@almadar/ui 2.53.0 → 2.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avl/index.cjs +826 -619
- package/dist/avl/index.js +826 -619
- package/dist/components/index.cjs +72 -30
- package/dist/components/index.js +72 -30
- package/dist/components/molecules/markdown/CodeBlock.d.ts +8 -0
- package/dist/providers/index.cjs +72 -30
- package/dist/providers/index.js +72 -30
- package/dist/runtime/index.cjs +72 -30
- package/dist/runtime/index.js +72 -30
- package/package.json +1 -1
package/dist/avl/index.js
CHANGED
|
@@ -22074,7 +22074,8 @@ var CodeBlock = React125__default.memo(
|
|
|
22074
22074
|
foldable: foldableProp,
|
|
22075
22075
|
className,
|
|
22076
22076
|
editable = false,
|
|
22077
|
-
onChange
|
|
22077
|
+
onChange,
|
|
22078
|
+
errorLines
|
|
22078
22079
|
}) => {
|
|
22079
22080
|
const code = typeof rawCode === "string" ? rawCode : String(rawCode ?? "");
|
|
22080
22081
|
const isOrb = language === "orb";
|
|
@@ -22106,6 +22107,28 @@ var CodeBlock = React125__default.memo(
|
|
|
22106
22107
|
ov.scrollLeft = ta.scrollLeft;
|
|
22107
22108
|
}
|
|
22108
22109
|
}, []);
|
|
22110
|
+
const errorLineProps = useMemo(() => {
|
|
22111
|
+
if (!errorLines || errorLines.size === 0) {
|
|
22112
|
+
return LINE_PROPS_FN;
|
|
22113
|
+
}
|
|
22114
|
+
return (lineNumber) => {
|
|
22115
|
+
const severity = errorLines.get(lineNumber);
|
|
22116
|
+
if (!severity) {
|
|
22117
|
+
return { "data-line": String(lineNumber - 1) };
|
|
22118
|
+
}
|
|
22119
|
+
return {
|
|
22120
|
+
"data-line": String(lineNumber - 1),
|
|
22121
|
+
style: {
|
|
22122
|
+
display: "block",
|
|
22123
|
+
backgroundColor: severity === "error" ? "rgba(248, 113, 113, 0.18)" : "rgba(251, 191, 36, 0.18)",
|
|
22124
|
+
// amber-400 @ 18%
|
|
22125
|
+
borderLeft: `3px solid ${severity === "error" ? "#ef4444" : "#f59e0b"}`,
|
|
22126
|
+
paddingLeft: "0.5rem",
|
|
22127
|
+
marginLeft: "-0.5rem"
|
|
22128
|
+
}
|
|
22129
|
+
};
|
|
22130
|
+
};
|
|
22131
|
+
}, [errorLines]);
|
|
22109
22132
|
const isFoldable = foldableProp ?? (language === "orb" || language === "json");
|
|
22110
22133
|
const [collapsed, setCollapsed] = useState(() => /* @__PURE__ */ new Set());
|
|
22111
22134
|
const foldRegions = useMemo(
|
|
@@ -22266,24 +22289,40 @@ var CodeBlock = React125__default.memo(
|
|
|
22266
22289
|
}
|
|
22267
22290
|
),
|
|
22268
22291
|
editable ? (
|
|
22269
|
-
/* GAP-77: editable mode = transparent
|
|
22270
|
-
|
|
22271
|
-
to avoid cursor jumps; the overlay reads `editableValue` which is
|
|
22272
|
-
mirrored from the textarea via onChange. Both elements share IDENTICAL
|
|
22273
|
-
font / line-height / padding so the highlighted text aligns with the
|
|
22274
|
-
textarea's invisible glyphs.
|
|
22292
|
+
/* GAP-77 / GAP-82 / GAP-83: editable mode = transparent textarea on
|
|
22293
|
+
top of a Prism-highlighted SyntaxHighlighter overlay.
|
|
22275
22294
|
|
|
22276
|
-
|
|
22277
|
-
|
|
22295
|
+
Layout: BOTH children are `position: absolute, inset: 0` so neither
|
|
22296
|
+
contributes to flow. The parent Box has `height: 100%` so it fills
|
|
22297
|
+
whatever container the consumer provides (the consumer is
|
|
22298
|
+
responsible for giving the parent a real height — usually via flex
|
|
22299
|
+
column with `minHeight: 0`).
|
|
22300
|
+
|
|
22301
|
+
Stacking: the overlay is FIRST in DOM order so it paints first
|
|
22302
|
+
(behind), the textarea is SECOND so it paints second (on top). No
|
|
22303
|
+
explicit z-index — DOM order alone determines stacking inside the
|
|
22304
|
+
parent's stacking context. The textarea has `color: transparent`
|
|
22305
|
+
plus `WebkitTextFillColor: transparent` (Safari) so its glyphs
|
|
22306
|
+
never paint, but the caret stays visible via `caretColor`.
|
|
22307
|
+
|
|
22308
|
+
Scroll sync: textarea scrolls naturally; `handleEditableScroll`
|
|
22309
|
+
mirrors its scrollTop/scrollLeft onto the overlay div so the
|
|
22310
|
+
highlighted spans stay aligned with the textarea content.
|
|
22311
|
+
|
|
22312
|
+
Error highlights (GAP-80): `errorLines` prop accepts a Map of
|
|
22313
|
+
1-based line numbers → severity. The overlay's SyntaxHighlighter
|
|
22314
|
+
uses `wrapLines` + `lineProps` to paint a colored background on
|
|
22315
|
+
those lines. */
|
|
22278
22316
|
/* @__PURE__ */ jsxs(
|
|
22279
22317
|
Box,
|
|
22280
22318
|
{
|
|
22281
22319
|
style: {
|
|
22282
22320
|
position: "relative",
|
|
22283
|
-
|
|
22284
|
-
borderRadius: hasHeader ? "0 0 0.5rem 0.5rem" : "0.5rem",
|
|
22321
|
+
height: "100%",
|
|
22285
22322
|
minHeight: "160px",
|
|
22286
22323
|
maxHeight,
|
|
22324
|
+
backgroundColor: "#1e1e1e",
|
|
22325
|
+
borderRadius: hasHeader ? "0 0 0.5rem 0.5rem" : "0.5rem",
|
|
22287
22326
|
overflow: "hidden"
|
|
22288
22327
|
},
|
|
22289
22328
|
children: [
|
|
@@ -22294,10 +22333,12 @@ var CodeBlock = React125__default.memo(
|
|
|
22294
22333
|
"aria-hidden": true,
|
|
22295
22334
|
style: {
|
|
22296
22335
|
position: "absolute",
|
|
22297
|
-
|
|
22336
|
+
top: 0,
|
|
22337
|
+
left: 0,
|
|
22338
|
+
width: "100%",
|
|
22339
|
+
height: "100%",
|
|
22298
22340
|
overflow: "hidden",
|
|
22299
|
-
pointerEvents: "none"
|
|
22300
|
-
maxHeight
|
|
22341
|
+
pointerEvents: "none"
|
|
22301
22342
|
},
|
|
22302
22343
|
children: /* @__PURE__ */ jsx(
|
|
22303
22344
|
SyntaxHighlighter,
|
|
@@ -22305,6 +22346,8 @@ var CodeBlock = React125__default.memo(
|
|
|
22305
22346
|
PreTag: "div",
|
|
22306
22347
|
language,
|
|
22307
22348
|
style: activeStyle,
|
|
22349
|
+
wrapLines: errorLines && errorLines.size > 0,
|
|
22350
|
+
lineProps: errorLineProps,
|
|
22308
22351
|
customStyle: {
|
|
22309
22352
|
backgroundColor: "transparent",
|
|
22310
22353
|
borderRadius: 0,
|
|
@@ -22312,7 +22355,6 @@ var CodeBlock = React125__default.memo(
|
|
|
22312
22355
|
margin: 0,
|
|
22313
22356
|
whiteSpace: "pre",
|
|
22314
22357
|
minWidth: "100%",
|
|
22315
|
-
minHeight: "160px",
|
|
22316
22358
|
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
|
|
22317
22359
|
fontSize: "13px",
|
|
22318
22360
|
lineHeight: "1.5"
|
|
@@ -22341,23 +22383,23 @@ var CodeBlock = React125__default.memo(
|
|
|
22341
22383
|
onScroll: handleEditableScroll,
|
|
22342
22384
|
spellCheck: false,
|
|
22343
22385
|
style: {
|
|
22344
|
-
position: "
|
|
22345
|
-
|
|
22346
|
-
|
|
22347
|
-
fontSize: "13px",
|
|
22348
|
-
lineHeight: "1.5",
|
|
22349
|
-
backgroundColor: "transparent",
|
|
22350
|
-
color: "transparent",
|
|
22351
|
-
caretColor: "#e6e6e6",
|
|
22352
|
-
borderRadius: hasHeader ? "0 0 0.5rem 0.5rem" : "0.5rem",
|
|
22353
|
-
border: "none",
|
|
22354
|
-
padding: "1rem",
|
|
22355
|
-
resize: "none",
|
|
22356
|
-
minHeight: "160px",
|
|
22357
|
-
maxHeight,
|
|
22386
|
+
position: "absolute",
|
|
22387
|
+
top: 0,
|
|
22388
|
+
left: 0,
|
|
22358
22389
|
width: "100%",
|
|
22359
22390
|
height: "100%",
|
|
22391
|
+
padding: "1rem",
|
|
22392
|
+
margin: 0,
|
|
22393
|
+
border: "none",
|
|
22360
22394
|
outline: "none",
|
|
22395
|
+
resize: "none",
|
|
22396
|
+
backgroundColor: "transparent",
|
|
22397
|
+
color: "transparent",
|
|
22398
|
+
caretColor: "#e6e6e6",
|
|
22399
|
+
WebkitTextFillColor: "transparent",
|
|
22400
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
|
|
22401
|
+
fontSize: "13px",
|
|
22402
|
+
lineHeight: "1.5",
|
|
22361
22403
|
whiteSpace: "pre",
|
|
22362
22404
|
overflowWrap: "normal",
|
|
22363
22405
|
overflow: "auto"
|
|
@@ -22388,7 +22430,7 @@ var CodeBlock = React125__default.memo(
|
|
|
22388
22430
|
)
|
|
22389
22431
|
] });
|
|
22390
22432
|
},
|
|
22391
|
-
(prev, next) => prev.language === next.language && prev.code === next.code && prev.showCopyButton === next.showCopyButton && prev.maxHeight === next.maxHeight && prev.foldable === next.foldable && prev.editable === next.editable && prev.onChange === next.onChange
|
|
22433
|
+
(prev, next) => prev.language === next.language && prev.code === next.code && prev.showCopyButton === next.showCopyButton && prev.maxHeight === next.maxHeight && prev.foldable === next.foldable && prev.editable === next.editable && prev.onChange === next.onChange && prev.errorLines === next.errorLines
|
|
22392
22434
|
);
|
|
22393
22435
|
CodeBlock.displayName = "CodeBlock";
|
|
22394
22436
|
|
|
@@ -49187,545 +49229,103 @@ AvlCosmicZoom.displayName = "AvlCosmicZoom";
|
|
|
49187
49229
|
|
|
49188
49230
|
// components/organisms/avl/AvlOrbitalsCosmicZoom.tsx
|
|
49189
49231
|
init_avl_schema_parser();
|
|
49190
|
-
|
|
49191
|
-
|
|
49192
|
-
var
|
|
49193
|
-
var
|
|
49194
|
-
|
|
49195
|
-
|
|
49196
|
-
|
|
49197
|
-
|
|
49198
|
-
const rows = Math.ceil(count / cols);
|
|
49199
|
-
const cellW = containerW / (cols + 0.3);
|
|
49200
|
-
const cellH = containerH / (rows + 0.3);
|
|
49201
|
-
const originX = (containerW - cols * cellW) / 2 + cellW / 2;
|
|
49202
|
-
const originY = (containerH - rows * cellH) / 2 + cellH / 2;
|
|
49203
|
-
return Array.from({ length: count }, (_, i) => ({
|
|
49204
|
-
cx: originX + i % cols * cellW,
|
|
49205
|
-
cy: originY + Math.floor(i / cols) * cellH
|
|
49206
|
-
}));
|
|
49207
|
-
}
|
|
49208
|
-
var avlOczWireId = 0;
|
|
49209
|
-
var EventWireOverlay = ({
|
|
49210
|
-
orbitalViews,
|
|
49211
|
-
crossLinks,
|
|
49212
|
-
color,
|
|
49213
|
-
animated,
|
|
49214
|
-
containerW,
|
|
49215
|
-
containerH
|
|
49232
|
+
init_avl_zoom_state();
|
|
49233
|
+
init_types();
|
|
49234
|
+
var SWIM_GUTTER2 = 120;
|
|
49235
|
+
var CENTER_W2 = 360;
|
|
49236
|
+
var AvlTraitScene = ({
|
|
49237
|
+
data,
|
|
49238
|
+
color = "var(--color-primary)",
|
|
49239
|
+
onTransitionClick
|
|
49216
49240
|
}) => {
|
|
49217
|
-
const
|
|
49218
|
-
|
|
49219
|
-
|
|
49220
|
-
|
|
49221
|
-
|
|
49222
|
-
|
|
49223
|
-
|
|
49224
|
-
|
|
49225
|
-
|
|
49226
|
-
const
|
|
49227
|
-
|
|
49228
|
-
|
|
49229
|
-
|
|
49230
|
-
|
|
49231
|
-
|
|
49232
|
-
|
|
49233
|
-
|
|
49234
|
-
|
|
49235
|
-
|
|
49236
|
-
const
|
|
49237
|
-
|
|
49238
|
-
"
|
|
49239
|
-
|
|
49240
|
-
|
|
49241
|
-
|
|
49242
|
-
|
|
49243
|
-
|
|
49244
|
-
|
|
49245
|
-
|
|
49246
|
-
|
|
49247
|
-
|
|
49248
|
-
|
|
49249
|
-
|
|
49250
|
-
|
|
49251
|
-
|
|
49252
|
-
|
|
49253
|
-
|
|
49254
|
-
|
|
49255
|
-
|
|
49256
|
-
|
|
49257
|
-
|
|
49258
|
-
|
|
49259
|
-
|
|
49260
|
-
|
|
49261
|
-
|
|
49262
|
-
|
|
49263
|
-
|
|
49264
|
-
|
|
49265
|
-
|
|
49266
|
-
|
|
49267
|
-
|
|
49268
|
-
|
|
49269
|
-
|
|
49270
|
-
|
|
49271
|
-
|
|
49272
|
-
|
|
49273
|
-
|
|
49274
|
-
|
|
49275
|
-
|
|
49276
|
-
|
|
49277
|
-
|
|
49278
|
-
|
|
49279
|
-
|
|
49280
|
-
|
|
49281
|
-
|
|
49282
|
-
|
|
49283
|
-
|
|
49284
|
-
|
|
49285
|
-
|
|
49286
|
-
|
|
49287
|
-
|
|
49288
|
-
|
|
49289
|
-
|
|
49290
|
-
|
|
49291
|
-
|
|
49292
|
-
|
|
49293
|
-
|
|
49294
|
-
|
|
49295
|
-
|
|
49296
|
-
|
|
49297
|
-
|
|
49298
|
-
|
|
49299
|
-
|
|
49300
|
-
|
|
49301
|
-
|
|
49302
|
-
|
|
49303
|
-
|
|
49304
|
-
|
|
49305
|
-
/* @__PURE__ */ jsx(
|
|
49306
|
-
"rect",
|
|
49307
|
-
{
|
|
49308
|
-
x: lx - labelW / 2,
|
|
49309
|
-
y: ly - 8,
|
|
49310
|
-
width: labelW,
|
|
49311
|
-
height: 14,
|
|
49312
|
-
rx: 3,
|
|
49313
|
-
fill: "var(--color-background, #fff)",
|
|
49314
|
-
stroke: color,
|
|
49315
|
-
strokeWidth: 0.5,
|
|
49316
|
-
opacity: 0.9
|
|
49317
|
-
}
|
|
49318
|
-
),
|
|
49319
|
-
/* @__PURE__ */ jsx(
|
|
49320
|
-
"text",
|
|
49321
|
-
{
|
|
49322
|
-
x: lx,
|
|
49323
|
-
y: ly + 3,
|
|
49324
|
-
textAnchor: "middle",
|
|
49325
|
-
fill: color,
|
|
49326
|
-
fontSize: 7,
|
|
49327
|
-
fontWeight: 600,
|
|
49328
|
-
fontFamily: "monospace",
|
|
49329
|
-
opacity: 0.8,
|
|
49330
|
-
children: link.eventName
|
|
49331
|
-
}
|
|
49332
|
-
)
|
|
49333
|
-
] }, `${pairKey}-${wireIdx}`);
|
|
49334
|
-
})
|
|
49335
|
-
)
|
|
49336
|
-
]
|
|
49337
|
-
}
|
|
49338
|
-
);
|
|
49339
|
-
};
|
|
49340
|
-
var InfoPanel = ({ view, crossLinks, color }) => {
|
|
49341
|
-
const emitsOut = crossLinks.filter((l) => l.emitterOrbital === view.name);
|
|
49342
|
-
const listensIn = crossLinks.filter((l) => l.listenerOrbital === view.name);
|
|
49343
|
-
return /* @__PURE__ */ jsxs(
|
|
49344
|
-
Box,
|
|
49345
|
-
{
|
|
49346
|
-
position: "absolute",
|
|
49347
|
-
rounded: "lg",
|
|
49348
|
-
paddingX: "md",
|
|
49349
|
-
paddingY: "sm",
|
|
49350
|
-
bg: "overlay",
|
|
49351
|
-
style: {
|
|
49352
|
-
left: view.cx - 120,
|
|
49353
|
-
top: view.cy + UNIT_DISPLAY_H / 2 + 4,
|
|
49354
|
-
width: 240,
|
|
49355
|
-
border: `1px solid ${color}`,
|
|
49356
|
-
zIndex: 20,
|
|
49357
|
-
pointerEvents: "none"
|
|
49358
|
-
},
|
|
49359
|
-
children: [
|
|
49360
|
-
/* @__PURE__ */ jsx(Typography, { weight: "semibold", style: { marginBottom: 4, color }, children: view.name }),
|
|
49361
|
-
/* @__PURE__ */ jsxs(Text, { variant: "small", style: { opacity: 0.7, color }, children: [
|
|
49362
|
-
"Entity: ",
|
|
49363
|
-
view.entityName,
|
|
49364
|
-
" (",
|
|
49365
|
-
view.fieldCount,
|
|
49366
|
-
" fields, ",
|
|
49367
|
-
view.persistence,
|
|
49368
|
-
")"
|
|
49369
|
-
] }),
|
|
49370
|
-
/* @__PURE__ */ jsxs(Text, { variant: "small", style: { opacity: 0.7, color }, children: [
|
|
49371
|
-
"Traits: ",
|
|
49372
|
-
view.traits.map((t) => t.name).join(", ") || "none"
|
|
49373
|
-
] }),
|
|
49374
|
-
view.pages.length > 0 && /* @__PURE__ */ jsxs(Text, { variant: "small", style: { opacity: 0.7, color }, children: [
|
|
49375
|
-
"Pages: ",
|
|
49376
|
-
view.pages.map((p2) => p2.name).join(", ")
|
|
49377
|
-
] }),
|
|
49378
|
-
emitsOut.length > 0 && /* @__PURE__ */ jsxs(Text, { variant: "small", style: { opacity: 0.7, color }, children: [
|
|
49379
|
-
"Emits \u2192 ",
|
|
49380
|
-
emitsOut.map((l) => `${l.eventName} \u2192 ${l.listenerOrbital}`).join(", ")
|
|
49381
|
-
] }),
|
|
49382
|
-
listensIn.length > 0 && /* @__PURE__ */ jsxs(Text, { variant: "small", style: { opacity: 0.7, color }, children: [
|
|
49383
|
-
"Listens \u2190 ",
|
|
49384
|
-
listensIn.map((l) => `${l.eventName} \u2190 ${l.emitterOrbital}`).join(", ")
|
|
49385
|
-
] })
|
|
49386
|
-
]
|
|
49387
|
-
}
|
|
49388
|
-
);
|
|
49389
|
-
};
|
|
49390
|
-
var AvlOrbitalsCosmicZoom = ({
|
|
49391
|
-
schema: schemaProp,
|
|
49392
|
-
className,
|
|
49393
|
-
color = "var(--color-primary, #4A90D9)",
|
|
49394
|
-
animated = true,
|
|
49395
|
-
width = "100%",
|
|
49396
|
-
height = 450,
|
|
49397
|
-
highlightedOrbital,
|
|
49398
|
-
onOrbitalSelect,
|
|
49399
|
-
minZoom = 0.4,
|
|
49400
|
-
maxZoom = 3
|
|
49401
|
-
}) => {
|
|
49402
|
-
const parsedSchema = useMemo(() => {
|
|
49403
|
-
if (typeof schemaProp === "string") return JSON.parse(schemaProp);
|
|
49404
|
-
return schemaProp;
|
|
49405
|
-
}, [schemaProp]);
|
|
49406
|
-
const { orbitals, crossLinks } = useMemo(
|
|
49407
|
-
() => parseApplicationLevel(parsedSchema),
|
|
49408
|
-
[parsedSchema]
|
|
49409
|
-
);
|
|
49410
|
-
const containerW = typeof width === "number" ? width : 800;
|
|
49411
|
-
const containerH = typeof height === "number" ? height : 450;
|
|
49412
|
-
const positions = useMemo(
|
|
49413
|
-
() => layoutOrbitals(orbitals.length, containerW, containerH),
|
|
49414
|
-
[orbitals.length, containerW, containerH]
|
|
49415
|
-
);
|
|
49416
|
-
const orbitalViews = useMemo(
|
|
49417
|
-
() => orbitals.map((o, i) => ({
|
|
49418
|
-
name: o.name,
|
|
49419
|
-
entityName: o.entityName,
|
|
49420
|
-
fieldCount: o.fieldCount,
|
|
49421
|
-
persistence: o.persistence || "persistent",
|
|
49422
|
-
traits: o.traitNames.map((n) => ({ name: n })),
|
|
49423
|
-
pages: o.pageNames.map((n) => ({ name: n })),
|
|
49424
|
-
cx: positions[i]?.cx ?? 0,
|
|
49425
|
-
cy: positions[i]?.cy ?? 0
|
|
49426
|
-
})),
|
|
49427
|
-
[orbitals, positions]
|
|
49428
|
-
);
|
|
49429
|
-
const [selected, setSelected] = useState(null);
|
|
49430
|
-
const handleSelect = useCallback(
|
|
49431
|
-
(name) => {
|
|
49432
|
-
setSelected((prev) => prev === name ? null : name);
|
|
49433
|
-
onOrbitalSelect?.(name);
|
|
49434
|
-
},
|
|
49435
|
-
[onOrbitalSelect]
|
|
49436
|
-
);
|
|
49437
|
-
const selectedView = orbitalViews.find((o) => o.name === selected);
|
|
49438
|
-
const [zoom, setZoom] = useState(1);
|
|
49439
|
-
const [pan, setPan] = useState({ x: 0, y: 0 });
|
|
49440
|
-
const dragStateRef = useRef(null);
|
|
49441
|
-
const transformWrapperRef = useRef(null);
|
|
49442
|
-
const clampZoom = useCallback(
|
|
49443
|
-
(z) => Math.max(minZoom, Math.min(maxZoom, z)),
|
|
49444
|
-
[minZoom, maxZoom]
|
|
49445
|
-
);
|
|
49446
|
-
const handlePointerDown = useCallback((e) => {
|
|
49447
|
-
if (e.target.closest("[data-orbital-tile]")) return;
|
|
49448
|
-
dragStateRef.current = {
|
|
49449
|
-
startX: e.clientX,
|
|
49450
|
-
startY: e.clientY,
|
|
49451
|
-
panX: pan.x,
|
|
49452
|
-
panY: pan.y
|
|
49453
|
-
};
|
|
49454
|
-
e.target.setPointerCapture(e.pointerId);
|
|
49455
|
-
}, [pan]);
|
|
49456
|
-
const handlePointerMove = useCallback((e) => {
|
|
49457
|
-
const drag = dragStateRef.current;
|
|
49458
|
-
if (!drag) return;
|
|
49459
|
-
setPan({
|
|
49460
|
-
x: drag.panX + (e.clientX - drag.startX),
|
|
49461
|
-
y: drag.panY + (e.clientY - drag.startY)
|
|
49462
|
-
});
|
|
49463
|
-
}, []);
|
|
49464
|
-
const handlePointerUp = useCallback((e) => {
|
|
49465
|
-
if (!dragStateRef.current) return;
|
|
49466
|
-
dragStateRef.current = null;
|
|
49467
|
-
try {
|
|
49468
|
-
e.target.releasePointerCapture(e.pointerId);
|
|
49469
|
-
} catch {
|
|
49470
|
-
}
|
|
49471
|
-
}, []);
|
|
49472
|
-
const panRef = useRef(pan);
|
|
49473
|
-
const zoomRef = useRef(zoom);
|
|
49474
|
-
useEffect(() => {
|
|
49475
|
-
panRef.current = pan;
|
|
49476
|
-
}, [pan]);
|
|
49477
|
-
useEffect(() => {
|
|
49478
|
-
zoomRef.current = zoom;
|
|
49479
|
-
}, [zoom]);
|
|
49480
|
-
useEffect(() => {
|
|
49481
|
-
const wrapper = transformWrapperRef.current;
|
|
49482
|
-
if (!wrapper) return;
|
|
49483
|
-
const wheelListener = (e) => {
|
|
49484
|
-
e.preventDefault();
|
|
49485
|
-
const rect = wrapper.getBoundingClientRect();
|
|
49486
|
-
const cursorX = e.clientX - rect.left;
|
|
49487
|
-
const cursorY = e.clientY - rect.top;
|
|
49488
|
-
const currentZoom = zoomRef.current;
|
|
49489
|
-
const currentPan = panRef.current;
|
|
49490
|
-
const worldX = (cursorX - currentPan.x) / currentZoom;
|
|
49491
|
-
const worldY = (cursorY - currentPan.y) / currentZoom;
|
|
49492
|
-
const delta = e.deltaY > 0 ? -0.1 : 0.1;
|
|
49493
|
-
const nextZoom = clampZoom(currentZoom * (1 + delta));
|
|
49494
|
-
const nextPanX = cursorX - worldX * nextZoom;
|
|
49495
|
-
const nextPanY = cursorY - worldY * nextZoom;
|
|
49496
|
-
setZoom(nextZoom);
|
|
49497
|
-
setPan({ x: nextPanX, y: nextPanY });
|
|
49498
|
-
};
|
|
49499
|
-
wrapper.addEventListener("wheel", wheelListener, { passive: false });
|
|
49500
|
-
return () => wrapper.removeEventListener("wheel", wheelListener);
|
|
49501
|
-
}, [clampZoom]);
|
|
49502
|
-
const zoomIn = useCallback(() => setZoom((z) => clampZoom(z * 1.2)), [clampZoom]);
|
|
49503
|
-
const zoomOut = useCallback(() => setZoom((z) => clampZoom(z / 1.2)), [clampZoom]);
|
|
49504
|
-
const resetZoom = useCallback(() => {
|
|
49505
|
-
setZoom(1);
|
|
49506
|
-
setPan({ x: 0, y: 0 });
|
|
49507
|
-
}, []);
|
|
49508
|
-
return /* @__PURE__ */ jsxs(
|
|
49509
|
-
Box,
|
|
49510
|
-
{
|
|
49511
|
-
className,
|
|
49512
|
-
position: "relative",
|
|
49513
|
-
overflow: "visible",
|
|
49514
|
-
style: { width, height: containerH },
|
|
49515
|
-
children: [
|
|
49516
|
-
/* @__PURE__ */ jsx(
|
|
49517
|
-
"div",
|
|
49518
|
-
{
|
|
49519
|
-
ref: transformWrapperRef,
|
|
49520
|
-
onPointerDown: handlePointerDown,
|
|
49521
|
-
onPointerMove: handlePointerMove,
|
|
49522
|
-
onPointerUp: handlePointerUp,
|
|
49523
|
-
onPointerCancel: handlePointerUp,
|
|
49524
|
-
style: {
|
|
49525
|
-
position: "absolute",
|
|
49526
|
-
inset: 0,
|
|
49527
|
-
overflow: "hidden",
|
|
49528
|
-
cursor: dragStateRef.current ? "grabbing" : "grab",
|
|
49529
|
-
touchAction: "none"
|
|
49530
|
-
},
|
|
49531
|
-
children: /* @__PURE__ */ jsxs(
|
|
49532
|
-
"div",
|
|
49533
|
-
{
|
|
49534
|
-
style: {
|
|
49535
|
-
position: "absolute",
|
|
49536
|
-
inset: 0,
|
|
49537
|
-
transform: `translate(${pan.x}px, ${pan.y}px) scale(${zoom})`,
|
|
49538
|
-
transformOrigin: "0 0"
|
|
49539
|
-
},
|
|
49540
|
-
children: [
|
|
49541
|
-
/* @__PURE__ */ jsx(
|
|
49542
|
-
EventWireOverlay,
|
|
49543
|
-
{
|
|
49544
|
-
orbitalViews,
|
|
49545
|
-
crossLinks,
|
|
49546
|
-
color,
|
|
49547
|
-
animated,
|
|
49548
|
-
containerW,
|
|
49549
|
-
containerH
|
|
49550
|
-
}
|
|
49551
|
-
),
|
|
49552
|
-
orbitalViews.map((view) => {
|
|
49553
|
-
const isHighlighted = view.name === highlightedOrbital;
|
|
49554
|
-
return /* @__PURE__ */ jsx(
|
|
49555
|
-
Box,
|
|
49556
|
-
{
|
|
49557
|
-
role: "button",
|
|
49558
|
-
tabIndex: 0,
|
|
49559
|
-
"data-orbital-tile": "true",
|
|
49560
|
-
onClick: () => handleSelect(view.name),
|
|
49561
|
-
onKeyDown: (e) => {
|
|
49562
|
-
if (e.key === "Enter" || e.key === " ") handleSelect(view.name);
|
|
49563
|
-
},
|
|
49564
|
-
"aria-label": `Orbital: ${view.name}${isHighlighted ? " (highlighted)" : ""}`,
|
|
49565
|
-
position: "absolute",
|
|
49566
|
-
style: {
|
|
49567
|
-
left: view.cx - UNIT_DISPLAY_W / 2,
|
|
49568
|
-
top: view.cy - UNIT_DISPLAY_H / 2,
|
|
49569
|
-
width: UNIT_DISPLAY_W,
|
|
49570
|
-
height: UNIT_DISPLAY_H,
|
|
49571
|
-
cursor: "pointer",
|
|
49572
|
-
transition: "transform 0.2s ease, filter 0.2s ease, box-shadow 0.3s ease",
|
|
49573
|
-
transform: selected === view.name ? "scale(1.05)" : "scale(1)",
|
|
49574
|
-
filter: selected && selected !== view.name ? "opacity(0.5)" : "none",
|
|
49575
|
-
// GAP-52: persistent highlight ring (independent from user selection)
|
|
49576
|
-
boxShadow: isHighlighted ? `0 0 0 3px ${color}, 0 0 24px 4px ${color}` : "none",
|
|
49577
|
-
borderRadius: isHighlighted ? "12px" : void 0,
|
|
49578
|
-
zIndex: isHighlighted ? 11 : selected === view.name ? 10 : 1
|
|
49579
|
-
},
|
|
49580
|
-
children: /* @__PURE__ */ jsx(
|
|
49581
|
-
AvlOrbitalUnit,
|
|
49582
|
-
{
|
|
49583
|
-
entityName: view.entityName,
|
|
49584
|
-
fields: view.fieldCount,
|
|
49585
|
-
persistence: view.persistence,
|
|
49586
|
-
traits: view.traits,
|
|
49587
|
-
pages: view.pages,
|
|
49588
|
-
color,
|
|
49589
|
-
animated: animated && (selected === view.name || isHighlighted)
|
|
49590
|
-
}
|
|
49591
|
-
)
|
|
49592
|
-
},
|
|
49593
|
-
view.name
|
|
49594
|
-
);
|
|
49595
|
-
}),
|
|
49596
|
-
selectedView && /* @__PURE__ */ jsx(
|
|
49597
|
-
InfoPanel,
|
|
49598
|
-
{
|
|
49599
|
-
view: selectedView,
|
|
49600
|
-
crossLinks,
|
|
49601
|
-
color
|
|
49602
|
-
}
|
|
49603
|
-
)
|
|
49604
|
-
]
|
|
49605
|
-
}
|
|
49606
|
-
)
|
|
49607
|
-
}
|
|
49608
|
-
),
|
|
49609
|
-
/* @__PURE__ */ jsxs(
|
|
49610
|
-
Box,
|
|
49611
|
-
{
|
|
49612
|
-
position: "absolute",
|
|
49613
|
-
style: {
|
|
49614
|
-
top: 12,
|
|
49615
|
-
right: 12,
|
|
49616
|
-
display: "flex",
|
|
49617
|
-
flexDirection: "column",
|
|
49618
|
-
gap: 4,
|
|
49619
|
-
zIndex: 30
|
|
49620
|
-
},
|
|
49621
|
-
children: [
|
|
49622
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", onClick: zoomIn, title: "Zoom in", action: "COSMIC_ZOOM_IN", children: /* @__PURE__ */ jsx(Icon, { name: "plus", size: "sm" }) }),
|
|
49623
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", onClick: zoomOut, title: "Zoom out", action: "COSMIC_ZOOM_OUT", children: /* @__PURE__ */ jsx(Icon, { name: "minus", size: "sm" }) }),
|
|
49624
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", onClick: resetZoom, title: "Reset", action: "COSMIC_ZOOM_RESET", children: /* @__PURE__ */ jsx(Icon, { name: "maximize", size: "sm" }) })
|
|
49625
|
-
]
|
|
49626
|
-
}
|
|
49627
|
-
)
|
|
49628
|
-
]
|
|
49629
|
-
}
|
|
49630
|
-
);
|
|
49631
|
-
};
|
|
49632
|
-
AvlOrbitalsCosmicZoom.displayName = "AvlOrbitalsCosmicZoom";
|
|
49633
|
-
init_types();
|
|
49634
|
-
var SWIM_GUTTER2 = 120;
|
|
49635
|
-
var CENTER_W2 = 360;
|
|
49636
|
-
var AvlTraitScene = ({
|
|
49637
|
-
data,
|
|
49638
|
-
color = "var(--color-primary)",
|
|
49639
|
-
onTransitionClick
|
|
49640
|
-
}) => {
|
|
49641
|
-
const [layout, setLayout] = useState(null);
|
|
49642
|
-
const dataKey = useMemo(() => JSON.stringify(data), [data]);
|
|
49643
|
-
useEffect(() => {
|
|
49644
|
-
computeTraitLayout(data).then(setLayout).catch(console.error);
|
|
49645
|
-
}, [dataKey]);
|
|
49646
|
-
if (!layout) {
|
|
49647
|
-
return /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("text", { x: 300, y: 200, textAnchor: "middle", fill: color, fontSize: 12, opacity: 0.5, children: "Computing layout..." }) });
|
|
49648
|
-
}
|
|
49649
|
-
const hasExternal = data.listenedEvents.length > 0 || data.emittedEvents.length > 0;
|
|
49650
|
-
const machineOffsetX = hasExternal ? 0 : 30;
|
|
49651
|
-
const padding = 20;
|
|
49652
|
-
const availW = CENTER_W2 - padding * 2;
|
|
49653
|
-
const availH = 300;
|
|
49654
|
-
const scale = Math.min(1, availW / layout.width, availH / layout.height);
|
|
49655
|
-
const scaledW = layout.width * scale;
|
|
49656
|
-
const scaledH = layout.height * scale;
|
|
49657
|
-
const offsetX = padding + (availW - scaledW) / 2;
|
|
49658
|
-
const offsetY = 50 + (availH - scaledH) / 2;
|
|
49659
|
-
const machineHeight = scaledH + 100;
|
|
49660
|
-
const renderMachine = /* @__PURE__ */ jsxs("g", { children: [
|
|
49661
|
-
/* @__PURE__ */ jsx("text", { x: CENTER_W2 / 2, y: 20, textAnchor: "middle", fill: color, fontSize: 20, fontWeight: "700", fontFamily: "inherit", children: data.name }),
|
|
49662
|
-
/* @__PURE__ */ jsxs("text", { x: CENTER_W2 / 2, y: 38, textAnchor: "middle", fill: color, fontSize: 11, opacity: 0.5, fontFamily: "inherit", children: [
|
|
49663
|
-
"linked to ",
|
|
49664
|
-
data.linkedEntity
|
|
49665
|
-
] }),
|
|
49666
|
-
/* @__PURE__ */ jsxs("defs", { children: [
|
|
49667
|
-
/* @__PURE__ */ jsx("marker", { id: "traitArrowV2", viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "6", markerHeight: "6", orient: "auto-start-reverse", children: /* @__PURE__ */ jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: CONNECTION_COLORS.forward.color, opacity: 0.7 }) }),
|
|
49668
|
-
/* @__PURE__ */ jsx("marker", { id: "traitArrowBack", viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "6", markerHeight: "6", orient: "auto-start-reverse", children: /* @__PURE__ */ jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: CONNECTION_COLORS.backward.color, opacity: 0.5 }) })
|
|
49669
|
-
] }),
|
|
49670
|
-
/* @__PURE__ */ jsxs("g", { transform: `translate(${offsetX},${offsetY}) scale(${scale})`, children: [
|
|
49671
|
-
layout.edges.map((edge) => {
|
|
49672
|
-
const conn = edge.isSelf ? CONNECTION_COLORS.selfLoop : edge.isBackward ? CONNECTION_COLORS.backward : CONNECTION_COLORS.forward;
|
|
49673
|
-
const marker = edge.isBackward || edge.isSelf ? "url(#traitArrowBack)" : "url(#traitArrowV2)";
|
|
49674
|
-
return /* @__PURE__ */ jsxs("g", { children: [
|
|
49675
|
-
/* @__PURE__ */ jsx(
|
|
49676
|
-
"path",
|
|
49677
|
-
{
|
|
49678
|
-
d: edgePath(edge.points),
|
|
49679
|
-
fill: "none",
|
|
49680
|
-
stroke: conn.color,
|
|
49681
|
-
strokeWidth: conn.width,
|
|
49682
|
-
strokeDasharray: conn.dash === "none" ? void 0 : conn.dash,
|
|
49683
|
-
opacity: 0.5,
|
|
49684
|
-
markerEnd: marker
|
|
49685
|
-
}
|
|
49686
|
-
),
|
|
49687
|
-
/* @__PURE__ */ jsx(
|
|
49688
|
-
AvlTransitionLane,
|
|
49689
|
-
{
|
|
49690
|
-
x: edge.labelX,
|
|
49691
|
-
y: edge.labelY,
|
|
49692
|
-
event: edge.event,
|
|
49693
|
-
guard: edge.guardExpr,
|
|
49694
|
-
effects: edge.effects.map((e) => ({ type: e.type })),
|
|
49695
|
-
width: edge.labelW,
|
|
49696
|
-
isBackward: edge.isBackward,
|
|
49697
|
-
isSelfLoop: edge.isSelf,
|
|
49698
|
-
color,
|
|
49699
|
-
onTransitionClick: onTransitionClick ? () => onTransitionClick(edge.index, {
|
|
49700
|
-
x: edge.labelX + offsetX + (hasExternal ? SWIM_GUTTER2 : machineOffsetX),
|
|
49701
|
-
y: edge.labelY + offsetY
|
|
49702
|
-
}) : void 0
|
|
49703
|
-
}
|
|
49704
|
-
)
|
|
49705
|
-
] }, edge.id);
|
|
49706
|
-
}),
|
|
49707
|
-
layout.nodes.map((node) => /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx(
|
|
49708
|
-
AvlState,
|
|
49709
|
-
{
|
|
49710
|
-
x: node.x,
|
|
49711
|
-
y: node.y,
|
|
49712
|
-
width: node.width,
|
|
49713
|
-
height: node.height,
|
|
49714
|
-
name: node.id,
|
|
49715
|
-
isInitial: node.isInitial,
|
|
49716
|
-
isTerminal: node.isTerminal,
|
|
49717
|
-
role: node.role,
|
|
49718
|
-
transitionCount: node.transitionCount,
|
|
49719
|
-
color
|
|
49720
|
-
}
|
|
49721
|
-
) }, node.id))
|
|
49722
|
-
] })
|
|
49723
|
-
] });
|
|
49724
|
-
if (!hasExternal) {
|
|
49725
|
-
return /* @__PURE__ */ jsx("g", { transform: `translate(${machineOffsetX}, 0)`, children: renderMachine });
|
|
49726
|
-
}
|
|
49727
|
-
return /* @__PURE__ */ jsx(
|
|
49728
|
-
AvlSwimLane,
|
|
49241
|
+
const [layout, setLayout] = useState(null);
|
|
49242
|
+
const dataKey = useMemo(() => JSON.stringify(data), [data]);
|
|
49243
|
+
useEffect(() => {
|
|
49244
|
+
computeTraitLayout(data).then(setLayout).catch(console.error);
|
|
49245
|
+
}, [dataKey]);
|
|
49246
|
+
if (!layout) {
|
|
49247
|
+
return /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("text", { x: 300, y: 200, textAnchor: "middle", fill: color, fontSize: 12, opacity: 0.5, children: "Computing layout..." }) });
|
|
49248
|
+
}
|
|
49249
|
+
const hasExternal = data.listenedEvents.length > 0 || data.emittedEvents.length > 0;
|
|
49250
|
+
const machineOffsetX = hasExternal ? 0 : 30;
|
|
49251
|
+
const padding = 20;
|
|
49252
|
+
const availW = CENTER_W2 - padding * 2;
|
|
49253
|
+
const availH = 300;
|
|
49254
|
+
const scale = Math.min(1, availW / layout.width, availH / layout.height);
|
|
49255
|
+
const scaledW = layout.width * scale;
|
|
49256
|
+
const scaledH = layout.height * scale;
|
|
49257
|
+
const offsetX = padding + (availW - scaledW) / 2;
|
|
49258
|
+
const offsetY = 50 + (availH - scaledH) / 2;
|
|
49259
|
+
const machineHeight = scaledH + 100;
|
|
49260
|
+
const renderMachine = /* @__PURE__ */ jsxs("g", { children: [
|
|
49261
|
+
/* @__PURE__ */ jsx("text", { x: CENTER_W2 / 2, y: 20, textAnchor: "middle", fill: color, fontSize: 20, fontWeight: "700", fontFamily: "inherit", children: data.name }),
|
|
49262
|
+
/* @__PURE__ */ jsxs("text", { x: CENTER_W2 / 2, y: 38, textAnchor: "middle", fill: color, fontSize: 11, opacity: 0.5, fontFamily: "inherit", children: [
|
|
49263
|
+
"linked to ",
|
|
49264
|
+
data.linkedEntity
|
|
49265
|
+
] }),
|
|
49266
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
|
49267
|
+
/* @__PURE__ */ jsx("marker", { id: "traitArrowV2", viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "6", markerHeight: "6", orient: "auto-start-reverse", children: /* @__PURE__ */ jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: CONNECTION_COLORS.forward.color, opacity: 0.7 }) }),
|
|
49268
|
+
/* @__PURE__ */ jsx("marker", { id: "traitArrowBack", viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "6", markerHeight: "6", orient: "auto-start-reverse", children: /* @__PURE__ */ jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: CONNECTION_COLORS.backward.color, opacity: 0.5 }) })
|
|
49269
|
+
] }),
|
|
49270
|
+
/* @__PURE__ */ jsxs("g", { transform: `translate(${offsetX},${offsetY}) scale(${scale})`, children: [
|
|
49271
|
+
layout.edges.map((edge) => {
|
|
49272
|
+
const conn = edge.isSelf ? CONNECTION_COLORS.selfLoop : edge.isBackward ? CONNECTION_COLORS.backward : CONNECTION_COLORS.forward;
|
|
49273
|
+
const marker = edge.isBackward || edge.isSelf ? "url(#traitArrowBack)" : "url(#traitArrowV2)";
|
|
49274
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
49275
|
+
/* @__PURE__ */ jsx(
|
|
49276
|
+
"path",
|
|
49277
|
+
{
|
|
49278
|
+
d: edgePath(edge.points),
|
|
49279
|
+
fill: "none",
|
|
49280
|
+
stroke: conn.color,
|
|
49281
|
+
strokeWidth: conn.width,
|
|
49282
|
+
strokeDasharray: conn.dash === "none" ? void 0 : conn.dash,
|
|
49283
|
+
opacity: 0.5,
|
|
49284
|
+
markerEnd: marker
|
|
49285
|
+
}
|
|
49286
|
+
),
|
|
49287
|
+
/* @__PURE__ */ jsx(
|
|
49288
|
+
AvlTransitionLane,
|
|
49289
|
+
{
|
|
49290
|
+
x: edge.labelX,
|
|
49291
|
+
y: edge.labelY,
|
|
49292
|
+
event: edge.event,
|
|
49293
|
+
guard: edge.guardExpr,
|
|
49294
|
+
effects: edge.effects.map((e) => ({ type: e.type })),
|
|
49295
|
+
width: edge.labelW,
|
|
49296
|
+
isBackward: edge.isBackward,
|
|
49297
|
+
isSelfLoop: edge.isSelf,
|
|
49298
|
+
color,
|
|
49299
|
+
onTransitionClick: onTransitionClick ? () => onTransitionClick(edge.index, {
|
|
49300
|
+
x: edge.labelX + offsetX + (hasExternal ? SWIM_GUTTER2 : machineOffsetX),
|
|
49301
|
+
y: edge.labelY + offsetY
|
|
49302
|
+
}) : void 0
|
|
49303
|
+
}
|
|
49304
|
+
)
|
|
49305
|
+
] }, edge.id);
|
|
49306
|
+
}),
|
|
49307
|
+
layout.nodes.map((node) => /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx(
|
|
49308
|
+
AvlState,
|
|
49309
|
+
{
|
|
49310
|
+
x: node.x,
|
|
49311
|
+
y: node.y,
|
|
49312
|
+
width: node.width,
|
|
49313
|
+
height: node.height,
|
|
49314
|
+
name: node.id,
|
|
49315
|
+
isInitial: node.isInitial,
|
|
49316
|
+
isTerminal: node.isTerminal,
|
|
49317
|
+
role: node.role,
|
|
49318
|
+
transitionCount: node.transitionCount,
|
|
49319
|
+
color
|
|
49320
|
+
}
|
|
49321
|
+
) }, node.id))
|
|
49322
|
+
] })
|
|
49323
|
+
] });
|
|
49324
|
+
if (!hasExternal) {
|
|
49325
|
+
return /* @__PURE__ */ jsx("g", { transform: `translate(${machineOffsetX}, 0)`, children: renderMachine });
|
|
49326
|
+
}
|
|
49327
|
+
return /* @__PURE__ */ jsx(
|
|
49328
|
+
AvlSwimLane,
|
|
49729
49329
|
{
|
|
49730
49330
|
listenedEvents: data.listenedEvents,
|
|
49731
49331
|
emittedEvents: data.emittedEvents,
|
|
@@ -49920,63 +49520,670 @@ var AvlTransitionScene = ({
|
|
|
49920
49520
|
return /* @__PURE__ */ jsxs("g", { children: [
|
|
49921
49521
|
/* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "GUARD" }),
|
|
49922
49522
|
/* @__PURE__ */ jsx(
|
|
49923
|
-
"polygon",
|
|
49523
|
+
"polygon",
|
|
49524
|
+
{
|
|
49525
|
+
points: `${CONTENT_LEFT + 6},${secY + 22} ${CONTENT_LEFT + 2},${secY + 26} ${CONTENT_LEFT + 6},${secY + 30} ${CONTENT_LEFT + 10},${secY + 26}`,
|
|
49526
|
+
fill: "none",
|
|
49527
|
+
stroke: color,
|
|
49528
|
+
strokeWidth: 1,
|
|
49529
|
+
opacity: 0.5
|
|
49530
|
+
}
|
|
49531
|
+
),
|
|
49532
|
+
/* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 18, y: secY + 29, fill: color, fontSize: 12, fontWeight: 400, opacity: 0.6, fontFamily: "inherit", children: data.guard.label })
|
|
49533
|
+
] });
|
|
49534
|
+
})(),
|
|
49535
|
+
hasEffects && (() => {
|
|
49536
|
+
const secY = cardY + headerH + sectionGap + triggerH + guardH;
|
|
49537
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
49538
|
+
/* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "EFFECTS" }),
|
|
49539
|
+
effects.map((eff, i) => {
|
|
49540
|
+
const rowY = secY + 22 + i * effectRowH;
|
|
49541
|
+
const effectType = mapEffectType(eff.type);
|
|
49542
|
+
const argsText = eff.args.length > 0 ? eff.args.join(" \xB7 ") : "";
|
|
49543
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
49544
|
+
/* @__PURE__ */ jsx(
|
|
49545
|
+
AvlEffect,
|
|
49546
|
+
{
|
|
49547
|
+
x: CONTENT_LEFT + 10,
|
|
49548
|
+
y: rowY + 6,
|
|
49549
|
+
effectType,
|
|
49550
|
+
size: 10,
|
|
49551
|
+
showBackground: true
|
|
49552
|
+
}
|
|
49553
|
+
),
|
|
49554
|
+
/* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 28, y: rowY + 10, fill: color, fontSize: 12, fontWeight: 500, opacity: 0.8, fontFamily: "inherit", children: eff.type }),
|
|
49555
|
+
argsText && /* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 28 + eff.type.length * 7 + 8, y: rowY + 10, fill: color, fontSize: 10, fontWeight: 400, opacity: 0.5, fontFamily: "monospace", children: argsText })
|
|
49556
|
+
] }, `eff-${i}`);
|
|
49557
|
+
})
|
|
49558
|
+
] });
|
|
49559
|
+
})(),
|
|
49560
|
+
hasSlots && (() => {
|
|
49561
|
+
const secY = cardY + headerH + sectionGap + triggerH + guardH + effectsH;
|
|
49562
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
49563
|
+
/* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "SLOTS" }),
|
|
49564
|
+
data.slotTargets.map((slot, i) => {
|
|
49565
|
+
const rowY = secY + 22 + i * 22;
|
|
49566
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
49567
|
+
/* @__PURE__ */ jsx("rect", { x: CONTENT_LEFT, y: rowY - 4, width: CARD_W - 56, height: 18, rx: 4, fill: color, fillOpacity: 0.04 }),
|
|
49568
|
+
/* @__PURE__ */ jsxs("text", { x: CONTENT_LEFT + 8, y: rowY + 8, fill: color, fontSize: 11, fontFamily: "inherit", children: [
|
|
49569
|
+
slot.name,
|
|
49570
|
+
": ",
|
|
49571
|
+
slot.pattern
|
|
49572
|
+
] })
|
|
49573
|
+
] }, `slot-${i}`);
|
|
49574
|
+
})
|
|
49575
|
+
] });
|
|
49576
|
+
})()
|
|
49577
|
+
] });
|
|
49578
|
+
};
|
|
49579
|
+
AvlTransitionScene.displayName = "AvlTransitionScene";
|
|
49580
|
+
|
|
49581
|
+
// components/organisms/avl/AvlOrbitalsCosmicZoom.tsx
|
|
49582
|
+
init_Box();
|
|
49583
|
+
init_Stack();
|
|
49584
|
+
init_Typography();
|
|
49585
|
+
var UNIT_DISPLAY_W = 240;
|
|
49586
|
+
var UNIT_DISPLAY_H = 160;
|
|
49587
|
+
function layoutOrbitals(count, containerW, containerH) {
|
|
49588
|
+
if (count === 0) return [];
|
|
49589
|
+
if (count === 1) return [{ cx: containerW / 2, cy: containerH / 2 }];
|
|
49590
|
+
const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
|
|
49591
|
+
const rows = Math.ceil(count / cols);
|
|
49592
|
+
const cellW = containerW / (cols + 0.3);
|
|
49593
|
+
const cellH = containerH / (rows + 0.3);
|
|
49594
|
+
const originX = (containerW - cols * cellW) / 2 + cellW / 2;
|
|
49595
|
+
const originY = (containerH - rows * cellH) / 2 + cellH / 2;
|
|
49596
|
+
return Array.from({ length: count }, (_, i) => ({
|
|
49597
|
+
cx: originX + i % cols * cellW,
|
|
49598
|
+
cy: originY + Math.floor(i / cols) * cellH
|
|
49599
|
+
}));
|
|
49600
|
+
}
|
|
49601
|
+
var avlOczWireId = 0;
|
|
49602
|
+
var EventWireOverlay = ({
|
|
49603
|
+
orbitalViews,
|
|
49604
|
+
crossLinks,
|
|
49605
|
+
color,
|
|
49606
|
+
animated,
|
|
49607
|
+
containerW,
|
|
49608
|
+
containerH
|
|
49609
|
+
}) => {
|
|
49610
|
+
const ids = React125__default.useMemo(() => {
|
|
49611
|
+
avlOczWireId += 1;
|
|
49612
|
+
return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
|
|
49613
|
+
}, []);
|
|
49614
|
+
const posMap = useMemo(() => {
|
|
49615
|
+
const m = /* @__PURE__ */ new Map();
|
|
49616
|
+
for (const ov of orbitalViews) m.set(ov.name, { cx: ov.cx, cy: ov.cy });
|
|
49617
|
+
return m;
|
|
49618
|
+
}, [orbitalViews]);
|
|
49619
|
+
const wiresByPair = useMemo(() => {
|
|
49620
|
+
const map = /* @__PURE__ */ new Map();
|
|
49621
|
+
for (const link of crossLinks) {
|
|
49622
|
+
const key = `${link.emitterOrbital}__${link.listenerOrbital}`;
|
|
49623
|
+
const arr = map.get(key) ?? [];
|
|
49624
|
+
arr.push(link);
|
|
49625
|
+
map.set(key, arr);
|
|
49626
|
+
}
|
|
49627
|
+
return map;
|
|
49628
|
+
}, [crossLinks]);
|
|
49629
|
+
const orbitalR = UNIT_DISPLAY_W * 0.38;
|
|
49630
|
+
return /* @__PURE__ */ jsxs(
|
|
49631
|
+
"svg",
|
|
49632
|
+
{
|
|
49633
|
+
style: {
|
|
49634
|
+
position: "absolute",
|
|
49635
|
+
inset: 0,
|
|
49636
|
+
width: "100%",
|
|
49637
|
+
height: "100%",
|
|
49638
|
+
pointerEvents: "none",
|
|
49639
|
+
overflow: "visible"
|
|
49640
|
+
},
|
|
49641
|
+
viewBox: `0 0 ${containerW} ${containerH}`,
|
|
49642
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
49643
|
+
children: [
|
|
49644
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
|
|
49645
|
+
"marker",
|
|
49646
|
+
{
|
|
49647
|
+
id: ids.arrow,
|
|
49648
|
+
markerWidth: "8",
|
|
49649
|
+
markerHeight: "6",
|
|
49650
|
+
refX: "7",
|
|
49651
|
+
refY: "3",
|
|
49652
|
+
orient: "auto",
|
|
49653
|
+
markerUnits: "strokeWidth",
|
|
49654
|
+
children: /* @__PURE__ */ jsx("path", { d: "M0,0 L8,3 L0,6 Z", fill: color, opacity: 0.6 })
|
|
49655
|
+
}
|
|
49656
|
+
) }),
|
|
49657
|
+
animated && /* @__PURE__ */ jsx("style", { children: `
|
|
49658
|
+
@keyframes avl-ocz-flow {
|
|
49659
|
+
from { stroke-dashoffset: 20; }
|
|
49660
|
+
to { stroke-dashoffset: 0; }
|
|
49661
|
+
}
|
|
49662
|
+
` }),
|
|
49663
|
+
Array.from(wiresByPair.entries()).map(
|
|
49664
|
+
([pairKey, links]) => links.map((link, wireIdx) => {
|
|
49665
|
+
const fromPos = posMap.get(link.emitterOrbital);
|
|
49666
|
+
const toPos = posMap.get(link.listenerOrbital);
|
|
49667
|
+
if (!fromPos || !toPos) return null;
|
|
49668
|
+
const dx = toPos.cx - fromPos.cx;
|
|
49669
|
+
const dy = toPos.cy - fromPos.cy;
|
|
49670
|
+
const dist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
49671
|
+
const nx = dx / dist;
|
|
49672
|
+
const ny = dy / dist;
|
|
49673
|
+
const x1 = fromPos.cx + nx * orbitalR;
|
|
49674
|
+
const y1 = fromPos.cy + ny * orbitalR;
|
|
49675
|
+
const x2 = toPos.cx - nx * (orbitalR + 6);
|
|
49676
|
+
const y2 = toPos.cy - ny * (orbitalR + 6);
|
|
49677
|
+
const offset = 25 + wireIdx * 18;
|
|
49678
|
+
const { cpx, cpy } = curveControlPoint(x1, y1, x2, y2, offset);
|
|
49679
|
+
const pathD = `M${x1},${y1} Q${cpx},${cpy} ${x2},${y2}`;
|
|
49680
|
+
const t = 0.5;
|
|
49681
|
+
const lx = (1 - t) * (1 - t) * x1 + 2 * (1 - t) * t * cpx + t * t * x2;
|
|
49682
|
+
const ly = (1 - t) * (1 - t) * y1 + 2 * (1 - t) * t * cpy + t * t * y2;
|
|
49683
|
+
const labelW = link.eventName.length * 5.5 + 12;
|
|
49684
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
49685
|
+
/* @__PURE__ */ jsx(
|
|
49686
|
+
"path",
|
|
49687
|
+
{
|
|
49688
|
+
d: pathD,
|
|
49689
|
+
fill: "none",
|
|
49690
|
+
stroke: color,
|
|
49691
|
+
strokeWidth: 1.2,
|
|
49692
|
+
strokeDasharray: animated ? "6 4" : "4 3",
|
|
49693
|
+
markerEnd: `url(#${ids.arrow})`,
|
|
49694
|
+
opacity: 0.5,
|
|
49695
|
+
style: animated ? { animation: "avl-ocz-flow 1.5s linear infinite" } : void 0
|
|
49696
|
+
}
|
|
49697
|
+
),
|
|
49698
|
+
/* @__PURE__ */ jsx(
|
|
49699
|
+
"rect",
|
|
49700
|
+
{
|
|
49701
|
+
x: lx - labelW / 2,
|
|
49702
|
+
y: ly - 8,
|
|
49703
|
+
width: labelW,
|
|
49704
|
+
height: 14,
|
|
49705
|
+
rx: 3,
|
|
49706
|
+
fill: "var(--color-background, #fff)",
|
|
49707
|
+
stroke: color,
|
|
49708
|
+
strokeWidth: 0.5,
|
|
49709
|
+
opacity: 0.9
|
|
49710
|
+
}
|
|
49711
|
+
),
|
|
49712
|
+
/* @__PURE__ */ jsx(
|
|
49713
|
+
"text",
|
|
49714
|
+
{
|
|
49715
|
+
x: lx,
|
|
49716
|
+
y: ly + 3,
|
|
49717
|
+
textAnchor: "middle",
|
|
49718
|
+
fill: color,
|
|
49719
|
+
fontSize: 7,
|
|
49720
|
+
fontWeight: 600,
|
|
49721
|
+
fontFamily: "monospace",
|
|
49722
|
+
opacity: 0.8,
|
|
49723
|
+
children: link.eventName
|
|
49724
|
+
}
|
|
49725
|
+
)
|
|
49726
|
+
] }, `${pairKey}-${wireIdx}`);
|
|
49727
|
+
})
|
|
49728
|
+
)
|
|
49729
|
+
]
|
|
49730
|
+
}
|
|
49731
|
+
);
|
|
49732
|
+
};
|
|
49733
|
+
var AvlOrbitalsCosmicZoom = ({
|
|
49734
|
+
schema: schemaProp,
|
|
49735
|
+
className,
|
|
49736
|
+
color = "var(--color-primary, #4A90D9)",
|
|
49737
|
+
animated = true,
|
|
49738
|
+
width = "100%",
|
|
49739
|
+
height = 450,
|
|
49740
|
+
highlightedOrbital,
|
|
49741
|
+
onOrbitalSelect,
|
|
49742
|
+
minZoom = 0.4,
|
|
49743
|
+
maxZoom = 3
|
|
49744
|
+
}) => {
|
|
49745
|
+
const parsedSchema = useMemo(() => {
|
|
49746
|
+
if (typeof schemaProp === "string") return JSON.parse(schemaProp);
|
|
49747
|
+
return schemaProp;
|
|
49748
|
+
}, [schemaProp]);
|
|
49749
|
+
const { orbitals, crossLinks } = useMemo(
|
|
49750
|
+
() => parseApplicationLevel(parsedSchema),
|
|
49751
|
+
[parsedSchema]
|
|
49752
|
+
);
|
|
49753
|
+
const containerW = typeof width === "number" ? width : 800;
|
|
49754
|
+
const containerH = typeof height === "number" ? height : 450;
|
|
49755
|
+
const positions = useMemo(
|
|
49756
|
+
() => layoutOrbitals(orbitals.length, containerW, containerH),
|
|
49757
|
+
[orbitals.length, containerW, containerH]
|
|
49758
|
+
);
|
|
49759
|
+
const orbitalViews = useMemo(
|
|
49760
|
+
() => orbitals.map((o, i) => ({
|
|
49761
|
+
name: o.name,
|
|
49762
|
+
entityName: o.entityName,
|
|
49763
|
+
fieldCount: o.fieldCount,
|
|
49764
|
+
persistence: o.persistence || "persistent",
|
|
49765
|
+
traits: o.traitNames.map((n) => ({ name: n })),
|
|
49766
|
+
pages: o.pageNames.map((n) => ({ name: n })),
|
|
49767
|
+
cx: positions[i]?.cx ?? 0,
|
|
49768
|
+
cy: positions[i]?.cy ?? 0
|
|
49769
|
+
})),
|
|
49770
|
+
[orbitals, positions]
|
|
49771
|
+
);
|
|
49772
|
+
const [state, dispatch] = useReducer(zoomReducer, initialZoomState);
|
|
49773
|
+
const drilledForHighlightRef = useRef(false);
|
|
49774
|
+
useEffect(() => {
|
|
49775
|
+
if (!highlightedOrbital) return;
|
|
49776
|
+
if (drilledForHighlightRef.current) return;
|
|
49777
|
+
drilledForHighlightRef.current = true;
|
|
49778
|
+
dispatch({ type: "ZOOM_INTO_ORBITAL", orbital: highlightedOrbital, targetPosition: { x: 0, y: 0 } });
|
|
49779
|
+
Promise.resolve().then(() => dispatch({ type: "ANIMATION_COMPLETE" }));
|
|
49780
|
+
}, [highlightedOrbital]);
|
|
49781
|
+
const breadcrumbs = useMemo(() => getBreadcrumbs(state), [state]);
|
|
49782
|
+
const handleSelect = useCallback(
|
|
49783
|
+
(name) => {
|
|
49784
|
+
dispatch({ type: "ZOOM_INTO_ORBITAL", orbital: name, targetPosition: { x: 0, y: 0 } });
|
|
49785
|
+
Promise.resolve().then(() => dispatch({ type: "ANIMATION_COMPLETE" }));
|
|
49786
|
+
onOrbitalSelect?.(name);
|
|
49787
|
+
},
|
|
49788
|
+
[onOrbitalSelect]
|
|
49789
|
+
);
|
|
49790
|
+
const handleTraitSelect = useCallback((traitName) => {
|
|
49791
|
+
dispatch({ type: "ZOOM_INTO_TRAIT", trait: traitName, targetPosition: { x: 0, y: 0 } });
|
|
49792
|
+
Promise.resolve().then(() => dispatch({ type: "ANIMATION_COMPLETE" }));
|
|
49793
|
+
}, []);
|
|
49794
|
+
const handleTransitionSelect = useCallback((transitionIndex) => {
|
|
49795
|
+
dispatch({ type: "ZOOM_INTO_TRANSITION", transitionIndex, targetPosition: { x: 0, y: 0 } });
|
|
49796
|
+
Promise.resolve().then(() => dispatch({ type: "ANIMATION_COMPLETE" }));
|
|
49797
|
+
}, []);
|
|
49798
|
+
const handleZoomOut = useCallback(() => {
|
|
49799
|
+
dispatch({ type: "ZOOM_OUT" });
|
|
49800
|
+
Promise.resolve().then(() => dispatch({ type: "ANIMATION_COMPLETE" }));
|
|
49801
|
+
}, []);
|
|
49802
|
+
const handleBreadcrumbClick = useCallback((targetLevel) => {
|
|
49803
|
+
const order = ["application", "orbital", "trait", "transition"];
|
|
49804
|
+
const currentIdx = order.indexOf(state.level);
|
|
49805
|
+
const targetIdx = order.indexOf(targetLevel);
|
|
49806
|
+
const steps = currentIdx - targetIdx;
|
|
49807
|
+
for (let i = 0; i < steps; i++) {
|
|
49808
|
+
dispatch({ type: "ZOOM_OUT" });
|
|
49809
|
+
}
|
|
49810
|
+
Promise.resolve().then(() => dispatch({ type: "ANIMATION_COMPLETE" }));
|
|
49811
|
+
}, [state.level]);
|
|
49812
|
+
useEffect(() => {
|
|
49813
|
+
if (state.level === "application") return;
|
|
49814
|
+
const onKey = (e) => {
|
|
49815
|
+
if (e.key === "Escape") handleZoomOut();
|
|
49816
|
+
};
|
|
49817
|
+
window.addEventListener("keydown", onKey);
|
|
49818
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
49819
|
+
}, [handleZoomOut, state.level]);
|
|
49820
|
+
const orbitalLevelData = useMemo(() => {
|
|
49821
|
+
if (!state.selectedOrbital) return null;
|
|
49822
|
+
return parseOrbitalLevel(parsedSchema, state.selectedOrbital);
|
|
49823
|
+
}, [parsedSchema, state.selectedOrbital]);
|
|
49824
|
+
const traitLevelData = useMemo(() => {
|
|
49825
|
+
if (!state.selectedOrbital || !state.selectedTrait) return null;
|
|
49826
|
+
return parseTraitLevel(parsedSchema, state.selectedOrbital, state.selectedTrait);
|
|
49827
|
+
}, [parsedSchema, state.selectedOrbital, state.selectedTrait]);
|
|
49828
|
+
const transitionLevelData = useMemo(() => {
|
|
49829
|
+
if (!state.selectedOrbital || !state.selectedTrait || state.selectedTransition === null) return null;
|
|
49830
|
+
return parseTransitionLevel(
|
|
49831
|
+
parsedSchema,
|
|
49832
|
+
state.selectedOrbital,
|
|
49833
|
+
state.selectedTrait,
|
|
49834
|
+
state.selectedTransition
|
|
49835
|
+
);
|
|
49836
|
+
}, [parsedSchema, state.selectedOrbital, state.selectedTrait, state.selectedTransition]);
|
|
49837
|
+
const [zoom, setZoom] = useState(1);
|
|
49838
|
+
const [pan, setPan] = useState({ x: 0, y: 0 });
|
|
49839
|
+
const dragStateRef = useRef(null);
|
|
49840
|
+
const transformWrapperRef = useRef(null);
|
|
49841
|
+
const clampZoom = useCallback(
|
|
49842
|
+
(z) => Math.max(minZoom, Math.min(maxZoom, z)),
|
|
49843
|
+
[minZoom, maxZoom]
|
|
49844
|
+
);
|
|
49845
|
+
const handlePointerDown = useCallback((e) => {
|
|
49846
|
+
if (e.target.closest("[data-orbital-tile]")) return;
|
|
49847
|
+
dragStateRef.current = {
|
|
49848
|
+
startX: e.clientX,
|
|
49849
|
+
startY: e.clientY,
|
|
49850
|
+
panX: pan.x,
|
|
49851
|
+
panY: pan.y
|
|
49852
|
+
};
|
|
49853
|
+
e.target.setPointerCapture(e.pointerId);
|
|
49854
|
+
}, [pan]);
|
|
49855
|
+
const handlePointerMove = useCallback((e) => {
|
|
49856
|
+
const drag = dragStateRef.current;
|
|
49857
|
+
if (!drag) return;
|
|
49858
|
+
setPan({
|
|
49859
|
+
x: drag.panX + (e.clientX - drag.startX),
|
|
49860
|
+
y: drag.panY + (e.clientY - drag.startY)
|
|
49861
|
+
});
|
|
49862
|
+
}, []);
|
|
49863
|
+
const handlePointerUp = useCallback((e) => {
|
|
49864
|
+
if (!dragStateRef.current) return;
|
|
49865
|
+
dragStateRef.current = null;
|
|
49866
|
+
try {
|
|
49867
|
+
e.target.releasePointerCapture(e.pointerId);
|
|
49868
|
+
} catch {
|
|
49869
|
+
}
|
|
49870
|
+
}, []);
|
|
49871
|
+
const panRef = useRef(pan);
|
|
49872
|
+
const zoomRef = useRef(zoom);
|
|
49873
|
+
useEffect(() => {
|
|
49874
|
+
panRef.current = pan;
|
|
49875
|
+
}, [pan]);
|
|
49876
|
+
useEffect(() => {
|
|
49877
|
+
zoomRef.current = zoom;
|
|
49878
|
+
}, [zoom]);
|
|
49879
|
+
useEffect(() => {
|
|
49880
|
+
const wrapper = transformWrapperRef.current;
|
|
49881
|
+
if (!wrapper) return;
|
|
49882
|
+
const wheelListener = (e) => {
|
|
49883
|
+
e.preventDefault();
|
|
49884
|
+
const rect = wrapper.getBoundingClientRect();
|
|
49885
|
+
const cursorX = e.clientX - rect.left;
|
|
49886
|
+
const cursorY = e.clientY - rect.top;
|
|
49887
|
+
const currentZoom = zoomRef.current;
|
|
49888
|
+
const currentPan = panRef.current;
|
|
49889
|
+
const worldX = (cursorX - currentPan.x) / currentZoom;
|
|
49890
|
+
const worldY = (cursorY - currentPan.y) / currentZoom;
|
|
49891
|
+
const delta = e.deltaY > 0 ? -0.1 : 0.1;
|
|
49892
|
+
const nextZoom = clampZoom(currentZoom * (1 + delta));
|
|
49893
|
+
const nextPanX = cursorX - worldX * nextZoom;
|
|
49894
|
+
const nextPanY = cursorY - worldY * nextZoom;
|
|
49895
|
+
setZoom(nextZoom);
|
|
49896
|
+
setPan({ x: nextPanX, y: nextPanY });
|
|
49897
|
+
};
|
|
49898
|
+
wrapper.addEventListener("wheel", wheelListener, { passive: false });
|
|
49899
|
+
return () => wrapper.removeEventListener("wheel", wheelListener);
|
|
49900
|
+
}, [clampZoom]);
|
|
49901
|
+
const zoomIn = useCallback(() => setZoom((z) => clampZoom(z * 1.2)), [clampZoom]);
|
|
49902
|
+
const zoomOut = useCallback(() => setZoom((z) => clampZoom(z / 1.2)), [clampZoom]);
|
|
49903
|
+
const resetZoom = useCallback(() => {
|
|
49904
|
+
setZoom(1);
|
|
49905
|
+
setPan({ x: 0, y: 0 });
|
|
49906
|
+
}, []);
|
|
49907
|
+
return /* @__PURE__ */ jsxs(
|
|
49908
|
+
Box,
|
|
49909
|
+
{
|
|
49910
|
+
className,
|
|
49911
|
+
position: "relative",
|
|
49912
|
+
overflow: "visible",
|
|
49913
|
+
style: { width, height: containerH },
|
|
49914
|
+
children: [
|
|
49915
|
+
/* @__PURE__ */ jsx(
|
|
49916
|
+
Box,
|
|
49924
49917
|
{
|
|
49925
|
-
|
|
49926
|
-
|
|
49927
|
-
|
|
49928
|
-
|
|
49929
|
-
|
|
49918
|
+
position: "absolute",
|
|
49919
|
+
style: {
|
|
49920
|
+
top: 12,
|
|
49921
|
+
left: 12,
|
|
49922
|
+
zIndex: 30,
|
|
49923
|
+
background: "var(--color-card, rgba(255,255,255,0.92))",
|
|
49924
|
+
padding: "4px 12px",
|
|
49925
|
+
borderRadius: 6,
|
|
49926
|
+
border: `1px solid ${color}`
|
|
49927
|
+
},
|
|
49928
|
+
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React125__default.Fragment, { children: [
|
|
49929
|
+
i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
|
|
49930
|
+
i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
|
|
49931
|
+
Box,
|
|
49932
|
+
{
|
|
49933
|
+
as: "span",
|
|
49934
|
+
onClick: () => handleBreadcrumbClick(crumb.level),
|
|
49935
|
+
style: { cursor: "pointer" },
|
|
49936
|
+
children: /* @__PURE__ */ jsx(
|
|
49937
|
+
Typography,
|
|
49938
|
+
{
|
|
49939
|
+
variant: "small",
|
|
49940
|
+
style: { color, textDecoration: "underline" },
|
|
49941
|
+
children: crumb.label
|
|
49942
|
+
}
|
|
49943
|
+
)
|
|
49944
|
+
}
|
|
49945
|
+
) : /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "bold", style: { color }, children: crumb.label })
|
|
49946
|
+
] }, crumb.level)) })
|
|
49930
49947
|
}
|
|
49931
49948
|
),
|
|
49932
|
-
/* @__PURE__ */ jsx(
|
|
49933
|
-
|
|
49934
|
-
|
|
49935
|
-
|
|
49936
|
-
|
|
49937
|
-
|
|
49938
|
-
|
|
49939
|
-
|
|
49940
|
-
|
|
49941
|
-
|
|
49942
|
-
|
|
49943
|
-
|
|
49944
|
-
|
|
49945
|
-
|
|
49949
|
+
state.level !== "application" && /* @__PURE__ */ jsx(
|
|
49950
|
+
Box,
|
|
49951
|
+
{
|
|
49952
|
+
position: "absolute",
|
|
49953
|
+
style: {
|
|
49954
|
+
bottom: 12,
|
|
49955
|
+
right: 12,
|
|
49956
|
+
zIndex: 30,
|
|
49957
|
+
background: "var(--color-card, rgba(255,255,255,0.85))",
|
|
49958
|
+
padding: "2px 8px",
|
|
49959
|
+
borderRadius: 4,
|
|
49960
|
+
opacity: 0.8
|
|
49961
|
+
},
|
|
49962
|
+
children: /* @__PURE__ */ jsx(Typography, { variant: "small", style: { color }, children: "Press Esc to zoom out" })
|
|
49963
|
+
}
|
|
49964
|
+
),
|
|
49965
|
+
state.level === "application" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
49966
|
+
/* @__PURE__ */ jsx(
|
|
49967
|
+
"div",
|
|
49968
|
+
{
|
|
49969
|
+
ref: transformWrapperRef,
|
|
49970
|
+
onPointerDown: handlePointerDown,
|
|
49971
|
+
onPointerMove: handlePointerMove,
|
|
49972
|
+
onPointerUp: handlePointerUp,
|
|
49973
|
+
onPointerCancel: handlePointerUp,
|
|
49974
|
+
style: {
|
|
49975
|
+
position: "absolute",
|
|
49976
|
+
inset: 0,
|
|
49977
|
+
overflow: "hidden",
|
|
49978
|
+
cursor: dragStateRef.current ? "grabbing" : "grab",
|
|
49979
|
+
touchAction: "none"
|
|
49980
|
+
},
|
|
49981
|
+
children: /* @__PURE__ */ jsxs(
|
|
49982
|
+
"div",
|
|
49983
|
+
{
|
|
49984
|
+
style: {
|
|
49985
|
+
position: "absolute",
|
|
49986
|
+
inset: 0,
|
|
49987
|
+
transform: `translate(${pan.x}px, ${pan.y}px) scale(${zoom})`,
|
|
49988
|
+
transformOrigin: "0 0"
|
|
49989
|
+
},
|
|
49990
|
+
children: [
|
|
49991
|
+
/* @__PURE__ */ jsx(
|
|
49992
|
+
EventWireOverlay,
|
|
49993
|
+
{
|
|
49994
|
+
orbitalViews,
|
|
49995
|
+
crossLinks,
|
|
49996
|
+
color,
|
|
49997
|
+
animated,
|
|
49998
|
+
containerW,
|
|
49999
|
+
containerH
|
|
50000
|
+
}
|
|
50001
|
+
),
|
|
50002
|
+
orbitalViews.map((view) => {
|
|
50003
|
+
const isHighlighted = view.name === highlightedOrbital;
|
|
50004
|
+
return /* @__PURE__ */ jsx(
|
|
50005
|
+
Box,
|
|
50006
|
+
{
|
|
50007
|
+
role: "button",
|
|
50008
|
+
tabIndex: 0,
|
|
50009
|
+
"data-orbital-tile": "true",
|
|
50010
|
+
onClick: () => handleSelect(view.name),
|
|
50011
|
+
onKeyDown: (e) => {
|
|
50012
|
+
if (e.key === "Enter" || e.key === " ") handleSelect(view.name);
|
|
50013
|
+
},
|
|
50014
|
+
"aria-label": `Orbital: ${view.name}${isHighlighted ? " (highlighted)" : ""}`,
|
|
50015
|
+
position: "absolute",
|
|
50016
|
+
style: {
|
|
50017
|
+
left: view.cx - UNIT_DISPLAY_W / 2,
|
|
50018
|
+
top: view.cy - UNIT_DISPLAY_H / 2,
|
|
50019
|
+
width: UNIT_DISPLAY_W,
|
|
50020
|
+
height: UNIT_DISPLAY_H,
|
|
50021
|
+
cursor: "pointer",
|
|
50022
|
+
transition: "transform 0.2s ease, filter 0.2s ease, box-shadow 0.3s ease",
|
|
50023
|
+
// GAP-52: persistent highlight ring (independent from user selection)
|
|
50024
|
+
boxShadow: isHighlighted ? `0 0 0 3px ${color}, 0 0 24px 4px ${color}` : "none",
|
|
50025
|
+
borderRadius: isHighlighted ? "12px" : void 0,
|
|
50026
|
+
zIndex: isHighlighted ? 11 : 1
|
|
50027
|
+
},
|
|
50028
|
+
children: /* @__PURE__ */ jsx(
|
|
50029
|
+
AvlOrbitalUnit,
|
|
50030
|
+
{
|
|
50031
|
+
entityName: view.entityName,
|
|
50032
|
+
fields: view.fieldCount,
|
|
50033
|
+
persistence: view.persistence,
|
|
50034
|
+
traits: view.traits,
|
|
50035
|
+
pages: view.pages,
|
|
50036
|
+
color,
|
|
50037
|
+
animated: animated && isHighlighted
|
|
50038
|
+
}
|
|
50039
|
+
)
|
|
50040
|
+
},
|
|
50041
|
+
view.name
|
|
50042
|
+
);
|
|
50043
|
+
})
|
|
50044
|
+
]
|
|
50045
|
+
}
|
|
50046
|
+
)
|
|
50047
|
+
}
|
|
50048
|
+
),
|
|
50049
|
+
/* @__PURE__ */ jsxs(
|
|
50050
|
+
Box,
|
|
50051
|
+
{
|
|
50052
|
+
position: "absolute",
|
|
50053
|
+
style: {
|
|
50054
|
+
top: 12,
|
|
50055
|
+
right: 12,
|
|
50056
|
+
display: "flex",
|
|
50057
|
+
flexDirection: "column",
|
|
50058
|
+
gap: 4,
|
|
50059
|
+
zIndex: 30
|
|
50060
|
+
},
|
|
50061
|
+
children: [
|
|
50062
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", onClick: zoomIn, title: "Zoom in", action: "COSMIC_ZOOM_IN", children: /* @__PURE__ */ jsx(Icon, { name: "plus", size: "sm" }) }),
|
|
50063
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", onClick: zoomOut, title: "Zoom out", action: "COSMIC_ZOOM_OUT", children: /* @__PURE__ */ jsx(Icon, { name: "minus", size: "sm" }) }),
|
|
50064
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", onClick: resetZoom, title: "Reset", action: "COSMIC_ZOOM_RESET", children: /* @__PURE__ */ jsx(Icon, { name: "maximize", size: "sm" }) })
|
|
50065
|
+
]
|
|
50066
|
+
}
|
|
50067
|
+
)
|
|
50068
|
+
] }),
|
|
50069
|
+
state.level === "orbital" && orbitalLevelData && /* @__PURE__ */ jsxs(
|
|
50070
|
+
Box,
|
|
50071
|
+
{
|
|
50072
|
+
position: "absolute",
|
|
50073
|
+
style: {
|
|
50074
|
+
inset: 0,
|
|
50075
|
+
paddingTop: 56,
|
|
50076
|
+
paddingBottom: 24,
|
|
50077
|
+
paddingLeft: 24,
|
|
50078
|
+
paddingRight: 24,
|
|
50079
|
+
display: "flex",
|
|
50080
|
+
alignItems: "stretch",
|
|
50081
|
+
justifyContent: "center",
|
|
50082
|
+
gap: 24
|
|
50083
|
+
},
|
|
50084
|
+
children: [
|
|
50085
|
+
/* @__PURE__ */ jsx(Box, { style: { flex: 1, maxWidth: 720, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ jsx(
|
|
50086
|
+
AvlOrbitalUnit,
|
|
50087
|
+
{
|
|
50088
|
+
entityName: orbitalLevelData.entity.name,
|
|
50089
|
+
fields: orbitalLevelData.entity.fields.length,
|
|
50090
|
+
persistence: orbitalLevelData.entity.persistence || "persistent",
|
|
50091
|
+
traits: orbitalLevelData.traits.map((t) => ({ name: t.name })),
|
|
50092
|
+
pages: orbitalLevelData.pages.map((p2) => ({ name: p2.name })),
|
|
50093
|
+
color,
|
|
50094
|
+
animated
|
|
50095
|
+
}
|
|
50096
|
+
) }),
|
|
50097
|
+
/* @__PURE__ */ jsxs(
|
|
50098
|
+
Box,
|
|
50099
|
+
{
|
|
50100
|
+
style: {
|
|
50101
|
+
width: 220,
|
|
50102
|
+
padding: 12,
|
|
50103
|
+
display: "flex",
|
|
50104
|
+
flexDirection: "column",
|
|
50105
|
+
gap: 8,
|
|
50106
|
+
borderLeft: `1px solid ${color}`,
|
|
50107
|
+
opacity: 0.95
|
|
50108
|
+
},
|
|
50109
|
+
children: [
|
|
50110
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "small", weight: "semibold", style: { color, marginBottom: 4 }, children: [
|
|
50111
|
+
"Traits (",
|
|
50112
|
+
orbitalLevelData.traits.length,
|
|
50113
|
+
")"
|
|
50114
|
+
] }),
|
|
50115
|
+
orbitalLevelData.traits.length === 0 && /* @__PURE__ */ jsx(Text, { variant: "small", style: { opacity: 0.6, color }, children: "No traits" }),
|
|
50116
|
+
orbitalLevelData.traits.map((trait) => /* @__PURE__ */ jsx(
|
|
50117
|
+
Button,
|
|
50118
|
+
{
|
|
50119
|
+
variant: "ghost",
|
|
50120
|
+
size: "sm",
|
|
50121
|
+
onClick: () => handleTraitSelect(trait.name),
|
|
50122
|
+
action: "COSMIC_DRILL_TRAIT",
|
|
50123
|
+
children: trait.name
|
|
50124
|
+
},
|
|
50125
|
+
trait.name
|
|
50126
|
+
)),
|
|
50127
|
+
orbitalLevelData.pages.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
50128
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "small", weight: "semibold", style: { color, marginTop: 12 }, children: [
|
|
50129
|
+
"Pages (",
|
|
50130
|
+
orbitalLevelData.pages.length,
|
|
50131
|
+
")"
|
|
50132
|
+
] }),
|
|
50133
|
+
orbitalLevelData.pages.map((page) => /* @__PURE__ */ jsx(Text, { variant: "small", style: { opacity: 0.7, color }, children: page.name }, page.name))
|
|
50134
|
+
] })
|
|
50135
|
+
]
|
|
50136
|
+
}
|
|
50137
|
+
)
|
|
50138
|
+
]
|
|
50139
|
+
}
|
|
50140
|
+
),
|
|
50141
|
+
state.level === "trait" && traitLevelData && /* @__PURE__ */ jsx(
|
|
50142
|
+
Box,
|
|
50143
|
+
{
|
|
50144
|
+
position: "absolute",
|
|
50145
|
+
style: {
|
|
50146
|
+
inset: 0,
|
|
50147
|
+
paddingTop: 56,
|
|
50148
|
+
paddingBottom: 24,
|
|
50149
|
+
paddingLeft: 24,
|
|
50150
|
+
paddingRight: 24
|
|
50151
|
+
},
|
|
50152
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 600 400", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx(
|
|
50153
|
+
AvlTraitScene,
|
|
49946
50154
|
{
|
|
49947
|
-
|
|
49948
|
-
|
|
49949
|
-
|
|
49950
|
-
size: 10,
|
|
49951
|
-
showBackground: true
|
|
50155
|
+
data: traitLevelData,
|
|
50156
|
+
color,
|
|
50157
|
+
onTransitionClick: (idx) => handleTransitionSelect(idx)
|
|
49952
50158
|
}
|
|
49953
|
-
)
|
|
49954
|
-
|
|
49955
|
-
|
|
49956
|
-
|
|
49957
|
-
|
|
49958
|
-
|
|
49959
|
-
|
|
49960
|
-
|
|
49961
|
-
|
|
49962
|
-
|
|
49963
|
-
|
|
49964
|
-
|
|
49965
|
-
|
|
49966
|
-
|
|
49967
|
-
/* @__PURE__ */ jsx("
|
|
49968
|
-
|
|
49969
|
-
|
|
49970
|
-
|
|
49971
|
-
|
|
49972
|
-
|
|
49973
|
-
|
|
49974
|
-
|
|
49975
|
-
|
|
49976
|
-
|
|
49977
|
-
|
|
50159
|
+
) })
|
|
50160
|
+
}
|
|
50161
|
+
),
|
|
50162
|
+
state.level === "transition" && transitionLevelData && /* @__PURE__ */ jsx(
|
|
50163
|
+
Box,
|
|
50164
|
+
{
|
|
50165
|
+
position: "absolute",
|
|
50166
|
+
style: {
|
|
50167
|
+
inset: 0,
|
|
50168
|
+
paddingTop: 56,
|
|
50169
|
+
paddingBottom: 24,
|
|
50170
|
+
paddingLeft: 24,
|
|
50171
|
+
paddingRight: 24
|
|
50172
|
+
},
|
|
50173
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 600 400", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx(
|
|
50174
|
+
AvlTransitionScene,
|
|
50175
|
+
{
|
|
50176
|
+
data: transitionLevelData,
|
|
50177
|
+
color
|
|
50178
|
+
}
|
|
50179
|
+
) })
|
|
50180
|
+
}
|
|
50181
|
+
)
|
|
50182
|
+
]
|
|
50183
|
+
}
|
|
50184
|
+
);
|
|
49978
50185
|
};
|
|
49979
|
-
|
|
50186
|
+
AvlOrbitalsCosmicZoom.displayName = "AvlOrbitalsCosmicZoom";
|
|
49980
50187
|
var AvlClickTarget = ({
|
|
49981
50188
|
x,
|
|
49982
50189
|
y,
|