@plitzi/sdk-server 0.37.7 → 0.37.9

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 (38) hide show
  1. package/CHANGELOG.md +255 -0
  2. package/README.md +7 -2
  3. package/dist/actions.d.ts +1 -1
  4. package/dist/adapters/cloudAdapters.js +4 -30
  5. package/dist/core/services/functionRoutes.d.ts +2 -2
  6. package/dist/core/services/functionRoutes.js +2 -2
  7. package/dist/functions-api.d.ts +23 -2
  8. package/dist/functions.d.ts +1 -1
  9. package/dist/functions.js +2 -2
  10. package/dist/modules/actions/index.d.ts +1 -1
  11. package/dist/modules/actions/index.js +3 -2
  12. package/dist/modules/actions/runtime/renderResolver.js +30 -4
  13. package/dist/modules/actions/taskCatalog.d.ts +3 -1
  14. package/dist/modules/actions/taskCatalog.js +1 -0
  15. package/dist/modules/actions/tasks/registry.js +4 -2
  16. package/dist/modules/actions/types.d.ts +6 -0
  17. package/dist/modules/functions/config.d.ts +19 -3
  18. package/dist/modules/functions/config.js +30 -14
  19. package/dist/modules/functions/contract.d.ts +10 -3
  20. package/dist/modules/functions/driver.js +4 -2
  21. package/dist/modules/functions/manifest.d.ts +5 -3
  22. package/dist/modules/functions/manifest.js +36 -5
  23. package/dist/modules/functions/routes.d.ts +1 -1
  24. package/dist/modules/functions/routes.js +3 -3
  25. package/dist/modules/functions/space.d.ts +7 -5
  26. package/dist/modules/functions/space.js +17 -10
  27. package/dist/modules/runtime/contract.d.ts +1 -1
  28. package/dist/modules/runtime/stages.d.ts +1 -1
  29. package/dist/modules/runtime/stages.js +1 -1
  30. package/dist/modules/ssr/prepareRender.js +2 -2
  31. package/dist/modules/ssr/registerExternalPlugins.d.ts +5 -1
  32. package/dist/modules/ssr/registerExternalPlugins.js +6 -2
  33. package/package.json +3 -3
  34. package/skills/plitzi-authoring/SKILL.md +11 -8
  35. package/skills/plitzi-authoring/reference/components.md +75 -0
  36. package/skills/plitzi-authoring/reference/flows.md +1 -1
  37. package/skills/plitzi-authoring/reference/plugins.md +12 -0
  38. package/skills/plitzi-authoring/reference/templates-and-export.md +6 -0
@@ -134,6 +134,18 @@ A plugin says what HAPPENED through its events (`onPick`, with the seat in the p
134
134
  decide what that means — write `state`, open a modal, call a server action. Prefer that to writing `state` from inside
135
135
  the component: the flow is visible in the space, the builder shows it, and the same act can come from a button too.
136
136
 
137
+ ## Behaving in the builder
138
+
139
+ The builder draws the element on its canvas while somebody edits the page: a click selects it, a drag moves it, a key
140
+ belongs to the editor.
141
+
142
+ - **Outside preview, do nothing on your own.** `usePlitziServiceContext().settings.previewMode` is `false` while the
143
+ page is edited. Declared interactions are already held back then; your own click handlers, timers, global listeners,
144
+ permission prompts and map gestures are not — gate them on `previewMode`, and still render something to select.
145
+ - **Never the global `window` or `document`.** The canvas is a frame of its own and the code runs in the builder's
146
+ window: listen, measure and go full screen through the node's own page (`ref.current.ownerDocument`, its
147
+ `defaultView`) or `usePlitziServiceContext().utils.getWindow()`. An `instanceof` check takes its class from there too.
148
+
137
149
  ## Components that draw into DOM they do not render
138
150
 
139
151
  A map, a chart library, anything that positions its own markers or popups: its roots are the library's to place. Never
@@ -27,6 +27,12 @@ Never rewrite an exported space by hand. `specFromSpace({ schema, style })` read
27
27
  `compareSpaces(original, authorSpace(spec))` must list nothing but what `corrections` explains. The builder's
28
28
  **Export** does all three. Edit the code from then on — and tidy it as you go ([structure.md](structure.md)).
29
29
 
30
+ A server action reads back the same way: `actionSpecFromEntry({ id, document })` gives the `defineAction` spec that writes
31
+ it — only when that spec writes the very same document, otherwise `reason` says why and it stays JSON — and
32
+ `actionToSource(spec)` writes the module. For the whole space as a project — pages, actions, functions, the source of
33
+ its plugins and runtime, its files — use `plitzi create --from <space>` (and `plitzi pull` later) rather than exporting
34
+ the parts by hand.
35
+
30
36
  For a document you did not author — an export, a JSON edited by hand — run the gate before serving it:
31
37
  `validateSpace({ schema, style })`.
32
38