dishui 0.0.91 → 0.0.101

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 (156) hide show
  1. package/dist/.release-verified.json +6 -0
  2. package/dist/ai.js +24 -0
  3. package/dist/components/Card/Metric2.js +11 -11
  4. package/dist/components/Card/Metric2.js.map +1 -1
  5. package/dist/components/Card/Ticket.d.ts +52 -0
  6. package/dist/components/Card/Ticket2.js +218 -0
  7. package/dist/components/Card/Ticket2.js.map +1 -0
  8. package/dist/components/Card/index.d.ts +32 -0
  9. package/dist/components/Card/index.js +211 -203
  10. package/dist/components/Card/index.js.map +1 -1
  11. package/dist/components/GroupButton/index.js +4 -4
  12. package/dist/components/GroupButton/index.js.map +1 -1
  13. package/dist/components/GroupedTable/index.js +10 -10
  14. package/dist/components/GroupedTable/index.js.map +1 -1
  15. package/dist/components/NavigationList/index.js +9 -9
  16. package/dist/components/NavigationList/index.js.map +1 -1
  17. package/dist/components/Section/index.js +11 -11
  18. package/dist/components/Section/index.js.map +1 -1
  19. package/dist/components/Skeleton/index.js +1 -1
  20. package/dist/components/Skeleton/index.js.map +1 -1
  21. package/dist/components/Table/index.js +6 -6
  22. package/dist/components/Table/index.js.map +1 -1
  23. package/dist/components/ai/AgentChat/index.d.ts +54 -0
  24. package/dist/components/ai/AgentChat/index.js +176 -0
  25. package/dist/components/ai/AgentChat/index.js.map +1 -0
  26. package/dist/components/ai/AgentRunCard/index.d.ts +38 -0
  27. package/dist/components/ai/AgentRunCard/index.js +100 -0
  28. package/dist/components/ai/AgentRunCard/index.js.map +1 -0
  29. package/dist/components/ai/AgentScreen/index.d.ts +50 -0
  30. package/dist/components/ai/AgentScreen/index.js +233 -0
  31. package/dist/components/ai/AgentScreen/index.js.map +1 -0
  32. package/dist/components/ai/ApprovalCard/index.d.ts +26 -0
  33. package/dist/components/ai/ApprovalCard/index.js +89 -0
  34. package/dist/components/ai/ApprovalCard/index.js.map +1 -0
  35. package/dist/components/ai/CodeView/index.d.ts +30 -0
  36. package/dist/components/ai/CodeView/index.js +149 -0
  37. package/dist/components/ai/CodeView/index.js.map +1 -0
  38. package/dist/components/ai/CommandSearch/index.d.ts +39 -0
  39. package/dist/components/ai/CommandSearch/index.js +217 -0
  40. package/dist/components/ai/CommandSearch/index.js.map +1 -0
  41. package/dist/components/ai/ContextCards/index.d.ts +42 -0
  42. package/dist/components/ai/ContextCards/index.js +106 -0
  43. package/dist/components/ai/ContextCards/index.js.map +1 -0
  44. package/dist/components/ai/DiffTable/index.d.ts +70 -0
  45. package/dist/components/ai/DiffTable/index.js +235 -0
  46. package/dist/components/ai/DiffTable/index.js.map +1 -0
  47. package/dist/components/ai/FilterTable/index.d.ts +35 -0
  48. package/dist/components/ai/FilterTable/index.js +86 -0
  49. package/dist/components/ai/FilterTable/index.js.map +1 -0
  50. package/dist/components/ai/FineTuneCard/index.d.ts +24 -0
  51. package/dist/components/ai/FineTuneCard/index.js +75 -0
  52. package/dist/components/ai/FineTuneCard/index.js.map +1 -0
  53. package/dist/components/ai/InsightCards/index.d.ts +23 -0
  54. package/dist/components/ai/InsightCards/index.js +64 -0
  55. package/dist/components/ai/InsightCards/index.js.map +1 -0
  56. package/dist/components/ai/IssueCard/index.d.ts +39 -0
  57. package/dist/components/ai/IssueCard/index.js +78 -0
  58. package/dist/components/ai/IssueCard/index.js.map +1 -0
  59. package/dist/components/ai/LoadingState/index.d.ts +22 -0
  60. package/dist/components/ai/LoadingState/index.js +80 -0
  61. package/dist/components/ai/LoadingState/index.js.map +1 -0
  62. package/dist/components/ai/PromptBar/index.d.ts +26 -0
  63. package/dist/components/ai/PromptBar/index.js +117 -0
  64. package/dist/components/ai/PromptBar/index.js.map +1 -0
  65. package/dist/components/ai/RecommendationCard/index.d.ts +44 -0
  66. package/dist/components/ai/RecommendationCard/index.js +142 -0
  67. package/dist/components/ai/RecommendationCard/index.js.map +1 -0
  68. package/dist/components/ai/RecordsTable/index.d.ts +65 -0
  69. package/dist/components/ai/RecordsTable/index.js +334 -0
  70. package/dist/components/ai/RecordsTable/index.js.map +1 -0
  71. package/dist/components/ai/SelectionActions/index.d.ts +19 -0
  72. package/dist/components/ai/SelectionActions/index.js +40 -0
  73. package/dist/components/ai/SelectionActions/index.js.map +1 -0
  74. package/dist/components/ai/StateFlow/index.d.ts +24 -0
  75. package/dist/components/ai/StateFlow/index.js +50 -0
  76. package/dist/components/ai/StateFlow/index.js.map +1 -0
  77. package/dist/components/ai/StreamingText/index.d.ts +44 -0
  78. package/dist/components/ai/StreamingText/index.js +211 -0
  79. package/dist/components/ai/StreamingText/index.js.map +1 -0
  80. package/dist/components/ai/TaskRows/index.d.ts +53 -0
  81. package/dist/components/ai/TaskRows/index.js +186 -0
  82. package/dist/components/ai/TaskRows/index.js.map +1 -0
  83. package/dist/components/ai/Thinking/index.d.ts +47 -0
  84. package/dist/components/ai/Thinking/index.js +197 -0
  85. package/dist/components/ai/Thinking/index.js.map +1 -0
  86. package/dist/components/ai/ToolChips/index.d.ts +21 -0
  87. package/dist/components/ai/ToolChips/index.js +63 -0
  88. package/dist/components/ai/ToolChips/index.js.map +1 -0
  89. package/dist/components/ai/index.d.ts +54 -0
  90. package/dist/components/ai/shared.d.ts +13 -0
  91. package/dist/components/ai/shared.js +25 -0
  92. package/dist/components/ai/shared.js.map +1 -0
  93. package/dist/components/pro/DataTable/rowDetailExtension.js +1 -1
  94. package/dist/components/pro/DataTable/rowDetailExtension.js.map +1 -1
  95. package/dist/components/pro/Flow/constants.js +3 -3
  96. package/dist/components/pro/Flow/constants.js.map +1 -1
  97. package/dist/components/pro/Flow/nodes/shapes.js +3 -3
  98. package/dist/components/pro/Flow/nodes/shapes.js.map +1 -1
  99. package/dist/components/pro/Flow/utils/themeColor.d.ts +2 -2
  100. package/dist/components/pro/Flow/utils/themeColor.js +2 -2
  101. package/dist/components/pro/Flow/utils/themeColor.js.map +1 -1
  102. package/dist/components/pro/Kanban/Kanban.d.ts +3 -0
  103. package/dist/components/pro/Kanban/Kanban.js +339 -0
  104. package/dist/components/pro/Kanban/Kanban.js.map +1 -0
  105. package/dist/components/pro/Kanban/Swimlanes.d.ts +3 -0
  106. package/dist/components/pro/Kanban/Swimlanes.js +60 -0
  107. package/dist/components/pro/Kanban/Swimlanes.js.map +1 -0
  108. package/dist/components/pro/Kanban/index.d.ts +5 -0
  109. package/dist/components/pro/Kanban/types.d.ts +103 -0
  110. package/dist/components/pro/Kanban/useKanbanDrag.d.ts +17 -0
  111. package/dist/components/pro/Kanban/useKanbanDrag.js +69 -0
  112. package/dist/components/pro/Kanban/useKanbanDrag.js.map +1 -0
  113. package/dist/components/pro/Kanban/utils.d.ts +13 -0
  114. package/dist/components/pro/Kanban/utils.js +48 -0
  115. package/dist/components/pro/Kanban/utils.js.map +1 -0
  116. package/dist/components/pro/RichTextEditor/AIRewrite.js +158 -127
  117. package/dist/components/pro/RichTextEditor/AIRewrite.js.map +1 -1
  118. package/dist/components/pro/RichTextEditor/BlockHandle.d.ts +2 -0
  119. package/dist/components/pro/RichTextEditor/BlockHandle.js +156 -115
  120. package/dist/components/pro/RichTextEditor/BlockHandle.js.map +1 -1
  121. package/dist/components/pro/RichTextEditor/RichTextEditor.js +136 -159
  122. package/dist/components/pro/RichTextEditor/RichTextEditor.js.map +1 -1
  123. package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js +44 -41
  124. package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js.map +1 -1
  125. package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js +59 -53
  126. package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js.map +1 -1
  127. package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js +48 -44
  128. package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js.map +1 -1
  129. package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js +67 -63
  130. package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js.map +1 -1
  131. package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.d.ts +1 -0
  132. package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js +182 -129
  133. package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js.map +1 -1
  134. package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.d.ts +1 -0
  135. package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js +3 -3
  136. package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js.map +1 -1
  137. package/dist/components/pro/RichTextEditor/Toolbar/useAnchoredDropdown.d.ts +3 -0
  138. package/dist/components/pro/RichTextEditor/Toolbar/useAnchoredDropdown.js +31 -0
  139. package/dist/components/pro/RichTextEditor/Toolbar/useAnchoredDropdown.js.map +1 -0
  140. package/dist/components/pro/RichTextEditor/index.d.ts +1 -1
  141. package/dist/components/pro/RichTextEditor/types.d.ts +78 -11
  142. package/dist/components/pro/RichTextEditor/types.js +11 -0
  143. package/dist/components/pro/RichTextEditor/types.js.map +1 -1
  144. package/dist/dishui.css +1 -1
  145. package/dist/index-nostyled.d.ts +1 -1
  146. package/dist/index.d.ts +6 -3
  147. package/dist/index.js +134 -107
  148. package/dist/kanban.js +5 -0
  149. package/dist/layouts/Sidebar.d.ts +16 -0
  150. package/dist/layouts/Sidebar.js +85 -52
  151. package/dist/layouts/Sidebar.js.map +1 -1
  152. package/dist/utils/i18n.js +20 -0
  153. package/dist/utils/i18n.js.map +1 -1
  154. package/dist/utils/menu.js +1 -1
  155. package/dist/utils/menu.js.map +1 -1
  156. package/package.json +14 -3
