vitral 0.12.1 → 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-B23S6737.js → chunk-2NMBPSMO.js} +35 -4
  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 +104 -42
  56. package/dist/vue.d.ts +3 -3
  57. package/dist/vue.js +4 -4
  58. package/package.json +39 -24
  59. /package/dist/{chunk-QGAEXUP5.js → chunk-OKXLOMAG.js} +0 -0
@@ -2,9 +2,9 @@ import {
2
2
  resolveModule,
3
3
  resolveTarget,
4
4
  splitName
5
- } from "./chunk-YKLWMIEH.js";
6
- import "./chunk-52D6ZT4A.js";
7
- import "./chunk-QGAEXUP5.js";
5
+ } from "./chunk-GJY5QTOO.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";
@@ -1,4 +1,4 @@
1
- import { a as RemoteModule, b as SharedModules, c as RemoteEntry } from './types-DJautV-K.js';
1
+ import { a as RemoteModule, b as SharedModules, c as RemoteEntry } from './types-cSsvpvgE.js';
2
2
  import './errors-kjBv6IH_.js';
3
3
 
4
4
  /**
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  hostSlot
3
- } from "./chunk-JKTZODC5.js";
3
+ } from "./chunk-XNUU3YPA.js";
4
4
  import {
5
5
  mountOnce,
6
6
  refreshable,
7
7
  registered,
8
8
  track
9
- } from "./chunk-I7IFR65H.js";
9
+ } from "./chunk-WIQ3W6AY.js";
10
10
  import {
11
11
  load
12
- } from "./chunk-52D6ZT4A.js";
13
- import "./chunk-QGAEXUP5.js";
12
+ } from "./chunk-NGO67IJR.js";
13
+ import "./chunk-OKXLOMAG.js";
14
14
  import {
15
15
  injectStyles
16
16
  } from "./chunk-YDO7SPF4.js";
@@ -0,0 +1,16 @@
1
+ import {
2
+ loadTranslations,
3
+ pickLanguage,
4
+ resetTranslations
5
+ } from "./chunk-EGUHWWE4.js";
6
+ import "./chunk-UCFOXMOR.js";
7
+ import "./chunk-VDVVEGAO.js";
8
+ import "./chunk-BQGVAXFM.js";
9
+ import "./chunk-JWDDXX5O.js";
10
+ import "./chunk-GNPFWISJ.js";
11
+ import "./chunk-MLKGABMK.js";
12
+ export {
13
+ loadTranslations,
14
+ pickLanguage,
15
+ resetTranslations
16
+ };
package/dist/i18n.d.ts ADDED
@@ -0,0 +1,52 @@
1
+ import { f as I18nHost } from './types-cSsvpvgE.js';
2
+ import './errors-kjBv6IH_.js';
3
+
4
+ /**
5
+ * Traduções dos remotes (`i18n` do `vitral.json`). Módulo à parte, baixado só
6
+ * quando um manifesto traz traduções e o host passou `configure({ i18n })`.
7
+ *
8
+ * Cada remote baixa só a língua aberta, junto com o JS, e as traduções entram
9
+ * no i18next (ou no que o host usar) antes da montagem. Numa troca de língua,
10
+ * os remotes já carregados baixam a língua nova.
11
+ */
12
+
13
+ /**
14
+ * Língua do remote para a língua aberta: a mesma, a base (`pt` para `pt-BR`),
15
+ * uma variante da base (`pt-PT` para `pt`), ou a primeira do `fallback` que o
16
+ * remote tiver.
17
+ */
18
+ declare function pickLanguage(lng: string, available: string[], fallback?: string[]): string | undefined;
19
+
20
+ /**
21
+ * Traduções dos remotes no i18next do host.
22
+ *
23
+ * ```ts
24
+ * import i18n from 'i18next'
25
+ * import { configure } from 'vitral'
26
+ * import { i18next } from 'vitral/i18n'
27
+ *
28
+ * configure({ remotes, i18n: i18next(i18n) })
29
+ * ```
30
+ *
31
+ * Cada remote com `i18n` no plugin baixa só a língua aberta, junto com o JS,
32
+ * e as traduções entram nesta instância antes da montagem. Com `dedupe:
33
+ * ['i18next', 'react-i18next']` no remote, o `useTranslation` dele lê daqui.
34
+ */
35
+
36
+ /** O que o vitral usa de uma instância do i18next. */
37
+ interface I18nextLike {
38
+ language?: string;
39
+ options?: {
40
+ fallbackLng?: unknown;
41
+ };
42
+ addResourceBundle(lng: string, ns: string, resources: any, deep?: boolean, overwrite?: boolean): unknown;
43
+ on(event: 'languageChanged', fn: (lng: string) => void): unknown;
44
+ off(event: 'languageChanged', fn: (lng: string) => void): unknown;
45
+ changeLanguage(lng?: string): unknown;
46
+ }
47
+ /** `fallbackLng` do i18next (texto, lista, objeto por língua ou função) como lista. */
48
+ declare function fallbacks(value: unknown, lng?: string): string[];
49
+ /** Adaptador de uma instância do i18next para `configure({ i18n })`. */
50
+ declare function i18next(i: I18nextLike): I18nHost;
51
+
52
+ export { I18nHost, type I18nextLike, fallbacks, i18next, pickLanguage };
package/dist/i18n.js ADDED
@@ -0,0 +1,39 @@
1
+ import {
2
+ pickLanguage
3
+ } from "./chunk-EGUHWWE4.js";
4
+ import "./chunk-UCFOXMOR.js";
5
+ import "./chunk-VDVVEGAO.js";
6
+ import "./chunk-BQGVAXFM.js";
7
+ import "./chunk-JWDDXX5O.js";
8
+ import "./chunk-GNPFWISJ.js";
9
+ import "./chunk-MLKGABMK.js";
10
+
11
+ // src/i18n.ts
12
+ function fallbacks(value, lng = "") {
13
+ if (typeof value === "function") return fallbacks(value(lng), lng);
14
+ if (typeof value === "string") return [value];
15
+ if (Array.isArray(value)) return value.filter((x) => typeof x === "string");
16
+ if (value && typeof value === "object") {
17
+ const o = value;
18
+ return [...fallbacks(o[lng]), ...fallbacks(o[lng.split("-")[0]]), ...fallbacks(o.default)];
19
+ }
20
+ return [];
21
+ }
22
+ function i18next(i) {
23
+ return {
24
+ language: () => i.language ?? "",
25
+ fallback: () => fallbacks(i.options?.fallbackLng, i.language),
26
+ add: (lng, ns, data) => void i.addResourceBundle(lng, ns, data, true, true),
27
+ onChange(fn) {
28
+ i.on("languageChanged", fn);
29
+ return () => void i.off("languageChanged", fn);
30
+ },
31
+ // O react-i18next desenha de novo no `languageChanged`, não quando um namespace entra.
32
+ refresh: () => void i.changeLanguage(i.language)
33
+ };
34
+ }
35
+ export {
36
+ fallbacks,
37
+ i18next,
38
+ pickLanguage
39
+ };
package/dist/iframe.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  splitName
3
- } from "./chunk-YKLWMIEH.js";
3
+ } from "./chunk-GJY5QTOO.js";
4
4
  import {
5
5
  verifyIntegrity
6
6
  } from "./chunk-UCFOXMOR.js";
