@valbuild/shared 0.153.0 → 0.153.5
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 +20 -0
- package/client/dist/valbuild-shared-client.cjs.dev.js +3 -1
- package/client/dist/valbuild-shared-client.cjs.prod.js +3 -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 +4 -0
- 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/index.d.ts +1 -0
- package/dist/declarations/src/internal/sketchpad/sketchFormat.d.ts +1 -16
- package/dist/declarations/src/internal/valCanvasProtocol.d.ts +10 -0
- package/dist/{getSitemapTree-32643b50.cjs.dev.js → getSitemapTree-09399379.cjs.dev.js} +21 -1
- package/dist/{getSitemapTree-a887fed4.esm.js → getSitemapTree-6d875612.esm.js} +20 -2
- package/dist/{getSitemapTree-a4738117.cjs.prod.js → getSitemapTree-7ed70b4a.cjs.prod.js} +21 -1
- package/internal/dist/valbuild-shared-internal.cjs.dev.js +42 -63
- package/internal/dist/valbuild-shared-internal.cjs.prod.js +42 -63
- package/internal/dist/valbuild-shared-internal.esm.js +40 -63
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @valbuild/shared
|
|
2
2
|
|
|
3
|
+
## 0.153.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1037](https://github.com/valbuild/val/pull/1037) [`0176db3`](https://github.com/valbuild/val/commit/0176db30d8d621002cf72025b063b6f62b79b00d) Thanks [@freekh](https://github.com/freekh)! - The assistant's default model is now chosen by Val Build, not built into the Studio, so it can change for every project without a Val upgrade. It starts on the newest Claude Sonnet the project's Anthropic key can reach, or, with only an OpenAI key, the newest GPT of OpenAI's balanced tier (such as `gpt-6.1-sol`). A model an editor has picked themselves is still remembered and still wins. The built-in fallback catalog, used only when the models cannot be listed, now offers the Claude 5.5 models.
|
|
8
|
+
- Updated dependencies [[`6b3f4c5`](https://github.com/valbuild/val/commit/6b3f4c53ad51a86027654f64da5fb332f40df37f)]:
|
|
9
|
+
- @valbuild/core@0.153.5
|
|
10
|
+
|
|
11
|
+
## 0.153.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#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.
|
|
16
|
+
|
|
17
|
+
- [#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.
|
|
18
|
+
|
|
19
|
+
- **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.
|
|
20
|
+
- **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.
|
|
21
|
+
- **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.
|
|
22
|
+
|
|
3
23
|
## 0.153.0
|
|
4
24
|
|
|
5
25
|
### Minor 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;
|
|
@@ -32,6 +33,7 @@ exports.getPageRouterSourceFolder = getSitemapTree.getPageRouterSourceFolder;
|
|
|
32
33
|
exports.getPatternFromModuleFilePath = getSitemapTree.getPatternFromModuleFilePath;
|
|
33
34
|
exports.getTanStackRouterSourceFolder = getSitemapTree.getTanStackRouterSourceFolder;
|
|
34
35
|
exports.isCanvasSelectionColor = getSitemapTree.isCanvasSelectionColor;
|
|
36
|
+
exports.isCodeChangedDetail = getSitemapTree.isCodeChangedDetail;
|
|
35
37
|
exports.isQuickPreviewFiles = getSitemapTree.isQuickPreviewFiles;
|
|
36
38
|
exports.isTanStackRoutesFolder = getSitemapTree.isTanStackRoutesFolder;
|
|
37
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;
|
|
@@ -32,6 +33,7 @@ exports.getPageRouterSourceFolder = getSitemapTree.getPageRouterSourceFolder;
|
|
|
32
33
|
exports.getPatternFromModuleFilePath = getSitemapTree.getPatternFromModuleFilePath;
|
|
33
34
|
exports.getTanStackRouterSourceFolder = getSitemapTree.getTanStackRouterSourceFolder;
|
|
34
35
|
exports.isCanvasSelectionColor = getSitemapTree.isCanvasSelectionColor;
|
|
36
|
+
exports.isCodeChangedDetail = getSitemapTree.isCodeChangedDetail;
|
|
35
37
|
exports.isQuickPreviewFiles = getSitemapTree.isQuickPreviewFiles;
|
|
36
38
|
exports.isTanStackRoutesFolder = getSitemapTree.isTanStackRoutesFolder;
|
|
37
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";
|
|
@@ -2605,6 +2605,10 @@ export declare const Api: {
|
|
|
2605
2605
|
label: z.ZodString;
|
|
2606
2606
|
contextWindow: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
2607
2607
|
}, z.core.$strip>>>;
|
|
2608
|
+
defaultModel: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
2609
|
+
provider: z.ZodString;
|
|
2610
|
+
model: z.ZodString;
|
|
2611
|
+
}, z.core.$strip>>>;
|
|
2608
2612
|
}, z.core.$strip>;
|
|
2609
2613
|
}, z.core.$strip>, z.ZodObject<{
|
|
2610
2614
|
status: z.ZodLiteral<500>;
|
|
@@ -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()`
|
|
@@ -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
|
/**
|
|
@@ -252,6 +252,16 @@ export type ValCanvasPageMessage = {
|
|
|
252
252
|
type: "quickPreviewStored";
|
|
253
253
|
id: string;
|
|
254
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[];
|
|
255
265
|
};
|
|
256
266
|
/** What the studio tells the page. */
|
|
257
267
|
export type ValCanvasStudioMessage = {
|
|
@@ -250,7 +250,7 @@ function isValCanvasPageMessage(data) {
|
|
|
250
250
|
if (createForOfIteratorHelper._typeof(data) !== "object" || data === null) return false;
|
|
251
251
|
var message = data;
|
|
252
252
|
if (message.val !== VAL_CANVAS_MESSAGE) return false;
|
|
253
|
-
return message.type === "ready" && isModulePathList(data.holds) && isHeldVersions(data.holdsVersions) || message.type === "elements" || message.type === "clicked" || message.type === "pinch" || message.type === "zoom" || message.type === "refreshing" || message.type === "elementPickingStopped" || message.type === "pickingStopped" || message.type === "elementPicked" && isPickedElement(data.element) || message.type === "location" && isPageLocation(data) || message.type === "pageRead" && typeof data.requestId === "string" || message.type === "pageScreenshot" && typeof data.requestId === "string" || message.type === "quickPreviewStored" && typeof data.id === "string";
|
|
253
|
+
return message.type === "ready" && isModulePathList(data.holds) && isHeldVersions(data.holdsVersions) || message.type === "elements" || message.type === "clicked" || message.type === "pinch" || message.type === "zoom" || message.type === "refreshing" || message.type === "elementPickingStopped" || message.type === "pickingStopped" || message.type === "elementPicked" && isPickedElement(data.element) || message.type === "location" && isPageLocation(data) || message.type === "pageRead" && typeof data.requestId === "string" || message.type === "pageScreenshot" && typeof data.requestId === "string" || message.type === "quickPreviewStored" && typeof data.id === "string" || message.type === "codeChanged" && Array.isArray(data.modules) && isModulePathList(data.modules);
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
/** `holdsVersions` on `ready`: absent, or a version per module path. */
|
|
@@ -373,6 +373,24 @@ function withValCanvasParam(url) {
|
|
|
373
373
|
return "".concat(url).concat(separator).concat(VAL_CANVAS_PARAM, "=1");
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
+
/**
|
|
377
|
+
* The `val-overlay-spa` event a page sends when what it renders and what the
|
|
378
|
+
* Studio relays have stopped agreeing about the code: these modules came
|
|
379
|
+
* made with another schema than this page's build has. The on-site overlay
|
|
380
|
+
* shows it with a reload; in the Studio's canvas the bridge passes it on
|
|
381
|
+
* (`codeChanged` in `valCanvasProtocol.ts`). An empty list takes it back.
|
|
382
|
+
*/
|
|
383
|
+
var CODE_CHANGED_EVENT = "codeChanged";
|
|
384
|
+
/** Whether a `val-overlay-spa` event's detail is a {@link CodeChangedDetail}. */
|
|
385
|
+
function isCodeChangedDetail(detail) {
|
|
386
|
+
if (createForOfIteratorHelper._typeof(detail) !== "object" || detail === null) return false;
|
|
387
|
+
if (!("type" in detail) || detail.type !== CODE_CHANGED_EVENT) return false;
|
|
388
|
+
if (!("modules" in detail) || !Array.isArray(detail.modules)) return false;
|
|
389
|
+
return detail.modules.every(function (module) {
|
|
390
|
+
return typeof module === "string" && module.startsWith("/");
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
|
|
376
394
|
/**
|
|
377
395
|
* Pointing at anything on a page, as Lovable's picker does: hover outlines
|
|
378
396
|
* the element under the pointer, a click picks it, and the assistant is told
|
|
@@ -1464,6 +1482,7 @@ function getPatternFromModuleFilePath(moduleFilePath, srcFolder) {
|
|
|
1464
1482
|
.replace("/page.val.ts", "").replace("/page.val.js", "");
|
|
1465
1483
|
}
|
|
1466
1484
|
|
|
1485
|
+
exports.CODE_CHANGED_EVENT = CODE_CHANGED_EVENT;
|
|
1467
1486
|
exports.DEFAULT_CANVAS_SELECTION = DEFAULT_CANVAS_SELECTION;
|
|
1468
1487
|
exports.DEFAULT_CANVAS_SELECTION_SOFT = DEFAULT_CANVAS_SELECTION_SOFT;
|
|
1469
1488
|
exports.QUICK_PREVIEW_PARAM = QUICK_PREVIEW_PARAM;
|
|
@@ -1488,6 +1507,7 @@ exports.getPageRouterSourceFolder = getPageRouterSourceFolder;
|
|
|
1488
1507
|
exports.getPatternFromModuleFilePath = getPatternFromModuleFilePath;
|
|
1489
1508
|
exports.getTanStackRouterSourceFolder = getTanStackRouterSourceFolder;
|
|
1490
1509
|
exports.isCanvasSelectionColor = isCanvasSelectionColor;
|
|
1510
|
+
exports.isCodeChangedDetail = isCodeChangedDetail;
|
|
1491
1511
|
exports.isQuickPreviewFiles = isQuickPreviewFiles;
|
|
1492
1512
|
exports.isTanStackRoutesFolder = isTanStackRoutesFolder;
|
|
1493
1513
|
exports.isValCanvasFrame = isValCanvasFrame;
|
|
@@ -230,7 +230,7 @@ function isValCanvasPageMessage(data) {
|
|
|
230
230
|
if (_typeof(data) !== "object" || data === null) return false;
|
|
231
231
|
var message = data;
|
|
232
232
|
if (message.val !== VAL_CANVAS_MESSAGE) return false;
|
|
233
|
-
return message.type === "ready" && isModulePathList(data.holds) && isHeldVersions(data.holdsVersions) || message.type === "elements" || message.type === "clicked" || message.type === "pinch" || message.type === "zoom" || message.type === "refreshing" || message.type === "elementPickingStopped" || message.type === "pickingStopped" || message.type === "elementPicked" && isPickedElement(data.element) || message.type === "location" && isPageLocation(data) || message.type === "pageRead" && typeof data.requestId === "string" || message.type === "pageScreenshot" && typeof data.requestId === "string" || message.type === "quickPreviewStored" && typeof data.id === "string";
|
|
233
|
+
return message.type === "ready" && isModulePathList(data.holds) && isHeldVersions(data.holdsVersions) || message.type === "elements" || message.type === "clicked" || message.type === "pinch" || message.type === "zoom" || message.type === "refreshing" || message.type === "elementPickingStopped" || message.type === "pickingStopped" || message.type === "elementPicked" && isPickedElement(data.element) || message.type === "location" && isPageLocation(data) || message.type === "pageRead" && typeof data.requestId === "string" || message.type === "pageScreenshot" && typeof data.requestId === "string" || message.type === "quickPreviewStored" && typeof data.id === "string" || message.type === "codeChanged" && Array.isArray(data.modules) && isModulePathList(data.modules);
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
/** `holdsVersions` on `ready`: absent, or a version per module path. */
|
|
@@ -353,6 +353,24 @@ function withValCanvasParam(url) {
|
|
|
353
353
|
return "".concat(url).concat(separator).concat(VAL_CANVAS_PARAM, "=1");
|
|
354
354
|
}
|
|
355
355
|
|
|
356
|
+
/**
|
|
357
|
+
* The `val-overlay-spa` event a page sends when what it renders and what the
|
|
358
|
+
* Studio relays have stopped agreeing about the code: these modules came
|
|
359
|
+
* made with another schema than this page's build has. The on-site overlay
|
|
360
|
+
* shows it with a reload; in the Studio's canvas the bridge passes it on
|
|
361
|
+
* (`codeChanged` in `valCanvasProtocol.ts`). An empty list takes it back.
|
|
362
|
+
*/
|
|
363
|
+
var CODE_CHANGED_EVENT = "codeChanged";
|
|
364
|
+
/** Whether a `val-overlay-spa` event's detail is a {@link CodeChangedDetail}. */
|
|
365
|
+
function isCodeChangedDetail(detail) {
|
|
366
|
+
if (_typeof(detail) !== "object" || detail === null) return false;
|
|
367
|
+
if (!("type" in detail) || detail.type !== CODE_CHANGED_EVENT) return false;
|
|
368
|
+
if (!("modules" in detail) || !Array.isArray(detail.modules)) return false;
|
|
369
|
+
return detail.modules.every(function (module) {
|
|
370
|
+
return typeof module === "string" && module.startsWith("/");
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
|
|
356
374
|
/**
|
|
357
375
|
* Pointing at anything on a page, as Lovable's picker does: hover outlines
|
|
358
376
|
* the element under the pointer, a click picks it, and the assistant is told
|
|
@@ -1444,4 +1462,4 @@ function getPatternFromModuleFilePath(moduleFilePath, srcFolder) {
|
|
|
1444
1462
|
.replace("/page.val.ts", "").replace("/page.val.js", "");
|
|
1445
1463
|
}
|
|
1446
1464
|
|
|
1447
|
-
export {
|
|
1465
|
+
export { isQuickPreviewFiles as A, QUICK_PREVIEW_SERVICE_WORKER_SOURCE as B, CODE_CHANGED_EVENT as C, DEFAULT_CANVAS_SELECTION as D, storeQuickPreview as E, withQuickPreviewParam as F, parseRoutePattern as G, formatRoutePattern as H, getNextAppRouterSourceFolder as I, getTanStackRouterSourceFolder as J, getPageRouterSourceFolder as K, isTanStackRoutesFolder as L, getPageRouterSitemapTree as M, getPatternFromModuleFilePath as N, QUICK_PREVIEW_PARAM as Q, VAL_CONFIG_SESSION_STORAGE_KEY as V, VAL_THEME_SESSION_STORAGE_KEY as a, VAL_AI_SESSION_STORAGE_KEY as b, VAL_CANVAS_PARAM as c, VAL_CANVAS_MESSAGE as d, DEFAULT_CANVAS_SELECTION_SOFT as e, isCanvasSelectionColor as f, isValCanvasStudioMessage as g, isValCanvasFrame as h, isValCanvasPageMessage as i, isCodeChangedDetail as j, describeElement as k, attachElementPicker as l, modifierLabel as m, createPickerOverlay as n, elementLabel as o, pageLocationOf as p, watchPageLocation as q, restoreScroll as r, startElementPicking as s, readPageSnapshot as t, findBySelector as u, screenshotPage as v, withValCanvasParam as w, QUICK_PREVIEW_SERVICE_WORKER_PATH as x, QUICK_PREVIEW_RENDER_SCRIPT as y, QUICK_PREVIEW_STORE_MESSAGE as z };
|
|
@@ -250,7 +250,7 @@ function isValCanvasPageMessage(data) {
|
|
|
250
250
|
if (createForOfIteratorHelper._typeof(data) !== "object" || data === null) return false;
|
|
251
251
|
var message = data;
|
|
252
252
|
if (message.val !== VAL_CANVAS_MESSAGE) return false;
|
|
253
|
-
return message.type === "ready" && isModulePathList(data.holds) && isHeldVersions(data.holdsVersions) || message.type === "elements" || message.type === "clicked" || message.type === "pinch" || message.type === "zoom" || message.type === "refreshing" || message.type === "elementPickingStopped" || message.type === "pickingStopped" || message.type === "elementPicked" && isPickedElement(data.element) || message.type === "location" && isPageLocation(data) || message.type === "pageRead" && typeof data.requestId === "string" || message.type === "pageScreenshot" && typeof data.requestId === "string" || message.type === "quickPreviewStored" && typeof data.id === "string";
|
|
253
|
+
return message.type === "ready" && isModulePathList(data.holds) && isHeldVersions(data.holdsVersions) || message.type === "elements" || message.type === "clicked" || message.type === "pinch" || message.type === "zoom" || message.type === "refreshing" || message.type === "elementPickingStopped" || message.type === "pickingStopped" || message.type === "elementPicked" && isPickedElement(data.element) || message.type === "location" && isPageLocation(data) || message.type === "pageRead" && typeof data.requestId === "string" || message.type === "pageScreenshot" && typeof data.requestId === "string" || message.type === "quickPreviewStored" && typeof data.id === "string" || message.type === "codeChanged" && Array.isArray(data.modules) && isModulePathList(data.modules);
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
/** `holdsVersions` on `ready`: absent, or a version per module path. */
|
|
@@ -373,6 +373,24 @@ function withValCanvasParam(url) {
|
|
|
373
373
|
return "".concat(url).concat(separator).concat(VAL_CANVAS_PARAM, "=1");
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
+
/**
|
|
377
|
+
* The `val-overlay-spa` event a page sends when what it renders and what the
|
|
378
|
+
* Studio relays have stopped agreeing about the code: these modules came
|
|
379
|
+
* made with another schema than this page's build has. The on-site overlay
|
|
380
|
+
* shows it with a reload; in the Studio's canvas the bridge passes it on
|
|
381
|
+
* (`codeChanged` in `valCanvasProtocol.ts`). An empty list takes it back.
|
|
382
|
+
*/
|
|
383
|
+
var CODE_CHANGED_EVENT = "codeChanged";
|
|
384
|
+
/** Whether a `val-overlay-spa` event's detail is a {@link CodeChangedDetail}. */
|
|
385
|
+
function isCodeChangedDetail(detail) {
|
|
386
|
+
if (createForOfIteratorHelper._typeof(detail) !== "object" || detail === null) return false;
|
|
387
|
+
if (!("type" in detail) || detail.type !== CODE_CHANGED_EVENT) return false;
|
|
388
|
+
if (!("modules" in detail) || !Array.isArray(detail.modules)) return false;
|
|
389
|
+
return detail.modules.every(function (module) {
|
|
390
|
+
return typeof module === "string" && module.startsWith("/");
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
|
|
376
394
|
/**
|
|
377
395
|
* Pointing at anything on a page, as Lovable's picker does: hover outlines
|
|
378
396
|
* the element under the pointer, a click picks it, and the assistant is told
|
|
@@ -1464,6 +1482,7 @@ function getPatternFromModuleFilePath(moduleFilePath, srcFolder) {
|
|
|
1464
1482
|
.replace("/page.val.ts", "").replace("/page.val.js", "");
|
|
1465
1483
|
}
|
|
1466
1484
|
|
|
1485
|
+
exports.CODE_CHANGED_EVENT = CODE_CHANGED_EVENT;
|
|
1467
1486
|
exports.DEFAULT_CANVAS_SELECTION = DEFAULT_CANVAS_SELECTION;
|
|
1468
1487
|
exports.DEFAULT_CANVAS_SELECTION_SOFT = DEFAULT_CANVAS_SELECTION_SOFT;
|
|
1469
1488
|
exports.QUICK_PREVIEW_PARAM = QUICK_PREVIEW_PARAM;
|
|
@@ -1488,6 +1507,7 @@ exports.getPageRouterSourceFolder = getPageRouterSourceFolder;
|
|
|
1488
1507
|
exports.getPatternFromModuleFilePath = getPatternFromModuleFilePath;
|
|
1489
1508
|
exports.getTanStackRouterSourceFolder = getTanStackRouterSourceFolder;
|
|
1490
1509
|
exports.isCanvasSelectionColor = isCanvasSelectionColor;
|
|
1510
|
+
exports.isCodeChangedDetail = isCodeChangedDetail;
|
|
1491
1511
|
exports.isQuickPreviewFiles = isQuickPreviewFiles;
|
|
1492
1512
|
exports.isTanStackRoutesFolder = isTanStackRoutesFolder;
|
|
1493
1513
|
exports.isValCanvasFrame = isValCanvasFrame;
|
|
@@ -10,7 +10,7 @@ var wrapNativeSuper = require('../../dist/wrapNativeSuper-933f991e.cjs.dev.js');
|
|
|
10
10
|
var zodValidationError = require('zod-validation-error');
|
|
11
11
|
var fp = require('@valbuild/core/fp');
|
|
12
12
|
var patch = require('@valbuild/core/patch');
|
|
13
|
-
var getSitemapTree = require('../../dist/getSitemapTree-
|
|
13
|
+
var getSitemapTree = require('../../dist/getSitemapTree-09399379.cjs.dev.js');
|
|
14
14
|
var FlexSearch = require('flexsearch');
|
|
15
15
|
var utils = require('../../dist/utils-d3d8b4b5.cjs.dev.js');
|
|
16
16
|
|
|
@@ -1351,6 +1351,24 @@ function chainOf(ids) {
|
|
|
1351
1351
|
function schemaVersionOf(serializedSchema) {
|
|
1352
1352
|
return sha256Hex("".concat(ENGINE, "\n").concat(JSON.stringify(serializedSchema)));
|
|
1353
1353
|
}
|
|
1354
|
+
var readerSchemaVersions = new WeakMap();
|
|
1355
|
+
|
|
1356
|
+
/**
|
|
1357
|
+
* The version of the schema a reader's own code has for a module: what the
|
|
1358
|
+
* readers hold relayed or drafted content's version against (`layered`'s
|
|
1359
|
+
* schema rule), so content is never read with a schema it was not made for.
|
|
1360
|
+
* The server readers (`fetchVal`) and the page's hooks (`useVal`) alike.
|
|
1361
|
+
* Hashed once per module object, which a build makes once: a load cost, not
|
|
1362
|
+
* a read cost.
|
|
1363
|
+
*/
|
|
1364
|
+
function readerSchemaVersion(module) {
|
|
1365
|
+
var cached = readerSchemaVersions.get(module);
|
|
1366
|
+
if (cached !== undefined) return cached;
|
|
1367
|
+
var schema = core.Internal.getSchema(module);
|
|
1368
|
+
var version = schema === undefined ? null : schemaVersionOf(schema["executeSerialize"]());
|
|
1369
|
+
readerSchemaVersions.set(module, version);
|
|
1370
|
+
return version;
|
|
1371
|
+
}
|
|
1354
1372
|
|
|
1355
1373
|
/**
|
|
1356
1374
|
* A module's base version, from its base source: what the module evaluates
|
|
@@ -4115,7 +4133,20 @@ var Api = {
|
|
|
4115
4133
|
model: zod.z.string(),
|
|
4116
4134
|
label: zod.z.string(),
|
|
4117
4135
|
contextWindow: zod.z.number().nullable().optional()
|
|
4118
|
-
})).optional()
|
|
4136
|
+
})).optional(),
|
|
4137
|
+
/**
|
|
4138
|
+
* The model a chat starts on until the editor picks one.
|
|
4139
|
+
*
|
|
4140
|
+
* Chosen by the content server, from `models`, so the default can
|
|
4141
|
+
* change for every project at once rather than at each project's
|
|
4142
|
+
* next Val upgrade. Null or absent (an older content server, or
|
|
4143
|
+
* nothing it recognised) means the Studio picks from its own
|
|
4144
|
+
* catalog.
|
|
4145
|
+
*/
|
|
4146
|
+
defaultModel: zod.z.object({
|
|
4147
|
+
provider: zod.z.string(),
|
|
4148
|
+
model: zod.z.string()
|
|
4149
|
+
}).nullable().optional()
|
|
4119
4150
|
})
|
|
4120
4151
|
}), zod.z.object({
|
|
4121
4152
|
status: zod.z.literal(500),
|
|
@@ -8229,8 +8260,6 @@ var toolNames = ["get_all_schema", "get_source", "search_content", "validate_con
|
|
|
8229
8260
|
* --- /about a route: what follows is the page at /about
|
|
8230
8261
|
* # Our people text (a heading: #, ## or ###)
|
|
8231
8262
|
* We are 40 people in Oslo. text (a paragraph)
|
|
8232
|
-
* ## Hi {field: /x.val.ts?p="t"} text linked to a content field: typing
|
|
8233
|
-
* in it writes the field
|
|
8234
8263
|
* [image: Team photo] placeholder: [kind] or [kind: label]
|
|
8235
8264
|
* [hero: Roof](image: /a.jpg) a placeholder with an image (or video) in it
|
|
8236
8265
|
* icon hero M3 5h18v14H3z how every [hero] box is drawn: SVG path data
|
|
@@ -8386,27 +8415,7 @@ function parseSketch(source) {
|
|
|
8386
8415
|
errors: errors
|
|
8387
8416
|
};
|
|
8388
8417
|
}
|
|
8389
|
-
|
|
8390
|
-
/** The link to a content field at the end of a text line. */
|
|
8391
|
-
var FIELD = / \{field: (\/[^{}]*)\}$/;
|
|
8392
|
-
function parseContent(whole, line, errors) {
|
|
8393
|
-
var link = FIELD.exec(whole);
|
|
8394
|
-
if (link) {
|
|
8395
|
-
var node = parseLine(whole.slice(0, link.index), line, errors);
|
|
8396
|
-
if (node.type !== "text") {
|
|
8397
|
-
errors.push({
|
|
8398
|
-
line: line,
|
|
8399
|
-
message: "Only a heading or a paragraph is linked to a field: put {field: ...} at the end of one."
|
|
8400
|
-
});
|
|
8401
|
-
return node;
|
|
8402
|
-
}
|
|
8403
|
-
return createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, node), {}, {
|
|
8404
|
-
field: link[1].trim()
|
|
8405
|
-
});
|
|
8406
|
-
}
|
|
8407
|
-
return parseLine(whole, line, errors);
|
|
8408
|
-
}
|
|
8409
|
-
function parseLine(content, line, errors) {
|
|
8418
|
+
function parseContent(content, line, errors) {
|
|
8410
8419
|
// A leading backslash keeps a line that looks like a keyword as text.
|
|
8411
8420
|
if (content.startsWith("\\")) {
|
|
8412
8421
|
return {
|
|
@@ -8513,19 +8522,13 @@ function parseLine(content, line, errors) {
|
|
|
8513
8522
|
* The line a text block is written as. Line breaks become spaces, and a
|
|
8514
8523
|
* paragraph that would read as something else is kept as text with `\`.
|
|
8515
8524
|
*/
|
|
8516
|
-
function formatSketchText(level, text
|
|
8525
|
+
function formatSketchText(level, text) {
|
|
8517
8526
|
var flat = text.replace(/\s+/g, " ").trim();
|
|
8518
|
-
var path = field === null || field === void 0 ? void 0 : field.replace(/\s+/g, " ").trim();
|
|
8519
|
-
// A source path, and one the line can be read back with: no braces.
|
|
8520
|
-
var link = path && /^\/[^{}]*$/.test(path) ? " {field: ".concat(path, "}") : "";
|
|
8521
8527
|
if (level > 0) {
|
|
8522
|
-
return "#".repeat(level) + " " + flat
|
|
8528
|
+
return "#".repeat(level) + " " + flat;
|
|
8523
8529
|
}
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
var whole = flat + link;
|
|
8527
|
-
var ambiguous = flat.startsWith("\\") || flat.startsWith("[") || CONTAINER.test(whole) || ROUTE.test(whole) || HEADING.test(whole) || ICON.test(whole);
|
|
8528
|
-
return (ambiguous ? "\\" + flat : flat) + link;
|
|
8530
|
+
var ambiguous = flat.startsWith("\\") || flat.startsWith("[") || CONTAINER.test(flat) || ROUTE.test(flat) || HEADING.test(flat) || ICON.test(flat);
|
|
8531
|
+
return ambiguous ? "\\" + flat : flat;
|
|
8529
8532
|
}
|
|
8530
8533
|
|
|
8531
8534
|
/** The line a placeholder is written as. */
|
|
@@ -8550,18 +8553,12 @@ function formatSketchBox(placeholder) {
|
|
|
8550
8553
|
*/
|
|
8551
8554
|
function formatSketch(blocks, icons) {
|
|
8552
8555
|
var lines = [];
|
|
8553
|
-
// One block per field: the first keeps the link.
|
|
8554
|
-
var linked = new Set();
|
|
8555
8556
|
var _walk = function walk(node, depth, inRow) {
|
|
8556
8557
|
var indent = " ".repeat(depth);
|
|
8557
8558
|
switch (node.type) {
|
|
8558
8559
|
case "text":
|
|
8559
8560
|
if (node.text) {
|
|
8560
|
-
|
|
8561
|
-
if (field) {
|
|
8562
|
-
linked.add(field);
|
|
8563
|
-
}
|
|
8564
|
-
lines.push(indent + formatSketchText(node.level, node.text, field));
|
|
8561
|
+
lines.push(indent + formatSketchText(node.level, node.text));
|
|
8565
8562
|
}
|
|
8566
8563
|
return;
|
|
8567
8564
|
case "placeholder":
|
|
@@ -8606,26 +8603,6 @@ function formatSketch(blocks, icons) {
|
|
|
8606
8603
|
return all.length > 0 ? all.join("\n") + "\n" : "";
|
|
8607
8604
|
}
|
|
8608
8605
|
|
|
8609
|
-
/**
|
|
8610
|
-
* The text of every block linked to a field, by field: what the Studio
|
|
8611
|
-
* writes to the content when a linked block changes. The first block wins,
|
|
8612
|
-
* as `formatSketch` keeps only its link.
|
|
8613
|
-
*/
|
|
8614
|
-
function sketchFieldTexts(blocks) {
|
|
8615
|
-
var texts = new Map();
|
|
8616
|
-
var _walk2 = function walk(node) {
|
|
8617
|
-
if (node.type === "text") {
|
|
8618
|
-
if (node.field && node.text && !texts.has(node.field)) {
|
|
8619
|
-
texts.set(node.field, node.text.replace(/\s+/g, " ").trim());
|
|
8620
|
-
}
|
|
8621
|
-
} else if (node.type === "row" || node.type === "col") {
|
|
8622
|
-
node.children.forEach(_walk2);
|
|
8623
|
-
}
|
|
8624
|
-
};
|
|
8625
|
-
blocks.forEach(_walk2);
|
|
8626
|
-
return texts;
|
|
8627
|
-
}
|
|
8628
|
-
|
|
8629
8606
|
/** The pages a sketch is about, in the order it gives them. */
|
|
8630
8607
|
function sketchRoutes(blocks) {
|
|
8631
8608
|
return blocks.flatMap(function (block) {
|
|
@@ -11821,6 +11798,7 @@ exports.parseStatus = projectSource.parseStatus;
|
|
|
11821
11798
|
exports.parseUpdateTarget = projectSource.parseUpdateTarget;
|
|
11822
11799
|
exports.parseVerify = projectSource.parseVerify;
|
|
11823
11800
|
exports.publishApiOf = projectSource.publishApiOf;
|
|
11801
|
+
exports.CODE_CHANGED_EVENT = getSitemapTree.CODE_CHANGED_EVENT;
|
|
11824
11802
|
exports.DEFAULT_CANVAS_SELECTION = getSitemapTree.DEFAULT_CANVAS_SELECTION;
|
|
11825
11803
|
exports.DEFAULT_CANVAS_SELECTION_SOFT = getSitemapTree.DEFAULT_CANVAS_SELECTION_SOFT;
|
|
11826
11804
|
exports.QUICK_PREVIEW_PARAM = getSitemapTree.QUICK_PREVIEW_PARAM;
|
|
@@ -11845,6 +11823,7 @@ exports.getPageRouterSourceFolder = getSitemapTree.getPageRouterSourceFolder;
|
|
|
11845
11823
|
exports.getPatternFromModuleFilePath = getSitemapTree.getPatternFromModuleFilePath;
|
|
11846
11824
|
exports.getTanStackRouterSourceFolder = getSitemapTree.getTanStackRouterSourceFolder;
|
|
11847
11825
|
exports.isCanvasSelectionColor = getSitemapTree.isCanvasSelectionColor;
|
|
11826
|
+
exports.isCodeChangedDetail = getSitemapTree.isCodeChangedDetail;
|
|
11848
11827
|
exports.isQuickPreviewFiles = getSitemapTree.isQuickPreviewFiles;
|
|
11849
11828
|
exports.isTanStackRoutesFolder = getSitemapTree.isTanStackRoutesFolder;
|
|
11850
11829
|
exports.isValCanvasFrame = getSitemapTree.isValCanvasFrame;
|
|
@@ -12045,6 +12024,7 @@ exports.partitionValidationErrors = partitionValidationErrors;
|
|
|
12045
12024
|
exports.pathOfModuleKey = pathOfModuleKey;
|
|
12046
12025
|
exports.performSearch = performSearch;
|
|
12047
12026
|
exports.proposalCustomProperties = proposalCustomProperties;
|
|
12027
|
+
exports.readerSchemaVersion = readerSchemaVersion;
|
|
12048
12028
|
exports.rebaseContentOp = rebaseContentOp;
|
|
12049
12029
|
exports.relativeLuminance = relativeLuminance;
|
|
12050
12030
|
exports.relocateForLocale = relocateForLocale;
|
|
@@ -12069,7 +12049,6 @@ exports.selfCheck = selfCheck;
|
|
|
12069
12049
|
exports.shouldEncodeWithWasm = shouldEncodeWithWasm;
|
|
12070
12050
|
exports.sideFiles = sideFiles;
|
|
12071
12051
|
exports.sideSource = sideSource;
|
|
12072
|
-
exports.sketchFieldTexts = sketchFieldTexts;
|
|
12073
12052
|
exports.sketchRoutes = sketchRoutes;
|
|
12074
12053
|
exports.sketchTitle = sketchTitle;
|
|
12075
12054
|
exports.sourcePathOfChild = sourcePathOfChild;
|
|
@@ -10,7 +10,7 @@ var wrapNativeSuper = require('../../dist/wrapNativeSuper-8673414f.cjs.prod.js')
|
|
|
10
10
|
var zodValidationError = require('zod-validation-error');
|
|
11
11
|
var fp = require('@valbuild/core/fp');
|
|
12
12
|
var patch = require('@valbuild/core/patch');
|
|
13
|
-
var getSitemapTree = require('../../dist/getSitemapTree-
|
|
13
|
+
var getSitemapTree = require('../../dist/getSitemapTree-7ed70b4a.cjs.prod.js');
|
|
14
14
|
var FlexSearch = require('flexsearch');
|
|
15
15
|
var utils = require('../../dist/utils-32bcaca2.cjs.prod.js');
|
|
16
16
|
|
|
@@ -1351,6 +1351,24 @@ function chainOf(ids) {
|
|
|
1351
1351
|
function schemaVersionOf(serializedSchema) {
|
|
1352
1352
|
return sha256Hex("".concat(ENGINE, "\n").concat(JSON.stringify(serializedSchema)));
|
|
1353
1353
|
}
|
|
1354
|
+
var readerSchemaVersions = new WeakMap();
|
|
1355
|
+
|
|
1356
|
+
/**
|
|
1357
|
+
* The version of the schema a reader's own code has for a module: what the
|
|
1358
|
+
* readers hold relayed or drafted content's version against (`layered`'s
|
|
1359
|
+
* schema rule), so content is never read with a schema it was not made for.
|
|
1360
|
+
* The server readers (`fetchVal`) and the page's hooks (`useVal`) alike.
|
|
1361
|
+
* Hashed once per module object, which a build makes once: a load cost, not
|
|
1362
|
+
* a read cost.
|
|
1363
|
+
*/
|
|
1364
|
+
function readerSchemaVersion(module) {
|
|
1365
|
+
var cached = readerSchemaVersions.get(module);
|
|
1366
|
+
if (cached !== undefined) return cached;
|
|
1367
|
+
var schema = core.Internal.getSchema(module);
|
|
1368
|
+
var version = schema === undefined ? null : schemaVersionOf(schema["executeSerialize"]());
|
|
1369
|
+
readerSchemaVersions.set(module, version);
|
|
1370
|
+
return version;
|
|
1371
|
+
}
|
|
1354
1372
|
|
|
1355
1373
|
/**
|
|
1356
1374
|
* A module's base version, from its base source: what the module evaluates
|
|
@@ -4115,7 +4133,20 @@ var Api = {
|
|
|
4115
4133
|
model: zod.z.string(),
|
|
4116
4134
|
label: zod.z.string(),
|
|
4117
4135
|
contextWindow: zod.z.number().nullable().optional()
|
|
4118
|
-
})).optional()
|
|
4136
|
+
})).optional(),
|
|
4137
|
+
/**
|
|
4138
|
+
* The model a chat starts on until the editor picks one.
|
|
4139
|
+
*
|
|
4140
|
+
* Chosen by the content server, from `models`, so the default can
|
|
4141
|
+
* change for every project at once rather than at each project's
|
|
4142
|
+
* next Val upgrade. Null or absent (an older content server, or
|
|
4143
|
+
* nothing it recognised) means the Studio picks from its own
|
|
4144
|
+
* catalog.
|
|
4145
|
+
*/
|
|
4146
|
+
defaultModel: zod.z.object({
|
|
4147
|
+
provider: zod.z.string(),
|
|
4148
|
+
model: zod.z.string()
|
|
4149
|
+
}).nullable().optional()
|
|
4119
4150
|
})
|
|
4120
4151
|
}), zod.z.object({
|
|
4121
4152
|
status: zod.z.literal(500),
|
|
@@ -8229,8 +8260,6 @@ var toolNames = ["get_all_schema", "get_source", "search_content", "validate_con
|
|
|
8229
8260
|
* --- /about a route: what follows is the page at /about
|
|
8230
8261
|
* # Our people text (a heading: #, ## or ###)
|
|
8231
8262
|
* We are 40 people in Oslo. text (a paragraph)
|
|
8232
|
-
* ## Hi {field: /x.val.ts?p="t"} text linked to a content field: typing
|
|
8233
|
-
* in it writes the field
|
|
8234
8263
|
* [image: Team photo] placeholder: [kind] or [kind: label]
|
|
8235
8264
|
* [hero: Roof](image: /a.jpg) a placeholder with an image (or video) in it
|
|
8236
8265
|
* icon hero M3 5h18v14H3z how every [hero] box is drawn: SVG path data
|
|
@@ -8386,27 +8415,7 @@ function parseSketch(source) {
|
|
|
8386
8415
|
errors: errors
|
|
8387
8416
|
};
|
|
8388
8417
|
}
|
|
8389
|
-
|
|
8390
|
-
/** The link to a content field at the end of a text line. */
|
|
8391
|
-
var FIELD = / \{field: (\/[^{}]*)\}$/;
|
|
8392
|
-
function parseContent(whole, line, errors) {
|
|
8393
|
-
var link = FIELD.exec(whole);
|
|
8394
|
-
if (link) {
|
|
8395
|
-
var node = parseLine(whole.slice(0, link.index), line, errors);
|
|
8396
|
-
if (node.type !== "text") {
|
|
8397
|
-
errors.push({
|
|
8398
|
-
line: line,
|
|
8399
|
-
message: "Only a heading or a paragraph is linked to a field: put {field: ...} at the end of one."
|
|
8400
|
-
});
|
|
8401
|
-
return node;
|
|
8402
|
-
}
|
|
8403
|
-
return createForOfIteratorHelper._objectSpread2(createForOfIteratorHelper._objectSpread2({}, node), {}, {
|
|
8404
|
-
field: link[1].trim()
|
|
8405
|
-
});
|
|
8406
|
-
}
|
|
8407
|
-
return parseLine(whole, line, errors);
|
|
8408
|
-
}
|
|
8409
|
-
function parseLine(content, line, errors) {
|
|
8418
|
+
function parseContent(content, line, errors) {
|
|
8410
8419
|
// A leading backslash keeps a line that looks like a keyword as text.
|
|
8411
8420
|
if (content.startsWith("\\")) {
|
|
8412
8421
|
return {
|
|
@@ -8513,19 +8522,13 @@ function parseLine(content, line, errors) {
|
|
|
8513
8522
|
* The line a text block is written as. Line breaks become spaces, and a
|
|
8514
8523
|
* paragraph that would read as something else is kept as text with `\`.
|
|
8515
8524
|
*/
|
|
8516
|
-
function formatSketchText(level, text
|
|
8525
|
+
function formatSketchText(level, text) {
|
|
8517
8526
|
var flat = text.replace(/\s+/g, " ").trim();
|
|
8518
|
-
var path = field === null || field === void 0 ? void 0 : field.replace(/\s+/g, " ").trim();
|
|
8519
|
-
// A source path, and one the line can be read back with: no braces.
|
|
8520
|
-
var link = path && /^\/[^{}]*$/.test(path) ? " {field: ".concat(path, "}") : "";
|
|
8521
8527
|
if (level > 0) {
|
|
8522
|
-
return "#".repeat(level) + " " + flat
|
|
8528
|
+
return "#".repeat(level) + " " + flat;
|
|
8523
8529
|
}
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
var whole = flat + link;
|
|
8527
|
-
var ambiguous = flat.startsWith("\\") || flat.startsWith("[") || CONTAINER.test(whole) || ROUTE.test(whole) || HEADING.test(whole) || ICON.test(whole);
|
|
8528
|
-
return (ambiguous ? "\\" + flat : flat) + link;
|
|
8530
|
+
var ambiguous = flat.startsWith("\\") || flat.startsWith("[") || CONTAINER.test(flat) || ROUTE.test(flat) || HEADING.test(flat) || ICON.test(flat);
|
|
8531
|
+
return ambiguous ? "\\" + flat : flat;
|
|
8529
8532
|
}
|
|
8530
8533
|
|
|
8531
8534
|
/** The line a placeholder is written as. */
|
|
@@ -8550,18 +8553,12 @@ function formatSketchBox(placeholder) {
|
|
|
8550
8553
|
*/
|
|
8551
8554
|
function formatSketch(blocks, icons) {
|
|
8552
8555
|
var lines = [];
|
|
8553
|
-
// One block per field: the first keeps the link.
|
|
8554
|
-
var linked = new Set();
|
|
8555
8556
|
var _walk = function walk(node, depth, inRow) {
|
|
8556
8557
|
var indent = " ".repeat(depth);
|
|
8557
8558
|
switch (node.type) {
|
|
8558
8559
|
case "text":
|
|
8559
8560
|
if (node.text) {
|
|
8560
|
-
|
|
8561
|
-
if (field) {
|
|
8562
|
-
linked.add(field);
|
|
8563
|
-
}
|
|
8564
|
-
lines.push(indent + formatSketchText(node.level, node.text, field));
|
|
8561
|
+
lines.push(indent + formatSketchText(node.level, node.text));
|
|
8565
8562
|
}
|
|
8566
8563
|
return;
|
|
8567
8564
|
case "placeholder":
|
|
@@ -8606,26 +8603,6 @@ function formatSketch(blocks, icons) {
|
|
|
8606
8603
|
return all.length > 0 ? all.join("\n") + "\n" : "";
|
|
8607
8604
|
}
|
|
8608
8605
|
|
|
8609
|
-
/**
|
|
8610
|
-
* The text of every block linked to a field, by field: what the Studio
|
|
8611
|
-
* writes to the content when a linked block changes. The first block wins,
|
|
8612
|
-
* as `formatSketch` keeps only its link.
|
|
8613
|
-
*/
|
|
8614
|
-
function sketchFieldTexts(blocks) {
|
|
8615
|
-
var texts = new Map();
|
|
8616
|
-
var _walk2 = function walk(node) {
|
|
8617
|
-
if (node.type === "text") {
|
|
8618
|
-
if (node.field && node.text && !texts.has(node.field)) {
|
|
8619
|
-
texts.set(node.field, node.text.replace(/\s+/g, " ").trim());
|
|
8620
|
-
}
|
|
8621
|
-
} else if (node.type === "row" || node.type === "col") {
|
|
8622
|
-
node.children.forEach(_walk2);
|
|
8623
|
-
}
|
|
8624
|
-
};
|
|
8625
|
-
blocks.forEach(_walk2);
|
|
8626
|
-
return texts;
|
|
8627
|
-
}
|
|
8628
|
-
|
|
8629
8606
|
/** The pages a sketch is about, in the order it gives them. */
|
|
8630
8607
|
function sketchRoutes(blocks) {
|
|
8631
8608
|
return blocks.flatMap(function (block) {
|
|
@@ -11821,6 +11798,7 @@ exports.parseStatus = projectSource.parseStatus;
|
|
|
11821
11798
|
exports.parseUpdateTarget = projectSource.parseUpdateTarget;
|
|
11822
11799
|
exports.parseVerify = projectSource.parseVerify;
|
|
11823
11800
|
exports.publishApiOf = projectSource.publishApiOf;
|
|
11801
|
+
exports.CODE_CHANGED_EVENT = getSitemapTree.CODE_CHANGED_EVENT;
|
|
11824
11802
|
exports.DEFAULT_CANVAS_SELECTION = getSitemapTree.DEFAULT_CANVAS_SELECTION;
|
|
11825
11803
|
exports.DEFAULT_CANVAS_SELECTION_SOFT = getSitemapTree.DEFAULT_CANVAS_SELECTION_SOFT;
|
|
11826
11804
|
exports.QUICK_PREVIEW_PARAM = getSitemapTree.QUICK_PREVIEW_PARAM;
|
|
@@ -11845,6 +11823,7 @@ exports.getPageRouterSourceFolder = getSitemapTree.getPageRouterSourceFolder;
|
|
|
11845
11823
|
exports.getPatternFromModuleFilePath = getSitemapTree.getPatternFromModuleFilePath;
|
|
11846
11824
|
exports.getTanStackRouterSourceFolder = getSitemapTree.getTanStackRouterSourceFolder;
|
|
11847
11825
|
exports.isCanvasSelectionColor = getSitemapTree.isCanvasSelectionColor;
|
|
11826
|
+
exports.isCodeChangedDetail = getSitemapTree.isCodeChangedDetail;
|
|
11848
11827
|
exports.isQuickPreviewFiles = getSitemapTree.isQuickPreviewFiles;
|
|
11849
11828
|
exports.isTanStackRoutesFolder = getSitemapTree.isTanStackRoutesFolder;
|
|
11850
11829
|
exports.isValCanvasFrame = getSitemapTree.isValCanvasFrame;
|
|
@@ -12045,6 +12024,7 @@ exports.partitionValidationErrors = partitionValidationErrors;
|
|
|
12045
12024
|
exports.pathOfModuleKey = pathOfModuleKey;
|
|
12046
12025
|
exports.performSearch = performSearch;
|
|
12047
12026
|
exports.proposalCustomProperties = proposalCustomProperties;
|
|
12027
|
+
exports.readerSchemaVersion = readerSchemaVersion;
|
|
12048
12028
|
exports.rebaseContentOp = rebaseContentOp;
|
|
12049
12029
|
exports.relativeLuminance = relativeLuminance;
|
|
12050
12030
|
exports.relocateForLocale = relocateForLocale;
|
|
@@ -12069,7 +12049,6 @@ exports.selfCheck = selfCheck;
|
|
|
12069
12049
|
exports.shouldEncodeWithWasm = shouldEncodeWithWasm;
|
|
12070
12050
|
exports.sideFiles = sideFiles;
|
|
12071
12051
|
exports.sideSource = sideSource;
|
|
12072
|
-
exports.sketchFieldTexts = sketchFieldTexts;
|
|
12073
12052
|
exports.sketchRoutes = sketchRoutes;
|
|
12074
12053
|
exports.sketchTitle = sketchTitle;
|
|
12075
12054
|
exports.sourcePathOfChild = sourcePathOfChild;
|
|
@@ -7,7 +7,7 @@ import { a as _createClass, c as _classCallCheck } from '../../dist/wrapNativeSu
|
|
|
7
7
|
import { fromError } from 'zod-validation-error';
|
|
8
8
|
import { result, array } from '@valbuild/core/fp';
|
|
9
9
|
import { PatchError, deepEqual, parseAndValidateArrayIndex } from '@valbuild/core/patch';
|
|
10
|
-
export { D as DEFAULT_CANVAS_SELECTION, e as DEFAULT_CANVAS_SELECTION_SOFT, Q as QUICK_PREVIEW_PARAM,
|
|
10
|
+
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';
|
|
11
11
|
import FlexSearch from 'flexsearch';
|
|
12
12
|
import { b as base64DataUrlToUint8Array } from '../../dist/utils-00f3e1df.esm.js';
|
|
13
13
|
|
|
@@ -1344,6 +1344,24 @@ function chainOf(ids) {
|
|
|
1344
1344
|
function schemaVersionOf(serializedSchema) {
|
|
1345
1345
|
return sha256Hex("".concat(ENGINE, "\n").concat(JSON.stringify(serializedSchema)));
|
|
1346
1346
|
}
|
|
1347
|
+
var readerSchemaVersions = new WeakMap();
|
|
1348
|
+
|
|
1349
|
+
/**
|
|
1350
|
+
* The version of the schema a reader's own code has for a module: what the
|
|
1351
|
+
* readers hold relayed or drafted content's version against (`layered`'s
|
|
1352
|
+
* schema rule), so content is never read with a schema it was not made for.
|
|
1353
|
+
* The server readers (`fetchVal`) and the page's hooks (`useVal`) alike.
|
|
1354
|
+
* Hashed once per module object, which a build makes once: a load cost, not
|
|
1355
|
+
* a read cost.
|
|
1356
|
+
*/
|
|
1357
|
+
function readerSchemaVersion(module) {
|
|
1358
|
+
var cached = readerSchemaVersions.get(module);
|
|
1359
|
+
if (cached !== undefined) return cached;
|
|
1360
|
+
var schema = Internal.getSchema(module);
|
|
1361
|
+
var version = schema === undefined ? null : schemaVersionOf(schema["executeSerialize"]());
|
|
1362
|
+
readerSchemaVersions.set(module, version);
|
|
1363
|
+
return version;
|
|
1364
|
+
}
|
|
1347
1365
|
|
|
1348
1366
|
/**
|
|
1349
1367
|
* A module's base version, from its base source: what the module evaluates
|
|
@@ -4108,7 +4126,20 @@ var Api = {
|
|
|
4108
4126
|
model: z.string(),
|
|
4109
4127
|
label: z.string(),
|
|
4110
4128
|
contextWindow: z.number().nullable().optional()
|
|
4111
|
-
})).optional()
|
|
4129
|
+
})).optional(),
|
|
4130
|
+
/**
|
|
4131
|
+
* The model a chat starts on until the editor picks one.
|
|
4132
|
+
*
|
|
4133
|
+
* Chosen by the content server, from `models`, so the default can
|
|
4134
|
+
* change for every project at once rather than at each project's
|
|
4135
|
+
* next Val upgrade. Null or absent (an older content server, or
|
|
4136
|
+
* nothing it recognised) means the Studio picks from its own
|
|
4137
|
+
* catalog.
|
|
4138
|
+
*/
|
|
4139
|
+
defaultModel: z.object({
|
|
4140
|
+
provider: z.string(),
|
|
4141
|
+
model: z.string()
|
|
4142
|
+
}).nullable().optional()
|
|
4112
4143
|
})
|
|
4113
4144
|
}), z.object({
|
|
4114
4145
|
status: z.literal(500),
|
|
@@ -8222,8 +8253,6 @@ var toolNames = ["get_all_schema", "get_source", "search_content", "validate_con
|
|
|
8222
8253
|
* --- /about a route: what follows is the page at /about
|
|
8223
8254
|
* # Our people text (a heading: #, ## or ###)
|
|
8224
8255
|
* We are 40 people in Oslo. text (a paragraph)
|
|
8225
|
-
* ## Hi {field: /x.val.ts?p="t"} text linked to a content field: typing
|
|
8226
|
-
* in it writes the field
|
|
8227
8256
|
* [image: Team photo] placeholder: [kind] or [kind: label]
|
|
8228
8257
|
* [hero: Roof](image: /a.jpg) a placeholder with an image (or video) in it
|
|
8229
8258
|
* icon hero M3 5h18v14H3z how every [hero] box is drawn: SVG path data
|
|
@@ -8379,27 +8408,7 @@ function parseSketch(source) {
|
|
|
8379
8408
|
errors: errors
|
|
8380
8409
|
};
|
|
8381
8410
|
}
|
|
8382
|
-
|
|
8383
|
-
/** The link to a content field at the end of a text line. */
|
|
8384
|
-
var FIELD = / \{field: (\/[^{}]*)\}$/;
|
|
8385
|
-
function parseContent(whole, line, errors) {
|
|
8386
|
-
var link = FIELD.exec(whole);
|
|
8387
|
-
if (link) {
|
|
8388
|
-
var node = parseLine(whole.slice(0, link.index), line, errors);
|
|
8389
|
-
if (node.type !== "text") {
|
|
8390
|
-
errors.push({
|
|
8391
|
-
line: line,
|
|
8392
|
-
message: "Only a heading or a paragraph is linked to a field: put {field: ...} at the end of one."
|
|
8393
|
-
});
|
|
8394
|
-
return node;
|
|
8395
|
-
}
|
|
8396
|
-
return _objectSpread2(_objectSpread2({}, node), {}, {
|
|
8397
|
-
field: link[1].trim()
|
|
8398
|
-
});
|
|
8399
|
-
}
|
|
8400
|
-
return parseLine(whole, line, errors);
|
|
8401
|
-
}
|
|
8402
|
-
function parseLine(content, line, errors) {
|
|
8411
|
+
function parseContent(content, line, errors) {
|
|
8403
8412
|
// A leading backslash keeps a line that looks like a keyword as text.
|
|
8404
8413
|
if (content.startsWith("\\")) {
|
|
8405
8414
|
return {
|
|
@@ -8506,19 +8515,13 @@ function parseLine(content, line, errors) {
|
|
|
8506
8515
|
* The line a text block is written as. Line breaks become spaces, and a
|
|
8507
8516
|
* paragraph that would read as something else is kept as text with `\`.
|
|
8508
8517
|
*/
|
|
8509
|
-
function formatSketchText(level, text
|
|
8518
|
+
function formatSketchText(level, text) {
|
|
8510
8519
|
var flat = text.replace(/\s+/g, " ").trim();
|
|
8511
|
-
var path = field === null || field === void 0 ? void 0 : field.replace(/\s+/g, " ").trim();
|
|
8512
|
-
// A source path, and one the line can be read back with: no braces.
|
|
8513
|
-
var link = path && /^\/[^{}]*$/.test(path) ? " {field: ".concat(path, "}") : "";
|
|
8514
8520
|
if (level > 0) {
|
|
8515
|
-
return "#".repeat(level) + " " + flat
|
|
8521
|
+
return "#".repeat(level) + " " + flat;
|
|
8516
8522
|
}
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
var whole = flat + link;
|
|
8520
|
-
var ambiguous = flat.startsWith("\\") || flat.startsWith("[") || CONTAINER.test(whole) || ROUTE.test(whole) || HEADING.test(whole) || ICON.test(whole);
|
|
8521
|
-
return (ambiguous ? "\\" + flat : flat) + link;
|
|
8523
|
+
var ambiguous = flat.startsWith("\\") || flat.startsWith("[") || CONTAINER.test(flat) || ROUTE.test(flat) || HEADING.test(flat) || ICON.test(flat);
|
|
8524
|
+
return ambiguous ? "\\" + flat : flat;
|
|
8522
8525
|
}
|
|
8523
8526
|
|
|
8524
8527
|
/** The line a placeholder is written as. */
|
|
@@ -8543,18 +8546,12 @@ function formatSketchBox(placeholder) {
|
|
|
8543
8546
|
*/
|
|
8544
8547
|
function formatSketch(blocks, icons) {
|
|
8545
8548
|
var lines = [];
|
|
8546
|
-
// One block per field: the first keeps the link.
|
|
8547
|
-
var linked = new Set();
|
|
8548
8549
|
var _walk = function walk(node, depth, inRow) {
|
|
8549
8550
|
var indent = " ".repeat(depth);
|
|
8550
8551
|
switch (node.type) {
|
|
8551
8552
|
case "text":
|
|
8552
8553
|
if (node.text) {
|
|
8553
|
-
|
|
8554
|
-
if (field) {
|
|
8555
|
-
linked.add(field);
|
|
8556
|
-
}
|
|
8557
|
-
lines.push(indent + formatSketchText(node.level, node.text, field));
|
|
8554
|
+
lines.push(indent + formatSketchText(node.level, node.text));
|
|
8558
8555
|
}
|
|
8559
8556
|
return;
|
|
8560
8557
|
case "placeholder":
|
|
@@ -8599,26 +8596,6 @@ function formatSketch(blocks, icons) {
|
|
|
8599
8596
|
return all.length > 0 ? all.join("\n") + "\n" : "";
|
|
8600
8597
|
}
|
|
8601
8598
|
|
|
8602
|
-
/**
|
|
8603
|
-
* The text of every block linked to a field, by field: what the Studio
|
|
8604
|
-
* writes to the content when a linked block changes. The first block wins,
|
|
8605
|
-
* as `formatSketch` keeps only its link.
|
|
8606
|
-
*/
|
|
8607
|
-
function sketchFieldTexts(blocks) {
|
|
8608
|
-
var texts = new Map();
|
|
8609
|
-
var _walk2 = function walk(node) {
|
|
8610
|
-
if (node.type === "text") {
|
|
8611
|
-
if (node.field && node.text && !texts.has(node.field)) {
|
|
8612
|
-
texts.set(node.field, node.text.replace(/\s+/g, " ").trim());
|
|
8613
|
-
}
|
|
8614
|
-
} else if (node.type === "row" || node.type === "col") {
|
|
8615
|
-
node.children.forEach(_walk2);
|
|
8616
|
-
}
|
|
8617
|
-
};
|
|
8618
|
-
blocks.forEach(_walk2);
|
|
8619
|
-
return texts;
|
|
8620
|
-
}
|
|
8621
|
-
|
|
8622
8599
|
/** The pages a sketch is about, in the order it gives them. */
|
|
8623
8600
|
function sketchRoutes(blocks) {
|
|
8624
8601
|
return blocks.flatMap(function (block) {
|
|
@@ -11794,4 +11771,4 @@ var messageOf = function messageOf(error) {
|
|
|
11794
11771
|
return error instanceof Error ? error.message : String(error);
|
|
11795
11772
|
};
|
|
11796
11773
|
|
|
11797
|
-
export { AA_LARGE, AA_TEXT, AIToolCallSummaries, AnalyticsBeacon, Api, BRAND_CONTRAST_PAIRS, BinaryFileRef, ChainFold, CodeOptions, ColorOptions, DEFAULT_ERROR_MESSAGE, DateOptions, EMPTY_CHAIN, ENCODE_DEFAULTS, ENCODE_MIME_TYPE_OF, ENGINE, FileOptions, HistoricalCommit, HistoricalModule, HistoricalPatchSet, HistoryError, ImageEncodeOption, ImageOptions, JSONValue, JSON_ENTRIES_BATCH_MAX, LOCAL_FILE_IN_REMOTE_PROJECT_HINT, LOCAL_FILE_IN_REMOTE_PROJECT_WARNING, ManifestJson, ModuleComparison, ModuleVersionSchema, NEVER_ENCODED, ParentRef$1 as ParentRef, Patch, PatchBlock, PatchId, PatchJSON, PatchSets, PlanRefusalError, ProjectVersionSchema, RAMP_STEPS, RemirrorBr, RemirrorBulletList, RemirrorHeading, RemirrorImage, RemirrorJSON, RemirrorLinkMark, RemirrorListItem, RemirrorOrderedList, RemirrorParagraph, RemirrorText, RemirrorTextMark, RestoreVerdict, RichTextOptions, SCHEMA_SOURCE_FIXES, SELF_CHECK_VERSION, SESSION_MEDIA_PREFIX, SKETCHPAD_MAX_TEXT_LENGTH, STAGED_SCHEMA_PREFIX, STUDIO_FIXES, SerializedArraySchema, SerializedBooleanSchema, SerializedCodeSchema, SerializedColorSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedDiscriminatedUnionSchema, SerializedEnumSchema, SerializedFileSchema, SerializedImageSchema, SerializedKeyOfSchema, SerializedLiteralSchema, SerializedLocaleSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedRecordSchema, SerializedRichTextSchema, SerializedRouteSchema, SerializedSchema, SerializedSettingsSchema, SerializedStringSchema, SerializedValViewSchema, SerializedVideoSchema, SharedValConfig, Sketchpad, SketchpadSummary, StatManifest, VAL_CLIENT_HEADER, VAL_ENABLE_COOKIE_NAME, VAL_GREEN_RAMP, VAL_SESSION_COOKIE, VAL_STATE_COOKIE, VAL_STUDIO_HEADER, ValCommit, ValDeployment, VideoOptions, VideoStreamOption, WARNING_FIXES, WASM_ENCODED_MIME_TYPES, accentRamp, applyChain, applyPatchRecord, baseModuleContent, baseVersionOf, buildDuplicatePatch, buildEmptyAtPathPatch, buildFileRefValue, buildImageGalleryPatch, buildRemoveImageGalleryEntryPatch, buildSearchIndex, bundleTier, chainHeadOf, chainOf, checkCompatibility, checkSketch, childSource, chooseEncoded, classifyJsonValuesOp, concatModulePath, contrastRatio, createRegExpFromPattern, createSearchIndex, createValClient, declaredLocales, describeContainerAtPath, emptyOf, engineWork, entryAddress, entryState, enumLocaleTag, expandJsonValuesRootOp, expandJsonValuesRootOpForKey, explainIncompatible, extendChain, fallbackMimeType, filterBlockingValidationErrors, filterRoutesByPatterns, findSimilar, fitWithin, flattenRichText, forEachRichTextImage, formatSketch, formatSketchBox, formatSketchText, getErrorMessageFromUnknownJson, getFilenameFromRef, getInlineImgInfo, getKeyOfRecordAt, getRefParts, getRoutesOf, getRoutesWithModulePaths, getSourceAt, getValDemo, hasLocaleRouteParam, indexModule, isInsidePatchSetPath, isJsonObject, isJsonValuesRootOp, isLocaleSchema, isMimeTypeAccepted, isRemoteSchema, isRepairedOnSave, isSchemaSourceFixError, isSkippedSource, isStudioFix, isValidationWarning, isWarningFix, joinSharedChanges, keyOfRecordPath, levenshtein, localeAt, localeMeantBy, localeOfModuleRoot, localeOfRouteKey, localeParamOfRouteKey, localeScopeAt, memoryTier, moduleKey, newestCommitSha, parseModuleKey, parseSketch, partitionValidationErrors, pathOfModuleKey, performSearch, proposalCustomProperties, rebaseContentOp, relativeLuminance, relocateForLocale, remirrorToRichTextSource, removeModule, resolveEncodeSettings, resolveEntry, resolvePairGround, resolveSchemaSourceFixForError, resolveSchemaSourceFixes, resolveSerializedSchemaAtPath, richTextImageSchema, richTextToRemirror, safeParsePatch, sameEntryVersion, sameModuleVersion, schemaErrorsOf, schemaTypesOfPath, schemaVersionOf, selectionClosure, selfCheck, shouldEncodeWithWasm, sideFiles, sideSource,
|
|
11774
|
+
export { AA_LARGE, AA_TEXT, AIToolCallSummaries, AnalyticsBeacon, Api, BRAND_CONTRAST_PAIRS, BinaryFileRef, ChainFold, CodeOptions, ColorOptions, DEFAULT_ERROR_MESSAGE, DateOptions, EMPTY_CHAIN, ENCODE_DEFAULTS, ENCODE_MIME_TYPE_OF, ENGINE, FileOptions, HistoricalCommit, HistoricalModule, HistoricalPatchSet, HistoryError, ImageEncodeOption, ImageOptions, JSONValue, JSON_ENTRIES_BATCH_MAX, LOCAL_FILE_IN_REMOTE_PROJECT_HINT, LOCAL_FILE_IN_REMOTE_PROJECT_WARNING, ManifestJson, ModuleComparison, ModuleVersionSchema, NEVER_ENCODED, ParentRef$1 as ParentRef, Patch, PatchBlock, PatchId, PatchJSON, PatchSets, PlanRefusalError, ProjectVersionSchema, RAMP_STEPS, RemirrorBr, RemirrorBulletList, RemirrorHeading, RemirrorImage, RemirrorJSON, RemirrorLinkMark, RemirrorListItem, RemirrorOrderedList, RemirrorParagraph, RemirrorText, RemirrorTextMark, RestoreVerdict, RichTextOptions, SCHEMA_SOURCE_FIXES, SELF_CHECK_VERSION, SESSION_MEDIA_PREFIX, SKETCHPAD_MAX_TEXT_LENGTH, STAGED_SCHEMA_PREFIX, STUDIO_FIXES, SerializedArraySchema, SerializedBooleanSchema, SerializedCodeSchema, SerializedColorSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedDiscriminatedUnionSchema, SerializedEnumSchema, SerializedFileSchema, SerializedImageSchema, SerializedKeyOfSchema, SerializedLiteralSchema, SerializedLocaleSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedRecordSchema, SerializedRichTextSchema, SerializedRouteSchema, SerializedSchema, SerializedSettingsSchema, SerializedStringSchema, SerializedValViewSchema, SerializedVideoSchema, SharedValConfig, Sketchpad, SketchpadSummary, StatManifest, VAL_CLIENT_HEADER, VAL_ENABLE_COOKIE_NAME, VAL_GREEN_RAMP, VAL_SESSION_COOKIE, VAL_STATE_COOKIE, VAL_STUDIO_HEADER, ValCommit, ValDeployment, VideoOptions, VideoStreamOption, WARNING_FIXES, WASM_ENCODED_MIME_TYPES, accentRamp, applyChain, applyPatchRecord, baseModuleContent, baseVersionOf, buildDuplicatePatch, buildEmptyAtPathPatch, buildFileRefValue, buildImageGalleryPatch, buildRemoveImageGalleryEntryPatch, buildSearchIndex, bundleTier, chainHeadOf, chainOf, checkCompatibility, checkSketch, childSource, chooseEncoded, classifyJsonValuesOp, concatModulePath, contrastRatio, createRegExpFromPattern, createSearchIndex, createValClient, declaredLocales, describeContainerAtPath, emptyOf, engineWork, entryAddress, entryState, enumLocaleTag, expandJsonValuesRootOp, expandJsonValuesRootOpForKey, explainIncompatible, extendChain, fallbackMimeType, filterBlockingValidationErrors, filterRoutesByPatterns, findSimilar, fitWithin, flattenRichText, forEachRichTextImage, formatSketch, formatSketchBox, formatSketchText, getErrorMessageFromUnknownJson, getFilenameFromRef, getInlineImgInfo, getKeyOfRecordAt, getRefParts, getRoutesOf, getRoutesWithModulePaths, getSourceAt, getValDemo, hasLocaleRouteParam, indexModule, isInsidePatchSetPath, isJsonObject, isJsonValuesRootOp, isLocaleSchema, isMimeTypeAccepted, isRemoteSchema, isRepairedOnSave, isSchemaSourceFixError, isSkippedSource, isStudioFix, isValidationWarning, isWarningFix, joinSharedChanges, keyOfRecordPath, levenshtein, localeAt, localeMeantBy, localeOfModuleRoot, localeOfRouteKey, localeParamOfRouteKey, localeScopeAt, memoryTier, moduleKey, newestCommitSha, parseModuleKey, parseSketch, partitionValidationErrors, pathOfModuleKey, performSearch, proposalCustomProperties, readerSchemaVersion, rebaseContentOp, relativeLuminance, relocateForLocale, remirrorToRichTextSource, removeModule, resolveEncodeSettings, resolveEntry, resolvePairGround, resolveSchemaSourceFixForError, resolveSchemaSourceFixes, resolveSerializedSchemaAtPath, richTextImageSchema, richTextToRemirror, safeParsePatch, sameEntryVersion, sameModuleVersion, schemaErrorsOf, schemaTypesOfPath, schemaVersionOf, selectionClosure, selfCheck, shouldEncodeWithWasm, sideFiles, sideSource, sketchRoutes, sketchTitle, sourcePathOfChild, storeWork, themeCustomProperties, tiered, toolNames, traverseSchemaSource, urlOf, valClientHeaders, valModulesEntryFile, valModulesEntryPath, validateRoutePatterns, versionHashCount, wholeEntryKey, withExtension };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valbuild/shared",
|
|
3
|
-
"version": "0.153.
|
|
3
|
+
"version": "0.153.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Val shared types and utilities",
|
|
6
6
|
"repository": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"yaml": "^2.9.0",
|
|
55
55
|
"zod": "^4.4.3",
|
|
56
56
|
"zod-validation-error": "^5.0.0",
|
|
57
|
-
"@valbuild/core": "0.153.
|
|
57
|
+
"@valbuild/core": "0.153.5"
|
|
58
58
|
},
|
|
59
59
|
"files": [
|
|
60
60
|
"CHANGELOG.md",
|