solid-intlayer 8.3.1 → 8.3.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 (107) hide show
  1. package/dist/chunk-C91j1N6u.js +1 -0
  2. package/dist/cjs/IntlayerNode.cjs +1 -1
  3. package/dist/cjs/UI/ContentSelector.cjs +1 -1
  4. package/dist/cjs/client/IntlayerProvider.cjs +1 -1
  5. package/dist/cjs/client/format/useIntl.cjs +1 -1
  6. package/dist/cjs/client/getBrowserLocale.cjs +1 -1
  7. package/dist/cjs/client/index.cjs +1 -1
  8. package/dist/cjs/client/t.cjs +1 -1
  9. package/dist/cjs/client/useContent.cjs +1 -1
  10. package/dist/cjs/client/useDictionary.cjs +1 -1
  11. package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
  12. package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
  13. package/dist/cjs/client/useIntlayer.cjs +1 -1
  14. package/dist/cjs/client/useLoadDynamic.cjs +1 -1
  15. package/dist/cjs/client/useLocale.cjs +1 -1
  16. package/dist/cjs/client/useLocaleBase.cjs +1 -1
  17. package/dist/cjs/client/useLocaleStorage.cjs +1 -1
  18. package/dist/cjs/client/useRewriteURL.cjs +1 -1
  19. package/dist/cjs/client/useTraduction.cjs +1 -1
  20. package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -1
  21. package/dist/cjs/editor/IntlayerEditorProvider.cjs +1 -1
  22. package/dist/cjs/editor/contexts/CommunicatorContext.cjs +1 -1
  23. package/dist/cjs/editor/contexts/ConfigurationContext.cjs +1 -1
  24. package/dist/cjs/editor/contexts/DictionariesRecordContext.cjs +1 -1
  25. package/dist/cjs/editor/contexts/EditedContentContext.cjs +1 -1
  26. package/dist/cjs/editor/contexts/EditorEnabledContext.cjs +1 -1
  27. package/dist/cjs/editor/contexts/EditorProvider.cjs +1 -1
  28. package/dist/cjs/editor/contexts/FocusDictionaryContext.cjs +1 -1
  29. package/dist/cjs/editor/contexts/index.cjs +1 -1
  30. package/dist/cjs/editor/contexts/useCrossFrameMessageListener.cjs +1 -1
  31. package/dist/cjs/editor/contexts/useCrossFrameState.cjs +1 -1
  32. package/dist/cjs/editor/contexts/useCrossURLPathState.cjs +1 -1
  33. package/dist/cjs/editor/contexts/useIframeClickInterceptor.cjs +1 -1
  34. package/dist/cjs/editor/index.cjs +1 -1
  35. package/dist/cjs/editor/useEditedContentRenderer.cjs +1 -1
  36. package/dist/cjs/getDictionary.cjs +1 -1
  37. package/dist/cjs/getIntlayer.cjs +1 -1
  38. package/dist/cjs/html/HTMLProvider.cjs +1 -1
  39. package/dist/cjs/html/HTMLRenderer.cjs +1 -1
  40. package/dist/cjs/html/index.cjs +1 -1
  41. package/dist/cjs/html/types.cjs +1 -1
  42. package/dist/cjs/index.cjs +1 -1
  43. package/dist/cjs/markdown/MarkdownProvider.cjs +1 -1
  44. package/dist/cjs/markdown/MarkdownRenderer.cjs +1 -1
  45. package/dist/cjs/markdown/compiler.cjs +1 -1
  46. package/dist/cjs/markdown/index.cjs +1 -1
  47. package/dist/cjs/markdown/runtime.cjs +1 -1
  48. package/dist/cjs/plugins.cjs +1 -1
  49. package/dist/cjs/solidElement/renderSolidElement.cjs +1 -1
  50. package/dist/esm/IntlayerNode.mjs +9 -17
  51. package/dist/esm/UI/ContentSelector.mjs +57 -56
  52. package/dist/esm/client/IntlayerProvider.mjs +56 -66
  53. package/dist/esm/client/format/useIntl.mjs +8 -11
  54. package/dist/esm/client/getBrowserLocale.mjs +79 -95
  55. package/dist/esm/client/index.mjs +11 -36
  56. package/dist/esm/client/t.mjs +9 -9
  57. package/dist/esm/client/useContent.mjs +12 -12
  58. package/dist/esm/client/useDictionary.mjs +2 -13
  59. package/dist/esm/client/useDictionaryAsync.mjs +2 -11
  60. package/dist/esm/client/useDictionaryDynamic.mjs +2 -15
  61. package/dist/esm/client/useIntlayer.mjs +2 -13
  62. package/dist/esm/client/useLoadDynamic.mjs +15 -21
  63. package/dist/esm/client/useLocale.mjs +23 -36
  64. package/dist/esm/client/useLocaleBase.mjs +14 -18
  65. package/dist/esm/client/useLocaleStorage.mjs +18 -25
  66. package/dist/esm/client/useRewriteURL.mjs +14 -18
  67. package/dist/esm/client/useTraduction.mjs +9 -12
  68. package/dist/esm/editor/ContentSelectorWrapper.mjs +2 -24
  69. package/dist/esm/editor/IntlayerEditorProvider.mjs +36 -58
  70. package/dist/esm/editor/contexts/CommunicatorContext.mjs +29 -28
  71. package/dist/esm/editor/contexts/ConfigurationContext.mjs +18 -20
  72. package/dist/esm/editor/contexts/DictionariesRecordContext.mjs +39 -44
  73. package/dist/esm/editor/contexts/EditedContentContext.mjs +135 -154
  74. package/dist/esm/editor/contexts/EditorEnabledContext.mjs +19 -27
  75. package/dist/esm/editor/contexts/EditorProvider.mjs +68 -80
  76. package/dist/esm/editor/contexts/FocusDictionaryContext.mjs +41 -47
  77. package/dist/esm/editor/contexts/index.mjs +11 -38
  78. package/dist/esm/editor/contexts/useCrossFrameMessageListener.mjs +30 -34
  79. package/dist/esm/editor/contexts/useCrossFrameState.mjs +44 -56
  80. package/dist/esm/editor/contexts/useCrossURLPathState.mjs +23 -24
  81. package/dist/esm/editor/contexts/useIframeClickInterceptor.mjs +17 -18
  82. package/dist/esm/editor/index.mjs +2 -4
  83. package/dist/esm/editor/useEditedContentRenderer.mjs +15 -28
  84. package/dist/esm/getDictionary.mjs +2 -16
  85. package/dist/esm/getIntlayer.mjs +2 -16
  86. package/dist/esm/html/HTMLProvider.mjs +12 -15
  87. package/dist/esm/html/HTMLRenderer.mjs +28 -51
  88. package/dist/esm/html/index.mjs +3 -10
  89. package/dist/esm/html/types.mjs +0 -1
  90. package/dist/esm/index.mjs +17 -54
  91. package/dist/esm/markdown/MarkdownProvider.mjs +33 -41
  92. package/dist/esm/markdown/MarkdownRenderer.mjs +36 -41
  93. package/dist/esm/markdown/compiler.mjs +6 -8
  94. package/dist/esm/markdown/index.mjs +5 -17
  95. package/dist/esm/markdown/runtime.mjs +21 -40
  96. package/dist/esm/plugins.mjs +2 -20
  97. package/dist/esm/solidElement/renderSolidElement.mjs +32 -29
  98. package/dist/getDictionary-DKdSGWHu.mjs +188 -0
  99. package/dist/getDictionary-DxYuk0_0.js +1 -0
  100. package/dist/types/IntlayerNode.d.ts +1 -2
  101. package/dist/types/client/useDictionary.d.ts +1 -1
  102. package/dist/types/getDictionary.d.ts +1 -2
  103. package/dist/types/getIntlayer.d.ts +1 -2
  104. package/dist/types/plugins.d.ts +15 -10
  105. package/package.json +11 -11
  106. package/dist/plugins-FXnYVZH5.mjs +0 -229
  107. package/dist/plugins-lDhO98Wy.js +0 -1
