@valbuild/shared 0.152.1 → 0.153.1
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.
- package/CHANGELOG.md +50 -0
- package/client/dist/valbuild-shared-client.cjs.dev.js +4 -1
- package/client/dist/valbuild-shared-client.cjs.prod.js +4 -1
- package/client/dist/valbuild-shared-client.esm.js +1 -1
- package/dist/declarations/src/client/index.d.ts +1 -0
- package/dist/declarations/src/internal/ApiRoutes.d.ts +123 -100
- package/dist/declarations/src/internal/codeChangedEvent.d.ts +15 -0
- package/dist/declarations/src/internal/content/version.d.ts +10 -1
- package/dist/declarations/src/internal/elementPicker.d.ts +8 -0
- package/dist/declarations/src/internal/index.d.ts +1 -0
- package/dist/declarations/src/internal/sketchpad/sketchFormat.d.ts +1 -16
- package/dist/declarations/src/internal/valCanvasProtocol.d.ts +34 -13
- package/dist/declarations/src/publish/builder.d.ts +7 -2
- package/dist/{getSitemapTree-dc61b8b6.cjs.dev.js → getSitemapTree-09399379.cjs.dev.js} +36 -6
- package/dist/{getSitemapTree-2b22cf1b.esm.js → getSitemapTree-6d875612.esm.js} +34 -7
- package/dist/{getSitemapTree-d0942fca.cjs.prod.js → getSitemapTree-7ed70b4a.cjs.prod.js} +36 -6
- package/internal/dist/valbuild-shared-internal.cjs.dev.js +145 -217
- package/internal/dist/valbuild-shared-internal.cjs.prod.js +145 -217
- package/internal/dist/valbuild-shared-internal.esm.js +140 -217
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# @valbuild/shared
|
|
2
2
|
|
|
3
|
+
## 0.153.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1031](https://github.com/valbuild/val/pull/1031) [`6ec1a5d`](https://github.com/valbuild/val/commit/6ec1a5d244f0d6e064eca4135f167dfa79744f9a) Thanks [@freekh](https://github.com/freekh)! - A page no longer shows content made for code it does not have yet. When the Studio is ahead of the page (it picked up a code change first, or the browser is still running the previous build), the page keeps showing its own content for the modules whose schema changed, and says "The code changed" with a **Reload** button — in the overlay on your site, and above the page in the Studio. In local development the page usually catches up a moment later by itself, and the notice goes away without a reload.
|
|
8
|
+
|
|
9
|
+
- [#1027](https://github.com/valbuild/val/pull/1027) [`b14870b`](https://github.com/valbuild/val/commit/b14870bebdc128234bb16e4ea06a0151d18c4771) Thanks [@freekh](https://github.com/freekh)! - The Sketchpad's linked text is gone, and so are its "needs code" badges.
|
|
10
|
+
|
|
11
|
+
- **Linked text is removed.** A heading or paragraph can no longer be linked to a content field (`{field: …}`), and typing in a sketchpad never changes the site's content: the sketch is a plan, and **Build** is what changes the pages. A sketch that still has a `{field: …}` from 0.152.0 shows it as plain text, and can be deleted.
|
|
12
|
+
- **No "needs code" badges.** A box of a kind the site does not have, and a new route the site has no page type for, are no longer marked. A box's kind still suggests the site's own kinds.
|
|
13
|
+
- **Narrow columns keep their shape.** In a row of several columns, a box's header stays on one line (a long kind is cut short, and shown in full on hover), and a box naming an image the project does not have says so in a few lines, with the file's name on one, instead of breaking the path over many.
|
|
14
|
+
|
|
15
|
+
## 0.153.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [#1016](https://github.com/valbuild/val/pull/1016) [`2e70d13`](https://github.com/valbuild/val/commit/2e70d13cf7ca25874900c9ea25227df2876727b9) Thanks [@freekh](https://github.com/freekh)! - Editing content in a proposal whose code changed, before the proposal is built again:
|
|
20
|
+
|
|
21
|
+
- **A module the proposal adds** can be edited and saved right away. Its content is read from the new file and saved. Before, those edits were dropped. If the module's content is made by code (not written out in the file), the save waits and says to build the proposal first.
|
|
22
|
+
- **A module whose schema moved because a file it imports changed** (for example a shared `src/schemas/*.ts`) is no longer read with the old schema. Pages keep showing the content as built until the proposal is built again.
|
|
23
|
+
- **Edits that no longer fit the schema** can be handed to the assistant. The banner that lists them has a **Have the assistant move it** button for each one. You still discard the held edit yourself afterwards.
|
|
24
|
+
|
|
25
|
+
For this, `@valbuild/tanstack-build` records which files each Val module imports, and the `val.server.ts` it generates passes that to Val as the new optional `moduleDependencies` option of `initValServer` and `initValContent`. You do not need to set it yourself. A site built before this has no `moduleDependencies` and works as before.
|
|
26
|
+
|
|
27
|
+
- [#1016](https://github.com/valbuild/val/pull/1016) [`2e70d13`](https://github.com/valbuild/val/commit/2e70d13cf7ca25874900c9ea25227df2876727b9) Thanks [@freekh](https://github.com/freekh)! - Removed what 0.151.0 kept only so that a Studio, a page and a server from the release before could still talk to each other during a deploy:
|
|
28
|
+
|
|
29
|
+
- **`PUT /api/val/sources/~`** is gone. Nothing in 0.151.0 asked it: the Studio reads modules through `GET /api/val/manifest` and `GET /api/val/modules/~<path>`, and `fetchVal`, `useVal` and the MCP tools read the server's content in-process. If a script or test of yours read content through it, read one module with `GET /api/val/modules/~<path>` instead. Its answer has the module's `source` and `version`, and an `entries` map holding the `.jsonValues()` entries pending changes touched.
|
|
30
|
+
- **`ValDraft.base`** is gone from the type. It has not been sent or read since 0.151.0, so a `draft` you pass to `ValProvider` is not affected.
|
|
31
|
+
- **A page no longer accepts edits relayed by a Studio from before 0.151.0.** Such a Studio sent each module as a bare `source`. After the upgrade, the Studio and your pages come from the same deploy, so this only matters while an older Studio is still open in a tab during a rollout. Reloading that tab fixes it.
|
|
32
|
+
- **`/api/val/stat`** no longer needs `sourcesSha` and `schemaSha`. The Studio now tells your local server which version it last saw, and the server still sends both fields for a Studio of 0.151.0. They stop being sent in the next release.
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- [#1028](https://github.com/valbuild/val/pull/1028) [`27e51ba`](https://github.com/valbuild/val/commit/27e51baadce61b2cbee2d5ef227aae045ccb2e21) Thanks [@freekh](https://github.com/freekh)! - Another editor's keystroke costs the Studio less. Locally (`pnpm dev`, and
|
|
37
|
+
anywhere `/stat` long-polls), the Studio no longer asks for the manifest or
|
|
38
|
+
the changed module after someone else types: `/stat` now carries what
|
|
39
|
+
`GET /manifest` would have answered, and the module's new version is computed
|
|
40
|
+
from the patch the Studio already fetched. Where neither can be used (an
|
|
41
|
+
older server, a version that does not match), the Studio asks for them as
|
|
42
|
+
before.
|
|
43
|
+
|
|
44
|
+
- [#1030](https://github.com/valbuild/val/pull/1030) [`efa1f7d`](https://github.com/valbuild/val/commit/efa1f7d810f3c4e4e21502c9cc81ce86da93650c) Thanks [@freekh](https://github.com/freekh)! - **Point the assistant at something on the page.** With the preview open, the assistant has a **Select** in its header: press it, click a field on the page, and what you picked shows above the message box and goes with your next message, so "make this shorter" means that field. In code mode it can pick any element, outlined in the proposal's colour. Press the × on it to take it off.
|
|
45
|
+
|
|
46
|
+
- Selecting a field to edit has moved from the preview's toolbar to the top of the editor column, beside **Structure | On page**. Esc turns it off, from the Studio or from the page.
|
|
47
|
+
- On a desktop the assistant now sits beside the preview instead of over it, so it never covers what you point it at.
|
|
48
|
+
- The assistant can read the page in the preview, and take a picture of it, to see what you see.
|
|
49
|
+
|
|
50
|
+
- Updated dependencies [[`67145fd`](https://github.com/valbuild/val/commit/67145fd16e35f2e3e0988ca5690fe5a4f84c1a41)]:
|
|
51
|
+
- @valbuild/core@0.153.0
|
|
52
|
+
|
|
3
53
|
## 0.152.1
|
|
4
54
|
|
|
5
55
|
### Patch Changes
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var getSitemapTree = require('../../dist/getSitemapTree-
|
|
5
|
+
var getSitemapTree = require('../../dist/getSitemapTree-09399379.cjs.dev.js');
|
|
6
6
|
require('../../dist/createForOfIteratorHelper-f2d7ac6d.cjs.dev.js');
|
|
7
7
|
require('@valbuild/core');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
exports.CODE_CHANGED_EVENT = getSitemapTree.CODE_CHANGED_EVENT;
|
|
11
12
|
exports.DEFAULT_CANVAS_SELECTION = getSitemapTree.DEFAULT_CANVAS_SELECTION;
|
|
12
13
|
exports.DEFAULT_CANVAS_SELECTION_SOFT = getSitemapTree.DEFAULT_CANVAS_SELECTION_SOFT;
|
|
13
14
|
exports.QUICK_PREVIEW_PARAM = getSitemapTree.QUICK_PREVIEW_PARAM;
|
|
@@ -31,6 +32,8 @@ exports.getPageRouterSitemapTree = getSitemapTree.getPageRouterSitemapTree;
|
|
|
31
32
|
exports.getPageRouterSourceFolder = getSitemapTree.getPageRouterSourceFolder;
|
|
32
33
|
exports.getPatternFromModuleFilePath = getSitemapTree.getPatternFromModuleFilePath;
|
|
33
34
|
exports.getTanStackRouterSourceFolder = getSitemapTree.getTanStackRouterSourceFolder;
|
|
35
|
+
exports.isCanvasSelectionColor = getSitemapTree.isCanvasSelectionColor;
|
|
36
|
+
exports.isCodeChangedDetail = getSitemapTree.isCodeChangedDetail;
|
|
34
37
|
exports.isQuickPreviewFiles = getSitemapTree.isQuickPreviewFiles;
|
|
35
38
|
exports.isTanStackRoutesFolder = getSitemapTree.isTanStackRoutesFolder;
|
|
36
39
|
exports.isValCanvasFrame = getSitemapTree.isValCanvasFrame;
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var getSitemapTree = require('../../dist/getSitemapTree-
|
|
5
|
+
var getSitemapTree = require('../../dist/getSitemapTree-7ed70b4a.cjs.prod.js');
|
|
6
6
|
require('../../dist/createForOfIteratorHelper-9ca2078d.cjs.prod.js');
|
|
7
7
|
require('@valbuild/core');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
exports.CODE_CHANGED_EVENT = getSitemapTree.CODE_CHANGED_EVENT;
|
|
11
12
|
exports.DEFAULT_CANVAS_SELECTION = getSitemapTree.DEFAULT_CANVAS_SELECTION;
|
|
12
13
|
exports.DEFAULT_CANVAS_SELECTION_SOFT = getSitemapTree.DEFAULT_CANVAS_SELECTION_SOFT;
|
|
13
14
|
exports.QUICK_PREVIEW_PARAM = getSitemapTree.QUICK_PREVIEW_PARAM;
|
|
@@ -31,6 +32,8 @@ exports.getPageRouterSitemapTree = getSitemapTree.getPageRouterSitemapTree;
|
|
|
31
32
|
exports.getPageRouterSourceFolder = getSitemapTree.getPageRouterSourceFolder;
|
|
32
33
|
exports.getPatternFromModuleFilePath = getSitemapTree.getPatternFromModuleFilePath;
|
|
33
34
|
exports.getTanStackRouterSourceFolder = getSitemapTree.getTanStackRouterSourceFolder;
|
|
35
|
+
exports.isCanvasSelectionColor = getSitemapTree.isCanvasSelectionColor;
|
|
36
|
+
exports.isCodeChangedDetail = getSitemapTree.isCodeChangedDetail;
|
|
34
37
|
exports.isQuickPreviewFiles = getSitemapTree.isQuickPreviewFiles;
|
|
35
38
|
exports.isTanStackRoutesFolder = getSitemapTree.isTanStackRoutesFolder;
|
|
36
39
|
exports.isValCanvasFrame = getSitemapTree.isValCanvasFrame;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { D as DEFAULT_CANVAS_SELECTION, e as DEFAULT_CANVAS_SELECTION_SOFT, Q as QUICK_PREVIEW_PARAM,
|
|
1
|
+
export { C as CODE_CHANGED_EVENT, D as DEFAULT_CANVAS_SELECTION, e as DEFAULT_CANVAS_SELECTION_SOFT, Q as QUICK_PREVIEW_PARAM, y as QUICK_PREVIEW_RENDER_SCRIPT, x as QUICK_PREVIEW_SERVICE_WORKER_PATH, B as QUICK_PREVIEW_SERVICE_WORKER_SOURCE, z as QUICK_PREVIEW_STORE_MESSAGE, b as VAL_AI_SESSION_STORAGE_KEY, d as VAL_CANVAS_MESSAGE, c as VAL_CANVAS_PARAM, V as VAL_CONFIG_SESSION_STORAGE_KEY, a as VAL_THEME_SESSION_STORAGE_KEY, l as attachElementPicker, n as createPickerOverlay, k as describeElement, o as elementLabel, u as findBySelector, H as formatRoutePattern, I as getNextAppRouterSourceFolder, M as getPageRouterSitemapTree, K as getPageRouterSourceFolder, N as getPatternFromModuleFilePath, J as getTanStackRouterSourceFolder, f as isCanvasSelectionColor, j as isCodeChangedDetail, A as isQuickPreviewFiles, L as isTanStackRoutesFolder, h as isValCanvasFrame, i as isValCanvasPageMessage, g as isValCanvasStudioMessage, m as modifierLabel, p as pageLocationOf, G as parseRoutePattern, t as readPageSnapshot, r as restoreScroll, v as screenshotPage, s as startElementPicking, E as storeQuickPreview, q as watchPageLocation, F as withQuickPreviewParam, w as withValCanvasParam } from '../../dist/getSitemapTree-6d875612.esm.js';
|
|
2
2
|
import '../../dist/createForOfIteratorHelper-9b80f1a2.esm.js';
|
|
3
3
|
import '@valbuild/core';
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export * from "../internal/sessionStorage.js";
|
|
18
18
|
export * from "../internal/valCanvasProtocol.js";
|
|
19
|
+
export * from "../internal/codeChangedEvent.js";
|
|
19
20
|
export * from "../internal/elementPicker.js";
|
|
20
21
|
export * from "../internal/pageInspection.js";
|
|
21
22
|
export * from "../internal/pageScreenshot.js";
|
|
@@ -119,6 +119,69 @@ export declare const SketchpadSummary: z.ZodObject<{
|
|
|
119
119
|
export type SketchpadSummaryT = z.infer<typeof SketchpadSummary>;
|
|
120
120
|
/** The most text a sketchpad holds, in UTF-8 bytes: a page, not a site. */
|
|
121
121
|
export declare const SKETCHPAD_MAX_TEXT_LENGTH: number;
|
|
122
|
+
/**
|
|
123
|
+
* A manifest as the server answers it: what each module IS on the server
|
|
124
|
+
* (`GET /manifest`, and the same answer on `/stat` when the Studio asks for it
|
|
125
|
+
* there -- one function on the server answers both, `manifestAnswer`).
|
|
126
|
+
*/
|
|
127
|
+
export declare const ManifestJson: z.ZodObject<{
|
|
128
|
+
project: z.ZodObject<{
|
|
129
|
+
build: z.ZodString;
|
|
130
|
+
seq: z.ZodNumber;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
modules: z.ZodRecord<z.ZodString & z.ZodType<ModuleFilePath, string, z.core.$ZodTypeInternals<ModuleFilePath, string>>, z.ZodObject<{
|
|
133
|
+
schema: z.ZodString;
|
|
134
|
+
base: z.ZodString;
|
|
135
|
+
chain: z.ZodString;
|
|
136
|
+
}, z.core.$strip>>;
|
|
137
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
138
|
+
since: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
superseded: z.ZodOptional<z.ZodBoolean>;
|
|
140
|
+
registry: z.ZodOptional<z.ZodObject<{
|
|
141
|
+
entry: z.ZodString;
|
|
142
|
+
core: z.ZodString;
|
|
143
|
+
}, z.core.$strip>>;
|
|
144
|
+
}, z.core.$strip>;
|
|
145
|
+
export type ManifestJsonT = z.infer<typeof ManifestJson>;
|
|
146
|
+
/**
|
|
147
|
+
* The manifest a `/stat` answer carries, when the request said which one the
|
|
148
|
+
* Studio holds (`manifest` on the request): what `GET /manifest` would have
|
|
149
|
+
* answered for it, so another editor's keystroke costs no manifest request.
|
|
150
|
+
*
|
|
151
|
+
* - A manifest, whole or a delta. A delta names the ETag it is relative to
|
|
152
|
+
* (`sinceTag`): a Studio uses it only while it holds exactly that one.
|
|
153
|
+
* - `unchanged`: the manifest the request named, at `seq`, is still the
|
|
154
|
+
* one for this answer's `seq`. Decided by `seq` alone, and not read: a
|
|
155
|
+
* Studio reads a manifest only for a stat whose `seq` moved. It keeps the
|
|
156
|
+
* next request naming the same manifest.
|
|
157
|
+
*
|
|
158
|
+
* Optional: absent from a server of the release before, and from an answer
|
|
159
|
+
* to a request that did not ask, and then the Studio reads `GET /manifest`.
|
|
160
|
+
*/
|
|
161
|
+
export declare const StatManifest: z.ZodUnion<readonly [z.ZodObject<{
|
|
162
|
+
project: z.ZodObject<{
|
|
163
|
+
build: z.ZodString;
|
|
164
|
+
seq: z.ZodNumber;
|
|
165
|
+
}, z.core.$strip>;
|
|
166
|
+
modules: z.ZodRecord<z.ZodString & z.ZodType<ModuleFilePath, string, z.core.$ZodTypeInternals<ModuleFilePath, string>>, z.ZodObject<{
|
|
167
|
+
schema: z.ZodString;
|
|
168
|
+
base: z.ZodString;
|
|
169
|
+
chain: z.ZodString;
|
|
170
|
+
}, z.core.$strip>>;
|
|
171
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
172
|
+
since: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
superseded: z.ZodOptional<z.ZodBoolean>;
|
|
174
|
+
registry: z.ZodOptional<z.ZodObject<{
|
|
175
|
+
entry: z.ZodString;
|
|
176
|
+
core: z.ZodString;
|
|
177
|
+
}, z.core.$strip>>;
|
|
178
|
+
sinceTag: z.ZodOptional<z.ZodString>;
|
|
179
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
180
|
+
unchanged: z.ZodLiteral<true>;
|
|
181
|
+
tag: z.ZodString;
|
|
182
|
+
seq: z.ZodNumber;
|
|
183
|
+
}, z.core.$strip>]>;
|
|
184
|
+
export type StatManifestT = z.infer<typeof StatManifest>;
|
|
122
185
|
export declare const Api: {
|
|
123
186
|
"/draft/enable": {
|
|
124
187
|
GET: {
|
|
@@ -585,11 +648,19 @@ export declare const Api: {
|
|
|
585
648
|
POST: {
|
|
586
649
|
req: {
|
|
587
650
|
body: z.ZodNullable<z.ZodObject<{
|
|
588
|
-
sourcesSha: z.ZodString
|
|
589
|
-
schemaSha: z.ZodString
|
|
651
|
+
sourcesSha: z.ZodOptional<z.ZodString>;
|
|
652
|
+
schemaSha: z.ZodOptional<z.ZodString>;
|
|
653
|
+
version: z.ZodOptional<z.ZodObject<{
|
|
654
|
+
build: z.ZodString;
|
|
655
|
+
seq: z.ZodNumber;
|
|
656
|
+
}, z.core.$strip>>;
|
|
590
657
|
baseSha: z.ZodString;
|
|
591
658
|
patches: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
592
659
|
jsonEntriesSha: z.ZodOptional<z.ZodString>;
|
|
660
|
+
manifest: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
661
|
+
tag: z.ZodString;
|
|
662
|
+
seq: z.ZodNumber;
|
|
663
|
+
}, z.core.$strip>>>;
|
|
593
664
|
}, z.core.$strip>>;
|
|
594
665
|
cookies: {
|
|
595
666
|
val_session: z.ZodOptional<z.ZodString>;
|
|
@@ -615,8 +686,8 @@ export declare const Api: {
|
|
|
615
686
|
json: z.ZodUnion<readonly [z.ZodObject<{
|
|
616
687
|
type: z.ZodUnion<readonly [z.ZodLiteral<"request-again">, z.ZodLiteral<"no-change">, z.ZodLiteral<"did-change">]>;
|
|
617
688
|
baseSha: z.ZodString;
|
|
618
|
-
schemaSha: z.ZodString
|
|
619
|
-
sourcesSha: z.ZodString
|
|
689
|
+
schemaSha: z.ZodOptional<z.ZodString>;
|
|
690
|
+
sourcesSha: z.ZodOptional<z.ZodString>;
|
|
620
691
|
patches: z.ZodArray<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>>;
|
|
621
692
|
appliedPatches: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>>>;
|
|
622
693
|
publishingPatches: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>>>;
|
|
@@ -653,13 +724,36 @@ export declare const Api: {
|
|
|
653
724
|
build: z.ZodString;
|
|
654
725
|
seq: z.ZodNumber;
|
|
655
726
|
}, z.core.$strip>>;
|
|
727
|
+
manifest: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
728
|
+
project: z.ZodObject<{
|
|
729
|
+
build: z.ZodString;
|
|
730
|
+
seq: z.ZodNumber;
|
|
731
|
+
}, z.core.$strip>;
|
|
732
|
+
modules: z.ZodRecord<z.ZodString & z.ZodType<ModuleFilePath, string, z.core.$ZodTypeInternals<ModuleFilePath, string>>, z.ZodObject<{
|
|
733
|
+
schema: z.ZodString;
|
|
734
|
+
base: z.ZodString;
|
|
735
|
+
chain: z.ZodString;
|
|
736
|
+
}, z.core.$strip>>;
|
|
737
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
738
|
+
since: z.ZodOptional<z.ZodNumber>;
|
|
739
|
+
superseded: z.ZodOptional<z.ZodBoolean>;
|
|
740
|
+
registry: z.ZodOptional<z.ZodObject<{
|
|
741
|
+
entry: z.ZodString;
|
|
742
|
+
core: z.ZodString;
|
|
743
|
+
}, z.core.$strip>>;
|
|
744
|
+
sinceTag: z.ZodOptional<z.ZodString>;
|
|
745
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
746
|
+
unchanged: z.ZodLiteral<true>;
|
|
747
|
+
tag: z.ZodString;
|
|
748
|
+
seq: z.ZodNumber;
|
|
749
|
+
}, z.core.$strip>]>>;
|
|
656
750
|
}, z.core.$strip>, z.ZodObject<{
|
|
657
751
|
type: z.ZodLiteral<"use-websocket">;
|
|
658
752
|
url: z.ZodString;
|
|
659
753
|
nonce: z.ZodString;
|
|
660
754
|
baseSha: z.ZodString;
|
|
661
|
-
schemaSha: z.ZodString
|
|
662
|
-
sourcesSha: z.ZodString
|
|
755
|
+
schemaSha: z.ZodOptional<z.ZodString>;
|
|
756
|
+
sourcesSha: z.ZodOptional<z.ZodString>;
|
|
663
757
|
commitSha: z.ZodOptional<z.ZodString>;
|
|
664
758
|
patches: z.ZodArray<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>>;
|
|
665
759
|
appliedPatches: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>>>;
|
|
@@ -711,6 +805,29 @@ export declare const Api: {
|
|
|
711
805
|
build: z.ZodString;
|
|
712
806
|
seq: z.ZodNumber;
|
|
713
807
|
}, z.core.$strip>>;
|
|
808
|
+
manifest: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
809
|
+
project: z.ZodObject<{
|
|
810
|
+
build: z.ZodString;
|
|
811
|
+
seq: z.ZodNumber;
|
|
812
|
+
}, z.core.$strip>;
|
|
813
|
+
modules: z.ZodRecord<z.ZodString & z.ZodType<ModuleFilePath, string, z.core.$ZodTypeInternals<ModuleFilePath, string>>, z.ZodObject<{
|
|
814
|
+
schema: z.ZodString;
|
|
815
|
+
base: z.ZodString;
|
|
816
|
+
chain: z.ZodString;
|
|
817
|
+
}, z.core.$strip>>;
|
|
818
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
819
|
+
since: z.ZodOptional<z.ZodNumber>;
|
|
820
|
+
superseded: z.ZodOptional<z.ZodBoolean>;
|
|
821
|
+
registry: z.ZodOptional<z.ZodObject<{
|
|
822
|
+
entry: z.ZodString;
|
|
823
|
+
core: z.ZodString;
|
|
824
|
+
}, z.core.$strip>>;
|
|
825
|
+
sinceTag: z.ZodOptional<z.ZodString>;
|
|
826
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
827
|
+
unchanged: z.ZodLiteral<true>;
|
|
828
|
+
tag: z.ZodString;
|
|
829
|
+
seq: z.ZodNumber;
|
|
830
|
+
}, z.core.$strip>]>>;
|
|
714
831
|
}, z.core.$strip>]>;
|
|
715
832
|
}, z.core.$strip>]>;
|
|
716
833
|
};
|
|
@@ -1430,100 +1547,6 @@ export declare const Api: {
|
|
|
1430
1547
|
}, z.core.$strip>]>;
|
|
1431
1548
|
};
|
|
1432
1549
|
};
|
|
1433
|
-
/**
|
|
1434
|
-
* @deprecated The whole tree. Nothing of this release asks it: the Studio
|
|
1435
|
-
* reads modules by version (`GET /manifest`, `GET /modules/~`), the draft
|
|
1436
|
-
* readers and MCP read the head in-process. Kept, with `exclude_patches`
|
|
1437
|
-
* (`BaseAlignment`'s fetch) and the ignored `validate_sources` and
|
|
1438
|
-
* `validate_binary_files`, for a Studio of the release before; goes in the
|
|
1439
|
-
* release after the one that ships this (see "Release-delayed deletions"
|
|
1440
|
-
* in `docs/plans/one-content-model.md`).
|
|
1441
|
-
*/
|
|
1442
|
-
"/sources/~": {
|
|
1443
|
-
PUT: {
|
|
1444
|
-
req: {
|
|
1445
|
-
path: z.ZodOptional<z.ZodString>;
|
|
1446
|
-
query: {
|
|
1447
|
-
validate_sources: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>> & z.ZodType<"true" | "false", string[], z.core.$ZodTypeInternals<"true" | "false", string[]>>, z.ZodTransform<boolean, "true" | "false">>>;
|
|
1448
|
-
validate_binary_files: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>> & z.ZodType<"true" | "false", string[], z.core.$ZodTypeInternals<"true" | "false", string[]>>, z.ZodTransform<boolean, "true" | "false">>>;
|
|
1449
|
-
exclude_patches: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>> & z.ZodType<"true" | "false", string[], z.core.$ZodTypeInternals<"true" | "false", string[]>>, z.ZodTransform<boolean, "true" | "false">>>;
|
|
1450
|
-
apply_patches: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>> & z.ZodType<"true" | "false", string[], z.core.$ZodTypeInternals<"true" | "false", string[]>>, z.ZodTransform<boolean, "true" | "false">>>;
|
|
1451
|
-
};
|
|
1452
|
-
cookies: {
|
|
1453
|
-
val_session: z.ZodOptional<z.ZodString>;
|
|
1454
|
-
};
|
|
1455
|
-
};
|
|
1456
|
-
res: z.ZodUnion<readonly [z.ZodObject<{
|
|
1457
|
-
status: z.ZodLiteral<401>;
|
|
1458
|
-
json: z.ZodObject<{
|
|
1459
|
-
message: z.ZodString;
|
|
1460
|
-
}, z.core.$strip>;
|
|
1461
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1462
|
-
status: z.ZodLiteral<401>;
|
|
1463
|
-
json: z.ZodObject<{
|
|
1464
|
-
message: z.ZodString;
|
|
1465
|
-
}, z.core.$strip>;
|
|
1466
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1467
|
-
status: z.ZodLiteral<500>;
|
|
1468
|
-
json: z.ZodObject<{
|
|
1469
|
-
message: z.ZodString;
|
|
1470
|
-
details: z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
1471
|
-
message: z.ZodString;
|
|
1472
|
-
path: z.ZodOptional<z.ZodString & z.ZodType<ModuleFilePath, string, z.core.$ZodTypeInternals<ModuleFilePath, string>>>;
|
|
1473
|
-
}, z.core.$strip>>, z.ZodObject<{
|
|
1474
|
-
message: z.ZodString;
|
|
1475
|
-
}, z.core.$strip>]>;
|
|
1476
|
-
}, z.core.$strip>;
|
|
1477
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1478
|
-
status: z.ZodLiteral<409>;
|
|
1479
|
-
json: z.ZodObject<{
|
|
1480
|
-
message: z.ZodString;
|
|
1481
|
-
}, z.core.$strip>;
|
|
1482
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1483
|
-
status: z.ZodLiteral<400>;
|
|
1484
|
-
json: z.ZodObject<{
|
|
1485
|
-
message: z.ZodString;
|
|
1486
|
-
details: z.ZodArray<z.ZodObject<{
|
|
1487
|
-
message: z.ZodString;
|
|
1488
|
-
path: z.ZodOptional<z.ZodString & z.ZodType<ModuleFilePath, string, z.core.$ZodTypeInternals<ModuleFilePath, string>>>;
|
|
1489
|
-
}, z.core.$strip>>;
|
|
1490
|
-
}, z.core.$strip>;
|
|
1491
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1492
|
-
status: z.ZodLiteral<200>;
|
|
1493
|
-
json: z.ZodObject<{
|
|
1494
|
-
schemaSha: z.ZodString;
|
|
1495
|
-
sourcesSha: z.ZodString;
|
|
1496
|
-
modules: z.ZodRecord<z.ZodString & z.ZodType<ModuleFilePath, string, z.core.$ZodTypeInternals<ModuleFilePath, string>>, z.ZodObject<{
|
|
1497
|
-
preview: z.ZodOptional<z.ZodAny>;
|
|
1498
|
-
source: z.ZodOptional<z.ZodAny>;
|
|
1499
|
-
baseSource: z.ZodOptional<z.ZodAny>;
|
|
1500
|
-
patches: z.ZodOptional<z.ZodObject<{
|
|
1501
|
-
applied: z.ZodArray<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>>;
|
|
1502
|
-
skipped: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>>>;
|
|
1503
|
-
errors: z.ZodOptional<z.ZodRecord<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>, z.ZodObject<{
|
|
1504
|
-
message: z.ZodString;
|
|
1505
|
-
}, z.core.$strip>>>;
|
|
1506
|
-
}, z.core.$strip>>;
|
|
1507
|
-
validationErrors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
1508
|
-
message: z.ZodString;
|
|
1509
|
-
value: z.ZodOptional<z.ZodUnknown>;
|
|
1510
|
-
fatal: z.ZodOptional<z.ZodBoolean>;
|
|
1511
|
-
fixes: z.ZodOptional<z.ZodArray<z.ZodType<"image:add-metadata" | "image:check-metadata" | "image:upload-remote" | "image:download-remote" | "image:check-remote" | "images:check-remote" | "images:upload-remote" | "file:add-metadata" | "file:check-metadata" | "file:upload-remote" | "file:download-remote" | "file:check-remote" | "files:check-remote" | "files:upload-remote" | "video:add-metadata" | "video:upload-remote" | "video:download-remote" | "videos:add-metadata" | "videos:check-remote" | "videos:upload-remote" | "keyof:check-keys" | "image:check-gallery" | "file:check-gallery" | "video:check-gallery" | "router:check-route" | "locale:check-locale" | "router:check-locale-param" | "images:check-unique-folder" | "files:check-unique-folder" | "images:check-all-files" | "files:check-all-files" | "videos:check-unique-folder" | "videos:check-all-files" | "jsonValues:extract-entry" | "record:fill-keys" | "external:upload" | "view:check-module" | "remote:rewrite-host", unknown, z.core.$ZodTypeInternals<"image:add-metadata" | "image:check-metadata" | "image:upload-remote" | "image:download-remote" | "image:check-remote" | "images:check-remote" | "images:upload-remote" | "file:add-metadata" | "file:check-metadata" | "file:upload-remote" | "file:download-remote" | "file:check-remote" | "files:check-remote" | "files:upload-remote" | "video:add-metadata" | "video:upload-remote" | "video:download-remote" | "videos:add-metadata" | "videos:check-remote" | "videos:upload-remote" | "keyof:check-keys" | "image:check-gallery" | "file:check-gallery" | "video:check-gallery" | "router:check-route" | "locale:check-locale" | "router:check-locale-param" | "images:check-unique-folder" | "files:check-unique-folder" | "images:check-all-files" | "files:check-all-files" | "videos:check-unique-folder" | "videos:check-all-files" | "jsonValues:extract-entry" | "record:fill-keys" | "external:upload" | "view:check-module" | "remote:rewrite-host", unknown>>>>;
|
|
1512
|
-
}, z.core.$strip>>>>;
|
|
1513
|
-
version: z.ZodOptional<z.ZodObject<{
|
|
1514
|
-
schema: z.ZodString;
|
|
1515
|
-
base: z.ZodString;
|
|
1516
|
-
chain: z.ZodString;
|
|
1517
|
-
}, z.core.$strip>>;
|
|
1518
|
-
}, z.core.$strip>>;
|
|
1519
|
-
project: z.ZodOptional<z.ZodObject<{
|
|
1520
|
-
build: z.ZodString;
|
|
1521
|
-
seq: z.ZodNumber;
|
|
1522
|
-
}, z.core.$strip>>;
|
|
1523
|
-
}, z.core.$strip>;
|
|
1524
|
-
}, z.core.$strip>]>;
|
|
1525
|
-
};
|
|
1526
|
-
};
|
|
1527
1550
|
/**
|
|
1528
1551
|
* One module by version: phase 6 of `docs/plans/one-content-model.md`
|
|
1529
1552
|
* ("The Studio loads everything from one place"). `GET /modules/~<path>`,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ModuleFilePath } from "@valbuild/core";
|
|
2
|
+
/**
|
|
3
|
+
* The `val-overlay-spa` event a page sends when what it renders and what the
|
|
4
|
+
* Studio relays have stopped agreeing about the code: these modules came
|
|
5
|
+
* made with another schema than this page's build has. The on-site overlay
|
|
6
|
+
* shows it with a reload; in the Studio's canvas the bridge passes it on
|
|
7
|
+
* (`codeChanged` in `valCanvasProtocol.ts`). An empty list takes it back.
|
|
8
|
+
*/
|
|
9
|
+
export declare const CODE_CHANGED_EVENT = "codeChanged";
|
|
10
|
+
export type CodeChangedDetail = {
|
|
11
|
+
type: typeof CODE_CHANGED_EVENT;
|
|
12
|
+
modules: ModuleFilePath[];
|
|
13
|
+
};
|
|
14
|
+
/** Whether a `val-overlay-spa` event's detail is a {@link CodeChangedDetail}. */
|
|
15
|
+
export declare function isCodeChangedDetail(detail: unknown): detail is CodeChangedDetail;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ModuleFilePath, type PatchId } from "@valbuild/core";
|
|
1
|
+
import { type ModuleFilePath, type PatchId, type SelectorSource, type ValModule } from "@valbuild/core";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
/**
|
|
4
4
|
* What a module's content IS: the schema it is read and patched with, the
|
|
@@ -81,6 +81,15 @@ export declare function chainOf(ids: readonly PatchId[]): string;
|
|
|
81
81
|
* (from what it holds in `SchemaStore`), so the two compare.
|
|
82
82
|
*/
|
|
83
83
|
export declare function schemaVersionOf(serializedSchema: unknown): string;
|
|
84
|
+
/**
|
|
85
|
+
* The version of the schema a reader's own code has for a module: what the
|
|
86
|
+
* readers hold relayed or drafted content's version against (`layered`'s
|
|
87
|
+
* schema rule), so content is never read with a schema it was not made for.
|
|
88
|
+
* The server readers (`fetchVal`) and the page's hooks (`useVal`) alike.
|
|
89
|
+
* Hashed once per module object, which a build makes once: a load cost, not
|
|
90
|
+
* a read cost.
|
|
91
|
+
*/
|
|
92
|
+
export declare function readerSchemaVersion(module: ValModule<SelectorSource>): string | null;
|
|
84
93
|
/**
|
|
85
94
|
* A module's base version, from its base source: what the module evaluates
|
|
86
95
|
* to, or what a content version or a publish put in its place. `.jsonValues()`
|
|
@@ -42,6 +42,12 @@ export type ElementPickerOptions = {
|
|
|
42
42
|
modifier: PickModifier;
|
|
43
43
|
/** On without the modifier: a Select button, or a touch screen. */
|
|
44
44
|
active: () => boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Only what shows a Val field can be picked: the field's element is taken
|
|
47
|
+
* for anything inside it, and nothing outside one is. The Studio's
|
|
48
|
+
* assistant outside code mode, where what can be changed is content.
|
|
49
|
+
*/
|
|
50
|
+
fieldsOnly?: () => boolean;
|
|
45
51
|
/** The element under the pointer while picking; `null` when not picking. */
|
|
46
52
|
onHover: (element: Element | null) => void;
|
|
47
53
|
onPick: (element: Element) => void;
|
|
@@ -88,6 +94,8 @@ export type ElementPicking = {
|
|
|
88
94
|
export declare function startElementPicking(root: HTMLElement, options: {
|
|
89
95
|
modifier: PickModifier;
|
|
90
96
|
active: () => boolean;
|
|
97
|
+
/** See `ElementPickerOptions.fieldsOnly`. */
|
|
98
|
+
fieldsOnly?: () => boolean;
|
|
91
99
|
color: string;
|
|
92
100
|
onPick: (picked: PickedElement) => void;
|
|
93
101
|
/** Esc while `active`: the Studio turns Select off. */
|
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
* --- /about a route: what follows is the page at /about
|
|
6
6
|
* # Our people text (a heading: #, ## or ###)
|
|
7
7
|
* We are 40 people in Oslo. text (a paragraph)
|
|
8
|
-
* ## Hi {field: /x.val.ts?p="t"} text linked to a content field: typing
|
|
9
|
-
* in it writes the field
|
|
10
8
|
* [image: Team photo] placeholder: [kind] or [kind: label]
|
|
11
9
|
* [hero: Roof](image: /a.jpg) a placeholder with an image (or video) in it
|
|
12
10
|
* icon hero M3 5h18v14H3z how every [hero] box is drawn: SVG path data
|
|
@@ -62,13 +60,6 @@ export type SketchText = {
|
|
|
62
60
|
/** 0 is a paragraph; 1-3 are headings. */
|
|
63
61
|
level: 0 | 1 | 2 | 3;
|
|
64
62
|
text: string;
|
|
65
|
-
/**
|
|
66
|
-
* The content field this text is linked to, as a source path
|
|
67
|
-
* (`/content/home.val.ts?p="hero"."title"`): typing in the block writes
|
|
68
|
-
* the field. Written `{field: <source path>}` at the end of the line. One
|
|
69
|
-
* block per field: a second link to the same field is not one.
|
|
70
|
-
*/
|
|
71
|
-
field?: string;
|
|
72
63
|
};
|
|
73
64
|
export type SketchPlaceholder = {
|
|
74
65
|
type: "placeholder";
|
|
@@ -109,7 +100,7 @@ export declare function parseSketch(source: string): ParsedSketch;
|
|
|
109
100
|
* The line a text block is written as. Line breaks become spaces, and a
|
|
110
101
|
* paragraph that would read as something else is kept as text with `\`.
|
|
111
102
|
*/
|
|
112
|
-
export declare function formatSketchText(level: SketchText["level"], text: string
|
|
103
|
+
export declare function formatSketchText(level: SketchText["level"], text: string): string;
|
|
113
104
|
/** The line a placeholder is written as. */
|
|
114
105
|
export declare function formatSketchBox(placeholder: Pick<SketchPlaceholder, "kind" | "label" | "media">): string;
|
|
115
106
|
/**
|
|
@@ -122,12 +113,6 @@ export declare function formatSketchBox(placeholder: Pick<SketchPlaceholder, "ki
|
|
|
122
113
|
* it is not on the page.
|
|
123
114
|
*/
|
|
124
115
|
export declare function formatSketch(blocks: SketchNode[], icons: Record<string, string>): string;
|
|
125
|
-
/**
|
|
126
|
-
* The text of every block linked to a field, by field: what the Studio
|
|
127
|
-
* writes to the content when a linked block changes. The first block wins,
|
|
128
|
-
* as `formatSketch` keeps only its link.
|
|
129
|
-
*/
|
|
130
|
-
export declare function sketchFieldTexts(blocks: SketchNode[]): Map<string, string>;
|
|
131
116
|
/** The pages a sketch is about, in the order it gives them. */
|
|
132
117
|
export declare function sketchRoutes(blocks: SketchNode[]): string[];
|
|
133
118
|
/**
|
|
@@ -211,6 +211,13 @@ export type ValCanvasPageMessage = {
|
|
|
211
211
|
*/
|
|
212
212
|
val: typeof VAL_CANVAS_MESSAGE;
|
|
213
213
|
type: "elementPickingStopped";
|
|
214
|
+
} | {
|
|
215
|
+
/**
|
|
216
|
+
* Esc on the page while picking FIELDS (`setPicking`): Content's Select
|
|
217
|
+
* turns off. Its twin for any element is `elementPickingStopped`.
|
|
218
|
+
*/
|
|
219
|
+
val: typeof VAL_CANVAS_MESSAGE;
|
|
220
|
+
type: "pickingStopped";
|
|
214
221
|
} | ({
|
|
215
222
|
/**
|
|
216
223
|
* Where the page is: its path and scroll, as it moves. A new build
|
|
@@ -245,6 +252,16 @@ export type ValCanvasPageMessage = {
|
|
|
245
252
|
type: "quickPreviewStored";
|
|
246
253
|
id: string;
|
|
247
254
|
error?: string;
|
|
255
|
+
} | {
|
|
256
|
+
/**
|
|
257
|
+
* Modules the Studio sent made with another schema than this page's
|
|
258
|
+
* build has: the page shows its bundle's content for them instead, and
|
|
259
|
+
* the Studio says the code changed, with a reload. An empty list: the
|
|
260
|
+
* page's code caught up (`CodeChangedDetail`).
|
|
261
|
+
*/
|
|
262
|
+
val: typeof VAL_CANVAS_MESSAGE;
|
|
263
|
+
type: "codeChanged";
|
|
264
|
+
modules: ModuleFilePath[];
|
|
248
265
|
};
|
|
249
266
|
/** What the studio tells the page. */
|
|
250
267
|
export type ValCanvasStudioMessage = {
|
|
@@ -275,20 +292,12 @@ export type ValCanvasStudioMessage = {
|
|
|
275
292
|
type: "sourceUpdate";
|
|
276
293
|
moduleFilePath: ModuleFilePath;
|
|
277
294
|
/**
|
|
278
|
-
* The
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
* of the release before. Goes in the release after the one that ships
|
|
283
|
-
* `read`, with the bridges' fallback that reads it: see
|
|
284
|
-
* "Release-delayed deletions" in `docs/plans/one-content-model.md`.
|
|
285
|
-
*/
|
|
286
|
-
source: unknown;
|
|
287
|
-
/**
|
|
288
|
-
* The same module as a read (`ModuleRead`), which the page keeps as it
|
|
289
|
-
* is. Optional: a Studio from the release before sends `source` alone.
|
|
295
|
+
* The module as a read (`ModuleRead`: its source and version), which
|
|
296
|
+
* the page keeps as it is. `unknown` because the page's own types are
|
|
297
|
+
* the ones that give it meaning; nothing in between should be
|
|
298
|
+
* interpreting it.
|
|
290
299
|
*/
|
|
291
|
-
read
|
|
300
|
+
read: unknown;
|
|
292
301
|
} | {
|
|
293
302
|
/**
|
|
294
303
|
* Everything the studio holds has been sent.
|
|
@@ -374,6 +383,17 @@ export type ValCanvasStudioMessage = {
|
|
|
374
383
|
modifier: PickModifier;
|
|
375
384
|
/** Whether the studio still holds the last pick: false takes its outline down. */
|
|
376
385
|
keepPicked: boolean;
|
|
386
|
+
/**
|
|
387
|
+
* Only Val's fields can be picked (`fieldsOnly` in `elementPicker.ts`):
|
|
388
|
+
* the Studio's assistant outside code mode. Absent is any element, so
|
|
389
|
+
* a studio that predates it is answered as before.
|
|
390
|
+
*/
|
|
391
|
+
fieldsOnly?: boolean;
|
|
392
|
+
/**
|
|
393
|
+
* What to outline in, instead of the `theme`'s selection colour: code
|
|
394
|
+
* mode's proposal colour. A bridge that predates it uses the theme's.
|
|
395
|
+
*/
|
|
396
|
+
color?: string;
|
|
377
397
|
} | {
|
|
378
398
|
/** Scroll to where the page before this one was (`location`). */
|
|
379
399
|
val: typeof VAL_CANVAS_MESSAGE;
|
|
@@ -414,6 +434,7 @@ export type ValCanvasStudioMessage = {
|
|
|
414
434
|
};
|
|
415
435
|
/** Narrow an unknown `event.data` to a message from the page. */
|
|
416
436
|
export declare function isValCanvasPageMessage(data: unknown): data is ValCanvasPageMessage;
|
|
437
|
+
export declare function isCanvasSelectionColor(value: unknown): value is string;
|
|
417
438
|
/** Narrow an unknown `event.data` to a message from the studio. */
|
|
418
439
|
export declare function isValCanvasStudioMessage(data: unknown): data is ValCanvasStudioMessage;
|
|
419
440
|
/**
|
|
@@ -16,7 +16,12 @@ export type StudioBuilder = {
|
|
|
16
16
|
publishArtifacts: Builder["publishArtifacts"];
|
|
17
17
|
/** A build's name, before building it: see `buildInputId`. */
|
|
18
18
|
buildInputId: Builder["buildInputId"];
|
|
19
|
-
/**
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* A tree's Val modules, as one module to evaluate: see `bundleValModules`.
|
|
21
|
+
* The Studio evaluates the code and nothing else; what each module depends
|
|
22
|
+
* on is for the server build (`moduleDependencies`), so it is not asked of
|
|
23
|
+
* the builder here.
|
|
24
|
+
*/
|
|
25
|
+
bundleValModules: (...args: Parameters<Builder["bundleValModules"]>) => Promise<Pick<Awaited<ReturnType<Builder["bundleValModules"]>>, "code">>;
|
|
21
26
|
};
|
|
22
27
|
export {};
|