|
|
- !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=5)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),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,s.style.transitionDelay=e.hideDelayMs+"ms",s.style.transitionDuration=e.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.updateCaret=function(t){this._caretEl.style.top=t.top+"px",this._caretEl.style.left=t.left+"px",this._caretEl.style.height=t.height+"px",this._flagEl.style.top=t.top+"px",this._flagEl.style.left=t.left+"px"},t.prototype.updateSelection=function(t,e){var n=this;this._clearSelection(),t=t||[],Array.from(t).forEach(function(t){return n._addSelection(t,e)})},t.prototype._clearSelection=function(){this._selectionEl.innerHTML=null},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.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.FLAG_FLAP_CLASS="ql-cursor-flag-flap",t.NAME_CLASS="ql-cursor-name",t.HIDDEN_CLASS="hidden",t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.ContentRect=function(t){if("getBBox"in t){var e=t.getBBox();return Object.freeze({height:e.height,left:0,top:0,width:e.width})}var n=window.getComputedStyle(t);return Object.freeze({height:parseFloat(n.height||"0"),left:parseFloat(n.paddingLeft||"0"),top:parseFloat(n.paddingTop||"0"),width:parseFloat(n.width||"0")})}},function(t,e,n){var r=Array.prototype.slice,i=n(14),o=n(15),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.st
- /*!
- * RangeFix v0.2.5
- * 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(){var e,n,r,i,o,s,a,u;return void 0===t&&(n=document.createElement("p"),r=document.createElement("span"),i=document.createTextNode("aa"),o=document.createTextNode("aa"),(s=document.createElement("img")).setAttribute("src","#null"),a=document.createRange(),t={},n.appendChild(i),n.appendChild(r),r.appendChild(s),r.appendChild(o),document.body.appendChild(n),a.setStart(i,1),a.setEnd(r,0),t.getClientRects=t.getBoundingClientRect=a.getClientRects().length>1,t.getClientRects||(a.setEnd(o,1),t.getClientRects=t.getBoundingClientRect=a.getClientRects().length<3),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}function r(t){var e;return t?screen.deviceXDPI===screen.logicalXDPI?t:"length"in t?Array.prototype.map.call(t,r):(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 i(t,e){var n,r=0;if(1024>=e.length)return Array.prototype.push.apply(t,e);for(;r<e.length;)n=Array.prototype.push.apply(t,Array.prototype.slice.call(e,r,r+1024)),r+=1024;return n}return e.getClientRects=function(t){var e,o,s,a,u=n();if(u.ieZoom)return r(t.getClientRects());if(!u.getClientRects)return t.getClientRects();for(e=[],o=t.endContainer,s=t.endOffset,a=document.createRange();o!==t.commonAncestorContainer;)a.setStart(o,0),a.setEnd(o,s),i(e,a.getClientRects()),s=Array.prototype.indexOf.call(o.parentNode.childNodes,o),o=o.parentNode;return(a=t.cloneRange()).setEnd(o,s),i(e,a.getClientRects()),e},e.getBoundingClientRect=function(t){var e,i,o,s,a,u,l=this.getClientRects(t);if(0===l.length)return null;if(a=t.getBoundingClientRect(),(u=n()).ieZoom)return r(a);if(!u.getBoundingClientRect)return a;if(0===a.width&&0===a.height)return l[0];for(e=0,i=l.length;e<i;e++)s=l[e],o?(o.left=Math.min(o.left,s.left),o.top=Math.min(o.top,s.top),o.right=Math.max(o.right,s.right),o.bottom=Math.max(o.bottom,s.bottom)):o={left:s.left,top:s.top,right:s.right,bottom:s.bottom};return o&&(o.width=o.right-o.left,o.height=o.bottom-o.top),o},e})?r.call(e,n,e,t):r)||(t.exports=i)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i='\n <span class="'+r.default.SELECTION_CLASS+'"></span>\n <span class="'+r.default.CARET_CONTAINER_CLASS+'">\n <span class="'+r.default.CARET_CLASS+'"></span>\n </span>\n <div class="'+r.default.FLAG_CLASS+'">\n <small class="'+r.default.NAME_CLASS+'"></small>\n <span class="'+r.default.FLAG_FLAP_CLASS+'"></span>\n </div>\n';e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),i=n(12),o=[],s=function(){function t(t){this.$$observationTargets=[],this.$$activeTargets=[],this.$$skippedTargets=[];var e=function(t){if(void 0===t)return"Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.";if("function"!=typeof t)return"Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function."}(t);if(e)throw TypeError(e);this.$$callback=t,o.push(this)}return t.prototype.observe=function(t){var e=a("observe",t);if(e)throw TypeError(e);u(this.$$observationTargets,t)>0||(this.$$observationTargets.push(new r.ResizeObservation(t)),d())},t.prototype.unobserve=function(t){var e=a("unobserve",t);if(e)throw TypeError(e);var n=u(this.$$observationTargets,t);n<0||(this.$$observationTargets.splice(n,1),b())},t.prototype.disconnect=function(){this.$$observationTargets=[],this.$$activeTargets=[]},t}();function a(t,e){return void 0===e?"Failed to execute '"+t+"' on 'ResizeObserver': 1 argument required, but only 0 present.":e instanceof window.Element?void 0:"Failed to execute '"+t+"' on 'ResizeObserver': parameter 1 is not of type 'Element'."}function u(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1}e.ResizeObserver=s;var l,c=fu
|