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.
- package/dist/cjs/analytics/useAnalytics.cjs +1 -1
- package/dist/cjs/analytics/useConversion.cjs +1 -1
- package/dist/cjs/analytics/useExperiment.cjs +1 -1
- package/dist/cjs/client/useLocale.cjs +1 -1
- package/dist/cjs/devtools/editDictionaryContent.cjs +1 -0
- package/dist/cjs/devtools/editorServer.cjs +1 -0
- package/dist/cjs/devtools/formatDictionaryForInspector.cjs +1 -1
- package/dist/cjs/devtools/index.cjs +1 -1
- package/dist/cjs/editor/useEditor.cjs +1 -1
- package/dist/cjs/format/index.cjs +1 -1
- package/dist/cjs/format/useCompact.cjs +1 -1
- package/dist/cjs/format/useCurrency.cjs +1 -1
- package/dist/cjs/format/useDate.cjs +1 -1
- package/dist/cjs/format/useIntl.cjs +1 -1
- package/dist/cjs/format/useList.cjs +1 -1
- package/dist/cjs/format/useNumber.cjs +1 -1
- package/dist/cjs/format/usePercentage.cjs +1 -1
- package/dist/cjs/format/useRelativeTime.cjs +1 -1
- package/dist/cjs/format/useUnit.cjs +1 -1
- package/dist/cjs/html/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/esm/UI/ContentSelector.mjs +1 -2
- package/dist/esm/analytics/exposureSink.mjs +1 -2
- package/dist/esm/analytics/useAnalytics.mjs +19 -20
- package/dist/esm/analytics/useConversion.mjs +3 -4
- package/dist/esm/analytics/useExperiment.mjs +4 -5
- package/dist/esm/client/installIntlayer.mjs +1 -2
- package/dist/esm/client/useDictionary.mjs +1 -2
- package/dist/esm/client/useDictionaryAsync.mjs +1 -2
- package/dist/esm/client/useDictionaryDynamic.mjs +1 -2
- package/dist/esm/client/useIntlayer.mjs +1 -2
- package/dist/esm/client/useLoadDynamic.mjs +1 -2
- package/dist/esm/client/useLocale.mjs +6 -11
- package/dist/esm/client/useLocaleStorage.mjs +1 -2
- package/dist/esm/client/usePathname.mjs +1 -2
- package/dist/esm/client/useRewriteURL.mjs +1 -2
- package/dist/esm/devtools/buildLocalesInspectorNode.mjs +1 -2
- package/dist/esm/devtools/editDictionaryContent.mjs +28 -0
- package/dist/esm/devtools/editorServer.mjs +20 -0
- package/dist/esm/devtools/formatDictionaryForInspector.mjs +38 -29
- package/dist/esm/devtools/index.mjs +155 -57
- package/dist/esm/editor/ContentSelector.mjs +1 -3
- package/dist/esm/editor/useEditor.mjs +28 -26
- package/dist/esm/format/index.mjs +10 -10
- package/dist/esm/format/useCompact.mjs +3 -4
- package/dist/esm/format/useCurrency.mjs +3 -4
- package/dist/esm/format/useDate.mjs +3 -4
- package/dist/esm/format/useIntl.mjs +3 -4
- package/dist/esm/format/useList.mjs +3 -4
- package/dist/esm/format/useNumber.mjs +3 -4
- package/dist/esm/format/usePercentage.mjs +3 -4
- package/dist/esm/format/useRelativeTime.mjs +3 -4
- package/dist/esm/format/useUnit.mjs +3 -4
- package/dist/esm/getDictionary.mjs +1 -2
- package/dist/esm/getIntlayer.mjs +1 -2
- package/dist/esm/html/HTMLRenderer.mjs +1 -2
- package/dist/esm/html/index.mjs +3 -3
- package/dist/esm/html/installIntlayerHTML.mjs +1 -2
- package/dist/esm/index.mjs +17 -17
- package/dist/esm/markdown/MarkdownRenderer.mjs +1 -2
- package/dist/esm/markdown/compiler.mjs +1 -2
- package/dist/esm/markdown/installIntlayerMarkdown.mjs +1 -2
- package/dist/esm/markdown/runtime.mjs +1 -2
- package/dist/esm/plugins.mjs +63 -64
- package/dist/esm/renderIntlayerNode.mjs +1 -2
- package/dist/esm-BnFj8Txc.js +1 -0
- package/dist/{esm-CtrrRmRn.mjs → esm-hfQR-yiQ.mjs} +77 -82
- package/dist/{isEnabled-BbWU6Ox5.mjs → isEnabled-DVKEZ2He.mjs} +1 -2
- package/dist/rolldown-runtime-BocRIvOZ.js +1 -0
- package/dist/types/devtools/editDictionaryContent.d.ts +47 -0
- package/dist/types/devtools/editorServer.d.ts +26 -0
- package/dist/types/devtools/formatDictionaryForInspector.d.ts +20 -0
- package/dist/types/devtools/index.d.ts +7 -0
- package/package.json +14 -14
- package/dist/esm-CXlI80Tk.js +0 -1
|
@@ -1,35 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
},
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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: [
|
|
17
|
-
app:
|
|
18
|
-
}, (
|
|
19
|
-
|
|
20
|
-
|
|
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 (!
|
|
29
|
-
let
|
|
30
|
-
if (!
|
|
31
|
-
console.error(`Locale ${
|
|
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
|
|
35
|
-
|
|
39
|
+
let o = e();
|
|
40
|
+
o.setLocale(a), t(a, o.isCookieEnabled ?? !0), f.sendInspectorTree(_), f.sendInspectorState(_);
|
|
36
41
|
}
|
|
37
42
|
}]
|
|
38
|
-
}),
|
|
39
|
-
|
|
40
|
-
}),
|
|
41
|
-
if (
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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 ===
|
|
81
|
+
value: e === n ? "current" : "",
|
|
57
82
|
editable: !1
|
|
58
83
|
})) };
|
|
59
84
|
return;
|
|
60
85
|
}
|
|
61
|
-
if (
|
|
62
|
-
let
|
|
63
|
-
|
|
86
|
+
if (i(t.nodeId)) {
|
|
87
|
+
let e = r(t.nodeId);
|
|
88
|
+
t.state = { Locale: [{
|
|
64
89
|
key: "locale",
|
|
65
|
-
value:
|
|
90
|
+
value: e,
|
|
66
91
|
editable: !1
|
|
67
92
|
}, {
|
|
68
93
|
key: "current",
|
|
69
|
-
value:
|
|
94
|
+
value: e === n,
|
|
70
95
|
editable: !1
|
|
71
96
|
}] };
|
|
72
97
|
return;
|
|
73
98
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
|
80
|
-
|
|
81
|
-
|
|
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:
|
|
167
|
+
value: c.key,
|
|
90
168
|
editable: !1
|
|
91
169
|
},
|
|
92
170
|
{
|
|
93
171
|
key: "title",
|
|
94
|
-
value:
|
|
172
|
+
value: c.title ?? "",
|
|
95
173
|
editable: !1
|
|
96
174
|
},
|
|
97
175
|
{
|
|
98
176
|
key: "description",
|
|
99
|
-
value:
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
18
|
+
o = !0, r?.(), i?.(), import("@intlayer/editor").then(({ stopEditorClient: e }) => {
|
|
16
19
|
e();
|
|
17
20
|
}).catch(() => {});
|
|
18
21
|
};
|
|
19
|
-
},
|
|
20
|
-
if (process.env.INTLAYER_EDITOR_ENABLED === "false" || !
|
|
21
|
-
if (
|
|
22
|
-
let
|
|
23
|
-
|
|
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
|
-
|
|
34
|
+
n = s(e);
|
|
32
35
|
},
|
|
33
36
|
unmounted() {
|
|
34
|
-
this.$parent === null &&
|
|
37
|
+
this.$parent === null && n?.();
|
|
35
38
|
}
|
|
36
39
|
});
|
|
37
40
|
return;
|
|
38
41
|
}
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
c =
|
|
42
|
-
}),
|
|
42
|
+
let a = n(e), c = null;
|
|
43
|
+
r(() => {
|
|
44
|
+
c = s(a);
|
|
45
|
+
}), i(() => {
|
|
43
46
|
c?.();
|
|
44
47
|
});
|
|
45
48
|
};
|
|
46
|
-
|
|
47
|
-
export { s as useEditor };
|
|
49
|
+
export { c as useEditor };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
export {
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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 };
|