@almadar/ui 6.53.1 → 6.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{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-P7A4SZSK.js → UISlotRenderer-QTHFT6Z4.js} +8 -8
- package/dist/avl/index.cjs +3031 -1790
- package/dist/avl/index.js +57 -745
- package/dist/{avl-3d-context-MAt_NuU9.d.ts → avl-3d-context-BpBKZIbc.d.ts} +1 -0
- package/dist/{chunk-ERXIHZW3.js → chunk-D2E44ODB.js} +29 -15
- package/dist/{chunk-UOTYAPV5.js → chunk-F4ZTPKZL.js} +3 -3
- package/dist/{chunk-53VTY5CC.js → chunk-FQM37C56.js} +352 -162
- package/dist/{chunk-HB4C27KU.js → chunk-HCSJHRC4.js} +1 -1
- package/dist/{chunk-7KSLPY56.js → chunk-HRCR53OW.js} +11 -1
- package/dist/{chunk-O7OLVVBR.js → chunk-Q47ZN2DW.js} +24 -22
- package/dist/{chunk-DQTV6QVS.js → chunk-QGH4NAQO.js} +53 -2
- package/dist/{chunk-QVXLKFUQ.js → chunk-RNY5LJXJ.js} +1 -1
- package/dist/{chunk-FUQASYEW.js → chunk-SGJHVPHC.js} +2 -2
- package/dist/{chunk-6O37FCX4.js → chunk-V3FGTQUE.js} +37 -2
- package/dist/{chunk-HUG25TT3.js → chunk-XZKGRSIO.js} +2745 -1644
- package/dist/{chunk-7LM6I3NA.js → chunk-Y53Q55H5.js} +522 -24
- package/dist/components/index.cjs +4614 -2858
- package/dist/components/index.d.ts +122 -53
- package/dist/components/index.js +16 -17
- package/dist/context/index.cjs +38 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.js +3 -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 +16 -1
- package/dist/hooks/index.d.ts +10 -1
- package/dist/hooks/index.js +3 -4
- package/dist/lib/drawable/three/index.cjs +444 -82
- package/dist/lib/drawable/three/index.d.ts +4 -4
- package/dist/lib/drawable/three/index.js +28 -24
- package/dist/lib/index.cjs +53 -3
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +4 -4
- package/dist/locales/index.cjs +33 -3
- package/dist/locales/index.js +23 -3
- package/dist/providers/index.cjs +4987 -3183
- package/dist/providers/index.d.ts +2 -2
- package/dist/providers/index.js +14 -11
- package/dist/runtime/index.cjs +8973 -7000
- package/dist/runtime/index.d.ts +28 -6
- package/dist/runtime/index.js +16 -13
- package/dist/ssr/index.cjs +26 -9
- package/dist/ssr/index.js +26 -9
- package/dist/{themeTokens-Ccu7EmGY.d.ts → themeTokens-D6MFwKrC.d.ts} +6 -2
- package/locales/ar.json +11 -1
- package/locales/en.json +11 -1
- package/locales/sl.json +11 -1
- package/package.json +8 -7
- package/scripts/audit-tailwind-safelist.ts +21 -1
- package/scripts/theme-contrast-audit.mjs +20 -1
- package/tailwind-preset.cjs +5 -6
- package/themes/_base.css +61 -0
- package/themes/_contract.md +37 -0
- package/themes/_fonts.css +6 -4
- package/themes/_presets.css +2 -0
- package/themes/almadar-heritage.css +455 -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 +455 -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-7QEWUTW3.js +0 -5
- package/dist/chunk-E37BYSXY.js +0 -51
package/dist/avl/index.js
CHANGED
|
@@ -1,648 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { BrowserPlayground, collectEmbeddedTraits } from '../chunk-53VTY5CC.js';
|
|
6
|
-
import '../chunk-DQTV6QVS.js';
|
|
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';
|
|
7
5
|
import '../chunk-VHTJRS2N.js';
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import { avlSeries, STATE_COLORS, Box, HStack, VStack, avlTint, CONNECTION_COLORS, parseTraitLevel,
|
|
12
|
-
export { CONNECTION_COLORS, EFFECT_CATEGORY_COLORS, OPERATOR_CATEGORY_COLORS, STATE_COLORS, effectCategoryOf, getStateRole, parseApplicationLevel, parseOrbitalLevel, parseTraitLevel, parseTransitionLevel, traitLevelFromTrait } from '../chunk-
|
|
13
|
-
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';
|
|
14
12
|
import { usePrefersReducedMotion, useMediaQuery } from '../chunk-JRW33U35.js';
|
|
15
13
|
import '../chunk-XJTHMW4G.js';
|
|
16
14
|
import { useEventBus } from '../chunk-6EV3OEBQ.js';
|
|
17
|
-
import '../chunk-PEST66PN.js';
|
|
18
15
|
import { profilerOnRender, perfStart, perfEnd } from '../chunk-KQXXO42S.js';
|
|
19
|
-
import { isEditableTarget } from '../chunk-
|
|
20
|
-
import {
|
|
21
|
-
import '../chunk-
|
|
22
|
-
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
|
+
import '../chunk-PQKU62LK.js';
|
|
21
|
+
import '../chunk-PEST66PN.js';
|
|
23
22
|
import '../chunk-QPXIAUJD.js';
|
|
24
|
-
import {
|
|
25
|
-
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';
|
|
26
24
|
import { FieldTypeSchema, EFFECT_OPERATORS, isInlineTrait, isPageReference, navigatePatternPath, isAriaRole, formatSExpr, answerToMutations, isBinding } from '@almadar/core';
|
|
27
25
|
import { operatorVisualForm, getStdOperatorMeta } from '@almadar/std/registry';
|
|
28
26
|
import { useTranslate } from '@almadar/ui/hooks';
|
|
27
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
29
28
|
import { MarkerType, Handle, Position, useReactFlow, NodeResizeControl, ResizeControlVariant, getBezierPath, EdgeLabelRenderer, BaseEdge, ReactFlow, Controls, Background, BackgroundVariant, ReactFlowProvider, useNodesState, useEdgesState, useNodesInitialized } from '@xyflow/react';
|
|
30
29
|
import { renderUiEntriesOf, getPatternDefinition, isEntityAwarePattern, eventKeyPropsOf, eventListPropsOf } from '@almadar/core/patterns';
|
|
31
30
|
import { createLogger } from '@almadar/logger';
|
|
32
31
|
import { useDroppable, useDraggable, DndContext, DragOverlay } from '@dnd-kit/core';
|
|
33
32
|
|
|
34
|
-
var AvlOrbital = ({
|
|
35
|
-
cx = 0,
|
|
36
|
-
cy = 0,
|
|
37
|
-
r = 80,
|
|
38
|
-
label,
|
|
39
|
-
color = "var(--color-primary)",
|
|
40
|
-
opacity = 1,
|
|
41
|
-
className
|
|
42
|
-
}) => {
|
|
43
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
44
|
-
/* @__PURE__ */ jsx(
|
|
45
|
-
"circle",
|
|
46
|
-
{
|
|
47
|
-
cx,
|
|
48
|
-
cy,
|
|
49
|
-
r,
|
|
50
|
-
fill: "none",
|
|
51
|
-
stroke: color,
|
|
52
|
-
strokeWidth: 2
|
|
53
|
-
}
|
|
54
|
-
),
|
|
55
|
-
/* @__PURE__ */ jsx(
|
|
56
|
-
"circle",
|
|
57
|
-
{
|
|
58
|
-
cx,
|
|
59
|
-
cy,
|
|
60
|
-
r,
|
|
61
|
-
fill: color,
|
|
62
|
-
opacity: 0.03
|
|
63
|
-
}
|
|
64
|
-
),
|
|
65
|
-
label && /* @__PURE__ */ jsx(
|
|
66
|
-
"text",
|
|
67
|
-
{
|
|
68
|
-
x: cx,
|
|
69
|
-
y: cy - r - 8,
|
|
70
|
-
textAnchor: "middle",
|
|
71
|
-
fill: color,
|
|
72
|
-
fontSize: 11,
|
|
73
|
-
fontFamily: "inherit",
|
|
74
|
-
fontWeight: "bold",
|
|
75
|
-
children: label
|
|
76
|
-
}
|
|
77
|
-
)
|
|
78
|
-
] });
|
|
79
|
-
};
|
|
80
|
-
AvlOrbital.displayName = "AvlOrbital";
|
|
81
|
-
var AvlTrait = ({
|
|
82
|
-
cx = 0,
|
|
83
|
-
cy = 0,
|
|
84
|
-
rx = 60,
|
|
85
|
-
ry = 30,
|
|
86
|
-
rotation = 0,
|
|
87
|
-
label,
|
|
88
|
-
color = "var(--color-primary)",
|
|
89
|
-
opacity = 1,
|
|
90
|
-
className
|
|
91
|
-
}) => {
|
|
92
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, transform: `rotate(${rotation},${cx},${cy})`, children: [
|
|
93
|
-
/* @__PURE__ */ jsx(
|
|
94
|
-
"ellipse",
|
|
95
|
-
{
|
|
96
|
-
cx,
|
|
97
|
-
cy,
|
|
98
|
-
rx,
|
|
99
|
-
ry,
|
|
100
|
-
fill: "none",
|
|
101
|
-
stroke: color,
|
|
102
|
-
strokeWidth: 1.5,
|
|
103
|
-
strokeDasharray: "4 2"
|
|
104
|
-
}
|
|
105
|
-
),
|
|
106
|
-
label && /* @__PURE__ */ jsx(
|
|
107
|
-
"text",
|
|
108
|
-
{
|
|
109
|
-
x: cx - rx - 6,
|
|
110
|
-
y: cy,
|
|
111
|
-
textAnchor: "end",
|
|
112
|
-
dominantBaseline: "central",
|
|
113
|
-
fill: color,
|
|
114
|
-
fontSize: 9,
|
|
115
|
-
fontFamily: "inherit",
|
|
116
|
-
opacity: 0.8,
|
|
117
|
-
transform: `rotate(${-rotation},${cx - rx - 6},${cy})`,
|
|
118
|
-
children: label
|
|
119
|
-
}
|
|
120
|
-
)
|
|
121
|
-
] });
|
|
122
|
-
};
|
|
123
|
-
AvlTrait.displayName = "AvlTrait";
|
|
124
|
-
var AvlApplication = ({
|
|
125
|
-
x = 0,
|
|
126
|
-
y = 0,
|
|
127
|
-
width = 500,
|
|
128
|
-
height = 350,
|
|
129
|
-
label,
|
|
130
|
-
color = "var(--color-primary)",
|
|
131
|
-
opacity = 1,
|
|
132
|
-
className
|
|
133
|
-
}) => {
|
|
134
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
135
|
-
/* @__PURE__ */ jsx(
|
|
136
|
-
"rect",
|
|
137
|
-
{
|
|
138
|
-
x,
|
|
139
|
-
y,
|
|
140
|
-
width,
|
|
141
|
-
height,
|
|
142
|
-
rx: 12,
|
|
143
|
-
ry: 12,
|
|
144
|
-
fill: "none",
|
|
145
|
-
stroke: color,
|
|
146
|
-
strokeWidth: 3
|
|
147
|
-
}
|
|
148
|
-
),
|
|
149
|
-
/* @__PURE__ */ jsx(
|
|
150
|
-
"rect",
|
|
151
|
-
{
|
|
152
|
-
x,
|
|
153
|
-
y,
|
|
154
|
-
width,
|
|
155
|
-
height,
|
|
156
|
-
rx: 12,
|
|
157
|
-
ry: 12,
|
|
158
|
-
fill: color,
|
|
159
|
-
opacity: 0.02
|
|
160
|
-
}
|
|
161
|
-
),
|
|
162
|
-
label && /* @__PURE__ */ jsx(
|
|
163
|
-
"text",
|
|
164
|
-
{
|
|
165
|
-
x: x + 16,
|
|
166
|
-
y: y + 20,
|
|
167
|
-
fill: color,
|
|
168
|
-
fontSize: 12,
|
|
169
|
-
fontFamily: "inherit",
|
|
170
|
-
fontWeight: "bold",
|
|
171
|
-
children: label
|
|
172
|
-
}
|
|
173
|
-
)
|
|
174
|
-
] });
|
|
175
|
-
};
|
|
176
|
-
AvlApplication.displayName = "AvlApplication";
|
|
177
|
-
var avlTransitionId = 0;
|
|
178
|
-
var AvlTransition = ({
|
|
179
|
-
x1,
|
|
180
|
-
y1,
|
|
181
|
-
x2,
|
|
182
|
-
y2,
|
|
183
|
-
curved = false,
|
|
184
|
-
curveAwayFrom,
|
|
185
|
-
label,
|
|
186
|
-
color = "var(--color-primary)",
|
|
187
|
-
opacity = 1,
|
|
188
|
-
className
|
|
189
|
-
}) => {
|
|
190
|
-
const ids = React19.useMemo(() => {
|
|
191
|
-
avlTransitionId += 1;
|
|
192
|
-
return { arrow: `avl-tr-${avlTransitionId}-arrow` };
|
|
193
|
-
}, []);
|
|
194
|
-
const mx = (x1 + x2) / 2;
|
|
195
|
-
const my = (y1 + y2) / 2;
|
|
196
|
-
const dx = x2 - x1;
|
|
197
|
-
const dy = y2 - y1;
|
|
198
|
-
const len = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
199
|
-
const curvature = len * 0.2;
|
|
200
|
-
let perpX = -dy / len;
|
|
201
|
-
let perpY = dx / len;
|
|
202
|
-
if (curveAwayFrom) {
|
|
203
|
-
const testX = mx + perpX * curvature;
|
|
204
|
-
const testY = my + perpY * curvature;
|
|
205
|
-
const distTest = Math.sqrt((testX - curveAwayFrom.x) ** 2 + (testY - curveAwayFrom.y) ** 2);
|
|
206
|
-
const distMid = Math.sqrt((mx - curveAwayFrom.x) ** 2 + (my - curveAwayFrom.y) ** 2);
|
|
207
|
-
if (distTest < distMid) {
|
|
208
|
-
perpX = -perpX;
|
|
209
|
-
perpY = -perpY;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
const cpx = mx + perpX * curvature;
|
|
213
|
-
const cpy = my + perpY * curvature;
|
|
214
|
-
const d = curved ? `M${x1},${y1} Q${cpx},${cpy} ${x2},${y2}` : `M${x1},${y1} L${x2},${y2}`;
|
|
215
|
-
const labelX = curved ? (x1 + 2 * cpx + x2) / 4 : mx;
|
|
216
|
-
const labelY = curved ? (y1 + 2 * cpy + y2) / 4 : my;
|
|
217
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
218
|
-
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
|
|
219
|
-
"marker",
|
|
220
|
-
{
|
|
221
|
-
id: ids.arrow,
|
|
222
|
-
markerWidth: "8",
|
|
223
|
-
markerHeight: "6",
|
|
224
|
-
refX: "7",
|
|
225
|
-
refY: "3",
|
|
226
|
-
orient: "auto",
|
|
227
|
-
markerUnits: "strokeWidth",
|
|
228
|
-
children: /* @__PURE__ */ jsx("path", { d: "M0,0 L8,3 L0,6 Z", fill: color })
|
|
229
|
-
}
|
|
230
|
-
) }),
|
|
231
|
-
/* @__PURE__ */ jsx(
|
|
232
|
-
"path",
|
|
233
|
-
{
|
|
234
|
-
d,
|
|
235
|
-
fill: "none",
|
|
236
|
-
stroke: color,
|
|
237
|
-
strokeWidth: 1.5,
|
|
238
|
-
markerEnd: `url(#${ids.arrow})`
|
|
239
|
-
}
|
|
240
|
-
),
|
|
241
|
-
label && /* @__PURE__ */ jsx(
|
|
242
|
-
"text",
|
|
243
|
-
{
|
|
244
|
-
x: labelX,
|
|
245
|
-
y: labelY - 6,
|
|
246
|
-
textAnchor: "middle",
|
|
247
|
-
fill: color,
|
|
248
|
-
fontSize: 9,
|
|
249
|
-
fontFamily: "inherit",
|
|
250
|
-
opacity: 0.8,
|
|
251
|
-
children: label
|
|
252
|
-
}
|
|
253
|
-
)
|
|
254
|
-
] });
|
|
255
|
-
};
|
|
256
|
-
AvlTransition.displayName = "AvlTransition";
|
|
257
|
-
var AvlEvent = ({
|
|
258
|
-
x = 0,
|
|
259
|
-
y = 0,
|
|
260
|
-
size: size2 = 16,
|
|
261
|
-
label,
|
|
262
|
-
color = "var(--color-primary)",
|
|
263
|
-
opacity = 1,
|
|
264
|
-
className
|
|
265
|
-
}) => {
|
|
266
|
-
const s = size2 / 16;
|
|
267
|
-
const bolt = [
|
|
268
|
-
`M${x - 2 * s},${y - 8 * s}`,
|
|
269
|
-
`L${x + 4 * s},${y - 8 * s}`,
|
|
270
|
-
`L${x + 1 * s},${y - 1 * s}`,
|
|
271
|
-
`L${x + 5 * s},${y - 1 * s}`,
|
|
272
|
-
`L${x - 3 * s},${y + 8 * s}`,
|
|
273
|
-
`L${x},${y + 1 * s}`,
|
|
274
|
-
`L${x - 4 * s},${y + 1 * s}`,
|
|
275
|
-
"Z"
|
|
276
|
-
].join(" ");
|
|
277
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
278
|
-
/* @__PURE__ */ jsx("path", { d: bolt, fill: color }),
|
|
279
|
-
label && /* @__PURE__ */ jsx(
|
|
280
|
-
"text",
|
|
281
|
-
{
|
|
282
|
-
x,
|
|
283
|
-
y: y + size2 / 2 + 12,
|
|
284
|
-
textAnchor: "middle",
|
|
285
|
-
fill: color,
|
|
286
|
-
fontSize: 9,
|
|
287
|
-
fontFamily: "inherit",
|
|
288
|
-
children: label
|
|
289
|
-
}
|
|
290
|
-
)
|
|
291
|
-
] });
|
|
292
|
-
};
|
|
293
|
-
AvlEvent.displayName = "AvlEvent";
|
|
294
|
-
var AvlGuard = ({
|
|
295
|
-
x = 0,
|
|
296
|
-
y = 0,
|
|
297
|
-
size: size2 = 24,
|
|
298
|
-
label,
|
|
299
|
-
color = "var(--color-primary)",
|
|
300
|
-
opacity = 1,
|
|
301
|
-
className
|
|
302
|
-
}) => {
|
|
303
|
-
const h = size2 / 2;
|
|
304
|
-
const points = `${x},${y - h} ${x + h},${y} ${x},${y + h} ${x - h},${y}`;
|
|
305
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
306
|
-
/* @__PURE__ */ jsx(
|
|
307
|
-
"polygon",
|
|
308
|
-
{
|
|
309
|
-
points,
|
|
310
|
-
fill: "none",
|
|
311
|
-
stroke: color,
|
|
312
|
-
strokeWidth: 2,
|
|
313
|
-
strokeLinejoin: "round"
|
|
314
|
-
}
|
|
315
|
-
),
|
|
316
|
-
label && /* @__PURE__ */ jsx(
|
|
317
|
-
"text",
|
|
318
|
-
{
|
|
319
|
-
x,
|
|
320
|
-
y,
|
|
321
|
-
textAnchor: "middle",
|
|
322
|
-
dominantBaseline: "central",
|
|
323
|
-
fill: color,
|
|
324
|
-
fontSize: 8,
|
|
325
|
-
fontFamily: "inherit",
|
|
326
|
-
children: label
|
|
327
|
-
}
|
|
328
|
-
)
|
|
329
|
-
] });
|
|
330
|
-
};
|
|
331
|
-
AvlGuard.displayName = "AvlGuard";
|
|
332
|
-
var AvlField = ({
|
|
333
|
-
x = 0,
|
|
334
|
-
y = 0,
|
|
335
|
-
angle = 0,
|
|
336
|
-
length = 30,
|
|
337
|
-
required = true,
|
|
338
|
-
label,
|
|
339
|
-
color = "var(--color-primary)",
|
|
340
|
-
opacity = 1,
|
|
341
|
-
className
|
|
342
|
-
}) => {
|
|
343
|
-
const x2 = x + length * Math.cos(angle);
|
|
344
|
-
const y2 = y + length * Math.sin(angle);
|
|
345
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
346
|
-
/* @__PURE__ */ jsx(
|
|
347
|
-
"line",
|
|
348
|
-
{
|
|
349
|
-
x1: x,
|
|
350
|
-
y1: y,
|
|
351
|
-
x2,
|
|
352
|
-
y2,
|
|
353
|
-
stroke: color,
|
|
354
|
-
strokeWidth: 1.5,
|
|
355
|
-
strokeDasharray: required ? void 0 : "3 2"
|
|
356
|
-
}
|
|
357
|
-
),
|
|
358
|
-
/* @__PURE__ */ jsx("circle", { cx: x2, cy: y2, r: 2.5, fill: color, opacity: 0.6 }),
|
|
359
|
-
label && /* @__PURE__ */ jsx(
|
|
360
|
-
"text",
|
|
361
|
-
{
|
|
362
|
-
x: x2 + 6 * Math.cos(angle),
|
|
363
|
-
y: y2 + 6 * Math.sin(angle),
|
|
364
|
-
textAnchor: Math.cos(angle) >= 0 ? "start" : "end",
|
|
365
|
-
dominantBaseline: "central",
|
|
366
|
-
fill: color,
|
|
367
|
-
fontSize: 8,
|
|
368
|
-
fontFamily: "inherit",
|
|
369
|
-
opacity: 0.7,
|
|
370
|
-
children: label
|
|
371
|
-
}
|
|
372
|
-
)
|
|
373
|
-
] });
|
|
374
|
-
};
|
|
375
|
-
AvlField.displayName = "AvlField";
|
|
376
|
-
var AvlBinding = ({
|
|
377
|
-
x1,
|
|
378
|
-
y1,
|
|
379
|
-
x2,
|
|
380
|
-
y2,
|
|
381
|
-
label,
|
|
382
|
-
color = "var(--color-primary)",
|
|
383
|
-
opacity = 1,
|
|
384
|
-
className
|
|
385
|
-
}) => {
|
|
386
|
-
const mx = (x1 + x2) / 2;
|
|
387
|
-
const my = (y1 + y2) / 2;
|
|
388
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
389
|
-
/* @__PURE__ */ jsx(
|
|
390
|
-
"line",
|
|
391
|
-
{
|
|
392
|
-
x1,
|
|
393
|
-
y1,
|
|
394
|
-
x2,
|
|
395
|
-
y2,
|
|
396
|
-
stroke: color,
|
|
397
|
-
strokeWidth: 1,
|
|
398
|
-
strokeDasharray: "2 3",
|
|
399
|
-
opacity: 0.6
|
|
400
|
-
}
|
|
401
|
-
),
|
|
402
|
-
/* @__PURE__ */ jsx(
|
|
403
|
-
"text",
|
|
404
|
-
{
|
|
405
|
-
x: mx,
|
|
406
|
-
y: my - 4,
|
|
407
|
-
textAnchor: "middle",
|
|
408
|
-
fill: color,
|
|
409
|
-
fontSize: 10,
|
|
410
|
-
fontFamily: "inherit",
|
|
411
|
-
fontWeight: "bold",
|
|
412
|
-
children: "@"
|
|
413
|
-
}
|
|
414
|
-
),
|
|
415
|
-
label && /* @__PURE__ */ jsx(
|
|
416
|
-
"text",
|
|
417
|
-
{
|
|
418
|
-
x: mx,
|
|
419
|
-
y: my + 10,
|
|
420
|
-
textAnchor: "middle",
|
|
421
|
-
fill: color,
|
|
422
|
-
fontSize: 8,
|
|
423
|
-
fontFamily: "inherit",
|
|
424
|
-
opacity: 0.6,
|
|
425
|
-
children: label
|
|
426
|
-
}
|
|
427
|
-
)
|
|
428
|
-
] });
|
|
429
|
-
};
|
|
430
|
-
AvlBinding.displayName = "AvlBinding";
|
|
431
|
-
var PERSISTENCE_STROKE = {
|
|
432
|
-
persistent: { strokeWidth: 2.5 },
|
|
433
|
-
runtime: { strokeDasharray: "6 3", strokeWidth: 2 }
|
|
434
|
-
};
|
|
435
|
-
var AvlPersistence = ({
|
|
436
|
-
x = 0,
|
|
437
|
-
y = 0,
|
|
438
|
-
kind,
|
|
439
|
-
size: size2 = 20,
|
|
440
|
-
label,
|
|
441
|
-
color = "var(--color-primary)",
|
|
442
|
-
opacity = 1,
|
|
443
|
-
className
|
|
444
|
-
}) => {
|
|
445
|
-
const half = size2 / 2;
|
|
446
|
-
const strokeProps = PERSISTENCE_STROKE[kind];
|
|
447
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
448
|
-
/* @__PURE__ */ jsx(
|
|
449
|
-
"line",
|
|
450
|
-
{
|
|
451
|
-
x1: x - half,
|
|
452
|
-
y1: y,
|
|
453
|
-
x2: x + half,
|
|
454
|
-
y2: y,
|
|
455
|
-
stroke: color,
|
|
456
|
-
strokeWidth: strokeProps.strokeWidth,
|
|
457
|
-
strokeDasharray: strokeProps.strokeDasharray,
|
|
458
|
-
strokeLinecap: "round"
|
|
459
|
-
}
|
|
460
|
-
),
|
|
461
|
-
label && /* @__PURE__ */ jsx(
|
|
462
|
-
"text",
|
|
463
|
-
{
|
|
464
|
-
x,
|
|
465
|
-
y: y + 14,
|
|
466
|
-
textAnchor: "middle",
|
|
467
|
-
fill: color,
|
|
468
|
-
fontSize: 8,
|
|
469
|
-
fontFamily: "inherit",
|
|
470
|
-
opacity: 0.7,
|
|
471
|
-
children: label
|
|
472
|
-
}
|
|
473
|
-
)
|
|
474
|
-
] });
|
|
475
|
-
};
|
|
476
|
-
AvlPersistence.displayName = "AvlPersistence";
|
|
477
|
-
var AvlOperator = ({
|
|
478
|
-
x = 0,
|
|
479
|
-
y = 0,
|
|
480
|
-
name,
|
|
481
|
-
namespace = "arithmetic",
|
|
482
|
-
size: size2 = 16,
|
|
483
|
-
color,
|
|
484
|
-
opacity = 1,
|
|
485
|
-
className
|
|
486
|
-
}) => {
|
|
487
|
-
const opColor2 = color ?? OPERATOR_CATEGORY_COLORS[namespace];
|
|
488
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
489
|
-
/* @__PURE__ */ jsx(
|
|
490
|
-
"rect",
|
|
491
|
-
{
|
|
492
|
-
x: x - size2,
|
|
493
|
-
y: y - size2 * 0.7,
|
|
494
|
-
width: size2 * 2,
|
|
495
|
-
height: size2 * 1.4,
|
|
496
|
-
rx: 4,
|
|
497
|
-
ry: 4,
|
|
498
|
-
fill: opColor2,
|
|
499
|
-
fillOpacity: 0.15,
|
|
500
|
-
stroke: opColor2,
|
|
501
|
-
strokeWidth: 1.5
|
|
502
|
-
}
|
|
503
|
-
),
|
|
504
|
-
/* @__PURE__ */ jsx(
|
|
505
|
-
"text",
|
|
506
|
-
{
|
|
507
|
-
x,
|
|
508
|
-
y: y + 1,
|
|
509
|
-
textAnchor: "middle",
|
|
510
|
-
dominantBaseline: "central",
|
|
511
|
-
fill: opColor2,
|
|
512
|
-
fontSize: size2 > 14 ? 10 : 8,
|
|
513
|
-
fontFamily: "inherit",
|
|
514
|
-
fontWeight: "bold",
|
|
515
|
-
children: name
|
|
516
|
-
}
|
|
517
|
-
)
|
|
518
|
-
] });
|
|
519
|
-
};
|
|
520
|
-
AvlOperator.displayName = "AvlOperator";
|
|
521
|
-
var AvlSExpr = ({
|
|
522
|
-
x = 0,
|
|
523
|
-
y = 0,
|
|
524
|
-
width = 140,
|
|
525
|
-
height = 80,
|
|
526
|
-
label,
|
|
527
|
-
color = "var(--color-primary)",
|
|
528
|
-
opacity = 1,
|
|
529
|
-
className
|
|
530
|
-
}) => {
|
|
531
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
532
|
-
/* @__PURE__ */ jsx(
|
|
533
|
-
"rect",
|
|
534
|
-
{
|
|
535
|
-
x,
|
|
536
|
-
y,
|
|
537
|
-
width,
|
|
538
|
-
height,
|
|
539
|
-
rx: 6,
|
|
540
|
-
ry: 6,
|
|
541
|
-
fill: color,
|
|
542
|
-
fillOpacity: 0.05,
|
|
543
|
-
stroke: color,
|
|
544
|
-
strokeWidth: 1,
|
|
545
|
-
strokeDasharray: "6 3"
|
|
546
|
-
}
|
|
547
|
-
),
|
|
548
|
-
/* @__PURE__ */ jsx("circle", { cx: x + 12, cy: y + 12, r: 3, fill: color, opacity: 0.4 }),
|
|
549
|
-
/* @__PURE__ */ jsx("line", { x1: x + 12, y1: y + 15, x2: x + 8, y2: y + 22, stroke: color, strokeWidth: 0.8, opacity: 0.3 }),
|
|
550
|
-
/* @__PURE__ */ jsx("line", { x1: x + 12, y1: y + 15, x2: x + 16, y2: y + 22, stroke: color, strokeWidth: 0.8, opacity: 0.3 }),
|
|
551
|
-
label && /* @__PURE__ */ jsx(
|
|
552
|
-
"text",
|
|
553
|
-
{
|
|
554
|
-
x: x + width / 2,
|
|
555
|
-
y: y + height / 2,
|
|
556
|
-
textAnchor: "middle",
|
|
557
|
-
dominantBaseline: "central",
|
|
558
|
-
fill: color,
|
|
559
|
-
fontSize: 9,
|
|
560
|
-
fontFamily: "inherit",
|
|
561
|
-
opacity: 0.6,
|
|
562
|
-
children: label
|
|
563
|
-
}
|
|
564
|
-
)
|
|
565
|
-
] });
|
|
566
|
-
};
|
|
567
|
-
AvlSExpr.displayName = "AvlSExpr";
|
|
568
|
-
var AvlLiteral = ({
|
|
569
|
-
x = 0,
|
|
570
|
-
y = 0,
|
|
571
|
-
value,
|
|
572
|
-
size: size2 = 12,
|
|
573
|
-
color = "var(--color-primary)",
|
|
574
|
-
opacity = 1,
|
|
575
|
-
className
|
|
576
|
-
}) => {
|
|
577
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
578
|
-
/* @__PURE__ */ jsx(
|
|
579
|
-
"circle",
|
|
580
|
-
{
|
|
581
|
-
cx: x,
|
|
582
|
-
cy: y,
|
|
583
|
-
r: size2,
|
|
584
|
-
fill: "none",
|
|
585
|
-
stroke: color,
|
|
586
|
-
strokeWidth: 1,
|
|
587
|
-
opacity: 0.5
|
|
588
|
-
}
|
|
589
|
-
),
|
|
590
|
-
/* @__PURE__ */ jsx(
|
|
591
|
-
"text",
|
|
592
|
-
{
|
|
593
|
-
x,
|
|
594
|
-
y: y + 1,
|
|
595
|
-
textAnchor: "middle",
|
|
596
|
-
dominantBaseline: "central",
|
|
597
|
-
fill: color,
|
|
598
|
-
fontSize: size2 > 10 ? 9 : 7,
|
|
599
|
-
fontFamily: "inherit",
|
|
600
|
-
children: value
|
|
601
|
-
}
|
|
602
|
-
)
|
|
603
|
-
] });
|
|
604
|
-
};
|
|
605
|
-
AvlLiteral.displayName = "AvlLiteral";
|
|
606
|
-
var AvlBindingRef = ({
|
|
607
|
-
x = 0,
|
|
608
|
-
y = 0,
|
|
609
|
-
path,
|
|
610
|
-
size: size2 = 12,
|
|
611
|
-
color = "var(--color-primary)",
|
|
612
|
-
opacity = 1,
|
|
613
|
-
className
|
|
614
|
-
}) => {
|
|
615
|
-
const fullLabel = `@${path}`;
|
|
616
|
-
const autoR = Math.max(size2, fullLabel.length * 3.5 + 4);
|
|
617
|
-
return /* @__PURE__ */ jsxs("g", { className, opacity, children: [
|
|
618
|
-
/* @__PURE__ */ jsx(
|
|
619
|
-
"circle",
|
|
620
|
-
{
|
|
621
|
-
cx: x,
|
|
622
|
-
cy: y,
|
|
623
|
-
r: autoR,
|
|
624
|
-
fill: "none",
|
|
625
|
-
stroke: color,
|
|
626
|
-
strokeWidth: 1.5,
|
|
627
|
-
strokeDasharray: "3 2"
|
|
628
|
-
}
|
|
629
|
-
),
|
|
630
|
-
/* @__PURE__ */ jsx(
|
|
631
|
-
"text",
|
|
632
|
-
{
|
|
633
|
-
x,
|
|
634
|
-
y: y + 1,
|
|
635
|
-
textAnchor: "middle",
|
|
636
|
-
dominantBaseline: "central",
|
|
637
|
-
fill: color,
|
|
638
|
-
fontSize: 10,
|
|
639
|
-
fontFamily: "inherit",
|
|
640
|
-
children: fullLabel
|
|
641
|
-
}
|
|
642
|
-
)
|
|
643
|
-
] });
|
|
644
|
-
};
|
|
645
|
-
AvlBindingRef.displayName = "AvlBindingRef";
|
|
646
33
|
var MONO = 7.4;
|
|
647
34
|
var ROW = 40;
|
|
648
35
|
var GAP_X = 112;
|
|
@@ -1225,86 +612,6 @@ var AvlCircuit = ({ expr, trace, cursor, title, showCode = true, className }) =>
|
|
|
1225
612
|
] });
|
|
1226
613
|
};
|
|
1227
614
|
AvlCircuit.displayName = "AvlCircuit";
|
|
1228
|
-
var AVL_GLYPH_KINDS = [
|
|
1229
|
-
"application",
|
|
1230
|
-
"orbital",
|
|
1231
|
-
"entity",
|
|
1232
|
-
"trait",
|
|
1233
|
-
"page",
|
|
1234
|
-
"state",
|
|
1235
|
-
"transition",
|
|
1236
|
-
"event",
|
|
1237
|
-
"guard",
|
|
1238
|
-
"effect",
|
|
1239
|
-
"field",
|
|
1240
|
-
"fieldType",
|
|
1241
|
-
"binding",
|
|
1242
|
-
"bindingRef",
|
|
1243
|
-
"persistence",
|
|
1244
|
-
"operator",
|
|
1245
|
-
"sexpr",
|
|
1246
|
-
"literal"
|
|
1247
|
-
];
|
|
1248
|
-
var HEIGHT = { sm: 32, md: 56, lg: 88 };
|
|
1249
|
-
var PAD2 = 6;
|
|
1250
|
-
function Symbol({ kind, label, effectType, fieldType, persistence, namespace }) {
|
|
1251
|
-
switch (kind) {
|
|
1252
|
-
case "application":
|
|
1253
|
-
return /* @__PURE__ */ jsx(AvlApplication, { width: 120, height: 80 });
|
|
1254
|
-
case "orbital":
|
|
1255
|
-
return /* @__PURE__ */ jsx(AvlOrbital, { r: 36 });
|
|
1256
|
-
case "entity":
|
|
1257
|
-
return /* @__PURE__ */ jsx(AvlEntity, { r: 18, fieldCount: 4, persistence: persistence ?? "persistent" });
|
|
1258
|
-
case "trait":
|
|
1259
|
-
return /* @__PURE__ */ jsx(AvlTrait, { rx: 44, ry: 22 });
|
|
1260
|
-
case "page":
|
|
1261
|
-
return /* @__PURE__ */ jsx(AvlPage, { size: 20 });
|
|
1262
|
-
case "state":
|
|
1263
|
-
return /* @__PURE__ */ jsx(AvlState, { width: 96, height: 34 });
|
|
1264
|
-
case "transition":
|
|
1265
|
-
return /* @__PURE__ */ jsx(AvlTransition, { x1: -40, y1: 0, x2: 40, y2: 0 });
|
|
1266
|
-
case "event":
|
|
1267
|
-
return /* @__PURE__ */ jsx(AvlEvent, { size: 20 });
|
|
1268
|
-
case "guard":
|
|
1269
|
-
return /* @__PURE__ */ jsx(AvlGuard, { size: 28 });
|
|
1270
|
-
case "effect":
|
|
1271
|
-
return /* @__PURE__ */ jsx(AvlEffect, { effectType: effectType ?? "set", size: 14 });
|
|
1272
|
-
case "field":
|
|
1273
|
-
return /* @__PURE__ */ jsx(AvlField, { length: 40 });
|
|
1274
|
-
case "fieldType":
|
|
1275
|
-
return /* @__PURE__ */ jsx(AvlFieldType, { kind: fieldType ?? "string", size: 9 });
|
|
1276
|
-
case "binding":
|
|
1277
|
-
return /* @__PURE__ */ jsx(AvlBinding, { x1: -40, y1: 0, x2: 40, y2: 0 });
|
|
1278
|
-
case "bindingRef":
|
|
1279
|
-
return /* @__PURE__ */ jsx(AvlBindingRef, { path: label ?? "entity.id", size: 14 });
|
|
1280
|
-
case "persistence":
|
|
1281
|
-
return /* @__PURE__ */ jsx(AvlPersistence, { kind: persistence ?? "persistent", size: 24 });
|
|
1282
|
-
case "operator":
|
|
1283
|
-
return /* @__PURE__ */ jsx(AvlOperator, { name: label ?? "+", namespace: namespace ?? "arithmetic", size: 20 });
|
|
1284
|
-
case "sexpr":
|
|
1285
|
-
return /* @__PURE__ */ jsx(AvlSExpr, { width: 110, height: 60 });
|
|
1286
|
-
case "literal":
|
|
1287
|
-
return /* @__PURE__ */ jsx(AvlLiteral, { value: label ?? "42", size: 14 });
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
var AvlGlyph = ({ kind, label, size: size2 = "md", showCaption = true, className, effectType, fieldType, persistence, namespace, ...rest }) => {
|
|
1291
|
-
const variant = { effectType, fieldType, persistence, namespace };
|
|
1292
|
-
const { t } = useTranslate();
|
|
1293
|
-
const groupRef = useRef(null);
|
|
1294
|
-
const [box, setBox] = useState({ x: -50, y: -50, w: 100, h: 100 });
|
|
1295
|
-
useLayoutEffect(() => {
|
|
1296
|
-
const g = groupRef.current;
|
|
1297
|
-
if (!g || typeof g.getBBox !== "function") return;
|
|
1298
|
-
const b = g.getBBox();
|
|
1299
|
-
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 });
|
|
1300
|
-
}, [kind, label, variant.effectType, variant.fieldType, variant.persistence, variant.namespace]);
|
|
1301
|
-
const height = HEIGHT[size2];
|
|
1302
|
-
return /* @__PURE__ */ jsxs(Box, { ...domPassthrough(rest), "data-testid": "avl-glyph", "data-kind": kind, className: `inline-flex flex-col items-center gap-1 ${className ?? ""}`, children: [
|
|
1303
|
-
/* @__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 }) }) }),
|
|
1304
|
-
showCaption ? /* @__PURE__ */ jsx(Box, { "data-testid": "avl-glyph-caption", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: label ?? t(`avl.glyph.${kind}`) }) }) : null
|
|
1305
|
-
] });
|
|
1306
|
-
};
|
|
1307
|
-
AvlGlyph.displayName = "AvlGlyph";
|
|
1308
615
|
var avlOuId = 0;
|
|
1309
616
|
var AvlOrbitalUnit = ({
|
|
1310
617
|
entityName,
|
|
@@ -1316,7 +623,7 @@ var AvlOrbitalUnit = ({
|
|
|
1316
623
|
color = "var(--color-primary)",
|
|
1317
624
|
animated = false
|
|
1318
625
|
}) => {
|
|
1319
|
-
const ids =
|
|
626
|
+
const ids = React17.useMemo(() => {
|
|
1320
627
|
avlOuId += 1;
|
|
1321
628
|
const base = `avl-ou-${avlOuId}`;
|
|
1322
629
|
return { glow: `${base}-glow`, grad: `${base}-grad` };
|
|
@@ -1473,7 +780,7 @@ var AvlClosedCircuit = ({
|
|
|
1473
780
|
color = "var(--color-primary)",
|
|
1474
781
|
animated = false
|
|
1475
782
|
}) => {
|
|
1476
|
-
const ids =
|
|
783
|
+
const ids = React17.useMemo(() => {
|
|
1477
784
|
avlCcId += 1;
|
|
1478
785
|
const base = `avl-cc-${avlCcId}`;
|
|
1479
786
|
return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
|
|
@@ -1626,7 +933,7 @@ var AvlEmitListen = ({
|
|
|
1626
933
|
color = "var(--color-primary)",
|
|
1627
934
|
animated = false
|
|
1628
935
|
}) => {
|
|
1629
|
-
const ids =
|
|
936
|
+
const ids = React17.useMemo(() => {
|
|
1630
937
|
avlElId += 1;
|
|
1631
938
|
const base = `avl-el-${avlElId}`;
|
|
1632
939
|
return { arrow: `${base}-arrow`, grad: `${base}-grad` };
|
|
@@ -1900,7 +1207,7 @@ function renderNode(node, color, glowId) {
|
|
|
1900
1207
|
const baseR = node.type === "operator" ? 20 : 16;
|
|
1901
1208
|
const r = Math.max(baseR, labelLen * 3.5 + 6);
|
|
1902
1209
|
const nc = nodeColor(node.type, color);
|
|
1903
|
-
return /* @__PURE__ */ jsxs(
|
|
1210
|
+
return /* @__PURE__ */ jsxs(React17.Fragment, { children: [
|
|
1904
1211
|
node.children.map((child, i) => {
|
|
1905
1212
|
const childR = Math.max(
|
|
1906
1213
|
child.type === "operator" ? 20 : 16,
|
|
@@ -1957,7 +1264,7 @@ var AvlExprTree = ({
|
|
|
1957
1264
|
className,
|
|
1958
1265
|
color = "var(--color-primary)"
|
|
1959
1266
|
}) => {
|
|
1960
|
-
const ids =
|
|
1267
|
+
const ids = React17.useMemo(() => {
|
|
1961
1268
|
avlEtId += 1;
|
|
1962
1269
|
return { glow: `avl-et-${avlEtId}-glow` };
|
|
1963
1270
|
}, []);
|
|
@@ -2788,14 +2095,14 @@ var SystemNodeInner = ({ data }) => {
|
|
|
2788
2095
|
}
|
|
2789
2096
|
);
|
|
2790
2097
|
};
|
|
2791
|
-
var SystemNode =
|
|
2098
|
+
var SystemNode = React17.memo(SystemNodeInner);
|
|
2792
2099
|
SystemNode.displayName = "SystemNode";
|
|
2793
2100
|
var SystemBandNodeInner = ({ data }) => {
|
|
2794
2101
|
const d = data;
|
|
2795
2102
|
const { t } = useTranslate();
|
|
2796
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 }) }) });
|
|
2797
2104
|
};
|
|
2798
|
-
var SystemBandNode =
|
|
2105
|
+
var SystemBandNode = React17.memo(SystemBandNodeInner);
|
|
2799
2106
|
SystemBandNode.displayName = "SystemBandNode";
|
|
2800
2107
|
var DEPENDENCY_ROLE_CLASS = {
|
|
2801
2108
|
selected: "border-primary bg-primary/25 text-foreground ring-2 ring-primary/40",
|
|
@@ -2853,14 +2160,14 @@ var DependencyNodeInner = ({ id, data }) => {
|
|
|
2853
2160
|
}
|
|
2854
2161
|
);
|
|
2855
2162
|
};
|
|
2856
|
-
var DependencyNode =
|
|
2163
|
+
var DependencyNode = React17.memo(DependencyNodeInner);
|
|
2857
2164
|
DependencyNode.displayName = "DependencyNode";
|
|
2858
2165
|
var DependencyColumnNodeInner = ({ data }) => {
|
|
2859
2166
|
const d = data;
|
|
2860
2167
|
const { t } = useTranslate();
|
|
2861
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"}`) }) });
|
|
2862
2169
|
};
|
|
2863
|
-
var DependencyColumnNode =
|
|
2170
|
+
var DependencyColumnNode = React17.memo(DependencyColumnNodeInner);
|
|
2864
2171
|
DependencyColumnNode.displayName = "DependencyColumnNode";
|
|
2865
2172
|
var DetailView = ({ data }) => {
|
|
2866
2173
|
const { t } = useTranslate();
|
|
@@ -4102,11 +3409,11 @@ function marqueeHits(marquee, boxes) {
|
|
|
4102
3409
|
);
|
|
4103
3410
|
}
|
|
4104
3411
|
function axisPositionFrom(axis, constraint, offset) {
|
|
4105
|
-
const start =
|
|
4106
|
-
const end =
|
|
3412
|
+
const start = axis === "x" ? offset.left : offset.top;
|
|
3413
|
+
const end = axis === "x" ? offset.right : offset.bottom;
|
|
4107
3414
|
if (constraint === "center") return { constraint, start: (start - end) / 2, end: 0 };
|
|
4108
3415
|
if (constraint !== "scale") return { constraint, start, end };
|
|
4109
|
-
const size2 =
|
|
3416
|
+
const size2 = axis === "x" ? offset.parentWidth : offset.parentHeight;
|
|
4110
3417
|
return size2 > 0 ? { constraint, start: start / size2 * 100, end: end / size2 * 100 } : { constraint, start: 0, end: 0 };
|
|
4111
3418
|
}
|
|
4112
3419
|
var edgesX = (r) => [r.left, r.left + r.width / 2, r.left + r.width];
|
|
@@ -4594,12 +3901,12 @@ function CanvasDndProvider({
|
|
|
4594
3901
|
}) {
|
|
4595
3902
|
const eventBus = useEventBus();
|
|
4596
3903
|
const sensors = useAlmadarDndSensors(false);
|
|
4597
|
-
const [activePayload, setActivePayload] =
|
|
4598
|
-
const lastPointerRef =
|
|
4599
|
-
const trackPointer =
|
|
3904
|
+
const [activePayload, setActivePayload] = React17.useState(null);
|
|
3905
|
+
const lastPointerRef = React17.useRef(null);
|
|
3906
|
+
const trackPointer = React17.useCallback((ev) => {
|
|
4600
3907
|
lastPointerRef.current = { x: ev.clientX, y: ev.clientY };
|
|
4601
3908
|
}, []);
|
|
4602
|
-
const handleDragStart =
|
|
3909
|
+
const handleDragStart = React17.useCallback((e) => {
|
|
4603
3910
|
const data = e.active.data.current;
|
|
4604
3911
|
const payload = data?.payload;
|
|
4605
3912
|
const activator = e.activatorEvent;
|
|
@@ -4613,7 +3920,7 @@ function CanvasDndProvider({
|
|
|
4613
3920
|
log.warn("dragStart:missing-payload", { id: e.active.id });
|
|
4614
3921
|
}
|
|
4615
3922
|
}, [eventBus, trackPointer]);
|
|
4616
|
-
const handleDragEnd =
|
|
3923
|
+
const handleDragEnd = React17.useCallback((e) => {
|
|
4617
3924
|
setActivePayload(null);
|
|
4618
3925
|
document.removeEventListener("pointermove", trackPointer);
|
|
4619
3926
|
const activeData = e.active.data.current;
|
|
@@ -4649,7 +3956,7 @@ function CanvasDndProvider({
|
|
|
4649
3956
|
const suppressed = onDrop ? onDrop(drop) === true : false;
|
|
4650
3957
|
if (!suppressed) defaultEmit(eventBus, drop);
|
|
4651
3958
|
}, [eventBus, onDrop, trackPointer]);
|
|
4652
|
-
const handleDragCancel =
|
|
3959
|
+
const handleDragCancel = React17.useCallback(() => {
|
|
4653
3960
|
setActivePayload(null);
|
|
4654
3961
|
document.removeEventListener("pointermove", trackPointer);
|
|
4655
3962
|
log.info("dragCancel");
|
|
@@ -6190,7 +5497,7 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
6190
5497
|
}
|
|
6191
5498
|
);
|
|
6192
5499
|
};
|
|
6193
|
-
var OrbPreviewNode =
|
|
5500
|
+
var OrbPreviewNode = React17.memo(OrbPreviewNodeInner);
|
|
6194
5501
|
OrbPreviewNode.displayName = "OrbPreviewNode";
|
|
6195
5502
|
orbPreviewLog.debug("export-resolved", () => ({
|
|
6196
5503
|
type: typeof OrbPreviewNode,
|
|
@@ -6295,7 +5602,7 @@ var EventFlowEdgeInner = (props) => {
|
|
|
6295
5602
|
) })
|
|
6296
5603
|
] });
|
|
6297
5604
|
};
|
|
6298
|
-
var EventFlowEdge =
|
|
5605
|
+
var EventFlowEdge = React17.memo(EventFlowEdgeInner);
|
|
6299
5606
|
EventFlowEdge.displayName = "EventFlowEdge";
|
|
6300
5607
|
function asString(v) {
|
|
6301
5608
|
return typeof v === "string" ? v : "";
|
|
@@ -7718,7 +7025,11 @@ function AppearanceSection({ patternConfig, themeManifest, onPropChange, onToken
|
|
|
7718
7025
|
{
|
|
7719
7026
|
checked: position.absolute,
|
|
7720
7027
|
label: t("orbInspector.absolute"),
|
|
7721
|
-
|
|
7028
|
+
disabled: !offsetInParent && !position.absolute,
|
|
7029
|
+
onChange: (on) => {
|
|
7030
|
+
if (!on) write({ ...position, absolute: false });
|
|
7031
|
+
else if (offsetInParent) write({ absolute: true, x: axisPositionFrom("x", "start", offsetInParent), y: axisPositionFrom("y", "start", offsetInParent) });
|
|
7032
|
+
}
|
|
7722
7033
|
}
|
|
7723
7034
|
),
|
|
7724
7035
|
position.absolute && ["x", "y"].map((axis) => /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2", "data-testid": `inspector-constraint-${axis}`, children: [
|
|
@@ -7729,9 +7040,10 @@ function AppearanceSection({ patternConfig, themeManifest, onPropChange, onToken
|
|
|
7729
7040
|
value: position[axis].constraint,
|
|
7730
7041
|
"aria-label": t(axis === "x" ? "orbInspector.constraintHorizontal" : "orbInspector.constraintVertical"),
|
|
7731
7042
|
options: CONSTRAINTS.map((c) => ({ value: c, label: t(CONSTRAINT_LABELS[axis][c]) })),
|
|
7043
|
+
disabled: !offsetInParent,
|
|
7732
7044
|
onValueChange: (v) => {
|
|
7733
7045
|
const constraint = CONSTRAINTS.find((c) => c === v);
|
|
7734
|
-
if (constraint) write({ ...position, [axis]: axisPositionFrom(axis, constraint, offsetInParent) });
|
|
7046
|
+
if (constraint && offsetInParent) write({ ...position, [axis]: axisPositionFrom(axis, constraint, offsetInParent) });
|
|
7735
7047
|
},
|
|
7736
7048
|
className: "flex-1 text-xs h-6"
|
|
7737
7049
|
}
|
|
@@ -8045,7 +7357,7 @@ var TraitCardNodeInner = (props) => {
|
|
|
8045
7357
|
}
|
|
8046
7358
|
);
|
|
8047
7359
|
};
|
|
8048
|
-
var TraitCardNode =
|
|
7360
|
+
var TraitCardNode = React17.memo(TraitCardNodeInner);
|
|
8049
7361
|
TraitCardNode.displayName = "TraitCardNode";
|
|
8050
7362
|
|
|
8051
7363
|
// lib/avl-layered-graph.ts
|
|
@@ -8348,19 +7660,19 @@ function FlowCanvasInner({
|
|
|
8348
7660
|
const fitPadding = systemLevel || flowLens ? 0.08 : 0.25;
|
|
8349
7661
|
const compact = useCompactLayout();
|
|
8350
7662
|
const [scope, setScope] = useState("local");
|
|
8351
|
-
const scopeRef =
|
|
7663
|
+
const scopeRef = React17.useRef(scope);
|
|
8352
7664
|
scopeRef.current = scope;
|
|
8353
7665
|
const [focusRequest, setFocusRequest] = useState(focusedOrbitalProp ?? initialOrbital);
|
|
8354
7666
|
const [stateByOrbital, setStateByOrbital] = useState({});
|
|
8355
|
-
const fitFocusedRef =
|
|
8356
|
-
const pendingFitRef =
|
|
8357
|
-
const fittedViewRef =
|
|
7667
|
+
const fitFocusedRef = React17.useRef(false);
|
|
7668
|
+
const pendingFitRef = React17.useRef(null);
|
|
7669
|
+
const fittedViewRef = React17.useRef(null);
|
|
8358
7670
|
useEffect(() => {
|
|
8359
7671
|
if (focusedOrbitalProp === void 0) return;
|
|
8360
7672
|
fitFocusedRef.current = true;
|
|
8361
7673
|
setFocusRequest(focusedOrbitalProp);
|
|
8362
7674
|
}, [focusedOrbitalProp]);
|
|
8363
|
-
const screenSizeUserOverrideRef =
|
|
7675
|
+
const screenSizeUserOverrideRef = React17.useRef(false);
|
|
8364
7676
|
const [screenSize, setScreenSize] = useState(
|
|
8365
7677
|
() => typeof window === "undefined" ? "laptop" : detectScreenSize(window.innerWidth)
|
|
8366
7678
|
);
|
|
@@ -8516,9 +7828,9 @@ function FlowCanvasInner({
|
|
|
8516
7828
|
const [edges, setEdges, onEdgesChange] = useEdgesState(activeEdges);
|
|
8517
7829
|
const reactFlow = useReactFlow();
|
|
8518
7830
|
const cameraMs = usePrefersReducedMotion() ? 0 : 300;
|
|
8519
|
-
const savedPositionsRef =
|
|
7831
|
+
const savedPositionsRef = React17.useRef(nodePositions);
|
|
8520
7832
|
savedPositionsRef.current = nodePositions;
|
|
8521
|
-
const nodesRef =
|
|
7833
|
+
const nodesRef = React17.useRef(nodes);
|
|
8522
7834
|
nodesRef.current = nodes;
|
|
8523
7835
|
useEffect(() => {
|
|
8524
7836
|
setEdges([]);
|
|
@@ -8663,7 +7975,7 @@ function FlowCanvasInner({
|
|
|
8663
7975
|
targetTraitName: tgtData.traitName
|
|
8664
7976
|
});
|
|
8665
7977
|
}, [nodes, onEventWire, eventBus]);
|
|
8666
|
-
const worldPositionsRef =
|
|
7978
|
+
const worldPositionsRef = React17.useRef(canvas.worldPositions);
|
|
8667
7979
|
worldPositionsRef.current = canvas.worldPositions;
|
|
8668
7980
|
const placementsOf = useCallback((list) => {
|
|
8669
7981
|
const positions = { ...savedPositionsRef.current };
|
|
@@ -9023,7 +8335,7 @@ var ZoomBreadcrumb = ({
|
|
|
9023
8335
|
if (eventName && band === "detail") {
|
|
9024
8336
|
segments.push({ icon: "\u26A1", label: eventName });
|
|
9025
8337
|
}
|
|
9026
|
-
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: [
|
|
9027
8339
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
|
|
9028
8340
|
/* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
|
|
9029
8341
|
/* @__PURE__ */ jsx("span", { children: seg.label })
|
|
@@ -9270,7 +8582,7 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
9270
8582
|
borderRadius: 6,
|
|
9271
8583
|
border: `1px solid ${color}`
|
|
9272
8584
|
},
|
|
9273
|
-
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: [
|
|
9274
8586
|
i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
|
|
9275
8587
|
i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
|
|
9276
8588
|
Box,
|
|
@@ -9813,4 +9125,4 @@ function deploymentGraph(input) {
|
|
|
9813
9125
|
});
|
|
9814
9126
|
}
|
|
9815
9127
|
|
|
9816
|
-
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 };
|