@kopexa/tiptap 17.5.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.
@@ -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 });
@@ -118,25 +119,28 @@ var EditorContentArea = ({ variant, variables }) => {
118
119
  return null;
119
120
  }
120
121
  const isEditable = editor.isEditable;
121
- return /* @__PURE__ */ jsxs("div", { className: styles.wrapper(), onKeyDown: handleKeyDown, children: [
122
- /* @__PURE__ */ jsxs(
123
- EditorContent,
124
- {
125
- editor,
126
- role: "presentation",
127
- className: styles.content(),
128
- style: {
129
- cursor: isDragging ? "grabbing" : "auto"
130
- },
131
- children: [
132
- isEditable && /* @__PURE__ */ jsx(SlashDropdownMenu, {}),
133
- isEditable && variables && variables.length > 0 && /* @__PURE__ */ jsx(VariableSuggestion, { editor, variables })
134
- ]
135
- }
136
- ),
137
- isEditable && /* @__PURE__ */ jsx(BubbleMenu, { editor }),
138
- isEditable && /* @__PURE__ */ jsx(LinkBubble, { editor })
139
- ] });
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
+ );
140
144
  };
141
145
  function LoadingSpinner({ text = "Connecting..." }) {
142
146
  const styles = editorSpinner();
package/dist/index.js CHANGED
@@ -7089,6 +7089,7 @@ var BasicEditor = ({
7089
7089
  content,
7090
7090
  variables,
7091
7091
  variableValues,
7092
+ showToolbar = true,
7092
7093
  ...options
7093
7094
  }) => {
7094
7095
  const editor = useCreateEditor({
@@ -7107,9 +7108,9 @@ var BasicEditor = ({
7107
7108
  const isBottomToolbar = variant === "field";
7108
7109
  const hasVariables = variables && variables.length > 0;
7109
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: [
7110
- !isBottomToolbar && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(EditorHeader, { editor, variant }),
7111
+ showToolbar && !isBottomToolbar && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(EditorHeader, { editor, variant }),
7111
7112
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(EditorContentArea, { variant, variables }),
7112
- isBottomToolbar && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(EditorHeader, { editor, variant })
7113
+ showToolbar && isBottomToolbar && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(EditorHeader, { editor, variant })
7113
7114
  ] }) }) });
7114
7115
  if (hasVariables) {
7115
7116
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(VariableProvider, { variables, resolveVariable, children: editorContent });
@@ -7160,25 +7161,28 @@ var EditorContentArea = ({ variant, variables }) => {
7160
7161
  return null;
7161
7162
  }
7162
7163
  const isEditable = editor.isEditable;
7163
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: styles.wrapper(), onKeyDown: handleKeyDown, children: [
7164
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
7165
- import_react56.EditorContent,
7166
- {
7167
- editor,
7168
- role: "presentation",
7169
- className: styles.content(),
7170
- style: {
7171
- cursor: isDragging ? "grabbing" : "auto"
7172
- },
7173
- children: [
7174
- isEditable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SlashDropdownMenu, {}),
7175
- isEditable && variables && variables.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(VariableSuggestion, { editor, variables })
7176
- ]
7177
- }
7178
- ),
7179
- isEditable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(BubbleMenu, { editor }),
7180
- isEditable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(LinkBubble, { editor })
7181
- ] });
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
+ );
7182
7186
  };
7183
7187
  function LoadingSpinner({ text = "Connecting..." }) {
7184
7188
  const styles = (0, import_theme9.editorSpinner)();
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-QIELBKP3.mjs";
5
5
  import {
6
6
  BasicEditor
7
- } from "./chunk-JZBRWJHC.mjs";
7
+ } from "./chunk-4JRYQZ4A.mjs";
8
8
  import "./chunk-MNTOOEHA.mjs";
9
9
  import "./chunk-ERPGWXFK.mjs";
