@kopexa/tiptap 17.2.2 → 17.2.3
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-YLDL3VYY.mjs → chunk-EIIWU5FR.mjs} +2 -1
- package/dist/{chunk-5QFCLKHL.mjs → chunk-NJZK5DRT.mjs} +1 -1
- package/dist/{chunk-SSJMKQ5G.mjs → chunk-XKWTI3MA.mjs} +4 -7
- package/dist/extensions/link/index.js +1 -0
- package/dist/extensions/link/index.mjs +1 -1
- package/dist/hooks/use-create-editor.js +3 -5
- package/dist/hooks/use-create-editor.mjs +2 -2
- package/dist/index.js +3 -5
- package/dist/index.mjs +3 -3
- package/dist/presets/basic/index.js +3 -5
- package/dist/presets/basic/index.mjs +3 -3
- package/package.json +24 -24
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// src/extensions/link/index.ts
|
|
4
4
|
import TiptapLink from "@tiptap/extension-link";
|
|
5
|
-
import { Plugin, TextSelection } from "@tiptap/pm/state";
|
|
5
|
+
import { Plugin, PluginKey, TextSelection } from "@tiptap/pm/state";
|
|
6
6
|
import { getMarkRange } from "@tiptap/react";
|
|
7
7
|
var Link = TiptapLink.extend({
|
|
8
8
|
inclusive: false,
|
|
@@ -19,6 +19,7 @@ var Link = TiptapLink.extend({
|
|
|
19
19
|
return [
|
|
20
20
|
...((_a = this.parent) == null ? void 0 : _a.call(this)) || [],
|
|
21
21
|
new Plugin({
|
|
22
|
+
key: new PluginKey("linkKeyHandler"),
|
|
22
23
|
props: {
|
|
23
24
|
handleKeyDown: (_, event) => {
|
|
24
25
|
const { selection } = editor.state;
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./chunk-N3JE67CS.mjs";
|
|
23
23
|
import {
|
|
24
24
|
Link
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-EIIWU5FR.mjs";
|
|
26
26
|
import {
|
|
27
27
|
UiState
|
|
28
28
|
} from "./chunk-KR42JAVB.mjs";
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
useEditor
|
|
60
60
|
} from "@tiptap/react";
|
|
61
61
|
import { StarterKit } from "@tiptap/starter-kit";
|
|
62
|
-
import { useEffect,
|
|
62
|
+
import { useEffect, useState } from "react";
|
|
63
63
|
var useCreateEditor = ({
|
|
64
64
|
content,
|
|
65
65
|
editable = true,
|
|
@@ -72,17 +72,14 @@ var useCreateEditor = ({
|
|
|
72
72
|
}) => {
|
|
73
73
|
const fileHandlerFromContext = useEditorFile();
|
|
74
74
|
const fileHandler = fileHandlerProp != null ? fileHandlerProp : fileHandlerFromContext;
|
|
75
|
-
const extensions =
|
|
75
|
+
const [extensions] = useState(
|
|
76
76
|
() => getExtensions({
|
|
77
77
|
editable,
|
|
78
78
|
placeholder,
|
|
79
79
|
enableControls,
|
|
80
80
|
controlResolver,
|
|
81
81
|
fileHandler
|
|
82
|
-
})
|
|
83
|
-
// Only recreate extensions when these values change
|
|
84
|
-
// Note: fileHandler and controlResolver are object references, so they should be stable
|
|
85
|
-
[editable, placeholder, enableControls, controlResolver, fileHandler]
|
|
82
|
+
})
|
|
86
83
|
);
|
|
87
84
|
const editor = useEditor({
|
|
88
85
|
editorProps: {
|
|
@@ -52,6 +52,7 @@ var Link = import_extension_link.default.extend({
|
|
|
52
52
|
return [
|
|
53
53
|
...((_a = this.parent) == null ? void 0 : _a.call(this)) || [],
|
|
54
54
|
new import_state.Plugin({
|
|
55
|
+
key: new import_state.PluginKey("linkKeyHandler"),
|
|
55
56
|
props: {
|
|
56
57
|
handleKeyDown: (_, event) => {
|
|
57
58
|
const { selection } = editor.state;
|
|
@@ -1044,6 +1044,7 @@ var Link = import_extension_link.default.extend({
|
|
|
1044
1044
|
return [
|
|
1045
1045
|
...((_a = this.parent) == null ? void 0 : _a.call(this)) || [],
|
|
1046
1046
|
new import_state.Plugin({
|
|
1047
|
+
key: new import_state.PluginKey("linkKeyHandler"),
|
|
1047
1048
|
props: {
|
|
1048
1049
|
handleKeyDown: (_, event) => {
|
|
1049
1050
|
const { selection } = editor.state;
|
|
@@ -2374,17 +2375,14 @@ var useCreateEditor = ({
|
|
|
2374
2375
|
}) => {
|
|
2375
2376
|
const fileHandlerFromContext = useEditorFile();
|
|
2376
2377
|
const fileHandler = fileHandlerProp != null ? fileHandlerProp : fileHandlerFromContext;
|
|
2377
|
-
const extensions = (0, import_react26.
|
|
2378
|
+
const [extensions] = (0, import_react26.useState)(
|
|
2378
2379
|
() => getExtensions({
|
|
2379
2380
|
editable,
|
|
2380
2381
|
placeholder,
|
|
2381
2382
|
enableControls,
|
|
2382
2383
|
controlResolver,
|
|
2383
2384
|
fileHandler
|
|
2384
|
-
})
|
|
2385
|
-
// Only recreate extensions when these values change
|
|
2386
|
-
// Note: fileHandler and controlResolver are object references, so they should be stable
|
|
2387
|
-
[editable, placeholder, enableControls, controlResolver, fileHandler]
|
|
2385
|
+
})
|
|
2388
2386
|
);
|
|
2389
2387
|
const editor = (0, import_react25.useEditor)({
|
|
2390
2388
|
editorProps: {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getExtensions,
|
|
4
4
|
useCreateEditor
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-XKWTI3MA.mjs";
|
|
6
6
|
import "../chunk-H6LC4LDQ.mjs";
|
|
7
7
|
import "../chunk-2U5CQUZH.mjs";
|
|
8
8
|
import "../chunk-7VW67NVL.mjs";
|
|
@@ -20,7 +20,7 @@ import "../chunk-Z365KVQY.mjs";
|
|
|
20
20
|
import "../chunk-N3JE67CS.mjs";
|
|
21
21
|
import "../chunk-EAAQE5ZV.mjs";
|
|
22
22
|
import "../chunk-DSBJFMHK.mjs";
|
|
23
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-EIIWU5FR.mjs";
|
|
24
24
|
import "../chunk-KR42JAVB.mjs";
|
|
25
25
|
import "../chunk-3VRQUYYW.mjs";
|
|
26
26
|
import "../chunk-32SUXCAQ.mjs";
|
package/dist/index.js
CHANGED
|
@@ -2083,6 +2083,7 @@ var Link = import_extension_link.default.extend({
|
|
|
2083
2083
|
return [
|
|
2084
2084
|
...((_a = this.parent) == null ? void 0 : _a.call(this)) || [],
|
|
2085
2085
|
new import_state.Plugin({
|
|
2086
|
+
key: new import_state.PluginKey("linkKeyHandler"),
|
|
2086
2087
|
props: {
|
|
2087
2088
|
handleKeyDown: (_, event) => {
|
|
2088
2089
|
const { selection } = editor.state;
|
|
@@ -2442,17 +2443,14 @@ var useCreateEditor = ({
|
|
|
2442
2443
|
}) => {
|
|
2443
2444
|
const fileHandlerFromContext = useEditorFile();
|
|
2444
2445
|
const fileHandler = fileHandlerProp != null ? fileHandlerProp : fileHandlerFromContext;
|
|
2445
|
-
const extensions = (0, import_react26.
|
|
2446
|
+
const [extensions] = (0, import_react26.useState)(
|
|
2446
2447
|
() => getExtensions({
|
|
2447
2448
|
editable,
|
|
2448
2449
|
placeholder,
|
|
2449
2450
|
enableControls,
|
|
2450
2451
|
controlResolver,
|
|
2451
2452
|
fileHandler
|
|
2452
|
-
})
|
|
2453
|
-
// Only recreate extensions when these values change
|
|
2454
|
-
// Note: fileHandler and controlResolver are object references, so they should be stable
|
|
2455
|
-
[editable, placeholder, enableControls, controlResolver, fileHandler]
|
|
2453
|
+
})
|
|
2456
2454
|
);
|
|
2457
2455
|
const editor = (0, import_react25.useEditor)({
|
|
2458
2456
|
editorProps: {
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
BasicEditor
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NJZK5DRT.mjs";
|
|
5
5
|
import "./chunk-MNTOOEHA.mjs";
|
|
6
6
|
import "./chunk-3ZPLSXTZ.mjs";
|
|
7
7
|
import "./chunk-6552DQWB.mjs";
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
import "./chunk-REJEJXOZ.mjs";
|
|
52
52
|
import {
|
|
53
53
|
getExtensions
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-XKWTI3MA.mjs";
|
|
55
55
|
import "./chunk-H6LC4LDQ.mjs";
|
|
56
56
|
import {
|
|
57
57
|
MathBlock
|
|
@@ -79,7 +79,7 @@ import {
|
|
|
79
79
|
} from "./chunk-N3JE67CS.mjs";
|
|
80
80
|
import "./chunk-EAAQE5ZV.mjs";
|
|
81
81
|
import "./chunk-DSBJFMHK.mjs";
|
|
82
|
-
import "./chunk-
|
|
82
|
+
import "./chunk-EIIWU5FR.mjs";
|
|
83
83
|
import "./chunk-KR42JAVB.mjs";
|
|
84
84
|
import "./chunk-3VRQUYYW.mjs";
|
|
85
85
|
import {
|
|
@@ -1053,6 +1053,7 @@ var Link = import_extension_link.default.extend({
|
|
|
1053
1053
|
return [
|
|
1054
1054
|
...((_a = this.parent) == null ? void 0 : _a.call(this)) || [],
|
|
1055
1055
|
new import_state.Plugin({
|
|
1056
|
+
key: new import_state.PluginKey("linkKeyHandler"),
|
|
1056
1057
|
props: {
|
|
1057
1058
|
handleKeyDown: (_, event) => {
|
|
1058
1059
|
const { selection } = editor.state;
|
|
@@ -2383,17 +2384,14 @@ var useCreateEditor = ({
|
|
|
2383
2384
|
}) => {
|
|
2384
2385
|
const fileHandlerFromContext = useEditorFile();
|
|
2385
2386
|
const fileHandler = fileHandlerProp != null ? fileHandlerProp : fileHandlerFromContext;
|
|
2386
|
-
const extensions = (0, import_react26.
|
|
2387
|
+
const [extensions] = (0, import_react26.useState)(
|
|
2387
2388
|
() => getExtensions({
|
|
2388
2389
|
editable,
|
|
2389
2390
|
placeholder,
|
|
2390
2391
|
enableControls,
|
|
2391
2392
|
controlResolver,
|
|
2392
2393
|
fileHandler
|
|
2393
|
-
})
|
|
2394
|
-
// Only recreate extensions when these values change
|
|
2395
|
-
// Note: fileHandler and controlResolver are object references, so they should be stable
|
|
2396
|
-
[editable, placeholder, enableControls, controlResolver, fileHandler]
|
|
2394
|
+
})
|
|
2397
2395
|
);
|
|
2398
2396
|
const editor = (0, import_react25.useEditor)({
|
|
2399
2397
|
editorProps: {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import {
|
|
4
4
|
BasicEditor
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-NJZK5DRT.mjs";
|
|
6
6
|
import "../../chunk-MNTOOEHA.mjs";
|
|
7
7
|
import "../../chunk-3ZPLSXTZ.mjs";
|
|
8
8
|
import "../../chunk-6552DQWB.mjs";
|
|
@@ -45,7 +45,7 @@ import "../../chunk-P55PLOHR.mjs";
|
|
|
45
45
|
import "../../chunk-BXJYNSWQ.mjs";
|
|
46
46
|
import "../../chunk-TZQQ6C2Q.mjs";
|
|
47
47
|
import "../../chunk-REJEJXOZ.mjs";
|
|
48
|
-
import "../../chunk-
|
|
48
|
+
import "../../chunk-XKWTI3MA.mjs";
|
|
49
49
|
import "../../chunk-H6LC4LDQ.mjs";
|
|
50
50
|
import "../../chunk-2U5CQUZH.mjs";
|
|
51
51
|
import "../../chunk-7VW67NVL.mjs";
|
|
@@ -63,7 +63,7 @@ import "../../chunk-Z365KVQY.mjs";
|
|
|
63
63
|
import "../../chunk-N3JE67CS.mjs";
|
|
64
64
|
import "../../chunk-EAAQE5ZV.mjs";
|
|
65
65
|
import "../../chunk-DSBJFMHK.mjs";
|
|
66
|
-
import "../../chunk-
|
|
66
|
+
import "../../chunk-EIIWU5FR.mjs";
|
|
67
67
|
import "../../chunk-KR42JAVB.mjs";
|
|
68
68
|
import "../../chunk-3VRQUYYW.mjs";
|
|
69
69
|
import "../../chunk-32SUXCAQ.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kopexa/tiptap",
|
|
3
|
-
"version": "17.2.
|
|
3
|
+
"version": "17.2.3",
|
|
4
4
|
"description": "our tiptap components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tiptap"
|
|
@@ -28,7 +28,7 @@
|
|
|
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": "17.11.
|
|
31
|
+
"@kopexa/theme": "17.11.3"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@floating-ui/dom": "^1.7.4",
|
|
@@ -62,28 +62,28 @@
|
|
|
62
62
|
"markdown-it": "^14.1.0",
|
|
63
63
|
"react-hotkeys-hook": "^5.2.3",
|
|
64
64
|
"react-intl": "^7.1.14",
|
|
65
|
-
"@kopexa/button": "17.0.
|
|
66
|
-
"@kopexa/
|
|
67
|
-
"@kopexa/
|
|
68
|
-
"@kopexa/
|
|
69
|
-
"@kopexa/
|
|
70
|
-
"@kopexa/
|
|
71
|
-
"@kopexa/extension-controlref": "17.1.
|
|
72
|
-
"@kopexa/
|
|
73
|
-
"@kopexa/
|
|
74
|
-
"@kopexa/
|
|
75
|
-
"@kopexa/
|
|
76
|
-
"@kopexa/
|
|
77
|
-
"@kopexa/
|
|
78
|
-
"@kopexa/
|
|
79
|
-
"@kopexa/
|
|
80
|
-
"@kopexa/
|
|
81
|
-
"@kopexa/separator": "17.0.
|
|
82
|
-
"@kopexa/shared-utils": "17.0.
|
|
83
|
-
"@kopexa/tabs": "17.0.
|
|
84
|
-
"@kopexa/toolbar": "17.0.
|
|
85
|
-
"@kopexa/use-
|
|
86
|
-
"@kopexa/use-
|
|
65
|
+
"@kopexa/button": "17.0.22",
|
|
66
|
+
"@kopexa/callout": "17.0.22",
|
|
67
|
+
"@kopexa/dialog": "17.0.22",
|
|
68
|
+
"@kopexa/chip": "17.1.19",
|
|
69
|
+
"@kopexa/editor-utils": "17.0.22",
|
|
70
|
+
"@kopexa/dropdown-menu": "17.0.22",
|
|
71
|
+
"@kopexa/extension-controlref": "17.1.4",
|
|
72
|
+
"@kopexa/extension-table": "17.0.22",
|
|
73
|
+
"@kopexa/icons": "17.3.4",
|
|
74
|
+
"@kopexa/extension-code": "17.0.22",
|
|
75
|
+
"@kopexa/input": "17.0.22",
|
|
76
|
+
"@kopexa/label": "17.0.22",
|
|
77
|
+
"@kopexa/select": "17.0.22",
|
|
78
|
+
"@kopexa/switch": "17.0.22",
|
|
79
|
+
"@kopexa/popover": "17.0.22",
|
|
80
|
+
"@kopexa/react-utils": "17.0.22",
|
|
81
|
+
"@kopexa/separator": "17.0.22",
|
|
82
|
+
"@kopexa/shared-utils": "17.0.22",
|
|
83
|
+
"@kopexa/tabs": "17.0.22",
|
|
84
|
+
"@kopexa/toolbar": "17.0.22",
|
|
85
|
+
"@kopexa/use-is-mobile": "17.0.22",
|
|
86
|
+
"@kopexa/use-composed-ref": "17.0.22"
|
|
87
87
|
},
|
|
88
88
|
"clean-package": "../../../clean-package.config.json",
|
|
89
89
|
"module": "dist/index.mjs",
|