@nxgt/material 2.13.0 → 2.14.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 (96) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +18 -5
  3. package/dist/{blockDiagram-BEXU5L5S-CQaNV8rX.js → blockDiagram-BEXU5L5S-Cn9cG3vt.js} +1 -1
  4. package/dist/{chunk-3FUC2YCW-DmtO_Y9L.js → chunk-3FUC2YCW-XrT5pZo5.js} +1 -1
  5. package/dist/{chunk-7M6MHVWA-BQ0cJz5u.js → chunk-7M6MHVWA-Uf-8NCRF.js} +1 -1
  6. package/dist/{chunk-GNY47TPC-DiVMvIit.js → chunk-GNY47TPC-CGgBmY0O.js} +4 -4
  7. package/dist/{chunk-NETBCI7D-B5Av2fJk.js → chunk-NETBCI7D-g-jPsM9q.js} +1 -1
  8. package/dist/{chunk-Z7XXMR3K-D4uKosJW.js → chunk-Z7XXMR3K-BzO1efzA.js} +1 -1
  9. package/dist/{classDiagram-v2-NBCMYWYE-BYktffst.js → classDiagram-v2-NBCMYWYE-7WgpfVcn.js} +2 -2
  10. package/dist/components/components.css +13 -2
  11. package/dist/components/ui/feedback/spinner/spinner.css +28 -0
  12. package/dist/components/ui/fields/otp-field/input-otp.css +48 -0
  13. package/dist/components/ui/media/pdf-viewer/pdf-viewer.css +24 -0
  14. package/dist/components/ui/overlays/drawer/vaul-drawer.css +199 -0
  15. package/dist/components/ui/overlays/drawer/vaul-keyframes.css +95 -0
  16. package/dist/{components-C-y3kTRm.js → components-qTUjhFuo.js} +116137 -127138
  17. package/dist/components.js +6 -6
  18. package/dist/{dagre-6A5THRUB-BvQAvoOX.js → dagre-6A5THRUB-BOuRxJdA.js} +3 -3
  19. package/dist/{diagram-22UHCM2B-BYd0lEdS.js → diagram-22UHCM2B-CF0vLJbn.js} +2 -2
  20. package/dist/{diagram-3UASUU5V-B3ndNq2p.js → diagram-3UASUU5V-RLo-MTfV.js} +1 -1
  21. package/dist/{elk-276RUBZZ-BxXn1nvc.js → elk-276RUBZZ-Dr2yBM7k.js} +3 -3
  22. package/dist/{erDiagram-OPXOYQCR-DjYy4h_r.js → erDiagram-OPXOYQCR-l7kPZ4FO.js} +2 -2
  23. package/dist/{field-blur-V8o79CDN.js → field-blur-BKGVq9_k.js} +865 -870
  24. package/dist/{flowDiagram-KWPJA3E3-BD7xvcMh.js → flowDiagram-KWPJA3E3-BQEK3XTl.js} +3 -3
  25. package/dist/fonts/katex/KaTeX_AMS-Regular.woff2 +0 -0
  26. package/dist/fonts/katex/KaTeX_Caligraphic-Bold.woff2 +0 -0
  27. package/dist/fonts/katex/KaTeX_Caligraphic-Regular.woff2 +0 -0
  28. package/dist/fonts/katex/KaTeX_Fraktur-Bold.woff2 +0 -0
  29. package/dist/fonts/katex/KaTeX_Fraktur-Regular.woff2 +0 -0
  30. package/dist/fonts/katex/KaTeX_Main-Bold.woff2 +0 -0
  31. package/dist/fonts/katex/KaTeX_Main-BoldItalic.woff2 +0 -0
  32. package/dist/fonts/katex/KaTeX_Main-Italic.woff2 +0 -0
  33. package/dist/fonts/katex/KaTeX_Main-Regular.woff2 +0 -0
  34. package/dist/fonts/katex/KaTeX_Math-BoldItalic.woff2 +0 -0
  35. package/dist/fonts/katex/KaTeX_Math-Italic.woff2 +0 -0
  36. package/dist/fonts/katex/KaTeX_SansSerif-Bold.woff2 +0 -0
  37. package/dist/fonts/katex/KaTeX_SansSerif-Italic.woff2 +0 -0
  38. package/dist/fonts/katex/KaTeX_SansSerif-Regular.woff2 +0 -0
  39. package/dist/fonts/katex/KaTeX_Script-Regular.woff2 +0 -0
  40. package/dist/fonts/katex/KaTeX_Size1-Regular.woff2 +0 -0
  41. package/dist/fonts/katex/KaTeX_Size2-Regular.woff2 +0 -0
  42. package/dist/fonts/katex/KaTeX_Size3-Regular.woff2 +0 -0
  43. package/dist/fonts/katex/KaTeX_Size4-Regular.woff2 +0 -0
  44. package/dist/fonts/katex/KaTeX_Typewriter-Regular.woff2 +0 -0
  45. package/dist/{ganttDiagram-FUAMR5RP-BAuk7X6i.js → ganttDiagram-FUAMR5RP-WYm8XV7U.js} +1 -1
  46. package/dist/hooks.js +25 -25
  47. package/dist/{journeyDiagram-ZHPQQLJL-h2S56BMC.js → journeyDiagram-ZHPQQLJL-p90NnenY.js} +1 -1
  48. package/dist/lib/components/ui/fields/attributes/attribute-form/consts.d.ts +5 -1
  49. package/dist/lib/components/ui/fields/attributes/attribute-form/types.d.ts +2 -2
  50. package/dist/lib/components/ui/fields/opening-hours/consts.d.ts +12 -1
  51. package/dist/lib/components/ui/media/image-cropper/image-crop-aspects.d.ts +6 -0
  52. package/dist/lib/components/ui/media/image-cropper/use-frame-size.d.ts +4 -0
  53. package/dist/lib/components/ui/primitives/index.d.ts +1 -0
  54. package/dist/lib/components/ui/primitives/nonce-provider/index.d.ts +1 -0
  55. package/dist/lib/components/ui/primitives/nonce-provider/nonce-provider.d.ts +20 -0
  56. package/dist/lib/components/ui/widgets/rich-text-editor/extensions/extensions.d.ts +2 -2
  57. package/dist/lib/components/ui/widgets/rich-text-editor/use-rich-text-editor.d.ts +17 -0
  58. package/dist/lib/hooks/index.d.ts +1 -0
  59. package/dist/lib/hooks/use-csp-nonce.d.ts +16 -0
  60. package/dist/lib/lib/index.d.ts +1 -0
  61. package/dist/lib/vite/index.d.ts +3 -2
  62. package/dist/lib.js +30 -29
  63. package/dist/main.js +16 -16
  64. package/dist/map.js +1 -1
  65. package/dist/material.css +25 -1
  66. package/dist/{mermaid.core-BWF4Tq7X.js → mermaid.core-CW8DO1T1.js} +21 -21
  67. package/dist/{mindmap-definition-NLK3R4M7-Q-4J7KMu.js → mindmap-definition-NLK3R4M7-DJcCg9PL.js} +2 -2
  68. package/dist/{pieDiagram-5QR66LMP-BIxQ164y.js → pieDiagram-5QR66LMP-b_dHXzkV.js} +1 -1
  69. package/dist/{quadrantDiagram-O4NWA36T-BlI0otnv.js → quadrantDiagram-O4NWA36T-BSqAcBs7.js} +1 -1
  70. package/dist/{requirementDiagram-PLB6GJNP-CuVPUh0S.js → requirementDiagram-PLB6GJNP-BcxkmIFp.js} +2 -2
  71. package/dist/{sankeyDiagram-IPEJSGJF-Cke5i_9w.js → sankeyDiagram-IPEJSGJF-aD5r_n1q.js} +1 -1
  72. package/dist/{stateDiagram-v2-GCMORJYK-CT53U-pL.js → stateDiagram-v2-GCMORJYK-Ct9ylaoP.js} +2 -2
  73. package/dist/{swimlanes-2SLR337P-BwEtm09G.js → swimlanes-2SLR337P-BwCqwEoR.js} +3 -3
  74. package/dist/{swimlanesDiagram-TC7HE7FX-36JXV6X2.js → swimlanesDiagram-TC7HE7FX-WxBGUt0w.js} +3 -3
  75. package/dist/{timeline-definition-EJHVYXUP-BeX-S1oM.js → timeline-definition-EJHVYXUP-5Q8GU13Q.js} +1 -1
  76. package/dist/{use-heading-spy--7KHY3lw.js → use-heading-spy-wlOv87q3.js} +63 -57
  77. package/dist/{usecaseDiagram-POWQR4AR-Dfd0rXLr.js → usecaseDiagram-POWQR4AR-CzGOd4ic.js} +2 -2
  78. package/dist/vite.js +2 -2
  79. package/dist/{xychartDiagram-PMCCYNJV-D0UPPflL.js → xychartDiagram-PMCCYNJV-Bh_1zZoW.js} +1 -1
  80. package/docs/README.md +1 -0
  81. package/docs/components/data-display.md +5 -0
  82. package/docs/components/form-fields.md +14 -0
  83. package/docs/components/primitives.md +31 -0
  84. package/docs/getting-started.md +5 -1
  85. package/docs/guides/csp.md +408 -0
  86. package/docs/guides/helpers.md +2 -0
  87. package/docs/guides/theming.md +27 -0
  88. package/docs/roadmap.md +17 -1
  89. package/docs/troubleshooting.md +139 -0
  90. package/lib/components/components.css +13 -2
  91. package/lib/components/ui/feedback/spinner/spinner.css +28 -0
  92. package/lib/components/ui/fields/otp-field/input-otp.css +48 -0
  93. package/lib/components/ui/media/pdf-viewer/pdf-viewer.css +24 -0
  94. package/lib/components/ui/overlays/drawer/vaul-drawer.css +199 -0
  95. package/lib/components/ui/overlays/drawer/vaul-keyframes.css +95 -0
  96. package/package.json +4 -4