7
7
  import {
8
8
  setFrameMounter,
9
9
  track
10
- } from "./chunk-I7IFR65H.js";
10
+ } from "./chunk-WIQ3W6AY.js";
11
11
  import {
12
12
  resolveEntry
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 {
17
17
  fetchBytes,
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { V as VitralConfig, c as RemoteEntry, I as Isolation, e as StyleOptions, P as Props, M as MountedRemote, a as RemoteModule, E as EventBus, R as RemoteContext, f as SharedValue } from './types-DJautV-K.js';
2
- export { g as Channel, h as ChannelContext, C as CheckedProps, D as DedupePlan, i as DevOverrides, H as Handler, j as McpAppBridge, k as PlannedCopy, l as Policy, m as PropsOf, n as ProvideOptions, o as ProvidedValue, p as RemoteContract, d as RemoteManifest, q as RemoteMetric, r as Remotes, s as RollbackInfo, S as Shared, t as SharedApi, b as SharedModules, u as SharedType, v as Signals, w as batch, x as choose, y as planDedupe, z as policy, A as provide, B as shared, F as signals, G as signalsFrom } from './types-DJautV-K.js';
1
+ import { V as VitralConfig, c as RemoteEntry, I as Isolation, e as StyleOptions, P as Props, M as MountedRemote, a as RemoteModule, E as EventBus, R as RemoteContext, g as SharedValue } from './types-cSsvpvgE.js';
2
+ export { h as Channel, i as ChannelContext, C as CheckedProps, D as DedupePlan, j as DevOverrides, H as Handler, k as McpAppBridge, l as PlannedCopy, m as Policy, n as PropsOf, o as ProvideOptions, p as ProvidedValue, q as RemoteContract, d as RemoteManifest, r as RemoteMetric, s as Remotes, t as RollbackInfo, S as Shared, u as SharedApi, b as SharedModules, v as SharedType, w as Signals, x as batch, y as choose, z as planDedupe, A as policy, B as provide, F as shared, G as signals, J as signalsFrom } from './types-cSsvpvgE.js';
3
3
  import { R as RemoteError } from './errors-kjBv6IH_.js';
4
4
  export { a as RemoteErrorCode } from './errors-kjBv6IH_.js';
5
- export { P as PreloadOptions, l as loadModule, a as loadRemote, p as preload } from './loader-Bmul2-5T.js';
6
- export { R as RemoteSlot, a as SlotOptions, S as SlotStatus, c as createSlot } from './slot--WLgdcW_.js';
7
- export { e as events } from './events-II6hXM3Q.js';
5
+ export { P as PreloadOptions, l as loadModule, a as loadRemote, p as preload } from './loader-vj8m2GQU.js';
6
+ export { R as RemoteSlot, a as SlotOptions, S as SlotStatus, c as createSlot } from './slot-CxhuVuka.js';
7
+ export { e as events } from './events-XXC4si92.js';
8
8
  export { n as navigate } from './navigate-BRG1WJUM.js';
9
9
  export { r as __reset } from './state-B1FJi8I9.js';
10
10
 
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  syncTabs,
16
16
  unsafeHTML,
17
17
  watchUpdates
18
- } from "./chunk-I7IFR65H.js";
18
+ } from "./chunk-WIQ3W6AY.js";
19
19
  import {
20
20
  choose,
21
21
  configure,
@@ -27,8 +27,8 @@ import {
27
27
  registerSrc,
28
28
  signals,
29
29
  signalsFrom
30
- } from "./chunk-52D6ZT4A.js";
31
- import "./chunk-QGAEXUP5.js";
30
+ } from "./chunk-NGO67IJR.js";
31
+ import "./chunk-OKXLOMAG.js";
32
32
  import "./chunk-YDO7SPF4.js";
