vitral 0.12.0 → 0.13.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 (59) hide show
  1. package/dist/angular.d.ts +2 -2
  2. package/dist/angular.js +5 -5
  3. package/dist/auto.js +5 -5
  4. package/dist/{chunk-SOENZNXO.js → chunk-2NMBPSMO.js} +87 -7
  5. package/dist/{chunk-QQWE5J6U.js → chunk-AJUORT35.js} +2 -1
  6. package/dist/{chunk-UFETTKDP.js → chunk-B4LYXSNK.js} +4 -4
  7. package/dist/{chunk-RGYVSS3X.js → chunk-C3LH5DSE.js} +5 -5
  8. package/dist/chunk-EGUHWWE4.js +86 -0
  9. package/dist/{chunk-YKLWMIEH.js → chunk-GJY5QTOO.js} +1 -1
  10. package/dist/{chunk-VDNFRNOG.js → chunk-LITYI5X7.js} +1 -1
  11. package/dist/{chunk-52D6ZT4A.js → chunk-NGO67IJR.js} +8 -3
  12. package/dist/{chunk-I7IFR65H.js → chunk-WIQ3W6AY.js} +4 -4
  13. package/dist/{chunk-JKTZODC5.js → chunk-XNUU3YPA.js} +2 -2
  14. package/dist/edge.d.ts +1 -1
  15. package/dist/element.d.ts +2 -2
  16. package/dist/element.js +5 -5
  17. package/dist/embed.js +2 -2
  18. package/dist/{events-II6hXM3Q.d.ts → events-XXC4si92.d.ts} +1 -1
  19. package/dist/{expose-KL6TA472.js → expose-PY7A4VM2.js} +3 -3
  20. package/dist/federation.d.ts +1 -1
  21. package/dist/{hydrate-LS3MLFGN.js → hydrate-UOEAX7D3.js} +4 -4
  22. package/dist/i18n-WISV4IP6.js +16 -0
  23. package/dist/i18n.d.ts +52 -0
  24. package/dist/i18n.js +39 -0
  25. package/dist/iframe.js +4 -4
  26. package/dist/index.d.ts +5 -5
  27. package/dist/index.js +3 -3
  28. package/dist/{loader-Bmul2-5T.d.ts → loader-vj8m2GQU.d.ts} +1 -1
  29. package/dist/next-config.d.ts +3 -1
  30. package/dist/next-config.js +2 -2
  31. package/dist/next-host.d.ts +12 -5
  32. package/dist/next-host.js +33 -19
  33. package/dist/next-server.d.ts +1 -1
  34. package/dist/preact.d.ts +4 -4
  35. package/dist/preact.js +4 -4
  36. package/dist/prefetch.js +2 -2
  37. package/dist/react-server.d.ts +1 -1
  38. package/dist/react.d.ts +4 -4
  39. package/dist/react.js +5 -5
  40. package/dist/{reframe-AD2UEPIO.js → reframe-RLSKSEJS.js} +3 -3
  41. package/dist/routes.d.ts +2 -2
  42. package/dist/routes.js +4 -4
  43. package/dist/single-spa.d.ts +1 -1
  44. package/dist/{slot--WLgdcW_.d.ts → slot-CxhuVuka.d.ts} +1 -1
  45. package/dist/solid.d.ts +3 -3
  46. package/dist/solid.js +4 -4
  47. package/dist/sri-Z5U32IR2.js +2 -2
  48. package/dist/svelte.d.ts +4 -4
  49. package/dist/svelte.js +4 -4
  50. package/dist/sw.d.ts +1 -1
  51. package/dist/testing.d.ts +1 -1
  52. package/dist/testing.js +3 -3
  53. package/dist/{types-DJautV-K.d.ts → types-cSsvpvgE.d.ts} +26 -1
  54. package/dist/vite.d.ts +10 -0
  55. package/dist/vite.js +107 -42
  56. package/dist/vue.d.ts +2 -2
  57. package/dist/vue.js +4 -4
  58. package/package.json +39 -24
  59. /package/dist/{chunk-QGAEXUP5.js → chunk-OKXLOMAG.js} +0 -0
