@plitzi/sdk-elements 0.38.10 → 0.38.12

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 (228) hide show
  1. package/CHANGELOG.md +295 -0
  2. package/dist/Element/ElementWords.d.ts +6 -2
  3. package/dist/Element/ElementWords.mjs +18 -11
  4. package/dist/Element/JsxManager.mjs +8 -8
  5. package/dist/Element/PluginManager.mjs +4 -4
  6. package/dist/Element/ReplicaProvider.mjs +9 -9
  7. package/dist/Element/RootElement.mjs +60 -60
  8. package/dist/Element/helpers/declaredAttributes.d.ts +10 -0
  9. package/dist/Element/helpers/declaredAttributes.mjs +22 -0
  10. package/dist/Element/hocs/withElement.mjs +101 -100
  11. package/dist/Element/hooks/useEditableContent.d.ts +12 -0
  12. package/dist/Element/hooks/useEditableContent.mjs +21 -0
  13. package/dist/Element/hooks/useElementDataSource.mjs +9 -9
  14. package/dist/Element/hooks/useElementVisible.mjs +1 -1
  15. package/dist/Element/hooks/useInternalItems.mjs +22 -23
  16. package/dist/Element/hooks/useIntervalTriggers.d.ts +2 -3
  17. package/dist/Element/hooks/useKeyTriggers.d.ts +2 -3
  18. package/dist/Element/hooks/usePluginTrigger.d.ts +21 -0
  19. package/dist/Element/hooks/usePluginTrigger.mjs +18 -0
  20. package/dist/Element/hooks/useRootElementInteractions.d.ts +2 -4
  21. package/dist/Element/hooks/useRootElementInteractions.mjs +79 -76
  22. package/dist/Element/hooks/useScrollInteractions.d.ts +2 -3
  23. package/dist/canvas/useAnimationFrame.mjs +1 -1
  24. package/dist/dataSource/GlobalSources.mjs +1 -1
  25. package/dist/dataSource/pathFields.mjs +1 -1
  26. package/dist/dataSource/sourceStore.d.ts +7 -0
  27. package/dist/dataSource/sourceStore.mjs +5 -0
  28. package/dist/elements/advanced/BlockHtml/BlockHtml.mjs +1 -1
  29. package/dist/elements/advanced/BlockHtml/declaration.d.ts +2 -27
  30. package/dist/elements/advanced/BlockHtml/declaration.mjs +2 -25
  31. package/dist/elements/advanced/BlockHtml/index.d.ts +2 -25
  32. package/dist/elements/advanced/BlockJsx/Settings.mjs +37 -37
  33. package/dist/elements/advanced/BlockJsx/declaration.d.ts +2 -27
  34. package/dist/elements/advanced/BlockJsx/declaration.mjs +2 -25
  35. package/dist/elements/advanced/BlockJsx/index.d.ts +2 -25
  36. package/dist/elements/advanced/Custom/Custom.mjs +52 -42
  37. package/dist/elements/advanced/Custom/Settings.mjs +41 -40
  38. package/dist/elements/advanced/Custom/declaration.d.ts +2 -26
  39. package/dist/elements/advanced/Custom/declaration.mjs +2 -22
  40. package/dist/elements/advanced/Custom/index.d.ts +2 -24
  41. package/dist/elements/advanced/NodeHtml/Settings.mjs +3 -3
  42. package/dist/elements/advanced/NodeHtml/declaration.d.ts +19 -44
  43. package/dist/elements/advanced/NodeHtml/declaration.mjs +2 -23
  44. package/dist/elements/advanced/NodeHtml/index.d.ts +19 -42
  45. package/dist/elements/advanced/PlitziSdk/Settings.mjs +4 -4
  46. package/dist/elements/advanced/Reference/Reference.mjs +1 -1
  47. package/dist/elements/advanced/Reference/declaration.d.ts +3 -27
  48. package/dist/elements/advanced/Reference/declaration.mjs +2 -22
  49. package/dist/elements/advanced/Reference/index.d.ts +3 -25
  50. package/dist/elements/basic/Button/Button.mjs +24 -31
  51. package/dist/elements/basic/Button/declaration.d.ts +4 -27
  52. package/dist/elements/basic/Button/declaration.mjs +2 -25
  53. package/dist/elements/basic/Button/index.d.ts +4 -25
  54. package/dist/elements/basic/Dropdown/Dropdown.mjs +1 -1
  55. package/dist/elements/basic/Dropdown/DropdownPopup/declaration.d.ts +3 -19
  56. package/dist/elements/basic/Dropdown/DropdownPopup/declaration.mjs +2 -16
  57. package/dist/elements/basic/Dropdown/DropdownPopup/index.d.ts +3 -17
  58. package/dist/elements/basic/Dropdown/declaration.d.ts +3 -26
  59. package/dist/elements/basic/Dropdown/declaration.mjs +16 -41
  60. package/dist/elements/basic/Dropdown/index.d.ts +5 -42
  61. package/dist/elements/basic/Dropdown/useDropdown.mjs +23 -29
  62. package/dist/elements/basic/Heading/Heading.mjs +15 -17
  63. package/dist/elements/basic/Heading/Settings.mjs +4 -4
  64. package/dist/elements/basic/Heading/declaration.d.ts +2 -27
  65. package/dist/elements/basic/Heading/declaration.mjs +2 -23
  66. package/dist/elements/basic/Heading/index.d.ts +2 -25
  67. package/dist/elements/basic/Link/Link.mjs +52 -59
  68. package/dist/elements/basic/Link/Settings.mjs +52 -51
  69. package/dist/elements/basic/Link/declaration.d.ts +6 -26
  70. package/dist/elements/basic/Link/declaration.mjs +8 -32
  71. package/dist/elements/basic/Link/index.d.ts +6 -24
  72. package/dist/elements/basic/Markdown/Markdown.mjs +1 -1
  73. package/dist/elements/basic/Markdown/declaration.d.ts +2 -25
  74. package/dist/elements/basic/Markdown/declaration.mjs +2 -25
  75. package/dist/elements/basic/Markdown/index.d.ts +2 -23
  76. package/dist/elements/basic/Paragraph/Paragraph.mjs +15 -17
  77. package/dist/elements/basic/Paragraph/declaration.d.ts +2 -27
  78. package/dist/elements/basic/Paragraph/declaration.mjs +5 -28
  79. package/dist/elements/basic/Paragraph/index.d.ts +2 -25
  80. package/dist/elements/basic/RichText/RichText.mjs +1 -1
  81. package/dist/elements/basic/RichText/Settings.mjs +4 -4
  82. package/dist/elements/basic/RichText/declaration.d.ts +4 -27
  83. package/dist/elements/basic/RichText/declaration.mjs +2 -23
  84. package/dist/elements/basic/RichText/index.d.ts +4 -25
  85. package/dist/elements/basic/Text/Text.mjs +16 -18
  86. package/dist/elements/basic/Text/declaration.d.ts +3 -28
  87. package/dist/elements/basic/Text/declaration.mjs +2 -25
  88. package/dist/elements/basic/Text/index.d.ts +3 -26
  89. package/dist/elements/basic/ThemeToggle/Settings.d.ts +6 -0
  90. package/dist/elements/basic/ThemeToggle/Settings.mjs +49 -0
  91. package/dist/elements/basic/ThemeToggle/ThemeToggle.mjs +40 -39
  92. package/dist/elements/basic/ThemeToggle/declaration.d.ts +3 -26
  93. package/dist/elements/basic/ThemeToggle/declaration.mjs +2 -23
  94. package/dist/elements/basic/ThemeToggle/index.d.ts +3 -24
  95. package/dist/elements/declarations/index.d.ts +145 -1061
  96. package/dist/elements/form/Form/Form.mjs +65 -64
  97. package/dist/elements/form/Form/declaration.d.ts +3 -28
  98. package/dist/elements/form/Form/declaration.mjs +2 -25
  99. package/dist/elements/form/Form/index.d.ts +17 -25
  100. package/dist/elements/form/FormControl/FormControl.mjs +106 -105
  101. package/dist/elements/form/FormControl/declaration.d.ts +2 -22
  102. package/dist/elements/form/FormControl/declaration.mjs +4 -23
  103. package/dist/elements/form/FormControl/hocs/withFieldValue.mjs +1 -1
  104. package/dist/elements/form/FormControl/index.d.ts +16 -20
  105. package/dist/elements/internal/LayoutContainer/LayoutContainer.mjs +1 -1
  106. package/dist/elements/internal/LayoutContainer/declaration.d.ts +3 -25
  107. package/dist/elements/internal/LayoutContainer/declaration.mjs +3 -23
  108. package/dist/elements/internal/LayoutContainer/index.d.ts +3 -23
  109. package/dist/elements/internal/Loading/Settings.d.ts +2 -0
  110. package/dist/elements/internal/Loading/Settings.mjs +5 -0
  111. package/dist/elements/internal/Loading/declaration.d.ts +2 -24
  112. package/dist/elements/internal/Loading/declaration.mjs +3 -25
  113. package/dist/elements/internal/Loading/index.d.ts +2 -22
  114. package/dist/elements/internal/NotFound/NotFound.mjs +1 -1
  115. package/dist/elements/internal/NotFound/Settings.d.ts +2 -0
  116. package/dist/elements/internal/NotFound/Settings.mjs +5 -0
  117. package/dist/elements/internal/NotFound/declaration.d.ts +2 -24
  118. package/dist/elements/internal/NotFound/declaration.mjs +7 -29
  119. package/dist/elements/internal/NotFound/index.d.ts +2 -22
  120. package/dist/elements/internal/Page/Page.mjs +17 -16
  121. package/dist/elements/internal/Page/Settings.mjs +102 -101
  122. package/dist/elements/internal/Page/declaration.d.ts +3 -23
  123. package/dist/elements/internal/Page/declaration.mjs +14 -32
  124. package/dist/elements/internal/Page/index.d.ts +3 -21
  125. package/dist/elements/media/Embed/Embed.mjs +1 -1
  126. package/dist/elements/media/Embed/Settings.mjs +7 -7
  127. package/dist/elements/media/Embed/declaration.d.ts +2 -27
  128. package/dist/elements/media/Embed/declaration.mjs +10 -33
  129. package/dist/elements/media/Embed/index.d.ts +2 -25
  130. package/dist/elements/media/FontAwesome/Settings.mjs +8 -8
  131. package/dist/elements/media/FontAwesome/declaration.d.ts +2 -27
  132. package/dist/elements/media/FontAwesome/declaration.mjs +5 -28
  133. package/dist/elements/media/FontAwesome/index.d.ts +2 -25
  134. package/dist/elements/media/Image/Image.mjs +1 -1
  135. package/dist/elements/media/Image/Settings.mjs +47 -46
  136. package/dist/elements/media/Image/declaration.d.ts +2 -27
  137. package/dist/elements/media/Image/declaration.mjs +7 -30
  138. package/dist/elements/media/Image/index.d.ts +2 -25
  139. package/dist/elements/media/Svg/Settings.mjs +4 -4
  140. package/dist/elements/media/Svg/Svg.mjs +1 -1
  141. package/dist/elements/media/Svg/declaration.d.ts +3 -27
  142. package/dist/elements/media/Svg/declaration.mjs +2 -22
  143. package/dist/elements/media/Svg/index.d.ts +3 -25
  144. package/dist/elements/media/Video/Settings.mjs +7 -7
  145. package/dist/elements/media/Video/Video.mjs +1 -1
  146. package/dist/elements/media/Video/declaration.d.ts +2 -27
  147. package/dist/elements/media/Video/declaration.mjs +6 -29
  148. package/dist/elements/media/Video/index.d.ts +2 -25
  149. package/dist/elements/provider/ApiContainer/ApiContainer.mjs +151 -150
  150. package/dist/elements/provider/ApiContainer/Settings.mjs +135 -134
  151. package/dist/elements/provider/ApiContainer/declaration.d.ts +3 -28
  152. package/dist/elements/provider/ApiContainer/declaration.mjs +2 -23
  153. package/dist/elements/provider/ApiContainer/index.d.ts +3 -26
  154. package/dist/elements/provider/Channel/Channel.mjs +57 -55
  155. package/dist/elements/provider/Channel/declaration.d.ts +9 -28
  156. package/dist/elements/provider/Channel/declaration.mjs +10 -25
  157. package/dist/elements/provider/Channel/index.d.ts +9 -26
  158. package/dist/elements/settings.mjs +70 -62
  159. package/dist/elements/structure/Carousel/Carousel.mjs +36 -35
  160. package/dist/elements/structure/Carousel/CarouselTrack/declaration.d.ts +3 -25
  161. package/dist/elements/structure/Carousel/CarouselTrack/declaration.mjs +6 -28
  162. package/dist/elements/structure/Carousel/CarouselTrack/index.d.ts +3 -23
  163. package/dist/elements/structure/Carousel/Settings.mjs +40 -39
  164. package/dist/elements/structure/Carousel/declaration.d.ts +4 -29
  165. package/dist/elements/structure/Carousel/declaration.mjs +2 -25
  166. package/dist/elements/structure/Carousel/index.d.ts +6 -51
  167. package/dist/elements/structure/Container/Settings.mjs +40 -39
  168. package/dist/elements/structure/Container/declaration.d.ts +3 -28
  169. package/dist/elements/structure/Container/declaration.mjs +2 -23
  170. package/dist/elements/structure/Container/index.d.ts +3 -26
  171. package/dist/elements/structure/DialogContainer/DialogContainer.d.ts +8 -8
  172. package/dist/elements/structure/DialogContainer/DialogContainer.mjs +54 -173
  173. package/dist/elements/structure/DialogContainer/Settings.mjs +24 -23
  174. package/dist/elements/structure/DialogContainer/declaration.d.ts +8 -31
  175. package/dist/elements/structure/DialogContainer/declaration.mjs +2 -23
  176. package/dist/elements/structure/DialogContainer/index.d.ts +8 -29
  177. package/dist/elements/structure/List/ListItem/declaration.d.ts +4 -26
  178. package/dist/elements/structure/List/ListItem/declaration.mjs +3 -25
  179. package/dist/elements/structure/List/ListItem/index.d.ts +4 -24
  180. package/dist/elements/structure/List/Settings.mjs +6 -6
  181. package/dist/elements/structure/List/declaration.d.ts +3 -28
  182. package/dist/elements/structure/List/declaration.mjs +2 -23
  183. package/dist/elements/structure/List/index.d.ts +6 -51
  184. package/dist/elements/structure/List/modes/ListControlled/ListControlled.mjs +13 -12
  185. package/dist/elements/structure/List/modes/ListControlled/ListControlledItem.mjs +6 -6
  186. package/dist/elements/structure/ModalContainer/ModalContainer.mjs +27 -121
  187. package/dist/elements/structure/ModalContainer/Settings.mjs +15 -14
  188. package/dist/elements/structure/ModalContainer/declaration.d.ts +3 -26
  189. package/dist/elements/structure/ModalContainer/declaration.mjs +2 -23
  190. package/dist/elements/structure/ModalContainer/index.d.ts +3 -24
  191. package/dist/elements/structure/Overlay/OverlayShell.d.ts +24 -0
  192. package/dist/elements/structure/Overlay/OverlayShell.mjs +64 -0
  193. package/dist/elements/structure/Overlay/metadataOf.d.ts +8 -0
  194. package/dist/elements/structure/{ModalContainer/metadataFromText.mjs → Overlay/metadataOf.mjs} +5 -2
  195. package/dist/elements/structure/{ModalContainer → Overlay}/useModalDialog.mjs +1 -1
  196. package/dist/elements/structure/Overlay/useOverlay.d.ts +40 -0
  197. package/dist/elements/structure/Overlay/useOverlay.mjs +83 -0
  198. package/dist/elements/structure/Pagination/Pagination.mjs +28 -27
  199. package/dist/elements/structure/Pagination/Settings.mjs +10 -10
  200. package/dist/elements/structure/Pagination/declaration.d.ts +3 -26
  201. package/dist/elements/structure/Pagination/declaration.mjs +2 -23
  202. package/dist/elements/structure/Pagination/index.d.ts +3 -24
  203. package/dist/elements/structure/TabContainer/TabContainerBody/TabContainerBody.d.ts +3 -3
  204. package/dist/elements/structure/TabContainer/TabContainerBody/TabContainerBody.mjs +10 -32
  205. package/dist/elements/structure/TabContainer/TabContainerBody/declaration.d.ts +4 -22
  206. package/dist/elements/structure/TabContainer/TabContainerBody/declaration.mjs +3 -17
  207. package/dist/elements/structure/TabContainer/TabContainerBody/index.d.ts +4 -20
  208. package/dist/elements/structure/TabContainer/TabContainerHeader/TabContainerHeader.d.ts +3 -3
  209. package/dist/elements/structure/TabContainer/TabContainerHeader/TabContainerHeader.mjs +10 -34
  210. package/dist/elements/structure/TabContainer/TabContainerHeader/declaration.d.ts +4 -22
  211. package/dist/elements/structure/TabContainer/TabContainerHeader/declaration.mjs +3 -17
  212. package/dist/elements/structure/TabContainer/TabContainerHeader/index.d.ts +4 -20
  213. package/dist/elements/structure/TabContainer/TabContainerItem/declaration.d.ts +4 -26
  214. package/dist/elements/structure/TabContainer/TabContainerItem/declaration.mjs +7 -27
  215. package/dist/elements/structure/TabContainer/TabContainerItem/index.d.ts +4 -24
  216. package/dist/elements/structure/TabContainer/declaration.d.ts +4 -26
  217. package/dist/elements/structure/TabContainer/declaration.mjs +3 -23
  218. package/dist/elements/structure/TabContainer/index.d.ts +15 -89
  219. package/dist/elements/structure/TabContainer/useTabItems.d.ts +7 -0
  220. package/dist/elements/structure/TabContainer/useTabItems.mjs +35 -0
  221. package/dist/elements/useSettingsUpdate.d.ts +12 -0
  222. package/dist/elements/useSettingsUpdate.mjs +8 -0
  223. package/dist/index.d.ts +169 -984
  224. package/dist/realtime/useChannel.d.ts +4 -3
  225. package/dist/realtime/useChannel.mjs +36 -36
  226. package/package.json +58 -14
  227. package/dist/elements/structure/ModalContainer/metadataFromText.d.ts +0 -7
  228. /package/dist/elements/structure/{ModalContainer → Overlay}/useModalDialog.d.ts +0 -0
