@plitzi/sdk-elements 0.38.23 → 0.39.0

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 (230) hide show
  1. package/CHANGELOG.md +180 -1
  2. package/dist/Element/RootElement.d.ts +1 -1
  3. package/dist/Element/RootElement.mjs +62 -61
  4. package/dist/Element/RowAnchor.d.ts +15 -0
  5. package/dist/Element/RowAnchor.mjs +8 -0
  6. package/dist/Element/helpers/elementConstants.mjs +12 -0
  7. package/dist/Element/hocs/withElement.d.ts +1 -1
  8. package/dist/Element/hocs/withElement.mjs +96 -88
  9. package/dist/Element/hooks/useEditableContent.d.ts +11 -0
  10. package/dist/Element/hooks/useEditableContent.mjs +11 -10
  11. package/dist/Element/hooks/useElement.mjs +1 -1
  12. package/dist/Element/hooks/useElementDataSource.mjs +11 -10
  13. package/dist/Element/hooks/useFocusInteractions.d.ts +12 -0
  14. package/dist/Element/hooks/useFocusInteractions.mjs +9 -0
  15. package/dist/Element/hooks/useInternalClassName.mjs +22 -21
  16. package/dist/Element/hooks/useRootElementInteractions.mjs +48 -42
  17. package/dist/Element/hooks/useScrollInteractions.d.ts +1 -1
  18. package/dist/Element/hooks/useScrollInteractions.mjs +61 -30
  19. package/dist/dataSource/PluginSource.d.ts +22 -0
  20. package/dist/dataSource/PluginSource.mjs +27 -0
  21. package/dist/dataSource/index.d.ts +2 -0
  22. package/dist/dataSource/index.mjs +5 -4
  23. package/dist/elements/advanced/BlockHtml/BlockHtml.d.ts +1 -1
  24. package/dist/elements/advanced/BlockHtml/index.d.ts +1 -1
  25. package/dist/elements/advanced/BlockJsx/BlockJsx.d.ts +1 -1
  26. package/dist/elements/advanced/BlockJsx/index.d.ts +1 -1
  27. package/dist/elements/advanced/Custom/Custom.d.ts +1 -1
  28. package/dist/elements/advanced/Custom/index.d.ts +1 -1
  29. package/dist/elements/advanced/NodeHtml/NodeHtml.d.ts +1 -1
  30. package/dist/elements/advanced/NodeHtml/declaration.d.ts +3 -3
  31. package/dist/elements/advanced/NodeHtml/index.d.ts +4 -4
  32. package/dist/elements/advanced/Reference/Reference.d.ts +2 -2
  33. package/dist/elements/advanced/Reference/Reference.mjs +1 -1
  34. package/dist/elements/advanced/Reference/index.d.ts +1 -1
  35. package/dist/elements/basic/Button/Button.d.ts +7 -2
  36. package/dist/elements/basic/Button/Button.mjs +27 -25
  37. package/dist/elements/basic/Button/Settings.mjs +1 -1
  38. package/dist/elements/basic/Button/declaration.d.ts +8 -1
  39. package/dist/elements/basic/Button/declaration.mjs +3 -0
  40. package/dist/elements/basic/Button/index.d.ts +9 -2
  41. package/dist/elements/basic/Dropdown/Dropdown.d.ts +9 -2
  42. package/dist/elements/basic/Dropdown/Dropdown.mjs +93 -74
  43. package/dist/elements/basic/Dropdown/DropdownPopup/DropdownPopup.d.ts +1 -1
  44. package/dist/elements/basic/Dropdown/DropdownPopup/index.d.ts +1 -1
  45. package/dist/elements/basic/Dropdown/declaration.d.ts +31 -0
  46. package/dist/elements/basic/Dropdown/declaration.mjs +38 -6
  47. package/dist/elements/basic/Dropdown/index.d.ts +33 -2
  48. package/dist/elements/basic/Dropdown/useDropdown.d.ts +2 -0
  49. package/dist/elements/basic/Heading/Heading.d.ts +1 -1
  50. package/dist/elements/basic/Heading/Heading.mjs +3 -2
  51. package/dist/elements/basic/Heading/declaration.d.ts +2 -0
  52. package/dist/elements/basic/Heading/declaration.mjs +2 -0
  53. package/dist/elements/basic/Heading/index.d.ts +3 -1
  54. package/dist/elements/basic/Link/Link.d.ts +1 -1
  55. package/dist/elements/basic/Link/Link.mjs +46 -45
  56. package/dist/elements/basic/Link/declaration.d.ts +1 -0
  57. package/dist/elements/basic/Link/declaration.mjs +5 -0
  58. package/dist/elements/basic/Link/index.d.ts +2 -1
  59. package/dist/elements/basic/Markdown/Markdown.d.ts +1 -1
  60. package/dist/elements/basic/Markdown/declaration.d.ts +2 -0
  61. package/dist/elements/basic/Markdown/declaration.mjs +2 -0
  62. package/dist/elements/basic/Markdown/index.d.ts +3 -1
  63. package/dist/elements/basic/Paragraph/Paragraph.d.ts +1 -1
  64. package/dist/elements/basic/Paragraph/Paragraph.mjs +3 -2
  65. package/dist/elements/basic/Paragraph/Settings.mjs +1 -1
  66. package/dist/elements/basic/Paragraph/declaration.d.ts +2 -0
  67. package/dist/elements/basic/Paragraph/declaration.mjs +2 -0
  68. package/dist/elements/basic/Paragraph/index.d.ts +3 -1
  69. package/dist/elements/basic/RichText/RichText.d.ts +1 -1
  70. package/dist/elements/basic/RichText/declaration.d.ts +1 -0
  71. package/dist/elements/basic/RichText/declaration.mjs +1 -0
  72. package/dist/elements/basic/RichText/index.d.ts +2 -1
  73. package/dist/elements/basic/Text/Settings.mjs +1 -1
  74. package/dist/elements/basic/Text/Text.d.ts +1 -1
  75. package/dist/elements/basic/Text/Text.mjs +3 -2
  76. package/dist/elements/basic/Text/declaration.d.ts +2 -0
  77. package/dist/elements/basic/Text/declaration.mjs +2 -0
  78. package/dist/elements/basic/Text/index.d.ts +3 -1
  79. package/dist/elements/basic/ThemeToggle/ThemeToggle.d.ts +2 -2
  80. package/dist/elements/basic/ThemeToggle/declaration.d.ts +1 -0
  81. package/dist/elements/basic/ThemeToggle/declaration.mjs +5 -0
  82. package/dist/elements/basic/ThemeToggle/index.d.ts +2 -1
  83. package/dist/elements/declarations/index.d.ts +322 -12
  84. package/dist/elements/declarations/index.mjs +46 -44
  85. package/dist/elements/form/Form/Form.d.ts +8 -2
  86. package/dist/elements/form/Form/Form.mjs +102 -79
  87. package/dist/elements/form/Form/declaration.d.ts +21 -3
  88. package/dist/elements/form/Form/declaration.mjs +28 -11
  89. package/dist/elements/form/Form/index.d.ts +17 -2
  90. package/dist/elements/form/FormControl/FormControl.d.ts +8 -2
  91. package/dist/elements/form/FormControl/FormControl.mjs +71 -66
  92. package/dist/elements/form/FormControl/Settings.d.ts +6 -1
  93. package/dist/elements/form/FormControl/Settings.mjs +130 -98
  94. package/dist/elements/form/FormControl/declaration.d.ts +7 -0
  95. package/dist/elements/form/FormControl/declaration.mjs +21 -1
  96. package/dist/elements/form/FormControl/helpers/useBlurValidation.d.ts +12 -0
  97. package/dist/elements/form/FormControl/helpers/useBlurValidation.mjs +20 -0
  98. package/dist/elements/form/FormControl/helpers/validateField.d.ts +8 -0
  99. package/dist/elements/form/FormControl/helpers/validateField.mjs +8 -2
  100. package/dist/elements/form/FormControl/hocs/withFieldValue.d.ts +4 -0
  101. package/dist/elements/form/FormControl/hocs/withFieldValue.mjs +49 -41
  102. package/dist/elements/form/FormControl/index.d.ts +8 -1
  103. package/dist/elements/form/FormControl/inputs/Checkbox.mjs +2 -2
  104. package/dist/elements/form/FormControl/inputs/Input.d.ts +5 -1
  105. package/dist/elements/form/FormControl/inputs/Input.mjs +42 -38
  106. package/dist/elements/form/FormControl/inputs/Select.d.ts +5 -1
  107. package/dist/elements/form/FormControl/inputs/Select.mjs +33 -28
  108. package/dist/elements/form/FormControl/inputs/Textarea.mjs +27 -26
  109. package/dist/elements/form/FormControl/inputs/useFocusWhenShown.d.ts +1 -1
  110. package/dist/elements/index.d.ts +3 -1
  111. package/dist/elements/index.mjs +32 -30
  112. package/dist/elements/internal/LayoutContainer/LayoutContainer.d.ts +1 -1
  113. package/dist/elements/internal/LayoutContainer/LayoutContainer.mjs +30 -30
  114. package/dist/elements/internal/LayoutContainer/index.d.ts +1 -1
  115. package/dist/elements/internal/LayoutContainer/mask.d.ts +13 -0
  116. package/dist/elements/internal/LayoutContainer/mask.mjs +16 -1
  117. package/dist/elements/internal/Loading/Loading.d.ts +1 -1
  118. package/dist/elements/internal/Loading/index.d.ts +1 -1
  119. package/dist/elements/internal/NotFound/NotFound.d.ts +1 -1
  120. package/dist/elements/internal/NotFound/index.d.ts +1 -1
  121. package/dist/elements/internal/Page/Page.d.ts +17 -3
  122. package/dist/elements/internal/Page/Page.mjs +32 -25
  123. package/dist/elements/internal/Page/PageHead.d.ts +11 -4
  124. package/dist/elements/internal/Page/PageHead.mjs +41 -19
  125. package/dist/elements/internal/Page/PageWithheld.d.ts +3 -2
  126. package/dist/elements/internal/Page/PageWithheld.mjs +41 -18
  127. package/dist/elements/internal/Page/Settings.d.ts +5 -1
  128. package/dist/elements/internal/Page/Settings.mjs +160 -121
  129. package/dist/elements/internal/Page/SharePreview.d.ts +13 -0
  130. package/dist/elements/internal/Page/SharePreview.mjs +53 -0
  131. package/dist/elements/internal/Page/declaration.d.ts +9 -1
  132. package/dist/elements/internal/Page/declaration.mjs +11 -4
  133. package/dist/elements/internal/Page/index.d.ts +9 -2
  134. package/dist/elements/media/Chart/Chart.d.ts +33 -0
  135. package/dist/elements/media/Chart/Chart.mjs +195 -0
  136. package/dist/elements/media/Chart/Settings.d.ts +6 -0
  137. package/dist/elements/media/Chart/Settings.mjs +92 -0
  138. package/dist/elements/media/Chart/chartGeometry.d.ts +37 -0
  139. package/dist/elements/media/Chart/chartGeometry.mjs +47 -0
  140. package/dist/elements/media/Chart/declaration.d.ts +144 -0
  141. package/dist/elements/media/Chart/declaration.mjs +107 -0
  142. package/dist/elements/media/Chart/index.d.ts +145 -0
  143. package/dist/elements/media/Chart/index.mjs +6 -0
  144. package/dist/elements/media/Embed/Embed.d.ts +1 -1
  145. package/dist/elements/media/Embed/Embed.mjs +25 -21
  146. package/dist/elements/media/Embed/declaration.d.ts +1 -0
  147. package/dist/elements/media/Embed/declaration.mjs +1 -0
  148. package/dist/elements/media/Embed/index.d.ts +2 -1
  149. package/dist/elements/media/FontAwesome/FontAwesome.d.ts +1 -1
  150. package/dist/elements/media/FontAwesome/index.d.ts +1 -1
  151. package/dist/elements/media/Image/Image.d.ts +1 -1
  152. package/dist/elements/media/Image/Image.mjs +35 -34
  153. package/dist/elements/media/Image/declaration.d.ts +2 -1
  154. package/dist/elements/media/Image/declaration.mjs +1 -0
  155. package/dist/elements/media/Image/index.d.ts +3 -2
  156. package/dist/elements/media/Svg/Svg.d.ts +1 -1
  157. package/dist/elements/media/Svg/declaration.d.ts +1 -0
  158. package/dist/elements/media/Svg/declaration.mjs +1 -0
  159. package/dist/elements/media/Svg/index.d.ts +2 -1
  160. package/dist/elements/media/Video/Video.d.ts +1 -1
  161. package/dist/elements/media/Video/declaration.d.ts +1 -0
  162. package/dist/elements/media/Video/declaration.mjs +1 -0
  163. package/dist/elements/media/Video/index.d.ts +2 -1
  164. package/dist/elements/provider/ApiContainer/ApiContainer.d.ts +1 -1
  165. package/dist/elements/provider/ApiContainer/ApiContainer.mjs +215 -185
  166. package/dist/elements/provider/ApiContainer/declaration.d.ts +9 -0
  167. package/dist/elements/provider/ApiContainer/declaration.mjs +10 -1
  168. package/dist/elements/provider/ApiContainer/hooks/useInputRefresh.d.ts +4 -4
  169. package/dist/elements/provider/ApiContainer/hooks/useProviderPagination.d.ts +2 -1
  170. package/dist/elements/provider/ApiContainer/index.d.ts +10 -1
  171. package/dist/elements/provider/Channel/Channel.d.ts +1 -1
  172. package/dist/elements/provider/Channel/declaration.d.ts +9 -0
  173. package/dist/elements/provider/Channel/declaration.mjs +11 -2
  174. package/dist/elements/provider/Channel/index.d.ts +10 -1
  175. package/dist/elements/settings.mjs +42 -40
  176. package/dist/elements/structure/Carousel/Carousel.d.ts +1 -1
  177. package/dist/elements/structure/Carousel/Carousel.mjs +147 -130
  178. package/dist/elements/structure/Carousel/CarouselContext.d.ts +3 -3
  179. package/dist/elements/structure/Carousel/CarouselTrack/CarouselTrack.d.ts +1 -1
  180. package/dist/elements/structure/Carousel/CarouselTrack/components/ScrollTrack/ScrollTrack.d.ts +6 -2
  181. package/dist/elements/structure/Carousel/CarouselTrack/components/ScrollTrack/ScrollTrack.mjs +32 -20
  182. package/dist/elements/structure/Carousel/CarouselTrack/index.d.ts +1 -1
  183. package/dist/elements/structure/Carousel/carouselIndex.d.ts +17 -0
  184. package/dist/elements/structure/Carousel/carouselIndex.mjs +17 -5
  185. package/dist/elements/structure/Carousel/declaration.d.ts +49 -2
  186. package/dist/elements/structure/Carousel/declaration.mjs +26 -4
  187. package/dist/elements/structure/Carousel/index.d.ts +51 -4
  188. package/dist/elements/structure/Container/Container.d.ts +5 -3
  189. package/dist/elements/structure/Container/Container.mjs +6 -5
  190. package/dist/elements/structure/Container/Settings.d.ts +4 -2
  191. package/dist/elements/structure/Container/Settings.mjs +19 -5
  192. package/dist/elements/structure/Container/declaration.d.ts +3 -2
  193. package/dist/elements/structure/Container/declaration.mjs +3 -1
  194. package/dist/elements/structure/Container/index.d.ts +4 -3
  195. package/dist/elements/structure/DialogContainer/DialogContainer.d.ts +1 -1
  196. package/dist/elements/structure/DialogContainer/declaration.d.ts +1 -0
  197. package/dist/elements/structure/DialogContainer/declaration.mjs +5 -0
  198. package/dist/elements/structure/DialogContainer/index.d.ts +2 -1
  199. package/dist/elements/structure/List/List.d.ts +1 -1
  200. package/dist/elements/structure/List/ListItem/ListItem.d.ts +1 -1
  201. package/dist/elements/structure/List/ListItem/index.d.ts +1 -1
  202. package/dist/elements/structure/List/declaration.d.ts +5 -0
  203. package/dist/elements/structure/List/declaration.mjs +5 -0
  204. package/dist/elements/structure/List/index.d.ts +7 -2
  205. package/dist/elements/structure/List/modes/ListControlled/ListControlled.mjs +1 -0
  206. package/dist/elements/structure/List/modes/ListControlled/ListControlledItem.d.ts +3 -1
  207. package/dist/elements/structure/List/modes/ListControlled/ListControlledItem.mjs +33 -25
  208. package/dist/elements/structure/ModalContainer/ModalContainer.d.ts +1 -1
  209. package/dist/elements/structure/ModalContainer/declaration.d.ts +2 -0
  210. package/dist/elements/structure/ModalContainer/declaration.mjs +2 -0
  211. package/dist/elements/structure/ModalContainer/index.d.ts +3 -1
  212. package/dist/elements/structure/Pagination/Pagination.d.ts +1 -1
  213. package/dist/elements/structure/Pagination/declaration.d.ts +1 -0
  214. package/dist/elements/structure/Pagination/declaration.mjs +5 -0
  215. package/dist/elements/structure/Pagination/index.d.ts +2 -1
  216. package/dist/elements/structure/TabContainer/TabContainer.d.ts +1 -1
  217. package/dist/elements/structure/TabContainer/TabContainerBody/TabContainerBody.d.ts +1 -1
  218. package/dist/elements/structure/TabContainer/TabContainerBody/index.d.ts +1 -1
  219. package/dist/elements/structure/TabContainer/TabContainerHeader/TabContainerHeader.d.ts +1 -1
  220. package/dist/elements/structure/TabContainer/TabContainerHeader/index.d.ts +1 -1
  221. package/dist/elements/structure/TabContainer/TabContainerItem/TabContainerItem.d.ts +1 -1
  222. package/dist/elements/structure/TabContainer/TabContainerItem/declaration.d.ts +6 -0
  223. package/dist/elements/structure/TabContainer/TabContainerItem/declaration.mjs +6 -0
  224. package/dist/elements/structure/TabContainer/TabContainerItem/index.d.ts +7 -1
  225. package/dist/elements/structure/TabContainer/index.d.ts +10 -4
  226. package/dist/index.d.ts +216 -51
  227. package/dist/index.mjs +39 -37
  228. package/package.json +8 -8
  229. package/dist/elements/provider/ApiContainer/helpers/isEmptyAnswer.d.ts +0 -16
  230. package/dist/elements/provider/ApiContainer/helpers/isEmptyAnswer.mjs +0 -4
