@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
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ButtonProps } from '@kopexa/button';
|
|
3
|
-
import { Editor } from '@tiptap/react';
|
|
4
|
-
import { Level } from '../heading-button/utils.js';
|
|
5
|
-
|
|
6
|
-
interface HeadingDropdownMenuProps extends Omit<ButtonProps, "type"> {
|
|
7
|
-
editor?: Editor | null;
|
|
8
|
-
levels?: Level[];
|
|
9
|
-
hideWhenUnavailable?: boolean;
|
|
10
|
-
onOpenChange?: (isOpen: boolean) => void;
|
|
11
|
-
}
|
|
12
|
-
declare function HeadingDropdownMenu({ editor: providedEditor, levels, hideWhenUnavailable, onOpenChange, ...props }: HeadingDropdownMenuProps): react_jsx_runtime.JSX.Element | null;
|
|
13
|
-
|
|
14
|
-
export { HeadingDropdownMenu, type HeadingDropdownMenuProps };
|
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
|
|
31
|
-
// src/ui/heading-dropdown-menu/index.tsx
|
|
32
|
-
var heading_dropdown_menu_exports = {};
|
|
33
|
-
__export(heading_dropdown_menu_exports, {
|
|
34
|
-
HeadingDropdownMenu: () => HeadingDropdownMenu
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(heading_dropdown_menu_exports);
|
|
37
|
-
var import_button2 = require("@kopexa/button");
|
|
38
|
-
var import_dropdown_menu = require("@kopexa/dropdown-menu");
|
|
39
|
-
var import_editor_utils2 = require("@kopexa/editor-utils");
|
|
40
|
-
var import_icons2 = require("@kopexa/icons");
|
|
41
|
-
var import_react4 = require("@tiptap/react");
|
|
42
|
-
var React2 = __toESM(require("react"));
|
|
43
|
-
|
|
44
|
-
// src/hooks/use-tiptap-editor.ts
|
|
45
|
-
var import_react = require("@tiptap/react");
|
|
46
|
-
var import_react2 = require("react");
|
|
47
|
-
function useTiptapEditor(providedEditor) {
|
|
48
|
-
const { editor: coreEditor } = (0, import_react.useCurrentEditor)();
|
|
49
|
-
const mainEditor = (0, import_react2.useMemo)(
|
|
50
|
-
() => providedEditor || coreEditor,
|
|
51
|
-
[providedEditor, coreEditor]
|
|
52
|
-
);
|
|
53
|
-
const editorState = (0, import_react.useEditorState)({
|
|
54
|
-
editor: mainEditor,
|
|
55
|
-
selector(context) {
|
|
56
|
-
if (!context.editor) {
|
|
57
|
-
return {
|
|
58
|
-
editor: null,
|
|
59
|
-
editorState: void 0,
|
|
60
|
-
canCommand: void 0
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
editor: context.editor,
|
|
65
|
-
editorState: context.editor.state,
|
|
66
|
-
canCommand: context.editor.can
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
return editorState || { editor: null };
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// src/ui/heading-button/index.tsx
|
|
74
|
-
var import_button = require("@kopexa/button");
|
|
75
|
-
var import_editor_utils = require("@kopexa/editor-utils");
|
|
76
|
-
var import_icons = require("@kopexa/icons");
|
|
77
|
-
var React = __toESM(require("react"));
|
|
78
|
-
|
|
79
|
-
// src/ui/heading-button/utils.ts
|
|
80
|
-
var import_react3 = require("@tiptap/react");
|
|
81
|
-
var headingShortcutKeys = {
|
|
82
|
-
1: "Ctrl-Alt-1",
|
|
83
|
-
2: "Ctrl-Alt-2",
|
|
84
|
-
3: "Ctrl-Alt-3",
|
|
85
|
-
4: "Ctrl-Alt-4",
|
|
86
|
-
5: "Ctrl-Alt-5",
|
|
87
|
-
6: "Ctrl-Alt-6"
|
|
88
|
-
};
|
|
89
|
-
function canToggleHeading(editor, level) {
|
|
90
|
-
if (!editor) return false;
|
|
91
|
-
try {
|
|
92
|
-
return editor.can().toggleNode("heading", "paragraph", { level });
|
|
93
|
-
} catch {
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
function isHeadingActive(editor, level) {
|
|
98
|
-
if (!editor) return false;
|
|
99
|
-
return editor.isActive("heading", { level });
|
|
100
|
-
}
|
|
101
|
-
function toggleHeading(editor, level) {
|
|
102
|
-
if (!editor) return;
|
|
103
|
-
if (editor.isActive("heading", { level })) {
|
|
104
|
-
editor.chain().focus().setNode("paragraph").run();
|
|
105
|
-
} else {
|
|
106
|
-
editor.chain().focus().toggleNode("heading", "paragraph", { level }).run();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
function isHeadingButtonDisabled(editor, level, userDisabled = false) {
|
|
110
|
-
if (!editor) return true;
|
|
111
|
-
if (userDisabled) return true;
|
|
112
|
-
if (!canToggleHeading(editor, level)) return true;
|
|
113
|
-
return false;
|
|
114
|
-
}
|
|
115
|
-
function shouldShowHeadingButton(params) {
|
|
116
|
-
const { editor, hideWhenUnavailable, headingInSchema } = params;
|
|
117
|
-
if (!headingInSchema || !editor) {
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
if (hideWhenUnavailable) {
|
|
121
|
-
if ((0, import_react3.isNodeSelection)(editor.state.selection)) {
|
|
122
|
-
return false;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return true;
|
|
126
|
-
}
|
|
127
|
-
function getFormattedHeadingName(level) {
|
|
128
|
-
return `Heading ${level}`;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// src/ui/heading-button/index.tsx
|
|
132
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
133
|
-
var headingIcons = {
|
|
134
|
-
1: import_icons.HeadingOneIcon,
|
|
135
|
-
2: import_icons.HeadingTwoIcon,
|
|
136
|
-
3: import_icons.HeadingThreeIcon,
|
|
137
|
-
4: import_icons.HeadingFourIcon,
|
|
138
|
-
5: import_icons.HeadingFiveIcon,
|
|
139
|
-
6: import_icons.HeadingSixIcon
|
|
140
|
-
};
|
|
141
|
-
function useHeadingState(editor, level, disabled = false) {
|
|
142
|
-
const headingInSchema = (0, import_editor_utils.isNodeInSchema)("heading", editor);
|
|
143
|
-
const isDisabled = isHeadingButtonDisabled(editor, level, disabled);
|
|
144
|
-
const isActive = isHeadingActive(editor, level);
|
|
145
|
-
const Icon = headingIcons[level];
|
|
146
|
-
const shortcutKey = headingShortcutKeys[level];
|
|
147
|
-
const formattedName = getFormattedHeadingName(level);
|
|
148
|
-
return {
|
|
149
|
-
headingInSchema,
|
|
150
|
-
isDisabled,
|
|
151
|
-
isActive,
|
|
152
|
-
Icon,
|
|
153
|
-
shortcutKey,
|
|
154
|
-
formattedName
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
var HeadingButton = ({
|
|
158
|
-
editor: providedEditor,
|
|
159
|
-
level,
|
|
160
|
-
text,
|
|
161
|
-
hideWhenUnavailable = false,
|
|
162
|
-
className = "",
|
|
163
|
-
disabled,
|
|
164
|
-
onClick,
|
|
165
|
-
children,
|
|
166
|
-
ref,
|
|
167
|
-
...buttonProps
|
|
168
|
-
}) => {
|
|
169
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
170
|
-
const {
|
|
171
|
-
headingInSchema,
|
|
172
|
-
isDisabled,
|
|
173
|
-
isActive,
|
|
174
|
-
Icon,
|
|
175
|
-
shortcutKey,
|
|
176
|
-
formattedName
|
|
177
|
-
} = useHeadingState(editor, level, disabled);
|
|
178
|
-
const handleClick = React.useCallback(
|
|
179
|
-
(e) => {
|
|
180
|
-
onClick == null ? void 0 : onClick(e);
|
|
181
|
-
if (!e.defaultPrevented && !isDisabled && editor) {
|
|
182
|
-
toggleHeading(editor, level);
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
[onClick, isDisabled, editor, level]
|
|
186
|
-
);
|
|
187
|
-
const show = React.useMemo(() => {
|
|
188
|
-
return shouldShowHeadingButton({
|
|
189
|
-
editor,
|
|
190
|
-
level,
|
|
191
|
-
hideWhenUnavailable,
|
|
192
|
-
headingInSchema
|
|
193
|
-
});
|
|
194
|
-
}, [editor, level, hideWhenUnavailable, headingInSchema]);
|
|
195
|
-
if (!show || !editor || !editor.isEditable) {
|
|
196
|
-
return null;
|
|
197
|
-
}
|
|
198
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
199
|
-
import_button.Button,
|
|
200
|
-
{
|
|
201
|
-
type: "button",
|
|
202
|
-
className: className.trim(),
|
|
203
|
-
disabled: isDisabled,
|
|
204
|
-
variant: "ghost",
|
|
205
|
-
color: "default",
|
|
206
|
-
"data-active-state": isActive ? "on" : "off",
|
|
207
|
-
"data-disabled": isDisabled,
|
|
208
|
-
tabIndex: -1,
|
|
209
|
-
"aria-label": formattedName,
|
|
210
|
-
"aria-pressed": isActive,
|
|
211
|
-
tooltip: formattedName,
|
|
212
|
-
shortcutKeys: shortcutKey,
|
|
213
|
-
onClick: handleClick,
|
|
214
|
-
startContent: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {}),
|
|
215
|
-
...buttonProps,
|
|
216
|
-
ref,
|
|
217
|
-
children: children || text
|
|
218
|
-
}
|
|
219
|
-
);
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
// src/ui/heading-dropdown-menu/index.tsx
|
|
223
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
224
|
-
function HeadingDropdownMenu({
|
|
225
|
-
editor: providedEditor,
|
|
226
|
-
levels = [1, 2, 3, 4, 5, 6],
|
|
227
|
-
hideWhenUnavailable = false,
|
|
228
|
-
onOpenChange,
|
|
229
|
-
...props
|
|
230
|
-
}) {
|
|
231
|
-
var _a;
|
|
232
|
-
const [isOpen, setIsOpen] = React2.useState(false);
|
|
233
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
234
|
-
const headingInSchema = (0, import_editor_utils2.isNodeInSchema)("heading", editor);
|
|
235
|
-
const handleOnOpenChange = React2.useCallback(
|
|
236
|
-
(open) => {
|
|
237
|
-
setIsOpen(open);
|
|
238
|
-
onOpenChange == null ? void 0 : onOpenChange(open);
|
|
239
|
-
},
|
|
240
|
-
[onOpenChange]
|
|
241
|
-
);
|
|
242
|
-
const getActiveIcon = React2.useCallback(() => {
|
|
243
|
-
if (!editor) return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons2.HeadingIcon, {});
|
|
244
|
-
const activeLevel = levels.find(
|
|
245
|
-
(level) => editor.isActive("heading", { level })
|
|
246
|
-
);
|
|
247
|
-
if (!activeLevel) return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons2.HeadingIcon, {});
|
|
248
|
-
const ActiveIcon = headingIcons[activeLevel];
|
|
249
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ActiveIcon, {});
|
|
250
|
-
}, [editor, levels]);
|
|
251
|
-
const canToggleAnyHeading = React2.useCallback(() => {
|
|
252
|
-
if (!editor) return false;
|
|
253
|
-
return levels.some(
|
|
254
|
-
(level) => editor.can().toggleNode("heading", "paragraph", { level })
|
|
255
|
-
);
|
|
256
|
-
}, [editor, levels]);
|
|
257
|
-
const isDisabled = !canToggleAnyHeading();
|
|
258
|
-
const isAnyHeadingActive = (_a = editor == null ? void 0 : editor.isActive("heading")) != null ? _a : false;
|
|
259
|
-
const show = React2.useMemo(() => {
|
|
260
|
-
if (!headingInSchema || !editor) {
|
|
261
|
-
return false;
|
|
262
|
-
}
|
|
263
|
-
if (hideWhenUnavailable) {
|
|
264
|
-
if ((0, import_react4.isNodeSelection)(editor.state.selection) || !canToggleAnyHeading()) {
|
|
265
|
-
return false;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
return true;
|
|
269
|
-
}, [headingInSchema, editor, hideWhenUnavailable, canToggleAnyHeading]);
|
|
270
|
-
if (!show || !editor || !editor.isEditable) {
|
|
271
|
-
return null;
|
|
272
|
-
}
|
|
273
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_dropdown_menu.DropdownMenu.Root, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
274
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dropdown_menu.DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
275
|
-
import_button2.Button,
|
|
276
|
-
{
|
|
277
|
-
type: "button",
|
|
278
|
-
disabled: isDisabled,
|
|
279
|
-
variant: "ghost",
|
|
280
|
-
color: "default",
|
|
281
|
-
"data-active-state": isAnyHeadingActive ? "on" : "off",
|
|
282
|
-
"data-disabled": isDisabled,
|
|
283
|
-
tabIndex: -1,
|
|
284
|
-
"aria-label": "Format text as heading",
|
|
285
|
-
"aria-pressed": isAnyHeadingActive,
|
|
286
|
-
tooltip: "Heading",
|
|
287
|
-
endContent: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons2.ChevronDownIcon, {}),
|
|
288
|
-
...props,
|
|
289
|
-
children: getActiveIcon()
|
|
290
|
-
}
|
|
291
|
-
) }),
|
|
292
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dropdown_menu.DropdownMenu.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dropdown_menu.DropdownMenu.Group, { children: levels.map((level) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dropdown_menu.DropdownMenu.Item, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
293
|
-
HeadingButton,
|
|
294
|
-
{
|
|
295
|
-
editor,
|
|
296
|
-
level,
|
|
297
|
-
text: getFormattedHeadingName(level),
|
|
298
|
-
tooltip: "",
|
|
299
|
-
fullWidth: true,
|
|
300
|
-
spacing: "start"
|
|
301
|
-
}
|
|
302
|
-
) }, `heading-${level}`)) }) })
|
|
303
|
-
] });
|
|
304
|
-
}
|
|
305
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
306
|
-
0 && (module.exports = {
|
|
307
|
-
HeadingDropdownMenu
|
|
308
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { Editor } from '@tiptap/react';
|
|
3
|
-
|
|
4
|
-
interface LinkBubbleProps {
|
|
5
|
-
editor: Editor | null;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* LinkBubble appears when the cursor is on a link.
|
|
9
|
-
* Shows URL preview with edit, open, and remove actions.
|
|
10
|
-
*/
|
|
11
|
-
declare function LinkBubble({ editor }: LinkBubbleProps): react_jsx_runtime.JSX.Element | null;
|
|
12
|
-
|
|
13
|
-
export { LinkBubble, type LinkBubbleProps, LinkBubble as default };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { Editor } from '@tiptap/react';
|
|
3
|
-
|
|
4
|
-
interface LinkBubbleProps {
|
|
5
|
-
editor: Editor | null;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* LinkBubble appears when the cursor is on a link.
|
|
9
|
-
* Shows URL preview with edit, open, and remove actions.
|
|
10
|
-
*/
|
|
11
|
-
declare function LinkBubble({ editor }: LinkBubbleProps): react_jsx_runtime.JSX.Element | null;
|
|
12
|
-
|
|
13
|
-
export { LinkBubble, type LinkBubbleProps, LinkBubble as default };
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
"use client";
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
-
|
|
22
|
-
// src/ui/link-bubble/index.tsx
|
|
23
|
-
var link_bubble_exports = {};
|
|
24
|
-
__export(link_bubble_exports, {
|
|
25
|
-
LinkBubble: () => LinkBubble,
|
|
26
|
-
default: () => link_bubble_default
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(link_bubble_exports);
|
|
29
|
-
var import_button = require("@kopexa/button");
|
|
30
|
-
var import_icons = require("@kopexa/icons");
|
|
31
|
-
var import_input = require("@kopexa/input");
|
|
32
|
-
var import_menus = require("@tiptap/react/menus");
|
|
33
|
-
var import_react = require("react");
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
-
function LinkBubble({ editor }) {
|
|
36
|
-
const [isEditing, setIsEditing] = (0, import_react.useState)(false);
|
|
37
|
-
const [url, setUrl] = (0, import_react.useState)("");
|
|
38
|
-
const getCurrentUrl = (0, import_react.useCallback)(() => {
|
|
39
|
-
if (!editor) return "";
|
|
40
|
-
const attrs = editor.getAttributes("link");
|
|
41
|
-
return attrs.href || "";
|
|
42
|
-
}, [editor]);
|
|
43
|
-
(0, import_react.useEffect)(() => {
|
|
44
|
-
const isLinkActive = editor == null ? void 0 : editor.isActive("link");
|
|
45
|
-
if (isLinkActive) {
|
|
46
|
-
setUrl(getCurrentUrl());
|
|
47
|
-
setIsEditing(false);
|
|
48
|
-
}
|
|
49
|
-
}, [editor, getCurrentUrl]);
|
|
50
|
-
const handleOpenLink = (0, import_react.useCallback)(() => {
|
|
51
|
-
const href = getCurrentUrl();
|
|
52
|
-
if (href) {
|
|
53
|
-
window.open(href, "_blank", "noopener,noreferrer");
|
|
54
|
-
}
|
|
55
|
-
}, [getCurrentUrl]);
|
|
56
|
-
const handleRemoveLink = (0, import_react.useCallback)(() => {
|
|
57
|
-
editor == null ? void 0 : editor.chain().focus().unsetLink().run();
|
|
58
|
-
}, [editor]);
|
|
59
|
-
const handleEdit = (0, import_react.useCallback)(() => {
|
|
60
|
-
setUrl(getCurrentUrl());
|
|
61
|
-
setIsEditing(true);
|
|
62
|
-
}, [getCurrentUrl]);
|
|
63
|
-
const handleSave = (0, import_react.useCallback)(() => {
|
|
64
|
-
if (url) {
|
|
65
|
-
editor == null ? void 0 : editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
|
|
66
|
-
} else {
|
|
67
|
-
editor == null ? void 0 : editor.chain().focus().unsetLink().run();
|
|
68
|
-
}
|
|
69
|
-
setIsEditing(false);
|
|
70
|
-
}, [editor, url]);
|
|
71
|
-
const handleKeyDown = (0, import_react.useCallback)(
|
|
72
|
-
(e) => {
|
|
73
|
-
if (e.key === "Enter") {
|
|
74
|
-
e.preventDefault();
|
|
75
|
-
handleSave();
|
|
76
|
-
} else if (e.key === "Escape") {
|
|
77
|
-
e.preventDefault();
|
|
78
|
-
setIsEditing(false);
|
|
79
|
-
setUrl(getCurrentUrl());
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
[handleSave, getCurrentUrl]
|
|
83
|
-
);
|
|
84
|
-
if (!editor) {
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
88
|
-
import_menus.BubbleMenu,
|
|
89
|
-
{
|
|
90
|
-
editor,
|
|
91
|
-
pluginKey: "linkBubbleMenu",
|
|
92
|
-
shouldShow: ({ editor: e, view }) => {
|
|
93
|
-
if (!view.hasFocus()) return false;
|
|
94
|
-
return e.isActive("link") && e.isEditable;
|
|
95
|
-
},
|
|
96
|
-
options: {
|
|
97
|
-
placement: "bottom-start",
|
|
98
|
-
offset: 8
|
|
99
|
-
},
|
|
100
|
-
className: "rounded-lg border bg-background shadow-md",
|
|
101
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex items-center gap-1 p-1.5 min-w-[280px]", children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
102
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
103
|
-
import_input.Input,
|
|
104
|
-
{
|
|
105
|
-
type: "url",
|
|
106
|
-
value: url,
|
|
107
|
-
onChange: (e) => setUrl(e.target.value),
|
|
108
|
-
onKeyDown: handleKeyDown,
|
|
109
|
-
placeholder: "Enter URL...",
|
|
110
|
-
className: "flex-1 h-8 text-sm",
|
|
111
|
-
autoFocus: true
|
|
112
|
-
}
|
|
113
|
-
),
|
|
114
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
115
|
-
import_button.IconButton,
|
|
116
|
-
{
|
|
117
|
-
type: "button",
|
|
118
|
-
size: "sm",
|
|
119
|
-
variant: "ghost",
|
|
120
|
-
onClick: handleSave,
|
|
121
|
-
"aria-label": "Save link",
|
|
122
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.EditIcon, { className: "size-4" })
|
|
123
|
-
}
|
|
124
|
-
)
|
|
125
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
126
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
127
|
-
"a",
|
|
128
|
-
{
|
|
129
|
-
href: getCurrentUrl(),
|
|
130
|
-
target: "_blank",
|
|
131
|
-
rel: "noopener noreferrer",
|
|
132
|
-
className: "flex-1 text-sm text-primary truncate max-w-[200px] hover:underline px-2",
|
|
133
|
-
onClick: (e) => {
|
|
134
|
-
e.preventDefault();
|
|
135
|
-
handleOpenLink();
|
|
136
|
-
},
|
|
137
|
-
children: getCurrentUrl()
|
|
138
|
-
}
|
|
139
|
-
),
|
|
140
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-0.5 border-l pl-1 ml-1", children: [
|
|
141
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
142
|
-
import_button.IconButton,
|
|
143
|
-
{
|
|
144
|
-
type: "button",
|
|
145
|
-
size: "sm",
|
|
146
|
-
variant: "ghost",
|
|
147
|
-
onClick: handleOpenLink,
|
|
148
|
-
"aria-label": "Open link in new tab",
|
|
149
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ExternalLinkIcon, { className: "size-4" })
|
|
150
|
-
}
|
|
151
|
-
),
|
|
152
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
153
|
-
import_button.IconButton,
|
|
154
|
-
{
|
|
155
|
-
type: "button",
|
|
156
|
-
size: "sm",
|
|
157
|
-
variant: "ghost",
|
|
158
|
-
onClick: handleEdit,
|
|
159
|
-
"aria-label": "Edit link",
|
|
160
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.EditIcon, { className: "size-4" })
|
|
161
|
-
}
|
|
162
|
-
),
|
|
163
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
164
|
-
import_button.IconButton,
|
|
165
|
-
{
|
|
166
|
-
type: "button",
|
|
167
|
-
size: "sm",
|
|
168
|
-
variant: "ghost",
|
|
169
|
-
onClick: handleRemoveLink,
|
|
170
|
-
"aria-label": "Remove link",
|
|
171
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.TrashIcon, { className: "size-4" })
|
|
172
|
-
}
|
|
173
|
-
)
|
|
174
|
-
] })
|
|
175
|
-
] }) })
|
|
176
|
-
}
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
var link_bubble_default = LinkBubble;
|
|
180
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
181
|
-
0 && (module.exports = {
|
|
182
|
-
LinkBubble
|
|
183
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { LinkButton, LinkContent, LinkMain, LinkMainProps, LinkPopover, LinkPopoverProps } from './link-popover.mjs';
|
|
2
|
-
export { LinkHandlerProps, UseLinkPopoverConfig, canSetLink, isLinkActive, shouldShowLinkButton, useLinkHandler, useLinkPopover, useLinkState } from './use-link-popover.mjs';
|
|
3
|
-
import 'react/jsx-runtime';
|
|
4
|
-
import '@kopexa/button';
|
|
5
|
-
import '@tiptap/react';
|
|
6
|
-
import '@kopexa/icons';
|
|
7
|
-
import 'react';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { LinkButton, LinkContent, LinkMain, LinkMainProps, LinkPopover, LinkPopoverProps } from './link-popover.js';
|
|
2
|
-
export { LinkHandlerProps, UseLinkPopoverConfig, canSetLink, isLinkActive, shouldShowLinkButton, useLinkHandler, useLinkPopover, useLinkState } from './use-link-popover.js';
|
|
3
|
-
import 'react/jsx-runtime';
|
|
4
|
-
import '@kopexa/button';
|
|
5
|
-
import '@tiptap/react';
|
|
6
|
-
import '@kopexa/icons';
|
|
7
|
-
import 'react';
|