33
33
  import "./chunk-VDVVEGAO.js";
34
34
  import {
@@ -1,4 +1,4 @@
1
- import { P as Props, a as RemoteModule } from './types-DJautV-K.js';
1
+ import { P as Props, a as RemoteModule } from './types-cSsvpvgE.js';
2
2
 
3
3
  /** Baixa (uma vez só) e devolve o módulo de um remote. */
4
4
  declare function loadRemote<P extends Props = Props>(name: string): Promise<RemoteModule<P>>;
@@ -1,4 +1,4 @@
1
- import { D as DedupePlan } from './types-DJautV-K.js';
1
+ import { D as DedupePlan } from './types-cSsvpvgE.js';
2
2
  import { ZoneRoute } from './next.js';
3
3
  import './errors-kjBv6IH_.js';
4
4
  import 'react';
@@ -14,6 +14,8 @@ interface HtmlHints {
14
14
  offers?: string[];
15
15
  /** Com `keys`: o `integrity` do preload do manifesto (só as assinaturas). */
16
16
  signed?: string;
17
+ /** Traduções por língua: o HTML pré-carrega só as da língua aberta (`lang` do `VitralNext`). */
18
+ i18n?: Record<string, Hint[]>;
17
19
  }
18
20
 
19
21
  interface NextRemoteConfig {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  subpaths
3
- } from "./chunk-B23S6737.js";
3
+ } from "./chunk-2NMBPSMO.js";
4
4
  import {
5
5
  hintsOf
6
- } from "./chunk-QQWE5J6U.js";
6
+ } from "./chunk-AJUORT35.js";
7
7
  import "./chunk-5O6XDJBR.js";
