@plitzi/sdk-elements 0.38.11 → 0.38.13

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 (226) hide show
  1. package/CHANGELOG.md +125 -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 +139 -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 +40 -39
  155. package/dist/elements/provider/Channel/declaration.d.ts +3 -28
  156. package/dist/elements/provider/Channel/declaration.mjs +3 -24
  157. package/dist/elements/provider/Channel/index.d.ts +3 -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 +163 -984
  224. package/package.json +57 -13
  225. package/dist/elements/structure/ModalContainer/metadataFromText.d.ts +0 -7
  226. /package/dist/elements/structure/{ModalContainer → Overlay}/useModalDialog.d.ts +0 -0
@@ -7,34 +7,21 @@ var t = e()({
7
7
  attributes: {},
8
8
  definition: {
9
9
  label: "Dropdown Popup",
10
- type: "dropdownPopup",
11
10
  description: "The floating panel revealed by a dropdown.",
12
11
  items: [],
13
- bindings: {},
14
- styleSelectors: { base: "" },
15
12
  initialState: {}
16
13
  },
17
14
  builder: {
18
15
  canDelete: !1,
19
- canSelect: !0,
20
16
  canDragDrop: !1,
21
17
  canMove: !1,
22
- canSnippet: !1,
23
- itemsAllowed: [],
24
- itemsNotAllowed: []
18
+ canSnippet: !1
25
19
  },
26
20
  market: {
27
21
  category: "basic",
28
- owner: "Plitzi",
29
- verified: !0,
30
- license: "MIT",
31
- website: "https://plitzi.com",
32
- backgroundColor: "#4422ee",
33
22
  icon: "fa-regular fa-window-restore"
34
23
  },
35
24
  defaultStyle: {
36
- name: "Dropdown Popup",
37
- displayMode: "desktop",
38
25
  style: { base: { default: {
39
26
  "background-color": "light-dark(white, oklch(0.21 0.006 285.885))",
40
27
  "min-height": "24px",
@@ -54,8 +41,7 @@ var t = e()({
54
41
  "z-index": 100
55
42
  } } },
56
43
  subTypes: {}
57
- },
58
- settings: {}
44
+ }
59
45
  },
60
46
  initialItems: []
61
47
  });
