@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-EAAQE5ZV.mjs
DELETED
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
messages
|
|
4
|
-
} from "./chunk-DSBJFMHK.mjs";
|
|
5
|
-
import {
|
|
6
|
-
useEditorFile
|
|
7
|
-
} from "./chunk-VRQ6OSAZ.mjs";
|
|
8
|
-
|
|
9
|
-
// src/extensions/image-upload/image-upload-view.tsx
|
|
10
|
-
import { IconButton } from "@kopexa/button";
|
|
11
|
-
import {
|
|
12
|
-
AlertCircleIcon,
|
|
13
|
-
ImageIcon,
|
|
14
|
-
TrashIcon,
|
|
15
|
-
UploadIcon
|
|
16
|
-
} from "@kopexa/icons";
|
|
17
|
-
import { imagePlaceholder } from "@kopexa/theme";
|
|
18
|
-
import {
|
|
19
|
-
NodeViewWrapper,
|
|
20
|
-
useEditorState
|
|
21
|
-
} from "@tiptap/react";
|
|
22
|
-
import { useCallback, useMemo, useRef, useState } from "react";
|
|
23
|
-
import { useIntl } from "react-intl";
|
|
24
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
25
|
-
function ImageUploadNodeView({ editor, node, getPos }) {
|
|
26
|
-
const intl = useIntl();
|
|
27
|
-
const fileHandler = useEditorFile();
|
|
28
|
-
const isEditable = useEditorState({
|
|
29
|
-
editor,
|
|
30
|
-
selector: ({ editor: e }) => {
|
|
31
|
-
var _a;
|
|
32
|
-
return (_a = e == null ? void 0 : e.isEditable) != null ? _a : false;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
const [uploadState, setUploadState] = useState("idle");
|
|
36
|
-
const [uploadProgress, setUploadProgress] = useState(0);
|
|
37
|
-
const [isDragOver, setIsDragOver] = useState(false);
|
|
38
|
-
const fileInputRef = useRef(null);
|
|
39
|
-
const handleRemove = useCallback(() => {
|
|
40
|
-
const pos = getPos();
|
|
41
|
-
if (pos === void 0) return;
|
|
42
|
-
editor.commands.deleteRange({
|
|
43
|
-
from: pos,
|
|
44
|
-
to: pos + node.nodeSize
|
|
45
|
-
});
|
|
46
|
-
}, [editor, getPos, node.nodeSize]);
|
|
47
|
-
const handleFileSelect = useCallback(
|
|
48
|
-
async (file) => {
|
|
49
|
-
if (!fileHandler) return;
|
|
50
|
-
const pos = getPos();
|
|
51
|
-
if (pos === void 0) return;
|
|
52
|
-
setUploadState("uploading");
|
|
53
|
-
setUploadProgress(0);
|
|
54
|
-
try {
|
|
55
|
-
const ref = await fileHandler.upload(file, (percent) => {
|
|
56
|
-
setUploadProgress(percent);
|
|
57
|
-
});
|
|
58
|
-
const currentPos = getPos();
|
|
59
|
-
if (currentPos === void 0) return;
|
|
60
|
-
editor.chain().focus().deleteRange({ from: currentPos, to: currentPos + node.nodeSize }).insertContentAt(currentPos, {
|
|
61
|
-
type: "image",
|
|
62
|
-
attrs: {
|
|
63
|
-
src: ref,
|
|
64
|
-
alt: file.name.replace(/\.[^/.]+$/, ""),
|
|
65
|
-
title: file.name.replace(/\.[^/.]+$/, "")
|
|
66
|
-
}
|
|
67
|
-
}).run();
|
|
68
|
-
} catch (error) {
|
|
69
|
-
console.error("[ImageUpload] Upload failed:", error);
|
|
70
|
-
setUploadState("error");
|
|
71
|
-
setUploadProgress(0);
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
[fileHandler, editor, getPos, node.nodeSize]
|
|
75
|
-
);
|
|
76
|
-
const handleInputChange = useCallback(
|
|
77
|
-
(e) => {
|
|
78
|
-
var _a;
|
|
79
|
-
const file = (_a = e.target.files) == null ? void 0 : _a[0];
|
|
80
|
-
if (file) {
|
|
81
|
-
handleFileSelect(file);
|
|
82
|
-
}
|
|
83
|
-
e.target.value = "";
|
|
84
|
-
},
|
|
85
|
-
[handleFileSelect]
|
|
86
|
-
);
|
|
87
|
-
const handleDrop = useCallback(
|
|
88
|
-
(e) => {
|
|
89
|
-
e.preventDefault();
|
|
90
|
-
e.stopPropagation();
|
|
91
|
-
setIsDragOver(false);
|
|
92
|
-
const file = e.dataTransfer.files[0];
|
|
93
|
-
if (file == null ? void 0 : file.type.startsWith("image/")) {
|
|
94
|
-
handleFileSelect(file);
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
[handleFileSelect]
|
|
98
|
-
);
|
|
99
|
-
const handleDragOver = useCallback((e) => {
|
|
100
|
-
e.preventDefault();
|
|
101
|
-
e.stopPropagation();
|
|
102
|
-
}, []);
|
|
103
|
-
const handleDragEnter = useCallback((e) => {
|
|
104
|
-
e.preventDefault();
|
|
105
|
-
e.stopPropagation();
|
|
106
|
-
setIsDragOver(true);
|
|
107
|
-
}, []);
|
|
108
|
-
const handleDragLeave = useCallback((e) => {
|
|
109
|
-
e.preventDefault();
|
|
110
|
-
e.stopPropagation();
|
|
111
|
-
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
112
|
-
setIsDragOver(false);
|
|
113
|
-
}
|
|
114
|
-
}, []);
|
|
115
|
-
const handleClick = useCallback(() => {
|
|
116
|
-
var _a;
|
|
117
|
-
if (uploadState === "idle" || uploadState === "error") {
|
|
118
|
-
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
119
|
-
}
|
|
120
|
-
}, [uploadState]);
|
|
121
|
-
const styles = useMemo(
|
|
122
|
-
() => imagePlaceholder({
|
|
123
|
-
size: "md",
|
|
124
|
-
variant: isDragOver ? "default" : void 0
|
|
125
|
-
}),
|
|
126
|
-
[isDragOver]
|
|
127
|
-
);
|
|
128
|
-
const errorStyles = useMemo(
|
|
129
|
-
() => imagePlaceholder({ size: "md", variant: "error" }),
|
|
130
|
-
[]
|
|
131
|
-
);
|
|
132
|
-
const uploadingStyles = useMemo(
|
|
133
|
-
() => imagePlaceholder({ size: "md", variant: "uploading" }),
|
|
134
|
-
[]
|
|
135
|
-
);
|
|
136
|
-
const disabledStyles = useMemo(
|
|
137
|
-
() => imagePlaceholder({ size: "md", variant: "disabled" }),
|
|
138
|
-
[]
|
|
139
|
-
);
|
|
140
|
-
if (!fileHandler) {
|
|
141
|
-
return /* @__PURE__ */ jsx(NodeViewWrapper, { className: "my-4", "data-type": "image-upload", children: /* @__PURE__ */ jsx("div", { className: disabledStyles.root(), children: /* @__PURE__ */ jsxs("div", { className: disabledStyles.content(), children: [
|
|
142
|
-
/* @__PURE__ */ jsx(ImageIcon, { className: disabledStyles.icon() }),
|
|
143
|
-
/* @__PURE__ */ jsx("span", { className: disabledStyles.text(), children: intl.formatMessage(messages.files_not_supported) }),
|
|
144
|
-
isEditable && /* @__PURE__ */ jsx(
|
|
145
|
-
IconButton,
|
|
146
|
-
{
|
|
147
|
-
size: "sm",
|
|
148
|
-
variant: "ghost",
|
|
149
|
-
onClick: handleRemove,
|
|
150
|
-
"aria-label": intl.formatMessage(messages.remove),
|
|
151
|
-
children: /* @__PURE__ */ jsx(TrashIcon, { className: "size-4" })
|
|
152
|
-
}
|
|
153
|
-
)
|
|
154
|
-
] }) }) });
|
|
155
|
-
}
|
|
156
|
-
if (uploadState === "uploading") {
|
|
157
|
-
return /* @__PURE__ */ jsx(NodeViewWrapper, { className: "my-4", "data-type": "image-upload", children: /* @__PURE__ */ jsx("div", { className: uploadingStyles.root(), children: /* @__PURE__ */ jsxs("div", { className: uploadingStyles.content(), children: [
|
|
158
|
-
/* @__PURE__ */ jsxs("div", { className: "relative size-12", children: [
|
|
159
|
-
/* @__PURE__ */ jsxs(
|
|
160
|
-
"svg",
|
|
161
|
-
{
|
|
162
|
-
className: "size-12 -rotate-90",
|
|
163
|
-
viewBox: "0 0 36 36",
|
|
164
|
-
"aria-hidden": "true",
|
|
165
|
-
children: [
|
|
166
|
-
/* @__PURE__ */ jsx(
|
|
167
|
-
"circle",
|
|
168
|
-
{
|
|
169
|
-
cx: "18",
|
|
170
|
-
cy: "18",
|
|
171
|
-
r: "16",
|
|
172
|
-
fill: "none",
|
|
173
|
-
className: "stroke-muted",
|
|
174
|
-
strokeWidth: "2"
|
|
175
|
-
}
|
|
176
|
-
),
|
|
177
|
-
/* @__PURE__ */ jsx(
|
|
178
|
-
"circle",
|
|
179
|
-
{
|
|
180
|
-
cx: "18",
|
|
181
|
-
cy: "18",
|
|
182
|
-
r: "16",
|
|
183
|
-
fill: "none",
|
|
184
|
-
className: "stroke-primary",
|
|
185
|
-
strokeWidth: "2",
|
|
186
|
-
strokeDasharray: 100,
|
|
187
|
-
strokeDashoffset: 100 - uploadProgress,
|
|
188
|
-
strokeLinecap: "round"
|
|
189
|
-
}
|
|
190
|
-
)
|
|
191
|
-
]
|
|
192
|
-
}
|
|
193
|
-
),
|
|
194
|
-
/* @__PURE__ */ jsxs("span", { className: "absolute inset-0 flex items-center justify-center text-xs font-medium", children: [
|
|
195
|
-
uploadProgress,
|
|
196
|
-
"%"
|
|
197
|
-
] })
|
|
198
|
-
] }),
|
|
199
|
-
/* @__PURE__ */ jsx("span", { className: uploadingStyles.text(), children: intl.formatMessage(messages.uploading) })
|
|
200
|
-
] }) }) });
|
|
201
|
-
}
|
|
202
|
-
if (uploadState === "error") {
|
|
203
|
-
return /* @__PURE__ */ jsx(NodeViewWrapper, { className: "my-4", "data-type": "image-upload", children: /* @__PURE__ */ jsxs("div", { className: errorStyles.root(), onClick: handleClick, children: [
|
|
204
|
-
/* @__PURE__ */ jsxs("div", { className: errorStyles.content(), children: [
|
|
205
|
-
/* @__PURE__ */ jsx(AlertCircleIcon, { className: errorStyles.icon() }),
|
|
206
|
-
/* @__PURE__ */ jsx("span", { className: errorStyles.text(), children: intl.formatMessage(messages.upload_error) }),
|
|
207
|
-
/* @__PURE__ */ jsx("span", { className: errorStyles.hint(), children: intl.formatMessage(messages.click_to_retry) })
|
|
208
|
-
] }),
|
|
209
|
-
/* @__PURE__ */ jsx(
|
|
210
|
-
"input",
|
|
211
|
-
{
|
|
212
|
-
ref: fileInputRef,
|
|
213
|
-
type: "file",
|
|
214
|
-
accept: "image/*",
|
|
215
|
-
className: "hidden",
|
|
216
|
-
onChange: handleInputChange
|
|
217
|
-
}
|
|
218
|
-
),
|
|
219
|
-
isEditable && /* @__PURE__ */ jsx(
|
|
220
|
-
IconButton,
|
|
221
|
-
{
|
|
222
|
-
size: "sm",
|
|
223
|
-
variant: "ghost",
|
|
224
|
-
className: errorStyles.removeButton(),
|
|
225
|
-
onClick: (e) => {
|
|
226
|
-
e.stopPropagation();
|
|
227
|
-
handleRemove();
|
|
228
|
-
},
|
|
229
|
-
"aria-label": intl.formatMessage(messages.remove),
|
|
230
|
-
children: /* @__PURE__ */ jsx(TrashIcon, { className: "size-3.5" })
|
|
231
|
-
}
|
|
232
|
-
)
|
|
233
|
-
] }) });
|
|
234
|
-
}
|
|
235
|
-
return /* @__PURE__ */ jsx(NodeViewWrapper, { className: "my-4", "data-type": "image-upload", children: /* @__PURE__ */ jsxs(
|
|
236
|
-
"div",
|
|
237
|
-
{
|
|
238
|
-
className: `${styles.root()} ${isDragOver ? "border-primary bg-primary/10" : ""}`,
|
|
239
|
-
onClick: handleClick,
|
|
240
|
-
onDrop: handleDrop,
|
|
241
|
-
onDragOver: handleDragOver,
|
|
242
|
-
onDragEnter: handleDragEnter,
|
|
243
|
-
onDragLeave: handleDragLeave,
|
|
244
|
-
children: [
|
|
245
|
-
/* @__PURE__ */ jsxs("div", { className: styles.content(), children: [
|
|
246
|
-
/* @__PURE__ */ jsx(UploadIcon, { className: styles.icon() }),
|
|
247
|
-
/* @__PURE__ */ jsx("span", { className: styles.text(), children: intl.formatMessage(messages.upload_placeholder) }),
|
|
248
|
-
/* @__PURE__ */ jsx("span", { className: styles.hint(), children: intl.formatMessage(messages.upload_hint) })
|
|
249
|
-
] }),
|
|
250
|
-
/* @__PURE__ */ jsx(
|
|
251
|
-
"input",
|
|
252
|
-
{
|
|
253
|
-
ref: fileInputRef,
|
|
254
|
-
type: "file",
|
|
255
|
-
accept: "image/*",
|
|
256
|
-
className: "hidden",
|
|
257
|
-
onChange: handleInputChange
|
|
258
|
-
}
|
|
259
|
-
),
|
|
260
|
-
isEditable && /* @__PURE__ */ jsx(
|
|
261
|
-
IconButton,
|
|
262
|
-
{
|
|
263
|
-
size: "sm",
|
|
264
|
-
variant: "ghost",
|
|
265
|
-
className: styles.removeButton(),
|
|
266
|
-
onClick: (e) => {
|
|
267
|
-
e.stopPropagation();
|
|
268
|
-
handleRemove();
|
|
269
|
-
},
|
|
270
|
-
"aria-label": intl.formatMessage(messages.remove),
|
|
271
|
-
children: /* @__PURE__ */ jsx(TrashIcon, { className: "size-3.5" })
|
|
272
|
-
}
|
|
273
|
-
)
|
|
274
|
-
]
|
|
275
|
-
}
|
|
276
|
-
) });
|
|
277
|
-
}
|
|
278
|
-
var image_upload_view_default = ImageUploadNodeView;
|
|
279
|
-
|
|
280
|
-
export {
|
|
281
|
-
ImageUploadNodeView,
|
|
282
|
-
image_upload_view_default
|
|
283
|
-
};
|
package/dist/chunk-EHY2NAW7.mjs
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
getFormattedHeadingName,
|
|
4
|
-
headingShortcutKeys,
|
|
5
|
-
isHeadingActive,
|
|
6
|
-
isHeadingButtonDisabled,
|
|
7
|
-
shouldShowHeadingButton,
|
|
8
|
-
toggleHeading
|
|
9
|
-
} from "./chunk-33QD5PYJ.mjs";
|
|
10
|
-
import {
|
|
11
|
-
useTiptapEditor
|
|
12
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
13
|
-
|
|
14
|
-
// src/ui/heading-button/index.tsx
|
|
15
|
-
import { Button } from "@kopexa/button";
|
|
16
|
-
import { isNodeInSchema } from "@kopexa/editor-utils";
|
|
17
|
-
import {
|
|
18
|
-
HeadingFiveIcon,
|
|
19
|
-
HeadingFourIcon,
|
|
20
|
-
HeadingOneIcon,
|
|
21
|
-
HeadingSixIcon,
|
|
22
|
-
HeadingThreeIcon,
|
|
23
|
-
HeadingTwoIcon
|
|
24
|
-
} from "@kopexa/icons";
|
|
25
|
-
import * as React from "react";
|
|
26
|
-
import { jsx } from "react/jsx-runtime";
|
|
27
|
-
var headingIcons = {
|
|
28
|
-
1: HeadingOneIcon,
|
|
29
|
-
2: HeadingTwoIcon,
|
|
30
|
-
3: HeadingThreeIcon,
|
|
31
|
-
4: HeadingFourIcon,
|
|
32
|
-
5: HeadingFiveIcon,
|
|
33
|
-
6: HeadingSixIcon
|
|
34
|
-
};
|
|
35
|
-
function useHeadingState(editor, level, disabled = false) {
|
|
36
|
-
const headingInSchema = isNodeInSchema("heading", editor);
|
|
37
|
-
const isDisabled = isHeadingButtonDisabled(editor, level, disabled);
|
|
38
|
-
const isActive = isHeadingActive(editor, level);
|
|
39
|
-
const Icon = headingIcons[level];
|
|
40
|
-
const shortcutKey = headingShortcutKeys[level];
|
|
41
|
-
const formattedName = getFormattedHeadingName(level);
|
|
42
|
-
return {
|
|
43
|
-
headingInSchema,
|
|
44
|
-
isDisabled,
|
|
45
|
-
isActive,
|
|
46
|
-
Icon,
|
|
47
|
-
shortcutKey,
|
|
48
|
-
formattedName
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
var HeadingButton = ({
|
|
52
|
-
editor: providedEditor,
|
|
53
|
-
level,
|
|
54
|
-
text,
|
|
55
|
-
hideWhenUnavailable = false,
|
|
56
|
-
className = "",
|
|
57
|
-
disabled,
|
|
58
|
-
onClick,
|
|
59
|
-
children,
|
|
60
|
-
ref,
|
|
61
|
-
...buttonProps
|
|
62
|
-
}) => {
|
|
63
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
64
|
-
const {
|
|
65
|
-
headingInSchema,
|
|
66
|
-
isDisabled,
|
|
67
|
-
isActive,
|
|
68
|
-
Icon,
|
|
69
|
-
shortcutKey,
|
|
70
|
-
formattedName
|
|
71
|
-
} = useHeadingState(editor, level, disabled);
|
|
72
|
-
const handleClick = React.useCallback(
|
|
73
|
-
(e) => {
|
|
74
|
-
onClick == null ? void 0 : onClick(e);
|
|
75
|
-
if (!e.defaultPrevented && !isDisabled && editor) {
|
|
76
|
-
toggleHeading(editor, level);
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
[onClick, isDisabled, editor, level]
|
|
80
|
-
);
|
|
81
|
-
const show = React.useMemo(() => {
|
|
82
|
-
return shouldShowHeadingButton({
|
|
83
|
-
editor,
|
|
84
|
-
level,
|
|
85
|
-
hideWhenUnavailable,
|
|
86
|
-
headingInSchema
|
|
87
|
-
});
|
|
88
|
-
}, [editor, level, hideWhenUnavailable, headingInSchema]);
|
|
89
|
-
if (!show || !editor || !editor.isEditable) {
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
return /* @__PURE__ */ jsx(
|
|
93
|
-
Button,
|
|
94
|
-
{
|
|
95
|
-
type: "button",
|
|
96
|
-
className: className.trim(),
|
|
97
|
-
disabled: isDisabled,
|
|
98
|
-
variant: "ghost",
|
|
99
|
-
color: "default",
|
|
100
|
-
"data-active-state": isActive ? "on" : "off",
|
|
101
|
-
"data-disabled": isDisabled,
|
|
102
|
-
tabIndex: -1,
|
|
103
|
-
"aria-label": formattedName,
|
|
104
|
-
"aria-pressed": isActive,
|
|
105
|
-
tooltip: formattedName,
|
|
106
|
-
shortcutKeys: shortcutKey,
|
|
107
|
-
onClick: handleClick,
|
|
108
|
-
startContent: /* @__PURE__ */ jsx(Icon, {}),
|
|
109
|
-
...buttonProps,
|
|
110
|
-
ref,
|
|
111
|
-
children: children || text
|
|
112
|
-
}
|
|
113
|
-
);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
export {
|
|
117
|
-
headingIcons,
|
|
118
|
-
useHeadingState,
|
|
119
|
-
HeadingButton
|
|
120
|
-
};
|
package/dist/chunk-EIIWU5FR.mjs
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/extensions/link/index.ts
|
|
4
|
-
import TiptapLink from "@tiptap/extension-link";
|
|
5
|
-
import { Plugin, PluginKey, TextSelection } from "@tiptap/pm/state";
|
|
6
|
-
import { getMarkRange } from "@tiptap/react";
|
|
7
|
-
var Link = TiptapLink.extend({
|
|
8
|
-
inclusive: false,
|
|
9
|
-
parseHTML() {
|
|
10
|
-
return [
|
|
11
|
-
{
|
|
12
|
-
tag: 'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'
|
|
13
|
-
}
|
|
14
|
-
];
|
|
15
|
-
},
|
|
16
|
-
addProseMirrorPlugins() {
|
|
17
|
-
var _a;
|
|
18
|
-
const { editor } = this;
|
|
19
|
-
return [
|
|
20
|
-
...((_a = this.parent) == null ? void 0 : _a.call(this)) || [],
|
|
21
|
-
new Plugin({
|
|
22
|
-
key: new PluginKey("linkKeyHandler"),
|
|
23
|
-
props: {
|
|
24
|
-
handleKeyDown: (_, event) => {
|
|
25
|
-
const { selection } = editor.state;
|
|
26
|
-
if (event.key === "Escape" && selection.empty !== true) {
|
|
27
|
-
editor.commands.focus(selection.to, { scrollIntoView: false });
|
|
28
|
-
}
|
|
29
|
-
return false;
|
|
30
|
-
},
|
|
31
|
-
handleClick(view, pos) {
|
|
32
|
-
const { schema, doc, tr } = view.state;
|
|
33
|
-
let range;
|
|
34
|
-
if (schema.marks.link) {
|
|
35
|
-
range = getMarkRange(doc.resolve(pos), schema.marks.link);
|
|
36
|
-
}
|
|
37
|
-
if (!range) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const { from, to } = range;
|
|
41
|
-
const start = Math.min(from, to);
|
|
42
|
-
const end = Math.max(from, to);
|
|
43
|
-
if (pos < start || pos > end) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const $start = doc.resolve(start);
|
|
47
|
-
const $end = doc.resolve(end);
|
|
48
|
-
const transaction = tr.setSelection(
|
|
49
|
-
new TextSelection($start, $end)
|
|
50
|
-
);
|
|
51
|
-
view.dispatch(transaction);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
})
|
|
55
|
-
];
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
export {
|
|
60
|
-
Link
|
|
61
|
-
};
|
package/dist/chunk-ERPGWXFK.mjs
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useSlashDropdownMenu
|
|
4
|
-
} from "./chunk-6552DQWB.mjs";
|
|
5
|
-
import {
|
|
6
|
-
SuggestionMenu
|
|
7
|
-
} from "./chunk-L5RDMV3H.mjs";
|
|
8
|
-
import {
|
|
9
|
-
filterSuggestionItems
|
|
10
|
-
} from "./chunk-CNVACBGT.mjs";
|
|
11
|
-
|
|
12
|
-
// src/ui/slash-dropdown-menu/slash-dropdown-menu.tsx
|
|
13
|
-
import { Button } from "@kopexa/button";
|
|
14
|
-
import { getElementOverflowPosition } from "@kopexa/editor-utils";
|
|
15
|
-
import { Separator } from "@kopexa/separator";
|
|
16
|
-
import { slashDropdownMenu } from "@kopexa/theme";
|
|
17
|
-
import * as React from "react";
|
|
18
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
-
var SlashDropdownMenu = (props) => {
|
|
20
|
-
const { config, ...restProps } = props;
|
|
21
|
-
const { getSlashMenuItems } = useSlashDropdownMenu(config);
|
|
22
|
-
return /* @__PURE__ */ jsx(
|
|
23
|
-
SuggestionMenu,
|
|
24
|
-
{
|
|
25
|
-
char: "/",
|
|
26
|
-
pluginKey: "slashDropdownMenu",
|
|
27
|
-
decorationClass: "tiptap-slash-decoration",
|
|
28
|
-
decorationContent: "Filter...",
|
|
29
|
-
selector: "tiptap-slash-dropdown-menu",
|
|
30
|
-
items: ({ query, editor }) => filterSuggestionItems(getSlashMenuItems(editor), query),
|
|
31
|
-
...restProps,
|
|
32
|
-
children: (props2) => /* @__PURE__ */ jsx(List, { ...props2, config })
|
|
33
|
-
}
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
var Item = (props) => {
|
|
37
|
-
const { item, isSelected, onSelect } = props;
|
|
38
|
-
const itemRef = React.useRef(null);
|
|
39
|
-
React.useEffect(() => {
|
|
40
|
-
const selector = document.querySelector(
|
|
41
|
-
'[data-selector="tiptap-slash-dropdown-menu"]'
|
|
42
|
-
);
|
|
43
|
-
if (!itemRef.current || !isSelected || !selector) return;
|
|
44
|
-
const overflow = getElementOverflowPosition(itemRef.current, selector);
|
|
45
|
-
if (overflow === "top") {
|
|
46
|
-
itemRef.current.scrollIntoView(true);
|
|
47
|
-
} else if (overflow === "bottom") {
|
|
48
|
-
itemRef.current.scrollIntoView(false);
|
|
49
|
-
}
|
|
50
|
-
}, [isSelected]);
|
|
51
|
-
const BadgeIcon = item.badge;
|
|
52
|
-
return /* @__PURE__ */ jsx(
|
|
53
|
-
Button,
|
|
54
|
-
{
|
|
55
|
-
ref: itemRef,
|
|
56
|
-
variant: "ghost",
|
|
57
|
-
color: "default",
|
|
58
|
-
startContent: BadgeIcon && /* @__PURE__ */ jsx(BadgeIcon, {}),
|
|
59
|
-
"data-active-state": isSelected ? "on" : "off",
|
|
60
|
-
onClick: onSelect,
|
|
61
|
-
fullWidth: true,
|
|
62
|
-
spacing: "start",
|
|
63
|
-
children: item.title
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
};
|
|
67
|
-
var List = ({
|
|
68
|
-
items,
|
|
69
|
-
selectedIndex,
|
|
70
|
-
onSelect,
|
|
71
|
-
config
|
|
72
|
-
}) => {
|
|
73
|
-
const styles = slashDropdownMenu();
|
|
74
|
-
const renderedItems = React.useMemo(() => {
|
|
75
|
-
const rendered = [];
|
|
76
|
-
const showGroups = (config == null ? void 0 : config.showGroups) !== false;
|
|
77
|
-
if (!showGroups) {
|
|
78
|
-
items.forEach((item, index) => {
|
|
79
|
-
rendered.push(
|
|
80
|
-
/* @__PURE__ */ jsx(
|
|
81
|
-
Item,
|
|
82
|
-
{
|
|
83
|
-
item,
|
|
84
|
-
isSelected: index === selectedIndex,
|
|
85
|
-
onSelect: () => onSelect(item)
|
|
86
|
-
},
|
|
87
|
-
`item-${index}-${item.title}`
|
|
88
|
-
)
|
|
89
|
-
);
|
|
90
|
-
});
|
|
91
|
-
return rendered;
|
|
92
|
-
}
|
|
93
|
-
const groups = {};
|
|
94
|
-
items.forEach((item, index) => {
|
|
95
|
-
const groupLabel = item.group || "";
|
|
96
|
-
if (!groups[groupLabel]) {
|
|
97
|
-
groups[groupLabel] = { items: [], indices: [] };
|
|
98
|
-
}
|
|
99
|
-
groups[groupLabel].items.push(item);
|
|
100
|
-
groups[groupLabel].indices.push(index);
|
|
101
|
-
});
|
|
102
|
-
Object.entries(groups).forEach(([groupLabel, groupData], groupIndex) => {
|
|
103
|
-
if (groupIndex > 0) {
|
|
104
|
-
rendered.push(
|
|
105
|
-
/* @__PURE__ */ jsx(
|
|
106
|
-
Separator,
|
|
107
|
-
{
|
|
108
|
-
orientation: "horizontal"
|
|
109
|
-
},
|
|
110
|
-
`separator-${groupIndex.toString()}`
|
|
111
|
-
)
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
const groupItems = groupData.items.map((item, itemIndex) => {
|
|
115
|
-
const originalIndex = groupData.indices[itemIndex];
|
|
116
|
-
return /* @__PURE__ */ jsx(
|
|
117
|
-
Item,
|
|
118
|
-
{
|
|
119
|
-
item,
|
|
120
|
-
isSelected: originalIndex === selectedIndex,
|
|
121
|
-
onSelect: () => onSelect(item)
|
|
122
|
-
},
|
|
123
|
-
`item-${originalIndex}-${item.title}`
|
|
124
|
-
);
|
|
125
|
-
});
|
|
126
|
-
if (groupLabel) {
|
|
127
|
-
rendered.push(
|
|
128
|
-
/* @__PURE__ */ jsxs(
|
|
129
|
-
"div",
|
|
130
|
-
{
|
|
131
|
-
className: styles.cardItemGroup(),
|
|
132
|
-
children: [
|
|
133
|
-
/* @__PURE__ */ jsx("div", { className: styles.cardGroupLabel(), children: groupLabel }),
|
|
134
|
-
/* @__PURE__ */ jsx("div", { className: styles.cardGroup(), children: groupItems })
|
|
135
|
-
]
|
|
136
|
-
},
|
|
137
|
-
`group-${groupIndex}-${groupLabel}`
|
|
138
|
-
)
|
|
139
|
-
);
|
|
140
|
-
} else {
|
|
141
|
-
rendered.push(...groupItems);
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
return rendered;
|
|
145
|
-
}, [items, selectedIndex, onSelect, config == null ? void 0 : config.showGroups, styles]);
|
|
146
|
-
if (!renderedItems.length) {
|
|
147
|
-
return null;
|
|
148
|
-
}
|
|
149
|
-
return /* @__PURE__ */ jsx(
|
|
150
|
-
"div",
|
|
151
|
-
{
|
|
152
|
-
className: styles.card(),
|
|
153
|
-
style: {
|
|
154
|
-
maxHeight: "var(--suggestion-menu-max-height)"
|
|
155
|
-
},
|
|
156
|
-
children: /* @__PURE__ */ jsx("div", { className: styles.body(), children: renderedItems })
|
|
157
|
-
}
|
|
158
|
-
);
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
export {
|
|
162
|
-
SlashDropdownMenu
|
|
163
|
-
};
|
package/dist/chunk-F73FCUD5.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";
|
package/dist/chunk-FRJX2F4T.mjs
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/extensions/math/messages.ts
|
|
4
|
-
import { defineMessages } from "react-intl";
|
|
5
|
-
var messages = defineMessages({
|
|
6
|
-
title: {
|
|
7
|
-
id: "editor.math.title",
|
|
8
|
-
defaultMessage: "Formula",
|
|
9
|
-
description: "Math block title"
|
|
10
|
-
},
|
|
11
|
-
edit: {
|
|
12
|
-
id: "editor.math.edit",
|
|
13
|
-
defaultMessage: "Edit",
|
|
14
|
-
description: "Edit button label"
|
|
15
|
-
},
|
|
16
|
-
preview: {
|
|
17
|
-
id: "editor.math.preview",
|
|
18
|
-
defaultMessage: "Preview",
|
|
19
|
-
description: "Preview section label"
|
|
20
|
-
},
|
|
21
|
-
latex_input: {
|
|
22
|
-
id: "editor.math.latex_input",
|
|
23
|
-
defaultMessage: "LaTeX",
|
|
24
|
-
description: "LaTeX input label"
|
|
25
|
-
},
|
|
26
|
-
latex_placeholder: {
|
|
27
|
-
id: "editor.math.latex_placeholder",
|
|
28
|
-
defaultMessage: "Enter LaTeX formula...",
|
|
29
|
-
description: "LaTeX input placeholder"
|
|
30
|
-
},
|
|
31
|
-
invalid_latex: {
|
|
32
|
-
id: "editor.math.invalid_latex",
|
|
33
|
-
defaultMessage: "Invalid LaTeX syntax",
|
|
34
|
-
description: "Error message for invalid LaTeX"
|
|
35
|
-
},
|
|
36
|
-
empty_formula: {
|
|
37
|
-
id: "editor.math.empty_formula",
|
|
38
|
-
defaultMessage: "Click to add formula",
|
|
39
|
-
description: "Placeholder for empty formula"
|
|
40
|
-
},
|
|
41
|
-
save: {
|
|
42
|
-
id: "editor.math.save",
|
|
43
|
-
defaultMessage: "Save",
|
|
44
|
-
description: "Save button label"
|
|
45
|
-
},
|
|
46
|
-
cancel: {
|
|
47
|
-
id: "editor.math.cancel",
|
|
48
|
-
defaultMessage: "Cancel",
|
|
49
|
-
description: "Cancel button label"
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
export {
|
|
54
|
-
messages
|
|
55
|
-
};
|