@yoopta/callout 4.9.9 → 6.0.0-beta.1

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.
@@ -1,5 +1,5 @@
1
- import { YooEditor, YooptaPathIndex } from '@yoopta/editor';
2
- import { CalloutElement, CalloutElementProps, CalloutTheme } from '../types';
1
+ import type { YooEditor, YooptaPathIndex } from '@yoopta/editor';
2
+ import type { CalloutElement, CalloutElementProps, CalloutTheme } from '../types';
3
3
  type CalloutElementOptions = {
4
4
  text?: string;
5
5
  props?: Omit<CalloutElementProps, 'nodeType'>;
@@ -16,4 +16,4 @@ export type CalloutCommands = {
16
16
  };
17
17
  export declare const CalloutCommands: CalloutCommands;
18
18
  export {};
19
- //# sourceMappingURL=CalloutCommands.d.ts.map
19
+ //# sourceMappingURL=callout-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callout-commands.d.ts","sourceRoot":"","sources":["../../src/commands/callout-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EAEnB,YAAY,EACb,MAAM,UAAU,CAAC;AAElB,KAAK,qBAAqB,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;CAC/C,CAAC;AAEF,KAAK,oBAAoB,GAAG,qBAAqB,GAAG;IAClD,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,oBAAoB,EAAE,CACpB,MAAM,EAAE,SAAS,EACjB,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,KACrC,cAAc,CAAC;IACpB,aAAa,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,KAAK,IAAI,CAAC;IACpF,aAAa,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,kBAAkB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CACvF,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,eAyB7B,CAAC"}
@@ -1,3 +1,3 @@
1
- import { SlateEditor, YooEditor } from '@yoopta/editor';
1
+ import type { SlateEditor, YooEditor } from '@yoopta/editor';
2
2
  export declare function withCalloutNormalize(slate: SlateEditor, editor: YooEditor): import("slate-react").ReactEditor;
3
- //# sourceMappingURL=withCalloutNormalize.d.ts.map
3
+ //# sourceMappingURL=with-callout-normalize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-callout-normalize.d.ts","sourceRoot":"","sources":["../../src/extensions/with-callout-normalize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG7D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,qCAmEzE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with-callout-normalize.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-callout-normalize.test.d.ts","sourceRoot":"","sources":["../../src/extensions/with-callout-normalize.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import type { SlateEditor, YooEditor } from '@yoopta/editor';
2
+ export declare function withCallout(slate: SlateEditor, editor: YooEditor): import("slate-react").ReactEditor;
3
+ //# sourceMappingURL=with-callout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-callout.d.ts","sourceRoot":"","sources":["../../src/extensions/with-callout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAI7D,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,qCAIhE"}
package/dist/index.d.ts CHANGED
@@ -1,12 +1,6 @@
1
- import { Callout } from './plugin/CalloutPlugin';
1
+ import { Callout } from './plugin/callout-plugin';
2
2
  import { CalloutElement, CalloutElementProps } from './types';
3
- import './styles.css';
4
- declare module 'slate' {
5
- interface CustomTypes {
6
- Element: CalloutElement;
7
- }
8
- }
9
- export { CalloutCommands } from './commands/CalloutCommands';
3
+ export { CalloutCommands } from './commands/callout-commands';
10
4
  export default Callout;
11
5
  export { CalloutElement, CalloutElementProps };
12
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,cAAc,CAAC;AAEtB,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,WAAW;QACnB,OAAO,EAAE,cAAc,CAAC;KACzB;CACF;AAED,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1 @@
1
- import{generateId as e,buildBlockData as t,Blocks as r,Elements as o,UI as n,useBlockData as a,useYooptaEditor as i,useYooptaReadOnly as s,YooptaPlugin as c,deserializeTextNodes as l,serializeTextNodes as u,serializeTextNodesIntoMarkdown as f}from"@yoopta/editor";import{jsxs as p,jsx as d}from"react/jsx-runtime";import*as h from"react";const g={buildCalloutElements:(t,r={})=>({id:e(),type:"callout",children:[{text:(null==r?void 0:r.text)||""}],props:r.props}),insertCallout:(e,o={})=>{const{at:n,focus:a,text:i,props:s}=o,c=g.buildCalloutElements(e,{text:i,props:s}),l=t({value:[c],type:"Callout"});r.insertBlock(e,l.type,{at:n,focus:a,blockData:l})},deleteCallout:(e,t)=>{r.deleteBlock(e,{blockId:t})},updateCalloutTheme:(e,t,r)=>{o.updateElement(e,t,{type:"callout",props:{theme:r}})}};
2
- /*!
3
- * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
4
- *
5
- * Copyright (c) 2014-2017, Jon Schlinkert.
6
- * Released under the MIT License.
7
- */function y(e){return"[object Object]"===Object.prototype.toString.call(e)}function v(e){var t,r;return!1!==y(e)&&(void 0===(t=e.constructor)||!1!==y(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}var b=Symbol.for("immer-nothing"),m=Symbol.for("immer-draftable"),w=Symbol.for("immer-state");function _(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var O=Object.getPrototypeOf;function x(e){return!!e&&!!e[w]}function P(e){return!!e&&(j(e)||Array.isArray(e)||!!e[m]||!!e.constructor?.[m]||A(e)||T(e))}var k=Object.prototype.constructor.toString();function j(e){if(!e||"object"!=typeof e)return!1;const t=O(e);if(null===t)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===k}function E(e,t){0===N(e)?Reflect.ownKeys(e).forEach((r=>{t(r,e[r],e)})):e.forEach(((r,o)=>t(o,r,e)))}function N(e){const t=e[w];return t?t.type_:Array.isArray(e)?1:A(e)?2:T(e)?3:0}function C(e,t){return 2===N(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function S(e,t,r){const o=N(e);2===o?e.set(t,r):3===o?e.add(r):e[t]=r}function A(e){return e instanceof Map}function T(e){return e instanceof Set}function B(e){return e.copy_||e.base_}function D(e,t){if(A(e))return new Map(e);if(T(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&j(e)){if(!O(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const r=Object.getOwnPropertyDescriptors(e);delete r[w];let o=Reflect.ownKeys(r);for(let t=0;t<o.length;t++){const n=o[t],a=r[n];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[n]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[n]})}return Object.create(O(e),r)}function z(e,t=!1){return L(e)||x(e)||!P(e)||(N(e)>1&&(e.set=e.add=e.clear=e.delete=R),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>z(t,!0)))),e}function R(){_(2)}function L(e){return Object.isFrozen(e)}var M,q={};function F(e){const t=q[e];return t||_(0),t}function $(){return M}function I(e,t){t&&(F("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function V(e){W(e),e.drafts_.forEach(J),e.drafts_=null}function W(e){e===M&&(M=e.parent_)}function Z(e){return M={drafts_:[],parent_:M,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function J(e){const t=e[w];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function K(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return void 0!==e&&e!==r?(r[w].modified_&&(V(t),_(4)),P(e)&&(e=H(t,e),t.parent_||G(t,e)),t.patches_&&F("Patches").generateReplacementPatches_(r[w].base_,e,t.patches_,t.inversePatches_)):e=H(t,r,[]),V(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==b?e:void 0}function H(e,t,r){if(L(t))return t;const o=t[w];if(!o)return E(t,((n,a)=>U(e,o,t,n,a,r))),t;if(o.scope_!==e)return t;if(!o.modified_)return G(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const t=o.copy_;let n=t,a=!1;3===o.type_&&(n=new Set(t),t.clear(),a=!0),E(n,((n,i)=>U(e,o,t,n,i,r,a))),G(e,t,!1),r&&e.patches_&&F("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function U(e,t,r,o,n,a,i){if(x(n)){const i=H(e,n,a&&t&&3!==t.type_&&!C(t.assigned_,o)?a.concat(o):void 0);if(S(r,o,i),!x(i))return;e.canAutoFreeze_=!1}else i&&r.add(n);if(P(n)&&!L(n)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;H(e,n),t&&t.scope_.parent_||"symbol"==typeof o||!Object.prototype.propertyIsEnumerable.call(r,o)||G(e,n)}}function G(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&z(t,r)}var X={get(e,t){if(t===w)return e;const r=B(e);if(!C(r,t))return function(e,t,r){const o=ee(t,r);return o?"value"in o?o.value:o.get?.call(e.draft_):void 0}(e,r,t);const o=r[t];return e.finalized_||!P(o)?o:o===Y(e.base_,t)?(re(e),e.copy_[t]=oe(o,e)):o},has:(e,t)=>t in B(e),ownKeys:e=>Reflect.ownKeys(B(e)),set(e,t,r){const o=ee(B(e),t);if(o?.set)return o.set.call(e.draft_,r),!0;if(!e.modified_){const o=Y(B(e),t),i=o?.[w];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(((n=r)===(a=o)?0!==n||1/n==1/a:n!=n&&a!=a)&&(void 0!==r||C(e.base_,t)))return!0;re(e),te(e)}var n,a;return e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Y(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,re(e),te(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const r=B(e),o=Reflect.getOwnPropertyDescriptor(r,t);return o?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:o.enumerable,value:r[t]}:o},defineProperty(){_(11)},getPrototypeOf:e=>O(e.base_),setPrototypeOf(){_(12)}},Q={};function Y(e,t){const r=e[w];return(r?B(r):e)[t]}function ee(e,t){if(!(t in e))return;let r=O(e);for(;r;){const e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=O(r)}}function te(e){e.modified_||(e.modified_=!0,e.parent_&&te(e.parent_))}function re(e){e.copy_||(e.copy_=D(e.base_,e.scope_.immer_.useStrictShallowCopy_))}E(X,((e,t)=>{Q[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Q.deleteProperty=function(e,t){return Q.set.call(this,e,t,void 0)},Q.set=function(e,t,r){return X.set.call(this,e[0],t,r,e[0])};function oe(e,t){const r=A(e)?F("MapSet").proxyMap_(e,t):T(e)?F("MapSet").proxySet_(e,t):function(e,t){const r=Array.isArray(e),o={type_:r?1:0,scope_:t?t.scope_:$(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let n=o,a=X;r&&(n=[o],a=Q);const{revoke:i,proxy:s}=Proxy.revocable(n,a);return o.draft_=s,o.revoke_=i,s}(e,t);return(t?t.scope_:$()).drafts_.push(r),r}function ne(e){if(!P(e)||L(e))return e;const t=e[w];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=D(e,t.scope_.immer_.useStrictShallowCopy_)}else r=D(e,!0);return E(r,((e,t)=>{S(r,e,ne(t))})),t&&(t.finalized_=!1),r}var ae=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,r)=>{if("function"==typeof e&&"function"!=typeof t){const r=t;t=e;const o=this;return function(e=r,...n){return o.produce(e,(e=>t.call(this,e,...n)))}}let o;if("function"!=typeof t&&_(6),void 0!==r&&"function"!=typeof r&&_(7),P(e)){const n=Z(this),a=oe(e,void 0);let i=!0;try{o=t(a),i=!1}finally{i?V(n):W(n)}return I(n,r),K(o,n)}if(!e||"object"!=typeof e){if(o=t(e),void 0===o&&(o=e),o===b&&(o=void 0),this.autoFreeze_&&z(o,!0),r){const t=[],n=[];F("Patches").generateReplacementPatches_(e,o,t,n),r(t,n)}return o}_(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...r)=>this.produceWithPatches(t,(t=>e(t,...r)));let r,o;return[this.produce(e,t,((e,t)=>{r=e,o=t})),r,o]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){P(e)||_(8),x(e)&&(e=function(e){x(e)||_(10);return ne(e)}(e));const t=Z(this),r=oe(e,void 0);return r[w].isManual_=!0,W(t),r}finishDraft(e,t){const r=e&&e[w];r&&r.isManual_||_(9);const{scope_:o}=r;return I(o,t),K(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const o=t[r];if(0===o.path.length&&"replace"===o.op){e=o.value;break}}r>-1&&(t=t.slice(r+1));const o=F("Patches").applyPatches_;return x(e)?o(e,t):this.produce(e,(e=>o(e,t)))}},ie=ae.produce;ae.produceWithPatches.bind(ae),ae.setAutoFreeze.bind(ae),ae.setUseStrictShallowCopy.bind(ae),ae.applyPatches.bind(ae);var se=ae.createDraft.bind(ae),ce=ae.finishDraft.bind(ae),le={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,o=le.levels(e,t);return o=r?o.slice(1):o.slice(0,-1)},common(e,t){for(var r=[],o=0;o<e.length&&o<t.length;o++){var n=e[o];if(n!==t[o])break;r.push(n)}return r},compare(e,t){for(var r=Math.min(e.length,t.length),o=0;o<r;o++){if(e[o]<t[o])return-1;if(e[o]>t[o])return 1}return 0},endsAfter(e,t){var r=e.length-1,o=e.slice(0,r),n=t.slice(0,r),a=e[r],i=t[r];return le.equals(o,n)&&a>i},endsAt(e,t){var r=e.length,o=e.slice(0,r),n=t.slice(0,r);return le.equals(o,n)},endsBefore(e,t){var r=e.length-1,o=e.slice(0,r),n=t.slice(0,r),a=e[r],i=t[r];return le.equals(o,n)&&a<i},equals:(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r])),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===le.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===le.compare(e,t),isBefore:(e,t)=>-1===le.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===le.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===le.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===le.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===le.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 r=e.slice(0,-1),o=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&le.equals(r,o)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,o=[],n=0;n<=e.length;n++)o.push(e.slice(0,n));return r&&o.reverse(),o},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(!le.isAncestor(t,e)&&!le.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 r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var o=[...e],{affinity:n="forward"}=r;if(0===e.length)return o;switch(t.type){case"insert_node":var{path:a}=t;(le.equals(a,o)||le.endsBefore(a,o)||le.isAncestor(a,o))&&(o[a.length-1]+=1);break;case"remove_node":var{path:i}=t;if(le.equals(i,o)||le.isAncestor(i,o))return null;le.endsBefore(i,o)&&(o[i.length-1]-=1);break;case"merge_node":var{path:s,position:c}=t;le.equals(s,o)||le.endsBefore(s,o)?o[s.length-1]-=1:le.isAncestor(s,o)&&(o[s.length-1]-=1,o[s.length]+=c);break;case"split_node":var{path:l,position:u}=t;if(le.equals(l,o)){if("forward"===n)o[o.length-1]+=1;else if("backward"!==n)return null}else le.endsBefore(l,o)?o[l.length-1]+=1:le.isAncestor(l,o)&&e[l.length]>=u&&(o[l.length-1]+=1,o[l.length]-=u);break;case"move_node":var{path:f,newPath:p}=t;if(le.equals(f,p))return o;if(le.isAncestor(f,o)||le.equals(f,o)){var d=p.slice();return le.endsBefore(f,p)&&f.length<p.length&&(d[f.length-1]-=1),d.concat(o.slice(f.length))}le.isSibling(f,p)&&(le.isAncestor(p,o)||le.equals(p,o))?le.endsBefore(f,o)?o[f.length-1]-=1:o[f.length-1]+=1:le.endsBefore(p,o)||le.equals(p,o)||le.isAncestor(p,o)?(le.endsBefore(f,o)&&(o[f.length-1]-=1),o[p.length-1]+=1):le.endsBefore(f,o)&&(le.equals(p,o)&&(o[p.length-1]+=1),o[f.length-1]-=1)}return o}};function ue(e){return ue="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},ue(e)}function fe(e){var t=function(e,t){if("object"!==ue(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==ue(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ue(t)?t:String(t)}function pe(e,t,r){return(t=fe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function de(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function he(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?de(Object(r),!0).forEach((function(t){pe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):de(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ge={transform(e,t){e.children=se(e.children);var r=e.selection&&se(e.selection);try{r=((e,t,r)=>{switch(r.type){case"insert_node":var{path:o,node:n}=r,a=Ne.parent(e,o),i=o[o.length-1];if(i>a.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(o,"] because the destination is past the end of the node."));if(a.children.splice(i,0,n),t)for(var[s,c]of Oe.points(t))t[c]=Re.transform(s,r);break;case"insert_text":var{path:l,offset:u,text:f}=r;if(0===f.length)break;var p=Ne.leaf(e,l),d=p.text.slice(0,u),h=p.text.slice(u);if(p.text=d+f+h,t)for(var[g,y]of Oe.points(t))t[y]=Re.transform(g,r);break;case"merge_node":var{path:v}=r,b=Ne.get(e,v),m=le.previous(v),w=Ne.get(e,m),_=Ne.parent(e,v),O=v[v.length-1];if(We.isText(b)&&We.isText(w))w.text+=b.text;else{if(We.isText(b)||We.isText(w))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(v,"] to nodes of different interfaces: ").concat(Me.stringify(b)," ").concat(Me.stringify(w)));w.children.push(...b.children)}if(_.children.splice(O,1),t)for(var[x,P]of Oe.points(t))t[P]=Re.transform(x,r);break;case"move_node":var{path:k,newPath:j}=r;if(le.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),N=Ne.parent(e,k),C=k[k.length-1];N.children.splice(C,1);var S=le.transform(k,r),A=Ne.get(e,le.parent(S)),T=S[S.length-1];if(A.children.splice(T,0,E),t)for(var[B,D]of Oe.points(t))t[D]=Re.transform(B,r);break;case"remove_node":var{path:z}=r,R=z[z.length-1];if(Ne.parent(e,z).children.splice(R,1),t)for(var[L,M]of Oe.points(t)){var q=Re.transform(L,r);if(null!=t&&null!=q)t[M]=q;else{var F=void 0,$=void 0;for(var[I,V]of Ne.texts(e)){if(-1!==le.compare(V,z)){$=[I,V];break}F=[I,V]}var W=!1;F&&$&&(W=le.equals($[1],z)?!le.hasPrevious($[1]):le.common(F[1],z).length<le.common($[1],z).length),F&&!W?(L.path=F[1],L.offset=F[0].text.length):$?(L.path=$[1],L.offset=0):t=null}}break;case"remove_text":var{path:Z,offset:J,text:K}=r;if(0===K.length)break;var H=Ne.leaf(e,Z),U=H.text.slice(0,J),G=H.text.slice(J+K.length);if(H.text=U+G,t)for(var[X,Q]of Oe.points(t))t[Q]=Re.transform(X,r);break;case"set_node":var{path:Y,properties:ee,newProperties:te}=r;if(0===Y.length)throw new Error("Cannot set properties on the root node!");var re=Ne.get(e,Y);for(var oe in te){if("children"===oe||"text"===oe)throw new Error('Cannot set the "'.concat(oe,'" property of nodes!'));var ne=te[oe];null==ne?delete re[oe]:re[oe]=ne}for(var ae in ee)te.hasOwnProperty(ae)||delete re[ae];break;case"set_selection":var{newProperties:ie}=r;if(null==ie)t=ie;else{if(null==t){if(!Oe.isRange(ie))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Me.stringify(ie)," when there is no current selection."));t=he({},ie)}for(var se in ie){var ce=ie[se];if(null==ce){if("anchor"===se||"focus"===se)throw new Error('Cannot remove the "'.concat(se,'" selection property'));delete t[se]}else t[se]=ce}}break;case"split_node":var{path:ue,position:fe,properties:pe}=r;if(0===ue.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(ue,"] because the root node cannot be split."));var de,ge=Ne.get(e,ue),ye=Ne.parent(e,ue),ve=ue[ue.length-1];if(We.isText(ge)){var be=ge.text.slice(0,fe),me=ge.text.slice(fe);ge.text=be,de=he(he({},pe),{},{text:me})}else{var we=ge.children.slice(0,fe),_e=ge.children.slice(fe);ge.children=we,de=he(he({},pe),{},{children:_e})}if(ye.children.splice(ve+1,0,de),t)for(var[xe,Pe]of Oe.points(t))t[Pe]=Re.transform(xe,r)}return t})(e,r,t)}finally{e.children=ce(e.children),e.selection=r?x(r)?ce(r):r:null}}},ye={insertNodes(e,t,r){e.insertNodes(t,r)},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,r){e.setNodes(t,r)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,r){e.unsetNodes(t,r)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,r){e.wrapNodes(t,r)}},ve={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,r){e.setPoint(t,r)},setSelection(e,t){e.setSelection(t)}},be=(e,t)=>{for(var r in e){var o=e[r],n=t[r];if(v(o)&&v(n)){if(!be(o,n))return!1}else if(Array.isArray(o)&&Array.isArray(n)){if(o.length!==n.length)return!1;for(var a=0;a<o.length;a++)if(o[a]!==n[a])return!1}else if(o!==n)return!1}for(var i in t)if(void 0===e[i]&&void 0!==t[i])return!1;return!0};function me(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var we=["anchor","focus"];function _e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}var Oe={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,{anchor:o,focus:n}=e;return Oe.isBackward(e)===r?[o,n]:[n,o]},end(e){var[,t]=Oe.edges(e);return t},equals:(e,t)=>Re.equals(e.anchor,t.anchor)&&Re.equals(e.focus,t.focus),includes(e,t){if(Oe.isRange(t)){if(Oe.includes(e,t.anchor)||Oe.includes(e,t.focus))return!0;var[r,o]=Oe.edges(e),[n,a]=Oe.edges(t);return Re.isBefore(r,n)&&Re.isAfter(o,a)}var[i,s]=Oe.edges(e),c=!1,l=!1;return Re.isPoint(t)?(c=Re.compare(t,i)>=0,l=Re.compare(t,s)<=0):(c=le.compare(t,i.path)>=0,l=le.compare(t,s.path)<=0),c&&l},intersection(e,t){var r=me(e,we),[o,n]=Oe.edges(e),[a,i]=Oe.edges(t),s=Re.isBefore(o,a)?a:o,c=Re.isBefore(n,i)?n:i;return Re.isBefore(c,s)?null:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(r),!0).forEach((function(t){pe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({anchor:s,focus:c},r)},isBackward(e){var{anchor:t,focus:r}=e;return Re.isAfter(t,r)},isCollapsed(e){var{anchor:t,focus:r}=e;return Re.equals(t,r)},isExpanded:e=>!Oe.isCollapsed(e),isForward:e=>!Oe.isBackward(e),isRange:e=>v(e)&&Re.isPoint(e.anchor)&&Re.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=Oe.edges(e);return t},transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return ie(e,(e=>{if(null===e)return null;var o,n,{affinity:a="inward"}=r;if("inward"===a){var i=Oe.isCollapsed(e);Oe.isForward(e)?(o="forward",n=i?o:"backward"):(o="backward",n=i?o:"forward")}else"outward"===a?Oe.isForward(e)?(o="backward",n="forward"):(o="forward",n="backward"):(o=a,n=a);var s=Re.transform(e.anchor,t,{affinity:o}),c=Re.transform(e.focus,t,{affinity:n});if(!s||!c)return null;e.anchor=s,e.focus=c}))}},xe=e=>v(e)&&Ne.isNodeList(e.children)&&!Be.isEditor(e),Pe={isAncestor:e=>v(e)&&Ne.isNodeList(e.children),isElement:xe,isElementList:e=>Array.isArray(e)&&e.every((e=>Pe.isElement(e))),isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return xe(e)&&e[r]===t},matches(e,t){for(var r in t)if("children"!==r&&e[r]!==t[r])return!1;return!0}},ke=["children"],je=["text"],Ee=new WeakMap,Ne={ancestor(e,t){var r=Ne.get(e,t);if(We.isText(r))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Me.stringify(r)));return r},ancestors(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var o of le.ancestors(t,r)){var n=[Ne.ancestor(e,o),o];yield n}}()},child(e,t){if(We.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Me.stringify(e)));var r=e.children[t];if(null==r)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Me.stringify(e)));return r},children(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:o=!1}=r,n=Ne.ancestor(e,t),{children:a}=n,i=o?a.length-1:0;o?i>=0:i<a.length;){var s=Ne.child(n,i),c=t.concat(i);yield[s,c],i=o?i-1:i+1}}()},common(e,t,r){var o=le.common(t,r);return[Ne.get(e,o),o]},descendant(e,t){var r=Ne.get(e,t);if(Be.isEditor(r))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Me.stringify(r)));return r},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,o]of Ne.nodes(e,t))0!==o.length&&(yield[r,o])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,o]of Ne.nodes(e,t))Pe.isElement(r)&&(yield[r,o])}()},extractProps:e=>Pe.isAncestor(e)?me(e,ke):me(e,je),first(e,t){for(var r=t.slice(),o=Ne.get(e,r);o&&!We.isText(o)&&0!==o.children.length;)o=o.children[0],r.push(0);return[o,r]},fragment(e,t){if(We.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(Me.stringify(e)));return ie({children:e.children},(e=>{var[r,o]=Oe.edges(t),n=Ne.nodes(e,{reverse:!0,pass:e=>{var[,r]=e;return!Oe.includes(t,r)}});for(var[,a]of n){if(!Oe.includes(t,a)){var i=Ne.parent(e,a),s=a[a.length-1];i.children.splice(s,1)}if(le.equals(a,o.path)){var c=Ne.leaf(e,a);c.text=c.text.slice(0,o.offset)}if(le.equals(a,r.path)){var l=Ne.leaf(e,a);l.text=l.text.slice(r.offset)}}Be.isEditor(e)&&(e.selection=null)})).children},get(e,t){for(var r=e,o=0;o<t.length;o++){var n=t[o];if(We.isText(r)||!r.children[n])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Me.stringify(e)));r=r.children[n]}return r},has(e,t){for(var r=e,o=0;o<t.length;o++){var n=t[o];if(We.isText(r)||!r.children[n])return!1;r=r.children[n]}return!0},isNode:e=>We.isText(e)||Pe.isElement(e)||Be.isEditor(e),isNodeList(e){if(!Array.isArray(e))return!1;var t=Ee.get(e);if(void 0!==t)return t;var r=e.every((e=>Ne.isNode(e)));return Ee.set(e,r),r},last(e,t){for(var r=t.slice(),o=Ne.get(e,r);o&&!We.isText(o)&&0!==o.children.length;){var n=o.children.length-1;o=o.children[n],r.push(n)}return[o,r]},leaf(e,t){var r=Ne.get(e,t);if(!We.isText(r))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Me.stringify(r)));return r},levels(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var o of le.levels(t,r)){var n=Ne.get(e,o);yield[n,o]}}()},matches:(e,t)=>Pe.isElement(e)&&Pe.isElementProps(t)&&Pe.matches(e,t)||We.isText(e)&&We.isTextProps(t)&&We.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:r,reverse:o=!1}=t,{from:n=[],to:a}=t,i=new Set,s=[],c=e;!a||!(o?le.isBefore(s,a):le.isAfter(s,a));)if(i.has(c)||(yield[c,s]),i.has(c)||We.isText(c)||0===c.children.length||null!=r&&!1!==r([c,s])){if(0===s.length)break;if(!o){var l=le.next(s);if(Ne.has(e,l)){s=l,c=Ne.get(e,s);continue}}if(o&&0!==s[s.length-1])s=le.previous(s),c=Ne.get(e,s);else s=le.parent(s),c=Ne.get(e,s),i.add(c)}else{i.add(c);var u=o?c.children.length-1:0;le.isAncestor(s,n)&&(u=n[s.length]),s=s.concat(u),c=Ne.get(e,s)}}()},parent(e,t){var r=le.parent(t),o=Ne.get(e,r);if(We.isText(o))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return o},string:e=>We.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[r,o]of Ne.nodes(e,t))We.isText(r)&&(yield[r,o])}()}};function Ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function Se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(r),!0).forEach((function(t){pe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ae={isNodeOperation:e=>Ae.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!v(e))return!1;switch(e.type){case"insert_node":case"remove_node":return le.isPath(e.path)&&Ne.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&le.isPath(e.path);case"merge_node":return"number"==typeof e.position&&le.isPath(e.path)&&v(e.properties);case"move_node":return le.isPath(e.path)&&le.isPath(e.newPath);case"set_node":return le.isPath(e.path)&&v(e.properties)&&v(e.newProperties);case"set_selection":return null===e.properties&&Oe.isRange(e.newProperties)||null===e.newProperties&&Oe.isRange(e.properties)||v(e.properties)&&v(e.newProperties);case"split_node":return le.isPath(e.path)&&"number"==typeof e.position&&v(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every((e=>Ae.isOperation(e))),isSelectionOperation:e=>Ae.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>Ae.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return Se(Se({},e),{},{type:"remove_node"});case"insert_text":return Se(Se({},e),{},{type:"remove_text"});case"merge_node":return Se(Se({},e),{},{type:"split_node",path:le.previous(e.path)});case"move_node":var{newPath:t,path:r}=e;if(le.equals(t,r))return e;if(le.isSibling(r,t))return Se(Se({},e),{},{path:t,newPath:r});var o=le.transform(r,e),n=le.transform(le.next(r),e);return Se(Se({},e),{},{path:o,newPath:n});case"remove_node":return Se(Se({},e),{},{type:"insert_node"});case"remove_text":return Se(Se({},e),{},{type:"insert_text"});case"set_node":var{properties:a,newProperties:i}=e;return Se(Se({},e),{},{properties:i,newProperties:a});case"set_selection":var{properties:s,newProperties:c}=e;return Se(Se({},e),{},null==s?{properties:c,newProperties:null}:null==c?{properties:null,newProperties:s}:{properties:c,newProperties:s});case"split_node":return Se(Se({},e),{},{type:"merge_node",path:le.next(e.path)})}}},Te=new WeakMap,Be={above:(e,t)=>e.above(t),addMark(e,t,r){e.addMark(t,r)},after:(e,t,r)=>e.after(t,r),before:(e,t,r)=>e.before(t,r),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteBackward(r)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteForward(r)},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,r){e.insertFragment(t,r)},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,r)=>e.isEdge(t,r),isEditor:e=>(e=>{var t=Te.get(e);if(void 0!==t)return t;if(!v(e))return!1;var r="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||v(e.marks))&&(null===e.selection||Oe.isRange(e.selection))&&Ne.isNodeList(e.children)&&Ae.isOperationList(e.operations);return Te.set(e,r),r})(e),isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,r)=>e.isEnd(t,r),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,r)=>e.isStart(t,r),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,r)=>e.leaf(t,r),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,r)=>e.node(t,r),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,r)=>e.parent(t,r),path:(e,t,r)=>e.path(t,r),pathRef:(e,t,r)=>e.pathRef(t,r),pathRefs:e=>e.pathRefs(),point:(e,t,r)=>e.point(t,r),pointRef:(e,t,r)=>e.pointRef(t,r),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,r)=>e.range(t,r),rangeRef:(e,t,r)=>e.rangeRef(t,r),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,r)=>e.string(t,r),unhangRange:(e,t,r)=>e.unhangRange(t,r),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)}};function De(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function ze(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?De(Object(r),!0).forEach((function(t){pe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):De(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Re={compare(e,t){var r=le.compare(e.path,t.path);return 0===r?e.offset<t.offset?-1:e.offset>t.offset?1:0:r},isAfter:(e,t)=>1===Re.compare(e,t),isBefore:(e,t)=>-1===Re.compare(e,t),equals:(e,t)=>e.offset===t.offset&&le.equals(e.path,t.path),isPoint:e=>v(e)&&"number"==typeof e.offset&&le.isPath(e.path),transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return ie(e,(e=>{if(null===e)return null;var{affinity:o="forward"}=r,{path:n,offset:a}=e;switch(t.type){case"insert_node":case"move_node":e.path=le.transform(n,t,r);break;case"insert_text":le.equals(t.path,n)&&(t.offset<a||t.offset===a&&"forward"===o)&&(e.offset+=t.text.length);break;case"merge_node":le.equals(t.path,n)&&(e.offset+=t.position),e.path=le.transform(n,t,r);break;case"remove_text":le.equals(t.path,n)&&t.offset<=a&&(e.offset-=Math.min(a-t.offset,t.text.length));break;case"remove_node":if(le.equals(t.path,n)||le.isAncestor(t.path,n))return null;e.path=le.transform(n,t,r);break;case"split_node":if(le.equals(t.path,n)){if(t.position===a&&null==o)return null;(t.position<a||t.position===a&&"forward"===o)&&(e.offset-=t.position,e.path=le.transform(n,t,ze(ze({},r),{},{affinity:"forward"})))}else e.path=le.transform(n,t,r)}}))}},Le=void 0,Me={setScrubber(e){Le=e},stringify:e=>JSON.stringify(e,Le)},qe=["text"],Fe=["anchor","focus"];function $e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function Ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$e(Object(r),!0).forEach((function(t){pe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$e(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ve,We={equals(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:o=!1}=r;function n(e){return me(e,qe)}return be(o?n(e):e,o?n(t):t)},isText:e=>v(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every((e=>We.isText(e))),isTextProps:e=>void 0!==e.text,matches(e,t){for(var r in t)if("text"!==r&&(!e.hasOwnProperty(r)||e[r]!==t[r]))return!1;return!0},decorations(e,t){var r=[Ie({},e)];for(var o of t){var n=me(o,Fe),[a,i]=Oe.edges(o),s=[],c=0,l=a.offset,u=i.offset;for(var f of r){var{length:p}=f.text,d=c;if(c+=p,l<=d&&c<=u)Object.assign(f,n),s.push(f);else if(l!==u&&(l===c||u===d)||l>c||u<d||u===d&&0!==d)s.push(f);else{var h=f,g=void 0,y=void 0;if(u<c){var v=u-d;y=Ie(Ie({},h),{},{text:h.text.slice(v)}),h=Ie(Ie({},h),{},{text:h.text.slice(0,v)})}if(l>d){var b=l-d;g=Ie(Ie({},h),{},{text:h.text.slice(0,b)}),h=Ie(Ie({},h),{},{text:h.text.slice(b)})}Object.assign(h,n),g&&s.push(g),s.push(h),y&&s.push(y)}}r=s}return r}},Ze=e=>e.selection?e.selection:e.children.length>0?Be.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"}(Ve||(Ve={})),Ve.L,Ve.L,Ve.V,Ve.LV,Ve.LVT,Ve.LV,Ve.V,Ve.V,Ve.T,Ve.LVT,Ve.T,Ve.T,Ve.Any,Ve.Extend,Ve.ZWJ,Ve.Any,Ve.SpacingMark,Ve.Prepend,Ve.Any,Ve.ZWJ,Ve.ExtPict,Ve.RI,Ve.RI;var Je={delete(e,t){e.delete(t)},insertFragment(e,t,r){e.insertFragment(t,r)},insertText(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Be.withoutNormalizing(e,(()=>{var{voids:o=!1}=r,{at:n=Ze(e)}=r;if(le.isPath(n)&&(n=Be.range(e,n)),Oe.isRange(n))if(Oe.isCollapsed(n))n=n.anchor;else{var a=Oe.end(n);if(!o&&Be.void(e,{at:a}))return;var i=Oe.start(n),s=Be.pointRef(e,i),c=Be.pointRef(e,a);Xe.delete(e,{at:n,voids:o});var l=s.unref(),u=c.unref();n=l||u,Xe.setSelection(e,{anchor:n,focus:n})}if(!(!o&&Be.void(e,{at:n})||Be.elementReadOnly(e,{at:n}))){var{path:f,offset:p}=n;t.length>0&&e.apply({type:"insert_text",path:f,offset:p,text:t})}}))}};function Ke(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function He(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(r),!0).forEach((function(t){pe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ke(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ue,Ge,Xe=He(He(He(He({},ge),ye),ve),Je);function Qe(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}function Ye(){return Ye=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Ye.apply(this,arguments)}"function"==typeof SuppressedError&&SuppressedError;var et,tt=function(e){return h.createElement("svg",Ye({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"success_svg__lucide success_svg__lucide-circle-check"},e),Ue||(Ue=h.createElement("circle",{cx:12,cy:12,r:10})),Ge||(Ge=h.createElement("path",{d:"m9 12 2 2 4-4"})))};function rt(){return rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},rt.apply(this,arguments)}var ot,nt,at=function(e){return h.createElement("svg",rt({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"warning_svg__lucide warning_svg__lucide-triangle-alert"},e),et||(et=h.createElement("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4M12 17h.01"})))};function it(){return it=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},it.apply(this,arguments)}var st,ct,lt=function(e){return h.createElement("svg",it({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"error_svg__lucide error_svg__lucide-circle-x"},e),ot||(ot=h.createElement("circle",{cx:12,cy:12,r:10})),nt||(nt=h.createElement("path",{d:"m15 9-6 6M9 9l6 6"})))};function ut(){return ut=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},ut.apply(this,arguments)}var ft,pt=function(e){return h.createElement("svg",ut({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"default_svg__lucide default_svg__lucide-info"},e),st||(st=h.createElement("circle",{cx:12,cy:12,r:10})),ct||(ct=h.createElement("path",{d:"M12 16v-4M12 8h.01"})))};function dt(){return dt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},dt.apply(this,arguments)}var ht,gt=function(e){return h.createElement("svg",dt({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor","aria-label":"Note"},e),ft||(ft=h.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 1.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 7c0-3.14 2.56-5.7 5.7-5.7ZM7 0C3.14 0 0 3.14 0 7s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7Zm1 3H6v5h2V3Zm0 6H6v2h2V9Z"})))};function yt(){return yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},yt.apply(this,arguments)}var vt=function(e){return h.createElement("svg",yt({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:"checkmark_svg__lucide checkmark_svg__lucide-check"},e),ht||(ht=h.createElement("path",{d:"M20 6 9 17l-5-5"})))};const bt={default:{backgroundColor:"#f5f7f9",color:"#000"},info:{backgroundColor:"#e1f3fe",color:"#08a2e7",borderLeft:"4px solid #08a2e7"},success:{backgroundColor:"#d1fae5",color:"#12b77f",borderLeft:"4px solid #12b77f"},warning:{backgroundColor:"#fef3c9",color:"#f97415",borderLeft:"4px solid #f97415"},error:{backgroundColor:"#fee1e2",color:"#ee4443",borderLeft:"4px solid #ee4443"}},{ExtendedBlockActions:mt,BlockOptionsMenuGroup:wt,BlockOptionsMenuItem:_t,BlockOptionsSeparator:Ot}=n,xt=({editor:e,block:t,props:r})=>{const n=r=>{o.updateElement(e,t.id,{type:"callout",props:{theme:r}})},a=e=>(null==r?void 0:r.theme)===e;return p(mt,Object.assign({onClick:()=>e.setPath({current:t.meta.order}),className:"yoopta-callout-options"},{children:[d(Ot,{}),p(wt,{children:[d(_t,{children:p("button",Object.assign({type:"button",className:"yoopta-block-options-button yoo-callout-justify-between",onClick:()=>n("default"),style:{backgroundColor:a("default")?bt.default.backgroundColor:void 0}},{children:[p("span",Object.assign({className:"yoo-callout-flex"},{children:[d(pt,{width:16,height:16,color:bt.default.color,className:"yoo-callout-w-4 yoo-callout-h-4 yoo-callout-mr-2"}),"Default"]})),a("default")&&d(vt,{width:16,height:16,color:"#000",className:"yoo-callout-w-4 yoo-callout-h-4"})]}))}),d(_t,{children:p("button",Object.assign({type:"button",className:"yoopta-block-options-button yoo-callout-justify-between",onClick:()=>n("info"),style:{backgroundColor:a("info")?bt.info.backgroundColor:void 0}},{children:[p("span",Object.assign({className:"yoo-callout-flex"},{children:[d(gt,{width:16,height:16,color:bt.info.color,className:"yoo-callout-w-4 yoo-callout-h-4 yoo-callout-mr-2"}),"Info"]})),a("info")&&d(vt,{width:16,height:16,color:"#000",className:"yoo-callout-w-4 yoo-callout-h-4"})]}))}),d(_t,{children:p("button",Object.assign({type:"button",className:"yoopta-block-options-button yoo-callout-justify-between",onClick:()=>n("success"),style:{backgroundColor:a("success")?bt.success.backgroundColor:void 0}},{children:[p("span",Object.assign({className:"yoo-callout-flex"},{children:[d(tt,{width:16,height:16,color:bt.success.color,className:"yoo-callout-w-4 yoo-callout-h-4 yoo-callout-mr-2"}),"Success"]})),a("success")&&d(vt,{width:16,height:16,color:"#000",className:"yoo-callout-w-4 yoo-callout-h-4"})]}))}),d(_t,{children:p("button",Object.assign({type:"button",className:"yoopta-block-options-button yoo-callout-justify-between",onClick:()=>n("warning"),style:{backgroundColor:a("warning")?bt.warning.backgroundColor:void 0}},{children:[p("span",Object.assign({className:"yoo-callout-flex"},{children:[d(at,{width:16,height:16,color:bt.warning.color,className:"yoo-callout-w-4 yoo-callout-h-4 yoo-callout-mr-2"}),"Warning"]})),a("warning")&&d(vt,{width:16,height:16,color:"#000",className:"yoo-callout-w-4 yoo-callout-h-4"})]}))}),d(_t,{children:p("button",Object.assign({type:"button",className:"yoopta-block-options-button yoo-callout-justify-between",onClick:()=>n("error"),style:{backgroundColor:a("error")?bt.error.backgroundColor:void 0}},{children:[p("span",Object.assign({className:"yoo-callout-flex"},{children:[d(lt,{width:16,height:16,color:bt.error.color,className:"yoo-callout-w-4 yoo-callout-h-4 yoo-callout-mr-2"}),"Error"]})),a("error")&&d(vt,{width:16,height:16,color:"#000",className:"yoo-callout-w-4 yoo-callout-h-4"})]}))})]})]}))},Pt={default:pt,success:tt,warning:at,error:lt,info:gt},kt=e=>{var{extendRender:t}=e,r=Qe(e,["extendRender"]);const{element:o,attributes:n,children:c,blockId:l,HTMLAttributes:u={}}=r,{className:f=""}=u,h=Qe(u,["className"]),g=a(l),y=i(),v=s(),{theme:b="default"}=o.props||{};if(t)return t(r);const m=Pt[b];return p("div",Object.assign({className:`yoopta-callout yoopta-callout-theme-${b} ${f}`},h,n,{children:[d("div",Object.assign({className:"yoopta-callout-icon"},{children:d(m,{})})),!v&&d(xt,{block:g,editor:y,props:o.props}),c]}))};kt.displayName="Callout";const jt=new c({type:"Callout",elements:{callout:{render:kt,props:{theme:"default"}}},commands:g,extensions:function(e,t){return e=function(e,t){const{normalizeNode:r}=e;return e.normalizeNode=o=>{const[n,a]=o;if(0===a.length&&Be.isEditor(n)){const r=n.children.filter((e=>Pe.isElement(e)&&"callout"===e.type));if(r.length>1&&null!==t.path.current){const o=t.path.current,a=n.children.findIndex((e=>Pe.isElement(e)&&"callout"===e.type));if(-1===a)return;const i=r.slice(1).map((e=>Pe.isElement(e)?{id:e.id,type:"Callout",value:[e],meta:{align:"left",depth:0,order:o+1}}:null)).filter((e=>!!e));for(let t=n.children.length-1;t>=0;t--){const r=n.children[t];Pe.isElement(r)&&"callout"===r.type&&t!==a&&Xe.removeNodes(e,{at:[t]})}return void t.batchOperations((()=>{i.forEach(((e,r)=>{t.insertBlock("Callout",{at:o+r+1,blockData:{id:e.id,value:e.value,meta:e.meta}})}))}))}}r(o)},e}(e,t)},options:{display:{title:"Callout",description:"Make writing stand out"},shortcuts:["<"]},parsers:{html:{deserialize:{nodeNames:["DL"],parse(t,r){if("DL"===t.nodeName||"DIV"===t.nodeName){const o=t.getAttribute("data-theme");return{id:e(),type:"callout",children:l(r,t.childNodes),props:{theme:o}}}}},serialize:(e,t,r)=>{var o,n;const a=bt[(null===(o=e.props)||void 0===o?void 0:o.theme)||"default"],{align:i="left",depth:s=0}=r||{};return`<dl data-theme="${(null===(n=e.props)||void 0===n?void 0:n.theme)||"default"}" data-meta-align="${i}" data-meta-depth="${s}" style="margin-left: ${20*s}px; text-align: ${i}; padding: .5rem .5rem .5rem 1rem; margin-top: .5rem; border-radius: .375rem; color: ${a.color}; border-left: ${a.borderLeft||0}; background-color: ${a.backgroundColor}">${u(e.children)}</dl>`}},markdown:{serialize:(e,t)=>`> ${f(e.children)}`},email:{serialize:(e,t,r)=>{var o,n;const a=bt[(null===(o=e.props)||void 0===o?void 0:o.theme)||"default"],{align:i="left",depth:s=0}=r||{};return`\n <table style="width: 100%; ">\n <tbody style="width: 100%;">\n <tr>\n <td data-theme="${(null===(n=e.props)||void 0===n?void 0:n.theme)||"default"}" data-meta-align="${i}" data-meta-depth="${s}" style="\n font-size: 16px;\n line-height: 1.75rem;\n margin-left: ${20*s}px; text-align: ${i}; padding: .5rem .5rem .5rem 1rem; margin-top: .5rem; border-radius: .375rem; color: ${a.color}; border-left: ${a.borderLeft||0}; background-color: ${a.backgroundColor};">${u(e.children)}\n </td>\n </tr>\n </tbody>\n </table>`}}}});!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===r&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".yoo-callout-mr-2{margin-right:.5rem}.yoo-callout-flex{display:flex}.yoo-callout-h-4{height:1rem}.yoo-callout-w-4{width:1rem}.yoo-callout-justify-between{justify-content:space-between}.yoopta-callout .yoopta-callout-options{opacity:0;transition:opacity .15s ease-in-out}.yoopta-callout:hover .yoopta-callout-options{opacity:1}.yoopta-callout{border-radius:.375rem;font-size:16px;gap:.75rem;line-height:1.75rem;margin-top:.5rem;padding:.5rem .5rem .5rem 2.5rem;position:relative}.yoopta-callout-icon{left:1rem;margin-top:.375rem;position:absolute;top:.5rem;width:1rem}.yoopta-callout-theme-default{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(245 247 249/var(--tw-bg-opacity));color:rgb(0 0 0/var(--tw-text-opacity))}.yoopta-callout-theme-info{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(225 243 254/var(--tw-bg-opacity));border-left-color:rgb(8 162 231/var(--tw-border-opacity));border-left-width:4px;color:rgb(8 162 231/var(--tw-text-opacity))}.yoopta-callout-theme-success{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(209 250 229/var(--tw-bg-opacity));border-left-color:rgb(18 183 127/var(--tw-border-opacity));border-left-width:4px;color:rgb(18 183 127/var(--tw-text-opacity))}.yoopta-callout-theme-warning{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(254 243 201/var(--tw-bg-opacity));border-left-color:rgb(249 116 21/var(--tw-border-opacity));border-left-width:4px;color:rgb(249 116 21/var(--tw-text-opacity))}.yoopta-callout-theme-error{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(254 225 226/var(--tw-bg-opacity));border-left-color:rgb(238 68 67/var(--tw-border-opacity));border-left-width:4px;color:rgb(238 68 67/var(--tw-text-opacity))}");export{g as CalloutCommands,jt as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{generateId as t,buildBlockData as r,Blocks as n,Elements as o,YooptaPlugin as i,deserializeTextNodes as a,serializeTextNodes as s,serializeTextNodesIntoMarkdown as l}from"@yoopta/editor";const c={buildCalloutElements:(e,r={})=>({id:t(),type:"callout",children:[{text:(null==r?void 0:r.text)||""}],props:r.props}),insertCallout:(e,t={})=>{const{at:o,focus:i,text:a,props:s}=t,l=c.buildCalloutElements(e,{text:a,props:s}),f=r({value:[l],type:"Callout"});n.insertBlock(e,f.type,{at:o,focus:i,blockData:f})},deleteCallout:(e,t)=>{n.deleteBlock(e,{blockId:t})},updateCalloutTheme:(e,t,r)=>{o.updateElement(e,t,{type:"callout",props:{theme:r}})}};var f={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,n=f.levels(e,t);return n=r?n.slice(1):n.slice(0,-1)},common(e,t){for(var r=[],n=0;n<e.length&&n<t.length;n++){var o=e[n];if(o!==t[n])break;r.push(o)}return r},compare(e,t){for(var r=Math.min(e.length,t.length),n=0;n<r;n++){if(e[n]<t[n])return-1;if(e[n]>t[n])return 1}return 0},endsAfter(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),i=e[r],a=t[r];return f.equals(n,o)&&i>a},endsAt(e,t){var r=e.length,n=e.slice(0,r),o=t.slice(0,r);return f.equals(n,o)},endsBefore(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),i=e[r],a=t[r];return f.equals(n,o)&&i<a},equals:(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===f.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===f.compare(e,t),isBefore:(e,t)=>-1===f.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===f.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===f.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===f.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===f.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 r=e.slice(0,-1),n=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&f.equals(r,n)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,n=[],o=0;o<=e.length;o++)n.push(e.slice(0,o));return r&&n.reverse(),n},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(!f.isAncestor(t,e)&&!f.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 r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var n=[...e],{affinity:o="forward"}=r;if(0===e.length)return n;switch(t.type){case"insert_node":var{path:i}=t;(f.equals(i,n)||f.endsBefore(i,n)||f.isAncestor(i,n))&&(n[i.length-1]+=1);break;case"remove_node":var{path:a}=t;if(f.equals(a,n)||f.isAncestor(a,n))return null;f.endsBefore(a,n)&&(n[a.length-1]-=1);break;case"merge_node":var{path:s,position:l}=t;f.equals(s,n)||f.endsBefore(s,n)?n[s.length-1]-=1:f.isAncestor(s,n)&&(n[s.length-1]-=1,n[s.length]+=l);break;case"split_node":var{path:c,position:p}=t;if(f.equals(c,n)){if("forward"===o)n[n.length-1]+=1;else if("backward"!==o)return null}else f.endsBefore(c,n)?n[c.length-1]+=1:f.isAncestor(c,n)&&e[c.length]>=p&&(n[c.length-1]+=1,n[c.length]-=p);break;case"move_node":var{path:u,newPath:d}=t;if(f.equals(u,d))return n;if(f.isAncestor(u,n)||f.equals(u,n)){var h=d.slice();return f.endsBefore(u,d)&&u.length<d.length&&(h[u.length-1]-=1),h.concat(n.slice(u.length))}f.isSibling(u,d)&&(f.isAncestor(d,n)||f.equals(d,n))?f.endsBefore(u,n)?n[u.length-1]-=1:n[u.length-1]+=1:f.endsBefore(d,n)||f.equals(d,n)||f.isAncestor(d,n)?(f.endsBefore(u,n)&&(n[u.length-1]-=1),n[d.length-1]+=1):f.endsBefore(u,n)&&(f.equals(d,n)&&(n[d.length-1]+=1),n[u.length-1]-=1)}return n}};function p(e){return p="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},p(e)}function u(e){var t=function(e,t){if("object"!==p(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===p(t)?t:String(t)}function d(e,t,r){return(t=u(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var g=["anchor","focus"];function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var y={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,{anchor:n,focus:o}=e;return y.isBackward(e)===r?[n,o]:[o,n]},end(e){var[,t]=y.edges(e);return t},equals:(e,t)=>B.equals(e.anchor,t.anchor)&&B.equals(e.focus,t.focus),surrounds(e,t){var r=y.intersection(e,t);return!!r&&y.equals(r,t)},includes(e,t){if(y.isRange(t)){if(y.includes(e,t.anchor)||y.includes(e,t.focus))return!0;var[r,n]=y.edges(e),[o,i]=y.edges(t);return B.isBefore(r,o)&&B.isAfter(n,i)}var[a,s]=y.edges(e),l=!1,c=!1;return B.isPoint(t)?(l=B.compare(t,a)>=0,c=B.compare(t,s)<=0):(l=f.compare(t,a.path)>=0,c=f.compare(t,s.path)<=0),l&&c},intersection(e,t){var r=h(e,g),[n,o]=y.edges(e),[i,a]=y.edges(t),s=B.isBefore(n,i)?i:n,l=B.isBefore(o,a)?o:a;return B.isBefore(l,s)?null:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({anchor:s,focus:l},r)},isBackward(e){var{anchor:t,focus:r}=e;return B.isAfter(t,r)},isCollapsed(e){var{anchor:t,focus:r}=e;return B.equals(t,r)},isExpanded:e=>!y.isCollapsed(e),isForward:e=>!y.isBackward(e),isRange:e=>S(e)&&B.isPoint(e.anchor)&&B.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=y.edges(e);return t},transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var n,o,{affinity:i="inward"}=r;if("inward"===i){var a=y.isCollapsed(e);y.isForward(e)?(n="forward",o=a?n:"backward"):(n="backward",o=a?n:"forward")}else"outward"===i?y.isForward(e)?(n="backward",o="forward"):(n="forward",o="backward"):(n=i,o=i);var s=B.transform(e.anchor,t,{affinity:n}),l=B.transform(e.focus,t,{affinity:o});return s&&l?{anchor:s,focus:l}:null}},m=function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!S(e)&&("function"!=typeof e.apply&&(t?j.isNodeList(e.children):Array.isArray(e.children)))},b={isAncestor(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return S(e)&&j.isNodeList(e.children,{deep:t})},isElement:m,isElementList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>b.isElement(e,{deep:t}))},isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return m(e)&&e[r]===t},matches(e,t){for(var r in t)if("children"!==r&&e[r]!==t[r])return!1;return!0}},w=["children"],O=["text"];function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var j={ancestor(e,t){var r=j.get(e,t);if(M.isText(r))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(L.stringify(r)));return r},ancestors(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var n of f.ancestors(t,r)){var o=[j.ancestor(e,n),n];yield o}}()},child(e,t){if(M.isText(e))throw new Error("Cannot get the child of a text node: ".concat(L.stringify(e)));var r=e.children[t];if(null==r)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(L.stringify(e)));return r},children(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:n=!1}=r,o=j.ancestor(e,t),{children:i}=o,a=n?i.length-1:0;n?a>=0:a<i.length;){var s=j.child(o,a),l=t.concat(a);yield[s,l],a=n?a-1:a+1}}()},common(e,t,r){var n=f.common(t,r);return[j.get(e,n),n]},descendant(e,t){var r=j.get(e,t);if(C.isEditor(r))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(L.stringify(r)));return r},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of j.nodes(e,t))0!==n.length&&(yield[r,n])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of j.nodes(e,t))b.isElement(r)&&(yield[r,n])}()},extractProps:e=>b.isAncestor(e)?h(e,w):h(e,O),first(e,t){for(var r=t.slice(),n=j.get(e,r);n&&!M.isText(n)&&0!==n.children.length;)n=n.children[0],r.push(0);return[n,r]},fragment(e,t){var r={children:e.children},[n,o]=y.edges(t),i=j.nodes(r,{reverse:!0,pass:e=>{var[,r]=e;return!y.includes(t,r)}}),a=function(){if(!y.includes(t,s)){var e=s[s.length-1];K(r,f.parent(s),t=>G(t,e,1))}f.equals(s,o.path)&&Q(r,s,e=>{var t=e.text.slice(0,o.offset);return P(P({},e),{},{text:t})}),f.equals(s,n.path)&&Q(r,s,e=>{var t=e.text.slice(n.offset);return P(P({},e),{},{text:t})})};for(var[,s]of i)a();return r.children},get(e,t){var r=j.getIf(e,t);if(void 0===r)throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(L.stringify(e)));return r},getIf(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(M.isText(r)||!r.children[o])return;r=r.children[o]}return r},has(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(M.isText(r)||!r.children[o])return!1;r=r.children[o]}return!0},isNode(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return M.isText(e)||b.isElement(e,{deep:t})||C.isEditor(e,{deep:t})},isNodeList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>j.isNode(e,{deep:t}))},last(e,t){for(var r=t.slice(),n=j.get(e,r);n&&!M.isText(n)&&0!==n.children.length;){var o=n.children.length-1;n=n.children[o],r.push(o)}return[n,r]},leaf(e,t){var r=j.get(e,t);if(!M.isText(r))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(L.stringify(r)));return r},levels(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var n of f.levels(t,r)){var o=j.get(e,n);yield[o,n]}}()},matches:(e,t)=>b.isElement(e)&&b.isElementProps(t)&&b.matches(e,t)||M.isText(e)&&M.isTextProps(t)&&M.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:r,reverse:n=!1}=t,{from:o=[],to:i}=t,a=new Set,s=[],l=e;!i||!(n?f.isBefore(s,i):f.isAfter(s,i));)if(a.has(l)||(yield[l,s]),a.has(l)||M.isText(l)||0===l.children.length||null!=r&&!1!==r([l,s])){if(0===s.length)break;if(!n){var c=f.next(s);if(j.has(e,c)){s=c,l=j.get(e,s);continue}}if(n&&0!==s[s.length-1])s=f.previous(s),l=j.get(e,s);else s=f.parent(s),l=j.get(e,s),a.add(l)}else{a.add(l);var p=n?l.children.length-1:0;f.isAncestor(s,o)&&(p=o[s.length]),s=s.concat(p),l=j.get(e,s)}}()},parent(e,t){var r=f.parent(t),n=j.get(e,r);if(M.isText(n))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return n},string:e=>M.isText(e)?e.text:e.children.map(j.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of j.nodes(e,t))M.isText(r)&&(yield[r,n])}()}};function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var _,N={isNodeOperation:e=>N.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!S(e))return!1;switch(e.type){case"insert_node":case"remove_node":return f.isPath(e.path)&&j.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&f.isPath(e.path);case"merge_node":return"number"==typeof e.position&&f.isPath(e.path)&&S(e.properties);case"move_node":return f.isPath(e.path)&&f.isPath(e.newPath);case"set_node":return f.isPath(e.path)&&S(e.properties)&&S(e.newProperties);case"set_selection":return null===e.properties&&y.isRange(e.newProperties)||null===e.newProperties&&y.isRange(e.properties)||S(e.properties)&&S(e.newProperties);case"split_node":return f.isPath(e.path)&&"number"==typeof e.position&&S(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every(e=>N.isOperation(e)),isSelectionOperation:e=>N.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>N.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return k(k({},e),{},{type:"remove_node"});case"insert_text":return k(k({},e),{},{type:"remove_text"});case"merge_node":return k(k({},e),{},{type:"split_node",path:f.previous(e.path)});case"move_node":var{newPath:t,path:r}=e;if(f.equals(t,r))return e;if(f.isSibling(r,t))return k(k({},e),{},{path:t,newPath:r});var n=f.transform(r,e),o=f.transform(f.next(r),e);return k(k({},e),{},{path:n,newPath:o});case"remove_node":return k(k({},e),{},{type:"insert_node"});case"remove_text":return k(k({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:a}=e;return k(k({},e),{},{properties:a,newProperties:i});case"set_selection":var{properties:s,newProperties:l}=e;return k(k({},e),{},null==s?{properties:l,newProperties:null}:null==l?{properties:null,newProperties:s}:{properties:l,newProperties:s});case"split_node":return k(k({},e),{},{type:"merge_node",path:f.next(e.path)})}}},S=e=>"object"==typeof e&&null!==e,A=(e,t)=>{for(var r in e){var n=e[r],o=t[r];if(Array.isArray(n)&&Array.isArray(o)){if(n.length!==o.length)return!1;for(var i=0;i<n.length;i++)if(n[i]!==o[i])return!1}else if(S(n)&&S(o)){if(!A(n,o))return!1}else if(n!==o)return!1}for(var a in t)if(void 0===e[a]&&void 0!==t[a])return!1;return!0},T=e=>e.selection?e.selection:e.children.length>0?C.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"}(_||(_={})),_.L,_.L,_.V,_.LV,_.LVT,_.LV,_.V,_.V,_.T,_.LVT,_.T,_.T,_.Any,_.Extend,_.ZWJ,_.Any,_.SpacingMark,_.Prepend,_.Any,_.ZWJ,_.ExtPict,_.RI,_.RI;var C={above:(e,t)=>e.above(t),addMark(e,t,r){e.addMark(t,r)},after:(e,t,r)=>e.after(t,r),before:(e,t,r)=>e.before(t,r),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteBackward(r)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteForward(r)},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,r){e.insertFragment(t,r)},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,r)=>e.isEdge(t,r),isEditor:e=>function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!S(e))return!1;var r="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||S(e.marks))&&(null===e.selection||y.isRange(e.selection))&&(!t||j.isNodeList(e.children))&&N.isOperationList(e.operations);return r}(e),isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,r)=>e.isEnd(t,r),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,r)=>e.isStart(t,r),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,r)=>e.leaf(t,r),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,r)=>e.node(t,r),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,r)=>e.parent(t,r),path:(e,t,r)=>e.path(t,r),pathRef:(e,t,r)=>e.pathRef(t,r),pathRefs:e=>e.pathRefs(),point:(e,t,r)=>e.point(t,r),pointRef:(e,t,r)=>e.pointRef(t,r),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,r)=>e.range(t,r),rangeRef:(e,t,r)=>e.rangeRef(t,r),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,r)=>e.string(t,r),unhangRange:(e,t,r)=>e.unhangRange(t,r),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:(e,t,r)=>e.shouldMergeNodesRemovePrevNode(t,r)};function D(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?D(Object(r),!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var B={compare(e,t){var r=f.compare(e.path,t.path);return 0===r?e.offset<t.offset?-1:e.offset>t.offset?1:0:r},isAfter:(e,t)=>1===B.compare(e,t),isBefore:(e,t)=>-1===B.compare(e,t),equals:(e,t)=>e.offset===t.offset&&f.equals(e.path,t.path),isPoint:e=>S(e)&&"number"==typeof e.offset&&f.isPath(e.path),transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var{affinity:n="forward"}=r,{path:o,offset:i}=e;switch(t.type){case"insert_node":case"move_node":o=f.transform(o,t,r);break;case"insert_text":f.equals(t.path,o)&&(t.offset<i||t.offset===i&&"forward"===n)&&(i+=t.text.length);break;case"merge_node":f.equals(t.path,o)&&(i+=t.position),o=f.transform(o,t,r);break;case"remove_text":f.equals(t.path,o)&&t.offset<=i&&(i-=Math.min(i-t.offset,t.text.length));break;case"remove_node":if(f.equals(t.path,o)||f.isAncestor(t.path,o))return null;o=f.transform(o,t,r);break;case"split_node":if(f.equals(t.path,o)){if(t.position===i&&null==n)return null;(t.position<i||t.position===i&&"forward"===n)&&(i-=t.position,o=f.transform(o,t,q(q({},r),{},{affinity:"forward"})))}else o=f.transform(o,t,r);break;default:return e}return{path:o,offset:i}}},R=void 0,L={setScrubber(e){R=e},stringify:e=>JSON.stringify(e,R)},$=["text"],z=["anchor","focus","merge"];function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function I(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var M={equals(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:n=!1}=r;function o(e){return h(e,$)}return A(n?o(e):e,n?o(t):t)},isText:e=>S(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every(e=>M.isText(e)),isTextProps:e=>void 0!==e.text,matches(e,t){for(var r in t)if("text"!==r&&(!e.hasOwnProperty(r)||e[r]!==t[r]))return!1;return!0},decorations(e,t){var r=[{leaf:I({},e)}];for(var n of t){var{anchor:o,focus:i,merge:a}=n,s=h(n,z),[l,c]=y.edges(n),f=[],p=0,u=l.offset,d=c.offset,g=null!=a?a:Object.assign;for(var{leaf:v}of r){var{length:m}=v.text,b=p;if(p+=m,u<=b&&p<=d)g(v,s),f.push({leaf:v});else if(u!==d&&(u===p||d===b)||u>p||d<b||d===b&&0!==b)f.push({leaf:v});else{var w=v,O=void 0,x=void 0;if(d<p){var P=d-b;x={leaf:I(I({},w),{},{text:w.text.slice(P)})},w=I(I({},w),{},{text:w.text.slice(0,P)})}if(u>b){var j=u-b;O={leaf:I(I({},w),{},{text:w.text.slice(0,j)})},w=I(I({},w),{},{text:w.text.slice(j)})}g(w,s),O&&f.push(O),f.push({leaf:w}),x&&f.push(x)}}r=f}if(r.length>1){var E=0;for(var[k,_]of r.entries()){var N=E,S=N+_.leaf.text.length,A={start:N,end:S};0===k&&(A.isFirst=!0),k===r.length-1&&(A.isLast=!0),_.position=A,E=S}}return r}};function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var J=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];return[...e.slice(0,t),...n,...e.slice(t)]},Z=function(e,t,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),i=3;i<n;i++)o[i-3]=arguments[i];return[...e.slice(0,t),...o,...e.slice(t+r)]},G=Z,H=(e,t,r)=>{if(0===t.length)throw new Error("Cannot modify the editor");for(var n=j.get(e,t),o=t.slice(),i=r(n);o.length>1;){var a=o.pop(),s=j.get(e,o);i=W(W({},s),{},{children:Z(s.children,a,1,i)})}var l=o.pop();e.children=Z(e.children,l,1,i)},K=(e,t,r)=>{0===t.length?e.children=r(e.children):H(e,t,e=>{if(M.isText(e))throw new Error("Cannot get the element at path [".concat(t,"] because it refers to a leaf node: ").concat(L.stringify(e)));return W(W({},e),{},{children:r(e.children)})})},Q=(e,t,r)=>H(e,t,e=>{if(!M.isText(e))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(L.stringify(e)));return r(e)});function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Y={transform(e,t){var r=!1;switch(t.type){case"insert_node":var{path:n,node:o}=t;K(e,f.parent(n),e=>{var t=n[n.length-1];if(t>e.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(n,"] because the destination is past the end of the node."));return J(e,t,o)}),r=!0;break;case"insert_text":var{path:i,offset:a,text:s}=t;if(0===s.length)break;Q(e,i,e=>{var t=e.text.slice(0,a),r=e.text.slice(a);return X(X({},e),{},{text:t+s+r})}),r=!0;break;case"merge_node":var{path:l}=t,c=l[l.length-1],p=f.previous(l),u=p[p.length-1];K(e,f.parent(l),e=>{var t,r=e[c],n=e[u];if(M.isText(r)&&M.isText(n))t=X(X({},n),{},{text:n.text+r.text});else{if(M.isText(r)||M.isText(n))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(l,"] to nodes of different interfaces: ").concat(L.stringify(r)," ").concat(L.stringify(n)));t=X(X({},n),{},{children:n.children.concat(r.children)})}return Z(e,u,2,t)}),r=!0;break;case"move_node":var{path:d,newPath:h}=t,g=d[d.length-1];if(f.isAncestor(d,h))throw new Error("Cannot move a path [".concat(d,"] to new path [").concat(h,"] because the destination is inside itself."));var v=j.get(e,d);K(e,f.parent(d),e=>G(e,g,1));var m=f.transform(d,t),b=m[m.length-1];K(e,f.parent(m),e=>J(e,b,v)),r=!0;break;case"remove_node":var{path:w}=t,O=w[w.length-1];if(K(e,f.parent(w),e=>G(e,O,1)),e.selection){var x=X({},e.selection);for(var[P,E]of y.points(x)){var k=B.transform(P,t);if(null!=x&&null!=k)x[E]=k;else{var _=void 0,N=void 0;for(var[S,A]of j.texts(e)){if(-1!==f.compare(A,w)){N=[S,A];break}_=[S,A]}var T=!1;_&&N&&(T=!f.isSibling(_[1],w)&&(!!f.equals(N[1],w)||f.common(_[1],w).length<f.common(N[1],w).length)),_&&!T?x[E]={path:_[1],offset:_[0].text.length}:N?x[E]={path:N[1],offset:0}:x=null}}x&&y.equals(x,e.selection)||(e.selection=x)}break;case"remove_text":var{path:C,offset:D,text:q}=t;if(0===q.length)break;Q(e,C,e=>{var t=e.text.slice(0,D),r=e.text.slice(D+q.length);return X(X({},e),{},{text:t+r})}),r=!0;break;case"set_node":var{path:R,properties:$,newProperties:z}=t;if(0===R.length)throw new Error("Cannot set properties on the root node!");H(e,R,e=>{var t=X({},e);for(var r in z){if("children"===r||"text"===r)throw new Error('Cannot set the "'.concat(r,'" property of nodes!'));var n=z[r];null==n?delete t[r]:t[r]=n}for(var o in $)z.hasOwnProperty(o)||delete t[o];return t});break;case"set_selection":var{newProperties:V}=t;if(null==V){e.selection=null;break}if(null==e.selection){if(!y.isRange(V))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(L.stringify(V)," when there is no current selection."));e.selection=X({},V);break}var I=X({},e.selection);for(var F in V){var W=V[F];if(null==W){if("anchor"===F||"focus"===F)throw new Error('Cannot remove the "'.concat(F,'" selection property'));delete I[F]}else I[F]=W}e.selection=I;break;case"split_node":var{path:U,position:Y,properties:ee}=t,te=U[U.length-1];if(0===U.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(U,"] because the root node cannot be split."));K(e,f.parent(U),e=>{var t,r,n=e[te];if(M.isText(n)){var o=n.text.slice(0,Y),i=n.text.slice(Y);t=X(X({},n),{},{text:o}),r=X(X({},ee),{},{text:i})}else{var a=n.children.slice(0,Y),s=n.children.slice(Y);t=X(X({},n),{},{children:a}),r=X(X({},ee),{},{children:s})}return Z(e,te,1,t,r)}),r=!0}if(r&&e.selection){var re=X({},e.selection);for(var[ne,oe]of y.points(re))re[oe]=B.transform(ne,t);y.equals(re,e.selection)||(e.selection=re)}}},ee={insertNodes(e,t,r){e.insertNodes(t,r)},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,r){e.setNodes(t,r)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,r){e.unsetNodes(t,r)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,r){e.wrapNodes(t,r)}},te={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,r){e.setPoint(t,r)},setSelection(e,t){e.setSelection(t)}},re={delete(e,t){e.delete(t)},insertFragment(e,t,r){e.insertFragment(t,r)},insertText(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};C.withoutNormalizing(e,()=>{var{voids:n=!1}=r,{at:o=T(e)}=r;if(f.isPath(o)&&(o=C.range(e,o)),y.isRange(o))if(y.isCollapsed(o))o=o.anchor;else{var i=y.end(o);if(!n&&C.void(e,{at:i}))return;var a=y.start(o),s=C.pointRef(e,a),l=C.pointRef(e,i);ie.delete(e,{at:o,voids:n});var c=s.unref(),p=l.unref();o=c||p,ie.setSelection(e,{anchor:o,focus:o})}if(!(!n&&C.void(e,{at:o})||C.elementReadOnly(e,{at:o}))){var{path:u,offset:d}=o;t.length>0&&e.apply({type:"insert_text",path:u,offset:d,text:t})}})}};function ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(r),!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var ie=oe(oe(oe(oe({},Y),ee),te),re);const ae=new i({type:"Callout",elements:e("callout",{render:t=>e("div",Object.assign({},t.attributes,{children:t.children})),props:{theme:"default"}}),commands:c,extensions:function(e,t){return e=function(e,t){const{normalizeNode:r}=e;return e.normalizeNode=n=>{const[o,i]=n;if(0===i.length&&C.isEditor(o)){const r=o.children.filter(e=>b.isElement(e)&&"callout"===e.type);if(r.length>1&&null!==t.path.current){const n=t.path.current,i=o.children.findIndex(e=>b.isElement(e)&&"callout"===e.type);if(-1===i)return;const a=r.slice(1).map(e=>b.isElement(e)?{id:e.id,type:"Callout",value:[e],meta:{align:"left",depth:0,order:n+1}}:null).filter(e=>!!e);for(let t=o.children.length-1;t>=0;t--){const r=o.children[t];b.isElement(r)&&"callout"===r.type&&t!==i&&ie.removeNodes(e,{at:[t]})}return void t.batchOperations(()=>{a.forEach((e,r)=>{t.insertBlock("Callout",{at:n+r+1,blockData:{id:e.id,value:e.value,meta:e.meta}})})})}}r(n)},e}(e,t)},options:{display:{title:"Callout",description:"Make writing stand out"},shortcuts:["<"]},parsers:{html:{deserialize:{nodeNames:["DL"],parse(e,r){if("DL"===e.nodeName||"DIV"===e.nodeName){const n=e.getAttribute("data-theme");return{id:t(),type:"callout",children:a(r,e.childNodes),props:{theme:n}}}}},serialize:(e,t,r)=>{var n;const o="inherit",i="inherit",a="inherit",{align:l="left",depth:c=0}=r||{};return`<dl data-theme="${(null===(n=e.props)||void 0===n?void 0:n.theme)||"default"}" data-meta-align="${l}" data-meta-depth="${c}" style="margin-left: ${20*c}px; text-align: ${l}; padding: .5rem .5rem .5rem 1rem; margin-top: .5rem; border-radius: .375rem; color: ${o}; border-left: ${i}; background-color: ${a}">${s(e.children)}</dl>`}},markdown:{serialize:e=>`> ${l(e.children)}`},email:{serialize:(e,t,r)=>{var n;const o="inherit",i="inherit",a="inherit",{align:l="left",depth:c=0}=r||{};return`\n <table style="width: 100%; ">\n <tbody style="width: 100%;">\n <tr>\n <td data-theme="${(null===(n=e.props)||void 0===n?void 0:n.theme)||"default"}" data-meta-align="${l}" data-meta-depth="${c}" style="\n font-size: 16px;\n line-height: 1.75rem;\n margin-left: ${20*c}px; text-align: ${l}; padding: .5rem .5rem .5rem 1rem; margin-top: .5rem; border-radius: .375rem; color: ${o}; border-left: ${i}; background-color: ${a};">${s(e.children)}\n </td>\n </tr>\n </tbody>\n </table>`}}}});export{c as CalloutCommands,ae as default};
@@ -1,5 +1,5 @@
1
1
  import { YooptaPlugin } from '@yoopta/editor';
2
- import { CalloutElementMap } from '../types';
2
+ import type { CalloutElementMap } from '../types';
3
3
  declare const Callout: YooptaPlugin<CalloutElementMap, Record<string, unknown>>;
4
4
  export { Callout };
5
- //# sourceMappingURL=CalloutPlugin.d.ts.map
5
+ //# sourceMappingURL=callout-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callout-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/callout-plugin.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EAKb,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,iBAAiB,EAAqC,MAAM,UAAU,CAAC;AAMrF,QAAA,MAAM,OAAO,0DA0FX,CAAC;AAEH,OAAO,EAAE,OAAO,EAAE,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { SlateElement } from '@yoopta/editor';
1
+ import type { SlateElement } from '@yoopta/editor';
2
2
  export type CalloutPluginElementKeys = 'callout';
3
3
  export type CalloutTheme = 'default' | 'success' | 'warning' | 'error' | 'info';
4
4
  export type CalloutElementProps = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAEjD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAChF,MAAM,MAAM,mBAAmB,GAAG;IAAE,KAAK,EAAE,YAAY,CAAA;CAAE,CAAC;AAC1D,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC;AAE1E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,cAAc,CAAC;CACzB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAEjD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAChF,MAAM,MAAM,mBAAmB,GAAG;IAAE,KAAK,EAAE,YAAY,CAAA;CAAE,CAAC;AAC1D,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC;AAE1E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,cAAc,CAAC;CACzB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/callout",
3
- "version": "4.9.9",
3
+ "version": "6.0.0-beta.1",
4
4
  "description": "Callout plugin for Yoopta Editor",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
@@ -14,12 +14,13 @@
14
14
  "dist/"
15
15
  ],
16
16
  "peerDependencies": {
17
- "@yoopta/editor": ">=4.0.0",
18
- "react": ">=17.0.2",
19
- "react-dom": ">=17.0.2"
17
+ "@yoopta/editor": ">=4.9.9",
18
+ "react": ">=18.2.0",
19
+ "react-dom": ">=18.2.0"
20
20
  },
21
21
  "publishConfig": {
22
- "registry": "https://registry.npmjs.org"
22
+ "registry": "https://registry.npmjs.org",
23
+ "access": "public"
23
24
  },
24
25
  "repository": {
25
26
  "type": "git",
@@ -34,5 +35,5 @@
34
35
  "bugs": {
35
36
  "url": "https://github.com/Darginec05/Yoopta-Editor/issues"
36
37
  },
37
- "gitHead": "e8260945d74e2b26e8c66a3ddf4da8ceb45bc74d"
38
+ "gitHead": "ff6a5ae2937a56e0d1820df29fdfd6356171786c"
38
39
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"CalloutCommands.d.ts","sourceRoot":"","sources":["../../src/commands/CalloutCommands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAA4B,YAAY,EAAE,MAAM,UAAU,CAAC;AAEvG,KAAK,qBAAqB,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;CAC/C,CAAC;AAEF,KAAK,oBAAoB,GAAG,qBAAqB,GAAG;IAClD,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,oBAAoB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,cAAc,CAAC;IACtG,aAAa,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,KAAK,IAAI,CAAC;IACpF,aAAa,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,kBAAkB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CACvF,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,eAsB7B,CAAC"}
@@ -1,4 +0,0 @@
1
- import { YooEditor } from '@yoopta/editor';
2
- import { SlateEditor } from '@yoopta/editor';
3
- export declare function withCallout(slate: SlateEditor, editor: YooEditor): import("slate-react").ReactEditor;
4
- //# sourceMappingURL=withCallout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"withCallout.d.ts","sourceRoot":"","sources":["../../src/extensions/withCallout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,qCAIhE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"withCalloutNormalize.d.ts","sourceRoot":"","sources":["../../src/extensions/withCalloutNormalize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAExD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,qCAiEzE"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=withCalloutNormalize.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"withCalloutNormalize.test.d.ts","sourceRoot":"","sources":["../../src/extensions/withCalloutNormalize.test.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CalloutPlugin.d.ts","sourceRoot":"","sources":["../../src/plugin/CalloutPlugin.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,YAAY,EACb,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAE,iBAAiB,EAAgB,MAAM,UAAU,CAAC;AAI3D,QAAA,MAAM,OAAO,0DAsFX,CAAC;AAEH,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { PluginElementRenderProps } from '@yoopta/editor';
3
- declare const CalloutRender: {
4
- ({ extendRender, ...props }: PluginElementRenderProps): JSX.Element;
5
- displayName: string;
6
- };
7
- export { CalloutRender };
8
- //# sourceMappingURL=Callout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Callout.d.ts","sourceRoot":"","sources":["../../src/ui/Callout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,wBAAwB,EAAoD,MAAM,gBAAgB,CAAC;AAiB5G,QAAA,MAAM,aAAa;iCAAgC,wBAAwB;;CAwB1E,CAAC;AAIF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,10 +0,0 @@
1
- import { YooEditor, YooptaBlockData } from '@yoopta/editor';
2
- import { CalloutElementProps } from '../types';
3
- type Props = {
4
- editor: YooEditor;
5
- block: YooptaBlockData;
6
- props?: CalloutElementProps;
7
- };
8
- declare const CalloutBlockOptions: ({ editor, block, props: calloutProps }: Props) => import("react/jsx-runtime").JSX.Element;
9
- export { CalloutBlockOptions };
10
- //# sourceMappingURL=CalloutBlockOptions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CalloutBlockOptions.d.ts","sourceRoot":"","sources":["../../src/ui/CalloutBlockOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAO1E,OAAO,EAAE,mBAAmB,EAA0C,MAAM,UAAU,CAAC;AAKvF,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEF,QAAA,MAAM,mBAAmB,2CAA4C,KAAK,4CAqIzE,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,4 +0,0 @@
1
- import { CSSProperties } from 'react';
2
- import { CalloutTheme } from '../types';
3
- export declare const CALLOUT_THEME_STYLES: Record<CalloutTheme, CSSProperties>;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,YAAY,EAAE,aAAa,CAyBpE,CAAC"}