glassbrain 0.2.0-alpha.6 → 0.2.0-alpha.7
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/chunks/{chunk-3P34XHQ2.js → chunk-3KUNYSJE.js} +3 -1
- package/dist/chunks/{chunk-3SAL4526.js → chunk-FNTYI7VP.js} +38 -22
- package/dist/chunks/{chunk-LMYD4QHC.js → chunk-GZSWZSSE.js} +373 -321
- package/dist/chunks/{chunk-M3MAM2VD.js → chunk-LK77SYCN.js} +34 -1
- package/dist/chunks/{chunk-5DEN6HXJ.js → chunk-Q35ZKWKF.js} +2 -2
- package/dist/cli/glassbrain.js +124 -109
- package/dist/cli/viewer.js +88 -59
- package/dist/core.d.ts +1 -0
- package/dist/core.js +11 -3
- package/dist/index.js +13 -5
- package/dist/internal.js +13 -5
- package/dist/kinds.d.ts +23 -0
- package/dist/profile.d.ts +5 -1
- package/dist/react/DetailPanel.js +2 -2
- package/dist/react/GlassPlanes.d.ts +11 -0
- package/dist/react/GraphCanvas.d.ts +2 -0
- package/dist/react/GraphCanvas.js +4 -4
- package/dist/react/icons.d.ts +2 -0
- package/dist/strings.d.ts +2 -2
- package/package.json +1 -1
- package/schema/profile.schema.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EN
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q35ZKWKF.js";
|
|
4
4
|
|
|
5
5
|
// src/react/i18n.ts
|
|
6
6
|
import { createContext, useContext } from "react";
|
|
@@ -18,6 +18,8 @@ var I = {
|
|
|
18
18
|
fit: "M4 9V5a1 1 0 0 1 1-1h4M15 4h4a1 1 0 0 1 1 1v4M20 15v4a1 1 0 0 1-1 1h-4M9 20H5a1 1 0 0 1-1-1v-4",
|
|
19
19
|
more: "M4 7h10M18 7h2M4 17h2M10 17h10M16 5v4M8 15v4",
|
|
20
20
|
warn: "M12 4 2.8 19.5h18.4L12 4Zm0 6v4.5m0 2.5v.5",
|
|
21
|
+
error: "M12 3a9 9 0 1 0 0 18 9 9 0 1 0 0-18Zm-3 6 6 6m0-6-6 6",
|
|
22
|
+
info: "M12 3a9 9 0 1 0 0 18 9 9 0 1 0 0-18Zm0 8v5m0-9v.5",
|
|
21
23
|
arrow: "M5 12h13M13 7l5 5-5 5",
|
|
22
24
|
stack: "M12 4 3 8.5l9 4.5 9-4.5L12 4ZM3 12.5l9 4.5 9-4.5M3 16.5l9 4.5 9-4.5",
|
|
23
25
|
edit: "M4 20h4L19 9l-4-4L4 16v4Zm9-13 4 4",
|
|
@@ -331,6 +331,9 @@ function validateStructure(model) {
|
|
|
331
331
|
}
|
|
332
332
|
return out;
|
|
333
333
|
}
|
|
334
|
+
function kindTable(...entries) {
|
|
335
|
+
return Object.assign(/* @__PURE__ */ Object.create(null), ...entries);
|
|
336
|
+
}
|
|
334
337
|
function defineProfile(input) {
|
|
335
338
|
const layers = input.layers?.length ? input.layers : [DEFAULT_LAYER];
|
|
336
339
|
const fallbackLayer = layers[0].id;
|
|
@@ -340,15 +343,15 @@ function defineProfile(input) {
|
|
|
340
343
|
merge: input.merge ?? mergeSlices,
|
|
341
344
|
layers,
|
|
342
345
|
layerOf: input.layerOf ?? ((n) => n.layer ?? fallbackLayer),
|
|
343
|
-
nodePalette: input.nodePalette
|
|
344
|
-
edgePalette: input.edgePalette
|
|
345
|
-
nodeSize: input.nodeSize
|
|
346
|
-
edgeWidth: input.edgeWidth
|
|
346
|
+
nodePalette: kindTable(input.nodePalette),
|
|
347
|
+
edgePalette: kindTable(input.edgePalette),
|
|
348
|
+
nodeSize: kindTable(input.nodeSize),
|
|
349
|
+
edgeWidth: kindTable(input.edgeWidth),
|
|
347
350
|
placeholderFlags: input.placeholderFlags ?? [],
|
|
348
351
|
style: input.style ?? [],
|
|
349
352
|
nodeClass: input.nodeClass ?? (() => ""),
|
|
350
353
|
edgeClass: input.edgeClass ?? ((e) => e.kind ?? ""),
|
|
351
|
-
kindLabels: input.kindLabels
|
|
354
|
+
kindLabels: kindTable(input.kindLabels),
|
|
352
355
|
detail: input.detail ?? {},
|
|
353
356
|
validate: input.validate ?? (() => []),
|
|
354
357
|
layoutEdge: input.layoutEdge ?? (() => false),
|
|
@@ -1317,7 +1320,7 @@ var GK_CSS = `
|
|
|
1317
1320
|
.gb-root { display:flex; height:100%; min-height:0; font-family: var(--gb-font, ui-sans-serif, system-ui, sans-serif);
|
|
1318
1321
|
color: var(--gb-text, var(--gb-default-text,#1f2937)); position:relative; container-type:inline-size; container-name:gk; }
|
|
1319
1322
|
.gb-stage { flex:1; min-width:0; position:relative; container-type:inline-size; container-name:gks; }
|
|
1320
|
-
.gb-canvas { position:absolute; inset:0; }
|
|
1323
|
+
.gb-scene, .gb-canvas { position:absolute; inset:0; }
|
|
1321
1324
|
/* The node text layer: cytoscape's canvases are z-index 1\u20133; this one sits above them and below the toolbar.
|
|
1322
1325
|
canvas is a replaced element; inset alone is not enough, it needs an explicit 100%. */
|
|
1323
1326
|
.gb-labels { position:absolute; left:0; top:0; pointer-events:none; z-index:4; }
|
|
@@ -1344,7 +1347,10 @@ var GK_CSS = `
|
|
|
1344
1347
|
stroke-linejoin:round; vector-effect:non-scaling-stroke; }
|
|
1345
1348
|
/* The in-column truncation notice sits one line above the column name. */
|
|
1346
1349
|
.gb-pane .gb-diff-trunc { top:auto; left:auto; bottom:44px; right:12px; }
|
|
1347
|
-
.gb-
|
|
1350
|
+
.gb-glass-plane { position:absolute; pointer-events:none; }
|
|
1351
|
+
.gb-glass-surface { position:absolute; inset:0; backdrop-filter:blur(18px) saturate(160%); -webkit-backdrop-filter:blur(18px) saturate(160%); }
|
|
1352
|
+
.gb-glass-rim { position:absolute; inset:0; overflow:visible; }
|
|
1353
|
+
.gb-glass-planes, .gb-plane-labels { position:absolute; inset:0; width:100%; height:100%;
|
|
1348
1354
|
pointer-events:none; overflow:hidden; }
|
|
1349
1355
|
/* svg is a replaced element: inset:0 alone falls back to its intrinsic 300x150, so it needs an explicit 100%. */
|
|
1350
1356
|
/* Plates are drawn **under** the graph (cytoscape's canvases are z-index 1\u20133); layer names **above**,
|
|
@@ -1365,7 +1371,7 @@ var GK_CSS = `
|
|
|
1365
1371
|
* --gb-r-pop layers that pop out (dropdowns, panels, cards on overlays)
|
|
1366
1372
|
* --gb-r-in-face / --gb-r-in-pop controls inside a face: outer radius minus padding (concentric), 10\u22123, 12\u22126
|
|
1367
1373
|
* --gb-r-chip small inline tags (keycaps, kind tags, focus tags) */
|
|
1368
|
-
.gb-field, .gb-segm, .gb-icon-btn, .gb-group, .gb-
|
|
1374
|
+
.gb-field, .gb-segm, .gb-icon-btn, .gb-group, .gb-note, .gb-chip, .gb-legend {
|
|
1369
1375
|
background: var(--gb-panel, var(--gb-default-panel,rgba(255,255,255,.86))); border:1px solid var(--gb-border,var(--gb-default-border,#e2e8f0));
|
|
1370
1376
|
box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 6px 18px -6px rgba(15,23,42,.12);
|
|
1371
1377
|
-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius:var(--gb-r-face,10px); }
|
|
@@ -1483,15 +1489,17 @@ var GK_CSS = `
|
|
|
1483
1489
|
border-radius:var(--gb-r-in-pop,6px); background: var(--gb-panel2,var(--gb-default-panel2,#fff)); color: var(--gb-text,var(--gb-default-text,#1f2937)); font: inherit; font-size:12.5px; }
|
|
1484
1490
|
|
|
1485
1491
|
/* Bottom right: the camera. */
|
|
1486
|
-
.gb-
|
|
1492
|
+
.gb-footer { position:absolute; inset:12px; z-index:10; pointer-events:none;
|
|
1493
|
+
display:flex; align-items:flex-end; gap:8px; }
|
|
1494
|
+
.gb-dock { display:flex; align-items:flex-end; gap:8px; flex:none; margin-left:auto; }
|
|
1495
|
+
.gb-dock > * { pointer-events:auto; }
|
|
1487
1496
|
.gb-group { display:inline-flex; overflow:hidden; }
|
|
1488
1497
|
.gb-group > button { display:grid; place-items:center; width:34px; height:34px; padding:0; border:0; background:transparent;
|
|
1489
1498
|
color: var(--gb-muted,var(--gb-default-muted,#64748b)); transition: color .15s, background-color .15s; }
|
|
1490
1499
|
.gb-group > button:hover { color: var(--gb-text,var(--gb-default-text,#1f2937)); background: var(--gb-tint,var(--gb-default-tint,#f1f5f9)); }
|
|
1491
1500
|
.gb-group > button:active { background: var(--gb-active,var(--gb-default-active,#e0f2fe)); }
|
|
1492
1501
|
.gb-group > button + button { border-left:1px solid var(--gb-border,var(--gb-default-border,#e2e8f0)); }
|
|
1493
|
-
.gb-
|
|
1494
|
-
.gb-issues { width:320px; max-height:340px; overflow:auto; padding-bottom:6px; }
|
|
1502
|
+
.gb-issues { width:min(440px, calc(100vw - 24px)); max-height:min(520px, 70vh); overflow:auto; padding-bottom:6px; }
|
|
1495
1503
|
.gb-issues details { border-top:1px solid var(--gb-border,var(--gb-default-border,#e2e8f0)); }
|
|
1496
1504
|
.gb-issues summary { display:flex; align-items:center; gap:8px; padding:7px 12px; cursor:pointer; font-size:12.5px;
|
|
1497
1505
|
color: var(--gb-text,var(--gb-default-text,#1f2937)); list-style:none; }
|
|
@@ -1502,12 +1510,21 @@ var GK_CSS = `
|
|
|
1502
1510
|
.gb-issues summary:hover { background: var(--gb-tint,var(--gb-default-tint,#f1f5f9)); }
|
|
1503
1511
|
.gb-issues summary span { flex:1; }
|
|
1504
1512
|
.gb-issues summary b { font-weight:500; font-variant-numeric: tabular-nums; color: var(--gb-muted,var(--gb-default-muted,#64748b)); }
|
|
1505
|
-
.gb-issues summary.is-err b { color: var(--gb-err,var(--gb-default-err,#dc2626)); }
|
|
1506
1513
|
.gb-issues ul { margin:0; padding:0 0 6px; list-style:none; font-size:11.5px; line-height:1.5; color: var(--gb-muted,var(--gb-default-muted,#64748b)); }
|
|
1507
1514
|
.gb-issues li { overflow-wrap:break-word; padding:3px 12px 3px 25px; }
|
|
1508
|
-
.gb-
|
|
1509
|
-
.gb-
|
|
1510
|
-
.gb-
|
|
1515
|
+
.gb-check-button { position:relative; }
|
|
1516
|
+
.gb-check-button .gb-ico { transform:translate(-2px,2px); }
|
|
1517
|
+
.gb-check-badge { position:absolute; top:1px; right:1px; padding:0 2px; border-radius:4px;
|
|
1518
|
+
background:var(--gb-panel2,var(--gb-default-panel2,#fff));
|
|
1519
|
+
font-size:10px; font-weight:700; line-height:12px; font-variant-numeric:tabular-nums; }
|
|
1520
|
+
.gb-check-error { color:var(--gb-err, #dc2626); }
|
|
1521
|
+
.gb-check-warn { color:var(--gb-warn, #b45309); }
|
|
1522
|
+
.gb-check-info { color:var(--gb-muted, #64748b); }
|
|
1523
|
+
.gb-issue-target { display:block; border:0; background:none; color:inherit; padding:0; font:inherit; text-align:left; cursor:pointer; }
|
|
1524
|
+
.gb-issue-target:hover { text-decoration:underline; }
|
|
1525
|
+
.gb-issue-where { display:block; opacity:.75; margin-top:3px; }
|
|
1526
|
+
.gb-issue-fix { white-space:pre-wrap; border-left:2px solid var(--gb-border, #e2e8f0); padding-left:8px; margin:6px 0 10px; }
|
|
1527
|
+
|
|
1511
1528
|
.gb-err { color: var(--gb-err,var(--gb-default-err,#dc2626)); border-color: var(--gb-err-border,var(--gb-default-err-border,#fca5a5)); background: var(--gb-err-bg,var(--gb-default-err-bg,#fef2f2)); }
|
|
1512
1529
|
.gb-hint { color: var(--gb-muted,var(--gb-default-muted,#64748b)); }
|
|
1513
1530
|
.gb-hint .gb-ico { color: var(--gb-warn,var(--gb-default-warn,#b45309)); }
|
|
@@ -1517,9 +1534,8 @@ var GK_CSS = `
|
|
|
1517
1534
|
.gb-search, .gb-thumb { transition:none; }
|
|
1518
1535
|
.gb-drop, .gb-panel { animation:none; }
|
|
1519
1536
|
}
|
|
1520
|
-
/*
|
|
1521
|
-
.gb-bl {
|
|
1522
|
-
display:flex; flex-direction:column; justify-content:flex-end; align-items:flex-start; gap:8px; pointer-events:none; }
|
|
1537
|
+
/* Share the available width with the dock. Stretch vertically to give the legend its height cap. */
|
|
1538
|
+
.gb-bl { min-width:0; align-self:stretch; display:flex; flex-direction:column; justify-content:flex-end; align-items:flex-start; gap:8px; }
|
|
1523
1539
|
.gb-bl > * { pointer-events:auto; }
|
|
1524
1540
|
.gb-note { font-size:11px; color: var(--gb-muted,var(--gb-default-muted,#64748b)); padding:4px 8px; display:flex; gap:8px; align-items:center; }
|
|
1525
1541
|
.gb-warn { color: var(--gb-warn,var(--gb-default-warn,#b45309)); border-color: var(--gb-warn-border,var(--gb-default-warn-border,#fcd34d)); background: var(--gb-warn-bg,var(--gb-default-warn-bg,#fffbeb)); }
|
|
@@ -1679,10 +1695,9 @@ var GK_CSS = `
|
|
|
1679
1695
|
.gb-bar.has-layers .gb-search { flex:1 1 100%; width:auto; max-width:none; min-width:0; }
|
|
1680
1696
|
.gb-bar.has-layers .gb-segm { flex:1 1 0; }
|
|
1681
1697
|
.gb-bar.has-layers .gb-menu { flex:none; }
|
|
1682
|
-
/*
|
|
1683
|
-
.gb-bar:not(.has-layers) .gb-search { flex:1 1
|
|
1684
|
-
|
|
1685
|
-
.gb-bl { max-width:calc(100% - 60px); }
|
|
1698
|
+
/* Folded layers and settings take only their button widths; search fills the rest. */
|
|
1699
|
+
.gb-bar:not(.has-layers) .gb-search { flex:1 1 9rem; width:auto; min-width:min(9rem,100%); }
|
|
1700
|
+
.gb-layers.is-collapsed .gb-layer-track { display:none; }
|
|
1686
1701
|
.gb-dock { flex-direction:column; align-items:flex-end; }
|
|
1687
1702
|
.gb-dock .gb-group { flex-direction:column; }
|
|
1688
1703
|
.gb-dock .gb-group > button + button { border-left:0; border-top:1px solid var(--gb-border,var(--gb-default-border,#e2e8f0)); }
|
|
@@ -2499,6 +2514,7 @@ export {
|
|
|
2499
2514
|
toPhysical,
|
|
2500
2515
|
toBundle,
|
|
2501
2516
|
validateStructure,
|
|
2517
|
+
kindTable,
|
|
2502
2518
|
defineProfile,
|
|
2503
2519
|
defaultProfile,
|
|
2504
2520
|
parseSources,
|