reactjs-tiptap-editor 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{ActionMenuButton-lsIBc9sU.js → ActionMenuButton-BOjCHFTA.js} +6 -6
- package/lib/ActionMenuButton-Df077oOH.cjs +1 -0
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.js +40 -78
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.js +2 -3
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +2 -3
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +2 -3
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +105 -99
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +2 -3
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +2 -3
- package/lib/CodeBlock.cjs +38 -38
- package/lib/CodeBlock.js +1561 -1605
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +2 -2
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +46 -63
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +24 -10
- package/lib/Drawer-DwrlY_lY.cjs +1 -0
- package/lib/Drawer-DxOoRiGQ.js +1099 -0
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +6 -5
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +69 -93
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +99 -110
- package/lib/ExportPdf.cjs +4 -4
- package/lib/ExportPdf.js +4 -13
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +9 -7
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +12 -34
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +12 -27
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +34 -47
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +39 -52
- package/lib/History.cjs +1 -1
- package/lib/History.js +318 -313
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +2 -3
- package/lib/{Iframe-CTajPyzs.js → Iframe-AhNV5WH5.js} +25 -34
- package/lib/Iframe-C6pBw-AF.cjs +1 -0
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +5 -4
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +5 -4
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +63 -91
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +7 -11
- package/lib/{Indent-BGEHlRx_.js → Indent-DZ5PcJA4.js} +3 -7
- package/lib/Indent-Do-X0AsY.cjs +1 -0
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +2 -3
- package/lib/Katex-CIC9ygbL.cjs +4 -0
- package/lib/{Katex-tMh4bfBb.js → Katex-bIgoenn_.js} +241 -255
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +5 -4
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +13 -21
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/LinkEditBlock-B0ZaACZO.cjs +5 -0
- package/lib/{LinkEditBlock-CA5NhP-m.js → LinkEditBlock-D_cF9fnc.js} +320 -370
- package/lib/MarkdownPaste.cjs +58 -0
- package/lib/MarkdownPaste.js +1656 -0
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +22 -17
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +118 -142
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +10 -18
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +2 -3
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +68 -133
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +15 -14
- package/lib/{SlashCommandNodeView-CZoM3ZlS.cjs → SlashCommandNodeView-Ba03hlVZ.cjs} +1 -1
- package/lib/{SlashCommandNodeView-DLuqbX2o.js → SlashCommandNodeView-cg0x3NRF.js} +15 -17
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +2 -3
- package/lib/{Table-BC4Lbqzn.js → Table-KqLiT5wG.js} +95 -133
- package/lib/Table-ddU2LSc6.cjs +9 -0
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +2 -3
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +51 -60
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +47 -69
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +2 -3
- package/lib/Twitter-BIiR78Jh.cjs +1 -0
- package/lib/{Twitter-D8Cbgl7g.js → Twitter-C1Lzqc7u.js} +567 -593
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +4 -3
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +3 -3
- package/lib/bubble.cjs +6 -4
- package/lib/bubble.js +3712 -3023
- package/lib/clsx-BWE7vnna.cjs +33 -0
- package/lib/clsx-eGVyq7ot.js +1062 -0
- package/lib/components/ActionButton.d.ts +2 -2
- package/lib/components/ActionMenuButton.d.ts +1 -1
- package/lib/components/Bubble/formatBubble.d.ts +5 -5
- package/lib/components/ui/checkbox.d.ts +1 -1
- package/lib/components/ui/dialog.d.ts +1 -1
- package/lib/components/ui/dropdown-menu.d.ts +1 -1
- package/lib/components/ui/emoji-picker.d.ts +1 -1
- package/lib/components/ui/label.d.ts +1 -1
- package/lib/components/ui/popover.d.ts +1 -1
- package/lib/components/ui/select.d.ts +1 -1
- package/lib/components/ui/separator.d.ts +1 -1
- package/lib/components/ui/switch.d.ts +1 -1
- package/lib/components/ui/tabs.d.ts +1 -1
- package/lib/components/ui/toast.d.ts +1 -1
- package/lib/components/ui/toggle.d.ts +1 -1
- package/lib/components/ui/tooltip.d.ts +1 -1
- package/lib/{delete-node-IyVmiRbI.js → delete-node-eQHsyyhR.js} +3 -1
- package/lib/{dropdown-menu-q6RL_fkA.js → dropdown-menu-CexIkt_V.js} +8 -8
- package/lib/{dropdown-menu-C_F7LEy5.cjs → dropdown-menu-oSKIntXM.cjs} +1 -1
- package/lib/extensions/Blockquote/Blockquote.d.ts +1 -1
- package/lib/extensions/Bold/Bold.d.ts +1 -1
- package/lib/extensions/Code/Code.d.ts +1 -1
- package/lib/extensions/CodeView/CodeView.d.ts +2 -2
- package/lib/extensions/Heading/Heading.d.ts +1 -1
- package/lib/extensions/Highlight/Highlight.d.ts +1 -1
- package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +1 -1
- package/lib/extensions/ImportWord/ImportWord.d.ts +2 -2
- package/lib/extensions/Italic/Italic.d.ts +1 -1
- package/lib/extensions/Link/Link.d.ts +1 -1
- package/lib/extensions/MarkdownPaste/MarkdownPaste.d.ts +5 -0
- package/lib/extensions/MarkdownPaste/index.d.ts +1 -0
- package/lib/extensions/Mermaid/Mermaid.d.ts +1 -1
- package/lib/extensions/MoreMark/MoreMark.d.ts +1 -1
- package/lib/extensions/Strike/Strike.d.ts +1 -1
- package/lib/extensions/Table/Table.d.ts +1 -1
- package/lib/extensions/TextAlign/TextAlign.d.ts +1 -1
- package/lib/extensions/TextUnderline/TextUnderline.d.ts +1 -1
- package/lib/index-BUTn2LY6.cjs +1 -0
- package/lib/{index-C07N8gA1.js → index-BlXGgvT-.js} +21 -18
- package/lib/{index-DqruLhsu.js → index-BnW6t8z6.js} +23 -23
- package/lib/{index-BsFvo9PG.cjs → index-BqL4vAWE.cjs} +1 -1
- package/lib/index-BtxvYLJ1.cjs +12 -0
- package/lib/{index-Do_dsOGB.js → index-C6xmkxrQ.js} +232 -217
- package/lib/index-CJ9pyCM4.cjs +1 -0
- package/lib/{index-neeeY2o7.cjs → index-D0lc95kr.cjs} +3 -3
- package/lib/{index-RcSPeQHn.js → index-DHUN85fV.js} +571 -657
- package/lib/index-DUpSE1Gb.cjs +1 -0
- package/lib/index-D_8P0LE5.js +1362 -0
- package/lib/{index-BDYJ8Ph2.js → index-RIXs7STX.js} +1 -1
- package/lib/index-mfGK4pFo.js +6469 -0
- package/lib/index-zig3Dj7A.cjs +22 -0
- package/lib/index.cjs +1 -1
- package/lib/index.js +26 -34
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.js +1 -1
- package/lib/plugins/image-upload.d.ts +1 -1
- package/lib/popover-BYSZ3zBi.js +24 -0
- package/lib/popover-BcHDZqBt.cjs +1 -0
- package/lib/{renderNodeView-BEkECnnY.js → renderNodeView-BrM5kUj_.js} +2 -2
- package/lib/{renderNodeView-DfLmGrgA.cjs → renderNodeView-D1zydtli.cjs} +1 -1
- package/lib/{select-CmV5uTXr.js → select-C5SHDLFj.js} +8 -5
- package/lib/{select-CYyIeImH.cjs → select-DHjzKkcu.cjs} +1 -1
- package/lib/{separator-BLp6xpSY.cjs → separator-BmixLrnJ.cjs} +1 -1
- package/lib/separator-CFKVxAea.js +293 -0
- package/lib/store/editor.d.ts +1 -1
- package/lib/store/store.d.ts +1 -1
- package/lib/style.css +1 -1
- package/lib/{textarea-Cn75Cm2n.cjs → textarea-CasDcv3u.cjs} +1 -1
- package/lib/{textarea-CkVKMPqK.js → textarea-DNLrJoRl.js} +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.d.ts +3 -3
- package/lib/updatePosition-CBRjbQMH.js +16 -0
- package/lib/updatePosition-CfmY5Trk.cjs +1 -0
- package/lib/utils/columns.d.ts +1 -1
- package/lib/utils/pdf.d.ts +1 -1
- package/lib/utils/utils.d.ts +1 -1
- package/package.json +262 -247
- package/lib/ActionMenuButton-B_E2mbAW.cjs +0 -1
- package/lib/Drawer-DQ4CxBwG.js +0 -1373
- package/lib/Drawer-FUeUKshi.cjs +0 -1
- package/lib/Iframe-EVWXCqe4.cjs +0 -1
- package/lib/Indent-q9cEWAa_.cjs +0 -1
- package/lib/Katex-ClqcEnN_.cjs +0 -4
- package/lib/LinkEditBlock-DZXk4ln_.cjs +0 -5
- package/lib/Table-BmDopO43.cjs +0 -9
- package/lib/Twitter-BbMD3Ybp.cjs +0 -1
- package/lib/clsx-CXbNJWDD.cjs +0 -54
- package/lib/clsx-DaPvp9ji.js +0 -7391
- package/lib/index-BCzvbrf5.cjs +0 -12
- package/lib/index-BnVcq33n.cjs +0 -1
- package/lib/index-CjhjjJsN.cjs +0 -1
- package/lib/index-Cs6cp0Y6.cjs +0 -1
- package/lib/index-Qcl3BG94.js +0 -1351
- package/lib/popover-CtinPbiy.js +0 -24
- package/lib/popover-DIMT3pae.cjs +0 -1
- package/lib/separator-C7luvaG8.js +0 -327
- package/lib/updatePosition-Cjuj2E26.cjs +0 -1
- package/lib/updatePosition-DRmKQBGm.js +0 -16
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";const S=require("react"),re=require("react-dom"),R=require("react/jsx-runtime"),B=require("./index-zig3Dj7A.cjs");var j={exports:{}},V={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* use-sync-external-store-shim.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var $;function le(){if($)return V;$=1;var e=S;function t(h,y){return h===y&&(h!==0||1/h===1/y)||h!==h&&y!==y}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(h,y){var c=y(),f=n({inst:{value:c,getSnapshot:y}}),m=f[0].inst,u=f[1];return s(function(){m.value=c,m.getSnapshot=y,d(m)&&u({inst:m})},[h,c,y]),o(function(){return d(m)&&u({inst:m}),h(function(){d(m)&&u({inst:m})})},[h]),i(c),c}function d(h){var y=h.getSnapshot;h=h.value;try{var c=y();return!r(h,c)}catch{return!0}}function E(h,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?E:a;return V.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,V}var q={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* use-sync-external-store-shim.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var z;function de(){return z||(z=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}function t(c,f){p||o.startTransition===void 0||(p=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=f();if(!h){var u=f();s(m,u)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}u=i({inst:{value:m,getSnapshot:f}});var l=u[0].inst,v=u[1];return d(function(){l.value=m,l.getSnapshot=f,r(l)&&v({inst:l})},[c,m,f]),a(function(){return r(l)&&v({inst:l}),c(function(){r(l)&&v({inst:l})})},[c]),E(m),m}function r(c){var f=c.getSnapshot;c=c.value;try{var m=f();return!s(c,m)}catch{return!0}}function n(c,f){return f()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=S,s=typeof Object.is=="function"?Object.is:e,i=o.useState,a=o.useEffect,d=o.useLayoutEffect,E=o.useDebugValue,p=!1,h=!1,y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;q.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),q}var k;function U(){return k||(k=1,process.env.NODE_ENV==="production"?j.exports=le():j.exports=de()),j.exports}var ne=U();const{getOwnPropertyNames:fe,getOwnPropertySymbols:he}=Object,{hasOwnProperty:pe}=Object.prototype;function I(e,t){return function(n,o,s){return e(n,o,s)&&t(n,o,s)}}function N(e){return function(r,n,o){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,o);const{cache:s}=o,i=s.get(r),a=s.get(n);if(i&&a)return i===n&&a===r;s.set(r,n),s.set(n,r);const d=e(r,n,o);return s.delete(r),s.delete(n),d}}function me(e){return e!=null?e[Symbol.toStringTag]:void 0}function F(e){return fe(e).concat(he(e))}const Ee=Object.hasOwn||((e,t)=>pe.call(e,t));function C(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const ve="__v",ye="__o",Se="_owner",{getOwnPropertyDescriptor:H,keys:K}=Object;function _e(e,t){return e.byteLength===t.byteLength&&L(new Uint8Array(e),new Uint8Array(t))}function Oe(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function ge(e,t){return e.byteLength===t.byteLength&&L(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function we(e,t){return C(e.getTime(),t.getTime())}function be(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Re(e,t){return e===t}function Y(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const o=new Array(n),s=e.entries();let i,a,d=0;for(;(i=s.next())&&!i.done;){const E=t.entries();let p=!1,h=0;for(;(a=E.next())&&!a.done;){if(o[h]){h++;continue}const y=i.value,c=a.value;if(r.equals(y[0],c[0],d,h,e,t,r)&&r.equals(y[1],c[1],y[0],c[0],e,t,r)){p=o[h]=!0;break}h++}if(!p)return!1;d++}return!0}const Ae=C;function Ce(e,t,r){const n=K(e);let o=n.length;if(K(t).length!==o)return!1;for(;o-- >0;)if(!oe(e,t,r,n[o]))return!1;return!0}function x(e,t,r){const n=F(e);let o=n.length;if(F(t).length!==o)return!1;let s,i,a;for(;o-- >0;)if(s=n[o],!oe(e,t,r,s)||(i=H(e,s),a=H(t,s),(i||a)&&(!i||!a||i.configurable!==a.configurable||i.enumerable!==a.enumerable||i.writable!==a.writable)))return!1;return!0}function Te(e,t){return C(e.valueOf(),t.valueOf())}function xe(e,t){return e.source===t.source&&e.flags===t.flags}function J(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const o=new Array(n),s=e.values();let i,a;for(;(i=s.next())&&!i.done;){const d=t.values();let E=!1,p=0;for(;(a=d.next())&&!a.done;){if(!o[p]&&r.equals(i.value,a.value,i.value,a.value,e,t,r)){E=o[p]=!0;break}p++}if(!E)return!1}return!0}function L(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function je(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function oe(e,t,r,n){return(n===Se||n===ye||n===ve)&&(e.$$typeof||t.$$typeof)?!0:Ee(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const Ne="[object ArrayBuffer]",De="[object Arguments]",Le="[object Boolean]",Me="[object DataView]",Ve="[object Date]",qe="[object Error]",Ie="[object Map]",Pe="[object Number]",Ge="[object Object]",Ue="[object RegExp]",We="[object Set]",Be="[object String]",$e={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},ze="[object URL]",ke=Object.prototype.toString;function Fe({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:o,areFunctionsEqual:s,areMapsEqual:i,areNumbersEqual:a,areObjectsEqual:d,arePrimitiveWrappersEqual:E,areRegExpsEqual:p,areSetsEqual:h,areTypedArraysEqual:y,areUrlsEqual:c,unknownTagComparators:f}){return function(u,l,v){if(u===l)return!0;if(u==null||l==null)return!1;const b=typeof u;if(b!==typeof l)return!1;if(b!=="object")return b==="number"?a(u,l,v):b==="function"?s(u,l,v):!1;const g=u.constructor;if(g!==l.constructor)return!1;if(g===Object)return d(u,l,v);if(Array.isArray(u))return t(u,l,v);if(g===Date)return n(u,l,v);if(g===RegExp)return p(u,l,v);if(g===Map)return i(u,l,v);if(g===Set)return h(u,l,v);const O=ke.call(u);if(O===Ve)return n(u,l,v);if(O===Ue)return p(u,l,v);if(O===Ie)return i(u,l,v);if(O===We)return h(u,l,v);if(O===Ge)return typeof u.then!="function"&&typeof l.then!="function"&&d(u,l,v);if(O===ze)return c(u,l,v);if(O===qe)return o(u,l,v);if(O===De)return d(u,l,v);if($e[O])return y(u,l,v);if(O===Ne)return e(u,l,v);if(O===Me)return r(u,l,v);if(O===Le||O===Pe||O===Be)return E(u,l,v);if(f){let _=f[O];if(!_){const w=me(u);w&&(_=f[w])}if(_)return _(u,l,v)}return!1}}function He({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:_e,areArraysEqual:r?x:Oe,areDataViewsEqual:ge,areDatesEqual:we,areErrorsEqual:be,areFunctionsEqual:Re,areMapsEqual:r?I(Y,x):Y,areNumbersEqual:Ae,areObjectsEqual:r?x:Ce,arePrimitiveWrappersEqual:Te,areRegExpsEqual:xe,areSetsEqual:r?I(J,x):J,areTypedArraysEqual:r?I(L,x):L,areUrlsEqual:je,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const o=N(n.areArraysEqual),s=N(n.areMapsEqual),i=N(n.areObjectsEqual),a=N(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:o,areMapsEqual:s,areObjectsEqual:i,areSetsEqual:a})}return n}function Ke(e){return function(t,r,n,o,s,i,a){return e(t,r,a)}}function Ye({circular:e,comparator:t,createState:r,equals:n,strict:o}){if(r)return function(a,d){const{cache:E=e?new WeakMap:void 0,meta:p}=r();return t(a,d,{cache:E,equals:n,meta:p,strict:o})};if(e)return function(a,d){return t(a,d,{cache:new WeakMap,equals:n,meta:void 0,strict:o})};const s={cache:void 0,equals:n,meta:void 0,strict:o};return function(a,d){return t(a,d,s)}}const Je=A();A({strict:!0});A({circular:!0});A({circular:!0,strict:!0});A({createInternalComparator:()=>C});A({strict:!0,createInternalComparator:()=>C});A({circular:!0,createInternalComparator:()=>C});A({circular:!0,createInternalComparator:()=>C,strict:!0});function A(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:o=!1}=e,s=He(e),i=Fe(s),a=r?r(i):Ke(i);return Ye({circular:t,comparator:i,createState:n,equals:a,strict:o})}var D={exports:{}},P={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var X;function Xe(){if(X)return P;X=1;var e=S,t=U();function r(E,p){return E===p&&(E!==0||1/E===1/p)||E!==E&&p!==p}var n=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,d=e.useDebugValue;return P.useSyncExternalStoreWithSelector=function(E,p,h,y,c){var f=s(null);if(f.current===null){var m={hasValue:!1,value:null};f.current=m}else m=f.current;f=a(function(){function l(_){if(!v){if(v=!0,b=_,_=y(_),c!==void 0&&m.hasValue){var w=m.value;if(c(w,_))return g=w}return g=_}if(w=g,n(b,_))return w;var T=y(_);return c!==void 0&&c(w,T)?(b=_,w):(b=_,g=T)}var v=!1,b,g,O=h===void 0?null:h;return[function(){return l(p())},O===null?void 0:function(){return l(O())}]},[p,h,y,c]);var u=o(E,f[0],f[1]);return i(function(){m.hasValue=!0,m.value=u},[u]),d(u),u},P}var G={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Z;function Ze(){return Z||(Z=1,process.env.NODE_ENV!=="production"&&(function(){function e(E,p){return E===p&&(E!==0||1/E===1/p)||E!==E&&p!==p}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=S,r=U(),n=typeof Object.is=="function"?Object.is:e,o=r.useSyncExternalStore,s=t.useRef,i=t.useEffect,a=t.useMemo,d=t.useDebugValue;G.useSyncExternalStoreWithSelector=function(E,p,h,y,c){var f=s(null);if(f.current===null){var m={hasValue:!1,value:null};f.current=m}else m=f.current;f=a(function(){function l(_){if(!v){if(v=!0,b=_,_=y(_),c!==void 0&&m.hasValue){var w=m.value;if(c(w,_))return g=w}return g=_}if(w=g,n(b,_))return w;var T=y(_);return c!==void 0&&c(w,T)?(b=_,w):(b=_,g=T)}var v=!1,b,g,O=h===void 0?null:h;return[function(){return l(p())},O===null?void 0:function(){return l(O())}]},[p,h,y,c]);var u=o(E,f[0],f[1]);return i(function(){m.hasValue=!0,m.value=u},[u]),d(u),u},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),G}var Q;function Qe(){return Q||(Q=1,process.env.NODE_ENV==="production"?D.exports=Xe():D.exports=Ze()),D.exports}var et=Qe(),tt=(...e)=>t=>{e.forEach(r=>{typeof r=="function"?r(t):r&&(r.current=t)})},rt=({contentComponent:e})=>{const t=ne.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return R.jsx(R.Fragment,{children:Object.values(t)})};function nt(){const e=new Set;let t={};return{subscribe(r){return e.add(r),()=>{e.delete(r)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(r,n){t={...t,[r]:re.createPortal(n.reactElement,n.element,r)},e.forEach(o=>o())},removeRenderer(r){const n={...t};delete n[r],t=n,e.forEach(o=>o())}}}var ot=class extends S.Component{constructor(e){var t;super(e),this.editorContentRef=S.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((t=e.editor)!=null&&t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&((e=t.view.dom)!=null&&e.parentNode)){if(t.contentComponent)return;const r=this.editorContentRef.current;r.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:r}),t.contentComponent=nt(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(n=>n.hasContentComponentInitialized?n:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;const t=this.props.editor;if(t){this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null;try{if(!((e=t.view.dom)!=null&&e.parentNode))return;const r=document.createElement("div");r.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:r})}catch{}}}render(){const{editor:e,innerRef:t,...r}=this.props;return R.jsxs(R.Fragment,{children:[R.jsx("div",{ref:tt(t,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&R.jsx(rt,{contentComponent:e.contentComponent})]})}},it=S.forwardRef((e,t)=>{const r=S.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return S.createElement(ot,{key:r,innerRef:t,...e})}),st=S.memo(it),ut=typeof window<"u"?S.useLayoutEffect:S.useEffect,at=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const t=()=>{this.transactionNumber+=1,this.subscribers.forEach(n=>n())},r=this.editor;return r.on("transaction",t),()=>{r.off("transaction",t)}}}};function ct(e){var t;const[r]=S.useState(()=>new at(e.editor)),n=et.useSyncExternalStoreWithSelector(r.subscribe,r.getSnapshot,r.getServerSnapshot,e.selector,(t=e.equalityFn)!=null?t:Je);return ut(()=>r.watch(e.editor),[e.editor,r]),S.useDebugValue(n),n}process.env.NODE_ENV;var M=S.createContext({editor:null});M.Consumer;var lt=()=>S.useContext(M),ie=S.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),dt=()=>S.useContext(ie),ft=S.forwardRef((e,t)=>{const{onDragStart:r}=dt(),n=e.as||"div";return R.jsx(n,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})});function ee(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function te(e){return!!(typeof e=="object"&&e.$$typeof&&(e.$$typeof.toString()==="Symbol(react.forward_ref)"||e.$$typeof.description==="react.forward_ref"))}function ht(e){return!!(typeof e=="object"&&e.$$typeof&&(e.$$typeof.toString()==="Symbol(react.memo)"||e.$$typeof.description==="react.memo"))}function pt(e){if(ee(e)||te(e))return!0;if(ht(e)){const t=e.type;if(t)return ee(t)||te(t)}return!1}function mt(){try{if(S.version)return parseInt(S.version.split(".")[0],10)>=19}catch{}return!1}var se=class{constructor(e,{editor:t,props:r={},as:n="div",className:o=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=r,this.element=document.createElement(n),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.editor.isInitialized?re.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;const t=this.component,r=this.props,n=this.editor,o=mt(),s=pt(t),i={...r};i.ref&&!(o||s)&&delete i.ref,!i.ref&&(o||s)&&(i.ref=a=>{this.ref=a}),this.reactElement=R.jsx(t,{...i}),(e=n==null?void 0:n.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){this.destroyed||(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0;const t=this.editor;(e=t==null?void 0:t.contentComponent)==null||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};S.createContext({markViewContentRef:()=>{}});var Et=class extends B.NodeView{constructor(e,t,r){if(super(e,t,r),this.selectionRafId=null,this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const n=this.dom.querySelector("[data-node-view-content]");if(!n)return;n.appendChild(this.contentDOMElement)}}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){const e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(r,n,o){var s;return n==="storage"?(s=e.storage[t.name])!=null?s:{}:Reflect.get(r,n,o)}})}return this.cachedExtensionWithSyncedStorage}mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(d={})=>this.updateAttributes(d),deleteNode:()=>this.deleteNode(),ref:S.createRef()};if(!this.component.displayName){const d=E=>E.charAt(0).toUpperCase()+E.substring(1);this.component.displayName=d(this.extension.name)}const n={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:d=>{d&&this.contentDOMElement&&d.firstChild!==this.contentDOMElement&&(d.hasAttribute("data-node-view-wrapper")&&d.removeAttribute("data-node-view-wrapper"),d.appendChild(this.contentDOMElement))}},o=this.component,s=S.memo(d=>R.jsx(ie.Provider,{value:n,children:S.createElement(o,d)}));s.displayName="ReactNodeView";let i=this.node.isInline?"span":"div";this.options.as&&(i=this.options.as);const{className:a=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new se(s,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var e;if(this.renderer.element.firstElementChild&&!((e=this.renderer.element.firstElementChild)!=null&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;const{from:e,to:t}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(e<=r&&t>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,r){const n=o=>{this.renderer.updateProps(o),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const o=this.node,s=this.decorations,i=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=r,this.options.update({oldNode:o,oldDecorations:s,newNode:e,newDecorations:t,oldInnerDecorations:i,innerDecorations:r,updateProps:()=>n({node:e,decorations:t,innerDecorations:r,extension:this.extensionWithSyncedStorage})})}return e===this.node&&this.decorations===t&&this.innerDecorations===r||(this.node=e,this.decorations=t,this.innerDecorations=r,n({node:e,decorations:t,innerDecorations:r,extension:this.extensionWithSyncedStorage})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs=="function"){const t=this.editor.extensionManager.attributes,r=B.getRenderedAttributes(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:r})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function vt(e,t){return r=>r.editor.contentComponent?new Et(e,r,t):{}}var W=S.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});W.displayName="TiptapContext";var yt=()=>S.useContext(W);function ue({editor:e,instance:t,children:r}){const n=e??t;if(!n)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const o=S.useMemo(()=>({editor:n}),[n]),s=S.useMemo(()=>({editor:n}),[n]);return R.jsx(M.Provider,{value:s,children:R.jsx(W.Provider,{value:o,children:r})})}ue.displayName="Tiptap";function ae({...e}){const{editor:t}=yt();return R.jsx(st,{editor:t,...e})}ae.displayName="Tiptap.Content";Object.assign(ue,{Content:ae});function ce(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=ce(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function St(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=ce(e))&&(n&&(n+=" "),n+=t);return n}exports.EditorContext=M;exports.NodeViewWrapper=ft;exports.ReactNodeViewRenderer=vt;exports.ReactRenderer=se;exports.clsx=St;exports.shimExports=ne;exports.useCurrentEditor=lt;exports.useEditorState=ct;
|