@@ -6,12 +6,12 @@ import "./chunk-MBY4JIJT-BFIqOe-8.js";
6
6
  import "./chunk-7PRAP22T-0C6_H8Li.js";
7
7
  import "./chunk-7INBJB4K-k-I67NSP.js";
8
8
  import "./chunk-5DYCD2WN-Cd1zazNp.js";
9
- import "./chunk-Z7XXMR3K-D4uKosJW.js";
9
+ import "./chunk-Z7XXMR3K-BzO1efzA.js";
10
10
  import "./chunk-GWA4HPMP-B8jXI0Tl.js";
11
11
  import "./chunk-XXDRQBXY-dKXxu_aj.js";
12
12
  import "./chunk-WEXAMYUT-CbFOhEve.js";
13
13
  import "./chunk-UA2S7LBM-ChuksCDg.js";
14
- import "./chunk-GNY47TPC-DiVMvIit.js";
14
+ import "./chunk-GNY47TPC-CGgBmY0O.js";
15
15
  import "./chunk-LNGE3PJU-DJjGTS7O.js";
16
- import { n as e } from "./chunk-7M6MHVWA-BQ0cJz5u.js";
16
+ import { n as e } from "./chunk-7M6MHVWA-Uf-8NCRF.js";
17
17
  export { e as diagram };
