@valbuild/shared 0.152.0 → 0.152.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 +12 -0
- package/client/dist/valbuild-shared-client.cjs.dev.js +1 -3
- package/client/dist/valbuild-shared-client.cjs.prod.js +1 -3
- package/client/dist/valbuild-shared-client.esm.js +1 -1
- package/dist/declarations/src/internal/elementPicker.d.ts +4 -5
- package/dist/declarations/src/internal/pageInspection.d.ts +1 -1
- package/dist/declarations/src/internal/pageScreenshot.d.ts +2 -3
- package/dist/declarations/src/internal/quickPreview.d.ts +3 -27
- package/dist/declarations/src/internal/valCanvasProtocol.d.ts +3 -3
- package/dist/{getSitemapTree-3c1b9e57.esm.js → getSitemapTree-2b22cf1b.esm.js} +10 -121
- package/dist/{getSitemapTree-6b9024d1.cjs.prod.js → getSitemapTree-d0942fca.cjs.prod.js} +9 -122
- package/dist/{getSitemapTree-59c5ed5d.cjs.dev.js → getSitemapTree-dc61b8b6.cjs.dev.js} +9 -122
- package/internal/dist/valbuild-shared-internal.cjs.dev.js +1 -3
- package/internal/dist/valbuild-shared-internal.cjs.prod.js +1 -3
- package/internal/dist/valbuild-shared-internal.esm.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @valbuild/shared
|
|
2
2
|
|
|
3
|
+
## 0.152.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1019](https://github.com/valbuild/val/pull/1019) [`b9089c8`](https://github.com/valbuild/val/commit/b9089c8787da8075722cc4ef3672beb61b288af4) Thanks [@freekh](https://github.com/freekh)! - **What the design tab needed is removed with it.** The page's canvas bridge
|
|
8
|
+
now answers `read_page`, `screenshot_page` and a quick preview only to the
|
|
9
|
+
Studio at the page's own origin, and no longer asks the server whether another
|
|
10
|
+
origin is the site's design tab. The site's server no longer writes a
|
|
11
|
+
proposal's files or offers the `patch-file` route: code and content are
|
|
12
|
+
changed in the proposal's own Studio. The assistant's `build_proposal` no
|
|
13
|
+
longer takes a `reason`.
|
|
14
|
+
|
|
3
15
|
## 0.152.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var getSitemapTree = require('../../dist/getSitemapTree-
|
|
5
|
+
var getSitemapTree = require('../../dist/getSitemapTree-dc61b8b6.cjs.dev.js');
|
|
6
6
|
require('../../dist/createForOfIteratorHelper-f2d7ac6d.cjs.dev.js');
|
|
7
7
|
require('@valbuild/core');
|
|
8
8
|
|
|
@@ -31,7 +31,6 @@ exports.getPageRouterSitemapTree = getSitemapTree.getPageRouterSitemapTree;
|
|
|
31
31
|
exports.getPageRouterSourceFolder = getSitemapTree.getPageRouterSourceFolder;
|
|
32
32
|
exports.getPatternFromModuleFilePath = getSitemapTree.getPatternFromModuleFilePath;
|
|
33
33
|
exports.getTanStackRouterSourceFolder = getSitemapTree.getTanStackRouterSourceFolder;
|
|
34
|
-
exports.isDesignTabOrigin = getSitemapTree.isDesignTabOrigin;
|
|
35
34
|
exports.isQuickPreviewFiles = getSitemapTree.isQuickPreviewFiles;
|
|
36
35
|
exports.isTanStackRoutesFolder = getSitemapTree.isTanStackRoutesFolder;
|
|
37
36
|
exports.isValCanvasFrame = getSitemapTree.isValCanvasFrame;
|
|
@@ -40,7 +39,6 @@ exports.isValCanvasStudioMessage = getSitemapTree.isValCanvasStudioMessage;
|
|
|
40
39
|
exports.modifierLabel = getSitemapTree.modifierLabel;
|
|
41
40
|
exports.pageLocationOf = getSitemapTree.pageLocationOf;
|
|
42
41
|
exports.parseRoutePattern = getSitemapTree.parseRoutePattern;
|
|
43
|
-
exports.quickPreviewSiteOrigin = getSitemapTree.quickPreviewSiteOrigin;
|
|
44
42
|
exports.readPageSnapshot = getSitemapTree.readPageSnapshot;
|
|
45
43
|
exports.restoreScroll = getSitemapTree.restoreScroll;
|
|
46
44
|
exports.screenshotPage = getSitemapTree.screenshotPage;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var getSitemapTree = require('../../dist/getSitemapTree-
|
|
5
|
+
var getSitemapTree = require('../../dist/getSitemapTree-d0942fca.cjs.prod.js');
|
|
6
6
|
require('../../dist/createForOfIteratorHelper-9ca2078d.cjs.prod.js');
|
|
7
7
|
require('@valbuild/core');
|
|
8
8
|
|
|
@@ -31,7 +31,6 @@ exports.getPageRouterSitemapTree = getSitemapTree.getPageRouterSitemapTree;
|
|
|
31
31
|
exports.getPageRouterSourceFolder = getSitemapTree.getPageRouterSourceFolder;
|
|
32
32
|
exports.getPatternFromModuleFilePath = getSitemapTree.getPatternFromModuleFilePath;
|
|
33
33
|
exports.getTanStackRouterSourceFolder = getSitemapTree.getTanStackRouterSourceFolder;
|
|
34
|
-
exports.isDesignTabOrigin = getSitemapTree.isDesignTabOrigin;
|
|
35
34
|
exports.isQuickPreviewFiles = getSitemapTree.isQuickPreviewFiles;
|
|
36
35
|
exports.isTanStackRoutesFolder = getSitemapTree.isTanStackRoutesFolder;
|
|
37
36
|
exports.isValCanvasFrame = getSitemapTree.isValCanvasFrame;
|
|
@@ -40,7 +39,6 @@ exports.isValCanvasStudioMessage = getSitemapTree.isValCanvasStudioMessage;
|
|
|
40
39
|
exports.modifierLabel = getSitemapTree.modifierLabel;
|
|
41
40
|
exports.pageLocationOf = getSitemapTree.pageLocationOf;
|
|
42
41
|
exports.parseRoutePattern = getSitemapTree.parseRoutePattern;
|
|
43
|
-
exports.quickPreviewSiteOrigin = getSitemapTree.quickPreviewSiteOrigin;
|
|
44
42
|
exports.readPageSnapshot = getSitemapTree.readPageSnapshot;
|
|
45
43
|
exports.restoreScroll = getSitemapTree.restoreScroll;
|
|
46
44
|
exports.screenshotPage = getSitemapTree.screenshotPage;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { D as DEFAULT_CANVAS_SELECTION, e as DEFAULT_CANVAS_SELECTION_SOFT, Q as QUICK_PREVIEW_PARAM, v as QUICK_PREVIEW_RENDER_SCRIPT, u as QUICK_PREVIEW_SERVICE_WORKER_PATH, z as QUICK_PREVIEW_SERVICE_WORKER_SOURCE, x 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, j as attachElementPicker, k as createPickerOverlay, h as describeElement, l as elementLabel, q as findBySelector,
|
|
1
|
+
export { D as DEFAULT_CANVAS_SELECTION, e as DEFAULT_CANVAS_SELECTION_SOFT, Q as QUICK_PREVIEW_PARAM, v as QUICK_PREVIEW_RENDER_SCRIPT, u as QUICK_PREVIEW_SERVICE_WORKER_PATH, z as QUICK_PREVIEW_SERVICE_WORKER_SOURCE, x 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, j as attachElementPicker, k as createPickerOverlay, h as describeElement, l as elementLabel, q as findBySelector, E as formatRoutePattern, F as getNextAppRouterSourceFolder, J as getPageRouterSitemapTree, H as getPageRouterSourceFolder, K as getPatternFromModuleFilePath, G as getTanStackRouterSourceFolder, y as isQuickPreviewFiles, I as isTanStackRoutesFolder, g as isValCanvasFrame, i as isValCanvasPageMessage, f as isValCanvasStudioMessage, m as modifierLabel, p as pageLocationOf, C as parseRoutePattern, o as readPageSnapshot, r as restoreScroll, t as screenshotPage, s as startElementPicking, A as storeQuickPreview, n as watchPageLocation, B as withQuickPreviewParam, w as withValCanvasParam } from '../../dist/getSitemapTree-2b22cf1b.esm.js';
|
|
2
2
|
import '../../dist/createForOfIteratorHelper-9b80f1a2.esm.js';
|
|
3
3
|
import '@valbuild/core';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pointing at anything on a page, as Lovable's picker does: hover outlines
|
|
3
3
|
* the element under the pointer, a click picks it, and the assistant is told
|
|
4
|
-
* which
|
|
4
|
+
* which.
|
|
5
5
|
*
|
|
6
|
-
* ANY element, not only what Val marks. The
|
|
6
|
+
* ANY element, not only what Val marks. The assistant changes code, and the
|
|
7
7
|
* thing a person wants changed is as often a wrapper, a gap or a button as a
|
|
8
8
|
* field -- so a field's path is extra information when there is one
|
|
9
9
|
* (`valPath`), never the condition for picking.
|
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
*
|
|
15
15
|
* Plain DOM, nothing of React's or the Studio's, and in `shared` because
|
|
16
16
|
* both halves need it: the canvas bridge (`@valbuild/next`,
|
|
17
|
-
* `@valbuild/tanstack`) runs it inside the
|
|
18
|
-
*
|
|
19
|
-
* reached; the Studio's stories run it on a page of their own. Only the
|
|
17
|
+
* `@valbuild/tanstack`) runs it inside the page, the only place the page's
|
|
18
|
+
* elements can be reached; the Studio's stories run it on a page of their own. Only the
|
|
20
19
|
* `PickedElement` crosses the frame (`valCanvasProtocol.ts`).
|
|
21
20
|
*/
|
|
22
21
|
export type PickedElement = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Looking at a page from the
|
|
2
|
+
* Looking at a page from the Studio:
|
|
3
3
|
* where it is -- its path and scroll, so a new build opens at the same place
|
|
4
4
|
* -- and what is on it, so the assistant can check its own change
|
|
5
5
|
* (`read_page`).
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
* `screenshot_page`, so it can see a change it made rather than only read it
|
|
4
4
|
* (`read_page` gives the words and the boxes).
|
|
5
5
|
*
|
|
6
|
-
* Taken HERE
|
|
7
|
-
* the
|
|
8
|
-
* frame of another origin. So the bridge renders its own document --
|
|
6
|
+
* Taken HERE, in the page: a browser lets no page photograph a frame, so
|
|
7
|
+
* the bridge renders its own document --
|
|
9
8
|
* `modern-screenshot` draws the DOM, with its computed styles, fonts and
|
|
10
9
|
* same-origin images, into a canvas -- and hands back a JPEG.
|
|
11
10
|
*
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A quick preview: a proposal's page, running the proposal's CLIENT code
|
|
3
|
-
* built in the
|
|
4
|
-
* (valbuild/home `docs/design-tab.md`).
|
|
3
|
+
* built in the Studio, without a build being uploaded or served.
|
|
5
4
|
*
|
|
6
5
|
* A full build of a proposal bundles the app for the server and the browser,
|
|
7
6
|
* uploads it, and has the platform render every page before it is served --
|
|
8
|
-
* minutes. Most of what the
|
|
7
|
+
* minutes. Most of what the assistant changes is components and styles,
|
|
9
8
|
* which the browser half alone shows. So the tab bundles the app in its
|
|
10
9
|
* builder worker, and a service worker on the proposal's address hands the
|
|
11
10
|
* page that bundle instead of the served one:
|
|
@@ -23,7 +22,7 @@
|
|
|
23
22
|
* 4. It takes it over by RENDERING it, not by hydrating it. Hydration keeps
|
|
24
23
|
* the markup the server sent wherever only an attribute differs -- React
|
|
25
24
|
* mends text, never a `className` -- so a change to classes and props,
|
|
26
|
-
* which is most of what the
|
|
25
|
+
* which is most of what the assistant changes, hydrated into the old
|
|
27
26
|
* page and showed nothing. The worker adds a script to the end of that
|
|
28
27
|
* document's `<body>` ({@link QUICK_PREVIEW_RENDER_SCRIPT}) that takes the
|
|
29
28
|
* server's markup out before the app's scripts run, so hydration finds
|
|
@@ -82,26 +81,3 @@ export declare function storeQuickPreview(id: string, files: QuickPreviewFiles,
|
|
|
82
81
|
}): Promise<void>;
|
|
83
82
|
/** The address of a page as a quick preview `id`. */
|
|
84
83
|
export declare function withQuickPreviewParam(url: string, id: string): string;
|
|
85
|
-
/**
|
|
86
|
-
* The one origin allowed to send this page a quick preview: the site's, where
|
|
87
|
-
* the design tab is, as this page's own Val server says it (the proposals
|
|
88
|
-
* list's `siteUrl`). `null` when it does not say.
|
|
89
|
-
*
|
|
90
|
-
* A quick preview is code that runs on this address, so the bridge takes one
|
|
91
|
-
* only from its parent, and only when that parent is the site: a page that
|
|
92
|
-
* framed this one could otherwise post a script into the worker and open
|
|
93
|
-
* the frame on it.
|
|
94
|
-
*/
|
|
95
|
-
export declare function quickPreviewSiteOrigin(api: string, fetchImpl?: typeof fetch): Promise<string | null>;
|
|
96
|
-
/**
|
|
97
|
-
* Whether `origin` may ask this page for what only the design tab should
|
|
98
|
-
* have -- what is on it (`readPage`), or code to run (`quickPreview`): this
|
|
99
|
-
* page's own origin (the Studio's canvas), or the site's, where the design
|
|
100
|
-
* tab is ({@link quickPreviewSiteOrigin}). Asked of the server once, and
|
|
101
|
-
* again only while it has not said.
|
|
102
|
-
*/
|
|
103
|
-
export declare function isDesignTabOrigin(origin: string, options: {
|
|
104
|
-
api: string;
|
|
105
|
-
own: string;
|
|
106
|
-
fetchImpl?: typeof fetch;
|
|
107
|
-
}): Promise<boolean>;
|
|
@@ -213,8 +213,8 @@ export type ValCanvasPageMessage = {
|
|
|
213
213
|
type: "elementPickingStopped";
|
|
214
214
|
} | ({
|
|
215
215
|
/**
|
|
216
|
-
* Where the page is: its path and scroll, as it moves.
|
|
217
|
-
*
|
|
216
|
+
* Where the page is: its path and scroll, as it moves. A new build
|
|
217
|
+
* is opened there (`scrollTo`), so a new version replaces the
|
|
218
218
|
* page in place rather than starting over at the top of the front page.
|
|
219
219
|
*/
|
|
220
220
|
val: typeof VAL_CANVAS_MESSAGE;
|
|
@@ -358,7 +358,7 @@ export type ValCanvasStudioMessage = {
|
|
|
358
358
|
picking: boolean;
|
|
359
359
|
} | {
|
|
360
360
|
/**
|
|
361
|
-
* Picking ANY element
|
|
361
|
+
* Picking ANY element (`elementPicker.ts`),
|
|
362
362
|
* rather than the fields Val tagged, as `setPicking` does.
|
|
363
363
|
*
|
|
364
364
|
* While `enabled`, holding `modifier` outlines what is under the
|
|
@@ -7,12 +7,11 @@ var VAL_AI_SESSION_STORAGE_KEY = "val-ai-session";
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A quick preview: a proposal's page, running the proposal's CLIENT code
|
|
10
|
-
* built in the
|
|
11
|
-
* (valbuild/home `docs/design-tab.md`).
|
|
10
|
+
* built in the Studio, without a build being uploaded or served.
|
|
12
11
|
*
|
|
13
12
|
* A full build of a proposal bundles the app for the server and the browser,
|
|
14
13
|
* uploads it, and has the platform render every page before it is served --
|
|
15
|
-
* minutes. Most of what the
|
|
14
|
+
* minutes. Most of what the assistant changes is components and styles,
|
|
16
15
|
* which the browser half alone shows. So the tab bundles the app in its
|
|
17
16
|
* builder worker, and a service worker on the proposal's address hands the
|
|
18
17
|
* page that bundle instead of the served one:
|
|
@@ -30,7 +29,7 @@ var VAL_AI_SESSION_STORAGE_KEY = "val-ai-session";
|
|
|
30
29
|
* 4. It takes it over by RENDERING it, not by hydrating it. Hydration keeps
|
|
31
30
|
* the markup the server sent wherever only an attribute differs -- React
|
|
32
31
|
* mends text, never a `className` -- so a change to classes and props,
|
|
33
|
-
* which is most of what the
|
|
32
|
+
* which is most of what the assistant changes, hydrated into the old
|
|
34
33
|
* page and showed nothing. The worker adds a script to the end of that
|
|
35
34
|
* document's `<body>` ({@link QUICK_PREVIEW_RENDER_SCRIPT}) that takes the
|
|
36
35
|
* server's markup out before the app's scripts run, so hydration finds
|
|
@@ -185,114 +184,6 @@ function withQuickPreviewParam(url, id) {
|
|
|
185
184
|
return parsed.toString();
|
|
186
185
|
}
|
|
187
186
|
|
|
188
|
-
/**
|
|
189
|
-
* The one origin allowed to send this page a quick preview: the site's, where
|
|
190
|
-
* the design tab is, as this page's own Val server says it (the proposals
|
|
191
|
-
* list's `siteUrl`). `null` when it does not say.
|
|
192
|
-
*
|
|
193
|
-
* A quick preview is code that runs on this address, so the bridge takes one
|
|
194
|
-
* only from its parent, and only when that parent is the site: a page that
|
|
195
|
-
* framed this one could otherwise post a script into the worker and open
|
|
196
|
-
* the frame on it.
|
|
197
|
-
*/
|
|
198
|
-
function quickPreviewSiteOrigin(_x4) {
|
|
199
|
-
return _quickPreviewSiteOrigin.apply(this, arguments);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/** The site's origin, as this page's server named it: asked once per page. */
|
|
203
|
-
function _quickPreviewSiteOrigin() {
|
|
204
|
-
_quickPreviewSiteOrigin = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(api) {
|
|
205
|
-
var fetchImpl,
|
|
206
|
-
res,
|
|
207
|
-
body,
|
|
208
|
-
siteUrl,
|
|
209
|
-
_args2 = arguments;
|
|
210
|
-
return _regenerator().w(function (_context2) {
|
|
211
|
-
while (1) switch (_context2.p = _context2.n) {
|
|
212
|
-
case 0:
|
|
213
|
-
fetchImpl = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : fetch;
|
|
214
|
-
_context2.n = 1;
|
|
215
|
-
return fetchImpl("".concat(api.replace(/\/+$/, ""), "/proposals-api"), {
|
|
216
|
-
credentials: "same-origin",
|
|
217
|
-
headers: {
|
|
218
|
-
Accept: "application/json"
|
|
219
|
-
}
|
|
220
|
-
});
|
|
221
|
-
case 1:
|
|
222
|
-
res = _context2.v;
|
|
223
|
-
if (res.ok) {
|
|
224
|
-
_context2.n = 2;
|
|
225
|
-
break;
|
|
226
|
-
}
|
|
227
|
-
return _context2.a(2, null);
|
|
228
|
-
case 2:
|
|
229
|
-
_context2.n = 3;
|
|
230
|
-
return res.json();
|
|
231
|
-
case 3:
|
|
232
|
-
body = _context2.v;
|
|
233
|
-
if (!(_typeof(body) !== "object" || body === null || !("siteUrl" in body))) {
|
|
234
|
-
_context2.n = 4;
|
|
235
|
-
break;
|
|
236
|
-
}
|
|
237
|
-
return _context2.a(2, null);
|
|
238
|
-
case 4:
|
|
239
|
-
siteUrl = body.siteUrl;
|
|
240
|
-
if (!(typeof siteUrl !== "string")) {
|
|
241
|
-
_context2.n = 5;
|
|
242
|
-
break;
|
|
243
|
-
}
|
|
244
|
-
return _context2.a(2, null);
|
|
245
|
-
case 5:
|
|
246
|
-
_context2.p = 5;
|
|
247
|
-
return _context2.a(2, new URL(siteUrl).origin);
|
|
248
|
-
case 6:
|
|
249
|
-
_context2.p = 6;
|
|
250
|
-
_context2.v;
|
|
251
|
-
return _context2.a(2, null);
|
|
252
|
-
}
|
|
253
|
-
}, _callee2, null, [[5, 6]]);
|
|
254
|
-
}));
|
|
255
|
-
return _quickPreviewSiteOrigin.apply(this, arguments);
|
|
256
|
-
}
|
|
257
|
-
var siteOriginOnce = null;
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* Whether `origin` may ask this page for what only the design tab should
|
|
261
|
-
* have -- what is on it (`readPage`), or code to run (`quickPreview`): this
|
|
262
|
-
* page's own origin (the Studio's canvas), or the site's, where the design
|
|
263
|
-
* tab is ({@link quickPreviewSiteOrigin}). Asked of the server once, and
|
|
264
|
-
* again only while it has not said.
|
|
265
|
-
*/
|
|
266
|
-
function isDesignTabOrigin(_x5, _x6) {
|
|
267
|
-
return _isDesignTabOrigin.apply(this, arguments);
|
|
268
|
-
}
|
|
269
|
-
function _isDesignTabOrigin() {
|
|
270
|
-
_isDesignTabOrigin = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(origin, options) {
|
|
271
|
-
var site;
|
|
272
|
-
return _regenerator().w(function (_context3) {
|
|
273
|
-
while (1) switch (_context3.n) {
|
|
274
|
-
case 0:
|
|
275
|
-
if (!(origin === options.own)) {
|
|
276
|
-
_context3.n = 1;
|
|
277
|
-
break;
|
|
278
|
-
}
|
|
279
|
-
return _context3.a(2, true);
|
|
280
|
-
case 1:
|
|
281
|
-
siteOriginOnce !== null && siteOriginOnce !== void 0 ? siteOriginOnce : siteOriginOnce = quickPreviewSiteOrigin(options.api, options.fetchImpl)["catch"](function () {
|
|
282
|
-
return null;
|
|
283
|
-
});
|
|
284
|
-
_context3.n = 2;
|
|
285
|
-
return siteOriginOnce;
|
|
286
|
-
case 2:
|
|
287
|
-
site = _context3.v;
|
|
288
|
-
if (site === null) siteOriginOnce = null;
|
|
289
|
-
return _context3.a(2, site !== null && site === origin);
|
|
290
|
-
}
|
|
291
|
-
}, _callee3);
|
|
292
|
-
}));
|
|
293
|
-
return _isDesignTabOrigin.apply(this, arguments);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
187
|
/** Marks a page load as the studio's canvas frame. */
|
|
297
188
|
var VAL_CANVAS_PARAM = "val_canvas";
|
|
298
189
|
|
|
@@ -465,9 +356,9 @@ function withValCanvasParam(url) {
|
|
|
465
356
|
/**
|
|
466
357
|
* Pointing at anything on a page, as Lovable's picker does: hover outlines
|
|
467
358
|
* the element under the pointer, a click picks it, and the assistant is told
|
|
468
|
-
* which
|
|
359
|
+
* which.
|
|
469
360
|
*
|
|
470
|
-
* ANY element, not only what Val marks. The
|
|
361
|
+
* ANY element, not only what Val marks. The assistant changes code, and the
|
|
471
362
|
* thing a person wants changed is as often a wrapper, a gap or a button as a
|
|
472
363
|
* field -- so a field's path is extra information when there is one
|
|
473
364
|
* (`valPath`), never the condition for picking.
|
|
@@ -478,9 +369,8 @@ function withValCanvasParam(url) {
|
|
|
478
369
|
*
|
|
479
370
|
* Plain DOM, nothing of React's or the Studio's, and in `shared` because
|
|
480
371
|
* both halves need it: the canvas bridge (`@valbuild/next`,
|
|
481
|
-
* `@valbuild/tanstack`) runs it inside the
|
|
482
|
-
*
|
|
483
|
-
* reached; the Studio's stories run it on a page of their own. Only the
|
|
372
|
+
* `@valbuild/tanstack`) runs it inside the page, the only place the page's
|
|
373
|
+
* elements can be reached; the Studio's stories run it on a page of their own. Only the
|
|
484
374
|
* `PickedElement` crosses the frame (`valCanvasProtocol.ts`).
|
|
485
375
|
*/
|
|
486
376
|
|
|
@@ -1179,9 +1069,8 @@ function selectorOf(element, root) {
|
|
|
1179
1069
|
* `screenshot_page`, so it can see a change it made rather than only read it
|
|
1180
1070
|
* (`read_page` gives the words and the boxes).
|
|
1181
1071
|
*
|
|
1182
|
-
* Taken HERE
|
|
1183
|
-
* the
|
|
1184
|
-
* frame of another origin. So the bridge renders its own document --
|
|
1072
|
+
* Taken HERE, in the page: a browser lets no page photograph a frame, so
|
|
1073
|
+
* the bridge renders its own document --
|
|
1185
1074
|
* `modern-screenshot` draws the DOM, with its computed styles, fonts and
|
|
1186
1075
|
* same-origin images, into a canvas -- and hands back a JPEG.
|
|
1187
1076
|
*
|
|
@@ -1546,4 +1435,4 @@ function getPatternFromModuleFilePath(moduleFilePath, srcFolder) {
|
|
|
1546
1435
|
.replace("/page.val.ts", "").replace("/page.val.js", "");
|
|
1547
1436
|
}
|
|
1548
1437
|
|
|
1549
|
-
export { storeQuickPreview as A, withQuickPreviewParam as B,
|
|
1438
|
+
export { storeQuickPreview as A, withQuickPreviewParam as B, parseRoutePattern as C, DEFAULT_CANVAS_SELECTION as D, formatRoutePattern as E, getNextAppRouterSourceFolder as F, getTanStackRouterSourceFolder as G, getPageRouterSourceFolder as H, isTanStackRoutesFolder as I, getPageRouterSitemapTree as J, getPatternFromModuleFilePath as K, 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, isValCanvasStudioMessage as f, isValCanvasFrame as g, describeElement as h, isValCanvasPageMessage as i, attachElementPicker as j, createPickerOverlay as k, elementLabel as l, modifierLabel as m, watchPageLocation as n, readPageSnapshot as o, pageLocationOf as p, findBySelector as q, restoreScroll as r, startElementPicking as s, screenshotPage as t, QUICK_PREVIEW_SERVICE_WORKER_PATH as u, QUICK_PREVIEW_RENDER_SCRIPT as v, withValCanvasParam as w, QUICK_PREVIEW_STORE_MESSAGE as x, isQuickPreviewFiles as y, QUICK_PREVIEW_SERVICE_WORKER_SOURCE as z };
|
|
@@ -27,12 +27,11 @@ var VAL_AI_SESSION_STORAGE_KEY = "val-ai-session";
|
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* A quick preview: a proposal's page, running the proposal's CLIENT code
|
|
30
|
-
* built in the
|
|
31
|
-
* (valbuild/home `docs/design-tab.md`).
|
|
30
|
+
* built in the Studio, without a build being uploaded or served.
|
|
32
31
|
*
|
|
33
32
|
* A full build of a proposal bundles the app for the server and the browser,
|
|
34
33
|
* uploads it, and has the platform render every page before it is served --
|
|
35
|
-
* minutes. Most of what the
|
|
34
|
+
* minutes. Most of what the assistant changes is components and styles,
|
|
36
35
|
* which the browser half alone shows. So the tab bundles the app in its
|
|
37
36
|
* builder worker, and a service worker on the proposal's address hands the
|
|
38
37
|
* page that bundle instead of the served one:
|
|
@@ -50,7 +49,7 @@ var VAL_AI_SESSION_STORAGE_KEY = "val-ai-session";
|
|
|
50
49
|
* 4. It takes it over by RENDERING it, not by hydrating it. Hydration keeps
|
|
51
50
|
* the markup the server sent wherever only an attribute differs -- React
|
|
52
51
|
* mends text, never a `className` -- so a change to classes and props,
|
|
53
|
-
* which is most of what the
|
|
52
|
+
* which is most of what the assistant changes, hydrated into the old
|
|
54
53
|
* page and showed nothing. The worker adds a script to the end of that
|
|
55
54
|
* document's `<body>` ({@link QUICK_PREVIEW_RENDER_SCRIPT}) that takes the
|
|
56
55
|
* server's markup out before the app's scripts run, so hydration finds
|
|
@@ -205,114 +204,6 @@ function withQuickPreviewParam(url, id) {
|
|
|
205
204
|
return parsed.toString();
|
|
206
205
|
}
|
|
207
206
|
|
|
208
|
-
/**
|
|
209
|
-
* The one origin allowed to send this page a quick preview: the site's, where
|
|
210
|
-
* the design tab is, as this page's own Val server says it (the proposals
|
|
211
|
-
* list's `siteUrl`). `null` when it does not say.
|
|
212
|
-
*
|
|
213
|
-
* A quick preview is code that runs on this address, so the bridge takes one
|
|
214
|
-
* only from its parent, and only when that parent is the site: a page that
|
|
215
|
-
* framed this one could otherwise post a script into the worker and open
|
|
216
|
-
* the frame on it.
|
|
217
|
-
*/
|
|
218
|
-
function quickPreviewSiteOrigin(_x4) {
|
|
219
|
-
return _quickPreviewSiteOrigin.apply(this, arguments);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/** The site's origin, as this page's server named it: asked once per page. */
|
|
223
|
-
function _quickPreviewSiteOrigin() {
|
|
224
|
-
_quickPreviewSiteOrigin = createForOfIteratorHelper._asyncToGenerator(/*#__PURE__*/createForOfIteratorHelper._regenerator().m(function _callee2(api) {
|
|
225
|
-
var fetchImpl,
|
|
226
|
-
res,
|
|
227
|
-
body,
|
|
228
|
-
siteUrl,
|
|
229
|
-
_args2 = arguments;
|
|
230
|
-
return createForOfIteratorHelper._regenerator().w(function (_context2) {
|
|
231
|
-
while (1) switch (_context2.p = _context2.n) {
|
|
232
|
-
case 0:
|
|
233
|
-
fetchImpl = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : fetch;
|
|
234
|
-
_context2.n = 1;
|
|
235
|
-
return fetchImpl("".concat(api.replace(/\/+$/, ""), "/proposals-api"), {
|
|
236
|
-
credentials: "same-origin",
|
|
237
|
-
headers: {
|
|
238
|
-
Accept: "application/json"
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
case 1:
|
|
242
|
-
res = _context2.v;
|
|
243
|
-
if (res.ok) {
|
|
244
|
-
_context2.n = 2;
|
|
245
|
-
break;
|
|
246
|
-
}
|
|
247
|
-
return _context2.a(2, null);
|
|
248
|
-
case 2:
|
|
249
|
-
_context2.n = 3;
|
|
250
|
-
return res.json();
|
|
251
|
-
case 3:
|
|
252
|
-
body = _context2.v;
|
|
253
|
-
if (!(createForOfIteratorHelper._typeof(body) !== "object" || body === null || !("siteUrl" in body))) {
|
|
254
|
-
_context2.n = 4;
|
|
255
|
-
break;
|
|
256
|
-
}
|
|
257
|
-
return _context2.a(2, null);
|
|
258
|
-
case 4:
|
|
259
|
-
siteUrl = body.siteUrl;
|
|
260
|
-
if (!(typeof siteUrl !== "string")) {
|
|
261
|
-
_context2.n = 5;
|
|
262
|
-
break;
|
|
263
|
-
}
|
|
264
|
-
return _context2.a(2, null);
|
|
265
|
-
case 5:
|
|
266
|
-
_context2.p = 5;
|
|
267
|
-
return _context2.a(2, new URL(siteUrl).origin);
|
|
268
|
-
case 6:
|
|
269
|
-
_context2.p = 6;
|
|
270
|
-
_context2.v;
|
|
271
|
-
return _context2.a(2, null);
|
|
272
|
-
}
|
|
273
|
-
}, _callee2, null, [[5, 6]]);
|
|
274
|
-
}));
|
|
275
|
-
return _quickPreviewSiteOrigin.apply(this, arguments);
|
|
276
|
-
}
|
|
277
|
-
var siteOriginOnce = null;
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Whether `origin` may ask this page for what only the design tab should
|
|
281
|
-
* have -- what is on it (`readPage`), or code to run (`quickPreview`): this
|
|
282
|
-
* page's own origin (the Studio's canvas), or the site's, where the design
|
|
283
|
-
* tab is ({@link quickPreviewSiteOrigin}). Asked of the server once, and
|
|
284
|
-
* again only while it has not said.
|
|
285
|
-
*/
|
|
286
|
-
function isDesignTabOrigin(_x5, _x6) {
|
|
287
|
-
return _isDesignTabOrigin.apply(this, arguments);
|
|
288
|
-
}
|
|
289
|
-
function _isDesignTabOrigin() {
|
|
290
|
-
_isDesignTabOrigin = createForOfIteratorHelper._asyncToGenerator(/*#__PURE__*/createForOfIteratorHelper._regenerator().m(function _callee3(origin, options) {
|
|
291
|
-
var site;
|
|
292
|
-
return createForOfIteratorHelper._regenerator().w(function (_context3) {
|
|
293
|
-
while (1) switch (_context3.n) {
|
|
294
|
-
case 0:
|
|
295
|
-
if (!(origin === options.own)) {
|
|
296
|
-
_context3.n = 1;
|
|
297
|
-
break;
|
|
298
|
-
}
|
|
299
|
-
return _context3.a(2, true);
|
|
300
|
-
case 1:
|
|
301
|
-
siteOriginOnce !== null && siteOriginOnce !== void 0 ? siteOriginOnce : siteOriginOnce = quickPreviewSiteOrigin(options.api, options.fetchImpl)["catch"](function () {
|
|
302
|
-
return null;
|
|
303
|
-
});
|
|
304
|
-
_context3.n = 2;
|
|
305
|
-
return siteOriginOnce;
|
|
306
|
-
case 2:
|
|
307
|
-
site = _context3.v;
|
|
308
|
-
if (site === null) siteOriginOnce = null;
|
|
309
|
-
return _context3.a(2, site !== null && site === origin);
|
|
310
|
-
}
|
|
311
|
-
}, _callee3);
|
|
312
|
-
}));
|
|
313
|
-
return _isDesignTabOrigin.apply(this, arguments);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
207
|
/** Marks a page load as the studio's canvas frame. */
|
|
317
208
|
var VAL_CANVAS_PARAM = "val_canvas";
|
|
318
209
|
|
|
@@ -485,9 +376,9 @@ function withValCanvasParam(url) {
|
|
|
485
376
|
/**
|
|
486
377
|
* Pointing at anything on a page, as Lovable's picker does: hover outlines
|
|
487
378
|
* the element under the pointer, a click picks it, and the assistant is told
|
|
488
|
-
* which
|
|
379
|
+
* which.
|
|
489
380
|
*
|
|
490
|
-
* ANY element, not only what Val marks. The
|
|
381
|
+
* ANY element, not only what Val marks. The assistant changes code, and the
|
|
491
382
|
* thing a person wants changed is as often a wrapper, a gap or a button as a
|
|
492
383
|
* field -- so a field's path is extra information when there is one
|
|
493
384
|
* (`valPath`), never the condition for picking.
|
|
@@ -498,9 +389,8 @@ function withValCanvasParam(url) {
|
|
|
498
389
|
*
|
|
499
390
|
* Plain DOM, nothing of React's or the Studio's, and in `shared` because
|
|
500
391
|
* both halves need it: the canvas bridge (`@valbuild/next`,
|
|
501
|
-
* `@valbuild/tanstack`) runs it inside the
|
|
502
|
-
*
|
|
503
|
-
* reached; the Studio's stories run it on a page of their own. Only the
|
|
392
|
+
* `@valbuild/tanstack`) runs it inside the page, the only place the page's
|
|
393
|
+
* elements can be reached; the Studio's stories run it on a page of their own. Only the
|
|
504
394
|
* `PickedElement` crosses the frame (`valCanvasProtocol.ts`).
|
|
505
395
|
*/
|
|
506
396
|
|
|
@@ -1199,9 +1089,8 @@ function selectorOf(element, root) {
|
|
|
1199
1089
|
* `screenshot_page`, so it can see a change it made rather than only read it
|
|
1200
1090
|
* (`read_page` gives the words and the boxes).
|
|
1201
1091
|
*
|
|
1202
|
-
* Taken HERE
|
|
1203
|
-
* the
|
|
1204
|
-
* frame of another origin. So the bridge renders its own document --
|
|
1092
|
+
* Taken HERE, in the page: a browser lets no page photograph a frame, so
|
|
1093
|
+
* the bridge renders its own document --
|
|
1205
1094
|
* `modern-screenshot` draws the DOM, with its computed styles, fonts and
|
|
1206
1095
|
* same-origin images, into a canvas -- and hands back a JPEG.
|
|
1207
1096
|
*
|
|
@@ -1589,7 +1478,6 @@ exports.getPageRouterSitemapTree = getPageRouterSitemapTree;
|
|
|
1589
1478
|
exports.getPageRouterSourceFolder = getPageRouterSourceFolder;
|
|
1590
1479
|
exports.getPatternFromModuleFilePath = getPatternFromModuleFilePath;
|
|
1591
1480
|
exports.getTanStackRouterSourceFolder = getTanStackRouterSourceFolder;
|
|
1592
|
-
exports.isDesignTabOrigin = isDesignTabOrigin;
|
|
1593
1481
|
exports.isQuickPreviewFiles = isQuickPreviewFiles;
|
|
1594
1482
|
exports.isTanStackRoutesFolder = isTanStackRoutesFolder;
|
|
1595
1483
|
exports.isValCanvasFrame = isValCanvasFrame;
|
|
@@ -1598,7 +1486,6 @@ exports.isValCanvasStudioMessage = isValCanvasStudioMessage;
|
|
|
1598
1486
|
exports.modifierLabel = modifierLabel;
|
|
1599
1487
|
exports.pageLocationOf = pageLocationOf;
|
|
1600
1488
|
exports.parseRoutePattern = parseRoutePattern;
|
|
1601
|
-
exports.quickPreviewSiteOrigin = quickPreviewSiteOrigin;
|
|
1602
1489
|
exports.readPageSnapshot = readPageSnapshot;
|
|
1603
1490
|
exports.restoreScroll = restoreScroll;
|
|
1604
1491
|
exports.screenshotPage = screenshotPage;
|
|
@@ -27,12 +27,11 @@ var VAL_AI_SESSION_STORAGE_KEY = "val-ai-session";
|
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* A quick preview: a proposal's page, running the proposal's CLIENT code
|
|
30
|
-
* built in the
|
|
31
|
-
* (valbuild/home `docs/design-tab.md`).
|
|
30
|
+
* built in the Studio, without a build being uploaded or served.
|
|
32
31
|
*
|
|
33
32
|
* A full build of a proposal bundles the app for the server and the browser,
|
|
34
33
|
* uploads it, and has the platform render every page before it is served --
|
|
35
|
-
* minutes. Most of what the
|
|
34
|
+
* minutes. Most of what the assistant changes is components and styles,
|
|
36
35
|
* which the browser half alone shows. So the tab bundles the app in its
|
|
37
36
|
* builder worker, and a service worker on the proposal's address hands the
|
|
38
37
|
* page that bundle instead of the served one:
|
|
@@ -50,7 +49,7 @@ var VAL_AI_SESSION_STORAGE_KEY = "val-ai-session";
|
|
|
50
49
|
* 4. It takes it over by RENDERING it, not by hydrating it. Hydration keeps
|
|
51
50
|
* the markup the server sent wherever only an attribute differs -- React
|
|
52
51
|
* mends text, never a `className` -- so a change to classes and props,
|
|
53
|
-
* which is most of what the
|
|
52
|
+
* which is most of what the assistant changes, hydrated into the old
|
|
54
53
|
* page and showed nothing. The worker adds a script to the end of that
|
|
55
54
|
* document's `<body>` ({@link QUICK_PREVIEW_RENDER_SCRIPT}) that takes the
|
|
56
55
|
* server's markup out before the app's scripts run, so hydration finds
|
|
@@ -205,114 +204,6 @@ function withQuickPreviewParam(url, id) {
|
|
|
205
204
|
return parsed.toString();
|
|
206
205
|
}
|
|
207
206
|
|
|
208
|
-
/**
|
|
209
|
-
* The one origin allowed to send this page a quick preview: the site's, where
|
|
210
|
-
* the design tab is, as this page's own Val server says it (the proposals
|
|
211
|
-
* list's `siteUrl`). `null` when it does not say.
|
|
212
|
-
*
|
|
213
|
-
* A quick preview is code that runs on this address, so the bridge takes one
|
|
214
|
-
* only from its parent, and only when that parent is the site: a page that
|
|
215
|
-
* framed this one could otherwise post a script into the worker and open
|
|
216
|
-
* the frame on it.
|
|
217
|
-
*/
|
|
218
|
-
function quickPreviewSiteOrigin(_x4) {
|
|
219
|
-
return _quickPreviewSiteOrigin.apply(this, arguments);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/** The site's origin, as this page's server named it: asked once per page. */
|
|
223
|
-
function _quickPreviewSiteOrigin() {
|
|
224
|
-
_quickPreviewSiteOrigin = createForOfIteratorHelper._asyncToGenerator(/*#__PURE__*/createForOfIteratorHelper._regenerator().m(function _callee2(api) {
|
|
225
|
-
var fetchImpl,
|
|
226
|
-
res,
|
|
227
|
-
body,
|
|
228
|
-
siteUrl,
|
|
229
|
-
_args2 = arguments;
|
|
230
|
-
return createForOfIteratorHelper._regenerator().w(function (_context2) {
|
|
231
|
-
while (1) switch (_context2.p = _context2.n) {
|
|
232
|
-
case 0:
|
|
233
|
-
fetchImpl = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : fetch;
|
|
234
|
-
_context2.n = 1;
|
|
235
|
-
return fetchImpl("".concat(api.replace(/\/+$/, ""), "/proposals-api"), {
|
|
236
|
-
credentials: "same-origin",
|
|
237
|
-
headers: {
|
|
238
|
-
Accept: "application/json"
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
case 1:
|
|
242
|
-
res = _context2.v;
|
|
243
|
-
if (res.ok) {
|
|
244
|
-
_context2.n = 2;
|
|
245
|
-
break;
|
|
246
|
-
}
|
|
247
|
-
return _context2.a(2, null);
|
|
248
|
-
case 2:
|
|
249
|
-
_context2.n = 3;
|
|
250
|
-
return res.json();
|
|
251
|
-
case 3:
|
|
252
|
-
body = _context2.v;
|
|
253
|
-
if (!(createForOfIteratorHelper._typeof(body) !== "object" || body === null || !("siteUrl" in body))) {
|
|
254
|
-
_context2.n = 4;
|
|
255
|
-
break;
|
|
256
|
-
}
|
|
257
|
-
return _context2.a(2, null);
|
|
258
|
-
case 4:
|
|
259
|
-
siteUrl = body.siteUrl;
|
|
260
|
-
if (!(typeof siteUrl !== "string")) {
|
|
261
|
-
_context2.n = 5;
|
|
262
|
-
break;
|
|
263
|
-
}
|
|
264
|
-
return _context2.a(2, null);
|
|
265
|
-
case 5:
|
|
266
|
-
_context2.p = 5;
|
|
267
|
-
return _context2.a(2, new URL(siteUrl).origin);
|
|
268
|
-
case 6:
|
|
269
|
-
_context2.p = 6;
|
|
270
|
-
_context2.v;
|
|
271
|
-
return _context2.a(2, null);
|
|
272
|
-
}
|
|
273
|
-
}, _callee2, null, [[5, 6]]);
|
|
274
|
-
}));
|
|
275
|
-
return _quickPreviewSiteOrigin.apply(this, arguments);
|
|
276
|
-
}
|
|
277
|
-
var siteOriginOnce = null;
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Whether `origin` may ask this page for what only the design tab should
|
|
281
|
-
* have -- what is on it (`readPage`), or code to run (`quickPreview`): this
|
|
282
|
-
* page's own origin (the Studio's canvas), or the site's, where the design
|
|
283
|
-
* tab is ({@link quickPreviewSiteOrigin}). Asked of the server once, and
|
|
284
|
-
* again only while it has not said.
|
|
285
|
-
*/
|
|
286
|
-
function isDesignTabOrigin(_x5, _x6) {
|
|
287
|
-
return _isDesignTabOrigin.apply(this, arguments);
|
|
288
|
-
}
|
|
289
|
-
function _isDesignTabOrigin() {
|
|
290
|
-
_isDesignTabOrigin = createForOfIteratorHelper._asyncToGenerator(/*#__PURE__*/createForOfIteratorHelper._regenerator().m(function _callee3(origin, options) {
|
|
291
|
-
var site;
|
|
292
|
-
return createForOfIteratorHelper._regenerator().w(function (_context3) {
|
|
293
|
-
while (1) switch (_context3.n) {
|
|
294
|
-
case 0:
|
|
295
|
-
if (!(origin === options.own)) {
|
|
296
|
-
_context3.n = 1;
|
|
297
|
-
break;
|
|
298
|
-
}
|
|
299
|
-
return _context3.a(2, true);
|
|
300
|
-
case 1:
|
|
301
|
-
siteOriginOnce !== null && siteOriginOnce !== void 0 ? siteOriginOnce : siteOriginOnce = quickPreviewSiteOrigin(options.api, options.fetchImpl)["catch"](function () {
|
|
302
|
-
return null;
|
|
303
|
-
});
|
|
304
|
-
_context3.n = 2;
|
|
305
|
-
return siteOriginOnce;
|
|
306
|
-
case 2:
|
|
307
|
-
site = _context3.v;
|
|
308
|
-
if (site === null) siteOriginOnce = null;
|
|
309
|
-
return _context3.a(2, site !== null && site === origin);
|
|
310
|
-
}
|
|
311
|
-
}, _callee3);
|
|
312
|
-
}));
|
|
313
|
-
return _isDesignTabOrigin.apply(this, arguments);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
207
|
/** Marks a page load as the studio's canvas frame. */
|
|
317
208
|
var VAL_CANVAS_PARAM = "val_canvas";
|
|
318
209
|
|
|
@@ -485,9 +376,9 @@ function withValCanvasParam(url) {
|
|
|
485
376
|
/**
|
|
486
377
|
* Pointing at anything on a page, as Lovable's picker does: hover outlines
|
|
487
378
|
* the element under the pointer, a click picks it, and the assistant is told
|
|
488
|
-
* which
|
|
379
|
+
* which.
|
|
489
380
|
*
|
|
490
|
-
* ANY element, not only what Val marks. The
|
|
381
|
+
* ANY element, not only what Val marks. The assistant changes code, and the
|
|
491
382
|
* thing a person wants changed is as often a wrapper, a gap or a button as a
|
|
492
383
|
* field -- so a field's path is extra information when there is one
|
|
493
384
|
* (`valPath`), never the condition for picking.
|
|
@@ -498,9 +389,8 @@ function withValCanvasParam(url) {
|
|
|
498
389
|
*
|
|
499
390
|
* Plain DOM, nothing of React's or the Studio's, and in `shared` because
|
|
500
391
|
* both halves need it: the canvas bridge (`@valbuild/next`,
|
|
501
|
-
* `@valbuild/tanstack`) runs it inside the
|
|
502
|
-
*
|
|
503
|
-
* reached; the Studio's stories run it on a page of their own. Only the
|
|
392
|
+
* `@valbuild/tanstack`) runs it inside the page, the only place the page's
|
|
393
|
+
* elements can be reached; the Studio's stories run it on a page of their own. Only the
|
|
504
394
|
* `PickedElement` crosses the frame (`valCanvasProtocol.ts`).
|
|
505
395
|
*/
|
|
506
396
|
|
|
@@ -1199,9 +1089,8 @@ function selectorOf(element, root) {
|
|
|
1199
1089
|
* `screenshot_page`, so it can see a change it made rather than only read it
|
|
1200
1090
|
* (`read_page` gives the words and the boxes).
|
|
1201
1091
|
*
|
|
1202
|
-
* Taken HERE
|
|
1203
|
-
* the
|
|
1204
|
-
* frame of another origin. So the bridge renders its own document --
|
|
1092
|
+
* Taken HERE, in the page: a browser lets no page photograph a frame, so
|
|
1093
|
+
* the bridge renders its own document --
|
|
1205
1094
|
* `modern-screenshot` draws the DOM, with its computed styles, fonts and
|
|
1206
1095
|
* same-origin images, into a canvas -- and hands back a JPEG.
|
|
1207
1096
|
*
|
|
@@ -1589,7 +1478,6 @@ exports.getPageRouterSitemapTree = getPageRouterSitemapTree;
|
|
|
1589
1478
|
exports.getPageRouterSourceFolder = getPageRouterSourceFolder;
|
|
1590
1479
|
exports.getPatternFromModuleFilePath = getPatternFromModuleFilePath;
|
|
1591
1480
|
exports.getTanStackRouterSourceFolder = getTanStackRouterSourceFolder;
|
|
1592
|
-
exports.isDesignTabOrigin = isDesignTabOrigin;
|
|
1593
1481
|
exports.isQuickPreviewFiles = isQuickPreviewFiles;
|
|
1594
1482
|
exports.isTanStackRoutesFolder = isTanStackRoutesFolder;
|
|
1595
1483
|
exports.isValCanvasFrame = isValCanvasFrame;
|
|
@@ -1598,7 +1486,6 @@ exports.isValCanvasStudioMessage = isValCanvasStudioMessage;
|
|
|
1598
1486
|
exports.modifierLabel = modifierLabel;
|
|
1599
1487
|
exports.pageLocationOf = pageLocationOf;
|
|
1600
1488
|
exports.parseRoutePattern = parseRoutePattern;
|
|
1601
|
-
exports.quickPreviewSiteOrigin = quickPreviewSiteOrigin;
|
|
1602
1489
|
exports.readPageSnapshot = readPageSnapshot;
|
|
1603
1490
|
exports.restoreScroll = restoreScroll;
|
|
1604
1491
|
exports.screenshotPage = screenshotPage;
|
|
@@ -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-dc61b8b6.cjs.dev.js');
|
|
14
14
|
var FlexSearch = require('flexsearch');
|
|
15
15
|
var utils = require('../../dist/utils-d3d8b4b5.cjs.dev.js');
|
|
16
16
|
|
|
@@ -11885,7 +11885,6 @@ exports.getPageRouterSitemapTree = getSitemapTree.getPageRouterSitemapTree;
|
|
|
11885
11885
|
exports.getPageRouterSourceFolder = getSitemapTree.getPageRouterSourceFolder;
|
|
11886
11886
|
exports.getPatternFromModuleFilePath = getSitemapTree.getPatternFromModuleFilePath;
|
|
11887
11887
|
exports.getTanStackRouterSourceFolder = getSitemapTree.getTanStackRouterSourceFolder;
|
|
11888
|
-
exports.isDesignTabOrigin = getSitemapTree.isDesignTabOrigin;
|
|
11889
11888
|
exports.isQuickPreviewFiles = getSitemapTree.isQuickPreviewFiles;
|
|
11890
11889
|
exports.isTanStackRoutesFolder = getSitemapTree.isTanStackRoutesFolder;
|
|
11891
11890
|
exports.isValCanvasFrame = getSitemapTree.isValCanvasFrame;
|
|
@@ -11894,7 +11893,6 @@ exports.isValCanvasStudioMessage = getSitemapTree.isValCanvasStudioMessage;
|
|
|
11894
11893
|
exports.modifierLabel = getSitemapTree.modifierLabel;
|
|
11895
11894
|
exports.pageLocationOf = getSitemapTree.pageLocationOf;
|
|
11896
11895
|
exports.parseRoutePattern = getSitemapTree.parseRoutePattern;
|
|
11897
|
-
exports.quickPreviewSiteOrigin = getSitemapTree.quickPreviewSiteOrigin;
|
|
11898
11896
|
exports.readPageSnapshot = getSitemapTree.readPageSnapshot;
|
|
11899
11897
|
exports.restoreScroll = getSitemapTree.restoreScroll;
|
|
11900
11898
|
exports.screenshotPage = getSitemapTree.screenshotPage;
|
|
@@ -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-d0942fca.cjs.prod.js');
|
|
14
14
|
var FlexSearch = require('flexsearch');
|
|
15
15
|
var utils = require('../../dist/utils-32bcaca2.cjs.prod.js');
|
|
16
16
|
|
|
@@ -11885,7 +11885,6 @@ exports.getPageRouterSitemapTree = getSitemapTree.getPageRouterSitemapTree;
|
|
|
11885
11885
|
exports.getPageRouterSourceFolder = getSitemapTree.getPageRouterSourceFolder;
|
|
11886
11886
|
exports.getPatternFromModuleFilePath = getSitemapTree.getPatternFromModuleFilePath;
|
|
11887
11887
|
exports.getTanStackRouterSourceFolder = getSitemapTree.getTanStackRouterSourceFolder;
|
|
11888
|
-
exports.isDesignTabOrigin = getSitemapTree.isDesignTabOrigin;
|
|
11889
11888
|
exports.isQuickPreviewFiles = getSitemapTree.isQuickPreviewFiles;
|
|
11890
11889
|
exports.isTanStackRoutesFolder = getSitemapTree.isTanStackRoutesFolder;
|
|
11891
11890
|
exports.isValCanvasFrame = getSitemapTree.isValCanvasFrame;
|
|
@@ -11894,7 +11893,6 @@ exports.isValCanvasStudioMessage = getSitemapTree.isValCanvasStudioMessage;
|
|
|
11894
11893
|
exports.modifierLabel = getSitemapTree.modifierLabel;
|
|
11895
11894
|
exports.pageLocationOf = getSitemapTree.pageLocationOf;
|
|
11896
11895
|
exports.parseRoutePattern = getSitemapTree.parseRoutePattern;
|
|
11897
|
-
exports.quickPreviewSiteOrigin = getSitemapTree.quickPreviewSiteOrigin;
|
|
11898
11896
|
exports.readPageSnapshot = getSitemapTree.readPageSnapshot;
|
|
11899
11897
|
exports.restoreScroll = getSitemapTree.restoreScroll;
|
|
11900
11898
|
exports.screenshotPage = getSitemapTree.screenshotPage;
|
|
@@ -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, v as QUICK_PREVIEW_RENDER_SCRIPT, u as QUICK_PREVIEW_SERVICE_WORKER_PATH, z as QUICK_PREVIEW_SERVICE_WORKER_SOURCE, x 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, j as attachElementPicker, k as createPickerOverlay, h as describeElement, l as elementLabel, q as findBySelector,
|
|
10
|
+
export { D as DEFAULT_CANVAS_SELECTION, e as DEFAULT_CANVAS_SELECTION_SOFT, Q as QUICK_PREVIEW_PARAM, v as QUICK_PREVIEW_RENDER_SCRIPT, u as QUICK_PREVIEW_SERVICE_WORKER_PATH, z as QUICK_PREVIEW_SERVICE_WORKER_SOURCE, x 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, j as attachElementPicker, k as createPickerOverlay, h as describeElement, l as elementLabel, q as findBySelector, E as formatRoutePattern, F as getNextAppRouterSourceFolder, J as getPageRouterSitemapTree, H as getPageRouterSourceFolder, K as getPatternFromModuleFilePath, G as getTanStackRouterSourceFolder, y as isQuickPreviewFiles, I as isTanStackRoutesFolder, g as isValCanvasFrame, i as isValCanvasPageMessage, f as isValCanvasStudioMessage, m as modifierLabel, p as pageLocationOf, C as parseRoutePattern, o as readPageSnapshot, r as restoreScroll, t as screenshotPage, s as startElementPicking, A as storeQuickPreview, n as watchPageLocation, B as withQuickPreviewParam, w as withValCanvasParam } from '../../dist/getSitemapTree-2b22cf1b.esm.js';
|
|
11
11
|
import FlexSearch from 'flexsearch';
|
|
12
12
|
import { b as base64DataUrlToUint8Array } from '../../dist/utils-00f3e1df.esm.js';
|
|
13
13
|
|