vue-intlayer 5.8.0-canary.0 → 5.8.1-canary.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 (43) hide show
  1. package/dist/cjs/client/useDictionary.cjs +1 -1
  2. package/dist/cjs/client/useIntlayer.cjs +1 -1
  3. package/dist/cjs/format/useCompact.cjs +1 -1
  4. package/dist/cjs/format/useCurrency.cjs +1 -1
  5. package/dist/cjs/format/useDate.cjs +1 -1
  6. package/dist/cjs/format/useList.cjs +1 -1
  7. package/dist/cjs/format/useNumber.cjs +1 -1
  8. package/dist/cjs/format/usePercentage.cjs +1 -1
  9. package/dist/cjs/format/useRelativeTime.cjs +1 -1
  10. package/dist/cjs/format/useUnit.cjs +1 -1
  11. package/dist/esm/client/useDictionary.mjs +22 -19
  12. package/dist/esm/client/useIntlayer.mjs +23 -16
  13. package/dist/esm/format/useCompact.mjs +7 -7
  14. package/dist/esm/format/useCurrency.mjs +8 -8
  15. package/dist/esm/format/useDate.mjs +9 -9
  16. package/dist/esm/format/useList.mjs +3 -3
  17. package/dist/esm/format/useNumber.mjs +8 -8
  18. package/dist/esm/format/usePercentage.mjs +3 -3
  19. package/dist/esm/format/useRelativeTime.mjs +3 -3
  20. package/dist/esm/format/useUnit.mjs +3 -3
  21. package/dist/types/client/useDictionary.d.ts +2 -1
  22. package/dist/types/client/useDictionary.d.ts.map +1 -1
  23. package/dist/types/client/useDictionaryDynamic.d.ts +1 -1
  24. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
  25. package/dist/types/client/useIntlayer.d.ts +2 -2
  26. package/dist/types/client/useIntlayer.d.ts.map +1 -1
  27. package/dist/types/format/useCompact.d.ts +2 -2
  28. package/dist/types/format/useCompact.d.ts.map +1 -1
  29. package/dist/types/format/useCurrency.d.ts +2 -2
  30. package/dist/types/format/useCurrency.d.ts.map +1 -1
  31. package/dist/types/format/useDate.d.ts +2 -2
  32. package/dist/types/format/useDate.d.ts.map +1 -1
  33. package/dist/types/format/useList.d.ts +2 -2
  34. package/dist/types/format/useList.d.ts.map +1 -1
  35. package/dist/types/format/useNumber.d.ts +2 -2
  36. package/dist/types/format/useNumber.d.ts.map +1 -1
  37. package/dist/types/format/usePercentage.d.ts +2 -2
  38. package/dist/types/format/usePercentage.d.ts.map +1 -1
  39. package/dist/types/format/useRelativeTime.d.ts +2 -2
  40. package/dist/types/format/useRelativeTime.d.ts.map +1 -1
  41. package/dist/types/format/useUnit.d.ts +2 -2
  42. package/dist/types/format/useUnit.d.ts.map +1 -1
  43. package/package.json +14 -14
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),u=require("../getDictionary.cjs"),y=require("./installIntlayer.cjs"),p=require("./useIntlayer.cjs"),d=(r,s)=>{const a=n.inject(y.INTLAYER_SYMBOL),l=n.computed(()=>s??a?.locale?.value),t=n.reactive({});return n.watchEffect(()=>{const c=u.getDictionary(r,l.value);for(const e in c){const o=t[e],i=c[e];e in t&&p.isUpdatableNode(o)?o.__update(i):t[e]=i}for(const e in t)e in c||delete t[e]}),t};exports.useDictionary=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),y=require("../getDictionary.cjs"),d=require("./installIntlayer.cjs"),f=(c,n)=>{const r=e.inject(d.INTLAYER_SYMBOL);if(!r)throw new Error("useIntlayer must be used under <IntlayerProvider>");const l=e.isRef(r.locale)?r.locale:e.ref(r.locale),s=e.computed(()=>(n!==void 0?e.toValue(n):void 0)??l.value),i=e.reactive({}),a=o=>{for(const t in o)i[t]=o[t];for(const t in i)t in o||delete i[t]};return e.watch([()=>e.toValue(c),()=>s.value],([o,t])=>{const u=y.getDictionary(o,t);a(u)},{immediate:!0,flush:"sync"}),e.toRefs(i)};exports.useDictionary=f;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),p=require("../getIntlayer.cjs"),d=require("./installIntlayer.cjs"),s=n=>!!n&&typeof n=="object"&&typeof n.__update=="function",f=(n,a)=>{const l=o.inject(d.INTLAYER_SYMBOL),u=o.computed(()=>a??l?.locale.value),t=o.reactive({});return o.watchEffect(()=>{const c=p.getIntlayer(n,u.value);for(const e in c){const r=t[e],i=c[e];e in t&&s(r)?r.__update(i):t[e]=i}for(const e in t)e in c||delete t[e]}),t};exports.isUpdatableNode=s;exports.useIntlayer=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),d=require("../getIntlayer.cjs"),y=require("./installIntlayer.cjs"),f=n=>!!n&&typeof n=="object"&&typeof n.__update=="function",p=(n,i)=>{const r=e.inject(y.INTLAYER_SYMBOL);if(!r)throw new Error("useIntlayer must be used under <IntlayerProvider>");const l=e.isRef(r.locale)?r.locale:e.ref(r.locale),s=e.computed(()=>(i!==void 0?e.toValue(i):void 0)??l.value),c=e.reactive({}),a=o=>{for(const t in o)c[t]=o[t];for(const t in c)t in o||delete c[t]};return e.watch([()=>e.toValue(n),()=>s.value],([o,t])=>{const u=d.getIntlayer(o,t);a(u)},{immediate:!0,flush:"sync"}),e.toRefs(c)};exports.isUpdatableNode=f;exports.useIntlayer=p;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/core"),t=require("vue"),n=require("../client/installIntlayer.cjs"),r=()=>{const c=t.inject(n.INTLAYER_SYMBOL);return t.computed(()=>{const o=c.locale.value;return(...e)=>l.compact(e[0],{...e[1],locale:e[1]?.locale??o})}).value};exports.useCompact=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/core"),t=require("vue"),n=require("../client/installIntlayer.cjs"),r=()=>{const c=t.inject(n.INTLAYER_SYMBOL);return t.computed(()=>{const o=c.locale.value;return(...e)=>l.compact(e[0],{...e[1],locale:e[1]?.locale??o})})};exports.useCompact=r;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/core"),r=require("vue"),n=require("../client/installIntlayer.cjs"),u=()=>{const c=r.inject(n.INTLAYER_SYMBOL);return r.computed(()=>{const t=c.locale.value;return(...e)=>l.currency(e[0],{...e[1],locale:e[1]?.locale??t})}).value};exports.useCurrency=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@intlayer/core"),r=require("vue"),l=require("../client/installIntlayer.cjs"),o=()=>{const c=r.inject(l.INTLAYER_SYMBOL);return r.computed(()=>{const t=c.locale.value;return(...e)=>n.currency(e[0],{...e[1],locale:e[1]?.locale??t})})};exports.useCurrency=o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@intlayer/core"),t=require("vue"),n=require("../client/installIntlayer.cjs"),r=()=>{const l=t.inject(n.INTLAYER_SYMBOL);return t.computed(()=>{const c=l.locale.value;return(...e)=>o.date(e[0],{...e[1],locale:e[1]?.locale??c})}).value};exports.useDate=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@intlayer/core"),t=require("vue"),n=require("../client/installIntlayer.cjs"),r=()=>{const l=t.inject(n.INTLAYER_SYMBOL);return t.computed(()=>{const c=l.locale.value;return(...e)=>o.date(e[0],{...e[1],locale:e[1]?.locale??c})})};exports.useDate=r;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@intlayer/core"),t=require("vue"),n=require("../client/installIntlayer.cjs"),r=()=>{const l=t.inject(n.INTLAYER_SYMBOL);return t.computed(()=>{const c=l.locale.value;return(...e)=>o.list(e[0],{...e[1],locale:e[1]?.locale??c})}).value};exports.useList=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@intlayer/core"),t=require("vue"),n=require("../client/installIntlayer.cjs"),r=()=>{const l=t.inject(n.INTLAYER_SYMBOL);return t.computed(()=>{const c=l.locale.value;return(...e)=>o.list(e[0],{...e[1],locale:e[1]?.locale??c})})};exports.useList=r;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@intlayer/core"),t=require("vue"),c=require("../client/installIntlayer.cjs"),n=()=>{const l=t.inject(c.INTLAYER_SYMBOL);return t.computed(()=>{const r=l.locale.value;return(...e)=>u.number(e[0],{...e[1],locale:e[1]?.locale??r})}).value};exports.useNumber=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@intlayer/core"),t=require("vue"),n=require("../client/installIntlayer.cjs"),o=()=>{const r=t.inject(n.INTLAYER_SYMBOL);return t.computed(()=>{const l=r.locale.value;return(...e)=>c.number(e[0],{...e[1],locale:e[1]?.locale??l})})};exports.useNumber=o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@intlayer/core"),t=require("vue"),r=require("../client/installIntlayer.cjs"),o=()=>{const c=t.inject(r.INTLAYER_SYMBOL);return t.computed(()=>{const l=c.locale.value;return(...e)=>n.percentage(e[0],{...e[1],locale:e[1]?.locale??l})}).value};exports.usePercentage=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@intlayer/core"),t=require("vue"),l=require("../client/installIntlayer.cjs"),o=()=>{const c=t.inject(l.INTLAYER_SYMBOL);return t.computed(()=>{const n=c.locale.value;return(...e)=>r.percentage(e[0],{...e[1],locale:e[1]?.locale??n})})};exports.usePercentage=o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@intlayer/core"),t=require("vue"),o=require("../client/installIntlayer.cjs"),n=()=>{const l=t.inject(o.INTLAYER_SYMBOL);return t.computed(()=>{const c=l.locale.value;return(...e)=>i.relativeTime(e[0],e[1],{...e[2],locale:e[2]?.locale??c})}).value};exports.useRelativeTime=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@intlayer/core"),t=require("vue"),o=require("../client/installIntlayer.cjs"),n=()=>{const l=t.inject(o.INTLAYER_SYMBOL);return t.computed(()=>{const c=l.locale.value;return(...e)=>i.relativeTime(e[0],e[1],{...e[2],locale:e[2]?.locale??c})})};exports.useRelativeTime=n;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@intlayer/core"),t=require("vue"),o=require("../client/installIntlayer.cjs"),r=()=>{const l=t.inject(o.INTLAYER_SYMBOL);return t.computed(()=>{const n=l.locale.value;return(...e)=>c.units(e[0],{...e[1],locale:e[1]?.locale??n})}).value};exports.useUnit=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@intlayer/core"),t=require("vue"),o=require("../client/installIntlayer.cjs"),r=()=>{const n=t.inject(o.INTLAYER_SYMBOL);return t.computed(()=>{const l=n.locale.value;return(...e)=>c.units(e[0],{...e[1],locale:e[1]?.locale??l})})};exports.useUnit=r;
@@ -1,22 +1,25 @@
1
- import { inject as s, computed as f, reactive as l, watchEffect as m } from "vue";
2
- import { getDictionary as u } from "../getDictionary.mjs";
3
- import { INTLAYER_SYMBOL as d } from "./installIntlayer.mjs";
4
- import { isUpdatableNode as g } from "./useIntlayer.mjs";
5
- const D = (c, i) => {
6
- const a = s(d), p = f(() => i ?? a?.locale?.value), o = l({});
7
- return m(() => {
8
- const e = u(
9
- c,
10
- p.value
11
- );
12
- for (const t in e) {
13
- const n = o[t], r = e[t];
14
- t in o && g(n) ? n.__update(r) : o[t] = r;
15
- }
16
- for (const t in o)
17
- t in e || delete o[t];
18
- }), o;
1
+ import { inject as f, isRef as m, ref as d, computed as p, toValue as c, reactive as y, watch as v, toRefs as h } from "vue";
2
+ import { getDictionary as w } from "../getDictionary.mjs";
3
+ import { INTLAYER_SYMBOL as I } from "./installIntlayer.mjs";
4
+ const k = (n, i) => {
5
+ const o = f(I);
6
+ if (!o)
7
+ throw new Error("useIntlayer must be used under <IntlayerProvider>");
8
+ const s = m(o.locale) ? o.locale : d(o.locale), a = p(() => (i !== void 0 ? c(i) : void 0) ?? s.value), r = y({}), l = (t) => {
9
+ for (const e in t)
10
+ r[e] = t[e];
11
+ for (const e in r)
12
+ e in t || delete r[e];
13
+ };
14
+ return v(
15
+ [() => c(n), () => a.value],
16
+ ([t, e]) => {
17
+ const u = w(t, e);
18
+ l(u);
19
+ },
20
+ { immediate: !0, flush: "sync" }
21
+ ), h(r);
19
22
  };
20
23
  export {
21
- D as useDictionary
24
+ k as useDictionary
22
25
  };
@@ -1,19 +1,26 @@
1
- import { inject as a, computed as f, reactive as l, watchEffect as u } from "vue";
2
- import { getIntlayer as m } from "../getIntlayer.mjs";
3
- import { INTLAYER_SYMBOL as d } from "./installIntlayer.mjs";
4
- const y = (o) => !!o && typeof o == "object" && typeof o.__update == "function", b = (o, i) => {
5
- const p = a(d), s = f(() => i ?? p?.locale.value), e = l({});
6
- return u(() => {
7
- const n = m(o, s.value);
8
- for (const t in n) {
9
- const c = e[t], r = n[t];
10
- t in e && y(c) ? c.__update(r) : e[t] = r;
11
- }
12
- for (const t in e)
13
- t in n || delete e[t];
14
- }), e;
1
+ import { inject as f, isRef as p, ref as d, computed as m, toValue as i, reactive as y, watch as v, toRefs as I } from "vue";
2
+ import { getIntlayer as h } from "../getIntlayer.mjs";
3
+ import { INTLAYER_SYMBOL as b } from "./installIntlayer.mjs";
4
+ const _ = (o) => !!o && typeof o == "object" && typeof o.__update == "function", g = (o, c) => {
5
+ const r = f(b);
6
+ if (!r)
7
+ throw new Error("useIntlayer must be used under <IntlayerProvider>");
8
+ const s = p(r.locale) ? r.locale : d(r.locale), a = m(() => (c !== void 0 ? i(c) : void 0) ?? s.value), n = y({}), l = (t) => {
9
+ for (const e in t)
10
+ n[e] = t[e];
11
+ for (const e in n)
12
+ e in t || delete n[e];
13
+ };
14
+ return v(
15
+ [() => i(o), () => a.value],
16
+ ([t, e]) => {
17
+ const u = h(t, e);
18
+ l(u);
19
+ },
20
+ { immediate: !0, flush: "sync" }
21
+ ), I(n);
15
22
  };
16
23
  export {
17
- y as isUpdatableNode,
18
- b as useIntlayer
24
+ _ as isUpdatableNode,
25
+ g as useIntlayer
19
26
  };
@@ -1,16 +1,16 @@
1
- import { compact as c } from "@intlayer/core";
1
+ import { compact as e } from "@intlayer/core";
2
2
  import { inject as l, computed as r } from "vue";
3
3
  import { INTLAYER_SYMBOL as m } from "../client/installIntlayer.mjs";
4
- const u = () => {
4
+ const i = () => {
5
5
  const t = l(m);
6
6
  return r(() => {
7
- const e = t.locale.value;
8
- return (...o) => c(o[0], {
7
+ const c = t.locale.value;
8
+ return (...o) => e(o[0], {
9
9
  ...o[1],
10
- locale: o[1]?.locale ?? e
10
+ locale: o[1]?.locale ?? c
11
11
  });
12
- }).value;
12
+ });
13
13
  };
14
14
  export {
15
- u as useCompact
15
+ i as useCompact
16
16
  };
@@ -1,16 +1,16 @@
1
1
  import { currency as c } from "@intlayer/core";
2
2
  import { inject as t, computed as l } from "vue";
3
3
  import { INTLAYER_SYMBOL as n } from "../client/installIntlayer.mjs";
4
- const i = () => {
5
- const o = t(n);
4
+ const p = () => {
5
+ const e = t(n);
6
6
  return l(() => {
7
- const r = o.locale.value;
8
- return (...e) => c(e[0], {
9
- ...e[1],
10
- locale: e[1]?.locale ?? r
7
+ const r = e.locale.value;
8
+ return (...o) => c(o[0], {
9
+ ...o[1],
10
+ locale: o[1]?.locale ?? r
11
11
  });
12
- }).value;
12
+ });
13
13
  };
14
14
  export {
15
- i as useCurrency
15
+ p as useCurrency
16
16
  };
@@ -1,16 +1,16 @@
1
1
  import { date as l } from "@intlayer/core";
2
2
  import { inject as r, computed as c } from "vue";
3
- import { INTLAYER_SYMBOL as a } from "../client/installIntlayer.mjs";
4
- const i = () => {
5
- const o = r(a);
3
+ import { INTLAYER_SYMBOL as m } from "../client/installIntlayer.mjs";
4
+ const p = () => {
5
+ const e = r(m);
6
6
  return c(() => {
7
- const t = o.locale.value;
8
- return (...e) => l(e[0], {
9
- ...e[1],
10
- locale: e[1]?.locale ?? t
7
+ const t = e.locale.value;
8
+ return (...o) => l(o[0], {
9
+ ...o[1],
10
+ locale: o[1]?.locale ?? t
11
11
  });
12
- }).value;
12
+ });
13
13
  };
14
14
  export {
15
- i as useDate
15
+ p as useDate
16
16
  };
@@ -1,7 +1,7 @@
1
1
  import { list as l } from "@intlayer/core";
2
2
  import { inject as r, computed as c } from "vue";
3
3
  import { INTLAYER_SYMBOL as i } from "../client/installIntlayer.mjs";
4
- const a = () => {
4
+ const u = () => {
5
5
  const t = r(i);
6
6
  return c(() => {
7
7
  const e = t.locale.value;
@@ -9,8 +9,8 @@ const a = () => {
9
9
  ...o[1],
10
10
  locale: o[1]?.locale ?? e
11
11
  });
12
- }).value;
12
+ });
13
13
  };
14
14
  export {
15
- a as useList
15
+ u as useList
16
16
  };
@@ -1,16 +1,16 @@
1
1
  import { number as t } from "@intlayer/core";
2
2
  import { inject as l, computed as c } from "vue";
3
3
  import { INTLAYER_SYMBOL as m } from "../client/installIntlayer.mjs";
4
- const i = () => {
5
- const o = l(m);
4
+ const p = () => {
5
+ const e = l(m);
6
6
  return c(() => {
7
- const r = o.locale.value;
8
- return (...e) => t(e[0], {
9
- ...e[1],
10
- locale: e[1]?.locale ?? r
7
+ const r = e.locale.value;
8
+ return (...o) => t(o[0], {
9
+ ...o[1],
10
+ locale: o[1]?.locale ?? r
11
11
  });
12
- }).value;
12
+ });
13
13
  };
14
14
  export {
15
- i as useNumber
15
+ p as useNumber
16
16
  };
@@ -1,7 +1,7 @@
1
1
  import { percentage as r } from "@intlayer/core";
2
2
  import { inject as c, computed as l } from "vue";
3
3
  import { INTLAYER_SYMBOL as n } from "../client/installIntlayer.mjs";
4
- const u = () => {
4
+ const i = () => {
5
5
  const o = c(n);
6
6
  return l(() => {
7
7
  const t = o.locale.value;
@@ -9,8 +9,8 @@ const u = () => {
9
9
  ...e[1],
10
10
  locale: e[1]?.locale ?? t
11
11
  });
12
- }).value;
12
+ });
13
13
  };
14
14
  export {
15
- u as usePercentage
15
+ i as usePercentage
16
16
  };
@@ -1,7 +1,7 @@
1
1
  import { relativeTime as l } from "@intlayer/core";
2
2
  import { inject as r, computed as c } from "vue";
3
3
  import { INTLAYER_SYMBOL as i } from "../client/installIntlayer.mjs";
4
- const u = () => {
4
+ const p = () => {
5
5
  const o = r(i);
6
6
  return c(() => {
7
7
  const t = o.locale.value;
@@ -9,8 +9,8 @@ const u = () => {
9
9
  ...e[2],
10
10
  locale: e[2]?.locale ?? t
11
11
  });
12
- }).value;
12
+ });
13
13
  };
