@kopexa/tiptap 17.6.18 → 17.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +691 -24
- package/dist/index.d.ts +691 -24
- package/dist/index.js +1081 -668
- package/dist/index.mjs +7686 -112
- package/package.json +57 -52
- package/dist/chunk-2SI7MRAE.mjs +0 -64
- package/dist/chunk-2U5CQUZH.mjs +0 -91
- package/dist/chunk-2UDCL55K.mjs +0 -55
- package/dist/chunk-2V6VOAPI.mjs +0 -139
- package/dist/chunk-2Z2QVW67.mjs +0 -1
- package/dist/chunk-32SUXCAQ.mjs +0 -115
- package/dist/chunk-33QD5PYJ.mjs +0 -63
- package/dist/chunk-3VRQUYYW.mjs +0 -169
- package/dist/chunk-42HKGCOO.mjs +0 -129
- package/dist/chunk-4ALV4UA5.mjs +0 -1
- package/dist/chunk-4CDZ547I.mjs +0 -185
- package/dist/chunk-4HO7BWDC.mjs +0 -89
- package/dist/chunk-4JRYQZ4A.mjs +0 -174
- package/dist/chunk-552JLRNB.mjs +0 -35
- package/dist/chunk-5SMDMQDF.mjs +0 -34
- package/dist/chunk-6552DQWB.mjs +0 -416
- package/dist/chunk-7FDDRVUE.mjs +0 -143
- package/dist/chunk-7VGROP26.mjs +0 -262
- package/dist/chunk-7VW67NVL.mjs +0 -80
- package/dist/chunk-AAV7ZNBP.mjs +0 -83
- package/dist/chunk-ATRHILCH.mjs +0 -1
- package/dist/chunk-B7WJOQ3X.mjs +0 -103
- package/dist/chunk-BEV5U2DK.mjs +0 -131
- package/dist/chunk-BXHPO3T7.mjs +0 -152
- package/dist/chunk-BXJYNSWQ.mjs +0 -30
- package/dist/chunk-C5RQWJKE.mjs +0 -155
- package/dist/chunk-CNVACBGT.mjs +0 -51
- package/dist/chunk-DQK6PA4U.mjs +0 -276
- package/dist/chunk-DSBJFMHK.mjs +0 -38
- package/dist/chunk-DT7ML2P4.mjs +0 -42
- package/dist/chunk-DZLGLP7R.mjs +0 -99
- package/dist/chunk-EAAQE5ZV.mjs +0 -283
- package/dist/chunk-EHY2NAW7.mjs +0 -120
- package/dist/chunk-EIIWU5FR.mjs +0 -61
- package/dist/chunk-ERPGWXFK.mjs +0 -163
- package/dist/chunk-F73FCUD5.mjs +0 -1
- package/dist/chunk-FRJX2F4T.mjs +0 -55
- package/dist/chunk-GYIYX2JH.mjs +0 -73
- package/dist/chunk-H6LC4LDQ.mjs +0 -63
- package/dist/chunk-H7MS2UMO.mjs +0 -168
- package/dist/chunk-HLLA2HRV.mjs +0 -1
- package/dist/chunk-HTJ2RXOG.mjs +0 -32
- package/dist/chunk-IFXRPGIJ.mjs +0 -98
- package/dist/chunk-IOB3REX6.mjs +0 -173
- package/dist/chunk-IQERE7KP.mjs +0 -115
- package/dist/chunk-JCV5SEKN.mjs +0 -65
- package/dist/chunk-JVSH5T4B.mjs +0 -72
- package/dist/chunk-KK4K43WM.mjs +0 -59
- package/dist/chunk-KR42JAVB.mjs +0 -60
- package/dist/chunk-KYLBKQ2E.mjs +0 -203
- package/dist/chunk-L5RDMV3H.mjs +0 -216
- package/dist/chunk-LNVWG34E.mjs +0 -165
- package/dist/chunk-LVNUU67N.mjs +0 -1
- package/dist/chunk-MNTOOEHA.mjs +0 -1
- package/dist/chunk-N3JE67CS.mjs +0 -81
- package/dist/chunk-N4CT5RNC.mjs +0 -123
- package/dist/chunk-OEVR5N7X.mjs +0 -65
- package/dist/chunk-P55PLOHR.mjs +0 -34
- package/dist/chunk-Q5FK7SFY.mjs +0 -75
- package/dist/chunk-Q7DFJ5NI.mjs +0 -153
- package/dist/chunk-QIELBKP3.mjs +0 -104
- package/dist/chunk-R2GM4A3T.mjs +0 -71
- package/dist/chunk-REJEJXOZ.mjs +0 -10
- package/dist/chunk-RFWNKE7D.mjs +0 -238
- package/dist/chunk-TAM3VMJT.mjs +0 -80
- package/dist/chunk-TDFS3DCZ.mjs +0 -79
- package/dist/chunk-TLM5ALHZ.mjs +0 -1
- package/dist/chunk-TZQQ6C2Q.mjs +0 -101
- package/dist/chunk-U5XAL46P.mjs +0 -39
- package/dist/chunk-UJ4BNZ63.mjs +0 -178
- package/dist/chunk-UVHVCION.mjs +0 -168
- package/dist/chunk-V6TAZMQN.mjs +0 -105
- package/dist/chunk-VF3G2URZ.mjs +0 -83
- package/dist/chunk-VRQ6OSAZ.mjs +0 -76
- package/dist/chunk-VTKJPVNM.mjs +0 -148
- package/dist/chunk-VX3HSJ76.mjs +0 -73
- package/dist/chunk-W2FLOOJ6.mjs +0 -75
- package/dist/chunk-XGAABDMW.mjs +0 -159
- package/dist/chunk-Y2KSWMG5.mjs +0 -1
- package/dist/chunk-YJAHZXLG.mjs +0 -92
- package/dist/chunk-Z365KVQY.mjs +0 -34
- package/dist/chunk-ZVTJ6XD7.mjs +0 -88
- package/dist/chunk-ZZ4OU46C.mjs +0 -131
- package/dist/context/editor-context.d.mts +0 -10
- package/dist/context/editor-context.d.ts +0 -10
- package/dist/context/editor-context.js +0 -34
- package/dist/context/editor-context.mjs +0 -9
- package/dist/context/editor-file-context.d.mts +0 -70
- package/dist/context/editor-file-context.d.ts +0 -70
- package/dist/context/editor-file-context.js +0 -96
- package/dist/context/editor-file-context.mjs +0 -12
- package/dist/extensions/callout/callout-settings.d.mts +0 -13
- package/dist/extensions/callout/callout-settings.d.ts +0 -13
- package/dist/extensions/callout/callout-settings.js +0 -206
- package/dist/extensions/callout/callout-settings.mjs +0 -9
- package/dist/extensions/callout/callout-view.d.mts +0 -12
- package/dist/extensions/callout/callout-view.d.ts +0 -12
- package/dist/extensions/callout/callout-view.js +0 -273
- package/dist/extensions/callout/callout-view.mjs +0 -12
- package/dist/extensions/callout/index.d.mts +0 -44
- package/dist/extensions/callout/index.d.ts +0 -44
- package/dist/extensions/callout/index.js +0 -380
- package/dist/extensions/callout/index.mjs +0 -13
- package/dist/extensions/callout/messages.d.mts +0 -59
- package/dist/extensions/callout/messages.d.ts +0 -59
- package/dist/extensions/callout/messages.js +0 -88
- package/dist/extensions/callout/messages.mjs +0 -7
- package/dist/extensions/image/image-view.d.mts +0 -15
- package/dist/extensions/image/image-view.d.ts +0 -15
- package/dist/extensions/image/image-view.js +0 -255
- package/dist/extensions/image/image-view.mjs +0 -12
- package/dist/extensions/image/index.d.mts +0 -29
- package/dist/extensions/image/index.d.ts +0 -29
- package/dist/extensions/image/index.js +0 -282
- package/dist/extensions/image/index.mjs +0 -16
- package/dist/extensions/image/messages.d.mts +0 -28
- package/dist/extensions/image/messages.d.ts +0 -28
- package/dist/extensions/image/messages.js +0 -57
- package/dist/extensions/image/messages.mjs +0 -7
- package/dist/extensions/image-upload/image-upload-view.d.mts +0 -12
- package/dist/extensions/image-upload/image-upload-view.d.ts +0 -12
- package/dist/extensions/image-upload/image-upload-view.js +0 -338
- package/dist/extensions/image-upload/image-upload-view.mjs +0 -12
- package/dist/extensions/image-upload/index.d.mts +0 -46
- package/dist/extensions/image-upload/index.d.ts +0 -46
- package/dist/extensions/image-upload/index.js +0 -414
- package/dist/extensions/image-upload/index.mjs +0 -16
- package/dist/extensions/image-upload/messages.d.mts +0 -32
- package/dist/extensions/image-upload/messages.d.ts +0 -32
- package/dist/extensions/image-upload/messages.js +0 -61
- package/dist/extensions/image-upload/messages.mjs +0 -7
- package/dist/extensions/link/index.d.mts +0 -6
- package/dist/extensions/link/index.d.ts +0 -6
- package/dist/extensions/link/index.js +0 -94
- package/dist/extensions/link/index.mjs +0 -7
- package/dist/extensions/math/index.d.mts +0 -38
- package/dist/extensions/math/index.d.ts +0 -38
- package/dist/extensions/math/index.js +0 -544
- package/dist/extensions/math/index.mjs +0 -17
- package/dist/extensions/math/inline-math-view.d.mts +0 -12
- package/dist/extensions/math/inline-math-view.d.ts +0 -12
- package/dist/extensions/math/inline-math-view.js +0 -232
- package/dist/extensions/math/inline-math-view.mjs +0 -11
- package/dist/extensions/math/inline-math.d.mts +0 -32
- package/dist/extensions/math/inline-math.d.ts +0 -32
- package/dist/extensions/math/inline-math.js +0 -304
- package/dist/extensions/math/inline-math.mjs +0 -12
- package/dist/extensions/math/math-block-view.d.mts +0 -11
- package/dist/extensions/math/math-block-view.d.ts +0 -11
- package/dist/extensions/math/math-block-view.js +0 -248
- package/dist/extensions/math/math-block-view.mjs +0 -11
- package/dist/extensions/math/messages.d.mts +0 -49
- package/dist/extensions/math/messages.d.ts +0 -49
- package/dist/extensions/math/messages.js +0 -78
- package/dist/extensions/math/messages.mjs +0 -7
- package/dist/extensions/selection/index.d.mts +0 -5
- package/dist/extensions/selection/index.d.ts +0 -5
- package/dist/extensions/selection/index.js +0 -62
- package/dist/extensions/selection/index.mjs +0 -7
- package/dist/extensions/toc/index.d.mts +0 -53
- package/dist/extensions/toc/index.d.ts +0 -53
- package/dist/extensions/toc/index.js +0 -501
- package/dist/extensions/toc/index.mjs +0 -13
- package/dist/extensions/toc/messages.d.mts +0 -74
- package/dist/extensions/toc/messages.d.ts +0 -74
- package/dist/extensions/toc/messages.js +0 -103
- package/dist/extensions/toc/messages.mjs +0 -7
- package/dist/extensions/toc/toc-settings.d.mts +0 -13
- package/dist/extensions/toc/toc-settings.d.ts +0 -13
- package/dist/extensions/toc/toc-settings.js +0 -283
- package/dist/extensions/toc/toc-settings.mjs +0 -9
- package/dist/extensions/toc/toc-view.d.mts +0 -12
- package/dist/extensions/toc/toc-view.d.ts +0 -12
- package/dist/extensions/toc/toc-view.js +0 -411
- package/dist/extensions/toc/toc-view.mjs +0 -12
- package/dist/extensions/trailing-node/index.d.mts +0 -9
- package/dist/extensions/trailing-node/index.d.ts +0 -9
- package/dist/extensions/trailing-node/index.js +0 -86
- package/dist/extensions/trailing-node/index.mjs +0 -7
- package/dist/extensions/ui-state/index.d.mts +0 -34
- package/dist/extensions/ui-state/index.d.ts +0 -34
- package/dist/extensions/ui-state/index.js +0 -84
- package/dist/extensions/ui-state/index.mjs +0 -9
- package/dist/extensions/variable/extract-variables.d.mts +0 -16
- package/dist/extensions/variable/extract-variables.d.ts +0 -16
- package/dist/extensions/variable/extract-variables.js +0 -58
- package/dist/extensions/variable/extract-variables.mjs +0 -7
- package/dist/extensions/variable/index.d.mts +0 -38
- package/dist/extensions/variable/index.d.ts +0 -38
- package/dist/extensions/variable/index.js +0 -190
- package/dist/extensions/variable/index.mjs +0 -11
- package/dist/extensions/variable/messages.d.mts +0 -69
- package/dist/extensions/variable/messages.d.ts +0 -69
- package/dist/extensions/variable/messages.js +0 -98
- package/dist/extensions/variable/messages.mjs +0 -7
- package/dist/extensions/variable/variable-context.d.mts +0 -56
- package/dist/extensions/variable/variable-context.d.ts +0 -56
- package/dist/extensions/variable/variable-context.js +0 -70
- package/dist/extensions/variable/variable-context.mjs +0 -12
- package/dist/extensions/variable/variable-filler-dialog.d.mts +0 -43
- package/dist/extensions/variable/variable-filler-dialog.d.ts +0 -43
- package/dist/extensions/variable/variable-filler-dialog.js +0 -207
- package/dist/extensions/variable/variable-filler-dialog.mjs +0 -9
- package/dist/extensions/variable/variable-suggestion.d.mts +0 -31
- package/dist/extensions/variable/variable-suggestion.d.ts +0 -31
- package/dist/extensions/variable/variable-suggestion.js +0 -615
- package/dist/extensions/variable/variable-suggestion.mjs +0 -14
- package/dist/extensions/variable/variable-view.d.mts +0 -13
- package/dist/extensions/variable/variable-view.d.ts +0 -13
- package/dist/extensions/variable/variable-view.js +0 -110
- package/dist/extensions/variable/variable-view.mjs +0 -11
- package/dist/hooks/use-create-editor.d.mts +0 -46
- package/dist/hooks/use-create-editor.d.ts +0 -46
- package/dist/hooks/use-create-editor.js +0 -2726
- package/dist/hooks/use-create-editor.mjs +0 -37
- package/dist/hooks/use-cursor-visibility.d.mts +0 -37
- package/dist/hooks/use-cursor-visibility.d.ts +0 -37
- package/dist/hooks/use-cursor-visibility.js +0 -140
- package/dist/hooks/use-cursor-visibility.mjs +0 -8
- package/dist/hooks/use-floating-element.d.mts +0 -43
- package/dist/hooks/use-floating-element.d.ts +0 -43
- package/dist/hooks/use-floating-element.js +0 -88
- package/dist/hooks/use-floating-element.mjs +0 -8
- package/dist/hooks/use-floating-toolbar-visibility.d.mts +0 -32
- package/dist/hooks/use-floating-toolbar-visibility.d.ts +0 -32
- package/dist/hooks/use-floating-toolbar-visibility.js +0 -115
- package/dist/hooks/use-floating-toolbar-visibility.mjs +0 -13
- package/dist/hooks/use-menu-navigation.d.mts +0 -55
- package/dist/hooks/use-menu-navigation.d.ts +0 -55
- package/dist/hooks/use-menu-navigation.js +0 -163
- package/dist/hooks/use-menu-navigation.mjs +0 -8
- package/dist/hooks/use-tiptap-editor.d.mts +0 -20
- package/dist/hooks/use-tiptap-editor.d.ts +0 -20
- package/dist/hooks/use-tiptap-editor.js +0 -58
- package/dist/hooks/use-tiptap-editor.mjs +0 -8
- package/dist/hooks/use-ui-editor-state.d.mts +0 -7
- package/dist/hooks/use-ui-editor-state.d.ts +0 -7
- package/dist/hooks/use-ui-editor-state.js +0 -107
- package/dist/hooks/use-ui-editor-state.mjs +0 -11
- package/dist/hooks/use-window-size.d.mts +0 -12
- package/dist/hooks/use-window-size.d.ts +0 -12
- package/dist/hooks/use-window-size.js +0 -75
- package/dist/hooks/use-window-size.mjs +0 -7
- package/dist/presets/basic/editor-header.d.mts +0 -23
- package/dist/presets/basic/editor-header.d.ts +0 -23
- package/dist/presets/basic/editor-header.js +0 -2750
- package/dist/presets/basic/editor-header.mjs +0 -43
- package/dist/presets/basic/index.d.mts +0 -38
- package/dist/presets/basic/index.d.ts +0 -38
- package/dist/presets/basic/index.js +0 -6891
- package/dist/presets/basic/index.mjs +0 -85
- package/dist/ui/blockquote-button/blockquote-button.d.mts +0 -20
- package/dist/ui/blockquote-button/blockquote-button.d.ts +0 -20
- package/dist/ui/blockquote-button/blockquote-button.js +0 -247
- package/dist/ui/blockquote-button/blockquote-button.mjs +0 -9
- package/dist/ui/blockquote-button/index.d.mts +0 -6
- package/dist/ui/blockquote-button/index.d.ts +0 -6
- package/dist/ui/blockquote-button/index.js +0 -259
- package/dist/ui/blockquote-button/index.mjs +0 -21
- package/dist/ui/blockquote-button/use-blockquote.d.mts +0 -85
- package/dist/ui/blockquote-button/use-blockquote.d.ts +0 -85
- package/dist/ui/blockquote-button/use-blockquote.js +0 -192
- package/dist/ui/blockquote-button/use-blockquote.mjs +0 -17
- package/dist/ui/bubble-menu/index.d.mts +0 -13
- package/dist/ui/bubble-menu/index.d.ts +0 -13
- package/dist/ui/bubble-menu/index.js +0 -673
- package/dist/ui/bubble-menu/index.mjs +0 -16
- package/dist/ui/codeblock-button/code-block-button.d.mts +0 -20
- package/dist/ui/codeblock-button/code-block-button.d.ts +0 -20
- package/dist/ui/codeblock-button/code-block-button.js +0 -237
- package/dist/ui/codeblock-button/code-block-button.mjs +0 -9
- package/dist/ui/codeblock-button/index.d.mts +0 -6
- package/dist/ui/codeblock-button/index.d.ts +0 -6
- package/dist/ui/codeblock-button/index.js +0 -249
- package/dist/ui/codeblock-button/index.mjs +0 -21
- package/dist/ui/codeblock-button/use-code-block.d.mts +0 -92
- package/dist/ui/codeblock-button/use-code-block.d.ts +0 -92
- package/dist/ui/codeblock-button/use-code-block.js +0 -192
- package/dist/ui/codeblock-button/use-code-block.mjs +0 -17
- package/dist/ui/color-highlight-button/color-highlight-button.d.mts +0 -25
- package/dist/ui/color-highlight-button/color-highlight-button.d.ts +0 -25
- package/dist/ui/color-highlight-button/color-highlight-button.js +0 -266
- package/dist/ui/color-highlight-button/color-highlight-button.mjs +0 -9
- package/dist/ui/color-highlight-button/index.d.mts +0 -6
- package/dist/ui/color-highlight-button/index.d.ts +0 -6
- package/dist/ui/color-highlight-button/index.js +0 -342
- package/dist/ui/color-highlight-button/index.mjs +0 -27
- package/dist/ui/color-highlight-button/use-color-highlight.d.mts +0 -64
- package/dist/ui/color-highlight-button/use-color-highlight.d.ts +0 -64
- package/dist/ui/color-highlight-button/use-color-highlight.js +0 -247
- package/dist/ui/color-highlight-button/use-color-highlight.mjs +0 -23
- package/dist/ui/color-highlight-popover/color-highlight-popover.d.mts +0 -29
- package/dist/ui/color-highlight-popover/color-highlight-popover.d.ts +0 -29
- package/dist/ui/color-highlight-popover/color-highlight-popover.js +0 -590
- package/dist/ui/color-highlight-popover/color-highlight-popover.mjs +0 -17
- package/dist/ui/color-highlight-popover/index.d.mts +0 -6
- package/dist/ui/color-highlight-popover/index.d.ts +0 -6
- package/dist/ui/color-highlight-popover/index.js +0 -591
- package/dist/ui/color-highlight-popover/index.mjs +0 -17
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.d.mts +0 -30
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.d.ts +0 -30
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.js +0 -171
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.mjs +0 -10
- package/dist/ui/heading-button/index.d.mts +0 -45
- package/dist/ui/heading-button/index.d.ts +0 -45
- package/dist/ui/heading-button/index.js +0 -222
- package/dist/ui/heading-button/index.mjs +0 -16
- package/dist/ui/heading-button/utils.d.mts +0 -17
- package/dist/ui/heading-button/utils.d.ts +0 -17
- package/dist/ui/heading-button/utils.js +0 -92
- package/dist/ui/heading-button/utils.mjs +0 -19
- package/dist/ui/heading-dropdown-menu/index.d.mts +0 -14
- package/dist/ui/heading-dropdown-menu/index.d.ts +0 -14
- package/dist/ui/heading-dropdown-menu/index.js +0 -308
- package/dist/ui/heading-dropdown-menu/index.mjs +0 -10
- package/dist/ui/link-bubble/index.d.mts +0 -13
- package/dist/ui/link-bubble/index.d.ts +0 -13
- package/dist/ui/link-bubble/index.js +0 -183
- package/dist/ui/link-bubble/index.mjs +0 -10
- package/dist/ui/link-popover/index.d.mts +0 -7
- package/dist/ui/link-popover/index.d.ts +0 -7
- package/dist/ui/link-popover/index.js +0 -512
- package/dist/ui/link-popover/index.mjs +0 -30
- package/dist/ui/link-popover/link-popover.d.mts +0 -85
- package/dist/ui/link-popover/link-popover.d.ts +0 -85
- package/dist/ui/link-popover/link-popover.js +0 -498
- package/dist/ui/link-popover/link-popover.mjs +0 -16
- package/dist/ui/link-popover/use-link-popover.d.mts +0 -123
- package/dist/ui/link-popover/use-link-popover.d.ts +0 -123
- package/dist/ui/link-popover/use-link-popover.js +0 -259
- package/dist/ui/link-popover/use-link-popover.mjs +0 -20
- package/dist/ui/list-button/index.d.mts +0 -50
- package/dist/ui/list-button/index.d.ts +0 -50
- package/dist/ui/list-button/index.js +0 -232
- package/dist/ui/list-button/index.mjs +0 -24
- package/dist/ui/list-dropdown-menu/index.d.mts +0 -45
- package/dist/ui/list-dropdown-menu/index.d.ts +0 -45
- package/dist/ui/list-dropdown-menu/index.js +0 -361
- package/dist/ui/list-dropdown-menu/index.mjs +0 -21
- package/dist/ui/mark-button/index.d.mts +0 -59
- package/dist/ui/mark-button/index.d.ts +0 -59
- package/dist/ui/mark-button/index.js +0 -217
- package/dist/ui/mark-button/index.mjs +0 -26
- package/dist/ui/reset-all-formatting-button/index.d.mts +0 -7
- package/dist/ui/reset-all-formatting-button/index.d.ts +0 -7
- package/dist/ui/reset-all-formatting-button/index.js +0 -286
- package/dist/ui/reset-all-formatting-button/index.mjs +0 -26
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.d.mts +0 -30
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.d.ts +0 -30
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.js +0 -271
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.mjs +0 -12
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.d.mts +0 -103
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.d.ts +0 -103
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.js +0 -211
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.mjs +0 -21
- package/dist/ui/slash-dropdown-menu/index.d.mts +0 -10
- package/dist/ui/slash-dropdown-menu/index.d.ts +0 -10
- package/dist/ui/slash-dropdown-menu/index.js +0 -1056
- package/dist/ui/slash-dropdown-menu/index.mjs +0 -19
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.d.mts +0 -16
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.d.ts +0 -16
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.js +0 -1053
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.mjs +0 -16
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.d.mts +0 -162
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.d.ts +0 -162
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.js +0 -457
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.mjs +0 -10
- package/dist/ui/suggestion-menu/index.d.mts +0 -10
- package/dist/ui/suggestion-menu/index.d.ts +0 -10
- package/dist/ui/suggestion-menu/index.js +0 -489
- package/dist/ui/suggestion-menu/index.mjs +0 -17
- package/dist/ui/suggestion-menu/suggestion-menu-types.d.mts +0 -89
- package/dist/ui/suggestion-menu/suggestion-menu-types.d.ts +0 -89
- package/dist/ui/suggestion-menu/suggestion-menu-types.js +0 -19
- package/dist/ui/suggestion-menu/suggestion-menu-types.mjs +0 -1
- package/dist/ui/suggestion-menu/suggestion-menu-utils.d.mts +0 -27
- package/dist/ui/suggestion-menu/suggestion-menu-utils.d.ts +0 -27
- package/dist/ui/suggestion-menu/suggestion-menu-utils.js +0 -75
- package/dist/ui/suggestion-menu/suggestion-menu-utils.mjs +0 -9
- package/dist/ui/suggestion-menu/suggestion-menu.d.mts +0 -15
- package/dist/ui/suggestion-menu/suggestion-menu.d.ts +0 -15
- package/dist/ui/suggestion-menu/suggestion-menu.js +0 -453
- package/dist/ui/suggestion-menu/suggestion-menu.mjs +0 -12
- package/dist/ui/table-button/index.d.mts +0 -15
- package/dist/ui/table-button/index.d.ts +0 -15
- package/dist/ui/table-button/index.js +0 -202
- package/dist/ui/table-button/index.mjs +0 -9
- package/dist/ui/table-button/use-table.d.mts +0 -51
- package/dist/ui/table-button/use-table.d.ts +0 -51
- package/dist/ui/table-button/use-table.js +0 -146
- package/dist/ui/table-button/use-table.mjs +0 -14
- package/dist/ui/text-align-button/index.d.mts +0 -6
- package/dist/ui/text-align-button/index.d.ts +0 -6
- package/dist/ui/text-align-button/index.js +0 -235
- package/dist/ui/text-align-button/index.mjs +0 -29
- package/dist/ui/text-align-button/text-align-button.d.mts +0 -20
- package/dist/ui/text-align-button/text-align-button.d.ts +0 -20
- package/dist/ui/text-align-button/text-align-button.js +0 -215
- package/dist/ui/text-align-button/text-align-button.mjs +0 -9
- package/dist/ui/text-align-button/use-text-align.d.mts +0 -106
- package/dist/ui/text-align-button/use-text-align.d.ts +0 -106
- package/dist/ui/text-align-button/use-text-align.js +0 -169
- package/dist/ui/text-align-button/use-text-align.mjs +0 -24
- package/dist/ui/undo-redo-button/index.d.mts +0 -6
- package/dist/ui/undo-redo-button/index.d.ts +0 -6
- package/dist/ui/undo-redo-button/index.js +0 -202
- package/dist/ui/undo-redo-button/index.mjs +0 -25
- package/dist/ui/undo-redo-button/undo-redo-button.d.mts +0 -23
- package/dist/ui/undo-redo-button/undo-redo-button.d.ts +0 -23
- package/dist/ui/undo-redo-button/undo-redo-button.js +0 -187
- package/dist/ui/undo-redo-button/undo-redo-button.mjs +0 -10
- package/dist/ui/undo-redo-button/use-undo-redo.d.mts +0 -95
- package/dist/ui/undo-redo-button/use-undo-redo.d.ts +0 -95
- package/dist/ui/undo-redo-button/use-undo-redo.js +0 -146
- package/dist/ui/undo-redo-button/use-undo-redo.mjs +0 -21
- package/dist/utils/index.d.mts +0 -38
- package/dist/utils/index.d.ts +0 -38
- package/dist/utils/index.js +0 -128
- package/dist/utils/index.mjs +0 -15
- package/dist/utils/safe-parse.d.mts +0 -14
- package/dist/utils/safe-parse.d.ts +0 -14
- package/dist/utils/safe-parse.js +0 -203
- package/dist/utils/safe-parse.mjs +0 -8
package/dist/chunk-Q5FK7SFY.mjs
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/extensions/variable/messages.ts
|
|
4
|
-
import { defineMessages } from "react-intl";
|
|
5
|
-
var messages = defineMessages({
|
|
6
|
-
title: {
|
|
7
|
-
id: "editor.variable.title",
|
|
8
|
-
defaultMessage: "Variables",
|
|
9
|
-
description: "Title for the variables section"
|
|
10
|
-
},
|
|
11
|
-
insert: {
|
|
12
|
-
id: "editor.variable.insert",
|
|
13
|
-
defaultMessage: "Insert variable",
|
|
14
|
-
description: "Insert variable button label"
|
|
15
|
-
},
|
|
16
|
-
empty_state: {
|
|
17
|
-
id: "editor.variable.empty_state",
|
|
18
|
-
defaultMessage: "No variables available",
|
|
19
|
-
description: "Empty state when no variables are defined"
|
|
20
|
-
},
|
|
21
|
-
hint: {
|
|
22
|
-
id: "editor.variable.hint",
|
|
23
|
-
defaultMessage: "Type {{ to insert a variable",
|
|
24
|
-
description: "Hint for inserting variables"
|
|
25
|
-
},
|
|
26
|
-
save: {
|
|
27
|
-
id: "editor.variable.save",
|
|
28
|
-
defaultMessage: "Save",
|
|
29
|
-
description: "Save button label"
|
|
30
|
-
},
|
|
31
|
-
cancel: {
|
|
32
|
-
id: "editor.variable.cancel",
|
|
33
|
-
defaultMessage: "Cancel",
|
|
34
|
-
description: "Cancel button label"
|
|
35
|
-
},
|
|
36
|
-
category_company: {
|
|
37
|
-
id: "editor.variable.category.company",
|
|
38
|
-
defaultMessage: "Company",
|
|
39
|
-
description: "Company variables category"
|
|
40
|
-
},
|
|
41
|
-
category_user: {
|
|
42
|
-
id: "editor.variable.category.user",
|
|
43
|
-
defaultMessage: "User",
|
|
44
|
-
description: "User variables category"
|
|
45
|
-
},
|
|
46
|
-
category_date: {
|
|
47
|
-
id: "editor.variable.category.date",
|
|
48
|
-
defaultMessage: "Date",
|
|
49
|
-
description: "Date variables category"
|
|
50
|
-
},
|
|
51
|
-
category_document: {
|
|
52
|
-
id: "editor.variable.category.document",
|
|
53
|
-
defaultMessage: "Document",
|
|
54
|
-
description: "Document variables category"
|
|
55
|
-
},
|
|
56
|
-
category_other: {
|
|
57
|
-
id: "editor.variable.category.other",
|
|
58
|
-
defaultMessage: "Other",
|
|
59
|
-
description: "Other variables category"
|
|
60
|
-
},
|
|
61
|
-
filler_title: {
|
|
62
|
-
id: "editor.variable.filler.title",
|
|
63
|
-
defaultMessage: "Fill in Variables",
|
|
64
|
-
description: "Title for the variable filler dialog"
|
|
65
|
-
},
|
|
66
|
-
filler_filled: {
|
|
67
|
-
id: "editor.variable.filler.filled",
|
|
68
|
-
defaultMessage: "filled",
|
|
69
|
-
description: "Label for filled count"
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
export {
|
|
74
|
-
messages
|
|
75
|
-
};
|
package/dist/chunk-Q7DFJ5NI.mjs
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
ListButton,
|
|
4
|
-
canToggleList,
|
|
5
|
-
isListActive,
|
|
6
|
-
listOptions
|
|
7
|
-
} from "./chunk-IOB3REX6.mjs";
|
|
8
|
-
import {
|
|
9
|
-
useTiptapEditor
|
|
10
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
11
|
-
|
|
12
|
-
// src/ui/list-dropdown-menu/index.tsx
|
|
13
|
-
import { Button } from "@kopexa/button";
|
|
14
|
-
import { DropdownMenu } from "@kopexa/dropdown-menu";
|
|
15
|
-
import { isNodeInSchema } from "@kopexa/editor-utils";
|
|
16
|
-
import { ChevronDownIcon, ListIcon } from "@kopexa/icons";
|
|
17
|
-
import { isNodeSelection } from "@tiptap/react";
|
|
18
|
-
import { useCallback, useMemo, useState } from "react";
|
|
19
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
-
function canToggleAnyList(editor, listTypes) {
|
|
21
|
-
if (!editor) return false;
|
|
22
|
-
return listTypes.some((type) => canToggleList(editor, type));
|
|
23
|
-
}
|
|
24
|
-
function isAnyListActive(editor, listTypes) {
|
|
25
|
-
if (!editor) return false;
|
|
26
|
-
return listTypes.some((type) => isListActive(editor, type));
|
|
27
|
-
}
|
|
28
|
-
function getFilteredListOptions(availableTypes) {
|
|
29
|
-
return listOptions.filter(
|
|
30
|
-
(option) => !option.type || availableTypes.includes(option.type)
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
function shouldShowListDropdown(params) {
|
|
34
|
-
const { editor, hideWhenUnavailable, listInSchema, canToggleAny } = params;
|
|
35
|
-
if (!listInSchema || !editor) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
if (hideWhenUnavailable) {
|
|
39
|
-
if (isNodeSelection(editor.state.selection) || !canToggleAny) {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
function useListDropdownState(editor, availableTypes) {
|
|
46
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
47
|
-
const listInSchema = availableTypes.some(
|
|
48
|
-
(type) => isNodeInSchema(type, editor)
|
|
49
|
-
);
|
|
50
|
-
const filteredLists = useMemo(
|
|
51
|
-
() => getFilteredListOptions(availableTypes),
|
|
52
|
-
[availableTypes]
|
|
53
|
-
);
|
|
54
|
-
const canToggleAny = canToggleAnyList(editor, availableTypes);
|
|
55
|
-
const isAnyActive = isAnyListActive(editor, availableTypes);
|
|
56
|
-
const handleOpenChange = useCallback(
|
|
57
|
-
(open, callback) => {
|
|
58
|
-
setIsOpen(open);
|
|
59
|
-
callback == null ? void 0 : callback(open);
|
|
60
|
-
},
|
|
61
|
-
[]
|
|
62
|
-
);
|
|
63
|
-
return {
|
|
64
|
-
isOpen,
|
|
65
|
-
setIsOpen,
|
|
66
|
-
listInSchema,
|
|
67
|
-
filteredLists,
|
|
68
|
-
canToggleAny,
|
|
69
|
-
isAnyActive,
|
|
70
|
-
handleOpenChange
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
function useActiveListIcon(editor, filteredLists) {
|
|
74
|
-
return useCallback(() => {
|
|
75
|
-
const activeOption = filteredLists.find(
|
|
76
|
-
(option) => isListActive(editor, option.type)
|
|
77
|
-
);
|
|
78
|
-
return activeOption ? /* @__PURE__ */ jsx(activeOption.icon, {}) : /* @__PURE__ */ jsx(ListIcon, {});
|
|
79
|
-
}, [editor, filteredLists]);
|
|
80
|
-
}
|
|
81
|
-
function ListDropdownMenu({
|
|
82
|
-
editor: providedEditor,
|
|
83
|
-
types = ["bulletList", "orderedList", "taskList"],
|
|
84
|
-
hideWhenUnavailable = false,
|
|
85
|
-
onOpenChange,
|
|
86
|
-
...props
|
|
87
|
-
}) {
|
|
88
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
89
|
-
const {
|
|
90
|
-
isOpen,
|
|
91
|
-
listInSchema,
|
|
92
|
-
filteredLists,
|
|
93
|
-
canToggleAny,
|
|
94
|
-
isAnyActive,
|
|
95
|
-
handleOpenChange
|
|
96
|
-
} = useListDropdownState(editor, types);
|
|
97
|
-
const getActiveIcon = useActiveListIcon(editor, filteredLists);
|
|
98
|
-
const show = useMemo(() => {
|
|
99
|
-
return shouldShowListDropdown({
|
|
100
|
-
editor,
|
|
101
|
-
listTypes: types,
|
|
102
|
-
hideWhenUnavailable,
|
|
103
|
-
listInSchema,
|
|
104
|
-
canToggleAny
|
|
105
|
-
});
|
|
106
|
-
}, [editor, types, hideWhenUnavailable, listInSchema, canToggleAny]);
|
|
107
|
-
const handleOnOpenChange = useCallback(
|
|
108
|
-
(open) => handleOpenChange(open, onOpenChange),
|
|
109
|
-
[handleOpenChange, onOpenChange]
|
|
110
|
-
);
|
|
111
|
-
if (!show || !editor || !editor.isEditable) {
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
return /* @__PURE__ */ jsxs(DropdownMenu.Root, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
115
|
-
/* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
116
|
-
Button,
|
|
117
|
-
{
|
|
118
|
-
type: "button",
|
|
119
|
-
variant: "ghost",
|
|
120
|
-
color: "default",
|
|
121
|
-
"data-active-state": isAnyActive ? "on" : "off",
|
|
122
|
-
tabIndex: -1,
|
|
123
|
-
"aria-label": "List options",
|
|
124
|
-
tooltip: "List",
|
|
125
|
-
endContent: /* @__PURE__ */ jsx(ChevronDownIcon, {}),
|
|
126
|
-
...props,
|
|
127
|
-
children: getActiveIcon()
|
|
128
|
-
}
|
|
129
|
-
) }),
|
|
130
|
-
/* @__PURE__ */ jsx(DropdownMenu.Content, { children: /* @__PURE__ */ jsx(DropdownMenu.Group, { children: filteredLists.map((option) => /* @__PURE__ */ jsx(DropdownMenu.Item, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
131
|
-
ListButton,
|
|
132
|
-
{
|
|
133
|
-
editor,
|
|
134
|
-
type: option.type,
|
|
135
|
-
text: option.label,
|
|
136
|
-
hideWhenUnavailable,
|
|
137
|
-
tooltip: "",
|
|
138
|
-
fullWidth: true,
|
|
139
|
-
spacing: "start"
|
|
140
|
-
}
|
|
141
|
-
) }, option.type)) }) })
|
|
142
|
-
] });
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export {
|
|
146
|
-
canToggleAnyList,
|
|
147
|
-
isAnyListActive,
|
|
148
|
-
getFilteredListOptions,
|
|
149
|
-
shouldShowListDropdown,
|
|
150
|
-
useListDropdownState,
|
|
151
|
-
useActiveListIcon,
|
|
152
|
-
ListDropdownMenu
|
|
153
|
-
};
|
package/dist/chunk-QIELBKP3.mjs
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
messages
|
|
4
|
-
} from "./chunk-Q5FK7SFY.mjs";
|
|
5
|
-
|
|
6
|
-
// src/extensions/variable/variable-filler-dialog.tsx
|
|
7
|
-
import { Button } from "@kopexa/button";
|
|
8
|
-
import { Dialog } from "@kopexa/dialog";
|
|
9
|
-
import { Input } from "@kopexa/input";
|
|
10
|
-
import { Label } from "@kopexa/label";
|
|
11
|
-
import * as React from "react";
|
|
12
|
-
import { useIntl } from "react-intl";
|
|
13
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
function VariableFillerDialog({
|
|
15
|
-
open,
|
|
16
|
-
onOpenChange,
|
|
17
|
-
variables,
|
|
18
|
-
values,
|
|
19
|
-
onSave,
|
|
20
|
-
title,
|
|
21
|
-
description
|
|
22
|
-
}) {
|
|
23
|
-
const intl = useIntl();
|
|
24
|
-
const [localValues, setLocalValues] = React.useState(
|
|
25
|
-
{}
|
|
26
|
-
);
|
|
27
|
-
React.useEffect(() => {
|
|
28
|
-
if (open) {
|
|
29
|
-
setLocalValues({ ...values });
|
|
30
|
-
}
|
|
31
|
-
}, [open, values]);
|
|
32
|
-
const handleChange = React.useCallback((name, value) => {
|
|
33
|
-
setLocalValues((prev) => ({
|
|
34
|
-
...prev,
|
|
35
|
-
[name]: value
|
|
36
|
-
}));
|
|
37
|
-
}, []);
|
|
38
|
-
const handleSave = React.useCallback(() => {
|
|
39
|
-
onSave(localValues);
|
|
40
|
-
onOpenChange(false);
|
|
41
|
-
}, [localValues, onSave, onOpenChange]);
|
|
42
|
-
const handleCancel = React.useCallback(() => {
|
|
43
|
-
setLocalValues({ ...values });
|
|
44
|
-
onOpenChange(false);
|
|
45
|
-
}, [values, onOpenChange]);
|
|
46
|
-
const groupedVariables = React.useMemo(() => {
|
|
47
|
-
return variables.reduce(
|
|
48
|
-
(acc, v) => {
|
|
49
|
-
const cat = v.category || intl.formatMessage(messages.category_other);
|
|
50
|
-
if (!acc[cat]) acc[cat] = [];
|
|
51
|
-
acc[cat].push(v);
|
|
52
|
-
return acc;
|
|
53
|
-
},
|
|
54
|
-
{}
|
|
55
|
-
);
|
|
56
|
-
}, [variables, intl]);
|
|
57
|
-
const filledCount = React.useMemo(() => {
|
|
58
|
-
return variables.filter((v) => {
|
|
59
|
-
var _a;
|
|
60
|
-
return (_a = localValues[v.name]) == null ? void 0 : _a.trim();
|
|
61
|
-
}).length;
|
|
62
|
-
}, [variables, localValues]);
|
|
63
|
-
return /* @__PURE__ */ jsx(Dialog.Root, { open, onOpenChange, size: "md", children: /* @__PURE__ */ jsxs(Dialog.Content, { children: [
|
|
64
|
-
/* @__PURE__ */ jsxs(Dialog.Header, { children: [
|
|
65
|
-
/* @__PURE__ */ jsx(Dialog.Title, { children: title || intl.formatMessage(messages.filler_title) }),
|
|
66
|
-
description && /* @__PURE__ */ jsx(Dialog.Description, { children: description })
|
|
67
|
-
] }),
|
|
68
|
-
/* @__PURE__ */ jsx(Dialog.Body, { children: /* @__PURE__ */ jsx("div", { className: "space-y-6", children: Object.entries(groupedVariables).map(([category, vars]) => /* @__PURE__ */ jsxs("div", { children: [
|
|
69
|
-
/* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold text-muted-foreground uppercase tracking-wide mb-3", children: category }),
|
|
70
|
-
/* @__PURE__ */ jsx("div", { className: "space-y-3", children: vars.map((v) => /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
71
|
-
/* @__PURE__ */ jsxs(Label, { htmlFor: `var-${v.name}`, className: "text-sm", children: [
|
|
72
|
-
v.label,
|
|
73
|
-
v.description && /* @__PURE__ */ jsx("span", { className: "ml-2 text-xs text-muted-foreground font-normal", children: v.description })
|
|
74
|
-
] }),
|
|
75
|
-
/* @__PURE__ */ jsx(
|
|
76
|
-
Input,
|
|
77
|
-
{
|
|
78
|
-
id: `var-${v.name}`,
|
|
79
|
-
placeholder: v.fallback || `{{${v.name}}}`,
|
|
80
|
-
value: localValues[v.name] || "",
|
|
81
|
-
onChange: (e) => handleChange(v.name, e.target.value)
|
|
82
|
-
}
|
|
83
|
-
)
|
|
84
|
-
] }, v.name)) })
|
|
85
|
-
] }, category)) }) }),
|
|
86
|
-
/* @__PURE__ */ jsxs(Dialog.Footer, { className: "flex items-center justify-between", children: [
|
|
87
|
-
/* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground", children: [
|
|
88
|
-
filledCount,
|
|
89
|
-
" / ",
|
|
90
|
-
variables.length,
|
|
91
|
-
" ",
|
|
92
|
-
intl.formatMessage(messages.filler_filled)
|
|
93
|
-
] }),
|
|
94
|
-
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
95
|
-
/* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: handleCancel, children: intl.formatMessage(messages.cancel) }),
|
|
96
|
-
/* @__PURE__ */ jsx(Button, { onClick: handleSave, children: intl.formatMessage(messages.save) })
|
|
97
|
-
] })
|
|
98
|
-
] })
|
|
99
|
-
] }) });
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export {
|
|
103
|
-
VariableFillerDialog
|
|
104
|
-
};
|
package/dist/chunk-R2GM4A3T.mjs
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useWindowSize
|
|
4
|
-
} from "./chunk-DT7ML2P4.mjs";
|
|
5
|
-
|
|
6
|
-
// src/hooks/use-cursor-visibility.ts
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
function useCursorVisibility({
|
|
9
|
-
editor,
|
|
10
|
-
overlayHeight = 0,
|
|
11
|
-
elementRef = null
|
|
12
|
-
}) {
|
|
13
|
-
const { height: windowHeight } = useWindowSize();
|
|
14
|
-
const [rect, setRect] = React.useState({
|
|
15
|
-
x: 0,
|
|
16
|
-
y: 0,
|
|
17
|
-
width: 0,
|
|
18
|
-
height: 0
|
|
19
|
-
});
|
|
20
|
-
const updateRect = React.useCallback(() => {
|
|
21
|
-
var _a;
|
|
22
|
-
const element = (_a = elementRef == null ? void 0 : elementRef.current) != null ? _a : document.body;
|
|
23
|
-
const { x, y, width, height } = element.getBoundingClientRect();
|
|
24
|
-
setRect({ x, y, width, height });
|
|
25
|
-
}, [elementRef]);
|
|
26
|
-
React.useEffect(() => {
|
|
27
|
-
var _a;
|
|
28
|
-
const element = (_a = elementRef == null ? void 0 : elementRef.current) != null ? _a : document.body;
|
|
29
|
-
updateRect();
|
|
30
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
31
|
-
window.requestAnimationFrame(updateRect);
|
|
32
|
-
});
|
|
33
|
-
resizeObserver.observe(element);
|
|
34
|
-
window.addEventListener("scroll", updateRect, { passive: true });
|
|
35
|
-
return () => {
|
|
36
|
-
resizeObserver.disconnect();
|
|
37
|
-
window.removeEventListener("scroll", updateRect);
|
|
38
|
-
};
|
|
39
|
-
}, [elementRef, updateRect]);
|
|
40
|
-
React.useEffect(() => {
|
|
41
|
-
const ensureCursorVisibility = () => {
|
|
42
|
-
if (!editor) return;
|
|
43
|
-
const { state, view } = editor;
|
|
44
|
-
if (!view.hasFocus()) return;
|
|
45
|
-
const { from } = state.selection;
|
|
46
|
-
const cursorCoords = view.coordsAtPos(from);
|
|
47
|
-
if (windowHeight < rect.height) {
|
|
48
|
-
if (cursorCoords) {
|
|
49
|
-
const availableSpace = windowHeight - cursorCoords.top - overlayHeight > 0;
|
|
50
|
-
if (!availableSpace) {
|
|
51
|
-
const targetScrollY = (
|
|
52
|
-
// TODO: Needed?
|
|
53
|
-
// window.scrollY + (cursorCoords.top - windowHeight / 2)
|
|
54
|
-
cursorCoords.top - windowHeight / 2
|
|
55
|
-
);
|
|
56
|
-
window.scrollTo({
|
|
57
|
-
top: targetScrollY,
|
|
58
|
-
behavior: "smooth"
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
ensureCursorVisibility();
|
|
65
|
-
}, [editor, overlayHeight, windowHeight, rect.height]);
|
|
66
|
-
return rect;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export {
|
|
70
|
-
useCursorVisibility
|
|
71
|
-
};
|
package/dist/chunk-REJEJXOZ.mjs
DELETED
package/dist/chunk-RFWNKE7D.mjs
DELETED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
TextAlignButton
|
|
4
|
-
} from "./chunk-GYIYX2JH.mjs";
|
|
5
|
-
import {
|
|
6
|
-
canSetTextAlign
|
|
7
|
-
} from "./chunk-IQERE7KP.mjs";
|
|
8
|
-
import {
|
|
9
|
-
UndoRedoButton
|
|
10
|
-
} from "./chunk-2SI7MRAE.mjs";
|
|
11
|
-
import {
|
|
12
|
-
TableButton
|
|
13
|
-
} from "./chunk-VX3HSJ76.mjs";
|
|
14
|
-
import {
|
|
15
|
-
ListDropdownMenu
|
|
16
|
-
} from "./chunk-Q7DFJ5NI.mjs";
|
|
17
|
-
import {
|
|
18
|
-
HeadingDropdownMenu
|
|
19
|
-
} from "./chunk-V6TAZMQN.mjs";
|
|
20
|
-
import {
|
|
21
|
-
MarkButton,
|
|
22
|
-
canToggleMark
|
|
23
|
-
} from "./chunk-LNVWG34E.mjs";
|
|
24
|
-
import {
|
|
25
|
-
LinkPopover
|
|
26
|
-
} from "./chunk-7VGROP26.mjs";
|
|
27
|
-
import {
|
|
28
|
-
CodeBlockButton
|
|
29
|
-
} from "./chunk-OEVR5N7X.mjs";
|
|
30
|
-
import {
|
|
31
|
-
ColorHighlightPopover
|
|
32
|
-
} from "./chunk-C5RQWJKE.mjs";
|
|
33
|
-
import {
|
|
34
|
-
BlockquoteButton
|
|
35
|
-
} from "./chunk-W2FLOOJ6.mjs";
|
|
36
|
-
import {
|
|
37
|
-
useTiptapEditor
|
|
38
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
39
|
-
import {
|
|
40
|
-
useEditorUIContext
|
|
41
|
-
} from "./chunk-REJEJXOZ.mjs";
|
|
42
|
-
import {
|
|
43
|
-
useCursorVisibility
|
|
44
|
-
} from "./chunk-R2GM4A3T.mjs";
|
|
45
|
-
import {
|
|
46
|
-
useWindowSize
|
|
47
|
-
} from "./chunk-DT7ML2P4.mjs";
|
|
48
|
-
|
|
49
|
-
// src/presets/basic/editor-header.tsx
|
|
50
|
-
import { MoreVerticalIcon } from "@kopexa/icons";
|
|
51
|
-
import { Popover } from "@kopexa/popover";
|
|
52
|
-
import {
|
|
53
|
-
Toolbar,
|
|
54
|
-
ToolbarButton,
|
|
55
|
-
ToolbarGroup,
|
|
56
|
-
ToolbarSeparator
|
|
57
|
-
} from "@kopexa/toolbar";
|
|
58
|
-
import { useIsMobile } from "@kopexa/use-is-mobile";
|
|
59
|
-
import { useEffect, useRef, useState } from "react";
|
|
60
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
61
|
-
var EditorHeader = ({
|
|
62
|
-
editor: providedEditor,
|
|
63
|
-
variant
|
|
64
|
-
}) => {
|
|
65
|
-
var _a, _b;
|
|
66
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
67
|
-
const isMobile = useIsMobile();
|
|
68
|
-
const windowSize = useWindowSize();
|
|
69
|
-
const { styles } = useEditorUIContext();
|
|
70
|
-
const toolbarRef = useRef(null);
|
|
71
|
-
const bodyRect = useCursorVisibility({
|
|
72
|
-
editor,
|
|
73
|
-
overlayHeight: (_b = (_a = toolbarRef.current) == null ? void 0 : _a.getBoundingClientRect().height) != null ? _b : 0
|
|
74
|
-
});
|
|
75
|
-
if (!(editor == null ? void 0 : editor.isEditable)) {
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
const ToolbarContent = variant === "comment" ? CommentToolbarContent : variant === "field" ? FieldToolbarContent : MainToolbarContent;
|
|
79
|
-
return /* @__PURE__ */ jsx("div", { className: styles.toolbarContainer(), "data-slot": "editor-toolbar", children: /* @__PURE__ */ jsx(
|
|
80
|
-
Toolbar,
|
|
81
|
-
{
|
|
82
|
-
sticky: true,
|
|
83
|
-
radius: "none",
|
|
84
|
-
border: "none",
|
|
85
|
-
style: isMobile ? {
|
|
86
|
-
bottom: `calc(100% - ${windowSize.height - bodyRect.y}px)`
|
|
87
|
-
} : {},
|
|
88
|
-
className: styles.toolbar(),
|
|
89
|
-
children: /* @__PURE__ */ jsx(ToolbarContent, {})
|
|
90
|
-
}
|
|
91
|
-
) });
|
|
92
|
-
};
|
|
93
|
-
var MainToolbarContent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
94
|
-
/* @__PURE__ */ jsxs(ToolbarGroup, { children: [
|
|
95
|
-
/* @__PURE__ */ jsx(UndoRedoButton, { action: "undo" }),
|
|
96
|
-
/* @__PURE__ */ jsx(UndoRedoButton, { action: "redo" })
|
|
97
|
-
] }),
|
|
98
|
-
/* @__PURE__ */ jsx(ToolbarSeparator, {}),
|
|
99
|
-
/* @__PURE__ */ jsxs(ToolbarGroup, { children: [
|
|
100
|
-
/* @__PURE__ */ jsx(HeadingDropdownMenu, { levels: [1, 2, 3, 4] }),
|
|
101
|
-
/* @__PURE__ */ jsx(ListDropdownMenu, { types: ["bulletList", "orderedList", "taskList"] }),
|
|
102
|
-
/* @__PURE__ */ jsx(BlockquoteButton, {}),
|
|
103
|
-
/* @__PURE__ */ jsx(CodeBlockButton, {})
|
|
104
|
-
] }),
|
|
105
|
-
/* @__PURE__ */ jsx(ToolbarSeparator, {}),
|
|
106
|
-
/* @__PURE__ */ jsxs(ToolbarGroup, { children: [
|
|
107
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "bold" }),
|
|
108
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "italic" }),
|
|
109
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "strike" }),
|
|
110
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "code" }),
|
|
111
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "underline" }),
|
|
112
|
-
/* @__PURE__ */ jsx(ColorHighlightPopover, {}),
|
|
113
|
-
/* @__PURE__ */ jsx(LinkPopover, {})
|
|
114
|
-
] }),
|
|
115
|
-
/* @__PURE__ */ jsx(ToolbarSeparator, {}),
|
|
116
|
-
/* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsx(TableButton, {}) }),
|
|
117
|
-
/* @__PURE__ */ jsx(MoreOptions, { hideWhenUnavailable: true })
|
|
118
|
-
] });
|
|
119
|
-
var CommentToolbarContent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
120
|
-
/* @__PURE__ */ jsxs(ToolbarGroup, { children: [
|
|
121
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "bold" }),
|
|
122
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "italic" }),
|
|
123
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "strike" }),
|
|
124
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "code" })
|
|
125
|
-
] }),
|
|
126
|
-
/* @__PURE__ */ jsx(ToolbarSeparator, {}),
|
|
127
|
-
/* @__PURE__ */ jsxs(ToolbarGroup, { children: [
|
|
128
|
-
/* @__PURE__ */ jsx(LinkPopover, {}),
|
|
129
|
-
/* @__PURE__ */ jsx(ListDropdownMenu, { types: ["bulletList", "orderedList"] })
|
|
130
|
-
] })
|
|
131
|
-
] });
|
|
132
|
-
var FieldToolbarContent = () => /* @__PURE__ */ jsxs(ToolbarGroup, { children: [
|
|
133
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "bold" }),
|
|
134
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "italic" }),
|
|
135
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "strike" }),
|
|
136
|
-
/* @__PURE__ */ jsx(LinkPopover, {})
|
|
137
|
-
] });
|
|
138
|
-
function MoreOptions({
|
|
139
|
-
editor: providedEditor,
|
|
140
|
-
hideWhenUnavailable = false,
|
|
141
|
-
...props
|
|
142
|
-
}) {
|
|
143
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
144
|
-
const [show, setShow] = useState(false);
|
|
145
|
-
useEffect(() => {
|
|
146
|
-
if (!editor) return;
|
|
147
|
-
const handleSelectionUpdate = () => {
|
|
148
|
-
setShow(
|
|
149
|
-
shouldShowMoreOptions({
|
|
150
|
-
editor,
|
|
151
|
-
hideWhenUnavailable
|
|
152
|
-
})
|
|
153
|
-
);
|
|
154
|
-
};
|
|
155
|
-
handleSelectionUpdate();
|
|
156
|
-
editor.on("selectionUpdate", handleSelectionUpdate);
|
|
157
|
-
return () => {
|
|
158
|
-
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
159
|
-
};
|
|
160
|
-
}, [editor, hideWhenUnavailable]);
|
|
161
|
-
if (!show || !editor || !editor.isEditable) {
|
|
162
|
-
return null;
|
|
163
|
-
}
|
|
164
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
165
|
-
/* @__PURE__ */ jsx(ToolbarSeparator, {}),
|
|
166
|
-
/* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxs(Popover.Root, { spacing: "dense", width: "auto", children: [
|
|
167
|
-
/* @__PURE__ */ jsx(
|
|
168
|
-
Popover.Trigger,
|
|
169
|
-
{
|
|
170
|
-
render: /* @__PURE__ */ jsx(
|
|
171
|
-
ToolbarButton,
|
|
172
|
-
{
|
|
173
|
-
type: "button",
|
|
174
|
-
variant: "ghost",
|
|
175
|
-
color: "default",
|
|
176
|
-
tabIndex: -1,
|
|
177
|
-
size: "md",
|
|
178
|
-
"aria-label": "More options",
|
|
179
|
-
title: "More options",
|
|
180
|
-
isIconOnly: true,
|
|
181
|
-
...props,
|
|
182
|
-
children: /* @__PURE__ */ jsx(MoreVerticalIcon, {})
|
|
183
|
-
}
|
|
184
|
-
)
|
|
185
|
-
}
|
|
186
|
-
),
|
|
187
|
-
/* @__PURE__ */ jsx(
|
|
188
|
-
Popover.Content,
|
|
189
|
-
{
|
|
190
|
-
side: "top",
|
|
191
|
-
align: "end",
|
|
192
|
-
alignOffset: 4,
|
|
193
|
-
sideOffset: 4,
|
|
194
|
-
children: /* @__PURE__ */ jsxs(Toolbar, { children: [
|
|
195
|
-
/* @__PURE__ */ jsxs(ToolbarGroup, { children: [
|
|
196
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "superscript" }),
|
|
197
|
-
/* @__PURE__ */ jsx(MarkButton, { type: "subscript" })
|
|
198
|
-
] }),
|
|
199
|
-
/* @__PURE__ */ jsx(ToolbarSeparator, {}),
|
|
200
|
-
/* @__PURE__ */ jsxs(ToolbarGroup, { children: [
|
|
201
|
-
/* @__PURE__ */ jsx(TextAlignButton, { align: "left" }),
|
|
202
|
-
/* @__PURE__ */ jsx(TextAlignButton, { align: "center" }),
|
|
203
|
-
/* @__PURE__ */ jsx(TextAlignButton, { align: "right" }),
|
|
204
|
-
/* @__PURE__ */ jsx(TextAlignButton, { align: "justify" })
|
|
205
|
-
] })
|
|
206
|
-
] })
|
|
207
|
-
}
|
|
208
|
-
)
|
|
209
|
-
] }) })
|
|
210
|
-
] });
|
|
211
|
-
}
|
|
212
|
-
function canMoreOptions(editor) {
|
|
213
|
-
if (!editor) {
|
|
214
|
-
return false;
|
|
215
|
-
}
|
|
216
|
-
const canTextAlignAny = ["left", "center", "right", "justify"].some(
|
|
217
|
-
(align) => canSetTextAlign(editor, align)
|
|
218
|
-
);
|
|
219
|
-
const canMarkAny = ["superscript", "subscript"].some(
|
|
220
|
-
(type) => canToggleMark(editor, type)
|
|
221
|
-
);
|
|
222
|
-
return canMarkAny || canTextAlignAny;
|
|
223
|
-
}
|
|
224
|
-
function shouldShowMoreOptions(params) {
|
|
225
|
-
const { editor, hideWhenUnavailable } = params;
|
|
226
|
-
if (!editor) {
|
|
227
|
-
return false;
|
|
228
|
-
}
|
|
229
|
-
if (hideWhenUnavailable && !editor.isActive("code")) {
|
|
230
|
-
return canMoreOptions(editor);
|
|
231
|
-
}
|
|
232
|
-
return Boolean(editor == null ? void 0 : editor.isEditable);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
export {
|
|
236
|
-
EditorHeader,
|
|
237
|
-
MoreOptions
|
|
238
|
-
};
|