dsh-plugin-inspiration-workbench 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/lib/client.js +66 -24
- package/lib/client.js.map +2 -2
- package/package.json +1 -1
- package/src/client/board.js +16 -2
- package/src/client/styles.css +52 -22
package/package.json
CHANGED
package/src/client/board.js
CHANGED
|
@@ -1476,6 +1476,17 @@ export function createBoard({ host, adapter, approvals, t, onOpenSession }) {
|
|
|
1476
1476
|
return dy > 0 ? 'top' : 'bottom';
|
|
1477
1477
|
}
|
|
1478
1478
|
|
|
1479
|
+
/** Small arrow head just outside the target edge, pointing into the card. */
|
|
1480
|
+
function arrowPath(point, side) {
|
|
1481
|
+
const normal = EDGE_NORMAL[side] || EDGE_NORMAL.left;
|
|
1482
|
+
const perp = { x: -normal.y, y: normal.x };
|
|
1483
|
+
const tip = { x: point.x - normal.x * 1, y: point.y - normal.y * 1 };
|
|
1484
|
+
const base = { x: point.x + normal.x * 7, y: point.y + normal.y * 7 };
|
|
1485
|
+
const left = { x: base.x + perp.x * 3.2, y: base.y + perp.y * 3.2 };
|
|
1486
|
+
const right = { x: base.x - perp.x * 3.2, y: base.y - perp.y * 3.2 };
|
|
1487
|
+
return 'M ' + tip.x + ' ' + tip.y + ' L ' + left.x + ' ' + left.y + ' L ' + right.x + ' ' + right.y + ' Z';
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1479
1490
|
function linkPath(from, to, fromSide, toSide) {
|
|
1480
1491
|
const distance = Math.hypot(to.x - from.x, to.y - from.y);
|
|
1481
1492
|
const bend = Math.max(36, Math.min(140, distance * 0.42));
|
|
@@ -1506,9 +1517,12 @@ export function createBoard({ host, adapter, approvals, t, onOpenSession }) {
|
|
|
1506
1517
|
});
|
|
1507
1518
|
const path = document.createElementNS(SVG_NS, 'path');
|
|
1508
1519
|
path.setAttribute('d', d);
|
|
1509
|
-
path.setAttribute('class', 'iwb-link');
|
|
1520
|
+
path.setAttribute('class', 'iwb-link' + (card.running ? ' iwb-link-active' : ''));
|
|
1510
1521
|
if (target.mode === 'draft') path.setAttribute('stroke-dasharray', '4 4');
|
|
1511
|
-
|
|
1522
|
+
const arrow = document.createElementNS(SVG_NS, 'path');
|
|
1523
|
+
arrow.setAttribute('d', arrowPath(edgeAnchor(targetCard, toSide), toSide));
|
|
1524
|
+
arrow.setAttribute('class', 'iwb-link-arrow');
|
|
1525
|
+
linkLayer.append(hit, path, arrow);
|
|
1512
1526
|
}
|
|
1513
1527
|
}
|
|
1514
1528
|
}
|
package/src/client/styles.css
CHANGED
|
@@ -465,32 +465,62 @@
|
|
|
465
465
|
overflow: visible; pointer-events: none; z-index: 1;
|
|
466
466
|
}
|
|
467
467
|
.iwb-links path.iwb-link {
|
|
468
|
-
fill: none; stroke: var(--dsw-alias-label-deep-diving); stroke-width: 1.
|
|
469
|
-
opacity: .
|
|
468
|
+
fill: none; stroke: var(--dsw-alias-label-deep-diving); stroke-width: 1.5;
|
|
469
|
+
stroke-linecap: round; opacity: .5; pointer-events: stroke; cursor: pointer;
|
|
470
|
+
transition: opacity .15s ease, stroke-width .15s ease;
|
|
470
471
|
}
|
|
471
|
-
.iwb-links path.iwb-link:hover { opacity: .95; stroke-width: 2; }
|
|
472
|
+
.iwb-links path.iwb-link:hover { opacity: .95; stroke-width: 2.2; }
|
|
472
473
|
.iwb-links path.iwb-link-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
|
|
473
|
-
.iwb-links path.iwb-link-temp {
|
|
474
|
-
|
|
474
|
+
.iwb-links path.iwb-link-temp {
|
|
475
|
+
fill: none; stroke: var(--dsw-alias-label-deep-diving); stroke-width: 1.8;
|
|
476
|
+
stroke-dasharray: 3 5; stroke-linecap: round; opacity: .75;
|
|
477
|
+
animation: iwb-flow 1s linear infinite;
|
|
478
|
+
}
|
|
479
|
+
.iwb-links path.iwb-link-arrow {
|
|
480
|
+
fill: var(--dsw-alias-label-deep-diving); opacity: .45; pointer-events: none;
|
|
481
|
+
}
|
|
482
|
+
.iwb-links path.iwb-link.iwb-link-active {
|
|
483
|
+
stroke-width: 2; opacity: .8;
|
|
484
|
+
stroke-dasharray: 7 7; animation: iwb-flow 1.1s linear infinite;
|
|
485
|
+
}
|
|
486
|
+
@keyframes iwb-flow { to { stroke-dashoffset: -28; } }
|
|
487
|
+
/* Connection handles: a whisper by default, a crisp ring on card hover. */
|
|
475
488
|
.iwb-port {
|
|
476
|
-
position: absolute; width:
|
|
477
|
-
border:
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
}
|
|
482
|
-
.iwb-card:hover .iwb-port,
|
|
483
|
-
.iwb-
|
|
489
|
+
position: absolute; width: 10px; height: 10px; border-radius: 50%;
|
|
490
|
+
border: 0; background: var(--dsw-alias-label-deep-diving);
|
|
491
|
+
opacity: .38; transform: scale(.9); cursor: crosshair; z-index: 3;
|
|
492
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-bg-layer-1) 55%, transparent);
|
|
493
|
+
transition: opacity .18s ease, transform .18s cubic-bezier(.2, .8, .3, 1.2), box-shadow .18s ease, background .18s ease;
|
|
494
|
+
}
|
|
495
|
+
.iwb-card:hover .iwb-port,
|
|
496
|
+
.iwb-card.iwb-focus .iwb-port {
|
|
497
|
+
width: 12px; height: 12px; opacity: .95; transform: scale(1);
|
|
498
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--dsw-alias-label-deep-diving) 16%, transparent);
|
|
499
|
+
}
|
|
500
|
+
.iwb-port:hover {
|
|
501
|
+
background: var(--dsw-alias-label-deep-diving);
|
|
502
|
+
transform: scale(1.25);
|
|
503
|
+
box-shadow: 0 0 0 4px color-mix(in srgb, var(--dsw-alias-label-deep-diving) 20%, transparent);
|
|
504
|
+
}
|
|
484
505
|
.iwb-port::after {
|
|
485
|
-
content: "
|
|
486
|
-
|
|
487
|
-
}
|
|
488
|
-
.iwb-port[data-side="right"] { right: -
|
|
489
|
-
.iwb-port[data-side="left"] { left: -
|
|
490
|
-
.iwb-port[data-side="top"] { top: -
|
|
491
|
-
.iwb-port[data-side="bottom"] { bottom: -
|
|
492
|
-
.iwb-card.iwb-
|
|
493
|
-
.iwb-card
|
|
506
|
+
content: ""; position: absolute; inset: 0; border-radius: 50%;
|
|
507
|
+
box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--dsw-alias-bg-layer-1) 65%, transparent);
|
|
508
|
+
}
|
|
509
|
+
.iwb-port[data-side="right"] { right: -5px; top: calc(50% - 5px); }
|
|
510
|
+
.iwb-port[data-side="left"] { left: -5px; top: calc(50% - 5px); }
|
|
511
|
+
.iwb-port[data-side="top"] { top: -5px; left: calc(50% - 5px); }
|
|
512
|
+
.iwb-port[data-side="bottom"] { bottom: -5px; left: calc(50% - 5px); }
|
|
513
|
+
.iwb-card:hover .iwb-port[data-side="right"] { right: -6px; top: calc(50% - 6px); }
|
|
514
|
+
.iwb-card:hover .iwb-port[data-side="left"] { left: -6px; top: calc(50% - 6px); }
|
|
515
|
+
.iwb-card:hover .iwb-port[data-side="top"] { top: -6px; left: calc(50% - 6px); }
|
|
516
|
+
.iwb-card:hover .iwb-port[data-side="bottom"] { bottom: -6px; left: calc(50% - 6px); }
|
|
517
|
+
|
|
518
|
+
.iwb-card.iwb-link-target {
|
|
519
|
+
outline: 1.5px solid color-mix(in srgb, var(--dsw-alias-label-deep-diving) 60%, transparent);
|
|
520
|
+
outline-offset: 4px;
|
|
521
|
+
box-shadow: 0 0 0 8px color-mix(in srgb, var(--dsw-alias-label-deep-diving) 7%, transparent);
|
|
522
|
+
}
|
|
523
|
+
.iwb-card-note.iwb-link-target { outline-color: color-mix(in srgb, var(--dsw-alias-label-deep-diving) 55%, transparent); }
|
|
494
524
|
.iwb-link-menu { min-width: 230px; }
|
|
495
525
|
.iwb-link-remove .iwb-model-name { color: var(--dsw-alias-state-error-primary); }
|
|
496
526
|
|