@templatical/media-library 0.15.1 → 0.16.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.
@@ -1,4 +1,4 @@
1
- import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, a as O, at as k, b as ee, c as te, d as ne, et as re, f as A, g as ie, h as ae, i as oe, it as j, j as M, k as N, l as se, m as ce, n as le, nt as ue, o as de, ot as P, p as fe, q as F, r as pe, rt as I, s as me, st as L, t as he, tt as ge, u as _e, v as ve, w as R, x as ye, y as be, z } from "./chunks/icons-DLyx2bga.js";
1
+ import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, a as O, at as k, b as ee, c as te, d as ne, et as re, f as A, g as ie, h as ae, i as oe, it as j, j as M, k as N, l as se, m as ce, n as le, nt as ue, o as de, ot as P, p as fe, q as F, r as pe, rt as I, s as me, st as L, t as he, tt as ge, u as _e, v as ve, w as R, x as ye, y as be, z } from "./chunks/icons-DMGf9Go7.js";
2
2
  //#region ../types/src/config.ts
3
3
  var xe = class extends Error {
4
4
  statusCode;
@@ -518,7 +518,7 @@ function Be(e, t, n, r) {
518
518
  //#region src/keys.ts
519
519
  var Ve = Symbol("templaticalMediaPopoverTarget");
520
520
  //#endregion
521
- //#region ../../node_modules/.pnpm/vue-advanced-cropper@2.8.9_vue@3.5.39_typescript@6.0.3_/node_modules/vue-advanced-cropper/dist/index.esm-bundler.js
521
+ //#region ../../node_modules/.pnpm/vue-advanced-cropper@2.8.9_vue@3.5.40_typescript@6.0.3_/node_modules/vue-advanced-cropper/dist/index.esm-bundler.js
522
522
  function He(e, t) {
523
523
  var n = Object.keys(e);
524
524
  if (Object.getOwnPropertySymbols) {
@@ -4639,7 +4639,7 @@ var Ln = ["data-tpl-theme"], Rn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, zn
4639
4639
  }
4640
4640
  });
4641
4641
  //#endregion
4642
- //#region ../../node_modules/.pnpm/@vueuse+shared@14.3.0_vue@3.5.39_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js
4642
+ //#region ../../node_modules/.pnpm/@vueuse+shared@14.3.0_vue@3.5.40_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js
4643
4643
  function Pr(e, t) {
4644
4644
  return T() ? (E(e, t), !0) : !1;
4645
4645
  }
@@ -4736,7 +4736,7 @@ function Xr(e, t, n) {
4736
4736
  });
4737
4737
  }
4738
4738
  //#endregion
4739
- //#region ../../node_modules/.pnpm/@vueuse+core@14.3.0_vue@3.5.39_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js
4739
+ //#region ../../node_modules/.pnpm/@vueuse+core@14.3.0_vue@3.5.40_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js
4740
4740
  var Zr = Ir ? window : void 0, Qr = Ir ? window.document : void 0, $r = Ir ? window.navigator : void 0;
4741
4741
  function ei(e) {
4742
4742
  let t = I(e);
@@ -6766,53 +6766,50 @@ var Wa = {
6766
6766
  }, L(u.value.mediaLibrary.selectFile), 9, No)) : N("", !0)])])])
6767
6767
  ]));
6768
6768
  }
6769
- }), Fo = (e, t, n) => {
6770
- let r = t.lastIndexOf("?"), i = e[r === -1 || r < t.lastIndexOf("/") ? t : t.slice(0, r)];
6771
- return i ? typeof i == "function" ? i() : Promise.resolve(i) : new Promise((e, r) => {
6772
- (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(r.bind(null, /* @__PURE__ */ Error("Unknown variable dynamic import: " + t + (t.split("/").length === n ? "" : ". Note that variables only represent file names one level deep."))));
6773
- });
6774
- }, Io = [
6775
- "en",
6776
- "de",
6777
- "pt-BR"
6778
- ];
6779
- function Lo(e) {
6780
- return e.trim().replace(/_/g, "-").toLowerCase();
6769
+ }), Fo = /* #__PURE__ */ Object.assign({
6770
+ "./locales/ca.ts": () => import("./chunks/ca-DnghH5Xn.js"),
6771
+ "./locales/de.ts": () => import("./chunks/de-ByQyu2jv.js"),
6772
+ "./locales/en.ts": () => import("./chunks/en-B-xajqfh.js"),
6773
+ "./locales/es.ts": () => import("./chunks/es-Bcp-DbmC.js"),
6774
+ "./locales/pt-BR.ts": () => import("./chunks/pt-BR-C0Hzc26R.js")
6775
+ });
6776
+ function Io(e) {
6777
+ return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
6781
6778
  }
