@plitzi/sdk-elements 0.37.1 → 0.37.3

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 (261) hide show
  1. package/CHANGELOG.md +1306 -0
  2. package/dist/Component/ComponentProvider.d.ts +1 -1
  3. package/dist/Component/ComponentProvider.mjs +10 -5
  4. package/dist/Element/JsxManager.d.ts +1 -1
  5. package/dist/Element/JsxManager.mjs +1 -0
  6. package/dist/Element/LayoutBody.d.ts +1 -1
  7. package/dist/Element/PluginManager.d.ts +1 -1
  8. package/dist/Element/PluginRemote.d.ts +3 -1
  9. package/dist/Element/PluginRemote.mjs +9 -9
  10. package/dist/Element/ReplicaProvider.d.ts +1 -1
  11. package/dist/Element/helpers/elementConstants.mjs +28 -0
  12. package/dist/Element/helpers/elementUtils.mjs +1 -1
  13. package/dist/Element/helpers/loadComponent.d.ts +6 -1
  14. package/dist/Element/helpers/loadComponent.mjs +7 -7
  15. package/dist/Element/helpers/pluginSelector.d.ts +1 -1
  16. package/dist/Element/helpers/pluginSelector.mjs +1 -0
  17. package/dist/Element/hocs/withElement.d.ts +1 -1
  18. package/dist/Element/hooks/useElementDataSource.mjs +23 -16
  19. package/dist/Element/hooks/useElementInternal.mjs +60 -52
  20. package/dist/Element/hooks/useInternalClassName.mjs +19 -18
  21. package/dist/Element/hooks/useKeyTriggers.d.ts +18 -0
  22. package/dist/Element/hooks/useKeyTriggers.mjs +36 -0
  23. package/dist/Element/hooks/useRootElementInteractions.mjs +70 -55
  24. package/dist/Element/hooks/useRscData.mjs +20 -15
  25. package/dist/components/ElementAdvancedEditor.d.ts +1 -1
  26. package/dist/dataSource/GlobalSources.mjs +115 -79
  27. package/dist/dataSource/getSourcesByElementId.mjs +2 -2
  28. package/dist/elements/advanced/BlockHtml/BlockHtml.d.ts +2 -2
  29. package/dist/elements/advanced/BlockHtml/Settings.d.ts +1 -1
  30. package/dist/elements/advanced/BlockHtml/index.d.ts +1 -1
  31. package/dist/elements/advanced/BlockJsx/BlockJsx.d.ts +2 -2
  32. package/dist/elements/advanced/BlockJsx/BlockJsx.mjs +1 -1
  33. package/dist/elements/advanced/BlockJsx/Settings.d.ts +1 -1
  34. package/dist/elements/advanced/BlockJsx/index.d.ts +1 -1
  35. package/dist/elements/advanced/Custom/Custom.d.ts +2 -2
  36. package/dist/elements/advanced/Custom/Settings.d.ts +1 -1
  37. package/dist/elements/advanced/Custom/index.d.ts +1 -1
  38. package/dist/elements/advanced/NodeHtml/declaration.d.ts +1 -1
  39. package/dist/elements/advanced/NodeHtml/index.d.ts +2 -2
  40. package/dist/elements/advanced/PlitziSdk/Settings.d.ts +1 -1
  41. package/dist/elements/advanced/Reference/Reference.d.ts +2 -2
  42. package/dist/elements/advanced/Reference/Settings.d.ts +1 -1
  43. package/dist/elements/advanced/Reference/index.d.ts +1 -1
  44. package/dist/elements/basic/Button/Button.d.ts +11 -4
  45. package/dist/elements/basic/Button/Button.mjs +5 -5
  46. package/dist/elements/basic/Button/Settings.d.ts +2 -1
  47. package/dist/elements/basic/Button/Settings.mjs +14 -7
  48. package/dist/elements/basic/Button/declaration.d.ts +8 -3
  49. package/dist/elements/basic/Button/declaration.mjs +14 -6
  50. package/dist/elements/basic/Button/index.d.ts +9 -4
  51. package/dist/elements/basic/Dropdown/Dropdown.d.ts +2 -2
  52. package/dist/elements/basic/Dropdown/Dropdown.mjs +48 -39
  53. package/dist/elements/basic/Dropdown/DropdownPopup/DropdownPopup.d.ts +2 -2
  54. package/dist/elements/basic/Dropdown/DropdownPopup/Settings.d.ts +1 -1
  55. package/dist/elements/basic/Dropdown/DropdownPopup/declaration.d.ts +2 -1
  56. package/dist/elements/basic/Dropdown/DropdownPopup/declaration.mjs +2 -1
  57. package/dist/elements/basic/Dropdown/DropdownPopup/index.d.ts +3 -2
  58. package/dist/elements/basic/Dropdown/Settings.d.ts +1 -1
  59. package/dist/elements/basic/Dropdown/declaration.d.ts +3 -0
  60. package/dist/elements/basic/Dropdown/declaration.mjs +9 -3
  61. package/dist/elements/basic/Dropdown/index.d.ts +7 -3
  62. package/dist/elements/basic/Dropdown/useDropdown.d.ts +6 -1
  63. package/dist/elements/basic/Dropdown/useDropdown.mjs +58 -41
  64. package/dist/elements/basic/Dropdown/useDropdownTrigger.d.ts +26 -0
  65. package/dist/elements/basic/Dropdown/useDropdownTrigger.mjs +30 -0
  66. package/dist/elements/basic/Heading/Heading.d.ts +2 -2
  67. package/dist/elements/basic/Heading/Settings.d.ts +1 -1
  68. package/dist/elements/basic/Heading/declaration.d.ts +9 -6
  69. package/dist/elements/basic/Heading/declaration.mjs +17 -9
  70. package/dist/elements/basic/Heading/index.d.ts +10 -7
  71. package/dist/elements/basic/Link/Link.d.ts +2 -2
  72. package/dist/elements/basic/Link/Link.mjs +5 -2
  73. package/dist/elements/basic/Link/Settings.d.ts +2 -1
  74. package/dist/elements/basic/Link/Settings.mjs +31 -24
  75. package/dist/elements/basic/Link/declaration.d.ts +5 -1
  76. package/dist/elements/basic/Link/declaration.mjs +16 -3
  77. package/dist/elements/basic/Link/index.d.ts +6 -2
  78. package/dist/elements/basic/Markdown/Markdown.d.ts +2 -2
  79. package/dist/elements/basic/Markdown/Settings.d.ts +1 -1
  80. package/dist/elements/basic/Markdown/declaration.d.ts +1 -1
  81. package/dist/elements/basic/Markdown/declaration.mjs +1 -1
  82. package/dist/elements/basic/Markdown/index.d.ts +2 -2
  83. package/dist/elements/basic/Paragraph/Paragraph.d.ts +2 -2
  84. package/dist/elements/basic/Paragraph/Settings.d.ts +1 -1
  85. package/dist/elements/basic/Paragraph/index.d.ts +1 -1
  86. package/dist/elements/basic/RichText/RichText.d.ts +2 -2
  87. package/dist/elements/basic/RichText/Settings.d.ts +1 -1
  88. package/dist/elements/basic/RichText/declaration.d.ts +3 -0
  89. package/dist/elements/basic/RichText/declaration.mjs +8 -3
  90. package/dist/elements/basic/RichText/index.d.ts +4 -1
  91. package/dist/elements/basic/Text/Settings.d.ts +1 -1
  92. package/dist/elements/basic/Text/Text.d.ts +2 -2
  93. package/dist/elements/basic/Text/declaration.d.ts +1 -1
  94. package/dist/elements/basic/Text/declaration.mjs +1 -1
  95. package/dist/elements/basic/Text/index.d.ts +2 -2
  96. package/dist/elements/basic/ThemeToggle/ThemeToggle.d.ts +2 -2
  97. package/dist/elements/basic/ThemeToggle/ThemeToggle.mjs +58 -62
  98. package/dist/elements/basic/ThemeToggle/declaration.d.ts +15 -1
  99. package/dist/elements/basic/ThemeToggle/declaration.mjs +12 -4
  100. package/dist/elements/basic/ThemeToggle/index.d.ts +16 -2
  101. package/dist/elements/declarations/index.d.ts +530 -21
  102. package/dist/elements/declarations/index.mjs +24 -22
  103. package/dist/elements/form/Form/Form.d.ts +2 -2
  104. package/dist/elements/form/Form/Form.mjs +37 -57
  105. package/dist/elements/form/Form/Settings.d.ts +1 -1
  106. package/dist/elements/form/Form/declaration.d.ts +60 -0
  107. package/dist/elements/form/Form/declaration.mjs +59 -3
  108. package/dist/elements/form/Form/index.d.ts +62 -2
  109. package/dist/elements/form/FormControl/FormControl.d.ts +19 -7
  110. package/dist/elements/form/FormControl/FormControl.mjs +138 -138
  111. package/dist/elements/form/FormControl/Settings.d.ts +3 -1
  112. package/dist/elements/form/FormControl/Settings.mjs +73 -57
  113. package/dist/elements/form/FormControl/components/Label.d.ts +3 -1
  114. package/dist/elements/form/FormControl/components/Label.mjs +20 -18
  115. package/dist/elements/form/FormControl/components/visuallyHidden.d.ts +6 -0
  116. package/dist/elements/form/FormControl/components/visuallyHidden.mjs +14 -0
  117. package/dist/elements/form/FormControl/declaration.d.ts +17 -0
  118. package/dist/elements/form/FormControl/declaration.mjs +56 -30
  119. package/dist/elements/form/FormControl/hocs/withFieldValue.d.ts +1 -1
  120. package/dist/elements/form/FormControl/hocs/withFieldValue.mjs +68 -61
  121. package/dist/elements/form/FormControl/index.d.ts +19 -2
  122. package/dist/elements/form/FormControl/inputs/Checkbox.d.ts +6 -1
  123. package/dist/elements/form/FormControl/inputs/Checkbox.mjs +5 -3
  124. package/dist/elements/form/FormControl/inputs/Hidden.d.ts +1 -1
  125. package/dist/elements/form/FormControl/inputs/Input.d.ts +8 -1
  126. package/dist/elements/form/FormControl/inputs/Input.mjs +44 -38
  127. package/dist/elements/form/FormControl/inputs/Select.d.ts +6 -1
  128. package/dist/elements/form/FormControl/inputs/Select.mjs +12 -10
  129. package/dist/elements/form/FormControl/inputs/Textarea.d.ts +8 -1
  130. package/dist/elements/form/FormControl/inputs/Textarea.mjs +26 -21
  131. package/dist/elements/form/FormControl/inputs/useFocusWhenShown.d.ts +7 -0
  132. package/dist/elements/form/FormControl/inputs/useFocusWhenShown.mjs +9 -0
  133. package/dist/elements/index.d.ts +3 -1
  134. package/dist/elements/index.mjs +16 -14
  135. package/dist/elements/internal/LayoutContainer/LayoutContainer.d.ts +2 -2
  136. package/dist/elements/internal/LayoutContainer/Settings.d.ts +1 -1
  137. package/dist/elements/internal/LayoutContainer/declaration.d.ts +3 -0
  138. package/dist/elements/internal/LayoutContainer/declaration.mjs +15 -3
  139. package/dist/elements/internal/LayoutContainer/index.d.ts +4 -1
  140. package/dist/elements/internal/LayoutPicker/LayoutPicker.d.ts +1 -1
  141. package/dist/elements/internal/Loading/Loading.d.ts +2 -2
  142. package/dist/elements/internal/Loading/index.d.ts +1 -1
  143. package/dist/elements/internal/NotFound/NotFound.d.ts +2 -2
  144. package/dist/elements/internal/NotFound/index.d.ts +1 -1
  145. package/dist/elements/internal/Page/Page.d.ts +2 -2
  146. package/dist/elements/internal/Page/Page.mjs +34 -43
  147. package/dist/elements/internal/Page/Settings.d.ts +1 -1
  148. package/dist/elements/internal/Page/declaration.d.ts +13 -0
  149. package/dist/elements/internal/Page/declaration.mjs +11 -0
  150. package/dist/elements/internal/Page/index.d.ts +14 -1
  151. package/dist/elements/media/FontAwesome/FontAwesome.d.ts +9 -2
  152. package/dist/elements/media/FontAwesome/FontAwesome.mjs +12 -5
  153. package/dist/elements/media/FontAwesome/Settings.d.ts +2 -1
  154. package/dist/elements/media/FontAwesome/Settings.mjs +29 -22
  155. package/dist/elements/media/FontAwesome/declaration.d.ts +1 -0
  156. package/dist/elements/media/FontAwesome/index.d.ts +2 -1
  157. package/dist/elements/media/Image/Image.d.ts +14 -3
  158. package/dist/elements/media/Image/Image.mjs +25 -25
  159. package/dist/elements/media/Image/Settings.d.ts +3 -1
  160. package/dist/elements/media/Image/Settings.mjs +29 -15
  161. package/dist/elements/media/Image/declaration.d.ts +7 -1
  162. package/dist/elements/media/Image/declaration.mjs +16 -3
  163. package/dist/elements/media/Image/index.d.ts +8 -2
  164. package/dist/elements/media/Video/Settings.d.ts +1 -1
  165. package/dist/elements/media/Video/Video.d.ts +2 -2
  166. package/dist/elements/media/Video/index.d.ts +1 -1
  167. package/dist/elements/provider/ApiContainer/ApiContainer.d.ts +11 -2
  168. package/dist/elements/provider/ApiContainer/ApiContainer.mjs +164 -198
  169. package/dist/elements/provider/ApiContainer/Settings.d.ts +2 -1
  170. package/dist/elements/provider/ApiContainer/Settings.mjs +129 -122
  171. package/dist/elements/provider/ApiContainer/components/FiltersInput/FiltersInput.d.ts +1 -1
  172. package/dist/elements/provider/ApiContainer/declaration.d.ts +88 -0
  173. package/dist/elements/provider/ApiContainer/declaration.mjs +112 -4
  174. package/dist/elements/provider/ApiContainer/helpers/isEmptyAnswer.d.ts +16 -0
  175. package/dist/elements/provider/ApiContainer/helpers/isEmptyAnswer.mjs +4 -0
  176. package/dist/elements/provider/ApiContainer/helpers/providerOutcome.d.ts +25 -0
  177. package/dist/elements/provider/ApiContainer/helpers/providerOutcome.mjs +7 -0
  178. package/dist/elements/provider/ApiContainer/helpers/queryInput.d.ts +5 -0
  179. package/dist/elements/provider/ApiContainer/helpers/queryInput.mjs +12 -0
  180. package/dist/elements/provider/ApiContainer/hooks/useAutoRefresh.d.ts +21 -0
  181. package/dist/elements/provider/ApiContainer/hooks/useAutoRefresh.mjs +18 -0
  182. package/dist/elements/provider/ApiContainer/index.d.ts +89 -1
  183. package/dist/elements/provider/Channel/Channel.d.ts +26 -0
  184. package/dist/elements/provider/Channel/Channel.mjs +92 -0
  185. package/dist/elements/provider/Channel/Settings.d.ts +9 -0
  186. package/dist/elements/provider/Channel/Settings.mjs +38 -0
  187. package/dist/elements/provider/Channel/declaration.d.ts +138 -0
  188. package/dist/elements/provider/Channel/declaration.mjs +125 -0
  189. package/dist/elements/provider/Channel/index.d.ts +137 -0
  190. package/dist/elements/provider/Channel/index.mjs +6 -0
  191. package/dist/elements/settings.mjs +25 -23
  192. package/dist/elements/structure/Container/Container.d.ts +17 -3
  193. package/dist/elements/structure/Container/Container.mjs +18 -9
  194. package/dist/elements/structure/Container/Settings.d.ts +4 -2
  195. package/dist/elements/structure/Container/Settings.mjs +110 -69
  196. package/dist/elements/structure/Container/declaration.d.ts +12 -1
  197. package/dist/elements/structure/Container/declaration.mjs +35 -3
  198. package/dist/elements/structure/Container/index.d.ts +7 -2
  199. package/dist/elements/structure/Container/index.mjs +3 -3
  200. package/dist/elements/structure/DialogContainer/DialogContainer.d.ts +2 -2
  201. package/dist/elements/structure/DialogContainer/DialogContainer.mjs +126 -153
  202. package/dist/elements/structure/DialogContainer/Settings.d.ts +1 -1
  203. package/dist/elements/structure/DialogContainer/declaration.d.ts +82 -1
  204. package/dist/elements/structure/DialogContainer/declaration.mjs +62 -1
  205. package/dist/elements/structure/DialogContainer/index.d.ts +83 -2
  206. package/dist/elements/structure/List/List.d.ts +2 -2
  207. package/dist/elements/structure/List/ListItem/ListItem.d.ts +2 -2
  208. package/dist/elements/structure/List/ListItem/Settings.d.ts +1 -1
  209. package/dist/elements/structure/List/ListItem/index.d.ts +1 -1
  210. package/dist/elements/structure/List/Settings.d.ts +1 -1
  211. package/dist/elements/structure/List/declaration.d.ts +4 -0
  212. package/dist/elements/structure/List/declaration.mjs +7 -3
  213. package/dist/elements/structure/List/index.d.ts +6 -2
  214. package/dist/elements/structure/List/modes/ListBasic.d.ts +1 -1
  215. package/dist/elements/structure/List/modes/ListControlled/ListControlled.d.ts +1 -1
  216. package/dist/elements/structure/List/modes/ListControlled/ListControlledItem.d.ts +1 -1
  217. package/dist/elements/structure/ModalContainer/ModalContainer.d.ts +2 -2
  218. package/dist/elements/structure/ModalContainer/ModalContainer.mjs +92 -107
  219. package/dist/elements/structure/ModalContainer/Settings.d.ts +1 -1
  220. package/dist/elements/structure/ModalContainer/declaration.d.ts +48 -2
  221. package/dist/elements/structure/ModalContainer/declaration.mjs +40 -2
  222. package/dist/elements/structure/ModalContainer/index.d.ts +49 -3
  223. package/dist/elements/structure/ModalContainer/metadataFromText.d.ts +1 -0
  224. package/dist/elements/structure/ModalContainer/metadataFromText.mjs +10 -0
  225. package/dist/elements/structure/ModalContainer/useModalDialog.d.ts +20 -0
  226. package/dist/elements/structure/ModalContainer/useModalDialog.mjs +31 -0
  227. package/dist/elements/structure/Pagination/Pagination.d.ts +7 -2
  228. package/dist/elements/structure/Pagination/Pagination.mjs +49 -52
  229. package/dist/elements/structure/Pagination/Settings.d.ts +2 -1
  230. package/dist/elements/structure/Pagination/Settings.mjs +16 -9
  231. package/dist/elements/structure/Pagination/declaration.d.ts +16 -0
  232. package/dist/elements/structure/Pagination/declaration.mjs +14 -3
  233. package/dist/elements/structure/Pagination/index.d.ts +17 -1
  234. package/dist/elements/structure/TabContainer/Settings.d.ts +1 -1
  235. package/dist/elements/structure/TabContainer/TabContainer.d.ts +2 -2
  236. package/dist/elements/structure/TabContainer/TabContainer.mjs +19 -17
  237. package/dist/elements/structure/TabContainer/TabContainerBody/Settings.d.ts +1 -1
  238. package/dist/elements/structure/TabContainer/TabContainerBody/TabContainerBody.d.ts +2 -2
  239. package/dist/elements/structure/TabContainer/TabContainerBody/TabContainerBody.mjs +8 -6
  240. package/dist/elements/structure/TabContainer/TabContainerBody/declaration.d.ts +1 -0
  241. package/dist/elements/structure/TabContainer/TabContainerBody/declaration.mjs +1 -0
  242. package/dist/elements/structure/TabContainer/TabContainerBody/index.d.ts +2 -1
  243. package/dist/elements/structure/TabContainer/TabContainerContext.d.ts +2 -0
  244. package/dist/elements/structure/TabContainer/TabContainerHeader/Settings.d.ts +1 -1
  245. package/dist/elements/structure/TabContainer/TabContainerHeader/TabContainerHeader.d.ts +2 -2
  246. package/dist/elements/structure/TabContainer/TabContainerHeader/TabContainerHeader.mjs +18 -14
  247. package/dist/elements/structure/TabContainer/TabContainerHeader/declaration.d.ts +1 -0
  248. package/dist/elements/structure/TabContainer/TabContainerHeader/declaration.mjs +1 -0
  249. package/dist/elements/structure/TabContainer/TabContainerHeader/index.d.ts +2 -1
  250. package/dist/elements/structure/TabContainer/TabContainerItem/Settings.d.ts +1 -1
  251. package/dist/elements/structure/TabContainer/TabContainerItem/TabContainerItem.d.ts +6 -2
  252. package/dist/elements/structure/TabContainer/TabContainerItem/TabContainerItem.mjs +48 -13
  253. package/dist/elements/structure/TabContainer/TabContainerItem/declaration.d.ts +1 -1
  254. package/dist/elements/structure/TabContainer/TabContainerItem/index.d.ts +1 -1
  255. package/dist/elements/structure/TabContainer/index.d.ts +6 -4
  256. package/dist/index.d.ts +570 -57
  257. package/dist/index.mjs +20 -17
  258. package/dist/realtime/useChannel.d.ts +35 -0
  259. package/dist/realtime/useChannel.mjs +57 -0
  260. package/package.json +75 -11
  261. package/dist/elements/media/FontAwesome/FontAwesome.stories-paused.d.ts +0 -1
