@almadar/ui 2.20.0 → 2.20.1
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/avl/index.cjs
CHANGED
|
@@ -5171,6 +5171,14 @@ function zoomReducer(state, action) {
|
|
|
5171
5171
|
}
|
|
5172
5172
|
return state;
|
|
5173
5173
|
}
|
|
5174
|
+
case "SWITCH_TRAIT": {
|
|
5175
|
+
if (state.level !== "trait" || state.animating) return state;
|
|
5176
|
+
return {
|
|
5177
|
+
...state,
|
|
5178
|
+
selectedTrait: action.trait,
|
|
5179
|
+
selectedTransition: null
|
|
5180
|
+
};
|
|
5181
|
+
}
|
|
5174
5182
|
case "RESET": {
|
|
5175
5183
|
return initialZoomState;
|
|
5176
5184
|
}
|
|
@@ -5378,12 +5386,15 @@ var AvlApplicationScene = ({
|
|
|
5378
5386
|
AvlApplicationScene.displayName = "AvlApplicationScene";
|
|
5379
5387
|
var CX = 300;
|
|
5380
5388
|
var CY = 200;
|
|
5389
|
+
var VIEWBOX_H = 400;
|
|
5381
5390
|
var ORBITAL_R2 = 130;
|
|
5382
5391
|
var ENTITY_R2 = 24;
|
|
5383
5392
|
var AvlOrbitalScene = ({
|
|
5384
5393
|
data,
|
|
5385
5394
|
color = "var(--color-primary)",
|
|
5386
|
-
|
|
5395
|
+
highlightedTrait,
|
|
5396
|
+
onTraitClick,
|
|
5397
|
+
onTraitHighlight
|
|
5387
5398
|
}) => {
|
|
5388
5399
|
const traitAngleStart = -Math.PI / 3;
|
|
5389
5400
|
const traitAngleStep = data.traits.length > 1 ? Math.PI * 1.2 / (data.traits.length - 1) : 0;
|
|
@@ -5409,7 +5420,7 @@ var AvlOrbitalScene = ({
|
|
|
5409
5420
|
rotation: rotationDeg,
|
|
5410
5421
|
label: trait.name,
|
|
5411
5422
|
color,
|
|
5412
|
-
opacity: 0.7
|
|
5423
|
+
opacity: highlightedTrait ? highlightedTrait === trait.name ? 1 : 0.25 : 0.7
|
|
5413
5424
|
}
|
|
5414
5425
|
),
|
|
5415
5426
|
onTraitClick && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5482,6 +5493,54 @@ var AvlOrbitalScene = ({
|
|
|
5482
5493
|
const py = CY + (ORBITAL_R2 + 15) * Math.sin(angle);
|
|
5483
5494
|
return /* @__PURE__ */ jsxRuntime.jsx(AvlPage, { x: px, y: py, label: page.route, color }, page.name);
|
|
5484
5495
|
}),
|
|
5496
|
+
data.traits.length > 1 && /* @__PURE__ */ jsxRuntime.jsx("g", { children: data.traits.map((trait, i) => {
|
|
5497
|
+
const pillW = 70;
|
|
5498
|
+
const gap = 8;
|
|
5499
|
+
const totalW = data.traits.length * pillW + (data.traits.length - 1) * gap;
|
|
5500
|
+
const startX = CX - totalW / 2;
|
|
5501
|
+
const px = startX + i * (pillW + gap);
|
|
5502
|
+
const py = VIEWBOX_H - 30;
|
|
5503
|
+
const isHighlighted = highlightedTrait === trait.name;
|
|
5504
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5505
|
+
"g",
|
|
5506
|
+
{
|
|
5507
|
+
style: { cursor: "pointer" },
|
|
5508
|
+
onClick: () => onTraitClick?.(trait.name, { x: CX, y: CY }),
|
|
5509
|
+
onMouseEnter: () => onTraitHighlight?.(trait.name),
|
|
5510
|
+
onMouseLeave: () => onTraitHighlight?.(null),
|
|
5511
|
+
children: [
|
|
5512
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5513
|
+
"rect",
|
|
5514
|
+
{
|
|
5515
|
+
x: px,
|
|
5516
|
+
y: py,
|
|
5517
|
+
width: pillW,
|
|
5518
|
+
height: 22,
|
|
5519
|
+
rx: 11,
|
|
5520
|
+
fill: isHighlighted ? color : "transparent",
|
|
5521
|
+
stroke: color,
|
|
5522
|
+
strokeWidth: isHighlighted ? 1.5 : 0.8,
|
|
5523
|
+
opacity: isHighlighted ? 0.15 : 0.3
|
|
5524
|
+
}
|
|
5525
|
+
),
|
|
5526
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5527
|
+
"text",
|
|
5528
|
+
{
|
|
5529
|
+
x: px + pillW / 2,
|
|
5530
|
+
y: py + 14,
|
|
5531
|
+
textAnchor: "middle",
|
|
5532
|
+
fill: color,
|
|
5533
|
+
fontSize: 8,
|
|
5534
|
+
fontWeight: isHighlighted ? "bold" : "normal",
|
|
5535
|
+
opacity: isHighlighted ? 1 : 0.6,
|
|
5536
|
+
children: trait.name.length > 10 ? trait.name.slice(0, 9) + "\u2026" : trait.name
|
|
5537
|
+
}
|
|
5538
|
+
)
|
|
5539
|
+
]
|
|
5540
|
+
},
|
|
5541
|
+
`tab-${trait.name}`
|
|
5542
|
+
);
|
|
5543
|
+
}) }),
|
|
5485
5544
|
data.externalLinks.map((link, i) => {
|
|
5486
5545
|
const isOut = link.direction === "out";
|
|
5487
5546
|
const edgeX = isOut ? 580 : 20;
|
|
@@ -6147,7 +6206,7 @@ var AvlLegend = ({
|
|
|
6147
6206
|
};
|
|
6148
6207
|
AvlLegend.displayName = "AvlLegend";
|
|
6149
6208
|
var VIEWBOX_W = 600;
|
|
6150
|
-
var
|
|
6209
|
+
var VIEWBOX_H2 = 400;
|
|
6151
6210
|
var ANIMATION_DURATION = 600;
|
|
6152
6211
|
var AvlCosmicZoom = ({
|
|
6153
6212
|
schema: schemaProp,
|
|
@@ -6176,11 +6235,11 @@ var AvlCosmicZoom = ({
|
|
|
6176
6235
|
const [transitionStyle, setTransitionStyle] = React6.useState({});
|
|
6177
6236
|
React6.useEffect(() => {
|
|
6178
6237
|
if (initialOrbital) {
|
|
6179
|
-
dispatch({ type: "ZOOM_INTO_ORBITAL", orbital: initialOrbital, targetPosition: { x: VIEWBOX_W / 2, y:
|
|
6238
|
+
dispatch({ type: "ZOOM_INTO_ORBITAL", orbital: initialOrbital, targetPosition: { x: VIEWBOX_W / 2, y: VIEWBOX_H2 / 2 } });
|
|
6180
6239
|
setTimeout(() => dispatch({ type: "ANIMATION_COMPLETE" }), 0);
|
|
6181
6240
|
if (initialTrait) {
|
|
6182
6241
|
setTimeout(() => {
|
|
6183
|
-
dispatch({ type: "ZOOM_INTO_TRAIT", trait: initialTrait, targetPosition: { x: VIEWBOX_W / 2, y:
|
|
6242
|
+
dispatch({ type: "ZOOM_INTO_TRAIT", trait: initialTrait, targetPosition: { x: VIEWBOX_W / 2, y: VIEWBOX_H2 / 2 } });
|
|
6184
6243
|
setTimeout(() => dispatch({ type: "ANIMATION_COMPLETE" }), 0);
|
|
6185
6244
|
}, 10);
|
|
6186
6245
|
}
|
|
@@ -6204,7 +6263,7 @@ var AvlCosmicZoom = ({
|
|
|
6204
6263
|
if (!target) return;
|
|
6205
6264
|
if (state.animationDirection === "in") {
|
|
6206
6265
|
setTransitionStyle({
|
|
6207
|
-
transform: `scale(${target.scale}) translate(${-(target.x - VIEWBOX_W / 2)}px, ${-(target.y -
|
|
6266
|
+
transform: `scale(${target.scale}) translate(${-(target.x - VIEWBOX_W / 2)}px, ${-(target.y - VIEWBOX_H2 / 2)}px)`,
|
|
6208
6267
|
transformOrigin: `${target.x}px ${target.y}px`,
|
|
6209
6268
|
transition: `transform ${ANIMATION_DURATION}ms cubic-bezier(0.4, 0, 0.2, 1), opacity ${ANIMATION_DURATION}ms ease`,
|
|
6210
6269
|
opacity: 0.3
|
|
@@ -6234,6 +6293,10 @@ var AvlCosmicZoom = ({
|
|
|
6234
6293
|
const handleTraitClick = React6.useCallback((name, pos) => {
|
|
6235
6294
|
dispatch({ type: "ZOOM_INTO_TRAIT", trait: name, targetPosition: pos });
|
|
6236
6295
|
}, []);
|
|
6296
|
+
const handleTraitSwitch = React6.useCallback((name) => {
|
|
6297
|
+
dispatch({ type: "SWITCH_TRAIT", trait: name });
|
|
6298
|
+
}, []);
|
|
6299
|
+
const [highlightedTrait, setHighlightedTrait] = React6__default.default.useState(null);
|
|
6237
6300
|
const handleTransitionClick = React6.useCallback((index, pos) => {
|
|
6238
6301
|
dispatch({ type: "ZOOM_INTO_TRANSITION", transitionIndex: index, targetPosition: pos });
|
|
6239
6302
|
}, []);
|
|
@@ -6267,7 +6330,9 @@ var AvlCosmicZoom = ({
|
|
|
6267
6330
|
{
|
|
6268
6331
|
data,
|
|
6269
6332
|
color,
|
|
6270
|
-
|
|
6333
|
+
highlightedTrait,
|
|
6334
|
+
onTraitClick: handleTraitClick,
|
|
6335
|
+
onTraitHighlight: setHighlightedTrait
|
|
6271
6336
|
}
|
|
6272
6337
|
);
|
|
6273
6338
|
}
|
|
@@ -6299,7 +6364,7 @@ var AvlCosmicZoom = ({
|
|
|
6299
6364
|
default:
|
|
6300
6365
|
return null;
|
|
6301
6366
|
}
|
|
6302
|
-
}, [state.level, state.selectedOrbital, state.selectedTrait, state.selectedTransition, schema, color, handleOrbitalClick, handleTraitClick, handleTransitionClick]);
|
|
6367
|
+
}, [state.level, state.selectedOrbital, state.selectedTrait, state.selectedTransition, schema, color, handleOrbitalClick, handleTraitClick, handleTransitionClick, highlightedTrait, setHighlightedTrait]);
|
|
6303
6368
|
const breadcrumbs = getBreadcrumbs(state);
|
|
6304
6369
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6305
6370
|
Box,
|
|
@@ -6329,6 +6394,28 @@ var AvlCosmicZoom = ({
|
|
|
6329
6394
|
] }, crumb.level))
|
|
6330
6395
|
}
|
|
6331
6396
|
),
|
|
6397
|
+
state.level === "trait" && state.selectedOrbital && (() => {
|
|
6398
|
+
const orbData = parseOrbitalLevel(schema, state.selectedOrbital);
|
|
6399
|
+
if (!orbData || orbData.traits.length <= 1) return null;
|
|
6400
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6401
|
+
HStack,
|
|
6402
|
+
{
|
|
6403
|
+
gap: "xs",
|
|
6404
|
+
align: "center",
|
|
6405
|
+
className: "absolute top-2 right-2 z-10 bg-[var(--color-surface)]/80 backdrop-blur rounded-md px-1.5 py-1",
|
|
6406
|
+
children: orbData.traits.map((t) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6407
|
+
Box,
|
|
6408
|
+
{
|
|
6409
|
+
as: "button",
|
|
6410
|
+
className: `px-2.5 py-1 rounded-md text-xs font-medium transition-all cursor-pointer border-none ${t.name === state.selectedTrait ? "bg-[var(--color-primary)] text-[var(--color-primary-foreground)]" : "bg-transparent text-[var(--color-muted-foreground)] hover:text-[var(--color-foreground)] hover:bg-[var(--color-surface)]"}`,
|
|
6411
|
+
onClick: () => handleTraitSwitch(t.name),
|
|
6412
|
+
children: t.name
|
|
6413
|
+
},
|
|
6414
|
+
t.name
|
|
6415
|
+
))
|
|
6416
|
+
}
|
|
6417
|
+
);
|
|
6418
|
+
})(),
|
|
6332
6419
|
state.level !== "application" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6333
6420
|
Typography,
|
|
6334
6421
|
{
|
|
@@ -6341,7 +6428,7 @@ var AvlCosmicZoom = ({
|
|
|
6341
6428
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6342
6429
|
"svg",
|
|
6343
6430
|
{
|
|
6344
|
-
viewBox: `0 0 ${VIEWBOX_W} ${
|
|
6431
|
+
viewBox: `0 0 ${VIEWBOX_W} ${VIEWBOX_H2}`,
|
|
6345
6432
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6346
6433
|
className: "w-full h-full",
|
|
6347
6434
|
role: "img",
|
package/dist/avl/index.d.cts
CHANGED
|
@@ -513,10 +513,14 @@ declare const AvlApplicationScene: React.FC<AvlApplicationSceneProps>;
|
|
|
513
513
|
interface AvlOrbitalSceneProps {
|
|
514
514
|
data: OrbitalLevelData;
|
|
515
515
|
color?: string;
|
|
516
|
+
/** Currently highlighted trait (before zooming in) */
|
|
517
|
+
highlightedTrait?: string | null;
|
|
516
518
|
onTraitClick?: (traitName: string, position: {
|
|
517
519
|
x: number;
|
|
518
520
|
y: number;
|
|
519
521
|
}) => void;
|
|
522
|
+
/** Called when a trait tab is hovered/selected (highlight without zoom) */
|
|
523
|
+
onTraitHighlight?: (traitName: string | null) => void;
|
|
520
524
|
}
|
|
521
525
|
declare const AvlOrbitalScene: React.FC<AvlOrbitalSceneProps>;
|
|
522
526
|
|
package/dist/avl/index.js
CHANGED
|
@@ -5164,6 +5164,14 @@ function zoomReducer(state, action) {
|
|
|
5164
5164
|
}
|
|
5165
5165
|
return state;
|
|
5166
5166
|
}
|
|
5167
|
+
case "SWITCH_TRAIT": {
|
|
5168
|
+
if (state.level !== "trait" || state.animating) return state;
|
|
5169
|
+
return {
|
|
5170
|
+
...state,
|
|
5171
|
+
selectedTrait: action.trait,
|
|
5172
|
+
selectedTransition: null
|
|
5173
|
+
};
|
|
5174
|
+
}
|
|
5167
5175
|
case "RESET": {
|
|
5168
5176
|
return initialZoomState;
|
|
5169
5177
|
}
|
|
@@ -5371,12 +5379,15 @@ var AvlApplicationScene = ({
|
|
|
5371
5379
|
AvlApplicationScene.displayName = "AvlApplicationScene";
|
|
5372
5380
|
var CX = 300;
|
|
5373
5381
|
var CY = 200;
|
|
5382
|
+
var VIEWBOX_H = 400;
|
|
5374
5383
|
var ORBITAL_R2 = 130;
|
|
5375
5384
|
var ENTITY_R2 = 24;
|
|
5376
5385
|
var AvlOrbitalScene = ({
|
|
5377
5386
|
data,
|
|
5378
5387
|
color = "var(--color-primary)",
|
|
5379
|
-
|
|
5388
|
+
highlightedTrait,
|
|
5389
|
+
onTraitClick,
|
|
5390
|
+
onTraitHighlight
|
|
5380
5391
|
}) => {
|
|
5381
5392
|
const traitAngleStart = -Math.PI / 3;
|
|
5382
5393
|
const traitAngleStep = data.traits.length > 1 ? Math.PI * 1.2 / (data.traits.length - 1) : 0;
|
|
@@ -5402,7 +5413,7 @@ var AvlOrbitalScene = ({
|
|
|
5402
5413
|
rotation: rotationDeg,
|
|
5403
5414
|
label: trait.name,
|
|
5404
5415
|
color,
|
|
5405
|
-
opacity: 0.7
|
|
5416
|
+
opacity: highlightedTrait ? highlightedTrait === trait.name ? 1 : 0.25 : 0.7
|
|
5406
5417
|
}
|
|
5407
5418
|
),
|
|
5408
5419
|
onTraitClick && /* @__PURE__ */ jsx(
|
|
@@ -5475,6 +5486,54 @@ var AvlOrbitalScene = ({
|
|
|
5475
5486
|
const py = CY + (ORBITAL_R2 + 15) * Math.sin(angle);
|
|
5476
5487
|
return /* @__PURE__ */ jsx(AvlPage, { x: px, y: py, label: page.route, color }, page.name);
|
|
5477
5488
|
}),
|
|
5489
|
+
data.traits.length > 1 && /* @__PURE__ */ jsx("g", { children: data.traits.map((trait, i) => {
|
|
5490
|
+
const pillW = 70;
|
|
5491
|
+
const gap = 8;
|
|
5492
|
+
const totalW = data.traits.length * pillW + (data.traits.length - 1) * gap;
|
|
5493
|
+
const startX = CX - totalW / 2;
|
|
5494
|
+
const px = startX + i * (pillW + gap);
|
|
5495
|
+
const py = VIEWBOX_H - 30;
|
|
5496
|
+
const isHighlighted = highlightedTrait === trait.name;
|
|
5497
|
+
return /* @__PURE__ */ jsxs(
|
|
5498
|
+
"g",
|
|
5499
|
+
{
|
|
5500
|
+
style: { cursor: "pointer" },
|
|
5501
|
+
onClick: () => onTraitClick?.(trait.name, { x: CX, y: CY }),
|
|
5502
|
+
onMouseEnter: () => onTraitHighlight?.(trait.name),
|
|
5503
|
+
onMouseLeave: () => onTraitHighlight?.(null),
|
|
5504
|
+
children: [
|
|
5505
|
+
/* @__PURE__ */ jsx(
|
|
5506
|
+
"rect",
|
|
5507
|
+
{
|
|
5508
|
+
x: px,
|
|
5509
|
+
y: py,
|
|
5510
|
+
width: pillW,
|
|
5511
|
+
height: 22,
|
|
5512
|
+
rx: 11,
|
|
5513
|
+
fill: isHighlighted ? color : "transparent",
|
|
5514
|
+
stroke: color,
|
|
5515
|
+
strokeWidth: isHighlighted ? 1.5 : 0.8,
|
|
5516
|
+
opacity: isHighlighted ? 0.15 : 0.3
|
|
5517
|
+
}
|
|
5518
|
+
),
|
|
5519
|
+
/* @__PURE__ */ jsx(
|
|
5520
|
+
"text",
|
|
5521
|
+
{
|
|
5522
|
+
x: px + pillW / 2,
|
|
5523
|
+
y: py + 14,
|
|
5524
|
+
textAnchor: "middle",
|
|
5525
|
+
fill: color,
|
|
5526
|
+
fontSize: 8,
|
|
5527
|
+
fontWeight: isHighlighted ? "bold" : "normal",
|
|
5528
|
+
opacity: isHighlighted ? 1 : 0.6,
|
|
5529
|
+
children: trait.name.length > 10 ? trait.name.slice(0, 9) + "\u2026" : trait.name
|
|
5530
|
+
}
|
|
5531
|
+
)
|
|
5532
|
+
]
|
|
5533
|
+
},
|
|
5534
|
+
`tab-${trait.name}`
|
|
5535
|
+
);
|
|
5536
|
+
}) }),
|
|
5478
5537
|
data.externalLinks.map((link, i) => {
|
|
5479
5538
|
const isOut = link.direction === "out";
|
|
5480
5539
|
const edgeX = isOut ? 580 : 20;
|
|
@@ -6140,7 +6199,7 @@ var AvlLegend = ({
|
|
|
6140
6199
|
};
|
|
6141
6200
|
AvlLegend.displayName = "AvlLegend";
|
|
6142
6201
|
var VIEWBOX_W = 600;
|
|
6143
|
-
var
|
|
6202
|
+
var VIEWBOX_H2 = 400;
|
|
6144
6203
|
var ANIMATION_DURATION = 600;
|
|
6145
6204
|
var AvlCosmicZoom = ({
|
|
6146
6205
|
schema: schemaProp,
|
|
@@ -6169,11 +6228,11 @@ var AvlCosmicZoom = ({
|
|
|
6169
6228
|
const [transitionStyle, setTransitionStyle] = useState({});
|
|
6170
6229
|
useEffect(() => {
|
|
6171
6230
|
if (initialOrbital) {
|
|
6172
|
-
dispatch({ type: "ZOOM_INTO_ORBITAL", orbital: initialOrbital, targetPosition: { x: VIEWBOX_W / 2, y:
|
|
6231
|
+
dispatch({ type: "ZOOM_INTO_ORBITAL", orbital: initialOrbital, targetPosition: { x: VIEWBOX_W / 2, y: VIEWBOX_H2 / 2 } });
|
|
6173
6232
|
setTimeout(() => dispatch({ type: "ANIMATION_COMPLETE" }), 0);
|
|
6174
6233
|
if (initialTrait) {
|
|
6175
6234
|
setTimeout(() => {
|
|
6176
|
-
dispatch({ type: "ZOOM_INTO_TRAIT", trait: initialTrait, targetPosition: { x: VIEWBOX_W / 2, y:
|
|
6235
|
+
dispatch({ type: "ZOOM_INTO_TRAIT", trait: initialTrait, targetPosition: { x: VIEWBOX_W / 2, y: VIEWBOX_H2 / 2 } });
|
|
6177
6236
|
setTimeout(() => dispatch({ type: "ANIMATION_COMPLETE" }), 0);
|
|
6178
6237
|
}, 10);
|
|
6179
6238
|
}
|
|
@@ -6197,7 +6256,7 @@ var AvlCosmicZoom = ({
|
|
|
6197
6256
|
if (!target) return;
|
|
6198
6257
|
if (state.animationDirection === "in") {
|
|
6199
6258
|
setTransitionStyle({
|
|
6200
|
-
transform: `scale(${target.scale}) translate(${-(target.x - VIEWBOX_W / 2)}px, ${-(target.y -
|
|
6259
|
+
transform: `scale(${target.scale}) translate(${-(target.x - VIEWBOX_W / 2)}px, ${-(target.y - VIEWBOX_H2 / 2)}px)`,
|
|
6201
6260
|
transformOrigin: `${target.x}px ${target.y}px`,
|
|
6202
6261
|
transition: `transform ${ANIMATION_DURATION}ms cubic-bezier(0.4, 0, 0.2, 1), opacity ${ANIMATION_DURATION}ms ease`,
|
|
6203
6262
|
opacity: 0.3
|
|
@@ -6227,6 +6286,10 @@ var AvlCosmicZoom = ({
|
|
|
6227
6286
|
const handleTraitClick = useCallback((name, pos) => {
|
|
6228
6287
|
dispatch({ type: "ZOOM_INTO_TRAIT", trait: name, targetPosition: pos });
|
|
6229
6288
|
}, []);
|
|
6289
|
+
const handleTraitSwitch = useCallback((name) => {
|
|
6290
|
+
dispatch({ type: "SWITCH_TRAIT", trait: name });
|
|
6291
|
+
}, []);
|
|
6292
|
+
const [highlightedTrait, setHighlightedTrait] = React6.useState(null);
|
|
6230
6293
|
const handleTransitionClick = useCallback((index, pos) => {
|
|
6231
6294
|
dispatch({ type: "ZOOM_INTO_TRANSITION", transitionIndex: index, targetPosition: pos });
|
|
6232
6295
|
}, []);
|
|
@@ -6260,7 +6323,9 @@ var AvlCosmicZoom = ({
|
|
|
6260
6323
|
{
|
|
6261
6324
|
data,
|
|
6262
6325
|
color,
|
|
6263
|
-
|
|
6326
|
+
highlightedTrait,
|
|
6327
|
+
onTraitClick: handleTraitClick,
|
|
6328
|
+
onTraitHighlight: setHighlightedTrait
|
|
6264
6329
|
}
|
|
6265
6330
|
);
|
|
6266
6331
|
}
|
|
@@ -6292,7 +6357,7 @@ var AvlCosmicZoom = ({
|
|
|
6292
6357
|
default:
|
|
6293
6358
|
return null;
|
|
6294
6359
|
}
|
|
6295
|
-
}, [state.level, state.selectedOrbital, state.selectedTrait, state.selectedTransition, schema, color, handleOrbitalClick, handleTraitClick, handleTransitionClick]);
|
|
6360
|
+
}, [state.level, state.selectedOrbital, state.selectedTrait, state.selectedTransition, schema, color, handleOrbitalClick, handleTraitClick, handleTransitionClick, highlightedTrait, setHighlightedTrait]);
|
|
6296
6361
|
const breadcrumbs = getBreadcrumbs(state);
|
|
6297
6362
|
return /* @__PURE__ */ jsxs(
|
|
6298
6363
|
Box,
|
|
@@ -6322,6 +6387,28 @@ var AvlCosmicZoom = ({
|
|
|
6322
6387
|
] }, crumb.level))
|
|
6323
6388
|
}
|
|
6324
6389
|
),
|
|
6390
|
+
state.level === "trait" && state.selectedOrbital && (() => {
|
|
6391
|
+
const orbData = parseOrbitalLevel(schema, state.selectedOrbital);
|
|
6392
|
+
if (!orbData || orbData.traits.length <= 1) return null;
|
|
6393
|
+
return /* @__PURE__ */ jsx(
|
|
6394
|
+
HStack,
|
|
6395
|
+
{
|
|
6396
|
+
gap: "xs",
|
|
6397
|
+
align: "center",
|
|
6398
|
+
className: "absolute top-2 right-2 z-10 bg-[var(--color-surface)]/80 backdrop-blur rounded-md px-1.5 py-1",
|
|
6399
|
+
children: orbData.traits.map((t) => /* @__PURE__ */ jsx(
|
|
6400
|
+
Box,
|
|
6401
|
+
{
|
|
6402
|
+
as: "button",
|
|
6403
|
+
className: `px-2.5 py-1 rounded-md text-xs font-medium transition-all cursor-pointer border-none ${t.name === state.selectedTrait ? "bg-[var(--color-primary)] text-[var(--color-primary-foreground)]" : "bg-transparent text-[var(--color-muted-foreground)] hover:text-[var(--color-foreground)] hover:bg-[var(--color-surface)]"}`,
|
|
6404
|
+
onClick: () => handleTraitSwitch(t.name),
|
|
6405
|
+
children: t.name
|
|
6406
|
+
},
|
|
6407
|
+
t.name
|
|
6408
|
+
))
|
|
6409
|
+
}
|
|
6410
|
+
);
|
|
6411
|
+
})(),
|
|
6325
6412
|
state.level !== "application" && /* @__PURE__ */ jsx(
|
|
6326
6413
|
Typography,
|
|
6327
6414
|
{
|
|
@@ -6334,7 +6421,7 @@ var AvlCosmicZoom = ({
|
|
|
6334
6421
|
/* @__PURE__ */ jsxs(
|
|
6335
6422
|
"svg",
|
|
6336
6423
|
{
|
|
6337
|
-
viewBox: `0 0 ${VIEWBOX_W} ${
|
|
6424
|
+
viewBox: `0 0 ${VIEWBOX_W} ${VIEWBOX_H2}`,
|
|
6338
6425
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6339
6426
|
className: "w-full h-full",
|
|
6340
6427
|
role: "img",
|
|
@@ -9,9 +9,13 @@ import type { OrbitalLevelData } from './avl-schema-parser';
|
|
|
9
9
|
export interface AvlOrbitalSceneProps {
|
|
10
10
|
data: OrbitalLevelData;
|
|
11
11
|
color?: string;
|
|
12
|
+
/** Currently highlighted trait (before zooming in) */
|
|
13
|
+
highlightedTrait?: string | null;
|
|
12
14
|
onTraitClick?: (traitName: string, position: {
|
|
13
15
|
x: number;
|
|
14
16
|
y: number;
|
|
15
17
|
}) => void;
|
|
18
|
+
/** Called when a trait tab is hovered/selected (highlight without zoom) */
|
|
19
|
+
onTraitHighlight?: (traitName: string | null) => void;
|
|
16
20
|
}
|
|
17
21
|
export declare const AvlOrbitalScene: React.FC<AvlOrbitalSceneProps>;
|
|
@@ -47,6 +47,9 @@ export type ZoomAction = {
|
|
|
47
47
|
type: 'ANIMATION_COMPLETE';
|
|
48
48
|
} | {
|
|
49
49
|
type: 'RESET';
|
|
50
|
+
} | {
|
|
51
|
+
type: 'SWITCH_TRAIT';
|
|
52
|
+
trait: string;
|
|
50
53
|
};
|
|
51
54
|
export declare const initialZoomState: ZoomState;
|
|
52
55
|
export declare function zoomReducer(state: ZoomState, action: ZoomAction): ZoomState;
|