@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
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
"use client";
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
-
|
|
22
|
-
// src/extensions/image/image-view.tsx
|
|
23
|
-
var image_view_exports = {};
|
|
24
|
-
__export(image_view_exports, {
|
|
25
|
-
ImageNodeView: () => ImageNodeView,
|
|
26
|
-
default: () => image_view_default
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(image_view_exports);
|
|
29
|
-
var import_button = require("@kopexa/button");
|
|
30
|
-
var import_icons = require("@kopexa/icons");
|
|
31
|
-
var import_theme = require("@kopexa/theme");
|
|
32
|
-
var import_react2 = require("@tiptap/react");
|
|
33
|
-
var import_react3 = require("react");
|
|
34
|
-
var import_react_intl2 = require("react-intl");
|
|
35
|
-
|
|
36
|
-
// src/context/editor-file-context.tsx
|
|
37
|
-
var import_react = require("react");
|
|
38
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
-
var EditorFileContext = (0, import_react.createContext)(null);
|
|
40
|
-
var DEFAULT_CACHE_BUFFER = 2 * 60 * 1e3;
|
|
41
|
-
var DEFAULT_CACHE_TTL = 10 * 60 * 1e3;
|
|
42
|
-
function useEditorFile() {
|
|
43
|
-
return (0, import_react.useContext)(EditorFileContext);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// src/extensions/image/messages.ts
|
|
47
|
-
var import_react_intl = require("react-intl");
|
|
48
|
-
var messages = (0, import_react_intl.defineMessages)({
|
|
49
|
-
loading: {
|
|
50
|
-
id: "editor.image.loading",
|
|
51
|
-
defaultMessage: "Loading image..."
|
|
52
|
-
},
|
|
53
|
-
uploading: {
|
|
54
|
-
id: "editor.image.uploading",
|
|
55
|
-
defaultMessage: "Uploading..."
|
|
56
|
-
},
|
|
57
|
-
error: {
|
|
58
|
-
id: "editor.image.error",
|
|
59
|
-
defaultMessage: "Failed to load image"
|
|
60
|
-
},
|
|
61
|
-
upload_error: {
|
|
62
|
-
id: "editor.image.upload_error",
|
|
63
|
-
defaultMessage: "Failed to upload image"
|
|
64
|
-
},
|
|
65
|
-
retry: {
|
|
66
|
-
id: "editor.image.retry",
|
|
67
|
-
defaultMessage: "Retry"
|
|
68
|
-
},
|
|
69
|
-
remove: {
|
|
70
|
-
id: "editor.image.remove",
|
|
71
|
-
defaultMessage: "Remove"
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
// src/extensions/image/image-view.tsx
|
|
76
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
77
|
-
function ImageNodeView({ editor, node, getPos }) {
|
|
78
|
-
var _a;
|
|
79
|
-
const intl = (0, import_react_intl2.useIntl)();
|
|
80
|
-
const fileHandler = useEditorFile();
|
|
81
|
-
const { src, alt, title, uploadState, uploadProgress } = node.attrs;
|
|
82
|
-
const isEditable = (0, import_react2.useEditorState)({
|
|
83
|
-
editor,
|
|
84
|
-
selector: ({ editor: e }) => {
|
|
85
|
-
var _a2;
|
|
86
|
-
return (_a2 = e == null ? void 0 : e.isEditable) != null ? _a2 : false;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
const [resolvedUrl, setResolvedUrl] = (0, import_react3.useState)(null);
|
|
90
|
-
const [resolveState, setResolveState] = (0, import_react3.useState)("idle");
|
|
91
|
-
const needsResolve = (_a = fileHandler == null ? void 0 : fileHandler.isReference(src)) != null ? _a : false;
|
|
92
|
-
const resolveImage = (0, import_react3.useCallback)(async () => {
|
|
93
|
-
if (!src) return;
|
|
94
|
-
if (!needsResolve) {
|
|
95
|
-
setResolvedUrl(src);
|
|
96
|
-
setResolveState("resolved");
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
if (!fileHandler) {
|
|
100
|
-
setResolvedUrl(src);
|
|
101
|
-
setResolveState("resolved");
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
setResolveState("loading");
|
|
105
|
-
try {
|
|
106
|
-
const url = await fileHandler.resolve(src);
|
|
107
|
-
setResolvedUrl(url);
|
|
108
|
-
setResolveState("resolved");
|
|
109
|
-
} catch {
|
|
110
|
-
setResolveState("error");
|
|
111
|
-
}
|
|
112
|
-
}, [src, needsResolve, fileHandler]);
|
|
113
|
-
(0, import_react3.useEffect)(() => {
|
|
114
|
-
resolveImage();
|
|
115
|
-
}, [resolveImage]);
|
|
116
|
-
const handleRetry = (0, import_react3.useCallback)(() => {
|
|
117
|
-
resolveImage();
|
|
118
|
-
}, [resolveImage]);
|
|
119
|
-
const handleRemove = (0, import_react3.useCallback)(() => {
|
|
120
|
-
const pos = getPos();
|
|
121
|
-
if (pos === void 0) return;
|
|
122
|
-
editor.commands.deleteRange({
|
|
123
|
-
from: pos,
|
|
124
|
-
to: pos + node.nodeSize
|
|
125
|
-
});
|
|
126
|
-
}, [editor, getPos, node.nodeSize]);
|
|
127
|
-
const errorStyles = (0, import_react3.useMemo)(
|
|
128
|
-
() => (0, import_theme.imagePlaceholder)({ size: "md", variant: "error" }),
|
|
129
|
-
[]
|
|
130
|
-
);
|
|
131
|
-
const loadingStyles = (0, import_react3.useMemo)(
|
|
132
|
-
() => (0, import_theme.imagePlaceholder)({ size: "md", variant: "uploading" }),
|
|
133
|
-
[]
|
|
134
|
-
);
|
|
135
|
-
if (uploadState === "uploading") {
|
|
136
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.NodeViewWrapper, { className: "my-4", "data-type": "image", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: loadingStyles.root(), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: loadingStyles.content(), children: [
|
|
137
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "relative size-12", children: [
|
|
138
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
139
|
-
"svg",
|
|
140
|
-
{
|
|
141
|
-
className: "size-12 -rotate-90",
|
|
142
|
-
viewBox: "0 0 36 36",
|
|
143
|
-
"aria-hidden": "true",
|
|
144
|
-
children: [
|
|
145
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
146
|
-
"circle",
|
|
147
|
-
{
|
|
148
|
-
cx: "18",
|
|
149
|
-
cy: "18",
|
|
150
|
-
r: "16",
|
|
151
|
-
fill: "none",
|
|
152
|
-
className: "stroke-muted",
|
|
153
|
-
strokeWidth: "2"
|
|
154
|
-
}
|
|
155
|
-
),
|
|
156
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
157
|
-
"circle",
|
|
158
|
-
{
|
|
159
|
-
cx: "18",
|
|
160
|
-
cy: "18",
|
|
161
|
-
r: "16",
|
|
162
|
-
fill: "none",
|
|
163
|
-
className: "stroke-primary",
|
|
164
|
-
strokeWidth: "2",
|
|
165
|
-
strokeDasharray: 100,
|
|
166
|
-
strokeDashoffset: 100 - (uploadProgress != null ? uploadProgress : 0),
|
|
167
|
-
strokeLinecap: "round"
|
|
168
|
-
}
|
|
169
|
-
)
|
|
170
|
-
]
|
|
171
|
-
}
|
|
172
|
-
),
|
|
173
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "absolute inset-0 flex items-center justify-center text-xs font-medium", children: [
|
|
174
|
-
uploadProgress != null ? uploadProgress : 0,
|
|
175
|
-
"%"
|
|
176
|
-
] })
|
|
177
|
-
] }),
|
|
178
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: loadingStyles.text(), children: intl.formatMessage(messages.uploading) })
|
|
179
|
-
] }) }) });
|
|
180
|
-
}
|
|
181
|
-
if (uploadState === "error") {
|
|
182
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.NodeViewWrapper, { className: "my-4", "data-type": "image", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: errorStyles.root(), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: errorStyles.content(), children: [
|
|
183
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons.AlertCircleIcon, { className: errorStyles.icon() }),
|
|
184
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: errorStyles.text(), children: intl.formatMessage(messages.upload_error) }),
|
|
185
|
-
isEditable && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
186
|
-
import_button.IconButton,
|
|
187
|
-
{
|
|
188
|
-
size: "sm",
|
|
189
|
-
variant: "ghost",
|
|
190
|
-
onClick: handleRemove,
|
|
191
|
-
"aria-label": intl.formatMessage(messages.remove),
|
|
192
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons.TrashIcon, { className: "size-4" })
|
|
193
|
-
}
|
|
194
|
-
)
|
|
195
|
-
] }) }) });
|
|
196
|
-
}
|
|
197
|
-
if (resolveState === "loading") {
|
|
198
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.NodeViewWrapper, { className: "my-4", "data-type": "image", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: `${loadingStyles.root()} animate-pulse`, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: loadingStyles.text(), children: intl.formatMessage(messages.loading) }) }) });
|
|
199
|
-
}
|
|
200
|
-
if (resolveState === "error") {
|
|
201
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.NodeViewWrapper, { className: "my-4", "data-type": "image", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: errorStyles.root(), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: errorStyles.content(), children: [
|
|
202
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons.AlertCircleIcon, { className: errorStyles.icon() }),
|
|
203
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: errorStyles.text(), children: intl.formatMessage(messages.error) }),
|
|
204
|
-
isEditable && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex gap-2", children: [
|
|
205
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
206
|
-
import_button.IconButton,
|
|
207
|
-
{
|
|
208
|
-
size: "sm",
|
|
209
|
-
variant: "outline",
|
|
210
|
-
onClick: handleRetry,
|
|
211
|
-
"aria-label": intl.formatMessage(messages.retry),
|
|
212
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons.ArrowCounterClockwiseIcon, { className: "size-4" })
|
|
213
|
-
}
|
|
214
|
-
),
|
|
215
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
216
|
-
import_button.IconButton,
|
|
217
|
-
{
|
|
218
|
-
size: "sm",
|
|
219
|
-
variant: "ghost",
|
|
220
|
-
onClick: handleRemove,
|
|
221
|
-
"aria-label": intl.formatMessage(messages.remove),
|
|
222
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons.TrashIcon, { className: "size-4" })
|
|
223
|
-
}
|
|
224
|
-
)
|
|
225
|
-
] })
|
|
226
|
-
] }) }) });
|
|
227
|
-
}
|
|
228
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react2.NodeViewWrapper, { className: "my-4 relative group", "data-type": "image", children: [
|
|
229
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
230
|
-
"img",
|
|
231
|
-
{
|
|
232
|
-
src: resolvedUrl != null ? resolvedUrl : src,
|
|
233
|
-
alt: alt != null ? alt : "",
|
|
234
|
-
title: title != null ? title : void 0,
|
|
235
|
-
className: "max-w-full h-auto rounded-lg",
|
|
236
|
-
draggable: false
|
|
237
|
-
}
|
|
238
|
-
),
|
|
239
|
-
isEditable && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity flex gap-1", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
240
|
-
import_button.IconButton,
|
|
241
|
-
{
|
|
242
|
-
size: "sm",
|
|
243
|
-
variant: "outline",
|
|
244
|
-
onClick: handleRemove,
|
|
245
|
-
"aria-label": intl.formatMessage(messages.remove),
|
|
246
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons.TrashIcon, { className: "size-3.5" })
|
|
247
|
-
}
|
|
248
|
-
) })
|
|
249
|
-
] });
|
|
250
|
-
}
|
|
251
|
-
var image_view_default = ImageNodeView;
|
|
252
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
253
|
-
0 && (module.exports = {
|
|
254
|
-
ImageNodeView
|
|
255
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
import {
|
|
4
|
-
ImageNodeView,
|
|
5
|
-
image_view_default
|
|
6
|
-
} from "../../chunk-KYLBKQ2E.mjs";
|
|
7
|
-
import "../../chunk-Z365KVQY.mjs";
|
|
8
|
-
import "../../chunk-VRQ6OSAZ.mjs";
|
|
9
|
-
export {
|
|
10
|
-
ImageNodeView,
|
|
11
|
-
image_view_default as default
|
|
12
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as _tiptap_core from '@tiptap/core';
|
|
2
|
-
export { default as ImageNodeView } from './image-view.mjs';
|
|
3
|
-
export { messages as imageMessages } from './messages.mjs';
|
|
4
|
-
import 'react/jsx-runtime';
|
|
5
|
-
import '@tiptap/react';
|
|
6
|
-
|
|
7
|
-
interface ImageNodeOptions {
|
|
8
|
-
/**
|
|
9
|
-
* Whether to allow base64 images
|
|
10
|
-
* @default true
|
|
11
|
-
*/
|
|
12
|
-
allowBase64: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* HTML attributes to add to the image element
|
|
15
|
-
*/
|
|
16
|
-
HTMLAttributes: Record<string, unknown>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Extended Image extension with file reference resolution support
|
|
20
|
-
*
|
|
21
|
-
* This extension wraps @tiptap/extension-image and adds:
|
|
22
|
-
* - File reference resolution via EditorFileProvider
|
|
23
|
-
* - Loading states while resolving URLs
|
|
24
|
-
* - Error handling for failed resolution
|
|
25
|
-
* - Upload state tracking for drag & drop uploads
|
|
26
|
-
*/
|
|
27
|
-
declare const ImageNode: _tiptap_core.Node<ImageNodeOptions, any>;
|
|
28
|
-
|
|
29
|
-
export { ImageNode, type ImageNodeOptions };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as _tiptap_core from '@tiptap/core';
|
|
2
|
-
export { default as ImageNodeView } from './image-view.js';
|
|
3
|
-
export { messages as imageMessages } from './messages.js';
|
|
4
|
-
import 'react/jsx-runtime';
|
|
5
|
-
import '@tiptap/react';
|
|
6
|
-
|
|
7
|
-
interface ImageNodeOptions {
|
|
8
|
-
/**
|
|
9
|
-
* Whether to allow base64 images
|
|
10
|
-
* @default true
|
|
11
|
-
*/
|
|
12
|
-
allowBase64: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* HTML attributes to add to the image element
|
|
15
|
-
*/
|
|
16
|
-
HTMLAttributes: Record<string, unknown>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Extended Image extension with file reference resolution support
|
|
20
|
-
*
|
|
21
|
-
* This extension wraps @tiptap/extension-image and adds:
|
|
22
|
-
* - File reference resolution via EditorFileProvider
|
|
23
|
-
* - Loading states while resolving URLs
|
|
24
|
-
* - Error handling for failed resolution
|
|
25
|
-
* - Upload state tracking for drag & drop uploads
|
|
26
|
-
*/
|
|
27
|
-
declare const ImageNode: _tiptap_core.Node<ImageNodeOptions, any>;
|
|
28
|
-
|
|
29
|
-
export { ImageNode, type ImageNodeOptions };
|
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/extensions/image/index.ts
|
|
22
|
-
var image_exports = {};
|
|
23
|
-
__export(image_exports, {
|
|
24
|
-
ImageNode: () => ImageNode,
|
|
25
|
-
ImageNodeView: () => ImageNodeView,
|
|
26
|
-
imageMessages: () => messages
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(image_exports);
|
|
29
|
-
var import_extension_image = require("@tiptap/extension-image");
|
|
30
|
-
var import_react4 = require("@tiptap/react");
|
|
31
|
-
|
|
32
|
-
// src/extensions/image/image-view.tsx
|
|
33
|
-
var import_button = require("@kopexa/button");
|
|
34
|
-
var import_icons = require("@kopexa/icons");
|
|
35
|
-
var import_theme = require("@kopexa/theme");
|
|
36
|
-
var import_react2 = require("@tiptap/react");
|
|
37
|
-
var import_react3 = require("react");
|
|
38
|
-
var import_react_intl2 = require("react-intl");
|
|
39
|
-
|
|
40
|
-
// src/context/editor-file-context.tsx
|
|
41
|
-
var import_react = require("react");
|
|
42
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
|
-
var EditorFileContext = (0, import_react.createContext)(null);
|
|
44
|
-
var DEFAULT_CACHE_BUFFER = 2 * 60 * 1e3;
|
|
45
|
-
var DEFAULT_CACHE_TTL = 10 * 60 * 1e3;
|
|
46
|
-
function useEditorFile() {
|
|
47
|
-
return (0, import_react.useContext)(EditorFileContext);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// src/extensions/image/messages.ts
|
|
51
|
-
var import_react_intl = require("react-intl");
|
|
52
|
-
var messages = (0, import_react_intl.defineMessages)({
|
|
53
|
-
loading: {
|
|
54
|
-
id: "editor.image.loading",
|
|
55
|
-
defaultMessage: "Loading image..."
|
|
56
|
-
},
|
|
57
|
-
uploading: {
|
|
58
|
-
id: "editor.image.uploading",
|
|
59
|
-
defaultMessage: "Uploading..."
|
|
60
|
-
},
|
|
61
|
-
error: {
|
|
62
|
-
id: "editor.image.error",
|
|
63
|
-
defaultMessage: "Failed to load image"
|
|
64
|
-
},
|
|
65
|
-
upload_error: {
|
|
66
|
-
id: "editor.image.upload_error",
|
|
67
|
-
defaultMessage: "Failed to upload image"
|
|
68
|
-
},
|
|
69
|
-
retry: {
|
|
70
|
-
id: "editor.image.retry",
|
|
71
|
-
defaultMessage: "Retry"
|
|
72
|
-
},
|
|
73
|
-
remove: {
|
|
74
|
-
id: "editor.image.remove",
|
|
75
|
-
defaultMessage: "Remove"
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
// src/extensions/image/image-view.tsx
|
|
80
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
81
|
-
function ImageNodeView({ editor, node, getPos }) {
|
|
82
|
-
var _a;
|
|
83
|
-
const intl = (0, import_react_intl2.useIntl)();
|
|
84
|
-
const fileHandler = useEditorFile();
|
|
85
|
-
const { src, alt, title, uploadState, uploadProgress } = node.attrs;
|
|
86
|
-
const isEditable = (0, import_react2.useEditorState)({
|
|
87
|
-
editor,
|
|
88
|
-
selector: ({ editor: e }) => {
|
|
89
|
-
var _a2;
|
|
90
|
-
return (_a2 = e == null ? void 0 : e.isEditable) != null ? _a2 : false;
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
const [resolvedUrl, setResolvedUrl] = (0, import_react3.useState)(null);
|
|
94
|
-
const [resolveState, setResolveState] = (0, import_react3.useState)("idle");
|
|
95
|
-
const needsResolve = (_a = fileHandler == null ? void 0 : fileHandler.isReference(src)) != null ? _a : false;
|
|
96
|
-
const resolveImage = (0, import_react3.useCallback)(async () => {
|
|
97
|
-
if (!src) return;
|
|
98
|
-
if (!needsResolve) {
|
|
99
|
-
setResolvedUrl(src);
|
|
100
|
-
setResolveState("resolved");
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
if (!fileHandler) {
|
|
104
|
-
setResolvedUrl(src);
|
|
105
|
-
setResolveState("resolved");
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
setResolveState("loading");
|
|
109
|
-
try {
|
|
110
|
-
const url = await fileHandler.resolve(src);
|
|
111
|
-
setResolvedUrl(url);
|
|
112
|
-
setResolveState("resolved");
|
|
113
|
-
} catch {
|
|
114
|
-
setResolveState("error");
|
|
115
|
-
}
|
|
116
|
-
}, [src, needsResolve, fileHandler]);
|
|
117
|
-
(0, import_react3.useEffect)(() => {
|
|
118
|
-
resolveImage();
|
|
119
|
-
}, [resolveImage]);
|
|
120
|
-
const handleRetry = (0, import_react3.useCallback)(() => {
|
|
121
|
-
resolveImage();
|
|
122
|
-
}, [resolveImage]);
|
|
123
|
-
const handleRemove = (0, import_react3.useCallback)(() => {
|
|
124
|
-
const pos = getPos();
|
|
125
|
-
if (pos === void 0) return;
|
|
126
|
-
editor.commands.deleteRange({
|
|
127
|
-
from: pos,
|
|
128
|
-
to: pos + node.nodeSize
|
|
129
|
-
});
|
|
130
|
-
}, [editor, getPos, node.nodeSize]);
|
|
131
|
-
const errorStyles = (0, import_react3.useMemo)(
|
|
132
|
-
() => (0, import_theme.imagePlaceholder)({ size: "md", variant: "error" }),
|
|
133
|
-
[]
|
|
134
|
-
);
|
|
135
|
-
const loadingStyles = (0, import_react3.useMemo)(
|
|
136
|
-
() => (0, import_theme.imagePlaceholder)({ size: "md", variant: "uploading" }),
|
|
137
|
-
[]
|
|
138
|
-
);
|
|
139
|
-
if (uploadState === "uploading") {
|
|
140
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.NodeViewWrapper, { className: "my-4", "data-type": "image", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: loadingStyles.root(), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: loadingStyles.content(), children: [
|
|
141
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "relative size-12", children: [
|
|
142
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
143
|
-
"svg",
|
|
144
|
-
{
|
|
145
|
-
className: "size-12 -rotate-90",
|
|
146
|
-
viewBox: "0 0 36 36",
|
|
147
|
-
"aria-hidden": "true",
|
|
148
|
-
children: [
|
|
149
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
150
|
-
"circle",
|
|
151
|
-
{
|
|
152
|
-
cx: "18",
|
|
153
|
-
cy: "18",
|
|
154
|
-
r: "16",
|
|
155
|
-
fill: "none",
|
|
156
|
-
className: "stroke-muted",
|
|
157
|
-
strokeWidth: "2"
|
|
158
|
-
}
|
|
159
|
-
),
|
|
160
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
161
|
-
"circle",
|
|
162
|
-
{
|
|
163
|
-
cx: "18",
|
|
164
|
-
cy: "18",
|
|
165
|
-
r: "16",
|
|
166
|
-
fill: "none",
|
|
167
|
-
className: "stroke-primary",
|
|
168
|
-
strokeWidth: "2",
|
|
169
|
-
strokeDasharray: 100,
|
|
170
|
-
strokeDashoffset: 100 - (uploadProgress != null ? uploadProgress : 0),
|
|
171
|
-
strokeLinecap: "round"
|
|
172
|
-
}
|
|
173
|
-
)
|
|
174
|
-
]
|
|
175
|
-
}
|
|
176
|
-
),
|
|
177
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "absolute inset-0 flex items-center justify-center text-xs font-medium", children: [
|
|
178
|
-
uploadProgress != null ? uploadProgress : 0,
|
|
179
|
-
"%"
|
|
180
|
-
] })
|
|
181
|
-
] }),
|
|
182
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: loadingStyles.text(), children: intl.formatMessage(messages.uploading) })
|
|
183
|
-
] }) }) });
|
|
184
|
-
}
|
|
185
|
-
if (uploadState === "error") {
|
|
186
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.NodeViewWrapper, { className: "my-4", "data-type": "image", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: errorStyles.root(), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: errorStyles.content(), children: [
|
|
187
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons.AlertCircleIcon, { className: errorStyles.icon() }),
|
|
188
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: errorStyles.text(), children: intl.formatMessage(messages.upload_error) }),
|
|
189
|
-
isEditable && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
190
|
-
import_button.IconButton,
|
|
191
|
-
{
|
|
192
|
-
size: "sm",
|
|
193
|
-
variant: "ghost",
|
|
194
|
-
onClick: handleRemove,
|
|
195
|
-
"aria-label": intl.formatMessage(messages.remove),
|
|
196
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons.TrashIcon, { className: "size-4" })
|
|
197
|
-
}
|
|
198
|
-
)
|
|
199
|
-
] }) }) });
|
|
200
|
-
}
|
|
201
|
-
if (resolveState === "loading") {
|
|
202
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.NodeViewWrapper, { className: "my-4", "data-type": "image", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: `${loadingStyles.root()} animate-pulse`, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: loadingStyles.text(), children: intl.formatMessage(messages.loading) }) }) });
|
|
203
|
-
}
|
|
204
|
-
if (resolveState === "error") {
|
|
205
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.NodeViewWrapper, { className: "my-4", "data-type": "image", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: errorStyles.root(), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: errorStyles.content(), children: [
|
|
206
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons.AlertCircleIcon, { className: errorStyles.icon() }),
|
|
207
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: errorStyles.text(), children: intl.formatMessage(messages.error) }),
|
|
208
|
-
isEditable && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex gap-2", children: [
|
|
209
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
210
|
-
import_button.IconButton,
|
|
211
|
-
{
|
|
212
|
-
size: "sm",
|
|
213
|
-
variant: "outline",
|
|
214
|
-
onClick: handleRetry,
|
|
215
|
-
"aria-label": intl.formatMessage(messages.retry),
|
|
216
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons.ArrowCounterClockwiseIcon, { className: "size-4" })
|
|
217
|
-
}
|
|
218
|
-
),
|
|
219
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
220
|
-
import_button.IconButton,
|
|
221
|
-
{
|
|
222
|
-
size: "sm",
|
|
223
|
-
variant: "ghost",
|
|
224
|
-
onClick: handleRemove,
|
|
225
|
-
"aria-label": intl.formatMessage(messages.remove),
|
|
226
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons.TrashIcon, { className: "size-4" })
|
|
227
|
-
}
|
|
228
|
-
)
|
|
229
|
-
] })
|
|
230
|
-
] }) }) });
|
|
231
|
-
}
|
|
232
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react2.NodeViewWrapper, { className: "my-4 relative group", "data-type": "image", children: [
|
|
233
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
234
|
-
"img",
|
|
235
|
-
{
|
|
236
|
-
src: resolvedUrl != null ? resolvedUrl : src,
|
|
237
|
-
alt: alt != null ? alt : "",
|
|
238
|
-
title: title != null ? title : void 0,
|
|
239
|
-
className: "max-w-full h-auto rounded-lg",
|
|
240
|
-
draggable: false
|
|
241
|
-
}
|
|
242
|
-
),
|
|
243
|
-
isEditable && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity flex gap-1", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
244
|
-
import_button.IconButton,
|
|
245
|
-
{
|
|
246
|
-
size: "sm",
|
|
247
|
-
variant: "outline",
|
|
248
|
-
onClick: handleRemove,
|
|
249
|
-
"aria-label": intl.formatMessage(messages.remove),
|
|
250
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons.TrashIcon, { className: "size-3.5" })
|
|
251
|
-
}
|
|
252
|
-
) })
|
|
253
|
-
] });
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// src/extensions/image/index.ts
|
|
257
|
-
var ImageNode = import_extension_image.Image.extend({
|
|
258
|
-
addAttributes() {
|
|
259
|
-
var _a;
|
|
260
|
-
return {
|
|
261
|
-
...(_a = this.parent) == null ? void 0 : _a.call(this),
|
|
262
|
-
// Upload state for drag & drop / paste uploads
|
|
263
|
-
uploadState: {
|
|
264
|
-
default: null,
|
|
265
|
-
rendered: false
|
|
266
|
-
},
|
|
267
|
-
uploadProgress: {
|
|
268
|
-
default: null,
|
|
269
|
-
rendered: false
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
},
|
|
273
|
-
addNodeView() {
|
|
274
|
-
return (0, import_react4.ReactNodeViewRenderer)(ImageNodeView);
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
278
|
-
0 && (module.exports = {
|
|
279
|
-
ImageNode,
|
|
280
|
-
ImageNodeView,
|
|
281
|
-
imageMessages
|
|
282
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
ImageNode
|
|
4
|
-
} from "../../chunk-HTJ2RXOG.mjs";
|
|
5
|
-
import {
|
|
6
|
-
ImageNodeView
|
|
7
|
-
} from "../../chunk-KYLBKQ2E.mjs";
|
|
8
|
-
import {
|
|
9
|
-
messages
|
|
10
|
-
} from "../../chunk-Z365KVQY.mjs";
|
|
11
|
-
import "../../chunk-VRQ6OSAZ.mjs";
|
|
12
|
-
export {
|
|
13
|
-
ImageNode,
|
|
14
|
-
ImageNodeView,
|
|
15
|
-
messages as imageMessages
|
|
16
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
declare const messages: {
|
|
2
|
-
loading: {
|
|
3
|
-
id: string;
|
|
4
|
-
defaultMessage: string;
|
|
5
|
-
};
|
|
6
|
-
uploading: {
|
|
7
|
-
id: string;
|
|
8
|
-
defaultMessage: string;
|
|
9
|
-
};
|
|
10
|
-
error: {
|
|
11
|
-
id: string;
|
|
12
|
-
defaultMessage: string;
|
|
13
|
-
};
|
|
14
|
-
upload_error: {
|
|
15
|
-
id: string;
|
|
16
|
-
defaultMessage: string;
|
|
17
|
-
};
|
|
18
|
-
retry: {
|
|
19
|
-
id: string;
|
|
20
|
-
defaultMessage: string;
|
|
21
|
-
};
|
|
22
|
-
remove: {
|
|
23
|
-
id: string;
|
|
24
|
-
defaultMessage: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export { messages };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
declare const messages: {
|
|
2
|
-
loading: {
|
|
3
|
-
id: string;
|
|
4
|
-
defaultMessage: string;
|
|
5
|
-
};
|
|
6
|
-
uploading: {
|
|
7
|
-
id: string;
|
|
8
|
-
defaultMessage: string;
|
|
9
|
-
};
|
|
10
|
-
error: {
|
|
11
|
-
id: string;
|
|
12
|
-
defaultMessage: string;
|
|
13
|
-
};
|
|
14
|
-
upload_error: {
|
|
15
|
-
id: string;
|
|
16
|
-
defaultMessage: string;
|
|
17
|
-
};
|
|
18
|
-
retry: {
|
|
19
|
-
id: string;
|
|
20
|
-
defaultMessage: string;
|
|
21
|
-
};
|
|
22
|
-
remove: {
|
|
23
|
-
id: string;
|
|
24
|
-
defaultMessage: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export { messages };
|