@plitzi/sdk-elements 0.38.15 → 0.38.17

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 (256) hide show
  1. package/CHANGELOG.md +118 -0
  2. package/dist/Component/ComponentProvider.mjs +3 -3
  3. package/dist/Element/ElementContext.mjs +1 -1
  4. package/dist/Element/ElementParentContext.mjs +1 -1
  5. package/dist/Element/JsxManager.mjs +2 -2
  6. package/dist/Element/LayoutBody.mjs +1 -1
  7. package/dist/Element/PluginManager.mjs +2 -2
  8. package/dist/Element/PluginRemote.mjs +4 -4
  9. package/dist/Element/ReplicaProvider.mjs +1 -1
  10. package/dist/Element/RootElement.mjs +4 -4
  11. package/dist/Element/helpers/declaredAttributes.mjs +1 -1
  12. package/dist/Element/helpers/getInteractions.mjs +4 -5
  13. package/dist/Element/hocs/withElement.mjs +2 -2
  14. package/dist/Element/hooks/useEditableContent.mjs +2 -2
  15. package/dist/Element/hooks/useElementDataSource.mjs +1 -1
  16. package/dist/Element/hooks/useElementInternal.mjs +2 -2
  17. package/dist/Element/hooks/useElementVisible.mjs +1 -1
  18. package/dist/Element/hooks/useInternalClassName.mjs +1 -1
  19. package/dist/Element/hooks/useInternalItems.mjs +2 -2
  20. package/dist/Element/hooks/useIntervalTriggers.mjs +1 -1
  21. package/dist/Element/hooks/useKeyTriggers.mjs +1 -1
  22. package/dist/Element/hooks/useLayoutChain.d.ts +1 -1
  23. package/dist/Element/hooks/useLayoutChain.mjs +4 -4
  24. package/dist/Element/hooks/usePluginTrigger.mjs +2 -2
  25. package/dist/Element/hooks/useRootElementInteractions.mjs +26 -27
  26. package/dist/Element/hooks/useRscData.d.ts +1 -1
  27. package/dist/Element/hooks/useRscData.mjs +1 -2
  28. package/dist/Element/hooks/useScrollInteractions.mjs +20 -21
  29. package/dist/builder/index.d.ts +5 -0
  30. package/dist/builder/index.mjs +1 -0
  31. package/dist/canvas/useAnimationFrame.mjs +1 -1
  32. package/dist/components/ElementAdvancedEditor.mjs +30 -30
  33. package/dist/components/IconField/index.mjs +1 -2
  34. package/dist/components/IconPicker/index.mjs +1 -2
  35. package/dist/components/MarkdownDocument/components/CodeBlock/CodeBlock.mjs +13 -13
  36. package/dist/dataSource/GlobalSources.mjs +44 -45
  37. package/dist/dataSource/getSourcesByElementId.mjs +1 -1
  38. package/dist/dataSource/index.d.ts +3 -0
  39. package/dist/dataSource/index.mjs +6 -3
  40. package/dist/dataSource/pathFields.mjs +1 -1
  41. package/dist/dataSource/sourceStore.mjs +1 -1
  42. package/dist/dataSource/useRegisterSource.d.ts +9 -0
  43. package/dist/dataSource/useRegisterSource.mjs +40 -0
  44. package/dist/dataSource/useResolvedVariables.d.ts +12 -0
  45. package/dist/dataSource/useResolvedVariables.mjs +27 -0
  46. package/dist/elements/advanced/BlockHtml/BlockHtml.d.ts +1 -1
  47. package/dist/elements/advanced/BlockHtml/BlockHtml.mjs +1 -1
  48. package/dist/elements/advanced/BlockHtml/declaration.d.ts +2 -2
  49. package/dist/elements/advanced/BlockHtml/declaration.mjs +1 -1
  50. package/dist/elements/advanced/BlockHtml/index.d.ts +3 -3
  51. package/dist/elements/advanced/BlockJsx/BlockJsx.d.ts +1 -1
  52. package/dist/elements/advanced/BlockJsx/Settings.mjs +25 -29
  53. package/dist/elements/advanced/BlockJsx/declaration.d.ts +2 -2
  54. package/dist/elements/advanced/BlockJsx/declaration.mjs +1 -1
  55. package/dist/elements/advanced/BlockJsx/index.d.ts +3 -3
  56. package/dist/elements/advanced/Custom/Custom.d.ts +1 -1
  57. package/dist/elements/advanced/Custom/Custom.mjs +2 -2
  58. package/dist/elements/advanced/Custom/Settings.mjs +3 -6
  59. package/dist/elements/advanced/Custom/declaration.d.ts +2 -2
  60. package/dist/elements/advanced/Custom/declaration.mjs +1 -1
  61. package/dist/elements/advanced/Custom/index.d.ts +3 -3
  62. package/dist/elements/advanced/NodeHtml/NodeHtml.d.ts +1 -1
  63. package/dist/elements/advanced/NodeHtml/declaration.d.ts +2 -2
  64. package/dist/elements/advanced/NodeHtml/declaration.mjs +1 -1
  65. package/dist/elements/advanced/NodeHtml/index.d.ts +3 -3
  66. package/dist/elements/advanced/PlitziSdk/declaration.d.ts +1 -1
  67. package/dist/elements/advanced/PlitziSdk/declaration.mjs +1 -1
  68. package/dist/elements/advanced/Reference/Reference.d.ts +1 -1
  69. package/dist/elements/advanced/Reference/Reference.mjs +3 -3
  70. package/dist/elements/advanced/Reference/declaration.d.ts +2 -2
  71. package/dist/elements/advanced/Reference/declaration.mjs +1 -1
  72. package/dist/elements/advanced/Reference/index.d.ts +3 -3
  73. package/dist/elements/basic/Button/Button.d.ts +1 -1
  74. package/dist/elements/basic/Button/Button.mjs +1 -1
  75. package/dist/elements/basic/Button/declaration.d.ts +3 -3
  76. package/dist/elements/basic/Button/declaration.mjs +1 -1
  77. package/dist/elements/basic/Button/index.d.ts +4 -4
  78. package/dist/elements/basic/Dropdown/Dropdown.d.ts +1 -1
  79. package/dist/elements/basic/Dropdown/Dropdown.mjs +12 -12
  80. package/dist/elements/basic/Dropdown/DropdownPopup/DropdownPopup.d.ts +1 -1
  81. package/dist/elements/basic/Dropdown/DropdownPopup/declaration.d.ts +2 -2
  82. package/dist/elements/basic/Dropdown/DropdownPopup/declaration.mjs +1 -1
  83. package/dist/elements/basic/Dropdown/DropdownPopup/index.d.ts +3 -3
  84. package/dist/elements/basic/Dropdown/declaration.d.ts +2 -2
  85. package/dist/elements/basic/Dropdown/declaration.mjs +1 -1
  86. package/dist/elements/basic/Dropdown/index.d.ts +5 -5
  87. package/dist/elements/basic/Dropdown/useDropdown.mjs +1 -5
  88. package/dist/elements/basic/Dropdown/useDropdownTrigger.mjs +1 -7
  89. package/dist/elements/basic/Heading/Heading.d.ts +1 -1
  90. package/dist/elements/basic/Heading/declaration.d.ts +2 -2
  91. package/dist/elements/basic/Heading/declaration.mjs +1 -1
  92. package/dist/elements/basic/Heading/index.d.ts +3 -3
  93. package/dist/elements/basic/Link/Link.d.ts +1 -1
  94. package/dist/elements/basic/Link/Link.mjs +2 -2
  95. package/dist/elements/basic/Link/Settings.mjs +2 -2
  96. package/dist/elements/basic/Link/declaration.d.ts +3 -3
  97. package/dist/elements/basic/Link/declaration.mjs +1 -1
  98. package/dist/elements/basic/Link/index.d.ts +4 -4
  99. package/dist/elements/basic/Markdown/Markdown.d.ts +1 -1
  100. package/dist/elements/basic/Markdown/Markdown.mjs +8 -8
  101. package/dist/elements/basic/Markdown/declaration.d.ts +2 -2
  102. package/dist/elements/basic/Markdown/declaration.mjs +1 -1
  103. package/dist/elements/basic/Markdown/hooks/useMarkdownClassNames.mjs +1 -1
  104. package/dist/elements/basic/Markdown/index.d.ts +3 -3
  105. package/dist/elements/basic/Paragraph/Paragraph.d.ts +1 -1
  106. package/dist/elements/basic/Paragraph/declaration.d.ts +2 -2
  107. package/dist/elements/basic/Paragraph/declaration.mjs +1 -1
  108. package/dist/elements/basic/Paragraph/index.d.ts +3 -3
  109. package/dist/elements/basic/RichText/RichText.d.ts +1 -1
  110. package/dist/elements/basic/RichText/RichText.mjs +14 -14
  111. package/dist/elements/basic/RichText/declaration.d.ts +2 -2
  112. package/dist/elements/basic/RichText/declaration.mjs +1 -1
  113. package/dist/elements/basic/RichText/index.d.ts +3 -3
  114. package/dist/elements/basic/Text/Text.d.ts +1 -1
  115. package/dist/elements/basic/Text/declaration.d.ts +2 -2
  116. package/dist/elements/basic/Text/declaration.mjs +1 -1
  117. package/dist/elements/basic/Text/index.d.ts +3 -3
  118. package/dist/elements/basic/ThemeToggle/ThemeToggle.d.ts +1 -1
  119. package/dist/elements/basic/ThemeToggle/ThemeToggle.mjs +3 -3
  120. package/dist/elements/basic/ThemeToggle/declaration.d.ts +2 -2
  121. package/dist/elements/basic/ThemeToggle/declaration.mjs +1 -1
  122. package/dist/elements/basic/ThemeToggle/index.d.ts +3 -3
  123. package/dist/elements/declarations/index.d.ts +66 -52
  124. package/dist/elements/declarations/index.mjs +45 -42
  125. package/dist/elements/form/Form/Form.d.ts +1 -1
  126. package/dist/elements/form/Form/Form.mjs +37 -37
  127. package/dist/elements/form/Form/declaration.d.ts +2 -2
  128. package/dist/elements/form/Form/declaration.mjs +1 -1
  129. package/dist/elements/form/Form/index.d.ts +1 -1
  130. package/dist/elements/form/FormControl/FormControl.d.ts +1 -1
  131. package/dist/elements/form/FormControl/FormControl.mjs +2 -2
  132. package/dist/elements/form/FormControl/Settings.mjs +1 -5
  133. package/dist/elements/form/FormControl/declaration.d.ts +2 -2
  134. package/dist/elements/form/FormControl/declaration.mjs +1 -1
  135. package/dist/elements/form/FormControl/hocs/withFieldValue.mjs +12 -16
  136. package/dist/elements/form/FormControl/index.d.ts +1 -1
  137. package/dist/elements/internal/LayoutContainer/LayoutContainer.d.ts +1 -1
  138. package/dist/elements/internal/LayoutContainer/LayoutContainer.mjs +1 -1
  139. package/dist/elements/internal/LayoutContainer/declaration.d.ts +2 -2
  140. package/dist/elements/internal/LayoutContainer/declaration.mjs +1 -1
  141. package/dist/elements/internal/LayoutContainer/index.d.ts +3 -3
  142. package/dist/elements/internal/LayoutPicker/LayoutPicker.mjs +7 -7
  143. package/dist/elements/internal/Loading/Loading.d.ts +1 -1
  144. package/dist/elements/internal/Loading/declaration.d.ts +2 -2
  145. package/dist/elements/internal/Loading/declaration.mjs +1 -1
  146. package/dist/elements/internal/Loading/index.d.ts +3 -3
  147. package/dist/elements/internal/NotFound/NotFound.d.ts +1 -1
  148. package/dist/elements/internal/NotFound/NotFound.mjs +1 -1
  149. package/dist/elements/internal/NotFound/declaration.d.ts +2 -2
  150. package/dist/elements/internal/NotFound/declaration.mjs +1 -1
  151. package/dist/elements/internal/NotFound/index.d.ts +3 -3
  152. package/dist/elements/internal/Page/Page.d.ts +1 -1
  153. package/dist/elements/internal/Page/Page.mjs +2 -2
  154. package/dist/elements/internal/Page/PageHead.mjs +7 -7
  155. package/dist/elements/internal/Page/Settings.mjs +1 -1
  156. package/dist/elements/internal/Page/declaration.d.ts +2 -2
  157. package/dist/elements/internal/Page/declaration.mjs +1 -1
  158. package/dist/elements/internal/Page/index.d.ts +3 -3
  159. package/dist/elements/media/Embed/Embed.d.ts +1 -1
  160. package/dist/elements/media/Embed/Embed.mjs +1 -1
  161. package/dist/elements/media/Embed/declaration.d.ts +2 -2
  162. package/dist/elements/media/Embed/declaration.mjs +1 -1
  163. package/dist/elements/media/Embed/index.d.ts +3 -3
  164. package/dist/elements/media/FontAwesome/FontAwesome.d.ts +1 -1
  165. package/dist/elements/media/FontAwesome/declaration.d.ts +2 -2
  166. package/dist/elements/media/FontAwesome/declaration.mjs +1 -1
  167. package/dist/elements/media/FontAwesome/index.d.ts +3 -3
  168. package/dist/elements/media/Image/Image.d.ts +1 -1
  169. package/dist/elements/media/Image/Image.mjs +12 -12
  170. package/dist/elements/media/Image/declaration.d.ts +2 -2
  171. package/dist/elements/media/Image/declaration.mjs +1 -1
  172. package/dist/elements/media/Image/index.d.ts +3 -3
  173. package/dist/elements/media/Svg/Svg.d.ts +1 -1
  174. package/dist/elements/media/Svg/Svg.mjs +11 -11
  175. package/dist/elements/media/Svg/declaration.d.ts +2 -2
  176. package/dist/elements/media/Svg/declaration.mjs +1 -1
  177. package/dist/elements/media/Svg/index.d.ts +3 -3
  178. package/dist/elements/media/Video/Video.d.ts +1 -1
  179. package/dist/elements/media/Video/Video.mjs +1 -1
  180. package/dist/elements/media/Video/declaration.d.ts +2 -2
  181. package/dist/elements/media/Video/declaration.mjs +1 -1
  182. package/dist/elements/media/Video/index.d.ts +3 -3
  183. package/dist/elements/provider/ApiContainer/ApiContainer.d.ts +1 -1
  184. package/dist/elements/provider/ApiContainer/ApiContainer.mjs +40 -48
  185. package/dist/elements/provider/ApiContainer/Settings.mjs +6 -10
  186. package/dist/elements/provider/ApiContainer/declaration.d.ts +2 -2
  187. package/dist/elements/provider/ApiContainer/declaration.mjs +1 -1
  188. package/dist/elements/provider/ApiContainer/helpers/serverMock.mjs +1 -1
  189. package/dist/elements/provider/ApiContainer/hooks/useApi.mjs +5 -5
  190. package/dist/elements/provider/ApiContainer/hooks/useProviderPagination.mjs +3 -12
  191. package/dist/elements/provider/ApiContainer/index.d.ts +3 -3
  192. package/dist/elements/provider/Channel/Channel.d.ts +1 -1
  193. package/dist/elements/provider/Channel/Channel.mjs +24 -24
  194. package/dist/elements/provider/Channel/declaration.d.ts +2 -2
  195. package/dist/elements/provider/Channel/declaration.mjs +1 -1
  196. package/dist/elements/provider/Channel/index.d.ts +3 -3
  197. package/dist/elements/settings.mjs +84 -85
  198. package/dist/elements/structure/Carousel/Carousel.d.ts +1 -1
  199. package/dist/elements/structure/Carousel/Carousel.mjs +27 -39
  200. package/dist/elements/structure/Carousel/CarouselTrack/CarouselTrack.d.ts +1 -1
  201. package/dist/elements/structure/Carousel/CarouselTrack/components/CarouselSlide/index.mjs +1 -2
  202. package/dist/elements/structure/Carousel/CarouselTrack/components/MarqueeTrack/index.mjs +1 -2
  203. package/dist/elements/structure/Carousel/CarouselTrack/components/ScrollTrack/index.mjs +1 -2
  204. package/dist/elements/structure/Carousel/CarouselTrack/declaration.d.ts +2 -2
  205. package/dist/elements/structure/Carousel/CarouselTrack/declaration.mjs +1 -1
  206. package/dist/elements/structure/Carousel/CarouselTrack/index.d.ts +3 -3
  207. package/dist/elements/structure/Carousel/declaration.d.ts +2 -2
  208. package/dist/elements/structure/Carousel/declaration.mjs +1 -1
  209. package/dist/elements/structure/Carousel/index.d.ts +5 -5
  210. package/dist/elements/structure/Container/Container.d.ts +1 -1
  211. package/dist/elements/structure/Container/declaration.d.ts +2 -2
  212. package/dist/elements/structure/Container/declaration.mjs +1 -1
  213. package/dist/elements/structure/Container/index.d.ts +3 -3
  214. package/dist/elements/structure/DialogContainer/DialogContainer.d.ts +1 -1
  215. package/dist/elements/structure/DialogContainer/declaration.d.ts +2 -2
  216. package/dist/elements/structure/DialogContainer/declaration.mjs +1 -1
  217. package/dist/elements/structure/DialogContainer/index.d.ts +3 -3
  218. package/dist/elements/structure/List/List.d.ts +1 -1
  219. package/dist/elements/structure/List/ListItem/ListItem.d.ts +1 -1
  220. package/dist/elements/structure/List/ListItem/declaration.d.ts +2 -2
  221. package/dist/elements/structure/List/ListItem/declaration.mjs +1 -1
  222. package/dist/elements/structure/List/ListItem/index.d.ts +3 -3
  223. package/dist/elements/structure/List/declaration.d.ts +2 -2
  224. package/dist/elements/structure/List/declaration.mjs +1 -1
  225. package/dist/elements/structure/List/index.d.ts +5 -5
  226. package/dist/elements/structure/List/modes/ListControlled/ListControlled.mjs +23 -23
  227. package/dist/elements/structure/ModalContainer/ModalContainer.d.ts +1 -1
  228. package/dist/elements/structure/ModalContainer/declaration.d.ts +2 -2
  229. package/dist/elements/structure/ModalContainer/declaration.mjs +1 -1
  230. package/dist/elements/structure/ModalContainer/index.d.ts +3 -3
  231. package/dist/elements/structure/Overlay/metadataOf.mjs +1 -1
  232. package/dist/elements/structure/Overlay/useOverlay.mjs +19 -19
  233. package/dist/elements/structure/Pagination/Pagination.d.ts +1 -1
  234. package/dist/elements/structure/Pagination/Pagination.mjs +3 -3
  235. package/dist/elements/structure/Pagination/declaration.d.ts +2 -2
  236. package/dist/elements/structure/Pagination/declaration.mjs +1 -1
  237. package/dist/elements/structure/Pagination/index.d.ts +3 -3
  238. package/dist/elements/structure/TabContainer/TabContainer.d.ts +1 -1
  239. package/dist/elements/structure/TabContainer/TabContainerBody/TabContainerBody.d.ts +1 -1
  240. package/dist/elements/structure/TabContainer/TabContainerBody/declaration.d.ts +2 -2
  241. package/dist/elements/structure/TabContainer/TabContainerBody/declaration.mjs +1 -1
  242. package/dist/elements/structure/TabContainer/TabContainerBody/index.d.ts +3 -3
  243. package/dist/elements/structure/TabContainer/TabContainerHeader/TabContainerHeader.d.ts +1 -1
  244. package/dist/elements/structure/TabContainer/TabContainerHeader/declaration.d.ts +2 -2
  245. package/dist/elements/structure/TabContainer/TabContainerHeader/declaration.mjs +1 -1
  246. package/dist/elements/structure/TabContainer/TabContainerHeader/index.d.ts +3 -3
  247. package/dist/elements/structure/TabContainer/TabContainerItem/TabContainerItem.d.ts +1 -1
  248. package/dist/elements/structure/TabContainer/TabContainerItem/declaration.d.ts +2 -2
  249. package/dist/elements/structure/TabContainer/TabContainerItem/declaration.mjs +1 -1
  250. package/dist/elements/structure/TabContainer/TabContainerItem/index.d.ts +3 -3
  251. package/dist/elements/structure/TabContainer/declaration.d.ts +2 -2
  252. package/dist/elements/structure/TabContainer/declaration.mjs +1 -1
  253. package/dist/elements/structure/TabContainer/index.d.ts +11 -11
  254. package/dist/index.d.ts +133 -121
  255. package/dist/index.mjs +85 -76
  256. package/package.json +18 -1408
