@kopexa/tiptap 17.6.18 → 17.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +691 -24
- package/dist/index.d.ts +691 -24
- package/dist/index.js +1478 -786
- package/dist/index.mjs +7987 -112
- package/package.json +57 -52
- package/dist/chunk-2SI7MRAE.mjs +0 -64
- package/dist/chunk-2U5CQUZH.mjs +0 -91
- package/dist/chunk-2UDCL55K.mjs +0 -55
- package/dist/chunk-2V6VOAPI.mjs +0 -139
- package/dist/chunk-2Z2QVW67.mjs +0 -1
- package/dist/chunk-32SUXCAQ.mjs +0 -115
- package/dist/chunk-33QD5PYJ.mjs +0 -63
- package/dist/chunk-3VRQUYYW.mjs +0 -169
- package/dist/chunk-42HKGCOO.mjs +0 -129
- package/dist/chunk-4ALV4UA5.mjs +0 -1
- package/dist/chunk-4CDZ547I.mjs +0 -185
- package/dist/chunk-4HO7BWDC.mjs +0 -89
- package/dist/chunk-4JRYQZ4A.mjs +0 -174
- package/dist/chunk-552JLRNB.mjs +0 -35
- package/dist/chunk-5SMDMQDF.mjs +0 -34
- package/dist/chunk-6552DQWB.mjs +0 -416
- package/dist/chunk-7FDDRVUE.mjs +0 -143
- package/dist/chunk-7VGROP26.mjs +0 -262
- package/dist/chunk-7VW67NVL.mjs +0 -80
- package/dist/chunk-AAV7ZNBP.mjs +0 -83
- package/dist/chunk-ATRHILCH.mjs +0 -1
- package/dist/chunk-B7WJOQ3X.mjs +0 -103
- package/dist/chunk-BEV5U2DK.mjs +0 -131
- package/dist/chunk-BXHPO3T7.mjs +0 -152
- package/dist/chunk-BXJYNSWQ.mjs +0 -30
- package/dist/chunk-C5RQWJKE.mjs +0 -155
- package/dist/chunk-CNVACBGT.mjs +0 -51
- package/dist/chunk-DQK6PA4U.mjs +0 -276
- package/dist/chunk-DSBJFMHK.mjs +0 -38
- package/dist/chunk-DT7ML2P4.mjs +0 -42
- package/dist/chunk-DZLGLP7R.mjs +0 -99
- package/dist/chunk-EAAQE5ZV.mjs +0 -283
- package/dist/chunk-EHY2NAW7.mjs +0 -120
- package/dist/chunk-EIIWU5FR.mjs +0 -61
- package/dist/chunk-ERPGWXFK.mjs +0 -163
- package/dist/chunk-F73FCUD5.mjs +0 -1
- package/dist/chunk-FRJX2F4T.mjs +0 -55
- package/dist/chunk-GYIYX2JH.mjs +0 -73
- package/dist/chunk-H6LC4LDQ.mjs +0 -63
- package/dist/chunk-H7MS2UMO.mjs +0 -168
- package/dist/chunk-HLLA2HRV.mjs +0 -1
- package/dist/chunk-HTJ2RXOG.mjs +0 -32
- package/dist/chunk-IFXRPGIJ.mjs +0 -98
- package/dist/chunk-IOB3REX6.mjs +0 -173
- package/dist/chunk-IQERE7KP.mjs +0 -115
- package/dist/chunk-JCV5SEKN.mjs +0 -65
- package/dist/chunk-JVSH5T4B.mjs +0 -72
- package/dist/chunk-KK4K43WM.mjs +0 -59
- package/dist/chunk-KR42JAVB.mjs +0 -60
- package/dist/chunk-KYLBKQ2E.mjs +0 -203
- package/dist/chunk-L5RDMV3H.mjs +0 -216
- package/dist/chunk-LNVWG34E.mjs +0 -165
- package/dist/chunk-LVNUU67N.mjs +0 -1
- package/dist/chunk-MNTOOEHA.mjs +0 -1
- package/dist/chunk-N3JE67CS.mjs +0 -81
- package/dist/chunk-N4CT5RNC.mjs +0 -123
- package/dist/chunk-OEVR5N7X.mjs +0 -65
- package/dist/chunk-P55PLOHR.mjs +0 -34
- package/dist/chunk-Q5FK7SFY.mjs +0 -75
- package/dist/chunk-Q7DFJ5NI.mjs +0 -153
- package/dist/chunk-QIELBKP3.mjs +0 -104
- package/dist/chunk-R2GM4A3T.mjs +0 -71
- package/dist/chunk-REJEJXOZ.mjs +0 -10
- package/dist/chunk-RFWNKE7D.mjs +0 -238
- package/dist/chunk-TAM3VMJT.mjs +0 -80
- package/dist/chunk-TDFS3DCZ.mjs +0 -79
- package/dist/chunk-TLM5ALHZ.mjs +0 -1
- package/dist/chunk-TZQQ6C2Q.mjs +0 -101
- package/dist/chunk-U5XAL46P.mjs +0 -39
- package/dist/chunk-UJ4BNZ63.mjs +0 -178
- package/dist/chunk-UVHVCION.mjs +0 -168
- package/dist/chunk-V6TAZMQN.mjs +0 -105
- package/dist/chunk-VF3G2URZ.mjs +0 -83
- package/dist/chunk-VRQ6OSAZ.mjs +0 -76
- package/dist/chunk-VTKJPVNM.mjs +0 -148
- package/dist/chunk-VX3HSJ76.mjs +0 -73
- package/dist/chunk-W2FLOOJ6.mjs +0 -75
- package/dist/chunk-XGAABDMW.mjs +0 -159
- package/dist/chunk-Y2KSWMG5.mjs +0 -1
- package/dist/chunk-YJAHZXLG.mjs +0 -92
- package/dist/chunk-Z365KVQY.mjs +0 -34
- package/dist/chunk-ZVTJ6XD7.mjs +0 -88
- package/dist/chunk-ZZ4OU46C.mjs +0 -131
- package/dist/context/editor-context.d.mts +0 -10
- package/dist/context/editor-context.d.ts +0 -10
- package/dist/context/editor-context.js +0 -34
- package/dist/context/editor-context.mjs +0 -9
- package/dist/context/editor-file-context.d.mts +0 -70
- package/dist/context/editor-file-context.d.ts +0 -70
- package/dist/context/editor-file-context.js +0 -96
- package/dist/context/editor-file-context.mjs +0 -12
- package/dist/extensions/callout/callout-settings.d.mts +0 -13
- package/dist/extensions/callout/callout-settings.d.ts +0 -13
- package/dist/extensions/callout/callout-settings.js +0 -206
- package/dist/extensions/callout/callout-settings.mjs +0 -9
- package/dist/extensions/callout/callout-view.d.mts +0 -12
- package/dist/extensions/callout/callout-view.d.ts +0 -12
- package/dist/extensions/callout/callout-view.js +0 -273
- package/dist/extensions/callout/callout-view.mjs +0 -12
- package/dist/extensions/callout/index.d.mts +0 -44
- package/dist/extensions/callout/index.d.ts +0 -44
- package/dist/extensions/callout/index.js +0 -380
- package/dist/extensions/callout/index.mjs +0 -13
- package/dist/extensions/callout/messages.d.mts +0 -59
- package/dist/extensions/callout/messages.d.ts +0 -59
- package/dist/extensions/callout/messages.js +0 -88
- package/dist/extensions/callout/messages.mjs +0 -7
- package/dist/extensions/image/image-view.d.mts +0 -15
- package/dist/extensions/image/image-view.d.ts +0 -15
- package/dist/extensions/image/image-view.js +0 -255
- package/dist/extensions/image/image-view.mjs +0 -12
- package/dist/extensions/image/index.d.mts +0 -29
- package/dist/extensions/image/index.d.ts +0 -29
- package/dist/extensions/image/index.js +0 -282
- package/dist/extensions/image/index.mjs +0 -16
- package/dist/extensions/image/messages.d.mts +0 -28
- package/dist/extensions/image/messages.d.ts +0 -28
- package/dist/extensions/image/messages.js +0 -57
- package/dist/extensions/image/messages.mjs +0 -7
- package/dist/extensions/image-upload/image-upload-view.d.mts +0 -12
- package/dist/extensions/image-upload/image-upload-view.d.ts +0 -12
- package/dist/extensions/image-upload/image-upload-view.js +0 -338
- package/dist/extensions/image-upload/image-upload-view.mjs +0 -12
- package/dist/extensions/image-upload/index.d.mts +0 -46
- package/dist/extensions/image-upload/index.d.ts +0 -46
- package/dist/extensions/image-upload/index.js +0 -414
- package/dist/extensions/image-upload/index.mjs +0 -16
- package/dist/extensions/image-upload/messages.d.mts +0 -32
- package/dist/extensions/image-upload/messages.d.ts +0 -32
- package/dist/extensions/image-upload/messages.js +0 -61
- package/dist/extensions/image-upload/messages.mjs +0 -7
- package/dist/extensions/link/index.d.mts +0 -6
- package/dist/extensions/link/index.d.ts +0 -6
- package/dist/extensions/link/index.js +0 -94
- package/dist/extensions/link/index.mjs +0 -7
- package/dist/extensions/math/index.d.mts +0 -38
- package/dist/extensions/math/index.d.ts +0 -38
- package/dist/extensions/math/index.js +0 -544
- package/dist/extensions/math/index.mjs +0 -17
- package/dist/extensions/math/inline-math-view.d.mts +0 -12
- package/dist/extensions/math/inline-math-view.d.ts +0 -12
- package/dist/extensions/math/inline-math-view.js +0 -232
- package/dist/extensions/math/inline-math-view.mjs +0 -11
- package/dist/extensions/math/inline-math.d.mts +0 -32
- package/dist/extensions/math/inline-math.d.ts +0 -32
- package/dist/extensions/math/inline-math.js +0 -304
- package/dist/extensions/math/inline-math.mjs +0 -12
- package/dist/extensions/math/math-block-view.d.mts +0 -11
- package/dist/extensions/math/math-block-view.d.ts +0 -11
- package/dist/extensions/math/math-block-view.js +0 -248
- package/dist/extensions/math/math-block-view.mjs +0 -11
- package/dist/extensions/math/messages.d.mts +0 -49
- package/dist/extensions/math/messages.d.ts +0 -49
- package/dist/extensions/math/messages.js +0 -78
- package/dist/extensions/math/messages.mjs +0 -7
- package/dist/extensions/selection/index.d.mts +0 -5
- package/dist/extensions/selection/index.d.ts +0 -5
- package/dist/extensions/selection/index.js +0 -62
- package/dist/extensions/selection/index.mjs +0 -7
- package/dist/extensions/toc/index.d.mts +0 -53
- package/dist/extensions/toc/index.d.ts +0 -53
- package/dist/extensions/toc/index.js +0 -501
- package/dist/extensions/toc/index.mjs +0 -13
- package/dist/extensions/toc/messages.d.mts +0 -74
- package/dist/extensions/toc/messages.d.ts +0 -74
- package/dist/extensions/toc/messages.js +0 -103
- package/dist/extensions/toc/messages.mjs +0 -7
- package/dist/extensions/toc/toc-settings.d.mts +0 -13
- package/dist/extensions/toc/toc-settings.d.ts +0 -13
- package/dist/extensions/toc/toc-settings.js +0 -283
- package/dist/extensions/toc/toc-settings.mjs +0 -9
- package/dist/extensions/toc/toc-view.d.mts +0 -12
- package/dist/extensions/toc/toc-view.d.ts +0 -12
- package/dist/extensions/toc/toc-view.js +0 -411
- package/dist/extensions/toc/toc-view.mjs +0 -12
- package/dist/extensions/trailing-node/index.d.mts +0 -9
- package/dist/extensions/trailing-node/index.d.ts +0 -9
- package/dist/extensions/trailing-node/index.js +0 -86
- package/dist/extensions/trailing-node/index.mjs +0 -7
- package/dist/extensions/ui-state/index.d.mts +0 -34
- package/dist/extensions/ui-state/index.d.ts +0 -34
- package/dist/extensions/ui-state/index.js +0 -84
- package/dist/extensions/ui-state/index.mjs +0 -9
- package/dist/extensions/variable/extract-variables.d.mts +0 -16
- package/dist/extensions/variable/extract-variables.d.ts +0 -16
- package/dist/extensions/variable/extract-variables.js +0 -58
- package/dist/extensions/variable/extract-variables.mjs +0 -7
- package/dist/extensions/variable/index.d.mts +0 -38
- package/dist/extensions/variable/index.d.ts +0 -38
- package/dist/extensions/variable/index.js +0 -190
- package/dist/extensions/variable/index.mjs +0 -11
- package/dist/extensions/variable/messages.d.mts +0 -69
- package/dist/extensions/variable/messages.d.ts +0 -69
- package/dist/extensions/variable/messages.js +0 -98
- package/dist/extensions/variable/messages.mjs +0 -7
- package/dist/extensions/variable/variable-context.d.mts +0 -56
- package/dist/extensions/variable/variable-context.d.ts +0 -56
- package/dist/extensions/variable/variable-context.js +0 -70
- package/dist/extensions/variable/variable-context.mjs +0 -12
- package/dist/extensions/variable/variable-filler-dialog.d.mts +0 -43
- package/dist/extensions/variable/variable-filler-dialog.d.ts +0 -43
- package/dist/extensions/variable/variable-filler-dialog.js +0 -207
- package/dist/extensions/variable/variable-filler-dialog.mjs +0 -9
- package/dist/extensions/variable/variable-suggestion.d.mts +0 -31
- package/dist/extensions/variable/variable-suggestion.d.ts +0 -31
- package/dist/extensions/variable/variable-suggestion.js +0 -615
- package/dist/extensions/variable/variable-suggestion.mjs +0 -14
- package/dist/extensions/variable/variable-view.d.mts +0 -13
- package/dist/extensions/variable/variable-view.d.ts +0 -13
- package/dist/extensions/variable/variable-view.js +0 -110
- package/dist/extensions/variable/variable-view.mjs +0 -11
- package/dist/hooks/use-create-editor.d.mts +0 -46
- package/dist/hooks/use-create-editor.d.ts +0 -46
- package/dist/hooks/use-create-editor.js +0 -2726
- package/dist/hooks/use-create-editor.mjs +0 -37
- package/dist/hooks/use-cursor-visibility.d.mts +0 -37
- package/dist/hooks/use-cursor-visibility.d.ts +0 -37
- package/dist/hooks/use-cursor-visibility.js +0 -140
- package/dist/hooks/use-cursor-visibility.mjs +0 -8
- package/dist/hooks/use-floating-element.d.mts +0 -43
- package/dist/hooks/use-floating-element.d.ts +0 -43
- package/dist/hooks/use-floating-element.js +0 -88
- package/dist/hooks/use-floating-element.mjs +0 -8
- package/dist/hooks/use-floating-toolbar-visibility.d.mts +0 -32
- package/dist/hooks/use-floating-toolbar-visibility.d.ts +0 -32
- package/dist/hooks/use-floating-toolbar-visibility.js +0 -115
- package/dist/hooks/use-floating-toolbar-visibility.mjs +0 -13
- package/dist/hooks/use-menu-navigation.d.mts +0 -55
- package/dist/hooks/use-menu-navigation.d.ts +0 -55
- package/dist/hooks/use-menu-navigation.js +0 -163
- package/dist/hooks/use-menu-navigation.mjs +0 -8
- package/dist/hooks/use-tiptap-editor.d.mts +0 -20
- package/dist/hooks/use-tiptap-editor.d.ts +0 -20
- package/dist/hooks/use-tiptap-editor.js +0 -58
- package/dist/hooks/use-tiptap-editor.mjs +0 -8
- package/dist/hooks/use-ui-editor-state.d.mts +0 -7
- package/dist/hooks/use-ui-editor-state.d.ts +0 -7
- package/dist/hooks/use-ui-editor-state.js +0 -107
- package/dist/hooks/use-ui-editor-state.mjs +0 -11
- package/dist/hooks/use-window-size.d.mts +0 -12
- package/dist/hooks/use-window-size.d.ts +0 -12
- package/dist/hooks/use-window-size.js +0 -75
- package/dist/hooks/use-window-size.mjs +0 -7
- package/dist/presets/basic/editor-header.d.mts +0 -23
- package/dist/presets/basic/editor-header.d.ts +0 -23
- package/dist/presets/basic/editor-header.js +0 -2750
- package/dist/presets/basic/editor-header.mjs +0 -43
- package/dist/presets/basic/index.d.mts +0 -38
- package/dist/presets/basic/index.d.ts +0 -38
- package/dist/presets/basic/index.js +0 -6891
- package/dist/presets/basic/index.mjs +0 -85
- package/dist/ui/blockquote-button/blockquote-button.d.mts +0 -20
- package/dist/ui/blockquote-button/blockquote-button.d.ts +0 -20
- package/dist/ui/blockquote-button/blockquote-button.js +0 -247
- package/dist/ui/blockquote-button/blockquote-button.mjs +0 -9
- package/dist/ui/blockquote-button/index.d.mts +0 -6
- package/dist/ui/blockquote-button/index.d.ts +0 -6
- package/dist/ui/blockquote-button/index.js +0 -259
- package/dist/ui/blockquote-button/index.mjs +0 -21
- package/dist/ui/blockquote-button/use-blockquote.d.mts +0 -85
- package/dist/ui/blockquote-button/use-blockquote.d.ts +0 -85
- package/dist/ui/blockquote-button/use-blockquote.js +0 -192
- package/dist/ui/blockquote-button/use-blockquote.mjs +0 -17
- package/dist/ui/bubble-menu/index.d.mts +0 -13
- package/dist/ui/bubble-menu/index.d.ts +0 -13
- package/dist/ui/bubble-menu/index.js +0 -673
- package/dist/ui/bubble-menu/index.mjs +0 -16
- package/dist/ui/codeblock-button/code-block-button.d.mts +0 -20
- package/dist/ui/codeblock-button/code-block-button.d.ts +0 -20
- package/dist/ui/codeblock-button/code-block-button.js +0 -237
- package/dist/ui/codeblock-button/code-block-button.mjs +0 -9
- package/dist/ui/codeblock-button/index.d.mts +0 -6
- package/dist/ui/codeblock-button/index.d.ts +0 -6
- package/dist/ui/codeblock-button/index.js +0 -249
- package/dist/ui/codeblock-button/index.mjs +0 -21
- package/dist/ui/codeblock-button/use-code-block.d.mts +0 -92
- package/dist/ui/codeblock-button/use-code-block.d.ts +0 -92
- package/dist/ui/codeblock-button/use-code-block.js +0 -192
- package/dist/ui/codeblock-button/use-code-block.mjs +0 -17
- package/dist/ui/color-highlight-button/color-highlight-button.d.mts +0 -25
- package/dist/ui/color-highlight-button/color-highlight-button.d.ts +0 -25
- package/dist/ui/color-highlight-button/color-highlight-button.js +0 -266
- package/dist/ui/color-highlight-button/color-highlight-button.mjs +0 -9
- package/dist/ui/color-highlight-button/index.d.mts +0 -6
- package/dist/ui/color-highlight-button/index.d.ts +0 -6
- package/dist/ui/color-highlight-button/index.js +0 -342
- package/dist/ui/color-highlight-button/index.mjs +0 -27
- package/dist/ui/color-highlight-button/use-color-highlight.d.mts +0 -64
- package/dist/ui/color-highlight-button/use-color-highlight.d.ts +0 -64
- package/dist/ui/color-highlight-button/use-color-highlight.js +0 -247
- package/dist/ui/color-highlight-button/use-color-highlight.mjs +0 -23
- package/dist/ui/color-highlight-popover/color-highlight-popover.d.mts +0 -29
- package/dist/ui/color-highlight-popover/color-highlight-popover.d.ts +0 -29
- package/dist/ui/color-highlight-popover/color-highlight-popover.js +0 -590
- package/dist/ui/color-highlight-popover/color-highlight-popover.mjs +0 -17
- package/dist/ui/color-highlight-popover/index.d.mts +0 -6
- package/dist/ui/color-highlight-popover/index.d.ts +0 -6
- package/dist/ui/color-highlight-popover/index.js +0 -591
- package/dist/ui/color-highlight-popover/index.mjs +0 -17
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.d.mts +0 -30
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.d.ts +0 -30
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.js +0 -171
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.mjs +0 -10
- package/dist/ui/heading-button/index.d.mts +0 -45
- package/dist/ui/heading-button/index.d.ts +0 -45
- package/dist/ui/heading-button/index.js +0 -222
- package/dist/ui/heading-button/index.mjs +0 -16
- package/dist/ui/heading-button/utils.d.mts +0 -17
- package/dist/ui/heading-button/utils.d.ts +0 -17
- package/dist/ui/heading-button/utils.js +0 -92
- package/dist/ui/heading-button/utils.mjs +0 -19
- package/dist/ui/heading-dropdown-menu/index.d.mts +0 -14
- package/dist/ui/heading-dropdown-menu/index.d.ts +0 -14
- package/dist/ui/heading-dropdown-menu/index.js +0 -308
- package/dist/ui/heading-dropdown-menu/index.mjs +0 -10
- package/dist/ui/link-bubble/index.d.mts +0 -13
- package/dist/ui/link-bubble/index.d.ts +0 -13
- package/dist/ui/link-bubble/index.js +0 -183
- package/dist/ui/link-bubble/index.mjs +0 -10
- package/dist/ui/link-popover/index.d.mts +0 -7
- package/dist/ui/link-popover/index.d.ts +0 -7
- package/dist/ui/link-popover/index.js +0 -512
- package/dist/ui/link-popover/index.mjs +0 -30
- package/dist/ui/link-popover/link-popover.d.mts +0 -85
- package/dist/ui/link-popover/link-popover.d.ts +0 -85
- package/dist/ui/link-popover/link-popover.js +0 -498
- package/dist/ui/link-popover/link-popover.mjs +0 -16
- package/dist/ui/link-popover/use-link-popover.d.mts +0 -123
- package/dist/ui/link-popover/use-link-popover.d.ts +0 -123
- package/dist/ui/link-popover/use-link-popover.js +0 -259
- package/dist/ui/link-popover/use-link-popover.mjs +0 -20
- package/dist/ui/list-button/index.d.mts +0 -50
- package/dist/ui/list-button/index.d.ts +0 -50
- package/dist/ui/list-button/index.js +0 -232
- package/dist/ui/list-button/index.mjs +0 -24
- package/dist/ui/list-dropdown-menu/index.d.mts +0 -45
- package/dist/ui/list-dropdown-menu/index.d.ts +0 -45
- package/dist/ui/list-dropdown-menu/index.js +0 -361
- package/dist/ui/list-dropdown-menu/index.mjs +0 -21
- package/dist/ui/mark-button/index.d.mts +0 -59
- package/dist/ui/mark-button/index.d.ts +0 -59
- package/dist/ui/mark-button/index.js +0 -217
- package/dist/ui/mark-button/index.mjs +0 -26
- package/dist/ui/reset-all-formatting-button/index.d.mts +0 -7
- package/dist/ui/reset-all-formatting-button/index.d.ts +0 -7
- package/dist/ui/reset-all-formatting-button/index.js +0 -286
- package/dist/ui/reset-all-formatting-button/index.mjs +0 -26
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.d.mts +0 -30
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.d.ts +0 -30
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.js +0 -271
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.mjs +0 -12
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.d.mts +0 -103
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.d.ts +0 -103
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.js +0 -211
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.mjs +0 -21
- package/dist/ui/slash-dropdown-menu/index.d.mts +0 -10
- package/dist/ui/slash-dropdown-menu/index.d.ts +0 -10
- package/dist/ui/slash-dropdown-menu/index.js +0 -1056
- package/dist/ui/slash-dropdown-menu/index.mjs +0 -19
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.d.mts +0 -16
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.d.ts +0 -16
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.js +0 -1053
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.mjs +0 -16
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.d.mts +0 -162
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.d.ts +0 -162
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.js +0 -457
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.mjs +0 -10
- package/dist/ui/suggestion-menu/index.d.mts +0 -10
- package/dist/ui/suggestion-menu/index.d.ts +0 -10
- package/dist/ui/suggestion-menu/index.js +0 -489
- package/dist/ui/suggestion-menu/index.mjs +0 -17
- package/dist/ui/suggestion-menu/suggestion-menu-types.d.mts +0 -89
- package/dist/ui/suggestion-menu/suggestion-menu-types.d.ts +0 -89
- package/dist/ui/suggestion-menu/suggestion-menu-types.js +0 -19
- package/dist/ui/suggestion-menu/suggestion-menu-types.mjs +0 -1
- package/dist/ui/suggestion-menu/suggestion-menu-utils.d.mts +0 -27
- package/dist/ui/suggestion-menu/suggestion-menu-utils.d.ts +0 -27
- package/dist/ui/suggestion-menu/suggestion-menu-utils.js +0 -75
- package/dist/ui/suggestion-menu/suggestion-menu-utils.mjs +0 -9
- package/dist/ui/suggestion-menu/suggestion-menu.d.mts +0 -15
- package/dist/ui/suggestion-menu/suggestion-menu.d.ts +0 -15
- package/dist/ui/suggestion-menu/suggestion-menu.js +0 -453
- package/dist/ui/suggestion-menu/suggestion-menu.mjs +0 -12
- package/dist/ui/table-button/index.d.mts +0 -15
- package/dist/ui/table-button/index.d.ts +0 -15
- package/dist/ui/table-button/index.js +0 -202
- package/dist/ui/table-button/index.mjs +0 -9
- package/dist/ui/table-button/use-table.d.mts +0 -51
- package/dist/ui/table-button/use-table.d.ts +0 -51
- package/dist/ui/table-button/use-table.js +0 -146
- package/dist/ui/table-button/use-table.mjs +0 -14
- package/dist/ui/text-align-button/index.d.mts +0 -6
- package/dist/ui/text-align-button/index.d.ts +0 -6
- package/dist/ui/text-align-button/index.js +0 -235
- package/dist/ui/text-align-button/index.mjs +0 -29
- package/dist/ui/text-align-button/text-align-button.d.mts +0 -20
- package/dist/ui/text-align-button/text-align-button.d.ts +0 -20
- package/dist/ui/text-align-button/text-align-button.js +0 -215
- package/dist/ui/text-align-button/text-align-button.mjs +0 -9
- package/dist/ui/text-align-button/use-text-align.d.mts +0 -106
- package/dist/ui/text-align-button/use-text-align.d.ts +0 -106
- package/dist/ui/text-align-button/use-text-align.js +0 -169
- package/dist/ui/text-align-button/use-text-align.mjs +0 -24
- package/dist/ui/undo-redo-button/index.d.mts +0 -6
- package/dist/ui/undo-redo-button/index.d.ts +0 -6
- package/dist/ui/undo-redo-button/index.js +0 -202
- package/dist/ui/undo-redo-button/index.mjs +0 -25
- package/dist/ui/undo-redo-button/undo-redo-button.d.mts +0 -23
- package/dist/ui/undo-redo-button/undo-redo-button.d.ts +0 -23
- package/dist/ui/undo-redo-button/undo-redo-button.js +0 -187
- package/dist/ui/undo-redo-button/undo-redo-button.mjs +0 -10
- package/dist/ui/undo-redo-button/use-undo-redo.d.mts +0 -95
- package/dist/ui/undo-redo-button/use-undo-redo.d.ts +0 -95
- package/dist/ui/undo-redo-button/use-undo-redo.js +0 -146
- package/dist/ui/undo-redo-button/use-undo-redo.mjs +0 -21
- package/dist/utils/index.d.mts +0 -38
- package/dist/utils/index.d.ts +0 -38
- package/dist/utils/index.js +0 -128
- package/dist/utils/index.mjs +0 -15
- package/dist/utils/safe-parse.d.mts +0 -14
- package/dist/utils/safe-parse.d.ts +0 -14
- package/dist/utils/safe-parse.js +0 -203
- package/dist/utils/safe-parse.mjs +0 -8
|
@@ -1,615 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
"use client";
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __export = (target, all) => {
|
|
11
|
-
for (var name in all)
|
|
12
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
-
};
|
|
14
|
-
var __copyProps = (to, from, except, desc) => {
|
|
15
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
-
for (let key of __getOwnPropNames(from))
|
|
17
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
-
mod
|
|
29
|
-
));
|
|
30
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
-
|
|
32
|
-
// src/extensions/variable/variable-suggestion.tsx
|
|
33
|
-
var variable_suggestion_exports = {};
|
|
34
|
-
__export(variable_suggestion_exports, {
|
|
35
|
-
VariableSuggestion: () => VariableSuggestion
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(variable_suggestion_exports);
|
|
38
|
-
var import_editor_utils = require("@kopexa/editor-utils");
|
|
39
|
-
var import_theme = require("@kopexa/theme");
|
|
40
|
-
var import_state2 = require("@tiptap/pm/state");
|
|
41
|
-
var React4 = __toESM(require("react"));
|
|
42
|
-
|
|
43
|
-
// src/ui/suggestion-menu/suggestion-menu.tsx
|
|
44
|
-
var import_react4 = require("@floating-ui/react");
|
|
45
|
-
var import_state = require("@tiptap/pm/state");
|
|
46
|
-
var import_suggestion = require("@tiptap/suggestion");
|
|
47
|
-
var React3 = __toESM(require("react"));
|
|
48
|
-
|
|
49
|
-
// src/hooks/use-floating-element.ts
|
|
50
|
-
var import_react = require("@floating-ui/react");
|
|
51
|
-
var React = __toESM(require("react"));
|
|
52
|
-
function useFloatingElement(show, referencePos, zIndex, options) {
|
|
53
|
-
const { dismissOptions, ...floatingOptions } = options || {};
|
|
54
|
-
const { refs, update, context, floatingStyles } = (0, import_react.useFloating)({
|
|
55
|
-
open: show,
|
|
56
|
-
...floatingOptions
|
|
57
|
-
});
|
|
58
|
-
const { isMounted, styles } = (0, import_react.useTransitionStyles)(context);
|
|
59
|
-
const dismiss = (0, import_react.useDismiss)(context, dismissOptions);
|
|
60
|
-
const { getReferenceProps, getFloatingProps } = (0, import_react.useInteractions)([dismiss]);
|
|
61
|
-
React.useEffect(() => {
|
|
62
|
-
update();
|
|
63
|
-
}, [referencePos, update]);
|
|
64
|
-
React.useEffect(() => {
|
|
65
|
-
if (referencePos === null) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
refs.setReference({
|
|
69
|
-
getBoundingClientRect: () => referencePos
|
|
70
|
-
});
|
|
71
|
-
}, [referencePos, refs]);
|
|
72
|
-
return React.useMemo(
|
|
73
|
-
() => ({
|
|
74
|
-
isMounted,
|
|
75
|
-
ref: refs.setFloating,
|
|
76
|
-
style: {
|
|
77
|
-
...styles,
|
|
78
|
-
...floatingStyles,
|
|
79
|
-
zIndex
|
|
80
|
-
},
|
|
81
|
-
update,
|
|
82
|
-
getFloatingProps,
|
|
83
|
-
getReferenceProps
|
|
84
|
-
}),
|
|
85
|
-
[
|
|
86
|
-
floatingStyles,
|
|
87
|
-
isMounted,
|
|
88
|
-
refs.setFloating,
|
|
89
|
-
styles,
|
|
90
|
-
update,
|
|
91
|
-
zIndex,
|
|
92
|
-
getFloatingProps,
|
|
93
|
-
getReferenceProps
|
|
94
|
-
]
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// src/hooks/use-menu-navigation.ts
|
|
99
|
-
var React2 = __toESM(require("react"));
|
|
100
|
-
function useMenuNavigation({
|
|
101
|
-
editor,
|
|
102
|
-
containerRef,
|
|
103
|
-
query,
|
|
104
|
-
items,
|
|
105
|
-
onSelect,
|
|
106
|
-
onClose,
|
|
107
|
-
orientation = "vertical",
|
|
108
|
-
autoSelectFirstItem = true
|
|
109
|
-
}) {
|
|
110
|
-
const [selectedIndex, setSelectedIndex] = React2.useState(
|
|
111
|
-
autoSelectFirstItem ? 0 : -1
|
|
112
|
-
);
|
|
113
|
-
React2.useEffect(() => {
|
|
114
|
-
const handleKeyboardNavigation = (event) => {
|
|
115
|
-
if (!items.length) return false;
|
|
116
|
-
const moveNext = () => setSelectedIndex((currentIndex) => {
|
|
117
|
-
if (currentIndex === -1) return 0;
|
|
118
|
-
return (currentIndex + 1) % items.length;
|
|
119
|
-
});
|
|
120
|
-
const movePrev = () => setSelectedIndex((currentIndex) => {
|
|
121
|
-
if (currentIndex === -1) return items.length - 1;
|
|
122
|
-
return (currentIndex - 1 + items.length) % items.length;
|
|
123
|
-
});
|
|
124
|
-
switch (event.key) {
|
|
125
|
-
case "ArrowUp": {
|
|
126
|
-
if (orientation === "horizontal") return false;
|
|
127
|
-
event.preventDefault();
|
|
128
|
-
movePrev();
|
|
129
|
-
return true;
|
|
130
|
-
}
|
|
131
|
-
case "ArrowDown": {
|
|
132
|
-
if (orientation === "horizontal") return false;
|
|
133
|
-
event.preventDefault();
|
|
134
|
-
moveNext();
|
|
135
|
-
return true;
|
|
136
|
-
}
|
|
137
|
-
case "ArrowLeft": {
|
|
138
|
-
if (orientation === "vertical") return false;
|
|
139
|
-
event.preventDefault();
|
|
140
|
-
movePrev();
|
|
141
|
-
return true;
|
|
142
|
-
}
|
|
143
|
-
case "ArrowRight": {
|
|
144
|
-
if (orientation === "vertical") return false;
|
|
145
|
-
event.preventDefault();
|
|
146
|
-
moveNext();
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
case "Tab": {
|
|
150
|
-
event.preventDefault();
|
|
151
|
-
if (event.shiftKey) {
|
|
152
|
-
movePrev();
|
|
153
|
-
} else {
|
|
154
|
-
moveNext();
|
|
155
|
-
}
|
|
156
|
-
return true;
|
|
157
|
-
}
|
|
158
|
-
case "Home": {
|
|
159
|
-
event.preventDefault();
|
|
160
|
-
setSelectedIndex(0);
|
|
161
|
-
return true;
|
|
162
|
-
}
|
|
163
|
-
case "End": {
|
|
164
|
-
event.preventDefault();
|
|
165
|
-
setSelectedIndex(items.length - 1);
|
|
166
|
-
return true;
|
|
167
|
-
}
|
|
168
|
-
case "Enter": {
|
|
169
|
-
if (event.isComposing) return false;
|
|
170
|
-
event.preventDefault();
|
|
171
|
-
if (selectedIndex !== -1 && items[selectedIndex]) {
|
|
172
|
-
onSelect == null ? void 0 : onSelect(items[selectedIndex]);
|
|
173
|
-
}
|
|
174
|
-
return true;
|
|
175
|
-
}
|
|
176
|
-
case "Escape": {
|
|
177
|
-
event.preventDefault();
|
|
178
|
-
onClose == null ? void 0 : onClose();
|
|
179
|
-
return true;
|
|
180
|
-
}
|
|
181
|
-
default:
|
|
182
|
-
return false;
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
let targetElement = null;
|
|
186
|
-
if (editor) {
|
|
187
|
-
targetElement = editor.view.dom;
|
|
188
|
-
} else if (containerRef == null ? void 0 : containerRef.current) {
|
|
189
|
-
targetElement = containerRef.current;
|
|
190
|
-
}
|
|
191
|
-
if (targetElement) {
|
|
192
|
-
targetElement.addEventListener("keydown", handleKeyboardNavigation, true);
|
|
193
|
-
return () => {
|
|
194
|
-
targetElement == null ? void 0 : targetElement.removeEventListener(
|
|
195
|
-
"keydown",
|
|
196
|
-
handleKeyboardNavigation,
|
|
197
|
-
true
|
|
198
|
-
);
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
return void 0;
|
|
202
|
-
}, [
|
|
203
|
-
editor,
|
|
204
|
-
containerRef,
|
|
205
|
-
items,
|
|
206
|
-
selectedIndex,
|
|
207
|
-
onSelect,
|
|
208
|
-
onClose,
|
|
209
|
-
orientation
|
|
210
|
-
]);
|
|
211
|
-
React2.useEffect(() => {
|
|
212
|
-
if (query) {
|
|
213
|
-
setSelectedIndex(autoSelectFirstItem ? 0 : -1);
|
|
214
|
-
}
|
|
215
|
-
}, [query, autoSelectFirstItem]);
|
|
216
|
-
return {
|
|
217
|
-
selectedIndex: items.length ? selectedIndex : void 0,
|
|
218
|
-
setSelectedIndex
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// src/hooks/use-tiptap-editor.ts
|
|
223
|
-
var import_react2 = require("@tiptap/react");
|
|
224
|
-
var import_react3 = require("react");
|
|
225
|
-
function useTiptapEditor(providedEditor) {
|
|
226
|
-
const { editor: coreEditor } = (0, import_react2.useCurrentEditor)();
|
|
227
|
-
const mainEditor = (0, import_react3.useMemo)(
|
|
228
|
-
() => providedEditor || coreEditor,
|
|
229
|
-
[providedEditor, coreEditor]
|
|
230
|
-
);
|
|
231
|
-
const editorState = (0, import_react2.useEditorState)({
|
|
232
|
-
editor: mainEditor,
|
|
233
|
-
selector(context) {
|
|
234
|
-
if (!context.editor) {
|
|
235
|
-
return {
|
|
236
|
-
editor: null,
|
|
237
|
-
editorState: void 0,
|
|
238
|
-
canCommand: void 0
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
return {
|
|
242
|
-
editor: context.editor,
|
|
243
|
-
editorState: context.editor.state,
|
|
244
|
-
canCommand: context.editor.can
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
return editorState || { editor: null };
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// src/ui/suggestion-menu/suggestion-menu-utils.ts
|
|
252
|
-
function calculateStartPosition(cursorPosition, previousNode, triggerChar) {
|
|
253
|
-
if (!(previousNode == null ? void 0 : previousNode.text) || !triggerChar) {
|
|
254
|
-
return cursorPosition;
|
|
255
|
-
}
|
|
256
|
-
const commandText = previousNode.text;
|
|
257
|
-
const triggerCharIndex = commandText.lastIndexOf(triggerChar);
|
|
258
|
-
if (triggerCharIndex === -1) {
|
|
259
|
-
return cursorPosition;
|
|
260
|
-
}
|
|
261
|
-
const textLength = commandText.substring(triggerCharIndex).length;
|
|
262
|
-
return cursorPosition - textLength;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
// src/ui/suggestion-menu/suggestion-menu.tsx
|
|
266
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
267
|
-
var SuggestionMenu = ({
|
|
268
|
-
editor: providedEditor,
|
|
269
|
-
floatingOptions,
|
|
270
|
-
selector = "tiptap-suggestion-menu",
|
|
271
|
-
children,
|
|
272
|
-
maxHeight = 384,
|
|
273
|
-
pluginKey = import_suggestion.SuggestionPluginKey,
|
|
274
|
-
...internalSuggestionProps
|
|
275
|
-
}) => {
|
|
276
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
277
|
-
const [show, setShow] = React3.useState(false);
|
|
278
|
-
const [internalClientRect, setInternalClientRect] = React3.useState(null);
|
|
279
|
-
const [internalCommand, setInternalCommand] = React3.useState(null);
|
|
280
|
-
const [internalItems, setInternalItems] = React3.useState(
|
|
281
|
-
[]
|
|
282
|
-
);
|
|
283
|
-
const [internalQuery, setInternalQuery] = React3.useState("");
|
|
284
|
-
const [, setInternalRange] = React3.useState(null);
|
|
285
|
-
const { ref, style, getFloatingProps, isMounted } = useFloatingElement(
|
|
286
|
-
show,
|
|
287
|
-
internalClientRect,
|
|
288
|
-
1e3,
|
|
289
|
-
{
|
|
290
|
-
placement: "bottom-start",
|
|
291
|
-
middleware: [
|
|
292
|
-
(0, import_react4.offset)(10),
|
|
293
|
-
(0, import_react4.flip)({
|
|
294
|
-
mainAxis: true,
|
|
295
|
-
crossAxis: false
|
|
296
|
-
}),
|
|
297
|
-
(0, import_react4.shift)(),
|
|
298
|
-
(0, import_react4.size)({
|
|
299
|
-
apply({ availableHeight, elements }) {
|
|
300
|
-
if (elements.floating) {
|
|
301
|
-
const maxHeightValue = maxHeight ? Math.min(maxHeight, availableHeight) : availableHeight;
|
|
302
|
-
elements.floating.style.setProperty(
|
|
303
|
-
"--suggestion-menu-max-height",
|
|
304
|
-
`${maxHeightValue}px`
|
|
305
|
-
);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
})
|
|
309
|
-
],
|
|
310
|
-
onOpenChange(open) {
|
|
311
|
-
if (!open) {
|
|
312
|
-
setShow(false);
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
...floatingOptions
|
|
316
|
-
}
|
|
317
|
-
);
|
|
318
|
-
const internalSuggestionPropsRef = React3.useRef(internalSuggestionProps);
|
|
319
|
-
React3.useEffect(() => {
|
|
320
|
-
internalSuggestionPropsRef.current = internalSuggestionProps;
|
|
321
|
-
}, [internalSuggestionProps]);
|
|
322
|
-
const closePopup = React3.useCallback(() => {
|
|
323
|
-
setShow(false);
|
|
324
|
-
}, []);
|
|
325
|
-
React3.useEffect(() => {
|
|
326
|
-
if (!editor || editor.isDestroyed) {
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
const existingPlugin = editor.state.plugins.find(
|
|
330
|
-
(plugin) => plugin.spec.key === pluginKey
|
|
331
|
-
);
|
|
332
|
-
if (existingPlugin) {
|
|
333
|
-
editor.unregisterPlugin(pluginKey);
|
|
334
|
-
}
|
|
335
|
-
const suggestion = (0, import_suggestion.Suggestion)({
|
|
336
|
-
pluginKey: pluginKey instanceof import_state.PluginKey ? pluginKey : new import_state.PluginKey(pluginKey),
|
|
337
|
-
editor,
|
|
338
|
-
command({ editor: editor2, range, props }) {
|
|
339
|
-
var _a, _b;
|
|
340
|
-
if (!range) {
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
const { view, state } = editor2;
|
|
344
|
-
const { selection } = state;
|
|
345
|
-
const isMention = editor2.extensionManager.extensions.some(
|
|
346
|
-
(extension) => {
|
|
347
|
-
var _a2, _b2;
|
|
348
|
-
const name = extension.name;
|
|
349
|
-
return name === "mention" && ((_b2 = (_a2 = extension.options) == null ? void 0 : _a2.suggestion) == null ? void 0 : _b2.char) === internalSuggestionPropsRef.current.char;
|
|
350
|
-
}
|
|
351
|
-
);
|
|
352
|
-
if (!isMention) {
|
|
353
|
-
const cursorPosition = selection.$from.pos;
|
|
354
|
-
const previousNode = (_a = selection.$head) == null ? void 0 : _a.nodeBefore;
|
|
355
|
-
const startPosition = previousNode ? calculateStartPosition(
|
|
356
|
-
cursorPosition,
|
|
357
|
-
previousNode,
|
|
358
|
-
internalSuggestionPropsRef.current.char
|
|
359
|
-
) : selection.$from.start();
|
|
360
|
-
const transaction = state.tr.deleteRange(
|
|
361
|
-
startPosition,
|
|
362
|
-
cursorPosition
|
|
363
|
-
);
|
|
364
|
-
view.dispatch(transaction);
|
|
365
|
-
}
|
|
366
|
-
const nodeAfter = view.state.selection.$to.nodeAfter;
|
|
367
|
-
const overrideSpace = (_b = nodeAfter == null ? void 0 : nodeAfter.text) == null ? void 0 : _b.startsWith(" ");
|
|
368
|
-
const rangeToUse = { ...range };
|
|
369
|
-
if (overrideSpace) {
|
|
370
|
-
rangeToUse.to += 1;
|
|
371
|
-
}
|
|
372
|
-
props.onSelect({ editor: editor2, range: rangeToUse, context: props.context });
|
|
373
|
-
},
|
|
374
|
-
render: () => {
|
|
375
|
-
return {
|
|
376
|
-
onStart: (props) => {
|
|
377
|
-
var _a, _b;
|
|
378
|
-
setInternalCommand(() => props.command);
|
|
379
|
-
setInternalItems(props.items);
|
|
380
|
-
setInternalQuery(props.query);
|
|
381
|
-
setInternalRange(props.range);
|
|
382
|
-
setInternalClientRect((_b = (_a = props.clientRect) == null ? void 0 : _a.call(props)) != null ? _b : null);
|
|
383
|
-
setShow(true);
|
|
384
|
-
},
|
|
385
|
-
onUpdate: (props) => {
|
|
386
|
-
var _a, _b;
|
|
387
|
-
setInternalCommand(() => props.command);
|
|
388
|
-
setInternalItems(props.items);
|
|
389
|
-
setInternalQuery(props.query);
|
|
390
|
-
setInternalRange(props.range);
|
|
391
|
-
setInternalClientRect((_b = (_a = props.clientRect) == null ? void 0 : _a.call(props)) != null ? _b : null);
|
|
392
|
-
},
|
|
393
|
-
onKeyDown: (props) => {
|
|
394
|
-
if (props.event.key === "Escape") {
|
|
395
|
-
closePopup();
|
|
396
|
-
return true;
|
|
397
|
-
}
|
|
398
|
-
return false;
|
|
399
|
-
},
|
|
400
|
-
onExit: () => {
|
|
401
|
-
setInternalCommand(null);
|
|
402
|
-
setInternalItems([]);
|
|
403
|
-
setInternalQuery("");
|
|
404
|
-
setInternalRange(null);
|
|
405
|
-
setInternalClientRect(null);
|
|
406
|
-
setShow(false);
|
|
407
|
-
}
|
|
408
|
-
};
|
|
409
|
-
},
|
|
410
|
-
...internalSuggestionPropsRef.current
|
|
411
|
-
});
|
|
412
|
-
editor.registerPlugin(suggestion);
|
|
413
|
-
return () => {
|
|
414
|
-
if (!editor.isDestroyed) {
|
|
415
|
-
editor.unregisterPlugin(pluginKey);
|
|
416
|
-
}
|
|
417
|
-
};
|
|
418
|
-
}, [editor, pluginKey, closePopup]);
|
|
419
|
-
const onSelect = React3.useCallback(
|
|
420
|
-
(item) => {
|
|
421
|
-
closePopup();
|
|
422
|
-
if (internalCommand) {
|
|
423
|
-
internalCommand(item);
|
|
424
|
-
}
|
|
425
|
-
},
|
|
426
|
-
[closePopup, internalCommand]
|
|
427
|
-
);
|
|
428
|
-
const { selectedIndex } = useMenuNavigation({
|
|
429
|
-
editor,
|
|
430
|
-
query: internalQuery,
|
|
431
|
-
items: internalItems,
|
|
432
|
-
onSelect
|
|
433
|
-
});
|
|
434
|
-
if (!isMounted || !show || !editor) {
|
|
435
|
-
return null;
|
|
436
|
-
}
|
|
437
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react4.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
438
|
-
"div",
|
|
439
|
-
{
|
|
440
|
-
ref,
|
|
441
|
-
style,
|
|
442
|
-
...getFloatingProps(),
|
|
443
|
-
"data-selector": selector,
|
|
444
|
-
className: "tiptap-suggestion-menu",
|
|
445
|
-
role: "listbox",
|
|
446
|
-
"aria-label": "Suggestions",
|
|
447
|
-
onPointerDown: (e) => e.preventDefault(),
|
|
448
|
-
children: children({
|
|
449
|
-
items: internalItems,
|
|
450
|
-
selectedIndex,
|
|
451
|
-
onSelect
|
|
452
|
-
})
|
|
453
|
-
}
|
|
454
|
-
) });
|
|
455
|
-
};
|
|
456
|
-
|
|
457
|
-
// src/extensions/variable/variable-suggestion.tsx
|
|
458
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
459
|
-
var VariableSuggestionPluginKey = new import_state2.PluginKey("variableSuggestion");
|
|
460
|
-
function VariableSuggestion({
|
|
461
|
-
editor,
|
|
462
|
-
variables
|
|
463
|
-
}) {
|
|
464
|
-
const getItems = React4.useCallback(
|
|
465
|
-
({ query }) => {
|
|
466
|
-
const normalizedQuery = query.toLowerCase().trim();
|
|
467
|
-
const items = [];
|
|
468
|
-
const matchingVariables = variables.filter((variable) => {
|
|
469
|
-
var _a, _b;
|
|
470
|
-
if (!normalizedQuery) return true;
|
|
471
|
-
return variable.name.toLowerCase().includes(normalizedQuery) || variable.label.toLowerCase().includes(normalizedQuery) || ((_a = variable.category) == null ? void 0 : _a.toLowerCase().includes(normalizedQuery)) || ((_b = variable.description) == null ? void 0 : _b.toLowerCase().includes(normalizedQuery));
|
|
472
|
-
});
|
|
473
|
-
for (const variable of matchingVariables) {
|
|
474
|
-
items.push({
|
|
475
|
-
title: variable.label,
|
|
476
|
-
subtext: variable.name,
|
|
477
|
-
group: variable.category,
|
|
478
|
-
keywords: [variable.name, variable.label, variable.category].filter(
|
|
479
|
-
Boolean
|
|
480
|
-
),
|
|
481
|
-
onSelect: ({ editor: editor2 }) => {
|
|
482
|
-
const attrs = {
|
|
483
|
-
name: variable.name,
|
|
484
|
-
fallback: variable.fallback,
|
|
485
|
-
category: variable.category
|
|
486
|
-
};
|
|
487
|
-
editor2.chain().focus().insertVariable(attrs).run();
|
|
488
|
-
}
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
if (normalizedQuery && !variables.some((v) => v.name.toLowerCase() === normalizedQuery)) {
|
|
492
|
-
items.push({
|
|
493
|
-
title: `Neue Variable "${query}"`,
|
|
494
|
-
subtext: query,
|
|
495
|
-
group: "Neu",
|
|
496
|
-
onSelect: ({ editor: editor2 }) => {
|
|
497
|
-
const attrs = {
|
|
498
|
-
name: query
|
|
499
|
-
};
|
|
500
|
-
editor2.chain().focus().insertVariable(attrs).run();
|
|
501
|
-
}
|
|
502
|
-
});
|
|
503
|
-
}
|
|
504
|
-
return items;
|
|
505
|
-
},
|
|
506
|
-
[variables]
|
|
507
|
-
);
|
|
508
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
509
|
-
SuggestionMenu,
|
|
510
|
-
{
|
|
511
|
-
editor,
|
|
512
|
-
pluginKey: VariableSuggestionPluginKey,
|
|
513
|
-
char: "{{",
|
|
514
|
-
items: getItems,
|
|
515
|
-
allowSpaces: false,
|
|
516
|
-
selector: "tiptap-variable-suggestion-menu",
|
|
517
|
-
children: (props) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(VariableList, { ...props })
|
|
518
|
-
}
|
|
519
|
-
);
|
|
520
|
-
}
|
|
521
|
-
var VariableItem = ({
|
|
522
|
-
item,
|
|
523
|
-
isSelected,
|
|
524
|
-
onSelect
|
|
525
|
-
}) => {
|
|
526
|
-
const itemRef = React4.useRef(null);
|
|
527
|
-
React4.useEffect(() => {
|
|
528
|
-
const selector = document.querySelector(
|
|
529
|
-
'[data-selector="tiptap-variable-suggestion-menu"]'
|
|
530
|
-
);
|
|
531
|
-
if (!itemRef.current || !isSelected || !selector) return;
|
|
532
|
-
const overflow = (0, import_editor_utils.getElementOverflowPosition)(itemRef.current, selector);
|
|
533
|
-
if (overflow === "top") {
|
|
534
|
-
itemRef.current.scrollIntoView(true);
|
|
535
|
-
} else if (overflow === "bottom") {
|
|
536
|
-
itemRef.current.scrollIntoView(false);
|
|
537
|
-
}
|
|
538
|
-
}, [isSelected]);
|
|
539
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
540
|
-
"button",
|
|
541
|
-
{
|
|
542
|
-
ref: itemRef,
|
|
543
|
-
type: "button",
|
|
544
|
-
"data-active-state": isSelected ? "on" : "off",
|
|
545
|
-
onClick: onSelect,
|
|
546
|
-
className: "w-full flex items-center justify-between gap-3 px-2 py-1.5 text-sm rounded-sm outline-none hover:bg-muted data-[active-state=on]:bg-muted",
|
|
547
|
-
children: [
|
|
548
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "font-medium truncate", children: item.title }),
|
|
549
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", { className: "text-xs text-muted-foreground font-mono shrink-0", children: item.subtext })
|
|
550
|
-
]
|
|
551
|
-
}
|
|
552
|
-
);
|
|
553
|
-
};
|
|
554
|
-
var VariableList = ({
|
|
555
|
-
items,
|
|
556
|
-
selectedIndex,
|
|
557
|
-
onSelect
|
|
558
|
-
}) => {
|
|
559
|
-
const styles = (0, import_theme.slashDropdownMenu)();
|
|
560
|
-
const renderedItems = React4.useMemo(() => {
|
|
561
|
-
const rendered = [];
|
|
562
|
-
const groups = {};
|
|
563
|
-
items.forEach((item, index) => {
|
|
564
|
-
const groupLabel = item.group || "";
|
|
565
|
-
if (!groups[groupLabel]) {
|
|
566
|
-
groups[groupLabel] = { items: [], indices: [] };
|
|
567
|
-
}
|
|
568
|
-
groups[groupLabel].items.push(item);
|
|
569
|
-
groups[groupLabel].indices.push(index);
|
|
570
|
-
});
|
|
571
|
-
Object.entries(groups).forEach(([groupLabel, groupData], groupIndex) => {
|
|
572
|
-
const groupItems = groupData.items.map((item, itemIndex) => {
|
|
573
|
-
const originalIndex = groupData.indices[itemIndex];
|
|
574
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
575
|
-
VariableItem,
|
|
576
|
-
{
|
|
577
|
-
item,
|
|
578
|
-
isSelected: originalIndex === selectedIndex,
|
|
579
|
-
onSelect: () => onSelect(item)
|
|
580
|
-
},
|
|
581
|
-
`item-${originalIndex}-${item.title}`
|
|
582
|
-
);
|
|
583
|
-
});
|
|
584
|
-
if (groupLabel) {
|
|
585
|
-
rendered.push(
|
|
586
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "py-1", children: [
|
|
587
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "px-2 py-1 text-xs font-semibold text-muted-foreground uppercase tracking-wide", children: groupLabel }),
|
|
588
|
-
groupItems
|
|
589
|
-
] }, `group-${groupIndex}-${groupLabel}`)
|
|
590
|
-
);
|
|
591
|
-
} else {
|
|
592
|
-
rendered.push(...groupItems);
|
|
593
|
-
}
|
|
594
|
-
});
|
|
595
|
-
return rendered;
|
|
596
|
-
}, [items, selectedIndex, onSelect]);
|
|
597
|
-
if (!renderedItems.length) {
|
|
598
|
-
return null;
|
|
599
|
-
}
|
|
600
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
601
|
-
"div",
|
|
602
|
-
{
|
|
603
|
-
className: styles.card(),
|
|
604
|
-
style: {
|
|
605
|
-
maxHeight: "var(--suggestion-menu-max-height)",
|
|
606
|
-
minWidth: "240px"
|
|
607
|
-
},
|
|
608
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: styles.body(), children: renderedItems })
|
|
609
|
-
}
|
|
610
|
-
);
|
|
611
|
-
};
|
|
612
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
613
|
-
0 && (module.exports = {
|
|
614
|
-
VariableSuggestion
|
|
615
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
import {
|
|
4
|
-
VariableSuggestion
|
|
5
|
-
} from "../../chunk-H7MS2UMO.mjs";
|
|
6
|
-
import "../../chunk-HLLA2HRV.mjs";
|
|
7
|
-
import "../../chunk-L5RDMV3H.mjs";
|
|
8
|
-
import "../../chunk-CNVACBGT.mjs";
|
|
9
|
-
import "../../chunk-P55PLOHR.mjs";
|
|
10
|
-
import "../../chunk-KK4K43WM.mjs";
|
|
11
|
-
import "../../chunk-42HKGCOO.mjs";
|
|
12
|
-
export {
|
|
13
|
-
VariableSuggestion
|
|
14
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { NodeViewProps } from '@tiptap/react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Variable NodeView Component
|
|
6
|
-
*
|
|
7
|
-
* Renders a template variable as an inline chip.
|
|
8
|
-
* Shows resolved value if available, otherwise shows variable name.
|
|
9
|
-
* In read-only mode with a resolved value, renders as plain text.
|
|
10
|
-
*/
|
|
11
|
-
declare function VariableNodeView({ node, editor }: NodeViewProps): react_jsx_runtime.JSX.Element;
|
|
12
|
-
|
|
13
|
-
export { VariableNodeView, VariableNodeView as default };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { NodeViewProps } from '@tiptap/react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Variable NodeView Component
|
|
6
|
-
*
|
|
7
|
-
* Renders a template variable as an inline chip.
|
|
8
|
-
* Shows resolved value if available, otherwise shows variable name.
|
|
9
|
-
* In read-only mode with a resolved value, renders as plain text.
|
|
10
|
-
*/
|
|
11
|
-
declare function VariableNodeView({ node, editor }: NodeViewProps): react_jsx_runtime.JSX.Element;
|
|
12
|
-
|
|
13
|
-
export { VariableNodeView, VariableNodeView as default };
|