14
14
  export {
15
- u as useRelativeTime
15
+ p as useRelativeTime
16
16
  };
@@ -1,7 +1,7 @@
1
1
  import { units as l } from "@intlayer/core";
2
2
  import { inject as r, computed as c } from "vue";
3
3
  import { INTLAYER_SYMBOL as n } from "../client/installIntlayer.mjs";
4
- const a = () => {
4
+ const p = () => {
5
5
  const t = r(n);
6
6
  return c(() => {
7
7
  const e = t.locale.value;
@@ -9,8 +9,8 @@ const a = () => {
9
9
  ...o[1],
10
10
  locale: o[1]?.locale ?? e
11
11
  });
12
- }).value;
12
+ });
13
13
  };
14
14
  export {
15
- a as useUnit
15
+ p as useUnit
16
16
  };
@@ -1,5 +1,6 @@
1
1
  import { LocalesValues } from '@intlayer/config/client';
2
2
  import { Dictionary } from '@intlayer/core';
3
+ import { ToRefs } from 'vue';
3
4
  import { DeepTransformContent } from '../plugins';
4
- export declare const useDictionary: <T extends Dictionary>(dictionary: T, locale?: LocalesValues) => DeepTransformContent<T["content"]>;
5
+ export declare const useDictionary: <T extends Dictionary>(dictionary: T, locale?: LocalesValues) => ToRefs<DeepTransformContent<T["content"]>>;
5
6
  //# sourceMappingURL=useDictionary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionary.d.ts","sourceRoot":"","sources":["../../../src/client/useDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAIlD,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,UAAU,EAChD,YAAY,CAAC,EACb,SAAS,aAAa,KACrB,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC,CAoCnC,CAAC"}
