@kopexa/tiptap 17.6.17 → 17.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +691 -24
- package/dist/index.d.ts +691 -24
- package/dist/index.js +1081 -668
- package/dist/index.mjs +7686 -112
- package/package.json +57 -52
- package/dist/chunk-2SI7MRAE.mjs +0 -64
- package/dist/chunk-2U5CQUZH.mjs +0 -91
- package/dist/chunk-2UDCL55K.mjs +0 -55
- package/dist/chunk-2V6VOAPI.mjs +0 -139
- package/dist/chunk-2Z2QVW67.mjs +0 -1
- package/dist/chunk-32SUXCAQ.mjs +0 -115
- package/dist/chunk-33QD5PYJ.mjs +0 -63
- package/dist/chunk-3VRQUYYW.mjs +0 -169
- package/dist/chunk-42HKGCOO.mjs +0 -129
- package/dist/chunk-4ALV4UA5.mjs +0 -1
- package/dist/chunk-4CDZ547I.mjs +0 -185
- package/dist/chunk-4HO7BWDC.mjs +0 -89
- package/dist/chunk-4JRYQZ4A.mjs +0 -174
- package/dist/chunk-552JLRNB.mjs +0 -35
- package/dist/chunk-5SMDMQDF.mjs +0 -34
- package/dist/chunk-6552DQWB.mjs +0 -416
- package/dist/chunk-7FDDRVUE.mjs +0 -143
- package/dist/chunk-7VGROP26.mjs +0 -262
- package/dist/chunk-7VW67NVL.mjs +0 -80
- package/dist/chunk-AAV7ZNBP.mjs +0 -83
- package/dist/chunk-ATRHILCH.mjs +0 -1
- package/dist/chunk-B7WJOQ3X.mjs +0 -103
- package/dist/chunk-BEV5U2DK.mjs +0 -131
- package/dist/chunk-BXHPO3T7.mjs +0 -152
- package/dist/chunk-BXJYNSWQ.mjs +0 -30
- package/dist/chunk-C5RQWJKE.mjs +0 -155
- package/dist/chunk-CNVACBGT.mjs +0 -51
- package/dist/chunk-DQK6PA4U.mjs +0 -276
- package/dist/chunk-DSBJFMHK.mjs +0 -38
- package/dist/chunk-DT7ML2P4.mjs +0 -42
- package/dist/chunk-DZLGLP7R.mjs +0 -99
- package/dist/chunk-EAAQE5ZV.mjs +0 -283
- package/dist/chunk-EHY2NAW7.mjs +0 -120
- package/dist/chunk-EIIWU5FR.mjs +0 -61
- package/dist/chunk-ERPGWXFK.mjs +0 -163
- package/dist/chunk-F73FCUD5.mjs +0 -1
- package/dist/chunk-FRJX2F4T.mjs +0 -55
- package/dist/chunk-GYIYX2JH.mjs +0 -73
- package/dist/chunk-H6LC4LDQ.mjs +0 -63
- package/dist/chunk-H7MS2UMO.mjs +0 -168
- package/dist/chunk-HLLA2HRV.mjs +0 -1
- package/dist/chunk-HTJ2RXOG.mjs +0 -32
- package/dist/chunk-IFXRPGIJ.mjs +0 -98
- package/dist/chunk-IOB3REX6.mjs +0 -173
- package/dist/chunk-IQERE7KP.mjs +0 -115
- package/dist/chunk-JCV5SEKN.mjs +0 -65
- package/dist/chunk-JVSH5T4B.mjs +0 -72
- package/dist/chunk-KK4K43WM.mjs +0 -59
- package/dist/chunk-KR42JAVB.mjs +0 -60
- package/dist/chunk-KYLBKQ2E.mjs +0 -203
- package/dist/chunk-L5RDMV3H.mjs +0 -216
- package/dist/chunk-LNVWG34E.mjs +0 -165
- package/dist/chunk-LVNUU67N.mjs +0 -1
- package/dist/chunk-MNTOOEHA.mjs +0 -1
- package/dist/chunk-N3JE67CS.mjs +0 -81
- package/dist/chunk-N4CT5RNC.mjs +0 -123
- package/dist/chunk-OEVR5N7X.mjs +0 -65
- package/dist/chunk-P55PLOHR.mjs +0 -34
- package/dist/chunk-Q5FK7SFY.mjs +0 -75
- package/dist/chunk-Q7DFJ5NI.mjs +0 -153
- package/dist/chunk-QIELBKP3.mjs +0 -104
- package/dist/chunk-R2GM4A3T.mjs +0 -71
- package/dist/chunk-REJEJXOZ.mjs +0 -10
- package/dist/chunk-RFWNKE7D.mjs +0 -238
- package/dist/chunk-TAM3VMJT.mjs +0 -80
- package/dist/chunk-TDFS3DCZ.mjs +0 -79
- package/dist/chunk-TLM5ALHZ.mjs +0 -1
- package/dist/chunk-TZQQ6C2Q.mjs +0 -101
- package/dist/chunk-U5XAL46P.mjs +0 -39
- package/dist/chunk-UJ4BNZ63.mjs +0 -178
- package/dist/chunk-UVHVCION.mjs +0 -168
- package/dist/chunk-V6TAZMQN.mjs +0 -105
- package/dist/chunk-VF3G2URZ.mjs +0 -83
- package/dist/chunk-VRQ6OSAZ.mjs +0 -76
- package/dist/chunk-VTKJPVNM.mjs +0 -148
- package/dist/chunk-VX3HSJ76.mjs +0 -73
- package/dist/chunk-W2FLOOJ6.mjs +0 -75
- package/dist/chunk-XGAABDMW.mjs +0 -159
- package/dist/chunk-Y2KSWMG5.mjs +0 -1
- package/dist/chunk-YJAHZXLG.mjs +0 -92
- package/dist/chunk-Z365KVQY.mjs +0 -34
- package/dist/chunk-ZVTJ6XD7.mjs +0 -88
- package/dist/chunk-ZZ4OU46C.mjs +0 -131
- package/dist/context/editor-context.d.mts +0 -10
- package/dist/context/editor-context.d.ts +0 -10
- package/dist/context/editor-context.js +0 -34
- package/dist/context/editor-context.mjs +0 -9
- package/dist/context/editor-file-context.d.mts +0 -70
- package/dist/context/editor-file-context.d.ts +0 -70
- package/dist/context/editor-file-context.js +0 -96
- package/dist/context/editor-file-context.mjs +0 -12
- package/dist/extensions/callout/callout-settings.d.mts +0 -13
- package/dist/extensions/callout/callout-settings.d.ts +0 -13
- package/dist/extensions/callout/callout-settings.js +0 -206
- package/dist/extensions/callout/callout-settings.mjs +0 -9
- package/dist/extensions/callout/callout-view.d.mts +0 -12
- package/dist/extensions/callout/callout-view.d.ts +0 -12
- package/dist/extensions/callout/callout-view.js +0 -273
- package/dist/extensions/callout/callout-view.mjs +0 -12
- package/dist/extensions/callout/index.d.mts +0 -44
- package/dist/extensions/callout/index.d.ts +0 -44
- package/dist/extensions/callout/index.js +0 -380
- package/dist/extensions/callout/index.mjs +0 -13
- package/dist/extensions/callout/messages.d.mts +0 -59
- package/dist/extensions/callout/messages.d.ts +0 -59
- package/dist/extensions/callout/messages.js +0 -88
- package/dist/extensions/callout/messages.mjs +0 -7
- package/dist/extensions/image/image-view.d.mts +0 -15
- package/dist/extensions/image/image-view.d.ts +0 -15
- package/dist/extensions/image/image-view.js +0 -255
- package/dist/extensions/image/image-view.mjs +0 -12
- package/dist/extensions/image/index.d.mts +0 -29
- package/dist/extensions/image/index.d.ts +0 -29
- package/dist/extensions/image/index.js +0 -282
- package/dist/extensions/image/index.mjs +0 -16
- package/dist/extensions/image/messages.d.mts +0 -28
- package/dist/extensions/image/messages.d.ts +0 -28
- package/dist/extensions/image/messages.js +0 -57
- package/dist/extensions/image/messages.mjs +0 -7
- package/dist/extensions/image-upload/image-upload-view.d.mts +0 -12
- package/dist/extensions/image-upload/image-upload-view.d.ts +0 -12
- package/dist/extensions/image-upload/image-upload-view.js +0 -338
- package/dist/extensions/image-upload/image-upload-view.mjs +0 -12
- package/dist/extensions/image-upload/index.d.mts +0 -46
- package/dist/extensions/image-upload/index.d.ts +0 -46
- package/dist/extensions/image-upload/index.js +0 -414
- package/dist/extensions/image-upload/index.mjs +0 -16
- package/dist/extensions/image-upload/messages.d.mts +0 -32
- package/dist/extensions/image-upload/messages.d.ts +0 -32
- package/dist/extensions/image-upload/messages.js +0 -61
- package/dist/extensions/image-upload/messages.mjs +0 -7
- package/dist/extensions/link/index.d.mts +0 -6
- package/dist/extensions/link/index.d.ts +0 -6
- package/dist/extensions/link/index.js +0 -94
- package/dist/extensions/link/index.mjs +0 -7
- package/dist/extensions/math/index.d.mts +0 -38
- package/dist/extensions/math/index.d.ts +0 -38
- package/dist/extensions/math/index.js +0 -544
- package/dist/extensions/math/index.mjs +0 -17
- package/dist/extensions/math/inline-math-view.d.mts +0 -12
- package/dist/extensions/math/inline-math-view.d.ts +0 -12
- package/dist/extensions/math/inline-math-view.js +0 -232
- package/dist/extensions/math/inline-math-view.mjs +0 -11
- package/dist/extensions/math/inline-math.d.mts +0 -32
- package/dist/extensions/math/inline-math.d.ts +0 -32
- package/dist/extensions/math/inline-math.js +0 -304
- package/dist/extensions/math/inline-math.mjs +0 -12
- package/dist/extensions/math/math-block-view.d.mts +0 -11
- package/dist/extensions/math/math-block-view.d.ts +0 -11
- package/dist/extensions/math/math-block-view.js +0 -248
- package/dist/extensions/math/math-block-view.mjs +0 -11
- package/dist/extensions/math/messages.d.mts +0 -49
- package/dist/extensions/math/messages.d.ts +0 -49
- package/dist/extensions/math/messages.js +0 -78
- package/dist/extensions/math/messages.mjs +0 -7
- package/dist/extensions/selection/index.d.mts +0 -5
- package/dist/extensions/selection/index.d.ts +0 -5
- package/dist/extensions/selection/index.js +0 -62
- package/dist/extensions/selection/index.mjs +0 -7
- package/dist/extensions/toc/index.d.mts +0 -53
- package/dist/extensions/toc/index.d.ts +0 -53
- package/dist/extensions/toc/index.js +0 -501
- package/dist/extensions/toc/index.mjs +0 -13
- package/dist/extensions/toc/messages.d.mts +0 -74
- package/dist/extensions/toc/messages.d.ts +0 -74
- package/dist/extensions/toc/messages.js +0 -103
- package/dist/extensions/toc/messages.mjs +0 -7
- package/dist/extensions/toc/toc-settings.d.mts +0 -13
- package/dist/extensions/toc/toc-settings.d.ts +0 -13
- package/dist/extensions/toc/toc-settings.js +0 -283
- package/dist/extensions/toc/toc-settings.mjs +0 -9
- package/dist/extensions/toc/toc-view.d.mts +0 -12
- package/dist/extensions/toc/toc-view.d.ts +0 -12
- package/dist/extensions/toc/toc-view.js +0 -411
- package/dist/extensions/toc/toc-view.mjs +0 -12
- package/dist/extensions/trailing-node/index.d.mts +0 -9
- package/dist/extensions/trailing-node/index.d.ts +0 -9
- package/dist/extensions/trailing-node/index.js +0 -86
- package/dist/extensions/trailing-node/index.mjs +0 -7
- package/dist/extensions/ui-state/index.d.mts +0 -34
- package/dist/extensions/ui-state/index.d.ts +0 -34
- package/dist/extensions/ui-state/index.js +0 -84
- package/dist/extensions/ui-state/index.mjs +0 -9
- package/dist/extensions/variable/extract-variables.d.mts +0 -16
- package/dist/extensions/variable/extract-variables.d.ts +0 -16
- package/dist/extensions/variable/extract-variables.js +0 -58
- package/dist/extensions/variable/extract-variables.mjs +0 -7
- package/dist/extensions/variable/index.d.mts +0 -38
- package/dist/extensions/variable/index.d.ts +0 -38
- package/dist/extensions/variable/index.js +0 -190
- package/dist/extensions/variable/index.mjs +0 -11
- package/dist/extensions/variable/messages.d.mts +0 -69
- package/dist/extensions/variable/messages.d.ts +0 -69
- package/dist/extensions/variable/messages.js +0 -98
- package/dist/extensions/variable/messages.mjs +0 -7
- package/dist/extensions/variable/variable-context.d.mts +0 -56
- package/dist/extensions/variable/variable-context.d.ts +0 -56
- package/dist/extensions/variable/variable-context.js +0 -70
- package/dist/extensions/variable/variable-context.mjs +0 -12
- package/dist/extensions/variable/variable-filler-dialog.d.mts +0 -43
- package/dist/extensions/variable/variable-filler-dialog.d.ts +0 -43
- package/dist/extensions/variable/variable-filler-dialog.js +0 -207
- package/dist/extensions/variable/variable-filler-dialog.mjs +0 -9
- package/dist/extensions/variable/variable-suggestion.d.mts +0 -31
- package/dist/extensions/variable/variable-suggestion.d.ts +0 -31
- package/dist/extensions/variable/variable-suggestion.js +0 -615
- package/dist/extensions/variable/variable-suggestion.mjs +0 -14
- package/dist/extensions/variable/variable-view.d.mts +0 -13
- package/dist/extensions/variable/variable-view.d.ts +0 -13
- package/dist/extensions/variable/variable-view.js +0 -110
- package/dist/extensions/variable/variable-view.mjs +0 -11
- package/dist/hooks/use-create-editor.d.mts +0 -46
- package/dist/hooks/use-create-editor.d.ts +0 -46
- package/dist/hooks/use-create-editor.js +0 -2726
- package/dist/hooks/use-create-editor.mjs +0 -37
- package/dist/hooks/use-cursor-visibility.d.mts +0 -37
- package/dist/hooks/use-cursor-visibility.d.ts +0 -37
- package/dist/hooks/use-cursor-visibility.js +0 -140
- package/dist/hooks/use-cursor-visibility.mjs +0 -8
- package/dist/hooks/use-floating-element.d.mts +0 -43
- package/dist/hooks/use-floating-element.d.ts +0 -43
- package/dist/hooks/use-floating-element.js +0 -88
- package/dist/hooks/use-floating-element.mjs +0 -8
- package/dist/hooks/use-floating-toolbar-visibility.d.mts +0 -32
- package/dist/hooks/use-floating-toolbar-visibility.d.ts +0 -32
- package/dist/hooks/use-floating-toolbar-visibility.js +0 -115
- package/dist/hooks/use-floating-toolbar-visibility.mjs +0 -13
- package/dist/hooks/use-menu-navigation.d.mts +0 -55
- package/dist/hooks/use-menu-navigation.d.ts +0 -55
- package/dist/hooks/use-menu-navigation.js +0 -163
- package/dist/hooks/use-menu-navigation.mjs +0 -8
- package/dist/hooks/use-tiptap-editor.d.mts +0 -20
- package/dist/hooks/use-tiptap-editor.d.ts +0 -20
- package/dist/hooks/use-tiptap-editor.js +0 -58
- package/dist/hooks/use-tiptap-editor.mjs +0 -8
- package/dist/hooks/use-ui-editor-state.d.mts +0 -7
- package/dist/hooks/use-ui-editor-state.d.ts +0 -7
- package/dist/hooks/use-ui-editor-state.js +0 -107
- package/dist/hooks/use-ui-editor-state.mjs +0 -11
- package/dist/hooks/use-window-size.d.mts +0 -12
- package/dist/hooks/use-window-size.d.ts +0 -12
- package/dist/hooks/use-window-size.js +0 -75
- package/dist/hooks/use-window-size.mjs +0 -7
- package/dist/presets/basic/editor-header.d.mts +0 -23
- package/dist/presets/basic/editor-header.d.ts +0 -23
- package/dist/presets/basic/editor-header.js +0 -2750
- package/dist/presets/basic/editor-header.mjs +0 -43
- package/dist/presets/basic/index.d.mts +0 -38
- package/dist/presets/basic/index.d.ts +0 -38
- package/dist/presets/basic/index.js +0 -6891
- package/dist/presets/basic/index.mjs +0 -85
- package/dist/ui/blockquote-button/blockquote-button.d.mts +0 -20
- package/dist/ui/blockquote-button/blockquote-button.d.ts +0 -20
- package/dist/ui/blockquote-button/blockquote-button.js +0 -247
- package/dist/ui/blockquote-button/blockquote-button.mjs +0 -9
- package/dist/ui/blockquote-button/index.d.mts +0 -6
- package/dist/ui/blockquote-button/index.d.ts +0 -6
- package/dist/ui/blockquote-button/index.js +0 -259
- package/dist/ui/blockquote-button/index.mjs +0 -21
- package/dist/ui/blockquote-button/use-blockquote.d.mts +0 -85
- package/dist/ui/blockquote-button/use-blockquote.d.ts +0 -85
- package/dist/ui/blockquote-button/use-blockquote.js +0 -192
- package/dist/ui/blockquote-button/use-blockquote.mjs +0 -17
- package/dist/ui/bubble-menu/index.d.mts +0 -13
- package/dist/ui/bubble-menu/index.d.ts +0 -13
- package/dist/ui/bubble-menu/index.js +0 -673
- package/dist/ui/bubble-menu/index.mjs +0 -16
- package/dist/ui/codeblock-button/code-block-button.d.mts +0 -20
- package/dist/ui/codeblock-button/code-block-button.d.ts +0 -20
- package/dist/ui/codeblock-button/code-block-button.js +0 -237
- package/dist/ui/codeblock-button/code-block-button.mjs +0 -9
- package/dist/ui/codeblock-button/index.d.mts +0 -6
- package/dist/ui/codeblock-button/index.d.ts +0 -6
- package/dist/ui/codeblock-button/index.js +0 -249
- package/dist/ui/codeblock-button/index.mjs +0 -21
- package/dist/ui/codeblock-button/use-code-block.d.mts +0 -92
- package/dist/ui/codeblock-button/use-code-block.d.ts +0 -92
- package/dist/ui/codeblock-button/use-code-block.js +0 -192
- package/dist/ui/codeblock-button/use-code-block.mjs +0 -17
- package/dist/ui/color-highlight-button/color-highlight-button.d.mts +0 -25
- package/dist/ui/color-highlight-button/color-highlight-button.d.ts +0 -25
- package/dist/ui/color-highlight-button/color-highlight-button.js +0 -266
- package/dist/ui/color-highlight-button/color-highlight-button.mjs +0 -9
- package/dist/ui/color-highlight-button/index.d.mts +0 -6
- package/dist/ui/color-highlight-button/index.d.ts +0 -6
- package/dist/ui/color-highlight-button/index.js +0 -342
- package/dist/ui/color-highlight-button/index.mjs +0 -27
- package/dist/ui/color-highlight-button/use-color-highlight.d.mts +0 -64
- package/dist/ui/color-highlight-button/use-color-highlight.d.ts +0 -64
- package/dist/ui/color-highlight-button/use-color-highlight.js +0 -247
- package/dist/ui/color-highlight-button/use-color-highlight.mjs +0 -23
- package/dist/ui/color-highlight-popover/color-highlight-popover.d.mts +0 -29
- package/dist/ui/color-highlight-popover/color-highlight-popover.d.ts +0 -29
- package/dist/ui/color-highlight-popover/color-highlight-popover.js +0 -590
- package/dist/ui/color-highlight-popover/color-highlight-popover.mjs +0 -17
- package/dist/ui/color-highlight-popover/index.d.mts +0 -6
- package/dist/ui/color-highlight-popover/index.d.ts +0 -6
- package/dist/ui/color-highlight-popover/index.js +0 -591
- package/dist/ui/color-highlight-popover/index.mjs +0 -17
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.d.mts +0 -30
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.d.ts +0 -30
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.js +0 -171
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.mjs +0 -10
- package/dist/ui/heading-button/index.d.mts +0 -45
- package/dist/ui/heading-button/index.d.ts +0 -45
- package/dist/ui/heading-button/index.js +0 -222
- package/dist/ui/heading-button/index.mjs +0 -16
- package/dist/ui/heading-button/utils.d.mts +0 -17
- package/dist/ui/heading-button/utils.d.ts +0 -17
- package/dist/ui/heading-button/utils.js +0 -92
- package/dist/ui/heading-button/utils.mjs +0 -19
- package/dist/ui/heading-dropdown-menu/index.d.mts +0 -14
- package/dist/ui/heading-dropdown-menu/index.d.ts +0 -14
- package/dist/ui/heading-dropdown-menu/index.js +0 -308
- package/dist/ui/heading-dropdown-menu/index.mjs +0 -10
- package/dist/ui/link-bubble/index.d.mts +0 -13
- package/dist/ui/link-bubble/index.d.ts +0 -13
- package/dist/ui/link-bubble/index.js +0 -183
- package/dist/ui/link-bubble/index.mjs +0 -10
- package/dist/ui/link-popover/index.d.mts +0 -7
- package/dist/ui/link-popover/index.d.ts +0 -7
- package/dist/ui/link-popover/index.js +0 -512
- package/dist/ui/link-popover/index.mjs +0 -30
- package/dist/ui/link-popover/link-popover.d.mts +0 -85
- package/dist/ui/link-popover/link-popover.d.ts +0 -85
- package/dist/ui/link-popover/link-popover.js +0 -498
- package/dist/ui/link-popover/link-popover.mjs +0 -16
- package/dist/ui/link-popover/use-link-popover.d.mts +0 -123
- package/dist/ui/link-popover/use-link-popover.d.ts +0 -123
- package/dist/ui/link-popover/use-link-popover.js +0 -259
- package/dist/ui/link-popover/use-link-popover.mjs +0 -20
- package/dist/ui/list-button/index.d.mts +0 -50
- package/dist/ui/list-button/index.d.ts +0 -50
- package/dist/ui/list-button/index.js +0 -232
- package/dist/ui/list-button/index.mjs +0 -24
- package/dist/ui/list-dropdown-menu/index.d.mts +0 -45
- package/dist/ui/list-dropdown-menu/index.d.ts +0 -45
- package/dist/ui/list-dropdown-menu/index.js +0 -361
- package/dist/ui/list-dropdown-menu/index.mjs +0 -21
- package/dist/ui/mark-button/index.d.mts +0 -59
- package/dist/ui/mark-button/index.d.ts +0 -59
- package/dist/ui/mark-button/index.js +0 -217
- package/dist/ui/mark-button/index.mjs +0 -26
- package/dist/ui/reset-all-formatting-button/index.d.mts +0 -7
- package/dist/ui/reset-all-formatting-button/index.d.ts +0 -7
- package/dist/ui/reset-all-formatting-button/index.js +0 -286
- package/dist/ui/reset-all-formatting-button/index.mjs +0 -26
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.d.mts +0 -30
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.d.ts +0 -30
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.js +0 -271
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.mjs +0 -12
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.d.mts +0 -103
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.d.ts +0 -103
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.js +0 -211
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.mjs +0 -21
- package/dist/ui/slash-dropdown-menu/index.d.mts +0 -10
- package/dist/ui/slash-dropdown-menu/index.d.ts +0 -10
- package/dist/ui/slash-dropdown-menu/index.js +0 -1056
- package/dist/ui/slash-dropdown-menu/index.mjs +0 -19
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.d.mts +0 -16
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.d.ts +0 -16
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.js +0 -1053
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.mjs +0 -16
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.d.mts +0 -162
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.d.ts +0 -162
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.js +0 -457
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.mjs +0 -10
- package/dist/ui/suggestion-menu/index.d.mts +0 -10
- package/dist/ui/suggestion-menu/index.d.ts +0 -10
- package/dist/ui/suggestion-menu/index.js +0 -489
- package/dist/ui/suggestion-menu/index.mjs +0 -17
- package/dist/ui/suggestion-menu/suggestion-menu-types.d.mts +0 -89
- package/dist/ui/suggestion-menu/suggestion-menu-types.d.ts +0 -89
- package/dist/ui/suggestion-menu/suggestion-menu-types.js +0 -19
- package/dist/ui/suggestion-menu/suggestion-menu-types.mjs +0 -1
- package/dist/ui/suggestion-menu/suggestion-menu-utils.d.mts +0 -27
- package/dist/ui/suggestion-menu/suggestion-menu-utils.d.ts +0 -27
- package/dist/ui/suggestion-menu/suggestion-menu-utils.js +0 -75
- package/dist/ui/suggestion-menu/suggestion-menu-utils.mjs +0 -9
- package/dist/ui/suggestion-menu/suggestion-menu.d.mts +0 -15
- package/dist/ui/suggestion-menu/suggestion-menu.d.ts +0 -15
- package/dist/ui/suggestion-menu/suggestion-menu.js +0 -453
- package/dist/ui/suggestion-menu/suggestion-menu.mjs +0 -12
- package/dist/ui/table-button/index.d.mts +0 -15
- package/dist/ui/table-button/index.d.ts +0 -15
- package/dist/ui/table-button/index.js +0 -202
- package/dist/ui/table-button/index.mjs +0 -9
- package/dist/ui/table-button/use-table.d.mts +0 -51
- package/dist/ui/table-button/use-table.d.ts +0 -51
- package/dist/ui/table-button/use-table.js +0 -146
- package/dist/ui/table-button/use-table.mjs +0 -14
- package/dist/ui/text-align-button/index.d.mts +0 -6
- package/dist/ui/text-align-button/index.d.ts +0 -6
- package/dist/ui/text-align-button/index.js +0 -235
- package/dist/ui/text-align-button/index.mjs +0 -29
- package/dist/ui/text-align-button/text-align-button.d.mts +0 -20
- package/dist/ui/text-align-button/text-align-button.d.ts +0 -20
- package/dist/ui/text-align-button/text-align-button.js +0 -215
- package/dist/ui/text-align-button/text-align-button.mjs +0 -9
- package/dist/ui/text-align-button/use-text-align.d.mts +0 -106
- package/dist/ui/text-align-button/use-text-align.d.ts +0 -106
- package/dist/ui/text-align-button/use-text-align.js +0 -169
- package/dist/ui/text-align-button/use-text-align.mjs +0 -24
- package/dist/ui/undo-redo-button/index.d.mts +0 -6
- package/dist/ui/undo-redo-button/index.d.ts +0 -6
- package/dist/ui/undo-redo-button/index.js +0 -202
- package/dist/ui/undo-redo-button/index.mjs +0 -25
- package/dist/ui/undo-redo-button/undo-redo-button.d.mts +0 -23
- package/dist/ui/undo-redo-button/undo-redo-button.d.ts +0 -23
- package/dist/ui/undo-redo-button/undo-redo-button.js +0 -187
- package/dist/ui/undo-redo-button/undo-redo-button.mjs +0 -10
- package/dist/ui/undo-redo-button/use-undo-redo.d.mts +0 -95
- package/dist/ui/undo-redo-button/use-undo-redo.d.ts +0 -95
- package/dist/ui/undo-redo-button/use-undo-redo.js +0 -146
- package/dist/ui/undo-redo-button/use-undo-redo.mjs +0 -21
- package/dist/utils/index.d.mts +0 -38
- package/dist/utils/index.d.ts +0 -38
- package/dist/utils/index.js +0 -128
- package/dist/utils/index.mjs +0 -15
- package/dist/utils/safe-parse.d.mts +0 -14
- package/dist/utils/safe-parse.d.ts +0 -14
- package/dist/utils/safe-parse.js +0 -203
- package/dist/utils/safe-parse.mjs +0 -8
package/dist/chunk-BEV5U2DK.mjs
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useTiptapEditor
|
|
4
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
5
|
-
|
|
6
|
-
// src/ui/codeblock-button/use-code-block.ts
|
|
7
|
-
import {
|
|
8
|
-
findNodePosition,
|
|
9
|
-
isNodeInSchema,
|
|
10
|
-
isNodeTypeSelected,
|
|
11
|
-
isValidPosition
|
|
12
|
-
} from "@kopexa/editor-utils";
|
|
13
|
-
import { CodeblockIcon } from "@kopexa/icons";
|
|
14
|
-
import { NodeSelection, TextSelection } from "@tiptap/pm/state";
|
|
15
|
-
import * as React from "react";
|
|
16
|
-
var CODE_BLOCK_SHORTCUT_KEY = "mod+alt+c";
|
|
17
|
-
function canToggle(editor, turnInto = true) {
|
|
18
|
-
var _a;
|
|
19
|
-
if (!editor || !editor.isEditable) return false;
|
|
20
|
-
if (!isNodeInSchema("codeBlock", editor) || isNodeTypeSelected(editor, ["image"]))
|
|
21
|
-
return false;
|
|
22
|
-
if (!turnInto) {
|
|
23
|
-
return editor.can().toggleNode("codeBlock", "paragraph");
|
|
24
|
-
}
|
|
25
|
-
try {
|
|
26
|
-
const view = editor.view;
|
|
27
|
-
const state = view.state;
|
|
28
|
-
const selection = state.selection;
|
|
29
|
-
if (selection.empty || selection instanceof TextSelection) {
|
|
30
|
-
const pos = (_a = findNodePosition({
|
|
31
|
-
editor,
|
|
32
|
-
node: state.selection.$anchor.node(1)
|
|
33
|
-
})) == null ? void 0 : _a.pos;
|
|
34
|
-
if (!isValidPosition(pos)) return false;
|
|
35
|
-
}
|
|
36
|
-
return true;
|
|
37
|
-
} catch {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function toggleCodeBlock(editor) {
|
|
42
|
-
var _a, _b, _c;
|
|
43
|
-
if (!editor || !editor.isEditable) return false;
|
|
44
|
-
if (!canToggle(editor)) return false;
|
|
45
|
-
try {
|
|
46
|
-
const view = editor.view;
|
|
47
|
-
let state = view.state;
|
|
48
|
-
let tr = state.tr;
|
|
49
|
-
if (state.selection.empty || state.selection instanceof TextSelection) {
|
|
50
|
-
const pos = (_a = findNodePosition({
|
|
51
|
-
editor,
|
|
52
|
-
node: state.selection.$anchor.node(1)
|
|
53
|
-
})) == null ? void 0 : _a.pos;
|
|
54
|
-
if (!isValidPosition(pos)) return false;
|
|
55
|
-
tr = tr.setSelection(NodeSelection.create(state.doc, pos));
|
|
56
|
-
view.dispatch(tr);
|
|
57
|
-
state = view.state;
|
|
58
|
-
}
|
|
59
|
-
const selection = state.selection;
|
|
60
|
-
let chain = editor.chain().focus();
|
|
61
|
-
if (selection instanceof NodeSelection) {
|
|
62
|
-
const firstChild = (_b = selection.node.firstChild) == null ? void 0 : _b.firstChild;
|
|
63
|
-
const lastChild = (_c = selection.node.lastChild) == null ? void 0 : _c.lastChild;
|
|
64
|
-
const from = firstChild ? selection.from + firstChild.nodeSize : selection.from + 1;
|
|
65
|
-
const to = lastChild ? selection.to - lastChild.nodeSize : selection.to - 1;
|
|
66
|
-
chain = chain.setTextSelection({ from, to }).clearNodes();
|
|
67
|
-
}
|
|
68
|
-
const toggle = editor.isActive("codeBlock") ? chain.setNode("paragraph") : chain.toggleNode("codeBlock", "paragraph");
|
|
69
|
-
toggle.run();
|
|
70
|
-
editor.chain().focus().selectTextblockEnd().run();
|
|
71
|
-
return true;
|
|
72
|
-
} catch {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function shouldShowButton(props) {
|
|
77
|
-
const { editor, hideWhenUnavailable } = props;
|
|
78
|
-
if (!editor || !editor.isEditable) return false;
|
|
79
|
-
if (!isNodeInSchema("codeBlock", editor)) return false;
|
|
80
|
-
if (hideWhenUnavailable && !editor.isActive("code")) {
|
|
81
|
-
return canToggle(editor);
|
|
82
|
-
}
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
function useCodeBlock(config) {
|
|
86
|
-
const {
|
|
87
|
-
editor: providedEditor,
|
|
88
|
-
hideWhenUnavailable = false,
|
|
89
|
-
onToggled
|
|
90
|
-
} = config || {};
|
|
91
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
92
|
-
const [isVisible, setIsVisible] = React.useState(true);
|
|
93
|
-
const canToggleState = canToggle(editor);
|
|
94
|
-
const isActive = (editor == null ? void 0 : editor.isActive("codeBlock")) || false;
|
|
95
|
-
React.useEffect(() => {
|
|
96
|
-
if (!editor) return;
|
|
97
|
-
const handleSelectionUpdate = () => {
|
|
98
|
-
setIsVisible(shouldShowButton({ editor, hideWhenUnavailable }));
|
|
99
|
-
};
|
|
100
|
-
handleSelectionUpdate();
|
|
101
|
-
editor.on("selectionUpdate", handleSelectionUpdate);
|
|
102
|
-
return () => {
|
|
103
|
-
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
104
|
-
};
|
|
105
|
-
}, [editor, hideWhenUnavailable]);
|
|
106
|
-
const handleToggle = React.useCallback(() => {
|
|
107
|
-
if (!editor) return false;
|
|
108
|
-
const success = toggleCodeBlock(editor);
|
|
109
|
-
if (success) {
|
|
110
|
-
onToggled == null ? void 0 : onToggled();
|
|
111
|
-
}
|
|
112
|
-
return success;
|
|
113
|
-
}, [editor, onToggled]);
|
|
114
|
-
return {
|
|
115
|
-
isVisible,
|
|
116
|
-
isActive,
|
|
117
|
-
handleToggle,
|
|
118
|
-
canToggle: canToggleState,
|
|
119
|
-
label: "Code Block",
|
|
120
|
-
shortcutKeys: CODE_BLOCK_SHORTCUT_KEY,
|
|
121
|
-
Icon: CodeblockIcon
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export {
|
|
126
|
-
CODE_BLOCK_SHORTCUT_KEY,
|
|
127
|
-
canToggle,
|
|
128
|
-
toggleCodeBlock,
|
|
129
|
-
shouldShowButton,
|
|
130
|
-
useCodeBlock
|
|
131
|
-
};
|
package/dist/chunk-BXHPO3T7.mjs
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
messages
|
|
4
|
-
} from "./chunk-FRJX2F4T.mjs";
|
|
5
|
-
|
|
6
|
-
// src/extensions/math/inline-math-view.tsx
|
|
7
|
-
import { Button } from "@kopexa/button";
|
|
8
|
-
import { Dialog } from "@kopexa/dialog";
|
|
9
|
-
import { Label } from "@kopexa/label";
|
|
10
|
-
import {
|
|
11
|
-
NodeViewWrapper,
|
|
12
|
-
useEditorState
|
|
13
|
-
} from "@tiptap/react";
|
|
14
|
-
import katex from "katex";
|
|
15
|
-
import "katex/dist/katex.min.css";
|
|
16
|
-
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
17
|
-
import { useIntl } from "react-intl";
|
|
18
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
-
function InlineMathView({ editor, node, getPos }) {
|
|
20
|
-
const intl = useIntl();
|
|
21
|
-
const attrs = node.attrs;
|
|
22
|
-
const { latex = "" } = attrs;
|
|
23
|
-
const isEditable = useEditorState({
|
|
24
|
-
editor,
|
|
25
|
-
selector: ({ editor: e }) => {
|
|
26
|
-
var _a;
|
|
27
|
-
return (_a = e == null ? void 0 : e.isEditable) != null ? _a : false;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
31
|
-
const [localLatex, setLocalLatex] = useState(latex);
|
|
32
|
-
const [error, setError] = useState(null);
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
if (isOpen) {
|
|
35
|
-
setLocalLatex(latex);
|
|
36
|
-
setError(null);
|
|
37
|
-
}
|
|
38
|
-
}, [isOpen, latex]);
|
|
39
|
-
const renderedHtml = useMemo(() => {
|
|
40
|
-
if (!latex) return null;
|
|
41
|
-
try {
|
|
42
|
-
return katex.renderToString(latex, {
|
|
43
|
-
throwOnError: false,
|
|
44
|
-
displayMode: false,
|
|
45
|
-
output: "html"
|
|
46
|
-
});
|
|
47
|
-
} catch {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
}, [latex]);
|
|
51
|
-
const previewHtml = useMemo(() => {
|
|
52
|
-
if (!localLatex) return null;
|
|
53
|
-
try {
|
|
54
|
-
setError(null);
|
|
55
|
-
return katex.renderToString(localLatex, {
|
|
56
|
-
throwOnError: true,
|
|
57
|
-
displayMode: false,
|
|
58
|
-
output: "html"
|
|
59
|
-
});
|
|
60
|
-
} catch (_e) {
|
|
61
|
-
setError(intl.formatMessage(messages.invalid_latex));
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
}, [localLatex, intl]);
|
|
65
|
-
const handleSave = useCallback(() => {
|
|
66
|
-
const pos = getPos();
|
|
67
|
-
if (pos === void 0) return;
|
|
68
|
-
editor.view.dispatch(
|
|
69
|
-
editor.state.tr.setNodeMarkup(pos, void 0, { latex: localLatex })
|
|
70
|
-
);
|
|
71
|
-
setIsOpen(false);
|
|
72
|
-
}, [editor, localLatex, getPos]);
|
|
73
|
-
const handleCancel = useCallback(() => {
|
|
74
|
-
setLocalLatex(latex);
|
|
75
|
-
setError(null);
|
|
76
|
-
setIsOpen(false);
|
|
77
|
-
}, [latex]);
|
|
78
|
-
const handleClick = useCallback(
|
|
79
|
-
(e) => {
|
|
80
|
-
e.stopPropagation();
|
|
81
|
-
e.preventDefault();
|
|
82
|
-
if (isEditable) {
|
|
83
|
-
setIsOpen(true);
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
[isEditable]
|
|
87
|
-
);
|
|
88
|
-
const isEmpty = !latex;
|
|
89
|
-
return /* @__PURE__ */ jsxs(
|
|
90
|
-
NodeViewWrapper,
|
|
91
|
-
{
|
|
92
|
-
as: "span",
|
|
93
|
-
className: "inline-math-wrapper",
|
|
94
|
-
"data-type": "inline-math",
|
|
95
|
-
"data-latex": latex,
|
|
96
|
-
children: [
|
|
97
|
-
/* @__PURE__ */ jsx(
|
|
98
|
-
"span",
|
|
99
|
-
{
|
|
100
|
-
className: `inline-math cursor-pointer rounded px-0.5 transition-colors ${isEditable ? "hover:bg-primary/10 hover:ring-1 hover:ring-primary/20" : ""} ${isEmpty ? "text-muted-foreground italic" : ""}`,
|
|
101
|
-
onClick: handleClick,
|
|
102
|
-
children: isEmpty ? /* @__PURE__ */ jsx("span", { className: "text-xs", children: "$?$" }) : renderedHtml ? /* @__PURE__ */ jsx(
|
|
103
|
-
"span",
|
|
104
|
-
{
|
|
105
|
-
dangerouslySetInnerHTML: { __html: renderedHtml }
|
|
106
|
-
}
|
|
107
|
-
) : /* @__PURE__ */ jsx("span", { className: "text-destructive text-xs", children: latex })
|
|
108
|
-
}
|
|
109
|
-
),
|
|
110
|
-
/* @__PURE__ */ jsx(Dialog.Root, { open: isOpen, onOpenChange: setIsOpen, size: "sm", children: /* @__PURE__ */ jsxs(Dialog.Content, { children: [
|
|
111
|
-
/* @__PURE__ */ jsx(Dialog.Header, { children: /* @__PURE__ */ jsx(Dialog.Title, { children: intl.formatMessage(messages.title) }) }),
|
|
112
|
-
/* @__PURE__ */ jsx(Dialog.Body, { children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
113
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
114
|
-
/* @__PURE__ */ jsx(Label, { className: "text-sm", children: intl.formatMessage(messages.latex_input) }),
|
|
115
|
-
/* @__PURE__ */ jsx(
|
|
116
|
-
"input",
|
|
117
|
-
{
|
|
118
|
-
type: "text",
|
|
119
|
-
className: "w-full p-2 rounded-md border border-input bg-background font-mono text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
120
|
-
value: localLatex,
|
|
121
|
-
onChange: (e) => setLocalLatex(e.target.value),
|
|
122
|
-
placeholder: intl.formatMessage(messages.latex_placeholder),
|
|
123
|
-
spellCheck: false
|
|
124
|
-
}
|
|
125
|
-
),
|
|
126
|
-
error && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: error })
|
|
127
|
-
] }),
|
|
128
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
129
|
-
/* @__PURE__ */ jsx(Label, { className: "text-sm", children: intl.formatMessage(messages.preview) }),
|
|
130
|
-
/* @__PURE__ */ jsx("div", { className: "min-h-10 p-3 rounded-md border border-border bg-muted/30 flex items-center justify-center", children: previewHtml ? /* @__PURE__ */ jsx(
|
|
131
|
-
"span",
|
|
132
|
-
{
|
|
133
|
-
dangerouslySetInnerHTML: { __html: previewHtml }
|
|
134
|
-
}
|
|
135
|
-
) : localLatex ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-sm", children: intl.formatMessage(messages.invalid_latex) }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-sm", children: "$...$" }) })
|
|
136
|
-
] })
|
|
137
|
-
] }) }),
|
|
138
|
-
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [
|
|
139
|
-
/* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: handleCancel, children: intl.formatMessage(messages.cancel) }),
|
|
140
|
-
/* @__PURE__ */ jsx(Button, { onClick: handleSave, disabled: !!error && !!localLatex, children: intl.formatMessage(messages.save) })
|
|
141
|
-
] })
|
|
142
|
-
] }) })
|
|
143
|
-
]
|
|
144
|
-
}
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
var inline_math_view_default = InlineMathView;
|
|
148
|
-
|
|
149
|
-
export {
|
|
150
|
-
InlineMathView,
|
|
151
|
-
inline_math_view_default
|
|
152
|
-
};
|
package/dist/chunk-BXJYNSWQ.mjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
defaultUiState
|
|
4
|
-
} from "./chunk-KR42JAVB.mjs";
|
|
5
|
-
|
|
6
|
-
// src/hooks/use-ui-editor-state.ts
|
|
7
|
-
import { useEditorState } from "@tiptap/react";
|
|
8
|
-
function useUiEditorState(editor) {
|
|
9
|
-
var _a;
|
|
10
|
-
return (_a = useEditorState({
|
|
11
|
-
editor,
|
|
12
|
-
selector: ({ editor: editor2 }) => {
|
|
13
|
-
if (!editor2) return defaultUiState;
|
|
14
|
-
const state = editor2.storage.uiState;
|
|
15
|
-
if (!state) {
|
|
16
|
-
console.warn(
|
|
17
|
-
"Editor storage uiState is not initialized. Ensure you have the uiState extension added to your editor."
|
|
18
|
-
);
|
|
19
|
-
return defaultUiState;
|
|
20
|
-
}
|
|
21
|
-
return { ...defaultUiState, ...state };
|
|
22
|
-
}
|
|
23
|
-
})) != null ? _a : defaultUiState;
|
|
24
|
-
}
|
|
25
|
-
var use_ui_editor_state_default = useUiEditorState;
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
useUiEditorState,
|
|
29
|
-
use_ui_editor_state_default
|
|
30
|
-
};
|
package/dist/chunk-C5RQWJKE.mjs
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
ColorHighlightButton
|
|
4
|
-
} from "./chunk-B7WJOQ3X.mjs";
|
|
5
|
-
import {
|
|
6
|
-
pickHighlightColorsByValue,
|
|
7
|
-
useColorHighlight
|
|
8
|
-
} from "./chunk-UJ4BNZ63.mjs";
|
|
9
|
-
import {
|
|
10
|
-
useTiptapEditor
|
|
11
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
12
|
-
import {
|
|
13
|
-
useMenuNavigation
|
|
14
|
-
} from "./chunk-42HKGCOO.mjs";
|
|
15
|
-
|
|
16
|
-
// src/ui/color-highlight-popover/color-highlight-popover.tsx
|
|
17
|
-
import { IconButton } from "@kopexa/button";
|
|
18
|
-
import { BanIcon, HighlighterIcon } from "@kopexa/icons";
|
|
19
|
-
import { Popover } from "@kopexa/popover";
|
|
20
|
-
import { ToolbarSeparator } from "@kopexa/toolbar";
|
|
21
|
-
import { useMemo, useRef, useState } from "react";
|
|
22
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
|
-
var ColorHighlightPopoverButton = ({
|
|
24
|
-
className,
|
|
25
|
-
children,
|
|
26
|
-
...props
|
|
27
|
-
}) => /* @__PURE__ */ jsx(
|
|
28
|
-
IconButton,
|
|
29
|
-
{
|
|
30
|
-
type: "button",
|
|
31
|
-
className,
|
|
32
|
-
variant: "ghost",
|
|
33
|
-
color: "default",
|
|
34
|
-
tabIndex: -1,
|
|
35
|
-
"aria-label": "Highlight text",
|
|
36
|
-
tooltip: "Highlight",
|
|
37
|
-
isIconOnly: !children,
|
|
38
|
-
...props,
|
|
39
|
-
children: children != null ? children : /* @__PURE__ */ jsx(HighlighterIcon, {})
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
function ColorHighlightPopoverContent({
|
|
43
|
-
editor,
|
|
44
|
-
colors = pickHighlightColorsByValue([
|
|
45
|
-
"var(--tt-color-highlight-green)",
|
|
46
|
-
"var(--tt-color-highlight-blue)",
|
|
47
|
-
"var(--tt-color-highlight-red)",
|
|
48
|
-
"var(--tt-color-highlight-purple)",
|
|
49
|
-
"var(--tt-color-highlight-yellow)"
|
|
50
|
-
])
|
|
51
|
-
}) {
|
|
52
|
-
const { handleRemoveHighlight } = useColorHighlight({ editor });
|
|
53
|
-
const containerRef = useRef(null);
|
|
54
|
-
const menuItems = useMemo(
|
|
55
|
-
() => [...colors, { label: "Remove highlight", value: "none" }],
|
|
56
|
-
[colors]
|
|
57
|
-
);
|
|
58
|
-
const { selectedIndex } = useMenuNavigation({
|
|
59
|
-
containerRef,
|
|
60
|
-
items: menuItems,
|
|
61
|
-
orientation: "both",
|
|
62
|
-
onSelect: (item) => {
|
|
63
|
-
if (!containerRef.current) return false;
|
|
64
|
-
const highlightedElement = containerRef.current.querySelector(
|
|
65
|
-
'[data-highlighted="true"]'
|
|
66
|
-
);
|
|
67
|
-
if (highlightedElement) highlightedElement.click();
|
|
68
|
-
if (item.value === "none") handleRemoveHighlight();
|
|
69
|
-
},
|
|
70
|
-
autoSelectFirstItem: false
|
|
71
|
-
});
|
|
72
|
-
return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: "flex gap-1 items-center", children: [
|
|
73
|
-
/* @__PURE__ */ jsx(
|
|
74
|
-
"div",
|
|
75
|
-
{
|
|
76
|
-
className: "flex items-center gap-1 outline-none",
|
|
77
|
-
"data-orientation": "horizontal",
|
|
78
|
-
children: colors.map((color, index) => /* @__PURE__ */ jsx(
|
|
79
|
-
ColorHighlightButton,
|
|
80
|
-
{
|
|
81
|
-
editor,
|
|
82
|
-
highlightColor: color.value,
|
|
83
|
-
"aria-label": `${color.label} highlight color`,
|
|
84
|
-
tabIndex: index === selectedIndex ? 0 : -1,
|
|
85
|
-
"data-highlighted": selectedIndex === index
|
|
86
|
-
},
|
|
87
|
-
color.value
|
|
88
|
-
))
|
|
89
|
-
}
|
|
90
|
-
),
|
|
91
|
-
/* @__PURE__ */ jsx(ToolbarSeparator, { orientation: "vertical" }),
|
|
92
|
-
/* @__PURE__ */ jsx("div", { className: "tiptap-button-group", children: /* @__PURE__ */ jsx(
|
|
93
|
-
IconButton,
|
|
94
|
-
{
|
|
95
|
-
onClick: handleRemoveHighlight,
|
|
96
|
-
"aria-label": "Remove highlight",
|
|
97
|
-
tabIndex: selectedIndex === colors.length ? 0 : -1,
|
|
98
|
-
type: "button",
|
|
99
|
-
role: "menuitem",
|
|
100
|
-
variant: "ghost",
|
|
101
|
-
color: "default",
|
|
102
|
-
"data-highlighted": selectedIndex === colors.length,
|
|
103
|
-
children: /* @__PURE__ */ jsx(BanIcon, {})
|
|
104
|
-
}
|
|
105
|
-
) })
|
|
106
|
-
] });
|
|
107
|
-
}
|
|
108
|
-
function ColorHighlightPopover({
|
|
109
|
-
editor: providedEditor,
|
|
110
|
-
colors = pickHighlightColorsByValue([
|
|
111
|
-
"var(--tt-color-highlight-green)",
|
|
112
|
-
"var(--tt-color-highlight-blue)",
|
|
113
|
-
"var(--tt-color-highlight-red)",
|
|
114
|
-
"var(--tt-color-highlight-purple)",
|
|
115
|
-
"var(--tt-color-highlight-yellow)"
|
|
116
|
-
]),
|
|
117
|
-
hideWhenUnavailable = false,
|
|
118
|
-
onApplied,
|
|
119
|
-
...props
|
|
120
|
-
}) {
|
|
121
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
122
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
123
|
-
const { isVisible, canColorHighlight, isActive, label } = useColorHighlight({
|
|
124
|
-
editor,
|
|
125
|
-
hideWhenUnavailable,
|
|
126
|
-
onApplied
|
|
127
|
-
});
|
|
128
|
-
if (!isVisible) return null;
|
|
129
|
-
return /* @__PURE__ */ jsxs(Popover.Root, { open: isOpen, onOpenChange: setIsOpen, spacing: "dense", children: [
|
|
130
|
-
/* @__PURE__ */ jsx(
|
|
131
|
-
Popover.Trigger,
|
|
132
|
-
{
|
|
133
|
-
render: /* @__PURE__ */ jsx(
|
|
134
|
-
ColorHighlightPopoverButton,
|
|
135
|
-
{
|
|
136
|
-
disabled: !canColorHighlight,
|
|
137
|
-
"data-disabled": !canColorHighlight,
|
|
138
|
-
"data-active-state": isActive ? "on" : "off",
|
|
139
|
-
"aria-pressed": isActive,
|
|
140
|
-
"aria-label": label,
|
|
141
|
-
title: label,
|
|
142
|
-
...props
|
|
143
|
-
}
|
|
144
|
-
)
|
|
145
|
-
}
|
|
146
|
-
),
|
|
147
|
-
/* @__PURE__ */ jsx(Popover.Content, { "aria-label": "Highlight colors", children: /* @__PURE__ */ jsx(ColorHighlightPopoverContent, { editor, colors }) })
|
|
148
|
-
] });
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export {
|
|
152
|
-
ColorHighlightPopoverButton,
|
|
153
|
-
ColorHighlightPopoverContent,
|
|
154
|
-
ColorHighlightPopover
|
|
155
|
-
};
|
package/dist/chunk-CNVACBGT.mjs
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/ui/suggestion-menu/suggestion-menu-utils.ts
|
|
4
|
-
function calculateStartPosition(cursorPosition, previousNode, triggerChar) {
|
|
5
|
-
if (!(previousNode == null ? void 0 : previousNode.text) || !triggerChar) {
|
|
6
|
-
return cursorPosition;
|
|
7
|
-
}
|
|
8
|
-
const commandText = previousNode.text;
|
|
9
|
-
const triggerCharIndex = commandText.lastIndexOf(triggerChar);
|
|
10
|
-
if (triggerCharIndex === -1) {
|
|
11
|
-
return cursorPosition;
|
|
12
|
-
}
|
|
13
|
-
const textLength = commandText.substring(triggerCharIndex).length;
|
|
14
|
-
return cursorPosition - textLength;
|
|
15
|
-
}
|
|
16
|
-
function filterSuggestionItems(items, query) {
|
|
17
|
-
const normalizedQuery = query.trim().toLowerCase();
|
|
18
|
-
if (!normalizedQuery) {
|
|
19
|
-
return items;
|
|
20
|
-
}
|
|
21
|
-
return items.filter((item) => {
|
|
22
|
-
var _a, _b;
|
|
23
|
-
if (item.title.toLowerCase().includes(normalizedQuery)) {
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
if ((_a = item.subtext) == null ? void 0 : _a.toLowerCase().includes(normalizedQuery)) {
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
if ((_b = item.keywords) == null ? void 0 : _b.some(
|
|
30
|
-
(keyword) => keyword.toLowerCase().includes(normalizedQuery)
|
|
31
|
-
)) {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
return false;
|
|
35
|
-
}).sort((a, b) => {
|
|
36
|
-
const aTitle = a.title.toLowerCase();
|
|
37
|
-
const bTitle = b.title.toLowerCase();
|
|
38
|
-
if (aTitle === normalizedQuery && bTitle !== normalizedQuery) return -1;
|
|
39
|
-
if (bTitle === normalizedQuery && aTitle !== normalizedQuery) return 1;
|
|
40
|
-
if (aTitle.startsWith(normalizedQuery) && !bTitle.startsWith(normalizedQuery))
|
|
41
|
-
return -1;
|
|
42
|
-
if (bTitle.startsWith(normalizedQuery) && !aTitle.startsWith(normalizedQuery))
|
|
43
|
-
return 1;
|
|
44
|
-
return 0;
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export {
|
|
49
|
-
calculateStartPosition,
|
|
50
|
-
filterSuggestionItems
|
|
51
|
-
};
|