solid-intlayer 5.5.10 → 5.6.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 (192) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/IntlayerNode.cjs +1 -0
  3. package/dist/cjs/UI/ContentSelector.cjs +1 -0
  4. package/dist/cjs/client/IntlayerProvider.cjs +1 -0
  5. package/dist/cjs/client/getBrowserLocale.cjs +1 -0
  6. package/dist/cjs/client/index.cjs +1 -29
  7. package/dist/cjs/client/t.cjs +1 -0
  8. package/dist/cjs/client/useContent.cjs +1 -0
  9. package/dist/cjs/client/useDictionary.cjs +1 -41
  10. package/dist/cjs/client/useDictionaryDynamic.cjs +1 -0
  11. package/dist/cjs/client/useIntlayer.cjs +1 -44
  12. package/dist/cjs/client/useIntlayerAsync.cjs +1 -0
  13. package/dist/cjs/client/useLoadDynamic.cjs +1 -0
  14. package/dist/cjs/client/useLocale.cjs +1 -33
  15. package/dist/cjs/client/useLocaleBase.cjs +1 -0
  16. package/dist/cjs/client/useLocaleCookie.cjs +1 -0
  17. package/dist/cjs/client/useTraduction.cjs +1 -0
  18. package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -0
  19. package/dist/cjs/editor/IntlayerEditorProvider.cjs +1 -0
  20. package/dist/cjs/editor/contexts/ChangedContentContext.cjs +1 -0
  21. package/dist/cjs/editor/contexts/CommunicatorContext.cjs +1 -0
  22. package/dist/cjs/editor/contexts/ConfigurationContext.cjs +1 -0
  23. package/dist/cjs/editor/contexts/DictionariesRecordContext.cjs +1 -0
  24. package/dist/cjs/editor/contexts/EditedContentContext.cjs +1 -0
  25. package/dist/cjs/editor/contexts/EditorEnabledContext.cjs +1 -0
  26. package/dist/cjs/editor/contexts/EditorProvider.cjs +1 -0
  27. package/dist/cjs/editor/contexts/FocusDictionaryContext.cjs +1 -0
  28. package/dist/cjs/editor/contexts/index.cjs +1 -0
  29. package/dist/cjs/editor/contexts/useCrossFrameMessageListener.cjs +1 -0
  30. package/dist/cjs/editor/contexts/useCrossFrameState.cjs +1 -0
  31. package/dist/cjs/editor/contexts/useCrossURLPathState.cjs +1 -0
  32. package/dist/cjs/editor/contexts/useIframeClickInterceptor.cjs +1 -0
  33. package/dist/cjs/editor/index.cjs +1 -0
  34. package/dist/cjs/editor/useEditedContentRenderer.cjs +1 -0
  35. package/dist/cjs/getDictionary.cjs +1 -42
  36. package/dist/cjs/getIntlayer.cjs +1 -38
  37. package/dist/cjs/index.cjs +1 -31
  38. package/dist/cjs/markdown/MarkdownProvider.cjs +1 -0
  39. package/dist/cjs/markdown/MarkdownRenderer.cjs +1 -0
  40. package/dist/cjs/markdown/index.cjs +1 -36
  41. package/dist/cjs/plugins.cjs +1 -53
  42. package/dist/cjs/solidElement/renderSolidElement.cjs +1 -0
  43. package/dist/esm/IntlayerNode.mjs +17 -0
  44. package/dist/esm/UI/ContentSelector.mjs +58 -0
  45. package/dist/esm/client/IntlayerProvider.mjs +69 -0
  46. package/dist/esm/client/getBrowserLocale.mjs +100 -0
  47. package/dist/esm/client/index.mjs +29 -5
  48. package/dist/esm/client/t.mjs +10 -0
  49. package/dist/esm/client/useContent.mjs +13 -0
  50. package/dist/esm/client/useDictionary.mjs +18 -13
  51. package/dist/esm/client/useDictionaryDynamic.mjs +16 -0
  52. package/dist/esm/client/useIntlayer.mjs +18 -15
  53. package/dist/esm/client/useIntlayerAsync.mjs +15 -0
  54. package/dist/esm/client/useLoadDynamic.mjs +21 -0
  55. package/dist/esm/client/useLocale.mjs +29 -6
  56. package/dist/esm/client/useLocaleBase.mjs +19 -0
  57. package/dist/esm/client/useLocaleCookie.mjs +19 -0
  58. package/dist/esm/client/useTraduction.mjs +10 -0
  59. package/dist/esm/editor/ContentSelectorWrapper.mjs +52 -0
  60. package/dist/esm/editor/IntlayerEditorProvider.mjs +64 -0
  61. package/dist/esm/editor/contexts/ChangedContentContext.mjs +39 -0
  62. package/dist/esm/editor/contexts/CommunicatorContext.mjs +30 -0
  63. package/dist/esm/editor/contexts/ConfigurationContext.mjs +19 -0
  64. package/dist/esm/editor/contexts/DictionariesRecordContext.mjs +44 -0
  65. package/dist/esm/editor/contexts/EditedContentContext.mjs +147 -0
  66. package/dist/esm/editor/contexts/EditorEnabledContext.mjs +27 -0
  67. package/dist/esm/editor/contexts/EditorProvider.mjs +85 -0
  68. package/dist/esm/editor/contexts/FocusDictionaryContext.mjs +47 -0
  69. package/dist/esm/editor/contexts/index.mjs +43 -0
  70. package/dist/esm/editor/contexts/useCrossFrameMessageListener.mjs +35 -0
  71. package/dist/esm/editor/contexts/useCrossFrameState.mjs +57 -0
  72. package/dist/esm/editor/contexts/useCrossURLPathState.mjs +25 -0
  73. package/dist/esm/editor/contexts/useIframeClickInterceptor.mjs +18 -0
  74. package/dist/esm/editor/index.mjs +4 -0
  75. package/dist/esm/editor/useEditedContentRenderer.mjs +29 -0
  76. package/dist/esm/getDictionary.mjs +13 -18
  77. package/dist/esm/getIntlayer.mjs +10 -15
  78. package/dist/esm/index.mjs +41 -6
  79. package/dist/esm/markdown/MarkdownProvider.mjs +24 -0
  80. package/dist/esm/markdown/MarkdownRenderer.mjs +31 -0
  81. package/dist/esm/markdown/index.mjs +7 -10
  82. package/dist/esm/plugins.mjs +113 -20
  83. package/dist/esm/solidElement/renderSolidElement.mjs +31 -0
  84. package/dist/types/IntlayerNode.d.ts +15 -0
  85. package/dist/types/IntlayerNode.d.ts.map +1 -0
  86. package/dist/types/UI/ContentSelector.d.ts +11 -0
  87. package/dist/types/UI/ContentSelector.d.ts.map +1 -0
  88. package/dist/types/client/IntlayerProvider.d.ts +28 -0
  89. package/dist/types/client/IntlayerProvider.d.ts.map +1 -0
  90. package/dist/types/client/getBrowserLocale.d.ts +25 -0
  91. package/dist/types/client/getBrowserLocale.d.ts.map +1 -0
  92. package/dist/types/client/index.d.ts +11 -4
  93. package/dist/types/client/index.d.ts.map +1 -1
  94. package/dist/types/client/t.d.ts +9 -0
  95. package/dist/types/client/t.d.ts.map +1 -0
  96. package/dist/types/client/useContent.d.ts +10 -0
  97. package/dist/types/client/useContent.d.ts.map +1 -0
  98. package/dist/types/client/useDictionary.d.ts +7 -2
  99. package/dist/types/client/useDictionary.d.ts.map +1 -1
  100. package/dist/types/client/useDictionaryDynamic.d.ts +9 -0
  101. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -0
  102. package/dist/types/client/useIntlayer.d.ts +9 -6
  103. package/dist/types/client/useIntlayer.d.ts.map +1 -1
  104. package/dist/types/client/useIntlayerAsync.d.ts +15 -0
  105. package/dist/types/client/useIntlayerAsync.d.ts.map +1 -0
  106. package/dist/types/client/useLoadDynamic.d.ts +2 -0
  107. package/dist/types/client/useLoadDynamic.d.ts.map +1 -0
  108. package/dist/types/client/useLocale.d.ts +14 -3
  109. package/dist/types/client/useLocale.d.ts.map +1 -1
  110. package/dist/types/client/useLocaleBase.d.ts +10 -0
  111. package/dist/types/client/useLocaleBase.d.ts.map +1 -0
  112. package/dist/types/client/useLocaleCookie.d.ts +17 -0
  113. package/dist/types/client/useLocaleCookie.d.ts.map +1 -0
  114. package/dist/types/client/useTraduction.d.ts +24 -0
  115. package/dist/types/client/useTraduction.d.ts.map +1 -0
  116. package/dist/types/editor/ContentSelectorWrapper.d.ts +7 -0
  117. package/dist/types/editor/ContentSelectorWrapper.d.ts.map +1 -0
  118. package/dist/types/editor/IntlayerEditorProvider.d.ts +3 -0
  119. package/dist/types/editor/IntlayerEditorProvider.d.ts.map +1 -0
  120. package/dist/types/editor/contexts/ChangedContentContext.d.ts +13 -0
  121. package/dist/types/editor/contexts/ChangedContentContext.d.ts.map +1 -0
  122. package/dist/types/editor/contexts/CommunicatorContext.d.ts +10 -0
  123. package/dist/types/editor/contexts/CommunicatorContext.d.ts.map +1 -0
  124. package/dist/types/editor/contexts/ConfigurationContext.d.ts +9 -0
  125. package/dist/types/editor/contexts/ConfigurationContext.d.ts.map +1 -0
  126. package/dist/types/editor/contexts/DictionariesRecordContext.d.ts +16 -0
  127. package/dist/types/editor/contexts/DictionariesRecordContext.d.ts.map +1 -0
  128. package/dist/types/editor/contexts/EditedContentContext.d.ts +33 -0
  129. package/dist/types/editor/contexts/EditedContentContext.d.ts.map +1 -0
  130. package/dist/types/editor/contexts/EditorEnabledContext.d.ts +11 -0
  131. package/dist/types/editor/contexts/EditorEnabledContext.d.ts.map +1 -0
  132. package/dist/types/editor/contexts/EditorProvider.d.ts +6 -0
  133. package/dist/types/editor/contexts/EditorProvider.d.ts.map +1 -0
  134. package/dist/types/editor/contexts/FocusDictionaryContext.d.ts +21 -0
  135. package/dist/types/editor/contexts/FocusDictionaryContext.d.ts.map +1 -0
  136. package/dist/types/editor/contexts/index.d.ts +13 -0
  137. package/dist/types/editor/contexts/index.d.ts.map +1 -0
  138. package/dist/types/editor/contexts/useCrossFrameMessageListener.d.ts +19 -0
  139. package/dist/types/editor/contexts/useCrossFrameMessageListener.d.ts.map +1 -0
  140. package/dist/types/editor/contexts/useCrossFrameState.d.ts +29 -0
  141. package/dist/types/editor/contexts/useCrossFrameState.d.ts.map +1 -0
  142. package/dist/types/editor/contexts/useCrossURLPathState.d.ts +4 -0
  143. package/dist/types/editor/contexts/useCrossURLPathState.d.ts.map +1 -0
  144. package/dist/types/editor/contexts/useIframeClickInterceptor.d.ts +9 -0
  145. package/dist/types/editor/contexts/useIframeClickInterceptor.d.ts.map +1 -0
  146. package/dist/types/editor/index.d.ts +2 -0
  147. package/dist/types/editor/index.d.ts.map +1 -0
  148. package/dist/types/editor/useEditedContentRenderer.d.ts +13 -0
  149. package/dist/types/editor/useEditedContentRenderer.d.ts.map +1 -0
  150. package/dist/types/getDictionary.d.ts +1 -1
  151. package/dist/types/getDictionary.d.ts.map +1 -1
  152. package/dist/types/getIntlayer.d.ts +1 -1
  153. package/dist/types/getIntlayer.d.ts.map +1 -1
  154. package/dist/types/index.d.ts +3 -5
  155. package/dist/types/index.d.ts.map +1 -1
  156. package/dist/types/markdown/MarkdownProvider.d.ts +12 -0
  157. package/dist/types/markdown/MarkdownProvider.d.ts.map +1 -0
  158. package/dist/types/markdown/MarkdownRenderer.d.ts +16 -0
  159. package/dist/types/markdown/MarkdownRenderer.d.ts.map +1 -0
  160. package/dist/types/markdown/index.d.ts +2 -3
  161. package/dist/types/markdown/index.d.ts.map +1 -1
  162. package/dist/types/plugins.d.ts +49 -23
  163. package/dist/types/plugins.d.ts.map +1 -1
  164. package/dist/types/solidElement/renderSolidElement.d.ts +3 -0
  165. package/dist/types/solidElement/renderSolidElement.d.ts.map +1 -0
  166. package/dist/web-BFg6-54-.mjs +443 -0
  167. package/dist/web-qH6jV2Kc.js +1 -0
  168. package/package.json +24 -18
  169. package/dist/cjs/client/index.cjs.map +0 -1
  170. package/dist/cjs/client/installIntlayer.cjs +0 -53
  171. package/dist/cjs/client/installIntlayer.cjs.map +0 -1
  172. package/dist/cjs/client/useDictionary.cjs.map +0 -1
  173. package/dist/cjs/client/useIntlayer.cjs.map +0 -1
  174. package/dist/cjs/client/useLocale.cjs.map +0 -1
  175. package/dist/cjs/getDictionary.cjs.map +0 -1
  176. package/dist/cjs/getIntlayer.cjs.map +0 -1
  177. package/dist/cjs/index.cjs.map +0 -1
  178. package/dist/cjs/markdown/index.cjs.map +0 -1
  179. package/dist/cjs/plugins.cjs.map +0 -1
  180. package/dist/esm/client/index.mjs.map +0 -1
  181. package/dist/esm/client/installIntlayer.mjs +0 -26
  182. package/dist/esm/client/installIntlayer.mjs.map +0 -1
  183. package/dist/esm/client/useDictionary.mjs.map +0 -1
  184. package/dist/esm/client/useIntlayer.mjs.map +0 -1
  185. package/dist/esm/client/useLocale.mjs.map +0 -1
  186. package/dist/esm/getDictionary.mjs.map +0 -1
  187. package/dist/esm/getIntlayer.mjs.map +0 -1
  188. package/dist/esm/index.mjs.map +0 -1
  189. package/dist/esm/markdown/index.mjs.map +0 -1
  190. package/dist/esm/plugins.mjs.map +0 -1
  191. package/dist/types/client/installIntlayer.d.ts +0 -11
  192. package/dist/types/client/installIntlayer.d.ts.map +0 -1
