@plitzi/plitzi-builder 0.37.8 → 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 (103) hide show
  1. package/CHANGELOG.md +247 -0
  2. package/dist/index.html +2 -2
  3. package/dist/modules/App/components/AppHeader/QuotaBreakdown.d.ts +7 -6
  4. package/dist/modules/App/components/VersionContents/PluginList.d.ts +7 -0
  5. package/dist/modules/App/components/VersionContents/VersionContents.d.ts +14 -0
  6. package/dist/modules/App/components/VersionContents/helpers.d.ts +8 -0
  7. package/dist/modules/App/components/VersionContents/helpers.test.d.ts +1 -0
  8. package/dist/modules/App/components/VersionContents/index.d.ts +2 -0
  9. package/dist/modules/App/components/VersionContents/useVersionContents.d.ts +8 -0
  10. package/dist/modules/Builder/BuilderProvider.d.ts +1 -1
  11. package/dist/modules/Components/Components.d.ts +6 -0
  12. package/dist/modules/Components/components/ComponentBanner/ComponentBanner.d.ts +7 -0
  13. package/dist/modules/Components/components/ComponentBanner/index.d.ts +1 -0
  14. package/dist/modules/Components/components/ComponentForm/ComponentForm.d.ts +19 -0
  15. package/dist/modules/Components/components/ComponentForm/SlotChoice.d.ts +8 -0
  16. package/dist/modules/Components/components/ComponentForm/index.d.ts +1 -0
  17. package/dist/modules/Components/components/ComponentItem/ComponentItem.d.ts +12 -0
  18. package/dist/modules/Components/components/ComponentItem/index.d.ts +1 -0
  19. package/dist/modules/Components/components/InstanceTools/InstanceTools.d.ts +10 -0
  20. package/dist/modules/Components/components/InstanceTools/SlotRow.d.ts +13 -0
  21. package/dist/modules/Components/components/InstanceTools/index.d.ts +1 -0
  22. package/dist/modules/Components/components/PropsEditor/PropRow.d.ts +14 -0
  23. package/dist/modules/Components/components/PropsEditor/PropsEditor.d.ts +11 -0
  24. package/dist/modules/Components/components/PropsEditor/index.d.ts +2 -0
  25. package/dist/modules/Components/helpers.d.ts +17 -0
  26. package/dist/modules/Components/helpers.test.d.ts +1 -0
  27. package/dist/modules/Components/index.d.ts +2 -0
  28. package/dist/modules/Components/slotChoices.d.ts +9 -0
  29. package/dist/modules/Components/useOpenComponent.d.ts +13 -0
  30. package/dist/modules/Components/useSaveAsComponent.d.ts +7 -0
  31. package/dist/modules/Elements/ElementHelper.d.ts +3 -2
  32. package/dist/modules/Elements/hooks/useDragElement.d.ts +3 -2
  33. package/dist/modules/Functions/Functions.d.ts +4 -3
  34. package/dist/modules/Functions/components/FunctionInspector/FunctionInspector.d.ts +20 -0
  35. package/dist/modules/Functions/components/FunctionInspector/components/InspectorSection/InspectorSection.d.ts +10 -0
  36. package/dist/modules/Functions/components/FunctionInspector/components/InspectorSection/index.d.ts +3 -0
  37. package/dist/modules/Functions/components/FunctionInspector/components/TaskTest/TaskTest.d.ts +16 -0
  38. package/dist/modules/Functions/components/FunctionInspector/components/TaskTest/index.d.ts +3 -0
  39. package/dist/modules/Functions/components/FunctionInspector/components/TimeLimit/TimeLimit.d.ts +16 -0
  40. package/dist/modules/Functions/components/FunctionInspector/components/TimeLimit/index.d.ts +3 -0
  41. package/dist/modules/Functions/components/FunctionInspector/components/TryField/TryField.d.ts +10 -0
  42. package/dist/modules/Functions/components/FunctionInspector/components/TryField/index.d.ts +3 -0
  43. package/dist/modules/Functions/components/FunctionInspector/components/TryResult/TryResult.d.ts +9 -0
  44. package/dist/modules/Functions/components/FunctionInspector/components/TryResult/index.d.ts +3 -0
  45. package/dist/modules/Functions/components/FunctionInspector/index.d.ts +3 -0
  46. package/dist/modules/Functions/components/FunctionsEditor/FunctionsEditor.d.ts +20 -0
  47. package/dist/modules/Functions/components/FunctionsEditor/index.d.ts +3 -0
  48. package/dist/modules/Functions/components/FunctionsGuide/FunctionsGuide.d.ts +7 -0
  49. package/dist/modules/Functions/components/FunctionsGuide/index.d.ts +3 -0
  50. package/dist/modules/Functions/components/FunctionsHeader/FunctionsHeader.d.ts +17 -0
  51. package/dist/modules/Functions/components/FunctionsHeader/index.d.ts +3 -0
  52. package/dist/modules/Functions/components/FunctionsProblems/FunctionsProblems.d.ts +2 -1
  53. package/dist/modules/Functions/components/FunctionsSidebar/FunctionsSidebar.d.ts +30 -0
  54. package/dist/modules/Functions/components/FunctionsSidebar/components/FileItem/FileItem.d.ts +14 -0
  55. package/dist/modules/Functions/components/FunctionsSidebar/components/FileItem/index.d.ts +3 -0
  56. package/dist/modules/Functions/components/FunctionsSidebar/components/FolderItem/FolderItem.d.ts +7 -0
  57. package/dist/modules/Functions/components/FunctionsSidebar/components/FolderItem/index.d.ts +3 -0
  58. package/dist/modules/Functions/components/FunctionsSidebar/components/NewFile/NewFile.d.ts +7 -0
  59. package/dist/modules/Functions/components/FunctionsSidebar/components/NewFile/index.d.ts +3 -0
  60. package/dist/modules/Functions/components/FunctionsSidebar/components/NewTask/NewTask.d.ts +13 -0
  61. package/dist/modules/Functions/components/FunctionsSidebar/components/NewTask/index.d.ts +3 -0
  62. package/dist/modules/Functions/components/FunctionsSidebar/components/RouteItem/RouteItem.d.ts +9 -0
  63. package/dist/modules/Functions/components/FunctionsSidebar/components/RouteItem/index.d.ts +3 -0
  64. package/dist/modules/Functions/components/FunctionsSidebar/components/SidebarSection/SidebarSection.d.ts +13 -0
  65. package/dist/modules/Functions/components/FunctionsSidebar/components/SidebarSection/index.d.ts +3 -0
  66. package/dist/modules/Functions/components/FunctionsSidebar/components/TaskItem/TaskItem.d.ts +16 -0
  67. package/dist/modules/Functions/components/FunctionsSidebar/components/TaskItem/index.d.ts +3 -0
  68. package/dist/modules/Functions/components/FunctionsSidebar/index.d.ts +3 -0
  69. package/dist/modules/Functions/components/FunctionsWelcome/FunctionsWelcome.d.ts +6 -0
  70. package/dist/modules/Functions/components/FunctionsWelcome/index.d.ts +3 -0
  71. package/dist/modules/Functions/editor/paths.d.ts +9 -0
  72. package/dist/modules/Functions/editor/source.d.ts +60 -0
  73. package/dist/modules/Functions/editor/source.test.d.ts +1 -0
  74. package/dist/modules/Functions/editor/typescriptWorker.d.ts +26 -0
  75. package/dist/modules/Functions/editor/useFunctionsTypeScript.d.ts +5 -2
  76. package/dist/modules/Functions/helpers.d.ts +119 -1
  77. package/dist/modules/Interactions/components/Workflow/helpers/nodeOptions.d.ts +22 -0
  78. package/dist/modules/Interactions/components/Workflow/helpers/nodeOptions.test.d.ts +1 -0
  79. package/dist/modules/Queue/QueueContext.d.ts +2 -5
  80. package/dist/modules/Space/hooks/useSpaceUsage.d.ts +36 -0
  81. package/dist/modules/Undoable/UndoableContext.d.ts +2 -5
  82. package/dist/package.json.d.ts +4 -3
  83. package/dist/plitzi-builder.css +1 -1
  84. package/dist/plitzi-builder.css.gz +0 -0
  85. package/dist/plitzi-builder.js +1564 -1519
  86. package/dist/plitzi-builder.js.gz +0 -0
  87. package/dist/plitzi-functions-worker.js +3 -3
  88. package/package.json +18 -17
  89. package/dist/modules/Builder/BuilderPopup.d.ts +0 -6
  90. package/dist/modules/Functions/components/FunctionsDeclared/FunctionsDeclared.d.ts +0 -10
  91. package/dist/modules/Functions/components/FunctionsDeclared/index.d.ts +0 -3
  92. package/dist/modules/Functions/components/FunctionsFiles/FunctionsFiles.d.ts +0 -11
  93. package/dist/modules/Functions/components/FunctionsFiles/index.d.ts +0 -3
  94. package/dist/modules/Functions/components/FunctionsTry/FunctionsTry.d.ts +0 -13
  95. package/dist/modules/Functions/components/FunctionsTry/index.d.ts +0 -3
  96. package/dist/modules/Segments/Segment.d.ts +0 -11
  97. package/dist/modules/Segments/Segments.d.ts +0 -2
  98. package/dist/modules/Segments/SegmentsContextProvider.d.ts +0 -7
  99. package/dist/modules/Segments/SegmentsReducer.d.ts +0 -133
  100. package/dist/modules/Segments/index.d.ts +0 -3
  101. package/dist/modules/Segments/models/PublishForm.d.ts +0 -19
  102. package/dist/modules/Segments/models/SegmentForm.d.ts +0 -17
  103. package/dist/modules/Space/hooks/useAccountUsage.d.ts +0 -60
