@kopexa/tiptap 17.6.18 → 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-L5RDMV3H.mjs
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
calculateStartPosition
|
|
4
|
-
} from "./chunk-CNVACBGT.mjs";
|
|
5
|
-
import {
|
|
6
|
-
useTiptapEditor
|
|
7
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
8
|
-
import {
|
|
9
|
-
useFloatingElement
|
|
10
|
-
} from "./chunk-KK4K43WM.mjs";
|
|
11
|
-
import {
|
|
12
|
-
useMenuNavigation
|
|
13
|
-
} from "./chunk-42HKGCOO.mjs";
|
|
14
|
-
|
|
15
|
-
// src/ui/suggestion-menu/suggestion-menu.tsx
|
|
16
|
-
import { FloatingPortal, flip, offset, shift, size } from "@floating-ui/react";
|
|
17
|
-
import { PluginKey } from "@tiptap/pm/state";
|
|
18
|
-
import {
|
|
19
|
-
Suggestion,
|
|
20
|
-
SuggestionPluginKey
|
|
21
|
-
} from "@tiptap/suggestion";
|
|
22
|
-
import * as React from "react";
|
|
23
|
-
import { jsx } from "react/jsx-runtime";
|
|
24
|
-
var SuggestionMenu = ({
|
|
25
|
-
editor: providedEditor,
|
|
26
|
-
floatingOptions,
|
|
27
|
-
selector = "tiptap-suggestion-menu",
|
|
28
|
-
children,
|
|
29
|
-
maxHeight = 384,
|
|
30
|
-
pluginKey = SuggestionPluginKey,
|
|
31
|
-
...internalSuggestionProps
|
|
32
|
-
}) => {
|
|
33
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
34
|
-
const [show, setShow] = React.useState(false);
|
|
35
|
-
const [internalClientRect, setInternalClientRect] = React.useState(null);
|
|
36
|
-
const [internalCommand, setInternalCommand] = React.useState(null);
|
|
37
|
-
const [internalItems, setInternalItems] = React.useState(
|
|
38
|
-
[]
|
|
39
|
-
);
|
|
40
|
-
const [internalQuery, setInternalQuery] = React.useState("");
|
|
41
|
-
const [, setInternalRange] = React.useState(null);
|
|
42
|
-
const { ref, style, getFloatingProps, isMounted } = useFloatingElement(
|
|
43
|
-
show,
|
|
44
|
-
internalClientRect,
|
|
45
|
-
1e3,
|
|
46
|
-
{
|
|
47
|
-
placement: "bottom-start",
|
|
48
|
-
middleware: [
|
|
49
|
-
offset(10),
|
|
50
|
-
flip({
|
|
51
|
-
mainAxis: true,
|
|
52
|
-
crossAxis: false
|
|
53
|
-
}),
|
|
54
|
-
shift(),
|
|
55
|
-
size({
|
|
56
|
-
apply({ availableHeight, elements }) {
|
|
57
|
-
if (elements.floating) {
|
|
58
|
-
const maxHeightValue = maxHeight ? Math.min(maxHeight, availableHeight) : availableHeight;
|
|
59
|
-
elements.floating.style.setProperty(
|
|
60
|
-
"--suggestion-menu-max-height",
|
|
61
|
-
`${maxHeightValue}px`
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
})
|
|
66
|
-
],
|
|
67
|
-
onOpenChange(open) {
|
|
68
|
-
if (!open) {
|
|
69
|
-
setShow(false);
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
...floatingOptions
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
const internalSuggestionPropsRef = React.useRef(internalSuggestionProps);
|
|
76
|
-
React.useEffect(() => {
|
|
77
|
-
internalSuggestionPropsRef.current = internalSuggestionProps;
|
|
78
|
-
}, [internalSuggestionProps]);
|
|
79
|
-
const closePopup = React.useCallback(() => {
|
|
80
|
-
setShow(false);
|
|
81
|
-
}, []);
|
|
82
|
-
React.useEffect(() => {
|
|
83
|
-
if (!editor || editor.isDestroyed) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
const existingPlugin = editor.state.plugins.find(
|
|
87
|
-
(plugin) => plugin.spec.key === pluginKey
|
|
88
|
-
);
|
|
89
|
-
if (existingPlugin) {
|
|
90
|
-
editor.unregisterPlugin(pluginKey);
|
|
91
|
-
}
|
|
92
|
-
const suggestion = Suggestion({
|
|
93
|
-
pluginKey: pluginKey instanceof PluginKey ? pluginKey : new PluginKey(pluginKey),
|
|
94
|
-
editor,
|
|
95
|
-
command({ editor: editor2, range, props }) {
|
|
96
|
-
var _a, _b;
|
|
97
|
-
if (!range) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
const { view, state } = editor2;
|
|
101
|
-
const { selection } = state;
|
|
102
|
-
const isMention = editor2.extensionManager.extensions.some(
|
|
103
|
-
(extension) => {
|
|
104
|
-
var _a2, _b2;
|
|
105
|
-
const name = extension.name;
|
|
106
|
-
return name === "mention" && ((_b2 = (_a2 = extension.options) == null ? void 0 : _a2.suggestion) == null ? void 0 : _b2.char) === internalSuggestionPropsRef.current.char;
|
|
107
|
-
}
|
|
108
|
-
);
|
|
109
|
-
if (!isMention) {
|
|
110
|
-
const cursorPosition = selection.$from.pos;
|
|
111
|
-
const previousNode = (_a = selection.$head) == null ? void 0 : _a.nodeBefore;
|
|
112
|
-
const startPosition = previousNode ? calculateStartPosition(
|
|
113
|
-
cursorPosition,
|
|
114
|
-
previousNode,
|
|
115
|
-
internalSuggestionPropsRef.current.char
|
|
116
|
-
) : selection.$from.start();
|
|
117
|
-
const transaction = state.tr.deleteRange(
|
|
118
|
-
startPosition,
|
|
119
|
-
cursorPosition
|
|
120
|
-
);
|
|
121
|
-
view.dispatch(transaction);
|
|
122
|
-
}
|
|
123
|
-
const nodeAfter = view.state.selection.$to.nodeAfter;
|
|
124
|
-
const overrideSpace = (_b = nodeAfter == null ? void 0 : nodeAfter.text) == null ? void 0 : _b.startsWith(" ");
|
|
125
|
-
const rangeToUse = { ...range };
|
|
126
|
-
if (overrideSpace) {
|
|
127
|
-
rangeToUse.to += 1;
|
|
128
|
-
}
|
|
129
|
-
props.onSelect({ editor: editor2, range: rangeToUse, context: props.context });
|
|
130
|
-
},
|
|
131
|
-
render: () => {
|
|
132
|
-
return {
|
|
133
|
-
onStart: (props) => {
|
|
134
|
-
var _a, _b;
|
|
135
|
-
setInternalCommand(() => props.command);
|
|
136
|
-
setInternalItems(props.items);
|
|
137
|
-
setInternalQuery(props.query);
|
|
138
|
-
setInternalRange(props.range);
|
|
139
|
-
setInternalClientRect((_b = (_a = props.clientRect) == null ? void 0 : _a.call(props)) != null ? _b : null);
|
|
140
|
-
setShow(true);
|
|
141
|
-
},
|
|
142
|
-
onUpdate: (props) => {
|
|
143
|
-
var _a, _b;
|
|
144
|
-
setInternalCommand(() => props.command);
|
|
145
|
-
setInternalItems(props.items);
|
|
146
|
-
setInternalQuery(props.query);
|
|
147
|
-
setInternalRange(props.range);
|
|
148
|
-
setInternalClientRect((_b = (_a = props.clientRect) == null ? void 0 : _a.call(props)) != null ? _b : null);
|
|
149
|
-
},
|
|
150
|
-
onKeyDown: (props) => {
|
|
151
|
-
if (props.event.key === "Escape") {
|
|
152
|
-
closePopup();
|
|
153
|
-
return true;
|
|
154
|
-
}
|
|
155
|
-
return false;
|
|
156
|
-
},
|
|
157
|
-
onExit: () => {
|
|
158
|
-
setInternalCommand(null);
|
|
159
|
-
setInternalItems([]);
|
|
160
|
-
setInternalQuery("");
|
|
161
|
-
setInternalRange(null);
|
|
162
|
-
setInternalClientRect(null);
|
|
163
|
-
setShow(false);
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
},
|
|
167
|
-
...internalSuggestionPropsRef.current
|
|
168
|
-
});
|
|
169
|
-
editor.registerPlugin(suggestion);
|
|
170
|
-
return () => {
|
|
171
|
-
if (!editor.isDestroyed) {
|
|
172
|
-
editor.unregisterPlugin(pluginKey);
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
}, [editor, pluginKey, closePopup]);
|
|
176
|
-
const onSelect = React.useCallback(
|
|
177
|
-
(item) => {
|
|
178
|
-
closePopup();
|
|
179
|
-
if (internalCommand) {
|
|
180
|
-
internalCommand(item);
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
[closePopup, internalCommand]
|
|
184
|
-
);
|
|
185
|
-
const { selectedIndex } = useMenuNavigation({
|
|
186
|
-
editor,
|
|
187
|
-
query: internalQuery,
|
|
188
|
-
items: internalItems,
|
|
189
|
-
onSelect
|
|
190
|
-
});
|
|
191
|
-
if (!isMounted || !show || !editor) {
|
|
192
|
-
return null;
|
|
193
|
-
}
|
|
194
|
-
return /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(
|
|
195
|
-
"div",
|
|
196
|
-
{
|
|
197
|
-
ref,
|
|
198
|
-
style,
|
|
199
|
-
...getFloatingProps(),
|
|
200
|
-
"data-selector": selector,
|
|
201
|
-
className: "tiptap-suggestion-menu",
|
|
202
|
-
role: "listbox",
|
|
203
|
-
"aria-label": "Suggestions",
|
|
204
|
-
onPointerDown: (e) => e.preventDefault(),
|
|
205
|
-
children: children({
|
|
206
|
-
items: internalItems,
|
|
207
|
-
selectedIndex,
|
|
208
|
-
onSelect
|
|
209
|
-
})
|
|
210
|
-
}
|
|
211
|
-
) });
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
export {
|
|
215
|
-
SuggestionMenu
|
|
216
|
-
};
|
package/dist/chunk-LNVWG34E.mjs
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useTiptapEditor
|
|
4
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
5
|
-
|
|
6
|
-
// src/ui/mark-button/index.tsx
|
|
7
|
-
import { isMarkInSchema, isNodeTypeSelected } from "@kopexa/editor-utils";
|
|
8
|
-
import {
|
|
9
|
-
BoldIcon,
|
|
10
|
-
CodeIcon,
|
|
11
|
-
ItalicIcon,
|
|
12
|
-
StrikeIcon,
|
|
13
|
-
SubscriptIcon,
|
|
14
|
-
SuperscriptIcon,
|
|
15
|
-
UnderlineIcon
|
|
16
|
-
} from "@kopexa/icons";
|
|
17
|
-
import { ToolbarButton } from "@kopexa/toolbar";
|
|
18
|
-
import { isNodeSelection } from "@tiptap/react";
|
|
19
|
-
import { useCallback, useMemo } from "react";
|
|
20
|
-
import { jsx } from "react/jsx-runtime";
|
|
21
|
-
var markIcons = {
|
|
22
|
-
bold: BoldIcon,
|
|
23
|
-
italic: ItalicIcon,
|
|
24
|
-
underline: UnderlineIcon,
|
|
25
|
-
strike: StrikeIcon,
|
|
26
|
-
code: CodeIcon,
|
|
27
|
-
superscript: SuperscriptIcon,
|
|
28
|
-
subscript: SubscriptIcon
|
|
29
|
-
};
|
|
30
|
-
var markShortcutKeys = {
|
|
31
|
-
bold: "mod+b",
|
|
32
|
-
italic: "mod+i",
|
|
33
|
-
underline: "mod+u",
|
|
34
|
-
strike: "mod+shift+s",
|
|
35
|
-
code: "mod+e",
|
|
36
|
-
superscript: "mod+.",
|
|
37
|
-
subscript: "mod+,"
|
|
38
|
-
};
|
|
39
|
-
function canToggleMark(editor, type) {
|
|
40
|
-
if (!editor || !editor.isEditable) return false;
|
|
41
|
-
if (!isMarkInSchema(type, editor) || isNodeTypeSelected(editor, ["image"]))
|
|
42
|
-
return false;
|
|
43
|
-
return editor.can().toggleMark(type);
|
|
44
|
-
}
|
|
45
|
-
function isMarkActive(editor, type) {
|
|
46
|
-
if (!editor) return false;
|
|
47
|
-
return editor.isActive(type);
|
|
48
|
-
}
|
|
49
|
-
function toggleMark(editor, type) {
|
|
50
|
-
if (!editor) return;
|
|
51
|
-
editor.chain().focus().toggleMark(type).run();
|
|
52
|
-
}
|
|
53
|
-
function isMarkButtonDisabled(editor, type, userDisabled = false) {
|
|
54
|
-
if (!editor) return true;
|
|
55
|
-
if (userDisabled) return true;
|
|
56
|
-
if (editor.isActive("codeBlock")) return true;
|
|
57
|
-
if (!canToggleMark(editor, type)) return true;
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
function shouldShowMarkButton(params) {
|
|
61
|
-
const { editor, type, hideWhenUnavailable, markInSchema } = params;
|
|
62
|
-
if (!markInSchema || !editor) {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
if (hideWhenUnavailable) {
|
|
66
|
-
if (isNodeSelection(editor.state.selection) || !canToggleMark(editor, type)) {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return true;
|
|
71
|
-
}
|
|
72
|
-
function getFormattedMarkName(type) {
|
|
73
|
-
return type.charAt(0).toUpperCase() + type.slice(1);
|
|
74
|
-
}
|
|
75
|
-
function useMarkState(editor, type, disabled = false) {
|
|
76
|
-
const markInSchema = isMarkInSchema(type, editor);
|
|
77
|
-
const isDisabled = isMarkButtonDisabled(editor, type, disabled);
|
|
78
|
-
const isActive = isMarkActive(editor, type);
|
|
79
|
-
const Icon = markIcons[type];
|
|
80
|
-
const shortcutKey = markShortcutKeys[type];
|
|
81
|
-
const formattedName = getFormattedMarkName(type);
|
|
82
|
-
return {
|
|
83
|
-
markInSchema,
|
|
84
|
-
isDisabled,
|
|
85
|
-
isActive,
|
|
86
|
-
Icon,
|
|
87
|
-
shortcutKey,
|
|
88
|
-
formattedName
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
var MarkButton = ({
|
|
92
|
-
editor: providedEditor,
|
|
93
|
-
type,
|
|
94
|
-
text,
|
|
95
|
-
hideWhenUnavailable = false,
|
|
96
|
-
className = "",
|
|
97
|
-
disabled,
|
|
98
|
-
onClick,
|
|
99
|
-
children,
|
|
100
|
-
...buttonProps
|
|
101
|
-
}) => {
|
|
102
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
103
|
-
const {
|
|
104
|
-
markInSchema,
|
|
105
|
-
isDisabled,
|
|
106
|
-
isActive,
|
|
107
|
-
Icon,
|
|
108
|
-
shortcutKey,
|
|
109
|
-
formattedName
|
|
110
|
-
} = useMarkState(editor, type, disabled);
|
|
111
|
-
const handleClick = useCallback(
|
|
112
|
-
(e) => {
|
|
113
|
-
onClick == null ? void 0 : onClick(e);
|
|
114
|
-
if (!e.defaultPrevented && !isDisabled && editor) {
|
|
115
|
-
toggleMark(editor, type);
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
[onClick, isDisabled, editor, type]
|
|
119
|
-
);
|
|
120
|
-
const show = useMemo(() => {
|
|
121
|
-
return shouldShowMarkButton({
|
|
122
|
-
editor,
|
|
123
|
-
type,
|
|
124
|
-
hideWhenUnavailable,
|
|
125
|
-
markInSchema
|
|
126
|
-
});
|
|
127
|
-
}, [editor, type, hideWhenUnavailable, markInSchema]);
|
|
128
|
-
if (!show || !editor || !editor.isEditable) {
|
|
129
|
-
return null;
|
|
130
|
-
}
|
|
131
|
-
return /* @__PURE__ */ jsx(
|
|
132
|
-
ToolbarButton,
|
|
133
|
-
{
|
|
134
|
-
type: "button",
|
|
135
|
-
className: className.trim(),
|
|
136
|
-
disabled: isDisabled,
|
|
137
|
-
variant: "ghost",
|
|
138
|
-
color: "default",
|
|
139
|
-
"data-active-state": isActive ? "on" : "off",
|
|
140
|
-
"data-disabled": isDisabled,
|
|
141
|
-
tabIndex: -1,
|
|
142
|
-
"aria-label": type,
|
|
143
|
-
"aria-pressed": isActive,
|
|
144
|
-
title: formattedName,
|
|
145
|
-
shortcutKeys: shortcutKey,
|
|
146
|
-
onClick: handleClick,
|
|
147
|
-
isIconOnly: true,
|
|
148
|
-
...buttonProps,
|
|
149
|
-
children: /* @__PURE__ */ jsx(Icon, {})
|
|
150
|
-
}
|
|
151
|
-
);
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
export {
|
|
155
|
-
markIcons,
|
|
156
|
-
markShortcutKeys,
|
|
157
|
-
canToggleMark,
|
|
158
|
-
isMarkActive,
|
|
159
|
-
toggleMark,
|
|
160
|
-
isMarkButtonDisabled,
|
|
161
|
-
shouldShowMarkButton,
|
|
162
|
-
getFormattedMarkName,
|
|
163
|
-
useMarkState,
|
|
164
|
-
MarkButton
|
|
165
|
-
};
|
package/dist/chunk-LVNUU67N.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";
|
package/dist/chunk-MNTOOEHA.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";
|
package/dist/chunk-N3JE67CS.mjs
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
ImageUploadNodeView
|
|
4
|
-
} from "./chunk-EAAQE5ZV.mjs";
|
|
5
|
-
|
|
6
|
-
// src/extensions/image-upload/index.ts
|
|
7
|
-
import { Node } from "@tiptap/core";
|
|
8
|
-
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
9
|
-
var ImageUploadNode = Node.create({
|
|
10
|
-
name: "imageUpload",
|
|
11
|
-
group: "block",
|
|
12
|
-
atom: true,
|
|
13
|
-
draggable: true,
|
|
14
|
-
selectable: true,
|
|
15
|
-
addOptions() {
|
|
16
|
-
return {
|
|
17
|
-
accept: "image/*",
|
|
18
|
-
maxSize: 0,
|
|
19
|
-
HTMLAttributes: {}
|
|
20
|
-
};
|
|
21
|
-
},
|
|
22
|
-
addAttributes() {
|
|
23
|
-
return {
|
|
24
|
-
// Upload state tracking
|
|
25
|
-
uploadState: {
|
|
26
|
-
default: null,
|
|
27
|
-
rendered: false
|
|
28
|
-
},
|
|
29
|
-
uploadProgress: {
|
|
30
|
-
default: null,
|
|
31
|
-
rendered: false
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
parseHTML() {
|
|
36
|
-
return [
|
|
37
|
-
{
|
|
38
|
-
tag: 'div[data-type="image-upload"]'
|
|
39
|
-
}
|
|
40
|
-
];
|
|
41
|
-
},
|
|
42
|
-
renderHTML({ HTMLAttributes }) {
|
|
43
|
-
return ["div", { ...HTMLAttributes, "data-type": "image-upload" }];
|
|
44
|
-
},
|
|
45
|
-
addNodeView() {
|
|
46
|
-
return ReactNodeViewRenderer(ImageUploadNodeView);
|
|
47
|
-
},
|
|
48
|
-
addCommands() {
|
|
49
|
-
return {
|
|
50
|
-
setImageUpload: () => ({ commands }) => {
|
|
51
|
-
return commands.insertContent({
|
|
52
|
-
type: this.name
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
},
|
|
57
|
-
addKeyboardShortcuts() {
|
|
58
|
-
return {
|
|
59
|
-
Enter: ({ editor }) => {
|
|
60
|
-
const { selection } = editor.state;
|
|
61
|
-
const { $from } = selection;
|
|
62
|
-
const node = $from.nodeAfter;
|
|
63
|
-
if ((node == null ? void 0 : node.type.name) === "imageUpload" && editor.isActive("imageUpload")) {
|
|
64
|
-
const nodeEl = editor.view.nodeDOM($from.pos);
|
|
65
|
-
if (nodeEl instanceof HTMLElement) {
|
|
66
|
-
const input = nodeEl.querySelector('input[type="file"]');
|
|
67
|
-
if (input instanceof HTMLElement) {
|
|
68
|
-
input.click();
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
export {
|
|
80
|
-
ImageUploadNode
|
|
81
|
-
};
|
package/dist/chunk-N4CT5RNC.mjs
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
messages
|
|
4
|
-
} from "./chunk-JCV5SEKN.mjs";
|
|
5
|
-
|
|
6
|
-
// src/extensions/callout/callout-settings.tsx
|
|
7
|
-
import { Button, IconButton } from "@kopexa/button";
|
|
8
|
-
import { Dialog } from "@kopexa/dialog";
|
|
9
|
-
import { SettingsIcon } from "@kopexa/icons";
|
|
10
|
-
import { Input } from "@kopexa/input";
|
|
11
|
-
import { Label } from "@kopexa/label";
|
|
12
|
-
import { Select } from "@kopexa/select";
|
|
13
|
-
import { useCallback, useEffect, useState } from "react";
|
|
14
|
-
import { useIntl } from "react-intl";
|
|
15
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
var VARIANTS = [
|
|
17
|
-
{ value: "default", messageKey: "variant_default" },
|
|
18
|
-
{ value: "info", messageKey: "variant_info" },
|
|
19
|
-
{ value: "success", messageKey: "variant_success" },
|
|
20
|
-
{ value: "warning", messageKey: "variant_warning" },
|
|
21
|
-
{ value: "destructive", messageKey: "variant_destructive" }
|
|
22
|
-
];
|
|
23
|
-
function CalloutSettings({
|
|
24
|
-
editor,
|
|
25
|
-
attrs,
|
|
26
|
-
getPos
|
|
27
|
-
}) {
|
|
28
|
-
const intl = useIntl();
|
|
29
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
30
|
-
const [localAttrs, setLocalAttrs] = useState(attrs);
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
if (isOpen) {
|
|
33
|
-
setLocalAttrs(attrs);
|
|
34
|
-
}
|
|
35
|
-
}, [isOpen, attrs]);
|
|
36
|
-
const handleSave = useCallback(() => {
|
|
37
|
-
const pos = getPos();
|
|
38
|
-
if (pos === void 0) return;
|
|
39
|
-
editor.view.dispatch(
|
|
40
|
-
editor.state.tr.setNodeMarkup(pos, void 0, localAttrs)
|
|
41
|
-
);
|
|
42
|
-
setIsOpen(false);
|
|
43
|
-
}, [editor, localAttrs, getPos]);
|
|
44
|
-
const handleCancel = useCallback(() => {
|
|
45
|
-
setLocalAttrs(attrs);
|
|
46
|
-
setIsOpen(false);
|
|
47
|
-
}, [attrs]);
|
|
48
|
-
const handleVariantChange = useCallback((value) => {
|
|
49
|
-
setLocalAttrs((prev) => ({
|
|
50
|
-
...prev,
|
|
51
|
-
variant: String(value)
|
|
52
|
-
}));
|
|
53
|
-
}, []);
|
|
54
|
-
const handleTitleChange = useCallback(
|
|
55
|
-
(e) => {
|
|
56
|
-
const value = e.target.value;
|
|
57
|
-
setLocalAttrs((prev) => ({
|
|
58
|
-
...prev,
|
|
59
|
-
title: value || null
|
|
60
|
-
}));
|
|
61
|
-
},
|
|
62
|
-
[]
|
|
63
|
-
);
|
|
64
|
-
if (!editor.isEditable) {
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
-
/* @__PURE__ */ jsx(
|
|
69
|
-
IconButton,
|
|
70
|
-
{
|
|
71
|
-
size: "sm",
|
|
72
|
-
variant: "ghost",
|
|
73
|
-
"aria-label": intl.formatMessage(messages.settings),
|
|
74
|
-
onClick: (e) => {
|
|
75
|
-
e.stopPropagation();
|
|
76
|
-
e.preventDefault();
|
|
77
|
-
setIsOpen(true);
|
|
78
|
-
},
|
|
79
|
-
children: /* @__PURE__ */ jsx(SettingsIcon, { className: "size-3.5" })
|
|
80
|
-
}
|
|
81
|
-
),
|
|
82
|
-
/* @__PURE__ */ jsx(Dialog.Root, { open: isOpen, onOpenChange: setIsOpen, size: "sm", children: /* @__PURE__ */ jsxs(Dialog.Content, { children: [
|
|
83
|
-
/* @__PURE__ */ jsx(Dialog.Header, { children: /* @__PURE__ */ jsx(Dialog.Title, { children: intl.formatMessage(messages.settings) }) }),
|
|
84
|
-
/* @__PURE__ */ jsx(Dialog.Body, { children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
85
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
86
|
-
/* @__PURE__ */ jsx(Label, { className: "text-sm", children: intl.formatMessage(messages.variant) }),
|
|
87
|
-
/* @__PURE__ */ jsxs(
|
|
88
|
-
Select,
|
|
89
|
-
{
|
|
90
|
-
size: "sm",
|
|
91
|
-
value: localAttrs.variant,
|
|
92
|
-
onValueChange: handleVariantChange,
|
|
93
|
-
children: [
|
|
94
|
-
/* @__PURE__ */ jsx(Select.Trigger, { children: /* @__PURE__ */ jsx(Select.Value, {}) }),
|
|
95
|
-
/* @__PURE__ */ jsx(Select.Content, { children: VARIANTS.map((v) => /* @__PURE__ */ jsx(Select.Item, { value: v.value, children: intl.formatMessage(messages[v.messageKey]) }, v.value)) })
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
|
-
)
|
|
99
|
-
] }),
|
|
100
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
101
|
-
/* @__PURE__ */ jsx(Label, { className: "text-sm", children: intl.formatMessage(messages.title) }),
|
|
102
|
-
/* @__PURE__ */ jsx(
|
|
103
|
-
Input,
|
|
104
|
-
{
|
|
105
|
-
size: "sm",
|
|
106
|
-
value: localAttrs.title || "",
|
|
107
|
-
onChange: handleTitleChange,
|
|
108
|
-
placeholder: intl.formatMessage(messages.title_placeholder)
|
|
109
|
-
}
|
|
110
|
-
)
|
|
111
|
-
] })
|
|
112
|
-
] }) }),
|
|
113
|
-
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [
|
|
114
|
-
/* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: handleCancel, children: intl.formatMessage(messages.cancel) }),
|
|
115
|
-
/* @__PURE__ */ jsx(Button, { onClick: handleSave, children: intl.formatMessage(messages.save) })
|
|
116
|
-
] })
|
|
117
|
-
] }) })
|
|
118
|
-
] });
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export {
|
|
122
|
-
CalloutSettings
|
|
123
|
-
};
|
package/dist/chunk-OEVR5N7X.mjs
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useCodeBlock
|
|
4
|
-
} from "./chunk-BEV5U2DK.mjs";
|
|
5
|
-
import {
|
|
6
|
-
useTiptapEditor
|
|
7
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
8
|
-
|
|
9
|
-
// src/ui/codeblock-button/code-block-button.tsx
|
|
10
|
-
import { CodeblockIcon } from "@kopexa/icons";
|
|
11
|
-
import { ToolbarButton } from "@kopexa/toolbar";
|
|
12
|
-
import { useCallback } from "react";
|
|
13
|
-
import { jsx } from "react/jsx-runtime";
|
|
14
|
-
var CodeBlockButton = ({
|
|
15
|
-
editor: providedEditor,
|
|
16
|
-
text,
|
|
17
|
-
hideWhenUnavailable = false,
|
|
18
|
-
onToggled,
|
|
19
|
-
showShortcut = false,
|
|
20
|
-
onClick,
|
|
21
|
-
children,
|
|
22
|
-
...buttonProps
|
|
23
|
-
}) => {
|
|
24
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
25
|
-
const { isVisible, canToggle, isActive, handleToggle, label, shortcutKeys } = useCodeBlock({
|
|
26
|
-
editor,
|
|
27
|
-
hideWhenUnavailable,
|
|
28
|
-
onToggled
|
|
29
|
-
});
|
|
30
|
-
const handleClick = useCallback(
|
|
31
|
-
(event) => {
|
|
32
|
-
onClick == null ? void 0 : onClick(event);
|
|
33
|
-
if (event.defaultPrevented) return;
|
|
34
|
-
handleToggle();
|
|
35
|
-
},
|
|
36
|
-
[handleToggle, onClick]
|
|
37
|
-
);
|
|
38
|
-
if (!isVisible) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
return /* @__PURE__ */ jsx(
|
|
42
|
-
ToolbarButton,
|
|
43
|
-
{
|
|
44
|
-
type: "button",
|
|
45
|
-
variant: "ghost",
|
|
46
|
-
color: "default",
|
|
47
|
-
disabled: !canToggle,
|
|
48
|
-
"data-disabled": !canToggle,
|
|
49
|
-
"data-active-state": isActive ? "on" : "off",
|
|
50
|
-
tabIndex: -1,
|
|
51
|
-
"aria-label": "codeBlock",
|
|
52
|
-
"aria-pressed": isActive,
|
|
53
|
-
title: label,
|
|
54
|
-
shortcutKeys,
|
|
55
|
-
onClick: handleClick,
|
|
56
|
-
isIconOnly: true,
|
|
57
|
-
...buttonProps,
|
|
58
|
-
children: /* @__PURE__ */ jsx(CodeblockIcon, {})
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export {
|
|
64
|
-
CodeBlockButton
|
|
65
|
-
};
|
package/dist/chunk-P55PLOHR.mjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/hooks/use-tiptap-editor.ts
|
|
4
|
-
import { useCurrentEditor, useEditorState } from "@tiptap/react";
|
|
5
|
-
import { useMemo } from "react";
|
|
6
|
-
function useTiptapEditor(providedEditor) {
|
|
7
|
-
const { editor: coreEditor } = useCurrentEditor();
|
|
8
|
-
const mainEditor = useMemo(
|
|
9
|
-
() => providedEditor || coreEditor,
|
|
10
|
-
[providedEditor, coreEditor]
|
|
11
|
-
);
|
|
12
|
-
const editorState = useEditorState({
|
|
13
|
-
editor: mainEditor,
|
|
14
|
-
selector(context) {
|
|
15
|
-
if (!context.editor) {
|
|
16
|
-
return {
|
|
17
|
-
editor: null,
|
|
18
|
-
editorState: void 0,
|
|
19
|
-
canCommand: void 0
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
return {
|
|
23
|
-
editor: context.editor,
|
|
24
|
-
editorState: context.editor.state,
|
|
25
|
-
canCommand: context.editor.can
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return editorState || { editor: null };
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export {
|
|
33
|
-
useTiptapEditor
|
|
34
|
-
};
|