@justai/cuts 0.33.0 → 0.34.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justai/cuts",
3
- "version": "0.33.0",
3
+ "version": "0.34.0",
4
4
  "description": "A persona's named parts \u2014 the page shell that holds them, and the cuts themselves.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -31,7 +31,7 @@
31
31
  "access": "public"
32
32
  },
33
33
  "dependencies": {
34
- "@justai/core": "^0.5.0",
34
+ "@justai/core": "^0.6.0",
35
35
  "@justai/ui": "^0.3.0",
36
36
  "@justai/atrium": "^0.1.9"
37
37
  }
@@ -93,6 +93,7 @@ const { id, title = "Choose a file", src = "/files" } = Astro.props;
93
93
  // two kernels at once would otherwise have both arrive calling themselves "files", and the second
94
94
  // would silently take the first one's place.
95
95
  import atrium from "@justai/atrium";
96
+ import { PRESENTATION_PARAM, PRESENTATION_EMBEDDED } from "@justai/core";
96
97
 
97
98
  interface Picked {
98
99
  path: string;
@@ -147,7 +148,15 @@ const { id, title = "Choose a file", src = "/files" } = Astro.props;
147
148
 
148
149
  async function pick(req: PickRequest = {}): Promise<Picked | null> {
149
150
  const bus = await router();
150
- if (!frame.getAttribute("src")) frame.setAttribute("src", root.dataset.src!);
151
+ if (!frame.getAttribute("src")) {
152
+ // DECLARE THE PRESENTATION. A page opened by a person and a page opened by another persona
153
+ // are two different situations, and the same controls do not belong in both — standalone
154
+ // there is nothing to cancel. The frame is the slower truth (a handshake takes a beat), so
155
+ // the declaration rides in the URL and is available in the first paint. It is presentation
156
+ // only: nothing that must not be forged is decided by it.
157
+ const src = root.dataset.src!;
158
+ frame.setAttribute("src", src + (src.includes("?") ? "&" : "?") + PRESENTATION_PARAM + "=" + PRESENTATION_EMBEDDED);
159
+ }
151
160
  // ONE HEADING, and it is the sheet's. A per-call title retitles the sheet rather than being
152
161
  // forwarded into the frame: the kernel renders a heading of its own for callers that have no
153
162
  // sheet around them, and sending it one here printed "Upload logo" twice, one under the other.