8
8
  import {
9
9
  planDedupe
@@ -1,11 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
- import { d as RemoteManifest } from './types-DJautV-K.js';
2
+ import { d as RemoteManifest } from './types-cSsvpvgE.js';
3
3
  import { RemoteProps } from './react.js';
4
4
  import './errors-kjBv6IH_.js';
5
5
  import './host-slot-Cz6EiGsB.js';
6
6
  import 'react/jsx-runtime';
7
- import './loader-Bmul2-5T.js';
8
- import './events-II6hXM3Q.js';
7
+ import './loader-vj8m2GQU.js';
8
+ import './events-XXC4si92.js';
9
9
 
10
10
  /** O remote dono do caminho público `path`, se houver. */
11
11
  declare function remoteFor(path: string): string | undefined;
@@ -19,13 +19,18 @@ interface VitralNextProps {
19
19
  pageProps?: {
20
20
  vitral?: Record<string, RemoteManifest | null>;
21
21
  };
22
+ /**
23
+ * Língua aberta, para o HTML pré-carregar as traduções do remote nela
24
+ * (`i18n` do plugin). Padrão: o `locale` do roteador do Next.
25
+ */
26
+ lang?: string;
22
27
  }
23
28
  /**
24
29
  * Coloque uma vez, no `_app`. Na página de um remote, o HTML já sai com as
25
30
  * dicas de preload dele, mesmo quando a página só desenha o `NextRemote`
26
31
  * no navegador (depois do login, por exemplo).
27
32
  */
28
- declare function VitralNext({ pageProps }?: VitralNextProps): ReactNode;
33
+ declare function VitralNext({ pageProps, lang }?: VitralNextProps): ReactNode;
29
34
  type NextRemoteProps = Omit<RemoteProps, 'name' | 'src'> & {
30
35
  name: string;
31
36
  /**
@@ -34,12 +39,14 @@ type NextRemoteProps = Omit<RemoteProps, 'name' | 'src'> & {
34
39
  * pede o manifesto. `null` ou ausente: o preload do build e o pedido de sempre.
35
40
  */
36
41
  manifest?: RemoteManifest | null;
42
+ /** Língua aberta, para o preload das traduções do remote. Padrão: o `locale` do roteador do Next. */
43
+ lang?: string;
37
44
  };
38
45
  /**
39
46
  * O remote na página do host. Passa o roteador do Next ao remote (prop
40
47
  * `__next`, lida pelo plugin no modo `next`): `useRouter`, `<Link>` e
41
48
  * `router.push` do remote usam o do host, com as rotas públicas.
42
49
  */
43
- declare function NextRemote({ name, props, fallback, manifest, ...rest }: NextRemoteProps): ReactNode;
50
+ declare function NextRemote({ name, props, fallback, manifest, lang, ...rest }: NextRemoteProps): ReactNode;
44
51
 
45
52
  export { NextRemote, type NextRemoteProps, VitralNext, type VitralNextProps, interceptNavigation, remoteFor };
package/dist/next-host.js CHANGED
@@ -1,30 +1,33 @@
1
1
  "use client";
2
- import {
3
- sri_exports
4
- } from "./chunk-VDNFRNOG.js";
5
2
  import {
6
3
  dedupe_exports
7
4
  } from "./chunk-LDOSAAEF.js";
5
+ import {
6
+ sri_exports
7
+ } from "./chunk-LITYI5X7.js";
8
8
  import {
9
9
  Remote,
10
10
  preload
11
- } from "./chunk-RGYVSS3X.js";
11
+ } from "./chunk-C3LH5DSE.js";
12
12
  import "./chunk-KCF46XOX.js";
13
+ import {
14
+ pickLanguage
15
+ } from "./chunk-EGUHWWE4.js";
13
16
  import "./chunk-UCFOXMOR.js";
14
17
  import {
15
18
  hintsOf
16
- } from "./chunk-QQWE5J6U.js";
19
+ } from "./chunk-AJUORT35.js";
17
20
  import "./chunk-5O6XDJBR.js";
