@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.
Files changed (109) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/Element/PluginManager.mjs +13 -13
  3. package/dist/Element/hooks/useElementState.d.ts +1 -1
  4. package/dist/Element/hooks/useFullscreenInteractions.d.ts +11 -0
  5. package/dist/Element/hooks/useFullscreenInteractions.mjs +14 -0
  6. package/dist/Element/hooks/useRootElementInteractions.mjs +93 -87
  7. package/dist/builder/ruleFields.d.ts +1 -1
  8. package/dist/builder/ruleFields.mjs +5 -0
  9. package/dist/dataSource/GlobalSources.mjs +121 -104
  10. package/dist/dataSource/useAudienceScope.mjs +2 -1
  11. package/dist/dataSource/usePageClock.d.ts +12 -0
  12. package/dist/dataSource/usePageClock.mjs +19 -0
  13. package/dist/elements/basic/Countdown/Countdown.d.ts +23 -0
  14. package/dist/elements/basic/Countdown/Countdown.mjs +58 -0
  15. package/dist/elements/basic/Countdown/Settings.d.ts +12 -0
  16. package/dist/elements/basic/Countdown/Settings.mjs +94 -0
  17. package/dist/elements/basic/Countdown/declaration.d.ts +72 -0
  18. package/dist/elements/basic/Countdown/declaration.mjs +58 -0
  19. package/dist/elements/basic/Countdown/index.d.ts +69 -0
  20. package/dist/elements/basic/Countdown/index.mjs +5 -0
  21. package/dist/elements/declarations/index.d.ts +508 -7
  22. package/dist/elements/declarations/index.mjs +84 -72
  23. package/dist/elements/index.d.ts +13 -3
  24. package/dist/elements/index.mjs +76 -66
  25. package/dist/elements/media/Image/Image.d.ts +6 -1
  26. package/dist/elements/media/Image/Image.mjs +44 -35
  27. package/dist/elements/media/Image/Settings.d.ts +2 -1
  28. package/dist/elements/media/Image/Settings.mjs +26 -19
  29. package/dist/elements/media/Image/declaration.d.ts +2 -0
  30. package/dist/elements/media/Image/declaration.mjs +2 -1
  31. package/dist/elements/media/Image/index.d.ts +2 -0
  32. package/dist/elements/settings.mjs +92 -80
  33. package/dist/elements/structure/Container/Container.d.ts +2 -4
  34. package/dist/elements/structure/Container/Container.mjs +5 -6
  35. package/dist/elements/structure/Container/Settings.d.ts +1 -2
  36. package/dist/elements/structure/Container/Settings.mjs +5 -19
  37. package/dist/elements/structure/Container/declaration.d.ts +1 -2
  38. package/dist/elements/structure/Container/declaration.mjs +1 -3
  39. package/dist/elements/structure/Container/index.d.ts +1 -2
  40. package/dist/elements/structure/Disclosure/Disclosure.d.ts +26 -0
  41. package/dist/elements/structure/Disclosure/Disclosure.mjs +49 -0
  42. package/dist/elements/structure/Disclosure/DisclosureSummary/DisclosureSummary.d.ts +16 -0
  43. package/dist/elements/structure/Disclosure/DisclosureSummary/DisclosureSummary.mjs +19 -0
  44. package/dist/elements/structure/Disclosure/DisclosureSummary/Settings.d.ts +7 -0
  45. package/dist/elements/structure/Disclosure/DisclosureSummary/Settings.mjs +20 -0
  46. package/dist/elements/structure/Disclosure/DisclosureSummary/declaration.d.ts +59 -0
  47. package/dist/elements/structure/Disclosure/DisclosureSummary/declaration.mjs +47 -0
  48. package/dist/elements/structure/Disclosure/DisclosureSummary/index.d.ts +57 -0
  49. package/dist/elements/structure/Disclosure/DisclosureSummary/index.mjs +5 -0
  50. package/dist/elements/structure/Disclosure/Settings.d.ts +10 -0
  51. package/dist/elements/structure/Disclosure/Settings.mjs +47 -0
  52. package/dist/elements/structure/Disclosure/declaration.d.ts +66 -0
  53. package/dist/elements/structure/Disclosure/declaration.mjs +55 -0
  54. package/dist/elements/structure/Disclosure/index.d.ts +121 -0
  55. package/dist/elements/structure/Disclosure/index.mjs +9 -0
  56. package/dist/elements/structure/Disclosure/useDetails.d.ts +27 -0
  57. package/dist/elements/structure/Disclosure/useDetails.mjs +49 -0
  58. package/dist/elements/structure/TimeWindow/TimeWindow.mjs +29 -25
  59. package/dist/elements/structure/TimeWindow/TimeWindowContext.d.ts +6 -0
  60. package/dist/elements/structure/TimeWindow/TimeWindowContext.mjs +4 -0
  61. package/dist/elements/{testing → structure}/Variants/Settings.mjs +1 -1
  62. package/dist/elements/{testing → structure}/Variants/VariantItem/Settings.mjs +1 -1
  63. package/dist/elements/{testing → structure}/Variants/VariantItem/VariantItem.mjs +1 -1
  64. package/dist/elements/{testing → structure}/Variants/VariantItem/declaration.d.ts +1 -1
  65. package/dist/elements/{testing → structure}/Variants/VariantItem/declaration.mjs +2 -2
  66. package/dist/elements/{testing → structure}/Variants/VariantItem/index.d.ts +1 -1
  67. package/dist/elements/{testing → structure}/Variants/VariantItem/index.mjs +1 -1
  68. package/dist/elements/{testing → structure}/Variants/Variants.mjs +12 -12
  69. package/dist/elements/{testing → structure/Variants}/childOfItem.mjs +1 -1
  70. package/dist/elements/{testing → structure}/Variants/declaration.d.ts +1 -1
  71. package/dist/elements/{testing → structure}/Variants/declaration.mjs +3 -3
  72. package/dist/elements/{testing → structure}/Variants/index.d.ts +2 -2
  73. package/dist/elements/{testing → structure}/Variants/index.mjs +1 -1
  74. package/dist/elements/user/Account/Account.d.ts +25 -0
  75. package/dist/elements/user/Account/Account.mjs +104 -0
  76. package/dist/elements/user/Account/Settings.d.ts +10 -0
  77. package/dist/elements/user/Account/Settings.mjs +47 -0
  78. package/dist/elements/user/Account/declaration.d.ts +143 -0
  79. package/dist/elements/user/Account/declaration.mjs +123 -0
  80. package/dist/elements/user/Account/index.d.ts +141 -0
  81. package/dist/elements/user/Account/index.mjs +5 -0
  82. package/dist/elements/user/Avatar/Avatar.d.ts +19 -0
  83. package/dist/elements/user/Avatar/Avatar.mjs +26 -0
  84. package/dist/elements/user/Avatar/AvatarFace.d.ts +15 -0
  85. package/dist/elements/user/Avatar/AvatarFace.mjs +28 -0
  86. package/dist/elements/user/Avatar/Settings.d.ts +9 -0
  87. package/dist/elements/user/Avatar/Settings.mjs +38 -0
  88. package/dist/elements/user/Avatar/declaration.d.ts +65 -0
  89. package/dist/elements/user/Avatar/declaration.mjs +53 -0
  90. package/dist/elements/user/Avatar/faces.d.ts +10 -0
  91. package/dist/elements/user/Avatar/faces.mjs +10 -0
  92. package/dist/elements/user/Avatar/index.d.ts +63 -0
  93. package/dist/elements/user/Avatar/index.mjs +5 -0
  94. package/dist/elements/user/SignInForm/Settings.d.ts +16 -0
  95. package/dist/elements/user/SignInForm/Settings.mjs +64 -0
  96. package/dist/elements/user/SignInForm/SignInForm.d.ts +34 -0
  97. package/dist/elements/user/SignInForm/SignInForm.mjs +112 -0
  98. package/dist/elements/user/SignInForm/declaration.d.ts +120 -0
  99. package/dist/elements/user/SignInForm/declaration.mjs +99 -0
  100. package/dist/elements/user/SignInForm/index.d.ts +118 -0
  101. package/dist/elements/user/SignInForm/index.mjs +5 -0
  102. package/dist/index.d.ts +514 -6
  103. package/dist/index.mjs +84 -74
  104. package/package.json +7 -7
  105. /package/dist/elements/{testing → structure}/Variants/Settings.d.ts +0 -0
  106. /package/dist/elements/{testing → structure}/Variants/VariantItem/Settings.d.ts +0 -0
  107. /package/dist/elements/{testing → structure}/Variants/VariantItem/VariantItem.d.ts +0 -0
  108. /package/dist/elements/{testing → structure}/Variants/Variants.d.ts +0 -0
  109. /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 = "", alt: u = "", decorative: d = !1, variables: f, fetchPriority: p = "auto", loadMode: m = "auto", sizes: h = "100vw", width: g, height: _, onUpdate: v }) => {
10
- let y = n(() => r(l, f, !0), [f, l]), b = e(v), x = t((e) => (t) => v?.(e, Math.max(0, Math.round(Number(t) || 0))), [v]), S = t((e) => v?.("decorative", e.target.checked), [v]);
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: b.text("src"),
19
+ onChange: x.text("src"),
20
20
  size: "xs"
21
- }), y && /* @__PURE__ */ a("div", {
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: y,
27
+ src: b,
28
28
  alt: "",
29
29
  className: "h-full w-full rounded-sm"
30
30
  })]
