@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-7FDDRVUE.mjs
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useTiptapEditor
|
|
4
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
5
|
-
|
|
6
|
-
// src/ui/reset-all-formatting-button/use-reset-all-formatting.ts
|
|
7
|
-
import { RotateCcwIcon } from "@kopexa/icons";
|
|
8
|
-
import { useIsMobile } from "@kopexa/use-is-mobile";
|
|
9
|
-
import * as React from "react";
|
|
10
|
-
import { useHotkeys } from "react-hotkeys-hook";
|
|
11
|
-
var RESET_ALL_FORMATTING_SHORTCUT_KEY = "mod+r";
|
|
12
|
-
function removeAllMarksExcept(tr, skip = []) {
|
|
13
|
-
const { selection } = tr;
|
|
14
|
-
const { empty, ranges } = selection;
|
|
15
|
-
if (empty) return tr;
|
|
16
|
-
ranges.forEach((range) => {
|
|
17
|
-
const from = range.$from.pos;
|
|
18
|
-
const to = range.$to.pos;
|
|
19
|
-
tr.doc.nodesBetween(from, to, (node, pos) => {
|
|
20
|
-
if (!node.isInline) return true;
|
|
21
|
-
node.marks.forEach((mark) => {
|
|
22
|
-
if (!skip.includes(mark.type.name)) {
|
|
23
|
-
tr.removeMark(pos, pos + node.nodeSize, mark.type);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
return true;
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
return tr;
|
|
30
|
-
}
|
|
31
|
-
function canResetMarks(tr, skip = []) {
|
|
32
|
-
const { selection } = tr;
|
|
33
|
-
const { empty, ranges } = selection;
|
|
34
|
-
if (empty) return false;
|
|
35
|
-
for (const range of ranges) {
|
|
36
|
-
const from = range.$from.pos;
|
|
37
|
-
const to = range.$to.pos;
|
|
38
|
-
let hasRemovableMarks = false;
|
|
39
|
-
tr.doc.nodesBetween(from, to, (node) => {
|
|
40
|
-
if (!node.isInline) return true;
|
|
41
|
-
for (const mark of node.marks) {
|
|
42
|
-
if (!skip.includes(mark.type.name)) {
|
|
43
|
-
hasRemovableMarks = true;
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return true;
|
|
48
|
-
});
|
|
49
|
-
if (hasRemovableMarks) {
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
function canResetFormatting(editor, preserveMarks) {
|
|
56
|
-
if (!editor || !editor.isEditable) return false;
|
|
57
|
-
const tr = editor.state.tr;
|
|
58
|
-
return canResetMarks(tr, preserveMarks);
|
|
59
|
-
}
|
|
60
|
-
function resetFormatting(editor, preserveMarks) {
|
|
61
|
-
if (!editor || !editor.isEditable) return false;
|
|
62
|
-
try {
|
|
63
|
-
const { view, state } = editor;
|
|
64
|
-
const { tr } = state;
|
|
65
|
-
const transaction = removeAllMarksExcept(tr, preserveMarks);
|
|
66
|
-
view.dispatch(transaction);
|
|
67
|
-
editor.commands.focus();
|
|
68
|
-
return true;
|
|
69
|
-
} catch {
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
function shouldShowButton(props) {
|
|
74
|
-
const { editor, hideWhenUnavailable, preserveMarks } = props;
|
|
75
|
-
if (!editor || !editor.isEditable) return false;
|
|
76
|
-
if (hideWhenUnavailable && !editor.isActive("code")) {
|
|
77
|
-
return canResetFormatting(editor, preserveMarks);
|
|
78
|
-
}
|
|
79
|
-
return true;
|
|
80
|
-
}
|
|
81
|
-
function useResetAllFormatting(config) {
|
|
82
|
-
const {
|
|
83
|
-
editor: providedEditor,
|
|
84
|
-
preserveMarks,
|
|
85
|
-
hideWhenUnavailable = false,
|
|
86
|
-
onResetAllFormatting
|
|
87
|
-
} = config || {};
|
|
88
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
89
|
-
const isMobile = useIsMobile();
|
|
90
|
-
const [isVisible, setIsVisible] = React.useState(true);
|
|
91
|
-
const canReset = canResetFormatting(editor, preserveMarks);
|
|
92
|
-
React.useEffect(() => {
|
|
93
|
-
if (!editor) return;
|
|
94
|
-
const handleSelectionUpdate = () => {
|
|
95
|
-
setIsVisible(
|
|
96
|
-
shouldShowButton({ editor, hideWhenUnavailable, preserveMarks })
|
|
97
|
-
);
|
|
98
|
-
};
|
|
99
|
-
handleSelectionUpdate();
|
|
100
|
-
editor.on("selectionUpdate", handleSelectionUpdate);
|
|
101
|
-
return () => {
|
|
102
|
-
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
103
|
-
};
|
|
104
|
-
}, [editor, hideWhenUnavailable, preserveMarks]);
|
|
105
|
-
const handleResetFormatting = React.useCallback(() => {
|
|
106
|
-
if (!editor) return false;
|
|
107
|
-
const success = resetFormatting(editor, preserveMarks);
|
|
108
|
-
if (success) {
|
|
109
|
-
onResetAllFormatting == null ? void 0 : onResetAllFormatting();
|
|
110
|
-
}
|
|
111
|
-
return success;
|
|
112
|
-
}, [editor, onResetAllFormatting, preserveMarks]);
|
|
113
|
-
useHotkeys(
|
|
114
|
-
RESET_ALL_FORMATTING_SHORTCUT_KEY,
|
|
115
|
-
(event) => {
|
|
116
|
-
event.preventDefault();
|
|
117
|
-
handleResetFormatting();
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
enabled: isVisible && canReset,
|
|
121
|
-
enableOnContentEditable: !isMobile,
|
|
122
|
-
enableOnFormTags: true
|
|
123
|
-
}
|
|
124
|
-
);
|
|
125
|
-
return {
|
|
126
|
-
isVisible,
|
|
127
|
-
handleResetFormatting,
|
|
128
|
-
canReset,
|
|
129
|
-
label: "Reset formatting",
|
|
130
|
-
shortcutKeys: RESET_ALL_FORMATTING_SHORTCUT_KEY,
|
|
131
|
-
Icon: RotateCcwIcon
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export {
|
|
136
|
-
RESET_ALL_FORMATTING_SHORTCUT_KEY,
|
|
137
|
-
removeAllMarksExcept,
|
|
138
|
-
canResetMarks,
|
|
139
|
-
canResetFormatting,
|
|
140
|
-
resetFormatting,
|
|
141
|
-
shouldShowButton,
|
|
142
|
-
useResetAllFormatting
|
|
143
|
-
};
|
package/dist/chunk-7VGROP26.mjs
DELETED
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useLinkPopover
|
|
4
|
-
} from "./chunk-VTKJPVNM.mjs";
|
|
5
|
-
import {
|
|
6
|
-
useTiptapEditor
|
|
7
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
8
|
-
|
|
9
|
-
// src/ui/link-popover/link-popover.tsx
|
|
10
|
-
import { IconButton } from "@kopexa/button";
|
|
11
|
-
import {
|
|
12
|
-
CheckIcon,
|
|
13
|
-
EditIcon,
|
|
14
|
-
ExternalLinkIcon,
|
|
15
|
-
LinkIcon,
|
|
16
|
-
TrashIcon
|
|
17
|
-
} from "@kopexa/icons";
|
|
18
|
-
import { Input } from "@kopexa/input";
|
|
19
|
-
import { Popover } from "@kopexa/popover";
|
|
20
|
-
import { ToolbarButton } from "@kopexa/toolbar";
|
|
21
|
-
import { useCallback, useEffect, useState } from "react";
|
|
22
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
|
-
var LinkButton = ({ className, children, ...props }) => {
|
|
24
|
-
return /* @__PURE__ */ jsx(
|
|
25
|
-
ToolbarButton,
|
|
26
|
-
{
|
|
27
|
-
type: "button",
|
|
28
|
-
className,
|
|
29
|
-
variant: "ghost",
|
|
30
|
-
color: "default",
|
|
31
|
-
tabIndex: -1,
|
|
32
|
-
"aria-label": "Link",
|
|
33
|
-
title: "Link",
|
|
34
|
-
isIconOnly: !children,
|
|
35
|
-
...props,
|
|
36
|
-
children: children || /* @__PURE__ */ jsx(LinkIcon, {})
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
var LinkMain = ({
|
|
41
|
-
url,
|
|
42
|
-
setUrl,
|
|
43
|
-
setLink,
|
|
44
|
-
removeLink,
|
|
45
|
-
openLink,
|
|
46
|
-
isActive,
|
|
47
|
-
onSave
|
|
48
|
-
}) => {
|
|
49
|
-
const [isEditing, setIsEditing] = useState(!isActive || !url);
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
setIsEditing(!isActive || !url);
|
|
52
|
-
}, [isActive, url]);
|
|
53
|
-
const handleKeyDown = (event) => {
|
|
54
|
-
if (event.key === "Enter") {
|
|
55
|
-
event.preventDefault();
|
|
56
|
-
setLink();
|
|
57
|
-
setIsEditing(false);
|
|
58
|
-
onSave == null ? void 0 : onSave();
|
|
59
|
-
} else if (event.key === "Escape") {
|
|
60
|
-
event.preventDefault();
|
|
61
|
-
setIsEditing(false);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
const handleSave = () => {
|
|
65
|
-
setLink();
|
|
66
|
-
setIsEditing(false);
|
|
67
|
-
onSave == null ? void 0 : onSave();
|
|
68
|
-
};
|
|
69
|
-
const handleEdit = () => {
|
|
70
|
-
setIsEditing(true);
|
|
71
|
-
};
|
|
72
|
-
if (isEditing) {
|
|
73
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 min-w-[280px]", children: [
|
|
74
|
-
/* @__PURE__ */ jsx(
|
|
75
|
-
Input,
|
|
76
|
-
{
|
|
77
|
-
type: "url",
|
|
78
|
-
placeholder: "Enter URL...",
|
|
79
|
-
value: url,
|
|
80
|
-
onChange: (e) => setUrl(e.target.value),
|
|
81
|
-
onKeyDown: handleKeyDown,
|
|
82
|
-
autoComplete: "off",
|
|
83
|
-
autoCorrect: "off",
|
|
84
|
-
autoCapitalize: "off",
|
|
85
|
-
className: "flex-1 h-8 text-sm",
|
|
86
|
-
autoFocus: true
|
|
87
|
-
}
|
|
88
|
-
),
|
|
89
|
-
/* @__PURE__ */ jsx(
|
|
90
|
-
IconButton,
|
|
91
|
-
{
|
|
92
|
-
type: "button",
|
|
93
|
-
size: "sm",
|
|
94
|
-
variant: "ghost",
|
|
95
|
-
onClick: handleSave,
|
|
96
|
-
"aria-label": "Save link",
|
|
97
|
-
disabled: !url,
|
|
98
|
-
children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" })
|
|
99
|
-
}
|
|
100
|
-
)
|
|
101
|
-
] });
|
|
102
|
-
}
|
|
103
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 min-w-[280px]", children: [
|
|
104
|
-
/* @__PURE__ */ jsx(
|
|
105
|
-
"a",
|
|
106
|
-
{
|
|
107
|
-
href: url,
|
|
108
|
-
target: "_blank",
|
|
109
|
-
rel: "noopener noreferrer",
|
|
110
|
-
className: "flex-1 text-sm text-primary truncate max-w-[200px] hover:underline px-2",
|
|
111
|
-
onClick: (e) => {
|
|
112
|
-
e.preventDefault();
|
|
113
|
-
openLink();
|
|
114
|
-
},
|
|
115
|
-
children: url
|
|
116
|
-
}
|
|
117
|
-
),
|
|
118
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5 border-l pl-1 ml-1", children: [
|
|
119
|
-
/* @__PURE__ */ jsx(
|
|
120
|
-
IconButton,
|
|
121
|
-
{
|
|
122
|
-
type: "button",
|
|
123
|
-
size: "sm",
|
|
124
|
-
variant: "ghost",
|
|
125
|
-
onClick: openLink,
|
|
126
|
-
"aria-label": "Open link in new tab",
|
|
127
|
-
children: /* @__PURE__ */ jsx(ExternalLinkIcon, { className: "size-4" })
|
|
128
|
-
}
|
|
129
|
-
),
|
|
130
|
-
/* @__PURE__ */ jsx(
|
|
131
|
-
IconButton,
|
|
132
|
-
{
|
|
133
|
-
type: "button",
|
|
134
|
-
size: "sm",
|
|
135
|
-
variant: "ghost",
|
|
136
|
-
onClick: handleEdit,
|
|
137
|
-
"aria-label": "Edit link",
|
|
138
|
-
children: /* @__PURE__ */ jsx(EditIcon, { className: "size-4" })
|
|
139
|
-
}
|
|
140
|
-
),
|
|
141
|
-
/* @__PURE__ */ jsx(
|
|
142
|
-
IconButton,
|
|
143
|
-
{
|
|
144
|
-
type: "button",
|
|
145
|
-
size: "sm",
|
|
146
|
-
variant: "ghost",
|
|
147
|
-
onClick: removeLink,
|
|
148
|
-
"aria-label": "Remove link",
|
|
149
|
-
children: /* @__PURE__ */ jsx(TrashIcon, { className: "size-4" })
|
|
150
|
-
}
|
|
151
|
-
)
|
|
152
|
-
] })
|
|
153
|
-
] });
|
|
154
|
-
};
|
|
155
|
-
var LinkContent = ({ editor }) => {
|
|
156
|
-
const linkPopover = useLinkPopover({
|
|
157
|
-
editor
|
|
158
|
-
});
|
|
159
|
-
return /* @__PURE__ */ jsx(LinkMain, { ...linkPopover });
|
|
160
|
-
};
|
|
161
|
-
function LinkPopover({
|
|
162
|
-
editor: providedEditor,
|
|
163
|
-
hideWhenUnavailable = false,
|
|
164
|
-
onSetLink,
|
|
165
|
-
onOpenChange,
|
|
166
|
-
autoOpenOnLinkActive = true,
|
|
167
|
-
onClick,
|
|
168
|
-
children,
|
|
169
|
-
...buttonProps
|
|
170
|
-
}) {
|
|
171
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
172
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
173
|
-
const {
|
|
174
|
-
isVisible,
|
|
175
|
-
canSet,
|
|
176
|
-
isActive,
|
|
177
|
-
url,
|
|
178
|
-
setUrl,
|
|
179
|
-
setLink,
|
|
180
|
-
removeLink,
|
|
181
|
-
openLink,
|
|
182
|
-
label
|
|
183
|
-
} = useLinkPopover({
|
|
184
|
-
editor,
|
|
185
|
-
hideWhenUnavailable,
|
|
186
|
-
onSetLink
|
|
187
|
-
});
|
|
188
|
-
const handleOnOpenChange = useCallback(
|
|
189
|
-
(nextIsOpen) => {
|
|
190
|
-
setIsOpen(nextIsOpen);
|
|
191
|
-
onOpenChange == null ? void 0 : onOpenChange(nextIsOpen);
|
|
192
|
-
},
|
|
193
|
-
[onOpenChange]
|
|
194
|
-
);
|
|
195
|
-
const handleSetLink = useCallback(() => {
|
|
196
|
-
setLink();
|
|
197
|
-
setIsOpen(false);
|
|
198
|
-
}, [setLink]);
|
|
199
|
-
const handleClick = useCallback(
|
|
200
|
-
(event) => {
|
|
201
|
-
onClick == null ? void 0 : onClick(event);
|
|
202
|
-
if (event.defaultPrevented) return;
|
|
203
|
-
setIsOpen(!isOpen);
|
|
204
|
-
},
|
|
205
|
-
[onClick, isOpen]
|
|
206
|
-
);
|
|
207
|
-
useEffect(() => {
|
|
208
|
-
if (autoOpenOnLinkActive && isActive) {
|
|
209
|
-
setIsOpen(true);
|
|
210
|
-
}
|
|
211
|
-
}, [autoOpenOnLinkActive, isActive]);
|
|
212
|
-
if (!isVisible) {
|
|
213
|
-
return null;
|
|
214
|
-
}
|
|
215
|
-
return /* @__PURE__ */ jsxs(
|
|
216
|
-
Popover.Root,
|
|
217
|
-
{
|
|
218
|
-
open: isOpen,
|
|
219
|
-
onOpenChange: handleOnOpenChange,
|
|
220
|
-
spacing: "dense",
|
|
221
|
-
children: [
|
|
222
|
-
/* @__PURE__ */ jsx(
|
|
223
|
-
Popover.Trigger,
|
|
224
|
-
{
|
|
225
|
-
render: /* @__PURE__ */ jsx(
|
|
226
|
-
LinkButton,
|
|
227
|
-
{
|
|
228
|
-
"data-disabled": !canSet,
|
|
229
|
-
disabled: !canSet,
|
|
230
|
-
"data-active-state": isActive ? "on" : "off",
|
|
231
|
-
"aria-label": label,
|
|
232
|
-
"aria-pressed": isActive,
|
|
233
|
-
onClick: handleClick,
|
|
234
|
-
...buttonProps
|
|
235
|
-
}
|
|
236
|
-
)
|
|
237
|
-
}
|
|
238
|
-
),
|
|
239
|
-
/* @__PURE__ */ jsx(Popover.Content, { children: /* @__PURE__ */ jsx(
|
|
240
|
-
LinkMain,
|
|
241
|
-
{
|
|
242
|
-
url,
|
|
243
|
-
setUrl,
|
|
244
|
-
setLink: handleSetLink,
|
|
245
|
-
removeLink,
|
|
246
|
-
openLink,
|
|
247
|
-
isActive,
|
|
248
|
-
onSave: () => setIsOpen(false)
|
|
249
|
-
}
|
|
250
|
-
) })
|
|
251
|
-
]
|
|
252
|
-
}
|
|
253
|
-
);
|
|
254
|
-
}
|
|
255
|
-
LinkButton.displayName = "LinkButton";
|
|
256
|
-
|
|
257
|
-
export {
|
|
258
|
-
LinkButton,
|
|
259
|
-
LinkMain,
|
|
260
|
-
LinkContent,
|
|
261
|
-
LinkPopover
|
|
262
|
-
};
|
package/dist/chunk-7VW67NVL.mjs
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
InlineMathView
|
|
4
|
-
} from "./chunk-BXHPO3T7.mjs";
|
|
5
|
-
|
|
6
|
-
// src/extensions/math/inline-math.ts
|
|
7
|
-
import { InputRule, mergeAttributes, Node } from "@tiptap/core";
|
|
8
|
-
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
9
|
-
var InlineMath = Node.create({
|
|
10
|
-
name: "inlineMath",
|
|
11
|
-
group: "inline",
|
|
12
|
-
inline: true,
|
|
13
|
-
atom: true,
|
|
14
|
-
addOptions() {
|
|
15
|
-
return {
|
|
16
|
-
HTMLAttributes: {}
|
|
17
|
-
};
|
|
18
|
-
},
|
|
19
|
-
addAttributes() {
|
|
20
|
-
return {
|
|
21
|
-
latex: {
|
|
22
|
-
default: "",
|
|
23
|
-
parseHTML: (element) => element.getAttribute("data-latex") || "",
|
|
24
|
-
renderHTML: (attributes) => ({
|
|
25
|
-
"data-latex": attributes.latex
|
|
26
|
-
})
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
},
|
|
30
|
-
parseHTML() {
|
|
31
|
-
return [
|
|
32
|
-
{
|
|
33
|
-
tag: 'span[data-type="inline-math"]'
|
|
34
|
-
}
|
|
35
|
-
];
|
|
36
|
-
},
|
|
37
|
-
renderHTML({ HTMLAttributes }) {
|
|
38
|
-
return [
|
|
39
|
-
"span",
|
|
40
|
-
mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
|
|
41
|
-
"data-type": "inline-math"
|
|
42
|
-
})
|
|
43
|
-
];
|
|
44
|
-
},
|
|
45
|
-
addNodeView() {
|
|
46
|
-
return ReactNodeViewRenderer(InlineMathView, {
|
|
47
|
-
as: "span"
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
addCommands() {
|
|
51
|
-
return {
|
|
52
|
-
insertInlineMath: (latex = "") => ({ commands }) => {
|
|
53
|
-
return commands.insertContent({
|
|
54
|
-
type: this.name,
|
|
55
|
-
attrs: { latex }
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
addInputRules() {
|
|
61
|
-
return [
|
|
62
|
-
// Inline math with $...$
|
|
63
|
-
new InputRule({
|
|
64
|
-
// Match $...$ but not $$...$$
|
|
65
|
-
find: /(?<!\$)\$([^$]+)\$(?!\$)/,
|
|
66
|
-
handler: ({ state, range, match }) => {
|
|
67
|
-
const latex = match[1];
|
|
68
|
-
const { tr } = state;
|
|
69
|
-
tr.replaceWith(range.from, range.to, this.type.create({ latex }));
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
];
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
var inline_math_default = InlineMath;
|
|
76
|
-
|
|
77
|
-
export {
|
|
78
|
-
InlineMath,
|
|
79
|
-
inline_math_default
|
|
80
|
-
};
|
package/dist/chunk-AAV7ZNBP.mjs
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
RESET_ALL_FORMATTING_SHORTCUT_KEY,
|
|
4
|
-
useResetAllFormatting
|
|
5
|
-
} from "./chunk-7FDDRVUE.mjs";
|
|
6
|
-
import {
|
|
7
|
-
useTiptapEditor
|
|
8
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
9
|
-
|
|
10
|
-
// src/ui/reset-all-formatting-button/reset-all-formatting-button.tsx
|
|
11
|
-
import { Button } from "@kopexa/button";
|
|
12
|
-
import { Chip } from "@kopexa/chip";
|
|
13
|
-
import { parseShortcutKeys } from "@kopexa/shared-utils";
|
|
14
|
-
import { useCallback } from "react";
|
|
15
|
-
import { jsx } from "react/jsx-runtime";
|
|
16
|
-
function ResetAllFormattingShortcutBadge({
|
|
17
|
-
shortcutKeys = RESET_ALL_FORMATTING_SHORTCUT_KEY
|
|
18
|
-
}) {
|
|
19
|
-
return /* @__PURE__ */ jsx(Chip, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
20
|
-
}
|
|
21
|
-
var ResetAllFormattingButton = ({
|
|
22
|
-
editor: providedEditor,
|
|
23
|
-
text,
|
|
24
|
-
hideWhenUnavailable = false,
|
|
25
|
-
preserveMarks = ["inlineThread"],
|
|
26
|
-
onResetAllFormatting,
|
|
27
|
-
showShortcut = false,
|
|
28
|
-
onClick,
|
|
29
|
-
children,
|
|
30
|
-
ref,
|
|
31
|
-
...buttonProps
|
|
32
|
-
}) => {
|
|
33
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
34
|
-
const {
|
|
35
|
-
isVisible,
|
|
36
|
-
canReset,
|
|
37
|
-
handleResetFormatting,
|
|
38
|
-
label,
|
|
39
|
-
shortcutKeys,
|
|
40
|
-
Icon
|
|
41
|
-
} = useResetAllFormatting({
|
|
42
|
-
editor,
|
|
43
|
-
preserveMarks,
|
|
44
|
-
hideWhenUnavailable,
|
|
45
|
-
onResetAllFormatting
|
|
46
|
-
});
|
|
47
|
-
const handleClick = useCallback(
|
|
48
|
-
(event) => {
|
|
49
|
-
onClick == null ? void 0 : onClick(event);
|
|
50
|
-
if (event.defaultPrevented) return;
|
|
51
|
-
handleResetFormatting();
|
|
52
|
-
},
|
|
53
|
-
[handleResetFormatting, onClick]
|
|
54
|
-
);
|
|
55
|
-
if (!isVisible) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
return /* @__PURE__ */ jsx(
|
|
59
|
-
Button,
|
|
60
|
-
{
|
|
61
|
-
type: "button",
|
|
62
|
-
variant: "ghost",
|
|
63
|
-
color: "default",
|
|
64
|
-
disabled: !canReset,
|
|
65
|
-
"data-disabled": !canReset,
|
|
66
|
-
"data-active-state": "off",
|
|
67
|
-
tabIndex: -1,
|
|
68
|
-
"aria-label": label,
|
|
69
|
-
tooltip: "Reset formatting",
|
|
70
|
-
onClick: handleClick,
|
|
71
|
-
startContent: /* @__PURE__ */ jsx(Icon, {}),
|
|
72
|
-
endContent: showShortcut ? /* @__PURE__ */ jsx(ResetAllFormattingShortcutBadge, { shortcutKeys }) : null,
|
|
73
|
-
...buttonProps,
|
|
74
|
-
ref,
|
|
75
|
-
children: text
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export {
|
|
81
|
-
ResetAllFormattingShortcutBadge,
|
|
82
|
-
ResetAllFormattingButton
|
|
83
|
-
};
|
package/dist/chunk-ATRHILCH.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";
|
package/dist/chunk-B7WJOQ3X.mjs
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useColorHighlight
|
|
4
|
-
} from "./chunk-UJ4BNZ63.mjs";
|
|
5
|
-
import {
|
|
6
|
-
useTiptapEditor
|
|
7
|
-
} from "./chunk-P55PLOHR.mjs";
|
|
8
|
-
|
|
9
|
-
// src/ui/color-highlight-button/color-highlight-button.tsx
|
|
10
|
-
import { colorHighlightButton } from "@kopexa/theme";
|
|
11
|
-
import { ToolbarButton } from "@kopexa/toolbar";
|
|
12
|
-
import { useCallback, useMemo } from "react";
|
|
13
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
var ColorHighlightButton = ({
|
|
15
|
-
editor: providedEditor,
|
|
16
|
-
highlightColor,
|
|
17
|
-
text,
|
|
18
|
-
hideWhenUnavailable = false,
|
|
19
|
-
onApplied,
|
|
20
|
-
showShortcut = false,
|
|
21
|
-
onClick,
|
|
22
|
-
children,
|
|
23
|
-
style,
|
|
24
|
-
className,
|
|
25
|
-
...buttonProps
|
|
26
|
-
}) => {
|
|
27
|
-
const { editor } = useTiptapEditor(providedEditor);
|
|
28
|
-
const {
|
|
29
|
-
isVisible,
|
|
30
|
-
canColorHighlight,
|
|
31
|
-
isActive,
|
|
32
|
-
handleColorHighlight,
|
|
33
|
-
label,
|
|
34
|
-
shortcutKeys
|
|
35
|
-
} = useColorHighlight({
|
|
36
|
-
editor,
|
|
37
|
-
highlightColor,
|
|
38
|
-
label: text || `Toggle highlight (${highlightColor})`,
|
|
39
|
-
hideWhenUnavailable,
|
|
40
|
-
onApplied
|
|
41
|
-
});
|
|
42
|
-
const handleClick = useCallback(
|
|
43
|
-
(event) => {
|
|
44
|
-
onClick == null ? void 0 : onClick(event);
|
|
45
|
-
if (event.defaultPrevented) return;
|
|
46
|
-
handleColorHighlight();
|
|
47
|
-
},
|
|
48
|
-
[handleColorHighlight, onClick]
|
|
49
|
-
);
|
|
50
|
-
const buttonStyle = useMemo(
|
|
51
|
-
() => ({
|
|
52
|
-
...style,
|
|
53
|
-
"--highlight-color": highlightColor
|
|
54
|
-
}),
|
|
55
|
-
[highlightColor, style]
|
|
56
|
-
);
|
|
57
|
-
if (!isVisible) {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
const styles = colorHighlightButton();
|
|
61
|
-
return /* @__PURE__ */ jsxs(
|
|
62
|
-
ToolbarButton,
|
|
63
|
-
{
|
|
64
|
-
type: "button",
|
|
65
|
-
disabled: !canColorHighlight,
|
|
66
|
-
"data-disabled": !canColorHighlight,
|
|
67
|
-
variant: "ghost",
|
|
68
|
-
color: "default",
|
|
69
|
-
"data-active-state": isActive ? "on" : "off",
|
|
70
|
-
tabIndex: -1,
|
|
71
|
-
"aria-label": label,
|
|
72
|
-
shortcutKeys,
|
|
73
|
-
"aria-pressed": isActive,
|
|
74
|
-
onClick: handleClick,
|
|
75
|
-
style: buttonStyle,
|
|
76
|
-
className: styles.button({ className }),
|
|
77
|
-
isIconOnly: true,
|
|
78
|
-
...buttonProps,
|
|
79
|
-
children: [
|
|
80
|
-
/* @__PURE__ */ jsx(
|
|
81
|
-
"span",
|
|
82
|
-
{
|
|
83
|
-
"data-active-state": isActive ? "on" : "off",
|
|
84
|
-
className: styles.mark()
|
|
85
|
-
}
|
|
86
|
-
),
|
|
87
|
-
children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
88
|
-
/* @__PURE__ */ jsx(
|
|
89
|
-
"span",
|
|
90
|
-
{
|
|
91
|
-
style: { "--highlight-color": highlightColor }
|
|
92
|
-
}
|
|
93
|
-
),
|
|
94
|
-
text
|
|
95
|
-
] })
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
|
-
);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export {
|
|
102
|
-
ColorHighlightButton
|
|
103
|
-
};
|