vue-intlayer 9.7.0 → 9.7.2
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/useDictionary.cjs +1 -1
- package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
- package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/client/useLocale.cjs +1 -1
- package/dist/cjs/devtools/editDictionaryContent.cjs +1 -1
- 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/html/HTMLRenderer.cjs +1 -1
- package/dist/cjs/html/index.cjs +1 -1
- package/dist/cjs/html/installIntlayerHTML.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 +26 -27
- package/dist/esm/client/useDictionaryAsync.mjs +6 -7
- package/dist/esm/client/useDictionaryDynamic.mjs +9 -10
- package/dist/esm/client/useIntlayer.mjs +19 -20
- 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 +14 -15
- package/dist/esm/devtools/editorServer.mjs +1 -2
- package/dist/esm/devtools/formatDictionaryForInspector.mjs +20 -33
- package/dist/esm/devtools/index.mjs +57 -58
- package/dist/esm/editor/ContentSelector.mjs +1 -3
- package/dist/esm/editor/useEditor.mjs +11 -12
- package/dist/esm/format/index.mjs +10 -10
- package/dist/esm/format/useCompact.mjs +1 -2
- package/dist/esm/format/useCurrency.mjs +1 -2
- package/dist/esm/format/useDate.mjs +1 -2
- package/dist/esm/format/useIntl.mjs +1 -2
- package/dist/esm/format/useList.mjs +1 -2
- package/dist/esm/format/useNumber.mjs +1 -2
- package/dist/esm/format/usePercentage.mjs +1 -2
- package/dist/esm/format/useRelativeTime.mjs +1 -2
- package/dist/esm/format/useUnit.mjs +1 -2
- package/dist/esm/getDictionary.mjs +1 -2
- package/dist/esm/getIntlayer.mjs +1 -2
- package/dist/esm/html/HTMLRenderer.mjs +8 -9
- package/dist/esm/html/index.mjs +3 -3
- package/dist/esm/html/installIntlayerHTML.mjs +13 -14
- 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 +76 -77
- 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/package.json +51 -51
- package/dist/esm-CXlI80Tk.js +0 -1
|
@@ -1,31 +1,38 @@
|
|
|
1
|
-
import { r as e } from "./isEnabled-
|
|
1
|
+
import { r as e } from "./isEnabled-DVKEZ2He.mjs";
|
|
2
2
|
import { analytics as t, editor as n } from "@intlayer/config/built";
|
|
3
|
-
|
|
4
|
-
var r = (e) => {
|
|
3
|
+
// ../@intlayer/analytics/dist/esm/events/contentExposure.mjs
|
|
4
|
+
var r = (e) => e.map((e) => e.key === void 0 ? "*" : String(e.key)).join("."), i = (e) => ({
|
|
5
|
+
dictionaryKey: e.dictionaryKey,
|
|
6
|
+
keyPath: r(e.keyPath),
|
|
7
|
+
locale: e.locale,
|
|
8
|
+
nodeType: e.nodeType,
|
|
9
|
+
experimentKey: e.experimentKey,
|
|
10
|
+
variant: e.variant
|
|
11
|
+
}), a = (e) => {
|
|
5
12
|
let t = 2166136261;
|
|
6
13
|
for (let n = 0; n < e.length; n++) t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
|
|
7
14
|
return t >>> 0;
|
|
8
|
-
},
|
|
15
|
+
}, o = (e, t, n, r) => {
|
|
9
16
|
if (n.length === 0) throw Error("assignVariant requires at least one variant");
|
|
10
17
|
if (n.length === 1) return n[0];
|
|
11
|
-
let
|
|
12
|
-
if (!
|
|
13
|
-
let e = Math.floor(
|
|
18
|
+
let i = a(`${e}:${t}`) / 4294967296;
|
|
19
|
+
if (!r || r.length !== n.length) {
|
|
20
|
+
let e = Math.floor(i * n.length);
|
|
14
21
|
return n[Math.min(e, n.length - 1)];
|
|
15
22
|
}
|
|
16
|
-
let o =
|
|
17
|
-
if (o <= 0) return n[Math.floor(
|
|
18
|
-
let s = 0, c =
|
|
19
|
-
for (let e = 0; e < n.length; e++) if (s +=
|
|
23
|
+
let o = r.reduce((e, t) => e + t, 0);
|
|
24
|
+
if (o <= 0) return n[Math.floor(i * n.length)];
|
|
25
|
+
let s = 0, c = i * o;
|
|
26
|
+
for (let e = 0; e < n.length; e++) if (s += r[e], c < s) return n[e];
|
|
20
27
|
return n[n.length - 1];
|
|
21
|
-
},
|
|
28
|
+
}, s = "", c = (e) => [
|
|
22
29
|
e.url,
|
|
23
30
|
e.dictionaryKey,
|
|
24
31
|
e.keyPath,
|
|
25
32
|
e.locale,
|
|
26
33
|
e.experimentKey ?? "",
|
|
27
34
|
e.variant ?? ""
|
|
28
|
-
].join(
|
|
35
|
+
].join(s), l = ({ max: e }) => {
|
|
29
36
|
let t = [], n = /* @__PURE__ */ new Map(), r = () => t.length + n.size, i = () => {
|
|
30
37
|
for (; r() > e && n.size > 0;) {
|
|
31
38
|
let e = n.keys().next().value;
|
|
@@ -36,7 +43,7 @@ var r = (e) => {
|
|
|
36
43
|
return {
|
|
37
44
|
push: (e) => {
|
|
38
45
|
if (e.type === "content_exposure") {
|
|
39
|
-
let t =
|
|
46
|
+
let t = c(e), r = n.get(t);
|
|
40
47
|
r ? (r.count = (r.count ?? 1) + (e.count ?? 1), r.t = e.t) : n.set(t, {
|
|
41
48
|
...e,
|
|
42
49
|
count: e.count ?? 1
|
|
@@ -50,20 +57,20 @@ var r = (e) => {
|
|
|
50
57
|
},
|
|
51
58
|
size: r
|
|
52
59
|
};
|
|
53
|
-
},
|
|
60
|
+
}, u = (e, t) => t >= 1 ? !0 : t <= 0 ? !1 : a(e) / 4294967295 < t, d = "__intlayer_analytics_sid__", f = () => {
|
|
54
61
|
let e = typeof globalThis < "u" ? globalThis.crypto : void 0;
|
|
55
62
|
return e?.randomUUID ? e.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
56
|
-
},
|
|
57
|
-
if (typeof window > "u" || !window.sessionStorage) return
|
|
63
|
+
}, p = () => {
|
|
64
|
+
if (typeof window > "u" || !window.sessionStorage) return f();
|
|
58
65
|
try {
|
|
59
|
-
let e = window.sessionStorage.getItem(
|
|
66
|
+
let e = window.sessionStorage.getItem(d);
|
|
60
67
|
if (e) return e;
|
|
61
|
-
let t =
|
|
62
|
-
return window.sessionStorage.setItem(
|
|
68
|
+
let t = f();
|
|
69
|
+
return window.sessionStorage.setItem(d, t), t;
|
|
63
70
|
} catch {
|
|
64
|
-
return
|
|
71
|
+
return f();
|
|
65
72
|
}
|
|
66
|
-
},
|
|
73
|
+
}, m = (e, t, { useBeacon: n = !1, token: r } = {}) => {
|
|
67
74
|
try {
|
|
68
75
|
let i = JSON.stringify(t);
|
|
69
76
|
return n && typeof navigator < "u" && typeof navigator.sendBeacon == "function" ? navigator.sendBeacon(e, i) : typeof fetch == "function" && (fetch(e, {
|
|
@@ -80,32 +87,28 @@ var r = (e) => {
|
|
|
80
87
|
} catch {
|
|
81
88
|
return !1;
|
|
82
89
|
}
|
|
83
|
-
},
|
|
90
|
+
}, h = (e) => {
|
|
84
91
|
if (typeof window > "u") return;
|
|
85
92
|
let t = window.requestIdleCallback;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
setTimeout(e, 1);
|
|
91
|
-
}, m = "__intlayer_public_token__", h = 6e4, g = () => {
|
|
93
|
+
typeof t == "function" ? t(() => e()) : setTimeout(e, 1);
|
|
94
|
+
}, g = "__intlayer_public_token__", _ = 6e4, v = () => {
|
|
92
95
|
try {
|
|
93
|
-
let e = window.sessionStorage?.getItem(
|
|
96
|
+
let e = window.sessionStorage?.getItem(g);
|
|
94
97
|
if (!e) return null;
|
|
95
98
|
let t = JSON.parse(e);
|
|
96
99
|
return typeof t?.token != "string" || typeof t?.expiresAt != "number" ? null : t;
|
|
97
100
|
} catch {
|
|
98
101
|
return null;
|
|
99
102
|
}
|
|
100
|
-
},
|
|
103
|
+
}, y = (e) => {
|
|
101
104
|
try {
|
|
102
|
-
window.sessionStorage?.setItem(
|
|
105
|
+
window.sessionStorage?.setItem(g, JSON.stringify(e));
|
|
103
106
|
} catch {}
|
|
104
|
-
},
|
|
105
|
-
let n = `${e.replace(/\/$/, "")}/api/public/token`, r = null, i = null, a = (e) => e !== null && e.expiresAt -
|
|
107
|
+
}, b = ({ backendURL: e, clientId: t }) => {
|
|
108
|
+
let n = `${e.replace(/\/$/, "")}/api/public/token`, r = null, i = null, a = (e) => e !== null && e.expiresAt - _ > Date.now(), o = () => {
|
|
106
109
|
if (a(r)) return r.token;
|
|
107
110
|
if (typeof window < "u") {
|
|
108
|
-
let e =
|
|
111
|
+
let e = v();
|
|
109
112
|
if (a(e)) return r = e, e.token;
|
|
110
113
|
}
|
|
111
114
|
}, s = async () => {
|
|
@@ -123,7 +126,7 @@ var r = (e) => {
|
|
|
123
126
|
r = {
|
|
124
127
|
token: a,
|
|
125
128
|
expiresAt: Date.now() + o * 1e3
|
|
126
|
-
}, typeof window < "u" &&
|
|
129
|
+
}, typeof window < "u" && y(r);
|
|
127
130
|
} catch {} finally {
|
|
128
131
|
i = null;
|
|
129
132
|
}
|
|
@@ -134,59 +137,59 @@ var r = (e) => {
|
|
|
134
137
|
t && typeof fetch == "function" && (o() || (i ||= s()));
|
|
135
138
|
}
|
|
136
139
|
};
|
|
137
|
-
},
|
|
140
|
+
}, x = "intlayer-analytics/1", S = () => typeof window > "u" || !window.location ? "" : window.location.pathname, C = () => {
|
|
138
141
|
if (typeof document < "u" && document.referrer) try {
|
|
139
142
|
return new URL(document.referrer).host;
|
|
140
143
|
} catch {
|
|
141
144
|
return;
|
|
142
145
|
}
|
|
143
|
-
},
|
|
144
|
-
let n =
|
|
146
|
+
}, w = (t) => {
|
|
147
|
+
let n = p(), r = e(), i = !r && u(n, t.sampleRate), a = l({ max: t.maxBufferSize }), s = `${t.backendURL.replace(/\/$/, "")}/api/analytics/events`, c = b({
|
|
145
148
|
backendURL: t.backendURL,
|
|
146
149
|
clientId: t.clientId
|
|
147
|
-
}),
|
|
148
|
-
let r =
|
|
149
|
-
for (let a = 0; a < r.length; a += 200)
|
|
150
|
+
}), d = "", f = null, g = !1, _ = null, v = null, y = /* @__PURE__ */ new Set(), w = (e = !1) => {
|
|
151
|
+
let r = a.drain(), i = c.getToken();
|
|
152
|
+
for (let a = 0; a < r.length; a += 200) m(s, {
|
|
150
153
|
token: i,
|
|
151
154
|
clientId: i ? void 0 : t.clientId,
|
|
152
155
|
sessionId: n,
|
|
153
|
-
sdkVersion:
|
|
156
|
+
sdkVersion: x,
|
|
154
157
|
events: r.slice(a, a + 200)
|
|
155
158
|
}, {
|
|
156
159
|
useBeacon: e,
|
|
157
160
|
token: i
|
|
158
161
|
});
|
|
159
162
|
}, T = (e) => {
|
|
160
|
-
|
|
163
|
+
a.push(e) >= t.maxBufferSize && w();
|
|
161
164
|
}, E = (e) => {
|
|
162
|
-
|
|
165
|
+
d = e;
|
|
163
166
|
}, D = (e = {}) => {
|
|
164
|
-
if (!
|
|
165
|
-
let t = e.url ??
|
|
166
|
-
(n !== "route_change" || t !==
|
|
167
|
+
if (!i) return;
|
|
168
|
+
let t = e.url ?? S(), n = e.reason ?? "initial";
|
|
169
|
+
(n !== "route_change" || t !== v) && (v = t, y = /* @__PURE__ */ new Set(), T({
|
|
167
170
|
type: "page_view",
|
|
168
171
|
t: Date.now(),
|
|
169
172
|
url: t,
|
|
170
|
-
locale: e.locale ??
|
|
171
|
-
ref: e.ref ??
|
|
173
|
+
locale: e.locale ?? d,
|
|
174
|
+
ref: e.ref ?? C(),
|
|
172
175
|
vw: e.vw ?? (typeof window < "u" ? window.innerWidth : void 0),
|
|
173
176
|
vh: e.vh ?? (typeof window < "u" ? window.innerHeight : void 0),
|
|
174
177
|
reason: n
|
|
175
178
|
}));
|
|
176
179
|
}, O = (e) => {
|
|
177
|
-
if (!
|
|
178
|
-
let t = e.locale ??
|
|
180
|
+
if (!i) return;
|
|
181
|
+
let t = e.locale ?? d, n = [
|
|
179
182
|
e.dictionaryKey,
|
|
180
183
|
e.keyPath,
|
|
181
184
|
t,
|
|
182
185
|
e.experimentKey ?? "",
|
|
183
186
|
e.variant ?? ""
|
|
184
187
|
].join("");
|
|
185
|
-
|
|
188
|
+
y.has(n) || (y.add(n), T({
|
|
186
189
|
...e,
|
|
187
190
|
type: "content_exposure",
|
|
188
191
|
t: Date.now(),
|
|
189
|
-
url:
|
|
192
|
+
url: S(),
|
|
190
193
|
locale: t
|
|
191
194
|
}));
|
|
192
195
|
}, k = (e) => {
|
|
@@ -194,10 +197,10 @@ var r = (e) => {
|
|
|
194
197
|
...e,
|
|
195
198
|
type: "conversion",
|
|
196
199
|
t: Date.now(),
|
|
197
|
-
url:
|
|
198
|
-
locale: e.locale ??
|
|
200
|
+
url: S(),
|
|
201
|
+
locale: e.locale ?? d
|
|
199
202
|
}), w());
|
|
200
|
-
}, A = (e, t, r) =>
|
|
203
|
+
}, A = (e, t, r) => o(n, e, t, r), j = () => {
|
|
201
204
|
if (typeof window > "u") return;
|
|
202
205
|
let e = () => {
|
|
203
206
|
document.visibilityState === "hidden" && w(!0);
|
|
@@ -219,43 +222,35 @@ var r = (e) => {
|
|
|
219
222
|
getVariant: A,
|
|
220
223
|
flush: w,
|
|
221
224
|
start: () => {
|
|
222
|
-
g || r || (g = !0,
|
|
225
|
+
g || r || (g = !0, c.prime(), f = setInterval(w, t.flushInterval), f?.unref?.(), h(j));
|
|
223
226
|
},
|
|
224
227
|
stop: () => {
|
|
225
|
-
g && (g = !1,
|
|
228
|
+
g && (g = !1, f &&= (clearInterval(f), null), _?.(), _ = null, w(!0));
|
|
226
229
|
}
|
|
227
230
|
};
|
|
228
|
-
},
|
|
229
|
-
typeof window < "u" && (window[
|
|
230
|
-
},
|
|
231
|
+
}, T = "__intlayer_analytics_client__", E = "__intlayer_analytics_ref_count__", D = () => typeof window > "u" ? null : window[T] ?? null, O = (e) => {
|
|
232
|
+
typeof window < "u" && (window[T] = e);
|
|
233
|
+
}, k = () => {
|
|
231
234
|
if (typeof window > "u") return 0;
|
|
232
235
|
let e = window;
|
|
233
|
-
return e[
|
|
234
|
-
},
|
|
236
|
+
return e[E] = (e[E] ?? 0) + 1, e[E];
|
|
237
|
+
}, A = () => {
|
|
235
238
|
if (typeof window > "u") return 0;
|
|
236
239
|
let e = window;
|
|
237
|
-
return e[
|
|
238
|
-
},
|
|
239
|
-
|
|
240
|
-
let e =
|
|
240
|
+
return e[E] = Math.max(0, (e[E] ?? 0) - 1), e[E];
|
|
241
|
+
}, j = () => {
|
|
242
|
+
k();
|
|
243
|
+
let e = D();
|
|
241
244
|
if (e) return e;
|
|
242
|
-
let r =
|
|
245
|
+
let r = w({
|
|
243
246
|
backendURL: n?.backendURL ?? "",
|
|
244
247
|
clientId: n?.clientId,
|
|
245
248
|
flushInterval: t?.flushInterval ?? 2e4,
|
|
246
249
|
maxBufferSize: 500,
|
|
247
250
|
sampleRate: t?.sampleRate ?? 1
|
|
248
251
|
});
|
|
249
|
-
return
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
keyPath: j(e.keyPath),
|
|
255
|
-
locale: e.locale,
|
|
256
|
-
nodeType: e.nodeType,
|
|
257
|
-
experimentKey: e.experimentKey,
|
|
258
|
-
variant: e.variant
|
|
259
|
-
});
|
|
260
|
-
//#endregion
|
|
261
|
-
export { M as buildContentExposure, T as getGlobalAnalyticsClient, k as initAnalyticsClient, A as stopAnalyticsClient };
|
|
252
|
+
return O(r), r.start(), r;
|
|
253
|
+
}, M = () => {
|
|
254
|
+
A() > 0 || (D()?.stop(), O(null));
|
|
255
|
+
};
|
|
256
|
+
export { i as buildContentExposure, D as getGlobalAnalyticsClient, j as initAnalyticsClient, M as stopAnalyticsClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { analytics as e, editor as t } from "@intlayer/config/built";
|
|
2
|
-
|
|
2
|
+
// ../@intlayer/analytics/dist/esm/utils/isBot.mjs
|
|
3
3
|
var n = /cubot/i, r = /bot\b|bot[/\-\s]|crawler|crawling|spider|scraper|slurp|archiver|feedfetcher|validator|curl\/|wget\/|python-requests|python-urllib|okhttp|axios\/|node-fetch|got \(|go-http-client|java\/|libwww|httpunit|http_request|apache-httpclient|headless|phantomjs|puppeteer|playwright|selenium|webdriver|cypress|lighthouse|pagespeed|gtmetrix|prerender|pingdom|uptime|statuscake|site24x7|bingpreview|yandex|baiduspider|sogou|exabot|semrush|ahrefs|mj12|dotbot|petalbot|applebot|amazonbot|bytespider|facebookexternalhit|meta-externalagent|embedly|outbrain|quora link preview|skypeuripreview|vkshare|w3c_validator|apis-google|mediapartners|adsbot|storebot-google|google-inspectiontool|google-read-aloud|google-extended|duplexweb-google|gptbot|oai-searchbot|chatgpt-user|perplexity|claudebot|claude-web|anthropic-ai|cohere-ai|ccbot|diffbot|imagesift|omgili|timpi|youbot/i, i = (e) => !e || !n.test(e) && r.test(e), a = [
|
|
4
4
|
"_phantom",
|
|
5
5
|
"__nightmare",
|
|
@@ -15,5 +15,4 @@ var n = /cubot/i, r = /bot\b|bot[/\-\s]|crawler|crawling|spider|scraper|slurp|ar
|
|
|
15
15
|
let e = globalThis;
|
|
16
16
|
return a.some((t) => t in e) ? !0 : navigator.userAgent ? i(navigator.userAgent) : !1;
|
|
17
17
|
}, s = process.env.INTLAYER_ANALYTICS_ENABLED !== "false" && e?.enabled === !0 && !!t?.clientId && typeof window < "u" && window.self === window.top && !o();
|
|
18
|
-
//#endregion
|
|
19
18
|
export { i, r as n, o as r, s as t };
|
package/package.json
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-intlayer",
|
|
3
|
-
"version": "9.7.
|
|
3
|
+
"version": "9.7.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Vue applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
7
|
-
"intlayer",
|
|
8
7
|
"data",
|
|
8
|
+
"i18n",
|
|
9
9
|
"internationalization",
|
|
10
|
+
"intlayer",
|
|
11
|
+
"json",
|
|
10
12
|
"multilingual",
|
|
11
|
-
"i18n",
|
|
12
13
|
"typescript",
|
|
13
|
-
"vue",
|
|
14
14
|
"vite",
|
|
15
|
-
"
|
|
15
|
+
"vue"
|
|
16
16
|
],
|
|
17
17
|
"homepage": "https://intlayer.org",
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/aymericzip/intlayer/issues"
|
|
20
20
|
},
|
|
21
|
-
"repository": {
|
|
22
|
-
"type": "git",
|
|
23
|
-
"url": "git+https://github.com/aymericzip/intlayer.git"
|
|
24
|
-
},
|
|
25
21
|
"license": "Apache-2.0",
|
|
26
22
|
"author": {
|
|
27
23
|
"name": "Aymeric PINEAU",
|
|
@@ -34,7 +30,37 @@
|
|
|
34
30
|
"url": "https://github.com/aymericzip"
|
|
35
31
|
}
|
|
36
32
|
],
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/aymericzip/intlayer.git"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"./dist",
|
|
39
|
+
"./package.json"
|
|
40
|
+
],
|
|
37
41
|
"sideEffects": false,
|
|
42
|
+
"main": "dist/cjs/index.cjs",
|
|
43
|
+
"module": "dist/esm/index.mjs",
|
|
44
|
+
"types": "dist/types/index.d.ts",
|
|
45
|
+
"typesVersions": {
|
|
46
|
+
"*": {
|
|
47
|
+
".": [
|
|
48
|
+
"./dist/types/index.d.ts"
|
|
49
|
+
],
|
|
50
|
+
"markdown": [
|
|
51
|
+
"./dist/types/markdown/index.d.ts"
|
|
52
|
+
],
|
|
53
|
+
"format": [
|
|
54
|
+
"./dist/types/format/index.d.ts"
|
|
55
|
+
],
|
|
56
|
+
"html": [
|
|
57
|
+
"./dist/types/html/index.d.ts"
|
|
58
|
+
],
|
|
59
|
+
"package.json": [
|
|
60
|
+
"./package.json"
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
},
|
|
38
64
|
"exports": {
|
|
39
65
|
".": {
|
|
40
66
|
"types": "./dist/types/index.d.ts",
|
|
@@ -58,41 +84,15 @@
|
|
|
58
84
|
},
|
|
59
85
|
"./package.json": "./package.json"
|
|
60
86
|
},
|
|
61
|
-
"main": "dist/cjs/index.cjs",
|
|
62
|
-
"module": "dist/esm/index.mjs",
|
|
63
|
-
"types": "dist/types/index.d.ts",
|
|
64
|
-
"typesVersions": {
|
|
65
|
-
"*": {
|
|
66
|
-
".": [
|
|
67
|
-
"./dist/types/index.d.ts"
|
|
68
|
-
],
|
|
69
|
-
"markdown": [
|
|
70
|
-
"./dist/types/markdown/index.d.ts"
|
|
71
|
-
],
|
|
72
|
-
"format": [
|
|
73
|
-
"./dist/types/format/index.d.ts"
|
|
74
|
-
],
|
|
75
|
-
"html": [
|
|
76
|
-
"./dist/types/html/index.d.ts"
|
|
77
|
-
],
|
|
78
|
-
"package.json": [
|
|
79
|
-
"./package.json"
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
"files": [
|
|
84
|
-
"./dist",
|
|
85
|
-
"./package.json"
|
|
86
|
-
],
|
|
87
87
|
"scripts": {
|
|
88
88
|
"build": "bun --bun vite build",
|
|
89
89
|
"build:ci": "bun --bun vite build",
|
|
90
90
|
"clean": "bun --bun rimraf ./dist .turbo",
|
|
91
91
|
"dev": "bun --bun vite build --watch",
|
|
92
|
-
"format": "
|
|
93
|
-
"format:fix": "
|
|
94
|
-
"lint": "
|
|
95
|
-
"lint:fix": "
|
|
92
|
+
"format": "oxfmt --check .",
|
|
93
|
+
"format:fix": "oxfmt .",
|
|
94
|
+
"lint": "oxlint .",
|
|
95
|
+
"lint:fix": "oxlint --fix .",
|
|
96
96
|
"prepublish": "cp -f ../../README.md ./README.md",
|
|
97
97
|
"publish": "bun publish || true",
|
|
98
98
|
"publish:canary": "bun publish --access public --tag canary || true",
|
|
@@ -103,12 +103,12 @@
|
|
|
103
103
|
"typecheck": "vue-tsc --noEmit --project tsconfig.types.json"
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"@intlayer/api": "9.7.
|
|
107
|
-
"@intlayer/config": "9.7.
|
|
108
|
-
"@intlayer/core": "9.7.
|
|
109
|
-
"@intlayer/dictionaries-entry": "9.7.
|
|
110
|
-
"@intlayer/editor": "9.7.
|
|
111
|
-
"@intlayer/types": "9.7.
|
|
106
|
+
"@intlayer/api": "9.7.2",
|
|
107
|
+
"@intlayer/config": "9.7.2",
|
|
108
|
+
"@intlayer/core": "9.7.2",
|
|
109
|
+
"@intlayer/dictionaries-entry": "9.7.2",
|
|
110
|
+
"@intlayer/editor": "9.7.2",
|
|
111
|
+
"@intlayer/types": "9.7.2",
|
|
112
112
|
"@vue/devtools-api": "^6.6.4"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
@@ -119,16 +119,16 @@
|
|
|
119
119
|
"@vitejs/plugin-vue": "6.0.8",
|
|
120
120
|
"ajv": "8.20.0",
|
|
121
121
|
"fast-glob": "3.3.3",
|
|
122
|
-
"rimraf": "6.1.
|
|
123
|
-
"tsdown": "0.23.
|
|
122
|
+
"rimraf": "6.1.4",
|
|
123
|
+
"tsdown": "0.23.7",
|
|
124
124
|
"typescript": "7.0.2",
|
|
125
|
-
"vite": "8.3.
|
|
125
|
+
"vite": "8.3.7",
|
|
126
126
|
"vite-plugin-dts": "5.1.2",
|
|
127
|
-
"vitest": "5.0
|
|
127
|
+
"vitest": "5.1.0",
|
|
128
128
|
"vue-tsc": "3.3.9"
|
|
129
129
|
},
|
|
130
130
|
"peerDependencies": {
|
|
131
|
-
"intlayer": "9.7.
|
|
131
|
+
"intlayer": "9.7.2",
|
|
132
132
|
"vue": ">=3.0.0"
|
|
133
133
|
},
|
|
134
134
|
"peerDependenciesMeta": {
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
}
|
|
138
138
|
},
|
|
139
139
|
"optionalDependencies": {
|
|
140
|
-
"@intlayer/analytics": "9.7.
|
|
140
|
+
"@intlayer/analytics": "9.7.2"
|
|
141
141
|
},
|
|
142
142
|
"engines": {
|
|
143
143
|
"node": ">=14.18"
|
package/dist/esm-CXlI80Tk.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./isEnabled-CuTKz0YA.js");let t=require("@intlayer/config/built");var n=e=>{let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0},r=(e,t,r,i)=>{if(r.length===0)throw Error(`assignVariant requires at least one variant`);if(r.length===1)return r[0];let a=n(`${e}:${t}`)/4294967296;if(!i||i.length!==r.length){let e=Math.floor(a*r.length);return r[Math.min(e,r.length-1)]}let o=i.reduce((e,t)=>e+t,0);if(o<=0)return r[Math.floor(a*r.length)];let s=0,c=a*o;for(let e=0;e<r.length;e++)if(s+=i[e],c<s)return r[e];return r[r.length-1]},i=``,a=e=>[e.url,e.dictionaryKey,e.keyPath,e.locale,e.experimentKey??``,e.variant??``].join(i),o=({max:e})=>{let t=[],n=new Map,r=()=>t.length+n.size,i=()=>{for(;r()>e&&n.size>0;){let e=n.keys().next().value;n.delete(e)}r()>e&&(t=t.slice(r()-e))};return{push:e=>{if(e.type===`content_exposure`){let t=a(e),r=n.get(t);r?(r.count=(r.count??1)+(e.count??1),r.t=e.t):n.set(t,{...e,count:e.count??1})}else t.push(e);return i(),r()},drain:()=>{let e=[...t,...n.values()];return t=[],n.clear(),e},size:r}},s=(e,t)=>t>=1?!0:t<=0?!1:n(e)/4294967295<t,c=`__intlayer_analytics_sid__`,l=()=>{let e=typeof globalThis<`u`?globalThis.crypto:void 0;return e?.randomUUID?e.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},u=()=>{if(typeof window>`u`||!window.sessionStorage)return l();try{let e=window.sessionStorage.getItem(c);if(e)return e;let t=l();return window.sessionStorage.setItem(c,t),t}catch{return l()}},d=(e,t,{useBeacon:n=!1,token:r}={})=>{try{let i=JSON.stringify(t);return n&&typeof navigator<`u`&&typeof navigator.sendBeacon==`function`?navigator.sendBeacon(e,i):typeof fetch==`function`&&(fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`,...r?{Authorization:`Bearer ${r}`}:{}},body:i,keepalive:!0,credentials:`omit`,mode:`cors`}).catch(()=>{}),!0)}catch{return!1}},f=e=>{if(typeof window>`u`)return;let t=window.requestIdleCallback;if(typeof t==`function`){t(()=>e());return}setTimeout(e,1)},p=`__intlayer_public_token__`,m=6e4,h=()=>{try{let e=window.sessionStorage?.getItem(p);if(!e)return null;let t=JSON.parse(e);return typeof t?.token!=`string`||typeof t?.expiresAt!=`number`?null:t}catch{return null}},g=e=>{try{window.sessionStorage?.setItem(p,JSON.stringify(e))}catch{}},_=({backendURL:e,clientId:t})=>{let n=`${e.replace(/\/$/,``)}/api/public/token`,r=null,i=null,a=e=>e!==null&&e.expiresAt-m>Date.now(),o=()=>{if(a(r))return r.token;if(typeof window<`u`){let e=h();if(a(e))return r=e,e.token}},s=async()=>{try{let e=await fetch(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({clientId:t}),credentials:`omit`,mode:`cors`});if(!e.ok)return;let i=await e.json(),a=i?.data?.token,o=i?.data?.expiresIn??0;if(!a||o<=0)return;r={token:a,expiresAt:Date.now()+o*1e3},typeof window<`u`&&g(r)}catch{}finally{i=null}};return{getToken:o,prime:()=>{t&&typeof fetch==`function`&&(o()||(i||=s()))}}},v=`intlayer-analytics/1`,y=()=>typeof window>`u`||!window.location?``:window.location.pathname,b=()=>{if(typeof document<`u`&&document.referrer)try{return new URL(document.referrer).host}catch{return}},x=t=>{let n=u(),i=e.r(),a=!i&&s(n,t.sampleRate),c=o({max:t.maxBufferSize}),l=`${t.backendURL.replace(/\/$/,``)}/api/analytics/events`,p=_({backendURL:t.backendURL,clientId:t.clientId}),m=``,h=null,g=!1,x=null,S=null,C=new Set,w=(e=!1)=>{let r=c.drain(),i=p.getToken();for(let a=0;a<r.length;a+=200)d(l,{token:i,clientId:i?void 0:t.clientId,sessionId:n,sdkVersion:v,events:r.slice(a,a+200)},{useBeacon:e,token:i})},T=e=>{c.push(e)>=t.maxBufferSize&&w()},E=e=>{m=e},D=(e={})=>{if(!a)return;let t=e.url??y(),n=e.reason??`initial`;(n!==`route_change`||t!==S)&&(S=t,C=new Set,T({type:`page_view`,t:Date.now(),url:t,locale:e.locale??m,ref:e.ref??b(),vw:e.vw??(typeof window<`u`?window.innerWidth:void 0),vh:e.vh??(typeof window<`u`?window.innerHeight:void 0),reason:n}))},O=e=>{if(!a)return;let t=e.locale??m,n=[e.dictionaryKey,e.keyPath,t,e.experimentKey??``,e.variant??``].join(``);C.has(n)||(C.add(n),T({...e,type:`content_exposure`,t:Date.now(),url:y(),locale:t}))},k=e=>{i||(T({...e,type:`conversion`,t:Date.now(),url:y(),locale:e.locale??m}),w())},A=(e,t,i)=>r(n,e,t,i),j=()=>{if(typeof window>`u`)return;let e=()=>{document.visibilityState===`hidden`&&w(!0)},t=()=>w(!0),n=()=>D({reason:`route_change`});document.addEventListener(`visibilitychange`,e),window.addEventListener(`pagehide`,t,{capture:!0}),window.addEventListener(`popstate`,n);let r=window.history,i=r.pushState,a=function(...e){let t=i.apply(this,e);return D({reason:`route_change`}),t};r.pushState=a,x=()=>{document.removeEventListener(`visibilitychange`,e),window.removeEventListener(`pagehide`,t,{capture:!0}),window.removeEventListener(`popstate`,n),r.pushState===a&&(r.pushState=i)}};return{setLocale:E,trackPageView:D,trackContentExposure:O,trackConversion:k,getVariant:A,flush:w,start:()=>{g||i||(g=!0,p.prime(),h=setInterval(w,t.flushInterval),h?.unref?.(),f(j))},stop:()=>{g&&(g=!1,h&&=(clearInterval(h),null),x?.(),x=null,w(!0))}}},S=`__intlayer_analytics_client__`,C=`__intlayer_analytics_ref_count__`,w=()=>typeof window>`u`?null:window[S]??null,T=e=>{typeof window<`u`&&(window[S]=e)},E=()=>{if(typeof window>`u`)return 0;let e=window;return e[C]=(e[C]??0)+1,e[C]},D=()=>{if(typeof window>`u`)return 0;let e=window;return e[C]=Math.max(0,(e[C]??0)-1),e[C]},O=()=>{E();let e=w();if(e)return e;let n=x({backendURL:t.editor?.backendURL??``,clientId:t.editor?.clientId,flushInterval:t.analytics?.flushInterval??2e4,maxBufferSize:500,sampleRate:t.analytics?.sampleRate??1});return T(n),n.start(),n},k=()=>{D()>0||(w()?.stop(),T(null))},A=e=>e.map(e=>e.key===void 0?`*`:String(e.key)).join(`.`),j=e=>({dictionaryKey:e.dictionaryKey,keyPath:A(e.keyPath),locale:e.locale,nodeType:e.nodeType,experimentKey:e.experimentKey,variant:e.variant});exports.buildContentExposure=j,exports.getGlobalAnalyticsClient=w,exports.initAnalyticsClient=O,exports.stopAnalyticsClient=k;
|