@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
@@ -10,11 +10,8 @@ declare const Markdown: {
10
10
  };
11
11
  readonly definition: {
12
12
  readonly label: "Markdown";
13
- readonly type: "markdown";
14
13
  readonly description: string;
15
- readonly bindings: {};
16
14
  readonly styleSelectors: {
17
- readonly base: "";
18
15
  readonly heading: "";
19
16
  readonly heading1: "";
20
17
  readonly heading2: "";
@@ -44,39 +41,21 @@ declare const Markdown: {
44
41
  readonly tableCell: "";
45
42
  readonly anchor: "";
46
43
  };
47
- readonly initialState: {
48
- readonly visibility: true;
49
- };
50
- };
51
- readonly builder: {
52
- readonly canDelete: true;
53
- readonly canSelect: true;
54
- readonly canDragDrop: true;
55
- readonly canMove: true;
56
- readonly canSnippet: true;
57
- readonly itemsAllowed: readonly [];
58
- readonly itemsNotAllowed: readonly [];
59
44
  };
60
45
  readonly market: {
61
46
  readonly category: "basic";
62
- readonly owner: "Plitzi";
63
- readonly verified: true;
64
- readonly license: "MIT";
65
- readonly website: "https://plitzi.com";
66
- readonly backgroundColor: "#4422ee";
67
47
  readonly icon: "fa-brands fa-markdown";
68
48
  };
69
49
  readonly defaultStyle: {
70
- readonly name: "Markdown";
71
- readonly displayMode: "desktop";
72
50
  readonly style: {
73
51
  readonly base: {
74
52
  readonly default: {};
75
53
  };
76
54
  };
77
55
  };
78
- readonly settings: {};
79
56
  };
57
+ } & {
58
+ content: import('@plitzi/sdk-shared/authoring/declare').ElementContentDefaults;
80
59
  } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
81
60
  content?: string | undefined;
82
61
  headingLinks?: boolean | undefined;