31
31
  })]
32
32
  }),
33
- !d && /* @__PURE__ */ i(s, {
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: b.text("alt"),
44
+ onChange: x.text("alt"),
38
45
  size: "xs"
39
46
  }),
40
47
  /* @__PURE__ */ i(o, {
41
- checked: d,
48
+ checked: f,
42
49
  label: "Decorative (nothing to describe)",
43
- onChange: S,
50
+ onChange: C,
44
51
  size: "xs"
45
52
  }),
46
53
  /* @__PURE__ */ a(c, {
47
- value: p,
54
+ value: m,
48
55
  label: "Fetch Priority",
49
- onChange: b.text("fetchPriority"),
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: m,
74
+ value: h,
68
75
  label: "Load Mode",
69
- onChange: b.text("loadMode"),
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: h,
94
+ value: g,
88
95
  label: "Sizes",
89
96
  placeholder: "(max-width: 48rem) 100vw, 360px",
90
- onChange: b.text("sizes"),
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: g ? String(g) : "",
104
+ value: _ ? String(_) : "",
98
105
  label: "Width (px)",
99
- onChange: x("width"),
106
+ onChange: S("width"),
100
107
  size: "xs"
101
108
  }), /* @__PURE__ */ i(s, {
102
109
  type: "number",
103
- value: _ ? String(_) : "",
110
+ value: v ? String(v) : "",
104
111
  label: "Height (px)",
105
- onChange: x("height"),
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/Dropdown/DropdownPopup/Settings.mjs";
9
- import c from "./basic/Dropdown/Settings.mjs";
10
- import l from "./basic/Heading/Settings.mjs";
11
- import u from "./basic/Link/Settings.mjs";
12
- import d from "./basic/Markdown/Settings.mjs";
13
- import f from "./basic/Paragraph/Settings.mjs";
14
- import p from "./basic/RichText/Settings.mjs";
15
- import m from "./basic/Text/Settings.mjs";
16
- import h from "./basic/ThemeToggle/Settings.mjs";
17
- import g from "./form/Form/Settings.mjs";
18
- import _ from "./form/FormControl/Settings.mjs";
19
- import v from "./internal/LayoutContainer/Settings.mjs";
20
- import y from "./internal/Loading/Settings.mjs";
21
- import b from "./internal/NotFound/Settings.mjs";
22
- import x from "./internal/Page/Settings.mjs";
23
- import S from "./media/Chart/Settings.mjs";
24
- import C from "./media/Embed/Settings.mjs";
25
- import w from "./media/FontAwesome/Settings.mjs";
26
- import T from "./media/Image/Settings.mjs";
27
- import E from "./media/Svg/Settings.mjs";
28
- import D from "./media/Video/Settings.mjs";
29
- import O from "./provider/ApiContainer/Settings.mjs";
30
- import k from "./provider/Channel/Settings.mjs";
31
- import A from "./structure/Carousel/CarouselTrack/Settings.mjs";
32
- import j from "./structure/Carousel/Settings.mjs";
33
- import M from "./structure/Container/Settings.mjs";
34
- import N from "./structure/DialogContainer/Settings.mjs";
35
- import P from "./structure/FocusGroup/Settings.mjs";
36
- import F from "./structure/List/ListItem/Settings.mjs";
37
- import I from "./structure/List/Settings.mjs";
38
- import L from "./structure/ModalContainer/Settings.mjs";
39
- import R from "./structure/Pagination/Settings.mjs";
40
- import z from "./structure/TabContainer/Settings.mjs";
41
- import B from "./structure/TabContainer/TabContainerBody/Settings.mjs";
42
- import V from "./structure/TabContainer/TabContainerHeader/Settings.mjs";
43
- import H from "./structure/TabContainer/TabContainerItem/Settings.mjs";
44
- import U from "./structure/TimeWindow/Settings.mjs";
45
- import W from "./testing/Variants/Settings.mjs";
46
- import G from "./testing/Variants/VariantItem/Settings.mjs";
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 K = {
49
- dropdown: c,
50
- dropdownPopup: s,
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: x,
57
- loading: y,
58
- notFound: b,
59
- container: M,
60
- focusGroup: P,
61
- layoutContainer: v,
62
- dialogContainer: N,
63
- modalContainer: L,
64
- carousel: j,
65
- carouselTrack: A,
66
- tabContainer: z,
67
- tabContainerBody: B,
68
- tabContainerHeader: V,
69
- tabContainerItem: H,
70
- timeWindow: U,
71
- variants: W,
72
- variantItem: G,
73
- heading: l,
74
- image: T,
75
- video: D,
76
- embed: C,
77
- chart: S,
78
- svg: E,
79
- fontAwesome: w,
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
- paragraph: f,
82
- text: m,
83
- themeToggle: h,
84
- markdown: d,
85
- richText: p,
86
- pagination: R,
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: I,
89
- listItem: F,
90
- link: u,
91
- form: g,
92
- formControl: _,
93
- apiContainer: O,
94
- channel: k
100
+ list: z,
101
+ listItem: R,
102
+ link: d,
103
+ form: _,
104
+ formControl: v,
105
+ apiContainer: k,
106
+ channel: A
95
107
  };
96
- export { K as defaultElementsSettings };
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' | 'details' | 'summary';
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, open, children }: ContainerProps) => import('react').JSX.Element;
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 = "", open: d = !1, children: f }) => {
8
- let p = !c && s && e.includes(o) ? {
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
- } : {}, m = c ? { "aria-hidden": !0 } : {}, h = l ? { "aria-live": l } : {}, g = o === "details" && d ? { open: !0 } : {};
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
- ...h,
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, open, onUpdate }: SettingsProps) => import('react').JSX.Element;
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, open: u = !1, onUpdate: d }) => {
9
- let f = e(d), p = t((e) => d?.("decorative", e.target.checked), [d]), m = t((e) => d?.("open", e.target.checked), [d]);
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: f.text("subType"),
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: f.text("label"),
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: p,
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
- open?: boolean | undefined;
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
  }>>;
@@ -35,9 +35,7 @@ var n = [
35
35
  "h5",
36
36
  "h6",
37
37
  "p",
38
- "span",
39
- "details",
40
- "summary"
38
+ "span"
41
39
  ]),
42
40
  live: t()([
43
41
  "",
@@ -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
- open?: boolean | undefined;
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 };