package/dist/angular.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { InjectionToken, Type, ApplicationConfig, Signal, Provider, EnvironmentProviders } from '@angular/core';
2
- import { R as RemoteContext, P as Props, a as RemoteModule, S as Shared, V as VitralConfig } from './types-DJautV-K.js';
3
- export { e as events } from './events-II6hXM3Q.js';
2
+ import { R as RemoteContext, P as Props, a as RemoteModule, S as Shared, V as VitralConfig } from './types-cSsvpvgE.js';
3
+ export { e as events } from './events-XXC4si92.js';
4
4
  export { n as navigate } from './navigate-BRG1WJUM.js';
5
5
  import './errors-kjBv6IH_.js';
6
6
 
package/dist/angular.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  defineVitralElement
3
- } from "./chunk-UFETTKDP.js";
4
- import "./chunk-JKTZODC5.js";
3
+ } from "./chunk-B4LYXSNK.js";
4
+ import "./chunk-XNUU3YPA.js";
5
5
  import {
6
6
  defineRemote,
7
7
  memoSelect,
8
8
  same,
9
9
  shared
10
- } from "./chunk-I7IFR65H.js";
10
+ } from "./chunk-WIQ3W6AY.js";
11
11
  import {
12
12
  configure
13
- } from "./chunk-52D6ZT4A.js";
14
- import "./chunk-QGAEXUP5.js";
13
+ } from "./chunk-NGO67IJR.js";
14
+ import "./chunk-OKXLOMAG.js";
15
15
  import "./chunk-YDO7SPF4.js";
16
16
  import "./chunk-VDVVEGAO.js";
17
17
  import "./chunk-BQGVAXFM.js";
package/dist/auto.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  defineVitralElement
3
- } from "./chunk-UFETTKDP.js";
4
- import "./chunk-JKTZODC5.js";
5
- import "./chunk-I7IFR65H.js";
6
- import "./chunk-52D6ZT4A.js";
7
- import "./chunk-QGAEXUP5.js";
3
+ } from "./chunk-B4LYXSNK.js";
4
+ import "./chunk-XNUU3YPA.js";
5
+ import "./chunk-WIQ3W6AY.js";
6
+ import "./chunk-NGO67IJR.js";
7
+ import "./chunk-OKXLOMAG.js";
8
8
  import "./chunk-YDO7SPF4.js";
9
9
  import "./chunk-VDVVEGAO.js";
10
10
  import "./chunk-BQGVAXFM.js";
@@ -29,6 +29,25 @@ async function exportOrigins(ctx, file, cache) {
29
29
  }
30
30
  return origins(file, parsed, /* @__PURE__ */ new Map(), []);
31
31
  }
