vue-intlayer 9.6.0 → 9.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 (76) hide show
  1. package/dist/cjs/analytics/useAnalytics.cjs +1 -1
  2. package/dist/cjs/analytics/useConversion.cjs +1 -1
  3. package/dist/cjs/analytics/useExperiment.cjs +1 -1
  4. package/dist/cjs/client/useLocale.cjs +1 -1
  5. package/dist/cjs/devtools/editDictionaryContent.cjs +1 -0
  6. package/dist/cjs/devtools/editorServer.cjs +1 -0
  7. package/dist/cjs/devtools/formatDictionaryForInspector.cjs +1 -1
  8. package/dist/cjs/devtools/index.cjs +1 -1
  9. package/dist/cjs/editor/useEditor.cjs +1 -1
  10. package/dist/cjs/format/index.cjs +1 -1
  11. package/dist/cjs/format/useCompact.cjs +1 -1
  12. package/dist/cjs/format/useCurrency.cjs +1 -1
  13. package/dist/cjs/format/useDate.cjs +1 -1
  14. package/dist/cjs/format/useIntl.cjs +1 -1
  15. package/dist/cjs/format/useList.cjs +1 -1
  16. package/dist/cjs/format/useNumber.cjs +1 -1
  17. package/dist/cjs/format/usePercentage.cjs +1 -1
  18. package/dist/cjs/format/useRelativeTime.cjs +1 -1
  19. package/dist/cjs/format/useUnit.cjs +1 -1
  20. package/dist/cjs/html/index.cjs +1 -1
  21. package/dist/cjs/index.cjs +1 -1
  22. package/dist/cjs/plugins.cjs +1 -1
  23. package/dist/esm/UI/ContentSelector.mjs +1 -2
  24. package/dist/esm/analytics/exposureSink.mjs +1 -2
  25. package/dist/esm/analytics/useAnalytics.mjs +19 -20
  26. package/dist/esm/analytics/useConversion.mjs +3 -4
  27. package/dist/esm/analytics/useExperiment.mjs +4 -5
  28. package/dist/esm/client/installIntlayer.mjs +1 -2
  29. package/dist/esm/client/useDictionary.mjs +1 -2
  30. package/dist/esm/client/useDictionaryAsync.mjs +1 -2
  31. package/dist/esm/client/useDictionaryDynamic.mjs +1 -2
  32. package/dist/esm/client/useIntlayer.mjs +1 -2
  33. package/dist/esm/client/useLoadDynamic.mjs +1 -2
  34. package/dist/esm/client/useLocale.mjs +6 -11
  35. package/dist/esm/client/useLocaleStorage.mjs +1 -2
  36. package/dist/esm/client/usePathname.mjs +1 -2
  37. package/dist/esm/client/useRewriteURL.mjs +1 -2
  38. package/dist/esm/devtools/buildLocalesInspectorNode.mjs +1 -2
  39. package/dist/esm/devtools/editDictionaryContent.mjs +28 -0
  40. package/dist/esm/devtools/editorServer.mjs +20 -0
  41. package/dist/esm/devtools/formatDictionaryForInspector.mjs +38 -29
  42. package/dist/esm/devtools/index.mjs +155 -57
  43. package/dist/esm/editor/ContentSelector.mjs +1 -3
  44. package/dist/esm/editor/useEditor.mjs +28 -26
  45. package/dist/esm/format/index.mjs +10 -10
  46. package/dist/esm/format/useCompact.mjs +3 -4
  47. package/dist/esm/format/useCurrency.mjs +3 -4
  48. package/dist/esm/format/useDate.mjs +3 -4
  49. package/dist/esm/format/useIntl.mjs +3 -4
  50. package/dist/esm/format/useList.mjs +3 -4
  51. package/dist/esm/format/useNumber.mjs +3 -4
  52. package/dist/esm/format/usePercentage.mjs +3 -4
  53. package/dist/esm/format/useRelativeTime.mjs +3 -4
  54. package/dist/esm/format/useUnit.mjs +3 -4
  55. package/dist/esm/getDictionary.mjs +1 -2
  56. package/dist/esm/getIntlayer.mjs +1 -2
  57. package/dist/esm/html/HTMLRenderer.mjs +1 -2
  58. package/dist/esm/html/index.mjs +3 -3
  59. package/dist/esm/html/installIntlayerHTML.mjs +1 -2
  60. package/dist/esm/index.mjs +17 -17
  61. package/dist/esm/markdown/MarkdownRenderer.mjs +1 -2
  62. package/dist/esm/markdown/compiler.mjs +1 -2
  63. package/dist/esm/markdown/installIntlayerMarkdown.mjs +1 -2
  64. package/dist/esm/markdown/runtime.mjs +1 -2
  65. package/dist/esm/plugins.mjs +63 -64
  66. package/dist/esm/renderIntlayerNode.mjs +1 -2
  67. package/dist/esm-BnFj8Txc.js +1 -0
  68. package/dist/{esm-CtrrRmRn.mjs → esm-hfQR-yiQ.mjs} +77 -82
  69. package/dist/{isEnabled-BbWU6Ox5.mjs → isEnabled-DVKEZ2He.mjs} +1 -2
  70. package/dist/rolldown-runtime-BocRIvOZ.js +1 -0
  71. package/dist/types/devtools/editDictionaryContent.d.ts +47 -0
  72. package/dist/types/devtools/editorServer.d.ts +26 -0
  73. package/dist/types/devtools/formatDictionaryForInspector.d.ts +20 -0
  74. package/dist/types/devtools/index.d.ts +7 -0
  75. package/package.json +14 -14
  76. package/dist/esm-CXlI80Tk.js +0 -1
