@kopexa/tiptap 17.6.17 → 17.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +691 -24
- package/dist/index.d.ts +691 -24
- package/dist/index.js +1081 -668
- package/dist/index.mjs +7686 -112
- package/package.json +57 -52
- package/dist/chunk-2SI7MRAE.mjs +0 -64
- package/dist/chunk-2U5CQUZH.mjs +0 -91
- package/dist/chunk-2UDCL55K.mjs +0 -55
- package/dist/chunk-2V6VOAPI.mjs +0 -139
- package/dist/chunk-2Z2QVW67.mjs +0 -1
- package/dist/chunk-32SUXCAQ.mjs +0 -115
- package/dist/chunk-33QD5PYJ.mjs +0 -63
- package/dist/chunk-3VRQUYYW.mjs +0 -169
- package/dist/chunk-42HKGCOO.mjs +0 -129
- package/dist/chunk-4ALV4UA5.mjs +0 -1
- package/dist/chunk-4CDZ547I.mjs +0 -185
- package/dist/chunk-4HO7BWDC.mjs +0 -89
- package/dist/chunk-4JRYQZ4A.mjs +0 -174
- package/dist/chunk-552JLRNB.mjs +0 -35
- package/dist/chunk-5SMDMQDF.mjs +0 -34
- package/dist/chunk-6552DQWB.mjs +0 -416
- package/dist/chunk-7FDDRVUE.mjs +0 -143
- package/dist/chunk-7VGROP26.mjs +0 -262
- package/dist/chunk-7VW67NVL.mjs +0 -80
- package/dist/chunk-AAV7ZNBP.mjs +0 -83
- package/dist/chunk-ATRHILCH.mjs +0 -1
- package/dist/chunk-B7WJOQ3X.mjs +0 -103
- package/dist/chunk-BEV5U2DK.mjs +0 -131
- package/dist/chunk-BXHPO3T7.mjs +0 -152
- package/dist/chunk-BXJYNSWQ.mjs +0 -30
- package/dist/chunk-C5RQWJKE.mjs +0 -155
- package/dist/chunk-CNVACBGT.mjs +0 -51
- package/dist/chunk-DQK6PA4U.mjs +0 -276
- package/dist/chunk-DSBJFMHK.mjs +0 -38
- package/dist/chunk-DT7ML2P4.mjs +0 -42
- package/dist/chunk-DZLGLP7R.mjs +0 -99
- package/dist/chunk-EAAQE5ZV.mjs +0 -283
- package/dist/chunk-EHY2NAW7.mjs +0 -120
- package/dist/chunk-EIIWU5FR.mjs +0 -61
- package/dist/chunk-ERPGWXFK.mjs +0 -163
- package/dist/chunk-F73FCUD5.mjs +0 -1
- package/dist/chunk-FRJX2F4T.mjs +0 -55
- package/dist/chunk-GYIYX2JH.mjs +0 -73
- package/dist/chunk-H6LC4LDQ.mjs +0 -63
- package/dist/chunk-H7MS2UMO.mjs +0 -168
- package/dist/chunk-HLLA2HRV.mjs +0 -1
- package/dist/chunk-HTJ2RXOG.mjs +0 -32
- package/dist/chunk-IFXRPGIJ.mjs +0 -98
- package/dist/chunk-IOB3REX6.mjs +0 -173
- package/dist/chunk-IQERE7KP.mjs +0 -115
- package/dist/chunk-JCV5SEKN.mjs +0 -65
- package/dist/chunk-JVSH5T4B.mjs +0 -72
- package/dist/chunk-KK4K43WM.mjs +0 -59
- package/dist/chunk-KR42JAVB.mjs +0 -60
- package/dist/chunk-KYLBKQ2E.mjs +0 -203
- package/dist/chunk-L5RDMV3H.mjs +0 -216
- package/dist/chunk-LNVWG34E.mjs +0 -165
- package/dist/chunk-LVNUU67N.mjs +0 -1
- package/dist/chunk-MNTOOEHA.mjs +0 -1
- package/dist/chunk-N3JE67CS.mjs +0 -81
- package/dist/chunk-N4CT5RNC.mjs +0 -123
- package/dist/chunk-OEVR5N7X.mjs +0 -65
- package/dist/chunk-P55PLOHR.mjs +0 -34
- package/dist/chunk-Q5FK7SFY.mjs +0 -75
- package/dist/chunk-Q7DFJ5NI.mjs +0 -153
- package/dist/chunk-QIELBKP3.mjs +0 -104
- package/dist/chunk-R2GM4A3T.mjs +0 -71
- package/dist/chunk-REJEJXOZ.mjs +0 -10
- package/dist/chunk-RFWNKE7D.mjs +0 -238
- package/dist/chunk-TAM3VMJT.mjs +0 -80
- package/dist/chunk-TDFS3DCZ.mjs +0 -79
- package/dist/chunk-TLM5ALHZ.mjs +0 -1
- package/dist/chunk-TZQQ6C2Q.mjs +0 -101
- package/dist/chunk-U5XAL46P.mjs +0 -39
- package/dist/chunk-UJ4BNZ63.mjs +0 -178
- package/dist/chunk-UVHVCION.mjs +0 -168
- package/dist/chunk-V6TAZMQN.mjs +0 -105
- package/dist/chunk-VF3G2URZ.mjs +0 -83
- package/dist/chunk-VRQ6OSAZ.mjs +0 -76
- package/dist/chunk-VTKJPVNM.mjs +0 -148
- package/dist/chunk-VX3HSJ76.mjs +0 -73
- package/dist/chunk-W2FLOOJ6.mjs +0 -75
- package/dist/chunk-XGAABDMW.mjs +0 -159
- package/dist/chunk-Y2KSWMG5.mjs +0 -1
- package/dist/chunk-YJAHZXLG.mjs +0 -92
- package/dist/chunk-Z365KVQY.mjs +0 -34
- package/dist/chunk-ZVTJ6XD7.mjs +0 -88
- package/dist/chunk-ZZ4OU46C.mjs +0 -131
- package/dist/context/editor-context.d.mts +0 -10
- package/dist/context/editor-context.d.ts +0 -10
- package/dist/context/editor-context.js +0 -34
- package/dist/context/editor-context.mjs +0 -9
- package/dist/context/editor-file-context.d.mts +0 -70
- package/dist/context/editor-file-context.d.ts +0 -70
- package/dist/context/editor-file-context.js +0 -96
- package/dist/context/editor-file-context.mjs +0 -12
- package/dist/extensions/callout/callout-settings.d.mts +0 -13
- package/dist/extensions/callout/callout-settings.d.ts +0 -13
- package/dist/extensions/callout/callout-settings.js +0 -206
- package/dist/extensions/callout/callout-settings.mjs +0 -9
- package/dist/extensions/callout/callout-view.d.mts +0 -12
- package/dist/extensions/callout/callout-view.d.ts +0 -12
- package/dist/extensions/callout/callout-view.js +0 -273
- package/dist/extensions/callout/callout-view.mjs +0 -12
- package/dist/extensions/callout/index.d.mts +0 -44
- package/dist/extensions/callout/index.d.ts +0 -44
- package/dist/extensions/callout/index.js +0 -380
- package/dist/extensions/callout/index.mjs +0 -13
- package/dist/extensions/callout/messages.d.mts +0 -59
- package/dist/extensions/callout/messages.d.ts +0 -59
- package/dist/extensions/callout/messages.js +0 -88
- package/dist/extensions/callout/messages.mjs +0 -7
- package/dist/extensions/image/image-view.d.mts +0 -15
- package/dist/extensions/image/image-view.d.ts +0 -15
- package/dist/extensions/image/image-view.js +0 -255
- package/dist/extensions/image/image-view.mjs +0 -12
- package/dist/extensions/image/index.d.mts +0 -29
- package/dist/extensions/image/index.d.ts +0 -29
- package/dist/extensions/image/index.js +0 -282
- package/dist/extensions/image/index.mjs +0 -16
- package/dist/extensions/image/messages.d.mts +0 -28
- package/dist/extensions/image/messages.d.ts +0 -28
- package/dist/extensions/image/messages.js +0 -57
- package/dist/extensions/image/messages.mjs +0 -7
- package/dist/extensions/image-upload/image-upload-view.d.mts +0 -12
- package/dist/extensions/image-upload/image-upload-view.d.ts +0 -12
- package/dist/extensions/image-upload/image-upload-view.js +0 -338
- package/dist/extensions/image-upload/image-upload-view.mjs +0 -12
- package/dist/extensions/image-upload/index.d.mts +0 -46
- package/dist/extensions/image-upload/index.d.ts +0 -46
- package/dist/extensions/image-upload/index.js +0 -414
- package/dist/extensions/image-upload/index.mjs +0 -16
- package/dist/extensions/image-upload/messages.d.mts +0 -32
- package/dist/extensions/image-upload/messages.d.ts +0 -32
- package/dist/extensions/image-upload/messages.js +0 -61
- package/dist/extensions/image-upload/messages.mjs +0 -7
- package/dist/extensions/link/index.d.mts +0 -6
- package/dist/extensions/link/index.d.ts +0 -6
- package/dist/extensions/link/index.js +0 -94
- package/dist/extensions/link/index.mjs +0 -7
- package/dist/extensions/math/index.d.mts +0 -38
- package/dist/extensions/math/index.d.ts +0 -38
- package/dist/extensions/math/index.js +0 -544
- package/dist/extensions/math/index.mjs +0 -17
- package/dist/extensions/math/inline-math-view.d.mts +0 -12
- package/dist/extensions/math/inline-math-view.d.ts +0 -12
- package/dist/extensions/math/inline-math-view.js +0 -232
- package/dist/extensions/math/inline-math-view.mjs +0 -11
- package/dist/extensions/math/inline-math.d.mts +0 -32
- package/dist/extensions/math/inline-math.d.ts +0 -32
- package/dist/extensions/math/inline-math.js +0 -304
- package/dist/extensions/math/inline-math.mjs +0 -12
- package/dist/extensions/math/math-block-view.d.mts +0 -11
- package/dist/extensions/math/math-block-view.d.ts +0 -11
- package/dist/extensions/math/math-block-view.js +0 -248
- package/dist/extensions/math/math-block-view.mjs +0 -11
- package/dist/extensions/math/messages.d.mts +0 -49
- package/dist/extensions/math/messages.d.ts +0 -49
- package/dist/extensions/math/messages.js +0 -78
- package/dist/extensions/math/messages.mjs +0 -7
- package/dist/extensions/selection/index.d.mts +0 -5
- package/dist/extensions/selection/index.d.ts +0 -5
- package/dist/extensions/selection/index.js +0 -62
- package/dist/extensions/selection/index.mjs +0 -7
- package/dist/extensions/toc/index.d.mts +0 -53
- package/dist/extensions/toc/index.d.ts +0 -53
- package/dist/extensions/toc/index.js +0 -501
- package/dist/extensions/toc/index.mjs +0 -13
- package/dist/extensions/toc/messages.d.mts +0 -74
- package/dist/extensions/toc/messages.d.ts +0 -74
- package/dist/extensions/toc/messages.js +0 -103
- package/dist/extensions/toc/messages.mjs +0 -7
- package/dist/extensions/toc/toc-settings.d.mts +0 -13
- package/dist/extensions/toc/toc-settings.d.ts +0 -13
- package/dist/extensions/toc/toc-settings.js +0 -283
- package/dist/extensions/toc/toc-settings.mjs +0 -9
- package/dist/extensions/toc/toc-view.d.mts +0 -12
- package/dist/extensions/toc/toc-view.d.ts +0 -12
- package/dist/extensions/toc/toc-view.js +0 -411
- package/dist/extensions/toc/toc-view.mjs +0 -12
- package/dist/extensions/trailing-node/index.d.mts +0 -9
- package/dist/extensions/trailing-node/index.d.ts +0 -9
- package/dist/extensions/trailing-node/index.js +0 -86
- package/dist/extensions/trailing-node/index.mjs +0 -7
- package/dist/extensions/ui-state/index.d.mts +0 -34
- package/dist/extensions/ui-state/index.d.ts +0 -34
- package/dist/extensions/ui-state/index.js +0 -84
- package/dist/extensions/ui-state/index.mjs +0 -9
- package/dist/extensions/variable/extract-variables.d.mts +0 -16
- package/dist/extensions/variable/extract-variables.d.ts +0 -16
- package/dist/extensions/variable/extract-variables.js +0 -58
- package/dist/extensions/variable/extract-variables.mjs +0 -7
- package/dist/extensions/variable/index.d.mts +0 -38
- package/dist/extensions/variable/index.d.ts +0 -38
- package/dist/extensions/variable/index.js +0 -190
- package/dist/extensions/variable/index.mjs +0 -11
- package/dist/extensions/variable/messages.d.mts +0 -69
- package/dist/extensions/variable/messages.d.ts +0 -69
- package/dist/extensions/variable/messages.js +0 -98
- package/dist/extensions/variable/messages.mjs +0 -7
- package/dist/extensions/variable/variable-context.d.mts +0 -56
- package/dist/extensions/variable/variable-context.d.ts +0 -56
- package/dist/extensions/variable/variable-context.js +0 -70
- package/dist/extensions/variable/variable-context.mjs +0 -12
- package/dist/extensions/variable/variable-filler-dialog.d.mts +0 -43
- package/dist/extensions/variable/variable-filler-dialog.d.ts +0 -43
- package/dist/extensions/variable/variable-filler-dialog.js +0 -207
- package/dist/extensions/variable/variable-filler-dialog.mjs +0 -9
- package/dist/extensions/variable/variable-suggestion.d.mts +0 -31
- package/dist/extensions/variable/variable-suggestion.d.ts +0 -31
- package/dist/extensions/variable/variable-suggestion.js +0 -615
- package/dist/extensions/variable/variable-suggestion.mjs +0 -14
- package/dist/extensions/variable/variable-view.d.mts +0 -13
- package/dist/extensions/variable/variable-view.d.ts +0 -13
- package/dist/extensions/variable/variable-view.js +0 -110
- package/dist/extensions/variable/variable-view.mjs +0 -11
- package/dist/hooks/use-create-editor.d.mts +0 -46
- package/dist/hooks/use-create-editor.d.ts +0 -46
- package/dist/hooks/use-create-editor.js +0 -2726
- package/dist/hooks/use-create-editor.mjs +0 -37
- package/dist/hooks/use-cursor-visibility.d.mts +0 -37
- package/dist/hooks/use-cursor-visibility.d.ts +0 -37
- package/dist/hooks/use-cursor-visibility.js +0 -140
- package/dist/hooks/use-cursor-visibility.mjs +0 -8
- package/dist/hooks/use-floating-element.d.mts +0 -43
- package/dist/hooks/use-floating-element.d.ts +0 -43
- package/dist/hooks/use-floating-element.js +0 -88
- package/dist/hooks/use-floating-element.mjs +0 -8
- package/dist/hooks/use-floating-toolbar-visibility.d.mts +0 -32
- package/dist/hooks/use-floating-toolbar-visibility.d.ts +0 -32
- package/dist/hooks/use-floating-toolbar-visibility.js +0 -115
- package/dist/hooks/use-floating-toolbar-visibility.mjs +0 -13
- package/dist/hooks/use-menu-navigation.d.mts +0 -55
- package/dist/hooks/use-menu-navigation.d.ts +0 -55
- package/dist/hooks/use-menu-navigation.js +0 -163
- package/dist/hooks/use-menu-navigation.mjs +0 -8
- package/dist/hooks/use-tiptap-editor.d.mts +0 -20
- package/dist/hooks/use-tiptap-editor.d.ts +0 -20
- package/dist/hooks/use-tiptap-editor.js +0 -58
- package/dist/hooks/use-tiptap-editor.mjs +0 -8
- package/dist/hooks/use-ui-editor-state.d.mts +0 -7
- package/dist/hooks/use-ui-editor-state.d.ts +0 -7
- package/dist/hooks/use-ui-editor-state.js +0 -107
- package/dist/hooks/use-ui-editor-state.mjs +0 -11
- package/dist/hooks/use-window-size.d.mts +0 -12
- package/dist/hooks/use-window-size.d.ts +0 -12
- package/dist/hooks/use-window-size.js +0 -75
- package/dist/hooks/use-window-size.mjs +0 -7
- package/dist/presets/basic/editor-header.d.mts +0 -23
- package/dist/presets/basic/editor-header.d.ts +0 -23
- package/dist/presets/basic/editor-header.js +0 -2750
- package/dist/presets/basic/editor-header.mjs +0 -43
- package/dist/presets/basic/index.d.mts +0 -38
- package/dist/presets/basic/index.d.ts +0 -38
- package/dist/presets/basic/index.js +0 -6891
- package/dist/presets/basic/index.mjs +0 -85
- package/dist/ui/blockquote-button/blockquote-button.d.mts +0 -20
- package/dist/ui/blockquote-button/blockquote-button.d.ts +0 -20
- package/dist/ui/blockquote-button/blockquote-button.js +0 -247
- package/dist/ui/blockquote-button/blockquote-button.mjs +0 -9
- package/dist/ui/blockquote-button/index.d.mts +0 -6
- package/dist/ui/blockquote-button/index.d.ts +0 -6
- package/dist/ui/blockquote-button/index.js +0 -259
- package/dist/ui/blockquote-button/index.mjs +0 -21
- package/dist/ui/blockquote-button/use-blockquote.d.mts +0 -85
- package/dist/ui/blockquote-button/use-blockquote.d.ts +0 -85
- package/dist/ui/blockquote-button/use-blockquote.js +0 -192
- package/dist/ui/blockquote-button/use-blockquote.mjs +0 -17
- package/dist/ui/bubble-menu/index.d.mts +0 -13
- package/dist/ui/bubble-menu/index.d.ts +0 -13
- package/dist/ui/bubble-menu/index.js +0 -673
- package/dist/ui/bubble-menu/index.mjs +0 -16
- package/dist/ui/codeblock-button/code-block-button.d.mts +0 -20
- package/dist/ui/codeblock-button/code-block-button.d.ts +0 -20
- package/dist/ui/codeblock-button/code-block-button.js +0 -237
- package/dist/ui/codeblock-button/code-block-button.mjs +0 -9
- package/dist/ui/codeblock-button/index.d.mts +0 -6
- package/dist/ui/codeblock-button/index.d.ts +0 -6
- package/dist/ui/codeblock-button/index.js +0 -249
- package/dist/ui/codeblock-button/index.mjs +0 -21
- package/dist/ui/codeblock-button/use-code-block.d.mts +0 -92
- package/dist/ui/codeblock-button/use-code-block.d.ts +0 -92
- package/dist/ui/codeblock-button/use-code-block.js +0 -192
- package/dist/ui/codeblock-button/use-code-block.mjs +0 -17
- package/dist/ui/color-highlight-button/color-highlight-button.d.mts +0 -25
- package/dist/ui/color-highlight-button/color-highlight-button.d.ts +0 -25
- package/dist/ui/color-highlight-button/color-highlight-button.js +0 -266
- package/dist/ui/color-highlight-button/color-highlight-button.mjs +0 -9
- package/dist/ui/color-highlight-button/index.d.mts +0 -6
- package/dist/ui/color-highlight-button/index.d.ts +0 -6
- package/dist/ui/color-highlight-button/index.js +0 -342
- package/dist/ui/color-highlight-button/index.mjs +0 -27
- package/dist/ui/color-highlight-button/use-color-highlight.d.mts +0 -64
- package/dist/ui/color-highlight-button/use-color-highlight.d.ts +0 -64
- package/dist/ui/color-highlight-button/use-color-highlight.js +0 -247
- package/dist/ui/color-highlight-button/use-color-highlight.mjs +0 -23
- package/dist/ui/color-highlight-popover/color-highlight-popover.d.mts +0 -29
- package/dist/ui/color-highlight-popover/color-highlight-popover.d.ts +0 -29
- package/dist/ui/color-highlight-popover/color-highlight-popover.js +0 -590
- package/dist/ui/color-highlight-popover/color-highlight-popover.mjs +0 -17
- package/dist/ui/color-highlight-popover/index.d.mts +0 -6
- package/dist/ui/color-highlight-popover/index.d.ts +0 -6
- package/dist/ui/color-highlight-popover/index.js +0 -591
- package/dist/ui/color-highlight-popover/index.mjs +0 -17
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.d.mts +0 -30
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.d.ts +0 -30
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.js +0 -171
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.mjs +0 -10
- package/dist/ui/heading-button/index.d.mts +0 -45
- package/dist/ui/heading-button/index.d.ts +0 -45
- package/dist/ui/heading-button/index.js +0 -222
- package/dist/ui/heading-button/index.mjs +0 -16
- package/dist/ui/heading-button/utils.d.mts +0 -17
- package/dist/ui/heading-button/utils.d.ts +0 -17
- package/dist/ui/heading-button/utils.js +0 -92
- package/dist/ui/heading-button/utils.mjs +0 -19
- package/dist/ui/heading-dropdown-menu/index.d.mts +0 -14
- package/dist/ui/heading-dropdown-menu/index.d.ts +0 -14
- package/dist/ui/heading-dropdown-menu/index.js +0 -308
- package/dist/ui/heading-dropdown-menu/index.mjs +0 -10
- package/dist/ui/link-bubble/index.d.mts +0 -13
- package/dist/ui/link-bubble/index.d.ts +0 -13
- package/dist/ui/link-bubble/index.js +0 -183
- package/dist/ui/link-bubble/index.mjs +0 -10
- package/dist/ui/link-popover/index.d.mts +0 -7
- package/dist/ui/link-popover/index.d.ts +0 -7
- package/dist/ui/link-popover/index.js +0 -512
- package/dist/ui/link-popover/index.mjs +0 -30
- package/dist/ui/link-popover/link-popover.d.mts +0 -85
- package/dist/ui/link-popover/link-popover.d.ts +0 -85
- package/dist/ui/link-popover/link-popover.js +0 -498
- package/dist/ui/link-popover/link-popover.mjs +0 -16
- package/dist/ui/link-popover/use-link-popover.d.mts +0 -123
- package/dist/ui/link-popover/use-link-popover.d.ts +0 -123
- package/dist/ui/link-popover/use-link-popover.js +0 -259
- package/dist/ui/link-popover/use-link-popover.mjs +0 -20
- package/dist/ui/list-button/index.d.mts +0 -50
- package/dist/ui/list-button/index.d.ts +0 -50
- package/dist/ui/list-button/index.js +0 -232
- package/dist/ui/list-button/index.mjs +0 -24
- package/dist/ui/list-dropdown-menu/index.d.mts +0 -45
- package/dist/ui/list-dropdown-menu/index.d.ts +0 -45
- package/dist/ui/list-dropdown-menu/index.js +0 -361
- package/dist/ui/list-dropdown-menu/index.mjs +0 -21
- package/dist/ui/mark-button/index.d.mts +0 -59
- package/dist/ui/mark-button/index.d.ts +0 -59
- package/dist/ui/mark-button/index.js +0 -217
- package/dist/ui/mark-button/index.mjs +0 -26
- package/dist/ui/reset-all-formatting-button/index.d.mts +0 -7
- package/dist/ui/reset-all-formatting-button/index.d.ts +0 -7
- package/dist/ui/reset-all-formatting-button/index.js +0 -286
- package/dist/ui/reset-all-formatting-button/index.mjs +0 -26
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.d.mts +0 -30
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.d.ts +0 -30
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.js +0 -271
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.mjs +0 -12
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.d.mts +0 -103
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.d.ts +0 -103
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.js +0 -211
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.mjs +0 -21
- package/dist/ui/slash-dropdown-menu/index.d.mts +0 -10
- package/dist/ui/slash-dropdown-menu/index.d.ts +0 -10
- package/dist/ui/slash-dropdown-menu/index.js +0 -1056
- package/dist/ui/slash-dropdown-menu/index.mjs +0 -19
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.d.mts +0 -16
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.d.ts +0 -16
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.js +0 -1053
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.mjs +0 -16
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.d.mts +0 -162
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.d.ts +0 -162
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.js +0 -457
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.mjs +0 -10
- package/dist/ui/suggestion-menu/index.d.mts +0 -10
- package/dist/ui/suggestion-menu/index.d.ts +0 -10
- package/dist/ui/suggestion-menu/index.js +0 -489
- package/dist/ui/suggestion-menu/index.mjs +0 -17
- package/dist/ui/suggestion-menu/suggestion-menu-types.d.mts +0 -89
- package/dist/ui/suggestion-menu/suggestion-menu-types.d.ts +0 -89
- package/dist/ui/suggestion-menu/suggestion-menu-types.js +0 -19
- package/dist/ui/suggestion-menu/suggestion-menu-types.mjs +0 -1
- package/dist/ui/suggestion-menu/suggestion-menu-utils.d.mts +0 -27
- package/dist/ui/suggestion-menu/suggestion-menu-utils.d.ts +0 -27
- package/dist/ui/suggestion-menu/suggestion-menu-utils.js +0 -75
- package/dist/ui/suggestion-menu/suggestion-menu-utils.mjs +0 -9
- package/dist/ui/suggestion-menu/suggestion-menu.d.mts +0 -15
- package/dist/ui/suggestion-menu/suggestion-menu.d.ts +0 -15
- package/dist/ui/suggestion-menu/suggestion-menu.js +0 -453
- package/dist/ui/suggestion-menu/suggestion-menu.mjs +0 -12
- package/dist/ui/table-button/index.d.mts +0 -15
- package/dist/ui/table-button/index.d.ts +0 -15
- package/dist/ui/table-button/index.js +0 -202
- package/dist/ui/table-button/index.mjs +0 -9
- package/dist/ui/table-button/use-table.d.mts +0 -51
- package/dist/ui/table-button/use-table.d.ts +0 -51
- package/dist/ui/table-button/use-table.js +0 -146
- package/dist/ui/table-button/use-table.mjs +0 -14
- package/dist/ui/text-align-button/index.d.mts +0 -6
- package/dist/ui/text-align-button/index.d.ts +0 -6
- package/dist/ui/text-align-button/index.js +0 -235
- package/dist/ui/text-align-button/index.mjs +0 -29
- package/dist/ui/text-align-button/text-align-button.d.mts +0 -20
- package/dist/ui/text-align-button/text-align-button.d.ts +0 -20
- package/dist/ui/text-align-button/text-align-button.js +0 -215
- package/dist/ui/text-align-button/text-align-button.mjs +0 -9
- package/dist/ui/text-align-button/use-text-align.d.mts +0 -106
- package/dist/ui/text-align-button/use-text-align.d.ts +0 -106
- package/dist/ui/text-align-button/use-text-align.js +0 -169
- package/dist/ui/text-align-button/use-text-align.mjs +0 -24
- package/dist/ui/undo-redo-button/index.d.mts +0 -6
- package/dist/ui/undo-redo-button/index.d.ts +0 -6
- package/dist/ui/undo-redo-button/index.js +0 -202
- package/dist/ui/undo-redo-button/index.mjs +0 -25
- package/dist/ui/undo-redo-button/undo-redo-button.d.mts +0 -23
- package/dist/ui/undo-redo-button/undo-redo-button.d.ts +0 -23
- package/dist/ui/undo-redo-button/undo-redo-button.js +0 -187
- package/dist/ui/undo-redo-button/undo-redo-button.mjs +0 -10
- package/dist/ui/undo-redo-button/use-undo-redo.d.mts +0 -95
- package/dist/ui/undo-redo-button/use-undo-redo.d.ts +0 -95
- package/dist/ui/undo-redo-button/use-undo-redo.js +0 -146
- package/dist/ui/undo-redo-button/use-undo-redo.mjs +0 -21
- package/dist/utils/index.d.mts +0 -38
- package/dist/utils/index.d.ts +0 -38
- package/dist/utils/index.js +0 -128
- package/dist/utils/index.mjs +0 -15
- package/dist/utils/safe-parse.d.mts +0 -14
- package/dist/utils/safe-parse.d.ts +0 -14
- package/dist/utils/safe-parse.js +0 -203
- package/dist/utils/safe-parse.mjs +0 -8
package/dist/chunk-XGAABDMW.mjs
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/ui/link-bubble/index.tsx
|
|
4
|
-
import { IconButton } from "@kopexa/button";
|
|
5
|
-
import { EditIcon, ExternalLinkIcon, TrashIcon } from "@kopexa/icons";
|
|
6
|
-
import { Input } from "@kopexa/input";
|
|
7
|
-
import { BubbleMenu as TiptapBubbleMenu } from "@tiptap/react/menus";
|
|
8
|
-
import { useCallback, useEffect, useState } from "react";
|
|
9
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
function LinkBubble({ editor }) {
|
|
11
|
-
const [isEditing, setIsEditing] = useState(false);
|
|
12
|
-
const [url, setUrl] = useState("");
|
|
13
|
-
const getCurrentUrl = useCallback(() => {
|
|
14
|
-
if (!editor) return "";
|
|
15
|
-
const attrs = editor.getAttributes("link");
|
|
16
|
-
return attrs.href || "";
|
|
17
|
-
}, [editor]);
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
const isLinkActive = editor == null ? void 0 : editor.isActive("link");
|
|
20
|
-
if (isLinkActive) {
|
|
21
|
-
setUrl(getCurrentUrl());
|
|
22
|
-
setIsEditing(false);
|
|
23
|
-
}
|
|
24
|
-
}, [editor, getCurrentUrl]);
|
|
25
|
-
const handleOpenLink = useCallback(() => {
|
|
26
|
-
const href = getCurrentUrl();
|
|
27
|
-
if (href) {
|
|
28
|
-
window.open(href, "_blank", "noopener,noreferrer");
|
|
29
|
-
}
|
|
30
|
-
}, [getCurrentUrl]);
|
|
31
|
-
const handleRemoveLink = useCallback(() => {
|
|
32
|
-
editor == null ? void 0 : editor.chain().focus().unsetLink().run();
|
|
33
|
-
}, [editor]);
|
|
34
|
-
const handleEdit = useCallback(() => {
|
|
35
|
-
setUrl(getCurrentUrl());
|
|
36
|
-
setIsEditing(true);
|
|
37
|
-
}, [getCurrentUrl]);
|
|
38
|
-
const handleSave = useCallback(() => {
|
|
39
|
-
if (url) {
|
|
40
|
-
editor == null ? void 0 : editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
|
|
41
|
-
} else {
|
|
42
|
-
editor == null ? void 0 : editor.chain().focus().unsetLink().run();
|
|
43
|
-
}
|
|
44
|
-
setIsEditing(false);
|
|
45
|
-
}, [editor, url]);
|
|
46
|
-
const handleKeyDown = useCallback(
|
|
47
|
-
(e) => {
|
|
48
|
-
if (e.key === "Enter") {
|
|
49
|
-
e.preventDefault();
|
|
50
|
-
handleSave();
|
|
51
|
-
} else if (e.key === "Escape") {
|
|
52
|
-
e.preventDefault();
|
|
53
|
-
setIsEditing(false);
|
|
54
|
-
setUrl(getCurrentUrl());
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
[handleSave, getCurrentUrl]
|
|
58
|
-
);
|
|
59
|
-
if (!editor) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
return /* @__PURE__ */ jsx(
|
|
63
|
-
TiptapBubbleMenu,
|
|
64
|
-
{
|
|
65
|
-
editor,
|
|
66
|
-
pluginKey: "linkBubbleMenu",
|
|
67
|
-
shouldShow: ({ editor: e, view }) => {
|
|
68
|
-
if (!view.hasFocus()) return false;
|
|
69
|
-
return e.isActive("link") && e.isEditable;
|
|
70
|
-
},
|
|
71
|
-
options: {
|
|
72
|
-
placement: "bottom-start",
|
|
73
|
-
offset: 8
|
|
74
|
-
},
|
|
75
|
-
className: "rounded-lg border bg-background shadow-md",
|
|
76
|
-
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 p-1.5 min-w-[280px]", children: isEditing ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
77
|
-
/* @__PURE__ */ jsx(
|
|
78
|
-
Input,
|
|
79
|
-
{
|
|
80
|
-
type: "url",
|
|
81
|
-
value: url,
|
|
82
|
-
onChange: (e) => setUrl(e.target.value),
|
|
83
|
-
onKeyDown: handleKeyDown,
|
|
84
|
-
placeholder: "Enter URL...",
|
|
85
|
-
className: "flex-1 h-8 text-sm",
|
|
86
|
-
autoFocus: true
|
|
87
|
-
}
|
|
88
|
-
),
|
|
89
|
-
/* @__PURE__ */ jsx(
|
|
90
|
-
IconButton,
|
|
91
|
-
{
|
|
92
|
-
type: "button",
|
|
93
|
-
size: "sm",
|
|
94
|
-
variant: "ghost",
|
|
95
|
-
onClick: handleSave,
|
|
96
|
-
"aria-label": "Save link",
|
|
97
|
-
children: /* @__PURE__ */ jsx(EditIcon, { className: "size-4" })
|
|
98
|
-
}
|
|
99
|
-
)
|
|
100
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
101
|
-
/* @__PURE__ */ jsx(
|
|
102
|
-
"a",
|
|
103
|
-
{
|
|
104
|
-
href: getCurrentUrl(),
|
|
105
|
-
target: "_blank",
|
|
106
|
-
rel: "noopener noreferrer",
|
|
107
|
-
className: "flex-1 text-sm text-primary truncate max-w-[200px] hover:underline px-2",
|
|
108
|
-
onClick: (e) => {
|
|
109
|
-
e.preventDefault();
|
|
110
|
-
handleOpenLink();
|
|
111
|
-
},
|
|
112
|
-
children: getCurrentUrl()
|
|
113
|
-
}
|
|
114
|
-
),
|
|
115
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5 border-l pl-1 ml-1", children: [
|
|
116
|
-
/* @__PURE__ */ jsx(
|
|
117
|
-
IconButton,
|
|
118
|
-
{
|
|
119
|
-
type: "button",
|
|
120
|
-
size: "sm",
|
|
121
|
-
variant: "ghost",
|
|
122
|
-
onClick: handleOpenLink,
|
|
123
|
-
"aria-label": "Open link in new tab",
|
|
124
|
-
children: /* @__PURE__ */ jsx(ExternalLinkIcon, { className: "size-4" })
|
|
125
|
-
}
|
|
126
|
-
),
|
|
127
|
-
/* @__PURE__ */ jsx(
|
|
128
|
-
IconButton,
|
|
129
|
-
{
|
|
130
|
-
type: "button",
|
|
131
|
-
size: "sm",
|
|
132
|
-
variant: "ghost",
|
|
133
|
-
onClick: handleEdit,
|
|
134
|
-
"aria-label": "Edit link",
|
|
135
|
-
children: /* @__PURE__ */ jsx(EditIcon, { className: "size-4" })
|
|
136
|
-
}
|
|
137
|
-
),
|
|
138
|
-
/* @__PURE__ */ jsx(
|
|
139
|
-
IconButton,
|
|
140
|
-
{
|
|
141
|
-
type: "button",
|
|
142
|
-
size: "sm",
|
|
143
|
-
variant: "ghost",
|
|
144
|
-
onClick: handleRemoveLink,
|
|
145
|
-
"aria-label": "Remove link",
|
|
146
|
-
children: /* @__PURE__ */ jsx(TrashIcon, { className: "size-4" })
|
|
147
|
-
}
|
|
148
|
-
)
|
|
149
|
-
] })
|
|
150
|
-
] }) })
|
|
151
|
-
}
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
var link_bubble_default = LinkBubble;
|
|
155
|
-
|
|
156
|
-
export {
|
|
157
|
-
LinkBubble,
|
|
158
|
-
link_bubble_default
|
|
159
|
-
};
|
package/dist/chunk-Y2KSWMG5.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";
|
package/dist/chunk-YJAHZXLG.mjs
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useTiptapEditor
|
|
4
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
5
|
-
|
|
6
|
-
// src/ui/table-button/use-table.ts
|
|
7
|
-
import { isNodeInSchema, isNodeTypeSelected } from "@kopexa/editor-utils";
|
|
8
|
-
import { TableIcon } from "@kopexa/icons";
|
|
9
|
-
import { isNodeSelection } from "@tiptap/react";
|
|
10
|
-
import { useCallback, useEffect, useState } from "react";
|
|
11
|
-
function canToggle(editor) {
|
|
12
|
-
if (!editor || !editor.isEditable) return false;
|
|
13
|
-
if (!isNodeInSchema("table", editor) || isNodeTypeSelected(editor, ["image"])) {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
try {
|
|
17
|
-
return editor.can().insertTable({ rows: 3, cols: 3, withHeaderRow: true });
|
|
18
|
-
} catch {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function toggleTable(editor, config) {
|
|
23
|
-
var _a;
|
|
24
|
-
if (!editor || !editor.isEditable) return false;
|
|
25
|
-
if (!canToggle(editor)) return false;
|
|
26
|
-
try {
|
|
27
|
-
return editor.chain().focus().insertTable({
|
|
28
|
-
rows: (config == null ? void 0 : config.rows) || 3,
|
|
29
|
-
cols: (config == null ? void 0 : config.cols) || 3,
|
|
30
|
-
withHeaderRow: (_a = config == null ? void 0 : config.withHeaderRow) != null ? _a : true
|
|
31
|
-
}).run();
|
|
32
|
-
} catch {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function shouldShowButton(props) {
|
|
37
|
-
const { editor, hideWhenUnavailable } = props;
|
|
38
|
-
if (!editor || !editor.isEditable) return false;
|
|
39
|
-
if (!isNodeInSchema("table", editor)) return false;
|
|
40
|
-
if (hideWhenUnavailable) {
|
|
41
|
-
if (isNodeSelection(editor.state.selection) || !canToggle) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
function useTableBlock(config) {
|
|
48
|
-
const {
|
|
49
|
-
editor: providedEditor,
|
|
50
|
-
hideWhenUnavailable = false,
|
|
51
|
-
onToggled
|
|
52
|
-
} = config || {};
|
|
53
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
54
|
-
const [isVisible, setIsVisible] = useState(true);
|
|
55
|
-
const canToggleState = canToggle(editor);
|
|
56
|
-
const isActive = (editor == null ? void 0 : editor.isActive("table")) || false;
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
if (!editor) return;
|
|
59
|
-
const handleSelectionUpdate = () => {
|
|
60
|
-
setIsVisible(shouldShowButton({ editor, hideWhenUnavailable }));
|
|
61
|
-
};
|
|
62
|
-
handleSelectionUpdate();
|
|
63
|
-
editor.on("selectionUpdate", handleSelectionUpdate);
|
|
64
|
-
return () => {
|
|
65
|
-
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
66
|
-
};
|
|
67
|
-
}, [editor, hideWhenUnavailable]);
|
|
68
|
-
const handleToggle = useCallback(() => {
|
|
69
|
-
if (!editor) return false;
|
|
70
|
-
const success = toggleTable(editor);
|
|
71
|
-
if (success) {
|
|
72
|
-
onToggled == null ? void 0 : onToggled();
|
|
73
|
-
}
|
|
74
|
-
return success;
|
|
75
|
-
}, [editor, onToggled]);
|
|
76
|
-
return {
|
|
77
|
-
isVisible,
|
|
78
|
-
isActive,
|
|
79
|
-
handleToggle,
|
|
80
|
-
canToggle: canToggleState,
|
|
81
|
-
label: "Table",
|
|
82
|
-
// shortcutKeys: CODE_BLOCK_SHORTCUT_KEY,
|
|
83
|
-
Icon: TableIcon
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export {
|
|
88
|
-
canToggle,
|
|
89
|
-
toggleTable,
|
|
90
|
-
shouldShowButton,
|
|
91
|
-
useTableBlock
|
|
92
|
-
};
|
package/dist/chunk-Z365KVQY.mjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/extensions/image/messages.ts
|
|
4
|
-
import { defineMessages } from "react-intl";
|
|
5
|
-
var messages = defineMessages({
|
|
6
|
-
loading: {
|
|
7
|
-
id: "editor.image.loading",
|
|
8
|
-
defaultMessage: "Loading image..."
|
|
9
|
-
},
|
|
10
|
-
uploading: {
|
|
11
|
-
id: "editor.image.uploading",
|
|
12
|
-
defaultMessage: "Uploading..."
|
|
13
|
-
},
|
|
14
|
-
error: {
|
|
15
|
-
id: "editor.image.error",
|
|
16
|
-
defaultMessage: "Failed to load image"
|
|
17
|
-
},
|
|
18
|
-
upload_error: {
|
|
19
|
-
id: "editor.image.upload_error",
|
|
20
|
-
defaultMessage: "Failed to upload image"
|
|
21
|
-
},
|
|
22
|
-
retry: {
|
|
23
|
-
id: "editor.image.retry",
|
|
24
|
-
defaultMessage: "Retry"
|
|
25
|
-
},
|
|
26
|
-
remove: {
|
|
27
|
-
id: "editor.image.remove",
|
|
28
|
-
defaultMessage: "Remove"
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export {
|
|
33
|
-
messages
|
|
34
|
-
};
|
package/dist/chunk-ZVTJ6XD7.mjs
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useTiptapEditor
|
|
4
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
5
|
-
|
|
6
|
-
// src/ui/undo-redo-button/use-undo-redo.ts
|
|
7
|
-
import { isNodeTypeSelected } from "@kopexa/editor-utils";
|
|
8
|
-
import { RedoIcon, UndoIcon } from "@kopexa/icons";
|
|
9
|
-
import { useCallback, useEffect, useState } from "react";
|
|
10
|
-
var UNDO_REDO_SHORTCUT_KEYS = {
|
|
11
|
-
undo: "mod+z",
|
|
12
|
-
redo: "mod+shift+z"
|
|
13
|
-
};
|
|
14
|
-
var historyActionLabels = {
|
|
15
|
-
undo: "Undo",
|
|
16
|
-
redo: "Redo"
|
|
17
|
-
};
|
|
18
|
-
var historyIcons = {
|
|
19
|
-
undo: UndoIcon,
|
|
20
|
-
redo: RedoIcon
|
|
21
|
-
};
|
|
22
|
-
function canExecuteUndoRedoAction(editor, action) {
|
|
23
|
-
if (!editor || !editor.isEditable) return false;
|
|
24
|
-
if (isNodeTypeSelected(editor, ["image"])) return false;
|
|
25
|
-
return action === "undo" ? editor.can().undo() : editor.can().redo();
|
|
26
|
-
}
|
|
27
|
-
function executeUndoRedoAction(editor, action) {
|
|
28
|
-
if (!editor || !editor.isEditable) return false;
|
|
29
|
-
if (!canExecuteUndoRedoAction(editor, action)) return false;
|
|
30
|
-
const chain = editor.chain().focus();
|
|
31
|
-
return action === "undo" ? chain.undo().run() : chain.redo().run();
|
|
32
|
-
}
|
|
33
|
-
function shouldShowButton(props) {
|
|
34
|
-
const { editor, hideWhenUnavailable, action } = props;
|
|
35
|
-
if (!editor || !editor.isEditable) return false;
|
|
36
|
-
if (hideWhenUnavailable && !editor.isActive("code")) {
|
|
37
|
-
return canExecuteUndoRedoAction(editor, action);
|
|
38
|
-
}
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
function useUndoRedo(config) {
|
|
42
|
-
const {
|
|
43
|
-
editor: providedEditor,
|
|
44
|
-
action,
|
|
45
|
-
hideWhenUnavailable = false,
|
|
46
|
-
onExecuted
|
|
47
|
-
} = config;
|
|
48
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
49
|
-
const [isVisible, setIsVisible] = useState(true);
|
|
50
|
-
const canExecute = canExecuteUndoRedoAction(editor, action);
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
if (!editor) return;
|
|
53
|
-
const handleUpdate = () => {
|
|
54
|
-
setIsVisible(shouldShowButton({ editor, hideWhenUnavailable, action }));
|
|
55
|
-
};
|
|
56
|
-
handleUpdate();
|
|
57
|
-
editor.on("transaction", handleUpdate);
|
|
58
|
-
return () => {
|
|
59
|
-
editor.off("transaction", handleUpdate);
|
|
60
|
-
};
|
|
61
|
-
}, [editor, hideWhenUnavailable, action]);
|
|
62
|
-
const handleAction = useCallback(() => {
|
|
63
|
-
if (!editor) return false;
|
|
64
|
-
const success = executeUndoRedoAction(editor, action);
|
|
65
|
-
if (success) {
|
|
66
|
-
onExecuted == null ? void 0 : onExecuted();
|
|
67
|
-
}
|
|
68
|
-
return success;
|
|
69
|
-
}, [editor, action, onExecuted]);
|
|
70
|
-
return {
|
|
71
|
-
isVisible,
|
|
72
|
-
handleAction,
|
|
73
|
-
canExecute,
|
|
74
|
-
label: historyActionLabels[action],
|
|
75
|
-
shortcutKeys: UNDO_REDO_SHORTCUT_KEYS[action],
|
|
76
|
-
Icon: historyIcons[action]
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export {
|
|
81
|
-
UNDO_REDO_SHORTCUT_KEYS,
|
|
82
|
-
historyActionLabels,
|
|
83
|
-
historyIcons,
|
|
84
|
-
canExecuteUndoRedoAction,
|
|
85
|
-
executeUndoRedoAction,
|
|
86
|
-
shouldShowButton,
|
|
87
|
-
useUndoRedo
|
|
88
|
-
};
|
package/dist/chunk-ZZ4OU46C.mjs
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useTiptapEditor
|
|
4
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
5
|
-
|
|
6
|
-
// src/ui/blockquote-button/use-blockquote.ts
|
|
7
|
-
import {
|
|
8
|
-
findNodePosition,
|
|
9
|
-
isNodeInSchema,
|
|
10
|
-
isNodeTypeSelected,
|
|
11
|
-
isValidPosition
|
|
12
|
-
} from "@kopexa/editor-utils";
|
|
13
|
-
import { BlockquoteIcon } from "@kopexa/icons";
|
|
14
|
-
import { NodeSelection, TextSelection } from "@tiptap/pm/state";
|
|
15
|
-
import * as React from "react";
|
|
16
|
-
var BLOCKQUOTE_SHORTCUT_KEY = "mod+shift+b";
|
|
17
|
-
function canToggleBlockquote(editor, turnInto = true) {
|
|
18
|
-
var _a;
|
|
19
|
-
if (!editor || !editor.isEditable) return false;
|
|
20
|
-
if (!isNodeInSchema("blockquote", editor) || isNodeTypeSelected(editor, ["image"]))
|
|
21
|
-
return false;
|
|
22
|
-
if (!turnInto) {
|
|
23
|
-
return editor.can().toggleWrap("blockquote");
|
|
24
|
-
}
|
|
25
|
-
try {
|
|
26
|
-
const view = editor.view;
|
|
27
|
-
const state = view.state;
|
|
28
|
-
const selection = state.selection;
|
|
29
|
-
if (selection.empty || selection instanceof TextSelection) {
|
|
30
|
-
const pos = (_a = findNodePosition({
|
|
31
|
-
editor,
|
|
32
|
-
node: state.selection.$anchor.node(1)
|
|
33
|
-
})) == null ? void 0 : _a.pos;
|
|
34
|
-
if (!isValidPosition(pos)) return false;
|
|
35
|
-
}
|
|
36
|
-
return true;
|
|
37
|
-
} catch {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function toggleBlockquote(editor) {
|
|
42
|
-
var _a, _b, _c;
|
|
43
|
-
if (!editor || !editor.isEditable) return false;
|
|
44
|
-
if (!canToggleBlockquote(editor)) return false;
|
|
45
|
-
try {
|
|
46
|
-
const view = editor.view;
|
|
47
|
-
let state = view.state;
|
|
48
|
-
let tr = state.tr;
|
|
49
|
-
if (state.selection.empty || state.selection instanceof TextSelection) {
|
|
50
|
-
const pos = (_a = findNodePosition({
|
|
51
|
-
editor,
|
|
52
|
-
node: state.selection.$anchor.node(1)
|
|
53
|
-
})) == null ? void 0 : _a.pos;
|
|
54
|
-
if (!isValidPosition(pos)) return false;
|
|
55
|
-
tr = tr.setSelection(NodeSelection.create(state.doc, pos));
|
|
56
|
-
view.dispatch(tr);
|
|
57
|
-
state = view.state;
|
|
58
|
-
}
|
|
59
|
-
const selection = state.selection;
|
|
60
|
-
let chain = editor.chain().focus();
|
|
61
|
-
if (selection instanceof NodeSelection) {
|
|
62
|
-
const firstChild = (_b = selection.node.firstChild) == null ? void 0 : _b.firstChild;
|
|
63
|
-
const lastChild = (_c = selection.node.lastChild) == null ? void 0 : _c.lastChild;
|
|
64
|
-
const from = firstChild ? selection.from + firstChild.nodeSize : selection.from + 1;
|
|
65
|
-
const to = lastChild ? selection.to - lastChild.nodeSize : selection.to - 1;
|
|
66
|
-
chain = chain.setTextSelection({ from, to }).clearNodes();
|
|
67
|
-
}
|
|
68
|
-
const toggle = editor.isActive("blockquote") ? chain.lift("blockquote") : chain.wrapIn("blockquote");
|
|
69
|
-
toggle.run();
|
|
70
|
-
editor.chain().focus().selectTextblockEnd().run();
|
|
71
|
-
return true;
|
|
72
|
-
} catch {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function shouldShowButton(props) {
|
|
77
|
-
const { editor, hideWhenUnavailable } = props;
|
|
78
|
-
if (!editor || !editor.isEditable) return false;
|
|
79
|
-
if (!isNodeInSchema("blockquote", editor)) return false;
|
|
80
|
-
if (hideWhenUnavailable && !editor.isActive("code")) {
|
|
81
|
-
return canToggleBlockquote(editor);
|
|
82
|
-
}
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
function useBlockquote(config) {
|
|
86
|
-
const {
|
|
87
|
-
editor: providedEditor,
|
|
88
|
-
hideWhenUnavailable = false,
|
|
89
|
-
onToggled
|
|
90
|
-
} = config || {};
|
|
91
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
92
|
-
const [isVisible, setIsVisible] = React.useState(true);
|
|
93
|
-
const canToggle = canToggleBlockquote(editor);
|
|
94
|
-
const isActive = (editor == null ? void 0 : editor.isActive("blockquote")) || false;
|
|
95
|
-
React.useEffect(() => {
|
|
96
|
-
if (!editor) return;
|
|
97
|
-
const handleSelectionUpdate = () => {
|
|
98
|
-
setIsVisible(shouldShowButton({ editor, hideWhenUnavailable }));
|
|
99
|
-
};
|
|
100
|
-
handleSelectionUpdate();
|
|
101
|
-
editor.on("selectionUpdate", handleSelectionUpdate);
|
|
102
|
-
return () => {
|
|
103
|
-
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
104
|
-
};
|
|
105
|
-
}, [editor, hideWhenUnavailable]);
|
|
106
|
-
const handleToggle = React.useCallback(() => {
|
|
107
|
-
if (!editor) return false;
|
|
108
|
-
const success = toggleBlockquote(editor);
|
|
109
|
-
if (success) {
|
|
110
|
-
onToggled == null ? void 0 : onToggled();
|
|
111
|
-
}
|
|
112
|
-
return success;
|
|
113
|
-
}, [editor, onToggled]);
|
|
114
|
-
return {
|
|
115
|
-
isVisible,
|
|
116
|
-
isActive,
|
|
117
|
-
handleToggle,
|
|
118
|
-
canToggle,
|
|
119
|
-
label: "Blockquote",
|
|
120
|
-
shortcutKeys: BLOCKQUOTE_SHORTCUT_KEY,
|
|
121
|
-
Icon: BlockquoteIcon
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export {
|
|
126
|
-
BLOCKQUOTE_SHORTCUT_KEY,
|
|
127
|
-
canToggleBlockquote,
|
|
128
|
-
toggleBlockquote,
|
|
129
|
-
shouldShowButton,
|
|
130
|
-
useBlockquote
|
|
131
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { editorBasic } from '@kopexa/theme';
|
|
3
|
-
|
|
4
|
-
type EditorUIContextType = {
|
|
5
|
-
styles: ReturnType<typeof editorBasic>;
|
|
6
|
-
};
|
|
7
|
-
declare const EditorUIProvider: React.Provider<EditorUIContextType>;
|
|
8
|
-
declare const useEditorUIContext: () => EditorUIContextType;
|
|
9
|
-
|
|
10
|
-
export { EditorUIProvider, useEditorUIContext };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { editorBasic } from '@kopexa/theme';
|
|
3
|
-
|
|
4
|
-
type EditorUIContextType = {
|
|
5
|
-
styles: ReturnType<typeof editorBasic>;
|
|
6
|
-
};
|
|
7
|
-
declare const EditorUIProvider: React.Provider<EditorUIContextType>;
|
|
8
|
-
declare const useEditorUIContext: () => EditorUIContextType;
|
|
9
|
-
|
|
10
|
-
export { EditorUIProvider, useEditorUIContext };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/context/editor-context.ts
|
|
22
|
-
var editor_context_exports = {};
|
|
23
|
-
__export(editor_context_exports, {
|
|
24
|
-
EditorUIProvider: () => EditorUIProvider,
|
|
25
|
-
useEditorUIContext: () => useEditorUIContext
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(editor_context_exports);
|
|
28
|
-
var import_react_utils = require("@kopexa/react-utils");
|
|
29
|
-
var [EditorUIProvider, useEditorUIContext] = (0, import_react_utils.createContext)();
|
|
30
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
-
0 && (module.exports = {
|
|
32
|
-
EditorUIProvider,
|
|
33
|
-
useEditorUIContext
|
|
34
|
-
});
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
interface EditorFileHandler {
|
|
5
|
-
/**
|
|
6
|
-
* Upload a file and return a reference string.
|
|
7
|
-
* The reference format is determined by the backend (e.g., UUID, custom scheme).
|
|
8
|
-
* @param file The file to upload
|
|
9
|
-
* @param onProgress Optional progress callback (0-100)
|
|
10
|
-
* @returns Promise resolving to a reference string
|
|
11
|
-
*/
|
|
12
|
-
upload: (file: File, onProgress?: (percent: number) => void) => Promise<string>;
|
|
13
|
-
/**
|
|
14
|
-
* Resolve a reference to a displayable URL.
|
|
15
|
-
* Typically returns a signed URL from your storage backend.
|
|
16
|
-
* @param ref The reference string from upload
|
|
17
|
-
* @returns Promise resolving to a displayable URL
|
|
18
|
-
*/
|
|
19
|
-
resolve: (ref: string) => Promise<string>;
|
|
20
|
-
/**
|
|
21
|
-
* Check if a src string is a reference that needs resolving.
|
|
22
|
-
* Returns false for already-valid URLs (https://, data:, etc.)
|
|
23
|
-
* @param src The src attribute value
|
|
24
|
-
* @returns true if this needs to be resolved
|
|
25
|
-
*/
|
|
26
|
-
isReference: (src: string) => boolean;
|
|
27
|
-
}
|
|
28
|
-
interface EditorFileContextValue extends EditorFileHandler {
|
|
29
|
-
/**
|
|
30
|
-
* Whether file handling is available
|
|
31
|
-
*/
|
|
32
|
-
isAvailable: true;
|
|
33
|
-
}
|
|
34
|
-
interface EditorFileProviderProps {
|
|
35
|
-
children: ReactNode;
|
|
36
|
-
/**
|
|
37
|
-
* Upload handler - called when user pastes/drops a file
|
|
38
|
-
*/
|
|
39
|
-
onUpload: EditorFileHandler["upload"];
|
|
40
|
-
/**
|
|
41
|
-
* Resolve handler - called to get displayable URL from reference
|
|
42
|
-
*/
|
|
43
|
-
onResolve: EditorFileHandler["resolve"];
|
|
44
|
-
/**
|
|
45
|
-
* Check if src needs resolving (default: not starting with http/https/data)
|
|
46
|
-
*/
|
|
47
|
-
isReference?: EditorFileHandler["isReference"];
|
|
48
|
-
/**
|
|
49
|
-
* Cache TTL buffer in ms (default: 2 minutes)
|
|
50
|
-
* URLs are refreshed this much before actual expiry
|
|
51
|
-
*/
|
|
52
|
-
cacheBuffer?: number;
|
|
53
|
-
/**
|
|
54
|
-
* Default cache TTL in ms if not determined from response (default: 10 minutes)
|
|
55
|
-
*/
|
|
56
|
-
defaultCacheTtl?: number;
|
|
57
|
-
}
|
|
58
|
-
declare function EditorFileProvider({ children, onUpload, onResolve, isReference, cacheBuffer, defaultCacheTtl, }: EditorFileProviderProps): react_jsx_runtime.JSX.Element;
|
|
59
|
-
/**
|
|
60
|
-
* Hook to access file handling capabilities.
|
|
61
|
-
* Returns null if no EditorFileProvider is present (files not supported).
|
|
62
|
-
*/
|
|
63
|
-
declare function useEditorFile(): EditorFileContextValue | null;
|
|
64
|
-
/**
|
|
65
|
-
* Hook that throws if file handling is not available.
|
|
66
|
-
* Use this in components that require file support.
|
|
67
|
-
*/
|
|
68
|
-
declare function useEditorFileRequired(): EditorFileContextValue;
|
|
69
|
-
|
|
70
|
-
export { type EditorFileHandler, EditorFileProvider, type EditorFileProviderProps, useEditorFile, useEditorFileRequired };
|