@@ -1,17 +1,17 @@
1
- import { useCallback as e } from "react";
1
+ import e from "../../useSettingsUpdate.mjs";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
3
  import r from "@plitzi/plitzi-ui/Input";
4
4
  import i from "@plitzi/plitzi-ui/Select";
5
5
  //#region src/elements/structure/List/Settings.tsx
6
6
  var a = ({ subType: a = "ul", source: o = "none", itemKey: s = "", label: c = "", onUpdate: l }) => {
7
- let u = e((e) => (t) => l?.(e, t), [l]);
7
+ let u = e(l);
8
8
  return /* @__PURE__ */ n("div", {
9
9
  className: "flex flex-col gap-4 py-2",
10
10
  children: [
11
11
  /* @__PURE__ */ n(i, {
12
12
  label: "Source",
13
13
  value: o,
14
- onChange: u("source"),
14
+ onChange: u.text("source"),
15
15
  size: "xs",
16
16
  children: [/* @__PURE__ */ t("option", {
17
17
  value: "none",
@@ -27,12 +27,12 @@ var a = ({ subType: a = "ul", source: o = "none", itemKey: s = "", label: c = ""
27
27
  placeholder: "id",
28
28
  value: s,
29
29
  title: "The field of each item that names it, so a row stays with its item when the list is filtered.",
30
- onChange: u("itemKey")
30
+ onChange: u.text("itemKey")
31
31
  }),
32
32
  /* @__PURE__ */ n(i, {
33
33
  label: "List Type",
34
34
  value: a,
35
- onChange: u("subType"),
35
+ onChange: u.text("subType"),
36
36
  size: "xs",
37
37
  children: [/* @__PURE__ */ t("option", {
38
38
  value: "ul",
@@ -46,7 +46,7 @@ var a = ({ subType: a = "ul", source: o = "none", itemKey: s = "", label: c = ""
46
46
  value: c,
47
47
  label: "List Name",
48
48
  placeholder: "e.g. Kinds of capsule, Search results",
49
- onChange: u("label"),
49
+ onChange: u.text("label"),
50
50
  size: "xs"
51
51
  })
52
52
  ]
@@ -2,7 +2,7 @@ import { ListProps } from './List';
2
2
  import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring/declare';
3
3
  /** What this element can be authored with — its component's own props, minus what the runtime supplies. */
4
4
  export type ListAttributes = AuthorableAttributes<ListProps>;
5
- declare const declaration: {
5
+ declare const declaration: import('@plitzi/sdk-shared/authoring/declare').DeclaredElement<{
6
6
  readonly type: "list";
7
7
  readonly attributeValues: {
8
8
  readonly subType: readonly string[];
@@ -17,38 +17,14 @@ declare const declaration: {
17
17
  };
18
18
  readonly definition: {
19
19
  readonly label: "List";
20
- readonly type: "list";
21
20
  readonly description: string;
22
- readonly items: readonly [];
23
- readonly bindings: {};
24
- readonly styleSelectors: {
25
- readonly base: "";
26
- };
27
- readonly initialState: {
28
- readonly visibility: true;
29
- };
30
- };
31
- readonly builder: {
32
- readonly canDelete: true;
33
- readonly canSelect: true;
34
- readonly canDragDrop: true;
35
- readonly canMove: true;
36
- readonly canSnippet: true;
37
- readonly itemsAllowed: readonly [];
38
- readonly itemsNotAllowed: readonly [];
21
+ readonly items: [];
39
22
  };
40
23
  readonly market: {
41
24
  readonly category: "structure";
42
- readonly owner: "Plitzi";
43
- readonly verified: true;
44
- readonly license: "MIT";
45
- readonly website: "https://plitzi.com";
46
- readonly backgroundColor: "#4422ee";
47
25
  readonly icon: "fa-solid fa-list";
48
26
  };
49
27
  readonly defaultStyle: {
50
- readonly name: "List";
51
- readonly displayMode: "desktop";
52
28
  readonly style: {
53
29
  readonly base: {
54
30
  readonly default: {
@@ -87,10 +63,9 @@ declare const declaration: {
87
63
  };
88
64
  };
89
65
  };
90
- readonly settings: {};
91
66
  };
92
67
  readonly initialItems: readonly ["listItem", "listItem", "listItem"];
93
- } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
68
+ }, Partial<{
94
69
  source?: "none" | "controlled" | undefined;
95
70
  label?: string | undefined;
96
71
  items?: unknown[] | undefined;
@@ -15,34 +15,14 @@ var n = e()({
15
15
  },
16
16
  definition: {
17
17
  label: "List",
18
- type: "list",
19
18
  description: "Repeats a template (its row: a listItem, or a container with subType \"li\") once per entry of a data array — the way to render a dynamic collection, as a <ul> (subType \"ol\" for a numbered one). Bind its items to a data source (e.g. an apiContainer response).",
20
- items: [],
21
- bindings: {},
22
- styleSelectors: { base: "" },
23
- initialState: { visibility: !0 }
24
- },
25
- builder: {
26
- canDelete: !0,
27
- canSelect: !0,
28
- canDragDrop: !0,
29
- canMove: !0,
30
- canSnippet: !0,
31
- itemsAllowed: [],
32
- itemsNotAllowed: []
19
+ items: []
33
20
  },
34
21
  market: {
35
22
  category: "structure",
36
- owner: "Plitzi",
37
- verified: !0,
38
- license: "MIT",
39
- website: "https://plitzi.com",
40
- backgroundColor: "#4422ee",
41
23
  icon: "fa-solid fa-list"
42
24
  },
43
25
  defaultStyle: {
44
- name: "List",
45
- displayMode: "desktop",
46
26
  style: { base: { default: {
47
27
  "margin-top": "0px",
48
28
  "margin-bottom": "10px",
@@ -68,8 +48,7 @@ var n = e()({
68
48
  } } }
69
49
  }
70
50
  }
71
- },
72
- settings: {}
51
+ }
73
52
  },
74
53
  initialItems: [
75
54
  "listItem",
@@ -12,46 +12,26 @@ declare const List: {
12
12
  readonly attributes: {};
13
13
  readonly definition: {
14
14
  readonly label: "List Item";
15
- readonly type: "listItem";
16
15
  readonly description: "The List Item element lets you add more items to existing List elements. You can then add any content you would like to them, including links, images, etc.";
17
- readonly items: readonly [];
18
- readonly bindings: {};
19
- readonly styleSelectors: {
20
- readonly base: "";
21
- };
22
- readonly initialState: {
23
- readonly visibility: true;
24
- };
16
+ readonly items: [];
25
17
  };
26
18
  readonly builder: {
27
- readonly canDelete: true;
28
- readonly canSelect: true;
29
- readonly canDragDrop: true;
30
- readonly canMove: true;
31
- readonly canSnippet: true;
32
- readonly itemsAllowed: readonly [];
33
- readonly itemsNotAllowed: readonly ["listItem"];
19
+ readonly itemsNotAllowed: ["listItem"];
34
20
  };
35
21
  readonly market: {
36
22
  readonly category: "structure";
37
- readonly owner: "Plitzi";
38
- readonly verified: true;
39
- readonly license: "MIT";
40
- readonly website: "https://plitzi.com";
41
- readonly backgroundColor: "#4422ee";
42
23
  readonly icon: "fa-solid fa-grip-lines";
43
24
  };
44
25
  readonly defaultStyle: {
45
- readonly name: "List Item";
46
- readonly displayMode: "desktop";
47
26
  readonly style: {
48
27
  readonly base: {
49
28
  readonly default: {};
50
29
  };
51
30
  };
52
31
  };
53
- readonly settings: {};
54
32
  };
33
+ } & {
34
+ content: import('@plitzi/sdk-shared/authoring/declare').ElementContentDefaults;
55
35
  } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<unknown>;
56
36
  };
57
37
  type: "list";
@@ -68,38 +48,14 @@ declare const List: {
68
48
  };
69
49
  readonly definition: {
70
50
  readonly label: "List";
71
- readonly type: "list";
72
51
  readonly description: string;
73
- readonly items: readonly [];
74
- readonly bindings: {};
75
- readonly styleSelectors: {
76
- readonly base: "";
77
- };
78
- readonly initialState: {
79
- readonly visibility: true;
80
- };
81
- };
82
- readonly builder: {
83
- readonly canDelete: true;
84
- readonly canSelect: true;
85
- readonly canDragDrop: true;
86
- readonly canMove: true;
87
- readonly canSnippet: true;
88
- readonly itemsAllowed: readonly [];
89
- readonly itemsNotAllowed: readonly [];
52
+ readonly items: [];
90
53
  };
91
54
  readonly market: {
92
55
  readonly category: "structure";
93
- readonly owner: "Plitzi";
94
- readonly verified: true;
95
- readonly license: "MIT";
96
- readonly website: "https://plitzi.com";
97
- readonly backgroundColor: "#4422ee";
98
56
  readonly icon: "fa-solid fa-list";
99
57
  };
100
58
  readonly defaultStyle: {
101
- readonly name: "List";
102
- readonly displayMode: "desktop";
103
59
  readonly style: {
104
60
  readonly base: {
105
61
  readonly default: {
@@ -138,8 +94,7 @@ declare const List: {
138
94
  };
139
95
  };
140
96
  };
141
- readonly settings: {};
142
- };
97
+ } & import('@plitzi/sdk-shared/authoring/declare').ElementContentDefaults;
143
98
  initialItems: readonly ["listItem", "listItem", "listItem"];
144
99
  __attributes: Partial<{
145
100
  source?: "none" | "controlled" | undefined;
@@ -1,26 +1,27 @@
1
1
  import e from "../../declaration.mjs";
2
2
  import t from "../../../../../Element/hooks/useElement.mjs";
3
3
  import { RootElement as n } from "../../../../../Element/RootElement.mjs";
4
- import { rowKeys as r } from "./rowKeys.mjs";
5
- import i from "./ListControlledItem.mjs";
6
- import { useCallback as a, useMemo as o } from "react";
7
- import s from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
8
- import { get as c } from "@plitzi/plitzi-ui/helpers";
9
- import { StoreProvider as l } from "@plitzi/nexus/react";
10
- import { emptyObject as u, getPathsFromObeject as d } from "@plitzi/sdk-shared/helpers/utils";
4
+ import r from "../../../../../dataSource/sourceStore.mjs";
5
+ import { rowKeys as i } from "./rowKeys.mjs";
6
+ import a from "./ListControlledItem.mjs";
7
+ import { useCallback as o, useMemo as s } from "react";
8
+ import c from "@plitzi/sdk-shared/hooks/usePlitzi";
9
+ import { get as l } from "@plitzi/plitzi-ui/helpers";
10
+ import { StoreProvider as u } from "@plitzi/nexus/react";
11
+ import { getPathsFromObject as d } from "@plitzi/sdk-shared/helpers/utils";
11
12
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
12
13
  import m from "clsx";
13
14
  import h from "@plitzi/sdk-shared/dataSource/helpers/getSourceName";
14
15
  import g from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
15
16
  //#region src/elements/structure/List/modes/ListControlled/ListControlled.tsx
16
17
  var _ = ({ ref: _, className: v = "", subType: y = "ul", children: b, items: x = [], itemKey: S, label: C = "" }) => {
17
- let { id: w, definition: { label: T } } = t(), E = h(e.sourceType, w), { settings: { previewMode: D } } = s(), O = o(() => Array.isArray(x) ? x : [], [x]), k = o(() => r(O, S), [O, S]), A = a(() => d({
18
- item: c(O, "0", {}),
18
+ let { id: w, definition: { label: T } } = t(), E = h(e.sourceType, w), { settings: { previewMode: D } } = c(), O = s(() => Array.isArray(x) ? x : [], [x]), k = s(() => i(O, S), [O, S]), A = o(() => d({
19
+ item: l(O, "0", {}),
19
20
  index: 0
20
21
  }).reduce((e, t) => [...e, {
21
22
  path: t,
22
23
  name: t
23
- }], []), [O]), j = o(() => E ? { runtime: { sources: { [E]: { items: O } } } } : u, [E, O]);
24
+ }], []), [O]), j = s(() => r(E, { items: O }), [E, O]);
24
25
  return g({
25
26
  id: w,
26
27
  source: E,
@@ -31,7 +32,7 @@ var _ = ({ ref: _, className: v = "", subType: y = "ul", children: b, items: x =
31
32
  tag: y,
32
33
  "aria-label": C || void 0,
33
34
  className: m("plitzi-component__controlled-list", v, { "controlled-list--build-mode": !D }),
34
- children: [/* @__PURE__ */ f(l, {
35
+ children: [/* @__PURE__ */ f(u, {
35
36
  inherit: "live",
36
37
  name: `List:${w}`,
37
38
  value: j,
@@ -41,7 +42,7 @@ var _ = ({ ref: _, className: v = "", subType: y = "ul", children: b, items: x =
41
42
  className: "controlled-list-item__counter",
42
43
  children: `List Item - ${t + 1}`
43
44
  })
44
- }, t) : /* @__PURE__ */ f(i, {
45
+ }, t) : /* @__PURE__ */ f(a, {
45
46
  index: t,
46
47
  isTemplate: t !== 0 && !D,
47
48
  record: e,
@@ -1,19 +1,19 @@
1
1
  import e from "../../../../../Element/ReplicaProvider.mjs";
2
- import { useId as t, useMemo as n } from "react";
3
- import { StoreProvider as r } from "@plitzi/nexus/react";
4
- import { emptyObject as i } from "@plitzi/sdk-shared/helpers/utils";
2
+ import t from "../../../../../dataSource/sourceStore.mjs";
3
+ import { useId as n, useMemo as r } from "react";
4
+ import { StoreProvider as i } from "@plitzi/nexus/react";
5
5
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
6
  import s from "clsx";
7
7
  //#region src/elements/structure/List/modes/ListControlled/ListControlledItem.tsx
8
8
  var c = ({ children: c, className: l = "", isTemplate: u = !1, index: d = 0, record: f, source: p = "" }) => {
9
- let m = t(), h = n(() => p ? { runtime: { sources: { [p]: {
9
+ let m = n(), h = r(() => t(p, {
10
10
  item: f,
11
11
  index: d
12
- } } } } : i, [
12
+ }), [
13
13
  p,
14
14
  f,
15
15
  d
16
- ]), g = /* @__PURE__ */ a(e, { children: /* @__PURE__ */ a(r, {
16
+ ]), g = /* @__PURE__ */ a(e, { children: /* @__PURE__ */ a(i, {
17
17
  inherit: "live",
18
18
  name: `Row:${p}`,
19
19
  segment: m,
@@ -1,129 +1,35 @@
1
1
  import e from "./declaration.mjs";
2
2
  import t from "../../../Element/hocs/withElement.mjs";
3
- import n from "../../../Element/hooks/useElement.mjs";
4
- import { RootElement as r } from "../../../Element/RootElement.mjs";
5
- import i from "../../../dataSource/pathFields.mjs";
6
- import a from "./useModalDialog.mjs";
7
- import { metadataFromText as o } from "./metadataFromText.mjs";
8
- import { use as s, useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
9
- import p from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
10
- import { StoreProvider as m } from "@plitzi/nexus/react";
11
- import { emptyObject as h } from "@plitzi/sdk-shared/helpers/utils";
12
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
13
- import v from "clsx";
14
- import y from "@plitzi/sdk-shared/dataSource/helpers/getSourceName";
15
- import b from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
3
+ import n from "../Overlay/OverlayShell.mjs";
4
+ import r from "../Overlay/useOverlay.mjs";
5
+ import { jsx as i } from "react/jsx-runtime";
16
6
  //#region src/elements/structure/ModalContainer/ModalContainer.tsx
17
- var x = ({ ref: t, className: x = "", children: S, title: C = "Modal Header", autoHideAfterClick: w = !0 }) => {
18
- let { id: T, rootId: E, visible: D, definition: { styleSelectors: O, label: k = "Modal" }, elementState: A, setElementState: j } = n(), M = y(e.sourceType, T), { settings: { previewMode: N }, contexts: { InteractionsContext: P } } = p(), { interactionsManager: F } = s(P), [I, L] = f({}), R = d(null), z = `${E}_${T}_title`, B = c((e) => {
19
- let { metadata: t } = e;
20
- L(t && typeof t == "object" ? t : typeof t == "string" ? o(t) : typeof t == "boolean" || typeof t == "number" ? { content: t } : {}), j((e) => ({
21
- ...e,
22
- visibility: !0
23
- }));
24
- }, [j, L]), V = c(() => {
25
- F.interactionTrigger(T, "onModalClose", { metadata: I }), L({}), j((e) => ({
26
- ...e,
27
- visibility: !1
28
- }));
29
- }, [
30
- F,
31
- j,
32
- L,
33
- I,
34
- T
35
- ]), H = c(() => {
36
- w && (F.interactionTrigger(T, "onModalClose", { metadata: I }), L({}), j((e) => ({
37
- ...e,
38
- visibility: !1
39
- })));
40
- }, [
41
- F,
42
- w,
43
- j,
44
- L,
45
- I,
46
- T
47
- ]), U = u(() => ({
48
- openModal: {
49
- ...e.callbacks.openModal,
50
- title: `Open ${k}`,
51
- callback: B
7
+ var a = ({ ref: t, className: a = "", children: o, title: s = "Modal Header", autoHideAfterClick: c = !0 }) => {
8
+ let l = r({
9
+ name: "Modal",
10
+ sourceType: e.sourceType,
11
+ callbacks: {
12
+ open: e.callbacks.openModal,
13
+ close: e.callbacks.closeModal
52
14
  },
53
- closeModal: {
54
- ...e.callbacks.closeModal,
55
- title: `Close ${k}`,
56
- callback: V
57
- }
58
- }), [
59
- V,
60
- B,
61
- k
62
- ]);
63
- a({
64
- panelRef: R,
65
- open: !!N && D,
66
- onClose: V
67
- }), l(() => {
68
- A.visibility !== !1 && F.interactionTrigger(T, "onModalOpen", { metadata: I });
69
- }, [
70
- T,
71
- F,
72
- I,
73
- A.visibility
74
- ]);
75
- let W = c(() => i(I), [I]);
76
- b({
77
- id: T,
78
- source: M,
79
- name: k || `Modal - ${T}`,
80
- fields: W
15
+ events: {
16
+ open: "onModalOpen",
17
+ close: "onModalClose"
18
+ },
19
+ autoHideAfterClick: c
81
20
  });
82
- let G = u(() => M ? { runtime: { sources: { [M]: I } } } : h, [M, I]);
83
- return /* @__PURE__ */ _(r, {
21
+ return /* @__PURE__ */ i(n, {
84
22
  ref: t,
85
- className: v("plitzi-component__modal-container", x),
86
- interactionTriggers: e.triggers,
87
- interactionCallbacks: U,
88
- children: [/* @__PURE__ */ g("div", {
89
- className: v("modal-container__background", O.backgroundContainer),
90
- "aria-hidden": "true",
91
- onClick: H
92
- }), /* @__PURE__ */ _("div", {
93
- ref: R,
94
- className: v("modal-container__root", O.rootContainer),
95
- role: "dialog",
96
- "aria-modal": "true",
97
- "aria-labelledby": z,
98
- tabIndex: -1,
99
- children: [/* @__PURE__ */ _("div", {
100
- className: v("modal-container__header", O.headerContainer),
101
- children: [/* @__PURE__ */ g("div", {
102
- id: z,
103
- className: v("modal-container__header__title", O.headerTitle),
104
- children: C || "Modal Header"
105
- }), /* @__PURE__ */ g("button", {
106
- type: "button",
107
- className: v("modal-container__close", O.headerCloseButton),
108
- "aria-label": "Close",
109
- title: "Close",
110
- onClick: V,
111
- children: /* @__PURE__ */ g("i", {
112
- className: "fa-solid fa-xmark",
113
- "aria-hidden": "true"
114
- })
115
- })]
116
- }), /* @__PURE__ */ g("div", {
117
- className: v("modal-container__body", O.bodyContainer),
118
- children: /* @__PURE__ */ g(m, {
119
- inherit: "live",
120
- name: `Modal:${T}`,
121
- value: G,
122
- children: S
123
- })
124
- })]
125
- })]
23
+ className: a,
24
+ block: "modal-container",
25
+ role: "dialog",
26
+ storeName: "Modal",
27
+ title: s || "Modal Header",
28
+ overlay: l,
29
+ triggers: e.triggers,
30
+ onDismiss: l.close,
31
+ children: o
126
32
  });
127
- }, S = t(x);
33
+ }, o = t(a);
128
34
  //#endregion
129
- export { x as ModalContainer, S as default };
35
+ export { a as ModalContainer, o as default };
@@ -1,24 +1,25 @@
1
- import { useCallback as e } from "react";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import r from "@plitzi/plitzi-ui/Checkbox";
4
- import i from "@plitzi/plitzi-ui/Input";
1
+ import e from "../../useSettingsUpdate.mjs";
2
+ import { useCallback as t } from "react";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ import i from "@plitzi/plitzi-ui/Checkbox";
5
+ import a from "@plitzi/plitzi-ui/Input";
5
6
  //#region src/elements/structure/ModalContainer/Settings.tsx
6
- var a = ({ title: a = "Modal Header", autoHideAfterClick: o = !0, onUpdate: s }) => {
7
- let c = e((e) => (t) => s?.(e, t), [s]), l = e((e) => s?.("autoHideAfterClick", e.target.checked), [s]);
8
- return /* @__PURE__ */ n("div", {
7
+ var o = ({ title: o = "Modal Header", autoHideAfterClick: s = !0, onUpdate: c }) => {
8
+ let l = e(c), u = t((e) => c?.("autoHideAfterClick", e.target.checked), [c]);
9
+ return /* @__PURE__ */ r("div", {
9
10
  className: "flex flex-col gap-4 py-2",
10
- children: [/* @__PURE__ */ t(i, {
11
+ children: [/* @__PURE__ */ n(a, {
11
12
  label: "Title",
12
- value: a,
13
- onChange: c("title"),
13
+ value: o,
14
+ onChange: l.text("title"),
14
15
  size: "xs"
15
- }), /* @__PURE__ */ t(r, {
16
+ }), /* @__PURE__ */ n(i, {
16
17
  label: "Hide after click background",
17
- checked: o,
18
- onChange: l,
18
+ checked: s,
19
+ onChange: u,
19
20
  size: "xs"
20
21
  })]
21
22
  });
22
23
  };
23
24
  //#endregion
24
- export { a as default };
25
+ export { o as default };
@@ -2,7 +2,7 @@ import { ModalContainerProps } from './ModalContainer';
2
2
  import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring/declare';
3
3
  /** What this element can be authored with — its component's own props, minus what the runtime supplies. */
4
4
  export type ModalContainerAttributes = AuthorableAttributes<ModalContainerProps>;
5
- declare const declaration: {
5
+ declare const declaration: import('@plitzi/sdk-shared/authoring/declare').DeclaredElement<{
6
6
  readonly type: "modalContainer";
7
7
  readonly sourceType: "modalContainer";
8
8
  readonly triggers: {
@@ -58,10 +58,8 @@ declare const declaration: {
58
58
  };
59
59
  readonly definition: {
60
60
  readonly label: "Modal Container";
61
- readonly type: "modalContainer";
62
61
  readonly description: string;
63
- readonly items: readonly [];
64
- readonly bindings: {};
62
+ readonly items: [];
65
63
  /**
66
64
  * A modal nobody opens is the commonest hidden subtree on a page, and before this it was built, bound and
67
65
  * subscribed on every render of the page it sat in. `lazy` rather than `visible` so what a visitor typed into
@@ -69,7 +67,6 @@ declare const declaration: {
69
67
  */
70
68
  readonly loadStrategy: "lazy";
71
69
  readonly styleSelectors: {
72
- readonly base: "";
73
70
  readonly backgroundContainer: "";
74
71
  readonly rootContainer: "";
75
72
  readonly headerContainer: "";
@@ -77,31 +74,12 @@ declare const declaration: {
77
74
  readonly headerCloseButton: "";
78
75
  readonly bodyContainer: "";
79
76
  };
80
- readonly initialState: {
81
- readonly visibility: true;
82
- };
83
- };
84
- readonly builder: {
85
- readonly canDelete: true;
86
- readonly canSelect: true;
87
- readonly canDragDrop: true;
88
- readonly canMove: true;
89
- readonly canSnippet: true;
90
- readonly itemsAllowed: readonly [];
91
- readonly itemsNotAllowed: readonly [];
92
77
  };
93
78
  readonly market: {
94
79
  readonly category: "structure";
95
- readonly owner: "Plitzi";
96
- readonly verified: true;
97
- readonly license: "MIT";
98
- readonly website: "https://plitzi.com";
99
- readonly backgroundColor: "#4422ee";
100
80
  readonly icon: "fa-regular fa-clone";
101
81
  };
102
82
  readonly defaultStyle: {
103
- readonly name: "Modal Container";
104
- readonly displayMode: "desktop";
105
83
  readonly style: {
106
84
  readonly base: {
107
85
  readonly default: {
@@ -206,10 +184,9 @@ declare const declaration: {
206
184
  };
207
185
  readonly subTypes: {};
208
186
  };
209
- readonly settings: {};
210
187
  };
211
188
  readonly initialItems: readonly ["container"];
212
- } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
189
+ }, Partial<{
213
190
  title?: string | undefined;
214
191
  autoHideAfterClick?: boolean | undefined;
215
192
  }>>;
@@ -48,43 +48,23 @@ var t = e()({
48
48
  },
49
49
  definition: {
50
50
  label: "Modal Container",
51
- type: "modalContainer",
52
51
  description: "A modal overlay container opened and closed through interactions; use for dialogs over the page. The element itself is fixed over the whole viewport, and holds two layers side by side — neither inside the other: `backgroundContainer`, the dim layer, `rgb(0 0 0 / 50%)` (its `background-color` is the whole dim), and `rootContainer`, the dialog, centred by `top: 50%`, `left: 50%` and `transform: translate3d(-50%, -50%, 0)` — to sit it near the top, set `top` and `transform: translateX(-50%)`; flex alignment on the dim layer moves nothing. Inside the dialog, top to bottom: `headerContainer` (with `headerTitle` and `headerCloseButton`) and `bodyContainer`.",
53
52
  items: [],
54
- bindings: {},
55
53
  loadStrategy: "lazy",
56
54
  styleSelectors: {
57
- base: "",
58
55
  backgroundContainer: "",
59
56
  rootContainer: "",
60
57
  headerContainer: "",
61
58
  headerTitle: "",
62
59
  headerCloseButton: "",
63
60
  bodyContainer: ""
64
- },
65
- initialState: { visibility: !0 }
66
- },
67
- builder: {
68
- canDelete: !0,
69
- canSelect: !0,
70
- canDragDrop: !0,
71
- canMove: !0,
72
- canSnippet: !0,
73
- itemsAllowed: [],
74
- itemsNotAllowed: []
61
+ }
75
62
  },
76
63
  market: {
77
64
  category: "structure",
78
- owner: "Plitzi",
79
- verified: !0,
80
- license: "MIT",
81
- website: "https://plitzi.com",
82
- backgroundColor: "#4422ee",
83
65
  icon: "fa-regular fa-clone"
84
66
  },
85
67
  defaultStyle: {
86
- name: "Modal Container",
87
- displayMode: "desktop",
88
68
  style: {
89
69
  base: { default: {
90
70
  position: "fixed",
@@ -174,8 +154,7 @@ var t = e()({
174
154
  } }
175
155
  },
176
156
  subTypes: {}
177
- },
178
- settings: {}
157
+ }
179
158
  },
180
159
  initialItems: ["container"]
181
160
  });