@nxgt/material-vue 0.32.0 → 0.33.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 (68) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +19 -6
  3. package/dist/{camera-DlWK0PLP.js → camera-B063QUeM.js} +1 -1
  4. package/dist/components/components.css +3 -1
  5. package/dist/components/ui/fields/otp-field/input-otp.css +48 -0
  6. package/dist/{components-Dqg7KwA2.js → components-CmIOfRO4.js} +12866 -16805
  7. package/dist/components.js +8 -8
  8. package/dist/composables.js +24 -24
  9. package/dist/fonts/katex/KaTeX_AMS-Regular.woff2 +0 -0
  10. package/dist/fonts/katex/KaTeX_Caligraphic-Bold.woff2 +0 -0
  11. package/dist/fonts/katex/KaTeX_Caligraphic-Regular.woff2 +0 -0
  12. package/dist/fonts/katex/KaTeX_Fraktur-Bold.woff2 +0 -0
  13. package/dist/fonts/katex/KaTeX_Fraktur-Regular.woff2 +0 -0
  14. package/dist/fonts/katex/KaTeX_Main-Bold.woff2 +0 -0
  15. package/dist/fonts/katex/KaTeX_Main-BoldItalic.woff2 +0 -0
  16. package/dist/fonts/katex/KaTeX_Main-Italic.woff2 +0 -0
  17. package/dist/fonts/katex/KaTeX_Main-Regular.woff2 +0 -0
  18. package/dist/fonts/katex/KaTeX_Math-BoldItalic.woff2 +0 -0
  19. package/dist/fonts/katex/KaTeX_Math-Italic.woff2 +0 -0
  20. package/dist/fonts/katex/KaTeX_SansSerif-Bold.woff2 +0 -0
  21. package/dist/fonts/katex/KaTeX_SansSerif-Italic.woff2 +0 -0
  22. package/dist/fonts/katex/KaTeX_SansSerif-Regular.woff2 +0 -0
  23. package/dist/fonts/katex/KaTeX_Script-Regular.woff2 +0 -0
  24. package/dist/fonts/katex/KaTeX_Size1-Regular.woff2 +0 -0
  25. package/dist/fonts/katex/KaTeX_Size2-Regular.woff2 +0 -0
  26. package/dist/fonts/katex/KaTeX_Size3-Regular.woff2 +0 -0
  27. package/dist/fonts/katex/KaTeX_Size4-Regular.woff2 +0 -0
  28. package/dist/fonts/katex/KaTeX_Typewriter-Regular.woff2 +0 -0
  29. package/dist/{form-scope-btEYYnGW.js → form-scope-DuDx5Jyx.js} +1 -1
  30. package/dist/lib/components/ui/fields/attributes/form-schema.d.ts +11 -2
  31. package/dist/lib/components/ui/fields/opening-hours/consts.d.ts +12 -1
  32. package/dist/lib/components/ui/primitives/index.d.ts +1 -0
  33. package/dist/lib/components/ui/primitives/nonce-provider/index.d.ts +2 -0
  34. package/dist/lib/components/ui/primitives/nonce-provider/nonce-provider.vue.d.ts +20 -0
  35. package/dist/lib/composables/index.d.ts +1 -0
  36. package/dist/lib/composables/use-csp-nonce.d.ts +18 -0
  37. package/dist/lib/lib/index.d.ts +1 -0
  38. package/dist/lib/nuxt/auto-imports.d.ts +1 -1
  39. package/dist/lib/nuxt/component-names.d.ts +1 -1
  40. package/dist/lib/vite/index.d.ts +3 -2
  41. package/dist/lib.js +48 -47
  42. package/dist/main.js +17 -17
  43. package/dist/material-vue.css +1 -1
  44. package/dist/{pdf-outline-sidebar-DchMD-_k.js → pdf-outline-sidebar-CzY59j_Y.js} +1 -1
  45. package/dist/{pdf-page-list-Cta0S89W.js → pdf-page-list-BMxNOnPk.js} +2 -2
  46. package/dist/{pdf-page-D-kDQq5h.js → pdf-page-nM_fvTHh.js} +1 -1
  47. package/dist/{pdf-reader-BwWozoIQ.js → pdf-reader-Dpv3oWe1.js} +48 -45
  48. package/dist/{pdf-sidebar-B0Addf1P.js → pdf-sidebar-DkefUgWg.js} +2 -2
  49. package/dist/{pdf-thumbnail-sidebar-Dsptq4fb.js → pdf-thumbnail-sidebar-I6i1lv5J.js} +2 -2
  50. package/dist/{stx-player-Bpnir1KO.js → stx-player-CN7Ic8tP.js} +13 -13
  51. package/dist/{use-heading-spy-Czi_Xv3u.js → use-heading-spy-DimKb49j.js} +53 -45
  52. package/dist/vite.js +2 -2
  53. package/docs/README.md +1 -0
  54. package/docs/components/data-display.md +5 -0
  55. package/docs/components/form-fields.md +23 -0
  56. package/docs/components/primitives.md +41 -0
  57. package/docs/getting-started.md +5 -1
  58. package/docs/guides/csp.md +420 -0
  59. package/docs/guides/helpers.md +2 -0
  60. package/docs/guides/theming.md +27 -0
  61. package/docs/roadmap.md +17 -0
  62. package/docs/troubleshooting.md +139 -0
  63. package/lib/components/components.css +3 -1
  64. package/lib/components/ui/fields/otp-field/input-otp.css +48 -0
  65. package/lib/nuxt/auto-imports.ts +1 -0
  66. package/lib/nuxt/component-names.ts +1 -0
  67. package/lib/vite/index.ts +6 -2
  68. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  import { n as e } from "./rolldown-runtime-CWhphoD1.js";