10
10
  import "./chunk-6552DQWB.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 };
@@ -6764,6 +6764,7 @@ var BasicEditor = ({
6764
6764
  content,
6765
6765
  variables,
6766
6766
  variableValues,
6767
+ showToolbar = true,
6767
6768
  ...options
6768
6769
  }) => {
6769
6770
  const editor = useCreateEditor({
@@ -6782,9 +6783,9 @@ var BasicEditor = ({
6782
6783
  const isBottomToolbar = variant === "field";
6783
6784
  const hasVariables = variables && variables.length > 0;
6784
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: [
6785
- !isBottomToolbar && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(EditorHeader, { editor, variant }),
6786
+ showToolbar && !isBottomToolbar && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(EditorHeader, { editor, variant }),
6786
6787
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(EditorContentArea, { variant, variables }),
6787
- isBottomToolbar && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(EditorHeader, { editor, variant })
6788
+ showToolbar && isBottomToolbar && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(EditorHeader, { editor, variant })
6788
6789
  ] }) }) });
6789
6790
  if (hasVariables) {
6790
6791
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(VariableProvider, { variables, resolveVariable, children: editorContent });
@@ -6835,25 +6836,28 @@ var EditorContentArea = ({ variant, variables }) => {
6835
6836
  return null;
6836
6837
  }
6837
6838
  const isEditable = editor.isEditable;
6838
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: styles.wrapper(), onKeyDown: handleKeyDown, children: [
6839
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
6840
- import_react56.EditorContent,
6841
- {
6842
- editor,
6843
- role: "presentation",
6844
- className: styles.content(),
6845
- style: {
6846
- cursor: isDragging ? "grabbing" : "auto"
6847
- },
6848
- children: [
6849
- isEditable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SlashDropdownMenu, {}),
6850
- isEditable && variables && variables.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(VariableSuggestion, { editor, variables })
6851
- ]
6852
- }
6853
- ),
6854
- isEditable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(BubbleMenu, { editor }),
6855
- isEditable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(LinkBubble, { editor })
6856
- ] });
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
+ );
6857
6861
  };
6858
6862
  function LoadingSpinner({ text = "Connecting..." }) {
6859
6863
  const styles = (0, import_theme9.editorSpinner)();
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  import {
4
4
  BasicEditor
5
- } from "../../chunk-JZBRWJHC.mjs";
5
+ } from "../../chunk-4JRYQZ4A.mjs";
6
6
  import "../../chunk-MNTOOEHA.mjs";
7
7
  import "../../chunk-ERPGWXFK.mjs";
8
8
  import "../../chunk-6552DQWB.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kopexa/tiptap",
3
- "version": "17.5.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.1"
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/button": "17.0.26",
66
- "@kopexa/callout": "17.0.26",
67
- "@kopexa/dialog": "17.0.26",
68
- "@kopexa/chip": "17.1.23",
69
- "@kopexa/dropdown-menu": "17.0.26",
70
- "@kopexa/editor-utils": "17.0.26",
71
- "@kopexa/extension-controlref": "17.1.8",
72
- "@kopexa/icons": "17.3.8",
73
- "@kopexa/extension-code": "17.0.26",
74
- "@kopexa/extension-table": "17.0.26",
75
- "@kopexa/label": "17.0.26",
76
- "@kopexa/popover": "17.0.26",
77
- "@kopexa/switch": "17.0.26",
78
- "@kopexa/select": "17.0.26",
79
- "@kopexa/input": "17.0.26",
80
- "@kopexa/react-utils": "17.0.26",
81
- "@kopexa/separator": "17.0.26",
82
- "@kopexa/shared-utils": "17.0.26",
83
- "@kopexa/tabs": "17.0.26",
84
- "@kopexa/toolbar": "17.0.26",
85
- "@kopexa/use-composed-ref": "17.0.26",
86
- "@kopexa/use-is-mobile": "17.0.26"
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",