@kopexa/tiptap 17.4.0 → 17.6.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.
@@ -18,9 +18,10 @@ function BubbleMenu({ editor }) {
18
18
  TiptapBubbleMenu,
19
19
  {
20
20
  editor,
21
- shouldShow: ({ editor: e, state }) => {
21
+ shouldShow: ({ editor: e, state, view }) => {
22
22
  const { selection } = state;
23
23
  const { empty } = selection;
24
+ if (!view.hasFocus()) return false;
24
25
  if (empty) return false;
25
26
  if (e.isActive("codeBlock")) return false;
26
27
  if (e.isActive("link")) return false;
@@ -7,10 +7,10 @@ import {
7
7
  } from "./chunk-DZLGLP7R.mjs";
8
8
  import {
9
9
  LinkBubble
10
- } from "./chunk-XNDXYI2N.mjs";
10
+ } from "./chunk-XGAABDMW.mjs";
11
11
  import {
12
12
  BubbleMenu
13
- } from "./chunk-GL3RTIER.mjs";
13
+ } from "./chunk-2UDCL55K.mjs";
14
14
  import {
15
15
  VariableSuggestion
16
16
  } from "./chunk-H7MS2UMO.mjs";
@@ -47,6 +47,7 @@ var BasicEditor = ({
47
47
  content,
48
48
  variables,
49
49
  variableValues,
50
+ showToolbar = true,
50
51
  ...options
51
52
  }) => {
52
53
  const editor = useCreateEditor({
@@ -65,9 +66,9 @@ var BasicEditor = ({
65
66
  const isBottomToolbar = variant === "field";
66
67
  const hasVariables = variables && variables.length > 0;
67
68
  const editorContent = /* @__PURE__ */ jsx(EditorUIProvider, { value: { styles }, children: /* @__PURE__ */ jsx("div", { className: styles.root(), "data-slot": "editor", children: /* @__PURE__ */ jsxs(EditorContext.Provider, { value: { editor }, children: [
68
- !isBottomToolbar && /* @__PURE__ */ jsx(EditorHeader, { editor, variant }),
69
+ showToolbar && !isBottomToolbar && /* @__PURE__ */ jsx(EditorHeader, { editor, variant }),
69
70
  /* @__PURE__ */ jsx(EditorContentArea, { variant, variables }),
70
- isBottomToolbar && /* @__PURE__ */ jsx(EditorHeader, { editor, variant })
71
+ showToolbar && isBottomToolbar && /* @__PURE__ */ jsx(EditorHeader, { editor, variant })
71
72
  ] }) }) });
72
73
  if (hasVariables) {
73
74
  return /* @__PURE__ */ jsx(VariableProvider, { variables, resolveVariable, children: editorContent });
@@ -79,29 +80,67 @@ var EditorContentArea = ({ variant, variables }) => {
79
80
  const { editor } = useContext(EditorContext);
80
81
  const { isDragging } = useUiEditorState(editor);
81
82
  useScrollToHash();
83
+ const handleKeyDown = useCallback(
84
+ (e) => {
85
+ if (!(editor == null ? void 0 : editor.isFocused)) return;
86
+ const isMod = e.metaKey || e.ctrlKey;
87
+ const key = e.key.toLowerCase();
88
+ const editorShortcuts = [
89
+ isMod && key === "b",
90
+ // Bold
91
+ isMod && key === "i",
92
+ // Italic
93
+ isMod && key === "u",
94
+ // Underline
95
+ isMod && e.shiftKey && key === "x",
96
+ // Strikethrough
97
+ isMod && key === "k",
98
+ // Link
99
+ isMod && key === "z",
100
+ // Undo
101
+ isMod && e.shiftKey && key === "z",
102
+ // Redo
103
+ isMod && key === "y",
104
+ // Redo (alternative)
105
+ isMod && key === "a",
106
+ // Select all
107
+ isMod && key === "e",
108
+ // Code
109
+ isMod && e.shiftKey && key === "e"
110
+ // Code block
111
+ ];
112
+ if (editorShortcuts.some(Boolean)) {
113
+ e.stopPropagation();
114
+ }
115
+ },
116
+ [editor]
117
+ );
82
118
  if (!editor) {
83
119
  return null;
84
120
  }
85
121
  const isEditable = editor.isEditable;
86
- return /* @__PURE__ */ jsxs("div", { className: styles.wrapper(), children: [
87
- /* @__PURE__ */ jsxs(
88
- EditorContent,
89
- {
90
- editor,
91
- role: "presentation",
92
- className: styles.content(),
93
- style: {
94
- cursor: isDragging ? "grabbing" : "auto"
95
- },
96
- children: [
97
- isEditable && /* @__PURE__ */ jsx(SlashDropdownMenu, {}),
98
- isEditable && variables && variables.length > 0 && /* @__PURE__ */ jsx(VariableSuggestion, { editor, variables })
99
- ]
100
- }
101
- ),
102
- isEditable && /* @__PURE__ */ jsx(BubbleMenu, { editor }),
103
- isEditable && /* @__PURE__ */ jsx(LinkBubble, { editor })
104
- ] });
122
+ return (
123
+ // biome-ignore lint/a11y/noStaticElementInteractions: Wrapper intercepts keyboard shortcuts to prevent propagation
124
+ /* @__PURE__ */ jsxs("div", { className: styles.wrapper(), onKeyDown: handleKeyDown, children: [
125
+ /* @__PURE__ */ jsxs(
126
+ EditorContent,
127
+ {
128
+ editor,
129
+ role: "presentation",
130
+ className: styles.content(),
131
+ style: {
132
+ cursor: isDragging ? "grabbing" : "auto"
133
+ },
134
+ children: [
135
+ isEditable && /* @__PURE__ */ jsx(SlashDropdownMenu, {}),
136
+ isEditable && variables && variables.length > 0 && /* @__PURE__ */ jsx(VariableSuggestion, { editor, variables })
137
+ ]
138
+ }
139
+ ),
140
+ isEditable && /* @__PURE__ */ jsx(BubbleMenu, { editor }),
141
+ isEditable && /* @__PURE__ */ jsx(LinkBubble, { editor })
142
+ ] })
143
+ );
105
144
  };
106
145
  function LoadingSpinner({ text = "Connecting..." }) {
107
146
  const styles = editorSpinner();
@@ -64,7 +64,8 @@ function LinkBubble({ editor }) {
64
64
  {
65
65
  editor,
66
66
  pluginKey: "linkBubbleMenu",
67
- shouldShow: ({ editor: e }) => {
67
+ shouldShow: ({ editor: e, view }) => {
68
+ if (!view.hasFocus()) return false;
68
69
  return e.isActive("link") && e.isEditable;
69
70
  },
70
71
  options: {
package/dist/index.js CHANGED
@@ -4266,9 +4266,10 @@ function BubbleMenu({ editor }) {
4266
4266
  import_menus.BubbleMenu,
4267
4267
  {
4268
4268
  editor,
4269
- shouldShow: ({ editor: e, state }) => {
4269
+ shouldShow: ({ editor: e, state, view }) => {
4270
4270
  const { selection } = state;
4271
4271
  const { empty } = selection;
4272
+ if (!view.hasFocus()) return false;
4272
4273
  if (empty) return false;
4273
4274
  if (e.isActive("codeBlock")) return false;
4274
4275
  if (e.isActive("link")) return false;
@@ -4462,7 +4463,8 @@ function LinkBubble({ editor }) {
4462
4463
  {
4463
4464
  editor,
4464
4465
  pluginKey: "linkBubbleMenu",
4465
- shouldShow: ({ editor: e }) => {
4466
+ shouldShow: ({ editor: e, view }) => {
4467
+ if (!view.hasFocus()) return false;
4466
4468
  return e.isActive("link") && e.isEditable;
4467
4469
  },
4468
4470
  options: {
@@ -7087,6 +7089,7 @@ var BasicEditor = ({
7087
7089
  content,
7088
7090
  variables,
7089
7091
  variableValues,
7092
+ showToolbar = true,
7090
7093
  ...options
7091
7094
  }) => {
7092
7095
  const editor = useCreateEditor({
@@ -7105,9 +7108,9 @@ var BasicEditor = ({
7105
7108
  const isBottomToolbar = variant === "field";
7106
7109
  const hasVariables = variables && variables.length > 0;
7107
7110
  const editorContent = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(EditorUIProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: styles.root(), "data-slot": "editor", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react56.EditorContext.Provider, { value: { editor }, children: [
7108
- !isBottomToolbar && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(EditorHeader, { editor, variant }),
7111
+ showToolbar && !isBottomToolbar && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(EditorHeader, { editor, variant }),
7109
7112
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(EditorContentArea, { variant, variables }),
7110
- isBottomToolbar && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(EditorHeader, { editor, variant })
7113
+ showToolbar && isBottomToolbar && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(EditorHeader, { editor, variant })
7111
7114
  ] }) }) });
7112
7115
  if (hasVariables) {
7113
7116
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(VariableProvider, { variables, resolveVariable, children: editorContent });
@@ -7119,29 +7122,67 @@ var EditorContentArea = ({ variant, variables }) => {
7119
7122
  const { editor } = (0, import_react57.useContext)(import_react56.EditorContext);
7120
7123
  const { isDragging } = useUiEditorState(editor);
7121
7124
  useScrollToHash();
7125
+ const handleKeyDown = (0, import_react57.useCallback)(
7126
+ (e) => {
7127
+ if (!(editor == null ? void 0 : editor.isFocused)) return;
7128
+ const isMod = e.metaKey || e.ctrlKey;
7129
+ const key = e.key.toLowerCase();
7130
+ const editorShortcuts = [
7131
+ isMod && key === "b",
7132
+ // Bold
7133
+ isMod && key === "i",
7134
+ // Italic
7135
+ isMod && key === "u",
7136
+ // Underline
7137
+ isMod && e.shiftKey && key === "x",
7138
+ // Strikethrough
7139
+ isMod && key === "k",
7140
+ // Link
7141
+ isMod && key === "z",
7142
+ // Undo
7143
+ isMod && e.shiftKey && key === "z",
7144
+ // Redo
7145
+ isMod && key === "y",
7146
+ // Redo (alternative)
7147
+ isMod && key === "a",
7148
+ // Select all
7149
+ isMod && key === "e",
7150
+ // Code
7151
+ isMod && e.shiftKey && key === "e"
7152
+ // Code block
7153
+ ];
7154
+ if (editorShortcuts.some(Boolean)) {
7155
+ e.stopPropagation();
7156
+ }
7157
+ },
7158
+ [editor]
7159
+ );
7122
7160
  if (!editor) {
7123
7161
  return null;
7124
7162
  }
7125
7163
  const isEditable = editor.isEditable;
7126
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: styles.wrapper(), children: [
7127
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
7128
- import_react56.EditorContent,
7129
- {
7130
- editor,
7131
- role: "presentation",
7132
- className: styles.content(),
7133
- style: {
7134
- cursor: isDragging ? "grabbing" : "auto"
7135
- },
7136
- children: [
7137
- isEditable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SlashDropdownMenu, {}),
7138
- isEditable && variables && variables.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(VariableSuggestion, { editor, variables })
7139
- ]
7140
- }
7141
- ),
7142
- isEditable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(BubbleMenu, { editor }),
7143
- isEditable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(LinkBubble, { editor })
7144
- ] });
7164
+ return (
7165
+ // biome-ignore lint/a11y/noStaticElementInteractions: Wrapper intercepts keyboard shortcuts to prevent propagation
7166
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: styles.wrapper(), onKeyDown: handleKeyDown, children: [
7167
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
7168
+ import_react56.EditorContent,
7169
+ {
7170
+ editor,
7171
+ role: "presentation",
7172
+ className: styles.content(),
7173
+ style: {
7174
+ cursor: isDragging ? "grabbing" : "auto"
7175
+ },
7176
+ children: [
7177
+ isEditable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SlashDropdownMenu, {}),
7178
+ isEditable && variables && variables.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(VariableSuggestion, { editor, variables })
7179
+ ]
7180
+ }
7181
+ ),
7182
+ isEditable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(BubbleMenu, { editor }),
7183
+ isEditable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(LinkBubble, { editor })
7184
+ ] })
7185
+ );
7145
7186
  };
7146
7187
  function LoadingSpinner({ text = "Connecting..." }) {
7147
7188
  const styles = (0, import_theme9.editorSpinner)();
package/dist/index.mjs CHANGED
@@ -4,13 +4,13 @@ import {
4
4
  } from "./chunk-QIELBKP3.mjs";
5
5
  import {
6
6
  BasicEditor
7
- } from "./chunk-GDDWW2IQ.mjs";
7
+ } from "./chunk-4JRYQZ4A.mjs";
8
8
  import "./chunk-MNTOOEHA.mjs";
9
9
  import "./chunk-ERPGWXFK.mjs";
10
10
  import "./chunk-6552DQWB.mjs";
11
11
  import "./chunk-DZLGLP7R.mjs";
12
- import "./chunk-XNDXYI2N.mjs";
13
- import "./chunk-GL3RTIER.mjs";
12
+ import "./chunk-XGAABDMW.mjs";
13
+ import "./chunk-2UDCL55K.mjs";
14
14
  import {
15
15
  VariableSuggestion
16
16
  } from "./chunk-H7MS2UMO.mjs";
@@ -27,7 +27,12 @@ type BasicEditorProps = GetExtensionsOptions & EditorBasicVariants & {
27
27
  * Maps variable names to their resolved values.
28
28
  */
29
29
  variableValues?: Record<string, string>;
30
+ /**
31
+ * Whether to show the toolbar.
32
+ * @default true
33
+ */
34
+ showToolbar?: boolean;
30
35
  };
31
- declare const BasicEditor: ({ variant, bordered, content, variables, variableValues, ...options }: BasicEditorProps) => react_jsx_runtime.JSX.Element;
36
+ declare const BasicEditor: ({ variant, bordered, content, variables, variableValues, showToolbar, ...options }: BasicEditorProps) => react_jsx_runtime.JSX.Element;
32
37
 
33
38
  export { BasicEditor, type BasicEditorProps };
@@ -27,7 +27,12 @@ type BasicEditorProps = GetExtensionsOptions & EditorBasicVariants & {
27
27
  * Maps variable names to their resolved values.
28
28
  */
29
29
  variableValues?: Record<string, string>;
30
+ /**
31
+ * Whether to show the toolbar.
32
+ * @default true
33
+ */
34
+ showToolbar?: boolean;
30
35
  };
31
- declare const BasicEditor: ({ variant, bordered, content, variables, variableValues, ...options }: BasicEditorProps) => react_jsx_runtime.JSX.Element;
36
+ declare const BasicEditor: ({ variant, bordered, content, variables, variableValues, showToolbar, ...options }: BasicEditorProps) => react_jsx_runtime.JSX.Element;
32
37
 
33
38
  export { BasicEditor, type BasicEditorProps };
@@ -3941,9 +3941,10 @@ function BubbleMenu({ editor }) {
3941
3941
  import_menus.BubbleMenu,
3942
3942
  {
3943
3943
  editor,
3944
- shouldShow: ({ editor: e, state }) => {
3944
+ shouldShow: ({ editor: e, state, view }) => {
3945
3945
  const { selection } = state;
3946
3946
  const { empty } = selection;
3947
+ if (!view.hasFocus()) return false;
3947
3948
  if (empty) return false;
3948
3949
  if (e.isActive("codeBlock")) return false;
3949
3950
  if (e.isActive("link")) return false;
@@ -4137,7 +4138,8 @@ function LinkBubble({ editor }) {
4137
4138
  {
4138
4139
  editor,
4139
4140
  pluginKey: "linkBubbleMenu",
4140
- shouldShow: ({ editor: e }) => {
4141
+ shouldShow: ({ editor: e, view }) => {
4142
+ if (!view.hasFocus()) return false;
4141
4143
  return e.isActive("link") && e.isEditable;
4142
4144
  },
4143
4145
  options: {
@@ -6762,6 +6764,7 @@ var BasicEditor = ({
6762
6764
  content,
6763
6765
  variables,
6764
6766
  variableValues,
6767
+ showToolbar = true,
6765
6768
  ...options
6766
6769
  }) => {
6767
6770
  const editor = useCreateEditor({
@@ -6780,9 +6783,9 @@ var BasicEditor = ({
6780
6783
  const isBottomToolbar = variant === "field";
6781
6784
  const hasVariables = variables && variables.length > 0;
6782
6785
  const editorContent = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(EditorUIProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: styles.root(), "data-slot": "editor", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react56.EditorContext.Provider, { value: { editor }, children: [
6783
- !isBottomToolbar && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(EditorHeader, { editor, variant }),
6786
+ showToolbar && !isBottomToolbar && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(EditorHeader, { editor, variant }),
6784
6787
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(EditorContentArea, { variant, variables }),
6785
- isBottomToolbar && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(EditorHeader, { editor, variant })
6788
+ showToolbar && isBottomToolbar && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(EditorHeader, { editor, variant })
6786
6789
  ] }) }) });
6787
6790
  if (hasVariables) {
6788
6791
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(VariableProvider, { variables, resolveVariable, children: editorContent });
@@ -6794,29 +6797,67 @@ var EditorContentArea = ({ variant, variables }) => {
6794
6797
  const { editor } = (0, import_react57.useContext)(import_react56.EditorContext);
6795
6798
  const { isDragging } = useUiEditorState(editor);
6796
6799
  useScrollToHash();
6800
+ const handleKeyDown = (0, import_react57.useCallback)(
6801
+ (e) => {
6802
+ if (!(editor == null ? void 0 : editor.isFocused)) return;
6803
+ const isMod = e.metaKey || e.ctrlKey;
6804
+ const key = e.key.toLowerCase();
6805
+ const editorShortcuts = [
6806
+ isMod && key === "b",
6807
+ // Bold
6808
+ isMod && key === "i",
6809
+ // Italic
6810
+ isMod && key === "u",
6811
+ // Underline
6812
+ isMod && e.shiftKey && key === "x",
6813
+ // Strikethrough
6814
+ isMod && key === "k",
6815
+ // Link
6816
+ isMod && key === "z",
6817
+ // Undo
6818
+ isMod && e.shiftKey && key === "z",
6819
+ // Redo
6820
+ isMod && key === "y",
6821
+ // Redo (alternative)
6822
+ isMod && key === "a",
6823
+ // Select all
6824
+ isMod && key === "e",
6825
+ // Code
6826
+ isMod && e.shiftKey && key === "e"
6827
+ // Code block
6828
+ ];
6829
+ if (editorShortcuts.some(Boolean)) {
6830
+ e.stopPropagation();
6831
+ }
6832
+ },
6833
+ [editor]
6834
+ );
6797
6835
  if (!editor) {
6798
6836
  return null;
6799
6837
  }
6800
6838
  const isEditable = editor.isEditable;
6801
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: styles.wrapper(), children: [
6802
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
6803
- import_react56.EditorContent,
6804
- {
6805
- editor,
6806
- role: "presentation",
6807
- className: styles.content(),
6808
- style: {
6809
- cursor: isDragging ? "grabbing" : "auto"
6810
- },
6811
- children: [
6812
- isEditable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SlashDropdownMenu, {}),
6813
- isEditable && variables && variables.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(VariableSuggestion, { editor, variables })
6814
- ]
6815
- }
6816
- ),
6817
- isEditable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(BubbleMenu, { editor }),
6818
- isEditable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(LinkBubble, { editor })
6819
- ] });
6839
+ return (
6840
+ // biome-ignore lint/a11y/noStaticElementInteractions: Wrapper intercepts keyboard shortcuts to prevent propagation
6841
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: styles.wrapper(), onKeyDown: handleKeyDown, children: [
6842
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
6843
+ import_react56.EditorContent,
6844
+ {
6845
+ editor,
6846
+ role: "presentation",
6847
+ className: styles.content(),
6848
+ style: {
6849
+ cursor: isDragging ? "grabbing" : "auto"
6850
+ },
6851
+ children: [
6852
+ isEditable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SlashDropdownMenu, {}),
6853
+ isEditable && variables && variables.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(VariableSuggestion, { editor, variables })
6854
+ ]
6855
+ }
6856
+ ),
6857
+ isEditable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(BubbleMenu, { editor }),
6858
+ isEditable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(LinkBubble, { editor })
6859
+ ] })
6860
+ );
6820
6861
  };
6821
6862
  function LoadingSpinner({ text = "Connecting..." }) {
6822
6863
  const styles = (0, import_theme9.editorSpinner)();
@@ -2,13 +2,13 @@
2
2
  "use client";
3
3
  import {
4
4
  BasicEditor
5
- } from "../../chunk-GDDWW2IQ.mjs";
5
+ } from "../../chunk-4JRYQZ4A.mjs";
6
6
  import "../../chunk-MNTOOEHA.mjs";
7
7
  import "../../chunk-ERPGWXFK.mjs";
8
8
  import "../../chunk-6552DQWB.mjs";
9
9
  import "../../chunk-DZLGLP7R.mjs";
10
- import "../../chunk-XNDXYI2N.mjs";
11
- import "../../chunk-GL3RTIER.mjs";
10
+ import "../../chunk-XGAABDMW.mjs";
11
+ import "../../chunk-2UDCL55K.mjs";
12
12
  import "../../chunk-H7MS2UMO.mjs";
13
13
  import "../../chunk-HLLA2HRV.mjs";
14
14
  import "../../chunk-L5RDMV3H.mjs";
@@ -637,9 +637,10 @@ function BubbleMenu({ editor }) {
637
637
  import_menus.BubbleMenu,
638
638
  {
639
639
  editor,
640
- shouldShow: ({ editor: e, state }) => {
640
+ shouldShow: ({ editor: e, state, view }) => {
641
641
  const { selection } = state;
642
642
  const { empty } = selection;
643
+ if (!view.hasFocus()) return false;
643
644
  if (empty) return false;
644
645
  if (e.isActive("codeBlock")) return false;
645
646
  if (e.isActive("link")) return false;
@@ -3,7 +3,7 @@
3
3
  import {
4
4
  BubbleMenu,
5
5
  bubble_menu_default
6
- } from "../../chunk-GL3RTIER.mjs";
6
+ } from "../../chunk-2UDCL55K.mjs";
7
7
  import "../../chunk-LNVWG34E.mjs";
8
8
  import "../../chunk-LVNUU67N.mjs";
9
9
  import "../../chunk-7VGROP26.mjs";
@@ -89,7 +89,8 @@ function LinkBubble({ editor }) {
89
89
  {
90
90
  editor,
91
91
  pluginKey: "linkBubbleMenu",
92
- shouldShow: ({ editor: e }) => {
92
+ shouldShow: ({ editor: e, view }) => {
93
+ if (!view.hasFocus()) return false;
93
94
  return e.isActive("link") && e.isEditable;
94
95
  },
95
96
  options: {
@@ -3,7 +3,7 @@
3
3
  import {
4
4
  LinkBubble,
5
5
  link_bubble_default
6
- } from "../../chunk-XNDXYI2N.mjs";
6
+ } from "../../chunk-XGAABDMW.mjs";
7
7
  export {
8
8
  LinkBubble,
9
9
  link_bubble_default as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kopexa/tiptap",
3
- "version": "17.4.0",
3
+ "version": "17.6.0",
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.13.0"
31
+ "@kopexa/theme": "17.14.0"
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/chip": "17.1.22",
66
- "@kopexa/callout": "17.0.25",
67
- "@kopexa/dialog": "17.0.25",
68
- "@kopexa/button": "17.0.25",
69
- "@kopexa/dropdown-menu": "17.0.25",
70
- "@kopexa/editor-utils": "17.0.25",
71
- "@kopexa/extension-code": "17.0.25",
72
- "@kopexa/extension-controlref": "17.1.7",
73
- "@kopexa/extension-table": "17.0.25",
74
- "@kopexa/icons": "17.3.7",
75
- "@kopexa/input": "17.0.25",
76
- "@kopexa/label": "17.0.25",
77
- "@kopexa/popover": "17.0.25",
78
- "@kopexa/select": "17.0.25",
79
- "@kopexa/switch": "17.0.25",
80
- "@kopexa/shared-utils": "17.0.25",
81
- "@kopexa/separator": "17.0.25",
82
- "@kopexa/toolbar": "17.0.25",
83
- "@kopexa/use-composed-ref": "17.0.25",
84
- "@kopexa/use-is-mobile": "17.0.25",
85
- "@kopexa/tabs": "17.0.25",
86
- "@kopexa/react-utils": "17.0.25"
65
+ "@kopexa/button": "17.0.27",
66
+ "@kopexa/callout": "17.0.27",
67
+ "@kopexa/chip": "17.1.24",
68
+ "@kopexa/dropdown-menu": "17.0.27",
69
+ "@kopexa/editor-utils": "17.0.27",
70
+ "@kopexa/extension-code": "17.0.27",
71
+ "@kopexa/dialog": "17.0.27",
72
+ "@kopexa/icons": "17.4.0",
73
+ "@kopexa/extension-table": "17.0.27",
74
+ "@kopexa/input": "17.0.27",
75
+ "@kopexa/label": "17.0.27",
76
+ "@kopexa/extension-controlref": "17.1.9",
77
+ "@kopexa/popover": "17.0.27",
78
+ "@kopexa/select": "17.0.27",
79
+ "@kopexa/switch": "17.0.27",
80
+ "@kopexa/separator": "17.0.27",
81
+ "@kopexa/react-utils": "17.0.27",
82
+ "@kopexa/shared-utils": "17.0.27",
83
+ "@kopexa/tabs": "17.0.27",
84
+ "@kopexa/use-composed-ref": "17.0.27",
85
+ "@kopexa/toolbar": "17.0.27",
86
+ "@kopexa/use-is-mobile": "17.0.27"
87
87
  },
88
88
  "clean-package": "../../../clean-package.config.json",
89
89
  "module": "dist/index.mjs",