@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,701 @@
|
|
|
1
|
+
import { AvlFieldType, AvlState, AvlPage, AvlEntity } from './chunk-FP3WIKTC.js';
|
|
2
|
+
import { AvlEffect } from './chunk-DZ42OJQC.js';
|
|
3
|
+
import { OPERATOR_CATEGORY_COLORS } from './chunk-DFNZUYX4.js';
|
|
4
|
+
import { useTranslate, Box, Typography, domPassthrough } from './chunk-MBQAMMSE.js';
|
|
5
|
+
import React, { useRef, useState, useLayoutEffect } from 'react';
|
|
6
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var AvlApplication = ({
|
|
9
|
+
x = 0,
|
|
10
|
+
y = 0,
|
|
11
|
+
width = 500,
|
|
12
|
+
height = 350,
|
|
13
|
+
label,
|
|
14
|
+
color = "var(--color-primary)",
|
|
15
|
+
opacity = 1,
|
|
16
|
+
className
|
|
17
|
+
}) => {
|
|
18
|
+
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
"rect",
|
|
21
|
+
{
|
|
22
|
+
x,
|
|
23
|
+
y,
|
|
24
|
+
width,
|
|
25
|
+
height,
|
|
26
|
+
rx: 12,
|
|
27
|
+
ry: 12,
|
|
28
|
+
fill: "none",
|
|
29
|
+
stroke: color,
|
|
30
|
+
strokeWidth: 3
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ jsx(
|
|
34
|
+
"rect",
|
|
35
|
+
{
|
|
36
|
+
x,
|
|
37
|
+
y,
|
|
38
|
+
width,
|
|
39
|
+
height,
|
|
40
|
+
rx: 12,
|
|
41
|
+
ry: 12,
|
|
42
|
+
fill: color,
|
|
43
|
+
opacity: 0.02
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
label && /* @__PURE__ */ jsx(
|
|
47
|
+
"text",
|
|
48
|
+
{
|
|
49
|
+
x: x + 16,
|
|
50
|
+
y: y + 20,
|
|
51
|
+
fill: color,
|
|
52
|
+
fontSize: 12,
|
|
53
|
+
fontFamily: "inherit",
|
|
54
|
+
fontWeight: "bold",
|
|
55
|
+
children: label
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] });
|
|
59
|
+
};
|
|
60
|
+
AvlApplication.displayName = "AvlApplication";
|
|
61
|
+
var AvlOrbital = ({
|
|
62
|
+
cx = 0,
|
|
63
|
+
cy = 0,
|
|
64
|
+
r = 80,
|
|
65
|
+
label,
|
|
66
|
+
color = "var(--color-primary)",
|
|
67
|
+
opacity = 1,
|
|
68
|
+
className
|
|
69
|
+
}) => {
|
|
70
|
+
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
"circle",
|
|
73
|
+
{
|
|
74
|
+
cx,
|
|
75
|
+
cy,
|
|
76
|
+
r,
|
|
77
|
+
fill: "none",
|
|
78
|
+
stroke: color,
|
|
79
|
+
strokeWidth: 2
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ jsx(
|
|
83
|
+
"circle",
|
|
84
|
+
{
|
|
85
|
+
cx,
|
|
86
|
+
cy,
|
|
87
|
+
r,
|
|
88
|
+
fill: color,
|
|
89
|
+
opacity: 0.03
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
label && /* @__PURE__ */ jsx(
|
|
93
|
+
"text",
|
|
94
|
+
{
|
|
95
|
+
x: cx,
|
|
96
|
+
y: cy - r - 8,
|
|
97
|
+
textAnchor: "middle",
|
|
98
|
+
fill: color,
|
|
99
|
+
fontSize: 11,
|
|
100
|
+
fontFamily: "inherit",
|
|
101
|
+
fontWeight: "bold",
|
|
102
|
+
children: label
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
] });
|
|
106
|
+
};
|
|
107
|
+
AvlOrbital.displayName = "AvlOrbital";
|
|
108
|
+
var AvlTrait = ({
|
|
109
|
+
cx = 0,
|
|
110
|
+
cy = 0,
|
|
111
|
+
rx = 60,
|
|
112
|
+
ry = 30,
|
|
113
|
+
rotation = 0,
|
|
114
|
+
label,
|
|
115
|
+
color = "var(--color-primary)",
|
|
116
|
+
opacity = 1,
|
|
117
|
+
className
|
|
118
|
+
}) => {
|
|
119
|
+
return /* @__PURE__ */ jsxs("g", { className, opacity, transform: `rotate(${rotation},${cx},${cy})`, children: [
|
|
120
|
+
/* @__PURE__ */ jsx(
|
|
121
|
+
"ellipse",
|
|
122
|
+
{
|
|
123
|
+
cx,
|
|
124
|
+
cy,
|
|
125
|
+
rx,
|
|
126
|
+
ry,
|
|
127
|
+
fill: "none",
|
|
128
|
+
stroke: color,
|
|
129
|
+
strokeWidth: 1.5,
|
|
130
|
+
strokeDasharray: "4 2"
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
label && /* @__PURE__ */ jsx(
|
|
134
|
+
"text",
|
|
135
|
+
{
|
|
136
|
+
x: cx - rx - 6,
|
|
137
|
+
y: cy,
|
|
138
|
+
textAnchor: "end",
|
|
139
|
+
dominantBaseline: "central",
|
|
140
|
+
fill: color,
|
|
141
|
+
fontSize: 9,
|
|
142
|
+
fontFamily: "inherit",
|
|
143
|
+
opacity: 0.8,
|
|
144
|
+
transform: `rotate(${-rotation},${cx - rx - 6},${cy})`,
|
|
145
|
+
children: label
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
] });
|
|
149
|
+
};
|
|
150
|
+
AvlTrait.displayName = "AvlTrait";
|
|
151
|
+
var avlTransitionId = 0;
|
|
152
|
+
var AvlTransition = ({
|
|
153
|
+
x1,
|
|
154
|
+
y1,
|
|
155
|
+
x2,
|
|
156
|
+
y2,
|
|
157
|
+
curved = false,
|
|
158
|
+
curveAwayFrom,
|
|
159
|
+
label,
|
|
160
|
+
color = "var(--color-primary)",
|
|
161
|
+
opacity = 1,
|
|
162
|
+
className
|
|
163
|
+
}) => {
|
|
164
|
+
const ids = React.useMemo(() => {
|
|
165
|
+
avlTransitionId += 1;
|
|
166
|
+
return { arrow: `avl-tr-${avlTransitionId}-arrow` };
|
|
167
|
+
}, []);
|
|
168
|
+
const mx = (x1 + x2) / 2;
|
|
169
|
+
const my = (y1 + y2) / 2;
|
|
170
|
+
const dx = x2 - x1;
|
|
171
|
+
const dy = y2 - y1;
|
|
172
|
+
const len = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
173
|
+
const curvature = len * 0.2;
|
|
174
|
+
let perpX = -dy / len;
|
|
175
|
+
let perpY = dx / len;
|
|
176
|
+
if (curveAwayFrom) {
|
|
177
|
+
const testX = mx + perpX * curvature;
|
|
178
|
+
const testY = my + perpY * curvature;
|
|
179
|
+
const distTest = Math.sqrt((testX - curveAwayFrom.x) ** 2 + (testY - curveAwayFrom.y) ** 2);
|
|
180
|
+
const distMid = Math.sqrt((mx - curveAwayFrom.x) ** 2 + (my - curveAwayFrom.y) ** 2);
|
|
181
|
+
if (distTest < distMid) {
|
|
182
|
+
perpX = -perpX;
|
|
183
|
+
perpY = -perpY;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
const cpx = mx + perpX * curvature;
|
|
187
|
+
const cpy = my + perpY * curvature;
|
|
188
|
+
const d = curved ? `M${x1},${y1} Q${cpx},${cpy} ${x2},${y2}` : `M${x1},${y1} L${x2},${y2}`;
|
|
189
|
+
const labelX = curved ? (x1 + 2 * cpx + x2) / 4 : mx;
|
|
190
|
+
const labelY = curved ? (y1 + 2 * cpy + y2) / 4 : my;
|
|
191
|
+
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
192
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
|
|
193
|
+
"marker",
|
|
194
|
+
{
|
|
195
|
+
id: ids.arrow,
|
|
196
|
+
markerWidth: "8",
|
|
197
|
+
markerHeight: "6",
|
|
198
|
+
refX: "7",
|
|
199
|
+
refY: "3",
|
|
200
|
+
orient: "auto",
|
|
201
|
+
markerUnits: "strokeWidth",
|
|
202
|
+
children: /* @__PURE__ */ jsx("path", { d: "M0,0 L8,3 L0,6 Z", fill: color })
|
|
203
|
+
}
|
|
204
|
+
) }),
|
|
205
|
+
/* @__PURE__ */ jsx(
|
|
206
|
+
"path",
|
|
207
|
+
{
|
|
208
|
+
d,
|
|
209
|
+
fill: "none",
|
|
210
|
+
stroke: color,
|
|
211
|
+
strokeWidth: 1.5,
|
|
212
|
+
markerEnd: `url(#${ids.arrow})`
|
|
213
|
+
}
|
|
214
|
+
),
|
|
215
|
+
label && /* @__PURE__ */ jsx(
|
|
216
|
+
"text",
|
|
217
|
+
{
|
|
218
|
+
x: labelX,
|
|
219
|
+
y: labelY - 6,
|
|
220
|
+
textAnchor: "middle",
|
|
221
|
+
fill: color,
|
|
222
|
+
fontSize: 9,
|
|
223
|
+
fontFamily: "inherit",
|
|
224
|
+
opacity: 0.8,
|
|
225
|
+
children: label
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
] });
|
|
229
|
+
};
|
|
230
|
+
AvlTransition.displayName = "AvlTransition";
|
|
231
|
+
var AvlEvent = ({
|
|
232
|
+
x = 0,
|
|
233
|
+
y = 0,
|
|
234
|
+
size = 16,
|
|
235
|
+
label,
|
|
236
|
+
color = "var(--color-primary)",
|
|
237
|
+
opacity = 1,
|
|
238
|
+
className
|
|
239
|
+
}) => {
|
|
240
|
+
const s = size / 16;
|
|
241
|
+
const bolt = [
|
|
242
|
+
`M${x - 2 * s},${y - 8 * s}`,
|
|
243
|
+
`L${x + 4 * s},${y - 8 * s}`,
|
|
244
|
+
`L${x + 1 * s},${y - 1 * s}`,
|
|
245
|
+
`L${x + 5 * s},${y - 1 * s}`,
|
|
246
|
+
`L${x - 3 * s},${y + 8 * s}`,
|
|
247
|
+
`L${x},${y + 1 * s}`,
|
|
248
|
+
`L${x - 4 * s},${y + 1 * s}`,
|
|
249
|
+
"Z"
|
|
250
|
+
].join(" ");
|
|
251
|
+
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
252
|
+
/* @__PURE__ */ jsx("path", { d: bolt, fill: color }),
|
|
253
|
+
label && /* @__PURE__ */ jsx(
|
|
254
|
+
"text",
|
|
255
|
+
{
|
|
256
|
+
x,
|
|
257
|
+
y: y + size / 2 + 12,
|
|
258
|
+
textAnchor: "middle",
|
|
259
|
+
fill: color,
|
|
260
|
+
fontSize: 9,
|
|
261
|
+
fontFamily: "inherit",
|
|
262
|
+
children: label
|
|
263
|
+
}
|
|
264
|
+
)
|
|
265
|
+
] });
|
|
266
|
+
};
|
|
267
|
+
AvlEvent.displayName = "AvlEvent";
|
|
268
|
+
var AvlGuard = ({
|
|
269
|
+
x = 0,
|
|
270
|
+
y = 0,
|
|
271
|
+
size = 24,
|
|
272
|
+
label,
|
|
273
|
+
color = "var(--color-primary)",
|
|
274
|
+
opacity = 1,
|
|
275
|
+
className
|
|
276
|
+
}) => {
|
|
277
|
+
const h = size / 2;
|
|
278
|
+
const points = `${x},${y - h} ${x + h},${y} ${x},${y + h} ${x - h},${y}`;
|
|
279
|
+
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
280
|
+
/* @__PURE__ */ jsx(
|
|
281
|
+
"polygon",
|
|
282
|
+
{
|
|
283
|
+
points,
|
|
284
|
+
fill: "none",
|
|
285
|
+
stroke: color,
|
|
286
|
+
strokeWidth: 2,
|
|
287
|
+
strokeLinejoin: "round"
|
|
288
|
+
}
|
|
289
|
+
),
|
|
290
|
+
label && /* @__PURE__ */ jsx(
|
|
291
|
+
"text",
|
|
292
|
+
{
|
|
293
|
+
x,
|
|
294
|
+
y,
|
|
295
|
+
textAnchor: "middle",
|
|
296
|
+
dominantBaseline: "central",
|
|
297
|
+
fill: color,
|
|
298
|
+
fontSize: 8,
|
|
299
|
+
fontFamily: "inherit",
|
|
300
|
+
children: label
|
|
301
|
+
}
|
|
302
|
+
)
|
|
303
|
+
] });
|
|
304
|
+
};
|
|
305
|
+
AvlGuard.displayName = "AvlGuard";
|
|
306
|
+
var AvlField = ({
|
|
307
|
+
x = 0,
|
|
308
|
+
y = 0,
|
|
309
|
+
angle = 0,
|
|
310
|
+
length = 30,
|
|
311
|
+
required = true,
|
|
312
|
+
label,
|
|
313
|
+
color = "var(--color-primary)",
|
|
314
|
+
opacity = 1,
|
|
315
|
+
className
|
|
316
|
+
}) => {
|
|
317
|
+
const x2 = x + length * Math.cos(angle);
|
|
318
|
+
const y2 = y + length * Math.sin(angle);
|
|
319
|
+
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
320
|
+
/* @__PURE__ */ jsx(
|
|
321
|
+
"line",
|
|
322
|
+
{
|
|
323
|
+
x1: x,
|
|
324
|
+
y1: y,
|
|
325
|
+
x2,
|
|
326
|
+
y2,
|
|
327
|
+
stroke: color,
|
|
328
|
+
strokeWidth: 1.5,
|
|
329
|
+
strokeDasharray: required ? void 0 : "3 2"
|
|
330
|
+
}
|
|
331
|
+
),
|
|
332
|
+
/* @__PURE__ */ jsx("circle", { cx: x2, cy: y2, r: 2.5, fill: color, opacity: 0.6 }),
|
|
333
|
+
label && /* @__PURE__ */ jsx(
|
|
334
|
+
"text",
|
|
335
|
+
{
|
|
336
|
+
x: x2 + 6 * Math.cos(angle),
|
|
337
|
+
y: y2 + 6 * Math.sin(angle),
|
|
338
|
+
textAnchor: Math.cos(angle) >= 0 ? "start" : "end",
|
|
339
|
+
dominantBaseline: "central",
|
|
340
|
+
fill: color,
|
|
341
|
+
fontSize: 8,
|
|
342
|
+
fontFamily: "inherit",
|
|
343
|
+
opacity: 0.7,
|
|
344
|
+
children: label
|
|
345
|
+
}
|
|
346
|
+
)
|
|
347
|
+
] });
|
|
348
|
+
};
|
|
349
|
+
AvlField.displayName = "AvlField";
|
|
350
|
+
var AvlBinding = ({
|
|
351
|
+
x1,
|
|
352
|
+
y1,
|
|
353
|
+
x2,
|
|
354
|
+
y2,
|
|
355
|
+
label,
|
|
356
|
+
color = "var(--color-primary)",
|
|
357
|
+
opacity = 1,
|
|
358
|
+
className
|
|
359
|
+
}) => {
|
|
360
|
+
const mx = (x1 + x2) / 2;
|
|
361
|
+
const my = (y1 + y2) / 2;
|
|
362
|
+
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
363
|
+
/* @__PURE__ */ jsx(
|
|
364
|
+
"line",
|
|
365
|
+
{
|
|
366
|
+
x1,
|
|
367
|
+
y1,
|
|
368
|
+
x2,
|
|
369
|
+
y2,
|
|
370
|
+
stroke: color,
|
|
371
|
+
strokeWidth: 1,
|
|
372
|
+
strokeDasharray: "2 3",
|
|
373
|
+
opacity: 0.6
|
|
374
|
+
}
|
|
375
|
+
),
|
|
376
|
+
/* @__PURE__ */ jsx(
|
|
377
|
+
"text",
|
|
378
|
+
{
|
|
379
|
+
x: mx,
|
|
380
|
+
y: my - 4,
|
|
381
|
+
textAnchor: "middle",
|
|
382
|
+
fill: color,
|
|
383
|
+
fontSize: 10,
|
|
384
|
+
fontFamily: "inherit",
|
|
385
|
+
fontWeight: "bold",
|
|
386
|
+
children: "@"
|
|
387
|
+
}
|
|
388
|
+
),
|
|
389
|
+
label && /* @__PURE__ */ jsx(
|
|
390
|
+
"text",
|
|
391
|
+
{
|
|
392
|
+
x: mx,
|
|
393
|
+
y: my + 10,
|
|
394
|
+
textAnchor: "middle",
|
|
395
|
+
fill: color,
|
|
396
|
+
fontSize: 8,
|
|
397
|
+
fontFamily: "inherit",
|
|
398
|
+
opacity: 0.6,
|
|
399
|
+
children: label
|
|
400
|
+
}
|
|
401
|
+
)
|
|
402
|
+
] });
|
|
403
|
+
};
|
|
404
|
+
AvlBinding.displayName = "AvlBinding";
|
|
405
|
+
var AvlBindingRef = ({
|
|
406
|
+
x = 0,
|
|
407
|
+
y = 0,
|
|
408
|
+
path,
|
|
409
|
+
size = 12,
|
|
410
|
+
color = "var(--color-primary)",
|
|
411
|
+
opacity = 1,
|
|
412
|
+
className
|
|
413
|
+
}) => {
|
|
414
|
+
const fullLabel = `@${path}`;
|
|
415
|
+
const autoR = Math.max(size, fullLabel.length * 3.5 + 4);
|
|
416
|
+
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
417
|
+
/* @__PURE__ */ jsx(
|
|
418
|
+
"circle",
|
|
419
|
+
{
|
|
420
|
+
cx: x,
|
|
421
|
+
cy: y,
|
|
422
|
+
r: autoR,
|
|
423
|
+
fill: "none",
|
|
424
|
+
stroke: color,
|
|
425
|
+
strokeWidth: 1.5,
|
|
426
|
+
strokeDasharray: "3 2"
|
|
427
|
+
}
|
|
428
|
+
),
|
|
429
|
+
/* @__PURE__ */ jsx(
|
|
430
|
+
"text",
|
|
431
|
+
{
|
|
432
|
+
x,
|
|
433
|
+
y: y + 1,
|
|
434
|
+
textAnchor: "middle",
|
|
435
|
+
dominantBaseline: "central",
|
|
436
|
+
fill: color,
|
|
437
|
+
fontSize: 10,
|
|
438
|
+
fontFamily: "inherit",
|
|
439
|
+
children: fullLabel
|
|
440
|
+
}
|
|
441
|
+
)
|
|
442
|
+
] });
|
|
443
|
+
};
|
|
444
|
+
AvlBindingRef.displayName = "AvlBindingRef";
|
|
445
|
+
var PERSISTENCE_STROKE = {
|
|
446
|
+
persistent: { strokeWidth: 2.5 },
|
|
447
|
+
runtime: { strokeDasharray: "6 3", strokeWidth: 2 }
|
|
448
|
+
};
|
|
449
|
+
var AvlPersistence = ({
|
|
450
|
+
x = 0,
|
|
451
|
+
y = 0,
|
|
452
|
+
kind,
|
|
453
|
+
size = 20,
|
|
454
|
+
label,
|
|
455
|
+
color = "var(--color-primary)",
|
|
456
|
+
opacity = 1,
|
|
457
|
+
className
|
|
458
|
+
}) => {
|
|
459
|
+
const half = size / 2;
|
|
460
|
+
const strokeProps = PERSISTENCE_STROKE[kind];
|
|
461
|
+
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
462
|
+
/* @__PURE__ */ jsx(
|
|
463
|
+
"line",
|
|
464
|
+
{
|
|
465
|
+
x1: x - half,
|
|
466
|
+
y1: y,
|
|
467
|
+
x2: x + half,
|
|
468
|
+
y2: y,
|
|
469
|
+
stroke: color,
|
|
470
|
+
strokeWidth: strokeProps.strokeWidth,
|
|
471
|
+
strokeDasharray: strokeProps.strokeDasharray,
|
|
472
|
+
strokeLinecap: "round"
|
|
473
|
+
}
|
|
474
|
+
),
|
|
475
|
+
label && /* @__PURE__ */ jsx(
|
|
476
|
+
"text",
|
|
477
|
+
{
|
|
478
|
+
x,
|
|
479
|
+
y: y + 14,
|
|
480
|
+
textAnchor: "middle",
|
|
481
|
+
fill: color,
|
|
482
|
+
fontSize: 8,
|
|
483
|
+
fontFamily: "inherit",
|
|
484
|
+
opacity: 0.7,
|
|
485
|
+
children: label
|
|
486
|
+
}
|
|
487
|
+
)
|
|
488
|
+
] });
|
|
489
|
+
};
|
|
490
|
+
AvlPersistence.displayName = "AvlPersistence";
|
|
491
|
+
var AvlOperator = ({
|
|
492
|
+
x = 0,
|
|
493
|
+
y = 0,
|
|
494
|
+
name,
|
|
495
|
+
namespace = "arithmetic",
|
|
496
|
+
size = 16,
|
|
497
|
+
color,
|
|
498
|
+
opacity = 1,
|
|
499
|
+
className
|
|
500
|
+
}) => {
|
|
501
|
+
const opColor = color ?? OPERATOR_CATEGORY_COLORS[namespace];
|
|
502
|
+
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
503
|
+
/* @__PURE__ */ jsx(
|
|
504
|
+
"rect",
|
|
505
|
+
{
|
|
506
|
+
x: x - size,
|
|
507
|
+
y: y - size * 0.7,
|
|
508
|
+
width: size * 2,
|
|
509
|
+
height: size * 1.4,
|
|
510
|
+
rx: 4,
|
|
511
|
+
ry: 4,
|
|
512
|
+
fill: opColor,
|
|
513
|
+
fillOpacity: 0.15,
|
|
514
|
+
stroke: opColor,
|
|
515
|
+
strokeWidth: 1.5
|
|
516
|
+
}
|
|
517
|
+
),
|
|
518
|
+
/* @__PURE__ */ jsx(
|
|
519
|
+
"text",
|
|
520
|
+
{
|
|
521
|
+
x,
|
|
522
|
+
y: y + 1,
|
|
523
|
+
textAnchor: "middle",
|
|
524
|
+
dominantBaseline: "central",
|
|
525
|
+
fill: opColor,
|
|
526
|
+
fontSize: size > 14 ? 10 : 8,
|
|
527
|
+
fontFamily: "inherit",
|
|
528
|
+
fontWeight: "bold",
|
|
529
|
+
children: name
|
|
530
|
+
}
|
|
531
|
+
)
|
|
532
|
+
] });
|
|
533
|
+
};
|
|
534
|
+
AvlOperator.displayName = "AvlOperator";
|
|
535
|
+
var AvlSExpr = ({
|
|
536
|
+
x = 0,
|
|
537
|
+
y = 0,
|
|
538
|
+
width = 140,
|
|
539
|
+
height = 80,
|
|
540
|
+
label,
|
|
541
|
+
color = "var(--color-primary)",
|
|
542
|
+
opacity = 1,
|
|
543
|
+
className
|
|
544
|
+
}) => {
|
|
545
|
+
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
546
|
+
/* @__PURE__ */ jsx(
|
|
547
|
+
"rect",
|
|
548
|
+
{
|
|
549
|
+
x,
|
|
550
|
+
y,
|
|
551
|
+
width,
|
|
552
|
+
height,
|
|
553
|
+
rx: 6,
|
|
554
|
+
ry: 6,
|
|
555
|
+
fill: color,
|
|
556
|
+
fillOpacity: 0.05,
|
|
557
|
+
stroke: color,
|
|
558
|
+
strokeWidth: 1,
|
|
559
|
+
strokeDasharray: "6 3"
|
|
560
|
+
}
|
|
561
|
+
),
|
|
562
|
+
/* @__PURE__ */ jsx("circle", { cx: x + 12, cy: y + 12, r: 3, fill: color, opacity: 0.4 }),
|
|
563
|
+
/* @__PURE__ */ jsx("line", { x1: x + 12, y1: y + 15, x2: x + 8, y2: y + 22, stroke: color, strokeWidth: 0.8, opacity: 0.3 }),
|
|
564
|
+
/* @__PURE__ */ jsx("line", { x1: x + 12, y1: y + 15, x2: x + 16, y2: y + 22, stroke: color, strokeWidth: 0.8, opacity: 0.3 }),
|
|
565
|
+
label && /* @__PURE__ */ jsx(
|
|
566
|
+
"text",
|
|
567
|
+
{
|
|
568
|
+
x: x + width / 2,
|
|
569
|
+
y: y + height / 2,
|
|
570
|
+
textAnchor: "middle",
|
|
571
|
+
dominantBaseline: "central",
|
|
572
|
+
fill: color,
|
|
573
|
+
fontSize: 9,
|
|
574
|
+
fontFamily: "inherit",
|
|
575
|
+
opacity: 0.6,
|
|
576
|
+
children: label
|
|
577
|
+
}
|
|
578
|
+
)
|
|
579
|
+
] });
|
|
580
|
+
};
|
|
581
|
+
AvlSExpr.displayName = "AvlSExpr";
|
|
582
|
+
var AvlLiteral = ({
|
|
583
|
+
x = 0,
|
|
584
|
+
y = 0,
|
|
585
|
+
value,
|
|
586
|
+
size = 12,
|
|
587
|
+
color = "var(--color-primary)",
|
|
588
|
+
opacity = 1,
|
|
589
|
+
className
|
|
590
|
+
}) => {
|
|
591
|
+
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
592
|
+
/* @__PURE__ */ jsx(
|
|
593
|
+
"circle",
|
|
594
|
+
{
|
|
595
|
+
cx: x,
|
|
596
|
+
cy: y,
|
|
597
|
+
r: size,
|
|
598
|
+
fill: "none",
|
|
599
|
+
stroke: color,
|
|
600
|
+
strokeWidth: 1,
|
|
601
|
+
opacity: 0.5
|
|
602
|
+
}
|
|
603
|
+
),
|
|
604
|
+
/* @__PURE__ */ jsx(
|
|
605
|
+
"text",
|
|
606
|
+
{
|
|
607
|
+
x,
|
|
608
|
+
y: y + 1,
|
|
609
|
+
textAnchor: "middle",
|
|
610
|
+
dominantBaseline: "central",
|
|
611
|
+
fill: color,
|
|
612
|
+
fontSize: size > 10 ? 9 : 7,
|
|
613
|
+
fontFamily: "inherit",
|
|
614
|
+
children: value
|
|
615
|
+
}
|
|
616
|
+
)
|
|
617
|
+
] });
|
|
618
|
+
};
|
|
619
|
+
AvlLiteral.displayName = "AvlLiteral";
|
|
620
|
+
var AVL_GLYPH_KINDS = [
|
|
621
|
+
"application",
|
|
622
|
+
"orbital",
|
|
623
|
+
"entity",
|
|
624
|
+
"trait",
|
|
625
|
+
"page",
|
|
626
|
+
"state",
|
|
627
|
+
"transition",
|
|
628
|
+
"event",
|
|
629
|
+
"guard",
|
|
630
|
+
"effect",
|
|
631
|
+
"field",
|
|
632
|
+
"fieldType",
|
|
633
|
+
"binding",
|
|
634
|
+
"bindingRef",
|
|
635
|
+
"persistence",
|
|
636
|
+
"operator",
|
|
637
|
+
"sexpr",
|
|
638
|
+
"literal"
|
|
639
|
+
];
|
|
640
|
+
var HEIGHT = { sm: 32, md: 56, lg: 88 };
|
|
641
|
+
var PAD = 6;
|
|
642
|
+
function Symbol({ kind, label, effectType, fieldType, persistence, namespace }) {
|
|
643
|
+
switch (kind) {
|
|
644
|
+
case "application":
|
|
645
|
+
return /* @__PURE__ */ jsx(AvlApplication, { width: 120, height: 80 });
|
|
646
|
+
case "orbital":
|
|
647
|
+
return /* @__PURE__ */ jsx(AvlOrbital, { r: 36 });
|
|
648
|
+
case "entity":
|
|
649
|
+
return /* @__PURE__ */ jsx(AvlEntity, { r: 18, fieldCount: 4, persistence: persistence ?? "persistent" });
|
|
650
|
+
case "trait":
|
|
651
|
+
return /* @__PURE__ */ jsx(AvlTrait, { rx: 44, ry: 22 });
|
|
652
|
+
case "page":
|
|
653
|
+
return /* @__PURE__ */ jsx(AvlPage, { size: 20 });
|
|
654
|
+
case "state":
|
|
655
|
+
return /* @__PURE__ */ jsx(AvlState, { width: 96, height: 34 });
|
|
656
|
+
case "transition":
|
|
657
|
+
return /* @__PURE__ */ jsx(AvlTransition, { x1: -40, y1: 0, x2: 40, y2: 0 });
|
|
658
|
+
case "event":
|
|
659
|
+
return /* @__PURE__ */ jsx(AvlEvent, { size: 20 });
|
|
660
|
+
case "guard":
|
|
661
|
+
return /* @__PURE__ */ jsx(AvlGuard, { size: 28 });
|
|
662
|
+
case "effect":
|
|
663
|
+
return /* @__PURE__ */ jsx(AvlEffect, { effectType: effectType ?? "set", size: 14 });
|
|
664
|
+
case "field":
|
|
665
|
+
return /* @__PURE__ */ jsx(AvlField, { length: 40 });
|
|
666
|
+
case "fieldType":
|
|
667
|
+
return /* @__PURE__ */ jsx(AvlFieldType, { kind: fieldType ?? "string", size: 9 });
|
|
668
|
+
case "binding":
|
|
669
|
+
return /* @__PURE__ */ jsx(AvlBinding, { x1: -40, y1: 0, x2: 40, y2: 0 });
|
|
670
|
+
case "bindingRef":
|
|
671
|
+
return /* @__PURE__ */ jsx(AvlBindingRef, { path: label ?? "entity.id", size: 14 });
|
|
672
|
+
case "persistence":
|
|
673
|
+
return /* @__PURE__ */ jsx(AvlPersistence, { kind: persistence ?? "persistent", size: 24 });
|
|
674
|
+
case "operator":
|
|
675
|
+
return /* @__PURE__ */ jsx(AvlOperator, { name: label ?? "+", namespace: namespace ?? "arithmetic", size: 20 });
|
|
676
|
+
case "sexpr":
|
|
677
|
+
return /* @__PURE__ */ jsx(AvlSExpr, { width: 110, height: 60 });
|
|
678
|
+
case "literal":
|
|
679
|
+
return /* @__PURE__ */ jsx(AvlLiteral, { value: label ?? "42", size: 14 });
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
var AvlGlyph = ({ kind, label, size = "md", showCaption = true, className, effectType, fieldType, persistence, namespace, ...rest }) => {
|
|
683
|
+
const variant = { effectType, fieldType, persistence, namespace };
|
|
684
|
+
const { t } = useTranslate();
|
|
685
|
+
const groupRef = useRef(null);
|
|
686
|
+
const [box, setBox] = useState({ x: -50, y: -50, w: 100, h: 100 });
|
|
687
|
+
useLayoutEffect(() => {
|
|
688
|
+
const g = groupRef.current;
|
|
689
|
+
if (!g || typeof g.getBBox !== "function") return;
|
|
690
|
+
const b = g.getBBox();
|
|
691
|
+
if (b.width > 0 && b.height > 0) setBox({ x: b.x - PAD, y: b.y - PAD, w: b.width + 2 * PAD, h: b.height + 2 * PAD });
|
|
692
|
+
}, [kind, label, variant.effectType, variant.fieldType, variant.persistence, variant.namespace]);
|
|
693
|
+
const height = HEIGHT[size];
|
|
694
|
+
return /* @__PURE__ */ jsxs(Box, { ...domPassthrough(rest), "data-testid": "avl-glyph", "data-kind": kind, className: `inline-flex flex-col items-center gap-1 ${className ?? ""}`, children: [
|
|
695
|
+
/* @__PURE__ */ jsx("svg", { height, width: height * box.w / box.h, viewBox: `${box.x} ${box.y} ${box.w} ${box.h}`, role: "img", "aria-label": label ?? t(`avl.glyph.${kind}`), children: /* @__PURE__ */ jsx("g", { ref: groupRef, children: /* @__PURE__ */ jsx(Symbol, { kind, label, ...variant }) }) }),
|
|
696
|
+
showCaption ? /* @__PURE__ */ jsx(Box, { "data-testid": "avl-glyph-caption", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: label ?? t(`avl.glyph.${kind}`) }) }) : null
|
|
697
|
+
] });
|
|
698
|
+
};
|
|
699
|
+
AvlGlyph.displayName = "AvlGlyph";
|
|
700
|
+
|
|
701
|
+
export { AVL_GLYPH_KINDS, AvlApplication, AvlBinding, AvlBindingRef, AvlEvent, AvlField, AvlGlyph, AvlGuard, AvlLiteral, AvlOperator, AvlOrbital, AvlPersistence, AvlSExpr, AvlTrait, AvlTransition };
|