@@ -19,56 +19,58 @@ import _ from "./internal/LayoutContainer/index.mjs";
19
19
  import v from "./internal/Loading/index.mjs";
20
20
  import { NotFound as y } from "./internal/NotFound/index.mjs";
21
21
  import b from "./internal/Page/index.mjs";
22
- import x from "./media/Embed/index.mjs";
23
- import S from "./media/FontAwesome/index.mjs";
24
- import C from "./media/Image/index.mjs";
25
- import w from "./media/Svg/index.mjs";
26
- import T from "./media/Video/index.mjs";
27
- import E from "./provider/ApiContainer/index.mjs";
28
- import D from "./provider/Channel/index.mjs";
29
- import O from "./structure/Carousel/index.mjs";
30
- import k from "./structure/Container/index.mjs";
31
- import A from "./structure/DialogContainer/index.mjs";
32
- import j from "./structure/List/index.mjs";
33
- import M from "./structure/ModalContainer/index.mjs";
34
- import N from "./structure/Pagination/index.mjs";
35
- import P from "./structure/TabContainer/index.mjs";
22
+ import x from "./media/Chart/index.mjs";
23
+ import S from "./media/Embed/index.mjs";
24
+ import C from "./media/FontAwesome/index.mjs";
25
+ import w from "./media/Image/index.mjs";
26
+ import T from "./media/Svg/index.mjs";
27
+ import E from "./media/Video/index.mjs";
28
+ import D from "./provider/ApiContainer/index.mjs";
29
+ import O from "./provider/Channel/index.mjs";
30
+ import k from "./structure/Carousel/index.mjs";
31
+ import A from "./structure/Container/index.mjs";
32
+ import j from "./structure/DialogContainer/index.mjs";
33
+ import M from "./structure/List/index.mjs";
34
+ import N from "./structure/ModalContainer/index.mjs";
35
+ import P from "./structure/Pagination/index.mjs";
36
+ import F from "./structure/TabContainer/index.mjs";
36
37
  //#region src/elements/index.ts