@@ -1,5 +1,5 @@
1
1
  import { a as e, t } from "./rolldown-runtime-BFFgcFxR.js";
2
- import { $ as n, G as r, H as i, J as a, K as o, Q as s, U as c, W as l, X as u, Y as d, Z as f, et as p, lt as m, nt as h, q as g, rt as _, tt as v, ut as y } from "./components-C-y3kTRm.js";
2
+ import { $ as n, G as r, H as i, J as a, K as o, Q as s, U as c, W as l, X as u, Y as d, Z as f, et as p, lt as m, nt as h, q as g, rt as _, tt as v, ut as y } from "./components-qTUjhFuo.js";
3
3
  import { a as b, c as x, g as S, h as C, l as w, m as T, o as E } from "./string-BqyOfyFV.js";
4
4
  import { i as D, n as O, t as k } from "./src-CsLQInsN.js";
5
5
  import { g as A } from "./chunk-ZIGJFQKS-9VXArDKF.js";
package/dist/hooks.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { r as e } from "./i18n-provider-D5hkauu6.js";
2
- import { i as t, n, o as r, r as i, s as a, t as o } from "./use-heading-spy--7KHY3lw.js";
3
- import { L as s, t as c } from "./number.utils-BiBN2hWJ.js";
4
- import { useCallback as l, useMemo as u } from "react";
5
- import { useNavigate as d, useSearchParams as f } from "react-router";
6
- import { createFormatters as p } from "@nxgt/material-core/print-format";
2
+ import { l as t, n, o as r, r as i, s as a, t as o, u as s } from "./use-heading-spy-wlOv87q3.js";
3
+ import { L as c, t as l } from "./number.utils-BiBN2hWJ.js";
4
+ import { useCallback as u, useMemo as d } from "react";
5
+ import { useNavigate as f, useSearchParams as p } from "react-router";
6
+ import { createFormatters as m } from "@nxgt/material-core/print-format";
7
7
  //#region lib/hooks/use-allowed-transitions.ts