18
- import "./chunk-JKTZODC5.js";
19
- import "./chunk-I7IFR65H.js";
21
+ import "./chunk-XNUU3YPA.js";
22
+ import "./chunk-WIQ3W6AY.js";
20
23
  import {
21
24
  configure,
22
25
  policy,
23
26
  register
24
- } from "./chunk-52D6ZT4A.js";
27
+ } from "./chunk-NGO67IJR.js";
25
28
  import {
26
29
  bundled
27
- } from "./chunk-QGAEXUP5.js";
30
+ } from "./chunk-OKXLOMAG.js";
28
31
  import "./chunk-YDO7SPF4.js";
29
32
  import "./chunk-VDVVEGAO.js";
30
33
  import "./chunk-BQGVAXFM.js";
@@ -38,7 +41,7 @@ import "./chunk-MLKGABMK.js";
38
41
  // src/next-host.tsx
39
42
  import Head from "next/head";
40
43
  import Router, { useRouter } from "next/router";
41
- import { createElement, Fragment, useEffect, useMemo, version as reactVersion } from "react";
44
+ import { createElement, Fragment, useEffect, useMemo, useState, version as reactVersion } from "react";
42
45
  import { plan, remotes, shared } from "vitral-next-host-config";
43
46
  var under = (path, prefix) => path === prefix || path.startsWith(prefix + "/");
