solid-intlayer 5.5.10 → 5.5.11
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.
- package/README.md +2 -2
- package/dist/cjs/IntlayerNode.cjs +1 -0
- package/dist/cjs/UI/ContentSelector.cjs +1 -0
- package/dist/cjs/client/IntlayerProvider.cjs +1 -0
- package/dist/cjs/client/getBrowserLocale.cjs +1 -0
- package/dist/cjs/client/index.cjs +1 -29
- package/dist/cjs/client/t.cjs +1 -0
- package/dist/cjs/client/useContent.cjs +1 -0
- package/dist/cjs/client/useDictionary.cjs +1 -41
- package/dist/cjs/client/useDictionaryDynamic.cjs +1 -0
- package/dist/cjs/client/useIntlayer.cjs +1 -44
- package/dist/cjs/client/useIntlayerAsync.cjs +1 -0
- package/dist/cjs/client/useLoadDynamic.cjs +1 -0
- package/dist/cjs/client/useLocale.cjs +1 -33
- package/dist/cjs/client/useLocaleBase.cjs +1 -0
- package/dist/cjs/client/useLocaleCookie.cjs +1 -0
- package/dist/cjs/client/useTraduction.cjs +1 -0
- package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -0
- package/dist/cjs/editor/IntlayerEditorProvider.cjs +1 -0
- package/dist/cjs/editor/contexts/ChangedContentContext.cjs +1 -0
- package/dist/cjs/editor/contexts/CommunicatorContext.cjs +1 -0
- package/dist/cjs/editor/contexts/ConfigurationContext.cjs +1 -0
- package/dist/cjs/editor/contexts/DictionariesRecordContext.cjs +1 -0
- package/dist/cjs/editor/contexts/EditedContentContext.cjs +1 -0
- package/dist/cjs/editor/contexts/EditorEnabledContext.cjs +1 -0
- package/dist/cjs/editor/contexts/EditorProvider.cjs +1 -0
- package/dist/cjs/editor/contexts/FocusDictionaryContext.cjs +1 -0
- package/dist/cjs/editor/contexts/index.cjs +1 -0
- package/dist/cjs/editor/contexts/useCrossFrameMessageListener.cjs +1 -0
- package/dist/cjs/editor/contexts/useCrossFrameState.cjs +1 -0
- package/dist/cjs/editor/contexts/useCrossURLPathState.cjs +1 -0
- package/dist/cjs/editor/contexts/useIframeClickInterceptor.cjs +1 -0
- package/dist/cjs/editor/index.cjs +1 -0
- package/dist/cjs/editor/useEditedContentRenderer.cjs +1 -0
- package/dist/cjs/getDictionary.cjs +1 -42
- package/dist/cjs/getIntlayer.cjs +1 -38
- package/dist/cjs/index.cjs +1 -31
- package/dist/cjs/markdown/MarkdownProvider.cjs +1 -0
- package/dist/cjs/markdown/MarkdownRenderer.cjs +1 -0
- package/dist/cjs/markdown/index.cjs +1 -36
- package/dist/cjs/plugins.cjs +1 -53
- package/dist/cjs/solidElement/renderSolidElement.cjs +1 -0
- package/dist/esm/IntlayerNode.mjs +17 -0
- package/dist/esm/UI/ContentSelector.mjs +58 -0
- package/dist/esm/client/IntlayerProvider.mjs +69 -0
- package/dist/esm/client/getBrowserLocale.mjs +100 -0
- package/dist/esm/client/index.mjs +29 -5
- package/dist/esm/client/t.mjs +10 -0
- package/dist/esm/client/useContent.mjs +13 -0
- package/dist/esm/client/useDictionary.mjs +18 -13
- package/dist/esm/client/useDictionaryDynamic.mjs +14 -0
- package/dist/esm/client/useIntlayer.mjs +18 -15
- package/dist/esm/client/useIntlayerAsync.mjs +15 -0
- package/dist/esm/client/useLoadDynamic.mjs +21 -0
- package/dist/esm/client/useLocale.mjs +29 -6
- package/dist/esm/client/useLocaleBase.mjs +19 -0
- package/dist/esm/client/useLocaleCookie.mjs +19 -0
- package/dist/esm/client/useTraduction.mjs +10 -0
- package/dist/esm/editor/ContentSelectorWrapper.mjs +52 -0
- package/dist/esm/editor/IntlayerEditorProvider.mjs +64 -0
- package/dist/esm/editor/contexts/ChangedContentContext.mjs +39 -0
- package/dist/esm/editor/contexts/CommunicatorContext.mjs +30 -0
- package/dist/esm/editor/contexts/ConfigurationContext.mjs +19 -0
- package/dist/esm/editor/contexts/DictionariesRecordContext.mjs +44 -0
- package/dist/esm/editor/contexts/EditedContentContext.mjs +147 -0
- package/dist/esm/editor/contexts/EditorEnabledContext.mjs +27 -0
- package/dist/esm/editor/contexts/EditorProvider.mjs +85 -0
- package/dist/esm/editor/contexts/FocusDictionaryContext.mjs +47 -0
- package/dist/esm/editor/contexts/index.mjs +43 -0
- package/dist/esm/editor/contexts/useCrossFrameMessageListener.mjs +35 -0
- package/dist/esm/editor/contexts/useCrossFrameState.mjs +57 -0
- package/dist/esm/editor/contexts/useCrossURLPathState.mjs +25 -0
- package/dist/esm/editor/contexts/useIframeClickInterceptor.mjs +18 -0
- package/dist/esm/editor/index.mjs +4 -0
- package/dist/esm/editor/useEditedContentRenderer.mjs +29 -0
- package/dist/esm/getDictionary.mjs +13 -18
- package/dist/esm/getIntlayer.mjs +10 -15
- package/dist/esm/index.mjs +41 -6
- package/dist/esm/markdown/MarkdownProvider.mjs +24 -0
- package/dist/esm/markdown/MarkdownRenderer.mjs +31 -0
- package/dist/esm/markdown/index.mjs +7 -10
- package/dist/esm/plugins.mjs +113 -20
- package/dist/esm/solidElement/renderSolidElement.mjs +31 -0
- package/dist/types/IntlayerNode.d.ts +15 -0
- package/dist/types/IntlayerNode.d.ts.map +1 -0
- package/dist/types/UI/ContentSelector.d.ts +11 -0
- package/dist/types/UI/ContentSelector.d.ts.map +1 -0
- package/dist/types/client/IntlayerProvider.d.ts +28 -0
- package/dist/types/client/IntlayerProvider.d.ts.map +1 -0
- package/dist/types/client/getBrowserLocale.d.ts +25 -0
- package/dist/types/client/getBrowserLocale.d.ts.map +1 -0
- package/dist/types/client/index.d.ts +11 -4
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/client/t.d.ts +9 -0
- package/dist/types/client/t.d.ts.map +1 -0
- package/dist/types/client/useContent.d.ts +10 -0
- package/dist/types/client/useContent.d.ts.map +1 -0
- package/dist/types/client/useDictionary.d.ts +7 -2
- package/dist/types/client/useDictionary.d.ts.map +1 -1
- package/dist/types/client/useDictionaryDynamic.d.ts +9 -0
- package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -0
- package/dist/types/client/useIntlayer.d.ts +9 -6
- package/dist/types/client/useIntlayer.d.ts.map +1 -1
- package/dist/types/client/useIntlayerAsync.d.ts +15 -0
- package/dist/types/client/useIntlayerAsync.d.ts.map +1 -0
- package/dist/types/client/useLoadDynamic.d.ts +2 -0
- package/dist/types/client/useLoadDynamic.d.ts.map +1 -0
- package/dist/types/client/useLocale.d.ts +14 -3
- package/dist/types/client/useLocale.d.ts.map +1 -1
- package/dist/types/client/useLocaleBase.d.ts +10 -0
- package/dist/types/client/useLocaleBase.d.ts.map +1 -0
- package/dist/types/client/useLocaleCookie.d.ts +17 -0
- package/dist/types/client/useLocaleCookie.d.ts.map +1 -0
- package/dist/types/client/useTraduction.d.ts +24 -0
- package/dist/types/client/useTraduction.d.ts.map +1 -0
- package/dist/types/editor/ContentSelectorWrapper.d.ts +7 -0
- package/dist/types/editor/ContentSelectorWrapper.d.ts.map +1 -0
- package/dist/types/editor/IntlayerEditorProvider.d.ts +3 -0
- package/dist/types/editor/IntlayerEditorProvider.d.ts.map +1 -0
- package/dist/types/editor/contexts/ChangedContentContext.d.ts +13 -0
- package/dist/types/editor/contexts/ChangedContentContext.d.ts.map +1 -0
- package/dist/types/editor/contexts/CommunicatorContext.d.ts +10 -0
- package/dist/types/editor/contexts/CommunicatorContext.d.ts.map +1 -0
- package/dist/types/editor/contexts/ConfigurationContext.d.ts +9 -0
- package/dist/types/editor/contexts/ConfigurationContext.d.ts.map +1 -0
- package/dist/types/editor/contexts/DictionariesRecordContext.d.ts +16 -0
- package/dist/types/editor/contexts/DictionariesRecordContext.d.ts.map +1 -0
- package/dist/types/editor/contexts/EditedContentContext.d.ts +33 -0
- package/dist/types/editor/contexts/EditedContentContext.d.ts.map +1 -0
- package/dist/types/editor/contexts/EditorEnabledContext.d.ts +11 -0
- package/dist/types/editor/contexts/EditorEnabledContext.d.ts.map +1 -0
- package/dist/types/editor/contexts/EditorProvider.d.ts +6 -0
- package/dist/types/editor/contexts/EditorProvider.d.ts.map +1 -0
- package/dist/types/editor/contexts/FocusDictionaryContext.d.ts +21 -0
- package/dist/types/editor/contexts/FocusDictionaryContext.d.ts.map +1 -0
- package/dist/types/editor/contexts/index.d.ts +13 -0
- package/dist/types/editor/contexts/index.d.ts.map +1 -0
- package/dist/types/editor/contexts/useCrossFrameMessageListener.d.ts +19 -0
- package/dist/types/editor/contexts/useCrossFrameMessageListener.d.ts.map +1 -0
- package/dist/types/editor/contexts/useCrossFrameState.d.ts +29 -0
- package/dist/types/editor/contexts/useCrossFrameState.d.ts.map +1 -0
- package/dist/types/editor/contexts/useCrossURLPathState.d.ts +4 -0
- package/dist/types/editor/contexts/useCrossURLPathState.d.ts.map +1 -0
- package/dist/types/editor/contexts/useIframeClickInterceptor.d.ts +9 -0
- package/dist/types/editor/contexts/useIframeClickInterceptor.d.ts.map +1 -0
- package/dist/types/editor/index.d.ts +2 -0
- package/dist/types/editor/index.d.ts.map +1 -0
- package/dist/types/editor/useEditedContentRenderer.d.ts +13 -0
- package/dist/types/editor/useEditedContentRenderer.d.ts.map +1 -0
- package/dist/types/getDictionary.d.ts +1 -1
- package/dist/types/getDictionary.d.ts.map +1 -1
- package/dist/types/getIntlayer.d.ts +1 -1
- package/dist/types/getIntlayer.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/markdown/MarkdownProvider.d.ts +12 -0
- package/dist/types/markdown/MarkdownProvider.d.ts.map +1 -0
- package/dist/types/markdown/MarkdownRenderer.d.ts +16 -0
- package/dist/types/markdown/MarkdownRenderer.d.ts.map +1 -0
- package/dist/types/markdown/index.d.ts +2 -3
- package/dist/types/markdown/index.d.ts.map +1 -1
- package/dist/types/plugins.d.ts +49 -23
- package/dist/types/plugins.d.ts.map +1 -1
- package/dist/types/solidElement/renderSolidElement.d.ts +3 -0
- package/dist/types/solidElement/renderSolidElement.d.ts.map +1 -0
- package/dist/web-BFg6-54-.mjs +443 -0
- package/dist/web-qH6jV2Kc.js +1 -0
- package/package.json +24 -18
- package/dist/cjs/client/index.cjs.map +0 -1
- package/dist/cjs/client/installIntlayer.cjs +0 -53
- package/dist/cjs/client/installIntlayer.cjs.map +0 -1
- package/dist/cjs/client/useDictionary.cjs.map +0 -1
- package/dist/cjs/client/useIntlayer.cjs.map +0 -1
- package/dist/cjs/client/useLocale.cjs.map +0 -1
- package/dist/cjs/getDictionary.cjs.map +0 -1
- package/dist/cjs/getIntlayer.cjs.map +0 -1
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/markdown/index.cjs.map +0 -1
- package/dist/cjs/plugins.cjs.map +0 -1
- package/dist/esm/client/index.mjs.map +0 -1
- package/dist/esm/client/installIntlayer.mjs +0 -26
- package/dist/esm/client/installIntlayer.mjs.map +0 -1
- package/dist/esm/client/useDictionary.mjs.map +0 -1
- package/dist/esm/client/useIntlayer.mjs.map +0 -1
- package/dist/esm/client/useLocale.mjs.map +0 -1
- package/dist/esm/getDictionary.mjs.map +0 -1
- package/dist/esm/getIntlayer.mjs.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/markdown/index.mjs.map +0 -1
- package/dist/esm/plugins.mjs.map +0 -1
- package/dist/types/client/installIntlayer.d.ts +0 -11
- package/dist/types/client/installIntlayer.d.ts.map +0 -1
package/dist/esm/getIntlayer.mjs
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
10
|
+
return o(t, n, e);
|
|
15
11
|
};
|
|
16
12
|
export {
|
|
17
|
-
getIntlayer
|
|
13
|
+
m as getIntlayer
|
|
18
14
|
};
|
|
19
|
-
//# sourceMappingURL=getIntlayer.mjs.map
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
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
|
package/dist/esm/plugins.mjs
CHANGED
|
@@ -1,27 +1,120 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
|
|
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: (
|
|
11
|
-
transform: (
|
|
12
|
-
|
|
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: (
|
|
18
|
-
transform: (
|
|
19
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
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,
|
|
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
|
|
1
|
+
import { LocalesValues } from '@intlayer/config/client';
|
|
2
2
|
import { Dictionary } from '@intlayer/core';
|
|
3
|
-
|
|
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;
|
|
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":"AAAA,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,qCAWvB,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { LocalesValues } from '@intlayer/config/client';
|
|
2
2
|
import { DictionaryKeys } from '@intlayer/core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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;
|
|
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 @@
|
|
|
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
|
|
2
|
-
|
|
3
|
-
|
|
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":"
|
|
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"}
|