37
- var F = /* @__PURE__ */ e({
38
- ApiContainer: () => E,
38
+ var I = /* @__PURE__ */ e({
39
+ ApiContainer: () => D,
39
40
  BlockHtml: () => t,
40
41
  BlockJsx: () => n,
41
42
  Button: () => o,
42
- Carousel: () => O,
43
- Channel: () => D,
44
- Container: () => k,
43
+ Carousel: () => k,
44
+ Channel: () => O,
45
+ Chart: () => x,
46
+ Container: () => A,
45
47
  Custom: () => r,
46
- DialogContainer: () => A,
48
+ DialogContainer: () => j,
47
49
  Dropdown: () => s,
48
- Embed: () => x,
49
- FontAwesome: () => S,
50
+ Embed: () => S,
51
+ FontAwesome: () => C,
50
52
  Form: () => h,
51
53
  FormControl: () => g,
52
54
  Heading: () => c,
53
- Image: () => C,
55
+ Image: () => w,
54
56
  LayoutContainer: () => _,
55
57
  Link: () => l,
56
- List: () => j,
58
+ List: () => M,
57
59
  Loading: () => v,
58
60
  Markdown: () => u,
59
- ModalContainer: () => M,
61
+ ModalContainer: () => N,
60
62
  NodeHtml: () => i,
61
63
  NotFound: () => y,
62
64
  Page: () => b,
63
- Pagination: () => N,
65
+ Pagination: () => P,
64
66
  Paragraph: () => d,
65
67
  Reference: () => a,
66
68
  RichText: () => f,
67
- Svg: () => w,
68
- TabContainer: () => P,
69
+ Svg: () => T,
70
+ TabContainer: () => F,
69
71
  Text: () => p,
70
72
  ThemeToggle: () => m,
71
- Video: () => T
73
+ Video: () => E
72
74
  });
73
75
  //#endregion
74
- export { E as ApiContainer, t as BlockHtml, n as BlockJsx, o as Button, O as Carousel, D as Channel, k as Container, r as Custom, A as DialogContainer, s as Dropdown, x as Embed, S as FontAwesome, h as Form, g as FormControl, c as Heading, C as Image, _ as LayoutContainer, l as Link, j as List, v as Loading, u as Markdown, M as ModalContainer, i as NodeHtml, y as NotFound, b as Page, N as Pagination, d as Paragraph, a as Reference, f as RichText, w as Svg, P as TabContainer, p as Text, m as ThemeToggle, T as Video, F as elements_exports };
76
+ export { D as ApiContainer, t as BlockHtml, n as BlockJsx, o as Button, k as Carousel, O as Channel, x as Chart, A as Container, r as Custom, j as DialogContainer, s as Dropdown, S as Embed, C as FontAwesome, h as Form, g as FormControl, c as Heading, w as Image, _ as LayoutContainer, l as Link, M as List, v as Loading, u as Markdown, N as ModalContainer, i as NodeHtml, y as NotFound, b as Page, P as Pagination, d as Paragraph, a as Reference, f as RichText, T as Svg, F as TabContainer, p as Text, m as ThemeToggle, E as Video, I as elements_exports };
@@ -13,7 +13,7 @@ export type LayoutContainerProps = {
13
13
  };
14
14
  declare const LayoutContainer: ({ ref, className, children, subType }: LayoutContainerProps) => import('react').JSX.Element;
15
15
  declare const _default: {
16
- (props: import('../../..').WithElementProps<LayoutContainerProps>): import('react').JSX.Element;
16
+ (props: import('../../..').WithElementProps<LayoutContainerProps>): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
17
17
  displayName: string;
18
18
  };
19
19
  export default _default;
@@ -1,15 +1,15 @@
1
1
  import e from "../../../Element/hocs/withElement.mjs";
2
2
  import t from "../../../Element/hooks/useElement.mjs";
3
3
  import { RootElement as n } from "../../../Element/RootElement.mjs";
4
- import { boxOf as r, maskFrameOf as i } from "./mask.mjs";
5
- import { useCallback as a, useEffect as o } from "react";
6
- import { usePlitzi as s } from "@plitzi/sdk-shared/hooks";
7
- import { throttle as c } from "@plitzi/plitzi-ui/helpers";
8
- import { jsx as l } from "react/jsx-runtime";
9
- import u from "clsx";
4
+ import { boxOf as r, chromeSides as i, maskFrameOf as a } from "./mask.mjs";
5
+ import { useCallback as o, useEffect as s } from "react";
6
+ import { usePlitzi as c } from "@plitzi/sdk-shared/hooks";
7
+ import { throttle as l } from "@plitzi/plitzi-ui/helpers";
8
+ import { jsx as u } from "react/jsx-runtime";
9
+ import d from "clsx";
10
10
  //#region src/elements/internal/LayoutContainer/LayoutContainer.tsx
11
- var d = ".plitzi-component__layout-container", f = ".plitzi-component--layout-body", p = (e) => [...e.querySelectorAll(f)].find((e) => !e.querySelector(f)) ?? null, m = ({ ref: e, className: f = "", children: m, subType: h = "div" }) => {
12
- let { plitziElementLayout: g } = t(), { settings: { previewMode: _ } } = s(), v = a((e, t) => {
11
+ var f = ".plitzi-component__layout-container", p = ".plitzi-component--layout-body", m = (e) => [...e.querySelectorAll(p)].find((e) => !e.querySelector(p)) ?? null, h = ({ ref: e, className: p = "", children: h, subType: g = "div" }) => {
12
+ let { plitziElementLayout: _ } = t(), { settings: { previewMode: v } } = c(), y = o((e, t) => {
13
13
  if (!e) return;
14
14
  if (!t) {
15
15
  e.style.removeProperty("--child-clip");
@@ -20,44 +20,44 @@ var d = ".plitzi-component__layout-container", f = ".plitzi-component--layout-bo
20
20
  e.style.removeProperty("--child-clip");
21
21
  return;
22
22
  }
23
- let a = i(e), o = a.getBoundingClientRect(), s = a.offsetWidth > 0 ? o.width / a.offsetWidth : 1, c = (n.top - o.top) / s - a.clientTop, l = (n.left - o.left) / s - a.clientLeft, u = l + n.width / s, d = c + n.height / s, f = `
23
+ let o = a(e), s = o.getBoundingClientRect(), c = o.offsetWidth > 0 ? s.width / o.offsetWidth : 1, l = (n.top - s.top) / c - o.clientTop, u = (n.left - s.left) / c - o.clientLeft, d = i(e, t, n), f = d.above ? `${String(l)}px` : "0", p = d.left ? `${String(u)}px` : "0", m = d.right ? `${String(u + n.width / c)}px` : "100%", h = d.below ? `${String(l + n.height / c)}px` : "100%", g = `
24
24
  polygon(
25
25
  evenodd,
26
26
  /* outer rect */
27
27
  0 0, 100% 0, 100% 100%, 0% 100%, 0 0,
28
- /* inner rect */
29
- ${l}px ${c}px, ${u}px ${c}px, ${u}px ${d}px, ${l}px ${d}px, ${l}px ${c}px
28
+ /* inner rect */
29
+ ${p} ${f}, ${m} ${f}, ${m} ${h}, ${p} ${h}, ${p} ${f}
30
30
  )`;
31
- e.style.setProperty("--child-clip", f);
31
+ e.style.setProperty("--child-clip", g);
32
32
  }, []);
33
- return o(() => {
33
+ return s(() => {
34
34
  let t = e?.current;
35
- if (!g || !t || _ || t.parentElement?.closest(d)) return;
36
- let n = null, r = c(() => {
37
- let e = p(t);
38
- e !== n && (n && a.unobserve(n), e && a.observe(e), n = e), v(t, e);
39
- }, 50), a = new ResizeObserver(r);
40
- a.observe(t);
41
- let o = i(t);
42
- o !== t && a.observe(o);
35
+ if (!_ || !t || v || t.parentElement?.closest(f)) return;
36
+ let n = null, r = l(() => {
37
+ let e = m(t);
38
+ e !== n && (n && i.unobserve(n), e && i.observe(e), n = e), y(t, e);
39
+ }, 50), i = new ResizeObserver(r);
40
+ i.observe(t);
41
+ let o = a(t);
42
+ o !== t && i.observe(o);
43
43
  let s = new MutationObserver(r);
44
44
  return s.observe(t, {
45
45
  childList: !0,
46
46
  subtree: !0
47
47
  }), t.addEventListener("scroll", r, !0), r(), () => {
48
- r.cancel(), a.disconnect(), s.disconnect(), t.removeEventListener("scroll", r, !0);
48
+ r.cancel(), i.disconnect(), s.disconnect(), t.removeEventListener("scroll", r, !0);
49
49
  };
50
50
  }, [
51
- g,
52
51
  _,
52
+ v,
53
53
  e,
54
- v
55
- ]), /* @__PURE__ */ l(n, {
54
+ y
55
+ ]), /* @__PURE__ */ u(n, {
56
56
  ref: e,
57
- tag: h,
58
- className: u("plitzi-component__layout-container", f),
59
- children: m
57
+ tag: g,
58
+ className: d("plitzi-component__layout-container", p),
59
+ children: h
60
60
  });
61
- }, h = e(m);
61
+ }, g = e(h);
62
62
  //#endregion
63
- export { m as LayoutContainer, h as default };
63
+ export { h as LayoutContainer, g as default };
@@ -1,5 +1,5 @@
1
1
  declare const LayoutContainer: {
2
- (props: import('../../..').WithElementProps<import('./LayoutContainer').LayoutContainerProps>): import('react').JSX.Element;
2
+ (props: import('../../..').WithElementProps<import('./LayoutContainer').LayoutContainerProps>): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
3
3
  displayName: string;
4
4
  } & {
5
5
  readonly type: "layoutContainer";
@@ -9,3 +9,16 @@ export declare const boxOf: (element: Element) => DOMRect | undefined;
9
9
  * box — or, when the layout draws none, the nearest ancestor that positions what it holds.
10
10
  */
11
11
  export declare const maskFrameOf: (layout: HTMLElement) => HTMLElement;
12
+ /** Which sides of its page a shell draws something on — a header above, a footer below, a sidebar beside. */
13
+ export type ChromeSides = {
14
+ above: boolean;
15
+ below: boolean;
16
+ left: boolean;
17
+ right: boolean;
18
+ };
19
+ /**
20
+ * Where the shell draws something around its page — or only leaves room the page's own background fills: the empty end
21
+ * of a shell as tall as the screen, the gutters beside a centred page. Masked, that room read as a grey slab around
22
+ * every page; only what the shell draws is chrome.
23
+ */
24
+ export declare const chromeSides: (layout: HTMLElement, body: Element, page: DOMRect) => ChromeSides;
@@ -9,6 +9,21 @@ var e = (e) => getComputedStyle(e).display === "contents", t = (n) => {
9
9
  if (!e(t)) return t;
10
10
  for (let e = t.parentElement; e; e = e.parentElement) if (getComputedStyle(e).position !== "static") return e;
11
11
  return t.ownerDocument.documentElement;
12
+ }, r = (e, t, n) => {
13
+ let r = {
14
+ above: !1,
15
+ below: !1,
16
+ left: !1,
17
+ right: !1
18
+ };
19
+ for (let i of e.querySelectorAll("[data-plitzi-el]")) {
20
+ if (i.contains(t) || t.contains(i)) continue;
21
+ let e = i.getBoundingClientRect();
22
+ if (e.width <= 0 || e.height <= 0) continue;
23
+ let a = e.top < n.bottom - 1 && e.bottom > n.top + 1;
24
+ r.above ||= e.top < n.top - 1 && !a, r.below ||= e.bottom > n.bottom + 1 && !a, r.left ||= a && e.left < n.left - 1, r.right ||= a && e.right > n.right + 1;
25
+ }
26
+ return r;
12
27
  };
13
28
  //#endregion
14
- export { t as boxOf, n as maskFrameOf };
29
+ export { t as boxOf, r as chromeSides, n as maskFrameOf };
@@ -5,7 +5,7 @@ export type LoadingProps = {
5
5
  };
6
6
  declare const Loading: ({ ref, className }: LoadingProps) => import('react').JSX.Element;
7
7
  declare const _default: {
8
- (props: import('../../..').WithElementProps<LoadingProps>): import('react').JSX.Element;
8
+ (props: import('../../..').WithElementProps<LoadingProps>): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
9
9
  displayName: string;
10
10
  };
11
11
  export default _default;
@@ -1,5 +1,5 @@
1
1
  declare const Loading: {
2
- (props: import('../../..').WithElementProps<import('./Loading').LoadingProps>): import('react').JSX.Element;
2
+ (props: import('../../..').WithElementProps<import('./Loading').LoadingProps>): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
3
3
  displayName: string;
4
4
  } & {
5
5
  readonly type: "loading";
@@ -5,7 +5,7 @@ export type NotFoundProps = {
5
5
  };
6
6
  declare const NotFound: ({ ref, className }: NotFoundProps) => import('react').JSX.Element | undefined;
7
7
  declare const _default: {
8
- (props: import('../../..').WithElementProps<NotFoundProps>): import('react').JSX.Element;
8
+ (props: import('../../..').WithElementProps<NotFoundProps>): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
9
9
  displayName: string;
10
10
  };
11
11
  export default _default;
@@ -1,5 +1,5 @@
1
1
  declare const NotFound: {
2
- (props: import('../../..').WithElementProps<import('./NotFound').NotFoundProps>): import('react').JSX.Element;
2
+ (props: import('../../..').WithElementProps<import('./NotFound').NotFoundProps>): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
3
3
  displayName: string;
4
4
  } & {
5
5
  readonly type: "notFound";
@@ -1,11 +1,25 @@
1
1
  import { DocumentScroll } from './declaration';
2
- import { PageAccess, PageWithheld as WithheldReason } from '@plitzi/sdk-shared/schema';
2
+ import { OgType, PageAccess, PageWithheld as WithheldReason } from '@plitzi/sdk-shared/schema';
3
3
  import { ReactNode, RefObject } from 'react';
4
4
  export type PageProps = {
5
5
  ref?: RefObject<HTMLElement>;
6
6
  seoEnabled?: boolean;
7
7
  seoPageTitle?: string;
8
8
  seoPageDescription?: string;
9
+ /** For search engines: `noindex`, `noindex, nofollow`. */
10
+ seoRobots?: string;
11
+ /** The page's JSON-LD, each object as it is written into the head. */
12
+ seoStructuredData?: Record<string, unknown>[];
13
+ /**
14
+ * The picture a link to the page shows — a chat's preview card, a post (`og:image`): a file of the site (`/og.png`)
15
+ * or an address, about 1200×630. A template over the page's server providers too: a room's page shows its cover.
16
+ * Left out, the space's `shareImage`.
17
+ */
18
+ seoImage?: string;
19
+ /** What the picture shows, for whoever cannot see it (`og:image:alt`). */
20
+ seoImageAlt?: string;
21
+ /** What the page is, in Open Graph's words: `website` (the default), `article`, `profile`, `music.playlist`… */
22
+ seoType?: OgType;
9
23
  /**
10
24
  * A template over the page's server providers and `navigation` that says this address shows nothing — a record that
11
25
  * is not there: the page server sends it with status 404, rendered as written. Read there only (`serverTemplates`).
@@ -36,9 +50,9 @@ export type PageProps = {
36
50
  layoutContainer?: string;
37
51
  children?: ReactNode;
38
52
  };
39
- declare const Page: ({ ref, seoEnabled, seoPageTitle, seoPageDescription, documentScroll, withheld, className, layout, layoutContainer, children }: PageProps) => import('react').JSX.Element;
53
+ declare const Page: ({ ref, seoEnabled, seoPageTitle, seoPageDescription, seoRobots, seoStructuredData, seoImage, seoImageAlt, seoType, documentScroll, withheld, className, layout, layoutContainer, children }: PageProps) => import('react').JSX.Element;
40
54
  declare const _default: {
41
- (props: import('../../..').WithElementProps<PageProps>): import('react').JSX.Element;
55
+ (props: import('../../..').WithElementProps<PageProps>): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
42
56
  displayName: string;
43
57
  };
44
58
  export default _default;
@@ -13,61 +13,68 @@ import { useRenderSettings as p, useSdkStore as m } from "@plitzi/sdk-shared/sto
13
13
  import { jsx as h, jsxs as g } from "react/jsx-runtime";
14
14
  import _ from "clsx";
15
15
  import { InteractionsContext as v } from "@plitzi/sdk-interactions";
16
+ import { AuthContext as y } from "@plitzi/sdk-auth";
16
17
  //#region src/elements/internal/Page/Page.tsx
17
- var y = {
18
+ var b = {
18
19
  locked: "html,body{height:100%;overflow:hidden;overscroll-behavior:none}",
19
20
  noBounce: "html,body{overscroll-behavior:none}"
20
- }, b = (e) => e.map((e) => ({
21
+ }, x = (e) => e.map((e) => ({
21
22
  ...e,
22
23
  plitziElementLayout: {
23
24
  slots: [e.slot],
24
25
  rootId: e.slot,
25
26
  type: "layout"
26
27
  }
27
- })), x = (t, n, r) => t.reduce((t, { layout: r, slot: i, plitziElementLayout: o }) => /* @__PURE__ */ h(e, {
28
+ })), S = (t, n, r) => t.reduce((t, { layout: r, slot: i, plitziElementLayout: o }) => /* @__PURE__ */ h(e, {
28
29
  bodies: { [i]: t },
29
30
  children: /* @__PURE__ */ h(a, { internalProps: {
30
31
  id: r,
31
32
  rootId: n,
32
33
  plitziElementLayout: o
33
34
  } })
34
- }, i), r), S = ({ ref: e, seoEnabled: n = !1, seoPageTitle: a = "Title", seoPageDescription: S = "Description", documentScroll: C = "", withheld: w, className: T = "", layout: E = "", layoutContainer: D = "", children: O }) => {
35
- let { id: k } = r(), { settings: { previewMode: A } } = f(), { interactionsManager: j } = l(v), { ownsHead: M, renderMode: N } = p(), P = M && N !== "widget", [[F, I]] = m(["navigation.routeParams", "navigation.queryParams"]), L = o(E, D), R = d(() => b(L), [L]), z = d(() => x(R, k, w ? /* @__PURE__ */ h(c, { reason: w }) : O), [
36
- R,
37
- k,
38
- O,
39
- w
35
+ }, i), r), C = ({ ref: e, seoEnabled: n = !1, seoPageTitle: a = "Title", seoPageDescription: C = "Description", seoRobots: w, seoStructuredData: T, seoImage: E, seoImageAlt: D, seoType: O, documentScroll: k = "", withheld: A, className: j = "", layout: M = "", layoutContainer: N = "", children: P }) => {
36
+ let { id: F } = r(), { settings: { previewMode: I } } = f(), { interactionsManager: L } = l(v), { ownsHead: R, renderMode: z } = p(), B = R && z !== "widget", [[V, H]] = m(["navigation.routeParams", "navigation.queryParams"]), { authenticated: U, user: W } = l(y), G = U ? `${String(W?.details?.id ?? "")}:${W?.details?.username ?? ""}` : "", K = o(M, N), q = d(() => x(K), [K]), J = d(() => S(q, F, A ? /* @__PURE__ */ h(c, { reason: A }) : P), [
37
+ q,
38
+ F,
39
+ P,
40
+ A
40
41
  ]);
41
42
  return u(() => {
42
43
  let e = !1;
43
44
  return queueMicrotask(() => {
44
- e || j.interactionTrigger(k, "onPageLoad", {
45
- pageId: k,
46
- routeParams: F,
47
- queryParams: I
45
+ e || L.interactionTrigger(F, "onPageLoad", {
46
+ pageId: F,
47
+ routeParams: V,
48
+ queryParams: H
48
49
  });
49
50
  }), () => {
50
51
  e = !0;
51
52
  };
52
53
  }, [
53
- k,
54
- j,
55
- I,
56
- F
54
+ F,
55
+ L,
56
+ H,
57
+ V,
58
+ G
57
59
  ]), /* @__PURE__ */ g(i, {
58
60
  ref: e,
59
- className: _("plitzi-component__page", T),
61
+ className: _("plitzi-component__page", j),
60
62
  interactionTriggers: t.triggers,
61
63
  children: [
62
- n && A && M && /* @__PURE__ */ h(s, {
63
- pageId: k,
64
+ n && I && R && /* @__PURE__ */ h(s, {
65
+ pageId: F,
64
66
  title: a,
65
- description: S
67
+ description: C,
68
+ ...w ? { robots: w } : {},
69
+ ...T ? { structuredData: T } : {},
70
+ ...E ? { image: E } : {},
71
+ ...D ? { imageAlt: D } : {},
72
+ ...O ? { type: O } : {}
66
73
  }),
67
- C && P && /* @__PURE__ */ h("style", { children: y[C] }),
68
- z
74
+ k && B && /* @__PURE__ */ h("style", { children: b[k] }),
75
+ J
69
76
  ]
70
77
  });
71
- }, C = n(S);
78
+ }, w = n(C);
72
79
  //#endregion
73
- export { S as Page, C as default };
80
+ export { C as Page, w as default };
@@ -1,12 +1,19 @@
1
+ import { OgType } from '@plitzi/sdk-shared/schema';
1
2
  export type PageHeadProps = {
2
3
  pageId: string;
3
4
  title?: string;
4
5
  description?: string;
6
+ robots?: string;
7
+ structuredData?: Record<string, unknown>[];
8
+ image?: string;
9
+ imageAlt?: string;
10
+ type?: OgType;
5
11
  };
6
12
  /**
7
- * The page's title and description in the head: its words, or its templates read against the answers of its server
8
- * providers — `rsc.data`, what the server wrote the HTML's head from, and what a navigation fetches before it lands —
9
- * so the tab says the record a detail page shows, on arrival and after every move.
13
+ * The page's head: its title, its JSON-LD and every tag `pageHeadTags` says of it — description, robots, Open Graph and
14
+ * card with its picture, its address, the space's icon, colour and language — its words, or its templates read against
15
+ * the answers of its server providers — `rsc.data`, what the server wrote the HTML's head from, and what a navigation
16
+ * fetches before it lands — so the tab says the record a detail page shows, on arrival and after every move.
10
17
  */
11
- declare const PageHead: ({ pageId, title, description }: PageHeadProps) => import('react').JSX.Element;
18
+ declare const PageHead: ({ pageId, title, description, robots, structuredData, image, imageAlt, type }: PageHeadProps) => import('react').JSX.Element;
12
19
  export default PageHead;
@@ -1,29 +1,51 @@
1
1
  import { useMemo as e } from "react";
2
2
  import { useCommonStore as t } from "@plitzi/sdk-shared/store";
3
3
  import { isRecord as n } from "@plitzi/sdk-shared/helpers";
4
- import { collectServerElements as r, pageSeoText as i, pageServerContext as a } from "@plitzi/sdk-shared/schema";
5
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
- import { Helmet as c } from "@dr.pogodin/react-helmet";
4
+ import { collectServerElements as r, jsonForScript as i, pageHeadTags as a, pageSeoText as o, pageServerContext as s, pageStructuredData as c, spaceIdentity as l } from "@plitzi/sdk-shared/schema";
5
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
6
+ import { Helmet as f } from "@dr.pogodin/react-helmet";
7
7
  //#region src/elements/internal/Page/PageHead.tsx
8
- var l = ({ pageId: l, title: u, description: d }) => {
9
- let [[f, p, m, h]] = t([
8
+ var p = () => typeof window > "u" ? "" : `${window.location.origin}${window.location.pathname}`, m = ({ pageId: m, title: h, description: g, robots: _, structuredData: v, image: y, imageAlt: b, type: x }) => {
9
+ let [[S, C, w, T, E]] = t([
10
10
  "schema.flat",
11
11
  "rsc.data",
12
12
  "navigation.routeParams",
13
- "navigation.queryParams"
14
- ]), g = e(() => n(f) ? r({ flat: f }, l) : [], [f, l]), _ = e(() => a(g, p ?? {}, {
15
- routeParams: m,
16
- queryParams: h
13
+ "navigation.queryParams",
14
+ "schema.settings"
15
+ ]), D = e(() => n(S) ? r({ flat: S }, m) : [], [S, m]), O = e(() => s(D, C ?? {}, {
16
+ routeParams: w,
17
+ queryParams: T
17
18
  }), [
18
- g,
19
- p,
20
- m,
21
- h
22
- ]), v = i(u, _), y = i(d, _);
23
- return /* @__PURE__ */ s(c, { children: [!!v && /* @__PURE__ */ o("title", { children: v }), !!y && /* @__PURE__ */ o("meta", {
24
- name: "description",
25
- content: y
26
- })] });
19
+ D,
20
+ C,
21
+ w,
22
+ T
23
+ ]), k = o(h, O), A = o(g, O), j = e(() => c(v, O), [v, O]), M = o(y, O), N = o(b, O), P = a({
24
+ ...k ? { title: k } : {},
25
+ ...A ? { description: A } : {},
26
+ ..._ ? { robots: _ } : {},
27
+ ...M ? { image: M } : {},
28
+ ...M && N ? { imageAlt: N } : {},
29
+ ...x ? { type: x } : {}
30
+ }, l(E), p());
31
+ return /* @__PURE__ */ d(f, { children: [
32
+ P.lang && /* @__PURE__ */ u("html", { lang: P.lang }),
33
+ !!k && /* @__PURE__ */ u("title", { children: k }),
34
+ P.meta.map((e) => /* @__PURE__ */ u("meta", {
35
+ ...e.attribute === "name" ? { name: e.key } : { property: e.key },
36
+ content: e.content,
37
+ ...e.media ? { media: e.media } : {}
38
+ }, `${e.key}${e.media ?? ""}`)),
39
+ P.links.map((e) => /* @__PURE__ */ u("link", {
40
+ rel: e.rel,
41
+ href: e.href,
42
+ ...e.type ? { type: e.type } : {}
43
+ }, e.rel)),
44
+ j.map((e, t) => /* @__PURE__ */ u("script", {
45
+ type: "application/ld+json",
46
+ children: i(e)
47
+ }, t))
48
+ ] });
27
49
  };
28
50
  //#endregion
29
- export { l as default };
51
+ export { m as default };
@@ -3,8 +3,9 @@ export type PageWithheldProps = {
3
3
  reason: Reason;
4
4
  };
5
5
  /**
6
- * What a page the server withheld from this visitor shows instead of its content — which was never sent: why, in a
7
- * sentence, inside the page's own layout so the site around it still works. The server answers it with 401 or 403.
6
+ * What a page the server withheld from this visitor shows instead of its content — which was never sent — inside the
7
+ * page's own layout so the site around it still works; the server answers it with 401 or 403. The page the space names
8
+ * for it (`settings.withheldPage`), or else why, in a sentence.
8
9
  */
9
10
  declare const PageWithheld: ({ reason }: PageWithheldProps) => import('react').JSX.Element;
10
11
  export default PageWithheld;
@@ -1,6 +1,10 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
1
+ import e from "../../../Element/hooks/useInternalItems.mjs";
2
+ import { usePlitzi as t } from "@plitzi/sdk-shared/hooks";
3
+ import { useCommonStore as n } from "@plitzi/sdk-shared/store";
4
+ import { withheldPageOf as r } from "@plitzi/sdk-shared/schema";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
2
6
  //#region src/elements/internal/Page/PageWithheld.tsx
3
- var n = {
7
+ var o = {
4
8
  unauthenticated: {
5
9
  title: "Sign in to see this page",
6
10
  text: "This page is for people who are signed in and have access to it."
@@ -9,7 +13,7 @@ var n = {
9
13
  title: "This page is not available to you",
10
14
  text: "It is for people with access you do not have. If you think you should, ask whoever runs this site."
11
15
  }
12
- }, r = {
16
+ }, s = {
13
17
  display: "flex",
14
18
  flexDirection: "column",
15
19
  gap: "8px",
@@ -18,26 +22,45 @@ var n = {
18
22
  padding: "0 16px",
19
23
  textAlign: "center",
20
24
  color: "var(--foreground, inherit)"
21
- }, i = {
25
+ }, c = {
22
26
  margin: 0,
23
27
  fontSize: "24px",
24
28
  lineHeight: 1.25
25
- }, a = {
29
+ }, l = {
26
30
  margin: 0,
27
31
  color: "var(--muted, inherit)",
28
32
  fontSize: "16px",
29
33
  lineHeight: 1.55
30
- }, o = ({ reason: o }) => /* @__PURE__ */ t("section", {
31
- className: "plitzi-component__page-withheld",
32
- style: r,
33
- "data-withheld": o,
34
- children: [/* @__PURE__ */ e("h1", {
35
- style: i,
36
- children: n[o].title
37
- }), /* @__PURE__ */ e("p", {
38
- style: a,
39
- children: n[o].text
40
- })]
41
- });
34
+ }, u = ({ page: t, previewMode: n }) => e({
35
+ id: t.id,
36
+ definition: t.definition,
37
+ children: void 0,
38
+ previewMode: n
39
+ }), d = ({ reason: e }) => {
40
+ let [[d, f, p]] = n([
41
+ "schema.flat",
42
+ "schema.pages",
43
+ "schema.settings"
44
+ ]), { settings: { previewMode: m } } = t(), h = r({
45
+ flat: d,
46
+ pages: f,
47
+ settings: p
48
+ });
49
+ return h === void 0 ? /* @__PURE__ */ a("section", {
50
+ className: "plitzi-component__page-withheld",
51
+ style: s,
52
+ "data-withheld": e,
53
+ children: [/* @__PURE__ */ i("h1", {
54
+ style: c,
55
+ children: o[e].title
56
+ }), /* @__PURE__ */ i("p", {
57
+ style: l,
58
+ children: o[e].text
59
+ })]
60
+ }) : /* @__PURE__ */ i(u, {
61
+ page: d[h],
62
+ previewMode: m
63
+ });
64
+ };
42
65
  //#endregion
43
- export { o as default };
66
+ export { d as default };
@@ -8,6 +8,10 @@ type SettingsProps = {
8
8
  folder?: string;
9
9
  seoPageTitle?: string;
10
10
  seoPageDescription?: string;
11
+ seoRobots?: string;
12
+ seoImage?: string;
13
+ seoImageAlt?: string;
14
+ seoType?: string;
11
15
  slug?: string;
12
16
  layout?: string;
13
17
  layoutContainer?: string;
@@ -18,5 +22,5 @@ type SettingsProps = {
18
22
  access?: PageAccess | '';
19
23
  onUpdate?: (key: string, value: string | boolean | number | PageAccess) => void;
20
24
  };
21
- declare const Settings: ({ id, seoEnabled, enabled, name, folder, seoPageTitle, seoPageDescription, slug, layout, layoutContainer, accessLevel, unauthorizedBehaviour, unauthorizedPageRedirect, documentScroll, access, onUpdate }: SettingsProps) => import('react').JSX.Element;
25
+ declare const Settings: ({ id, seoEnabled, enabled, name, folder, seoPageTitle, seoPageDescription, seoRobots, seoImage, seoImageAlt, seoType, slug, layout, layoutContainer, accessLevel, unauthorizedBehaviour, unauthorizedPageRedirect, documentScroll, access, onUpdate }: SettingsProps) => import('react').JSX.Element;
22
26
  export default Settings;