@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,591 +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/color-highlight-popover/index.tsx
|
|
32
|
-
var color_highlight_popover_exports = {};
|
|
33
|
-
__export(color_highlight_popover_exports, {
|
|
34
|
-
ColorHighlightPopover: () => ColorHighlightPopover,
|
|
35
|
-
ColorHighlightPopoverButton: () => ColorHighlightPopoverButton,
|
|
36
|
-
ColorHighlightPopoverContent: () => ColorHighlightPopoverContent
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(color_highlight_popover_exports);
|
|
39
|
-
|
|
40
|
-
// src/ui/color-highlight-popover/color-highlight-popover.tsx
|
|
41
|
-
var import_button = require("@kopexa/button");
|
|
42
|
-
var import_icons2 = require("@kopexa/icons");
|
|
43
|
-
var import_popover = require("@kopexa/popover");
|
|
44
|
-
var import_toolbar2 = require("@kopexa/toolbar");
|
|
45
|
-
var import_react4 = require("react");
|
|
46
|
-
|
|
47
|
-
// src/hooks/use-menu-navigation.ts
|
|
48
|
-
var React = __toESM(require("react"));
|
|
49
|
-
function useMenuNavigation({
|
|
50
|
-
editor,
|
|
51
|
-
containerRef,
|
|
52
|
-
query,
|
|
53
|
-
items,
|
|
54
|
-
onSelect,
|
|
55
|
-
onClose,
|
|
56
|
-
orientation = "vertical",
|
|
57
|
-
autoSelectFirstItem = true
|
|
58
|
-
}) {
|
|
59
|
-
const [selectedIndex, setSelectedIndex] = React.useState(
|
|
60
|
-
autoSelectFirstItem ? 0 : -1
|
|
61
|
-
);
|
|
62
|
-
React.useEffect(() => {
|
|
63
|
-
const handleKeyboardNavigation = (event) => {
|
|
64
|
-
if (!items.length) return false;
|
|
65
|
-
const moveNext = () => setSelectedIndex((currentIndex) => {
|
|
66
|
-
if (currentIndex === -1) return 0;
|
|
67
|
-
return (currentIndex + 1) % items.length;
|
|
68
|
-
});
|
|
69
|
-
const movePrev = () => setSelectedIndex((currentIndex) => {
|
|
70
|
-
if (currentIndex === -1) return items.length - 1;
|
|
71
|
-
return (currentIndex - 1 + items.length) % items.length;
|
|
72
|
-
});
|
|
73
|
-
switch (event.key) {
|
|
74
|
-
case "ArrowUp": {
|
|
75
|
-
if (orientation === "horizontal") return false;
|
|
76
|
-
event.preventDefault();
|
|
77
|
-
movePrev();
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
case "ArrowDown": {
|
|
81
|
-
if (orientation === "horizontal") return false;
|
|
82
|
-
event.preventDefault();
|
|
83
|
-
moveNext();
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
case "ArrowLeft": {
|
|
87
|
-
if (orientation === "vertical") return false;
|
|
88
|
-
event.preventDefault();
|
|
89
|
-
movePrev();
|
|
90
|
-
return true;
|
|
91
|
-
}
|
|
92
|
-
case "ArrowRight": {
|
|
93
|
-
if (orientation === "vertical") return false;
|
|
94
|
-
event.preventDefault();
|
|
95
|
-
moveNext();
|
|
96
|
-
return true;
|
|
97
|
-
}
|
|
98
|
-
case "Tab": {
|
|
99
|
-
event.preventDefault();
|
|
100
|
-
if (event.shiftKey) {
|
|
101
|
-
movePrev();
|
|
102
|
-
} else {
|
|
103
|
-
moveNext();
|
|
104
|
-
}
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
case "Home": {
|
|
108
|
-
event.preventDefault();
|
|
109
|
-
setSelectedIndex(0);
|
|
110
|
-
return true;
|
|
111
|
-
}
|
|
112
|
-
case "End": {
|
|
113
|
-
event.preventDefault();
|
|
114
|
-
setSelectedIndex(items.length - 1);
|
|
115
|
-
return true;
|
|
116
|
-
}
|
|
117
|
-
case "Enter": {
|
|
118
|
-
if (event.isComposing) return false;
|
|
119
|
-
event.preventDefault();
|
|
120
|
-
if (selectedIndex !== -1 && items[selectedIndex]) {
|
|
121
|
-
onSelect == null ? void 0 : onSelect(items[selectedIndex]);
|
|
122
|
-
}
|
|
123
|
-
return true;
|
|
124
|
-
}
|
|
125
|
-
case "Escape": {
|
|
126
|
-
event.preventDefault();
|
|
127
|
-
onClose == null ? void 0 : onClose();
|
|
128
|
-
return true;
|
|
129
|
-
}
|
|
130
|
-
default:
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
let targetElement = null;
|
|
135
|
-
if (editor) {
|
|
136
|
-
targetElement = editor.view.dom;
|
|
137
|
-
} else if (containerRef == null ? void 0 : containerRef.current) {
|
|
138
|
-
targetElement = containerRef.current;
|
|
139
|
-
}
|
|
140
|
-
if (targetElement) {
|
|
141
|
-
targetElement.addEventListener("keydown", handleKeyboardNavigation, true);
|
|
142
|
-
return () => {
|
|
143
|
-
targetElement == null ? void 0 : targetElement.removeEventListener(
|
|
144
|
-
"keydown",
|
|
145
|
-
handleKeyboardNavigation,
|
|
146
|
-
true
|
|
147
|
-
);
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
return void 0;
|
|
151
|
-
}, [
|
|
152
|
-
editor,
|
|
153
|
-
containerRef,
|
|
154
|
-
items,
|
|
155
|
-
selectedIndex,
|
|
156
|
-
onSelect,
|
|
157
|
-
onClose,
|
|
158
|
-
orientation
|
|
159
|
-
]);
|
|
160
|
-
React.useEffect(() => {
|
|
161
|
-
if (query) {
|
|
162
|
-
setSelectedIndex(autoSelectFirstItem ? 0 : -1);
|
|
163
|
-
}
|
|
164
|
-
}, [query, autoSelectFirstItem]);
|
|
165
|
-
return {
|
|
166
|
-
selectedIndex: items.length ? selectedIndex : void 0,
|
|
167
|
-
setSelectedIndex
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// src/hooks/use-tiptap-editor.ts
|
|
172
|
-
var import_react = require("@tiptap/react");
|
|
173
|
-
var import_react2 = require("react");
|
|
174
|
-
function useTiptapEditor(providedEditor) {
|
|
175
|
-
const { editor: coreEditor } = (0, import_react.useCurrentEditor)();
|
|
176
|
-
const mainEditor = (0, import_react2.useMemo)(
|
|
177
|
-
() => providedEditor || coreEditor,
|
|
178
|
-
[providedEditor, coreEditor]
|
|
179
|
-
);
|
|
180
|
-
const editorState = (0, import_react.useEditorState)({
|
|
181
|
-
editor: mainEditor,
|
|
182
|
-
selector(context) {
|
|
183
|
-
if (!context.editor) {
|
|
184
|
-
return {
|
|
185
|
-
editor: null,
|
|
186
|
-
editorState: void 0,
|
|
187
|
-
canCommand: void 0
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
return {
|
|
191
|
-
editor: context.editor,
|
|
192
|
-
editorState: context.editor.state,
|
|
193
|
-
canCommand: context.editor.can
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
return editorState || { editor: null };
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// src/ui/color-highlight-button/color-highlight-button.tsx
|
|
201
|
-
var import_theme = require("@kopexa/theme");
|
|
202
|
-
var import_toolbar = require("@kopexa/toolbar");
|
|
203
|
-
var import_react3 = require("react");
|
|
204
|
-
|
|
205
|
-
// src/ui/color-highlight-button/use-color-highlight.ts
|
|
206
|
-
var import_editor_utils = require("@kopexa/editor-utils");
|
|
207
|
-
var import_icons = require("@kopexa/icons");
|
|
208
|
-
var import_use_is_mobile = require("@kopexa/use-is-mobile");
|
|
209
|
-
var React2 = __toESM(require("react"));
|
|
210
|
-
var import_react_hotkeys_hook = require("react-hotkeys-hook");
|
|
211
|
-
var COLOR_HIGHLIGHT_SHORTCUT_KEY = "mod+shift+h";
|
|
212
|
-
var HIGHLIGHT_COLORS = [
|
|
213
|
-
{
|
|
214
|
-
label: "Default background",
|
|
215
|
-
value: "var(--tt-bg-color)",
|
|
216
|
-
border: "var(--tt-bg-color-contrast)"
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
label: "Gray background",
|
|
220
|
-
value: "var(--tt-color-highlight-gray)",
|
|
221
|
-
border: "var(--tt-color-highlight-gray-contrast)"
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
label: "Brown background",
|
|
225
|
-
value: "var(--tt-color-highlight-brown)",
|
|
226
|
-
border: "var(--tt-color-highlight-brown-contrast)"
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
label: "Orange background",
|
|
230
|
-
value: "var(--tt-color-highlight-orange)",
|
|
231
|
-
border: "var(--tt-color-highlight-orange-contrast)"
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
label: "Yellow background",
|
|
235
|
-
value: "var(--tt-color-highlight-yellow)",
|
|
236
|
-
border: "var(--tt-color-highlight-yellow-contrast)"
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
label: "Green background",
|
|
240
|
-
value: "var(--tt-color-highlight-green)",
|
|
241
|
-
border: "var(--tt-color-highlight-green-contrast)"
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
label: "Blue background",
|
|
245
|
-
value: "var(--tt-color-highlight-blue)",
|
|
246
|
-
border: "var(--tt-color-highlight-blue-contrast)"
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
label: "Purple background",
|
|
250
|
-
value: "var(--tt-color-highlight-purple)",
|
|
251
|
-
border: "var(--tt-color-highlight-purple-contrast)"
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
label: "Pink background",
|
|
255
|
-
value: "var(--tt-color-highlight-pink)",
|
|
256
|
-
border: "var(--tt-color-highlight-pink-contrast)"
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
label: "Red background",
|
|
260
|
-
value: "var(--tt-color-highlight-red)",
|
|
261
|
-
border: "var(--tt-color-highlight-red-contrast)"
|
|
262
|
-
}
|
|
263
|
-
];
|
|
264
|
-
function pickHighlightColorsByValue(values) {
|
|
265
|
-
const colorMap = new Map(
|
|
266
|
-
HIGHLIGHT_COLORS.map((color) => [color.value, color])
|
|
267
|
-
);
|
|
268
|
-
return values.map((value) => colorMap.get(value)).filter((color) => !!color);
|
|
269
|
-
}
|
|
270
|
-
function canColorHighlight(editor) {
|
|
271
|
-
if (!editor || !editor.isEditable) return false;
|
|
272
|
-
if (!(0, import_editor_utils.isMarkInSchema)("highlight", editor) || (0, import_editor_utils.isNodeTypeSelected)(editor, ["image"]))
|
|
273
|
-
return false;
|
|
274
|
-
return editor.can().setMark("highlight");
|
|
275
|
-
}
|
|
276
|
-
function isColorHighlightActive(editor, highlightColor) {
|
|
277
|
-
if (!editor || !editor.isEditable) return false;
|
|
278
|
-
return highlightColor ? editor.isActive("highlight", { color: highlightColor }) : editor.isActive("highlight");
|
|
279
|
-
}
|
|
280
|
-
function removeHighlight(editor) {
|
|
281
|
-
if (!editor || !editor.isEditable) return false;
|
|
282
|
-
if (!canColorHighlight(editor)) return false;
|
|
283
|
-
return editor.chain().focus().unsetMark("highlight").run();
|
|
284
|
-
}
|
|
285
|
-
function shouldShowButton(props) {
|
|
286
|
-
const { editor, hideWhenUnavailable } = props;
|
|
287
|
-
if (!editor || !editor.isEditable) return false;
|
|
288
|
-
if (!(0, import_editor_utils.isMarkInSchema)("highlight", editor)) return false;
|
|
289
|
-
if (hideWhenUnavailable && !editor.isActive("code")) {
|
|
290
|
-
return canColorHighlight(editor);
|
|
291
|
-
}
|
|
292
|
-
return true;
|
|
293
|
-
}
|
|
294
|
-
function useColorHighlight(config) {
|
|
295
|
-
const {
|
|
296
|
-
editor: providedEditor,
|
|
297
|
-
label,
|
|
298
|
-
highlightColor,
|
|
299
|
-
hideWhenUnavailable = false,
|
|
300
|
-
onApplied
|
|
301
|
-
} = config;
|
|
302
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
303
|
-
const isMobile = (0, import_use_is_mobile.useIsMobile)();
|
|
304
|
-
const [isVisible, setIsVisible] = React2.useState(true);
|
|
305
|
-
const canColorHighlightState = canColorHighlight(editor);
|
|
306
|
-
const isActive = isColorHighlightActive(editor, highlightColor);
|
|
307
|
-
React2.useEffect(() => {
|
|
308
|
-
if (!editor) return;
|
|
309
|
-
const handleSelectionUpdate = () => {
|
|
310
|
-
setIsVisible(shouldShowButton({ editor, hideWhenUnavailable }));
|
|
311
|
-
};
|
|
312
|
-
handleSelectionUpdate();
|
|
313
|
-
editor.on("selectionUpdate", handleSelectionUpdate);
|
|
314
|
-
return () => {
|
|
315
|
-
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
316
|
-
};
|
|
317
|
-
}, [editor, hideWhenUnavailable]);
|
|
318
|
-
const handleColorHighlight = React2.useCallback(() => {
|
|
319
|
-
if (!editor || !canColorHighlightState || !highlightColor || !label)
|
|
320
|
-
return false;
|
|
321
|
-
if (editor.state.storedMarks) {
|
|
322
|
-
const highlightMarkType = editor.schema.marks.highlight;
|
|
323
|
-
if (highlightMarkType) {
|
|
324
|
-
editor.view.dispatch(
|
|
325
|
-
editor.state.tr.removeStoredMark(highlightMarkType)
|
|
326
|
-
);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
setTimeout(() => {
|
|
330
|
-
const success = editor.chain().focus().toggleMark("highlight", { color: highlightColor }).run();
|
|
331
|
-
if (success) {
|
|
332
|
-
onApplied == null ? void 0 : onApplied({ color: highlightColor, label });
|
|
333
|
-
}
|
|
334
|
-
return success;
|
|
335
|
-
}, 0);
|
|
336
|
-
}, [canColorHighlightState, highlightColor, editor, label, onApplied]);
|
|
337
|
-
const handleRemoveHighlight = React2.useCallback(() => {
|
|
338
|
-
const success = removeHighlight(editor);
|
|
339
|
-
if (success) {
|
|
340
|
-
onApplied == null ? void 0 : onApplied({ color: "", label: "Remove highlight" });
|
|
341
|
-
}
|
|
342
|
-
return success;
|
|
343
|
-
}, [editor, onApplied]);
|
|
344
|
-
(0, import_react_hotkeys_hook.useHotkeys)(
|
|
345
|
-
COLOR_HIGHLIGHT_SHORTCUT_KEY,
|
|
346
|
-
(event) => {
|
|
347
|
-
event.preventDefault();
|
|
348
|
-
handleColorHighlight();
|
|
349
|
-
},
|
|
350
|
-
{
|
|
351
|
-
enabled: isVisible && canColorHighlightState,
|
|
352
|
-
enableOnContentEditable: !isMobile,
|
|
353
|
-
enableOnFormTags: true
|
|
354
|
-
}
|
|
355
|
-
);
|
|
356
|
-
return {
|
|
357
|
-
isVisible,
|
|
358
|
-
isActive,
|
|
359
|
-
handleColorHighlight,
|
|
360
|
-
handleRemoveHighlight,
|
|
361
|
-
canColorHighlight: canColorHighlightState,
|
|
362
|
-
label: label || `Highlight`,
|
|
363
|
-
shortcutKeys: COLOR_HIGHLIGHT_SHORTCUT_KEY,
|
|
364
|
-
Icon: import_icons.HighlighterIcon
|
|
365
|
-
};
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
// src/ui/color-highlight-button/color-highlight-button.tsx
|
|
369
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
370
|
-
var ColorHighlightButton = ({
|
|
371
|
-
editor: providedEditor,
|
|
372
|
-
highlightColor,
|
|
373
|
-
text,
|
|
374
|
-
hideWhenUnavailable = false,
|
|
375
|
-
onApplied,
|
|
376
|
-
showShortcut = false,
|
|
377
|
-
onClick,
|
|
378
|
-
children,
|
|
379
|
-
style,
|
|
380
|
-
className,
|
|
381
|
-
...buttonProps
|
|
382
|
-
}) => {
|
|
383
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
384
|
-
const {
|
|
385
|
-
isVisible,
|
|
386
|
-
canColorHighlight: canColorHighlight2,
|
|
387
|
-
isActive,
|
|
388
|
-
handleColorHighlight,
|
|
389
|
-
label,
|
|
390
|
-
shortcutKeys
|
|
391
|
-
} = useColorHighlight({
|
|
392
|
-
editor,
|
|
393
|
-
highlightColor,
|
|
394
|
-
label: text || `Toggle highlight (${highlightColor})`,
|
|
395
|
-
hideWhenUnavailable,
|
|
396
|
-
onApplied
|
|
397
|
-
});
|
|
398
|
-
const handleClick = (0, import_react3.useCallback)(
|
|
399
|
-
(event) => {
|
|
400
|
-
onClick == null ? void 0 : onClick(event);
|
|
401
|
-
if (event.defaultPrevented) return;
|
|
402
|
-
handleColorHighlight();
|
|
403
|
-
},
|
|
404
|
-
[handleColorHighlight, onClick]
|
|
405
|
-
);
|
|
406
|
-
const buttonStyle = (0, import_react3.useMemo)(
|
|
407
|
-
() => ({
|
|
408
|
-
...style,
|
|
409
|
-
"--highlight-color": highlightColor
|
|
410
|
-
}),
|
|
411
|
-
[highlightColor, style]
|
|
412
|
-
);
|
|
413
|
-
if (!isVisible) {
|
|
414
|
-
return null;
|
|
415
|
-
}
|
|
416
|
-
const styles = (0, import_theme.colorHighlightButton)();
|
|
417
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
418
|
-
import_toolbar.ToolbarButton,
|
|
419
|
-
{
|
|
420
|
-
type: "button",
|
|
421
|
-
disabled: !canColorHighlight2,
|
|
422
|
-
"data-disabled": !canColorHighlight2,
|
|
423
|
-
variant: "ghost",
|
|
424
|
-
color: "default",
|
|
425
|
-
"data-active-state": isActive ? "on" : "off",
|
|
426
|
-
tabIndex: -1,
|
|
427
|
-
"aria-label": label,
|
|
428
|
-
shortcutKeys,
|
|
429
|
-
"aria-pressed": isActive,
|
|
430
|
-
onClick: handleClick,
|
|
431
|
-
style: buttonStyle,
|
|
432
|
-
className: styles.button({ className }),
|
|
433
|
-
isIconOnly: true,
|
|
434
|
-
...buttonProps,
|
|
435
|
-
children: [
|
|
436
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
437
|
-
"span",
|
|
438
|
-
{
|
|
439
|
-
"data-active-state": isActive ? "on" : "off",
|
|
440
|
-
className: styles.mark()
|
|
441
|
-
}
|
|
442
|
-
),
|
|
443
|
-
children || /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
444
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
445
|
-
"span",
|
|
446
|
-
{
|
|
447
|
-
style: { "--highlight-color": highlightColor }
|
|
448
|
-
}
|
|
449
|
-
),
|
|
450
|
-
text
|
|
451
|
-
] })
|
|
452
|
-
]
|
|
453
|
-
}
|
|
454
|
-
);
|
|
455
|
-
};
|
|
456
|
-
|
|
457
|
-
// src/ui/color-highlight-popover/color-highlight-popover.tsx
|
|
458
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
459
|
-
var ColorHighlightPopoverButton = ({
|
|
460
|
-
className,
|
|
461
|
-
children,
|
|
462
|
-
...props
|
|
463
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
464
|
-
import_button.IconButton,
|
|
465
|
-
{
|
|
466
|
-
type: "button",
|
|
467
|
-
className,
|
|
468
|
-
variant: "ghost",
|
|
469
|
-
color: "default",
|
|
470
|
-
tabIndex: -1,
|
|
471
|
-
"aria-label": "Highlight text",
|
|
472
|
-
tooltip: "Highlight",
|
|
473
|
-
isIconOnly: !children,
|
|
474
|
-
...props,
|
|
475
|
-
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons2.HighlighterIcon, {})
|
|
476
|
-
}
|
|
477
|
-
);
|
|
478
|
-
function ColorHighlightPopoverContent({
|
|
479
|
-
editor,
|
|
480
|
-
colors = pickHighlightColorsByValue([
|
|
481
|
-
"var(--tt-color-highlight-green)",
|
|
482
|
-
"var(--tt-color-highlight-blue)",
|
|
483
|
-
"var(--tt-color-highlight-red)",
|
|
484
|
-
"var(--tt-color-highlight-purple)",
|
|
485
|
-
"var(--tt-color-highlight-yellow)"
|
|
486
|
-
])
|
|
487
|
-
}) {
|
|
488
|
-
const { handleRemoveHighlight } = useColorHighlight({ editor });
|
|
489
|
-
const containerRef = (0, import_react4.useRef)(null);
|
|
490
|
-
const menuItems = (0, import_react4.useMemo)(
|
|
491
|
-
() => [...colors, { label: "Remove highlight", value: "none" }],
|
|
492
|
-
[colors]
|
|
493
|
-
);
|
|
494
|
-
const { selectedIndex } = useMenuNavigation({
|
|
495
|
-
containerRef,
|
|
496
|
-
items: menuItems,
|
|
497
|
-
orientation: "both",
|
|
498
|
-
onSelect: (item) => {
|
|
499
|
-
if (!containerRef.current) return false;
|
|
500
|
-
const highlightedElement = containerRef.current.querySelector(
|
|
501
|
-
'[data-highlighted="true"]'
|
|
502
|
-
);
|
|
503
|
-
if (highlightedElement) highlightedElement.click();
|
|
504
|
-
if (item.value === "none") handleRemoveHighlight();
|
|
505
|
-
},
|
|
506
|
-
autoSelectFirstItem: false
|
|
507
|
-
});
|
|
508
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { ref: containerRef, className: "flex gap-1 items-center", children: [
|
|
509
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
510
|
-
"div",
|
|
511
|
-
{
|
|
512
|
-
className: "flex items-center gap-1 outline-none",
|
|
513
|
-
"data-orientation": "horizontal",
|
|
514
|
-
children: colors.map((color, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
515
|
-
ColorHighlightButton,
|
|
516
|
-
{
|
|
517
|
-
editor,
|
|
518
|
-
highlightColor: color.value,
|
|
519
|
-
"aria-label": `${color.label} highlight color`,
|
|
520
|
-
tabIndex: index === selectedIndex ? 0 : -1,
|
|
521
|
-
"data-highlighted": selectedIndex === index
|
|
522
|
-
},
|
|
523
|
-
color.value
|
|
524
|
-
))
|
|
525
|
-
}
|
|
526
|
-
),
|
|
527
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_toolbar2.ToolbarSeparator, { orientation: "vertical" }),
|
|
528
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "tiptap-button-group", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
529
|
-
import_button.IconButton,
|
|
530
|
-
{
|
|
531
|
-
onClick: handleRemoveHighlight,
|
|
532
|
-
"aria-label": "Remove highlight",
|
|
533
|
-
tabIndex: selectedIndex === colors.length ? 0 : -1,
|
|
534
|
-
type: "button",
|
|
535
|
-
role: "menuitem",
|
|
536
|
-
variant: "ghost",
|
|
537
|
-
color: "default",
|
|
538
|
-
"data-highlighted": selectedIndex === colors.length,
|
|
539
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons2.BanIcon, {})
|
|
540
|
-
}
|
|
541
|
-
) })
|
|
542
|
-
] });
|
|
543
|
-
}
|
|
544
|
-
function ColorHighlightPopover({
|
|
545
|
-
editor: providedEditor,
|
|
546
|
-
colors = pickHighlightColorsByValue([
|
|
547
|
-
"var(--tt-color-highlight-green)",
|
|
548
|
-
"var(--tt-color-highlight-blue)",
|
|
549
|
-
"var(--tt-color-highlight-red)",
|
|
550
|
-
"var(--tt-color-highlight-purple)",
|
|
551
|
-
"var(--tt-color-highlight-yellow)"
|
|
552
|
-
]),
|
|
553
|
-
hideWhenUnavailable = false,
|
|
554
|
-
onApplied,
|
|
555
|
-
...props
|
|
556
|
-
}) {
|
|
557
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
558
|
-
const [isOpen, setIsOpen] = (0, import_react4.useState)(false);
|
|
559
|
-
const { isVisible, canColorHighlight: canColorHighlight2, isActive, label } = useColorHighlight({
|
|
560
|
-
editor,
|
|
561
|
-
hideWhenUnavailable,
|
|
562
|
-
onApplied
|
|
563
|
-
});
|
|
564
|
-
if (!isVisible) return null;
|
|
565
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_popover.Popover.Root, { open: isOpen, onOpenChange: setIsOpen, spacing: "dense", children: [
|
|
566
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
567
|
-
import_popover.Popover.Trigger,
|
|
568
|
-
{
|
|
569
|
-
render: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
570
|
-
ColorHighlightPopoverButton,
|
|
571
|
-
{
|
|
572
|
-
disabled: !canColorHighlight2,
|
|
573
|
-
"data-disabled": !canColorHighlight2,
|
|
574
|
-
"data-active-state": isActive ? "on" : "off",
|
|
575
|
-
"aria-pressed": isActive,
|
|
576
|
-
"aria-label": label,
|
|
577
|
-
title: label,
|
|
578
|
-
...props
|
|
579
|
-
}
|
|
580
|
-
)
|
|
581
|
-
}
|
|
582
|
-
),
|
|
583
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_popover.Popover.Content, { "aria-label": "Highlight colors", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ColorHighlightPopoverContent, { editor, colors }) })
|
|
584
|
-
] });
|
|
585
|
-
}
|
|
586
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
587
|
-
0 && (module.exports = {
|
|
588
|
-
ColorHighlightPopover,
|
|
589
|
-
ColorHighlightPopoverButton,
|
|
590
|
-
ColorHighlightPopoverContent
|
|
591
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../chunk-TLM5ALHZ.mjs";
|
|
3
|
-
import {
|
|
4
|
-
ColorHighlightPopover,
|
|
5
|
-
ColorHighlightPopoverButton,
|
|
6
|
-
ColorHighlightPopoverContent
|
|
7
|
-
} from "../../chunk-C5RQWJKE.mjs";
|
|
8
|
-
import "../../chunk-2Z2QVW67.mjs";
|
|
9
|
-
import "../../chunk-B7WJOQ3X.mjs";
|
|
10
|
-
import "../../chunk-UJ4BNZ63.mjs";
|
|
11
|
-
import "../../chunk-P55PLOHR.mjs";
|
|
12
|
-
import "../../chunk-42HKGCOO.mjs";
|
|
13
|
-
export {
|
|
14
|
-
ColorHighlightPopover,
|
|
15
|
-
ColorHighlightPopoverButton,
|
|
16
|
-
ColorHighlightPopoverContent
|
|
17
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/react';
|
|
2
|
-
|
|
3
|
-
interface UseScrollToHashConfig {
|
|
4
|
-
/**
|
|
5
|
-
* The Tiptap editor instance.
|
|
6
|
-
*/
|
|
7
|
-
editor?: Editor | null;
|
|
8
|
-
/**
|
|
9
|
-
* Callback called when the target node is found.
|
|
10
|
-
* @param nodeId The ID of the found node
|
|
11
|
-
*/
|
|
12
|
-
onTargetFound?: (nodeId: string) => void;
|
|
13
|
-
/**
|
|
14
|
-
* Callback called when the target node is not found.
|
|
15
|
-
* @param hash The hash that was attempted to be scrolled to
|
|
16
|
-
*/
|
|
17
|
-
onTargetNotFound?: (hash: string) => void;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Hook to scroll to a specific hash in the Tiptap editor.
|
|
21
|
-
* It finds the node with the given ID and scrolls it into view.
|
|
22
|
-
*
|
|
23
|
-
* @param config Configuration for the scroll behavior
|
|
24
|
-
* @returns Function to scroll to a specific hash
|
|
25
|
-
*/
|
|
26
|
-
declare function useScrollToHash(config?: UseScrollToHashConfig): {
|
|
27
|
-
scrollToHash: (id: string) => boolean;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export { type UseScrollToHashConfig, useScrollToHash };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/react';
|
|
2
|
-
|
|
3
|
-
interface UseScrollToHashConfig {
|
|
4
|
-
/**
|
|
5
|
-
* The Tiptap editor instance.
|
|
6
|
-
*/
|
|
7
|
-
editor?: Editor | null;
|
|
8
|
-
/**
|
|
9
|
-
* Callback called when the target node is found.
|
|
10
|
-
* @param nodeId The ID of the found node
|
|
11
|
-
*/
|
|
12
|
-
onTargetFound?: (nodeId: string) => void;
|
|
13
|
-
/**
|
|
14
|
-
* Callback called when the target node is not found.
|
|
15
|
-
* @param hash The hash that was attempted to be scrolled to
|
|
16
|
-
*/
|
|
17
|
-
onTargetNotFound?: (hash: string) => void;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Hook to scroll to a specific hash in the Tiptap editor.
|
|
21
|
-
* It finds the node with the given ID and scrolls it into view.
|
|
22
|
-
*
|
|
23
|
-
* @param config Configuration for the scroll behavior
|
|
24
|
-
* @returns Function to scroll to a specific hash
|
|
25
|
-
*/
|
|
26
|
-
declare function useScrollToHash(config?: UseScrollToHashConfig): {
|
|
27
|
-
scrollToHash: (id: string) => boolean;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export { type UseScrollToHashConfig, useScrollToHash };
|