8
- function m(e, t, n) {
8
+ function h(e, t, n) {
9
9
  return (t[e] || []).map((e) => {
10
10
  let t = n[e];
11
11
  return t ? {
@@ -16,18 +16,18 @@ function m(e, t, n) {
16
16
  }
17
17
  //#endregion
18
18
  //#region lib/hooks/use-formatters.ts
19
- function h(t = {}) {
19
+ function g(t = {}) {
20
20
  let n = e(), r = t.locale ?? n?.language ?? "en", { timeZone: i } = t;
21
- return u(() => p({
21
+ return d(() => m({
22
22
  locale: r,
23
23
  timeZone: i
24
24
  }), [r, i]);
25
25
  }
26
26
  //#endregion
27
27
  //#region lib/hooks/use-navigation.ts
28
- function g(e, t) {
29
- let n = d();
30
- return l(() => {
28
+ function _(e, t) {
29
+ let n = f();
30
+ return u(() => {
31
31
  n(e, t);
32
32
  }, [
33
33
  n,
@@ -35,21 +35,21 @@ function g(e, t) {
35
35
  t
36
36
  ]);
37
37
  }
38
- function _(e) {
39
- let t = d();
40
- return u(() => e.map(({ to: e, options: n }) => () => {
38
+ function v(e) {
39
+ let t = f();
40
+ return d(() => e.map(({ to: e, options: n }) => () => {
41
41
  t(e, n);
42
42
  }), [t, e]);
43
43
  }
44
44
  //#endregion
45
45
  //#region lib/hooks/use-number-formatter.ts
46
- function v() {
47
- let t = e(), n = l((e, n) => c(e, {
46
+ function y() {
47
+ let t = e(), n = u((e, n) => l(e, {
48
48
  ...n,
49
49
  language: t?.language
50
50
  }), [t?.language]);
51
51
  return {
52
- formatCurrency: l((e, t) => n(e, {
52
+ formatCurrency: u((e, t) => n(e, {
53
53
  ...t,
54
54
  currency: t?.currency,
55
55
  style: t?.currency ? "currency" : void 0
@@ -59,7 +59,7 @@ function v() {
59
59
  }
60
60
  //#endregion
61
61
  //#region lib/hooks/use-options.ts
62
- function y(e, { filter: t, value: n, label: r, expanded: i }) {
62
+ function b(e, { filter: t, value: n, label: r, expanded: i }) {
63
63
  return e.filter((e) => e && (t?.(e) ?? !0)).map((e) => {
64
64
  let t = typeof n == "function" ? n(e) : e[n]?.toString() ?? "", a = "";
65
65
  return a = typeof r == "function" ? r(e) : Array.isArray(r) ? r.map((t) => e[t]).filter(Boolean).join(" ") : e[r]?.toString() ?? "", {
@@ -69,9 +69,9 @@ function y(e, { filter: t, value: n, label: r, expanded: i }) {
69
69
  };
70
70
  });
71
71
  }
72
- function b(e, t) {
72
+ function x(e, t) {
73
73
  let { filter: n, value: r, label: i, expanded: a } = t;
74
- return u(() => y(e, {
74
+ return d(() => b(e, {
75
75
  filter: n,
76
76
  value: r,
77
77
  label: i,
@@ -84,14 +84,14 @@ function b(e, t) {
84
84
  a
85
85
  ]);
86
86
  }
87
- function x(e) {
87
+ function S(e) {
88
88
  return e?.edges?.map((e) => e.node) ?? [];
89
89
  }
90
90
  //#endregion
91
91
  //#region lib/hooks/use-search-param.ts
92
- function S(e) {
93
- let [t, n] = f();
94
- return u(() => t.get(e), [t, e]);
92
+ function C(e) {
93
+ let [t, n] = p();
94
+ return d(() => t.get(e), [t, e]);
95
95
  }
96
96
  //#endregion
97
- export { r as applyResolvedTheme, y as buildOptions, x as extractNode, a as resolveTheme, m as useAllowedTransitions, h as useFormatters, o as useHeadingSpy, s as useIsClient, i as useIsMobile, n as useLocalizedDate, g as useNavigationHandler, _ as useNavigationHandlers, v as useNumberFormatter, b as useOptions, S as useSearchParam, t as useTheme };
97
+ export { t as applyResolvedTheme, b as buildOptions, S as extractNode, s as resolveTheme, h as useAllowedTransitions, r as useCspNonce, g as useFormatters, o as useHeadingSpy, c as useIsClient, i as useIsMobile, n as useLocalizedDate, _ as useNavigationHandler, v as useNavigationHandlers, y as useNumberFormatter, x as useOptions, C as useSearchParam, a as useTheme };
@@ -1,4 +1,4 @@
1
- import { ct as e } from "./components-C-y3kTRm.js";
1
+ import { ct as e } from "./components-qTUjhFuo.js";
2
2
  import { t } from "./src-CsLQInsN.js";
3
3
  import { n } from "./chunk-Y2CYZVJY-BAad7w_K.js";
4
4
  import { H as r, U as i, a, c as o, q as s, v as c, w as l, x as u, y as d } from "./chunk-O7XYJQB3-BChweQ_V.js";
@@ -2,7 +2,11 @@ import { default as z } from 'zod';
2
2
  import { MaterialLocaleKey } from '../../../../../i18n/types';
3
3
  import { TFormValues } from './types';
4
4
  export declare const ATTRIBUTE_TYPES: readonly ["COLOR", "DATE", "DATETIME", "MULTI_SELECT", "NUMBER", "RICH_TEXT", "SELECT", "STRING", "TEXT", "TIME"];
5
- export declare const schema: z.ZodObject<{
5
+ /**
6
+ * The attribute form's schema, built on the first call (inside `AttributeForm`'s
7
+ * render), never when the module loads: see `openingHoursSchema`.
8
+ */
9
+ export declare const attributeFormSchema: () => z.ZodObject<{
6
10
  defaultValue: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
7
11
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
12
  priority: z.ZodOptional<z.ZodNullable<z.ZodCoercedNumber<unknown>>>;
@@ -1,3 +1,3 @@
1
1
  import { z } from 'zod';
2
- import { schema } from './consts';
3
- export type TFormValues = z.infer<typeof schema>;
2
+ import { attributeFormSchema } from './consts';
3
+ export type TFormValues = z.infer<ReturnType<typeof attributeFormSchema>>;
@@ -1,11 +1,22 @@
1
1
  import { default as z } from 'zod';
2
2
  import { MaterialLocaleKey } from '../../../../i18n/types';
3
- export declare const OpeningHoursSchema: z.ZodObject<{
3
+ /**
4
+ * The schema of one opening hour: `dayOfWeek` `0`-`6` (coerced from a
5
+ * string), `openTime` and `closeTime` as `HH:mm`, `isClosed`. Built on the
6
+ * first call, then the same schema: nothing is built when the module loads,
7
+ * so an app under a strict CSP can call `z.config({ jitless: true })` first.
8
+ */
9
+ export declare const openingHoursSchema: () => z.ZodObject<{
4
10
  openTime: z.ZodOptional<z.ZodString>;
5
11
  closeTime: z.ZodOptional<z.ZodString>;
6
12
  isClosed: z.ZodOptional<z.ZodBoolean>;
7
13
  dayOfWeek: z.ZodCoercedNumber<unknown>;
8
14
  }, z.core.$strip>;
15
+ /**
16
+ * @deprecated Use `openingHoursSchema()`; removed in 3.0. Built on its first
17
+ * use, and behaves as the schema the factory returns (not the same object).
18
+ */
19
+ export declare const OpeningHoursSchema: ReturnType<typeof openingHoursSchema>;
9
20
  /** English fallback for every `material.opening-hours.days.*` key. */
10
21
  export declare const DAY_OF_WEEK_FALLBACKS: readonly ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
11
22
  /**
@@ -0,0 +1,6 @@
1
+ import { ImageCropAspectId } from './types';
2
+ /** The aspect picker of `ImageCropper`: free, then the fixed ratios. */
3
+ export declare function ImageCropAspects({ value, onChange, }: {
4
+ value: ImageCropAspectId;
5
+ onChange: (value: ImageCropAspectId) => void;
6
+ }): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { RefObject } from 'react';
2
+ import { CropSize } from './crop-resize-handles';
3
+ /** The frame's client size, kept current by a `ResizeObserver`. */
4
+ export declare function useFrameSize(frameRef: RefObject<HTMLDivElement | null>): CropSize | null;
@@ -10,6 +10,7 @@ export * from './input';
10
10
  export * from './input-group';
11
11
  export * from './kbd';
12
12
  export * from './label';
13
+ export * from './nonce-provider';
13
14
  export * from './scroll-area';
14
15
  export * from './separator';
15
16
  export * from './table';
@@ -0,0 +1 @@
1
+ export * from './nonce-provider';
@@ -0,0 +1,20 @@
1
+ import { ReactNode } from 'react';
2
+ export type NonceProviderProps = {
3
+ /**
4
+ * This request's Content Security Policy nonce: the one in the
5
+ * `style-src-elem 'nonce-…'` directive, and the one given to
6
+ * `renderToPipeableStream({ nonce })`. Empty or `undefined`, the nearest
7
+ * outer `NonceProvider`'s nonce carries on.
8
+ */
9
+ nonce: string | undefined;
10
+ children?: ReactNode;
11
+ };
12
+ /**
13
+ * Gives the page's CSP nonce to every component below: the `<style>`
14
+ * elements of `ScrollArea` and `Select`, and the styles `RichTextEditor`
15
+ * injects (`useCspNonce`). On the client it also
16
+ * keeps it for the code that runs outside React (`setCspNonce`), which the
17
+ * modals' scroll lock reads. Render it once, at the root, on the server and
18
+ * on the client, with the same nonce.
19
+ */
20
+ export declare function NonceProvider({ nonce, children }: NonceProviderProps): import("react").JSX.Element;
@@ -18,7 +18,7 @@ export interface BuildExtensionsParams {
18
18
  */
19
19
  translate?: SlashCommandTranslate;
20
20
  }
21
- export declare const extensions: ({ mentionSuggestionsRef, hasMentions, placeholder, characterLimit, features, translate, }: BuildExtensionsParams) => (import('@tiptap/core').Node<any, any> | import('@tiptap/core').Extension<{
21
+ export declare const extensions: ({ mentionSuggestionsRef, hasMentions, placeholder, characterLimit, features, translate, }: BuildExtensionsParams) => (import('@tiptap/core').Node<import('@tiptap/extension-table').TableOptions, any> | import('@tiptap/core').Node<any, any> | import('@tiptap/core').Extension<{
22
22
  features?: RichTextEditorFeatures;
23
23
  translate?: SlashCommandTranslate;
24
- }, any> | import('@tiptap/core').Node<import('@tiptap/extension-table').TableOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-table').TableCellOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extension-text-style').TextStyleKitOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extension-text-style').FontFamilyOptions, any> | import('@tiptap/core').Extension<import('@tiptap/starter-kit').StarterKitOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extension-typography').TypographyOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extensions').FocusOptions, any> | import('@tiptap/core').Mark<import('@tiptap/extension-highlight').HighlightOptions, any> | import('@tiptap/core').Mark<import('@tiptap/extension-subscript').SubscriptExtensionOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extension-text-align').TextAlignOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extensions').PlaceholderOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extensions').CharacterCountOptions, import('@tiptap/extensions').CharacterCountStorage> | import('@tiptap/core').Node<import('@tiptap/extension-list').TaskListOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-list').TaskItemOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-image').ImageOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-youtube').YoutubeOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-emoji').EmojiOptions, import('@tiptap/extension-emoji').EmojiStorage> | import('@tiptap/core').Node<import('@tiptap/extension-code-block-lowlight').CodeBlockLowlightOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-mention').MentionOptions<any, import('@tiptap/extension-mention').MentionNodeAttrs>, any>)[];
24
+ }, any> | import('@tiptap/core').Node<import('@tiptap/extension-table').TableCellOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extension-text-style').TextStyleKitOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extension-text-style').FontFamilyOptions, any> | import('@tiptap/core').Extension<import('@tiptap/starter-kit').StarterKitOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extension-typography').TypographyOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extensions').FocusOptions, any> | import('@tiptap/core').Mark<import('@tiptap/extension-highlight').HighlightOptions, any> | import('@tiptap/core').Mark<import('@tiptap/extension-subscript').SubscriptExtensionOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extension-text-align').TextAlignOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extensions').PlaceholderOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extensions').CharacterCountOptions, import('@tiptap/extensions').CharacterCountStorage> | import('@tiptap/core').Node<import('@tiptap/extension-list').TaskListOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-list').TaskItemOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-image').ImageOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-youtube').YoutubeOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-emoji').EmojiOptions, import('@tiptap/extension-emoji').EmojiStorage> | import('@tiptap/core').Node<import('@tiptap/extension-code-block-lowlight').CodeBlockLowlightOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-mention').MentionOptions<any, import('@tiptap/extension-mention').MentionNodeAttrs>, any>)[];
@@ -0,0 +1,17 @@
1
+ import { Editor, UseEditorOptions } from '@tiptap/react';
2
+ import { RichTextEditorOptions } from './types';
3
+ export type UseRichTextEditorArgs = {
4
+ options?: RichTextEditorOptions;
5
+ label?: unknown;
6
+ required?: boolean;
7
+ editable?: boolean;
8
+ placeholder?: string;
9
+ characterLimit?: number;
10
+ content?: UseEditorOptions['content'];
11
+ editorOptions: Omit<UseEditorOptions, 'extensions' | 'editorProps'>;
12
+ };
13
+ /** The TipTap editor of `RichTextEditor`, with the refs that feed it. */
14
+ export declare function useRichTextEditor({ options, label, required, editable, placeholder, characterLimit, content, editorOptions, }: UseRichTextEditorArgs): {
15
+ editor: Editor;
16
+ labelId: string;
17
+ };
@@ -1,5 +1,6 @@
1
1
  export * from './resolve-theme';
2
2
  export * from './use-allowed-transitions';
3
+ export { useCspNonce } from './use-csp-nonce';
3
4
  export * from './use-formatters';
4
5
  export * from './use-heading-spy';
5
6
  export * from './use-is-client';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The page's CSP nonce, given by `NonceProvider`. Internal: read it with
3
+ * `useCspNonce`.
4
+ */
5
+ export declare const CspNonceContext: import('react').Context<string | undefined>;
6
+ /** How many `NonceProvider`s enclose a component. Internal. */
7
+ export declare const CspNonceDepthContext: import('react').Context<number>;
8
+ /**
9
+ * The CSP nonce of the nearest `NonceProvider`, for a `<style>` (or
10
+ * `<script>`) a component renders: `<style nonce={useCspNonce()}>`.
11
+ *
12
+ * `undefined` outside a `NonceProvider`. It never reads the page during
13
+ * render, so the server and the client render the same attribute; code that
14
+ * runs in an effect can fall back to `getCspNonce()` (from `/lib`).
15
+ */
16
+ export declare function useCspNonce(): string | undefined;
@@ -1,3 +1,4 @@
1
+ export { getCspNonce, setCspNonce } from '@nxgt/material-core/csp-nonce';
1
2
  export { createFormatters, type DateInput, type FormatAmountOptions, type FormatDateOptions, type Formatters, type FormattersOptions, formatAmount, formatDate, } from '@nxgt/material-core/print-format';
2
3
  export * from './array.utils';
3
4
  export * from './build-field-options';
@@ -2,6 +2,7 @@
2
2
  * Build-time helpers for the apps that consume this library: Node code that
3
3
  * runs inside a consumer's `vite.config.ts`. The one copy lives in
4
4
  * `@nxgt/material-core/vite`, shared with the sister library; this entry keeps
5
- * the subpath consumers already import. See `pdfkitStandardFonts` there.
5
+ * the subpath consumers already import. See `pdfkitStandardFonts` and
6
+ * `cspAssetsInlineLimit` there.
6
7
  */
7
- export { pdfkitStandardFonts } from '@nxgt/material-core/vite';
8
+ export { cspAssetsInlineLimit, pdfkitStandardFonts, } from '@nxgt/material-core/vite';
package/dist/lib.js CHANGED
@@ -1,34 +1,35 @@
1
1
  import { t as e } from "./utils-DC8bw9A_.js";
2
2
  import { a as t, i as n, t as r } from "./stored-language-g121Yv0w.js";
3
3
  import { i, r as a, v as o } from "./translator-BMFC0lBV.js";
4
- import { _ as s, a as c, c as l, d as u, f as d, g as f, h as p, i as m, l as ee, m as te, n as ne, o as re, p as h, r as g, s as _, t as v, u as y } from "./async-slice-TBZ6Taw2.js";
5
- import { n as b, r as x, t as S } from "./number.utils-BiBN2hWJ.js";
6
- import { useCallback as C } from "react";
7
- import { createSlice as w } from "@reduxjs/toolkit";
8
- import { createFormatters as T, formatAmount as E, formatDate as D } from "@nxgt/material-core/print-format";
9
- import { invalidFormatMessage as O, sizeMessage as k } from "@nxgt/material-core/zod-issue-messages";
4
+ import { _ as s, a as c, c as l, d as u, f as d, g as ee, h as te, i as ne, l as re, m as ie, n as ae, o as oe, p as f, r as p, s as m, t as h, u as g } from "./async-slice-TBZ6Taw2.js";
5
+ import { n as _, r as v, t as y } from "./number.utils-BiBN2hWJ.js";
6
+ import { useCallback as b } from "react";
7
+ import { getCspNonce as x, setCspNonce as S } from "@nxgt/material-core/csp-nonce";
8
+ import { createSlice as C } from "@reduxjs/toolkit";
9
+ import { createFormatters as w, formatAmount as T, formatDate as E } from "@nxgt/material-core/print-format";
10
+ import { invalidFormatMessage as D, sizeMessage as O } from "@nxgt/material-core/zod-issue-messages";
10
11
  //#region lib/lib/array.utils.ts
11
- function A(e) {
12
+ function k(e) {
12
13
  return Array.from(new Set(e));
13
14
  }
14
- function j(e, t, n) {
15
+ function A(e, t, n) {
15
16
  return e.find((e) => e[t] === n);
16
17
  }
17
- function M(e, t, n) {
18
+ function j(e, t, n) {
18
19
  return e.filter((e) => n.includes(e[t]));
19
20
  }
20
- function N(e, t) {
21
+ function M(e, t) {
21
22
  return {
22
- findByKey: C((n) => j(e, t, n), [e, t]),
23
- findByKeyIn: C((n) => M(e, t, n), [e, t])
23
+ findByKey: b((n) => A(e, t, n), [e, t]),
24
+ findByKeyIn: b((n) => j(e, t, n), [e, t])
24
25
  };
25
26
  }
26
- function P(e) {
27
- return N(e, "id");
27
+ function N(e) {
28
+ return M(e, "id");
28
29
  }
29
30
  //#endregion
30
31
  //#region lib/lib/build-field-options.ts
31
- function ie(e, { valueKey: t, label: n }) {
32
+ function P(e, { valueKey: t, label: n }) {
32
33
  return e.map((e) => ({
33
34
  value: i(e, t),
34
35
  label: typeof n == "function" ? n(e) : i(e, n)
@@ -45,7 +46,7 @@ function I(e, t) {
45
46
  function L(e) {
46
47
  let t = new FormData();
47
48
  return typeof e == "object" && Object.entries(e).forEach(([e, n]) => {
48
- f(n) || t.append(e, n);
49
+ ee(n) || t.append(e, n);
49
50
  }), t;
50
51
  }
51
52
  function R(e) {
@@ -84,7 +85,7 @@ function W(e) {
84
85
  //#endregion
85
86
  //#region lib/lib/redux/filter-slice.ts
86
87
  function G({ name: e, initialState: t, reducers: n = void 0, selectors: r = {} }) {
87
- return w({
88
+ return C({
88
89
  name: e,
89
90
  initialState: t,
90
91
  reducers: (e) => ({
@@ -108,7 +109,7 @@ function G({ name: e, initialState: t, reducers: n = void 0, selectors: r = {} }
108
109
  }
109
110
  //#endregion
110
111
  //#region lib/lib/redux/status-slice.ts
111
- var K = ({ name: e, initialState: t = { status: "idle" }, reducers: n = {}, selectors: r = {} }) => w({
112
+ var K = ({ name: e, initialState: t = { status: "idle" }, reducers: n = {}, selectors: r = {} }) => C({
112
113
  name: e,
113
114
  initialState: t,
114
115
  reducers: {
@@ -127,7 +128,7 @@ var K = ({ name: e, initialState: t = { status: "idle" }, reducers: n = {}, sele
127
128
  ...n
128
129
  },
129
130
  selectors: { ...r }
130
- }), q = ({ name: e, initialState: t, reducers: n = {}, selectors: r = {} }) => w({
131
+ }), q = ({ name: e, initialState: t, reducers: n = {}, selectors: r = {} }) => C({
131
132
  name: e,
132
133
  initialState: t,
133
134
  reducers: {
@@ -179,7 +180,7 @@ function X(e) {
179
180
  console.warn(`Failed to remove state for key "${e}":`, t);
180
181
  }
181
182
  }
182
- var ae = {
183
+ var se = {
183
184
  safeGetItem: J,
184
185
  safeSetItem: Y,
185
186
  safeRemoveItem: X
@@ -187,11 +188,11 @@ var ae = {
187
188
  isDirty: !1,
188
189
  step: 0,
189
190
  values: {}
190
- }, oe = ({ name: e, initialState: t, reducers: n = void 0, selectors: r = {} }) => {
191
+ }, ce = ({ name: e, initialState: t, reducers: n = void 0, selectors: r = {} }) => {
191
192
  let i = () => ({
192
193
  ...Z,
193
194
  values: t ?? Z.values
194
- }), a = w({
195
+ }), a = C({
195
196
  name: e,
196
197
  initialState: () => {
197
198
  if (typeof localStorage > "u") return i();
@@ -224,10 +225,10 @@ var ae = {
224
225
  }),
225
226
  selectors: { ...r }
226
227
  });
227
- return y(a, i), a;
228
- }, se = { colorFromVariable(e, t = 1) {
228
+ return g(a, i), a;
229
+ }, le = { colorFromVariable(e, t = 1) {
229
230
  return `rgb(from var(--${e}) r g b / ${t})`;
230
- } }, Q = (e, t) => typeof e == "function" ? e(t) : e, ce = (e, t = "files") => {
231
+ } }, ue = (e, t) => typeof e == "function" ? e(t) : e, Q = (e, t = "files") => {
231
232
  let n = new FormData();
232
233
  return (o(e) ? e.filter(Boolean) : [e]).forEach((e) => {
233
234
  n.append(t, e, e.name);
@@ -242,7 +243,7 @@ var ae = {
242
243
  if (Object.getPrototypeOf(e) !== Object.prototype && e.constructor) return e.constructor.name;
243
244
  }
244
245
  return t;
245
- }, le = ({ storageKey: e = n, language: i, translate: o = a } = {}) => {
246
+ }, de = ({ storageKey: e = n, language: i, translate: o = a } = {}) => {
246
247
  let s = () => typeof i == "function" ? i() : i ?? r(e, "en", t);
247
248
  return (e) => {
248
249
  let t = s(), n = (e, n) => o(e, n, t), r = (e, t) => {
@@ -259,11 +260,11 @@ var ae = {
259
260
  }
260
261
  case "invalid_value": return e.values.length === 1 ? n("material.zod.invalid_value_single", { value: e.values[0] }) : n("material.zod.invalid_value_multiple", { values: e.values.join(" | ") });
261
262
  case "too_big":
262
- case "too_small": return k(e, {
263
+ case "too_small": return O(e, {
263
264
  translate: n,
264
265
  lookup: r
265
266
  });
266
- case "invalid_format": return O(e, {
267
+ case "invalid_format": return D(e, {
267
268
  translate: n,
268
269
  lookup: r
269
270
  });
@@ -277,4 +278,4 @@ var ae = {
277
278
  };
278
279
  };
279
280
  //#endregion
280
- export { b as DATE_UTILS, ae as LOCALE_STORE_UTILS, u as STRING_UTILS, se as STYLES_UTILS, ie as buildFieldOptions, V as cast, H as castAsync, U as cleanObject, g as clientOnly, e as cn, ce as convertToFormData, v as createAsyncSlice, T as createFormatters, G as createSliceWithFilter, K as createStatusSlice, q as createStatusesSlice, oe as createStepFormSlice, W as delay, d as enumToKebabCase, j as findByKey, M as findByKeyIn, R as formDataToObject, E as formatAmount, D as formatDate, x as formatDateRangeFilter, S as formatNumber, I as ifEmptyList, F as ifEmptyString, m as isExternalHref, h as joinTruthyParts, L as objectToFormData, B as omit, $ as parsedType, z as pick, Q as renderSlot, l as resolveSliceState, J as safeGetItem, X as safeRemoveItem, Y as safeSetItem, c as searchParam, re as searchParams, te as slugify, p as splitMatch, A as uniqueArray, ne as useActions, P as useFindById, N as useFindByKey, ee as useSliceReducer, _ as useSliceSelector, le as zodLocaleError };
281
+ export { _ as DATE_UTILS, se as LOCALE_STORE_UTILS, u as STRING_UTILS, le as STYLES_UTILS, P as buildFieldOptions, V as cast, H as castAsync, U as cleanObject, p as clientOnly, e as cn, Q as convertToFormData, h as createAsyncSlice, w as createFormatters, G as createSliceWithFilter, K as createStatusSlice, q as createStatusesSlice, ce as createStepFormSlice, W as delay, d as enumToKebabCase, A as findByKey, j as findByKeyIn, R as formDataToObject, T as formatAmount, E as formatDate, v as formatDateRangeFilter, y as formatNumber, x as getCspNonce, I as ifEmptyList, F as ifEmptyString, ne as isExternalHref, f as joinTruthyParts, L as objectToFormData, B as omit, $ as parsedType, z as pick, ue as renderSlot, l as resolveSliceState, J as safeGetItem, X as safeRemoveItem, Y as safeSetItem, c as searchParam, oe as searchParams, S as setCspNonce, ie as slugify, te as splitMatch, k as uniqueArray, ae as useActions, N as useFindById, M as useFindByKey, re as useSliceReducer, m as useSliceSelector, de as zodLocaleError };