@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
|
@@ -1,501 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
"use client";
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
-
|
|
22
|
-
// src/extensions/toc/index.ts
|
|
23
|
-
var toc_exports = {};
|
|
24
|
-
__export(toc_exports, {
|
|
25
|
-
TocNode: () => TocNode,
|
|
26
|
-
default: () => toc_default
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(toc_exports);
|
|
29
|
-
var import_core = require("@tiptap/core");
|
|
30
|
-
var import_react4 = require("@tiptap/react");
|
|
31
|
-
|
|
32
|
-
// src/extensions/toc/toc-view.tsx
|
|
33
|
-
var import_icons2 = require("@kopexa/icons");
|
|
34
|
-
var import_theme = require("@kopexa/theme");
|
|
35
|
-
var import_react2 = require("@tiptap/react");
|
|
36
|
-
var import_react3 = require("react");
|
|
37
|
-
var import_react_intl3 = require("react-intl");
|
|
38
|
-
|
|
39
|
-
// src/extensions/toc/messages.ts
|
|
40
|
-
var import_react_intl = require("react-intl");
|
|
41
|
-
var messages = (0, import_react_intl.defineMessages)({
|
|
42
|
-
title: {
|
|
43
|
-
id: "editor.toc.title",
|
|
44
|
-
defaultMessage: "Table of Contents",
|
|
45
|
-
description: "Title of the table of contents"
|
|
46
|
-
},
|
|
47
|
-
save: {
|
|
48
|
-
id: "editor.toc.save",
|
|
49
|
-
defaultMessage: "Save",
|
|
50
|
-
description: "Save button label"
|
|
51
|
-
},
|
|
52
|
-
cancel: {
|
|
53
|
-
id: "editor.toc.cancel",
|
|
54
|
-
defaultMessage: "Cancel",
|
|
55
|
-
description: "Cancel button label"
|
|
56
|
-
},
|
|
57
|
-
empty_state: {
|
|
58
|
-
id: "editor.toc.empty_state",
|
|
59
|
-
defaultMessage: "No headings found. Add headings (H1-H6) to populate the table of contents.",
|
|
60
|
-
description: "Empty state when no headings are present"
|
|
61
|
-
},
|
|
62
|
-
empty_heading: {
|
|
63
|
-
id: "editor.toc.empty_heading",
|
|
64
|
-
defaultMessage: "(Empty heading)",
|
|
65
|
-
description: "Placeholder for empty heading text"
|
|
66
|
-
},
|
|
67
|
-
settings: {
|
|
68
|
-
id: "editor.toc.settings",
|
|
69
|
-
defaultMessage: "Settings",
|
|
70
|
-
description: "Settings button label"
|
|
71
|
-
},
|
|
72
|
-
min_level: {
|
|
73
|
-
id: "editor.toc.min_level",
|
|
74
|
-
defaultMessage: "Minimum level",
|
|
75
|
-
description: "Minimum heading level setting"
|
|
76
|
-
},
|
|
77
|
-
max_level: {
|
|
78
|
-
id: "editor.toc.max_level",
|
|
79
|
-
defaultMessage: "Maximum level",
|
|
80
|
-
description: "Maximum heading level setting"
|
|
81
|
-
},
|
|
82
|
-
numbered: {
|
|
83
|
-
id: "editor.toc.numbered",
|
|
84
|
-
defaultMessage: "Numbering",
|
|
85
|
-
description: "Numbering toggle label"
|
|
86
|
-
},
|
|
87
|
-
numbered_hint: {
|
|
88
|
-
id: "editor.toc.numbered_hint",
|
|
89
|
-
defaultMessage: "Show hierarchical numbering (1, 1.1, 1.1.1)",
|
|
90
|
-
description: "Hint for numbering toggle"
|
|
91
|
-
},
|
|
92
|
-
style: {
|
|
93
|
-
id: "editor.toc.style",
|
|
94
|
-
defaultMessage: "Style",
|
|
95
|
-
description: "Style setting label"
|
|
96
|
-
},
|
|
97
|
-
style_default: {
|
|
98
|
-
id: "editor.toc.style_default",
|
|
99
|
-
defaultMessage: "Default",
|
|
100
|
-
description: "Default style option"
|
|
101
|
-
},
|
|
102
|
-
style_flat: {
|
|
103
|
-
id: "editor.toc.style_flat",
|
|
104
|
-
defaultMessage: "Flat",
|
|
105
|
-
description: "Flat style option"
|
|
106
|
-
},
|
|
107
|
-
style_compact: {
|
|
108
|
-
id: "editor.toc.style_compact",
|
|
109
|
-
defaultMessage: "Compact",
|
|
110
|
-
description: "Compact style option"
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
// src/extensions/toc/toc-settings.tsx
|
|
115
|
-
var import_button = require("@kopexa/button");
|
|
116
|
-
var import_dialog = require("@kopexa/dialog");
|
|
117
|
-
var import_icons = require("@kopexa/icons");
|
|
118
|
-
var import_label = require("@kopexa/label");
|
|
119
|
-
var import_select = require("@kopexa/select");
|
|
120
|
-
var import_switch = require("@kopexa/switch");
|
|
121
|
-
var import_react = require("react");
|
|
122
|
-
var import_react_intl2 = require("react-intl");
|
|
123
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
124
|
-
var HEADING_LEVELS = [
|
|
125
|
-
{ value: "1", label: "H1" },
|
|
126
|
-
{ value: "2", label: "H2" },
|
|
127
|
-
{ value: "3", label: "H3" },
|
|
128
|
-
{ value: "4", label: "H4" },
|
|
129
|
-
{ value: "5", label: "H5" },
|
|
130
|
-
{ value: "6", label: "H6" }
|
|
131
|
-
];
|
|
132
|
-
function TocSettings({ editor, attrs, getPos }) {
|
|
133
|
-
const intl = (0, import_react_intl2.useIntl)();
|
|
134
|
-
const [isOpen, setIsOpen] = (0, import_react.useState)(false);
|
|
135
|
-
const [localAttrs, setLocalAttrs] = (0, import_react.useState)(attrs);
|
|
136
|
-
(0, import_react.useEffect)(() => {
|
|
137
|
-
if (isOpen) {
|
|
138
|
-
setLocalAttrs(attrs);
|
|
139
|
-
}
|
|
140
|
-
}, [isOpen, attrs]);
|
|
141
|
-
const handleSave = (0, import_react.useCallback)(() => {
|
|
142
|
-
const pos = getPos();
|
|
143
|
-
if (pos === void 0) return;
|
|
144
|
-
editor.view.dispatch(
|
|
145
|
-
editor.state.tr.setNodeMarkup(pos, void 0, localAttrs)
|
|
146
|
-
);
|
|
147
|
-
setIsOpen(false);
|
|
148
|
-
}, [editor, localAttrs, getPos]);
|
|
149
|
-
const handleCancel = (0, import_react.useCallback)(() => {
|
|
150
|
-
setLocalAttrs(attrs);
|
|
151
|
-
setIsOpen(false);
|
|
152
|
-
}, [attrs]);
|
|
153
|
-
const handleMinLevelChange = (0, import_react.useCallback)((value) => {
|
|
154
|
-
const minLevel = Number.parseInt(String(value), 10);
|
|
155
|
-
setLocalAttrs((prev) => ({
|
|
156
|
-
...prev,
|
|
157
|
-
minLevel,
|
|
158
|
-
// Ensure maxLevel is not less than minLevel
|
|
159
|
-
maxLevel: Math.max(prev.maxLevel, minLevel)
|
|
160
|
-
}));
|
|
161
|
-
}, []);
|
|
162
|
-
const handleMaxLevelChange = (0, import_react.useCallback)((value) => {
|
|
163
|
-
const maxLevel = Number.parseInt(String(value), 10);
|
|
164
|
-
setLocalAttrs((prev) => ({
|
|
165
|
-
...prev,
|
|
166
|
-
maxLevel,
|
|
167
|
-
// Ensure minLevel is not greater than maxLevel
|
|
168
|
-
minLevel: Math.min(prev.minLevel, maxLevel)
|
|
169
|
-
}));
|
|
170
|
-
}, []);
|
|
171
|
-
const handleNumberedChange = (0, import_react.useCallback)((checked) => {
|
|
172
|
-
setLocalAttrs((prev) => ({ ...prev, numbered: checked }));
|
|
173
|
-
}, []);
|
|
174
|
-
const handleStyleChange = (0, import_react.useCallback)((value) => {
|
|
175
|
-
setLocalAttrs((prev) => ({
|
|
176
|
-
...prev,
|
|
177
|
-
style: String(value)
|
|
178
|
-
}));
|
|
179
|
-
}, []);
|
|
180
|
-
if (!editor.isEditable) {
|
|
181
|
-
return null;
|
|
182
|
-
}
|
|
183
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
184
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
185
|
-
import_button.IconButton,
|
|
186
|
-
{
|
|
187
|
-
size: "sm",
|
|
188
|
-
variant: "ghost",
|
|
189
|
-
"aria-label": intl.formatMessage(messages.settings),
|
|
190
|
-
onClick: (e) => {
|
|
191
|
-
e.stopPropagation();
|
|
192
|
-
e.preventDefault();
|
|
193
|
-
setIsOpen(true);
|
|
194
|
-
},
|
|
195
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.SettingsIcon, { className: "size-3.5" })
|
|
196
|
-
}
|
|
197
|
-
),
|
|
198
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Root, { open: isOpen, onOpenChange: setIsOpen, size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.Dialog.Content, { children: [
|
|
199
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Title, { children: intl.formatMessage(messages.settings) }) }),
|
|
200
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
|
|
201
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
202
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
203
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { className: "text-sm", children: intl.formatMessage(messages.min_level) }),
|
|
204
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
205
|
-
import_select.Select,
|
|
206
|
-
{
|
|
207
|
-
size: "sm",
|
|
208
|
-
value: String(localAttrs.minLevel),
|
|
209
|
-
onValueChange: handleMinLevelChange,
|
|
210
|
-
children: [
|
|
211
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.Select.Trigger, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.Select.Value, {}) }),
|
|
212
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.Select.Content, { children: HEADING_LEVELS.map((level) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
213
|
-
import_select.Select.Item,
|
|
214
|
-
{
|
|
215
|
-
value: level.value,
|
|
216
|
-
disabled: Number.parseInt(level.value, 10) > localAttrs.maxLevel,
|
|
217
|
-
children: level.label
|
|
218
|
-
},
|
|
219
|
-
level.value
|
|
220
|
-
)) })
|
|
221
|
-
]
|
|
222
|
-
}
|
|
223
|
-
)
|
|
224
|
-
] }),
|
|
225
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
226
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { className: "text-sm", children: intl.formatMessage(messages.max_level) }),
|
|
227
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
228
|
-
import_select.Select,
|
|
229
|
-
{
|
|
230
|
-
size: "sm",
|
|
231
|
-
value: String(localAttrs.maxLevel),
|
|
232
|
-
onValueChange: handleMaxLevelChange,
|
|
233
|
-
children: [
|
|
234
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.Select.Trigger, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.Select.Value, {}) }),
|
|
235
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.Select.Content, { children: HEADING_LEVELS.map((level) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
236
|
-
import_select.Select.Item,
|
|
237
|
-
{
|
|
238
|
-
value: level.value,
|
|
239
|
-
disabled: Number.parseInt(level.value, 10) < localAttrs.minLevel,
|
|
240
|
-
children: level.label
|
|
241
|
-
},
|
|
242
|
-
level.value
|
|
243
|
-
)) })
|
|
244
|
-
]
|
|
245
|
-
}
|
|
246
|
-
)
|
|
247
|
-
] })
|
|
248
|
-
] }),
|
|
249
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
250
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-0.5", children: [
|
|
251
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { className: "text-sm", children: intl.formatMessage(messages.numbered) }),
|
|
252
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: intl.formatMessage(messages.numbered_hint) })
|
|
253
|
-
] }),
|
|
254
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
255
|
-
import_switch.Switch,
|
|
256
|
-
{
|
|
257
|
-
size: "sm",
|
|
258
|
-
checked: localAttrs.numbered,
|
|
259
|
-
onCheckedChange: handleNumberedChange
|
|
260
|
-
}
|
|
261
|
-
)
|
|
262
|
-
] }),
|
|
263
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
264
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { className: "text-sm", children: intl.formatMessage(messages.style) }),
|
|
265
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
266
|
-
import_select.Select,
|
|
267
|
-
{
|
|
268
|
-
size: "sm",
|
|
269
|
-
value: localAttrs.style,
|
|
270
|
-
onValueChange: handleStyleChange,
|
|
271
|
-
children: [
|
|
272
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.Select.Trigger, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.Select.Value, {}) }),
|
|
273
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_select.Select.Content, { children: [
|
|
274
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.Select.Item, { value: "default", children: intl.formatMessage(messages.style_default) }),
|
|
275
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.Select.Item, { value: "flat", children: intl.formatMessage(messages.style_flat) }),
|
|
276
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.Select.Item, { value: "compact", children: intl.formatMessage(messages.style_compact) })
|
|
277
|
-
] })
|
|
278
|
-
]
|
|
279
|
-
}
|
|
280
|
-
)
|
|
281
|
-
] })
|
|
282
|
-
] }) }),
|
|
283
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.Dialog.Footer, { children: [
|
|
284
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "ghost", onClick: handleCancel, children: intl.formatMessage(messages.cancel) }),
|
|
285
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { onClick: handleSave, children: intl.formatMessage(messages.save) })
|
|
286
|
-
] })
|
|
287
|
-
] }) })
|
|
288
|
-
] });
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
// src/extensions/toc/toc-view.tsx
|
|
292
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
293
|
-
function generateHeadingNumbers(headings, minLevel) {
|
|
294
|
-
const counters = [0, 0, 0, 0, 0, 0];
|
|
295
|
-
return headings.map((heading) => {
|
|
296
|
-
const levelIndex = heading.level - 1;
|
|
297
|
-
counters[levelIndex]++;
|
|
298
|
-
for (let i = levelIndex + 1; i < 6; i++) {
|
|
299
|
-
counters[i] = 0;
|
|
300
|
-
}
|
|
301
|
-
const numberParts = [];
|
|
302
|
-
for (let i = minLevel - 1; i <= levelIndex; i++) {
|
|
303
|
-
if (counters[i] > 0) {
|
|
304
|
-
numberParts.push(counters[i]);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
return {
|
|
308
|
-
...heading,
|
|
309
|
-
number: numberParts.join(".")
|
|
310
|
-
};
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
function TocNodeView({ editor, node, getPos }) {
|
|
314
|
-
const [headings, setHeadings] = (0, import_react3.useState)([]);
|
|
315
|
-
const intl = (0, import_react_intl3.useIntl)();
|
|
316
|
-
const attrs = node.attrs;
|
|
317
|
-
const {
|
|
318
|
-
minLevel = 1,
|
|
319
|
-
maxLevel = 6,
|
|
320
|
-
numbered = false,
|
|
321
|
-
style = "default"
|
|
322
|
-
} = attrs;
|
|
323
|
-
const styles = (0, import_react3.useMemo)(() => (0, import_theme.toc)({ style }), [style]);
|
|
324
|
-
const updateHeadings = (0, import_react3.useCallback)(() => {
|
|
325
|
-
const items = [];
|
|
326
|
-
const { doc } = editor.state;
|
|
327
|
-
doc.descendants((docNode, pos) => {
|
|
328
|
-
if (docNode.type.name === "heading") {
|
|
329
|
-
const level = docNode.attrs.level;
|
|
330
|
-
if (level >= minLevel && level <= maxLevel) {
|
|
331
|
-
const id = docNode.attrs.id || `heading-${pos}`;
|
|
332
|
-
items.push({
|
|
333
|
-
id,
|
|
334
|
-
level,
|
|
335
|
-
text: docNode.textContent,
|
|
336
|
-
pos
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
});
|
|
341
|
-
const numberedHeadings = generateHeadingNumbers(items, minLevel);
|
|
342
|
-
setHeadings(numberedHeadings);
|
|
343
|
-
}, [editor, minLevel, maxLevel]);
|
|
344
|
-
(0, import_react3.useEffect)(() => {
|
|
345
|
-
updateHeadings();
|
|
346
|
-
editor.on("update", updateHeadings);
|
|
347
|
-
return () => {
|
|
348
|
-
editor.off("update", updateHeadings);
|
|
349
|
-
};
|
|
350
|
-
}, [editor, updateHeadings]);
|
|
351
|
-
const handleClick = (0, import_react3.useCallback)(
|
|
352
|
-
(pos, id) => {
|
|
353
|
-
var _a;
|
|
354
|
-
editor.chain().focus().setTextSelection(pos).run();
|
|
355
|
-
let element = document.querySelector(`[data-id="${id}"]`);
|
|
356
|
-
if (!element) {
|
|
357
|
-
const { view } = editor;
|
|
358
|
-
const coords = view.coordsAtPos(pos);
|
|
359
|
-
const domNode = document.elementFromPoint(coords.left, coords.top);
|
|
360
|
-
element = (_a = domNode == null ? void 0 : domNode.closest("h1, h2, h3, h4, h5, h6")) != null ? _a : null;
|
|
361
|
-
}
|
|
362
|
-
if (element) {
|
|
363
|
-
element.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
364
|
-
}
|
|
365
|
-
},
|
|
366
|
-
[editor]
|
|
367
|
-
);
|
|
368
|
-
const isEmpty = headings.length === 0;
|
|
369
|
-
const getIndent = (level) => {
|
|
370
|
-
return (level - minLevel) * 16;
|
|
371
|
-
};
|
|
372
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react2.NodeViewWrapper, { className: styles.root(), "data-type": "toc", children: [
|
|
373
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: styles.header(), children: [
|
|
374
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: styles.headerContent(), children: [
|
|
375
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons2.ListIcon, { className: styles.headerIcon() }),
|
|
376
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: styles.headerTitle(), children: intl.formatMessage(messages.title) })
|
|
377
|
-
] }),
|
|
378
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: styles.headerActions(), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
379
|
-
TocSettings,
|
|
380
|
-
{
|
|
381
|
-
editor,
|
|
382
|
-
attrs,
|
|
383
|
-
getPos
|
|
384
|
-
}
|
|
385
|
-
) })
|
|
386
|
-
] }),
|
|
387
|
-
isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: styles.emptyState(), children: intl.formatMessage(messages.empty_state) }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("nav", { className: styles.nav(), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { className: styles.list(), children: headings.map((heading) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
388
|
-
"li",
|
|
389
|
-
{
|
|
390
|
-
className: styles.item(),
|
|
391
|
-
style: {
|
|
392
|
-
paddingLeft: `${getIndent(heading.level)}px`
|
|
393
|
-
},
|
|
394
|
-
children: [
|
|
395
|
-
numbered && heading.number && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: styles.itemNumber(), children: heading.number }),
|
|
396
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
397
|
-
"button",
|
|
398
|
-
{
|
|
399
|
-
type: "button",
|
|
400
|
-
onClick: () => handleClick(heading.pos, heading.id),
|
|
401
|
-
className: styles.itemButton(),
|
|
402
|
-
children: heading.text || intl.formatMessage(messages.empty_heading)
|
|
403
|
-
}
|
|
404
|
-
)
|
|
405
|
-
]
|
|
406
|
-
},
|
|
407
|
-
heading.id
|
|
408
|
-
)) }) })
|
|
409
|
-
] });
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
// src/extensions/toc/index.ts
|
|
413
|
-
var TocNode = import_core.Node.create({
|
|
414
|
-
name: "tableOfContentsNode",
|
|
415
|
-
group: "block",
|
|
416
|
-
atom: true,
|
|
417
|
-
draggable: true,
|
|
418
|
-
addOptions() {
|
|
419
|
-
return {
|
|
420
|
-
HTMLAttributes: {}
|
|
421
|
-
};
|
|
422
|
-
},
|
|
423
|
-
addAttributes() {
|
|
424
|
-
return {
|
|
425
|
-
minLevel: {
|
|
426
|
-
default: 1,
|
|
427
|
-
parseHTML: (element) => Number.parseInt(element.getAttribute("data-min-level") || "1", 10),
|
|
428
|
-
renderHTML: (attributes) => ({
|
|
429
|
-
"data-min-level": attributes.minLevel
|
|
430
|
-
})
|
|
431
|
-
},
|
|
432
|
-
maxLevel: {
|
|
433
|
-
default: 6,
|
|
434
|
-
parseHTML: (element) => Number.parseInt(element.getAttribute("data-max-level") || "6", 10),
|
|
435
|
-
renderHTML: (attributes) => ({
|
|
436
|
-
"data-max-level": attributes.maxLevel
|
|
437
|
-
})
|
|
438
|
-
},
|
|
439
|
-
numbered: {
|
|
440
|
-
default: false,
|
|
441
|
-
parseHTML: (element) => element.getAttribute("data-numbered") === "true",
|
|
442
|
-
renderHTML: (attributes) => ({
|
|
443
|
-
"data-numbered": attributes.numbered ? "true" : "false"
|
|
444
|
-
})
|
|
445
|
-
},
|
|
446
|
-
style: {
|
|
447
|
-
default: "default",
|
|
448
|
-
parseHTML: (element) => element.getAttribute("data-style") || "default",
|
|
449
|
-
renderHTML: (attributes) => ({
|
|
450
|
-
"data-style": attributes.style
|
|
451
|
-
})
|
|
452
|
-
}
|
|
453
|
-
};
|
|
454
|
-
},
|
|
455
|
-
parseHTML() {
|
|
456
|
-
return [
|
|
457
|
-
{
|
|
458
|
-
tag: 'div[data-type="toc"]'
|
|
459
|
-
}
|
|
460
|
-
];
|
|
461
|
-
},
|
|
462
|
-
renderHTML({ HTMLAttributes }) {
|
|
463
|
-
return [
|
|
464
|
-
"div",
|
|
465
|
-
(0, import_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes, {
|
|
466
|
-
"data-type": "toc"
|
|
467
|
-
})
|
|
468
|
-
];
|
|
469
|
-
},
|
|
470
|
-
addNodeView() {
|
|
471
|
-
return (0, import_react4.ReactNodeViewRenderer)(TocNodeView);
|
|
472
|
-
},
|
|
473
|
-
addCommands() {
|
|
474
|
-
return {
|
|
475
|
-
insertTableOfContents: () => ({ commands }) => {
|
|
476
|
-
return commands.insertContent({
|
|
477
|
-
type: this.name
|
|
478
|
-
});
|
|
479
|
-
},
|
|
480
|
-
updateTocSettings: (attrs) => ({ tr, state, dispatch }) => {
|
|
481
|
-
const { selection } = state;
|
|
482
|
-
const node = state.doc.nodeAt(selection.from);
|
|
483
|
-
if ((node == null ? void 0 : node.type.name) !== this.name) {
|
|
484
|
-
return false;
|
|
485
|
-
}
|
|
486
|
-
if (dispatch) {
|
|
487
|
-
tr.setNodeMarkup(selection.from, void 0, {
|
|
488
|
-
...node.attrs,
|
|
489
|
-
...attrs
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
return true;
|
|
493
|
-
}
|
|
494
|
-
};
|
|
495
|
-
}
|
|
496
|
-
});
|
|
497
|
-
var toc_default = TocNode;
|
|
498
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
499
|
-
0 && (module.exports = {
|
|
500
|
-
TocNode
|
|
501
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
import {
|
|
4
|
-
TocNode,
|
|
5
|
-
toc_default
|
|
6
|
-
} from "../../chunk-IFXRPGIJ.mjs";
|
|
7
|
-
import "../../chunk-2V6VOAPI.mjs";
|
|
8
|
-
import "../../chunk-4CDZ547I.mjs";
|
|
9
|
-
import "../../chunk-TAM3VMJT.mjs";
|
|
10
|
-
export {
|
|
11
|
-
TocNode,
|
|
12
|
-
toc_default as default
|
|
13
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
declare const messages: {
|
|
2
|
-
title: {
|
|
3
|
-
id: string;
|
|
4
|
-
defaultMessage: string;
|
|
5
|
-
description: string;
|
|
6
|
-
};
|
|
7
|
-
save: {
|
|
8
|
-
id: string;
|
|
9
|
-
defaultMessage: string;
|
|
10
|
-
description: string;
|
|
11
|
-
};
|
|
12
|
-
cancel: {
|
|
13
|
-
id: string;
|
|
14
|
-
defaultMessage: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
empty_state: {
|
|
18
|
-
id: string;
|
|
19
|
-
defaultMessage: string;
|
|
20
|
-
description: string;
|
|
21
|
-
};
|
|
22
|
-
empty_heading: {
|
|
23
|
-
id: string;
|
|
24
|
-
defaultMessage: string;
|
|
25
|
-
description: string;
|
|
26
|
-
};
|
|
27
|
-
settings: {
|
|
28
|
-
id: string;
|
|
29
|
-
defaultMessage: string;
|
|
30
|
-
description: string;
|
|
31
|
-
};
|
|
32
|
-
min_level: {
|
|
33
|
-
id: string;
|
|
34
|
-
defaultMessage: string;
|
|
35
|
-
description: string;
|
|
36
|
-
};
|
|
37
|
-
max_level: {
|
|
38
|
-
id: string;
|
|
39
|
-
defaultMessage: string;
|
|
40
|
-
description: string;
|
|
41
|
-
};
|
|
42
|
-
numbered: {
|
|
43
|
-
id: string;
|
|
44
|
-
defaultMessage: string;
|
|
45
|
-
description: string;
|
|
46
|
-
};
|
|
47
|
-
numbered_hint: {
|
|
48
|
-
id: string;
|
|
49
|
-
defaultMessage: string;
|
|
50
|
-
description: string;
|
|
51
|
-
};
|
|
52
|
-
style: {
|
|
53
|
-
id: string;
|
|
54
|
-
defaultMessage: string;
|
|
55
|
-
description: string;
|
|
56
|
-
};
|
|
57
|
-
style_default: {
|
|
58
|
-
id: string;
|
|
59
|
-
defaultMessage: string;
|
|
60
|
-
description: string;
|
|
61
|
-
};
|
|
62
|
-
style_flat: {
|
|
63
|
-
id: string;
|
|
64
|
-
defaultMessage: string;
|
|
65
|
-
description: string;
|
|
66
|
-
};
|
|
67
|
-
style_compact: {
|
|
68
|
-
id: string;
|
|
69
|
-
defaultMessage: string;
|
|
70
|
-
description: string;
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export { messages };
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
declare const messages: {
|
|
2
|
-
title: {
|
|
3
|
-
id: string;
|
|
4
|
-
defaultMessage: string;
|
|
5
|
-
description: string;
|
|
6
|
-
};
|
|
7
|
-
save: {
|
|
8
|
-
id: string;
|
|
9
|
-
defaultMessage: string;
|
|
10
|
-
description: string;
|
|
11
|
-
};
|
|
12
|
-
cancel: {
|
|
13
|
-
id: string;
|
|
14
|
-
defaultMessage: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
empty_state: {
|
|
18
|
-
id: string;
|
|
19
|
-
defaultMessage: string;
|
|
20
|
-
description: string;
|
|
21
|
-
};
|
|
22
|
-
empty_heading: {
|
|
23
|
-
id: string;
|
|
24
|
-
defaultMessage: string;
|
|
25
|
-
description: string;
|
|
26
|
-
};
|
|
27
|
-
settings: {
|
|
28
|
-
id: string;
|
|
29
|
-
defaultMessage: string;
|
|
30
|
-
description: string;
|
|
31
|
-
};
|
|
32
|
-
min_level: {
|
|
33
|
-
id: string;
|
|
34
|
-
defaultMessage: string;
|
|
35
|
-
description: string;
|
|
36
|
-
};
|
|
37
|
-
max_level: {
|
|
38
|
-
id: string;
|
|
39
|
-
defaultMessage: string;
|
|
40
|
-
description: string;
|
|
41
|
-
};
|
|
42
|
-
numbered: {
|
|
43
|
-
id: string;
|
|
44
|
-
defaultMessage: string;
|
|
45
|
-
description: string;
|
|
46
|
-
};
|
|
47
|
-
numbered_hint: {
|
|
48
|
-
id: string;
|
|
49
|
-
defaultMessage: string;
|
|
50
|
-
description: string;
|
|
51
|
-
};
|
|
52
|
-
style: {
|
|
53
|
-
id: string;
|
|
54
|
-
defaultMessage: string;
|
|
55
|
-
description: string;
|
|
56
|
-
};
|
|
57
|
-
style_default: {
|
|
58
|
-
id: string;
|
|
59
|
-
defaultMessage: string;
|
|
60
|
-
description: string;
|
|
61
|
-
};
|
|
62
|
-
style_flat: {
|
|
63
|
-
id: string;
|
|
64
|
-
defaultMessage: string;
|
|
65
|
-
description: string;
|
|
66
|
-
};
|
|
67
|
-
style_compact: {
|
|
68
|
-
id: string;
|
|
69
|
-
defaultMessage: string;
|
|
70
|
-
description: string;
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export { messages };
|