@nxgt/material 3.68.0 → 3.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/README.md +13 -9
  3. package/dist/{alert-dialog-BhARh_qC.js → alert-dialog-y2pbowVh.js} +1 -1
  4. package/dist/{async-slice-CHyRU5V3.js → async-slice-CGfWBOaV.js} +1 -1
  5. package/dist/{button-Du7fJ9i_.js → button-D54Hrjo0.js} +1 -1
  6. package/dist/charts.js +3 -3
  7. package/dist/{chip-BVB6UYl-.js → chip-B5MhXBfm.js} +2 -2
  8. package/dist/{code-editor-D-GBs2yu.js → code-editor-mULs4SL8.js} +5 -5
  9. package/dist/code-editor.js +5 -5
  10. package/dist/{code-language-items-xrgq1Am0.js → code-language-items-BWDnqUqn.js} +2 -2
  11. package/dist/components/ui/collections/server-table/server-table-phone-row.css +6 -0
  12. package/dist/components/ui/display/code/code-moonlight.css +37 -0
  13. package/dist/{components-iNCh4A6M.js → components-B_taYVcd.js} +19740 -18682
  14. package/dist/components.js +28 -28
  15. package/dist/{dialog-DFY_nsqF.js → dialog-AjCYZ2Vz.js} +4 -4
  16. package/dist/dnd.js +1 -1
  17. package/dist/{dropdown-menu-B6Yh4XJu.js → dropdown-menu-LN60hu_3.js} +1 -1
  18. package/dist/editor.js +673 -673
  19. package/dist/{empty-state-DGtwE50c.js → empty-state-Bo8G8W8G.js} +2 -2
  20. package/dist/{field-blur-Br7ij-a1.js → field-blur-Cnd6FfCH.js} +1 -1
  21. package/dist/{field-blur-context-CucMAZLj.js → field-blur-context-bUFZj8iN.js} +1 -1
  22. package/dist/{hooks-CYQJkKGc.js → hooks-Dt4PkQiZ.js} +2 -2
  23. package/dist/hooks.js +3 -3
  24. package/dist/{hover-card-C2J0GwWf.js → hover-card-QtGnvsnc.js} +1 -1
  25. package/dist/i18n.js +3 -3
  26. package/dist/{icon-badge-LzO5K6Wu.js → icon-badge-DLbpCQIm.js} +3 -3
  27. package/dist/{icon-button-vLJ4YrEW.js → icon-button-C59DqL7L.js} +1 -1
  28. package/dist/lib/components/ui/actions/fab/fab-dock-inset.d.ts +29 -0
  29. package/dist/lib/components/ui/actions/fab/fab-dock.d.ts +6 -1
  30. package/dist/lib/components/ui/collections/data-table/select-checkbox.d.ts +3 -2
  31. package/dist/lib/components/ui/collections/filter/use-filter-field-config.d.ts +3 -3
  32. package/dist/lib/components/ui/collections/index.d.ts +1 -0
  33. package/dist/lib/components/ui/collections/record-actions-menu/index.d.ts +2 -0
  34. package/dist/lib/components/ui/collections/record-actions-menu/record-actions-dialogs.d.ts +15 -0
  35. package/dist/lib/components/ui/collections/record-actions-menu/record-actions-menu.d.ts +72 -0
  36. package/dist/lib/components/ui/collections/record-actions-menu/record-actions-rules.d.ts +68 -0
  37. package/dist/lib/components/ui/collections/record-actions-menu/record-actions-words.d.ts +52 -0
  38. package/dist/lib/components/ui/collections/record-actions-menu/use-record-actions.d.ts +51 -0
  39. package/dist/lib/components/ui/collections/record-actions-menu/use-record-flight.d.ts +16 -0
  40. package/dist/lib/components/ui/collections/row-menu/row-menu-column.d.ts +4 -0
  41. package/dist/lib/components/ui/collections/row-menu/row-menu.d.ts +1 -1
  42. package/dist/lib/components/ui/collections/server-table/partials/server-table-band-classes.d.ts +7 -5
  43. package/dist/lib/components/ui/collections/server-table/partials/server-table-column-sorting.d.ts +7 -0
  44. package/dist/lib/components/ui/collections/server-table/types.d.ts +3 -1
  45. package/dist/lib/components/ui/display/markdown/markdown.d.ts +12 -1
  46. package/dist/lib/components/ui/display/markdown/markdown.utils.d.ts +2 -0
  47. package/dist/lib/components/ui/display/markdown/mermaid-csp-scope.d.ts +8 -0
  48. package/dist/lib/components/ui/display/markdown/mermaid-markup.d.ts +20 -0
  49. package/dist/lib/components/ui/display/markdown/partials/markdown-code.d.ts +5 -1
  50. package/dist/lib/components/ui/feedback/confirm-dialog/action-refusal.d.ts +24 -0
  51. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-alert.d.ts +17 -0
  52. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-description.d.ts +10 -0
  53. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog.d.ts +24 -2
  54. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-refusal.d.ts +7 -0
  55. package/dist/lib/components/ui/feedback/confirm-dialog/index.d.ts +1 -0
  56. package/dist/lib/components/ui/feedback/confirm-dialog/use-confirm-action.d.ts +6 -0
  57. package/dist/lib/components/ui/feedback/index.d.ts +1 -0
  58. package/dist/lib/components/ui/feedback/stale-notice/index.d.ts +1 -0
  59. package/dist/lib/components/ui/feedback/stale-notice/stale-notice.d.ts +15 -0
  60. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  61. package/dist/lib/components/ui/fields/country-field/index.d.ts +2 -0
  62. package/dist/lib/components/ui/fields/country-field/iso-countries.d.ts +2 -0
  63. package/dist/lib/components/ui/fields/index.d.ts +1 -0
  64. package/dist/lib/components/ui/fields/phone-field/index.d.ts +1 -1
  65. package/dist/lib/components/ui/fields/phone-field/parse-phone.d.ts +2 -0
  66. package/dist/lib/components/ui/fields/phone-field/phone-field.d.ts +8 -1
  67. package/dist/lib/components/ui/fields/phone-field/phone-form-field.d.ts +8 -1
  68. package/dist/lib/components/ui/fields/phone-field/use-phone-value.d.ts +2 -1
  69. package/dist/lib/components/ui/fields/postal-address/utils.d.ts +15 -0
  70. package/dist/lib/components/ui/fields/quantity-field/index.d.ts +3 -0
  71. package/dist/lib/components/ui/fields/quantity-field/quantity-field.d.ts +8 -0
  72. package/dist/lib/components/ui/fields/quantity-field/quantity-form-field.d.ts +8 -0
  73. package/dist/lib/components/ui/fields/quantity-field/quantity-row.d.ts +13 -0
  74. package/dist/lib/components/ui/fields/quantity-field/quantity-unit.d.ts +12 -0
  75. package/dist/lib/components/ui/fields/quantity-field/quantity-value.d.ts +9 -0
  76. package/dist/lib/components/ui/fields/quantity-field/types.d.ts +45 -0
  77. package/dist/lib/components/ui/forms/index.d.ts +1 -0
  78. package/dist/lib/components/ui/forms/use-server-field-errors.d.ts +21 -0
  79. package/dist/lib/components/ui/layout/index.d.ts +1 -0
  80. package/dist/lib/components/ui/layout/record-page/index.d.ts +2 -0
  81. package/dist/lib/components/ui/layout/record-page/record-details.d.ts +40 -0
  82. package/dist/lib/components/ui/layout/record-page/record-page.d.ts +27 -0
  83. package/dist/lib/components/ui/media/upload/index.d.ts +1 -0
  84. package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-field.d.ts +6 -1
  85. package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-field.errors.d.ts +8 -0
  86. package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-field.utils.d.ts +2 -7
  87. package/dist/lib/components/ui/media/upload/network-upload-field/use-start-upload.d.ts +7 -3
  88. package/dist/lib/components/ui/media/upload/network-upload-field/use-upload-item-handlers.d.ts +2 -1
  89. package/dist/lib/components/ui/media/upload/s3-upload-field/s3-upload-field.d.ts +2 -5
  90. package/dist/lib/components/ui/media/upload/s3-upload-field/s3-upload-field.utils.d.ts +26 -1
  91. package/dist/lib/components/ui/media/upload/upload-error.d.ts +33 -0
  92. package/dist/lib/components/ui/selection/autocomplete/autocomplete-enter.d.ts +18 -0
  93. package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-chip-input.d.ts +2 -1
  94. package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-text-input.d.ts +2 -1
  95. package/dist/lib/components/ui/selection/autocomplete/types.d.ts +3 -1
  96. package/dist/lib/components/ui/widgets/chat/chat-conversation-item.d.ts +8 -2
  97. package/dist/lib/components/ui/widgets/chat/chat-markdown.d.ts +4 -0
  98. package/dist/lib/components/ui/widgets/chat/chat-message-list.d.ts +8 -1
  99. package/dist/lib/components/ui/widgets/chat/index.d.ts +2 -0
  100. package/dist/lib/components/ui/widgets/chat/partials/chat-conversation-item-text.d.ts +2 -1
  101. package/dist/lib/components/ui/widgets/chat/partials/chat-empty-thread.d.ts +2 -0
  102. package/dist/lib/components/ui/widgets/chat/proposal/chat-action-proposal-parts.d.ts +24 -0
  103. package/dist/lib/components/ui/widgets/chat/proposal/chat-action-proposal.d.ts +39 -0
  104. package/dist/lib/components/ui/widgets/chat/proposal/chat-action-proposal.rules.d.ts +17 -0
  105. package/dist/lib/components/ui/widgets/chat/proposal/chat-tool-activity.d.ts +16 -0
  106. package/dist/lib/components/ui/widgets/education/questions/partials/question-content.d.ts +1 -1
  107. package/dist/lib/components/ui/widgets/education/questions/question-text.d.ts +1 -1
  108. package/dist/lib/components/ui/widgets/education/questions/question.d.ts +1 -1
  109. package/dist/lib/components/ui/widgets/education/questions/types.d.ts +10 -0
  110. package/dist/lib/i18n/resources/en/en.d.ts +49 -0
  111. package/dist/lib/i18n/resources/en/material.json.d.ts +50 -1
  112. package/dist/lib/i18n/resources/fr/fr.d.ts +49 -0
  113. package/dist/lib/i18n/resources/fr/material.json.d.ts +50 -1
  114. package/dist/lib/i18n/resources/resources.d.ts +98 -0
  115. package/dist/lib/i18n/translator.d.ts +1 -1
  116. package/dist/lib/print/output/to-pdf-element.d.ts +6 -0
  117. package/dist/lib.js +1 -1
  118. package/dist/main.js +42 -42
  119. package/dist/map.js +8 -8
  120. package/dist/material.css +1 -1
  121. package/dist/pdf-reader.js +1 -1
  122. package/dist/print.js +135 -131
  123. package/dist/{public-BHthpdpe.js → public-BSaSCwy7.js} +9 -9
  124. package/dist/{rich-code-block-DoW7l2ND.js → rich-code-block-BFVj1GWz.js} +5 -5
  125. package/dist/{sortable-provider-FLNMfr0o.js → sortable-provider-REwyjiOZ.js} +2 -2
  126. package/dist/{spinner-DCgDw8eq.js → spinner-BFZxqdWC.js} +1 -1
  127. package/dist/theme-picker.js +2 -2
  128. package/dist/{theme-toggle-BMDAwMLh.js → theme-toggle-BHi6miz-.js} +1 -1
  129. package/dist/{toolbar-items-CkPEhQq7.js → toolbar-items-BTtoKVlx.js} +3 -3
  130. package/dist/{translate-material-DkcuQBNr.js → translate-material-R-uLthBy.js} +1 -1
  131. package/dist/{translator-DXdVRdMm.js → translator-ClbXOGQO.js} +100 -2
  132. package/dist/{typography-BNS_IbFI.js → typography-v-PJ4Zco.js} +1 -1
  133. package/dist/{use-chat-composer-B-tGRLkI.js → use-chat-composer-Rhan4Xv0.js} +2463 -2405
  134. package/dist/{use-heading-spy-DaqibCCm.js → use-heading-spy-CJnBkCY0.js} +179 -87
  135. package/dist/{use-material-translation-Bxl8sv1n.js → use-material-translation-CCWUeiEn.js} +1 -1
  136. package/dist/{use-return-focus-Y_Kx0QlW.js → use-return-focus-Duk40DZI.js} +1 -1
  137. package/docs/components/buttons-and-actions.md +24 -0
  138. package/docs/components/data-display.md +33 -0
  139. package/docs/components/data-table-filter-and-lists.md +117 -5
  140. package/docs/components/feedback-and-status.md +58 -2
  141. package/docs/components/form-fields.md +97 -3
  142. package/docs/components/media-and-files.md +55 -9
  143. package/docs/components/navigation-and-layout.md +58 -0
  144. package/docs/components/rich-widgets.md +37 -3
  145. package/docs/components/selection-and-choice.md +10 -3
  146. package/docs/guides/cards-and-tiles.md +4 -2
  147. package/docs/guides/csp.md +44 -6
  148. package/docs/guides/forms.md +55 -7
  149. package/docs/guides/i18n.md +6 -5
  150. package/docs/guides/printing.md +17 -7
  151. package/docs/previews/data-table-filter-lists-recordactionsmenu.webp +0 -0
  152. package/docs/previews/feedback-status-stalenotice.webp +0 -0
  153. package/docs/previews/form-fields-quantityfield.webp +0 -0
  154. package/docs/previews/media-files-networkuploadfield.webp +0 -0
  155. package/docs/previews/media-files-s3uploadfield.webp +0 -0
  156. package/docs/previews/media-files-uploadfield.webp +0 -0
  157. package/docs/previews/navigation-layout-recordpage.webp +0 -0
  158. package/docs/previews/rich-widgets-chat-action-proposal.webp +0 -0
  159. package/docs/roadmap.md +14 -1
  160. package/docs/troubleshooting.md +58 -11
  161. package/lib/components/ui/collections/server-table/server-table-phone-row.css +6 -0
  162. package/lib/components/ui/display/code/code-moonlight.css +37 -0
  163. package/package.json +2 -2
