@almadar/shell-web 0.0.0-stage → 0.1.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/bundling.d.mts +18 -0
- package/bundling.mjs +28 -0
- package/dist/ArbitraryClassCompiler-Mzabq-UB.d.ts +100 -0
- package/dist/AvlGlyph-JKJOAH23.js +6 -0
- package/dist/AvlStateMachine-PI4YGREK.js +8 -0
- package/dist/AvlTransitionDetail-ZH7V24UG.js +12 -0
- package/dist/AvlTransitionExplainer-ZSRT7L6Y.js +13 -0
- package/dist/BehaviorValueFrame-6RUJXT4A.js +29 -0
- package/dist/BehaviorValueFrame-SSEMEBTG.css +1756 -0
- package/dist/BehaviorView-RFEE5J6E.js +10 -0
- package/dist/Canvas3DHost-_Y-5uLM_.d.ts +552 -0
- package/dist/EventBusProvider-CVwjkV_2.d.ts +284 -0
- package/dist/FileTree-BCFnBEuQ.d.ts +254 -0
- package/dist/FlowCanvas-3JRMNJLV.css +1756 -0
- package/dist/FlowCanvas-STDC4OWK.js +27 -0
- package/dist/GameAudioProvider-Cm9BnvmP.d.ts +93 -0
- package/dist/KaTeX_AMS-Regular-CYEKBG2K.woff +0 -0
- package/dist/KaTeX_AMS-Regular-JKX5W2C4.ttf +0 -0
- package/dist/KaTeX_AMS-Regular-U6PRYMIZ.woff2 +0 -0
- package/dist/KaTeX_Caligraphic-Bold-5QL5CMTE.woff2 +0 -0
- package/dist/KaTeX_Caligraphic-Bold-WZ3QSGD3.woff +0 -0
- package/dist/KaTeX_Caligraphic-Bold-ZTS3R3HK.ttf +0 -0
- package/dist/KaTeX_Caligraphic-Regular-3LKEU76G.woff +0 -0
- package/dist/KaTeX_Caligraphic-Regular-A7XRTZ5Q.ttf +0 -0
- package/dist/KaTeX_Caligraphic-Regular-KX5MEWCF.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Bold-2QVFK6NQ.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Bold-T4SWXBMT.woff +0 -0
- package/dist/KaTeX_Fraktur-Bold-WGHVTYOR.ttf +0 -0
- package/dist/KaTeX_Fraktur-Regular-2PEIFJSJ.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Regular-5U4OPH2X.ttf +0 -0
- package/dist/KaTeX_Fraktur-Regular-PQMHCIK6.woff +0 -0
- package/dist/KaTeX_Main-Bold-2GA4IZIN.woff +0 -0
- package/dist/KaTeX_Main-Bold-W5FBVCZM.ttf +0 -0
- package/dist/KaTeX_Main-Bold-YP5VVQRP.woff2 +0 -0
- package/dist/KaTeX_Main-BoldItalic-4P4C7HJH.woff +0 -0
- package/dist/KaTeX_Main-BoldItalic-N4V3DX7S.woff2 +0 -0
- package/dist/KaTeX_Main-BoldItalic-ODMLBJJQ.ttf +0 -0
- package/dist/KaTeX_Main-Italic-I43T2HSR.ttf +0 -0
- package/dist/KaTeX_Main-Italic-RELBIK7M.woff2 +0 -0
- package/dist/KaTeX_Main-Italic-SASNQFN2.woff +0 -0
- package/dist/KaTeX_Main-Regular-ARRPAO67.woff2 +0 -0
- package/dist/KaTeX_Main-Regular-P5I74A2A.woff +0 -0
- package/dist/KaTeX_Main-Regular-W74P5G27.ttf +0 -0
- package/dist/KaTeX_Math-BoldItalic-6EBV3DK5.woff +0 -0
- package/dist/KaTeX_Math-BoldItalic-K4WTGH3J.woff2 +0 -0
- package/dist/KaTeX_Math-BoldItalic-VB447A4D.ttf +0 -0
- package/dist/KaTeX_Math-Italic-6KGCHLFN.woff2 +0 -0
- package/dist/KaTeX_Math-Italic-KKK3USB2.woff +0 -0
- package/dist/KaTeX_Math-Italic-SON4MRCA.ttf +0 -0
- package/dist/KaTeX_SansSerif-Bold-RRNVJFFW.woff2 +0 -0
- package/dist/KaTeX_SansSerif-Bold-STQ6RXC7.ttf +0 -0
- package/dist/KaTeX_SansSerif-Bold-X5M5EMOD.woff +0 -0
- package/dist/KaTeX_SansSerif-Italic-HMPFTM52.woff2 +0 -0
- package/dist/KaTeX_SansSerif-Italic-PSN4QKYX.woff +0 -0
- package/dist/KaTeX_SansSerif-Italic-WTBAZBGY.ttf +0 -0
- package/dist/KaTeX_SansSerif-Regular-2TL3USAE.ttf +0 -0
- package/dist/KaTeX_SansSerif-Regular-OQCII6EP.woff +0 -0
- package/dist/KaTeX_SansSerif-Regular-XIQ62X4E.woff2 +0 -0
- package/dist/KaTeX_Script-Regular-72OLXYNA.ttf +0 -0
- package/dist/KaTeX_Script-Regular-A5IFOEBS.woff +0 -0
- package/dist/KaTeX_Script-Regular-APUWIHLP.woff2 +0 -0
- package/dist/KaTeX_Size1-Regular-4HRHTS65.woff +0 -0
- package/dist/KaTeX_Size1-Regular-5LRUTBFT.woff2 +0 -0
- package/dist/KaTeX_Size1-Regular-7K6AASVL.ttf +0 -0
- package/dist/KaTeX_Size2-Regular-222HN3GT.ttf +0 -0
- package/dist/KaTeX_Size2-Regular-K5ZHAIS6.woff +0 -0
- package/dist/KaTeX_Size2-Regular-LELKET5D.woff2 +0 -0
- package/dist/KaTeX_Size3-Regular-TLFPAHDE.woff +0 -0
- package/dist/KaTeX_Size3-Regular-UFCO6WCA.ttf +0 -0
- package/dist/KaTeX_Size3-Regular-WQRQ47UD.woff2 +0 -0
- package/dist/KaTeX_Size4-Regular-7PGNVPQK.ttf +0 -0
- package/dist/KaTeX_Size4-Regular-CDMV7U5C.woff2 +0 -0
- package/dist/KaTeX_Size4-Regular-PKMWZHNC.woff +0 -0
- package/dist/KaTeX_Typewriter-Regular-3F5K6SQ6.ttf +0 -0
- package/dist/KaTeX_Typewriter-Regular-MJMFSK64.woff +0 -0
- package/dist/KaTeX_Typewriter-Regular-VBYJ4NRC.woff2 +0 -0
- package/dist/KernelEngineContext-BOCQoFwk.d.ts +43 -0
- package/dist/LayersPanel-BBQ54IVG.js +7 -0
- package/dist/ModuleCard-3TT2X7IW.js +7 -0
- package/dist/OrbInspector-K6T6O7GI.js +27 -0
- package/dist/OrbInspector-MHLJ6OEE.css +1756 -0
- package/dist/Select-mDZIwNqN.d.ts +199 -0
- package/dist/ServerBridge-Cm1On51b.d.ts +233 -0
- package/dist/ThemeContext-DJmO59xd.d.ts +147 -0
- package/dist/TraitValueFrame-2PJGLLVI.js +28 -0
- package/dist/TraitValueFrame-4G3KOUBR.css +1756 -0
- package/dist/UISlotContext-Dl_ewwCI.d.ts +79 -0
- package/dist/UISlotRenderer-JKFSX24W.js +27 -0
- package/dist/UISlotRenderer-KVFO6J7R.css +1756 -0
- package/dist/UserContext-DqWeZkUZ.d.ts +100 -0
- package/dist/auth/browser/index.d.ts +2 -0
- package/dist/auth/browser/index.js +1 -0
- package/dist/auth/react/index.d.ts +49 -0
- package/dist/auth/react/index.js +119 -0
- package/dist/avl/index.css +1756 -0
- package/dist/avl/index.d.ts +2238 -0
- package/dist/avl/index.js +2693 -0
- package/dist/avl-3d-context-BIRKWpaL.d.ts +204 -0
- package/dist/avl-schema-parser-CtJxJ9KU.d.ts +132 -0
- package/dist/avl-zoom-state-CKMVuBFg.d.ts +17 -0
- package/dist/chunk-2PY54Z44.js +227 -0
- package/dist/chunk-2QOH2HWM.js +95 -0
- package/dist/chunk-3BBUBJFF.js +339 -0
- package/dist/chunk-42FY4RYA.js +191 -0
- package/dist/chunk-5QTYQTPS.js +15 -0
- package/dist/chunk-6P3MWXYE.js +440 -0
- package/dist/chunk-73SRAB4P.js +1053 -0
- package/dist/chunk-A2LR6VQQ.js +349 -0
- package/dist/chunk-AILY3XPS.js +562 -0
- package/dist/chunk-B4BU77LT.js +432 -0
- package/dist/chunk-DFNZUYX4.js +378 -0
- package/dist/chunk-DJ433ET5.js +1327 -0
- package/dist/chunk-DLZF4PVE.js +24 -0
- package/dist/chunk-DYEKAA4L.js +787 -0
- package/dist/chunk-DZ42OJQC.js +176 -0
- package/dist/chunk-EOWMARUB.js +16 -0
- package/dist/chunk-EQAMU2ZC.js +14 -0
- package/dist/chunk-FAJDTHWC.js +98 -0
- package/dist/chunk-FIW6WN23.js +508 -0
- package/dist/chunk-FP3WIKTC.js +303 -0
- package/dist/chunk-G7DCAZ22.js +19 -0
- package/dist/chunk-GAR5TQ5B.js +199 -0
- package/dist/chunk-GKIFONTE.js +131 -0
- package/dist/chunk-GYTPOFVC.js +47155 -0
- package/dist/chunk-KVQS4GXU.js +328 -0
- package/dist/chunk-L2DEKY4J.js +97 -0
- package/dist/chunk-L677XGY3.js +701 -0
- package/dist/chunk-MBQAMMSE.js +11877 -0
- package/dist/chunk-P4LNHAFI.js +1051 -0
- package/dist/chunk-P4ZFUQFF.js +93 -0
- package/dist/chunk-PC7K4SK7.js +1384 -0
- package/dist/chunk-R5O5AUPI.js +573 -0
- package/dist/chunk-SGM3FASH.js +672 -0
- package/dist/chunk-SJGJJKBY.js +502 -0
- package/dist/chunk-TESBIVUA.js +11 -0
- package/dist/chunk-TZZBINQY.js +82 -0
- package/dist/chunk-U6QRZASX.js +280 -0
- package/dist/chunk-VFF5OO47.js +319 -0
- package/dist/chunk-YDNJLLG6.js +516 -0
- package/dist/chunk-YHMRX6YA.js +455 -0
- package/dist/chunk-ZO6MXAS3.js +69 -0
- package/dist/components/index.css +1756 -0
- package/dist/components/index.d.ts +11093 -0
- package/dist/components/index.js +1110 -0
- package/dist/context/index.d.ts +9 -0
- package/dist/context/index.js +7 -0
- package/dist/core.d.ts +2523 -0
- package/dist/core.js +2 -0
- package/dist/design-classes/index.cjs +429 -0
- package/dist/design-classes/index.d.cts +165 -0
- package/dist/design-classes/index.d.ts +165 -0
- package/dist/design-classes/index.js +397 -0
- package/dist/emojiItems-QGSNAABW.js +20 -0
- package/dist/fx-CmQjnHmT.d.ts +371 -0
- package/dist/hooks/index.d.ts +936 -0
- package/dist/hooks/index.js +7 -0
- package/dist/index.d.ts +486 -0
- package/dist/index.js +38 -0
- package/dist/katexPlugin-FA7NX4PE.css +1161 -0
- package/dist/katexPlugin-NCDKOOQY.js +2 -0
- package/dist/kernel-client-ZH4PSMCN.js +367 -0
- package/dist/kernel-wire-B4S8pnP3.d.ts +65 -0
- package/dist/lib/index.d.ts +602 -0
- package/dist/lib/index.js +1288 -0
- package/dist/paintDispatch-ChW5mVuK.d.ts +698 -0
- package/dist/parseLessonSegments-GpCeMrb2.d.ts +334 -0
- package/dist/perf-CKiBKbkw.d.ts +22 -0
- package/dist/perf-Dr28-AgT.d.ts +57 -0
- package/dist/prism-AIWGN2X5.js +134 -0
- package/dist/providers/index.css +1756 -0
- package/dist/providers/index.d.ts +340 -0
- package/dist/providers/index.js +30 -0
- package/dist/renderer/index.d.ts +467 -0
- package/dist/renderer/index.js +3 -0
- package/dist/runtime/index.css +1756 -0
- package/dist/runtime/index.d.ts +440 -0
- package/dist/runtime/index.js +31 -0
- package/dist/slot-host-CPzrxLo9.d.ts +48 -0
- package/dist/ssr/index.cjs +7631 -0
- package/dist/ssr/index.d.cts +487 -0
- package/dist/ssr/index.d.ts +487 -0
- package/dist/ssr/index.js +7599 -0
- package/dist/storage/browser/index.d.ts +1 -0
- package/dist/storage/browser/index.js +1 -0
- package/dist/test-support.d.ts +35 -0
- package/dist/test-support.js +114 -0
- package/dist/themeTokens-CRd8AEDF.d.ts +125 -0
- package/dist/three/index.css +503 -0
- package/dist/three/index.d.ts +1185 -0
- package/dist/three/index.js +3896 -0
- package/dist/useKeyboardRouter-Dsq553Ur.d.ts +42 -0
- package/dist/useUISlots-CiobNFGb.d.ts +211 -0
- package/dist/verification-C5pTeMJv.d.ts +66 -0
- package/dist/verificationRegistry-CabxhfTv.d.ts +122 -0
- package/dist/wrapCallbackForEvent-B9QLbhxX.d.ts +19 -0
- package/index.css +199 -0
- package/package.json +269 -3
- package/src/core/locales/ar.json +1263 -0
- package/src/core/locales/en.json +1263 -0
- package/src/core/locales/index.ts +54 -0
- package/src/core/locales/sl.json +1263 -0
- package/src/core/tokens/native-tokens.json +369 -0
- package/tailwind-compile.cjs +29 -0
- package/tailwind-preset.cjs +991 -0
- package/themes/_base.css +451 -0
- package/themes/_contract.md +307 -0
- package/themes/_fonts-kenney.css +11 -0
- package/themes/_fonts.css +12 -0
- package/themes/_foundation.css +105 -0
- package/themes/_head.css +22 -0
- package/themes/_presets.css +67 -0
- package/themes/almadar-heritage.css +455 -0
- package/themes/almadar-website.css +269 -0
- package/themes/almadar.css +269 -0
- package/themes/aqua.css +455 -0
- package/themes/arabesque.css +459 -0
- package/themes/art-deco.css +457 -0
- package/themes/art-nouveau.css +459 -0
- package/themes/atelier.css +463 -0
- package/themes/bauhaus.css +461 -0
- package/themes/bloomberg-dense.css +463 -0
- package/themes/blueprint.css +457 -0
- package/themes/clay.css +449 -0
- package/themes/comic.css +453 -0
- package/themes/constructivist.css +457 -0
- package/themes/corporate.css +449 -0
- package/themes/cyberpunk.css +453 -0
- package/themes/frutiger-aero.css +458 -0
- package/themes/game-adventure.css +201 -0
- package/themes/game-rpg.css +203 -0
- package/themes/game-sci-fi.css +201 -0
- package/themes/game-ui-pack.css +200 -0
- package/themes/gazette.css +449 -0
- package/themes/glass.css +457 -0
- package/themes/gothic.css +453 -0
- package/themes/index.css +21 -0
- package/themes/ink-wash.css +459 -0
- package/themes/kawaii.css +459 -0
- package/themes/kflow.css +310 -0
- package/themes/kiosk.css +449 -0
- package/themes/linear-clean.css +463 -0
- package/themes/luxury.css +451 -0
- package/themes/mac-classic.css +455 -0
- package/themes/material.css +463 -0
- package/themes/memphis.css +453 -0
- package/themes/mid-century.css +455 -0
- package/themes/minimalist.css +449 -0
- package/themes/mudcloth.css +459 -0
- package/themes/nata.css +310 -0
- package/themes/neon.css +453 -0
- package/themes/neumorphic.css +451 -0
- package/themes/newsprint.css +455 -0
- package/themes/notion-editorial.css +463 -0
- package/themes/orb.css +465 -0
- package/themes/pixel.css +449 -0
- package/themes/prism.css +309 -0
- package/themes/rawi.css +310 -0
- package/themes/retro.css +452 -0
- package/themes/risograph.css +463 -0
- package/themes/scandi.css +469 -0
- package/themes/sketch.css +455 -0
- package/themes/solarpunk.css +469 -0
- package/themes/steampunk.css +451 -0
- package/themes/swiss.css +455 -0
- package/themes/terminal.css +466 -0
- package/themes/trait-wars.css +487 -0
- package/themes/ukiyo-e.css +459 -0
- package/themes/vaporwave.css +455 -0
- package/themes/victorian.css +453 -0
- package/themes/wabi-sabi.css +459 -0
- package/themes/win95.css +455 -0
- package/themes/wireframe.css +439 -0
- package/themes/zine.css +455 -0
- package/README.md +0 -3
|
@@ -0,0 +1,1327 @@
|
|
|
1
|
+
import { useAvl3DPalette } from './chunk-EOWMARUB.js';
|
|
2
|
+
import { avlBlend, AVL_INK, EFFECT_CATEGORY_COLORS, OPERATOR_CATEGORY_COLORS, avlTint, effectCategoryOf } from './chunk-DFNZUYX4.js';
|
|
3
|
+
import { Typography, Box, VStack, useTranslate } from './chunk-MBQAMMSE.js';
|
|
4
|
+
import { Vector3, QuadraticBezierCurve3, MathUtils, Quaternion } from 'three';
|
|
5
|
+
import { EntityPersistenceSchema } from '@almadar/core';
|
|
6
|
+
import { getStdOperatorMeta } from '@almadar/std/registry';
|
|
7
|
+
import { Html, RoundedBox } from '@react-three/drei';
|
|
8
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
|
+
import { useRef, useState, useMemo } from 'react';
|
|
10
|
+
import { useFrame } from '@react-three/fiber';
|
|
11
|
+
|
|
12
|
+
function operatorPaletteKey(category) {
|
|
13
|
+
return `op:${category}`;
|
|
14
|
+
}
|
|
15
|
+
function operatorCategoryPalette() {
|
|
16
|
+
const out = {};
|
|
17
|
+
for (const [category, color] of Object.entries(OPERATOR_CATEGORY_COLORS)) out[operatorPaletteKey(category)] = color;
|
|
18
|
+
return out;
|
|
19
|
+
}
|
|
20
|
+
var AVL_3D_COLORS = {
|
|
21
|
+
orbitalSphere: "var(--color-card)",
|
|
22
|
+
orbitalRim: "var(--color-info)",
|
|
23
|
+
entityCore: "var(--color-warning)",
|
|
24
|
+
entityCoreGlow: avlBlend("var(--color-warning)", 70, "var(--color-background)"),
|
|
25
|
+
traitOrbit: "var(--color-info)",
|
|
26
|
+
traitOrbitHighlight: "var(--color-primary)",
|
|
27
|
+
stateIdle: "var(--color-muted)",
|
|
28
|
+
stateEdge: "var(--color-info)",
|
|
29
|
+
stateActive: "var(--color-primary)",
|
|
30
|
+
transitionArc: "var(--color-muted-foreground)",
|
|
31
|
+
transitionArcHover: "var(--color-primary)",
|
|
32
|
+
guardPass: "var(--color-success)",
|
|
33
|
+
guardFail: "var(--color-error)",
|
|
34
|
+
crossWire: "var(--color-accent)",
|
|
35
|
+
crossWireGlow: avlBlend("var(--color-accent)", 70, "var(--color-background)"),
|
|
36
|
+
pagePortal: "var(--color-success)",
|
|
37
|
+
background: "var(--color-background)",
|
|
38
|
+
backgroundSurface: "var(--color-card)",
|
|
39
|
+
fog: "var(--color-background)",
|
|
40
|
+
sparkle: "var(--color-info)",
|
|
41
|
+
sparkleWarm: "var(--color-warning)",
|
|
42
|
+
// Entity persistence badge (Avl3DEntityCore ring + micro-icons)
|
|
43
|
+
persistencePersistent: "var(--color-info)",
|
|
44
|
+
persistenceRuntime: "var(--color-success)",
|
|
45
|
+
persistenceUnknown: "var(--color-muted-foreground)",
|
|
46
|
+
// Expression tree (Avl3DExprTree): operator categories, bindings, literals
|
|
47
|
+
...operatorCategoryPalette(),
|
|
48
|
+
exprOperatorUnknown: "var(--color-muted-foreground)",
|
|
49
|
+
exprBinding: "var(--color-accent)",
|
|
50
|
+
exprLiteral: "var(--color-muted-foreground)",
|
|
51
|
+
// Effect category (Avl3DTransitionArc micro-icons)
|
|
52
|
+
effectUi: EFFECT_CATEGORY_COLORS.ui.color,
|
|
53
|
+
effectData: EFFECT_CATEGORY_COLORS.data.color,
|
|
54
|
+
effectCommunication: EFFECT_CATEGORY_COLORS.communication.color,
|
|
55
|
+
effectLifecycle: EFFECT_CATEGORY_COLORS.lifecycle.color,
|
|
56
|
+
effectControl: EFFECT_CATEGORY_COLORS.control.color,
|
|
57
|
+
effectAsync: EFFECT_CATEGORY_COLORS.async.color,
|
|
58
|
+
effectCompute: EFFECT_CATEGORY_COLORS.compute.color,
|
|
59
|
+
effectSystem: EFFECT_CATEGORY_COLORS.system.color,
|
|
60
|
+
effectUnknown: "var(--color-muted-foreground)",
|
|
61
|
+
// Misc mesh accents
|
|
62
|
+
fieldParticle: "var(--color-foreground)",
|
|
63
|
+
lightAmbient: "var(--color-info)",
|
|
64
|
+
lightDirectional: avlBlend("var(--color-info)", 50, AVL_INK.onFocus),
|
|
65
|
+
lightFill: avlBlend("var(--color-info)", 70, AVL_INK.canvas)
|
|
66
|
+
};
|
|
67
|
+
var PERSISTENCE_PALETTE_KEY = {
|
|
68
|
+
persistent: "persistencePersistent",
|
|
69
|
+
runtime: "persistenceRuntime"
|
|
70
|
+
};
|
|
71
|
+
function persistencePaletteKey(persistence) {
|
|
72
|
+
const parsed = EntityPersistenceSchema.safeParse(persistence);
|
|
73
|
+
return parsed.success ? PERSISTENCE_PALETTE_KEY[parsed.data] : "persistenceUnknown";
|
|
74
|
+
}
|
|
75
|
+
function exprOperatorPaletteKey(label) {
|
|
76
|
+
const meta = getStdOperatorMeta(label);
|
|
77
|
+
return meta ? operatorPaletteKey(meta.category) : "exprOperatorUnknown";
|
|
78
|
+
}
|
|
79
|
+
var EFFECT_CATEGORY_PALETTE_KEY = {
|
|
80
|
+
ui: "effectUi",
|
|
81
|
+
data: "effectData",
|
|
82
|
+
communication: "effectCommunication",
|
|
83
|
+
lifecycle: "effectLifecycle",
|
|
84
|
+
control: "effectControl",
|
|
85
|
+
async: "effectAsync",
|
|
86
|
+
compute: "effectCompute",
|
|
87
|
+
system: "effectSystem"
|
|
88
|
+
};
|
|
89
|
+
function effectTypePaletteKey(type) {
|
|
90
|
+
const category = effectCategoryOf(type);
|
|
91
|
+
return category ? EFFECT_CATEGORY_PALETTE_KEY[category] : "effectUnknown";
|
|
92
|
+
}
|
|
93
|
+
var GOLDEN_ANGLE = Math.PI * (3 - Math.sqrt(5));
|
|
94
|
+
function goldenSpiralPositions(count, baseRadius) {
|
|
95
|
+
if (count === 0) return [];
|
|
96
|
+
if (count === 1) return [{ x: 0, y: 0, z: 0 }];
|
|
97
|
+
const positions = [];
|
|
98
|
+
for (let i = 0; i < count; i++) {
|
|
99
|
+
const angle = i * GOLDEN_ANGLE;
|
|
100
|
+
const r = baseRadius * Math.sqrt(i / count);
|
|
101
|
+
positions.push({
|
|
102
|
+
x: r * Math.cos(angle),
|
|
103
|
+
y: 0,
|
|
104
|
+
z: r * Math.sin(angle)
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return positions;
|
|
108
|
+
}
|
|
109
|
+
function forceDirectedPositions(count, edges, baseRadius, iterations = 80) {
|
|
110
|
+
if (count === 0) return [];
|
|
111
|
+
if (count === 1) return [{ x: 0, y: 0, z: 0 }];
|
|
112
|
+
const positions = goldenSpiralPositions(count, baseRadius);
|
|
113
|
+
const repulsionStrength = baseRadius * baseRadius * 0.5;
|
|
114
|
+
const attractionStrength = 0.15;
|
|
115
|
+
const damping = 0.85;
|
|
116
|
+
const velocities = positions.map(() => ({ x: 0, y: 0, z: 0 }));
|
|
117
|
+
for (let iter = 0; iter < iterations; iter++) {
|
|
118
|
+
for (let i = 0; i < count; i++) {
|
|
119
|
+
for (let j = i + 1; j < count; j++) {
|
|
120
|
+
const dx = positions[i].x - positions[j].x;
|
|
121
|
+
const dz = positions[i].z - positions[j].z;
|
|
122
|
+
const distSq = dx * dx + dz * dz + 0.01;
|
|
123
|
+
const force = repulsionStrength / distSq;
|
|
124
|
+
const dist = Math.sqrt(distSq);
|
|
125
|
+
const fx = dx / dist * force;
|
|
126
|
+
const fz = dz / dist * force;
|
|
127
|
+
velocities[i].x += fx;
|
|
128
|
+
velocities[i].z += fz;
|
|
129
|
+
velocities[j].x -= fx;
|
|
130
|
+
velocities[j].z -= fz;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
for (const edge of edges) {
|
|
134
|
+
const dx = positions[edge.to].x - positions[edge.from].x;
|
|
135
|
+
const dz = positions[edge.to].z - positions[edge.from].z;
|
|
136
|
+
const dist = Math.sqrt(dx * dx + dz * dz + 0.01);
|
|
137
|
+
const force = dist * attractionStrength;
|
|
138
|
+
const fx = dx / dist * force;
|
|
139
|
+
const fz = dz / dist * force;
|
|
140
|
+
velocities[edge.from].x += fx;
|
|
141
|
+
velocities[edge.from].z += fz;
|
|
142
|
+
velocities[edge.to].x -= fx;
|
|
143
|
+
velocities[edge.to].z -= fz;
|
|
144
|
+
}
|
|
145
|
+
for (let i = 0; i < count; i++) {
|
|
146
|
+
positions[i].x += velocities[i].x * 0.1;
|
|
147
|
+
positions[i].z += velocities[i].z * 0.1;
|
|
148
|
+
velocities[i].x *= damping;
|
|
149
|
+
velocities[i].z *= damping;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
let cx = 0, cz = 0;
|
|
153
|
+
for (const p of positions) {
|
|
154
|
+
cx += p.x;
|
|
155
|
+
cz += p.z;
|
|
156
|
+
}
|
|
157
|
+
cx /= count;
|
|
158
|
+
cz /= count;
|
|
159
|
+
for (const p of positions) {
|
|
160
|
+
p.x -= cx;
|
|
161
|
+
p.z -= cz;
|
|
162
|
+
}
|
|
163
|
+
return positions;
|
|
164
|
+
}
|
|
165
|
+
function fibonacciSpherePositions(count, radius) {
|
|
166
|
+
if (count === 0) return [];
|
|
167
|
+
if (count === 1) return [{ x: 0, y: 0, z: 0 }];
|
|
168
|
+
const positions = [];
|
|
169
|
+
for (let i = 0; i < count; i++) {
|
|
170
|
+
const y = 1 - 2 * i / (count - 1);
|
|
171
|
+
const radiusAtY = Math.sqrt(1 - y * y);
|
|
172
|
+
const theta = GOLDEN_ANGLE * i;
|
|
173
|
+
positions.push({
|
|
174
|
+
x: radius * radiusAtY * Math.cos(theta),
|
|
175
|
+
y: radius * y,
|
|
176
|
+
z: radius * radiusAtY * Math.sin(theta)
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
return positions;
|
|
180
|
+
}
|
|
181
|
+
function orbitRingPositions(count, radius, tilt) {
|
|
182
|
+
if (count === 0) return [];
|
|
183
|
+
const positions = [];
|
|
184
|
+
const step = 2 * Math.PI / count;
|
|
185
|
+
for (let i = 0; i < count; i++) {
|
|
186
|
+
const angle = i * step;
|
|
187
|
+
const x = radius * Math.cos(angle);
|
|
188
|
+
const flatZ = radius * Math.sin(angle);
|
|
189
|
+
const y = flatZ * Math.sin(tilt);
|
|
190
|
+
const z = flatZ * Math.cos(tilt);
|
|
191
|
+
positions.push({ x, y, z });
|
|
192
|
+
}
|
|
193
|
+
return positions;
|
|
194
|
+
}
|
|
195
|
+
function arcCurve3D(from, to, offset) {
|
|
196
|
+
const start = new Vector3(...from);
|
|
197
|
+
const end = new Vector3(...to);
|
|
198
|
+
const mid = new Vector3().addVectors(start, end).multiplyScalar(0.5);
|
|
199
|
+
const dir = new Vector3().subVectors(end, start).normalize();
|
|
200
|
+
const up = new Vector3(0, 1, 0);
|
|
201
|
+
const perp = new Vector3().crossVectors(dir, up).normalize();
|
|
202
|
+
if (perp.length() < 1e-3) {
|
|
203
|
+
perp.crossVectors(dir, new Vector3(1, 0, 0)).normalize();
|
|
204
|
+
}
|
|
205
|
+
const control = mid.clone().add(perp.multiplyScalar(offset));
|
|
206
|
+
control.y += Math.abs(offset) * 0.3;
|
|
207
|
+
return new QuadraticBezierCurve3(start, control, end);
|
|
208
|
+
}
|
|
209
|
+
function selfLoopCurve3D(position, loopRadius) {
|
|
210
|
+
const base = new Vector3(...position);
|
|
211
|
+
const start = base.clone().add(new Vector3(-loopRadius * 0.3, 0, 0));
|
|
212
|
+
const end = base.clone().add(new Vector3(loopRadius * 0.3, 0, 0));
|
|
213
|
+
const control = base.clone().add(new Vector3(0, loopRadius, 0));
|
|
214
|
+
return new QuadraticBezierCurve3(start, control, end);
|
|
215
|
+
}
|
|
216
|
+
function treeLayout3D(node, origin, horizontalSpacing, verticalSpacing = 2) {
|
|
217
|
+
const results = [];
|
|
218
|
+
function layoutNode(n, pos, depth) {
|
|
219
|
+
results.push({ node: n, position: pos });
|
|
220
|
+
if (!n.children || n.children.length === 0) return;
|
|
221
|
+
const childCount = n.children.length;
|
|
222
|
+
const totalWidth = (childCount - 1) * horizontalSpacing / (depth + 1);
|
|
223
|
+
const startX = pos.x - totalWidth / 2;
|
|
224
|
+
for (let i = 0; i < childCount; i++) {
|
|
225
|
+
const childPos = {
|
|
226
|
+
x: startX + i * totalWidth / Math.max(childCount - 1, 1),
|
|
227
|
+
y: pos.y - verticalSpacing,
|
|
228
|
+
z: pos.z
|
|
229
|
+
};
|
|
230
|
+
layoutNode(n.children[i], childPos, depth + 1);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
layoutNode(node, origin, 0);
|
|
234
|
+
return results;
|
|
235
|
+
}
|
|
236
|
+
var CAMERA_POSITIONS = {
|
|
237
|
+
application: { position: [0, 20, 30], target: [0, 0, 0] },
|
|
238
|
+
orbital: { position: [0, 8, 12], target: [0, 0, 0] },
|
|
239
|
+
trait: { position: [0, 6, 10], target: [0, 0, 0] },
|
|
240
|
+
transition: { position: [0, 4, 8], target: [0, 0, 0] }
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
// src/lib/avl-zoom-state.ts
|
|
244
|
+
var initialZoomState = {
|
|
245
|
+
level: "application",
|
|
246
|
+
selectedOrbital: null,
|
|
247
|
+
selectedTrait: null,
|
|
248
|
+
selectedTransition: null,
|
|
249
|
+
animating: false,
|
|
250
|
+
animationDirection: "in",
|
|
251
|
+
animationTarget: null
|
|
252
|
+
};
|
|
253
|
+
function zoomReducer(state, action) {
|
|
254
|
+
switch (action.type) {
|
|
255
|
+
case "ZOOM_INTO_ORBITAL": {
|
|
256
|
+
if (state.level !== "application" || state.animating) return state;
|
|
257
|
+
return {
|
|
258
|
+
...state,
|
|
259
|
+
animating: true,
|
|
260
|
+
animationDirection: "in",
|
|
261
|
+
animationTarget: { x: action.targetPosition.x, y: action.targetPosition.y, scale: 3 },
|
|
262
|
+
selectedOrbital: action.orbital
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
case "ZOOM_INTO_TRAIT": {
|
|
266
|
+
if (state.level !== "orbital" || state.animating) return state;
|
|
267
|
+
return {
|
|
268
|
+
...state,
|
|
269
|
+
animating: true,
|
|
270
|
+
animationDirection: "in",
|
|
271
|
+
animationTarget: { x: action.targetPosition.x, y: action.targetPosition.y, scale: 3 },
|
|
272
|
+
selectedTrait: action.trait
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
case "ZOOM_INTO_TRANSITION": {
|
|
276
|
+
if (state.level !== "trait" || state.animating) return state;
|
|
277
|
+
return {
|
|
278
|
+
...state,
|
|
279
|
+
animating: true,
|
|
280
|
+
animationDirection: "in",
|
|
281
|
+
animationTarget: { x: action.targetPosition.x, y: action.targetPosition.y, scale: 3 },
|
|
282
|
+
selectedTransition: action.transitionIndex
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
case "JUMP_TO_TRAIT_CIRCUIT": {
|
|
286
|
+
if (state.level !== "application" || state.animating) return state;
|
|
287
|
+
return {
|
|
288
|
+
...state,
|
|
289
|
+
level: "trait",
|
|
290
|
+
selectedOrbital: action.orbital,
|
|
291
|
+
selectedTrait: null,
|
|
292
|
+
selectedTransition: null,
|
|
293
|
+
animating: false,
|
|
294
|
+
animationDirection: "in",
|
|
295
|
+
animationTarget: null
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
case "SELECT_TRAIT": {
|
|
299
|
+
return { ...state, selectedTrait: action.trait };
|
|
300
|
+
}
|
|
301
|
+
case "ZOOM_OUT": {
|
|
302
|
+
if (state.level === "application" || state.animating) return state;
|
|
303
|
+
return {
|
|
304
|
+
...state,
|
|
305
|
+
animating: true,
|
|
306
|
+
animationDirection: "out",
|
|
307
|
+
animationTarget: { x: 300, y: 200, scale: 0.3 }
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
case "ANIMATION_COMPLETE": {
|
|
311
|
+
if (!state.animating) return state;
|
|
312
|
+
if (state.animationDirection === "in") {
|
|
313
|
+
const nextLevel = state.level === "application" ? "orbital" : state.level === "orbital" ? "trait" : "transition";
|
|
314
|
+
return {
|
|
315
|
+
...state,
|
|
316
|
+
level: nextLevel,
|
|
317
|
+
animating: false,
|
|
318
|
+
animationTarget: null
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
if (state.level === "transition") {
|
|
322
|
+
return {
|
|
323
|
+
...state,
|
|
324
|
+
level: "trait",
|
|
325
|
+
selectedTransition: null,
|
|
326
|
+
animating: false,
|
|
327
|
+
animationTarget: null
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
if (state.level === "trait") {
|
|
331
|
+
return {
|
|
332
|
+
...state,
|
|
333
|
+
level: "application",
|
|
334
|
+
selectedOrbital: null,
|
|
335
|
+
selectedTrait: null,
|
|
336
|
+
animating: false,
|
|
337
|
+
animationTarget: null
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
if (state.level === "orbital") {
|
|
341
|
+
return {
|
|
342
|
+
...state,
|
|
343
|
+
level: "application",
|
|
344
|
+
selectedOrbital: null,
|
|
345
|
+
animating: false,
|
|
346
|
+
animationTarget: null
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
return state;
|
|
350
|
+
}
|
|
351
|
+
case "SWITCH_TRAIT": {
|
|
352
|
+
if (state.level !== "trait" || state.animating) return state;
|
|
353
|
+
return {
|
|
354
|
+
...state,
|
|
355
|
+
selectedTrait: action.trait,
|
|
356
|
+
selectedTransition: null
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
case "RESET": {
|
|
360
|
+
return initialZoomState;
|
|
361
|
+
}
|
|
362
|
+
default:
|
|
363
|
+
return state;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
function getBreadcrumbs(state) {
|
|
367
|
+
const crumbs = [{ labelKey: "avl.glyph.application", level: "application" }];
|
|
368
|
+
if (state.selectedOrbital) {
|
|
369
|
+
crumbs.push({ label: state.selectedOrbital, level: "orbital" });
|
|
370
|
+
}
|
|
371
|
+
if (state.selectedTrait) {
|
|
372
|
+
crumbs.push({ label: state.selectedTrait, level: "trait" });
|
|
373
|
+
}
|
|
374
|
+
if (state.selectedTransition !== null) {
|
|
375
|
+
crumbs.push({ labelKey: "avl.breadcrumb.transitionNumber", labelParams: { n: state.selectedTransition }, level: "transition" });
|
|
376
|
+
}
|
|
377
|
+
return crumbs;
|
|
378
|
+
}
|
|
379
|
+
var Avl3DLabel = ({
|
|
380
|
+
position,
|
|
381
|
+
text,
|
|
382
|
+
color = AVL_INK.text,
|
|
383
|
+
fontSize = 12,
|
|
384
|
+
className,
|
|
385
|
+
occlude = false
|
|
386
|
+
}) => {
|
|
387
|
+
return /* @__PURE__ */ jsx(
|
|
388
|
+
Html,
|
|
389
|
+
{
|
|
390
|
+
position,
|
|
391
|
+
center: true,
|
|
392
|
+
distanceFactor: 10,
|
|
393
|
+
occlude: occlude ? "blending" : void 0,
|
|
394
|
+
className,
|
|
395
|
+
style: { pointerEvents: "none" },
|
|
396
|
+
children: /* @__PURE__ */ jsx(
|
|
397
|
+
Typography,
|
|
398
|
+
{
|
|
399
|
+
variant: "small",
|
|
400
|
+
style: {
|
|
401
|
+
color,
|
|
402
|
+
fontSize: `${fontSize}px`,
|
|
403
|
+
whiteSpace: "nowrap",
|
|
404
|
+
textShadow: `0 0 4px ${avlTint(AVL_INK.canvas, 80)}`,
|
|
405
|
+
userSelect: "none"
|
|
406
|
+
},
|
|
407
|
+
children: text
|
|
408
|
+
}
|
|
409
|
+
)
|
|
410
|
+
}
|
|
411
|
+
);
|
|
412
|
+
};
|
|
413
|
+
Avl3DLabel.displayName = "Avl3DLabel";
|
|
414
|
+
var Avl3DTooltip = ({
|
|
415
|
+
position,
|
|
416
|
+
title,
|
|
417
|
+
rows,
|
|
418
|
+
accentColor = AVL_INK.focus
|
|
419
|
+
}) => {
|
|
420
|
+
return /* @__PURE__ */ jsx(
|
|
421
|
+
Html,
|
|
422
|
+
{
|
|
423
|
+
position,
|
|
424
|
+
center: true,
|
|
425
|
+
distanceFactor: 8,
|
|
426
|
+
style: { pointerEvents: "none" },
|
|
427
|
+
zIndexRange: [100, 0],
|
|
428
|
+
children: /* @__PURE__ */ jsx(
|
|
429
|
+
Box,
|
|
430
|
+
{
|
|
431
|
+
style: {
|
|
432
|
+
background: avlTint(AVL_INK.surface, 92),
|
|
433
|
+
backdropFilter: "blur(8px)",
|
|
434
|
+
borderLeft: `3px solid ${accentColor}`,
|
|
435
|
+
borderRadius: "6px",
|
|
436
|
+
padding: "8px 12px",
|
|
437
|
+
minWidth: "140px",
|
|
438
|
+
maxWidth: "220px",
|
|
439
|
+
boxShadow: "var(--shadow-lg)"
|
|
440
|
+
},
|
|
441
|
+
children: /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
442
|
+
/* @__PURE__ */ jsx(
|
|
443
|
+
Typography,
|
|
444
|
+
{
|
|
445
|
+
variant: "small",
|
|
446
|
+
style: {
|
|
447
|
+
color: AVL_INK.text,
|
|
448
|
+
fontWeight: 600,
|
|
449
|
+
fontSize: "12px",
|
|
450
|
+
lineHeight: 1.3
|
|
451
|
+
},
|
|
452
|
+
children: title
|
|
453
|
+
}
|
|
454
|
+
),
|
|
455
|
+
rows.map((row) => /* @__PURE__ */ jsxs(
|
|
456
|
+
Box,
|
|
457
|
+
{
|
|
458
|
+
style: {
|
|
459
|
+
display: "flex",
|
|
460
|
+
justifyContent: "space-between",
|
|
461
|
+
gap: "12px"
|
|
462
|
+
},
|
|
463
|
+
children: [
|
|
464
|
+
/* @__PURE__ */ jsx(
|
|
465
|
+
Typography,
|
|
466
|
+
{
|
|
467
|
+
variant: "small",
|
|
468
|
+
style: {
|
|
469
|
+
color: AVL_INK.quiet,
|
|
470
|
+
fontSize: "10px",
|
|
471
|
+
whiteSpace: "nowrap"
|
|
472
|
+
},
|
|
473
|
+
children: row.label
|
|
474
|
+
}
|
|
475
|
+
),
|
|
476
|
+
/* @__PURE__ */ jsx(
|
|
477
|
+
Typography,
|
|
478
|
+
{
|
|
479
|
+
variant: "small",
|
|
480
|
+
style: {
|
|
481
|
+
color: AVL_INK.text,
|
|
482
|
+
fontSize: "10px",
|
|
483
|
+
fontWeight: 500,
|
|
484
|
+
textAlign: "right"
|
|
485
|
+
},
|
|
486
|
+
children: row.value
|
|
487
|
+
}
|
|
488
|
+
)
|
|
489
|
+
]
|
|
490
|
+
},
|
|
491
|
+
row.label
|
|
492
|
+
))
|
|
493
|
+
] })
|
|
494
|
+
}
|
|
495
|
+
)
|
|
496
|
+
}
|
|
497
|
+
);
|
|
498
|
+
};
|
|
499
|
+
Avl3DTooltip.displayName = "Avl3DTooltip";
|
|
500
|
+
var Avl3DOrbitalNode = ({
|
|
501
|
+
name,
|
|
502
|
+
entityName,
|
|
503
|
+
traitCount,
|
|
504
|
+
pageCount = 0,
|
|
505
|
+
persistence = "persistent",
|
|
506
|
+
position,
|
|
507
|
+
onClick
|
|
508
|
+
}) => {
|
|
509
|
+
const groupRef = useRef(null);
|
|
510
|
+
const [hovered, setHovered] = useState(false);
|
|
511
|
+
const palette = useAvl3DPalette();
|
|
512
|
+
const { t } = useTranslate();
|
|
513
|
+
const scale = useMemo(() => 0.6 + Math.min(traitCount, 8) * 0.3, [traitCount]);
|
|
514
|
+
const currentScale = useRef(scale);
|
|
515
|
+
const targetScale = hovered ? scale * 1.06 : scale;
|
|
516
|
+
useFrame((_, delta) => {
|
|
517
|
+
if (!groupRef.current) return;
|
|
518
|
+
groupRef.current.rotation.y += delta * (hovered ? 0.4 : 0.2);
|
|
519
|
+
groupRef.current.rotation.x += delta * 0.05;
|
|
520
|
+
currentScale.current = MathUtils.damp(currentScale.current, targetScale, 6, delta);
|
|
521
|
+
});
|
|
522
|
+
const baseBrightness = 0.3 + Math.min(pageCount, 5) * 0.05;
|
|
523
|
+
const emissiveIntensity = hovered ? 0.8 : baseBrightness;
|
|
524
|
+
if (!palette) return null;
|
|
525
|
+
return /* @__PURE__ */ jsxs("group", { position, children: [
|
|
526
|
+
/* @__PURE__ */ jsxs("mesh", { scale: scale * 1.3, children: [
|
|
527
|
+
/* @__PURE__ */ jsx("sphereGeometry", { args: [1, 16, 16] }),
|
|
528
|
+
/* @__PURE__ */ jsx(
|
|
529
|
+
"meshStandardMaterial",
|
|
530
|
+
{
|
|
531
|
+
color: palette.orbitalRim,
|
|
532
|
+
emissive: palette.orbitalRim,
|
|
533
|
+
emissiveIntensity: hovered ? 0.2 : 0.06,
|
|
534
|
+
transparent: true,
|
|
535
|
+
opacity: hovered ? 0.08 : 0.03,
|
|
536
|
+
depthWrite: false
|
|
537
|
+
}
|
|
538
|
+
)
|
|
539
|
+
] }),
|
|
540
|
+
/* @__PURE__ */ jsxs("group", { ref: groupRef, children: [
|
|
541
|
+
/* @__PURE__ */ jsxs(
|
|
542
|
+
"mesh",
|
|
543
|
+
{
|
|
544
|
+
onClick: (e) => {
|
|
545
|
+
e.stopPropagation();
|
|
546
|
+
onClick?.();
|
|
547
|
+
},
|
|
548
|
+
onPointerOver: (e) => {
|
|
549
|
+
e.stopPropagation();
|
|
550
|
+
setHovered(true);
|
|
551
|
+
document.body.style.cursor = "pointer";
|
|
552
|
+
},
|
|
553
|
+
onPointerOut: () => {
|
|
554
|
+
setHovered(false);
|
|
555
|
+
document.body.style.cursor = "auto";
|
|
556
|
+
},
|
|
557
|
+
scale: currentScale.current,
|
|
558
|
+
rotation: [Math.PI / 4, 0, 0],
|
|
559
|
+
children: [
|
|
560
|
+
/* @__PURE__ */ jsx("torusGeometry", { args: [1, 0.18, 24, 64] }),
|
|
561
|
+
/* @__PURE__ */ jsx(
|
|
562
|
+
"meshStandardMaterial",
|
|
563
|
+
{
|
|
564
|
+
color: palette.orbitalSphere,
|
|
565
|
+
emissive: palette.orbitalRim,
|
|
566
|
+
emissiveIntensity,
|
|
567
|
+
roughness: 0.2,
|
|
568
|
+
metalness: 0.7
|
|
569
|
+
}
|
|
570
|
+
)
|
|
571
|
+
]
|
|
572
|
+
}
|
|
573
|
+
),
|
|
574
|
+
/* @__PURE__ */ jsxs(
|
|
575
|
+
"mesh",
|
|
576
|
+
{
|
|
577
|
+
scale: scale * 0.9,
|
|
578
|
+
rotation: [Math.PI / 2 + 0.3, Math.PI / 5, 0],
|
|
579
|
+
children: [
|
|
580
|
+
/* @__PURE__ */ jsx("torusGeometry", { args: [1, 0.06, 12, 64] }),
|
|
581
|
+
/* @__PURE__ */ jsx(
|
|
582
|
+
"meshStandardMaterial",
|
|
583
|
+
{
|
|
584
|
+
color: palette.traitOrbit,
|
|
585
|
+
emissive: palette.traitOrbit,
|
|
586
|
+
emissiveIntensity: 0.25,
|
|
587
|
+
transparent: true,
|
|
588
|
+
opacity: 0.4
|
|
589
|
+
}
|
|
590
|
+
)
|
|
591
|
+
]
|
|
592
|
+
}
|
|
593
|
+
)
|
|
594
|
+
] }),
|
|
595
|
+
/* @__PURE__ */ jsxs("mesh", { scale: scale * 0.25, children: [
|
|
596
|
+
/* @__PURE__ */ jsx("icosahedronGeometry", { args: [1, 1] }),
|
|
597
|
+
/* @__PURE__ */ jsx(
|
|
598
|
+
"meshStandardMaterial",
|
|
599
|
+
{
|
|
600
|
+
color: palette.entityCore,
|
|
601
|
+
emissive: palette.entityCoreGlow,
|
|
602
|
+
emissiveIntensity: 2,
|
|
603
|
+
roughness: 0.1
|
|
604
|
+
}
|
|
605
|
+
)
|
|
606
|
+
] }),
|
|
607
|
+
/* @__PURE__ */ jsx(
|
|
608
|
+
"pointLight",
|
|
609
|
+
{
|
|
610
|
+
color: palette.entityCoreGlow,
|
|
611
|
+
intensity: 0.5,
|
|
612
|
+
distance: 3,
|
|
613
|
+
decay: 2
|
|
614
|
+
}
|
|
615
|
+
),
|
|
616
|
+
/* @__PURE__ */ jsx(
|
|
617
|
+
Avl3DLabel,
|
|
618
|
+
{
|
|
619
|
+
position: [0, scale + 0.6, 0],
|
|
620
|
+
text: name,
|
|
621
|
+
color: AVL_INK.text,
|
|
622
|
+
fontSize: hovered ? 14 : 12
|
|
623
|
+
}
|
|
624
|
+
),
|
|
625
|
+
/* @__PURE__ */ jsx(
|
|
626
|
+
Avl3DLabel,
|
|
627
|
+
{
|
|
628
|
+
position: [0, -(scale + 0.4), 0],
|
|
629
|
+
text: entityName,
|
|
630
|
+
color: AVL_INK.quiet,
|
|
631
|
+
fontSize: 10
|
|
632
|
+
}
|
|
633
|
+
),
|
|
634
|
+
hovered && /* @__PURE__ */ jsx(
|
|
635
|
+
Avl3DTooltip,
|
|
636
|
+
{
|
|
637
|
+
position: [scale + 1.2, 0.3, 0],
|
|
638
|
+
title: name,
|
|
639
|
+
accentColor: AVL_3D_COLORS.orbitalRim,
|
|
640
|
+
rows: [
|
|
641
|
+
{ label: t("avl.entity"), value: entityName },
|
|
642
|
+
{ label: t("avl.glyph.persistence"), value: persistence },
|
|
643
|
+
{ label: t("avl.traits"), value: String(traitCount) },
|
|
644
|
+
{ label: t("avl3d.pages"), value: String(pageCount) }
|
|
645
|
+
]
|
|
646
|
+
}
|
|
647
|
+
)
|
|
648
|
+
] });
|
|
649
|
+
};
|
|
650
|
+
Avl3DOrbitalNode.displayName = "Avl3DOrbitalNode";
|
|
651
|
+
var Avl3DCrossWire = ({
|
|
652
|
+
from,
|
|
653
|
+
to,
|
|
654
|
+
eventName,
|
|
655
|
+
color
|
|
656
|
+
}) => {
|
|
657
|
+
const palette = useAvl3DPalette();
|
|
658
|
+
const { tubeArgs, midpoint } = useMemo(() => {
|
|
659
|
+
const curve = arcCurve3D(from, to, 2);
|
|
660
|
+
const mid = curve.getPoint(0.5);
|
|
661
|
+
return {
|
|
662
|
+
tubeArgs: [curve, 32, 0.03, 8, false],
|
|
663
|
+
midpoint: [mid.x, mid.y, mid.z]
|
|
664
|
+
};
|
|
665
|
+
}, [from, to]);
|
|
666
|
+
if (!palette) return null;
|
|
667
|
+
const wireColor = color ?? palette.crossWire;
|
|
668
|
+
return /* @__PURE__ */ jsxs("group", { children: [
|
|
669
|
+
/* @__PURE__ */ jsxs("mesh", { children: [
|
|
670
|
+
/* @__PURE__ */ jsx("tubeGeometry", { args: [tubeArgs[0], tubeArgs[1], tubeArgs[2], tubeArgs[3], tubeArgs[4]] }),
|
|
671
|
+
/* @__PURE__ */ jsx(
|
|
672
|
+
"meshStandardMaterial",
|
|
673
|
+
{
|
|
674
|
+
color: wireColor,
|
|
675
|
+
emissive: wireColor,
|
|
676
|
+
emissiveIntensity: 0.4,
|
|
677
|
+
transparent: true,
|
|
678
|
+
opacity: 0.6,
|
|
679
|
+
roughness: 0.5
|
|
680
|
+
}
|
|
681
|
+
)
|
|
682
|
+
] }),
|
|
683
|
+
/* @__PURE__ */ jsx(
|
|
684
|
+
Avl3DLabel,
|
|
685
|
+
{
|
|
686
|
+
position: midpoint,
|
|
687
|
+
text: eventName,
|
|
688
|
+
color: wireColor,
|
|
689
|
+
fontSize: 9
|
|
690
|
+
}
|
|
691
|
+
)
|
|
692
|
+
] });
|
|
693
|
+
};
|
|
694
|
+
Avl3DCrossWire.displayName = "Avl3DCrossWire";
|
|
695
|
+
function fieldPositions(count, radius) {
|
|
696
|
+
const positions = [];
|
|
697
|
+
const goldenAngle = Math.PI * (3 - Math.sqrt(5));
|
|
698
|
+
for (let i = 0; i < Math.min(count, 12); i++) {
|
|
699
|
+
const y = 1 - 2 * i / Math.max(count - 1, 1);
|
|
700
|
+
const r = Math.sqrt(1 - y * y);
|
|
701
|
+
const theta = goldenAngle * i;
|
|
702
|
+
positions.push([
|
|
703
|
+
radius * r * Math.cos(theta),
|
|
704
|
+
radius * y,
|
|
705
|
+
radius * r * Math.sin(theta)
|
|
706
|
+
]);
|
|
707
|
+
}
|
|
708
|
+
return positions;
|
|
709
|
+
}
|
|
710
|
+
var Avl3DEntityCore = ({
|
|
711
|
+
name,
|
|
712
|
+
fieldCount,
|
|
713
|
+
persistence,
|
|
714
|
+
position,
|
|
715
|
+
fields
|
|
716
|
+
}) => {
|
|
717
|
+
const coreRef = useRef(null);
|
|
718
|
+
const palette = useAvl3DPalette();
|
|
719
|
+
const { t } = useTranslate();
|
|
720
|
+
useFrame((_, delta) => {
|
|
721
|
+
if (!coreRef.current) return;
|
|
722
|
+
coreRef.current.rotation.y += delta * 0.3;
|
|
723
|
+
coreRef.current.rotation.x += delta * 0.1;
|
|
724
|
+
});
|
|
725
|
+
if (!palette) return null;
|
|
726
|
+
const fieldPos = fieldPositions(fieldCount, 1.4);
|
|
727
|
+
const pColor = palette[persistencePaletteKey(persistence)];
|
|
728
|
+
return /* @__PURE__ */ jsxs("group", { position, children: [
|
|
729
|
+
/* @__PURE__ */ jsxs("mesh", { ref: coreRef, children: [
|
|
730
|
+
/* @__PURE__ */ jsx("icosahedronGeometry", { args: [1, 2] }),
|
|
731
|
+
/* @__PURE__ */ jsx(
|
|
732
|
+
"meshStandardMaterial",
|
|
733
|
+
{
|
|
734
|
+
color: palette.entityCore,
|
|
735
|
+
emissive: palette.entityCoreGlow,
|
|
736
|
+
emissiveIntensity: 2,
|
|
737
|
+
roughness: 0.15,
|
|
738
|
+
metalness: 0.85
|
|
739
|
+
}
|
|
740
|
+
)
|
|
741
|
+
] }),
|
|
742
|
+
/* @__PURE__ */ jsxs("mesh", { scale: 1.2, children: [
|
|
743
|
+
/* @__PURE__ */ jsx("sphereGeometry", { args: [1, 24, 24] }),
|
|
744
|
+
/* @__PURE__ */ jsx(
|
|
745
|
+
"meshStandardMaterial",
|
|
746
|
+
{
|
|
747
|
+
color: palette.entityCoreGlow,
|
|
748
|
+
emissive: palette.entityCoreGlow,
|
|
749
|
+
emissiveIntensity: 0.6,
|
|
750
|
+
transparent: true,
|
|
751
|
+
opacity: 0.1,
|
|
752
|
+
depthWrite: false
|
|
753
|
+
}
|
|
754
|
+
)
|
|
755
|
+
] }),
|
|
756
|
+
/* @__PURE__ */ jsxs("mesh", { scale: 1.6, children: [
|
|
757
|
+
/* @__PURE__ */ jsx("sphereGeometry", { args: [1, 16, 16] }),
|
|
758
|
+
/* @__PURE__ */ jsx(
|
|
759
|
+
"meshStandardMaterial",
|
|
760
|
+
{
|
|
761
|
+
color: palette.entityCore,
|
|
762
|
+
emissive: palette.entityCore,
|
|
763
|
+
emissiveIntensity: 0.2,
|
|
764
|
+
transparent: true,
|
|
765
|
+
opacity: 0.04,
|
|
766
|
+
depthWrite: false
|
|
767
|
+
}
|
|
768
|
+
)
|
|
769
|
+
] }),
|
|
770
|
+
/* @__PURE__ */ jsx(
|
|
771
|
+
"pointLight",
|
|
772
|
+
{
|
|
773
|
+
color: palette.entityCoreGlow,
|
|
774
|
+
intensity: 2.5,
|
|
775
|
+
distance: 10,
|
|
776
|
+
decay: 2
|
|
777
|
+
}
|
|
778
|
+
),
|
|
779
|
+
fieldPos.map((pos, i) => {
|
|
780
|
+
const fieldType = fields?.[i];
|
|
781
|
+
return /* @__PURE__ */ jsxs("mesh", { position: pos, scale: 0.08, rotation: [Math.PI / 6, Math.PI / 4, 0], children: [
|
|
782
|
+
fieldType === "number" ? /* @__PURE__ */ jsx("tetrahedronGeometry", { args: [1, 0] }) : fieldType === "boolean" ? /* @__PURE__ */ jsx("boxGeometry", { args: [1.2, 1.2, 1.2] }) : fieldType === "date" ? /* @__PURE__ */ jsx("octahedronGeometry", { args: [1, 0] }) : fieldType === "enum" ? /* @__PURE__ */ jsx("torusGeometry", { args: [0.8, 0.3, 6, 12] }) : fieldType === "object" ? /* @__PURE__ */ jsx("dodecahedronGeometry", { args: [1, 0] }) : fieldType === "array" ? /* @__PURE__ */ jsx("cylinderGeometry", { args: [0.8, 0.8, 1.5, 6] }) : (
|
|
783
|
+
// string (default): sphere
|
|
784
|
+
/* @__PURE__ */ jsx("sphereGeometry", { args: [1, 8, 8] })
|
|
785
|
+
),
|
|
786
|
+
/* @__PURE__ */ jsx(
|
|
787
|
+
"meshStandardMaterial",
|
|
788
|
+
{
|
|
789
|
+
color: palette.fieldParticle,
|
|
790
|
+
emissive: palette.fieldParticle,
|
|
791
|
+
emissiveIntensity: 0.8,
|
|
792
|
+
transparent: true,
|
|
793
|
+
opacity: 0.7
|
|
794
|
+
}
|
|
795
|
+
)
|
|
796
|
+
] }, i);
|
|
797
|
+
}),
|
|
798
|
+
persistence === "singleton" ? (
|
|
799
|
+
// Singleton: double concentric rings (thick outer + thin inner)
|
|
800
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
801
|
+
/* @__PURE__ */ jsxs("mesh", { rotation: [Math.PI / 2, 0, 0], children: [
|
|
802
|
+
/* @__PURE__ */ jsx("torusGeometry", { args: [1.6, 0.04, 8, 64] }),
|
|
803
|
+
/* @__PURE__ */ jsx("meshStandardMaterial", { color: pColor, emissive: pColor, emissiveIntensity: 0.6, transparent: true, opacity: 0.6 })
|
|
804
|
+
] }),
|
|
805
|
+
/* @__PURE__ */ jsxs("mesh", { rotation: [Math.PI / 2, 0, 0], children: [
|
|
806
|
+
/* @__PURE__ */ jsx("torusGeometry", { args: [1.4, 0.02, 8, 64] }),
|
|
807
|
+
/* @__PURE__ */ jsx("meshStandardMaterial", { color: pColor, emissive: pColor, emissiveIntensity: 0.4, transparent: true, opacity: 0.4 })
|
|
808
|
+
] })
|
|
809
|
+
] })
|
|
810
|
+
) : persistence === "runtime" ? (
|
|
811
|
+
// Runtime: segmented ring (8 arc segments with gaps)
|
|
812
|
+
/* @__PURE__ */ jsx(Fragment, { children: Array.from({ length: 8 }).map((_, i) => {
|
|
813
|
+
const angle = i / 8 * Math.PI * 2;
|
|
814
|
+
const x = 1.6 * Math.cos(angle);
|
|
815
|
+
const z = 1.6 * Math.sin(angle);
|
|
816
|
+
return /* @__PURE__ */ jsxs("mesh", { position: [x, 0, z], rotation: [Math.PI / 2, 0, angle], children: [
|
|
817
|
+
/* @__PURE__ */ jsx("torusGeometry", { args: [0.25, 0.025, 6, 12, Math.PI * 0.7] }),
|
|
818
|
+
/* @__PURE__ */ jsx("meshStandardMaterial", { color: pColor, emissive: pColor, emissiveIntensity: 0.6, transparent: true, opacity: 0.6 })
|
|
819
|
+
] }, i);
|
|
820
|
+
}) })
|
|
821
|
+
) : persistence === "instance" ? (
|
|
822
|
+
// Instance: dotted ring (small spheres in a circle)
|
|
823
|
+
/* @__PURE__ */ jsx(Fragment, { children: Array.from({ length: 16 }).map((_, i) => {
|
|
824
|
+
const angle = i / 16 * Math.PI * 2;
|
|
825
|
+
const x = 1.6 * Math.cos(angle);
|
|
826
|
+
const z = 1.6 * Math.sin(angle);
|
|
827
|
+
return /* @__PURE__ */ jsxs("mesh", { position: [x, 0, z], scale: 0.04, children: [
|
|
828
|
+
/* @__PURE__ */ jsx("sphereGeometry", { args: [1, 6, 6] }),
|
|
829
|
+
/* @__PURE__ */ jsx("meshStandardMaterial", { color: pColor, emissive: pColor, emissiveIntensity: 0.8 })
|
|
830
|
+
] }, i);
|
|
831
|
+
}) })
|
|
832
|
+
) : (
|
|
833
|
+
// Persistent (default): solid torus ring
|
|
834
|
+
/* @__PURE__ */ jsxs("mesh", { rotation: [Math.PI / 2, 0, 0], children: [
|
|
835
|
+
/* @__PURE__ */ jsx("torusGeometry", { args: [1.6, 0.03, 8, 64] }),
|
|
836
|
+
/* @__PURE__ */ jsx("meshStandardMaterial", { color: pColor, emissive: pColor, emissiveIntensity: 0.6, transparent: true, opacity: 0.6 })
|
|
837
|
+
] })
|
|
838
|
+
),
|
|
839
|
+
/* @__PURE__ */ jsx(
|
|
840
|
+
Avl3DLabel,
|
|
841
|
+
{
|
|
842
|
+
position: [0, -1.8, 0],
|
|
843
|
+
text: name,
|
|
844
|
+
color: AVL_3D_COLORS.entityCore,
|
|
845
|
+
fontSize: 14
|
|
846
|
+
}
|
|
847
|
+
),
|
|
848
|
+
/* @__PURE__ */ jsx(
|
|
849
|
+
Avl3DLabel,
|
|
850
|
+
{
|
|
851
|
+
position: [0, -2.3, 0],
|
|
852
|
+
text: t(fieldCount === 1 ? "avl3d.fieldCountOne" : "avl3d.fieldCountOther", { count: fieldCount }),
|
|
853
|
+
color: AVL_INK.quiet,
|
|
854
|
+
fontSize: 10
|
|
855
|
+
}
|
|
856
|
+
)
|
|
857
|
+
] });
|
|
858
|
+
};
|
|
859
|
+
Avl3DEntityCore.displayName = "Avl3DEntityCore";
|
|
860
|
+
var Avl3DStateNode = ({
|
|
861
|
+
name,
|
|
862
|
+
isInitial = false,
|
|
863
|
+
isTerminal = false,
|
|
864
|
+
position,
|
|
865
|
+
active = false,
|
|
866
|
+
incomingCount = 0,
|
|
867
|
+
outgoingCount = 0,
|
|
868
|
+
onClick
|
|
869
|
+
}) => {
|
|
870
|
+
const [hovered, setHovered] = useState(false);
|
|
871
|
+
const palette = useAvl3DPalette();
|
|
872
|
+
const { t } = useTranslate();
|
|
873
|
+
const targetScale = hovered ? 1.08 : 1;
|
|
874
|
+
const currentScale = useRef(1);
|
|
875
|
+
useFrame((_, delta) => {
|
|
876
|
+
currentScale.current = MathUtils.damp(currentScale.current, targetScale, 6, delta);
|
|
877
|
+
});
|
|
878
|
+
const scale = currentScale.current;
|
|
879
|
+
if (!palette) return null;
|
|
880
|
+
const baseColor = active ? palette.stateActive : palette.stateIdle;
|
|
881
|
+
const emissiveColor = active ? palette.stateActive : palette.stateEdge;
|
|
882
|
+
const emissiveIntensity = active ? 2 : hovered ? 0.8 : 0.3;
|
|
883
|
+
return /* @__PURE__ */ jsxs("group", { position, children: [
|
|
884
|
+
/* @__PURE__ */ jsxs("mesh", { scale: scale * 1.4, children: [
|
|
885
|
+
/* @__PURE__ */ jsx("boxGeometry", { args: [1.2, 0.7, 0.5] }),
|
|
886
|
+
/* @__PURE__ */ jsx(
|
|
887
|
+
"meshStandardMaterial",
|
|
888
|
+
{
|
|
889
|
+
color: emissiveColor,
|
|
890
|
+
emissive: emissiveColor,
|
|
891
|
+
emissiveIntensity: active ? 0.3 : hovered ? 0.1 : 0.03,
|
|
892
|
+
transparent: true,
|
|
893
|
+
opacity: active ? 0.08 : 0.03,
|
|
894
|
+
depthWrite: false
|
|
895
|
+
}
|
|
896
|
+
)
|
|
897
|
+
] }),
|
|
898
|
+
/* @__PURE__ */ jsx(
|
|
899
|
+
RoundedBox,
|
|
900
|
+
{
|
|
901
|
+
args: [1, 0.55, 0.35],
|
|
902
|
+
radius: 0.12,
|
|
903
|
+
smoothness: 4,
|
|
904
|
+
scale,
|
|
905
|
+
onClick: (e) => {
|
|
906
|
+
e.stopPropagation();
|
|
907
|
+
onClick?.();
|
|
908
|
+
},
|
|
909
|
+
onPointerOver: (e) => {
|
|
910
|
+
e.stopPropagation();
|
|
911
|
+
setHovered(true);
|
|
912
|
+
document.body.style.cursor = "pointer";
|
|
913
|
+
},
|
|
914
|
+
onPointerOut: () => {
|
|
915
|
+
setHovered(false);
|
|
916
|
+
document.body.style.cursor = "auto";
|
|
917
|
+
},
|
|
918
|
+
children: /* @__PURE__ */ jsx(
|
|
919
|
+
"meshStandardMaterial",
|
|
920
|
+
{
|
|
921
|
+
color: baseColor,
|
|
922
|
+
emissive: emissiveColor,
|
|
923
|
+
emissiveIntensity,
|
|
924
|
+
roughness: 0.35,
|
|
925
|
+
metalness: 0.5
|
|
926
|
+
}
|
|
927
|
+
)
|
|
928
|
+
}
|
|
929
|
+
),
|
|
930
|
+
isInitial && /* @__PURE__ */ jsxs("group", { position: [-0.75, 0, 0], children: [
|
|
931
|
+
/* @__PURE__ */ jsxs("mesh", { rotation: [0, 0, -Math.PI / 2], children: [
|
|
932
|
+
/* @__PURE__ */ jsx("coneGeometry", { args: [0.12, 0.25, 8] }),
|
|
933
|
+
/* @__PURE__ */ jsx(
|
|
934
|
+
"meshStandardMaterial",
|
|
935
|
+
{
|
|
936
|
+
color: palette.stateActive,
|
|
937
|
+
emissive: palette.stateActive,
|
|
938
|
+
emissiveIntensity: 1
|
|
939
|
+
}
|
|
940
|
+
)
|
|
941
|
+
] }),
|
|
942
|
+
/* @__PURE__ */ jsxs("mesh", { position: [-0.2, 0, 0], rotation: [0, 0, Math.PI / 2], children: [
|
|
943
|
+
/* @__PURE__ */ jsx("cylinderGeometry", { args: [0.02, 0.02, 0.25, 6] }),
|
|
944
|
+
/* @__PURE__ */ jsx(
|
|
945
|
+
"meshStandardMaterial",
|
|
946
|
+
{
|
|
947
|
+
color: palette.stateActive,
|
|
948
|
+
emissive: palette.stateActive,
|
|
949
|
+
emissiveIntensity: 0.6
|
|
950
|
+
}
|
|
951
|
+
)
|
|
952
|
+
] })
|
|
953
|
+
] }),
|
|
954
|
+
isTerminal && /* @__PURE__ */ jsxs("group", { position: [0.75, 0, 0], children: [
|
|
955
|
+
/* @__PURE__ */ jsxs("mesh", { scale: 0.15, children: [
|
|
956
|
+
/* @__PURE__ */ jsx("octahedronGeometry", { args: [1, 0] }),
|
|
957
|
+
/* @__PURE__ */ jsx(
|
|
958
|
+
"meshStandardMaterial",
|
|
959
|
+
{
|
|
960
|
+
color: palette.guardFail,
|
|
961
|
+
emissive: palette.guardFail,
|
|
962
|
+
emissiveIntensity: 1
|
|
963
|
+
}
|
|
964
|
+
)
|
|
965
|
+
] }),
|
|
966
|
+
/* @__PURE__ */ jsxs("mesh", { rotation: [Math.PI / 2, 0, 0], children: [
|
|
967
|
+
/* @__PURE__ */ jsx("torusGeometry", { args: [0.2, 0.015, 8, 24] }),
|
|
968
|
+
/* @__PURE__ */ jsx(
|
|
969
|
+
"meshStandardMaterial",
|
|
970
|
+
{
|
|
971
|
+
color: palette.guardFail,
|
|
972
|
+
emissive: palette.guardFail,
|
|
973
|
+
emissiveIntensity: 0.5
|
|
974
|
+
}
|
|
975
|
+
)
|
|
976
|
+
] })
|
|
977
|
+
] }),
|
|
978
|
+
active && /* @__PURE__ */ jsx(
|
|
979
|
+
"pointLight",
|
|
980
|
+
{
|
|
981
|
+
color: palette.stateActive,
|
|
982
|
+
intensity: 1.5,
|
|
983
|
+
distance: 4,
|
|
984
|
+
decay: 2
|
|
985
|
+
}
|
|
986
|
+
),
|
|
987
|
+
/* @__PURE__ */ jsx(
|
|
988
|
+
Avl3DLabel,
|
|
989
|
+
{
|
|
990
|
+
position: [0, -0.55, 0],
|
|
991
|
+
text: name,
|
|
992
|
+
color: active ? palette.stateActive : AVL_INK.text,
|
|
993
|
+
fontSize: 11
|
|
994
|
+
}
|
|
995
|
+
),
|
|
996
|
+
hovered && /* @__PURE__ */ jsx(
|
|
997
|
+
Avl3DTooltip,
|
|
998
|
+
{
|
|
999
|
+
position: [0.9, 0.3, 0],
|
|
1000
|
+
title: name,
|
|
1001
|
+
accentColor: active ? AVL_3D_COLORS.stateActive : AVL_3D_COLORS.stateEdge,
|
|
1002
|
+
rows: [
|
|
1003
|
+
{ label: t("avl3d.type"), value: isInitial ? t("avl3d.typeInitial") : isTerminal ? t("avl3d.typeTerminal") : t("avl3d.typeStandard") },
|
|
1004
|
+
{ label: t("avl3d.incoming"), value: String(incomingCount) },
|
|
1005
|
+
{ label: t("avl3d.outgoing"), value: String(outgoingCount) },
|
|
1006
|
+
...active ? [{ label: t("avl3d.status"), value: t("status.active") }] : []
|
|
1007
|
+
]
|
|
1008
|
+
}
|
|
1009
|
+
)
|
|
1010
|
+
] });
|
|
1011
|
+
};
|
|
1012
|
+
Avl3DStateNode.displayName = "Avl3DStateNode";
|
|
1013
|
+
var Avl3DTransitionArc = ({
|
|
1014
|
+
from,
|
|
1015
|
+
to,
|
|
1016
|
+
event,
|
|
1017
|
+
hasGuard = false,
|
|
1018
|
+
effectTypes,
|
|
1019
|
+
index,
|
|
1020
|
+
isSelf = false,
|
|
1021
|
+
fromState,
|
|
1022
|
+
toState,
|
|
1023
|
+
onClick,
|
|
1024
|
+
color
|
|
1025
|
+
}) => {
|
|
1026
|
+
const [hovered, setHovered] = useState(false);
|
|
1027
|
+
const palette = useAvl3DPalette();
|
|
1028
|
+
const { t } = useTranslate();
|
|
1029
|
+
const { tubeArgs, labelPos, guardPos, arrowPos, arrowQuat, effectPositions } = useMemo(() => {
|
|
1030
|
+
const offset = 1.5 + index * 0.8;
|
|
1031
|
+
const curve = isSelf ? selfLoopCurve3D(from, 1.2) : arcCurve3D(from, to, offset);
|
|
1032
|
+
const mid = curve.getPoint(0.5);
|
|
1033
|
+
const guardPt = curve.getPoint(0.3);
|
|
1034
|
+
const arrowPt = curve.getPoint(0.9);
|
|
1035
|
+
const arrowTangent = curve.getTangent(0.9);
|
|
1036
|
+
const upVec = new Vector3(0, 1, 0);
|
|
1037
|
+
const tangentVec = new Vector3(arrowTangent.x, arrowTangent.y, arrowTangent.z).normalize();
|
|
1038
|
+
const quat = new Quaternion().setFromUnitVectors(upVec, tangentVec);
|
|
1039
|
+
const effectPositions2 = [];
|
|
1040
|
+
for (let ei = 0; ei < 4; ei++) {
|
|
1041
|
+
const t2 = 0.7 + ei * 0.05;
|
|
1042
|
+
const ep = curve.getPoint(t2);
|
|
1043
|
+
effectPositions2.push([ep.x, ep.y + 0.2, ep.z]);
|
|
1044
|
+
}
|
|
1045
|
+
return {
|
|
1046
|
+
tubeArgs: [curve, 48, 0.02, 8, false],
|
|
1047
|
+
labelPos: [mid.x, mid.y + 0.3, mid.z],
|
|
1048
|
+
guardPos: [guardPt.x, guardPt.y, guardPt.z],
|
|
1049
|
+
arrowPos: [arrowPt.x, arrowPt.y, arrowPt.z],
|
|
1050
|
+
arrowQuat: [quat.x, quat.y, quat.z, quat.w],
|
|
1051
|
+
effectPositions: effectPositions2
|
|
1052
|
+
};
|
|
1053
|
+
}, [from, to, index, isSelf]);
|
|
1054
|
+
const emissiveIntensity = hovered ? 0.8 : 0.4;
|
|
1055
|
+
if (!palette) return null;
|
|
1056
|
+
const arcColor = color ?? palette.transitionArc;
|
|
1057
|
+
return /* @__PURE__ */ jsxs("group", { children: [
|
|
1058
|
+
/* @__PURE__ */ jsxs(
|
|
1059
|
+
"mesh",
|
|
1060
|
+
{
|
|
1061
|
+
onClick: (e) => {
|
|
1062
|
+
e.stopPropagation();
|
|
1063
|
+
onClick?.();
|
|
1064
|
+
},
|
|
1065
|
+
onPointerOver: (e) => {
|
|
1066
|
+
e.stopPropagation();
|
|
1067
|
+
setHovered(true);
|
|
1068
|
+
document.body.style.cursor = "pointer";
|
|
1069
|
+
},
|
|
1070
|
+
onPointerOut: () => {
|
|
1071
|
+
setHovered(false);
|
|
1072
|
+
document.body.style.cursor = "auto";
|
|
1073
|
+
},
|
|
1074
|
+
children: [
|
|
1075
|
+
/* @__PURE__ */ jsx("tubeGeometry", { args: [tubeArgs[0], tubeArgs[1], tubeArgs[2], tubeArgs[3], tubeArgs[4]] }),
|
|
1076
|
+
/* @__PURE__ */ jsx(
|
|
1077
|
+
"meshStandardMaterial",
|
|
1078
|
+
{
|
|
1079
|
+
color: arcColor,
|
|
1080
|
+
emissive: arcColor,
|
|
1081
|
+
emissiveIntensity,
|
|
1082
|
+
transparent: true,
|
|
1083
|
+
opacity: hovered ? 0.9 : 0.7
|
|
1084
|
+
}
|
|
1085
|
+
)
|
|
1086
|
+
]
|
|
1087
|
+
}
|
|
1088
|
+
),
|
|
1089
|
+
hasGuard && /* @__PURE__ */ jsxs("mesh", { position: guardPos, scale: 0.15, children: [
|
|
1090
|
+
/* @__PURE__ */ jsx("octahedronGeometry", { args: [1, 0] }),
|
|
1091
|
+
/* @__PURE__ */ jsx(
|
|
1092
|
+
"meshStandardMaterial",
|
|
1093
|
+
{
|
|
1094
|
+
color: palette.guardPass,
|
|
1095
|
+
emissive: palette.guardPass,
|
|
1096
|
+
emissiveIntensity: 0.8
|
|
1097
|
+
}
|
|
1098
|
+
)
|
|
1099
|
+
] }),
|
|
1100
|
+
/* @__PURE__ */ jsxs(
|
|
1101
|
+
"mesh",
|
|
1102
|
+
{
|
|
1103
|
+
position: arrowPos,
|
|
1104
|
+
quaternion: arrowQuat,
|
|
1105
|
+
scale: 0.08,
|
|
1106
|
+
children: [
|
|
1107
|
+
/* @__PURE__ */ jsx("coneGeometry", { args: [1, 2, 8] }),
|
|
1108
|
+
/* @__PURE__ */ jsx(
|
|
1109
|
+
"meshStandardMaterial",
|
|
1110
|
+
{
|
|
1111
|
+
color: arcColor,
|
|
1112
|
+
emissive: arcColor,
|
|
1113
|
+
emissiveIntensity: 0.6
|
|
1114
|
+
}
|
|
1115
|
+
)
|
|
1116
|
+
]
|
|
1117
|
+
}
|
|
1118
|
+
),
|
|
1119
|
+
/* @__PURE__ */ jsx(
|
|
1120
|
+
Avl3DLabel,
|
|
1121
|
+
{
|
|
1122
|
+
position: labelPos,
|
|
1123
|
+
text: event,
|
|
1124
|
+
color: hovered ? AVL_INK.text : arcColor,
|
|
1125
|
+
fontSize: hovered ? 11 : 9
|
|
1126
|
+
}
|
|
1127
|
+
),
|
|
1128
|
+
hovered && /* @__PURE__ */ jsx(
|
|
1129
|
+
Avl3DTooltip,
|
|
1130
|
+
{
|
|
1131
|
+
position: [labelPos[0], labelPos[1] + 0.6, labelPos[2]],
|
|
1132
|
+
title: event,
|
|
1133
|
+
accentColor: arcColor,
|
|
1134
|
+
rows: [
|
|
1135
|
+
...fromState && toState ? [{ label: t("avl.transition"), value: `${fromState} \u2192 ${toState}` }] : [],
|
|
1136
|
+
...hasGuard ? [{ label: t("avl.guard"), value: t("common.yes") }] : [],
|
|
1137
|
+
...effectTypes && effectTypes.length > 0 ? [{ label: t("avl.effects"), value: effectTypes.slice(0, 3).join(", ") + (effectTypes.length > 3 ? ` +${effectTypes.length - 3}` : "") }] : []
|
|
1138
|
+
]
|
|
1139
|
+
}
|
|
1140
|
+
),
|
|
1141
|
+
effectTypes && effectTypes.length > 0 && effectTypes.slice(0, 4).map((effectType, ei) => {
|
|
1142
|
+
const pt = effectPositions[ei];
|
|
1143
|
+
if (!pt) return null;
|
|
1144
|
+
const eColor = palette[effectTypePaletteKey(effectType)];
|
|
1145
|
+
return /* @__PURE__ */ jsx("group", { position: pt, children: /* @__PURE__ */ jsxs("mesh", { scale: 0.06, children: [
|
|
1146
|
+
effectType === "render-ui" ? /* @__PURE__ */ jsx("boxGeometry", { args: [1.5, 1.5, 0.3] }) : effectType === "persist" ? /* @__PURE__ */ jsx("cylinderGeometry", { args: [0.6, 0.6, 1.5, 8] }) : effectType === "emit" ? /* @__PURE__ */ jsx("sphereGeometry", { args: [1, 8, 8] }) : effectType === "navigate" ? /* @__PURE__ */ jsx("coneGeometry", { args: [0.8, 1.5, 6] }) : effectType === "set" ? /* @__PURE__ */ jsx("tetrahedronGeometry", { args: [1, 0] }) : effectType === "call-service" ? /* @__PURE__ */ jsx("torusGeometry", { args: [0.8, 0.3, 6, 12] }) : /* @__PURE__ */ jsx("octahedronGeometry", { args: [0.8, 0] }),
|
|
1147
|
+
/* @__PURE__ */ jsx(
|
|
1148
|
+
"meshStandardMaterial",
|
|
1149
|
+
{
|
|
1150
|
+
color: eColor,
|
|
1151
|
+
emissive: eColor,
|
|
1152
|
+
emissiveIntensity: 0.8
|
|
1153
|
+
}
|
|
1154
|
+
)
|
|
1155
|
+
] }) }, ei);
|
|
1156
|
+
})
|
|
1157
|
+
] });
|
|
1158
|
+
};
|
|
1159
|
+
Avl3DTransitionArc.displayName = "Avl3DTransitionArc";
|
|
1160
|
+
function edgeGeometry(parent, child) {
|
|
1161
|
+
const p = new Vector3(parent.x, parent.y, parent.z);
|
|
1162
|
+
const c = new Vector3(child.x, child.y, child.z);
|
|
1163
|
+
const mid = new Vector3().addVectors(p, c).multiplyScalar(0.5);
|
|
1164
|
+
const dir = new Vector3().subVectors(c, p);
|
|
1165
|
+
const length = dir.length();
|
|
1166
|
+
const yAxis = new Vector3(0, 1, 0);
|
|
1167
|
+
const angle = yAxis.angleTo(dir.normalize());
|
|
1168
|
+
const axis = new Vector3().crossVectors(yAxis, dir).normalize();
|
|
1169
|
+
if (axis.length() < 1e-3) {
|
|
1170
|
+
return {
|
|
1171
|
+
position: [mid.x, mid.y, mid.z],
|
|
1172
|
+
rotation: [0, 0, 0],
|
|
1173
|
+
length
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1176
|
+
return {
|
|
1177
|
+
position: [mid.x, mid.y, mid.z],
|
|
1178
|
+
rotation: [
|
|
1179
|
+
axis.x * angle,
|
|
1180
|
+
axis.y * angle,
|
|
1181
|
+
axis.z * angle
|
|
1182
|
+
],
|
|
1183
|
+
length
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
var Avl3DExprTree = ({
|
|
1187
|
+
expression,
|
|
1188
|
+
position
|
|
1189
|
+
}) => {
|
|
1190
|
+
const layoutResults = useMemo(() => {
|
|
1191
|
+
const origin = { x: position[0], y: position[1], z: position[2] };
|
|
1192
|
+
return treeLayout3D(expression, origin, 2.5, 1.5);
|
|
1193
|
+
}, [expression, position]);
|
|
1194
|
+
const edges = useMemo(() => {
|
|
1195
|
+
const result = [];
|
|
1196
|
+
function collectEdges(node, parentPos) {
|
|
1197
|
+
const entry = layoutResults.find((r) => r.node === node);
|
|
1198
|
+
if (!entry) return;
|
|
1199
|
+
if (parentPos) {
|
|
1200
|
+
result.push({
|
|
1201
|
+
parent: parentPos,
|
|
1202
|
+
child: entry.position,
|
|
1203
|
+
key: `${parentPos.x}-${parentPos.y}-${entry.position.x}-${entry.position.y}`
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
1206
|
+
if (node.children) {
|
|
1207
|
+
for (const child of node.children) {
|
|
1208
|
+
collectEdges(child, entry.position);
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
collectEdges(expression, null);
|
|
1213
|
+
return result;
|
|
1214
|
+
}, [expression, layoutResults]);
|
|
1215
|
+
const palette = useAvl3DPalette();
|
|
1216
|
+
if (!palette) return null;
|
|
1217
|
+
return /* @__PURE__ */ jsxs("group", { children: [
|
|
1218
|
+
edges.map((edge) => {
|
|
1219
|
+
const geo = edgeGeometry(edge.parent, edge.child);
|
|
1220
|
+
return /* @__PURE__ */ jsxs(
|
|
1221
|
+
"mesh",
|
|
1222
|
+
{
|
|
1223
|
+
position: geo.position,
|
|
1224
|
+
rotation: geo.rotation,
|
|
1225
|
+
children: [
|
|
1226
|
+
/* @__PURE__ */ jsx("cylinderGeometry", { args: [0.015, 0.015, geo.length, 6] }),
|
|
1227
|
+
/* @__PURE__ */ jsx(
|
|
1228
|
+
"meshStandardMaterial",
|
|
1229
|
+
{
|
|
1230
|
+
color: palette.transitionArc,
|
|
1231
|
+
transparent: true,
|
|
1232
|
+
opacity: 0.5
|
|
1233
|
+
}
|
|
1234
|
+
)
|
|
1235
|
+
]
|
|
1236
|
+
},
|
|
1237
|
+
edge.key
|
|
1238
|
+
);
|
|
1239
|
+
}),
|
|
1240
|
+
layoutResults.map((entry, i) => {
|
|
1241
|
+
const pos = [
|
|
1242
|
+
entry.position.x,
|
|
1243
|
+
entry.position.y,
|
|
1244
|
+
entry.position.z
|
|
1245
|
+
];
|
|
1246
|
+
if (entry.node.type === "operator") {
|
|
1247
|
+
const opColor = palette[exprOperatorPaletteKey(entry.node.label)];
|
|
1248
|
+
return /* @__PURE__ */ jsxs("group", { position: pos, children: [
|
|
1249
|
+
/* @__PURE__ */ jsxs("mesh", { children: [
|
|
1250
|
+
/* @__PURE__ */ jsx("boxGeometry", { args: [0.6, 0.4, 0.3] }),
|
|
1251
|
+
/* @__PURE__ */ jsx(
|
|
1252
|
+
"meshStandardMaterial",
|
|
1253
|
+
{
|
|
1254
|
+
color: opColor,
|
|
1255
|
+
emissive: opColor,
|
|
1256
|
+
emissiveIntensity: 0.4,
|
|
1257
|
+
roughness: 0.3
|
|
1258
|
+
}
|
|
1259
|
+
)
|
|
1260
|
+
] }),
|
|
1261
|
+
/* @__PURE__ */ jsx(
|
|
1262
|
+
Avl3DLabel,
|
|
1263
|
+
{
|
|
1264
|
+
position: [0, -0.4, 0],
|
|
1265
|
+
text: entry.node.label,
|
|
1266
|
+
color: opColor,
|
|
1267
|
+
fontSize: 10
|
|
1268
|
+
}
|
|
1269
|
+
)
|
|
1270
|
+
] }, i);
|
|
1271
|
+
}
|
|
1272
|
+
if (entry.node.type === "binding") {
|
|
1273
|
+
return /* @__PURE__ */ jsxs("group", { position: pos, children: [
|
|
1274
|
+
/* @__PURE__ */ jsxs("mesh", { scale: 0.08, children: [
|
|
1275
|
+
/* @__PURE__ */ jsx("torusKnotGeometry", { args: [2, 0.6, 48, 8, 2, 3] }),
|
|
1276
|
+
/* @__PURE__ */ jsx(
|
|
1277
|
+
"meshStandardMaterial",
|
|
1278
|
+
{
|
|
1279
|
+
color: palette.exprBinding,
|
|
1280
|
+
emissive: palette.exprBinding,
|
|
1281
|
+
emissiveIntensity: 0.4,
|
|
1282
|
+
transparent: true,
|
|
1283
|
+
opacity: 0.85,
|
|
1284
|
+
roughness: 0.3
|
|
1285
|
+
}
|
|
1286
|
+
)
|
|
1287
|
+
] }),
|
|
1288
|
+
/* @__PURE__ */ jsx(
|
|
1289
|
+
Avl3DLabel,
|
|
1290
|
+
{
|
|
1291
|
+
position: [0, -0.35, 0],
|
|
1292
|
+
text: entry.node.label,
|
|
1293
|
+
color: palette.exprBinding,
|
|
1294
|
+
fontSize: 9
|
|
1295
|
+
}
|
|
1296
|
+
)
|
|
1297
|
+
] }, i);
|
|
1298
|
+
}
|
|
1299
|
+
return /* @__PURE__ */ jsxs("group", { position: pos, children: [
|
|
1300
|
+
/* @__PURE__ */ jsxs("mesh", { rotation: [Math.PI / 6, Math.PI / 4, 0], children: [
|
|
1301
|
+
/* @__PURE__ */ jsx("boxGeometry", { args: [0.2, 0.2, 0.2] }),
|
|
1302
|
+
/* @__PURE__ */ jsx(
|
|
1303
|
+
"meshStandardMaterial",
|
|
1304
|
+
{
|
|
1305
|
+
color: palette.exprLiteral,
|
|
1306
|
+
emissive: palette.exprLiteral,
|
|
1307
|
+
emissiveIntensity: 0.2,
|
|
1308
|
+
roughness: 0.5
|
|
1309
|
+
}
|
|
1310
|
+
)
|
|
1311
|
+
] }),
|
|
1312
|
+
/* @__PURE__ */ jsx(
|
|
1313
|
+
Avl3DLabel,
|
|
1314
|
+
{
|
|
1315
|
+
position: [0, -0.3, 0],
|
|
1316
|
+
text: entry.node.label,
|
|
1317
|
+
color: palette.exprLiteral,
|
|
1318
|
+
fontSize: 8
|
|
1319
|
+
}
|
|
1320
|
+
)
|
|
1321
|
+
] }, i);
|
|
1322
|
+
})
|
|
1323
|
+
] });
|
|
1324
|
+
};
|
|
1325
|
+
Avl3DExprTree.displayName = "Avl3DExprTree";
|
|
1326
|
+
|
|
1327
|
+
export { AVL_3D_COLORS, Avl3DCrossWire, Avl3DEntityCore, Avl3DExprTree, Avl3DLabel, Avl3DOrbitalNode, Avl3DStateNode, Avl3DTooltip, Avl3DTransitionArc, CAMERA_POSITIONS, arcCurve3D, fibonacciSpherePositions, forceDirectedPositions, getBreadcrumbs, goldenSpiralPositions, initialZoomState, orbitRingPositions, selfLoopCurve3D, treeLayout3D, zoomReducer };
|