44
47
  function remoteFor(path) {
@@ -109,11 +112,12 @@ function interceptClicks() {
109
112
  document.addEventListener("click", on);
110
113
  return () => document.removeEventListener("click", on);
111
114
  }
112
- function VitralNext({ pageProps } = {}) {
115
+ function VitralNext({ pageProps, lang } = {}) {
113
116
  setup();
114
117
  const router = useRouter();
115
118
  const name = remoteFor((router?.asPath ?? "/").split(/[?#]/)[0]);
116
119
  useEffect(() => {
120
+ hydrated = true;
117
121
  const here = remoteFor(location.pathname);
118
122
  const go = (name2) => preload(name2, { routes: !!remotes[name2].warmRoutes });
119
123
  if (here) go(here);
@@ -128,7 +132,8 @@ function VitralNext({ pageProps } = {}) {
128
132
  for (const id of idle) typeof cancelIdleCallback === "function" ? cancelIdleCallback(id) : clearTimeout(id);
129
133
  };
130
134
  }, []);
131
- return useMemo(() => name ? linksFor(name, pageProps?.vitral?.[name], false) : null, [name, pageProps]);
135
+ const lng = lang ?? router?.locale;
136
+ return useMemo(() => name ? linksFor(name, pageProps?.vitral?.[name], false, false, true, lng) : null, [name, pageProps, lng]);
132
137
  }
133
138
  var seeded = /* @__PURE__ */ new Map();
134
139
  function seed(name, m) {
@@ -139,33 +144,42 @@ function seed(name, m) {
139
144
  }
140
145
  var push = (url, options) => void Router.push(url, void 0, options);
141
146
  var replace = (url, options) => void Router.replace(url, void 0, options);
142
- function hints(h, shadow, replaces) {
147
+ function hints(h, shadow, replaces, low, lang) {
143
148
  if (!h) return null;
144
- const link = (as, [href, integrity, fetchPriority]) => createElement("link", { key: `vitral:${href}`, rel: "preload", as, href, crossOrigin: "anonymous", ...integrity && { integrity }, ...fetchPriority && { fetchPriority } });
149
+ const link = (as, [href, integrity, high]) => {
150
+ const fetchPriority = low ? "low" : high;
151
+ const sri = as !== "fetch" && integrity;
152
+ return createElement("link", { key: `vitral:${href}`, rel: "preload", as, href, crossOrigin: "anonymous", ...sri && { integrity: sri }, ...fetchPriority && { fetchPriority } });
153
+ };
145
154
  const out = [
146
155
  ...h.manifest ? [link("fetch", [h.manifest, h.signed])] : [],
147
156
  // Com Shadow DOM o CSS vem por fetch: o preload de estilo não serviria.
148
157
  ...shadow ? [] : h.css.map((c) => link("style", c)),
149
- ...h.js.map((j) => link("script", j))
158
+ ...h.js.map((j) => link("script", j)),
159
+ // Traduções da língua aberta, junto com o JS: o remote monta depois que elas entram.
160
+ ...lang && h.i18n ? (h.i18n[pickLanguage(lang, Object.keys(h.i18n)) ?? ""] ?? []).map((t) => link("fetch", t)) : []
150
161
  ];
151
162
  const have = new Set(out.map((l) => l.key));
152
163
  for (const href of replaces ? [replaces.manifest, ...replaces.css.map((c) => c[0]), ...replaces.js.map((j) => j[0])] : [])
153
164
  if (href && !have.has(`vitral:${href}`)) out.push(createElement("link", { key: `vitral:${href}`, rel: "dns-prefetch", href: new URL(href, "http://h.invalid").origin.replace("http://h.invalid", "/") }));
154
165
  return createElement(Head, null, ...out);
155
166
  }
156
- function linksFor(name, manifest, shadow, replaces) {
167
+ var hydrated = false;
168
+ function linksFor(name, manifest, shadow, replaces, low, lang) {
157
169
  const r = remotes[name];
158
170
  const h = manifest && r ? hintsOf(manifest, r.url, offered(), r.integrity, r.keys) : r?.hints;
159
- return hints(manifest && h ? { ...h, manifest: "" } : h, shadow, replaces ? r?.hints : void 0);
171
+ return hints(manifest && h ? { ...h, manifest: "" } : h, shadow, replaces ? r?.hints : void 0, low, lang);
160
172
  }
161
- function NextRemote({ name, props, fallback = null, manifest, ...rest }) {
173
+ function NextRemote({ name, props, fallback = null, manifest, lang, ...rest }) {
162
174
  setup();
163
175
  if (manifest) seed(name, manifest);
164
176
  const router = useRouter();
165
177
  const r = remotes[name];
166
178
  const host = useMemo(() => ({ asPath: router.asPath, basePath: r?.basePath, routes: r?.routes, push, replace, events: Router.events }), [router.asPath, r]);
167
179
  const all = useMemo(() => ({ ...props, __next: host }), [props, host]);
168
- const links = useMemo(() => linksFor(name, manifest, rest.isolate === "shadow", true), [name, manifest, rest.isolate]);
180
+ const lng = lang ?? router.locale;
181
+ const [late] = useState(() => hydrated);
182
+ const links = useMemo(() => linksFor(name, manifest, rest.isolate === "shadow", true, late, lng), [name, manifest, rest.isolate, late, lng]);
169
183
  return createElement(Fragment, null, links, router.isReady ? createElement(Remote, { ...rest, name, fallback, props: all }) : fallback);
170
184
  }
171
185
  export {
@@ -1,5 +1,5 @@
1
1
  import { S as ServerRendered } from './ssr-markup-BCPpGmss.js';
2
- import { P as Props, d as RemoteManifest } from './types-DJautV-K.js';
2
+ import { P as Props, d as RemoteManifest } from './types-cSsvpvgE.js';
3
3
  import './errors-kjBv6IH_.js';
4
4
 
5
5
  /** SSR de um remote na página do host: o `render` do servidor do remote e as props. */
package/dist/preact.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as preact from 'preact';
2
2
  import { VNode, ComponentType } from 'preact';
3
- import { P as Props, I as Isolation, C as CheckedProps, a as RemoteModule, S as Shared } from './types-DJautV-K.js';
4
- export { R as RemoteContext } from './types-DJautV-K.js';
3
+ import { P as Props, I as Isolation, C as CheckedProps, a as RemoteModule, S as Shared } from './types-cSsvpvgE.js';
4
+ export { R as RemoteContext } from './types-cSsvpvgE.js';
5
5
  import { R as RemoteError } from './errors-kjBv6IH_.js';
6
- import { S as SlotStatus } from './slot--WLgdcW_.js';
7
- export { e as events } from './events-II6hXM3Q.js';
6
+ import { S as SlotStatus } from './slot-CxhuVuka.js';
7
+ export { e as events } from './events-XXC4si92.js';
8
8
  export { n as navigate } from './navigate-BRG1WJUM.js';
9
9
  import { L as Loading, P as Prefetch } from './host-slot-Cz6EiGsB.js';
10
10
 
package/dist/preact.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  hostSlot
3
- } from "./chunk-JKTZODC5.js";
3
+ } from "./chunk-XNUU3YPA.js";
4
4
  import {
5
5
  defineRemote,
6
6
  memoSelect,
7
7
  same,
8
8
  shared
9
- } from "./chunk-I7IFR65H.js";
10
- import "./chunk-52D6ZT4A.js";
11
- import "./chunk-QGAEXUP5.js";
9
+ } from "./chunk-WIQ3W6AY.js";
10
+ import "./chunk-NGO67IJR.js";
11
+ import "./chunk-OKXLOMAG.js";
12
12
  import "./chunk-YDO7SPF4.js";
13
13
  import "./chunk-VDVVEGAO.js";
14
14
  import "./chunk-BQGVAXFM.js";
package/dist/prefetch.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  policy,
3
3
  resolveEntry
4
- } from "./chunk-52D6ZT4A.js";
5
- import "./chunk-QGAEXUP5.js";
4
+ } from "./chunk-NGO67IJR.js";
5
+ import "./chunk-OKXLOMAG.js";
6
6
  import "./chunk-YDO7SPF4.js";
7
7
  import {
8
8
  addLink
@@ -1,6 +1,6 @@
1
1
  import { ComponentType } from 'react';
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/react.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { ReactNode, ComponentType } from 'react';
2
2
  import { L as Loading, P as Prefetch } from './host-slot-Cz6EiGsB.js';
3
3
  import * as JSXRuntime from 'react/jsx-runtime';
4
- import { P as Props, I as Isolation, C as CheckedProps, a as RemoteModule, S as Shared, R as RemoteContext } from './types-DJautV-K.js';
5
- export { E as EventBus } from './types-DJautV-K.js';
6
- import { P as PreloadOptions } from './loader-Bmul2-5T.js';
7
- export { e as events } from './events-II6hXM3Q.js';
4
+ import { P as Props, I as Isolation, C as CheckedProps, a as RemoteModule, S as Shared, R as RemoteContext } from './types-cSsvpvgE.js';
5
+ export { E as EventBus } from './types-cSsvpvgE.js';
6
+ import { P as PreloadOptions } from './loader-vj8m2GQU.js';
7
+ export { e as events } from './events-XXC4si92.js';
8
8
  import './errors-kjBv6IH_.js';
9
9
 
10
10
  /**
package/dist/react.js CHANGED
@@ -9,12 +9,12 @@ import {
9
9
  usePortalContainer,
10
10
  useShared,
11
11
  useVitral
12
- } from "./chunk-RGYVSS3X.js";
12
+ } from "./chunk-C3LH5DSE.js";
13
13
  import "./chunk-KCF46XOX.js";
14
- import "./chunk-JKTZODC5.js";
15
- import "./chunk-I7IFR65H.js";
16
- import "./chunk-52D6ZT4A.js";
17
- import "./chunk-QGAEXUP5.js";
14
+ import "./chunk-XNUU3YPA.js";
15
+ import "./chunk-WIQ3W6AY.js";
16
+ import "./chunk-NGO67IJR.js";
17
+ import "./chunk-OKXLOMAG.js";
18
18
  import "./chunk-YDO7SPF4.js";
19
19
  import "./chunk-VDVVEGAO.js";
20
20
  import "./chunk-BQGVAXFM.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  splitName
3
- } from "./chunk-YKLWMIEH.js";
3
+ } from "./chunk-GJY5QTOO.js";
4
4
  import {
5
5
  verifyIntegrity
6
6
  } from "./chunk-UCFOXMOR.js";
7
7
  import {
8
8
  resolveEntry
9
- } from "./chunk-52D6ZT4A.js";
10
- import "./chunk-QGAEXUP5.js";
9
+ } from "./chunk-NGO67IJR.js";
10
+ import "./chunk-OKXLOMAG.js";
11
11
  import {
12
12
  prefetchCss
13
13
  } from "./chunk-YDO7SPF4.js";
package/dist/routes.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { R as Routes, a as RouteMatch } from './match-CMBM_jLW.js';
2
- import { P as Props } from './types-DJautV-K.js';
3
- import { S as SlotStatus } from './slot--WLgdcW_.js';
2
+ import { P as Props } from './types-cSsvpvgE.js';
3
+ import { S as SlotStatus } from './slot-CxhuVuka.js';
4
4
  import './errors-kjBv6IH_.js';
5
5
 
6
6
  interface RoutesOptions {
package/dist/routes.js CHANGED
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-OVVGVPIV.js";
4
4
  import {
5
5
  createSlot
6
- } from "./chunk-I7IFR65H.js";
6
+ } from "./chunk-WIQ3W6AY.js";
7
7
  import {
8
8
  warmSsr
9
- } from "./chunk-52D6ZT4A.js";
10
- import "./chunk-QGAEXUP5.js";
9
+ } from "./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";
@@ -122,7 +122,7 @@ var VitralOutletElement = class extends Base {
122
122
  if (ssr?.getAttribute("data-vitral-slot") === name) {
123
123
  this.#status("loading", null);
124
124
  warmSsr(ssr);
125
- import("./hydrate-LS3MLFGN.js").then((m) => {
125
+ import("./hydrate-UOEAX7D3.js").then((m) => {
126
126
  if (this.#route === name && !this.#slot) this.#slot = m.hydrateSlot(this, ssr, { ...options, props: this.#props });
127
127
  else ssr.remove();
128
128
  });
@@ -1,4 +1,4 @@
1
- import { P as Props, a as RemoteModule } from './types-DJautV-K.js';
1
+ import { P as Props, a as RemoteModule } from './types-cSsvpvgE.js';
2
2
  import './errors-kjBv6IH_.js';
3
3
 
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { R as RemoteError } from './errors-kjBv6IH_.js';
2
- import { P as Props, I as Isolation, e as StyleOptions } from './types-DJautV-K.js';
2
+ import { P as Props, I as Isolation, e as StyleOptions } from './types-cSsvpvgE.js';
3
3
 
4
4
  type SlotStatus = 'loading' | 'ready' | 'error';
5
5
  interface SlotOptions<P extends Props = Props> {
package/dist/solid.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { JSX, Component, Accessor } from 'solid-js';
2
- import { P as Props, I as Isolation, C as CheckedProps, a as RemoteModule, S as Shared } from './types-DJautV-K.js';
3
- export { R as RemoteContext } from './types-DJautV-K.js';
2
+ import { P as Props, I as Isolation, C as CheckedProps, a as RemoteModule, S as Shared } from './types-cSsvpvgE.js';
3
+ export { R as RemoteContext } from './types-cSsvpvgE.js';
4
4
  import { R as RemoteError } from './errors-kjBv6IH_.js';
5
- export { e as events } from './events-II6hXM3Q.js';
5
+ export { e as events } from './events-XXC4si92.js';
6
6
  export { n as navigate } from './navigate-BRG1WJUM.js';
7
7
  import { L as Loading, P as Prefetch } from './host-slot-Cz6EiGsB.js';
8
8
 
package/dist/solid.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  hostSlot
3
- } from "./chunk-JKTZODC5.js";
3
+ } from "./chunk-XNUU3YPA.js";
4
4
  import {
5
5
  defineRemote,
6
6
  memoSelect,
7
7
  same,
8
8
  shared
9
- } from "./chunk-I7IFR65H.js";
10
- import "./chunk-52D6ZT4A.js";
11
- import "./chunk-QGAEXUP5.js";
9
+ } from "./chunk-WIQ3W6AY.js";
10
+ import "./chunk-NGO67IJR.js";
11
+ import "./chunk-OKXLOMAG.js";
12
12
  import "./chunk-YDO7SPF4.js";
13
13
  import "./chunk-VDVVEGAO.js";
14
14
  import "./chunk-BQGVAXFM.js";
@@ -2,9 +2,9 @@ import {
2
2
  importVerified,
3
3
  signature,
4
4
  verified
5
- } from "./chunk-VDNFRNOG.js";
5
+ } from "./chunk-LITYI5X7.js";
6
6
  import "./chunk-UCFOXMOR.js";
7
- import "./chunk-QGAEXUP5.js";
7
+ import "./chunk-OKXLOMAG.js";
8
8
  import "./chunk-VDVVEGAO.js";
9
9
  import "./chunk-BQGVAXFM.js";
10
10
  import "./chunk-JWDDXX5O.js";