2
2
  import { t } from "./utils-CykWQ0iJ.js";
3
- import { Ef as n } from "./components-Dqg7KwA2.js";
3
+ import { kf as n } from "./components-CmIOfRO4.js";
4
4
  import { t as r } from "./use-material-translation-CaHS6oZz.js";
5
5
  import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, defineComponent as u, normalizeClass as d, normalizeStyle as f, openBlock as p, ref as m, renderList as h, toDisplayString as g, unref as _, withCtx as v } from "vue";
6
6
  //#region lib/components/ui/media/pdf-viewer/partials/pdf-outline-row.vue?vue&type=script&setup=true&lang.ts
@@ -1,6 +1,6 @@
1
1
  import { n as e } from "./rolldown-runtime-CWhphoD1.js";
2
- import { Ef as t } from "./components-Dqg7KwA2.js";
3
- import { t as n } from "./pdf-page-D-kDQq5h.js";
2
+ import { kf as t } from "./components-CmIOfRO4.js";
3
+ import { t as n } from "./pdf-page-nM_fvTHh.js";
4
4
  import { Fragment as r, createBlock as i, createElementBlock as a, createElementVNode as o, defineComponent as s, openBlock as c, renderList as l, withCtx as u } from "vue";
5
5
  //#region lib/components/ui/media/pdf-viewer/partials/pdf-page-list.vue?vue&type=script&setup=true&lang.ts
