@fluenti/solid 0.6.1 → 0.6.3

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 (62) hide show
  1. package/dist/components-entry-Bdm3s2x9.cjs +1 -0
  2. package/dist/{components-entry-C-Df62O-.js → components-entry-Dfzg6Idb.js} +189 -111
  3. package/dist/components-entry.cjs +1 -1
  4. package/dist/components-entry.js +1 -1
  5. package/dist/index.cjs +1 -2
  6. package/dist/index.js +1 -3
  7. package/dist/server.cjs +1 -2
  8. package/dist/server.js +0 -2
  9. package/dist/solid/src/compile-time-t.d.ts +0 -1
  10. package/dist/solid/src/compiled.d.ts +0 -1
  11. package/dist/solid/src/components/DateTime.d.ts +0 -1
  12. package/dist/solid/src/components/NumberFormat.d.ts +0 -1
  13. package/dist/solid/src/components-entry.d.ts +0 -1
  14. package/dist/solid/src/context.d.ts +7 -2
  15. package/dist/solid/src/hooks/__useI18n.d.ts +0 -1
  16. package/dist/solid/src/index.d.ts +0 -1
  17. package/dist/solid/src/msg.d.ts +0 -1
  18. package/dist/solid/src/plain-runtime.d.ts +0 -1
  19. package/dist/solid/src/plural.d.ts +0 -1
  20. package/dist/solid/src/provider.d.ts +0 -1
  21. package/dist/solid/src/rich-dom.d.ts +0 -1
  22. package/dist/solid/src/select.d.ts +0 -1
  23. package/dist/solid/src/server.d.ts +0 -1
  24. package/dist/solid/src/solid-runtime.d.ts +0 -1
  25. package/dist/solid/src/trans.d.ts +0 -1
  26. package/dist/solid/src/types.d.ts +0 -1
  27. package/dist/solid/src/use-i18n.d.ts +2 -2
  28. package/dist/solid/src/vite-plugin.d.ts +0 -1
  29. package/dist/vite-plugin.cjs +1 -2
  30. package/dist/vite-plugin.js +0 -2
  31. package/package.json +3 -3
  32. package/src/context.ts +158 -1
  33. package/src/use-i18n.ts +8 -1
  34. package/dist/components-entry-5CGlUlc5.cjs +0 -2
  35. package/dist/components-entry-5CGlUlc5.cjs.map +0 -1
  36. package/dist/components-entry-C-Df62O-.js.map +0 -1
  37. package/dist/index.cjs.map +0 -1
  38. package/dist/index.js.map +0 -1
  39. package/dist/server.cjs.map +0 -1
  40. package/dist/server.js.map +0 -1
  41. package/dist/solid/src/compile-time-t.d.ts.map +0 -1
  42. package/dist/solid/src/compiled.d.ts.map +0 -1
  43. package/dist/solid/src/components/DateTime.d.ts.map +0 -1
  44. package/dist/solid/src/components/NumberFormat.d.ts.map +0 -1
  45. package/dist/solid/src/components-entry.d.ts.map +0 -1
  46. package/dist/solid/src/context.d.ts.map +0 -1
  47. package/dist/solid/src/hooks/__useI18n.d.ts.map +0 -1
  48. package/dist/solid/src/index.d.ts.map +0 -1
  49. package/dist/solid/src/msg.d.ts.map +0 -1
  50. package/dist/solid/src/plain-runtime.d.ts.map +0 -1
  51. package/dist/solid/src/plural.d.ts.map +0 -1
  52. package/dist/solid/src/provider.d.ts.map +0 -1
  53. package/dist/solid/src/rich-dom.d.ts.map +0 -1
  54. package/dist/solid/src/select.d.ts.map +0 -1
  55. package/dist/solid/src/server.d.ts.map +0 -1
  56. package/dist/solid/src/solid-runtime.d.ts.map +0 -1
  57. package/dist/solid/src/trans.d.ts.map +0 -1
  58. package/dist/solid/src/types.d.ts.map +0 -1
  59. package/dist/solid/src/use-i18n.d.ts.map +0 -1
  60. package/dist/solid/src/vite-plugin.d.ts.map +0 -1
  61. package/dist/vite-plugin.cjs.map +0 -1
  62. package/dist/vite-plugin.js.map +0 -1
@@ -3,15 +3,34 @@ import { createFluentiCore as a } from "@fluenti/core";
3
3
  import { Dynamic as o, createComponent as s, memo as c } from "solid-js/web";