1
+ {"version":3,"file":"useDictionary.d.ts","sourceRoot":"","sources":["../../../src/client/useDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EASL,KAAK,MAAM,EACZ,MAAM,KAAK,CAAC;AAEb,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGlD,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,UAAU,EAChD,YAAY,CAAC,EACb,SAAS,aAAa,KACrB,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CA0C3C,CAAC"}
@@ -5,5 +5,5 @@ import { Dictionary, DictionaryKeys, LanguageContent } from '@intlayer/core';
5
5
  *
6
6
  * If the locale is not provided, it will use the locale from the client context
7
7
  */
8
- export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: LanguageContent<() => Promise<T>>, key: K, locale?: LocalesValues) => import('@intlayer/core').DeepTransformContent<T["content"], import('..').IInterpreterPluginState>;
8
+ export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: LanguageContent<() => Promise<T>>, key: K, locale?: LocalesValues) => import('vue').ToRefs<import('@intlayer/core').DeepTransformContent<T["content"], import('..').IInterpreterPluginState>>;
9
9
  //# sourceMappingURL=useDictionaryDynamic.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionaryDynamic.d.ts","sourceRoot":"","sources":["../../../src/client/useDictionaryDynamic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAMxB;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC/B,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,cAAc,EAExB,mBAAmB,eAAe,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,EACpD,KAAK,CAAC,EACN,SAAS,aAAa,sGAiBvB,CAAC"}
