@neta-art/cohub-cli 10.12.3 → 10.14.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/dist/board-kernel.d.ts +1 -1
- package/dist/board-kernel.js +665 -118
- package/dist/commands/boards/authoring.js +36 -2
- package/dist/commands/boards.js +1 -0
- package/dist/commands/referrals.js +7 -3
- package/dist/commands/space-displays.js +2 -0
- package/dist/commands/spaces.js +14 -1
- package/dist/session-status.js +2 -0
- package/package.json +2 -2
package/dist/board-kernel.js
CHANGED
|
@@ -5683,6 +5683,10 @@ const BOARD_DEFAULT_SIZES$1 = {
|
|
|
5683
5683
|
width: 480,
|
|
5684
5684
|
height: 270
|
|
5685
5685
|
},
|
|
5686
|
+
session: {
|
|
5687
|
+
width: 320,
|
|
5688
|
+
height: 176
|
|
5689
|
+
},
|
|
5686
5690
|
effect: {
|
|
5687
5691
|
width: 240,
|
|
5688
5692
|
height: 240
|
|
@@ -5896,7 +5900,7 @@ const BoardFrameItemSchema$1 = object({
|
|
|
5896
5900
|
type: literal("frame"),
|
|
5897
5901
|
props: object({
|
|
5898
5902
|
label: string().max(280).default(""),
|
|
5899
|
-
decoration: _enum(["frame", "none"]).optional().describe("none hides the title, border and background: an invisible group whose tracks move every child."),
|
|
5903
|
+
decoration: _enum(["frame", "none"]).optional().describe("none hides the title, border and background: an invisible group whose tracks move every child; with a label it is also a page viewers step to."),
|
|
5900
5904
|
clip: boolean().default(true).describe("Hide children outside the frame.")
|
|
5901
5905
|
}).strict().prefault({})
|
|
5902
5906
|
}).strict();
|
|
@@ -6096,6 +6100,22 @@ const BoardTaskItemSchema$1 = object({
|
|
|
6096
6100
|
snapshot: BoardTaskSnapshotSchema$1.describe("Maintained by the server; omit it.")
|
|
6097
6101
|
}).strict()
|
|
6098
6102
|
}).strict();
|
|
6103
|
+
const BoardSessionSnapshotSchema$1 = object({
|
|
6104
|
+
title: string().max(255).default(""),
|
|
6105
|
+
excerpt: string().max(480).optional().describe("The latest message as plain text."),
|
|
6106
|
+
source: string().max(120).optional().describe("Where the chat runs: web, cli or a channel."),
|
|
6107
|
+
issue: _enum(["failed", "lost"]).optional().describe("How the last run ended when it did not finish."),
|
|
6108
|
+
errorExcerpt: string().max(240).optional(),
|
|
6109
|
+
activityAt: string().max(64).optional()
|
|
6110
|
+
}).strict();
|
|
6111
|
+
const BoardSessionItemSchema$1 = object({
|
|
6112
|
+
...boxed$1(BOARD_DEFAULT_SIZES$1.session),
|
|
6113
|
+
type: literal("session"),
|
|
6114
|
+
props: object({
|
|
6115
|
+
sessionId: string().min(1).max(160).describe("The chat shown; the server keeps its title, latest message and status up to date."),
|
|
6116
|
+
snapshot: BoardSessionSnapshotSchema$1.describe("Maintained by the server; omit it.")
|
|
6117
|
+
}).strict()
|
|
6118
|
+
}).strict();
|
|
6099
6119
|
const BOARD_EFFECT_KINDS$1 = [
|
|
6100
6120
|
"particles",
|
|
6101
6121
|
"trail",
|
|
@@ -6150,6 +6170,7 @@ const BOARD_ITEM_SCHEMAS$1 = {
|
|
|
6150
6170
|
audio: BoardAudioItemSchema$1,
|
|
6151
6171
|
file: BoardFileItemSchema$1,
|
|
6152
6172
|
task: BoardTaskItemSchema$1,
|
|
6173
|
+
session: BoardSessionItemSchema$1,
|
|
6153
6174
|
effect: BoardEffectItemSchema$1,
|
|
6154
6175
|
custom: BoardCustomItemSchema$1
|
|
6155
6176
|
};
|
|
@@ -9798,6 +9819,100 @@ function fileCategoryAccent(category, palette) {
|
|
|
9798
9819
|
}
|
|
9799
9820
|
}
|
|
9800
9821
|
//#endregion
|
|
9822
|
+
//#region ../sdk/src/board/model/frames.ts
|
|
9823
|
+
const SAME_ROW = .5;
|
|
9824
|
+
const CROSS_WEIGHT = 2;
|
|
9825
|
+
const CENTER_WEIGHT = .1;
|
|
9826
|
+
function boardNavigableFrames(scene) {
|
|
9827
|
+
const frames = [];
|
|
9828
|
+
const visit = (ids) => {
|
|
9829
|
+
for (const id of ids) {
|
|
9830
|
+
const item = scene.get(id);
|
|
9831
|
+
if (item?.type !== "frame") continue;
|
|
9832
|
+
if (item.props.decoration !== "none" || item.props.label.trim()) frames.push(item);
|
|
9833
|
+
else visit(scene.children(id));
|
|
9834
|
+
}
|
|
9835
|
+
};
|
|
9836
|
+
visit(scene.children(void 0));
|
|
9837
|
+
return frames;
|
|
9838
|
+
}
|
|
9839
|
+
function boardFrameRegion(item) {
|
|
9840
|
+
const label = item.type === "frame" ? item.props.label.trim() : "";
|
|
9841
|
+
return {
|
|
9842
|
+
id: item.id,
|
|
9843
|
+
rect: itemBounds(item.frame),
|
|
9844
|
+
...label ? { label } : {}
|
|
9845
|
+
};
|
|
9846
|
+
}
|
|
9847
|
+
function boardFrameRegions(scene) {
|
|
9848
|
+
return boardReadingOrder(boardNavigableFrames(scene).map(boardFrameRegion));
|
|
9849
|
+
}
|
|
9850
|
+
const byId = (a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
|
9851
|
+
function boardReadingOrder(regions) {
|
|
9852
|
+
const sorted = [...regions].sort((a, b) => a.rect.y - b.rect.y || a.rect.x - b.rect.x || byId(a, b));
|
|
9853
|
+
const rows = [];
|
|
9854
|
+
for (const region of sorted) {
|
|
9855
|
+
const { y, height } = region.rect;
|
|
9856
|
+
const row = rows.at(-1);
|
|
9857
|
+
const overlap = row ? Math.min(row.bottom, y + height) - Math.max(row.top, y) : -1;
|
|
9858
|
+
if (row && overlap >= SAME_ROW * Math.min(height, row.bottom - row.top)) row.regions.push(region);
|
|
9859
|
+
else rows.push({
|
|
9860
|
+
top: y,
|
|
9861
|
+
bottom: y + height,
|
|
9862
|
+
regions: [region]
|
|
9863
|
+
});
|
|
9864
|
+
}
|
|
9865
|
+
return rows.flatMap((row) => row.regions.sort((a, b) => a.rect.x - b.rect.x || a.rect.y - b.rect.y || byId(a, b)));
|
|
9866
|
+
}
|
|
9867
|
+
function axis(rect, horizontal) {
|
|
9868
|
+
return horizontal ? {
|
|
9869
|
+
start: rect.x,
|
|
9870
|
+
end: rect.x + rect.width,
|
|
9871
|
+
crossStart: rect.y,
|
|
9872
|
+
crossEnd: rect.y + rect.height
|
|
9873
|
+
} : {
|
|
9874
|
+
start: rect.y,
|
|
9875
|
+
end: rect.y + rect.height,
|
|
9876
|
+
crossStart: rect.x,
|
|
9877
|
+
crossEnd: rect.x + rect.width
|
|
9878
|
+
};
|
|
9879
|
+
}
|
|
9880
|
+
/** Left and right stay within regions sharing some height; up and down may reach regions offset sideways. */
|
|
9881
|
+
function boardRegionNeighbor(regions, from, direction) {
|
|
9882
|
+
const horizontal = direction === "left" || direction === "right";
|
|
9883
|
+
const sign = direction === "right" || direction === "down" ? 1 : -1;
|
|
9884
|
+
const origin = axis(from.rect, horizontal);
|
|
9885
|
+
const center = (origin.start + origin.end) / 2;
|
|
9886
|
+
const crossCenter = (origin.crossStart + origin.crossEnd) / 2;
|
|
9887
|
+
let best = null;
|
|
9888
|
+
let bestScore = Number.POSITIVE_INFINITY;
|
|
9889
|
+
for (const region of regions) {
|
|
9890
|
+
if (region.id === from.id) continue;
|
|
9891
|
+
const other = axis(region.rect, horizontal);
|
|
9892
|
+
if (!(sign > 0 ? other.end > origin.end && other.start + other.end > center * 2 : other.start < origin.start && other.start + other.end < center * 2)) continue;
|
|
9893
|
+
const gap = Math.max(0, sign > 0 ? other.start - origin.end : origin.start - other.end);
|
|
9894
|
+
const cross = Math.max(0, other.crossStart - origin.crossEnd, origin.crossStart - other.crossEnd);
|
|
9895
|
+
if (horizontal && cross > 0) continue;
|
|
9896
|
+
const drift = Math.abs((other.crossStart + other.crossEnd) / 2 - crossCenter);
|
|
9897
|
+
const score = gap + CROSS_WEIGHT * cross + CENTER_WEIGHT * drift;
|
|
9898
|
+
if (score < bestScore) {
|
|
9899
|
+
best = region;
|
|
9900
|
+
bestScore = score;
|
|
9901
|
+
}
|
|
9902
|
+
}
|
|
9903
|
+
return best;
|
|
9904
|
+
}
|
|
9905
|
+
function boardRegionStep(regions, from, step) {
|
|
9906
|
+
const index = regions.findIndex((region) => region.id === from.id);
|
|
9907
|
+
switch (step) {
|
|
9908
|
+
case "next": return index < 0 ? null : regions[index + 1] ?? null;
|
|
9909
|
+
case "previous": return index > 0 ? regions[index - 1] ?? null : null;
|
|
9910
|
+
case "first": return regions[0] ?? null;
|
|
9911
|
+
case "last": return regions.at(-1) ?? null;
|
|
9912
|
+
default: return boardRegionNeighbor(regions, from, step) ?? (step === "right" ? boardRegionStep(regions, from, "next") : step === "left" ? boardRegionStep(regions, from, "previous") : null);
|
|
9913
|
+
}
|
|
9914
|
+
}
|
|
9915
|
+
//#endregion
|
|
9801
9916
|
//#region ../sdk/src/board/model/themes.ts
|
|
9802
9917
|
const BOARD_THEME_DATA = {
|
|
9803
9918
|
dark: {
|
|
@@ -9808,6 +9923,9 @@ const BOARD_THEME_DATA = {
|
|
|
9808
9923
|
hover: 2500907,
|
|
9809
9924
|
border: 3158838,
|
|
9810
9925
|
brand: 14564909,
|
|
9926
|
+
activity: 14564909,
|
|
9927
|
+
error: 15950429,
|
|
9928
|
+
warning: 15580004,
|
|
9811
9929
|
text: 15330286,
|
|
9812
9930
|
muted: 10198947,
|
|
9813
9931
|
rare: 6009047,
|
|
@@ -9877,6 +9995,9 @@ const BOARD_THEME_DATA = {
|
|
|
9877
9995
|
hover: 15330029,
|
|
9878
9996
|
border: 14409442,
|
|
9879
9997
|
brand: 13582898,
|
|
9998
|
+
activity: 13582898,
|
|
9999
|
+
error: 10165794,
|
|
10000
|
+
warning: 8804608,
|
|
9880
10001
|
text: 66050,
|
|
9881
10002
|
muted: 6251625,
|
|
9882
10003
|
rare: 24458,
|
|
@@ -9946,6 +10067,9 @@ const BOARD_THEME_DATA = {
|
|
|
9946
10067
|
hover: 1057828,
|
|
9947
10068
|
border: 1582887,
|
|
9948
10069
|
brand: 34240,
|
|
10070
|
+
activity: 34240,
|
|
10071
|
+
error: 15950429,
|
|
10072
|
+
warning: 14790474,
|
|
9949
10073
|
text: 12572374,
|
|
9950
10074
|
muted: 6848639,
|
|
9951
10075
|
rare: 2206648,
|
|
@@ -10015,6 +10139,9 @@ const BOARD_THEME_DATA = {
|
|
|
10015
10139
|
hover: 15920337,
|
|
10016
10140
|
border: 14341313,
|
|
10017
10141
|
brand: 31924,
|
|
10142
|
+
activity: 31924,
|
|
10143
|
+
error: 10363429,
|
|
10144
|
+
warning: 8936704,
|
|
10018
10145
|
text: 2110772,
|
|
10019
10146
|
muted: 5860973,
|
|
10020
10147
|
rare: 28541,
|
|
@@ -10084,6 +10211,9 @@ const BOARD_THEME_DATA = {
|
|
|
10084
10211
|
hover: 1973788,
|
|
10085
10212
|
border: 1842202,
|
|
10086
10213
|
brand: 3900150,
|
|
10214
|
+
activity: 15524306,
|
|
10215
|
+
error: 15562341,
|
|
10216
|
+
warning: 15449187,
|
|
10087
10217
|
text: 16314853,
|
|
10088
10218
|
muted: 7630695,
|
|
10089
10219
|
rare: 9235170,
|
|
@@ -10150,6 +10280,9 @@ const BOARD_THEME_DATA = {
|
|
|
10150
10280
|
hover: 16185078,
|
|
10151
10281
|
border: 15527149,
|
|
10152
10282
|
brand: 1824230,
|
|
10283
|
+
activity: 434355,
|
|
10284
|
+
error: 13705029,
|
|
10285
|
+
warning: 9725440,
|
|
10153
10286
|
text: 1447704,
|
|
10154
10287
|
muted: 7566452,
|
|
10155
10288
|
rare: 31378,
|
|
@@ -10241,6 +10374,9 @@ const BOARD_THEME_DATA = {
|
|
|
10241
10374
|
hover: 2237220,
|
|
10242
10375
|
border: 2763565,
|
|
10243
10376
|
brand: 1824230,
|
|
10377
|
+
activity: 3142143,
|
|
10378
|
+
error: 16740488,
|
|
10379
|
+
warning: 16766287,
|
|
10244
10380
|
text: 16185078,
|
|
10245
10381
|
muted: 9079436,
|
|
10246
10382
|
rare: 1824230,
|
|
@@ -31562,7 +31698,7 @@ const CLOSE = 2;
|
|
|
31562
31698
|
const MIDDLE = 3;
|
|
31563
31699
|
const OPEN_NARROW = 4;
|
|
31564
31700
|
const CLOSE_NARROW = 5;
|
|
31565
|
-
const DOT = 6;
|
|
31701
|
+
const DOT$1 = 6;
|
|
31566
31702
|
const COLON = 7;
|
|
31567
31703
|
const SEMICOLON = 8;
|
|
31568
31704
|
const OPEN_QUOTE = 9;
|
|
@@ -31586,7 +31722,7 @@ function getStaticCharType(text, index) {
|
|
|
31586
31722
|
case 12289:
|
|
31587
31723
|
case 12290:
|
|
31588
31724
|
case 65292:
|
|
31589
|
-
case 65294: return DOT;
|
|
31725
|
+
case 65294: return DOT$1;
|
|
31590
31726
|
case 65306: return COLON;
|
|
31591
31727
|
case 65307: return SEMICOLON;
|
|
31592
31728
|
case 183:
|
|
@@ -31676,7 +31812,7 @@ function getFontData(measurement) {
|
|
|
31676
31812
|
function getCharType(data, text, index) {
|
|
31677
31813
|
const type = getStaticCharType(text, index);
|
|
31678
31814
|
switch (type) {
|
|
31679
|
-
case DOT: return data.typeForDot;
|
|
31815
|
+
case DOT$1: return data.typeForDot;
|
|
31680
31816
|
case COLON: return data.typeForColon;
|
|
31681
31817
|
case SEMICOLON: return data.typeForSemicolon;
|
|
31682
31818
|
case OPEN_QUOTE: return data.quoteFullwidth ? OPEN : OPEN_NARROW;
|
|
@@ -33381,12 +33517,12 @@ function syncTextResolution(text, resolution) {
|
|
|
33381
33517
|
if (text.resolution !== next) text.resolution = next;
|
|
33382
33518
|
}
|
|
33383
33519
|
const ICON = 12;
|
|
33384
|
-
const GAP$
|
|
33520
|
+
const GAP$3 = 5;
|
|
33385
33521
|
const MAX_GROWTH = 1.25;
|
|
33386
33522
|
const MIN_READABLE = 7;
|
|
33387
|
-
const SECOND$
|
|
33523
|
+
const SECOND$2 = 1e3;
|
|
33388
33524
|
function formatBoardDuration(ms) {
|
|
33389
|
-
const total = Math.max(0, Math.floor(ms / SECOND$
|
|
33525
|
+
const total = Math.max(0, Math.floor(ms / SECOND$2));
|
|
33390
33526
|
const hours = Math.floor(total / 3600);
|
|
33391
33527
|
const minutes = Math.floor(total % 3600 / 60);
|
|
33392
33528
|
const seconds = String(total % 60).padStart(2, "0");
|
|
@@ -33440,6 +33576,14 @@ const PIXEL_GLYPHS = {
|
|
|
33440
33576
|
".###..",
|
|
33441
33577
|
"..#...",
|
|
33442
33578
|
"......"
|
|
33579
|
+
],
|
|
33580
|
+
session: [
|
|
33581
|
+
"######",
|
|
33582
|
+
"#....#",
|
|
33583
|
+
"#....#",
|
|
33584
|
+
"######",
|
|
33585
|
+
"##....",
|
|
33586
|
+
"#....."
|
|
33443
33587
|
]
|
|
33444
33588
|
};
|
|
33445
33589
|
function drawLineGlyph(graphics, glyph, color) {
|
|
@@ -33513,6 +33657,24 @@ function drawLineGlyph(graphics, glyph, color) {
|
|
|
33513
33657
|
4.7
|
|
33514
33658
|
]).fill({ color });
|
|
33515
33659
|
return;
|
|
33660
|
+
case "session":
|
|
33661
|
+
graphics.poly([
|
|
33662
|
+
1.5,
|
|
33663
|
+
2,
|
|
33664
|
+
10.5,
|
|
33665
|
+
2,
|
|
33666
|
+
10.5,
|
|
33667
|
+
8.5,
|
|
33668
|
+
6,
|
|
33669
|
+
8.5,
|
|
33670
|
+
3.5,
|
|
33671
|
+
10.5,
|
|
33672
|
+
3.5,
|
|
33673
|
+
8.5,
|
|
33674
|
+
1.5,
|
|
33675
|
+
8.5
|
|
33676
|
+
], true).stroke(line);
|
|
33677
|
+
return;
|
|
33516
33678
|
}
|
|
33517
33679
|
}
|
|
33518
33680
|
function traceCube(graphics, cx, cy, radius) {
|
|
@@ -33600,7 +33762,7 @@ function syncCardTag(tag, input, context) {
|
|
|
33600
33762
|
drawCardGlyph(tag.icon.clear(), input.glyph, color, pixel);
|
|
33601
33763
|
tag.text.style.fill = color;
|
|
33602
33764
|
tag.text.style.fontFamily = context.style.font;
|
|
33603
|
-
fitTextToWidth(tag.text, input.text, Math.max(1, input.width - ICON - GAP$
|
|
33765
|
+
fitTextToWidth(tag.text, input.text, Math.max(1, input.width - ICON - GAP$3));
|
|
33604
33766
|
tag.text.position.set(17, (ICON - tag.text.height) / 2);
|
|
33605
33767
|
}
|
|
33606
33768
|
syncTextResolution(tag.text, context.textResolution * tagScale(context.zoom));
|
|
@@ -34092,9 +34254,9 @@ function drawModelKey(graphics, cx, cy, radius, context) {
|
|
|
34092
34254
|
cap: "round"
|
|
34093
34255
|
});
|
|
34094
34256
|
}
|
|
34095
|
-
const GAP$
|
|
34257
|
+
const GAP$2 = 12;
|
|
34096
34258
|
const WAVE_HEIGHT = 16;
|
|
34097
|
-
const partsByContainer$
|
|
34259
|
+
const partsByContainer$14 = /* @__PURE__ */ new WeakMap();
|
|
34098
34260
|
function audioKeyCenter(width, height) {
|
|
34099
34261
|
const radius = Math.min(16, Math.max(8, height / 2 - 8), width / 4);
|
|
34100
34262
|
return {
|
|
@@ -34103,8 +34265,8 @@ function audioKeyCenter(width, height) {
|
|
|
34103
34265
|
radius
|
|
34104
34266
|
};
|
|
34105
34267
|
}
|
|
34106
|
-
function sync$
|
|
34107
|
-
const parts = partsByContainer$
|
|
34268
|
+
function sync$14(container, item, context) {
|
|
34269
|
+
const parts = partsByContainer$14.get(container);
|
|
34108
34270
|
if (!parts) return;
|
|
34109
34271
|
syncContent$1(parts, item, context);
|
|
34110
34272
|
syncTextResolution(parts.title, context.textResolution);
|
|
@@ -34142,7 +34304,7 @@ function syncContent$1(parts, item, context) {
|
|
|
34142
34304
|
});
|
|
34143
34305
|
const key = audioKeyCenter(width, height);
|
|
34144
34306
|
drawMediaPlayKey(parts.plate, key.x, key.y, key.radius, context, true);
|
|
34145
|
-
const left = key.x + key.radius + GAP$
|
|
34307
|
+
const left = key.x + key.radius + GAP$2;
|
|
34146
34308
|
const room = width - 14 - left;
|
|
34147
34309
|
parts.title.visible = detailed && room > 24;
|
|
34148
34310
|
parts.wave.clear();
|
|
@@ -34177,21 +34339,21 @@ const audioCardRenderer = {
|
|
|
34177
34339
|
roundPixels: true
|
|
34178
34340
|
});
|
|
34179
34341
|
root.addChild(plate, wave, title);
|
|
34180
|
-
partsByContainer$
|
|
34342
|
+
partsByContainer$14.set(root, {
|
|
34181
34343
|
root,
|
|
34182
34344
|
plate,
|
|
34183
34345
|
wave,
|
|
34184
34346
|
title,
|
|
34185
34347
|
sig: ""
|
|
34186
34348
|
});
|
|
34187
|
-
if (item.type === "audio") sync$
|
|
34349
|
+
if (item.type === "audio") sync$14(root, item, context);
|
|
34188
34350
|
return root;
|
|
34189
34351
|
},
|
|
34190
34352
|
update: (container, item, context) => {
|
|
34191
|
-
if (item.type === "audio") sync$
|
|
34353
|
+
if (item.type === "audio") sync$14(container, item, context);
|
|
34192
34354
|
},
|
|
34193
34355
|
resolution: (container, item, context) => {
|
|
34194
|
-
if (item.type === "audio") sync$
|
|
34356
|
+
if (item.type === "audio") sync$14(container, item, context);
|
|
34195
34357
|
},
|
|
34196
34358
|
renderFar: (graphics, item, context) => {
|
|
34197
34359
|
drawFarPlate(graphics, item.frame, {
|
|
@@ -34202,13 +34364,13 @@ const audioCardRenderer = {
|
|
|
34202
34364
|
});
|
|
34203
34365
|
},
|
|
34204
34366
|
destroy: (container) => {
|
|
34205
|
-
partsByContainer$
|
|
34206
|
-
partsByContainer$
|
|
34367
|
+
partsByContainer$14.get(container)?.root.destroy({ children: true });
|
|
34368
|
+
partsByContainer$14.delete(container);
|
|
34207
34369
|
}
|
|
34208
34370
|
};
|
|
34209
34371
|
//#endregion
|
|
34210
34372
|
//#region ../sdk/src/board/render/renderers/model-card-renderer.ts
|
|
34211
|
-
const partsByContainer$
|
|
34373
|
+
const partsByContainer$13 = /* @__PURE__ */ new WeakMap();
|
|
34212
34374
|
const INSET_RATIO = .06;
|
|
34213
34375
|
const KEY_RADIUS = 14;
|
|
34214
34376
|
const KEY_MARGIN = 10;
|
|
@@ -34221,8 +34383,8 @@ function modelKeyCenter(width, height) {
|
|
|
34221
34383
|
radius
|
|
34222
34384
|
};
|
|
34223
34385
|
}
|
|
34224
|
-
function sync$
|
|
34225
|
-
const parts = partsByContainer$
|
|
34386
|
+
function sync$13(container, item, context) {
|
|
34387
|
+
const parts = partsByContainer$13.get(container);
|
|
34226
34388
|
if (!parts) return;
|
|
34227
34389
|
positionShell(parts.root, item);
|
|
34228
34390
|
const { width, height } = item.frame;
|
|
@@ -34296,7 +34458,7 @@ const modelCardRenderer = {
|
|
|
34296
34458
|
const chrome = new Graphics();
|
|
34297
34459
|
const tag = createCardTag();
|
|
34298
34460
|
root.addChild(plate, sprite, chrome, tag.root);
|
|
34299
|
-
partsByContainer$
|
|
34461
|
+
partsByContainer$13.set(root, {
|
|
34300
34462
|
root,
|
|
34301
34463
|
plate,
|
|
34302
34464
|
sprite,
|
|
@@ -34304,17 +34466,17 @@ const modelCardRenderer = {
|
|
|
34304
34466
|
tag,
|
|
34305
34467
|
sig: ""
|
|
34306
34468
|
});
|
|
34307
|
-
if (item.type === "file") sync$
|
|
34469
|
+
if (item.type === "file") sync$13(root, item, context);
|
|
34308
34470
|
return root;
|
|
34309
34471
|
},
|
|
34310
34472
|
update: (container, item, context) => {
|
|
34311
|
-
if (item.type === "file") sync$
|
|
34473
|
+
if (item.type === "file") sync$13(container, item, context);
|
|
34312
34474
|
},
|
|
34313
34475
|
resolution: (container, item, context) => {
|
|
34314
|
-
if (item.type === "file") sync$
|
|
34476
|
+
if (item.type === "file") sync$13(container, item, context);
|
|
34315
34477
|
},
|
|
34316
34478
|
zoom: (container, zoom) => {
|
|
34317
|
-
const tag = partsByContainer$
|
|
34479
|
+
const tag = partsByContainer$13.get(container)?.tag;
|
|
34318
34480
|
if (tag) zoomCardTag(tag, zoom);
|
|
34319
34481
|
},
|
|
34320
34482
|
renderFar: (graphics, item, context) => {
|
|
@@ -34326,8 +34488,8 @@ const modelCardRenderer = {
|
|
|
34326
34488
|
});
|
|
34327
34489
|
},
|
|
34328
34490
|
destroy: (container) => {
|
|
34329
|
-
partsByContainer$
|
|
34330
|
-
partsByContainer$
|
|
34491
|
+
partsByContainer$13.get(container)?.root.destroy({ children: true });
|
|
34492
|
+
partsByContainer$13.delete(container);
|
|
34331
34493
|
}
|
|
34332
34494
|
};
|
|
34333
34495
|
//#endregion
|
|
@@ -34390,9 +34552,9 @@ function arrowLabelAnchor(arrow, style) {
|
|
|
34390
34552
|
}
|
|
34391
34553
|
//#endregion
|
|
34392
34554
|
//#region ../sdk/src/board/render/renderers/arrow-card-renderer.ts
|
|
34393
|
-
const partsByContainer$
|
|
34394
|
-
function sync$
|
|
34395
|
-
const parts = partsByContainer$
|
|
34555
|
+
const partsByContainer$12 = /* @__PURE__ */ new WeakMap();
|
|
34556
|
+
function sync$12(container, item, context) {
|
|
34557
|
+
const parts = partsByContainer$12.get(container);
|
|
34396
34558
|
if (!parts) return;
|
|
34397
34559
|
parts.root.position.set(0, 0);
|
|
34398
34560
|
parts.root.rotation = 0;
|
|
@@ -34496,7 +34658,7 @@ const arrowCardRenderer = {
|
|
|
34496
34658
|
label.anchor.set(.5);
|
|
34497
34659
|
const backdrop = new Graphics();
|
|
34498
34660
|
root.addChild(line, backdrop, label);
|
|
34499
|
-
partsByContainer$
|
|
34661
|
+
partsByContainer$12.set(root, {
|
|
34500
34662
|
root,
|
|
34501
34663
|
line,
|
|
34502
34664
|
backdrop,
|
|
@@ -34504,14 +34666,14 @@ const arrowCardRenderer = {
|
|
|
34504
34666
|
lineSig: "",
|
|
34505
34667
|
labelSig: ""
|
|
34506
34668
|
});
|
|
34507
|
-
if (item.type === "arrow") sync$
|
|
34669
|
+
if (item.type === "arrow") sync$12(root, item, context);
|
|
34508
34670
|
return root;
|
|
34509
34671
|
},
|
|
34510
34672
|
update: (container, item, context) => {
|
|
34511
|
-
if (item.type === "arrow") sync$
|
|
34673
|
+
if (item.type === "arrow") sync$12(container, item, context);
|
|
34512
34674
|
},
|
|
34513
34675
|
resolution: (container, _item, context) => {
|
|
34514
|
-
const parts = partsByContainer$
|
|
34676
|
+
const parts = partsByContainer$12.get(container);
|
|
34515
34677
|
if (parts) syncTextResolution(parts.label, context.textResolution);
|
|
34516
34678
|
},
|
|
34517
34679
|
renderFar: (graphics, item, context) => {
|
|
@@ -34524,13 +34686,13 @@ const arrowCardRenderer = {
|
|
|
34524
34686
|
});
|
|
34525
34687
|
},
|
|
34526
34688
|
destroy: (container) => {
|
|
34527
|
-
partsByContainer$
|
|
34528
|
-
partsByContainer$
|
|
34689
|
+
partsByContainer$12.get(container)?.root.destroy({ children: true });
|
|
34690
|
+
partsByContainer$12.delete(container);
|
|
34529
34691
|
}
|
|
34530
34692
|
};
|
|
34531
34693
|
//#endregion
|
|
34532
34694
|
//#region ../sdk/src/board/render/renderers/draw-card-renderer.ts
|
|
34533
|
-
const partsByContainer$
|
|
34695
|
+
const partsByContainer$11 = /* @__PURE__ */ new WeakMap();
|
|
34534
34696
|
function fillRibbon(graphics, ribbon, color) {
|
|
34535
34697
|
const { positions, indices } = ribbon;
|
|
34536
34698
|
for (let offset = 0; offset < indices.length; offset += 3) {
|
|
@@ -34581,8 +34743,8 @@ function tessellate(parts, points, size, paint) {
|
|
|
34581
34743
|
texture: Texture.WHITE
|
|
34582
34744
|
}));
|
|
34583
34745
|
}
|
|
34584
|
-
function sync$
|
|
34585
|
-
const parts = partsByContainer$
|
|
34746
|
+
function sync$11(container, item, context) {
|
|
34747
|
+
const parts = partsByContainer$11.get(container);
|
|
34586
34748
|
if (!parts) return;
|
|
34587
34749
|
positionShell(parts.root, item);
|
|
34588
34750
|
const { points } = item.props;
|
|
@@ -34615,7 +34777,7 @@ const drawCardRenderer = {
|
|
|
34615
34777
|
canRender: (item) => item.type === "draw",
|
|
34616
34778
|
create: (item, context) => {
|
|
34617
34779
|
const root = new Container();
|
|
34618
|
-
partsByContainer$
|
|
34780
|
+
partsByContainer$11.set(root, {
|
|
34619
34781
|
root,
|
|
34620
34782
|
stroke: null,
|
|
34621
34783
|
ribbon: null,
|
|
@@ -34632,11 +34794,11 @@ const drawCardRenderer = {
|
|
|
34632
34794
|
height: 1
|
|
34633
34795
|
}
|
|
34634
34796
|
});
|
|
34635
|
-
if (item.type === "draw") sync$
|
|
34797
|
+
if (item.type === "draw") sync$11(root, item, context);
|
|
34636
34798
|
return root;
|
|
34637
34799
|
},
|
|
34638
34800
|
update: (container, item, context) => {
|
|
34639
|
-
if (item.type === "draw") sync$
|
|
34801
|
+
if (item.type === "draw") sync$11(container, item, context);
|
|
34640
34802
|
},
|
|
34641
34803
|
renderFar: (graphics, item, context) => {
|
|
34642
34804
|
if (item.type !== "draw") return;
|
|
@@ -34649,15 +34811,15 @@ const drawCardRenderer = {
|
|
|
34649
34811
|
});
|
|
34650
34812
|
},
|
|
34651
34813
|
destroy: (container) => {
|
|
34652
|
-
partsByContainer$
|
|
34653
|
-
partsByContainer$
|
|
34814
|
+
partsByContainer$11.get(container)?.root.destroy({ children: true });
|
|
34815
|
+
partsByContainer$11.delete(container);
|
|
34654
34816
|
}
|
|
34655
34817
|
};
|
|
34656
34818
|
//#endregion
|
|
34657
34819
|
//#region ../sdk/src/board/render/renderers/effect-card-renderer.ts
|
|
34658
34820
|
const BOARD_EFFECT_MAX_PARTICLES = 4e3;
|
|
34659
34821
|
const TRAIL_SAMPLES = 64;
|
|
34660
|
-
const partsByContainer$
|
|
34822
|
+
const partsByContainer$10 = /* @__PURE__ */ new WeakMap();
|
|
34661
34823
|
function hashString(value) {
|
|
34662
34824
|
let hash = 2166136261;
|
|
34663
34825
|
for (let index = 0; index < value.length; index += 1) {
|
|
@@ -34798,8 +34960,8 @@ function drawTrail(graphics, parts, item, context, color) {
|
|
|
34798
34960
|
});
|
|
34799
34961
|
}
|
|
34800
34962
|
}
|
|
34801
|
-
function sync$
|
|
34802
|
-
const parts = partsByContainer$
|
|
34963
|
+
function sync$10(container, item, context) {
|
|
34964
|
+
const parts = partsByContainer$10.get(container);
|
|
34803
34965
|
if (!parts) return;
|
|
34804
34966
|
positionShell(parts.root, item);
|
|
34805
34967
|
const { width, height } = item.frame;
|
|
@@ -34834,16 +34996,16 @@ const effectCardRenderer = {
|
|
|
34834
34996
|
const root = new Container();
|
|
34835
34997
|
const graphics = new Graphics();
|
|
34836
34998
|
root.addChild(graphics);
|
|
34837
|
-
partsByContainer$
|
|
34999
|
+
partsByContainer$10.set(root, {
|
|
34838
35000
|
root,
|
|
34839
35001
|
graphics,
|
|
34840
35002
|
trail: []
|
|
34841
35003
|
});
|
|
34842
|
-
if (item.type === "effect") sync$
|
|
35004
|
+
if (item.type === "effect") sync$10(root, item, context);
|
|
34843
35005
|
return root;
|
|
34844
35006
|
},
|
|
34845
35007
|
update: (container, item, context) => {
|
|
34846
|
-
if (item.type === "effect") sync$
|
|
35008
|
+
if (item.type === "effect") sync$10(container, item, context);
|
|
34847
35009
|
},
|
|
34848
35010
|
renderFar: (graphics, item, context) => {
|
|
34849
35011
|
if (item.type !== "effect") return;
|
|
@@ -34853,8 +35015,8 @@ const effectCardRenderer = {
|
|
|
34853
35015
|
});
|
|
34854
35016
|
},
|
|
34855
35017
|
destroy: (container) => {
|
|
34856
|
-
partsByContainer$
|
|
34857
|
-
partsByContainer$
|
|
35018
|
+
partsByContainer$10.get(container)?.root.destroy({ children: true });
|
|
35019
|
+
partsByContainer$10.delete(container);
|
|
34858
35020
|
}
|
|
34859
35021
|
};
|
|
34860
35022
|
//#endregion
|
|
@@ -34862,21 +35024,21 @@ const effectCardRenderer = {
|
|
|
34862
35024
|
const PADDING$1 = 10;
|
|
34863
35025
|
const COVER_RATIO = .56;
|
|
34864
35026
|
const MIN_BODY_FOR_COVER = 38;
|
|
34865
|
-
const TITLE_SIZE = 13;
|
|
34866
|
-
const TITLE_LINE = TITLE_SIZE * 1.35;
|
|
35027
|
+
const TITLE_SIZE$1 = 13;
|
|
35028
|
+
const TITLE_LINE$1 = TITLE_SIZE$1 * 1.35;
|
|
34867
35029
|
const TITLE_MAX_LINES = 2;
|
|
34868
|
-
const EXCERPT_SIZE = 11;
|
|
34869
|
-
const EXCERPT_LINE = EXCERPT_SIZE * 1.45;
|
|
34870
|
-
const EXCERPT_MAX_LINES = 3;
|
|
35030
|
+
const EXCERPT_SIZE$1 = 11;
|
|
35031
|
+
const EXCERPT_LINE$1 = EXCERPT_SIZE$1 * 1.45;
|
|
35032
|
+
const EXCERPT_MAX_LINES$1 = 3;
|
|
34871
35033
|
const TYPE_MARK_SIZE = 28;
|
|
34872
|
-
const GAP = 4;
|
|
35034
|
+
const GAP$1 = 4;
|
|
34873
35035
|
const STRIPE = 2;
|
|
34874
35036
|
const MAX_DASHES = 40;
|
|
34875
|
-
const partsByContainer$
|
|
35037
|
+
const partsByContainer$9 = /* @__PURE__ */ new WeakMap();
|
|
34876
35038
|
function detailFor(zoom) {
|
|
34877
35039
|
return boardCardDetailed(zoom) ? "full" : "title";
|
|
34878
35040
|
}
|
|
34879
|
-
function viewOf(item) {
|
|
35041
|
+
function viewOf$1(item) {
|
|
34880
35042
|
if (item.type === "file") {
|
|
34881
35043
|
const { src, snapshot } = item.props;
|
|
34882
35044
|
return {
|
|
@@ -34907,7 +35069,7 @@ function coverHeight(view, height) {
|
|
|
34907
35069
|
const ideal = Math.round(height * COVER_RATIO);
|
|
34908
35070
|
return Math.max(0, Math.min(ideal, height - MIN_BODY_FOR_COVER));
|
|
34909
35071
|
}
|
|
34910
|
-
function linesInRoom(room, lineHeight, max) {
|
|
35072
|
+
function linesInRoom$1(room, lineHeight, max) {
|
|
34911
35073
|
if (room < lineHeight * .85) return 0;
|
|
34912
35074
|
return Math.max(0, Math.min(max, Math.floor((room + .5) / lineHeight)));
|
|
34913
35075
|
}
|
|
@@ -34920,9 +35082,9 @@ function layoutCover(sprite, width, height, texture) {
|
|
|
34920
35082
|
function syncClip(parts, rect, style) {
|
|
34921
35083
|
traceCardOutline(parts.clip.clear(), rect, style).fill({ color: 16777215 });
|
|
34922
35084
|
}
|
|
34923
|
-
function sync$
|
|
34924
|
-
const parts = partsByContainer$
|
|
34925
|
-
const view = viewOf(item);
|
|
35085
|
+
function sync$9(container, item, context) {
|
|
35086
|
+
const parts = partsByContainer$9.get(container);
|
|
35087
|
+
const view = viewOf$1(item);
|
|
34926
35088
|
if (!parts || !view) return;
|
|
34927
35089
|
syncContent(parts, item, view, context);
|
|
34928
35090
|
for (const text of [
|
|
@@ -35037,9 +35199,9 @@ function syncContent(parts, item, view, context) {
|
|
|
35037
35199
|
if (parts.typeMark.text !== mark) parts.typeMark.text = mark;
|
|
35038
35200
|
parts.typeMark.position.set(PADDING$1, cursor);
|
|
35039
35201
|
parts.typeMark.visible = true;
|
|
35040
|
-
cursor += parts.typeMark.height + GAP;
|
|
35202
|
+
cursor += parts.typeMark.height + GAP$1;
|
|
35041
35203
|
} else parts.typeMark.visible = false;
|
|
35042
|
-
const titleLines = linesInRoom(Math.max(0, contentBottom - cursor), TITLE_LINE, TITLE_MAX_LINES);
|
|
35204
|
+
const titleLines = linesInRoom$1(Math.max(0, contentBottom - cursor), TITLE_LINE$1, TITLE_MAX_LINES);
|
|
35043
35205
|
parts.title.style.fill = context.palette.text;
|
|
35044
35206
|
fitTextToLines(parts.title, title, titleLines, innerWidth);
|
|
35045
35207
|
parts.title.position.set(PADDING$1, cursor);
|
|
@@ -35048,8 +35210,8 @@ function syncContent(parts, item, view, context) {
|
|
|
35048
35210
|
parts.excerpt.visible = false;
|
|
35049
35211
|
return;
|
|
35050
35212
|
}
|
|
35051
|
-
const excerptTop = cursor + (titleLines > 0 ? parts.title.height + GAP : 0);
|
|
35052
|
-
const excerptLines = linesInRoom(contentBottom - excerptTop, EXCERPT_LINE, EXCERPT_MAX_LINES);
|
|
35213
|
+
const excerptTop = cursor + (titleLines > 0 ? parts.title.height + GAP$1 : 0);
|
|
35214
|
+
const excerptLines = linesInRoom$1(contentBottom - excerptTop, EXCERPT_LINE$1, EXCERPT_MAX_LINES$1);
|
|
35053
35215
|
const showExcerpt = Boolean(excerpt) && excerptLines > 0;
|
|
35054
35216
|
if (showExcerpt) {
|
|
35055
35217
|
parts.excerpt.style.fill = context.palette.muted;
|
|
@@ -35075,9 +35237,9 @@ const fileCardRenderer = {
|
|
|
35075
35237
|
style: {
|
|
35076
35238
|
fill: context.palette.text,
|
|
35077
35239
|
fontFamily: BOARD_FONT_STACK,
|
|
35078
|
-
fontSize: TITLE_SIZE,
|
|
35240
|
+
fontSize: TITLE_SIZE$1,
|
|
35079
35241
|
fontWeight: "600",
|
|
35080
|
-
lineHeight: TITLE_LINE
|
|
35242
|
+
lineHeight: TITLE_LINE$1
|
|
35081
35243
|
},
|
|
35082
35244
|
resolution,
|
|
35083
35245
|
roundPixels: true
|
|
@@ -35087,9 +35249,9 @@ const fileCardRenderer = {
|
|
|
35087
35249
|
style: {
|
|
35088
35250
|
fill: context.palette.muted,
|
|
35089
35251
|
fontFamily: BOARD_FONT_STACK,
|
|
35090
|
-
fontSize: EXCERPT_SIZE,
|
|
35252
|
+
fontSize: EXCERPT_SIZE$1,
|
|
35091
35253
|
fontWeight: "400",
|
|
35092
|
-
lineHeight: EXCERPT_LINE
|
|
35254
|
+
lineHeight: EXCERPT_LINE$1
|
|
35093
35255
|
},
|
|
35094
35256
|
resolution,
|
|
35095
35257
|
roundPixels: true
|
|
@@ -35110,7 +35272,7 @@ const fileCardRenderer = {
|
|
|
35110
35272
|
body.addChild(cover, coverMask, typeMark, title, excerpt);
|
|
35111
35273
|
const tag = createCardTag();
|
|
35112
35274
|
root.addChild(plate, body, clip, tag.root);
|
|
35113
|
-
partsByContainer$
|
|
35275
|
+
partsByContainer$9.set(root, {
|
|
35114
35276
|
tag,
|
|
35115
35277
|
root,
|
|
35116
35278
|
plate,
|
|
@@ -35124,17 +35286,17 @@ const fileCardRenderer = {
|
|
|
35124
35286
|
visualSig: "",
|
|
35125
35287
|
textSig: ""
|
|
35126
35288
|
});
|
|
35127
|
-
sync$
|
|
35289
|
+
sync$9(root, item, context);
|
|
35128
35290
|
return root;
|
|
35129
35291
|
},
|
|
35130
|
-
update: sync$
|
|
35131
|
-
resolution: sync$
|
|
35292
|
+
update: sync$9,
|
|
35293
|
+
resolution: sync$9,
|
|
35132
35294
|
zoom: (container, zoom) => {
|
|
35133
|
-
const tag = partsByContainer$
|
|
35295
|
+
const tag = partsByContainer$9.get(container)?.tag;
|
|
35134
35296
|
if (tag) zoomCardTag(tag, zoom);
|
|
35135
35297
|
},
|
|
35136
35298
|
renderFar: (graphics, item, context) => {
|
|
35137
|
-
const category = viewOf(item)?.category ?? "other";
|
|
35299
|
+
const category = viewOf$1(item)?.category ?? "other";
|
|
35138
35300
|
drawFarPlate(graphics, item.frame, {
|
|
35139
35301
|
fill: farPictureTone(item, context) ?? context.palette.surface,
|
|
35140
35302
|
fillAlpha: .96,
|
|
@@ -35143,16 +35305,16 @@ const fileCardRenderer = {
|
|
|
35143
35305
|
});
|
|
35144
35306
|
},
|
|
35145
35307
|
destroy: (container) => {
|
|
35146
|
-
partsByContainer$
|
|
35147
|
-
partsByContainer$
|
|
35308
|
+
partsByContainer$9.get(container)?.root.destroy({ children: true });
|
|
35309
|
+
partsByContainer$9.delete(container);
|
|
35148
35310
|
}
|
|
35149
35311
|
};
|
|
35150
35312
|
//#endregion
|
|
35151
35313
|
//#region ../sdk/src/board/render/renderers/frame-card-renderer.ts
|
|
35152
|
-
const partsByContainer$
|
|
35314
|
+
const partsByContainer$8 = /* @__PURE__ */ new WeakMap();
|
|
35153
35315
|
const DEFAULT_WASH = .04;
|
|
35154
|
-
function sync$
|
|
35155
|
-
const parts = partsByContainer$
|
|
35316
|
+
function sync$8(container, item, context) {
|
|
35317
|
+
const parts = partsByContainer$8.get(container);
|
|
35156
35318
|
if (!parts) return;
|
|
35157
35319
|
const { frame, style, props, locked } = item;
|
|
35158
35320
|
positionShell(parts.root, item);
|
|
@@ -35231,21 +35393,21 @@ const frameCardRenderer = {
|
|
|
35231
35393
|
fontWeight: "600"
|
|
35232
35394
|
}, context.textResolution);
|
|
35233
35395
|
root.addChild(box, label);
|
|
35234
|
-
partsByContainer$
|
|
35396
|
+
partsByContainer$8.set(root, {
|
|
35235
35397
|
root,
|
|
35236
35398
|
box,
|
|
35237
35399
|
label,
|
|
35238
35400
|
visualSig: "",
|
|
35239
35401
|
textSig: ""
|
|
35240
35402
|
});
|
|
35241
|
-
if (item.type === "frame") sync$
|
|
35403
|
+
if (item.type === "frame") sync$8(root, item, context);
|
|
35242
35404
|
return root;
|
|
35243
35405
|
},
|
|
35244
35406
|
update: (container, item, context) => {
|
|
35245
|
-
if (item.type === "frame") sync$
|
|
35407
|
+
if (item.type === "frame") sync$8(container, item, context);
|
|
35246
35408
|
},
|
|
35247
35409
|
resolution: (container, _item, context) => {
|
|
35248
|
-
const parts = partsByContainer$
|
|
35410
|
+
const parts = partsByContainer$8.get(container);
|
|
35249
35411
|
if (parts) syncTextResolution(parts.label, context.textResolution);
|
|
35250
35412
|
},
|
|
35251
35413
|
renderFar: (graphics, item, context) => {
|
|
@@ -35256,14 +35418,14 @@ const frameCardRenderer = {
|
|
|
35256
35418
|
});
|
|
35257
35419
|
},
|
|
35258
35420
|
destroy: (container) => {
|
|
35259
|
-
partsByContainer$
|
|
35421
|
+
partsByContainer$8.delete(container);
|
|
35260
35422
|
container.destroy({ children: true });
|
|
35261
35423
|
}
|
|
35262
35424
|
};
|
|
35263
35425
|
//#endregion
|
|
35264
35426
|
//#region ../sdk/src/board/render/renderers/shape-card-renderer.ts
|
|
35265
35427
|
const DEFAULT_ROUNDED_RADIUS = 8;
|
|
35266
|
-
const partsByContainer$
|
|
35428
|
+
const partsByContainer$7 = /* @__PURE__ */ new WeakMap();
|
|
35267
35429
|
const pathCache = /* @__PURE__ */ new Map();
|
|
35268
35430
|
function parsedPath(d) {
|
|
35269
35431
|
if (pathCache.has(d)) return pathCache.get(d) ?? null;
|
|
@@ -35344,8 +35506,8 @@ function outlinePoints(geometry, width, height, radius) {
|
|
|
35344
35506
|
default: return roundRectPoints(width, height, radius);
|
|
35345
35507
|
}
|
|
35346
35508
|
}
|
|
35347
|
-
function sync$
|
|
35348
|
-
const parts = partsByContainer$
|
|
35509
|
+
function sync$7(container, item, context) {
|
|
35510
|
+
const parts = partsByContainer$7.get(container);
|
|
35349
35511
|
if (!parts) return;
|
|
35350
35512
|
positionShell(parts.root, item);
|
|
35351
35513
|
const { width, height } = item.frame;
|
|
@@ -35439,21 +35601,21 @@ const shapeCardRenderer = {
|
|
|
35439
35601
|
roundPixels: true
|
|
35440
35602
|
});
|
|
35441
35603
|
root.addChild(shape, label);
|
|
35442
|
-
partsByContainer$
|
|
35604
|
+
partsByContainer$7.set(root, {
|
|
35443
35605
|
root,
|
|
35444
35606
|
shape,
|
|
35445
35607
|
label,
|
|
35446
35608
|
visualSig: "",
|
|
35447
35609
|
textSig: ""
|
|
35448
35610
|
});
|
|
35449
|
-
if (item.type === "shape") sync$
|
|
35611
|
+
if (item.type === "shape") sync$7(root, item, context);
|
|
35450
35612
|
return root;
|
|
35451
35613
|
},
|
|
35452
35614
|
update: (container, item, context) => {
|
|
35453
|
-
if (item.type === "shape") sync$
|
|
35615
|
+
if (item.type === "shape") sync$7(container, item, context);
|
|
35454
35616
|
},
|
|
35455
35617
|
resolution: (container, _item, context) => {
|
|
35456
|
-
const parts = partsByContainer$
|
|
35618
|
+
const parts = partsByContainer$7.get(container);
|
|
35457
35619
|
if (parts) syncTextResolution(parts.label, context.textResolution);
|
|
35458
35620
|
},
|
|
35459
35621
|
renderFar: (graphics, item, context) => {
|
|
@@ -35466,16 +35628,16 @@ const shapeCardRenderer = {
|
|
|
35466
35628
|
});
|
|
35467
35629
|
},
|
|
35468
35630
|
destroy: (container) => {
|
|
35469
|
-
partsByContainer$
|
|
35470
|
-
partsByContainer$
|
|
35631
|
+
partsByContainer$7.get(container)?.root.destroy({ children: true });
|
|
35632
|
+
partsByContainer$7.delete(container);
|
|
35471
35633
|
}
|
|
35472
35634
|
};
|
|
35473
35635
|
//#endregion
|
|
35474
35636
|
//#region ../sdk/src/board/render/renderers/custom-card-renderer.ts
|
|
35475
|
-
const partsByContainer$
|
|
35637
|
+
const partsByContainer$6 = /* @__PURE__ */ new WeakMap();
|
|
35476
35638
|
const LABEL_LINE = 16;
|
|
35477
|
-
function sync$
|
|
35478
|
-
const parts = partsByContainer$
|
|
35639
|
+
function sync$6(container, item, context) {
|
|
35640
|
+
const parts = partsByContainer$6.get(container);
|
|
35479
35641
|
if (!parts) return;
|
|
35480
35642
|
if (parts.id !== item.id) {
|
|
35481
35643
|
context.scripts?.release(parts.id);
|
|
@@ -35535,7 +35697,7 @@ const customCardRenderer = {
|
|
|
35535
35697
|
});
|
|
35536
35698
|
label.anchor.set(.5);
|
|
35537
35699
|
root.addChild(sprite, placeholder, label);
|
|
35538
|
-
partsByContainer$
|
|
35700
|
+
partsByContainer$6.set(root, {
|
|
35539
35701
|
id: item.id,
|
|
35540
35702
|
root,
|
|
35541
35703
|
sprite,
|
|
@@ -35543,14 +35705,14 @@ const customCardRenderer = {
|
|
|
35543
35705
|
label,
|
|
35544
35706
|
sig: ""
|
|
35545
35707
|
});
|
|
35546
|
-
if (item.type === "custom") sync$
|
|
35708
|
+
if (item.type === "custom") sync$6(root, item, context);
|
|
35547
35709
|
return root;
|
|
35548
35710
|
},
|
|
35549
35711
|
update: (container, item, context) => {
|
|
35550
|
-
if (item.type === "custom") sync$
|
|
35712
|
+
if (item.type === "custom") sync$6(container, item, context);
|
|
35551
35713
|
},
|
|
35552
35714
|
resolution: (container, _item, context) => {
|
|
35553
|
-
const parts = partsByContainer$
|
|
35715
|
+
const parts = partsByContainer$6.get(container);
|
|
35554
35716
|
if (parts) syncTextResolution(parts.label, context.textResolution);
|
|
35555
35717
|
},
|
|
35556
35718
|
renderFar: (graphics, item, context) => {
|
|
@@ -35560,15 +35722,15 @@ const customCardRenderer = {
|
|
|
35560
35722
|
});
|
|
35561
35723
|
},
|
|
35562
35724
|
destroy: (container, context) => {
|
|
35563
|
-
const parts = partsByContainer$
|
|
35725
|
+
const parts = partsByContainer$6.get(container);
|
|
35564
35726
|
if (parts) context.scripts?.release(parts.id);
|
|
35565
35727
|
parts?.root.destroy({ children: true });
|
|
35566
|
-
partsByContainer$
|
|
35728
|
+
partsByContainer$6.delete(container);
|
|
35567
35729
|
}
|
|
35568
35730
|
};
|
|
35569
35731
|
//#endregion
|
|
35570
35732
|
//#region ../sdk/src/board/render/renderers/image-card-renderer.ts
|
|
35571
|
-
const partsByContainer$
|
|
35733
|
+
const partsByContainer$5 = /* @__PURE__ */ new WeakMap();
|
|
35572
35734
|
function cropRect(crop) {
|
|
35573
35735
|
if (!crop) return null;
|
|
35574
35736
|
const w = Math.min(crop.w, 1 - crop.x);
|
|
@@ -35583,8 +35745,8 @@ function cropRect(crop) {
|
|
|
35583
35745
|
const PRINT_MARGIN = 6;
|
|
35584
35746
|
const FADE_MS = 160;
|
|
35585
35747
|
const FAR_ALPHA = .9;
|
|
35586
|
-
function sync$
|
|
35587
|
-
const parts = partsByContainer$
|
|
35748
|
+
function sync$5(container, item, context) {
|
|
35749
|
+
const parts = partsByContainer$5.get(container);
|
|
35588
35750
|
if (!parts) return;
|
|
35589
35751
|
positionShell(parts.root, item);
|
|
35590
35752
|
const { width, height } = item.frame;
|
|
@@ -35674,7 +35836,7 @@ const imageCardRenderer = {
|
|
|
35674
35836
|
const placeholder = new Graphics();
|
|
35675
35837
|
const picture = new Graphics();
|
|
35676
35838
|
root.addChild(placeholder, picture);
|
|
35677
|
-
partsByContainer$
|
|
35839
|
+
partsByContainer$5.set(root, {
|
|
35678
35840
|
root,
|
|
35679
35841
|
placeholder,
|
|
35680
35842
|
picture,
|
|
@@ -35683,14 +35845,14 @@ const imageCardRenderer = {
|
|
|
35683
35845
|
fadeFrom: null,
|
|
35684
35846
|
clearSurface: false
|
|
35685
35847
|
});
|
|
35686
|
-
if (item.type === "image") sync$
|
|
35848
|
+
if (item.type === "image") sync$5(root, item, context);
|
|
35687
35849
|
return root;
|
|
35688
35850
|
},
|
|
35689
35851
|
update: (container, item, context) => {
|
|
35690
|
-
if (item.type === "image") sync$
|
|
35852
|
+
if (item.type === "image") sync$5(container, item, context);
|
|
35691
35853
|
},
|
|
35692
35854
|
tick: (container, clock) => {
|
|
35693
|
-
const parts = partsByContainer$
|
|
35855
|
+
const parts = partsByContainer$5.get(container);
|
|
35694
35856
|
if (parts?.fadeFrom == null) return null;
|
|
35695
35857
|
const progress = Math.min(1, Math.max(0, (clock - parts.fadeFrom) / FADE_MS));
|
|
35696
35858
|
parts.picture.alpha = 1 - (1 - progress) ** 3;
|
|
@@ -35706,6 +35868,367 @@ const imageCardRenderer = {
|
|
|
35706
35868
|
fillAlpha: FAR_ALPHA
|
|
35707
35869
|
});
|
|
35708
35870
|
},
|
|
35871
|
+
destroy: (container) => {
|
|
35872
|
+
partsByContainer$5.get(container)?.root.destroy({ children: true });
|
|
35873
|
+
partsByContainer$5.delete(container);
|
|
35874
|
+
}
|
|
35875
|
+
};
|
|
35876
|
+
//#endregion
|
|
35877
|
+
//#region ../sdk/src/board/render/renderers/session-card-renderer.ts
|
|
35878
|
+
const PAD_X = 14;
|
|
35879
|
+
const PAD_Y = 12;
|
|
35880
|
+
const TITLE_SIZE = 14;
|
|
35881
|
+
const TITLE_LINE = 19;
|
|
35882
|
+
const STATUS_SIZE = 11.5;
|
|
35883
|
+
const STATUS_LINE = 16;
|
|
35884
|
+
const EXCERPT_SIZE = 12;
|
|
35885
|
+
const EXCERPT_LINE = 18;
|
|
35886
|
+
const EXCERPT_MAX_LINES = 6;
|
|
35887
|
+
const MODEL_SIZE = 10;
|
|
35888
|
+
const MODEL_LINE = 14;
|
|
35889
|
+
const GAP = 6;
|
|
35890
|
+
const DOT = 4;
|
|
35891
|
+
const UNREAD = 6;
|
|
35892
|
+
const RING = 8;
|
|
35893
|
+
const UNAVAILABLE_ALPHA = .55;
|
|
35894
|
+
const SECOND$1 = 1e3;
|
|
35895
|
+
const WAVE_FRAME_MS = 150;
|
|
35896
|
+
const PIP_SCREEN = 6;
|
|
35897
|
+
const partsByContainer$4 = /* @__PURE__ */ new WeakMap();
|
|
35898
|
+
const pad = (value) => String(value).padStart(2, "0");
|
|
35899
|
+
function compactTime(value) {
|
|
35900
|
+
const date = value ? new Date(value) : null;
|
|
35901
|
+
if (!date || Number.isNaN(date.getTime())) return "";
|
|
35902
|
+
const now = /* @__PURE__ */ new Date();
|
|
35903
|
+
const time = `${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
35904
|
+
if (date.toDateString() === now.toDateString()) return time;
|
|
35905
|
+
const day = `${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
35906
|
+
return date.getFullYear() === now.getFullYear() ? `${day} ${time}` : `${date.getFullYear()}-${day}`;
|
|
35907
|
+
}
|
|
35908
|
+
function sourceName(source) {
|
|
35909
|
+
const key = source?.trim().toLowerCase().replace(/^channel[:_]/, "").split(":")[0] ?? "";
|
|
35910
|
+
if (!key || key === "web" || key === "web_app") return "";
|
|
35911
|
+
if (key === "cli") return "CLI";
|
|
35912
|
+
return key.charAt(0).toUpperCase() + key.slice(1).replace(/_/g, " ");
|
|
35913
|
+
}
|
|
35914
|
+
function snapshotView(item, context, unavailable) {
|
|
35915
|
+
const { snapshot } = item.props;
|
|
35916
|
+
const status = snapshot.issue ?? "idle";
|
|
35917
|
+
const excerpt = (status === "failed" ? snapshot.errorExcerpt : void 0) ?? snapshot.excerpt ?? null;
|
|
35918
|
+
const meta = unavailable ? context.labels.sessionUnavailable : [sourceName(snapshot.source), compactTime(snapshot.activityAt)].filter(Boolean).join(" · ");
|
|
35919
|
+
return {
|
|
35920
|
+
title: snapshot.title || excerpt || context.labels.sessionUntitled,
|
|
35921
|
+
excerpt: snapshot.title ? excerpt : null,
|
|
35922
|
+
meta,
|
|
35923
|
+
status: unavailable ? "idle" : status,
|
|
35924
|
+
label: unavailable ? "" : status === "failed" ? context.labels.failed : status === "lost" ? context.labels.sessionLost : "",
|
|
35925
|
+
startedAt: null,
|
|
35926
|
+
model: null,
|
|
35927
|
+
unread: false,
|
|
35928
|
+
unavailable
|
|
35929
|
+
};
|
|
35930
|
+
}
|
|
35931
|
+
function viewOf(item, context) {
|
|
35932
|
+
const live = context.session?.(item.props.sessionId) ?? null;
|
|
35933
|
+
if (live === "unavailable") return snapshotView(item, context, true);
|
|
35934
|
+
return live ? {
|
|
35935
|
+
...live,
|
|
35936
|
+
unavailable: false
|
|
35937
|
+
} : snapshotView(item, context, false);
|
|
35938
|
+
}
|
|
35939
|
+
function statusColor$1(status, context) {
|
|
35940
|
+
if (status === "running") return context.palette.activity;
|
|
35941
|
+
if (status === "failed") return context.palette.error;
|
|
35942
|
+
if (status === "lost") return context.palette.warning;
|
|
35943
|
+
return context.palette.muted;
|
|
35944
|
+
}
|
|
35945
|
+
function waveFor(status, context) {
|
|
35946
|
+
if (context.reducedMotion) return null;
|
|
35947
|
+
if (status === "running") return 1200;
|
|
35948
|
+
return status === "stopping" ? 2400 : null;
|
|
35949
|
+
}
|
|
35950
|
+
const RESTING_ALPHA = [
|
|
35951
|
+
1,
|
|
35952
|
+
.6,
|
|
35953
|
+
.32
|
|
35954
|
+
];
|
|
35955
|
+
function waveAlpha(index, clock, period) {
|
|
35956
|
+
const phase = ((clock - index * 150) % period + period) % period / period;
|
|
35957
|
+
return .32 + .68 * Math.max(0, Math.sin(phase * Math.PI * 2));
|
|
35958
|
+
}
|
|
35959
|
+
function drawDot(graphics, x, y, size, color, pixel) {
|
|
35960
|
+
graphics.clear();
|
|
35961
|
+
if (pixel) graphics.rect(x, y, size, size);
|
|
35962
|
+
else graphics.circle(x + size / 2, y + size / 2, size / 2);
|
|
35963
|
+
graphics.fill({ color });
|
|
35964
|
+
}
|
|
35965
|
+
function advance$1(parts, clock) {
|
|
35966
|
+
const { motion } = parts;
|
|
35967
|
+
let next = null;
|
|
35968
|
+
if (motion.wave) {
|
|
35969
|
+
const frame = Math.floor(clock / WAVE_FRAME_MS);
|
|
35970
|
+
if (frame !== motion.frame) {
|
|
35971
|
+
motion.frame = frame;
|
|
35972
|
+
const at = frame * WAVE_FRAME_MS;
|
|
35973
|
+
motion.wave.dots.forEach((dot, index) => {
|
|
35974
|
+
dot.alpha = waveAlpha(index, at, motion.wave.period);
|
|
35975
|
+
});
|
|
35976
|
+
}
|
|
35977
|
+
next = WAVE_FRAME_MS - clock % WAVE_FRAME_MS;
|
|
35978
|
+
}
|
|
35979
|
+
if (motion.startedAt !== null) {
|
|
35980
|
+
const elapsedMs = Date.now() - motion.startedAt;
|
|
35981
|
+
const elapsed = formatBoardDuration(elapsedMs);
|
|
35982
|
+
if (elapsed !== motion.elapsed) {
|
|
35983
|
+
motion.elapsed = elapsed;
|
|
35984
|
+
fitTextToWidth(parts.status, `${motion.label} · ${elapsed}`, motion.width);
|
|
35985
|
+
}
|
|
35986
|
+
const untilNextSecond = SECOND$1 - Math.max(0, elapsedMs) % SECOND$1;
|
|
35987
|
+
next = next === null ? untilNextSecond : Math.min(next, untilNextSecond);
|
|
35988
|
+
}
|
|
35989
|
+
return next;
|
|
35990
|
+
}
|
|
35991
|
+
function linesInRoom(room, lineHeight, max) {
|
|
35992
|
+
return room < lineHeight * .85 ? 0 : Math.max(0, Math.min(max, Math.floor((room + .5) / lineHeight)));
|
|
35993
|
+
}
|
|
35994
|
+
function sync$4(container, item, context) {
|
|
35995
|
+
const parts = partsByContainer$4.get(container);
|
|
35996
|
+
if (!parts) return;
|
|
35997
|
+
positionShell(parts.root, item);
|
|
35998
|
+
const { width, height } = item.frame;
|
|
35999
|
+
const view = viewOf(item, context);
|
|
36000
|
+
const full = boardCardDetailed(context.zoom);
|
|
36001
|
+
const elevation = cardElevation(context, item.id);
|
|
36002
|
+
const pixel = context.style.corner === "pixel";
|
|
36003
|
+
const color = statusColor$1(view.status, context);
|
|
36004
|
+
const showStatus = view.status !== "idle";
|
|
36005
|
+
const ring = view.status === "failed" || view.status === "lost";
|
|
36006
|
+
const counting = full && view.status === "running" && view.startedAt !== null;
|
|
36007
|
+
const elapsed = counting ? formatBoardDuration(Date.now() - view.startedAt) : "";
|
|
36008
|
+
const innerWidth = Math.max(1, width - 28);
|
|
36009
|
+
syncCardTag(parts.tag, {
|
|
36010
|
+
glyph: "session",
|
|
36011
|
+
text: view.meta,
|
|
36012
|
+
width
|
|
36013
|
+
}, context);
|
|
36014
|
+
const pip = full ? 0 : Math.round(Math.min(Math.max(PIP_SCREEN / context.zoom, DOT), Math.min(width, height) * .2));
|
|
36015
|
+
const textSig = [
|
|
36016
|
+
view.title,
|
|
36017
|
+
view.excerpt,
|
|
36018
|
+
view.label,
|
|
36019
|
+
counting,
|
|
36020
|
+
view.model,
|
|
36021
|
+
view.unread,
|
|
36022
|
+
showStatus,
|
|
36023
|
+
full,
|
|
36024
|
+
pip,
|
|
36025
|
+
width,
|
|
36026
|
+
height,
|
|
36027
|
+
color,
|
|
36028
|
+
context.palette.text,
|
|
36029
|
+
context.palette.muted,
|
|
36030
|
+
context.style.font,
|
|
36031
|
+
context.themeKey
|
|
36032
|
+
].join("|");
|
|
36033
|
+
if (textSig !== parts.textSig) {
|
|
36034
|
+
parts.textSig = textSig;
|
|
36035
|
+
for (const text of [
|
|
36036
|
+
parts.title,
|
|
36037
|
+
parts.status,
|
|
36038
|
+
parts.excerpt
|
|
36039
|
+
]) text.style.fontFamily = context.style.font;
|
|
36040
|
+
const statusLeft = PAD_X + (ring ? RING : 15) + GAP;
|
|
36041
|
+
let cursor = PAD_Y;
|
|
36042
|
+
parts.title.style.fill = context.palette.text;
|
|
36043
|
+
const titleRoom = innerWidth - (full ? view.unread ? 12 : 0 : showStatus ? pip + GAP : 0);
|
|
36044
|
+
fitTextToWidth(parts.title, view.title, Math.max(1, titleRoom));
|
|
36045
|
+
parts.title.position.set(PAD_X, cursor);
|
|
36046
|
+
cursor += TITLE_LINE;
|
|
36047
|
+
parts.status.visible = showStatus && full;
|
|
36048
|
+
if (showStatus) {
|
|
36049
|
+
cursor += 4;
|
|
36050
|
+
parts.status.style.fill = color;
|
|
36051
|
+
fitTextToWidth(parts.status, counting ? `${view.label} · ${elapsed}` : view.label, Math.max(1, width - statusLeft - PAD_X));
|
|
36052
|
+
parts.status.position.set(statusLeft, cursor);
|
|
36053
|
+
cursor += STATUS_LINE;
|
|
36054
|
+
}
|
|
36055
|
+
const showModel = full && Boolean(view.model);
|
|
36056
|
+
parts.model.visible = showModel;
|
|
36057
|
+
if (showModel) {
|
|
36058
|
+
parts.model.style.fill = context.palette.muted;
|
|
36059
|
+
fitTextToWidth(parts.model, view.model, innerWidth);
|
|
36060
|
+
parts.model.position.set(width - PAD_X - parts.model.width, height - PAD_Y - MODEL_LINE + 2);
|
|
36061
|
+
}
|
|
36062
|
+
const bottom = height - PAD_Y - (showModel ? 20 : 0);
|
|
36063
|
+
const lines = full && view.excerpt ? linesInRoom(bottom - cursor - GAP, EXCERPT_LINE, EXCERPT_MAX_LINES) : 0;
|
|
36064
|
+
parts.excerpt.visible = lines > 0;
|
|
36065
|
+
if (lines > 0) {
|
|
36066
|
+
parts.excerpt.style.fill = context.palette.muted;
|
|
36067
|
+
fitTextToLines(parts.excerpt, view.excerpt, lines, innerWidth);
|
|
36068
|
+
parts.excerpt.position.set(PAD_X, cursor + GAP);
|
|
36069
|
+
}
|
|
36070
|
+
}
|
|
36071
|
+
for (const text of [
|
|
36072
|
+
parts.title,
|
|
36073
|
+
parts.status,
|
|
36074
|
+
parts.excerpt,
|
|
36075
|
+
parts.model
|
|
36076
|
+
]) syncTextResolution(text, context.textResolution);
|
|
36077
|
+
const visualSig = [
|
|
36078
|
+
width,
|
|
36079
|
+
height,
|
|
36080
|
+
pip,
|
|
36081
|
+
elevation,
|
|
36082
|
+
view.status,
|
|
36083
|
+
view.unread,
|
|
36084
|
+
view.unavailable,
|
|
36085
|
+
full,
|
|
36086
|
+
pixel,
|
|
36087
|
+
color,
|
|
36088
|
+
parts.title.width,
|
|
36089
|
+
context.palette.activity,
|
|
36090
|
+
context.palette.surface,
|
|
36091
|
+
context.themeKey
|
|
36092
|
+
].join("|");
|
|
36093
|
+
if (visualSig !== parts.visualSig) {
|
|
36094
|
+
parts.visualSig = visualSig;
|
|
36095
|
+
const rect = {
|
|
36096
|
+
x: 0,
|
|
36097
|
+
y: 0,
|
|
36098
|
+
width,
|
|
36099
|
+
height
|
|
36100
|
+
};
|
|
36101
|
+
drawCardSurface(parts.plate.clear(), rect, context.style, {
|
|
36102
|
+
fill: context.palette.surface,
|
|
36103
|
+
border: context.palette.border,
|
|
36104
|
+
borderAlpha: .85,
|
|
36105
|
+
elevation
|
|
36106
|
+
});
|
|
36107
|
+
traceCardOutline(parts.clip.clear(), rect, context.style, -1).fill({ color: 16777215 });
|
|
36108
|
+
parts.content.alpha = view.unavailable ? UNAVAILABLE_ALPHA : 1;
|
|
36109
|
+
const markY = 43;
|
|
36110
|
+
parts.mark.clear();
|
|
36111
|
+
parts.mark.alpha = view.status === "queued" ? .7 : 1;
|
|
36112
|
+
for (const dot of parts.dots) dot.visible = false;
|
|
36113
|
+
if (showStatus && !full) drawDot(parts.mark, width - PAD_X - pip, PAD_Y, pip, color, pixel);
|
|
36114
|
+
else if (showStatus && ring) {
|
|
36115
|
+
if (pixel) parts.mark.rect(PAD_X, markY - RING / 2, RING, RING);
|
|
36116
|
+
else parts.mark.circle(18, markY, RING / 2 - .75);
|
|
36117
|
+
parts.mark.stroke({
|
|
36118
|
+
color,
|
|
36119
|
+
width: 1.5,
|
|
36120
|
+
alignment: pixel ? 1 : .5
|
|
36121
|
+
});
|
|
36122
|
+
} else if (showStatus) parts.dots.forEach((dot, index) => {
|
|
36123
|
+
drawDot(dot, PAD_X + index * 5.5, markY - DOT / 2, DOT, color, pixel);
|
|
36124
|
+
dot.alpha = (view.status === "queued" ? .7 : 1) * (RESTING_ALPHA[index] ?? 1);
|
|
36125
|
+
dot.visible = true;
|
|
36126
|
+
});
|
|
36127
|
+
parts.unread.visible = full && view.unread && !view.unavailable;
|
|
36128
|
+
if (parts.unread.visible) drawDot(parts.unread, PAD_X + parts.title.width + GAP, 18.5, UNREAD, context.palette.activity, pixel);
|
|
36129
|
+
}
|
|
36130
|
+
const wave = full && showStatus && !ring ? waveFor(view.status, context) : null;
|
|
36131
|
+
parts.motion.wave = wave ? {
|
|
36132
|
+
period: wave,
|
|
36133
|
+
dots: parts.dots
|
|
36134
|
+
} : null;
|
|
36135
|
+
if (!wave) parts.motion.frame = -1;
|
|
36136
|
+
parts.motion.startedAt = counting ? view.startedAt : null;
|
|
36137
|
+
parts.motion.label = view.label;
|
|
36138
|
+
parts.motion.elapsed = elapsed;
|
|
36139
|
+
parts.motion.width = Math.max(1, width - 35 - PAD_X);
|
|
36140
|
+
}
|
|
36141
|
+
function isSession(item) {
|
|
36142
|
+
return item.type === "session";
|
|
36143
|
+
}
|
|
36144
|
+
const sessionCardRenderer = {
|
|
36145
|
+
id: "session-card",
|
|
36146
|
+
canRender: isSession,
|
|
36147
|
+
create: (item, context) => {
|
|
36148
|
+
const root = new Container();
|
|
36149
|
+
const plate = new Graphics();
|
|
36150
|
+
const clip = new Graphics();
|
|
36151
|
+
const content = new Container();
|
|
36152
|
+
const mark = new Graphics();
|
|
36153
|
+
const dots = [
|
|
36154
|
+
new Graphics(),
|
|
36155
|
+
new Graphics(),
|
|
36156
|
+
new Graphics()
|
|
36157
|
+
];
|
|
36158
|
+
const unread = new Graphics();
|
|
36159
|
+
const text = (fontFamily, fontSize, fontWeight, lineHeight) => new Text({
|
|
36160
|
+
text: "",
|
|
36161
|
+
style: {
|
|
36162
|
+
fontFamily,
|
|
36163
|
+
fontSize,
|
|
36164
|
+
fontWeight,
|
|
36165
|
+
lineHeight
|
|
36166
|
+
},
|
|
36167
|
+
resolution: context.textResolution,
|
|
36168
|
+
roundPixels: true
|
|
36169
|
+
});
|
|
36170
|
+
const title = text(context.style.font, TITLE_SIZE, "600", TITLE_LINE);
|
|
36171
|
+
const status = text(context.style.font, STATUS_SIZE, "500", STATUS_LINE);
|
|
36172
|
+
const excerpt = text(context.style.font, EXCERPT_SIZE, "400", EXCERPT_LINE);
|
|
36173
|
+
const model = text(BOARD_MONO_FONT_STACK, MODEL_SIZE, "500", MODEL_LINE);
|
|
36174
|
+
content.mask = clip;
|
|
36175
|
+
content.addChild(mark, ...dots, unread, title, status, excerpt, model);
|
|
36176
|
+
const tag = createCardTag();
|
|
36177
|
+
root.addChild(plate, content, clip, tag.root);
|
|
36178
|
+
partsByContainer$4.set(root, {
|
|
36179
|
+
root,
|
|
36180
|
+
plate,
|
|
36181
|
+
content,
|
|
36182
|
+
clip,
|
|
36183
|
+
mark,
|
|
36184
|
+
dots,
|
|
36185
|
+
unread,
|
|
36186
|
+
title,
|
|
36187
|
+
status,
|
|
36188
|
+
excerpt,
|
|
36189
|
+
model,
|
|
36190
|
+
tag,
|
|
36191
|
+
visualSig: "",
|
|
36192
|
+
textSig: "",
|
|
36193
|
+
motion: {
|
|
36194
|
+
wave: null,
|
|
36195
|
+
frame: -1,
|
|
36196
|
+
startedAt: null,
|
|
36197
|
+
label: "",
|
|
36198
|
+
elapsed: "",
|
|
36199
|
+
width: 0
|
|
36200
|
+
}
|
|
36201
|
+
});
|
|
36202
|
+
if (isSession(item)) sync$4(root, item, context);
|
|
36203
|
+
return root;
|
|
36204
|
+
},
|
|
36205
|
+
update: (container, item, context) => {
|
|
36206
|
+
if (isSession(item)) sync$4(container, item, context);
|
|
36207
|
+
},
|
|
36208
|
+
resolution: (container, item, context) => {
|
|
36209
|
+
if (isSession(item)) sync$4(container, item, context);
|
|
36210
|
+
},
|
|
36211
|
+
tick: (container, clock) => {
|
|
36212
|
+
const parts = partsByContainer$4.get(container);
|
|
36213
|
+
return parts ? advance$1(parts, clock) : null;
|
|
36214
|
+
},
|
|
36215
|
+
zoom: (container, zoom) => {
|
|
36216
|
+
const tag = partsByContainer$4.get(container)?.tag;
|
|
36217
|
+
if (tag) zoomCardTag(tag, zoom);
|
|
36218
|
+
},
|
|
36219
|
+
renderFar: (graphics, item, context) => {
|
|
36220
|
+
if (!isSession(item)) return;
|
|
36221
|
+
const { status, unavailable } = viewOf(item, context);
|
|
36222
|
+
const active = !unavailable && (status === "running" || status === "failed" || status === "lost");
|
|
36223
|
+
drawFarPlate(graphics, item.frame, {
|
|
36224
|
+
fill: context.palette.surface,
|
|
36225
|
+
fillAlpha: unavailable ? .6 : .96,
|
|
36226
|
+
...active ? {
|
|
36227
|
+
accent: statusColor$1(status, context),
|
|
36228
|
+
accentAlpha: .9
|
|
36229
|
+
} : {}
|
|
36230
|
+
});
|
|
36231
|
+
},
|
|
35709
36232
|
destroy: (container) => {
|
|
35710
36233
|
partsByContainer$4.get(container)?.root.destroy({ children: true });
|
|
35711
36234
|
partsByContainer$4.delete(container);
|
|
@@ -36606,7 +37129,10 @@ const DEFAULT_BOARD_RENDER_LABELS = {
|
|
|
36606
37129
|
generating: "Generating",
|
|
36607
37130
|
failed: "Failed",
|
|
36608
37131
|
previewUnavailable: "Preview unavailable",
|
|
36609
|
-
noPreview: "No preview"
|
|
37132
|
+
noPreview: "No preview",
|
|
37133
|
+
sessionUntitled: "New chat",
|
|
37134
|
+
sessionLost: "Run lost",
|
|
37135
|
+
sessionUnavailable: "Unavailable"
|
|
36610
37136
|
};
|
|
36611
37137
|
const playable = (renderer) => ({
|
|
36612
37138
|
...renderer,
|
|
@@ -36620,6 +37146,7 @@ const builtinCardRenderers = [
|
|
|
36620
37146
|
playable(modelCardRenderer),
|
|
36621
37147
|
fileCardRenderer,
|
|
36622
37148
|
playable(taskCardRenderer),
|
|
37149
|
+
sessionCardRenderer,
|
|
36623
37150
|
shapeCardRenderer,
|
|
36624
37151
|
drawCardRenderer,
|
|
36625
37152
|
arrowCardRenderer,
|
|
@@ -36673,6 +37200,10 @@ const BOARD_DEFAULT_SIZES = {
|
|
|
36673
37200
|
width: 480,
|
|
36674
37201
|
height: 270
|
|
36675
37202
|
},
|
|
37203
|
+
session: {
|
|
37204
|
+
width: 320,
|
|
37205
|
+
height: 176
|
|
37206
|
+
},
|
|
36676
37207
|
effect: {
|
|
36677
37208
|
width: 240,
|
|
36678
37209
|
height: 240
|
|
@@ -36881,7 +37412,7 @@ object({
|
|
|
36881
37412
|
type: literal("frame"),
|
|
36882
37413
|
props: object({
|
|
36883
37414
|
label: string().max(280).default(""),
|
|
36884
|
-
decoration: _enum(["frame", "none"]).optional().describe("none hides the title, border and background: an invisible group whose tracks move every child."),
|
|
37415
|
+
decoration: _enum(["frame", "none"]).optional().describe("none hides the title, border and background: an invisible group whose tracks move every child; with a label it is also a page viewers step to."),
|
|
36885
37416
|
clip: boolean().default(true).describe("Hide children outside the frame.")
|
|
36886
37417
|
}).strict().prefault({})
|
|
36887
37418
|
}).strict();
|
|
@@ -37081,6 +37612,22 @@ object({
|
|
|
37081
37612
|
snapshot: BoardTaskSnapshotSchema.describe("Maintained by the server; omit it.")
|
|
37082
37613
|
}).strict()
|
|
37083
37614
|
}).strict();
|
|
37615
|
+
const BoardSessionSnapshotSchema = object({
|
|
37616
|
+
title: string().max(255).default(""),
|
|
37617
|
+
excerpt: string().max(480).optional().describe("The latest message as plain text."),
|
|
37618
|
+
source: string().max(120).optional().describe("Where the chat runs: web, cli or a channel."),
|
|
37619
|
+
issue: _enum(["failed", "lost"]).optional().describe("How the last run ended when it did not finish."),
|
|
37620
|
+
errorExcerpt: string().max(240).optional(),
|
|
37621
|
+
activityAt: string().max(64).optional()
|
|
37622
|
+
}).strict();
|
|
37623
|
+
object({
|
|
37624
|
+
...boxed(BOARD_DEFAULT_SIZES.session),
|
|
37625
|
+
type: literal("session"),
|
|
37626
|
+
props: object({
|
|
37627
|
+
sessionId: string().min(1).max(160).describe("The chat shown; the server keeps its title, latest message and status up to date."),
|
|
37628
|
+
snapshot: BoardSessionSnapshotSchema.describe("Maintained by the server; omit it.")
|
|
37629
|
+
}).strict()
|
|
37630
|
+
}).strict();
|
|
37084
37631
|
const BOARD_EFFECT_KINDS = [
|
|
37085
37632
|
"particles",
|
|
37086
37633
|
"trail",
|
|
@@ -38323,4 +38870,4 @@ function exportBoardImageBytes(renderer, document, options = {}) {
|
|
|
38323
38870
|
}
|
|
38324
38871
|
}
|
|
38325
38872
|
//#endregion
|
|
38326
|
-
export { BOARD_SCRIPT_DRAWING_EXAMPLE, boardAssetKey, boardAssetKeySource, boardDocumentAt, boardPathTrack, boardRenderTheme, boardSequence, boardSequencePatch, boardTextureEdge, boardTexturePixels, buildBoardScene, createBoardAnimationSampler, createBoardRenderSampler, createNodeBoardRenderer, createNodeBoardScriptHost, exportBoardImageBytes, hasBoardScripts, inspectBoardItems, inspectBoardScene, measureBoardText, parseBoardDocument, planBoardExport, prepareBoardExport, selectBoardExportAssets };
|
|
38873
|
+
export { BOARD_SCRIPT_DRAWING_EXAMPLE, boardAssetKey, boardAssetKeySource, boardDocumentAt, boardFrameRegions, boardPathTrack, boardRegionStep, boardRenderTheme, boardSequence, boardSequencePatch, boardTextureEdge, boardTexturePixels, buildBoardScene, createBoardAnimationSampler, createBoardRenderSampler, createNodeBoardRenderer, createNodeBoardScriptHost, exportBoardImageBytes, hasBoardScripts, inspectBoardItems, inspectBoardScene, measureBoardText, parseBoardDocument, planBoardExport, prepareBoardExport, selectBoardExportAssets };
|