@@ -1,14 +1,14 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
- import { a as t, c as n, d as r, i, n as a, r as o, t as s, u as c } from "./alert-dialog-BhARh_qC.js";
3
- import { a as l } from "./button-Du7fJ9i_.js";
4
- import { i as u } from "./translate-material-DkcuQBNr.js";
5
- import { t as d } from "./use-material-translation-Bxl8sv1n.js";
2
+ import { a as t, c as n, d as r, i, n as a, r as o, t as s, u as c } from "./alert-dialog-y2pbowVh.js";
3
+ import { a as l } from "./button-D54Hrjo0.js";
4
+ import { i as u } from "./translate-material-R-uLthBy.js";
5
+ import { t as d } from "./use-material-translation-CCWUeiEn.js";
6
6
  import { _ as f, g as p, h as m, n as h, v as g, y as _ } from "./number.utils-BG_eEt5g.js";
7
7
  import { useCallback as v, useEffect as y, useMemo as b, useRef as x, useState as S } from "react";
8
- import { jsx as C, jsxs as w } from "react/jsx-runtime";
9
- import { busySettler as T, busySettler as E, createSubmitGuard as D, createSubmitGuard as O } from "@nxgt/material-core/submit-guard";
8
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
9
+ import { busySettler as E, busySettler as D, createSubmitGuard as O, createSubmitGuard as k } from "@nxgt/material-core/submit-guard";
10
10
  //#region ../../node_modules/date-fns/locale/fr/_lib/formatDistance.js