32
+ async function exportSources(ctx, file, cache) {
33
+ await exportOrigins(ctx, file, cache);
34
+ const parsed = /* @__PURE__ */ new Map();
35
+ for (const [f, p] of cache) parsed.set(f, await p);
36
+ return sources(file, parsed, /* @__PURE__ */ new Map(), []);
37
+ }
38
+ function sources(file, parsed, memo, stack) {
39
+ const p = parsed.get(file);
40
+ if (!p || stack.includes(file)) return /* @__PURE__ */ new Map();
41
+ const known = memo.get(file);
42
+ if (known) return known;
43
+ const next = [...stack, file];
44
+ const out = /* @__PURE__ */ new Map();
45
+ for (const name of p.local.keys()) out.set(name, [file, name]);
46
+ for (const n of p.named) out.set(n.exported, n.source && sources(n.source, parsed, memo, next).get(n.name) || [file, n.exported]);
47
+ for (const s of p.star) for (const [name, v] of sources(s, parsed, memo, next)) if (name !== "default" && !out.has(name)) out.set(name, v);
48
+ memo.set(file, out);
49
+ return out;
50
+ }
32
51
  function origins(file, parsed, memo, stack) {
33
52
  if (stack.includes(file)) return /* @__PURE__ */ new Map();
34
53
  const known = memo.get(file);
@@ -257,6 +276,32 @@ function dedupeHooks(entry, getGroups) {
257
276
  origins2 = /* @__PURE__ */ new Map();
258
277
  exports.clear();
259
278
  },
279
+ /**
280
+ * Depois do build dividido: arquivos de um grupo que o código principal
281
+ * alcança sem passar pela cópia própria. Eles baixam e rodam mesmo com o
282
+ * pacote oferecido pelo host; o aviso mostra um caminho até cada grupo.
283
+ */
284
+ leaks(ctx, root) {
285
+ const from = /* @__PURE__ */ new Map();
286
+ const stack = ["\0" + BOOT];
287
+ while (stack.length) {
288
+ const id = stack.pop();
289
+ const m = ctx.getModuleInfo(id);
290
+ for (const d of [...m?.importedIds ?? [], ...m?.dynamicallyImportedIds ?? []]) if (!d.startsWith(OWN) && !from.has(d)) from.set(d, id), stack.push(d);
291
+ }
292
+ const r = norm(root) + "/";
293
+ const show = (id) => {
294
+ const v = /^\0([\w:-]*?:)(\/.*)$/.exec(id);
295
+ return v ? v[1] + show(v[2]) : norm(id).startsWith(r) ? norm(id).slice(r.length) : id.replace(/^\0/, "");
296
+ };
297
+ for (const g of getGroups()) {
298
+ const found = [...from.keys()].filter((id) => !id.startsWith("\0") && inside(g, id));
299
+ if (!found.length) continue;
300
+ const chain = [found[0]];
301
+ while (from.has(chain[0]) && !chain[0].startsWith("\0" + BOOT)) chain.unshift(from.get(chain[0]));
302
+ ctx.warn?.(`dedupe: ${found.length} arquivo(s) de ${g.name} entram no c\xF3digo principal do remote, fora da c\xF3pia pr\xF3pria: baixam e rodam mesmo com o pacote oferecido pelo host. Um caminho: ${chain.slice(1).map(show).join(" \u2192 ")}`);
303
+ }
304
+ },
260
305
  /** Algum grupo troca também os imports que chegam a arquivos do pacote? */
261
306
  files: () => getGroups().some((g) => g.files),
262
307
  resolveId: {
@@ -324,23 +369,56 @@ export { v${i} as ${JSON.stringify(n)} }
324
369
  ` + (own.has("default") ? `export { default } from ${f}
325
370
  ` : "");
326
371
  }
372
+ const from = rest.length ? await exportSources(ctx, file, exports) : /* @__PURE__ */ new Map();
373
+ const src = (n) => from.get(n) ?? [file, n];
374
+ const rel = (x) => x.slice(g.dir.length + 1);
327
375
  if (rest.length)
328
- ctx.warn?.(`dedupe: ${file.slice(g.dir.length + 1)}: ${rest.join(", ")} n\xE3o sai(em) por nenhum export de ${g.name}: esses nomes v\xEAm de uma c\xF3pia pr\xF3pria deste arquivo`);
376
+ ctx.warn?.(`dedupe: ${rel(file)}: ${rest.join(", ")} n\xE3o sai(em) por nenhum export de ${g.name}: esses nomes v\xEAm de uma c\xF3pia pr\xF3pria de ${[...new Set(rest.map((n) => rel(src(n)[0])))].join(", ")}, que entra no c\xF3digo principal do remote`);
377
+ const q = (n) => n === "default" ? "default" : JSON.stringify(n);
329
378
  return `import { deps } from ${JSON.stringify(DEPS)}
330
379
  ` + shared.map(([name, v], i) => `const v${i} = deps[${JSON.stringify(v.spec)}][${JSON.stringify(v.name)}]
331
380
  ` + (name === "default" ? `export default v${i}
332
381
  ` : `export { v${i} as ${JSON.stringify(name)} }
333
- `)).join("") + (rest.length ? `export { ${rest.map((n) => n === "default" ? "default" : JSON.stringify(n)).join(", ")} } from ${f}
334
- ` : "");
382
+ `)).join("") + rest.map((n) => `export { ${q(src(n)[1])} as ${q(n)} } from ${JSON.stringify(src(n)[0])}
383
+ `).join("");
335
384
  }
