dishui 0.0.71 → 0.0.73

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.
Files changed (93) hide show
  1. package/dist/components/Button/index.d.ts +4 -4
  2. package/dist/components/Button/index.js +18 -17
  3. package/dist/components/Button/index.js.map +1 -1
  4. package/dist/components/Card/Metric.d.ts +17 -0
  5. package/dist/components/Card/Metric2.js +50 -0
  6. package/dist/components/Card/Metric2.js.map +1 -0
  7. package/dist/components/Card/index.d.ts +3 -0
  8. package/dist/components/Card/index.js +118 -117
  9. package/dist/components/Card/index.js.map +1 -1
  10. package/dist/components/Group/index.d.ts +2 -0
  11. package/dist/components/GroupButton/index.d.ts +16 -0
  12. package/dist/components/GroupButton/index.js +41 -0
  13. package/dist/components/GroupButton/index.js.map +1 -0
  14. package/dist/components/GroupedTable/index.d.ts +38 -0
  15. package/dist/components/GroupedTable/index.js +92 -0
  16. package/dist/components/GroupedTable/index.js.map +1 -0
  17. package/dist/components/Layout/index.d.ts +4 -2
  18. package/dist/components/Layout/index.js +1 -1
  19. package/dist/components/Layout/index.js.map +1 -1
  20. package/dist/components/NavigationList/index.d.ts +17 -0
  21. package/dist/components/NavigationList/index.js +48 -0
  22. package/dist/components/NavigationList/index.js.map +1 -0
  23. package/dist/components/Section/index.d.ts +28 -0
  24. package/dist/components/Section/index.js +58 -0
  25. package/dist/components/Section/index.js.map +1 -0
  26. package/dist/components/Select/index.d.ts +2 -0
  27. package/dist/components/Select/index.js +83 -82
  28. package/dist/components/Select/index.js.map +1 -1
  29. package/dist/components/SidebarToggleButton/index.d.ts +16 -1
  30. package/dist/components/SidebarToggleButton/index.js +90 -30
  31. package/dist/components/SidebarToggleButton/index.js.map +1 -1
  32. package/dist/components/Skeleton/index.d.ts +7 -0
  33. package/dist/components/Skeleton/index.js +21 -0
  34. package/dist/components/Skeleton/index.js.map +1 -0
  35. package/dist/components/Tree/Tree.js +5 -2
  36. package/dist/components/Tree/Tree.js.map +1 -1
  37. package/dist/components/pro/RichTextEditor/AIRewrite.js +114 -72
  38. package/dist/components/pro/RichTextEditor/AIRewrite.js.map +1 -1
  39. package/dist/components/pro/RichTextEditor/BlockHandle.js +315 -196
  40. package/dist/components/pro/RichTextEditor/BlockHandle.js.map +1 -1
  41. package/dist/components/pro/RichTextEditor/BubbleToolbar.d.ts +1 -1
  42. package/dist/components/pro/RichTextEditor/BubbleToolbar.js +69 -33
  43. package/dist/components/pro/RichTextEditor/BubbleToolbar.js.map +1 -1
  44. package/dist/components/pro/RichTextEditor/CommentPanel.d.ts +2 -1
  45. package/dist/components/pro/RichTextEditor/CommentPanel.js +100 -81
  46. package/dist/components/pro/RichTextEditor/CommentPanel.js.map +1 -1
  47. package/dist/components/pro/RichTextEditor/CommentPopover.d.ts +2 -1
  48. package/dist/components/pro/RichTextEditor/CommentPopover.js +92 -68
  49. package/dist/components/pro/RichTextEditor/CommentPopover.js.map +1 -1
  50. package/dist/components/pro/RichTextEditor/RichTextEditor.js +24 -22
  51. package/dist/components/pro/RichTextEditor/RichTextEditor.js.map +1 -1
  52. package/dist/components/pro/RichTextEditor/SearchReplace.d.ts +7 -0
  53. package/dist/components/pro/RichTextEditor/SlashMenu.js +136 -73
  54. package/dist/components/pro/RichTextEditor/SlashMenu.js.map +1 -1
  55. package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.d.ts +1 -1
  56. package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js +346 -313
  57. package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js.map +1 -1
  58. package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js +114 -146
  59. package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js.map +1 -1
  60. package/dist/components/pro/RichTextEditor/extensions/CommentMark.js +2 -2
  61. package/dist/components/pro/RichTextEditor/extensions/CommentMark.js.map +1 -1
  62. package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js +178 -163
  63. package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js.map +1 -1
  64. package/dist/components/pro/RichTextEditor/extensions/FontSize.js +8 -5
  65. package/dist/components/pro/RichTextEditor/extensions/FontSize.js.map +1 -1
  66. package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.d.ts +6 -0
  67. package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js +85 -74
  68. package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js.map +1 -1
  69. package/dist/components/pro/RichTextEditor/searchUtils.d.ts +23 -0
  70. package/dist/contexts/AppContext.js +47 -45
  71. package/dist/contexts/AppContext.js.map +1 -1
  72. package/dist/dishui.css +1 -1
  73. package/dist/index-nostyled.d.ts +11 -1
  74. package/dist/index.d.ts +11 -1
  75. package/dist/index.js +119 -114
  76. package/dist/layouts/MainLayout.js +9 -10
  77. package/dist/layouts/MainLayout.js.map +1 -1
  78. package/dist/layouts/Sidebar.d.ts +9 -0
  79. package/dist/layouts/Sidebar.js +99 -80
  80. package/dist/layouts/Sidebar.js.map +1 -1
  81. package/dist/layouts/headbar/Headbar.d.ts +1 -1
  82. package/dist/layouts/headbar/Headbar.js +2 -2
  83. package/dist/layouts/headbar/Headbar.js.map +1 -1
  84. package/dist/lite.d.ts +19 -1
  85. package/dist/lite.js +17 -8
  86. package/dist/styles/themeStyles.js +6 -6
  87. package/dist/styles/themeStyles.js.map +1 -1
  88. package/dist/utils/i18n.d.ts +3 -0
  89. package/dist/utils/i18n.js +78 -0
  90. package/dist/utils/i18n.js.map +1 -1
  91. package/dist/utils/menu.js +23 -6
  92. package/dist/utils/menu.js.map +1 -1
  93. package/package.json +8 -2
@@ -6,45 +6,65 @@ import { FONT_FAMILIES as a, FONT_SIZES as o, SelectDropdown as s } from "./Sele
6
6
  import { MarkdownTemplateMenu as c } from "./MarkdownTemplates.js";
7
7
  import { FloatingDialogMenu as l } from "./FloatingDialogMenu.js";
8
8
  import { TableOpsMenu as u } from "./TableOpsMenu.js";
9
- import { useCallback as d, useEffect as f, useState as p } from "react";
10
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
9
+ import { useCallback as d, useEffect as f, useRef as p, useState as m } from "react";
10
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
11
+ import { useEditorState as v } from "@tiptap/react";
11
12
  //#region src/components/pro/RichTextEditor/Toolbar/Toolbar.tsx