1
+ {"version":3,"file":"useDictionaryDynamic.d.ts","sourceRoot":"","sources":["../../../src/client/useDictionaryDynamic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAMxB;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC/B,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,cAAc,EAExB,mBAAmB,eAAe,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,EACpD,KAAK,CAAC,EACN,SAAS,aAAa,4HAiBvB,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { LocalesValues } from '@intlayer/config/client';
2
2
  import { DictionaryKeys } from '@intlayer/core';
3
3
  import { IntlayerDictionaryTypesConnector } from 'intlayer';
4
+ import { MaybeRefOrGetter, ToRefs } from 'vue';
4
5
  import { DeepTransformContent } from '../plugins';
5
- /** guard utility — true only for objects generated by `renderIntlayerNode()` */
6
6
  export declare const isUpdatableNode: (val: unknown) => val is {
7
7
  __update: (n: unknown) => void;
8
8
  };
9
- export declare const useIntlayer: <T extends DictionaryKeys>(key: T, locale?: LocalesValues) => DeepTransformContent<IntlayerDictionaryTypesConnector[T]["content"]>;
9
+ export declare const useIntlayer: <T extends DictionaryKeys>(key: MaybeRefOrGetter<T>, locale?: MaybeRefOrGetter<LocalesValues | null | undefined>) => ToRefs<DeepTransformContent<IntlayerDictionaryTypesConnector[T]["content"]>>;
10
10
  //# sourceMappingURL=useIntlayer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIntlayer.d.ts","sourceRoot":"","sources":["../../../src/client/useIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGlD,gFAAgF;AAChF,eAAO,MAAM,eAAe,GAC1B,KAAK,OAAO,KACX,GAAG,IAAI;IAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;CAGG,CAAC;AAE9C,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,cAAc,EAClD,KAAK,CAAC,EACN,SAAS,aAAa,KACrB,oBAAoB,CAAC,gCAAgC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAmCrE,CAAC"}
1
+ {"version":3,"file":"useIntlayer.d.ts","sourceRoot":"","sources":["../../../src/client/useIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EASL,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACZ,MAAM,KAAK,CAAC;AAEb,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGlD,eAAO,MAAM,eAAe,GAC1B,KAAK,OAAO,KACX,GAAG,IAAI;IAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;CAGG,CAAC;AAE9C,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,cAAc,EAClD,KAAK,gBAAgB,CAAC,CAAC,CAAC,EACxB,SAAS,gBAAgB,CAAC,aAAa,GAAG,IAAI,GAAG,SAAS,CAAC,KAC1D,MAAM,CACP,oBAAoB,CAAC,gCAAgC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CA4CrE,CAAC"}
@@ -8,7 +8,7 @@
8
8
  * formatCompact(1500); // "1.5K"
9
9
  * ```
10
10
  */
11
- export declare const useCompact: () => (value: string | number, options?: (Intl.NumberFormatOptions & {
11
+ export declare const useCompact: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
12
12
  locale?: import('intlayer').LocalesValues;
13
- }) | undefined) => string;
13
+ }) | undefined) => string>;
14
14
  //# sourceMappingURL=useCompact.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCompact.d.ts","sourceRoot":"","sources":["../../../src/format/useCompact.ts"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU;;yBAYtB,CAAC"}
1
+ {"version":3,"file":"useCompact.d.ts","sourceRoot":"","sources":["../../../src/format/useCompact.ts"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU;;0BAYtB,CAAC"}
@@ -19,7 +19,7 @@
19
19
  * // "¥9,876,543"
20
20
  * ```
21
21
  */
22
- export declare const useCurrency: () => (value: string | number, options?: (Intl.NumberFormatOptions & {
22
+ export declare const useCurrency: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
23
23
  locale?: import('intlayer').LocalesValues;
24
- }) | undefined) => string;
24
+ }) | undefined) => string>;
25
25
  //# sourceMappingURL=useCurrency.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrency.d.ts","sourceRoot":"","sources":["../../../src/format/useCurrency.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,WAAW;;yBAYvB,CAAC"}
