@nxgt/material 3.6.0 → 3.7.1

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 (97) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +46 -1
  3. package/dist/{button-1Fornjtn.js → button--cF4gY14.js} +1 -1
  4. package/dist/charts.js +1 -1
  5. package/dist/{code-editor-DeZYlIO2.js → code-editor-0CdGwKDg.js} +3 -3
  6. package/dist/code-editor.js +3 -3
  7. package/dist/{code-language-items-Bb7afEj-.js → code-language-items-CGARRbVm.js} +1 -1
  8. package/dist/components/animations/scroll.css +1 -1
  9. package/dist/components/base-content.css +1 -1
  10. package/dist/components/base.css +1 -1
  11. package/dist/components/components.css +2 -0
  12. package/dist/components/editor-field-expressive.css +5 -0
  13. package/dist/components/editor-prose.css +1 -1
  14. package/dist/components/theme-tokens.css +17 -4
  15. package/dist/components/ui/display/period-cards/period-cards.css +2 -2
  16. package/dist/components/ui/media/pdf-viewer/pdf-viewer.css +1 -1
  17. package/dist/components/ui/widgets/drawing/drawing-animate.css +123 -0
  18. package/dist/components/ui/widgets/drawing/drawing.css +459 -0
  19. package/dist/{components-BCYZgeoV.js → components-bYGPzyKd.js} +761 -761
  20. package/dist/components.js +18 -18
  21. package/dist/{dialog-JQT6iETD.js → dialog-DdJ1C4BR.js} +168 -168
  22. package/dist/dnd.js +1 -1
  23. package/dist/draw-animate.js +106 -0
  24. package/dist/draw-png.js +2 -0
  25. package/dist/draw-sketch.js +38 -0
  26. package/dist/draw.js +65 -0
  27. package/dist/drawing-B8VuG7nx.js +390 -0
  28. package/dist/drawing-context-CeKeZE6b.js +10 -0
  29. package/dist/{dropdown-menu-DiZvX4tG.js → dropdown-menu-DWtgUVW7.js} +1 -1
  30. package/dist/editor-viewer.js +1 -1
  31. package/dist/editor.js +120 -120
  32. package/dist/{empty-state-Cpvsmk0R.js → empty-state-CRWLQ1sM.js} +2 -2
  33. package/dist/{icon-badge-C30yKsAM.js → icon-badge-Bb5-73XP.js} +18 -18
  34. package/dist/{icon-button-BXlI3DJ_.js → icon-button-5A6Mrj6w.js} +60 -90
  35. package/dist/lib/components/ui/display/shape/use-shape-morph.d.ts +1 -0
  36. package/dist/lib/components/ui/widgets/drawing/drawing-a11y.d.ts +20 -0
  37. package/dist/lib/components/ui/widgets/drawing/drawing-context.d.ts +23 -0
  38. package/dist/lib/components/ui/widgets/drawing/drawing-types.d.ts +63 -0
  39. package/dist/lib/components/ui/widgets/drawing/drawing.d.ts +17 -0
  40. package/dist/lib/components/ui/widgets/drawing/index.d.ts +5 -0
  41. package/dist/lib/components/ui/widgets/drawing/partials/drawing-root.d.ts +17 -0
  42. package/dist/lib/components/ui/widgets/drawing/partials/interactive-node.d.ts +22 -0
  43. package/dist/lib/components/ui/widgets/drawing/partials/primitives/content.d.ts +20 -0
  44. package/dist/lib/components/ui/widgets/drawing/partials/primitives/path.d.ts +29 -0
  45. package/dist/lib/components/ui/widgets/drawing/partials/primitives/primitive.d.ts +19 -0
  46. package/dist/lib/components/ui/widgets/drawing/partials/primitives/shapes.d.ts +18 -0
  47. package/dist/lib/components/ui/widgets/drawing/partials/react-attrs.d.ts +5 -0
  48. package/dist/lib/components/ui/widgets/drawing/partials/ring.d.ts +9 -0
  49. package/dist/lib/components/ui/widgets/drawing/partials/svg-tree.d.ts +29 -0
  50. package/dist/lib/components/ui/widgets/drawing/use-exact-text.d.ts +16 -0
  51. package/dist/lib/draw/index.d.ts +32 -0
  52. package/dist/lib/draw-animate/index.d.ts +19 -0
  53. package/dist/lib/draw-animate/morph-drawing.d.ts +32 -0
  54. package/dist/lib/draw-animate/reduced-motion.d.ts +2 -0
  55. package/dist/lib/draw-animate/use-drawing-controls.d.ts +27 -0
  56. package/dist/lib/draw-animate/use-scene-morph.d.ts +15 -0
  57. package/dist/lib/draw-png/index.d.ts +11 -0
  58. package/dist/lib/draw-sketch/index.d.ts +17 -0
  59. package/dist/lib/draw-sketch/sketch.d.ts +19 -0
  60. package/dist/lib/print/components/print-drawing.d.ts +16 -0
  61. package/dist/lib/print/index.d.ts +2 -1
  62. package/dist/main.js +23 -23
  63. package/dist/map.js +63 -63
  64. package/dist/material.css +1 -1
  65. package/dist/pdf-reader.js +1 -1
  66. package/dist/print.js +123 -115
  67. package/dist/{public-Cde8_SN8.js → public-SsiazLEv.js} +743 -743
  68. package/dist/{render-json-BwJX1jZ2.js → render-json-DyFYFIkZ.js} +1 -1
  69. package/dist/{rich-code-block-yxMXBuGd.js → rich-code-block-CwNwQs5z.js} +3 -3
  70. package/dist/{rich-text-viewer-Bq-2vTVm.js → rich-text-viewer-LO1IZCWs.js} +1 -1
  71. package/dist/{sortable-provider-DYlpq8lP.js → sortable-provider-BvD98s8Y.js} +19 -19
  72. package/dist/{spinner-D-FE_mTW.js → spinner-CtGCPza-.js} +4 -4
  73. package/dist/styles.css +1 -0
  74. package/dist/{toolbar-items-DnkS3bDY.js → toolbar-items-DsDDD5AY.js} +1 -1
  75. package/dist/{use-chat-composer-BwpSgP_D.js → use-chat-composer-DZ01a16D.js} +923 -922
  76. package/dist/use-shape-morph-BKA_R5P5.js +35 -0
  77. package/docs/README.md +1 -0
  78. package/docs/components/rich-widgets.md +196 -0
  79. package/docs/guides/drawing.md +499 -0
  80. package/docs/guides/printing.md +47 -0
  81. package/docs/guides/theming.md +3 -2
  82. package/docs/previews/rich-widgets-drawing.webp +0 -0
  83. package/docs/roadmap.md +17 -0
  84. package/docs/troubleshooting.md +145 -1
  85. package/lib/components/animations/scroll.css +1 -1
  86. package/lib/components/base-content.css +1 -1
  87. package/lib/components/base.css +1 -1
  88. package/lib/components/components.css +2 -0
  89. package/lib/components/editor-field-expressive.css +5 -0
  90. package/lib/components/editor-prose.css +1 -1
  91. package/lib/components/theme-tokens.css +17 -4
  92. package/lib/components/ui/display/period-cards/period-cards.css +2 -2
  93. package/lib/components/ui/media/pdf-viewer/pdf-viewer.css +1 -1
  94. package/lib/components/ui/widgets/drawing/drawing-animate.css +123 -0
  95. package/lib/components/ui/widgets/drawing/drawing.css +459 -0
  96. package/lib/styles.css +1 -0
  97. package/package.json +22 -2
