@kopexa/tiptap 17.2.1 → 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.
@@ -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-REJEJXOZ.mjs";
23
23
  import {
24
24
  useCreateEditor
25
- } from "./chunk-SCYH6NOA.mjs";
25
+ } from "./chunk-XKWTI3MA.mjs";
26
26
 
27
27
  // src/presets/basic/index.tsx
28
28
  import {
@@ -22,7 +22,7 @@ import {
22
22
  } from "./chunk-N3JE67CS.mjs";
23
23
  import {
24
24
  Link
25
- } from "./chunk-YLDL3VYY.mjs";
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 } from "react";
62
+ import { useEffect, useState } from "react";
63
63
  var useCreateEditor = ({
64
64
  content,
65
65
  editable = true,
@@ -72,6 +72,15 @@ var useCreateEditor = ({
72
72
  }) => {
73
73
  const fileHandlerFromContext = useEditorFile();
74
74
  const fileHandler = fileHandlerProp != null ? fileHandlerProp : fileHandlerFromContext;
75
+ const [extensions] = useState(
76
+ () => getExtensions({
77
+ editable,
78
+ placeholder,
79
+ enableControls,
80
+ controlResolver,
81
+ fileHandler
82
+ })
83
+ );
75
84
  const editor = useEditor({
76
85
  editorProps: {
77
86
  attributes: {
@@ -83,13 +92,7 @@ var useCreateEditor = ({
83
92
  },
84
93
  immediatelyRender: false,
85
94
  shouldRerenderOnTransaction: false,
86
- extensions: getExtensions({
87
- editable,
88
- placeholder,
89
- enableControls,
90
- controlResolver,
91
- fileHandler
92
- }),
95
+ extensions,
93
96
  editable,
94
97
  onUpdate: ({ editor: editor2 }) => {
95
98
  onChange == null ? void 0 : onChange(editor2.getJSON());
@@ -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;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Link
4
- } from "../../chunk-YLDL3VYY.mjs";
4
+ } from "../../chunk-EIIWU5FR.mjs";
5
5
  export {
6
6
  Link
7
7
  };
@@ -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,6 +2375,15 @@ var useCreateEditor = ({
2374
2375
  }) => {
2375
2376
  const fileHandlerFromContext = useEditorFile();
2376
2377
  const fileHandler = fileHandlerProp != null ? fileHandlerProp : fileHandlerFromContext;
2378
+ const [extensions] = (0, import_react26.useState)(
2379
+ () => getExtensions({
2380
+ editable,
2381
+ placeholder,
2382
+ enableControls,
2383
+ controlResolver,
2384
+ fileHandler
2385
+ })
2386
+ );
2377
2387
  const editor = (0, import_react25.useEditor)({
2378
2388
  editorProps: {
2379
2389
  attributes: {
@@ -2385,13 +2395,7 @@ var useCreateEditor = ({
2385
2395
  },
2386
2396
  immediatelyRender: false,
2387
2397
  shouldRerenderOnTransaction: false,
2388
- extensions: getExtensions({
2389
- editable,
2390
- placeholder,
2391
- enableControls,
2392
- controlResolver,
2393
- fileHandler
2394
- }),
2398
+ extensions,
2395
2399
  editable,
2396
2400
  onUpdate: ({ editor: editor2 }) => {
2397
2401
  onChange == null ? void 0 : onChange(editor2.getJSON());
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getExtensions,
4
4
  useCreateEditor
5
- } from "../chunk-SCYH6NOA.mjs";
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-YLDL3VYY.mjs";
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,6 +2443,15 @@ var useCreateEditor = ({
2442
2443
  }) => {
2443
2444
  const fileHandlerFromContext = useEditorFile();
2444
2445
  const fileHandler = fileHandlerProp != null ? fileHandlerProp : fileHandlerFromContext;
2446
+ const [extensions] = (0, import_react26.useState)(
2447
+ () => getExtensions({
2448
+ editable,
2449
+ placeholder,
2450
+ enableControls,
2451
+ controlResolver,
2452
+ fileHandler
2453
+ })
2454
+ );
2445
2455
  const editor = (0, import_react25.useEditor)({
2446
2456
  editorProps: {
2447
2457
  attributes: {
@@ -2453,13 +2463,7 @@ var useCreateEditor = ({
2453
2463
  },
2454
2464
  immediatelyRender: false,
2455
2465
  shouldRerenderOnTransaction: false,
2456
- extensions: getExtensions({
2457
- editable,
2458
- placeholder,
2459
- enableControls,
2460
- controlResolver,
2461
- fileHandler
2462
- }),
2466
+ extensions,
2463
2467
  editable,
2464
2468
  onUpdate: ({ editor: editor2 }) => {
2465
2469
  onChange == null ? void 0 : onChange(editor2.getJSON());
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  BasicEditor
4
- } from "./chunk-VFCZOVWU.mjs";
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-SCYH6NOA.mjs";
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-YLDL3VYY.mjs";
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,6 +2384,15 @@ var useCreateEditor = ({
2383
2384
  }) => {
2384
2385
  const fileHandlerFromContext = useEditorFile();
2385
2386
  const fileHandler = fileHandlerProp != null ? fileHandlerProp : fileHandlerFromContext;
2387
+ const [extensions] = (0, import_react26.useState)(
2388
+ () => getExtensions({
2389
+ editable,
2390
+ placeholder,
2391
+ enableControls,
2392
+ controlResolver,
2393
+ fileHandler
2394
+ })
2395
+ );
2386
2396
  const editor = (0, import_react25.useEditor)({
2387
2397
  editorProps: {
2388
2398
  attributes: {
@@ -2394,13 +2404,7 @@ var useCreateEditor = ({
2394
2404
  },
2395
2405
  immediatelyRender: false,
2396
2406
  shouldRerenderOnTransaction: false,
2397
- extensions: getExtensions({
2398
- editable,
2399
- placeholder,
2400
- enableControls,
2401
- controlResolver,
2402
- fileHandler
2403
- }),
2407
+ extensions,
2404
2408
  editable,
2405
2409
  onUpdate: ({ editor: editor2 }) => {
2406
2410
  onChange == null ? void 0 : onChange(editor2.getJSON());
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  import {
4
4
  BasicEditor
5
- } from "../../chunk-VFCZOVWU.mjs";
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-SCYH6NOA.mjs";
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-YLDL3VYY.mjs";
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.1",
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.1"
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.20",
66
- "@kopexa/callout": "17.0.20",
67
- "@kopexa/dialog": "17.0.20",
68
- "@kopexa/dropdown-menu": "17.0.20",
69
- "@kopexa/editor-utils": "17.0.20",
70
- "@kopexa/chip": "17.1.17",
71
- "@kopexa/extension-code": "17.0.20",
72
- "@kopexa/extension-controlref": "17.1.2",
73
- "@kopexa/icons": "17.3.2",
74
- "@kopexa/extension-table": "17.0.20",
75
- "@kopexa/input": "17.0.20",
76
- "@kopexa/label": "17.0.20",
77
- "@kopexa/select": "17.0.20",
78
- "@kopexa/popover": "17.0.20",
79
- "@kopexa/switch": "17.0.20",
80
- "@kopexa/react-utils": "17.0.20",
81
- "@kopexa/separator": "17.0.20",
82
- "@kopexa/tabs": "17.0.20",
83
- "@kopexa/toolbar": "17.0.20",
84
- "@kopexa/use-composed-ref": "17.0.20",
85
- "@kopexa/shared-utils": "17.0.20",
86
- "@kopexa/use-is-mobile": "17.0.20"
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",