@plitzi/sdk-elements 0.37.8 → 0.37.9
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 +241 -0
- package/dist/Element/ElementContext.mjs +2 -3
- package/dist/Element/ElementParentContext.mjs +2 -3
- package/dist/Element/LayoutBody.d.ts +12 -9
- package/dist/Element/LayoutBody.mjs +13 -14
- package/dist/Element/hooks/useElementInternal.mjs +21 -20
- package/dist/Element/hooks/useInternalClassName.mjs +1 -1
- package/dist/Element/hooks/useInternalItems.mjs +1 -1
- package/dist/elements/advanced/Reference/PropField.d.ts +13 -0
- package/dist/elements/advanced/Reference/PropField.mjs +65 -0
- package/dist/elements/advanced/Reference/Reference.d.ts +5 -6
- package/dist/elements/advanced/Reference/Reference.mjs +128 -138
- package/dist/elements/advanced/Reference/Settings.d.ts +5 -4
- package/dist/elements/advanced/Reference/Settings.mjs +48 -87
- package/dist/elements/advanced/Reference/declaration.d.ts +2 -4
- package/dist/elements/advanced/Reference/declaration.mjs +2 -3
- package/dist/elements/advanced/Reference/index.d.ts +2 -4
- package/dist/elements/declarations/index.d.ts +2 -4
- package/dist/elements/internal/Page/Page.mjs +29 -29
- package/dist/elements/provider/ApiContainer/hooks/useApi.mjs +12 -12
- package/dist/elements/structure/List/modes/ListControlled/ListControlled.mjs +22 -19
- package/dist/index.d.ts +2 -4
- package/package.json +14 -10
|
@@ -1,147 +1,137 @@
|
|
|
1
|
-
import e from "../../../Element/
|
|
2
|
-
import t from "../../../Element/
|
|
3
|
-
import n from "../../../Element/hooks/
|
|
4
|
-
import
|
|
5
|
-
import i from "../../../Element/
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
1
|
+
import { isVisible as e } from "../../../Element/helpers/isVisible.mjs";
|
|
2
|
+
import t from "../../../Element/LayoutBody.mjs";
|
|
3
|
+
import n from "../../../Element/hooks/useInternalItems.mjs";
|
|
4
|
+
import r from "../../../Element/hocs/withElement.mjs";
|
|
5
|
+
import i from "../../../Element/hooks/useElement.mjs";
|
|
6
|
+
import { RootElement as a } from "../../../Element/RootElement.mjs";
|
|
7
|
+
import o from "../../../Element/PluginManager.mjs";
|
|
8
|
+
import s from "../../../Element/ReplicaProvider.mjs";
|
|
9
|
+
import { useId as c, useMemo as l } from "react";
|
|
10
|
+
import u from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
11
|
+
import { useCommonStore as d } from "@plitzi/sdk-shared/store";
|
|
12
|
+
import { COMPONENT_PROPS_SOURCE as f } from "@plitzi/sdk-shared/schema/schemaConstants";
|
|
13
|
+
import { StoreProvider as p } from "@plitzi/nexus/react";
|
|
14
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
15
|
+
import g from "clsx";
|
|
16
|
+
import { HIDDEN_CLASS as _ } from "@plitzi/sdk-shared/style/styleStates";
|
|
13
17
|
//#region src/elements/advanced/Reference/Reference.tsx
|
|
14
|
-
var v = ({
|
|
15
|
-
let
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
let t;
|
|
49
|
-
if (e && (t = await j(e)), !t) return;
|
|
50
|
-
let n = p(t, "definition.baseElementId");
|
|
51
|
-
i = p(t, "schema"), r = p(t, `schema.flat.${n}`);
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
default: r = p(M.current, `flat.${e}`), i = M.current;
|
|
55
|
-
}
|
|
56
|
-
if (!r) {
|
|
57
|
-
I(void 0);
|
|
58
|
-
return;
|
|
18
|
+
var v = (e, t) => Object.fromEntries(Object.entries(e.props ?? {}).map(([e, n]) => [e, t[e] ?? n.default ?? null])), y = (t, n) => g(t, { [_]: !e(n.visibility) }), b = ({ instance: e, instanceId: t, items: r, plitziElementLayout: i, previewMode: a }) => {
|
|
19
|
+
let o = l(() => ({
|
|
20
|
+
...e,
|
|
21
|
+
items: r
|
|
22
|
+
}), [e, r]);
|
|
23
|
+
return n({
|
|
24
|
+
id: t,
|
|
25
|
+
definition: o,
|
|
26
|
+
plitziElementLayout: i,
|
|
27
|
+
children: void 0,
|
|
28
|
+
previewMode: a
|
|
29
|
+
});
|
|
30
|
+
}, x = ({ ref: e, className: n, componentId: r, previewMode: u }) => {
|
|
31
|
+
let { id: _, attributes: x, definition: S, plitziElementLayout: C, elementState: w, definition: { styleSelectors: T } } = i(), [E] = d("schema.components"), D = l(() => S.items ?? [], [S.items]), O = l(() => D.map((e) => `schema.flat.${e}.attributes.slot`), [D]), [k] = d(O), A = c(), j = Object.hasOwn(E, r) ? E[r] : void 0, M = l(() => j ? {
|
|
32
|
+
schema: { flat: j.flat },
|
|
33
|
+
runtime: { sources: { [f]: v(j, x) } }
|
|
34
|
+
} : {}, [j, x]), N = l(() => ({
|
|
35
|
+
slots: j?.slots ?? [],
|
|
36
|
+
rootId: _,
|
|
37
|
+
type: "component"
|
|
38
|
+
}), [j?.slots, _]), P = l(() => {
|
|
39
|
+
let e = j?.slots ?? [], t = {};
|
|
40
|
+
for (let n of e) {
|
|
41
|
+
let r = D.filter((t, r) => {
|
|
42
|
+
let i = k[r];
|
|
43
|
+
return (typeof i == "string" ? i : e[0]) === n;
|
|
44
|
+
});
|
|
45
|
+
t[n] = /* @__PURE__ */ m(b, {
|
|
46
|
+
instance: S,
|
|
47
|
+
instanceId: _,
|
|
48
|
+
items: r,
|
|
49
|
+
plitziElementLayout: C,
|
|
50
|
+
previewMode: u
|
|
51
|
+
});
|
|
59
52
|
}
|
|
60
|
-
|
|
61
|
-
element: r,
|
|
62
|
-
elementType: p(r, "definition.type"),
|
|
63
|
-
referenceContextData: {
|
|
64
|
-
schema: i,
|
|
65
|
-
prevSchema: M.current
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}, [P, j]);
|
|
69
|
-
s(() => {
|
|
70
|
-
L(x, b);
|
|
53
|
+
return t;
|
|
71
54
|
}, [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
]);
|
|
76
|
-
let R = c(() => ({
|
|
77
|
-
containerId: S,
|
|
78
|
-
type: b,
|
|
79
|
-
rootId: C
|
|
80
|
-
}), [
|
|
55
|
+
j?.slots,
|
|
56
|
+
D,
|
|
57
|
+
k,
|
|
81
58
|
S,
|
|
82
|
-
|
|
83
|
-
C
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
59
|
+
_,
|
|
60
|
+
C,
|
|
61
|
+
u
|
|
62
|
+
]), F = y(T.base, w), I = l(() => ({
|
|
63
|
+
id: j?.rootId ?? "",
|
|
64
|
+
rootId: _,
|
|
65
|
+
className: F
|
|
88
66
|
}), [
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
])
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
67
|
+
j?.rootId,
|
|
68
|
+
_,
|
|
69
|
+
F
|
|
70
|
+
]), L = j ? j.flat[j.rootId] : void 0, R = L && /* @__PURE__ */ m(s, { children: /* @__PURE__ */ m(p, {
|
|
71
|
+
inherit: "live",
|
|
72
|
+
name: `Component:${r}:${_}`,
|
|
73
|
+
segment: A,
|
|
74
|
+
value: M,
|
|
75
|
+
children: /* @__PURE__ */ m(t, {
|
|
76
|
+
bodies: P,
|
|
77
|
+
children: /* @__PURE__ */ m(o, {
|
|
78
|
+
type: L.definition.type,
|
|
79
|
+
internalProps: I,
|
|
80
|
+
plitziElementLayout: N
|
|
81
|
+
}, `${_}_${r}`)
|
|
102
82
|
})
|
|
83
|
+
}) });
|
|
84
|
+
return u && R ? R : /* @__PURE__ */ h(a, {
|
|
85
|
+
ref: e,
|
|
86
|
+
className: g("plitzi-component__reference", n, { "reference--build-mode": !u }),
|
|
87
|
+
children: [R, !u && !L && /* @__PURE__ */ h("div", {
|
|
88
|
+
className: "reference__label",
|
|
89
|
+
children: [
|
|
90
|
+
"Component ",
|
|
91
|
+
r,
|
|
92
|
+
" not found"
|
|
93
|
+
]
|
|
94
|
+
})]
|
|
103
95
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
] })
|
|
143
|
-
]
|
|
96
|
+
}, S = ({ ref: e, className: t, referenceId: n, previewMode: r }) => {
|
|
97
|
+
let { id: u, elementState: f, definition: { rootId: _, styleSelectors: v } } = i(), [b] = d(`schema.flat.${n}`), x = b, S = c(), C = y(v.base, f), w = l(() => ({
|
|
98
|
+
id: x?.id ?? "",
|
|
99
|
+
rootId: _,
|
|
100
|
+
className: C
|
|
101
|
+
}), [
|
|
102
|
+
x?.id,
|
|
103
|
+
_,
|
|
104
|
+
C
|
|
105
|
+
]), T = x && /* @__PURE__ */ m(s, { children: /* @__PURE__ */ m(p, {
|
|
106
|
+
inherit: "live",
|
|
107
|
+
name: `Reference:${u}`,
|
|
108
|
+
segment: S,
|
|
109
|
+
children: /* @__PURE__ */ m(o, {
|
|
110
|
+
type: x.definition.type,
|
|
111
|
+
internalProps: w
|
|
112
|
+
}, `${u}_${n}`)
|
|
113
|
+
}) });
|
|
114
|
+
return r && T ? T : /* @__PURE__ */ h(a, {
|
|
115
|
+
ref: e,
|
|
116
|
+
className: g("plitzi-component__reference", t, { "reference--build-mode": !r }),
|
|
117
|
+
children: [T, !r && !x && /* @__PURE__ */ m("div", {
|
|
118
|
+
className: "reference__label",
|
|
119
|
+
children: "Element Reference"
|
|
120
|
+
})]
|
|
121
|
+
});
|
|
122
|
+
}, C = ({ ref: e, className: t = "", referenceType: n = "element", referenceId: r = "" }) => {
|
|
123
|
+
let { settings: { previewMode: i = !0 } } = u();
|
|
124
|
+
return n === "component" ? /* @__PURE__ */ m(x, {
|
|
125
|
+
ref: e,
|
|
126
|
+
className: t,
|
|
127
|
+
componentId: r,
|
|
128
|
+
previewMode: i
|
|
129
|
+
}) : /* @__PURE__ */ m(S, {
|
|
130
|
+
ref: e,
|
|
131
|
+
className: t,
|
|
132
|
+
referenceId: r,
|
|
133
|
+
previewMode: i
|
|
144
134
|
});
|
|
145
|
-
},
|
|
135
|
+
}, w = r(C);
|
|
146
136
|
//#endregion
|
|
147
|
-
export {
|
|
137
|
+
export { C as Reference, w as default };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
type SettingsProps = {
|
|
2
|
-
referenceType?: 'element' | '
|
|
2
|
+
referenceType?: 'element' | 'component';
|
|
3
3
|
referenceId?: string;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
onUpdate?: (key: string, value: string | number | boolean | object) => void;
|
|
5
|
+
/** An instance's props arrive here as the attributes they are. */
|
|
6
|
+
[prop: string]: unknown;
|
|
6
7
|
};
|
|
7
|
-
declare const Settings: ({ referenceType, referenceId,
|
|
8
|
+
declare const Settings: ({ referenceType, referenceId, onUpdate, ...values }: SettingsProps) => import('react').JSX.Element;
|
|
8
9
|
export default Settings;
|
|
@@ -1,96 +1,57 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { useCommonStore as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import c from "@plitzi/plitzi-ui/Select2";
|
|
1
|
+
import e from "./PropField.mjs";
|
|
2
|
+
import { useCallback as t, useMemo as n } from "react";
|
|
3
|
+
import { useCommonStore as r } from "@plitzi/sdk-shared/store";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import o from "@plitzi/plitzi-ui/Select2";
|
|
7
6
|
//#region src/elements/advanced/Reference/Settings.tsx
|
|
8
|
-
var
|
|
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
|
-
case "segment": return new Promise((e) => {
|
|
40
|
-
_().then((t) => {
|
|
41
|
-
e(a(t, "edges", []).map((e) => ({
|
|
42
|
-
value: e.identifier,
|
|
43
|
-
label: a(e, "definition.name", e.id)
|
|
44
|
-
})));
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
default: return [];
|
|
48
|
-
}
|
|
49
|
-
}, [
|
|
50
|
-
S,
|
|
51
|
-
l,
|
|
52
|
-
_
|
|
53
|
-
]), w = n(() => {
|
|
54
|
-
if (!u) return [];
|
|
55
|
-
switch (l) {
|
|
56
|
-
case "segment": {
|
|
57
|
-
let e = a(h, u), t = a(e, "definition.baseElementId");
|
|
58
|
-
return S?.flat ? Object.values(S.flat).filter((e) => a(e, "definition.type", "") === "container" && a(e, "definition.rootId", "") === t && Array.isArray(a(e, "definition.items")) && a(e, "definition.items", []).length === 0).map((e) => ({
|
|
59
|
-
value: e.id,
|
|
60
|
-
label: a(e, "definition.label")
|
|
61
|
-
})) : [];
|
|
62
|
-
}
|
|
63
|
-
default: return [];
|
|
64
|
-
}
|
|
65
|
-
}, [
|
|
66
|
-
u,
|
|
67
|
-
l,
|
|
68
|
-
h,
|
|
69
|
-
S?.flat
|
|
70
|
-
]);
|
|
71
|
-
return /* @__PURE__ */ s("div", {
|
|
72
|
-
className: "flex h-full flex-col py-2",
|
|
7
|
+
var s = [{
|
|
8
|
+
value: "element",
|
|
9
|
+
label: "Element"
|
|
10
|
+
}, {
|
|
11
|
+
value: "component",
|
|
12
|
+
label: "Component"
|
|
13
|
+
}], c = ({ component: t, values: n, onUpdate: r }) => /* @__PURE__ */ i("div", {
|
|
14
|
+
className: "flex flex-col gap-2",
|
|
15
|
+
children: Object.entries(t.props ?? {}).map(([t, a]) => /* @__PURE__ */ i(e, {
|
|
16
|
+
name: t,
|
|
17
|
+
prop: a,
|
|
18
|
+
value: n[t],
|
|
19
|
+
onUpdate: r
|
|
20
|
+
}, t))
|
|
21
|
+
}), l = ({ referenceType: e = "element", referenceId: l = "", onUpdate: u, ...d }) => {
|
|
22
|
+
let [[f, p]] = r(["schema.flat", "schema.components"]), m = t((e) => {
|
|
23
|
+
u?.("referenceType", e?.value ?? "element"), u?.("referenceId", "");
|
|
24
|
+
}, [u]), h = t((e) => u?.("referenceId", e?.value ?? ""), [u]), g = n(() => e === "component" ? Object.values(p).map((e) => ({
|
|
25
|
+
value: e.id,
|
|
26
|
+
label: e.label ?? e.id
|
|
27
|
+
})) : Object.values(f).map((e) => ({
|
|
28
|
+
value: e.id,
|
|
29
|
+
label: e.definition.label
|
|
30
|
+
})), [
|
|
31
|
+
e,
|
|
32
|
+
p,
|
|
33
|
+
f
|
|
34
|
+
]), _ = e === "component" && Object.hasOwn(p, l) ? p[l] : void 0;
|
|
35
|
+
return /* @__PURE__ */ a("div", {
|
|
36
|
+
className: "flex h-full flex-col gap-2 py-2",
|
|
73
37
|
children: [
|
|
74
|
-
/* @__PURE__ */ o
|
|
75
|
-
value:
|
|
76
|
-
onChange: v,
|
|
77
|
-
placeholder: "Search...",
|
|
38
|
+
/* @__PURE__ */ i(o, {
|
|
39
|
+
value: e,
|
|
78
40
|
label: "Reference Type",
|
|
79
|
-
|
|
41
|
+
onChange: m,
|
|
42
|
+
options: s
|
|
80
43
|
}),
|
|
81
|
-
/* @__PURE__ */ o
|
|
82
|
-
value:
|
|
83
|
-
label: "
|
|
84
|
-
onChange:
|
|
44
|
+
/* @__PURE__ */ i(o, {
|
|
45
|
+
value: l,
|
|
46
|
+
label: e === "component" ? "Component" : "Element",
|
|
47
|
+
onChange: h,
|
|
85
48
|
placeholder: "Search...",
|
|
86
|
-
options:
|
|
49
|
+
options: g
|
|
87
50
|
}),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
onChange: b,
|
|
93
|
-
options: w
|
|
51
|
+
_ && /* @__PURE__ */ i(c, {
|
|
52
|
+
component: _,
|
|
53
|
+
values: d,
|
|
54
|
+
onUpdate: u
|
|
94
55
|
})
|
|
95
56
|
]
|
|
96
57
|
});
|
|
@@ -8,12 +8,11 @@ declare const declaration: {
|
|
|
8
8
|
readonly attributes: {
|
|
9
9
|
readonly referenceType: "element";
|
|
10
10
|
readonly referenceId: "";
|
|
11
|
-
readonly referenceContainer: "";
|
|
12
11
|
};
|
|
13
12
|
readonly definition: {
|
|
14
13
|
readonly label: "Reference";
|
|
15
14
|
readonly type: "reference";
|
|
16
|
-
readonly description: "
|
|
15
|
+
readonly description: "Places one of the components of the space, or renders another of its elements by id, in place.";
|
|
17
16
|
readonly items: readonly [];
|
|
18
17
|
readonly bindings: {};
|
|
19
18
|
readonly styleSelectors: {
|
|
@@ -53,8 +52,7 @@ declare const declaration: {
|
|
|
53
52
|
readonly settings: {};
|
|
54
53
|
};
|
|
55
54
|
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
|
|
56
|
-
referenceType: import('@plitzi/sdk-shared').ElementLayoutType;
|
|
57
55
|
referenceId: string;
|
|
58
|
-
|
|
56
|
+
referenceType: "element" | "component";
|
|
59
57
|
}>>;
|
|
60
58
|
export default declaration;
|
|
@@ -5,13 +5,12 @@ var t = e()({
|
|
|
5
5
|
content: {
|
|
6
6
|
attributes: {
|
|
7
7
|
referenceType: "element",
|
|
8
|
-
referenceId: ""
|
|
9
|
-
referenceContainer: ""
|
|
8
|
+
referenceId: ""
|
|
10
9
|
},
|
|
11
10
|
definition: {
|
|
12
11
|
label: "Reference",
|
|
13
12
|
type: "reference",
|
|
14
|
-
description: "
|
|
13
|
+
description: "Places one of the components of the space, or renders another of its elements by id, in place.",
|
|
15
14
|
items: [],
|
|
16
15
|
bindings: {},
|
|
17
16
|
styleSelectors: { base: "" },
|
|
@@ -7,12 +7,11 @@ declare const Reference: {
|
|
|
7
7
|
readonly attributes: {
|
|
8
8
|
readonly referenceType: "element";
|
|
9
9
|
readonly referenceId: "";
|
|
10
|
-
readonly referenceContainer: "";
|
|
11
10
|
};
|
|
12
11
|
readonly definition: {
|
|
13
12
|
readonly label: "Reference";
|
|
14
13
|
readonly type: "reference";
|
|
15
|
-
readonly description: "
|
|
14
|
+
readonly description: "Places one of the components of the space, or renders another of its elements by id, in place.";
|
|
16
15
|
readonly items: readonly [];
|
|
17
16
|
readonly bindings: {};
|
|
18
17
|
readonly styleSelectors: {
|
|
@@ -52,8 +51,7 @@ declare const Reference: {
|
|
|
52
51
|
readonly settings: {};
|
|
53
52
|
};
|
|
54
53
|
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
|
|
55
|
-
referenceType: import('@plitzi/sdk-shared').ElementLayoutType;
|
|
56
54
|
referenceId: string;
|
|
57
|
-
|
|
55
|
+
referenceType: "element" | "component";
|
|
58
56
|
}>>;
|
|
59
57
|
export default Reference;
|
|
@@ -3109,12 +3109,11 @@ export declare const elementDeclarations: {
|
|
|
3109
3109
|
readonly attributes: {
|
|
3110
3110
|
readonly referenceType: "element";
|
|
3111
3111
|
readonly referenceId: "";
|
|
3112
|
-
readonly referenceContainer: "";
|
|
3113
3112
|
};
|
|
3114
3113
|
readonly definition: {
|
|
3115
3114
|
readonly label: "Reference";
|
|
3116
3115
|
readonly type: "reference";
|
|
3117
|
-
readonly description: "
|
|
3116
|
+
readonly description: "Places one of the components of the space, or renders another of its elements by id, in place.";
|
|
3118
3117
|
readonly items: readonly [];
|
|
3119
3118
|
readonly bindings: {};
|
|
3120
3119
|
readonly styleSelectors: {
|
|
@@ -3154,9 +3153,8 @@ export declare const elementDeclarations: {
|
|
|
3154
3153
|
readonly settings: {};
|
|
3155
3154
|
};
|
|
3156
3155
|
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
|
|
3157
|
-
referenceType: import('@plitzi/sdk-shared').ElementLayoutType;
|
|
3158
3156
|
referenceId: string;
|
|
3159
|
-
|
|
3157
|
+
referenceType: "element" | "component";
|
|
3160
3158
|
}>>;
|
|
3161
3159
|
readonly RichText: {
|
|
3162
3160
|
readonly type: "richText";
|
|
@@ -7,56 +7,56 @@ import a from "./declaration.mjs";
|
|
|
7
7
|
import o from "../../../Element/hooks/useLayoutChain.mjs";
|
|
8
8
|
import { use as s, useEffect as c, useMemo as l } from "react";
|
|
9
9
|
import u from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
10
|
-
import {
|
|
11
|
-
import { jsx as
|
|
12
|
-
import
|
|
13
|
-
import { Helmet as
|
|
10
|
+
import { useRenderSettings as d, useSdkStore as f } from "@plitzi/sdk-shared/store";
|
|
11
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
12
|
+
import h from "clsx";
|
|
13
|
+
import { Helmet as g } from "@dr.pogodin/react-helmet";
|
|
14
14
|
//#region src/elements/internal/Page/Page.tsx
|
|
15
|
-
var
|
|
15
|
+
var _ = (e) => e.map((e) => ({
|
|
16
16
|
...e,
|
|
17
17
|
plitziElementLayout: {
|
|
18
|
-
|
|
18
|
+
slots: [e.slot],
|
|
19
19
|
rootId: e.slot,
|
|
20
20
|
type: "layout"
|
|
21
21
|
}
|
|
22
|
-
})),
|
|
23
|
-
|
|
24
|
-
children: /* @__PURE__ */
|
|
22
|
+
})), v = (t, n, r) => t.reduce((t, { layout: r, slot: a, plitziElementLayout: o }) => /* @__PURE__ */ p(e, {
|
|
23
|
+
bodies: { [a]: t },
|
|
24
|
+
children: /* @__PURE__ */ p(i, { internalProps: {
|
|
25
25
|
id: r,
|
|
26
26
|
rootId: n,
|
|
27
27
|
plitziElementLayout: o
|
|
28
28
|
} })
|
|
29
|
-
}, a), r),
|
|
30
|
-
let { id:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
}, a), r), y = ({ ref: e, seoEnabled: t = !1, seoPageTitle: i = "Title", seoPageDescription: y = "Description", className: b = "", layout: x = "", layoutContainer: S = "", children: C }) => {
|
|
30
|
+
let { id: w } = n(), { settings: { previewMode: T }, contexts: { InteractionsContext: E } } = u(), { interactionsManager: D } = s(E), { ownsHead: O } = d(), [[k, A]] = f(["navigation.routeParams", "navigation.queryParams"]), j = o(x, S), M = l(() => _(j), [j]), N = l(() => v(M, w, C), [
|
|
31
|
+
M,
|
|
32
|
+
w,
|
|
33
|
+
C
|
|
34
34
|
]);
|
|
35
35
|
return c(() => {
|
|
36
36
|
let e = !1;
|
|
37
37
|
return queueMicrotask(() => {
|
|
38
|
-
e ||
|
|
39
|
-
pageId:
|
|
40
|
-
routeParams:
|
|
41
|
-
queryParams:
|
|
38
|
+
e || D.interactionTrigger(w, "onPageLoad", {
|
|
39
|
+
pageId: w,
|
|
40
|
+
routeParams: k,
|
|
41
|
+
queryParams: A
|
|
42
42
|
});
|
|
43
43
|
}), () => {
|
|
44
44
|
e = !0;
|
|
45
45
|
};
|
|
46
46
|
}, [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
]), /* @__PURE__ */
|
|
47
|
+
w,
|
|
48
|
+
D,
|
|
49
|
+
A,
|
|
50
|
+
k
|
|
51
|
+
]), /* @__PURE__ */ m(r, {
|
|
52
52
|
ref: e,
|
|
53
|
-
className:
|
|
53
|
+
className: h("plitzi-component__page", b),
|
|
54
54
|
interactionTriggers: a.triggers,
|
|
55
|
-
children: [t &&
|
|
55
|
+
children: [t && T && O && /* @__PURE__ */ m(g, { children: [!!i && /* @__PURE__ */ p("title", { children: i }), !!y && /* @__PURE__ */ p("meta", {
|
|
56
56
|
name: "description",
|
|
57
|
-
content:
|
|
58
|
-
})] }),
|
|
57
|
+
content: y
|
|
58
|
+
})] }), N]
|
|
59
59
|
});
|
|
60
|
-
},
|
|
60
|
+
}, b = t(y);
|
|
61
61
|
//#endregion
|
|
62
|
-
export {
|
|
62
|
+
export { y as Page, b as default };
|