6
6
  var d = { class: "flex flex-col items-center gap-4 px-4 py-4" }, f = /*@__PURE__*/ s({
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./utils-CykWQ0iJ.js";
2
- import { kp as t } from "./components-Dqg7KwA2.js";
2
+ import { Mp as t } from "./components-CmIOfRO4.js";
3
3
  import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, nextTick as c, normalizeClass as l, normalizeStyle as u, onBeforeUnmount as d, openBlock as f, ref as p, shallowRef as m, unref as h, watch as g } from "vue";
4
4
  import { DEFAULT_PAGE_SIZE as _, escapeHtml as v, findTextMatches as y, highlightItemHtml as b, placeholderSize as x, rotatedSize as S } from "@nxgt/material-core/pdf-viewer";
5
5
  //#region lib/components/ui/media/pdf-viewer/pdf-note-icons.ts
@@ -1,11 +1,11 @@
1
1
  import { t as e } from "./utils-CykWQ0iJ.js";
2
- import { On as t } from "./components-Dqg7KwA2.js";
2
+ import { kn as t } from "./components-CmIOfRO4.js";
3
3
  import { t as n } from "./use-material-translation-CaHS6oZz.js";
4
4
  import { t as r } from "./Button-DEA5W6O3.js";
5
5
  import { o as i } from "./HoverCardTrigger-CjSteFgk.js";
6
- import { n as a } from "./pdf-page-D-kDQq5h.js";
7
- import { t as o } from "./pdf-page-list-Cta0S89W.js";
8
- import { t as s } from "./pdf-sidebar-B0Addf1P.js";
6
+ import { n as a } from "./pdf-page-nM_fvTHh.js";
7
+ import { t as o } from "./pdf-page-list-BMxNOnPk.js";
8
+ import { t as s } from "./pdf-sidebar-DkefUgWg.js";
9
9
  import { t as c } from "./pdf-toolbar-Da6UMt1O.js";
10
10
  import { computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, nextTick as _, normalizeClass as v, onBeforeUnmount as y, onMounted as b, openBlock as x, reactive as S, ref as C, shallowRef as w, toDisplayString as T, toRef as E, unref as D, useId as O, watch as k, withCtx as A } from "vue";
11
11
  import { AlertCircle as j, FileX2 as M, KeyRound as N, Loader2 as P } from "@lucide/vue";
@@ -89,7 +89,16 @@ function Z({ pdf: e, goToPage: t, externalLinkTarget: n }) {
89
89
  }
90
90
  //#endregion
91
91
  //#region lib/components/ui/media/pdf-viewer/use-pdf-document.ts
92
- function re(e, t) {
92
+ function re(e, t, n) {
93
+ let r = e.getDocument({
94
+ ...t,
95
+ isEvalSupported: !1
96
+ });
97
+ return r.onPassword = (t, i) => {
98
+ n(t, i === e.PasswordResponses.INCORRECT_PASSWORD) || r.destroy();
99
+ }, r;
100
+ }
101
+ function ie(e, t) {
93
102
  let n = w(null), r = w(null), i = 0, o = null;
94
103
  function s() {
95
104
  o?.destroy(), o = null, r.value = null, n.value?.destroy(), n.value = null;
@@ -102,16 +111,10 @@ function re(e, t) {
102
111
  if (c !== i) return;
103
112
  let l = await I(e.value);
104
113
  if (c !== i) return;
105
- let u = s.getDocument(l);
106
- o = u, u.onPassword = (e, n) => {
107
- if (c !== i) {
108
- u.destroy();
109
- return;
110
- }
111
- r.value = (t) => {
112
- r.value = null, e(t);
113
- }, t.onPasswordProtected(n === s.PasswordResponses.INCORRECT_PASSWORD);
114
- };
114
+ let u = re(s, l, (e, n) => c === i ? (r.value = (t) => {
115
+ r.value = null, e(t);
116
+ }, t.onPasswordProtected(n), !0) : !1);
117
+ o = u;
115
118
  let d = await u.promise;
116
119
  if (o === u && (o = null), c !== i) {
117
120
  d.destroy();
@@ -132,24 +135,24 @@ function re(e, t) {
132
135
  }
133
136
  //#endregion
134
137
  //#region lib/components/ui/media/pdf-viewer/partials/pdf-error-state.vue?vue&type=script&setup=true&lang.ts
135
- var ie = { class: "absolute inset-0 flex flex-col items-center justify-center gap-3 text-muted-foreground" }, ae = { class: "text-sm font-medium" }, oe = { class: "max-w-xs text-center text-xs opacity-60" }, se = /* @__PURE__ */ g({
138
+ var ae = { class: "absolute inset-0 flex flex-col items-center justify-center gap-3 text-muted-foreground" }, oe = { class: "text-sm font-medium" }, se = { class: "max-w-xs text-center text-xs opacity-60" }, ce = /* @__PURE__ */ g({
136
139
  __name: "pdf-error-state",
137
140
  props: { message: {} },
138
141
  setup(e) {
139
142
  let { t } = n();
140
- return (n, r) => (x(), f("div", ie, [
143
+ return (n, r) => (x(), f("div", ae, [
141
144
  h(D(j), { class: "size-10 text-error opacity-70" }),
142
- p("p", ae, T(D(t)("material.pdf-reader.error", "Failed to load document")), 1),
143
- p("p", oe, T(e.message), 1)
145
+ p("p", oe, T(D(t)("material.pdf-reader.error", "Failed to load document")), 1),
146
+ p("p", se, T(e.message), 1)
144
147
  ]));
145
148
  }
146
- }), ce = { class: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-background/80 backdrop-blur-sm" }, le = { class: "text-sm text-muted-foreground" }, ue = /* @__PURE__ */ g({
149
+ }), le = { class: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-background/80 backdrop-blur-sm" }, ue = { class: "text-sm text-muted-foreground" }, de = /* @__PURE__ */ g({
147
150
  __name: "pdf-loading-overlay",
148
151
  setup(e) {
149
152
  let { t } = n();
150
- return (e, n) => (x(), f("div", ce, [h(D(P), { class: "size-8 animate-spin text-primary" }), p("p", le, T(D(t)("material.pdf-reader.loading", "Loading document…")), 1)]));
153
+ return (e, n) => (x(), f("div", le, [h(D(P), { class: "size-8 animate-spin text-primary" }), p("p", ue, T(D(t)("material.pdf-reader.loading", "Loading document…")), 1)]));
151
154
  }
152
- }), de = { class: "absolute inset-0 flex flex-col items-center justify-center gap-4" }, fe = { class: "text-sm font-semibold" }, Q = ["id"], pe = /* @__PURE__ */ g({
155
+ }), fe = { class: "absolute inset-0 flex flex-col items-center justify-center gap-4" }, pe = { class: "text-sm font-semibold" }, me = ["id"], he = /* @__PURE__ */ g({
153
156
  __name: "pdf-password-form",
154
157
  props: {
155
158
  modelValue: {},
@@ -164,9 +167,9 @@ var ie = { class: "absolute inset-0 flex flex-col items-center justify-center ga
164
167
  function u(e) {
165
168
  e.key === "Enter" && o("submit");
166
169
  }
167
- return (t, n) => (x(), f("div", de, [
170
+ return (t, n) => (x(), f("div", fe, [
168
171
  h(D(N), { class: "size-10 text-primary opacity-70" }),
169
- p("p", fe, T(D(s)("material.pdf-reader.password", "Password protected")), 1),
172
+ p("p", pe, T(D(s)("material.pdf-reader.password", "Password protected")), 1),
170
173
  p("div", {
171
174
  ref_key: "fields",
172
175
  ref: l,
@@ -201,10 +204,10 @@ var ie = { class: "absolute inset-0 flex flex-col items-center justify-center ga
201
204
  id: D(c),
202
205
  role: "alert",
203
206
  class: "text-sm text-error-text"
204
- }, T(D(s)("material.pdf-reader.password-incorrect", "Incorrect password. Try again.")), 9, Q)) : d("", !0)
207
+ }, T(D(s)("material.pdf-reader.password-incorrect", "Incorrect password. Try again.")), 9, me)) : d("", !0)
205
208
  ]));
206
209
  }
207
- }), me = { class: "flex min-h-0 flex-1" }, he = /* @__PURE__ */ g({
210
+ }), ge = { class: "flex min-h-0 flex-1" }, _e = /* @__PURE__ */ g({
208
211
  __name: "pdf-reader-body",
209
212
  props: {
210
213
  file: {},
@@ -226,7 +229,7 @@ var ie = { class: "absolute inset-0 flex flex-col items-center justify-center ga
226
229
  "documentChange"
227
230
  ],
228
231
  setup(e, { emit: t }) {
229
- let n = e, r = t, i = C(""), { pdf: a, resolvePassword: c } = re(E(n, "file"), {
232
+ let n = e, r = t, i = C(""), { pdf: a, resolvePassword: c } = ie(E(n, "file"), {
230
233
  onLoadSuccess: (e) => r("loadSuccess", e),
231
234
  onLoadError: (e) => r("loadError", e),
232
235
  onPasswordProtected: (e) => r("passwordProtected", e),
@@ -250,7 +253,7 @@ var ie = { class: "absolute inset-0 flex flex-col items-center justify-center ga
250
253
  goToPage: (e) => r("goToPage", e),
251
254
  externalLinkTarget: n.externalLinkTarget
252
255
  }) : null);
253
- return (t, n) => (x(), f("div", me, [e.state.sidebarOpen && e.state.numPages > 0 && D(a) ? (x(), u(s, {
256
+ return (t, n) => (x(), f("div", ge, [e.state.sidebarOpen && e.state.numPages > 0 && D(a) ? (x(), u(s, {
254
257
  key: 0,
255
258
  pdf: D(a),
256
259
  tab: e.state.sidebarTab,
@@ -274,12 +277,12 @@ var ie = { class: "absolute inset-0 flex flex-col items-center justify-center ga
274
277
  ref: m,
275
278
  class: "relative min-w-0 flex-1 overflow-hidden"
276
279
  }, [
277
- e.state.isLoading ? (x(), u(ue, { key: 0 })) : d("", !0),
278
- e.state.error && !e.state.isPasswordProtected ? (x(), u(se, {
280
+ e.state.isLoading ? (x(), u(de, { key: 0 })) : d("", !0),
281
+ e.state.error && !e.state.isPasswordProtected ? (x(), u(ce, {
279
282
  key: 1,
280
283
  message: e.state.error
281
284
  }, null, 8, ["message"])) : d("", !0),
282
- e.state.isPasswordProtected ? (x(), u(pe, {
285
+ e.state.isPasswordProtected ? (x(), u(he, {
283
286
  key: 2,
284
287
  modelValue: i.value,
285
288
  "onUpdate:modelValue": n[2] ||= (e) => i.value = e,
@@ -317,7 +320,7 @@ var ie = { class: "absolute inset-0 flex flex-col items-center justify-center ga
317
320
  });
318
321
  //#endregion
319
322
  //#region lib/components/ui/media/pdf-viewer/use-pdf-file-actions.ts
320
- function ge(e, t) {
323
+ function ve(e, t) {
321
324
  let { t: r } = n(), i = () => t.value?.getData();
322
325
  return {
323
326
  download() {
@@ -334,8 +337,8 @@ function ge(e, t) {
334
337
  }
335
338
  //#endregion
336
339
  //#region lib/components/ui/media/pdf-viewer/use-pdf-scroll-spy.ts
337
- var _e = 2e3;
338
- function ve(e) {
340
+ var ye = 2e3;
341
+ function Q(e) {
339
342
  let t = C(!1), n = 0, r = null, i = () => {}, a = 0;
340
343
  return k(e.numPages, (e) => {
341
344
  e > 0 || (i(), t.value = !1, n = 0);
@@ -355,7 +358,7 @@ function ve(e) {
355
358
  d();
356
359
  return;
357
360
  }
358
- let f = setTimeout(d, _e);
361
+ let f = setTimeout(d, ye);
359
362
  u(() => clearTimeout(f));
360
363
  }, { flush: "post" }), k(t, (t, o, s) => {
361
364
  if (!t) return;
@@ -382,7 +385,7 @@ var $ = {
382
385
  texts: [],
383
386
  matches: []
384
387
  };
385
- function ye(e, t, n = 150) {
388
+ function be(e, t, n = 150) {
386
389
  let r = w($);
387
390
  return k([e, t], ([e, t], i, a) => {
388
391
  if (r.value = $, !e || !t.trim()) return;
@@ -398,8 +401,8 @@ function ye(e, t, n = 150) {
398
401
  }
399
402
  //#endregion
400
403
  //#region lib/components/ui/media/pdf-viewer/use-pdf-search-hits.ts
401
- function be(e) {
402
- let t = ye(e.pdf, e.query), n = C(-1);
404
+ function xe(e) {
405
+ let t = be(e.pdf, e.query), n = C(-1);
403
406
  k([e.pdf, e.query], () => {
404
407
  n.value = -1;
405
408
  });
@@ -436,7 +439,7 @@ function be(e) {
436
439
  }
437
440
  //#endregion
438
441
  //#region lib/components/ui/media/pdf-viewer/pdf-reader.vue?vue&type=script&setup=true&lang.ts
439
- var xe = ["aria-label"], Se = /* @__PURE__ */ g({
442
+ var Se = ["aria-label"], Ce = /* @__PURE__ */ g({
440
443
  name: "PdfReader",
441
444
  __name: "pdf-reader",
442
445
  props: {
@@ -473,14 +476,14 @@ var xe = ["aria-label"], Se = /* @__PURE__ */ g({
473
476
  onPageChange: (e) => a.onPageChange ? a.onPageChange(e) : o("pageChange", e),
474
477
  onLoadSuccess: (e) => a.onLoadSuccess ? a.onLoadSuccess(e) : o("loadSuccess", e),
475
478
  onLoadError: (e) => a.onLoadError ? a.onLoadError(e) : o("loadError", e)
476
- }), { state: _, computedScale: S, actions: T, handlers: E } = g, O = ve({
479
+ }), { state: _, computedScale: S, actions: T, handlers: E } = g, O = Q({
477
480
  containerRef: g.containerRef,
478
481
  pageRefs: d,
479
482
  currentPage: () => _.currentPage,
480
483
  numPages: () => _.numPages,
481
484
  sizesKnown: () => _.containerHeight !== void 0 && (_.pageSizes?.length ?? 0) >= _.currentPage - 1,
482
485
  goToPage: T.goToPage
483
- }), { hits: k, highlight: A } = be({
486
+ }), { hits: k, highlight: A } = xe({
484
487
  pdf: p,
485
488
  query: () => _.searchQuery,
486
489
  goToPage: T.goToPage,
@@ -513,7 +516,7 @@ var xe = ["aria-label"], Se = /* @__PURE__ */ g({
513
516
  }
514
517
  });
515
518
  }
516
- let { download: F, print: I } = ge(a, p);
519
+ let { download: F, print: I } = ve(a, p);
517
520
  return (t, n) => r.file ? (x(), f("div", {
518
521
  key: 1,
519
522
  ref_key: "wrapperRef",
@@ -565,7 +568,7 @@ var xe = ["aria-label"], Se = /* @__PURE__ */ g({
565
568
  "onSearchChange",
566
569
  "onSearchOpenChange",
567
570
  "onToggleNightMode"
568
- ]), h(he, {
571
+ ]), h(_e, {
569
572
  file: r.file,
570
573
  state: D(_),
571
574
  "effective-scale": D(S),
@@ -595,11 +598,11 @@ var xe = ["aria-label"], Se = /* @__PURE__ */ g({
595
598
  "onSetOutline",
596
599
  "onSetSidebarTab",
597
600
  "onGoToPage"
598
- ])], 42, xe)) : (x(), u(J, {
601
+ ])], 42, Se)) : (x(), u(J, {
599
602
  key: 0,
600
603
  class: v(a.class)
601
604
  }, null, 8, ["class"]));
602
605
  }
603
606
  });
604
607
  //#endregion
605
- export { Se as default };
608
+ export { Ce as default };
@@ -1,8 +1,8 @@
1
1
  import { n as e } from "./rolldown-runtime-CWhphoD1.js";
2
2
  import { t } from "./utils-CykWQ0iJ.js";
3
3
  import { t as n } from "./use-material-translation-CaHS6oZz.js";
4
- import { t as r } from "./pdf-outline-sidebar-DchMD-_k.js";
5
- import { t as i } from "./pdf-thumbnail-sidebar-Dsptq4fb.js";
4
+ import { t as r } from "./pdf-outline-sidebar-CzY59j_Y.js";
5
+ import { t as i } from "./pdf-thumbnail-sidebar-I6i1lv5J.js";
6
6
  import { createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, toDisplayString as d, unref as f, useId as p, useTemplateRef as m } from "vue";
7
7
  //#region lib/components/ui/media/pdf-viewer/partials/pdf-sidebar.vue?vue&type=script&setup=true&lang.ts
8
8
  var h = ["aria-label"], g = ["aria-label"], _ = [
@@ -1,8 +1,8 @@
1
1
  import { n as e } from "./rolldown-runtime-CWhphoD1.js";
2
2
  import { t } from "./utils-CykWQ0iJ.js";
3
- import { Ef as n } from "./components-Dqg7KwA2.js";
3
+ import { kf as n } from "./components-CmIOfRO4.js";
4
4
  import { t as r } from "./use-material-translation-CaHS6oZz.js";
5
- import { t as i } from "./pdf-page-D-kDQq5h.js";
5
+ import { t as i } from "./pdf-page-nM_fvTHh.js";
6
6
  import { Fragment as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, openBlock as f, renderList as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
7
7
  //#region lib/components/ui/media/pdf-viewer/partials/pdf-thumbnail-sidebar.vue?vue&type=script&setup=true&lang.ts
8
8
  var _ = ["aria-label"], v = {
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./utils-CykWQ0iJ.js";
2
- import { $t as t, Jt as n, Mp as r, Qt as i, Yt as a, Zt as o, en as s, qt as c } from "./components-Dqg7KwA2.js";
2
+ import { $t as t, Fp as n, Jt as r, Qt as i, Xt as a, Yt as o, en as s, tn as c } from "./components-CmIOfRO4.js";
3
3
  import { t as l } from "./use-material-translation-CaHS6oZz.js";
4
4
  import { createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, normalizeClass as _, openBlock as v, toDisplayString as y, unref as b, withCtx as x } from "vue";
5
5
  //#region lib/components/ui/media/stx-player/partials/stx-player-frame.vue?vue&type=script&setup=true&lang.ts
@@ -20,49 +20,49 @@ var S = ["data-layout", "aria-label"], C = {
20
20
  ] }
21
21
  },
22
22
  setup(a) {
23
- let { containerRef: g, state: w } = s();
23
+ let { containerRef: g, state: w } = c();
24
24
  function T(e) {
25
25
  g.value = e instanceof HTMLElement ? e : null;
26
26
  }
27
27
  let { t: E } = l();
28
- return (s, l) => (v(), f("section", {
28
+ return (c, l) => (v(), f("section", {
29
29
  ref: T,
30
30
  "data-slot": "stx-player",
31
31
  "data-layout": a.layout,
32
32
  "aria-label": b(w).current?.title ?? b(E)("material.stx-player.label", "Media player"),
33
- class: _(b(e)("@container rounded outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50", s.$props.class))
34
- }, [a.layout === "mini" ? (v(), u(o, { key: 0 })) : (v(), f("div", {
33
+ class: _(b(e)("@container rounded outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50", c.$props.class))
34
+ }, [a.layout === "mini" ? (v(), u(i, { key: 0 })) : (v(), f("div", {
35
35
  key: 1,
36
36
  class: _(b(e)("grid gap-3", a.showQueue && "@min-[768px]:grid-cols-[minmax(0,1fr)_18rem] @min-[768px]:items-stretch"))
37
37
  }, [p("div", { class: _(b(e)("bg-card overflow-hidden rounded border", b(w).current?.kind === "audio" && "flex flex-col gap-4 p-6")) }, [
38
- b(w).current?.kind === "audio" ? (v(), f("div", C, [h(r, { variant: "title-medium" }, {
38
+ b(w).current?.kind === "audio" ? (v(), f("div", C, [h(n, { variant: "title-medium" }, {
39
39
  default: x(() => [m(y(b(w).current.title), 1)]),
40
40
  _: 1
41
- }), b(w).current.artist ? (v(), u(r, {
41
+ }), b(w).current.artist ? (v(), u(n, {
42
42
  key: 0,
43
43
  class: "text-muted-foreground"
44
44
  }, {
45
45
  default: x(() => [m(y(b(w).current.artist) + " " + y(b(w).current.album ? ` · ${b(w).current.album}` : ""), 1)]),
46
46
  _: 1
47
47
  })) : d("", !0)])) : d("", !0),
48
- h(c, null, {
49
- default: x(() => [b(w).current?.kind === "audio" ? d("", !0) : (v(), u(t, {
48
+ h(r, null, {
49
+ default: x(() => [b(w).current?.kind === "audio" ? d("", !0) : (v(), u(s, {
50
50
  key: 0,
51
51
  tone: "overlay"
52
52
  }, {
53
- trailing: x(() => [h(i, { tone: "overlay" })]),
53
+ trailing: x(() => [h(t, { tone: "overlay" })]),
54
54
  _: 1
55
55
  }))]),
56
56
  _: 1
57
57
  }),
58
- b(w).current?.kind === "audio" ? (v(), u(t, {
58
+ b(w).current?.kind === "audio" ? (v(), u(s, {
59
59
  key: 1,
60
60
  tone: "surface"
61
61
  }, {
62
- trailing: x(() => [h(i, { tone: "surface" })]),
62
+ trailing: x(() => [h(t, { tone: "surface" })]),
63
63
  _: 1
64
64
  })) : d("", !0)
65
- ], 2), a.showQueue ? (v(), u(n, {
65
+ ], 2), a.showQueue ? (v(), u(o, {
66
66
  key: 0,
67
67
  class: "min-h-72"
68
68
  })) : d("", !0)], 2))], 10, S));
@@ -1,28 +1,29 @@
1
1
  import { a as e } from "./i18n-provider-CiVi05fs.js";
2
2
  import { c as t, d as n, f as r, l as i, n as a, u as o } from "./number.utils-Cy1z6qI7.js";
3
- import { computed as s, getCurrentInstance as c, onMounted as l, ref as u, toValue as d } from "vue";
4
- import { useIntersectionObserver as f, useMediaQuery as p, useSSRWidth as m, useStorage as h } from "@vueuse/core";
3
+ import { computed as s, getCurrentInstance as c, inject as l, onMounted as u, ref as d, toValue as f } from "vue";
4
+ import { injectConfigProviderContext as p } from "reka-ui";
5
+ import { useIntersectionObserver as m, useMediaQuery as h, useSSRWidth as g, useStorage as _ } from "@vueuse/core";
5
6
  //#region lib/composables/resolve-theme.ts
6
- function g(e, t) {
7
+ function v(e, t) {
7
8
  let n = e === "light" || e === "dark" ? e : "system";
8
9
  return {
9
10
  theme: n === "system" ? t ? "dark" : "light" : n,
10
11
  preference: n
11
12
  };
12
13
  }
13
- function _(e) {
14
+ function y(e) {
14
15
  typeof document > "u" || (document.documentElement.classList.toggle("dark", e === "dark"), document.documentElement.style.colorScheme = e);
15
16
  }
16
17
  //#endregion
17
18
  //#region lib/composables/use-ssr-media-query.ts
18
- var v = 1024;
19
- function y(e) {
20
- return c() ? p(e, { ssrWidth: m() ?? v }) : p(e);
19
+ var b = 1024;
20
+ function x(e) {
21
+ return c() ? h(e, { ssrWidth: g() ?? b }) : h(e);
21
22
  }
22
23
  //#endregion
23
24
  //#region lib/composables/use-theme.ts
24
- function b() {
25
- let e = y("(prefers-color-scheme: dark)"), t = h("theme", null, void 0, { initOnMounted: !0 }), n = s(() => g(t.value, !!e.value));
25
+ function S() {
26
+ let e = x("(prefers-color-scheme: dark)"), t = _("theme", null, void 0, { initOnMounted: !0 }), n = s(() => v(t.value, !!e.value));
26
27
  return {
27
28
  get theme() {
28
29
  return n.value.theme;
@@ -31,19 +32,19 @@ function b() {
31
32
  return n.value.preference;
32
33
  },
33
34
  updateTheme: (n) => {
34
- n === "system" ? t.value = null : t.value = n, _(g(n === "system" ? void 0 : n, !!e.value).theme);
35
+ n === "system" ? t.value = null : t.value = n, y(v(n === "system" ? void 0 : n, !!e.value).theme);
35
36
  }
36
37
  };
37
38
  }
38
39
  //#endregion
39
40
  //#region lib/composables/use-mobile.ts
40
- var x = 768;
41
- function S() {
42
- return y(`(max-width: ${x - 1}px)`);
41
+ var C = 768;
42
+ function w() {
43
+ return x(`(max-width: ${C - 1}px)`);
43
44
  }
44
45
  //#endregion
45
46
  //#region ../../node_modules/date-fns/locale/fr/_lib/formatDistance.js
46
- var C = {
47
+ var T = {
47
48
  lessThanXSeconds: {
48
49
  one: "moins d’une seconde",
49
50
  other: "moins de {{count}} secondes"
@@ -105,10 +106,10 @@ var C = {
105
106
  one: "presqu’un an",
106
107
  other: "presque {{count}} ans"
107
108
  }
108
- }, w = (e, t, n) => {
109
- let r, i = C[e];
109
+ }, E = (e, t, n) => {
110
+ let r, i = T[e];
110
111
  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;
111
- }, T = {
112
+ }, D = {
112
113
  date: r({
113
114
  formats: {
114
115
  full: "EEEE d MMMM y",
@@ -136,18 +137,18 @@ var C = {
136
137
  },
137
138
  defaultWidth: "full"
138
139
  })
139
- }, E = {
140
+ }, O = {
140
141
  lastWeek: "eeee 'dernier à' p",
141
142
  yesterday: "'hier à' p",
142
143
  today: "'aujourd’hui à' p",
143
144
  tomorrow: "'demain à' p'",
144
145
  nextWeek: "eeee 'prochain à' p",
145
146
  other: "P"
146
- }, D = (e, t, n, r) => E[e], O = {
147
+ }, k = (e, t, n, r) => O[e], A = {
147
148
  narrow: ["av. J.-C", "ap. J.-C"],
148
149
  abbreviated: ["av. J.-C", "ap. J.-C"],
149
150
  wide: ["avant Jésus-Christ", "après Jésus-Christ"]
150
- }, k = {
151
+ }, j = {
151
152
  narrow: [
152
153
  "T1",
153
154
  "T2",
@@ -166,7 +167,7 @@ var C = {
166
167
  "3ème trimestre",
167
168
  "4ème trimestre"
168
169
  ]
169
- }, A = {
170
+ }, M = {
170
171
  narrow: [
171
172
  "J",
172
173
  "F",
@@ -209,7 +210,7 @@ var C = {
209
210
  "novembre",
210
211
  "décembre"
211
212
  ]
212
- }, j = {
213
+ }, N = {
213
214
  narrow: [
214
215
  "D",
215
216
  "L",
@@ -246,7 +247,7 @@ var C = {
246
247
  "vendredi",
247
248
  "samedi"
248
249
  ]
249
- }, M = {
250
+ }, P = {
250
251
  narrow: {
251
252
  am: "AM",
252
253
  pm: "PM",
@@ -277,7 +278,7 @@ var C = {
277
278
  evening: "du soir",
278
279
  night: "du matin"
279
280
  }
280
- }, N = (e, t) => {
281
+ }, F = (e, t) => {
281
282
  let n = Number(e), r = t?.unit;
282
283
  if (n === 0) return "0";
283
284
  let i = [
@@ -288,38 +289,38 @@ var C = {
288
289
  "second"
289
290
  ], a;
290
291
  return a = n === 1 ? r && i.includes(r) ? "ère" : "er" : "ème", n + a;
291
- }, P = ["MMM", "MMMM"], F = {
292
+ }, I = ["MMM", "MMMM"], L = {
292
293
  en: t,
293
294
  fr: {
294
295
  code: "fr",
295
- formatDistance: w,
296
- formatLong: T,
297
- formatRelative: D,
296
+ formatDistance: E,
297
+ formatLong: D,
298
+ formatRelative: k,
298
299
  localize: {
299
- preprocessor: (e, t) => e.getDate() === 1 || !t.some((e) => e.isToken && P.includes(e.value)) ? t : t.map((e) => e.isToken && e.value === "do" ? {
300
+ preprocessor: (e, t) => e.getDate() === 1 || !t.some((e) => e.isToken && I.includes(e.value)) ? t : t.map((e) => e.isToken && e.value === "do" ? {
300
301
  isToken: !0,
301
302
  value: "d"
302
303
  } : e),
303
- ordinalNumber: N,
304
+ ordinalNumber: F,
304
305
  era: n({
305
- values: O,
306
+ values: A,
306
307
  defaultWidth: "wide"
307
308
  }),
308
309
  quarter: n({
309
- values: k,
310
+ values: j,
310
311
  defaultWidth: "wide",
311
312
  argumentCallback: (e) => e - 1
312
313
  }),
313
314
  month: n({
314
- values: A,
315
+ values: M,
315
316
  defaultWidth: "wide"
316
317
  }),
317
318
  day: n({
318
- values: j,
319
+ values: N,
319
320
  defaultWidth: "wide"
320
321
  }),
321
322
  dayPeriod: n({
322
- values: M,
323
+ values: P,
323
324
  defaultWidth: "wide"
324
325
  })
325
326
  },
@@ -449,8 +450,8 @@ var C = {
449
450
  }
450
451
  }
451
452
  };
452
- function I() {
453
- let n = e(), r = s(() => n?.language ?? "en"), i = s(() => F[r.value] ?? t);
453
+ function R() {
454
+ let n = e(), r = s(() => n?.language ?? "en"), i = s(() => L[r.value] ?? t);
454
455
  return {
455
456
  get language() {
456
457
  return r.value;
@@ -462,19 +463,26 @@ function I() {
462
463
  };
463
464
  }
464
465
  //#endregion
466
+ //#region lib/composables/use-csp-nonce.ts
467
+ var z = Symbol("nxgt-csp-nonce"), B = Symbol("nxgt-csp-nonce-depth");
468
+ function V() {
469
+ let e = l(z, null), t = p(null);
470
+ return s(() => e?.value || t?.nonce?.value || void 0);
471
+ }
472
+ //#endregion
465
473
  //#region lib/composables/use-heading-spy.ts
466
- var L = "0px 0px -65% 0px", R = [0, 1];
467
- function z(e, t, n) {
468
- let r = u(!1);
469
- l(() => {
474
+ var H = "0px 0px -65% 0px", U = [0, 1];
475
+ function W(e, t, n) {
476
+ let r = d(!1);
477
+ u(() => {
470
478
  r.value = !0;
471
- }), f(s(() => r.value ? d(e).map((e) => document.getElementById(e)).filter((e) => e != null) : []), (e) => {
479
+ }), m(s(() => r.value ? f(e).map((e) => document.getElementById(e)).filter((e) => e != null) : []), (e) => {
472
480
  let n = e.filter((e) => e.isIntersecting).sort((e, t) => e.boundingClientRect.top - t.boundingClientRect.top)[0]?.target.id;
473
481
  n && t(n);
474
482
  }, {
475
- rootMargin: n?.rootMargin ?? L,
476
- threshold: n?.threshold ?? R
483
+ rootMargin: n?.rootMargin ?? H,
484
+ threshold: n?.threshold ?? U
477
485
  });
478
486
  }
479
487
  //#endregion
480
- export { y as a, b as i, I as n, _ as o, S as r, g as s, z as t };
488
+ export { R as a, x as c, V as i, y as l, B as n, w as o, z as r, S as s, W as t, v as u };
package/dist/vite.js CHANGED
@@ -1,2 +1,2 @@
1
- import { pdfkitStandardFonts as e } from "@nxgt/material-core/vite";
2
- export { e as pdfkitStandardFonts };
1
+ import { cspAssetsInlineLimit as e, pdfkitStandardFonts as t } from "@nxgt/material-core/vite";
2
+ export { e as cspAssetsInlineLimit, t as pdfkitStandardFonts };
package/docs/README.md CHANGED
@@ -15,6 +15,7 @@ detail: every option, the second example, and the traps.
15
15
  | [PDF documents](guides/pdf.md) | You produce a PDF file from data with `@nxgt/material-vue/pdf`: in the browser (`usePdf`, `PdfDownloadButton`) or from a Nuxt server route (`pdfResponse`), fonts on an inlined server |
16
16
  | [Maps](guides/maps.md) | You render Leaflet maps or a location field with `@nxgt/material-vue/map` |
17
17
  | [SSR](guides/ssr.md) | Your app renders on a server — Nuxt or a Vite SSR server — and bundles this package |
18
+ | [Content Security Policy](guides/csp.md) | Your app sends a strict CSP: the directives to use, the components that still inject a `<style>`, the zod and KaTeX settings, self-hosting a font, the per-request nonce |
18
19
  | [Helpers](guides/helpers.md) | You need a utility, composable, Pinia store factory or type from `/lib`, `/composables`, `/i18n`, `/models`, `/types` or `/dnd` |
19
20
  | [Troubleshooting](troubleshooting.md) | Something failed and you have an error message or a symptom |
20
21
  | [Roadmap](roadmap.md) | You want to know what is planned, what shipped, and what will not be done |
@@ -706,6 +706,11 @@ left alone. Mermaid diagrams
706
706
  render in the browser only, after mount; on the server the fence is left
707
707
  empty.
708
708
 
709
+ Math needs no import of its own: KaTeX's CSS is in the stylesheet, and its
710
+ fonts are files the stylesheet loads (`dist/fonts/katex/` on the compiled
711
+ route), allowed by `font-src 'self'`. Math in system fonts means the fonts
712
+ were not served ([troubleshooting](../troubleshooting.md#math-renders-in-the-system-fonts)).
713
+
709
714
  `MermaidDiagram` renders one chart outside markdown, the same way: client-only,
710
715
  with `mermaid` imported on mount.
711
716