@valbuild/next 0.152.2 → 0.153.0
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 +30 -0
- package/dist/ValCanvasBridge-15729d01.cjs.js +7 -0
- package/dist/{ValCanvasBridge-4166883a.cjs.prod.js → ValCanvasBridge-15729d01.cjs.prod.js} +34 -10
- package/dist/{ValCanvasBridge-ce35f123.esm.js → ValCanvasBridge-52b7bf0a.esm.js} +34 -10
- package/dist/{ValCanvasBridge-847e3386.cjs.dev.js → ValCanvasBridge-55e4f5c8.cjs.dev.js} +34 -10
- package/dist/ValNextProvider-141f7813.cjs.js +7 -0
- package/dist/{ValNextProvider-41d622a7.cjs.prod.js → ValNextProvider-141f7813.cjs.prod.js} +3 -9
- package/dist/{ValNextProvider-4b9bcfc0.cjs.dev.js → ValNextProvider-1ca811a5.cjs.dev.js} +3 -9
- package/dist/{ValNextProvider-745ed99e.esm.js → ValNextProvider-690053b9.esm.js} +3 -9
- package/dist/valbuild-next.cjs.dev.js +2 -2
- package/dist/valbuild-next.cjs.prod.js +2 -2
- package/dist/valbuild-next.esm.js +2 -2
- package/dist/{version-d15c3a29.esm.js → version-071eeba4.esm.js} +1 -1
- package/dist/{version-0628bae1.cjs.prod.js → version-0a9fcf5a.cjs.prod.js} +1 -1
- package/dist/{version-3b636b47.cjs.dev.js → version-43f61b34.cjs.dev.js} +1 -1
- package/package.json +8 -8
- package/rsc/dist/valbuild-next-rsc.cjs.dev.js +1 -1
- package/rsc/dist/valbuild-next-rsc.cjs.prod.js +1 -1
- package/rsc/dist/valbuild-next-rsc.esm.js +1 -1
- package/server/dist/valbuild-next-server.cjs.dev.js +1 -1
- package/server/dist/valbuild-next-server.cjs.prod.js +1 -1
- package/server/dist/valbuild-next-server.esm.js +1 -1
- package/dist/ValCanvasBridge-4166883a.cjs.js +0 -7
- package/dist/ValNextProvider-41d622a7.cjs.js +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @valbuild/next
|
|
2
2
|
|
|
3
|
+
## 0.153.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1016](https://github.com/valbuild/val/pull/1016) [`2e70d13`](https://github.com/valbuild/val/commit/2e70d13cf7ca25874900c9ea25227df2876727b9) Thanks [@freekh](https://github.com/freekh)! - Removed what 0.151.0 kept only so that a Studio, a page and a server from the release before could still talk to each other during a deploy:
|
|
8
|
+
|
|
9
|
+
- **`PUT /api/val/sources/~`** is gone. Nothing in 0.151.0 asked it: the Studio reads modules through `GET /api/val/manifest` and `GET /api/val/modules/~<path>`, and `fetchVal`, `useVal` and the MCP tools read the server's content in-process. If a script or test of yours read content through it, read one module with `GET /api/val/modules/~<path>` instead. Its answer has the module's `source` and `version`, and an `entries` map holding the `.jsonValues()` entries pending changes touched.
|
|
10
|
+
- **`ValDraft.base`** is gone from the type. It has not been sent or read since 0.151.0, so a `draft` you pass to `ValProvider` is not affected.
|
|
11
|
+
- **A page no longer accepts edits relayed by a Studio from before 0.151.0.** Such a Studio sent each module as a bare `source`. After the upgrade, the Studio and your pages come from the same deploy, so this only matters while an older Studio is still open in a tab during a rollout. Reloading that tab fixes it.
|
|
12
|
+
- **`/api/val/stat`** no longer needs `sourcesSha` and `schemaSha`. The Studio now tells your local server which version it last saw, and the server still sends both fields for a Studio of 0.151.0. They stop being sent in the next release.
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#1016](https://github.com/valbuild/val/pull/1016) [`2e70d13`](https://github.com/valbuild/val/commit/2e70d13cf7ca25874900c9ea25227df2876727b9) Thanks [@freekh](https://github.com/freekh)! - `/api/val/enable`, `/api/val/disable` and Val's other routes that take `redirect_to` now accept a path on your site, such as `?redirect_to=/blog`, and redirect to it on the same origin. In a Next.js app a path used to answer 500. A value that is neither a path starting with `/` nor an absolute URL is refused with a 400 that says what is accepted.
|
|
17
|
+
|
|
18
|
+
- [#1030](https://github.com/valbuild/val/pull/1030) [`efa1f7d`](https://github.com/valbuild/val/commit/efa1f7d810f3c4e4e21502c9cc81ce86da93650c) Thanks [@freekh](https://github.com/freekh)! - **Point the assistant at something on the page.** With the preview open, the assistant has a **Select** in its header: press it, click a field on the page, and what you picked shows above the message box and goes with your next message, so "make this shorter" means that field. In code mode it can pick any element, outlined in the proposal's colour. Press the × on it to take it off.
|
|
19
|
+
|
|
20
|
+
- Selecting a field to edit has moved from the preview's toolbar to the top of the editor column, beside **Structure | On page**. Esc turns it off, from the Studio or from the page.
|
|
21
|
+
- On a desktop the assistant now sits beside the preview instead of over it, so it never covers what you point it at.
|
|
22
|
+
- The assistant can read the page in the preview, and take a picture of it, to see what you see.
|
|
23
|
+
|
|
24
|
+
- Updated dependencies [[`67145fd`](https://github.com/valbuild/val/commit/67145fd16e35f2e3e0988ca5690fe5a4f84c1a41), [`67145fd`](https://github.com/valbuild/val/commit/67145fd16e35f2e3e0988ca5690fe5a4f84c1a41), [`efa1f7d`](https://github.com/valbuild/val/commit/efa1f7d810f3c4e4e21502c9cc81ce86da93650c), [`efa1f7d`](https://github.com/valbuild/val/commit/efa1f7d810f3c4e4e21502c9cc81ce86da93650c), [`27e51ba`](https://github.com/valbuild/val/commit/27e51baadce61b2cbee2d5ef227aae045ccb2e21), [`efa1f7d`](https://github.com/valbuild/val/commit/efa1f7d810f3c4e4e21502c9cc81ce86da93650c), [`2e70d13`](https://github.com/valbuild/val/commit/2e70d13cf7ca25874900c9ea25227df2876727b9), [`2e70d13`](https://github.com/valbuild/val/commit/2e70d13cf7ca25874900c9ea25227df2876727b9), [`2e70d13`](https://github.com/valbuild/val/commit/2e70d13cf7ca25874900c9ea25227df2876727b9), [`2e70d13`](https://github.com/valbuild/val/commit/2e70d13cf7ca25874900c9ea25227df2876727b9), [`efa1f7d`](https://github.com/valbuild/val/commit/efa1f7d810f3c4e4e21502c9cc81ce86da93650c), [`2e70d13`](https://github.com/valbuild/val/commit/2e70d13cf7ca25874900c9ea25227df2876727b9), [`67145fd`](https://github.com/valbuild/val/commit/67145fd16e35f2e3e0988ca5690fe5a4f84c1a41), [`efa1f7d`](https://github.com/valbuild/val/commit/efa1f7d810f3c4e4e21502c9cc81ce86da93650c), [`efa1f7d`](https://github.com/valbuild/val/commit/efa1f7d810f3c4e4e21502c9cc81ce86da93650c), [`56ab7d5`](https://github.com/valbuild/val/commit/56ab7d5818772a9e310a561ebdb798b27ee704c9)]:
|
|
25
|
+
- @valbuild/ui@0.153.0
|
|
26
|
+
- @valbuild/core@0.153.0
|
|
27
|
+
- @valbuild/server@0.153.0
|
|
28
|
+
- @valbuild/shared@0.153.0
|
|
29
|
+
- @valbuild/react@0.153.0
|
|
30
|
+
- @valbuild/language-server@0.153.0
|
|
31
|
+
- @valbuild/mcp@0.153.0
|
|
32
|
+
|
|
3
33
|
## 0.152.2
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
@@ -58,7 +58,7 @@ var RESCAN_INTERVAL_MS = 5000;
|
|
|
58
58
|
* mounted there at all.
|
|
59
59
|
*/
|
|
60
60
|
function ValCanvasBridge(_ref) {
|
|
61
|
-
var _elementPicking$modif;
|
|
61
|
+
var _elementPicking$color, _elementPicking$modif;
|
|
62
62
|
var draftMode = _ref.draftMode,
|
|
63
63
|
isRefreshing = _ref.isRefreshing,
|
|
64
64
|
holds = _ref.holds,
|
|
@@ -98,6 +98,8 @@ function ValCanvasBridge(_ref) {
|
|
|
98
98
|
setElementPicking = _React$useState8[1];
|
|
99
99
|
var elementPickingActive = React__default["default"].useRef(false);
|
|
100
100
|
elementPickingActive.current = (elementPicking === null || elementPicking === void 0 ? void 0 : elementPicking.active) === true;
|
|
101
|
+
var elementPickingFieldsOnly = React__default["default"].useRef(false);
|
|
102
|
+
elementPickingFieldsOnly.current = (elementPicking === null || elementPicking === void 0 ? void 0 : elementPicking.fieldsOnly) === true;
|
|
101
103
|
var elementPicker = React__default["default"].useRef(null);
|
|
102
104
|
/** A scroll back to where the last build was, still trying. */
|
|
103
105
|
var stopRestoring = React__default["default"].useRef(null);
|
|
@@ -328,11 +330,14 @@ function ValCanvasBridge(_ref) {
|
|
|
328
330
|
return;
|
|
329
331
|
}
|
|
330
332
|
if (message.type === "pickElements") {
|
|
333
|
+
var _message$color;
|
|
331
334
|
setElementPicking({
|
|
332
335
|
enabled: message.enabled,
|
|
333
336
|
active: message.active,
|
|
334
337
|
modifier: message.modifier,
|
|
335
|
-
keepPicked: message.keepPicked
|
|
338
|
+
keepPicked: message.keepPicked,
|
|
339
|
+
fieldsOnly: message.fieldsOnly === true,
|
|
340
|
+
color: (_message$color = message.color) !== null && _message$color !== void 0 ? _message$color : null
|
|
336
341
|
});
|
|
337
342
|
return;
|
|
338
343
|
}
|
|
@@ -433,13 +438,11 @@ function ValCanvasBridge(_ref) {
|
|
|
433
438
|
* re-reads the server's own content is `confirmed`, below.)
|
|
434
439
|
*/
|
|
435
440
|
window.dispatchEvent(new CustomEvent("val-event", {
|
|
436
|
-
detail:
|
|
441
|
+
detail: {
|
|
437
442
|
type: "source-update",
|
|
438
443
|
moduleFilePath: message.moduleFilePath,
|
|
439
|
-
source: message.source
|
|
440
|
-
}, message.read !== undefined ? {
|
|
441
444
|
read: message.read
|
|
442
|
-
}
|
|
445
|
+
}
|
|
443
446
|
}));
|
|
444
447
|
return;
|
|
445
448
|
}
|
|
@@ -521,14 +524,32 @@ function ValCanvasBridge(_ref) {
|
|
|
521
524
|
};
|
|
522
525
|
}, [post]);
|
|
523
526
|
|
|
527
|
+
// Esc while picking fields: the key goes to the page, which has the focus
|
|
528
|
+
// once it has been clicked, so the studio hears of it only from here.
|
|
529
|
+
React__default["default"].useEffect(function () {
|
|
530
|
+
var onKey = function onKey(event) {
|
|
531
|
+
if (event.key === "Escape" && pickingRef.current) {
|
|
532
|
+
post({
|
|
533
|
+
val: client.VAL_CANVAS_MESSAGE,
|
|
534
|
+
type: "pickingStopped"
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
window.addEventListener("keydown", onKey);
|
|
539
|
+
return function () {
|
|
540
|
+
return window.removeEventListener("keydown", onKey);
|
|
541
|
+
};
|
|
542
|
+
}, [post]);
|
|
543
|
+
|
|
524
544
|
/**
|
|
525
545
|
* Picking any element: the page's own elements, which
|
|
526
546
|
* only this side of the frame can reach. The listeners and the outlines are
|
|
527
547
|
* `startElementPicking`'s (`@valbuild/shared`), so both bindings run the
|
|
528
548
|
* same picker; what crosses back is the element described.
|
|
529
549
|
*/
|
|
530
|
-
var
|
|
531
|
-
selectionColorRef
|
|
550
|
+
var pickColor = (_elementPicking$color = elementPicking === null || elementPicking === void 0 ? void 0 : elementPicking.color) !== null && _elementPicking$color !== void 0 ? _elementPicking$color : selectionColors.selection;
|
|
551
|
+
var selectionColorRef = React__default["default"].useRef(pickColor);
|
|
552
|
+
selectionColorRef.current = pickColor;
|
|
532
553
|
var pickingEnabled = (elementPicking === null || elementPicking === void 0 ? void 0 : elementPicking.enabled) === true;
|
|
533
554
|
var pickModifier = (_elementPicking$modif = elementPicking === null || elementPicking === void 0 ? void 0 : elementPicking.modifier) !== null && _elementPicking$modif !== void 0 ? _elementPicking$modif : "alt";
|
|
534
555
|
React__default["default"].useEffect(function () {
|
|
@@ -538,6 +559,9 @@ function ValCanvasBridge(_ref) {
|
|
|
538
559
|
active: function active() {
|
|
539
560
|
return elementPickingActive.current;
|
|
540
561
|
},
|
|
562
|
+
fieldsOnly: function fieldsOnly() {
|
|
563
|
+
return elementPickingFieldsOnly.current;
|
|
564
|
+
},
|
|
541
565
|
color: selectionColorRef.current,
|
|
542
566
|
onPick: function onPick(element) {
|
|
543
567
|
return post({
|
|
@@ -566,8 +590,8 @@ function ValCanvasBridge(_ref) {
|
|
|
566
590
|
}, [keepPicked]);
|
|
567
591
|
React__default["default"].useEffect(function () {
|
|
568
592
|
var _elementPicker$curren2;
|
|
569
|
-
(_elementPicker$curren2 = elementPicker.current) === null || _elementPicker$curren2 === void 0 || _elementPicker$curren2.setColor(
|
|
570
|
-
}, [
|
|
593
|
+
(_elementPicker$curren2 = elementPicker.current) === null || _elementPicker$curren2 === void 0 || _elementPicker$curren2.setColor(pickColor);
|
|
594
|
+
}, [pickColor]);
|
|
571
595
|
|
|
572
596
|
/**
|
|
573
597
|
* Two-finger gestures, handed to the studio.
|
|
@@ -50,7 +50,7 @@ var RESCAN_INTERVAL_MS = 5000;
|
|
|
50
50
|
* mounted there at all.
|
|
51
51
|
*/
|
|
52
52
|
function ValCanvasBridge(_ref) {
|
|
53
|
-
var _elementPicking$modif;
|
|
53
|
+
var _elementPicking$color, _elementPicking$modif;
|
|
54
54
|
var draftMode = _ref.draftMode,
|
|
55
55
|
isRefreshing = _ref.isRefreshing,
|
|
56
56
|
holds = _ref.holds,
|
|
@@ -90,6 +90,8 @@ function ValCanvasBridge(_ref) {
|
|
|
90
90
|
setElementPicking = _React$useState8[1];
|
|
91
91
|
var elementPickingActive = React.useRef(false);
|
|
92
92
|
elementPickingActive.current = (elementPicking === null || elementPicking === void 0 ? void 0 : elementPicking.active) === true;
|
|
93
|
+
var elementPickingFieldsOnly = React.useRef(false);
|
|
94
|
+
elementPickingFieldsOnly.current = (elementPicking === null || elementPicking === void 0 ? void 0 : elementPicking.fieldsOnly) === true;
|
|
93
95
|
var elementPicker = React.useRef(null);
|
|
94
96
|
/** A scroll back to where the last build was, still trying. */
|
|
95
97
|
var stopRestoring = React.useRef(null);
|
|
@@ -320,11 +322,14 @@ function ValCanvasBridge(_ref) {
|
|
|
320
322
|
return;
|
|
321
323
|
}
|
|
322
324
|
if (message.type === "pickElements") {
|
|
325
|
+
var _message$color;
|
|
323
326
|
setElementPicking({
|
|
324
327
|
enabled: message.enabled,
|
|
325
328
|
active: message.active,
|
|
326
329
|
modifier: message.modifier,
|
|
327
|
-
keepPicked: message.keepPicked
|
|
330
|
+
keepPicked: message.keepPicked,
|
|
331
|
+
fieldsOnly: message.fieldsOnly === true,
|
|
332
|
+
color: (_message$color = message.color) !== null && _message$color !== void 0 ? _message$color : null
|
|
328
333
|
});
|
|
329
334
|
return;
|
|
330
335
|
}
|
|
@@ -425,13 +430,11 @@ function ValCanvasBridge(_ref) {
|
|
|
425
430
|
* re-reads the server's own content is `confirmed`, below.)
|
|
426
431
|
*/
|
|
427
432
|
window.dispatchEvent(new CustomEvent("val-event", {
|
|
428
|
-
detail:
|
|
433
|
+
detail: {
|
|
429
434
|
type: "source-update",
|
|
430
435
|
moduleFilePath: message.moduleFilePath,
|
|
431
|
-
source: message.source
|
|
432
|
-
}, message.read !== undefined ? {
|
|
433
436
|
read: message.read
|
|
434
|
-
}
|
|
437
|
+
}
|
|
435
438
|
}));
|
|
436
439
|
return;
|
|
437
440
|
}
|
|
@@ -513,14 +516,32 @@ function ValCanvasBridge(_ref) {
|
|
|
513
516
|
};
|
|
514
517
|
}, [post]);
|
|
515
518
|
|
|
519
|
+
// Esc while picking fields: the key goes to the page, which has the focus
|
|
520
|
+
// once it has been clicked, so the studio hears of it only from here.
|
|
521
|
+
React.useEffect(function () {
|
|
522
|
+
var onKey = function onKey(event) {
|
|
523
|
+
if (event.key === "Escape" && pickingRef.current) {
|
|
524
|
+
post({
|
|
525
|
+
val: VAL_CANVAS_MESSAGE,
|
|
526
|
+
type: "pickingStopped"
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
window.addEventListener("keydown", onKey);
|
|
531
|
+
return function () {
|
|
532
|
+
return window.removeEventListener("keydown", onKey);
|
|
533
|
+
};
|
|
534
|
+
}, [post]);
|
|
535
|
+
|
|
516
536
|
/**
|
|
517
537
|
* Picking any element: the page's own elements, which
|
|
518
538
|
* only this side of the frame can reach. The listeners and the outlines are
|
|
519
539
|
* `startElementPicking`'s (`@valbuild/shared`), so both bindings run the
|
|
520
540
|
* same picker; what crosses back is the element described.
|
|
521
541
|
*/
|
|
522
|
-
var
|
|
523
|
-
selectionColorRef
|
|
542
|
+
var pickColor = (_elementPicking$color = elementPicking === null || elementPicking === void 0 ? void 0 : elementPicking.color) !== null && _elementPicking$color !== void 0 ? _elementPicking$color : selectionColors.selection;
|
|
543
|
+
var selectionColorRef = React.useRef(pickColor);
|
|
544
|
+
selectionColorRef.current = pickColor;
|
|
524
545
|
var pickingEnabled = (elementPicking === null || elementPicking === void 0 ? void 0 : elementPicking.enabled) === true;
|
|
525
546
|
var pickModifier = (_elementPicking$modif = elementPicking === null || elementPicking === void 0 ? void 0 : elementPicking.modifier) !== null && _elementPicking$modif !== void 0 ? _elementPicking$modif : "alt";
|
|
526
547
|
React.useEffect(function () {
|
|
@@ -530,6 +551,9 @@ function ValCanvasBridge(_ref) {
|
|
|
530
551
|
active: function active() {
|
|
531
552
|
return elementPickingActive.current;
|
|
532
553
|
},
|
|
554
|
+
fieldsOnly: function fieldsOnly() {
|
|
555
|
+
return elementPickingFieldsOnly.current;
|
|
556
|
+
},
|
|
533
557
|
color: selectionColorRef.current,
|
|
534
558
|
onPick: function onPick(element) {
|
|
535
559
|
return post({
|
|
@@ -558,8 +582,8 @@ function ValCanvasBridge(_ref) {
|
|
|
558
582
|
}, [keepPicked]);
|
|
559
583
|
React.useEffect(function () {
|
|
560
584
|
var _elementPicker$curren2;
|
|
561
|
-
(_elementPicker$curren2 = elementPicker.current) === null || _elementPicker$curren2 === void 0 || _elementPicker$curren2.setColor(
|
|
562
|
-
}, [
|
|
585
|
+
(_elementPicker$curren2 = elementPicker.current) === null || _elementPicker$curren2 === void 0 || _elementPicker$curren2.setColor(pickColor);
|
|
586
|
+
}, [pickColor]);
|
|
563
587
|
|
|
564
588
|
/**
|
|
565
589
|
* Two-finger gestures, handed to the studio.
|
|
@@ -58,7 +58,7 @@ var RESCAN_INTERVAL_MS = 5000;
|
|
|
58
58
|
* mounted there at all.
|
|
59
59
|
*/
|
|
60
60
|
function ValCanvasBridge(_ref) {
|
|
61
|
-
var _elementPicking$modif;
|
|
61
|
+
var _elementPicking$color, _elementPicking$modif;
|
|
62
62
|
var draftMode = _ref.draftMode,
|
|
63
63
|
isRefreshing = _ref.isRefreshing,
|
|
64
64
|
holds = _ref.holds,
|
|
@@ -98,6 +98,8 @@ function ValCanvasBridge(_ref) {
|
|
|
98
98
|
setElementPicking = _React$useState8[1];
|
|
99
99
|
var elementPickingActive = React__default["default"].useRef(false);
|
|
100
100
|
elementPickingActive.current = (elementPicking === null || elementPicking === void 0 ? void 0 : elementPicking.active) === true;
|
|
101
|
+
var elementPickingFieldsOnly = React__default["default"].useRef(false);
|
|
102
|
+
elementPickingFieldsOnly.current = (elementPicking === null || elementPicking === void 0 ? void 0 : elementPicking.fieldsOnly) === true;
|
|
101
103
|
var elementPicker = React__default["default"].useRef(null);
|
|
102
104
|
/** A scroll back to where the last build was, still trying. */
|
|
103
105
|
var stopRestoring = React__default["default"].useRef(null);
|
|
@@ -328,11 +330,14 @@ function ValCanvasBridge(_ref) {
|
|
|
328
330
|
return;
|
|
329
331
|
}
|
|
330
332
|
if (message.type === "pickElements") {
|
|
333
|
+
var _message$color;
|
|
331
334
|
setElementPicking({
|
|
332
335
|
enabled: message.enabled,
|
|
333
336
|
active: message.active,
|
|
334
337
|
modifier: message.modifier,
|
|
335
|
-
keepPicked: message.keepPicked
|
|
338
|
+
keepPicked: message.keepPicked,
|
|
339
|
+
fieldsOnly: message.fieldsOnly === true,
|
|
340
|
+
color: (_message$color = message.color) !== null && _message$color !== void 0 ? _message$color : null
|
|
336
341
|
});
|
|
337
342
|
return;
|
|
338
343
|
}
|
|
@@ -433,13 +438,11 @@ function ValCanvasBridge(_ref) {
|
|
|
433
438
|
* re-reads the server's own content is `confirmed`, below.)
|
|
434
439
|
*/
|
|
435
440
|
window.dispatchEvent(new CustomEvent("val-event", {
|
|
436
|
-
detail:
|
|
441
|
+
detail: {
|
|
437
442
|
type: "source-update",
|
|
438
443
|
moduleFilePath: message.moduleFilePath,
|
|
439
|
-
source: message.source
|
|
440
|
-
}, message.read !== undefined ? {
|
|
441
444
|
read: message.read
|
|
442
|
-
}
|
|
445
|
+
}
|
|
443
446
|
}));
|
|
444
447
|
return;
|
|
445
448
|
}
|
|
@@ -521,14 +524,32 @@ function ValCanvasBridge(_ref) {
|
|
|
521
524
|
};
|
|
522
525
|
}, [post]);
|
|
523
526
|
|
|
527
|
+
// Esc while picking fields: the key goes to the page, which has the focus
|
|
528
|
+
// once it has been clicked, so the studio hears of it only from here.
|
|
529
|
+
React__default["default"].useEffect(function () {
|
|
530
|
+
var onKey = function onKey(event) {
|
|
531
|
+
if (event.key === "Escape" && pickingRef.current) {
|
|
532
|
+
post({
|
|
533
|
+
val: client.VAL_CANVAS_MESSAGE,
|
|
534
|
+
type: "pickingStopped"
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
window.addEventListener("keydown", onKey);
|
|
539
|
+
return function () {
|
|
540
|
+
return window.removeEventListener("keydown", onKey);
|
|
541
|
+
};
|
|
542
|
+
}, [post]);
|
|
543
|
+
|
|
524
544
|
/**
|
|
525
545
|
* Picking any element: the page's own elements, which
|
|
526
546
|
* only this side of the frame can reach. The listeners and the outlines are
|
|
527
547
|
* `startElementPicking`'s (`@valbuild/shared`), so both bindings run the
|
|
528
548
|
* same picker; what crosses back is the element described.
|
|
529
549
|
*/
|
|
530
|
-
var
|
|
531
|
-
selectionColorRef
|
|
550
|
+
var pickColor = (_elementPicking$color = elementPicking === null || elementPicking === void 0 ? void 0 : elementPicking.color) !== null && _elementPicking$color !== void 0 ? _elementPicking$color : selectionColors.selection;
|
|
551
|
+
var selectionColorRef = React__default["default"].useRef(pickColor);
|
|
552
|
+
selectionColorRef.current = pickColor;
|
|
532
553
|
var pickingEnabled = (elementPicking === null || elementPicking === void 0 ? void 0 : elementPicking.enabled) === true;
|
|
533
554
|
var pickModifier = (_elementPicking$modif = elementPicking === null || elementPicking === void 0 ? void 0 : elementPicking.modifier) !== null && _elementPicking$modif !== void 0 ? _elementPicking$modif : "alt";
|
|
534
555
|
React__default["default"].useEffect(function () {
|
|
@@ -538,6 +559,9 @@ function ValCanvasBridge(_ref) {
|
|
|
538
559
|
active: function active() {
|
|
539
560
|
return elementPickingActive.current;
|
|
540
561
|
},
|
|
562
|
+
fieldsOnly: function fieldsOnly() {
|
|
563
|
+
return elementPickingFieldsOnly.current;
|
|
564
|
+
},
|
|
541
565
|
color: selectionColorRef.current,
|
|
542
566
|
onPick: function onPick(element) {
|
|
543
567
|
return post({
|
|
@@ -566,8 +590,8 @@ function ValCanvasBridge(_ref) {
|
|
|
566
590
|
}, [keepPicked]);
|
|
567
591
|
React__default["default"].useEffect(function () {
|
|
568
592
|
var _elementPicker$curren2;
|
|
569
|
-
(_elementPicker$curren2 = elementPicker.current) === null || _elementPicker$curren2 === void 0 || _elementPicker$curren2.setColor(
|
|
570
|
-
}, [
|
|
593
|
+
(_elementPicker$curren2 = elementPicker.current) === null || _elementPicker$curren2 === void 0 || _elementPicker$curren2.setColor(pickColor);
|
|
594
|
+
}, [pickColor]);
|
|
571
595
|
|
|
572
596
|
/**
|
|
573
597
|
* Two-finger gestures, handed to the studio.
|
|
@@ -17,7 +17,7 @@ var internal = require('@valbuild/react/internal');
|
|
|
17
17
|
var fallbackColors = require('./fallbackColors-d9a7b81e.cjs.prod.js');
|
|
18
18
|
var client = require('@valbuild/shared/client');
|
|
19
19
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-8459fbc7.cjs.prod.js');
|
|
20
|
-
var ValCanvasBridge = require('./ValCanvasBridge-
|
|
20
|
+
var ValCanvasBridge = require('./ValCanvasBridge-15729d01.cjs.prod.js');
|
|
21
21
|
var jsxRuntime = require('react/jsx-runtime');
|
|
22
22
|
require('./unsupportedIterableToArray-1aadf9fb.cjs.prod.js');
|
|
23
23
|
|
|
@@ -542,14 +542,8 @@ var ValNextProvider = function ValNextProvider(props) {
|
|
|
542
542
|
* the page already shows does not count.
|
|
543
543
|
*/
|
|
544
544
|
if (outcome.changed) {
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
// A Studio of the release before: it never confirms.
|
|
548
|
-
(_refreshLoopRef$curre3 = refreshLoopRef.current) === null || _refreshLoopRef$curre3 === void 0 || _refreshLoopRef$curre3.changedByPreviousStudio();
|
|
549
|
-
} else {
|
|
550
|
-
var _refreshLoopRef$curre4;
|
|
551
|
-
(_refreshLoopRef$curre4 = refreshLoopRef.current) === null || _refreshLoopRef$curre4 === void 0 || _refreshLoopRef$curre4.changed();
|
|
552
|
-
}
|
|
545
|
+
var _refreshLoopRef$curre3;
|
|
546
|
+
(_refreshLoopRef$curre3 = refreshLoopRef.current) === null || _refreshLoopRef$curre3 === void 0 || _refreshLoopRef$curre3.changed();
|
|
553
547
|
}
|
|
554
548
|
};
|
|
555
549
|
window.addEventListener("val-event", reactServerComponentRefreshListener);
|
|
@@ -17,7 +17,7 @@ var internal = require('@valbuild/react/internal');
|
|
|
17
17
|
var fallbackColors = require('./fallbackColors-38f01ad2.cjs.dev.js');
|
|
18
18
|
var client = require('@valbuild/shared/client');
|
|
19
19
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-9c6aa3c7.cjs.dev.js');
|
|
20
|
-
var ValCanvasBridge = require('./ValCanvasBridge-
|
|
20
|
+
var ValCanvasBridge = require('./ValCanvasBridge-55e4f5c8.cjs.dev.js');
|
|
21
21
|
var jsxRuntime = require('react/jsx-runtime');
|
|
22
22
|
require('./unsupportedIterableToArray-20a9209f.cjs.dev.js');
|
|
23
23
|
|
|
@@ -542,14 +542,8 @@ var ValNextProvider = function ValNextProvider(props) {
|
|
|
542
542
|
* the page already shows does not count.
|
|
543
543
|
*/
|
|
544
544
|
if (outcome.changed) {
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
// A Studio of the release before: it never confirms.
|
|
548
|
-
(_refreshLoopRef$curre3 = refreshLoopRef.current) === null || _refreshLoopRef$curre3 === void 0 || _refreshLoopRef$curre3.changedByPreviousStudio();
|
|
549
|
-
} else {
|
|
550
|
-
var _refreshLoopRef$curre4;
|
|
551
|
-
(_refreshLoopRef$curre4 = refreshLoopRef.current) === null || _refreshLoopRef$curre4 === void 0 || _refreshLoopRef$curre4.changed();
|
|
552
|
-
}
|
|
545
|
+
var _refreshLoopRef$curre3;
|
|
546
|
+
(_refreshLoopRef$curre3 = refreshLoopRef.current) === null || _refreshLoopRef$curre3 === void 0 || _refreshLoopRef$curre3.changed();
|
|
553
547
|
}
|
|
554
548
|
};
|
|
555
549
|
window.addEventListener("val-event", reactServerComponentRefreshListener);
|
|
@@ -13,7 +13,7 @@ import { isDraft, createDraftStore, draftHolds, draftHoldsVersions, startRefresh
|
|
|
13
13
|
import { p as prefixStyles, u as useConfigStorageSave, f as floatDarkBg, d as floatLightBg, v as valPrefixedClass, c as cn } from './fallbackColors-0d915c59.esm.js';
|
|
14
14
|
import { VAL_THEME_SESSION_STORAGE_KEY, isValCanvasFrame } from '@valbuild/shared/client';
|
|
15
15
|
import { _ as _createForOfIteratorHelper } from './createForOfIteratorHelper-9209e9dd.esm.js';
|
|
16
|
-
import { ValCanvasBridge } from './ValCanvasBridge-
|
|
16
|
+
import { ValCanvasBridge } from './ValCanvasBridge-52b7bf0a.esm.js';
|
|
17
17
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
18
18
|
import './unsupportedIterableToArray-f57eb659.esm.js';
|
|
19
19
|
|
|
@@ -515,14 +515,8 @@ var ValNextProvider = function ValNextProvider(props) {
|
|
|
515
515
|
* the page already shows does not count.
|
|
516
516
|
*/
|
|
517
517
|
if (outcome.changed) {
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
// A Studio of the release before: it never confirms.
|
|
521
|
-
(_refreshLoopRef$curre3 = refreshLoopRef.current) === null || _refreshLoopRef$curre3 === void 0 || _refreshLoopRef$curre3.changedByPreviousStudio();
|
|
522
|
-
} else {
|
|
523
|
-
var _refreshLoopRef$curre4;
|
|
524
|
-
(_refreshLoopRef$curre4 = refreshLoopRef.current) === null || _refreshLoopRef$curre4 === void 0 || _refreshLoopRef$curre4.changed();
|
|
525
|
-
}
|
|
518
|
+
var _refreshLoopRef$curre3;
|
|
519
|
+
(_refreshLoopRef$curre3 = refreshLoopRef.current) === null || _refreshLoopRef$curre3 === void 0 || _refreshLoopRef$curre3.changed();
|
|
526
520
|
}
|
|
527
521
|
};
|
|
528
522
|
window.addEventListener("val-event", reactServerComponentRefreshListener);
|
|
@@ -8,13 +8,13 @@ var core = require('@valbuild/core');
|
|
|
8
8
|
var stega = require('@valbuild/react/stega');
|
|
9
9
|
var objectWithoutProperties = require('./objectWithoutProperties-8f93848f.cjs.dev.js');
|
|
10
10
|
var internal = require('@valbuild/react/internal');
|
|
11
|
-
var ValNextProvider = require('./ValNextProvider-
|
|
11
|
+
var ValNextProvider = require('./ValNextProvider-1ca811a5.cjs.dev.js');
|
|
12
12
|
var NextImage = require('next/image');
|
|
13
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
14
|
var ValVideo = require('./ValVideo-15e5c4fa.cjs.dev.js');
|
|
15
15
|
var ValApp = require('./ValApp-826dca6c.cjs.dev.js');
|
|
16
16
|
var ValModulesClient = require('./ValModulesClient-4ecabf99.cjs.dev.js');
|
|
17
|
-
var version = require('./version-
|
|
17
|
+
var version = require('./version-43f61b34.cjs.dev.js');
|
|
18
18
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-9c6aa3c7.cjs.dev.js');
|
|
19
19
|
require('./unsupportedIterableToArray-20a9209f.cjs.dev.js');
|
|
20
20
|
|
|
@@ -8,13 +8,13 @@ var core = require('@valbuild/core');
|
|
|
8
8
|
var stega = require('@valbuild/react/stega');
|
|
9
9
|
var objectWithoutProperties = require('./objectWithoutProperties-107dcb46.cjs.prod.js');
|
|
10
10
|
var internal = require('@valbuild/react/internal');
|
|
11
|
-
var ValNextProvider = require('./ValNextProvider-
|
|
11
|
+
var ValNextProvider = require('./ValNextProvider-141f7813.cjs.prod.js');
|
|
12
12
|
var NextImage = require('next/image');
|
|
13
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
14
|
var ValVideo = require('./ValVideo-02f43a7c.cjs.prod.js');
|
|
15
15
|
var ValApp = require('./ValApp-866089f6.cjs.prod.js');
|
|
16
16
|
var ValModulesClient = require('./ValModulesClient-10c0721c.cjs.prod.js');
|
|
17
|
-
var version = require('./version-
|
|
17
|
+
var version = require('./version-0a9fcf5a.cjs.prod.js');
|
|
18
18
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-8459fbc7.cjs.prod.js');
|
|
19
19
|
require('./unsupportedIterableToArray-1aadf9fb.cjs.prod.js');
|
|
20
20
|
|
|
@@ -7,13 +7,13 @@ export { GenericSelector, Schema, VAL_EXTENSION, derefPatch, modules } from '@va
|
|
|
7
7
|
import { stegaEncode, attrs, raw, autoTagJSX } from '@valbuild/react/stega';
|
|
8
8
|
import { d as decodeValPathsOfString, _ as _objectWithoutProperties } from './objectWithoutProperties-2daec22c.esm.js';
|
|
9
9
|
export { ValRichText } from '@valbuild/react/internal';
|
|
10
|
-
import { ValNextProvider } from './ValNextProvider-
|
|
10
|
+
import { ValNextProvider } from './ValNextProvider-690053b9.esm.js';
|
|
11
11
|
import NextImage from 'next/image';
|
|
12
12
|
import { jsx } from 'react/jsx-runtime';
|
|
13
13
|
export { ValVideo } from './ValVideo-8acf31b6.esm.js';
|
|
14
14
|
export { ValApp } from './ValApp-69cd599c.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-071eeba4.esm.js';
|
|
17
17
|
import { _ as _createForOfIteratorHelper } from './createForOfIteratorHelper-9209e9dd.esm.js';
|
|
18
18
|
import './unsupportedIterableToArray-f57eb659.esm.js';
|
|
19
19
|
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"next",
|
|
13
13
|
"react"
|
|
14
14
|
],
|
|
15
|
-
"version": "0.
|
|
15
|
+
"version": "0.153.0",
|
|
16
16
|
"main": "dist/valbuild-next.cjs.js",
|
|
17
17
|
"module": "dist/valbuild-next.esm.js",
|
|
18
18
|
"exports": {
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"client-only": "^0.0.1",
|
|
49
49
|
"server-only": "^0.0.1",
|
|
50
|
-
"@valbuild/
|
|
51
|
-
"@valbuild/
|
|
52
|
-
"@valbuild/
|
|
53
|
-
"@valbuild/
|
|
54
|
-
"@valbuild/
|
|
55
|
-
"@valbuild/
|
|
56
|
-
"@valbuild/
|
|
50
|
+
"@valbuild/language-server": "0.153.0",
|
|
51
|
+
"@valbuild/mcp": "0.153.0",
|
|
52
|
+
"@valbuild/react": "0.153.0",
|
|
53
|
+
"@valbuild/server": "0.153.0",
|
|
54
|
+
"@valbuild/core": "0.153.0",
|
|
55
|
+
"@valbuild/ui": "0.153.0",
|
|
56
|
+
"@valbuild/shared": "0.153.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@testing-library/react": "^16.3.3",
|
|
@@ -9,7 +9,7 @@ var stega = require('@valbuild/react/stega');
|
|
|
9
9
|
var internal$1 = require('@valbuild/react/internal');
|
|
10
10
|
var core = require('@valbuild/core');
|
|
11
11
|
var internal = require('@valbuild/server/internal');
|
|
12
|
-
var version = require('../../dist/version-
|
|
12
|
+
var version = require('../../dist/version-43f61b34.cjs.dev.js');
|
|
13
13
|
var routeFromVal = require('../../dist/routeFromVal-a1e0a8be.cjs.dev.js');
|
|
14
14
|
require('../../dist/createForOfIteratorHelper-9c6aa3c7.cjs.dev.js');
|
|
15
15
|
require('../../dist/unsupportedIterableToArray-20a9209f.cjs.dev.js');
|
|
@@ -9,7 +9,7 @@ var stega = require('@valbuild/react/stega');
|
|
|
9
9
|
var internal$1 = require('@valbuild/react/internal');
|
|
10
10
|
var core = require('@valbuild/core');
|
|
11
11
|
var internal = require('@valbuild/server/internal');
|
|
12
|
-
var version = require('../../dist/version-
|
|
12
|
+
var version = require('../../dist/version-0a9fcf5a.cjs.prod.js');
|
|
13
13
|
var routeFromVal = require('../../dist/routeFromVal-c4dace91.cjs.prod.js');
|
|
14
14
|
require('../../dist/createForOfIteratorHelper-8459fbc7.cjs.prod.js');
|
|
15
15
|
require('../../dist/unsupportedIterableToArray-1aadf9fb.cjs.prod.js');
|
|
@@ -5,7 +5,7 @@ import { SET_RSC, SET_AUTO_TAG_JSX_ENABLED } from '@valbuild/react/stega';
|
|
|
5
5
|
import { fetchValFrom, isJsonValuesRecordSchema, awaitResolved, resolveValEntry, resolveVal } from '@valbuild/react/internal';
|
|
6
6
|
import { Internal } from '@valbuild/core';
|
|
7
7
|
import { createValRuntime, readDraftChanges, draftForRequest, readerSchemaVersion } from '@valbuild/server/internal';
|
|
8
|
-
import { V as VERSION } from '../../dist/version-
|
|
8
|
+
import { V as VERSION } from '../../dist/version-071eeba4.esm.js';
|
|
9
9
|
import { i as initValRouteFromVal, g as getValRouteUrlFromVal } from '../../dist/routeFromVal-80976677.esm.js';
|
|
10
10
|
import '../../dist/createForOfIteratorHelper-9209e9dd.esm.js';
|
|
11
11
|
import '../../dist/unsupportedIterableToArray-f57eb659.esm.js';
|
|
@@ -9,7 +9,7 @@ var objectSpread2 = require('../../dist/objectSpread2-58726b14.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-43f61b34.cjs.dev.js');
|
|
13
13
|
var mcp = require('@valbuild/mcp');
|
|
14
14
|
require('../../dist/unsupportedIterableToArray-20a9209f.cjs.dev.js');
|
|
15
15
|
|
|
@@ -9,7 +9,7 @@ var objectSpread2 = require('../../dist/objectSpread2-469273e9.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-0a9fcf5a.cjs.prod.js');
|
|
13
13
|
var mcp = require('@valbuild/mcp');
|
|
14
14
|
require('../../dist/unsupportedIterableToArray-1aadf9fb.cjs.prod.js');
|
|
15
15
|
|
|
@@ -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-071eeba4.esm.js';
|
|
10
10
|
import { initValMcp as initValMcp$1 } from '@valbuild/mcp';
|
|
11
11
|
import '../../dist/unsupportedIterableToArray-f57eb659.esm.js';
|
|
12
12
|
|