@plitzi/sdk-elements 0.37.2 → 0.37.4
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 +1180 -0
- package/dist/Component/ComponentProvider.mjs +10 -5
- package/dist/Element/JsxManager.mjs +1 -0
- package/dist/Element/PluginRemote.d.ts +3 -1
- package/dist/Element/PluginRemote.mjs +9 -9
- package/dist/Element/helpers/elementConstants.mjs +28 -0
- package/dist/Element/helpers/elementUtils.mjs +1 -1
- package/dist/Element/helpers/loadComponent.d.ts +6 -1
- package/dist/Element/helpers/loadComponent.mjs +7 -7
- package/dist/Element/helpers/pluginSelector.mjs +1 -0
- package/dist/Element/hooks/useElementDataSource.mjs +23 -16
- package/dist/Element/hooks/useElementInternal.mjs +60 -52
- package/dist/Element/hooks/useInternalClassName.mjs +19 -18
- package/dist/Element/hooks/useKeyTriggers.d.ts +18 -0
- package/dist/Element/hooks/useKeyTriggers.mjs +36 -0
- package/dist/Element/hooks/useRootElementInteractions.mjs +65 -56
- package/dist/Element/hooks/useRscData.mjs +20 -15
- package/dist/dataSource/GlobalSources.mjs +114 -80
- package/dist/dataSource/getSourcesByElementId.mjs +2 -2
- package/dist/elements/advanced/BlockJsx/BlockJsx.mjs +1 -1
- package/dist/elements/advanced/NodeHtml/declaration.d.ts +1 -1
- package/dist/elements/advanced/NodeHtml/index.d.ts +1 -1
- package/dist/elements/basic/Button/Button.d.ts +10 -3
- package/dist/elements/basic/Button/Button.mjs +5 -5
- package/dist/elements/basic/Button/Settings.d.ts +2 -1
- package/dist/elements/basic/Button/Settings.mjs +14 -7
- package/dist/elements/basic/Button/declaration.d.ts +8 -3
- package/dist/elements/basic/Button/declaration.mjs +14 -6
- package/dist/elements/basic/Button/index.d.ts +8 -3
- package/dist/elements/basic/Dropdown/Dropdown.mjs +48 -39
- package/dist/elements/basic/Dropdown/declaration.d.ts +3 -0
- package/dist/elements/basic/Dropdown/declaration.mjs +9 -3
- package/dist/elements/basic/Dropdown/index.d.ts +3 -0
- package/dist/elements/basic/Dropdown/useDropdown.d.ts +6 -1
- package/dist/elements/basic/Dropdown/useDropdown.mjs +58 -41
- package/dist/elements/basic/Dropdown/useDropdownTrigger.d.ts +26 -0
- package/dist/elements/basic/Dropdown/useDropdownTrigger.mjs +30 -0
- package/dist/elements/basic/Heading/declaration.d.ts +9 -6
- package/dist/elements/basic/Heading/declaration.mjs +17 -9
- package/dist/elements/basic/Heading/index.d.ts +9 -6
- package/dist/elements/basic/Link/Link.mjs +4 -1
- package/dist/elements/basic/Link/Settings.d.ts +2 -1
- package/dist/elements/basic/Link/Settings.mjs +31 -24
- package/dist/elements/basic/Link/declaration.d.ts +5 -1
- package/dist/elements/basic/Link/declaration.mjs +16 -3
- package/dist/elements/basic/Link/index.d.ts +5 -1
- package/dist/elements/basic/Markdown/declaration.d.ts +1 -1
- package/dist/elements/basic/Markdown/declaration.mjs +1 -1
- package/dist/elements/basic/Markdown/index.d.ts +1 -1
- package/dist/elements/basic/RichText/declaration.d.ts +3 -0
- package/dist/elements/basic/RichText/declaration.mjs +8 -3
- package/dist/elements/basic/RichText/index.d.ts +3 -0
- package/dist/elements/basic/Text/declaration.d.ts +1 -1
- package/dist/elements/basic/Text/declaration.mjs +1 -1
- package/dist/elements/basic/Text/index.d.ts +1 -1
- package/dist/elements/basic/ThemeToggle/ThemeToggle.mjs +3 -0
- package/dist/elements/basic/ThemeToggle/declaration.d.ts +3 -0
- package/dist/elements/basic/ThemeToggle/declaration.mjs +4 -3
- package/dist/elements/basic/ThemeToggle/index.d.ts +3 -0
- package/dist/elements/declarations/index.d.ts +217 -17
- package/dist/elements/declarations/index.mjs +24 -22
- package/dist/elements/form/Form/declaration.d.ts +3 -0
- package/dist/elements/form/Form/declaration.mjs +4 -3
- package/dist/elements/form/Form/index.d.ts +3 -0
- package/dist/elements/form/FormControl/FormControl.d.ts +18 -6
- package/dist/elements/form/FormControl/FormControl.mjs +135 -127
- package/dist/elements/form/FormControl/Settings.d.ts +3 -1
- package/dist/elements/form/FormControl/Settings.mjs +73 -57
- package/dist/elements/form/FormControl/components/Label.d.ts +3 -1
- package/dist/elements/form/FormControl/components/Label.mjs +20 -18
- package/dist/elements/form/FormControl/components/visuallyHidden.d.ts +6 -0
- package/dist/elements/form/FormControl/components/visuallyHidden.mjs +14 -0
- package/dist/elements/form/FormControl/declaration.d.ts +5 -0
- package/dist/elements/form/FormControl/declaration.mjs +46 -30
- package/dist/elements/form/FormControl/hocs/withFieldValue.mjs +68 -61
- package/dist/elements/form/FormControl/index.d.ts +5 -0
- package/dist/elements/form/FormControl/inputs/Checkbox.d.ts +6 -1
- package/dist/elements/form/FormControl/inputs/Checkbox.mjs +5 -3
- package/dist/elements/form/FormControl/inputs/Input.d.ts +8 -1
- package/dist/elements/form/FormControl/inputs/Input.mjs +44 -38
- package/dist/elements/form/FormControl/inputs/Select.d.ts +6 -1
- package/dist/elements/form/FormControl/inputs/Select.mjs +12 -10
- package/dist/elements/form/FormControl/inputs/Textarea.d.ts +8 -1
- package/dist/elements/form/FormControl/inputs/Textarea.mjs +26 -21
- package/dist/elements/form/FormControl/inputs/useFocusWhenShown.d.ts +7 -0
- package/dist/elements/form/FormControl/inputs/useFocusWhenShown.mjs +9 -0
- package/dist/elements/index.d.ts +3 -1
- package/dist/elements/index.mjs +16 -14
- package/dist/elements/internal/LayoutContainer/declaration.d.ts +3 -0
- package/dist/elements/internal/LayoutContainer/declaration.mjs +15 -3
- package/dist/elements/internal/LayoutContainer/index.d.ts +3 -0
- package/dist/elements/media/FontAwesome/FontAwesome.d.ts +8 -1
- package/dist/elements/media/FontAwesome/FontAwesome.mjs +12 -5
- package/dist/elements/media/FontAwesome/Settings.d.ts +2 -1
- package/dist/elements/media/FontAwesome/Settings.mjs +29 -22
- package/dist/elements/media/FontAwesome/declaration.d.ts +1 -0
- package/dist/elements/media/FontAwesome/index.d.ts +1 -0
- package/dist/elements/media/Image/Image.d.ts +13 -2
- package/dist/elements/media/Image/Image.mjs +25 -25
- package/dist/elements/media/Image/Settings.d.ts +3 -1
- package/dist/elements/media/Image/Settings.mjs +29 -15
- package/dist/elements/media/Image/declaration.d.ts +7 -1
- package/dist/elements/media/Image/declaration.mjs +16 -3
- package/dist/elements/media/Image/index.d.ts +7 -1
- package/dist/elements/provider/ApiContainer/ApiContainer.mjs +145 -137
- package/dist/elements/provider/ApiContainer/declaration.d.ts +14 -1
- package/dist/elements/provider/ApiContainer/declaration.mjs +41 -4
- package/dist/elements/provider/ApiContainer/helpers/isEmptyAnswer.d.ts +16 -0
- package/dist/elements/provider/ApiContainer/helpers/isEmptyAnswer.mjs +4 -0
- package/dist/elements/provider/ApiContainer/helpers/queryInput.d.ts +5 -0
- package/dist/elements/provider/ApiContainer/helpers/queryInput.mjs +12 -0
- package/dist/elements/provider/ApiContainer/index.d.ts +14 -1
- package/dist/elements/provider/Channel/Channel.d.ts +26 -0
- package/dist/elements/provider/Channel/Channel.mjs +92 -0
- package/dist/elements/provider/Channel/Settings.d.ts +9 -0
- package/dist/elements/provider/Channel/Settings.mjs +38 -0
- package/dist/elements/provider/Channel/declaration.d.ts +138 -0
- package/dist/elements/provider/Channel/declaration.mjs +125 -0
- package/dist/elements/provider/Channel/index.d.ts +137 -0
- package/dist/elements/provider/Channel/index.mjs +6 -0
- package/dist/elements/settings.mjs +25 -23
- package/dist/elements/structure/Container/Container.d.ts +16 -2
- package/dist/elements/structure/Container/Container.mjs +18 -9
- package/dist/elements/structure/Container/Settings.d.ts +4 -2
- package/dist/elements/structure/Container/Settings.mjs +110 -69
- package/dist/elements/structure/Container/declaration.d.ts +12 -1
- package/dist/elements/structure/Container/declaration.mjs +35 -3
- package/dist/elements/structure/Container/index.d.ts +6 -1
- package/dist/elements/structure/Container/index.mjs +3 -3
- package/dist/elements/structure/DialogContainer/DialogContainer.mjs +123 -100
- package/dist/elements/structure/List/declaration.d.ts +4 -0
- package/dist/elements/structure/List/declaration.mjs +7 -3
- package/dist/elements/structure/List/index.d.ts +4 -0
- package/dist/elements/structure/ModalContainer/ModalContainer.mjs +92 -80
- package/dist/elements/structure/ModalContainer/metadataFromText.d.ts +1 -0
- package/dist/elements/structure/ModalContainer/metadataFromText.mjs +10 -0
- package/dist/elements/structure/ModalContainer/useModalDialog.d.ts +20 -0
- package/dist/elements/structure/ModalContainer/useModalDialog.mjs +31 -0
- package/dist/elements/structure/Pagination/Pagination.d.ts +6 -1
- package/dist/elements/structure/Pagination/Pagination.mjs +23 -21
- package/dist/elements/structure/Pagination/Settings.d.ts +2 -1
- package/dist/elements/structure/Pagination/Settings.mjs +16 -9
- package/dist/elements/structure/Pagination/declaration.d.ts +5 -0
- package/dist/elements/structure/Pagination/declaration.mjs +7 -3
- package/dist/elements/structure/Pagination/index.d.ts +5 -0
- package/dist/elements/structure/TabContainer/TabContainer.mjs +19 -17
- package/dist/elements/structure/TabContainer/TabContainerBody/TabContainerBody.mjs +8 -6
- package/dist/elements/structure/TabContainer/TabContainerContext.d.ts +2 -0
- package/dist/elements/structure/TabContainer/TabContainerHeader/TabContainerHeader.mjs +18 -14
- package/dist/elements/structure/TabContainer/TabContainerItem/TabContainerItem.d.ts +5 -1
- package/dist/elements/structure/TabContainer/TabContainerItem/TabContainerItem.mjs +48 -13
- package/dist/elements/structure/TabContainer/TabContainerItem/declaration.d.ts +1 -1
- package/dist/index.d.ts +220 -16
- package/dist/index.mjs +20 -17
- package/dist/realtime/useChannel.d.ts +35 -0
- package/dist/realtime/useChannel.mjs +57 -0
- package/package.json +67 -11
- package/dist/elements/media/FontAwesome/FontAwesome.stories-paused.d.ts +0 -1
|
@@ -1,78 +1,87 @@
|
|
|
1
1
|
import e from "./useElementInteractions.mjs";
|
|
2
2
|
import t from "./useInternalClassName.mjs";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import f from "
|
|
9
|
-
import
|
|
3
|
+
import n from "./useKeyTriggers.mjs";
|
|
4
|
+
import { interactionBasicTriggers as r, nativeEventsList as i } from "../helpers/elementConstants.mjs";
|
|
5
|
+
import { use as a, useCallback as o, useContext as s, useEffect as c, useMemo as l } from "react";
|
|
6
|
+
import { get as u } from "@plitzi/plitzi-ui/helpers";
|
|
7
|
+
import { StoreContext as d } from "@plitzi/nexus/react";
|
|
8
|
+
import { emptyObject as f } from "@plitzi/sdk-shared/helpers/utils";
|
|
9
|
+
import p from "clsx";
|
|
10
|
+
import { liveSources as m } from "@plitzi/sdk-shared/dataSource";
|
|
11
|
+
import { pConsole as h } from "@plitzi/sdk-shared/devTools/utils/PlitziConsole";
|
|
10
12
|
//#region src/Element/hooks/useRootElementInteractions.ts
|
|
11
|
-
var
|
|
12
|
-
let { id:
|
|
13
|
-
i || e.preventDefault(), r && r(e)
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
var g = (e) => typeof e == "object" && !!e, _ = /* @__PURE__ */ new WeakSet(), v = (e) => "nativeEvent" in e && g(e.nativeEvent) ? e.nativeEvent : e, y = ({ elementContext: y, InteractionsContext: b, previewMode: x, debugMode: S, baseElementId: C, className: w, interactionTriggers: T, interactionCallbacks: E, otherProps: D }) => {
|
|
14
|
+
let { id: O, className: k, attributes: A, definition: j, definition: { interactions: M }, plitziElementLayout: N, elementState: P, setElementState: F } = y, { interactionsManager: I, useInteractions: L } = a(b), R = o((e, t, n, r, i = !1) => {
|
|
15
|
+
i || e.preventDefault(), r && r(e);
|
|
16
|
+
let a = v(e);
|
|
17
|
+
_.has(a) || (i || _.add(a), I.interactionTrigger(t, n, { event: e }));
|
|
18
|
+
}, [I]), z = l(() => !x || !M ? {} : Object.values(M).filter((e) => e.type === "trigger" && e.action && i.includes(e.action) && e.enabled).reduce((e, t) => {
|
|
19
|
+
let n = u(t, "params.propagateEvent", !1);
|
|
16
20
|
return {
|
|
17
21
|
...e,
|
|
18
|
-
[t.action]: (e) =>
|
|
22
|
+
[t.action]: (e) => R(e, O, t.action, D[t.action], n)
|
|
19
23
|
};
|
|
20
24
|
}, {}), [
|
|
21
|
-
w,
|
|
22
25
|
O,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
...
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
M,
|
|
27
|
+
D,
|
|
28
|
+
x,
|
|
29
|
+
R
|
|
30
|
+
]), B = s(d), V = o(() => {
|
|
31
|
+
let e = B?.getPath("runtime.sources");
|
|
32
|
+
return m(g(e) ? e : f, B?.getPath("runtime.state"), B?.getPath("schema.settings.computed"));
|
|
33
|
+
}, [B]), H = o(() => ({ dataSource: V() }), [V]), U = l(() => ({
|
|
34
|
+
...r,
|
|
35
|
+
...T
|
|
36
|
+
}), [T]), W = e({
|
|
37
|
+
attributes: A,
|
|
38
|
+
definition: j,
|
|
39
|
+
setElementState: F
|
|
36
40
|
});
|
|
37
|
-
|
|
38
|
-
id:
|
|
39
|
-
interactions:
|
|
40
|
-
triggers:
|
|
41
|
-
callbacks:
|
|
42
|
-
...
|
|
43
|
-
...
|
|
44
|
-
}), [
|
|
45
|
-
getAdditionalParams:
|
|
46
|
-
}),
|
|
47
|
-
|
|
41
|
+
L({
|
|
42
|
+
id: O,
|
|
43
|
+
interactions: M,
|
|
44
|
+
triggers: U,
|
|
45
|
+
callbacks: l(() => ({
|
|
46
|
+
...E,
|
|
47
|
+
...W
|
|
48
|
+
}), [E, W]),
|
|
49
|
+
getAdditionalParams: H
|
|
50
|
+
}), n({
|
|
51
|
+
id: O,
|
|
52
|
+
interactions: M,
|
|
53
|
+
previewMode: x,
|
|
54
|
+
interactionsManager: I
|
|
55
|
+
}), c(() => {
|
|
56
|
+
if (!x || !M || !Object.keys(M).length) return;
|
|
48
57
|
let e = !1;
|
|
49
58
|
return queueMicrotask(() => {
|
|
50
|
-
e ||
|
|
59
|
+
e || I.interactionTrigger(O, "onLoad", {});
|
|
51
60
|
}), () => {
|
|
52
61
|
e = !0;
|
|
53
62
|
};
|
|
54
|
-
}, []),
|
|
55
|
-
if (
|
|
56
|
-
|
|
63
|
+
}, []), c(() => {
|
|
64
|
+
if (S) return h.addProviderMethod(`getElementDataSource-${O}`, V), () => {
|
|
65
|
+
h.removeProviderMethod(`getElementDataSource-${O}`);
|
|
57
66
|
};
|
|
58
67
|
}, [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
68
|
+
S,
|
|
69
|
+
V,
|
|
70
|
+
O
|
|
62
71
|
]);
|
|
63
|
-
let
|
|
64
|
-
id:
|
|
65
|
-
className:
|
|
66
|
-
previewMode:
|
|
67
|
-
baseElementId:
|
|
68
|
-
definition:
|
|
69
|
-
elementState:
|
|
70
|
-
plitziElementLayout:
|
|
72
|
+
let G = t({
|
|
73
|
+
id: O,
|
|
74
|
+
className: w,
|
|
75
|
+
previewMode: x,
|
|
76
|
+
baseElementId: C,
|
|
77
|
+
definition: j,
|
|
78
|
+
elementState: P,
|
|
79
|
+
plitziElementLayout: N
|
|
71
80
|
});
|
|
72
81
|
return {
|
|
73
|
-
className:
|
|
74
|
-
events:
|
|
82
|
+
className: p(k, G),
|
|
83
|
+
events: z
|
|
75
84
|
};
|
|
76
85
|
};
|
|
77
86
|
//#endregion
|
|
78
|
-
export {
|
|
87
|
+
export { y as default };
|
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import e from "./useElement.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import r from "@plitzi/sdk-shared/server/rsc/
|
|
2
|
+
import { useRef as t } from "react";
|
|
3
|
+
import { useCommonStore as n } from "@plitzi/sdk-shared/store";
|
|
4
|
+
import { currentRscLocation as r, rscDataPath as i } from "@plitzi/sdk-shared/server/rsc/refreshRsc";
|
|
5
|
+
import a from "@plitzi/sdk-shared/server/rsc/useRscRefresh";
|
|
5
6
|
//#region src/Element/hooks/useRscData.ts
|
|
6
|
-
var
|
|
7
|
-
let { id:
|
|
7
|
+
var o = () => {
|
|
8
|
+
let { id: o, rootId: s } = e(), [[c = !1, l = !1, u = !1, d, f, p, m]] = n([
|
|
8
9
|
"rsc.enabled",
|
|
9
10
|
"rsc.loaded",
|
|
10
11
|
"rsc.stale",
|
|
11
12
|
"rsc.location",
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
i(o),
|
|
14
|
+
"navigation.currentPageId",
|
|
15
|
+
"schema.pages"
|
|
16
|
+
]), h = a(), g = d !== void 0 && d !== r() || s !== void 0 && s !== p && Array.isArray(m) && m.includes(s), _ = t(void 0);
|
|
17
|
+
!g && f !== void 0 && (_.current = f);
|
|
18
|
+
let v = g && _.current !== void 0 ? _.current : f;
|
|
14
19
|
return {
|
|
15
|
-
enabled:
|
|
16
|
-
loaded:
|
|
17
|
-
stale:
|
|
18
|
-
location:
|
|
19
|
-
elementData:
|
|
20
|
-
isServerElement:
|
|
21
|
-
refresh:
|
|
20
|
+
enabled: c,
|
|
21
|
+
loaded: l,
|
|
22
|
+
stale: u,
|
|
23
|
+
location: d,
|
|
24
|
+
elementData: v ?? null,
|
|
25
|
+
isServerElement: v !== void 0,
|
|
26
|
+
refresh: h
|
|
22
27
|
};
|
|
23
28
|
};
|
|
24
29
|
//#endregion
|
|
25
|
-
export {
|
|
30
|
+
export { o as default };
|
|
@@ -1,70 +1,76 @@
|
|
|
1
|
-
import { use as e, useCallback as t, useMemo as n } from "react";
|
|
2
|
-
import { useCommonStore as
|
|
3
|
-
import { get as
|
|
4
|
-
import { getPathsFromObeject as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
import { use as e, useCallback as t, useMemo as n, useRef as r } from "react";
|
|
2
|
+
import { useCommonStore as i, useCommonStoreSync as a, useRenderSettings as o } from "@plitzi/sdk-shared/store";
|
|
3
|
+
import { get as s } from "@plitzi/plitzi-ui/helpers";
|
|
4
|
+
import { getPathsFromObeject as c } from "@plitzi/sdk-shared/helpers/utils";
|
|
5
|
+
import { evaluateComputed as l, resolveVariables as u } from "@plitzi/sdk-shared/dataSource";
|
|
6
|
+
import d, { SPACE_THEME_AREA as f } from "@plitzi/sdk-shared/theme/useTheme";
|
|
7
|
+
import p from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
|
|
8
|
+
import m from "@plitzi/sdk-auth/AuthContext";
|
|
9
|
+
import h from "@plitzi/sdk-shared/hooks/useStableValue";
|
|
10
10
|
//#region src/dataSource/GlobalSources.tsx
|
|
11
|
-
var
|
|
12
|
-
let { environment:
|
|
11
|
+
var g = ({ children: g }) => {
|
|
12
|
+
let { environment: _ } = o(), [[v, y, b, x, S, C, w]] = i([
|
|
13
13
|
"schema.variables",
|
|
14
14
|
"navigation.routeParams",
|
|
15
15
|
"navigation.queryParams",
|
|
16
16
|
"navigation.hostname",
|
|
17
17
|
"navigation.origin",
|
|
18
|
+
"navigation.href",
|
|
18
19
|
"navigation.currentPageId"
|
|
19
|
-
]),
|
|
20
|
-
routeParams:
|
|
21
|
-
queryParams:
|
|
22
|
-
hostname:
|
|
23
|
-
environment:
|
|
20
|
+
]), T = h(n(() => u(v, {
|
|
21
|
+
routeParams: y,
|
|
22
|
+
queryParams: b,
|
|
23
|
+
hostname: x,
|
|
24
|
+
environment: _
|
|
24
25
|
}), [
|
|
25
|
-
h,
|
|
26
|
-
y,
|
|
27
|
-
v,
|
|
28
26
|
_,
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
x,
|
|
28
|
+
b,
|
|
29
|
+
y,
|
|
30
|
+
v
|
|
31
|
+
])), E = t(() => c(T).map((e) => ({
|
|
31
32
|
path: e,
|
|
32
33
|
name: `variables.${e}`
|
|
33
|
-
})), [
|
|
34
|
-
|
|
34
|
+
})), [T]);
|
|
35
|
+
p({
|
|
35
36
|
id: "global",
|
|
36
37
|
source: "variables",
|
|
37
38
|
name: "Variables",
|
|
38
|
-
fields:
|
|
39
|
-
}),
|
|
40
|
-
let [
|
|
39
|
+
fields: E
|
|
40
|
+
}), a("runtime.sources.variables", T);
|
|
41
|
+
let [D = {}] = i("pageDefinitions"), O = n(() => Object.values(D).map((e) => ({
|
|
41
42
|
value: e.id,
|
|
42
|
-
label:
|
|
43
|
-
})), [
|
|
44
|
-
routeParams:
|
|
45
|
-
queryParams:
|
|
46
|
-
origin:
|
|
47
|
-
|
|
43
|
+
label: s(e, "attributes.name", e.id)
|
|
44
|
+
})), [D]), k = n(() => ({
|
|
45
|
+
routeParams: y,
|
|
46
|
+
queryParams: b,
|
|
47
|
+
origin: S,
|
|
48
|
+
href: C,
|
|
49
|
+
currentPageId: w
|
|
48
50
|
}), [
|
|
49
|
-
|
|
50
|
-
v,
|
|
51
|
+
y,
|
|
51
52
|
b,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
S,
|
|
54
|
+
C,
|
|
55
|
+
w
|
|
56
|
+
]), A = t(() => {
|
|
57
|
+
let e = c({
|
|
58
|
+
routeParams: y,
|
|
59
|
+
queryParams: b
|
|
57
60
|
}).map((e) => ({
|
|
58
61
|
path: e,
|
|
59
62
|
name: `navigation.${e}`
|
|
60
63
|
})), t = {
|
|
61
64
|
path: "origin",
|
|
62
65
|
name: "Origin"
|
|
63
|
-
}, n =
|
|
66
|
+
}, n = {
|
|
67
|
+
path: "href",
|
|
68
|
+
name: "This page’s address"
|
|
69
|
+
}, r = O.length > 0 ? {
|
|
64
70
|
path: "currentPageId",
|
|
65
71
|
name: "Current Page",
|
|
66
72
|
inputType: "select",
|
|
67
|
-
values:
|
|
73
|
+
values: O
|
|
68
74
|
} : {
|
|
69
75
|
path: "currentPageId",
|
|
70
76
|
name: "Current Page"
|
|
@@ -72,79 +78,107 @@ var m = ({ children: m }) => {
|
|
|
72
78
|
return [
|
|
73
79
|
...e,
|
|
74
80
|
t,
|
|
75
|
-
n
|
|
81
|
+
n,
|
|
82
|
+
r
|
|
76
83
|
];
|
|
77
84
|
}, [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
85
|
+
y,
|
|
86
|
+
b,
|
|
87
|
+
O
|
|
81
88
|
]);
|
|
82
|
-
|
|
89
|
+
p({
|
|
83
90
|
id: "global",
|
|
84
91
|
source: "navigation",
|
|
85
92
|
name: "Navigation",
|
|
86
|
-
fields:
|
|
87
|
-
}),
|
|
88
|
-
let { user:
|
|
89
|
-
isAuthenticated:
|
|
90
|
-
...
|
|
91
|
-
accessToken:
|
|
93
|
+
fields: A
|
|
94
|
+
}), a("runtime.sources.navigation", k);
|
|
95
|
+
let { user: j, authenticated: M, state: N } = e(m), [P = "basic"] = i("schema.settings.userProvider"), F = n(() => P === "" ? {} : {
|
|
96
|
+
isAuthenticated: M,
|
|
97
|
+
...N === void 0 ? {} : { status: N },
|
|
98
|
+
accessToken: j?.accessToken ?? "",
|
|
92
99
|
details: {
|
|
93
100
|
username: "",
|
|
94
101
|
email: "",
|
|
95
102
|
roles: "",
|
|
96
103
|
permissions: "",
|
|
97
104
|
verified: "",
|
|
98
|
-
...
|
|
105
|
+
...j?.details ?? {}
|
|
99
106
|
}
|
|
100
107
|
}, [
|
|
108
|
+
P,
|
|
101
109
|
j,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
]), N = t(() => s(M).map((e) => ({
|
|
110
|
+
M,
|
|
111
|
+
N
|
|
112
|
+
]), I = t(() => c(F).map((e) => ({
|
|
106
113
|
path: e,
|
|
107
114
|
name: `user.${e}`
|
|
108
|
-
})), [
|
|
109
|
-
|
|
115
|
+
})), [F]);
|
|
116
|
+
p({
|
|
110
117
|
id: "global",
|
|
111
118
|
source: "auth",
|
|
112
119
|
name: "Auth State",
|
|
113
|
-
fields:
|
|
114
|
-
}),
|
|
115
|
-
let [
|
|
120
|
+
fields: I
|
|
121
|
+
}), a("runtime.sources.auth", F);
|
|
122
|
+
let [L] = i("runtime.state"), R = t(() => c(L).map((e) => ({
|
|
116
123
|
path: e,
|
|
117
124
|
name: `state.${e}`
|
|
118
|
-
})), [
|
|
119
|
-
|
|
125
|
+
})), [L]);
|
|
126
|
+
p({
|
|
120
127
|
id: "global",
|
|
121
128
|
source: "state",
|
|
122
129
|
name: "State",
|
|
123
|
-
fields:
|
|
124
|
-
}),
|
|
125
|
-
let [
|
|
130
|
+
fields: R
|
|
131
|
+
}), a("runtime.sources.state", L);
|
|
132
|
+
let [z] = i("runtime.host"), B = t(() => c(z).map((e) => ({
|
|
126
133
|
path: e,
|
|
127
134
|
name: `host.${e}`
|
|
128
|
-
})), [
|
|
129
|
-
|
|
135
|
+
})), [z]);
|
|
136
|
+
p({
|
|
130
137
|
id: "global",
|
|
131
138
|
source: "host",
|
|
132
139
|
name: "Host",
|
|
133
|
-
fields:
|
|
134
|
-
}),
|
|
135
|
-
let { theme:
|
|
136
|
-
mode:
|
|
137
|
-
resolved:
|
|
138
|
-
}), [
|
|
140
|
+
fields: B
|
|
141
|
+
}), a("runtime.sources.host", z);
|
|
142
|
+
let { theme: V, resolvedTheme: H } = d(f), U = n(() => ({
|
|
143
|
+
mode: V,
|
|
144
|
+
resolved: H
|
|
145
|
+
}), [V, H]), W = t(() => c(U).map((e) => ({
|
|
139
146
|
path: e,
|
|
140
147
|
name: `theme.${e}`
|
|
141
|
-
})), [
|
|
142
|
-
|
|
148
|
+
})), [U]);
|
|
149
|
+
p({
|
|
143
150
|
id: "global",
|
|
144
151
|
source: "theme",
|
|
145
152
|
name: "Theme",
|
|
146
|
-
fields:
|
|
147
|
-
}),
|
|
153
|
+
fields: W
|
|
154
|
+
}), a("runtime.sources.theme", U);
|
|
155
|
+
let [G] = i("schema.settings.computed"), K = r(void 0), q = n(() => l(G ?? {}, {
|
|
156
|
+
variables: T,
|
|
157
|
+
navigation: k,
|
|
158
|
+
auth: F,
|
|
159
|
+
state: L ?? {},
|
|
160
|
+
host: z ?? {},
|
|
161
|
+
theme: U
|
|
162
|
+
}, K.current), [
|
|
163
|
+
G,
|
|
164
|
+
T,
|
|
165
|
+
k,
|
|
166
|
+
F,
|
|
167
|
+
L,
|
|
168
|
+
z,
|
|
169
|
+
U
|
|
170
|
+
]);
|
|
171
|
+
K.current = q;
|
|
172
|
+
let J = t(() => c(q).map((e) => ({
|
|
173
|
+
path: e,
|
|
174
|
+
name: `computed.${e}`
|
|
175
|
+
})), [q]);
|
|
176
|
+
return p({
|
|
177
|
+
id: "global",
|
|
178
|
+
source: "computed",
|
|
179
|
+
name: "Computed",
|
|
180
|
+
fields: J
|
|
181
|
+
}), a("runtime.sources.computed", q), g;
|
|
148
182
|
};
|
|
149
183
|
//#endregion
|
|
150
|
-
export {
|
|
184
|
+
export { g as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import e from "@plitzi/sdk-schema/helpers/
|
|
1
|
+
import { renderContext as e } from "@plitzi/sdk-schema/helpers/elementTree";
|
|
2
2
|
//#region src/dataSource/getSourcesByElementId.ts
|
|
3
3
|
var t = (t = {}, n, r) => {
|
|
4
4
|
if (!r || !n) return {};
|
|
5
|
-
let i = e
|
|
5
|
+
let i = e(n, r);
|
|
6
6
|
return Object.values(t).filter((e) => e.meta.id === "global" || !!e.meta.id && i.includes(e.meta.id)).reduce((e, t) => ({
|
|
7
7
|
...e,
|
|
8
8
|
[t.id]: t
|
|
@@ -78,6 +78,7 @@ declare const declaration: {
|
|
|
78
78
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
79
79
|
onLoad?: import('react').ReactEventHandler<"span"> | undefined;
|
|
80
80
|
onClick?: import('react').MouseEventHandler<"span"> | undefined;
|
|
81
|
+
onPointerDown?: import('react').PointerEventHandler<"span"> | undefined;
|
|
81
82
|
onMouseEnter?: import('react').MouseEventHandler<"span"> | undefined;
|
|
82
83
|
onMouseLeave?: import('react').MouseEventHandler<"span"> | undefined;
|
|
83
84
|
onFocus?: import('react').FocusEventHandler<"span"> | undefined;
|
|
@@ -266,7 +267,6 @@ declare const declaration: {
|
|
|
266
267
|
onTouchMoveCapture?: import('react').TouchEventHandler<"span"> | undefined;
|
|
267
268
|
onTouchStart?: import('react').TouchEventHandler<"span"> | undefined;
|
|
268
269
|
onTouchStartCapture?: import('react').TouchEventHandler<"span"> | undefined;
|
|
269
|
-
onPointerDown?: import('react').PointerEventHandler<"span"> | undefined;
|
|
270
270
|
onPointerDownCapture?: import('react').PointerEventHandler<"span"> | undefined;
|
|
271
271
|
onPointerMove?: import('react').PointerEventHandler<"span"> | undefined;
|
|
272
272
|
onPointerMoveCapture?: import('react').PointerEventHandler<"span"> | undefined;
|
|
@@ -70,6 +70,7 @@ declare const NodeHtml: {
|
|
|
70
70
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
71
71
|
onLoad?: import('react').ReactEventHandler<"span"> | undefined;
|
|
72
72
|
onClick?: import('react').MouseEventHandler<"span"> | undefined;
|
|
73
|
+
onPointerDown?: import('react').PointerEventHandler<"span"> | undefined;
|
|
73
74
|
onMouseEnter?: import('react').MouseEventHandler<"span"> | undefined;
|
|
74
75
|
onMouseLeave?: import('react').MouseEventHandler<"span"> | undefined;
|
|
75
76
|
onFocus?: import('react').FocusEventHandler<"span"> | undefined;
|
|
@@ -258,7 +259,6 @@ declare const NodeHtml: {
|
|
|
258
259
|
onTouchMoveCapture?: import('react').TouchEventHandler<"span"> | undefined;
|
|
259
260
|
onTouchStart?: import('react').TouchEventHandler<"span"> | undefined;
|
|
260
261
|
onTouchStartCapture?: import('react').TouchEventHandler<"span"> | undefined;
|
|
261
|
-
onPointerDown?: import('react').PointerEventHandler<"span"> | undefined;
|
|
262
262
|
onPointerDownCapture?: import('react').PointerEventHandler<"span"> | undefined;
|
|
263
263
|
onPointerMove?: import('react').PointerEventHandler<"span"> | undefined;
|
|
264
264
|
onPointerMoveCapture?: import('react').PointerEventHandler<"span"> | undefined;
|
|
@@ -20,12 +20,19 @@ export type ButtonProps = {
|
|
|
20
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
21
|
* of its own. An icon-only button without one is announced as nothing at all.
|
|
22
22
|
*
|
|
23
|
-
* The browser falls back to it by itself, so it is never copied into `aria-label
|
|
24
|
-
*
|
|
23
|
+
* The browser falls back to it by itself, so it is never copied into `aria-label` — and neither is `content`: the
|
|
24
|
+
* button's name is what it SHOWS, content and children together. An `aria-label` taken from `content` named a button
|
|
25
|
+
* whose words were among its children after the default "Button" instead.
|
|
25
26
|
*/
|
|
26
27
|
title?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The button's name, for when the words it shows do not say what it does: a key hint beside an icon ("V"), a count,
|
|
30
|
+
* an arrow. Read in place of everything inside it by screen readers and browser agents, so it says the whole of it —
|
|
31
|
+
* "Select (V)". Left empty, the button is named by what it shows, then by `title`.
|
|
32
|
+
*/
|
|
33
|
+
label?: string;
|
|
27
34
|
};
|
|
28
|
-
declare const Button: ({ ref, className, children, contentPlacement, content, subType, disabled, ariaExpanded, ariaPressed, title }: ButtonProps) => import('react').JSX.Element;
|
|
35
|
+
declare const Button: ({ ref, className, children, contentPlacement, content, subType, disabled, ariaExpanded, ariaPressed, title, label }: ButtonProps) => import('react').JSX.Element;
|
|
29
36
|
declare const _default: {
|
|
30
37
|
(props: import('../../../Element/hocs/withElement').WithElementProps<ButtonProps>): import('react').JSX.Element;
|
|
31
38
|
displayName: string;
|
|
@@ -4,16 +4,16 @@ import n from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
|
4
4
|
import { jsxs as r } from "react/jsx-runtime";
|
|
5
5
|
import i from "clsx";
|
|
6
6
|
//#region src/elements/basic/Button/Button.tsx
|
|
7
|
-
var a = ({ ref: e, className: a = "", children: o, contentPlacement: s = "after", content: c = "Button", subType: l = "button", disabled: u = !1, ariaExpanded: d, ariaPressed: f, title: p }) => {
|
|
8
|
-
let { settings: { previewMode:
|
|
7
|
+
var a = ({ ref: e, className: a = "", children: o, contentPlacement: s = "after", content: c = "Button", subType: l = "button", disabled: u = !1, ariaExpanded: d, ariaPressed: f, title: p, label: m }) => {
|
|
8
|
+
let { settings: { previewMode: h } } = n();
|
|
9
9
|
return /* @__PURE__ */ r(t, {
|
|
10
10
|
ref: e,
|
|
11
11
|
tag: "button",
|
|
12
|
-
type:
|
|
13
|
-
className: i("plitzi-component__button", a, { "container--empty--skip": !
|
|
12
|
+
type: h ? l : "button",
|
|
13
|
+
className: i("plitzi-component__button", a, { "container--empty--skip": !h && !o && c }),
|
|
14
14
|
disabled: u,
|
|
15
|
-
"aria-label": c || void 0,
|
|
16
15
|
title: p || void 0,
|
|
16
|
+
"aria-label": m || void 0,
|
|
17
17
|
"aria-expanded": d,
|
|
18
18
|
"aria-pressed": f,
|
|
19
19
|
children: [
|
|
@@ -4,7 +4,8 @@ type SettingsProps = {
|
|
|
4
4
|
subType?: 'button' | 'reset' | 'submit';
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
title?: string;
|
|
7
|
+
label?: string;
|
|
7
8
|
onUpdate?: (key: string, value: string | number | boolean) => void;
|
|
8
9
|
};
|
|
9
|
-
declare const Settings: ({ content, contentPlacement, subType, disabled, title, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
10
|
+
declare const Settings: ({ content, contentPlacement, subType, disabled, title, label, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
10
11
|
export default Settings;
|
|
@@ -4,28 +4,35 @@ import r from "@plitzi/plitzi-ui/Checkbox";
|
|
|
4
4
|
import i from "@plitzi/plitzi-ui/Input";
|
|
5
5
|
import a from "@plitzi/plitzi-ui/Select";
|
|
6
6
|
//#region src/elements/basic/Button/Settings.tsx
|
|
7
|
-
var o = ({ content: o = "Button", contentPlacement: s = "after", subType: c = "button", disabled: l = !1, title: u = "",
|
|
8
|
-
let
|
|
7
|
+
var o = ({ content: o = "Button", contentPlacement: s = "after", subType: c = "button", disabled: l = !1, title: u = "", label: d = "", onUpdate: f }) => {
|
|
8
|
+
let p = e((e) => f?.("content", e), [f]), m = e((e) => f?.("contentPlacement", e), [f]), h = e((e) => f?.("subType", e), [f]), g = e((e) => f?.("title", e), [f]), _ = e((e) => f?.("label", e), [f]), v = e((e) => f?.("disabled", e.target.checked), [f]);
|
|
9
9
|
return /* @__PURE__ */ n("div", {
|
|
10
10
|
className: "flex h-full flex-col gap-4 py-2",
|
|
11
11
|
children: [
|
|
12
12
|
/* @__PURE__ */ t(i, {
|
|
13
13
|
value: o,
|
|
14
14
|
label: "Content",
|
|
15
|
-
onChange:
|
|
15
|
+
onChange: p,
|
|
16
16
|
size: "xs"
|
|
17
17
|
}),
|
|
18
18
|
/* @__PURE__ */ t(i, {
|
|
19
19
|
value: u,
|
|
20
20
|
label: "Tooltip",
|
|
21
21
|
placeholder: "What the button does, for an icon-only one",
|
|
22
|
-
onChange:
|
|
22
|
+
onChange: g,
|
|
23
|
+
size: "xs"
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ t(i, {
|
|
26
|
+
value: d,
|
|
27
|
+
label: "Accessible Name",
|
|
28
|
+
placeholder: "When its words do not say what it does",
|
|
29
|
+
onChange: _,
|
|
23
30
|
size: "xs"
|
|
24
31
|
}),
|
|
25
32
|
/* @__PURE__ */ n(a, {
|
|
26
33
|
value: s,
|
|
27
34
|
label: "Mode",
|
|
28
|
-
onChange:
|
|
35
|
+
onChange: m,
|
|
29
36
|
size: "xs",
|
|
30
37
|
children: [
|
|
31
38
|
/* @__PURE__ */ t("option", {
|
|
@@ -45,7 +52,7 @@ var o = ({ content: o = "Button", contentPlacement: s = "after", subType: c = "b
|
|
|
45
52
|
/* @__PURE__ */ n(a, {
|
|
46
53
|
value: c,
|
|
47
54
|
label: "Button Type",
|
|
48
|
-
onChange:
|
|
55
|
+
onChange: h,
|
|
49
56
|
size: "xs",
|
|
50
57
|
children: [
|
|
51
58
|
/* @__PURE__ */ t("option", {
|
|
@@ -65,7 +72,7 @@ var o = ({ content: o = "Button", contentPlacement: s = "after", subType: c = "b
|
|
|
65
72
|
/* @__PURE__ */ t(r, {
|
|
66
73
|
checked: l,
|
|
67
74
|
label: "Is Disabled",
|
|
68
|
-
onChange:
|
|
75
|
+
onChange: v,
|
|
69
76
|
size: "xs"
|
|
70
77
|
})
|
|
71
78
|
]
|