package/CHANGELOG.md CHANGED
@@ -1,5 +1,123 @@
1
1
  # @plitzi/sdk-elements
2
2
 
3
+ ## 0.38.17
4
+
5
+ ### Patch Changes
6
+
7
+ - 4f8dc37: ## Packages
8
+
9
+ - **A library package is imported by its root and its folders, never by a file** (`@plitzi/sdk-shared`, `sdk-schema`,
10
+ `sdk-style`, `sdk-elements`, `sdk-interactions`, `sdk-auth`, `sdk-dev-tools`, `sdk-event-bridge`, `sdk-navigation`,
11
+ `sdk-plugins`, `sdk-variables`): each `exports` is now `"."` and `"./*"`, the latter a folder's `index`.
12
+ `@plitzi/sdk-shared/helpers/isRecord` becomes `import { isRecord } from '@plitzi/sdk-shared/helpers'`, and a default
13
+ export by the name its folder gives it — almost always its file's (`import usePlitzi from '…/hooks/usePlitzi'` →
14
+ `import { usePlitzi } from '@plitzi/sdk-shared/hooks'`). A file-level specifier now fails with `ERR_MODULE_NOT_FOUND`.
15
+ New entries where a folder barrel would have brought more than was asked for: `@plitzi/sdk-shared/project` and
16
+ `@plitzi/sdk-shared/plugins/bundle` (Node only), `@plitzi/sdk-interactions/declarations` (the global callbacks and
17
+ utility specs, without React), and `@plitzi/sdk-elements/elements/declarations`, which now also carries the
18
+ declarations' attribute types and the constants they are checked with. `RuleGroup` is exported by `@plitzi/sdk-shared`
19
+ with the document types that use it. `plitzi upgrade migrations` names every such import in a project, with the folder to
20
+ import it from instead.
21
+ - **`@plitzi/sdk-shared`'s root exports the document types, and only them** (`@plitzi/sdk-shared`): what the package
22
+ does is imported from its folder — `formatDate` from `@plitzi/sdk-shared/helpers`, `ThemeProvider` from
23
+ `@plitzi/sdk-shared/theme`, a GraphQL operation's types from `@plitzi/sdk-shared/network/graphql` — so a module that
24
+ imports a type from the root no longer loads every area of the package.
25
+ - **What one package alone used lives in that package** (`@plitzi/sdk-shared`, `@plitzi/sdk-elements`): the data
26
+ source hooks moved from `@plitzi/sdk-shared/dataSource/hooks` to `@plitzi/sdk-elements/dataSource`
27
+ (`useRegisterSource`, `useResolvedVariables`), and the Apollo links the builder's client is built with into the
28
+ builder.
29
+ - **The builder's panels are an entry of their own** (`@plitzi/sdk-style`, `@plitzi/sdk-variables`,
30
+ `@plitzi/sdk-elements`): the style inspector, the advanced style editor and `BuilderStyleContextProvider` are imported
31
+ from `@plitzi/sdk-style/builder`; the variables' lists and forms from `@plitzi/sdk-variables/builder`; the elements'
32
+ settings panels (`defaultElementsSettings`) from `@plitzi/sdk-elements/builder`. Each package's root keeps what a page
33
+ and a server use — `generateCache` no longer loads the inspector, on a server 227 modules down to 21.
34
+
35
+ ## CLI
36
+ - **`plitzi upgrade`'s `renames` part is now `migrations`** (`@plitzi/cli`): what a version changed that a project's
37
+ own source must follow, one file per change in the CLI's `src/migrations/changes/` with the version it shipped in —
38
+ rewritten with `--write` when it has one right answer, said otherwise. The `--json` report carries `migrations` (each
39
+ with its `migration`, `since`, `file`, `line`, `what` and whether it was `written`) in place of `renames` and
40
+ `changes`. The changes of 0.38.0 (`canTemplate` → `canSnippet`, the `*Template` authoring names), 0.38.9 (a
41
+ `formControl` without `required` is optional) and 0.38.12 (`usePlitziServiceContext` → `usePlitzi`) are no longer
42
+ looked for: a project still on one of those versions makes them by hand.
43
+
44
+ - Updated dependencies [4f8dc37]
45
+ - @plitzi/sdk-auth@0.38.17
46
+ - @plitzi/sdk-event-bridge@0.38.17
47
+ - @plitzi/sdk-interactions@0.38.17
48
+ - @plitzi/sdk-navigation@0.38.17
49
+ - @plitzi/sdk-schema@0.38.17
50
+ - @plitzi/sdk-shared@0.38.17
51
+
52
+ ## 0.38.16
53
+
54
+ ### Patch Changes
55
+
56
+ - 9cfdccb: ## Security
57
+
58
+ - **A site's credential reads nothing of the space over MCP** (`@plitzi/sdk-mcp`): the `render` token every published
59
+ page embeds — and a self-hosting `host` key — resolved to a grant naming the space, and the MCP served every read
60
+ under it: the unpublished draft, the change history with who made each change and every value before and after, the
61
+ functions' source, the space's private data, its action documents and connectors. Only an `agent` grant attaches a
62
+ space now; any other is a connection with no space (`plitzi_render` and the public guides), told so in the words
63
+ `NO_SPACE_ATTACHED` already uses. A deployment whose `getGrant` answered other scopes for reading must issue agent
64
+ grants for them.
65
+
66
+ ## Agents
67
+ - **`plitzi space watch`** (`@plitzi/cli`): the space read again on every save of `src/space/`, `src/plugins/`,
68
+ `src/data/` or `public/data/`, and only what changed said — what the save did to the space element by element, the
69
+ findings and warnings it brought and fixed (one that only moved down its file is the same one), a save that changed
70
+ nothing, or that the space stopped authoring and why. `--json` is one event a line (`ready`, `pass`, `refused`,
71
+ `error`), for an agent to run in the background instead of `author` and `space lint` after every edit. Each pass reads
72
+ the space in a process of its own (`space watch-pass`, hidden). `space lint`'s reading is `spaceFindings`, shared.
73
+ - **A space's activity, followed** (`@plitzi/sdk-shared`, `@plitzi/sdk-mcp`, `@plitzi/cli`): what happened on a space
74
+ after a cursor — its draft changed (a person in the builder, an agent, the autofix), a version went out, a server
75
+ action failed or was refused — and, with nothing yet, waited for, up to 50 s. One vocabulary,
76
+ `@plitzi/sdk-shared/activity` (`SpaceActivity`, `SpaceActivityPage`, `activityLine`, `isSpaceActivityPage`, the
77
+ limits); the reader's own writes left out and counted (`skippedMine`), `mine` keeps them.
78
+ - **`plitzi_activity { after, wait, limit, mine }`** (`@plitzi/sdk-mcp`), on the new `getActivity` adapter
79
+ (`SSRAdapters`). The listing budget is 78k (was 77k) for it.
80
+ - **`plitzi space activity [--follow] [--after <cursor>] [--mine] [--limit <n>] [--json]`** (`@plitzi/cli`), over
81
+ the platform's `GET /spaces/:spaceId/activity`; `--follow` stays, one page a line with `--json`, and asks again
82
+ when the platform does not answer.
83
+ - **The people in the builder see the agent work** (`@plitzi/sdk-server`, `@plitzi/sdk-shared`, `@plitzi/sdk-mcp`,
84
+ `@plitzi/plitzi-builder`): an agent grant carries the application the member connected (`Grant.client`,
85
+ `StoredSpaceToken.client`, `SSRGrant.client`), and every MCP write `SSRWriteContext.client` — the history's
86
+ `client` for an agent, which was never set. A collaborator may be an agent (`SubscriptionCollaborator.agent`): the
87
+ builder draws it as a robot, names it `Claude · for ana` (`collaboratorTitle`) in the header, on the canvas and in
88
+ its notices. The deployment announces it — Plitzi's joins it on a write, selects what it changed, and lets it go
89
+ after a minute of nothing. `activityLine` names it the same way (`Claude for ana over the MCP, …`), so
90
+ `plitzi space activity` says which application wrote.
91
+ - A tool may declare `documents: false` (`ToolSpec`): the host loads none of the space for it, and passes the call's
92
+ abort signal through `ToolContext.activity`.
93
+
94
+ ## Authoring
95
+ - **A file that does not parse is said at its line under any loader** (`@plitzi/sdk-authoring`): `moduleProblem` read
96
+ the first line of the error, and an esbuild transform (tsx, vitest) puts only `Transform failed with 1 error:` there
97
+ — the file, line and what is wrong are on the next. A line of the message that points at a file of the project is
98
+ now the problem (`src/space/hero.ts:139: Expected "}" but found ";"`), the project's root matched as given and as it
99
+ is on disk (`/var/…` and `/private/var/…` on macOS).
100
+
101
+ ## Testing
102
+ - **`unusedPort` is chosen where the system never hands one out** (`@plitzi/sdk-server`): it answered a port the system
103
+ had just handed out (`listen(0)`), from the ephemeral range every outgoing connection takes its local port from — so
104
+ another worker's request could take it before the test listened, and CI failed `runtime.test.ts` with `EADDRINUSE`
105
+ (the page server then ends the process). It is a free port below that range now, at random, checked first.
106
+
107
+ ## Docs
108
+ - **A self-hosted runtime's endpoints go in `data`**, as 0.38.15 moved them: `docs/en/runtimes.md`, the
109
+ `10-runtime` example and the website still put `served.stage` in `preAuth`, before the cross-site guard.
110
+ - New: `docs/en/activity.md`; `space watch` in `docs/en/agent-tooling.md`'s loop; the CLI README, the CLI skill, the
111
+ generated project's `AGENTS.md`, the MCP guide and README.
112
+
113
+ - Updated dependencies [9cfdccb]
114
+ - @plitzi/sdk-auth@0.38.16
115
+ - @plitzi/sdk-event-bridge@0.38.16
116
+ - @plitzi/sdk-interactions@0.38.16
117
+ - @plitzi/sdk-navigation@0.38.16
118
+ - @plitzi/sdk-schema@0.38.16
119
+ - @plitzi/sdk-shared@0.38.16
120
+
3
121
  ## 0.38.15