package/dist/map.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { t as e } from "./utils-Bcd2Z3ea.js";
2
- import { t } from "./icon-button-BXlI3DJ_.js";
3
- import { t as n } from "./tooltip-tmFoTU_d.js";
4
- import { c as r, n as i, o as a, r as o, s, t as c, u as l } from "./dialog-JQT6iETD.js";
5
- import { i as u, n as d, r as f, t as p } from "./hover-card-D5iHS9q1.js";
6
- import { t as m } from "./use-material-translation-hLQzOjF0.js";
7
- import { t as h } from "./button-1Fornjtn.js";
2
+ import { t } from "./tooltip-tmFoTU_d.js";
3
+ import { c as n, n as r, o as i, r as a, s as o, t as s, u as c } from "./dialog-DdJ1C4BR.js";
4
+ import { i as l, n as u, r as d, t as f } from "./hover-card-D5iHS9q1.js";
5
+ import { t as p } from "./use-material-translation-hLQzOjF0.js";
6
+ import { t as m } from "./button--cF4gY14.js";
7
+ import { t as h } from "./icon-button-5A6Mrj6w.js";
8
8
  import { r as g, t as _ } from "./field-blur-DFUazxsL.js";
9
- import { n as v, t as y } from "./icon-badge-C30yKsAM.js";
9
+ import { n as v, t as y } from "./icon-badge-Bb5-73XP.js";
10
10
  import { MapIcon as b, MapPin as x, Minus as S, Plus as C } from "lucide-react";
