@valbuild/next 0.150.11 → 0.150.13
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 +38 -0
- package/dist/ValCanvasBridge-134c3ae1.cjs.js +7 -0
- package/dist/{ValCanvasBridge-b0cf84b5.cjs.prod.js → ValCanvasBridge-134c3ae1.cjs.prod.js} +98 -15
- package/dist/{ValCanvasBridge-2ae482d4.esm.js → ValCanvasBridge-4a5ef73c.esm.js} +99 -16
- package/dist/{ValCanvasBridge-c0dacd5a.cjs.dev.js → ValCanvasBridge-9d221d32.cjs.dev.js} +98 -15
- package/dist/ValNextProvider-35d0b521.cjs.prod.js +1 -1
- package/dist/ValNextProvider-a85a1d33.cjs.dev.js +1 -1
- package/dist/ValNextProvider-df6f351e.esm.js +1 -1
- package/dist/valbuild-next.cjs.dev.js +1 -1
- package/dist/valbuild-next.cjs.prod.js +1 -1
- package/dist/valbuild-next.esm.js +1 -1
- package/dist/{version-fd8b5d31.esm.js → version-a12c3424.esm.js} +1 -1
- package/dist/{version-93810b24.cjs.dev.js → version-f8ed0986.cjs.dev.js} +1 -1
- package/dist/{version-f390770a.cjs.prod.js → version-fc401414.cjs.prod.js} +1 -1
- package/package.json +7 -7
- package/rsc/dist/valbuild-next-rsc.cjs.dev.js +3 -2
- package/rsc/dist/valbuild-next-rsc.cjs.prod.js +3 -2
- package/rsc/dist/valbuild-next-rsc.esm.js +3 -2
- package/server/dist/valbuild-next-server.cjs.dev.js +3 -2
- package/server/dist/valbuild-next-server.cjs.prod.js +3 -2
- package/server/dist/valbuild-next-server.esm.js +3 -2
- package/dist/ValCanvasBridge-b0cf84b5.cjs.js +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @valbuild/next
|
|
2
2
|
|
|
3
|
+
## 0.150.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#985](https://github.com/valbuild/val/pull/985) [`0cd38eb`](https://github.com/valbuild/val/commit/0cd38eb62c80e2b3989aa45a6c9c75b02fc27cd1) Thanks [@freekh](https://github.com/freekh)! - The design tab's assistant can check its work two more ways.
|
|
8
|
+
|
|
9
|
+
- **`lint`** runs Val's own eslint rules -- the ones `@valbuild/eslint-plugin` runs in an editor -- over the proposal's files: a `c.define` path that is not the file's own, a module missing from `val.modules.ts`, `c.define` content that is a variable (which validates, then fails at publish), an import a `.val` file may not make. With `fix: true` it stages the fixes the rules can make themselves.
|
|
10
|
+
- **`screenshot_page`** shows the assistant a picture of the page in the preview, at desktop, tablet or phone width, on screen or the whole page. The page draws itself, through the canvas bridge in `@valbuild/next` and `@valbuild/tanstack`, so a site needs those packages at this version for it. The picture is drawn from the page's HTML and CSS: images from other sites, videos, canvases and embeds may come out blank.
|
|
11
|
+
|
|
12
|
+
`@valbuild/eslint-plugin` has a new entry, `@valbuild/eslint-plugin/rules`, with the same rules over a project that is not on a disk (`createRules(host)`). The plugin itself behaves as before.
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`295a925`](https://github.com/valbuild/val/commit/295a92513fe0356fafc78978bd0a6d32866f1dbe), [`0cd38eb`](https://github.com/valbuild/val/commit/0cd38eb62c80e2b3989aa45a6c9c75b02fc27cd1), [`0e490a9`](https://github.com/valbuild/val/commit/0e490a9b6e44b1e3d70e914d2b16009335124c4b)]:
|
|
15
|
+
- @valbuild/ui@0.150.13
|
|
16
|
+
- @valbuild/shared@0.150.13
|
|
17
|
+
- @valbuild/react@0.150.13
|
|
18
|
+
- @valbuild/server@0.150.13
|
|
19
|
+
- @valbuild/language-server@0.150.13
|
|
20
|
+
- @valbuild/mcp@0.150.13
|
|
21
|
+
|
|
22
|
+
## 0.150.12
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- [#977](https://github.com/valbuild/val/pull/977) [`55f565e`](https://github.com/valbuild/val/commit/55f565eefe470d1a7cda436d628aec2f7ad61969) Thanks [@freekh](https://github.com/freekh)! - The Studio now shows which versions of Val it runs. Open the Account panel (the button at the foot of the left rail) and click the grey line at the bottom, for example `TanStack · Val 0.150.8`, to see:
|
|
27
|
+
|
|
28
|
+
- what your app's server runs: `@valbuild/next` or `@valbuild/tanstack`, `@valbuild/core` and `@valbuild/server`
|
|
29
|
+
- what the Studio in your browser loaded: `@valbuild/ui`, and the `@valbuild/core` bundled into it
|
|
30
|
+
|
|
31
|
+
**Copy all** puts the list on the clipboard, ready to paste into a bug report. The server's half comes from a new `GET /api/val/versions` route, which needs the same sign-in as the rest of the Studio. If your server's Val is older than the Studio, the list says so and still shows the Studio's half.
|
|
32
|
+
|
|
33
|
+
- Updated dependencies [[`e39a373`](https://github.com/valbuild/val/commit/e39a3730624cbf3a5434d4fb0d13be26f44280db), [`d47537a`](https://github.com/valbuild/val/commit/d47537a40ca7ca0c6a5e7b80f1dfb18791fc5bc1), [`55f565e`](https://github.com/valbuild/val/commit/55f565eefe470d1a7cda436d628aec2f7ad61969)]:
|
|
34
|
+
- @valbuild/ui@0.150.12
|
|
35
|
+
- @valbuild/server@0.150.12
|
|
36
|
+
- @valbuild/shared@0.150.12
|
|
37
|
+
- @valbuild/react@0.150.12
|
|
38
|
+
- @valbuild/language-server@0.150.12
|
|
39
|
+
- @valbuild/mcp@0.150.12
|
|
40
|
+
|
|
3
41
|
## 0.150.11
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
|
@@ -339,6 +339,44 @@ function ValCanvasBridge(_ref) {
|
|
|
339
339
|
});
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
+
if (message.type === "screenshotPage") {
|
|
343
|
+
// The assistant's `screenshot_page`: a picture of the page, drawn
|
|
344
|
+
// here because the tab is another origin and cannot. As `readPage`:
|
|
345
|
+
// only for the frame's parent, when that is the design tab or the
|
|
346
|
+
// Studio here, and answered to it alone.
|
|
347
|
+
if (event.source !== window.parent) return;
|
|
348
|
+
var _asker = event.origin;
|
|
349
|
+
void client.isDesignTabOrigin(_asker, {
|
|
350
|
+
api: "/api/val",
|
|
351
|
+
own: window.location.origin
|
|
352
|
+
}).then(/*#__PURE__*/function () {
|
|
353
|
+
var _ref2 = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee(trusted) {
|
|
354
|
+
var _t;
|
|
355
|
+
return asyncToGenerator._regenerator().w(function (_context) {
|
|
356
|
+
while (1) switch (_context.n) {
|
|
357
|
+
case 0:
|
|
358
|
+
if (trusted) {
|
|
359
|
+
_context.n = 1;
|
|
360
|
+
break;
|
|
361
|
+
}
|
|
362
|
+
return _context.a(2);
|
|
363
|
+
case 1:
|
|
364
|
+
_t = window.parent;
|
|
365
|
+
_context.n = 2;
|
|
366
|
+
return screenshotReply(message);
|
|
367
|
+
case 2:
|
|
368
|
+
_t.postMessage.call(_t, _context.v, _asker);
|
|
369
|
+
case 3:
|
|
370
|
+
return _context.a(2);
|
|
371
|
+
}
|
|
372
|
+
}, _callee);
|
|
373
|
+
}));
|
|
374
|
+
return function (_x) {
|
|
375
|
+
return _ref2.apply(this, arguments);
|
|
376
|
+
};
|
|
377
|
+
}());
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
342
380
|
if (message.type === "quickPreview") {
|
|
343
381
|
// Code that will run on this address: only from the frame's parent,
|
|
344
382
|
// and only when that is the site's design tab. See `quickPreview.ts`.
|
|
@@ -346,23 +384,23 @@ function ValCanvasBridge(_ref) {
|
|
|
346
384
|
var id = message.id,
|
|
347
385
|
files = message.files;
|
|
348
386
|
var origin = event.origin;
|
|
349
|
-
void asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function
|
|
350
|
-
var site,
|
|
351
|
-
return asyncToGenerator._regenerator().w(function (
|
|
352
|
-
while (1) switch (
|
|
387
|
+
void asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee2() {
|
|
388
|
+
var site, _t2;
|
|
389
|
+
return asyncToGenerator._regenerator().w(function (_context2) {
|
|
390
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
353
391
|
case 0:
|
|
354
|
-
|
|
355
|
-
|
|
392
|
+
_context2.p = 0;
|
|
393
|
+
_context2.n = 1;
|
|
356
394
|
return client.quickPreviewSiteOrigin("/api/val");
|
|
357
395
|
case 1:
|
|
358
|
-
site =
|
|
396
|
+
site = _context2.v;
|
|
359
397
|
if (!(site === null || site !== origin)) {
|
|
360
|
-
|
|
398
|
+
_context2.n = 2;
|
|
361
399
|
break;
|
|
362
400
|
}
|
|
363
401
|
throw new Error("Only the site's design tab can show a quick preview of this proposal.");
|
|
364
402
|
case 2:
|
|
365
|
-
|
|
403
|
+
_context2.n = 3;
|
|
366
404
|
return client.storeQuickPreview(id, files, {
|
|
367
405
|
swUrl: "/api/val".concat(client.QUICK_PREVIEW_SERVICE_WORKER_PATH)
|
|
368
406
|
});
|
|
@@ -372,21 +410,21 @@ function ValCanvasBridge(_ref) {
|
|
|
372
410
|
type: "quickPreviewStored",
|
|
373
411
|
id: id
|
|
374
412
|
});
|
|
375
|
-
|
|
413
|
+
_context2.n = 5;
|
|
376
414
|
break;
|
|
377
415
|
case 4:
|
|
378
|
-
|
|
379
|
-
|
|
416
|
+
_context2.p = 4;
|
|
417
|
+
_t2 = _context2.v;
|
|
380
418
|
post({
|
|
381
419
|
val: client.VAL_CANVAS_MESSAGE,
|
|
382
420
|
type: "quickPreviewStored",
|
|
383
421
|
id: id,
|
|
384
|
-
error:
|
|
422
|
+
error: _t2 instanceof Error ? _t2.message : String(_t2)
|
|
385
423
|
});
|
|
386
424
|
case 5:
|
|
387
|
-
return
|
|
425
|
+
return _context2.a(2);
|
|
388
426
|
}
|
|
389
|
-
},
|
|
427
|
+
}, _callee2, null, [[0, 4]]);
|
|
390
428
|
}))();
|
|
391
429
|
return;
|
|
392
430
|
}
|
|
@@ -784,7 +822,52 @@ function findByPath(path) {
|
|
|
784
822
|
return null;
|
|
785
823
|
}
|
|
786
824
|
|
|
825
|
+
/** What `screenshotPage` answers: the picture, or why it could not be taken. */
|
|
826
|
+
function screenshotReply(_x2) {
|
|
827
|
+
return _screenshotReply.apply(this, arguments);
|
|
828
|
+
}
|
|
787
829
|
/** What `readPage` answers: the page read, or why it could not be. */
|
|
830
|
+
function _screenshotReply() {
|
|
831
|
+
_screenshotReply = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee3(message) {
|
|
832
|
+
var _t3, _t4, _t5, _t6;
|
|
833
|
+
return asyncToGenerator._regenerator().w(function (_context3) {
|
|
834
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
835
|
+
case 0:
|
|
836
|
+
_context3.p = 0;
|
|
837
|
+
_t3 = client.VAL_CANVAS_MESSAGE;
|
|
838
|
+
_t4 = message.requestId;
|
|
839
|
+
_context3.n = 1;
|
|
840
|
+
return client.screenshotPage(window, objectSpread2._objectSpread2(objectSpread2._objectSpread2({}, message.fullPage !== undefined ? {
|
|
841
|
+
fullPage: message.fullPage
|
|
842
|
+
} : {}), {}, {
|
|
843
|
+
// The picker's highlight is the Studio's, not the page's.
|
|
844
|
+
exclude: function exclude(element) {
|
|
845
|
+
return element.hasAttribute("data-val-picker");
|
|
846
|
+
}
|
|
847
|
+
}));
|
|
848
|
+
case 1:
|
|
849
|
+
_t5 = _context3.v;
|
|
850
|
+
return _context3.a(2, {
|
|
851
|
+
val: _t3,
|
|
852
|
+
type: "pageScreenshot",
|
|
853
|
+
requestId: _t4,
|
|
854
|
+
screenshot: _t5
|
|
855
|
+
});
|
|
856
|
+
case 2:
|
|
857
|
+
_context3.p = 2;
|
|
858
|
+
_t6 = _context3.v;
|
|
859
|
+
return _context3.a(2, {
|
|
860
|
+
val: client.VAL_CANVAS_MESSAGE,
|
|
861
|
+
type: "pageScreenshot",
|
|
862
|
+
requestId: message.requestId,
|
|
863
|
+
screenshot: null,
|
|
864
|
+
error: _t6 instanceof Error ? _t6.message : String(_t6)
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
}, _callee3, null, [[0, 2]]);
|
|
868
|
+
}));
|
|
869
|
+
return _screenshotReply.apply(this, arguments);
|
|
870
|
+
}
|
|
788
871
|
function readPageReply(message) {
|
|
789
872
|
try {
|
|
790
873
|
return {
|
|
@@ -4,7 +4,7 @@ import { _ as _asyncToGenerator, a as _regenerator } from './asyncToGenerator-50
|
|
|
4
4
|
import { _ as _slicedToArray } from './slicedToArray-aa291011.esm.js';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { Internal } from '@valbuild/core';
|
|
7
|
-
import { VAL_CANVAS_MESSAGE, watchPageLocation, startElementPicking, DEFAULT_CANVAS_SELECTION, DEFAULT_CANVAS_SELECTION_SOFT, isValCanvasStudioMessage, restoreScroll, isDesignTabOrigin, storeQuickPreview, QUICK_PREVIEW_SERVICE_WORKER_PATH, quickPreviewSiteOrigin, readPageSnapshot } from '@valbuild/shared/client';
|
|
7
|
+
import { VAL_CANVAS_MESSAGE, watchPageLocation, startElementPicking, DEFAULT_CANVAS_SELECTION, DEFAULT_CANVAS_SELECTION_SOFT, isValCanvasStudioMessage, restoreScroll, isDesignTabOrigin, storeQuickPreview, QUICK_PREVIEW_SERVICE_WORKER_PATH, quickPreviewSiteOrigin, readPageSnapshot, screenshotPage } from '@valbuild/shared/client';
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
9
|
import './defineProperty-cca5affa.esm.js';
|
|
10
10
|
import './unsupportedIterableToArray-5baabfdc.esm.js';
|
|
@@ -331,6 +331,44 @@ function ValCanvasBridge(_ref) {
|
|
|
331
331
|
});
|
|
332
332
|
return;
|
|
333
333
|
}
|
|
334
|
+
if (message.type === "screenshotPage") {
|
|
335
|
+
// The assistant's `screenshot_page`: a picture of the page, drawn
|
|
336
|
+
// here because the tab is another origin and cannot. As `readPage`:
|
|
337
|
+
// only for the frame's parent, when that is the design tab or the
|
|
338
|
+
// Studio here, and answered to it alone.
|
|
339
|
+
if (event.source !== window.parent) return;
|
|
340
|
+
var _asker = event.origin;
|
|
341
|
+
void isDesignTabOrigin(_asker, {
|
|
342
|
+
api: "/api/val",
|
|
343
|
+
own: window.location.origin
|
|
344
|
+
}).then(/*#__PURE__*/function () {
|
|
345
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(trusted) {
|
|
346
|
+
var _t;
|
|
347
|
+
return _regenerator().w(function (_context) {
|
|
348
|
+
while (1) switch (_context.n) {
|
|
349
|
+
case 0:
|
|
350
|
+
if (trusted) {
|
|
351
|
+
_context.n = 1;
|
|
352
|
+
break;
|
|
353
|
+
}
|
|
354
|
+
return _context.a(2);
|
|
355
|
+
case 1:
|
|
356
|
+
_t = window.parent;
|
|
357
|
+
_context.n = 2;
|
|
358
|
+
return screenshotReply(message);
|
|
359
|
+
case 2:
|
|
360
|
+
_t.postMessage.call(_t, _context.v, _asker);
|
|
361
|
+
case 3:
|
|
362
|
+
return _context.a(2);
|
|
363
|
+
}
|
|
364
|
+
}, _callee);
|
|
365
|
+
}));
|
|
366
|
+
return function (_x) {
|
|
367
|
+
return _ref2.apply(this, arguments);
|
|
368
|
+
};
|
|
369
|
+
}());
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
334
372
|
if (message.type === "quickPreview") {
|
|
335
373
|
// Code that will run on this address: only from the frame's parent,
|
|
336
374
|
// and only when that is the site's design tab. See `quickPreview.ts`.
|
|
@@ -338,23 +376,23 @@ function ValCanvasBridge(_ref) {
|
|
|
338
376
|
var id = message.id,
|
|
339
377
|
files = message.files;
|
|
340
378
|
var origin = event.origin;
|
|
341
|
-
void _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
342
|
-
var site,
|
|
343
|
-
return _regenerator().w(function (
|
|
344
|
-
while (1) switch (
|
|
379
|
+
void _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
380
|
+
var site, _t2;
|
|
381
|
+
return _regenerator().w(function (_context2) {
|
|
382
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
345
383
|
case 0:
|
|
346
|
-
|
|
347
|
-
|
|
384
|
+
_context2.p = 0;
|
|
385
|
+
_context2.n = 1;
|
|
348
386
|
return quickPreviewSiteOrigin("/api/val");
|
|
349
387
|
case 1:
|
|
350
|
-
site =
|
|
388
|
+
site = _context2.v;
|
|
351
389
|
if (!(site === null || site !== origin)) {
|
|
352
|
-
|
|
390
|
+
_context2.n = 2;
|
|
353
391
|
break;
|
|
354
392
|
}
|
|
355
393
|
throw new Error("Only the site's design tab can show a quick preview of this proposal.");
|
|
356
394
|
case 2:
|
|
357
|
-
|
|
395
|
+
_context2.n = 3;
|
|
358
396
|
return storeQuickPreview(id, files, {
|
|
359
397
|
swUrl: "/api/val".concat(QUICK_PREVIEW_SERVICE_WORKER_PATH)
|
|
360
398
|
});
|
|
@@ -364,21 +402,21 @@ function ValCanvasBridge(_ref) {
|
|
|
364
402
|
type: "quickPreviewStored",
|
|
365
403
|
id: id
|
|
366
404
|
});
|
|
367
|
-
|
|
405
|
+
_context2.n = 5;
|
|
368
406
|
break;
|
|
369
407
|
case 4:
|
|
370
|
-
|
|
371
|
-
|
|
408
|
+
_context2.p = 4;
|
|
409
|
+
_t2 = _context2.v;
|
|
372
410
|
post({
|
|
373
411
|
val: VAL_CANVAS_MESSAGE,
|
|
374
412
|
type: "quickPreviewStored",
|
|
375
413
|
id: id,
|
|
376
|
-
error:
|
|
414
|
+
error: _t2 instanceof Error ? _t2.message : String(_t2)
|
|
377
415
|
});
|
|
378
416
|
case 5:
|
|
379
|
-
return
|
|
417
|
+
return _context2.a(2);
|
|
380
418
|
}
|
|
381
|
-
},
|
|
419
|
+
}, _callee2, null, [[0, 4]]);
|
|
382
420
|
}))();
|
|
383
421
|
return;
|
|
384
422
|
}
|
|
@@ -776,7 +814,52 @@ function findByPath(path) {
|
|
|
776
814
|
return null;
|
|
777
815
|
}
|
|
778
816
|
|
|
817
|
+
/** What `screenshotPage` answers: the picture, or why it could not be taken. */
|
|
818
|
+
function screenshotReply(_x2) {
|
|
819
|
+
return _screenshotReply.apply(this, arguments);
|
|
820
|
+
}
|
|
779
821
|
/** What `readPage` answers: the page read, or why it could not be. */
|
|
822
|
+
function _screenshotReply() {
|
|
823
|
+
_screenshotReply = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(message) {
|
|
824
|
+
var _t3, _t4, _t5, _t6;
|
|
825
|
+
return _regenerator().w(function (_context3) {
|
|
826
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
827
|
+
case 0:
|
|
828
|
+
_context3.p = 0;
|
|
829
|
+
_t3 = VAL_CANVAS_MESSAGE;
|
|
830
|
+
_t4 = message.requestId;
|
|
831
|
+
_context3.n = 1;
|
|
832
|
+
return screenshotPage(window, _objectSpread2(_objectSpread2({}, message.fullPage !== undefined ? {
|
|
833
|
+
fullPage: message.fullPage
|
|
834
|
+
} : {}), {}, {
|
|
835
|
+
// The picker's highlight is the Studio's, not the page's.
|
|
836
|
+
exclude: function exclude(element) {
|
|
837
|
+
return element.hasAttribute("data-val-picker");
|
|
838
|
+
}
|
|
839
|
+
}));
|
|
840
|
+
case 1:
|
|
841
|
+
_t5 = _context3.v;
|
|
842
|
+
return _context3.a(2, {
|
|
843
|
+
val: _t3,
|
|
844
|
+
type: "pageScreenshot",
|
|
845
|
+
requestId: _t4,
|
|
846
|
+
screenshot: _t5
|
|
847
|
+
});
|
|
848
|
+
case 2:
|
|
849
|
+
_context3.p = 2;
|
|
850
|
+
_t6 = _context3.v;
|
|
851
|
+
return _context3.a(2, {
|
|
852
|
+
val: VAL_CANVAS_MESSAGE,
|
|
853
|
+
type: "pageScreenshot",
|
|
854
|
+
requestId: message.requestId,
|
|
855
|
+
screenshot: null,
|
|
856
|
+
error: _t6 instanceof Error ? _t6.message : String(_t6)
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
}, _callee3, null, [[0, 2]]);
|
|
860
|
+
}));
|
|
861
|
+
return _screenshotReply.apply(this, arguments);
|
|
862
|
+
}
|
|
780
863
|
function readPageReply(message) {
|
|
781
864
|
try {
|
|
782
865
|
return {
|
|
@@ -339,6 +339,44 @@ function ValCanvasBridge(_ref) {
|
|
|
339
339
|
});
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
+
if (message.type === "screenshotPage") {
|
|
343
|
+
// The assistant's `screenshot_page`: a picture of the page, drawn
|
|
344
|
+
// here because the tab is another origin and cannot. As `readPage`:
|
|
345
|
+
// only for the frame's parent, when that is the design tab or the
|
|
346
|
+
// Studio here, and answered to it alone.
|
|
347
|
+
if (event.source !== window.parent) return;
|
|
348
|
+
var _asker = event.origin;
|
|
349
|
+
void client.isDesignTabOrigin(_asker, {
|
|
350
|
+
api: "/api/val",
|
|
351
|
+
own: window.location.origin
|
|
352
|
+
}).then(/*#__PURE__*/function () {
|
|
353
|
+
var _ref2 = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee(trusted) {
|
|
354
|
+
var _t;
|
|
355
|
+
return asyncToGenerator._regenerator().w(function (_context) {
|
|
356
|
+
while (1) switch (_context.n) {
|
|
357
|
+
case 0:
|
|
358
|
+
if (trusted) {
|
|
359
|
+
_context.n = 1;
|
|
360
|
+
break;
|
|
361
|
+
}
|
|
362
|
+
return _context.a(2);
|
|
363
|
+
case 1:
|
|
364
|
+
_t = window.parent;
|
|
365
|
+
_context.n = 2;
|
|
366
|
+
return screenshotReply(message);
|
|
367
|
+
case 2:
|
|
368
|
+
_t.postMessage.call(_t, _context.v, _asker);
|
|
369
|
+
case 3:
|
|
370
|
+
return _context.a(2);
|
|
371
|
+
}
|
|
372
|
+
}, _callee);
|
|
373
|
+
}));
|
|
374
|
+
return function (_x) {
|
|
375
|
+
return _ref2.apply(this, arguments);
|
|
376
|
+
};
|
|
377
|
+
}());
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
342
380
|
if (message.type === "quickPreview") {
|
|
343
381
|
// Code that will run on this address: only from the frame's parent,
|
|
344
382
|
// and only when that is the site's design tab. See `quickPreview.ts`.
|
|
@@ -346,23 +384,23 @@ function ValCanvasBridge(_ref) {
|
|
|
346
384
|
var id = message.id,
|
|
347
385
|
files = message.files;
|
|
348
386
|
var origin = event.origin;
|
|
349
|
-
void asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function
|
|
350
|
-
var site,
|
|
351
|
-
return asyncToGenerator._regenerator().w(function (
|
|
352
|
-
while (1) switch (
|
|
387
|
+
void asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee2() {
|
|
388
|
+
var site, _t2;
|
|
389
|
+
return asyncToGenerator._regenerator().w(function (_context2) {
|
|
390
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
353
391
|
case 0:
|
|
354
|
-
|
|
355
|
-
|
|
392
|
+
_context2.p = 0;
|
|
393
|
+
_context2.n = 1;
|
|
356
394
|
return client.quickPreviewSiteOrigin("/api/val");
|
|
357
395
|
case 1:
|
|
358
|
-
site =
|
|
396
|
+
site = _context2.v;
|
|
359
397
|
if (!(site === null || site !== origin)) {
|
|
360
|
-
|
|
398
|
+
_context2.n = 2;
|
|
361
399
|
break;
|
|
362
400
|
}
|
|
363
401
|
throw new Error("Only the site's design tab can show a quick preview of this proposal.");
|
|
364
402
|
case 2:
|
|
365
|
-
|
|
403
|
+
_context2.n = 3;
|
|
366
404
|
return client.storeQuickPreview(id, files, {
|
|
367
405
|
swUrl: "/api/val".concat(client.QUICK_PREVIEW_SERVICE_WORKER_PATH)
|
|
368
406
|
});
|
|
@@ -372,21 +410,21 @@ function ValCanvasBridge(_ref) {
|
|
|
372
410
|
type: "quickPreviewStored",
|
|
373
411
|
id: id
|
|
374
412
|
});
|
|
375
|
-
|
|
413
|
+
_context2.n = 5;
|
|
376
414
|
break;
|
|
377
415
|
case 4:
|
|
378
|
-
|
|
379
|
-
|
|
416
|
+
_context2.p = 4;
|
|
417
|
+
_t2 = _context2.v;
|
|
380
418
|
post({
|
|
381
419
|
val: client.VAL_CANVAS_MESSAGE,
|
|
382
420
|
type: "quickPreviewStored",
|
|
383
421
|
id: id,
|
|
384
|
-
error:
|
|
422
|
+
error: _t2 instanceof Error ? _t2.message : String(_t2)
|
|
385
423
|
});
|
|
386
424
|
case 5:
|
|
387
|
-
return
|
|
425
|
+
return _context2.a(2);
|
|
388
426
|
}
|
|
389
|
-
},
|
|
427
|
+
}, _callee2, null, [[0, 4]]);
|
|
390
428
|
}))();
|
|
391
429
|
return;
|
|
392
430
|
}
|
|
@@ -784,7 +822,52 @@ function findByPath(path) {
|
|
|
784
822
|
return null;
|
|
785
823
|
}
|
|
786
824
|
|
|
825
|
+
/** What `screenshotPage` answers: the picture, or why it could not be taken. */
|
|
826
|
+
function screenshotReply(_x2) {
|
|
827
|
+
return _screenshotReply.apply(this, arguments);
|
|
828
|
+
}
|
|
787
829
|
/** What `readPage` answers: the page read, or why it could not be. */
|
|
830
|
+
function _screenshotReply() {
|
|
831
|
+
_screenshotReply = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee3(message) {
|
|
832
|
+
var _t3, _t4, _t5, _t6;
|
|
833
|
+
return asyncToGenerator._regenerator().w(function (_context3) {
|
|
834
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
835
|
+
case 0:
|
|
836
|
+
_context3.p = 0;
|
|
837
|
+
_t3 = client.VAL_CANVAS_MESSAGE;
|
|
838
|
+
_t4 = message.requestId;
|
|
839
|
+
_context3.n = 1;
|
|
840
|
+
return client.screenshotPage(window, objectSpread2._objectSpread2(objectSpread2._objectSpread2({}, message.fullPage !== undefined ? {
|
|
841
|
+
fullPage: message.fullPage
|
|
842
|
+
} : {}), {}, {
|
|
843
|
+
// The picker's highlight is the Studio's, not the page's.
|
|
844
|
+
exclude: function exclude(element) {
|
|
845
|
+
return element.hasAttribute("data-val-picker");
|
|
846
|
+
}
|
|
847
|
+
}));
|
|
848
|
+
case 1:
|
|
849
|
+
_t5 = _context3.v;
|
|
850
|
+
return _context3.a(2, {
|
|
851
|
+
val: _t3,
|
|
852
|
+
type: "pageScreenshot",
|
|
853
|
+
requestId: _t4,
|
|
854
|
+
screenshot: _t5
|
|
855
|
+
});
|
|
856
|
+
case 2:
|
|
857
|
+
_context3.p = 2;
|
|
858
|
+
_t6 = _context3.v;
|
|
859
|
+
return _context3.a(2, {
|
|
860
|
+
val: client.VAL_CANVAS_MESSAGE,
|
|
861
|
+
type: "pageScreenshot",
|
|
862
|
+
requestId: message.requestId,
|
|
863
|
+
screenshot: null,
|
|
864
|
+
error: _t6 instanceof Error ? _t6.message : String(_t6)
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
}, _callee3, null, [[0, 2]]);
|
|
868
|
+
}));
|
|
869
|
+
return _screenshotReply.apply(this, arguments);
|
|
870
|
+
}
|
|
788
871
|
function readPageReply(message) {
|
|
789
872
|
try {
|
|
790
873
|
return {
|
|
@@ -16,7 +16,7 @@ var stega = require('@valbuild/react/stega');
|
|
|
16
16
|
var fallbackColors = require('./fallbackColors-e1d73b36.cjs.prod.js');
|
|
17
17
|
var client = require('@valbuild/shared/client');
|
|
18
18
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-d4afcad8.cjs.prod.js');
|
|
19
|
-
var ValCanvasBridge = require('./ValCanvasBridge-
|
|
19
|
+
var ValCanvasBridge = require('./ValCanvasBridge-134c3ae1.cjs.prod.js');
|
|
20
20
|
var jsxRuntime = require('react/jsx-runtime');
|
|
21
21
|
require('./unsupportedIterableToArray-0d2087a2.cjs.prod.js');
|
|
22
22
|
require('./defineProperty-8951f469.cjs.prod.js');
|
|
@@ -16,7 +16,7 @@ var stega = require('@valbuild/react/stega');
|
|
|
16
16
|
var fallbackColors = require('./fallbackColors-080c1bbc.cjs.dev.js');
|
|
17
17
|
var client = require('@valbuild/shared/client');
|
|
18
18
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-0445603c.cjs.dev.js');
|
|
19
|
-
var ValCanvasBridge = require('./ValCanvasBridge-
|
|
19
|
+
var ValCanvasBridge = require('./ValCanvasBridge-9d221d32.cjs.dev.js');
|
|
20
20
|
var jsxRuntime = require('react/jsx-runtime');
|
|
21
21
|
require('./unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
|
|
22
22
|
require('./defineProperty-f90345d7.cjs.dev.js');
|
|
@@ -12,7 +12,7 @@ import { SET_AUTO_TAG_JSX_ENABLED } from '@valbuild/react/stega';
|
|
|
12
12
|
import { p as prefixStyles, u as useConfigStorageSave, f as floatDarkBg, d as floatLightBg, v as valPrefixedClass, c as cn } from './fallbackColors-149dfbc9.esm.js';
|
|
13
13
|
import { VAL_THEME_SESSION_STORAGE_KEY, isValCanvasFrame } from '@valbuild/shared/client';
|
|
14
14
|
import { _ as _createForOfIteratorHelper } from './createForOfIteratorHelper-5758a730.esm.js';
|
|
15
|
-
import { ValCanvasBridge } from './ValCanvasBridge-
|
|
15
|
+
import { ValCanvasBridge } from './ValCanvasBridge-4a5ef73c.esm.js';
|
|
16
16
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
17
17
|
import './unsupportedIterableToArray-5baabfdc.esm.js';
|
|
18
18
|
import './defineProperty-cca5affa.esm.js';
|
|
@@ -14,7 +14,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
14
14
|
var ValVideo = require('./ValVideo-6e410ad8.cjs.dev.js');
|
|
15
15
|
var ValApp = require('./ValApp-c718d1a6.cjs.dev.js');
|
|
16
16
|
var ValModulesClient = require('./ValModulesClient-4ecabf99.cjs.dev.js');
|
|
17
|
-
var version = require('./version-
|
|
17
|
+
var version = require('./version-f8ed0986.cjs.dev.js');
|
|
18
18
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-0445603c.cjs.dev.js');
|
|
19
19
|
require('./defineProperty-f90345d7.cjs.dev.js');
|
|
20
20
|
require('./unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
|
|
@@ -14,7 +14,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
14
14
|
var ValVideo = require('./ValVideo-dcd2b9f8.cjs.prod.js');
|
|
15
15
|
var ValApp = require('./ValApp-6c3da222.cjs.prod.js');
|
|
16
16
|
var ValModulesClient = require('./ValModulesClient-10c0721c.cjs.prod.js');
|
|
17
|
-
var version = require('./version-
|
|
17
|
+
var version = require('./version-fc401414.cjs.prod.js');
|
|
18
18
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-d4afcad8.cjs.prod.js');
|
|
19
19
|
require('./defineProperty-8951f469.cjs.prod.js');
|
|
20
20
|
require('./unsupportedIterableToArray-0d2087a2.cjs.prod.js');
|
|
@@ -13,7 +13,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
13
13
|
export { ValVideo } from './ValVideo-d377f06e.esm.js';
|
|
14
14
|
export { ValApp } from './ValApp-a88a9ded.esm.js';
|
|
15
15
|
export { ValModulesClient, useRegisterValModules } from './ValModulesClient-0dd601a1.esm.js';
|
|
16
|
-
import { V as VERSION } from './version-
|
|
16
|
+
import { V as VERSION } from './version-a12c3424.esm.js';
|
|
17
17
|
import { _ as _createForOfIteratorHelper } from './createForOfIteratorHelper-5758a730.esm.js';
|
|
18
18
|
import './defineProperty-cca5affa.esm.js';
|
|
19
19
|
import './unsupportedIterableToArray-5baabfdc.esm.js';
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"next",
|
|
13
13
|
"react"
|
|
14
14
|
],
|
|
15
|
-
"version": "0.150.
|
|
15
|
+
"version": "0.150.13",
|
|
16
16
|
"main": "dist/valbuild-next.cjs.js",
|
|
17
17
|
"module": "dist/valbuild-next.esm.js",
|
|
18
18
|
"exports": {
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
"client-only": "^0.0.1",
|
|
49
49
|
"server-only": "^0.0.1",
|
|
50
50
|
"@valbuild/core": "0.150.3",
|
|
51
|
-
"@valbuild/language-server": "0.150.
|
|
52
|
-
"@valbuild/
|
|
53
|
-
"@valbuild/
|
|
54
|
-
"@valbuild/
|
|
55
|
-
"@valbuild/shared": "0.150.
|
|
56
|
-
"@valbuild/ui": "0.150.
|
|
51
|
+
"@valbuild/language-server": "0.150.13",
|
|
52
|
+
"@valbuild/mcp": "0.150.13",
|
|
53
|
+
"@valbuild/react": "0.150.13",
|
|
54
|
+
"@valbuild/server": "0.150.13",
|
|
55
|
+
"@valbuild/shared": "0.150.13",
|
|
56
|
+
"@valbuild/ui": "0.150.13"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@testing-library/react": "^16.3.3",
|
|
@@ -12,7 +12,7 @@ var core = require('@valbuild/core');
|
|
|
12
12
|
var React = require('react');
|
|
13
13
|
var internal = require('@valbuild/shared/internal');
|
|
14
14
|
var server = require('@valbuild/server');
|
|
15
|
-
var version = require('../../dist/version-
|
|
15
|
+
var version = require('../../dist/version-f8ed0986.cjs.dev.js');
|
|
16
16
|
require('../../dist/createForOfIteratorHelper-0445603c.cjs.dev.js');
|
|
17
17
|
require('../../dist/unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
|
|
18
18
|
require('../../dist/slicedToArray-44036a76.cjs.dev.js');
|
|
@@ -820,7 +820,8 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
820
820
|
var valServerPromise = server.createValServer(valModules, "/api/val", objectSpread2._objectSpread2({
|
|
821
821
|
versions: {
|
|
822
822
|
next: nextVersion,
|
|
823
|
-
core: coreVersion
|
|
823
|
+
core: coreVersion,
|
|
824
|
+
framework: "next"
|
|
824
825
|
}
|
|
825
826
|
}, config), config, {
|
|
826
827
|
isEnabled: function isEnabled() {
|
|
@@ -12,7 +12,7 @@ var core = require('@valbuild/core');
|
|
|
12
12
|
var React = require('react');
|
|
13
13
|
var internal = require('@valbuild/shared/internal');
|
|
14
14
|
var server = require('@valbuild/server');
|
|
15
|
-
var version = require('../../dist/version-
|
|
15
|
+
var version = require('../../dist/version-fc401414.cjs.prod.js');
|
|
16
16
|
require('../../dist/createForOfIteratorHelper-d4afcad8.cjs.prod.js');
|
|
17
17
|
require('../../dist/unsupportedIterableToArray-0d2087a2.cjs.prod.js');
|
|
18
18
|
require('../../dist/slicedToArray-ce613de6.cjs.prod.js');
|
|
@@ -820,7 +820,8 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
820
820
|
var valServerPromise = server.createValServer(valModules, "/api/val", objectSpread2._objectSpread2({
|
|
821
821
|
versions: {
|
|
822
822
|
next: nextVersion,
|
|
823
|
-
core: coreVersion
|
|
823
|
+
core: coreVersion,
|
|
824
|
+
framework: "next"
|
|
824
825
|
}
|
|
825
826
|
}, config), config, {
|
|
826
827
|
isEnabled: function isEnabled() {
|
|
@@ -8,7 +8,7 @@ import { Internal } from '@valbuild/core';
|
|
|
8
8
|
import { cache } from 'react';
|
|
9
9
|
import { VAL_SESSION_COOKIE, memoizePerRequest } from '@valbuild/shared/internal';
|
|
10
10
|
import { createValServer } from '@valbuild/server';
|
|
11
|
-
import { V as VERSION } from '../../dist/version-
|
|
11
|
+
import { V as VERSION } from '../../dist/version-a12c3424.esm.js';
|
|
12
12
|
import '../../dist/createForOfIteratorHelper-5758a730.esm.js';
|
|
13
13
|
import '../../dist/unsupportedIterableToArray-5baabfdc.esm.js';
|
|
14
14
|
import '../../dist/slicedToArray-aa291011.esm.js';
|
|
@@ -816,7 +816,8 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
816
816
|
var valServerPromise = createValServer(valModules, "/api/val", _objectSpread2({
|
|
817
817
|
versions: {
|
|
818
818
|
next: nextVersion,
|
|
819
|
-
core: coreVersion
|
|
819
|
+
core: coreVersion,
|
|
820
|
+
framework: "next"
|
|
820
821
|
}
|
|
821
822
|
}, config), config, {
|
|
822
823
|
isEnabled: function isEnabled() {
|
|
@@ -9,7 +9,7 @@ var objectSpread2 = require('../../dist/objectSpread2-58024783.cjs.dev.js');
|
|
|
9
9
|
var core = require('@valbuild/core');
|
|
10
10
|
var server = require('@valbuild/server');
|
|
11
11
|
var server$1 = require('next/server');
|
|
12
|
-
var version = require('../../dist/version-
|
|
12
|
+
var version = require('../../dist/version-f8ed0986.cjs.dev.js');
|
|
13
13
|
var mcp = require('@valbuild/mcp');
|
|
14
14
|
require('../../dist/unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
|
|
15
15
|
require('../../dist/defineProperty-f90345d7.cjs.dev.js');
|
|
@@ -27,7 +27,8 @@ var initValNextAppRouter = function initValNextAppRouter(valModules, config, nex
|
|
|
27
27
|
return server.createValApiRouter(route, server.createValServer(valModules, route, objectSpread2._objectSpread2({
|
|
28
28
|
versions: {
|
|
29
29
|
next: nextVersion,
|
|
30
|
-
core: coreVersion
|
|
30
|
+
core: coreVersion,
|
|
31
|
+
framework: "next"
|
|
31
32
|
}
|
|
32
33
|
}, config), config, {
|
|
33
34
|
isEnabled: function isEnabled() {
|
|
@@ -9,7 +9,7 @@ var objectSpread2 = require('../../dist/objectSpread2-13f847a9.cjs.prod.js');
|
|
|
9
9
|
var core = require('@valbuild/core');
|
|
10
10
|
var server = require('@valbuild/server');
|
|
11
11
|
var server$1 = require('next/server');
|
|
12
|
-
var version = require('../../dist/version-
|
|
12
|
+
var version = require('../../dist/version-fc401414.cjs.prod.js');
|
|
13
13
|
var mcp = require('@valbuild/mcp');
|
|
14
14
|
require('../../dist/unsupportedIterableToArray-0d2087a2.cjs.prod.js');
|
|
15
15
|
require('../../dist/defineProperty-8951f469.cjs.prod.js');
|
|
@@ -27,7 +27,8 @@ var initValNextAppRouter = function initValNextAppRouter(valModules, config, nex
|
|
|
27
27
|
return server.createValApiRouter(route, server.createValServer(valModules, route, objectSpread2._objectSpread2({
|
|
28
28
|
versions: {
|
|
29
29
|
next: nextVersion,
|
|
30
|
-
core: coreVersion
|
|
30
|
+
core: coreVersion,
|
|
31
|
+
framework: "next"
|
|
31
32
|
}
|
|
32
33
|
}, config), config, {
|
|
33
34
|
isEnabled: function isEnabled() {
|
|
@@ -6,7 +6,7 @@ import { Internal } from '@valbuild/core';
|
|
|
6
6
|
import { createValApiRouter, createValServer } from '@valbuild/server';
|
|
7
7
|
export { createPrettierFormatter } from '@valbuild/server';
|
|
8
8
|
import { NextResponse } from 'next/server';
|
|
9
|
-
import { V as VERSION } from '../../dist/version-
|
|
9
|
+
import { V as VERSION } from '../../dist/version-a12c3424.esm.js';
|
|
10
10
|
import { initValMcp as initValMcp$1 } from '@valbuild/mcp';
|
|
11
11
|
import '../../dist/unsupportedIterableToArray-5baabfdc.esm.js';
|
|
12
12
|
import '../../dist/defineProperty-cca5affa.esm.js';
|
|
@@ -24,7 +24,8 @@ var initValNextAppRouter = function initValNextAppRouter(valModules, config, nex
|
|
|
24
24
|
return createValApiRouter(route, createValServer(valModules, route, _objectSpread2({
|
|
25
25
|
versions: {
|
|
26
26
|
next: nextVersion,
|
|
27
|
-
core: coreVersion
|
|
27
|
+
core: coreVersion,
|
|
28
|
+
framework: "next"
|
|
28
29
|
}
|
|
29
30
|
}, config), config, {
|
|
30
31
|
isEnabled: function isEnabled() {
|