@yoopta/link 4.9.4 → 4.9.5
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/index.js +4 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -6,26 +6,26 @@ import{generateId as e,useYooptaEditor as t,useYooptaTools as n,Blocks as r,UI a
|
|
|
6
6
|
* Released under the MIT License.
|
|
7
7
|
*/function x(e){return"[object Object]"===Object.prototype.toString.call(e)}function O(e){var t,n;return!1!==x(e)&&(void 0===(t=e.constructor)||!1!==x(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}var _=Symbol.for("immer-nothing"),P=Symbol.for("immer-draftable"),k=Symbol.for("immer-state");function j(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var E=Object.getPrototypeOf;function S(e){return!!e&&!!e[k]}function R(e){return!!e&&(T(e)||Array.isArray(e)||!!e[P]||!!e.constructor?.[P]||z(e)||M(e))}var A=Object.prototype.constructor.toString();function T(e){if(!e||"object"!=typeof e)return!1;const t=E(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)===A}function C(e,t){0===N(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function N(e){const t=e[k];return t?t.type_:Array.isArray(e)?1:z(e)?2:M(e)?3:0}function L(e,t){return 2===N(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function D(e,t,n){const r=N(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function z(e){return e instanceof Map}function M(e){return e instanceof Set}function F(e){return e.copy_||e.base_}function B(e,t){if(z(e))return new Map(e);if(M(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&T(e)){if(!E(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[k];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(E(e),n)}function q(e,t=!1){return V(e)||S(e)||!R(e)||(N(e)>1&&(e.set=e.add=e.clear=e.delete=W),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>q(t,!0)))),e}function W(){j(2)}function V(e){return Object.isFrozen(e)}var I,$={};function H(e){const t=$[e];return t||j(0),t}function Z(){return I}function J(e,t){t&&(H("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function K(e){U(e),e.drafts_.forEach(Y),e.drafts_=null}function U(e){e===I&&(I=e.parent_)}function X(e){return I={drafts_:[],parent_:I,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Y(e){const t=e[k];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function G(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[k].modified_&&(K(t),j(4)),R(e)&&(e=Q(t,e),t.parent_||te(t,e)),t.patches_&&H("Patches").generateReplacementPatches_(n[k].base_,e,t.patches_,t.inversePatches_)):e=Q(t,n,[]),K(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==_?e:void 0}function Q(e,t,n){if(V(t))return t;const r=t[k];if(!r)return C(t,((o,i)=>ee(e,r,t,o,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return te(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),C(o,((o,s)=>ee(e,r,t,o,s,n,i))),te(e,t,!1),n&&e.patches_&&H("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function ee(e,t,n,r,o,i,s){if(S(o)){const s=Q(e,o,i&&t&&3!==t.type_&&!L(t.assigned_,r)?i.concat(r):void 0);if(D(n,r,s),!S(s))return;e.canAutoFreeze_=!1}else s&&n.add(o);if(R(o)&&!V(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Q(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||te(e,o)}}function te(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&q(t,n)}var ne={get(e,t){if(t===k)return e;const n=F(e);if(!L(n,t))return function(e,t,n){const r=ie(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_||!R(r)?r:r===oe(e.base_,t)?(ae(e),e.copy_[t]=le(r,e)):r},has:(e,t)=>t in F(e),ownKeys:e=>Reflect.ownKeys(F(e)),set(e,t,n){const r=ie(F(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=oe(F(e),t),s=r?.[k];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||L(e.base_,t)))return!0;ae(e),se(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!==oe(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,ae(e),se(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=F(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){j(11)},getPrototypeOf:e=>E(e.base_),setPrototypeOf(){j(12)}},re={};function oe(e,t){const n=e[k];return(n?F(n):e)[t]}function ie(e,t){if(!(t in e))return;let n=E(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=E(n)}}function se(e){e.modified_||(e.modified_=!0,e.parent_&&se(e.parent_))}function ae(e){e.copy_||(e.copy_=B(e.base_,e.scope_.immer_.useStrictShallowCopy_))}C(ne,((e,t)=>{re[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),re.deleteProperty=function(e,t){return re.set.call(this,e,t,void 0)},re.set=function(e,t,n){return ne.set.call(this,e[0],t,n,e[0])};function le(e,t){const n=z(e)?H("MapSet").proxyMap_(e,t):M(e)?H("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Z(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=ne;n&&(o=[r],i=re);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}(e,t);return(t?t.scope_:Z()).drafts_.push(n),n}function ce(e){if(!R(e)||V(e))return e;const t=e[k];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=B(e,t.scope_.immer_.useStrictShallowCopy_)}else n=B(e,!0);return C(n,((e,t)=>{D(n,e,ce(t))})),t&&(t.finalized_=!1),n}var fe=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&&j(6),void 0!==n&&"function"!=typeof n&&j(7),R(e)){const o=X(this),i=le(e,void 0);let s=!0;try{r=t(i),s=!1}finally{s?K(o):U(o)}return J(o,n),G(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===_&&(r=void 0),this.autoFreeze_&&q(r,!0),n){const t=[],o=[];H("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}j(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){R(e)||j(8),S(e)&&(e=function(e){S(e)||j(10);return ce(e)}(e));const t=X(this),n=le(e,void 0);return n[k].isManual_=!0,U(t),n}finishDraft(e,t){const n=e&&e[k];n&&n.isManual_||j(9);const{scope_:r}=n;return J(r,t),G(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 S(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},ue=fe.produce;fe.produceWithPatches.bind(fe),fe.setAutoFreeze.bind(fe),fe.setUseStrictShallowCopy.bind(fe),fe.applyPatches.bind(fe);var pe=fe.createDraft.bind(fe),de=fe.finishDraft.bind(fe),he={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=he.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 he.equals(r,o)&&i>s},endsAt(e,t){var n=e.length,r=e.slice(0,n),o=t.slice(0,n);return he.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 he.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===he.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===he.compare(e,t),isBefore:(e,t)=>-1===he.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===he.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===he.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===he.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===he.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]&&he.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(!he.isAncestor(t,e)&&!he.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;(he.equals(i,r)||he.endsBefore(i,r)||he.isAncestor(i,r))&&(r[i.length-1]+=1);break;case"remove_node":var{path:s}=t;if(he.equals(s,r)||he.isAncestor(s,r))return null;he.endsBefore(s,r)&&(r[s.length-1]-=1);break;case"merge_node":var{path:a,position:l}=t;he.equals(a,r)||he.endsBefore(a,r)?r[a.length-1]-=1:he.isAncestor(a,r)&&(r[a.length-1]-=1,r[a.length]+=l);break;case"split_node":var{path:c,position:f}=t;if(he.equals(c,r)){if("forward"===o)r[r.length-1]+=1;else if("backward"!==o)return null}else he.endsBefore(c,r)?r[c.length-1]+=1:he.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(he.equals(u,p))return r;if(he.isAncestor(u,r)||he.equals(u,r)){var d=p.slice();return he.endsBefore(u,p)&&u.length<p.length&&(d[u.length-1]-=1),d.concat(r.slice(u.length))}he.isSibling(u,p)&&(he.isAncestor(p,r)||he.equals(p,r))?he.endsBefore(u,r)?r[u.length-1]-=1:r[u.length-1]+=1:he.endsBefore(p,r)||he.equals(p,r)||he.isAncestor(p,r)?(he.endsBefore(u,r)&&(r[u.length-1]-=1),r[p.length-1]+=1):he.endsBefore(u,r)&&(he.equals(p,r)&&(r[p.length-1]+=1),r[u.length-1]-=1)}return r}};function ge(e){return ge="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},ge(e)}function ye(e){var t=function(e,t){if("object"!==ge(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ge(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ge(t)?t:String(t)}function me(e,t,n){return(t=ye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ve(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?ve(Object(n),!0).forEach((function(t){me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var we={transform(e,t){e.children=pe(e.children);var n=e.selection&&pe(e.selection);try{n=((e,t,n)=>{switch(n.type){case"insert_node":var{path:r,node:o}=n,i=Ne.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 Ee.points(t))t[l]=We.transform(a,n);break;case"insert_text":var{path:c,offset:f,text:u}=n;if(0===u.length)break;var p=Ne.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 Ee.points(t))t[y]=We.transform(g,n);break;case"merge_node":var{path:m}=n,v=Ne.get(e,m),b=he.previous(m),w=Ne.get(e,b),x=Ne.parent(e,m),O=m[m.length-1];if(Ue.isText(v)&&Ue.isText(w))w.text+=v.text;else{if(Ue.isText(v)||Ue.isText(w))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(m,"] to nodes of different interfaces: ").concat(Ie.stringify(v)," ").concat(Ie.stringify(w)));w.children.push(...v.children)}if(x.children.splice(O,1),t)for(var[_,P]of Ee.points(t))t[P]=We.transform(_,n);break;case"move_node":var{path:k,newPath:j}=n;if(he.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=Ne.get(e,k),S=Ne.parent(e,k),R=k[k.length-1];S.children.splice(R,1);var A=he.transform(k,n),T=Ne.get(e,he.parent(A)),C=A[A.length-1];if(T.children.splice(C,0,E),t)for(var[N,L]of Ee.points(t))t[L]=We.transform(N,n);break;case"remove_node":var{path:D}=n,z=D[D.length-1];if(Ne.parent(e,D).children.splice(z,1),t)for(var[M,F]of Ee.points(t)){var B=We.transform(M,n);if(null!=t&&null!=B)t[F]=B;else{var q=void 0,W=void 0;for(var[V,I]of Ne.texts(e)){if(-1!==he.compare(I,D)){W=[V,I];break}q=[V,I]}var $=!1;q&&W&&($=he.equals(W[1],D)?!he.hasPrevious(W[1]):he.common(q[1],D).length<he.common(W[1],D).length),q&&!$?(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:H,offset:Z,text:J}=n;if(0===J.length)break;var K=Ne.leaf(e,H),U=K.text.slice(0,Z),X=K.text.slice(Z+J.length);if(K.text=U+X,t)for(var[Y,G]of Ee.points(t))t[G]=We.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=Ne.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(!Ee.isRange(se))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Ie.stringify(se)," when there is no current selection."));t=be({},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,de=Ne.get(e,ce),ge=Ne.parent(e,ce),ye=ce[ce.length-1];if(Ue.isText(de)){var me=de.text.slice(0,fe),ve=de.text.slice(fe);de.text=me,pe=be(be({},ue),{},{text:ve})}else{var we=de.children.slice(0,fe),xe=de.children.slice(fe);de.children=we,pe=be(be({},ue),{},{children:xe})}if(ge.children.splice(ye+1,0,pe),t)for(var[Oe,_e]of Ee.points(t))t[_e]=We.transform(Oe,n)}return t})(e,n,t)}finally{e.children=de(e.children),e.selection=n?S(n)?de(n):n:null}}},xe={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)}},Oe={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)}},_e=(e,t)=>{for(var n in e){var r=e[n],o=t[n];if(O(r)&&O(o)){if(!_e(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 Pe(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 ke=["anchor","focus"];function je(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 Ee={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:o}=e;return Ee.isBackward(e)===n?[r,o]:[o,r]},end(e){var[,t]=Ee.edges(e);return t},equals:(e,t)=>We.equals(e.anchor,t.anchor)&&We.equals(e.focus,t.focus),includes(e,t){if(Ee.isRange(t)){if(Ee.includes(e,t.anchor)||Ee.includes(e,t.focus))return!0;var[n,r]=Ee.edges(e),[o,i]=Ee.edges(t);return We.isBefore(n,o)&&We.isAfter(r,i)}var[s,a]=Ee.edges(e),l=!1,c=!1;return We.isPoint(t)?(l=We.compare(t,s)>=0,c=We.compare(t,a)<=0):(l=he.compare(t,s.path)>=0,c=he.compare(t,a.path)<=0),l&&c},intersection(e,t){var n=Pe(e,ke),[r,o]=Ee.edges(e),[i,s]=Ee.edges(t),a=We.isBefore(r,i)?i:r,l=We.isBefore(o,s)?o:s;return We.isBefore(l,a)?null:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?je(Object(n),!0).forEach((function(t){me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):je(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 We.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return We.equals(t,n)},isExpanded:e=>!Ee.isCollapsed(e),isForward:e=>!Ee.isBackward(e),isRange:e=>O(e)&&We.isPoint(e.anchor)&&We.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=Ee.edges(e);return t},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return ue(e,(e=>{if(null===e)return null;var r,o,{affinity:i="inward"}=n;if("inward"===i){var s=Ee.isCollapsed(e);Ee.isForward(e)?(r="forward",o=s?r:"backward"):(r="backward",o=s?r:"forward")}else"outward"===i?Ee.isForward(e)?(r="backward",o="forward"):(r="forward",o="backward"):(r=i,o=i);var a=We.transform(e.anchor,t,{affinity:r}),l=We.transform(e.focus,t,{affinity:o});if(!a||!l)return null;e.anchor=a,e.focus=l}))}},Se=e=>O(e)&&Ne.isNodeList(e.children)&&!Fe.isEditor(e),Re={isAncestor:e=>O(e)&&Ne.isNodeList(e.children),isElement:Se,isElementList:e=>Array.isArray(e)&&e.every((e=>Re.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 Se(e)&&e[n]===t},matches(e,t){for(var n in t)if("children"!==n&&e[n]!==t[n])return!1;return!0}},Ae=["children"],Te=["text"],Ce=new WeakMap,Ne={ancestor(e,t){var n=Ne.get(e,t);if(Ue.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Ie.stringify(n)));return n},ancestors(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of he.ancestors(t,n)){var o=[Ne.ancestor(e,r),r];yield o}}()},child(e,t){if(Ue.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Ie.stringify(e)));var n=e.children[t];if(null==n)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Ie.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=Ne.ancestor(e,t),{children:i}=o,s=r?i.length-1:0;r?s>=0:s<i.length;){var a=Ne.child(o,s),l=t.concat(s);yield[a,l],s=r?s-1:s+1}}()},common(e,t,n){var r=he.common(t,n);return[Ne.get(e,r),r]},descendant(e,t){var n=Ne.get(e,t);if(Fe.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Ie.stringify(n)));return n},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Ne.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 Ne.nodes(e,t))Re.isElement(n)&&(yield[n,r])}()},extractProps:e=>Re.isAncestor(e)?Pe(e,Ae):Pe(e,Te),first(e,t){for(var n=t.slice(),r=Ne.get(e,n);r&&!Ue.isText(r)&&0!==r.children.length;)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){if(Ue.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(Ie.stringify(e)));var n=ue({children:e.children},(e=>{var[n,r]=Ee.edges(t),o=Ne.nodes(e,{reverse:!0,pass:e=>{var[,n]=e;return!Ee.includes(t,n)}});for(var[,i]of o){if(!Ee.includes(t,i)){var s=Ne.parent(e,i),a=i[i.length-1];s.children.splice(a,1)}if(he.equals(i,r.path)){var l=Ne.leaf(e,i);l.text=l.text.slice(0,r.offset)}if(he.equals(i,n.path)){var c=Ne.leaf(e,i);c.text=c.text.slice(n.offset)}}Fe.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(Ue.isText(n)||!n.children[o])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Ie.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(Ue.isText(n)||!n.children[o])return!1;n=n.children[o]}return!0},isNode:e=>Ue.isText(e)||Re.isElement(e)||Fe.isEditor(e),isNodeList(e){if(!Array.isArray(e))return!1;var t=Ce.get(e);if(void 0!==t)return t;var n=e.every((e=>Ne.isNode(e)));return Ce.set(e,n),n},last(e,t){for(var n=t.slice(),r=Ne.get(e,n);r&&!Ue.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=Ne.get(e,t);if(!Ue.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Ie.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of he.levels(t,n)){var o=Ne.get(e,r);yield[o,r]}}()},matches:(e,t)=>Re.isElement(e)&&Re.isElementProps(t)&&Re.matches(e,t)||Ue.isText(e)&&Ue.isTextProps(t)&&Ue.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?he.isBefore(a,i):he.isAfter(a,i));)if(s.has(l)||(yield[l,a]),s.has(l)||Ue.isText(l)||0===l.children.length||null!=n&&!1!==n([l,a])){if(0===a.length)break;if(!r){var c=he.next(a);if(Ne.has(e,c)){a=c,l=Ne.get(e,a);continue}}if(r&&0!==a[a.length-1])a=he.previous(a),l=Ne.get(e,a);else a=he.parent(a),l=Ne.get(e,a),s.add(l)}else{s.add(l);var f=r?l.children.length-1:0;he.isAncestor(a,o)&&(f=o[a.length]),a=a.concat(f),l=Ne.get(e,a)}}()},parent(e,t){var n=he.parent(t),r=Ne.get(e,n);if(Ue.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=>Ue.isText(e)?e.text:e.children.map(Ne.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Ne.nodes(e,t))Ue.isText(n)&&(yield[n,r])}()}};function Le(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 De(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(n),!0).forEach((function(t){me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ze={isNodeOperation:e=>ze.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!O(e))return!1;switch(e.type){case"insert_node":case"remove_node":return he.isPath(e.path)&&Ne.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&he.isPath(e.path);case"merge_node":return"number"==typeof e.position&&he.isPath(e.path)&&O(e.properties);case"move_node":return he.isPath(e.path)&&he.isPath(e.newPath);case"set_node":return he.isPath(e.path)&&O(e.properties)&&O(e.newProperties);case"set_selection":return null===e.properties&&Ee.isRange(e.newProperties)||null===e.newProperties&&Ee.isRange(e.properties)||O(e.properties)&&O(e.newProperties);case"split_node":return he.isPath(e.path)&&"number"==typeof e.position&&O(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every((e=>ze.isOperation(e))),isSelectionOperation:e=>ze.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>ze.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return De(De({},e),{},{type:"remove_node"});case"insert_text":return De(De({},e),{},{type:"remove_text"});case"merge_node":return De(De({},e),{},{type:"split_node",path:he.previous(e.path)});case"move_node":var{newPath:t,path:n}=e;if(he.equals(t,n))return e;if(he.isSibling(n,t))return De(De({},e),{},{path:t,newPath:n});var r=he.transform(n,e),o=he.transform(he.next(n),e);return De(De({},e),{},{path:r,newPath:o});case"remove_node":return De(De({},e),{},{type:"insert_node"});case"remove_text":return De(De({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:s}=e;return De(De({},e),{},{properties:s,newProperties:i});case"set_selection":var{properties:a,newProperties:l}=e;return De(De({},e),{},null==a?{properties:l,newProperties:null}:null==l?{properties:null,newProperties:a}:{properties:l,newProperties:a});case"split_node":return De(De({},e),{},{type:"merge_node",path:he.next(e.path)})}}},Me=new WeakMap,Fe={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=Me.get(e);if(void 0!==t)return t;if(!O(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||O(e.marks))&&(null===e.selection||Ee.isRange(e.selection))&&Ne.isNodeList(e.children)&&ze.isOperationList(e.operations);return Me.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 Be(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 qe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(n),!0).forEach((function(t){me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Be(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var We={compare(e,t){var n=he.compare(e.path,t.path);return 0===n?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter:(e,t)=>1===We.compare(e,t),isBefore:(e,t)=>-1===We.compare(e,t),equals:(e,t)=>e.offset===t.offset&&he.equals(e.path,t.path),isPoint:e=>O(e)&&"number"==typeof e.offset&&he.isPath(e.path),transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return ue(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=he.transform(o,t,n);break;case"insert_text":he.equals(t.path,o)&&(t.offset<i||t.offset===i&&"forward"===r)&&(e.offset+=t.text.length);break;case"merge_node":he.equals(t.path,o)&&(e.offset+=t.position),e.path=he.transform(o,t,n);break;case"remove_text":he.equals(t.path,o)&&t.offset<=i&&(e.offset-=Math.min(i-t.offset,t.text.length));break;case"remove_node":if(he.equals(t.path,o)||he.isAncestor(t.path,o))return null;e.path=he.transform(o,t,n);break;case"split_node":if(he.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=he.transform(o,t,qe(qe({},n),{},{affinity:"forward"})))}else e.path=he.transform(o,t,n)}}))}},Ve=void 0,Ie={setScrubber(e){Ve=e},stringify:e=>JSON.stringify(e,Ve)},$e=["text"],He=["anchor","focus"];function Ze(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 Je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(n),!0).forEach((function(t){me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ze(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ke,Ue={equals(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:r=!1}=n;function o(e){return Pe(e,$e)}return _e(r?o(e):e,r?o(t):t)},isText:e=>O(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every((e=>Ue.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=[Je({},e)];for(var r of t){var o=Pe(r,He),[i,s]=Ee.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=Je(Je({},h),{},{text:h.text.slice(m)}),h=Je(Je({},h),{},{text:h.text.slice(0,m)})}if(c>d){var v=c-d;g=Je(Je({},h),{},{text:h.text.slice(0,v)}),h=Je(Je({},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}},Xe=e=>e.selection?e.selection:e.children.length>0?Fe.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"}(Ke||(Ke={})),Ke.L,Ke.L,Ke.V,Ke.LV,Ke.LVT,Ke.LV,Ke.V,Ke.V,Ke.T,Ke.LVT,Ke.T,Ke.T,Ke.Any,Ke.Extend,Ke.ZWJ,Ke.Any,Ke.SpacingMark,Ke.Prepend,Ke.Any,Ke.ZWJ,Ke.ExtPict,Ke.RI,Ke.RI;var Ye={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]:{};Fe.withoutNormalizing(e,(()=>{var{voids:r=!1}=n,{at:o=Xe(e)}=n;if(he.isPath(o)&&(o=Fe.range(e,o)),Ee.isRange(o))if(Ee.isCollapsed(o))o=o.anchor;else{var i=Ee.end(o);if(!r&&Fe.void(e,{at:i}))return;var s=Ee.start(o),a=Fe.pointRef(e,s),l=Fe.pointRef(e,i);et.delete(e,{at:o,voids:r});var c=a.unref(),f=l.unref();o=c||f,et.setSelection(e,{anchor:o,focus:o})}if(!(!r&&Fe.void(e,{at:o})||Fe.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 Ge(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 Qe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ge(Object(n),!0).forEach((function(t){me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ge(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var et=Qe(Qe(Qe(Qe({},we),xe),Oe),Ye);const tt={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=Fe.string(r,r.selection),i=Object.assign(Object.assign({},n),{title:n.title||o||n.url||"",nodeType:"inline"}),s=tt.buildLinkElements(e,{props:n}),[a]=Fe.nodes(r,{at:r.selection,match:e=>!Fe.isEditor(e)&&Re.isElement(e)&&"link"===e.type});if(a){const[e,t]=a;return et.setNodes(r,{props:Object.assign(Object.assign(Object.assign({},null==e?void 0:e.props),i),{nodeType:"inline"})},{match:e=>Re.isElement(e)&&"link"===e.type,at:t}),Fe.insertText(r,i.title||i.url||"",{at:r.selection}),void et.collapse(r,{edge:"end"})}et.wrapNodes(r,s,{split:!0,at:r.selection}),et.setNodes(r,{text:(null==n?void 0:n.title)||(null==n?void 0:n.url)||""},{at:r.selection,mode:"lowest",match:e=>!Fe.isEditor(e)&&Re.isElement(e)&&"link"===e.type}),Fe.insertText(r,(null==n?void 0:n.title)||(null==n?void 0:n.url)||"",{at:r.selection}),et.collapse(r,{edge:"end"})},deleteLink:(e,t)=>{try{const{slate:e}=t;if(!e||!e.selection)return;const[n]=Fe.nodes(e,{at:e.selection,match:e=>!Fe.isEditor(e)&&Re.isElement(e)&&"link"===e.type});n&&et.unwrapNodes(e,{match:e=>!Fe.isEditor(e)&&Re.isElement(e)&&"link"===e.type,at:e.selection})}catch(e){}}};function nt(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.453.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 rt=(...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.453.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 ot={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.453.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 it=h((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>g("svg",{ref:l,...ot,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:rt("lucide",o),...a},[...s.map((([e,t])=>g(e,t))),...Array.isArray(i)?i:[i]]))),st=(e,t)=>{const n=h((({className:n,...r},o)=>{return g(it,{ref:o,iconNode:t,className:rt(`lucide-${i=e,i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var i}));return n.displayName=`${e}`,n},at=st("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"}]]),lt=st("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.453.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.9.
|
|
3
|
+
"version": "4.9.5",
|
|
4
4
|
"description": "Link plugin for Yoopta Editor",
|
|
5
5
|
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"lucide-react": "^0.379.0"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "8a9a0b0f1e8dc5963232b1d33988562acbcffc46"
|
|
41
41
|
}
|