12
- var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPainterChange: S, children: C }) => {
13
- let w = {
13
+ var y = /* @__PURE__ */ new Set([
14
+ "bold",
15
+ "italic",
16
+ "underline",
17
+ "strike",
18
+ "code",
19
+ "subscript",
20
+ "superscript",
21
+ "textStyle",
22
+ "highlight"
23
+ ]), b = ({ editor: b, config: x, labels: S, hasAI: C, onAIClick: w, onFormatPainterChange: T, children: E }) => {
24
+ let D = {
14
25
  ...e,
15
- ...y
16
- }, [T, E] = p(null), D = {
17
- textFormat: v?.textFormat ?? !0,
18
- heading: v?.heading ?? !0,
19
- alignment: v?.alignment ?? !0,
20
- list: v?.list ?? !0,
21
- insert: v?.insert ?? !0,
22
- color: v?.color ?? !0,
23
- history: v?.history ?? !0,
24
- ai: v?.ai ?? !0,
25
- tableOps: v?.tableOps ?? !0,
26
- fontStyle: v?.fontStyle ?? !0,
27
- formatPainter: v?.formatPainter ?? !0
28
- }, O = d(() => {
29
- let e = _.getAttributes("link").href, t = window.prompt(w.insertLinkUrl, e);
30
- if (t !== null) {
31
- if (t === "") {
32
- _.chain().focus().extendMarkRange("link").unsetLink().run();
26
+ ...S
27
+ };
28
+ v({
29
+ editor: b,
30
+ selector: ({ transactionNumber: e }) => e
31
+ });
32
+ let [O, k] = m(null), A = p(T);
33
+ f(() => {
34
+ A.current = T;
35
+ }, [T]);
36
+ let j = {
37
+ textFormat: x?.textFormat ?? !0,
38
+ heading: x?.heading ?? !0,
39
+ alignment: x?.alignment ?? !0,
40
+ list: x?.list ?? !0,
41
+ insert: x?.insert ?? !0,
42
+ color: x?.color ?? !0,
43
+ history: x?.history ?? !0,
44
+ ai: x?.ai ?? !0,
45
+ tableOps: x?.tableOps ?? !0,
46
+ fontStyle: x?.fontStyle ?? !0,
47
+ formatPainter: x?.formatPainter ?? !0
48
+ }, M = d(() => {
49
+ let e = b.getAttributes("link").href, t = window.prompt(D.insertLinkUrl, e);
50
+ if (t !== null && !b.isDestroyed && b.isEditable) {
51
+ if (t.trim() === "") {
52
+ b.chain().focus().extendMarkRange("link").unsetLink().run();
33
53
  return;
34
54
  }
35
- _.chain().focus().extendMarkRange("link").setLink({ href: t }).run();
55
+ b.chain().focus().extendMarkRange("link").setLink({ href: t.trim() }).run();
36
56
  }
37
- }, [_, w.insertLinkUrl]), k = d(() => {
38
- let e = window.prompt(w.insertImageUrl);
39
- e && _.chain().focus().setImage({ src: e }).run();
40
- }, [_, w.insertImageUrl]), A = d(() => {
41
- _.chain().focus().insertTable({
57
+ }, [b, D.insertLinkUrl]), N = d(() => {
58
+ let e = window.prompt(D.insertImageUrl);
59
+ e && b.chain().focus().setImage({ src: e }).run();
60
+ }, [b, D.insertImageUrl]), P = d(() => {
61
+ b.chain().focus().insertTable({
42
62
  rows: 3,
43
63
  cols: 3,
44
64
  withHeaderRow: !0
45
65
  }).run();
46
- }, [_]), j = d(() => {
47
- _.chain().focus().insertContent({
66
+ }, [b]), F = d(() => {
67
+ b.chain().focus().insertContent({
48
68
  type: "codeBlock",
49
69
  attrs: { language: "r-markdown" },
50
70
  content: [{
@@ -52,8 +72,8 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
52
72
  text: "# Markdown\n\nWrite your **markdown** here."
53
73
  }]
54
74
  }).run();
55
- }, [_]), M = d((e) => {
56
- _.chain().focus().insertContent({
75
+ }, [b]), I = d((e) => {
76
+ b.chain().focus().insertContent({
57
77
  type: "codeBlock",
58
78
  attrs: { language: "r-markdown" },
59
79
  content: [{
@@ -61,13 +81,13 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
61
81
  text: e
62
82
  }]
63
83
  }).run();
64
- }, [_]), N = d((e = "block") => {
84
+ }, [b]), L = d((e = "block") => {
65
85
  let n = e === "float" ? {
66
86
  x: 40,
67
87
  y: 40,
68
- zIndex: t(_)
88
+ zIndex: t(b)
69
89
  } : e === "block" ? {} : { width: 240 };
70
- _.chain().focus().insertContent({
90
+ b.chain().focus().insertContent({
71
91
  type: "floatingDialog",
72
92
  attrs: {
73
93
  title: "Note",
@@ -76,60 +96,72 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
76
96
  },
77
97
  content: [{ type: "paragraph" }]
78
98
  }).run();
79
- }, [_]), P = d(() => {
80
- if (T) {
81
- E(null), S?.(!1);
99
+ }, [b]), R = d(() => {
100
+ if (O) {
101
+ k(null);
82
102
  return;
83
103
  }
84
- let { from: e, to: t } = _.state.selection;
104
+ if (b.isDestroyed || !b.isEditable) return;
105
+ let { from: e, to: t } = b.state.selection;
85
106
  if (e === t) return;
86
- let n = [];
87
- _.state.doc.nodesBetween(e, t, (e) => {
88
- e.marks && e.marks.forEach((e) => {
89
- n.push({
90
- type: e.type.name,
91
- attrs: e.attrs
92
- });
93
- });
94
- }), E(n), S?.(!0);
95
- }, [
96
- _,
97
- T,
98
- S
99
- ]);
107
+ let n;
108
+ b.state.doc.nodesBetween(e, t, (e) => {
109
+ if (!e.isText) return;
110
+ let t = e.marks.filter((e) => y.has(e.type.name));
111
+ n = n === void 0 ? t : n.filter((e) => t.some((t) => e.eq(t)));
112
+ }), n !== void 0 && k(n);
113
+ }, [b, O]);
100
114
  f(() => {
101
- if (!T) return;
102
- let e = _.view.dom, t = () => {
103
- let { from: e, to: t } = _.state.selection;
104
- if (e === t || !T) return;
105
- let { tr: n } = _.state;
106
- n.removeMark(e, t);
107
- for (let r of T) {
108
- let i = _.schema.marks[r.type];
109
- i && n.addMark(e, t, i.create(r.attrs));
115
+ if (!O) return;
116
+ if (b.isDestroyed || !b.isEditable || !j.formatPainter || !j.textFormat) {
117
+ k(null);
118
+ return;
119
+ }
120
+ A.current?.(!0);
121
+ let e = b.view.dom, t = null, n = !1, r = () => {
122
+ n = !0, t !== null && cancelAnimationFrame(t), t = null, k(null);
123
+ }, i = () => {
124
+ b.isEditable || r();
125
+ }, a = (e) => {
126
+ e.key === "Escape" && r();
127
+ }, o = () => {
128
+ if (t = null, n || b.isDestroyed || !b.isEditable) return;
129
+ let { from: e, to: r } = b.state.selection;
130
+ if (e === r) return;
131
+ let { tr: i } = b.state;
132
+ for (let t of y) {
133
+ let n = b.schema.marks[t];
134
+ n && i.removeMark(e, r, n);
110
135
  }
111
- _.view.dispatch(n), E(null), S?.(!1);
112
- }, n = () => {
113
- requestAnimationFrame(t);
136
+ b.state.doc.nodesBetween(e, r, (t, n) => {
137
+ if (!t.isText) return;
138
+ let a = t.marks.filter((e) => !y.has(e.type.name));
139
+ for (let o of O) a.some((e) => o.type.excludes(e.type) || e.type.excludes(o.type)) || i.addMark(Math.max(e, n), Math.min(r, n + t.nodeSize), o);
140
+ }), n = !0, b.view.dispatch(i), k(null);
141
+ }, s = () => {
142
+ n || (t !== null && cancelAnimationFrame(t), t = requestAnimationFrame(o));
114
143
  };
115
- return e.addEventListener("mouseup", n), () => {
116
- e.removeEventListener("mouseup", n);
144
+ return e.addEventListener("mouseup", s), e.ownerDocument.addEventListener("keydown", a), b.on("transaction", i), b.on("destroy", r), () => {
145
+ n = !0, t !== null && cancelAnimationFrame(t), e.removeEventListener("mouseup", s), e.ownerDocument.removeEventListener("keydown", a), b.off("transaction", i), b.off("destroy", r), A.current?.(!1);
117
146
  };
118
147
  }, [
119
- _,
120
- T,
121
- S
148
+ b,
149
+ O,
150
+ j.formatPainter,
151
+ j.textFormat
122
152
  ]);
123
- let F = _.getAttributes("textStyle").fontFamily || "", I = _.getAttributes("textStyle").fontSize || "";
124
- return /* @__PURE__ */ g("div", {
153
+ let z = b.getAttributes("textStyle").fontFamily || "", B = b.getAttributes("textStyle").fontSize || "";
154
+ return /* @__PURE__ */ _("div", {
125
155
  className: "rte-toolbar",
156
+ role: "group",
157
+ "aria-label": "Text formatting",
126
158
  children: [
127
- D.history && /* @__PURE__ */ g(m, { children: [
128
- /* @__PURE__ */ h(n, {
129
- onClick: () => _.chain().focus().undo().run(),
130
- disabled: !_.can().undo(),
131
- title: w.undo,
132
- children: /* @__PURE__ */ g("svg", {
159
+ j.history && /* @__PURE__ */ _(h, { children: [
160
+ /* @__PURE__ */ g(n, {
161
+ onClick: () => b.chain().focus().undo().run(),
162
+ disabled: !b.can().undo(),
163
+ title: D.undo,
164
+ children: /* @__PURE__ */ _("svg", {
133
165
  width: "16",
134
166
  height: "16",
135
167
  viewBox: "0 0 24 24",
@@ -138,14 +170,14 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
138
170
  strokeWidth: "2",
139
171
  strokeLinecap: "round",
140
172
  strokeLinejoin: "round",
141
- children: [/* @__PURE__ */ h("polyline", { points: "1 4 1 10 7 10" }), /* @__PURE__ */ h("path", { d: "M3.51 15a9 9 0 102.13-9.36L1 10" })]
173
+ children: [/* @__PURE__ */ g("polyline", { points: "1 4 1 10 7 10" }), /* @__PURE__ */ g("path", { d: "M3.51 15a9 9 0 102.13-9.36L1 10" })]
142
174
  })
143
175
  }),
144
- /* @__PURE__ */ h(n, {
145
- onClick: () => _.chain().focus().redo().run(),
146
- disabled: !_.can().redo(),
147
- title: w.redo,
148
- children: /* @__PURE__ */ g("svg", {
176
+ /* @__PURE__ */ g(n, {
177
+ onClick: () => b.chain().focus().redo().run(),
178
+ disabled: !b.can().redo(),
179
+ title: D.redo,
180
+ children: /* @__PURE__ */ _("svg", {
149
181
  width: "16",
150
182
  height: "16",
151
183
  viewBox: "0 0 24 24",
@@ -154,38 +186,38 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
154
186
  strokeWidth: "2",
155
187
  strokeLinecap: "round",
156
188
  strokeLinejoin: "round",
157
- children: [/* @__PURE__ */ h("polyline", { points: "23 4 23 10 17 10" }), /* @__PURE__ */ h("path", { d: "M20.49 15a9 9 0 11-2.13-9.36L23 10" })]
189
+ children: [/* @__PURE__ */ g("polyline", { points: "23 4 23 10 17 10" }), /* @__PURE__ */ g("path", { d: "M20.49 15a9 9 0 11-2.13-9.36L23 10" })]
158
190
  })
159
191
  }),
160
- /* @__PURE__ */ h(r, {})
192
+ /* @__PURE__ */ g(r, {})
161
193
  ] }),
162
- D.fontStyle && /* @__PURE__ */ g(m, { children: [
163
- /* @__PURE__ */ h(s, {
164
- value: F,
194
+ j.fontStyle && /* @__PURE__ */ _(h, { children: [
195
+ /* @__PURE__ */ g(s, {
196
+ value: z,
165
197
  options: a,
166
198
  onChange: (e) => {
167
- e ? _.chain().focus().setFontFamily(e).run() : _.chain().focus().unsetFontFamily().run();
199
+ e ? b.chain().focus().setFontFamily(e).run() : b.chain().focus().unsetFontFamily().run();
168
200
  },
169
- title: w.fontFamily,
201
+ title: D.fontFamily,
170
202
  width: 120
171
203
  }),
172
- /* @__PURE__ */ h(s, {
173
- value: I,
204
+ /* @__PURE__ */ g(s, {
205
+ value: B,
174
206
  options: o,
175
207
  onChange: (e) => {
176
- e ? _.chain().focus().setFontSize(e).run() : _.chain().focus().unsetFontSize().run();
208
+ e ? b.chain().focus().setFontSize(e).run() : b.chain().focus().unsetFontSize().run();
177
209
  },
178
- title: w.fontSize,
210
+ title: D.fontSize,
179
211
  width: 80
180
212
  }),
181
- /* @__PURE__ */ h(r, {})
213
+ /* @__PURE__ */ g(r, {})
182
214
  ] }),
183
- D.textFormat && /* @__PURE__ */ g(m, { children: [
184
- /* @__PURE__ */ h(n, {
185
- onClick: () => _.chain().focus().toggleBold().run(),
186
- isActive: _.isActive("bold"),
187
- title: w.bold,
188
- children: /* @__PURE__ */ g("svg", {
215
+ j.textFormat && /* @__PURE__ */ _(h, { children: [
216
+ /* @__PURE__ */ g(n, {
217
+ onClick: () => b.chain().focus().toggleBold().run(),
218
+ isActive: b.isActive("bold"),
219
+ title: D.bold,
220
+ children: /* @__PURE__ */ _("svg", {
189
221
  width: "16",
190
222
  height: "16",
191
223
  viewBox: "0 0 24 24",
@@ -194,14 +226,14 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
194
226
  strokeWidth: "2.5",
195
227
  strokeLinecap: "round",
196
228
  strokeLinejoin: "round",
197
- children: [/* @__PURE__ */ h("path", { d: "M6 4h8a4 4 0 014 4 4 4 0 01-4 4H6z" }), /* @__PURE__ */ h("path", { d: "M6 12h9a4 4 0 014 4 4 4 0 01-4 4H6z" })]
229
+ children: [/* @__PURE__ */ g("path", { d: "M6 4h8a4 4 0 014 4 4 4 0 01-4 4H6z" }), /* @__PURE__ */ g("path", { d: "M6 12h9a4 4 0 014 4 4 4 0 01-4 4H6z" })]
198
230
  })
199
231
  }),
200
- /* @__PURE__ */ h(n, {
201
- onClick: () => _.chain().focus().toggleItalic().run(),
202
- isActive: _.isActive("italic"),
203
- title: w.italic,
204
- children: /* @__PURE__ */ g("svg", {
232
+ /* @__PURE__ */ g(n, {
233
+ onClick: () => b.chain().focus().toggleItalic().run(),
234
+ isActive: b.isActive("italic"),
235
+ title: D.italic,
236
+ children: /* @__PURE__ */ _("svg", {
205
237
  width: "16",
206
238
  height: "16",
207
239
  viewBox: "0 0 24 24",
@@ -211,19 +243,19 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
211
243
  strokeLinecap: "round",
212
244
  strokeLinejoin: "round",
213
245
  children: [
214
- /* @__PURE__ */ h("line", {
246
+ /* @__PURE__ */ g("line", {
215
247
  x1: "19",
216
248
  y1: "4",
217
249
  x2: "10",
218
250
  y2: "4"
219
251
  }),
220
- /* @__PURE__ */ h("line", {
252
+ /* @__PURE__ */ g("line", {
221
253
  x1: "14",
222
254
  y1: "20",
223
255
  x2: "5",
224
256
  y2: "20"
225
257
  }),
226
- /* @__PURE__ */ h("line", {
258
+ /* @__PURE__ */ g("line", {
227
259
  x1: "15",
228
260
  y1: "4",
229
261
  x2: "9",
@@ -232,11 +264,11 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
232
264
  ]
233
265
  })
234
266
  }),
235
- /* @__PURE__ */ h(n, {
236
- onClick: () => _.chain().focus().toggleUnderline().run(),
237
- isActive: _.isActive("underline"),
238
- title: w.underline,
239
- children: /* @__PURE__ */ g("svg", {
267
+ /* @__PURE__ */ g(n, {
268
+ onClick: () => b.chain().focus().toggleUnderline().run(),
269
+ isActive: b.isActive("underline"),
270
+ title: D.underline,
271
+ children: /* @__PURE__ */ _("svg", {
240
272
  width: "16",
241
273
  height: "16",
242
274
  viewBox: "0 0 24 24",
@@ -245,7 +277,7 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
245
277
  strokeWidth: "2",
246
278
  strokeLinecap: "round",
247
279
  strokeLinejoin: "round",
248
- children: [/* @__PURE__ */ h("path", { d: "M6 3v7a6 6 0 006 6 6 6 0 006-6V3" }), /* @__PURE__ */ h("line", {
280
+ children: [/* @__PURE__ */ g("path", { d: "M6 3v7a6 6 0 006 6 6 6 0 006-6V3" }), /* @__PURE__ */ g("line", {
249
281
  x1: "4",
250
282
  y1: "21",
251
283
  x2: "20",
@@ -253,11 +285,11 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
253
285
  })]
254
286
  })
255
287
  }),
256
- /* @__PURE__ */ h(n, {
257
- onClick: () => _.chain().focus().toggleStrike().run(),
258
- isActive: _.isActive("strike"),
259
- title: w.strikethrough,
260
- children: /* @__PURE__ */ g("svg", {
288
+ /* @__PURE__ */ g(n, {
289
+ onClick: () => b.chain().focus().toggleStrike().run(),
290
+ isActive: b.isActive("strike"),
291
+ title: D.strikethrough,
292
+ children: /* @__PURE__ */ _("svg", {
261
293
  width: "16",
262
294
  height: "16",
263
295
  viewBox: "0 0 24 24",
@@ -267,9 +299,9 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
267
299
  strokeLinecap: "round",
268
300
  strokeLinejoin: "round",
269
301
  children: [
270
- /* @__PURE__ */ h("path", { d: "M17.3 4.9c-2.3-.6-4.4-1-6.2-.9-2.7 0-5.3.7-5.3 3.6 0 1.5 1.8 3.3 7.2 3.3" }),
271
- /* @__PURE__ */ h("path", { d: "M13 15.1c0 2.8-2.6 3.6-5.3 3.6-1.8-.1-3.9-.5-6.2-.9" }),
272
- /* @__PURE__ */ h("line", {
302
+ /* @__PURE__ */ g("path", { d: "M17.3 4.9c-2.3-.6-4.4-1-6.2-.9-2.7 0-5.3.7-5.3 3.6 0 1.5 1.8 3.3 7.2 3.3" }),
303
+ /* @__PURE__ */ g("path", { d: "M13 15.1c0 2.8-2.6 3.6-5.3 3.6-1.8-.1-3.9-.5-6.2-.9" }),
304
+ /* @__PURE__ */ g("line", {
273
305
  x1: "4",
274
306
  y1: "12",
275
307
  x2: "20",
@@ -278,41 +310,42 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
278
310
  ]
279
311
  })
280
312
  }),
281
- /* @__PURE__ */ h(n, {
282
- onClick: () => _.chain().focus().toggleSubscript().run(),
283
- isActive: _.isActive("subscript"),
284
- title: w.subscript,
285
- children: /* @__PURE__ */ g("span", {
313
+ /* @__PURE__ */ g(n, {
314
+ onClick: () => b.chain().focus().toggleSubscript().run(),
315
+ isActive: b.isActive("subscript"),
316
+ title: D.subscript,
317
+ children: /* @__PURE__ */ _("span", {
286
318
  style: {
287
319
  fontSize: "13px",
288
320
  fontWeight: 600
289
321
  },
290
- children: ["X", /* @__PURE__ */ h("sub", {
322
+ children: ["X", /* @__PURE__ */ g("sub", {
291
323
  style: { fontSize: "9px" },
292
324
  children: "2"
293
325
  })]
294
326
  })
295
327
  }),
296
- /* @__PURE__ */ h(n, {
297
- onClick: () => _.chain().focus().toggleSuperscript().run(),
298
- isActive: _.isActive("superscript"),
299
- title: w.superscript,
300
- children: /* @__PURE__ */ g("span", {
328
+ /* @__PURE__ */ g(n, {
329
+ onClick: () => b.chain().focus().toggleSuperscript().run(),
330
+ isActive: b.isActive("superscript"),
331
+ title: D.superscript,
332
+ children: /* @__PURE__ */ _("span", {
301
333
  style: {
302
334
  fontSize: "13px",
303
335
  fontWeight: 600
304
336
  },
305
- children: ["X", /* @__PURE__ */ h("sup", {
337
+ children: ["X", /* @__PURE__ */ g("sup", {
306
338
  style: { fontSize: "9px" },
307
339
  children: "2"
308
340
  })]
309
341
  })
310
342
  }),
311
- D.formatPainter && /* @__PURE__ */ h(n, {
312
- onClick: P,
313
- isActive: !!T,
314
- title: T ? w.formatPainterActive : w.formatPainter,
315
- children: /* @__PURE__ */ g("svg", {
343
+ j.formatPainter && /* @__PURE__ */ g(n, {
344
+ onClick: R,
345
+ disabled: !b.isEditable || !O && b.state.selection.empty,
346
+ isActive: !!O,
347
+ title: O ? D.formatPainterActive : D.formatPainter,
348
+ children: /* @__PURE__ */ _("svg", {
316
349
  width: "16",
317
350
  height: "16",
318
351
  viewBox: "0 0 24 24",
@@ -322,40 +355,40 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
322
355
  strokeLinecap: "round",
323
356
  strokeLinejoin: "round",
324
357
  children: [
325
- /* @__PURE__ */ h("path", { d: "M19 3H5a2 2 0 00-2 2v2a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2z" }),
326
- /* @__PURE__ */ h("path", { d: "M10 7v4a2 2 0 01-2 2H7" }),
327
- /* @__PURE__ */ h("path", { d: "M7 13l-3 8" }),
328
- /* @__PURE__ */ h("path", { d: "M4 21h6" })
358
+ /* @__PURE__ */ g("path", { d: "M19 3H5a2 2 0 00-2 2v2a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2z" }),
359
+ /* @__PURE__ */ g("path", { d: "M10 7v4a2 2 0 01-2 2H7" }),
360
+ /* @__PURE__ */ g("path", { d: "M7 13l-3 8" }),
361
+ /* @__PURE__ */ g("path", { d: "M4 21h6" })
329
362
  ]
330
363
  })
331
364
  }),
332
- /* @__PURE__ */ h(r, {})
365
+ /* @__PURE__ */ g(r, {})
333
366
  ] }),
334
- D.heading && /* @__PURE__ */ g(m, { children: [[
367
+ j.heading && /* @__PURE__ */ _(h, { children: [[
335
368
  1,
336
369
  2,
337
370
  3,
338
371
  4,
339
372
  5,
340
373
  6
341
- ].map((e) => /* @__PURE__ */ h(n, {
342
- onClick: () => _.chain().focus().toggleHeading({ level: e }).run(),
343
- isActive: _.isActive("heading", { level: e }),
344
- title: `${w.heading} ${e}`,
345
- children: /* @__PURE__ */ g("span", {
374
+ ].map((e) => /* @__PURE__ */ g(n, {
375
+ onClick: () => b.chain().focus().toggleHeading({ level: e }).run(),
376
+ isActive: b.isActive("heading", { level: e }),
377
+ title: `${D.heading} ${e}`,
378
+ children: /* @__PURE__ */ _("span", {
346
379
  style: {
347
380
  fontSize: "12px",
348
381
  fontWeight: 700
349
382
  },
350
383
  children: ["H", e]
351
384
  })
352
- }, e)), /* @__PURE__ */ h(r, {})] }),
353
- D.alignment && /* @__PURE__ */ g(m, { children: [
354
- /* @__PURE__ */ h(n, {
355
- onClick: () => _.chain().focus().setTextAlign("left").run(),
356
- isActive: _.isActive({ textAlign: "left" }),
357
- title: w.alignLeft,
358
- children: /* @__PURE__ */ g("svg", {
385
+ }, e)), /* @__PURE__ */ g(r, {})] }),
386
+ j.alignment && /* @__PURE__ */ _(h, { children: [
387
+ /* @__PURE__ */ g(n, {
388
+ onClick: () => b.chain().focus().setTextAlign("left").run(),
389
+ isActive: b.isActive({ textAlign: "left" }),
390
+ title: D.alignLeft,
391
+ children: /* @__PURE__ */ _("svg", {
359
392
  width: "16",
360
393
  height: "16",
361
394
  viewBox: "0 0 24 24",
@@ -365,25 +398,25 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
365
398
  strokeLinecap: "round",
366
399
  strokeLinejoin: "round",
367
400
  children: [
368
- /* @__PURE__ */ h("line", {
401
+ /* @__PURE__ */ g("line", {
369
402
  x1: "17",
370
403
  y1: "10",
371
404
  x2: "3",
372
405
  y2: "10"
373
406
  }),
374
- /* @__PURE__ */ h("line", {
407
+ /* @__PURE__ */ g("line", {
375
408
  x1: "21",
376
409
  y1: "6",
377
410
  x2: "3",
378
411
  y2: "6"
379
412
  }),
380
- /* @__PURE__ */ h("line", {
413
+ /* @__PURE__ */ g("line", {
381
414
  x1: "21",
382
415
  y1: "14",
383
416
  x2: "3",
384
417
  y2: "14"
385
418
  }),
386
- /* @__PURE__ */ h("line", {
419
+ /* @__PURE__ */ g("line", {
387
420
  x1: "17",
388
421
  y1: "18",
389
422
  x2: "3",
@@ -392,11 +425,11 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
392
425
  ]
393
426
  })
394
427
  }),
395
- /* @__PURE__ */ h(n, {
396
- onClick: () => _.chain().focus().setTextAlign("center").run(),
397
- isActive: _.isActive({ textAlign: "center" }),
398
- title: w.alignCenter,
399
- children: /* @__PURE__ */ g("svg", {
428
+ /* @__PURE__ */ g(n, {
429
+ onClick: () => b.chain().focus().setTextAlign("center").run(),
430
+ isActive: b.isActive({ textAlign: "center" }),
431
+ title: D.alignCenter,
432
+ children: /* @__PURE__ */ _("svg", {
400
433
  width: "16",
401
434
  height: "16",
402
435
  viewBox: "0 0 24 24",
@@ -406,25 +439,25 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
406
439
  strokeLinecap: "round",
407
440
  strokeLinejoin: "round",
408
441
  children: [
409
- /* @__PURE__ */ h("line", {
442
+ /* @__PURE__ */ g("line", {
410
443
  x1: "18",
411
444
  y1: "10",
412
445
  x2: "6",
413
446
  y2: "10"
414
447
  }),
415
- /* @__PURE__ */ h("line", {
448
+ /* @__PURE__ */ g("line", {
416
449
  x1: "21",
417
450
  y1: "6",
418
451
  x2: "3",
419
452
  y2: "6"
420
453
  }),
421
- /* @__PURE__ */ h("line", {
454
+ /* @__PURE__ */ g("line", {
422
455
  x1: "21",
423
456
  y1: "14",
424
457
  x2: "3",
425
458
  y2: "14"
426
459
  }),
427
- /* @__PURE__ */ h("line", {
460
+ /* @__PURE__ */ g("line", {
428
461
  x1: "18",
429
462
  y1: "18",
430
463
  x2: "6",
@@ -433,11 +466,11 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
433
466
  ]
434
467
  })
435
468
  }),
436
- /* @__PURE__ */ h(n, {
437
- onClick: () => _.chain().focus().setTextAlign("right").run(),
438
- isActive: _.isActive({ textAlign: "right" }),
439
- title: w.alignRight,
440
- children: /* @__PURE__ */ g("svg", {
469
+ /* @__PURE__ */ g(n, {
470
+ onClick: () => b.chain().focus().setTextAlign("right").run(),
471
+ isActive: b.isActive({ textAlign: "right" }),
472
+ title: D.alignRight,
473
+ children: /* @__PURE__ */ _("svg", {
441
474
  width: "16",
442
475
  height: "16",
443
476
  viewBox: "0 0 24 24",
@@ -447,25 +480,25 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
447
480
  strokeLinecap: "round",
448
481
  strokeLinejoin: "round",
449
482
  children: [
450
- /* @__PURE__ */ h("line", {
483
+ /* @__PURE__ */ g("line", {
451
484
  x1: "21",
452
485
  y1: "10",
453
486
  x2: "7",
454
487
  y2: "10"
455
488
  }),
456
- /* @__PURE__ */ h("line", {
489
+ /* @__PURE__ */ g("line", {
457
490
  x1: "21",
458
491
  y1: "6",
459
492
  x2: "3",
460
493
  y2: "6"
461
494
  }),
462
- /* @__PURE__ */ h("line", {
495
+ /* @__PURE__ */ g("line", {
463
496
  x1: "21",
464
497
  y1: "14",
465
498
  x2: "3",
466
499
  y2: "14"
467
500
  }),
468
- /* @__PURE__ */ h("line", {
501
+ /* @__PURE__ */ g("line", {
469
502
  x1: "21",
470
503
  y1: "18",
471
504
  x2: "7",
@@ -474,11 +507,11 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
474
507
  ]
475
508
  })
476
509
  }),
477
- /* @__PURE__ */ h(n, {
478
- onClick: () => _.chain().focus().setTextAlign("justify").run(),
479
- isActive: _.isActive({ textAlign: "justify" }),
480
- title: w.alignJustify,
481
- children: /* @__PURE__ */ g("svg", {
510
+ /* @__PURE__ */ g(n, {
511
+ onClick: () => b.chain().focus().setTextAlign("justify").run(),
512
+ isActive: b.isActive({ textAlign: "justify" }),
513
+ title: D.alignJustify,
514
+ children: /* @__PURE__ */ _("svg", {
482
515
  width: "16",
483
516
  height: "16",
484
517
  viewBox: "0 0 24 24",
@@ -488,25 +521,25 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
488
521
  strokeLinecap: "round",
489
522
  strokeLinejoin: "round",
490
523
  children: [
491
- /* @__PURE__ */ h("line", {
524
+ /* @__PURE__ */ g("line", {
492
525
  x1: "21",
493
526
  y1: "10",
494
527
  x2: "3",
495
528
  y2: "10"
496
529
  }),
497
- /* @__PURE__ */ h("line", {
530
+ /* @__PURE__ */ g("line", {
498
531
  x1: "21",
499
532
  y1: "6",
500
533
  x2: "3",
501
534
  y2: "6"
502
535
  }),
503
- /* @__PURE__ */ h("line", {
536
+ /* @__PURE__ */ g("line", {
504
537
  x1: "21",
505
538
  y1: "14",
506
539
  x2: "3",
507
540
  y2: "14"
508
541
  }),
509
- /* @__PURE__ */ h("line", {
542
+ /* @__PURE__ */ g("line", {
510
543
  x1: "21",
511
544
  y1: "18",
512
545
  x2: "3",
@@ -515,14 +548,14 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
515
548
  ]
516
549
  })
517
550
  }),
518
- /* @__PURE__ */ h(r, {})
551
+ /* @__PURE__ */ g(r, {})
519
552
  ] }),
520
- D.list && /* @__PURE__ */ g(m, { children: [
521
- /* @__PURE__ */ h(n, {
522
- onClick: () => _.chain().focus().toggleBulletList().run(),
523
- isActive: _.isActive("bulletList"),
524
- title: w.bulletList,
525
- children: /* @__PURE__ */ g("svg", {
553
+ j.list && /* @__PURE__ */ _(h, { children: [
554
+ /* @__PURE__ */ g(n, {
555
+ onClick: () => b.chain().focus().toggleBulletList().run(),
556
+ isActive: b.isActive("bulletList"),
557
+ title: D.bulletList,
558
+ children: /* @__PURE__ */ _("svg", {
526
559
  width: "16",
527
560
  height: "16",
528
561
  viewBox: "0 0 24 24",
@@ -532,37 +565,37 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
532
565
  strokeLinecap: "round",
533
566
  strokeLinejoin: "round",
534
567
  children: [
535
- /* @__PURE__ */ h("line", {
568
+ /* @__PURE__ */ g("line", {
536
569
  x1: "8",
537
570
  y1: "6",
538
571
  x2: "21",
539
572
  y2: "6"
540
573
  }),
541
- /* @__PURE__ */ h("line", {
574
+ /* @__PURE__ */ g("line", {
542
575
  x1: "8",
543
576
  y1: "12",
544
577
  x2: "21",
545
578
  y2: "12"
546
579
  }),
547
- /* @__PURE__ */ h("line", {
580
+ /* @__PURE__ */ g("line", {
548
581
  x1: "8",
549
582
  y1: "18",
550
583
  x2: "21",
551
584
  y2: "18"
552
585
  }),
553
- /* @__PURE__ */ h("circle", {
586
+ /* @__PURE__ */ g("circle", {
554
587
  cx: "4",
555
588
  cy: "6",
556
589
  r: "1",
557
590
  fill: "currentColor"
558
591
  }),
559
- /* @__PURE__ */ h("circle", {
592
+ /* @__PURE__ */ g("circle", {
560
593
  cx: "4",
561
594
  cy: "12",
562
595
  r: "1",
563
596
  fill: "currentColor"
564
597
  }),
565
- /* @__PURE__ */ h("circle", {
598
+ /* @__PURE__ */ g("circle", {
566
599
  cx: "4",
567
600
  cy: "18",
568
601
  r: "1",
@@ -571,11 +604,11 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
571
604
  ]
572
605
  })
573
606
  }),
574
- /* @__PURE__ */ h(n, {
575
- onClick: () => _.chain().focus().toggleOrderedList().run(),
576
- isActive: _.isActive("orderedList"),
577
- title: w.orderedList,
578
- children: /* @__PURE__ */ g("svg", {
607
+ /* @__PURE__ */ g(n, {
608
+ onClick: () => b.chain().focus().toggleOrderedList().run(),
609
+ isActive: b.isActive("orderedList"),
610
+ title: D.orderedList,
611
+ children: /* @__PURE__ */ _("svg", {
579
612
  width: "16",
580
613
  height: "16",
581
614
  viewBox: "0 0 24 24",
@@ -585,25 +618,25 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
585
618
  strokeLinecap: "round",
586
619
  strokeLinejoin: "round",
587
620
  children: [
588
- /* @__PURE__ */ h("line", {
621
+ /* @__PURE__ */ g("line", {
589
622
  x1: "10",
590
623
  y1: "6",
591
624
  x2: "21",
592
625
  y2: "6"
593
626
  }),
594
- /* @__PURE__ */ h("line", {
627
+ /* @__PURE__ */ g("line", {
595
628
  x1: "10",
596
629
  y1: "12",
597
630
  x2: "21",
598
631
  y2: "12"
599
632
  }),
600
- /* @__PURE__ */ h("line", {
633
+ /* @__PURE__ */ g("line", {
601
634
  x1: "10",
602
635
  y1: "18",
603
636
  x2: "21",
604
637
  y2: "18"
605
638
  }),
606
- /* @__PURE__ */ h("text", {
639
+ /* @__PURE__ */ g("text", {
607
640
  x: "2",
608
641
  y: "8",
609
642
  fontSize: "8",
@@ -612,7 +645,7 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
612
645
  fontWeight: "bold",
613
646
  children: "1"
614
647
  }),
615
- /* @__PURE__ */ h("text", {
648
+ /* @__PURE__ */ g("text", {
616
649
  x: "2",
617
650
  y: "14",
618
651
  fontSize: "8",
@@ -621,7 +654,7 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
621
654
  fontWeight: "bold",
622
655
  children: "2"
623
656
  }),
624
- /* @__PURE__ */ h("text", {
657
+ /* @__PURE__ */ g("text", {
625
658
  x: "2",
626
659
  y: "20",
627
660
  fontSize: "8",
@@ -633,11 +666,11 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
633
666
  ]
634
667
  })
635
668
  }),
636
- /* @__PURE__ */ h(n, {
637
- onClick: () => _.chain().focus().toggleTaskList().run(),
638
- isActive: _.isActive("taskList"),
639
- title: w.taskList,
640
- children: /* @__PURE__ */ g("svg", {
669
+ /* @__PURE__ */ g(n, {
670
+ onClick: () => b.chain().focus().toggleTaskList().run(),
671
+ isActive: b.isActive("taskList"),
672
+ title: D.taskList,
673
+ children: /* @__PURE__ */ _("svg", {
641
674
  width: "16",
642
675
  height: "16",
643
676
  viewBox: "0 0 24 24",
@@ -647,28 +680,28 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
647
680
  strokeLinecap: "round",
648
681
  strokeLinejoin: "round",
649
682
  children: [
650
- /* @__PURE__ */ h("rect", {
683
+ /* @__PURE__ */ g("rect", {
651
684
  x: "3",
652
685
  y: "5",
653
686
  width: "6",
654
687
  height: "6",
655
688
  rx: "1"
656
689
  }),
657
- /* @__PURE__ */ h("path", { d: "M5 8l1.5 1.5L9 6.5" }),
658
- /* @__PURE__ */ h("line", {
690
+ /* @__PURE__ */ g("path", { d: "M5 8l1.5 1.5L9 6.5" }),
691
+ /* @__PURE__ */ g("line", {
659
692
  x1: "12",
660
693
  y1: "8",
661
694
  x2: "21",
662
695
  y2: "8"
663
696
  }),
664
- /* @__PURE__ */ h("rect", {
697
+ /* @__PURE__ */ g("rect", {
665
698
  x: "3",
666
699
  y: "14",
667
700
  width: "6",
668
701
  height: "6",
669
702
  rx: "1"
670
703
  }),
671
- /* @__PURE__ */ h("line", {
704
+ /* @__PURE__ */ g("line", {
672
705
  x1: "12",
673
706
  y1: "17",
674
707
  x2: "21",
@@ -677,14 +710,14 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
677
710
  ]
678
711
  })
679
712
  }),
680
- /* @__PURE__ */ h(r, {})
713
+ /* @__PURE__ */ g(r, {})
681
714
  ] }),
682
- D.insert && /* @__PURE__ */ g(m, { children: [
683
- /* @__PURE__ */ h(n, {
684
- onClick: () => _.chain().focus().toggleBlockquote().run(),
685
- isActive: _.isActive("blockquote"),
686
- title: w.blockquote,
687
- children: /* @__PURE__ */ g("svg", {
715
+ j.insert && /* @__PURE__ */ _(h, { children: [
716
+ /* @__PURE__ */ g(n, {
717
+ onClick: () => b.chain().focus().toggleBlockquote().run(),
718
+ isActive: b.isActive("blockquote"),
719
+ title: D.blockquote,
720
+ children: /* @__PURE__ */ _("svg", {
688
721
  width: "16",
689
722
  height: "16",
690
723
  viewBox: "0 0 24 24",
@@ -693,14 +726,14 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
693
726
  strokeWidth: "2",
694
727
  strokeLinecap: "round",
695
728
  strokeLinejoin: "round",
696
- children: [/* @__PURE__ */ h("path", { d: "M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z" }), /* @__PURE__ */ h("path", { d: "M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3z" })]
729
+ children: [/* @__PURE__ */ g("path", { d: "M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z" }), /* @__PURE__ */ g("path", { d: "M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3z" })]
697
730
  })
698
731
  }),
699
- /* @__PURE__ */ h(n, {
700
- onClick: () => _.chain().focus().toggleNode("codeBlock", "paragraph").run(),
701
- isActive: _.isActive("codeBlock"),
702
- title: w.codeBlock,
703
- children: /* @__PURE__ */ g("svg", {
732
+ /* @__PURE__ */ g(n, {
733
+ onClick: () => b.chain().focus().toggleNode("codeBlock", "paragraph").run(),
734
+ isActive: b.isActive("codeBlock"),
735
+ title: D.codeBlock,
736
+ children: /* @__PURE__ */ _("svg", {
704
737
  width: "16",
705
738
  height: "16",
706
739
  viewBox: "0 0 24 24",
@@ -709,12 +742,12 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
709
742
  strokeWidth: "2",
710
743
  strokeLinecap: "round",
711
744
  strokeLinejoin: "round",
712
- children: [/* @__PURE__ */ h("polyline", { points: "16 18 22 12 16 6" }), /* @__PURE__ */ h("polyline", { points: "8 6 2 12 8 18" })]
745
+ children: [/* @__PURE__ */ g("polyline", { points: "16 18 22 12 16 6" }), /* @__PURE__ */ g("polyline", { points: "8 6 2 12 8 18" })]
713
746
  })
714
747
  }),
715
- /* @__PURE__ */ h(n, {
748
+ /* @__PURE__ */ g(n, {
716
749
  onClick: () => {
717
- _.chain().focus().insertContent({
750
+ b.chain().focus().insertContent({
718
751
  type: "codeBlock",
719
752
  attrs: { language: "r-mermaid" },
720
753
  content: [{
@@ -723,8 +756,8 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
723
756
  }]
724
757
  }).run();
725
758
  },
726
- title: w.mermaidBlock,
727
- children: /* @__PURE__ */ g("svg", {
759
+ title: D.mermaidBlock,
760
+ children: /* @__PURE__ */ _("svg", {
728
761
  width: "16",
729
762
  height: "16",
730
763
  viewBox: "0 0 24 24",
@@ -734,28 +767,28 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
734
767
  strokeLinecap: "round",
735
768
  strokeLinejoin: "round",
736
769
  children: [
737
- /* @__PURE__ */ h("circle", {
770
+ /* @__PURE__ */ g("circle", {
738
771
  cx: "6",
739
772
  cy: "6",
740
773
  r: "3"
741
774
  }),
742
- /* @__PURE__ */ h("circle", {
775
+ /* @__PURE__ */ g("circle", {
743
776
  cx: "18",
744
777
  cy: "6",
745
778
  r: "3"
746
779
  }),
747
- /* @__PURE__ */ h("circle", {
780
+ /* @__PURE__ */ g("circle", {
748
781
  cx: "12",
749
782
  cy: "18",
750
783
  r: "3"
751
784
  }),
752
- /* @__PURE__ */ h("line", {
785
+ /* @__PURE__ */ g("line", {
753
786
  x1: "6",
754
787
  y1: "9",
755
788
  x2: "12",
756
789
  y2: "15"
757
790
  }),
758
- /* @__PURE__ */ h("line", {
791
+ /* @__PURE__ */ g("line", {
759
792
  x1: "18",
760
793
  y1: "9",
761
794
  x2: "12",
@@ -764,11 +797,11 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
764
797
  ]
765
798
  })
766
799
  }),
767
- /* @__PURE__ */ h(n, {
768
- onClick: O,
769
- isActive: _.isActive("link"),
770
- title: w.link,
771
- children: /* @__PURE__ */ g("svg", {
800
+ /* @__PURE__ */ g(n, {
801
+ onClick: M,
802
+ isActive: b.isActive("link"),
803
+ title: D.link,
804
+ children: /* @__PURE__ */ _("svg", {
772
805
  width: "16",
773
806
  height: "16",
774
807
  viewBox: "0 0 24 24",
@@ -777,13 +810,13 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
777
810
  strokeWidth: "2",
778
811
  strokeLinecap: "round",
779
812
  strokeLinejoin: "round",
780
- children: [/* @__PURE__ */ h("path", { d: "M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71" }), /* @__PURE__ */ h("path", { d: "M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71" })]
813
+ children: [/* @__PURE__ */ g("path", { d: "M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71" }), /* @__PURE__ */ g("path", { d: "M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71" })]
781
814
  })
782
815
  }),
783
- /* @__PURE__ */ h(n, {
784
- onClick: k,
785
- title: w.image,
786
- children: /* @__PURE__ */ g("svg", {
816
+ /* @__PURE__ */ g(n, {
817
+ onClick: N,
818
+ title: D.image,
819
+ children: /* @__PURE__ */ _("svg", {
787
820
  width: "16",
788
821
  height: "16",
789
822
  viewBox: "0 0 24 24",
@@ -793,7 +826,7 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
793
826
  strokeLinecap: "round",
794
827
  strokeLinejoin: "round",
795
828
  children: [
796
- /* @__PURE__ */ h("rect", {
829
+ /* @__PURE__ */ g("rect", {
797
830
  x: "3",
798
831
  y: "3",
799
832
  width: "18",
@@ -801,19 +834,19 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
801
834
  rx: "2",
802
835
  ry: "2"
803
836
  }),
804
- /* @__PURE__ */ h("circle", {
837
+ /* @__PURE__ */ g("circle", {
805
838
  cx: "8.5",
806
839
  cy: "8.5",
807
840
  r: "1.5"
808
841
  }),
809
- /* @__PURE__ */ h("polyline", { points: "21 15 16 10 5 21" })
842
+ /* @__PURE__ */ g("polyline", { points: "21 15 16 10 5 21" })
810
843
  ]
811
844
  })
812
845
  }),
813
- /* @__PURE__ */ h(n, {
814
- onClick: A,
815
- title: w.table,
816
- children: /* @__PURE__ */ g("svg", {
846
+ /* @__PURE__ */ g(n, {
847
+ onClick: P,
848
+ title: D.table,
849
+ children: /* @__PURE__ */ _("svg", {
817
850
  width: "16",
818
851
  height: "16",
819
852
  viewBox: "0 0 24 24",
@@ -823,32 +856,32 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
823
856
  strokeLinecap: "round",
824
857
  strokeLinejoin: "round",
825
858
  children: [
826
- /* @__PURE__ */ h("rect", {
859
+ /* @__PURE__ */ g("rect", {
827
860
  x: "3",
828
861
  y: "3",
829
862
  width: "18",
830
863
  height: "18",
831
864
  rx: "2"
832
865
  }),
833
- /* @__PURE__ */ h("line", {
866
+ /* @__PURE__ */ g("line", {
834
867
  x1: "3",
835
868
  y1: "9",
836
869
  x2: "21",
837
870
  y2: "9"
838
871
  }),
839
- /* @__PURE__ */ h("line", {
872
+ /* @__PURE__ */ g("line", {
840
873
  x1: "3",
841
874
  y1: "15",
842
875
  x2: "21",
843
876
  y2: "15"
844
877
  }),
845
- /* @__PURE__ */ h("line", {
878
+ /* @__PURE__ */ g("line", {
846
879
  x1: "9",
847
880
  y1: "3",
848
881
  x2: "9",
849
882
  y2: "21"
850
883
  }),
851
- /* @__PURE__ */ h("line", {
884
+ /* @__PURE__ */ g("line", {
852
885
  x1: "15",
853
886
  y1: "3",
854
887
  x2: "15",
@@ -857,14 +890,14 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
857
890
  ]
858
891
  })
859
892
  }),
860
- D.tableOps && /* @__PURE__ */ h(u, {
861
- editor: _,
862
- labels: w
893
+ j.tableOps && /* @__PURE__ */ g(u, {
894
+ editor: b,
895
+ labels: D
863
896
  }),
864
- /* @__PURE__ */ h(n, {
865
- onClick: () => _.chain().focus().setHorizontalRule().run(),
866
- title: w.horizontalRule,
867
- children: /* @__PURE__ */ h("svg", {
897
+ /* @__PURE__ */ g(n, {
898
+ onClick: () => b.chain().focus().setHorizontalRule().run(),
899
+ title: D.horizontalRule,
900
+ children: /* @__PURE__ */ g("svg", {
868
901
  width: "16",
869
902
  height: "16",
870
903
  viewBox: "0 0 24 24",
@@ -872,7 +905,7 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
872
905
  stroke: "currentColor",
873
906
  strokeWidth: "2",
874
907
  strokeLinecap: "round",
875
- children: /* @__PURE__ */ h("line", {
908
+ children: /* @__PURE__ */ g("line", {
876
909
  x1: "3",
877
910
  y1: "12",
878
911
  x2: "21",
@@ -880,10 +913,10 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
880
913
  })
881
914
  })
882
915
  }),
883
- /* @__PURE__ */ h(n, {
884
- onClick: j,
885
- title: w.markdownBlock,
886
- children: /* @__PURE__ */ g("svg", {
916
+ /* @__PURE__ */ g(n, {
917
+ onClick: F,
918
+ title: D.markdownBlock,
919
+ children: /* @__PURE__ */ _("svg", {
887
920
  width: "16",
888
921
  height: "16",
889
922
  viewBox: "0 0 24 24",
@@ -893,30 +926,30 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
893
926
  strokeLinecap: "round",
894
927
  strokeLinejoin: "round",
895
928
  children: [
896
- /* @__PURE__ */ h("path", { d: "M2 3h20v18H2z" }),
897
- /* @__PURE__ */ h("path", { d: "M5 15V9l3 3.5L11 9v6" }),
898
- /* @__PURE__ */ h("path", { d: "M17 9l-2.5 3H17v3" })
929
+ /* @__PURE__ */ g("path", { d: "M2 3h20v18H2z" }),
930
+ /* @__PURE__ */ g("path", { d: "M5 15V9l3 3.5L11 9v6" }),
931
+ /* @__PURE__ */ g("path", { d: "M17 9l-2.5 3H17v3" })
899
932
  ]
900
933
  })
901
934
  }),
902
- /* @__PURE__ */ h(c, {
903
- labels: w,
904
- onSelect: M
935
+ /* @__PURE__ */ g(c, {
936
+ labels: D,
937
+ onSelect: I
905
938
  }),
906
- /* @__PURE__ */ h(l, {
907
- labels: w,
908
- onInsert: N
939
+ /* @__PURE__ */ g(l, {
940
+ labels: D,
941
+ onInsert: L
909
942
  }),
910
- /* @__PURE__ */ h(r, {})
943
+ /* @__PURE__ */ g(r, {})
911
944
  ] }),
912
- D.color && /* @__PURE__ */ g(m, { children: [
913
- /* @__PURE__ */ h(i, {
914
- value: _.getAttributes("textStyle").color || "",
945
+ j.color && /* @__PURE__ */ _(h, { children: [
946
+ /* @__PURE__ */ g(i, {
947
+ value: b.getAttributes("textStyle").color || "",
915
948
  onChange: (e) => {
916
- e ? _.chain().focus().setColor(e).run() : _.chain().focus().unsetColor().run();
949
+ e ? b.chain().focus().setColor(e).run() : b.chain().focus().unsetColor().run();
917
950
  },
918
- title: w.color,
919
- icon: /* @__PURE__ */ h("svg", {
951
+ title: D.color,
952
+ icon: /* @__PURE__ */ g("svg", {
920
953
  width: "16",
921
954
  height: "16",
922
955
  viewBox: "0 0 24 24",
@@ -925,16 +958,16 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
925
958
  strokeWidth: "2",
926
959
  strokeLinecap: "round",
927
960
  strokeLinejoin: "round",
928
- children: /* @__PURE__ */ h("path", { d: "M12 2L2 22h20L12 2z" })
961
+ children: /* @__PURE__ */ g("path", { d: "M12 2L2 22h20L12 2z" })
929
962
  })
930
963
  }),
931
- /* @__PURE__ */ h(i, {
932
- value: _.getAttributes("highlight").color || "",
964
+ /* @__PURE__ */ g(i, {
965
+ value: b.getAttributes("highlight").color || "",
933
966
  onChange: (e) => {
934
- e ? _.chain().focus().toggleHighlight({ color: e }).run() : _.chain().focus().unsetHighlight().run();
967
+ e ? b.chain().focus().toggleHighlight({ color: e }).run() : b.chain().focus().unsetHighlight().run();
935
968
  },
936
- title: w.highlight,
937
- icon: /* @__PURE__ */ g("svg", {
969
+ title: D.highlight,
970
+ icon: /* @__PURE__ */ _("svg", {
938
971
  width: "16",
939
972
  height: "16",
940
973
  viewBox: "0 0 24 24",
@@ -943,15 +976,15 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
943
976
  strokeWidth: "2",
944
977
  strokeLinecap: "round",
945
978
  strokeLinejoin: "round",
946
- children: [/* @__PURE__ */ h("path", { d: "M12 20h9" }), /* @__PURE__ */ h("path", { d: "M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z" })]
979
+ children: [/* @__PURE__ */ g("path", { d: "M12 20h9" }), /* @__PURE__ */ g("path", { d: "M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z" })]
947
980
  })
948
981
  }),
949
- /* @__PURE__ */ h(r, {})
982
+ /* @__PURE__ */ g(r, {})
950
983
  ] }),
951
- D.ai && b && x && /* @__PURE__ */ h(n, {
952
- onClick: x,
953
- title: w.ai,
954
- children: /* @__PURE__ */ g("svg", {
984
+ j.ai && C && w && /* @__PURE__ */ g(n, {
985
+ onClick: w,
986
+ title: D.ai,
987
+ children: /* @__PURE__ */ _("svg", {
955
988
  width: "16",
956
989
  height: "16",
957
990
  viewBox: "0 0 24 24",
@@ -960,14 +993,14 @@ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPain
960
993
  strokeWidth: "2",
961
994
  strokeLinecap: "round",
962
995
  strokeLinejoin: "round",
963
- children: [/* @__PURE__ */ h("path", { d: "M9.5 2A2.5 2.5 0 0112 4.5v15a2.5 2.5 0 01-4.96.44 2.5 2.5 0 01-2.96-3.08 3 3 0 01-.34-5.58 2.5 2.5 0 011.32-4.24 2.5 2.5 0 011.98-3A2.5 2.5 0 019.5 2z" }), /* @__PURE__ */ h("path", { d: "M14.5 2A2.5 2.5 0 0012 4.5v15a2.5 2.5 0 004.96.44 2.5 2.5 0 002.96-3.08 3 3 0 00.34-5.58 2.5 2.5 0 00-1.32-4.24 2.5 2.5 0 00-1.98-3A2.5 2.5 0 0014.5 2z" })]
996
+ children: [/* @__PURE__ */ g("path", { d: "M9.5 2A2.5 2.5 0 0112 4.5v15a2.5 2.5 0 01-4.96.44 2.5 2.5 0 01-2.96-3.08 3 3 0 01-.34-5.58 2.5 2.5 0 011.32-4.24 2.5 2.5 0 011.98-3A2.5 2.5 0 019.5 2z" }), /* @__PURE__ */ g("path", { d: "M14.5 2A2.5 2.5 0 0012 4.5v15a2.5 2.5 0 004.96.44 2.5 2.5 0 002.96-3.08 3 3 0 00.34-5.58 2.5 2.5 0 00-1.32-4.24 2.5 2.5 0 00-1.98-3A2.5 2.5 0 0014.5 2z" })]
964
997
  })
965
998
  }),
966
- C
999
+ E
967
1000
  ]
968
1001
  });
969
1002
  };
970
1003
  //#endregion
971
- export { _ as default };
1004
+ export { b as default };
972
1005
 
973
1006
  //# sourceMappingURL=Toolbar.js.map