11
11
  import { useCallback as w, useEffect as T, useEffectEvent as E, useMemo as D, useRef as O, useState as k } from "react";
12
12
  import { jsx as A, jsxs as j } from "react/jsx-runtime";
@@ -95,7 +95,7 @@ function J({ className: t, children: n, showMinicardControl: r = !0, zoom: i = 1
95
95
  attribution: "© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors",
96
96
  url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
97
97
  }),
98
- /* @__PURE__ */ A(u, {
98
+ /* @__PURE__ */ A(l, {
99
99
  visible: r,
100
100
  children: /* @__PURE__ */ A(q, {
101
101
  position: "topright",
@@ -109,7 +109,7 @@ function J({ className: t, children: n, showMinicardControl: r = !0, zoom: i = 1
109
109
  }
110
110
  //#endregion
111
111
  //#region lib/map/components/partials/marker.tsx
112
- function Y({ title: e, position: t, onChange: r, draggable: i, children: a, tooltip: o, reference: s, icon: c, ...l }) {
112
+ function Y({ title: e, position: n, onChange: r, draggable: i, children: a, tooltip: o, reference: s, icon: c, ...l }) {
113
113
  let u = R({ viewreset() {
114
114
  s && r?.(u.getCenter());
115
115
  } }), d = O(null), f = D(() => ({ dragend() {
@@ -119,15 +119,15 @@ function Y({ title: e, position: t, onChange: r, draggable: i, children: a, tool
119
119
  s && u.flyTo(e, u.getZoom());
120
120
  });
121
121
  return T(() => {
122
- p(t);
123
- }, [t]), /* @__PURE__ */ A(H, {
122
+ p(n);
123
+ }, [n]), /* @__PURE__ */ A(H, {
124
124
  ...l,
125
125
  title: e ?? (typeof o == "string" ? o : void 0),
126
126
  draggable: i,
127
127
  eventHandlers: f,
128
- position: t,
128
+ position: n,
129
129
  ref: d,
130
- icon: o ? /* @__PURE__ */ A(n, {
130
+ icon: o ? /* @__PURE__ */ A(t, {
131
131
  content: o,
132
132
  children: c ?? /* @__PURE__ */ A(X, {})
133
133
  }) : c ?? /* @__PURE__ */ A(X, {}),
@@ -143,27 +143,27 @@ function X() {
143
143
  }
144
144
  //#endregion
145
145
  //#region lib/map/components/partials/location-preview.tsx
146
- function Z({ name: e, position: n, children: r }) {
146
+ function Z({ name: e, position: t, children: n }) {
147
147
  "use no memo";
148
- let { t: i } = m(), [a, o] = k(!1);
149
- return /* @__PURE__ */ j(p, {
150
- open: a,
151
- onOpenChange: o,
152
- children: [/* @__PURE__ */ A(f, {
148
+ let { t: r } = p(), [i, a] = k(!1);
149
+ return /* @__PURE__ */ j(f, {
150
+ open: i,
151
+ onOpenChange: a,
152
+ children: [/* @__PURE__ */ A(d, {
153
153
  asChild: !0,
154
- children: r ?? /* @__PURE__ */ A(t, {
154
+ children: n ?? /* @__PURE__ */ A(h, {
155
155
  variant: "tonal",
156
156
  "data-pw": `${e ?? "location"}-preview`,
157
157
  color: "info",
158
- "aria-label": e ? i("material.map.preview-named", "Preview {name}", { name: e }) : i("material.map.preview", "Preview location"),
158
+ "aria-label": e ? r("material.map.preview-named", "Preview {name}", { name: e }) : r("material.map.preview", "Preview location"),
159
159
  children: /* @__PURE__ */ A(b, {})
160
160
  })
161
- }), /* @__PURE__ */ A(d, {
161
+ }), /* @__PURE__ */ A(u, {
162
162
  className: "aspect-square",
163
163
  children: /* @__PURE__ */ A(J, {
164
- center: n,
164
+ center: t,
165
165
  showMinicardControl: !1,
166
- children: /* @__PURE__ */ A(Y, { position: n })
166
+ children: /* @__PURE__ */ A(Y, { position: t })
167
167
  })
168
168
  })]
169
169
  });
@@ -171,48 +171,48 @@ function Z({ name: e, position: n, children: r }) {
171
171
  //#endregion
172
172
  //#region lib/map/components/location-field.tsx
173
173
  var Q = [5.44087, 10.06843];
174
- function $({ value: n, onChange: u, dialogTitle: d, closeLabel: f, mapClassName: p, placeholder: g, ..._ }) {
175
- let { t: y } = m(), b = d ?? y("material.location-field.dialog-title", "Choose a location"), S = O(null), C = w((e) => {
174
+ function $({ value: t, onChange: l, dialogTitle: u, closeLabel: d, mapClassName: f, placeholder: g, ..._ }) {
175
+ let { t: y } = p(), b = u ?? y("material.location-field.dialog-title", "Choose a location"), S = O(null), C = w((e) => {
176
176
  if (e) {
177
177
  let t = [parseFloat(e.lat.toFixed(7)), parseFloat(e.lng.toFixed(7))];
178
- S.current = t, u?.(t);
178
+ S.current = t, l?.(t);
179
179
  }
180
- }, [u]), [T, E] = k(!1), D = n ?? Q, M = !_.disabled && !_.readOnly, N = w(() => {
181
- !n && M && u?.(S.current ?? Q), E(!1);
180
+ }, [l]), [T, E] = k(!1), D = t ?? Q, M = !_.disabled && !_.readOnly, N = w(() => {
181
+ !t && M && l?.(S.current ?? Q), E(!1);
182
182
  }, [
183
- n,
183
+ t,
184
184
  M,
185
- u
185
+ l
186
186
  ]);
187
187
  return /* @__PURE__ */ A(v, {
188
188
  ..._,
189
- value: n ? n.join(" - ") : "",
189
+ value: t ? t.join(" - ") : "",
190
190
  placeholder: g ?? y("material.location-field.placeholder", "No location selected"),
191
- leading: n ? /* @__PURE__ */ A(Z, {
192
- position: n,
191
+ leading: t ? /* @__PURE__ */ A(Z, {
192
+ position: t,
193
193
  children: _.leading
194
194
  }) : _.leading,
195
- trailing: /* @__PURE__ */ j(c, {
195
+ trailing: /* @__PURE__ */ j(s, {
196
196
  open: T,
197
197
  onOpenChange: E,
198
- children: [/* @__PURE__ */ A(a, {
198
+ children: [/* @__PURE__ */ A(i, {
199
199
  asChild: !0,
200
- children: _.trailing ?? /* @__PURE__ */ A(t, {
200
+ children: _.trailing ?? /* @__PURE__ */ A(h, {
201
201
  "data-pw": `${_.name}-trailing`,
202
202
  variant: "tonal",
203
203
  "aria-label": typeof b == "string" ? b : void 0,
204
204
  children: /* @__PURE__ */ A(x, {})
205
205
  })
206
- }), /* @__PURE__ */ j(o, { children: [
207
- /* @__PURE__ */ A(i, {
206
+ }), /* @__PURE__ */ j(a, { children: [
207
+ /* @__PURE__ */ A(r, {
208
208
  variant: "tonal",
209
209
  color: "primary"
210
210
  }),
211
- /* @__PURE__ */ A(l, { children: b }),
212
- /* @__PURE__ */ A(s, { hidden: !0 }),
211
+ /* @__PURE__ */ A(c, { children: b }),
212
+ /* @__PURE__ */ A(o, { hidden: !0 }),
213
213
  /* @__PURE__ */ A(J, {
214
214
  center: D,
215
- className: e(p),
215
+ className: e(f),
216
216
  children: /* @__PURE__ */ A(Y, {
217
217
  position: D,
218
218
  onChange: C,
@@ -220,9 +220,9 @@ function $({ value: n, onChange: u, dialogTitle: d, closeLabel: f, mapClassName:
220
220
  reference: M
221
221
  })
222
222
  }),
223
- /* @__PURE__ */ A(r, { children: /* @__PURE__ */ A(h, {
223
+ /* @__PURE__ */ A(n, { children: /* @__PURE__ */ A(m, {
224
224
  onClick: N,
225
- children: f ?? y("material.location-field.confirm", "OK")
225
+ children: d ?? y("material.location-field.confirm", "OK")
226
226
  }) })
227
227
  ] })]
228
228
  })
@@ -253,7 +253,7 @@ function ee({ control: e, name: t, ...n }) {
253
253
  //#endregion
254
254
  //#region lib/map/components/partials/location-marker.tsx
255
255
  function te({ ...e }) {
256
- let { t } = m(), { coords: n } = W(), r = I();
256
+ let { t } = p(), { coords: n } = W(), r = I();
257
257
  return T(() => {
258
258
  n && r.flyTo([n.latitude, n.longitude], r.getZoom());
259
259
  }, [
@@ -273,29 +273,29 @@ function te({ ...e }) {
273
273
  }
274
274
  //#endregion
275
275
  //#region lib/map/components/partials/map-actions.tsx
276
- function ne({ position: n = "topleft", className: r, ...i }) {
277
- let { t: a } = m(), o = I(), { coords: s } = W(), c = w(() => {
278
- o.setView(o.getCenter(), o.getZoom() + 1, { animate: !0 });
279
- }, [o]), l = w(() => {
280
- o.setView(o.getCenter(), Math.max(o.getZoom() - 1, 0), { animate: !0 });
281
- }, [o]);
276
+ function ne({ position: t = "topleft", className: n, ...r }) {
277
+ let { t: i } = p(), a = I(), { coords: o } = W(), s = w(() => {
278
+ a.setView(a.getCenter(), a.getZoom() + 1, { animate: !0 });
279
+ }, [a]), c = w(() => {
280
+ a.setView(a.getCenter(), Math.max(a.getZoom() - 1, 0), { animate: !0 });
281
+ }, [a]);
282
282
  return T(() => {
283
- s && o.setView([s.latitude, s.longitude], o.getZoom());
284
- }, [s, o]), /* @__PURE__ */ A("div", {
285
- className: e(U[n], "border-primary"),
283
+ o && a.setView([o.latitude, o.longitude], a.getZoom());
284
+ }, [o, a]), /* @__PURE__ */ A("div", {
285
+ className: e(U[t], "border-primary"),
286
286
  children: /* @__PURE__ */ A("div", {
287
287
  className: "leaflet-control leaflet-bar border-primary",
288
288
  children: /* @__PURE__ */ j("div", {
289
- className: e("grid gap-1 p-0.5 bg-paper rounded *:z-[300]", r),
290
- ...i,
291
- children: [/* @__PURE__ */ A(t, {
292
- "aria-label": a("material.map.zoom-in", "Zoom in"),
293
- onClick: c,
289
+ className: e("grid gap-1 p-0.5 bg-paper rounded *:z-[300]", n),
290
+ ...r,
291
+ children: [/* @__PURE__ */ A(h, {
292
+ "aria-label": i("material.map.zoom-in", "Zoom in"),
293
+ onClick: s,
294
294
  children: /* @__PURE__ */ A(C, {})
295
- }), /* @__PURE__ */ A(t, {
296
- "aria-label": a("material.map.zoom-out", "Zoom out"),
297
- disabled: o.getZoom() === 0,
298
- onClick: l,
295
+ }), /* @__PURE__ */ A(h, {
296
+ "aria-label": i("material.map.zoom-out", "Zoom out"),
297
+ disabled: a.getZoom() === 0,
298
+ onClick: c,
299
299
  children: /* @__PURE__ */ A(S, {})
300
300
  })]
301
301
  })