336
385
  return null;
337
386
  }
338
387
  };
339
388
  }
340
- function boot(entry, groups2) {
341
- const calls = groups2.map(
342
- (g) => `need(${JSON.stringify(g.name)}, ${JSON.stringify(g.range)}, ${JSON.stringify(g.version)}, ${JSON.stringify(g.keys)}, () => import(${JSON.stringify(OWN + g.name)}).then((m) => m.default))`
389
+ function groupDeps(groups2) {
390
+ const names = new Set(groups2.map((g) => g.name));
391
+ const direct = new Map(
392
+ groups2.map((g) => {
393
+ let data = {};
394
+ try {
395
+ if (g.dir) data = JSON.parse(readFileSync(join(g.dir, "package.json"), "utf8"));
396
+ } catch {
397
+ }
398
+ const deps = Object.keys({ ...data.dependencies, ...data.peerDependencies }).map(groupOf);
399
+ return [g.name, [...new Set(deps)].filter((d) => d !== g.name && names.has(d))];
400
+ })
343
401
  );
402
+ const out = /* @__PURE__ */ new Map();
403
+ const visiting = /* @__PURE__ */ new Set();
404
+ const visit = (n) => {
405
+ if (out.has(n) || visiting.has(n)) return;
406
+ visiting.add(n);
407
+ for (const d of direct.get(n) ?? []) visit(d);
408
+ visiting.delete(n);
409
+ out.set(n, (direct.get(n) ?? []).filter((d) => out.has(d)));
410
+ };
411
+ for (const g of groups2) visit(g.name);
412
+ return out;
413
+ }
414
+ function boot(entry, groups2) {
415
+ const uses = groupDeps(groups2);
416
+ const order = [...uses.keys()];
417
+ const calls = [...groups2].sort((a, b) => order.indexOf(a.name) - order.indexOf(b.name)).map((g) => {
418
+ const call = `need(${JSON.stringify(g.name)}, ${JSON.stringify(g.range)}, ${JSON.stringify(g.version)}, ${JSON.stringify(g.keys)}, () => import(${JSON.stringify(OWN + g.name)}).then((m) => m.default))`;
419
+ const before = uses.get(g.name) ?? [];
420
+ return `done[${JSON.stringify(g.name)}] = ` + (before.length ? `Promise.all(${JSON.stringify(before)}.map((n) => done[n])).then(() => ${call})` : call);
421
+ });
344
422
  return `const { deps } = await import(${JSON.stringify(DEPS)})
345
423
  const p = globalThis[Symbol.for("vitral")]
346
424
  const shared = !!(p && p.dedupe) && /\\/split\\/[^/]*$/.test(import.meta.url)
@@ -359,7 +437,9 @@ async function need(name, range, version, keys, load) {
359
437
  if (!m || ((lacks.length || names.length) && !keep)) m = await load()
360
438
  Object.assign(deps, m)
361
439
  }
362
- await Promise.all([${calls.join(", ")}])
440
+ const done = {}
441
+ ${calls.join("\n")}
442
+ await Promise.all(Object.values(done))
363
443
  const remote = await import(${JSON.stringify(entry)})
364
444
  export default remote.default
365
445
  `;
@@ -28,7 +28,8 @@ function hintsOf(m, url, offered, integrity, keys) {
28
28
  css: (m.css ?? []).map(hint),
29
29
  js: (m.split ? ordered([...own, ...m.split.chunks ?? [], m.split.entry], m.split.order) : [m.entry]).map(hint),
30
30
  ...offers.length && { offers },
31
- ...k && { signed: k.trim() }
31
+ ...k && { signed: k.trim() },
32
+ ...m.i18n && { i18n: Object.fromEntries(Object.entries(m.i18n).map(([lng, ns]) => [lng, Object.values(ns).map((f) => hint(f).slice(0, 2))])) }
32
33
  };
33
34
  }
34
35
 
@@ -2,18 +2,18 @@ import {
2
2
  hostSlot,
3
3
  timings,
4
4
  when
5
- } from "./chunk-JKTZODC5.js";
5
+ } from "./chunk-XNUU3YPA.js";
6
6
  import {
7
7
  defineRemote,
8
8
  memoSelect,
9
9
  same,
10
10
  shared
11
- } from "./chunk-I7IFR65H.js";
11
+ } from "./chunk-WIQ3W6AY.js";
12
12
  import {
13
13
  policy,
14
14
  registerSrc,
15
15
  warmSsr
16
- } from "./chunk-52D6ZT4A.js";
16
+ } from "./chunk-NGO67IJR.js";
17
17
 
