@yoopta/link 4.8.1 → 4.8.3-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/commands/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAmB,QAAQ,EAAoB,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEzD,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;CAC3C,CAAC;AAEF,KAAK,iBAAiB,GAAG,kBAAkB,GAAG;IAC5C,SAAS,EAAE,QAAQ,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAmB,QAAQ,EAAoB,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEzD,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;CAC3C,CAAC;AAEF,KAAK,iBAAiB,GAAG,kBAAkB,GAAG;IAC5C,SAAS,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACjC,KAAK,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,iBAAiB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,WAAW,CAAC;IACnF,UAAU,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACpE,UAAU,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;CACxE,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,YAgF1B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,26 +6,26 @@ import{generateId as e,useYooptaEditor as t,useYooptaTools as n,UI as r,Elements
|
|
|
6
6
|
* Released under the MIT License.
|
|
7
7
|
*/function w(e){return"[object Object]"===Object.prototype.toString.call(e)}function x(e){var t,n;return!1!==w(e)&&(void 0===(t=e.constructor)||!1!==w(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}var O=Symbol.for("immer-nothing"),_=Symbol.for("immer-draftable"),P=Symbol.for("immer-state");function k(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var j=Object.getPrototypeOf;function E(e){return!!e&&!!e[P]}function S(e){return!!e&&(A(e)||Array.isArray(e)||!!e[_]||!!e.constructor?.[_]||D(e)||z(e))}var R=Object.prototype.constructor.toString();function A(e){if(!e||"object"!=typeof e)return!1;const t=j(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===R}function T(e,t){0===C(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function C(e){const t=e[P];return t?t.type_:Array.isArray(e)?1:D(e)?2:z(e)?3:0}function N(e,t){return 2===C(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function L(e,t,n){const r=C(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function D(e){return e instanceof Map}function z(e){return e instanceof Set}function M(e){return e.copy_||e.base_}function F(e,t){if(D(e))return new Map(e);if(z(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&A(e)){if(!j(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[P];let r=Reflect.ownKeys(n);for(let t=0;t<r.length;t++){const o=r[t],i=n[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(j(e),n)}function B(e,t=!1){return W(e)||E(e)||!S(e)||(C(e)>1&&(e.set=e.add=e.clear=e.delete=q),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>B(t,!0)))),e}function q(){k(2)}function W(e){return Object.isFrozen(e)}var V,I={};function H(e){const t=I[e];return t||k(0),t}function $(){return V}function Z(e,t){t&&(H("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function J(e){K(e),e.drafts_.forEach(X),e.drafts_=null}function K(e){e===V&&(V=e.parent_)}function U(e){return V={drafts_:[],parent_:V,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function X(e){const t=e[P];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Y(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[P].modified_&&(J(t),k(4)),S(e)&&(e=G(t,e),t.parent_||ee(t,e)),t.patches_&&H("Patches").generateReplacementPatches_(n[P].base_,e,t.patches_,t.inversePatches_)):e=G(t,n,[]),J(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==O?e:void 0}function G(e,t,n){if(W(t))return t;const r=t[P];if(!r)return T(t,((o,i)=>Q(e,r,t,o,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return ee(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let o=t,i=!1;3===r.type_&&(o=new Set(t),t.clear(),i=!0),T(o,((o,s)=>Q(e,r,t,o,s,n,i))),ee(e,t,!1),n&&e.patches_&&H("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Q(e,t,n,r,o,i,s){if(E(o)){const s=G(e,o,i&&t&&3!==t.type_&&!N(t.assigned_,r)?i.concat(r):void 0);if(L(n,r,s),!E(s))return;e.canAutoFreeze_=!1}else s&&n.add(o);if(S(o)&&!W(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;G(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||ee(e,o)}}function ee(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&B(t,n)}var te={get(e,t){if(t===P)return e;const n=M(e);if(!N(n,t))return function(e,t,n){const r=oe(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!S(r)?r:r===re(e.base_,t)?(se(e),e.copy_[t]=ae(r,e)):r},has:(e,t)=>t in M(e),ownKeys:e=>Reflect.ownKeys(M(e)),set(e,t,n){const r=oe(M(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=re(M(e),t),s=r?.[P];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==n||N(e.base_,t)))return!0;se(e),ie(e)}var o,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==re(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,se(e),ie(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=M(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){k(11)},getPrototypeOf:e=>j(e.base_),setPrototypeOf(){k(12)}},ne={};function re(e,t){const n=e[P];return(n?M(n):e)[t]}function oe(e,t){if(!(t in e))return;let n=j(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=j(n)}}function ie(e){e.modified_||(e.modified_=!0,e.parent_&&ie(e.parent_))}function se(e){e.copy_||(e.copy_=F(e.base_,e.scope_.immer_.useStrictShallowCopy_))}T(te,((e,t)=>{ne[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),ne.deleteProperty=function(e,t){return ne.set.call(this,e,t,void 0)},ne.set=function(e,t,n){return te.set.call(this,e[0],t,n,e[0])};function ae(e,t){const n=D(e)?H("MapSet").proxyMap_(e,t):z(e)?H("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:$(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=te;n&&(o=[r],i=ne);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}(e,t);return(t?t.scope_:$()).drafts_.push(n),n}function le(e){if(!S(e)||W(e))return e;const t=e[P];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=F(e,t.scope_.immer_.useStrictShallowCopy_)}else n=F(e,!0);return T(n,((e,t)=>{L(n,e,le(t))})),t&&(t.finalized_=!1),n}var ce=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,(e=>t.call(this,e,...o)))}}let r;if("function"!=typeof t&&k(6),void 0!==n&&"function"!=typeof n&&k(7),S(e)){const o=U(this),i=ae(e,void 0);let s=!0;try{r=t(i),s=!1}finally{s?J(o):K(o)}return Z(o,n),Y(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===O&&(r=void 0),this.autoFreeze_&&B(r,!0),n){const t=[],o=[];H("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}k(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){S(e)||k(8),E(e)&&(e=function(e){E(e)||k(10);return le(e)}(e));const t=U(this),n=ae(e,void 0);return n[P].isManual_=!0,K(t),n}finishDraft(e,t){const n=e&&e[P];n&&n.isManual_||k(9);const{scope_:r}=n;return Z(r,t),Y(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=H("Patches").applyPatches_;return E(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},fe=ce.produce;ce.produceWithPatches.bind(ce),ce.setAutoFreeze.bind(ce),ce.setUseStrictShallowCopy.bind(ce),ce.applyPatches.bind(ce);var ue=ce.createDraft.bind(ce),pe=ce.finishDraft.bind(ce),de={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=de.levels(e,t);return r=n?r.slice(1):r.slice(0,-1)},common(e,t){for(var n=[],r=0;r<e.length&&r<t.length;r++){var o=e[r];if(o!==t[r])break;n.push(o)}return n},compare(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],s=t[n];return de.equals(r,o)&&i>s},endsAt(e,t){var n=e.length,r=e.slice(0,n),o=t.slice(0,n);return de.equals(r,o)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],s=t[n];return de.equals(r,o)&&i<s},equals:(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n])),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===de.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===de.compare(e,t),isBefore:(e,t)=>-1===de.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===de.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===de.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===de.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===de.compare(e,t),isPath:e=>Array.isArray(e)&&(0===e.length||"number"==typeof e[0]),isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&de.equals(n,r)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=[],o=0;o<=e.length;o++)r.push(e.slice(0,o));return n&&r.reverse(),r},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!de.isAncestor(t,e)&&!de.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var r=[...e],{affinity:o="forward"}=n;if(0===e.length)return r;switch(t.type){case"insert_node":var{path:i}=t;(de.equals(i,r)||de.endsBefore(i,r)||de.isAncestor(i,r))&&(r[i.length-1]+=1);break;case"remove_node":var{path:s}=t;if(de.equals(s,r)||de.isAncestor(s,r))return null;de.endsBefore(s,r)&&(r[s.length-1]-=1);break;case"merge_node":var{path:a,position:l}=t;de.equals(a,r)||de.endsBefore(a,r)?r[a.length-1]-=1:de.isAncestor(a,r)&&(r[a.length-1]-=1,r[a.length]+=l);break;case"split_node":var{path:c,position:f}=t;if(de.equals(c,r)){if("forward"===o)r[r.length-1]+=1;else if("backward"!==o)return null}else de.endsBefore(c,r)?r[c.length-1]+=1:de.isAncestor(c,r)&&e[c.length]>=f&&(r[c.length-1]+=1,r[c.length]-=f);break;case"move_node":var{path:u,newPath:p}=t;if(de.equals(u,p))return r;if(de.isAncestor(u,r)||de.equals(u,r)){var d=p.slice();return de.endsBefore(u,p)&&u.length<p.length&&(d[u.length-1]-=1),d.concat(r.slice(u.length))}de.isSibling(u,p)&&(de.isAncestor(p,r)||de.equals(p,r))?de.endsBefore(u,r)?r[u.length-1]-=1:r[u.length-1]+=1:de.endsBefore(p,r)||de.equals(p,r)||de.isAncestor(p,r)?(de.endsBefore(u,r)&&(r[u.length-1]-=1),r[p.length-1]+=1):de.endsBefore(u,r)&&(de.equals(p,r)&&(r[p.length-1]+=1),r[u.length-1]-=1)}return r}};function he(e){return he="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},he(e)}function ge(e){var t=function(e,t){if("object"!==he(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==he(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===he(t)?t:String(t)}function ye(e,t,n){return(t=ge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){ye(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var be={transform(e,t){e.children=ue(e.children);var n=e.selection&&ue(e.selection);try{n=((e,t,n)=>{switch(n.type){case"insert_node":var{path:r,node:o}=n,i=Ce.parent(e,r),s=r[r.length-1];if(s>i.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r,"] because the destination is past the end of the node."));if(i.children.splice(s,0,o),t)for(var[a,l]of je.points(t))t[l]=qe.transform(a,n);break;case"insert_text":var{path:c,offset:f,text:u}=n;if(0===u.length)break;var p=Ce.leaf(e,c),d=p.text.slice(0,f),h=p.text.slice(f);if(p.text=d+u+h,t)for(var[g,y]of je.points(t))t[y]=qe.transform(g,n);break;case"merge_node":var{path:m}=n,v=Ce.get(e,m),b=de.previous(m),w=Ce.get(e,b),x=Ce.parent(e,m),O=m[m.length-1];if(Ke.isText(v)&&Ke.isText(w))w.text+=v.text;else{if(Ke.isText(v)||Ke.isText(w))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(m,"] to nodes of different interfaces: ").concat(Ve.stringify(v)," ").concat(Ve.stringify(w)));w.children.push(...v.children)}if(x.children.splice(O,1),t)for(var[_,P]of je.points(t))t[P]=qe.transform(_,n);break;case"move_node":var{path:k,newPath:j}=n;if(de.isAncestor(k,j))throw new Error("Cannot move a path [".concat(k,"] to new path [").concat(j,"] because the destination is inside itself."));var E=Ce.get(e,k),S=Ce.parent(e,k),R=k[k.length-1];S.children.splice(R,1);var A=de.transform(k,n),T=Ce.get(e,de.parent(A)),C=A[A.length-1];if(T.children.splice(C,0,E),t)for(var[N,L]of je.points(t))t[L]=qe.transform(N,n);break;case"remove_node":var{path:D}=n,z=D[D.length-1];if(Ce.parent(e,D).children.splice(z,1),t)for(var[M,F]of je.points(t)){var B=qe.transform(M,n);if(null!=t&&null!=B)t[F]=B;else{var q=void 0,W=void 0;for(var[V,I]of Ce.texts(e)){if(-1!==de.compare(I,D)){W=[V,I];break}q=[V,I]}var H=!1;q&&W&&(H=de.equals(W[1],D)?!de.hasPrevious(W[1]):de.common(q[1],D).length<de.common(W[1],D).length),q&&!H?(M.path=q[1],M.offset=q[0].text.length):W?(M.path=W[1],M.offset=0):t=null}}break;case"remove_text":var{path:$,offset:Z,text:J}=n;if(0===J.length)break;var K=Ce.leaf(e,$),U=K.text.slice(0,Z),X=K.text.slice(Z+J.length);if(K.text=U+X,t)for(var[Y,G]of je.points(t))t[G]=qe.transform(Y,n);break;case"set_node":var{path:Q,properties:ee,newProperties:te}=n;if(0===Q.length)throw new Error("Cannot set properties on the root node!");var ne=Ce.get(e,Q);for(var re in te){if("children"===re||"text"===re)throw new Error('Cannot set the "'.concat(re,'" property of nodes!'));var oe=te[re];null==oe?delete ne[re]:ne[re]=oe}for(var ie in ee)te.hasOwnProperty(ie)||delete ne[ie];break;case"set_selection":var{newProperties:se}=n;if(null==se)t=se;else{if(null==t){if(!je.isRange(se))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Ve.stringify(se)," when there is no current selection."));t=ve({},se)}for(var ae in se){var le=se[ae];if(null==le){if("anchor"===ae||"focus"===ae)throw new Error('Cannot remove the "'.concat(ae,'" selection property'));delete t[ae]}else t[ae]=le}}break;case"split_node":var{path:ce,position:fe,properties:ue}=n;if(0===ce.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(ce,"] because the root node cannot be split."));var pe,he=Ce.get(e,ce),ge=Ce.parent(e,ce),ye=ce[ce.length-1];if(Ke.isText(he)){var me=he.text.slice(0,fe),be=he.text.slice(fe);he.text=me,pe=ve(ve({},ue),{},{text:be})}else{var we=he.children.slice(0,fe),xe=he.children.slice(fe);he.children=we,pe=ve(ve({},ue),{},{children:xe})}if(ge.children.splice(ye+1,0,pe),t)for(var[Oe,_e]of je.points(t))t[_e]=qe.transform(Oe,n)}return t})(e,n,t)}finally{e.children=pe(e.children),e.selection=n?E(n)?pe(n):n:null}}},we={insertNodes(e,t,n){e.insertNodes(t,n)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,n){e.setNodes(t,n)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,n){e.unsetNodes(t,n)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,n){e.wrapNodes(t,n)}},xe={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,n){e.setPoint(t,n)},setSelection(e,t){e.setSelection(t)}},Oe=(e,t)=>{for(var n in e){var r=e[n],o=t[n];if(x(r)&&x(o)){if(!Oe(r,o))return!1}else if(Array.isArray(r)&&Array.isArray(o)){if(r.length!==o.length)return!1;for(var i=0;i<r.length;i++)if(r[i]!==o[i])return!1}else if(r!==o)return!1}for(var s in t)if(void 0===e[s]&&void 0!==t[s])return!1;return!0};function _e(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Pe=["anchor","focus"];function ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var je={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:o}=e;return je.isBackward(e)===n?[r,o]:[o,r]},end(e){var[,t]=je.edges(e);return t},equals:(e,t)=>qe.equals(e.anchor,t.anchor)&&qe.equals(e.focus,t.focus),includes(e,t){if(je.isRange(t)){if(je.includes(e,t.anchor)||je.includes(e,t.focus))return!0;var[n,r]=je.edges(e),[o,i]=je.edges(t);return qe.isBefore(n,o)&&qe.isAfter(r,i)}var[s,a]=je.edges(e),l=!1,c=!1;return qe.isPoint(t)?(l=qe.compare(t,s)>=0,c=qe.compare(t,a)<=0):(l=de.compare(t,s.path)>=0,c=de.compare(t,a.path)<=0),l&&c},intersection(e,t){var n=_e(e,Pe),[r,o]=je.edges(e),[i,s]=je.edges(t),a=qe.isBefore(r,i)?i:r,l=qe.isBefore(o,s)?o:s;return qe.isBefore(l,a)?null:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(n),!0).forEach((function(t){ye(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ke(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({anchor:a,focus:l},n)},isBackward(e){var{anchor:t,focus:n}=e;return qe.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return qe.equals(t,n)},isExpanded:e=>!je.isCollapsed(e),isForward:e=>!je.isBackward(e),isRange:e=>x(e)&&qe.isPoint(e.anchor)&&qe.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=je.edges(e);return t},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return fe(e,(e=>{if(null===e)return null;var r,o,{affinity:i="inward"}=n;if("inward"===i){var s=je.isCollapsed(e);je.isForward(e)?(r="forward",o=s?r:"backward"):(r="backward",o=s?r:"forward")}else"outward"===i?je.isForward(e)?(r="backward",o="forward"):(r="forward",o="backward"):(r=i,o=i);var a=qe.transform(e.anchor,t,{affinity:r}),l=qe.transform(e.focus,t,{affinity:o});if(!a||!l)return null;e.anchor=a,e.focus=l}))}},Ee=e=>x(e)&&Ce.isNodeList(e.children)&&!Me.isEditor(e),Se={isAncestor:e=>x(e)&&Ce.isNodeList(e.children),isElement:Ee,isElementList:e=>Array.isArray(e)&&e.every((e=>Se.isElement(e))),isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return Ee(e)&&e[n]===t},matches(e,t){for(var n in t)if("children"!==n&&e[n]!==t[n])return!1;return!0}},Re=["children"],Ae=["text"],Te=new WeakMap,Ce={ancestor(e,t){var n=Ce.get(e,t);if(Ke.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Ve.stringify(n)));return n},ancestors(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of de.ancestors(t,n)){var o=[Ce.ancestor(e,r),r];yield o}}()},child(e,t){if(Ke.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Ve.stringify(e)));var n=e.children[t];if(null==n)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Ve.stringify(e)));return n},children(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:r=!1}=n,o=Ce.ancestor(e,t),{children:i}=o,s=r?i.length-1:0;r?s>=0:s<i.length;){var a=Ce.child(o,s),l=t.concat(s);yield[a,l],s=r?s-1:s+1}}()},common(e,t,n){var r=de.common(t,n);return[Ce.get(e,r),r]},descendant(e,t){var n=Ce.get(e,t);if(Me.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Ve.stringify(n)));return n},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Ce.nodes(e,t))0!==r.length&&(yield[n,r])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Ce.nodes(e,t))Se.isElement(n)&&(yield[n,r])}()},extractProps:e=>Se.isAncestor(e)?_e(e,Re):_e(e,Ae),first(e,t){for(var n=t.slice(),r=Ce.get(e,n);r&&!Ke.isText(r)&&0!==r.children.length;)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){if(Ke.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(Ve.stringify(e)));var n=fe({children:e.children},(e=>{var[n,r]=je.edges(t),o=Ce.nodes(e,{reverse:!0,pass:e=>{var[,n]=e;return!je.includes(t,n)}});for(var[,i]of o){if(!je.includes(t,i)){var s=Ce.parent(e,i),a=i[i.length-1];s.children.splice(a,1)}if(de.equals(i,r.path)){var l=Ce.leaf(e,i);l.text=l.text.slice(0,r.offset)}if(de.equals(i,n.path)){var c=Ce.leaf(e,i);c.text=c.text.slice(n.offset)}}Me.isEditor(e)&&(e.selection=null)}));return n.children},get(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if(Ke.isText(n)||!n.children[o])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Ve.stringify(e)));n=n.children[o]}return n},has(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if(Ke.isText(n)||!n.children[o])return!1;n=n.children[o]}return!0},isNode:e=>Ke.isText(e)||Se.isElement(e)||Me.isEditor(e),isNodeList(e){if(!Array.isArray(e))return!1;var t=Te.get(e);if(void 0!==t)return t;var n=e.every((e=>Ce.isNode(e)));return Te.set(e,n),n},last(e,t){for(var n=t.slice(),r=Ce.get(e,n);r&&!Ke.isText(r)&&0!==r.children.length;){var o=r.children.length-1;r=r.children[o],n.push(o)}return[r,n]},leaf(e,t){var n=Ce.get(e,t);if(!Ke.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Ve.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of de.levels(t,n)){var o=Ce.get(e,r);yield[o,r]}}()},matches:(e,t)=>Se.isElement(e)&&Se.isElementProps(t)&&Se.matches(e,t)||Ke.isText(e)&&Ke.isTextProps(t)&&Ke.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:n,reverse:r=!1}=t,{from:o=[],to:i}=t,s=new Set,a=[],l=e;!i||!(r?de.isBefore(a,i):de.isAfter(a,i));)if(s.has(l)||(yield[l,a]),s.has(l)||Ke.isText(l)||0===l.children.length||null!=n&&!1!==n([l,a])){if(0===a.length)break;if(!r){var c=de.next(a);if(Ce.has(e,c)){a=c,l=Ce.get(e,a);continue}}if(r&&0!==a[a.length-1])a=de.previous(a),l=Ce.get(e,a);else a=de.parent(a),l=Ce.get(e,a),s.add(l)}else{s.add(l);var f=r?l.children.length-1:0;de.isAncestor(a,o)&&(f=o[a.length]),a=a.concat(f),l=Ce.get(e,a)}}()},parent(e,t){var n=de.parent(t),r=Ce.get(e,n);if(Ke.isText(r))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return r},string:e=>Ke.isText(e)?e.text:e.children.map(Ce.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Ce.nodes(e,t))Ke.isText(n)&&(yield[n,r])}()}};function Ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Le(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(n),!0).forEach((function(t){ye(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var De={isNodeOperation:e=>De.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!x(e))return!1;switch(e.type){case"insert_node":case"remove_node":return de.isPath(e.path)&&Ce.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&de.isPath(e.path);case"merge_node":return"number"==typeof e.position&&de.isPath(e.path)&&x(e.properties);case"move_node":return de.isPath(e.path)&&de.isPath(e.newPath);case"set_node":return de.isPath(e.path)&&x(e.properties)&&x(e.newProperties);case"set_selection":return null===e.properties&&je.isRange(e.newProperties)||null===e.newProperties&&je.isRange(e.properties)||x(e.properties)&&x(e.newProperties);case"split_node":return de.isPath(e.path)&&"number"==typeof e.position&&x(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every((e=>De.isOperation(e))),isSelectionOperation:e=>De.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>De.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return Le(Le({},e),{},{type:"remove_node"});case"insert_text":return Le(Le({},e),{},{type:"remove_text"});case"merge_node":return Le(Le({},e),{},{type:"split_node",path:de.previous(e.path)});case"move_node":var{newPath:t,path:n}=e;if(de.equals(t,n))return e;if(de.isSibling(n,t))return Le(Le({},e),{},{path:t,newPath:n});var r=de.transform(n,e),o=de.transform(de.next(n),e);return Le(Le({},e),{},{path:r,newPath:o});case"remove_node":return Le(Le({},e),{},{type:"insert_node"});case"remove_text":return Le(Le({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:s}=e;return Le(Le({},e),{},{properties:s,newProperties:i});case"set_selection":var{properties:a,newProperties:l}=e;return Le(Le({},e),{},null==a?{properties:l,newProperties:null}:null==l?{properties:null,newProperties:a}:{properties:l,newProperties:a});case"split_node":return Le(Le({},e),{},{type:"merge_node",path:de.next(e.path)})}}},ze=new WeakMap,Me={above:(e,t)=>e.above(t),addMark(e,t,n){e.addMark(t,n)},after:(e,t,n)=>e.after(t,n),before:(e,t,n)=>e.before(t,n),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteBackward(n)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteForward(n)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,n){e.insertFragment(t,n)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,n)=>e.isEdge(t,n),isEditor:e=>(e=>{var t=ze.get(e);if(void 0!==t)return t;if(!x(e))return!1;var n="function"==typeof e.addMark&&"function"==typeof e.apply&&"function"==typeof e.deleteFragment&&"function"==typeof e.insertBreak&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertText&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isInline&&"function"==typeof e.isSelectable&&"function"==typeof e.isVoid&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.removeMark&&"function"==typeof e.getDirtyPaths&&(null===e.marks||x(e.marks))&&(null===e.selection||je.isRange(e.selection))&&Ce.isNodeList(e.children)&&De.isOperationList(e.operations);return ze.set(e,n),n})(e),isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,n)=>e.isEnd(t,n),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,n)=>e.isStart(t,n),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,n)=>e.leaf(t,n),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,n)=>e.node(t,n),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,n)=>e.parent(t,n),path:(e,t,n)=>e.path(t,n),pathRef:(e,t,n)=>e.pathRef(t,n),pathRefs:e=>e.pathRefs(),point:(e,t,n)=>e.point(t,n),pointRef:(e,t,n)=>e.pointRef(t,n),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,n)=>e.range(t,n),rangeRef:(e,t,n)=>e.rangeRef(t,n),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,n)=>e.string(t,n),unhangRange:(e,t,n)=>e.unhangRange(t,n),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)}};function Fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fe(Object(n),!0).forEach((function(t){ye(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var qe={compare(e,t){var n=de.compare(e.path,t.path);return 0===n?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter:(e,t)=>1===qe.compare(e,t),isBefore:(e,t)=>-1===qe.compare(e,t),equals:(e,t)=>e.offset===t.offset&&de.equals(e.path,t.path),isPoint:e=>x(e)&&"number"==typeof e.offset&&de.isPath(e.path),transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return fe(e,(e=>{if(null===e)return null;var{affinity:r="forward"}=n,{path:o,offset:i}=e;switch(t.type){case"insert_node":case"move_node":e.path=de.transform(o,t,n);break;case"insert_text":de.equals(t.path,o)&&(t.offset<i||t.offset===i&&"forward"===r)&&(e.offset+=t.text.length);break;case"merge_node":de.equals(t.path,o)&&(e.offset+=t.position),e.path=de.transform(o,t,n);break;case"remove_text":de.equals(t.path,o)&&t.offset<=i&&(e.offset-=Math.min(i-t.offset,t.text.length));break;case"remove_node":if(de.equals(t.path,o)||de.isAncestor(t.path,o))return null;e.path=de.transform(o,t,n);break;case"split_node":if(de.equals(t.path,o)){if(t.position===i&&null==r)return null;(t.position<i||t.position===i&&"forward"===r)&&(e.offset-=t.position,e.path=de.transform(o,t,Be(Be({},n),{},{affinity:"forward"})))}else e.path=de.transform(o,t,n)}}))}},We=void 0,Ve={setScrubber(e){We=e},stringify:e=>JSON.stringify(e,We)},Ie=["text"],He=["anchor","focus"];function $e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ze(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$e(Object(n),!0).forEach((function(t){ye(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$e(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Je,Ke={equals(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:r=!1}=n;function o(e){return _e(e,Ie)}return Oe(r?o(e):e,r?o(t):t)},isText:e=>x(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every((e=>Ke.isText(e))),isTextProps:e=>void 0!==e.text,matches(e,t){for(var n in t)if("text"!==n&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[Ze({},e)];for(var r of t){var o=_e(r,He),[i,s]=je.edges(r),a=[],l=0,c=i.offset,f=s.offset;for(var u of n){var{length:p}=u.text,d=l;if(l+=p,c<=d&&l<=f)Object.assign(u,o),a.push(u);else if(c!==f&&(c===l||f===d)||c>l||f<d||f===d&&0!==d)a.push(u);else{var h=u,g=void 0,y=void 0;if(f<l){var m=f-d;y=Ze(Ze({},h),{},{text:h.text.slice(m)}),h=Ze(Ze({},h),{},{text:h.text.slice(0,m)})}if(c>d){var v=c-d;g=Ze(Ze({},h),{},{text:h.text.slice(0,v)}),h=Ze(Ze({},h),{},{text:h.text.slice(v)})}Object.assign(h,o),g&&a.push(g),a.push(h),y&&a.push(y)}}n=a}return n}},Ue=e=>e.selection?e.selection:e.children.length>0?Me.end(e,[]):[0];!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(Je||(Je={})),Je.L,Je.L,Je.V,Je.LV,Je.LVT,Je.LV,Je.V,Je.V,Je.T,Je.LVT,Je.T,Je.T,Je.Any,Je.Extend,Je.ZWJ,Je.Any,Je.SpacingMark,Je.Prepend,Je.Any,Je.ZWJ,Je.ExtPict,Je.RI,Je.RI;var Xe={delete(e,t){e.delete(t)},insertFragment(e,t,n){e.insertFragment(t,n)},insertText(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Me.withoutNormalizing(e,(()=>{var{voids:r=!1}=n,{at:o=Ue(e)}=n;if(de.isPath(o)&&(o=Me.range(e,o)),je.isRange(o))if(je.isCollapsed(o))o=o.anchor;else{var i=je.end(o);if(!r&&Me.void(e,{at:i}))return;var s=je.start(o),a=Me.pointRef(e,s),l=Me.pointRef(e,i);Qe.delete(e,{at:o,voids:r});var c=a.unref(),f=l.unref();o=c||f,Qe.setSelection(e,{anchor:o,focus:o})}if(!(!r&&Me.void(e,{at:o})||Me.elementReadOnly(e,{at:o}))){var{path:u,offset:p}=o;t.length>0&&e.apply({type:"insert_text",path:u,offset:p,text:t})}}))}};function Ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ye(Object(n),!0).forEach((function(t){ye(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ye(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qe=Ge(Ge(Ge(Ge({},be),we),xe),Xe);const et={buildLinkElements:(t,n)=>{const{props:r}=n||{},o=Object.assign(Object.assign({},r),{nodeType:"inline"});return{id:e(),type:"link",children:[{text:(null==r?void 0:r.title)||(null==r?void 0:r.url)||""}],props:o}},insertLink:(e,t)=>{let{props:n,slate:r}=t||{};if(!r||!r.selection)return;const o=Me.string(r,r.selection),i=Object.assign(Object.assign({},n),{title:n.title||o||n.url||"",nodeType:"inline"}),s=et.buildLinkElements(e,{props:n}),[a]=Me.nodes(r,{at:r.selection,match:e=>!Me.isEditor(e)&&Se.isElement(e)&&"link"===e.type});if(a){const[e,t]=a;return Qe.setNodes(r,{props:Object.assign(Object.assign(Object.assign({},null==e?void 0:e.props),i),{nodeType:"inline"})},{match:e=>Se.isElement(e)&&"link"===e.type,at:t}),Me.insertText(r,i.title||i.url||"",{at:r.selection}),void Qe.collapse(r,{edge:"end"})}Qe.wrapNodes(r,s,{split:!0,at:r.selection}),Qe.setNodes(r,{text:(null==n?void 0:n.title)||(null==n?void 0:n.url)||""},{at:r.selection,mode:"lowest",match:e=>!Me.isEditor(e)&&Se.isElement(e)&&"link"===e.type}),Me.insertText(r,(null==n?void 0:n.title)||(null==n?void 0:n.url)||"",{at:r.selection}),Qe.collapse(r,{edge:"end"})},deleteLink:(e,t)=>{try{const{slate:e}=t;if(!e||!e.selection)return;const[n]=Me.nodes(e,{at:e.selection,match:e=>!Me.isEditor(e)&&Se.isElement(e)&&"link"===e.type});n&&Qe.unwrapNodes(e,{match:e=>!Me.isEditor(e)&&Se.isElement(e)&&"link"===e.type,at:e.selection})}catch(e){}}};function tt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;
|
|
8
8
|
/**
|
|
9
|
-
* @license lucide-react v0.
|
|
9
|
+
* @license lucide-react v0.379.0 - ISC
|
|
10
10
|
*
|
|
11
11
|
* This source code is licensed under the ISC license.
|
|
12
12
|
* See the LICENSE file in the root directory of this source tree.
|
|
13
13
|
*/
|
|
14
14
|
const nt=(...e)=>e.filter(((e,t,n)=>Boolean(e)&&n.indexOf(e)===t)).join(" ")
|
|
15
15
|
/**
|
|
16
|
-
* @license lucide-react v0.
|
|
16
|
+
* @license lucide-react v0.379.0 - ISC
|
|
17
17
|
*
|
|
18
18
|
* This source code is licensed under the ISC license.
|
|
19
19
|
* See the LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/;var rt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
|
|
21
21
|
/**
|
|
22
|
-
* @license lucide-react v0.
|
|
22
|
+
* @license lucide-react v0.379.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
26
|
*/const ot=d((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>h("svg",{ref:l,...rt,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:nt("lucide",o),...a},[...s.map((([e,t])=>h(e,t))),...Array.isArray(i)?i:[i]]))),it=(e,t)=>{const n=d((({className:n,...r},o)=>{return h(ot,{ref:o,iconNode:t,className:nt(`lucide-${i=e,i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var i}));return n.displayName=`${e}`,n},st=it("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),at=it("SquareArrowOutUpRight",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]]);
|
|
27
27
|
/**
|
|
28
|
-
* @license lucide-react v0.
|
|
28
|
+
* @license lucide-react v0.379.0 - ISC
|
|
29
29
|
*
|
|
30
30
|
* This source code is licensed under the ISC license.
|
|
31
31
|
* See the LICENSE file in the root directory of this source tree.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoopta/link",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.3-rc.0",
|
|
4
4
|
"description": "Link plugin for Yoopta Editor",
|
|
5
5
|
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"lucide-react": "^0.379.0"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "3ebd29556ec23ec77961e72d1278a987ca6e99df"
|
|
41
41
|
}
|