@almadar/ui 6.54.0 → 6.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AwaitingSkeletonContext-Bh399p1x.d.ts → AwaitingSkeletonContext-DPgW__WV.d.ts} +3 -1
- package/dist/{Canvas3DHost-B-y2TNij.d.ts → Canvas3DHost-DfAhg6EH.d.ts} +2 -0
- package/dist/Typography-7PDT62PG.js +5 -0
- package/dist/{UISlotRenderer-QUEG6WFM.js → UISlotRenderer-QTHFT6Z4.js} +6 -6
- package/dist/avl/index.cjs +3385 -1883
- package/dist/avl/index.js +45 -737
- package/dist/{chunk-ERXIHZW3.js → chunk-D2E44ODB.js} +29 -15
- package/dist/{chunk-FJDS4SVD.js → chunk-F4ZTPKZL.js} +3 -3
- package/dist/{chunk-U3CGKPOK.js → chunk-FQM37C56.js} +136 -107
- package/dist/{chunk-4UP6BZ4R.js → chunk-HCSJHRC4.js} +1 -1
- package/dist/{chunk-N2V4LHFQ.js → chunk-HRCR53OW.js} +10 -1
- package/dist/{chunk-O7OLVVBR.js → chunk-Q47ZN2DW.js} +24 -22
- package/dist/{chunk-4HC5HRHB.js → chunk-QGH4NAQO.js} +2 -2
- package/dist/{chunk-MCKFWPT2.js → chunk-RNY5LJXJ.js} +1 -1
- package/dist/{chunk-Z7JWXIRE.js → chunk-SGJHVPHC.js} +2 -2
- package/dist/{chunk-6O37FCX4.js → chunk-V3FGTQUE.js} +37 -2
- package/dist/{chunk-U2FGMHQP.js → chunk-XZKGRSIO.js} +3334 -1796
- package/dist/{chunk-Z5IYJU44.js → chunk-Y53Q55H5.js} +521 -24
- package/dist/components/index.cjs +5194 -3008
- package/dist/components/index.d.ts +117 -52
- package/dist/components/index.js +13 -13
- package/dist/context/index.cjs +36 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.js +1 -1
- package/dist/design-classes/index.cjs +29 -15
- package/dist/design-classes/index.d.cts +1 -0
- package/dist/design-classes/index.d.ts +1 -0
- package/dist/design-classes/index.js +29 -15
- package/dist/hooks/index.cjs +10 -1
- package/dist/hooks/index.js +3 -3
- package/dist/lib/drawable/three/index.cjs +442 -82
- package/dist/lib/drawable/three/index.d.ts +2 -2
- package/dist/lib/drawable/three/index.js +28 -24
- package/dist/lib/index.cjs +52 -3
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +4 -4
- package/dist/locales/index.cjs +30 -3
- package/dist/locales/index.js +21 -3
- package/dist/providers/index.cjs +5330 -3091
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.js +12 -9
- package/dist/runtime/index.cjs +5400 -3182
- package/dist/runtime/index.d.ts +7 -3
- package/dist/runtime/index.js +8 -8
- package/dist/ssr/index.cjs +24 -8
- package/dist/ssr/index.js +24 -8
- package/dist/{themeTokens-Ccu7EmGY.d.ts → themeTokens-D6MFwKrC.d.ts} +6 -2
- package/locales/ar.json +10 -1
- package/locales/en.json +10 -1
- package/locales/sl.json +10 -1
- package/package.json +6 -6
- package/scripts/theme-contrast-audit.mjs +20 -1
- package/tailwind-preset.cjs +3 -0
- package/themes/_base.css +61 -0
- package/themes/_contract.md +37 -0
- package/themes/almadar-heritage.css +82 -0
- package/themes/almadar-website.css +82 -0
- package/themes/almadar.css +82 -0
- package/themes/aqua.css +82 -0
- package/themes/arabesque.css +82 -0
- package/themes/art-deco.css +82 -0
- package/themes/art-nouveau.css +82 -0
- package/themes/atelier.css +82 -0
- package/themes/bauhaus.css +82 -0
- package/themes/bloomberg-dense.css +83 -1
- package/themes/blueprint.css +84 -0
- package/themes/clay.css +82 -0
- package/themes/comic.css +82 -0
- package/themes/constructivist.css +82 -0
- package/themes/corporate.css +82 -0
- package/themes/cyberpunk.css +82 -0
- package/themes/frutiger-aero.css +83 -0
- package/themes/game-adventure.css +15 -0
- package/themes/game-rpg.css +16 -0
- package/themes/game-sci-fi.css +15 -0
- package/themes/game-ui-pack.css +15 -0
- package/themes/gazette.css +82 -0
- package/themes/glass.css +82 -0
- package/themes/gothic.css +82 -0
- package/themes/ink-wash.css +82 -0
- package/themes/kawaii.css +82 -0
- package/themes/kiosk.css +82 -0
- package/themes/linear-clean.css +82 -0
- package/themes/luxury.css +82 -0
- package/themes/mac-classic.css +90 -8
- package/themes/material.css +82 -0
- package/themes/memphis.css +82 -0
- package/themes/mid-century.css +82 -0
- package/themes/minimalist.css +82 -0
- package/themes/mudcloth.css +82 -0
- package/themes/neon.css +83 -0
- package/themes/neumorphic.css +82 -0
- package/themes/newsprint.css +82 -0
- package/themes/notion-editorial.css +82 -0
- package/themes/orb.css +82 -0
- package/themes/pixel.css +82 -0
- package/themes/prism.css +82 -0
- package/themes/retro.css +83 -0
- package/themes/risograph.css +82 -0
- package/themes/scandi.css +82 -0
- package/themes/sketch.css +82 -0
- package/themes/solarpunk.css +82 -0
- package/themes/steampunk.css +82 -0
- package/themes/swiss.css +82 -0
- package/themes/terminal.css +84 -1
- package/themes/trait-wars.css +82 -0
- package/themes/ukiyo-e.css +82 -0
- package/themes/vaporwave.css +82 -0
- package/themes/victorian.css +82 -0
- package/themes/wabi-sabi.css +82 -0
- package/themes/win95.css +84 -0
- package/themes/wireframe.css +82 -0
- package/themes/zine.css +82 -0
- package/dist/Typography-CFI7JUVE.js +0 -5
package/dist/avl/index.js
CHANGED
|
@@ -1,647 +1,35 @@
|
|
|
1
|
-
import { BrowserPlayground, collectEmbeddedTraits } from '../chunk-
|
|
2
|
-
import { zoomReducer, initialZoomState, getBreadcrumbs } from '../chunk-
|
|
3
|
-
import { JsonTreeEditor } from '../chunk-
|
|
4
|
-
import { useTranslate as useTranslate$1 } from '../chunk-
|
|
1
|
+
import { BrowserPlayground, collectEmbeddedTraits } from '../chunk-FQM37C56.js';
|
|
2
|
+
import { zoomReducer, initialZoomState, getBreadcrumbs } from '../chunk-SGJHVPHC.js';
|
|
3
|
+
import { JsonTreeEditor } from '../chunk-F4ZTPKZL.js';
|
|
4
|
+
import { useTranslate as useTranslate$1 } from '../chunk-QGH4NAQO.js';
|
|
5
5
|
import '../chunk-VHTJRS2N.js';
|
|
6
|
-
import { spacingTokenOf, positionOf, withPosition, snapToSpacingStep, defaultSpacingStepPx, spacingOf, withSizing, withSpacing, layoutOf, withLayout, sizingOf, DESIGN_COLOR_TOKENS, DESIGN_RADIUS_TOKENS, DESIGN_SPACING_SCALE, sizeLimitOf, withSizeLimit, isArbitraryClass, tokenOfDesignClass } from '../chunk-
|
|
7
|
-
import { Popover, Button, Icon, Select, Badge, IconButton, AvlStateMachine, Input,
|
|
8
|
-
export { AvlEffect, AvlEntity, AvlFieldType, AvlPage, AvlState, AvlStateMachine, BehaviorView, FIELD_TYPE_SHAPES, MiniStateMachine, ModuleCard, computeTraitLayout, edgePath } from '../chunk-
|
|
9
|
-
import { avlSeries, STATE_COLORS, Box, HStack, VStack, avlTint, CONNECTION_COLORS, parseTraitLevel,
|
|
10
|
-
export { CONNECTION_COLORS, EFFECT_CATEGORY_COLORS, OPERATOR_CATEGORY_COLORS, STATE_COLORS, effectCategoryOf, getStateRole, parseApplicationLevel, parseOrbitalLevel, parseTraitLevel, parseTransitionLevel, traitLevelFromTrait } from '../chunk-
|
|
11
|
-
import { Typography, INLINE_TEXT_ATTR } from '../chunk-
|
|
6
|
+
import { spacingTokenOf, positionOf, withPosition, snapToSpacingStep, defaultSpacingStepPx, spacingOf, withSizing, withSpacing, layoutOf, withLayout, sizingOf, DESIGN_COLOR_TOKENS, DESIGN_RADIUS_TOKENS, DESIGN_SPACING_SCALE, sizeLimitOf, withSizeLimit, isArbitraryClass, tokenOfDesignClass } from '../chunk-D2E44ODB.js';
|
|
7
|
+
import { AvlGlyph, Popover, Button, Icon, Select, Badge, IconButton, AvlStateMachine, Input, useContainerWidth, AvlOrbital, AvlTrait, AvlEntity, AvlPage, AvlEvent, AvlGuard, AvlEffect, AvlState, useAlmadarDndSensors, almadarDndCollisionDetection, TagInput, Checkbox, Switch, CodeBlock, AvlFieldType, FileTree, Card, Accordion, RangeSlider, computeTraitLayout, edgePath, FormField, Radio, useCompactLayout, ButtonGroup, roundedEdgePath } from '../chunk-XZKGRSIO.js';
|
|
8
|
+
export { AVL_GLYPH_KINDS, AvlApplication, AvlBinding, AvlBindingRef, AvlEffect, AvlEntity, AvlEvent, AvlField, AvlFieldType, AvlGlyph, AvlGuard, AvlLiteral, AvlOperator, AvlOrbital, AvlPage, AvlPersistence, AvlSExpr, AvlState, AvlStateMachine, AvlTrait, AvlTransition, BehaviorView, FIELD_TYPE_SHAPES, MiniStateMachine, ModuleCard, computeTraitLayout, edgePath } from '../chunk-XZKGRSIO.js';
|
|
9
|
+
import { avlSeries, STATE_COLORS, Box, HStack, VStack, avlTint, CONNECTION_COLORS, parseTraitLevel, AVL_INK, AVL_FONT, parseApplicationLevel, parseOrbitalLevel, getStateRole, effectCategoryOf, EFFECT_CATEGORY_COLORS, pressableProps, traitTransitionRenderUi, traitEventWires, effectZoneOf, OPERATOR_CATEGORY_COLORS, avlBlend } from '../chunk-Y53Q55H5.js';
|
|
10
|
+
export { CONNECTION_COLORS, EFFECT_CATEGORY_COLORS, OPERATOR_CATEGORY_COLORS, STATE_COLORS, effectCategoryOf, getStateRole, parseApplicationLevel, parseOrbitalLevel, parseTraitLevel, parseTransitionLevel, traitLevelFromTrait } from '../chunk-Y53Q55H5.js';
|
|
11
|
+
import { Typography, INLINE_TEXT_ATTR } from '../chunk-HCSJHRC4.js';
|
|
12
12
|
import { usePrefersReducedMotion, useMediaQuery } from '../chunk-JRW33U35.js';
|
|
13
13
|
import '../chunk-XJTHMW4G.js';
|
|
14
14
|
import { useEventBus } from '../chunk-6EV3OEBQ.js';
|
|
15
15
|
import { profilerOnRender, perfStart, perfEnd } from '../chunk-KQXXO42S.js';
|
|
16
|
-
import { isEditableTarget } from '../chunk-
|
|
17
|
-
import {
|
|
18
|
-
import '../chunk-
|
|
19
|
-
import '../chunk-
|
|
16
|
+
import { isEditableTarget } from '../chunk-Q47ZN2DW.js';
|
|
17
|
+
import { cn } from '../chunk-64WACXM7.js';
|
|
18
|
+
import '../chunk-RNY5LJXJ.js';
|
|
19
|
+
import '../chunk-HRCR53OW.js';
|
|
20
20
|
import '../chunk-PQKU62LK.js';
|
|
21
21
|
import '../chunk-PEST66PN.js';
|
|
22
22
|
import '../chunk-QPXIAUJD.js';
|
|
23
|
-
import {
|
|
24
|
-
import React19, { createContext, useContext, useState, useRef, useCallback, useMemo, useEffect, useLayoutEffect, Profiler, useReducer } from 'react';
|
|
23
|
+
import React17, { createContext, useContext, useState, useRef, useCallback, useMemo, useEffect, Profiler, useReducer } from 'react';
|
|
25
24
|
import { FieldTypeSchema, EFFECT_OPERATORS, isInlineTrait, isPageReference, navigatePatternPath, isAriaRole, formatSExpr, answerToMutations, isBinding } from '@almadar/core';
|
|
26
25
|
import { operatorVisualForm, getStdOperatorMeta } from '@almadar/std/registry';
|
|
27
26
|
import { useTranslate } from '@almadar/ui/hooks';
|
|
27
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
28
28
|
import { MarkerType, Handle, Position, useReactFlow, NodeResizeControl, ResizeControlVariant, getBezierPath, EdgeLabelRenderer, BaseEdge, ReactFlow, Controls, Background, BackgroundVariant, ReactFlowProvider, useNodesState, useEdgesState, useNodesInitialized } from '@xyflow/react';
|
|
29
29
|
import { renderUiEntriesOf, getPatternDefinition, isEntityAwarePattern, eventKeyPropsOf, eventListPropsOf } from '@almadar/core/patterns';
|
|
30
30
|
import { createLogger } from '@almadar/logger';
|
|
31
31
|
import { useDroppable, useDraggable, DndContext, DragOverlay } from '@dnd-kit/core';
|
|
32
32
|
|
|
33
|
-
var AvlOrbital = ({
|
|
34
|
-
cx = 0,
|
|
35
|
-
cy = 0,
|
|
36
|
-
r = 80,
|
|
37
|
-
label,
|
|
38
|
-
color = "var(--color-primary)",
|
|
39
|
-
opacity = 1,
|
|
40
|
-
className
|
|
41
|
-
}) => {
|
|
42
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
43
|
-
/* @__PURE__ */ jsx(
|
|
44
|
-
"circle",
|
|
45
|
-
{
|
|
46
|
-
cx,
|
|
47
|
-
cy,
|
|
48
|
-
r,
|
|
49
|
-
fill: "none",
|
|
50
|
-
stroke: color,
|
|
51
|
-
strokeWidth: 2
|
|
52
|
-
}
|
|
53
|
-
),
|
|
54
|
-
/* @__PURE__ */ jsx(
|
|
55
|
-
"circle",
|
|
56
|
-
{
|
|
57
|
-
cx,
|
|
58
|
-
cy,
|
|
59
|
-
r,
|
|
60
|
-
fill: color,
|
|
61
|
-
opacity: 0.03
|
|
62
|
-
}
|
|
63
|
-
),
|
|
64
|
-
label && /* @__PURE__ */ jsx(
|
|
65
|
-
"text",
|
|
66
|
-
{
|
|
67
|
-
x: cx,
|
|
68
|
-
y: cy - r - 8,
|
|
69
|
-
textAnchor: "middle",
|
|
70
|
-
fill: color,
|
|
71
|
-
fontSize: 11,
|
|
72
|
-
fontFamily: "inherit",
|
|
73
|
-
fontWeight: "bold",
|
|
74
|
-
children: label
|
|
75
|
-
}
|
|
76
|
-
)
|
|
77
|
-
] });
|
|
78
|
-
};
|
|
79
|
-
AvlOrbital.displayName = "AvlOrbital";
|
|
80
|
-
var AvlTrait = ({
|
|
81
|
-
cx = 0,
|
|
82
|
-
cy = 0,
|
|
83
|
-
rx = 60,
|
|
84
|
-
ry = 30,
|
|
85
|
-
rotation = 0,
|
|
86
|
-
label,
|
|
87
|
-
color = "var(--color-primary)",
|
|
88
|
-
opacity = 1,
|
|
89
|
-
className
|
|
90
|
-
}) => {
|
|
91
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, transform: `rotate(${rotation},${cx},${cy})`, children: [
|
|
92
|
-
/* @__PURE__ */ jsx(
|
|
93
|
-
"ellipse",
|
|
94
|
-
{
|
|
95
|
-
cx,
|
|
96
|
-
cy,
|
|
97
|
-
rx,
|
|
98
|
-
ry,
|
|
99
|
-
fill: "none",
|
|
100
|
-
stroke: color,
|
|
101
|
-
strokeWidth: 1.5,
|
|
102
|
-
strokeDasharray: "4 2"
|
|
103
|
-
}
|
|
104
|
-
),
|
|
105
|
-
label && /* @__PURE__ */ jsx(
|
|
106
|
-
"text",
|
|
107
|
-
{
|
|
108
|
-
x: cx - rx - 6,
|
|
109
|
-
y: cy,
|
|
110
|
-
textAnchor: "end",
|
|
111
|
-
dominantBaseline: "central",
|
|
112
|
-
fill: color,
|
|
113
|
-
fontSize: 9,
|
|
114
|
-
fontFamily: "inherit",
|
|
115
|
-
opacity: 0.8,
|
|
116
|
-
transform: `rotate(${-rotation},${cx - rx - 6},${cy})`,
|
|
117
|
-
children: label
|
|
118
|
-
}
|
|
119
|
-
)
|
|
120
|
-
] });
|
|
121
|
-
};
|
|
122
|
-
AvlTrait.displayName = "AvlTrait";
|
|
123
|
-
var AvlApplication = ({
|
|
124
|
-
x = 0,
|
|
125
|
-
y = 0,
|
|
126
|
-
width = 500,
|
|
127
|
-
height = 350,
|
|
128
|
-
label,
|
|
129
|
-
color = "var(--color-primary)",
|
|
130
|
-
opacity = 1,
|
|
131
|
-
className
|
|
132
|
-
}) => {
|
|
133
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
134
|
-
/* @__PURE__ */ jsx(
|
|
135
|
-
"rect",
|
|
136
|
-
{
|
|
137
|
-
x,
|
|
138
|
-
y,
|
|
139
|
-
width,
|
|
140
|
-
height,
|
|
141
|
-
rx: 12,
|
|
142
|
-
ry: 12,
|
|
143
|
-
fill: "none",
|
|
144
|
-
stroke: color,
|
|
145
|
-
strokeWidth: 3
|
|
146
|
-
}
|
|
147
|
-
),
|
|
148
|
-
/* @__PURE__ */ jsx(
|
|
149
|
-
"rect",
|
|
150
|
-
{
|
|
151
|
-
x,
|
|
152
|
-
y,
|
|
153
|
-
width,
|
|
154
|
-
height,
|
|
155
|
-
rx: 12,
|
|
156
|
-
ry: 12,
|
|
157
|
-
fill: color,
|
|
158
|
-
opacity: 0.02
|
|
159
|
-
}
|
|
160
|
-
),
|
|
161
|
-
label && /* @__PURE__ */ jsx(
|
|
162
|
-
"text",
|
|
163
|
-
{
|
|
164
|
-
x: x + 16,
|
|
165
|
-
y: y + 20,
|
|
166
|
-
fill: color,
|
|
167
|
-
fontSize: 12,
|
|
168
|
-
fontFamily: "inherit",
|
|
169
|
-
fontWeight: "bold",
|
|
170
|
-
children: label
|
|
171
|
-
}
|
|
172
|
-
)
|
|
173
|
-
] });
|
|
174
|
-
};
|
|
175
|
-
AvlApplication.displayName = "AvlApplication";
|
|
176
|
-
var avlTransitionId = 0;
|
|
177
|
-
var AvlTransition = ({
|
|
178
|
-
x1,
|
|
179
|
-
y1,
|
|
180
|
-
x2,
|
|
181
|
-
y2,
|
|
182
|
-
curved = false,
|
|
183
|
-
curveAwayFrom,
|
|
184
|
-
label,
|
|
185
|
-
color = "var(--color-primary)",
|
|
186
|
-
opacity = 1,
|
|
187
|
-
className
|
|
188
|
-
}) => {
|
|
189
|
-
const ids = React19.useMemo(() => {
|
|
190
|
-
avlTransitionId += 1;
|
|
191
|
-
return { arrow: `avl-tr-${avlTransitionId}-arrow` };
|
|
192
|
-
}, []);
|
|
193
|
-
const mx = (x1 + x2) / 2;
|
|
194
|
-
const my = (y1 + y2) / 2;
|
|
195
|
-
const dx = x2 - x1;
|
|
196
|
-
const dy = y2 - y1;
|
|
197
|
-
const len = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
198
|
-
const curvature = len * 0.2;
|
|
199
|
-
let perpX = -dy / len;
|
|
200
|
-
let perpY = dx / len;
|
|
201
|
-
if (curveAwayFrom) {
|
|
202
|
-
const testX = mx + perpX * curvature;
|
|
203
|
-
const testY = my + perpY * curvature;
|
|
204
|
-
const distTest = Math.sqrt((testX - curveAwayFrom.x) ** 2 + (testY - curveAwayFrom.y) ** 2);
|
|
205
|
-
const distMid = Math.sqrt((mx - curveAwayFrom.x) ** 2 + (my - curveAwayFrom.y) ** 2);
|
|
206
|
-
if (distTest < distMid) {
|
|
207
|
-
perpX = -perpX;
|
|
208
|
-
perpY = -perpY;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
const cpx = mx + perpX * curvature;
|
|
212
|
-
const cpy = my + perpY * curvature;
|
|
213
|
-
const d = curved ? `M${x1},${y1} Q${cpx},${cpy} ${x2},${y2}` : `M${x1},${y1} L${x2},${y2}`;
|
|
214
|
-
const labelX = curved ? (x1 + 2 * cpx + x2) / 4 : mx;
|
|
215
|
-
const labelY = curved ? (y1 + 2 * cpy + y2) / 4 : my;
|
|
216
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
217
|
-
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
|
|
218
|
-
"marker",
|
|
219
|
-
{
|
|
220
|
-
id: ids.arrow,
|
|
221
|
-
markerWidth: "8",
|
|
222
|
-
markerHeight: "6",
|
|
223
|
-
refX: "7",
|
|
224
|
-
refY: "3",
|
|
225
|
-
orient: "auto",
|
|
226
|
-
markerUnits: "strokeWidth",
|
|
227
|
-
children: /* @__PURE__ */ jsx("path", { d: "M0,0 L8,3 L0,6 Z", fill: color })
|
|
228
|
-
}
|
|
229
|
-
) }),
|
|
230
|
-
/* @__PURE__ */ jsx(
|
|
231
|
-
"path",
|
|
232
|
-
{
|
|
233
|
-
d,
|
|
234
|
-
fill: "none",
|
|
235
|
-
stroke: color,
|
|
236
|
-
strokeWidth: 1.5,
|
|
237
|
-
markerEnd: `url(#${ids.arrow})`
|
|
238
|
-
}
|
|
239
|
-
),
|
|
240
|
-
label && /* @__PURE__ */ jsx(
|
|
241
|
-
"text",
|
|
242
|
-
{
|
|
243
|
-
x: labelX,
|
|
244
|
-
y: labelY - 6,
|
|
245
|
-
textAnchor: "middle",
|
|
246
|
-
fill: color,
|
|
247
|
-
fontSize: 9,
|
|
248
|
-
fontFamily: "inherit",
|
|
249
|
-
opacity: 0.8,
|
|
250
|
-
children: label
|
|
251
|
-
}
|
|
252
|
-
)
|
|
253
|
-
] });
|
|
254
|
-
};
|
|
255
|
-
AvlTransition.displayName = "AvlTransition";
|
|
256
|
-
var AvlEvent = ({
|
|
257
|
-
x = 0,
|
|
258
|
-
y = 0,
|
|
259
|
-
size: size2 = 16,
|
|
260
|
-
label,
|
|
261
|
-
color = "var(--color-primary)",
|
|
262
|
-
opacity = 1,
|
|
263
|
-
className
|
|
264
|
-
}) => {
|
|
265
|
-
const s = size2 / 16;
|
|
266
|
-
const bolt = [
|
|
267
|
-
`M${x - 2 * s},${y - 8 * s}`,
|
|
268
|
-
`L${x + 4 * s},${y - 8 * s}`,
|
|
269
|
-
`L${x + 1 * s},${y - 1 * s}`,
|
|
270
|
-
`L${x + 5 * s},${y - 1 * s}`,
|
|
271
|
-
`L${x - 3 * s},${y + 8 * s}`,
|
|
272
|
-
`L${x},${y + 1 * s}`,
|
|
273
|
-
`L${x - 4 * s},${y + 1 * s}`,
|
|
274
|
-
"Z"
|
|
275
|
-
].join(" ");
|
|
276
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
277
|
-
/* @__PURE__ */ jsx("path", { d: bolt, fill: color }),
|
|
278
|
-
label && /* @__PURE__ */ jsx(
|
|
279
|
-
"text",
|
|
280
|
-
{
|
|
281
|
-
x,
|
|
282
|
-
y: y + size2 / 2 + 12,
|
|
283
|
-
textAnchor: "middle",
|
|
284
|
-
fill: color,
|
|
285
|
-
fontSize: 9,
|
|
286
|
-
fontFamily: "inherit",
|
|
287
|
-
children: label
|
|
288
|
-
}
|
|
289
|
-
)
|
|
290
|
-
] });
|
|
291
|
-
};
|
|
292
|
-
AvlEvent.displayName = "AvlEvent";
|
|
293
|
-
var AvlGuard = ({
|
|
294
|
-
x = 0,
|
|
295
|
-
y = 0,
|
|
296
|
-
size: size2 = 24,
|
|
297
|
-
label,
|
|
298
|
-
color = "var(--color-primary)",
|
|
299
|
-
opacity = 1,
|
|
300
|
-
className
|
|
301
|
-
}) => {
|
|
302
|
-
const h = size2 / 2;
|
|
303
|
-
const points = `${x},${y - h} ${x + h},${y} ${x},${y + h} ${x - h},${y}`;
|
|
304
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
305
|
-
/* @__PURE__ */ jsx(
|
|
306
|
-
"polygon",
|
|
307
|
-
{
|
|
308
|
-
points,
|
|
309
|
-
fill: "none",
|
|
310
|
-
stroke: color,
|
|
311
|
-
strokeWidth: 2,
|
|
312
|
-
strokeLinejoin: "round"
|
|
313
|
-
}
|
|
314
|
-
),
|
|
315
|
-
label && /* @__PURE__ */ jsx(
|
|
316
|
-
"text",
|
|
317
|
-
{
|
|
318
|
-
x,
|
|
319
|
-
y,
|
|
320
|
-
textAnchor: "middle",
|
|
321
|
-
dominantBaseline: "central",
|
|
322
|
-
fill: color,
|
|
323
|
-
fontSize: 8,
|
|
324
|
-
fontFamily: "inherit",
|
|
325
|
-
children: label
|
|
326
|
-
}
|
|
327
|
-
)
|
|
328
|
-
] });
|
|
329
|
-
};
|
|
330
|
-
AvlGuard.displayName = "AvlGuard";
|
|
331
|
-
var AvlField = ({
|
|
332
|
-
x = 0,
|
|
333
|
-
y = 0,
|
|
334
|
-
angle = 0,
|
|
335
|
-
length = 30,
|
|
336
|
-
required = true,
|
|
337
|
-
label,
|
|
338
|
-
color = "var(--color-primary)",
|
|
339
|
-
opacity = 1,
|
|
340
|
-
className
|
|
341
|
-
}) => {
|
|
342
|
-
const x2 = x + length * Math.cos(angle);
|
|
343
|
-
const y2 = y + length * Math.sin(angle);
|
|
344
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
345
|
-
/* @__PURE__ */ jsx(
|
|
346
|
-
"line",
|
|
347
|
-
{
|
|
348
|
-
x1: x,
|
|
349
|
-
y1: y,
|
|
350
|
-
x2,
|
|
351
|
-
y2,
|
|
352
|
-
stroke: color,
|
|
353
|
-
strokeWidth: 1.5,
|
|
354
|
-
strokeDasharray: required ? void 0 : "3 2"
|
|
355
|
-
}
|
|
356
|
-
),
|
|
357
|
-
/* @__PURE__ */ jsx("circle", { cx: x2, cy: y2, r: 2.5, fill: color, opacity: 0.6 }),
|
|
358
|
-
label && /* @__PURE__ */ jsx(
|
|
359
|
-
"text",
|
|
360
|
-
{
|
|
361
|
-
x: x2 + 6 * Math.cos(angle),
|
|
362
|
-
y: y2 + 6 * Math.sin(angle),
|
|
363
|
-
textAnchor: Math.cos(angle) >= 0 ? "start" : "end",
|
|
364
|
-
dominantBaseline: "central",
|
|
365
|
-
fill: color,
|
|
366
|
-
fontSize: 8,
|
|
367
|
-
fontFamily: "inherit",
|
|
368
|
-
opacity: 0.7,
|
|
369
|
-
children: label
|
|
370
|
-
}
|
|
371
|
-
)
|
|
372
|
-
] });
|
|
373
|
-
};
|
|
374
|
-
AvlField.displayName = "AvlField";
|
|
375
|
-
var AvlBinding = ({
|
|
376
|
-
x1,
|
|
377
|
-
y1,
|
|
378
|
-
x2,
|
|
379
|
-
y2,
|
|
380
|
-
label,
|
|
381
|
-
color = "var(--color-primary)",
|
|
382
|
-
opacity = 1,
|
|
383
|
-
className
|
|
384
|
-
}) => {
|
|
385
|
-
const mx = (x1 + x2) / 2;
|
|
386
|
-
const my = (y1 + y2) / 2;
|
|
387
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
388
|
-
/* @__PURE__ */ jsx(
|
|
389
|
-
"line",
|
|
390
|
-
{
|
|
391
|
-
x1,
|
|
392
|
-
y1,
|
|
393
|
-
x2,
|
|
394
|
-
y2,
|
|
395
|
-
stroke: color,
|
|
396
|
-
strokeWidth: 1,
|
|
397
|
-
strokeDasharray: "2 3",
|
|
398
|
-
opacity: 0.6
|
|
399
|
-
}
|
|
400
|
-
),
|
|
401
|
-
/* @__PURE__ */ jsx(
|
|
402
|
-
"text",
|
|
403
|
-
{
|
|
404
|
-
x: mx,
|
|
405
|
-
y: my - 4,
|
|
406
|
-
textAnchor: "middle",
|
|
407
|
-
fill: color,
|
|
408
|
-
fontSize: 10,
|
|
409
|
-
fontFamily: "inherit",
|
|
410
|
-
fontWeight: "bold",
|
|
411
|
-
children: "@"
|
|
412
|
-
}
|
|
413
|
-
),
|
|
414
|
-
label && /* @__PURE__ */ jsx(
|
|
415
|
-
"text",
|
|
416
|
-
{
|
|
417
|
-
x: mx,
|
|
418
|
-
y: my + 10,
|
|
419
|
-
textAnchor: "middle",
|
|
420
|
-
fill: color,
|
|
421
|
-
fontSize: 8,
|
|
422
|
-
fontFamily: "inherit",
|
|
423
|
-
opacity: 0.6,
|
|
424
|
-
children: label
|
|
425
|
-
}
|
|
426
|
-
)
|
|
427
|
-
] });
|
|
428
|
-
};
|
|
429
|
-
AvlBinding.displayName = "AvlBinding";
|
|
430
|
-
var PERSISTENCE_STROKE = {
|
|
431
|
-
persistent: { strokeWidth: 2.5 },
|
|
432
|
-
runtime: { strokeDasharray: "6 3", strokeWidth: 2 }
|
|
433
|
-
};
|
|
434
|
-
var AvlPersistence = ({
|
|
435
|
-
x = 0,
|
|
436
|
-
y = 0,
|
|
437
|
-
kind,
|
|
438
|
-
size: size2 = 20,
|
|
439
|
-
label,
|
|
440
|
-
color = "var(--color-primary)",
|
|
441
|
-
opacity = 1,
|
|
442
|
-
className
|
|
443
|
-
}) => {
|
|
444
|
-
const half = size2 / 2;
|
|
445
|
-
const strokeProps = PERSISTENCE_STROKE[kind];
|
|
446
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
447
|
-
/* @__PURE__ */ jsx(
|
|
448
|
-
"line",
|
|
449
|
-
{
|
|
450
|
-
x1: x - half,
|
|
451
|
-
y1: y,
|
|
452
|
-
x2: x + half,
|
|
453
|
-
y2: y,
|
|
454
|
-
stroke: color,
|
|
455
|
-
strokeWidth: strokeProps.strokeWidth,
|
|
456
|
-
strokeDasharray: strokeProps.strokeDasharray,
|
|
457
|
-
strokeLinecap: "round"
|
|
458
|
-
}
|
|
459
|
-
),
|
|
460
|
-
label && /* @__PURE__ */ jsx(
|
|
461
|
-
"text",
|
|
462
|
-
{
|
|
463
|
-
x,
|
|
464
|
-
y: y + 14,
|
|
465
|
-
textAnchor: "middle",
|
|
466
|
-
fill: color,
|
|
467
|
-
fontSize: 8,
|
|
468
|
-
fontFamily: "inherit",
|
|
469
|
-
opacity: 0.7,
|
|
470
|
-
children: label
|
|
471
|
-
}
|
|
472
|
-
)
|
|
473
|
-
] });
|
|
474
|
-
};
|
|
475
|
-
AvlPersistence.displayName = "AvlPersistence";
|
|
476
|
-
var AvlOperator = ({
|
|
477
|
-
x = 0,
|
|
478
|
-
y = 0,
|
|
479
|
-
name,
|
|
480
|
-
namespace = "arithmetic",
|
|
481
|
-
size: size2 = 16,
|
|
482
|
-
color,
|
|
483
|
-
opacity = 1,
|
|
484
|
-
className
|
|
485
|
-
}) => {
|
|
486
|
-
const opColor2 = color ?? OPERATOR_CATEGORY_COLORS[namespace];
|
|
487
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
488
|
-
/* @__PURE__ */ jsx(
|
|
489
|
-
"rect",
|
|
490
|
-
{
|
|
491
|
-
x: x - size2,
|
|
492
|
-
y: y - size2 * 0.7,
|
|
493
|
-
width: size2 * 2,
|
|
494
|
-
height: size2 * 1.4,
|
|
495
|
-
rx: 4,
|
|
496
|
-
ry: 4,
|
|
497
|
-
fill: opColor2,
|
|
498
|
-
fillOpacity: 0.15,
|
|
499
|
-
stroke: opColor2,
|
|
500
|
-
strokeWidth: 1.5
|
|
501
|
-
}
|
|
502
|
-
),
|
|
503
|
-
/* @__PURE__ */ jsx(
|
|
504
|
-
"text",
|
|
505
|
-
{
|
|
506
|
-
x,
|
|
507
|
-
y: y + 1,
|
|
508
|
-
textAnchor: "middle",
|
|
509
|
-
dominantBaseline: "central",
|
|
510
|
-
fill: opColor2,
|
|
511
|
-
fontSize: size2 > 14 ? 10 : 8,
|
|
512
|
-
fontFamily: "inherit",
|
|
513
|
-
fontWeight: "bold",
|
|
514
|
-
children: name
|
|
515
|
-
}
|
|
516
|
-
)
|
|
517
|
-
] });
|
|
518
|
-
};
|
|
519
|
-
AvlOperator.displayName = "AvlOperator";
|
|
520
|
-
var AvlSExpr = ({
|
|
521
|
-
x = 0,
|
|
522
|
-
y = 0,
|
|
523
|
-
width = 140,
|
|
524
|
-
height = 80,
|
|
525
|
-
label,
|
|
526
|
-
color = "var(--color-primary)",
|
|
527
|
-
opacity = 1,
|
|
528
|
-
className
|
|
529
|
-
}) => {
|
|
530
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
531
|
-
/* @__PURE__ */ jsx(
|
|
532
|
-
"rect",
|
|
533
|
-
{
|
|
534
|
-
x,
|
|
535
|
-
y,
|
|
536
|
-
width,
|
|
537
|
-
height,
|
|
538
|
-
rx: 6,
|
|
539
|
-
ry: 6,
|
|
540
|
-
fill: color,
|
|
541
|
-
fillOpacity: 0.05,
|
|
542
|
-
stroke: color,
|
|
543
|
-
strokeWidth: 1,
|
|
544
|
-
strokeDasharray: "6 3"
|
|
545
|
-
}
|
|
546
|
-
),
|
|
547
|
-
/* @__PURE__ */ jsx("circle", { cx: x + 12, cy: y + 12, r: 3, fill: color, opacity: 0.4 }),
|
|
548
|
-
/* @__PURE__ */ jsx("line", { x1: x + 12, y1: y + 15, x2: x + 8, y2: y + 22, stroke: color, strokeWidth: 0.8, opacity: 0.3 }),
|
|
549
|
-
/* @__PURE__ */ jsx("line", { x1: x + 12, y1: y + 15, x2: x + 16, y2: y + 22, stroke: color, strokeWidth: 0.8, opacity: 0.3 }),
|
|
550
|
-
label && /* @__PURE__ */ jsx(
|
|
551
|
-
"text",
|
|
552
|
-
{
|
|
553
|
-
x: x + width / 2,
|
|
554
|
-
y: y + height / 2,
|
|
555
|
-
textAnchor: "middle",
|
|
556
|
-
dominantBaseline: "central",
|
|
557
|
-
fill: color,
|
|
558
|
-
fontSize: 9,
|
|
559
|
-
fontFamily: "inherit",
|
|
560
|
-
opacity: 0.6,
|
|
561
|
-
children: label
|
|
562
|
-
}
|
|
563
|
-
)
|
|
564
|
-
] });
|
|
565
|
-
};
|
|
566
|
-
AvlSExpr.displayName = "AvlSExpr";
|
|
567
|
-
var AvlLiteral = ({
|
|
568
|
-
x = 0,
|
|
569
|
-
y = 0,
|
|
570
|
-
value,
|
|
571
|
-
size: size2 = 12,
|
|
572
|
-
color = "var(--color-primary)",
|
|
573
|
-
opacity = 1,
|
|
574
|
-
className
|
|
575
|
-
}) => {
|
|
576
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
577
|
-
/* @__PURE__ */ jsx(
|
|
578
|
-
"circle",
|
|
579
|
-
{
|
|
580
|
-
cx: x,
|
|
581
|
-
cy: y,
|
|
582
|
-
r: size2,
|
|
583
|
-
fill: "none",
|
|
584
|
-
stroke: color,
|
|
585
|
-
strokeWidth: 1,
|
|
586
|
-
opacity: 0.5
|
|
587
|
-
}
|
|
588
|
-
),
|
|
589
|
-
/* @__PURE__ */ jsx(
|
|
590
|
-
"text",
|
|
591
|
-
{
|
|
592
|
-
x,
|
|
593
|
-
y: y + 1,
|
|
594
|
-
textAnchor: "middle",
|
|
595
|
-
dominantBaseline: "central",
|
|
596
|
-
fill: color,
|
|
597
|
-
fontSize: size2 > 10 ? 9 : 7,
|
|
598
|
-
fontFamily: "inherit",
|
|
599
|
-
children: value
|
|
600
|
-
}
|
|
601
|
-
)
|
|
602
|
-
] });
|
|
603
|
-
};
|
|
604
|
-
AvlLiteral.displayName = "AvlLiteral";
|
|
605
|
-
var AvlBindingRef = ({
|
|
606
|
-
x = 0,
|
|
607
|
-
y = 0,
|
|
608
|
-
path,
|
|
609
|
-
size: size2 = 12,
|
|
610
|
-
color = "var(--color-primary)",
|
|
611
|
-
opacity = 1,
|
|
612
|
-
className
|
|
613
|
-
}) => {
|
|
614
|
-
const fullLabel = `@${path}`;
|
|
615
|
-
const autoR = Math.max(size2, fullLabel.length * 3.5 + 4);
|
|
616
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
617
|
-
/* @__PURE__ */ jsx(
|
|
618
|
-
"circle",
|
|
619
|
-
{
|
|
620
|
-
cx: x,
|
|
621
|
-
cy: y,
|
|
622
|
-
r: autoR,
|
|
623
|
-
fill: "none",
|
|
624
|
-
stroke: color,
|
|
625
|
-
strokeWidth: 1.5,
|
|
626
|
-
strokeDasharray: "3 2"
|
|
627
|
-
}
|
|
628
|
-
),
|
|
629
|
-
/* @__PURE__ */ jsx(
|
|
630
|
-
"text",
|
|
631
|
-
{
|
|
632
|
-
x,
|
|
633
|
-
y: y + 1,
|
|
634
|
-
textAnchor: "middle",
|
|
635
|
-
dominantBaseline: "central",
|
|
636
|
-
fill: color,
|
|
637
|
-
fontSize: 10,
|
|
638
|
-
fontFamily: "inherit",
|
|
639
|
-
children: fullLabel
|
|
640
|
-
}
|
|
641
|
-
)
|
|
642
|
-
] });
|
|
643
|
-
};
|
|
644
|
-
AvlBindingRef.displayName = "AvlBindingRef";
|
|
645
33
|
var MONO = 7.4;
|
|
646
34
|
var ROW = 40;
|
|
647
35
|
var GAP_X = 112;
|
|
@@ -1224,86 +612,6 @@ var AvlCircuit = ({ expr, trace, cursor, title, showCode = true, className }) =>
|
|
|
1224
612
|
] });
|
|
1225
613
|
};
|
|
1226
614
|
AvlCircuit.displayName = "AvlCircuit";
|
|
1227
|
-
var AVL_GLYPH_KINDS = [
|
|
1228
|
-
"application",
|
|
1229
|
-
"orbital",
|
|
1230
|
-
"entity",
|
|
1231
|
-
"trait",
|
|
1232
|
-
"page",
|
|
1233
|
-
"state",
|
|
1234
|
-
"transition",
|
|
1235
|
-
"event",
|
|
1236
|
-
"guard",
|
|
1237
|
-
"effect",
|
|
1238
|
-
"field",
|
|
1239
|
-
"fieldType",
|
|
1240
|
-
"binding",
|
|
1241
|
-
"bindingRef",
|
|
1242
|
-
"persistence",
|
|
1243
|
-
"operator",
|
|
1244
|
-
"sexpr",
|
|
1245
|
-
"literal"
|
|
1246
|
-
];
|
|
1247
|
-
var HEIGHT = { sm: 32, md: 56, lg: 88 };
|
|
1248
|
-
var PAD2 = 6;
|
|
1249
|
-
function Symbol({ kind, label, effectType, fieldType, persistence, namespace }) {
|
|
1250
|
-
switch (kind) {
|
|
1251
|
-
case "application":
|
|
1252
|
-
return /* @__PURE__ */ jsx(AvlApplication, { width: 120, height: 80 });
|
|
1253
|
-
case "orbital":
|
|
1254
|
-
return /* @__PURE__ */ jsx(AvlOrbital, { r: 36 });
|
|
1255
|
-
case "entity":
|
|
1256
|
-
return /* @__PURE__ */ jsx(AvlEntity, { r: 18, fieldCount: 4, persistence: persistence ?? "persistent" });
|
|
1257
|
-
case "trait":
|
|
1258
|
-
return /* @__PURE__ */ jsx(AvlTrait, { rx: 44, ry: 22 });
|
|
1259
|
-
case "page":
|
|
1260
|
-
return /* @__PURE__ */ jsx(AvlPage, { size: 20 });
|
|
1261
|
-
case "state":
|
|
1262
|
-
return /* @__PURE__ */ jsx(AvlState, { width: 96, height: 34 });
|
|
1263
|
-
case "transition":
|
|
1264
|
-
return /* @__PURE__ */ jsx(AvlTransition, { x1: -40, y1: 0, x2: 40, y2: 0 });
|
|
1265
|
-
case "event":
|
|
1266
|
-
return /* @__PURE__ */ jsx(AvlEvent, { size: 20 });
|
|
1267
|
-
case "guard":
|
|
1268
|
-
return /* @__PURE__ */ jsx(AvlGuard, { size: 28 });
|
|
1269
|
-
case "effect":
|
|
1270
|
-
return /* @__PURE__ */ jsx(AvlEffect, { effectType: effectType ?? "set", size: 14 });
|
|
1271
|
-
case "field":
|
|
1272
|
-
return /* @__PURE__ */ jsx(AvlField, { length: 40 });
|
|
1273
|
-
case "fieldType":
|
|
1274
|
-
return /* @__PURE__ */ jsx(AvlFieldType, { kind: fieldType ?? "string", size: 9 });
|
|
1275
|
-
case "binding":
|
|
1276
|
-
return /* @__PURE__ */ jsx(AvlBinding, { x1: -40, y1: 0, x2: 40, y2: 0 });
|
|
1277
|
-
case "bindingRef":
|
|
1278
|
-
return /* @__PURE__ */ jsx(AvlBindingRef, { path: label ?? "entity.id", size: 14 });
|
|
1279
|
-
case "persistence":
|
|
1280
|
-
return /* @__PURE__ */ jsx(AvlPersistence, { kind: persistence ?? "persistent", size: 24 });
|
|
1281
|
-
case "operator":
|
|
1282
|
-
return /* @__PURE__ */ jsx(AvlOperator, { name: label ?? "+", namespace: namespace ?? "arithmetic", size: 20 });
|
|
1283
|
-
case "sexpr":
|
|
1284
|
-
return /* @__PURE__ */ jsx(AvlSExpr, { width: 110, height: 60 });
|
|
1285
|
-
case "literal":
|
|
1286
|
-
return /* @__PURE__ */ jsx(AvlLiteral, { value: label ?? "42", size: 14 });
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
var AvlGlyph = ({ kind, label, size: size2 = "md", showCaption = true, className, effectType, fieldType, persistence, namespace, ...rest }) => {
|
|
1290
|
-
const variant = { effectType, fieldType, persistence, namespace };
|
|
1291
|
-
const { t } = useTranslate();
|
|
1292
|
-
const groupRef = useRef(null);
|
|
1293
|
-
const [box, setBox] = useState({ x: -50, y: -50, w: 100, h: 100 });
|
|
1294
|
-
useLayoutEffect(() => {
|
|
1295
|
-
const g = groupRef.current;
|
|
1296
|
-
if (!g || typeof g.getBBox !== "function") return;
|
|
1297
|
-
const b = g.getBBox();
|
|
1298
|
-
if (b.width > 0 && b.height > 0) setBox({ x: b.x - PAD2, y: b.y - PAD2, w: b.width + 2 * PAD2, h: b.height + 2 * PAD2 });
|
|
1299
|
-
}, [kind, label, variant.effectType, variant.fieldType, variant.persistence, variant.namespace]);
|
|
1300
|
-
const height = HEIGHT[size2];
|
|
1301
|
-
return /* @__PURE__ */ jsxs(Box, { ...domPassthrough(rest), "data-testid": "avl-glyph", "data-kind": kind, className: `inline-flex flex-col items-center gap-1 ${className ?? ""}`, children: [
|
|
1302
|
-
/* @__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 }) }) }),
|
|
1303
|
-
showCaption ? /* @__PURE__ */ jsx(Box, { "data-testid": "avl-glyph-caption", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: label ?? t(`avl.glyph.${kind}`) }) }) : null
|
|
1304
|
-
] });
|
|
1305
|
-
};
|
|
1306
|
-
AvlGlyph.displayName = "AvlGlyph";
|
|
1307
615
|
var avlOuId = 0;
|
|
1308
616
|
var AvlOrbitalUnit = ({
|
|
1309
617
|
entityName,
|
|
@@ -1315,7 +623,7 @@ var AvlOrbitalUnit = ({
|
|
|
1315
623
|
color = "var(--color-primary)",
|
|
1316
624
|
animated = false
|
|
1317
625
|
}) => {
|
|
1318
|
-
const ids =
|
|
626
|
+
const ids = React17.useMemo(() => {
|
|
1319
627
|
avlOuId += 1;
|
|
1320
628
|
const base = `avl-ou-${avlOuId}`;
|
|
1321
629
|
return { glow: `${base}-glow`, grad: `${base}-grad` };
|
|
@@ -1472,7 +780,7 @@ var AvlClosedCircuit = ({
|
|
|
1472
780
|
color = "var(--color-primary)",
|
|
1473
781
|
animated = false
|
|
1474
782
|
}) => {
|
|
1475
|
-
const ids =
|
|
783
|
+
const ids = React17.useMemo(() => {
|
|
1476
784
|
avlCcId += 1;
|
|
1477
785
|
const base = `avl-cc-${avlCcId}`;
|
|
1478
786
|
return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
|
|
@@ -1625,7 +933,7 @@ var AvlEmitListen = ({
|
|
|
1625
933
|
color = "var(--color-primary)",
|
|
1626
934
|
animated = false
|
|
1627
935
|
}) => {
|
|
1628
|
-
const ids =
|
|
936
|
+
const ids = React17.useMemo(() => {
|
|
1629
937
|
avlElId += 1;
|
|
1630
938
|
const base = `avl-el-${avlElId}`;
|
|
1631
939
|
return { arrow: `${base}-arrow`, grad: `${base}-grad` };
|
|
@@ -1899,7 +1207,7 @@ function renderNode(node, color, glowId) {
|
|
|
1899
1207
|
const baseR = node.type === "operator" ? 20 : 16;
|
|
1900
1208
|
const r = Math.max(baseR, labelLen * 3.5 + 6);
|
|
1901
1209
|
const nc = nodeColor(node.type, color);
|
|
1902
|
-
return /* @__PURE__ */ jsxs(
|
|
1210
|
+
return /* @__PURE__ */ jsxs(React17.Fragment, { children: [
|
|
1903
1211
|
node.children.map((child, i) => {
|
|
1904
1212
|
const childR = Math.max(
|
|
1905
1213
|
child.type === "operator" ? 20 : 16,
|
|
@@ -1956,7 +1264,7 @@ var AvlExprTree = ({
|
|
|
1956
1264
|
className,
|
|
1957
1265
|
color = "var(--color-primary)"
|
|
1958
1266
|
}) => {
|
|
1959
|
-
const ids =
|
|
1267
|
+
const ids = React17.useMemo(() => {
|
|
1960
1268
|
avlEtId += 1;
|
|
1961
1269
|
return { glow: `avl-et-${avlEtId}-glow` };
|
|
1962
1270
|
}, []);
|
|
@@ -2787,14 +2095,14 @@ var SystemNodeInner = ({ data }) => {
|
|
|
2787
2095
|
}
|
|
2788
2096
|
);
|
|
2789
2097
|
};
|
|
2790
|
-
var SystemNode =
|
|
2098
|
+
var SystemNode = React17.memo(SystemNodeInner);
|
|
2791
2099
|
SystemNode.displayName = "SystemNode";
|
|
2792
2100
|
var SystemBandNodeInner = ({ data }) => {
|
|
2793
2101
|
const d = data;
|
|
2794
2102
|
const { t } = useTranslate();
|
|
2795
2103
|
return /* @__PURE__ */ jsx(Box, { "data-testid": `avl-system-band-${d.bandKind}`, className: "pointer-events-none whitespace-nowrap", children: /* @__PURE__ */ jsx(Typography, { variant: "overline", color: "muted", children: t(d.bandKind === "connected" ? "avl.system.connected" : "avl.system.standalone", { count: d.bandCount ?? 0 }) }) });
|
|
2796
2104
|
};
|
|
2797
|
-
var SystemBandNode =
|
|
2105
|
+
var SystemBandNode = React17.memo(SystemBandNodeInner);
|
|
2798
2106
|
SystemBandNode.displayName = "SystemBandNode";
|
|
2799
2107
|
var DEPENDENCY_ROLE_CLASS = {
|
|
2800
2108
|
selected: "border-primary bg-primary/25 text-foreground ring-2 ring-primary/40",
|
|
@@ -2852,14 +2160,14 @@ var DependencyNodeInner = ({ id, data }) => {
|
|
|
2852
2160
|
}
|
|
2853
2161
|
);
|
|
2854
2162
|
};
|
|
2855
|
-
var DependencyNode =
|
|
2163
|
+
var DependencyNode = React17.memo(DependencyNodeInner);
|
|
2856
2164
|
DependencyNode.displayName = "DependencyNode";
|
|
2857
2165
|
var DependencyColumnNodeInner = ({ data }) => {
|
|
2858
2166
|
const d = data;
|
|
2859
2167
|
const { t } = useTranslate();
|
|
2860
2168
|
return /* @__PURE__ */ jsx(Box, { "data-testid": `avl-dependency-column-${d.dependencyColumn}`, className: "pointer-events-none whitespace-nowrap", children: /* @__PURE__ */ jsx(Typography, { variant: "overline", color: "muted", children: t(`avl.deps.column.${d.dependencyColumn ?? "unknown"}`) }) });
|
|
2861
2169
|
};
|
|
2862
|
-
var DependencyColumnNode =
|
|
2170
|
+
var DependencyColumnNode = React17.memo(DependencyColumnNodeInner);
|
|
2863
2171
|
DependencyColumnNode.displayName = "DependencyColumnNode";
|
|
2864
2172
|
var DetailView = ({ data }) => {
|
|
2865
2173
|
const { t } = useTranslate();
|
|
@@ -4593,12 +3901,12 @@ function CanvasDndProvider({
|
|
|
4593
3901
|
}) {
|
|
4594
3902
|
const eventBus = useEventBus();
|
|
4595
3903
|
const sensors = useAlmadarDndSensors(false);
|
|
4596
|
-
const [activePayload, setActivePayload] =
|
|
4597
|
-
const lastPointerRef =
|
|
4598
|
-
const trackPointer =
|
|
3904
|
+
const [activePayload, setActivePayload] = React17.useState(null);
|
|
3905
|
+
const lastPointerRef = React17.useRef(null);
|
|
3906
|
+
const trackPointer = React17.useCallback((ev) => {
|
|
4599
3907
|
lastPointerRef.current = { x: ev.clientX, y: ev.clientY };
|
|
4600
3908
|
}, []);
|
|
4601
|
-
const handleDragStart =
|
|
3909
|
+
const handleDragStart = React17.useCallback((e) => {
|
|
4602
3910
|
const data = e.active.data.current;
|
|
4603
3911
|
const payload = data?.payload;
|
|
4604
3912
|
const activator = e.activatorEvent;
|
|
@@ -4612,7 +3920,7 @@ function CanvasDndProvider({
|
|
|
4612
3920
|
log.warn("dragStart:missing-payload", { id: e.active.id });
|
|
4613
3921
|
}
|
|
4614
3922
|
}, [eventBus, trackPointer]);
|
|
4615
|
-
const handleDragEnd =
|
|
3923
|
+
const handleDragEnd = React17.useCallback((e) => {
|
|
4616
3924
|
setActivePayload(null);
|
|
4617
3925
|
document.removeEventListener("pointermove", trackPointer);
|
|
4618
3926
|
const activeData = e.active.data.current;
|
|
@@ -4648,7 +3956,7 @@ function CanvasDndProvider({
|
|
|
4648
3956
|
const suppressed = onDrop ? onDrop(drop) === true : false;
|
|
4649
3957
|
if (!suppressed) defaultEmit(eventBus, drop);
|
|
4650
3958
|
}, [eventBus, onDrop, trackPointer]);
|
|
4651
|
-
const handleDragCancel =
|
|
3959
|
+
const handleDragCancel = React17.useCallback(() => {
|
|
4652
3960
|
setActivePayload(null);
|
|
4653
3961
|
document.removeEventListener("pointermove", trackPointer);
|
|
4654
3962
|
log.info("dragCancel");
|
|
@@ -6189,7 +5497,7 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
6189
5497
|
}
|
|
6190
5498
|
);
|
|
6191
5499
|
};
|
|
6192
|
-
var OrbPreviewNode =
|
|
5500
|
+
var OrbPreviewNode = React17.memo(OrbPreviewNodeInner);
|
|
6193
5501
|
OrbPreviewNode.displayName = "OrbPreviewNode";
|
|
6194
5502
|
orbPreviewLog.debug("export-resolved", () => ({
|
|
6195
5503
|
type: typeof OrbPreviewNode,
|
|
@@ -6294,7 +5602,7 @@ var EventFlowEdgeInner = (props) => {
|
|
|
6294
5602
|
) })
|
|
6295
5603
|
] });
|
|
6296
5604
|
};
|
|
6297
|
-
var EventFlowEdge =
|
|
5605
|
+
var EventFlowEdge = React17.memo(EventFlowEdgeInner);
|
|
6298
5606
|
EventFlowEdge.displayName = "EventFlowEdge";
|
|
6299
5607
|
function asString(v) {
|
|
6300
5608
|
return typeof v === "string" ? v : "";
|
|
@@ -8049,7 +7357,7 @@ var TraitCardNodeInner = (props) => {
|
|
|
8049
7357
|
}
|
|
8050
7358
|
);
|
|
8051
7359
|
};
|
|
8052
|
-
var TraitCardNode =
|
|
7360
|
+
var TraitCardNode = React17.memo(TraitCardNodeInner);
|
|
8053
7361
|
TraitCardNode.displayName = "TraitCardNode";
|
|
8054
7362
|
|
|
8055
7363
|
// lib/avl-layered-graph.ts
|
|
@@ -8352,19 +7660,19 @@ function FlowCanvasInner({
|
|
|
8352
7660
|
const fitPadding = systemLevel || flowLens ? 0.08 : 0.25;
|
|
8353
7661
|
const compact = useCompactLayout();
|
|
8354
7662
|
const [scope, setScope] = useState("local");
|
|
8355
|
-
const scopeRef =
|
|
7663
|
+
const scopeRef = React17.useRef(scope);
|
|
8356
7664
|
scopeRef.current = scope;
|
|
8357
7665
|
const [focusRequest, setFocusRequest] = useState(focusedOrbitalProp ?? initialOrbital);
|
|
8358
7666
|
const [stateByOrbital, setStateByOrbital] = useState({});
|
|
8359
|
-
const fitFocusedRef =
|
|
8360
|
-
const pendingFitRef =
|
|
8361
|
-
const fittedViewRef =
|
|
7667
|
+
const fitFocusedRef = React17.useRef(false);
|
|
7668
|
+
const pendingFitRef = React17.useRef(null);
|
|
7669
|
+
const fittedViewRef = React17.useRef(null);
|
|
8362
7670
|
useEffect(() => {
|
|
8363
7671
|
if (focusedOrbitalProp === void 0) return;
|
|
8364
7672
|
fitFocusedRef.current = true;
|
|
8365
7673
|
setFocusRequest(focusedOrbitalProp);
|
|
8366
7674
|
}, [focusedOrbitalProp]);
|
|
8367
|
-
const screenSizeUserOverrideRef =
|
|
7675
|
+
const screenSizeUserOverrideRef = React17.useRef(false);
|
|
8368
7676
|
const [screenSize, setScreenSize] = useState(
|
|
8369
7677
|
() => typeof window === "undefined" ? "laptop" : detectScreenSize(window.innerWidth)
|
|
8370
7678
|
);
|
|
@@ -8520,9 +7828,9 @@ function FlowCanvasInner({
|
|
|
8520
7828
|
const [edges, setEdges, onEdgesChange] = useEdgesState(activeEdges);
|
|
8521
7829
|
const reactFlow = useReactFlow();
|
|
8522
7830
|
const cameraMs = usePrefersReducedMotion() ? 0 : 300;
|
|
8523
|
-
const savedPositionsRef =
|
|
7831
|
+
const savedPositionsRef = React17.useRef(nodePositions);
|
|
8524
7832
|
savedPositionsRef.current = nodePositions;
|
|
8525
|
-
const nodesRef =
|
|
7833
|
+
const nodesRef = React17.useRef(nodes);
|
|
8526
7834
|
nodesRef.current = nodes;
|
|
8527
7835
|
useEffect(() => {
|
|
8528
7836
|
setEdges([]);
|
|
@@ -8667,7 +7975,7 @@ function FlowCanvasInner({
|
|
|
8667
7975
|
targetTraitName: tgtData.traitName
|
|
8668
7976
|
});
|
|
8669
7977
|
}, [nodes, onEventWire, eventBus]);
|
|
8670
|
-
const worldPositionsRef =
|
|
7978
|
+
const worldPositionsRef = React17.useRef(canvas.worldPositions);
|
|
8671
7979
|
worldPositionsRef.current = canvas.worldPositions;
|
|
8672
7980
|
const placementsOf = useCallback((list) => {
|
|
8673
7981
|
const positions = { ...savedPositionsRef.current };
|
|
@@ -9027,7 +8335,7 @@ var ZoomBreadcrumb = ({
|
|
|
9027
8335
|
if (eventName && band === "detail") {
|
|
9028
8336
|
segments.push({ icon: "\u26A1", label: eventName });
|
|
9029
8337
|
}
|
|
9030
|
-
return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(
|
|
8338
|
+
return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React17.Fragment, { children: [
|
|
9031
8339
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
|
|
9032
8340
|
/* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
|
|
9033
8341
|
/* @__PURE__ */ jsx("span", { children: seg.label })
|
|
@@ -9274,7 +8582,7 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
9274
8582
|
borderRadius: 6,
|
|
9275
8583
|
border: `1px solid ${color}`
|
|
9276
8584
|
},
|
|
9277
|
-
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(
|
|
8585
|
+
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React17.Fragment, { children: [
|
|
9278
8586
|
i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
|
|
9279
8587
|
i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
|
|
9280
8588
|
Box,
|
|
@@ -9817,4 +9125,4 @@ function deploymentGraph(input) {
|
|
|
9817
9125
|
});
|
|
9818
9126
|
}
|
|
9819
9127
|
|
|
9820
|
-
export {
|
|
9128
|
+
export { AVL_GRAPH_NODE_TYPES, AvlBackwardEdge, AvlBehaviorGlyph, AvlBindingEdge, AvlCircuit, AvlClickTarget, AvlClosedCircuit, AvlCosmicZoom, AvlEmitListen, AvlEventWireEdge, AvlExprTree, AvlGraphCanvas, AvlOrbitalUnit, AvlOrbitalsCosmicZoom, AvlPageEdge, AvlSlotMap, AvlSwimLane, AvlTraitScene, AvlTransitionDetail, AvlTransitionEdge, AvlTransitionLane, AvlTransitionScene, CANVAS_TOOLS, CanvasDndProvider, CanvasVerifyContext, DEPLOYMENT_ROW, DOMAIN_COLORS, DependencyColumnNode, DependencyNode, DetailView, EDITABLE, ElementEditAccessContext, EventFlowEdge, FlowCanvas, KnobField, KnobSettingRow, LIVE_STATE, LayersPanel, OrbInspector, OrbPreviewNode, SystemBandNode, SystemMapContext, SystemNode, ZOOM_BAND_THRESHOLDS, ZoomBandContext, ZoomBreadcrumb, ZoomLegend, arcPath, armPosition, armsOf, canvasViewGraph, computeZoomBand, curveControlPoint, dependencyReach, deploymentGraph, deriveEditFocusFromElement, dropBusEvent, firedTransition, flowNeighbors, gridPositions, hasCanvasTool, initialStateOf, layeredGraph, optionForPlayedStep, parseLayerId, propAccessAt, radialPositions, ringPositions, schemaToDependencyGraph, schemaToFlowGraph, schemaToLayerItems, schemaToOverviewGraph, stateMachinePlayback, stateOptionsOf, traitFlowGraph, transitionPlayback, useCanvasDraggable, useCanvasDroppable, useInlineTextEdit, useZoomBand, zoomProgress };
|