@@ -1,35 +1,44 @@
1
- //#region src/devtools/formatDictionaryForInspector.ts
2
- var e = (e) => typeof e == "object" && !!e && !Array.isArray(e), t = (t) => e(t) && t.nodeType === "translation" && e(t.translation), n = (e) => {
1
+ import * as e from "@intlayer/types/nodeType";
2
+ // src/devtools/formatDictionaryForInspector.ts
3
+ var t = "(root)", n = (e) => typeof e == "object" && !!e && !Array.isArray(e), r = (t) => n(t) && t.nodeType === e.TRANSLATION && n(t.translation), i = (e) => {
3
4
  if (typeof e == "string") return e;
4
5
  try {
5
6
  return JSON.stringify(e) ?? String(e);
6
7
  } catch {
7
8
  return String(e);
8
9
  }
9
- }, r = (i, a, o) => {
10
- let s = a.length === 0 ? "(root)" : a.join(".");
11
- if (t(i)) {
12
- o[s] = i.translation;
13
- return;
14
- }
15
- if (e(i) && typeof i.nodeType == "string") {
16
- o[s] = n(i[i.nodeType]);
17
- return;
18
- }
19
- if (Array.isArray(i)) {
20
- i.forEach((e, t) => {
21
- r(e, [...a, String(t)], o);
22
- });
23
- return;
24
- }
25
- if (e(i)) {
26
- for (let [e, t] of Object.entries(i)) r(t, [...a, e], o);
27
- return;
28
- }
29
- a.length > 0 && (o[a.join(".")] = n(i));
30
- }, i = (e) => {
31
- let t = {};
32
- return r(e.content, [], t), t;
33
- };
34
- //#endregion
35
- export { i as formatDictionaryForInspector };
10
+ }, a = (e) => e.length === 0 ? t : e.map(({ key: e }) => {
11
+ let t = String(e);
12
+ return t.includes(".") ? JSON.stringify(t) : t;
13
+ }).join("."), o = (t, s, c) => {
14
+ let l = a(s);
15
+ if (r(t)) c.push({
16
+ label: l,
17
+ keyPath: s,
18
+ value: t.translation
19
+ });
20
+ else if (n(t) && typeof t.nodeType == "string") c.push({
21
+ label: l,
22
+ keyPath: s,
23
+ value: i(t[t.nodeType])
24
+ });
25
+ else if (Array.isArray(t)) t.forEach((t, n) => {
26
+ o(t, [...s, {
27
+ type: e.ARRAY,
28
+ key: n
29
+ }], c);
30
+ });
31
+ else if (n(t)) for (let [n, r] of Object.entries(t)) o(r, [...s, {
32
+ type: e.OBJECT,
33
+ key: n
34
+ }], c);
35
+ else s.length > 0 && c.push({
36
+ label: l,
37
+ keyPath: s,
38
+ value: i(t)
39
+ });
40
+ }, s = (e) => {
41
+ let t = [];
42
+ return o(e.content, [], t), t;
43
+ }, c = (e) => Object.fromEntries(s(e).map(({ label: e, value: t }) => [e, t]));
44
+ export { t as ROOT_PATH, c as formatDictionaryForInspector, s as listInspectorEntries };
@@ -1,23 +1,28 @@
1
- import { setLocaleInStorage as e } from "../client/useLocaleStorage.mjs";
2
- import { createIntlayerClient as t } from "../client/installIntlayer.mjs";
3
- import { formatDictionaryForInspector as n } from "./formatDictionaryForInspector.mjs";
4
- import { buildLocalesInspectorNode as r, getLocaleFromNodeId as i, isLocaleNodeId as a } from "./buildLocalesInspectorNode.mjs";
5
- import { internationalization as o } from "@intlayer/config/built";
6
- import { watch as s } from "vue";
7
- import { getDictionaries as c } from "@intlayer/dictionaries-entry";
8
- import { setupDevtoolsPlugin as l } from "@vue/devtools-api";
9
- //#region src/devtools/index.ts
10
- var u = "intlayer", d = "intlayer-dictionaries-inspector", { defaultLocale: f, locales: p } = o ?? {}, m = l, h = (o) => {
11
- m({
12
- id: u,
1
+ import { createIntlayerClient as e } from "../client/installIntlayer.mjs";
2
+ import { setLocaleInStorage as t } from "../client/useLocaleStorage.mjs";
3
+ import { buildLocalesInspectorNode as n, getLocaleFromNodeId as r, isLocaleNodeId as i } from "./buildLocalesInspectorNode.mjs";
4
+ import { applyDictionaryEdit as a, getEditKeyPath as o, getEditability as s, parseEditPath as c } from "./editDictionaryContent.mjs";
5
+ import { createEditorServerSession as l } from "./editorServer.mjs";
6
+ import { formatDictionaryForInspector as u, listInspectorEntries as d } from "./formatDictionaryForInspector.mjs";
7
+ import { internationalization as f } from "@intlayer/config/built";
8
+ import { watch as p } from "vue";
9
+ import { getDictionaries as m } from "@intlayer/dictionaries-entry";
10
+ import { setupDevtoolsPlugin as h } from "@vue/devtools-api";
11
+ // src/devtools/index.ts
12
+ var g = "intlayer", _ = "intlayer-dictionaries-inspector", v = "intlayer-editor-offline", { defaultLocale: y, locales: b } = f ?? {}, x = h, S = (e) => e.localId ?? e.key, C = (e, t) => Object.values(e).flat().find((e) => S(e) === t), w = (e) => e.locale ?? e.filePath?.split("/").pop() ?? "declaration", T = (f) => {
13
+ x({
14
+ id: g,
13
15
  label: "Intlayer",
14
16
  packageName: "vue-intlayer",
15
17
  homepage: "https://intlayer.org",
16
- componentStateTypes: [u],
17
- app: o
18
- }, (o) => {
19
- o.addInspector({
20
- id: d,
18
+ componentStateTypes: [g],
19
+ app: f
20
+ }, (f) => {
21
+ let h = l();
22
+ h.fetchUnmergedDictionaries().then((e) => {
23
+ e && f.sendInspectorTree(_);
24
+ }), f.addInspector({
25
+ id: _,
21
26
  label: "Intlayer",
22
27
  icon: "language",
23
28
  treeFilterPlaceholder: "Search dictionaries",
@@ -25,60 +30,133 @@ var u = "intlayer", d = "intlayer-dictionaries-inspector", { defaultLocale: f, l
25
30
  icon: "check",
26
31
  tooltip: "Set as current locale",
27
32
  action: (n) => {
28
- if (!a(n)) return;
29
- let r = i(n);
30
- if (!p?.map(String).includes(r)) {
31
- console.error(`Locale ${r} is not available`);
33
+ if (!i(n)) return;
34
+ let a = r(n);
35
+ if (!b?.map(String).includes(a)) {
36
+ console.error(`Locale ${a} is not available`);
32
37
  return;
33
38
  }
34
- let s = t();
35
- s.setLocale(r), e(r, s.isCookieEnabled ?? !0), o.sendInspectorTree(d), o.sendInspectorState(d);
39
+ let o = e();
40
+ o.setLocale(a), t(a, o.isCookieEnabled ?? !0), f.sendInspectorTree(_), f.sendInspectorState(_);
36
41
  }
37
42
  }]
38
- }), s(() => t().locale.value, () => {
39
- o.sendInspectorTree(d), o.sendInspectorState(d);
40
- }), o.on.getInspectorTree((e) => {
41
- if (e.inspectorId !== "intlayer-dictionaries-inspector") return;
42
- let n = c(), i = Object.keys(n), a = t().locale.value ?? f;
43
- e.rootNodes = [...i.length === 0 ? [{
44
- id: "intlayer-no-dictionaries",
45
- label: "No dictionaries loaded. Add an Intlayer build plugin (e.g. vite-intlayer) to generate them."
46
- }] : i.map((e) => ({
47
- id: e,
48
- label: e
49
- })), r(a)];
50
- }), o.on.getInspectorState((e) => {
51
- if (e.inspectorId !== "intlayer-dictionaries-inspector") return;
52
- let r = t().locale.value ?? f;
53
- if (e.nodeId === "intlayer-locales") {
54
- e.state = { Locales: (p ?? []).map((e) => ({
43
+ }), p(() => e().locale.value, () => {
44
+ f.sendInspectorTree(_), f.sendInspectorState(_);
45
+ }), f.on.getInspectorTree(async (t) => {
46
+ if (t.inspectorId !== "intlayer-dictionaries-inspector") return;
47
+ let r = e().locale.value ?? y, i = await h.fetchUnmergedDictionaries();
48
+ if (i) {
49
+ t.rootNodes = [...Object.entries(i).flatMap(([e, t]) => t.map((n) => ({
50
+ id: S(n),
51
+ label: t.length > 1 ? `${e} (${w(n)})` : e,
52
+ tags: [{
53
+ label: "editable",
54
+ textColor: 16777215,
55
+ backgroundColor: 4372611
56
+ }]
57
+ }))), n(r)];
58
+ return;
59
+ }
60
+ let a = m(), o = Object.keys(a);
61
+ t.rootNodes = [
62
+ ...o.length === 0 ? [{
63
+ id: "intlayer-no-dictionaries",
64
+ label: "No dictionaries loaded. Add an Intlayer build plugin (e.g. vite-intlayer) to generate them."
65
+ }] : o.map((e) => ({
66
+ id: e,
67
+ label: e
68
+ })),
69
+ {
70
+ id: v,
71
+ label: "Enable live editing (editor server)"
72
+ },
73
+ n(r)
74
+ ];
75
+ }), f.on.getInspectorState(async (t) => {
76
+ if (t.inspectorId !== "intlayer-dictionaries-inspector") return;
77
+ let n = e().locale.value ?? y;
78
+ if (t.nodeId === "intlayer-locales") {
79
+ t.state = { Locales: (b ?? []).map((e) => ({
55
80
  key: e,
56
- value: e === r ? "current" : "",
81
+ value: e === n ? "current" : "",
57
82
  editable: !1
58
83
  })) };
59
84
  return;
60
85
  }
61
- if (a(e.nodeId)) {
62
- let t = i(e.nodeId);
63
- e.state = { Locale: [{
86
+ if (i(t.nodeId)) {
87
+ let e = r(t.nodeId);
88
+ t.state = { Locale: [{
64
89
  key: "locale",
65
- value: t,
90
+ value: e,
66
91
  editable: !1
67
92
  }, {
68
93
  key: "current",
69
- value: t === r,
94
+ value: e === n,
70
95
  editable: !1
71
96
  }] };
72
97
  return;
73
98
  }
74
- let o = c()[e.nodeId];
75
- if (!o) {
76
- e.state = {};
99
+ if (t.nodeId === "intlayer-editor-offline") {
100
+ t.state = { "Live editing": [
101
+ {
102
+ key: "status",
103
+ value: "Intlayer editor server not detected",
104
+ editable: !1
105
+ },
106
+ {
107
+ key: "enable it",
108
+ value: "Set `editor.enabled: true` in intlayer.config, run `npx intlayer editor start`, then reopen this panel",
109
+ editable: !1
110
+ },
111
+ {
112
+ key: "edits",
113
+ value: "Edits are written back to your .content source files",
114
+ editable: !1
115
+ }
116
+ ] };
117
+ return;
118
+ }
119
+ let a = await h.fetchUnmergedDictionaries(), o = a ? C(a, t.nodeId) : void 0;
120
+ if (o) {
121
+ t.state = {
122
+ Translations: d(o).map(({ label: e, keyPath: t, value: n }) => ({
123
+ key: e,
124
+ value: n,
125
+ editable: s(o, t) !== null
126
+ })),
127
+ Metadata: [
128
+ {
129
+ key: "key",
130
+ value: o.key,
131
+ editable: !1
132
+ },
133
+ {
134
+ key: "title",
135
+ value: o.title ?? "",
136
+ editable: !1
137
+ },
138
+ {
139
+ key: "description",
140
+ value: o.description ?? "",
141
+ editable: !1
142
+ },
143
+ {
144
+ key: "file",
145
+ value: o.filePath ?? "",
146
+ editable: !1
147
+ }
148
+ ]
149
+ };
77
150
  return;
78
151
  }
79
- let s = n(o);
80
- e.state = {
81
- Translations: Object.entries(s).map(([e, t]) => ({
152
+ let c = m()[t.nodeId];
153
+ if (!c) {
154
+ t.state = {};
155
+ return;
156
+ }
157
+ let l = u(c);
158
+ t.state = {
159
+ Translations: Object.entries(l).map(([e, t]) => ({
82
160
  key: e,
83
161
  value: t,
84
162
  editable: !1
@@ -86,23 +164,43 @@ var u = "intlayer", d = "intlayer-dictionaries-inspector", { defaultLocale: f, l
86
164
  Metadata: [
87
165
  {
88
166
  key: "key",
89
- value: o.key,
167
+ value: c.key,
90
168
  editable: !1
91
169
  },
92
170
  {
93
171
  key: "title",
94
- value: o.title ?? "",
172
+ value: c.title ?? "",
95
173
  editable: !1
96
174
  },
97
175
  {
98
176
  key: "description",
99
- value: o.description ?? "",
177
+ value: c.description ?? "",
100
178
  editable: !1
101
179
  }
102
180
  ]
103
181
  };
104
182
  });
183
+ let g = Promise.resolve();
184
+ f.on.editInspectorState((e) => {
185
+ if (e.inspectorId !== "intlayer-dictionaries-inspector" || e.state.remove) return;
186
+ let t = c(e.path), n = e.state.value;
187
+ if (t && typeof n == "string") return g = g.catch(() => {}).then(async () => {
188
+ let r = await h.fetchUnmergedDictionaries();
189
+ if (!r) return;
190
+ let i = C(r, e.nodeId);
191
+ if (!i) return;
192
+ let s = o(i, t);
193
+ if (!s) return;
194
+ let c = a(i, s, n);
195
+ if (c) try {
196
+ await h.writeDictionary(c);
197
+ } catch (e) {
198
+ console.error("[intlayer] Failed to save the dictionary through the editor server:", e);
199
+ } finally {
200
+ f.sendInspectorState(_);
201
+ }
202
+ }), g;
203
+ });
105
204
  });
106
205
  };
107
- //#endregion
108
- export { u as INTLAYER_DEVTOOLS_PLUGIN_ID, d as INTLAYER_DICTIONARIES_INSPECTOR_ID, h as enableIntlayerDevtools };
206
+ export { v as EDITOR_OFFLINE_NODE_ID, g as INTLAYER_DEVTOOLS_PLUGIN_ID, _ as INTLAYER_DICTIONARIES_INSPECTOR_ID, T as enableIntlayerDevtools };
@@ -1,7 +1,6 @@
1
1
  import { defineComponent as e, h as t } from "vue";
2
2
  import { isEnabled as n } from "@intlayer/editor/isEnabled";
3
- //#endregion
4
- //#region src/editor/ContentSelector.vue
3
+ // src/editor/ContentSelector.vue
5
4
  var r = e({
6
5
  name: "ContentSelector",
7
6
  props: {
@@ -21,5 +20,4 @@ var r = e({
21
20
  }, r.default?.());
22
21
  }
23
22
  });
24
- //#endregion
25
23
  export { r as default };
@@ -1,26 +1,29 @@
1
1
  import { INTLAYER_SYMBOL as e } from "../client/installIntlayer.mjs";
2
- import { inject as t, onMounted as n, onUnmounted as r, watchEffect as i } from "vue";
3
- import { isEnabled as a } from "@intlayer/editor/isEnabled";
4
- //#region src/editor/useEditor.ts
5
- var o = (e) => {
6
- let t = null, n = !1;
7
- return import("@intlayer/editor").then(({ initEditorClient: r }) => {
8
- if (n) return;
9
- let a = r();
10
- e && (t = i(() => {
11
- let t = e.value;
12
- t && a.currentLocale.set(t);
13
- }));
2
+ import { setLocaleInStorage as t } from "../client/useLocaleStorage.mjs";
3
+ import { inject as n, onMounted as r, onUnmounted as i, watchEffect as a } from "vue";
4
+ import { isEnabled as o } from "@intlayer/editor/isEnabled";
5
+ // src/editor/useEditor.ts
6
+ var s = (e) => {
7
+ let n = e?.locale, r = null, i = null, o = !1;
8
+ return import("@intlayer/editor").then(({ initEditorClient: s }) => {
9
+ if (o) return;
10
+ let c = s();
11
+ n && (r = a(() => {
12
+ let e = n.value;
13
+ e && c.currentLocale.set(e);
14
+ })), i = c.onLocaleChangeRequested((n) => {
15
+ e?.setLocale(n), t(n, !0);
16
+ });
14
17
  }).catch(() => {}), () => {
15
- n = !0, t?.(), import("@intlayer/editor").then(({ stopEditorClient: e }) => {
18
+ o = !0, r?.(), i?.(), import("@intlayer/editor").then(({ stopEditorClient: e }) => {
16
19
  e();
17
20
  }).catch(() => {});
18
21
  };
19
- }, s = (i) => {
20
- if (process.env.INTLAYER_EDITOR_ENABLED === "false" || !a) return;
21
- if (i) {
22
- let t = null;
23
- i.mixin({
22
+ }, c = (t) => {
23
+ if (process.env.INTLAYER_EDITOR_ENABLED === "false" || !o) return;
24
+ if (t) {
25
+ let n = null;
26
+ t.mixin({
24
27
  inject: { _intlayerClient: {
25
28
  from: e,
26
29
  default: null
@@ -28,20 +31,19 @@ var o = (e) => {
28
31
  mounted() {
29
32
  if (this.$parent !== null) return;
30
33
  let e = this._intlayerClient;
31
- t = o(e?.locale);
34
+ n = s(e);
32
35
  },
33
36
  unmounted() {
34
- this.$parent === null && t?.();
37
+ this.$parent === null && n?.();
35
38
  }
36
39
  });
37
40
  return;
38
41
  }
39
- let s = t(e), c = null;
40
- n(() => {
41
- c = o(s?.locale);
42
- }), r(() => {
42
+ let a = n(e), c = null;
43
+ r(() => {
44
+ c = s(a);
45
+ }), i(() => {
43
46
  c?.();
44
47
  });
45
48
  };
46
- //#endregion
47
- export { s as useEditor };
49
+ export { c as useEditor };
@@ -1,10 +1,10 @@
1
- import { usePercentage as e } from "./usePercentage.mjs";
2
- import { useUnit as t } from "./useUnit.mjs";
3
- import { useCompact as n } from "./useCompact.mjs";
4
- import { useNumber as r } from "./useNumber.mjs";
5
- import { useIntl as i } from "./useIntl.mjs";
6
- import { useList as a } from "./useList.mjs";
7
- import { useCurrency as o } from "./useCurrency.mjs";
8
- import { useDate as s } from "./useDate.mjs";
9
- import { useRelativeTime as c } from "./useRelativeTime.mjs";
10
- export { n as useCompact, o as useCurrency, s as useDate, i as useIntl, a as useList, r as useNumber, e as usePercentage, c as useRelativeTime, t as useUnit };
1
+ import { useCompact as e } from "./useCompact.mjs";
2
+ import { useCurrency as t } from "./useCurrency.mjs";
3
+ import { useDate as n } from "./useDate.mjs";
4
+ import { useIntl as r } from "./useIntl.mjs";
5
+ import { useList as i } from "./useList.mjs";
6
+ import { useNumber as a } from "./useNumber.mjs";
7
+ import { usePercentage as o } from "./usePercentage.mjs";
8
+ import { useRelativeTime as s } from "./useRelativeTime.mjs";
9
+ import { useUnit as c } from "./useUnit.mjs";
10
+ export { e as useCompact, t as useCurrency, n as useDate, r as useIntl, i as useList, a as useNumber, o as usePercentage, s as useRelativeTime, c as useUnit };
@@ -1,16 +1,15 @@
1
1
  import { INTLAYER_SYMBOL as e } from "../client/installIntlayer.mjs";
2
2
  import { computed as t, inject as n } from "vue";
3
3
  import { compact as r } from "@intlayer/core/formatters";
4
- //#region src/format/useCompact.ts
4
+ // src/format/useCompact.ts
5
5
  var i = () => {
6
- let i = n(e);
6
+ let i = n(e, null);
7
7
  return t(() => {
8
- let e = i.locale.value;
8
+ let e = i?.locale.value;
9
9
  return (...t) => r(t[0], {
10
10
  ...t[1],
11
11
  locale: t[1]?.locale ?? e
12
12
  });
13
13
  });
14
14
  };
15
- //#endregion
16
15
  export { i as useCompact };
@@ -1,16 +1,15 @@
1
1
  import { INTLAYER_SYMBOL as e } from "../client/installIntlayer.mjs";
2
2
  import { computed as t, inject as n } from "vue";
3
3
  import { currency as r } from "@intlayer/core/formatters";
4
- //#region src/format/useCurrency.ts
4
+ // src/format/useCurrency.ts
5
5
  var i = () => {
6
- let i = n(e);
6
+ let i = n(e, null);
7
7
  return t(() => {
8
- let e = i.locale.value;
8
+ let e = i?.locale.value;
9
9
  return (...t) => r(t[0], {
10
10
  ...t[1],
11
11
  locale: t[1]?.locale ?? e
12
12
  });
13
13
  });
14
14
  };
15
- //#endregion
16
15
  export { i as useCurrency };
@@ -1,11 +1,11 @@
1
1
  import { INTLAYER_SYMBOL as e } from "../client/installIntlayer.mjs";
2
2
  import { computed as t, inject as n } from "vue";
3
3
  import { date as r, presets as i } from "@intlayer/core/formatters";
4
- //#region src/format/useDate.ts
4
+ // src/format/useDate.ts
5
5
  var a = () => {
6
- let a = n(e);
6
+ let a = n(e, null);
7
7
  return t(() => {
8
- let e = a.locale.value;
8
+ let e = a?.locale.value;
9
9
  return (...t) => {
10
10
  let n = typeof t[1] == "string" ? {
11
11
  ...i[t[1]],
@@ -18,5 +18,4 @@ var a = () => {
18
18
  };
19
19
  });
20
20
  };
21
- //#endregion
22
21
  export { a as useDate };
@@ -1,13 +1,12 @@
1
1
  import { INTLAYER_SYMBOL as e } from "../client/installIntlayer.mjs";
2
2
  import { computed as t, inject as n } from "vue";
3
3
  import { bindIntl as r } from "@intlayer/core/utils";
4
- //#region src/format/useIntl.ts
4
+ // src/format/useIntl.ts
5
5
  var i = (i) => {
6
- let a = n(e);
6
+ let a = n(e, null);
7
7
  return t(() => {
8
- let e = i ?? a.locale.value;
8
+ let e = i ?? a?.locale.value;
9
9
  return r(e);
10
10
  });
11
11
  };
12
- //#endregion
13
12
  export { i as useIntl };
@@ -1,16 +1,15 @@
1
1
  import { INTLAYER_SYMBOL as e } from "../client/installIntlayer.mjs";
2
2
  import { computed as t, inject as n } from "vue";
3
3
  import { list as r } from "@intlayer/core/formatters";
4
- //#region src/format/useList.ts
4
+ // src/format/useList.ts
5
5
  var i = () => {
6
- let i = n(e);
6
+ let i = n(e, null);
7
7
  return t(() => {
8
- let e = i.locale.value;
8
+ let e = i?.locale.value;
9
9
  return (...t) => r(t[0], {
10
10
  ...t[1],
11
11
  locale: t[1]?.locale ?? e
12
12
  });
13
13
  });
14
14
  };
15
- //#endregion
16
15
  export { i as useList };
@@ -1,16 +1,15 @@
1
1
  import { INTLAYER_SYMBOL as e } from "../client/installIntlayer.mjs";
2
2
  import { computed as t, inject as n } from "vue";
3
3
  import { number as r } from "@intlayer/core/formatters";
4
- //#region src/format/useNumber.ts
4
+ // src/format/useNumber.ts
5
5
  var i = () => {
6
- let i = n(e);
6
+ let i = n(e, null);
7
7
  return t(() => {
8
- let e = i.locale.value;
8
+ let e = i?.locale.value;
9
9
  return (...t) => r(t[0], {
10
10
  ...t[1],
11
11
  locale: t[1]?.locale ?? e
12
12
  });
13
13
  });
14
14
  };
15
- //#endregion
16
15
  export { i as useNumber };
@@ -1,16 +1,15 @@
1
1
  import { INTLAYER_SYMBOL as e } from "../client/installIntlayer.mjs";
2
2
  import { computed as t, inject as n } from "vue";
3
3
  import { percentage as r } from "@intlayer/core/formatters";
4
- //#region src/format/usePercentage.ts
4
+ // src/format/usePercentage.ts
5
5
  var i = () => {
6
- let i = n(e);
6
+ let i = n(e, null);
7
7
  return t(() => {
8
- let e = i.locale.value;
8
+ let e = i?.locale.value;
9
9
  return (...t) => r(t[0], {
10
10
  ...t[1],
11
11
  locale: t[1]?.locale ?? e
12
12
  });
13
13
  });
14
14
  };
15
- //#endregion
16
15
  export { i as usePercentage };
@@ -1,16 +1,15 @@
1
1
  import { INTLAYER_SYMBOL as e } from "../client/installIntlayer.mjs";
2
2
  import { computed as t, inject as n } from "vue";
3
3
  import { relativeTime as r } from "@intlayer/core/formatters";
4
- //#region src/format/useRelativeTime.ts
4
+ // src/format/useRelativeTime.ts
5
5
  var i = () => {
6
- let i = n(e);
6
+ let i = n(e, null);
7
7
  return t(() => {
8
- let e = i.locale.value;
8
+ let e = i?.locale.value;
9
9
  return (...t) => r(t[0], t[1], {
10
10
  ...t[2],
11
11
  locale: t[2]?.locale ?? e
12
12
  });
13
13
  });
14
14
  };
15
- //#endregion
16
15
  export { i as useRelativeTime };
@@ -1,16 +1,15 @@
1
1
  import { INTLAYER_SYMBOL as e } from "../client/installIntlayer.mjs";
2
2
  import { computed as t, inject as n } from "vue";
3
3
  import { units as r } from "@intlayer/core/formatters";
4
- //#region src/format/useUnit.ts
4
+ // src/format/useUnit.ts
5
5
  var i = () => {
6
- let i = n(e);
6
+ let i = n(e, null);
7
7
  return t(() => {
8
- let e = i.locale.value;
8
+ let e = i?.locale.value;
9
9
  return (...t) => r(t[0], {
10
10
  ...t[1],
11
11
  locale: t[1]?.locale ?? e
12
12
  });
13
13
  });
14
14
  };
15
- //#endregion
16
15
  export { i as useUnit };
@@ -1,9 +1,8 @@
1
1
  import { getPlugins as e } from "./plugins.mjs";
2
2
  import { getDictionary as t } from "@intlayer/core/interpreter";
3
- //#region src/getDictionary.ts
3
+ // src/getDictionary.ts
4
4
  var n = (n, r) => {
5
5
  let i = typeof r == "object" && r ? r.locale : r;
6
6
  return t(n, r, e(i));
7
7
  };
8
- //#endregion
9
8
  export { n as getDictionary };