@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,38 +0,0 @@
|
|
|
1
|
-
import { Node } from '@tiptap/core';
|
|
2
|
-
export { default as InlineMath, InlineMathAttrs } from './inline-math.mjs';
|
|
3
|
-
|
|
4
|
-
interface MathBlockAttrs {
|
|
5
|
-
/**
|
|
6
|
-
* The LaTeX formula content
|
|
7
|
-
*/
|
|
8
|
-
latex: string;
|
|
9
|
-
}
|
|
10
|
-
interface MathBlockOptions {
|
|
11
|
-
/**
|
|
12
|
-
* Custom HTML attributes for the Math block wrapper element.
|
|
13
|
-
*/
|
|
14
|
-
HTMLAttributes: Record<string, unknown>;
|
|
15
|
-
}
|
|
16
|
-
declare module "@tiptap/core" {
|
|
17
|
-
interface Commands<ReturnType> {
|
|
18
|
-
mathBlock: {
|
|
19
|
-
/**
|
|
20
|
-
* Insert a math block
|
|
21
|
-
*/
|
|
22
|
-
insertMathBlock: (latex?: string) => ReturnType;
|
|
23
|
-
/**
|
|
24
|
-
* Update math block content
|
|
25
|
-
*/
|
|
26
|
-
updateMathBlock: (latex: string) => ReturnType;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Math Block Node Extension
|
|
32
|
-
*
|
|
33
|
-
* Renders LaTeX formulas using KaTeX.
|
|
34
|
-
* Provides an editor dialog for editing formulas.
|
|
35
|
-
*/
|
|
36
|
-
declare const MathBlock: Node<MathBlockOptions, any>;
|
|
37
|
-
|
|
38
|
-
export { MathBlock, type MathBlockAttrs, type MathBlockOptions, MathBlock as default };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Node } from '@tiptap/core';
|
|
2
|
-
export { default as InlineMath, InlineMathAttrs } from './inline-math.js';
|
|
3
|
-
|
|
4
|
-
interface MathBlockAttrs {
|
|
5
|
-
/**
|
|
6
|
-
* The LaTeX formula content
|
|
7
|
-
*/
|
|
8
|
-
latex: string;
|
|
9
|
-
}
|
|
10
|
-
interface MathBlockOptions {
|
|
11
|
-
/**
|
|
12
|
-
* Custom HTML attributes for the Math block wrapper element.
|
|
13
|
-
*/
|
|
14
|
-
HTMLAttributes: Record<string, unknown>;
|
|
15
|
-
}
|
|
16
|
-
declare module "@tiptap/core" {
|
|
17
|
-
interface Commands<ReturnType> {
|
|
18
|
-
mathBlock: {
|
|
19
|
-
/**
|
|
20
|
-
* Insert a math block
|
|
21
|
-
*/
|
|
22
|
-
insertMathBlock: (latex?: string) => ReturnType;
|
|
23
|
-
/**
|
|
24
|
-
* Update math block content
|
|
25
|
-
*/
|
|
26
|
-
updateMathBlock: (latex: string) => ReturnType;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Math Block Node Extension
|
|
32
|
-
*
|
|
33
|
-
* Renders LaTeX formulas using KaTeX.
|
|
34
|
-
* Provides an editor dialog for editing formulas.
|
|
35
|
-
*/
|
|
36
|
-
declare const MathBlock: Node<MathBlockOptions, any>;
|
|
37
|
-
|
|
38
|
-
export { MathBlock, type MathBlockAttrs, type MathBlockOptions, MathBlock as default };
|
|
@@ -1,544 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
"use client";
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __export = (target, all) => {
|
|
11
|
-
for (var name in all)
|
|
12
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
-
};
|
|
14
|
-
var __copyProps = (to, from, except, desc) => {
|
|
15
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
-
for (let key of __getOwnPropNames(from))
|
|
17
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
-
mod
|
|
29
|
-
));
|
|
30
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
-
|
|
32
|
-
// src/extensions/math/index.ts
|
|
33
|
-
var math_exports = {};
|
|
34
|
-
__export(math_exports, {
|
|
35
|
-
InlineMath: () => InlineMath,
|
|
36
|
-
MathBlock: () => MathBlock,
|
|
37
|
-
default: () => math_default
|
|
38
|
-
});
|
|
39
|
-
module.exports = __toCommonJS(math_exports);
|
|
40
|
-
var import_core2 = require("@tiptap/core");
|
|
41
|
-
var import_react6 = require("@tiptap/react");
|
|
42
|
-
|
|
43
|
-
// src/extensions/math/math-block-view.tsx
|
|
44
|
-
var import_button = require("@kopexa/button");
|
|
45
|
-
var import_dialog = require("@kopexa/dialog");
|
|
46
|
-
var import_icons = require("@kopexa/icons");
|
|
47
|
-
var import_label = require("@kopexa/label");
|
|
48
|
-
var import_react = require("@tiptap/react");
|
|
49
|
-
var import_katex = __toESM(require("katex"));
|
|
50
|
-
var import_katex_min = require("katex/dist/katex.min.css");
|
|
51
|
-
var import_react2 = require("react");
|
|
52
|
-
var import_react_intl2 = require("react-intl");
|
|
53
|
-
|
|
54
|
-
// src/extensions/math/messages.ts
|
|
55
|
-
var import_react_intl = require("react-intl");
|
|
56
|
-
var messages = (0, import_react_intl.defineMessages)({
|
|
57
|
-
title: {
|
|
58
|
-
id: "editor.math.title",
|
|
59
|
-
defaultMessage: "Formula",
|
|
60
|
-
description: "Math block title"
|
|
61
|
-
},
|
|
62
|
-
edit: {
|
|
63
|
-
id: "editor.math.edit",
|
|
64
|
-
defaultMessage: "Edit",
|
|
65
|
-
description: "Edit button label"
|
|
66
|
-
},
|
|
67
|
-
preview: {
|
|
68
|
-
id: "editor.math.preview",
|
|
69
|
-
defaultMessage: "Preview",
|
|
70
|
-
description: "Preview section label"
|
|
71
|
-
},
|
|
72
|
-
latex_input: {
|
|
73
|
-
id: "editor.math.latex_input",
|
|
74
|
-
defaultMessage: "LaTeX",
|
|
75
|
-
description: "LaTeX input label"
|
|
76
|
-
},
|
|
77
|
-
latex_placeholder: {
|
|
78
|
-
id: "editor.math.latex_placeholder",
|
|
79
|
-
defaultMessage: "Enter LaTeX formula...",
|
|
80
|
-
description: "LaTeX input placeholder"
|
|
81
|
-
},
|
|
82
|
-
invalid_latex: {
|
|
83
|
-
id: "editor.math.invalid_latex",
|
|
84
|
-
defaultMessage: "Invalid LaTeX syntax",
|
|
85
|
-
description: "Error message for invalid LaTeX"
|
|
86
|
-
},
|
|
87
|
-
empty_formula: {
|
|
88
|
-
id: "editor.math.empty_formula",
|
|
89
|
-
defaultMessage: "Click to add formula",
|
|
90
|
-
description: "Placeholder for empty formula"
|
|
91
|
-
},
|
|
92
|
-
save: {
|
|
93
|
-
id: "editor.math.save",
|
|
94
|
-
defaultMessage: "Save",
|
|
95
|
-
description: "Save button label"
|
|
96
|
-
},
|
|
97
|
-
cancel: {
|
|
98
|
-
id: "editor.math.cancel",
|
|
99
|
-
defaultMessage: "Cancel",
|
|
100
|
-
description: "Cancel button label"
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
// src/extensions/math/math-block-view.tsx
|
|
105
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
106
|
-
function MathBlockView({ editor, node, getPos }) {
|
|
107
|
-
const intl = (0, import_react_intl2.useIntl)();
|
|
108
|
-
const attrs = node.attrs;
|
|
109
|
-
const { latex = "" } = attrs;
|
|
110
|
-
const isEditable = (0, import_react.useEditorState)({
|
|
111
|
-
editor,
|
|
112
|
-
selector: ({ editor: e }) => {
|
|
113
|
-
var _a;
|
|
114
|
-
return (_a = e == null ? void 0 : e.isEditable) != null ? _a : false;
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
const [isOpen, setIsOpen] = (0, import_react2.useState)(false);
|
|
118
|
-
const [localLatex, setLocalLatex] = (0, import_react2.useState)(latex);
|
|
119
|
-
const [error, setError] = (0, import_react2.useState)(null);
|
|
120
|
-
(0, import_react2.useEffect)(() => {
|
|
121
|
-
if (isOpen) {
|
|
122
|
-
setLocalLatex(latex);
|
|
123
|
-
setError(null);
|
|
124
|
-
}
|
|
125
|
-
}, [isOpen, latex]);
|
|
126
|
-
const renderedHtml = (0, import_react2.useMemo)(() => {
|
|
127
|
-
if (!latex) return null;
|
|
128
|
-
try {
|
|
129
|
-
return import_katex.default.renderToString(latex, {
|
|
130
|
-
throwOnError: false,
|
|
131
|
-
displayMode: true,
|
|
132
|
-
output: "html"
|
|
133
|
-
});
|
|
134
|
-
} catch {
|
|
135
|
-
return null;
|
|
136
|
-
}
|
|
137
|
-
}, [latex]);
|
|
138
|
-
const previewHtml = (0, import_react2.useMemo)(() => {
|
|
139
|
-
if (!localLatex) return null;
|
|
140
|
-
try {
|
|
141
|
-
setError(null);
|
|
142
|
-
return import_katex.default.renderToString(localLatex, {
|
|
143
|
-
throwOnError: true,
|
|
144
|
-
displayMode: true,
|
|
145
|
-
output: "html"
|
|
146
|
-
});
|
|
147
|
-
} catch (_e) {
|
|
148
|
-
setError(intl.formatMessage(messages.invalid_latex));
|
|
149
|
-
return null;
|
|
150
|
-
}
|
|
151
|
-
}, [localLatex, intl]);
|
|
152
|
-
const handleSave = (0, import_react2.useCallback)(() => {
|
|
153
|
-
const pos = getPos();
|
|
154
|
-
if (pos === void 0) return;
|
|
155
|
-
editor.view.dispatch(
|
|
156
|
-
editor.state.tr.setNodeMarkup(pos, void 0, { latex: localLatex })
|
|
157
|
-
);
|
|
158
|
-
setIsOpen(false);
|
|
159
|
-
}, [editor, localLatex, getPos]);
|
|
160
|
-
const handleCancel = (0, import_react2.useCallback)(() => {
|
|
161
|
-
setLocalLatex(latex);
|
|
162
|
-
setError(null);
|
|
163
|
-
setIsOpen(false);
|
|
164
|
-
}, [latex]);
|
|
165
|
-
const handleOpenEditor = (0, import_react2.useCallback)(
|
|
166
|
-
(e) => {
|
|
167
|
-
e.stopPropagation();
|
|
168
|
-
e.preventDefault();
|
|
169
|
-
if (isEditable) {
|
|
170
|
-
setIsOpen(true);
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
[isEditable]
|
|
174
|
-
);
|
|
175
|
-
const isEmpty = !latex;
|
|
176
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
177
|
-
import_react.NodeViewWrapper,
|
|
178
|
-
{
|
|
179
|
-
className: "my-4 relative group",
|
|
180
|
-
"data-type": "math-block",
|
|
181
|
-
"data-latex": latex,
|
|
182
|
-
children: [
|
|
183
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
184
|
-
"button",
|
|
185
|
-
{
|
|
186
|
-
type: "button",
|
|
187
|
-
className: "w-full flex items-center justify-center min-h-16 p-4 rounded-md border border-border bg-muted/30 cursor-pointer hover:bg-muted/50 transition-colors",
|
|
188
|
-
onClick: handleOpenEditor,
|
|
189
|
-
children: isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 text-muted-foreground", children: [
|
|
190
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-lg font-serif", children: "\u2211" }),
|
|
191
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm", children: intl.formatMessage(messages.empty_formula) })
|
|
192
|
-
] }) : renderedHtml ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
193
|
-
"div",
|
|
194
|
-
{
|
|
195
|
-
className: "katex-display",
|
|
196
|
-
dangerouslySetInnerHTML: { __html: renderedHtml }
|
|
197
|
-
}
|
|
198
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-destructive text-sm", children: intl.formatMessage(messages.invalid_latex) })
|
|
199
|
-
}
|
|
200
|
-
),
|
|
201
|
-
isEditable && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
202
|
-
import_button.IconButton,
|
|
203
|
-
{
|
|
204
|
-
size: "sm",
|
|
205
|
-
variant: "ghost",
|
|
206
|
-
className: "absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
207
|
-
"aria-label": intl.formatMessage(messages.edit),
|
|
208
|
-
onClick: handleOpenEditor,
|
|
209
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.EditIcon, { className: "size-3.5" })
|
|
210
|
-
}
|
|
211
|
-
),
|
|
212
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Root, { open: isOpen, onOpenChange: setIsOpen, size: "md", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.Dialog.Content, { children: [
|
|
213
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Title, { children: intl.formatMessage(messages.title) }) }),
|
|
214
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
|
|
215
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
216
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { className: "text-sm", children: intl.formatMessage(messages.latex_input) }),
|
|
217
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
218
|
-
"textarea",
|
|
219
|
-
{
|
|
220
|
-
className: "w-full min-h-24 p-3 rounded-md border border-input bg-background font-mono text-sm resize-y focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
221
|
-
value: localLatex,
|
|
222
|
-
onChange: (e) => setLocalLatex(e.target.value),
|
|
223
|
-
placeholder: intl.formatMessage(messages.latex_placeholder),
|
|
224
|
-
spellCheck: false
|
|
225
|
-
}
|
|
226
|
-
),
|
|
227
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-destructive", children: error })
|
|
228
|
-
] }),
|
|
229
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
230
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { className: "text-sm", children: intl.formatMessage(messages.preview) }),
|
|
231
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "min-h-16 p-4 rounded-md border border-border bg-muted/30 flex items-center justify-center", children: previewHtml ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
232
|
-
"div",
|
|
233
|
-
{
|
|
234
|
-
className: "katex-display",
|
|
235
|
-
dangerouslySetInnerHTML: { __html: previewHtml }
|
|
236
|
-
}
|
|
237
|
-
) : localLatex ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground text-sm", children: intl.formatMessage(messages.invalid_latex) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground text-sm", children: intl.formatMessage(messages.latex_placeholder) }) })
|
|
238
|
-
] })
|
|
239
|
-
] }) }),
|
|
240
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.Dialog.Footer, { children: [
|
|
241
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "ghost", onClick: handleCancel, children: intl.formatMessage(messages.cancel) }),
|
|
242
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { onClick: handleSave, disabled: !!error && !!localLatex, children: intl.formatMessage(messages.save) })
|
|
243
|
-
] })
|
|
244
|
-
] }) })
|
|
245
|
-
]
|
|
246
|
-
}
|
|
247
|
-
);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
// src/extensions/math/inline-math.ts
|
|
251
|
-
var import_core = require("@tiptap/core");
|
|
252
|
-
var import_react5 = require("@tiptap/react");
|
|
253
|
-
|
|
254
|
-
// src/extensions/math/inline-math-view.tsx
|
|
255
|
-
var import_button2 = require("@kopexa/button");
|
|
256
|
-
var import_dialog2 = require("@kopexa/dialog");
|
|
257
|
-
var import_label2 = require("@kopexa/label");
|
|
258
|
-
var import_react3 = require("@tiptap/react");
|
|
259
|
-
var import_katex2 = __toESM(require("katex"));
|
|
260
|
-
var import_katex_min2 = require("katex/dist/katex.min.css");
|
|
261
|
-
var import_react4 = require("react");
|
|
262
|
-
var import_react_intl3 = require("react-intl");
|
|
263
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
264
|
-
function InlineMathView({ editor, node, getPos }) {
|
|
265
|
-
const intl = (0, import_react_intl3.useIntl)();
|
|
266
|
-
const attrs = node.attrs;
|
|
267
|
-
const { latex = "" } = attrs;
|
|
268
|
-
const isEditable = (0, import_react3.useEditorState)({
|
|
269
|
-
editor,
|
|
270
|
-
selector: ({ editor: e }) => {
|
|
271
|
-
var _a;
|
|
272
|
-
return (_a = e == null ? void 0 : e.isEditable) != null ? _a : false;
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
|
-
const [isOpen, setIsOpen] = (0, import_react4.useState)(false);
|
|
276
|
-
const [localLatex, setLocalLatex] = (0, import_react4.useState)(latex);
|
|
277
|
-
const [error, setError] = (0, import_react4.useState)(null);
|
|
278
|
-
(0, import_react4.useEffect)(() => {
|
|
279
|
-
if (isOpen) {
|
|
280
|
-
setLocalLatex(latex);
|
|
281
|
-
setError(null);
|
|
282
|
-
}
|
|
283
|
-
}, [isOpen, latex]);
|
|
284
|
-
const renderedHtml = (0, import_react4.useMemo)(() => {
|
|
285
|
-
if (!latex) return null;
|
|
286
|
-
try {
|
|
287
|
-
return import_katex2.default.renderToString(latex, {
|
|
288
|
-
throwOnError: false,
|
|
289
|
-
displayMode: false,
|
|
290
|
-
output: "html"
|
|
291
|
-
});
|
|
292
|
-
} catch {
|
|
293
|
-
return null;
|
|
294
|
-
}
|
|
295
|
-
}, [latex]);
|
|
296
|
-
const previewHtml = (0, import_react4.useMemo)(() => {
|
|
297
|
-
if (!localLatex) return null;
|
|
298
|
-
try {
|
|
299
|
-
setError(null);
|
|
300
|
-
return import_katex2.default.renderToString(localLatex, {
|
|
301
|
-
throwOnError: true,
|
|
302
|
-
displayMode: false,
|
|
303
|
-
output: "html"
|
|
304
|
-
});
|
|
305
|
-
} catch (_e) {
|
|
306
|
-
setError(intl.formatMessage(messages.invalid_latex));
|
|
307
|
-
return null;
|
|
308
|
-
}
|
|
309
|
-
}, [localLatex, intl]);
|
|
310
|
-
const handleSave = (0, import_react4.useCallback)(() => {
|
|
311
|
-
const pos = getPos();
|
|
312
|
-
if (pos === void 0) return;
|
|
313
|
-
editor.view.dispatch(
|
|
314
|
-
editor.state.tr.setNodeMarkup(pos, void 0, { latex: localLatex })
|
|
315
|
-
);
|
|
316
|
-
setIsOpen(false);
|
|
317
|
-
}, [editor, localLatex, getPos]);
|
|
318
|
-
const handleCancel = (0, import_react4.useCallback)(() => {
|
|
319
|
-
setLocalLatex(latex);
|
|
320
|
-
setError(null);
|
|
321
|
-
setIsOpen(false);
|
|
322
|
-
}, [latex]);
|
|
323
|
-
const handleClick = (0, import_react4.useCallback)(
|
|
324
|
-
(e) => {
|
|
325
|
-
e.stopPropagation();
|
|
326
|
-
e.preventDefault();
|
|
327
|
-
if (isEditable) {
|
|
328
|
-
setIsOpen(true);
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
[isEditable]
|
|
332
|
-
);
|
|
333
|
-
const isEmpty = !latex;
|
|
334
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
335
|
-
import_react3.NodeViewWrapper,
|
|
336
|
-
{
|
|
337
|
-
as: "span",
|
|
338
|
-
className: "inline-math-wrapper",
|
|
339
|
-
"data-type": "inline-math",
|
|
340
|
-
"data-latex": latex,
|
|
341
|
-
children: [
|
|
342
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
343
|
-
"span",
|
|
344
|
-
{
|
|
345
|
-
className: `inline-math cursor-pointer rounded px-0.5 transition-colors ${isEditable ? "hover:bg-primary/10 hover:ring-1 hover:ring-primary/20" : ""} ${isEmpty ? "text-muted-foreground italic" : ""}`,
|
|
346
|
-
onClick: handleClick,
|
|
347
|
-
children: isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-xs", children: "$?$" }) : renderedHtml ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
348
|
-
"span",
|
|
349
|
-
{
|
|
350
|
-
dangerouslySetInnerHTML: { __html: renderedHtml }
|
|
351
|
-
}
|
|
352
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-destructive text-xs", children: latex })
|
|
353
|
-
}
|
|
354
|
-
),
|
|
355
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dialog2.Dialog.Root, { open: isOpen, onOpenChange: setIsOpen, size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_dialog2.Dialog.Content, { children: [
|
|
356
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dialog2.Dialog.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dialog2.Dialog.Title, { children: intl.formatMessage(messages.title) }) }),
|
|
357
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dialog2.Dialog.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "space-y-4", children: [
|
|
358
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "space-y-1.5", children: [
|
|
359
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_label2.Label, { className: "text-sm", children: intl.formatMessage(messages.latex_input) }),
|
|
360
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
361
|
-
"input",
|
|
362
|
-
{
|
|
363
|
-
type: "text",
|
|
364
|
-
className: "w-full p-2 rounded-md border border-input bg-background font-mono text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
365
|
-
value: localLatex,
|
|
366
|
-
onChange: (e) => setLocalLatex(e.target.value),
|
|
367
|
-
placeholder: intl.formatMessage(messages.latex_placeholder),
|
|
368
|
-
spellCheck: false
|
|
369
|
-
}
|
|
370
|
-
),
|
|
371
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "text-xs text-destructive", children: error })
|
|
372
|
-
] }),
|
|
373
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "space-y-1.5", children: [
|
|
374
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_label2.Label, { className: "text-sm", children: intl.formatMessage(messages.preview) }),
|
|
375
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "min-h-10 p-3 rounded-md border border-border bg-muted/30 flex items-center justify-center", children: previewHtml ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
376
|
-
"span",
|
|
377
|
-
{
|
|
378
|
-
dangerouslySetInnerHTML: { __html: previewHtml }
|
|
379
|
-
}
|
|
380
|
-
) : localLatex ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-muted-foreground text-sm", children: intl.formatMessage(messages.invalid_latex) }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-muted-foreground text-sm", children: "$...$" }) })
|
|
381
|
-
] })
|
|
382
|
-
] }) }),
|
|
383
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_dialog2.Dialog.Footer, { children: [
|
|
384
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_button2.Button, { variant: "ghost", onClick: handleCancel, children: intl.formatMessage(messages.cancel) }),
|
|
385
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_button2.Button, { onClick: handleSave, disabled: !!error && !!localLatex, children: intl.formatMessage(messages.save) })
|
|
386
|
-
] })
|
|
387
|
-
] }) })
|
|
388
|
-
]
|
|
389
|
-
}
|
|
390
|
-
);
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
// src/extensions/math/inline-math.ts
|
|
394
|
-
var InlineMath = import_core.Node.create({
|
|
395
|
-
name: "inlineMath",
|
|
396
|
-
group: "inline",
|
|
397
|
-
inline: true,
|
|
398
|
-
atom: true,
|
|
399
|
-
addOptions() {
|
|
400
|
-
return {
|
|
401
|
-
HTMLAttributes: {}
|
|
402
|
-
};
|
|
403
|
-
},
|
|
404
|
-
addAttributes() {
|
|
405
|
-
return {
|
|
406
|
-
latex: {
|
|
407
|
-
default: "",
|
|
408
|
-
parseHTML: (element) => element.getAttribute("data-latex") || "",
|
|
409
|
-
renderHTML: (attributes) => ({
|
|
410
|
-
"data-latex": attributes.latex
|
|
411
|
-
})
|
|
412
|
-
}
|
|
413
|
-
};
|
|
414
|
-
},
|
|
415
|
-
parseHTML() {
|
|
416
|
-
return [
|
|
417
|
-
{
|
|
418
|
-
tag: 'span[data-type="inline-math"]'
|
|
419
|
-
}
|
|
420
|
-
];
|
|
421
|
-
},
|
|
422
|
-
renderHTML({ HTMLAttributes }) {
|
|
423
|
-
return [
|
|
424
|
-
"span",
|
|
425
|
-
(0, import_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes, {
|
|
426
|
-
"data-type": "inline-math"
|
|
427
|
-
})
|
|
428
|
-
];
|
|
429
|
-
},
|
|
430
|
-
addNodeView() {
|
|
431
|
-
return (0, import_react5.ReactNodeViewRenderer)(InlineMathView, {
|
|
432
|
-
as: "span"
|
|
433
|
-
});
|
|
434
|
-
},
|
|
435
|
-
addCommands() {
|
|
436
|
-
return {
|
|
437
|
-
insertInlineMath: (latex = "") => ({ commands }) => {
|
|
438
|
-
return commands.insertContent({
|
|
439
|
-
type: this.name,
|
|
440
|
-
attrs: { latex }
|
|
441
|
-
});
|
|
442
|
-
}
|
|
443
|
-
};
|
|
444
|
-
},
|
|
445
|
-
addInputRules() {
|
|
446
|
-
return [
|
|
447
|
-
// Inline math with $...$
|
|
448
|
-
new import_core.InputRule({
|
|
449
|
-
// Match $...$ but not $$...$$
|
|
450
|
-
find: /(?<!\$)\$([^$]+)\$(?!\$)/,
|
|
451
|
-
handler: ({ state, range, match }) => {
|
|
452
|
-
const latex = match[1];
|
|
453
|
-
const { tr } = state;
|
|
454
|
-
tr.replaceWith(range.from, range.to, this.type.create({ latex }));
|
|
455
|
-
}
|
|
456
|
-
})
|
|
457
|
-
];
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
|
|
461
|
-
// src/extensions/math/index.ts
|
|
462
|
-
var MathBlock = import_core2.Node.create({
|
|
463
|
-
name: "mathBlock",
|
|
464
|
-
group: "block",
|
|
465
|
-
atom: true,
|
|
466
|
-
draggable: true,
|
|
467
|
-
addOptions() {
|
|
468
|
-
return {
|
|
469
|
-
HTMLAttributes: {}
|
|
470
|
-
};
|
|
471
|
-
},
|
|
472
|
-
addAttributes() {
|
|
473
|
-
return {
|
|
474
|
-
latex: {
|
|
475
|
-
default: "",
|
|
476
|
-
parseHTML: (element) => element.getAttribute("data-latex") || "",
|
|
477
|
-
renderHTML: (attributes) => ({
|
|
478
|
-
"data-latex": attributes.latex
|
|
479
|
-
})
|
|
480
|
-
}
|
|
481
|
-
};
|
|
482
|
-
},
|
|
483
|
-
parseHTML() {
|
|
484
|
-
return [
|
|
485
|
-
{
|
|
486
|
-
tag: 'div[data-type="math-block"]'
|
|
487
|
-
}
|
|
488
|
-
];
|
|
489
|
-
},
|
|
490
|
-
renderHTML({ HTMLAttributes }) {
|
|
491
|
-
return [
|
|
492
|
-
"div",
|
|
493
|
-
(0, import_core2.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes, {
|
|
494
|
-
"data-type": "math-block"
|
|
495
|
-
})
|
|
496
|
-
];
|
|
497
|
-
},
|
|
498
|
-
addNodeView() {
|
|
499
|
-
return (0, import_react6.ReactNodeViewRenderer)(MathBlockView);
|
|
500
|
-
},
|
|
501
|
-
addCommands() {
|
|
502
|
-
return {
|
|
503
|
-
insertMathBlock: (latex = "") => ({ commands }) => {
|
|
504
|
-
return commands.insertContent({
|
|
505
|
-
type: this.name,
|
|
506
|
-
attrs: { latex }
|
|
507
|
-
});
|
|
508
|
-
},
|
|
509
|
-
updateMathBlock: (latex) => ({ tr, state, dispatch }) => {
|
|
510
|
-
const { selection } = state;
|
|
511
|
-
const node = state.doc.nodeAt(selection.from);
|
|
512
|
-
if ((node == null ? void 0 : node.type.name) !== this.name) {
|
|
513
|
-
return false;
|
|
514
|
-
}
|
|
515
|
-
if (dispatch) {
|
|
516
|
-
tr.setNodeMarkup(selection.from, void 0, {
|
|
517
|
-
...node.attrs,
|
|
518
|
-
latex
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
|
-
return true;
|
|
522
|
-
}
|
|
523
|
-
};
|
|
524
|
-
},
|
|
525
|
-
addInputRules() {
|
|
526
|
-
return [
|
|
527
|
-
// Block math with $$...$$
|
|
528
|
-
new import_core2.InputRule({
|
|
529
|
-
find: /^\$\$(.+)\$\$$/,
|
|
530
|
-
handler: ({ state, range, match }) => {
|
|
531
|
-
const latex = match[1];
|
|
532
|
-
const { tr } = state;
|
|
533
|
-
tr.replaceWith(range.from, range.to, this.type.create({ latex }));
|
|
534
|
-
}
|
|
535
|
-
})
|
|
536
|
-
];
|
|
537
|
-
}
|
|
538
|
-
});
|
|
539
|
-
var math_default = MathBlock;
|
|
540
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
541
|
-
0 && (module.exports = {
|
|
542
|
-
InlineMath,
|
|
543
|
-
MathBlock
|
|
544
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
import {
|
|
4
|
-
MathBlock,
|
|
5
|
-
math_default
|
|
6
|
-
} from "../../chunk-2U5CQUZH.mjs";
|
|
7
|
-
import {
|
|
8
|
-
InlineMath
|
|
9
|
-
} from "../../chunk-7VW67NVL.mjs";
|
|
10
|
-
import "../../chunk-BXHPO3T7.mjs";
|
|
11
|
-
import "../../chunk-UVHVCION.mjs";
|
|
12
|
-
import "../../chunk-FRJX2F4T.mjs";
|
|
13
|
-
export {
|
|
14
|
-
InlineMath,
|
|
15
|
-
MathBlock,
|
|
16
|
-
math_default as default
|
|
17
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { NodeViewProps } from '@tiptap/react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Inline Math NodeView Component
|
|
6
|
-
*
|
|
7
|
-
* Renders an inline LaTeX formula using KaTeX.
|
|
8
|
-
* Click to edit.
|
|
9
|
-
*/
|
|
10
|
-
declare function InlineMathView({ editor, node, getPos }: NodeViewProps): react_jsx_runtime.JSX.Element;
|
|
11
|
-
|
|
12
|
-
export { InlineMathView, InlineMathView as default };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { NodeViewProps } from '@tiptap/react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Inline Math NodeView Component
|
|
6
|
-
*
|
|
7
|
-
* Renders an inline LaTeX formula using KaTeX.
|
|
8
|
-
* Click to edit.
|
|
9
|
-
*/
|
|
10
|
-
declare function InlineMathView({ editor, node, getPos }: NodeViewProps): react_jsx_runtime.JSX.Element;
|
|
11
|
-
|
|
12
|
-
export { InlineMathView, InlineMathView as default };
|