package/CHANGELOG.md CHANGED
@@ -1,5 +1,252 @@
1
1
  # @plitzi/plitzi-builder
2
2
 
3
+ ## 0.37.9
4
+
5
+ ### Patch Changes
6
+
7
+ - 3ae61a4: ## Components replace segments
8
+
9
+ - **What a component is:** a reusable block written once and placed anywhere as an instance. An edit to the component
10
+ is an edit to every instance.
11
+ - **Where it lives:** in the space document, as `schema.components`, one tree per component and never in
12
+ `schema.flat`. It is published, rolled back, copied by templates and exported with the space.
13
+ - **Props and slots:**
14
+ - A component declares props (`type`, `description`, `required`, `default`, `options`). An instance hands them in
15
+ as its own attributes, so templates and bindings reach them. Inside, they are read as `{{ props.<name> }}`.
16
+ - Slots are elements an instance fills; each child names its slot in `attributes.slot`.
17
+ - **A prop an instance leaves out prints nothing.** It is its `default`, or `null`. `props` is a settled source:
18
+ - `processTwig` takes `{ settled }` in place of `keepEmptyTokens: true`.
19
+ - Every other empty token is still kept for a later pass.
20
+ - `COMPONENT_PROPS_SOURCE` names the source.
21
+ - **Fixed: a flow in a list row or a component instance acts on its own copy.** A step's target resolves in the
22
+ replica the flow fired in first, then outwards. It used to reach whichever copy registered last.
23
+ - **Fixed: an instance's own `visible` hides it in preview.** The same goes for an element reference.
24
+ - **Fixed: a list row keeps its state with its record.** Rows are keyed by each record's unique `id`, so filtering no
25
+ longer moves one row's state onto another.
26
+ - **Closed scope:** inside, a component reads only its props and the globals. The validator, `lintSpace` and
27
+ `authorSpace` each refuse a read of the page around an instance. Components nest, and a cycle is refused.
28
+ - **Where to use them:**
29
+ - In code (`@plitzi/sdk-authoring`): `SpaceSpec.components` and `component(id, { props, children })`.
30
+ `specFromSpace` and `specToSource` read and write both.
31
+ - In the builder:
32
+ - a Components panel lists them, and an open component becomes the canvas;
33
+ - an element becomes a component with **Save as component**;
34
+ - in an instance's settings, an instance gets its props and slots, or is **detached** back into a copy.
35
+ - In the MCP: `upsertComponent` and `deleteComponent`. Element ops work inside a component through `pageRef`.
36
+ - **Schema helpers:** `@plitzi/sdk-schema` gains `addComponent`, `updateComponent`, `removeComponent`,
37
+ `detachInstance`, `renameElement`, `treeOf`, `flatMapOf` and `documentIds`.
38
+ - **GraphQL and live events:** `SpaceAddComponent`, `SpaceUpdateComponent`, `SpaceRemoveComponent` and
39
+ `SpaceDetachInstance`, each with a live event. History records a declaration change as a `component` entry.
40
+ - **Breaking: segments are removed.** This covers:
41
+ - `@plitzi/sdk-shared`'s segment types, queries, mutations, context and `SEGMENT_*` events;
42
+ - `referenceType: 'segment'`;
43
+ - the `Segments` builder module;
44
+ - `Space.segments` and the `Segment`/`Segments` queries;
45
+ - `CommonState.prevSchema`.
46
+ - **Breaking: `ElementLayout` and `LayoutBody` change shape.**
47
+ - `ElementLayout` is `{ slots, rootId, type }`; it was `{ containerId }`.
48
+ - `LayoutBody` takes `bodies` keyed by slot.
49
+ - `reference`'s `referenceContainer` attribute is removed.
50
+ - Guide: `docs/en/components.md`.
51
+
52
+ ## Functions ask for the time they need
53
+ - **What changes:** a task can ask for more CPU or wall time than the default with `limits`, in milliseconds. Example:
54
+ `limits: { cpuMs: 1000, wallMs: 20_000 }`. `defineFunctions({ limits })` asks it for every task and route at once,
55
+ and a task's own limits win over those.
56
+ - **What a run is given:** what it asked for, or the default (100 ms of CPU, 10 s) when it asked for nothing. Never
57
+ above the space's plan or the deployment's ceiling.
58
+ - **Deployment ceilings:** `functions.limits` sets them. `DEFAULT_FUNCTION_CEILINGS` covers each unset one, at 2 s of
59
+ CPU and 30 s.
60
+ - **Asking for more than the ceiling** is a problem when the functions are saved; it is never quietly cut down.
61
+ - **Manifest:** carries what each task asked for, and the builder shows it beside the task.
62
+
63
+ ## Functions answer under `/fn`, not `/api`
64
+
65
+ A space's routes are served at `/fn/<path>` (`FUNCTION_ROUTES_PREFIX`). `/api` is a slug a site wants for a page of its
66
+ own. A page under `/fn` is refused instead (`page-route-reserved`).
67
+
68
+ ## The builder's Functions panel
69
+
70
+ Rebuilt around the code. The panel reads `defineFunctions` as it is typed and writes into it, so the code stays the one
71
+ place a function is declared.
72
+
73
+ - **Layout:** the tasks, routes and files on the left, the code in the middle, the selected task on the right.
74
+ - **Live list:** tasks and routes are listed as the code declares them, including tasks imported from another file.
75
+ A task you have written but not saved says so. Tasks built by calling something are counted, and listed once saved.
76
+ - **Code and panel follow each other:** clicking a task or a route opens its file at its line. Putting the cursor inside
77
+ a task's code selects that task.
78
+ - **New task:** + in Tasks asks for its namespace, action and title. The task is written into `defineFunctions` with a
79
+ `run` to start from, in the file's own quotes, and the editor opens on it.
80
+ - **Time limit:** each task gets a slider from 100 ms to 1 s of CPU per run, with presets. The value is written into
81
+ the task as `limits: { cpuMs }`. "Use default" takes it out. `DEFAULT_FUNCTION_TIME_LIMITS` in
82
+ `@plitzi/sdk-shared/actions` is the default both the panel and the server use.
83
+ - **Test:** fills a task's params the way its step does, from their defaults: a select, a switch or text. JSON stays a
84
+ toggle away. With unsaved changes, the button reads "Save & run": it saves, then runs. If the save fails, it says why.
85
+ - **Header:** shows Saved, Unsaved (and in how many files) or the number of problems the last save found. ⌘S saves.
86
+ **Discard** asks first, then puts every file back to what was last saved, or back to nothing for functions never
87
+ saved. Removing the functions is a quiet button beside Save.
88
+ - **Problems:** clicking one opens its file at its line.
89
+ - **Editor:** each file has its own editor and undo history. Opening another file no longer marks the one you left as
90
+ changed. Before this, it could also write the newly opened file's text into the one you left. The cause was in
91
+ `@plitzi/plitzi-ui`'s CodeMirror, fixed in 1.6.25, which every package now depends on. That release also sets code
92
+ editors (several lines) in a monospaced face again. Long lines scroll inside the editor, and the line numbers stay
93
+ in place.
94
+
95
+ ## A space's own functions are their own category of steps
96
+
97
+ In the action editor's step picker, the space's own functions are listed under **Functions**, apart from the
98
+ platform's **Tasks**. The other headings now read Callbacks, Global callbacks and Utilities. The saved step is still a
99
+ `task` node.
100
+
101
+ - `@plitzi/sdk-server`: every registered task has an `origin`, `'deployment'` (shipped with the server or a native
102
+ function) or `'space'` (from the space's functions). `describeCatalog`, `/_action/catalog` and the builder's
103
+ `SpaceActionTasks` carry it (`ActionTaskDescriptor.origin`).
104
+ - `@plitzi/sdk-shared`: an `InteractionCallback` may name the `group` the picker lists it under.
105
+
106
+ ## Fixed: preview no longer breaks a builder that is embedded in a page
107
+
108
+ When the builder is mounted inside a Plitzi page (the platform's `/spaces/:id/update`), going to preview with a page
109
+ that has SEO turned on left the builder unstyled. The previewed page wrote its title and description through a head
110
+ manager of the builder's own, and that manager rewrote the host page's head, removing the builder's own stylesheet.
111
+
112
+ - `@plitzi/sdk-shared`: a new render setting, `ownsHead`, says whether the page may write the document head. It is on
113
+ by default (`DEFAULT_RENDER_SETTINGS`).
114
+ - `@plitzi/sdk-elements`: `Page` writes its SEO only where `ownsHead` is on.
115
+ - Builder: sets `ownsHead: false` for its canvas. A page drawn there is in a frame, and the document head is the
116
+ editor's. The canvas's own `HelmetProvider` is gone.
117
+
118
+ ## Fixed: the builder's plan usage panel shows the space being edited
119
+ - **The 404 is gone.** Opening Plan usage said "The account breakdown could not be read (The server answered 404.)".
120
+ The panel asked `/account/usage`, which went away when accounts became workspaces.
121
+ - **Only this space.** The panel listed every space of the workspace. It now reads `/spaces/:spaceId/usage`, which
122
+ now also answers the space's own `pages` (the heaviest ten), `pagesTotal` and `periodEndsAt`. The plan's ceilings
123
+ stay on top. Anyone who can edit the space can read it, including a guest of another workspace.
124
+ - **It scrolls.** A long breakdown scrolls inside the modal, where it used to overflow.
125
+ - **`getKeyDecoded(webKey, true)` reads the token's subject.** The function, in `@plitzi/sdk-shared`, looked for
126
+ `data.spaceId`, which space tokens no longer carry, so every space decoded as 0. The builder asked about space 0, and
127
+ the builder and the SDK kept every space's persisted state under the same key on a host. Pages served without a
128
+ `webKey` (SSR) still decode as 0, which is what their painted-state cookie is named after.
129
+
130
+ ## Fixed: a remote plugin in the builder reads the canvas it sits in
131
+
132
+ The builder carries its own copy of the Plitzi runtime. A remote plugin imports `@plitzi/plitzi-sdk`, which the page's
133
+ import map resolves to the SDK's copy. Each copy made its own React contexts, so on the builder's canvas a plugin read
134
+ none of the canvas's providers. In the builder embedded in Plitzi's site, it read the site around the builder instead:
135
+ the site's element as its own, the site's live mode (so it stayed interactive while being edited), and the site's store
136
+ and interactions.
137
+
138
+ - `@plitzi/sdk-shared` gains `sharedContext(name, default)`: a context made once per page and handed to every copy of
139
+ the runtime that asks for it.
140
+ - The runtime's contexts now go through it, so a provider from any copy reaches a consumer from any copy:
141
+ - `@plitzi/sdk-shared`: service, component, schema, network, theme scope, dev tools, builder.
142
+ - `@plitzi/sdk-elements`: element, element parent, layout body.
143
+ - interactions, plugins, event bridge, auth, variables and style.
144
+ - The store's contexts need `@plitzi/nexus` 1.4.0, which does the same. Every `@plitzi/*` package now asks for
145
+ `^1.4.0`, which is published.
146
+
147
+ ## The source of plugins and runtimes is kept on the space
148
+
149
+ What a plugin or a runtime is built from now goes up with it, so a space can be taken back out as a project
150
+ (`plitzi create --from`, below).
151
+
152
+ - `@plitzi/cli`:
153
+ - `plitzi pack plugin` writes the plugin's source beside its zip: every file of the project its elements import,
154
+ `import type` included, and the packages they need. `--source-root` names the project those paths are relative to.
155
+ - `plitzi upload plugin` and `plitzi runtime push` keep that source on the space, in its private bucket.
156
+ - `plitzi pack source` writes it to a file.
157
+ - A source that cannot be kept (a file outside the project, an undeclared package, a credential in the code) never
158
+ stops the upload or the push: they say why, and the artifact is kept built only.
159
+ - `@plitzi/sdk-shared/source`: the snapshot's format, the paths it may hold and the credential check, shared by the CLI
160
+ and the platform.
161
+
162
+ ## `plitzi create --from` and `plitzi pull`: a space on Plitzi as a project of your own
163
+
164
+ The way back from everything the CLI puts on Plitzi. `plitzi create my-board --from pizarra` writes a server project
165
+ holding what the space is made of, and runs it with nothing of Plitzi's: neither its servers nor its CDN. `plitzi pull`
166
+ keeps it in step with the space. See `docs/en/projects-from-spaces.md`.
167
+
168
+ - **What lands in the project:**
169
+ - its pages as authoring code;
170
+ - its server actions as `defineAction` code — JSON, with the reason said, for one that would not read back exactly;
171
+ - its plugins and runtime as the source they were uploaded from, and its functions;
172
+ - its files, downloaded into `public/`, with every CDN address rewritten to the project's.
173
+ - **`src/main.ts`** serves all of it, the runtime in the same process.
174
+ - **`.env`** gets a key made for the project's actions to sign with, and the names of the variables and credentials
175
+ the space had. Their values stay on Plitzi.
176
+ - **Who may run it:** the person must be signed in and able to change the space (owner, administrator or writer).
177
+ - **Plugins** are rebuilt against the project's SDK. One uploaded before sources were kept runs as it was built, from
178
+ `vendor/plugins/`, and the report says to upload it again.
179
+ - **The end of `create`** says what came across differently, including a space whose visitors sign in with Plitzi.
180
+ - `--source cloud` keeps the pages on Plitzi and runs the rest locally.
181
+ - **Any version:** `--environment` and `--revision` take out a published snapshot — its latest, or one revision pinned
182
+ — instead of the draft, with the source its plugins and runtime were built from then. A cloud project serves that
183
+ revision pinned.
184
+ - **`plitzi pull`** writes what changed on the space, keeps what changed in the project, and writes nothing when a
185
+ file changed on both — naming them, with `--force` to take the space's copy. It never touches `.env`, only adds to
186
+ `package.json`, and keeps `plitzi functions push` working from the project. It follows the version the project was
187
+ made from, and `--environment`/`--revision` move it.
188
+ - `@plitzi/sdk-authoring`:
189
+ - `actionSpecFromEntry` reads an action document back into its `defineAction` declaration, only when the round trip
190
+ is exact, and `actionToSource` writes it as a module.
191
+ - `defineAction` takes `limits`.
192
+ - `specToSource` takes `importExtension: '.ts'`, for split files that Node imports as they are.
193
+
194
+ ## The builder shows what a snapshot holds
195
+
196
+ **Make Snapshot** lists what it will freeze — pages, layouts and elements, server actions, connectors, functions, the
197
+ runtime and the plugins, each with whether its source is kept — and what no snapshot freezes: the space's files, its
198
+ variables and credentials. A space's components are part of its document, so they are frozen with its pages. **Publish Snapshot** lists what the chosen environment's snapshot holds.
199
+
200
+ ## Fixed: a space read from Plitzi kept its server elements
201
+ - **What happened:** a page server reading its space from Plitzi (`createCloudAdapters`) never ran an element's
202
+ `render` action, and a browser-rendered space ignored `loadStrategy`. The space's GraphQL answered neither
203
+ `runtime` nor `loadStrategy` of an element, nor the space's `rsc` settings.
204
+ - **Now:** the platform answers them, and the SDK, the builder and the cloud adapters ask for them.
205
+
206
+ ## A plugin the deployment registers is not looked for elsewhere
207
+
208
+ `@plitzi/sdk-server` used to fetch the manifest of every plugin the space lists on its CDN, even one the deployment
209
+ registers itself, and logged a warning when the CDN was out of reach. It now asks only for the ones it does not have.
210
+
211
+ ## Fixed: inline code in Markdown carries nothing of the syntax tree
212
+
213
+ A `markdown` element wrote every inline `` `code` `` as `<code node="[object Object]">`: `react-markdown` hands its
214
+ renderers the syntax-tree node as a prop, and the inline branch spread it onto the tag. Fixed in
215
+ `@plitzi/plitzi-ui` 1.6.26 (with a test), which every package now asks for.
216
+
217
+ ## Dev tools hear about the render run the page stopped waiting for
218
+
219
+ When a server element's action ran past the section's budget, the page was answered without it. The run ended a moment
220
+ later, after the page's runs had been sent, so the dev tools never showed the one run that needed debugging. It is now
221
+ told the moment the page stops waiting, as `aborted`, with the reason.
222
+
223
+ ## Fixed: a tab you come back to no longer loses its session
224
+ - **What happened:** a page left in another tab past its access token's life signed its visitor out on return. A
225
+ reload put them right back in.
226
+ - **Why:** the browser drops the cookie carrying the access token the moment the token expires, and the background
227
+ tab's renewal timer had not run. The first check on return was told `missing`, which the client took as no
228
+ session at all.
229
+ - **Now:** a `missing` refusal is renewed instead whenever the browser can still renew, meaning it holds a refresh
230
+ token or a session hint whose renewal window is open. The session ends only if that renewal fails.
231
+ - **Requests made in that moment:** `reportAuthFailure` now answers whether it renewed the session. A read refused
232
+ as the tab came back is asked again, once, once the session is renewed. This covers an api container's read and a
233
+ server section's refresh, so they no longer show a 401 that only a reload cleared.
234
+
235
+ - Updated dependencies [3ae61a4]
236
+ - @plitzi/sdk-auth@0.37.9
237
+ - @plitzi/sdk-authoring@0.37.9
238
+ - @plitzi/sdk-dev-tools@0.37.9
239
+ - @plitzi/sdk-elements@0.37.9
240
+ - @plitzi/sdk-event-bridge@0.37.9
241
+ - @plitzi/sdk-interactions@0.37.9
242
+ - @plitzi/sdk-navigation@0.37.9
243
+ - @plitzi/sdk-plugins@0.37.9
244
+ - @plitzi/sdk-schema@0.37.9
245
+ - @plitzi/sdk-shared@0.37.9
246
+ - @plitzi/sdk-style@0.37.9
247
+ - @plitzi/sdk-variables@0.37.9
248
+ - @plitzi/plitzi-sdk@0.37.9
249
+
3
250
  ## 0.37.8
4
251
 
5
252
  ### Patch Changes
package/dist/index.html CHANGED
@@ -56,10 +56,10 @@
56
56
  render(
57
57
  'plitzi',
58
58
  {
59
- webKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwib3JpZ2lucyI6WyJodHRwczovL3dlYnNpdGUucGxpdHppLmFwcCIsImh0dHBzOi8vcGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDAiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMSIsImh0dHBzOi8vc3NyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImh0dHA6Ly9sb2NhbGhvc3Q6MzAwMCIsImh0dHA6Ly9sb2NhbGhvc3Q6ODA4MCIsImh0dHA6Ly8xMjcuMC4wLjE6ODA4MCIsImh0dHBzOi8vZGV2LnBsaXR6aS5jb20iLCJodHRwczovL3BsaXR6aS5jb20iLCJodHRwczovL3N0Zy5wbGl0emkuY29tIl0sImlzcyI6Imh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImF1ZCI6WyJodHRwczovL3BsaXR6aS5sb2NhbCIsImh0dHBzOi8vYXBwLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vYXBwLnBsaXR6aS5sb2NhbDozMDAwIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDEiLCJodHRwczovL2FwaS5wbGl0emkubG9jYWwiLCJodHRwczovL3Nzci5wbGl0emkubG9jYWwiLCJodHRwczovL3NlcnZlci5wbGl0emkubG9jYWwiLCJodHRwczovL21jcC5wbGl0emkubG9jYWwiLCJodHRwczovL2F1dGgucGxpdHppLmxvY2FsIiwiaHR0cDovLzEyNy4wLjAuMTo1MzAwIiwiaHR0cDovL2xvY2FsaG9zdDo1MTgwIl0sInNjb3BlIjoic3BhY2U6cmVuZGVyIiwiaWF0IjoxNzkwMjEzMjg5LCJqdGkiOiJhZDgyN2EyMjliZjhlMzk3IiwibmJmIjoxNzkwMjEzMjg5fQ.dedpVVA5Nv3Xr7nEOZ8UmEJcIamF9AHGnLgqQyDV8-k',
59
+ webKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxOCIsIm9yaWdpbnMiOlsiaHR0cHM6Ly90cmVtb3IucGxpdHppLmFwcCIsImh0dHBzOi8vdHJlbW9yLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vcGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDAiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMSIsImh0dHBzOi8vc3NyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImh0dHA6Ly9sb2NhbGhvc3Q6MzAwMCIsImh0dHA6Ly9sb2NhbGhvc3Q6ODA4MCIsImh0dHA6Ly8xMjcuMC4wLjE6ODA4MCJdLCJpc3MiOiJodHRwczovL3NlcnZlci5wbGl0emkubG9jYWwiLCJhdWQiOlsiaHR0cHM6Ly9wbGl0emkubG9jYWwiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWwiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMCIsImh0dHBzOi8vYXBwLnBsaXR6aS5sb2NhbDozMDAxIiwiaHR0cHM6Ly9hcGkucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9zc3IucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9zZXJ2ZXIucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9tY3AucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hdXRoLnBsaXR6aS5sb2NhbCIsImh0dHA6Ly8xMjcuMC4wLjE6NTMwMCIsImh0dHA6Ly9sb2NhbGhvc3Q6NTE4MCJdLCJzY29wZSI6InNwYWNlOnJlbmRlciIsImlhdCI6MTc5MDc5NDEyMywianRpIjoiNmU1MTNmOTIwNTEwMzNkNCIsIm5iZiI6MTc5MDc5NDEyM30.4zBNY-E9PJZUfotar7D9LDM5yuwHOQc1nbxhHLPbVgA',
60
60
  // The actor. Without it the builder loads and every write is refused, since authorization is
61
61
  // can(actor, space, permission). Both halves come from `yarn token 1 --user admin` in plitzi-sdk-server.
62
- userKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwiaXNzIjoiaHR0cHM6Ly9zZXJ2ZXIucGxpdHppLmxvY2FsIiwiYXVkIjpbImh0dHBzOi8vcGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDAiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMSIsImh0dHBzOi8vYXBpLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc3NyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vbWNwLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vYXV0aC5wbGl0emkubG9jYWwiLCJodHRwOi8vMTI3LjAuMC4xOjUzMDAiLCJodHRwOi8vbG9jYWxob3N0OjUxODAiXSwic2NvcGUiOiJ1c2VyIiwiZXhwIjoxNzkwMjg3MDg0LCJpYXQiOjE3OTAyMDA2ODQsImp0aSI6ImNiZWE3MDZlNzYyZGFiNGUiLCJuYmYiOjE3OTAyMDA2ODR9.IpPxIRFRi6KXz0yCC1fPQF6hLubU_7u0fTcgQohmB10',
62
+ userKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwiaXNzIjoiaHR0cHM6Ly9zZXJ2ZXIucGxpdHppLmxvY2FsIiwiYXVkIjpbImh0dHBzOi8vcGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDAiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMSIsImh0dHBzOi8vYXBpLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc3NyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vbWNwLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vYXV0aC5wbGl0emkubG9jYWwiLCJodHRwOi8vMTI3LjAuMC4xOjUzMDAiLCJodHRwOi8vbG9jYWxob3N0OjUxODAiXSwic2NvcGUiOiJ1c2VyIiwiZXhwIjoxNzkwODgwNDk3LCJpYXQiOjE3OTA3OTQwOTcsImp0aSI6IjgzNWVjMTA5MDhkNzA4NjYiLCJuYmYiOjE3OTA3OTQwOTd9.aSm7PJz1yPtXjPD9DT40IWaqK7N9EAuSZ1Bsb7ZvABc',
63
63
  environment: 'main',
64
64
  functionsWorkerUrl: '/plitzi-functions-worker.js',
65
65
  server: {
@@ -6,14 +6,15 @@ export type QuotaBreakdownProps = {
6
6
  liveElements: number;
7
7
  };
8
8
  /**
9
- * The number in the header, taken apart.
9
+ * The number in the header, taken apart — for the space being edited.
10
10
  *
11
- * The meter answers "how much room is left"; this answers what follows it — where the room went. Two breakdowns,
12
- * because the two ceilings are spent by different things: elements sit in pages, and page views are spent by
13
- * visitors on paths.
11
+ * The meter answers "how much room is left"; this answers what follows it — where this space's room went. Two
12
+ * breakdowns, because the two ceilings are spent by different things: elements sit in pages, and page views are spent by
13
+ * visitors on paths. The account's ceilings stay at the top, since the space spends them too; how the workspace's other
14
+ * spaces spent them is the dashboard's to show, to its members.
14
15
  *
15
- * The space being edited is answered entirely from the store, so it is on screen before any request is made, and it
16
- * is there even for someone whose account owns none of this. The rest of the account is what the request is for.
16
+ * Its elements are answered from the store, so they are on screen before any request is made. Its page views are what
17
+ * the request is for. Scrolls on its own: a space with many pages is longer than the window.
17
18
  */
18
19
  declare const QuotaBreakdown: ({ readings, spaceId, liveElements }: QuotaBreakdownProps) => import('react').JSX.Element;
19
20
  export default QuotaBreakdown;
@@ -0,0 +1,7 @@
1
+ import { SpaceVersionContents } from '@plitzi/sdk-shared';
2
+ export type PluginListProps = {
3
+ plugins: SpaceVersionContents['plugins'];
4
+ };
5
+ /** Each installed plugin, and whether it can be taken out as code or only as it was built. */
6
+ declare const PluginList: ({ plugins }: PluginListProps) => import('react').JSX.Element;
7
+ export default PluginList;
@@ -0,0 +1,14 @@
1
+ import { Environment } from '@plitzi/sdk-shared';
2
+ export type VersionContentsProps = {
3
+ environment: Environment;
4
+ /** A snapshot's revision; an environment's latest when left out. Meaningless for the draft. */
5
+ revision?: number;
6
+ /** What the list is: "This snapshot will freeze", "production r3 holds". */
7
+ title: string;
8
+ };
9
+ /**
10
+ * What one version of the space holds — the draft a snapshot would freeze, or a snapshot as it was frozen — and what no
11
+ * version holds, because every version shares it. Read from the platform, which is what freezes it.
12
+ */
13
+ declare const VersionContents: ({ environment, revision, title }: VersionContentsProps) => import('react').JSX.Element;
14
+ export default VersionContents;
@@ -0,0 +1,8 @@
1
+ import { SpaceVersionContents } from '@plitzi/sdk-shared';
2
+ /** One line of what a version holds: what it is, and how much of it. */
3
+ export type ContentsRow = {
4
+ label: string;
5
+ value: string;
6
+ };
7
+ /** What a version holds, as the lines the builder shows — the plugins are listed on their own, by name. */
8
+ export declare const contentsRows: (contents: SpaceVersionContents) => ContentsRow[];
@@ -0,0 +1,2 @@
1
+ export { default } from './VersionContents';
2
+ export type { VersionContentsProps } from './VersionContents';
@@ -0,0 +1,8 @@
1
+ import { Environment, SpaceVersionContents } from '@plitzi/sdk-shared';
2
+ /** What one version of the space holds: the draft, or an environment's snapshot — its latest unless one is named. */
3
+ declare const useVersionContents: (environment: Environment, revision?: number) => {
4
+ contents: SpaceVersionContents | undefined;
5
+ loading: boolean;
6
+ error: Error | undefined;
7
+ };
8
+ export default useVersionContents;
@@ -2,7 +2,7 @@ import { EventBridgeEvent } from '@plitzi/sdk-shared';
2
2
  export type BuilderProviderProps = {
3
3
  children: React.ReactNode;
4
4
  baseElementId: string;
5
- mode?: 'normal' | 'template' | 'segment';
5
+ mode?: 'normal' | 'template';
6
6
  schemaName?: string;
7
7
  onHandler?: (event: EventBridgeEvent, data: unknown[]) => void;
8
8
  onBaseElementChange?: (baseElementId: string) => void;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The space's components: what each is called and how many places render it. A component is placed by dragging it
3
+ * onto a page, and edited by opening it in the canvas, where its tree is edited like a page's.
4
+ */
5
+ declare const Components: () => import('react').JSX.Element;
6
+ export default Components;
@@ -0,0 +1,7 @@
1
+ import { SpaceComponent } from '@plitzi/sdk-shared';
2
+ export type ComponentBannerProps = {
3
+ component: SpaceComponent;
4
+ };
5
+ /** Says the canvas is a component, not a page — every instance of it changes with what is edited here. */
6
+ declare const ComponentBanner: ({ component }: ComponentBannerProps) => import('react').JSX.Element;
7
+ export default ComponentBanner;
@@ -0,0 +1 @@
1
+ export { default } from './ComponentBanner';
@@ -0,0 +1,19 @@
1
+ import { PageFolder, SpaceComponentDeclaration } from '@plitzi/sdk-shared';
2
+ import { MouseEvent } from 'react';
3
+ export type ComponentFormProps = {
4
+ declaration?: SpaceComponentDeclaration;
5
+ /** The elements of the component's tree that can be a slot: those that hold children. */
6
+ slotChoices?: {
7
+ id: string;
8
+ label: string;
9
+ }[];
10
+ pageFolders?: PageFolder[];
11
+ onClose?: (e?: MouseEvent) => void;
12
+ onSubmit?: (e: MouseEvent | undefined, values: SpaceComponentDeclaration) => void;
13
+ };
14
+ /**
15
+ * What a component declares: what it is called, where the builder files it, the props an instance hands in and the
16
+ * elements of its tree an instance fills.
17
+ */
18
+ declare const ComponentForm: ({ declaration, slotChoices, pageFolders, onClose, onSubmit }: ComponentFormProps) => import('react').JSX.Element;
19
+ export default ComponentForm;
@@ -0,0 +1,8 @@
1
+ export type SlotChoiceProps = {
2
+ id: string;
3
+ label: string;
4
+ checked: boolean;
5
+ onToggle: (id: string, checked: boolean) => void;
6
+ };
7
+ declare const SlotChoice: ({ id, label, checked, onToggle }: SlotChoiceProps) => import('react').JSX.Element;
8
+ export default SlotChoice;
@@ -0,0 +1 @@
1
+ export { default } from './ComponentForm';
@@ -0,0 +1,12 @@
1
+ import { PageFolder, SpaceComponent } from '@plitzi/sdk-shared';
2
+ export type ComponentItemProps = {
3
+ component: SpaceComponent;
4
+ /** How many places in the space render it. */
5
+ instances: number;
6
+ /** Whether it is the one open in the canvas. */
7
+ open: boolean;
8
+ pageFolders: PageFolder[];
9
+ };
10
+ /** One component of the space: dragged onto a page to place it, opened to edit its tree, renamed, removed. */
11
+ declare const ComponentItem: ({ component, instances, open, pageFolders }: ComponentItemProps) => import('react').JSX.Element;
12
+ export default ComponentItem;
@@ -0,0 +1 @@
1
+ export { default } from './ComponentItem';
@@ -0,0 +1,10 @@
1
+ export type InstanceToolsProps = {
2
+ instanceId: string;
3
+ componentId: string;
4
+ };
5
+ /**
6
+ * What only the builder can do with an instance, beside the settings of the element itself: open the component it
7
+ * places, put each of its children in a slot, and detach it — a copy of the component that is then this page's own.
8
+ */
9
+ declare const InstanceTools: ({ instanceId, componentId }: InstanceToolsProps) => import('react').JSX.Element | null;
10
+ export default InstanceTools;
@@ -0,0 +1,13 @@
1
+ import { Element } from '@plitzi/sdk-shared';
2
+ export type SlotRowProps = {
3
+ child: Element;
4
+ slots: {
5
+ value: string;
6
+ label: string;
7
+ }[];
8
+ /** The slot a child naming none goes in: the component's first. */
9
+ fallback?: string;
10
+ };
11
+ /** One child of an instance, and the slot of the component it fills. */
12
+ declare const SlotRow: ({ child, slots, fallback }: SlotRowProps) => import('react').JSX.Element;
13
+ export default SlotRow;
@@ -0,0 +1 @@
1
+ export { default } from './InstanceTools';
@@ -0,0 +1,14 @@
1
+ import { ComponentProp } from '@plitzi/sdk-shared';
2
+ export type PropEntry = {
3
+ name: string;
4
+ prop: ComponentProp;
5
+ };
6
+ export type PropRowProps = {
7
+ index: number;
8
+ entry: PropEntry;
9
+ problem?: string;
10
+ onChange: (index: number, entry: PropEntry) => void;
11
+ onRemove: (index: number) => void;
12
+ };
13
+ declare const PropRow: ({ index, entry, problem, onChange, onRemove }: PropRowProps) => import('react').JSX.Element;
14
+ export default PropRow;
@@ -0,0 +1,11 @@
1
+ import { PropEntry } from './PropRow';
2
+ export type PropsEditorProps = {
3
+ value: PropEntry[];
4
+ onChange: (value: PropEntry[]) => void;
5
+ };
6
+ /**
7
+ * The props a component declares, one row each: the name it is read by (`{{ props.<name> }}`), its kind, what it is
8
+ * for and whether an instance must hand it in.
9
+ */
10
+ declare const PropsEditor: ({ value, onChange }: PropsEditorProps) => import('react').JSX.Element;
11
+ export default PropsEditor;
@@ -0,0 +1,2 @@
1
+ export { default } from './PropsEditor';
2
+ export type { PropEntry } from './PropRow';
@@ -0,0 +1,17 @@
1
+ import { ComponentDefinition, Schema, SpaceComponent } from '@plitzi/sdk-shared';
2
+ /** A name for a new component, from what the author called it and free among the space's components. */
3
+ export declare const componentIdFor: (label: string, components: Schema["components"]) => string;
4
+ /**
5
+ * A new component with nothing in it yet: the one container it is built in, made the way a drop makes one — from the
6
+ * element's own declaration — and named free of every tree of the document.
7
+ */
8
+ export declare const emptyComponent: (label: string, schema: Pick<Schema, "flat" | "components">, container: ComponentDefinition) => SpaceComponent;
9
+ /** What the builder shows a component as: the name the author gave it, else its id. */
10
+ export declare const componentLabel: (component: SpaceComponent) => string;
11
+ /**
12
+ * How many places render each component.
13
+ *
14
+ * Counted tree by tree. While a component is open, the builder reads `schema.flat` with its tree laid over the pages',
15
+ * so an element is counted from that flat only when no component holds it — and from its component's tree otherwise.
16
+ */
17
+ export declare const instanceCounts: (schema: Pick<Schema, "flat" | "components">) => Record<string, number>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default } from './Components';
2
+ export { default as useOpenComponent } from './useOpenComponent';
@@ -0,0 +1,9 @@
1
+ import { ComponentDefinition, Element, Schema } from '@plitzi/sdk-shared';
2
+ /**
3
+ * The elements of a tree hung off `rootId` that can be a slot: those whose TYPE holds children, as its declaration
4
+ * says. Not the element's own `items`, which an authored document gives every element, a text included.
5
+ */
6
+ export declare const slotChoicesOf: (flat: Schema["flat"], rootId: Element["id"], definitions: Record<string, ComponentDefinition>) => {
7
+ id: string;
8
+ label: string;
9
+ }[];
@@ -0,0 +1,13 @@
1
+ import { SpaceComponent } from '@plitzi/sdk-shared';
2
+ /**
3
+ * The component open in the canvas, and the scope the builder is drawn in while it is.
4
+ *
5
+ * The scope lays the component's tree over the pages' — ids are one namespace, so every tool that finds an element by
6
+ * id finds the component's — and hands its props their defaults. With nothing open it is empty, and a scope with
7
+ * nothing of its own reads straight through to the store.
8
+ */
9
+ declare const useOpenComponent: () => {
10
+ component?: SpaceComponent;
11
+ scope: Record<string, unknown>;
12
+ };
13
+ export default useOpenComponent;
@@ -0,0 +1,7 @@
1
+ import { Element } from '@plitzi/sdk-shared';
2
+ /**
3
+ * Makes a component of an element on the canvas: the element and everything inside it become the component's tree,
4
+ * and an instance of it takes the element's place, so the page renders what it did. Returns whether it was made.
5
+ */
6
+ declare const useSaveAsComponent: () => (element: Element) => Promise<boolean>;
7
+ export default useSaveAsComponent;
@@ -4,8 +4,9 @@ import { ComponentDefinition, Element, Schema } from '@plitzi/sdk-shared';
4
4
  * A drop can insert a whole sub-tree at once, and each element of it needs a name that is free of the document AND
5
5
  * of its siblings in the same drop — which is why the taken set is carried across the burst rather than re-read
6
6
  * per element. The random minter, not the positional one: the builder and the MCP write the same document
7
- * concurrently, and a counter has both mint `heading-3`. */
8
- export declare const makeIdMinter: (flat: Schema["flat"]) => (type: string) => string;
7
+ * concurrently, and a counter has both mint `heading-3`. Free of every tree — the pages' and each component's — since
8
+ * ids are one namespace across them. */
9
+ export declare const makeIdMinter: (schema: Pick<Schema, "flat" | "components">) => (type: string) => string;
9
10
  export declare const getInitialItems: (parentId: string, items: string[] | undefined, definitions: Record<string, ComponentDefinition>, mintId: (type: string) => string, rootId?: string) => {
10
11
  directItems: Record<string, Element>;
11
12
  items: Record<string, Element>;
@@ -5,9 +5,10 @@ export type UseDragElementProps = {
5
5
  type: string;
6
6
  variables?: object[];
7
7
  manifest?: Template;
8
- onParentRefresh?: (identifier: string, segment: object) => void;
8
+ /** What the dropped element is called in the builder's tree, instead of its type's default label. */
9
+ label?: string;
9
10
  };
10
- declare const useDragElement: ({ attributes, type, variables, manifest }: UseDragElementProps) => {
11
+ declare const useDragElement: ({ attributes, type, variables, manifest, label }: UseDragElementProps) => {
11
12
  onDragStart: (e: DragEvent) => void;
12
13
  };
13
14
  export default useDragElement;
@@ -1,7 +1,8 @@
1
1
  /**
2
- * The space's own server code: its files, edited with TypeScript that knows the contract, saved as the draft
3
- * — built and checked on the platform, problems shown where they are — and tried in the sandbox. The live site runs
4
- * what the space was last published with. A project's `plitzi functions pull` edits the same files.
2
+ * The space's own server code: its tasks and routes as the code declares them — listed as it is typed — its files,
3
+ * edited with TypeScript that knows the contract, and the selected task's time limit and test run beside them. Saved as
4
+ * the draft, built and checked on the platform; the live site runs what the space was last published with. A
5
+ * project's `plitzi functions pull` edits the same files.
5
6
  */
6
7
  declare const Functions: () => import('react').JSX.Element;
7
8
  export default Functions;
@@ -0,0 +1,20 @@
1
+ import { ListedTask } from '../../helpers';
2
+ import { ActionRunReport, FunctionTimeLimits } from '@plitzi/sdk-shared';
3
+ export type FunctionInspectorProps = {
4
+ task: ListedTask;
5
+ /** What every task gets unless it asks for its own, from `defineFunctions`. */
6
+ sharedLimits?: FunctionTimeLimits;
7
+ hosts: string[];
8
+ /** Why its limits cannot be written for you right now — the code is still being read, say — or nothing. */
9
+ limitsDisabledReason: string;
10
+ /** The code differs from the saved draft. */
11
+ modified: boolean;
12
+ onLimitsChange: (task: ListedTask, cpuMs: number | undefined) => void;
13
+ onRun: (task: string, params: Record<string, unknown>) => Promise<ActionRunReport | undefined>;
14
+ };
15
+ /**
16
+ * The selected task: what it is as a step, how much CPU a run of it may use — written into its code — and a run of it
17
+ * in the sandbox, saving first when the code changed.
18
+ */
19
+ declare const FunctionInspector: ({ task, sharedLimits, hosts, limitsDisabledReason, modified, onLimitsChange, onRun }: FunctionInspectorProps) => import('react').JSX.Element;
20
+ export default FunctionInspector;