4
4
  import { PLURAL_CATEGORIES as l, buildICUPluralMessage as u, buildICUSelectMessage as d, hashMessage as f, normalizeSelectForms as p, offsetIndices as m } from "@fluenti/core/runtime";
5
5
  //#region src/context.ts
6
- var h = Symbol.for("fluenti.runtime.solid.v1");
7
- function g() {
6
+ var h = Symbol.for("fluenti.runtime.solid.v1"), g = Symbol.for("fluenti.solid.context.v1"), _ = Symbol.for("fluenti.solid.fallback-context.v1");
7
+ function v() {
8
8
  let e = globalThis[h];
9
9
  return typeof e == "object" && e ? e : null;
10
10
  }
11
- function _(e) {
11
+ function y(e) {
12
12
  return typeof e == "object" && e && "default" in e ? e.default : e;
13
13
  }
14
- var v = {
14
+ function b() {
15
+ try {
16
+ if (typeof process < "u" && process.env != null && process.env.NODE_ENV === "production") return !1;
17
+ } catch {}
18
+ try {
19
+ return !1;
20
+ } catch {}
21
+ try {
22
+ if (typeof process < "u" && process.env != null) return process.env.NODE_ENV !== "production";
23
+ } catch {}
24
+ return !1;
25
+ }
26
+ function x(e) {
27
+ let t = globalThis[e];
28
+ return t && typeof t == "object" ? t : void 0;
29
+ }
30
+ function S(e, t) {
31
+ return globalThis[e] = t, t;
32
+ }
33
+ var C = {
15
34
  en: "USD",
16
35
  "en-US": "USD",
17
36
  "en-GB": "GBP",
@@ -40,7 +59,7 @@ var v = {
40
59
  ru: "RUB",
41
60
  ar: "SAR",
42
61
  hi: "INR"
43
- }, y = {
62
+ }, w = {
44
63
  short: {
45
64
  year: "numeric",
46
65
  month: "numeric",
@@ -63,10 +82,10 @@ var v = {
63
82
  hour: "numeric",
64
83
  minute: "numeric"
65
84
  }
66
- }, b = {
85
+ }, T = {
67
86
  currency: (e) => ({
68
87
  style: "currency",
69
- currency: v[e] ?? v[e.split("-")[0]] ?? "USD"
88
+ currency: C[e] ?? C[e.split("-")[0]] ?? "USD"
70
89
  }),
71
90
  percent: { style: "percent" },
72
91
  decimal: {
@@ -74,16 +93,70 @@ var v = {
74
93
  maximumFractionDigits: 2
75
94
  }
76
95
  };
77
- function x(e) {
96
+ function E() {
97
+ let e = "en", t = { en: {} }, n = a({
98
+ locale: e,
99
+ messages: t,
100
+ devWarnings: !1
101
+ }), r = () => e, i = () => !1, o = () => new Set(Object.keys(t));
102
+ function s() {
103
+ n.locale !== e && (n.locale = e);
104
+ }
105
+ function c(e, ...t) {
106
+ return s(), Array.isArray(e) && "raw" in e ? n.t(e, ...t) : n.t(e, t[0]);
107
+ }
108
+ return {
109
+ locale: r,
110
+ setLocale: async (r) => {
111
+ e = r, n.locale = r, t[r] ??= {};
112
+ },
113
+ t: c,
114
+ loadMessages: (e, r) => {
115
+ n.loadMessages(e, r), t[e] = {
116
+ ...t[e],
117
+ ...r
118
+ };
119
+ },
120
+ getLocales: () => Array.from(new Set([...n.getLocales(), ...Object.keys(t)])),
121
+ d: (e, t) => (s(), n.d(e, t)),
122
+ n: (e, t) => (s(), n.n(e, t)),
123
+ format: (e, t) => (s(), n.format(e, t)),
124
+ isLoading: i,
125
+ loadedLocales: o,
126
+ preloadLocale: (e) => {},
127
+ te: (n, r) => {
128
+ let i = t[r ?? e];
129
+ return i !== void 0 && n in i;
130
+ },
131
+ tm: (n, r) => {
132
+ let i = t[r ?? e];
133
+ return i ? i[n] : void 0;
134
+ }
135
+ };
136
+ }
137
+ function D() {
138
+ let e = x(g);
139
+ if (e) return {
140
+ context: e,
141
+ source: "singleton"
142
+ };
143
+ if (!b()) return;
144
+ let t = x(_);
145
+ return t ||= S(_, E()), {
146
+ context: t,
147
+ source: "development"
148
+ };
149
+ }
150
+ function O(e) {
78
151
  let [t, n] = r(e.locale), [i, o] = r(!1), s = new Set([e.locale]), [c, l] = r(new Set(s)), u = { ...e.messages }, d = e, f = d.lazyLocaleLoading ?? e.splitting ?? !1, p = {
79
152
  locale: e.locale,
80
153
  messages: e.messages ?? {},
81
154
  dateFormats: {
82
- ...y,
155
+ ...w,
83
156
  ...d.dateFormats
84
157
  },
85
158
  numberFormats: {
86
- ...b,
159
+ ...T,
87
160
  ...d.numberFormats
88
161
  }
89
162
  };
@@ -93,17 +166,17 @@ function x(e) {
93
166
  let r = t();
94
167
  return m.locale !== r && (m.locale = r), Array.isArray(e) && "raw" in e ? m.t(e, ...n) : m.t(e, n[0]);
95
168
  }
96
- let v = (e, t) => {
169
+ let g = (e, t) => {
97
170
  m.loadMessages(e, t), u[e] = {
98
171
  ...u[e],
99
172
  ...t
100
173
  }, s.add(e), l(new Set(s));
101
- }, x = 0, S = async (e) => {
174
+ }, _ = 0, b = async (e) => {
102
175
  if (!f || !d.chunkLoader) {
103
176
  n(e);
104
177
  return;
105
178
  }
106
- let t = g();
179
+ let t = v();
107
180
  if (s.has(e)) {
108
181
  try {
109
182
  t?.__switchLocale && await t.__switchLocale(e);
@@ -113,30 +186,30 @@ function x(e) {
113
186
  n(e);
114
187
  return;
115
188
  }
116
- let r = ++x;
189
+ let r = ++_;
117
190
  o(!0);
118
191
  try {
119
- let i = _(await d.chunkLoader(e));
192
+ let i = y(await d.chunkLoader(e));
120
193
  if (m.loadMessages(e, i), u[e] = {
121
194
  ...u[e],
122
195
  ...i
123
- }, s.add(e), l(new Set(s)), r !== x) return;
196
+ }, s.add(e), l(new Set(s)), r !== _) return;
124
197
  try {
125
198
  t?.__switchLocale && await t.__switchLocale(e);
126
199
  } catch (t) {
127
200
  console.warn(`[fluenti] split runtime switch failed for locale "${e}"`, t);
128
201
  }
129
- if (r !== x) return;
202
+ if (r !== _) return;
130
203
  n(e);
131
204
  } finally {
132
- r === x && o(!1);
205
+ r === _ && o(!1);
133
206
  }
134
- }, C = /* @__PURE__ */ new Set();
207
+ }, x = /* @__PURE__ */ new Set();
135
208
  return {
136
209
  locale: t,
137
- setLocale: S,
210
+ setLocale: b,
138
211
  t: h,
139
- loadMessages: v,
212
+ loadMessages: g,
140
213
  getLocales: () => m.getLocales(),
141
214
  d: (e, n) => {
142
215
  let r = t();
@@ -153,11 +226,11 @@ function x(e) {
153
226
  isLoading: i,
154
227
  loadedLocales: c,
155
228
  preloadLocale: (e) => {
156
- if (!f || s.has(e) || !d.chunkLoader || C.has(e)) return;
157
- C.add(e);
158
- let t = g();
229
+ if (!f || s.has(e) || !d.chunkLoader || x.has(e)) return;
230
+ x.add(e);
231
+ let t = v();
159
232
  d.chunkLoader(e).then(async (n) => {
160
- let r = _(n);
233
+ let r = y(n);
161
234
  m.loadMessages(e, r), u[e] = {
162
235
  ...u[e],
163
236
  ...r
@@ -165,7 +238,7 @@ function x(e) {
165
238
  }).catch((t) => {
166
239
  console.warn("[fluenti] preload failed:", e, t);
167
240
  }).finally(() => {
168
- C.delete(e);
241
+ x.delete(e);
169
242
  });
170
243
  },
171
244
  te: (e, n) => {
@@ -178,9 +251,14 @@ function x(e) {
178
251
  }
179
252
  };
180
253
  }
181
- var S = x, C = t(), w = (e) => {
182
- let t = x(e);
183
- return s(C.Provider, {
254
+ function k(e) {
255
+ return S(g, O(e));
256
+ }
257
+ //#endregion
258
+ //#region src/provider.tsx
259
+ var A = t(), j = (e) => {
260
+ let t = O(e);
261
+ return s(A.Provider, {
184
262
  value: t,
185
263
  get children() {
186
264
  return e.children;
@@ -189,26 +267,28 @@ var S = x, C = t(), w = (e) => {
189
267
  };
190
268
  //#endregion
191
269
  //#region src/use-i18n.ts
192
- function T() {
193
- let e = i(C);
270
+ function M() {
271
+ let e = i(A);
194
272
  if (e) return e;
273
+ let t = D();
274
+ if (t) return t.context;
195
275
  throw Error("useI18n() must be used inside an <I18nProvider>.");
196
276
  }
197
- function E() {
198
- return T().locale;
277
+ function N() {
278
+ return M().locale;
199
279
  }
200
280
  //#endregion
201
281
  //#region src/rich-dom.tsx
202
- function D(e) {
282
+ function P(e) {
203
283
  return typeof Node < "u" && e instanceof Node;
204
284
  }
205
- function O(e) {
285
+ function F(e) {
206
286
  return typeof e == "function" && !e.length ? e() : e;
207
287
  }
208
- function k(e) {
288
+ function I(e) {
209
289
  let t = [], n = "";
210
290
  function r(e) {
211
- let i = O(e);
291
+ let i = F(e);
212
292
  if (i == null || typeof i == "boolean") return;
213
293
  if (Array.isArray(i)) {
214
294
  for (let e of i) r(e);
@@ -218,7 +298,7 @@ function k(e) {
218
298
  n += String(i);
219
299
  return;
220
300
  }
221
- if (!D(i)) return;
301
+ if (!P(i)) return;
222
302
  if (i.nodeType === Node.TEXT_NODE) {
223
303
  n += i.textContent ?? "";
224
304
  return;
@@ -227,7 +307,7 @@ function k(e) {
227
307
  r(Array.from(i.childNodes));
228
308
  return;
229
309
  }
230
- let a = t.length, o = k(Array.from(i.childNodes));
310
+ let a = t.length, o = I(Array.from(i.childNodes));
231
311
  t.push(i.cloneNode(!1)), t.push(...o.components), o.message === "" && o.components.length === 0 ? n += `<${a}/>` : n += `<${a}>${m(o.message, a + 1)}</${a}>`;
232
312
  }
233
313
  return r(e), {
@@ -235,21 +315,21 @@ function k(e) {
235
315
  components: t
236
316
  };
237
317
  }
238
- function A(e, t) {
239
- let n = O(t);
318
+ function L(e, t) {
319
+ let n = F(t);
240
320
  if (!(n == null || typeof n == "boolean")) {
241
321
  if (Array.isArray(n)) {
242
- for (let t of n) A(e, t);
322
+ for (let t of n) L(e, t);
243
323
  return;
244
324
  }
245
325
  if (typeof n == "string" || typeof n == "number") {
246
326
  e.appendChild(document.createTextNode(String(n)));
247
327
  return;
248
328
  }
249
- D(n) && e.appendChild(n);
329
+ P(n) && e.appendChild(n);
250
330
  }
251
331
  }
252
- function j(e, t) {
332
+ function R(e, t) {
253
333
  let n = /<(\d+)(?:\/>|(>)([\s\S]*?)<\/\1>)/g, r = [], i = 0, a;
254
334
  for (n.lastIndex = 0, a = n.exec(e); a !== null;) {
255
335
  a.index > i && r.push(e.slice(i, a.index));
@@ -261,27 +341,27 @@ function j(e, t) {
261
341
  let c = t[o];
262
342
  if (s) c && r.push(c.cloneNode(!1));
263
343
  else {
264
- let e = j(a[2] === void 0 ? "" : a[3], t);
344
+ let e = R(a[2] === void 0 ? "" : a[3], t);
265
345
  if (c) {
266
346
  let t = c.cloneNode(!1);
267
- A(t, e), r.push(t);
347
+ L(t, e), r.push(t);
268
348
  } else r.push(a[3] ?? "");
269
349
  }
270
350
  i = n.lastIndex, a = n.exec(e);
271
351
  }
272
352
  return i < e.length && r.push(e.slice(i)), r.length <= 1 ? r[0] ?? "" : r;
273
353
  }
274
- function M(e, t) {
354
+ function z(e, t) {
275
355
  let n = {}, r = [];
276
356
  for (let i of e) {
277
357
  let e = t[i];
278
358
  if (e === void 0) continue;
279
- let a = k(e);
359
+ let a = I(e);
280
360
  n[i] = m(a.message, r.length), r.push(...a.components);
281
361
  }
282
362
  for (let [i, a] of Object.entries(t)) {
283
363
  if (e.includes(i) || a === void 0) continue;
284
- let t = k(a);
364
+ let t = I(a);
285
365
  n[i] = m(t.message, r.length), r.push(...t.components);
286
366
  }
287
367
  return {
@@ -291,9 +371,9 @@ function M(e, t) {
291
371
  }
292
372
  //#endregion
293
373
  //#region src/trans.tsx
294
- var N = 100;
295
- function P(e, t = 0) {
296
- if (t > N) return [{
374
+ var B = 100;
375
+ function V(e, t = 0) {
376
+ if (t > B) return [{
297
377
  type: "text",
298
378
  value: e
299
379
  }];
@@ -328,7 +408,7 @@ function P(e, t = 0) {
328
408
  }), r = i + 1;
329
409
  continue;
330
410
  }
331
- let s = o[1], c = i + o[0].length, l = F(e, s, c);
411
+ let s = o[1], c = i + o[0].length, l = H(e, s, c);
332
412
  if (l === -1) {
333
413
  n.push({
334
414
  type: "text",
@@ -340,12 +420,12 @@ function P(e, t = 0) {
340
420
  n.push({
341
421
  type: "tag",
342
422
  name: s,
343
- children: P(u, t + 1)
423
+ children: V(u, t + 1)
344
424
  }), r = l + d.length;
345
425
  }
346
426
  return n;
347
427
  }
348
- function F(e, t, n) {
428
+ function H(e, t, n) {
349
429
  let r = `<${t}>`, i = `</${t}>`, a = 1, o = n;
350
430
  for (; o < e.length && a > 0;) {
351
431
  let t = e.indexOf(r, o), n = e.indexOf(i, o);
@@ -358,25 +438,25 @@ function F(e, t, n) {
358
438
  }
359
439
  return -1;
360
440
  }
361
- function I(e, t) {
441
+ function U(e, t) {
362
442
  let n = e.map((e) => {
363
443
  if (e.type === "text") return e.value;
364
444
  let n = t[e.name];
365
445
  return n ? s(o, {
366
446
  component: n,
367
- children: e.children.length > 0 ? I(e.children, t) : void 0
368
- }) : I(e.children, t);
447
+ children: e.children.length > 0 ? U(e.children, t) : void 0
448
+ }) : U(e.children, t);
369
449
  });
370
450
  return n.length === 1 ? n[0] : n;
371
451
  }
372
- var L = (t) => {
373
- let { t: r } = T(), i = e(() => t.children), a = n(() => {
452
+ var W = (t) => {
453
+ let { t: r } = M(), i = e(() => t.children), a = n(() => {
374
454
  let e = t.__message ?? t.message;
375
455
  return typeof e == "function" ? e() : e;
376
456
  }), c = n(() => t.__components ?? t.components);
377
457
  return (() => {
378
458
  let e = a(), n = c();
379
- if (e !== void 0 && n) return I(P(r({
459
+ if (e !== void 0 && n) return U(V(r({
380
460
  ...t.id === void 0 ? {} : { id: t.id },
381
461
  message: e,
382
462
  ...t.context === void 0 ? {} : { context: t.context },
@@ -384,12 +464,12 @@ var L = (t) => {
384
464
  })), n);
385
465
  let l = i.toArray();
386
466
  if (l.length === 0) return null;
387
- let u = k(l), d = r({
467
+ let u = I(l), d = r({
388
468
  ...t.id === void 0 ? {} : { id: t.id },
389
469
  message: u.message,
390
470
  ...t.context === void 0 ? {} : { context: t.context },
391
471
  ...t.comment === void 0 ? {} : { comment: t.comment }
392
- }), f = u.components.length > 0 ? j(d, u.components) : d;
472
+ }), f = u.components.length > 0 ? R(d, u.components) : d;
393
473
  return Array.isArray(f) && f.length > 1 && t.tag ? s(o, {
394
474
  get component() {
395
475
  return t.tag;
@@ -400,32 +480,32 @@ var L = (t) => {
400
480
  };
401
481
  //#endregion
402
482
  //#region src/plain-runtime.ts
403
- function R(e) {
483
+ function G(e) {
404
484
  return typeof e == "function" && !e.length ? e() : e;
405
485
  }
406
- function z(e, t, n) {
486
+ function K(e, t, n) {
407
487
  return e ?? (n === void 0 ? t : f(t, n));
408
488
  }
409
- function B(e) {
489
+ function q(e) {
410
490
  return typeof e == "string" || typeof e == "number";
411
491
  }
412
- function V(e, t) {
492
+ function J(e, t) {
413
493
  let n = {};
414
494
  for (let t of l) {
415
- let r = R(e[t]);
495
+ let r = G(e[t]);
416
496
  if (r !== void 0) {
417
- if (!B(r)) return;
497
+ if (!q(r)) return;
418
498
  n[t] = String(r);
419
499
  }
420
500
  }
421
501
  if (n.other !== void 0) return u(n, t);
422
502
  }
423
- function H(e) {
503
+ function Y(e) {
424
504
  let t = {};
425
505
  for (let [n, r] of Object.entries(e)) {
426
- let e = R(r);
506
+ let e = G(r);
427
507
  if (e !== void 0) {
428
- if (!B(e)) return;
508
+ if (!q(e)) return;
429
509
  t[n] = String(e);
430
510
  }
431
511
  }
@@ -438,18 +518,18 @@ function H(e) {
438
518
  }
439
519
  //#endregion
440
520
  //#region src/plural.tsx
441
- var U = (e) => {
442
- let { t } = T();
521
+ var X = (e) => {
522
+ let { t } = M();
443
523
  return (() => {
444
524
  let n = {};
445
525
  for (let t of l) {
446
- let r = R(e[t]);
526
+ let r = G(e[t]);
447
527
  r !== void 0 && (n[t] = r);
448
528
  }
449
- let r = V(n, e.offset);
529
+ let r = J(n, e.offset);
450
530
  if (r !== void 0) {
451
531
  let n = t({
452
- id: z(e.id, r, e.context),
532
+ id: K(e.id, r, e.context),
453
533
  message: r,
454
534
  ...e.context === void 0 ? {} : { context: e.context },
455
535
  ...e.comment === void 0 ? {} : { comment: e.comment }
@@ -461,7 +541,7 @@ var U = (e) => {
461
541
  children: n
462
542
  }) : n;
463
543
  }
464
- let { messages: i, components: a } = M(l, n), c = u({
544
+ let { messages: i, components: a } = z(l, n), c = u({
465
545
  ...i.zero !== void 0 && { zero: i.zero },
466
546
  ...i.one !== void 0 && { one: i.one },
467
547
  ...i.two !== void 0 && { two: i.two },
@@ -469,11 +549,11 @@ var U = (e) => {
469
549
  ...i.many !== void 0 && { many: i.many },
470
550
  other: i.other ?? ""
471
551
  }, e.offset), d = t({
472
- id: z(e.id, c, e.context),
552
+ id: K(e.id, c, e.context),
473
553
  message: c,
474
554
  ...e.context === void 0 ? {} : { context: e.context },
475
555
  ...e.comment === void 0 ? {} : { comment: e.comment }
476
- }, { count: e.value }), f = a.length > 0 ? j(d, a) : d;
556
+ }, { count: e.value }), f = a.length > 0 ? R(d, a) : d;
477
557
  return e.tag ? s(o, {
478
558
  get component() {
479
559
  return e.tag;
@@ -481,8 +561,8 @@ var U = (e) => {
481
561
  children: f
482
562
  }) : f;
483
563
  });
484
- }, W = (e) => {
485
- let { t } = T(), n = () => {
564
+ }, Z = (e) => {
565
+ let { t } = M(), n = () => {
486
566
  let n = new Set([
487
567
  "value",
488
568
  "id",
@@ -507,20 +587,20 @@ var U = (e) => {
507
587
  } : {
508
588
  ...e.options,
509
589
  other: e.other
510
- }, i = H(r);
590
+ }, i = Y(r);
511
591
  if (i !== void 0) return t({
512
- id: z(e.id, i.message, e.context),
592
+ id: K(e.id, i.message, e.context),
513
593
  message: i.message,
514
594
  ...e.context === void 0 ? {} : { context: e.context },
515
595
  ...e.comment === void 0 ? {} : { comment: e.comment }
516
596
  }, { value: i.valueMap[e.value] ?? "other" });
517
- let a = [...Object.keys(r).filter((e) => e !== "other"), "other"], { messages: o, components: s } = M(a, r), c = p(Object.fromEntries([...a].map((e) => [e, o[e] ?? ""]))), l = t({
518
- id: z(e.id, d(c.forms), e.context),
597
+ let a = [...Object.keys(r).filter((e) => e !== "other"), "other"], { messages: o, components: s } = z(a, r), c = p(Object.fromEntries([...a].map((e) => [e, o[e] ?? ""]))), l = t({
598
+ id: K(e.id, d(c.forms), e.context),
519
599
  message: d(c.forms),
520
600
  ...e.context === void 0 ? {} : { context: e.context },
521
601
  ...e.comment === void 0 ? {} : { comment: e.comment }
522
602
  }, { value: c.valueMap[e.value] ?? "other" });
523
- return s.length > 0 ? j(l, s) : l;
603
+ return s.length > 0 ? R(l, s) : l;
524
604
  };
525
605
  return (() => e.tag ? s(o, {
526
606
  get component() {
@@ -533,27 +613,27 @@ var U = (e) => {
533
613
  };
534
614
  //#endregion
535
615
  //#region src/components/DateTime.tsx
536
- function G(e) {
537
- let { d: t } = T();
616
+ function Q(e) {
617
+ let { d: t } = M();
538
618
  return c(() => t(e.value, e.format));
539
619
  }
540
620
  //#endregion
541
621
  //#region src/components/NumberFormat.tsx
542
- function K(e) {
543
- let { n: t } = T();
622
+ function $(e) {
623
+ let { n: t } = M();
544
624
  return c(() => t(e.value, e.format));
545
625
  }
546
626
  //#endregion
547
627
  //#region src/compiled.tsx
548
- var q = (e) => {
549
- let { t } = T();
628
+ var ee = (e) => {
629
+ let { t } = M();
550
630
  return (() => {
551
631
  let n = t({
552
632
  id: e.id ?? f(e.message, e.context),
553
633
  message: e.message,
554
634
  ...e.context === void 0 ? {} : { context: e.context },
555
635
  ...e.comment === void 0 ? {} : { comment: e.comment }
556
- }), r = e.components && e.components.length > 0 ? j(n, e.components) : n;
636
+ }), r = e.components && e.components.length > 0 ? R(n, e.components) : n;
557
637
  return e.tag ? s(o, {
558
638
  get component() {
559
639
  return e.tag;
@@ -561,11 +641,11 @@ var q = (e) => {
561
641
  children: r
562
642
  }) : r;
563
643
  });
564
- }, J = (e) => {
565
- let { t } = T();
644
+ }, te = (e) => {
645
+ let { t } = M();
566
646
  return (() => {
567
647
  let n = t({
568
- id: z(e.id, e.message, e.context),
648
+ id: K(e.id, e.message, e.context),
569
649
  message: e.message,
570
650
  ...e.context === void 0 ? {} : { context: e.context },
571
651
  ...e.comment === void 0 ? {} : { comment: e.comment }
@@ -577,11 +657,11 @@ var q = (e) => {
577
657
  children: n
578
658
  }) : n;
579
659
  });
580
- }, Y = (e) => {
581
- let { t } = T();
660
+ }, ne = (e) => {
661
+ let { t } = M();
582
662
  return (() => {
583
663
  let n = t({
584
- id: z(e.id, e.message, e.context),
664
+ id: K(e.id, e.message, e.context),
585
665
  message: e.message,
586
666
  ...e.context === void 0 ? {} : { context: e.context },
587
667
  ...e.comment === void 0 ? {} : { comment: e.comment }
@@ -593,15 +673,15 @@ var q = (e) => {
593
673
  children: n
594
674
  }) : n;
595
675
  });
596
- }, X = (e) => {
597
- let { t } = T();
676
+ }, re = (e) => {
677
+ let { t } = M();
598
678
  return (() => {
599
679
  let n = t({
600
- id: z(e.id, e.message, e.context),
680
+ id: K(e.id, e.message, e.context),
601
681
  message: e.message,
602
682
  ...e.context === void 0 ? {} : { context: e.context },
603
683
  ...e.comment === void 0 ? {} : { comment: e.comment }
604
- }, { count: e.value }), r = e.components.length > 0 ? j(n, e.components) : n;
684
+ }, { count: e.value }), r = e.components.length > 0 ? R(n, e.components) : n;
605
685
  return e.tag ? s(o, {
606
686
  get component() {
607
687
  return e.tag;
@@ -609,15 +689,15 @@ var q = (e) => {
609
689
  children: r
610
690
  }) : r;
611
691
  });
612
- }, Z = (e) => {
613
- let { t } = T();
692
+ }, ie = (e) => {
693
+ let { t } = M();
614
694
  return (() => {
615
695
  let n = t({
616
- id: z(e.id, e.message, e.context),
696
+ id: K(e.id, e.message, e.context),
617
697
  message: e.message,
618
698
  ...e.context === void 0 ? {} : { context: e.context },
619
699
  ...e.comment === void 0 ? {} : { comment: e.comment }
620
- }, { value: e.valueMap?.[e.value] ?? "other" }), r = e.components.length > 0 ? j(n, e.components) : n;
700
+ }, { value: e.valueMap?.[e.value] ?? "other" }), r = e.components.length > 0 ? R(n, e.components) : n;
621
701
  return e.tag ? s(o, {
622
702
  get component() {
623
703
  return e.tag;
@@ -627,6 +707,4 @@ var q = (e) => {
627
707
  });
628
708
  };
629
709
  //#endregion
630
- export { q as a, W as c, T as d, E as f, Y as i, U as l, S as m, X as n, K as o, w as p, Z as r, G as s, J as t, L as u };
631
-
632
- //# sourceMappingURL=components-entry-C-Df62O-.js.map
710
+ export { ee as a, Z as c, M as d, N as f, ne as i, X as l, k as m, re as n, $ as o, j as p, ie as r, Q as s, te as t, W as u };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./components-entry-5CGlUlc5.cjs`);exports.DateTime=e.s,exports.NumberFormat=e.o,exports.Plural=e.l,exports.Select=e.c,exports.Trans=e.u,exports.__FluentiCompiledPlural=e.t,exports.__FluentiCompiledRichPlural=e.n,exports.__FluentiCompiledRichSelect=e.r,exports.__FluentiCompiledSelect=e.i,exports.__FluentiCompiledTrans=e.a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./components-entry-Bdm3s2x9.cjs`);exports.DateTime=e.s,exports.NumberFormat=e.o,exports.Plural=e.l,exports.Select=e.c,exports.Trans=e.u,exports.__FluentiCompiledPlural=e.t,exports.__FluentiCompiledRichPlural=e.n,exports.__FluentiCompiledRichSelect=e.r,exports.__FluentiCompiledSelect=e.i,exports.__FluentiCompiledTrans=e.a;
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "./components-entry-C-Df62O-.js";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "./components-entry-Dfzg6Idb.js";
2
2
  export { s as DateTime, a as NumberFormat, r as Plural, t as Select, l as Trans, c as __FluentiCompiledPlural, i as __FluentiCompiledRichPlural, o as __FluentiCompiledRichSelect, n as __FluentiCompiledSelect, e as __FluentiCompiledTrans };
package/dist/index.cjs CHANGED
@@ -1,2 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./components-entry-5CGlUlc5.cjs`);let t=require(`@fluenti/core`);var n=((...e)=>{throw Error("[fluenti] `t` imported from '@fluenti/solid' is a compile-time API. Use it only with the Fluenti build transform inside a component or custom hook. For runtime lookups, use useI18n().t(...).")});exports.DateTime=e.s,exports.I18nProvider=e.p,exports.NumberFormat=e.o,exports.Plural=e.l,exports.Select=e.c,exports.Trans=e.u,exports.createFluenti=e.m,Object.defineProperty(exports,`msg`,{enumerable:!0,get:function(){return t.msg}}),exports.t=n,exports.useI18n=e.d,exports.useLocale=e.f;
2
- //# sourceMappingURL=index.cjs.map
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./components-entry-Bdm3s2x9.cjs`);let t=require(`@fluenti/core`);var n=((...e)=>{throw Error("[fluenti] `t` imported from '@fluenti/solid' is a compile-time API. Use it only with the Fluenti build transform inside a component or custom hook. For runtime lookups, use useI18n().t(...).")});exports.DateTime=e.s,exports.I18nProvider=e.p,exports.NumberFormat=e.o,exports.Plural=e.l,exports.Select=e.c,exports.Trans=e.u,exports.createFluenti=e.m,Object.defineProperty(exports,`msg`,{enumerable:!0,get:function(){return t.msg}}),exports.t=n,exports.useI18n=e.d,exports.useLocale=e.f;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as e, d as t, f as n, l as r, m as i, o as a, p as o, s, u as c } from "./components-entry-C-Df62O-.js";
1
+ import { c as e, d as t, f as n, l as r, m as i, o as a, p as o, s, u as c } from "./components-entry-Dfzg6Idb.js";
2
2
  import { msg as l } from "@fluenti/core";
3
3
  //#region src/compile-time-t.ts
4
4
  var u = ((...e) => {
@@ -6,5 +6,3 @@ var u = ((...e) => {
6
6
  });
7
7
  //#endregion
8
8
  export { s as DateTime, o as I18nProvider, a as NumberFormat, r as Plural, e as Select, c as Trans, i as createFluenti, l as msg, u as t, t as useI18n, n as useLocale };
9
-
10
- //# sourceMappingURL=index.js.map