@@ -1,8 +1,116 @@
1
- import { elementDeclaration as e } from "@plitzi/sdk-shared/authoring/declare";
1
+ import { elementDeclaration as e, valuesOf as t } from "@plitzi/sdk-shared/authoring/declare";
2
2
  //#region src/elements/provider/ApiContainer/declaration.ts
3
- var t = e()({
3
+ var n = e()({
4
4
  type: "apiContainer",
5
+ attributeValues: {
6
+ subType: t()([
7
+ "",
8
+ "div",
9
+ "header",
10
+ "footer",
11
+ "nav",
12
+ "main",
13
+ "section",
14
+ "article",
15
+ "aside",
16
+ "address",
17
+ "figure"
18
+ ]),
19
+ method: t()([
20
+ "get",
21
+ "post",
22
+ "put",
23
+ "delete",
24
+ "patch"
25
+ ]),
26
+ credentials: t()([
27
+ "include",
28
+ "omit",
29
+ "same-origin"
30
+ ]),
31
+ pagination: t()([
32
+ "none",
33
+ "url",
34
+ "append"
35
+ ])
36
+ },
5
37
  sourceType: "apiContainer",
38
+ triggers: {
39
+ onApiError: {
40
+ action: "onApiError",
41
+ title: "On Api Error",
42
+ type: "trigger",
43
+ params: {},
44
+ preview: {
45
+ url: "",
46
+ method: "",
47
+ status: "",
48
+ data: ""
49
+ }
50
+ },
51
+ onApiSuccess: {
52
+ action: "onApiSuccess",
53
+ title: "On Api Success",
54
+ type: "trigger",
55
+ params: {},
56
+ preview: {
57
+ url: "",
58
+ method: "",
59
+ status: "",
60
+ data: ""
61
+ }
62
+ }
63
+ },
64
+ callbacks: {
65
+ performQuery: {
66
+ action: "performQuery",
67
+ title: "Perform Query",
68
+ type: "callback",
69
+ preview: {},
70
+ params: { input: {
71
+ label: "Input (server providers)",
72
+ type: "codemirror-json",
73
+ defaultValue: "{}",
74
+ description: "Values handed to a server-driven provider with its request, beside the page’s own route and query params — a search, a filter. Kept for the pages it loads after (`loadMore`, `goToPage`) until the next query."
75
+ } }
76
+ },
77
+ loadMore: {
78
+ action: "loadMore",
79
+ title: "Load More",
80
+ type: "callback",
81
+ preview: {},
82
+ params: {}
83
+ },
84
+ goToPage: {
85
+ action: "goToPage",
86
+ title: "Go To Page",
87
+ type: "callback",
88
+ preview: {},
89
+ params: { page: {
90
+ label: "Page",
91
+ defaultValue: "1",
92
+ type: "text"
93
+ } }
94
+ },
95
+ writeRecord: {
96
+ action: "writeRecord",
97
+ title: "Write Record",
98
+ type: "callback",
99
+ preview: { action: "create" },
100
+ params: {
101
+ action: {
102
+ label: "Endpoint",
103
+ defaultValue: "create",
104
+ type: "text"
105
+ },
106
+ recordId: {
107
+ label: "Record Id",
108
+ defaultValue: "",
109
+ type: "text"
110
+ }
111
+ }
112
+ }
113
+ },
6
114
  content: {
7
115
  attributes: {
8
116
  query: "",
@@ -26,7 +134,7 @@ var t = e()({
26
134
  definition: {
27
135
  label: "Api Container",
28
136
  type: "apiContainer",
29
- description: "Fetches data from a backend HTTP API (its `query`/`method`/`credentials`) and exposes the response as a data source ITS DESCENDANTS bind to (source `apiContainer_<id>.data`; only elements inside it can consume it). This is how you get backend data into the frontend. Its `mockData` prop is builder-only sample data — the published runtime fetches the real `query`, so always set a real query for production. With `cache: true` a browser request is kept for `staleTime` seconds (default 30) and shared with every provider asking the same thing; it is off unless set. A flow refreshes it with `performQuery` or the global `invalidateQueries` step. Its `subType` (container tag) is empty by default, and then it renders NO element of its own: its children lay out directly in its parent, and any class, variant or style binding on it applies to nothing. To style the provider itself give it a tag (`subType: \"div\"`, `section`, …); otherwise style its parent or a child.",
137
+ description: "Fetches data from a backend HTTP API (its `query`/`method`/`credentials`) and exposes the response as a data source ITS DESCENDANTS bind to (source `apiContainer_<id>.data`; only elements inside it can consume it). This is how you get backend data into the frontend. Its `mockData` prop is builder-only sample data — the published runtime fetches the real `query`, so always set a real query for production. With `cache: true` a browser request is kept for `staleTime` seconds (default 30) and shared with every provider asking the same thing; it is off unless set. A flow refreshes it with `performQuery` or the global `invalidateQueries` step, and `refreshSeconds` makes it ask again on its own every N seconds (either runtime; paused while the tab is hidden) — the way to keep a queue, feed or status board current without a plugin. Its `subType` (container tag) is empty by default, and then it renders NO element of its own: its children lay out directly in its parent, and any class, variant or style binding on it applies to nothing. To style the provider itself give it a tag (`subType: \"div\"`, `section`, …); otherwise style its parent or a child.",
30
138
  items: [],
31
139
  bindings: {},
32
140
  styleSelectors: { base: "" },
@@ -60,4 +168,4 @@ var t = e()({
60
168
  }
61
169
  });
62
170
  //#endregion
63
- export { t as default };
171
+ export { n as default };
@@ -0,0 +1,16 @@
1
+ type ProviderSlice = {
2
+ records?: unknown[];
3
+ record?: unknown;
4
+ data?: unknown;
5
+ };
6
+ /**
7
+ * Whether a provider has nothing to show, for each shape of answer it can hold.
8
+ *
9
+ * A connector list publishes `records`, a detail provider `record`, and a plain `query` the body it received under
10
+ * `data`. Only the first two used to be asked, so a `query` — whose slice has no `records` at all — reported empty
11
+ * whatever it held, and an empty state bound to `isEmpty` showed over a full page.
12
+ *
13
+ * `records` is the list after pagination has accumulated it, which is why it is passed in rather than read here.
14
+ */
15
+ export declare const isEmptyAnswer: (slice: ProviderSlice, records: unknown[], singleRecord: boolean) => boolean;
16
+ export {};
@@ -0,0 +1,4 @@
1
+ //#region src/elements/provider/ApiContainer/helpers/isEmptyAnswer.ts
2
+ var e = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || typeof e == "object" && !Array.isArray(e) && Object.keys(e).length === 0, t = (t, n, r) => r ? t.record === void 0 : Array.isArray(t.records) ? n.length === 0 : e(t.data);
3
+ //#endregion
4
+ export { t as isEmptyAnswer };
@@ -0,0 +1,25 @@
1
+ export type ProviderOutcome = 'success' | 'error' | undefined;
2
+ export type ProviderOutcomeParams = {
3
+ serverMode: boolean;
4
+ /** Browser provider: what its request answered. */
5
+ isSuccess: boolean;
6
+ isError: boolean;
7
+ /** Server provider: a payload has arrived, and it is for the page the visitor is on. */
8
+ rscResolved: boolean;
9
+ rscPending: boolean;
10
+ /** Server provider: this element's slice of that payload — `null` when the server could not resolve it. */
11
+ elementData: unknown;
12
+ };
13
+ /**
14
+ * Which of `onApiSuccess` / `onApiError` a provider has earned, or neither yet.
15
+ *
16
+ * The same question for both runtimes, answered from what each one has. A browser provider has its request's
17
+ * status. A server provider has no request of its own — its data arrives in the page's RSC payload — so success is
18
+ * its slice being there and error is the payload arriving WITHOUT it. Asked only of the browser request, a server
19
+ * provider never fired either trigger, and a flow its author wired to them never ran.
20
+ *
21
+ * A payload resolved for another page is neither: the visitor navigated and this provider's answer is still on its
22
+ * way.
23
+ */
24
+ declare const providerOutcome: ({ serverMode, isSuccess, isError, rscResolved, rscPending, elementData }: ProviderOutcomeParams) => ProviderOutcome;
25
+ export default providerOutcome;
@@ -0,0 +1,7 @@
1
+ //#region src/elements/provider/ApiContainer/helpers/providerOutcome.ts
2
+ var e = ({ serverMode: e, isSuccess: t, isError: n, rscResolved: r, rscPending: i, elementData: a }) => {
3
+ if (!e) return t ? "success" : n ? "error" : void 0;
4
+ if (r && !i) return a == null ? "error" : "success";
5
+ };
6
+ //#endregion
7
+ export { e as default };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * A query's `input`, as the server reads a page's query params: flat, each value a string. An object as authored, or
3
+ * its JSON text as the editor keeps it; anything else is no input at all.
4
+ */
5
+ export declare const queryInputOf: (input: unknown) => Record<string, string> | undefined;
@@ -0,0 +1,12 @@
1
+ //#region src/elements/provider/ApiContainer/helpers/queryInput.ts
2
+ var e = (e) => {
3
+ let t = e;
4
+ if (typeof t == "string") try {
5
+ t = JSON.parse(t || "{}");
6
+ } catch {
7
+ return;
8
+ }
9
+ if (typeof t == "object" && t && !Array.isArray(t)) return Object.fromEntries(Object.entries(t).flatMap(([e, t]) => typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? [[e, String(t)]] : []));
10
+ };
11
+ //#endregion
12
+ export { e as queryInputOf };
@@ -0,0 +1,21 @@
1
+ export type UseAutoRefreshParams = {
2
+ /** Seconds between refreshes. Zero, a negative number or anything that is not a number turns it off. */
3
+ seconds: number | string;
4
+ /** Whether there is anything to refresh at all — a provider that cannot fetch must not be asked to. */
5
+ enabled: boolean;
6
+ refresh: () => unknown;
7
+ };
8
+ /**
9
+ * Asks a provider for its data again every `seconds`, for a page that shows something still moving.
10
+ *
11
+ * Three things a bare `setInterval` gets wrong, each of them a load the page's server pays for:
12
+ *
13
+ * - **A hidden tab does not ask.** Nobody is looking, and a dashboard left open in a background tab overnight is
14
+ * otherwise thousands of requests answering no one.
15
+ * - **One at a time.** A refresh that outlives the interval is not joined by a second one — on a slow server that
16
+ * is how a poll turns into a pile-up.
17
+ * - **The newest `refresh`, without restarting the clock.** The callback is read through a ref, so a re-render that
18
+ * hands over a new function does not reset the countdown to the full interval each time.
19
+ */
20
+ declare const useAutoRefresh: ({ seconds, enabled, refresh }: UseAutoRefreshParams) => void;
21
+ export default useAutoRefresh;
@@ -0,0 +1,18 @@
1
+ import { useEffect as e, useRef as t } from "react";
2
+ //#region src/elements/provider/ApiContainer/hooks/useAutoRefresh.ts
3
+ var n = ({ seconds: n, enabled: r, refresh: i }) => {
4
+ let a = t(i);
5
+ a.current = i;
6
+ let o = Number(n), s = r && Number.isFinite(o) && o > 0;
7
+ e(() => {
8
+ if (!s) return;
9
+ let e = !1, t = setInterval(() => {
10
+ e || document.visibilityState === "hidden" || (e = !0, Promise.resolve().then(() => a.current()).catch(() => void 0).finally(() => {
11
+ e = !1;
12
+ }));
13
+ }, o * 1e3);
14
+ return () => clearInterval(t);
15
+ }, [s, o]);
16
+ };
17
+ //#endregion
18
+ export { n as default };
@@ -1,9 +1,97 @@
1
1
  declare const ApiContainer: {
2
- (props: import('../../../Element/hocs/withElement').WithElementProps<import('./ApiContainer').ApiContainerProps>): import("react").JSX.Element;
2
+ (props: import('../../../Element/hocs/withElement').WithElementProps<import('./ApiContainer').ApiContainerProps>): import('react').JSX.Element;
3
3
  displayName: string;
4
4
  } & {
5
5
  readonly type: "apiContainer";
6
+ readonly attributeValues: {
7
+ readonly subType: readonly string[];
8
+ readonly method: readonly string[];
9
+ readonly credentials: readonly string[];
10
+ readonly pagination: readonly string[];
11
+ };
6
12
  readonly sourceType: "apiContainer";
13
+ readonly triggers: {
14
+ readonly onApiError: {
15
+ readonly action: "onApiError";
16
+ readonly title: "On Api Error";
17
+ readonly type: "trigger";
18
+ readonly params: {};
19
+ readonly preview: {
20
+ readonly url: "";
21
+ readonly method: "";
22
+ readonly status: "";
23
+ readonly data: "";
24
+ };
25
+ };
26
+ readonly onApiSuccess: {
27
+ readonly action: "onApiSuccess";
28
+ readonly title: "On Api Success";
29
+ readonly type: "trigger";
30
+ readonly params: {};
31
+ readonly preview: {
32
+ readonly url: "";
33
+ readonly method: "";
34
+ readonly status: "";
35
+ readonly data: "";
36
+ };
37
+ };
38
+ };
39
+ readonly callbacks: {
40
+ readonly performQuery: {
41
+ readonly action: "performQuery";
42
+ readonly title: "Perform Query";
43
+ readonly type: "callback";
44
+ readonly preview: {};
45
+ readonly params: {
46
+ readonly input: {
47
+ readonly label: "Input (server providers)";
48
+ readonly type: "codemirror-json";
49
+ readonly defaultValue: "{}";
50
+ readonly description: string;
51
+ };
52
+ };
53
+ };
54
+ readonly loadMore: {
55
+ readonly action: "loadMore";
56
+ readonly title: "Load More";
57
+ readonly type: "callback";
58
+ readonly preview: {};
59
+ readonly params: {};
60
+ };
61
+ readonly goToPage: {
62
+ readonly action: "goToPage";
63
+ readonly title: "Go To Page";
64
+ readonly type: "callback";
65
+ readonly preview: {};
66
+ readonly params: {
67
+ readonly page: {
68
+ readonly label: "Page";
69
+ readonly defaultValue: "1";
70
+ readonly type: "text";
71
+ };
72
+ };
73
+ };
74
+ readonly writeRecord: {
75
+ readonly action: "writeRecord";
76
+ readonly title: "Write Record";
77
+ readonly type: "callback";
78
+ readonly preview: {
79
+ readonly action: "create";
80
+ };
81
+ readonly params: {
82
+ readonly action: {
83
+ readonly label: "Endpoint";
84
+ readonly defaultValue: "create";
85
+ readonly type: "text";
86
+ };
87
+ readonly recordId: {
88
+ readonly label: "Record Id";
89
+ readonly defaultValue: "";
90
+ readonly type: "text";
91
+ };
92
+ };
93
+ };
94
+ };
7
95
  readonly content: {
8
96
  readonly attributes: {
9
97
  readonly query: "";
@@ -0,0 +1,26 @@
1
+ import { ReactNode, RefObject } from 'react';
2
+ export type ChannelProps = {
3
+ ref?: RefObject<HTMLElement | null>;
4
+ className?: string;
5
+ children?: ReactNode;
6
+ /** The topic, usually a template: `board:{{ id }}`. A channel the space declares must cover it. */
7
+ topic?: string;
8
+ /**
9
+ * What opens a topic of a private (`grant: true`) channel: bound to the `grant` the action that let this visitor in
10
+ * returned — `{{ data.grant }}`. Empty for any other channel.
11
+ */
12
+ grant?: string;
13
+ /** What this page announces to the members — an object from a binding, or JSON text typed in the builder. */
14
+ presence?: unknown;
15
+ /** How many of the latest messages its source holds. */
16
+ keep?: number | string;
17
+ /** Empty renders no element of its own, as a provider does; a tag gives it one to style. */
18
+ subType?: '' | 'div' | 'section' | 'aside' | 'main';
19
+ };
20
+ declare const Channel: ({ ref, className, children, topic, grant, presence, keep, subType }: ChannelProps) => import('react').JSX.Element;
21
+ declare const _default: {
22
+ (props: import('../../../Element/hocs/withElement').WithElementProps<ChannelProps>): import('react').JSX.Element;
23
+ displayName: string;
24
+ };
25
+ export default _default;
26
+ export { Channel };
@@ -0,0 +1,92 @@
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 r from "../../../dataSource/pathFields.mjs";
5
+ import i from "./declaration.mjs";
6
+ import a from "../../../realtime/useChannel.mjs";
7
+ import { use as o, useCallback as s, useMemo as c, useState as l } from "react";
8
+ import u from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
9
+ import { StoreProvider as d } from "@plitzi/nexus/react";
10
+ import { emptyObject as f } from "@plitzi/sdk-shared/helpers/utils";
11
+ import { jsx as p } from "react/jsx-runtime";
12
+ import m from "clsx";
13
+ import h from "@plitzi/sdk-shared/dataSource/helpers/getSourceName";
14
+ import g from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
15
+ import { JOIN_TYPE as _, LEAVE_TYPE as v, PRESENCE_TYPE as y } from "@plitzi/sdk-shared/realtime";
16
+ //#region src/elements/provider/Channel/Channel.tsx
17
+ var b = (e) => {
18
+ if (typeof e != "string") return e;
19
+ try {
20
+ return JSON.parse(e);
21
+ } catch {
22
+ return e;
23
+ }
24
+ }, x = /* @__PURE__ */ new Set([
25
+ y,
26
+ _,
27
+ v
28
+ ]), S = ({ ref: e, className: _, children: v, topic: y = "", grant: S = "", presence: C, keep: w = 20, subType: T = "" }) => {
29
+ let { id: E, definition: { label: D = "Channel" } } = t(), { settings: { previewMode: O }, contexts: { InteractionsContext: k } } = u(), { interactionsManager: A } = o(k), j = Math.max(0, Number(w) || 0), [M, N] = l([]), P = s((e) => {
30
+ x.has(e.type) || (j > 0 && N((t) => [...t, e].slice(-j)), A.interactionTrigger(E, "onMessage", { ...e }));
31
+ }, [
32
+ E,
33
+ A,
34
+ j
35
+ ]), F = s(({ from: e, user: t, state: n }) => void A.interactionTrigger(E, "onJoin", {
36
+ from: e,
37
+ user: t ?? "",
38
+ state: n
39
+ }), [E, A]), I = s(({ from: e, user: t, state: n }) => void A.interactionTrigger(E, "onLeave", {
40
+ from: e,
41
+ user: t ?? "",
42
+ state: n
43
+ }), [E, A]), L = a(O && y ? y : void 0, {
44
+ grant: S || void 0,
45
+ presence: C === void 0 || C === "" ? void 0 : b(C),
46
+ onMessage: P,
47
+ onJoin: F,
48
+ onLeave: I
49
+ }), R = c(() => ({
50
+ publish: {
51
+ ...i.callbacks.publish,
52
+ callback: ({ type: e, data: t }) => typeof e == "string" && e ? L.publish(e, b(t)) : Promise.resolve(!1)
53
+ },
54
+ setPresence: {
55
+ ...i.callbacks.setPresence,
56
+ callback: ({ data: e }) => L.setPresence(b(e))
57
+ }
58
+ }), [L]), z = h(i.sourceType, E), B = c(() => ({
59
+ connected: L.connected,
60
+ me: L.me ?? "",
61
+ members: L.members,
62
+ messages: M,
63
+ last: M.at(-1) ?? null
64
+ }), [
65
+ L.connected,
66
+ L.me,
67
+ L.members,
68
+ M
69
+ ]), V = s(() => r(B), [B]);
70
+ g({
71
+ id: E,
72
+ source: z,
73
+ name: D || `Channel - ${E}`,
74
+ fields: V
75
+ });
76
+ let H = c(() => z ? { runtime: { sources: { [z]: B } } } : f, [B, z]);
77
+ return /* @__PURE__ */ p(n, {
78
+ ref: e,
79
+ tag: T,
80
+ className: m("plitzi-component__channel", _),
81
+ interactionTriggers: i.triggers,
82
+ interactionCallbacks: R,
83
+ children: /* @__PURE__ */ p(d, {
84
+ inherit: "live",
85
+ name: `Channel:${E}`,
86
+ value: H,
87
+ children: v
88
+ })
89
+ });
90
+ }, C = e(S);
91
+ //#endregion
92
+ export { S as Channel, C as default };
@@ -0,0 +1,9 @@
1
+ type SettingsProps = {
2
+ topic?: string;
3
+ grant?: string;
4
+ keep?: number | string;
5
+ presence?: unknown;
6
+ onUpdate?: (key: string, value: string | boolean | number) => void;
7
+ };
8
+ declare const Settings: ({ topic, grant, keep, presence, onUpdate }: SettingsProps) => import('react').JSX.Element;
9
+ export default Settings;
@@ -0,0 +1,38 @@
1
+ import { useCallback as e } from "react";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import r from "@plitzi/plitzi-ui/Input";
4
+ import i from "@plitzi/plitzi-ui/TextArea";
5
+ //#region src/elements/provider/Channel/Settings.tsx
6
+ var a = (e) => typeof e == "string" ? e : e === void 0 ? "" : JSON.stringify(e, null, 2), o = ({ topic: o = "", grant: s = "", keep: c = 20, presence: l, onUpdate: u }) => {
7
+ let d = e((e) => u?.("topic", e), [u]), f = e((e) => u?.("grant", e), [u]), p = e((e) => u?.("keep", Number(e) || 0), [u]), m = e((e) => u?.("presence", e), [u]);
8
+ return /* @__PURE__ */ n("div", {
9
+ className: "flex h-full flex-col gap-4 py-2",
10
+ children: [
11
+ /* @__PURE__ */ t(r, {
12
+ value: o,
13
+ label: "Topic (e.g. board:{{ id }})",
14
+ onChange: d,
15
+ size: "sm"
16
+ }),
17
+ /* @__PURE__ */ t(r, {
18
+ value: s,
19
+ label: "Grant (private channels: the grant the action returned)",
20
+ onChange: f,
21
+ size: "sm"
22
+ }),
23
+ /* @__PURE__ */ t(r, {
24
+ value: String(c),
25
+ label: "Messages kept",
26
+ onChange: p,
27
+ size: "sm"
28
+ }),
29
+ /* @__PURE__ */ t(i, {
30
+ value: a(l),
31
+ label: "Presence (JSON)",
32
+ onChange: m
33
+ })
34
+ ]
35
+ });
36
+ };
37
+ //#endregion
38
+ export { o as default };
@@ -0,0 +1,138 @@
1
+ import { ChannelProps } from './Channel';
2
+ import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring/declare';
3
+ /** What this element can be authored with — its component's own props, minus what the runtime supplies. */
4
+ export type ChannelAttributes = AuthorableAttributes<ChannelProps>;
5
+ declare const declaration: {
6
+ readonly type: "channel";
7
+ readonly attributeValues: {
8
+ readonly subType: readonly string[];
9
+ };
10
+ readonly sourceType: "channel";
11
+ readonly triggers: {
12
+ readonly onMessage: {
13
+ readonly action: "onMessage";
14
+ readonly title: "On Message";
15
+ readonly type: "trigger";
16
+ readonly params: {};
17
+ readonly preview: {
18
+ readonly type: "";
19
+ readonly data: "";
20
+ readonly from: "";
21
+ readonly user: "";
22
+ readonly at: "";
23
+ };
24
+ };
25
+ readonly onJoin: {
26
+ readonly action: "onJoin";
27
+ readonly title: "On Join";
28
+ readonly type: "trigger";
29
+ readonly params: {};
30
+ readonly preview: {
31
+ readonly from: "";
32
+ readonly user: "";
33
+ readonly state: {};
34
+ };
35
+ };
36
+ readonly onLeave: {
37
+ readonly action: "onLeave";
38
+ readonly title: "On Leave";
39
+ readonly type: "trigger";
40
+ readonly params: {};
41
+ readonly preview: {
42
+ readonly from: "";
43
+ readonly user: "";
44
+ readonly state: {};
45
+ };
46
+ };
47
+ };
48
+ readonly callbacks: {
49
+ readonly publish: {
50
+ readonly action: "publish";
51
+ readonly title: "Publish";
52
+ readonly type: "callback";
53
+ readonly preview: {};
54
+ readonly params: {
55
+ readonly type: {
56
+ readonly label: "Type";
57
+ readonly defaultValue: "";
58
+ readonly type: "text";
59
+ };
60
+ readonly data: {
61
+ readonly label: "Data (JSON or a template)";
62
+ readonly defaultValue: "";
63
+ readonly type: "text";
64
+ };
65
+ };
66
+ };
67
+ readonly setPresence: {
68
+ readonly action: "setPresence";
69
+ readonly title: "Set Presence";
70
+ readonly type: "callback";
71
+ readonly preview: {};
72
+ readonly params: {
73
+ readonly data: {
74
+ readonly label: "State (JSON or a template)";
75
+ readonly defaultValue: "";
76
+ readonly type: "text";
77
+ };
78
+ };
79
+ };
80
+ };
81
+ readonly content: {
82
+ readonly attributes: {
83
+ readonly topic: "";
84
+ readonly grant: "";
85
+ readonly keep: 20;
86
+ readonly subType: "";
87
+ };
88
+ readonly definition: {
89
+ readonly label: "Channel";
90
+ readonly type: "channel";
91
+ readonly description: string;
92
+ readonly items: readonly [];
93
+ readonly bindings: {};
94
+ readonly styleSelectors: {
95
+ readonly base: "";
96
+ };
97
+ readonly initialState: {
98
+ readonly visibility: true;
99
+ };
100
+ };
101
+ readonly builder: {
102
+ readonly canDelete: true;
103
+ readonly canSelect: true;
104
+ readonly canDragDrop: true;
105
+ readonly canMove: true;
106
+ readonly canTemplate: true;
107
+ readonly itemsAllowed: readonly [];
108
+ readonly itemsNotAllowed: readonly [];
109
+ };
110
+ readonly market: {
111
+ readonly category: "provider";
112
+ readonly owner: "Plitzi";
113
+ readonly verified: true;
114
+ readonly license: "MIT";
115
+ readonly website: "https://plitzi.com";
116
+ readonly backgroundColor: "#4422ee";
117
+ readonly icon: "fa-solid fa-tower-broadcast";
118
+ };
119
+ readonly defaultStyle: {
120
+ readonly name: "Channel";
121
+ readonly displayMode: "desktop";
122
+ readonly style: {
123
+ readonly base: {
124
+ readonly default: {};
125
+ };
126
+ };
127
+ readonly subTypes: {};
128
+ };
129
+ readonly settings: {};
130
+ };
131
+ } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
132
+ subType?: "" | "div" | "section" | "aside" | "main" | undefined;
133
+ topic?: string | undefined;
134
+ grant?: string | undefined;
135
+ presence?: unknown;
136
+ keep?: number | string | undefined;
137
+ }>>;
138
+ export default declaration;