@kopexa/tiptap 17.6.17 → 17.7.0
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 +1081 -668
- package/dist/index.mjs +7686 -112
- package/package.json +57 -52
- package/dist/chunk-2SI7MRAE.mjs +0 -64
- package/dist/chunk-2U5CQUZH.mjs +0 -91
- package/dist/chunk-2UDCL55K.mjs +0 -55
- package/dist/chunk-2V6VOAPI.mjs +0 -139
- package/dist/chunk-2Z2QVW67.mjs +0 -1
- package/dist/chunk-32SUXCAQ.mjs +0 -115
- package/dist/chunk-33QD5PYJ.mjs +0 -63
- package/dist/chunk-3VRQUYYW.mjs +0 -169
- package/dist/chunk-42HKGCOO.mjs +0 -129
- package/dist/chunk-4ALV4UA5.mjs +0 -1
- package/dist/chunk-4CDZ547I.mjs +0 -185
- package/dist/chunk-4HO7BWDC.mjs +0 -89
- package/dist/chunk-4JRYQZ4A.mjs +0 -174
- package/dist/chunk-552JLRNB.mjs +0 -35
- package/dist/chunk-5SMDMQDF.mjs +0 -34
- package/dist/chunk-6552DQWB.mjs +0 -416
- package/dist/chunk-7FDDRVUE.mjs +0 -143
- package/dist/chunk-7VGROP26.mjs +0 -262
- package/dist/chunk-7VW67NVL.mjs +0 -80
- package/dist/chunk-AAV7ZNBP.mjs +0 -83
- package/dist/chunk-ATRHILCH.mjs +0 -1
- package/dist/chunk-B7WJOQ3X.mjs +0 -103
- package/dist/chunk-BEV5U2DK.mjs +0 -131
- package/dist/chunk-BXHPO3T7.mjs +0 -152
- package/dist/chunk-BXJYNSWQ.mjs +0 -30
- package/dist/chunk-C5RQWJKE.mjs +0 -155
- package/dist/chunk-CNVACBGT.mjs +0 -51
- package/dist/chunk-DQK6PA4U.mjs +0 -276
- package/dist/chunk-DSBJFMHK.mjs +0 -38
- package/dist/chunk-DT7ML2P4.mjs +0 -42
- package/dist/chunk-DZLGLP7R.mjs +0 -99
- package/dist/chunk-EAAQE5ZV.mjs +0 -283
- package/dist/chunk-EHY2NAW7.mjs +0 -120
- package/dist/chunk-EIIWU5FR.mjs +0 -61
- package/dist/chunk-ERPGWXFK.mjs +0 -163
- package/dist/chunk-F73FCUD5.mjs +0 -1
- package/dist/chunk-FRJX2F4T.mjs +0 -55
- package/dist/chunk-GYIYX2JH.mjs +0 -73
- package/dist/chunk-H6LC4LDQ.mjs +0 -63
- package/dist/chunk-H7MS2UMO.mjs +0 -168
- package/dist/chunk-HLLA2HRV.mjs +0 -1
- package/dist/chunk-HTJ2RXOG.mjs +0 -32
- package/dist/chunk-IFXRPGIJ.mjs +0 -98
- package/dist/chunk-IOB3REX6.mjs +0 -173
- package/dist/chunk-IQERE7KP.mjs +0 -115
- package/dist/chunk-JCV5SEKN.mjs +0 -65
- package/dist/chunk-JVSH5T4B.mjs +0 -72
- package/dist/chunk-KK4K43WM.mjs +0 -59
- package/dist/chunk-KR42JAVB.mjs +0 -60
- package/dist/chunk-KYLBKQ2E.mjs +0 -203
- package/dist/chunk-L5RDMV3H.mjs +0 -216
- package/dist/chunk-LNVWG34E.mjs +0 -165
- package/dist/chunk-LVNUU67N.mjs +0 -1
- package/dist/chunk-MNTOOEHA.mjs +0 -1
- package/dist/chunk-N3JE67CS.mjs +0 -81
- package/dist/chunk-N4CT5RNC.mjs +0 -123
- package/dist/chunk-OEVR5N7X.mjs +0 -65
- package/dist/chunk-P55PLOHR.mjs +0 -34
- package/dist/chunk-Q5FK7SFY.mjs +0 -75
- package/dist/chunk-Q7DFJ5NI.mjs +0 -153
- package/dist/chunk-QIELBKP3.mjs +0 -104
- package/dist/chunk-R2GM4A3T.mjs +0 -71
- package/dist/chunk-REJEJXOZ.mjs +0 -10
- package/dist/chunk-RFWNKE7D.mjs +0 -238
- package/dist/chunk-TAM3VMJT.mjs +0 -80
- package/dist/chunk-TDFS3DCZ.mjs +0 -79
- package/dist/chunk-TLM5ALHZ.mjs +0 -1
- package/dist/chunk-TZQQ6C2Q.mjs +0 -101
- package/dist/chunk-U5XAL46P.mjs +0 -39
- package/dist/chunk-UJ4BNZ63.mjs +0 -178
- package/dist/chunk-UVHVCION.mjs +0 -168
- package/dist/chunk-V6TAZMQN.mjs +0 -105
- package/dist/chunk-VF3G2URZ.mjs +0 -83
- package/dist/chunk-VRQ6OSAZ.mjs +0 -76
- package/dist/chunk-VTKJPVNM.mjs +0 -148
- package/dist/chunk-VX3HSJ76.mjs +0 -73
- package/dist/chunk-W2FLOOJ6.mjs +0 -75
- package/dist/chunk-XGAABDMW.mjs +0 -159
- package/dist/chunk-Y2KSWMG5.mjs +0 -1
- package/dist/chunk-YJAHZXLG.mjs +0 -92
- package/dist/chunk-Z365KVQY.mjs +0 -34
- package/dist/chunk-ZVTJ6XD7.mjs +0 -88
- package/dist/chunk-ZZ4OU46C.mjs +0 -131
- package/dist/context/editor-context.d.mts +0 -10
- package/dist/context/editor-context.d.ts +0 -10
- package/dist/context/editor-context.js +0 -34
- package/dist/context/editor-context.mjs +0 -9
- package/dist/context/editor-file-context.d.mts +0 -70
- package/dist/context/editor-file-context.d.ts +0 -70
- package/dist/context/editor-file-context.js +0 -96
- package/dist/context/editor-file-context.mjs +0 -12
- package/dist/extensions/callout/callout-settings.d.mts +0 -13
- package/dist/extensions/callout/callout-settings.d.ts +0 -13
- package/dist/extensions/callout/callout-settings.js +0 -206
- package/dist/extensions/callout/callout-settings.mjs +0 -9
- package/dist/extensions/callout/callout-view.d.mts +0 -12
- package/dist/extensions/callout/callout-view.d.ts +0 -12
- package/dist/extensions/callout/callout-view.js +0 -273
- package/dist/extensions/callout/callout-view.mjs +0 -12
- package/dist/extensions/callout/index.d.mts +0 -44
- package/dist/extensions/callout/index.d.ts +0 -44
- package/dist/extensions/callout/index.js +0 -380
- package/dist/extensions/callout/index.mjs +0 -13
- package/dist/extensions/callout/messages.d.mts +0 -59
- package/dist/extensions/callout/messages.d.ts +0 -59
- package/dist/extensions/callout/messages.js +0 -88
- package/dist/extensions/callout/messages.mjs +0 -7
- package/dist/extensions/image/image-view.d.mts +0 -15
- package/dist/extensions/image/image-view.d.ts +0 -15
- package/dist/extensions/image/image-view.js +0 -255
- package/dist/extensions/image/image-view.mjs +0 -12
- package/dist/extensions/image/index.d.mts +0 -29
- package/dist/extensions/image/index.d.ts +0 -29
- package/dist/extensions/image/index.js +0 -282
- package/dist/extensions/image/index.mjs +0 -16
- package/dist/extensions/image/messages.d.mts +0 -28
- package/dist/extensions/image/messages.d.ts +0 -28
- package/dist/extensions/image/messages.js +0 -57
- package/dist/extensions/image/messages.mjs +0 -7
- package/dist/extensions/image-upload/image-upload-view.d.mts +0 -12
- package/dist/extensions/image-upload/image-upload-view.d.ts +0 -12
- package/dist/extensions/image-upload/image-upload-view.js +0 -338
- package/dist/extensions/image-upload/image-upload-view.mjs +0 -12
- package/dist/extensions/image-upload/index.d.mts +0 -46
- package/dist/extensions/image-upload/index.d.ts +0 -46
- package/dist/extensions/image-upload/index.js +0 -414
- package/dist/extensions/image-upload/index.mjs +0 -16
- package/dist/extensions/image-upload/messages.d.mts +0 -32
- package/dist/extensions/image-upload/messages.d.ts +0 -32
- package/dist/extensions/image-upload/messages.js +0 -61
- package/dist/extensions/image-upload/messages.mjs +0 -7
- package/dist/extensions/link/index.d.mts +0 -6
- package/dist/extensions/link/index.d.ts +0 -6
- package/dist/extensions/link/index.js +0 -94
- package/dist/extensions/link/index.mjs +0 -7
- package/dist/extensions/math/index.d.mts +0 -38
- package/dist/extensions/math/index.d.ts +0 -38
- package/dist/extensions/math/index.js +0 -544
- package/dist/extensions/math/index.mjs +0 -17
- package/dist/extensions/math/inline-math-view.d.mts +0 -12
- package/dist/extensions/math/inline-math-view.d.ts +0 -12
- package/dist/extensions/math/inline-math-view.js +0 -232
- package/dist/extensions/math/inline-math-view.mjs +0 -11
- package/dist/extensions/math/inline-math.d.mts +0 -32
- package/dist/extensions/math/inline-math.d.ts +0 -32
- package/dist/extensions/math/inline-math.js +0 -304
- package/dist/extensions/math/inline-math.mjs +0 -12
- package/dist/extensions/math/math-block-view.d.mts +0 -11
- package/dist/extensions/math/math-block-view.d.ts +0 -11
- package/dist/extensions/math/math-block-view.js +0 -248
- package/dist/extensions/math/math-block-view.mjs +0 -11
- package/dist/extensions/math/messages.d.mts +0 -49
- package/dist/extensions/math/messages.d.ts +0 -49
- package/dist/extensions/math/messages.js +0 -78
- package/dist/extensions/math/messages.mjs +0 -7
- package/dist/extensions/selection/index.d.mts +0 -5
- package/dist/extensions/selection/index.d.ts +0 -5
- package/dist/extensions/selection/index.js +0 -62
- package/dist/extensions/selection/index.mjs +0 -7
- package/dist/extensions/toc/index.d.mts +0 -53
- package/dist/extensions/toc/index.d.ts +0 -53
- package/dist/extensions/toc/index.js +0 -501
- package/dist/extensions/toc/index.mjs +0 -13
- package/dist/extensions/toc/messages.d.mts +0 -74
- package/dist/extensions/toc/messages.d.ts +0 -74
- package/dist/extensions/toc/messages.js +0 -103
- package/dist/extensions/toc/messages.mjs +0 -7
- package/dist/extensions/toc/toc-settings.d.mts +0 -13
- package/dist/extensions/toc/toc-settings.d.ts +0 -13
- package/dist/extensions/toc/toc-settings.js +0 -283
- package/dist/extensions/toc/toc-settings.mjs +0 -9
- package/dist/extensions/toc/toc-view.d.mts +0 -12
- package/dist/extensions/toc/toc-view.d.ts +0 -12
- package/dist/extensions/toc/toc-view.js +0 -411
- package/dist/extensions/toc/toc-view.mjs +0 -12
- package/dist/extensions/trailing-node/index.d.mts +0 -9
- package/dist/extensions/trailing-node/index.d.ts +0 -9
- package/dist/extensions/trailing-node/index.js +0 -86
- package/dist/extensions/trailing-node/index.mjs +0 -7
- package/dist/extensions/ui-state/index.d.mts +0 -34
- package/dist/extensions/ui-state/index.d.ts +0 -34
- package/dist/extensions/ui-state/index.js +0 -84
- package/dist/extensions/ui-state/index.mjs +0 -9
- package/dist/extensions/variable/extract-variables.d.mts +0 -16
- package/dist/extensions/variable/extract-variables.d.ts +0 -16
- package/dist/extensions/variable/extract-variables.js +0 -58
- package/dist/extensions/variable/extract-variables.mjs +0 -7
- package/dist/extensions/variable/index.d.mts +0 -38
- package/dist/extensions/variable/index.d.ts +0 -38
- package/dist/extensions/variable/index.js +0 -190
- package/dist/extensions/variable/index.mjs +0 -11
- package/dist/extensions/variable/messages.d.mts +0 -69
- package/dist/extensions/variable/messages.d.ts +0 -69
- package/dist/extensions/variable/messages.js +0 -98
- package/dist/extensions/variable/messages.mjs +0 -7
- package/dist/extensions/variable/variable-context.d.mts +0 -56
- package/dist/extensions/variable/variable-context.d.ts +0 -56
- package/dist/extensions/variable/variable-context.js +0 -70
- package/dist/extensions/variable/variable-context.mjs +0 -12
- package/dist/extensions/variable/variable-filler-dialog.d.mts +0 -43
- package/dist/extensions/variable/variable-filler-dialog.d.ts +0 -43
- package/dist/extensions/variable/variable-filler-dialog.js +0 -207
- package/dist/extensions/variable/variable-filler-dialog.mjs +0 -9
- package/dist/extensions/variable/variable-suggestion.d.mts +0 -31
- package/dist/extensions/variable/variable-suggestion.d.ts +0 -31
- package/dist/extensions/variable/variable-suggestion.js +0 -615
- package/dist/extensions/variable/variable-suggestion.mjs +0 -14
- package/dist/extensions/variable/variable-view.d.mts +0 -13
- package/dist/extensions/variable/variable-view.d.ts +0 -13
- package/dist/extensions/variable/variable-view.js +0 -110
- package/dist/extensions/variable/variable-view.mjs +0 -11
- package/dist/hooks/use-create-editor.d.mts +0 -46
- package/dist/hooks/use-create-editor.d.ts +0 -46
- package/dist/hooks/use-create-editor.js +0 -2726
- package/dist/hooks/use-create-editor.mjs +0 -37
- package/dist/hooks/use-cursor-visibility.d.mts +0 -37
- package/dist/hooks/use-cursor-visibility.d.ts +0 -37
- package/dist/hooks/use-cursor-visibility.js +0 -140
- package/dist/hooks/use-cursor-visibility.mjs +0 -8
- package/dist/hooks/use-floating-element.d.mts +0 -43
- package/dist/hooks/use-floating-element.d.ts +0 -43
- package/dist/hooks/use-floating-element.js +0 -88
- package/dist/hooks/use-floating-element.mjs +0 -8
- package/dist/hooks/use-floating-toolbar-visibility.d.mts +0 -32
- package/dist/hooks/use-floating-toolbar-visibility.d.ts +0 -32
- package/dist/hooks/use-floating-toolbar-visibility.js +0 -115
- package/dist/hooks/use-floating-toolbar-visibility.mjs +0 -13
- package/dist/hooks/use-menu-navigation.d.mts +0 -55
- package/dist/hooks/use-menu-navigation.d.ts +0 -55
- package/dist/hooks/use-menu-navigation.js +0 -163
- package/dist/hooks/use-menu-navigation.mjs +0 -8
- package/dist/hooks/use-tiptap-editor.d.mts +0 -20
- package/dist/hooks/use-tiptap-editor.d.ts +0 -20
- package/dist/hooks/use-tiptap-editor.js +0 -58
- package/dist/hooks/use-tiptap-editor.mjs +0 -8
- package/dist/hooks/use-ui-editor-state.d.mts +0 -7
- package/dist/hooks/use-ui-editor-state.d.ts +0 -7
- package/dist/hooks/use-ui-editor-state.js +0 -107
- package/dist/hooks/use-ui-editor-state.mjs +0 -11
- package/dist/hooks/use-window-size.d.mts +0 -12
- package/dist/hooks/use-window-size.d.ts +0 -12
- package/dist/hooks/use-window-size.js +0 -75
- package/dist/hooks/use-window-size.mjs +0 -7
- package/dist/presets/basic/editor-header.d.mts +0 -23
- package/dist/presets/basic/editor-header.d.ts +0 -23
- package/dist/presets/basic/editor-header.js +0 -2750
- package/dist/presets/basic/editor-header.mjs +0 -43
- package/dist/presets/basic/index.d.mts +0 -38
- package/dist/presets/basic/index.d.ts +0 -38
- package/dist/presets/basic/index.js +0 -6891
- package/dist/presets/basic/index.mjs +0 -85
- package/dist/ui/blockquote-button/blockquote-button.d.mts +0 -20
- package/dist/ui/blockquote-button/blockquote-button.d.ts +0 -20
- package/dist/ui/blockquote-button/blockquote-button.js +0 -247
- package/dist/ui/blockquote-button/blockquote-button.mjs +0 -9
- package/dist/ui/blockquote-button/index.d.mts +0 -6
- package/dist/ui/blockquote-button/index.d.ts +0 -6
- package/dist/ui/blockquote-button/index.js +0 -259
- package/dist/ui/blockquote-button/index.mjs +0 -21
- package/dist/ui/blockquote-button/use-blockquote.d.mts +0 -85
- package/dist/ui/blockquote-button/use-blockquote.d.ts +0 -85
- package/dist/ui/blockquote-button/use-blockquote.js +0 -192
- package/dist/ui/blockquote-button/use-blockquote.mjs +0 -17
- package/dist/ui/bubble-menu/index.d.mts +0 -13
- package/dist/ui/bubble-menu/index.d.ts +0 -13
- package/dist/ui/bubble-menu/index.js +0 -673
- package/dist/ui/bubble-menu/index.mjs +0 -16
- package/dist/ui/codeblock-button/code-block-button.d.mts +0 -20
- package/dist/ui/codeblock-button/code-block-button.d.ts +0 -20
- package/dist/ui/codeblock-button/code-block-button.js +0 -237
- package/dist/ui/codeblock-button/code-block-button.mjs +0 -9
- package/dist/ui/codeblock-button/index.d.mts +0 -6
- package/dist/ui/codeblock-button/index.d.ts +0 -6
- package/dist/ui/codeblock-button/index.js +0 -249
- package/dist/ui/codeblock-button/index.mjs +0 -21
- package/dist/ui/codeblock-button/use-code-block.d.mts +0 -92
- package/dist/ui/codeblock-button/use-code-block.d.ts +0 -92
- package/dist/ui/codeblock-button/use-code-block.js +0 -192
- package/dist/ui/codeblock-button/use-code-block.mjs +0 -17
- package/dist/ui/color-highlight-button/color-highlight-button.d.mts +0 -25
- package/dist/ui/color-highlight-button/color-highlight-button.d.ts +0 -25
- package/dist/ui/color-highlight-button/color-highlight-button.js +0 -266
- package/dist/ui/color-highlight-button/color-highlight-button.mjs +0 -9
- package/dist/ui/color-highlight-button/index.d.mts +0 -6
- package/dist/ui/color-highlight-button/index.d.ts +0 -6
- package/dist/ui/color-highlight-button/index.js +0 -342
- package/dist/ui/color-highlight-button/index.mjs +0 -27
- package/dist/ui/color-highlight-button/use-color-highlight.d.mts +0 -64
- package/dist/ui/color-highlight-button/use-color-highlight.d.ts +0 -64
- package/dist/ui/color-highlight-button/use-color-highlight.js +0 -247
- package/dist/ui/color-highlight-button/use-color-highlight.mjs +0 -23
- package/dist/ui/color-highlight-popover/color-highlight-popover.d.mts +0 -29
- package/dist/ui/color-highlight-popover/color-highlight-popover.d.ts +0 -29
- package/dist/ui/color-highlight-popover/color-highlight-popover.js +0 -590
- package/dist/ui/color-highlight-popover/color-highlight-popover.mjs +0 -17
- package/dist/ui/color-highlight-popover/index.d.mts +0 -6
- package/dist/ui/color-highlight-popover/index.d.ts +0 -6
- package/dist/ui/color-highlight-popover/index.js +0 -591
- package/dist/ui/color-highlight-popover/index.mjs +0 -17
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.d.mts +0 -30
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.d.ts +0 -30
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.js +0 -171
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.mjs +0 -10
- package/dist/ui/heading-button/index.d.mts +0 -45
- package/dist/ui/heading-button/index.d.ts +0 -45
- package/dist/ui/heading-button/index.js +0 -222
- package/dist/ui/heading-button/index.mjs +0 -16
- package/dist/ui/heading-button/utils.d.mts +0 -17
- package/dist/ui/heading-button/utils.d.ts +0 -17
- package/dist/ui/heading-button/utils.js +0 -92
- package/dist/ui/heading-button/utils.mjs +0 -19
- package/dist/ui/heading-dropdown-menu/index.d.mts +0 -14
- package/dist/ui/heading-dropdown-menu/index.d.ts +0 -14
- package/dist/ui/heading-dropdown-menu/index.js +0 -308
- package/dist/ui/heading-dropdown-menu/index.mjs +0 -10
- package/dist/ui/link-bubble/index.d.mts +0 -13
- package/dist/ui/link-bubble/index.d.ts +0 -13
- package/dist/ui/link-bubble/index.js +0 -183
- package/dist/ui/link-bubble/index.mjs +0 -10
- package/dist/ui/link-popover/index.d.mts +0 -7
- package/dist/ui/link-popover/index.d.ts +0 -7
- package/dist/ui/link-popover/index.js +0 -512
- package/dist/ui/link-popover/index.mjs +0 -30
- package/dist/ui/link-popover/link-popover.d.mts +0 -85
- package/dist/ui/link-popover/link-popover.d.ts +0 -85
- package/dist/ui/link-popover/link-popover.js +0 -498
- package/dist/ui/link-popover/link-popover.mjs +0 -16
- package/dist/ui/link-popover/use-link-popover.d.mts +0 -123
- package/dist/ui/link-popover/use-link-popover.d.ts +0 -123
- package/dist/ui/link-popover/use-link-popover.js +0 -259
- package/dist/ui/link-popover/use-link-popover.mjs +0 -20
- package/dist/ui/list-button/index.d.mts +0 -50
- package/dist/ui/list-button/index.d.ts +0 -50
- package/dist/ui/list-button/index.js +0 -232
- package/dist/ui/list-button/index.mjs +0 -24
- package/dist/ui/list-dropdown-menu/index.d.mts +0 -45
- package/dist/ui/list-dropdown-menu/index.d.ts +0 -45
- package/dist/ui/list-dropdown-menu/index.js +0 -361
- package/dist/ui/list-dropdown-menu/index.mjs +0 -21
- package/dist/ui/mark-button/index.d.mts +0 -59
- package/dist/ui/mark-button/index.d.ts +0 -59
- package/dist/ui/mark-button/index.js +0 -217
- package/dist/ui/mark-button/index.mjs +0 -26
- package/dist/ui/reset-all-formatting-button/index.d.mts +0 -7
- package/dist/ui/reset-all-formatting-button/index.d.ts +0 -7
- package/dist/ui/reset-all-formatting-button/index.js +0 -286
- package/dist/ui/reset-all-formatting-button/index.mjs +0 -26
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.d.mts +0 -30
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.d.ts +0 -30
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.js +0 -271
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.mjs +0 -12
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.d.mts +0 -103
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.d.ts +0 -103
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.js +0 -211
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.mjs +0 -21
- package/dist/ui/slash-dropdown-menu/index.d.mts +0 -10
- package/dist/ui/slash-dropdown-menu/index.d.ts +0 -10
- package/dist/ui/slash-dropdown-menu/index.js +0 -1056
- package/dist/ui/slash-dropdown-menu/index.mjs +0 -19
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.d.mts +0 -16
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.d.ts +0 -16
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.js +0 -1053
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.mjs +0 -16
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.d.mts +0 -162
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.d.ts +0 -162
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.js +0 -457
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.mjs +0 -10
- package/dist/ui/suggestion-menu/index.d.mts +0 -10
- package/dist/ui/suggestion-menu/index.d.ts +0 -10
- package/dist/ui/suggestion-menu/index.js +0 -489
- package/dist/ui/suggestion-menu/index.mjs +0 -17
- package/dist/ui/suggestion-menu/suggestion-menu-types.d.mts +0 -89
- package/dist/ui/suggestion-menu/suggestion-menu-types.d.ts +0 -89
- package/dist/ui/suggestion-menu/suggestion-menu-types.js +0 -19
- package/dist/ui/suggestion-menu/suggestion-menu-types.mjs +0 -1
- package/dist/ui/suggestion-menu/suggestion-menu-utils.d.mts +0 -27
- package/dist/ui/suggestion-menu/suggestion-menu-utils.d.ts +0 -27
- package/dist/ui/suggestion-menu/suggestion-menu-utils.js +0 -75
- package/dist/ui/suggestion-menu/suggestion-menu-utils.mjs +0 -9
- package/dist/ui/suggestion-menu/suggestion-menu.d.mts +0 -15
- package/dist/ui/suggestion-menu/suggestion-menu.d.ts +0 -15
- package/dist/ui/suggestion-menu/suggestion-menu.js +0 -453
- package/dist/ui/suggestion-menu/suggestion-menu.mjs +0 -12
- package/dist/ui/table-button/index.d.mts +0 -15
- package/dist/ui/table-button/index.d.ts +0 -15
- package/dist/ui/table-button/index.js +0 -202
- package/dist/ui/table-button/index.mjs +0 -9
- package/dist/ui/table-button/use-table.d.mts +0 -51
- package/dist/ui/table-button/use-table.d.ts +0 -51
- package/dist/ui/table-button/use-table.js +0 -146
- package/dist/ui/table-button/use-table.mjs +0 -14
- package/dist/ui/text-align-button/index.d.mts +0 -6
- package/dist/ui/text-align-button/index.d.ts +0 -6
- package/dist/ui/text-align-button/index.js +0 -235
- package/dist/ui/text-align-button/index.mjs +0 -29
- package/dist/ui/text-align-button/text-align-button.d.mts +0 -20
- package/dist/ui/text-align-button/text-align-button.d.ts +0 -20
- package/dist/ui/text-align-button/text-align-button.js +0 -215
- package/dist/ui/text-align-button/text-align-button.mjs +0 -9
- package/dist/ui/text-align-button/use-text-align.d.mts +0 -106
- package/dist/ui/text-align-button/use-text-align.d.ts +0 -106
- package/dist/ui/text-align-button/use-text-align.js +0 -169
- package/dist/ui/text-align-button/use-text-align.mjs +0 -24
- package/dist/ui/undo-redo-button/index.d.mts +0 -6
- package/dist/ui/undo-redo-button/index.d.ts +0 -6
- package/dist/ui/undo-redo-button/index.js +0 -202
- package/dist/ui/undo-redo-button/index.mjs +0 -25
- package/dist/ui/undo-redo-button/undo-redo-button.d.mts +0 -23
- package/dist/ui/undo-redo-button/undo-redo-button.d.ts +0 -23
- package/dist/ui/undo-redo-button/undo-redo-button.js +0 -187
- package/dist/ui/undo-redo-button/undo-redo-button.mjs +0 -10
- package/dist/ui/undo-redo-button/use-undo-redo.d.mts +0 -95
- package/dist/ui/undo-redo-button/use-undo-redo.d.ts +0 -95
- package/dist/ui/undo-redo-button/use-undo-redo.js +0 -146
- package/dist/ui/undo-redo-button/use-undo-redo.mjs +0 -21
- package/dist/utils/index.d.mts +0 -38
- package/dist/utils/index.d.ts +0 -38
- package/dist/utils/index.js +0 -128
- package/dist/utils/index.mjs +0 -15
- package/dist/utils/safe-parse.d.mts +0 -14
- package/dist/utils/safe-parse.d.ts +0 -14
- package/dist/utils/safe-parse.js +0 -203
- package/dist/utils/safe-parse.mjs +0 -8
package/dist/chunk-4JRYQZ4A.mjs
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
SlashDropdownMenu
|
|
4
|
-
} from "./chunk-ERPGWXFK.mjs";
|
|
5
|
-
import {
|
|
6
|
-
useScrollToHash
|
|
7
|
-
} from "./chunk-DZLGLP7R.mjs";
|
|
8
|
-
import {
|
|
9
|
-
LinkBubble
|
|
10
|
-
} from "./chunk-XGAABDMW.mjs";
|
|
11
|
-
import {
|
|
12
|
-
BubbleMenu
|
|
13
|
-
} from "./chunk-2UDCL55K.mjs";
|
|
14
|
-
import {
|
|
15
|
-
VariableSuggestion
|
|
16
|
-
} from "./chunk-H7MS2UMO.mjs";
|
|
17
|
-
import {
|
|
18
|
-
EditorHeader
|
|
19
|
-
} from "./chunk-RFWNKE7D.mjs";
|
|
20
|
-
import {
|
|
21
|
-
useUiEditorState
|
|
22
|
-
} from "./chunk-BXJYNSWQ.mjs";
|
|
23
|
-
import {
|
|
24
|
-
EditorUIProvider
|
|
25
|
-
} from "./chunk-REJEJXOZ.mjs";
|
|
26
|
-
import {
|
|
27
|
-
useCreateEditor
|
|
28
|
-
} from "./chunk-DQK6PA4U.mjs";
|
|
29
|
-
import {
|
|
30
|
-
VariableProvider
|
|
31
|
-
} from "./chunk-5SMDMQDF.mjs";
|
|
32
|
-
|
|
33
|
-
// src/presets/basic/index.tsx
|
|
34
|
-
import {
|
|
35
|
-
editorBasic,
|
|
36
|
-
editorSpinner
|
|
37
|
-
} from "@kopexa/theme";
|
|
38
|
-
import {
|
|
39
|
-
EditorContent,
|
|
40
|
-
EditorContext
|
|
41
|
-
} from "@tiptap/react";
|
|
42
|
-
import { useCallback, useContext } from "react";
|
|
43
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
44
|
-
var BasicEditor = ({
|
|
45
|
-
variant,
|
|
46
|
-
bordered,
|
|
47
|
-
content,
|
|
48
|
-
variables,
|
|
49
|
-
variableValues,
|
|
50
|
-
showToolbar = true,
|
|
51
|
-
...options
|
|
52
|
-
}) => {
|
|
53
|
-
const editor = useCreateEditor({
|
|
54
|
-
content,
|
|
55
|
-
enableVariables: !!(variables == null ? void 0 : variables.length),
|
|
56
|
-
...options
|
|
57
|
-
});
|
|
58
|
-
const styles = editorBasic({ variant, bordered });
|
|
59
|
-
const resolveVariable = useCallback(
|
|
60
|
-
(name) => variableValues == null ? void 0 : variableValues[name],
|
|
61
|
-
[variableValues]
|
|
62
|
-
);
|
|
63
|
-
if (!editor) {
|
|
64
|
-
return /* @__PURE__ */ jsx(LoadingSpinner, {});
|
|
65
|
-
}
|
|
66
|
-
const isBottomToolbar = variant === "field";
|
|
67
|
-
const hasVariables = variables && variables.length > 0;
|
|
68
|
-
const editorContent = /* @__PURE__ */ jsx(EditorUIProvider, { value: { styles }, children: /* @__PURE__ */ jsx("div", { className: styles.root(), "data-slot": "editor", children: /* @__PURE__ */ jsxs(EditorContext.Provider, { value: { editor }, children: [
|
|
69
|
-
showToolbar && !isBottomToolbar && /* @__PURE__ */ jsx(EditorHeader, { editor, variant }),
|
|
70
|
-
/* @__PURE__ */ jsx(EditorContentArea, { variant, variables }),
|
|
71
|
-
showToolbar && isBottomToolbar && /* @__PURE__ */ jsx(EditorHeader, { editor, variant })
|
|
72
|
-
] }) }) });
|
|
73
|
-
if (hasVariables) {
|
|
74
|
-
return /* @__PURE__ */ jsx(VariableProvider, { variables, resolveVariable, children: editorContent });
|
|
75
|
-
}
|
|
76
|
-
return editorContent;
|
|
77
|
-
};
|
|
78
|
-
var EditorContentArea = ({ variant, variables }) => {
|
|
79
|
-
const styles = editorBasic({ variant });
|
|
80
|
-
const { editor } = useContext(EditorContext);
|
|
81
|
-
const { isDragging } = useUiEditorState(editor);
|
|
82
|
-
useScrollToHash();
|
|
83
|
-
const handleKeyDown = useCallback(
|
|
84
|
-
(e) => {
|
|
85
|
-
if (!(editor == null ? void 0 : editor.isFocused)) return;
|
|
86
|
-
const isMod = e.metaKey || e.ctrlKey;
|
|
87
|
-
const key = e.key.toLowerCase();
|
|
88
|
-
const editorShortcuts = [
|
|
89
|
-
isMod && key === "b",
|
|
90
|
-
// Bold
|
|
91
|
-
isMod && key === "i",
|
|
92
|
-
// Italic
|
|
93
|
-
isMod && key === "u",
|
|
94
|
-
// Underline
|
|
95
|
-
isMod && e.shiftKey && key === "x",
|
|
96
|
-
// Strikethrough
|
|
97
|
-
isMod && key === "k",
|
|
98
|
-
// Link
|
|
99
|
-
isMod && key === "z",
|
|
100
|
-
// Undo
|
|
101
|
-
isMod && e.shiftKey && key === "z",
|
|
102
|
-
// Redo
|
|
103
|
-
isMod && key === "y",
|
|
104
|
-
// Redo (alternative)
|
|
105
|
-
isMod && key === "a",
|
|
106
|
-
// Select all
|
|
107
|
-
isMod && key === "e",
|
|
108
|
-
// Code
|
|
109
|
-
isMod && e.shiftKey && key === "e"
|
|
110
|
-
// Code block
|
|
111
|
-
];
|
|
112
|
-
if (editorShortcuts.some(Boolean)) {
|
|
113
|
-
e.stopPropagation();
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
[editor]
|
|
117
|
-
);
|
|
118
|
-
if (!editor) {
|
|
119
|
-
return null;
|
|
120
|
-
}
|
|
121
|
-
const isEditable = editor.isEditable;
|
|
122
|
-
return (
|
|
123
|
-
// biome-ignore lint/a11y/noStaticElementInteractions: Wrapper intercepts keyboard shortcuts to prevent propagation
|
|
124
|
-
/* @__PURE__ */ jsxs("div", { className: styles.wrapper(), onKeyDown: handleKeyDown, children: [
|
|
125
|
-
/* @__PURE__ */ jsxs(
|
|
126
|
-
EditorContent,
|
|
127
|
-
{
|
|
128
|
-
editor,
|
|
129
|
-
role: "presentation",
|
|
130
|
-
className: styles.content(),
|
|
131
|
-
style: {
|
|
132
|
-
cursor: isDragging ? "grabbing" : "auto"
|
|
133
|
-
},
|
|
134
|
-
children: [
|
|
135
|
-
isEditable && /* @__PURE__ */ jsx(SlashDropdownMenu, {}),
|
|
136
|
-
isEditable && variables && variables.length > 0 && /* @__PURE__ */ jsx(VariableSuggestion, { editor, variables })
|
|
137
|
-
]
|
|
138
|
-
}
|
|
139
|
-
),
|
|
140
|
-
isEditable && /* @__PURE__ */ jsx(BubbleMenu, { editor }),
|
|
141
|
-
isEditable && /* @__PURE__ */ jsx(LinkBubble, { editor })
|
|
142
|
-
] })
|
|
143
|
-
);
|
|
144
|
-
};
|
|
145
|
-
function LoadingSpinner({ text = "Connecting..." }) {
|
|
146
|
-
const styles = editorSpinner();
|
|
147
|
-
return /* @__PURE__ */ jsx("div", { className: styles.root(), children: /* @__PURE__ */ jsxs("div", { className: styles.content(), children: [
|
|
148
|
-
/* @__PURE__ */ jsxs(
|
|
149
|
-
"svg",
|
|
150
|
-
{
|
|
151
|
-
className: styles.svg(),
|
|
152
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
153
|
-
fill: "none",
|
|
154
|
-
viewBox: "0 0 24 24",
|
|
155
|
-
children: [
|
|
156
|
-
/* @__PURE__ */ jsx("title", { children: "Loading Spinner" }),
|
|
157
|
-
/* @__PURE__ */ jsx("circle", { className: styles.circle(), cx: "12", cy: "12", r: "10" }),
|
|
158
|
-
/* @__PURE__ */ jsx(
|
|
159
|
-
"path",
|
|
160
|
-
{
|
|
161
|
-
className: styles.path(),
|
|
162
|
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
163
|
-
}
|
|
164
|
-
)
|
|
165
|
-
]
|
|
166
|
-
}
|
|
167
|
-
),
|
|
168
|
-
/* @__PURE__ */ jsx("div", { className: styles.text(), children: text })
|
|
169
|
-
] }) });
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export {
|
|
173
|
-
BasicEditor
|
|
174
|
-
};
|
package/dist/chunk-552JLRNB.mjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/extensions/variable/extract-variables.ts
|
|
4
|
-
function extractVariablesFromContent(content) {
|
|
5
|
-
if (!content) return [];
|
|
6
|
-
const variables = /* @__PURE__ */ new Map();
|
|
7
|
-
function scan(node) {
|
|
8
|
-
var _a;
|
|
9
|
-
if (node.type === "variable" && ((_a = node.attrs) == null ? void 0 : _a.name)) {
|
|
10
|
-
const name = node.attrs.name;
|
|
11
|
-
if (!variables.has(name)) {
|
|
12
|
-
variables.set(name, {
|
|
13
|
-
name,
|
|
14
|
-
label: formatVariableName(name),
|
|
15
|
-
category: node.attrs.category || void 0,
|
|
16
|
-
fallback: node.attrs.fallback || void 0
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
if (node.content && Array.isArray(node.content)) {
|
|
21
|
-
for (const child of node.content) {
|
|
22
|
-
scan(child);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
scan(content);
|
|
27
|
-
return Array.from(variables.values());
|
|
28
|
-
}
|
|
29
|
-
function formatVariableName(name) {
|
|
30
|
-
return name.replace(/([A-Z])/g, " $1").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()).replace(/\s+/g, " ").trim();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export {
|
|
34
|
-
extractVariablesFromContent
|
|
35
|
-
};
|
package/dist/chunk-5SMDMQDF.mjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/extensions/variable/variable-context.tsx
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
var VariableContext = React.createContext(null);
|
|
7
|
-
function VariableProvider({
|
|
8
|
-
children,
|
|
9
|
-
variables,
|
|
10
|
-
resolveVariable
|
|
11
|
-
}) {
|
|
12
|
-
const value = React.useMemo(
|
|
13
|
-
() => ({
|
|
14
|
-
variables,
|
|
15
|
-
resolveVariable
|
|
16
|
-
}),
|
|
17
|
-
[variables, resolveVariable]
|
|
18
|
-
);
|
|
19
|
-
return /* @__PURE__ */ jsx(VariableContext.Provider, { value, children });
|
|
20
|
-
}
|
|
21
|
-
function useVariables() {
|
|
22
|
-
return React.useContext(VariableContext);
|
|
23
|
-
}
|
|
24
|
-
function useVariablesWithFallback(fallbackVariables = []) {
|
|
25
|
-
var _a;
|
|
26
|
-
const context = React.useContext(VariableContext);
|
|
27
|
-
return (_a = context == null ? void 0 : context.variables) != null ? _a : fallbackVariables;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export {
|
|
31
|
-
VariableProvider,
|
|
32
|
-
useVariables,
|
|
33
|
-
useVariablesWithFallback
|
|
34
|
-
};
|
package/dist/chunk-6552DQWB.mjs
DELETED
|
@@ -1,416 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
toggleTable
|
|
4
|
-
} from "./chunk-YJAHZXLG.mjs";
|
|
5
|
-
|
|
6
|
-
// src/ui/slash-dropdown-menu/use-slash-dropdown-menu.ts
|
|
7
|
-
import {
|
|
8
|
-
findSelectionPosition,
|
|
9
|
-
hasContentAbove,
|
|
10
|
-
isExtensionAvailable,
|
|
11
|
-
isNodeInSchema
|
|
12
|
-
} from "@kopexa/editor-utils";
|
|
13
|
-
import {
|
|
14
|
-
AiSparklesIcon,
|
|
15
|
-
AlertIcon,
|
|
16
|
-
BlockquoteIcon,
|
|
17
|
-
CodeBlockIcon,
|
|
18
|
-
ControlsIcon,
|
|
19
|
-
HeadingOneIcon,
|
|
20
|
-
HeadingThreeIcon,
|
|
21
|
-
HeadingTwoIcon,
|
|
22
|
-
ImageIcon,
|
|
23
|
-
InfoIcon,
|
|
24
|
-
ListIcon,
|
|
25
|
-
ListOrderedIcon,
|
|
26
|
-
ListTodoIcon,
|
|
27
|
-
MinusIcon,
|
|
28
|
-
TableIcon,
|
|
29
|
-
TableOfContentsIcon,
|
|
30
|
-
TypeIcon
|
|
31
|
-
} from "@kopexa/icons";
|
|
32
|
-
import * as React from "react";
|
|
33
|
-
var texts = {
|
|
34
|
-
// AI
|
|
35
|
-
continue_writing: {
|
|
36
|
-
title: "Continue Writing",
|
|
37
|
-
subtext: "Continue writing from the current position",
|
|
38
|
-
keywords: ["continue", "write", "continue writing", "ai"],
|
|
39
|
-
badge: AiSparklesIcon,
|
|
40
|
-
group: "AI"
|
|
41
|
-
},
|
|
42
|
-
ai_ask_button: {
|
|
43
|
-
title: "Ask AI",
|
|
44
|
-
subtext: "Ask AI to generate content",
|
|
45
|
-
keywords: ["ai", "ask", "generate"],
|
|
46
|
-
badge: AiSparklesIcon,
|
|
47
|
-
group: "AI"
|
|
48
|
-
},
|
|
49
|
-
// Style
|
|
50
|
-
text: {
|
|
51
|
-
title: "Text",
|
|
52
|
-
subtext: "Regular text paragraph",
|
|
53
|
-
keywords: ["p", "paragraph", "text"],
|
|
54
|
-
badge: TypeIcon,
|
|
55
|
-
group: "Style"
|
|
56
|
-
},
|
|
57
|
-
heading_1: {
|
|
58
|
-
title: "Heading 1",
|
|
59
|
-
subtext: "Top-level heading",
|
|
60
|
-
keywords: ["h", "heading1", "h1"],
|
|
61
|
-
badge: HeadingOneIcon,
|
|
62
|
-
group: "Style"
|
|
63
|
-
},
|
|
64
|
-
heading_2: {
|
|
65
|
-
title: "Heading 2",
|
|
66
|
-
subtext: "Key section heading",
|
|
67
|
-
keywords: ["h2", "heading2", "subheading"],
|
|
68
|
-
badge: HeadingTwoIcon,
|
|
69
|
-
group: "Style"
|
|
70
|
-
},
|
|
71
|
-
heading_3: {
|
|
72
|
-
title: "Heading 3",
|
|
73
|
-
subtext: "Subsection and group heading",
|
|
74
|
-
keywords: ["h3", "heading3", "subheading"],
|
|
75
|
-
badge: HeadingThreeIcon,
|
|
76
|
-
group: "Style"
|
|
77
|
-
},
|
|
78
|
-
bullet_list: {
|
|
79
|
-
title: "Bullet List",
|
|
80
|
-
subtext: "List with unordered items",
|
|
81
|
-
keywords: ["ul", "li", "list", "bulletlist", "bullet list"],
|
|
82
|
-
badge: ListIcon,
|
|
83
|
-
group: "Style"
|
|
84
|
-
},
|
|
85
|
-
ordered_list: {
|
|
86
|
-
title: "Numbered List",
|
|
87
|
-
subtext: "List with ordered items",
|
|
88
|
-
keywords: ["ol", "li", "list", "numberedlist", "numbered list"],
|
|
89
|
-
badge: ListOrderedIcon,
|
|
90
|
-
group: "Style"
|
|
91
|
-
},
|
|
92
|
-
task_list: {
|
|
93
|
-
title: "To-do list",
|
|
94
|
-
subtext: "List with tasks",
|
|
95
|
-
keywords: ["tasklist", "task list", "todo", "checklist"],
|
|
96
|
-
badge: ListTodoIcon,
|
|
97
|
-
group: "Style"
|
|
98
|
-
},
|
|
99
|
-
quote: {
|
|
100
|
-
title: "Blockquote",
|
|
101
|
-
subtext: "Blockquote block",
|
|
102
|
-
keywords: ["quote", "blockquote"],
|
|
103
|
-
badge: BlockquoteIcon,
|
|
104
|
-
group: "Style"
|
|
105
|
-
},
|
|
106
|
-
code_block: {
|
|
107
|
-
title: "Code Block",
|
|
108
|
-
subtext: "Code block with syntax highlighting",
|
|
109
|
-
keywords: ["code", "pre"],
|
|
110
|
-
badge: CodeBlockIcon,
|
|
111
|
-
group: "Style"
|
|
112
|
-
},
|
|
113
|
-
// Insert
|
|
114
|
-
// mention: {
|
|
115
|
-
// title: "Mention",
|
|
116
|
-
// subtext: "Mention a user or item",
|
|
117
|
-
// keywords: ["mention", "user", "item", "tag"],
|
|
118
|
-
// badge: AtSignIcon,
|
|
119
|
-
// group: "Insert",
|
|
120
|
-
// },
|
|
121
|
-
// emoji: {
|
|
122
|
-
// title: "Emoji",
|
|
123
|
-
// subtext: "Insert an emoji",
|
|
124
|
-
// keywords: ["emoji", "emoticon", "smiley"],
|
|
125
|
-
// badge: SmilePlusIcon,
|
|
126
|
-
// group: "Insert",
|
|
127
|
-
// },
|
|
128
|
-
control: {
|
|
129
|
-
title: "Control",
|
|
130
|
-
subtext: "Insert a control block",
|
|
131
|
-
keywords: ["control"],
|
|
132
|
-
badge: ControlsIcon,
|
|
133
|
-
group: "Insert"
|
|
134
|
-
},
|
|
135
|
-
divider: {
|
|
136
|
-
title: "Separator",
|
|
137
|
-
subtext: "Horizontal line to separate content",
|
|
138
|
-
keywords: ["hr", "horizontalRule", "line", "separator"],
|
|
139
|
-
badge: MinusIcon,
|
|
140
|
-
group: "Insert"
|
|
141
|
-
},
|
|
142
|
-
table: {
|
|
143
|
-
title: "Table",
|
|
144
|
-
subtext: "Insert a table",
|
|
145
|
-
keywords: ["table", "grid", "spreadsheet"],
|
|
146
|
-
badge: TableIcon,
|
|
147
|
-
group: "Insert"
|
|
148
|
-
},
|
|
149
|
-
table_of_contents: {
|
|
150
|
-
title: "Table of Contents",
|
|
151
|
-
subtext: "Auto-generated list of headings",
|
|
152
|
-
keywords: ["toc", "table of contents", "index", "navigation", "headings"],
|
|
153
|
-
badge: TableOfContentsIcon,
|
|
154
|
-
group: "Insert"
|
|
155
|
-
},
|
|
156
|
-
callout: {
|
|
157
|
-
title: "Callout",
|
|
158
|
-
subtext: "Highlighted block for important information",
|
|
159
|
-
keywords: ["callout", "info", "warning", "alert", "note", "tip"],
|
|
160
|
-
badge: InfoIcon,
|
|
161
|
-
group: "Insert"
|
|
162
|
-
},
|
|
163
|
-
callout_warning: {
|
|
164
|
-
title: "Warning",
|
|
165
|
-
subtext: "Warning callout block",
|
|
166
|
-
keywords: ["warning", "caution", "attention"],
|
|
167
|
-
badge: AlertIcon,
|
|
168
|
-
group: "Insert"
|
|
169
|
-
},
|
|
170
|
-
math: {
|
|
171
|
-
title: "Formula",
|
|
172
|
-
subtext: "LaTeX math formula block",
|
|
173
|
-
keywords: ["math", "latex", "formula", "equation", "katex"],
|
|
174
|
-
badge: TypeIcon,
|
|
175
|
-
group: "Insert"
|
|
176
|
-
},
|
|
177
|
-
// Upload
|
|
178
|
-
image: {
|
|
179
|
-
title: "Image",
|
|
180
|
-
subtext: "Resizable image with caption",
|
|
181
|
-
keywords: [
|
|
182
|
-
"image",
|
|
183
|
-
"imageUpload",
|
|
184
|
-
"upload",
|
|
185
|
-
"img",
|
|
186
|
-
"picture",
|
|
187
|
-
"media",
|
|
188
|
-
"url"
|
|
189
|
-
],
|
|
190
|
-
badge: ImageIcon,
|
|
191
|
-
group: "Upload"
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
var getItemImplementations = () => {
|
|
195
|
-
return {
|
|
196
|
-
// AI
|
|
197
|
-
continue_writing: {
|
|
198
|
-
check: (editor) => {
|
|
199
|
-
const { hasContent } = hasContentAbove(editor);
|
|
200
|
-
const extensionsReady = isExtensionAvailable(editor, [
|
|
201
|
-
"ai",
|
|
202
|
-
"aiAdvanced"
|
|
203
|
-
]);
|
|
204
|
-
return extensionsReady && hasContent;
|
|
205
|
-
},
|
|
206
|
-
action: ({ editor }) => {
|
|
207
|
-
const editorChain = editor.chain().focus();
|
|
208
|
-
const nodeSelectionPosition = findSelectionPosition({ editor });
|
|
209
|
-
if (nodeSelectionPosition !== null) {
|
|
210
|
-
editorChain.setNodeSelection(nodeSelectionPosition);
|
|
211
|
-
}
|
|
212
|
-
editorChain.run();
|
|
213
|
-
editor.chain().focus().aiGenerationShow().run();
|
|
214
|
-
requestAnimationFrame(() => {
|
|
215
|
-
const { hasContent, content } = hasContentAbove(editor);
|
|
216
|
-
const snippet = content.length > 500 ? `...${content.slice(-500)}` : content;
|
|
217
|
-
const prompt = hasContent ? `Context: ${snippet}
|
|
218
|
-
|
|
219
|
-
Continue writing from where the text above ends. Write ONLY ONE SENTENCE. DONT REPEAT THE TEXT.` : "Start writing a new paragraph. Write ONLY ONE SENTENCE.";
|
|
220
|
-
editor.chain().focus().aiTextPrompt({
|
|
221
|
-
stream: true,
|
|
222
|
-
format: "rich-text",
|
|
223
|
-
text: prompt
|
|
224
|
-
}).run();
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
},
|
|
228
|
-
ai_ask_button: {
|
|
229
|
-
check: (editor) => isExtensionAvailable(editor, ["ai", "aiAdvanced"]),
|
|
230
|
-
action: ({ editor }) => {
|
|
231
|
-
const editorChain = editor.chain().focus();
|
|
232
|
-
const nodeSelectionPosition = findSelectionPosition({ editor });
|
|
233
|
-
if (nodeSelectionPosition !== null) {
|
|
234
|
-
editorChain.setNodeSelection(nodeSelectionPosition);
|
|
235
|
-
}
|
|
236
|
-
editorChain.run();
|
|
237
|
-
editor.chain().focus().aiGenerationShow().run();
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
// Style
|
|
241
|
-
text: {
|
|
242
|
-
check: (editor) => isNodeInSchema("paragraph", editor),
|
|
243
|
-
action: ({ editor }) => {
|
|
244
|
-
editor.chain().focus().setParagraph().run();
|
|
245
|
-
}
|
|
246
|
-
},
|
|
247
|
-
heading_1: {
|
|
248
|
-
check: (editor) => isNodeInSchema("heading", editor),
|
|
249
|
-
action: ({ editor }) => {
|
|
250
|
-
editor.chain().focus().toggleHeading({ level: 1 }).run();
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
heading_2: {
|
|
254
|
-
check: (editor) => isNodeInSchema("heading", editor),
|
|
255
|
-
action: ({ editor }) => {
|
|
256
|
-
editor.chain().focus().toggleHeading({ level: 2 }).run();
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
heading_3: {
|
|
260
|
-
check: (editor) => isNodeInSchema("heading", editor),
|
|
261
|
-
action: ({ editor }) => {
|
|
262
|
-
editor.chain().focus().toggleHeading({ level: 3 }).run();
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
bullet_list: {
|
|
266
|
-
check: (editor) => isNodeInSchema("bulletList", editor),
|
|
267
|
-
action: ({ editor }) => {
|
|
268
|
-
editor.chain().focus().toggleBulletList().run();
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
ordered_list: {
|
|
272
|
-
check: (editor) => isNodeInSchema("orderedList", editor),
|
|
273
|
-
action: ({ editor }) => {
|
|
274
|
-
editor.chain().focus().toggleOrderedList().run();
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
task_list: {
|
|
278
|
-
check: (editor) => isNodeInSchema("taskList", editor),
|
|
279
|
-
action: ({ editor }) => {
|
|
280
|
-
editor.chain().focus().toggleTaskList().run();
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
quote: {
|
|
284
|
-
check: (editor) => isNodeInSchema("blockquote", editor),
|
|
285
|
-
action: ({ editor }) => {
|
|
286
|
-
editor.chain().focus().toggleBlockquote().run();
|
|
287
|
-
}
|
|
288
|
-
},
|
|
289
|
-
code_block: {
|
|
290
|
-
check: (editor) => isNodeInSchema("codeBlock", editor),
|
|
291
|
-
action: ({ editor }) => {
|
|
292
|
-
editor.chain().focus().toggleNode("codeBlock", "paragraph").run();
|
|
293
|
-
}
|
|
294
|
-
},
|
|
295
|
-
// Insert
|
|
296
|
-
// mention: {
|
|
297
|
-
// check: (editor: Editor) =>
|
|
298
|
-
// isExtensionAvailable(editor, ["mention", "mentionAdvanced"]),
|
|
299
|
-
// action: ({ editor }: { editor: Editor }) => addMentionTrigger(editor),
|
|
300
|
-
// },
|
|
301
|
-
// emoji: {
|
|
302
|
-
// check: (editor: Editor) =>
|
|
303
|
-
// isExtensionAvailable(editor, ["emoji", "emojiPicker"]),
|
|
304
|
-
// action: ({ editor }: { editor: Editor }) => addEmojiTrigger(editor),
|
|
305
|
-
// },
|
|
306
|
-
divider: {
|
|
307
|
-
check: (editor) => isNodeInSchema("horizontalRule", editor),
|
|
308
|
-
action: ({ editor }) => {
|
|
309
|
-
editor.chain().focus().setHorizontalRule().run();
|
|
310
|
-
}
|
|
311
|
-
},
|
|
312
|
-
table: {
|
|
313
|
-
check: (editor) => isNodeInSchema("table", editor),
|
|
314
|
-
action: ({ editor }) => toggleTable(editor, { rows: 3, cols: 3, withHeaderRow: true })
|
|
315
|
-
},
|
|
316
|
-
control: {
|
|
317
|
-
check: (editor) => isNodeInSchema("controlBlock", editor),
|
|
318
|
-
action: ({ editor }) => {
|
|
319
|
-
try {
|
|
320
|
-
return editor.chain().focus().insertControlBlock().run();
|
|
321
|
-
} catch (e) {
|
|
322
|
-
console.error(e);
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
table_of_contents: {
|
|
327
|
-
check: (editor) => isNodeInSchema("tableOfContentsNode", editor),
|
|
328
|
-
action: ({ editor }) => {
|
|
329
|
-
editor.chain().focus().insertTableOfContents().run();
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
callout: {
|
|
333
|
-
check: (editor) => isNodeInSchema("calloutNode", editor),
|
|
334
|
-
action: ({ editor }) => {
|
|
335
|
-
editor.chain().focus().insertCallout("info").run();
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
callout_warning: {
|
|
339
|
-
check: (editor) => isNodeInSchema("calloutNode", editor),
|
|
340
|
-
action: ({ editor }) => {
|
|
341
|
-
editor.chain().focus().insertCallout("warning").run();
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
math: {
|
|
345
|
-
check: (editor) => isNodeInSchema("mathBlock", editor),
|
|
346
|
-
action: ({ editor }) => {
|
|
347
|
-
editor.chain().focus().insertMathBlock().run();
|
|
348
|
-
}
|
|
349
|
-
},
|
|
350
|
-
// Upload
|
|
351
|
-
image: {
|
|
352
|
-
check: (editor) => isNodeInSchema("imageUpload", editor),
|
|
353
|
-
action: ({ editor }) => {
|
|
354
|
-
editor.chain().focus().setImageUpload().run();
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
};
|
|
359
|
-
function organizeItemsByGroups(items, showGroups) {
|
|
360
|
-
if (!showGroups) {
|
|
361
|
-
return items.map((item) => ({ ...item, group: "" }));
|
|
362
|
-
}
|
|
363
|
-
const groups = {};
|
|
364
|
-
items.forEach((item) => {
|
|
365
|
-
const groupLabel = item.group || "";
|
|
366
|
-
if (!groups[groupLabel]) {
|
|
367
|
-
groups[groupLabel] = [];
|
|
368
|
-
}
|
|
369
|
-
groups[groupLabel].push(item);
|
|
370
|
-
});
|
|
371
|
-
const organizedItems = [];
|
|
372
|
-
Object.entries(groups).forEach(([, groupItems]) => {
|
|
373
|
-
organizedItems.push(...groupItems);
|
|
374
|
-
});
|
|
375
|
-
return organizedItems;
|
|
376
|
-
}
|
|
377
|
-
function useSlashDropdownMenu(config) {
|
|
378
|
-
const getSlashMenuItems = React.useCallback(
|
|
379
|
-
(editor) => {
|
|
380
|
-
const items = [];
|
|
381
|
-
const enabledItems = (config == null ? void 0 : config.enabledItems) || Object.keys(texts);
|
|
382
|
-
const showGroups = (config == null ? void 0 : config.showGroups) !== false;
|
|
383
|
-
const itemImplementations = getItemImplementations();
|
|
384
|
-
enabledItems.forEach((itemType) => {
|
|
385
|
-
var _a;
|
|
386
|
-
const itemImpl = itemImplementations[itemType];
|
|
387
|
-
const itemText = texts[itemType];
|
|
388
|
-
if (itemImpl && itemText && itemImpl.check(editor)) {
|
|
389
|
-
const item = {
|
|
390
|
-
onSelect: ({ editor: editor2 }) => itemImpl.action({ editor: editor2 }),
|
|
391
|
-
...itemText
|
|
392
|
-
};
|
|
393
|
-
if ((_a = config == null ? void 0 : config.itemGroups) == null ? void 0 : _a[itemType]) {
|
|
394
|
-
item.group = config.itemGroups[itemType];
|
|
395
|
-
} else if (!showGroups) {
|
|
396
|
-
item.group = "";
|
|
397
|
-
}
|
|
398
|
-
items.push(item);
|
|
399
|
-
}
|
|
400
|
-
});
|
|
401
|
-
if (config == null ? void 0 : config.customItems) {
|
|
402
|
-
items.push(...config.customItems);
|
|
403
|
-
}
|
|
404
|
-
return organizeItemsByGroups(items, showGroups);
|
|
405
|
-
},
|
|
406
|
-
[config]
|
|
407
|
-
);
|
|
408
|
-
return {
|
|
409
|
-
getSlashMenuItems,
|
|
410
|
-
config
|
|
411
|
-
};
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
export {
|
|
415
|
-
useSlashDropdownMenu
|
|
416
|
-
};
|