@almadar/shell-web 0.1.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ArbitraryClassCompiler-Mzabq-UB.d.ts → ArbitraryClassCompiler-CO_iASBn.d.ts} +99 -4
- package/dist/AvlGlyph-PIXU6QH5.js +5 -0
- package/dist/AvlStateMachine-CKGMECMG.js +8 -0
- package/dist/AvlTransitionDetail-QZX6G5KJ.js +10 -0
- package/dist/AvlTransitionExplainer-26WLEIC6.js +11 -0
- package/dist/BehaviorView-JLZ4PKWY.js +10 -0
- package/dist/{EventBusProvider-CVwjkV_2.d.ts → EventBusProvider-BFFHfN4O.d.ts} +12 -0
- package/dist/{FileTree-BCFnBEuQ.d.ts → FileTree-B3GDAjaQ.d.ts} +131 -4
- package/dist/FlowCanvas-RPII4V24.js +23 -0
- package/dist/{BehaviorValueFrame-SSEMEBTG.css → FlowCanvas-VWUPMBKB.css} +189 -191
- package/dist/{GameAudioProvider-Cm9BnvmP.d.ts → GameAudioProvider-D7wo5ryN.d.ts} +5 -8
- package/dist/KernelEngineContext-CPeWQMAz.d.ts +46 -0
- package/dist/LayersPanel-M2LHWUFF.js +6 -0
- package/dist/ModuleCard-NJD6JQGD.js +6 -0
- package/dist/OrbInspector-OWWKPOBF.js +23 -0
- package/dist/{TraitValueFrame-4G3KOUBR.css → OrbInspector-VMTMZHNQ.css} +189 -191
- package/dist/{Select-mDZIwNqN.d.ts → Select-C2Uq6t86.d.ts} +17 -31
- package/dist/ServerBridge-Bqsj-lOU.d.ts +124 -0
- package/dist/{FlowCanvas-3JRMNJLV.css → UISlotRenderer-BIS6KT7T.css} +189 -191
- package/dist/UISlotRenderer-PY7FIJXN.js +23 -0
- package/dist/auth/browser/index.js +1 -0
- package/dist/auth/react/index.d.ts +8 -1
- package/dist/auth/react/index.js +40 -2
- package/dist/avl/index.css +189 -191
- package/dist/avl/index.d.ts +107 -85
- package/dist/avl/index.js +170 -39
- package/dist/{chunk-P4LNHAFI.js → chunk-2WGR4TDJ.js} +465 -36
- package/dist/{chunk-GKIFONTE.js → chunk-3S54FWRC.js} +2 -2
- package/dist/{chunk-KVQS4GXU.js → chunk-4YJ53G7S.js} +18 -8
- package/dist/{chunk-MBQAMMSE.js → chunk-4YXBKHHM.js} +269 -658
- package/dist/{chunk-YDNJLLG6.js → chunk-57DC34LY.js} +19 -10
- package/dist/{chunk-FP3WIKTC.js → chunk-7N6ZPHQ5.js} +9 -1
- package/dist/{chunk-AILY3XPS.js → chunk-AE7VCQB6.js} +5 -6
- package/dist/{chunk-L677XGY3.js → chunk-AGVSO4WY.js} +4 -5
- package/dist/{chunk-FAJDTHWC.js → chunk-AGXD77SL.js} +2 -2
- package/dist/chunk-AU7O65OX.js +66 -0
- package/dist/{chunk-DFNZUYX4.js → chunk-FAKU5F62.js} +273 -29
- package/dist/{chunk-U6QRZASX.js → chunk-ILQXJ2AR.js} +1 -1
- package/dist/chunk-M74BCDBQ.js +490 -0
- package/dist/{chunk-GYTPOFVC.js → chunk-MS4K3K2R.js} +12095 -13329
- package/dist/{chunk-SGM3FASH.js → chunk-OWNG4JZI.js} +13 -12
- package/dist/{chunk-VFF5OO47.js → chunk-PCR37T3U.js} +15 -38
- package/dist/{chunk-SJGJJKBY.js → chunk-PRLHKBXG.js} +5 -3
- package/dist/{chunk-R5O5AUPI.js → chunk-PRXQGGCO.js} +93 -86
- package/dist/{chunk-42FY4RYA.js → chunk-REXYVBUO.js} +2 -2
- package/dist/{chunk-EQAMU2ZC.js → chunk-UTDC2NEA.js} +1 -1
- package/dist/{chunk-73SRAB4P.js → chunk-UU57VNS2.js} +2 -2
- package/dist/{chunk-TESBIVUA.js → chunk-VHC2M26B.js} +2 -2
- package/dist/{chunk-L2DEKY4J.js → chunk-VO2TTLS5.js} +3 -6
- package/dist/{chunk-2PY54Z44.js → chunk-VUIACGDU.js} +4 -5
- package/dist/{chunk-DLZF4PVE.js → chunk-YYIHRIDH.js} +3 -3
- package/dist/{chunk-DYEKAA4L.js → chunk-ZDRDJKYB.js} +243 -252
- package/dist/components/index.css +189 -191
- package/dist/components/index.d.ts +739 -289
- package/dist/components/index.js +25 -28
- package/dist/context/index.d.ts +2 -3
- package/dist/context/index.js +4 -3
- package/dist/core.d.ts +95 -19
- package/dist/core.js +2 -1
- package/dist/design-classes/index.cjs +3 -1
- package/dist/design-classes/index.js +3 -1
- package/dist/{fx-CmQjnHmT.d.ts → fx-Br8zjvu9.d.ts} +6 -6
- package/dist/hooks/index.d.ts +40 -5
- package/dist/hooks/index.js +5 -4
- package/dist/index.d.ts +40 -114
- package/dist/index.js +174 -34
- package/dist/kernel-client-JW6OH5FX.js +537 -0
- package/dist/kernel-wire-DGAySGhX.d.ts +95 -0
- package/dist/lib/index.d.ts +3 -4
- package/dist/lib/index.js +4 -4
- package/dist/{prism-AIWGN2X5.js → prism-X5YWKXO5.js} +5 -3
- package/dist/providers/index.css +189 -191
- package/dist/providers/index.d.ts +41 -28
- package/dist/providers/index.js +19 -24
- package/dist/renderer/index.d.ts +0 -2
- package/dist/renderer/index.js +1 -0
- package/dist/runtime/index.css +189 -191
- package/dist/runtime/index.d.ts +57 -253
- package/dist/runtime/index.js +18 -24
- package/dist/ssr/index.cjs +2643 -535
- package/dist/ssr/index.d.cts +0 -23
- package/dist/ssr/index.d.ts +0 -23
- package/dist/ssr/index.js +2639 -535
- package/dist/storage/browser/index.js +1 -0
- package/dist/test-support.d.ts +15 -8
- package/dist/test-support.js +91 -24
- package/dist/{paintDispatch-ChW5mVuK.d.ts → verificationRegistry-oopV1J1n.d.ts} +132 -30
- package/package.json +14 -38
- package/src/core/lib/band-shapes.json +7 -0
- package/src/core/locales/ar.json +18 -5
- package/src/core/locales/en.json +18 -5
- package/src/core/locales/sl.json +18 -5
- package/tailwind-preset.cjs +30 -1
- package/dist/AvlGlyph-JKJOAH23.js +0 -6
- package/dist/AvlStateMachine-PI4YGREK.js +0 -8
- package/dist/AvlTransitionDetail-ZH7V24UG.js +0 -12
- package/dist/AvlTransitionExplainer-ZSRT7L6Y.js +0 -13
- package/dist/BehaviorValueFrame-6RUJXT4A.js +0 -29
- package/dist/BehaviorView-RFEE5J6E.js +0 -10
- package/dist/Canvas3DHost-_Y-5uLM_.d.ts +0 -552
- package/dist/FlowCanvas-STDC4OWK.js +0 -27
- package/dist/KernelEngineContext-BOCQoFwk.d.ts +0 -43
- package/dist/LayersPanel-BBQ54IVG.js +0 -7
- package/dist/ModuleCard-3TT2X7IW.js +0 -7
- package/dist/OrbInspector-K6T6O7GI.js +0 -27
- package/dist/OrbInspector-MHLJ6OEE.css +0 -1756
- package/dist/ServerBridge-Cm1On51b.d.ts +0 -233
- package/dist/TraitValueFrame-2PJGLLVI.js +0 -28
- package/dist/UISlotRenderer-JKFSX24W.js +0 -27
- package/dist/UISlotRenderer-KVFO6J7R.css +0 -1756
- package/dist/UserContext-DqWeZkUZ.d.ts +0 -100
- package/dist/avl-3d-context-BIRKWpaL.d.ts +0 -204
- package/dist/avl-schema-parser-CtJxJ9KU.d.ts +0 -132
- package/dist/avl-zoom-state-CKMVuBFg.d.ts +0 -17
- package/dist/chunk-2QOH2HWM.js +0 -95
- package/dist/chunk-6P3MWXYE.js +0 -440
- package/dist/chunk-B4BU77LT.js +0 -432
- package/dist/chunk-DJ433ET5.js +0 -1327
- package/dist/chunk-DZ42OJQC.js +0 -176
- package/dist/chunk-EOWMARUB.js +0 -16
- package/dist/chunk-FIW6WN23.js +0 -508
- package/dist/chunk-GAR5TQ5B.js +0 -199
- package/dist/chunk-PC7K4SK7.js +0 -1384
- package/dist/chunk-ZO6MXAS3.js +0 -69
- package/dist/kernel-client-ZH4PSMCN.js +0 -367
- package/dist/kernel-wire-B4S8pnP3.d.ts +0 -65
- package/dist/three/index.css +0 -503
- package/dist/three/index.d.ts +0 -1185
- package/dist/three/index.js +0 -3896
- package/dist/useKeyboardRouter-Dsq553Ur.d.ts +0 -42
- package/dist/verificationRegistry-CabxhfTv.d.ts +0 -122
package/dist/chunk-GAR5TQ5B.js
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { getStateRole } from './chunk-DFNZUYX4.js';
|
|
2
|
-
import { useState, useLayoutEffect } from 'react';
|
|
3
|
-
|
|
4
|
-
function useContainerWidth(ref) {
|
|
5
|
-
const [width, setWidth] = useState(null);
|
|
6
|
-
useLayoutEffect(() => {
|
|
7
|
-
const el = ref.current;
|
|
8
|
-
if (!el) return;
|
|
9
|
-
setWidth(el.clientWidth);
|
|
10
|
-
if (typeof ResizeObserver === "undefined") return;
|
|
11
|
-
const ro = new ResizeObserver(([entry]) => setWidth(entry.contentRect.width));
|
|
12
|
-
ro.observe(el);
|
|
13
|
-
return () => ro.disconnect();
|
|
14
|
-
}, [ref]);
|
|
15
|
-
return width;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// src/lib/avl-elk-layout.ts
|
|
19
|
-
function stateWidth(transitionCount) {
|
|
20
|
-
if (transitionCount >= 5) return 160;
|
|
21
|
-
if (transitionCount >= 3) return 130;
|
|
22
|
-
return 110;
|
|
23
|
-
}
|
|
24
|
-
var STATE_H = 40;
|
|
25
|
-
var elk;
|
|
26
|
-
function loadElk() {
|
|
27
|
-
elk ??= import('elkjs/lib/elk.bundled.js').then(({ default: Elk }) => new Elk());
|
|
28
|
-
return elk;
|
|
29
|
-
}
|
|
30
|
-
function flowOrder(data) {
|
|
31
|
-
const byName = new Map(data.states.map((s) => [s.name, s]));
|
|
32
|
-
const seen = /* @__PURE__ */ new Set();
|
|
33
|
-
const queue = data.states.filter((s) => s.isInitial).map((s) => s.name);
|
|
34
|
-
const out = [];
|
|
35
|
-
while (queue.length > 0) {
|
|
36
|
-
const name = queue.shift();
|
|
37
|
-
if (seen.has(name)) continue;
|
|
38
|
-
const state = byName.get(name);
|
|
39
|
-
if (!state) continue;
|
|
40
|
-
seen.add(name);
|
|
41
|
-
out.push(state);
|
|
42
|
-
for (const t of data.transitions) if (t.from === name && !seen.has(t.to)) queue.push(t.to);
|
|
43
|
-
}
|
|
44
|
-
for (const s of data.states) if (!seen.has(s.name)) out.push(s);
|
|
45
|
-
return out;
|
|
46
|
-
}
|
|
47
|
-
async function computeTraitLayout(data, metrics) {
|
|
48
|
-
const transitionCounts = {};
|
|
49
|
-
for (const s of data.states) transitionCounts[s.name] = 0;
|
|
50
|
-
for (const t of data.transitions) {
|
|
51
|
-
transitionCounts[t.from] = (transitionCounts[t.from] ?? 0) + 1;
|
|
52
|
-
transitionCounts[t.to] = (transitionCounts[t.to] ?? 0) + 1;
|
|
53
|
-
}
|
|
54
|
-
const maxTC = Math.max(...Object.values(transitionCounts), 0);
|
|
55
|
-
const LABEL_BASE_W = 100;
|
|
56
|
-
const LABEL_H = 44;
|
|
57
|
-
const states = metrics ? flowOrder(data) : data.states;
|
|
58
|
-
const elkGraph = {
|
|
59
|
-
id: "root",
|
|
60
|
-
layoutOptions: {
|
|
61
|
-
"elk.algorithm": "layered",
|
|
62
|
-
"elk.direction": metrics?.direction === "rtl" ? "LEFT" : "RIGHT",
|
|
63
|
-
"elk.spacing.nodeNode": String(metrics?.nodeSpacing ?? 80),
|
|
64
|
-
"elk.spacing.edgeNode": "30",
|
|
65
|
-
"elk.spacing.edgeEdge": "24",
|
|
66
|
-
"elk.spacing.edgeLabel": "10",
|
|
67
|
-
"elk.spacing.labelLabel": "8",
|
|
68
|
-
"elk.layered.spacing.nodeNodeBetweenLayers": String(metrics?.layerSpacing ?? 100),
|
|
69
|
-
...metrics?.orthogonal ? { "elk.edgeRouting": "ORTHOGONAL" } : {},
|
|
70
|
-
...metrics ? { "elk.layered.considerModelOrder.strategy": "NODES_AND_EDGES", "elk.layered.cycleBreaking.strategy": "MODEL_ORDER" } : {},
|
|
71
|
-
"elk.edgeLabels.placement": "CENTER",
|
|
72
|
-
"elk.layered.mergeEdges": "false",
|
|
73
|
-
"elk.layered.nodePlacement.strategy": "NETWORK_SIMPLEX"
|
|
74
|
-
},
|
|
75
|
-
children: states.map((s) => {
|
|
76
|
-
const tc = transitionCounts[s.name] ?? 0;
|
|
77
|
-
const size = metrics ? metrics.nodeSize(s.name) : { width: stateWidth(tc), height: STATE_H };
|
|
78
|
-
return {
|
|
79
|
-
id: s.name,
|
|
80
|
-
width: size.width,
|
|
81
|
-
height: size.height,
|
|
82
|
-
labels: [{ text: s.name, width: size.width - 10, height: 14 }],
|
|
83
|
-
...metrics && s.isInitial ? { layoutOptions: { "elk.layered.layering.layerConstraint": "FIRST" } } : {}
|
|
84
|
-
};
|
|
85
|
-
}),
|
|
86
|
-
edges: data.transitions.map((t, i) => {
|
|
87
|
-
const textW = Math.max(t.event.length * 8, 60);
|
|
88
|
-
const iconsW = Math.min(t.effects.length, 6) * 28 + 20;
|
|
89
|
-
const label = metrics ? metrics.labelSize(t) : { width: Math.max(textW, iconsW, LABEL_BASE_W), height: LABEL_H };
|
|
90
|
-
return {
|
|
91
|
-
id: `e${i}`,
|
|
92
|
-
sources: [t.from],
|
|
93
|
-
targets: [t.to],
|
|
94
|
-
labels: [{
|
|
95
|
-
text: t.event,
|
|
96
|
-
width: label.width,
|
|
97
|
-
height: label.height,
|
|
98
|
-
...metrics ? { layoutOptions: { "elk.edgeLabels.inline": "true" } } : {}
|
|
99
|
-
}]
|
|
100
|
-
};
|
|
101
|
-
})
|
|
102
|
-
};
|
|
103
|
-
const layout = await (await loadElk()).layout(elkGraph);
|
|
104
|
-
const layoutChildren = layout.children ?? [];
|
|
105
|
-
const layoutEdges = layout.edges ?? [];
|
|
106
|
-
const nodeXMap = {};
|
|
107
|
-
for (const n of layoutChildren) {
|
|
108
|
-
nodeXMap[n.id] = n.x ?? 0;
|
|
109
|
-
}
|
|
110
|
-
const nodes = layoutChildren.map((n) => {
|
|
111
|
-
const name = n.id;
|
|
112
|
-
const stateInfo = data.states.find((s) => s.name === name);
|
|
113
|
-
const tc = transitionCounts[name] ?? 0;
|
|
114
|
-
return {
|
|
115
|
-
id: name,
|
|
116
|
-
x: n.x ?? 0,
|
|
117
|
-
y: n.y ?? 0,
|
|
118
|
-
width: n.width ?? 110,
|
|
119
|
-
height: n.height ?? STATE_H,
|
|
120
|
-
isInitial: stateInfo?.isInitial ?? void 0,
|
|
121
|
-
isTerminal: stateInfo?.isTerminal ?? void 0,
|
|
122
|
-
role: getStateRole(stateInfo?.isInitial ?? void 0, stateInfo?.isTerminal ?? void 0, tc, maxTC),
|
|
123
|
-
transitionCount: tc
|
|
124
|
-
};
|
|
125
|
-
});
|
|
126
|
-
const edges = layoutEdges.map((e, i) => {
|
|
127
|
-
const t = data.transitions[i];
|
|
128
|
-
const labels = e.labels ?? [];
|
|
129
|
-
const label = labels[0];
|
|
130
|
-
const sections = e.sections ?? [];
|
|
131
|
-
const points = [];
|
|
132
|
-
for (const section of sections) {
|
|
133
|
-
const bendPoints = section.bendPoints ?? [];
|
|
134
|
-
points.push({ x: section.startPoint.x, y: section.startPoint.y });
|
|
135
|
-
for (const bp of bendPoints) points.push({ x: bp.x, y: bp.y });
|
|
136
|
-
points.push({ x: section.endPoint.x, y: section.endPoint.y });
|
|
137
|
-
}
|
|
138
|
-
const isSelf = t.from === t.to;
|
|
139
|
-
const toX = nodeXMap[t.to] ?? 0;
|
|
140
|
-
const fromX = nodeXMap[t.from] ?? 0;
|
|
141
|
-
const isBackward = !isSelf && (metrics?.direction === "rtl" ? toX >= fromX : toX <= fromX);
|
|
142
|
-
const lw = label?.width ?? LABEL_BASE_W;
|
|
143
|
-
const lh = label?.height ?? LABEL_H;
|
|
144
|
-
return {
|
|
145
|
-
id: e.id,
|
|
146
|
-
from: t.from,
|
|
147
|
-
to: t.to,
|
|
148
|
-
event: t.event,
|
|
149
|
-
effects: t.effects,
|
|
150
|
-
guard: !!t.guard,
|
|
151
|
-
guardExpr: typeof t.guard === "string" ? t.guard : void 0,
|
|
152
|
-
index: t.index,
|
|
153
|
-
labelX: label?.x ?? 0,
|
|
154
|
-
labelY: label?.y ?? 0,
|
|
155
|
-
labelW: lw,
|
|
156
|
-
labelH: lh,
|
|
157
|
-
points,
|
|
158
|
-
isSelf,
|
|
159
|
-
isBackward
|
|
160
|
-
};
|
|
161
|
-
});
|
|
162
|
-
return {
|
|
163
|
-
nodes,
|
|
164
|
-
edges,
|
|
165
|
-
width: layout.width ?? 600,
|
|
166
|
-
height: layout.height ?? 400
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
function roundedEdgePath(points, radius) {
|
|
170
|
-
if (points.length < 3) return edgePath(points);
|
|
171
|
-
let d = `M ${points[0].x},${points[0].y}`;
|
|
172
|
-
for (let i = 1; i < points.length - 1; i++) {
|
|
173
|
-
const prev = points[i - 1];
|
|
174
|
-
const cur = points[i];
|
|
175
|
-
const next = points[i + 1];
|
|
176
|
-
const inLen = Math.hypot(cur.x - prev.x, cur.y - prev.y);
|
|
177
|
-
const outLen = Math.hypot(next.x - cur.x, next.y - cur.y);
|
|
178
|
-
const r = Math.min(radius, inLen / 2, outLen / 2);
|
|
179
|
-
if (r <= 0) {
|
|
180
|
-
d += ` L ${cur.x},${cur.y}`;
|
|
181
|
-
continue;
|
|
182
|
-
}
|
|
183
|
-
const ax = cur.x - (cur.x - prev.x) / inLen * r;
|
|
184
|
-
const ay = cur.y - (cur.y - prev.y) / inLen * r;
|
|
185
|
-
const bx = cur.x + (next.x - cur.x) / outLen * r;
|
|
186
|
-
const by = cur.y + (next.y - cur.y) / outLen * r;
|
|
187
|
-
d += ` L ${ax},${ay} Q ${cur.x},${cur.y} ${bx},${by}`;
|
|
188
|
-
}
|
|
189
|
-
const last = points[points.length - 1];
|
|
190
|
-
return `${d} L ${last.x},${last.y}`;
|
|
191
|
-
}
|
|
192
|
-
function edgePath(points) {
|
|
193
|
-
if (points.length === 0) return "";
|
|
194
|
-
let d = `M ${points[0].x},${points[0].y}`;
|
|
195
|
-
for (let i = 1; i < points.length; i++) d += ` L ${points[i].x},${points[i].y}`;
|
|
196
|
-
return d;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export { computeTraitLayout, edgePath, roundedEdgePath, useContainerWidth };
|