@@ -1,57 +1,58 @@
1
- import { delegateEvents as p, spread as T, mergeProps as k, insert as L, template as y, use as C } from "solid-js/web";
2
- import { createSignal as m, createEffect as P, onCleanup as w } from "solid-js";
3
- var D = /* @__PURE__ */ y("<span role=button tabindex=0>");
4
- const O = 250, x = (t) => {
5
- let n;
6
- const [f, l] = m(!1), [a, r] = m(t.isSelecting);
7
- let s = null;
8
- const h = typeof t.children == "string", v = () => {
9
- r(!0), t.onPress();
10
- }, $ = () => {
11
- s = setTimeout(() => {
12
- v();
13
- }, t.pressDuration ?? O);
14
- }, i = () => {
15
- s && (clearTimeout(s), s = null);
16
- }, u = () => {
17
- i(), $();
18
- }, g = () => {
19
- l(!0), t.onHover?.();
20
- }, o = () => {
21
- l(!1), i();
22
- }, c = (e) => {
23
- n && !n.contains(e.target) && (r(!1), t.onClickOutside?.());
24
- };
25
- P(() => {
26
- document.addEventListener("mousedown", c), w(() => {
27
- document.removeEventListener("mousedown", c), i();
28
- });
29
- });
30
- const E = (e) => {
31
- a() && (e.preventDefault(), e.stopPropagation());
32
- }, S = () => {
33
- r(!1);
34
- };
35
- return (() => {
36
- var e = D(), d = n;
37
- return typeof d == "function" ? C(d, e) : n = e, e.addEventListener("mouseenter", g), e.addEventListener("blur", S), e.addEventListener("touchcancel", o), e.$$touchend = o, e.$$touchstart = u, e.addEventListener("mouseleave", o), e.$$mouseup = o, e.$$mousedown = u, e.$$click = E, e.$$keyup = () => null, T(e, k({
38
- get style() {
39
- return {
40
- display: h ? "inline" : "inline-block",
41
- cursor: "pointer",
42
- "user-select": "none",
43
- "border-radius": "0.375rem",
44
- "outline-width": "2px",
45
- "outline-offset": "4px",
46
- "outline-style": "solid",
47
- "outline-color": t.isSelecting || a() || f() ? "inherit" : "transparent",
48
- transition: "all 100ms 50ms ease-in-out"
49
- };
50
- }
51
- }, t), !1, !0), L(e, () => t.children), e;
52
- })();
53
- };
54
- p(["keyup", "click", "mousedown", "mouseup", "touchstart", "touchend"]);
55
- export {
56
- x as ContentSelector
1
+ import { delegateEvents as e, insert as t, mergeProps as n, spread as r, template as i, use as a } from "solid-js/web";
2
+ import { createEffect as o, createSignal as s, onCleanup as c } from "solid-js";
3
+ //#region src/UI/ContentSelector.tsx
4
+ var l = /* @__PURE__ */ i("<span role=button tabindex=0>"), u = 250, d = (e) => {
5
+ let i, [d, f] = s(!1), [p, m] = s(e.isSelecting), h = null, g = typeof e.children == "string", _ = () => {
6
+ m(!0), e.onPress();
7
+ }, v = () => {
8
+ h = setTimeout(() => {
9
+ _();
10
+ }, e.pressDuration ?? u);
11
+ }, y = () => {
12
+ h &&= (clearTimeout(h), null);
13
+ }, b = () => {
14
+ y(), v();
15
+ }, x = () => {
16
+ f(!0), e.onHover?.();
17
+ }, S = () => {
18
+ f(!1), y();
19
+ }, C = (t) => {
20
+ i && !i.contains(t.target) && (m(!1), e.onClickOutside?.());
21
+ };
22
+ o(() => {
23
+ document.addEventListener("mousedown", C), c(() => {
24
+ document.removeEventListener("mousedown", C), y();
25
+ });
26
+ });
27
+ let w = (e) => {
28
+ p() && (e.preventDefault(), e.stopPropagation());
29
+ }, T = () => {
30
+ m(!1);
31
+ };
32
+ return (() => {
33
+ var o = l(), s = i;
34
+ return typeof s == "function" ? a(s, o) : i = o, o.addEventListener("mouseenter", x), o.addEventListener("blur", T), o.addEventListener("touchcancel", S), o.$$touchend = S, o.$$touchstart = b, o.addEventListener("mouseleave", S), o.$$mouseup = S, o.$$mousedown = b, o.$$click = w, o.$$keyup = () => null, r(o, n({ get style() {
35
+ return {
36
+ display: g ? "inline" : "inline-block",
37
+ cursor: "pointer",
38
+ "user-select": "none",
39
+ "border-radius": "0.375rem",
40
+ "outline-width": "2px",
41
+ "outline-offset": "4px",
42
+ "outline-style": "solid",
43
+ "outline-color": e.isSelecting || p() || d() ? "inherit" : "transparent",
44
+ transition: "all 100ms 50ms ease-in-out"
45
+ };
46
+ } }, e), !1, !0), t(o, () => e.children), o;
47
+ })();
57
48
  };
49
+ e([
50
+ "keyup",
51
+ "click",
52
+ "mousedown",
53
+ "mouseup",
54
+ "touchstart",
55
+ "touchend"
56
+ ]);
57
+ //#endregion
58
+ export { d as ContentSelector };
@@ -1,66 +1,56 @@
1
- import { createComponent as n } from "solid-js/web";
2
- import s from "@intlayer/config/built";
3
- import { localeResolver as v } from "@intlayer/core/localization";
4
- import { createContext as y, createSignal as I, createEffect as c, useContext as w } from "solid-js";
5
- import { IntlayerEditorProvider as b } from "../editor/IntlayerEditorProvider.mjs";
6
- import { localeCookie as d, setLocaleInStorage as A } from "./useLocaleStorage.mjs";
7
- const f = y({
8
- locale: () => d ?? s?.internationalization?.defaultLocale,
9
- setLocale: () => null,
10
- disableEditor: !1
11
- }), k = () => w(f), x = (t) => {
12
- const {
13
- internationalization: u
14
- } = s ?? {}, {
15
- defaultLocale: L,
16
- locales: a
17
- } = u ?? {}, m = t.locale ?? d ?? t.defaultLocale ?? L, [o, l] = I(m);
18
- c(() => {
19
- if (typeof window < "u") {
20
- const e = (r) => {
21
- if (r.data?.type === "INTLAYER_LOCALE_CHANGE") {
22
- const i = r.data.locale;
23
- a?.includes(i) && l(i);
24
- }
25
- };
26
- return window.addEventListener("message", e), () => window.removeEventListener("message", e);
27
- }
28
- }), c(() => {
29
- const e = o();
30
- typeof window < "u" && window.postMessage({
31
- type: "INTLAYER_LOCALE_CHANGE",
32
- locale: e
33
- }, "*");
34
- });
35
- const C = (e) => {
36
- if (o().toString() !== e.toString()) {
37
- if (!a?.map(String).includes(e)) {
38
- console.error(`Locale ${e} is not available`);
39
- return;
40
- }
41
- l(e), A(e, t.isCookieEnabled);
42
- }
43
- }, g = t.setLocale ?? C, E = () => v(t.locale ?? o());
44
- return n(f.Provider, {
45
- get value() {
46
- return {
47
- locale: E,
48
- setLocale: g,
49
- disableEditor: t.disableEditor
50
- };
51
- },
52
- get children() {
53
- return t.children;
54
- }
55
- });
56
- }, p = (t) => n(b, {
57
- get children() {
58
- return n(x, t);
59
- }
60
- });
61
- export {
62
- f as IntlayerClientContext,
63
- p as IntlayerProvider,
64
- x as IntlayerProviderContent,
65
- k as useIntlayerContext
66
- };
1
+ import { IntlayerEditorProvider as e } from "../editor/IntlayerEditorProvider.mjs";
2
+ import { localeCookie as t, setLocaleInStorage as n } from "./useLocaleStorage.mjs";
3
+ import { createComponent as r } from "solid-js/web";
4
+ import i from "@intlayer/config/built";
5
+ import { createContext as a, createEffect as o, createSignal as s, useContext as c } from "solid-js";
6
+ import { localeResolver as l } from "@intlayer/core/localization";
7
+ //#region src/client/IntlayerProvider.tsx
8
+ var u = a({
9
+ locale: () => t ?? i?.internationalization?.defaultLocale,
10
+ setLocale: () => null,
11
+ disableEditor: !1
12
+ }), d = () => c(u), f = (e) => {
13
+ let { internationalization: a } = i ?? {}, { defaultLocale: c, locales: d } = a ?? {}, [f, p] = s(e.locale ?? t ?? e.defaultLocale ?? c);
14
+ o(() => {
15
+ if (typeof window < "u") {
16
+ let e = (e) => {
17
+ if (e.data?.type === "INTLAYER_LOCALE_CHANGE") {
18
+ let t = e.data.locale;
19
+ d?.includes(t) && p(t);
20
+ }
21
+ };
22
+ return window.addEventListener("message", e), () => window.removeEventListener("message", e);
23
+ }
24
+ }), o(() => {
25
+ let e = f();
26
+ typeof window < "u" && window.postMessage({
27
+ type: "INTLAYER_LOCALE_CHANGE",
28
+ locale: e
29
+ }, "*");
30
+ });
31
+ let m = e.setLocale ?? ((t) => {
32
+ if (f().toString() !== t.toString()) {
33
+ if (!d?.map(String).includes(t)) {
34
+ console.error(`Locale ${t} is not available`);
35
+ return;
36
+ }
37
+ p(t), n(t, e.isCookieEnabled);
38
+ }
39
+ }), h = () => l(e.locale ?? f());
40
+ return r(u.Provider, {
41
+ get value() {
42
+ return {
43
+ locale: h,
44
+ setLocale: m,
45
+ disableEditor: e.disableEditor
46
+ };
47
+ },
48
+ get children() {
49
+ return e.children;
50
+ }
51
+ });
52
+ }, p = (t) => r(e, { get children() {
53
+ return r(f, t);
54
+ } });
55
+ //#endregion
56
+ export { u as IntlayerClientContext, p as IntlayerProvider, f as IntlayerProviderContent, d as useIntlayerContext };
@@ -1,13 +1,10 @@
1
+ import { IntlayerClientContext as e } from "../IntlayerProvider.mjs";
2
+ import { createMemo as t, useContext as n } from "solid-js";
1
3
  import { bindIntl as r } from "@intlayer/core/formatters";
2
- import { useContext as n, createMemo as c } from "solid-js";
3
- import { IntlayerClientContext as l } from "../IntlayerProvider.mjs";
4
- const u = (t) => {
5
- const e = n(l);
6
- return c(() => {
7
- const o = t ?? e.locale();
8
- return r(o);
9
- });
10
- };
11
- export {
12
- u as useIntl
4
+ //#region src/client/format/useIntl.ts
5
+ var i = (i) => {
6
+ let a = n(e);
7
+ return t(() => r(i ?? a.locale()));
13
8
  };
9
+ //#endregion
10
+ export { i as useIntl };
@@ -1,96 +1,80 @@
1
- import s from "@intlayer/config/built";
2
- import { localeDetector as u } from "@intlayer/core/localization";
3
- import { getLocaleFromStorage as m } from "@intlayer/core/utils";
4
- import * as p from "@intlayer/types/locales";
5
- var v = /* @__PURE__ */ ((o) => (o.Querystring = "querystring", o.Storage = "storage", o.Navigator = "navigator", o.HtmlTag = "htmlTag", o))(v || {});
6
- const h = () => ({
7
- order: [
8
- "querystring",
9
- "storage",
10
- "navigator",
11
- "htmlTag"
12
- /* HtmlTag */
13
- ],
14
- lookupQuerystring: "locale",
15
- htmlTag: typeof document < "u" ? document.documentElement : null
16
- }), y = (o, a) => {
17
- const r = {}, d = {
18
- querystring: () => {
19
- if (typeof window > "u") return;
20
- const t = window.location.search || "", n = new URLSearchParams(t).get(a.lookupQuerystring ?? "");
21
- n && (r.querystring = n);
22
- },
23
- storage: () => {
24
- if (typeof window > "u") return;
25
- const t = m({
26
- getCookie: (e) => {
27
- try {
28
- const n = document.cookie.split(";"), i = `${e}=`, g = n.find((f) => f.trim().startsWith(i));
29
- if (g)
30
- return g.split("=")[1].trim();
31
- } catch {
32
- }
33
- },
34
- getSessionStorage: (e) => {
35
- try {
36
- return window.sessionStorage.getItem(e) ?? void 0;
37
- } catch {
38
- }
39
- },
40
- getLocaleStorage: (e) => {
41
- try {
42
- return window.localStorage.getItem(e) ?? void 0;
43
- } catch {
44
- }
45
- }
46
- });
47
- t && (r.storage = t);
48
- },
49
- navigator: () => {
50
- if (typeof navigator > "u") return;
51
- const {
52
- internationalization: t
53
- } = s, e = navigator.languages ?? [navigator.language], n = u({
54
- "accept-language": e.join(",")
55
- }, t.locales, t.defaultLocale);
56
- n && (r.navigator = n);
57
- },
58
- htmlTag: () => {
59
- const t = a.htmlTag;
60
- if (t && typeof t.getAttribute == "function") {
61
- const e = t.getAttribute("lang");
62
- if (e) {
63
- const {
64
- internationalization: n
65
- } = s, i = u({
66
- "accept-language": e
67
- }, n.locales, n.defaultLocale);
68
- r.htmlTag = i;
69
- }
70
- }
71
- }
72
- };
73
- return o.forEach((t) => {
74
- d[t]?.();
75
- }), r;
76
- }, w = (o, a) => {
77
- const {
78
- internationalization: r
79
- } = s;
80
- for (const l of a) {
81
- const c = o[l];
82
- if (c && r.locales.includes(c))
83
- return c;
84
- }
85
- return r?.defaultLocale ?? p.ENGLISH;
86
- }, q = (o = {}) => {
87
- const a = {
88
- ...h(),
89
- ...o
90
- }, r = y(a.order ?? [], a);
91
- return w(r, a.order ?? []);
92
- };
93
- export {
94
- v as LanguageDetector,
95
- q as getBrowserLocale
1
+ import e from "@intlayer/config/built";
2
+ import { getLocaleFromStorage as t } from "@intlayer/core/utils";
3
+ import { localeDetector as n } from "@intlayer/core/localization";
4
+ import * as r from "@intlayer/types/locales";
5
+ //#region src/client/getBrowserLocale.tsx
6
+ var i = /* @__PURE__ */ function(e) {
7
+ return e.Querystring = "querystring", e.Storage = "storage", e.Navigator = "navigator", e.HtmlTag = "htmlTag", e;
8
+ }({}), a = () => ({
9
+ order: [
10
+ i.Querystring,
11
+ i.Storage,
12
+ i.Navigator,
13
+ i.HtmlTag
14
+ ],
15
+ lookupQuerystring: "locale",
16
+ htmlTag: typeof document < "u" ? document.documentElement : null
17
+ }), o = (r, a) => {
18
+ let o = {}, s = () => {
19
+ if (typeof window > "u") return;
20
+ let e = window.location.search || "", t = new URLSearchParams(e).get(a.lookupQuerystring ?? "");
21
+ t && (o[i.Querystring] = t);
22
+ }, c = () => {
23
+ if (typeof window > "u") return;
24
+ let e = t({
25
+ getCookie: (e) => {
26
+ try {
27
+ let t = document.cookie.split(";"), n = `${e}=`, r = t.find((e) => e.trim().startsWith(n));
28
+ if (r) return r.split("=")[1].trim();
29
+ } catch {}
30
+ },
31
+ getSessionStorage: (e) => {
32
+ try {
33
+ return window.sessionStorage.getItem(e) ?? void 0;
34
+ } catch {}
35
+ },
36
+ getLocaleStorage: (e) => {
37
+ try {
38
+ return window.localStorage.getItem(e) ?? void 0;
39
+ } catch {}
40
+ }
41
+ });
42
+ e && (o[i.Storage] = e);
43
+ }, l = () => {
44
+ if (typeof navigator > "u") return;
45
+ let { internationalization: t } = e, r = navigator.languages ?? [navigator.language], a = n({ "accept-language": r.join(",") }, t.locales, t.defaultLocale);
46
+ a && (o[i.Navigator] = a);
47
+ }, u = () => {
48
+ let t = a.htmlTag;
49
+ if (t && typeof t.getAttribute == "function") {
50
+ let r = t.getAttribute("lang");
51
+ if (r) {
52
+ let { internationalization: t } = e, a = n({ "accept-language": r }, t.locales, t.defaultLocale);
53
+ o[i.HtmlTag] = a;
54
+ }
55
+ }
56
+ }, d = {
57
+ [i.Querystring]: s,
58
+ [i.Storage]: c,
59
+ [i.Navigator]: l,
60
+ [i.HtmlTag]: u
61
+ };
62
+ return r.forEach((e) => {
63
+ d[e]?.();
64
+ }), o;
65
+ }, s = (t, n) => {
66
+ let { internationalization: i } = e;
67
+ for (let e of n) {
68
+ let n = t[e];
69
+ if (n && i.locales.includes(n)) return n;
70
+ }
71
+ return i?.defaultLocale ?? r.ENGLISH;
72
+ }, c = (e = {}) => {
73
+ let t = {
74
+ ...a(),
75
+ ...e
76
+ };
77
+ return s(o(t.order ?? [], t), t.order ?? []);
96
78
  };
79
+ //#endregion
80
+ export { i as LanguageDetector, c as getBrowserLocale };
@@ -1,36 +1,11 @@
1
- import { useIntl as r } from "./format/useIntl.mjs";
2
- import { getBrowserLocale as a } from "./getBrowserLocale.mjs";
3
- import { IntlayerClientContext as l, IntlayerProvider as s, IntlayerProviderContent as c, useIntlayerContext as i } from "./IntlayerProvider.mjs";
4
- import { t as x } from "./t.mjs";
5
- import { useDictionary as p } from "./useDictionary.mjs";
6
- import { useDictionaryAsync as y } from "./useDictionaryAsync.mjs";
7
- import { useDictionaryDynamic as I } from "./useDictionaryDynamic.mjs";
8
- import { useIntlayer as D } from "./useIntlayer.mjs";
9
- import { useLoadDynamic as d } from "./useLoadDynamic.mjs";
10
- import { useLocale as S } from "./useLocale.mjs";
11
- import { useLocaleBase as w } from "./useLocaleBase.mjs";
12
- import { localeCookie as P, localeInStorage as R, setLocaleCookie as A, setLocaleInStorage as U, useLocaleCookie as b, useLocaleStorage as h } from "./useLocaleStorage.mjs";
13
- import { useRewriteURL as q } from "./useRewriteURL.mjs";
14
- export {
15
- l as IntlayerClientContext,
16
- s as IntlayerProvider,
17
- c as IntlayerProviderContent,
18
- a as getBrowserLocale,
19
- P as localeCookie,
20
- R as localeInStorage,
21
- A as setLocaleCookie,
22
- U as setLocaleInStorage,
23
- x as t,
24
- p as useDictionary,
25
- y as useDictionaryAsync,
26
- I as useDictionaryDynamic,
27
- r as useIntl,
28
- D as useIntlayer,
29
- i as useIntlayerContext,
30
- d as useLoadDynamic,
31
- S as useLocale,
32
- w as useLocaleBase,
33
- b as useLocaleCookie,
34
- h as useLocaleStorage,
35
- q as useRewriteURL
36
- };
1
+ import { localeCookie as e, localeInStorage as t, setLocaleCookie as n, setLocaleInStorage as r, useLocaleCookie as i, useLocaleStorage as a } from "./useLocaleStorage.mjs";
2
+ import { IntlayerClientContext as o, IntlayerProvider as s, IntlayerProviderContent as c, useIntlayerContext as l } from "./IntlayerProvider.mjs";
3
+ import { useIntl as u } from "./format/useIntl.mjs";
4
+ import { getBrowserLocale as d } from "./getBrowserLocale.mjs";
5
+ import { t as f } from "./t.mjs";
6
+ import { f as p, m, p as h, u as g } from "../../getDictionary-DKdSGWHu.mjs";
7
+ import { useLoadDynamic as _ } from "./useLoadDynamic.mjs";
8
+ import { useLocale as v } from "./useLocale.mjs";
9
+ import { useLocaleBase as y } from "./useLocaleBase.mjs";
10
+ import { useRewriteURL as b } from "./useRewriteURL.mjs";
11
+ export { o as IntlayerClientContext, s as IntlayerProvider, c as IntlayerProviderContent, d as getBrowserLocale, e as localeCookie, t as localeInStorage, n as setLocaleCookie, r as setLocaleInStorage, f as t, m as useDictionary, h as useDictionaryAsync, p as useDictionaryDynamic, u as useIntl, g as useIntlayer, l as useIntlayerContext, _ as useLoadDynamic, v as useLocale, y as useLocaleBase, i as useLocaleCookie, a as useLocaleStorage, b as useRewriteURL };
@@ -1,10 +1,10 @@
1
- import { getTranslation as n } from "@intlayer/core/interpreter";
2
- import { useContext as c } from "solid-js";
3
- import { IntlayerClientContext as l } from "./IntlayerProvider.mjs";
4
- const f = (o, e) => {
5
- const { locale: t } = c(l), r = e ?? (typeof t == "function" ? t() : t);
6
- return n(o, r);
7
- };
8
- export {
9
- f as t
1
+ import { IntlayerClientContext as e } from "./IntlayerProvider.mjs";
2
+ import { getTranslation as t } from "@intlayer/core/interpreter";
3
+ import { useContext as n } from "solid-js";
4
+ //#region src/client/t.ts
5
+ var r = (r, i) => {
6
+ let { locale: a } = n(e);
7
+ return t(r, i ?? (typeof a == "function" ? a() : a));
10
8
  };
9
+ //#endregion
10
+ export { r as t };
@@ -1,13 +1,13 @@
1
- import { useLocaleBase as r } from "./useLocaleBase.mjs";
2
- import { useTranslation as o } from "./useTraduction.mjs";
3
- const a = (t) => {
4
- const { locale: e } = r(), n = o(t);
5
- return {
6
- locale: e,
7
- content: n,
8
- t: o
9
- };
10
- };
11
- export {
12
- a as useContent
1
+ import { useLocaleBase as e } from "./useLocaleBase.mjs";
2
+ import { useTranslation as t } from "./useTraduction.mjs";
3
+ //#region src/client/useContent.ts
4
+ var n = (n) => {
5
+ let { locale: r } = e();
6
+ return {
7
+ locale: r,
8
+ content: t(n),
9
+ t
10
+ };
13
11
  };
12
+ //#endregion
13
+ export { n as useContent };
@@ -1,13 +1,2 @@
1
- import { useContext as n, createMemo as c } from "solid-js";
2
- import { getDictionary as i } from "../getDictionary.mjs";
3
- import { IntlayerClientContext as a } from "./IntlayerProvider.mjs";
4
- const p = (t, o) => {
5
- const e = n(a);
6
- return c(() => {
7
- const r = o ?? e?.locale?.();
8
- return i(t, r);
9
- });
10
- };
11
- export {
12
- p as useDictionary
13
- };
1
+ import { m as e } from "../../getDictionary-DKdSGWHu.mjs";
2
+ export { e as useDictionary };
@@ -1,11 +1,2 @@
1
- import i from "@intlayer/config/built";
2
- import { useContext as c } from "solid-js";
3
- import { IntlayerClientContext as l } from "./IntlayerProvider.mjs";
4
- import { useDictionary as s } from "./useDictionary.mjs";
5
- const p = async (o, n) => {
6
- const { locale: r } = c(l), a = i?.internationalization.defaultLocale, t = n ?? r() ?? a, e = await o[t]?.();
7
- return s(e, t);
8
- };
9
- export {
10
- p as useDictionaryAsync
11
- };
1
+ import { p as e } from "../../getDictionary-DKdSGWHu.mjs";
2
+ export { e as useDictionaryAsync };
@@ -1,15 +1,2 @@
1
- import c from "@intlayer/config/built";
2
- import { useContext as l } from "solid-js";
3
- import { IntlayerClientContext as m } from "./IntlayerProvider.mjs";
4
- import { useDictionary as s } from "./useDictionary.mjs";
5
- import { useLoadDynamic as u } from "./useLoadDynamic.mjs";
6
- const L = (t, n, r) => {
7
- const { locale: i } = l(m) ?? {}, e = c?.internationalization.defaultLocale, o = r ?? i?.() ?? e, a = u(
8
- `${String(n)}.${o}`,
9
- t[o]?.()
10
- );
11
- return s(a, o);
12
- };
13
- export {
14
- L as useDictionaryDynamic
15
- };
1
+ import { f as e } from "../../getDictionary-DKdSGWHu.mjs";
2
+ export { e as useDictionaryDynamic };
@@ -1,13 +1,2 @@
1
- import { useContext as n, createMemo as c } from "solid-js";
2
- import { getIntlayer as l } from "../getIntlayer.mjs";
3
- import { IntlayerClientContext as a } from "./IntlayerProvider.mjs";
4
- const p = (t, e) => {
5
- const o = n(a);
6
- return c(() => {
7
- const r = o?.locale();
8
- return l(t, e ?? r);
9
- });
10
- };
11
- export {
12
- p as useIntlayer
13
- };
1
+ import { u as e } from "../../getDictionary-DKdSGWHu.mjs";
2
+ export { e as useIntlayer };