@cardenelabs/dragon 0.45.0 → 0.45.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +70 -29
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +70 -29
- package/dist/cli.js.map +1 -1
- package/dist/export.cjs +70 -29
- package/dist/export.cjs.map +1 -1
- package/dist/export.js +70 -29
- package/dist/export.js.map +1 -1
- package/dist/index.cjs +70 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +70 -29
- package/dist/index.js.map +1 -1
- package/dist/light/{chunk-VRAW7VAQ.cjs → chunk-5OQV42W3.cjs} +50 -19
- package/dist/light/chunk-5OQV42W3.cjs.map +1 -0
- package/dist/light/chunk-CLS6JVKK.cjs.map +1 -1
- package/dist/light/{chunk-JNSHZTPF.js → chunk-EHTQUCW4.js} +49 -18
- package/dist/light/chunk-EHTQUCW4.js.map +1 -0
- package/dist/light/{chunk-OUQ44P45.cjs → chunk-JCEKXALJ.cjs} +81 -81
- package/dist/light/{chunk-OUQ44P45.cjs.map → chunk-JCEKXALJ.cjs.map} +1 -1
- package/dist/light/{chunk-6ZUKJ3VO.js → chunk-YEQSLVIN.js} +2 -2
- package/dist/light/{git-C4RVNFT6.js → git-GESUYKGR.js} +3 -3
- package/dist/light/{git-I7D7RIW2.cjs → git-K3KAAAWW.cjs} +59 -59
- package/dist/light/{git-I7D7RIW2.cjs.map → git-K3KAAAWW.cjs.map} +1 -1
- package/dist/light/index.cjs +231 -219
- package/dist/light/index.cjs.map +1 -1
- package/dist/light/index.js +31 -19
- package/dist/light/index.js.map +1 -1
- package/dist/light/{lineup-YEG4HHEI.js → lineup-2V2U7HZH.js} +3 -3
- package/dist/light/{lineup-FAIKTH3Y.cjs → lineup-623J25LU.cjs} +40 -40
- package/dist/light/{lineup-FAIKTH3Y.cjs.map → lineup-623J25LU.cjs.map} +1 -1
- package/dist/light/{state-ZZUK6AQT.cjs → state-OZVCHX7H.cjs} +41 -41
- package/dist/light/{state-ZZUK6AQT.cjs.map → state-OZVCHX7H.cjs.map} +1 -1
- package/dist/light/{state-P3LIVI3K.js → state-T4OTVING.js} +2 -2
- package/dist/light/{time-B5WUQOFP.js → time-6WEMD4FQ.js} +3 -3
- package/dist/light/{time-64DJKYAL.cjs → time-PQCPVQOE.cjs} +84 -84
- package/dist/light/{time-64DJKYAL.cjs.map → time-PQCPVQOE.cjs.map} +1 -1
- package/dist/light/{tree-66EH4QVI.cjs → tree-6D7KI57H.cjs} +62 -62
- package/dist/light/{tree-66EH4QVI.cjs.map → tree-6D7KI57H.cjs.map} +1 -1
- package/dist/light/{tree-5HPREYW2.js → tree-ZJZQI5QT.js} +3 -3
- package/dist/player.global.js +3 -3
- package/package.json +1 -1
- package/src/layout/scene.ts +58 -16
- package/src/look/values.ts +1 -1
- package/src/render/draw.ts +34 -14
- package/dist/light/chunk-JNSHZTPF.js.map +0 -1
- package/dist/light/chunk-VRAW7VAQ.cjs.map +0 -1
- /package/dist/light/{chunk-6ZUKJ3VO.js.map → chunk-YEQSLVIN.js.map} +0 -0
- /package/dist/light/{git-C4RVNFT6.js.map → git-GESUYKGR.js.map} +0 -0
- /package/dist/light/{lineup-YEG4HHEI.js.map → lineup-2V2U7HZH.js.map} +0 -0
- /package/dist/light/{state-P3LIVI3K.js.map → state-T4OTVING.js.map} +0 -0
- /package/dist/light/{time-B5WUQOFP.js.map → time-6WEMD4FQ.js.map} +0 -0
- /package/dist/light/{tree-5HPREYW2.js.map → tree-ZJZQI5QT.js.map} +0 -0
package/dist/light/index.cjs
CHANGED
|
@@ -50,7 +50,7 @@ var _chunkCLS6JVKKcjs = require('./chunk-CLS6JVKK.cjs');
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
var
|
|
53
|
+
var _chunkJCEKXALJcjs = require('./chunk-JCEKXALJ.cjs');
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
@@ -92,7 +92,8 @@ var _chunkOUQ44P45cjs = require('./chunk-OUQ44P45.cjs');
|
|
|
92
92
|
|
|
93
93
|
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
|
|
96
|
+
var _chunk5OQV42W3cjs = require('./chunk-5OQV42W3.cjs');
|
|
96
97
|
|
|
97
98
|
// src/kinds/registry.ts
|
|
98
99
|
var LATER_KINDS = ["git", "lineup", "state", "time", "tree"];
|
|
@@ -105,7 +106,7 @@ function kindLoaded(kind) {
|
|
|
105
106
|
}
|
|
106
107
|
function kindParts(kind, lang = "ja") {
|
|
107
108
|
const parts = registered[kind];
|
|
108
|
-
if (parts === void 0) throw new Error(
|
|
109
|
+
if (parts === void 0) throw new Error(_chunk5OQV42W3cjs.FIGURE_TEXT[lang].kindNotLoaded(kind));
|
|
109
110
|
return parts;
|
|
110
111
|
}
|
|
111
112
|
|
|
@@ -8191,8 +8192,8 @@ function groupsOf(diagram) {
|
|
|
8191
8192
|
}
|
|
8192
8193
|
var vertical = (side2) => side2 === "left" || side2 === "right";
|
|
8193
8194
|
function placeBoxes(diagram, groups) {
|
|
8194
|
-
const columns =
|
|
8195
|
-
const edges =
|
|
8195
|
+
const columns = _chunk5OQV42W3cjs.LOOK.architecture.columns;
|
|
8196
|
+
const edges = _chunk5OQV42W3cjs.edgesOf.call(void 0, diagram).map((e) => e.edge);
|
|
8196
8197
|
const slots = /* @__PURE__ */ new Map();
|
|
8197
8198
|
groups.forEach((group, g) => {
|
|
8198
8199
|
const inGroup = new Set(group.members);
|
|
@@ -8256,27 +8257,27 @@ function nameLines(name2) {
|
|
|
8256
8257
|
return [name2.slice(0, at), name2.slice(at + 1)];
|
|
8257
8258
|
}
|
|
8258
8259
|
function headerSize(region) {
|
|
8259
|
-
const { icon, nameY, line: line2, inset } =
|
|
8260
|
+
const { icon, nameY, line: line2, inset } = _chunk5OQV42W3cjs.LOOK.region;
|
|
8260
8261
|
const lines = nameLines(region.name);
|
|
8261
|
-
const w = Math.max(icon, ...lines.map((l) =>
|
|
8262
|
-
const h = nameY - inset + (lines.length - 1) * line2 + (region.note ? line2 : 0) +
|
|
8262
|
+
const w = Math.max(icon, ...lines.map((l) => _chunk5OQV42W3cjs.textWidth.call(void 0, l, _chunk5OQV42W3cjs.TYPE.regionName)), _chunk5OQV42W3cjs.textWidth.call(void 0, _nullishCoalesce(region.note, () => ( "")), _chunk5OQV42W3cjs.TYPE.regionNote));
|
|
8263
|
+
const h = nameY - inset + (lines.length - 1) * line2 + (region.note ? line2 : 0) + _chunk5OQV42W3cjs.LOOK.gap / 2;
|
|
8263
8264
|
return { w, h, lines };
|
|
8264
8265
|
}
|
|
8265
8266
|
function arrange(diagram, groups, slots, rooms) {
|
|
8266
|
-
const { box: B, region: R, architecture: A, margin, gap } =
|
|
8267
|
-
const colors =
|
|
8268
|
-
const regionColor =
|
|
8269
|
-
const edges =
|
|
8267
|
+
const { box: B, region: R, architecture: A, margin, gap } = _chunk5OQV42W3cjs.LOOK;
|
|
8268
|
+
const colors = _chunk5OQV42W3cjs.boxColors.call(void 0, diagram);
|
|
8269
|
+
const regionColor = _chunk5OQV42W3cjs.regionColors.call(void 0, diagram);
|
|
8270
|
+
const edges = _chunk5OQV42W3cjs.edgesOf.call(void 0, diagram);
|
|
8270
8271
|
const columnCount = Math.max(1, ...[...slots.values()].map((s) => s.col + 1));
|
|
8271
|
-
const carriedIn =
|
|
8272
|
-
const widths = new Map(diagram.boxes.map((b) => [b.id, Math.max(
|
|
8272
|
+
const carriedIn = _chunk5OQV42W3cjs.slotRooms.call(void 0, diagram);
|
|
8273
|
+
const widths = new Map(diagram.boxes.map((b) => [b.id, Math.max(_chunk5OQV42W3cjs.boxWidth.call(void 0, diagram, b.id, true), _chunk5OQV42W3cjs.slotBoxWidth.call(void 0, carriedIn.get(b.id), b.icon !== void 0, B.padX))]));
|
|
8273
8274
|
const colW = Array.from({ length: columnCount }, (_, c) => Math.max(B.minW, ...[...slots].filter(([, s]) => s.col === c).map(([id]) => _nullishCoalesce(widths.get(id), () => ( B.minW)))));
|
|
8274
8275
|
const between = Array.from({ length: Math.max(0, columnCount - 1) }, () => A.columnGap);
|
|
8275
8276
|
for (const { edge: edge2 } of edges) {
|
|
8276
8277
|
const a = slots.get(edge2.from);
|
|
8277
8278
|
const b = slots.get(edge2.to);
|
|
8278
8279
|
if (!a || !b || edge2.label === void 0 || a.group !== b.group || a.row !== b.row || Math.abs(a.col - b.col) !== 1 || vertical(edge2.labelSide)) continue;
|
|
8279
|
-
const need =
|
|
8280
|
+
const need = _chunk5OQV42W3cjs.textWidth.call(void 0, edge2.label, _chunk5OQV42W3cjs.labelStyle.call(void 0, edge2.label)) + _chunk5OQV42W3cjs.LOOK.label.padX * 2 + A.labelRoom * 2;
|
|
8280
8281
|
const i = Math.min(a.col, b.col);
|
|
8281
8282
|
if (need <= A.maxColumnGap) between[i] = Math.max(_nullishCoalesce(between[i], () => ( 0)), need);
|
|
8282
8283
|
}
|
|
@@ -8290,7 +8291,7 @@ function arrange(diagram, groups, slots, rooms) {
|
|
|
8290
8291
|
const slot = slots.get(id);
|
|
8291
8292
|
return slot ? [`${slot.group}:${slot.row}`] : [];
|
|
8292
8293
|
}));
|
|
8293
|
-
const loopRoom = (g, row) => loopRows.has(`${g}:${row}`) ?
|
|
8294
|
+
const loopRoom = (g, row) => loopRows.has(`${g}:${row}`) ? _chunk5OQV42W3cjs.LOOP_ROOM : 0;
|
|
8294
8295
|
const boxes = [];
|
|
8295
8296
|
const bands = [];
|
|
8296
8297
|
let cursor = margin;
|
|
@@ -8327,7 +8328,7 @@ function arrange(diagram, groups, slots, rooms) {
|
|
|
8327
8328
|
cursor += h + R.gap;
|
|
8328
8329
|
});
|
|
8329
8330
|
const bandsBottom = cursor - R.gap;
|
|
8330
|
-
for (const box of boxes)
|
|
8331
|
+
for (const box of boxes) _chunk5OQV42W3cjs.placeSlot.call(void 0, box, carriedIn.get(box.id));
|
|
8331
8332
|
const byId = new Map(boxes.map((b) => [b.id, b]));
|
|
8332
8333
|
const bandOf = (id) => bands[_nullishCoalesce(_optionalChain([slots, 'access', _138 => _138.get, 'call', _139 => _139(id), 'optionalAccess', _140 => _140.group]), () => ( 0))];
|
|
8333
8334
|
const crosses = (points, rect, pad2) => {
|
|
@@ -8340,28 +8341,28 @@ function arrange(diagram, groups, slots, rooms) {
|
|
|
8340
8341
|
};
|
|
8341
8342
|
const loopZones = [...looped].flatMap((id) => {
|
|
8342
8343
|
const box = byId.get(id);
|
|
8343
|
-
return box ? [{ x: box.x, y: box.y + box.h, w: box.w, h:
|
|
8344
|
+
return box ? [{ x: box.x, y: box.y + box.h, w: box.w, h: _chunk5OQV42W3cjs.LOOP_ROOM }] : [];
|
|
8344
8345
|
});
|
|
8345
8346
|
const onLoop = (points) => loopZones.some((zone) => crosses(points, zone, 0));
|
|
8346
|
-
const blocked = (points, a, b) => boxes.some((box) => box.id !== a && box.id !== b && crosses(points, box,
|
|
8347
|
+
const blocked = (points, a, b) => boxes.some((box) => box.id !== a && box.id !== b && crosses(points, box, _chunk5OQV42W3cjs.LOOK.label.search)) || onLoop(points);
|
|
8347
8348
|
const laneBelow = (id) => {
|
|
8348
8349
|
const box = byId.get(id);
|
|
8349
8350
|
const band2 = bandOf(id);
|
|
8350
8351
|
const slot = slots.get(id);
|
|
8351
8352
|
const under = box.y + box.h + (slot ? loopRoom(slot.group, slot.row) : 0);
|
|
8352
|
-
return (_nullishCoalesce(_optionalChain([slot, 'optionalAccess', _141 => _141.row]), () => ( 0))) < band2.rows - 1 ? under + A.rowGap / 2 : Math.min(under + R.pad / 2, band2.y + band2.h -
|
|
8353
|
+
return (_nullishCoalesce(_optionalChain([slot, 'optionalAccess', _141 => _141.row]), () => ( 0))) < band2.rows - 1 ? under + A.rowGap / 2 : Math.min(under + R.pad / 2, band2.y + band2.h - _chunk5OQV42W3cjs.LOOK.edge.inset);
|
|
8353
8354
|
};
|
|
8354
8355
|
const laneAbove = (id) => {
|
|
8355
8356
|
const box = byId.get(id);
|
|
8356
8357
|
const band2 = bandOf(id);
|
|
8357
|
-
return (_nullishCoalesce(_optionalChain([slots, 'access', _142 => _142.get, 'call', _143 => _143(id), 'optionalAccess', _144 => _144.row]), () => ( 0))) > 0 ? box.y - A.rowGap / 2 : Math.max(box.y - R.pad / 2, band2.y +
|
|
8358
|
+
return (_nullishCoalesce(_optionalChain([slots, 'access', _142 => _142.get, 'call', _143 => _143(id), 'optionalAccess', _144 => _144.row]), () => ( 0))) > 0 ? box.y - A.rowGap / 2 : Math.max(box.y - R.pad / 2, band2.y + _chunk5OQV42W3cjs.LOOK.edge.inset);
|
|
8358
8359
|
};
|
|
8359
|
-
const inset =
|
|
8360
|
+
const inset = _chunk5OQV42W3cjs.LOOK.edge.inset;
|
|
8360
8361
|
const gapX = (col, toRight) => toRight ? colLeft[col] + colW[col] + (_nullishCoalesce(between[col], () => ( A.columnGap))) / 2 : colLeft[col] - (_nullishCoalesce(between[col - 1], () => ( A.columnGap))) / 2;
|
|
8361
8362
|
const route = (from, to) => {
|
|
8362
8363
|
const a = byId.get(from);
|
|
8363
8364
|
const b = byId.get(to);
|
|
8364
|
-
if (from === to) return
|
|
8365
|
+
if (from === to) return _chunk5OQV42W3cjs.loopUnder.call(void 0, a);
|
|
8365
8366
|
const sa = slots.get(from);
|
|
8366
8367
|
const sb = slots.get(to);
|
|
8367
8368
|
if (sa.group === sb.group && sa.row === sb.row) {
|
|
@@ -8432,10 +8433,10 @@ function arrange(diagram, groups, slots, rooms) {
|
|
|
8432
8433
|
from: edge2.from,
|
|
8433
8434
|
to: edge2.to,
|
|
8434
8435
|
points: route(edge2.from, edge2.to),
|
|
8435
|
-
color:
|
|
8436
|
+
color: _chunk5OQV42W3cjs.edgeColor.call(void 0, edge2, colors),
|
|
8436
8437
|
carry: edge2.carry
|
|
8437
8438
|
}));
|
|
8438
|
-
|
|
8439
|
+
_chunk5OQV42W3cjs.seatCarriers.call(void 0, sceneEdges, byId, carriedIn);
|
|
8439
8440
|
const outward = /* @__PURE__ */ new Map();
|
|
8440
8441
|
for (const edge2 of sceneEdges) {
|
|
8441
8442
|
if (edge2.points.length !== 2) continue;
|
|
@@ -8443,7 +8444,7 @@ function arrange(diagram, groups, slots, rooms) {
|
|
|
8443
8444
|
if (!back) continue;
|
|
8444
8445
|
const [p, q] = edge2.points;
|
|
8445
8446
|
const flat = Math.abs(q[1] - p[1]) < Math.abs(q[0] - p[0]);
|
|
8446
|
-
const d = (edge2.from < edge2.to ? 1 : -1) *
|
|
8447
|
+
const d = (edge2.from < edge2.to ? 1 : -1) * _chunk5OQV42W3cjs.LOOK.edge.parallel;
|
|
8447
8448
|
edge2.points = edge2.points.map(([x, y]) => flat ? [x, y + d] : [x + d, y]);
|
|
8448
8449
|
outward.set(edge2, flat ? d > 0 ? "below" : "above" : d > 0 ? "right" : "left");
|
|
8449
8450
|
}
|
|
@@ -8465,39 +8466,39 @@ function arrange(diagram, groups, slots, rooms) {
|
|
|
8465
8466
|
header: { x: margin + R.inset, y: band2.y + R.inset, w: header.w, h: header.h }
|
|
8466
8467
|
});
|
|
8467
8468
|
});
|
|
8468
|
-
const badgeAt = (edge2, taken, lines2) => edge2.from === edge2.to ?
|
|
8469
|
-
const early =
|
|
8469
|
+
const badgeAt = (edge2, taken, lines2) => edge2.from === edge2.to ? _chunk5OQV42W3cjs.loopBadge.call(void 0, edge2.points) : _chunk5OQV42W3cjs.badgeOnPath.call(void 0, edge2.points, taken, lines2);
|
|
8470
|
+
const early = _chunk5OQV42W3cjs.lineBadges.call(void 0, sceneEdges, diagram.steps.length, badgeAt);
|
|
8470
8471
|
const labels = [];
|
|
8471
8472
|
for (const edge2 of sceneEdges) {
|
|
8472
8473
|
const source = _optionalChain([diagram, 'access', _145 => _145.steps, 'access', _146 => _146[edge2.step], 'optionalAccess', _147 => _147.events, 'access', _148 => _148[edge2.event]]);
|
|
8473
8474
|
if (_optionalChain([source, 'optionalAccess', _149 => _149.type]) !== "edge" || source.label === void 0) continue;
|
|
8474
|
-
const seen = [...early].filter(([s]) => s <= edge2.step).map(([, b]) =>
|
|
8475
|
+
const seen = [...early].filter(([s]) => s <= edge2.step).map(([, b]) => _chunk5OQV42W3cjs.badgeRect.call(void 0, b.point));
|
|
8475
8476
|
const soft = [...regions.map((r) => r.header), ...labels.filter((l) => l.step === edge2.step)];
|
|
8476
8477
|
const side2 = _nullishCoalesce(source.labelSide, () => ( outward.get(edge2)));
|
|
8477
|
-
const below = edge2.from === edge2.to ? { side: "below", base:
|
|
8478
|
+
const below = edge2.from === edge2.to ? { side: "below", base: _chunk5OQV42W3cjs.loopLabelBase.call(void 0, edge2.points, _chunk5OQV42W3cjs.textWidth.call(void 0, source.label, _chunk5OQV42W3cjs.labelStyle.call(void 0, source.label)) + _chunk5OQV42W3cjs.LOOK.label.padX * 2) } : void 0;
|
|
8478
8479
|
labels.push(
|
|
8479
|
-
|
|
8480
|
+
_chunk5OQV42W3cjs.placeLabel.call(void 0,
|
|
8480
8481
|
{ step: edge2.step, event: edge2.event, text: source.label, points: edge2.points, color: edge2.color, ..._nullishCoalesce(below, () => ( (side2 ? { side: side2 } : { flip: true }))) },
|
|
8481
8482
|
{ hard: boxes, soft, touch: seen }
|
|
8482
8483
|
)
|
|
8483
8484
|
);
|
|
8484
8485
|
}
|
|
8485
8486
|
const layout = { kind: "architecture", width: 0, height: 0, regions, boxes, lifelines: [], edges: sceneEdges, labels, actions: [], badges: [], paths: [], ends: [] };
|
|
8486
|
-
const shift = labels.length > 0 ? Math.max(0, margin +
|
|
8487
|
-
if (shift > 0)
|
|
8488
|
-
const contentRight = Math.max(...boxes.map((b) => b.x + b.w + R.pad), ...labels.map((l) => l.x + l.w +
|
|
8489
|
-
const width = Math.max(contentRight + margin,
|
|
8487
|
+
const shift = labels.length > 0 ? Math.max(0, margin + _chunk5OQV42W3cjs.LOOK.label.soft - Math.min(...labels.map((l) => l.x))) : 0;
|
|
8488
|
+
if (shift > 0) _chunk5OQV42W3cjs.shiftContent.call(void 0, layout, shift, 0);
|
|
8489
|
+
const contentRight = Math.max(...boxes.map((b) => b.x + b.w + R.pad), ...labels.map((l) => l.x + l.w + _chunk5OQV42W3cjs.LOOK.label.soft), ...sceneEdges.flatMap((e) => e.points.map((p) => p[0] + R.pad)));
|
|
8490
|
+
const width = Math.max(contentRight + margin, _chunk5OQV42W3cjs.stripNeed.call(void 0, diagram) + margin * 2);
|
|
8490
8491
|
for (const region of regions) region.w = width - margin * 2;
|
|
8491
8492
|
const contentBottom = Math.max(bandsBottom, ...labels.map((l) => l.y + l.h));
|
|
8492
|
-
const strip2 =
|
|
8493
|
+
const strip2 = _chunk5OQV42W3cjs.layoutStrip.call(void 0, diagram, margin, contentBottom + gap, width - margin * 2);
|
|
8493
8494
|
layout.width = width;
|
|
8494
8495
|
layout.height = (strip2 ? strip2.y + strip2.h : contentBottom) + margin;
|
|
8495
8496
|
if (strip2) layout.strip = strip2;
|
|
8496
|
-
const lines =
|
|
8497
|
-
layout.badges =
|
|
8497
|
+
const lines = _chunk5OQV42W3cjs.lineBadges.call(void 0, sceneEdges, diagram.steps.length, badgeAt);
|
|
8498
|
+
layout.badges = _chunk5OQV42W3cjs.replaceSameSpot.call(void 0,
|
|
8498
8499
|
diagram.steps.map((step, s) => {
|
|
8499
8500
|
const line2 = lines.get(s);
|
|
8500
|
-
if (!line2) return
|
|
8501
|
+
if (!line2) return _chunk5OQV42W3cjs.cornerBadge.call(void 0, step.events, s, layout);
|
|
8501
8502
|
return { step: s, x: line2.point[0], y: line2.point[1], color: line2.edge.color };
|
|
8502
8503
|
})
|
|
8503
8504
|
);
|
|
@@ -8505,7 +8506,7 @@ function arrange(diagram, groups, slots, rooms) {
|
|
|
8505
8506
|
}
|
|
8506
8507
|
function grow(layout, groups, slots, rooms) {
|
|
8507
8508
|
let grown = false;
|
|
8508
|
-
const soft =
|
|
8509
|
+
const soft = _chunk5OQV42W3cjs.LOOK.label.soft;
|
|
8509
8510
|
for (const label2 of layout.labels) {
|
|
8510
8511
|
const edge2 = layout.edges.find((e) => e.step === label2.step && e.event === label2.event);
|
|
8511
8512
|
const a = edge2 && slots.get(edge2.from);
|
|
@@ -8530,12 +8531,12 @@ function grow(layout, groups, slots, rooms) {
|
|
|
8530
8531
|
|
|
8531
8532
|
// src/layout/sequence.ts
|
|
8532
8533
|
function layoutSequence(diagram) {
|
|
8533
|
-
const { box: B, sequence: Q, label: L, margin, gap } =
|
|
8534
|
-
const colors =
|
|
8534
|
+
const { box: B, sequence: Q, label: L, margin, gap } = _chunk5OQV42W3cjs.LOOK;
|
|
8535
|
+
const colors = _chunk5OQV42W3cjs.boxColors.call(void 0, diagram);
|
|
8535
8536
|
const listed = _nullishCoalesce(_optionalChain([diagram, 'access', _155 => _155.sequence, 'optionalAccess', _156 => _156.lifelines]), () => ( []));
|
|
8536
8537
|
const order = [...listed, ...diagram.boxes.map((b) => b.id).filter((id) => !listed.includes(id))];
|
|
8537
8538
|
const column = new Map(order.map((id, i) => [id, i]));
|
|
8538
|
-
const widths = order.map((id) =>
|
|
8539
|
+
const widths = order.map((id) => _chunk5OQV42W3cjs.boxWidth.call(void 0, diagram, id, false));
|
|
8539
8540
|
const spacing = widths.slice(1).map((w, i) => widths[i] / 2 + w / 2 + Q.columnGap);
|
|
8540
8541
|
const needs = [];
|
|
8541
8542
|
for (const step of diagram.steps) {
|
|
@@ -8543,7 +8544,7 @@ function layoutSequence(diagram) {
|
|
|
8543
8544
|
if (event2.type !== "edge" || event2.label === void 0) continue;
|
|
8544
8545
|
const a = _nullishCoalesce(column.get(event2.from), () => ( 0));
|
|
8545
8546
|
const b = _nullishCoalesce(column.get(event2.to), () => ( 0));
|
|
8546
|
-
const w =
|
|
8547
|
+
const w = _chunk5OQV42W3cjs.textWidth.call(void 0, event2.label, _chunk5OQV42W3cjs.labelStyle.call(void 0, event2.label)) + L.padX * 2;
|
|
8547
8548
|
if (a === b) {
|
|
8548
8549
|
if (a < spacing.length) needs.push({ from: a, to: a + 1, need: Q.selfW + L.side + w + Q.labelRoom });
|
|
8549
8550
|
} else {
|
|
@@ -8598,8 +8599,8 @@ function layoutSequence(diagram) {
|
|
|
8598
8599
|
above = named && side2 === "above" ? Q.labelOffset + L.h / 2 : gap;
|
|
8599
8600
|
under = self ? Q.selfH + gap : named && side2 === "below" ? Q.labelOffset + L.h / 2 : gap;
|
|
8600
8601
|
} else {
|
|
8601
|
-
above =
|
|
8602
|
-
under =
|
|
8602
|
+
above = _chunk5OQV42W3cjs.LOOK.action.h / 2;
|
|
8603
|
+
under = _chunk5OQV42W3cjs.LOOK.action.h / 2;
|
|
8603
8604
|
}
|
|
8604
8605
|
y = first ? y + above : y + Math.max(Q.minPitch, below + Q.rowGap + above) + (e === 0 && s > 0 ? Q.stepGap : 0);
|
|
8605
8606
|
first = false;
|
|
@@ -8612,15 +8613,15 @@ function layoutSequence(diagram) {
|
|
|
8612
8613
|
[xf, y],
|
|
8613
8614
|
[xf + Q.selfW, y],
|
|
8614
8615
|
[xf + Q.selfW, y + Q.selfH],
|
|
8615
|
-
[xf +
|
|
8616
|
+
[xf + _chunk5OQV42W3cjs.LOOK.edge.inset, y + Q.selfH]
|
|
8616
8617
|
] : [
|
|
8617
8618
|
[xf, y],
|
|
8618
|
-
[xt - dir *
|
|
8619
|
+
[xt - dir * _chunk5OQV42W3cjs.LOOK.edge.inset, y]
|
|
8619
8620
|
];
|
|
8620
|
-
const color =
|
|
8621
|
+
const color = _chunk5OQV42W3cjs.edgeColor.call(void 0, event2, colors);
|
|
8621
8622
|
const seats = {};
|
|
8622
8623
|
if (event2.carry.kind !== "none") {
|
|
8623
|
-
const reach =
|
|
8624
|
+
const reach = _chunk5OQV42W3cjs.LOOK.slot.lifeline + _chunk5OQV42W3cjs.carrierHalf.call(void 0, event2.carry)[0];
|
|
8624
8625
|
const [p0, p1] = points;
|
|
8625
8626
|
const [q0, q1] = points.slice(-2);
|
|
8626
8627
|
const out = Math.sign(p1[0] - p0[0]) || 1;
|
|
@@ -8642,27 +8643,27 @@ function layoutSequence(diagram) {
|
|
|
8642
8643
|
}
|
|
8643
8644
|
} else {
|
|
8644
8645
|
const x = xs[_nullishCoalesce(column.get(event2.box), () => ( 0))];
|
|
8645
|
-
const w =
|
|
8646
|
-
actions.push({ step: s, event: e, box: event2.box, text: event2.label, color: _nullishCoalesce(colors.get(event2.box), () => ( "slate")), x: x +
|
|
8646
|
+
const w = _chunk5OQV42W3cjs.textWidth.call(void 0, event2.label, _chunk5OQV42W3cjs.TYPE.action) + _chunk5OQV42W3cjs.LOOK.action.padX * 2;
|
|
8647
|
+
actions.push({ step: s, event: e, box: event2.box, text: event2.label, color: _nullishCoalesce(colors.get(event2.box), () => ( "slate")), x: x + _chunk5OQV42W3cjs.LOOK.badge.r + 4, y: y - _chunk5OQV42W3cjs.LOOK.action.h / 2, w, h: _chunk5OQV42W3cjs.LOOK.action.h });
|
|
8647
8648
|
}
|
|
8648
8649
|
});
|
|
8649
8650
|
});
|
|
8650
8651
|
const bottom = (first ? headBottom : y + below) + Q.tail;
|
|
8651
8652
|
const lifelines = order.map((id, i) => ({ id, x: xs[i], y1: headBottom, y2: bottom }));
|
|
8652
|
-
const early =
|
|
8653
|
+
const early = _chunk5OQV42W3cjs.lineBadges.call(void 0, edges, diagram.steps.length);
|
|
8653
8654
|
const labels = [];
|
|
8654
8655
|
for (const request of requests) {
|
|
8655
|
-
const seen = [...early].filter(([s]) => s <= request.step).map(([, b]) =>
|
|
8656
|
+
const seen = [...early].filter(([s]) => s <= request.step).map(([, b]) => _chunk5OQV42W3cjs.badgeRect.call(void 0, b.point));
|
|
8656
8657
|
const soft = [...labels.filter((l) => l.step === request.step), ...actions];
|
|
8657
|
-
labels.push(
|
|
8658
|
+
labels.push(_chunk5OQV42W3cjs.placeLabel.call(void 0, request, { hard: boxes, soft, touch: seen }));
|
|
8658
8659
|
}
|
|
8659
8660
|
const layout = { kind: "sequence", width: 0, height: 0, regions: [], boxes, lifelines, edges, labels, actions, badges: [], paths: [], ends: [] };
|
|
8660
8661
|
const lefts = [...boxes.map((b) => b.x), ...labels.map((l) => l.x), ...actions.map((a) => a.x)];
|
|
8661
8662
|
const shift = Math.max(0, margin - Math.min(...lefts));
|
|
8662
|
-
if (shift > 0)
|
|
8663
|
+
if (shift > 0) _chunk5OQV42W3cjs.shiftContent.call(void 0, layout, shift, 0);
|
|
8663
8664
|
const rights = [...boxes.map((b) => b.x + b.w), ...labels.map((l) => l.x + l.w), ...actions.map((a) => a.x + a.w), ...edges.flatMap((edge2) => edge2.points.map((p) => p[0]))];
|
|
8664
|
-
const width = Math.max(Math.max(...rights) + margin,
|
|
8665
|
-
const strip2 =
|
|
8665
|
+
const width = Math.max(Math.max(...rights) + margin, _chunk5OQV42W3cjs.stripNeed.call(void 0, diagram) + margin * 2);
|
|
8666
|
+
const strip2 = _chunk5OQV42W3cjs.layoutStrip.call(void 0, diagram, margin, bottom + gap, width - margin * 2);
|
|
8666
8667
|
layout.width = width;
|
|
8667
8668
|
layout.height = (strip2 ? strip2.y + strip2.h : bottom) + margin;
|
|
8668
8669
|
if (strip2) layout.strip = strip2;
|
|
@@ -8670,29 +8671,29 @@ function layoutSequence(diagram) {
|
|
|
8670
8671
|
return layout;
|
|
8671
8672
|
}
|
|
8672
8673
|
function badges(diagram, layout) {
|
|
8673
|
-
const lines =
|
|
8674
|
+
const lines = _chunk5OQV42W3cjs.lineBadges.call(void 0, layout.edges, diagram.steps.length);
|
|
8674
8675
|
const placed = diagram.steps.map((step, s) => {
|
|
8675
8676
|
const line2 = lines.get(s);
|
|
8676
8677
|
if (line2) return { step: s, x: line2.point[0], y: line2.point[1], color: line2.edge.color };
|
|
8677
8678
|
const action2 = layout.actions.find((a) => a.step === s);
|
|
8678
8679
|
const lifeline2 = action2 && layout.lifelines.find((l) => l.id === action2.box);
|
|
8679
8680
|
if (action2 && lifeline2) return { step: s, x: lifeline2.x, y: action2.y + action2.h / 2, color: action2.color };
|
|
8680
|
-
return
|
|
8681
|
+
return _chunk5OQV42W3cjs.cornerBadge.call(void 0, step.events, s, layout);
|
|
8681
8682
|
});
|
|
8682
|
-
return
|
|
8683
|
+
return _chunk5OQV42W3cjs.replaceSameSpot.call(void 0, placed);
|
|
8683
8684
|
}
|
|
8684
8685
|
|
|
8685
8686
|
// src/timeline.ts
|
|
8686
|
-
var LINEUP_LENGTH = { line:
|
|
8687
|
+
var LINEUP_LENGTH = { line: _chunk5OQV42W3cjs.MOTION.lineup.slide, seal: _chunk5OQV42W3cjs.MOTION.lineup.seal, open: _chunk5OQV42W3cjs.MOTION.fade, pick: _chunk5OQV42W3cjs.MOTION.fade, stamp: _chunk5OQV42W3cjs.MOTION.popFade };
|
|
8687
8688
|
function plan(step, needle) {
|
|
8688
8689
|
const out = { edges: [], events: [], busy: 0 };
|
|
8689
|
-
let cursor =
|
|
8690
|
+
let cursor = _chunk5OQV42W3cjs.MOTION.edgeAt;
|
|
8690
8691
|
let arrived;
|
|
8691
8692
|
let changes = 0;
|
|
8692
8693
|
let settled = Number.NEGATIVE_INFINITY;
|
|
8693
8694
|
const line2 = (e, event2, a) => {
|
|
8694
8695
|
const carries = event2.carry.kind !== "none";
|
|
8695
|
-
const b = a + (carries ?
|
|
8696
|
+
const b = a + (carries ? _chunk5OQV42W3cjs.MOTION.drawCarry : _chunk5OQV42W3cjs.MOTION.draw);
|
|
8696
8697
|
out.edges.push({ event: e, a, b, carries, coin: event2.carry.kind === "coin", named: event2.label !== void 0 });
|
|
8697
8698
|
out.busy = Math.max(out.busy, b);
|
|
8698
8699
|
return b;
|
|
@@ -8703,14 +8704,14 @@ function plan(step, needle) {
|
|
|
8703
8704
|
const pulled = (event2) => event2.type === "edge" && event2.at !== void 0 && event2.at >= p0 && event2.at < p1;
|
|
8704
8705
|
step.events.forEach((event2, e) => {
|
|
8705
8706
|
if (needle && e === _optionalChain([nows, 'access', _161 => _161[0], 'optionalAccess', _162 => _162.e])) {
|
|
8706
|
-
let t = Math.max(cursor, settled +
|
|
8707
|
+
let t = Math.max(cursor, settled + _chunk5OQV42W3cjs.MOTION.change);
|
|
8707
8708
|
const keys = [[t, p0]];
|
|
8708
8709
|
const passed = [];
|
|
8709
8710
|
for (let u = p0; u < p1; u++) {
|
|
8710
8711
|
const entry = t;
|
|
8711
8712
|
const lines = step.events.flatMap((ev, k) => pulled(ev) && ev.at === u ? [{ k, ev }] : []);
|
|
8712
|
-
const done = lines.reduce((latest, l, j) => Math.max(latest, line2(l.k, l.ev, entry +
|
|
8713
|
-
const end = Math.max(entry + needle.speed, lines.length > 0 ? done +
|
|
8713
|
+
const done = lines.reduce((latest, l, j) => Math.max(latest, line2(l.k, l.ev, entry + _chunk5OQV42W3cjs.MOTION.stagger * j)), entry);
|
|
8714
|
+
const end = Math.max(entry + needle.speed, lines.length > 0 ? done + _chunk5OQV42W3cjs.MOTION.time.wait : entry);
|
|
8714
8715
|
if (end - needle.speed > entry + 1e-9) keys.push([end - needle.speed, u]);
|
|
8715
8716
|
keys.push([end, u + 1]);
|
|
8716
8717
|
passed.push({ unit: u, at: end });
|
|
@@ -8718,7 +8719,7 @@ function plan(step, needle) {
|
|
|
8718
8719
|
}
|
|
8719
8720
|
out.sweep = { keys, passed };
|
|
8720
8721
|
out.busy = Math.max(out.busy, t);
|
|
8721
|
-
cursor = t +
|
|
8722
|
+
cursor = t + _chunk5OQV42W3cjs.MOTION.time.after;
|
|
8722
8723
|
arrived = t;
|
|
8723
8724
|
changes = 0;
|
|
8724
8725
|
return;
|
|
@@ -8728,7 +8729,7 @@ function plan(step, needle) {
|
|
|
8728
8729
|
const a = cursor;
|
|
8729
8730
|
const b = a + LINEUP_LENGTH[event2.type];
|
|
8730
8731
|
out.edges.push({ event: e, a, b, carries: false, coin: false, named: false });
|
|
8731
|
-
cursor = a +
|
|
8732
|
+
cursor = a + _chunk5OQV42W3cjs.MOTION.lineup.stagger;
|
|
8732
8733
|
arrived = b;
|
|
8733
8734
|
changes = 0;
|
|
8734
8735
|
out.busy = Math.max(out.busy, b);
|
|
@@ -8736,24 +8737,24 @@ function plan(step, needle) {
|
|
|
8736
8737
|
}
|
|
8737
8738
|
if (event2.type === "commit" || event2.type === "branch" || event2.type === "leaf" || event2.type === "node") {
|
|
8738
8739
|
const a = cursor;
|
|
8739
|
-
const b = a +
|
|
8740
|
+
const b = a + _chunk5OQV42W3cjs.MOTION.draw;
|
|
8740
8741
|
out.edges.push({ event: e, a, b, carries: false, coin: false, named: false });
|
|
8741
|
-
cursor = a +
|
|
8742
|
+
cursor = a + _chunk5OQV42W3cjs.MOTION.stagger;
|
|
8742
8743
|
arrived = b;
|
|
8743
8744
|
changes = 0;
|
|
8744
8745
|
out.busy = Math.max(out.busy, b);
|
|
8745
8746
|
} else if (event2.type === "edge") {
|
|
8746
8747
|
const a = cursor;
|
|
8747
8748
|
arrived = line2(e, event2, a);
|
|
8748
|
-
cursor = a +
|
|
8749
|
+
cursor = a + _chunk5OQV42W3cjs.MOTION.stagger;
|
|
8749
8750
|
changes = 0;
|
|
8750
8751
|
} else if (event2.type === "action") {
|
|
8751
8752
|
out.events.push({ event: e, at: cursor });
|
|
8752
|
-
out.busy = Math.max(out.busy, cursor +
|
|
8753
|
-
cursor +=
|
|
8753
|
+
out.busy = Math.max(out.busy, cursor + _chunk5OQV42W3cjs.MOTION.action);
|
|
8754
|
+
cursor += _chunk5OQV42W3cjs.MOTION.action;
|
|
8754
8755
|
changes = 0;
|
|
8755
8756
|
} else {
|
|
8756
|
-
const at = (_nullishCoalesce(arrived, () => ( cursor))) +
|
|
8757
|
+
const at = (_nullishCoalesce(arrived, () => ( cursor))) + _chunk5OQV42W3cjs.MOTION.change * changes++;
|
|
8757
8758
|
out.events.push({ event: e, at });
|
|
8758
8759
|
out.busy = Math.max(out.busy, at);
|
|
8759
8760
|
settled = Math.max(settled, at);
|
|
@@ -8764,7 +8765,7 @@ function plan(step, needle) {
|
|
|
8764
8765
|
}
|
|
8765
8766
|
function buildTimeline(diagram, still = false) {
|
|
8766
8767
|
const time = diagram.kind === "time" ? diagram.time : void 0;
|
|
8767
|
-
const T =
|
|
8768
|
+
const T = _chunk5OQV42W3cjs.MOTION.time;
|
|
8768
8769
|
const speed = time ? Math.min(T.unitMax, Math.max(T.unitMin, T.axis / Math.max(1, time.scale.count))) : 0;
|
|
8769
8770
|
let at = 0;
|
|
8770
8771
|
const plans = diagram.steps.map((step) => {
|
|
@@ -8774,16 +8775,16 @@ function buildTimeline(diagram, still = false) {
|
|
|
8774
8775
|
return p;
|
|
8775
8776
|
});
|
|
8776
8777
|
const steps = [];
|
|
8777
|
-
let t =
|
|
8778
|
+
let t = _chunk5OQV42W3cjs.MOTION.intro;
|
|
8778
8779
|
diagram.steps.forEach((step, s) => {
|
|
8779
|
-
const read = Math.min(
|
|
8780
|
-
const length = Math.max(read, (_nullishCoalesce(_optionalChain([plans, 'access', _167 => _167[s], 'optionalAccess', _168 => _168.busy]), () => ( 0))) +
|
|
8780
|
+
const read = Math.min(_chunk5OQV42W3cjs.MOTION.stepMax, Math.max(_chunk5OQV42W3cjs.MOTION.stepMin, _chunk5OQV42W3cjs.MOTION.stepBase + [...step.body].length * _chunk5OQV42W3cjs.MOTION.perChar));
|
|
8781
|
+
const length = Math.max(read, (_nullishCoalesce(_optionalChain([plans, 'access', _167 => _167[s], 'optionalAccess', _168 => _168.busy]), () => ( 0))) + _chunk5OQV42W3cjs.MOTION.dwell);
|
|
8781
8782
|
steps.push({ start: t, end: t + length });
|
|
8782
8783
|
t += length;
|
|
8783
8784
|
});
|
|
8784
8785
|
const end = t;
|
|
8785
|
-
const total = Math.ceil(end +
|
|
8786
|
-
const last = total -
|
|
8786
|
+
const total = Math.ceil(end + _chunk5OQV42W3cjs.MOTION.outro);
|
|
8787
|
+
const last = total - _chunk5OQV42W3cjs.MOTION.tail;
|
|
8787
8788
|
const lastSpan = steps[steps.length - 1];
|
|
8788
8789
|
const whole = still && lastSpan ? { start: lastSpan.start + (_nullishCoalesce(_optionalChain([plans, 'access', _169 => _169[plans.length - 1], 'optionalAccess', _170 => _170.busy]), () => ( 0))), end: last } : void 0;
|
|
8789
8790
|
const faint = _nullishCoalesce(_optionalChain([whole, 'optionalAccess', _171 => _171.start]), () => ( last));
|
|
@@ -8800,7 +8801,7 @@ function buildTimeline(diagram, still = false) {
|
|
|
8800
8801
|
const event2 = _optionalChain([diagram, 'access', _172 => _172.steps, 'access', _173 => _173[s], 'optionalAccess', _174 => _174.events, 'access', _175 => _175[edge2.event]]);
|
|
8801
8802
|
const own = diagram.kind === "git" && _optionalChain([event2, 'optionalAccess', _176 => _176.type]) === "edge" && event2.carry.kind === "tag" && event2.carry.text === event2.from;
|
|
8802
8803
|
if (edge2.carries && !own) departures.push({ step: s, event: edge2.event, who: edge2.coin ? "coin" : "main", a, b: span.start + edge2.b });
|
|
8803
|
-
if (edge2.named) named.push({ step: s, event: edge2.event, start: a +
|
|
8804
|
+
if (edge2.named) named.push({ step: s, event: edge2.event, start: a + _chunk5OQV42W3cjs.MOTION.labelDelay, end: span.end });
|
|
8804
8805
|
}
|
|
8805
8806
|
named.forEach((label2, k) => {
|
|
8806
8807
|
const later = named[k + 2];
|
|
@@ -8854,7 +8855,7 @@ function buildTimeline(diagram, still = false) {
|
|
|
8854
8855
|
labels,
|
|
8855
8856
|
badges: steps.map((span, s) => ({ step: s, appears: span.start })),
|
|
8856
8857
|
events,
|
|
8857
|
-
stills: steps.map((span) => span.end -
|
|
8858
|
+
stills: steps.map((span) => span.end - _chunk5OQV42W3cjs.MOTION.still),
|
|
8858
8859
|
...whole ? { whole } : {},
|
|
8859
8860
|
...states ? { states } : {},
|
|
8860
8861
|
...time ? { needle, units, meters: meterTimes(diagram, plans, steps) } : {}
|
|
@@ -8868,7 +8869,7 @@ function meterTimes(diagram, plans, steps) {
|
|
|
8868
8869
|
plans.forEach((p, s) => {
|
|
8869
8870
|
const start = steps[s].start;
|
|
8870
8871
|
const sets = (_nullishCoalesce(_optionalChain([diagram, 'access', _188 => _188.steps, 'access', _189 => _189[s], 'optionalAccess', _190 => _190.events]), () => ( []))).flatMap((event2, e) => {
|
|
8871
|
-
const ratio = event2.type === "strip" && event2.field === field2 && event2.value !== void 0 ?
|
|
8872
|
+
const ratio = event2.type === "strip" && event2.field === field2 && event2.value !== void 0 ? _chunk5OQV42W3cjs.ratioOf.call(void 0, event2.value) : void 0;
|
|
8872
8873
|
return ratio === void 0 ? [] : [{ e, ratio }];
|
|
8873
8874
|
});
|
|
8874
8875
|
const set = sets[sets.length - 1];
|
|
@@ -8884,14 +8885,14 @@ function meterTimes(diagram, plans, steps) {
|
|
|
8884
8885
|
if (boundary > 0 && boundary >= p0) {
|
|
8885
8886
|
const tb = start + (_nullishCoalesce(_optionalChain([sweep, 'access', _193 => _193.find, 'call', _194 => _194(([, position]) => position === boundary), 'optionalAccess', _195 => _195[0]]), () => ( first[0])));
|
|
8886
8887
|
const prev = keys[keys.length - 1][0];
|
|
8887
|
-
keys.push([Math.max(prev, tb -
|
|
8888
|
+
keys.push([Math.max(prev, tb - _chunk5OQV42W3cjs.MOTION.time.reset), value2], [tb, 0]);
|
|
8888
8889
|
base = 0;
|
|
8889
8890
|
from = boundary;
|
|
8890
8891
|
}
|
|
8891
8892
|
for (const [t, position] of sweep) if (position >= from) keys.push([start + t, base + (set.ratio - base) * (position - from) / (p1 - from)]);
|
|
8892
8893
|
} else {
|
|
8893
8894
|
const at = start + (_nullishCoalesce(_optionalChain([p, 'access', _196 => _196.events, 'access', _197 => _197.find, 'call', _198 => _198((x) => x.event === set.e), 'optionalAccess', _199 => _199.at]), () => ( 0)));
|
|
8894
|
-
keys.push([at, value2], [at +
|
|
8895
|
+
keys.push([at, value2], [at + _chunk5OQV42W3cjs.MOTION.fade, set.ratio]);
|
|
8895
8896
|
}
|
|
8896
8897
|
value2 = set.ratio;
|
|
8897
8898
|
});
|
|
@@ -8913,7 +8914,7 @@ function stateTimes(diagram, edges, last) {
|
|
|
8913
8914
|
if (on) {
|
|
8914
8915
|
const left = of(on.box);
|
|
8915
8916
|
left.lit.push({ start: on.since, end: edge2.start });
|
|
8916
|
-
if (on.box === event2.from && left.done === void 0) left.done = edge2.start +
|
|
8917
|
+
if (on.box === event2.from && left.done === void 0) left.done = edge2.start + _chunk5OQV42W3cjs.MOTION.done;
|
|
8917
8918
|
on = void 0;
|
|
8918
8919
|
}
|
|
8919
8920
|
if (!isEnd(event2.to)) on = { box: event2.to, since: edge2.drawn };
|
|
@@ -8959,33 +8960,33 @@ var Motion = (_class = class {
|
|
|
8959
8960
|
}
|
|
8960
8961
|
/** `a` で出て `b` から消える。`within` を立てると `b` までに消え終わる。 */
|
|
8961
8962
|
vis(a, b = this.last, o = {}) {
|
|
8962
|
-
const f = _nullishCoalesce(o.f, () => (
|
|
8963
|
+
const f = _nullishCoalesce(o.f, () => ( _chunk5OQV42W3cjs.MOTION.fade));
|
|
8963
8964
|
const on = _nullishCoalesce(o.on, () => ( {}));
|
|
8964
8965
|
const off = _nullishCoalesce(o.off, () => ( {}));
|
|
8965
8966
|
const out = o.within ? Math.max(a + f, b - f) : b;
|
|
8966
8967
|
return this.kf([
|
|
8967
8968
|
[0, { opacity: 0, ...off }],
|
|
8968
|
-
[a, { opacity: 0, ...off }, _nullishCoalesce(o.ein, () => (
|
|
8969
|
+
[a, { opacity: 0, ...off }, _nullishCoalesce(o.ein, () => ( _chunk5OQV42W3cjs.EASE.out))],
|
|
8969
8970
|
[a + f, { opacity: 1, ...on }],
|
|
8970
|
-
[out, { opacity: 1, ...on },
|
|
8971
|
+
[out, { opacity: 1, ...on }, _chunk5OQV42W3cjs.EASE.inOut],
|
|
8971
8972
|
[Math.min(out + f, this.total), { opacity: 0, ...off }],
|
|
8972
8973
|
[this.total, { opacity: 0, ...off }]
|
|
8973
8974
|
]);
|
|
8974
8975
|
}
|
|
8975
8976
|
/** 少し下から浮いて出る。 */
|
|
8976
8977
|
rise(a, b = this.last, within = false) {
|
|
8977
|
-
return this.vis(a, b, { on: { transform: "translateY(0)" }, off: { transform: `translateY(${
|
|
8978
|
+
return this.vis(a, b, { on: { transform: "translateY(0)" }, off: { transform: `translateY(${_chunk5OQV42W3cjs.LOOK.rise}px)` }, within });
|
|
8978
8979
|
}
|
|
8979
8980
|
/** 小さな所から弾んで出る。 */
|
|
8980
8981
|
pop(a, b = this.last) {
|
|
8981
|
-
return this.vis(a, b, { f:
|
|
8982
|
+
return this.vis(a, b, { f: _chunk5OQV42W3cjs.MOTION.popFade, ein: _chunk5OQV42W3cjs.EASE.pop, on: { transform: "scale(1)" }, off: { transform: `scale(${_chunk5OQV42W3cjs.LOOK.popFrom})` } });
|
|
8982
8983
|
}
|
|
8983
8984
|
/** 初めから出ていて `b` で消える。 */
|
|
8984
8985
|
until(b) {
|
|
8985
|
-
const f =
|
|
8986
|
+
const f = _chunk5OQV42W3cjs.MOTION.untilFade;
|
|
8986
8987
|
return this.kf([
|
|
8987
8988
|
[0, { opacity: 1 }],
|
|
8988
|
-
[b, { opacity: 1 },
|
|
8989
|
+
[b, { opacity: 1 }, _chunk5OQV42W3cjs.EASE.inOut],
|
|
8989
8990
|
[b + f, { opacity: 0 }],
|
|
8990
8991
|
[this.last, { opacity: 0 }],
|
|
8991
8992
|
[this.total, { opacity: 1 }]
|
|
@@ -9017,8 +9018,8 @@ var isTimeLayout = (layout) => layout.kind === "time";
|
|
|
9017
9018
|
var isTreeLayout = (layout) => layout.kind === "tree";
|
|
9018
9019
|
var font = (t) => `font:${t.weight} ${t.size}px var(--${t.family})`;
|
|
9019
9020
|
var mix = (pct, base = "var(--surf)") => `color-mix(in srgb,var(--c) ${pct}%,${base})`;
|
|
9020
|
-
var S =
|
|
9021
|
-
var X =
|
|
9021
|
+
var S = _chunk5OQV42W3cjs.LOOK.stroke;
|
|
9022
|
+
var X = _chunk5OQV42W3cjs.LOOK.mix;
|
|
9022
9023
|
var PAST = `color-mix(in srgb,var(--mute) ${X.past}%,var(--bg))`;
|
|
9023
9024
|
var PART_CSS = [
|
|
9024
9025
|
".dg{display:block;width:100%;height:auto;overflow:visible}",
|
|
@@ -9027,83 +9028,83 @@ var PART_CSS = [
|
|
|
9027
9028
|
".dg-bg{fill:var(--bg)}",
|
|
9028
9029
|
".dg-band{fill:color-mix(in srgb,var(--c) var(--tint),var(--bg));stroke:color-mix(in srgb,var(--c) var(--edge),transparent)}",
|
|
9029
9030
|
`.dg-bi{fill:${mix(X.regionIcon)};stroke:${mix(X.regionIconEdge, "transparent")}}`,
|
|
9030
|
-
`.dg-bz{${font(
|
|
9031
|
-
`.dg-bx{${font(
|
|
9031
|
+
`.dg-bz{${font(_chunk5OQV42W3cjs.TYPE.regionName)};fill:var(--ct)}`,
|
|
9032
|
+
`.dg-bx{${font(_chunk5OQV42W3cjs.TYPE.regionNote)};fill:var(--mute)}`,
|
|
9032
9033
|
".dg-st{fill:var(--surf);stroke:var(--hair)}",
|
|
9033
9034
|
`.dg-halo{fill:none;stroke:var(--c);stroke-width:${S.halo};stroke-opacity:.16}`,
|
|
9034
9035
|
`.dg-on{fill:none;stroke:var(--c);stroke-width:${S.on}}`,
|
|
9035
9036
|
`.dg-ic{fill:${mix(X.icon)}}`,
|
|
9036
9037
|
`.dg-slot{fill:none;stroke:${mix(X.slot, "transparent")};stroke-width:${S.slot};stroke-dasharray:3 3}`,
|
|
9037
9038
|
`.dg-gl{fill:none;stroke:var(--c);stroke-width:${S.glyph};stroke-linecap:round;stroke-linejoin:round}`,
|
|
9038
|
-
`.dg-sn{${font(
|
|
9039
|
-
`.dg-ss{${font(
|
|
9040
|
-
`.dg-ss-ok{${font(
|
|
9041
|
-
`.dg-ss-act{${font(
|
|
9039
|
+
`.dg-sn{${font(_chunk5OQV42W3cjs.TYPE.boxName)};fill:var(--ink)}`,
|
|
9040
|
+
`.dg-ss{${font(_chunk5OQV42W3cjs.TYPE.boxSub)};fill:var(--mute)}`,
|
|
9041
|
+
`.dg-ss-ok{${font(_chunk5OQV42W3cjs.TYPE.boxSubStrong)};fill:var(--ct)}`,
|
|
9042
|
+
`.dg-ss-act{${font(_chunk5OQV42W3cjs.TYPE.boxSubStrong)};fill:var(--ink)}`,
|
|
9042
9043
|
`.dg-ll{stroke:var(--line);stroke-width:${S.lifeline};stroke-dasharray:3 4}`,
|
|
9043
|
-
`.dg-e{fill:none;stroke:var(--line);stroke-width:${S.edge};stroke-linecap:round;stroke-dasharray:0 ${
|
|
9044
|
+
`.dg-e{fill:none;stroke:var(--line);stroke-width:${S.edge};stroke-linecap:round;stroke-dasharray:0 ${_chunk5OQV42W3cjs.LOOK.edge.ghostDash}}`,
|
|
9044
9045
|
`.dg-eh{fill:none;stroke:var(--line);stroke-width:${S.arrow};stroke-linecap:round;stroke-linejoin:round}`,
|
|
9045
9046
|
`.dg-e-on{fill:none;stroke:var(--c);stroke-width:${S.edgeOn};stroke-linecap:round;stroke-dasharray:1 2}`,
|
|
9046
9047
|
`.dg-eh-on{fill:none;stroke:var(--c);stroke-width:${S.edgeOn};stroke-linecap:round;stroke-linejoin:round}`,
|
|
9047
|
-
`.dg-flow{fill:none;stroke:var(--surf);stroke-width:${S.flow};stroke-linecap:round;stroke-dasharray:1.5 ${
|
|
9048
|
+
`.dg-flow{fill:none;stroke:var(--surf);stroke-width:${S.flow};stroke-linecap:round;stroke-dasharray:1.5 ${_chunk5OQV42W3cjs.LOOK.edge.flowDash}}`,
|
|
9048
9049
|
`.dg-e-past{fill:none;stroke:${PAST};stroke-width:${S.edge};stroke-linecap:round}`,
|
|
9049
9050
|
`.dg-eh-past{fill:none;stroke:${PAST};stroke-width:${S.arrow};stroke-linecap:round;stroke-linejoin:round}`,
|
|
9050
9051
|
".dg-bd{cursor:pointer}",
|
|
9051
9052
|
".dg-bdf{fill:var(--c)}",
|
|
9052
|
-
`.dg-bdft{${font(
|
|
9053
|
+
`.dg-bdft{${font(_chunk5OQV42W3cjs.TYPE.badge)};fill:var(--on-c)}`,
|
|
9053
9054
|
`.dg-bdr{fill:none;stroke:var(--c);stroke-width:${S.badgeRing};pointer-events:none}`,
|
|
9054
9055
|
`.dg-bdp{fill:${mix(X.badgePast)};stroke:${mix(X.badgePastEdge, "transparent")};stroke-width:${S.hair}}`,
|
|
9055
|
-
`.dg-bdpt{${font(
|
|
9056
|
+
`.dg-bdpt{${font(_chunk5OQV42W3cjs.TYPE.badge)};fill:var(--ct)}`,
|
|
9056
9057
|
`.dg-bdp-g{fill:var(--surf);stroke:${PAST};stroke-width:${S.hair}}`,
|
|
9057
|
-
`.dg-bdpt-g{${font(
|
|
9058
|
+
`.dg-bdpt-g{${font(_chunk5OQV42W3cjs.TYPE.badge)};fill:var(--mute)}`,
|
|
9058
9059
|
`.dg-cap rect,.dg-act rect{fill:${mix(X.cap)};stroke:${mix(X.capEdge, "transparent")}}`,
|
|
9059
|
-
`.dg-cap text{${font(
|
|
9060
|
-
`.dg-capj text{${font(
|
|
9061
|
-
`.dg-cap-past text{${font(
|
|
9062
|
-
`.dg-cap-pastj text{${font(
|
|
9063
|
-
`.dg-act text{${font(
|
|
9060
|
+
`.dg-cap text{${font(_chunk5OQV42W3cjs.TYPE.label)};fill:var(--ct)}`,
|
|
9061
|
+
`.dg-capj text{${font(_chunk5OQV42W3cjs.TYPE.labelJa)}}`,
|
|
9062
|
+
`.dg-cap-past text{${font(_chunk5OQV42W3cjs.TYPE.label)};fill:var(--mute);fill-opacity:${_chunk5OQV42W3cjs.LOOK.state.pastLabel}}`,
|
|
9063
|
+
`.dg-cap-pastj text{${font(_chunk5OQV42W3cjs.TYPE.labelJa)}}`,
|
|
9064
|
+
`.dg-act text{${font(_chunk5OQV42W3cjs.TYPE.action)};fill:var(--ct)}`,
|
|
9064
9065
|
".dg-car{fill:var(--carry,var(--ink))}",
|
|
9065
|
-
`.dg-car-t{${font(
|
|
9066
|
-
`.dg-car-tj{${font(
|
|
9066
|
+
`.dg-car-t{${font(_chunk5OQV42W3cjs.TYPE.carrier)};fill:var(--bg)}`,
|
|
9067
|
+
`.dg-car-tj{${font(_chunk5OQV42W3cjs.TYPE.carrierJa)}}`,
|
|
9067
9068
|
`.dg-env{fill:var(--carry,var(--ink));stroke:var(--surf);stroke-width:${S.envelope}}`,
|
|
9068
9069
|
`.dg-env-in{fill:none;stroke:var(--surf);stroke-width:${S.flow};stroke-linejoin:round;stroke-linecap:round}`,
|
|
9069
9070
|
".dg-coin{fill:var(--coin);stroke:var(--surf);stroke-width:1.2}",
|
|
9070
9071
|
".dg-coin-in{fill:none;stroke:var(--coinin);stroke-width:1.1}",
|
|
9071
9072
|
".dg-strip{fill:var(--surf);stroke:var(--hair)}",
|
|
9072
9073
|
`.dg-sep{stroke:var(--hair);stroke-width:${S.hair}}`,
|
|
9073
|
-
`.dg-sh{${font(
|
|
9074
|
-
`.dg-fl{${font(
|
|
9075
|
-
`.dg-fv{${font(
|
|
9076
|
-
`.dg-fvj{${font(
|
|
9074
|
+
`.dg-sh{${font(_chunk5OQV42W3cjs.TYPE.stripTitle)};fill:var(--ink)}`,
|
|
9075
|
+
`.dg-fl{${font(_chunk5OQV42W3cjs.TYPE.fieldName)};fill:var(--mute)}`,
|
|
9076
|
+
`.dg-fv{${font(_chunk5OQV42W3cjs.TYPE.fieldValue)};fill:var(--ink)}`,
|
|
9077
|
+
`.dg-fvj{${font(_chunk5OQV42W3cjs.TYPE.fieldValueJa)};fill:var(--ink)}`,
|
|
9077
9078
|
".dg-fv-c{fill:var(--ct)}",
|
|
9078
9079
|
".dg-fl-now{fill:var(--c)}",
|
|
9079
9080
|
`.dg-tr-ring{fill:none;stroke:var(--line);stroke-width:${S.trail}}`,
|
|
9080
9081
|
".dg-tr-fill{fill:var(--c)}",
|
|
9081
9082
|
".dg-tg rect{fill:var(--c)}",
|
|
9082
|
-
`.dg-tg text{${font(
|
|
9083
|
+
`.dg-tg text{${font(_chunk5OQV42W3cjs.TYPE.tag)};fill:var(--on-c)}`,
|
|
9083
9084
|
`.dg-side{fill:color-mix(in srgb,var(--c) ${X.side}%,var(--bg));stroke:${mix(X.sideEdge, "transparent")};stroke-dasharray:4 4}`,
|
|
9084
|
-
`.dg-side-t{${font(
|
|
9085
|
-
`.dg-side-n{${font(
|
|
9085
|
+
`.dg-side-t{${font(_chunk5OQV42W3cjs.TYPE.regionName)};fill:var(--ct)}`,
|
|
9086
|
+
`.dg-side-n{${font(_chunk5OQV42W3cjs.TYPE.regionNote)};fill:var(--mute)}`,
|
|
9086
9087
|
`.dg-ghost{fill:var(--surf);stroke:${mix(X.ghostEdge, "transparent")};stroke-dasharray:4 3}`,
|
|
9087
|
-
`.dg-path{fill:none;stroke:${mix(X.path, "transparent")};stroke-width:${S.path};stroke-linecap:round;stroke-dasharray:0 ${
|
|
9088
|
+
`.dg-path{fill:none;stroke:${mix(X.path, "transparent")};stroke-width:${S.path};stroke-linecap:round;stroke-dasharray:0 ${_chunk5OQV42W3cjs.LOOK.edge.ghostDash}}`,
|
|
9088
9089
|
`.dg-path-h{fill:none;stroke:${mix(X.path, "transparent")};stroke-width:${S.arrow};stroke-linecap:round;stroke-linejoin:round}`,
|
|
9089
|
-
`.dg-path-t{${font(
|
|
9090
|
-
`.dg-path-tj{${font(
|
|
9090
|
+
`.dg-path-t{${font(_chunk5OQV42W3cjs.TYPE.label)};fill:var(--ct)}`,
|
|
9091
|
+
`.dg-path-tj{${font(_chunk5OQV42W3cjs.TYPE.labelJa)}}`,
|
|
9091
9092
|
".dg-start{fill:var(--ink)}",
|
|
9092
9093
|
`.dg-end{fill:var(--bg);stroke:var(--ink);stroke-width:${S.end}}`,
|
|
9093
9094
|
".dg-end-in{fill:var(--ink)}",
|
|
9094
9095
|
`.dg-end-x{fill:var(--bg);stroke:${mix(X.path, "transparent")};stroke-width:${S.arrow};stroke-dasharray:2 2.5}`,
|
|
9095
9096
|
`.dg-end-xi{fill:${mix(X.path, "transparent")}}`,
|
|
9096
|
-
`.dg-mark{${font(
|
|
9097
|
+
`.dg-mark{${font(_chunk5OQV42W3cjs.TYPE.regionNote)};fill:var(--mute)}`,
|
|
9097
9098
|
`.dg-done{fill:var(--ink);stroke:var(--surf);stroke-width:${S.done}}`,
|
|
9098
9099
|
`.dg-done-ck{fill:none;stroke:var(--surf);stroke-width:${S.glyph};stroke-linecap:round;stroke-linejoin:round}`,
|
|
9099
9100
|
`.dg-git-l{fill:none;stroke:var(--c);stroke-width:${S.git};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,
|
|
9100
9101
|
`.dg-git-cp{fill:none;stroke:var(--c);stroke-width:${S.gitOrphan};stroke-linecap:round;stroke-dasharray:3 3;stroke-opacity:.7}`,
|
|
9101
9102
|
`.dg-git-c{fill:var(--surf);stroke:var(--c);stroke-width:${S.git}}`,
|
|
9102
|
-
`.dg-git-id{${font(
|
|
9103
|
-
`.dg-git-h{${font(
|
|
9104
|
-
`.dg-git-n{${font(
|
|
9103
|
+
`.dg-git-id{${font(_chunk5OQV42W3cjs.TYPE.gitId)};fill:var(--ct)}`,
|
|
9104
|
+
`.dg-git-h{${font(_chunk5OQV42W3cjs.TYPE.gitHash)};fill:var(--mute)}`,
|
|
9105
|
+
`.dg-git-n{${font(_chunk5OQV42W3cjs.TYPE.gitNote)};fill:var(--ink2)}`,
|
|
9105
9106
|
`.dg-git-old{fill:var(--surf);stroke:var(--c);stroke-width:${S.gitOrphan};stroke-dasharray:3 3;stroke-opacity:.6}`,
|
|
9106
|
-
`.dg-git-oldl{${font(
|
|
9107
|
+
`.dg-git-oldl{${font(_chunk5OQV42W3cjs.TYPE.gitId)};fill:var(--ct);opacity:.55}`,
|
|
9107
9108
|
// 木の図 (#3233)。木の線は線の灰で、運ぶ物が通った跡は運ぶ物の色で引く
|
|
9108
9109
|
`.dg-tree-l{fill:none;stroke:var(--line);stroke-width:${S.tree};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,
|
|
9109
9110
|
`.dg-tree-tr{fill:none;stroke:var(--c);stroke-width:${S.treeTrail};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,
|
|
@@ -9111,66 +9112,66 @@ var PART_CSS = [
|
|
|
9111
9112
|
`.dg-tree-con{fill:none;stroke:var(--line);stroke-width:${S.treeCon};stroke-linecap:round;stroke-dasharray:2 3.5}`,
|
|
9112
9113
|
`.dg-tree-card{fill:var(--surf);stroke:var(--hair);stroke-width:${S.hair}}`,
|
|
9113
9114
|
`.dg-tree-cg{fill:none;stroke:var(--mute);stroke-width:${S.glyph};stroke-linecap:round;stroke-linejoin:round}`,
|
|
9114
|
-
`.dg-tree-ct{${font(
|
|
9115
|
-
`.dg-tree-hash{${font(
|
|
9116
|
-
`.dg-tree-name{${font(
|
|
9117
|
-
`.dg-tree-one{${font(
|
|
9118
|
-
`.dg-tree-rh{${font(
|
|
9119
|
-
`.dg-tree-rn{${font(
|
|
9115
|
+
`.dg-tree-ct{${font(_chunk5OQV42W3cjs.TYPE.treeCard)};fill:var(--ink)}`,
|
|
9116
|
+
`.dg-tree-hash{${font(_chunk5OQV42W3cjs.TYPE.treeHash)};fill:var(--ink)}`,
|
|
9117
|
+
`.dg-tree-name{${font(_chunk5OQV42W3cjs.TYPE.treeName)};fill:var(--mute)}`,
|
|
9118
|
+
`.dg-tree-one{${font(_chunk5OQV42W3cjs.TYPE.boxName)};fill:var(--ink)}`,
|
|
9119
|
+
`.dg-tree-rh{${font(_chunk5OQV42W3cjs.TYPE.rootHash)};fill:var(--ink)}`,
|
|
9120
|
+
`.dg-tree-rn{${font(_chunk5OQV42W3cjs.TYPE.rootName)};fill:var(--mute)}`,
|
|
9120
9121
|
// 列の図 (#3239)。封は列の左端から右へ伸びる
|
|
9121
9122
|
".dg-ln-chip{fill:var(--c)}",
|
|
9122
9123
|
`.dg-ln-plain{fill:color-mix(in srgb,var(--mute) ${X.chipPlain}%,var(--surf))}`,
|
|
9123
|
-
`.dg-ln-t{${font(
|
|
9124
|
-
`.dg-ln-tp{${font(
|
|
9124
|
+
`.dg-ln-t{${font(_chunk5OQV42W3cjs.TYPE.chip)};fill:var(--on-c)}`,
|
|
9125
|
+
`.dg-ln-tp{${font(_chunk5OQV42W3cjs.TYPE.chip)};fill:var(--ink)}`,
|
|
9125
9126
|
".dg-ln-seal{transform-box:fill-box;transform-origin:0 50%}",
|
|
9126
9127
|
`.dg-ln-sd{fill:color-mix(in srgb,var(--mute) ${X.sealDark}%,var(--surf))}`,
|
|
9127
9128
|
`.dg-ln-sl{fill:color-mix(in srgb,var(--mute) ${X.sealLight}%,var(--surf))}`,
|
|
9128
9129
|
`.dg-ln-stamp{fill:var(--surf);stroke:var(--c);stroke-width:${S.stamp}}`,
|
|
9129
|
-
`.dg-ln-st{${font(
|
|
9130
|
+
`.dg-ln-st{${font(_chunk5OQV42W3cjs.TYPE.stamp)};fill:var(--ct)}`,
|
|
9130
9131
|
// 時間軸の図 (#3165)。和文を含む字は、末尾に j を付けた class で同じ大きさと太さの和文の字にする
|
|
9131
9132
|
`.dg-tm-ep{fill:color-mix(in srgb,var(--ink) ${X.timeShade}%,transparent)}`,
|
|
9132
9133
|
`.dg-tm-sep{stroke:var(--hair);stroke-width:${S.hair};stroke-dasharray:2 4}`,
|
|
9133
|
-
`.dg-tm-hd{${font(
|
|
9134
|
-
`.dg-tm-hdj{${font(
|
|
9134
|
+
`.dg-tm-hd{${font(_chunk5OQV42W3cjs.TYPE.timeHead)};fill:var(--ink)}`,
|
|
9135
|
+
`.dg-tm-hdj{${font(_chunkJCEKXALJcjs.sansOf.call(void 0, _chunk5OQV42W3cjs.TYPE.timeHead))}}`,
|
|
9135
9136
|
`.dg-tm-slot{fill:none;stroke:var(--line);stroke-width:${S.timeSlot};opacity:.55}`,
|
|
9136
9137
|
".dg-tm-m{fill:var(--c)}",
|
|
9137
9138
|
".dg-tm-x{fill:var(--c-slate)}",
|
|
9138
9139
|
`.dg-tm-fr{fill:none;stroke:var(--c-blue);stroke-width:${S.timeFrame};stroke-dasharray:3 2}`,
|
|
9139
9140
|
`.dg-tm-gd{fill:none;stroke:color-mix(in srgb,var(--c-blue) ${X.timeGuide}%,transparent);stroke-width:${S.hair};stroke-dasharray:2 3}`,
|
|
9140
9141
|
`.dg-tm-ax{fill:none;stroke:var(--line);stroke-width:${S.timeAxis}}`,
|
|
9141
|
-
`.dg-tm-tk{${font(
|
|
9142
|
-
`.dg-tm-tkj{${font(
|
|
9143
|
-
`.dg-tm-en{${font(
|
|
9144
|
-
`.dg-tm-er{${font(
|
|
9145
|
-
`.dg-tm-erj{${font(
|
|
9146
|
-
`.dg-tm-rn{${font(
|
|
9142
|
+
`.dg-tm-tk{${font(_chunk5OQV42W3cjs.TYPE.timeTick)};fill:var(--mute)}`,
|
|
9143
|
+
`.dg-tm-tkj{${font(_chunkJCEKXALJcjs.sansOf.call(void 0, _chunk5OQV42W3cjs.TYPE.timeTick))}}`,
|
|
9144
|
+
`.dg-tm-en{${font(_chunk5OQV42W3cjs.TYPE.timePeriod)};fill:var(--ink2)}`,
|
|
9145
|
+
`.dg-tm-er{${font(_chunk5OQV42W3cjs.TYPE.timeRange)};fill:var(--mute)}`,
|
|
9146
|
+
`.dg-tm-erj{${font(_chunkJCEKXALJcjs.sansOf.call(void 0, _chunk5OQV42W3cjs.TYPE.timeRange))}}`,
|
|
9147
|
+
`.dg-tm-rn{${font(_chunk5OQV42W3cjs.TYPE.timeRow)};fill:var(--ink2)}`,
|
|
9147
9148
|
`.dg-tm-br{fill:none;stroke:var(--c);stroke-width:${S.timeSpan};stroke-linecap:round;stroke-linejoin:round}`,
|
|
9148
|
-
`.dg-tm-bt{${font(
|
|
9149
|
+
`.dg-tm-bt{${font(_chunk5OQV42W3cjs.TYPE.spanText)};fill:var(--ct)}`,
|
|
9149
9150
|
`.dg-tm-bx{fill:color-mix(in srgb,var(--c) ${X.timeSpan}%,transparent);stroke:var(--c);stroke-width:${S.timeSpan};stroke-dasharray:4 3}`,
|
|
9150
9151
|
`.dg-tm-con{fill:none;stroke:var(--line);stroke-width:${S.timeDrop};stroke-linecap:round;stroke-dasharray:0 3.5}`,
|
|
9151
9152
|
".dg-tm-pg{fill:var(--surf);stroke:var(--line);stroke-dasharray:2 2.5}",
|
|
9152
9153
|
`.dg-tm-pgl{fill:none;stroke:var(--mute);stroke-width:${S.timeFlag};stroke-linecap:round;stroke-linejoin:round}`,
|
|
9153
9154
|
`.dg-tm-pc{fill:var(--surf);stroke:var(--c);stroke-width:${S.timePoint}}`,
|
|
9154
9155
|
`.dg-tm-pcg{fill:none;stroke:var(--c);stroke-width:${S.timeFlag};stroke-linecap:round;stroke-linejoin:round}`,
|
|
9155
|
-
`.dg-tm-pn{${font(
|
|
9156
|
-
`.dg-tm-pnj{${font(
|
|
9156
|
+
`.dg-tm-pn{${font(_chunk5OQV42W3cjs.TYPE.pointName)};fill:var(--ink)}`,
|
|
9157
|
+
`.dg-tm-pnj{${font(_chunkJCEKXALJcjs.sansOf.call(void 0, _chunk5OQV42W3cjs.TYPE.pointName))}}`,
|
|
9157
9158
|
".dg-tm-pn-g{fill:var(--mute)}",
|
|
9158
|
-
`.dg-tm-ps{${font(
|
|
9159
|
+
`.dg-tm-ps{${font(_chunk5OQV42W3cjs.TYPE.pointState)};fill:var(--ct)}`,
|
|
9159
9160
|
`.dg-tm-ln{fill:none;stroke:var(--c);stroke-width:${S.edgeOn};stroke-linecap:round;stroke-dasharray:1 2}`,
|
|
9160
9161
|
`.dg-tm-nd{stroke:var(--ink);stroke-width:${S.timeNeedle};opacity:.55}`,
|
|
9161
9162
|
".dg-tm-nh{fill:var(--ink)}",
|
|
9162
9163
|
".dg-tm-ph{fill:none;stroke:var(--line);stroke-dasharray:3 3}",
|
|
9163
9164
|
`.dg-tm-ex{fill:color-mix(in srgb,var(--c-slate) ${X.timeEmpty}%,var(--surf));stroke:var(--c-slate);stroke-width:${S.timeFrame};stroke-dasharray:3 3}`,
|
|
9164
|
-
`.dg-tm-ext{${font(
|
|
9165
|
+
`.dg-tm-ext{${font(_chunk5OQV42W3cjs.TYPE.emptyText)};fill:var(--t-slate)}`,
|
|
9165
9166
|
".dg-tm-mt{fill:var(--hair)}",
|
|
9166
9167
|
".dg-tm-mf{fill:var(--c);transform-box:fill-box;transform-origin:0 50%}",
|
|
9167
9168
|
`.dg-tm-mk{stroke:var(--ink2);stroke-width:${S.timeMeter}}`,
|
|
9168
|
-
`.dg-tm-ml{${font(
|
|
9169
|
+
`.dg-tm-ml{${font(_chunk5OQV42W3cjs.TYPE.meterLine)};fill:var(--ink2)}`,
|
|
9169
9170
|
".dg-vp-bg{fill:var(--bg)}",
|
|
9170
9171
|
".dg-vp-frame{fill:none;stroke:var(--hair)}",
|
|
9171
9172
|
".dg-hd-bg{fill:var(--bg)}",
|
|
9172
9173
|
".dg-mm-bg{fill:var(--surf);stroke:var(--hair)}",
|
|
9173
|
-
`.dg-mm-t{${font(
|
|
9174
|
+
`.dg-mm-t{${font(_chunk5OQV42W3cjs.TYPE.miniTitle)};fill:var(--mute)}`,
|
|
9174
9175
|
".dg-mm-world{fill:var(--sunk);stroke:var(--hair)}",
|
|
9175
9176
|
`.dg-mm-band{fill:${mix(X.miniBand)};stroke:${mix(X.miniBandEdge, "transparent")};stroke-width:.6}`,
|
|
9176
9177
|
`.dg-mm-card{fill:${mix(X.mini)}}`,
|
|
@@ -9235,7 +9236,7 @@ function subChanges(diagram, timeline, actionsInBox) {
|
|
|
9235
9236
|
}
|
|
9236
9237
|
const kept = list2.filter((change, k) => {
|
|
9237
9238
|
const next = list2[k + 1];
|
|
9238
|
-
return next === void 0 || next[0] - change[0] >=
|
|
9239
|
+
return next === void 0 || next[0] - change[0] >= _chunk5OQV42W3cjs.MOTION.minShow;
|
|
9239
9240
|
});
|
|
9240
9241
|
out.set(box.id, kept);
|
|
9241
9242
|
}
|
|
@@ -9262,25 +9263,26 @@ function fadeBefore(l, time, steps) {
|
|
|
9262
9263
|
return cut > after.start ? { ...rest, after: { start: after.start, end: Math.min(after.end, cut) } } : rest;
|
|
9263
9264
|
}
|
|
9264
9265
|
function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], traces = []) {
|
|
9265
|
-
const vars =
|
|
9266
|
+
const vars = _chunk5OQV42W3cjs.paletteVars.call(void 0, palette, theme);
|
|
9266
9267
|
const id = nameOf(`${JSON.stringify(diagram)}|${vars}|${follow ? `${follow.width}|${follow.lang}` : ""}`);
|
|
9267
9268
|
const m = new Motion(`dg${id}`, timeline.total, timeline.last);
|
|
9268
9269
|
const ctx = { m, t: timeline, id, sh: `filter="url(#dg-sh-${id})"`, end: timeline.steps[timeline.steps.length - 1].end, ink, traces };
|
|
9269
9270
|
const on = involved(diagram);
|
|
9270
9271
|
const subs = subChanges(diagram, timeline, layout.kind !== "sequence");
|
|
9271
9272
|
const L = { band: [], base: [], lit: [], node: [], badge: [], top: [] };
|
|
9272
|
-
for (const region of layout.regions) L.band.push(
|
|
9273
|
+
for (const region of layout.regions) L.band.push(_chunkJCEKXALJcjs.band.call(void 0, region, ink));
|
|
9273
9274
|
const ghostColor = _nullishCoalesce(_optionalChain([layout, 'access', _220 => _220.boxes, 'access', _221 => _221.find, 'call', _222 => _222((b) => b.ghost), 'optionalAccess', _223 => _223.color]), () => ( "slate"));
|
|
9274
|
-
if (layout.side) L.band.push(
|
|
9275
|
+
if (layout.side) L.band.push(_chunkJCEKXALJcjs.side.call(void 0, layout.side, ghostColor, ink));
|
|
9275
9276
|
const boxColor = (id2, ghost) => _optionalChain([layout, 'access', _224 => _224.boxes, 'access', _225 => _225.find, 'call', _226 => _226((b) => b.id === id2 && (ghost === void 0 || b.ghost === ghost)), 'optionalAccess', _227 => _227.color]);
|
|
9276
|
-
for (const p of layout.paths) L.base.push(
|
|
9277
|
-
for (const e of layout.ends) L.node.push(
|
|
9277
|
+
for (const p of layout.paths) L.base.push(_chunkJCEKXALJcjs.path.call(void 0, p, _nullishCoalesce(_nullishCoalesce(boxColor(p.to, true), () => ( boxColor(p.from))), () => ( ghostColor)), ink, traces));
|
|
9278
|
+
for (const e of layout.ends) L.node.push(_chunkJCEKXALJcjs.endMark.call(void 0, e, ghostColor, ink));
|
|
9278
9279
|
const isState = layout.kind === "state";
|
|
9279
9280
|
const arrivals = new Map((_nullishCoalesce(timeline.states, () => ( []))).flatMap((s) => s.lit[0] ? [[s.box, s.lit[0].start]] : []));
|
|
9280
9281
|
const meters = new Map((_nullishCoalesce(timeline.meters, () => ( []))).map((meter) => [meter.field, meter.keys]));
|
|
9281
9282
|
const gauge = (field2) => field2.meter ? kindParts("time").meterField({ ...field2, meter: field2.meter }, _nullishCoalesce(meters.get(field2.name), () => ( [[0, 0]])), ctx) : void 0;
|
|
9282
|
-
|
|
9283
|
-
|
|
9283
|
+
const drawStrip = (s) => _chunkJCEKXALJcjs.strip.call(void 0, s, fieldChanges(diagram, timeline, layout), ctx, isState, arrivals, gauge);
|
|
9284
|
+
if (layout.strip && !follow) L.band.push(drawStrip(layout.strip));
|
|
9285
|
+
for (const line2 of layout.lifelines) L.base.push(_chunkJCEKXALJcjs.lifeline.call(void 0, line2.x, line2.y1, line2.y2));
|
|
9284
9286
|
if (isGitLayout(layout)) {
|
|
9285
9287
|
const git = kindParts("git").drawGit(layout, diagram, timeline, ctx);
|
|
9286
9288
|
L.base.push(git.links);
|
|
@@ -9315,57 +9317,61 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
|
|
|
9315
9317
|
const time = timeline.edges.find((t) => t.step === e.step && t.event === e.event);
|
|
9316
9318
|
if (!time || timeLayout && !wired.has(`${e.step}/${e.event}`) || runs.has(`${e.step}/${e.event}`)) continue;
|
|
9317
9319
|
const since = Math.max(_nullishCoalesce(_optionalChain([tree, 'optionalAccess', _230 => _230.appear, 'access', _231 => _231.get, 'call', _232 => _232(e.from)]), () => ( 0)), _nullishCoalesce(_optionalChain([tree, 'optionalAccess', _233 => _233.appear, 'access', _234 => _234.get, 'call', _235 => _235(e.to)]), () => ( 0)));
|
|
9318
|
-
const drawn =
|
|
9320
|
+
const drawn = _chunkJCEKXALJcjs.edge.call(void 0, e, time, ctx, isState, since);
|
|
9319
9321
|
L.base.push(drawn.base);
|
|
9320
9322
|
L.lit.push(drawn.lit);
|
|
9321
9323
|
}
|
|
9322
9324
|
const states = new Map((_nullishCoalesce(timeline.states, () => ( []))).map((s) => [s.box, s]));
|
|
9323
9325
|
const links = new Map(diagram.boxes.flatMap((b) => b.link === void 0 ? [] : [[b.id, b.link]]));
|
|
9324
|
-
const linked = (id2, markup) =>
|
|
9326
|
+
const linked = (id2, markup) => _chunkJCEKXALJcjs.linkTo.call(void 0, links.get(id2), markup);
|
|
9325
9327
|
for (const box of timeLayout || lineupLayout ? [] : layout.boxes) {
|
|
9326
9328
|
if (box.ghost) {
|
|
9327
|
-
L.node.push(linked(box.id,
|
|
9329
|
+
L.node.push(linked(box.id, _chunkJCEKXALJcjs.ghostCard.call(void 0, box, ink)));
|
|
9328
9330
|
continue;
|
|
9329
9331
|
}
|
|
9330
9332
|
const state = states.get(box.id);
|
|
9331
|
-
L.node.push(linked(box.id,
|
|
9332
|
-
if (_optionalChain([state, 'optionalAccess', _237 => _237.done]) !== void 0) L.node.push(
|
|
9333
|
+
L.node.push(linked(box.id, _chunkJCEKXALJcjs.card.call(void 0, box, ctx, _nullishCoalesce(on.get(box.id), () => ( [])), _nullishCoalesce(subs.get(box.id), () => ( [])), isState ? _nullishCoalesce(_optionalChain([state, 'optionalAccess', _236 => _236.lit]), () => ( [])) : void 0)));
|
|
9334
|
+
if (_optionalChain([state, 'optionalAccess', _237 => _237.done]) !== void 0) L.node.push(_chunkJCEKXALJcjs.doneMark.call(void 0, box, state.done, ctx));
|
|
9333
9335
|
}
|
|
9334
|
-
for (const b of layout.badges) L.badge.push(
|
|
9336
|
+
for (const b of layout.badges) if (!(follow && onStrip(layout, b))) L.badge.push(_chunkJCEKXALJcjs.badge.call(void 0, b, ctx, isState));
|
|
9335
9337
|
for (const l of layout.labels) {
|
|
9336
9338
|
const time = timeline.labels.find((t) => t.step === l.step && t.event === l.event);
|
|
9337
|
-
if (time) L.top.push(
|
|
9339
|
+
if (time) L.top.push(_chunkJCEKXALJcjs.label.call(void 0, l, fadeBefore(l, time, timeline.steps), ctx));
|
|
9338
9340
|
}
|
|
9339
9341
|
const { whole } = timeline;
|
|
9340
9342
|
for (const a of layout.actions) {
|
|
9341
9343
|
const time = timeline.events.find((t) => t.step === a.step && t.event === a.event);
|
|
9342
9344
|
if (!time) continue;
|
|
9343
9345
|
const until = timeline.steps[a.step].end;
|
|
9344
|
-
L.top.push(whole && until > whole.start ?
|
|
9346
|
+
L.top.push(whole && until > whole.start ? _chunkJCEKXALJcjs.action.call(void 0, a, time.at, whole.end, ctx) : _chunkJCEKXALJcjs.action.call(void 0, a, time.at, until, ctx, whole));
|
|
9345
9347
|
}
|
|
9346
9348
|
for (const time of timeline.carriers) {
|
|
9347
9349
|
const e = layout.edges.find((x) => x.step === time.step && x.event === time.event);
|
|
9348
|
-
if (e) L.top.push(
|
|
9350
|
+
if (e) L.top.push(_chunkJCEKXALJcjs.carrier.call(void 0, e, treeLayout ? { ...time, start: time.depart, end: time.arrive + _chunk5OQV42W3cjs.MOTION.fade } : time, ctx));
|
|
9349
9351
|
}
|
|
9350
9352
|
const content = Object.values(L).map((parts) => parts.join("")).join("");
|
|
9351
|
-
const { near, far, nearY, farY } =
|
|
9353
|
+
const { near, far, nearY, farY } = _chunk5OQV42W3cjs.LOOK.shadow;
|
|
9352
9354
|
const shadow = `<filter id="dg-sh-${id}" x="-20%" y="-30%" width="140%" height="180%"><feDropShadow dx="0" dy="${nearY}" stdDeviation="${near}" style="flood-color:var(--sh);flood-opacity:var(--shA)"/><feDropShadow dx="0" dy="${farY}" stdDeviation="${far}" style="flood-color:var(--sh);flood-opacity:var(--shB)"/></filter>`;
|
|
9353
|
-
const heads = follow && layout.kind === "sequence" ? layout.boxes.map((box) => linked(box.id,
|
|
9354
|
-
const
|
|
9355
|
-
const
|
|
9356
|
-
|
|
9355
|
+
const heads = follow && layout.kind === "sequence" ? layout.boxes.map((box) => linked(box.id, _chunkJCEKXALJcjs.headCard.call(void 0, box, ctx, _nullishCoalesce(on.get(box.id), () => ( [])), _nullishCoalesce(subs.get(box.id), () => ( []))))).join("") : "";
|
|
9356
|
+
const drawTable = (s, from) => drawStrip(s) + layout.badges.filter((b) => onStrip(layout, b)).map((b) => _chunkJCEKXALJcjs.badge.call(void 0, { ...b, x: b.x - from.x + s.x + _chunk5OQV42W3cjs.LOOK.badge.r, y: b.y - from.y + s.y }, ctx, isState)).join("");
|
|
9357
|
+
const view = follow ? followView(layout, timeline, diagram, m, id, content, follow, heads, drawTable) : { body: `<rect class="dg-bg" width="${layout.width}" height="${layout.height}" rx="${_chunk5OQV42W3cjs.LOOK.region.radius}"/>${content}`, w: layout.width, h: layout.height };
|
|
9358
|
+
const css = `.dg-${id}{${_chunk5OQV42W3cjs.FONT_VARS};--T:${timeline.total}s;${vars}}${PART_CSS}${m.frames.join("")}`;
|
|
9359
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" class="dg dg-${id}" viewBox="0 0 ${Math.ceil(view.w)} ${Math.ceil(view.h)}" width="${Math.ceil(view.w)}" height="${Math.ceil(view.h)}" role="img" aria-label="${_chunkJCEKXALJcjs.esc.call(void 0, diagram.title)}" data-dragon="figure" data-view="${follow ? "follow" : "fixed"}"><style>${css}</style><defs>${shadow}</defs>${view.body}</svg>`;
|
|
9357
9360
|
}
|
|
9358
9361
|
function union(rects) {
|
|
9359
9362
|
const x = Math.min(...rects.map((r) => r.x));
|
|
9360
9363
|
const y = Math.min(...rects.map((r) => r.y));
|
|
9361
9364
|
return { x, y, w: Math.max(...rects.map((r) => r.x + r.w)) - x, h: Math.max(...rects.map((r) => r.y + r.h)) - y };
|
|
9362
9365
|
}
|
|
9366
|
+
function onStrip(layout, badge2) {
|
|
9367
|
+
return layout.strip !== void 0 && badge2.y >= layout.strip.y;
|
|
9368
|
+
}
|
|
9363
9369
|
function focusOf(layout, diagram, step) {
|
|
9364
9370
|
const rects = focusParts(layout, diagram, step);
|
|
9365
9371
|
return rects.length === 0 ? void 0 : union(rects);
|
|
9366
9372
|
}
|
|
9367
9373
|
function badgeFocus(badge2, parts, vw, vh) {
|
|
9368
|
-
const room =
|
|
9374
|
+
const room = _chunk5OQV42W3cjs.LOOK.badge.r + _chunk5OQV42W3cjs.LOOK.follow.badgeRoom;
|
|
9369
9375
|
const { x: bx, y: by } = badge2;
|
|
9370
9376
|
const away = (p) => Math.hypot(Math.max(0, p.x - bx, bx - p.x - p.w), Math.max(0, p.y - by, by - p.y - p.h));
|
|
9371
9377
|
let held = { x: bx - room, y: by - room, w: room * 2, h: room * 2 };
|
|
@@ -9405,31 +9411,33 @@ function focusParts(layout, diagram, step) {
|
|
|
9405
9411
|
}
|
|
9406
9412
|
return rects;
|
|
9407
9413
|
}
|
|
9408
|
-
function followView(layout, timeline, diagram, m, id, content, follow, heads) {
|
|
9409
|
-
const F =
|
|
9410
|
-
const M =
|
|
9414
|
+
function followView(layout, timeline, diagram, m, id, content, follow, heads, drawTable) {
|
|
9415
|
+
const F = _chunk5OQV42W3cjs.LOOK.follow;
|
|
9416
|
+
const M = _chunk5OQV42W3cjs.LOOK.mini;
|
|
9411
9417
|
const frameWidth = Math.max(1, follow.width);
|
|
9412
9418
|
const full = Math.min(layout.width, frameWidth);
|
|
9413
|
-
const
|
|
9419
|
+
const worldH = layout.strip ? layout.strip.y : layout.height;
|
|
9420
|
+
const title = _chunk5OQV42W3cjs.FIGURE_TEXT[follow.lang].overview;
|
|
9414
9421
|
const sized = (vh2) => {
|
|
9415
9422
|
const mw2 = Math.min(M.w, full * 0.4, vh2 * 0.4 / layout.height * layout.width);
|
|
9416
9423
|
const k2 = mw2 / layout.width;
|
|
9417
|
-
const mh2 =
|
|
9418
|
-
const bw2 = Math.max(mw2, Math.ceil(
|
|
9424
|
+
const mh2 = worldH * k2;
|
|
9425
|
+
const bw2 = Math.max(mw2, Math.ceil(_chunk5OQV42W3cjs.textWidth.call(void 0, title, _chunk5OQV42W3cjs.TYPE.miniTitle)));
|
|
9419
9426
|
return { vh: vh2, mw: mw2, k: k2, mh: mh2, bw: bw2, bgW: bw2 + M.pad * 2, bgH: mh2 + M.pad * 2 + M.title, beside: mh2 > mw2 };
|
|
9420
9427
|
};
|
|
9421
|
-
const natural = sized(Math.min(
|
|
9428
|
+
const natural = sized(Math.min(worldH, Math.max(F.minH, full * F.aspect)));
|
|
9422
9429
|
const bare = natural.beside && frameWidth < F.narrow;
|
|
9423
|
-
const
|
|
9424
|
-
const
|
|
9430
|
+
const tableH = layout.strip ? _chunk5OQV42W3cjs.rewrapStrip.call(void 0, layout.strip, 0, 0, full).h + M.inset : 0;
|
|
9431
|
+
const room = follow.height === void 0 ? Number.POSITIVE_INFINITY : (natural.beside ? follow.height : follow.height - natural.bgH - M.inset) - tableH;
|
|
9432
|
+
const { vh, mw, k, mh, bw, bgW, bgH, beside } = room < natural.vh ? sized(Math.max(F.fitMinH, room)) : { ...natural, vh: Number.isFinite(room) ? Math.min(worldH, room) : natural.vh };
|
|
9425
9433
|
const vw = beside && !bare ? Math.min(layout.width, frameWidth - bgW - M.inset) : full;
|
|
9426
9434
|
const clampX = (x) => Math.min(layout.width - vw / 2, Math.max(vw / 2, x));
|
|
9427
9435
|
const top = heads === "" ? 0 : Math.max(...layout.boxes.map((b) => b.y + b.h)) + F.headRoom;
|
|
9428
9436
|
const strip2 = heads === "" ? 0 : F.head.pad * 2 + F.head.h;
|
|
9429
9437
|
const below = vh - strip2;
|
|
9430
|
-
const clampY = (y) => Math.min(
|
|
9431
|
-
const r =
|
|
9432
|
-
let prev = [layout.width / 2,
|
|
9438
|
+
const clampY = (y) => Math.min(worldH - below / 2, Math.max(top + below / 2, y));
|
|
9439
|
+
const r = _chunk5OQV42W3cjs.LOOK.badge.r;
|
|
9440
|
+
let prev = [layout.width / 2, worldH / 2];
|
|
9433
9441
|
const middles = timeline.steps.map((_, s) => {
|
|
9434
9442
|
if (isTimeLayout(layout)) {
|
|
9435
9443
|
const f2 = kindParts("time").timeFocus(layout, timeline, s, focusParts(layout, diagram, s), vw, below);
|
|
@@ -9440,7 +9448,7 @@ function followView(layout, timeline, diagram, m, id, content, follow, heads) {
|
|
|
9440
9448
|
prev = f ? [f.x + f.w / 2, f.y + f.h / 2] : prev;
|
|
9441
9449
|
const at = [clampX(prev[0]), clampY(prev[1])];
|
|
9442
9450
|
const b = layout.badges.find((x) => x.step === s);
|
|
9443
|
-
if (!b || Math.abs(b.x - at[0]) <= vw / 2 - r && Math.abs(b.y - at[1]) <= below / 2 - r) return at;
|
|
9451
|
+
if (!b || onStrip(layout, b) || Math.abs(b.x - at[0]) <= vw / 2 - r && Math.abs(b.y - at[1]) <= below / 2 - r) return at;
|
|
9444
9452
|
const near = badgeFocus(b, focusParts(layout, diagram, s), vw, below);
|
|
9445
9453
|
prev = [near.x + near.w / 2, near.y + near.h / 2];
|
|
9446
9454
|
return [clampX(prev[0]), clampY(prev[1])];
|
|
@@ -9455,10 +9463,10 @@ function followView(layout, timeline, diagram, m, id, content, follow, heads) {
|
|
|
9455
9463
|
if (s === 0) return;
|
|
9456
9464
|
const before = centers[s - 1];
|
|
9457
9465
|
const start = timeline.steps[s].start;
|
|
9458
|
-
cam.push([start, before[0], before[1], 1,
|
|
9466
|
+
cam.push([start, before[0], before[1], 1, _chunk5OQV42W3cjs.EASE.inOut], [start + F.ease, c[0], c[1]]);
|
|
9459
9467
|
});
|
|
9460
9468
|
const cl = centers[centers.length - 1];
|
|
9461
|
-
cam.push([timeline.last, cl[0], cl[1], 1,
|
|
9469
|
+
cam.push([timeline.last, cl[0], cl[1], 1, _chunk5OQV42W3cjs.EASE.inOut], [timeline.total, c0[0], c0[1]]);
|
|
9462
9470
|
const camKf = m.move(cam.map(([t, cx, cy, s, e]) => [t, vw / 2 - cx, vh / 2 - cy, s, e]));
|
|
9463
9471
|
const bgX = beside ? vw + M.inset : vw - bgW - M.inset;
|
|
9464
9472
|
const bgY = beside ? 0 : vh + M.inset;
|
|
@@ -9467,9 +9475,9 @@ function followView(layout, timeline, diagram, m, id, content, follow, heads) {
|
|
|
9467
9475
|
const my = bgY + M.pad + M.title;
|
|
9468
9476
|
const overview = () => {
|
|
9469
9477
|
const shapes = [
|
|
9470
|
-
...layout.regions.map((r3) => `<rect class="dg-mm-band" style="${
|
|
9471
|
-
...layout.boxes.map((b) => `<rect class="dg-mm-card" style="${
|
|
9472
|
-
...(isTreeLayout(layout) ? layout.nodes : []).map((n) => `<rect class="dg-mm-card" style="${
|
|
9478
|
+
...layout.regions.map((r3) => `<rect class="dg-mm-band" style="${_chunkJCEKXALJcjs.cs.call(void 0, r3.color)}" x="${mx + r3.x * k}" y="${my + r3.y * k}" width="${r3.w * k}" height="${r3.h * k}" rx="3"/>`),
|
|
9479
|
+
...layout.boxes.map((b) => `<rect class="dg-mm-card" style="${_chunkJCEKXALJcjs.cs.call(void 0, b.color)}" x="${mx + b.x * k}" y="${my + b.y * k}" width="${b.w * k}" height="${b.h * k}" rx="1.5"/>`),
|
|
9480
|
+
...(isTreeLayout(layout) ? layout.nodes : []).map((n) => `<rect class="dg-mm-card" style="${_chunkJCEKXALJcjs.cs.call(void 0, n.color)}" x="${mx + n.x * k}" y="${my + n.y * k}" width="${n.w * k}" height="${n.h * k}" rx="1.5"/>`)
|
|
9473
9481
|
].join("");
|
|
9474
9482
|
const vp = m.move(cam.map(([t, cx, cy, , e]) => [t, mx + (cx - vw / 2) * k, my + (cy - vh / 2) * k, 1, e]));
|
|
9475
9483
|
return {
|
|
@@ -9479,21 +9487,25 @@ function followView(layout, timeline, diagram, m, id, content, follow, heads) {
|
|
|
9479
9487
|
};
|
|
9480
9488
|
const mini = bare ? { clip: "", body: "" } : overview();
|
|
9481
9489
|
const head = strip2 === 0 ? "" : `<g class="dg-hd"><rect class="dg-hd-bg" width="${vw}" height="${strip2}"/><line class="dg-sep" x1="0" y1="${strip2}" x2="${vw}" y2="${strip2}"/><g class="dg-a" style="${m.move(cam.map(([t, cx, , s, e]) => [t, vw / 2 - cx, 0, s, e]))}">${heads}</g></g>`;
|
|
9482
|
-
const body = `<defs><clipPath id="dg-vp-${id}"><rect width="${vw}" height="${vh}" rx="${
|
|
9483
|
-
|
|
9490
|
+
const body = `<defs><clipPath id="dg-vp-${id}"><rect width="${vw}" height="${vh}" rx="${_chunk5OQV42W3cjs.LOOK.region.radius}"/></clipPath>${mini.clip}</defs><g clip-path="url(#dg-vp-${id})"><rect class="dg-vp-bg" width="${vw}" height="${vh}"/><g class="dg-a" style="${camKf}">${content}</g>${head}</g><rect class="dg-vp-frame" x="0.5" y="0.5" width="${vw - 1}" height="${vh - 1}" rx="${_chunk5OQV42W3cjs.LOOK.region.radius}"/>${mini.body}`;
|
|
9491
|
+
const w = beside && !bare ? vw + M.inset + bgW : full;
|
|
9492
|
+
const bottom = beside ? vh : bgY + bgH;
|
|
9493
|
+
if (!layout.strip) return { body, w, h: bottom };
|
|
9494
|
+
const table = _chunk5OQV42W3cjs.rewrapStrip.call(void 0, layout.strip, 0, bottom + M.inset, full);
|
|
9495
|
+
return { body: body + drawTable(table, layout.strip), w, h: table.y + table.h };
|
|
9484
9496
|
}
|
|
9485
9497
|
function paletteOf(options, theme) {
|
|
9486
|
-
const palette =
|
|
9498
|
+
const palette = _chunk5OQV42W3cjs.resolvePalette.call(void 0, options.palette);
|
|
9487
9499
|
if (!options.colors) return palette;
|
|
9488
|
-
const words =
|
|
9489
|
-
const errors = Object.entries(options.colors).flatMap(([name2, value2]) => !
|
|
9500
|
+
const words = _chunk5OQV42W3cjs.FIGURE_TEXT[_nullishCoalesce(options.lang, () => ( "ja"))];
|
|
9501
|
+
const errors = Object.entries(options.colors).flatMap(([name2, value2]) => !_chunk5OQV42W3cjs.isColorName.call(void 0, name2) ? [words.unknownColor(name2)] : _chunk5OQV42W3cjs.isColorValue.call(void 0, value2) ? [] : [words.unreadableColor(name2)]);
|
|
9490
9502
|
if (errors.length > 0) throw new Error(words.cannotDraw(errors.join(" / ")));
|
|
9491
9503
|
return { ...palette, [theme]: { ...palette[theme], ...options.colors } };
|
|
9492
9504
|
}
|
|
9493
9505
|
function renderDiagram(input, options = {}) {
|
|
9494
9506
|
const lang = _nullishCoalesce(options.lang, () => ( "ja"));
|
|
9495
9507
|
const read = readDiagram(input, { lang });
|
|
9496
|
-
if (!read.ok) throw new Error(
|
|
9508
|
+
if (!read.ok) throw new Error(_chunk5OQV42W3cjs.FIGURE_TEXT[lang].cannotDraw(read.errors.map((e) => `${e.pointer} ${e.message}`).join(" / ")));
|
|
9497
9509
|
const diagram = read.diagram;
|
|
9498
9510
|
const layout = diagram.kind === "sequence" ? layoutSequence(diagram) : diagram.kind === "state" ? kindParts("state", lang).layoutState(diagram, lang) : diagram.kind === "git" ? kindParts("git", lang).layoutGit(diagram) : diagram.kind === "time" ? kindParts("time", lang).layoutTime(diagram, lang) : diagram.kind === "tree" ? kindParts("tree", lang).layoutTree(diagram) : diagram.kind === "lineup" ? kindParts("lineup", lang).layoutLineup(diagram) : layoutArchitecture(diagram);
|
|
9499
9511
|
return renderLayout(diagram, layout, buildTimeline(diagram, options.still === true), options);
|
|
@@ -9509,11 +9521,11 @@ function renderLayout(diagram, layout, timeline, options = {}) {
|
|
|
9509
9521
|
palette: palette.id,
|
|
9510
9522
|
theme,
|
|
9511
9523
|
...diagram.view ? { view: diagram.view } : {},
|
|
9512
|
-
fonts: { ...
|
|
9524
|
+
fonts: { ..._chunk5OQV42W3cjs.FONTS },
|
|
9513
9525
|
layout,
|
|
9514
9526
|
timeline,
|
|
9515
9527
|
diagram,
|
|
9516
|
-
overlaps:
|
|
9528
|
+
overlaps: _chunkJCEKXALJcjs.findOverlaps.call(void 0, ink, timeline.stills, traces)
|
|
9517
9529
|
};
|
|
9518
9530
|
}
|
|
9519
9531
|
|
|
@@ -9521,16 +9533,16 @@ function renderLayout(diagram, layout, timeline, options = {}) {
|
|
|
9521
9533
|
function chooseView(rendered, frameWidth, frameHeight) {
|
|
9522
9534
|
const byWidth = Math.max(0, frameWidth) / rendered.layout.width;
|
|
9523
9535
|
const scale = frameHeight === void 0 ? byWidth : Math.min(byWidth, Math.max(0, frameHeight) / rendered.layout.height);
|
|
9524
|
-
const textPx = scale *
|
|
9536
|
+
const textPx = scale * _chunk5OQV42W3cjs.TYPE.boxName.size;
|
|
9525
9537
|
if (rendered.view) return { mode: rendered.view, textPx };
|
|
9526
|
-
return { mode: textPx >=
|
|
9538
|
+
return { mode: textPx >= _chunk5OQV42W3cjs.READABLE_PX ? "fixed" : "follow", textPx };
|
|
9527
9539
|
}
|
|
9528
9540
|
|
|
9529
9541
|
// src/player.ts
|
|
9530
9542
|
var font2 = (t) => `font:${t.weight} ${t.size}px var(--${t.family})`;
|
|
9531
9543
|
var px = (v) => `${v}px`;
|
|
9532
9544
|
function playerCss() {
|
|
9533
|
-
const P =
|
|
9545
|
+
const P = _chunk5OQV42W3cjs.LOOK.player;
|
|
9534
9546
|
const hidden = px(P.hidden);
|
|
9535
9547
|
return [
|
|
9536
9548
|
`.dg-player{display:flex;flex-direction:column;gap:${px(P.gap)};color:var(--ink)}`,
|
|
@@ -9539,15 +9551,15 @@ function playerCss() {
|
|
|
9539
9551
|
`.dg-bar{container:dg-bar/inline-size}`,
|
|
9540
9552
|
`.dg-row{display:flex;align-items:flex-start;gap:${px(P.gap)}}`,
|
|
9541
9553
|
`.dg-btns{display:flex;gap:${px(P.gap / 2)};flex:none}`,
|
|
9542
|
-
`.dg-btn{width:${px(P.button)};height:${px(P.button)};border-radius:${px(P.radius)};border:${px(
|
|
9554
|
+
`.dg-btn{width:${px(P.button)};height:${px(P.button)};border-radius:${px(P.radius)};border:${px(_chunk5OQV42W3cjs.LOOK.stroke.hair)} solid var(--hair);background:var(--surf);color:var(--ink);${font2(_chunk5OQV42W3cjs.TYPE.button)};cursor:pointer}`,
|
|
9543
9555
|
`.dg-btn:focus-visible{outline:${px(P.focus)} solid var(--c-blue);outline-offset:${px(P.focus)}}`,
|
|
9544
9556
|
`.dg-say{display:flex;gap:${px(P.gap)};min-width:0}`,
|
|
9545
|
-
`.dg-no{${font2(
|
|
9557
|
+
`.dg-no{${font2(_chunk5OQV42W3cjs.TYPE.stepNo)};color:var(--mute);padding-top:${px(P.focus)}}`,
|
|
9546
9558
|
`.dg-txt{display:grid;grid-template-columns:minmax(0,1fr);min-width:0}`,
|
|
9547
9559
|
`.dg-txt>*{grid-area:1/1}`,
|
|
9548
9560
|
`.dg-room{visibility:hidden}`,
|
|
9549
|
-
`.dg-tt{${font2(
|
|
9550
|
-
`.dg-tb{${font2(
|
|
9561
|
+
`.dg-tt{${font2(_chunk5OQV42W3cjs.TYPE.stepTitle)};margin:0}`,
|
|
9562
|
+
`.dg-tb{${font2(_chunk5OQV42W3cjs.TYPE.stepBody)};color:var(--ink2);margin:0;white-space:pre-line}`,
|
|
9551
9563
|
`.dg-sr{position:absolute;width:${hidden};height:${hidden};margin:-${hidden};padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}`,
|
|
9552
9564
|
// 狭い帯 (携帯の幅) では、段を送る釦を指で押せる大きさにし、その横に番号を置き、
|
|
9553
9565
|
// 題を 2 段目、本文を 3 段目に置いてどちらも帯の全幅を使う (#3057、#3069)。
|
|
@@ -9558,7 +9570,7 @@ function playerCss() {
|
|
|
9558
9570
|
// 指で触る時は、広い帯でも段を送る釦を指で押せる大きさにする (#3076)。並びは横 1 列のまま変えない。
|
|
9559
9571
|
// 広い帯は本文が 2 行あれば帯の高さが変わらず、本文の無い帯だけが釦の分だけ高くなる
|
|
9560
9572
|
`@media (pointer: coarse){.dg-btn{width:${px(P.touch)};height:${px(P.touch)}}}`,
|
|
9561
|
-
`.dg-spot{fill:none;stroke:var(--t-amber);stroke-width:${px(
|
|
9573
|
+
`.dg-spot{fill:none;stroke:var(--t-amber);stroke-width:${px(_chunk5OQV42W3cjs.LOOK.stroke.mark)};stroke-dasharray:${_chunk5OQV42W3cjs.LOOK.mark.dash} ${_chunk5OQV42W3cjs.LOOK.mark.gap};pointer-events:none}`
|
|
9562
9574
|
].join("");
|
|
9563
9575
|
}
|
|
9564
9576
|
function ensureCss(doc) {
|
|
@@ -9578,7 +9590,7 @@ function mountDiagram(host, diagram, options = {}) {
|
|
|
9578
9590
|
const reduce = Boolean(_optionalChain([win, 'optionalAccess', _247 => _247.matchMedia, 'optionalCall', _248 => _248("(prefers-reduced-motion: reduce)"), 'access', _249 => _249.matches]));
|
|
9579
9591
|
const rendered = renderDiagram(diagram, options);
|
|
9580
9592
|
const lang = _nullishCoalesce(options.lang, () => ( "ja"));
|
|
9581
|
-
const words =
|
|
9593
|
+
const words = _chunk5OQV42W3cjs.FIGURE_TEXT[lang];
|
|
9582
9594
|
const palette = paletteOf(options, rendered.theme);
|
|
9583
9595
|
const { timeline } = rendered;
|
|
9584
9596
|
const steps = rendered.diagram.steps;
|
|
@@ -9587,7 +9599,7 @@ function mountDiagram(host, diagram, options = {}) {
|
|
|
9587
9599
|
const root = doc.createElement("div");
|
|
9588
9600
|
root.className = "dg-player";
|
|
9589
9601
|
root.dataset.dragon = "player";
|
|
9590
|
-
root.setAttribute("style", `${
|
|
9602
|
+
root.setAttribute("style", `${_chunk5OQV42W3cjs.FONT_VARS};${_chunk5OQV42W3cjs.paletteVars.call(void 0, palette, rendered.theme)}`);
|
|
9591
9603
|
const frame = doc.createElement("div");
|
|
9592
9604
|
frame.className = "dg-frame";
|
|
9593
9605
|
const button = (name2, label2, text2) => {
|
|
@@ -9695,7 +9707,7 @@ function mountDiagram(host, diagram, options = {}) {
|
|
|
9695
9707
|
if (!svg) return;
|
|
9696
9708
|
for (const old of svg.querySelectorAll(".dg-spots")) old.remove();
|
|
9697
9709
|
if (marked.length === 0) return;
|
|
9698
|
-
const M =
|
|
9710
|
+
const M = _chunk5OQV42W3cjs.LOOK.mark;
|
|
9699
9711
|
const group = doc.createElementNS(SVG_NS, "g");
|
|
9700
9712
|
group.setAttribute("class", "dg-spots");
|
|
9701
9713
|
for (const r of marked) {
|
|
@@ -9846,11 +9858,11 @@ function mountDiagram(host, diagram, options = {}) {
|
|
|
9846
9858
|
|
|
9847
9859
|
// src/light.ts
|
|
9848
9860
|
var LOADERS = {
|
|
9849
|
-
git: () => Promise.resolve().then(() => _interopRequireWildcard(require("./git-
|
|
9850
|
-
lineup: () => Promise.resolve().then(() => _interopRequireWildcard(require("./lineup-
|
|
9851
|
-
state: () => Promise.resolve().then(() => _interopRequireWildcard(require("./state-
|
|
9852
|
-
time: () => Promise.resolve().then(() => _interopRequireWildcard(require("./time-
|
|
9853
|
-
tree: () => Promise.resolve().then(() => _interopRequireWildcard(require("./tree-
|
|
9861
|
+
git: () => Promise.resolve().then(() => _interopRequireWildcard(require("./git-K3KAAAWW.cjs"))),
|
|
9862
|
+
lineup: () => Promise.resolve().then(() => _interopRequireWildcard(require("./lineup-623J25LU.cjs"))),
|
|
9863
|
+
state: () => Promise.resolve().then(() => _interopRequireWildcard(require("./state-OZVCHX7H.cjs"))),
|
|
9864
|
+
time: () => Promise.resolve().then(() => _interopRequireWildcard(require("./time-PQCPVQOE.cjs"))),
|
|
9865
|
+
tree: () => Promise.resolve().then(() => _interopRequireWildcard(require("./tree-6D7KI57H.cjs")))
|
|
9854
9866
|
};
|
|
9855
9867
|
var isLater = (kind) => LATER_KINDS.includes(kind);
|
|
9856
9868
|
async function loadKind(kind) {
|
|
@@ -9881,5 +9893,5 @@ async function register(kind) {
|
|
|
9881
9893
|
|
|
9882
9894
|
|
|
9883
9895
|
|
|
9884
|
-
exports.DEFAULT_PALETTE =
|
|
9896
|
+
exports.DEFAULT_PALETTE = _chunk5OQV42W3cjs.DEFAULT_PALETTE; exports.FONTS = _chunk5OQV42W3cjs.FONTS; exports.FORMAT_VERSION = FORMAT_VERSION; exports.ICONS = _chunkJCEKXALJcjs.ICONS; exports.LATER_KINDS = LATER_KINDS; exports.PALETTES = _chunk5OQV42W3cjs.PALETTES; exports.READABLE_PX = _chunk5OQV42W3cjs.READABLE_PX; exports.chooseView = chooseView; exports.describeOverlap = _chunkJCEKXALJcjs.describeOverlap; exports.extractDiagrams = extractDiagrams; exports.iconSvg = _chunkJCEKXALJcjs.iconSvg; exports.kindLoaded = kindLoaded; exports.loadKind = loadKind; exports.mountDiagram = mountDiagram; exports.parseNotation = parseNotation; exports.printNotation = printNotation; exports.readDiagram = readDiagram; exports.renderDiagram = renderDiagram; exports.resolvePalette = _chunk5OQV42W3cjs.resolvePalette; exports.validateDiagram = validateDiagram;
|
|
9885
9897
|
//# sourceMappingURL=index.cjs.map
|