@@ -8,36 +8,21 @@ declare const DropdownPopup: {
8
8
  readonly attributes: {};
9
9
  readonly definition: {
10
10
  readonly label: "Dropdown Popup";
11
- readonly type: "dropdownPopup";
12
11
  readonly description: "The floating panel revealed by a dropdown.";
13
- readonly items: readonly [];
14
- readonly bindings: {};
15
- readonly styleSelectors: {
16
- readonly base: "";
17
- };
12
+ readonly items: [];
18
13
  readonly initialState: {};
19
14
  };
20
15
  readonly builder: {
21
16
  readonly canDelete: false;
22
- readonly canSelect: true;
23
17
  readonly canDragDrop: false;
24
18
  readonly canMove: false;
25
19
  readonly canSnippet: false;
26
- readonly itemsAllowed: readonly [];
27
- readonly itemsNotAllowed: readonly [];
28
20
  };
29
21
  readonly market: {
30
22
  readonly category: "basic";
31
- readonly owner: "Plitzi";
32
- readonly verified: true;
33
- readonly license: "MIT";
34
- readonly website: "https://plitzi.com";
35
- readonly backgroundColor: "#4422ee";
36
23
  readonly icon: "fa-regular fa-window-restore";
37
24
  };
38
25
  readonly defaultStyle: {
39
- readonly name: "Dropdown Popup";
40
- readonly displayMode: "desktop";
41
26
  readonly style: {
42
27
  readonly base: {
43
28
  readonly default: {
@@ -62,8 +47,9 @@ declare const DropdownPopup: {
62
47
  };
63
48
  readonly subTypes: {};
64
49
  };
65
- readonly settings: {};
66
50
  };
67
51
  readonly initialItems: readonly [];
52
+ } & {
53
+ content: import('@plitzi/sdk-shared/authoring/declare').ElementContentDefaults;
68
54
  } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<unknown>;
69
55
  export default DropdownPopup;
@@ -2,7 +2,7 @@ import { DropdownProps } from './Dropdown';
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 DropdownAttributes = AuthorableAttributes<DropdownProps>;
5
- declare const declaration: {
5
+ declare const declaration: import('@plitzi/sdk-shared/authoring/declare').DeclaredElement<{
6
6
  readonly type: "dropdown";
7
7
  readonly attributeValues: {
8
8
  readonly popupPlacement: readonly string[];
@@ -20,39 +20,17 @@ declare const declaration: {
20
20
  };
21
21
  readonly definition: {
22
22
  readonly label: "Dropdown";
23
- readonly type: "dropdown";
24
23
  readonly description: "A trigger that toggles an attached popup panel (dropdownPopup) — menus, selects, flyouts.";
25
- readonly items: readonly [];
26
- readonly bindings: {};
24
+ readonly items: [];
27
25
  readonly styleSelectors: {
28
- readonly base: "";
29
26
  readonly backgroundContainer: "";
30
27
  };
31
- readonly initialState: {
32
- readonly visibility: true;
33
- };
34
- };
35
- readonly builder: {
36
- readonly canDelete: true;
37
- readonly canSelect: true;
38
- readonly canDragDrop: true;
39
- readonly canMove: true;
40
- readonly canSnippet: true;
41
- readonly itemsAllowed: readonly [];
42
- readonly itemsNotAllowed: readonly [];
43
28
  };
44
29
  readonly market: {
45
30
  readonly category: "basic";
46
- readonly owner: "Plitzi";
47
- readonly verified: true;
48
- readonly license: "MIT";
49
- readonly website: "https://plitzi.com";
50
- readonly backgroundColor: "#4422ee";
51
31
  readonly icon: "fa-solid fa-angle-down";
52
32
  };
53
33
  readonly defaultStyle: {
54
- readonly name: "Dropdown";
55
- readonly displayMode: "desktop";
56
34
  readonly style: {
57
35
  readonly base: {
58
36
  readonly default: {
@@ -73,10 +51,9 @@ declare const declaration: {
73
51
  };
74
52
  };
75
53
  };
76
- readonly settings: {};
77
54
  };
78
55
  readonly initialItems: readonly ["dropdownPopup"];
79
- } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
56
+ }, Partial<{
80
57
  disabled?: boolean | undefined;
81
58
  closeOnClickPopup?: boolean | undefined;
82
59
  popupPlacement?: "left" | "right" | "top" | "bottom" | undefined;
@@ -21,54 +21,29 @@ var n = e()({
21
21
  },
22
22
  definition: {
23
23
  label: "Dropdown",
24
- type: "dropdown",
25
24
  description: "A trigger that toggles an attached popup panel (dropdownPopup) — menus, selects, flyouts.",
26
25
  items: [],
27
- bindings: {},
28
- styleSelectors: {
29
- base: "",
30
- backgroundContainer: ""
31
- },
32
- initialState: { visibility: !0 }
33
- },
34
- builder: {
35
- canDelete: !0,
36
- canSelect: !0,
37
- canDragDrop: !0,
38
- canMove: !0,
39
- canSnippet: !0,
40
- itemsAllowed: [],
41
- itemsNotAllowed: []
26
+ styleSelectors: { backgroundContainer: "" }
42
27
  },
43
28
  market: {
44
29
  category: "basic",
45
- owner: "Plitzi",
46
- verified: !0,
47
- license: "MIT",
48
- website: "https://plitzi.com",
49
- backgroundColor: "#4422ee",
50
30
  icon: "fa-solid fa-angle-down"
51
31
  },
52
- defaultStyle: {
53
- name: "Dropdown",
54
- displayMode: "desktop",
55
- style: {
56
- base: { default: {
57
- cursor: "pointer",
58
- "user-select": "none"
59
- } },
60
- backgroundContainer: { default: {
61
- top: 0,
62
- bottom: 0,
63
- left: 0,
64
- right: 0,
65
- position: "fixed",
66
- cursor: "default",
67
- "z-index": 50
68
- } }
69
- }
70
- },
71
- settings: {}
32
+ defaultStyle: { style: {
33
+ base: { default: {
34
+ cursor: "pointer",
35
+ "user-select": "none"
36
+ } },
37
+ backgroundContainer: { default: {
38
+ top: 0,
39
+ bottom: 0,
40
+ left: 0,
41
+ right: 0,
42
+ position: "fixed",
43
+ cursor: "default",
44
+ "z-index": 50
45
+ } }
46
+ } }
72
47
  },
73
48
  initialItems: ["dropdownPopup"]
74
49
  });
@@ -13,36 +13,21 @@ declare const Dropdown: {
13
13
  readonly attributes: {};
14
14
  readonly definition: {
15
15
  readonly label: "Dropdown Popup";
16
- readonly type: "dropdownPopup";
17
16
  readonly description: "The floating panel revealed by a dropdown.";
18
- readonly items: readonly [];
19
- readonly bindings: {};
20
- readonly styleSelectors: {
21
- readonly base: "";
22
- };
17
+ readonly items: [];
23
18
  readonly initialState: {};
24
19
  };
25
20
  readonly builder: {
26
21
  readonly canDelete: false;
27
- readonly canSelect: true;
28
22
  readonly canDragDrop: false;
29
23
  readonly canMove: false;
30
24
  readonly canSnippet: false;
31
- readonly itemsAllowed: readonly [];
32
- readonly itemsNotAllowed: readonly [];
33
25
  };
34
26
  readonly market: {
35
27
  readonly category: "basic";
36
- readonly owner: "Plitzi";
37
- readonly verified: true;
38
- readonly license: "MIT";
39
- readonly website: "https://plitzi.com";
40
- readonly backgroundColor: "#4422ee";
41
28
  readonly icon: "fa-regular fa-window-restore";
42
29
  };
43
30
  readonly defaultStyle: {
44
- readonly name: "Dropdown Popup";
45
- readonly displayMode: "desktop";
46
31
  readonly style: {
47
32
  readonly base: {
48
33
  readonly default: {
@@ -67,9 +52,10 @@ declare const Dropdown: {
67
52
  };
68
53
  readonly subTypes: {};
69
54
  };
70
- readonly settings: {};
71
55
  };
72
56
  readonly initialItems: readonly [];
57
+ } & {
58
+ content: import('@plitzi/sdk-shared/authoring/declare').ElementContentDefaults;
73
59
  } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<unknown>;
74
60
  };
75
61
  type: "dropdown";
@@ -89,39 +75,17 @@ declare const Dropdown: {
89
75
  };
90
76
  readonly definition: {
91
77
  readonly label: "Dropdown";
92
- readonly type: "dropdown";
93
78
  readonly description: "A trigger that toggles an attached popup panel (dropdownPopup) — menus, selects, flyouts.";
94
- readonly items: readonly [];
95
- readonly bindings: {};
79
+ readonly items: [];
96
80
  readonly styleSelectors: {
97
- readonly base: "";
98
81
  readonly backgroundContainer: "";
99
82
  };
100
- readonly initialState: {
101
- readonly visibility: true;
102
- };
103
- };
104
- readonly builder: {
105
- readonly canDelete: true;
106
- readonly canSelect: true;
107
- readonly canDragDrop: true;
108
- readonly canMove: true;
109
- readonly canSnippet: true;
110
- readonly itemsAllowed: readonly [];
111
- readonly itemsNotAllowed: readonly [];
112
83
  };
113
84
  readonly market: {
114
85
  readonly category: "basic";
115
- readonly owner: "Plitzi";
116
- readonly verified: true;
117
- readonly license: "MIT";
118
- readonly website: "https://plitzi.com";
119
- readonly backgroundColor: "#4422ee";
120
86
  readonly icon: "fa-solid fa-angle-down";
121
87
  };
122
88
  readonly defaultStyle: {
123
- readonly name: "Dropdown";
124
- readonly displayMode: "desktop";
125
89
  readonly style: {
126
90
  readonly base: {
127
91
  readonly default: {
@@ -142,8 +106,7 @@ declare const Dropdown: {
142
106
  };
143
107
  };
144
108
  };
145
- readonly settings: {};
146
- };
109
+ } & import('@plitzi/sdk-shared/authoring/declare').ElementContentDefaults;
147
110
  initialItems: readonly ["dropdownPopup"];
148
111
  __attributes: Partial<{
149
112
  disabled?: boolean | undefined;
@@ -2,36 +2,30 @@ import { useCallback as e, useEffect as t, useMemo as n, useState as r } from "r
2
2
  import i from "@plitzi/plitzi-ui/hooks/useDidUpdateEffect";
3
3
  //#region src/elements/basic/Dropdown/useDropdown.ts
4
4
  var a = ({ ref: a, popupRef: o, open: s, placement: c = "bottom", disabled: l = !1, loading: u = !1, closeOnClickPopup: d = !0, closeOnClickOutside: f = !1, offsetX: p = 0, offsetY: m = 0, myWindow: h, onChange: g }) => {
5
- let [_, v] = r(s ?? !1), [y, b] = r(() => a?.current?.getBoundingClientRect()), x = n(() => h || (typeof window < "u" ? window : null), [h]), S = e((e) => {
6
- if (!(l || u || e.target instanceof Node && o?.current?.contains(e.target))) {
7
- if (e.stopPropagation(), e.preventDefault(), s !== void 0) {
8
- g?.(!_, !1);
9
- return;
10
- }
11
- g?.(!_, !0), v((e) => !e);
5
+ let [_, v] = r(s ?? !1), [y, b] = r(() => a?.current?.getBoundingClientRect()), x = n(() => h || (typeof window < "u" ? window : null), [h]), S = e(() => {
6
+ if (s !== void 0) {
7
+ g?.(!_, !1);
8
+ return;
12
9
  }
10
+ g?.(!_, !0), v((e) => !e);
13
11
  }, [
14
- l,
15
- u,
16
12
  g,
17
13
  _,
18
- s,
19
- o
14
+ s
20
15
  ]), C = e((e) => {
21
- if (!(l || u || !d)) {
22
- if (e.stopPropagation(), e.preventDefault(), s !== void 0) {
23
- g?.(!_, !1);
24
- return;
25
- }
26
- g?.(!_, !0), v((e) => !e);
27
- }
16
+ l || u || e.target instanceof Node && o?.current?.contains(e.target) || (e.stopPropagation(), e.preventDefault(), S());
17
+ }, [
18
+ l,
19
+ u,
20
+ o,
21
+ S
22
+ ]), w = e((e) => {
23
+ l || u || !d || (e.stopPropagation(), e.preventDefault(), S());
28
24
  }, [
29
25
  d,
30
26
  l,
31
27
  u,
32
- g,
33
- _,
34
- s
28
+ S
35
29
  ]);
36
30
  t(() => {
37
31
  let e = a?.current;
@@ -41,7 +35,7 @@ var a = ({ ref: a, popupRef: o, open: s, placement: c = "bottom", disabled: l =
41
35
  n?.disconnect(), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t);
42
36
  };
43
37
  }, [_, a]);
44
- let w = e((e) => {
38
+ let T = e((e) => {
45
39
  e.key === "Escape" && (g?.(!_, s !== void 0), v((e) => !e));
46
40
  }, [
47
41
  g,
@@ -65,15 +59,15 @@ var a = ({ ref: a, popupRef: o, open: s, placement: c = "bottom", disabled: l =
65
59
  g,
66
60
  s
67
61
  ]), t(() => {
68
- if (_ && !l) return window.addEventListener("keydown", w), () => {
69
- window.removeEventListener("keydown", w);
62
+ if (_ && !l) return window.addEventListener("keydown", T), () => {
63
+ window.removeEventListener("keydown", T);
70
64
  };
71
65
  }, [
72
66
  _,
73
- w,
67
+ T,
74
68
  l
75
69
  ]);
76
- let T = e((e) => {
70
+ let E = e((e) => {
77
71
  if (!y || !x) return;
78
72
  let t = x.innerWidth, n = x.innerHeight, r = 0, i = 0;
79
73
  switch (c) {
@@ -107,18 +101,18 @@ var a = ({ ref: a, popupRef: o, open: s, placement: c = "bottom", disabled: l =
107
101
  }, [s]), [
108
102
  _,
109
103
  v,
110
- S,
111
104
  C,
105
+ w,
112
106
  y,
113
107
  n(() => {
114
108
  if (!_ || !a?.current || !o?.current) return;
115
109
  let e = o.current.getBoundingClientRect();
116
- return T(e);
110
+ return E(e);
117
111
  }, [
118
112
  _,
119
113
  a,
120
114
  o,
121
- T
115
+ E
122
116
  ])
123
117
  ];
124
118
  };
@@ -1,24 +1,22 @@
1
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 { use as r, useCallback as i, useMemo as a } from "react";
5
- import o from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
6
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
- import l from "clsx";
8
- import u from "@plitzi/plitzi-ui/ContentEditable";
2
+ import { RootElement as t } from "../../../Element/RootElement.mjs";
3
+ import n from "../../../Element/hooks/useEditableContent.mjs";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import a from "clsx";
6
+ import o from "@plitzi/plitzi-ui/ContentEditable";
9
7
  //#region src/elements/basic/Heading/Heading.tsx
10
- var d = ({ ref: e, className: d = "", content: f = "Heading", subType: p = "h1" }) => {
11
- let { id: m } = t(), { settings: { previewMode: h }, contexts: { BuilderContext: g } } = o(), _ = g ? r(g) : void 0, v = a(() => typeof f != "string" && typeof f != "number" ? JSON.stringify(f) : !f && f !== "" && !h ? "Heading" : f, [f, h]), y = i((e) => !h && _?.updateElement(m, "content", e), [_?.updateElement, m]);
12
- return /* @__PURE__ */ c(n, {
8
+ var s = ({ ref: e, className: s = "", content: c = "Heading", subType: l = "h1" }) => {
9
+ let { previewMode: u, text: d, handleChange: f } = n(c);
10
+ return /* @__PURE__ */ i(t, {
13
11
  ref: e,
14
- tag: h ? p : "div",
15
- className: l("plitzi-component__heading", { [`plitzi-component__heading-${p}`]: p }, d),
16
- children: [h && v, !h && /* @__PURE__ */ s(u, {
17
- value: v,
18
- onChange: y,
12
+ tag: u ? l : "div",
13
+ className: a("plitzi-component__heading", { [`plitzi-component__heading-${l}`]: l }, s),
14
+ children: [u && d, !u && /* @__PURE__ */ r(o, {
15
+ value: d,
16
+ onChange: f,
19
17
  openMode: "doubleClick"
20
18
  })]
21
19
  });
22
- }, f = e(d);
20
+ }, c = e(s);
23
21
  //#endregion
24
- export { d as Heading, f as default };
22
+ export { s as Heading, c as default };
@@ -1,16 +1,16 @@
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/TextArea";
4
4
  import i from "@plitzi/plitzi-ui/Select";
5
5
  //#region src/elements/basic/Heading/Settings.tsx
6
6
  var a = ({ subType: a = "h1", content: o = "", onUpdate: s }) => {
7
- let c = e((e) => (t) => s?.(e, t), [s]);
7
+ let c = e(s);
8
8
  return /* @__PURE__ */ n("div", {
9
9
  className: "flex h-full flex-col gap-4 py-2",
10
10
  children: [/* @__PURE__ */ n(i, {
11
11
  value: a,
12
12
  label: "Heading Tag",
13
- onChange: c("subType"),
13
+ onChange: c.text("subType"),
14
14
  size: "xs",
15
15
  children: [
16
16
  /* @__PURE__ */ t("option", {
@@ -41,7 +41,7 @@ var a = ({ subType: a = "h1", content: o = "", onUpdate: s }) => {
41
41
  }), /* @__PURE__ */ t(r, {
42
42
  value: o,
43
43
  label: "Content",
44
- onChange: c("content"),
44
+ onChange: c.text("content"),
45
45
  size: "xs"
46
46
  })]
47
47
  });
@@ -2,7 +2,7 @@ import { HeadingProps } from './Heading';
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 HeadingAttributes = AuthorableAttributes<HeadingProps>;
5
- declare const declaration: {
5
+ declare const declaration: import('@plitzi/sdk-shared/authoring/declare').DeclaredElement<{
6
6
  readonly type: "heading";
7
7
  readonly attributeValues: {
8
8
  readonly subType: readonly string[];
@@ -14,37 +14,13 @@ declare const declaration: {
14
14
  };
15
15
  readonly definition: {
16
16
  readonly label: "Heading";
17
- readonly type: "heading";
18
17
  readonly description: "A section heading (<h1>–<h6>) for titles and document hierarchy.";
19
- readonly bindings: {};
20
- readonly styleSelectors: {
21
- readonly base: "";
22
- };
23
- readonly initialState: {
24
- readonly visibility: true;
25
- };
26
- };
27
- readonly builder: {
28
- readonly canDelete: true;
29
- readonly canSelect: true;
30
- readonly canDragDrop: true;
31
- readonly canMove: true;
32
- readonly canSnippet: true;
33
- readonly itemsAllowed: readonly [];
34
- readonly itemsNotAllowed: readonly [];
35
18
  };
36
19
  readonly market: {
37
20
  readonly category: "basic";
38
- readonly owner: "Plitzi";
39
- readonly verified: true;
40
- readonly license: "MIT";
41
- readonly website: "https://plitzi.com";
42
- readonly backgroundColor: "#4422ee";
43
21
  readonly icon: "fa-solid fa-heading";
44
22
  };
45
23
  readonly defaultStyle: {
46
- readonly name: "Heading";
47
- readonly displayMode: "desktop";
48
24
  readonly style: {
49
25
  readonly base: {
50
26
  readonly default: {
@@ -147,9 +123,8 @@ declare const declaration: {
147
123
  };
148
124
  };
149
125
  };
150
- readonly settings: {};
151
126
  };
152
- } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
127
+ }, Partial<{
153
128
  content?: string | undefined;
154
129
  subType?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
155
130
  }>>;
@@ -17,33 +17,13 @@ var n = e()({
17
17
  },
18
18
  definition: {
19
19
  label: "Heading",
20
- type: "heading",
21
- description: "A section heading (<h1>–<h6>) for titles and document hierarchy.",
22
- bindings: {},
23
- styleSelectors: { base: "" },
24
- initialState: { visibility: !0 }
25
- },
26
- builder: {
27
- canDelete: !0,
28
- canSelect: !0,
29
- canDragDrop: !0,
30
- canMove: !0,
31
- canSnippet: !0,
32
- itemsAllowed: [],
33
- itemsNotAllowed: []
20
+ description: "A section heading (<h1>–<h6>) for titles and document hierarchy."
34
21
  },
35
22
  market: {
36
23
  category: "basic",
37
- owner: "Plitzi",
38
- verified: !0,
39
- license: "MIT",
40
- website: "https://plitzi.com",
41
- backgroundColor: "#4422ee",
42
24
  icon: "fa-solid fa-heading"
43
25
  },
44
26
  defaultStyle: {
45
- name: "Heading",
46
- displayMode: "desktop",
47
27
  style: { base: { default: {
48
28
  "margin-top": "25px",
49
29
  "margin-bottom": "25px",
@@ -117,8 +97,7 @@ var n = e()({
117
97
  } } }
118
98
  }
119
99
  }
120
- },
121
- settings: {}
100
+ }
122
101
  }
123
102
  });
124
103
  //#endregion
@@ -13,37 +13,13 @@ declare const Heading: {
13
13
  };
14
14
  readonly definition: {
15
15
  readonly label: "Heading";
16
- readonly type: "heading";
17
16
  readonly description: "A section heading (<h1>–<h6>) for titles and document hierarchy.";
18
- readonly bindings: {};
19
- readonly styleSelectors: {
20
- readonly base: "";
21
- };
22
- readonly initialState: {
23
- readonly visibility: true;
24
- };
25
- };
26
- 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 [];
34
17
  };
35
18
  readonly market: {
36
19
  readonly category: "basic";
37
- readonly owner: "Plitzi";
38
- readonly verified: true;
39
- readonly license: "MIT";
40
- readonly website: "https://plitzi.com";
41
- readonly backgroundColor: "#4422ee";
42
20
  readonly icon: "fa-solid fa-heading";
43
21
  };
44
22
  readonly defaultStyle: {
45
- readonly name: "Heading";
46
- readonly displayMode: "desktop";
47
23
  readonly style: {
48
24
  readonly base: {
49
25
  readonly default: {
@@ -146,8 +122,9 @@ declare const Heading: {
146
122
  };
147
123
  };
148
124
  };
149
- readonly settings: {};
150
125
  };
126
+ } & {
127
+ content: import('@plitzi/sdk-shared/authoring/declare').ElementContentDefaults;
151
128
  } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
152
129
  content?: string | undefined;
153
130
  subType?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;