@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-GYIYX2JH.mjs
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useTextAlign
|
|
4
|
-
} from "./chunk-IQERE7KP.mjs";
|
|
5
|
-
import {
|
|
6
|
-
useTiptapEditor
|
|
7
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
8
|
-
|
|
9
|
-
// src/ui/text-align-button/text-align-button.tsx
|
|
10
|
-
import { IconButton } from "@kopexa/button";
|
|
11
|
-
import { useCallback } from "react";
|
|
12
|
-
import { jsx } from "react/jsx-runtime";
|
|
13
|
-
var TextAlignButton = ({
|
|
14
|
-
editor: providedEditor,
|
|
15
|
-
align,
|
|
16
|
-
text,
|
|
17
|
-
hideWhenUnavailable = false,
|
|
18
|
-
onAligned,
|
|
19
|
-
showShortcut = false,
|
|
20
|
-
onClick,
|
|
21
|
-
children,
|
|
22
|
-
...buttonProps
|
|
23
|
-
}) => {
|
|
24
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
25
|
-
const {
|
|
26
|
-
isVisible,
|
|
27
|
-
handleTextAlign,
|
|
28
|
-
label,
|
|
29
|
-
canAlign,
|
|
30
|
-
isActive,
|
|
31
|
-
Icon,
|
|
32
|
-
shortcutKeys
|
|
33
|
-
} = useTextAlign({
|
|
34
|
-
editor,
|
|
35
|
-
align,
|
|
36
|
-
hideWhenUnavailable,
|
|
37
|
-
onAligned
|
|
38
|
-
});
|
|
39
|
-
const handleClick = useCallback(
|
|
40
|
-
(e) => {
|
|
41
|
-
onClick == null ? void 0 : onClick(e);
|
|
42
|
-
if (e.defaultPrevented) return;
|
|
43
|
-
handleTextAlign();
|
|
44
|
-
},
|
|
45
|
-
[handleTextAlign, onClick]
|
|
46
|
-
);
|
|
47
|
-
if (!isVisible) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
return /* @__PURE__ */ jsx(
|
|
51
|
-
IconButton,
|
|
52
|
-
{
|
|
53
|
-
type: "button",
|
|
54
|
-
disabled: canAlign,
|
|
55
|
-
variant: "ghost",
|
|
56
|
-
color: "default",
|
|
57
|
-
"data-active-state": isActive ? "on" : "off",
|
|
58
|
-
"data-disabled": canAlign,
|
|
59
|
-
tabIndex: -1,
|
|
60
|
-
"aria-label": label,
|
|
61
|
-
"aria-pressed": isActive,
|
|
62
|
-
tooltip: label,
|
|
63
|
-
shortcutKeys,
|
|
64
|
-
onClick: handleClick,
|
|
65
|
-
...buttonProps,
|
|
66
|
-
children: /* @__PURE__ */ jsx(Icon, {})
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export {
|
|
72
|
-
TextAlignButton
|
|
73
|
-
};
|
package/dist/chunk-H6LC4LDQ.mjs
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/extensions/trailing-node/index.ts
|
|
4
|
-
import { Plugin, PluginKey } from "@tiptap/pm/state";
|
|
5
|
-
import { Extension } from "@tiptap/react";
|
|
6
|
-
function nodeEqualsType({
|
|
7
|
-
types,
|
|
8
|
-
node
|
|
9
|
-
}) {
|
|
10
|
-
if (!node) return false;
|
|
11
|
-
if (Array.isArray(types)) {
|
|
12
|
-
return types.includes(node.type);
|
|
13
|
-
}
|
|
14
|
-
return node.type === types;
|
|
15
|
-
}
|
|
16
|
-
var TrailingNode = Extension.create({
|
|
17
|
-
name: "trailingNode",
|
|
18
|
-
addOptions() {
|
|
19
|
-
return {
|
|
20
|
-
node: "paragraph",
|
|
21
|
-
notAfter: ["paragraph"]
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
addProseMirrorPlugins() {
|
|
25
|
-
const plugin = new PluginKey(this.name);
|
|
26
|
-
const disabledNodes = Object.entries(this.editor.schema.nodes).map(([, value]) => value).filter((node) => this.options.notAfter.includes(node.name));
|
|
27
|
-
return [
|
|
28
|
-
new Plugin({
|
|
29
|
-
key: plugin,
|
|
30
|
-
appendTransaction: (_, __, state) => {
|
|
31
|
-
const { doc, tr, schema } = state;
|
|
32
|
-
const shouldInsertNodeAtEnd = plugin.getState(state);
|
|
33
|
-
const endPosition = doc.content.size;
|
|
34
|
-
const type = schema.nodes[this.options.node];
|
|
35
|
-
if (!shouldInsertNodeAtEnd) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
if (type) {
|
|
39
|
-
return tr.insert(endPosition, type.create());
|
|
40
|
-
}
|
|
41
|
-
return null;
|
|
42
|
-
},
|
|
43
|
-
state: {
|
|
44
|
-
init: (_, state) => {
|
|
45
|
-
const lastNode = state.tr.doc.lastChild;
|
|
46
|
-
return !nodeEqualsType({ node: lastNode, types: disabledNodes });
|
|
47
|
-
},
|
|
48
|
-
apply: (tr, value) => {
|
|
49
|
-
if (!tr.docChanged) {
|
|
50
|
-
return value;
|
|
51
|
-
}
|
|
52
|
-
const lastNode = tr.doc.lastChild;
|
|
53
|
-
return !nodeEqualsType({ node: lastNode, types: disabledNodes });
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
export {
|
|
62
|
-
TrailingNode
|
|
63
|
-
};
|
package/dist/chunk-H7MS2UMO.mjs
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
SuggestionMenu
|
|
4
|
-
} from "./chunk-L5RDMV3H.mjs";
|
|
5
|
-
|
|
6
|
-
// src/extensions/variable/variable-suggestion.tsx
|
|
7
|
-
import { getElementOverflowPosition } from "@kopexa/editor-utils";
|
|
8
|
-
import { slashDropdownMenu } from "@kopexa/theme";
|
|
9
|
-
import { PluginKey } from "@tiptap/pm/state";
|
|
10
|
-
import * as React from "react";
|
|
11
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
var VariableSuggestionPluginKey = new PluginKey("variableSuggestion");
|
|
13
|
-
function VariableSuggestion({
|
|
14
|
-
editor,
|
|
15
|
-
variables
|
|
16
|
-
}) {
|
|
17
|
-
const getItems = React.useCallback(
|
|
18
|
-
({ query }) => {
|
|
19
|
-
const normalizedQuery = query.toLowerCase().trim();
|
|
20
|
-
const items = [];
|
|
21
|
-
const matchingVariables = variables.filter((variable) => {
|
|
22
|
-
var _a, _b;
|
|
23
|
-
if (!normalizedQuery) return true;
|
|
24
|
-
return variable.name.toLowerCase().includes(normalizedQuery) || variable.label.toLowerCase().includes(normalizedQuery) || ((_a = variable.category) == null ? void 0 : _a.toLowerCase().includes(normalizedQuery)) || ((_b = variable.description) == null ? void 0 : _b.toLowerCase().includes(normalizedQuery));
|
|
25
|
-
});
|
|
26
|
-
for (const variable of matchingVariables) {
|
|
27
|
-
items.push({
|
|
28
|
-
title: variable.label,
|
|
29
|
-
subtext: variable.name,
|
|
30
|
-
group: variable.category,
|
|
31
|
-
keywords: [variable.name, variable.label, variable.category].filter(
|
|
32
|
-
Boolean
|
|
33
|
-
),
|
|
34
|
-
onSelect: ({ editor: editor2 }) => {
|
|
35
|
-
const attrs = {
|
|
36
|
-
name: variable.name,
|
|
37
|
-
fallback: variable.fallback,
|
|
38
|
-
category: variable.category
|
|
39
|
-
};
|
|
40
|
-
editor2.chain().focus().insertVariable(attrs).run();
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
if (normalizedQuery && !variables.some((v) => v.name.toLowerCase() === normalizedQuery)) {
|
|
45
|
-
items.push({
|
|
46
|
-
title: `Neue Variable "${query}"`,
|
|
47
|
-
subtext: query,
|
|
48
|
-
group: "Neu",
|
|
49
|
-
onSelect: ({ editor: editor2 }) => {
|
|
50
|
-
const attrs = {
|
|
51
|
-
name: query
|
|
52
|
-
};
|
|
53
|
-
editor2.chain().focus().insertVariable(attrs).run();
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
return items;
|
|
58
|
-
},
|
|
59
|
-
[variables]
|
|
60
|
-
);
|
|
61
|
-
return /* @__PURE__ */ jsx(
|
|
62
|
-
SuggestionMenu,
|
|
63
|
-
{
|
|
64
|
-
editor,
|
|
65
|
-
pluginKey: VariableSuggestionPluginKey,
|
|
66
|
-
char: "{{",
|
|
67
|
-
items: getItems,
|
|
68
|
-
allowSpaces: false,
|
|
69
|
-
selector: "tiptap-variable-suggestion-menu",
|
|
70
|
-
children: (props) => /* @__PURE__ */ jsx(VariableList, { ...props })
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
var VariableItem = ({
|
|
75
|
-
item,
|
|
76
|
-
isSelected,
|
|
77
|
-
onSelect
|
|
78
|
-
}) => {
|
|
79
|
-
const itemRef = React.useRef(null);
|
|
80
|
-
React.useEffect(() => {
|
|
81
|
-
const selector = document.querySelector(
|
|
82
|
-
'[data-selector="tiptap-variable-suggestion-menu"]'
|
|
83
|
-
);
|
|
84
|
-
if (!itemRef.current || !isSelected || !selector) return;
|
|
85
|
-
const overflow = getElementOverflowPosition(itemRef.current, selector);
|
|
86
|
-
if (overflow === "top") {
|
|
87
|
-
itemRef.current.scrollIntoView(true);
|
|
88
|
-
} else if (overflow === "bottom") {
|
|
89
|
-
itemRef.current.scrollIntoView(false);
|
|
90
|
-
}
|
|
91
|
-
}, [isSelected]);
|
|
92
|
-
return /* @__PURE__ */ jsxs(
|
|
93
|
-
"button",
|
|
94
|
-
{
|
|
95
|
-
ref: itemRef,
|
|
96
|
-
type: "button",
|
|
97
|
-
"data-active-state": isSelected ? "on" : "off",
|
|
98
|
-
onClick: onSelect,
|
|
99
|
-
className: "w-full flex items-center justify-between gap-3 px-2 py-1.5 text-sm rounded-sm outline-none hover:bg-muted data-[active-state=on]:bg-muted",
|
|
100
|
-
children: [
|
|
101
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium truncate", children: item.title }),
|
|
102
|
-
/* @__PURE__ */ jsx("code", { className: "text-xs text-muted-foreground font-mono shrink-0", children: item.subtext })
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
|
-
);
|
|
106
|
-
};
|
|
107
|
-
var VariableList = ({
|
|
108
|
-
items,
|
|
109
|
-
selectedIndex,
|
|
110
|
-
onSelect
|
|
111
|
-
}) => {
|
|
112
|
-
const styles = slashDropdownMenu();
|
|
113
|
-
const renderedItems = React.useMemo(() => {
|
|
114
|
-
const rendered = [];
|
|
115
|
-
const groups = {};
|
|
116
|
-
items.forEach((item, index) => {
|
|
117
|
-
const groupLabel = item.group || "";
|
|
118
|
-
if (!groups[groupLabel]) {
|
|
119
|
-
groups[groupLabel] = { items: [], indices: [] };
|
|
120
|
-
}
|
|
121
|
-
groups[groupLabel].items.push(item);
|
|
122
|
-
groups[groupLabel].indices.push(index);
|
|
123
|
-
});
|
|
124
|
-
Object.entries(groups).forEach(([groupLabel, groupData], groupIndex) => {
|
|
125
|
-
const groupItems = groupData.items.map((item, itemIndex) => {
|
|
126
|
-
const originalIndex = groupData.indices[itemIndex];
|
|
127
|
-
return /* @__PURE__ */ jsx(
|
|
128
|
-
VariableItem,
|
|
129
|
-
{
|
|
130
|
-
item,
|
|
131
|
-
isSelected: originalIndex === selectedIndex,
|
|
132
|
-
onSelect: () => onSelect(item)
|
|
133
|
-
},
|
|
134
|
-
`item-${originalIndex}-${item.title}`
|
|
135
|
-
);
|
|
136
|
-
});
|
|
137
|
-
if (groupLabel) {
|
|
138
|
-
rendered.push(
|
|
139
|
-
/* @__PURE__ */ jsxs("div", { className: "py-1", children: [
|
|
140
|
-
/* @__PURE__ */ jsx("div", { className: "px-2 py-1 text-xs font-semibold text-muted-foreground uppercase tracking-wide", children: groupLabel }),
|
|
141
|
-
groupItems
|
|
142
|
-
] }, `group-${groupIndex}-${groupLabel}`)
|
|
143
|
-
);
|
|
144
|
-
} else {
|
|
145
|
-
rendered.push(...groupItems);
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
return rendered;
|
|
149
|
-
}, [items, selectedIndex, onSelect]);
|
|
150
|
-
if (!renderedItems.length) {
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
return /* @__PURE__ */ jsx(
|
|
154
|
-
"div",
|
|
155
|
-
{
|
|
156
|
-
className: styles.card(),
|
|
157
|
-
style: {
|
|
158
|
-
maxHeight: "var(--suggestion-menu-max-height)",
|
|
159
|
-
minWidth: "240px"
|
|
160
|
-
},
|
|
161
|
-
children: /* @__PURE__ */ jsx("div", { className: styles.body(), children: renderedItems })
|
|
162
|
-
}
|
|
163
|
-
);
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
export {
|
|
167
|
-
VariableSuggestion
|
|
168
|
-
};
|
package/dist/chunk-HLLA2HRV.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";
|
package/dist/chunk-HTJ2RXOG.mjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
ImageNodeView
|
|
4
|
-
} from "./chunk-KYLBKQ2E.mjs";
|
|
5
|
-
|
|
6
|
-
// src/extensions/image/index.ts
|
|
7
|
-
import { Image as TiptapImage } from "@tiptap/extension-image";
|
|
8
|
-
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
9
|
-
var ImageNode = TiptapImage.extend({
|
|
10
|
-
addAttributes() {
|
|
11
|
-
var _a;
|
|
12
|
-
return {
|
|
13
|
-
...(_a = this.parent) == null ? void 0 : _a.call(this),
|
|
14
|
-
// Upload state for drag & drop / paste uploads
|
|
15
|
-
uploadState: {
|
|
16
|
-
default: null,
|
|
17
|
-
rendered: false
|
|
18
|
-
},
|
|
19
|
-
uploadProgress: {
|
|
20
|
-
default: null,
|
|
21
|
-
rendered: false
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
addNodeView() {
|
|
26
|
-
return ReactNodeViewRenderer(ImageNodeView);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
export {
|
|
31
|
-
ImageNode
|
|
32
|
-
};
|
package/dist/chunk-IFXRPGIJ.mjs
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
TocNodeView
|
|
4
|
-
} from "./chunk-2V6VOAPI.mjs";
|
|
5
|
-
|
|
6
|
-
// src/extensions/toc/index.ts
|
|
7
|
-
import { mergeAttributes, Node } from "@tiptap/core";
|
|
8
|
-
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
9
|
-
var TocNode = Node.create({
|
|
10
|
-
name: "tableOfContentsNode",
|
|
11
|
-
group: "block",
|
|
12
|
-
atom: true,
|
|
13
|
-
draggable: true,
|
|
14
|
-
addOptions() {
|
|
15
|
-
return {
|
|
16
|
-
HTMLAttributes: {}
|
|
17
|
-
};
|
|
18
|
-
},
|
|
19
|
-
addAttributes() {
|
|
20
|
-
return {
|
|
21
|
-
minLevel: {
|
|
22
|
-
default: 1,
|
|
23
|
-
parseHTML: (element) => Number.parseInt(element.getAttribute("data-min-level") || "1", 10),
|
|
24
|
-
renderHTML: (attributes) => ({
|
|
25
|
-
"data-min-level": attributes.minLevel
|
|
26
|
-
})
|
|
27
|
-
},
|
|
28
|
-
maxLevel: {
|
|
29
|
-
default: 6,
|
|
30
|
-
parseHTML: (element) => Number.parseInt(element.getAttribute("data-max-level") || "6", 10),
|
|
31
|
-
renderHTML: (attributes) => ({
|
|
32
|
-
"data-max-level": attributes.maxLevel
|
|
33
|
-
})
|
|
34
|
-
},
|
|
35
|
-
numbered: {
|
|
36
|
-
default: false,
|
|
37
|
-
parseHTML: (element) => element.getAttribute("data-numbered") === "true",
|
|
38
|
-
renderHTML: (attributes) => ({
|
|
39
|
-
"data-numbered": attributes.numbered ? "true" : "false"
|
|
40
|
-
})
|
|
41
|
-
},
|
|
42
|
-
style: {
|
|
43
|
-
default: "default",
|
|
44
|
-
parseHTML: (element) => element.getAttribute("data-style") || "default",
|
|
45
|
-
renderHTML: (attributes) => ({
|
|
46
|
-
"data-style": attributes.style
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
parseHTML() {
|
|
52
|
-
return [
|
|
53
|
-
{
|
|
54
|
-
tag: 'div[data-type="toc"]'
|
|
55
|
-
}
|
|
56
|
-
];
|
|
57
|
-
},
|
|
58
|
-
renderHTML({ HTMLAttributes }) {
|
|
59
|
-
return [
|
|
60
|
-
"div",
|
|
61
|
-
mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
|
|
62
|
-
"data-type": "toc"
|
|
63
|
-
})
|
|
64
|
-
];
|
|
65
|
-
},
|
|
66
|
-
addNodeView() {
|
|
67
|
-
return ReactNodeViewRenderer(TocNodeView);
|
|
68
|
-
},
|
|
69
|
-
addCommands() {
|
|
70
|
-
return {
|
|
71
|
-
insertTableOfContents: () => ({ commands }) => {
|
|
72
|
-
return commands.insertContent({
|
|
73
|
-
type: this.name
|
|
74
|
-
});
|
|
75
|
-
},
|
|
76
|
-
updateTocSettings: (attrs) => ({ tr, state, dispatch }) => {
|
|
77
|
-
const { selection } = state;
|
|
78
|
-
const node = state.doc.nodeAt(selection.from);
|
|
79
|
-
if ((node == null ? void 0 : node.type.name) !== this.name) {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
if (dispatch) {
|
|
83
|
-
tr.setNodeMarkup(selection.from, void 0, {
|
|
84
|
-
...node.attrs,
|
|
85
|
-
...attrs
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
var toc_default = TocNode;
|
|
94
|
-
|
|
95
|
-
export {
|
|
96
|
-
TocNode,
|
|
97
|
-
toc_default
|
|
98
|
-
};
|
package/dist/chunk-IOB3REX6.mjs
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useTiptapEditor
|
|
4
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
5
|
-
|
|
6
|
-
// src/ui/list-button/index.tsx
|
|
7
|
-
import { Button } from "@kopexa/button";
|
|
8
|
-
import { isNodeInSchema } from "@kopexa/editor-utils";
|
|
9
|
-
import { ListIcon, ListOrderedIcon, ListTodoIcon } from "@kopexa/icons";
|
|
10
|
-
import { isNodeSelection } from "@tiptap/react";
|
|
11
|
-
import { useCallback, useMemo } from "react";
|
|
12
|
-
import { jsx } from "react/jsx-runtime";
|
|
13
|
-
var listOptions = [
|
|
14
|
-
{
|
|
15
|
-
label: "Bullet List",
|
|
16
|
-
type: "bulletList",
|
|
17
|
-
icon: ListIcon
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
label: "Ordered List",
|
|
21
|
-
type: "orderedList",
|
|
22
|
-
icon: ListOrderedIcon
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
label: "Task List",
|
|
26
|
-
type: "taskList",
|
|
27
|
-
icon: ListTodoIcon
|
|
28
|
-
}
|
|
29
|
-
];
|
|
30
|
-
var listShortcutKeys = {
|
|
31
|
-
bulletList: "Ctrl-Shift-8",
|
|
32
|
-
orderedList: "Ctrl-Shift-7",
|
|
33
|
-
taskList: "Ctrl-Shift-9"
|
|
34
|
-
};
|
|
35
|
-
function canToggleList(editor, type) {
|
|
36
|
-
if (!editor) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
switch (type) {
|
|
40
|
-
case "bulletList":
|
|
41
|
-
return editor.can().toggleBulletList();
|
|
42
|
-
case "orderedList":
|
|
43
|
-
return editor.can().toggleOrderedList();
|
|
44
|
-
case "taskList":
|
|
45
|
-
return editor.can().toggleList("taskList", "taskItem");
|
|
46
|
-
default:
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function isListActive(editor, type) {
|
|
51
|
-
if (!editor) return false;
|
|
52
|
-
switch (type) {
|
|
53
|
-
case "bulletList":
|
|
54
|
-
return editor.isActive("bulletList");
|
|
55
|
-
case "orderedList":
|
|
56
|
-
return editor.isActive("orderedList");
|
|
57
|
-
case "taskList":
|
|
58
|
-
return editor.isActive("taskList");
|
|
59
|
-
default:
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
function toggleList(editor, type) {
|
|
64
|
-
if (!editor) return;
|
|
65
|
-
switch (type) {
|
|
66
|
-
case "bulletList":
|
|
67
|
-
editor.chain().focus().toggleBulletList().run();
|
|
68
|
-
break;
|
|
69
|
-
case "orderedList":
|
|
70
|
-
editor.chain().focus().toggleOrderedList().run();
|
|
71
|
-
break;
|
|
72
|
-
case "taskList":
|
|
73
|
-
editor.chain().focus().toggleList("taskList", "taskItem").run();
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function getListOption(type) {
|
|
78
|
-
return listOptions.find((option) => option.type === type);
|
|
79
|
-
}
|
|
80
|
-
function shouldShowListButton(params) {
|
|
81
|
-
const { editor, type, hideWhenUnavailable, listInSchema } = params;
|
|
82
|
-
if (!listInSchema || !editor) {
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
if (hideWhenUnavailable) {
|
|
86
|
-
if (isNodeSelection(editor.state.selection) || !canToggleList(editor, type)) {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return true;
|
|
91
|
-
}
|
|
92
|
-
function useListState(editor, type) {
|
|
93
|
-
const listInSchema = isNodeInSchema(type, editor);
|
|
94
|
-
const listOption = getListOption(type);
|
|
95
|
-
const isActive = isListActive(editor, type);
|
|
96
|
-
const shortcutKey = listShortcutKeys[type];
|
|
97
|
-
return {
|
|
98
|
-
listInSchema,
|
|
99
|
-
listOption,
|
|
100
|
-
isActive,
|
|
101
|
-
shortcutKey
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
var ListButton = ({
|
|
105
|
-
editor: providedEditor,
|
|
106
|
-
type,
|
|
107
|
-
hideWhenUnavailable = false,
|
|
108
|
-
className = "",
|
|
109
|
-
onClick,
|
|
110
|
-
text,
|
|
111
|
-
children,
|
|
112
|
-
ref,
|
|
113
|
-
...buttonProps
|
|
114
|
-
}) => {
|
|
115
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
116
|
-
const { listInSchema, listOption, isActive, shortcutKey } = useListState(
|
|
117
|
-
editor,
|
|
118
|
-
type
|
|
119
|
-
);
|
|
120
|
-
const Icon = (listOption == null ? void 0 : listOption.icon) || ListIcon;
|
|
121
|
-
const handleClick = useCallback(
|
|
122
|
-
(e) => {
|
|
123
|
-
onClick == null ? void 0 : onClick(e);
|
|
124
|
-
if (!e.defaultPrevented && editor) {
|
|
125
|
-
toggleList(editor, type);
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
[onClick, editor, type]
|
|
129
|
-
);
|
|
130
|
-
const show = useMemo(() => {
|
|
131
|
-
return shouldShowListButton({
|
|
132
|
-
editor,
|
|
133
|
-
type,
|
|
134
|
-
hideWhenUnavailable,
|
|
135
|
-
listInSchema
|
|
136
|
-
});
|
|
137
|
-
}, [editor, type, hideWhenUnavailable, listInSchema]);
|
|
138
|
-
if (!show || !editor || !editor.isEditable) {
|
|
139
|
-
return null;
|
|
140
|
-
}
|
|
141
|
-
return /* @__PURE__ */ jsx(
|
|
142
|
-
Button,
|
|
143
|
-
{
|
|
144
|
-
type: "button",
|
|
145
|
-
className: className.trim(),
|
|
146
|
-
variant: "ghost",
|
|
147
|
-
color: "default",
|
|
148
|
-
"data-active-state": isActive ? "on" : "off",
|
|
149
|
-
tabIndex: -1,
|
|
150
|
-
"aria-label": (listOption == null ? void 0 : listOption.label) || type,
|
|
151
|
-
"aria-pressed": isActive,
|
|
152
|
-
tooltip: (listOption == null ? void 0 : listOption.label) || type,
|
|
153
|
-
shortcutKeys: shortcutKey,
|
|
154
|
-
onClick: handleClick,
|
|
155
|
-
startContent: /* @__PURE__ */ jsx(Icon, {}),
|
|
156
|
-
...buttonProps,
|
|
157
|
-
ref,
|
|
158
|
-
children: children || text
|
|
159
|
-
}
|
|
160
|
-
);
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
export {
|
|
164
|
-
listOptions,
|
|
165
|
-
listShortcutKeys,
|
|
166
|
-
canToggleList,
|
|
167
|
-
isListActive,
|
|
168
|
-
toggleList,
|
|
169
|
-
getListOption,
|
|
170
|
-
shouldShowListButton,
|
|
171
|
-
useListState,
|
|
172
|
-
ListButton
|
|
173
|
-
};
|