@plitzi/sdk-elements 0.36.1 → 0.37.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 +80 -0
- package/dist/Element/ElementParentContext.d.ts +13 -0
- package/dist/Element/ElementParentContext.mjs +6 -0
- package/dist/Element/LayoutBody.d.ts +21 -0
- package/dist/Element/LayoutBody.mjs +24 -0
- package/dist/Element/hocs/withElement.mjs +104 -87
- package/dist/Element/hooks/useElementDataSource.mjs +1 -1
- package/dist/Element/hooks/useElementInternal.mjs +24 -24
- package/dist/Element/hooks/useInternalItems.mjs +42 -39
- package/dist/Element/hooks/useLayoutChain.d.ts +10 -0
- package/dist/Element/hooks/useLayoutChain.mjs +20 -0
- package/dist/Element/hooks/useRootElementInteractions.mjs +45 -44
- package/dist/dataSource/GlobalSources.mjs +60 -59
- package/dist/dataSource/pathFields.d.ts +7 -0
- package/dist/dataSource/pathFields.mjs +8 -0
- package/dist/elements/advanced/Custom/declaration.d.ts +7 -9
- package/dist/elements/advanced/Custom/index.d.ts +1 -7
- package/dist/elements/advanced/Reference/Reference.mjs +93 -89
- package/dist/elements/advanced/Reference/declaration.d.ts +1 -1
- package/dist/elements/advanced/Reference/index.d.ts +1 -1
- package/dist/elements/basic/Button/Button.d.ts +9 -1
- package/dist/elements/basic/Button/Button.mjs +19 -20
- package/dist/elements/basic/Button/Settings.d.ts +2 -1
- package/dist/elements/basic/Button/Settings.mjs +13 -6
- package/dist/elements/basic/Button/declaration.d.ts +1 -0
- package/dist/elements/basic/Button/index.d.ts +1 -0
- package/dist/elements/declarations/index.d.ts +6 -9
- package/dist/elements/form/FormControl/declaration.d.ts +2 -0
- package/dist/elements/internal/LayoutContainer/LayoutContainer.d.ts +6 -0
- package/dist/elements/internal/LayoutContainer/LayoutContainer.mjs +31 -23
- package/dist/elements/internal/LayoutContainer/Settings.d.ts +4 -1
- package/dist/elements/internal/LayoutContainer/Settings.mjs +78 -64
- package/dist/elements/internal/LayoutContainer/declaration.d.ts +2 -0
- package/dist/elements/internal/LayoutContainer/index.d.ts +2 -0
- package/dist/elements/internal/LayoutPicker/LayoutPicker.d.ts +10 -0
- package/dist/elements/internal/LayoutPicker/LayoutPicker.mjs +35 -0
- package/dist/elements/internal/LayoutPicker/index.d.ts +3 -0
- package/dist/elements/internal/LayoutPicker/index.mjs +5 -0
- package/dist/elements/internal/Page/Page.mjs +49 -48
- package/dist/elements/internal/Page/Settings.mjs +101 -119
- package/dist/elements/provider/ApiContainer/ApiContainer.mjs +58 -66
- package/dist/elements/provider/ApiContainer/declaration.mjs +1 -1
- package/dist/elements/provider/ApiContainer/hooks/useApi.d.ts +8 -0
- package/dist/elements/provider/ApiContainer/hooks/useApi.mjs +52 -48
- package/dist/elements/structure/Container/Container.d.ts +1 -1
- package/dist/elements/structure/Container/Settings.d.ts +1 -1
- package/dist/elements/structure/Container/Settings.mjs +4 -0
- package/dist/elements/structure/Container/declaration.d.ts +1 -1
- package/dist/elements/structure/Container/index.d.ts +1 -1
- package/dist/elements/structure/DialogContainer/DialogContainer.mjs +17 -25
- package/dist/elements/structure/ModalContainer/ModalContainer.mjs +15 -23
- package/dist/index.d.ts +6 -9
- package/package.json +38 -10
|
@@ -1,71 +1,72 @@
|
|
|
1
1
|
import e from "./useElementInteractions.mjs";
|
|
2
2
|
import t from "./useInternalClassName.mjs";
|
|
3
3
|
import { interactionBasicTriggers as n, nativeEventsList as r } from "../helpers/elementConstants.mjs";
|
|
4
|
-
import { use as i, useCallback as a,
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { use as i, useCallback as a, useContext as o, useEffect as s, useMemo as c } from "react";
|
|
5
|
+
import { get as l } from "@plitzi/plitzi-ui/helpers";
|
|
6
|
+
import { StoreContext as u } from "@plitzi/nexus/react";
|
|
7
7
|
import { emptyObject as d } from "@plitzi/sdk-shared/helpers/utils";
|
|
8
8
|
import f from "clsx";
|
|
9
9
|
import { pConsole as p } from "@plitzi/sdk-shared/devTools/utils/PlitziConsole";
|
|
10
10
|
//#region src/Element/hooks/useRootElementInteractions.ts
|
|
11
|
-
var m = ({ elementContext:
|
|
12
|
-
let { id:
|
|
13
|
-
i || e.preventDefault(), r && r(e),
|
|
14
|
-
}, [
|
|
15
|
-
let n =
|
|
11
|
+
var m = (e) => typeof e == "object" && !!e, h = ({ elementContext: h, InteractionsContext: g, previewMode: _, debugMode: v, baseElementId: y, className: b, interactionTriggers: x, interactionCallbacks: S, otherProps: C }) => {
|
|
12
|
+
let { id: w, className: T, attributes: E, definition: D, definition: { interactions: O }, plitziElementLayout: k, elementState: A, setElementState: j } = h, { interactionsManager: M, useInteractions: N } = i(g), P = a((e, t, n, r, i = !1) => {
|
|
13
|
+
i || e.preventDefault(), r && r(e), M.interactionTrigger(t, n, { event: e });
|
|
14
|
+
}, [M]), F = c(() => !_ || !O ? {} : Object.values(O).filter((e) => e.type === "trigger" && e.action && r.includes(e.action) && e.enabled).reduce((e, t) => {
|
|
15
|
+
let n = l(t, "params.propagateEvent", !1);
|
|
16
16
|
return {
|
|
17
17
|
...e,
|
|
18
|
-
[t.action]: (e) =>
|
|
18
|
+
[t.action]: (e) => P(e, w, t.action, C[t.action], n)
|
|
19
19
|
};
|
|
20
20
|
}, {}), [
|
|
21
|
+
w,
|
|
22
|
+
O,
|
|
21
23
|
C,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
L
|
|
28
|
-
let R = a(() => ({ dataSource: L.current }), [L]), z = s(() => ({
|
|
24
|
+
_,
|
|
25
|
+
P
|
|
26
|
+
]), I = o(u), L = a(() => {
|
|
27
|
+
let e = I?.getPath("runtime.sources");
|
|
28
|
+
return m(e) ? e : d;
|
|
29
|
+
}, [I]), R = a(() => ({ dataSource: L() }), [L]), z = c(() => ({
|
|
29
30
|
...n,
|
|
30
|
-
...
|
|
31
|
-
}), [
|
|
32
|
-
attributes:
|
|
33
|
-
definition:
|
|
34
|
-
setElementState:
|
|
31
|
+
...x
|
|
32
|
+
}), [x]), B = e({
|
|
33
|
+
attributes: E,
|
|
34
|
+
definition: D,
|
|
35
|
+
setElementState: j
|
|
35
36
|
});
|
|
36
|
-
|
|
37
|
-
id:
|
|
38
|
-
interactions:
|
|
37
|
+
N({
|
|
38
|
+
id: w,
|
|
39
|
+
interactions: O,
|
|
39
40
|
triggers: z,
|
|
40
|
-
callbacks:
|
|
41
|
-
...
|
|
41
|
+
callbacks: c(() => ({
|
|
42
|
+
...S,
|
|
42
43
|
...B
|
|
43
|
-
}), [
|
|
44
|
+
}), [S, B]),
|
|
44
45
|
getAdditionalParams: R
|
|
45
|
-
}),
|
|
46
|
-
|
|
47
|
-
}, []),
|
|
48
|
-
if (
|
|
49
|
-
p.removeProviderMethod(`getElementDataSource-${
|
|
46
|
+
}), s(() => {
|
|
47
|
+
_ && O && Object.keys(O).length && M.interactionTrigger(w, "onLoad", {});
|
|
48
|
+
}, []), s(() => {
|
|
49
|
+
if (v) return p.addProviderMethod(`getElementDataSource-${w}`, L), () => {
|
|
50
|
+
p.removeProviderMethod(`getElementDataSource-${w}`);
|
|
50
51
|
};
|
|
51
52
|
}, [
|
|
52
|
-
|
|
53
|
+
v,
|
|
53
54
|
L,
|
|
54
|
-
|
|
55
|
+
w
|
|
55
56
|
]);
|
|
56
57
|
let V = t({
|
|
57
|
-
id:
|
|
58
|
-
className:
|
|
59
|
-
previewMode:
|
|
60
|
-
baseElementId:
|
|
61
|
-
definition:
|
|
62
|
-
elementState:
|
|
63
|
-
plitziElementLayout:
|
|
58
|
+
id: w,
|
|
59
|
+
className: b,
|
|
60
|
+
previewMode: _,
|
|
61
|
+
baseElementId: y,
|
|
62
|
+
definition: D,
|
|
63
|
+
elementState: A,
|
|
64
|
+
plitziElementLayout: k
|
|
64
65
|
});
|
|
65
66
|
return {
|
|
66
|
-
className: f(
|
|
67
|
-
events:
|
|
67
|
+
className: f(T, V),
|
|
68
|
+
events: F
|
|
68
69
|
};
|
|
69
70
|
};
|
|
70
71
|
//#endregion
|
|
71
|
-
export {
|
|
72
|
+
export { h as default };
|
|
@@ -6,64 +6,65 @@ import c, { SPACE_THEME_AREA as l } from "@plitzi/sdk-shared/theme/useTheme";
|
|
|
6
6
|
import u from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
|
|
7
7
|
import d from "@plitzi/sdk-auth/AuthContext";
|
|
8
8
|
import { resolveVariables as f } from "@plitzi/sdk-shared/dataSource";
|
|
9
|
+
import p from "@plitzi/sdk-shared/hooks/useStableValue";
|
|
9
10
|
//#region src/dataSource/GlobalSources.tsx
|
|
10
|
-
var
|
|
11
|
-
let { environment:
|
|
11
|
+
var m = ({ children: m }) => {
|
|
12
|
+
let { environment: h } = a(), [[g, _, v, y, b, x]] = r([
|
|
12
13
|
"schema.variables",
|
|
13
14
|
"navigation.routeParams",
|
|
14
15
|
"navigation.queryParams",
|
|
15
16
|
"navigation.hostname",
|
|
16
17
|
"navigation.origin",
|
|
17
18
|
"navigation.currentPageId"
|
|
18
|
-
]),
|
|
19
|
-
routeParams:
|
|
20
|
-
queryParams:
|
|
21
|
-
hostname:
|
|
22
|
-
environment:
|
|
19
|
+
]), S = p(n(() => f(g, {
|
|
20
|
+
routeParams: _,
|
|
21
|
+
queryParams: v,
|
|
22
|
+
hostname: y,
|
|
23
|
+
environment: h
|
|
23
24
|
}), [
|
|
24
|
-
|
|
25
|
+
h,
|
|
26
|
+
y,
|
|
25
27
|
v,
|
|
26
28
|
_,
|
|
27
|
-
g
|
|
28
|
-
|
|
29
|
-
]), S = t(() => s(x).map((e) => ({
|
|
29
|
+
g
|
|
30
|
+
])), C = t(() => s(S).map((e) => ({
|
|
30
31
|
path: e,
|
|
31
32
|
name: `variables.${e}`
|
|
32
|
-
})), [
|
|
33
|
+
})), [S]);
|
|
33
34
|
u({
|
|
34
35
|
id: "global",
|
|
35
36
|
source: "variables",
|
|
36
37
|
name: "Variables",
|
|
37
|
-
fields:
|
|
38
|
-
}), i("runtime.sources.variables",
|
|
39
|
-
let [
|
|
38
|
+
fields: C
|
|
39
|
+
}), i("runtime.sources.variables", S);
|
|
40
|
+
let [w = {}] = r("pageDefinitions"), T = n(() => Object.values(w).map((e) => ({
|
|
40
41
|
value: e.id,
|
|
41
42
|
label: o(e, "attributes.name", e.id)
|
|
42
|
-
})), [
|
|
43
|
-
routeParams:
|
|
44
|
-
queryParams:
|
|
45
|
-
origin:
|
|
46
|
-
currentPageId:
|
|
43
|
+
})), [w]), E = n(() => ({
|
|
44
|
+
routeParams: _,
|
|
45
|
+
queryParams: v,
|
|
46
|
+
origin: b,
|
|
47
|
+
currentPageId: x
|
|
47
48
|
}), [
|
|
48
|
-
g,
|
|
49
49
|
_,
|
|
50
|
-
|
|
51
|
-
b
|
|
52
|
-
|
|
50
|
+
v,
|
|
51
|
+
b,
|
|
52
|
+
x
|
|
53
|
+
]), D = t(() => {
|
|
53
54
|
let e = s({
|
|
54
|
-
routeParams:
|
|
55
|
-
queryParams:
|
|
55
|
+
routeParams: _,
|
|
56
|
+
queryParams: v
|
|
56
57
|
}).map((e) => ({
|
|
57
58
|
path: e,
|
|
58
59
|
name: `navigation.${e}`
|
|
59
60
|
})), t = {
|
|
60
61
|
path: "origin",
|
|
61
62
|
name: "Origin"
|
|
62
|
-
}, n =
|
|
63
|
+
}, n = T.length > 0 ? {
|
|
63
64
|
path: "currentPageId",
|
|
64
65
|
name: "Current Page",
|
|
65
66
|
inputType: "select",
|
|
66
|
-
values:
|
|
67
|
+
values: T
|
|
67
68
|
} : {
|
|
68
69
|
path: "currentPageId",
|
|
69
70
|
name: "Current Page"
|
|
@@ -74,74 +75,74 @@ var p = ({ children: p }) => {
|
|
|
74
75
|
n
|
|
75
76
|
];
|
|
76
77
|
}, [
|
|
77
|
-
g,
|
|
78
78
|
_,
|
|
79
|
-
|
|
79
|
+
v,
|
|
80
|
+
T
|
|
80
81
|
]);
|
|
81
82
|
u({
|
|
82
83
|
id: "global",
|
|
83
84
|
source: "navigation",
|
|
84
85
|
name: "Navigation",
|
|
85
|
-
fields:
|
|
86
|
-
}), i("runtime.sources.navigation",
|
|
87
|
-
let { user:
|
|
88
|
-
isAuthenticated:
|
|
89
|
-
accessToken:
|
|
86
|
+
fields: D
|
|
87
|
+
}), i("runtime.sources.navigation", E);
|
|
88
|
+
let { user: O, authenticated: k } = e(d), [A = "basic"] = r("schema.settings.userProvider"), j = n(() => A === "" ? {} : {
|
|
89
|
+
isAuthenticated: k,
|
|
90
|
+
accessToken: O?.accessToken ?? "",
|
|
90
91
|
details: {
|
|
91
92
|
username: "",
|
|
92
93
|
email: "",
|
|
93
94
|
roles: "",
|
|
94
95
|
permissions: "",
|
|
95
96
|
verified: "",
|
|
96
|
-
...
|
|
97
|
+
...O?.details ?? {}
|
|
97
98
|
}
|
|
98
99
|
}, [
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
]),
|
|
100
|
+
A,
|
|
101
|
+
O,
|
|
102
|
+
k
|
|
103
|
+
]), M = t(() => s(j).map((e) => ({
|
|
103
104
|
path: e,
|
|
104
105
|
name: `user.${e}`
|
|
105
|
-
})), [
|
|
106
|
+
})), [j]);
|
|
106
107
|
u({
|
|
107
108
|
id: "global",
|
|
108
109
|
source: "auth",
|
|
109
110
|
name: "Auth State",
|
|
110
|
-
fields:
|
|
111
|
-
}), i("runtime.sources.auth",
|
|
112
|
-
let [
|
|
111
|
+
fields: M
|
|
112
|
+
}), i("runtime.sources.auth", j);
|
|
113
|
+
let [N] = r("runtime.state"), P = t(() => s(N).map((e) => ({
|
|
113
114
|
path: e,
|
|
114
115
|
name: `state.${e}`
|
|
115
|
-
})), [
|
|
116
|
+
})), [N]);
|
|
116
117
|
u({
|
|
117
118
|
id: "global",
|
|
118
119
|
source: "state",
|
|
119
120
|
name: "State",
|
|
120
|
-
fields:
|
|
121
|
-
}), i("runtime.sources.state",
|
|
122
|
-
let [
|
|
121
|
+
fields: P
|
|
122
|
+
}), i("runtime.sources.state", N);
|
|
123
|
+
let [F] = r("runtime.host"), I = t(() => s(F).map((e) => ({
|
|
123
124
|
path: e,
|
|
124
125
|
name: `host.${e}`
|
|
125
|
-
})), [
|
|
126
|
+
})), [F]);
|
|
126
127
|
u({
|
|
127
128
|
id: "global",
|
|
128
129
|
source: "host",
|
|
129
130
|
name: "Host",
|
|
130
|
-
fields:
|
|
131
|
-
}), i("runtime.sources.host",
|
|
132
|
-
let { theme:
|
|
133
|
-
mode:
|
|
134
|
-
resolved:
|
|
135
|
-
}), [
|
|
131
|
+
fields: I
|
|
132
|
+
}), i("runtime.sources.host", F);
|
|
133
|
+
let { theme: L, resolvedTheme: R } = c(l), z = n(() => ({
|
|
134
|
+
mode: L,
|
|
135
|
+
resolved: R
|
|
136
|
+
}), [L, R]), B = t(() => s(z).map((e) => ({
|
|
136
137
|
path: e,
|
|
137
138
|
name: `theme.${e}`
|
|
138
|
-
})), [
|
|
139
|
+
})), [z]);
|
|
139
140
|
return u({
|
|
140
141
|
id: "global",
|
|
141
142
|
source: "theme",
|
|
142
143
|
name: "Theme",
|
|
143
|
-
fields:
|
|
144
|
-
}), i("runtime.sources.theme",
|
|
144
|
+
fields: B
|
|
145
|
+
}), i("runtime.sources.theme", z), m;
|
|
145
146
|
};
|
|
146
147
|
//#endregion
|
|
147
|
-
export {
|
|
148
|
+
export { m as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SourceField } from '@plitzi/sdk-shared';
|
|
2
|
+
/**
|
|
3
|
+
* Every path of a source's data, named by its last two segments — what the binding picker lists for a provider, a
|
|
4
|
+
* modal or a dialog. Only ever run when the picker asks: see `useRegisterSource`.
|
|
5
|
+
*/
|
|
6
|
+
declare const pathFields: (data: Record<string, unknown>) => SourceField[];
|
|
7
|
+
export default pathFields;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { CustomProps } from './Custom';
|
|
2
2
|
import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring/declare';
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* What this element can be authored with — its component's own props, minus what the runtime supplies — and
|
|
5
|
+
* anything else: the component its `renderType` names reads its own attributes off this element (a chart's
|
|
6
|
+
* `series`, a map's `height`), so the element carries whatever that component declares.
|
|
7
|
+
*/
|
|
8
|
+
export type CustomAttributes = AuthorableAttributes<CustomProps> & Record<string, unknown>;
|
|
5
9
|
declare const declaration: {
|
|
6
10
|
readonly type: "custom";
|
|
7
11
|
readonly content: {
|
|
@@ -53,11 +57,5 @@ declare const declaration: {
|
|
|
53
57
|
};
|
|
54
58
|
readonly settings: {};
|
|
55
59
|
};
|
|
56
|
-
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<
|
|
57
|
-
settings?: string | undefined;
|
|
58
|
-
assets?: string | undefined;
|
|
59
|
-
renderType?: string | undefined;
|
|
60
|
-
isPlugin?: boolean | undefined;
|
|
61
|
-
scriptUrl?: string | undefined;
|
|
62
|
-
}>>;
|
|
60
|
+
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<CustomAttributes>;
|
|
63
61
|
export default declaration;
|
|
@@ -52,11 +52,5 @@ declare const Custom: {
|
|
|
52
52
|
};
|
|
53
53
|
readonly settings: {};
|
|
54
54
|
};
|
|
55
|
-
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<
|
|
56
|
-
settings?: string | undefined;
|
|
57
|
-
assets?: string | undefined;
|
|
58
|
-
renderType?: string | undefined;
|
|
59
|
-
isPlugin?: boolean | undefined;
|
|
60
|
-
scriptUrl?: string | undefined;
|
|
61
|
-
}>>;
|
|
55
|
+
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<import('./declaration').CustomAttributes>;
|
|
62
56
|
export default Custom;
|
|
@@ -1,143 +1,147 @@
|
|
|
1
|
-
import e from "../../../Element/
|
|
2
|
-
import t from "../../../Element/
|
|
3
|
-
import
|
|
4
|
-
import r from "../../../Element/
|
|
5
|
-
import
|
|
6
|
-
import u from "
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import g from "
|
|
1
|
+
import e from "../../../Element/LayoutBody.mjs";
|
|
2
|
+
import t from "../../../Element/hocs/withElement.mjs";
|
|
3
|
+
import n from "../../../Element/hooks/useElement.mjs";
|
|
4
|
+
import { RootElement as r } from "../../../Element/RootElement.mjs";
|
|
5
|
+
import i from "../../../Element/PluginManager.mjs";
|
|
6
|
+
import { use as a, useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
7
|
+
import d from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
8
|
+
import { useCommonStore as f } from "@plitzi/sdk-shared/store";
|
|
9
|
+
import { get as p } from "@plitzi/plitzi-ui/helpers";
|
|
10
|
+
import { StoreProvider as m } from "@plitzi/nexus/react";
|
|
11
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
|
+
import _ from "clsx";
|
|
12
13
|
//#region src/elements/advanced/Reference/Reference.tsx
|
|
13
|
-
var
|
|
14
|
-
let { id:
|
|
15
|
-
j.current = O;
|
|
16
|
-
let M = c(k);
|
|
14
|
+
var v = ({ ref: t, children: v, className: y = "", referenceType: b = "element", referenceId: x = "", referenceContainer: S = "" }) => {
|
|
15
|
+
let { id: C, definition: { rootId: w, styleSelectors: T } } = n(), { settings: { previewMode: E, environment: D }, contexts: { SegmentsContext: O } } = d(), [[k, A]] = f(["schema", "segments"]), { segmentGet: j } = a(O), M = l(k);
|
|
17
16
|
M.current = k;
|
|
18
|
-
let N =
|
|
17
|
+
let N = l(A);
|
|
18
|
+
N.current = A;
|
|
19
|
+
let P = o((e, t) => {
|
|
19
20
|
let n, r;
|
|
20
21
|
switch (t) {
|
|
21
22
|
case "segment": {
|
|
22
|
-
let t =
|
|
23
|
+
let t = p(N.current, e);
|
|
23
24
|
if (!t) return;
|
|
24
|
-
let i =
|
|
25
|
-
r =
|
|
25
|
+
let i = p(t, "definition.baseElementId");
|
|
26
|
+
r = p(t, "schema"), n = p(t, `schema.flat.${i}`);
|
|
26
27
|
break;
|
|
27
28
|
}
|
|
28
|
-
default: n =
|
|
29
|
+
default: n = p(M.current, `flat.${e}`), r = M.current;
|
|
29
30
|
}
|
|
30
31
|
if (n) return {
|
|
31
32
|
element: n,
|
|
32
|
-
elementType:
|
|
33
|
+
elementType: p(n, "definition.type"),
|
|
33
34
|
referenceContextData: {
|
|
34
35
|
schema: r,
|
|
35
|
-
prevSchema:
|
|
36
|
+
prevSchema: M.current
|
|
36
37
|
}
|
|
37
38
|
};
|
|
38
|
-
}, []), [
|
|
39
|
-
let n =
|
|
39
|
+
}, []), [F, I] = u(P(x, b)), L = o(async (e, t) => {
|
|
40
|
+
let n = P(e, t);
|
|
40
41
|
if (n) {
|
|
41
|
-
|
|
42
|
+
I(n);
|
|
42
43
|
return;
|
|
43
44
|
}
|
|
44
45
|
let r, i;
|
|
45
46
|
switch (t) {
|
|
46
47
|
case "segment": {
|
|
47
48
|
let t;
|
|
48
|
-
if (e && (t = await
|
|
49
|
-
let n =
|
|
50
|
-
i =
|
|
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}`);
|
|
51
52
|
break;
|
|
52
53
|
}
|
|
53
|
-
default: r =
|
|
54
|
+
default: r = p(M.current, `flat.${e}`), i = M.current;
|
|
54
55
|
}
|
|
55
56
|
if (!r) {
|
|
56
|
-
|
|
57
|
+
I(void 0);
|
|
57
58
|
return;
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
+
I({
|
|
60
61
|
element: r,
|
|
61
|
-
elementType:
|
|
62
|
+
elementType: p(r, "definition.type"),
|
|
62
63
|
referenceContextData: {
|
|
63
64
|
schema: i,
|
|
64
|
-
prevSchema:
|
|
65
|
+
prevSchema: M.current
|
|
65
66
|
}
|
|
66
67
|
});
|
|
67
|
-
}, [
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
}, [P, j]);
|
|
69
|
+
s(() => {
|
|
70
|
+
L(x, b);
|
|
70
71
|
}, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
L,
|
|
73
|
+
x,
|
|
74
|
+
b
|
|
74
75
|
]);
|
|
75
|
-
let
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
referenceId: S,
|
|
80
|
-
rootId: S
|
|
76
|
+
let R = c(() => ({
|
|
77
|
+
containerId: S,
|
|
78
|
+
type: b,
|
|
79
|
+
rootId: C
|
|
81
80
|
}), [
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
className: w.base
|
|
81
|
+
S,
|
|
82
|
+
b,
|
|
83
|
+
C
|
|
84
|
+
]), z = c(() => ({
|
|
85
|
+
id: F?.element?.id ?? "",
|
|
86
|
+
rootId: w,
|
|
87
|
+
className: T.base
|
|
90
88
|
}), [
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
F?.element?.id,
|
|
90
|
+
w,
|
|
91
|
+
T.base
|
|
94
92
|
]);
|
|
95
|
-
if (!
|
|
96
|
-
ref:
|
|
97
|
-
className:
|
|
98
|
-
children: !
|
|
93
|
+
if (!F) return /* @__PURE__ */ h(r, {
|
|
94
|
+
ref: t,
|
|
95
|
+
className: _("plitzi-component__reference", y, { "reference--build-mode": !E }),
|
|
96
|
+
children: !E && /* @__PURE__ */ g("div", {
|
|
99
97
|
className: "reference__label",
|
|
100
|
-
children: ["Element Reference ", /* @__PURE__ */
|
|
98
|
+
children: ["Element Reference ", /* @__PURE__ */ h("b", {
|
|
101
99
|
className: "capitalize",
|
|
102
|
-
children:
|
|
100
|
+
children: b
|
|
103
101
|
})]
|
|
104
102
|
})
|
|
105
103
|
});
|
|
106
|
-
let { element:
|
|
107
|
-
return
|
|
108
|
-
name: `Reference:${
|
|
109
|
-
value:
|
|
110
|
-
children: /* @__PURE__ */
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
104
|
+
let { element: B, elementType: V, referenceContextData: H } = F;
|
|
105
|
+
return E && B && b === "element" ? /* @__PURE__ */ h(m, {
|
|
106
|
+
name: `Reference:${C}`,
|
|
107
|
+
value: H,
|
|
108
|
+
children: /* @__PURE__ */ h(e, {
|
|
109
|
+
body: v,
|
|
110
|
+
children: /* @__PURE__ */ h(i, {
|
|
111
|
+
type: V,
|
|
112
|
+
internalProps: z,
|
|
113
|
+
plitziElementLayout: R
|
|
114
|
+
}, `${C}_${x}`)
|
|
115
|
+
})
|
|
116
|
+
}) : /* @__PURE__ */ g(r, {
|
|
117
|
+
ref: t,
|
|
118
|
+
className: _("plitzi-component__reference", y, { "reference--build-mode": !E }),
|
|
118
119
|
children: [
|
|
119
|
-
/* @__PURE__ */ m
|
|
120
|
-
name: `Reference:${
|
|
121
|
-
value:
|
|
122
|
-
children:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
/* @__PURE__ */ h(m, {
|
|
121
|
+
name: `Reference:${C}`,
|
|
122
|
+
value: H,
|
|
123
|
+
children: B && /* @__PURE__ */ h(e, {
|
|
124
|
+
body: v,
|
|
125
|
+
children: /* @__PURE__ */ h(i, {
|
|
126
|
+
type: V,
|
|
127
|
+
internalProps: z,
|
|
128
|
+
plitziElementLayout: R
|
|
129
|
+
}, `${C}_${x}`)
|
|
130
|
+
})
|
|
127
131
|
}),
|
|
128
|
-
!
|
|
132
|
+
!E && !B && /* @__PURE__ */ g("div", {
|
|
129
133
|
className: "reference__label",
|
|
130
|
-
children: ["Element Reference ",
|
|
134
|
+
children: ["Element Reference ", b]
|
|
131
135
|
}),
|
|
132
|
-
|
|
136
|
+
E && !B && b === "segment" && /* @__PURE__ */ g("div", { children: [
|
|
133
137
|
"Segment ",
|
|
134
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ h("b", { children: x }),
|
|
135
139
|
" not found, publish to ",
|
|
136
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ h("b", { children: D }),
|
|
137
141
|
" environment"
|
|
138
142
|
] })
|
|
139
143
|
]
|
|
140
144
|
});
|
|
141
|
-
},
|
|
145
|
+
}, y = t(v);
|
|
142
146
|
//#endregion
|
|
143
|
-
export {
|
|
147
|
+
export { v as Reference, y as default };
|
|
@@ -53,8 +53,8 @@ declare const declaration: {
|
|
|
53
53
|
readonly settings: {};
|
|
54
54
|
};
|
|
55
55
|
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
|
|
56
|
-
referenceId: string;
|
|
57
56
|
referenceType: import('@plitzi/sdk-shared').ElementLayoutType;
|
|
57
|
+
referenceId: string;
|
|
58
58
|
referenceContainer: string;
|
|
59
59
|
}>>;
|
|
60
60
|
export default declaration;
|
|
@@ -52,8 +52,8 @@ declare const Reference: {
|
|
|
52
52
|
readonly settings: {};
|
|
53
53
|
};
|
|
54
54
|
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
|
|
55
|
-
referenceId: string;
|
|
56
55
|
referenceType: import('@plitzi/sdk-shared').ElementLayoutType;
|
|
56
|
+
referenceId: string;
|
|
57
57
|
referenceContainer: string;
|
|
58
58
|
}>>;
|
|
59
59
|
export default Reference;
|
|
@@ -16,8 +16,16 @@ export type ButtonProps = {
|
|
|
16
16
|
ariaExpanded?: boolean;
|
|
17
17
|
/** For a button that stays on or off — a filter, a mode: `true` while it is on. Left out, it is a plain button. */
|
|
18
18
|
ariaPressed?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* What the button does, in words — shown as a tooltip on hover, and the button's accessible name when it has no text
|
|
21
|
+
* of its own. An icon-only button without one is announced as nothing at all.
|
|
22
|
+
*
|
|
23
|
+
* The browser falls back to it by itself, so it is never copied into `aria-label`: an `aria-label` would win over a
|
|
24
|
+
* visually-hidden label among the children, which is how a button with an empty `content` names itself.
|
|
25
|
+
*/
|
|
26
|
+
title?: string;
|
|
19
27
|
};
|
|
20
|
-
declare const Button: ({ ref, className, children, contentPlacement, content, subType, disabled, ariaExpanded, ariaPressed }: ButtonProps) => import("react").JSX.Element;
|
|
28
|
+
declare const Button: ({ ref, className, children, contentPlacement, content, subType, disabled, ariaExpanded, ariaPressed, title }: ButtonProps) => import("react").JSX.Element;
|
|
21
29
|
declare const _default: {
|
|
22
30
|
(props: import('../../../Element/hocs/withElement').WithElementProps<ButtonProps>): import("react").JSX.Element;
|
|
23
31
|
displayName: string;
|