1
+ {"version":3,"file":"useCurrency.d.ts","sourceRoot":"","sources":["../../../src/format/useCurrency.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,WAAW;;0BAYvB,CAAC"}
@@ -17,7 +17,7 @@
17
17
  * // "2 août"
18
18
  * ```
19
19
  */
20
- export declare const useDate: () => (date: string | number | Date, options?: (Intl.DateTimeFormatOptions & {
20
+ export declare const useDate: () => import('vue').ComputedRef<(date: string | number | Date, options?: (Intl.DateTimeFormatOptions & {
21
21
  locale?: import('intlayer').LocalesValues;
22
- }) | undefined) => string;
22
+ }) | undefined) => string>;
23
23
  //# sourceMappingURL=useDate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDate.d.ts","sourceRoot":"","sources":["../../../src/format/useDate.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,OAAO;;yBAYnB,CAAC"}
1
+ {"version":3,"file":"useDate.d.ts","sourceRoot":"","sources":["../../../src/format/useDate.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,OAAO;;0BAYnB,CAAC"}
@@ -16,7 +16,7 @@
16
16
  * // "1, 2 und 3"
17
17
  * ```
18
18
  */
19
- export declare const useList: () => (values: (string | number)[], options?: (Intl.ListFormatOptions & {
19
+ export declare const useList: () => import('vue').ComputedRef<(values: (string | number)[], options?: (Intl.ListFormatOptions & {
20
20
  locale?: import('intlayer').LocalesValues;
21
- }) | undefined) => string;
21
+ }) | undefined) => string>;
22
22
  //# sourceMappingURL=useList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useList.d.ts","sourceRoot":"","sources":["../../../src/format/useList.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,OAAO;;yBAYnB,CAAC"}
1
+ {"version":3,"file":"useList.d.ts","sourceRoot":"","sources":["../../../src/format/useList.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,OAAO;;0BAYnB,CAAC"}
@@ -17,7 +17,7 @@
17
17
  * // e.g. "75%"
18
18
  * ```
19
19
  */
20
- export declare const useNumber: () => (value: string | number, options?: (Intl.NumberFormatOptions & {
20
+ export declare const useNumber: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
21
21
  locale?: import('intlayer').LocalesValues;
22
- }) | undefined) => string;
22
+ }) | undefined) => string>;
23
23
  //# sourceMappingURL=useNumber.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useNumber.d.ts","sourceRoot":"","sources":["../../../src/format/useNumber.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,SAAS;;yBAYrB,CAAC"}
1
+ {"version":3,"file":"useNumber.d.ts","sourceRoot":"","sources":["../../../src/format/useNumber.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,SAAS;;0BAYrB,CAAC"}
@@ -11,7 +11,7 @@
11
11
  * formatPercentage(0.237, { minimumFractionDigits: 1 }); // "23.7%"
12
12
  * ```
13
13
  */
14
- export declare const usePercentage: () => (value: string | number, options?: (Intl.NumberFormatOptions & {
14
+ export declare const usePercentage: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
15
15
  locale?: import('intlayer').LocalesValues;
16
- }) | undefined) => string;
16
+ }) | undefined) => string>;
17
17
  //# sourceMappingURL=usePercentage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePercentage.d.ts","sourceRoot":"","sources":["../../../src/format/usePercentage.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa;;yBAYzB,CAAC"}