6779
+ var Lo = Io(Fo);
6782
6780
  function Ro(e) {
6783
- let t = Lo(e);
6784
- return Io.find((e) => Lo(e) === t);
6781
+ return e.trim().replace(/_/g, "-").toLowerCase();
6785
6782
  }
6786
6783
  function zo(e) {
6787
- return Lo(e).split("-")[0];
6784
+ let t = Ro(e);
6785
+ return Lo.find((e) => Ro(e) === t);
6788
6786
  }
6789
6787
  function Bo(e) {
6790
- return Ro(e) ?? Ro(zo(e)) ?? "en";
6788
+ return Ro(e).split("-")[0];
6789
+ }
6790
+ function Vo(e) {
6791
+ return zo(e) ?? zo(Bo(e)) ?? "en";
6791
6792
  }
6792
- async function Vo(e) {
6793
- let t = Bo(e);
6794
- return (await Fo(/* #__PURE__ */ Object.assign({
6795
- "./locales/de.ts": () => import("./chunks/de-ByQyu2jv.js"),
6796
- "./locales/en.ts": () => import("./chunks/en-B-xajqfh.js"),
6797
- "./locales/pt-BR.ts": () => import("./chunks/pt-BR-C0Hzc26R.js")
6798
- }), `./locales/${t}.ts`, 3)).default;
6793
+ async function Ho(e) {
6794
+ let t = Fo[`./locales/${Vo(e)}.ts`];
6795
+ return (await t()).default;
6799
6796
  }
6800
6797
  //#endregion
6801
6798
  //#region src/standalone/visual.ts
6802
- var Ho = null, Uo = e(null);
6803
- async function Wo(e) {
6799
+ var Uo = null, Wo = e(null);
6800
+ async function Go(e) {
6804
6801
  let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
6805
6802
  if (!t) throw Error(`Container element not found: ${e.container}`);
6806
6803
  let n = Ce(e.auth, e.onError);
6807
6804
  await n.initialize();
6808
- let r = await new ke(n).fetchConfig(), i = await Vo(e.locale ?? "en");
6809
- return Ko(t, e.theme), Ho && Go(), new Promise((a, s) => {
6805
+ let r = await new ke(n).fetchConfig(), i = await Ho(e.locale ?? "en");
6806
+ return qo(t, e.theme), Uo && Ko(), new Promise((a, s) => {
6810
6807
  try {
6811
- Ho = be({ setup() {
6808
+ Uo = be({ setup() {
6812
6809
  let s = () => {
6813
6810
  a({
6814
- setTheme: (e) => Ko(t, e),
6815
- unmount: Go
6811
+ setTheme: (e) => qo(t, e),
6812
+ unmount: Ko
6816
6813
  });
6817
6814
  };
6818
6815
  return () => o(Po, {
@@ -6822,27 +6819,27 @@ async function Wo(e) {
6822
6819
  translations: i,
6823
6820
  onSelect: e.onSelect,
6824
6821
  onError: e.onError,
6825
- ref: Uo,
6822
+ ref: Wo,
6826
6823
  onReady: s
6827
6824
  });
6828
- } }), Ho.mount(t);
6825
+ } }), Uo.mount(t);
6829
6826
  } catch (e) {
6830
6827
  s(e);
6831
6828
  }
6832
6829
  });
6833
6830
  }
6834
- function Go() {
6835
- Ho && (Ho.unmount(), Ho = null, Uo.value = null);
6831
+ function Ko() {
6832
+ Uo && (Uo.unmount(), Uo = null, Wo.value = null);
6836
6833
  }
6837
- function Ko(e, t) {
6834
+ function qo(e, t) {
6838
6835
  t && (t.primaryColor && e.style.setProperty("--tpl-primary", t.primaryColor), t.borderRadius !== void 0 && (e.style.setProperty("--tpl-radius", `${t.borderRadius}px`), e.style.setProperty("--tpl-radius-sm", `${Math.max(0, t.borderRadius - 3)}px`), e.style.setProperty("--tpl-radius-lg", `${t.borderRadius + 4}px`)));
6839
6836
  }
6840
- var qo = {
6841
- init: Wo,
6842
- unmount: Go
6837
+ var Jo = {
6838
+ init: Go,
6839
+ unmount: Ko
6843
6840
  };
6844
- typeof window < "u" && (window.TemplaticalMedia = qo);
6841
+ typeof window < "u" && (window.TemplaticalMedia = Jo);
6845
6842
  //#endregion
6846
- export { qo as default, Wo as init, Go as unmount };
6843
+ export { Jo as default, Go as init, Ko as unmount };
6847
6844
 
6848
6845
  //# sourceMappingURL=media-library.js.map