@selvajs/selva 4.21.0-beta.7 → 4.21.0-beta.9
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/build/adapter-node.js +1 -1
- package/build/client/_app/immutable/assets/0.CqqJCiiV.css +2 -0
- package/build/client/_app/immutable/assets/0.CqqJCiiV.css.br +0 -0
- package/build/client/_app/immutable/assets/0.CqqJCiiV.css.gz +0 -0
- package/build/client/_app/immutable/chunks/{BepzH9eI.js → DptnDNFA.js} +60 -55
- package/build/client/_app/immutable/chunks/DptnDNFA.js.br +0 -0
- package/build/client/_app/immutable/chunks/{BepzH9eI.js.gz → DptnDNFA.js.gz} +0 -0
- package/build/client/_app/immutable/chunks/DvJo0Zn0.js +1 -0
- package/build/client/_app/immutable/chunks/DvJo0Zn0.js.br +1 -0
- package/build/client/_app/immutable/chunks/DvJo0Zn0.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.Cmuegtgc.js → app.GRcSFliG.js} +2 -2
- package/build/client/_app/immutable/entry/app.GRcSFliG.js.br +0 -0
- package/build/client/_app/immutable/entry/app.GRcSFliG.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15._hpTnSzc.js +36 -0
- package/build/client/_app/immutable/nodes/15._hpTnSzc.js.br +0 -0
- package/build/client/_app/immutable/nodes/15._hpTnSzc.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.DpKe0-GH.js +1 -0
- package/build/client/_app/immutable/nodes/21.DpKe0-GH.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.DpKe0-GH.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{25.D6EkgNRa.js → 25.BacveQsm.js} +1 -1
- package/build/client/_app/immutable/nodes/25.BacveQsm.js.br +0 -0
- package/build/client/_app/immutable/nodes/25.BacveQsm.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/server/.vite/manifest.json +16 -27
- package/build/server/_app/immutable/assets/_layout.CqqJCiiV.css +2 -0
- package/build/server/chunks/api-errors.js +18 -3
- package/build/server/chunks/api-errors.js.map +1 -1
- package/build/server/chunks/boot.server.js +1 -1
- package/build/server/chunks/bootHealth.server.js +23 -23
- package/build/server/chunks/bootHealth.server.js.map +1 -1
- package/build/server/chunks/computeRateLimit.server.js +1 -1
- package/build/server/chunks/delete-with-blobs.js +1 -1
- package/build/server/chunks/engine.server.js +50 -3
- package/build/server/chunks/engine.server.js.map +1 -1
- package/build/server/chunks/grasshopper.js +1 -1
- package/build/server/chunks/handlers.js +4 -4
- package/build/server/chunks/handlers.js.map +1 -1
- package/build/server/chunks/http2.js +1 -1
- package/build/server/chunks/instance.js +3 -3
- package/build/server/chunks/internal.js +1 -1
- package/build/server/chunks/{abort-Bfrdupaj.js → keepalive-vtcjhAV3.js} +6 -3
- package/build/server/chunks/keepalive-vtcjhAV3.js.map +1 -0
- package/build/server/chunks/package.js +2 -1
- package/build/server/chunks/package.js.map +1 -1
- package/build/server/chunks/permissions.server.js +1 -1
- package/build/server/chunks/providers.server.js +142 -18
- package/build/server/chunks/providers.server.js.map +1 -1
- package/build/server/chunks/resolve-server.js +1 -1
- package/build/server/chunks/schema-extraction.js +75 -8
- package/build/server/chunks/schema-extraction.js.map +1 -1
- package/build/server/chunks/server-config-write.js +6 -6
- package/build/server/chunks/server-config-write.js.map +1 -1
- package/build/server/chunks/serverStats.server.js +1 -1
- package/build/server/chunks/solve.server.js +4 -5
- package/build/server/chunks/solve.server.js.map +1 -1
- package/build/server/chunks/sveltekit.js +3 -4
- package/build/server/chunks/sveltekit.js.map +1 -1
- package/build/server/chunks/update-outcome.js +11 -0
- package/build/server/chunks/update-outcome.js.map +1 -1
- package/build/server/chunks/updateCheck.server.js +23 -11
- package/build/server/chunks/updateCheck.server.js.map +1 -1
- package/build/server/entries/endpoints/api/admin/compute/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/compute/actions/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/compute/status/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/system/health/_server.ts.js +3 -2
- package/build/server/entries/endpoints/api/admin/system/health/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/admin/system/update/_server.ts.js +32 -1
- package/build/server/entries/endpoints/api/admin/system/update/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/admin/users/_id_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/users/_id_/disable/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/users/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/files/_...path_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/compute/_server.ts.js +10 -5
- package/build/server/entries/endpoints/api/v1/compute/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/v1/compute/schema/_server.ts.js +2 -2
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/solve/_server.ts.js +3 -3
- package/build/server/entries/endpoints/mcp/_server.ts.js +38 -9
- package/build/server/entries/endpoints/mcp/_server.ts.js.map +1 -1
- package/build/server/entries/hooks.server.js +1 -1
- package/build/server/entries/pages/admin/compute/_page.server.ts.js +1 -2
- package/build/server/entries/pages/admin/compute/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/admin/system/_page.server.ts.js +8 -3
- package/build/server/entries/pages/admin/system/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/admin/system/_page.svelte.js +18 -2
- package/build/server/entries/pages/admin/system/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/library/_guid_/_page.server.ts.js +198 -99
- package/build/server/entries/pages/library/_guid_/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/library/_guid_/_page.svelte.js +462 -30
- package/build/server/entries/pages/library/_guid_/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/projects/_page.svelte.js +2 -0
- package/build/server/entries/pages/projects/_page.svelte.js.map +1 -1
- package/build/server/manifest-full.js +1 -1
- package/build/server/manifest.js +1 -1
- package/build/server/nodes/0.js +2 -2
- package/build/server/nodes/15.js +1 -1
- package/build/server/nodes/21.js +1 -1
- package/build/server/nodes/25.js +1 -1
- package/build/server/server.js +1 -1
- package/package.json +14 -11
- package/templates/.env.example +5 -3
- package/build/client/_app/immutable/assets/0.2jDm0bqh.css +0 -2
- package/build/client/_app/immutable/assets/0.2jDm0bqh.css.br +0 -0
- package/build/client/_app/immutable/assets/0.2jDm0bqh.css.gz +0 -0
- package/build/client/_app/immutable/chunks/BepzH9eI.js.br +0 -0
- package/build/client/_app/immutable/chunks/BmoT9ksD.js +0 -1
- package/build/client/_app/immutable/chunks/BmoT9ksD.js.br +0 -1
- package/build/client/_app/immutable/chunks/BmoT9ksD.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.Cmuegtgc.js.br +0 -0
- package/build/client/_app/immutable/entry/app.Cmuegtgc.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15.BXIV1QfS.js +0 -32
- package/build/client/_app/immutable/nodes/15.BXIV1QfS.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.BXIV1QfS.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.DvC40Ypm.js +0 -1
- package/build/client/_app/immutable/nodes/21.DvC40Ypm.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.DvC40Ypm.js.gz +0 -0
- package/build/client/_app/immutable/nodes/25.D6EkgNRa.js.br +0 -0
- package/build/client/_app/immutable/nodes/25.D6EkgNRa.js.gz +0 -0
- package/build/server/_app/immutable/assets/_layout.2jDm0bqh.css +0 -2
- package/build/server/chunks/abort-Bfrdupaj.js.map +0 -1
- package/build/server/chunks/computeLimits.js +0 -33
- package/build/server/chunks/computeLimits.js.map +0 -1
- /package/build/client/_app/immutable/nodes/{0.CYdyv5To.js → 0.Ds0zeDAg.js} +0 -0
- /package/build/client/_app/immutable/nodes/{0.CYdyv5To.js.br → 0.Ds0zeDAg.js.br} +0 -0
- /package/build/client/_app/immutable/nodes/{0.CYdyv5To.js.gz → 0.Ds0zeDAg.js.gz} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as subFolderSegments, m as downloadFileDataByRoot, p as decodeBase64ToBinary$1, r as GrasshopperResponseProcessor } from "../../../../chunks/grasshopper.js";
|
|
2
2
|
import { a as isDynamicValueListWidget, c as isTextWidget, i as isDropdownWidget, n as isCheckboxWidget, o as isFileWidget, r as isColorWidget, s as isNumberWidget } from "../../../../chunks/schema.js";
|
|
3
|
-
import { a as
|
|
3
|
+
import { a as getGroups, i as serverSourcedInputIds, n as KEEPALIVE_PREFERENCE, o as getInputItems, r as raceAbort, s as getLayoutItems } from "../../../../chunks/keepalive-vtcjhAV3.js";
|
|
4
4
|
import { i as outcomeFromComputeMessages, n as decodeOutcome, r as finalizeResult, t as decodeDiagnostic } from "../../../../chunks/outcome-D28FgvFK.js";
|
|
5
5
|
import { Ft as run, Lt as escape_html, Ot as attr, _ as setContext, a as derived, d as spread_props, f as stringify, h as getContext, i as bind_props, kt as clsx$1, l as props_id, n as attr_style, o as element$1, ot as snapshot, p as html, r as attributes, s as ensure_array_like, t as attr_class } from "../../../../chunks/server3.js";
|
|
6
6
|
import { c as watch$1, s as Context, t as FOOTER_CONTEXT_KEY } from "../../../../chunks/footerContext.svelte.js";
|
|
@@ -8116,12 +8116,17 @@ var RECIPES$1 = {
|
|
|
8116
8116
|
streaks: .4
|
|
8117
8117
|
}),
|
|
8118
8118
|
concrete: `
|
|
8119
|
-
float
|
|
8120
|
-
float
|
|
8121
|
-
float
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8119
|
+
float cloud = ( selvaFbm( uv * 0.002 ) - 0.5 ) * selvaDetail( 80.0 );
|
|
8120
|
+
float mottle = ( selvaFbm( uv * 0.018 + vec2( 5.0, 1.0 ) ) - 0.5 ) * selvaDetail( 15.0 );
|
|
8121
|
+
float sand = ( selvaNoise( uv * 0.5 ) - 0.5 ) * selvaDetail( 2.5 );
|
|
8122
|
+
vec3 pore = selvaCell( uv / 30.0 );
|
|
8123
|
+
// One cell in ten holds a hole 2 to 5 mm across.
|
|
8124
|
+
float radius = mix( 1.0, 2.5, selvaHash( vec2( pore.z, 4.0 ) ) ) / 30.0;
|
|
8125
|
+
float hole = 1.0 - smoothstep( radius * 0.5, radius, pore.x );
|
|
8126
|
+
hole *= step( 0.9, selvaHash( vec2( pore.z, 2.0 ) ) ) * selvaDetail( 4.0 );
|
|
8127
|
+
tone = vec3( 1.0 + cloud * 0.18 + mottle * 0.07 + sand * 0.03 - hole * 0.3 );
|
|
8128
|
+
gloss = 1.0 + cloud * 0.15 + hole * 0.1;
|
|
8129
|
+
height = -hole * 0.0003;`,
|
|
8125
8130
|
plaster: `
|
|
8126
8131
|
float trowel = 0.5 + ( selvaFbm( uv * 0.05 ) - 0.5 ) * selvaDetail( 6.0 );
|
|
8127
8132
|
tone = vec3( 1.0 + ( trowel - 0.5 ) * 0.07 );
|
|
@@ -10442,10 +10447,13 @@ function applySolveResult(state, result, editedSinceSent) {
|
|
|
10442
10447
|
/**
|
|
10443
10448
|
* Every schema output set to null. A blocked solve reports `outputs: {}`, and merging that into
|
|
10444
10449
|
* `values` would leave the previous solve's outputs behind.
|
|
10450
|
+
*
|
|
10451
|
+
* Dynamic value list outputs stay: they hold the options and rows the form is drawn from, not a
|
|
10452
|
+
* result. Blanked, a repeated block disappears and every list empties until the next good solve.
|
|
10445
10453
|
*/
|
|
10446
10454
|
function blankOutputs(schema) {
|
|
10447
10455
|
const blank = {};
|
|
10448
|
-
for (const output of schema.outputs) blank[output.id] = null;
|
|
10456
|
+
for (const output of schema.outputs) if (output.type !== "dynamicValueList") blank[output.id] = null;
|
|
10449
10457
|
return blank;
|
|
10450
10458
|
}
|
|
10451
10459
|
/** Writes a result into the state. Shared by the clean path and by `acknowledge()`. */
|
|
@@ -11039,6 +11047,68 @@ function createSolveEventStream(options) {
|
|
|
11039
11047
|
}
|
|
11040
11048
|
};
|
|
11041
11049
|
}
|
|
11050
|
+
var KEEPALIVE_REQUEST_HEADERS = { Prefer: KEEPALIVE_PREFERENCE };
|
|
11051
|
+
var NEWLINE = 10;
|
|
11052
|
+
var NULL_BODY_STATUSES = /* @__PURE__ */ new Set([
|
|
11053
|
+
101,
|
|
11054
|
+
103,
|
|
11055
|
+
204,
|
|
11056
|
+
205,
|
|
11057
|
+
304
|
|
11058
|
+
]);
|
|
11059
|
+
/**
|
|
11060
|
+
* The real response inside a keep-alive stream (wire format in `shared/keepalive.ts`), or `res`
|
|
11061
|
+
* itself when the server didn't apply the preference. Resolves once the solve's response begins,
|
|
11062
|
+
* so it waits as long as the solve.
|
|
11063
|
+
*
|
|
11064
|
+
* @throws when the stream ends or breaks before the real response begins.
|
|
11065
|
+
*/
|
|
11066
|
+
async function unwrapKeepalive(res) {
|
|
11067
|
+
if (res.headers.get("Preference-Applied") !== "selva-keepalive" || !res.body) return res;
|
|
11068
|
+
const reader = res.body.getReader();
|
|
11069
|
+
let head = /* @__PURE__ */ new Uint8Array(0);
|
|
11070
|
+
for (;;) {
|
|
11071
|
+
const { done, value } = await reader.read();
|
|
11072
|
+
if (done) throw new Error("The keep-alive response ended before the solve result.");
|
|
11073
|
+
head = concat(head, value);
|
|
11074
|
+
const newline = head.indexOf(NEWLINE);
|
|
11075
|
+
if (newline === -1) continue;
|
|
11076
|
+
const meta = JSON.parse(new TextDecoder().decode(head.subarray(0, newline)));
|
|
11077
|
+
const headers = new Headers(meta.headers);
|
|
11078
|
+
let body = prepend(head.subarray(newline + 1), reader);
|
|
11079
|
+
if (headers.get("Content-Encoding") === "gzip") {
|
|
11080
|
+
body = body.pipeThrough(new DecompressionStream("gzip"));
|
|
11081
|
+
headers.delete("Content-Encoding");
|
|
11082
|
+
headers.delete("Content-Length");
|
|
11083
|
+
}
|
|
11084
|
+
return new Response(NULL_BODY_STATUSES.has(meta.status) ? null : body, {
|
|
11085
|
+
status: meta.status,
|
|
11086
|
+
headers
|
|
11087
|
+
});
|
|
11088
|
+
}
|
|
11089
|
+
}
|
|
11090
|
+
function concat(a, b) {
|
|
11091
|
+
const out = new Uint8Array(a.byteLength + b.byteLength);
|
|
11092
|
+
out.set(a);
|
|
11093
|
+
out.set(b, a.byteLength);
|
|
11094
|
+
return out;
|
|
11095
|
+
}
|
|
11096
|
+
/** `first`, then the rest of `reader`. */
|
|
11097
|
+
function prepend(first, reader) {
|
|
11098
|
+
return new ReadableStream({
|
|
11099
|
+
start(controller) {
|
|
11100
|
+
if (first.byteLength > 0) controller.enqueue(first);
|
|
11101
|
+
},
|
|
11102
|
+
async pull(controller) {
|
|
11103
|
+
const { done, value } = await reader.read();
|
|
11104
|
+
if (done) controller.close();
|
|
11105
|
+
else controller.enqueue(value);
|
|
11106
|
+
},
|
|
11107
|
+
cancel(reason) {
|
|
11108
|
+
return reader.cancel(reason);
|
|
11109
|
+
}
|
|
11110
|
+
});
|
|
11111
|
+
}
|
|
11042
11112
|
/**
|
|
11043
11113
|
* A ready-made `SolveFn` that POSTs to a `/api/compute`-shaped endpoint (the wire contract
|
|
11044
11114
|
* `SolveEngine` produces) and unpacks the result, with 429 cooldown, session-expiry detection,
|
|
@@ -11131,7 +11201,8 @@ function createComputeFetchSolveFn(opts) {
|
|
|
11131
11201
|
method: "POST",
|
|
11132
11202
|
headers: {
|
|
11133
11203
|
"Content-Type": "application/json",
|
|
11134
|
-
...bearerToken ? { Authorization: `Bearer ${bearerToken}` } : {}
|
|
11204
|
+
...bearerToken ? { Authorization: `Bearer ${bearerToken}` } : {},
|
|
11205
|
+
...opts.keepalive ? KEEPALIVE_REQUEST_HEADERS : {}
|
|
11135
11206
|
},
|
|
11136
11207
|
body: payload,
|
|
11137
11208
|
signal
|
|
@@ -11148,6 +11219,15 @@ function createComputeFetchSolveFn(opts) {
|
|
|
11148
11219
|
return { outputs: {} };
|
|
11149
11220
|
}
|
|
11150
11221
|
const redirectedToLogin = res.redirected && new URL(res.url).pathname === (opts.loginPath ?? "/login");
|
|
11222
|
+
try {
|
|
11223
|
+
res = await unwrapKeepalive(res);
|
|
11224
|
+
} catch (err) {
|
|
11225
|
+
if (signal.aborted) {
|
|
11226
|
+
log("[Compute] solve aborted while the server held it — empty result discarded");
|
|
11227
|
+
return { outputs: {} };
|
|
11228
|
+
}
|
|
11229
|
+
throw new Error("The connection dropped while waiting for the result. Please try again.", { cause: err });
|
|
11230
|
+
}
|
|
11151
11231
|
if (res.status === 401 || redirectedToLogin) {
|
|
11152
11232
|
opts.onSessionExpired?.();
|
|
11153
11233
|
throw sessionExpiredError();
|
|
@@ -15439,15 +15519,100 @@ function OutputDisplay($$renderer, $$props) {
|
|
|
15439
15519
|
$$renderer.push(`<!--]-->`);
|
|
15440
15520
|
});
|
|
15441
15521
|
}
|
|
15522
|
+
// ../ui/src/lib/components/preview/RepeatBlock.svelte
|
|
15523
|
+
function RepeatBlock($$renderer, $$props) {
|
|
15524
|
+
$$renderer.component(($$renderer) => {
|
|
15525
|
+
/** Display name of each member input, keyed by input id. */
|
|
15526
|
+
/** Option pictures of each member input, keyed by input id. */
|
|
15527
|
+
/** Each member's resolved picks, one per row in row order. */
|
|
15528
|
+
let { repeat, memberLabels, memberMedia = {}, shown, rowOptions, onPick, disabled = false, assets } = $$props;
|
|
15529
|
+
const sections = derived(() => {
|
|
15530
|
+
const out = [];
|
|
15531
|
+
repeat.rows.forEach((row, index) => {
|
|
15532
|
+
const label = row.section ?? "";
|
|
15533
|
+
let section = out.find((s) => s.label === label);
|
|
15534
|
+
if (!section) out.push(section = {
|
|
15535
|
+
label,
|
|
15536
|
+
rows: []
|
|
15537
|
+
});
|
|
15538
|
+
section.rows.push({
|
|
15539
|
+
index,
|
|
15540
|
+
key: row.key,
|
|
15541
|
+
label: row.label || row.key
|
|
15542
|
+
});
|
|
15543
|
+
});
|
|
15544
|
+
return out;
|
|
15545
|
+
});
|
|
15546
|
+
function rowValue(memberId, index) {
|
|
15547
|
+
const picks = shown[memberId];
|
|
15548
|
+
return Array.isArray(picks) && typeof picks[index] === "string" ? picks[index] : void 0;
|
|
15549
|
+
}
|
|
15550
|
+
function setRow(memberId, rowKey, value) {
|
|
15551
|
+
if (typeof value === "string") onPick(memberId, rowKey, value);
|
|
15552
|
+
}
|
|
15553
|
+
const configFor = (memberId, index) => ({
|
|
15554
|
+
options: rowOptions[memberId]?.[index] ?? {},
|
|
15555
|
+
optionMedia: memberMedia[memberId]
|
|
15556
|
+
});
|
|
15557
|
+
const COLUMNS = [
|
|
15558
|
+
"grid-cols-1",
|
|
15559
|
+
"grid-cols-1",
|
|
15560
|
+
"grid-cols-2",
|
|
15561
|
+
"grid-cols-3",
|
|
15562
|
+
"grid-cols-4"
|
|
15563
|
+
];
|
|
15564
|
+
const columns = derived(() => COLUMNS[Math.min(repeat.members.length, 4)]);
|
|
15565
|
+
$$renderer.push(`<div class="gap-5 flex flex-col"><!--[-->`);
|
|
15566
|
+
const each_array = ensure_array_like(sections());
|
|
15567
|
+
for (let $$index_3 = 0, $$length = each_array.length; $$index_3 < $$length; $$index_3++) {
|
|
15568
|
+
let section = each_array[$$index_3];
|
|
15569
|
+
$$renderer.push(`<section class="gap-3 flex flex-col"${attr("aria-label", section.label || void 0)}><div class="gap-1 flex flex-col">`);
|
|
15570
|
+
if (section.label) $$renderer.push(`<!--[0--><h3 class="text-sm font-medium text-foreground">${escape_html(section.label)}</h3>`);
|
|
15571
|
+
else $$renderer.push("<!--[-1-->");
|
|
15572
|
+
$$renderer.push(`<!--]--> <div${attr_class(`gap-x-2 grid ${stringify(columns())}`)}><!--[-->`);
|
|
15573
|
+
const each_array_1 = ensure_array_like(repeat.members);
|
|
15574
|
+
for (let $$index = 0, $$length = each_array_1.length; $$index < $$length; $$index++) {
|
|
15575
|
+
let member = each_array_1[$$index];
|
|
15576
|
+
$$renderer.push(`<span class="text-xs truncate text-muted-foreground">${escape_html(memberLabels[member] ?? member)}</span>`);
|
|
15577
|
+
}
|
|
15578
|
+
$$renderer.push(`<!--]--></div></div> <!--[-->`);
|
|
15579
|
+
const each_array_2 = ensure_array_like(section.rows);
|
|
15580
|
+
for (let $$index_2 = 0, $$length = each_array_2.length; $$index_2 < $$length; $$index_2++) {
|
|
15581
|
+
let row = each_array_2[$$index_2];
|
|
15582
|
+
$$renderer.push(`<div class="gap-1.5 flex flex-col"><span class="text-sm truncate"${attr("title", row.label)}>${escape_html(row.label)}</span> <div${attr_class(`gap-2 grid items-center ${stringify(columns())}`)}><!--[-->`);
|
|
15583
|
+
const each_array_3 = ensure_array_like(repeat.members);
|
|
15584
|
+
for (let $$index_1 = 0, $$length = each_array_3.length; $$index_1 < $$length; $$index_1++) {
|
|
15585
|
+
let member = each_array_3[$$index_1];
|
|
15586
|
+
$$renderer.push(`<div role="group"${attr("aria-label", `${stringify(row.label)}: ${stringify(memberLabels[member] ?? member)}`)}>`);
|
|
15587
|
+
DropdownInput($$renderer, {
|
|
15588
|
+
value: rowValue(member, row.index),
|
|
15589
|
+
config: configFor(member, row.index),
|
|
15590
|
+
onChange: (value) => setRow(member, row.key, value),
|
|
15591
|
+
disabled,
|
|
15592
|
+
assets
|
|
15593
|
+
});
|
|
15594
|
+
$$renderer.push(`<!----></div>`);
|
|
15595
|
+
}
|
|
15596
|
+
$$renderer.push(`<!--]--></div></div>`);
|
|
15597
|
+
}
|
|
15598
|
+
$$renderer.push(`<!--]--></section>`);
|
|
15599
|
+
}
|
|
15600
|
+
$$renderer.push(`<!--]--></div>`);
|
|
15601
|
+
});
|
|
15602
|
+
}
|
|
15442
15603
|
// ../ui/src/lib/components/preview/TabContent.svelte
|
|
15443
15604
|
function TabContent($$renderer, $$props) {
|
|
15444
15605
|
$$renderer.component(($$renderer) => {
|
|
15445
15606
|
const locale = getLocaleContext();
|
|
15446
15607
|
const t = derived(() => locale.messages);
|
|
15447
15608
|
/** Computed value list options keyed by the target dynamic-value-list input id. */
|
|
15609
|
+
/** Option tables and repeats from the last solve. */
|
|
15610
|
+
/** Sets one row's pick of a repeated input. */
|
|
15611
|
+
/** The member input each repeat is drawn at, keyed by repeat id. */
|
|
15612
|
+
/** Option pictures of each repeated input, keyed by input id. */
|
|
15448
15613
|
/** The schema's icons and thumbnails, which value-list options point into. */
|
|
15449
15614
|
/** No tinted backdrop and no scroll area of its own: the container scrolls. */
|
|
15450
|
-
let { tab, values, collapsedGroups, onToggleGroup, onValueChange, inputs, outputs, dynamicOptions = {}, assets, bare = false } = $$props;
|
|
15615
|
+
let { tab, values, collapsedGroups, onToggleGroup, onValueChange, inputs, outputs, dynamicOptions = {}, formModel, onRowPick, repeatLeads = {}, memberLabels = {}, memberMedia = {}, assets, bare = false } = $$props;
|
|
15451
15616
|
const { host } = getHostContext();
|
|
15452
15617
|
const visibleGroups = derived(() => tab.groups.filter((group) => evaluateGroupVisibility(group, values)).flatMap((group) => {
|
|
15453
15618
|
const items = group.items.filter((item) => isSupportedOn(host, layoutItemKind(item, inputs)));
|
|
@@ -15464,8 +15629,26 @@ function TabContent($$renderer, $$props) {
|
|
|
15464
15629
|
}
|
|
15465
15630
|
function renderInput($$renderer, layoutItem, visibility) {
|
|
15466
15631
|
const input = getInputById(layoutItem.paramId);
|
|
15467
|
-
|
|
15632
|
+
const repeatId = formModel?.repeatOf[layoutItem.paramId];
|
|
15633
|
+
const repeat = repeatId ? formModel?.repeats.find((r) => r.id === repeatId) : void 0;
|
|
15634
|
+
if (input && repeat && formModel) {
|
|
15468
15635
|
$$renderer.push("<!--[0-->");
|
|
15636
|
+
if (repeatLeads[repeat.id] === input.id && onRowPick) {
|
|
15637
|
+
$$renderer.push("<!--[0-->");
|
|
15638
|
+
RepeatBlock($$renderer, {
|
|
15639
|
+
repeat,
|
|
15640
|
+
memberLabels,
|
|
15641
|
+
memberMedia,
|
|
15642
|
+
shown: formModel.shown,
|
|
15643
|
+
rowOptions: formModel.rowOptions,
|
|
15644
|
+
onPick: onRowPick,
|
|
15645
|
+
disabled: visibility.disabled,
|
|
15646
|
+
assets
|
|
15647
|
+
});
|
|
15648
|
+
} else $$renderer.push("<!--[-1-->");
|
|
15649
|
+
$$renderer.push(`<!--]-->`);
|
|
15650
|
+
} else if (input) {
|
|
15651
|
+
$$renderer.push("<!--[1-->");
|
|
15469
15652
|
InputControl($$renderer, {
|
|
15470
15653
|
item: layoutItem,
|
|
15471
15654
|
value: values[input.id],
|
|
@@ -15630,23 +15813,226 @@ function collectDynamicValueListSources(schema) {
|
|
|
15630
15813
|
}
|
|
15631
15814
|
return [...byId.values()];
|
|
15632
15815
|
}
|
|
15816
|
+
function findOptionIndex(entries, pick) {
|
|
15817
|
+
if (typeof pick !== "string") return -1;
|
|
15818
|
+
const wanted = pick.toLowerCase();
|
|
15819
|
+
return entries.findIndex(([name, value]) => value.toLowerCase() === wanted || name.toLowerCase() === wanted);
|
|
15820
|
+
}
|
|
15821
|
+
/**
|
|
15822
|
+
* The option value a pick resolves to, as Grasshopper resolves it in the solve: the pick if still
|
|
15823
|
+
* offered (by value or name, ignoring case), else the first option. With no options known the
|
|
15824
|
+
* pick passes through. `packages/schemas/fixtures/dynamic-value-list-resolution.json` pins both.
|
|
15825
|
+
*/
|
|
15826
|
+
function resolvePick(options, pick) {
|
|
15827
|
+
const entries = Object.entries(options ?? {});
|
|
15828
|
+
if (entries.length === 0) return typeof pick === "string" ? pick : "";
|
|
15829
|
+
return entries[Math.max(0, findOptionIndex(entries, pick))][1];
|
|
15830
|
+
}
|
|
15831
|
+
/**
|
|
15832
|
+
* Checklist: the picks still offered, in pick order; none left gives the first option. Duplicates
|
|
15833
|
+
* collapse by option, not by value, so two options sharing a value both stay.
|
|
15834
|
+
*/
|
|
15835
|
+
function resolvePicks(options, picks) {
|
|
15836
|
+
const entries = Object.entries(options ?? {});
|
|
15837
|
+
if (entries.length === 0) return picks.filter((p) => typeof p === "string");
|
|
15838
|
+
const kept = /* @__PURE__ */ new Set();
|
|
15839
|
+
for (const pick of picks) {
|
|
15840
|
+
const index = findOptionIndex(entries, pick);
|
|
15841
|
+
if (index >= 0) kept.add(index);
|
|
15842
|
+
}
|
|
15843
|
+
return kept.size > 0 ? [...kept].map((i) => entries[i][1]) : [entries[0][1]];
|
|
15844
|
+
}
|
|
15633
15845
|
/**
|
|
15634
|
-
*
|
|
15846
|
+
* A checklist edit made on the resolved picks, merged back into the stored ones: picks not offered
|
|
15847
|
+
* now were never shown, so the edit can't have removed them, and they come back when offered again.
|
|
15848
|
+
*/
|
|
15849
|
+
function keepHiddenPicks(options, stored, edited) {
|
|
15850
|
+
const entries = Object.entries(options ?? {});
|
|
15851
|
+
if (entries.length === 0 || !Array.isArray(stored)) return edited;
|
|
15852
|
+
const hidden = stored.filter((pick) => typeof pick === "string" && findOptionIndex(entries, pick) < 0 && !edited.includes(pick));
|
|
15853
|
+
return [...edited, ...hidden];
|
|
15854
|
+
}
|
|
15855
|
+
/**
|
|
15856
|
+
* A repeated input's picks. Its value is one JSON object of row key to pick, so a pick stays with
|
|
15857
|
+
* its row when rows come and go, and the value is a plain string on the wire. Anything else reads
|
|
15858
|
+
* as no picks.
|
|
15859
|
+
*/
|
|
15860
|
+
function readRowPicks(value) {
|
|
15861
|
+
if (typeof value !== "string" || !value.trimStart().startsWith("{")) return {};
|
|
15862
|
+
try {
|
|
15863
|
+
const parsed = JSON.parse(value);
|
|
15864
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
15865
|
+
return Object.fromEntries(Object.entries(parsed).filter((entry) => typeof entry[1] === "string"));
|
|
15866
|
+
} catch {
|
|
15867
|
+
return {};
|
|
15868
|
+
}
|
|
15869
|
+
}
|
|
15870
|
+
/** The repeated input's value with one row's pick set. Picks for rows not shown now are kept. */
|
|
15871
|
+
function withRowPick(value, rowKey, pick) {
|
|
15872
|
+
return JSON.stringify({
|
|
15873
|
+
...readRowPicks(value),
|
|
15874
|
+
[rowKey]: pick
|
|
15875
|
+
});
|
|
15876
|
+
}
|
|
15877
|
+
/** The options each targeted payload gives its input: one set, or the same set for every row. */
|
|
15878
|
+
function lookUpOptions(payloads, repeatById, repeatOf) {
|
|
15879
|
+
const options = {};
|
|
15880
|
+
const rowOptions = {};
|
|
15881
|
+
for (const { source, payload } of payloads) {
|
|
15882
|
+
const target = payload.targetInputId ?? source.targetInputId;
|
|
15883
|
+
if (!target || !payload.options || typeof payload.options !== "object") continue;
|
|
15884
|
+
const repeat = repeatById.get(repeatOf[target]);
|
|
15885
|
+
const offered = payload.options;
|
|
15886
|
+
if (repeat) rowOptions[target] = repeat.rows.map(() => offered);
|
|
15887
|
+
else options[target] = offered;
|
|
15888
|
+
}
|
|
15889
|
+
for (const { source, payload } of payloads) {
|
|
15890
|
+
const repeat = repeatById.get(source.id);
|
|
15891
|
+
const offered = payload.options;
|
|
15892
|
+
if (!repeat || !offered || Object.keys(offered).length === 0) continue;
|
|
15893
|
+
for (const member of repeat.members) rowOptions[member] ??= repeat.rows.map(() => offered);
|
|
15894
|
+
}
|
|
15895
|
+
return {
|
|
15896
|
+
options,
|
|
15897
|
+
rowOptions
|
|
15898
|
+
};
|
|
15899
|
+
}
|
|
15900
|
+
var tableOptionsCache = /* @__PURE__ */ new WeakMap();
|
|
15901
|
+
/**
|
|
15902
|
+
* Narrows each pick table as Grasshopper does in the solve: an input offers the values its column
|
|
15903
|
+
* has in the rows left by the picks before it, and resolves its own pick against those.
|
|
15904
|
+
* `packages/schemas/fixtures/pick-table.json` pins both.
|
|
15905
|
+
*/
|
|
15906
|
+
function narrowPickTables(payloads, values, repeatById, repeatOf) {
|
|
15907
|
+
const options = {};
|
|
15908
|
+
const rowOptions = {};
|
|
15909
|
+
const shown = {};
|
|
15910
|
+
for (const { payload } of payloads) {
|
|
15911
|
+
const table = payload.pickTable;
|
|
15912
|
+
if (!table || !Array.isArray(table.inputs) || !Array.isArray(table.rows)) continue;
|
|
15913
|
+
const cache = tableOptionsCache.get(table.rows) ?? /* @__PURE__ */ new Map();
|
|
15914
|
+
tableOptionsCache.set(table.rows, cache);
|
|
15915
|
+
const by = Array.isArray(table.by) ? table.by : [];
|
|
15916
|
+
const held = by.map((id) => {
|
|
15917
|
+
const value = values[id];
|
|
15918
|
+
return (Array.isArray(value) ? value : [value]).filter((item) => item !== void 0 && item !== null).map(String);
|
|
15919
|
+
});
|
|
15920
|
+
const start = Array.from({ length: Math.max(1, ...held.map((h) => h.length)) }, (_, i) => {
|
|
15921
|
+
const picked = held.map((items) => items[Math.min(i, items.length - 1)]);
|
|
15922
|
+
return {
|
|
15923
|
+
rows: table.rows.filter((row) => picked.every((item, d) => item === void 0 || row[d]?.toLowerCase() === item.toLowerCase())),
|
|
15924
|
+
picked: picked.map((item) => item ?? "")
|
|
15925
|
+
};
|
|
15926
|
+
});
|
|
15927
|
+
const left = [];
|
|
15928
|
+
table.inputs.forEach((id, index) => {
|
|
15929
|
+
const column = by.length + index;
|
|
15930
|
+
const parent = table.parents?.[index] ?? index - 1;
|
|
15931
|
+
const before = parent >= 0 && left[parent] ? left[parent] : start;
|
|
15932
|
+
const repeat = repeatById.get(repeatOf[id]);
|
|
15933
|
+
const rowPicks = repeat ? readRowPicks(values[id]) : void 0;
|
|
15934
|
+
const picks = repeat ? repeat.rows.map((row) => rowPicks?.[row.key]) : [values[id]];
|
|
15935
|
+
const offeredPerRow = [];
|
|
15936
|
+
const resolved = [];
|
|
15937
|
+
const after = picks.map((wanted, i) => {
|
|
15938
|
+
const { rows, picked } = before[Math.min(i, before.length - 1)];
|
|
15939
|
+
const key = JSON.stringify([column, ...picked]);
|
|
15940
|
+
let offered = cache.get(key);
|
|
15941
|
+
if (!offered) {
|
|
15942
|
+
offered = {};
|
|
15943
|
+
for (const row of rows) {
|
|
15944
|
+
const cell = row[column];
|
|
15945
|
+
if (typeof cell === "string" && cell !== "") offered[cell] = cell;
|
|
15946
|
+
}
|
|
15947
|
+
cache.set(key, offered);
|
|
15948
|
+
}
|
|
15949
|
+
offeredPerRow.push(offered);
|
|
15950
|
+
const pick = resolvePick(offered, wanted);
|
|
15951
|
+
resolved.push(pick);
|
|
15952
|
+
return {
|
|
15953
|
+
rows: rows.filter((row) => row[column] === pick),
|
|
15954
|
+
picked: [...picked, `${column}:${pick}`]
|
|
15955
|
+
};
|
|
15956
|
+
});
|
|
15957
|
+
if (repeat) {
|
|
15958
|
+
rowOptions[id] = offeredPerRow;
|
|
15959
|
+
shown[id] = resolved;
|
|
15960
|
+
} else {
|
|
15961
|
+
options[id] = offeredPerRow[0];
|
|
15962
|
+
shown[id] = resolved[0];
|
|
15963
|
+
}
|
|
15964
|
+
left[index] = after.length > 0 ? after : before;
|
|
15965
|
+
});
|
|
15966
|
+
}
|
|
15967
|
+
return {
|
|
15968
|
+
options,
|
|
15969
|
+
rowOptions,
|
|
15970
|
+
shown
|
|
15971
|
+
};
|
|
15972
|
+
}
|
|
15973
|
+
/**
|
|
15974
|
+
* What the form shows, from the payloads the last solve returned and the values on screen now.
|
|
15975
|
+
* A pick table is narrowed by the picks on screen, so changing one updates the lists that depend
|
|
15976
|
+
* on it without a solve.
|
|
15635
15977
|
*
|
|
15636
|
-
*
|
|
15637
|
-
*
|
|
15638
|
-
* `targetInputId` is the fallback when the payload omits it.
|
|
15978
|
+
* Pass the previous model to keep the identity of every array that didn't change: this runs on
|
|
15979
|
+
* each value change, and a fresh array re-renders its whole checklist or repeat.
|
|
15639
15980
|
*/
|
|
15640
|
-
function
|
|
15641
|
-
const
|
|
15981
|
+
function buildFormModel(schema, values, previous) {
|
|
15982
|
+
const payloads = [];
|
|
15642
15983
|
for (const source of collectDynamicValueListSources(schema)) {
|
|
15643
15984
|
const payload = coercePayloadMemo(values[source.id]);
|
|
15644
|
-
if (
|
|
15645
|
-
|
|
15646
|
-
|
|
15647
|
-
|
|
15985
|
+
if (payload) payloads.push({
|
|
15986
|
+
source,
|
|
15987
|
+
payload
|
|
15988
|
+
});
|
|
15648
15989
|
}
|
|
15649
|
-
|
|
15990
|
+
const repeats = [];
|
|
15991
|
+
const repeatOf = {};
|
|
15992
|
+
for (const { source, payload } of payloads) {
|
|
15993
|
+
if (!Array.isArray(payload.rows) || !Array.isArray(payload.members)) continue;
|
|
15994
|
+
const rows = payload.rows.filter((r) => typeof r?.key === "string");
|
|
15995
|
+
repeats.push({
|
|
15996
|
+
id: source.id,
|
|
15997
|
+
rows,
|
|
15998
|
+
members: payload.members
|
|
15999
|
+
});
|
|
16000
|
+
for (const member of payload.members) repeatOf[member] = source.id;
|
|
16001
|
+
}
|
|
16002
|
+
const repeatById = new Map(repeats.map((r) => [r.id, r]));
|
|
16003
|
+
const tables = narrowPickTables(payloads, values, repeatById, repeatOf);
|
|
16004
|
+
const lookup = lookUpOptions(payloads, repeatById, repeatOf);
|
|
16005
|
+
Object.assign(lookup.options, tables.options);
|
|
16006
|
+
Object.assign(lookup.rowOptions, tables.rowOptions);
|
|
16007
|
+
const shown = { ...tables.shown };
|
|
16008
|
+
for (const { source, payload } of payloads) {
|
|
16009
|
+
const target = payload.targetInputId ?? source.targetInputId;
|
|
16010
|
+
if (!target || !payload.resolvedInSolve || repeatOf[target]) continue;
|
|
16011
|
+
const value = values[target];
|
|
16012
|
+
shown[target] = Array.isArray(value) ? resolvePicks(lookup.options[target], value) : resolvePick(lookup.options[target], value);
|
|
16013
|
+
}
|
|
16014
|
+
for (const repeat of repeats) for (const member of repeat.members) {
|
|
16015
|
+
const picks = readRowPicks(values[member]);
|
|
16016
|
+
shown[member] = repeat.rows.map((row, i) => resolvePick(lookup.rowOptions[member]?.[i], picks[row.key]));
|
|
16017
|
+
}
|
|
16018
|
+
if (previous) {
|
|
16019
|
+
reuseUnchanged(shown, previous.shown);
|
|
16020
|
+
reuseUnchanged(lookup.rowOptions, previous.rowOptions);
|
|
16021
|
+
}
|
|
16022
|
+
return {
|
|
16023
|
+
...lookup,
|
|
16024
|
+
repeats,
|
|
16025
|
+
repeatOf,
|
|
16026
|
+
shown
|
|
16027
|
+
};
|
|
16028
|
+
}
|
|
16029
|
+
function sameValue(a, b) {
|
|
16030
|
+
if (a === b) return true;
|
|
16031
|
+
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
|
|
16032
|
+
return a.every((item, i) => item === b[i]);
|
|
16033
|
+
}
|
|
16034
|
+
function reuseUnchanged(next, previous) {
|
|
16035
|
+
for (const key of Object.keys(next)) if (key in previous && sameValue(next[key], previous[key])) next[key] = previous[key];
|
|
15650
16036
|
}
|
|
15651
16037
|
// ../ui/src/lib/components/preview/TabLayout.svelte
|
|
15652
16038
|
function TabLayout($$renderer, $$props) {
|
|
@@ -15660,13 +16046,49 @@ function TabLayout($$renderer, $$props) {
|
|
|
15660
16046
|
let { schema, values, onValueChange, panelFilter, requestedTabId = null, bare = false } = $$props;
|
|
15661
16047
|
let activeTabId = "";
|
|
15662
16048
|
let collapsedGroups = {};
|
|
16049
|
+
let lastModel;
|
|
16050
|
+
const formModel = derived(() => lastModel = buildFormModel(schema, values, lastModel));
|
|
16051
|
+
const shownValues = derived(() => ({
|
|
16052
|
+
...values,
|
|
16053
|
+
...formModel().shown
|
|
16054
|
+
}));
|
|
15663
16055
|
const visibleTabs = derived(() => schema.layout.type === "tabbed" ? schema.layout.tabs.filter((tab) => {
|
|
15664
|
-
if (!isTabVisible(tab,
|
|
16056
|
+
if (!isTabVisible(tab, shownValues())) return false;
|
|
15665
16057
|
if (!panelFilter) return true;
|
|
15666
16058
|
return panelFilter === "right" ? tab.position === "right" : tab.position !== "right";
|
|
15667
16059
|
}) : []);
|
|
15668
16060
|
const showTabBar = derived(() => visibleTabs().length > 1);
|
|
15669
|
-
const
|
|
16061
|
+
const repeatLeads = derived(() => {
|
|
16062
|
+
const placed = new Set(getLayoutItems(schema).filter((item) => item.type === "input").map((item) => item.paramId));
|
|
16063
|
+
const leads = {};
|
|
16064
|
+
for (const repeat of formModel().repeats) {
|
|
16065
|
+
const lead = repeat.members.find((m) => placed.has(m));
|
|
16066
|
+
if (lead) leads[repeat.id] = lead;
|
|
16067
|
+
}
|
|
16068
|
+
return leads;
|
|
16069
|
+
});
|
|
16070
|
+
const memberMedia = derived(() => {
|
|
16071
|
+
const media = {};
|
|
16072
|
+
for (const item of getLayoutItems(schema)) {
|
|
16073
|
+
if (item.type !== "input") continue;
|
|
16074
|
+
const config = item.config;
|
|
16075
|
+
if (config?.optionMedia) media[item.paramId] = config.optionMedia;
|
|
16076
|
+
}
|
|
16077
|
+
return media;
|
|
16078
|
+
});
|
|
16079
|
+
const memberLabels = derived(() => {
|
|
16080
|
+
const labels = {};
|
|
16081
|
+
for (const input of schema.inputs) labels[input.id] = input.nickname;
|
|
16082
|
+
for (const item of getLayoutItems(schema)) if (item.type === "input" && item.displayName) labels[item.paramId] = item.displayName;
|
|
16083
|
+
return labels;
|
|
16084
|
+
});
|
|
16085
|
+
function handleValueChange(paramId, value, forceSolve) {
|
|
16086
|
+
const merged = Array.isArray(value) && Array.isArray(formModel().shown[paramId]) ? keepHiddenPicks(formModel().options[paramId], values[paramId], value) : value;
|
|
16087
|
+
onValueChange(paramId, merged, forceSolve);
|
|
16088
|
+
}
|
|
16089
|
+
function handleRowPick(memberId, rowKey, pick) {
|
|
16090
|
+
onValueChange(memberId, withRowPick(values[memberId], rowKey, pick));
|
|
16091
|
+
}
|
|
15670
16092
|
function toggleGroup(groupId) {
|
|
15671
16093
|
collapsedGroups[groupId] = !collapsedGroups[groupId];
|
|
15672
16094
|
}
|
|
@@ -15696,13 +16118,18 @@ function TabLayout($$renderer, $$props) {
|
|
|
15696
16118
|
let tab = each_array[$$index];
|
|
15697
16119
|
TabContent($$renderer, {
|
|
15698
16120
|
tab,
|
|
15699
|
-
values,
|
|
16121
|
+
values: shownValues(),
|
|
15700
16122
|
collapsedGroups,
|
|
15701
16123
|
onToggleGroup: toggleGroup,
|
|
15702
|
-
onValueChange,
|
|
16124
|
+
onValueChange: handleValueChange,
|
|
16125
|
+
onRowPick: handleRowPick,
|
|
15703
16126
|
inputs: schema.inputs,
|
|
15704
16127
|
outputs: schema.outputs,
|
|
15705
|
-
dynamicOptions:
|
|
16128
|
+
dynamicOptions: formModel().options,
|
|
16129
|
+
formModel: formModel(),
|
|
16130
|
+
repeatLeads: repeatLeads(),
|
|
16131
|
+
memberLabels: memberLabels(),
|
|
16132
|
+
memberMedia: memberMedia(),
|
|
15706
16133
|
assets: schema.assets,
|
|
15707
16134
|
bare
|
|
15708
16135
|
});
|
|
@@ -16532,6 +16959,9 @@ function AppLayout($$renderer, $$props) {
|
|
|
16532
16959
|
let rightCollapsed = false;
|
|
16533
16960
|
let requestedLeftTabId = null;
|
|
16534
16961
|
let requestedRightTabId = null;
|
|
16962
|
+
const leftDefaultSize = derived(() => isTwoPanelMode() ? 50 : hasViewer && hasRightPanel() ? 22 : 30);
|
|
16963
|
+
const rightDefaultSize = derived(() => isTwoPanelMode() ? 50 : 25);
|
|
16964
|
+
const viewerDefaultSize = derived(() => 100 - (hasLeftPanel() ? leftDefaultSize() : 0) - (hasRightPanel() ? rightDefaultSize() : 0));
|
|
16535
16965
|
const layoutKey = derived(() => `${hasLeftPanel() ? "L" : ""}${hasViewer ? "V" : ""}${hasRightPanel() ? "R" : ""}`);
|
|
16536
16966
|
async function handleLoadValues(loadedValues) {
|
|
16537
16967
|
Object.assign(values, loadedValues);
|
|
@@ -16797,7 +17227,7 @@ function AppLayout($$renderer, $$props) {
|
|
|
16797
17227
|
$$renderer.push("<!--[-->");
|
|
16798
17228
|
Pane($$renderer, {
|
|
16799
17229
|
order: 1,
|
|
16800
|
-
defaultSize:
|
|
17230
|
+
defaultSize: leftDefaultSize(),
|
|
16801
17231
|
minSize: 15,
|
|
16802
17232
|
maxSize: 45,
|
|
16803
17233
|
collapsible: true,
|
|
@@ -16841,6 +17271,7 @@ function AppLayout($$renderer, $$props) {
|
|
|
16841
17271
|
$$renderer.push("<!--[-->");
|
|
16842
17272
|
Pane($$renderer, {
|
|
16843
17273
|
order: 2,
|
|
17274
|
+
defaultSize: viewerDefaultSize(),
|
|
16844
17275
|
minSize: 20,
|
|
16845
17276
|
class: "min-h-0 flex flex-col",
|
|
16846
17277
|
children: ($$renderer) => {
|
|
@@ -16897,7 +17328,7 @@ function AppLayout($$renderer, $$props) {
|
|
|
16897
17328
|
$$renderer.push("<!--[-->");
|
|
16898
17329
|
Pane($$renderer, {
|
|
16899
17330
|
order: 3,
|
|
16900
|
-
defaultSize:
|
|
17331
|
+
defaultSize: rightDefaultSize(),
|
|
16901
17332
|
minSize: 15,
|
|
16902
17333
|
maxSize: 45,
|
|
16903
17334
|
collapsible: true,
|
|
@@ -17518,6 +17949,7 @@ function _page($$renderer, $$props) {
|
|
|
17518
17949
|
versionId: () => data.versionId,
|
|
17519
17950
|
streamId: () => liveEvents?.streamId ?? null,
|
|
17520
17951
|
bearerToken: () => data.shareToken,
|
|
17952
|
+
keepalive: true,
|
|
17521
17953
|
meshes: shouldShowViewer() ? { extract: (response, opts) => getThreeObjectsFromComputeResponse(response, opts) } : void 0,
|
|
17522
17954
|
debug: true
|
|
17523
17955
|
});
|