1
+ {"version":3,"file":"usePercentage.d.ts","sourceRoot":"","sources":["../../../src/format/usePercentage.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa;;0BAYzB,CAAC"}
@@ -14,8 +14,8 @@
14
14
  * formatRelativeTime(now, twoHoursAgo, { unit: "hour", numeric: "auto" }); // "2 hours ago"
15
15
  * ```
16
16
  */
17
- export declare const useRelativeTime: () => (from: string | number | Date, to?: string | number | Date | undefined, options?: (Intl.RelativeTimeFormatOptions & {
17
+ export declare const useRelativeTime: () => import('vue').ComputedRef<(from: string | number | Date, to?: string | number | Date | undefined, options?: (Intl.RelativeTimeFormatOptions & {
18
18
  locale?: import('intlayer').LocalesValues;
19
19
  unit?: Intl.RelativeTimeFormatUnit;
20
- }) | undefined) => string;
20
+ }) | undefined) => string>;
21
21
  //# sourceMappingURL=useRelativeTime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRelativeTime.d.ts","sourceRoot":"","sources":["../../../src/format/useRelativeTime.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,eAAe;;;yBAY3B,CAAC"}
1
+ {"version":3,"file":"useRelativeTime.d.ts","sourceRoot":"","sources":["../../../src/format/useRelativeTime.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,eAAe;;;0BAY3B,CAAC"}
@@ -13,7 +13,7 @@
13
13
  * // "10 km" (depending on locale)
14
14
  * ```
15
15
  */
16
- export declare const useUnit: () => (value: string | number, options?: (Intl.NumberFormatOptions & {
16
+ export declare const useUnit: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
17
17
  locale?: import('intlayer').LocalesValues;
18
- }) | undefined) => string;
18
+ }) | undefined) => string>;
19
19
  //# sourceMappingURL=useUnit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useUnit.d.ts","sourceRoot":"","sources":["../../../src/format/useUnit.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,OAAO;;yBAYnB,CAAC"}