@@ -20,8 +20,8 @@ var y = /* @__PURE__ */ new Set([
20
20
  "superscript",
21
21
  "textStyle",
22
22
  "highlight"
23
- ]), b = ({ editor: b, config: x, labels: S, hasAI: C, onAIClick: w, onFormatPainterChange: T, children: E }) => {
24
- let D = {
23
+ ]), b = ({ editor: b, config: x, labels: S, hasAI: C, onAIClick: w, onRequestAIConfig: T, onFormatPainterChange: E, children: D }) => {
24
+ let O = {
25
25
  ...e,
26
26
  ...S
27
27
  };
@@ -29,11 +29,11 @@ var y = /* @__PURE__ */ new Set([
29
29
  editor: b,
30
30
  selector: ({ transactionNumber: e }) => e
31
31
  });
32
- let [O, k] = m(null), A = p(T);
32
+ let [k, A] = m(null), j = p(E);
33
33
  f(() => {
34
- A.current = T;
35
- }, [T]);
36
- let j = {
34
+ j.current = E;
35
+ }, [E]);
36
+ let M = {
37
37
  textFormat: x?.textFormat ?? !0,
38
38
  heading: x?.heading ?? !0,
39
39
  alignment: x?.alignment ?? !0,
@@ -45,8 +45,8 @@ var y = /* @__PURE__ */ new Set([
45
45
  tableOps: x?.tableOps ?? !0,
46
46
  fontStyle: x?.fontStyle ?? !0,
47
47
  formatPainter: x?.formatPainter ?? !0
48
- }, M = d(() => {
49
- let e = b.getAttributes("link").href, t = window.prompt(D.insertLinkUrl, e);
48
+ }, N = x?.buttons ?? {}, P = (e, t = !0) => N[e] ?? t, F = d(() => {
49
+ let e = b.getAttributes("link").href, t = window.prompt(O.insertLinkUrl, e);
50
50
  if (t !== null && !b.isDestroyed && b.isEditable) {
51
51
  if (t.trim() === "") {
52
52
  b.chain().focus().extendMarkRange("link").unsetLink().run();
@@ -54,16 +54,16 @@ var y = /* @__PURE__ */ new Set([
54
54
  }
55
55
  b.chain().focus().extendMarkRange("link").setLink({ href: t.trim() }).run();
56
56
  }
57
- }, [b, D.insertLinkUrl]), N = d(() => {
58
- let e = window.prompt(D.insertImageUrl);
57
+ }, [b, O.insertLinkUrl]), I = d(() => {
58
+ let e = window.prompt(O.insertImageUrl);
59
59
  e && b.chain().focus().setImage({ src: e }).run();
60
- }, [b, D.insertImageUrl]), P = d(() => {
60
+ }, [b, O.insertImageUrl]), L = d(() => {
61
61
  b.chain().focus().insertTable({
62
62
  rows: 3,
63
63
  cols: 3,
64
64
  withHeaderRow: !0
65
65
  }).run();
66
- }, [b]), F = d(() => {
66
+ }, [b]), R = d(() => {
67
67
  b.chain().focus().insertContent({
68
68
  type: "codeBlock",
69
69
  attrs: { language: "r-markdown" },
@@ -72,7 +72,7 @@ var y = /* @__PURE__ */ new Set([
72
72
  text: "# Markdown\n\nWrite your **markdown** here."
73
73
  }]
74
74
  }).run();
75
- }, [b]), I = d((e, t = !0) => {
75
+ }, [b]), z = d((e, t = !0) => {
76
76
  if (b.isDestroyed || !b.isEditable) return;
77
77
  let n = b.chain();
78
78
  t && n.focus(), n.insertContent({
@@ -83,7 +83,7 @@ var y = /* @__PURE__ */ new Set([
83
83
  text: e
84
84
  }]
85
85
  }).run();
86
- }, [b]), L = d((e = "block", n = !0) => {
86
+ }, [b]), B = d((e = "block", n = !0) => {
87
87
  if (b.isDestroyed || !b.isEditable) return;
88
88
  let r = e === "float" ? {
89
89
  x: 40,
@@ -99,9 +99,9 @@ var y = /* @__PURE__ */ new Set([
99
99
  },
100
100
  content: [{ type: "paragraph" }]
101
101
  }).run();
102
- }, [b]), R = d(() => {
103
- if (O) {
104
- k(null);
102
+ }, [b]), V = d(() => {
103
+ if (k) {
104
+ A(null);
105
105
  return;
106
106
  }
107
107
  if (b.isDestroyed || !b.isEditable) return;
@@ -112,17 +112,17 @@ var y = /* @__PURE__ */ new Set([
112
112
  if (!e.isText) return;
113
113
  let t = e.marks.filter((e) => y.has(e.type.name));
114
114
  n = n === void 0 ? t : n.filter((e) => t.some((t) => e.eq(t)));
115
- }), n !== void 0 && k(n);
116
- }, [b, O]);
115
+ }), n !== void 0 && A(n);
116
+ }, [b, k]);
117
117
  f(() => {
118
- if (!O) return;
119
- if (b.isDestroyed || !b.isEditable || !j.formatPainter || !j.textFormat) {
120
- k(null);
118
+ if (!k) return;
119
+ if (b.isDestroyed || !b.isEditable || !M.formatPainter || !M.textFormat) {
120
+ A(null);
121
121
  return;
122
122
  }
123
- A.current?.(!0);
123
+ j.current?.(!0);
124
124
  let e = b.view.dom, t = null, n = !1, r = () => {
125
- n = !0, t !== null && cancelAnimationFrame(t), t = null, k(null);
125
+ n = !0, t !== null && cancelAnimationFrame(t), t = null, A(null);
126
126
  }, i = () => {
127
127
  b.isEditable || r();
128
128
  }, a = (e) => {
@@ -139,31 +139,31 @@ var y = /* @__PURE__ */ new Set([
139
139
  b.state.doc.nodesBetween(e, r, (t, n) => {
140
140
  if (!t.isText) return;
141
141
  let a = t.marks.filter((e) => !y.has(e.type.name));
142
- 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);
143
- }), n = !0, b.view.dispatch(i), k(null);
142
+ for (let o of k) 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);
143
+ }), n = !0, b.view.dispatch(i), A(null);
144
144
  }, s = () => {
145
145
  n || (t !== null && cancelAnimationFrame(t), t = requestAnimationFrame(o));
146
146
  };
147
147
  return e.addEventListener("mouseup", s), e.ownerDocument.addEventListener("keydown", a), b.on("transaction", i), b.on("destroy", r), () => {
148
- 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);
148
+ n = !0, t !== null && cancelAnimationFrame(t), e.removeEventListener("mouseup", s), e.ownerDocument.removeEventListener("keydown", a), b.off("transaction", i), b.off("destroy", r), j.current?.(!1);
149
149
  };
150
150
  }, [
151
151
  b,
152
- O,
153
- j.formatPainter,
154
- j.textFormat
152
+ k,
153
+ M.formatPainter,
154
+ M.textFormat
155
155
  ]);
