slate/dist/index.js

10 lines
303 KiB
JavaScript
Raw Normal View History

2020-08-19 10:18:29 +03:00
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),n=e(t),r=require("@emotion/react"),o=e(require("react-dom")),a={navigation:1,sidebar:2,header:3,modal:4,tooltip:5},i={text:"'inter-regular', -apple-system, BlinkMacSystemFont, arial, sans-serif",semiBold:"'inter-semi-bold', -apple-system, BlinkMacSystemFont, arial, sans-serif",medium:"'inter-medium', -apple-system, BlinkMacSystemFont, arial, sans-serif",mono:"'mono', monaco, monospace",monoBold:"'mono-bold', monaco, monospace",monoCode:"'fira-code-regular', mono, monospace",monoCodeBold:"'fira-code-bold', mono-bold, monospace",code:"'jet-brains-regular', mono, monospace",codeBold:"'jet-brains-bold', mono, monospace"},s={lvl1:"1rem",lvl2:"1.25rem",lvl3:"1.563rem",lvl4:"1.953rem"},l={white:"#ffffff",foreground:"#f7f7f7",gray:"#e5e5e5",border:"#d8d8d8",darkGray:"#b2b2b2",black:"#1b1f23",pitchBlack:"#0c0c0c",brand:"#0047FF",link:"#2935ff",green:"#28a745",yellow:" #FFC940",red:"#ff0000"},c={foreground:l.white,ctaBackground:l.brand,pageBackground:l.foreground,pageText:l.black},u=Object.freeze({__proto__:null,values:{version:"0.1.0",sds:"0.1.0"},sizes:{mobile:768,navigation:288,sidebar:416,header:72},zindex:a,font:i,typescale:s,system:l,code:{},theme:c}),d=function(e){var t=e.name,n=e.detail,r=new CustomEvent(t,{detail:n});window.dispatchEvent(r)};var f=function(e){if(Array.isArray(e))return e};var p=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}return n}};var h=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r};var m=function(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}};var v=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};var g=function(e,t){return f(e)||p(e,t)||m(e,t)||v()};var y=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function b(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function w(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function x(e,t){return e(t={exports:{}},t.exports),t.exports}var _=x((function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t.apply(this,arguments)}e.exports=t}));var k=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t};var S=function(){function e(e){this.isSpeedy=void 0===e.speedy?"production"===process.env.NODE_ENV:e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode
//! moment.js
2020-08-19 09:18:37 +03:00
r.version="2.27.0",t=Ot,r.fn=gn,r.min=function(){var e=[].slice.call(arguments,0);return Et("isBefore",e)},r.max=function(){var e=[].slice.call(arguments,0);return Et("isAfter",e)},r.now=function(){return Date.now?Date.now():+new Date},r.utc=p,r.unix=function(e){return Ot(1e3*e)},r.months=function(e,t){return xn(e,t,"months")},r.isDate=u,r.locale=it,r.invalid=v,r.duration=Wt,r.isMoment=_,r.weekdays=function(e,t,n){return _n(e,t,n,"weekdays")},r.parseZone=function(){return Ot.apply(null,arguments).parseZone()},r.localeData=lt,r.isDuration=jt,r.monthsShort=function(e,t){return xn(e,t,"monthsShort")},r.weekdaysMin=function(e,t,n){return _n(e,t,n,"weekdaysMin")},r.defineLocale=st,r.updateLocale=function(e,t){if(null!=t){var n,r,o=et;null!=tt[e]&&null!=tt[e].parentLocale?tt[e].set(E(tt[e]._config,t)):(null!=(r=at(e))&&(o=r._config),t=E(o,t),null==r&&(t.abbr=e),(n=new R(t)).parentLocale=tt[e],tt[e]=n),it(e)}else null!=tt[e]&&(null!=tt[e].parentLocale?(tt[e]=tt[e].parentLocale,e===it()&&it(e)):null!=tt[e]&&delete tt[e]);return tt[e]},r.locales=function(){return C(tt)},r.weekdaysShort=function(e,t,n){return _n(e,t,n,"weekdaysShort")},r.normalizeUnits=B,r.relativeTimeRounding=function(e){return void 0===e?Vn:"function"==typeof e&&(Vn=e,!0)},r.relativeTimeThreshold=function(e,t){return void 0!==$n[e]&&(void 0===t?$n[e]:($n[e]=t,"s"===e&&($n.ss=t-1),!0))},r.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},r.prototype=gn,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()}));function is(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=tn(e);if(t){var o=tn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return en(this,n)}}function ss(){var e=y(["\n box-sizing: border-box;\n cursor: pointer;\n margin: 0 10px;\n\n :hover {\n color: ",";\n }\n"]);return ss=function(){return e},e}function ls(){var e=y(["\n box-sizing: border-box;\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n grid-template-rows: repeat(6, 40px);\n align-items: center;\n text-align: center;\n width: 100%;\n color: ",";\n margin: 5px 0;\n"]);return ls=function(){return e},e}function cs(){var e=y(["\n box-sizing: border-box;\n font-size: 0.9em;\n cursor: not-allowed;\n color: "," !important;\n"]);return cs=function(){return e},e}function us(){var e=y(["\n box-sizing: border-box;\n font-size: 0.9em;\n position: relative;\n cursor: pointer;\n\n :hover {\n color: ",' !important;\n }\n\n &:after {\n position: absolute;\n top: calc(50% - 15px);\n left: calc(50% - 15px);\n content: "";\n width: 30px;\n height: 30px;\n border-radius: 50%;\n border: 1px solid ',";\n }\n"]);return us=function(){return e},e}function ds(){var e=y(["\n box-sizing: border-box;\n font-size: 0.9em;\n cursor: pointer;\n\n :hover {\n color: "," !important;\n }\n"]);return ds=function(){return e},e}function fs(){var e=y(["\n box-sizing: border-box;\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n text-align: center;\n width: 100%;\n color: ",";\n margin: 10px 0;\n font-size: 0.9em;\n border-bottom: 1px solid ",";\n padding-bottom: 10px;\n"]);return fs=function(){return e},e}function ps(){var e=y(["\n box-sizing: border-box;\n text-align: center;\n font-size: ",";\n margin: 10px 0;\n"]);return ps=function(){return e},e}function hs(){var e=y(["\n box-sizing: border-box;\n display: grid;\n grid-template-columns: 30px 1fr 30px;\n align-items: center;\n"]);return hs=function(){return e},e}function ms(){var e=y(["\n box-sizing: bo
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
2020-08-19 09:18:37 +03:00
!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var a=typeof o;if("string"===a||"number"===a)e.push(o);else if(Array.isArray(o)&&o.length){var i=n.apply(null,o);i&&e.push(i)}else if("object"===a)for(var s in o)t.call(o,s)&&o[s]&&e.push(s)}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()})),kl=x((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.findInArray=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]},t.isFunction=function(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)},t.isNum=function(e){return"number"==typeof e&&!isNaN(e)},t.int=function(e){return parseInt(e,10)},t.dontSetMe=function(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}}));w(kl);kl.findInArray,kl.isFunction,kl.isNum,kl.dontSetMe;var Sl=x((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getPrefix=r,t.browserPrefixToKey=o,t.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},t.default=void 0;var n=["Moz","Webkit","O","ms"];function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window||void 0===window.document)return"";var t=window.document.documentElement.style;if(e in t)return"";for(var r=0;r<n.length;r++)if(o(e,n[r])in t)return n[r];return""}function o(e,t){return t?"".concat(t).concat(function(e){for(var t="",n=!0,r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):"-"===e[r]?n=!0:t+=e[r];return t}(e)):e}var a=r();t.default=a}));w(Sl);Sl.getPrefix,Sl.browserPrefixToKey,Sl.browserPrefixToStyle;var Cl=x((function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.matchesSelector=c,t.matchesSelectorAndParentsTo=function(e,t,n){var r=e;do{if(c(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1},t.addEvent=function(e,t,n,r){if(!e)return;var o=i({capture:!0},r);e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},t.removeEvent=function(e,t,n,r){if(!e)return;var o=i({capture:!0},r);e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},t.outerHeight=function(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,kl.int)(n.borderTopWidth),t+=(0,kl.int)(n.borderBottomWidth)},t.outerWidth=function(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,kl.int)(n.borderLeftWidth),t+=(0,kl.int)(n.borderRightWidth)},t.innerHeight=function(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,kl.int)(n.paddingTop),t-=(0,kl.int)(n.paddingBottom)},t.innerWidth=function(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,kl.int)(n.paddingLeft),t-=(0,kl.int)(n.paddingRight)},t.offsetXYFromParent=function(e,t,n){var r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-r.left)/n,a=(e.clientY+t.scrollTop-r.top)/n;return{x:o,y:a}},t.createCSSTransform=function(e,t){var n=u(e,t,"px");return s({},(0,r.browserPrefixToKey)("transform",r.default),n)},t.createSVGTransform=function(e,t){return u(e,t,"")},t.getTranslation=u,t.getTouch=function(e,t){return e.targetTouches&&(0,kl.findInArray)(e.targetTouches,(function(e){return t===e.identifier}))||e.changedTouches&&(0,kl.findInArray)(e.changedTouches,(function(e){return t===e.identifier}))},t.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},t.addUserSelectStyles=function(e){if(!e)return;var t=e.getElementById("react-draggable-style-