@valbuild/tanstack 0.152.0 → 0.152.2

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 CHANGED
@@ -1,5 +1,35 @@
1
1
  # @valbuild/tanstack
2
2
 
3
+ ## 0.152.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`077ab3e`](https://github.com/valbuild/val/commit/077ab3eeccc2ab75b1b6fd4a5cf14b71c9ee8344)]:
8
+ - @valbuild/ui@0.152.2
9
+ - @valbuild/react@0.152.2
10
+ - @valbuild/server@0.152.2
11
+ - @valbuild/language-server@0.152.2
12
+ - @valbuild/mcp@0.152.2
13
+
14
+ ## 0.152.1
15
+
16
+ ### Patch Changes
17
+
18
+ - [#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
19
+ now answers `read_page`, `screenshot_page` and a quick preview only to the
20
+ Studio at the page's own origin, and no longer asks the server whether another
21
+ origin is the site's design tab. The site's server no longer writes a
22
+ proposal's files or offers the `patch-file` route: code and content are
23
+ changed in the proposal's own Studio. The assistant's `build_proposal` no
24
+ longer takes a `reason`.
25
+ - Updated dependencies [[`b9089c8`](https://github.com/valbuild/val/commit/b9089c8787da8075722cc4ef3672beb61b288af4), [`b9089c8`](https://github.com/valbuild/val/commit/b9089c8787da8075722cc4ef3672beb61b288af4), [`b9089c8`](https://github.com/valbuild/val/commit/b9089c8787da8075722cc4ef3672beb61b288af4), [`b9089c8`](https://github.com/valbuild/val/commit/b9089c8787da8075722cc4ef3672beb61b288af4)]:
26
+ - @valbuild/ui@0.152.1
27
+ - @valbuild/server@0.152.1
28
+ - @valbuild/shared@0.152.1
29
+ - @valbuild/react@0.152.1
30
+ - @valbuild/language-server@0.152.1
31
+ - @valbuild/mcp@0.152.1
32
+
3
33
  ## 0.152.0
4
34
 
5
35
  ### Patch Changes
@@ -6,7 +6,7 @@ var asyncToGenerator = require('./asyncToGenerator-c3823d62.cjs.dev.js');
6
6
  var _typeof = require('./typeof-bd6ec82c.cjs.dev.js');
7
7
  var core = require('@valbuild/core');
8
8
  var stega = require('@valbuild/react/stega');
9
- var version = require('./version-c27a565d.cjs.dev.js');
9
+ var version = require('./version-9879acd5.cjs.dev.js');
10
10
  var internal = require('@valbuild/react/internal');
11
11
  var ui = require('@valbuild/ui');
12
12
  var reactRouter = require('@tanstack/react-router');
@@ -306,8 +306,8 @@ function ValCanvasBridge(_ref) {
306
306
  var pickingRef = React__default["default"].useRef(false);
307
307
  pickingRef.current = picking;
308
308
  /**
309
- * Picking ANY element (the design tab's `pickElements`), as the studio last
310
- * said. `null` until it says, which is every studio but the design tab.
309
+ * Picking ANY element (`pickElements`), as the studio last said. `null`
310
+ * until it says.
311
311
  */
312
312
  var _React$useState7 = React__default["default"].useState(null),
313
313
  _React$useState8 = _typeof._slicedToArray(_React$useState7, 2),
@@ -555,114 +555,80 @@ function ValCanvasBridge(_ref) {
555
555
  }
556
556
  if (message.type === "scrollTo") {
557
557
  var _stopRestoring$curren2;
558
- // Where the build before this one was: the design tab swaps a new
559
- // build in at the same place.
558
+ // Where the build before this one was: a new build swapped in at the
559
+ // same place.
560
560
  (_stopRestoring$curren2 = stopRestoring.current) === null || _stopRestoring$curren2 === void 0 || _stopRestoring$curren2.call(stopRestoring);
561
561
  stopRestoring.current = client.restoreScroll(window, message.x, message.y);
562
562
  return;
563
563
  }
564
564
  if (message.type === "readPage") {
565
- // The assistant's `read_page`: what is on the page, read here because
566
- // the tab is another origin and cannot. The page's words, unpublished
567
- // ones included, so only for the frame's parent, and only when that
568
- // is the site's design tab or the Studio here -- and answered to it
569
- // alone, not to `*`.
565
+ // The assistant's `read_page`: what is on the page, read here, where
566
+ // the page's elements are. The page's words, unpublished ones
567
+ // included, so only for the frame's parent, and only when that is the
568
+ // Studio here, at this page's own origin -- and answered to it alone,
569
+ // not to `*`.
570
570
  if (event.source !== window.parent) return;
571
571
  var asker = event.origin;
572
- void client.isDesignTabOrigin(asker, {
573
- api: "/api/val",
574
- own: window.location.origin
575
- }).then(function (trusted) {
576
- if (trusted) window.parent.postMessage(readPageReply(message), asker);
577
- });
572
+ if (asker !== window.location.origin) return;
573
+ window.parent.postMessage(readPageReply(message), asker);
578
574
  return;
579
575
  }
580
576
  if (message.type === "screenshotPage") {
581
577
  // The assistant's `screenshot_page`: a picture of the page, drawn
582
- // here because the tab is another origin and cannot. As `readPage`:
583
- // only for the frame's parent, when that is the design tab or the
578
+ // here. As `readPage`: only for the frame's parent, when that is the
584
579
  // Studio here, and answered to it alone.
585
580
  if (event.source !== window.parent) return;
586
581
  var _asker = event.origin;
587
- void client.isDesignTabOrigin(_asker, {
588
- api: "/api/val",
589
- own: window.location.origin
590
- }).then(/*#__PURE__*/function () {
591
- var _ref2 = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee(trusted) {
592
- var _t;
593
- return asyncToGenerator._regenerator().w(function (_context) {
594
- while (1) switch (_context.n) {
595
- case 0:
596
- if (trusted) {
597
- _context.n = 1;
598
- break;
599
- }
600
- return _context.a(2);
601
- case 1:
602
- _t = window.parent;
603
- _context.n = 2;
604
- return screenshotReply(message);
605
- case 2:
606
- _t.postMessage.call(_t, _context.v, _asker);
607
- case 3:
608
- return _context.a(2);
609
- }
610
- }, _callee);
611
- }));
612
- return function (_x) {
613
- return _ref2.apply(this, arguments);
614
- };
615
- }());
582
+ if (_asker !== window.location.origin) return;
583
+ void screenshotReply(message).then(function (reply) {
584
+ return window.parent.postMessage(reply, _asker);
585
+ });
616
586
  return;
617
587
  }
618
588
  if (message.type === "quickPreview") {
619
589
  // Code that will run on this address: only from the frame's parent,
620
- // and only when that is the site's design tab. See `quickPreview.ts`.
590
+ // and only when that is the Studio here. See `quickPreview.ts`.
621
591
  if (event.source !== window.parent) return;
622
592
  var id = message.id,
623
593
  files = message.files;
624
594
  var origin = event.origin;
625
- void asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee2() {
626
- var site, _t2;
627
- return asyncToGenerator._regenerator().w(function (_context2) {
628
- while (1) switch (_context2.p = _context2.n) {
595
+ void asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee() {
596
+ var _t;
597
+ return asyncToGenerator._regenerator().w(function (_context) {
598
+ while (1) switch (_context.p = _context.n) {
629
599
  case 0:
630
- _context2.p = 0;
631
- _context2.n = 1;
632
- return client.quickPreviewSiteOrigin("/api/val");
633
- case 1:
634
- site = _context2.v;
635
- if (!(site === null || site !== origin)) {
636
- _context2.n = 2;
600
+ _context.p = 0;
601
+ if (!(origin !== window.location.origin)) {
602
+ _context.n = 1;
637
603
  break;
638
604
  }
639
- throw new Error("Only the site's design tab can show a quick preview of this proposal.");
640
- case 2:
641
- _context2.n = 3;
605
+ throw new Error("Only this proposal's own Studio can show a quick preview of it.");
606
+ case 1:
607
+ _context.n = 2;
642
608
  return client.storeQuickPreview(id, files, {
643
609
  swUrl: "/api/val".concat(client.QUICK_PREVIEW_SERVICE_WORKER_PATH)
644
610
  });
645
- case 3:
611
+ case 2:
646
612
  post({
647
613
  val: client.VAL_CANVAS_MESSAGE,
648
614
  type: "quickPreviewStored",
649
615
  id: id
650
616
  });
651
- _context2.n = 5;
617
+ _context.n = 4;
652
618
  break;
653
- case 4:
654
- _context2.p = 4;
655
- _t2 = _context2.v;
619
+ case 3:
620
+ _context.p = 3;
621
+ _t = _context.v;
656
622
  post({
657
623
  val: client.VAL_CANVAS_MESSAGE,
658
624
  type: "quickPreviewStored",
659
625
  id: id,
660
- error: _t2 instanceof Error ? _t2.message : String(_t2)
626
+ error: _t instanceof Error ? _t.message : String(_t)
661
627
  });
662
- case 5:
663
- return _context2.a(2);
628
+ case 4:
629
+ return _context.a(2);
664
630
  }
665
- }, _callee2, null, [[0, 4]]);
631
+ }, _callee, null, [[0, 3]]);
666
632
  }))();
667
633
  return;
668
634
  }
@@ -728,7 +694,7 @@ function ValCanvasBridge(_ref) {
728
694
  };
729
695
  }, [scan, post]);
730
696
 
731
- // Where the page is, as it moves: the design tab opens a new build there.
697
+ // Where the page is, as it moves: a new build is opened there.
732
698
  React__default["default"].useEffect(function () {
733
699
  return client.watchPageLocation(window, function (location) {
734
700
  return post(_typeof._objectSpread2({
@@ -773,7 +739,7 @@ function ValCanvasBridge(_ref) {
773
739
  }, [post]);
774
740
 
775
741
  /**
776
- * Picking any element, for the design tab: the page's own elements, which
742
+ * Picking any element: the page's own elements, which
777
743
  * only this side of the frame can reach. The listeners and the outlines are
778
744
  * `startElementPicking`'s (`@valbuild/shared`), so both bindings run the
779
745
  * same picker; what crosses back is the element described.
@@ -1073,20 +1039,20 @@ function findByPath(path) {
1073
1039
  }
1074
1040
 
1075
1041
  /** What `screenshotPage` answers: the picture, or why it could not be taken. */
1076
- function screenshotReply(_x2) {
1042
+ function screenshotReply(_x) {
1077
1043
  return _screenshotReply.apply(this, arguments);
1078
1044
  }
1079
1045
  /** What `readPage` answers: the page read, or why it could not be. */
1080
1046
  function _screenshotReply() {
1081
- _screenshotReply = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee3(message) {
1082
- var _t3, _t4, _t5, _t6;
1083
- return asyncToGenerator._regenerator().w(function (_context3) {
1084
- while (1) switch (_context3.p = _context3.n) {
1047
+ _screenshotReply = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee2(message) {
1048
+ var _t2, _t3, _t4, _t5;
1049
+ return asyncToGenerator._regenerator().w(function (_context2) {
1050
+ while (1) switch (_context2.p = _context2.n) {
1085
1051
  case 0:
1086
- _context3.p = 0;
1087
- _t3 = client.VAL_CANVAS_MESSAGE;
1088
- _t4 = message.requestId;
1089
- _context3.n = 1;
1052
+ _context2.p = 0;
1053
+ _t2 = client.VAL_CANVAS_MESSAGE;
1054
+ _t3 = message.requestId;
1055
+ _context2.n = 1;
1090
1056
  return client.screenshotPage(window, _typeof._objectSpread2(_typeof._objectSpread2({}, message.fullPage !== undefined ? {
1091
1057
  fullPage: message.fullPage
1092
1058
  } : {}), {}, {
@@ -1096,25 +1062,25 @@ function _screenshotReply() {
1096
1062
  }
1097
1063
  }));
1098
1064
  case 1:
1099
- _t5 = _context3.v;
1100
- return _context3.a(2, {
1101
- val: _t3,
1065
+ _t4 = _context2.v;
1066
+ return _context2.a(2, {
1067
+ val: _t2,
1102
1068
  type: "pageScreenshot",
1103
- requestId: _t4,
1104
- screenshot: _t5
1069
+ requestId: _t3,
1070
+ screenshot: _t4
1105
1071
  });
1106
1072
  case 2:
1107
- _context3.p = 2;
1108
- _t6 = _context3.v;
1109
- return _context3.a(2, {
1073
+ _context2.p = 2;
1074
+ _t5 = _context2.v;
1075
+ return _context2.a(2, {
1110
1076
  val: client.VAL_CANVAS_MESSAGE,
1111
1077
  type: "pageScreenshot",
1112
1078
  requestId: message.requestId,
1113
1079
  screenshot: null,
1114
- error: _t6 instanceof Error ? _t6.message : String(_t6)
1080
+ error: _t5 instanceof Error ? _t5.message : String(_t5)
1115
1081
  });
1116
1082
  }
1117
- }, _callee3, null, [[0, 2]]);
1083
+ }, _callee2, null, [[0, 2]]);
1118
1084
  }));
1119
1085
  return _screenshotReply.apply(this, arguments);
1120
1086
  }
@@ -6,7 +6,7 @@ var asyncToGenerator = require('./asyncToGenerator-8e5c36c8.cjs.prod.js');
6
6
  var _typeof = require('./typeof-56656438.cjs.prod.js');
7
7
  var core = require('@valbuild/core');
8
8
  var stega = require('@valbuild/react/stega');
9
- var version = require('./version-96339a5a.cjs.prod.js');
9
+ var version = require('./version-ef9e858f.cjs.prod.js');
10
10
  var internal = require('@valbuild/react/internal');
11
11
  var ui = require('@valbuild/ui');
12
12
  var reactRouter = require('@tanstack/react-router');
@@ -306,8 +306,8 @@ function ValCanvasBridge(_ref) {
306
306
  var pickingRef = React__default["default"].useRef(false);
307
307
  pickingRef.current = picking;
308
308
  /**
309
- * Picking ANY element (the design tab's `pickElements`), as the studio last
310
- * said. `null` until it says, which is every studio but the design tab.
309
+ * Picking ANY element (`pickElements`), as the studio last said. `null`
310
+ * until it says.
311
311
  */
312
312
  var _React$useState7 = React__default["default"].useState(null),
313
313
  _React$useState8 = _typeof._slicedToArray(_React$useState7, 2),
@@ -555,114 +555,80 @@ function ValCanvasBridge(_ref) {
555
555
  }
556
556
  if (message.type === "scrollTo") {
557
557
  var _stopRestoring$curren2;
558
- // Where the build before this one was: the design tab swaps a new
559
- // build in at the same place.
558
+ // Where the build before this one was: a new build swapped in at the
559
+ // same place.
560
560
  (_stopRestoring$curren2 = stopRestoring.current) === null || _stopRestoring$curren2 === void 0 || _stopRestoring$curren2.call(stopRestoring);
561
561
  stopRestoring.current = client.restoreScroll(window, message.x, message.y);
562
562
  return;
563
563
  }
564
564
  if (message.type === "readPage") {
565
- // The assistant's `read_page`: what is on the page, read here because
566
- // the tab is another origin and cannot. The page's words, unpublished
567
- // ones included, so only for the frame's parent, and only when that
568
- // is the site's design tab or the Studio here -- and answered to it
569
- // alone, not to `*`.
565
+ // The assistant's `read_page`: what is on the page, read here, where
566
+ // the page's elements are. The page's words, unpublished ones
567
+ // included, so only for the frame's parent, and only when that is the
568
+ // Studio here, at this page's own origin -- and answered to it alone,
569
+ // not to `*`.
570
570
  if (event.source !== window.parent) return;
571
571
  var asker = event.origin;
572
- void client.isDesignTabOrigin(asker, {
573
- api: "/api/val",
574
- own: window.location.origin
575
- }).then(function (trusted) {
576
- if (trusted) window.parent.postMessage(readPageReply(message), asker);
577
- });
572
+ if (asker !== window.location.origin) return;
573
+ window.parent.postMessage(readPageReply(message), asker);
578
574
  return;
579
575
  }
580
576
  if (message.type === "screenshotPage") {
581
577
  // The assistant's `screenshot_page`: a picture of the page, drawn
582
- // here because the tab is another origin and cannot. As `readPage`:
583
- // only for the frame's parent, when that is the design tab or the
578
+ // here. As `readPage`: only for the frame's parent, when that is the
584
579
  // Studio here, and answered to it alone.
585
580
  if (event.source !== window.parent) return;
586
581
  var _asker = event.origin;
587
- void client.isDesignTabOrigin(_asker, {
588
- api: "/api/val",
589
- own: window.location.origin
590
- }).then(/*#__PURE__*/function () {
591
- var _ref2 = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee(trusted) {
592
- var _t;
593
- return asyncToGenerator._regenerator().w(function (_context) {
594
- while (1) switch (_context.n) {
595
- case 0:
596
- if (trusted) {
597
- _context.n = 1;
598
- break;
599
- }
600
- return _context.a(2);
601
- case 1:
602
- _t = window.parent;
603
- _context.n = 2;
604
- return screenshotReply(message);
605
- case 2:
606
- _t.postMessage.call(_t, _context.v, _asker);
607
- case 3:
608
- return _context.a(2);
609
- }
610
- }, _callee);
611
- }));
612
- return function (_x) {
613
- return _ref2.apply(this, arguments);
614
- };
615
- }());
582
+ if (_asker !== window.location.origin) return;
583
+ void screenshotReply(message).then(function (reply) {
584
+ return window.parent.postMessage(reply, _asker);
585
+ });
616
586
  return;
617
587
  }
618
588
  if (message.type === "quickPreview") {
619
589
  // Code that will run on this address: only from the frame's parent,
620
- // and only when that is the site's design tab. See `quickPreview.ts`.
590
+ // and only when that is the Studio here. See `quickPreview.ts`.
621
591
  if (event.source !== window.parent) return;
622
592
  var id = message.id,
623
593
  files = message.files;
624
594
  var origin = event.origin;
625
- void asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee2() {
626
- var site, _t2;
627
- return asyncToGenerator._regenerator().w(function (_context2) {
628
- while (1) switch (_context2.p = _context2.n) {
595
+ void asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee() {
596
+ var _t;
597
+ return asyncToGenerator._regenerator().w(function (_context) {
598
+ while (1) switch (_context.p = _context.n) {
629
599
  case 0:
630
- _context2.p = 0;
631
- _context2.n = 1;
632
- return client.quickPreviewSiteOrigin("/api/val");
633
- case 1:
634
- site = _context2.v;
635
- if (!(site === null || site !== origin)) {
636
- _context2.n = 2;
600
+ _context.p = 0;
601
+ if (!(origin !== window.location.origin)) {
602
+ _context.n = 1;
637
603
  break;
638
604
  }
639
- throw new Error("Only the site's design tab can show a quick preview of this proposal.");
640
- case 2:
641
- _context2.n = 3;
605
+ throw new Error("Only this proposal's own Studio can show a quick preview of it.");
606
+ case 1:
607
+ _context.n = 2;
642
608
  return client.storeQuickPreview(id, files, {
643
609
  swUrl: "/api/val".concat(client.QUICK_PREVIEW_SERVICE_WORKER_PATH)
644
610
  });
645
- case 3:
611
+ case 2:
646
612
  post({
647
613
  val: client.VAL_CANVAS_MESSAGE,
648
614
  type: "quickPreviewStored",
649
615
  id: id
650
616
  });
651
- _context2.n = 5;
617
+ _context.n = 4;
652
618
  break;
653
- case 4:
654
- _context2.p = 4;
655
- _t2 = _context2.v;
619
+ case 3:
620
+ _context.p = 3;
621
+ _t = _context.v;
656
622
  post({
657
623
  val: client.VAL_CANVAS_MESSAGE,
658
624
  type: "quickPreviewStored",
659
625
  id: id,
660
- error: _t2 instanceof Error ? _t2.message : String(_t2)
626
+ error: _t instanceof Error ? _t.message : String(_t)
661
627
  });
662
- case 5:
663
- return _context2.a(2);
628
+ case 4:
629
+ return _context.a(2);
664
630
  }
665
- }, _callee2, null, [[0, 4]]);
631
+ }, _callee, null, [[0, 3]]);
666
632
  }))();
667
633
  return;
668
634
  }
@@ -728,7 +694,7 @@ function ValCanvasBridge(_ref) {
728
694
  };
729
695
  }, [scan, post]);
730
696
 
731
- // Where the page is, as it moves: the design tab opens a new build there.
697
+ // Where the page is, as it moves: a new build is opened there.
732
698
  React__default["default"].useEffect(function () {
733
699
  return client.watchPageLocation(window, function (location) {
734
700
  return post(_typeof._objectSpread2({
@@ -773,7 +739,7 @@ function ValCanvasBridge(_ref) {
773
739
  }, [post]);
774
740
 
775
741
  /**
776
- * Picking any element, for the design tab: the page's own elements, which
742
+ * Picking any element: the page's own elements, which
777
743
  * only this side of the frame can reach. The listeners and the outlines are
778
744
  * `startElementPicking`'s (`@valbuild/shared`), so both bindings run the
779
745
  * same picker; what crosses back is the element described.
@@ -1073,20 +1039,20 @@ function findByPath(path) {
1073
1039
  }
1074
1040
 
1075
1041
  /** What `screenshotPage` answers: the picture, or why it could not be taken. */
1076
- function screenshotReply(_x2) {
1042
+ function screenshotReply(_x) {
1077
1043
  return _screenshotReply.apply(this, arguments);
1078
1044
  }
1079
1045
  /** What `readPage` answers: the page read, or why it could not be. */
1080
1046
  function _screenshotReply() {
1081
- _screenshotReply = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee3(message) {
1082
- var _t3, _t4, _t5, _t6;
1083
- return asyncToGenerator._regenerator().w(function (_context3) {
1084
- while (1) switch (_context3.p = _context3.n) {
1047
+ _screenshotReply = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee2(message) {
1048
+ var _t2, _t3, _t4, _t5;
1049
+ return asyncToGenerator._regenerator().w(function (_context2) {
1050
+ while (1) switch (_context2.p = _context2.n) {
1085
1051
  case 0:
1086
- _context3.p = 0;
1087
- _t3 = client.VAL_CANVAS_MESSAGE;
1088
- _t4 = message.requestId;
1089
- _context3.n = 1;
1052
+ _context2.p = 0;
1053
+ _t2 = client.VAL_CANVAS_MESSAGE;
1054
+ _t3 = message.requestId;
1055
+ _context2.n = 1;
1090
1056
  return client.screenshotPage(window, _typeof._objectSpread2(_typeof._objectSpread2({}, message.fullPage !== undefined ? {
1091
1057
  fullPage: message.fullPage
1092
1058
  } : {}), {}, {
@@ -1096,25 +1062,25 @@ function _screenshotReply() {
1096
1062
  }
1097
1063
  }));
1098
1064
  case 1:
1099
- _t5 = _context3.v;
1100
- return _context3.a(2, {
1101
- val: _t3,
1065
+ _t4 = _context2.v;
1066
+ return _context2.a(2, {
1067
+ val: _t2,
1102
1068
  type: "pageScreenshot",
1103
- requestId: _t4,
1104
- screenshot: _t5
1069
+ requestId: _t3,
1070
+ screenshot: _t4
1105
1071
  });
1106
1072
  case 2:
1107
- _context3.p = 2;
1108
- _t6 = _context3.v;
1109
- return _context3.a(2, {
1073
+ _context2.p = 2;
1074
+ _t5 = _context2.v;
1075
+ return _context2.a(2, {
1110
1076
  val: client.VAL_CANVAS_MESSAGE,
1111
1077
  type: "pageScreenshot",
1112
1078
  requestId: message.requestId,
1113
1079
  screenshot: null,
1114
- error: _t6 instanceof Error ? _t6.message : String(_t6)
1080
+ error: _t5 instanceof Error ? _t5.message : String(_t5)
1115
1081
  });
1116
1082
  }
1117
- }, _callee3, null, [[0, 2]]);
1083
+ }, _callee2, null, [[0, 2]]);
1118
1084
  }));
1119
1085
  return _screenshotReply.apply(this, arguments);
1120
1086
  }
@@ -5,14 +5,14 @@ import * as core from '@valbuild/core';
5
5
  export { core as expr };
6
6
  export { GenericSelector, Schema, VAL_EXTENSION, derefPatch, modules } from '@valbuild/core';
7
7
  import { stegaEncode, stegaDecodeStrings, attrs, raw, isReactDevelopmentBuild, watchStegaLeaks, stegaLeakMessage, SET_AUTO_TAG_JSX_ENABLED, autoTagJSX } from '@valbuild/react/stega';
8
- import { r as readValEnableCookie, V as VERSION$1 } from './version-f05a8296.esm.js';
8
+ import { r as readValEnableCookie, V as VERSION$1 } from './version-8892838b.esm.js';
9
9
  import { isDraft, createDraftStore, draftHolds, draftHoldsVersions, startRefreshLoop, applyValEvent } from '@valbuild/react/internal';
10
10
  export { ValRichText } from '@valbuild/react/internal';
11
11
  import { VERSION, VAL_APP_PATH, VAL_OVERLAY_ID, VAL_APP_ID } from '@valbuild/ui';
12
12
  import { useRouter, useRouterState } from '@tanstack/react-router';
13
13
  import React, { useEffect, useRef, useState } from 'react';
14
14
  import { V as ValOverlayProvider } from './ValOverlayContext-6826b4d9.esm.js';
15
- import { VAL_CONFIG_SESSION_STORAGE_KEY, VAL_THEME_SESSION_STORAGE_KEY, VAL_CANVAS_MESSAGE, watchPageLocation, startElementPicking, DEFAULT_CANVAS_SELECTION, DEFAULT_CANVAS_SELECTION_SOFT, isValCanvasStudioMessage, restoreScroll, isDesignTabOrigin, storeQuickPreview, QUICK_PREVIEW_SERVICE_WORKER_PATH, quickPreviewSiteOrigin, readPageSnapshot, screenshotPage, isValCanvasFrame } from '@valbuild/shared/client';
15
+ import { VAL_CONFIG_SESSION_STORAGE_KEY, VAL_THEME_SESSION_STORAGE_KEY, VAL_CANVAS_MESSAGE, watchPageLocation, startElementPicking, DEFAULT_CANVAS_SELECTION, DEFAULT_CANVAS_SELECTION_SOFT, isValCanvasStudioMessage, restoreScroll, storeQuickPreview, QUICK_PREVIEW_SERVICE_WORKER_PATH, screenshotPage, readPageSnapshot, isValCanvasFrame } from '@valbuild/shared/client';
16
16
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
17
17
  import { D as DEMO_CLAIM_MESSAGE, a as DEMO_SERVICE_WORKER_PATH, b as DEMO_RELAY_MESSAGE } from './demoServiceWorker-56fd96cf.esm.js';
18
18
 
@@ -283,8 +283,8 @@ function ValCanvasBridge(_ref) {
283
283
  var pickingRef = React.useRef(false);
284
284
  pickingRef.current = picking;
285
285
  /**
286
- * Picking ANY element (the design tab's `pickElements`), as the studio last
287
- * said. `null` until it says, which is every studio but the design tab.
286
+ * Picking ANY element (`pickElements`), as the studio last said. `null`
287
+ * until it says.
288
288
  */
289
289
  var _React$useState7 = React.useState(null),
290
290
  _React$useState8 = _slicedToArray(_React$useState7, 2),
@@ -532,114 +532,80 @@ function ValCanvasBridge(_ref) {
532
532
  }
533
533
  if (message.type === "scrollTo") {
534
534
  var _stopRestoring$curren2;
535
- // Where the build before this one was: the design tab swaps a new
536
- // build in at the same place.
535
+ // Where the build before this one was: a new build swapped in at the
536
+ // same place.
537
537
  (_stopRestoring$curren2 = stopRestoring.current) === null || _stopRestoring$curren2 === void 0 || _stopRestoring$curren2.call(stopRestoring);
538
538
  stopRestoring.current = restoreScroll(window, message.x, message.y);
539
539
  return;
540
540
  }
541
541
  if (message.type === "readPage") {
542
- // The assistant's `read_page`: what is on the page, read here because
543
- // the tab is another origin and cannot. The page's words, unpublished
544
- // ones included, so only for the frame's parent, and only when that
545
- // is the site's design tab or the Studio here -- and answered to it
546
- // alone, not to `*`.
542
+ // The assistant's `read_page`: what is on the page, read here, where
543
+ // the page's elements are. The page's words, unpublished ones
544
+ // included, so only for the frame's parent, and only when that is the
545
+ // Studio here, at this page's own origin -- and answered to it alone,
546
+ // not to `*`.
547
547
  if (event.source !== window.parent) return;
548
548
  var asker = event.origin;
549
- void isDesignTabOrigin(asker, {
550
- api: "/api/val",
551
- own: window.location.origin
552
- }).then(function (trusted) {
553
- if (trusted) window.parent.postMessage(readPageReply(message), asker);
554
- });
549
+ if (asker !== window.location.origin) return;
550
+ window.parent.postMessage(readPageReply(message), asker);
555
551
  return;
556
552
  }
557
553
  if (message.type === "screenshotPage") {
558
554
  // The assistant's `screenshot_page`: a picture of the page, drawn
559
- // here because the tab is another origin and cannot. As `readPage`:
560
- // only for the frame's parent, when that is the design tab or the
555
+ // here. As `readPage`: only for the frame's parent, when that is the
561
556
  // Studio here, and answered to it alone.
562
557
  if (event.source !== window.parent) return;
563
558
  var _asker = event.origin;
564
- void isDesignTabOrigin(_asker, {
565
- api: "/api/val",
566
- own: window.location.origin
567
- }).then(/*#__PURE__*/function () {
568
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(trusted) {
569
- var _t;
570
- return _regenerator().w(function (_context) {
571
- while (1) switch (_context.n) {
572
- case 0:
573
- if (trusted) {
574
- _context.n = 1;
575
- break;
576
- }
577
- return _context.a(2);
578
- case 1:
579
- _t = window.parent;
580
- _context.n = 2;
581
- return screenshotReply(message);
582
- case 2:
583
- _t.postMessage.call(_t, _context.v, _asker);
584
- case 3:
585
- return _context.a(2);
586
- }
587
- }, _callee);
588
- }));
589
- return function (_x) {
590
- return _ref2.apply(this, arguments);
591
- };
592
- }());
559
+ if (_asker !== window.location.origin) return;
560
+ void screenshotReply(message).then(function (reply) {
561
+ return window.parent.postMessage(reply, _asker);
562
+ });
593
563
  return;
594
564
  }
595
565
  if (message.type === "quickPreview") {
596
566
  // Code that will run on this address: only from the frame's parent,
597
- // and only when that is the site's design tab. See `quickPreview.ts`.
567
+ // and only when that is the Studio here. See `quickPreview.ts`.
598
568
  if (event.source !== window.parent) return;
599
569
  var id = message.id,
600
570
  files = message.files;
601
571
  var origin = event.origin;
602
- void _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
603
- var site, _t2;
604
- return _regenerator().w(function (_context2) {
605
- while (1) switch (_context2.p = _context2.n) {
572
+ void _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
573
+ var _t;
574
+ return _regenerator().w(function (_context) {
575
+ while (1) switch (_context.p = _context.n) {
606
576
  case 0:
607
- _context2.p = 0;
608
- _context2.n = 1;
609
- return quickPreviewSiteOrigin("/api/val");
610
- case 1:
611
- site = _context2.v;
612
- if (!(site === null || site !== origin)) {
613
- _context2.n = 2;
577
+ _context.p = 0;
578
+ if (!(origin !== window.location.origin)) {
579
+ _context.n = 1;
614
580
  break;
615
581
  }
616
- throw new Error("Only the site's design tab can show a quick preview of this proposal.");
617
- case 2:
618
- _context2.n = 3;
582
+ throw new Error("Only this proposal's own Studio can show a quick preview of it.");
583
+ case 1:
584
+ _context.n = 2;
619
585
  return storeQuickPreview(id, files, {
620
586
  swUrl: "/api/val".concat(QUICK_PREVIEW_SERVICE_WORKER_PATH)
621
587
  });
622
- case 3:
588
+ case 2:
623
589
  post({
624
590
  val: VAL_CANVAS_MESSAGE,
625
591
  type: "quickPreviewStored",
626
592
  id: id
627
593
  });
628
- _context2.n = 5;
594
+ _context.n = 4;
629
595
  break;
630
- case 4:
631
- _context2.p = 4;
632
- _t2 = _context2.v;
596
+ case 3:
597
+ _context.p = 3;
598
+ _t = _context.v;
633
599
  post({
634
600
  val: VAL_CANVAS_MESSAGE,
635
601
  type: "quickPreviewStored",
636
602
  id: id,
637
- error: _t2 instanceof Error ? _t2.message : String(_t2)
603
+ error: _t instanceof Error ? _t.message : String(_t)
638
604
  });
639
- case 5:
640
- return _context2.a(2);
605
+ case 4:
606
+ return _context.a(2);
641
607
  }
642
- }, _callee2, null, [[0, 4]]);
608
+ }, _callee, null, [[0, 3]]);
643
609
  }))();
644
610
  return;
645
611
  }
@@ -705,7 +671,7 @@ function ValCanvasBridge(_ref) {
705
671
  };
706
672
  }, [scan, post]);
707
673
 
708
- // Where the page is, as it moves: the design tab opens a new build there.
674
+ // Where the page is, as it moves: a new build is opened there.
709
675
  React.useEffect(function () {
710
676
  return watchPageLocation(window, function (location) {
711
677
  return post(_objectSpread2({
@@ -750,7 +716,7 @@ function ValCanvasBridge(_ref) {
750
716
  }, [post]);
751
717
 
752
718
  /**
753
- * Picking any element, for the design tab: the page's own elements, which
719
+ * Picking any element: the page's own elements, which
754
720
  * only this side of the frame can reach. The listeners and the outlines are
755
721
  * `startElementPicking`'s (`@valbuild/shared`), so both bindings run the
756
722
  * same picker; what crosses back is the element described.
@@ -1050,20 +1016,20 @@ function findByPath(path) {
1050
1016
  }
1051
1017
 
1052
1018
  /** What `screenshotPage` answers: the picture, or why it could not be taken. */
1053
- function screenshotReply(_x2) {
1019
+ function screenshotReply(_x) {
1054
1020
  return _screenshotReply.apply(this, arguments);
1055
1021
  }
1056
1022
  /** What `readPage` answers: the page read, or why it could not be. */
1057
1023
  function _screenshotReply() {
1058
- _screenshotReply = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(message) {
1059
- var _t3, _t4, _t5, _t6;
1060
- return _regenerator().w(function (_context3) {
1061
- while (1) switch (_context3.p = _context3.n) {
1024
+ _screenshotReply = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(message) {
1025
+ var _t2, _t3, _t4, _t5;
1026
+ return _regenerator().w(function (_context2) {
1027
+ while (1) switch (_context2.p = _context2.n) {
1062
1028
  case 0:
1063
- _context3.p = 0;
1064
- _t3 = VAL_CANVAS_MESSAGE;
1065
- _t4 = message.requestId;
1066
- _context3.n = 1;
1029
+ _context2.p = 0;
1030
+ _t2 = VAL_CANVAS_MESSAGE;
1031
+ _t3 = message.requestId;
1032
+ _context2.n = 1;
1067
1033
  return screenshotPage(window, _objectSpread2(_objectSpread2({}, message.fullPage !== undefined ? {
1068
1034
  fullPage: message.fullPage
1069
1035
  } : {}), {}, {
@@ -1073,25 +1039,25 @@ function _screenshotReply() {
1073
1039
  }
1074
1040
  }));
1075
1041
  case 1:
1076
- _t5 = _context3.v;
1077
- return _context3.a(2, {
1078
- val: _t3,
1042
+ _t4 = _context2.v;
1043
+ return _context2.a(2, {
1044
+ val: _t2,
1079
1045
  type: "pageScreenshot",
1080
- requestId: _t4,
1081
- screenshot: _t5
1046
+ requestId: _t3,
1047
+ screenshot: _t4
1082
1048
  });
1083
1049
  case 2:
1084
- _context3.p = 2;
1085
- _t6 = _context3.v;
1086
- return _context3.a(2, {
1050
+ _context2.p = 2;
1051
+ _t5 = _context2.v;
1052
+ return _context2.a(2, {
1087
1053
  val: VAL_CANVAS_MESSAGE,
1088
1054
  type: "pageScreenshot",
1089
1055
  requestId: message.requestId,
1090
1056
  screenshot: null,
1091
- error: _t6 instanceof Error ? _t6.message : String(_t6)
1057
+ error: _t5 instanceof Error ? _t5.message : String(_t5)
1092
1058
  });
1093
1059
  }
1094
- }, _callee3, null, [[0, 2]]);
1060
+ }, _callee2, null, [[0, 2]]);
1095
1061
  }));
1096
1062
  return _screenshotReply.apply(this, arguments);
1097
1063
  }
@@ -76,7 +76,7 @@ var packageJson = {
76
76
  "tanstack-router",
77
77
  "react"
78
78
  ],
79
- version: "0.152.0",
79
+ version: "0.152.2",
80
80
  scripts: {
81
81
  typecheck: "tsc --noEmit",
82
82
  test: "jest"
@@ -78,7 +78,7 @@ var packageJson = {
78
78
  "tanstack-router",
79
79
  "react"
80
80
  ],
81
- version: "0.152.0",
81
+ version: "0.152.2",
82
82
  scripts: {
83
83
  typecheck: "tsc --noEmit",
84
84
  test: "jest"
@@ -78,7 +78,7 @@ var packageJson = {
78
78
  "tanstack-router",
79
79
  "react"
80
80
  ],
81
- version: "0.152.0",
81
+ version: "0.152.2",
82
82
  scripts: {
83
83
  typecheck: "tsc --noEmit",
84
84
  test: "jest"
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "tanstack-router",
15
15
  "react"
16
16
  ],
17
- "version": "0.152.0",
17
+ "version": "0.152.2",
18
18
  "main": "dist/valbuild-tanstack.cjs.js",
19
19
  "module": "dist/valbuild-tanstack.esm.js",
20
20
  "exports": {
@@ -52,13 +52,13 @@
52
52
  "exports": true
53
53
  },
54
54
  "dependencies": {
55
+ "@valbuild/language-server": "0.152.2",
55
56
  "@valbuild/core": "0.151.0",
56
- "@valbuild/language-server": "0.152.0",
57
- "@valbuild/mcp": "0.152.0",
58
- "@valbuild/react": "0.152.0",
59
- "@valbuild/server": "0.152.0",
60
- "@valbuild/shared": "0.152.0",
61
- "@valbuild/ui": "0.152.0"
57
+ "@valbuild/mcp": "0.152.2",
58
+ "@valbuild/react": "0.152.2",
59
+ "@valbuild/server": "0.152.2",
60
+ "@valbuild/ui": "0.152.2",
61
+ "@valbuild/shared": "0.152.1"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@tanstack/react-router": "^1.170.41",
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = require('../../dist/version-c27a565d.cjs.dev.js');
5
+ var version = require('../../dist/version-9879acd5.cjs.dev.js');
6
6
  var asyncToGenerator = require('../../dist/asyncToGenerator-c3823d62.cjs.dev.js');
7
7
  var core = require('@valbuild/core');
8
8
  var _typeof = require('../../dist/typeof-bd6ec82c.cjs.dev.js');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = require('../../dist/version-96339a5a.cjs.prod.js');
5
+ var version = require('../../dist/version-ef9e858f.cjs.prod.js');
6
6
  var asyncToGenerator = require('../../dist/asyncToGenerator-8e5c36c8.cjs.prod.js');
7
7
  var core = require('@valbuild/core');
8
8
  var _typeof = require('../../dist/typeof-56656438.cjs.prod.js');
@@ -1,4 +1,4 @@
1
- import { V as VERSION, s as setValEnableCookieReader } from '../../dist/version-f05a8296.esm.js';
1
+ import { V as VERSION, s as setValEnableCookieReader } from '../../dist/version-8892838b.esm.js';
2
2
  import { _ as _asyncToGenerator, a as _regenerator } from '../../dist/asyncToGenerator-500f022f.esm.js';
3
3
  import { Internal } from '@valbuild/core';
4
4
  import { _ as _objectSpread2, a as _slicedToArray } from '../../dist/typeof-3e1a1d11.esm.js';