@kopexa/tiptap 1.0.0 → 2.0.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/{chunk-AASYBJDX.mjs → chunk-2SI7MRAE.mjs} +1 -1
- package/dist/{chunk-6W7J7PHZ.mjs → chunk-B2DHYFSH.mjs} +6 -7
- package/dist/{chunk-RQPJU4UB.mjs → chunk-B7WJOQ3X.mjs} +1 -1
- package/dist/{chunk-ACWAVTTK.mjs → chunk-BEV5U2DK.mjs} +6 -6
- package/dist/{chunk-TGQP45HH.mjs → chunk-EHY2NAW7.mjs} +1 -3
- package/dist/{chunk-O5P45H3I.mjs → chunk-GYIYX2JH.mjs} +1 -1
- package/dist/{chunk-QCULSZRZ.mjs → chunk-IOB3REX6.mjs} +1 -3
- package/dist/{chunk-ILPDDC4W.mjs → chunk-IQERE7KP.mjs} +1 -4
- package/dist/{chunk-6SS62RYU.mjs → chunk-JNL4KY45.mjs} +1 -3
- package/dist/{chunk-R2RRQUU5.mjs → chunk-LHXRE26G.mjs} +2 -2
- package/dist/{chunk-F2HHFSM4.mjs → chunk-LNVWG34E.mjs} +1 -4
- package/dist/chunk-NUCXXNTA.mjs +131 -0
- package/dist/{chunk-GLQRF7PR.mjs → chunk-OEVR5N7X.mjs} +2 -10
- package/dist/{chunk-YYHNT322.mjs → chunk-OZWCQMRA.mjs} +27 -19
- package/dist/{chunk-OX2A52WL.mjs → chunk-Q7DFJ5NI.mjs} +2 -4
- package/dist/{chunk-ODBSAQ5V.mjs → chunk-QF3YHPWM.mjs} +2 -4
- package/dist/{chunk-R5AMMJTQ.mjs → chunk-REJEJXOZ.mjs} +3 -3
- package/dist/chunk-TZQQ6C2Q.mjs +101 -0
- package/dist/{chunk-KI3YOPAA.mjs → chunk-UJ4BNZ63.mjs} +1 -4
- package/dist/{chunk-4LAWYE7B.mjs → chunk-V6TAZMQN.mjs} +2 -4
- package/dist/{chunk-QP2LCU5N.mjs → chunk-VX3HSJ76.mjs} +2 -2
- package/dist/{chunk-WCBSINO5.mjs → chunk-W2FLOOJ6.mjs} +1 -1
- package/dist/{chunk-JHMEXFB3.mjs → chunk-WHJ4B43N.mjs} +1 -1
- package/dist/{chunk-YD56B5SG.mjs → chunk-WPRDVMPN.mjs} +19 -18
- package/dist/{chunk-44V2Y6IU.mjs → chunk-XL5FS7LN.mjs} +3 -3
- package/dist/{chunk-ZSYXHD7D.mjs → chunk-YJAHZXLG.mjs} +1 -4
- package/dist/{chunk-T7LL5ZSR.mjs → chunk-ZVTJ6XD7.mjs} +1 -3
- package/dist/{chunk-I7WKP3OM.mjs → chunk-ZZ4OU46C.mjs} +6 -6
- package/dist/context/editor-context.d.mts +4 -4
- package/dist/context/editor-context.d.ts +4 -4
- package/dist/context/editor-context.js +5 -5
- package/dist/context/editor-context.mjs +5 -6
- package/dist/extensions/link/index.mjs +0 -1
- package/dist/extensions/selection/index.mjs +0 -1
- package/dist/extensions/trailing-node/index.mjs +0 -1
- package/dist/extensions/ui-state/index.mjs +0 -1
- package/dist/hooks/use-create-editor.d.mts +16 -5
- package/dist/hooks/use-create-editor.d.ts +16 -5
- package/dist/hooks/use-create-editor.js +84 -1062
- package/dist/hooks/use-create-editor.mjs +5 -18
- package/dist/hooks/use-cursor-visibility.mjs +0 -1
- package/dist/hooks/use-floating-element.mjs +0 -1
- package/dist/hooks/use-floating-toolbar-visibility.mjs +0 -1
- package/dist/hooks/use-menu-navigation.mjs +0 -1
- package/dist/hooks/use-tiptap-editor.mjs +0 -1
- package/dist/hooks/use-ui-editor-state.mjs +0 -1
- package/dist/hooks/use-window-size.mjs +0 -1
- package/dist/index.d.mts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +483 -1584
- package/dist/index.mjs +39 -60
- package/dist/presets/basic/editor-header.js +112 -167
- package/dist/presets/basic/editor-header.mjs +25 -25
- package/dist/presets/basic/index.d.mts +6 -3
- package/dist/presets/basic/index.d.ts +6 -3
- package/dist/presets/basic/index.js +386 -1468
- package/dist/presets/basic/index.mjs +32 -46
- package/dist/ui/blockquote-button/blockquote-button.js +12 -67
- package/dist/ui/blockquote-button/blockquote-button.mjs +2 -4
- package/dist/ui/blockquote-button/index.js +12 -67
- package/dist/ui/blockquote-button/index.mjs +2 -4
- package/dist/ui/blockquote-button/use-blockquote.js +12 -65
- package/dist/ui/blockquote-button/use-blockquote.mjs +1 -3
- package/dist/ui/codeblock-button/code-block-button.js +13 -76
- package/dist/ui/codeblock-button/code-block-button.mjs +2 -4
- package/dist/ui/codeblock-button/index.js +13 -76
- package/dist/ui/codeblock-button/index.mjs +2 -4
- package/dist/ui/codeblock-button/use-code-block.js +12 -65
- package/dist/ui/codeblock-button/use-code-block.mjs +1 -3
- package/dist/ui/color-highlight-button/color-highlight-button.js +3 -23
- package/dist/ui/color-highlight-button/color-highlight-button.mjs +2 -4
- package/dist/ui/color-highlight-button/index.js +3 -23
- package/dist/ui/color-highlight-button/index.mjs +2 -4
- package/dist/ui/color-highlight-button/use-color-highlight.js +3 -21
- package/dist/ui/color-highlight-button/use-color-highlight.mjs +1 -3
- package/dist/ui/color-highlight-popover/color-highlight-popover.js +4 -24
- package/dist/ui/color-highlight-popover/color-highlight-popover.mjs +3 -5
- package/dist/ui/color-highlight-popover/index.js +4 -24
- package/dist/ui/color-highlight-popover/index.mjs +3 -5
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.js +2 -18
- package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.mjs +1 -3
- package/dist/ui/heading-button/index.js +2 -9
- package/dist/ui/heading-button/index.mjs +1 -3
- package/dist/ui/heading-button/utils.mjs +0 -1
- package/dist/ui/heading-dropdown-menu/index.js +4 -10
- package/dist/ui/heading-dropdown-menu/index.mjs +2 -4
- package/dist/ui/link-popover/index.js +2 -6
- package/dist/ui/link-popover/index.mjs +3 -4
- package/dist/ui/link-popover/link-popover.js +2 -6
- package/dist/ui/link-popover/link-popover.mjs +3 -4
- package/dist/ui/link-popover/use-link-popover.js +2 -6
- package/dist/ui/link-popover/use-link-popover.mjs +2 -3
- package/dist/ui/list-button/index.js +2 -9
- package/dist/ui/list-button/index.mjs +1 -3
- package/dist/ui/list-dropdown-menu/index.js +4 -10
- package/dist/ui/list-dropdown-menu/index.mjs +2 -4
- package/dist/ui/mark-button/index.js +3 -21
- package/dist/ui/mark-button/index.mjs +1 -3
- package/dist/ui/reset-all-formatting-button/index.mjs +0 -1
- package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.mjs +0 -1
- package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.mjs +0 -1
- package/dist/ui/slash-dropdown-menu/index.js +27 -129
- package/dist/ui/slash-dropdown-menu/index.mjs +3 -5
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.js +27 -129
- package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.mjs +3 -5
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.js +23 -116
- package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.mjs +2 -4
- package/dist/ui/suggestion-menu/index.mjs +0 -1
- package/dist/ui/suggestion-menu/suggestion-menu-utils.mjs +0 -1
- package/dist/ui/suggestion-menu/suggestion-menu.mjs +0 -1
- package/dist/ui/table-button/index.js +4 -24
- package/dist/ui/table-button/index.mjs +2 -4
- package/dist/ui/table-button/use-table.js +3 -21
- package/dist/ui/table-button/use-table.mjs +1 -3
- package/dist/ui/text-align-button/index.js +3 -32
- package/dist/ui/text-align-button/index.mjs +2 -4
- package/dist/ui/text-align-button/text-align-button.js +3 -32
- package/dist/ui/text-align-button/text-align-button.mjs +2 -4
- package/dist/ui/text-align-button/use-text-align.js +3 -30
- package/dist/ui/text-align-button/use-text-align.mjs +1 -3
- package/dist/ui/undo-redo-button/index.js +2 -18
- package/dist/ui/undo-redo-button/index.mjs +2 -4
- package/dist/ui/undo-redo-button/undo-redo-button.js +2 -18
- package/dist/ui/undo-redo-button/undo-redo-button.mjs +2 -4
- package/dist/ui/undo-redo-button/use-undo-redo.js +2 -16
- package/dist/ui/undo-redo-button/use-undo-redo.mjs +1 -3
- package/dist/utils/index.d.mts +1 -101
- package/dist/utils/index.d.ts +1 -101
- package/dist/utils/index.js +0 -166
- package/dist/utils/index.mjs +1 -28
- package/dist/utils/safe-parse.mjs +0 -1
- package/package.json +36 -30
- package/dist/chunk-4HTILXJM.mjs +0 -104
- package/dist/chunk-4IIGLBTD.mjs +0 -81
- package/dist/chunk-574UV65T.mjs +0 -111
- package/dist/chunk-7HC7D256.mjs +0 -91
- package/dist/chunk-AC22DSDA.mjs +0 -540
- package/dist/chunk-AGOMESFC.mjs +0 -1
- package/dist/chunk-BXPGSCTT.mjs +0 -39
- package/dist/chunk-C6M3CDOK.mjs +0 -254
- package/dist/chunk-EN3J5AMF.mjs +0 -12
- package/dist/chunk-HYDS6H67.mjs +0 -58
- package/dist/chunk-KRLE4MMD.mjs +0 -116
- package/dist/chunk-LKOQAQPZ.mjs +0 -13
- package/dist/chunk-LXZ53XU7.mjs +0 -1
- package/dist/chunk-T6P7CS4F.mjs +0 -42
- package/dist/chunk-TVFWG7IC.mjs +0 -43
- package/dist/chunk-VULWMVYS.mjs +0 -11
- package/dist/chunk-WKV76XOR.mjs +0 -8
- package/dist/extensions/table/index.d.mts +0 -8
- package/dist/extensions/table/index.d.ts +0 -8
- package/dist/extensions/table/index.js +0 -1044
- package/dist/extensions/table/index.mjs +0 -33
- package/dist/extensions/table/kit.d.mts +0 -30
- package/dist/extensions/table/kit.d.ts +0 -30
- package/dist/extensions/table/kit.js +0 -1034
- package/dist/extensions/table/kit.mjs +0 -20
- package/dist/extensions/table/table/icons.d.mts +0 -13
- package/dist/extensions/table/table/icons.d.ts +0 -13
- package/dist/extensions/table/table/icons.js +0 -81
- package/dist/extensions/table/table/icons.mjs +0 -8
- package/dist/extensions/table/table/index.d.mts +0 -3
- package/dist/extensions/table/table/index.d.ts +0 -3
- package/dist/extensions/table/table/index.js +0 -818
- package/dist/extensions/table/table/index.mjs +0 -16
- package/dist/extensions/table/table/table-controls.d.mts +0 -10
- package/dist/extensions/table/table/table-controls.d.ts +0 -10
- package/dist/extensions/table/table/table-controls.js +0 -129
- package/dist/extensions/table/table/table-controls.mjs +0 -8
- package/dist/extensions/table/table/table-view.d.mts +0 -43
- package/dist/extensions/table/table/table-view.d.ts +0 -43
- package/dist/extensions/table/table/table-view.js +0 -610
- package/dist/extensions/table/table/table-view.mjs +0 -12
- package/dist/extensions/table/table/table.d.mts +0 -17
- package/dist/extensions/table/table/table.d.ts +0 -17
- package/dist/extensions/table/table/table.js +0 -816
- package/dist/extensions/table/table/table.mjs +0 -15
- package/dist/extensions/table/table/utilities/col-style.d.mts +0 -3
- package/dist/extensions/table/table/utilities/col-style.d.ts +0 -3
- package/dist/extensions/table/table/utilities/col-style.js +0 -36
- package/dist/extensions/table/table/utilities/col-style.mjs +0 -8
- package/dist/extensions/table/table/utilities/delete-table-when-all-cells-selected.d.mts +0 -5
- package/dist/extensions/table/table/utilities/delete-table-when-all-cells-selected.d.ts +0 -5
- package/dist/extensions/table/table/utilities/delete-table-when-all-cells-selected.js +0 -66
- package/dist/extensions/table/table/utilities/delete-table-when-all-cells-selected.mjs +0 -40
- package/dist/extensions/table/table/utilities/get-table-node-types.d.mts +0 -7
- package/dist/extensions/table/table/utilities/get-table-node-types.d.ts +0 -7
- package/dist/extensions/table/table/utilities/get-table-node-types.js +0 -44
- package/dist/extensions/table/table/utilities/get-table-node-types.mjs +0 -21
- package/dist/extensions/table/table/utilities/insert-line-above-table-action.d.mts +0 -5
- package/dist/extensions/table/table/utilities/insert-line-above-table-action.d.ts +0 -5
- package/dist/extensions/table/table/utilities/insert-line-above-table-action.js +0 -80
- package/dist/extensions/table/table/utilities/insert-line-above-table-action.mjs +0 -9
- package/dist/extensions/table/table/utilities/insert-line-below-table-action.d.mts +0 -5
- package/dist/extensions/table/table/utilities/insert-line-below-table-action.d.ts +0 -5
- package/dist/extensions/table/table/utilities/insert-line-below-table-action.js +0 -79
- package/dist/extensions/table/table/utilities/insert-line-below-table-action.mjs +0 -9
- package/dist/extensions/table/table/utilities/is-cell-selection.d.mts +0 -5
- package/dist/extensions/table/table/utilities/is-cell-selection.d.ts +0 -5
- package/dist/extensions/table/table/utilities/is-cell-selection.js +0 -34
- package/dist/extensions/table/table/utilities/is-cell-selection.mjs +0 -8
- package/dist/extensions/table/table-cell.d.mts +0 -8
- package/dist/extensions/table/table-cell.d.ts +0 -8
- package/dist/extensions/table/table-cell.js +0 -139
- package/dist/extensions/table/table-cell.mjs +0 -8
- package/dist/extensions/table/table-header.d.mts +0 -6
- package/dist/extensions/table/table-header.d.ts +0 -6
- package/dist/extensions/table/table-header.js +0 -104
- package/dist/extensions/table/table-header.mjs +0 -8
- package/dist/extensions/table/table-row.d.mts +0 -6
- package/dist/extensions/table/table-row.d.ts +0 -6
- package/dist/extensions/table/table-row.js +0 -35
- package/dist/extensions/table/table-row.mjs +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kopexa/tiptap",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "our tiptap components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tiptap"
|
|
@@ -28,46 +28,52 @@
|
|
|
28
28
|
"motion": ">=12.23.6",
|
|
29
29
|
"react": ">=19.0.0-rc.0",
|
|
30
30
|
"react-dom": ">=19.0.0-rc.0",
|
|
31
|
-
"@kopexa/theme": "2.
|
|
31
|
+
"@kopexa/theme": "2.1.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@floating-ui/dom": "^1.7.4",
|
|
35
35
|
"@floating-ui/react": "^0.27.16",
|
|
36
|
-
"
|
|
37
|
-
"@tiptap/
|
|
38
|
-
"@tiptap/extension-
|
|
39
|
-
"@tiptap/extension-
|
|
40
|
-
"@tiptap/extension-link": "^3.
|
|
41
|
-
"@tiptap/extension-
|
|
42
|
-
"@tiptap/extension-
|
|
43
|
-
"@tiptap/extension-
|
|
44
|
-
"@tiptap/extension-
|
|
45
|
-
"@tiptap/extension-task-
|
|
46
|
-
"@tiptap/extension-
|
|
47
|
-
"@tiptap/extension-
|
|
48
|
-
"@tiptap/extension-
|
|
49
|
-
"@tiptap/
|
|
50
|
-
"@tiptap/
|
|
51
|
-
"@tiptap/
|
|
52
|
-
"@tiptap/
|
|
53
|
-
"@tiptap/
|
|
36
|
+
"@tiptap/core": "^3.6.1",
|
|
37
|
+
"@tiptap/extension-collaboration": "^3.6.1",
|
|
38
|
+
"@tiptap/extension-highlight": "^3.6.1",
|
|
39
|
+
"@tiptap/extension-invisible-characters": "^3.6.1",
|
|
40
|
+
"@tiptap/extension-link": "^3.6.1",
|
|
41
|
+
"@tiptap/extension-list": "^3.6.1",
|
|
42
|
+
"@tiptap/extension-subscript": "^3.6.1",
|
|
43
|
+
"@tiptap/extension-superscript": "^3.6.1",
|
|
44
|
+
"@tiptap/extension-table-of-contents": "^3.6.1",
|
|
45
|
+
"@tiptap/extension-task-item": "^3.6.1",
|
|
46
|
+
"@tiptap/extension-task-list": "^3.6.1",
|
|
47
|
+
"@tiptap/extension-text-align": "^3.6.1",
|
|
48
|
+
"@tiptap/extension-text-style": "^3.6.1",
|
|
49
|
+
"@tiptap/extension-typography": "^3.6.1",
|
|
50
|
+
"@tiptap/extension-unique-id": "^3.6.1",
|
|
51
|
+
"@tiptap/extensions": "^3.6.1",
|
|
52
|
+
"@tiptap/pm": "3.6.1",
|
|
53
|
+
"@tiptap/react": "^3.6.1",
|
|
54
|
+
"@tiptap/starter-kit": "^3.6.1",
|
|
55
|
+
"@tiptap/suggestion": "^3.6.1",
|
|
54
56
|
"jsx-dom-cjs": "^8.1.6",
|
|
55
57
|
"markdown-it": "^14.1.0",
|
|
56
58
|
"react-hotkeys-hook": "^5.1.0",
|
|
57
|
-
"
|
|
58
|
-
"@kopexa/
|
|
59
|
-
"@kopexa/
|
|
60
|
-
"@kopexa/
|
|
61
|
-
"@kopexa/
|
|
62
|
-
"@kopexa/
|
|
63
|
-
"@kopexa/
|
|
59
|
+
"react-intl": "^7.1.11",
|
|
60
|
+
"@kopexa/button": "10.0.0",
|
|
61
|
+
"@kopexa/chip": "5.0.0",
|
|
62
|
+
"@kopexa/dropdown-menu": "5.0.0",
|
|
63
|
+
"@kopexa/editor-utils": "1.0.0",
|
|
64
|
+
"@kopexa/extension-controlref": "2.0.0",
|
|
65
|
+
"@kopexa/extension-table": "1.0.0",
|
|
66
|
+
"@kopexa/icons": "12.0.0",
|
|
67
|
+
"@kopexa/input": "5.0.0",
|
|
68
|
+
"@kopexa/popover": "12.0.0",
|
|
64
69
|
"@kopexa/react-utils": "3.0.0",
|
|
65
|
-
"@kopexa/separator": "
|
|
70
|
+
"@kopexa/separator": "4.0.0",
|
|
66
71
|
"@kopexa/shared-utils": "2.0.0",
|
|
67
|
-
"@kopexa/tabs": "
|
|
72
|
+
"@kopexa/tabs": "4.0.0",
|
|
73
|
+
"@kopexa/toolbar": "2.0.0",
|
|
68
74
|
"@kopexa/use-composed-ref": "1.0.0",
|
|
69
75
|
"@kopexa/use-is-mobile": "1.0.0",
|
|
70
|
-
"@kopexa/
|
|
76
|
+
"@kopexa/extension-code": "1.0.0"
|
|
71
77
|
},
|
|
72
78
|
"clean-package": "../../../clean-package.config.json",
|
|
73
79
|
"module": "dist/index.mjs",
|
package/dist/chunk-4HTILXJM.mjs
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
TrailingNode
|
|
4
|
-
} from "./chunk-H6LC4LDQ.mjs";
|
|
5
|
-
import {
|
|
6
|
-
UiState
|
|
7
|
-
} from "./chunk-KR42JAVB.mjs";
|
|
8
|
-
import {
|
|
9
|
-
safeParseContent
|
|
10
|
-
} from "./chunk-7LHOYNVF.mjs";
|
|
11
|
-
import {
|
|
12
|
-
Link
|
|
13
|
-
} from "./chunk-CUT6PA4X.mjs";
|
|
14
|
-
import {
|
|
15
|
-
Selection
|
|
16
|
-
} from "./chunk-U5XAL46P.mjs";
|
|
17
|
-
import {
|
|
18
|
-
TableKit
|
|
19
|
-
} from "./chunk-BXPGSCTT.mjs";
|
|
20
|
-
|
|
21
|
-
// src/hooks/use-create-editor.ts
|
|
22
|
-
import { ControlKit } from "@kopexa/extension-controlref";
|
|
23
|
-
import { Highlight } from "@tiptap/extension-highlight";
|
|
24
|
-
import { Subscript } from "@tiptap/extension-subscript";
|
|
25
|
-
import { Superscript } from "@tiptap/extension-superscript";
|
|
26
|
-
import { TaskItem } from "@tiptap/extension-task-item";
|
|
27
|
-
import { TaskList } from "@tiptap/extension-task-list";
|
|
28
|
-
import { TextAlign } from "@tiptap/extension-text-align";
|
|
29
|
-
import { Typography } from "@tiptap/extension-typography";
|
|
30
|
-
import { UniqueID } from "@tiptap/extension-unique-id";
|
|
31
|
-
import { Placeholder } from "@tiptap/extensions";
|
|
32
|
-
import {
|
|
33
|
-
useEditor
|
|
34
|
-
} from "@tiptap/react";
|
|
35
|
-
import { StarterKit } from "@tiptap/starter-kit";
|
|
36
|
-
var useCreateEditor = ({
|
|
37
|
-
content,
|
|
38
|
-
editable = true,
|
|
39
|
-
placeholder = "Write, type '/' for commands\u2026",
|
|
40
|
-
onChange,
|
|
41
|
-
...options
|
|
42
|
-
}) => {
|
|
43
|
-
const editor = useEditor({
|
|
44
|
-
editorProps: {
|
|
45
|
-
attributes: {
|
|
46
|
-
autocomplete: "off",
|
|
47
|
-
autocorrect: "off",
|
|
48
|
-
autocapitalize: "off",
|
|
49
|
-
"aria-label": "Main content area, start typing to enter text."
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
immediatelyRender: false,
|
|
53
|
-
shouldRerenderOnTransaction: false,
|
|
54
|
-
extensions: [
|
|
55
|
-
StarterKit.configure({
|
|
56
|
-
trailingNode: false,
|
|
57
|
-
// we use our custom trailing node extension
|
|
58
|
-
link: false
|
|
59
|
-
// we use our custom link extension
|
|
60
|
-
}),
|
|
61
|
-
TextAlign.configure({ types: ["heading", "paragraph"] }),
|
|
62
|
-
TaskList,
|
|
63
|
-
TaskItem.configure({ nested: true }),
|
|
64
|
-
Highlight.configure({ multicolor: true }),
|
|
65
|
-
Typography,
|
|
66
|
-
Superscript,
|
|
67
|
-
Subscript,
|
|
68
|
-
Selection,
|
|
69
|
-
TrailingNode,
|
|
70
|
-
Link.configure({ openOnClick: !editable }),
|
|
71
|
-
// disable link click when editing
|
|
72
|
-
UniqueID.configure({
|
|
73
|
-
types: [
|
|
74
|
-
"paragraph",
|
|
75
|
-
"bulletList",
|
|
76
|
-
"orderedList",
|
|
77
|
-
"taskList",
|
|
78
|
-
"heading",
|
|
79
|
-
"blockquote",
|
|
80
|
-
"codeBlock"
|
|
81
|
-
]
|
|
82
|
-
// filterTransaction: (transaction) => !isChangeOrigin(transaction),
|
|
83
|
-
}),
|
|
84
|
-
UiState,
|
|
85
|
-
TableKit,
|
|
86
|
-
Placeholder.configure({
|
|
87
|
-
placeholder,
|
|
88
|
-
emptyNodeClass: "is-empty with-slash"
|
|
89
|
-
}),
|
|
90
|
-
ControlKit
|
|
91
|
-
],
|
|
92
|
-
editable,
|
|
93
|
-
onUpdate: ({ editor: editor2 }) => {
|
|
94
|
-
onChange == null ? void 0 : onChange(editor2.getJSON());
|
|
95
|
-
},
|
|
96
|
-
content: safeParseContent(content),
|
|
97
|
-
...options
|
|
98
|
-
});
|
|
99
|
-
return editor;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export {
|
|
103
|
-
useCreateEditor
|
|
104
|
-
};
|
package/dist/chunk-4IIGLBTD.mjs
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/extensions/table/table-header.ts
|
|
4
|
-
import { TableHeader as TiptapTableHeader } from "@tiptap/extension-table";
|
|
5
|
-
var TableHeader = TiptapTableHeader.extend({
|
|
6
|
-
addAttributes() {
|
|
7
|
-
return {
|
|
8
|
-
colspan: {
|
|
9
|
-
default: 1
|
|
10
|
-
},
|
|
11
|
-
rowspan: {
|
|
12
|
-
default: 1
|
|
13
|
-
},
|
|
14
|
-
colwidth: {
|
|
15
|
-
default: null,
|
|
16
|
-
parseHTML: (element) => {
|
|
17
|
-
const colwidth = element.getAttribute("colwidth");
|
|
18
|
-
const value = colwidth ? [Number.parseInt(colwidth, 10)] : null;
|
|
19
|
-
return value;
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
background: {
|
|
23
|
-
default: "none"
|
|
24
|
-
},
|
|
25
|
-
style: {
|
|
26
|
-
default: null
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
// addProseMirrorPlugins() {
|
|
31
|
-
// return [
|
|
32
|
-
// new Plugin({
|
|
33
|
-
// props: {
|
|
34
|
-
// decorations: (state) => {
|
|
35
|
-
// const { isEditable } = this.editor;
|
|
36
|
-
// if (!isEditable) {
|
|
37
|
-
// return DecorationSet.empty;
|
|
38
|
-
// }
|
|
39
|
-
// const { doc, selection } = state;
|
|
40
|
-
// const decorations: Decoration[] = [];
|
|
41
|
-
// const cells = getCellsInRow(0)(selection);
|
|
42
|
-
// if (cells) {
|
|
43
|
-
// cells.forEach(({ pos }, index) => {
|
|
44
|
-
// decorations.push(
|
|
45
|
-
// Decoration.widget(pos + 1, () => {
|
|
46
|
-
// const colSelected = isColumnSelected(index)(selection);
|
|
47
|
-
// let className = "grip-column";
|
|
48
|
-
// if (colSelected) {
|
|
49
|
-
// className += " selected";
|
|
50
|
-
// }
|
|
51
|
-
// if (index === 0) {
|
|
52
|
-
// className += " first";
|
|
53
|
-
// }
|
|
54
|
-
// if (index === cells.length - 1) {
|
|
55
|
-
// className += " last";
|
|
56
|
-
// }
|
|
57
|
-
// const grip = document.createElement("a");
|
|
58
|
-
// grip.className = className;
|
|
59
|
-
// grip.addEventListener("mousedown", (event) => {
|
|
60
|
-
// event.preventDefault();
|
|
61
|
-
// event.stopImmediatePropagation();
|
|
62
|
-
// this.editor.view.dispatch(
|
|
63
|
-
// selectColumn(index)(this.editor.state.tr),
|
|
64
|
-
// );
|
|
65
|
-
// });
|
|
66
|
-
// return grip;
|
|
67
|
-
// }),
|
|
68
|
-
// );
|
|
69
|
-
// });
|
|
70
|
-
// }
|
|
71
|
-
// return DecorationSet.create(doc, decorations);
|
|
72
|
-
// },
|
|
73
|
-
// },
|
|
74
|
-
// }),
|
|
75
|
-
// ];
|
|
76
|
-
// },
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
export {
|
|
80
|
-
TableHeader
|
|
81
|
-
};
|
package/dist/chunk-574UV65T.mjs
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__publicField
|
|
4
|
-
} from "./chunk-WKV76XOR.mjs";
|
|
5
|
-
|
|
6
|
-
// src/extensions/table/table/table-controls.ts
|
|
7
|
-
import { findParentNode } from "@tiptap/core";
|
|
8
|
-
import {
|
|
9
|
-
Plugin,
|
|
10
|
-
PluginKey,
|
|
11
|
-
TextSelection
|
|
12
|
-
} from "@tiptap/pm/state";
|
|
13
|
-
import { Decoration, DecorationSet } from "@tiptap/pm/view";
|
|
14
|
-
var key = new PluginKey("tableControls");
|
|
15
|
-
function tableControls() {
|
|
16
|
-
return new Plugin({
|
|
17
|
-
key,
|
|
18
|
-
state: {
|
|
19
|
-
init() {
|
|
20
|
-
return new TableControlsState();
|
|
21
|
-
},
|
|
22
|
-
apply(tr, prev) {
|
|
23
|
-
return prev.apply(tr);
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
props: {
|
|
27
|
-
handleDOMEvents: {
|
|
28
|
-
mousemove: (view, event) => {
|
|
29
|
-
var _a;
|
|
30
|
-
const pluginState = key.getState(view.state);
|
|
31
|
-
if (!event.target.closest(".table-wrapper") && pluginState.values.hoveredTable) {
|
|
32
|
-
return view.dispatch(
|
|
33
|
-
view.state.tr.setMeta(key, {
|
|
34
|
-
setHoveredTable: null,
|
|
35
|
-
setHoveredCell: null
|
|
36
|
-
})
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
const pos = view.posAtCoords({
|
|
40
|
-
left: event.clientX,
|
|
41
|
-
top: event.clientY
|
|
42
|
-
});
|
|
43
|
-
if (!pos || pos.pos < 0 || pos.pos > view.state.doc.content.size)
|
|
44
|
-
return;
|
|
45
|
-
const table = findParentNode((node) => node.type.name === "table")(
|
|
46
|
-
TextSelection.create(view.state.doc, pos.pos)
|
|
47
|
-
);
|
|
48
|
-
const cell = findParentNode(
|
|
49
|
-
(node) => node.type.name === "tableCell" || node.type.name === "tableHeader"
|
|
50
|
-
)(TextSelection.create(view.state.doc, pos.pos));
|
|
51
|
-
if (!table || !cell) return;
|
|
52
|
-
if (((_a = pluginState.values.hoveredCell) == null ? void 0 : _a.pos) !== cell.pos) {
|
|
53
|
-
return view.dispatch(
|
|
54
|
-
view.state.tr.setMeta(key, {
|
|
55
|
-
setHoveredTable: table,
|
|
56
|
-
setHoveredCell: cell
|
|
57
|
-
})
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
decorations: (state) => {
|
|
63
|
-
const pluginState = key.getState(state);
|
|
64
|
-
if (!pluginState) {
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
const { hoveredTable, hoveredCell } = pluginState.values;
|
|
68
|
-
const docSize = state.doc.content.size;
|
|
69
|
-
if (hoveredTable && hoveredCell && hoveredTable.pos < docSize && hoveredCell.pos < docSize) {
|
|
70
|
-
const decorations = [
|
|
71
|
-
Decoration.node(
|
|
72
|
-
hoveredTable.pos,
|
|
73
|
-
hoveredTable.pos + hoveredTable.node.nodeSize,
|
|
74
|
-
{},
|
|
75
|
-
{
|
|
76
|
-
hoveredTable,
|
|
77
|
-
hoveredCell
|
|
78
|
-
}
|
|
79
|
-
)
|
|
80
|
-
];
|
|
81
|
-
return DecorationSet.create(state.doc, decorations);
|
|
82
|
-
}
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
var TableControlsState = class {
|
|
89
|
-
constructor(props = {}) {
|
|
90
|
-
__publicField(this, "values");
|
|
91
|
-
this.values = {
|
|
92
|
-
hoveredTable: null,
|
|
93
|
-
hoveredCell: null,
|
|
94
|
-
...props
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
apply(tr) {
|
|
98
|
-
const actions = tr.getMeta(key);
|
|
99
|
-
if ((actions == null ? void 0 : actions.setHoveredTable) !== void 0) {
|
|
100
|
-
this.values.hoveredTable = actions.setHoveredTable;
|
|
101
|
-
}
|
|
102
|
-
if ((actions == null ? void 0 : actions.setHoveredCell) !== void 0) {
|
|
103
|
-
this.values.hoveredCell = actions.setHoveredCell;
|
|
104
|
-
}
|
|
105
|
-
return this;
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export {
|
|
110
|
-
tableControls
|
|
111
|
-
};
|
package/dist/chunk-7HC7D256.mjs
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
tableControls
|
|
4
|
-
} from "./chunk-574UV65T.mjs";
|
|
5
|
-
import {
|
|
6
|
-
TableView
|
|
7
|
-
} from "./chunk-AC22DSDA.mjs";
|
|
8
|
-
import {
|
|
9
|
-
insertLineAboveTableAction
|
|
10
|
-
} from "./chunk-TVFWG7IC.mjs";
|
|
11
|
-
import {
|
|
12
|
-
insertLineBelowTableAction
|
|
13
|
-
} from "./chunk-T6P7CS4F.mjs";
|
|
14
|
-
|
|
15
|
-
// src/extensions/table/table/table.ts
|
|
16
|
-
import { Table as TiptapTable } from "@tiptap/extension-table";
|
|
17
|
-
import { columnResizing, tableEditing } from "@tiptap/pm/tables";
|
|
18
|
-
var Table = TiptapTable.extend({
|
|
19
|
-
addOptions() {
|
|
20
|
-
var _a;
|
|
21
|
-
return {
|
|
22
|
-
...(_a = this.parent) == null ? void 0 : _a.call(this),
|
|
23
|
-
HTMLAttributes: {},
|
|
24
|
-
resizable: true,
|
|
25
|
-
handleWidth: 5,
|
|
26
|
-
cellMinWidth: 100,
|
|
27
|
-
lastColumnResizable: true,
|
|
28
|
-
allowTableNodeSelection: true
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
addKeyboardShortcuts() {
|
|
32
|
-
var _a;
|
|
33
|
-
return {
|
|
34
|
-
...(_a = this.parent) == null ? void 0 : _a.call(this),
|
|
35
|
-
Tab: () => {
|
|
36
|
-
if (this.editor.isActive("table")) {
|
|
37
|
-
if (this.editor.isActive("listItem") || this.editor.isActive("taskItem")) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
if (this.editor.commands.goToNextCell()) {
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
if (!this.editor.can().addRowAfter()) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
return this.editor.chain().addRowAfter().goToNextCell().run();
|
|
47
|
-
}
|
|
48
|
-
return false;
|
|
49
|
-
},
|
|
50
|
-
ArrowDown: insertLineBelowTableAction,
|
|
51
|
-
ArrowUp: insertLineAboveTableAction
|
|
52
|
-
};
|
|
53
|
-
},
|
|
54
|
-
addNodeView() {
|
|
55
|
-
return ({ editor, getPos, node, decorations }) => {
|
|
56
|
-
const { cellMinWidth } = this.options;
|
|
57
|
-
return new TableView(
|
|
58
|
-
node,
|
|
59
|
-
cellMinWidth,
|
|
60
|
-
// biome-ignore lint/suspicious/noExplicitAny: prosemirror
|
|
61
|
-
decorations,
|
|
62
|
-
editor,
|
|
63
|
-
getPos
|
|
64
|
-
);
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
addProseMirrorPlugins() {
|
|
68
|
-
const isResizable = this.options.resizable && this.editor.isEditable;
|
|
69
|
-
const plugins = [
|
|
70
|
-
tableEditing({
|
|
71
|
-
allowTableNodeSelection: this.options.allowTableNodeSelection
|
|
72
|
-
}),
|
|
73
|
-
tableControls()
|
|
74
|
-
];
|
|
75
|
-
if (isResizable) {
|
|
76
|
-
plugins.unshift(
|
|
77
|
-
columnResizing({
|
|
78
|
-
handleWidth: this.options.handleWidth,
|
|
79
|
-
cellMinWidth: this.options.cellMinWidth,
|
|
80
|
-
// View: TableView,
|
|
81
|
-
lastColumnResizable: this.options.lastColumnResizable
|
|
82
|
-
})
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
return plugins;
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
export {
|
|
90
|
-
Table
|
|
91
|
-
};
|