@@ -1,25 +1,23 @@
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/Paragraph/Paragraph.tsx
10
- var d = ({ ref: e, content: d = "Paragraph", className: f = "" }) => {
11
- let { id: p } = t(), { settings: { previewMode: m }, contexts: { BuilderContext: h } } = o(), g = h ? r(h) : void 0, _ = a(() => typeof d != "string" && typeof d != "number" ? JSON.stringify(d) : !d && d !== "" && !m ? "Paragraph" : typeof d == "number" ? `${d}` : d, [d, m]), v = i((e) => g?.updateElement(p, "content", e), [g, p]);
12
- return /* @__PURE__ */ c(n, {
8
+ var s = ({ ref: e, content: s = "Paragraph", className: c = "" }) => {
9
+ let { previewMode: l, text: u, handleChange: d } = n(s);
10
+ return /* @__PURE__ */ i(t, {
13
11
  ref: e,
14
- tag: m ? "p" : "div",
15
- className: l("plitzi-component__paragraph", f),
16
- children: [m && _, !m && /* @__PURE__ */ s(u, {
12
+ tag: l ? "p" : "div",
13
+ className: a("plitzi-component__paragraph", c),
14
+ children: [l && u, !l && /* @__PURE__ */ r(o, {
17
15
  className: "",
18
- value: _,
19
- onChange: v,
16
+ value: u,
17
+ onChange: d,
20
18
  openMode: "doubleClick"
21
19
  })]
22
20
  });
23
- }, f = e(d);
21
+ }, c = e(s);
24
22
  //#endregion
25
- export { d as Paragraph, f as default };
23
+ export { s as Paragraph, c as default };
@@ -2,7 +2,7 @@ import { ParagraphProps } from './Paragraph';
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 ParagraphAttributes = AuthorableAttributes<ParagraphProps>;
5
- declare const declaration: {
5
+ declare const declaration: import('@plitzi/sdk-shared/authoring/declare').DeclaredElement<{
6
6
  readonly type: "paragraph";
7
7
  readonly content: {
8
8
  readonly attributes: {
@@ -10,37 +10,13 @@ declare const declaration: {
10
10
  };
11
11
  readonly definition: {
12
12
  readonly label: "Paragraph";
13
- readonly type: "paragraph";
14
13
  readonly description: "A block of body text (a <p>). Use for longer prose passages.";
15
- readonly bindings: {};
16
- readonly styleSelectors: {
17
- readonly base: "";
18
- };
19
- readonly initialState: {
20
- readonly visibility: true;
21
- };
22
- };
23
- readonly builder: {
24
- readonly canDelete: true;
25
- readonly canSelect: true;
26
- readonly canDragDrop: true;
27
- readonly canMove: true;
28
- readonly canSnippet: true;
29
- readonly itemsAllowed: readonly [];
30
- readonly itemsNotAllowed: readonly [];
31
14
  };
32
15
  readonly market: {
33
16
  readonly category: "basic";
34
- readonly owner: "Plitzi";
35
- readonly verified: true;
36
- readonly license: "MIT";
37
- readonly website: "https://plitzi.com";
38
- readonly backgroundColor: "#4422ee";
39
17
  readonly icon: "fa-solid fa-paragraph";
40
18
  };
41
19
  readonly defaultStyle: {
42
- readonly name: "Paragraph";
43
- readonly displayMode: "desktop";
44
20
  readonly style: {
45
21
  readonly base: {
46
22
  readonly default: {
@@ -50,9 +26,8 @@ declare const declaration: {
50
26
  };
51
27
  };
52
28
  };
53
- readonly settings: {};
54
29
  };
55
- } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
30
+ }, Partial<{
56
31
  content?: string | number | undefined;
57
32
  }>>;
58
33
  export default declaration;
@@ -6,39 +6,16 @@ var t = e()({
6
6
  attributes: { content: "Paragraph" },
7
7
  definition: {
8
8
  label: "Paragraph",
9
- type: "paragraph",
10
- description: "A block of body text (a <p>). Use for longer prose passages.",
11
- bindings: {},
12
- styleSelectors: { base: "" },
13
- initialState: { visibility: !0 }
14
- },
15
- builder: {
16
- canDelete: !0,
17
- canSelect: !0,
18
- canDragDrop: !0,
19
- canMove: !0,
20
- canSnippet: !0,
21
- itemsAllowed: [],
22
- itemsNotAllowed: []
9
+ description: "A block of body text (a <p>). Use for longer prose passages."
23
10
  },
24
11
  market: {
25
12
  category: "basic",
26
- owner: "Plitzi",
27
- verified: !0,
28
- license: "MIT",
29
- website: "https://plitzi.com",
30
- backgroundColor: "#4422ee",
31
13
  icon: "fa-solid fa-paragraph"
32
14
  },
33
- defaultStyle: {
34
- name: "Paragraph",
35
- displayMode: "desktop",
36
- style: { base: { default: {
37
- "margin-top": "14px",
38
- "margin-bottom": "14px"
39
- } } }
40
- },
41
- settings: {}
15
+ defaultStyle: { style: { base: { default: {
16
+ "margin-top": "14px",
17
+ "margin-bottom": "14px"
18
+ } } } }
42
19
  }
43
20
  });
44
21
  //#endregion
@@ -9,37 +9,13 @@ declare const Paragraph: {
9
9
  };
10
10
  readonly definition: {
11
11
  readonly label: "Paragraph";
12
- readonly type: "paragraph";
13
12
  readonly description: "A block of body text (a <p>). Use for longer prose passages.";
14
- readonly bindings: {};
15
- readonly styleSelectors: {
16
- readonly base: "";
17
- };
18
- readonly initialState: {
19
- readonly visibility: true;
20
- };
21
- };
22
- readonly builder: {
23
- readonly canDelete: true;
24
- readonly canSelect: true;
25
- readonly canDragDrop: true;
26
- readonly canMove: true;
27
- readonly canSnippet: true;
28
- readonly itemsAllowed: readonly [];
29
- readonly itemsNotAllowed: readonly [];
30
13
  };
31
14
  readonly market: {
32
15
  readonly category: "basic";
33
- readonly owner: "Plitzi";
34
- readonly verified: true;
35
- readonly license: "MIT";
36
- readonly website: "https://plitzi.com";
37
- readonly backgroundColor: "#4422ee";
38
16
  readonly icon: "fa-solid fa-paragraph";
39
17
  };
40
18
  readonly defaultStyle: {
41
- readonly name: "Paragraph";
42
- readonly displayMode: "desktop";
43
19
  readonly style: {
44
20
  readonly base: {
45
21
  readonly default: {
@@ -49,8 +25,9 @@ declare const Paragraph: {
49
25
  };
50
26
  };
51
27
  };
52
- readonly settings: {};
53
28
  };
29
+ } & {
30
+ content: import('@plitzi/sdk-shared/authoring/declare').ElementContentDefaults;
54
31
  } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
55
32
  content?: string | number | undefined;
56
33
  }>>;
@@ -6,7 +6,7 @@ import i from "../Markdown/hooks/useMarkdownClassNames.mjs";
6
6
  import { classHtmlParts as a } from "./classHtmlParts.mjs";
7
7
  import { rebaseHtmlMedia as o, sanitizeHtml as s } from "./sanitizeHtml.mjs";
8
8
  import { useMemo as c } from "react";
9
- import l from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
9
+ import l from "@plitzi/sdk-shared/hooks/usePlitzi";
10
10
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
11
11
  import f from "clsx";
12
12
  //#region src/elements/basic/RichText/RichText.tsx
@@ -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/basic/RichText/Settings.tsx
6
6
  var a = ({ format: a = "html", mediaBaseUrl: 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 grow flex-col gap-4 py-2",
10
10
  children: [
11
11
  /* @__PURE__ */ n(i, {
12
12
  value: a,
13
13
  label: "Content Format",
14
- onChange: c("format"),
14
+ onChange: c.text("format"),
15
15
  size: "xs",
16
16
  children: [
17
17
  /* @__PURE__ */ t("option", {
@@ -33,7 +33,7 @@ var a = ({ format: a = "html", mediaBaseUrl: o = "", onUpdate: s }) => {
33
33
  label: "Media Base URL",
34
34
  placeholder: "https://cms.example.com",
35
35
  title: "Prefix for relative image and link paths inside the body.",
36
- onChange: c("mediaBaseUrl"),
36
+ onChange: c.text("mediaBaseUrl"),
37
37
  size: "xs"
38
38
  }),
39
39
  /* @__PURE__ */ n("span", {
@@ -2,7 +2,7 @@ import { RichTextProps } from './RichText';
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 RichTextAttributes = AuthorableAttributes<RichTextProps>;
5
- declare const declaration: {
5
+ declare const declaration: import('@plitzi/sdk-shared/authoring/declare').DeclaredElement<{
6
6
  readonly type: "richText";
7
7
  readonly attributeValues: {
8
8
  readonly format: readonly string[];
@@ -15,12 +15,9 @@ declare const declaration: {
15
15
  };
16
16
  readonly definition: {
17
17
  readonly label: "Rich Text";
18
- readonly type: "richText";
19
18
  readonly description: string;
20
- readonly items: readonly [];
21
- readonly bindings: {};
19
+ readonly items: [];
22
20
  readonly styleSelectors: {
23
- readonly base: "";
24
21
  readonly heading: "";
25
22
  readonly heading1: "";
26
23
  readonly heading2: "";
@@ -49,31 +46,12 @@ declare const declaration: {
49
46
  readonly tableHeaderCell: "";
50
47
  readonly tableCell: "";
51
48
  };
52
- readonly initialState: {
53
- readonly visibility: true;
54
- };
55
- };
56
- readonly builder: {
57
- readonly canDelete: true;
58
- readonly canSelect: true;
59
- readonly canDragDrop: true;
60
- readonly canMove: true;
61
- readonly canSnippet: true;
62
- readonly itemsAllowed: readonly [];
63
- readonly itemsNotAllowed: readonly [];
64
49
  };
65
50
  readonly market: {
66
51
  readonly category: "basic";
67
- readonly owner: "Plitzi";
68
- readonly verified: true;
69
- readonly license: "MIT";
70
- readonly website: "https://plitzi.com";
71
- readonly backgroundColor: "#4422ee";
72
52
  readonly icon: "fa-solid fa-file-lines";
73
53
  };
74
54
  readonly defaultStyle: {
75
- readonly name: "Rich Text";
76
- readonly displayMode: "desktop";
77
55
  readonly style: {
78
56
  readonly base: {
79
57
  readonly default: {};
@@ -81,11 +59,10 @@ declare const declaration: {
81
59
  };
82
60
  readonly subTypes: {};
83
61
  };
84
- readonly settings: {};
85
62
  };
86
- } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
87
- format?: "html" | "markdown" | "text" | undefined;
63
+ }, Partial<{
88
64
  content?: string | undefined;
65
+ format?: "html" | "markdown" | "text" | undefined;
89
66
  mediaBaseUrl?: string | undefined;
90
67
  }>>;
91
68
  export default declaration;
@@ -15,12 +15,9 @@ var n = e()({
15
15
  },
16
16
  definition: {
17
17
  label: "Rich Text",
18
- type: "richText",
19
18
  description: "Renders a body field coming from a CMS — HTML, markdown or plain text. Scripts and event handlers are stripped before rendering, so third-party content cannot execute. The parts of an HTML or markdown body take a class through the slots a `markdown` has, by the same names: `heading` and `heading1`…`heading6` (a property on one of the two, never both), `paragraph`, `link`, `strong` (`strong`/`b`), `emphasis` (`em`/`i`), `list`, `listItem`, `quote`, `divider`, `code` (inline), `codeBlock` (`pre`), `image`, `table`, `tableHead`, `tableRow`, `tableHeaderCell`, `tableCell`; the fenced block of a markdown body also sits in `codeBlockFrame`, under `codeBlockHeader` with `codeBlockLanguage` and `codeBlockCopy`. Unstyled, a body reads as a document from the base layer of the SDK, which a class on the slot of a part replaces property by property.",
20
19
  items: [],
21
- bindings: {},
22
20
  styleSelectors: {
23
- base: "",
24
21
  heading: "",
25
22
  heading1: "",
26
23
  heading2: "",
@@ -48,34 +45,16 @@ var n = e()({
48
45
  tableRow: "",
49
46
  tableHeaderCell: "",
50
47
  tableCell: ""
51
- },
52
- initialState: { visibility: !0 }
53
- },
54
- builder: {
55
- canDelete: !0,
56
- canSelect: !0,
57
- canDragDrop: !0,
58
- canMove: !0,
59
- canSnippet: !0,
60
- itemsAllowed: [],
61
- itemsNotAllowed: []
48
+ }
62
49
  },
63
50
  market: {
64
51
  category: "basic",
65
- owner: "Plitzi",
66
- verified: !0,
67
- license: "MIT",
68
- website: "https://plitzi.com",
69
- backgroundColor: "#4422ee",
70
52
  icon: "fa-solid fa-file-lines"
71
53
  },
72
54
  defaultStyle: {
73
- name: "Rich Text",
74
- displayMode: "desktop",
75
55
  style: { base: { default: {} } },
76
56
  subTypes: {}
77
- },
78
- settings: {}
57
+ }
79
58
  }
80
59
  });
81
60
  //#endregion
@@ -14,12 +14,9 @@ declare const RichText: {
14
14
  };
15
15
  readonly definition: {
16
16
  readonly label: "Rich Text";
17
- readonly type: "richText";
18
17
  readonly description: string;
19
- readonly items: readonly [];
20
- readonly bindings: {};
18
+ readonly items: [];
21
19
  readonly styleSelectors: {
22
- readonly base: "";
23
20
  readonly heading: "";
24
21
  readonly heading1: "";
25
22
  readonly heading2: "";
@@ -48,31 +45,12 @@ declare const RichText: {
48
45
  readonly tableHeaderCell: "";
49
46
  readonly tableCell: "";
50
47
  };
51
- readonly initialState: {
52
- readonly visibility: true;
53
- };
54
- };
55
- readonly builder: {
56
- readonly canDelete: true;
57
- readonly canSelect: true;
58
- readonly canDragDrop: true;
59
- readonly canMove: true;
60
- readonly canSnippet: true;
61
- readonly itemsAllowed: readonly [];
62
- readonly itemsNotAllowed: readonly [];
63
48
  };
64
49
  readonly market: {
65
50
  readonly category: "basic";
66
- readonly owner: "Plitzi";
67
- readonly verified: true;
68
- readonly license: "MIT";
69
- readonly website: "https://plitzi.com";
70
- readonly backgroundColor: "#4422ee";
71
51
  readonly icon: "fa-solid fa-file-lines";
72
52
  };
73
53
  readonly defaultStyle: {
74
- readonly name: "Rich Text";
75
- readonly displayMode: "desktop";
76
54
  readonly style: {
77
55
  readonly base: {
78
56
  readonly default: {};
@@ -80,11 +58,12 @@ declare const RichText: {
80
58
  };
81
59
  readonly subTypes: {};
82
60
  };
83
- readonly settings: {};
84
61
  };
62
+ } & {
63
+ content: import('@plitzi/sdk-shared/authoring/declare').ElementContentDefaults;
85
64
  } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
86
- format?: "html" | "markdown" | "text" | undefined;
87
65
  content?: string | undefined;
66
+ format?: "html" | "markdown" | "text" | undefined;
88
67
  mediaBaseUrl?: string | undefined;
89
68
  }>>;
90
69
  export default RichText;
@@ -1,26 +1,24 @@
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/Text/Text.tsx
10
- var d = ({ ref: e, content: d = "Text", className: f = "", title: p = "", decorative: m = !1 }) => {
11
- let { id: h } = t(), { settings: { previewMode: g }, contexts: { BuilderContext: _ } } = o(), v = _ ? r(_) : void 0, y = a(() => typeof d != "string" && typeof d != "number" ? JSON.stringify(d) : !d && d !== "" && !g ? "Text" : typeof d == "number" ? `${d}` : d, [d, g]), b = i((e) => v?.updateElement(h, "content", e), [v, h]);
12
- return /* @__PURE__ */ c(n, {
8
+ var s = ({ ref: e, content: s = "Text", className: c = "", title: l = "", decorative: u = !1 }) => {
9
+ let { previewMode: d, text: f, handleChange: p } = n(s);
10
+ return /* @__PURE__ */ i(t, {
13
11
  ref: e,
14
- className: l("plitzi-component__text", f),
15
- title: p || void 0,
16
- ...m ? { "aria-hidden": !0 } : {},
17
- children: [g && y, !g && /* @__PURE__ */ s(u, {
12
+ className: a("plitzi-component__text", c),
13
+ title: l || void 0,
14
+ ...u ? { "aria-hidden": !0 } : {},
15
+ children: [d && f, !d && /* @__PURE__ */ r(o, {
18
16
  className: "focus-visible:outline-hidden",
19
- value: y,
20
- onChange: b,
17
+ value: f,
18
+ onChange: p,
21
19
  openMode: "doubleClick"
22
20
  })]
23
21
  });
24
- }, f = e(d);
22
+ }, c = e(s);
25
23
  //#endregion
26
- export { d as Text, f as default };
24
+ export { s as Text, c as default };
@@ -2,7 +2,7 @@ import { TextProps } from './Text';
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 TextAttributes = AuthorableAttributes<TextProps>;
5
- declare const declaration: {
5
+ declare const declaration: import('@plitzi/sdk-shared/authoring/declare').DeclaredElement<{
6
6
  readonly type: "text";
7
7
  readonly content: {
8
8
  readonly attributes: {
@@ -10,37 +10,13 @@ declare const declaration: {
10
10
  };
11
11
  readonly definition: {
12
12
  readonly label: "Text";
13
- readonly type: "text";
14
13
  readonly description: "Inline plain-text content. Use for short runs of copy; bind its content to data for dynamic text.";
15
- readonly bindings: {};
16
- readonly styleSelectors: {
17
- readonly base: "";
18
- };
19
- readonly initialState: {
20
- readonly visibility: true;
21
- };
22
- };
23
- readonly builder: {
24
- readonly canDelete: true;
25
- readonly canSelect: true;
26
- readonly canDragDrop: true;
27
- readonly canMove: true;
28
- readonly canSnippet: true;
29
- readonly itemsAllowed: readonly [];
30
- readonly itemsNotAllowed: readonly [];
31
14
  };
32
15
  readonly market: {
33
16
  readonly category: "basic";
34
- readonly owner: "Plitzi";
35
- readonly verified: true;
36
- readonly license: "MIT";
37
- readonly website: "https://plitzi.com";
38
- readonly backgroundColor: "#4422ee";
39
17
  readonly icon: "fa-solid fa-align-left";
40
18
  };
41
19
  readonly defaultStyle: {
42
- readonly name: "Text";
43
- readonly displayMode: "desktop";
44
20
  readonly style: {
45
21
  readonly base: {
46
22
  readonly default: {
@@ -49,11 +25,10 @@ declare const declaration: {
49
25
  };
50
26
  };
51
27
  };
52
- readonly settings: {};
53
28
  };
54
- } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
55
- title?: string | undefined;
29
+ }, Partial<{
56
30
  content?: string | number | undefined;
31
+ title?: string | undefined;
57
32
  decorative?: boolean | undefined;
58
33
  }>>;
59
34
  export default declaration;
@@ -6,36 +6,13 @@ var t = e()({
6
6
  attributes: { content: "Text" },
7
7
  definition: {
8
8
  label: "Text",
9
- type: "text",
10
- description: "Inline plain-text content. Use for short runs of copy; bind its content to data for dynamic text.",
11
- bindings: {},
12
- styleSelectors: { base: "" },
13
- initialState: { visibility: !0 }
14
- },
15
- builder: {
16
- canDelete: !0,
17
- canSelect: !0,
18
- canDragDrop: !0,
19
- canMove: !0,
20
- canSnippet: !0,
21
- itemsAllowed: [],
22
- itemsNotAllowed: []
9
+ description: "Inline plain-text content. Use for short runs of copy; bind its content to data for dynamic text."
23
10
  },
24
11
  market: {
25
12
  category: "basic",
26
- owner: "Plitzi",
27
- verified: !0,
28
- license: "MIT",
29
- website: "https://plitzi.com",
30
- backgroundColor: "#4422ee",
31
13
  icon: "fa-solid fa-align-left"
32
14
  },
33
- defaultStyle: {
34
- name: "Text",
35
- displayMode: "desktop",
36
- style: { base: { default: { display: "inline" } } }
37
- },
38
- settings: {}
15
+ defaultStyle: { style: { base: { default: { display: "inline" } } } }
39
16
  }
40
17
  });
41
18
  //#endregion
@@ -9,37 +9,13 @@ declare const Text: {
9
9
  };
10
10
  readonly definition: {
11
11
  readonly label: "Text";
12
- readonly type: "text";
13
12
  readonly description: "Inline plain-text content. Use for short runs of copy; bind its content to data for dynamic text.";
14
- readonly bindings: {};
15
- readonly styleSelectors: {
16
- readonly base: "";
17
- };
18
- readonly initialState: {
19
- readonly visibility: true;
20
- };
21
- };
22
- readonly builder: {
23
- readonly canDelete: true;
24
- readonly canSelect: true;
25
- readonly canDragDrop: true;
26
- readonly canMove: true;
27
- readonly canSnippet: true;
28
- readonly itemsAllowed: readonly [];
29
- readonly itemsNotAllowed: readonly [];
30
13
  };
31
14
  readonly market: {
32
15
  readonly category: "basic";
33
- readonly owner: "Plitzi";
34
- readonly verified: true;
35
- readonly license: "MIT";
36
- readonly website: "https://plitzi.com";
37
- readonly backgroundColor: "#4422ee";
38
16
  readonly icon: "fa-solid fa-align-left";
39
17
  };
40
18
  readonly defaultStyle: {
41
- readonly name: "Text";
42
- readonly displayMode: "desktop";
43
19
  readonly style: {
44
20
  readonly base: {
45
21
  readonly default: {
@@ -48,11 +24,12 @@ declare const Text: {
48
24
  };
49
25
  };
50
26
  };
51
- readonly settings: {};
52
27
  };
28
+ } & {
29
+ content: import('@plitzi/sdk-shared/authoring/declare').ElementContentDefaults;
53
30
  } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
54
- title?: string | undefined;
55
31
  content?: string | number | undefined;
32
+ title?: string | undefined;
56
33
  decorative?: boolean | undefined;
57
34
  }>>;
58
35
  export default Text;