@pie-lib/editable-html-tip-tap 2.1.2-next.31 → 2.1.2-next.32

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.
@@ -1,6 +1,6 @@
1
1
  import { PIE_TOOLBAR__CLASS as e } from "../constants.js";
2
2
  import { DoneButton as t } from "./common/done-button.js";
3
- import n from "../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
3
+ import { clsx as n } from "../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
4
4
  import { ToolbarIcon as r } from "./respArea/ToolbarIcon.js";
5
5
  import { spanishConfig as i, specialConfig as a } from "./characters/characterUtils.js";
6
6
  import o from "./icons/TextAlign.js";
@@ -13,44 +13,49 @@ import { styled as v, useTheme as y } from "@mui/material/styles";
13
13
  import { NodeSelection as b } from "prosemirror-state";
14
14
  import x from "@mui/icons-material/Delete";
15
15
  import { jsx as S, jsxs as C } from "react/jsx-runtime";
16
- import w from "@mui/icons-material/FormatBold";
17
- import T from "@mui/icons-material/FormatItalic";
18
- import E from "@mui/icons-material/FormatStrikethrough";
19
- import D from "@mui/icons-material/Code";
20
- import O from "@mui/icons-material/GridOn";
21
- import k from "@mui/icons-material/FormatListBulleted";
22
- import A from "@mui/icons-material/FormatListNumbered";
23
- import j from "@mui/icons-material/FormatUnderlined";
24
- import M from "@mui/icons-material/Functions";
25
- import N from "@mui/icons-material/Image";
26
- import P from "@mui/icons-material/Redo";
27
- import F from "@mui/icons-material/Undo";
28
- import ee from "@mui/icons-material/FormatQuote";
29
- import I from "@mui/icons-material/Theaters";
30
- import L from "@mui/icons-material/VolumeUp";
31
- import R from "@mui/icons-material/BorderAll";
16
+ import { color as w } from "@pie-lib/render-ui";
17
+ import T from "@mui/icons-material/FormatBold";
18
+ import E from "@mui/icons-material/FormatItalic";
19
+ import D from "@mui/icons-material/FormatStrikethrough";
20
+ import O from "@mui/icons-material/Code";
21
+ import k from "@mui/icons-material/GridOn";
22
+ import A from "@mui/icons-material/FormatListBulleted";
23
+ import j from "@mui/icons-material/FormatListNumbered";
24
+ import M from "@mui/icons-material/FormatUnderlined";
25
+ import N from "@mui/icons-material/Functions";
26
+ import P from "@mui/icons-material/Image";
27
+ import F from "@mui/icons-material/Redo";
28
+ import ee from "@mui/icons-material/Undo";
29
+ import I from "@mui/icons-material/FormatQuote";
30
+ import L from "@mui/icons-material/Theaters";
31
+ import R from "@mui/icons-material/VolumeUp";
32
+ import z from "@mui/icons-material/BorderAll";
32
33
  //#region src/components/MenuBar.tsx
