@plitzi/sdk-elements 0.39.12 → 0.39.14
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 +28 -0
- package/dist/Element/PluginManager.mjs +13 -13
- package/dist/Element/hooks/useElementState.d.ts +1 -1
- package/dist/Element/hooks/useFullscreenInteractions.d.ts +11 -0
- package/dist/Element/hooks/useFullscreenInteractions.mjs +14 -0
- package/dist/Element/hooks/useRootElementInteractions.mjs +93 -87
- package/dist/builder/ruleFields.d.ts +1 -1
- package/dist/builder/ruleFields.mjs +5 -0
- package/dist/dataSource/GlobalSources.mjs +121 -104
- package/dist/dataSource/useAudienceScope.mjs +2 -1
- package/dist/dataSource/usePageClock.d.ts +12 -0
- package/dist/dataSource/usePageClock.mjs +19 -0
- package/dist/elements/basic/Countdown/Countdown.d.ts +23 -0
- package/dist/elements/basic/Countdown/Countdown.mjs +58 -0
- package/dist/elements/basic/Countdown/Settings.d.ts +12 -0
- package/dist/elements/basic/Countdown/Settings.mjs +94 -0
- package/dist/elements/basic/Countdown/declaration.d.ts +72 -0
- package/dist/elements/basic/Countdown/declaration.mjs +58 -0
- package/dist/elements/basic/Countdown/index.d.ts +69 -0
- package/dist/elements/basic/Countdown/index.mjs +5 -0
- package/dist/elements/declarations/index.d.ts +508 -7
- package/dist/elements/declarations/index.mjs +84 -72
- package/dist/elements/index.d.ts +13 -3
- package/dist/elements/index.mjs +76 -66
- package/dist/elements/media/Image/Image.d.ts +6 -1
- package/dist/elements/media/Image/Image.mjs +44 -35
- package/dist/elements/media/Image/Settings.d.ts +2 -1
- package/dist/elements/media/Image/Settings.mjs +26 -19
- package/dist/elements/media/Image/declaration.d.ts +2 -0
- package/dist/elements/media/Image/declaration.mjs +2 -1
- package/dist/elements/media/Image/index.d.ts +2 -0
- package/dist/elements/settings.mjs +92 -80
- package/dist/elements/structure/Container/Container.d.ts +2 -4
- package/dist/elements/structure/Container/Container.mjs +5 -6
- package/dist/elements/structure/Container/Settings.d.ts +1 -2
- package/dist/elements/structure/Container/Settings.mjs +5 -19
- package/dist/elements/structure/Container/declaration.d.ts +1 -2
- package/dist/elements/structure/Container/declaration.mjs +1 -3
- package/dist/elements/structure/Container/index.d.ts +1 -2
- package/dist/elements/structure/Disclosure/Disclosure.d.ts +26 -0
- package/dist/elements/structure/Disclosure/Disclosure.mjs +49 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/DisclosureSummary.d.ts +16 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/DisclosureSummary.mjs +19 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/Settings.d.ts +7 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/Settings.mjs +20 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/declaration.d.ts +59 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/declaration.mjs +47 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/index.d.ts +57 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/index.mjs +5 -0
- package/dist/elements/structure/Disclosure/Settings.d.ts +10 -0
- package/dist/elements/structure/Disclosure/Settings.mjs +47 -0
- package/dist/elements/structure/Disclosure/declaration.d.ts +66 -0
- package/dist/elements/structure/Disclosure/declaration.mjs +55 -0
- package/dist/elements/structure/Disclosure/index.d.ts +121 -0
- package/dist/elements/structure/Disclosure/index.mjs +9 -0
- package/dist/elements/structure/Disclosure/useDetails.d.ts +27 -0
- package/dist/elements/structure/Disclosure/useDetails.mjs +49 -0
- package/dist/elements/structure/TimeWindow/TimeWindow.mjs +29 -25
- package/dist/elements/structure/TimeWindow/TimeWindowContext.d.ts +6 -0
- package/dist/elements/structure/TimeWindow/TimeWindowContext.mjs +4 -0
- package/dist/elements/{testing → structure}/Variants/Settings.mjs +1 -1
- package/dist/elements/{testing → structure}/Variants/VariantItem/Settings.mjs +1 -1
- package/dist/elements/{testing → structure}/Variants/VariantItem/VariantItem.mjs +1 -1
- package/dist/elements/{testing → structure}/Variants/VariantItem/declaration.d.ts +1 -1
- package/dist/elements/{testing → structure}/Variants/VariantItem/declaration.mjs +2 -2
- package/dist/elements/{testing → structure}/Variants/VariantItem/index.d.ts +1 -1
- package/dist/elements/{testing → structure}/Variants/VariantItem/index.mjs +1 -1
- package/dist/elements/{testing → structure}/Variants/Variants.mjs +12 -12
- package/dist/elements/{testing → structure/Variants}/childOfItem.mjs +1 -1
- package/dist/elements/{testing → structure}/Variants/declaration.d.ts +1 -1
- package/dist/elements/{testing → structure}/Variants/declaration.mjs +3 -3
- package/dist/elements/{testing → structure}/Variants/index.d.ts +2 -2
- package/dist/elements/{testing → structure}/Variants/index.mjs +1 -1
- package/dist/elements/user/Account/Account.d.ts +25 -0
- package/dist/elements/user/Account/Account.mjs +104 -0
- package/dist/elements/user/Account/Settings.d.ts +10 -0
- package/dist/elements/user/Account/Settings.mjs +47 -0
- package/dist/elements/user/Account/declaration.d.ts +143 -0
- package/dist/elements/user/Account/declaration.mjs +123 -0
- package/dist/elements/user/Account/index.d.ts +141 -0
- package/dist/elements/user/Account/index.mjs +5 -0
- package/dist/elements/user/Avatar/Avatar.d.ts +19 -0
- package/dist/elements/user/Avatar/Avatar.mjs +26 -0
- package/dist/elements/user/Avatar/AvatarFace.d.ts +15 -0
- package/dist/elements/user/Avatar/AvatarFace.mjs +28 -0
- package/dist/elements/user/Avatar/Settings.d.ts +9 -0
- package/dist/elements/user/Avatar/Settings.mjs +38 -0
- package/dist/elements/user/Avatar/declaration.d.ts +65 -0
- package/dist/elements/user/Avatar/declaration.mjs +53 -0
- package/dist/elements/user/Avatar/faces.d.ts +10 -0
- package/dist/elements/user/Avatar/faces.mjs +10 -0
- package/dist/elements/user/Avatar/index.d.ts +63 -0
- package/dist/elements/user/Avatar/index.mjs +5 -0
- package/dist/elements/user/SignInForm/Settings.d.ts +16 -0
- package/dist/elements/user/SignInForm/Settings.mjs +64 -0
- package/dist/elements/user/SignInForm/SignInForm.d.ts +34 -0
- package/dist/elements/user/SignInForm/SignInForm.mjs +112 -0
- package/dist/elements/user/SignInForm/declaration.d.ts +120 -0
- package/dist/elements/user/SignInForm/declaration.mjs +99 -0
- package/dist/elements/user/SignInForm/index.d.ts +118 -0
- package/dist/elements/user/SignInForm/index.mjs +5 -0
- package/dist/index.d.ts +514 -6
- package/dist/index.mjs +84 -74
- package/package.json +7 -7
- /package/dist/elements/{testing → structure}/Variants/Settings.d.ts +0 -0
- /package/dist/elements/{testing → structure}/Variants/VariantItem/Settings.d.ts +0 -0
- /package/dist/elements/{testing → structure}/Variants/VariantItem/VariantItem.d.ts +0 -0
- /package/dist/elements/{testing → structure}/Variants/Variants.d.ts +0 -0
- /package/dist/elements/{testing → structure/Variants}/childOfItem.d.ts +0 -0
|
@@ -6,8 +6,8 @@ import o from "@plitzi/plitzi-ui/Checkbox";
|
|
|
6
6
|
import s from "@plitzi/plitzi-ui/Input";
|
|
7
7
|
import c from "@plitzi/plitzi-ui/Select";
|
|
8
8
|
// src/elements/media/Image/Settings.tsx
|
|
9
|
-
var l = ({ src: l = "",
|
|
10
|
-
let
|
|
9
|
+
var l = ({ src: l = "", fallbackSrc: u = "", alt: d = "", decorative: f = !1, variables: p, fetchPriority: m = "auto", loadMode: h = "auto", sizes: g = "100vw", width: _, height: v, onUpdate: y }) => {
|
|
10
|
+
let b = n(() => r(l, p, !0), [p, l]), x = e(y), S = t((e) => (t) => y?.(e, Math.max(0, Math.round(Number(t) || 0))), [y]), C = t((e) => y?.("decorative", e.target.checked), [y]);
|
|
11
11
|
return /* @__PURE__ */ a("div", {
|
|
12
12
|
className: "flex h-full flex-col gap-4 py-2",
|
|
13
13
|
children: [
|
|
@@ -16,37 +16,44 @@ var l = ({ src: l = "", alt: u = "", decorative: d = !1, variables: f, fetchPrio
|
|
|
16
16
|
children: [/* @__PURE__ */ i(s, {
|
|
17
17
|
value: l,
|
|
18
18
|
label: "Url",
|
|
19
|
-
onChange:
|
|
19
|
+
onChange: x.text("src"),
|
|
20
20
|
size: "xs"
|
|
21
|
-
}),
|
|
21
|
+
}), b && /* @__PURE__ */ a("div", {
|
|
22
22
|
className: "border-ui-line-strong relative mt-2 flex items-center justify-center rounded-sm border p-2",
|
|
23
23
|
children: [/* @__PURE__ */ i("div", {
|
|
24
24
|
className: "border-ui-line-strong bg-ui-panel absolute top-2 left-2 rounded-tl rounded-br border p-1 text-xs",
|
|
25
25
|
children: "Preview"
|
|
26
26
|
}), /* @__PURE__ */ i("img", {
|
|
27
|
-
src:
|
|
27
|
+
src: b,
|
|
28
28
|
alt: "",
|
|
29
29
|
className: "h-full w-full rounded-sm"
|
|
30
30
|
})]
|
|
31
31
|
})]
|
|
32
32
|
}),
|
|
33
|
-
|
|
33
|
+
/* @__PURE__ */ i(s, {
|
|
34
34
|
value: u,
|
|
35
|
+
label: "Fallback Url",
|
|
36
|
+
placeholder: "Shown when the Url is empty or does not load",
|
|
37
|
+
onChange: x.text("fallbackSrc"),
|
|
38
|
+
size: "xs"
|
|
39
|
+
}),
|
|
40
|
+
!f && /* @__PURE__ */ i(s, {
|
|
41
|
+
value: d,
|
|
35
42
|
label: "Alt Text",
|
|
36
43
|
placeholder: "What the picture shows, for who cannot see it",
|
|
37
|
-
onChange:
|
|
44
|
+
onChange: x.text("alt"),
|
|
38
45
|
size: "xs"
|
|
39
46
|
}),
|
|
40
47
|
/* @__PURE__ */ i(o, {
|
|
41
|
-
checked:
|
|
48
|
+
checked: f,
|
|
42
49
|
label: "Decorative (nothing to describe)",
|
|
43
|
-
onChange:
|
|
50
|
+
onChange: C,
|
|
44
51
|
size: "xs"
|
|
45
52
|
}),
|
|
46
53
|
/* @__PURE__ */ a(c, {
|
|
47
|
-
value:
|
|
54
|
+
value: m,
|
|
48
55
|
label: "Fetch Priority",
|
|
49
|
-
onChange:
|
|
56
|
+
onChange: x.text("fetchPriority"),
|
|
50
57
|
size: "xs",
|
|
51
58
|
children: [
|
|
52
59
|
/* @__PURE__ */ i("option", {
|
|
@@ -64,9 +71,9 @@ var l = ({ src: l = "", alt: u = "", decorative: d = !1, variables: f, fetchPrio
|
|
|
64
71
|
]
|
|
65
72
|
}),
|
|
66
73
|
/* @__PURE__ */ a(c, {
|
|
67
|
-
value:
|
|
74
|
+
value: h,
|
|
68
75
|
label: "Load Mode",
|
|
69
|
-
onChange:
|
|
76
|
+
onChange: x.text("loadMode"),
|
|
70
77
|
size: "xs",
|
|
71
78
|
children: [
|
|
72
79
|
/* @__PURE__ */ i("option", {
|
|
@@ -84,25 +91,25 @@ var l = ({ src: l = "", alt: u = "", decorative: d = !1, variables: f, fetchPrio
|
|
|
84
91
|
]
|
|
85
92
|
}),
|
|
86
93
|
/* @__PURE__ */ i(s, {
|
|
87
|
-
value:
|
|
94
|
+
value: g,
|
|
88
95
|
label: "Sizes",
|
|
89
96
|
placeholder: "(max-width: 48rem) 100vw, 360px",
|
|
90
|
-
onChange:
|
|
97
|
+
onChange: x.text("sizes"),
|
|
91
98
|
size: "xs"
|
|
92
99
|
}),
|
|
93
100
|
/* @__PURE__ */ a("div", {
|
|
94
101
|
className: "flex gap-2",
|
|
95
102
|
children: [/* @__PURE__ */ i(s, {
|
|
96
103
|
type: "number",
|
|
97
|
-
value:
|
|
104
|
+
value: _ ? String(_) : "",
|
|
98
105
|
label: "Width (px)",
|
|
99
|
-
onChange:
|
|
106
|
+
onChange: S("width"),
|
|
100
107
|
size: "xs"
|
|
101
108
|
}), /* @__PURE__ */ i(s, {
|
|
102
109
|
type: "number",
|
|
103
|
-
value:
|
|
110
|
+
value: v ? String(v) : "",
|
|
104
111
|
label: "Height (px)",
|
|
105
|
-
onChange:
|
|
112
|
+
onChange: S("height"),
|
|
106
113
|
size: "xs"
|
|
107
114
|
})]
|
|
108
115
|
})
|
|
@@ -12,6 +12,7 @@ declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElemen
|
|
|
12
12
|
readonly content: {
|
|
13
13
|
readonly attributes: {
|
|
14
14
|
readonly src: "";
|
|
15
|
+
readonly fallbackSrc: "";
|
|
15
16
|
readonly alt: "";
|
|
16
17
|
readonly decorative: false;
|
|
17
18
|
readonly fetchPriority: "auto";
|
|
@@ -47,6 +48,7 @@ declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElemen
|
|
|
47
48
|
alt?: string | undefined;
|
|
48
49
|
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
49
50
|
decorative?: boolean | undefined;
|
|
51
|
+
fallbackSrc?: string | undefined;
|
|
50
52
|
loadMode?: "auto" | "eager" | "lazy" | undefined;
|
|
51
53
|
}>>;
|
|
52
54
|
export default declaration;
|
|
@@ -18,6 +18,7 @@ var n = e()({
|
|
|
18
18
|
content: {
|
|
19
19
|
attributes: {
|
|
20
20
|
src: "",
|
|
21
|
+
fallbackSrc: "",
|
|
21
22
|
alt: "",
|
|
22
23
|
decorative: !1,
|
|
23
24
|
fetchPriority: "auto",
|
|
@@ -25,7 +26,7 @@ var n = e()({
|
|
|
25
26
|
},
|
|
26
27
|
definition: {
|
|
27
28
|
label: "Image",
|
|
28
|
-
description: "Displays an image from a URL. It starts 140px wide and as tall as the picture is for that width (`height: auto`, never wider than where it sits): a class that sets only a `width` or an `aspect-ratio` is obeyed, and `object-fit` decides how the picture fills a box that sets both."
|
|
29
|
+
description: "Displays an image from a URL. It starts 140px wide and as tall as the picture is for that width (`height: auto`, never wider than where it sits): a class that sets only a `width` or an `aspect-ratio` is obeyed, and `object-fit` decides how the picture fills a box that sets both. `fallbackSrc` is shown when `src` is empty or does not load (a product without a photo yet, a feed whose picture is gone), and the SDK’s placeholder when that fails too; a failed `src` is said on the image (`data-plitzi-failed`)."
|
|
29
30
|
},
|
|
30
31
|
market: {
|
|
31
32
|
category: "media",
|
|
@@ -8,6 +8,7 @@ declare const Image: import('react').FC<import('../../..').WithElementProps<impo
|
|
|
8
8
|
readonly content: {
|
|
9
9
|
readonly attributes: {
|
|
10
10
|
readonly src: "";
|
|
11
|
+
readonly fallbackSrc: "";
|
|
11
12
|
readonly alt: "";
|
|
12
13
|
readonly decorative: false;
|
|
13
14
|
readonly fetchPriority: "auto";
|
|
@@ -45,6 +46,7 @@ declare const Image: import('react').FC<import('../../..').WithElementProps<impo
|
|
|
45
46
|
alt?: string | undefined;
|
|
46
47
|
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
47
48
|
decorative?: boolean | undefined;
|
|
49
|
+
fallbackSrc?: string | undefined;
|
|
48
50
|
loadMode?: "auto" | "eager" | "lazy" | undefined;
|
|
49
51
|
}>>;
|
|
50
52
|
export default Image;
|
|
@@ -5,92 +5,104 @@ import r from "./advanced/NodeHtml/Settings.mjs";
|
|
|
5
5
|
import i from "./advanced/PlitziSdk/Settings.mjs";
|
|
6
6
|
import a from "./advanced/Reference/Settings.mjs";
|
|
7
7
|
import o from "./basic/Button/Settings.mjs";
|
|
8
|
-
import s from "./basic/
|
|
9
|
-
import c from "./basic/Dropdown/Settings.mjs";
|
|
10
|
-
import l from "./basic/
|
|
11
|
-
import u from "./basic/
|
|
12
|
-
import d from "./basic/
|
|
13
|
-
import f from "./basic/
|
|
14
|
-
import p from "./basic/
|
|
15
|
-
import m from "./basic/
|
|
16
|
-
import h from "./basic/
|
|
17
|
-
import g from "./
|
|
18
|
-
import _ from "./form/
|
|
19
|
-
import v from "./
|
|
20
|
-
import y from "./internal/
|
|
21
|
-
import b from "./internal/
|
|
22
|
-
import x from "./internal/
|
|
23
|
-
import S from "./
|
|
24
|
-
import C from "./media/
|
|
25
|
-
import w from "./media/
|
|
26
|
-
import T from "./media/
|
|
27
|
-
import E from "./media/
|
|
28
|
-
import D from "./media/
|
|
29
|
-
import O from "./
|
|
30
|
-
import k from "./provider/
|
|
31
|
-
import A from "./
|
|
32
|
-
import j from "./structure/Carousel/Settings.mjs";
|
|
33
|
-
import M from "./structure/
|
|
34
|
-
import N from "./structure/
|
|
35
|
-
import P from "./structure/
|
|
36
|
-
import F from "./structure/
|
|
37
|
-
import I from "./structure/
|
|
38
|
-
import L from "./structure/
|
|
39
|
-
import R from "./structure/
|
|
40
|
-
import z from "./structure/
|
|
41
|
-
import B from "./structure/
|
|
42
|
-
import V from "./structure/
|
|
43
|
-
import H from "./structure/TabContainer/
|
|
44
|
-
import U from "./structure/
|
|
45
|
-
import W from "./
|
|
46
|
-
import G from "./
|
|
8
|
+
import s from "./basic/Countdown/Settings.mjs";
|
|
9
|
+
import c from "./basic/Dropdown/DropdownPopup/Settings.mjs";
|
|
10
|
+
import l from "./basic/Dropdown/Settings.mjs";
|
|
11
|
+
import u from "./basic/Heading/Settings.mjs";
|
|
12
|
+
import d from "./basic/Link/Settings.mjs";
|
|
13
|
+
import f from "./basic/Markdown/Settings.mjs";
|
|
14
|
+
import p from "./basic/Paragraph/Settings.mjs";
|
|
15
|
+
import m from "./basic/RichText/Settings.mjs";
|
|
16
|
+
import h from "./basic/Text/Settings.mjs";
|
|
17
|
+
import g from "./basic/ThemeToggle/Settings.mjs";
|
|
18
|
+
import _ from "./form/Form/Settings.mjs";
|
|
19
|
+
import v from "./form/FormControl/Settings.mjs";
|
|
20
|
+
import y from "./internal/LayoutContainer/Settings.mjs";
|
|
21
|
+
import b from "./internal/Loading/Settings.mjs";
|
|
22
|
+
import x from "./internal/NotFound/Settings.mjs";
|
|
23
|
+
import S from "./internal/Page/Settings.mjs";
|
|
24
|
+
import C from "./media/Chart/Settings.mjs";
|
|
25
|
+
import w from "./media/Embed/Settings.mjs";
|
|
26
|
+
import T from "./media/FontAwesome/Settings.mjs";
|
|
27
|
+
import E from "./media/Image/Settings.mjs";
|
|
28
|
+
import D from "./media/Svg/Settings.mjs";
|
|
29
|
+
import O from "./media/Video/Settings.mjs";
|
|
30
|
+
import k from "./provider/ApiContainer/Settings.mjs";
|
|
31
|
+
import A from "./provider/Channel/Settings.mjs";
|
|
32
|
+
import j from "./structure/Carousel/CarouselTrack/Settings.mjs";
|
|
33
|
+
import M from "./structure/Carousel/Settings.mjs";
|
|
34
|
+
import N from "./structure/Container/Settings.mjs";
|
|
35
|
+
import P from "./structure/DialogContainer/Settings.mjs";
|
|
36
|
+
import F from "./structure/Disclosure/DisclosureSummary/Settings.mjs";
|
|
37
|
+
import I from "./structure/Disclosure/Settings.mjs";
|
|
38
|
+
import L from "./structure/FocusGroup/Settings.mjs";
|
|
39
|
+
import R from "./structure/List/ListItem/Settings.mjs";
|
|
40
|
+
import z from "./structure/List/Settings.mjs";
|
|
41
|
+
import B from "./structure/ModalContainer/Settings.mjs";
|
|
42
|
+
import V from "./structure/Pagination/Settings.mjs";
|
|
43
|
+
import H from "./structure/TabContainer/Settings.mjs";
|
|
44
|
+
import U from "./structure/TabContainer/TabContainerBody/Settings.mjs";
|
|
45
|
+
import W from "./structure/TabContainer/TabContainerHeader/Settings.mjs";
|
|
46
|
+
import G from "./structure/TabContainer/TabContainerItem/Settings.mjs";
|
|
47
|
+
import K from "./structure/TimeWindow/Settings.mjs";
|
|
48
|
+
import q from "./structure/Variants/Settings.mjs";
|
|
49
|
+
import J from "./structure/Variants/VariantItem/Settings.mjs";
|
|
50
|
+
import Y from "./user/Account/Settings.mjs";
|
|
51
|
+
import X from "./user/Avatar/Settings.mjs";
|
|
52
|
+
import Z from "./user/SignInForm/Settings.mjs";
|
|
47
53
|
// src/elements/settings.ts
|
|
48
|
-
var
|
|
49
|
-
dropdown:
|
|
50
|
-
dropdownPopup:
|
|
54
|
+
var Q = {
|
|
55
|
+
dropdown: l,
|
|
56
|
+
dropdownPopup: c,
|
|
51
57
|
plitziSdk: i,
|
|
52
58
|
custom: n,
|
|
53
59
|
reference: a,
|
|
54
60
|
blockHtml: e,
|
|
55
61
|
blockJsx: t,
|
|
56
|
-
page:
|
|
57
|
-
loading:
|
|
58
|
-
notFound:
|
|
59
|
-
container:
|
|
60
|
-
focusGroup:
|
|
61
|
-
layoutContainer:
|
|
62
|
-
dialogContainer:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
62
|
+
page: S,
|
|
63
|
+
loading: b,
|
|
64
|
+
notFound: x,
|
|
65
|
+
container: N,
|
|
66
|
+
focusGroup: L,
|
|
67
|
+
layoutContainer: y,
|
|
68
|
+
dialogContainer: P,
|
|
69
|
+
disclosure: I,
|
|
70
|
+
disclosureSummary: F,
|
|
71
|
+
modalContainer: B,
|
|
72
|
+
carousel: M,
|
|
73
|
+
carouselTrack: j,
|
|
74
|
+
tabContainer: H,
|
|
75
|
+
tabContainerBody: U,
|
|
76
|
+
tabContainerHeader: W,
|
|
77
|
+
tabContainerItem: G,
|
|
78
|
+
timeWindow: K,
|
|
79
|
+
variants: q,
|
|
80
|
+
variantItem: J,
|
|
81
|
+
account: Y,
|
|
82
|
+
avatar: X,
|
|
83
|
+
signInForm: Z,
|
|
84
|
+
heading: u,
|
|
85
|
+
image: E,
|
|
86
|
+
video: O,
|
|
87
|
+
embed: w,
|
|
88
|
+
chart: C,
|
|
89
|
+
svg: D,
|
|
90
|
+
fontAwesome: T,
|
|
80
91
|
button: o,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
92
|
+
countdown: s,
|
|
93
|
+
paragraph: p,
|
|
94
|
+
text: h,
|
|
95
|
+
themeToggle: g,
|
|
96
|
+
markdown: f,
|
|
97
|
+
richText: m,
|
|
98
|
+
pagination: V,
|
|
87
99
|
nodeHtml: r,
|
|
88
|
-
list:
|
|
89
|
-
listItem:
|
|
90
|
-
link:
|
|
91
|
-
form:
|
|
92
|
-
formControl:
|
|
93
|
-
apiContainer:
|
|
94
|
-
channel:
|
|
100
|
+
list: z,
|
|
101
|
+
listItem: R,
|
|
102
|
+
link: d,
|
|
103
|
+
form: _,
|
|
104
|
+
formControl: v,
|
|
105
|
+
apiContainer: k,
|
|
106
|
+
channel: A
|
|
95
107
|
};
|
|
96
|
-
export {
|
|
108
|
+
export { Q as defaultElementsSettings };
|
|
@@ -2,9 +2,7 @@ import { ReactNode, RefObject } from 'react';
|
|
|
2
2
|
export type ContainerProps = {
|
|
3
3
|
ref?: RefObject<HTMLElement>;
|
|
4
4
|
className?: string;
|
|
5
|
-
subType?: 'div' | 'header' | 'footer' | 'nav' | 'main' | 'section' | 'article' | 'aside' | 'address' | 'figure' | 'dl' | 'dt' | 'dd' | 'li' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span'
|
|
6
|
-
/** A `details` shown open from the start; closed when left out. Read by no other tag. */
|
|
7
|
-
open?: boolean;
|
|
5
|
+
subType?: 'div' | 'header' | 'footer' | 'nav' | 'main' | 'section' | 'article' | 'aside' | 'address' | 'figure' | 'dl' | 'dt' | 'dd' | 'li' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';
|
|
8
6
|
/**
|
|
9
7
|
* The name of the part of the page this is — "Main navigation", "Search results", "Your cart" — for screen readers
|
|
10
8
|
* and browser agents, which list the page by its landmarks and regions and jump between them.
|
|
@@ -32,7 +30,7 @@ export type ContainerProps = {
|
|
|
32
30
|
title?: string;
|
|
33
31
|
children?: ReactNode;
|
|
34
32
|
};
|
|
35
|
-
declare const Container: ({ ref, className, subType, label, decorative, live, title,
|
|
33
|
+
declare const Container: ({ ref, className, subType, label, decorative, live, title, children }: ContainerProps) => import('react').JSX.Element;
|
|
36
34
|
declare const _default: import('react').FC<import('../../..').WithElementProps<ContainerProps>>;
|
|
37
35
|
export default _default;
|
|
38
36
|
export { Container };
|
|
@@ -4,21 +4,20 @@ import { RootElement as n } from "../../../Element/RootElement.mjs";
|
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
5
|
import i from "clsx";
|
|
6
6
|
// src/elements/structure/Container/Container.tsx
|
|
7
|
-
var a = ({ ref: t, className: a = "", subType: o = "div", label: s = "", decorative: c = !1, live: l = "", title: u = "",
|
|
8
|
-
let
|
|
7
|
+
var a = ({ ref: t, className: a = "", subType: o = "div", label: s = "", decorative: c = !1, live: l = "", title: u = "", children: d }) => {
|
|
8
|
+
let f = !c && s && e.includes(o) ? {
|
|
9
9
|
"aria-label": s,
|
|
10
10
|
...o === "div" ? { role: "group" } : {}
|
|
11
|
-
} : {},
|
|
11
|
+
} : {}, p = c ? { "aria-hidden": !0 } : {}, m = l ? { "aria-live": l } : {};
|
|
12
12
|
return /* @__PURE__ */ r(n, {
|
|
13
13
|
ref: t,
|
|
14
14
|
tag: o,
|
|
15
15
|
className: i(`plitzi-component__container plitzi-component__container-${o}`, a),
|
|
16
16
|
title: u || void 0,
|
|
17
|
+
...f,
|
|
17
18
|
...p,
|
|
18
19
|
...m,
|
|
19
|
-
|
|
20
|
-
...g,
|
|
21
|
-
children: f
|
|
20
|
+
children: d
|
|
22
21
|
});
|
|
23
22
|
}, o = t(a);
|
|
24
23
|
export { a as Container, o as default };
|
|
@@ -3,8 +3,7 @@ type SettingsProps = {
|
|
|
3
3
|
subType?: ContainerProps['subType'];
|
|
4
4
|
label?: string;
|
|
5
5
|
decorative?: boolean;
|
|
6
|
-
open?: boolean;
|
|
7
6
|
onUpdate?: (key: string, value: string | boolean | number) => void;
|
|
8
7
|
};
|
|
9
|
-
declare const Settings: ({ subType, label, decorative,
|
|
8
|
+
declare const Settings: ({ subType, label, decorative, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
10
9
|
export default Settings;
|
|
@@ -5,15 +5,15 @@ import i from "@plitzi/plitzi-ui/Checkbox";
|
|
|
5
5
|
import a from "@plitzi/plitzi-ui/Input";
|
|
6
6
|
import o from "@plitzi/plitzi-ui/Select";
|
|
7
7
|
// src/elements/structure/Container/Settings.tsx
|
|
8
|
-
var s = ({ subType: s = "div", label: c = "", decorative: l = !1,
|
|
9
|
-
let
|
|
8
|
+
var s = ({ subType: s = "div", label: c = "", decorative: l = !1, onUpdate: u }) => {
|
|
9
|
+
let d = e(u), f = t((e) => u?.("decorative", e.target.checked), [u]);
|
|
10
10
|
return /* @__PURE__ */ r("div", {
|
|
11
11
|
className: "flex flex-col gap-4 py-2",
|
|
12
12
|
children: [
|
|
13
13
|
/* @__PURE__ */ r(o, {
|
|
14
14
|
label: "ContainerTag",
|
|
15
15
|
value: s,
|
|
16
|
-
onChange:
|
|
16
|
+
onChange: d.text("subType"),
|
|
17
17
|
size: "xs",
|
|
18
18
|
children: [
|
|
19
19
|
/* @__PURE__ */ n("option", {
|
|
@@ -99,14 +99,6 @@ var s = ({ subType: s = "div", label: c = "", decorative: l = !1, open: u = !1,
|
|
|
99
99
|
/* @__PURE__ */ n("option", {
|
|
100
100
|
value: "span",
|
|
101
101
|
children: "Span (inline)"
|
|
102
|
-
}),
|
|
103
|
-
/* @__PURE__ */ n("option", {
|
|
104
|
-
value: "details",
|
|
105
|
-
children: "Details (opens and closes)"
|
|
106
|
-
}),
|
|
107
|
-
/* @__PURE__ */ n("option", {
|
|
108
|
-
value: "summary",
|
|
109
|
-
children: "Summary (what opens a details)"
|
|
110
102
|
})
|
|
111
103
|
]
|
|
112
104
|
}),
|
|
@@ -114,19 +106,13 @@ var s = ({ subType: s = "div", label: c = "", decorative: l = !1, open: u = !1,
|
|
|
114
106
|
value: c,
|
|
115
107
|
label: "Region Name",
|
|
116
108
|
placeholder: "e.g. Main navigation, Search results",
|
|
117
|
-
onChange:
|
|
109
|
+
onChange: d.text("label"),
|
|
118
110
|
size: "xs"
|
|
119
111
|
}),
|
|
120
112
|
/* @__PURE__ */ n(i, {
|
|
121
113
|
checked: l,
|
|
122
114
|
label: "Decorative (hidden from screen readers)",
|
|
123
|
-
onChange:
|
|
124
|
-
size: "xs"
|
|
125
|
-
}),
|
|
126
|
-
s === "details" && /* @__PURE__ */ n(i, {
|
|
127
|
-
checked: u,
|
|
128
|
-
label: "Open at start",
|
|
129
|
-
onChange: m,
|
|
115
|
+
onChange: f,
|
|
130
116
|
size: "xs"
|
|
131
117
|
})
|
|
132
118
|
]
|
|
@@ -39,8 +39,7 @@ declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElemen
|
|
|
39
39
|
}, Partial<{
|
|
40
40
|
title?: string | undefined;
|
|
41
41
|
label?: string | undefined;
|
|
42
|
-
|
|
43
|
-
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | "li" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "details" | "summary" | undefined;
|
|
42
|
+
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | "li" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | undefined;
|
|
44
43
|
live?: "polite" | "assertive" | "" | undefined;
|
|
45
44
|
decorative?: boolean | undefined;
|
|
46
45
|
}>>;
|
|
@@ -31,8 +31,7 @@ declare const Container: import('react').FC<import('../../..').WithElementProps<
|
|
|
31
31
|
} & import('@plitzi/sdk-shared/authoring').ElementAttributesBrand<Partial<{
|
|
32
32
|
title?: string | undefined;
|
|
33
33
|
label?: string | undefined;
|
|
34
|
-
|
|
35
|
-
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | "li" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "details" | "summary" | undefined;
|
|
34
|
+
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | "li" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | undefined;
|
|
36
35
|
live?: "polite" | "assertive" | "" | undefined;
|
|
37
36
|
decorative?: boolean | undefined;
|
|
38
37
|
}>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
export type DisclosureProps = {
|
|
3
|
+
ref?: RefObject<HTMLElement | null>;
|
|
4
|
+
className?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
/** Whether what it holds is shown. Its summary opens and closes it, and so do the open/close/toggle steps. */
|
|
7
|
+
open?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Its group: of the disclosures with the same name, one is open at a time — an accordion. Empty, it opens and closes
|
|
10
|
+
* on its own.
|
|
11
|
+
*/
|
|
12
|
+
name?: string;
|
|
13
|
+
/** Closed by a press anywhere outside it — a menu, a panel of filters; a question of a FAQ stays open. */
|
|
14
|
+
closeOnClickOutside?: boolean;
|
|
15
|
+
/** Closed when the page changes — a menu in a layout, which stays on the screen from one page to the next. */
|
|
16
|
+
closeOnNavigate?: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* What it holds, shown or not by its summary: a `<details>`, so it works as the page arrives — before the script, or
|
|
20
|
+
* without one — the browser's find-in-page opens the one that holds what was found, a group (`name`) is an accordion
|
|
21
|
+
* without a line of code, and what is closed is still in the page for a search engine to read.
|
|
22
|
+
*/
|
|
23
|
+
declare const Disclosure: ({ ref: refProp, className, children, open, name, closeOnClickOutside, closeOnNavigate }: DisclosureProps) => import('react').JSX.Element;
|
|
24
|
+
declare const _default: import('react').FC<import('../../..').WithElementProps<DisclosureProps>>;
|
|
25
|
+
export default _default;
|
|
26
|
+
export { Disclosure };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import e from "./declaration.mjs";
|
|
2
|
+
import t from "./useDetails.mjs";
|
|
3
|
+
import n from "../../../Element/hocs/withElement.mjs";
|
|
4
|
+
import r from "../../../Element/hooks/useElement.mjs";
|
|
5
|
+
import { RootElement as i } from "../../../Element/RootElement.mjs";
|
|
6
|
+
import { useCallback as a, useMemo as o, useRef as s } from "react";
|
|
7
|
+
import { usePlitzi as c } from "@plitzi/sdk-shared/hooks";
|
|
8
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
9
|
+
import u from "clsx";
|
|
10
|
+
// src/elements/structure/Disclosure/Disclosure.tsx
|
|
11
|
+
var d = (e) => (t) => ({
|
|
12
|
+
...t,
|
|
13
|
+
open: e
|
|
14
|
+
}), f = ({ ref: n, className: f = "", children: p, open: m = !1, name: h = "", closeOnClickOutside: g = !1, closeOnNavigate: _ = !0 }) => {
|
|
15
|
+
let { setElementState: v } = r(), { settings: { previewMode: y } } = c(), b = s(null), x = n ?? b, S = !y, C = a((e) => v(d(e)), [v]), { onToggle: w, onClickCapture: T, onKeyDown: E } = t({
|
|
16
|
+
ref: x,
|
|
17
|
+
open: m,
|
|
18
|
+
setOpen: C,
|
|
19
|
+
editing: S,
|
|
20
|
+
closeOnClickOutside: g,
|
|
21
|
+
closeOnNavigate: _
|
|
22
|
+
}), D = o(() => ({
|
|
23
|
+
openDisclosure: {
|
|
24
|
+
...e.callbacks.openDisclosure,
|
|
25
|
+
callback: () => C(!0)
|
|
26
|
+
},
|
|
27
|
+
closeDisclosure: {
|
|
28
|
+
...e.callbacks.closeDisclosure,
|
|
29
|
+
callback: () => C(!1)
|
|
30
|
+
},
|
|
31
|
+
toggleDisclosure: {
|
|
32
|
+
...e.callbacks.toggleDisclosure,
|
|
33
|
+
callback: () => C(!m)
|
|
34
|
+
}
|
|
35
|
+
}), [m, C]);
|
|
36
|
+
return /* @__PURE__ */ l(i, {
|
|
37
|
+
tag: "details",
|
|
38
|
+
ref: x,
|
|
39
|
+
className: u("plitzi-component__disclosure", f),
|
|
40
|
+
open: S || m,
|
|
41
|
+
name: h && !S ? h : void 0,
|
|
42
|
+
onToggle: w,
|
|
43
|
+
onClickCapture: T,
|
|
44
|
+
onKeyDown: E,
|
|
45
|
+
interactionCallbacks: D,
|
|
46
|
+
children: p
|
|
47
|
+
});
|
|
48
|
+
}, p = n(f);
|
|
49
|
+
export { f as Disclosure, p as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
export type DisclosureSummaryProps = {
|
|
3
|
+
ref?: RefObject<HTMLElement | null>;
|
|
4
|
+
className?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* The sign at its end that turns as the disclosure opens. Off, it draws none — for a sign of its own: an icon inside
|
|
8
|
+
* it, turned by the parent's `expanded` state.
|
|
9
|
+
*/
|
|
10
|
+
marker?: boolean;
|
|
11
|
+
};
|
|
12
|
+
/** What is pressed to open a disclosure and close it: its `<summary>`, whose text is the control's name. */
|
|
13
|
+
declare const DisclosureSummary: ({ ref, className, children, marker }: DisclosureSummaryProps) => import('react').JSX.Element;
|
|
14
|
+
declare const _default: import('react').FC<import('../../../..').WithElementProps<DisclosureSummaryProps>>;
|
|
15
|
+
export default _default;
|
|
16
|
+
export { DisclosureSummary };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import e from "../../../../Element/hocs/withElement.mjs";
|
|
2
|
+
import t from "../../../../Element/hooks/useElement.mjs";
|
|
3
|
+
import { RootElement as n } from "../../../../Element/RootElement.mjs";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import a from "clsx";
|
|
6
|
+
// src/elements/structure/Disclosure/DisclosureSummary/DisclosureSummary.tsx
|
|
7
|
+
var o = ({ ref: e, className: o = "", children: s, marker: c = !0 }) => {
|
|
8
|
+
let { definition: { styleSelectors: l } } = t();
|
|
9
|
+
return /* @__PURE__ */ i(n, {
|
|
10
|
+
tag: "summary",
|
|
11
|
+
ref: e,
|
|
12
|
+
className: a("plitzi-component__disclosure-summary", o),
|
|
13
|
+
children: [s, c && /* @__PURE__ */ r("span", {
|
|
14
|
+
className: a("plitzi-component__disclosure-marker", l.marker),
|
|
15
|
+
"aria-hidden": "true"
|
|
16
|
+
})]
|
|
17
|
+
});
|
|
18
|
+
}, s = e(o);
|
|
19
|
+
export { o as DisclosureSummary, s as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type SettingsProps = {
|
|
2
|
+
marker?: boolean;
|
|
3
|
+
onUpdate?: (key: string, value: string | boolean | number) => void;
|
|
4
|
+
};
|
|
5
|
+
/** A disclosure summary's settings: whether it draws the sign that turns as the disclosure opens. */
|
|
6
|
+
declare const Settings: ({ marker, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
7
|
+
export default Settings;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import e from "../../../useSettingsUpdate.mjs";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import r from "@plitzi/plitzi-ui/Checkbox";
|
|
4
|
+
// src/elements/structure/Disclosure/DisclosureSummary/Settings.tsx
|
|
5
|
+
var i = ({ marker: i = !0, onUpdate: a }) => {
|
|
6
|
+
let o = e(a);
|
|
7
|
+
return /* @__PURE__ */ n("div", {
|
|
8
|
+
className: "flex flex-col gap-4 py-2",
|
|
9
|
+
children: [/* @__PURE__ */ t(r, {
|
|
10
|
+
label: "Marker",
|
|
11
|
+
size: "xs",
|
|
12
|
+
checked: i,
|
|
13
|
+
onChange: o.checked("marker")
|
|
14
|
+
}), /* @__PURE__ */ t("span", {
|
|
15
|
+
className: "text-ui-fg-subtle text-xs",
|
|
16
|
+
children: "The sign at the end that turns as it opens; its look is the Marker slot. Off, put a sign of your own inside and turn it with the summary’s Expanded state."
|
|
17
|
+
})]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
export { i as default };
|