@kopexa/tiptap 17.6.18 → 17.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +691 -24
- package/dist/index.d.ts +691 -24
- package/dist/index.js +1478 -786
- package/dist/index.mjs +7987 -112
- package/package.json +57 -52
- package/dist/chunk-2SI7MRAE.mjs +0 -64
- package/dist/chunk-2U5CQUZH.mjs +0 -91
- package/dist/chunk-2UDCL55K.mjs +0 -55
- package/dist/chunk-2V6VOAPI.mjs +0 -139
- package/dist/chunk-2Z2QVW67.mjs +0 -1
- package/dist/chunk-32SUXCAQ.mjs +0 -115
- package/dist/chunk-33QD5PYJ.mjs +0 -63
- package/dist/chunk-3VRQUYYW.mjs +0 -169
- package/dist/chunk-42HKGCOO.mjs +0 -129
- package/dist/chunk-4ALV4UA5.mjs +0 -1
- package/dist/chunk-4CDZ547I.mjs +0 -185
- package/dist/chunk-4HO7BWDC.mjs +0 -89
- package/dist/chunk-4JRYQZ4A.mjs +0 -174
- package/dist/chunk-552JLRNB.mjs +0 -35
- package/dist/chunk-5SMDMQDF.mjs +0 -34
- package/dist/chunk-6552DQWB.mjs +0 -416
- package/dist/chunk-7FDDRVUE.mjs +0 -143
- package/dist/chunk-7VGROP26.mjs +0 -262
- package/dist/chunk-7VW67NVL.mjs +0 -80
- package/dist/chunk-AAV7ZNBP.mjs +0 -83
- package/dist/chunk-ATRHILCH.mjs +0 -1
- package/dist/chunk-B7WJOQ3X.mjs +0 -103
- package/dist/chunk-BEV5U2DK.mjs +0 -131
- package/dist/chunk-BXHPO3T7.mjs +0 -152
- package/dist/chunk-BXJYNSWQ.mjs +0 -30
- package/dist/chunk-C5RQWJKE.mjs +0 -155
- package/dist/chunk-CNVACBGT.mjs +0 -51
- package/dist/chunk-DQK6PA4U.mjs +0 -276
- package/dist/chunk-DSBJFMHK.mjs +0 -38
- package/dist/chunk-DT7ML2P4.mjs +0 -42
- package/dist/chunk-DZLGLP7R.mjs +0 -99
- package/dist/chunk-EAAQE5ZV.mjs +0 -283
- package/dist/chunk-EHY2NAW7.mjs +0 -120
- package/dist/chunk-EIIWU5FR.mjs +0 -61
- package/dist/chunk-ERPGWXFK.mjs +0 -163
- package/dist/chunk-F73FCUD5.mjs +0 -1
- package/dist/chunk-FRJX2F4T.mjs +0 -55
- package/dist/chunk-GYIYX2JH.mjs +0 -73
- package/dist/chunk-H6LC4LDQ.mjs +0 -63
- package/dist/chunk-H7MS2UMO.mjs +0 -168
- package/dist/chunk-HLLA2HRV.mjs +0 -1
- package/dist/chunk-HTJ2RXOG.mjs +0 -32
- package/dist/chunk-IFXRPGIJ.mjs +0 -98
- package/dist/chunk-IOB3REX6.mjs +0 -173
- package/dist/chunk-IQERE7KP.mjs +0 -115
- package/dist/chunk-JCV5SEKN.mjs +0 -65
- package/dist/chunk-JVSH5T4B.mjs +0 -72
- package/dist/chunk-KK4K43WM.mjs +0 -59
- package/dist/chunk-KR42JAVB.mjs +0 -60
- package/dist/chunk-KYLBKQ2E.mjs +0 -203
- package/dist/chunk-L5RDMV3H.mjs +0 -216
- package/dist/chunk-LNVWG34E.mjs +0 -165
- package/dist/chunk-LVNUU67N.mjs +0 -1
- package/dist/chunk-MNTOOEHA.mjs +0 -1
- package/dist/chunk-N3JE67CS.mjs +0 -81
- package/dist/chunk-N4CT5RNC.mjs +0 -123
- package/dist/chunk-OEVR5N7X.mjs +0 -65
- package/dist/chunk-P55PLOHR.mjs +0 -34
- package/dist/chunk-Q5FK7SFY.mjs +0 -75
- package/dist/chunk-Q7DFJ5NI.mjs +0 -153
- package/dist/chunk-QIELBKP3.mjs +0 -104
- package/dist/chunk-R2GM4A3T.mjs +0 -71
- package/dist/chunk-REJEJXOZ.mjs +0 -10
- package/dist/chunk-RFWNKE7D.mjs +0 -238
- package/dist/chunk-TAM3VMJT.mjs +0 -80
- package/dist/chunk-TDFS3DCZ.mjs +0 -79
- package/dist/chunk-TLM5ALHZ.mjs +0 -1
- package/dist/chunk-TZQQ6C2Q.mjs +0 -101
- package/dist/chunk-U5XAL46P.mjs +0 -39
- package/dist/chunk-UJ4BNZ63.mjs +0 -178
- package/dist/chunk-UVHVCION.mjs +0 -168
- package/dist/chunk-V6TAZMQN.mjs +0 -105
- package/dist/chunk-VF3G2URZ.mjs +0 -83
- package/dist/chunk-VRQ6OSAZ.mjs +0 -76
- package/dist/chunk-VTKJPVNM.mjs +0 -148
- package/dist/chunk-VX3HSJ76.mjs +0 -73
- package/dist/chunk-W2FLOOJ6.mjs +0 -75
- package/dist/chunk-XGAABDMW.mjs +0 -159
- package/dist/chunk-Y2KSWMG5.mjs +0 -1
- package/dist/chunk-YJAHZXLG.mjs +0 -92
- package/dist/chunk-Z365KVQY.mjs +0 -34
- package/dist/chunk-ZVTJ6XD7.mjs +0 -88
- package/dist/chunk-ZZ4OU46C.mjs +0 -131
- package/dist/context/editor-context.d.mts +0 -10
- package/dist/context/editor-context.d.ts +0 -10
- package/dist/context/editor-context.js +0 -34
- package/dist/context/editor-context.mjs +0 -9
- package/dist/context/editor-file-context.d.mts +0 -70
- package/dist/context/editor-file-context.d.ts +0 -70
- package/dist/context/editor-file-context.js +0 -96
- package/dist/context/editor-file-context.mjs +0 -12
- package/dist/extensions/callout/callout-settings.d.mts +0 -13
- package/dist/extensions/callout/callout-settings.d.ts +0 -13
- package/dist/extensions/callout/callout-settings.js +0 -206
- package/dist/extensions/callout/callout-settings.mjs +0 -9
- package/dist/extensions/callout/callout-view.d.mts +0 -12
- package/dist/extensions/callout/callout-view.d.ts +0 -12
- package/dist/extensions/callout/callout-view.js +0 -273
- package/dist/extensions/callout/callout-view.mjs +0 -12
- package/dist/extensions/callout/index.d.mts +0 -44
- package/dist/extensions/callout/index.d.ts +0 -44
- package/dist/extensions/callout/index.js +0 -380
- package/dist/extensions/callout/index.mjs +0 -13
- package/dist/extensions/callout/messages.d.mts +0 -59
- package/dist/extensions/callout/messages.d.ts +0 -59
- package/dist/extensions/callout/messages.js +0 -88
- package/dist/extensions/callout/messages.mjs +0 -7
- package/dist/extensions/image/image-view.d.mts +0 -15
- package/dist/extensions/image/image-view.d.ts +0 -15
- package/dist/extensions/image/image-view.js +0 -255
- package/dist/extensions/image/image-view.mjs +0 -12
- package/dist/extensions/image/index.d.mts +0 -29
- package/dist/extensions/image/index.d.ts +0 -29
- package/dist/extensions/image/index.js +0 -282
- package/dist/extensions/image/index.mjs +0 -16
- package/dist/extensions/image/messages.d.mts +0 -28
- package/dist/extensions/image/messages.d.ts +0 -28
- package/dist/extensions/image/messages.js +0 -57
- package/dist/extensions/image/messages.mjs +0 -7
- package/dist/extensions/image-upload/image-upload-view.d.mts +0 -12
- package/dist/extensions/image-upload/image-upload-view.d.ts +0 -12
- package/dist/extensions/image-upload/image-upload-view.js +0 -338
- package/dist/extensions/image-upload/image-upload-view.mjs +0 -12
- package/dist/extensions/image-upload/index.d.mts +0 -46
- package/dist/extensions/image-upload/index.d.ts +0 -46
- package/dist/extensions/image-upload/index.js +0 -414
- package/dist/extensions/image-upload/index.mjs +0 -16
- package/dist/extensions/image-upload/messages.d.mts +0 -32
- package/dist/extensions/image-upload/messages.d.ts +0 -32
- package/dist/extensions/image-upload/messages.js +0 -61
- package/dist/extensions/image-upload/messages.mjs +0 -7
- package/dist/extensions/link/index.d.mts +0 -6
- package/dist/extensions/link/index.d.ts +0 -6
- package/dist/extensions/link/index.js +0 -94
- package/dist/extensions/link/index.mjs +0 -7
- package/dist/extensions/math/index.d.mts +0 -38
- package/dist/extensions/math/index.d.ts +0 -38
- package/dist/extensions/math/index.js +0 -544
- package/dist/extensions/math/index.mjs +0 -17
- package/dist/extensions/math/inline-math-view.d.mts +0 -12
- package/dist/extensions/math/inline-math-view.d.ts +0 -12
- package/dist/extensions/math/inline-math-view.js +0 -232
- package/dist/extensions/math/inline-math-view.mjs +0 -11
- package/dist/extensions/math/inline-math.d.mts +0 -32
- package/dist/extensions/math/inline-math.d.ts +0 -32
- package/dist/extensions/math/inline-math.js +0 -304
- package/dist/extensions/math/inline-math.mjs +0 -12
- package/dist/extensions/math/math-block-view.d.mts +0 -11
- package/dist/extensions/math/math-block-view.d.ts +0 -11
- package/dist/extensions/math/math-block-view.js +0 -248
- package/dist/extensions/math/math-block-view.mjs +0 -11
- package/dist/extensions/math/messages.d.mts +0 -49
- package/dist/extensions/math/messages.d.ts +0 -49
- package/dist/extensions/math/messages.js +0 -78
- package/dist/extensions/math/messages.mjs +0 -7
- package/dist/extensions/selection/index.d.mts +0 -5
- package/dist/extensions/selection/index.d.ts +0 -5
- package/dist/extensions/selection/index.js +0 -62
- package/dist/extensions/selection/index.mjs +0 -7
- package/dist/extensions/toc/index.d.mts +0 -53
- package/dist/extensions/toc/index.d.ts +0 -53
- package/dist/extensions/toc/index.js +0 -501
- package/dist/extensions/toc/index.mjs +0 -13
- package/dist/extensions/toc/messages.d.mts +0 -74
- package/dist/extensions/toc/messages.d.ts +0 -74
- package/dist/extensions/toc/messages.js +0 -103
- package/dist/extensions/toc/messages.mjs +0 -7
- package/dist/extensions/toc/toc-settings.d.mts +0 -13
- package/dist/extensions/toc/toc-settings.d.ts +0 -13
- package/dist/extensions/toc/toc-settings.js +0 -283
- package/dist/extensions/toc/toc-settings.mjs +0 -9
- package/dist/extensions/toc/toc-view.d.mts +0 -12
- package/dist/extensions/toc/toc-view.d.ts +0 -12
- package/dist/extensions/toc/toc-view.js +0 -411
- package/dist/extensions/toc/toc-view.mjs +0 -12
- package/dist/extensions/trailing-node/index.d.mts +0 -9
- package/dist/extensions/trailing-node/index.d.ts +0 -9
- package/dist/extensions/trailing-node/index.js +0 -86
- package/dist/extensions/trailing-node/index.mjs +0 -7
- package/dist/extensions/ui-state/index.d.mts +0 -34
- package/dist/extensions/ui-state/index.d.ts +0 -34
- package/dist/extensions/ui-state/index.js +0 -84
- package/dist/extensions/ui-state/index.mjs +0 -9
- package/dist/extensions/variable/extract-variables.d.mts +0 -16
- package/dist/extensions/variable/extract-variables.d.ts +0 -16
- package/dist/extensions/variable/extract-variables.js +0 -58
- package/dist/extensions/variable/extract-variables.mjs +0 -7
- package/dist/extensions/variable/index.d.mts +0 -38
- package/dist/extensions/variable/index.d.ts +0 -38
- package/dist/extensions/variable/index.js +0 -190
- package/dist/extensions/variable/index.mjs +0 -11
- package/dist/extensions/variable/messages.d.mts +0 -69
- package/dist/extensions/variable/messages.d.ts +0 -69
- package/dist/extensions/variable/messages.js +0 -98
- package/dist/extensions/variable/messages.mjs +0 -7
- package/dist/extensions/variable/variable-context.d.mts +0 -56
- package/dist/extensions/variable/variable-context.d.ts +0 -56
- package/dist/extensions/variable/variable-context.js +0 -70
- package/dist/extensions/variable/variable-context.mjs +0 -12
- package/dist/extensions/variable/variable-filler-dialog.d.mts +0 -43
- package/dist/extensions/variable/variable-filler-dialog.d.ts +0 -43
- package/dist/extensions/variable/variable-filler-dialog.js +0 -207
- package/dist/extensions/variable/variable-filler-dialog.mjs +0 -9
- package/dist/extensions/variable/variable-suggestion.d.mts +0 -31
- package/dist/extensions/variable/variable-suggestion.d.ts +0 -31
- package/dist/extensions/variable/variable-suggestion.js +0 -615
- package/dist/extensions/variable/variable-suggestion.mjs +0 -14
- package/dist/extensions/variable/variable-view.d.mts +0 -13
- package/dist/extensions/variable/variable-view.d.ts +0 -13
- package/dist/extensions/variable/variable-view.js +0 -110
- package/dist/extensions/variable/variable-view.mjs +0 -11
- package/dist/hooks/use-create-editor.d.mts +0 -46
- package/dist/hooks/use-create-editor.d.ts +0 -46
- package/dist/hooks/use-create-editor.js +0 -2726
- package/dist/hooks/use-create-editor.mjs +0 -37
- package/dist/hooks/use-cursor-visibility.d.mts +0 -37
- package/dist/hooks/use-cursor-visibility.d.ts +0 -37
- package/dist/hooks/use-cursor-visibility.js +0 -140
- package/dist/hooks/use-cursor-visibility.mjs +0 -8
- package/dist/hooks/use-floating-element.d.mts +0 -43
- package/dist/hooks/use-floating-element.d.ts +0 -43
- package/dist/hooks/use-floating-element.js +0 -88
- package/dist/hooks/use-floating-element.mjs +0 -8
- package/dist/hooks/use-floating-toolbar-visibility.d.mts +0 -32
- package/dist/hooks/use-floating-toolbar-visibility.d.ts +0 -32
- package/dist/hooks/use-floating-toolbar-visibility.js +0 -115
- package/dist/hooks/use-floating-toolbar-visibility.mjs +0 -13
- package/dist/hooks/use-menu-navigation.d.mts +0 -55
- package/dist/hooks/use-menu-navigation.d.ts +0 -55
- package/dist/hooks/use-menu-navigation.js +0 -163
- package/dist/hooks/use-menu-navigation.mjs +0 -8
- package/dist/hooks/use-tiptap-editor.d.mts +0 -20
- package/dist/hooks/use-tiptap-editor.d.ts +0 -20
- package/dist/hooks/use-tiptap-editor.js +0 -58
- package/dist/hooks/use-tiptap-editor.mjs +0 -8
- package/dist/hooks/use-ui-editor-state.d.mts +0 -7
- package/dist/hooks/use-ui-editor-state.d.ts +0 -7
- package/dist/hooks/use-ui-editor-state.js +0 -107
- package/dist/hooks/use-ui-editor-state.mjs +0 -11
- package/dist/hooks/use-window-size.d.mts +0 -12
- package/dist/hooks/use-window-size.d.ts +0 -12
- package/dist/hooks/use-window-size.js +0 -75
- package/dist/hooks/use-window-size.mjs +0 -7
- package/dist/presets/basic/editor-header.d.mts +0 -23
- package/dist/presets/basic/editor-header.d.ts +0 -23
- package/dist/presets/basic/editor-header.js +0 -2750
- package/dist/presets/basic/editor-header.mjs +0 -43
- package/dist/presets/basic/index.d.mts +0 -38
- package/dist/presets/basic/index.d.ts +0 -38
- package/dist/presets/basic/index.js +0 -6891
- package/dist/presets/basic/index.mjs +0 -85
- package/dist/ui/blockquote-button/blockquote-button.d.mts +0 -20
- package/dist/ui/blockquote-button/blockquote-button.d.ts +0 -20
- package/dist/ui/blockquote-button/blockquote-button.js +0 -247
- package/dist/ui/blockquote-button/blockquote-button.mjs +0 -9
- package/dist/ui/blockquote-button/index.d.mts +0 -6
- package/dist/ui/blockquote-button/index.d.ts +0 -6
- package/dist/ui/blockquote-button/index.js +0 -259
- package/dist/ui/blockquote-button/index.mjs +0 -21
- package/dist/ui/blockquote-button/use-blockquote.d.mts +0 -85
- package/dist/ui/blockquote-button/use-blockquote.d.ts +0 -85
- package/dist/ui/blockquote-button/use-blockquote.js +0 -192
- package/dist/ui/blockquote-button/use-blockquote.mjs +0 -17
- package/dist/ui/bubble-menu/index.d.mts +0 -13
- package/dist/ui/bubble-menu/index.d.ts +0 -13
- package/dist/ui/bubble-menu/index.js +0 -673
- package/dist/ui/bubble-menu/index.mjs +0 -16
- package/dist/ui/codeblock-button/code-block-button.d.mts +0 -20
- package/dist/ui/codeblock-button/code-block-button.d.ts +0 -20
- package/dist/ui/codeblock-button/code-block-button.js +0 -237
- package/dist/ui/codeblock-button/code-block-button.mjs +0 -9
- package/dist/ui/codeblock-button/index.d.mts +0 -6
- package/dist/ui/codeblock-button/index.d.ts +0 -6
- package/dist/ui/codeblock-button/index.js +0 -249
- package/dist/ui/codeblock-button/index.mjs +0 -21
- package/dist/ui/codeblock-button/use-code-block.d.mts +0 -92
- package/dist/ui/codeblock-button/use-code-block.d.ts +0 -92
- package/dist/ui/codeblock-button/use-code-block.js +0 -192
- package/dist/ui/codeblock-button/use-code-block.mjs +0 -17
- package/dist/ui/color-highlight-button/color-highlight-button.d.mts +0 -25
- package/dist/ui/color-highlight-button/color-highlight-button.d.ts +0 -25
- package/dist/ui/color-highlight-button/color-highlight-button.js +0 -266
- package/dist/ui/color-highlight-button/color-highlight-button.mjs +0 -9
- package/dist/ui/color-highlight-button/index.d.mts +0 -6
- package/dist/ui/color-highlight-button/index.d.ts +0 -6
- package/dist/ui/color-highlight-button/index.js +0 -342
- package/dist/ui/color-highlight-button/index.mjs +0 -27
- package/dist/ui/color-highlight-button/use-color-highlight.d.mts +0 -64
- package/dist/ui/color-highlight-button/use-color-highlight.d.ts +0 -64
- package/dist/ui/color-highlight-button/use-color-highlight.js +0 -247
- package/dist/ui/color-highlight-button/use-color-highlight.mjs +0 -23
- package/dist/ui/color-highlight-popover/color-highlight-popover.d.mts +0 -29
- package/dist/ui/color-highlight-popover/color-highlight-popover.d.ts +0 -29
- package/dist/ui/color-highlight-popover/color-highlight-popover.js +0 -590
- package/dist/ui/color-highlight-popover/color-highlight-popover.mjs +0 -17
- package/dist/ui/color-highlight-popover/index.d.mts +0 -6
- package/dist/ui/color-highlight-popover/index.d.ts +0 -6
- package/dist/ui/color-highlight-popover/index.js +0 -591
- package/dist/ui/color-highlight-popover/index.mjs +0 -17
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.d.mts +0 -30
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.d.ts +0 -30
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.js +0 -171
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.mjs +0 -10
- package/dist/ui/heading-button/index.d.mts +0 -45
- package/dist/ui/heading-button/index.d.ts +0 -45
- package/dist/ui/heading-button/index.js +0 -222
- package/dist/ui/heading-button/index.mjs +0 -16
- package/dist/ui/heading-button/utils.d.mts +0 -17
- package/dist/ui/heading-button/utils.d.ts +0 -17
- package/dist/ui/heading-button/utils.js +0 -92
- package/dist/ui/heading-button/utils.mjs +0 -19
- package/dist/ui/heading-dropdown-menu/index.d.mts +0 -14
- package/dist/ui/heading-dropdown-menu/index.d.ts +0 -14
- package/dist/ui/heading-dropdown-menu/index.js +0 -308
- package/dist/ui/heading-dropdown-menu/index.mjs +0 -10
- package/dist/ui/link-bubble/index.d.mts +0 -13
- package/dist/ui/link-bubble/index.d.ts +0 -13
- package/dist/ui/link-bubble/index.js +0 -183
- package/dist/ui/link-bubble/index.mjs +0 -10
- package/dist/ui/link-popover/index.d.mts +0 -7
- package/dist/ui/link-popover/index.d.ts +0 -7
- package/dist/ui/link-popover/index.js +0 -512
- package/dist/ui/link-popover/index.mjs +0 -30
- package/dist/ui/link-popover/link-popover.d.mts +0 -85
- package/dist/ui/link-popover/link-popover.d.ts +0 -85
- package/dist/ui/link-popover/link-popover.js +0 -498
- package/dist/ui/link-popover/link-popover.mjs +0 -16
- package/dist/ui/link-popover/use-link-popover.d.mts +0 -123
- package/dist/ui/link-popover/use-link-popover.d.ts +0 -123
- package/dist/ui/link-popover/use-link-popover.js +0 -259
- package/dist/ui/link-popover/use-link-popover.mjs +0 -20
- package/dist/ui/list-button/index.d.mts +0 -50
- package/dist/ui/list-button/index.d.ts +0 -50
- package/dist/ui/list-button/index.js +0 -232
- package/dist/ui/list-button/index.mjs +0 -24
- package/dist/ui/list-dropdown-menu/index.d.mts +0 -45
- package/dist/ui/list-dropdown-menu/index.d.ts +0 -45
- package/dist/ui/list-dropdown-menu/index.js +0 -361
- package/dist/ui/list-dropdown-menu/index.mjs +0 -21
- package/dist/ui/mark-button/index.d.mts +0 -59
- package/dist/ui/mark-button/index.d.ts +0 -59
- package/dist/ui/mark-button/index.js +0 -217
- package/dist/ui/mark-button/index.mjs +0 -26
- package/dist/ui/reset-all-formatting-button/index.d.mts +0 -7
- package/dist/ui/reset-all-formatting-button/index.d.ts +0 -7
- package/dist/ui/reset-all-formatting-button/index.js +0 -286
- package/dist/ui/reset-all-formatting-button/index.mjs +0 -26
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.d.mts +0 -30
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.d.ts +0 -30
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.js +0 -271
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.mjs +0 -12
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.d.mts +0 -103
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.d.ts +0 -103
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.js +0 -211
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.mjs +0 -21
- package/dist/ui/slash-dropdown-menu/index.d.mts +0 -10
- package/dist/ui/slash-dropdown-menu/index.d.ts +0 -10
- package/dist/ui/slash-dropdown-menu/index.js +0 -1056
- package/dist/ui/slash-dropdown-menu/index.mjs +0 -19
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.d.mts +0 -16
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.d.ts +0 -16
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.js +0 -1053
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.mjs +0 -16
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.d.mts +0 -162
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.d.ts +0 -162
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.js +0 -457
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.mjs +0 -10
- package/dist/ui/suggestion-menu/index.d.mts +0 -10
- package/dist/ui/suggestion-menu/index.d.ts +0 -10
- package/dist/ui/suggestion-menu/index.js +0 -489
- package/dist/ui/suggestion-menu/index.mjs +0 -17
- package/dist/ui/suggestion-menu/suggestion-menu-types.d.mts +0 -89
- package/dist/ui/suggestion-menu/suggestion-menu-types.d.ts +0 -89
- package/dist/ui/suggestion-menu/suggestion-menu-types.js +0 -19
- package/dist/ui/suggestion-menu/suggestion-menu-types.mjs +0 -1
- package/dist/ui/suggestion-menu/suggestion-menu-utils.d.mts +0 -27
- package/dist/ui/suggestion-menu/suggestion-menu-utils.d.ts +0 -27
- package/dist/ui/suggestion-menu/suggestion-menu-utils.js +0 -75
- package/dist/ui/suggestion-menu/suggestion-menu-utils.mjs +0 -9
- package/dist/ui/suggestion-menu/suggestion-menu.d.mts +0 -15
- package/dist/ui/suggestion-menu/suggestion-menu.d.ts +0 -15
- package/dist/ui/suggestion-menu/suggestion-menu.js +0 -453
- package/dist/ui/suggestion-menu/suggestion-menu.mjs +0 -12
- package/dist/ui/table-button/index.d.mts +0 -15
- package/dist/ui/table-button/index.d.ts +0 -15
- package/dist/ui/table-button/index.js +0 -202
- package/dist/ui/table-button/index.mjs +0 -9
- package/dist/ui/table-button/use-table.d.mts +0 -51
- package/dist/ui/table-button/use-table.d.ts +0 -51
- package/dist/ui/table-button/use-table.js +0 -146
- package/dist/ui/table-button/use-table.mjs +0 -14
- package/dist/ui/text-align-button/index.d.mts +0 -6
- package/dist/ui/text-align-button/index.d.ts +0 -6
- package/dist/ui/text-align-button/index.js +0 -235
- package/dist/ui/text-align-button/index.mjs +0 -29
- package/dist/ui/text-align-button/text-align-button.d.mts +0 -20
- package/dist/ui/text-align-button/text-align-button.d.ts +0 -20
- package/dist/ui/text-align-button/text-align-button.js +0 -215
- package/dist/ui/text-align-button/text-align-button.mjs +0 -9
- package/dist/ui/text-align-button/use-text-align.d.mts +0 -106
- package/dist/ui/text-align-button/use-text-align.d.ts +0 -106
- package/dist/ui/text-align-button/use-text-align.js +0 -169
- package/dist/ui/text-align-button/use-text-align.mjs +0 -24
- package/dist/ui/undo-redo-button/index.d.mts +0 -6
- package/dist/ui/undo-redo-button/index.d.ts +0 -6
- package/dist/ui/undo-redo-button/index.js +0 -202
- package/dist/ui/undo-redo-button/index.mjs +0 -25
- package/dist/ui/undo-redo-button/undo-redo-button.d.mts +0 -23
- package/dist/ui/undo-redo-button/undo-redo-button.d.ts +0 -23
- package/dist/ui/undo-redo-button/undo-redo-button.js +0 -187
- package/dist/ui/undo-redo-button/undo-redo-button.mjs +0 -10
- package/dist/ui/undo-redo-button/use-undo-redo.d.mts +0 -95
- package/dist/ui/undo-redo-button/use-undo-redo.d.ts +0 -95
- package/dist/ui/undo-redo-button/use-undo-redo.js +0 -146
- package/dist/ui/undo-redo-button/use-undo-redo.mjs +0 -21
- package/dist/utils/index.d.mts +0 -38
- package/dist/utils/index.d.ts +0 -38
- package/dist/utils/index.js +0 -128
- package/dist/utils/index.mjs +0 -15
- package/dist/utils/safe-parse.d.mts +0 -14
- package/dist/utils/safe-parse.d.ts +0 -14
- package/dist/utils/safe-parse.js +0 -203
- package/dist/utils/safe-parse.mjs +0 -8
package/dist/chunk-DQK6PA4U.mjs
DELETED
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
TrailingNode
|
|
4
|
-
} from "./chunk-H6LC4LDQ.mjs";
|
|
5
|
-
import {
|
|
6
|
-
VariableNode
|
|
7
|
-
} from "./chunk-4HO7BWDC.mjs";
|
|
8
|
-
import {
|
|
9
|
-
MathBlock
|
|
10
|
-
} from "./chunk-2U5CQUZH.mjs";
|
|
11
|
-
import {
|
|
12
|
-
InlineMath
|
|
13
|
-
} from "./chunk-7VW67NVL.mjs";
|
|
14
|
-
import {
|
|
15
|
-
Selection
|
|
16
|
-
} from "./chunk-U5XAL46P.mjs";
|
|
17
|
-
import {
|
|
18
|
-
TocNode
|
|
19
|
-
} from "./chunk-IFXRPGIJ.mjs";
|
|
20
|
-
import {
|
|
21
|
-
ImageNode
|
|
22
|
-
} from "./chunk-HTJ2RXOG.mjs";
|
|
23
|
-
import {
|
|
24
|
-
ImageUploadNode
|
|
25
|
-
} from "./chunk-N3JE67CS.mjs";
|
|
26
|
-
import {
|
|
27
|
-
Link
|
|
28
|
-
} from "./chunk-EIIWU5FR.mjs";
|
|
29
|
-
import {
|
|
30
|
-
UiState
|
|
31
|
-
} from "./chunk-KR42JAVB.mjs";
|
|
32
|
-
import {
|
|
33
|
-
safeParseContent
|
|
34
|
-
} from "./chunk-3VRQUYYW.mjs";
|
|
35
|
-
import {
|
|
36
|
-
CalloutNode
|
|
37
|
-
} from "./chunk-32SUXCAQ.mjs";
|
|
38
|
-
import {
|
|
39
|
-
useEditorFile
|
|
40
|
-
} from "./chunk-VRQ6OSAZ.mjs";
|
|
41
|
-
|
|
42
|
-
// src/hooks/use-create-editor.ts
|
|
43
|
-
import { CodeKit } from "@kopexa/extension-code";
|
|
44
|
-
import { ControlKit } from "@kopexa/extension-controlref";
|
|
45
|
-
import { TableKit } from "@kopexa/extension-table";
|
|
46
|
-
import { FileHandler } from "@tiptap/extension-file-handler";
|
|
47
|
-
import { Highlight } from "@tiptap/extension-highlight";
|
|
48
|
-
import InvisibleCharacters from "@tiptap/extension-invisible-characters";
|
|
49
|
-
import { TaskItem, TaskList } from "@tiptap/extension-list";
|
|
50
|
-
import { Subscript } from "@tiptap/extension-subscript";
|
|
51
|
-
import { Superscript } from "@tiptap/extension-superscript";
|
|
52
|
-
import {
|
|
53
|
-
getHierarchicalIndexes,
|
|
54
|
-
TableOfContents
|
|
55
|
-
} from "@tiptap/extension-table-of-contents";
|
|
56
|
-
import { TextAlign } from "@tiptap/extension-text-align";
|
|
57
|
-
import { TextStyleKit } from "@tiptap/extension-text-style";
|
|
58
|
-
import { Typography } from "@tiptap/extension-typography";
|
|
59
|
-
import { UniqueID } from "@tiptap/extension-unique-id";
|
|
60
|
-
import { CharacterCount, Placeholder } from "@tiptap/extensions";
|
|
61
|
-
import {
|
|
62
|
-
useEditor
|
|
63
|
-
} from "@tiptap/react";
|
|
64
|
-
import { StarterKit } from "@tiptap/starter-kit";
|
|
65
|
-
import { useEffect, useState } from "react";
|
|
66
|
-
var useCreateEditor = ({
|
|
67
|
-
content,
|
|
68
|
-
editable = true,
|
|
69
|
-
placeholder = "Write, type '/' for commands\u2026",
|
|
70
|
-
onChange,
|
|
71
|
-
enableControls = false,
|
|
72
|
-
controlResolver,
|
|
73
|
-
fileHandler: fileHandlerProp,
|
|
74
|
-
enableVariables = false,
|
|
75
|
-
...options
|
|
76
|
-
}) => {
|
|
77
|
-
const fileHandlerFromContext = useEditorFile();
|
|
78
|
-
const fileHandler = fileHandlerProp != null ? fileHandlerProp : fileHandlerFromContext;
|
|
79
|
-
const [extensions] = useState(
|
|
80
|
-
() => getExtensions({
|
|
81
|
-
editable,
|
|
82
|
-
placeholder,
|
|
83
|
-
enableControls,
|
|
84
|
-
controlResolver,
|
|
85
|
-
fileHandler,
|
|
86
|
-
enableVariables
|
|
87
|
-
})
|
|
88
|
-
);
|
|
89
|
-
const editor = useEditor({
|
|
90
|
-
editorProps: {
|
|
91
|
-
attributes: {
|
|
92
|
-
autocomplete: "off",
|
|
93
|
-
autocorrect: "off",
|
|
94
|
-
autocapitalize: "off",
|
|
95
|
-
"aria-label": "Main content area, start typing to enter text."
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
immediatelyRender: false,
|
|
99
|
-
shouldRerenderOnTransaction: false,
|
|
100
|
-
extensions,
|
|
101
|
-
editable,
|
|
102
|
-
onUpdate: ({ editor: editor2 }) => {
|
|
103
|
-
onChange == null ? void 0 : onChange(editor2.getJSON());
|
|
104
|
-
},
|
|
105
|
-
content: safeParseContent(content),
|
|
106
|
-
...options
|
|
107
|
-
});
|
|
108
|
-
useEffect(() => {
|
|
109
|
-
if (editor && editor.isEditable !== editable) {
|
|
110
|
-
editor.setEditable(editable);
|
|
111
|
-
}
|
|
112
|
-
}, [editor, editable]);
|
|
113
|
-
return editor;
|
|
114
|
-
};
|
|
115
|
-
function getExtensions({
|
|
116
|
-
editable,
|
|
117
|
-
placeholder,
|
|
118
|
-
enableControls = false,
|
|
119
|
-
controlResolver,
|
|
120
|
-
fileHandler,
|
|
121
|
-
enableVariables = false
|
|
122
|
-
}) {
|
|
123
|
-
const extensions = [
|
|
124
|
-
StarterKit.configure({
|
|
125
|
-
trailingNode: false,
|
|
126
|
-
// we use our custom trailing node extension
|
|
127
|
-
link: false,
|
|
128
|
-
// we use our custom link extension
|
|
129
|
-
code: false,
|
|
130
|
-
// we use our own
|
|
131
|
-
codeBlock: false
|
|
132
|
-
// we use our own
|
|
133
|
-
// undoRedo should be dynamic based on collaboration, later.^
|
|
134
|
-
}),
|
|
135
|
-
TextAlign.configure({ types: ["heading", "paragraph"] }),
|
|
136
|
-
TaskList,
|
|
137
|
-
TaskItem.configure({ nested: true }),
|
|
138
|
-
InvisibleCharacters.configure({
|
|
139
|
-
visible: false
|
|
140
|
-
}),
|
|
141
|
-
TableOfContents.configure({
|
|
142
|
-
getIndex: getHierarchicalIndexes
|
|
143
|
-
}),
|
|
144
|
-
Selection,
|
|
145
|
-
Link.configure({ openOnClick: !editable }),
|
|
146
|
-
// disable link click when editing
|
|
147
|
-
TextStyleKit,
|
|
148
|
-
Highlight.configure({ multicolor: true }),
|
|
149
|
-
CharacterCount,
|
|
150
|
-
Typography,
|
|
151
|
-
Superscript,
|
|
152
|
-
Subscript,
|
|
153
|
-
CodeKit,
|
|
154
|
-
TrailingNode,
|
|
155
|
-
UniqueID.configure({
|
|
156
|
-
types: [
|
|
157
|
-
"paragraph",
|
|
158
|
-
"bulletList",
|
|
159
|
-
"orderedList",
|
|
160
|
-
"taskList",
|
|
161
|
-
"heading",
|
|
162
|
-
"blockquote",
|
|
163
|
-
"codeBlock"
|
|
164
|
-
]
|
|
165
|
-
// filterTransaction: (transaction) => !isChangeOrigin(transaction),
|
|
166
|
-
}),
|
|
167
|
-
UiState,
|
|
168
|
-
TableKit,
|
|
169
|
-
TocNode,
|
|
170
|
-
CalloutNode,
|
|
171
|
-
MathBlock,
|
|
172
|
-
InlineMath,
|
|
173
|
-
// Image support - extended with file reference resolution
|
|
174
|
-
ImageNode.configure({
|
|
175
|
-
allowBase64: true
|
|
176
|
-
}),
|
|
177
|
-
// Image upload placeholder
|
|
178
|
-
ImageUploadNode,
|
|
179
|
-
Placeholder.configure({
|
|
180
|
-
placeholder,
|
|
181
|
-
emptyNodeClass: "is-empty with-slash"
|
|
182
|
-
})
|
|
183
|
-
];
|
|
184
|
-
if (enableControls) {
|
|
185
|
-
extensions.push(ControlKit.configure({ resolver: controlResolver }));
|
|
186
|
-
}
|
|
187
|
-
if (enableVariables) {
|
|
188
|
-
extensions.push(VariableNode);
|
|
189
|
-
}
|
|
190
|
-
if (fileHandler) {
|
|
191
|
-
extensions.push(
|
|
192
|
-
FileHandler.configure({
|
|
193
|
-
allowedMimeTypes: [
|
|
194
|
-
"image/jpeg",
|
|
195
|
-
"image/png",
|
|
196
|
-
"image/gif",
|
|
197
|
-
"image/webp",
|
|
198
|
-
"image/svg+xml"
|
|
199
|
-
],
|
|
200
|
-
onDrop: (editor, files, pos) => {
|
|
201
|
-
for (const file of files) {
|
|
202
|
-
handleFileUpload(editor, file, fileHandler, pos);
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
onPaste: (editor, files) => {
|
|
206
|
-
for (const file of files) {
|
|
207
|
-
handleFileUpload(editor, file, fileHandler);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
})
|
|
211
|
-
);
|
|
212
|
-
}
|
|
213
|
-
return extensions;
|
|
214
|
-
}
|
|
215
|
-
async function handleFileUpload(editor, file, fileHandler, pos) {
|
|
216
|
-
if (!editor) return;
|
|
217
|
-
const tempId = `uploading-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
218
|
-
const insertPos = pos != null ? pos : editor.state.selection.anchor;
|
|
219
|
-
editor.chain().focus().insertContentAt(insertPos, {
|
|
220
|
-
type: "image",
|
|
221
|
-
attrs: {
|
|
222
|
-
src: tempId,
|
|
223
|
-
uploadState: "uploading",
|
|
224
|
-
uploadProgress: 0
|
|
225
|
-
}
|
|
226
|
-
}).run();
|
|
227
|
-
try {
|
|
228
|
-
const ref = await fileHandler.upload(file, (percent) => {
|
|
229
|
-
editor.state.doc.descendants((node, nodePos) => {
|
|
230
|
-
if (node.type.name === "image" && node.attrs.src === tempId) {
|
|
231
|
-
editor.view.dispatch(
|
|
232
|
-
editor.state.tr.setNodeMarkup(nodePos, void 0, {
|
|
233
|
-
...node.attrs,
|
|
234
|
-
uploadProgress: percent
|
|
235
|
-
})
|
|
236
|
-
);
|
|
237
|
-
return false;
|
|
238
|
-
}
|
|
239
|
-
return true;
|
|
240
|
-
});
|
|
241
|
-
});
|
|
242
|
-
editor.state.doc.descendants((node, nodePos) => {
|
|
243
|
-
if (node.type.name === "image" && node.attrs.src === tempId) {
|
|
244
|
-
editor.view.dispatch(
|
|
245
|
-
editor.state.tr.setNodeMarkup(nodePos, void 0, {
|
|
246
|
-
src: ref,
|
|
247
|
-
uploadState: null,
|
|
248
|
-
uploadProgress: null
|
|
249
|
-
})
|
|
250
|
-
);
|
|
251
|
-
return false;
|
|
252
|
-
}
|
|
253
|
-
return true;
|
|
254
|
-
});
|
|
255
|
-
} catch (error) {
|
|
256
|
-
editor.state.doc.descendants((node, nodePos) => {
|
|
257
|
-
if (node.type.name === "image" && node.attrs.src === tempId) {
|
|
258
|
-
editor.view.dispatch(
|
|
259
|
-
editor.state.tr.setNodeMarkup(nodePos, void 0, {
|
|
260
|
-
...node.attrs,
|
|
261
|
-
uploadState: "error",
|
|
262
|
-
uploadProgress: null
|
|
263
|
-
})
|
|
264
|
-
);
|
|
265
|
-
return false;
|
|
266
|
-
}
|
|
267
|
-
return true;
|
|
268
|
-
});
|
|
269
|
-
console.error("[FileHandler] Upload failed:", error);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
export {
|
|
274
|
-
useCreateEditor,
|
|
275
|
-
getExtensions
|
|
276
|
-
};
|
package/dist/chunk-DSBJFMHK.mjs
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/extensions/image-upload/messages.ts
|
|
4
|
-
import { defineMessages } from "react-intl";
|
|
5
|
-
var messages = defineMessages({
|
|
6
|
-
upload_error: {
|
|
7
|
-
id: "editor.image.upload_error",
|
|
8
|
-
defaultMessage: "Failed to upload image"
|
|
9
|
-
},
|
|
10
|
-
uploading: {
|
|
11
|
-
id: "editor.image.uploading",
|
|
12
|
-
defaultMessage: "Uploading..."
|
|
13
|
-
},
|
|
14
|
-
upload_placeholder: {
|
|
15
|
-
id: "editor.image.upload_placeholder",
|
|
16
|
-
defaultMessage: "Click to upload or drag & drop"
|
|
17
|
-
},
|
|
18
|
-
upload_hint: {
|
|
19
|
-
id: "editor.image.upload_hint",
|
|
20
|
-
defaultMessage: "PNG, JPG, GIF, WebP, SVG"
|
|
21
|
-
},
|
|
22
|
-
click_to_retry: {
|
|
23
|
-
id: "editor.image.click_to_retry",
|
|
24
|
-
defaultMessage: "Click to try again"
|
|
25
|
-
},
|
|
26
|
-
files_not_supported: {
|
|
27
|
-
id: "editor.image.files_not_supported",
|
|
28
|
-
defaultMessage: "File upload is not configured"
|
|
29
|
-
},
|
|
30
|
-
remove: {
|
|
31
|
-
id: "editor.image.remove",
|
|
32
|
-
defaultMessage: "Remove"
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
export {
|
|
37
|
-
messages
|
|
38
|
-
};
|
package/dist/chunk-DT7ML2P4.mjs
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/hooks/use-window-size.ts
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
function useWindowSize() {
|
|
6
|
-
const [windowSize, setWindowSize] = React.useState({
|
|
7
|
-
width: 0,
|
|
8
|
-
height: 0,
|
|
9
|
-
offsetTop: 0
|
|
10
|
-
});
|
|
11
|
-
React.useEffect(() => {
|
|
12
|
-
handleResize();
|
|
13
|
-
function handleResize() {
|
|
14
|
-
if (typeof window === "undefined") return;
|
|
15
|
-
const vp = window.visualViewport;
|
|
16
|
-
if (!vp) return;
|
|
17
|
-
const { width = 0, height = 0, offsetTop = 0 } = vp;
|
|
18
|
-
setWindowSize((state) => {
|
|
19
|
-
if (width === state.width && height === state.height && offsetTop === state.offsetTop) {
|
|
20
|
-
return state;
|
|
21
|
-
}
|
|
22
|
-
return { width, height, offsetTop };
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
const visualViewport = window.visualViewport;
|
|
26
|
-
if (visualViewport) {
|
|
27
|
-
visualViewport.addEventListener("resize", handleResize);
|
|
28
|
-
visualViewport.addEventListener("scroll", handleResize);
|
|
29
|
-
}
|
|
30
|
-
return () => {
|
|
31
|
-
if (visualViewport) {
|
|
32
|
-
visualViewport.removeEventListener("resize", handleResize);
|
|
33
|
-
visualViewport.removeEventListener("scroll", handleResize);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}, []);
|
|
37
|
-
return windowSize;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export {
|
|
41
|
-
useWindowSize
|
|
42
|
-
};
|
package/dist/chunk-DZLGLP7R.mjs
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useTiptapEditor
|
|
4
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
5
|
-
import {
|
|
6
|
-
selectNodeAndHideFloating
|
|
7
|
-
} from "./chunk-TDFS3DCZ.mjs";
|
|
8
|
-
|
|
9
|
-
// src/ui/copy-anchor-link-button/use-scroll-to-hash.ts
|
|
10
|
-
import { getEditorExtension } from "@kopexa/editor-utils";
|
|
11
|
-
import * as React from "react";
|
|
12
|
-
function useScrollToHash(config = {}) {
|
|
13
|
-
const {
|
|
14
|
-
editor: providedEditor,
|
|
15
|
-
onTargetFound = () => {
|
|
16
|
-
},
|
|
17
|
-
onTargetNotFound = () => {
|
|
18
|
-
}
|
|
19
|
-
} = config;
|
|
20
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
21
|
-
const scrollToNode = React.useCallback(
|
|
22
|
-
(id) => {
|
|
23
|
-
var _a, _b, _c;
|
|
24
|
-
if (!editor) return false;
|
|
25
|
-
const attributeName = (_c = (_b = (_a = getEditorExtension(editor, "uniqueID")) == null ? void 0 : _a.options) == null ? void 0 : _b.attributeName) != null ? _c : "data-id";
|
|
26
|
-
let position = null;
|
|
27
|
-
editor.state.doc.descendants((node, pos) => {
|
|
28
|
-
var _a2;
|
|
29
|
-
if (((_a2 = node.attrs) == null ? void 0 : _a2[attributeName]) === id) {
|
|
30
|
-
position = pos;
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
return true;
|
|
34
|
-
});
|
|
35
|
-
if (position === null) return false;
|
|
36
|
-
selectNodeAndHideFloating(editor, position);
|
|
37
|
-
setTimeout(() => {
|
|
38
|
-
let dom = null;
|
|
39
|
-
if (typeof position === "number") {
|
|
40
|
-
dom = editor.view.nodeDOM(position);
|
|
41
|
-
}
|
|
42
|
-
if (dom) {
|
|
43
|
-
dom.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
44
|
-
}
|
|
45
|
-
}, 0);
|
|
46
|
-
return true;
|
|
47
|
-
},
|
|
48
|
-
[editor]
|
|
49
|
-
);
|
|
50
|
-
const handleScroll = React.useCallback(
|
|
51
|
-
(delay = 0) => {
|
|
52
|
-
var _a;
|
|
53
|
-
const hash = (_a = window.location.hash) == null ? void 0 : _a.substring(1);
|
|
54
|
-
if (!hash) return;
|
|
55
|
-
setTimeout(() => {
|
|
56
|
-
if (scrollToNode(hash)) {
|
|
57
|
-
onTargetFound(hash);
|
|
58
|
-
} else {
|
|
59
|
-
onTargetNotFound(hash);
|
|
60
|
-
}
|
|
61
|
-
}, delay);
|
|
62
|
-
},
|
|
63
|
-
[scrollToNode, onTargetFound, onTargetNotFound]
|
|
64
|
-
);
|
|
65
|
-
React.useEffect(() => {
|
|
66
|
-
var _a, _b;
|
|
67
|
-
if (!editor) return;
|
|
68
|
-
const provider = (_b = (_a = editor.extensionManager.extensions.find(
|
|
69
|
-
(ext) => ext.name === "collaborationCaret"
|
|
70
|
-
)) == null ? void 0 : _a.options) == null ? void 0 : _b.provider;
|
|
71
|
-
if (provider == null ? void 0 : provider.on) {
|
|
72
|
-
const syncHandler = () => handleScroll(500);
|
|
73
|
-
provider.on("synced", syncHandler);
|
|
74
|
-
return () => {
|
|
75
|
-
var _a2;
|
|
76
|
-
(_a2 = provider.off) == null ? void 0 : _a2.call(provider, "synced", syncHandler);
|
|
77
|
-
};
|
|
78
|
-
} else {
|
|
79
|
-
handleScroll(500);
|
|
80
|
-
}
|
|
81
|
-
}, [editor, handleScroll]);
|
|
82
|
-
React.useEffect(() => {
|
|
83
|
-
const immediateScroll = () => handleScroll();
|
|
84
|
-
const delayedScroll = () => handleScroll(500);
|
|
85
|
-
window.addEventListener("hashchange", immediateScroll);
|
|
86
|
-
window.addEventListener("pageshow", delayedScroll);
|
|
87
|
-
window.addEventListener("popstate", immediateScroll);
|
|
88
|
-
return () => {
|
|
89
|
-
window.removeEventListener("hashchange", immediateScroll);
|
|
90
|
-
window.removeEventListener("pageshow", delayedScroll);
|
|
91
|
-
window.removeEventListener("popstate", immediateScroll);
|
|
92
|
-
};
|
|
93
|
-
}, [handleScroll]);
|
|
94
|
-
return { scrollToHash: scrollToNode };
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export {
|
|
98
|
-
useScrollToHash
|
|
99
|
-
};
|