solid-intlayer 8.3.1 → 8.3.2
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/dist/chunk-C91j1N6u.js +1 -0
- package/dist/cjs/IntlayerNode.cjs +1 -1
- package/dist/cjs/UI/ContentSelector.cjs +1 -1
- package/dist/cjs/client/IntlayerProvider.cjs +1 -1
- package/dist/cjs/client/format/useIntl.cjs +1 -1
- package/dist/cjs/client/getBrowserLocale.cjs +1 -1
- package/dist/cjs/client/index.cjs +1 -1
- package/dist/cjs/client/t.cjs +1 -1
- package/dist/cjs/client/useContent.cjs +1 -1
- package/dist/cjs/client/useDictionary.cjs +1 -1
- package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
- package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/client/useLoadDynamic.cjs +1 -1
- package/dist/cjs/client/useLocale.cjs +1 -1
- package/dist/cjs/client/useLocaleBase.cjs +1 -1
- package/dist/cjs/client/useLocaleStorage.cjs +1 -1
- package/dist/cjs/client/useRewriteURL.cjs +1 -1
- package/dist/cjs/client/useTraduction.cjs +1 -1
- package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -1
- package/dist/cjs/editor/IntlayerEditorProvider.cjs +1 -1
- package/dist/cjs/editor/contexts/CommunicatorContext.cjs +1 -1
- package/dist/cjs/editor/contexts/ConfigurationContext.cjs +1 -1
- package/dist/cjs/editor/contexts/DictionariesRecordContext.cjs +1 -1
- package/dist/cjs/editor/contexts/EditedContentContext.cjs +1 -1
- package/dist/cjs/editor/contexts/EditorEnabledContext.cjs +1 -1
- package/dist/cjs/editor/contexts/EditorProvider.cjs +1 -1
- package/dist/cjs/editor/contexts/FocusDictionaryContext.cjs +1 -1
- package/dist/cjs/editor/contexts/index.cjs +1 -1
- package/dist/cjs/editor/contexts/useCrossFrameMessageListener.cjs +1 -1
- package/dist/cjs/editor/contexts/useCrossFrameState.cjs +1 -1
- package/dist/cjs/editor/contexts/useCrossURLPathState.cjs +1 -1
- package/dist/cjs/editor/contexts/useIframeClickInterceptor.cjs +1 -1
- package/dist/cjs/editor/index.cjs +1 -1
- package/dist/cjs/editor/useEditedContentRenderer.cjs +1 -1
- package/dist/cjs/getDictionary.cjs +1 -1
- package/dist/cjs/getIntlayer.cjs +1 -1
- package/dist/cjs/html/HTMLProvider.cjs +1 -1
- package/dist/cjs/html/HTMLRenderer.cjs +1 -1
- package/dist/cjs/html/index.cjs +1 -1
- package/dist/cjs/html/types.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/markdown/MarkdownProvider.cjs +1 -1
- package/dist/cjs/markdown/MarkdownRenderer.cjs +1 -1
- package/dist/cjs/markdown/compiler.cjs +1 -1
- package/dist/cjs/markdown/index.cjs +1 -1
- package/dist/cjs/markdown/runtime.cjs +1 -1
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/cjs/solidElement/renderSolidElement.cjs +1 -1
- package/dist/esm/IntlayerNode.mjs +9 -17
- package/dist/esm/UI/ContentSelector.mjs +57 -56
- package/dist/esm/client/IntlayerProvider.mjs +56 -66
- package/dist/esm/client/format/useIntl.mjs +8 -11
- package/dist/esm/client/getBrowserLocale.mjs +79 -95
- package/dist/esm/client/index.mjs +11 -36
- package/dist/esm/client/t.mjs +9 -9
- package/dist/esm/client/useContent.mjs +12 -12
- package/dist/esm/client/useDictionary.mjs +2 -13
- package/dist/esm/client/useDictionaryAsync.mjs +2 -11
- package/dist/esm/client/useDictionaryDynamic.mjs +2 -15
- package/dist/esm/client/useIntlayer.mjs +2 -13
- package/dist/esm/client/useLoadDynamic.mjs +15 -21
- package/dist/esm/client/useLocale.mjs +23 -36
- package/dist/esm/client/useLocaleBase.mjs +14 -18
- package/dist/esm/client/useLocaleStorage.mjs +18 -25
- package/dist/esm/client/useRewriteURL.mjs +14 -18
- package/dist/esm/client/useTraduction.mjs +9 -12
- package/dist/esm/editor/ContentSelectorWrapper.mjs +2 -24
- package/dist/esm/editor/IntlayerEditorProvider.mjs +36 -58
- package/dist/esm/editor/contexts/CommunicatorContext.mjs +29 -28
- package/dist/esm/editor/contexts/ConfigurationContext.mjs +18 -20
- package/dist/esm/editor/contexts/DictionariesRecordContext.mjs +39 -44
- package/dist/esm/editor/contexts/EditedContentContext.mjs +135 -154
- package/dist/esm/editor/contexts/EditorEnabledContext.mjs +19 -27
- package/dist/esm/editor/contexts/EditorProvider.mjs +68 -80
- package/dist/esm/editor/contexts/FocusDictionaryContext.mjs +41 -47
- package/dist/esm/editor/contexts/index.mjs +11 -38
- package/dist/esm/editor/contexts/useCrossFrameMessageListener.mjs +30 -34
- package/dist/esm/editor/contexts/useCrossFrameState.mjs +44 -56
- package/dist/esm/editor/contexts/useCrossURLPathState.mjs +23 -24
- package/dist/esm/editor/contexts/useIframeClickInterceptor.mjs +17 -18
- package/dist/esm/editor/index.mjs +2 -4
- package/dist/esm/editor/useEditedContentRenderer.mjs +15 -28
- package/dist/esm/getDictionary.mjs +2 -16
- package/dist/esm/getIntlayer.mjs +2 -16
- package/dist/esm/html/HTMLProvider.mjs +12 -15
- package/dist/esm/html/HTMLRenderer.mjs +28 -51
- package/dist/esm/html/index.mjs +3 -10
- package/dist/esm/html/types.mjs +0 -1
- package/dist/esm/index.mjs +17 -54
- package/dist/esm/markdown/MarkdownProvider.mjs +33 -41
- package/dist/esm/markdown/MarkdownRenderer.mjs +36 -41
- package/dist/esm/markdown/compiler.mjs +6 -8
- package/dist/esm/markdown/index.mjs +5 -17
- package/dist/esm/markdown/runtime.mjs +21 -40
- package/dist/esm/plugins.mjs +2 -20
- package/dist/esm/solidElement/renderSolidElement.mjs +32 -29
- package/dist/getDictionary-DKdSGWHu.mjs +188 -0
- package/dist/getDictionary-DxYuk0_0.js +1 -0
- package/dist/types/IntlayerNode.d.ts +1 -2
- package/dist/types/client/useDictionary.d.ts +1 -1
- package/dist/types/getDictionary.d.ts +1 -2
- package/dist/types/getIntlayer.d.ts +1 -2
- package/dist/types/plugins.d.ts +15 -10
- package/package.json +11 -11
- package/dist/plugins-FXnYVZH5.mjs +0 -229
- package/dist/plugins-lDhO98Wy.js +0 -1
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
}, s = /* @__PURE__ */ new Map(), a = (r, e) => (s.has(r) || s.set(r, o(e)), s.get(r).read());
|
|
19
|
-
export {
|
|
20
|
-
a as useLoadDynamic
|
|
21
|
-
};
|
|
1
|
+
//#region src/client/useLoadDynamic.ts
|
|
2
|
+
var e = (e) => {
|
|
3
|
+
let t = "pending", n, r = e.then((e) => {
|
|
4
|
+
t = "success", n = e;
|
|
5
|
+
}, (e) => {
|
|
6
|
+
t = "error", n = e;
|
|
7
|
+
});
|
|
8
|
+
return { read() {
|
|
9
|
+
if (t === "pending") throw r;
|
|
10
|
+
if (t === "error") throw n;
|
|
11
|
+
return n;
|
|
12
|
+
} };
|
|
13
|
+
}, t = /* @__PURE__ */ new Map(), n = (n, r) => (t.has(n) || t.set(n, e(r)), t.get(n).read());
|
|
14
|
+
//#endregion
|
|
15
|
+
export { n as useLoadDynamic };
|
|
@@ -1,37 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
o(t);
|
|
23
|
-
}
|
|
24
|
-
}), {
|
|
25
|
-
locale: e?.locale,
|
|
26
|
-
// Current locale (signal accessor)
|
|
27
|
-
defaultLocale: n,
|
|
28
|
-
// Principal locale defined in config
|
|
29
|
-
availableLocales: r,
|
|
30
|
-
// List of the available locales defined in config
|
|
31
|
-
setLocale: i
|
|
32
|
-
// Function to set the locale
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
b as useLocale
|
|
1
|
+
import { setLocaleInStorage as e } from "./useLocaleStorage.mjs";
|
|
2
|
+
import { IntlayerClientContext as t } from "./IntlayerProvider.mjs";
|
|
3
|
+
import n from "@intlayer/config/built";
|
|
4
|
+
import { createEffect as r, useContext as i } from "solid-js";
|
|
5
|
+
//#region src/client/useLocale.ts
|
|
6
|
+
var a = ({ isCookieEnabled: a, onLocaleChange: o } = {}) => {
|
|
7
|
+
let { defaultLocale: s, locales: c } = n?.internationalization ?? {}, l = i(t);
|
|
8
|
+
return r(() => {
|
|
9
|
+
o && l?.locale && o(l.locale());
|
|
10
|
+
}), {
|
|
11
|
+
locale: l?.locale,
|
|
12
|
+
defaultLocale: s,
|
|
13
|
+
availableLocales: c,
|
|
14
|
+
setLocale: (t) => {
|
|
15
|
+
if (!c?.map(String).includes(t)) {
|
|
16
|
+
console.error(`Locale ${t} is not available`);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
l?.setLocale(t), e(t, a ?? l?.isCookieEnabled ?? !0), o?.(t);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
37
22
|
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { a as useLocale };
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
setLocale: t
|
|
14
|
-
// Function to set the locale
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
m as useLocaleBase
|
|
1
|
+
import { IntlayerClientContext as e } from "./IntlayerProvider.mjs";
|
|
2
|
+
import t from "@intlayer/config/built";
|
|
3
|
+
import { useContext as n } from "solid-js";
|
|
4
|
+
//#region src/client/useLocaleBase.ts
|
|
5
|
+
var { defaultLocale: r, locales: i } = t.internationalization, a = () => {
|
|
6
|
+
let { locale: t, setLocale: a } = n(e);
|
|
7
|
+
return {
|
|
8
|
+
locale: t,
|
|
9
|
+
defaultLocale: r,
|
|
10
|
+
availableLocales: i,
|
|
11
|
+
setLocale: a
|
|
12
|
+
};
|
|
19
13
|
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { a as useLocaleBase };
|
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
S as localeCookie,
|
|
21
|
-
s as localeInStorage,
|
|
22
|
-
k as setLocaleCookie,
|
|
23
|
-
n as setLocaleInStorage,
|
|
24
|
-
p as useLocaleCookie,
|
|
25
|
-
g as useLocaleStorage
|
|
1
|
+
import { LocaleStorage as e, getLocaleFromStorage as t, setLocaleInStorage as n } from "@intlayer/core/utils";
|
|
2
|
+
import { createMemo as r } from "solid-js";
|
|
3
|
+
import { localeStorageOptions as i } from "@intlayer/core/localization";
|
|
4
|
+
//#region src/client/useLocaleStorage.ts
|
|
5
|
+
var a = t(i), o = a, s = (e, t) => n(e, {
|
|
6
|
+
...i,
|
|
7
|
+
isCookieEnabled: t
|
|
8
|
+
}), c = s, l = (t) => r(() => e({
|
|
9
|
+
...i,
|
|
10
|
+
isCookieEnabled: t
|
|
11
|
+
})), u = (e) => {
|
|
12
|
+
let t = l(e);
|
|
13
|
+
return {
|
|
14
|
+
localeCookie: t().getLocale(),
|
|
15
|
+
setLocaleCookie: t().setLocale
|
|
16
|
+
};
|
|
26
17
|
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { o as localeCookie, a as localeInStorage, c as setLocaleCookie, s as setLocaleInStorage, u as useLocaleCookie, l as useLocaleStorage };
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { createEffect as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
t + window.location.search + window.location.hash
|
|
14
|
-
);
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
p as useRewriteURL
|
|
1
|
+
import { useLocale as e } from "./useLocale.mjs";
|
|
2
|
+
import t from "@intlayer/config/built";
|
|
3
|
+
import { createEffect as n } from "solid-js";
|
|
4
|
+
import { getRewritePath as r } from "@intlayer/core/localization";
|
|
5
|
+
//#region src/client/useRewriteURL.ts
|
|
6
|
+
var i = () => {
|
|
7
|
+
let { locale: i } = e(), a = t?.routing?.rewrite;
|
|
8
|
+
n(() => {
|
|
9
|
+
if (typeof window > "u" || !a) return;
|
|
10
|
+
let e = i(), t = window.location.pathname, n = r(t, e, a);
|
|
11
|
+
n && n !== t && window.history.replaceState(window.history.state, "", n + window.location.search + window.location.hash);
|
|
12
|
+
});
|
|
19
13
|
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { i as useRewriteURL };
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
+
import { IntlayerClientContext as e } from "./IntlayerProvider.mjs";
|
|
2
|
+
import { getTranslation as t } from "@intlayer/core/interpreter";
|
|
1
3
|
import n from "@intlayer/config/built";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return r(
|
|
8
|
-
t,
|
|
9
|
-
o?.() ?? n?.internationalization.defaultLocale
|
|
10
|
-
);
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
s as useTranslation
|
|
4
|
+
import { useContext as r } from "solid-js";
|
|
5
|
+
//#region src/client/useTraduction.ts
|
|
6
|
+
var i = (i) => {
|
|
7
|
+
let { locale: a } = r(e) ?? {};
|
|
8
|
+
return t(i, a?.() ?? n?.internationalization.defaultLocale);
|
|
14
9
|
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { i as useTranslation };
|
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
import "
|
|
2
|
-
|
|
3
|
-
import "@intlayer/types/nodeType";
|
|
4
|
-
import "solid-js";
|
|
5
|
-
import "@intlayer/core/formatters";
|
|
6
|
-
import "../client/IntlayerProvider.mjs";
|
|
7
|
-
import "@intlayer/config/built";
|
|
8
|
-
import "@intlayer/core/localization";
|
|
9
|
-
import "@intlayer/types/locales";
|
|
10
|
-
import "@intlayer/core/interpreter";
|
|
11
|
-
import { C as k } from "../../plugins-FXnYVZH5.mjs";
|
|
12
|
-
import "../client/useLocaleStorage.mjs";
|
|
13
|
-
import "../client/useLocaleBase.mjs";
|
|
14
|
-
import "../UI/ContentSelector.mjs";
|
|
15
|
-
import "@intlayer/editor";
|
|
16
|
-
import "./contexts/ConfigurationContext.mjs";
|
|
17
|
-
import "./contexts/DictionariesRecordContext.mjs";
|
|
18
|
-
import "./contexts/EditedContentContext.mjs";
|
|
19
|
-
import "./contexts/EditorEnabledContext.mjs";
|
|
20
|
-
import "./contexts/CommunicatorContext.mjs";
|
|
21
|
-
import "./contexts/FocusDictionaryContext.mjs";
|
|
22
|
-
export {
|
|
23
|
-
k as ContentSelectorRenderer
|
|
24
|
-
};
|
|
1
|
+
import { l as e } from "../../getDictionary-DKdSGWHu.mjs";
|
|
2
|
+
export { e as ContentSelectorRenderer };
|
|
@@ -1,61 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useDictionariesRecordActions as e } from "./contexts/DictionariesRecordContext.mjs";
|
|
2
|
+
import { useEditorEnabled as t } from "./contexts/EditorEnabledContext.mjs";
|
|
3
|
+
import { EditorProvider as n } from "./contexts/EditorProvider.mjs";
|
|
4
|
+
import { useCrossURLPathSetter as r } from "./contexts/useCrossURLPathState.mjs";
|
|
5
|
+
import { useIframeClickInterceptor as i } from "./contexts/useIframeClickInterceptor.mjs";
|
|
6
|
+
import { createComponent as a, memo as o } from "solid-js/web";
|
|
2
7
|
import s from "@intlayer/config/built";
|
|
3
8
|
import { onMount as c } from "solid-js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, O = (t) => r(l, {
|
|
33
|
-
postMessage: (e) => {
|
|
34
|
-
typeof window > "u" || !(window.self !== window.top) || (o.applicationURL.length > 0 && window?.postMessage(
|
|
35
|
-
e,
|
|
36
|
-
// Use to restrict the origin of the editor for security reasons.
|
|
37
|
-
// Correspond to the current application URL to synchronize the locales states.
|
|
38
|
-
o.applicationURL
|
|
39
|
-
), o.editorURL.length > 0 && window.parent?.postMessage(
|
|
40
|
-
e,
|
|
41
|
-
// Use to restrict the origin of the editor for security reasons.
|
|
42
|
-
// Correspond to the editor URL to synchronize the locales states.
|
|
43
|
-
o.editorURL
|
|
44
|
-
), o.cmsURL.length > 0 && window.parent?.postMessage(
|
|
45
|
-
e,
|
|
46
|
-
// Use to restrict the origin of the CMS for security reasons.
|
|
47
|
-
// Correspond to the CMS URL.
|
|
48
|
-
o.cmsURL
|
|
49
|
-
));
|
|
50
|
-
},
|
|
51
|
-
get allowedOrigins() {
|
|
52
|
-
return [o?.editorURL, o?.cmsURL, o?.applicationURL];
|
|
53
|
-
},
|
|
54
|
-
configuration: s,
|
|
55
|
-
get children() {
|
|
56
|
-
return [r(w, {}), p(() => t.children)];
|
|
57
|
-
}
|
|
9
|
+
//#region src/editor/IntlayerEditorProvider.tsx
|
|
10
|
+
var l = () => {
|
|
11
|
+
r(), i();
|
|
12
|
+
let { setLocaleDictionaries: t } = e() ?? {};
|
|
13
|
+
return c(() => {
|
|
14
|
+
import("@intlayer/unmerged-dictionaries-entry").then((e) => {
|
|
15
|
+
let n = e.getUnmergedDictionaries(), r = Object.fromEntries(Object.values(n).flat().map((e) => [e.localId, e]));
|
|
16
|
+
t?.(r);
|
|
17
|
+
});
|
|
18
|
+
}), [];
|
|
19
|
+
}, { editor: u } = s, d = () => {
|
|
20
|
+
let { enabled: e } = t();
|
|
21
|
+
return e() ? a(l, {}) : [];
|
|
22
|
+
}, f = (e) => a(n, {
|
|
23
|
+
postMessage: (e) => {
|
|
24
|
+
typeof window > "u" || window.self !== window.top && (u.applicationURL.length > 0 && window?.postMessage(e, u.applicationURL), u.editorURL.length > 0 && window.parent?.postMessage(e, u.editorURL), u.cmsURL.length > 0 && window.parent?.postMessage(e, u.cmsURL));
|
|
25
|
+
},
|
|
26
|
+
get allowedOrigins() {
|
|
27
|
+
return [
|
|
28
|
+
u?.editorURL,
|
|
29
|
+
u?.cmsURL,
|
|
30
|
+
u?.applicationURL
|
|
31
|
+
];
|
|
32
|
+
},
|
|
33
|
+
configuration: s,
|
|
34
|
+
get children() {
|
|
35
|
+
return [a(d, {}), o(() => e.children)];
|
|
36
|
+
}
|
|
58
37
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { f as IntlayerEditorProvider };
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import
|
|
3
|
-
import { createContext as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { createComponent as e } from "solid-js/web";
|
|
2
|
+
import t from "@intlayer/config/built";
|
|
3
|
+
import { createContext as n, createMemo as r, useContext as i } from "solid-js";
|
|
4
|
+
//#region src/editor/contexts/CommunicatorContext.tsx
|
|
5
|
+
var a = () => Math.random().toString(36).slice(2), { editor: o } = t, s = n({
|
|
6
|
+
postMessage: () => null,
|
|
7
|
+
allowedOrigins: [
|
|
8
|
+
o?.applicationURL,
|
|
9
|
+
o?.editorURL,
|
|
10
|
+
o?.cmsURL
|
|
11
|
+
],
|
|
12
|
+
senderId: ""
|
|
13
|
+
}), c = (t) => {
|
|
14
|
+
let n = a(), i = r(() => ({
|
|
15
|
+
postMessage: t.postMessage,
|
|
16
|
+
allowedOrigins: t.allowedOrigins,
|
|
17
|
+
senderId: n
|
|
18
|
+
}));
|
|
19
|
+
return e(s.Provider, {
|
|
20
|
+
get value() {
|
|
21
|
+
return i();
|
|
22
|
+
},
|
|
23
|
+
get children() {
|
|
24
|
+
return t.children;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}, l = () => i(s);
|
|
28
|
+
//#endregion
|
|
29
|
+
export { c as CommunicatorProvider, l as useCommunicator };
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { createContext as n, useContext as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
f as useConfigurationState
|
|
20
|
-
};
|
|
1
|
+
import { useCrossFrameState as e } from "./useCrossFrameState.mjs";
|
|
2
|
+
import { createComponent as t } from "solid-js/web";
|
|
3
|
+
import { createContext as n, useContext as r } from "solid-js";
|
|
4
|
+
import { MessageKey as i } from "@intlayer/editor";
|
|
5
|
+
//#region src/editor/contexts/ConfigurationContext.tsx
|
|
6
|
+
var a = n(void 0), o = () => e(i.INTLAYER_CONFIGURATION, void 0, {
|
|
7
|
+
receive: !1,
|
|
8
|
+
emit: !0
|
|
9
|
+
}), s = (e) => t(a.Provider, {
|
|
10
|
+
get value() {
|
|
11
|
+
return e.configuration;
|
|
12
|
+
},
|
|
13
|
+
get children() {
|
|
14
|
+
return e.children;
|
|
15
|
+
}
|
|
16
|
+
}), c = () => r(a);
|
|
17
|
+
//#endregion
|
|
18
|
+
export { s as ConfigurationProvider, c as useConfiguration, o as useConfigurationState };
|
|
@@ -1,45 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { createContext as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
...t
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
export {
|
|
42
|
-
f as DictionariesRecordProvider,
|
|
43
|
-
g as useDictionariesRecord,
|
|
44
|
-
v as useDictionariesRecordActions
|
|
1
|
+
import { useCrossFrameState as e } from "./useCrossFrameState.mjs";
|
|
2
|
+
import { createComponent as t } from "solid-js/web";
|
|
3
|
+
import { createContext as n, createMemo as r, useContext as i } from "solid-js";
|
|
4
|
+
import { MessageKey as a } from "@intlayer/editor";
|
|
5
|
+
//#region src/editor/contexts/DictionariesRecordContext.tsx
|
|
6
|
+
var o = n(void 0), s = n(void 0), c = (n) => {
|
|
7
|
+
let [i, c] = e(a.INTLAYER_LOCALE_DICTIONARIES_CHANGED, void 0), l = r(() => ({ localeDictionaries: i() ?? {} })), u = r(() => ({
|
|
8
|
+
setLocaleDictionaries: c,
|
|
9
|
+
setLocaleDictionary: (e) => {
|
|
10
|
+
c((t) => ({
|
|
11
|
+
...t,
|
|
12
|
+
[e.localId]: e
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
}));
|
|
16
|
+
return t(o.Provider, {
|
|
17
|
+
get value() {
|
|
18
|
+
return l();
|
|
19
|
+
},
|
|
20
|
+
get children() {
|
|
21
|
+
return t(s.Provider, {
|
|
22
|
+
get value() {
|
|
23
|
+
return u();
|
|
24
|
+
},
|
|
25
|
+
get children() {
|
|
26
|
+
return n.children;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}, l = () => i(s), u = () => {
|
|
32
|
+
let e = l(), t = i(o);
|
|
33
|
+
if (!t) throw Error("useDictionariesRecordStates must be used within a DictionariesRecordProvider");
|
|
34
|
+
return {
|
|
35
|
+
...t,
|
|
36
|
+
...e
|
|
37
|
+
};
|
|
45
38
|
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { c as DictionariesRecordProvider, u as useDictionariesRecord, l as useDictionariesRecordActions };
|