4
122
 
5
123
  ### Patch Changes
@@ -2,7 +2,7 @@ import { getPlugins as e, processLocalCustomPlugins as t, processLocalPlugins as
2
2
  import { defaultElements as r } from "../index.mjs";
3
3
  import { useCallback as i, useMemo as a, useRef as o } from "react";
4
4
  import { get as s, omit as c } from "@plitzi/plitzi-ui/helpers";
5
- import l from "@plitzi/sdk-shared/elements/ComponentContext";
5
+ import { ComponentContext as l } from "@plitzi/sdk-shared/elements";
6
6
  import { jsx as u } from "react/jsx-runtime";
7
7
  //#region src/Component/ComponentProvider.tsx
8
8
  var d = ({ localComponents: d, localCustomComponents: f, children: p }) => {
@@ -38,14 +38,14 @@ var d = ({ localComponents: d, localCustomComponents: f, children: p }) => {
38
38
  [t.type]: t,
39
39
  ...e(t)
40
40
  });
41
- }), Object.keys(n).length === 0 ? n : (g.current = {
41
+ }), Object.keys(n).length === 0 || (g.current = {
42
42
  ...h.current,
43
43
  ...n,
44
44
  ...m
45
45
  }, h.current = {
46
46
  ...h.current,
47
47
  ...n
48
- }, n);
48
+ }), n;
49
49
  }, [g, m]), y = i((e) => {
50
50
  if (!e) return [];
51
51
  Array.isArray(e) || (e = [e]);
@@ -1,4 +1,4 @@
1
- import { sharedContext as e } from "@plitzi/sdk-shared/helpers/sharedContext";
1
+ import { sharedContext as e } from "@plitzi/sdk-shared/helpers";
2
2
  //#region src/Element/ElementContext.tsx
3
3
  var t = e("ElementContext", void 0);
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { sharedContext as e } from "@plitzi/sdk-shared/helpers/sharedContext";
1
+ import { sharedContext as e } from "@plitzi/sdk-shared/helpers";
2
2
  //#region src/Element/ElementParentContext.ts
3
3
  var t = e("ElementParentContext", void 0);
4
4
  //#endregion
@@ -2,8 +2,8 @@ import e from "./PluginRemote.mjs";
2
2
  import { getRemoteSettings as t } from "./helpers/pluginSelector.mjs";
3
3
  import n from "../elements/internal/NotFound/NotFound.mjs";
4
4
  import { memo as r, use as i, useMemo as a } from "react";
5
- import o from "@plitzi/sdk-shared/elements/ComponentContext";
6
- import s from "@plitzi/sdk-shared/plugins/PluginsContext";
5
+ import { ComponentContext as o } from "@plitzi/sdk-shared/elements";
6
+ import { PluginsContext as s } from "@plitzi/sdk-shared/plugins";
7
7
  import { jsx as c } from "react/jsx-runtime";
8
8
  var l = r(({ plitziJsxSkipHOC: r = !0, as: l = "", internalProps: u, children: d, ...f }) => {
9
9
  let { components: p } = i(o), { plugins: m } = i(s), h = l ? p.current[l] : void 0, g = a(() => h ? void 0 : t({
@@ -1,5 +1,5 @@
1
1
  import { use as e, useCallback as t, useLayoutEffect as n, useState as r, useSyncExternalStore as i } from "react";
2
- import { sharedContext as a } from "@plitzi/sdk-shared/helpers/sharedContext";
2
+ import { sharedContext as a } from "@plitzi/sdk-shared/helpers";
3
3
  import { jsx as o } from "react/jsx-runtime";
4
4
  //#region src/Element/LayoutBody.tsx
5
5
  var s = a("LayoutBodyContext", void 0), c = () => void 0, l = ({ bodies: e, children: t }) => {
@@ -1,7 +1,7 @@
1
1
  import e from "./helpers/pluginSelector.mjs";
2
2
  import { memo as t, use as n } from "react";
3
- import r from "@plitzi/sdk-shared/elements/ComponentContext";
4
- import i from "@plitzi/sdk-shared/plugins/PluginsContext";
3
+ import { ComponentContext as r } from "@plitzi/sdk-shared/elements";
4
+ import { PluginsContext as i } from "@plitzi/sdk-shared/plugins";
5
5
  var a = t(({ plitziElementLayout: t = void 0, type: a = "", internalProps: o }) => {
6
6
  let { components: s } = n(r), { plugins: c } = n(i);
7
7
  return e({
@@ -1,11 +1,11 @@
1
1
  import e from "./helpers/loadComponent.mjs";
2
2
  import { Suspense as t, lazy as n, use as r, useEffect as i, useMemo as a, useState as o } from "react";
3
- import s from "@plitzi/sdk-shared/elements/ComponentContext";
4
- import { emptyObject as c } from "@plitzi/sdk-shared/helpers/utils";
3
+ import { emptyObject as s } from "@plitzi/sdk-shared/helpers";
4
+ import { ComponentContext as c } from "@plitzi/sdk-shared/elements";
5
5
  import { jsx as l } from "react/jsx-runtime";
6
6
  //#region src/Element/PluginRemote.tsx
7
- var u = ({ url: u = "", type: d, internalProps: f, autoRegister: p = !0, plitziJsxSkipHOC: m = !1, plitziJsxProps: h = c }) => {
8
- let { register: g } = r(s), [_, v] = o(!1);
7
+ var u = ({ url: u = "", type: d, internalProps: f, autoRegister: p = !0, plitziJsxSkipHOC: m = !1, plitziJsxProps: h = s }) => {
8
+ let { register: g } = r(c), [_, v] = o(!1);
9
9
  i(() => v(!0), []);
10
10
  let y = a(() => n(e(u, g, p, m, d)), [u, d]);
11
11
  return _ ? m ? /* @__PURE__ */ l(t, { children: /* @__PURE__ */ l(y, {
@@ -1,6 +1,6 @@
1
1
  import { use as e, useEffect as t, useMemo as n } from "react";
2
2
  import { jsx as r } from "react/jsx-runtime";
3
- import i from "@plitzi/sdk-interactions/InteractionsContext";
3
+ import { InteractionsContext as i } from "@plitzi/sdk-interactions";
4
4
  //#region src/Element/ReplicaProvider.tsx
5
5
  var a = ({ children: a }) => {
6
6
  let o = e(i), s = n(() => o.interactionsManager.createChildManager(), [o]), c = n(() => ({
@@ -3,9 +3,9 @@ import t from "./helpers/parseStyle.mjs";
3
3
  import n from "./helpers/renderStaticTag.mjs";
4
4
  import r from "./hooks/useRootElementInteractions.mjs";
5
5
  import { use as i, useMemo as a } from "react";
6
- import o from "@plitzi/sdk-shared/hooks/usePlitzi";
7
- import s from "@plitzi/sdk-interactions/InteractionsContext";
8
- import { motionAttributes as c } from "@plitzi/sdk-shared/schema/motion";
6
+ import { usePlitzi as o } from "@plitzi/sdk-shared/hooks";
7
+ import { motionAttributes as s } from "@plitzi/sdk-shared/schema";
8
+ import { InteractionsContext as c } from "@plitzi/sdk-interactions";
9
9
  //#region src/Element/RootElement.tsx
10
10
  var l = ({ ref: l, children: u, tag: d = "div", className: f = "", interactionTriggers: p, interactionCallbacks: m, style: h, ...g }) => {
11
11
  let _ = a(() => t(h), [h]), v = e(), y = o(), b = y.settings.previewMode ?? !0, x = !!y.settings.debugMode;
@@ -17,7 +17,7 @@ var l = ({ ref: l, children: u, tag: d = "div", className: f = "", interactionTr
17
17
  otherProps: g,
18
18
  children: u
19
19
  });
20
- let { root: { baseElementId: S } } = y, C = !!i(s).interactionsManager, { id: w, rootId: T, style: E, plitziElementLayout: D, definition: { type: O, label: k, runtime: A, anchor: j, parentId: M, motion: N } } = v, P = c(N), F = A === "server" ? { "data-rsc-id": w } : void 0, I = D?.type === "component" && !M && D.rootId !== w ? D.rootId : void 0, L = y.settings.testAttributes === !1 ? void 0 : {
20
+ let { root: { baseElementId: S } } = y, C = !!i(c).interactionsManager, { id: w, rootId: T, style: E, plitziElementLayout: D, definition: { type: O, label: k, runtime: A, anchor: j, parentId: M, motion: N } } = v, P = s(N), F = A === "server" ? { "data-rsc-id": w } : void 0, I = D?.type === "component" && !M && D.rootId !== w ? D.rootId : void 0, L = y.settings.testAttributes === !1 ? void 0 : {
21
21
  "data-plitzi-el": w,
22
22
  ...I === void 0 ? {} : { "data-plitzi-instance": I }
23
23
  }, R = !x && (b || !O || T !== S) ? {} : {
@@ -1,4 +1,4 @@
1
- import { isRecord as e } from "@plitzi/sdk-shared/helpers/isRecord";
1
+ import { isRecord as e } from "@plitzi/sdk-shared/helpers";
2
2
  //#region src/Element/helpers/declaredAttributes.ts
3
3
  var t = (e, t) => {
4
4
  if (typeof t != "string") return t;
@@ -1,5 +1,4 @@
1
- import { toBuilderParams as e, toInteractionCallback as t } from "@plitzi/sdk-shared/authoring/builder";
2
- import { BUILTIN_ELEMENT_CALLBACKS as n } from "@plitzi/sdk-shared/authoring/elementCallbacks";
1
+ import { BUILTIN_ELEMENT_CALLBACKS as e, toBuilderParams as t, toInteractionCallback as n } from "@plitzi/sdk-shared/authoring";
3
2
  //#region src/Element/helpers/getInteractions.ts
4
3
  var r = (e, t) => (n) => {
5
4
  let { category: r } = n;
@@ -14,13 +13,13 @@ var r = (e, t) => (n) => {
14
13
  label: `Selector - ${e}`
15
14
  }))] : [];
16
15
  }, i = (i, a, o, s, c) => {
17
- let l = n.setState, u = e(l.params), d = n.toggleState, f = e(d.params), p = {
16
+ let l = e.setState, u = t(l.params), d = e.toggleState, f = t(d.params), p = {
18
17
  type: "select",
19
18
  options: r(i, a),
20
19
  when: (e) => e.category === "attribute" || e.category === "state"
21
20
  };
22
21
  return {
23
- setState: t("setState", l, o, {
22
+ setState: n("setState", l, o, {
24
23
  title: `Update ${a.label}`,
25
24
  postCallback: s,
26
25
  params: {
@@ -48,7 +47,7 @@ var r = (e, t) => (n) => {
48
47
  }
49
48
  }
50
49
  }),
51
- toggleState: t("toggleState", d, c, {
50
+ toggleState: n("toggleState", d, c, {
52
51
  title: `Toggle ${a.label}`,
53
52
  postCallback: s,
54
53
  params: {
@@ -6,8 +6,8 @@ import { omitKeys as i } from "../helpers/omitKeys.mjs";
6
6
  import a from "../hooks/useElementInternal.mjs";
7
7
  import o from "@plitzi/plitzi-ui/ErrorBoundary";
8
8
  import { Profiler as s, use as c, useEffect as l, useId as u, useMemo as d, useRef as f } from "react";
9
- import p from "@plitzi/sdk-event-bridge/hooks/useEventBridge";
10
- import m from "@plitzi/sdk-shared/hooks/usePlitzi";
9
+ import { useEventBridge as p } from "@plitzi/sdk-event-bridge";
10
+ import { usePlitzi as m } from "@plitzi/sdk-shared/hooks";
11
11
  import { useCommonStore as h } from "@plitzi/sdk-shared/store";
12
12
  import { diffProps as g, tracingCollector as _ } from "@plitzi/sdk-shared/store/tracing";
13
13
  import { jsx as v } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  import e from "./useElement.mjs";
2
2
  import { use as t, useCallback as n, useMemo as r } from "react";
3
- import i from "@plitzi/sdk-shared/hooks/usePlitzi";
4
- import a from "@plitzi/sdk-shared/builder/contexts/BuilderContext";
3
+ import { usePlitzi as i } from "@plitzi/sdk-shared/hooks";
4
+ import { BuilderContext as a } from "@plitzi/sdk-shared/builder/contexts";
5
5
  //#region src/Element/hooks/useEditableContent.ts
6
6
  var o = (e) => typeof e == "string" ? e : typeof e == "number" ? `${e}` : e == null ? "" : JSON.stringify(e), s = (s) => {
7
7
  let { id: c } = e(), { settings: { previewMode: l } } = i(), u = t(a);
@@ -1,6 +1,6 @@
1
1
  import { useMemo as e } from "react";
2
2
  import { useCommonStore as t } from "@plitzi/sdk-shared/store";
3
- import { isRecord as n } from "@plitzi/sdk-shared/helpers/isRecord";
3
+ import { isRecord as n } from "@plitzi/sdk-shared/helpers";
4
4
  import { templatePaths as r } from "@plitzi/sdk-shared/helpers/twigWrapper";
5
5
  //#region src/Element/hooks/useElementDataSource.ts
6
6
  var i = ({ source: e, transformers: t, when: n }) => {
@@ -8,9 +8,9 @@ import o from "../helpers/parseStyleSelectors.mjs";
8
8
  import { useMemo as s } from "react";
9
9
  import { useCommonStore as c } from "@plitzi/sdk-shared/store";
10
10
  import { get as l } from "@plitzi/plitzi-ui/helpers";
11
- import u from "@plitzi/sdk-shared/dataSource/getBindingsDetails";
11
+ import { getBindingsDetails as u } from "@plitzi/sdk-shared/dataSource";
12
12
  import { hasValidToken as d, processTwig as f, templatePaths as p } from "@plitzi/sdk-shared/helpers/twigWrapper";
13
- import { COMPONENT_PROPS_SOURCE as m } from "@plitzi/sdk-shared/schema/schemaConstants";
13
+ import { COMPONENT_PROPS_SOURCE as m } from "@plitzi/sdk-shared/schema";
14
14
  //#region src/Element/hooks/useElementInternal.ts
15
15
  var h = { settled: /* @__PURE__ */ new Set([m]) }, g = (e, t, n) => {
16
16
  let { queryParams: r = {}, routeParams: i = {}, variables: a = {}, origin: o = "", navigation: s, ...c } = n, l = {
@@ -1,5 +1,5 @@
1
1
  import { useEffect as e, useState as t } from "react";
2
- import n from "@plitzi/sdk-shared/hooks/usePlitzi";
2
+ import { usePlitzi as n } from "@plitzi/sdk-shared/hooks";
3
3
  //#region src/Element/hooks/useElementVisible.ts
4
4
  var r = (e) => typeof e.checkVisibility == "function" ? e.checkVisibility() : e.getClientRects().length > 0, i = (i) => {
5
5
  let { utils: { rootRef: a } } = n(), [o, s] = t(void 0);
@@ -1,7 +1,7 @@
1
1
  import { isVisible as e } from "../helpers/isVisible.mjs";
2
2
  import { useMemo as t } from "react";
3
3
  import n from "clsx";
4
- import { HIDDEN_CLASS as r } from "@plitzi/sdk-shared/style/styleStates";
4
+ import { HIDDEN_CLASS as r } from "@plitzi/sdk-shared/style";
5
5
  //#region src/Element/hooks/useInternalClassName.ts
6
6
  var i = ({ id: i, className: a, previewMode: o, baseElementId: s, plitziElementLayout: c, definition: l, elementState: u }) => {
7
7
  let { items: d } = l, f = e(u.visibility);
@@ -4,9 +4,9 @@ import r from "../ServerStaticShell.mjs";
4
4
  import { Fragment as i, isValidElement as a, use as o, useMemo as s, useRef as c, useSyncExternalStore as l } from "react";
5
5
  import { useCommonStore as u } from "@plitzi/sdk-shared/store";
6
6
  import { get as d } from "@plitzi/plitzi-ui/helpers";
7
- import f from "@plitzi/sdk-shared/elements/ComponentContext";
7
+ import { ComponentContext as f } from "@plitzi/sdk-shared/elements";
8
8
  import { passesFlagGate as p } from "@plitzi/sdk-shared/flags";
9
- import m from "@plitzi/sdk-shared/plugins/PluginsContext";
9
+ import { PluginsContext as m } from "@plitzi/sdk-shared/plugins";
10
10
  import { jsx as h } from "react/jsx-runtime";
11
11
  //#region src/Element/hooks/useInternalItems.tsx
12
12
  var g = typeof window > "u", _ = "#layout-body", v = "#children", y = {}, b = () => () => {}, x = () => !0, S = () => !1, C = ({ id: C, definition: w, plitziElementLayout: T, children: E, previewMode: D, visible: O = !0 }) => {
@@ -1,5 +1,5 @@
1
1
  import { useEffect as e, useMemo as t } from "react";
2
- import { INTERVAL_TRIGGER as n, intervalOf as r } from "@plitzi/sdk-shared/helpers/interval";
2
+ import { INTERVAL_TRIGGER as n, intervalOf as r } from "@plitzi/sdk-shared/helpers";
3
3
  //#region src/Element/hooks/useIntervalTriggers.ts
4
4
  var i = ({ id: i, interactions: a, previewMode: o, interactionsManager: s }) => {
5
5
  let c = t(() => [...new Set(Object.values(a ?? {}).flatMap((e) => {
@@ -1,5 +1,5 @@
1
1
  import { useEffect as e, useMemo as t } from "react";
2
- import { KEY_TRIGGER as n, isFieldEditing as r, keyPressCombo as i, parseKeys as a } from "@plitzi/sdk-shared/helpers/keys";
2
+ import { KEY_TRIGGER as n, isFieldEditing as r, keyPressCombo as i, parseKeys as a } from "@plitzi/sdk-shared/helpers";
3
3
  //#region src/Element/hooks/useKeyTriggers.ts
4
4
  var o = "input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]", s = (e) => e instanceof Element && e.closest(o) !== null, c = () => /Mac|iPhone|iPad|iPod/.test(navigator.userAgent), l = ({ id: o, interactions: l, previewMode: u, interactionsManager: d }) => {
5
5
  let f = t(() => [...new Set(Object.values(l ?? {}).flatMap((e) => {
@@ -1,4 +1,4 @@
1
- import { LayoutLink } from '@plitzi/sdk-shared/schema/layoutChain';
1
+ import { LayoutLink } from '@plitzi/sdk-shared/schema';
2
2
  /**
3
3
  * The shells around a page, innermost first — see `resolveLayoutChain`.
4
4
  *
@@ -1,13 +1,13 @@
1
1
  import { useCallback as e, useContext as t, useRef as n, useSyncExternalStore as r } from "react";
2
- import { StoreContext as i } from "@plitzi/nexus/react";
3
- import { resolveLayoutChain as a } from "@plitzi/sdk-shared/schema/layoutChain";
2
+ import { resolveLayoutChain as i } from "@plitzi/sdk-shared/schema";
3
+ import { StoreContext as a } from "@plitzi/nexus/react";
4
4
  //#region src/Element/hooks/useLayoutChain.ts
5
5
  var o = [], s = (e, t) => e.length === t.length && e.every((e, n) => e.layout === t[n].layout && e.slot === t[n].slot), c = (e) => typeof e == "object" && !!e && "definition" in e && "attributes" in e, l = (e) => (t) => {
6
6
  let n = e(`schema.flat.${t}`);
7
7
  return c(n) ? n : void 0;
8
8
  }, u = (c, u) => {
9
- let d = t(i), f = n(o), p = e((e) => d ? d.subscribePath("schema.flat", e) : () => void 0, [d]), m = e(() => {
10
- let e = c && d ? a(l((e) => d.getPath(e)), c, u) : o;
9
+ let d = t(a), f = n(o), p = e((e) => d ? d.subscribePath("schema.flat", e) : () => void 0, [d]), m = e(() => {
10
+ let e = c && d ? i(l((e) => d.getPath(e)), c, u) : o;
11
11
  return s(f.current, e) || (f.current = e), f.current;
12
12
  }, [
13
13
  d,
@@ -1,7 +1,7 @@
1
1
  import e from "./useElement.mjs";
2
2
  import { use as t, useCallback as n } from "react";
3
- import r from "@plitzi/sdk-shared/hooks/usePlitzi";
4
- import i from "@plitzi/sdk-interactions/InteractionsContext";
3
+ import { usePlitzi as r } from "@plitzi/sdk-shared/hooks";
4
+ import { InteractionsContext as i } from "@plitzi/sdk-interactions";
5
5
  //#region src/Element/hooks/usePluginTrigger.ts
6
6
  var a = (a) => {
7
7
  let { id: o } = e(), { settings: { previewMode: s = !0 } } = r(), { interactionsManager: c } = t(i);
@@ -1,26 +1,25 @@
1
- import e from "./useElementInteractions.mjs";
2
- import t from "./useInternalClassName.mjs";
3
- import n from "./useIntervalTriggers.mjs";
4
- import r from "./useKeyTriggers.mjs";
5
- import i from "./useScrollInteractions.mjs";
6
- import { interactionBasicTriggers as a, nativeEventsList as o } from "../helpers/elementConstants.mjs";
1
+ import { interactionBasicTriggers as e, nativeEventsList as t } from "../helpers/elementConstants.mjs";
2
+ import n from "./useElementInteractions.mjs";
3
+ import r from "./useInternalClassName.mjs";
4
+ import i from "./useIntervalTriggers.mjs";
5
+ import a from "./useKeyTriggers.mjs";
6
+ import o from "./useScrollInteractions.mjs";
7
7
  import { use as s, useCallback as c, useContext as l, useEffect as u, useEffectEvent as d, useMemo as f, useRef as p } from "react";
8
- import { isRecord as m } from "@plitzi/sdk-shared/helpers/isRecord";
9
- import { get as h } from "@plitzi/plitzi-ui/helpers";
10
- import { StoreContext as g } from "@plitzi/nexus/react";
11
- import { emptyObject as _ } from "@plitzi/sdk-shared/helpers/utils";
12
- import v from "clsx";
13
- import y from "@plitzi/sdk-interactions/InteractionsContext";
14
- import { liveSources as b } from "@plitzi/sdk-shared/dataSource";
15
- import { pConsole as x } from "@plitzi/sdk-shared/devTools/utils/PlitziConsole";
8
+ import { emptyObject as m, isRecord as h } from "@plitzi/sdk-shared/helpers";
9
+ import { get as g } from "@plitzi/plitzi-ui/helpers";
10
+ import { liveSources as _ } from "@plitzi/sdk-shared/dataSource";
11
+ import { StoreContext as v } from "@plitzi/nexus/react";
12
+ import y from "clsx";
13
+ import { InteractionsContext as b } from "@plitzi/sdk-interactions";
14
+ import { pConsole as x } from "@plitzi/sdk-shared/devTools";
16
15
  //#region src/Element/hooks/useRootElementInteractions.ts
17
- var S = /* @__PURE__ */ new WeakSet(), C = (e) => "nativeEvent" in e && m(e.nativeEvent) ? e.nativeEvent : e, w = ({ elementContext: w, previewMode: T, debugMode: E, baseElementId: D, className: O, interactionTriggers: k, interactionCallbacks: A, otherProps: j, ref: M }) => {
18
- let { id: N, className: P, attributes: F, definition: I, definition: { interactions: L }, plitziElementLayout: R, elementState: z, setElementState: B } = w, { interactionsManager: V, useInteractions: H } = s(y), U = c((e, t, n, r, i = !1) => {
16
+ var S = /* @__PURE__ */ new WeakSet(), C = (e) => "nativeEvent" in e && h(e.nativeEvent) ? e.nativeEvent : e, w = ({ elementContext: w, previewMode: T, debugMode: E, baseElementId: D, className: O, interactionTriggers: k, interactionCallbacks: A, otherProps: j, ref: M }) => {
17
+ let { id: N, className: P, attributes: F, definition: I, definition: { interactions: L }, plitziElementLayout: R, elementState: z, setElementState: B } = w, { interactionsManager: V, useInteractions: H } = s(b), U = c((e, t, n, r, i = !1) => {
19
18
  i || e.preventDefault(), r && r(e);
20
19
  let a = C(e);
21
20
  S.has(a) || (i || S.add(a), V.interactionTrigger(t, n, { event: e }));
22
- }, [V]), W = f(() => !T || !L ? {} : Object.values(L).filter((e) => e.type === "trigger" && e.action && o.includes(e.action) && e.enabled).reduce((e, t) => {
23
- let n = h(t, "params.propagateEvent", !1);
21
+ }, [V]), W = f(() => !T || !L ? {} : Object.values(L).filter((e) => e.type === "trigger" && e.action && t.includes(e.action) && e.enabled).reduce((e, t) => {
22
+ let n = g(t, "params.propagateEvent", !1);
24
23
  return {
25
24
  ...e,
26
25
  [t.action]: (e) => U(e, N, t.action, j[t.action], n)
@@ -31,17 +30,17 @@ var S = /* @__PURE__ */ new WeakSet(), C = (e) => "nativeEvent" in e && m(e.nati
31
30
  j,
32
31
  T,
33
32
  U
34
- ]), G = l(g), K = c(() => {
33
+ ]), G = l(v), K = c(() => {
35
34
  let e = G?.getPath("runtime.sources");
36
- return b(m(e) ? e : _, G?.getPath("runtime.state"), G?.getPath("schema.settings.computed"));
35
+ return _(h(e) ? e : m, G?.getPath("runtime.state"), G?.getPath("schema.settings.computed"));
37
36
  }, [G]), q = c(() => ({ dataSource: K() }), [K]), J = f(() => ({
38
- ...a,
37
+ ...e,
39
38
  ...k
40
- }), [k]), Y = p(null), X = M ?? Y, Z = e({
39
+ }), [k]), Y = p(null), X = M ?? Y, Z = n({
41
40
  attributes: F,
42
41
  definition: I,
43
42
  setElementState: B
44
- }), Q = i({
43
+ }), Q = o({
45
44
  id: N,
46
45
  label: I.label,
47
46
  nodeRef: X,
@@ -63,12 +62,12 @@ var S = /* @__PURE__ */ new WeakSet(), C = (e) => "nativeEvent" in e && m(e.nati
63
62
  Z
64
63
  ]),
65
64
  getAdditionalParams: q
66
- }), r({
65
+ }), a({
67
66
  id: N,
68
67
  interactions: L,
69
68
  previewMode: T,
70
69
  interactionsManager: V
71
- }), n({
70
+ }), i({
72
71
  id: N,
73
72
  interactions: L,
74
73
  previewMode: T,
@@ -92,7 +91,7 @@ var S = /* @__PURE__ */ new WeakSet(), C = (e) => "nativeEvent" in e && m(e.nati
92
91
  K,
93
92
  N
94
93
  ]);
95
- let ee = t({
94
+ let ee = r({
96
95
  id: N,
97
96
  className: O,
98
97
  previewMode: T,
@@ -102,7 +101,7 @@ var S = /* @__PURE__ */ new WeakSet(), C = (e) => "nativeEvent" in e && m(e.nati
102
101
  plitziElementLayout: R
103
102
  });
104
103
  return {
105
- className: v(P, ee),
104
+ className: y(P, ee),
106
105
  events: W,
107
106
  nodeRef: X
108
107
  };
@@ -16,7 +16,7 @@ declare const useRscData: <T>() => {
16
16
  isServerElement: boolean;
17
17
  /** A refresh asking about this element — or about the whole payload of this page — is in flight. */
18
18
  refreshing: boolean;
19
- refresh: (ids?: string[], params?: Record<string, string>, { fresh }?: Pick<import('@plitzi/sdk-shared').RscRefreshOptions, "fresh">) => Promise<void>;
19
+ refresh: (ids?: string[], params?: Record<string, string>, { fresh }?: Pick<import('@plitzi/sdk-shared/server').RscRefreshOptions, "fresh">) => Promise<void>;
20
20
  /** Stops this element's refresh in flight, here and on the server; what it shows stays. */
21
21
  cancel: () => void;
22
22
  };
@@ -2,8 +2,7 @@ import e from "./useElement.mjs";
2
2
  import { useCallback as t, useRef as n } from "react";
3
3
  import { useCommonStore as r } from "@plitzi/sdk-shared/store";
4
4
  import { useStoreById as i } from "@plitzi/nexus/react";
5
- import { cancelRsc as a, currentRscLocation as o, rscDataPath as s } from "@plitzi/sdk-shared/server/rsc/refreshRsc";
6
- import c from "@plitzi/sdk-shared/server/rsc/useRscRefresh";
5
+ import { cancelRsc as a, currentRscLocation as o, rscDataPath as s, useRscRefresh as c } from "@plitzi/sdk-shared/server";
7
6
  //#region src/Element/hooks/useRscData.ts
8
7
  var l = () => {
9
8
  let { id: l, rootId: u } = e(), [[d = !1, f = !1, p = !1, m, h, g, _, v]] = r([
@@ -1,23 +1,22 @@
1
1
  import { useEffect as e, useMemo as t } from "react";
2
- import { toInteractionCallbacks as n } from "@plitzi/sdk-shared/authoring/builder";
3
- import { SCROLL_CALLBACKS as r } from "@plitzi/sdk-shared/authoring/elementCallbacks";
4
- import { SCROLL_BEHAVIORS as i, SCROLL_POSITIONS as a, SCROLL_TRIGGER as o, scrollDistance as s, scrollPosition as c, scrollState as l } from "@plitzi/sdk-shared/helpers/scroll";
2
+ import { SCROLL_BEHAVIORS as n, SCROLL_POSITIONS as r, SCROLL_TRIGGER as i, scrollDistance as a, scrollPosition as o, scrollState as s } from "@plitzi/sdk-shared/helpers";
3
+ import { SCROLL_CALLBACKS as c, toInteractionCallbacks as l } from "@plitzi/sdk-shared/authoring";
5
4
  //#region src/Element/hooks/useScrollInteractions.ts
6
- var u = (e) => i.find((t) => t === e) ?? "smooth", d = (e, t) => a.find((t) => t === e) ?? t, f = ({ id: i, label: a, nodeRef: f, interactions: p, previewMode: m, interactionsManager: h }) => {
7
- let g = t(() => n(r, {
5
+ var u = (e) => n.find((t) => t === e) ?? "smooth", d = (e, t) => r.find((t) => t === e) ?? t, f = ({ id: n, label: r, nodeRef: f, interactions: p, previewMode: m, interactionsManager: h }) => {
6
+ let g = t(() => l(c, {
8
7
  scrollBy: (e) => {
9
8
  let t = f.current;
10
9
  t?.scrollBy({
11
- left: s(e.x, t.clientWidth) ?? 0,
12
- top: s(e.y, t.clientHeight) ?? 0,
10
+ left: a(e.x, t.clientWidth) ?? 0,
11
+ top: a(e.y, t.clientHeight) ?? 0,
13
12
  behavior: u(e.behavior)
14
13
  });
15
14
  },
16
15
  scrollTo: (e) => {
17
16
  let t = f.current;
18
17
  t && t.scrollTo({
19
- left: c(e.x, t.scrollWidth, t.clientWidth) ?? t.scrollLeft,
20
- top: c(e.y, t.scrollHeight, t.clientHeight) ?? t.scrollTop,
18
+ left: o(e.x, t.scrollWidth, t.clientWidth) ?? t.scrollLeft,
19
+ top: o(e.y, t.scrollHeight, t.clientHeight) ?? t.scrollTop,
21
20
  behavior: u(e.behavior)
22
21
  });
23
22
  },
@@ -29,25 +28,25 @@ var u = (e) => i.find((t) => t === e) ?? "smooth", d = (e, t) => a.find((t) => t
29
28
  });
30
29
  }
31
30
  }, {
32
- scrollBy: { title: `Scroll ${a} by` },
33
- scrollTo: { title: `Scroll ${a} to` },
34
- scrollIntoView: { title: `Scroll to ${a}` }
35
- }), [a, f]), _ = t(() => Object.values(p ?? {}).some((e) => e.type === "trigger" && e.action === o && e.enabled), [p]);
31
+ scrollBy: { title: `Scroll ${r} by` },
32
+ scrollTo: { title: `Scroll ${r} to` },
33
+ scrollIntoView: { title: `Scroll to ${r}` }
34
+ }), [r, f]), _ = t(() => Object.values(p ?? {}).some((e) => e.type === "trigger" && e.action === i && e.enabled), [p]);
36
35
  return e(() => {
37
36
  let e = f.current;
38
37
  if (!m || !_ || !e || typeof window > "u") return;
39
- let t = 0, n = () => {
38
+ let t = 0, r = () => {
40
39
  t = 0;
41
- let n = l(e);
42
- h.interactionTrigger(i, o, n);
43
- }, r = () => {
44
- t === 0 && (t = window.requestAnimationFrame(n));
40
+ let r = s(e);
41
+ h.interactionTrigger(n, i, r);
42
+ }, a = () => {
43
+ t === 0 && (t = window.requestAnimationFrame(r));
45
44
  };
46
- return e.addEventListener("scroll", r, { passive: !0 }), t = window.requestAnimationFrame(n), () => {
47
- e.removeEventListener("scroll", r), window.cancelAnimationFrame(t);
45
+ return e.addEventListener("scroll", a, { passive: !0 }), t = window.requestAnimationFrame(r), () => {
46
+ e.removeEventListener("scroll", a), window.cancelAnimationFrame(t);
48
47
  };
49
48
  }, [
50
- i,
49
+ n,
51
50
  h,
52
51
  _,
53
52
  f,