1
+ {"version":3,"file":"useUnit.d.ts","sourceRoot":"","sources":["../../../src/format/useUnit.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,OAAO;;0BAYnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intlayer",
3
- "version": "5.8.0-canary.0",
3
+ "version": "5.8.1-canary.0",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Vue applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -65,11 +65,11 @@
65
65
  "dependencies": {
66
66
  "js-cookie": "^3.0.5",
67
67
  "uuid": "^11.1.0",
68
- "@intlayer/config": "5.8.0-canary.0",
69
- "@intlayer/core": "5.8.0-canary.0",
70
- "@intlayer/editor": "5.8.0-canary.0",
71
- "@intlayer/api": "5.8.0-canary.0",
72
- "@intlayer/dictionaries-entry": "5.8.0-canary.0"
68
+ "@intlayer/config": "5.8.1-canary.0",
69
+ "@intlayer/core": "5.8.1-canary.0",
70
+ "@intlayer/api": "5.8.1-canary.0",
71
+ "@intlayer/dictionaries-entry": "5.8.1-canary.0",
72
+ "@intlayer/editor": "5.8.1-canary.0"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@types/js-cookie": "^3.0.6",
@@ -87,18 +87,18 @@
87
87
  "vitest": "^3.2.2",
88
88
  "@utils/eslint-config": "1.0.4",
89
89
  "@utils/ts-config": "1.0.4",
90
- "@utils/ts-config-types": "1.0.4",
90
+ "@intlayer/backend": "5.8.1-canary.0",
91
91
  "@utils/tsup-config": "1.0.4",
92
- "@intlayer/backend": "5.8.0-canary.0"
92
+ "@utils/ts-config-types": "1.0.4"
93
93
  },
94
94
  "peerDependencies": {
95
95
  "vue": "^3.5.13",
96
- "@intlayer/api": "5.8.0-canary.0",
97
- "@intlayer/core": "5.8.0-canary.0",
98
- "@intlayer/config": "5.8.0-canary.0",
99
- "@intlayer/dictionaries-entry": "5.8.0-canary.0",
100
- "@intlayer/editor": "5.8.0-canary.0",
101
- "intlayer": "5.8.0-canary.0"
96
+ "@intlayer/config": "5.8.1-canary.0",
97
+ "@intlayer/core": "5.8.1-canary.0",
98
+ "@intlayer/api": "5.8.1-canary.0",
99
+ "@intlayer/editor": "5.8.1-canary.0",
100
+ "@intlayer/dictionaries-entry": "5.8.1-canary.0",
101
+ "intlayer": "5.8.1-canary.0"
102
102
  },
103
103
  "engines": {
104
104
  "node": ">=14.18"