@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/index.d.mts
CHANGED
|
@@ -1,25 +1,692 @@
|
|
|
1
|
+
import * as _tiptap_core from '@tiptap/core';
|
|
2
|
+
import { Node, JSONContent } from '@tiptap/core';
|
|
1
3
|
export { Content, JSONContent } from '@tiptap/core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
import { HocuspocusProvider } from '@hocuspocus/provider';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { ReactNode } from 'react';
|
|
8
|
+
import * as Y from 'yjs';
|
|
9
|
+
import { Editor, Extensions, Content, JSONContent as JSONContent$1 } from '@tiptap/react';
|
|
10
|
+
import { ControlResolver } from '@kopexa/extension-controlref';
|
|
11
|
+
import { PagesOptions } from '@kopexa/extension-pages';
|
|
12
|
+
import { EditorBasicVariants } from '@kopexa/theme';
|
|
13
|
+
|
|
14
|
+
type CollaborationStatus = "connecting" | "connected" | "disconnected";
|
|
15
|
+
interface CollabUser {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
color?: string;
|
|
19
|
+
avatar?: string;
|
|
20
|
+
}
|
|
21
|
+
/** A resolved user with a guaranteed color. */
|
|
22
|
+
interface ResolvedCollabUser extends CollabUser {
|
|
23
|
+
color: string;
|
|
24
|
+
}
|
|
25
|
+
interface CollaborationState {
|
|
26
|
+
/** Current WebSocket connection status. */
|
|
27
|
+
status: CollaborationStatus;
|
|
28
|
+
/** True when reconnecting after a previous disconnect. */
|
|
29
|
+
isReconnecting: boolean;
|
|
30
|
+
/** True when both remote and local are synced. */
|
|
31
|
+
synced: boolean;
|
|
32
|
+
/** Whether the remote provider has synced at least once. */
|
|
33
|
+
remoteSynced: boolean;
|
|
34
|
+
/** Whether local IndexedDB persistence has synced. */
|
|
35
|
+
localSynced: boolean;
|
|
36
|
+
/** Timestamp of the last successful remote sync. */
|
|
37
|
+
lastSyncedAt: Date | null;
|
|
38
|
+
/** Active collaborators (from awareness protocol). */
|
|
39
|
+
collabUsers: ResolvedCollabUser[];
|
|
40
|
+
/** The Hocuspocus WebSocket provider. */
|
|
41
|
+
provider: HocuspocusProvider | null;
|
|
42
|
+
/** The shared Yjs document. */
|
|
43
|
+
ydoc: Y.Doc;
|
|
44
|
+
/** The current user with resolved color. */
|
|
45
|
+
user: ResolvedCollabUser;
|
|
46
|
+
}
|
|
47
|
+
interface CollaborationProviderProps {
|
|
48
|
+
/** Unique document identifier for the collaboration room. */
|
|
49
|
+
documentId: string;
|
|
50
|
+
/** WebSocket URL of the Hocuspocus server. */
|
|
51
|
+
url: string;
|
|
52
|
+
/**
|
|
53
|
+
* Async function to get a fresh auth token.
|
|
54
|
+
* Called on every connect and reconnect for token renewal.
|
|
55
|
+
*/
|
|
56
|
+
getToken: () => Promise<string> | string;
|
|
57
|
+
/** Current user info for presence/cursors. */
|
|
58
|
+
user: CollabUser;
|
|
59
|
+
/**
|
|
60
|
+
* Enable local IndexedDB persistence for offline caching.
|
|
61
|
+
* @default true
|
|
62
|
+
*/
|
|
63
|
+
enableLocalPersistence?: boolean;
|
|
64
|
+
children: ReactNode;
|
|
65
|
+
}
|
|
66
|
+
declare function CollaborationProvider({ documentId, url, getToken, user, enableLocalPersistence, children, }: CollaborationProviderProps): react_jsx_runtime.JSX.Element;
|
|
67
|
+
/**
|
|
68
|
+
* Returns the collaboration state, or `null` if outside a CollaborationProvider.
|
|
69
|
+
* This is how `useCreateEditor` detects whether to enable collaboration.
|
|
70
|
+
*/
|
|
71
|
+
declare function useCollaboration(): CollaborationState | null;
|
|
72
|
+
/**
|
|
73
|
+
* Returns the collaboration state, or throws if not inside a CollaborationProvider.
|
|
74
|
+
* Use in components that require collaboration to be active.
|
|
75
|
+
*/
|
|
76
|
+
declare function useCollaborationRequired(): CollaborationState;
|
|
77
|
+
|
|
78
|
+
interface EditorFileHandler {
|
|
79
|
+
/**
|
|
80
|
+
* Upload a file and return a reference string.
|
|
81
|
+
* The reference format is determined by the backend (e.g., UUID, custom scheme).
|
|
82
|
+
* @param file The file to upload
|
|
83
|
+
* @param onProgress Optional progress callback (0-100)
|
|
84
|
+
* @returns Promise resolving to a reference string
|
|
85
|
+
*/
|
|
86
|
+
upload: (file: File, onProgress?: (percent: number) => void) => Promise<string>;
|
|
87
|
+
/**
|
|
88
|
+
* Resolve a reference to a displayable URL.
|
|
89
|
+
* Typically returns a signed URL from your storage backend.
|
|
90
|
+
* @param ref The reference string from upload
|
|
91
|
+
* @returns Promise resolving to a displayable URL
|
|
92
|
+
*/
|
|
93
|
+
resolve: (ref: string) => Promise<string>;
|
|
94
|
+
/**
|
|
95
|
+
* Check if a src string is a reference that needs resolving.
|
|
96
|
+
* Returns false for already-valid URLs (https://, data:, etc.)
|
|
97
|
+
* @param src The src attribute value
|
|
98
|
+
* @returns true if this needs to be resolved
|
|
99
|
+
*/
|
|
100
|
+
isReference: (src: string) => boolean;
|
|
101
|
+
}
|
|
102
|
+
interface EditorFileContextValue extends EditorFileHandler {
|
|
103
|
+
/**
|
|
104
|
+
* Whether file handling is available
|
|
105
|
+
*/
|
|
106
|
+
isAvailable: true;
|
|
107
|
+
}
|
|
108
|
+
interface EditorFileProviderProps {
|
|
109
|
+
children: ReactNode;
|
|
110
|
+
/**
|
|
111
|
+
* Upload handler - called when user pastes/drops a file
|
|
112
|
+
*/
|
|
113
|
+
onUpload: EditorFileHandler["upload"];
|
|
114
|
+
/**
|
|
115
|
+
* Resolve handler - called to get displayable URL from reference
|
|
116
|
+
*/
|
|
117
|
+
onResolve: EditorFileHandler["resolve"];
|
|
118
|
+
/**
|
|
119
|
+
* Check if src needs resolving (default: not starting with http/https/data)
|
|
120
|
+
*/
|
|
121
|
+
isReference?: EditorFileHandler["isReference"];
|
|
122
|
+
/**
|
|
123
|
+
* Cache TTL buffer in ms (default: 2 minutes)
|
|
124
|
+
* URLs are refreshed this much before actual expiry
|
|
125
|
+
*/
|
|
126
|
+
cacheBuffer?: number;
|
|
127
|
+
/**
|
|
128
|
+
* Default cache TTL in ms if not determined from response (default: 10 minutes)
|
|
129
|
+
*/
|
|
130
|
+
defaultCacheTtl?: number;
|
|
131
|
+
}
|
|
132
|
+
declare function EditorFileProvider({ children, onUpload, onResolve, isReference, cacheBuffer, defaultCacheTtl, }: EditorFileProviderProps): react_jsx_runtime.JSX.Element;
|
|
133
|
+
/**
|
|
134
|
+
* Hook to access file handling capabilities.
|
|
135
|
+
* Returns null if no EditorFileProvider is present (files not supported).
|
|
136
|
+
*/
|
|
137
|
+
declare function useEditorFile(): EditorFileContextValue | null;
|
|
138
|
+
/**
|
|
139
|
+
* Hook that throws if file handling is not available.
|
|
140
|
+
* Use this in components that require file support.
|
|
141
|
+
*/
|
|
142
|
+
declare function useEditorFileRequired(): EditorFileContextValue;
|
|
143
|
+
|
|
144
|
+
type CalloutVariant = "default" | "info" | "success" | "warning" | "destructive";
|
|
145
|
+
interface CalloutNodeAttrs {
|
|
146
|
+
/**
|
|
147
|
+
* Visual variant of the callout
|
|
148
|
+
* @default "info"
|
|
149
|
+
*/
|
|
150
|
+
variant: CalloutVariant;
|
|
151
|
+
/**
|
|
152
|
+
* Optional title for the callout
|
|
153
|
+
* @default null
|
|
154
|
+
*/
|
|
155
|
+
title: string | null;
|
|
156
|
+
}
|
|
157
|
+
interface CalloutOptions {
|
|
158
|
+
/**
|
|
159
|
+
* Custom HTML attributes for the Callout wrapper element.
|
|
160
|
+
*/
|
|
161
|
+
HTMLAttributes: Record<string, unknown>;
|
|
162
|
+
}
|
|
163
|
+
declare module "@tiptap/core" {
|
|
164
|
+
interface Commands<ReturnType> {
|
|
165
|
+
calloutNode: {
|
|
166
|
+
/**
|
|
167
|
+
* Insert a callout node
|
|
168
|
+
*/
|
|
169
|
+
insertCallout: (variant?: CalloutVariant) => ReturnType;
|
|
170
|
+
/**
|
|
171
|
+
* Update callout settings
|
|
172
|
+
*/
|
|
173
|
+
updateCalloutSettings: (attrs: Partial<CalloutNodeAttrs>) => ReturnType;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Callout Node Extension
|
|
179
|
+
*
|
|
180
|
+
* Inserts a callout block with different variants (info, warning, success, error)
|
|
181
|
+
* Supports editable content inside the callout.
|
|
182
|
+
*/
|
|
183
|
+
declare const CalloutNode: Node<CalloutOptions, any>;
|
|
184
|
+
|
|
185
|
+
interface ImageNodeOptions {
|
|
186
|
+
/**
|
|
187
|
+
* Whether to allow base64 images
|
|
188
|
+
* @default true
|
|
189
|
+
*/
|
|
190
|
+
allowBase64: boolean;
|
|
191
|
+
/**
|
|
192
|
+
* HTML attributes to add to the image element
|
|
193
|
+
*/
|
|
194
|
+
HTMLAttributes: Record<string, unknown>;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Extended Image extension with file reference resolution support
|
|
198
|
+
*
|
|
199
|
+
* This extension wraps @tiptap/extension-image and adds:
|
|
200
|
+
* - File reference resolution via EditorFileProvider
|
|
201
|
+
* - Loading states while resolving URLs
|
|
202
|
+
* - Error handling for failed resolution
|
|
203
|
+
* - Upload state tracking for drag & drop uploads
|
|
204
|
+
*/
|
|
205
|
+
declare const ImageNode: _tiptap_core.Node<ImageNodeOptions, any>;
|
|
206
|
+
|
|
207
|
+
interface ImageUploadNodeOptions {
|
|
208
|
+
/**
|
|
209
|
+
* Allowed MIME types for upload
|
|
210
|
+
* @default ["image/*"]
|
|
211
|
+
*/
|
|
212
|
+
accept: string;
|
|
213
|
+
/**
|
|
214
|
+
* Maximum file size in bytes (0 = unlimited)
|
|
215
|
+
* @default 0
|
|
216
|
+
*/
|
|
217
|
+
maxSize: number;
|
|
218
|
+
/**
|
|
219
|
+
* HTML attributes to add to the wrapper element
|
|
220
|
+
*/
|
|
221
|
+
HTMLAttributes: Record<string, unknown>;
|
|
222
|
+
}
|
|
223
|
+
declare module "@tiptap/core" {
|
|
224
|
+
interface Commands<ReturnType> {
|
|
225
|
+
imageUpload: {
|
|
226
|
+
/**
|
|
227
|
+
* Insert an image upload placeholder
|
|
228
|
+
*/
|
|
229
|
+
setImageUpload: () => ReturnType;
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* ImageUploadNode - Upload placeholder that converts to a regular image node
|
|
235
|
+
*
|
|
236
|
+
* This extension provides a file upload UI that, after successful upload,
|
|
237
|
+
* replaces itself with a standard `image` node from @tiptap/extension-image.
|
|
238
|
+
*
|
|
239
|
+
* This separation allows:
|
|
240
|
+
* - Clean coexistence with the standard image extension
|
|
241
|
+
* - Upload UI only when needed
|
|
242
|
+
* - Standard image handling for display
|
|
243
|
+
*/
|
|
244
|
+
declare const ImageUploadNode: Node<ImageUploadNodeOptions, any>;
|
|
245
|
+
|
|
246
|
+
interface InlineMathAttrs {
|
|
247
|
+
/**
|
|
248
|
+
* The LaTeX formula content
|
|
249
|
+
*/
|
|
250
|
+
latex: string;
|
|
251
|
+
}
|
|
252
|
+
interface InlineMathOptions {
|
|
253
|
+
/**
|
|
254
|
+
* Custom HTML attributes for the inline math wrapper element.
|
|
255
|
+
*/
|
|
256
|
+
HTMLAttributes: Record<string, unknown>;
|
|
257
|
+
}
|
|
258
|
+
declare module "@tiptap/core" {
|
|
259
|
+
interface Commands<ReturnType> {
|
|
260
|
+
inlineMath: {
|
|
261
|
+
/**
|
|
262
|
+
* Insert inline math
|
|
263
|
+
*/
|
|
264
|
+
insertInlineMath: (latex?: string) => ReturnType;
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Inline Math Node Extension
|
|
270
|
+
*
|
|
271
|
+
* Renders inline LaTeX formulas using KaTeX.
|
|
272
|
+
*/
|
|
273
|
+
declare const InlineMath: Node<InlineMathOptions, any>;
|
|
274
|
+
|
|
275
|
+
interface MathBlockAttrs {
|
|
276
|
+
/**
|
|
277
|
+
* The LaTeX formula content
|
|
278
|
+
*/
|
|
279
|
+
latex: string;
|
|
280
|
+
}
|
|
281
|
+
interface MathBlockOptions {
|
|
282
|
+
/**
|
|
283
|
+
* Custom HTML attributes for the Math block wrapper element.
|
|
284
|
+
*/
|
|
285
|
+
HTMLAttributes: Record<string, unknown>;
|
|
286
|
+
}
|
|
287
|
+
declare module "@tiptap/core" {
|
|
288
|
+
interface Commands<ReturnType> {
|
|
289
|
+
mathBlock: {
|
|
290
|
+
/**
|
|
291
|
+
* Insert a math block
|
|
292
|
+
*/
|
|
293
|
+
insertMathBlock: (latex?: string) => ReturnType;
|
|
294
|
+
/**
|
|
295
|
+
* Update math block content
|
|
296
|
+
*/
|
|
297
|
+
updateMathBlock: (latex: string) => ReturnType;
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Math Block Node Extension
|
|
303
|
+
*
|
|
304
|
+
* Renders LaTeX formulas using KaTeX.
|
|
305
|
+
* Provides an editor dialog for editing formulas.
|
|
306
|
+
*/
|
|
307
|
+
declare const MathBlock: Node<MathBlockOptions, any>;
|
|
308
|
+
|
|
309
|
+
interface TocNodeAttrs {
|
|
310
|
+
/**
|
|
311
|
+
* Minimum heading level to include (1-6)
|
|
312
|
+
* @default 1
|
|
313
|
+
*/
|
|
314
|
+
minLevel: number;
|
|
315
|
+
/**
|
|
316
|
+
* Maximum heading level to include (1-6)
|
|
317
|
+
* @default 6
|
|
318
|
+
*/
|
|
319
|
+
maxLevel: number;
|
|
320
|
+
/**
|
|
321
|
+
* Show hierarchical numbering (1, 1.1, 1.1.1)
|
|
322
|
+
* @default false
|
|
323
|
+
*/
|
|
324
|
+
numbered: boolean;
|
|
325
|
+
/**
|
|
326
|
+
* Visual style variant
|
|
327
|
+
* @default "default"
|
|
328
|
+
*/
|
|
329
|
+
style: "default" | "flat" | "compact";
|
|
330
|
+
}
|
|
331
|
+
interface TocOptions {
|
|
332
|
+
/**
|
|
333
|
+
* Custom HTML attributes for the ToC wrapper element.
|
|
334
|
+
*/
|
|
335
|
+
HTMLAttributes: Record<string, unknown>;
|
|
336
|
+
}
|
|
337
|
+
declare module "@tiptap/core" {
|
|
338
|
+
interface Commands<ReturnType> {
|
|
339
|
+
tableOfContentsNode: {
|
|
340
|
+
/**
|
|
341
|
+
* Insert a table of contents node
|
|
342
|
+
*/
|
|
343
|
+
insertTableOfContents: () => ReturnType;
|
|
344
|
+
/**
|
|
345
|
+
* Update table of contents settings
|
|
346
|
+
*/
|
|
347
|
+
updateTocSettings: (attrs: Partial<TocNodeAttrs>) => ReturnType;
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Table of Contents Node Extension
|
|
353
|
+
*
|
|
354
|
+
* Inserts an inline table of contents that automatically updates
|
|
355
|
+
* based on headings in the document.
|
|
356
|
+
*/
|
|
357
|
+
declare const TocNode: Node<TocOptions, any>;
|
|
358
|
+
|
|
359
|
+
interface VariableNodeAttrs {
|
|
360
|
+
/** The variable name/key (e.g., "companyName") */
|
|
361
|
+
name: string;
|
|
362
|
+
/** Optional fallback value if variable is not resolved */
|
|
363
|
+
fallback?: string;
|
|
364
|
+
/** Optional category for grouping (e.g., "company", "user", "date") */
|
|
365
|
+
category?: string;
|
|
366
|
+
}
|
|
367
|
+
interface VariableOptions {
|
|
368
|
+
/**
|
|
369
|
+
* HTML attributes to add to the variable element.
|
|
370
|
+
*/
|
|
371
|
+
HTMLAttributes: Record<string, unknown>;
|
|
372
|
+
}
|
|
373
|
+
declare module "@tiptap/core" {
|
|
374
|
+
interface Commands<ReturnType> {
|
|
375
|
+
variable: {
|
|
376
|
+
/**
|
|
377
|
+
* Insert a variable node
|
|
378
|
+
*/
|
|
379
|
+
insertVariable: (attrs: VariableNodeAttrs) => ReturnType;
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* VariableNode Extension
|
|
385
|
+
*
|
|
386
|
+
* Allows inserting template variables like {{companyName}} into documents.
|
|
387
|
+
* Variables are rendered as inline chips and can be resolved when rendering
|
|
388
|
+
* the final document.
|
|
389
|
+
*
|
|
390
|
+
* Triggered by typing `{{` which opens a suggestion menu.
|
|
391
|
+
*/
|
|
392
|
+
declare const VariableNode: Node<VariableOptions, any>;
|
|
393
|
+
|
|
394
|
+
interface VariableDefinition {
|
|
395
|
+
/** The variable key/name */
|
|
396
|
+
name: string;
|
|
397
|
+
/** Display label for the variable */
|
|
398
|
+
label: string;
|
|
399
|
+
/** Optional description */
|
|
400
|
+
description?: string;
|
|
401
|
+
/** Category for grouping */
|
|
402
|
+
category?: string;
|
|
403
|
+
/** Default/fallback value */
|
|
404
|
+
fallback?: string;
|
|
405
|
+
}
|
|
406
|
+
interface VariableSuggestionProps {
|
|
407
|
+
editor?: Editor | null;
|
|
408
|
+
/**
|
|
409
|
+
* List of available variables to suggest
|
|
410
|
+
*/
|
|
411
|
+
variables: VariableDefinition[];
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Variable Suggestion Menu
|
|
415
|
+
*
|
|
416
|
+
* A suggestion popup triggered by typing `{{` that shows available
|
|
417
|
+
* template variables for insertion.
|
|
418
|
+
*/
|
|
419
|
+
declare function VariableSuggestion({ editor, variables, }: VariableSuggestionProps): react_jsx_runtime.JSX.Element;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Extracts all variable nodes from a TipTap document.
|
|
423
|
+
*
|
|
424
|
+
* Recursively scans the document content and returns unique variables.
|
|
425
|
+
*
|
|
426
|
+
* @param content - The TipTap JSONContent to scan
|
|
427
|
+
* @returns Array of unique variable definitions found in the document
|
|
428
|
+
*/
|
|
429
|
+
declare function extractVariablesFromContent(content: JSONContent | undefined): VariableDefinition[];
|
|
430
|
+
|
|
431
|
+
interface VariableContextValue {
|
|
432
|
+
/** Available variables for template insertion */
|
|
433
|
+
variables: VariableDefinition[];
|
|
434
|
+
/** Resolve a variable to its current value */
|
|
435
|
+
resolveVariable?: (name: string) => string | undefined;
|
|
436
|
+
}
|
|
437
|
+
interface VariableProviderProps {
|
|
438
|
+
children: React.ReactNode;
|
|
439
|
+
/**
|
|
440
|
+
* List of available variables
|
|
441
|
+
*/
|
|
442
|
+
variables: VariableDefinition[];
|
|
443
|
+
/**
|
|
444
|
+
* Optional function to resolve a variable name to its current value.
|
|
445
|
+
* Used for preview/rendering purposes.
|
|
446
|
+
*/
|
|
447
|
+
resolveVariable?: (name: string) => string | undefined;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Provider for template variables
|
|
451
|
+
*
|
|
452
|
+
* Wrap your editor with this provider to make variables available
|
|
453
|
+
* for the suggestion menu and variable panel.
|
|
454
|
+
*
|
|
455
|
+
* @example
|
|
456
|
+
* ```tsx
|
|
457
|
+
* const variables = [
|
|
458
|
+
* { name: 'companyName', label: 'Company Name', category: 'Company' },
|
|
459
|
+
* { name: 'userName', label: 'User Name', category: 'User' },
|
|
460
|
+
* ];
|
|
461
|
+
*
|
|
462
|
+
* <VariableProvider variables={variables}>
|
|
463
|
+
* <Editor />
|
|
464
|
+
* </VariableProvider>
|
|
465
|
+
* ```
|
|
466
|
+
*/
|
|
467
|
+
declare function VariableProvider({ children, variables, resolveVariable, }: VariableProviderProps): react_jsx_runtime.JSX.Element;
|
|
468
|
+
/**
|
|
469
|
+
* Hook to access variable context
|
|
470
|
+
*
|
|
471
|
+
* Returns null if used outside of VariableProvider
|
|
472
|
+
*/
|
|
473
|
+
declare function useVariables(): VariableContextValue | null;
|
|
474
|
+
/**
|
|
475
|
+
* Hook to access variables with fallback
|
|
476
|
+
*
|
|
477
|
+
* @param fallbackVariables - Variables to use if no provider is present
|
|
478
|
+
*/
|
|
479
|
+
declare function useVariablesWithFallback(fallbackVariables?: VariableDefinition[]): VariableDefinition[];
|
|
480
|
+
|
|
481
|
+
interface VariableFillerDialogProps {
|
|
482
|
+
/**
|
|
483
|
+
* Whether the dialog is open
|
|
484
|
+
*/
|
|
485
|
+
open: boolean;
|
|
486
|
+
/**
|
|
487
|
+
* Callback when the dialog open state changes
|
|
488
|
+
*/
|
|
489
|
+
onOpenChange: (open: boolean) => void;
|
|
490
|
+
/**
|
|
491
|
+
* Available variables to fill
|
|
492
|
+
*/
|
|
493
|
+
variables: VariableDefinition[];
|
|
494
|
+
/**
|
|
495
|
+
* Current variable values
|
|
496
|
+
*/
|
|
497
|
+
values: Record<string, string>;
|
|
498
|
+
/**
|
|
499
|
+
* Callback when variables are saved
|
|
500
|
+
*/
|
|
501
|
+
onSave: (values: Record<string, string>) => void;
|
|
502
|
+
/**
|
|
503
|
+
* Dialog title
|
|
504
|
+
*/
|
|
505
|
+
title?: string;
|
|
506
|
+
/**
|
|
507
|
+
* Dialog description
|
|
508
|
+
*/
|
|
509
|
+
description?: string;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* A dialog for filling in template variables
|
|
513
|
+
*
|
|
514
|
+
* Shows all available variables grouped by category with input fields.
|
|
515
|
+
* User can fill in values and save.
|
|
516
|
+
*/
|
|
517
|
+
declare function VariableFillerDialog({ open, onOpenChange, variables, values, onSave, title, description, }: VariableFillerDialogProps): react_jsx_runtime.JSX.Element;
|
|
518
|
+
|
|
519
|
+
type GetExtensionsOptions = {
|
|
520
|
+
editable?: boolean;
|
|
521
|
+
placeholder?: string;
|
|
522
|
+
/**
|
|
523
|
+
* Enable the control block feature (experimental).
|
|
524
|
+
* @default false
|
|
525
|
+
*/
|
|
526
|
+
enableControls?: boolean;
|
|
527
|
+
/**
|
|
528
|
+
* Resolver for control lookups. Only used when `enableControls` is true.
|
|
529
|
+
*/
|
|
530
|
+
controlResolver?: ControlResolver;
|
|
531
|
+
/**
|
|
532
|
+
* File handler for image uploads. When provided, enables:
|
|
533
|
+
* - Drag & drop images
|
|
534
|
+
* - Paste images
|
|
535
|
+
* - Image display with URL resolution
|
|
536
|
+
*/
|
|
537
|
+
fileHandler?: EditorFileHandler | null;
|
|
538
|
+
/**
|
|
539
|
+
* Enable template variables (e.g., {{companyName}}).
|
|
540
|
+
* Variables can be inserted by typing `{{`.
|
|
541
|
+
* @default false
|
|
542
|
+
*/
|
|
543
|
+
enableVariables?: boolean;
|
|
544
|
+
/**
|
|
545
|
+
* Enable page pagination (A4-like document layout with page breaks).
|
|
546
|
+
* When provided, the Pages extension is configured with these options.
|
|
547
|
+
*/
|
|
548
|
+
pagesOptions?: Partial<PagesOptions>;
|
|
549
|
+
/**
|
|
550
|
+
* Collaboration context from CollaborationProvider.
|
|
551
|
+
* When provided, enables real-time collaborative editing with Yjs.
|
|
552
|
+
* Automatically replaces History with Yjs undo manager.
|
|
553
|
+
* @internal — set automatically by useCreateEditor, not by consumers.
|
|
554
|
+
*/
|
|
555
|
+
collaboration?: CollaborationState | null;
|
|
556
|
+
/**
|
|
557
|
+
* Additional custom extensions to append after the built-in ones.
|
|
558
|
+
* Combine with `disabled` to replace built-in extensions with custom ones.
|
|
559
|
+
*/
|
|
560
|
+
customExtensions?: Extensions;
|
|
561
|
+
/**
|
|
562
|
+
* Disable specific built-in extensions by name.
|
|
563
|
+
*
|
|
564
|
+
* All built-in extensions are **enabled by default**. Set an extension's
|
|
565
|
+
* TipTap name to `false` to exclude it from the editor. Omitted keys
|
|
566
|
+
* (or `undefined`) keep the extension active.
|
|
567
|
+
*
|
|
568
|
+
* Built-in extension names:
|
|
569
|
+
* - Core: `starterKit`, `textAlign`, `selection`, `trailingNode`,
|
|
570
|
+
* `uniqueId`, `uiState`, `placeholder`, `characterCount`, `typography`
|
|
571
|
+
* - Lists: `taskList`, `taskItem`
|
|
572
|
+
* - Text: `textStyleKit`, `highlight`, `superscript`, `subscript`, `link`
|
|
573
|
+
* - Code: `codeKit`
|
|
574
|
+
* - Table: `tableKit`
|
|
575
|
+
* - Blocks: `tableOfContents`, `tableOfContentsNode`, `calloutNode`,
|
|
576
|
+
* `mathBlock`, `inlineMath`, `invisibleCharacters`
|
|
577
|
+
* - Images: `image`, `imageUpload`
|
|
578
|
+
*
|
|
579
|
+
* @example
|
|
580
|
+
* ```ts
|
|
581
|
+
* // Replace the built-in table with a custom one
|
|
582
|
+
* getExtensions({
|
|
583
|
+
* disabled: { tableKit: false },
|
|
584
|
+
* customExtensions: [MyCustomTable],
|
|
585
|
+
* })
|
|
586
|
+
* ```
|
|
587
|
+
*/
|
|
588
|
+
disabled?: Record<string, false>;
|
|
589
|
+
};
|
|
590
|
+
/**
|
|
591
|
+
* getExtensions returns all kopexa used extensions for our editor.
|
|
592
|
+
* this export is important, and should be used in every editor instance even
|
|
593
|
+
* the collaborative one, to ensure that all extensions are registered correctly.
|
|
594
|
+
*/
|
|
595
|
+
declare function getExtensions({ editable, placeholder, enableControls, controlResolver, fileHandler, enableVariables, pagesOptions, collaboration, customExtensions, disabled, }: GetExtensionsOptions): Extensions;
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Tracks the current document visibility state ('visible' | 'hidden').
|
|
599
|
+
* Uses useSyncExternalStore for tear-free reads.
|
|
600
|
+
*/
|
|
601
|
+
declare function useDocumentVisibility(): DocumentVisibilityState;
|
|
602
|
+
|
|
603
|
+
interface UseIdleOptions {
|
|
604
|
+
/** Start as idle. @default false */
|
|
605
|
+
initialState?: boolean;
|
|
606
|
+
}
|
|
607
|
+
interface UseIdleReturn {
|
|
608
|
+
/** Whether the user is currently idle. */
|
|
609
|
+
isIdle: boolean;
|
|
610
|
+
/** Reset the idle timer manually (e.g., on reconnect). */
|
|
611
|
+
resetIdle: () => void;
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Tracks user idle state based on input activity.
|
|
615
|
+
* All event listeners are passive for zero scroll-blocking overhead.
|
|
616
|
+
*
|
|
617
|
+
* @param timeout Milliseconds of inactivity before considered idle.
|
|
618
|
+
* @param options Configuration options.
|
|
619
|
+
*/
|
|
620
|
+
declare function useIdle(timeout: number, options?: UseIdleOptions): UseIdleReturn;
|
|
621
|
+
|
|
622
|
+
type BasicEditorProps = GetExtensionsOptions & EditorBasicVariants & {
|
|
623
|
+
content?: Content | undefined;
|
|
624
|
+
onChange?: (content: JSONContent$1) => void;
|
|
625
|
+
/**
|
|
626
|
+
* This Editor wraps react-intl, if no provider is found in
|
|
627
|
+
* the parent tree, we provide our own <IntlProvider /> with
|
|
628
|
+
* @default en
|
|
629
|
+
*/
|
|
630
|
+
locale?: string;
|
|
631
|
+
/**
|
|
632
|
+
* Available template variables.
|
|
633
|
+
* When provided, enables variable insertion via `{{` trigger.
|
|
634
|
+
*/
|
|
635
|
+
variables?: VariableDefinition[];
|
|
636
|
+
/**
|
|
637
|
+
* Values for template variables.
|
|
638
|
+
* Maps variable names to their resolved values.
|
|
639
|
+
*/
|
|
640
|
+
variableValues?: Record<string, string>;
|
|
641
|
+
/**
|
|
642
|
+
* Whether to show the toolbar.
|
|
643
|
+
* @default true
|
|
644
|
+
*/
|
|
645
|
+
showToolbar?: boolean;
|
|
646
|
+
};
|
|
647
|
+
declare const BasicEditor: ({ variant, bordered, content, variables, variableValues, showToolbar, pagesOptions, ...options }: BasicEditorProps) => react_jsx_runtime.JSX.Element;
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Handles image upload with progress tracking and abort capability
|
|
651
|
+
* @param file The file to upload
|
|
652
|
+
* @param onProgress Optional callback for tracking upload progress
|
|
653
|
+
* @param abortSignal Optional AbortSignal for cancelling the upload
|
|
654
|
+
* @returns Promise resolving to the URL of the uploaded image
|
|
655
|
+
*/
|
|
656
|
+
declare const handleImageUpload: (file: File, onProgress?: (event: {
|
|
657
|
+
progress: number;
|
|
658
|
+
}) => void, abortSignal?: AbortSignal) => Promise<string>;
|
|
659
|
+
/**
|
|
660
|
+
* Converts a File to base64 string
|
|
661
|
+
* @param file The file to convert
|
|
662
|
+
* @param abortSignal Optional AbortSignal for cancelling the conversion
|
|
663
|
+
* @returns Promise resolving to the base64 representation of the file
|
|
664
|
+
*/
|
|
665
|
+
declare const convertFileToBase64: (file: File, abortSignal?: AbortSignal) => Promise<string>;
|
|
666
|
+
type ProtocolOptions = {
|
|
667
|
+
/**
|
|
668
|
+
* The protocol scheme to be registered.
|
|
669
|
+
* @default '''
|
|
670
|
+
* @example 'ftp'
|
|
671
|
+
* @example 'git'
|
|
672
|
+
*/
|
|
673
|
+
scheme: string;
|
|
674
|
+
/**
|
|
675
|
+
* If enabled, it allows optional slashes after the protocol.
|
|
676
|
+
* @default false
|
|
677
|
+
* @example true
|
|
678
|
+
*/
|
|
679
|
+
optionalSlashes?: boolean;
|
|
680
|
+
};
|
|
681
|
+
type ProtocolConfig = Array<ProtocolOptions | string>;
|
|
682
|
+
declare function isAllowedUri(uri: string | undefined, protocols?: ProtocolConfig): true | RegExpMatchArray | null;
|
|
683
|
+
declare function sanitizeUrl(inputUrl: string, baseUrl: string, protocols?: ProtocolConfig): string;
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* Generates a deterministic hex color from a string ID.
|
|
687
|
+
* Uses a simple hash to derive a hue, with fixed saturation (65%)
|
|
688
|
+
* and lightness (55%) for readable cursor colors on white backgrounds.
|
|
689
|
+
*/
|
|
690
|
+
declare function generateColorFromId(id: string): string;
|
|
691
|
+
|
|
692
|
+
export { CalloutNode, type CalloutNodeAttrs, type CalloutVariant, type CollabUser, CollaborationProvider, type CollaborationProviderProps, type CollaborationState, type CollaborationStatus, BasicEditor as Editor, type EditorFileHandler, EditorFileProvider, type EditorFileProviderProps, type GetExtensionsOptions, ImageNode, ImageUploadNode, InlineMath, type InlineMathAttrs, MathBlock, type MathBlockAttrs, type ResolvedCollabUser, TocNode, type VariableDefinition, VariableFillerDialog, type VariableFillerDialogProps, VariableNode, type VariableNodeAttrs, type VariableOptions, VariableProvider, type VariableProviderProps, VariableSuggestion, type VariableSuggestionProps, convertFileToBase64, extractVariablesFromContent, generateColorFromId, getExtensions, handleImageUpload, isAllowedUri, sanitizeUrl, useCollaboration, useCollaborationRequired, useDocumentVisibility, useEditorFile, useEditorFileRequired, useIdle, useVariables, useVariablesWithFallback };
|