@descix/frqtl-web 0.7.0-p2 → 0.7.0-p3

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.
@@ -0,0 +1,176 @@
1
+ /* Copyright 2023-2026 by Essam Abadir */
2
+
3
+ /**
4
+ * host-auth.js — the ONE follower of the DeSciX shell's session for an app DOCUMENT.
5
+ *
6
+ * Behind the DeSciX App Shell, `DeSciX.powch.on('auth', cb)` calls `cb` once at once with the current state and then
7
+ * on every change, with `{ signedIn: boolean, address: string|null }`; it returns the unsubscribe
8
+ * (@descix/app-sdk 0.8.0 APP_SHELL_API.md §"DeSciX.powch — identity and wallet"). `DeSciX.powch.login()` opens Powch;
9
+ * on success the SHELL routes itself, so the app never redirects. This module follows that session for a caller and
10
+ * records which host state it met on `document.documentElement.dataset.descixAuth` (a HOST_AUTH_STATES row). The
11
+ * control that shows it, and where, is the call site's policy (lib/features/ide/sign-in.js).
12
+ *
13
+ * Order of operations, from the published contract:
14
+ * - `powch` is read only after `ready()` resolved `mode:'shell'` AND its `members` names `powch` (the SDK's member
15
+ * getters console.error where the member is absent — the same rule lib/shim/host/host-view.js follows for `view`).
16
+ * - `powch` is read off the bus at the point of use (the bus object is replaced when the shell reaches READY), so
17
+ * `login` is looked up at the tap, never captured at load.
18
+ *
19
+ * A host with no session to follow is a STATE (no SDK, no shell, a shell without Powch), never an error. A host that
20
+ * breaks the published shape is a defect: it THROWS a TypeError naming the contract, and the record says
21
+ * `contract-violated`.
22
+ *
23
+ * Host-neutral ESM with no imports. It is NOT part of the stable host-view entry (that bundle carries host-view.js
24
+ * and device.js only).
25
+ */
26
+
27
+ /** Where the bridge calls this module relies on are published. */
28
+ export const HOST_AUTH_CONTRACT = '@descix/app-sdk 0.8.0 APP_SHELL_API.md §"DeSciX.powch — identity and wallet"';
29
+
30
+ /** The closed table of host session states. `session` is true where the shell holds a session the app can show. */
31
+ export const HOST_AUTH_STATES = Object.freeze([
32
+ { id: 'pending', session: false, means: 'awaiting DeSciX.ready()' },
33
+ { id: 'sdk-absent', session: false, means: 'window.DeSciX is undefined: no publisher-provided DeSciXAppSDK.js beside this page (dev, a plain static host)' },
34
+ { id: 'unmanaged', session: false, means: 'ready() resolved standalone or embedded-no-bridge: no readable shell above this page, nothing to sign into' },
35
+ { id: 'powch-unpublished', session: false, means: 'the shell resolved, but its members do not include powch' },
36
+ { id: 'signed-out', session: true, means: 'powch.on(auth) reported signedIn false' },
37
+ { id: 'signed-in', session: true, means: 'powch.on(auth) reported signedIn true' },
38
+ { id: 'contract-violated', session: false, means: 'the SDK or shell broke the published shape; the edge is in dataset.descixAuthDetail and a TypeError was thrown' },
39
+ ].map(Object.freeze));
40
+
41
+ const STATE_IDS = new Set(HOST_AUTH_STATES.map((r) => r.id));
42
+
43
+ function defaultRoot() {
44
+ return typeof document !== 'undefined' ? document.documentElement : null;
45
+ }
46
+
47
+ function record(root, id, detail) {
48
+ if (!STATE_IDS.has(id)) { throw new Error(`host-auth: '${id}' is not a HOST_AUTH_STATES row`); }
49
+ if (root) {
50
+ root.dataset.descixAuth = id;
51
+ if (detail === undefined) { delete root.dataset.descixAuthDetail; } else { root.dataset.descixAuthDetail = detail; }
52
+ }
53
+ return id;
54
+ }
55
+
56
+ function violation(root, edge) {
57
+ record(root, 'contract-violated', edge);
58
+ return new TypeError(`host-auth: ${edge} — the published contract is ${HOST_AUTH_CONTRACT}. (FAIL-LOUD.)`);
59
+ }
60
+
61
+ function liveMode(sdk) {
62
+ try { return sdk.mode; } catch (e) { return undefined; }
63
+ }
64
+
65
+ /** The auth payload, checked against the published shape. */
66
+ function sessionOf(s) {
67
+ if (!s || typeof s !== 'object' || typeof s.signedIn !== 'boolean') {
68
+ return { edge: 'powch.on(auth) delivered ' + JSON.stringify(s) + ', not { signedIn: boolean, address: string|null }' };
69
+ }
70
+ if (!(s.address === null || typeof s.address === 'string')) {
71
+ return { edge: 'powch.on(auth) delivered address ' + JSON.stringify(s.address) + ', not a string or null' };
72
+ }
73
+ return { signedIn: s.signedIn, address: s.address };
74
+ }
75
+
76
+ /**
77
+ * Follow the shell's session. `onState(id, session)` runs on every state change (`session` is
78
+ * `{ signedIn, address }` for the two session rows, else null).
79
+ *
80
+ * @param {object} args
81
+ * @param {object|undefined} args.sdk the app-side SDK object (`window.DeSciX`), or undefined
82
+ * @param {function(string, ?{signedIn: boolean, address: ?string}): void} args.onState
83
+ * @param {{dataset: object}} [args.root] where the record is written; defaults to `document.documentElement`
84
+ * @returns {{ stop: function(): void, settled: Promise<string> }} `stop` unsubscribes (idempotent; safe before
85
+ * ready() settles); `settled` resolves once the subscription is made (with the state the shell's immediate callback
86
+ * reported, else 'pending', or the non-session row met), and REJECTS with the TypeError on a contract violation.
87
+ */
88
+ export function followHostAuth({ sdk, onState, root } = {}) {
89
+ if (typeof onState !== 'function') { throw new TypeError('host-auth: followHostAuth needs an onState(id, session) function'); }
90
+ const target = root || defaultRoot();
91
+ let stopped = false;
92
+ let off = null;
93
+ const emit = (id, session = null, detail) => { if (!stopped) { onState(record(target, id, detail), session); } };
94
+ const stop = () => {
95
+ if (stopped) { return; }
96
+ stopped = true;
97
+ if (off) { const f = off; off = null; f(); }
98
+ };
99
+
100
+ if (sdk === undefined || sdk === null) {
101
+ emit('sdk-absent');
102
+ return { stop, settled: Promise.resolve('sdk-absent') };
103
+ }
104
+ if (typeof sdk.ready !== 'function') {
105
+ const err = violation(target, 'window.DeSciX is a ' + typeof sdk + ' without ready()');
106
+ return { stop, settled: Promise.reject(err) };
107
+ }
108
+
109
+ emit('pending');
110
+ const settled = (async () => {
111
+ let ready;
112
+ try {
113
+ ready = await sdk.ready();
114
+ } catch (e) {
115
+ if (liveMode(sdk) === 'embedded-no-bridge') { emit('unmanaged', null, 'ready() rejected: ' + (e && e.message)); return 'unmanaged'; }
116
+ throw violation(target, 'ready() rejected while the SDK reports mode ' + JSON.stringify(liveMode(sdk)) + ': ' + (e && e.message));
117
+ }
118
+ const mode = ready && ready.mode;
119
+ if (mode === 'standalone' || mode === 'embedded-no-bridge') { emit('unmanaged', null, 'ready() resolved ' + mode); return 'unmanaged'; }
120
+ if (mode !== 'shell') { throw violation(target, 'ready() resolved mode ' + JSON.stringify(mode)); }
121
+ if (!Array.isArray(ready.members)) { throw violation(target, 'ready() resolved shell without a members array'); }
122
+ if (!ready.members.includes('powch')) {
123
+ emit('powch-unpublished', null, 'members: ' + ready.members.join(','));
124
+ return 'powch-unpublished';
125
+ }
126
+ if (stopped) { return 'pending'; }
127
+ const powch = sdk.powch;
128
+ if (!powch) { throw violation(target, 'members names powch; the getter returned ' + String(powch)); }
129
+ if (typeof powch.on !== 'function') { throw violation(target, 'powch.on is ' + typeof powch.on); }
130
+
131
+ let fault = null;
132
+ let first = null;
133
+ const cb = (s) => {
134
+ const got = sessionOf(s);
135
+ if (got.edge) {
136
+ // The shell logs a throwing subscriber and keeps the others running (the published contract).
137
+ fault = violation(target, got.edge);
138
+ if (off) { const f = off; off = null; f(); }
139
+ if (!stopped) { onState('contract-violated', null); }
140
+ throw fault;
141
+ }
142
+ const id = got.signedIn ? 'signed-in' : 'signed-out';
143
+ if (first === null) { first = id; }
144
+ emit(id, got);
145
+ };
146
+ let unsubscribe;
147
+ try {
148
+ unsubscribe = powch.on('auth', cb);
149
+ } catch (e) {
150
+ if (fault) { throw fault; }
151
+ throw violation(target, 'powch.on(auth) threw: ' + (e && e.message));
152
+ }
153
+ if (typeof unsubscribe !== 'function') { throw violation(target, 'powch.on(auth) returned ' + typeof unsubscribe + ', not the unsubscribe function'); }
154
+ off = unsubscribe;
155
+ if (fault) { const f = off; off = null; f(); throw fault; }
156
+ if (stopped) { const f = off; off = null; f(); }
157
+ // The first state is whatever the shell's immediate callback reported; 'pending' until it arrives.
158
+ return first || 'pending';
159
+ })();
160
+ return { stop, settled };
161
+ }
162
+
163
+ /**
164
+ * Open Powch's sign-in through the shell. `powch` and its `login` are read HERE, at the tap.
165
+ * @param {object} sdk the app-side SDK object (`window.DeSciX`)
166
+ * @returns {Promise<unknown>} what `powch.login()` returns
167
+ * @throws {TypeError} a shell without a powch.login function (the control is only shown on a session row)
168
+ */
169
+ export function hostSignIn(sdk) {
170
+ const powch = sdk && sdk.powch;
171
+ if (!powch || typeof powch.login !== 'function') {
172
+ throw new TypeError('host-auth: hostSignIn found no DeSciX.powch.login function at the tap — the published ' +
173
+ 'contract is ' + HOST_AUTH_CONTRACT + '. (FAIL-LOUD.)');
174
+ }
175
+ return powch.login();
176
+ }
@@ -8,10 +8,13 @@
8
8
  * its error copy.
