solid-intlayer 5.7.7 → 5.8.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- 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/getBrowserLocale.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/useLocale.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/EditedContentContext.cjs +1 -1
- package/dist/cjs/editor/contexts/EditorProvider.cjs +1 -1
- package/dist/cjs/editor/contexts/useCrossFrameMessageListener.cjs +1 -1
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/cjs/solidElement/renderSolidElement.cjs +1 -1
- package/dist/esm/IntlayerNode.mjs +9 -9
- package/dist/esm/UI/ContentSelector.mjs +30 -32
- package/dist/esm/client/IntlayerProvider.mjs +38 -42
- package/dist/esm/client/getBrowserLocale.mjs +41 -42
- package/dist/esm/client/useDictionary.mjs +9 -10
- package/dist/esm/client/useDictionaryAsync.mjs +8 -9
- package/dist/esm/client/useDictionaryDynamic.mjs +11 -12
- package/dist/esm/client/useIntlayer.mjs +8 -8
- package/dist/esm/client/useLocale.mjs +18 -19
- package/dist/esm/editor/ContentSelectorWrapper.mjs +22 -25
- package/dist/esm/editor/IntlayerEditorProvider.mjs +19 -20
- package/dist/esm/editor/contexts/CommunicatorContext.mjs +16 -16
- package/dist/esm/editor/contexts/EditedContentContext.mjs +81 -85
- package/dist/esm/editor/contexts/EditorProvider.mjs +7 -7
- package/dist/esm/editor/contexts/useCrossFrameMessageListener.mjs +16 -16
- package/dist/esm/plugins.mjs +9 -9
- package/dist/esm/solidElement/renderSolidElement.mjs +13 -14
- package/dist/web-Ch-xTpJg.js +1 -0
- package/dist/web-mv0y5CK4.mjs +567 -0
- package/package.json +14 -14
- package/dist/web-BFg6-54-.mjs +0 -443
- package/dist/web-qH6jV2Kc.js +0 -1
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useContext as
|
|
3
|
-
import { IntlayerClientContext as
|
|
4
|
-
import { useDictionary as
|
|
5
|
-
import { useLoadDynamic as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
n[o]()
|
|
1
|
+
import c from "@intlayer/config/built";
|
|
2
|
+
import { useContext as l } from "solid-js";
|
|
3
|
+
import { IntlayerClientContext as m } from "./IntlayerProvider.mjs";
|
|
4
|
+
import { useDictionary as s } from "./useDictionary.mjs";
|
|
5
|
+
import { useLoadDynamic as u } from "./useLoadDynamic.mjs";
|
|
6
|
+
const L = (t, n, r) => {
|
|
7
|
+
const { locale: i } = l(m), e = c?.internationalization.defaultLocale, o = r ?? i() ?? e, a = u(
|
|
8
|
+
`${String(n)}.${o}`,
|
|
9
|
+
t[o]()
|
|
11
10
|
);
|
|
12
|
-
return
|
|
11
|
+
return s(a, o);
|
|
13
12
|
};
|
|
14
13
|
export {
|
|
15
|
-
|
|
14
|
+
L as useDictionaryDynamic
|
|
16
15
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useContext as n, createMemo as
|
|
2
|
-
import { getIntlayer as
|
|
3
|
-
import { IntlayerClientContext as
|
|
4
|
-
const p = (t,
|
|
5
|
-
const
|
|
6
|
-
return
|
|
7
|
-
const
|
|
8
|
-
return
|
|
1
|
+
import { useContext as n, createMemo as c } from "solid-js";
|
|
2
|
+
import { getIntlayer as l } from "../getIntlayer.mjs";
|
|
3
|
+
import { IntlayerClientContext as a } from "./IntlayerProvider.mjs";
|
|
4
|
+
const p = (t, e) => {
|
|
5
|
+
const o = n(a);
|
|
6
|
+
return c(() => {
|
|
7
|
+
const r = o?.locale();
|
|
8
|
+
return l(t, e ?? r);
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useContext as
|
|
3
|
-
import { IntlayerClientContext as
|
|
4
|
-
import { useLocaleCookie as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
console.error(`Locale ${t} is not available`);
|
|
1
|
+
import n from "@intlayer/config/built";
|
|
2
|
+
import { useContext as l, createEffect as s } from "solid-js";
|
|
3
|
+
import { IntlayerClientContext as f } from "./IntlayerProvider.mjs";
|
|
4
|
+
import { useLocaleCookie as m } from "./useLocaleCookie.mjs";
|
|
5
|
+
const C = ({ onLocaleChange: e } = {}) => {
|
|
6
|
+
const { defaultLocale: c, locales: r } = n?.internationalization ?? {}, t = l(f), { setLocaleCookie: a } = m(), i = (o) => {
|
|
7
|
+
if (!r?.map(String).includes(o)) {
|
|
8
|
+
console.error(`Locale ${o} is not available`);
|
|
10
9
|
return;
|
|
11
10
|
}
|
|
12
|
-
|
|
11
|
+
t?.setLocale(o), a(o), e?.(o);
|
|
13
12
|
};
|
|
14
|
-
return
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
o
|
|
13
|
+
return s(() => {
|
|
14
|
+
if (e && t?.locale) {
|
|
15
|
+
const o = t.locale();
|
|
16
|
+
e(o);
|
|
18
17
|
}
|
|
19
18
|
}), {
|
|
20
|
-
locale:
|
|
19
|
+
locale: t?.locale,
|
|
21
20
|
// Current locale (signal accessor)
|
|
22
|
-
defaultLocale:
|
|
21
|
+
defaultLocale: c,
|
|
23
22
|
// Principal locale defined in config
|
|
24
|
-
availableLocales:
|
|
23
|
+
availableLocales: r,
|
|
25
24
|
// List of the available locales defined in config
|
|
26
|
-
setLocale:
|
|
25
|
+
setLocale: i
|
|
27
26
|
// Function to set the locale
|
|
28
27
|
};
|
|
29
28
|
};
|
|
30
29
|
export {
|
|
31
|
-
|
|
30
|
+
C as useLocale
|
|
32
31
|
};
|
|
@@ -1,51 +1,48 @@
|
|
|
1
1
|
import { isSameKeyPath as c } from "@intlayer/core";
|
|
2
|
-
import { createComponent as o, mergeProps as
|
|
2
|
+
import { createComponent as o, mergeProps as m, createMemo as a } from "solid-js";
|
|
3
3
|
import "@intlayer/config/built";
|
|
4
4
|
import "@intlayer/config/client";
|
|
5
|
-
import { useIntlayerContext as
|
|
5
|
+
import { useIntlayerContext as d } from "../client/IntlayerProvider.mjs";
|
|
6
6
|
import "@intlayer/editor";
|
|
7
7
|
import "./contexts/ConfigurationContext.mjs";
|
|
8
8
|
import "./contexts/DictionariesRecordContext.mjs";
|
|
9
9
|
import "./contexts/EditedContentContext.mjs";
|
|
10
|
-
import { useEditorEnabled as
|
|
10
|
+
import { useEditorEnabled as l } from "./contexts/EditorEnabledContext.mjs";
|
|
11
11
|
import "./contexts/CommunicatorContext.mjs";
|
|
12
|
-
import { useFocusDictionary as
|
|
12
|
+
import { useFocusDictionary as s } from "./contexts/FocusDictionaryContext.mjs";
|
|
13
13
|
import "../markdown/MarkdownProvider.mjs";
|
|
14
14
|
import "../client/useLocaleCookie.mjs";
|
|
15
15
|
import "../client/useLocaleBase.mjs";
|
|
16
|
-
import { ContentSelector as
|
|
17
|
-
const
|
|
16
|
+
import { ContentSelector as y } from "../UI/ContentSelector.mjs";
|
|
17
|
+
const h = (e) => {
|
|
18
18
|
const {
|
|
19
|
-
focusedContent:
|
|
19
|
+
focusedContent: t,
|
|
20
20
|
setFocusedContent: r
|
|
21
|
-
} =
|
|
22
|
-
dictionaryKey:
|
|
23
|
-
keyPath:
|
|
24
|
-
}),
|
|
25
|
-
|
|
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;
|
|
27
|
-
});
|
|
28
|
-
return o(s, {
|
|
21
|
+
} = s(), n = () => r({
|
|
22
|
+
dictionaryKey: e.dictionaryKey,
|
|
23
|
+
keyPath: e.keyPath
|
|
24
|
+
}), i = a(() => (t?.dictionaryKey === e.dictionaryKey && (t?.keyPath?.length ?? 0) > 0 && c(t?.keyPath ?? [], e.keyPath)) ?? !1);
|
|
25
|
+
return o(y, {
|
|
29
26
|
onPress: n,
|
|
30
27
|
get isSelecting() {
|
|
31
|
-
return
|
|
28
|
+
return i();
|
|
32
29
|
},
|
|
33
30
|
get children() {
|
|
34
|
-
return
|
|
31
|
+
return e.children;
|
|
35
32
|
}
|
|
36
33
|
});
|
|
37
|
-
},
|
|
34
|
+
}, R = (e) => {
|
|
38
35
|
const {
|
|
39
|
-
enabled:
|
|
40
|
-
} =
|
|
36
|
+
enabled: t
|
|
37
|
+
} = l(), {
|
|
41
38
|
disableEditor: r
|
|
42
|
-
} =
|
|
43
|
-
return
|
|
39
|
+
} = d();
|
|
40
|
+
return t() && !r ? o(h, m(e, {
|
|
44
41
|
get children() {
|
|
45
|
-
return
|
|
42
|
+
return e.children;
|
|
46
43
|
}
|
|
47
|
-
})) :
|
|
44
|
+
})) : e.children;
|
|
48
45
|
};
|
|
49
46
|
export {
|
|
50
|
-
|
|
47
|
+
R as ContentSelectorRenderer
|
|
51
48
|
};
|
|
@@ -1,51 +1,50 @@
|
|
|
1
|
-
import { m } from "../../web-
|
|
2
|
-
import
|
|
1
|
+
import { m as n } from "../../web-mv0y5CK4.mjs";
|
|
2
|
+
import i from "@intlayer/config/built";
|
|
3
3
|
import "@intlayer/editor";
|
|
4
4
|
import "./contexts/ConfigurationContext.mjs";
|
|
5
5
|
import "./contexts/DictionariesRecordContext.mjs";
|
|
6
6
|
import "./contexts/EditedContentContext.mjs";
|
|
7
|
-
import { useEditorEnabled as
|
|
8
|
-
import { EditorProvider as
|
|
7
|
+
import { useEditorEnabled as s } from "./contexts/EditorEnabledContext.mjs";
|
|
8
|
+
import { EditorProvider as m } from "./contexts/EditorProvider.mjs";
|
|
9
9
|
import "./contexts/FocusDictionaryContext.mjs";
|
|
10
10
|
import { createComponent as e } from "solid-js";
|
|
11
11
|
import "./contexts/CommunicatorContext.mjs";
|
|
12
|
-
import { useCrossURLPathSetter as
|
|
13
|
-
import { useIframeClickInterceptor as
|
|
14
|
-
const
|
|
12
|
+
import { useCrossURLPathSetter as p } from "./contexts/useCrossURLPathState.mjs";
|
|
13
|
+
import { useIframeClickInterceptor as d } from "./contexts/useIframeClickInterceptor.mjs";
|
|
14
|
+
const a = () => (p(), d(), []), {
|
|
15
15
|
editor: o
|
|
16
|
-
} =
|
|
16
|
+
} = i, f = () => {
|
|
17
17
|
const {
|
|
18
18
|
enabled: r
|
|
19
|
-
} =
|
|
20
|
-
return r() ? e(
|
|
21
|
-
},
|
|
19
|
+
} = s();
|
|
20
|
+
return r() ? e(a, {}) : [];
|
|
21
|
+
}, k = (r) => e(m, {
|
|
22
22
|
postMessage: (t) => {
|
|
23
|
-
|
|
24
|
-
typeof window > "u" || !(window.self !== window.top) || (o.applicationURL.length > 0 && (window == null || window.postMessage(
|
|
23
|
+
typeof window > "u" || !(window.self !== window.top) || (o.applicationURL.length > 0 && window?.postMessage(
|
|
25
24
|
t,
|
|
26
25
|
// Use to restrict the origin of the editor for security reasons.
|
|
27
26
|
// Correspond to the current application URL to synchronize the locales states.
|
|
28
27
|
o.applicationURL
|
|
29
|
-
)
|
|
28
|
+
), o.editorURL.length > 0 && window.parent?.postMessage(
|
|
30
29
|
t,
|
|
31
30
|
// Use to restrict the origin of the editor for security reasons.
|
|
32
31
|
// Correspond to the editor URL to synchronize the locales states.
|
|
33
32
|
o.editorURL
|
|
34
|
-
)
|
|
33
|
+
), o.cmsURL.length > 0 && window.parent?.postMessage(
|
|
35
34
|
t,
|
|
36
35
|
// Use to restrict the origin of the CMS for security reasons.
|
|
37
36
|
// Correspond to the CMS URL.
|
|
38
37
|
o.cmsURL
|
|
39
|
-
))
|
|
38
|
+
));
|
|
40
39
|
},
|
|
41
40
|
get allowedOrigins() {
|
|
42
|
-
return [o
|
|
41
|
+
return [o?.editorURL, o?.cmsURL, o?.applicationURL];
|
|
43
42
|
},
|
|
44
|
-
configuration:
|
|
43
|
+
configuration: i,
|
|
45
44
|
get children() {
|
|
46
|
-
return [e(
|
|
45
|
+
return [e(f, {}), n(() => r.children)];
|
|
47
46
|
}
|
|
48
47
|
});
|
|
49
48
|
export {
|
|
50
|
-
|
|
49
|
+
k as IntlayerEditorProvider
|
|
51
50
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import s from "@intlayer/config/built";
|
|
2
|
-
import { createContext as
|
|
3
|
-
const
|
|
2
|
+
import { createContext as i, useContext as c, createMemo as a, createComponent as x } from "solid-js";
|
|
3
|
+
const d = () => "xxxx-xxxx-4xxx-yxxx".replace(/[xy]/g, function(e) {
|
|
4
4
|
const t = Math.random() * 16 | 0;
|
|
5
|
-
return (
|
|
5
|
+
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
6
6
|
}), {
|
|
7
|
-
editor:
|
|
8
|
-
} = s, r =
|
|
7
|
+
editor: o
|
|
8
|
+
} = s, r = i({
|
|
9
9
|
postMessage: () => null,
|
|
10
|
-
allowedOrigins: [
|
|
10
|
+
allowedOrigins: [o?.applicationURL, o?.editorURL, o?.cmsURL],
|
|
11
11
|
senderId: ""
|
|
12
|
-
}),
|
|
13
|
-
const t =
|
|
14
|
-
postMessage:
|
|
15
|
-
allowedOrigins:
|
|
12
|
+
}), m = (e) => {
|
|
13
|
+
const t = d(), n = a(() => ({
|
|
14
|
+
postMessage: e.postMessage,
|
|
15
|
+
allowedOrigins: e.allowedOrigins,
|
|
16
16
|
senderId: t
|
|
17
17
|
}));
|
|
18
|
-
return
|
|
18
|
+
return x(r.Provider, {
|
|
19
19
|
get value() {
|
|
20
|
-
return
|
|
20
|
+
return n();
|
|
21
21
|
},
|
|
22
22
|
get children() {
|
|
23
|
-
return
|
|
23
|
+
return e.children;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
},
|
|
26
|
+
}, g = () => c(r);
|
|
27
27
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
m as CommunicatorProvider,
|
|
29
|
+
g as useCommunicator
|
|
30
30
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { getContentNodeByKeyPath as
|
|
2
|
-
import { MessageKey as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { useDictionariesRecord as
|
|
5
|
-
import { useCrossFrameMessageListener as
|
|
6
|
-
import { useCrossFrameState as
|
|
7
|
-
const
|
|
1
|
+
import { getContentNodeByKeyPath as m, renameContentNodeByKeyPath as k, editDictionaryByKeyPath as B } from "@intlayer/core";
|
|
2
|
+
import { MessageKey as f } from "@intlayer/editor";
|
|
3
|
+
import { createContext as h, useContext as T, createComponent as g } from "solid-js";
|
|
4
|
+
import { useDictionariesRecord as H } from "./DictionariesRecordContext.mjs";
|
|
5
|
+
import { useCrossFrameMessageListener as _ } from "./useCrossFrameMessageListener.mjs";
|
|
6
|
+
import { useCrossFrameState as Y } from "./useCrossFrameState.mjs";
|
|
7
|
+
const x = h(void 0), J = (c) => _(`${f.INTLAYER_EDITED_CONTENT_CHANGED}/post`, c), Q = (c) => _(`${f.INTLAYER_EDITED_CONTENT_CHANGED}/get`, c), A = h(void 0), U = (c) => {
|
|
8
8
|
const {
|
|
9
|
-
localeDictionaries:
|
|
10
|
-
} =
|
|
9
|
+
localeDictionaries: r
|
|
10
|
+
} = H(), [D, s] = Y(f.INTLAYER_EDITED_CONTENT_CHANGED), p = (t) => {
|
|
11
11
|
if (typeof t == "function")
|
|
12
|
-
|
|
13
|
-
const n = e
|
|
12
|
+
s((e) => {
|
|
13
|
+
const n = e?.[Object.keys(e || {})[0]], o = t(n);
|
|
14
14
|
return {
|
|
15
15
|
...e,
|
|
16
16
|
[o.key]: o
|
|
@@ -18,130 +18,126 @@ const P = _(void 0), X = (r) => A(`${N.INTLAYER_EDITED_CONTENT_CHANGED}/post`, r
|
|
|
18
18
|
});
|
|
19
19
|
else {
|
|
20
20
|
const e = t;
|
|
21
|
-
|
|
21
|
+
s((n) => ({
|
|
22
22
|
...n,
|
|
23
23
|
[e.key]: e
|
|
24
24
|
}));
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, P = (t, e) => {
|
|
27
|
+
s((n) => ({
|
|
28
28
|
...n,
|
|
29
29
|
[t]: {
|
|
30
|
-
...n
|
|
30
|
+
...n?.[t],
|
|
31
31
|
content: e
|
|
32
32
|
}
|
|
33
33
|
}));
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
let d = n;
|
|
34
|
+
}, I = (t, e, n = [], o = !0) => {
|
|
35
|
+
s((d) => {
|
|
36
|
+
const C = r[t]?.content, u = structuredClone(d?.[t]?.content ?? C);
|
|
37
|
+
let i = n;
|
|
39
38
|
if (!o) {
|
|
40
|
-
let
|
|
41
|
-
const
|
|
42
|
-
let
|
|
43
|
-
for (; typeof
|
|
44
|
-
|
|
45
|
-
...
|
|
46
|
-
key:
|
|
39
|
+
let l = 0;
|
|
40
|
+
const b = n.slice(0, -1), a = n[n.length - 1];
|
|
41
|
+
let N = a.key;
|
|
42
|
+
for (; typeof m(u, i) < "u"; )
|
|
43
|
+
l++, N = l === 0 ? a.key : `${a.key} (${l})`, i = [...b, {
|
|
44
|
+
...a,
|
|
45
|
+
key: N
|
|
47
46
|
}];
|
|
48
47
|
}
|
|
49
|
-
const
|
|
48
|
+
const E = B(u, i, e);
|
|
50
49
|
return {
|
|
51
|
-
...
|
|
50
|
+
...d,
|
|
52
51
|
[t]: {
|
|
53
|
-
...
|
|
54
|
-
content:
|
|
52
|
+
...d?.[t],
|
|
53
|
+
content: E
|
|
55
54
|
}
|
|
56
55
|
};
|
|
57
56
|
});
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const s = (d = E[t]) == null ? void 0 : d.content, i = structuredClone(((a = o == null ? void 0 : o[t]) == null ? void 0 : a.content) ?? s), C = Y(i, e, n);
|
|
57
|
+
}, w = (t, e, n = []) => {
|
|
58
|
+
s((o) => {
|
|
59
|
+
const d = r[t]?.content, C = structuredClone(o?.[t]?.content ?? d), u = k(C, e, n);
|
|
62
60
|
return {
|
|
63
61
|
...o,
|
|
64
62
|
[t]: {
|
|
65
|
-
...o
|
|
66
|
-
content:
|
|
63
|
+
...o?.[t],
|
|
64
|
+
content: u
|
|
67
65
|
}
|
|
68
66
|
};
|
|
69
67
|
});
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
u && typeof u == "object" && d in u && delete u[d];
|
|
68
|
+
}, S = (t, e) => {
|
|
69
|
+
s((n) => {
|
|
70
|
+
const o = r[t]?.content, d = structuredClone(n?.[t]?.content ?? o), C = structuredClone(d), u = e.slice(0, -1), i = e[e.length - 1]?.key;
|
|
71
|
+
if (i) {
|
|
72
|
+
const E = m(C, u);
|
|
73
|
+
E && typeof E == "object" && i in E && delete E[i];
|
|
77
74
|
}
|
|
78
75
|
return {
|
|
79
76
|
...n,
|
|
80
77
|
[t]: {
|
|
81
|
-
...n
|
|
82
|
-
content:
|
|
78
|
+
...n?.[t],
|
|
79
|
+
content: C
|
|
83
80
|
}
|
|
84
81
|
};
|
|
85
82
|
});
|
|
86
|
-
},
|
|
87
|
-
|
|
83
|
+
}, F = (t) => {
|
|
84
|
+
s((e) => {
|
|
88
85
|
const n = {
|
|
89
86
|
...e
|
|
90
87
|
};
|
|
91
88
|
return delete n[t], n;
|
|
92
89
|
});
|
|
93
|
-
},
|
|
94
|
-
|
|
90
|
+
}, G = (t) => {
|
|
91
|
+
s((e) => ({
|
|
95
92
|
...e,
|
|
96
93
|
[t]: {
|
|
97
|
-
...e
|
|
94
|
+
...e?.[t],
|
|
98
95
|
content: {}
|
|
99
96
|
}
|
|
100
97
|
}));
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
getEditedContentValue: b
|
|
98
|
+
}, L = () => {
|
|
99
|
+
s({});
|
|
100
|
+
}, O = (t, e) => {
|
|
101
|
+
const n = r[t]?.content, o = D()?.[t]?.content ?? n;
|
|
102
|
+
return m(o, e);
|
|
103
|
+
}, R = {
|
|
104
|
+
editedContent: D()
|
|
105
|
+
}, $ = {
|
|
106
|
+
setEditedContentState: s,
|
|
107
|
+
setEditedDictionary: p,
|
|
108
|
+
setEditedContent: P,
|
|
109
|
+
addEditedContent: I,
|
|
110
|
+
renameEditedContent: w,
|
|
111
|
+
removeEditedContent: S,
|
|
112
|
+
restoreEditedContent: F,
|
|
113
|
+
clearEditedDictionaryContent: G,
|
|
114
|
+
clearEditedContent: L,
|
|
115
|
+
getEditedContentValue: O
|
|
120
116
|
};
|
|
121
|
-
return
|
|
122
|
-
value:
|
|
117
|
+
return g(x.Provider, {
|
|
118
|
+
value: R,
|
|
123
119
|
get children() {
|
|
124
|
-
return
|
|
125
|
-
value:
|
|
120
|
+
return g(A.Provider, {
|
|
121
|
+
value: $,
|
|
126
122
|
get children() {
|
|
127
|
-
return
|
|
123
|
+
return c.children;
|
|
128
124
|
}
|
|
129
125
|
});
|
|
130
126
|
}
|
|
131
127
|
});
|
|
132
|
-
},
|
|
133
|
-
const
|
|
134
|
-
if (!
|
|
128
|
+
}, j = () => T(A), X = () => {
|
|
129
|
+
const c = j(), r = T(x);
|
|
130
|
+
if (!r)
|
|
135
131
|
throw new Error("useEditedContent must be used within a EditedContentProvider");
|
|
136
132
|
return {
|
|
137
|
-
...
|
|
138
|
-
...
|
|
133
|
+
...r,
|
|
134
|
+
...c
|
|
139
135
|
};
|
|
140
136
|
};
|
|
141
137
|
export {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
138
|
+
U as EditedContentProvider,
|
|
139
|
+
X as useEditedContent,
|
|
140
|
+
j as useEditedContentActions,
|
|
141
|
+
Q as useGetEditedContentState,
|
|
142
|
+
J as usePostEditedContentState
|
|
147
143
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { m as
|
|
2
|
-
import { createComponent as r, createSignal as d, createEffect as
|
|
1
|
+
import { m as i } from "../../../web-mv0y5CK4.mjs";
|
|
2
|
+
import { createComponent as r, createSignal as d, createEffect as o } from "solid-js";
|
|
3
3
|
import { CommunicatorProvider as c } from "./CommunicatorContext.mjs";
|
|
4
4
|
import { ConfigurationProvider as a } from "./ConfigurationContext.mjs";
|
|
5
5
|
import { DictionariesRecordProvider as l } from "./DictionariesRecordContext.mjs";
|
|
@@ -8,7 +8,7 @@ import { EditorEnabledProvider as g, useGetEditorEnabledState as f, useEditorEna
|
|
|
8
8
|
import { FocusDictionaryProvider as h } from "./FocusDictionaryContext.mjs";
|
|
9
9
|
const E = (e) => {
|
|
10
10
|
const t = u();
|
|
11
|
-
return
|
|
11
|
+
return o(() => {
|
|
12
12
|
t();
|
|
13
13
|
}), r(l, {
|
|
14
14
|
get children() {
|
|
@@ -27,14 +27,14 @@ const E = (e) => {
|
|
|
27
27
|
const t = f(), {
|
|
28
28
|
enabled: n
|
|
29
29
|
} = s();
|
|
30
|
-
return
|
|
30
|
+
return o(() => {
|
|
31
31
|
n() || t();
|
|
32
|
-
}),
|
|
32
|
+
}), i(() => i(() => !!n())() ? e.children : e.fallback);
|
|
33
33
|
}, v = (e) => {
|
|
34
34
|
const [t, n] = d(!1);
|
|
35
|
-
return
|
|
35
|
+
return o(() => {
|
|
36
36
|
n(window.self !== window.top);
|
|
37
|
-
}),
|
|
37
|
+
}), i(() => i(() => !!t())() ? e.children : e.fallback);
|
|
38
38
|
}, G = (e) => r(g, {
|
|
39
39
|
get children() {
|
|
40
40
|
return r(a, {
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { compareUrls as c } from "@intlayer/editor";
|
|
2
|
-
import { onMount as f, onCleanup as
|
|
3
|
-
import { useCommunicator as
|
|
4
|
-
const
|
|
5
|
-
const t =
|
|
2
|
+
import { onMount as f, onCleanup as g } from "solid-js";
|
|
3
|
+
import { useCommunicator as w } from "./CommunicatorContext.mjs";
|
|
4
|
+
const v = (r, o, l) => {
|
|
5
|
+
const t = w();
|
|
6
6
|
if (!t)
|
|
7
7
|
throw new Error("useCrossFrameMessageListener must be used within a CommunicatorProvider");
|
|
8
8
|
const {
|
|
9
|
-
allowedOrigins:
|
|
10
|
-
postMessage:
|
|
9
|
+
allowedOrigins: s,
|
|
10
|
+
postMessage: i,
|
|
11
11
|
senderId: n
|
|
12
12
|
} = t;
|
|
13
13
|
return f(() => {
|
|
14
14
|
if (o) {
|
|
15
|
-
const
|
|
15
|
+
const e = (a) => {
|
|
16
16
|
const {
|
|
17
|
-
type:
|
|
18
|
-
data:
|
|
19
|
-
senderId:
|
|
17
|
+
type: m,
|
|
18
|
+
data: d,
|
|
19
|
+
senderId: p
|
|
20
20
|
} = a.data;
|
|
21
|
-
|
|
21
|
+
m === r && p !== n && (typeof s > "u" || s?.some((u) => c(u, a.origin)) || s?.includes("*")) && o(d);
|
|
22
22
|
};
|
|
23
|
-
window.addEventListener("message",
|
|
23
|
+
window.addEventListener("message", e), g(() => window.removeEventListener("message", e));
|
|
24
24
|
}
|
|
25
|
-
}), (
|
|
26
|
-
|
|
25
|
+
}), (e) => {
|
|
26
|
+
i({
|
|
27
27
|
type: r,
|
|
28
|
-
data:
|
|
28
|
+
data: e,
|
|
29
29
|
senderId: n
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
v as useCrossFrameMessageListener
|
|
35
35
|
};
|