@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kopexa/tiptap",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.7.2",
|
|
4
4
|
"description": "our tiptap components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tiptap"
|
|
@@ -28,62 +28,67 @@
|
|
|
28
28
|
"motion": ">=12.23.6",
|
|
29
29
|
"react": ">=19.0.0-rc.0",
|
|
30
30
|
"react-dom": ">=19.0.0-rc.0",
|
|
31
|
-
"@kopexa/theme": "17.22.
|
|
31
|
+
"@kopexa/theme": "17.22.9"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@floating-ui/dom": "^1.7.4",
|
|
35
|
-
"@floating-ui/react": "^0.27.
|
|
36
|
-
"@tiptap/core": "^3.
|
|
37
|
-
"@
|
|
38
|
-
"@tiptap/extension-
|
|
39
|
-
"@tiptap/extension-
|
|
40
|
-
"@tiptap/extension-
|
|
41
|
-
"@tiptap/extension-
|
|
42
|
-
"@tiptap/extension-
|
|
43
|
-
"@tiptap/extension-
|
|
44
|
-
"@tiptap/extension-
|
|
45
|
-
"@tiptap/extension-
|
|
46
|
-
"@tiptap/extension-
|
|
47
|
-
"@tiptap/extension-
|
|
48
|
-
"@tiptap/extension-
|
|
49
|
-
"@tiptap/extension-
|
|
50
|
-
"@tiptap/extension-
|
|
51
|
-
"@tiptap/extension-
|
|
52
|
-
"@tiptap/extension-
|
|
53
|
-
"@tiptap/extension-
|
|
54
|
-
"@tiptap/
|
|
55
|
-
"@tiptap/
|
|
56
|
-
"@tiptap/
|
|
57
|
-
"@tiptap/
|
|
58
|
-
"@tiptap/
|
|
35
|
+
"@floating-ui/react": "^0.27.18",
|
|
36
|
+
"@tiptap/core": "^3.20.0",
|
|
37
|
+
"@hocuspocus/provider": "^2.15.0",
|
|
38
|
+
"@tiptap/extension-collaboration": "^3.20.0",
|
|
39
|
+
"@tiptap/extension-collaboration-caret": "^3.20.0",
|
|
40
|
+
"@tiptap/extension-file-handler": "^3.20.0",
|
|
41
|
+
"@tiptap/extension-highlight": "^3.20.0",
|
|
42
|
+
"@tiptap/extension-image": "^3.20.0",
|
|
43
|
+
"@tiptap/extension-invisible-characters": "^3.20.0",
|
|
44
|
+
"@tiptap/extension-link": "^3.20.0",
|
|
45
|
+
"@tiptap/extension-list": "^3.20.0",
|
|
46
|
+
"@tiptap/extension-mathematics": "^3.20.0",
|
|
47
|
+
"@tiptap/extension-subscript": "^3.20.0",
|
|
48
|
+
"@tiptap/extension-superscript": "^3.20.0",
|
|
49
|
+
"@tiptap/extension-table-of-contents": "^3.20.0",
|
|
50
|
+
"@tiptap/extension-task-item": "^3.20.0",
|
|
51
|
+
"@tiptap/extension-task-list": "^3.20.0",
|
|
52
|
+
"@tiptap/extension-text-align": "^3.20.0",
|
|
53
|
+
"@tiptap/extension-text-style": "^3.20.0",
|
|
54
|
+
"@tiptap/extension-typography": "^3.20.0",
|
|
55
|
+
"@tiptap/extension-unique-id": "^3.20.0",
|
|
56
|
+
"@tiptap/extensions": "^3.20.0",
|
|
57
|
+
"@tiptap/pm": "^3.20.0",
|
|
58
|
+
"@tiptap/react": "^3.20.0",
|
|
59
|
+
"@tiptap/starter-kit": "^3.20.0",
|
|
60
|
+
"@tiptap/suggestion": "^3.20.0",
|
|
59
61
|
"dompurify": "^3.3.1",
|
|
60
|
-
"katex": "^0.16.
|
|
62
|
+
"katex": "^0.16.33",
|
|
61
63
|
"jsx-dom-cjs": "^8.1.6",
|
|
62
64
|
"markdown-it": "^14.1.0",
|
|
63
|
-
"react-hotkeys-hook": "^5.2.
|
|
65
|
+
"react-hotkeys-hook": "^5.2.4",
|
|
64
66
|
"react-intl": "^7.1.14",
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"@kopexa/callout": "17.0.
|
|
68
|
-
"@kopexa/
|
|
69
|
-
"@kopexa/
|
|
70
|
-
"@kopexa/
|
|
71
|
-
"@kopexa/
|
|
72
|
-
"@kopexa/extension-
|
|
73
|
-
"@kopexa/extension-
|
|
74
|
-
"@kopexa/
|
|
75
|
-
"@kopexa/
|
|
76
|
-
"@kopexa/
|
|
77
|
-
"@kopexa/
|
|
78
|
-
"@kopexa/
|
|
79
|
-
"@kopexa/
|
|
80
|
-
"@kopexa/
|
|
81
|
-
"@kopexa/
|
|
82
|
-
"@kopexa/
|
|
83
|
-
"@kopexa/shared-utils": "17.0.
|
|
84
|
-
"@kopexa/
|
|
85
|
-
"@kopexa/
|
|
86
|
-
"@kopexa/
|
|
67
|
+
"y-indexeddb": "^9.0.12",
|
|
68
|
+
"yjs": "^13.6.0",
|
|
69
|
+
"@kopexa/callout": "17.0.48",
|
|
70
|
+
"@kopexa/chip": "17.1.45",
|
|
71
|
+
"@kopexa/dialog": "17.2.13",
|
|
72
|
+
"@kopexa/dropdown-menu": "17.0.48",
|
|
73
|
+
"@kopexa/editor-utils": "17.0.48",
|
|
74
|
+
"@kopexa/extension-pages": "17.0.45",
|
|
75
|
+
"@kopexa/extension-code": "17.0.48",
|
|
76
|
+
"@kopexa/input": "17.0.48",
|
|
77
|
+
"@kopexa/extension-table": "17.1.0",
|
|
78
|
+
"@kopexa/extension-controlref": "17.1.30",
|
|
79
|
+
"@kopexa/icons": "17.7.13",
|
|
80
|
+
"@kopexa/button": "17.0.48",
|
|
81
|
+
"@kopexa/popover": "17.2.13",
|
|
82
|
+
"@kopexa/label": "17.0.48",
|
|
83
|
+
"@kopexa/select": "17.2.13",
|
|
84
|
+
"@kopexa/switch": "17.2.13",
|
|
85
|
+
"@kopexa/shared-utils": "17.0.48",
|
|
86
|
+
"@kopexa/react-utils": "17.0.48",
|
|
87
|
+
"@kopexa/tabs": "17.0.48",
|
|
88
|
+
"@kopexa/separator": "17.0.48",
|
|
89
|
+
"@kopexa/toolbar": "17.2.13",
|
|
90
|
+
"@kopexa/use-composed-ref": "17.0.48",
|
|
91
|
+
"@kopexa/use-is-mobile": "17.0.48"
|
|
87
92
|
},
|
|
88
93
|
"clean-package": "../../../clean-package.config.json",
|
|
89
94
|
"module": "dist/index.mjs",
|
|
@@ -97,8 +102,8 @@
|
|
|
97
102
|
"./package.json": "./package.json"
|
|
98
103
|
},
|
|
99
104
|
"scripts": {
|
|
100
|
-
"build": "tsup src --dts",
|
|
101
|
-
"build:fast": "tsup src",
|
|
105
|
+
"build": "NODE_OPTIONS='--max-old-space-size=8192' tsup src/index.ts --dts",
|
|
106
|
+
"build:fast": "tsup src/index.ts",
|
|
102
107
|
"dev": "pnpm build:fast --watch",
|
|
103
108
|
"clean": "rimraf dist .turbo",
|
|
104
109
|
"typecheck": "tsc --noEmit"
|
package/dist/chunk-2SI7MRAE.mjs
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useUndoRedo
|
|
4
|
-
} from "./chunk-ZVTJ6XD7.mjs";
|
|
5
|
-
import {
|
|
6
|
-
useTiptapEditor
|
|
7
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
8
|
-
|
|
9
|
-
// src/ui/undo-redo-button/undo-redo-button.tsx
|
|
10
|
-
import { ToolbarButton } from "@kopexa/toolbar";
|
|
11
|
-
import { useCallback } from "react";
|
|
12
|
-
import { jsx } from "react/jsx-runtime";
|
|
13
|
-
var UndoRedoButton = ({
|
|
14
|
-
editor: providedEditor,
|
|
15
|
-
action,
|
|
16
|
-
text,
|
|
17
|
-
hideWhenUnavailable = false,
|
|
18
|
-
onExecuted,
|
|
19
|
-
showShortcut = false,
|
|
20
|
-
onClick,
|
|
21
|
-
children,
|
|
22
|
-
...buttonProps
|
|
23
|
-
}) => {
|
|
24
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
25
|
-
const { isVisible, handleAction, label, canExecute, Icon, shortcutKeys } = useUndoRedo({
|
|
26
|
-
editor,
|
|
27
|
-
action,
|
|
28
|
-
hideWhenUnavailable,
|
|
29
|
-
onExecuted
|
|
30
|
-
});
|
|
31
|
-
const handleClick = useCallback(
|
|
32
|
-
(event) => {
|
|
33
|
-
onClick == null ? void 0 : onClick(event);
|
|
34
|
-
if (event.defaultPrevented) return;
|
|
35
|
-
handleAction();
|
|
36
|
-
},
|
|
37
|
-
[handleAction, onClick]
|
|
38
|
-
);
|
|
39
|
-
if (!isVisible) {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
return /* @__PURE__ */ jsx(
|
|
43
|
-
ToolbarButton,
|
|
44
|
-
{
|
|
45
|
-
type: "button",
|
|
46
|
-
variant: "ghost",
|
|
47
|
-
color: "default",
|
|
48
|
-
disabled: !canExecute,
|
|
49
|
-
"data-disabled": !canExecute,
|
|
50
|
-
tabIndex: -1,
|
|
51
|
-
"aria-label": label,
|
|
52
|
-
title: label,
|
|
53
|
-
shortcutKeys,
|
|
54
|
-
onClick: handleClick,
|
|
55
|
-
isIconOnly: true,
|
|
56
|
-
...buttonProps,
|
|
57
|
-
children: /* @__PURE__ */ jsx(Icon, {})
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export {
|
|
63
|
-
UndoRedoButton
|
|
64
|
-
};
|
package/dist/chunk-2U5CQUZH.mjs
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
MathBlockView
|
|
4
|
-
} from "./chunk-UVHVCION.mjs";
|
|
5
|
-
|
|
6
|
-
// src/extensions/math/index.ts
|
|
7
|
-
import { InputRule, mergeAttributes, Node } from "@tiptap/core";
|
|
8
|
-
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
9
|
-
var MathBlock = Node.create({
|
|
10
|
-
name: "mathBlock",
|
|
11
|
-
group: "block",
|
|
12
|
-
atom: true,
|
|
13
|
-
draggable: true,
|
|
14
|
-
addOptions() {
|
|
15
|
-
return {
|
|
16
|
-
HTMLAttributes: {}
|
|
17
|
-
};
|
|
18
|
-
},
|
|
19
|
-
addAttributes() {
|
|
20
|
-
return {
|
|
21
|
-
latex: {
|
|
22
|
-
default: "",
|
|
23
|
-
parseHTML: (element) => element.getAttribute("data-latex") || "",
|
|
24
|
-
renderHTML: (attributes) => ({
|
|
25
|
-
"data-latex": attributes.latex
|
|
26
|
-
})
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
},
|
|
30
|
-
parseHTML() {
|
|
31
|
-
return [
|
|
32
|
-
{
|
|
33
|
-
tag: 'div[data-type="math-block"]'
|
|
34
|
-
}
|
|
35
|
-
];
|
|
36
|
-
},
|
|
37
|
-
renderHTML({ HTMLAttributes }) {
|
|
38
|
-
return [
|
|
39
|
-
"div",
|
|
40
|
-
mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
|
|
41
|
-
"data-type": "math-block"
|
|
42
|
-
})
|
|
43
|
-
];
|
|
44
|
-
},
|
|
45
|
-
addNodeView() {
|
|
46
|
-
return ReactNodeViewRenderer(MathBlockView);
|
|
47
|
-
},
|
|
48
|
-
addCommands() {
|
|
49
|
-
return {
|
|
50
|
-
insertMathBlock: (latex = "") => ({ commands }) => {
|
|
51
|
-
return commands.insertContent({
|
|
52
|
-
type: this.name,
|
|
53
|
-
attrs: { latex }
|
|
54
|
-
});
|
|
55
|
-
},
|
|
56
|
-
updateMathBlock: (latex) => ({ tr, state, dispatch }) => {
|
|
57
|
-
const { selection } = state;
|
|
58
|
-
const node = state.doc.nodeAt(selection.from);
|
|
59
|
-
if ((node == null ? void 0 : node.type.name) !== this.name) {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
if (dispatch) {
|
|
63
|
-
tr.setNodeMarkup(selection.from, void 0, {
|
|
64
|
-
...node.attrs,
|
|
65
|
-
latex
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
addInputRules() {
|
|
73
|
-
return [
|
|
74
|
-
// Block math with $$...$$
|
|
75
|
-
new InputRule({
|
|
76
|
-
find: /^\$\$(.+)\$\$$/,
|
|
77
|
-
handler: ({ state, range, match }) => {
|
|
78
|
-
const latex = match[1];
|
|
79
|
-
const { tr } = state;
|
|
80
|
-
tr.replaceWith(range.from, range.to, this.type.create({ latex }));
|
|
81
|
-
}
|
|
82
|
-
})
|
|
83
|
-
];
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
var math_default = MathBlock;
|
|
87
|
-
|
|
88
|
-
export {
|
|
89
|
-
MathBlock,
|
|
90
|
-
math_default
|
|
91
|
-
};
|
package/dist/chunk-2UDCL55K.mjs
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
MarkButton
|
|
4
|
-
} from "./chunk-LNVWG34E.mjs";
|
|
5
|
-
import {
|
|
6
|
-
LinkPopover
|
|
7
|
-
} from "./chunk-7VGROP26.mjs";
|
|
8
|
-
|
|
9
|
-
// src/ui/bubble-menu/index.tsx
|
|
10
|
-
import { Toolbar, ToolbarGroup, ToolbarSeparator } from "@kopexa/toolbar";
|
|
11
|
-
import { BubbleMenu as TiptapBubbleMenu } from "@tiptap/react/menus";
|
|
12
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
function BubbleMenu({ editor }) {
|
|
14
|
-
if (!editor) {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
return /* @__PURE__ */ jsx(
|
|
18
|
-
TiptapBubbleMenu,
|
|
19
|
-
{
|
|
20
|
-
editor,
|
|
21
|
-
shouldShow: ({ editor: e, state, view }) => {
|
|
22
|
-
const { selection } = state;
|
|
23
|
-
const { empty } = selection;
|
|
24
|
-
if (!view.hasFocus()) return false;
|
|
25
|
-
if (empty) return false;
|
|
26
|
-
if (e.isActive("codeBlock")) return false;
|
|
27
|
-
if (e.isActive("link")) return false;
|
|
28
|
-
if (e.isActive("variable")) return false;
|
|
29
|
-
if (!e.isEditable) return false;
|
|
30
|
-
return true;
|
|
31
|
-
},
|
|
32
|
-
options: {
|
|
33
|
-
placement: "top",
|
|
34
|
-
offset: 8
|
|
35
|
-
},
|
|
36
|
-
className: "rounded-lg border bg-background shadow-md",
|
|
37
|
-
children: /* @__PURE__ */ jsxs(Toolbar, { radius: "md", border: "none", className: "p-1", children: [
|
|
38
|
-
/* @__PURE__ */ jsxs(ToolbarGroup, { children: [
|
|
39
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "bold" }),
|
|
40
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "italic" }),
|
|
41
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "strike" }),
|
|
42
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "code" })
|
|
43
|
-
] }),
|
|
44
|
-
/* @__PURE__ */ jsx(ToolbarSeparator, {}),
|
|
45
|
-
/* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsx(LinkPopover, { autoOpenOnLinkActive: false }) })
|
|
46
|
-
] })
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
var bubble_menu_default = BubbleMenu;
|
|
51
|
-
|
|
52
|
-
export {
|
|
53
|
-
BubbleMenu,
|
|
54
|
-
bubble_menu_default
|
|
55
|
-
};
|
package/dist/chunk-2V6VOAPI.mjs
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
TocSettings
|
|
4
|
-
} from "./chunk-4CDZ547I.mjs";
|
|
5
|
-
import {
|
|
6
|
-
messages
|
|
7
|
-
} from "./chunk-TAM3VMJT.mjs";
|
|
8
|
-
|
|
9
|
-
// src/extensions/toc/toc-view.tsx
|
|
10
|
-
import { ListIcon } from "@kopexa/icons";
|
|
11
|
-
import { toc } from "@kopexa/theme";
|
|
12
|
-
import { NodeViewWrapper } from "@tiptap/react";
|
|
13
|
-
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
14
|
-
import { useIntl } from "react-intl";
|
|
15
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
function generateHeadingNumbers(headings, minLevel) {
|
|
17
|
-
const counters = [0, 0, 0, 0, 0, 0];
|
|
18
|
-
return headings.map((heading) => {
|
|
19
|
-
const levelIndex = heading.level - 1;
|
|
20
|
-
counters[levelIndex]++;
|
|
21
|
-
for (let i = levelIndex + 1; i < 6; i++) {
|
|
22
|
-
counters[i] = 0;
|
|
23
|
-
}
|
|
24
|
-
const numberParts = [];
|
|
25
|
-
for (let i = minLevel - 1; i <= levelIndex; i++) {
|
|
26
|
-
if (counters[i] > 0) {
|
|
27
|
-
numberParts.push(counters[i]);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
...heading,
|
|
32
|
-
number: numberParts.join(".")
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
function TocNodeView({ editor, node, getPos }) {
|
|
37
|
-
const [headings, setHeadings] = useState([]);
|
|
38
|
-
const intl = useIntl();
|
|
39
|
-
const attrs = node.attrs;
|
|
40
|
-
const {
|
|
41
|
-
minLevel = 1,
|
|
42
|
-
maxLevel = 6,
|
|
43
|
-
numbered = false,
|
|
44
|
-
style = "default"
|
|
45
|
-
} = attrs;
|
|
46
|
-
const styles = useMemo(() => toc({ style }), [style]);
|
|
47
|
-
const updateHeadings = useCallback(() => {
|
|
48
|
-
const items = [];
|
|
49
|
-
const { doc } = editor.state;
|
|
50
|
-
doc.descendants((docNode, pos) => {
|
|
51
|
-
if (docNode.type.name === "heading") {
|
|
52
|
-
const level = docNode.attrs.level;
|
|
53
|
-
if (level >= minLevel && level <= maxLevel) {
|
|
54
|
-
const id = docNode.attrs.id || `heading-${pos}`;
|
|
55
|
-
items.push({
|
|
56
|
-
id,
|
|
57
|
-
level,
|
|
58
|
-
text: docNode.textContent,
|
|
59
|
-
pos
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
const numberedHeadings = generateHeadingNumbers(items, minLevel);
|
|
65
|
-
setHeadings(numberedHeadings);
|
|
66
|
-
}, [editor, minLevel, maxLevel]);
|
|
67
|
-
useEffect(() => {
|
|
68
|
-
updateHeadings();
|
|
69
|
-
editor.on("update", updateHeadings);
|
|
70
|
-
return () => {
|
|
71
|
-
editor.off("update", updateHeadings);
|
|
72
|
-
};
|
|
73
|
-
}, [editor, updateHeadings]);
|
|
74
|
-
const handleClick = useCallback(
|
|
75
|
-
(pos, id) => {
|
|
76
|
-
var _a;
|
|
77
|
-
editor.chain().focus().setTextSelection(pos).run();
|
|
78
|
-
let element = document.querySelector(`[data-id="${id}"]`);
|
|
79
|
-
if (!element) {
|
|
80
|
-
const { view } = editor;
|
|
81
|
-
const coords = view.coordsAtPos(pos);
|
|
82
|
-
const domNode = document.elementFromPoint(coords.left, coords.top);
|
|
83
|
-
element = (_a = domNode == null ? void 0 : domNode.closest("h1, h2, h3, h4, h5, h6")) != null ? _a : null;
|
|
84
|
-
}
|
|
85
|
-
if (element) {
|
|
86
|
-
element.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
[editor]
|
|
90
|
-
);
|
|
91
|
-
const isEmpty = headings.length === 0;
|
|
92
|
-
const getIndent = (level) => {
|
|
93
|
-
return (level - minLevel) * 16;
|
|
94
|
-
};
|
|
95
|
-
return /* @__PURE__ */ jsxs(NodeViewWrapper, { className: styles.root(), "data-type": "toc", children: [
|
|
96
|
-
/* @__PURE__ */ jsxs("div", { className: styles.header(), children: [
|
|
97
|
-
/* @__PURE__ */ jsxs("div", { className: styles.headerContent(), children: [
|
|
98
|
-
/* @__PURE__ */ jsx(ListIcon, { className: styles.headerIcon() }),
|
|
99
|
-
/* @__PURE__ */ jsx("span", { className: styles.headerTitle(), children: intl.formatMessage(messages.title) })
|
|
100
|
-
] }),
|
|
101
|
-
/* @__PURE__ */ jsx("div", { className: styles.headerActions(), children: /* @__PURE__ */ jsx(
|
|
102
|
-
TocSettings,
|
|
103
|
-
{
|
|
104
|
-
editor,
|
|
105
|
-
attrs,
|
|
106
|
-
getPos
|
|
107
|
-
}
|
|
108
|
-
) })
|
|
109
|
-
] }),
|
|
110
|
-
isEmpty ? /* @__PURE__ */ jsx("p", { className: styles.emptyState(), children: intl.formatMessage(messages.empty_state) }) : /* @__PURE__ */ jsx("nav", { className: styles.nav(), children: /* @__PURE__ */ jsx("ul", { className: styles.list(), children: headings.map((heading) => /* @__PURE__ */ jsxs(
|
|
111
|
-
"li",
|
|
112
|
-
{
|
|
113
|
-
className: styles.item(),
|
|
114
|
-
style: {
|
|
115
|
-
paddingLeft: `${getIndent(heading.level)}px`
|
|
116
|
-
},
|
|
117
|
-
children: [
|
|
118
|
-
numbered && heading.number && /* @__PURE__ */ jsx("span", { className: styles.itemNumber(), children: heading.number }),
|
|
119
|
-
/* @__PURE__ */ jsx(
|
|
120
|
-
"button",
|
|
121
|
-
{
|
|
122
|
-
type: "button",
|
|
123
|
-
onClick: () => handleClick(heading.pos, heading.id),
|
|
124
|
-
className: styles.itemButton(),
|
|
125
|
-
children: heading.text || intl.formatMessage(messages.empty_heading)
|
|
126
|
-
}
|
|
127
|
-
)
|
|
128
|
-
]
|
|
129
|
-
},
|
|
130
|
-
heading.id
|
|
131
|
-
)) }) })
|
|
132
|
-
] });
|
|
133
|
-
}
|
|
134
|
-
var toc_view_default = TocNodeView;
|
|
135
|
-
|
|
136
|
-
export {
|
|
137
|
-
TocNodeView,
|
|
138
|
-
toc_view_default
|
|
139
|
-
};
|
package/dist/chunk-2Z2QVW67.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";
|
package/dist/chunk-32SUXCAQ.mjs
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
CalloutNodeView
|
|
4
|
-
} from "./chunk-VF3G2URZ.mjs";
|
|
5
|
-
|
|
6
|
-
// src/extensions/callout/index.ts
|
|
7
|
-
import { mergeAttributes, Node } from "@tiptap/core";
|
|
8
|
-
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
9
|
-
var CalloutNode = Node.create({
|
|
10
|
-
name: "calloutNode",
|
|
11
|
-
group: "block",
|
|
12
|
-
content: "block+",
|
|
13
|
-
defining: true,
|
|
14
|
-
draggable: true,
|
|
15
|
-
addOptions() {
|
|
16
|
-
return {
|
|
17
|
-
HTMLAttributes: {}
|
|
18
|
-
};
|
|
19
|
-
},
|
|
20
|
-
addAttributes() {
|
|
21
|
-
return {
|
|
22
|
-
variant: {
|
|
23
|
-
default: "info",
|
|
24
|
-
parseHTML: (element) => element.getAttribute("data-variant") || "info",
|
|
25
|
-
renderHTML: (attributes) => ({
|
|
26
|
-
"data-variant": attributes.variant
|
|
27
|
-
})
|
|
28
|
-
},
|
|
29
|
-
title: {
|
|
30
|
-
default: null,
|
|
31
|
-
parseHTML: (element) => element.getAttribute("data-title") || null,
|
|
32
|
-
renderHTML: (attributes) => {
|
|
33
|
-
if (!attributes.title) return {};
|
|
34
|
-
return {
|
|
35
|
-
"data-title": attributes.title
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
},
|
|
41
|
-
parseHTML() {
|
|
42
|
-
return [
|
|
43
|
-
{
|
|
44
|
-
tag: 'div[data-type="callout"]'
|
|
45
|
-
}
|
|
46
|
-
];
|
|
47
|
-
},
|
|
48
|
-
renderHTML({ HTMLAttributes }) {
|
|
49
|
-
return [
|
|
50
|
-
"div",
|
|
51
|
-
mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
|
|
52
|
-
"data-type": "callout"
|
|
53
|
-
}),
|
|
54
|
-
0
|
|
55
|
-
];
|
|
56
|
-
},
|
|
57
|
-
addNodeView() {
|
|
58
|
-
return ReactNodeViewRenderer(CalloutNodeView);
|
|
59
|
-
},
|
|
60
|
-
addCommands() {
|
|
61
|
-
return {
|
|
62
|
-
insertCallout: (variant = "info") => ({ commands }) => {
|
|
63
|
-
return commands.insertContent({
|
|
64
|
-
type: this.name,
|
|
65
|
-
attrs: { variant },
|
|
66
|
-
content: [
|
|
67
|
-
{
|
|
68
|
-
type: "paragraph"
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
});
|
|
72
|
-
},
|
|
73
|
-
updateCalloutSettings: (attrs) => ({ tr, state, dispatch }) => {
|
|
74
|
-
const { selection } = state;
|
|
75
|
-
const node = state.doc.nodeAt(selection.from);
|
|
76
|
-
if ((node == null ? void 0 : node.type.name) !== this.name) {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
if (dispatch) {
|
|
80
|
-
tr.setNodeMarkup(selection.from, void 0, {
|
|
81
|
-
...node.attrs,
|
|
82
|
-
...attrs
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
},
|
|
89
|
-
addKeyboardShortcuts() {
|
|
90
|
-
return {
|
|
91
|
-
// Allow backspace at start to lift content out of callout
|
|
92
|
-
Backspace: ({ editor }) => {
|
|
93
|
-
var _a;
|
|
94
|
-
const { state } = editor;
|
|
95
|
-
const { selection } = state;
|
|
96
|
-
const { $from } = selection;
|
|
97
|
-
if ($from.parent.type.name === "paragraph" && $from.parentOffset === 0) {
|
|
98
|
-
const calloutNode = $from.node(-1);
|
|
99
|
-
if ((calloutNode == null ? void 0 : calloutNode.type.name) === this.name) {
|
|
100
|
-
if (calloutNode.childCount === 1 && ((_a = calloutNode.firstChild) == null ? void 0 : _a.textContent) === "") {
|
|
101
|
-
return editor.commands.deleteNode(this.name);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
var callout_default = CalloutNode;
|
|
111
|
-
|
|
112
|
-
export {
|
|
113
|
-
CalloutNode,
|
|
114
|
-
callout_default
|
|
115
|
-
};
|
package/dist/chunk-33QD5PYJ.mjs
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/ui/heading-button/utils.ts
|
|
4
|
-
import { isNodeSelection } from "@tiptap/react";
|
|
5
|
-
var headingShortcutKeys = {
|
|
6
|
-
1: "Ctrl-Alt-1",
|
|
7
|
-
2: "Ctrl-Alt-2",
|
|
8
|
-
3: "Ctrl-Alt-3",
|
|
9
|
-
4: "Ctrl-Alt-4",
|
|
10
|
-
5: "Ctrl-Alt-5",
|
|
11
|
-
6: "Ctrl-Alt-6"
|
|
12
|
-
};
|
|
13
|
-
function canToggleHeading(editor, level) {
|
|
14
|
-
if (!editor) return false;
|
|
15
|
-
try {
|
|
16
|
-
return editor.can().toggleNode("heading", "paragraph", { level });
|
|
17
|
-
} catch {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function isHeadingActive(editor, level) {
|
|
22
|
-
if (!editor) return false;
|
|
23
|
-
return editor.isActive("heading", { level });
|
|
24
|
-
}
|
|
25
|
-
function toggleHeading(editor, level) {
|
|
26
|
-
if (!editor) return;
|
|
27
|
-
if (editor.isActive("heading", { level })) {
|
|
28
|
-
editor.chain().focus().setNode("paragraph").run();
|
|
29
|
-
} else {
|
|
30
|
-
editor.chain().focus().toggleNode("heading", "paragraph", { level }).run();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function isHeadingButtonDisabled(editor, level, userDisabled = false) {
|
|
34
|
-
if (!editor) return true;
|
|
35
|
-
if (userDisabled) return true;
|
|
36
|
-
if (!canToggleHeading(editor, level)) return true;
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
function shouldShowHeadingButton(params) {
|
|
40
|
-
const { editor, hideWhenUnavailable, headingInSchema } = params;
|
|
41
|
-
if (!headingInSchema || !editor) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
if (hideWhenUnavailable) {
|
|
45
|
-
if (isNodeSelection(editor.state.selection)) {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
function getFormattedHeadingName(level) {
|
|
52
|
-
return `Heading ${level}`;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export {
|
|
56
|
-
headingShortcutKeys,
|
|
57
|
-
canToggleHeading,
|
|
58
|
-
isHeadingActive,
|
|
59
|
-
toggleHeading,
|
|
60
|
-
isHeadingButtonDisabled,
|
|
61
|
-
shouldShowHeadingButton,
|
|
62
|
-
getFormattedHeadingName
|
|
63
|
-
};
|