@plitzi/sdk-elements 0.32.24 → 0.33.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/CHANGELOG.md +31 -0
- package/dist/Element/ElementContext.d.ts +7 -0
- package/dist/Element/helpers/isVisible.d.ts +1 -0
- package/dist/Element/helpers/isVisible.mjs +4 -0
- package/dist/Element/hocs/withElement.mjs +86 -78
- package/dist/Element/hooks/useInternalClassName.mjs +21 -20
- package/dist/Element/hooks/useInternalItems.mjs +1 -1
- package/dist/Element/hooks/useRscData.d.ts +4 -3
- package/dist/Element/hooks/useRscData.mjs +15 -10
- package/dist/dataSource/GlobalSources.d.ts +1 -2
- package/dist/dataSource/GlobalSources.mjs +46 -62
- package/dist/elements/advanced/BlockJsx/BlockJsx.mjs +1 -1
- package/dist/elements/basic/Link/Link.mjs +47 -41
- package/dist/elements/basic/RichText/RichText.d.ts +20 -0
- package/dist/elements/basic/RichText/RichText.mjs +30 -0
- package/dist/elements/basic/RichText/Settings.d.ts +7 -0
- package/dist/elements/basic/RichText/Settings.mjs +51 -0
- package/dist/elements/{provider/CollectionContainer → basic/RichText}/index.d.ts +6 -7
- package/dist/elements/{provider/CollectionContainer → basic/RichText}/index.mjs +12 -13
- package/dist/elements/basic/RichText/sanitizeHtml.d.ts +21 -0
- package/dist/elements/basic/RichText/sanitizeHtml.mjs +8 -0
- package/dist/elements/form/FormControl/index.mjs +1 -1
- package/dist/elements/index.d.ts +5 -3
- package/dist/elements/index.mjs +30 -28
- package/dist/elements/internal/Page/Page.mjs +28 -26
- package/dist/elements/provider/ApiContainer/ApiContainer.d.ts +28 -1
- package/dist/elements/provider/ApiContainer/ApiContainer.mjs +201 -86
- package/dist/elements/provider/ApiContainer/Settings.d.ts +15 -3
- package/dist/elements/provider/ApiContainer/Settings.mjs +209 -92
- package/dist/elements/provider/ApiContainer/components/FiltersInput/FiltersInput.d.ts +22 -0
- package/dist/elements/provider/ApiContainer/components/FiltersInput/FiltersInput.mjs +75 -0
- package/dist/elements/provider/ApiContainer/components/FiltersInput/index.d.ts +3 -0
- package/dist/elements/provider/ApiContainer/components/FiltersInput/index.mjs +5 -0
- package/dist/elements/provider/ApiContainer/hooks/useProviderPagination.d.ts +31 -0
- package/dist/elements/provider/ApiContainer/hooks/useProviderPagination.mjs +51 -0
- package/dist/elements/provider/ApiContainer/hooks/useProviderWrite.d.ts +26 -0
- package/dist/elements/provider/ApiContainer/hooks/useProviderWrite.mjs +27 -0
- package/dist/elements/provider/ApiContainer/index.d.ts +8 -0
- package/dist/elements/provider/ApiContainer/index.mjs +9 -1
- package/dist/elements/settings.mjs +32 -30
- package/dist/elements/structure/Pagination/Pagination.d.ts +41 -0
- package/dist/elements/structure/Pagination/Pagination.mjs +83 -0
- package/dist/elements/structure/Pagination/Settings.d.ts +12 -0
- package/dist/elements/structure/Pagination/Settings.mjs +85 -0
- package/dist/elements/structure/Pagination/buildPageWindow.d.ts +9 -0
- package/dist/elements/structure/Pagination/buildPageWindow.mjs +8 -0
- package/dist/elements/structure/Pagination/index.d.ts +67 -0
- package/dist/elements/structure/Pagination/index.mjs +59 -0
- package/dist/index.d.ts +130 -57
- package/dist/index.mjs +32 -30
- package/package.json +76 -32
- package/dist/elements/internal/Page/helpers/UserHelper.d.ts +0 -4
- package/dist/elements/provider/CollectionContainer/CollectionContainer.d.ts +0 -18
- package/dist/elements/provider/CollectionContainer/CollectionContainer.mjs +0 -69
- package/dist/elements/provider/CollectionContainer/CollectionContainer.stories-pending.d.ts +0 -1
- package/dist/elements/provider/CollectionContainer/Settings.d.ts +0 -10
- package/dist/elements/provider/CollectionContainer/Settings.mjs +0 -74
- package/dist/elements/provider/CollectionContainer/hooks/useCollectionContext.d.ts +0 -19
- package/dist/elements/provider/CollectionContainer/hooks/useCollectionContext.mjs +0 -71
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @plitzi/sdk-elements
|
|
2
2
|
|
|
3
|
+
## 0.33.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- v0.33.0
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @plitzi/sdk-auth@0.33.0
|
|
13
|
+
- @plitzi/sdk-dev-tools@0.33.0
|
|
14
|
+
- @plitzi/sdk-event-bridge@0.33.0
|
|
15
|
+
- @plitzi/sdk-interactions@0.33.0
|
|
16
|
+
- @plitzi/sdk-navigation@0.33.0
|
|
17
|
+
- @plitzi/sdk-schema@0.33.0
|
|
18
|
+
- @plitzi/sdk-shared@0.33.0
|
|
19
|
+
|
|
20
|
+
## 0.32.25
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- v0.32.25
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
- @plitzi/sdk-auth@0.32.25
|
|
27
|
+
- @plitzi/sdk-dev-tools@0.32.25
|
|
28
|
+
- @plitzi/sdk-event-bridge@0.32.25
|
|
29
|
+
- @plitzi/sdk-interactions@0.32.25
|
|
30
|
+
- @plitzi/sdk-navigation@0.32.25
|
|
31
|
+
- @plitzi/sdk-schema@0.32.25
|
|
32
|
+
- @plitzi/sdk-shared@0.32.25
|
|
33
|
+
|
|
3
34
|
## 0.32.24
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
|
@@ -4,6 +4,13 @@ export type ElementContextValue<T extends 'skipHOC' | 'full' = 'full'> = {
|
|
|
4
4
|
id: string;
|
|
5
5
|
idRef?: string;
|
|
6
6
|
rootId?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Whether this element is on screen: its own `visibility` state AND every ancestor's, chained through this context.
|
|
9
|
+
* A hidden element still renders its subtree (it is hidden in CSS, not unmounted), so anything that DOES something
|
|
10
|
+
* rather than just paint — fetching, polling, submitting — reads this instead of its own state to stay inert while
|
|
11
|
+
* the branch it lives in is hidden.
|
|
12
|
+
*/
|
|
13
|
+
visible: boolean;
|
|
7
14
|
} & (T extends 'skipHOC' ? {
|
|
8
15
|
plitziJsxSkipHOC: true;
|
|
9
16
|
} : {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isVisible: (visibility: unknown) => boolean;
|
|
@@ -1,60 +1,68 @@
|
|
|
1
1
|
import e from "../ElementContext.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import n from "../
|
|
4
|
-
import r from "
|
|
5
|
-
import
|
|
6
|
-
import c from "
|
|
7
|
-
import l from "@plitzi/sdk-
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
2
|
+
import { isVisible as t } from "../helpers/isVisible.mjs";
|
|
3
|
+
import { omitKeys as n } from "../helpers/omitKeys.mjs";
|
|
4
|
+
import r from "../hooks/useElementInternal.mjs";
|
|
5
|
+
import i from "@plitzi/plitzi-ui/ErrorBoundary";
|
|
6
|
+
import { Profiler as a, use as o, useMemo as s, useRef as c } from "react";
|
|
7
|
+
import l from "@plitzi/sdk-event-bridge/hooks/useEventBridge";
|
|
8
|
+
import u from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
9
|
+
import { useCommonStore as d } from "@plitzi/sdk-shared/store";
|
|
10
|
+
import { diffProps as f, tracingCollector as p } from "@plitzi/sdk-shared/store/tracing";
|
|
11
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
11
12
|
//#region src/Element/hocs/withElement.tsx
|
|
12
|
-
var
|
|
13
|
-
let
|
|
14
|
-
let
|
|
15
|
-
id:
|
|
16
|
-
rootId:
|
|
13
|
+
var h = (h) => {
|
|
14
|
+
let g = h.displayName || h.name, _ = (g) => {
|
|
15
|
+
let _ = c(void 0), v = c(void 0), { id: y, rootId: b } = g.internalProps, x = o(e), S = x?.visible ?? !0, C = s(() => ({
|
|
16
|
+
id: y,
|
|
17
|
+
rootId: b,
|
|
18
|
+
visible: S,
|
|
17
19
|
plitziJsxSkipHOC: !0
|
|
18
|
-
}), [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
}), [
|
|
21
|
+
y,
|
|
22
|
+
b,
|
|
23
|
+
S
|
|
24
|
+
]);
|
|
25
|
+
if (g.plitziJsxSkipHOC) return /* @__PURE__ */ m(e, {
|
|
26
|
+
value: C,
|
|
27
|
+
children: /* @__PURE__ */ m(h, { ...g })
|
|
22
28
|
});
|
|
23
|
-
let
|
|
24
|
-
if (!
|
|
25
|
-
let { internalProps:
|
|
26
|
-
element:
|
|
27
|
-
internalProps:
|
|
28
|
-
children:
|
|
29
|
-
previewMode:
|
|
30
|
-
}), { attributes:
|
|
31
|
-
|
|
32
|
-
let
|
|
33
|
-
id:
|
|
34
|
-
idRef:
|
|
35
|
-
rootId:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
let { settings: { previewMode: w, debugMode: T }, root: { baseElementId: E } } = u(), [D] = d(`schema.flat.${y}`);
|
|
30
|
+
if (!D) throw Error(`Element ${y} not found, Page ${E}`);
|
|
31
|
+
let { internalProps: O, customProps: k, children: A } = r({
|
|
32
|
+
element: D,
|
|
33
|
+
internalProps: g.internalProps,
|
|
34
|
+
children: g.children,
|
|
35
|
+
previewMode: w
|
|
36
|
+
}), { attributes: j, definition: M, style: N, plitziElementLayout: P, elementState: F, setElementState: I } = O, L = s(() => ({ [`${y}_setState`]: I }), [y, I]);
|
|
37
|
+
l("element", L);
|
|
38
|
+
let R = D.idRef, z = S && t(F.visibility), B = s(() => ({
|
|
39
|
+
id: y,
|
|
40
|
+
idRef: R,
|
|
41
|
+
rootId: b,
|
|
42
|
+
visible: z,
|
|
43
|
+
attributes: j,
|
|
44
|
+
definition: M,
|
|
45
|
+
plitziElementLayout: P,
|
|
46
|
+
style: N,
|
|
47
|
+
elementState: F,
|
|
48
|
+
setElementState: I
|
|
42
49
|
}), [
|
|
43
|
-
|
|
44
|
-
A,
|
|
45
|
-
N,
|
|
46
|
-
v,
|
|
47
|
-
I,
|
|
50
|
+
j,
|
|
48
51
|
M,
|
|
52
|
+
F,
|
|
49
53
|
y,
|
|
50
|
-
|
|
51
|
-
P
|
|
52
|
-
|
|
54
|
+
R,
|
|
55
|
+
P,
|
|
56
|
+
b,
|
|
57
|
+
N,
|
|
58
|
+
I,
|
|
59
|
+
z
|
|
60
|
+
]), V = s(() => {
|
|
53
61
|
let e = {
|
|
54
|
-
...
|
|
55
|
-
...
|
|
56
|
-
...
|
|
57
|
-
...
|
|
62
|
+
...O.attributes,
|
|
63
|
+
...g.extraProps,
|
|
64
|
+
...k,
|
|
65
|
+
...n(g, [
|
|
58
66
|
"plitziJsxSkipHOC",
|
|
59
67
|
"internalProps",
|
|
60
68
|
"className",
|
|
@@ -62,34 +70,34 @@ var m = (m) => {
|
|
|
62
70
|
"extraProps"
|
|
63
71
|
])
|
|
64
72
|
};
|
|
65
|
-
return
|
|
73
|
+
return A && (e = {
|
|
66
74
|
...e,
|
|
67
|
-
children:
|
|
68
|
-
}), /* @__PURE__ */
|
|
75
|
+
children: A
|
|
76
|
+
}), /* @__PURE__ */ m(i, { children: /* @__PURE__ */ m(h, {
|
|
69
77
|
...e,
|
|
70
|
-
ref:
|
|
78
|
+
ref: _
|
|
71
79
|
}) });
|
|
72
80
|
}, [
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
]),
|
|
78
|
-
value:
|
|
79
|
-
children:
|
|
81
|
+
O.attributes,
|
|
82
|
+
g,
|
|
83
|
+
k,
|
|
84
|
+
A
|
|
85
|
+
]), H = /* @__PURE__ */ m(e, {
|
|
86
|
+
value: B,
|
|
87
|
+
children: V
|
|
80
88
|
});
|
|
81
|
-
if (
|
|
82
|
-
|
|
89
|
+
if (T) {
|
|
90
|
+
p.linkParent(y, x?.id);
|
|
83
91
|
let e = {
|
|
84
|
-
attributes:
|
|
85
|
-
definition:
|
|
86
|
-
style:
|
|
87
|
-
elementState:
|
|
88
|
-
plitziElementLayout:
|
|
89
|
-
children:
|
|
90
|
-
...
|
|
91
|
-
...
|
|
92
|
-
...
|
|
92
|
+
attributes: j,
|
|
93
|
+
definition: M,
|
|
94
|
+
style: N,
|
|
95
|
+
elementState: F,
|
|
96
|
+
plitziElementLayout: P,
|
|
97
|
+
children: A,
|
|
98
|
+
...k,
|
|
99
|
+
...g.extraProps,
|
|
100
|
+
...n(g, [
|
|
93
101
|
"plitziJsxSkipHOC",
|
|
94
102
|
"internalProps",
|
|
95
103
|
"className",
|
|
@@ -97,15 +105,15 @@ var m = (m) => {
|
|
|
97
105
|
"extraProps"
|
|
98
106
|
])
|
|
99
107
|
};
|
|
100
|
-
return
|
|
101
|
-
id:
|
|
102
|
-
onRender:
|
|
103
|
-
children:
|
|
108
|
+
return p.recordProps(y, f(v.current, e)), v.current = e, /* @__PURE__ */ m(a, {
|
|
109
|
+
id: y,
|
|
110
|
+
onRender: p.onRender,
|
|
111
|
+
children: H
|
|
104
112
|
});
|
|
105
113
|
}
|
|
106
|
-
return
|
|
114
|
+
return H;
|
|
107
115
|
};
|
|
108
|
-
return
|
|
116
|
+
return _.displayName = `withElement(${g})`, _;
|
|
109
117
|
};
|
|
110
118
|
//#endregion
|
|
111
|
-
export {
|
|
119
|
+
export { h as default };
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import t from "
|
|
1
|
+
import { isVisible as e } from "../helpers/isVisible.mjs";
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
import n from "clsx";
|
|
3
4
|
//#region src/Element/hooks/useInternalClassName.ts
|
|
4
|
-
var
|
|
5
|
-
let { items:
|
|
6
|
-
return
|
|
7
|
-
"plitzi-component--hidden":
|
|
8
|
-
"plitzi-component": !
|
|
9
|
-
"plitzi-component--layout": !
|
|
10
|
-
with__container: !
|
|
11
|
-
"container--empty": !
|
|
12
|
-
"container--base-element": !
|
|
13
|
-
"plitzi-component--layout-body":
|
|
14
|
-
},
|
|
15
|
-
r,
|
|
16
|
-
u,
|
|
5
|
+
var r = ({ id: r, className: i, previewMode: a, baseElementId: o, plitziElementLayout: s, definition: c, elementState: l }) => {
|
|
6
|
+
let { items: u } = c, d = e(l.visibility);
|
|
7
|
+
return t(() => n(i, {
|
|
8
|
+
"plitzi-component--hidden": !d,
|
|
9
|
+
"plitzi-component": !a && !s,
|
|
10
|
+
"plitzi-component--layout": !a && !!s,
|
|
11
|
+
with__container: !a && !!u,
|
|
12
|
+
"container--empty": !a && !!u && u.length === 0 && !s,
|
|
13
|
+
"container--base-element": !a && !!u && o === r,
|
|
14
|
+
"plitzi-component--layout-body": s && r === s.containerId
|
|
15
|
+
}, c.styleSelectors.base), [
|
|
17
16
|
i,
|
|
18
|
-
|
|
19
|
-
l,
|
|
17
|
+
d,
|
|
20
18
|
a,
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
s,
|
|
20
|
+
u,
|
|
21
|
+
o,
|
|
22
|
+
r,
|
|
23
|
+
c.styleSelectors.base
|
|
23
24
|
]);
|
|
24
25
|
};
|
|
25
26
|
//#endregion
|
|
26
|
-
export {
|
|
27
|
+
export { r as default };
|
|
@@ -8,7 +8,7 @@ import u from "@plitzi/sdk-shared/elements/ComponentContext";
|
|
|
8
8
|
import { jsx as d } from "react/jsx-runtime";
|
|
9
9
|
//#region src/Element/hooks/useInternalItems.tsx
|
|
10
10
|
var f = typeof window > "u", p = () => () => {}, m = () => !0, h = () => !1, g = ({ id: g, definition: _, plitziElementLayout: v, children: y, previewMode: b }) => {
|
|
11
|
-
let [[x, S]] = s(["schema.flat", "
|
|
11
|
+
let [[x, S]] = s(["schema.flat", "rsc.enabled"], { mode: "mount" }), { components: C } = r(u), { contexts: { PluginsContext: w } } = l(), { plugins: T } = r(w), { items: E } = _, D = v || y || E?.length, O = a(v), k = a(0);
|
|
12
12
|
O.current !== v && (O.current = v, k.current += 1);
|
|
13
13
|
let A = k.current, j = o(p, m, h);
|
|
14
14
|
return i(() => {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
declare const useRscData: <T>() => {
|
|
2
2
|
enabled: boolean;
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/** Whether a payload has arrived at all — the builder and client-only renders never see one. */
|
|
4
|
+
loaded: boolean;
|
|
5
|
+
elementData: NonNullable<T> | null;
|
|
5
6
|
isServerElement: boolean;
|
|
6
|
-
refresh: (
|
|
7
|
+
refresh: (ids?: string[], params?: Record<string, string>) => Promise<void>;
|
|
7
8
|
};
|
|
8
9
|
export default useRscData;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import e from "./useElement.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import n from "@plitzi/sdk-shared/server/rsc/
|
|
2
|
+
import { useCommonStore as t } from "@plitzi/sdk-shared/store";
|
|
3
|
+
import { rscDataPath as n } from "@plitzi/sdk-shared/server/rsc/refreshRsc";
|
|
4
|
+
import r from "@plitzi/sdk-shared/server/rsc/useRscRefresh";
|
|
4
5
|
//#region src/Element/hooks/useRscData.ts
|
|
5
|
-
var
|
|
6
|
-
let {
|
|
6
|
+
var i = () => {
|
|
7
|
+
let { id: i } = e(), [[a = !1, o = !1, s]] = t([
|
|
8
|
+
"rsc.enabled",
|
|
9
|
+
"rsc.loaded",
|
|
10
|
+
n(i)
|
|
11
|
+
]), c = r();
|
|
7
12
|
return {
|
|
8
|
-
enabled:
|
|
9
|
-
|
|
10
|
-
elementData:
|
|
11
|
-
isServerElement:
|
|
12
|
-
refresh:
|
|
13
|
+
enabled: a,
|
|
14
|
+
loaded: o,
|
|
15
|
+
elementData: s ?? null,
|
|
16
|
+
isServerElement: s !== void 0,
|
|
17
|
+
refresh: c
|
|
13
18
|
};
|
|
14
19
|
};
|
|
15
20
|
//#endregion
|
|
16
|
-
export {
|
|
21
|
+
export { i as default };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export type GlobalSourcesProps = {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
environment?: string;
|
|
5
4
|
};
|
|
6
|
-
declare const GlobalSources: ({ children
|
|
5
|
+
declare const GlobalSources: ({ children }: GlobalSourcesProps) => ReactNode;
|
|
7
6
|
export default GlobalSources;
|
|
@@ -1,40 +1,45 @@
|
|
|
1
1
|
import { use as e, useCallback as t, useMemo as n } from "react";
|
|
2
|
-
import { useCommonStore as r, useCommonStoreSync as i } from "@plitzi/sdk-shared/store";
|
|
3
|
-
import { get as
|
|
4
|
-
import { getPathsFromObeject as
|
|
5
|
-
import
|
|
6
|
-
import { QueryBuilderEvaluator as
|
|
7
|
-
import l from "@plitzi/sdk-navigation/NavigationContext";
|
|
2
|
+
import { useCommonStore as r, useCommonStoreSync as i, useRenderSettings as a } from "@plitzi/sdk-shared/store";
|
|
3
|
+
import { get as o } from "@plitzi/plitzi-ui/helpers";
|
|
4
|
+
import { getPathsFromObeject as s } from "@plitzi/sdk-shared/helpers/utils";
|
|
5
|
+
import c from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
|
|
6
|
+
import { QueryBuilderEvaluator as l } from "@plitzi/plitzi-ui/QueryBuilder";
|
|
8
7
|
import u from "@plitzi/sdk-auth/AuthContext";
|
|
9
8
|
//#region src/dataSource/GlobalSources.tsx
|
|
10
|
-
var d = ({ children: d
|
|
11
|
-
let {
|
|
9
|
+
var d = ({ children: d }) => {
|
|
10
|
+
let { environment: f } = a(), [[p, m, h, g, _]] = r([
|
|
11
|
+
"schema.variables",
|
|
12
|
+
"navigation.routeParams",
|
|
13
|
+
"navigation.queryParams",
|
|
14
|
+
"navigation.hostname",
|
|
15
|
+
"navigation.currentPageId"
|
|
16
|
+
]), v = n(() => p ? p.reduce((e, t) => {
|
|
12
17
|
let { name: n, value: r, subValues: i } = t;
|
|
13
18
|
if (!Array.isArray(i) || i.length === 0) return {
|
|
14
19
|
...e,
|
|
15
20
|
[n]: r
|
|
16
21
|
};
|
|
17
22
|
let a = {
|
|
18
|
-
routeParams:
|
|
19
|
-
queryParams:
|
|
20
|
-
hostname:
|
|
23
|
+
routeParams: m,
|
|
24
|
+
queryParams: h,
|
|
25
|
+
hostname: g,
|
|
21
26
|
environment: f
|
|
22
|
-
}, o = i.find((e) =>
|
|
27
|
+
}, o = i.find((e) => l(e.when, a));
|
|
23
28
|
return {
|
|
24
29
|
...e,
|
|
25
30
|
[n]: o ? o.value : r
|
|
26
31
|
};
|
|
27
32
|
}, {}) : {}, [
|
|
28
33
|
f,
|
|
34
|
+
g,
|
|
29
35
|
h,
|
|
30
36
|
m,
|
|
31
|
-
p
|
|
32
|
-
|
|
33
|
-
]), y = t(() => o(v).map((e) => ({
|
|
37
|
+
p
|
|
38
|
+
]), y = t(() => s(v).map((e) => ({
|
|
34
39
|
path: e,
|
|
35
40
|
name: `variables.${e}`
|
|
36
41
|
})), [v]);
|
|
37
|
-
|
|
42
|
+
c({
|
|
38
43
|
id: "global",
|
|
39
44
|
source: "variables",
|
|
40
45
|
name: "Variables",
|
|
@@ -42,19 +47,19 @@ var d = ({ children: d, environment: f = "main" }) => {
|
|
|
42
47
|
}), i("runtime.sources.variables", v);
|
|
43
48
|
let [b = {}] = r("pageDefinitions"), x = n(() => Object.values(b).map((e) => ({
|
|
44
49
|
value: e.id,
|
|
45
|
-
label:
|
|
50
|
+
label: o(e, "attributes.name", e.id)
|
|
46
51
|
})), [b]), S = n(() => ({
|
|
47
|
-
routeParams:
|
|
48
|
-
queryParams:
|
|
49
|
-
currentPageId:
|
|
52
|
+
routeParams: m,
|
|
53
|
+
queryParams: h,
|
|
54
|
+
currentPageId: _
|
|
50
55
|
}), [
|
|
51
|
-
p,
|
|
52
56
|
m,
|
|
53
|
-
|
|
57
|
+
h,
|
|
58
|
+
_
|
|
54
59
|
]), C = t(() => {
|
|
55
|
-
let e =
|
|
56
|
-
routeParams:
|
|
57
|
-
queryParams:
|
|
60
|
+
let e = s({
|
|
61
|
+
routeParams: m,
|
|
62
|
+
queryParams: h
|
|
58
63
|
}).map((e) => ({
|
|
59
64
|
path: e,
|
|
60
65
|
name: `navigation.${e}`
|
|
@@ -69,67 +74,46 @@ var d = ({ children: d, environment: f = "main" }) => {
|
|
|
69
74
|
};
|
|
70
75
|
return [...e, t];
|
|
71
76
|
}, [
|
|
72
|
-
p,
|
|
73
77
|
m,
|
|
78
|
+
h,
|
|
74
79
|
x
|
|
75
80
|
]);
|
|
76
|
-
|
|
81
|
+
c({
|
|
77
82
|
id: "global",
|
|
78
83
|
source: "navigation",
|
|
79
84
|
name: "Navigation",
|
|
80
85
|
fields: C
|
|
81
86
|
}), i("runtime.sources.navigation", S);
|
|
82
|
-
let { user: w, authenticated: T } = e(u), [E = "basic"] = r("schema.settings.userProvider"), D = n(() => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
locale: "",
|
|
93
|
-
updated_at: "",
|
|
94
|
-
email: "",
|
|
95
|
-
email_verified: !1,
|
|
96
|
-
sub: "",
|
|
97
|
-
...w
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
case "basic": return {
|
|
101
|
-
isAuthenticated: T,
|
|
102
|
-
accessToken: w?.accessToken ?? "",
|
|
103
|
-
details: {
|
|
104
|
-
username: "",
|
|
105
|
-
email: "",
|
|
106
|
-
roles: "",
|
|
107
|
-
permissions: "",
|
|
108
|
-
verified: "",
|
|
109
|
-
...w?.details ?? {}
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
default: return {};
|
|
87
|
+
let { user: w, authenticated: T } = e(u), [E = "basic"] = r("schema.settings.userProvider"), D = n(() => E === "" ? {} : {
|
|
88
|
+
isAuthenticated: T,
|
|
89
|
+
accessToken: w?.accessToken ?? "",
|
|
90
|
+
details: {
|
|
91
|
+
username: "",
|
|
92
|
+
email: "",
|
|
93
|
+
roles: "",
|
|
94
|
+
permissions: "",
|
|
95
|
+
verified: "",
|
|
96
|
+
...w?.details ?? {}
|
|
113
97
|
}
|
|
114
98
|
}, [
|
|
115
99
|
E,
|
|
116
100
|
w,
|
|
117
101
|
T
|
|
118
|
-
]), O = t(() =>
|
|
102
|
+
]), O = t(() => s(D).map((e) => ({
|
|
119
103
|
path: e,
|
|
120
104
|
name: `user.${e}`
|
|
121
105
|
})), [D]);
|
|
122
|
-
|
|
106
|
+
c({
|
|
123
107
|
id: "global",
|
|
124
108
|
source: "auth",
|
|
125
109
|
name: "Auth State",
|
|
126
110
|
fields: O
|
|
127
111
|
}), i("runtime.sources.auth", D);
|
|
128
|
-
let [k] = r("runtime.state"), A = t(() =>
|
|
112
|
+
let [k] = r("runtime.state"), A = t(() => s(k).map((e) => ({
|
|
129
113
|
path: e,
|
|
130
114
|
name: `state.${e}`
|
|
131
115
|
})), [k]);
|
|
132
|
-
return
|
|
116
|
+
return c({
|
|
133
117
|
id: "global",
|
|
134
118
|
source: "state",
|
|
135
119
|
name: "State",
|
|
@@ -4,7 +4,7 @@ import n from "../../../Element/hocs/withElement.mjs";
|
|
|
4
4
|
import { useCallback as r, useEffect as i, useMemo as a, useState as o } from "react";
|
|
5
5
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
6
|
import l from "clsx";
|
|
7
|
-
import { omit as u } from "@plitzi/plitzi-ui";
|
|
7
|
+
import { omit as u } from "@plitzi/plitzi-ui/helpers/lodash";
|
|
8
8
|
//#region src/elements/advanced/BlockJsx/BlockJsx.tsx
|
|
9
9
|
var d = ({ ref: n, className: d = "", props: f = "{}", contentCache: p = "", ...m }) => {
|
|
10
10
|
let { id: h, rootId: g, plitziElementLayout: _ } = e(), [v, y] = o(), [b, x] = o(), S = a(() => ({
|