18
18
  // src/element.ts
19
19
  var Base = typeof HTMLElement === "undefined" ? class {
@@ -77,7 +77,7 @@ var VitralRemoteElement = class extends Base {
77
77
  };
78
78
  const ssr = true ? this.querySelector(":scope>[data-vitral-ssr]") : null;
79
79
  if (ssr) {
80
- const go = () => (warmSsr(ssr), import("./hydrate-LS3MLFGN.js").then((m) => this.isConnected && !this.#slot && (this.#slot = m.hydrateSlot(this, ssr, { ...options, props: this.#props }))));
80
+ const go = () => (warmSsr(ssr), import("./hydrate-UOEAX7D3.js").then((m) => this.isConnected && !this.#slot && (this.#slot = m.hydrateSlot(this, ssr, { ...options, props: this.#props }))));
81
81
  if (policy() === "lazy") when(this, "visible", go);
82
82
  else go();
83
83
  } else this.#slot = hostSlot(this, options);
@@ -6,20 +6,20 @@ import {
6
6
  import {
7
7
  hostSlot,
8
8
  when
9
- } from "./chunk-JKTZODC5.js";
9
+ } from "./chunk-XNUU3YPA.js";
10
10
  import {
11
11
  defineRemote,
12
12
  memoSelect,
13
13
  same,
14
14
  shared
15
- } from "./chunk-I7IFR65H.js";
15
+ } from "./chunk-WIQ3W6AY.js";
16
16
  import {
17
17
  policy,
18
18
  preload
19
- } from "./chunk-52D6ZT4A.js";
19
+ } from "./chunk-NGO67IJR.js";
20
20
  import {
21
21
  dedupeModule
22
- } from "./chunk-QGAEXUP5.js";
22
+ } from "./chunk-OKXLOMAG.js";
23
23
  import {
24
24
  events
25
25
  } from "./chunk-EQZOJU3B.js";
@@ -192,7 +192,7 @@ function Remote({
192
192
  let dead = false;
193
193
  let s = null;
194
194
  if (holder) {
195
- const go = () => import("./hydrate-LS3MLFGN.js").then((m) => {
195
+ const go = () => import("./hydrate-UOEAX7D3.js").then((m) => {
196
196
  if (!dead) slot.current = s = m.hydrateSlot(target.current, holder, { ...options, props: latest.current ?? {} });
197
197
  });
198
198
  const stop = policy() === "lazy" ? when(target.current, "visible", go) : (go(), () => {
@@ -0,0 +1,86 @@
1
+ import {
2
+ verifyIntegrity
3
+ } from "./chunk-UCFOXMOR.js";
4
+ import {
5
+ absolute,
6
+ fetchBytes
7
+ } from "./chunk-VDVVEGAO.js";
8
+ import {
9
+ RemoteError
10
+ } from "./chunk-BQGVAXFM.js";
11
+
12
+ // src/core/i18n.ts
13
+ var asked = /* @__PURE__ */ new Map();
14
+ var remotes = /* @__PURE__ */ new Map();
15
+ var watching;
16
+ var stop;
17
+ function pickLanguage(lng, available, fallback = []) {
18
+ const low = available.map((a) => a.toLowerCase());
19
+ const base = (x) => x.toLowerCase().split(/[-_]/)[0];
20
+ for (const want of [lng, ...fallback]) {
21
+ if (!want) continue;
22
+ const exact = low.indexOf(want.toLowerCase());
23
+ if (exact >= 0) return available[exact];
24
+ const b = low.indexOf(base(want));
25
+ if (b >= 0) return available[b];
26
+ const variant = low.findIndex((a) => base(a) === base(want));
27
+ if (variant >= 0) return available[variant];
28
+ }
29
+ }
30
+ function loadTranslations(name, t, sri, host, timeout, priority) {
31
+ const files = {};
32
+ for (const lng in t.files) for (const ns in t.files[lng]) (files[lng] ??= {})[ns] = absolute(t.files[lng][ns], t.base);
33
+ remotes.set(name, { files, sri });
34
+ watch(host, timeout);
35
+ return load(name, files, sri, host, host.language(), timeout, priority);
36
+ }
37
+ function load(name, files, sri, host, lng, timeout, priority) {
38
+ const pick = pickLanguage(lng, Object.keys(files), host.fallback?.() ?? []);
39
+ if (!pick) return Promise.resolve(false);
40
+ return Promise.all(
41
+ Object.entries(files[pick]).map(([ns, url]) => {
42
+ let p = asked.get(url);
43
+ if (!p) {
44
+ const want = sri[url];
45
+ const here = !!want && !!globalThis.crypto?.subtle && want.split(/\s+/).every((t) => /^sha(256|384|512)-/.test(t));
46
+ p = fetchBytes(url, timeout, name, { credentials: "same-origin", priority, ...want && !here && { integrity: want } }).then(async (bytes) => {
47
+ if (here) await verifyIntegrity(name, bytes, want);
48
+ let data;
49
+ try {
50
+ data = JSON.parse(new TextDecoder().decode(bytes));
51
+ } catch (e) {
52
+ throw new RemoteError("INVALID_MODULE", name, `JSON inv\xE1lido em ${url}`, e);
53
+ }
54
+ host.add(pick, ns, data);
55
+ return true;
56
+ });
57
+ p.catch(() => asked.delete(url));
58
+ asked.set(url, p);
59
+ return p;
60
+ }
61
+ return p.then(() => false);
62
+ })
63
+ ).then((added) => added.includes(true));
64
+ }
65
+ function watch(host, timeout) {
66
+ if (watching === host || !host.onChange) return;
67
+ stop?.();
68
+ watching = host;
69
+ stop = host.onChange((lng) => {
70
+ Promise.all([...remotes].map(([name, r]) => load(name, r.files, r.sri, host, lng, timeout).catch(() => false))).then((added) => {
71
+ if (added.includes(true)) host.refresh?.();
72
+ });
73
+ });
74
+ }
75
+ function resetTranslations() {
76
+ stop?.();
77
+ asked.clear();
78
+ remotes.clear();
79
+ watching = stop = void 0;
80
+ }
81
+
82
+ export {
83
+ pickLanguage,
84
+ loadTranslations,
85
+ resetTranslations
86
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  mountable
3
- } from "./chunk-52D6ZT4A.js";
3
+ } from "./chunk-NGO67IJR.js";
4
4
  import {
5
5
  RemoteError
6
6
  } from "./chunk-BQGVAXFM.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-UCFOXMOR.js";
4
4
  import {
5
5
  dedupeModule
6
- } from "./chunk-QGAEXUP5.js";
6
+ } from "./chunk-OKXLOMAG.js";
7
7
  import {
8
8
  addLink,
9
9
  fetchBytes,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  dedupeModule,
3
3
  sriModule
4
- } from "./chunk-QGAEXUP5.js";
4
+ } from "./chunk-OKXLOMAG.js";
5
5
  import {
6
6
  prefetchCss
7
7
  } from "./chunk-YDO7SPF4.js";
@@ -106,7 +106,7 @@ function loadRemote(name) {
106
106
  return load(name).then((r) => r.module);
107
107
  }
108
108
  function loadModule(name) {
109
- return import("./expose-KL6TA472.js").then((m) => m.resolveModule(name, (n) => loadFile(n))).catch(fail);
109
+ return import("./expose-PY7A4VM2.js").then((m) => m.resolveModule(name, (n) => loadFile(n))).catch(fail);
110
110
  }
111
111
  function preload(name, options = {}) {
112
112
  const done = load(name);
@@ -146,7 +146,7 @@ function warmSsr(holder) {
146
146
  }
147
147
  function load(name, isolate, priority) {
148
148
  const file = (n) => loadFile(n, isolate, priority);
149
- return (protocol().entry(name) || !name.includes("/") ? file(name).then((r) => mountable(name, r)) : import("./expose-KL6TA472.js").then((m) => m.resolveTarget(name, file))).catch(fail);
149
+ return (protocol().entry(name) || !name.includes("/") ? file(name).then((r) => mountable(name, r)) : import("./expose-PY7A4VM2.js").then((m) => m.resolveTarget(name, file))).catch(fail);
150
150
  }
151
151
  function loadFile(name, isolate, priority) {
152
152
  const p = protocol();
@@ -167,8 +167,11 @@ function loadFile(name, isolate, priority) {
167
167
  const d = resolved.split?.dedupe;
168
168
  if (d?.some((x) => x.uses)) (p.uses ??= {})[resolved.split.entry] = Object.fromEntries(d.map((x) => [x.name, x.uses]));
169
169
  prefetchCss(resolved, (isolate ?? resolved.isolate ?? p.settings().isolate) === "shadow", priority);
170
+ const { i18n, timeout } = p.settings();
171
+ const words = resolved.i18n && i18n && import("./i18n-WISV4IP6.js").then((m) => m.loadTranslations(name, resolved.i18n, resolved.sri ?? {}, i18n, timeout, priority)).catch((e) => console.warn(`[vitral] ${name}: tradu\xE7\xF5es n\xE3o carregaram`, e));
170
172
  t = performance.now();
171
173
  const ns = await withRetry(p.settings().retries, () => importModule(name, resolved));
174
+ await words;
172
175
  metric(name, "js", t);
173
176
  return { ...resolved, module: ns?.default ?? ns, exports: ns };
174
177
  } catch (e) {
@@ -216,6 +219,8 @@ async function resolveEntry(name, entry, priority, early) {
216
219
  version: m.version,
217
220
  sri,
218
221
  priority,
222
+ // As URLs viram absolutas no módulo das traduções, que só baixa quando há o que traduzir.
223
+ ...m.i18n && { i18n: { files: m.i18n, base: entry.url } },
219
224
  split: m.split && typeof entry.integrity !== "string" ? {
220
225
  entry: abs(m.split.entry),
221
226
  chunks: (m.split.chunks ?? []).map(abs),
@@ -3,7 +3,7 @@ import {
3
3
  loadFile,
4
4
  registerSrc,
5
5
  resolveEntry
6
- } from "./chunk-52D6ZT4A.js";
6
+ } from "./chunk-NGO67IJR.js";
7
7
  import {
8
8
  injectStyles
9
9
  } from "./chunk-YDO7SPF4.js";
@@ -87,7 +87,7 @@ var noop = () => {
87
87
  async function checkUpdates() {
88
88
  const p = protocol();
89
89
  const found = [];
90
- const { splitName } = await import("./expose-KL6TA472.js");
90
+ const { splitName } = await import("./expose-PY7A4VM2.js");
91
91
  const remotes = /* @__PURE__ */ new Map();
92
92
  for (const name of live.keys()) {
93
93
  const root = splitName(name)[0];
@@ -132,8 +132,8 @@ async function mountOnce(target, name, props, options) {
132
132
  const p = protocol();
133
133
  await p.pending();
134
134
  const isolate = options.isolate ?? registered(name)?.isolate ?? p.settings().isolate;
135
- if (isolate === "iframe") return (frames ?? (await import("./reframe-AD2UEPIO.js")).noFrames)(target, name, props, options).catch(fail);
136
- const { module: mod, ...resolved } = await (isolate == "reframe" ? (await import("./reframe-AD2UEPIO.js")).load : load)(name, isolate, options.priority);
135
+ if (isolate === "iframe") return (frames ?? (await import("./reframe-RLSKSEJS.js")).noFrames)(target, name, props, options).catch(fail);
136
+ const { module: mod, ...resolved } = await (isolate == "reframe" ? (await import("./reframe-RLSKSEJS.js")).load : load)(name, isolate, options.priority);
137
137
  const untrack = track(name, resolved);
138
138
  ctxHooks.watch?.(name);
139
139
  const label = resolved.name ?? name;
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createSlot
3
- } from "./chunk-I7IFR65H.js";
3
+ } from "./chunk-WIQ3W6AY.js";
4
4
  import {
5
5
  policy,
6
6
  preload,
7
7
  registerSrc
8
- } from "./chunk-52D6ZT4A.js";
8
+ } from "./chunk-NGO67IJR.js";
9
9
  import {
10
10
  ctxHooks
11
11
  } from "./chunk-JWDDXX5O.js";
package/dist/edge.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { R as Routes } from './match-CMBM_jLW.js';
2
2
  import { S as ServerRendered } from './ssr-markup-BCPpGmss.js';
3
- import { P as Props } from './types-DJautV-K.js';
3
+ import { P as Props } from './types-cSsvpvgE.js';
4
4
  import './errors-kjBv6IH_.js';
5
5
 
6
6
  /**
package/dist/element.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as Props, S as Shared, a as RemoteModule } from './types-DJautV-K.js';
2
- import { S as SlotStatus } from './slot--WLgdcW_.js';
1
+ import { P as Props, S as Shared, a as RemoteModule } from './types-cSsvpvgE.js';
2
+ import { S as SlotStatus } from './slot-CxhuVuka.js';
3
3
  import './errors-kjBv6IH_.js';
4
4
 
5
5
  /**
package/dist/element.js CHANGED
@@ -3,11 +3,11 @@ import {
3
3
  VitralRemoteElement,
4
4
  defineVitralElement,
5
5
  elementRemote
6
- } from "./chunk-UFETTKDP.js";
7
- import "./chunk-JKTZODC5.js";
8
- import "./chunk-I7IFR65H.js";
9
- import "./chunk-52D6ZT4A.js";
10
- import "./chunk-QGAEXUP5.js";
6
+ } from "./chunk-B4LYXSNK.js";
7
+ import "./chunk-XNUU3YPA.js";
8
+ import "./chunk-WIQ3W6AY.js";
9
+ import "./chunk-NGO67IJR.js";
10
+ import "./chunk-OKXLOMAG.js";
11
11
  import "./chunk-YDO7SPF4.js";
12
12
  import "./chunk-VDVVEGAO.js";
13
13
  import "./chunk-BQGVAXFM.js";