@@ -1,19 +1,14 @@
1
- import {
2
- getIntlayer as getIntlayerCore
3
- } from "@intlayer/core";
4
- import {
5
- intlayerNodePlugins,
6
- markdownPlugin
7
- } from "./plugins.mjs";
8
- const getIntlayer = (key, locale, additionalPlugins) => {
9
- const plugins = [
10
- intlayerNodePlugins,
11
- markdownPlugin,
12
- ...additionalPlugins ?? []
1
+ import { getIntlayer as o } from "@intlayer/core";
2
+ import { intlayerNodePlugins as l, solidNodePlugins as i, markdownPlugin as g } from "./plugins.mjs";
3
+ const m = (t, n, r) => {
4
+ const e = [
5
+ l,
6
+ i,
7
+ g,
8
+ ...r ?? []
13
9
  ];
14
- return getIntlayerCore(key, locale, plugins);
10
+ return o(t, n, e);
15
11
  };
16
12
  export {
17
- getIntlayer
13
+ m as getIntlayer
18
14
  };
19
- //# sourceMappingURL=getIntlayer.mjs.map
@@ -1,6 +1,41 @@
1
- export * from "./client/index.mjs";
2
- export * from "./getDictionary.mjs";
3
- export * from "./getIntlayer.mjs";
4
- export * from "./markdown/index.mjs";
5
- export * from "./plugins.mjs";
6
- //# sourceMappingURL=index.mjs.map
1
+ import { getBrowserLocale as f } from "./client/getBrowserLocale.mjs";
2
+ import { IntlayerClientContext as y, IntlayerProvider as u, IntlayerProviderContent as C, useIntlayerContext as I } from "./client/IntlayerProvider.mjs";
3
+ import { t as d } from "./client/t.mjs";
4
+ import { useDictionary as D } from "./client/useDictionary.mjs";
5
+ import { useDictionaryDynamic as P } from "./client/useDictionaryDynamic.mjs";
6
+ import { useIntlayer as B } from "./client/useIntlayer.mjs";
7
+ import { useIntlayerAsync as A } from "./client/useIntlayerAsync.mjs";
8
+ import { useLoadDynamic as b } from "./client/useLoadDynamic.mjs";
9
+ import { useLocale as j } from "./client/useLocale.mjs";
10
+ import { useLocaleBase as z } from "./client/useLocaleBase.mjs";
11
+ import { localeCookie as F, setLocaleCookie as G, useLocaleCookie as H } from "./client/useLocaleCookie.mjs";
12
+ import { MarkdownProvider as K } from "./markdown/MarkdownProvider.mjs";
13
+ import "@intlayer/core";
14
+ import "@intlayer/editor";
15
+ import "./editor/contexts/ChangedContentContext.mjs";
16
+ import "./editor/contexts/ConfigurationContext.mjs";
17
+ import "./editor/contexts/DictionariesRecordContext.mjs";
18
+ import "./editor/contexts/EditedContentContext.mjs";
19
+ import "./editor/contexts/EditorEnabledContext.mjs";
20
+ import "solid-js";
21
+ import "./editor/contexts/CommunicatorContext.mjs";
22
+ import "./editor/contexts/FocusDictionaryContext.mjs";
23
+ export {
24
+ y as IntlayerClientContext,
25
+ u as IntlayerProvider,
26
+ C as IntlayerProviderContent,
27
+ K as MarkdownProvider,
28
+ f as getBrowserLocale,
29
+ F as localeCookie,
30
+ G as setLocaleCookie,
31
+ d as t,
32
+ D as useDictionary,
33
+ P as useDictionaryDynamic,
34
+ B as useIntlayer,
35
+ A as useIntlayerAsync,
36
+ I as useIntlayerContext,
37
+ b as useLoadDynamic,
38
+ j as useLocale,
39
+ z as useLocaleBase,
40
+ H as useLocaleCookie
41
+ };
@@ -0,0 +1,24 @@
1
+ import { createContext as t, createComponent as d, useContext as a } from "solid-js";
2
+ const e = t(), i = (r) => {
3
+ const n = (o) => o;
4
+ return d(e.Provider, {
5
+ get value() {
6
+ return {
7
+ renderMarkdown: r.renderMarkdown ?? n
8
+ };
9
+ },
10
+ get children() {
11
+ return r.children;
12
+ }
13
+ });
14
+ }, u = () => {
15
+ const r = a(e);
16
+ if (!r)
17
+ throw new Error("useMarkdown must be used within a MarkdownProvider. To fix this error, wrap your component with <MarkdownProvider>.");
18
+ return r;
19
+ };
20
+ export {
21
+ e as MarkdownContext,
22
+ i as MarkdownProvider,
23
+ u as useMarkdown
24
+ };
@@ -0,0 +1,31 @@
1
+ import { getContent as d, getMarkdownMetadata as o, getContentNodeByKeyPath as i } from "@intlayer/core";
2
+ import { useEditedContentRenderer as a } from "../editor/useEditedContentRenderer.mjs";
3
+ import { useMarkdown as c } from "./MarkdownProvider.mjs";
4
+ const l = (t) => {
5
+ const {
6
+ renderMarkdown: e
7
+ } = c(), n = a({
8
+ dictionaryKey: t.dictionaryKey,
9
+ keyPath: t.keyPath,
10
+ children: t.children
11
+ });
12
+ if (typeof n != "string") {
13
+ const r = d(n, {
14
+ dictionaryKey: t.dictionaryKey,
15
+ keyPath: t.keyPath
16
+ }, t.locale);
17
+ return typeof r != "string" ? (console.error(`Incorrect Markdown content. Edited Markdown content type: ${typeof r}. Expected string. Value ${JSON.stringify(r)}`), e(t.children)) : e(r);
18
+ }
19
+ return e(n);
20
+ }, m = (t) => {
21
+ const e = a({
22
+ dictionaryKey: t.dictionaryKey,
23
+ keyPath: t.keyPath,
24
+ children: t.children
25
+ }), n = o(e);
26
+ return i(n, t.metadataKeyPath);
27
+ };
28
+ export {
29
+ m as MarkdownMetadataRenderer,
30
+ l as MarkdownRenderer
31
+ };
@@ -1,12 +1,9 @@
1
- const useMarkdown = () => {
2
- const renderMarkdown = (content) => {
3
- return content;
4
- };
5
- return {
6
- renderMarkdown
7
- };
8
- };
1
+ import { MarkdownContext as o, MarkdownProvider as d, useMarkdown as a } from "./MarkdownProvider.mjs";
2
+ import { MarkdownMetadataRenderer as t, MarkdownRenderer as M } from "./MarkdownRenderer.mjs";
9
3
  export {
10
- useMarkdown
4
+ o as MarkdownContext,
5
+ t as MarkdownMetadataRenderer,
6
+ d as MarkdownProvider,
7
+ M as MarkdownRenderer,
8
+ a as useMarkdown
11
9
  };
12
- //# sourceMappingURL=index.mjs.map
@@ -1,27 +1,120 @@
1
- const solidNodePlugins = {
2
- id: "solid-node-plugin",
3
- canHandle: (node) => typeof node === "bigint" || typeof node === "string" || typeof node === "number",
4
- transform: (node, { children, ...rest }) => {
5
- return children ?? node;
6
- }
7
- };
8
- const intlayerNodePlugins = {
1
+ import { getMarkdownMetadata as p, NodeType as u } from "@intlayer/core";
2
+ import { renderIntlayerNode as d } from "./IntlayerNode.mjs";
3
+ import { ContentSelectorRenderer as l } from "./editor/ContentSelectorWrapper.mjs";
4
+ import { EditedContentRenderer as y } from "./editor/useEditedContentRenderer.mjs";
5
+ import "./markdown/MarkdownProvider.mjs";
6
+ import { MarkdownRenderer as f, MarkdownMetadataRenderer as h } from "./markdown/MarkdownRenderer.mjs";
7
+ import { renderSolidElement as k } from "./solidElement/renderSolidElement.mjs";
8
+ import { createComponent as i, mergeProps as o } from "solid-js";
9
+ const C = {
9
10
  id: "intlayer-node-plugin",
10
- canHandle: (node) => typeof node === "bigint" || typeof node === "string" || typeof node === "number",
11
- transform: (node, { children, ...rest }) => {
12
- return children ?? node;
11
+ canHandle: (e) => typeof e == "bigint" || typeof e == "string" || typeof e == "number",
12
+ transform: (e, {
13
+ plugins: t,
14
+ // Removed to avoid next error - Functions cannot be passed directly to Client Components
15
+ ...n
16
+ }) => d({
17
+ ...n,
18
+ value: n.children,
19
+ children: i(l, o(n, {
20
+ get children() {
21
+ return i(y, o(n, {
22
+ get children() {
23
+ return n.children;
24
+ }
25
+ }));
26
+ }
27
+ }))
28
+ })
29
+ }, E = {
30
+ id: "solid-node-plugin",
31
+ canHandle: (e) => typeof e == "object" && typeof e.props < "u",
32
+ transform: (e, {
33
+ plugins: t,
34
+ // Removed to avoid next error - Functions cannot be passed directly to Client Components
35
+ ...n
36
+ }) => d({
37
+ ...n,
38
+ value: "[[solid-element]]",
39
+ children: i(l, o(n, {
40
+ get children() {
41
+ return k(e);
42
+ }
43
+ }))
44
+ })
45
+ }, P = {
46
+ id: "markdown-string-plugin",
47
+ canHandle: (e) => typeof e == "string",
48
+ transform: (e, t, n) => {
49
+ const {
50
+ plugins: c,
51
+ // Removed to avoid next error - Functions cannot be passed directly to Client Components
52
+ ...r
53
+ } = t, s = p(e), g = n(s, {
54
+ plugins: [{
55
+ id: "markdown-metadata-plugin",
56
+ canHandle: (a) => typeof a == "string" || typeof a == "number" || typeof a == "boolean" || !a,
57
+ transform: (a, m) => d({
58
+ ...m,
59
+ value: a,
60
+ children: i(l, o(r, {
61
+ get children() {
62
+ return i(h, o(r, {
63
+ get metadataKeyPath() {
64
+ return m.keyPath;
65
+ },
66
+ children: e
67
+ }));
68
+ }
69
+ }))
70
+ })
71
+ }],
72
+ dictionaryKey: r.dictionaryKey,
73
+ keyPath: []
74
+ });
75
+ return d({
76
+ ...t,
77
+ value: e,
78
+ children: i(l, o(r, {
79
+ get children() {
80
+ return i(f, o(r, {
81
+ children: e
82
+ }));
83
+ }
84
+ })),
85
+ additionalProps: {
86
+ metadata: g
87
+ }
88
+ });
13
89
  }
14
- };
15
- const markdownPlugin = {
90
+ }, j = {
16
91
  id: "markdown-plugin",
17
- canHandle: (node) => typeof node === "string",
18
- transform: (node, props) => {
19
- return node;
92
+ canHandle: (e) => typeof e == "object" && (e == null ? void 0 : e.nodeType) === u.Markdown,
93
+ transform: (e, t, n) => {
94
+ const c = [...t.keyPath, {
95
+ type: u.Markdown
96
+ }], r = e[u.Markdown];
97
+ return n(r, {
98
+ ...t,
99
+ children: r,
100
+ keyPath: c,
101
+ plugins: [P, ...t.plugins ?? []]
102
+ });
20
103
  }
104
+ }, T = {
105
+ translation: !0,
106
+ enumeration: !0,
107
+ condition: !0,
108
+ insertion: !0,
109
+ nested: !0,
110
+ solidNode: !0,
111
+ intlayerNode: !0,
112
+ markdown: !0
21
113
  };
22
114
  export {
23
- intlayerNodePlugins,
24
- markdownPlugin,
25
- solidNodePlugins
115
+ T as interpreterPluginsEnabledState,
116
+ C as intlayerNodePlugins,
117
+ j as markdownPlugin,
118
+ P as markdownStringPlugin,
119
+ E as solidNodePlugins
26
120
  };
27
- //# sourceMappingURL=plugins.mjs.map
@@ -0,0 +1,31 @@
1
+ import { D as t } from "../../web-BFg6-54-.mjs";
2
+ const f = (o) => {
3
+ if (typeof o == "string")
4
+ return o;
5
+ const n = ((r) => {
6
+ var s;
7
+ if (r != null && r.props && typeof r.props.children == "object") {
8
+ const c = [], { children: i } = r.props;
9
+ return Object.keys(i ?? {}).forEach((h) => {
10
+ c.push(
11
+ f((i ?? {})[h])
12
+ );
13
+ }), {
14
+ ...r,
15
+ props: { ...r.props, children: c }
16
+ };
17
+ }
18
+ return {
19
+ ...r,
20
+ props: { ...r.props, children: ((s = r.props) == null ? void 0 : s.children) ?? [] }
21
+ };
22
+ })(o), { type: d, props: p } = n;
23
+ return t({
24
+ component: d ?? "span",
25
+ ...p,
26
+ children: p.children
27
+ });
28
+ };
29
+ export {
30
+ f as renderSolidElement
31
+ };
@@ -0,0 +1,15 @@
1
+ import { NodeProps } from '@intlayer/core';
2
+ import { JSX, ParentProps } from 'solid-js';
3
+ export type IntlayerNode<T = NodeProps['children'], AdditionalProps = {}> = JSX.Element & {
4
+ value: T;
5
+ } & AdditionalProps;
6
+ type RenderIntlayerNodeProps<T> = ParentProps<{
7
+ value: T;
8
+ children: JSX.Element;
9
+ additionalProps?: {
10
+ [key: string]: any;
11
+ };
12
+ }>;
13
+ export declare const renderIntlayerNode: <T extends number | string | boolean | undefined | null>({ children, value, additionalProps, }: RenderIntlayerNodeProps<T>) => IntlayerNode<T>;
14
+ export {};
15
+ //# sourceMappingURL=IntlayerNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IntlayerNode.d.ts","sourceRoot":"","sources":["../../src/IntlayerNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEjD,MAAM,MAAM,YAAY,CACtB,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,EACzB,eAAe,GAAG,EAAE,IAClB,GAAG,CAAC,OAAO,GAAG;IAChB,KAAK,EAAE,CAAC,CAAC;CACV,GAAG,eAAe,CAAC;AAEpB,KAAK,uBAAuB,CAAC,CAAC,IAAI,WAAW,CAAC;IAC5C,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CAC1C,CAAC,CAAC;AAEH,eAAO,MAAM,kBAAkB,GAC7B,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,EACtD,uCAIC,uBAAuB,CAAC,CAAC,CAAC,KAAG,YAAY,CAAC,CAAC,CAuC7C,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Component, JSX } from 'solid-js';
2
+ type ContentSelectorProps = {
3
+ onPress: () => void;
4
+ onClickOutside?: () => void;
5
+ pressDuration?: number;
6
+ isSelecting?: boolean;
7
+ children?: JSX.Element;
8
+ } & JSX.HTMLAttributes<HTMLDivElement>;
9
+ export declare const ContentSelector: Component<ContentSelectorProps>;
10
+ export {};
11
+ //# sourceMappingURL=ContentSelector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentSelector.d.ts","sourceRoot":"","sources":["../../../src/UI/ContentSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,GAAG,EACT,MAAM,UAAU,CAAC;AAIlB,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACxB,GAAG,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAEvC,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,oBAAoB,CA0G3D,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { LocalesValues } from '@intlayer/config/client';
2
+ import { Component, ParentProps } from 'solid-js';
3
+ type IntlayerValue = {
4
+ locale: () => LocalesValues;
5
+ setLocale: (newLocale: LocalesValues) => void;
6
+ disableEditor?: boolean;
7
+ };
8
+ /**
9
+ * Context that store the current locale on the client side
10
+ */
11
+ export declare const IntlayerClientContext: import('solid-js').Context<IntlayerValue>;
12
+ /**
13
+ * Hook that provides the current locale
14
+ */
15
+ export declare const useIntlayerContext: () => IntlayerValue;
16
+ export type IntlayerProviderProps = ParentProps<{
17
+ locale?: LocalesValues;
18
+ defaultLocale?: LocalesValues;
19
+ setLocale?: (locale: LocalesValues) => void;
20
+ disableEditor?: boolean;
21
+ }>;
22
+ /**
23
+ * Provider that store the current locale on the client side
24
+ */
25
+ export declare const IntlayerProviderContent: Component<IntlayerProviderProps>;
26
+ export declare const IntlayerProvider: Component<IntlayerProviderProps>;
27
+ export {};
28
+ //# sourceMappingURL=IntlayerProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IntlayerProvider.d.ts","sourceRoot":"","sources":["../../../src/client/IntlayerProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EACL,KAAK,SAAS,EACd,KAAK,WAAW,EAKjB,MAAM,UAAU,CAAC;AAIlB,KAAK,aAAa,GAAG;IACnB,MAAM,EAAE,MAAM,aAAa,CAAC;IAC5B,SAAS,EAAE,CAAC,SAAS,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,2CAKhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB,qBAA0C,CAAC;AAE1E,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC;IAC9C,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,CAAC,qBAAqB,CAyEpE,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,SAAS,CAAC,qBAAqB,CAI7D,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ export declare enum LanguageDetector {
3
+ Querystring = "querystring",
4
+ Cookie = "cookie",
5
+ LocalStorage = "localStorage",
6
+ SessionStorage = "sessionStorage",
7
+ Navigator = "navigator",
8
+ HtmlTag = "htmlTag"
9
+ }
10
+ type LanguageDetectorOptions = {
11
+ order?: LanguageDetector[];
12
+ lookupQuerystring?: string;
13
+ lookupCookie?: string;
14
+ lookupLocalStorage?: string;
15
+ lookupSessionStorage?: string;
16
+ excludeCacheFor?: string[];
17
+ htmlTag?: HTMLElement | null;
18
+ };
19
+ /**
20
+ * Core language detector function
21
+ * const detectedLanguages = detectLanguage(['LanguageDetector.Cookie', 'LanguageDetector.LocalStorage'], { lookupCookie: 'myCookie' });
22
+ */
23
+ export declare const getBrowserLocale: (userOptions?: LanguageDetectorOptions | undefined) => Locales;
24
+ export {};
25
+ //# sourceMappingURL=getBrowserLocale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBrowserLocale.d.ts","sourceRoot":"","sources":["../../../src/client/getBrowserLocale.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,oBAAY,gBAAgB;IAC1B,WAAW,gBAAgB;IAC3B,MAAM,WAAW;IACjB,YAAY,iBAAiB;IAC7B,cAAc,mBAAmB;IACjC,SAAS,cAAc;IACvB,OAAO,YAAY;CACpB;AAGD,KAAK,uBAAuB,GAAG;IAC7B,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAC9B,CAAC;AA2JF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAC3B,cAAa,uBAAuB,GAAG,SAAc,KACpD,OAMF,CAAC"}
@@ -1,5 +1,12 @@
1
- export * from './installIntlayer';
2
- export * from './useDictionary';
3
- export * from './useIntlayer';
4
- export * from './useLocale';
1
+ export { getBrowserLocale } from './getBrowserLocale';
2
+ export { IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, useIntlayerContext, type IntlayerProviderProps, } from './IntlayerProvider';
3
+ export { t } from './t';
4
+ export { useDictionary } from './useDictionary';
5
+ export { useDictionaryDynamic } from './useDictionaryDynamic';
6
+ export { useIntlayer } from './useIntlayer';
7
+ export { useIntlayerAsync } from './useIntlayerAsync';
8
+ export { useLoadDynamic } from './useLoadDynamic';
9
+ export { useLocale } from './useLocale';
10
+ export { useLocaleBase } from './useLocaleBase';
11
+ export { localeCookie, setLocaleCookie, useLocaleCookie, } from './useLocaleCookie';
5
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,GAChB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ import { LanguageContent } from '@intlayer/core';
3
+ /**
4
+ * On the client side, this function returns the translation of the provided multilang content.
5
+ *
6
+ * If the locale is not provided, it will use the locale from the client context
7
+ */
8
+ export declare const t: <Content = string>(multilangContent: LanguageContent<Content>, locale?: Locales) => Content;
9
+ //# sourceMappingURL=t.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"t.d.ts","sourceRoot":"","sources":["../../../src/client/t.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAItE;;;;GAIG;AACH,eAAO,MAAM,CAAC,GAAI,OAAO,GAAG,MAAM,EAChC,kBAAkB,eAAe,CAAC,OAAO,CAAC,EAC1C,SAAS,OAAO,YAQjB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { LanguageContent } from '@intlayer/core';
2
+ /**
3
+ * On the client side, hook to get the translation content based on the locale
4
+ */
5
+ export declare const useContent: <Content>(languageContent: LanguageContent<Content>) => {
6
+ locale: () => import('intlayer').LocalesValues;
7
+ content: Content;
8
+ t: <Content_1 = string>(languageContent: LanguageContent<Content_1>) => Content_1;
9
+ };
10
+ //# sourceMappingURL=useContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useContent.d.ts","sourceRoot":"","sources":["../../../src/client/useContent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAItD;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,EAChC,iBAAiB,eAAe,CAAC,OAAO,CAAC;;;;CAW1C,CAAC"}
@@ -1,4 +1,9 @@
1
- import type { LocalesValues } from '@intlayer/config/client';
1
+ import { LocalesValues } from '@intlayer/config/client';
2
2
  import { Dictionary } from '@intlayer/core';
3
- export declare const useDictionary: <T extends Dictionary>(dictionary: T, locale?: LocalesValues) => any;
3
+ /**
4
+ * On the client side, Hook that transform a dictionary and return the content
5
+ *
6
+ * If the locale is not provided, it will use the locale from the client context
7
+ */
8
+ export declare const useDictionary: <T extends Dictionary>(dictionary: T, locale?: LocalesValues) => import('solid-js').Accessor<any>;
4
9
  //# sourceMappingURL=useDictionary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionary.d.ts","sourceRoot":"","sources":["../../../src/client/useDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAK5C,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,UAAU,EAChD,YAAY,CAAC,EACb,SAAS,aAAa,KACrB,GAgBF,CAAC"}
1
+ {"version":3,"file":"useDictionary.d.ts","sourceRoot":"","sources":["../../../src/client/useDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,UAAU,EAChD,YAAY,CAAC,EACb,SAAS,aAAa,qCAevB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { LocalesValues } from '@intlayer/config/client';
2
+ import { Dictionary, DictionaryKeys, LanguageContent } from '@intlayer/core';
3
+ /**
4
+ * On the server side, Hook that transform a dictionary and return the content
5
+ *
6
+ * If the locale is not provided, it will use the locale from the client context
7
+ */
8
+ export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: LanguageContent<() => Promise<T>>, key: K, locale?: LocalesValues) => import('solid-js').Accessor<any>;
9
+ //# sourceMappingURL=useDictionaryDynamic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDictionaryDynamic.d.ts","sourceRoot":"","sources":["../../../src/client/useDictionaryDynamic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAMxB;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC/B,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,cAAc,EAExB,mBAAmB,eAAe,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,EACpD,KAAK,CAAC,EACN,SAAS,aAAa,qCAYvB,CAAC"}
@@ -1,8 +1,11 @@
1
- import type { LocalesValues } from '@intlayer/config/client';
1
+ import { LocalesValues } from '@intlayer/config/client';
2
2
  import { DictionaryKeys } from '@intlayer/core';
3
- /** guard utility true only for objects generated by `renderIntlayerNode()` */
4
- export declare const isUpdatableNode: (val: unknown) => val is {
5
- __update: (n: unknown) => void;
6
- };
7
- export declare const useIntlayer: <T extends DictionaryKeys>(key: T, locale?: LocalesValues) => any;
3
+ import { IntlayerDictionaryTypesConnector } from 'intlayer';
4
+ import { DeepTransformContent } from '../plugins';
5
+ /**
6
+ * On the client side, Hook that picking one dictionary by its key and return the content
7
+ *
8
+ * If the locale is not provided, it will use the locale from the client context
9
+ */
10
+ export declare const useIntlayer: <T extends DictionaryKeys>(key: T, locale?: LocalesValues) => (() => DeepTransformContent<IntlayerDictionaryTypesConnector[T]["content"]>);
8
11
  //# sourceMappingURL=useIntlayer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIntlayer.d.ts","sourceRoot":"","sources":["../../../src/client/useIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAMhD,gFAAgF;AAChF,eAAO,MAAM,eAAe,GAC1B,KAAK,OAAO,KACX,GAAG,IAAI;IAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;CAGG,CAAC;AAE9C,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,cAAc,EAClD,KAAK,CAAC,EACN,SAAS,aAAa,KACrB,GAgBF,CAAC"}
1
+ {"version":3,"file":"useIntlayer.d.ts","sourceRoot":"","sources":["../../../src/client/useIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAIjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGvD;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,cAAc,EAClD,KAAK,CAAC,EACN,SAAS,aAAa,KACrB,CAAC,MAAM,oBAAoB,CAC5B,gCAAgC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAC/C,CAeA,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { LocalesValues } from '@intlayer/config/client';
2
+ import { DictionaryKeys } from '@intlayer/core';
3
+ /**
4
+ * SolidJS composable that picks one dictionary by its key and returns the content.
5
+ *
6
+ * 1. Uses the local (bundled) dictionary for the initial render.
7
+ * 2. Hydrates with the distant dictionary once it resolves.
8
+ *
9
+ * If `locale` is not provided, it falls back to the locale found in the
10
+ * `IntlayerClientContext`.
11
+ */
12
+ export declare const useIntlayerAsync: <T extends DictionaryKeys>(key: T, locale?: LocalesValues) => import('@intlayer/core').DeepTransformContent<import('intlayer').IntlayerDictionaryTypesConnector[T]["content"], import('@intlayer/core').IInterpreterPluginState> & {
13
+ isLoading: boolean;
14
+ };
15
+ //# sourceMappingURL=useIntlayerAsync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIntlayerAsync.d.ts","sourceRoot":"","sources":["../../../src/client/useIntlayerAsync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,gBAAgB,CAAC;AAIxB;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,cAAc,EACvD,KAAK,CAAC,EACN,SAAS,aAAa,KAiCjB,qKAA0B;IAAE,SAAS,EAAE,OAAO,CAAA;CACpD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const useLoadDynamic: <T>(key: string, promise: Promise<T>) => T;
2
+ //# sourceMappingURL=useLoadDynamic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLoadDynamic.d.ts","sourceRoot":"","sources":["../../../src/client/useLoadDynamic.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,KAAK,MAAM,EAAE,SAAS,OAAO,CAAC,CAAC,CAAC,KAAG,CAMpE,CAAC"}
@@ -1,4 +1,15 @@
1
- import type { LocalesValues } from '@intlayer/config/client';
2
- import { Accessor } from 'solid-js';
3
- export declare const useLocale: () => [Accessor<LocalesValues>, (locale: LocalesValues) => void];
1
+ import { LocalesValues } from '@intlayer/config/client';
2
+ type useLocaleProps = {
3
+ onLocaleChange?: (locale: LocalesValues) => void;
4
+ };
5
+ /**
6
+ * On the client side, hook to get the current locale and all related fields
7
+ */
8
+ export declare const useLocale: ({ onLocaleChange }?: useLocaleProps) => {
9
+ locale: () => LocalesValues;
10
+ defaultLocale: import('intlayer').Locales;
11
+ availableLocales: import('intlayer').Locales[];
12
+ setLocale: (locale: LocalesValues) => void;
13
+ };
14
+ export {};
4
15
  //# sourceMappingURL=useLocale.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocale.d.ts","sourceRoot":"","sources":["../../../src/client/useLocale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGpC,eAAO,MAAM,SAAS,QAAO,CAC3B,QAAQ,CAAC,aAAa,CAAC,EACvB,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAKhC,CAAC"}
1
+ {"version":3,"file":"useLocale.d.ts","sourceRoot":"","sources":["../../../src/client/useLocale.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAK7D,KAAK,cAAc,GAAG;IACpB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,qBAAoB,cAAmB;;;;wBAOpC,aAAa;CAyBzC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * On the client side, hook to get the current locale and all related fields
3
+ */
4
+ export declare const useLocaleBase: () => {
5
+ locale: () => import('intlayer').LocalesValues;
6
+ defaultLocale: import('intlayer').Locales;
7
+ availableLocales: import('intlayer').Locales[];
8
+ setLocale: (newLocale: import('intlayer').LocalesValues) => void;
9
+ };
10
+ //# sourceMappingURL=useLocaleBase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLocaleBase.d.ts","sourceRoot":"","sources":["../../../src/client/useLocaleBase.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;CASzB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { LocalesValues } from '@intlayer/config/client';
2
+ /**
3
+ * Get the locale cookie
4
+ */
5
+ export declare const localeCookie: LocalesValues | undefined;
6
+ /**
7
+ * Set the locale cookie
8
+ */
9
+ export declare const setLocaleCookie: (locale: LocalesValues) => void;
10
+ /**
11
+ * Hook that provides the locale cookie and a function to set it
12
+ */
13
+ export declare const useLocaleCookie: () => {
14
+ localeCookie: LocalesValues | undefined;
15
+ setLocaleCookie: (locale: LocalesValues) => void;
16
+ };
17
+ //# sourceMappingURL=useLocaleCookie.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLocaleCookie.d.ts","sourceRoot":"","sources":["../../../src/client/useLocaleCookie.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAc7D;;GAEG;AACH,eAAO,MAAM,YAAY,EACrB,aAAa,GACb,SAAS,CAAC;AAEd;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,aAAa,SAEpD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;;8BAPY,aAAa;CAUnD,CAAC"}