solid-intlayer 5.7.5 → 5.7.6
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/cjs/UI/ContentSelector.cjs +1 -1
- package/dist/cjs/client/useDictionary.cjs +1 -1
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -1
- package/dist/cjs/editor/IntlayerEditorProvider.cjs +1 -1
- package/dist/cjs/editor/contexts/EditorProvider.cjs +1 -1
- package/dist/cjs/editor/contexts/index.cjs +1 -1
- package/dist/cjs/editor/useEditedContentRenderer.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/UI/ContentSelector.mjs +12 -11
- package/dist/esm/client/useDictionary.mjs +10 -18
- package/dist/esm/client/useIntlayer.mjs +6 -15
- package/dist/esm/editor/ContentSelectorWrapper.mjs +6 -7
- package/dist/esm/editor/IntlayerEditorProvider.mjs +29 -42
- package/dist/esm/editor/contexts/EditorProvider.mjs +33 -38
- package/dist/esm/editor/contexts/index.mjs +36 -40
- package/dist/esm/editor/useEditedContentRenderer.mjs +2 -3
- package/dist/esm/index.mjs +31 -32
- package/dist/types/UI/ContentSelector.d.ts +1 -0
- package/dist/types/UI/ContentSelector.d.ts.map +1 -1
- package/dist/types/client/useDictionary.d.ts +1 -1
- package/dist/types/client/useDictionary.d.ts.map +1 -1
- package/dist/types/client/useDictionaryAsync.d.ts +1 -1
- package/dist/types/client/useDictionaryAsync.d.ts.map +1 -1
- package/dist/types/client/useDictionaryDynamic.d.ts +1 -1
- package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
- package/dist/types/client/useIntlayer.d.ts.map +1 -1
- package/dist/types/editor/IntlayerEditorProvider.d.ts.map +1 -1
- package/dist/types/editor/contexts/EditorProvider.d.ts.map +1 -1
- package/dist/types/editor/contexts/index.d.ts +0 -1
- package/dist/types/editor/contexts/index.d.ts.map +1 -1
- package/package.json +9 -9
- package/dist/cjs/editor/contexts/ChangedContentContext.cjs +0 -1
- package/dist/esm/editor/contexts/ChangedContentContext.mjs +0 -39
- package/dist/types/editor/contexts/ChangedContentContext.d.ts +0 -13
- package/dist/types/editor/contexts/ChangedContentContext.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../web-qH6jV2Kc.js"),s=require("solid-js");var y=o.template("<span role=button tabindex=0>");const b=250,k=t=>{let
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../web-qH6jV2Kc.js"),s=require("solid-js");var y=o.template("<span role=button tabindex=0>");const b=250,k=t=>{let i;const[v,c]=s.createSignal(!1),[d,u]=s.createSignal(t.isSelecting);let l=null;const h=typeof t.children=="string",g=()=>{u(!0),t.onPress()},S=()=>{l=setTimeout(()=>{g()},t.pressDuration??b)},a=()=>{l&&(clearTimeout(l),l=null)},m=()=>{a(),S()},$=()=>{var e;c(!0),(e=t.onHover)==null||e.call(t)},r=()=>{c(!1),a()},f=e=>{var n;i&&!i.contains(e.target)&&(u(!1),(n=t.onClickOutside)==null||n.call(t))};s.createEffect(()=>{document.addEventListener("mousedown",f),s.onCleanup(()=>{document.removeEventListener("mousedown",f),a()})});const E=e=>{d()&&(e.preventDefault(),e.stopPropagation())},T=()=>{u(!1)};return(()=>{var e=y(),n=i;return typeof n=="function"?o.use(n,e):i=e,e.addEventListener("mouseenter",$),e.addEventListener("blur",T),e.addEventListener("touchcancel",r),e.$$touchend=r,e.$$touchstart=m,e.addEventListener("mouseleave",r),e.$$mouseup=r,e.$$mousedown=m,e.$$click=E,e.$$keyup=()=>null,o.spread(e,s.mergeProps({get style(){return{display:h?"inline":"inline-block",cursor:"pointer","user-select":"none","border-radius":"0.375rem","outline-width":"2px","outline-offset":"4px","outline-style":"solid","outline-color":t.isSelecting||d()||v()?"inherit":"transparent",transition:"all 100ms 50ms ease-in-out"}}},t),!1,!0),o.insert(e,()=>t.children),e})()};o.delegateEvents(["keyup","click","mousedown","mouseup","touchstart","touchend"]);exports.ContentSelector=k;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("solid-js"),c=require("../getDictionary.cjs"),s=require("./IntlayerProvider.cjs"),a=(i,o)=>{const e=t.useContext(s.IntlayerClientContext);return t.createMemo(()=>{var r;const n=o??((r=e==null?void 0:e.locale)==null?void 0:r.call(e));return c.getDictionary(i,n)})};exports.useDictionary=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("solid-js"),c=require("../getIntlayer.cjs"),s=require("./IntlayerProvider.cjs"),a=(r,n)=>{const e=t.useContext(s.IntlayerClientContext);return t.createMemo(()=>{const o=e==null?void 0:e.locale(),l=n??o;return c.getIntlayer(r,l)})};exports.useIntlayer=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@intlayer/core"),t=require("solid-js");require("@intlayer/config/built");require("@intlayer/config/client");const l=require("../client/IntlayerProvider.cjs");require("@intlayer/editor");require("./contexts/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@intlayer/core"),t=require("solid-js");require("@intlayer/config/built");require("@intlayer/config/client");const l=require("../client/IntlayerProvider.cjs");require("@intlayer/editor");require("./contexts/ConfigurationContext.cjs");require("./contexts/DictionariesRecordContext.cjs");require("./contexts/EditedContentContext.cjs");const u=require("./contexts/EditorEnabledContext.cjs");require("./contexts/CommunicatorContext.cjs");const s=require("./contexts/FocusDictionaryContext.cjs");require("../markdown/MarkdownProvider.cjs");require("../client/useLocaleCookie.cjs");require("../client/useLocaleBase.cjs");const d=require("../UI/ContentSelector.cjs"),y=r=>{const{focusedContent:e,setFocusedContent:n}=s.useFocusDictionary(),o=()=>n({dictionaryKey:r.dictionaryKey,keyPath:r.keyPath}),c=t.createMemo(()=>{var i;return((e==null?void 0:e.dictionaryKey)===r.dictionaryKey&&(((i=e==null?void 0:e.keyPath)==null?void 0:i.length)??0)>0&&a.isSameKeyPath((e==null?void 0:e.keyPath)??[],r.keyPath))??!1});return t.createComponent(d.ContentSelector,{onPress:o,get isSelecting(){return c()},get children(){return r.children}})},q=r=>{const{enabled:e}=u.useEditorEnabled(),{disableEditor:n}=l.useIntlayerContext();return e()&&!n?t.createComponent(y,t.mergeProps(r,{get children(){return r.children}})):r.children};exports.ContentSelectorRenderer=q;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../web-qH6jV2Kc.js"),s=require("@intlayer/config/built");require("@intlayer/editor");require("./contexts/ConfigurationContext.cjs");require("./contexts/DictionariesRecordContext.cjs");require("./contexts/EditedContentContext.cjs");const a=require("./contexts/EditorEnabledContext.cjs"),d=require("./contexts/EditorProvider.cjs");require("./contexts/FocusDictionaryContext.cjs");const o=require("solid-js");require("./contexts/CommunicatorContext.cjs");const u=require("./contexts/useCrossURLPathState.cjs"),l=require("./contexts/useIframeClickInterceptor.cjs"),p=()=>(u.useCrossURLPathSetter(),l.useIframeClickInterceptor(),[]),{editor:e}=s,f=()=>{const{enabled:r}=a.useEditorEnabled();return r()?o.createComponent(p,{}):[]},w=r=>o.createComponent(d.EditorProvider,{postMessage:t=>{var n,i;typeof window>"u"||!(window.self!==window.top)||(e.applicationURL.length>0&&(window==null||window.postMessage(t,e.applicationURL)),e.editorURL.length>0&&((n=window.parent)==null||n.postMessage(t,e.editorURL)),e.cmsURL.length>0&&((i=window.parent)==null||i.postMessage(t,e.cmsURL)))},get allowedOrigins(){return[e==null?void 0:e.editorURL,e==null?void 0:e.cmsURL,e==null?void 0:e.applicationURL]},configuration:s,get children(){return[o.createComponent(f,{}),c.memo(()=>r.children)]}});exports.IntlayerEditorProvider=w;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../web-qH6jV2Kc.js"),t=require("solid-js"),d=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../web-qH6jV2Kc.js"),t=require("solid-js"),d=require("./CommunicatorContext.cjs"),a=require("./ConfigurationContext.cjs"),l=require("./DictionariesRecordContext.cjs"),i=require("./EditedContentContext.cjs"),o=require("./EditorEnabledContext.cjs"),s=require("./FocusDictionaryContext.cjs"),u=e=>{const r=i.useGetEditedContentState();return t.createEffect(()=>{r()}),t.createComponent(l.DictionariesRecordProvider,{get children(){return t.createComponent(i.EditedContentProvider,{get children(){return t.createComponent(s.FocusDictionaryProvider,{get children(){return e.children}})}})}})},g=e=>{const r=o.useGetEditorEnabledState(),{enabled:n}=o.useEditorEnabled();return t.createEffect(()=>{n()||r()}),c.memo(()=>n()?e.children:e.fallback)},C=e=>{const[r,n]=t.createSignal(!1);return t.createEffect(()=>{n(window.self!==window.top)}),c.memo(()=>r()?e.children:e.fallback)},E=e=>t.createComponent(o.EditorEnabledProvider,{get children(){return t.createComponent(a.ConfigurationProvider,{get configuration(){return e.configuration},get children(){return t.createComponent(C,{get fallback(){return e.children},get children(){return t.createComponent(d.CommunicatorProvider,{get postMessage(){return e.postMessage},get allowedOrigins(){return e.allowedOrigins},get children(){return t.createComponent(g,{get fallback(){return e.children},get children(){return t.createComponent(u,{get children(){return e.children}})}})}})}})}})}});exports.EditorProvider=E;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@intlayer/editor"),r=require("./ConfigurationContext.cjs"),i=require("./DictionariesRecordContext.cjs"),e=require("./EditedContentContext.cjs"),t=require("./EditorEnabledContext.cjs"),u=require("./EditorProvider.cjs"),s=require("./FocusDictionaryContext.cjs"),c=require("./useCrossFrameMessageListener.cjs"),C=require("./useCrossFrameState.cjs"),d=require("./useCrossURLPathState.cjs"),a=require("./useIframeClickInterceptor.cjs");exports.ConfigurationProvider=r.ConfigurationProvider;exports.useConfiguration=r.useConfiguration;exports.useConfigurationState=r.useConfigurationState;exports.DictionariesRecordProvider=i.DictionariesRecordProvider;exports.useDictionariesRecord=i.useDictionariesRecord;exports.useDictionariesRecordActions=i.useDictionariesRecordActions;exports.EditedContentProvider=e.EditedContentProvider;exports.useEditedContent=e.useEditedContent;exports.useEditedContentActions=e.useEditedContentActions;exports.useGetEditedContentState=e.useGetEditedContentState;exports.usePostEditedContentState=e.usePostEditedContentState;exports.EditorEnabledProvider=t.EditorEnabledProvider;exports.useEditorEnabled=t.useEditorEnabled;exports.useEditorEnabledState=t.useEditorEnabledState;exports.useGetEditorEnabledState=t.useGetEditorEnabledState;exports.usePostEditorEnabledState=t.usePostEditorEnabledState;exports.EditorProvider=u.EditorProvider;exports.FocusDictionaryProvider=s.FocusDictionaryProvider;exports.useFocusDictionary=s.useFocusDictionary;exports.useFocusDictionaryActions=s.useFocusDictionaryActions;exports.useCrossFrameMessageListener=c.useCrossFrameMessageListener;exports.useCrossFrameState=C.useCrossFrameState;exports.useCrossURLPathSetter=d.useCrossURLPathSetter;exports.useCrossURLPathState=d.useCrossURLPathState;exports.useIframeClickInterceptor=a.useIframeClickInterceptor;exports.useIframeClickMerger=a.useIframeClickMerger;Object.keys(n).forEach(o=>{o!=="default"&&!Object.prototype.hasOwnProperty.call(exports,o)&&Object.defineProperty(exports,o,{enumerable:!0,get:()=>n[o]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@intlayer/core");require("@intlayer/editor");require("./contexts/ConfigurationContext.cjs");require("./contexts/DictionariesRecordContext.cjs");const i=require("./contexts/EditedContentContext.cjs");require("./contexts/EditorEnabledContext.cjs");require("solid-js");require("./contexts/CommunicatorContext.cjs");require("./contexts/FocusDictionaryContext.cjs");const o=({dictionaryKey:t,keyPath:n,children:e})=>{const r=i.useEditedContentActions();return r?r.getEditedContentValue(t,n)??e:e},u=t=>{const n=o(t);if(typeof n=="object"){const e=d.getContent(n,t,t.locale);return typeof e!="string"?(console.error(`Incorrect edited content format. Content type: ${typeof e}. Expected string. Value ${JSON.stringify(e)}`),t.children):e}return n};exports.EditedContentRenderer=u;exports.useEditedContentRenderer=o;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./client/getBrowserLocale.cjs"),e=require("./client/IntlayerProvider.cjs"),i=require("./client/t.cjs"),n=require("./client/useDictionary.cjs"),t=require("./client/useDictionaryAsync.cjs"),c=require("./client/useDictionaryDynamic.cjs"),a=require("./client/useIntlayer.cjs"),s=require("./client/useIntlayerAsync.cjs"),u=require("./client/useLoadDynamic.cjs"),l=require("./client/useLocale.cjs"),y=require("./client/useLocaleBase.cjs"),r=require("./client/useLocaleCookie.cjs"),q=require("./markdown/MarkdownProvider.cjs");require("@intlayer/core");require("@intlayer/editor");require("./editor/contexts/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./client/getBrowserLocale.cjs"),e=require("./client/IntlayerProvider.cjs"),i=require("./client/t.cjs"),n=require("./client/useDictionary.cjs"),t=require("./client/useDictionaryAsync.cjs"),c=require("./client/useDictionaryDynamic.cjs"),a=require("./client/useIntlayer.cjs"),s=require("./client/useIntlayerAsync.cjs"),u=require("./client/useLoadDynamic.cjs"),l=require("./client/useLocale.cjs"),y=require("./client/useLocaleBase.cjs"),r=require("./client/useLocaleCookie.cjs"),q=require("./markdown/MarkdownProvider.cjs");require("@intlayer/core");require("@intlayer/editor");require("./editor/contexts/ConfigurationContext.cjs");require("./editor/contexts/DictionariesRecordContext.cjs");require("./editor/contexts/EditedContentContext.cjs");require("./editor/contexts/EditorEnabledContext.cjs");require("solid-js");require("./editor/contexts/CommunicatorContext.cjs");require("./editor/contexts/FocusDictionaryContext.cjs");exports.getBrowserLocale=o.getBrowserLocale;exports.IntlayerClientContext=e.IntlayerClientContext;exports.IntlayerProvider=e.IntlayerProvider;exports.IntlayerProviderContent=e.IntlayerProviderContent;exports.useIntlayerContext=e.useIntlayerContext;exports.t=i.t;exports.useDictionary=n.useDictionary;exports.useDictionaryAsync=t.useDictionaryAsync;exports.useDictionaryDynamic=c.useDictionaryDynamic;exports.useIntlayer=a.useIntlayer;exports.useIntlayerAsync=s.useIntlayerAsync;exports.useLoadDynamic=u.useLoadDynamic;exports.useLocale=l.useLocale;exports.useLocaleBase=y.useLocaleBase;exports.localeCookie=r.localeCookie;exports.setLocaleCookie=r.setLocaleCookie;exports.useLocaleCookie=r.useLocaleCookie;exports.MarkdownProvider=q.MarkdownProvider;
|
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
import { d as T, t as k, s as L, i as y, u as C } from "../../web-BFg6-54-.mjs";
|
|
2
2
|
import { createSignal as m, createEffect as P, onCleanup as w, mergeProps as D } from "solid-js";
|
|
3
3
|
var O = /* @__PURE__ */ k("<span role=button tabindex=0>");
|
|
4
|
-
const _ = 250,
|
|
4
|
+
const _ = 250, R = (t) => {
|
|
5
5
|
let s;
|
|
6
|
-
const [f, a] = m(!1), [u,
|
|
6
|
+
const [f, a] = m(!1), [u, l] = m(t.isSelecting);
|
|
7
7
|
let o = null;
|
|
8
8
|
const h = typeof t.children == "string", v = () => {
|
|
9
|
-
|
|
9
|
+
l(!0), t.onPress();
|
|
10
10
|
}, $ = () => {
|
|
11
11
|
o = setTimeout(() => {
|
|
12
12
|
v();
|
|
13
13
|
}, t.pressDuration ?? _);
|
|
14
|
-
},
|
|
14
|
+
}, r = () => {
|
|
15
15
|
o && (clearTimeout(o), o = null);
|
|
16
16
|
}, c = () => {
|
|
17
|
-
|
|
17
|
+
r(), $();
|
|
18
18
|
}, g = () => {
|
|
19
|
-
|
|
19
|
+
var e;
|
|
20
|
+
a(!0), (e = t.onHover) == null || e.call(t);
|
|
20
21
|
}, i = () => {
|
|
21
|
-
a(!1),
|
|
22
|
+
a(!1), r();
|
|
22
23
|
}, d = (e) => {
|
|
23
24
|
var n;
|
|
24
|
-
s && !s.contains(e.target) && (
|
|
25
|
+
s && !s.contains(e.target) && (l(!1), (n = t.onClickOutside) == null || n.call(t));
|
|
25
26
|
};
|
|
26
27
|
P(() => {
|
|
27
28
|
document.addEventListener("mousedown", d), w(() => {
|
|
28
|
-
document.removeEventListener("mousedown", d),
|
|
29
|
+
document.removeEventListener("mousedown", d), r();
|
|
29
30
|
});
|
|
30
31
|
});
|
|
31
32
|
const E = (e) => {
|
|
32
33
|
u() && (e.preventDefault(), e.stopPropagation());
|
|
33
34
|
}, S = () => {
|
|
34
|
-
|
|
35
|
+
l(!1);
|
|
35
36
|
};
|
|
36
37
|
return (() => {
|
|
37
38
|
var e = O(), n = s;
|
|
@@ -54,5 +55,5 @@ const _ = 250, x = (t) => {
|
|
|
54
55
|
};
|
|
55
56
|
T(["keyup", "click", "mousedown", "mouseup", "touchstart", "touchend"]);
|
|
56
57
|
export {
|
|
57
|
-
|
|
58
|
+
R as ContentSelector
|
|
58
59
|
};
|
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
import { useContext as
|
|
2
|
-
import "
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { getDictionary as i } from "../getDictionary.mjs";
|
|
11
|
-
import { IntlayerClientContext as f } from "./IntlayerProvider.mjs";
|
|
12
|
-
const g = (t, p) => {
|
|
13
|
-
const o = s(f), { changedContent: r } = u();
|
|
14
|
-
return l(() => {
|
|
15
|
-
var e;
|
|
16
|
-
const m = p ?? ((e = o == null ? void 0 : o.locale) == null ? void 0 : e.call(o));
|
|
17
|
-
return r != null && r[t.key] ? i(r == null ? void 0 : r[t.key], m) : i(t, m);
|
|
1
|
+
import { useContext as n, createMemo as a } from "solid-js";
|
|
2
|
+
import { getDictionary as m } from "../getDictionary.mjs";
|
|
3
|
+
import { IntlayerClientContext as l } from "./IntlayerProvider.mjs";
|
|
4
|
+
const u = (t, e) => {
|
|
5
|
+
const r = n(l);
|
|
6
|
+
return a(() => {
|
|
7
|
+
var o;
|
|
8
|
+
const i = e ?? ((o = r == null ? void 0 : r.locale) == null ? void 0 : o.call(r));
|
|
9
|
+
return m(t, i);
|
|
18
10
|
});
|
|
19
11
|
};
|
|
20
12
|
export {
|
|
21
|
-
|
|
13
|
+
u as useDictionary
|
|
22
14
|
};
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import { useContext as
|
|
2
|
-
import "@intlayer/editor";
|
|
3
|
-
import { useChangedContent as n } from "../editor/contexts/ChangedContentContext.mjs";
|
|
4
|
-
import "../editor/contexts/ConfigurationContext.mjs";
|
|
5
|
-
import "../editor/contexts/DictionariesRecordContext.mjs";
|
|
6
|
-
import "../editor/contexts/EditedContentContext.mjs";
|
|
7
|
-
import "../editor/contexts/EditorEnabledContext.mjs";
|
|
8
|
-
import "../editor/contexts/CommunicatorContext.mjs";
|
|
9
|
-
import "../editor/contexts/FocusDictionaryContext.mjs";
|
|
10
|
-
import { getDictionary as s } from "../getDictionary.mjs";
|
|
1
|
+
import { useContext as n, createMemo as l } from "solid-js";
|
|
11
2
|
import { getIntlayer as a } from "../getIntlayer.mjs";
|
|
12
3
|
import { IntlayerClientContext as c } from "./IntlayerProvider.mjs";
|
|
13
|
-
const
|
|
14
|
-
const
|
|
4
|
+
const p = (t, r) => {
|
|
5
|
+
const e = n(c);
|
|
15
6
|
return l(() => {
|
|
16
|
-
const
|
|
17
|
-
return
|
|
7
|
+
const o = e == null ? void 0 : e.locale();
|
|
8
|
+
return a(t, r ?? o);
|
|
18
9
|
});
|
|
19
10
|
};
|
|
20
11
|
export {
|
|
21
|
-
|
|
12
|
+
p as useIntlayer
|
|
22
13
|
};
|
|
@@ -4,7 +4,6 @@ import "@intlayer/config/built";
|
|
|
4
4
|
import "@intlayer/config/client";
|
|
5
5
|
import { useIntlayerContext as y } from "../client/IntlayerProvider.mjs";
|
|
6
6
|
import "@intlayer/editor";
|
|
7
|
-
import "./contexts/ChangedContentContext.mjs";
|
|
8
7
|
import "./contexts/ConfigurationContext.mjs";
|
|
9
8
|
import "./contexts/DictionariesRecordContext.mjs";
|
|
10
9
|
import "./contexts/EditedContentContext.mjs";
|
|
@@ -14,8 +13,8 @@ import { useFocusDictionary as h } from "./contexts/FocusDictionaryContext.mjs";
|
|
|
14
13
|
import "../markdown/MarkdownProvider.mjs";
|
|
15
14
|
import "../client/useLocaleCookie.mjs";
|
|
16
15
|
import "../client/useLocaleBase.mjs";
|
|
17
|
-
import { ContentSelector as
|
|
18
|
-
const
|
|
16
|
+
import { ContentSelector as s } from "../UI/ContentSelector.mjs";
|
|
17
|
+
const p = (t) => {
|
|
19
18
|
const {
|
|
20
19
|
focusedContent: e,
|
|
21
20
|
setFocusedContent: r
|
|
@@ -26,7 +25,7 @@ const s = (t) => {
|
|
|
26
25
|
var i;
|
|
27
26
|
return ((e == null ? void 0 : e.dictionaryKey) === t.dictionaryKey && (((i = e == null ? void 0 : e.keyPath) == null ? void 0 : i.length) ?? 0) > 0 && c((e == null ? void 0 : e.keyPath) ?? [], t.keyPath)) ?? !1;
|
|
28
27
|
});
|
|
29
|
-
return o(
|
|
28
|
+
return o(s, {
|
|
30
29
|
onPress: n,
|
|
31
30
|
get isSelecting() {
|
|
32
31
|
return m();
|
|
@@ -35,18 +34,18 @@ const s = (t) => {
|
|
|
35
34
|
return t.children;
|
|
36
35
|
}
|
|
37
36
|
});
|
|
38
|
-
},
|
|
37
|
+
}, W = (t) => {
|
|
39
38
|
const {
|
|
40
39
|
enabled: e
|
|
41
40
|
} = d(), {
|
|
42
41
|
disableEditor: r
|
|
43
42
|
} = y();
|
|
44
|
-
return e() && !r ? o(
|
|
43
|
+
return e() && !r ? o(p, a(t, {
|
|
45
44
|
get children() {
|
|
46
45
|
return t.children;
|
|
47
46
|
}
|
|
48
47
|
})) : t.children;
|
|
49
48
|
};
|
|
50
49
|
export {
|
|
51
|
-
|
|
50
|
+
W as ContentSelectorRenderer
|
|
52
51
|
};
|
|
@@ -1,64 +1,51 @@
|
|
|
1
|
-
import { m
|
|
2
|
-
import
|
|
3
|
-
import m from "@intlayer/config/built";
|
|
4
|
-
import { createComponent as i, onMount as c, onCleanup as l } from "solid-js";
|
|
1
|
+
import { m } from "../../web-BFg6-54-.mjs";
|
|
2
|
+
import s from "@intlayer/config/built";
|
|
5
3
|
import "@intlayer/editor";
|
|
6
|
-
import { useChangedContentActions as f } from "./contexts/ChangedContentContext.mjs";
|
|
7
4
|
import "./contexts/ConfigurationContext.mjs";
|
|
8
5
|
import "./contexts/DictionariesRecordContext.mjs";
|
|
9
6
|
import "./contexts/EditedContentContext.mjs";
|
|
10
|
-
import { useEditorEnabled as
|
|
11
|
-
import { EditorProvider as
|
|
7
|
+
import { useEditorEnabled as p } from "./contexts/EditorEnabledContext.mjs";
|
|
8
|
+
import { EditorProvider as a } from "./contexts/EditorProvider.mjs";
|
|
12
9
|
import "./contexts/FocusDictionaryContext.mjs";
|
|
10
|
+
import { createComponent as e } from "solid-js";
|
|
13
11
|
import "./contexts/CommunicatorContext.mjs";
|
|
14
|
-
import { useCrossURLPathSetter as
|
|
15
|
-
import { useIframeClickInterceptor as
|
|
16
|
-
const
|
|
17
|
-
editor:
|
|
18
|
-
} =
|
|
12
|
+
import { useCrossURLPathSetter as f } from "./contexts/useCrossURLPathState.mjs";
|
|
13
|
+
import { useIframeClickInterceptor as c } from "./contexts/useIframeClickInterceptor.mjs";
|
|
14
|
+
const l = () => (f(), c(), []), {
|
|
15
|
+
editor: o
|
|
16
|
+
} = s, d = () => {
|
|
19
17
|
const {
|
|
20
|
-
enabled:
|
|
21
|
-
} =
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
} catch (t) {
|
|
30
|
-
console.error("Error initializing IntlayerEventListener:", t);
|
|
31
|
-
}
|
|
32
|
-
l(() => o.cleanup());
|
|
33
|
-
}), n() ? i(I, {}) : [];
|
|
34
|
-
}, D = (n) => i(d, {
|
|
35
|
-
postMessage: (r) => {
|
|
36
|
-
var t, s;
|
|
37
|
-
typeof window > "u" || !(window.self !== window.top) || (e.applicationURL.length > 0 && (window == null || window.postMessage(
|
|
38
|
-
r,
|
|
18
|
+
enabled: r
|
|
19
|
+
} = p();
|
|
20
|
+
return r() ? e(l, {}) : [];
|
|
21
|
+
}, P = (r) => e(a, {
|
|
22
|
+
postMessage: (t) => {
|
|
23
|
+
var i, n;
|
|
24
|
+
typeof window > "u" || !(window.self !== window.top) || (o.applicationURL.length > 0 && (window == null || window.postMessage(
|
|
25
|
+
t,
|
|
39
26
|
// Use to restrict the origin of the editor for security reasons.
|
|
40
27
|
// Correspond to the current application URL to synchronize the locales states.
|
|
41
|
-
|
|
42
|
-
)),
|
|
43
|
-
|
|
28
|
+
o.applicationURL
|
|
29
|
+
)), o.editorURL.length > 0 && ((i = window.parent) == null || i.postMessage(
|
|
30
|
+
t,
|
|
44
31
|
// Use to restrict the origin of the editor for security reasons.
|
|
45
32
|
// Correspond to the editor URL to synchronize the locales states.
|
|
46
|
-
|
|
47
|
-
)),
|
|
48
|
-
|
|
33
|
+
o.editorURL
|
|
34
|
+
)), o.cmsURL.length > 0 && ((n = window.parent) == null || n.postMessage(
|
|
35
|
+
t,
|
|
49
36
|
// Use to restrict the origin of the CMS for security reasons.
|
|
50
37
|
// Correspond to the CMS URL.
|
|
51
|
-
|
|
38
|
+
o.cmsURL
|
|
52
39
|
)));
|
|
53
40
|
},
|
|
54
41
|
get allowedOrigins() {
|
|
55
|
-
return [
|
|
42
|
+
return [o == null ? void 0 : o.editorURL, o == null ? void 0 : o.cmsURL, o == null ? void 0 : o.applicationURL];
|
|
56
43
|
},
|
|
57
|
-
configuration:
|
|
44
|
+
configuration: s,
|
|
58
45
|
get children() {
|
|
59
|
-
return [
|
|
46
|
+
return [e(d, {}), m(() => r.children)];
|
|
60
47
|
}
|
|
61
48
|
});
|
|
62
49
|
export {
|
|
63
|
-
|
|
50
|
+
P as IntlayerEditorProvider
|
|
64
51
|
};
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { m as o } from "../../../web-BFg6-54-.mjs";
|
|
2
2
|
import { createComponent as r, createSignal as d, createEffect as i } from "solid-js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
const b = (e) => {
|
|
3
|
+
import { CommunicatorProvider as c } from "./CommunicatorContext.mjs";
|
|
4
|
+
import { ConfigurationProvider as a } from "./ConfigurationContext.mjs";
|
|
5
|
+
import { DictionariesRecordProvider as l } from "./DictionariesRecordContext.mjs";
|
|
6
|
+
import { useGetEditedContentState as u, EditedContentProvider as m } from "./EditedContentContext.mjs";
|
|
7
|
+
import { EditorEnabledProvider as g, useGetEditorEnabledState as f, useEditorEnabled as s } from "./EditorEnabledContext.mjs";
|
|
8
|
+
import { FocusDictionaryProvider as h } from "./FocusDictionaryContext.mjs";
|
|
9
|
+
const E = (e) => {
|
|
11
10
|
const t = u();
|
|
12
11
|
return i(() => {
|
|
13
12
|
t();
|
|
14
|
-
}), r(
|
|
13
|
+
}), r(l, {
|
|
15
14
|
get children() {
|
|
16
|
-
return r(
|
|
15
|
+
return r(m, {
|
|
17
16
|
get children() {
|
|
18
|
-
return r(
|
|
17
|
+
return r(h, {
|
|
19
18
|
get children() {
|
|
20
19
|
return e.children;
|
|
21
20
|
}
|
|
@@ -24,10 +23,10 @@ const b = (e) => {
|
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
25
|
});
|
|
27
|
-
},
|
|
28
|
-
const t =
|
|
26
|
+
}, b = (e) => {
|
|
27
|
+
const t = f(), {
|
|
29
28
|
enabled: n
|
|
30
|
-
} =
|
|
29
|
+
} = s();
|
|
31
30
|
return i(() => {
|
|
32
31
|
n() || t();
|
|
33
32
|
}), o(() => n() ? e.children : e.fallback);
|
|
@@ -36,38 +35,34 @@ const b = (e) => {
|
|
|
36
35
|
return i(() => {
|
|
37
36
|
n(window.self !== window.top);
|
|
38
37
|
}), o(() => t() ? e.children : e.fallback);
|
|
39
|
-
},
|
|
38
|
+
}, G = (e) => r(g, {
|
|
40
39
|
get children() {
|
|
41
|
-
return r(
|
|
40
|
+
return r(a, {
|
|
41
|
+
get configuration() {
|
|
42
|
+
return e.configuration;
|
|
43
|
+
},
|
|
42
44
|
get children() {
|
|
43
|
-
return r(
|
|
44
|
-
get
|
|
45
|
-
return e.
|
|
45
|
+
return r(v, {
|
|
46
|
+
get fallback() {
|
|
47
|
+
return e.children;
|
|
46
48
|
},
|
|
47
49
|
get children() {
|
|
48
|
-
return r(
|
|
49
|
-
get
|
|
50
|
-
return e.
|
|
50
|
+
return r(c, {
|
|
51
|
+
get postMessage() {
|
|
52
|
+
return e.postMessage;
|
|
53
|
+
},
|
|
54
|
+
get allowedOrigins() {
|
|
55
|
+
return e.allowedOrigins;
|
|
51
56
|
},
|
|
52
57
|
get children() {
|
|
53
|
-
return r(
|
|
54
|
-
get
|
|
55
|
-
return e.
|
|
56
|
-
},
|
|
57
|
-
get allowedOrigins() {
|
|
58
|
-
return e.allowedOrigins;
|
|
58
|
+
return r(b, {
|
|
59
|
+
get fallback() {
|
|
60
|
+
return e.children;
|
|
59
61
|
},
|
|
60
62
|
get children() {
|
|
61
|
-
return r(
|
|
62
|
-
get fallback() {
|
|
63
|
-
return e.children;
|
|
64
|
-
},
|
|
63
|
+
return r(E, {
|
|
65
64
|
get children() {
|
|
66
|
-
return
|
|
67
|
-
get children() {
|
|
68
|
-
return e.children;
|
|
69
|
-
}
|
|
70
|
-
});
|
|
65
|
+
return e.children;
|
|
71
66
|
}
|
|
72
67
|
});
|
|
73
68
|
}
|
|
@@ -81,5 +76,5 @@ const b = (e) => {
|
|
|
81
76
|
}
|
|
82
77
|
});
|
|
83
78
|
export {
|
|
84
|
-
|
|
79
|
+
G as EditorProvider
|
|
85
80
|
};
|
|
@@ -1,43 +1,39 @@
|
|
|
1
1
|
export * from "@intlayer/editor";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { useIframeClickInterceptor as H, useIframeClickMerger as J } from "./useIframeClickInterceptor.mjs";
|
|
2
|
+
import { ConfigurationProvider as r, useConfiguration as i, useConfigurationState as s } from "./ConfigurationContext.mjs";
|
|
3
|
+
import { DictionariesRecordProvider as d, useDictionariesRecord as a, useDictionariesRecordActions as u } from "./DictionariesRecordContext.mjs";
|
|
4
|
+
import { EditedContentProvider as f, useEditedContent as E, useEditedContentActions as m, useGetEditedContentState as C, usePostEditedContentState as p } from "./EditedContentContext.mjs";
|
|
5
|
+
import { EditorEnabledProvider as P, useEditorEnabled as S, useEditorEnabledState as l, useGetEditorEnabledState as v, usePostEditorEnabledState as D } from "./EditorEnabledContext.mjs";
|
|
6
|
+
import { EditorProvider as g } from "./EditorProvider.mjs";
|
|
7
|
+
import { FocusDictionaryProvider as R, useFocusDictionary as y, useFocusDictionaryActions as A } from "./FocusDictionaryContext.mjs";
|
|
8
|
+
import { useCrossFrameMessageListener as L } from "./useCrossFrameMessageListener.mjs";
|
|
9
|
+
import { useCrossFrameState as k } from "./useCrossFrameState.mjs";
|
|
10
|
+
import { useCrossURLPathSetter as M, useCrossURLPathState as U } from "./useCrossURLPathState.mjs";
|
|
11
|
+
import { useIframeClickInterceptor as q, useIframeClickMerger as w } from "./useIframeClickInterceptor.mjs";
|
|
13
12
|
export {
|
|
14
|
-
r as
|
|
15
|
-
d as
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
J as useIframeClickMerger,
|
|
41
|
-
g as usePostEditedContentState,
|
|
42
|
-
F as usePostEditorEnabledState
|
|
13
|
+
r as ConfigurationProvider,
|
|
14
|
+
d as DictionariesRecordProvider,
|
|
15
|
+
f as EditedContentProvider,
|
|
16
|
+
P as EditorEnabledProvider,
|
|
17
|
+
g as EditorProvider,
|
|
18
|
+
R as FocusDictionaryProvider,
|
|
19
|
+
i as useConfiguration,
|
|
20
|
+
s as useConfigurationState,
|
|
21
|
+
L as useCrossFrameMessageListener,
|
|
22
|
+
k as useCrossFrameState,
|
|
23
|
+
M as useCrossURLPathSetter,
|
|
24
|
+
U as useCrossURLPathState,
|
|
25
|
+
a as useDictionariesRecord,
|
|
26
|
+
u as useDictionariesRecordActions,
|
|
27
|
+
E as useEditedContent,
|
|
28
|
+
m as useEditedContentActions,
|
|
29
|
+
S as useEditorEnabled,
|
|
30
|
+
l as useEditorEnabledState,
|
|
31
|
+
y as useFocusDictionary,
|
|
32
|
+
A as useFocusDictionaryActions,
|
|
33
|
+
C as useGetEditedContentState,
|
|
34
|
+
v as useGetEditorEnabledState,
|
|
35
|
+
q as useIframeClickInterceptor,
|
|
36
|
+
w as useIframeClickMerger,
|
|
37
|
+
p as usePostEditedContentState,
|
|
38
|
+
D as usePostEditorEnabledState
|
|
43
39
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getContent as r } from "@intlayer/core";
|
|
2
2
|
import "@intlayer/editor";
|
|
3
|
-
import "./contexts/ChangedContentContext.mjs";
|
|
4
3
|
import "./contexts/ConfigurationContext.mjs";
|
|
5
4
|
import "./contexts/DictionariesRecordContext.mjs";
|
|
6
5
|
import { useEditedContentActions as i } from "./contexts/EditedContentContext.mjs";
|
|
@@ -15,7 +14,7 @@ const d = ({
|
|
|
15
14
|
}) => {
|
|
16
15
|
const o = i();
|
|
17
16
|
return o ? o.getEditedContentValue(e, n) ?? t : t;
|
|
18
|
-
},
|
|
17
|
+
}, y = (e) => {
|
|
19
18
|
const n = d(e);
|
|
20
19
|
if (typeof n == "object") {
|
|
21
20
|
const t = r(n, e, e.locale);
|
|
@@ -24,6 +23,6 @@ const d = ({
|
|
|
24
23
|
return n;
|
|
25
24
|
};
|
|
26
25
|
export {
|
|
27
|
-
|
|
26
|
+
y as EditedContentRenderer,
|
|
28
27
|
d as useEditedContentRenderer
|
|
29
28
|
};
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { getBrowserLocale as
|
|
2
|
-
import { IntlayerClientContext as
|
|
3
|
-
import { t as
|
|
4
|
-
import { useDictionary as
|
|
5
|
-
import { useDictionaryAsync as
|
|
6
|
-
import { useDictionaryDynamic as
|
|
7
|
-
import { useIntlayer as
|
|
8
|
-
import { useIntlayerAsync as
|
|
9
|
-
import { useLoadDynamic as
|
|
10
|
-
import { useLocale as
|
|
11
|
-
import { useLocaleBase as
|
|
12
|
-
import { localeCookie as
|
|
13
|
-
import { MarkdownProvider as
|
|
1
|
+
import { getBrowserLocale as l } from "./client/getBrowserLocale.mjs";
|
|
2
|
+
import { IntlayerClientContext as f, IntlayerProvider as y, IntlayerProviderContent as u, useIntlayerContext as C } from "./client/IntlayerProvider.mjs";
|
|
3
|
+
import { t as L } from "./client/t.mjs";
|
|
4
|
+
import { useDictionary as D } from "./client/useDictionary.mjs";
|
|
5
|
+
import { useDictionaryAsync as v } from "./client/useDictionaryAsync.mjs";
|
|
6
|
+
import { useDictionaryDynamic as w } from "./client/useDictionaryDynamic.mjs";
|
|
7
|
+
import { useIntlayer as B } from "./client/useIntlayer.mjs";
|
|
8
|
+
import { useIntlayerAsync as M } from "./client/useIntlayerAsync.mjs";
|
|
9
|
+
import { useLoadDynamic as h } from "./client/useLoadDynamic.mjs";
|
|
10
|
+
import { useLocale as q } from "./client/useLocale.mjs";
|
|
11
|
+
import { useLocaleBase as E } from "./client/useLocaleBase.mjs";
|
|
12
|
+
import { localeCookie as G, setLocaleCookie as H, useLocaleCookie as J } from "./client/useLocaleCookie.mjs";
|
|
13
|
+
import { MarkdownProvider as N } from "./markdown/MarkdownProvider.mjs";
|
|
14
14
|
import "@intlayer/core";
|
|
15
15
|
import "@intlayer/editor";
|
|
16
|
-
import "./editor/contexts/ChangedContentContext.mjs";
|
|
17
16
|
import "./editor/contexts/ConfigurationContext.mjs";
|
|
18
17
|
import "./editor/contexts/DictionariesRecordContext.mjs";
|
|
19
18
|
import "./editor/contexts/EditedContentContext.mjs";
|
|
@@ -22,22 +21,22 @@ import "solid-js";
|
|
|
22
21
|
import "./editor/contexts/CommunicatorContext.mjs";
|
|
23
22
|
import "./editor/contexts/FocusDictionaryContext.mjs";
|
|
24
23
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
24
|
+
f as IntlayerClientContext,
|
|
25
|
+
y as IntlayerProvider,
|
|
26
|
+
u as IntlayerProviderContent,
|
|
27
|
+
N as MarkdownProvider,
|
|
28
|
+
l as getBrowserLocale,
|
|
29
|
+
G as localeCookie,
|
|
30
|
+
H as setLocaleCookie,
|
|
31
|
+
L as t,
|
|
32
|
+
D as useDictionary,
|
|
33
|
+
v as useDictionaryAsync,
|
|
34
|
+
w as useDictionaryDynamic,
|
|
35
|
+
B as useIntlayer,
|
|
36
|
+
M as useIntlayerAsync,
|
|
37
|
+
C as useIntlayerContext,
|
|
38
|
+
h as useLoadDynamic,
|
|
39
|
+
q as useLocale,
|
|
40
|
+
E as useLocaleBase,
|
|
41
|
+
J as useLocaleCookie
|
|
43
42
|
};
|
|
@@ -1 +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,
|
|
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,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,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,CA2G3D,CAAC"}
|
|
@@ -5,5 +5,5 @@ import { Dictionary } from '@intlayer/core';
|
|
|
5
5
|
*
|
|
6
6
|
* If the locale is not provided, it will use the locale from the client context
|
|
7
7
|
*/
|
|
8
|
-
export declare const useDictionary: <T extends Dictionary>(dictionary: T, locale?: LocalesValues) => import('solid-js').Accessor<
|
|
8
|
+
export declare const useDictionary: <T extends Dictionary>(dictionary: T, locale?: LocalesValues) => import('solid-js').Accessor<import('@intlayer/core').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState>>;
|
|
9
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,KAAK,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;AAKjD;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,UAAU,EAChD,YAAY,CAAC,EACb,SAAS,aAAa,2IASvB,CAAC"}
|
|
@@ -5,5 +5,5 @@ import { Dictionary, LanguageContent } from '@intlayer/core';
|
|
|
5
5
|
*
|
|
6
6
|
* If the locale is not provided, it will use the locale from the client context
|
|
7
7
|
*/
|
|
8
|
-
export declare const useDictionaryAsync: <T extends Dictionary>(dictionaryPromise: LanguageContent<() => Promise<T>>, locale?: LocalesValues) => Promise<import('solid-js').Accessor<
|
|
8
|
+
export declare const useDictionaryAsync: <T extends Dictionary>(dictionaryPromise: LanguageContent<() => Promise<T>>, locale?: LocalesValues) => Promise<import('solid-js').Accessor<import('@intlayer/core').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState>>>;
|
|
9
9
|
//# sourceMappingURL=useDictionaryAsync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryAsync.d.ts","sourceRoot":"","sources":["../../../src/client/useDictionaryAsync.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKlE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAU,CAAC,SAAS,UAAU,EAC3D,mBAAmB,eAAe,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,EACpD,SAAS,aAAa,
|
|
1
|
+
{"version":3,"file":"useDictionaryAsync.d.ts","sourceRoot":"","sources":["../../../src/client/useDictionaryAsync.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKlE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAU,CAAC,SAAS,UAAU,EAC3D,mBAAmB,eAAe,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,EACpD,SAAS,aAAa,oJASvB,CAAC"}
|
|
@@ -5,5 +5,5 @@ import { Dictionary, DictionaryKeys, LanguageContent } from '@intlayer/core';
|
|
|
5
5
|
*
|
|
6
6
|
* If the locale is not provided, it will use the locale from the client context
|
|
7
7
|
*/
|
|
8
|
-
export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: LanguageContent<() => Promise<T>>, key: K, locale?: LocalesValues) => import('solid-js').Accessor<
|
|
8
|
+
export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: LanguageContent<() => Promise<T>>, key: K, locale?: LocalesValues) => import('solid-js').Accessor<import('@intlayer/core').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState>>;
|
|
9
9
|
//# sourceMappingURL=useDictionaryDynamic.d.ts.map
|
|
@@ -1 +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,
|
|
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,2IAYvB,CAAC"}
|
|
@@ -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,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,UAAU,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;AAEjE,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,CASA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntlayerEditorProvider.d.ts","sourceRoot":"","sources":["../../../src/editor/IntlayerEditorProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IntlayerEditorProvider.d.ts","sourceRoot":"","sources":["../../../src/editor/IntlayerEditorProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AA8B5D,eAAO,MAAM,sBAAsB,EAAE,SAAS,CAAC,WAAW,CA+CzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorProvider.d.ts","sourceRoot":"","sources":["../../../../src/editor/contexts/EditorProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,WAAW,EAGjB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"EditorProvider.d.ts","sourceRoot":"","sources":["../../../../src/editor/contexts/EditorProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,WAAW,EAGjB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,KAAK,yBAAyB,EAE/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,0BAA0B,EAEhC,MAAM,wBAAwB,CAAC;AAsEhC,MAAM,MAAM,mBAAmB,GAAG,yBAAyB,GACzD,0BAA0B,CAAC;AAE7B,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAiBtE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/editor/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/editor/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-intlayer",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Solid applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
],
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"js-cookie": "^3.0.5",
|
|
60
|
-
"@intlayer/
|
|
61
|
-
"@intlayer/
|
|
62
|
-
"@intlayer/
|
|
63
|
-
"@intlayer/
|
|
60
|
+
"@intlayer/config": "5.7.6",
|
|
61
|
+
"@intlayer/core": "5.7.6",
|
|
62
|
+
"@intlayer/editor": "5.7.6",
|
|
63
|
+
"@intlayer/api": "5.7.6"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@solidjs/testing-library": "^0.8.10",
|
|
@@ -86,10 +86,10 @@
|
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"solid-js": "^1.9.5",
|
|
89
|
-
"@intlayer/
|
|
90
|
-
"@intlayer/
|
|
91
|
-
"@intlayer/
|
|
92
|
-
"@intlayer/editor": "5.7.
|
|
89
|
+
"@intlayer/config": "5.7.6",
|
|
90
|
+
"@intlayer/core": "5.7.6",
|
|
91
|
+
"@intlayer/api": "5.7.6",
|
|
92
|
+
"@intlayer/editor": "5.7.6"
|
|
93
93
|
},
|
|
94
94
|
"engines": {
|
|
95
95
|
"node": ">=14.18"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("solid-js"),r=t.createContext(void 0),d=t.createContext(void 0),i=n=>{const[c,e]=t.createSignal({}),a=(C,g)=>{e(o=>({...o,[C]:{...o==null?void 0:o[C],content:g}}))};return t.createComponent(r.Provider,{value:{changedContent:c},get children(){return t.createComponent(d.Provider,{value:{setChangedContent:a},get children(){return n.children}})}})},s=()=>t.useContext(d),u=()=>{var e;const n=t.useContext(r),c=s();return{changedContent:(e=n==null?void 0:n.changedContent)==null?void 0:e.call(n),...c}};exports.ChangedContentProvider=i;exports.useChangedContent=u;exports.useChangedContentActions=s;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { createContext as r, createSignal as i, createComponent as C, useContext as d } from "solid-js";
|
|
2
|
-
const a = r(void 0), s = r(void 0), x = (n) => {
|
|
3
|
-
const [o, t] = i({}), g = (c, h) => {
|
|
4
|
-
t((e) => ({
|
|
5
|
-
...e,
|
|
6
|
-
[c]: {
|
|
7
|
-
...e == null ? void 0 : e[c],
|
|
8
|
-
content: h
|
|
9
|
-
}
|
|
10
|
-
}));
|
|
11
|
-
};
|
|
12
|
-
return C(a.Provider, {
|
|
13
|
-
value: {
|
|
14
|
-
changedContent: o
|
|
15
|
-
},
|
|
16
|
-
get children() {
|
|
17
|
-
return C(s.Provider, {
|
|
18
|
-
value: {
|
|
19
|
-
setChangedContent: g
|
|
20
|
-
},
|
|
21
|
-
get children() {
|
|
22
|
-
return n.children;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}, u = () => d(s), m = () => {
|
|
28
|
-
var t;
|
|
29
|
-
const n = d(a), o = u();
|
|
30
|
-
return {
|
|
31
|
-
changedContent: (t = n == null ? void 0 : n.changedContent) == null ? void 0 : t.call(n),
|
|
32
|
-
...o
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
x as ChangedContentProvider,
|
|
37
|
-
m as useChangedContent,
|
|
38
|
-
u as useChangedContentActions
|
|
39
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Dictionary } from '@intlayer/core';
|
|
2
|
-
import { Component, ParentProps } from 'solid-js';
|
|
3
|
-
type ChangedContentActionsContextType = {
|
|
4
|
-
setChangedContent: (dictionaryKey: Dictionary['key'], newValue: Dictionary['content']) => void;
|
|
5
|
-
};
|
|
6
|
-
export declare const ChangedContentProvider: Component<ParentProps>;
|
|
7
|
-
export declare const useChangedContentActions: () => ChangedContentActionsContextType | undefined;
|
|
8
|
-
export declare const useChangedContent: () => {
|
|
9
|
-
setChangedContent?: ((dictionaryKey: Dictionary["key"], newValue: Dictionary["content"]) => void) | undefined;
|
|
10
|
-
changedContent: Record<string, Dictionary> | undefined;
|
|
11
|
-
};
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=ChangedContentContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChangedContentContext.d.ts","sourceRoot":"","sources":["../../../../src/editor/contexts/ChangedContentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAWlB,KAAK,gCAAgC,GAAG;IACtC,iBAAiB,EAAE,CACjB,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,EAChC,QAAQ,EAAE,UAAU,CAAC,SAAS,CAAC,KAC5B,IAAI,CAAC;CACX,CAAC;AAMF,eAAO,MAAM,sBAAsB,EAAE,SAAS,CAAC,WAAW,CAgCzD,CAAC;AAEF,eAAO,MAAM,wBAAwB,oDAIpC,CAAC;AAEF,eAAO,MAAM,iBAAiB;yCAjDX,UAAU,CAAC,KAAK,CAAC,YACtB,UAAU,CAAC,SAAS,CAAC,KAC5B,IAAI;;CAuDV,CAAC"}
|