slate/dist/index.js

10 lines
291 KiB
JavaScript
Raw Normal View History

2020-07-10 09:15:22 +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")),i={navigation:1,sidebar:2,modal:3,tooltip:4,header:5},a={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"},s={lvl1:"1rem",lvl2:"1.25rem",lvl3:"1.563rem",lvl4:"1.953em"},u={white:"#ffffff",foreground:"#f7f7f7",gray:"#e5e5e5",border:"#d8d8d8",darkGray:"#b2b2b2",black:"#2D2926",pitchBlack:"#0c0c0c",brand:"#2935ff",green:"#28a745",yellow:" #FFC940",red:"#ff0000"},l={foreground:u.white,ctaBackground:u.brand,pageBackground:u.foreground,pageText:u.black},c=Object.freeze({__proto__:null,sizes:{navigation:288,sidebar:416,header:72},zindex:i,font:a,typescale:s,system:u,theme:l});var d=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 f(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function h(e,t){return e(t={exports:{}},t.exports),t.exports}var m=h((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 v=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t};var y=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===e)return document.styleSheets[t]}(r);try{var i=105===e.charCodeAt(1)&&64===e.charCodeAt(0);o.insertRule(e,i?0:o.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'+e+'"',t)}}else r.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}();function g(e){function t(e,t,r){var o=t.trim().split(h);t=o;var i=o.length,a=e.length;switch(a){case 0:case 1:var s=0;for(e=0===a?"":e[0]+" ";s<i;++s)t[s]=n(e,t[s],r).trim();break;default:var u=s=0;for(t=[];s<i;++s)for(var l=0;l<a;++l)t[u++]=n(e[l]+" ",o[s],r).trim()}return t}function n(e,t,n){var r=t.charCodeAt(0);switch(33>r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0<t.indexOf("\f"))return t.replace(m,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function r(e,t,n,i){var a=e+";",s=2*t+3*n+4*i;if(944===s){e=a.indexOf(":",9)+1;var u=a.substring(e,a.length-1).trim();return u=a.substring(0,e).trim()+u+";",1===E||2===E&&o(u,1)?"-webkit-"+u+u:u}if(0===E||2===E&&!o(a,1))return a;switch(s){case 1015:r
//! moment.js
2020-07-10 09:15:22 +03:00
r.version="2.27.0",t=Dt,r.fn=yn,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=h,r.unix=function(e){return Dt(1e3*e)},r.months=function(e,t){return xn(e,t,"months")},r.isDate=c,r.locale=at,r.invalid=y,r.duration=Wt,r.isMoment=_,r.weekdays=function(e,t,n){return _n(e,t,n,"weekdays")},r.parseZone=function(){return Dt.apply(null,arguments).parseZone()},r.localeData=ut,r.isDuration=Nt,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=it(e))&&(o=r._config),t=E(o,t),null==r&&(t.abbr=e),(n=new P(t)).parentLocale=tt[e],tt[e]=n),at(e)}else null!=tt[e]&&(null!=tt[e].parentLocale?(tt[e]=tt[e].parentLocale,e===at()&&at(e)):null!=tt[e]&&delete tt[e]);return tt[e]},r.locales=function(){return O(tt)},r.weekdaysShort=function(e,t,n){return _n(e,t,n,"weekdaysShort")},r.normalizeUnits=F,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=yn,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}()})),An="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,Ln=function(){for(var e=["Edge","Trident","Firefox"],t=0;t<e.length;t+=1)if(An&&navigator.userAgent.indexOf(e[t])>=0)return 1;return 0}();var Yn=An&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),Ln))}};function In(e){return e&&"[object Function]"==={}.toString.call(e)}function zn(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function Bn(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function Fn(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=zn(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/(auto|scroll|overlay)/.test(n+o+r)?e:Fn(Bn(e))}function Wn(e){return e&&e.referenceNode?e.referenceNode:e}var Hn=An&&!(!window.MSInputMethodContext||!document.documentMode),Un=An&&/MSIE 10/.test(navigator.userAgent);function Gn(e){return 11===e?Hn:10===e?Un:Hn||Un}function Vn(e){if(!e)return document.documentElement;for(var t=Gn(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===zn(n,"position")?Vn(n):n:e?e.ownerDocument.documentElement:document.documentElement}function $n(e){return null!==e.parentNode?$n(e.parentNode):e}function Xn(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,o=n?t:e,i=document.createRange();i.setStart(r,0),i.setEnd(o,0);var a,s,u=i.commonAncestorContainer;if(e!==u&&t!==u||r.contains(o))return"BODY"===(s=(a=u).nodeName)||"HTML"!==s&&Vn(a.firstElementChild)!==a?Vn(u):u;var l=$n(e);return l.host?Xn(l.host,t):Xn(e,$n(t).host)}function qn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var o=e.ownerDocument.documentElement,i=e.ownerDocument.scrollingElement||o;return i[n]}return e[n]}fu
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
2020-07-10 09:15:22 +03:00
!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)&&o.length){var a=n.apply(null,o);a&&e.push(a)}else if("object"===i)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}()})),Ci=h((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."))}}));p(Ci);Ci.findInArray,Ci.isFunction,Ci.isNum,Ci.dontSetMe;var Mi=h((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 i=r();t.default=i}));p(Mi);Mi.getPrefix,Mi.browserPrefixToKey,Mi.browserPrefixToStyle;var Ei=h((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=l,t.matchesSelectorAndParentsTo=function(e,t,n){var r=e;do{if(l(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=a({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=a({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,Ci.int)(n.borderTopWidth),t+=(0,Ci.int)(n.borderBottomWidth)},t.outerWidth=function(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Ci.int)(n.borderLeftWidth),t+=(0,Ci.int)(n.borderRightWidth)},t.innerHeight=function(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Ci.int)(n.paddingTop),t-=(0,Ci.int)(n.paddingBottom)},t.innerWidth=function(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Ci.int)(n.paddingLeft),t-=(0,Ci.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,i=(e.clientY+t.scrollTop-r.top)/n;return{x:o,y:i}},t.createCSSTransform=function(e,t){var n=c(e,t,"px");return s({},(0,r.browserPrefixToKey)("transform",r.default),n)},t.createSVGTransform=function(e,t){return c(e,t,"")},t.getTranslation=c,t.getTouch=function(e,t){return e.targetTouches&&(0,Ci.findInArray)(e.targetTouches,(function(e){return t===e.identifier}))||e.changedTouches&&(0,Ci.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-