156
- let z = b.getAttributes("textStyle").fontFamily || "", B = b.getAttributes("textStyle").fontSize || "";
156
+ let H = b.getAttributes("textStyle").fontFamily || "", U = b.getAttributes("textStyle").fontSize || "";
157
157
  return /* @__PURE__ */ _("div", {
158
158
  className: "rte-toolbar",
159
159
  role: "group",
160
160
  "aria-label": "Text formatting",
161
161
  children: [
162
- j.history && /* @__PURE__ */ _(h, { children: [
163
- /* @__PURE__ */ g(n, {
162
+ (P("undo", M.history) || P("redo", M.history)) && /* @__PURE__ */ _(h, { children: [
163
+ P("undo", M.history) && /* @__PURE__ */ g(n, {
164
164
  onClick: () => b.chain().focus().undo().run(),
165
165
  disabled: !b.can().undo(),
166
- title: D.undo,
166
+ title: O.undo,
167
167
  children: /* @__PURE__ */ _("svg", {
168
168
  width: "16",
169
169
  height: "16",
@@ -176,10 +176,10 @@ var y = /* @__PURE__ */ new Set([
176
176
  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" })]
177
177
  })
178
178
  }),
179
- /* @__PURE__ */ g(n, {
179
+ P("redo", M.history) && /* @__PURE__ */ g(n, {
180
180
  onClick: () => b.chain().focus().redo().run(),
181
181
  disabled: !b.can().redo(),
182
- title: D.redo,
182
+ title: O.redo,
183
183
  children: /* @__PURE__ */ _("svg", {
184
184
  width: "16",
185
185
  height: "16",
@@ -194,32 +194,40 @@ var y = /* @__PURE__ */ new Set([
194
194
  }),
195
195
  /* @__PURE__ */ g(r, {})
196
196
  ] }),
197
- j.fontStyle && /* @__PURE__ */ _(h, { children: [
198
- /* @__PURE__ */ g(s, {
199
- value: z,
197
+ (P("fontFamily", M.fontStyle) || P("fontSize", M.fontStyle)) && /* @__PURE__ */ _(h, { children: [
198
+ P("fontFamily", M.fontStyle) && /* @__PURE__ */ g(s, {
199
+ value: H,
200
200
  options: a,
201
201
  onChange: (e) => {
202
202
  e ? b.chain().focus().setFontFamily(e).run() : b.chain().focus().unsetFontFamily().run();
203
203
  },
204
- title: D.fontFamily,
204
+ title: O.fontFamily,
205
205
  width: 120
206
206
  }),
207
- /* @__PURE__ */ g(s, {
208
- value: B,
207
+ P("fontSize", M.fontStyle) && /* @__PURE__ */ g(s, {
208
+ value: U,
209
209
  options: o,
210
210
  onChange: (e) => {
211
211
  e ? b.chain().focus().setFontSize(e).run() : b.chain().focus().unsetFontSize().run();
212
212
  },
213
- title: D.fontSize,
213
+ title: O.fontSize,
214
214
  width: 80
215
215
  }),
216
216
  /* @__PURE__ */ g(r, {})
217
217
  ] }),
218
- j.textFormat && /* @__PURE__ */ _(h, { children: [
219
- /* @__PURE__ */ g(n, {
218
+ [
219
+ "bold",
220
+ "italic",
221
+ "underline",
222
+ "strikethrough",
223
+ "subscript",
224
+ "superscript",
225
+ "formatPainter"
226
+ ].some((e) => P(e, e === "formatPainter" ? M.formatPainter : M.textFormat)) && /* @__PURE__ */ _(h, { children: [
227
+ P("bold", M.textFormat) && /* @__PURE__ */ g(n, {
220
228
  onClick: () => b.chain().focus().toggleBold().run(),
221
229
  isActive: b.isActive("bold"),
222
- title: D.bold,
230
+ title: O.bold,
223
231
  children: /* @__PURE__ */ _("svg", {
224
232
  width: "16",
225
233
  height: "16",
@@ -232,10 +240,10 @@ var y = /* @__PURE__ */ new Set([
232
240
  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" })]
233
241
  })
234
242
  }),
235
- /* @__PURE__ */ g(n, {
243
+ P("italic", M.textFormat) && /* @__PURE__ */ g(n, {
236
244
  onClick: () => b.chain().focus().toggleItalic().run(),
237
245
  isActive: b.isActive("italic"),
238
- title: D.italic,
246
+ title: O.italic,
239
247
  children: /* @__PURE__ */ _("svg", {
240
248
  width: "16",
241
249
  height: "16",
@@ -267,10 +275,10 @@ var y = /* @__PURE__ */ new Set([
267
275
  ]
268
276
  })
269
277
  }),
270
- /* @__PURE__ */ g(n, {
278
+ P("underline", M.textFormat) && /* @__PURE__ */ g(n, {
271
279
  onClick: () => b.chain().focus().toggleUnderline().run(),
272
280
  isActive: b.isActive("underline"),
273
- title: D.underline,
281
+ title: O.underline,
274
282
  children: /* @__PURE__ */ _("svg", {
275
283
  width: "16",
276
284
  height: "16",
@@ -288,10 +296,10 @@ var y = /* @__PURE__ */ new Set([
288
296
  })]
289
297
  })
290
298
  }),
291
- /* @__PURE__ */ g(n, {
299
+ P("strikethrough", M.textFormat) && /* @__PURE__ */ g(n, {
292
300
  onClick: () => b.chain().focus().toggleStrike().run(),
293
301
  isActive: b.isActive("strike"),
294
- title: D.strikethrough,
302
+ title: O.strikethrough,
295
303
  children: /* @__PURE__ */ _("svg", {
296
304
  width: "16",
297
305
  height: "16",
@@ -313,10 +321,10 @@ var y = /* @__PURE__ */ new Set([
313
321
  ]
314
322
  })
315
323
  }),
316
- /* @__PURE__ */ g(n, {
324
+ P("subscript", M.textFormat) && /* @__PURE__ */ g(n, {
317
325
  onClick: () => b.chain().focus().toggleSubscript().run(),
318
326
  isActive: b.isActive("subscript"),
319
- title: D.subscript,
327
+ title: O.subscript,
320
328
  children: /* @__PURE__ */ _("span", {
321
329
  style: {
322
330
  fontSize: "13px",
@@ -328,10 +336,10 @@ var y = /* @__PURE__ */ new Set([
328
336
  })]
329
337
  })
330
338
  }),
331
- /* @__PURE__ */ g(n, {
339
+ P("superscript", M.textFormat) && /* @__PURE__ */ g(n, {
332
340
  onClick: () => b.chain().focus().toggleSuperscript().run(),
333
341
  isActive: b.isActive("superscript"),
334
- title: D.superscript,
342
+ title: O.superscript,
335
343
  children: /* @__PURE__ */ _("span", {
336
344
  style: {
337
345
  fontSize: "13px",
@@ -343,11 +351,11 @@ var y = /* @__PURE__ */ new Set([
343
351
  })]
344
352
  })
345
353
  }),
346
- j.formatPainter && /* @__PURE__ */ g(n, {
347
- onClick: R,
348
- disabled: !b.isEditable || !O && b.state.selection.empty,
349
- isActive: !!O,
350
- title: O ? D.formatPainterActive : D.formatPainter,
354
+ P("formatPainter", M.formatPainter) && /* @__PURE__ */ g(n, {
355
+ onClick: V,
356
+ disabled: !b.isEditable || !k && b.state.selection.empty,
357
+ isActive: !!k,
358
+ title: k ? O.formatPainterActive : O.formatPainter,
351
359
  children: /* @__PURE__ */ _("svg", {
352
360
  width: "16",
353
361
  height: "16",
@@ -367,17 +375,24 @@ var y = /* @__PURE__ */ new Set([
367
375
  }),
368
376
  /* @__PURE__ */ g(r, {})
369
377
  ] }),
370
- j.heading && /* @__PURE__ */ _(h, { children: [[
378
+ [
379
+ 1,
380
+ 2,
381
+ 3,
382
+ 4,
383
+ 5,
384
+ 6
385
+ ].some((e) => P(`heading${e}`, M.heading)) && /* @__PURE__ */ _(h, { children: [[
371
386
  1,
372
387
  2,
373
388
  3,
374
389
  4,
375
390
  5,
376
391
  6
377
- ].map((e) => /* @__PURE__ */ g(n, {
392
+ ].filter((e) => P(`heading${e}`, M.heading)).map((e) => /* @__PURE__ */ g(n, {
378
393
  onClick: () => b.chain().focus().toggleHeading({ level: e }).run(),
379
394
  isActive: b.isActive("heading", { level: e }),
380
- title: `${D.heading} ${e}`,
395
+ title: `${O.heading} ${e}`,
381
396
  children: /* @__PURE__ */ _("span", {
382
397
  style: {
383
398
  fontSize: "12px",
@@ -386,11 +401,16 @@ var y = /* @__PURE__ */ new Set([
386
401
  children: ["H", e]
387
402
  })
388
403
  }, e)), /* @__PURE__ */ g(r, {})] }),
389
- j.alignment && /* @__PURE__ */ _(h, { children: [
390
- /* @__PURE__ */ g(n, {
404
+ [
405
+ "alignLeft",
406
+ "alignCenter",
407
+ "alignRight",
408
+ "alignJustify"
409
+ ].some((e) => P(e, M.alignment)) && /* @__PURE__ */ _(h, { children: [
410
+ P("alignLeft", M.alignment) && /* @__PURE__ */ g(n, {
391
411
  onClick: () => b.chain().focus().setTextAlign("left").run(),
392
412
  isActive: b.isActive({ textAlign: "left" }),
393
- title: D.alignLeft,
413
+ title: O.alignLeft,
394
414
  children: /* @__PURE__ */ _("svg", {
395
415
  width: "16",
396
416
  height: "16",
@@ -428,10 +448,10 @@ var y = /* @__PURE__ */ new Set([
428
448
  ]
429
449
  })
430
450
  }),
431
- /* @__PURE__ */ g(n, {
451
+ P("alignCenter", M.alignment) && /* @__PURE__ */ g(n, {
432
452
  onClick: () => b.chain().focus().setTextAlign("center").run(),
433
453
  isActive: b.isActive({ textAlign: "center" }),
434
- title: D.alignCenter,
454
+ title: O.alignCenter,
435
455
  children: /* @__PURE__ */ _("svg", {
436
456
  width: "16",
437
457
  height: "16",
@@ -469,10 +489,10 @@ var y = /* @__PURE__ */ new Set([
469
489
  ]
470
490
  })
471
491
  }),
472
- /* @__PURE__ */ g(n, {
492
+ P("alignRight", M.alignment) && /* @__PURE__ */ g(n, {
473
493
  onClick: () => b.chain().focus().setTextAlign("right").run(),
474
494
  isActive: b.isActive({ textAlign: "right" }),
475
- title: D.alignRight,
495
+ title: O.alignRight,
476
496
  children: /* @__PURE__ */ _("svg", {
477
497
  width: "16",
478
498
  height: "16",
@@ -510,10 +530,10 @@ var y = /* @__PURE__ */ new Set([
510
530
  ]
511
531
  })
512
532
  }),
513
- /* @__PURE__ */ g(n, {
533
+ P("alignJustify", M.alignment) && /* @__PURE__ */ g(n, {
514
534
  onClick: () => b.chain().focus().setTextAlign("justify").run(),
515
535
  isActive: b.isActive({ textAlign: "justify" }),
516
- title: D.alignJustify,
536
+ title: O.alignJustify,
517
537
  children: /* @__PURE__ */ _("svg", {
518
538
  width: "16",
519
539
  height: "16",
@@ -553,11 +573,15 @@ var y = /* @__PURE__ */ new Set([
553
573
  }),
554
574
  /* @__PURE__ */ g(r, {})
555
575
  ] }),
556
- j.list && /* @__PURE__ */ _(h, { children: [
557
- /* @__PURE__ */ g(n, {
576
+ [
577
+ "bulletList",
578
+ "orderedList",
579
+ "taskList"
580
+ ].some((e) => P(e, M.list)) && /* @__PURE__ */ _(h, { children: [
581
+ P("bulletList", M.list) && /* @__PURE__ */ g(n, {
558
582
  onClick: () => b.chain().focus().toggleBulletList().run(),
559
583
  isActive: b.isActive("bulletList"),
560
- title: D.bulletList,
584
+ title: O.bulletList,
561
585
  children: /* @__PURE__ */ _("svg", {
562
586
  width: "16",
563
587
  height: "16",
@@ -607,10 +631,10 @@ var y = /* @__PURE__ */ new Set([
607
631
  ]
608
632
  })
609
633
  }),
610
- /* @__PURE__ */ g(n, {
634
+ P("orderedList", M.list) && /* @__PURE__ */ g(n, {
611
635
  onClick: () => b.chain().focus().toggleOrderedList().run(),
612
636
  isActive: b.isActive("orderedList"),
613
- title: D.orderedList,
637
+ title: O.orderedList,
614
638
  children: /* @__PURE__ */ _("svg", {
615
639
  width: "16",
616
640
  height: "16",
@@ -669,10 +693,10 @@ var y = /* @__PURE__ */ new Set([
669
693
  ]
670
694
  })
671
695
  }),
672
- /* @__PURE__ */ g(n, {
696
+ P("taskList", M.list) && /* @__PURE__ */ g(n, {
673
697
  onClick: () => b.chain().focus().toggleTaskList().run(),
674
698
  isActive: b.isActive("taskList"),
675
- title: D.taskList,
699
+ title: O.taskList,
676
700
  children: /* @__PURE__ */ _("svg", {
677
701
  width: "16",
678
702
  height: "16",
@@ -715,11 +739,23 @@ var y = /* @__PURE__ */ new Set([
715
739
  }),
716
740
  /* @__PURE__ */ g(r, {})
717
741
  ] }),
718
- j.insert && /* @__PURE__ */ _(h, { children: [
719
- /* @__PURE__ */ g(n, {
742
+ [
743
+ "blockquote",
744
+ "codeBlock",
745
+ "mermaidBlock",
746
+ "link",
747
+ "image",
748
+ "table",
749
+ "tableOps",
750
+ "horizontalRule",
751
+ "markdownBlock",
752
+ "markdownTemplates",
753
+ "floatingDialog"
754
+ ].some((e) => P(e, e === "tableOps" ? M.tableOps : M.insert)) && /* @__PURE__ */ _(h, { children: [
755
+ P("blockquote", M.insert) && /* @__PURE__ */ g(n, {
720
756
  onClick: () => b.chain().focus().toggleBlockquote().run(),
721
757
  isActive: b.isActive("blockquote"),
722
- title: D.blockquote,
758
+ title: O.blockquote,
723
759
  children: /* @__PURE__ */ _("svg", {
724
760
  width: "16",
725
761
  height: "16",
@@ -732,10 +768,10 @@ var y = /* @__PURE__ */ new Set([
732
768
  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" })]
733
769
  })
734
770
  }),
735
- /* @__PURE__ */ g(n, {
771
+ P("codeBlock", M.insert) && /* @__PURE__ */ g(n, {
736
772
  onClick: () => b.chain().focus().toggleNode("codeBlock", "paragraph").run(),
737
773
  isActive: b.isActive("codeBlock"),
738
- title: D.codeBlock,
774
+ title: O.codeBlock,
739
775
  children: /* @__PURE__ */ _("svg", {
740
776
  width: "16",
741
777
  height: "16",
@@ -748,7 +784,7 @@ var y = /* @__PURE__ */ new Set([
748
784
  children: [/* @__PURE__ */ g("polyline", { points: "16 18 22 12 16 6" }), /* @__PURE__ */ g("polyline", { points: "8 6 2 12 8 18" })]
749
785
  })
750
786
  }),
751
- /* @__PURE__ */ g(n, {
787
+ P("mermaidBlock", M.insert) && /* @__PURE__ */ g(n, {
752
788
  onClick: () => {
753
789
  b.chain().focus().insertContent({
754
790
  type: "codeBlock",
@@ -759,7 +795,7 @@ var y = /* @__PURE__ */ new Set([
759
795
  }]
760
796
  }).run();
761
797
  },
762
- title: D.mermaidBlock,
798
+ title: O.mermaidBlock,
763
799
  children: /* @__PURE__ */ _("svg", {
764
800
  width: "16",
765
801
  height: "16",
@@ -800,10 +836,10 @@ var y = /* @__PURE__ */ new Set([
800
836
  ]
801
837
  })
802
838
  }),
803
- /* @__PURE__ */ g(n, {
804
- onClick: M,
839
+ P("link", M.insert) && /* @__PURE__ */ g(n, {
840
+ onClick: F,
805
841
  isActive: b.isActive("link"),
806
- title: D.link,
842
+ title: O.link,
807
843
  children: /* @__PURE__ */ _("svg", {
808
844
  width: "16",
809
845
  height: "16",
@@ -816,9 +852,9 @@ var y = /* @__PURE__ */ new Set([
816
852
  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" })]
817
853
  })
818
854
  }),
819
- /* @__PURE__ */ g(n, {
820
- onClick: N,
821
- title: D.image,
855
+ P("image", M.insert) && /* @__PURE__ */ g(n, {
856
+ onClick: I,
857
+ title: O.image,
822
858
  children: /* @__PURE__ */ _("svg", {
823
859
  width: "16",
824
860
  height: "16",
@@ -846,9 +882,9 @@ var y = /* @__PURE__ */ new Set([
846
882
  ]
847
883
  })
848
884
  }),
849
- /* @__PURE__ */ g(n, {
850
- onClick: P,
851
- title: D.table,
885
+ P("table", M.insert) && /* @__PURE__ */ g(n, {
886
+ onClick: L,
887
+ title: O.table,
852
888
  children: /* @__PURE__ */ _("svg", {
853
889
  width: "16",
854
890
  height: "16",
@@ -893,13 +929,13 @@ var y = /* @__PURE__ */ new Set([
893
929
  ]
894
930
  })
895
931
  }),
896
- j.tableOps && /* @__PURE__ */ g(u, {
932
+ P("tableOps", M.tableOps) && /* @__PURE__ */ g(u, {
897
933
  editor: b,
898
- labels: D
934
+ labels: O
899
935
  }),
900
- /* @__PURE__ */ g(n, {
936
+ P("horizontalRule", M.insert) && /* @__PURE__ */ g(n, {
901
937
  onClick: () => b.chain().focus().setHorizontalRule().run(),
902
- title: D.horizontalRule,
938
+ title: O.horizontalRule,
903
939
  children: /* @__PURE__ */ g("svg", {
904
940
  width: "16",
905
941
  height: "16",
@@ -916,9 +952,9 @@ var y = /* @__PURE__ */ new Set([
916
952
  })
917
953
  })
918
954
  }),
919
- /* @__PURE__ */ g(n, {
920
- onClick: F,
921
- title: D.markdownBlock,
955
+ P("markdownBlock", M.insert) && /* @__PURE__ */ g(n, {
956
+ onClick: R,
957
+ title: O.markdownBlock,
922
958
  children: /* @__PURE__ */ _("svg", {
923
959
  width: "16",
924
960
  height: "16",
@@ -935,51 +971,68 @@ var y = /* @__PURE__ */ new Set([
935
971
  ]
936
972
  })
937
973
  }),
938
- /* @__PURE__ */ g(c, {
939
- labels: D,
940
- onSelect: I
974
+ P("markdownTemplates", M.insert) && /* @__PURE__ */ g(c, {
975
+ labels: O,
976
+ onSelect: z
941
977
  }),
942
- /* @__PURE__ */ g(l, {
943
- labels: D,
944
- onInsert: L
978
+ P("floatingDialog", M.insert) && /* @__PURE__ */ g(l, {
979
+ labels: O,
980
+ onInsert: B
945
981
  }),
946
982
  /* @__PURE__ */ g(r, {})
947
983
  ] }),
948
- j.color && /* @__PURE__ */ _(h, { children: [
949
- /* @__PURE__ */ g(i, {
984
+ ["textColor", "highlight"].some((e) => P(e, M.color)) && /* @__PURE__ */ _(h, { children: [
985
+ P("textColor", M.color) && /* @__PURE__ */ g(i, {
950
986
  value: b.getAttributes("textStyle").color || "",
951
987
  onChange: (e) => {
952
988
  e ? b.chain().focus().setColor(e).run() : b.chain().focus().unsetColor().run();
953
989
  },
954
- title: D.color,
990
+ title: O.color,
955
991
  kind: "text"
956
992
  }),
957
- /* @__PURE__ */ g(i, {
993
+ P("highlight", M.color) && /* @__PURE__ */ g(i, {
958
994
  value: b.getAttributes("highlight").color || "",
959
995
  onChange: (e) => {
960
996
  e ? b.chain().focus().toggleHighlight({ color: e }).run() : b.chain().focus().unsetHighlight().run();
961
997
  },
962
- title: D.highlight,
998
+ title: O.highlight,
963
999
  kind: "highlight"
964
1000
  }),
965
1001
  /* @__PURE__ */ g(r, {})
966
1002
  ] }),
967
- j.ai && C && w && /* @__PURE__ */ g(n, {
968
- onClick: w,
969
- title: D.ai,
970
- children: /* @__PURE__ */ _("svg", {
971
- width: "16",
972
- height: "16",
973
- viewBox: "0 0 24 24",
974
- fill: "none",
975
- stroke: "currentColor",
976
- strokeWidth: "2",
977
- strokeLinecap: "round",
978
- strokeLinejoin: "round",
979
- 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" })]
980
- })
1003
+ P("ai", M.ai) && w && /* @__PURE__ */ _(n, {
1004
+ onClick: C ? w : T || (() => {}),
1005
+ disabled: !C && !T,
1006
+ title: C ? O.ai : T ? O.aiConfigure : O.aiNotConfigured,
1007
+ className: `rte-toolbar__ai-btn ${C ? "" : "rte-toolbar__ai-btn--unconfigured"}`,
1008
+ children: [
1009
+ /* @__PURE__ */ _("svg", {
1010
+ className: "rte-toolbar__ai-icon",
1011
+ width: "16",
1012
+ height: "16",
1013
+ viewBox: "0 0 24 24",
1014
+ fill: "none",
1015
+ "aria-hidden": "true",
1016
+ children: [/* @__PURE__ */ g("path", {
1017
+ d: "M12 2.75l1.14 4.11a5.5 5.5 0 003.82 3.82L21.25 12l-4.29 1.32a5.5 5.5 0 00-3.82 3.82L12 21.25l-1.14-4.11a5.5 5.5 0 00-3.82-3.82L2.75 12l4.29-1.32a5.5 5.5 0 003.82-3.82L12 2.75z",
1018
+ fill: "currentColor"
1019
+ }), /* @__PURE__ */ g("path", {
1020
+ d: "M19 2.75l.42 1.52a2 2 0 001.31 1.31l1.52.42-1.52.42a2 2 0 00-1.31 1.31L19 9.25l-.42-1.52a2 2 0 00-1.31-1.31L15.75 6l1.52-.42a2 2 0 001.31-1.31L19 2.75z",
1021
+ fill: "currentColor",
1022
+ opacity: ".68"
1023
+ })]
1024
+ }),
1025
+ /* @__PURE__ */ g("span", {
1026
+ className: "rte-toolbar__ai-label",
1027
+ children: "AI"
1028
+ }),
1029
+ !C && T && /* @__PURE__ */ g("span", {
1030
+ className: "rte-toolbar__ai-configure",
1031
+ children: O.aiConfigure
1032
+ })
1033
+ ]
981
1034
  }),
982
- E
1035
+ D
983
1036
  ]
984
1037
  });
985
1038
  };