diff --git a/.gitignore b/.gitignore index 9fa983f..aa77055 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ coverage/ # Consumers will override this anyway, so don't bother committing package-lock.json yarn.lock +!/dist diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..12cc549 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,4 @@ +import QuillCursors from './quill-cursors/quill-cursors'; +import Cursor from './quill-cursors/cursor'; +import '../assets/quill-cursors.scss'; +export { QuillCursors as default, Cursor }; diff --git a/dist/quill-cursors.js b/dist/quill-cursors.js new file mode 100644 index 0000000..7be27a7 --- /dev/null +++ b/dist/quill-cursors.js @@ -0,0 +1,8 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.QuillCursors=e():t.QuillCursors=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(6),i=function(){function t(t,e,n){this.id=t,this.name=e,this.color=n}return t.prototype.build=function(e){var n=document.createElement(t.CONTAINER_ELEMENT_TAG);n.classList.add(t.CURSOR_CLASS),n.id="ql-cursor-"+this.id,n.innerHTML=e.template;var r=n.getElementsByClassName(t.SELECTION_CLASS)[0],i=n.getElementsByClassName(t.CARET_CONTAINER_CLASS)[0],o=i.getElementsByClassName(t.CARET_CLASS)[0],s=n.getElementsByClassName(t.FLAG_CLASS)[0];return s.style.backgroundColor=this.color,o.style.backgroundColor=this.color,n.getElementsByClassName(t.NAME_CLASS)[0].textContent=this.name,this._hideDelay=e.hideDelayMs+"ms",this._hideSpeedMs=e.hideSpeedMs,this._positionFlag=e.positionFlag,s.style.transitionDelay=this._hideDelay,s.style.transitionDuration=this._hideSpeedMs+"ms",this._el=n,this._selectionEl=r,this._caretEl=i,this._flagEl=s,this._el},t.prototype.show=function(){this._el.classList.remove(t.HIDDEN_CLASS)},t.prototype.hide=function(){this._el.classList.add(t.HIDDEN_CLASS)},t.prototype.remove=function(){this._el.parentNode.removeChild(this._el)},t.prototype.toggleFlag=function(e){var n=this;this._flagEl.classList.toggle(t.SHOW_FLAG_CLASS,e)||(this._flagEl.classList.add(t.NO_DELAY_CLASS),setTimeout((function(){return n._flagEl.classList.remove(t.NO_DELAY_CLASS)}),this._hideSpeedMs))},t.prototype.updateCaret=function(t,e){this._caretEl.style.top=t.top+"px",this._caretEl.style.left=t.left+"px",this._caretEl.style.height=t.height+"px",this._positionFlag?this._positionFlag(this._flagEl,t,e):this._updateCaretFlag(t,e)},t.prototype.updateSelection=function(t,e){var n=this;this._clearSelection(),t=t||[],t=Array.from(t),t=this._sanitize(t),(t=this._sortByDomPosition(t)).forEach((function(t){return n._addSelection(t,e)}))},t.prototype._updateCaretFlag=function(e,n){this._flagEl.style.width="";var r=this._flagEl.getBoundingClientRect();this._flagEl.classList.remove(t.FLAG_FLIPPED_CLASS),e.left>n.width-r.width&&this._flagEl.classList.add(t.FLAG_FLIPPED_CLASS),this._flagEl.style.left=e.left+"px",this._flagEl.style.top=e.top+"px",this._flagEl.style.width=Math.ceil(r.width)+"px"},t.prototype._clearSelection=function(){this._selectionEl.innerHTML=""},t.prototype._addSelection=function(t,e){var n=this._selectionBlock(t,e);this._selectionEl.appendChild(n)},t.prototype._selectionBlock=function(e,n){var i=document.createElement(t.SELECTION_ELEMENT_TAG);return i.classList.add(t.SELECTION_BLOCK_CLASS),i.style.top=e.top-n.top+"px",i.style.left=e.left-n.left+"px",i.style.width=e.width+"px",i.style.height=e.height+"px",i.style.backgroundColor=r(this.color).setAlpha(.3).toString(),i},t.prototype._sortByDomPosition=function(t){return t.sort((function(t,e){return t.top===e.top?t.left-e.left:t.top-e.top}))},t.prototype._sanitize=function(t){var e=this,n=new Set;return t.filter((function(t){if(!t.width||!t.height)return!1;var r=e._serialize(t);return!n.has(r)&&(n.add(r),!0)}))},t.prototype._serialize=function(t){return["top:"+t.top,"right:"+t.right,"bottom:"+t.bottom,"left:"+t.left].join(";")},t.CONTAINER_ELEMENT_TAG="SPAN",t.SELECTION_ELEMENT_TAG="SPAN",t.CURSOR_CLASS="ql-cursor",t.SELECTION_CLASS="ql-cursor-selections",t.SELECTION_BLOCK_CLASS="ql-cursor-selection-block",t.CARET_CLASS="ql-cursor-caret",t.CARET_CONTAINER_CLASS="ql-cursor-caret-container",t.FLAG_CLASS="ql-cursor-flag",t.SHOW_FLAG_CLASS="show-flag",t.FLAG_FLIPPED_CLASS="flag-flipped",t.NAME_CLASS="ql-cursor-name",t.HIDDEN_CLASS="hidden",t.NO_DELAY_CLASS="no-delay",t}();e.default=i},function(t,e,n){var r=Array.prototype.slice,i=n(12),o=n(13),s=t.exports=function(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?t===e:t==e:function(t,e,n){var l,c;if(a(t)||a(e))return!1;if(t.prototype!==e.prototype)return!1;if(o(t))return!!o(e)&&(t=r.call(t),e=r.call(e),s(t,e,n));if(u(t)){if(!u(e))return!1;if(t.length!==e.length)return!1;for(l=0;l=0;l--)if(f[l]!=h[l])return!1;for(l=f.length-1;l>=0;l--)if(c=f[l],!s(t[c],e[c],n))return!1;return typeof t==typeof e}(t,e,n))};function a(t){return null==t}function u(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}},function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===i.call(t)},u=function(t){if(!t||"[object Object]"!==i.call(t))return!1;var e,n=r.call(t,"constructor"),o=t.constructor&&t.constructor.prototype&&r.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!o)return!1;for(e in t);return void 0===e||r.call(t,e)},l=function(t,e){o&&"__proto__"===e.name?o(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},c=function(t,e){if("__proto__"===e){if(!r.call(t,e))return;if(s)return s(t,e).value}return t[e]};t.exports=function t(){var e,n,r,i,o,s,f=arguments[0],h=1,p=arguments.length,d=!1;for("boolean"==typeof f&&(d=f,f=arguments[1]||{},h=2),(null==f||"object"!=typeof f&&"function"!=typeof f)&&(f={});h=0},t.prototype._handleTextChange=function(t){var e=this;window.setTimeout((function(){e._options.transformOnTextChange&&e._transformCursors(t),e._options.selectionChangeSource&&(e._emitSelection(),e.update())}))},t.prototype._emitSelection=function(){this._quill.emitter.emit(this._quill.constructor.events.SELECTION_CHANGE,this._quill.getSelection(),this._currentSelection,this._options.selectionChangeSource)},t.prototype._setDefaults=function(t){return(t=Object.assign({},t)).template=t.template||a.default,t.containerClass=t.containerClass||"ql-cursors",null!==t.selectionChangeSource&&(t.selectionChangeSource=t.selectionChangeSource||this._quill.constructor.sources.API),t.hideDelayMs=Number.isInteger(t.hideDelayMs)?t.hideDelayMs:3e3,t.hideSpeedMs=Number.isInteger(t.hideSpeedMs)?t.hideSpeedMs:400,t.transformOnTextChange=!!t.transformOnTextChange,t},t.prototype._lineRanges=function(t,e,n){var r=this._quill.getLines(t.range);return r.reduce((function(t,i,o){if(!i.children){var s=document.createRange();return s.selectNode(i.domNode),t.concat(s)}var a=0===o?e:i.path(0).pop(),u=a[0],l=a[1],c=o===r.length-1?n:i.path(i.length()-1).pop(),f=c[0],h=c[1],p=document.createRange();return u.domNode.nodeType===Node.TEXT_NODE?p.setStart(u.domNode,l):p.setStartBefore(u.domNode),f.domNode.nodeType===Node.TEXT_NODE?p.setEnd(f.domNode,h):p.setEndAfter(f.domNode),t.concat(p)}),[])},t.prototype._transformCursors=function(t){var e=this;t=new l(t),this.cursors().filter((function(t){return t.range})).forEach((function(n){n.range.index=t.transformPosition(n.range.index),e._updateCursor(n)}))},t}();e.default=c},function(t,e,n){var r;!function(i){var o=/^\s+/,s=/\s+$/,a=0,u=i.round,l=i.min,c=i.max,f=i.random;function h(t,e){if(e=e||{},(t=t||"")instanceof h)return t;if(!(this instanceof h))return new h(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,r=null,a=null,u=null,f=!1,h=!1;"string"==typeof t&&(t=function(t){t=t.replace(o,"").replace(s,"").toLowerCase();var e,n=!1;if(M[t])t=M[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=G.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=G.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=G.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=G.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=G.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=G.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=G.hex8.exec(t))return{r:q(e[1]),g:q(e[2]),b:q(e[3]),a:H(e[4]),format:n?"name":"hex8"};if(e=G.hex6.exec(t))return{r:q(e[1]),g:q(e[2]),b:q(e[3]),format:n?"name":"hex"};if(e=G.hex4.exec(t))return{r:q(e[1]+""+e[1]),g:q(e[2]+""+e[2]),b:q(e[3]+""+e[3]),a:H(e[4]+""+e[4]),format:n?"name":"hex8"};if(e=G.hex3.exec(t))return{r:q(e[1]+""+e[1]),g:q(e[2]+""+e[2]),b:q(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==typeof t&&(U(t.r)&&U(t.g)&&U(t.b)?(p=t.r,d=t.g,g=t.b,e={r:255*N(p,255),g:255*N(d,255),b:255*N(g,255)},f=!0,h="%"===String(t.r).substr(-1)?"prgb":"rgb"):U(t.h)&&U(t.s)&&U(t.v)?(r=F(t.s),a=F(t.v),e=function(t,e,n){t=6*N(t,360),e=N(e,100),n=N(n,100);var r=i.floor(t),o=t-r,s=n*(1-e),a=n*(1-o*e),u=n*(1-(1-o)*e),l=r%6;return{r:255*[n,a,s,s,u,n][l],g:255*[u,n,n,a,s,s][l],b:255*[s,s,u,n,n,a][l]}}(t.h,r,a),f=!0,h="hsv"):U(t.h)&&U(t.s)&&U(t.l)&&(r=F(t.s),u=F(t.l),e=function(t,e,n){var r,i,o;function s(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=N(t,360),e=N(e,100),n=N(n,100),0===e)r=i=o=n;else{var a=n<.5?n*(1+e):n+e-n*e,u=2*n-a;r=s(u,a,t+1/3),i=s(u,a,t),o=s(u,a,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,r,u),f=!0,h="hsl"),t.hasOwnProperty("a")&&(n=t.a));var p,d,g;return n=T(n),{ok:f,format:t.format||h,r:l(255,c(e.r,0)),g:l(255,c(e.g,0)),b:l(255,c(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=u(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=u(this._r)),this._g<1&&(this._g=u(this._g)),this._b<1&&(this._b=u(this._b)),this._ok=n.ok,this._tc_id=a++}function p(t,e,n){t=N(t,255),e=N(e,255),n=N(n,255);var r,i,o=c(t,e,n),s=l(t,e,n),a=(o+s)/2;if(o==s)r=i=0;else{var u=o-s;switch(i=a>.5?u/(2-o-s):u/(o+s),o){case t:r=(e-n)/u+(e>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(h(r));return o}function k(t,e){e=e||6;for(var n=h(t).toHsv(),r=n.h,i=n.s,o=n.v,s=[],a=1/e;e--;)s.push(h({h:r,s:i,v:o})),o=(o+a)%1;return s}h.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,r=this.toRgb();return t=r.r/255,e=r.g/255,n=r.b/255,.2126*(t<=.03928?t/12.92:i.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:i.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:i.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=T(t),this._roundA=u(100*this._a)/100,this},toHsv:function(){var t=d(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=d(this._r,this._g,this._b),e=u(360*t.h),n=u(100*t.s),r=u(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=p(this._r,this._g,this._b),e=u(360*t.h),n=u(100*t.s),r=u(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return g(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var o=[D(u(t).toString(16)),D(u(e).toString(16)),D(u(n).toString(16)),D(I(r))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:u(this._r),g:u(this._g),b:u(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+u(this._r)+", "+u(this._g)+", "+u(this._b)+")":"rgba("+u(this._r)+", "+u(this._g)+", "+u(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:u(100*N(this._r,255))+"%",g:u(100*N(this._g,255))+"%",b:u(100*N(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+u(100*N(this._r,255))+"%, "+u(100*N(this._g,255))+"%, "+u(100*N(this._b,255))+"%)":"rgba("+u(100*N(this._r,255))+"%, "+u(100*N(this._g,255))+"%, "+u(100*N(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(R[g(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+b(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=h(t);n="#"+b(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return h(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(A,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(_,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(C,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(L,arguments)},complement:function(){return this._applyCombination(w,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(O,arguments)},triad:function(){return this._applyCombination(S,arguments)},tetrad:function(){return this._applyCombination(E,arguments)}},h.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:F(t[r]));t=n}return h(t,e)},h.equals=function(t,e){return!(!t||!e)&&h(t).toRgbString()==h(e).toRgbString()},h.random=function(){return h.fromRatio({r:f(),g:f(),b:f()})},h.mix=function(t,e,n){n=0===n?0:n||50;var r=h(t).toRgb(),i=h(e).toRgb(),o=n/100;return h({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},h.readability=function(t,e){var n=h(t),r=h(e);return(i.max(n.getLuminance(),r.getLuminance())+.05)/(i.min(n.getLuminance(),r.getLuminance())+.05)},h.isReadable=function(t,e,n){var r,i,o=h.readability(t,e);switch(i=!1,(r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},h.mostReadable=function(t,e,n){var r,i,o,s,a=null,u=0;i=(n=n||{}).includeFallbackColors,o=n.level,s=n.size;for(var l=0;lu&&(u=r,a=h(e[l]));return h.isReadable(t,a,{level:o,size:s})||!i?a:(n.includeFallbackColors=!1,h.mostReadable(t,["#fff","#000"],n))};var M=h.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},R=h.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(M);function T(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function N(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=l(e,c(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),i.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function j(t){return l(1,c(0,t))}function q(t){return parseInt(t,16)}function D(t){return 1==t.length?"0"+t:""+t}function F(t){return t<=1&&(t=100*t+"%"),t}function I(t){return i.round(255*parseFloat(t)).toString(16)}function H(t){return q(t)/255}var P,B,z,G=(B="[\\s|\\(]+("+(P="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+P+")[,|\\s]+("+P+")\\s*\\)?",z="[\\s|\\(]+("+P+")[,|\\s]+("+P+")[,|\\s]+("+P+")[,|\\s]+("+P+")\\s*\\)?",{CSS_UNIT:new RegExp(P),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+z),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+z),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+z),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(t){return!!G.CSS_UNIT.exec(t)}t.exports?t.exports=h:void 0===(r=function(){return h}.call(e,n,e,t))||(t.exports=r)}(Math)},function(t,e,n){var r,i; +/*! + * RangeFix v0.2.8 + * https://github.com/edg2s/rangefix + * + * Copyright 2014-17 Ed Sanders. + * Released under the MIT license + */void 0===(i="function"==typeof(r=function(){var t,e={};function n(t){var e;return t?screen.deviceXDPI===screen.logicalXDPI?t:"length"in t?Array.prototype.map.call(t,n):(e=screen.deviceXDPI/screen.logicalXDPI,{top:t.top/e,bottom:t.bottom/e,left:t.left/e,right:t.right/e,width:t.width/e,height:t.height/e}):t}function r(t,e){var n,r=0;if(1024>=e.length)return Array.prototype.push.apply(t,e);for(;r1,t.getClientRects||(a.setEnd(o,1),t.getClientRects=t.getBoundingClientRect=2===a.getClientRects().length),t.getBoundingClientRect||(a.setEnd(a.startContainer,a.startOffset),e=a.getBoundingClientRect(),t.getBoundingClientRect=0===e.top&&0===e.left),document.body.removeChild(n),u=window.ActiveXObject&&new Function("/*@cc_on return @_jscript_version; @*/")(),t.ieZoom=!!u&&u<=10),t},e.getClientRects=function(t){var e,i,o,s,a,u=this.isBroken();if(u.ieZoom)return n(t.getClientRects());if(!u.getClientRects)return t.getClientRects();for(e=[],o=[],i=t.endContainer,s=t.endOffset,a=document.createRange();i!==t.commonAncestorContainer;)a.setStart(i,0),a.setEnd(i,s),r(o,a.getClientRects()),s=Array.prototype.indexOf.call(i.parentNode.childNodes,i),i=i.parentNode;return(a=t.cloneRange()).setEnd(i,s),r(e,a.getClientRects()),r(e,o),e},e.getBoundingClientRect=function(t){var e,r,i,o,s,a,u=this.getClientRects(t);if(0===u.length)return null;if(s=t.getBoundingClientRect(),(a=this.isBroken()).ieZoom)return n(s);if(!a.getBoundingClientRect)return s;if(0===s.width&&0===s.height)return u[0];for(e=0,r=u.length;e\n \n \n \n
\n \n
\n';e.default=o},function(t,e,n){"use strict";n.r(e),function(t){var n=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,r){return t[0]===e&&(n=r,!0)})),n}return(function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n0},t.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),a?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;s.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),l=function(t,e){for(var n=0,r=Object.keys(e);n0},t}(),A="undefined"!=typeof WeakMap?new WeakMap:new n,x=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=u.getInstance(),r=new m(e,n,this);A.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){x.prototype[t]=function(){var e;return(e=A.get(this))[t].apply(e,arguments)}}));var C=void 0!==i.ResizeObserver?i.ResizeObserver:x;e.default=C}.call(this,n(10))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=r(n(1)),o=r(n(2)),s=r(n(14)),a=r(n(15)),u=r(n(3)),l=String.fromCharCode(0),c=function(){function t(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]}return t.prototype.insert=function(t,e){var n={};return"string"==typeof t&&0===t.length?this:(n.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))},t.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},t.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},t.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=o.default(!0,{},t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,"object"!=typeof(n=this.ops[e-1])))return this.ops.unshift(t),this;if(i.default(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},t.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},t.prototype.filter=function(t){return this.ops.filter(t)},t.prototype.forEach=function(t){this.ops.forEach(t)},t.prototype.map=function(t){return this.ops.map(t)},t.prototype.partition=function(t){var e=[],n=[];return this.forEach((function(r){(t(r)?e:n).push(r)})),[e,n]},t.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},t.prototype.changeLength=function(){return this.reduce((function(t,e){return e.insert?t+u.default.length(e):e.delete?t-e.delete:t}),0)},t.prototype.length=function(){return this.reduce((function(t,e){return t+u.default.length(e)}),0)},t.prototype.slice=function(e,n){void 0===e&&(e=0),void 0===n&&(n=1/0);for(var r=[],i=u.default.iterator(this.ops),o=0;o0&&r.next(s.retain-l)}for(var c=new t(o);n.hasNext()||r.hasNext();)if("insert"===r.peekType())c.push(r.next());else if("delete"===n.peekType())c.push(n.next());else{var f=Math.min(n.peekLength(),r.peekLength()),h=n.next(f),p=r.next(f);if("number"==typeof p.retain){var d={};"number"==typeof h.retain?d.retain=f:d.insert=h.insert;var g=a.default.compose(h.attributes,p.attributes,"number"==typeof h.retain);if(g&&(d.attributes=g),c.push(d),!r.hasNext()&&i.default(c.ops[c.ops.length-1],d)){var b=new t(n.rest());return c.concat(b).chop()}}else"number"==typeof p.delete&&"number"==typeof h.retain&&c.push(p)}return c.chop()},t.prototype.concat=function(e){var n=new t(this.ops.slice());return e.ops.length>0&&(n.push(e.ops[0]),n.ops=n.ops.concat(e.ops.slice(1))),n},t.prototype.diff=function(e,n){if(this.ops===e.ops)return new t;var r=[this,e].map((function(t){return t.map((function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:l;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")})).join("")})),o=new t,c=s.default(r[0],r[1],n),f=u.default.iterator(this.ops),h=u.default.iterator(e.ops);return c.forEach((function(t){for(var e=t[1].length;e>0;){var n=0;switch(t[0]){case s.default.INSERT:n=Math.min(h.peekLength(),e),o.push(h.next(n));break;case s.default.DELETE:n=Math.min(e,f.peekLength()),f.next(n),o.delete(n);break;case s.default.EQUAL:n=Math.min(f.peekLength(),h.peekLength(),e);var r=f.next(n),u=h.next(n);i.default(r.insert,u.insert)?o.retain(n,a.default.diff(r.attributes,u.attributes)):o.push(u).delete(n)}e-=n}})),o.chop()},t.prototype.eachLine=function(e,n){void 0===n&&(n="\n");for(var r=u.default.iterator(this.ops),i=new t,o=0;r.hasNext();){if("insert"!==r.peekType())return;var s=r.peek(),a=u.default.length(s)-r.peekLength(),l="string"==typeof s.insert?s.insert.indexOf(n,a)-a:-1;if(l<0)i.push(r.next());else if(l>0)i.push(r.next(l));else{if(!1===e(i,r.next(1).attributes||{},o))return;o+=1,i=new t}}i.length()>0&&e(i,{},o)},t.prototype.invert=function(e){var n=new t;return this.reduce((function(t,r){if(r.insert)n.delete(u.default.length(r));else{if(r.retain&&null==r.attributes)return n.retain(r.retain),t+r.retain;if(r.delete||r.retain&&r.attributes){var i=r.delete||r.retain;return e.slice(t,t+i).forEach((function(t){r.delete?n.push(t):r.retain&&r.attributes&&n.retain(u.default.length(t),a.default.invert(r.attributes,t.attributes))})),t+i}}return t}),0),n.chop()},t.prototype.transform=function(e,n){if(void 0===n&&(n=!1),n=!!n,"number"==typeof e)return this.transformPosition(e,n);for(var r=e,i=u.default.iterator(this.ops),o=u.default.iterator(r.ops),s=new t;i.hasNext()||o.hasNext();)if("insert"!==i.peekType()||!n&&"insert"===o.peekType())if("insert"===o.peekType())s.push(o.next());else{var l=Math.min(i.peekLength(),o.peekLength()),c=i.next(l),f=o.next(l);if(c.delete)continue;f.delete?s.push(f):s.retain(l,a.default.transform(c.attributes,f.attributes,n))}else s.retain(u.default.length(i.next()));return s.chop()},t.prototype.transformPosition=function(t,e){void 0===e&&(e=!1),e=!!e;for(var n=u.default.iterator(this.ops),r=0;n.hasNext()&&r<=t;){var i=n.peekLength(),o=n.peekType();n.next(),"delete"!==o?("insert"===o&&(rs)){var p=e.slice(0,h);if((m=e.slice(h))===l){var d=Math.min(a,h),g=u.slice(0,d),b=p.slice(0,d);if(g===b){var _=u.slice(d),v=p.slice(d);return c(g,_,v,l)}}}if(null===f||f===a){var y=a,m=(p=e.slice(0,y),e.slice(y));if(p===u){var A=Math.min(o-y,s-y),x=l.slice(l.length-A),C=m.slice(m.length-A);if(x===C){_=l.slice(0,l.length-A),v=m.slice(0,m.length-A);return c(u,_,v,x)}}}}if(r.length>0&&i&&0===i.length){g=t.slice(0,r.index),x=t.slice(r.index+r.length),d=g.length,A=x.length;if(!(se.length?t:e,u=t.length>e.length?e:t,l=a.indexOf(u);if(-1!==l)return s=[[1,a.substring(0,l)],[0,u],[1,a.substring(l+u.length)]],t.length>e.length&&(s[0][0]=s[2][0]=-1),s;if(1===u.length)return[[-1,t],[1,e]];var c=function(t,e){var n=t.length>e.length?t:e,r=t.length>e.length?e:t;if(n.length<4||2*r.length=t.length?[r,s,a,u,f]:null}var a,u,l,c,f,h=s(n,r,Math.ceil(n.length/4)),p=s(n,r,Math.ceil(n.length/2));if(!h&&!p)return null;a=p?h&&h[4].length>p[4].length?h:p:h;t.length>e.length?(u=a[0],l=a[1],c=a[2],f=a[3]):(c=a[0],f=a[1],u=a[2],l=a[3]);var d=a[4];return[u,l,c,f,d]}(t,e);if(c){var f=c[0],h=c[1],p=c[2],d=c[3],g=c[4],b=n(f,p),_=n(h,d);return b.concat([[0,g]],_)}return function(t,e){for(var n=t.length,i=e.length,o=Math.ceil((n+i)/2),s=o,a=2*o,u=new Array(a),l=new Array(a),c=0;cn)d+=2;else if(m>i)p+=2;else if(h){if((C=s+f-v)>=0&&C=A)return r(t,e,S,m)}}}for(var x=-_+g;x<=_-b;x+=2){for(var C=s+x,w=(A=x===-_||x!==_&&l[C-1]n)b+=2;else if(w>i)g+=2;else if(!h){if((y=s+f-x)>=0&&y=(A=n-A))return r(t,e,S,m)}}}}return[[-1,t],[1,e]]}(t,e)}(t=t.substring(0,t.length-h),e=e.substring(0,e.length-h));return p&&g.unshift([0,p]),d&&g.push([0,d]),function t(e,n){e.push([0,""]);var r,s=0,a=0,c=0,f="",h="";for(;s=0&&l(e[p][1])){var d=e[p][1].slice(-1);if(e[p][1]=e[p][1].slice(0,-1),f=d+f,h=d+h,!e[p][1]){e.splice(p,1),s--;var g=p-1;e[g]&&1===e[g][0]&&(c++,h=e[g][1]+h,g--),e[g]&&-1===e[g][0]&&(a++,f=e[g][1]+f,g--),p=g}}if(u(e[s][1])){d=e[s][1].charAt(0);e[s][1]=e[s][1].slice(1),f+=d,h+=d}}if(s0||h.length>0){f.length>0&&h.length>0&&(0!==(r=i(h,f))&&(p>=0?e[p][1]+=h.substring(0,r):(e.splice(0,0,[0,h.substring(0,r)]),s++),h=h.substring(r),f=f.substring(r)),0!==(r=o(h,f))&&(e[s][1]=h.substring(h.length-r)+e[s][1],h=h.substring(0,h.length-r),f=f.substring(0,f.length-r)));var b=c+a;0===f.length&&0===h.length?(e.splice(s-b,b),s-=b):0===f.length?(e.splice(s-b,b,[1,h]),s=s-b+1):0===h.length?(e.splice(s-b,b,[-1,f]),s=s-b+1):(e.splice(s-b,b,[-1,f],[1,h]),s=s-b+2)}0!==s&&0===e[s-1][0]?(e[s-1][1]+=e[s][1],e.splice(s,1)):s++,c=0,a=0,f="",h=""}""===e[e.length-1][1]&&e.pop();var _=!1;s=1;for(;s=55296&&t<=56319}function a(t){return t>=56320&&t<=57343}function u(t){return a(t.charCodeAt(0))}function l(t){return s(t.charCodeAt(t.length-1))}function c(t,e,n,r){return l(t)||u(r)?null:function(t){for(var e=[],n=0;n0&&e.push(t[n]);return e}([[0,t],[-1,e],[1,n],[0,r]])}function f(t,e,r){return n(t,e,r,!0)}f.INSERT=1,f.DELETE=-1,f.EQUAL=0,t.exports=f},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i,o=r(n(1)),s=r(n(2));!function(t){t.compose=function(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var r=s.default(!0,{},e);for(var i in n||(r=Object.keys(r).reduce((function(t,e){return null!=r[e]&&(t[e]=r[e]),t}),{})),t)void 0!==t[i]&&void 0===e[i]&&(r[i]=t[i]);return Object.keys(r).length>0?r:void 0},t.diff=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var n=Object.keys(t).concat(Object.keys(e)).reduce((function(n,r){return o.default(t[r],e[r])||(n[r]=void 0===e[r]?null:e[r]),n}),{});return Object.keys(n).length>0?n:void 0},t.invert=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),t=t||{};var n=Object.keys(e).reduce((function(n,r){return e[r]!==t[r]&&void 0!==t[r]&&(n[r]=e[r]),n}),{});return Object.keys(t).reduce((function(n,r){return t[r]!==e[r]&&void 0===e[r]&&(n[r]=null),n}),n)},t.transform=function(t,e,n){if(void 0===n&&(n=!1),"object"!=typeof t)return e;if("object"==typeof e){if(!n)return e;var r=Object.keys(e).reduce((function(n,r){return void 0===t[r]&&(n[r]=e[r]),n}),{});return Object.keys(r).length>0?r:void 0}}}(i||(i={})),e.default=i},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(3)),o=function(){function t(t){this.ops=t,this.index=0,this.offset=0}return t.prototype.hasNext=function(){return this.peekLength()<1/0},t.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var n=this.offset,r=i.default.length(e);if(t>=r-n?(t=r-n,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),"number"==typeof e.retain?o.retain=t:"string"==typeof e.insert?o.insert=e.insert.substr(n,t):o.insert=e.insert,o}return{retain:1/0}},t.prototype.peek=function(){return this.ops[this.index]},t.prototype.peekLength=function(){return this.ops[this.index]?i.default.length(this.ops[this.index])-this.offset:1/0},t.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},t.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=t,this.index=e,[n].concat(r)}return[]},t}();e.default=o},function(t,e,n){var r=n(18),i=n(19);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.i,i,""]]);var o={insert:"head",singleton:!1},s=(r(t.i,i,o),i.locals?i.locals:{});t.exports=s},function(t,e,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),s={};function a(t,e,n){for(var r=0;r void; +} diff --git a/dist/quill-cursors/i-range.d.ts b/dist/quill-cursors/i-range.d.ts new file mode 100644 index 0000000..accef34 --- /dev/null +++ b/dist/quill-cursors/i-range.d.ts @@ -0,0 +1,4 @@ +export default interface IQuillRange { + index: number; + length: number; +} diff --git a/dist/quill-cursors/quill-cursors.d.ts b/dist/quill-cursors/quill-cursors.d.ts new file mode 100644 index 0000000..ba60234 --- /dev/null +++ b/dist/quill-cursors/quill-cursors.d.ts @@ -0,0 +1,30 @@ +import IQuillCursorsOptions from './i-quill-cursors-options'; +import Cursor from './cursor'; +import IQuillRange from './i-range'; +export default class QuillCursors { + private readonly _cursors; + private readonly _quill; + private readonly _container; + private readonly _boundsContainer; + private readonly _options; + private _currentSelection; + constructor(quill: any, options?: IQuillCursorsOptions); + createCursor(id: string, name: string, color: string): Cursor; + moveCursor(id: string, range: IQuillRange): void; + removeCursor(id: string): void; + update(): void; + clearCursors(): void; + toggleFlag(id: string, shouldShow?: boolean): void; + cursors(): Cursor[]; + private _registerSelectionChangeListeners; + private _registerTextChangeListener; + private _registerDomListeners; + private _updateCursor; + private _indexWithinQuillBounds; + private _leafIsValid; + private _handleTextChange; + private _emitSelection; + private _setDefaults; + private _lineRanges; + private _transformCursors; +} diff --git a/dist/quill-cursors/template.d.ts b/dist/quill-cursors/template.d.ts new file mode 100644 index 0000000..4dfe6ea --- /dev/null +++ b/dist/quill-cursors/template.d.ts @@ -0,0 +1,2 @@ +declare const template: string; +export default template;