9
9
  *
10
10
  * STUDIO_LANDING_ATTR the <html> attribute carrying the outcome id
11
- * STUDIO_LANDING_OUTCOMES the closed table: one row per branch of STUDIO's link resolution, `{ id, runs, means }`;
12
- * `runs` says whether the scene that landing opens starts on load (through STUDIO's Run
13
- * control's own path) — true only on `ok`, a deep link that named a scene; every other
14
- * landing opens its scene in Design, waiting for Run
11
+ * STUDIO_LANDING_OUTCOMES the closed table: one row per branch of STUDIO's link resolution, `{ id, runs, cards,
12
+ * means }`; `runs` says whether the scene that landing opens starts on load (through
13
+ * STUDIO's Run control's own path) — true only on `ok`, a deep link that named a scene;
14
+ * every other landing opens its scene in Design, waiting for Run. `cards` says whether
15
+ * the landing offers the showcase cards (and the try-it) of the roster scene it opens —
16
+ * true on `ok` and on `first-contact`, so a bare STUDIO open offers what that scene's
17
+ * deep link offers; a landing that opens no roster scene offers none
15
18
  * recordStudioLanding(root, id) writes `id` on `root` (an Element, or null to only validate); an id outside the
16
19
  * table THROWS — that is a defect in the writer, never a landing
17
20
  *
@@ -32,31 +35,31 @@ export const STUDIO_LANDING_ATTR = 'data-frqtl-studio-landing';
32
35
 
33
36
  /** The closed table of STUDIO deep-link landings, in the order the resolver tests them (lib/features/ide/test/studio-landing-of.test.mjs holds it). */
34
37
  export const STUDIO_LANDING_OUTCOMES = Object.freeze([
35
- { id: 'refused-key', runs: false,
38
+ { id: 'refused-key', runs: false, cards: false,
36
39
  means: 'the link carries a key STUDIO does not own, or a deleted key (deep-link.js deepLinkRefusalOf): the refusal is on the deep-link strip and the opening scene opens' },
37
- { id: 'conflict', runs: false,
40
+ { id: 'conflict', runs: false, cards: false,
38
41
  means: 'the link names more than one scene source (two of walkthrough, project and scene), or a renderer beside a walkthrough or a project, which carry their own: nothing opens' },
39
- { id: 'mode-without-walkthrough', runs: false,
42
+ { id: 'mode-without-walkthrough', runs: false, cards: false,
40
43
  means: 'the link names a mode and no walkthrough: nothing opens' },
41
- { id: 'renderer-without-scene', runs: false,
44
+ { id: 'renderer-without-scene', runs: false, cards: false,
42
45
  means: 'the link names a renderer and no scene; a renderer is chosen only for a scene link: nothing opens' },
43
- { id: 'unknown-walkthrough', runs: false,
46
+ { id: 'unknown-walkthrough', runs: false, cards: false,
44
47
  means: 'the linked walkthrough is not a scene of the loaded roster (walkthroughById(roster, id)): nothing opens' },
45
- { id: 'unknown-mode', runs: false,
48
+ { id: 'unknown-mode', runs: false, cards: false,
46
49
  means: 'the linked mode is not one the linked scene declares (walkthroughModes): nothing opens' },
47
- { id: 'scene-refused-origin', runs: false,
50
+ { id: 'scene-refused-origin', runs: false, cards: false,
48
51
  means: 'the linked scene URL is on neither the page\'s origin nor the roster\'s (roster-link.js sceneOriginRefusalOf): the strip names the rule and both origins; nothing opens' },
49
- { id: 'scene-unreadable', runs: false,
52
+ { id: 'scene-unreadable', runs: false, cards: false,
50
53
  means: 'the linked scene URL is allowed but its read failed (a non-200, an empty body, or not a .js sketch): nothing opens' },
51
- { id: 'project-unreadable', runs: false,
54
+ { id: 'project-unreadable', runs: false, cards: false,
52
55
  means: 'the linked saved project is present but its folder is refused by the load: nothing opens' },
53
- { id: 'project-not-found', runs: false,
56
+ { id: 'project-not-found', runs: false, cards: false,
54
57
  means: 'no saved project of the linked name in this browser: nothing opens' },
55
- { id: 'ok', runs: true,
58
+ { id: 'ok', runs: true, cards: true,
56
59
  means: 'the linked walkthrough (in the linked mode, else its default), saved project or scene resolved and was handed to STUDIO\'s selection path; the scene starts on load' },
57
- { id: 'first-contact', runs: false,
58
- means: 'no STUDIO deep link: the roster\'s first-contact scene (firstContactOf(roster)) opens' },
59
- { id: 'first-contact-empty', runs: false,
60
+ { id: 'first-contact', runs: false, cards: true,
61
+ means: 'no STUDIO deep link: the roster\'s first-contact scene (firstContactOf(roster)) opens, offering its showcase cards and try-it as its deep link does' },
62
+ { id: 'first-contact-empty', runs: false, cards: false,
60
63
  means: 'no STUDIO deep link and the roster declares no first contact: the Empty Universe opens' },
61
64
  ].map(Object.freeze));
62
65
 
@@ -1 +1 @@
1
- import{r as s,C as w,j as r}from"./index-DX5L-7-w.js";function k({fileName:o,language:d,source:a,appliedSource:c,monacoBaseUrl:f,onRun:p,onReset:m,onClose:C,onChange:g,extraActions:j,error:t}){if(typeof o!="string"||!o)throw new Error("[SceneCodeEditor] fileName is required — the scene file as its owner names it (its roster row source). (FAIL-LOUD.)");if(typeof a!="string"||typeof c!="string")throw new Error("[SceneCodeEditor] source and appliedSource must be the scene text. (FAIL-LOUD.)");if(!f)throw new Error("[SceneCodeEditor] monacoBaseUrl is required — ferry FraqtlIde's router-resolved base. (FAIL-LOUD.)");if(d!==void 0&&d!=="javascript"&&d!=="json")throw new Error("[SceneCodeEditor] language is 'javascript' or 'json', got "+JSON.stringify(d)+". (FAIL-LOUD.)");const x=s.useRef(null),l=s.useRef(null),[h,b]=s.useState(a),u=s.useRef({});u.current={onRun:p,onChange:g};function v(){var e=l.current&&l.current.activeFile();return e?e.value:h}s.useEffect(function(){var e=new w({mountEl:x.current,monacoBaseUrl:f,emitBusRun:!1,showRun:!1});return e.openFile({id:o,language:d||"javascript",value:a,kind:"frqtl"}),e.onRun(function(i){u.current.onRun(i.value)}),e.onContentChange(function(){var i=e.activeFile();i&&(b(i.value),typeof u.current.onChange=="function"&&u.current.onChange(i.value))}),l.current=e,function(){e.dispose(),l.current=null}},[]),s.useEffect(function(){var e=l.current;if(e){var i=e.activeFile();i&&i.value!==a&&(e.setFileValue(o,a),b(a))}},[a,o]),s.useEffect(function(){var e=l.current;e&&e.setBaseline(o,c)},[c,o]),s.useEffect(function(){var e=l.current;e&&e.setMarkers(o,t&&t.line?[{startLineNumber:t.line,startColumn:t.col||1,endLineNumber:t.line,endColumn:(t.col||1)+1,message:t.message,severity:"error"}]:[])},[t,o]);var y=h!==c,n={root:{display:"flex",flexDirection:"column",width:"100%",height:"100%",background:"#111",color:"#ccc",fontFamily:"ui-monospace,Menlo,Consolas,monospace",fontSize:"0.75rem"},head:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 12px",borderBottom:"1px solid #222",flexShrink:0,flexWrap:"wrap"},file:{color:"#7ec8e3",fontWeight:700},mark:{color:"#fb4",fontSize:"0.7rem"},btn:{padding:"2px 10px",background:"#1a2a3a",color:"#8af",border:"1px solid #2a3a4a",borderRadius:"3px",cursor:"pointer",fontSize:"0.7rem"},run:{background:"#1a3a24",color:"#6c9",borderColor:"#2a4a34"},off:{opacity:.45,cursor:"not-allowed"},pane:{flex:1,position:"relative",overflow:"hidden",minHeight:0},err:{background:"#2a1111",color:"#ff6b6b",padding:"6px 12px",fontSize:"0.7rem",whiteSpace:"pre-wrap",maxHeight:"30%",overflow:"auto",flexShrink:0,borderTop:"1px solid #b6161c"}};return r.jsxs("div",{style:n.root,"data-role":"scene-code-editor","data-edited":y?"1":"0",children:[r.jsxs("div",{style:n.head,children:[r.jsx("span",{style:n.file,"data-role":"scene-editor-file",children:o}),y&&r.jsx("span",{style:n.mark,"data-role":"scene-editor-edited",children:"(edited)"}),r.jsx("span",{style:{flex:1}}),r.jsx("button",{style:Object.assign({},n.btn,n.run),"data-role":"scene-editor-run",title:"Run this code in a fresh frame (Cmd/Ctrl+Enter)",onClick:function(){p(v())},children:"Run"}),r.jsx("button",{style:n.btn,"data-role":"scene-editor-reset",title:"Back to the scene file: re-read it, discard these edits, reload",onClick:function(){m()},children:"Reset"}),(j||[]).map(function(e){return r.jsx("button",{"data-role":"scene-editor-action-"+e.id,disabled:!!e.disabled,title:e.title||"",style:Object.assign({},n.btn,e.disabled?n.off:{}),onClick:function(){e.disabled||e.onClick()},children:e.label},e.id)}),r.jsx("button",{style:n.btn,"data-role":"scene-editor-close",title:"Hide the editor; the code stays as you left it",onClick:function(){C(v())},children:"Close"})]}),r.jsx("div",{ref:x,style:n.pane}),t&&r.jsxs("div",{style:n.err,"data-role":"scene-editor-error",children:[t.line?"line "+t.line+(t.col?":"+t.col:"")+" — ":"",t.message]})]})}export{k as default};
1
+ import{r as s,C as w,j as r}from"./index-YDj5QEI1.js";function k({fileName:o,language:d,source:a,appliedSource:c,monacoBaseUrl:f,onRun:p,onReset:m,onClose:C,onChange:g,extraActions:j,error:t}){if(typeof o!="string"||!o)throw new Error("[SceneCodeEditor] fileName is required — the scene file as its owner names it (its roster row source). (FAIL-LOUD.)");if(typeof a!="string"||typeof c!="string")throw new Error("[SceneCodeEditor] source and appliedSource must be the scene text. (FAIL-LOUD.)");if(!f)throw new Error("[SceneCodeEditor] monacoBaseUrl is required — ferry FraqtlIde's router-resolved base. (FAIL-LOUD.)");if(d!==void 0&&d!=="javascript"&&d!=="json")throw new Error("[SceneCodeEditor] language is 'javascript' or 'json', got "+JSON.stringify(d)+". (FAIL-LOUD.)");const x=s.useRef(null),l=s.useRef(null),[h,b]=s.useState(a),u=s.useRef({});u.current={onRun:p,onChange:g};function v(){var e=l.current&&l.current.activeFile();return e?e.value:h}s.useEffect(function(){var e=new w({mountEl:x.current,monacoBaseUrl:f,emitBusRun:!1,showRun:!1});return e.openFile({id:o,language:d||"javascript",value:a,kind:"frqtl"}),e.onRun(function(i){u.current.onRun(i.value)}),e.onContentChange(function(){var i=e.activeFile();i&&(b(i.value),typeof u.current.onChange=="function"&&u.current.onChange(i.value))}),l.current=e,function(){e.dispose(),l.current=null}},[]),s.useEffect(function(){var e=l.current;if(e){var i=e.activeFile();i&&i.value!==a&&(e.setFileValue(o,a),b(a))}},[a,o]),s.useEffect(function(){var e=l.current;e&&e.setBaseline(o,c)},[c,o]),s.useEffect(function(){var e=l.current;e&&e.setMarkers(o,t&&t.line?[{startLineNumber:t.line,startColumn:t.col||1,endLineNumber:t.line,endColumn:(t.col||1)+1,message:t.message,severity:"error"}]:[])},[t,o]);var y=h!==c,n={root:{display:"flex",flexDirection:"column",width:"100%",height:"100%",background:"#111",color:"#ccc",fontFamily:"ui-monospace,Menlo,Consolas,monospace",fontSize:"0.75rem"},head:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 12px",borderBottom:"1px solid #222",flexShrink:0,flexWrap:"wrap"},file:{color:"#7ec8e3",fontWeight:700},mark:{color:"#fb4",fontSize:"0.7rem"},btn:{padding:"2px 10px",background:"#1a2a3a",color:"#8af",border:"1px solid #2a3a4a",borderRadius:"3px",cursor:"pointer",fontSize:"0.7rem"},run:{background:"#1a3a24",color:"#6c9",borderColor:"#2a4a34"},off:{opacity:.45,cursor:"not-allowed"},pane:{flex:1,position:"relative",overflow:"hidden",minHeight:0},err:{background:"#2a1111",color:"#ff6b6b",padding:"6px 12px",fontSize:"0.7rem",whiteSpace:"pre-wrap",maxHeight:"30%",overflow:"auto",flexShrink:0,borderTop:"1px solid #b6161c"}};return r.jsxs("div",{style:n.root,"data-role":"scene-code-editor","data-edited":y?"1":"0",children:[r.jsxs("div",{style:n.head,children:[r.jsx("span",{style:n.file,"data-role":"scene-editor-file",children:o}),y&&r.jsx("span",{style:n.mark,"data-role":"scene-editor-edited",children:"(edited)"}),r.jsx("span",{style:{flex:1}}),r.jsx("button",{style:Object.assign({},n.btn,n.run),"data-role":"scene-editor-run",title:"Run this code in a fresh frame (Cmd/Ctrl+Enter)",onClick:function(){p(v())},children:"Run"}),r.jsx("button",{style:n.btn,"data-role":"scene-editor-reset",title:"Back to the scene file: re-read it, discard these edits, reload",onClick:function(){m()},children:"Reset"}),(j||[]).map(function(e){return r.jsx("button",{"data-role":"scene-editor-action-"+e.id,disabled:!!e.disabled,title:e.title||"",style:Object.assign({},n.btn,e.disabled?n.off:{}),onClick:function(){e.disabled||e.onClick()},children:e.label},e.id)}),r.jsx("button",{style:n.btn,"data-role":"scene-editor-close",title:"Hide the editor; the code stays as you left it",onClick:function(){C(v())},children:"Close"})]}),r.jsx("div",{ref:x,style:n.pane}),t&&r.jsxs("div",{style:n.err,"data-role":"scene-editor-error",children:[t.line?"line "+t.line+(t.col?":"+t.col:"")+" — ":"",t.message]})]})}export{k as default};