11
- var k = {
11
+ var A = {
12
12
  lessThanXSeconds: {
13
13
  one: "moins d’une seconde",
14
14
  other: "moins de {{count}} secondes"
@@ -70,10 +70,10 @@ var k = {
70
70
  one: "presqu’un an",
71
71
  other: "presque {{count}} ans"
72
72
  }
73
- }, A = (e, t, n) => {
74
- let r, i = k[e];
73
+ }, j = (e, t, n) => {
74
+ let r, i = A[e];
75
75
  return r = typeof i == "string" ? i : t === 1 ? i.one : i.other.replace("{{count}}", String(t)), n?.addSuffix ? n.comparison && n.comparison > 0 ? "dans " + r : "il y a " + r : r;
76
- }, j = {
76
+ }, M = {
77
77
  date: _({
78
78
  formats: {
79
79
  full: "EEEE d MMMM y",
@@ -101,18 +101,18 @@ var k = {
101
101
  },
102
102
  defaultWidth: "full"
103
103
  })
104
- }, M = {
104
+ }, N = {
105
105
  lastWeek: "eeee 'dernier à' p",
106
106
  yesterday: "'hier à' p",
107
107
  today: "'aujourd’hui à' p",
108
108
  tomorrow: "'demain à' p'",
109
109
  nextWeek: "eeee 'prochain à' p",
110
110
  other: "P"
111
- }, N = (e, t, n, r) => M[e], P = {
111
+ }, P = (e, t, n, r) => N[e], ee = {
112
112
  narrow: ["av. J.-C", "ap. J.-C"],
113
113
  abbreviated: ["av. J.-C", "ap. J.-C"],
114
114
  wide: ["avant Jésus-Christ", "après Jésus-Christ"]
115
- }, F = {
115
+ }, te = {
116
116
  narrow: [
117
117
  "T1",
118
118
  "T2",
@@ -131,7 +131,7 @@ var k = {
131
131
  "3ème trimestre",
132
132
  "4ème trimestre"
133
133
  ]
134
- }, I = {
134
+ }, F = {
135
135
  narrow: [
136
136
  "J",
137
137
  "F",
@@ -174,7 +174,7 @@ var k = {
174
174
  "novembre",
175
175
  "décembre"
176
176
  ]
177
- }, L = {
177
+ }, I = {
178
178
  narrow: [
179
179
  "D",
180
180
  "L",
@@ -211,7 +211,7 @@ var k = {
211
211
  "vendredi",
212
212
  "samedi"
213
213
  ]
214
- }, R = {
214
+ }, L = {
215
215
  narrow: {
216
216
  am: "AM",
217
217
  pm: "PM",
@@ -242,7 +242,7 @@ var k = {
242
242
  evening: "du soir",
243
243
  night: "du matin"
244
244
  }
245
- }, z = (e, t) => {
245
+ }, R = (e, t) => {
246
246
  let n = Number(e), r = t?.unit;
247
247
  if (n === 0) return "0";
248
248
  let i = [
@@ -253,38 +253,38 @@ var k = {
253
253
  "second"
254
254
  ], a;
255
255
  return a = n === 1 ? r && i.includes(r) ? "ère" : "er" : "ème", n + a;
256
- }, B = ["MMM", "MMMM"], V = {
256
+ }, z = ["MMM", "MMMM"], B = {
257
257
  en: m,
258
258
  fr: {
259
259
  code: "fr",
260
- formatDistance: A,
261
- formatLong: j,
262
- formatRelative: N,
260
+ formatDistance: j,
261
+ formatLong: M,
262
+ formatRelative: P,
263
263
  localize: {
264
- preprocessor: (e, t) => e.getDate() === 1 || !t.some((e) => e.isToken && B.includes(e.value)) ? t : t.map((e) => e.isToken && e.value === "do" ? {
264
+ preprocessor: (e, t) => e.getDate() === 1 || !t.some((e) => e.isToken && z.includes(e.value)) ? t : t.map((e) => e.isToken && e.value === "do" ? {
265
265
  isToken: !0,
266
266
  value: "d"
267
267
  } : e),
268
- ordinalNumber: z,
268
+ ordinalNumber: R,
269
269
  era: g({
270
- values: P,
270
+ values: ee,
271
271
  defaultWidth: "wide"
272
272
  }),
273
273
  quarter: g({
274
- values: F,
274
+ values: te,
275
275
  defaultWidth: "wide",
276
276
  argumentCallback: (e) => e - 1
277
277
  }),
278
278
  month: g({
279
- values: I,
279
+ values: F,
280
280
  defaultWidth: "wide"
281
281
  }),
282
282
  day: g({
283
- values: L,
283
+ values: I,
284
284
  defaultWidth: "wide"
285
285
  }),
286
286
  dayPeriod: g({
287
- values: R,
287
+ values: L,
288
288
  defaultWidth: "wide"
289
289
  })
290
290
  },
@@ -414,8 +414,8 @@ var k = {
414
414
  }
415
415
  }
416
416
  };
417
- function H() {
418
- let e = u()?.language ?? "en", t = b(() => V[e] ?? m, [e]);
417
+ function V() {
418
+ let e = u()?.language ?? "en", t = b(() => B[e] ?? m, [e]);
419
419
  return {
420
420
  language: e,
421
421
  locale: t,
@@ -424,8 +424,8 @@ function H() {
424
424
  }
425
425
  //#endregion
426
426
  //#region lib/components/ui/feedback/alert-dialog/alert-dialog-actions.tsx
427
- function U({ className: t, ...n }) {
428
- return /* @__PURE__ */ C(c, {
427
+ function H({ className: t, ...n }) {
428
+ return /* @__PURE__ */ w(c, {
429
429
  className: e(l({
430
430
  variant: n.variant,
431
431
  color: n.color
@@ -433,8 +433,8 @@ function U({ className: t, ...n }) {
433
433
  ...n
434
434
  });
435
435
  }
436
- function W({ className: t, ...n }) {
437
- return /* @__PURE__ */ C(r, {
436
+ function U({ className: t, ...n }) {
437
+ return /* @__PURE__ */ w(r, {
438
438
  "data-variant": n.variant ?? "tonal",
439
439
  className: e(l({
440
440
  variant: n.variant ?? "tonal",
@@ -444,92 +444,165 @@ function W({ className: t, ...n }) {
444
444
  });
445
445
  }
446
446
  //#endregion
447
- //#region lib/hooks/use-focus-on-mount.ts
448
- function G(e = !0) {
449
- let t = x(null);
450
- return y(() => {
451
- e && t.current?.focus();
452
- }, [e]), t;
447
+ //#region lib/components/ui/feedback/confirm-dialog/action-refusal.ts
448
+ var W = class extends Error {
449
+ action;
450
+ details;
451
+ constructor(e, t) {
452
+ super(e), this.name = "ActionRefusal", this.action = t.action, this.details = t.details;
453
+ }
454
+ };
455
+ function G(e) {
456
+ return e instanceof W || e instanceof Error && e.name === "ActionRefusal" && typeof e.action?.label == "string";
453
457
  }
454
- //#endregion
455
- //#region lib/hooks/use-submit-once.ts
456
458
  function K(e) {
457
- let [t] = S(D), [n] = S(() => T(t)), r = e !== void 0;
458
- return y(() => {
459
- e !== void 0 && n(e);
460
- }, [e, n]), v((e, n) => t.once(e, {
461
- settleSync: !r,
462
- ...n
463
- }), [t, r]);
459
+ return G(e) ? e.action : void 0;
460
+ }
461
+ //#endregion
462
+ //#region lib/components/ui/feedback/confirm-dialog/confirm-refusal.tsx
463
+ var q = "font-medium text-inherit underline underline-offset-2";
464
+ function J({ action: e, close: t }) {
465
+ return e.href && !e.onAction ? /* @__PURE__ */ w("a", {
466
+ className: q,
467
+ href: e.href,
468
+ onClick: t,
469
+ children: e.label
470
+ }) : /* @__PURE__ */ w("button", {
471
+ type: "button",
472
+ className: q,
473
+ onClick: () => {
474
+ e.onAction?.(), t();
475
+ },
476
+ children: e.label
477
+ });
478
+ }
479
+ function Y({ message: e, cause: t, close: n }) {
480
+ return G(t) ? /* @__PURE__ */ T("div", {
481
+ className: "flex flex-col gap-1",
482
+ children: [
483
+ /* @__PURE__ */ w("span", { children: e }),
484
+ t.details != null && /* @__PURE__ */ w("span", {
485
+ className: "text-muted-foreground",
486
+ children: t.details
487
+ }),
488
+ /* @__PURE__ */ w("span", { children: /* @__PURE__ */ w(J, {
489
+ action: t.action,
490
+ close: n
491
+ }) })
492
+ ]
493
+ }) : /* @__PURE__ */ w(C, { children: e });
494
+ }
495
+ //#endregion
496
+ //#region lib/components/ui/feedback/confirm-dialog/confirm-alert.tsx
497
+ function X({ message: e, cause: t, close: n, refusal: r }) {
498
+ return /* @__PURE__ */ w("div", {
499
+ role: "alert",
500
+ className: "text-sm text-error-text",
501
+ children: r ? r({
502
+ message: e,
503
+ cause: t,
504
+ close: n
505
+ }) : /* @__PURE__ */ w(Y, {
506
+ message: e,
507
+ cause: t,
508
+ close: n
509
+ })
510
+ });
511
+ }
512
+ //#endregion
513
+ //#region lib/components/ui/feedback/confirm-dialog/confirm-description.tsx
514
+ function Z({ children: e, details: t }) {
515
+ return typeof e == "string" && t == null ? /* @__PURE__ */ w(o, { children: e }) : /* @__PURE__ */ w(o, {
516
+ asChild: !0,
517
+ children: /* @__PURE__ */ w("div", {
518
+ className: "space-y-2",
519
+ children: t == null ? e : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("div", { children: e }), /* @__PURE__ */ w("div", { children: t })] })
520
+ })
521
+ });
464
522
  }
465
523
  //#endregion
466
524
  //#region lib/components/ui/feedback/confirm-dialog/confirm-dialog-rules.ts
467
- function q(e) {
525
+ function ne(e) {
468
526
  return e === "destructive" ? "max-sm:flex-col" : void 0;
469
527
  }
470
- function J({ busy: e, confirmDisabled: t, lockOnRefusal: n, error: r }) {
528
+ function re({ busy: e, confirmDisabled: t, lockOnRefusal: n, error: r }) {
471
529
  return e || !!t || !!n && !!r;
472
530
  }
473
531
  //#endregion
474
532
  //#region lib/components/ui/feedback/confirm-dialog/use-confirm-action.ts
475
- function Y({ open: e, onOpenChange: t, onConfirm: n }) {
476
- let { t: r } = d(), [i, a] = S(!1), [o, s] = S(null);
533
+ function ie({ open: e, onOpenChange: t, onConfirm: n }) {
534
+ let { t: r } = d(), [i, a] = S(!1), [o, s] = S(null), [c, l] = S(null);
477
535
  return y(() => {
478
- e || s(null);
536
+ e || (s(null), l(null));
479
537
  }, [e]), {
480
538
  pending: i,
481
539
  error: o,
540
+ cause: c,
482
541
  handleOpenChange: (e) => {
483
- e && s(null), t(e);
542
+ e && (s(null), l(null)), t(e);
484
543
  },
485
544
  handleConfirm: async (e) => {
486
- e.preventDefault(), s(null), a(!0);
545
+ e.preventDefault(), s(null), l(null), a(!0);
487
546
  try {
488
547
  await n(), t(!1);
489
548
  } catch (e) {
490
- s(e instanceof Error && e.message ? e.message : r("material.confirm-dialog.failed", "The action failed."));
549
+ l(e), s(e instanceof Error && e.message ? e.message : r("material.confirm-dialog.failed", "The action failed."));
491
550
  } finally {
492
551
  a(!1);
493
552
  }
494
553
  }
495
554
  };
496
555
  }
556
+ function ae(e) {
557
+ let t = x(null);
558
+ return y(() => {
559
+ let n = t.current;
560
+ if (!e || !n) return;
561
+ let r = document.activeElement;
562
+ (r === document.body || n.contains(r)) && n.focus();
563
+ }, [e]), t;
564
+ }
497
565
  //#endregion
498
566
  //#region lib/components/ui/feedback/confirm-dialog/confirm-dialog.tsx
499
- function X({ open: e, onOpenChange: r, title: c, description: l, confirmLabel: u, cancelLabel: f, cancelVariant: p, onConfirm: m, variant: h = "default", loading: g = !1, confirmDisabled: _, lockOnRefusal: v, onCloseAutoFocus: y }) {
500
- let { t: b } = d(), { pending: x, error: S, handleOpenChange: T, handleConfirm: E } = Y({
567
+ function Q({ open: e, onOpenChange: r, title: o, description: c, details: l, confirmLabel: u, cancelLabel: f, cancelVariant: p, onConfirm: m, variant: h = "default", loading: g = !1, confirmDisabled: _, lockOnRefusal: v, refusal: y, onCloseAutoFocus: b }) {
568
+ let { t: x } = d(), { pending: S, error: C, cause: E, handleOpenChange: D, handleConfirm: O } = ie({
501
569
  open: e,
502
570
  onOpenChange: r,
503
571
  onConfirm: m
504
- }), D = g || x;
505
- return /* @__PURE__ */ C(s, {
572
+ }), k = g || S;
573
+ return /* @__PURE__ */ w(s, {
506
574
  open: e,
507
- onOpenChange: T,
508
- children: /* @__PURE__ */ w(a, {
509
- onCloseAutoFocus: y,
575
+ onOpenChange: D,
576
+ children: /* @__PURE__ */ T(a, {
577
+ ref: ae(S),
578
+ onCloseAutoFocus: b,
510
579
  children: [
511
- /* @__PURE__ */ w(t, { children: [/* @__PURE__ */ C(n, { children: c }), /* @__PURE__ */ C(o, { children: l })] }),
512
- S && /* @__PURE__ */ C("p", {
513
- role: "alert",
514
- className: "text-sm text-error-text",
515
- children: S
580
+ /* @__PURE__ */ T(t, { children: [/* @__PURE__ */ w(n, { children: o }), /* @__PURE__ */ w(Z, {
581
+ details: l,
582
+ children: c
583
+ })] }),
584
+ C && /* @__PURE__ */ w(X, {
585
+ message: C,
586
+ cause: E,
587
+ close: () => r(!1),
588
+ refusal: y
516
589
  }),
517
- /* @__PURE__ */ w(i, {
518
- className: q(h),
519
- children: [/* @__PURE__ */ C(W, {
520
- disabled: D,
590
+ /* @__PURE__ */ T(i, {
591
+ className: ne(h),
592
+ children: [/* @__PURE__ */ w(U, {
593
+ disabled: k,
521
594
  variant: p,
522
- children: f ?? b("material.confirm-dialog.cancel", "Cancel")
523
- }), /* @__PURE__ */ C(U, {
524
- onClick: E,
595
+ children: f ?? x("material.confirm-dialog.cancel", "Cancel")
596
+ }), /* @__PURE__ */ w(H, {
597
+ onClick: O,
525
598
  color: h === "destructive" ? "error" : "primary",
526
- disabled: J({
527
- busy: D,
599
+ disabled: re({
600
+ busy: k,
528
601
  confirmDisabled: _,
529
602
  lockOnRefusal: v,
530
- error: S
603
+ error: C
531
604
  }),
532
- children: D ? b("material.confirm-dialog.processing", "Processing...") : u ?? b("material.confirm-dialog.confirm", "Confirm")
605
+ children: k ? x("material.confirm-dialog.processing", "Processing...") : u ?? x("material.confirm-dialog.confirm", "Confirm")
533
606
  })]
534
607
  })
535
608
  ]
@@ -537,8 +610,27 @@ function X({ open: e, onOpenChange: r, title: c, description: l, confirmLabel: u
537
610
  });
538
611
  }
539
612
  //#endregion
613
+ //#region lib/hooks/use-focus-on-mount.ts
614
+ function oe(e = !0) {
615
+ let t = x(null);
616
+ return y(() => {
617
+ e && t.current?.focus();
618
+ }, [e]), t;
619
+ }
620
+ //#endregion
621
+ //#region lib/hooks/use-submit-once.ts
622
+ function $(e) {
623
+ let [t] = S(O), [n] = S(() => E(t)), r = e !== void 0;
624
+ return y(() => {
625
+ e !== void 0 && n(e);
626
+ }, [e, n]), v((e, n) => t.once(e, {
627
+ settleSync: !r,
628
+ ...n
629
+ }), [t, r]);
630
+ }
631
+ //#endregion
540
632
  //#region lib/hooks/use-countdown.ts
541
- function Z(e, { paused: t = !1, onExpire: n, key: r } = {}) {
633
+ function se(e, { paused: t = !1, onExpire: n, key: r } = {}) {
542
634
  let [i, a] = S(e), [o, s] = S({
543
635
  duration: e,
544
636
  key: r
@@ -565,9 +657,9 @@ function Z(e, { paused: t = !1, onExpire: n, key: r } = {}) {
565
657
  }
566
658
  //#endregion
567
659
  //#region lib/components/ui/feedback/unsaved-dialog/unsaved-dialog.tsx
568
- function Q({ open: e, onOpenChange: t, onLeave: n, title: r, description: i, stayLabel: a, leaveLabel: o }) {
660
+ function ce({ open: e, onOpenChange: t, onLeave: n, title: r, description: i, stayLabel: a, leaveLabel: o }) {
569
661
  let { t: s } = d();
570
- return /* @__PURE__ */ C(X, {
662
+ return /* @__PURE__ */ w(Q, {
571
663
  open: e,
572
664
  onOpenChange: t,
573
665
  variant: "destructive",
@@ -580,9 +672,9 @@ function Q({ open: e, onOpenChange: t, onLeave: n, title: r, description: i, sta
580
672
  }
581
673
  //#endregion
582
674
  //#region lib/hooks/use-heading-spy.ts
583
- var $ = "0px 0px -65% 0px", ee = [0, 1];
584
- function te(e, t, n) {
585
- let r = n?.rootMargin ?? $, i = n?.threshold ?? ee;
675
+ var le = "0px 0px -65% 0px", ue = [0, 1];
676
+ function de(e, t, n) {
677
+ let r = n?.rootMargin ?? le, i = n?.threshold ?? ue;
586
678
  y(() => {
587
679
  if (e.length === 0) return;
588
680
  let n = e.map((e) => document.getElementById(e)).filter((e) => e != null);
@@ -604,4 +696,4 @@ function te(e, t, n) {
604
696
  ]);
605
697
  }
606
698
  //#endregion
607
- export { E as a, G as c, H as d, X as i, U as l, Q as n, O as o, Z as r, K as s, te as t, W as u };
699
+ export { k as a, Q as c, K as d, H as f, D as i, W as l, V as m, ce as n, $ as o, U as p, se as r, oe as s, de as t, G as u };
@@ -1,4 +1,4 @@
1
- import { i as e, t } from "./translate-material-DkcuQBNr.js";
1
+ import { i as e, t } from "./translate-material-R-uLthBy.js";
2
2
  import { useCallback as n } from "react";
3
3
  //#region lib/i18n/use-material-translation.ts
4
4
  function r() {
@@ -1,6 +1,6 @@
1
1
  import { o as e, r as t } from "./dist-DVRQkaTK.js";
2
2
  import { a as n, c as r, i, l as a, o, r as s, s as c } from "./dist-lmHmz_bu.js";
3
- import { C as l, S as u, w as d } from "./spinner-DCgDw8eq.js";
3
+ import { C as l, S as u, w as d } from "./spinner-BFZxqdWC.js";
4
4
  import { c as f, i as p, l as m, o as h, r as g, s as ee } from "./in-dialog-Vwkyp-M5.js";
5
5
  import { r as _ } from "./escape-owner-DpaP0lm1.js";
6
6
  import * as v from "react";
@@ -444,6 +444,30 @@ Other `<button>` props go to the button. **Parts:** `data-slot="fab"` (with `dat
444
444
 
445
445
  **FabDock** places its children in the bottom-end corner, 16 px in (24 px from 840 px wide), above the home indicator (`env(safe-area-inset-bottom)`) and above a docked bar that sets `--nxgt-media-dock` (0 otherwise). Several FABs stack, the main one last. `contained` places it in its nearest positioned ancestor (a pane) instead of the viewport: it spans the pane (clicks pass through it), and an open FabMenu's scrim covers that pane only. The menu stays modal, so the whole page, not just the pane, is `inert` while it is open. `data-slot="fab-dock"`.
446
446
 
447
+ **Keeping the page end clear.** A viewport `FabDock` (not `contained`) sets `--fab-dock-inset` on the document while it shows its button: the dock's height, its offset from the bottom (gap, home indicator, docked bar) and 12 px of clearance. Pad the scroller or the page with it, so the last row scrolls clear of the button. Where the dock is hidden (`display: none` at a breakpoint, for example `className="sm:hidden"`) the property is removed and the padding falls back to 0. Several docks share the property (the largest value wins, and it goes when the last one does). It is measured on mount and at each resize; a change to `--nxgt-media-dock` alone is picked up at the next resize. A `contained` dock sets nothing.
448
+
449
+ ```tsx
450
+ import { Fab, FabDock } from '@nxgt/material/components';
451
+ import { Plus } from 'lucide-react';
452
+
453
+ function Members({ names }: { names: string[] }) {
454
+ return (
455
+ <>
456
+ <main className="pb-[var(--fab-dock-inset,0px)]">
457
+ <ul>
458
+ {names.map((name) => (
459
+ <li key={name}>{name}</li>
460
+ ))}
461
+ </ul>
462
+ </main>
463
+ <FabDock className="sm:hidden">
464
+ <Fab icon={<Plus />} label="Add member" />
465
+ </FabDock>
466
+ </>
467
+ );
468
+ }
469
+ ```
470
+
447
471
  **useScrollAway(ref?, { threshold = 24 })** (`@nxgt/material/hooks`) is true while the reader scrolls down by `threshold` px or more since the scroll last turned, and false again on scrolling back up, at the top or at the end. With `ref` it listens to that scroller only; without one, to the window. It reads once per frame at most, and is false on the server and at first render, so the markup never depends on it.
448
472
 
449
473
  **Accessibility:** a small FAB still takes 44 px on a coarse pointer; the icon is 3:1 or more and the label 4.5:1 or more against each tone, light and dark; under forced colours it keeps a border, a pressed FAB takes the system highlight and a disabled one turns `GrayText`. The springs stop under `prefers-reduced-motion`.
@@ -1469,6 +1469,39 @@ import { Markdown } from '@nxgt/material/components';
1469
1469
  | --- | --- | --- | --- |
1470
1470
  | `children` | `string` | — | the markdown source |
1471
1471
  | `emojis` | `EmojiItem[]` | — | resolves `:shortcode:` to custom emojis |
1472
+ | `math` | `boolean` | `true` | `false`: `$...$` and `$$...$$` stay text, KaTeX is not run |
1473
+ | `mermaid` | `boolean` | `true` | `false`: a `mermaid` fence shows as a code block and mermaid is never loaded |
1474
+
1475
+ `ChatMarkdown` takes the same `math` and `mermaid` props (default `true`).
1476
+
1477
+ ### Untrusted input (model output, user text)
1478
+
1479
+ `Markdown` and `ChatMarkdown` are safe for text you do not control, with no
1480
+ prop to set. These guarantees are covered by tests with XSS payloads:
1481
+
1482
+ - **Raw HTML is never rendered.** `<img onerror>`, `<script>`, `<iframe>`,
1483
+ `<svg onload>` and the like show as escaped text; there is no HTML plugin.
1484
+ - **Dangerous URLs are dropped.** In a link, an image, a reference definition or
1485
+ an autolink, only `http:`, `https:`, `mailto:`, `tel:`, relative paths and
1486
+ `#anchors` survive (a relative path holding a `:` is dropped), whatever the case or the whitespace. `javascript:`,
1487
+ `vbscript:`, `data:` and `file:` links lose their `href` (the text stays);
1488
+ such images are removed.
1489
+ - **External links** (`http(s)://…` and `//host`) carry
1490
+ `rel="noopener noreferrer"`. The component sets no `target`; add none if you
1491
+ can avoid it.
1492
+ - Mermaid runs with `securityLevel: 'strict'` and its SVG is inserted as DOM
1493
+ (it is shown as an image from a `blob:` URL: allow `img-src blob:`, no
1494
+ `data:` needed), after mount.
1495
+
1496
+ The full `Markdown` (maths, diagrams and highlighted code) runs under a strict
1497
+ nonce CSP with no `unsafe-inline`, no `unsafe-eval`, no `style-src-attr` and no
1498
+ `img-src data:` (`img-src blob:` for the diagrams): wrap the app in `NonceProvider` and see the
1499
+ [CSP guide](../guides/csp.md#markdown-katex-mermaid-and-code-under-a-strict-csp)
1500
+ (`Data display/Markdown > StrictCsp` plays it under that policy). Two things
1501
+ only: a server-rendered page that has math needs `style-src-attr 'unsafe-inline'`
1502
+ (KaTeX's server markup carries inline `style` attributes), and mermaid's mindmap
1503
+ and architecture diagrams add a `<style>` to `<head>`. `math={false}` and
1504
+ `mermaid={false}` stay for a restricted GFM-only mode.
1472
1505
 
1473
1506
  Mermaid diagrams render in the browser only, after mount; on the server the
1474
1507
  fence is left empty.