33
- var z = () => /* @__PURE__ */ S("svg", {
34
+ var B = () => /* @__PURE__ */ S("svg", {
34
35
  xmlns: "http://www.w3.org/2000/svg",
35
36
  height: "24px",
36
37
  viewBox: "0 0 24 24",
37
38
  width: "24px",
38
39
  fill: "none",
40
+ "aria-hidden": "true",
41
+ focusable: "false",
39
42
  children: /* @__PURE__ */ S("path", {
40
43
  d: "M22,7h-2v1h3v1h-4V7c0-0.55,0.45-1,1-1h2V5h-3V4h3c0.55,0,1,0.45,1,1v1C23,6.55,22.55,7,22,7z M5.88,20h2.66l3.4-5.42h0.12 l3.4,5.42h2.66l-4.65-7.27L17.81,6h-2.68l-3.07,4.99h-0.12L8.85,6H6.19l4.32,6.73L5.88,20z",
41
44
  fill: "currentColor"
42
45
  })
43
- }), B = () => /* @__PURE__ */ S("svg", {
46
+ }), V = () => /* @__PURE__ */ S("svg", {
44
47
  xmlns: "http://www.w3.org/2000/svg",
45
48
  height: "24px",
46
49
  viewBox: "0 0 24 24",
47
50
  width: "24px",
48
51
  fill: "none",
52
+ "aria-hidden": "true",
53
+ focusable: "false",
49
54
  children: /* @__PURE__ */ S("path", {
50
55
  d: "M22,18h-2v1h3v1h-4v-2c0-0.55,0.45-1,1-1h2v-1h-3v-1h3c0.55,0,1,0.45,1,1v1C23,17.55,22.55,18,22,18z M5.88,18h2.66 l3.4-5.42h0.12l3.4,5.42h2.66l-4.65-7.27L17.81,4h-2.68l-3.07,4.99h-0.12L8.85,4H6.19l4.32,6.73L5.88,18z",
51
56
  fill: "currentColor"
52
57
  })
53
- }), V = () => /* @__PURE__ */ S("svg", {
58
+ }), H = () => /* @__PURE__ */ S("svg", {
54
59
  width: "30",
55
60
  height: "28",
56
61
  viewBox: "0 0 30 28",
@@ -60,12 +65,14 @@ var z = () => /* @__PURE__ */ S("svg", {
60
65
  width: "20px",
61
66
  height: "18px"
62
67
  },
68
+ "aria-hidden": "true",
69
+ focusable: "false",
63
70
  children: /* @__PURE__ */ S("path", {
64
71
  d: "M27 4V24H29C29.5 24 30 24.5 30 25V27C30 27.5625 29.5 28 29 28H19C18.4375 28 18 27.5625 18 27V25C18 24.5 18.4375 24 19 24H21V16H9V24H11C11.5 24 12 24.5 12 25V27C12 27.5625 11.5 28 11 28H1C0.4375 28 0 27.5625 0 27V25C0 24.5 0.4375 24 1 24H3V4H1C0.4375 4 0 3.5625 0 3V1C0 0.5 0.4375 0 1 0H11C11.5 0 12 0.5 12 1V3C12 3.5625 11.5 4 11 4H9V12H21V4H19C18.4375 4 18 3.5625 18 3V1C18 0.5 18.4375 0 19 0H29C29.5 0 30 0.5 30 1V3C30 3.5625 29.5 4 29 4H27Z",
65
72
  fill: "currentColor"
66
73
  })
67
74
  });
68
- function H({ editor: v, classes: y, activePlugins: H, toolbarOpts: U, responseAreaProps: W, onChange: G, autoWidthToolbar: K }) {
75
+ function U({ editor: v, classes: y, activePlugins: w, toolbarOpts: U, responseAreaProps: W, onChange: G, autoWidthToolbar: K }) {
69
76
  let [q, J] = g(!1), Y = U ?? {}, X = _({
70
77
  editor: v,
71
78
  selector: (e) => {
@@ -78,6 +85,7 @@ function H({ editor: v, classes: y, activePlugins: H, toolbarOpts: U, responseAr
78
85
  hideDefaultToolbar: r,
79
86
  hasTextSelectionInTable: i,
80
87
  isFocused: e.editor?.isFocused,
88
+ toolbarOpened: e.editor?._toolbarOpened ?? !1,
81
89
  isBold: e.editor.isActive("bold") ?? !1,
82
90
  canBold: e.editor.can().chain().toggleBold().run() ?? !1,
83
91
  isTable: e.editor.isActive("table") ?? !1,
@@ -113,7 +121,7 @@ function H({ editor: v, classes: y, activePlugins: H, toolbarOpts: U, responseAr
113
121
  [y.toolbarWithNoDone]: !0,
114
122
  [y.toolbarTop]: Y.position === "top",
115
123
  [y.toolbarRight]: Y.alignment === "right",
116
- [y.focused]: Y.alwaysVisible || X.isFocused && !v._toolbarOpened && !X.hideDefaultToolbar,
124
+ [y.focused]: Y.alwaysVisible || X.isFocused && !X.toolbarOpened && !X.hideDefaultToolbar,
117
125
  [y.autoWidth]: Z,
118
126
  [y.fullWidth]: !Z,
119
127
  [y.hidden]: Y.isHidden === !0
@@ -121,18 +129,20 @@ function H({ editor: v, classes: y, activePlugins: H, toolbarOpts: U, responseAr
121
129
  e.preventDefault();
122
130
  }, ne = h(() => [
123
131
  {
124
- icon: /* @__PURE__ */ S(O, {}),
132
+ icon: /* @__PURE__ */ S(k, {}),
133
+ label: "Insert table",
125
134
  onClick: (e) => e.chain().focus().insertTable({
126
135
  rows: 2,
127
136
  cols: 2,
128
137
  withHeaderRow: !1
129
138
  }).run(),
130
- hidden: (e) => !H?.includes("table") || e.isTable,
139
+ hidden: (e) => !w?.includes("table") || e.isTable,
131
140
  isActive: (e) => e.isTable,
132
141
  isDisabled: (e) => !e.canTable
133
142
  },
134
143
  {
135
144
  icon: /* @__PURE__ */ S(l, {}),
145
+ label: "Add table row",
136
146
  onClick: (e) => e.chain().focus().addRowAfter().run(),
137
147
  hidden: (e) => !(e.isTable && !e.hasTextSelectionInTable),
138
148
  isActive: (e) => e.isTable,
@@ -140,6 +150,7 @@ function H({ editor: v, classes: y, activePlugins: H, toolbarOpts: U, responseAr
140
150
  },
141
151
  {
142
152
  icon: /* @__PURE__ */ S(d, {}),
153
+ label: "Remove table row",
143
154
  onClick: (e) => e.chain().focus().deleteRow().run(),
144
155
  hidden: (e) => !(e.isTable && !e.hasTextSelectionInTable),
145
156
  isActive: (e) => e.isTable,
@@ -147,6 +158,7 @@ function H({ editor: v, classes: y, activePlugins: H, toolbarOpts: U, responseAr
147
158
  },
148
159
  {
149
160
  icon: /* @__PURE__ */ S(c, {}),
161
+ label: "Add table column",
150
162
  onClick: (e) => e.chain().focus().addColumnAfter().run(),
151
163
  hidden: (e) => !(e.isTable && !e.hasTextSelectionInTable),
152
164
  isActive: (e) => e.isTable,
@@ -154,6 +166,7 @@ function H({ editor: v, classes: y, activePlugins: H, toolbarOpts: U, responseAr
154
166
  },
155
167
  {
156
168
  icon: /* @__PURE__ */ S(u, {}),
169
+ label: "Remove table column",
157
170
  onClick: (e) => e.chain().focus().deleteColumn().run(),
158
171
  hidden: (e) => !(e.isTable && !e.hasTextSelectionInTable),
159
172
  isActive: (e) => e.isTable,
@@ -161,13 +174,16 @@ function H({ editor: v, classes: y, activePlugins: H, toolbarOpts: U, responseAr
161
174
  },
162
175
  {
163
176
  icon: /* @__PURE__ */ S(f, {}),
177
+ label: "Remove table",
164
178
  onClick: (e) => e.chain().focus().deleteTable().run(),
165
179
  hidden: (e) => !(e.isTable && !e.hasTextSelectionInTable),
166
180
  isActive: (e) => e.isTable,
167
181
  isDisabled: (e) => !e.canTable
168
182
  },
169
183
  {
170
- icon: /* @__PURE__ */ S(R, {}),
184
+ icon: /* @__PURE__ */ S(z, {}),
185
+ label: "Table borders",
186
+ toggle: !0,
171
187
  onClick: (e) => {
172
188
  let t = e.getAttributes("table"), n = {
173
189
  ...t,
@@ -180,64 +196,81 @@ function H({ editor: v, classes: y, activePlugins: H, toolbarOpts: U, responseAr
180
196
  isDisabled: (e) => !e.canTable
181
197
  },
182
198
  {
183
- icon: /* @__PURE__ */ S(w, {}),
199
+ icon: /* @__PURE__ */ S(T, {}),
200
+ label: "Bold",
201
+ toggle: !0,
184
202
  onClick: (e) => e.chain().focus().toggleBold().run(),
185
- hidden: () => !H?.includes("bold"),
203
+ hidden: () => !w?.includes("bold"),
186
204
  isActive: (e) => e.isBold,
187
205
  isDisabled: (e) => !e.canBold
188
206
  },
189
207
  {
190
- icon: /* @__PURE__ */ S(T, {}),
208
+ icon: /* @__PURE__ */ S(E, {}),
209
+ label: "Italic",
210
+ toggle: !0,
191
211
  onClick: (e) => e.chain().focus().toggleItalic().run(),
192
- hidden: () => !H?.includes("italic"),
212
+ hidden: () => !w?.includes("italic"),
193
213
  isActive: (e) => e.isItalic,
194
214
  isDisabled: (e) => !e.canItalic
195
215
  },
196
216
  {
197
- icon: /* @__PURE__ */ S(E, {}),
217
+ icon: /* @__PURE__ */ S(D, {}),
218
+ label: "Strikethrough",
219
+ toggle: !0,
198
220
  onClick: (e) => e.chain().focus().toggleStrike().run(),
199
- hidden: () => !H?.includes("strikethrough"),
221
+ hidden: () => !w?.includes("strikethrough"),
200
222
  isActive: (e) => e.isStrike,
201
223
  isDisabled: (e) => !e.canStrike
202
224
  },
203
225
  {
204
- icon: /* @__PURE__ */ S(D, {}),
226
+ icon: /* @__PURE__ */ S(O, {}),
227
+ label: "Code",
228
+ toggle: !0,
205
229
  onClick: (e) => e.chain().focus().toggleCode().run(),
206
- hidden: () => !H?.includes("code"),
230
+ hidden: () => !w?.includes("code"),
207
231
  isActive: (e) => e.isCode,
208
232
  isDisabled: (e) => !e.canCode
209
233
  },
210
234
  {
211
- icon: /* @__PURE__ */ S(j, {}),
235
+ icon: /* @__PURE__ */ S(M, {}),
236
+ label: "Underline",
237
+ toggle: !0,
212
238
  onClick: (e) => e.chain().focus().toggleUnderline().run(),
213
- hidden: () => !H?.includes("underline"),
239
+ hidden: () => !w?.includes("underline"),
214
240
  isActive: (e) => e.isUnderline
215
241
  },
216
242
  {
217
- icon: /* @__PURE__ */ S(B, {}),
243
+ icon: /* @__PURE__ */ S(V, {}),
244
+ label: "Subscript",
245
+ toggle: !0,
218
246
  onClick: (e) => e.chain().focus().toggleSubscript().run(),
219
- hidden: () => !H?.includes("subscript"),
247
+ hidden: () => !w?.includes("subscript"),
220
248
  isActive: (e) => e.isSubScript
221
249
  },
222
250
  {
223
- icon: /* @__PURE__ */ S(z, {}),
251
+ icon: /* @__PURE__ */ S(B, {}),
252
+ label: "Superscript",
253
+ toggle: !0,
224
254
  onClick: (e) => e.chain().focus().toggleSuperscript().run(),
225
- hidden: () => !H?.includes("superscript"),
255
+ hidden: () => !w?.includes("superscript"),
226
256
  isActive: (e) => e.isSuperScript
227
257
  },
228
258
  {
229
- icon: /* @__PURE__ */ S(N, {}),
230
- hidden: () => !H?.includes("image"),
259
+ icon: /* @__PURE__ */ S(P, {}),
260
+ label: "Insert image",
261
+ hidden: () => !w?.includes("image"),
231
262
  onClick: (e) => e.chain().focus().setImageUploadNode().run()
232
263
  },
233
264
  {
234
- icon: /* @__PURE__ */ S(I, {}),
235
- hidden: () => !H?.includes("video"),
265
+ icon: /* @__PURE__ */ S(L, {}),
266
+ label: "Insert video",
267
+ hidden: () => !w?.includes("video"),
236
268
  onClick: (e) => e.chain().focus().insertMedia({ type: "video" }).run()
237
269
  },
238
270
  {
239
- icon: /* @__PURE__ */ S(L, {}),
240
- hidden: () => !H?.includes("audio"),
271
+ icon: /* @__PURE__ */ S(R, {}),
272
+ label: "Insert audio",
273
+ hidden: () => !w?.includes("audio"),
241
274
  onClick: (e) => e.chain().focus().insertMedia({
242
275
  type: "audio",
243
276
  tag: "audio"
@@ -245,66 +278,81 @@ function H({ editor: v, classes: y, activePlugins: H, toolbarOpts: U, responseAr
245
278
  },
246
279
  {
247
280
  icon: /* @__PURE__ */ S(s, {}),
248
- hidden: () => !H?.includes("css"),
281
+ label: "CSS classes",
282
+ hidden: () => !w?.includes("css"),
249
283
  onClick: (e) => e.commands.openCSSClassDialog()
250
284
  },
251
285
  {
252
- icon: /* @__PURE__ */ S(ee, {}),
253
- hidden: () => !H?.includes("blockquote"),
286
+ icon: /* @__PURE__ */ S(I, {}),
287
+ label: "Blockquote",
288
+ toggle: !0,
289
+ hidden: () => !w?.includes("blockquote"),
254
290
  onClick: (e) => e.chain().focus().toggleBlockquote().run(),
255
291
  isActive: (e) => e.isBlockquote
256
292
  },
257
293
  {
258
- icon: /* @__PURE__ */ S(V, {}),
259
- hidden: () => !H?.includes("h3"),
294
+ icon: /* @__PURE__ */ S(H, {}),
295
+ label: "Heading",
296
+ toggle: !0,
297
+ hidden: () => !w?.includes("h3"),
260
298
  onClick: (e) => e.chain().focus().toggleHeadingParagraph().run(),
261
299
  isActive: (e) => e.isHeadingParagraph
262
300
  },
263
301
  {
264
- icon: /* @__PURE__ */ S(M, {}),
265
- hidden: () => !H?.includes("math"),
302
+ icon: /* @__PURE__ */ S(N, {}),
303
+ label: "Insert math",
304
+ hidden: () => !w?.includes("math"),
266
305
  onClick: (e) => e.chain().focus().insertMath("").run()
267
306
  },
268
307
  {
269
308
  icon: /* @__PURE__ */ S(p, { letter: "ñ" }),
270
- hidden: () => !H?.includes("languageCharacters"),
309
+ label: "Spanish characters (ñ)",
310
+ hidden: () => !w?.includes("languageCharacters"),
271
311
  onClick: () => J(i)
272
312
  },
273
313
  {
274
314
  icon: /* @__PURE__ */ S(p, { letter: "€" }),
275
- hidden: () => H?.filter((e) => e === "languageCharacters").length !== 2,
315
+ label: "Special characters (€)",
316
+ hidden: () => w?.filter((e) => e === "languageCharacters").length !== 2,
276
317
  onClick: () => J(a)
277
318
  },
278
319
  {
279
320
  icon: /* @__PURE__ */ S(o, { editor: v }),
280
- hidden: () => !H?.includes("text-align"),
321
+ label: "Text alignment",
322
+ hidden: () => !w?.includes("text-align"),
281
323
  onClick: () => {}
282
324
  },
283
325
  {
284
- icon: /* @__PURE__ */ S(k, {}),
285
- hidden: () => !H?.includes("bulleted-list"),
326
+ icon: /* @__PURE__ */ S(A, {}),
327
+ label: "Bulleted list",
328
+ toggle: !0,
329
+ hidden: () => !w?.includes("bulleted-list"),
286
330
  onClick: (e) => e.chain().focus().toggleBulletList().run(),
287
331
  isActive: (e) => e.isBulletList
288
332
  },
289
333
  {
290
- icon: /* @__PURE__ */ S(A, {}),
291
- hidden: () => !H?.includes("numbered-list"),
334
+ icon: /* @__PURE__ */ S(j, {}),
335
+ label: "Numbered list",
336
+ toggle: !0,
337
+ hidden: () => !w?.includes("numbered-list"),
292
338
  onClick: (e) => e.chain().focus().toggleOrderedList().run(),
293
339
  isActive: (e) => e.isOrderedList
294
340
  },
295
341
  {
296
- icon: /* @__PURE__ */ S(F, {}),
297
- hidden: () => !H?.includes("undo"),
342
+ icon: /* @__PURE__ */ S(ee, {}),
343
+ label: "Undo",
344
+ hidden: () => !w?.includes("undo"),
298
345
  onClick: (e) => e.chain().focus().undo().run(),
299
346
  isDisabled: (e) => !e.canUndo
300
347
  },
301
348
  {
302
- icon: /* @__PURE__ */ S(P, {}),
303
- hidden: () => !H?.includes("redo"),
349
+ icon: /* @__PURE__ */ S(F, {}),
350
+ label: "Redo",
351
+ hidden: () => !w?.includes("redo"),
304
352
  onClick: (e) => e.chain().focus().redo().run(),
305
353
  isDisabled: (e) => !e.canRedo
306
354
  }
307
- ], [H, v]), re = X.hideDefaultToolbar && X.currentNode?.type?.name === "drag_in_the_blank";
355
+ ], [w, v]), re = X.hideDefaultToolbar && X.currentNode?.type?.name === "drag_in_the_blank";
308
356
  return /* @__PURE__ */ C("div", {
309
357
  className: Q,
310
358
  style: { ...$ },
@@ -322,6 +370,7 @@ function H({ editor: v, classes: y, activePlugins: H, toolbarOpts: U, responseAr
322
370
  e.preventDefault(), v.chain().focus().deleteSelection().run(), G?.(v.getHTML());
323
371
  },
324
372
  "aria-label": "Delete response area",
373
+ title: "Delete response area",
325
374
  children: /* @__PURE__ */ S(x, {})
326
375
  })
327
376
  })
@@ -335,7 +384,11 @@ function H({ editor: v, classes: y, activePlugins: H, toolbarOpts: U, responseAr
335
384
  children: ne.filter((e) => !e.hidden?.(X)).map((e, t) => {
336
385
  let r = e.isDisabled?.(X), i = e.isActive?.(X);
337
386
  return /* @__PURE__ */ S("button", {
387
+ type: "button",
338
388
  disabled: r,
389
+ "aria-label": e.label,
390
+ title: e.label,
391
+ "aria-pressed": e.toggle ? !!i : void 0,
339
392
  onClick: (t) => {
340
393
  t.preventDefault(), e.onClick(v);
341
394
  },
@@ -344,7 +397,10 @@ function H({ editor: v, classes: y, activePlugins: H, toolbarOpts: U, responseAr
344
397
  }, t);
345
398
  })
346
399
  }),
347
- H?.includes("responseArea") && /* @__PURE__ */ S("button", {
400
+ w?.includes("responseArea") && /* @__PURE__ */ S("button", {
401
+ type: "button",
402
+ "aria-label": "Insert response area",
403
+ title: "Insert response area",
348
404
  onClick: () => {
349
405
  v.chain().focus().insertResponseArea(W.type).run();
350
406
  },
@@ -368,12 +424,12 @@ function H({ editor: v, classes: y, activePlugins: H, toolbarOpts: U, responseAr
368
424
  ]
369
425
  });
370
426
  }
371
- var U = (e) => {
427
+ var W = (e) => {
372
428
  y();
373
429
  let t = {
374
430
  defaultToolbar: "defaultToolbar",
375
431
  buttonsContainer: "buttonsContainer",
376
- button: "button",
432
+ button: "toolbarButton",
377
433
  active: "active",
378
434
  disabled: "disabled",
379
435
  isActive: "isActive",
@@ -389,11 +445,11 @@ var U = (e) => {
389
445
  label: "label",
390
446
  shared: "shared"
391
447
  };
392
- return /* @__PURE__ */ S(W, { children: /* @__PURE__ */ S(H, {
448
+ return /* @__PURE__ */ S(G, { children: /* @__PURE__ */ S(U, {
393
449
  ...e,
394
450
  classes: t
395
451
  }) });
396
- }, W = v("div")(({ theme: e }) => ({
452
+ }, G = v("div")(() => ({
397
453
  "& .defaultToolbar": {
398
454
  display: "flex",
399
455
  width: "100%",
@@ -404,21 +460,25 @@ var U = (e) => {
404
460
  display: "flex",
405
461
  width: "100%"
406
462
  },
407
- "& .button": {
463
+ "& .toolbarButton": {
408
464
  color: "grey",
409
465
  display: "inline-flex",
410
466
  padding: "2px",
411
467
  background: "none",
412
468
  border: "none",
413
469
  cursor: "pointer",
414
- "&:hover": { color: "black" },
415
- "&:focus": { outline: `2px solid ${e.palette.grey[700]}` }
470
+ "& svg": {
471
+ width: "24px",
472
+ height: "24px"
473
+ },
474
+ "&:hover": { color: w.text() },
475
+ "&:focus": { outline: `2px solid ${w.buttonFocusOutline()}` }
416
476
  },
417
- "& .active": { color: "black" },
477
+ "& .active": { color: w.text() },
418
478
  "& .disabled": {
419
479
  opacity: .7,
420
480
  cursor: "not-allowed",
421
- "& :hover": { color: "grey" }
481
+ "& :hover": { color: w.disabled() }
422
482
  },
423
483
  "& .isActive": {
424
484
  background: "var(--purple)",
@@ -459,4 +519,4 @@ var U = (e) => {
459
519
  "& .shared": { display: "flex" }
460
520
  }));
461
521
  //#endregion
462
- export { U as default };
522
+ export { W as default };
@@ -74,12 +74,12 @@ var u = o("div", { shouldForwardProp: (e) => !["noBorder", "error"].includes(e)
74
74
  color: l.text(),
75
75
  backgroundColor: l.background()
76
76
  },
77
- "& table:not([border=\"1\"]) tr": { borderTop: "1px solid #dfe2e5" },
77
+ "& table:not([border=\"1\"]) tr": { borderTop: `1px solid ${l.tableGridLight()}` },
78
78
  "& td, th": {
79
79
  padding: ".6em 1em",
80
80
  textAlign: "center"
81
81
  },
82
- "& table:not([border=\"1\"]) td, th": { border: "1px solid #dfe2e5" },
82
+ "& table:not([border=\"1\"]) td, th": { border: `1px solid ${l.tableGridLight()}` },
83
83
  ...n && { border: `2px solid ${e.palette.error.main} !important` }
84
84
  })), d = o("div", { shouldForwardProp: (e) => !["disableScrollbar", "highlightShape"].includes(e) })(({ theme: e, disableScrollbar: t, highlightShape: n }) => ({
85
85
  position: "relative",
@@ -104,7 +104,20 @@ function p(o) {
104
104
  }, [h, S]), n(() => {
105
105
  if (o.adjustWidthForLimit) {
106
106
  let e = document.createElement("p");
107
- e.style.visibility = "hidden", e.style.position = "absolute", e.textContent = "W".repeat(o.charactersLimit), m.current.appendChild(e), p(`${e.offsetWidth + 27}px`), e.remove();
107
+ e.style.visibility = "hidden", e.style.position = "absolute", e.style.whiteSpace = "nowrap", e.textContent = "W".repeat(o.charactersLimit);
108
+ let t = window.getComputedStyle(m.current);
109
+ [
110
+ "fontFamily",
111
+ "fontSize",
112
+ "fontWeight",
113
+ "fontStyle",
114
+ "letterSpacing",
115
+ "wordSpacing",
116
+ "textTransform",
117
+ "lineHeight"
118
+ ].forEach((n) => {
119
+ e.style[n] = t[n];
120
+ }), document.body.appendChild(e), p(`${e.offsetWidth + 27}px`), e.remove();
108
121
  }
109
122
  }, [o.adjustWidthForLimit, o.charactersLimit]);
110
123
  let j = r(() => ({
@@ -23,4 +23,4 @@ o.propTypes = {
23
23
  };
24
24
  var s = o;
25
25
  //#endregion
26
- export { s as DoneButton };
26
+ export { s as DoneButton, o as RawDoneButton };
@@ -2,23 +2,28 @@ import e from "react";
2
2
  import { styled as t } from "@mui/material/styles";
3
3
  import n from "prop-types";
4
4
  import { jsx as r } from "react/jsx-runtime";
5
- import i from "debug";
5
+ import { color as i } from "@pie-lib/render-ui";
6
+ import a from "debug";
6
7
  //#region src/components/common/toolbar-buttons.tsx
7
- var a = t("button", { shouldForwardProp: (e) => ![
8
+ var o = t("button", { shouldForwardProp: (e) => ![
8
9
  "active",
9
10
  "disabled",
10
11
  "extraStyles"
11
- ].includes(e) })(({ theme: e, active: t, disabled: n }) => ({
12
- color: t ? "black" : "grey",
12
+ ].includes(e) })(({ active: e, disabled: t }) => ({
13
+ color: e ? i.text() : i.disabled(),
13
14
  display: "inline-flex",
14
15
  padding: "2px",
15
16
  background: "none",
16
17
  border: "none",
17
- cursor: n ? "not-allowed" : "pointer",
18
- "&:hover": { color: n ? "grey" : "black" },
19
- "&:focus": { outline: `2px solid ${e.palette.grey[700]}` },
20
- ...n && { opacity: .7 }
21
- })), o = i("pie-elements:editable-html:raw-button");
18
+ cursor: t ? "not-allowed" : "pointer",
19
+ "& svg": {
20
+ width: "24px",
21
+ height: "24px"
22
+ },
23
+ "&:hover": { color: t ? i.disabled() : i.text() },
24
+ "&:focus": { outline: `2px solid ${i.buttonFocusOutline()}` },
25
+ ...t && { opacity: .7 }
26
+ })), s = a("pie-elements:editable-html:raw-button");
22
27
  (class extends e.Component {
23
28
  static propTypes = {
24
29
  onClick: n.func.isRequired,
@@ -31,33 +36,33 @@ var a = t("button", { shouldForwardProp: (e) => ![
31
36
  super(e);
32
37
  }
33
38
  onClick = (e) => {
34
- o("[onClick]"), e.preventDefault();
39
+ s("[onClick]"), e.preventDefault();
35
40
  let { onClick: t } = this.props;
36
41
  t(e);
37
42
  };
38
43
  onKeyDown = (e) => {
39
44
  if (e.key === "Enter" || e.key === " ") {
40
- o("[onKeyDown]"), e.preventDefault();
45
+ s("[onKeyDown]"), e.preventDefault();
41
46
  let { onClick: t } = this.props;
42
47
  t(e);
43
48
  }
44
49
  };
45
50
  render() {
46
- let { active: e, children: t, disabled: n, extraStyles: i, ariaLabel: o } = this.props;
47
- return /* @__PURE__ */ r(a, {
51
+ let { active: e, children: t, disabled: n, extraStyles: i, ariaLabel: a } = this.props;
52
+ return /* @__PURE__ */ r(o, {
48
53
  style: i,
49
54
  active: e,
50
55
  disabled: n,
51
56
  onMouseDown: this.onClick,
52
57
  onKeyDown: this.onKeyDown,
53
- "aria-label": o,
58
+ "aria-label": a,
54
59
  "aria-pressed": e,
55
60
  tabIndex: 0,
56
61
  children: t
57
62
  });
58
63
  }
59
64
  });
60
- var s = class extends e.Component {
65
+ var c = class extends e.Component {
61
66
  static propTypes = {
62
67
  onToggle: n.func.isRequired,
63
68
  mark: n.string,
@@ -76,7 +81,7 @@ var s = class extends e.Component {
76
81
  };
77
82
  render() {
78
83
  let { children: e, active: t, label: n } = this.props;
79
- return /* @__PURE__ */ r(a, {
84
+ return /* @__PURE__ */ r(o, {
80
85
  active: t,
81
86
  onMouseDown: this.onToggle,
82
87
  "aria-pressed": t,
@@ -86,6 +91,6 @@ var s = class extends e.Component {
86
91
  children: e
87
92
  });
88
93
  }
89
- };
94
+ }, l = c;
90
95
  //#endregion
91
- export { s as MarkButton };
96
+ export { l as MarkButton, c as RawMarkButton };
@@ -11,6 +11,8 @@ var n = e("path")({
11
11
  width: "24",
12
12
  height: "24",
13
13
  viewBox: "0 0 24 24",
14
+ "aria-hidden": "true",
15
+ focusable: "false",
14
16
  children: /* @__PURE__ */ t(e, { ...n })
15
17
  }), i = r((e) => /* @__PURE__ */ t(n, {
16
18
  ...e,