solid-intlayer 8.3.0 → 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,35 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
29
|
-
senderId: i
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
export {
|
|
34
|
-
h as useCrossFrameMessageListener
|
|
1
|
+
import { useCommunicator as e } from "./CommunicatorContext.mjs";
|
|
2
|
+
import { onCleanup as t, onMount as n } from "solid-js";
|
|
3
|
+
import { compareUrls as r } from "@intlayer/editor";
|
|
4
|
+
//#region src/editor/contexts/useCrossFrameMessageListener.tsx
|
|
5
|
+
var i = (i, a) => {
|
|
6
|
+
let o = e();
|
|
7
|
+
if (!o) throw Error("useCrossFrameMessageListener must be used within a CommunicatorProvider");
|
|
8
|
+
let { allowedOrigins: s, postMessage: c, senderId: l } = o;
|
|
9
|
+
return n(() => {
|
|
10
|
+
if (a) {
|
|
11
|
+
let e = (e) => {
|
|
12
|
+
let { type: t, data: n, senderId: o } = e.data;
|
|
13
|
+
t === i && o !== l && (s === void 0 || s?.filter((e) => ![
|
|
14
|
+
null,
|
|
15
|
+
void 0,
|
|
16
|
+
"",
|
|
17
|
+
"*"
|
|
18
|
+
].includes(e)).some((t) => r(t, e.origin)) || s?.includes("*")) && a(n);
|
|
19
|
+
};
|
|
20
|
+
window.addEventListener("message", e), t(() => window.removeEventListener("message", e));
|
|
21
|
+
}
|
|
22
|
+
}), (e) => {
|
|
23
|
+
c({
|
|
24
|
+
type: i,
|
|
25
|
+
data: e,
|
|
26
|
+
senderId: l
|
|
27
|
+
});
|
|
28
|
+
};
|
|
35
29
|
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { i as useCrossFrameMessageListener };
|
|
@@ -1,57 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
return a(
|
|
45
|
-
`${e}/get`,
|
|
46
|
-
// Only activate the state listener if the `emit` option is true
|
|
47
|
-
f ? g : void 0
|
|
48
|
-
), S(() => {
|
|
49
|
-
c && typeof t == "function" && typeof r() > "u" && t({
|
|
50
|
-
type: `${e}/get`,
|
|
51
|
-
senderId: n
|
|
52
|
-
});
|
|
53
|
-
}), [r, y, d];
|
|
54
|
-
};
|
|
55
|
-
export {
|
|
56
|
-
w as useCrossFrameState
|
|
1
|
+
import { useCommunicator as e } from "./CommunicatorContext.mjs";
|
|
2
|
+
import { useCrossFrameMessageListener as t } from "./useCrossFrameMessageListener.mjs";
|
|
3
|
+
import { createEffect as n, createSignal as r } from "solid-js";
|
|
4
|
+
//#region src/editor/contexts/useCrossFrameState.tsx
|
|
5
|
+
var i = (i, a, o) => {
|
|
6
|
+
let { postMessage: s, senderId: c } = e() ?? {}, { emit: l, receive: u } = o ?? {
|
|
7
|
+
emit: !0,
|
|
8
|
+
receive: !0
|
|
9
|
+
}, [d, f] = r(typeof a == "function" ? a() : a);
|
|
10
|
+
return t(`${i}/post`, u ? (e) => {
|
|
11
|
+
f(() => e);
|
|
12
|
+
} : void 0), t(`${i}/get`, l ? (e, t) => {
|
|
13
|
+
l && typeof s == "function" && t !== c && d() !== void 0 && s({
|
|
14
|
+
type: `${i}/post`,
|
|
15
|
+
data: d(),
|
|
16
|
+
senderId: c
|
|
17
|
+
});
|
|
18
|
+
} : void 0), n(() => {
|
|
19
|
+
u && typeof s == "function" && d() === void 0 && s({
|
|
20
|
+
type: `${i}/get`,
|
|
21
|
+
senderId: c
|
|
22
|
+
});
|
|
23
|
+
}), [
|
|
24
|
+
d,
|
|
25
|
+
(e) => {
|
|
26
|
+
f((t) => {
|
|
27
|
+
let n = typeof e == "function" ? e(t) : e;
|
|
28
|
+
return l && typeof s == "function" && n !== void 0 && s({
|
|
29
|
+
type: `${i}/post`,
|
|
30
|
+
data: n,
|
|
31
|
+
senderId: c
|
|
32
|
+
}), n;
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
() => {
|
|
36
|
+
typeof s == "function" && s({
|
|
37
|
+
type: `${i}/post`,
|
|
38
|
+
data: d(),
|
|
39
|
+
senderId: c
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
];
|
|
57
43
|
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { i as useCrossFrameState };
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
E as useCrossURLPathSetter,
|
|
24
|
-
v as useCrossURLPathState
|
|
1
|
+
import { useCrossFrameState as e } from "./useCrossFrameState.mjs";
|
|
2
|
+
import { onCleanup as t, onMount as n } from "solid-js";
|
|
3
|
+
import { MessageKey as r } from "@intlayer/editor";
|
|
4
|
+
//#region src/editor/contexts/useCrossURLPathState.tsx
|
|
5
|
+
var i = (t, n) => e(r.INTLAYER_URL_CHANGE, t, n), a = (e) => {
|
|
6
|
+
let r = i(e, {
|
|
7
|
+
emit: !0,
|
|
8
|
+
receive: !1
|
|
9
|
+
}), [a, o] = r;
|
|
10
|
+
return n(() => {
|
|
11
|
+
let e = history.pushState, n = history.replaceState, r = (e) => function(...t) {
|
|
12
|
+
e.apply(this, t), window.dispatchEvent(new Event("locationchange"));
|
|
13
|
+
};
|
|
14
|
+
history.pushState = r(e), history.replaceState = r(n);
|
|
15
|
+
let i = () => {
|
|
16
|
+
o(window.location.pathname);
|
|
17
|
+
};
|
|
18
|
+
window.addEventListener("locationchange", i), window.addEventListener("popstate", i), window.addEventListener("hashchange", i), window.addEventListener("load", i), i(), t(() => {
|
|
19
|
+
window.removeEventListener("locationchange", i), window.removeEventListener("popstate", i), window.removeEventListener("hashchange", i), window.removeEventListener("load", i), history.pushState = e, history.replaceState = n;
|
|
20
|
+
});
|
|
21
|
+
}), r;
|
|
25
22
|
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { a as useCrossURLPathSetter, i as useCrossURLPathState };
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
1
|
+
import { useCrossFrameMessageListener as e } from "./useCrossFrameMessageListener.mjs";
|
|
2
|
+
import { onCleanup as t, onMount as n } from "solid-js";
|
|
3
|
+
import { MessageKey as r, mergeIframeClick as i } from "@intlayer/editor";
|
|
4
|
+
//#region src/editor/contexts/useIframeClickInterceptor.tsx
|
|
5
|
+
var a = () => {
|
|
6
|
+
let i = e(r.INTLAYER_IFRAME_CLICKED);
|
|
7
|
+
n(() => {
|
|
8
|
+
let e = (e) => {
|
|
9
|
+
i();
|
|
10
|
+
};
|
|
11
|
+
document.addEventListener("mousedown", e), t(() => {
|
|
12
|
+
document.removeEventListener("mousedown", e);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
}, o = () => e(r.INTLAYER_IFRAME_CLICKED, i);
|
|
16
|
+
//#endregion
|
|
17
|
+
export { a as useIframeClickInterceptor, o as useIframeClickMerger };
|
|
@@ -1,29 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "@intlayer/
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
children: t
|
|
15
|
-
}) => {
|
|
16
|
-
const o = i();
|
|
17
|
-
return o ? o.getEditedContentValue(e, n) ?? t : t;
|
|
18
|
-
}, V = (e) => {
|
|
19
|
-
const n = d(e);
|
|
20
|
-
if (typeof n == "object") {
|
|
21
|
-
const t = r(n, e, e.locale);
|
|
22
|
-
return typeof t != "string" ? (console.error(`Incorrect edited content format. Content type: ${typeof t}. Expected string. Value ${JSON.stringify(t)}`), e.children) : t;
|
|
23
|
-
}
|
|
24
|
-
return n;
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
V as EditedContentRenderer,
|
|
28
|
-
d as useEditedContentRenderer
|
|
1
|
+
import { useEditedContentActions as e } from "./contexts/EditedContentContext.mjs";
|
|
2
|
+
import { getContent as t } from "@intlayer/core/interpreter";
|
|
3
|
+
//#region src/editor/useEditedContentRenderer.tsx
|
|
4
|
+
var n = ({ dictionaryKey: t, keyPath: n, children: r }) => {
|
|
5
|
+
let i = e();
|
|
6
|
+
return i ? i.getEditedContentValue(t, n) ?? r : r;
|
|
7
|
+
}, r = (e) => {
|
|
8
|
+
let r = n(e);
|
|
9
|
+
if (typeof r == "object") {
|
|
10
|
+
let n = t(r, e, e.locale);
|
|
11
|
+
return typeof n == "string" ? n : (console.error(`Incorrect edited content format. Content type: ${typeof n}. Expected string. Value ${JSON.stringify(n)}`), e.children);
|
|
12
|
+
}
|
|
13
|
+
return r;
|
|
29
14
|
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { r as EditedContentRenderer, n as useEditedContentRenderer };
|
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const c = (i, n, o) => {
|
|
4
|
-
const t = [
|
|
5
|
-
r,
|
|
6
|
-
a,
|
|
7
|
-
e,
|
|
8
|
-
g,
|
|
9
|
-
l,
|
|
10
|
-
...o ?? []
|
|
11
|
-
];
|
|
12
|
-
return s(i, n, t);
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
c as getDictionary
|
|
16
|
-
};
|
|
1
|
+
import { t as e } from "../getDictionary-DKdSGWHu.mjs";
|
|
2
|
+
export { e as getDictionary };
|
package/dist/esm/getIntlayer.mjs
CHANGED
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const P = (n, t, s) => {
|
|
4
|
-
const i = [
|
|
5
|
-
a,
|
|
6
|
-
e,
|
|
7
|
-
l,
|
|
8
|
-
o,
|
|
9
|
-
g,
|
|
10
|
-
...s ?? []
|
|
11
|
-
];
|
|
12
|
-
return r(n, t, i);
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
P as getIntlayer
|
|
16
|
-
};
|
|
1
|
+
import { d as e } from "../getDictionary-DKdSGWHu.mjs";
|
|
2
|
+
export { e as getIntlayer };
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { createContext as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
import { createComponent as e } from "solid-js/web";
|
|
2
|
+
import { createContext as t, useContext as n } from "solid-js";
|
|
3
|
+
//#region src/html/HTMLProvider.tsx
|
|
4
|
+
var r = t(), i = () => n(r), a = (t) => e(r.Provider, {
|
|
5
|
+
get value() {
|
|
6
|
+
return { components: t.components };
|
|
7
|
+
},
|
|
8
|
+
get children() {
|
|
9
|
+
return t.children;
|
|
10
|
+
}
|
|
12
11
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
i as useHTMLContext
|
|
16
|
-
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { a as HTMLProvider, i as useHTMLContext };
|
|
@@ -1,52 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, H = ({
|
|
28
|
-
components: e
|
|
29
|
-
} = {}) => {
|
|
30
|
-
const t = y();
|
|
31
|
-
return (n) => M(n, {
|
|
32
|
-
components: {
|
|
33
|
-
...t?.components,
|
|
34
|
-
...e
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}, P = (e) => {
|
|
38
|
-
const t = H({
|
|
39
|
-
components: e.components || e.userComponents
|
|
40
|
-
}), n = () => e.children || e.html || "", o = f(() => u({
|
|
41
|
-
dictionaryKey: e.dictionaryKey,
|
|
42
|
-
keyPath: e.keyPath,
|
|
43
|
-
children: n()
|
|
44
|
-
})), r = () => e.dictionaryKey && e.keyPath && typeof o() == "string" ? o() : n();
|
|
45
|
-
return c(() => t(r()));
|
|
46
|
-
};
|
|
47
|
-
export {
|
|
48
|
-
P as HTMLRenderer,
|
|
49
|
-
C as defaultHTMLComponents,
|
|
50
|
-
M as renderHTML,
|
|
51
|
-
H as useHTMLRenderer
|
|
1
|
+
import { useEditedContentRenderer as e } from "../editor/useEditedContentRenderer.mjs";
|
|
2
|
+
import { useHTMLContext as t } from "./HTMLProvider.mjs";
|
|
3
|
+
import { getHTML as n } from "@intlayer/core/interpreter";
|
|
4
|
+
import { Dynamic as r, createComponent as i, memo as a, mergeProps as o } from "solid-js/web";
|
|
5
|
+
import { HTML_TAGS as s } from "@intlayer/core/transpiler";
|
|
6
|
+
import { createMemo as c } from "solid-js";
|
|
7
|
+
var l = (() => {
|
|
8
|
+
let e = {};
|
|
9
|
+
for (let t of s) e[t] = ({ children: e, ...n }) => i(r, o({ component: t }, n, { children: e }));
|
|
10
|
+
return e;
|
|
11
|
+
})(), u = (e, { components: t } = {}) => n(e, {
|
|
12
|
+
...l,
|
|
13
|
+
...t
|
|
14
|
+
}), d = ({ components: e } = {}) => {
|
|
15
|
+
let n = t();
|
|
16
|
+
return (t) => u(t, { components: {
|
|
17
|
+
...n?.components,
|
|
18
|
+
...e
|
|
19
|
+
} });
|
|
20
|
+
}, f = (t) => {
|
|
21
|
+
let n = d({ components: t.components || t.userComponents }), r = () => t.children || t.html || "", i = c(() => e({
|
|
22
|
+
dictionaryKey: t.dictionaryKey,
|
|
23
|
+
keyPath: t.keyPath,
|
|
24
|
+
children: r()
|
|
25
|
+
})), o = () => t.dictionaryKey && t.keyPath && typeof i() == "string" ? i() : r();
|
|
26
|
+
return a(() => n(o()));
|
|
52
27
|
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { f as HTMLRenderer, l as defaultHTMLComponents, u as renderHTML, d as useHTMLRenderer };
|
package/dist/esm/html/index.mjs
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import { HTMLProvider as
|
|
2
|
-
import { HTMLRenderer as
|
|
3
|
-
export {
|
|
4
|
-
o as HTMLProvider,
|
|
5
|
-
H as HTMLRenderer,
|
|
6
|
-
L as defaultHTMLComponents,
|
|
7
|
-
M as renderHTML,
|
|
8
|
-
n as useHTMLContext,
|
|
9
|
-
T as useHTMLRenderer
|
|
10
|
-
};
|
|
1
|
+
import { HTMLProvider as e, useHTMLContext as t } from "./HTMLProvider.mjs";
|
|
2
|
+
import { HTMLRenderer as n, defaultHTMLComponents as r, renderHTML as i, useHTMLRenderer as a } from "./HTMLRenderer.mjs";
|
|
3
|
+
export { e as HTMLProvider, n as HTMLRenderer, r as defaultHTMLComponents, i as renderHTML, t as useHTMLContext, a as useHTMLRenderer };
|
package/dist/esm/html/types.mjs
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,54 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
import { compileMarkdown as V } from "./markdown/compiler.mjs";
|
|
19
|
-
import { MarkdownProvider as X, useMarkdown as Y } from "./markdown/MarkdownProvider.mjs";
|
|
20
|
-
import { MarkdownRenderer as _ } from "./markdown/MarkdownRenderer.mjs";
|
|
21
|
-
import "solid-js/web";
|
|
22
|
-
export {
|
|
23
|
-
G as HTMLProvider,
|
|
24
|
-
K as HTMLRenderer,
|
|
25
|
-
p as IntlayerClientContext,
|
|
26
|
-
x as IntlayerProvider,
|
|
27
|
-
i as IntlayerProviderContent,
|
|
28
|
-
X as MarkdownProvider,
|
|
29
|
-
_ as MarkdownRenderer,
|
|
30
|
-
V as compileMarkdown,
|
|
31
|
-
n as getBrowserLocale,
|
|
32
|
-
q as getDictionary,
|
|
33
|
-
E as getIntlayer,
|
|
34
|
-
P as localeCookie,
|
|
35
|
-
T as localeInStorage,
|
|
36
|
-
N as renderHTML,
|
|
37
|
-
S as setLocaleCookie,
|
|
38
|
-
B as setLocaleInStorage,
|
|
39
|
-
s as t,
|
|
40
|
-
u as useDictionary,
|
|
41
|
-
y as useDictionaryAsync,
|
|
42
|
-
I as useDictionaryDynamic,
|
|
43
|
-
O as useHTMLRenderer,
|
|
44
|
-
t as useIntl,
|
|
45
|
-
k as useIntlayer,
|
|
46
|
-
f as useIntlayerContext,
|
|
47
|
-
g as useLoadDynamic,
|
|
48
|
-
D as useLocale,
|
|
49
|
-
v as useLocaleBase,
|
|
50
|
-
A as useLocaleCookie,
|
|
51
|
-
U as useLocaleStorage,
|
|
52
|
-
Y as useMarkdown,
|
|
53
|
-
h as useRewriteURL
|
|
54
|
-
};
|
|
1
|
+
import { localeCookie as e, localeInStorage as t, setLocaleCookie as n, setLocaleInStorage as r, useLocaleCookie as i, useLocaleStorage as a } from "./client/useLocaleStorage.mjs";
|
|
2
|
+
import { IntlayerClientContext as o, IntlayerProvider as s, IntlayerProviderContent as c, useIntlayerContext as l } from "./client/IntlayerProvider.mjs";
|
|
3
|
+
import { useIntl as u } from "./client/format/useIntl.mjs";
|
|
4
|
+
import { getBrowserLocale as d } from "./client/getBrowserLocale.mjs";
|
|
5
|
+
import { t as f } from "./client/t.mjs";
|
|
6
|
+
import { d as p, f as m, m as h, p as g, t as _, u as v } from "../getDictionary-DKdSGWHu.mjs";
|
|
7
|
+
import { useLoadDynamic as y } from "./client/useLoadDynamic.mjs";
|
|
8
|
+
import { useLocale as b } from "./client/useLocale.mjs";
|
|
9
|
+
import { useLocaleBase as x } from "./client/useLocaleBase.mjs";
|
|
10
|
+
import { useRewriteURL as S } from "./client/useRewriteURL.mjs";
|
|
11
|
+
import { compileMarkdown as C } from "./markdown/compiler.mjs";
|
|
12
|
+
import { MarkdownProvider as w, useMarkdown as T } from "./markdown/MarkdownProvider.mjs";
|
|
13
|
+
import { MarkdownRenderer as E } from "./markdown/MarkdownRenderer.mjs";
|
|
14
|
+
import { HTMLProvider as D } from "./html/HTMLProvider.mjs";
|
|
15
|
+
import { HTMLRenderer as O, renderHTML as k, useHTMLRenderer as A } from "./html/HTMLRenderer.mjs";
|
|
16
|
+
import "./html/index.mjs";
|
|
17
|
+
export { D as HTMLProvider, O as HTMLRenderer, o as IntlayerClientContext, s as IntlayerProvider, c as IntlayerProviderContent, w as MarkdownProvider, E as MarkdownRenderer, C as compileMarkdown, d as getBrowserLocale, _ as getDictionary, p as getIntlayer, e as localeCookie, t as localeInStorage, k as renderHTML, n as setLocaleCookie, r as setLocaleInStorage, f as t, h as useDictionary, g as useDictionaryAsync, m as useDictionaryDynamic, A as useHTMLRenderer, u as useIntl, v as useIntlayer, l as useIntlayerContext, y as useLoadDynamic, b as useLocale, x as useLocaleBase, i as useLocaleCookie, a as useLocaleStorage, T as useMarkdown, S as useRewriteURL };
|
|
@@ -1,42 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, s = () => {
|
|
33
|
-
const r = i(a);
|
|
34
|
-
if (!r)
|
|
35
|
-
throw new Error("useMarkdown must be used within a MarkdownProvider. To fix this error, wrap your component with <MarkdownProvider>.");
|
|
36
|
-
return r;
|
|
37
|
-
};
|
|
38
|
-
export {
|
|
39
|
-
a as MarkdownContext,
|
|
40
|
-
M as MarkdownProvider,
|
|
41
|
-
s as useMarkdown
|
|
1
|
+
import { compileMarkdown as e } from "./compiler.mjs";
|
|
2
|
+
import { createComponent as t } from "solid-js/web";
|
|
3
|
+
import { createContext as n, useContext as r } from "solid-js";
|
|
4
|
+
//#region src/markdown/MarkdownProvider.tsx
|
|
5
|
+
var i = n(), a = (n) => {
|
|
6
|
+
let r = (t, r, i, a) => n.renderMarkdown ? n.renderMarkdown(t, r, i, a) : e(t, {
|
|
7
|
+
forceBlock: r?.forceBlock ?? n.forceBlock,
|
|
8
|
+
preserveFrontmatter: r?.preserveFrontmatter ?? n.preserveFrontmatter,
|
|
9
|
+
tagfilter: r?.tagfilter ?? n.tagfilter,
|
|
10
|
+
wrapper: a || n.wrapper,
|
|
11
|
+
forceWrapper: !!(a || n.wrapper),
|
|
12
|
+
components: {
|
|
13
|
+
...n.components,
|
|
14
|
+
...i ?? {}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return t(i.Provider, {
|
|
18
|
+
get value() {
|
|
19
|
+
return {
|
|
20
|
+
components: n.components,
|
|
21
|
+
renderMarkdown: r
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
get children() {
|
|
25
|
+
return n.children;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}, o = () => {
|
|
29
|
+
let e = r(i);
|
|
30
|
+
if (!e) throw Error("useMarkdown must be used within a MarkdownProvider. To fix this error, wrap your component with <MarkdownProvider>.");
|
|
31
|
+
return e;
|
|
42
32
|
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { i as MarkdownContext, a as MarkdownProvider, o as useMarkdown };
|