@almadar/ui 2.28.2 → 2.29.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/avl/index.cjs +412 -0
- package/dist/avl/index.d.cts +89 -1
- package/dist/avl/index.d.ts +3 -0
- package/dist/avl/index.js +410 -2
- package/dist/providers/EntityStoreProvider.d.ts +47 -0
- package/dist/providers/index.cjs +221 -141
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.js +115 -40
- package/dist/runtime/OrbPreview.d.ts +2 -2
- package/dist/runtime/index.cjs +968 -938
- package/dist/runtime/index.js +190 -160
- package/dist/runtime/useTraitStateMachine.d.ts +1 -1
- package/package.json +1 -1
package/dist/avl/index.cjs
CHANGED
|
@@ -5198,6 +5198,414 @@ var AvlSwimLane = ({
|
|
|
5198
5198
|
] });
|
|
5199
5199
|
};
|
|
5200
5200
|
AvlSwimLane.displayName = "AvlSwimLane";
|
|
5201
|
+
var DOMAIN_COLORS = {
|
|
5202
|
+
commerce: "#14b8a6",
|
|
5203
|
+
healthcare: "#3b82f6",
|
|
5204
|
+
education: "#6366f1",
|
|
5205
|
+
finance: "#10b981",
|
|
5206
|
+
scheduling: "#f59e0b",
|
|
5207
|
+
workflow: "#f97316",
|
|
5208
|
+
social: "#ec4899",
|
|
5209
|
+
media: "#a855f7",
|
|
5210
|
+
gaming: "#ef4444",
|
|
5211
|
+
iot: "#06b6d4",
|
|
5212
|
+
crm: "#0ea5e9",
|
|
5213
|
+
analytics: "#8b5cf6",
|
|
5214
|
+
communication: "#f43f5e",
|
|
5215
|
+
content: "#84cc16",
|
|
5216
|
+
location: "#22c55e",
|
|
5217
|
+
hr: "#64748b",
|
|
5218
|
+
legal: "#78716c",
|
|
5219
|
+
"real-estate": "#a8a29e"
|
|
5220
|
+
};
|
|
5221
|
+
var SIZE_MAP = {
|
|
5222
|
+
xs: 32,
|
|
5223
|
+
sm: 48,
|
|
5224
|
+
md: 120,
|
|
5225
|
+
lg: 200,
|
|
5226
|
+
xl: 300
|
|
5227
|
+
};
|
|
5228
|
+
function PersistenceCore({ cx, cy, r: r2, persistence, color }) {
|
|
5229
|
+
switch (persistence) {
|
|
5230
|
+
case "runtime":
|
|
5231
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5232
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r: r2, fill: "none", stroke: color, strokeWidth: 1.5, strokeDasharray: "4 2", opacity: 0.9 }),
|
|
5233
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r: r2 * 0.4, fill: color, opacity: 0.3, children: /* @__PURE__ */ jsxRuntime.jsx("animate", { attributeName: "opacity", values: "0.3;0.6;0.3", dur: "2s", repeatCount: "indefinite" }) })
|
|
5234
|
+
] });
|
|
5235
|
+
case "singleton":
|
|
5236
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5237
|
+
"rect",
|
|
5238
|
+
{
|
|
5239
|
+
x: cx - r2 * 0.7,
|
|
5240
|
+
y: cy - r2 * 0.7,
|
|
5241
|
+
width: r2 * 1.4,
|
|
5242
|
+
height: r2 * 1.4,
|
|
5243
|
+
transform: `rotate(45 ${cx} ${cy})`,
|
|
5244
|
+
fill: color,
|
|
5245
|
+
fillOpacity: 0.15,
|
|
5246
|
+
stroke: color,
|
|
5247
|
+
strokeWidth: 1.5
|
|
5248
|
+
}
|
|
5249
|
+
);
|
|
5250
|
+
case "instance":
|
|
5251
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5252
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r: r2, fill: color, fillOpacity: 0.1, stroke: color, strokeWidth: 1, strokeDasharray: "2 2" }),
|
|
5253
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r: r2 * 0.5, fill: color, fillOpacity: 0.2 })
|
|
5254
|
+
] });
|
|
5255
|
+
case "persistent":
|
|
5256
|
+
default:
|
|
5257
|
+
return /* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r: r2, fill: color, fillOpacity: 0.15, stroke: color, strokeWidth: 2 });
|
|
5258
|
+
}
|
|
5259
|
+
}
|
|
5260
|
+
function FieldSpokes({ cx, cy, innerR, outerR, count, color }) {
|
|
5261
|
+
if (count === 0) return null;
|
|
5262
|
+
const spokes = Array.from({ length: count }, (_, i) => {
|
|
5263
|
+
const angle = Math.PI * 2 * i / count - Math.PI / 2;
|
|
5264
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5265
|
+
"line",
|
|
5266
|
+
{
|
|
5267
|
+
x1: cx + innerR * Math.cos(angle),
|
|
5268
|
+
y1: cy + innerR * Math.sin(angle),
|
|
5269
|
+
x2: cx + outerR * Math.cos(angle),
|
|
5270
|
+
y2: cy + outerR * Math.sin(angle),
|
|
5271
|
+
stroke: color,
|
|
5272
|
+
strokeWidth: 1,
|
|
5273
|
+
opacity: 0.5
|
|
5274
|
+
},
|
|
5275
|
+
i
|
|
5276
|
+
);
|
|
5277
|
+
});
|
|
5278
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: spokes });
|
|
5279
|
+
}
|
|
5280
|
+
function StateRings({ cx, cy, baseR, count, color, animated }) {
|
|
5281
|
+
if (count === 0) return null;
|
|
5282
|
+
const ringCount = Math.min(count, 5);
|
|
5283
|
+
const ringSpacing = baseR * 0.25;
|
|
5284
|
+
const rings = Array.from({ length: ringCount }, (_, i) => {
|
|
5285
|
+
const r2 = baseR + (i + 1) * ringSpacing;
|
|
5286
|
+
const opacity = 0.6 - i * 0.1;
|
|
5287
|
+
const width = i === 0 ? 1.5 : 1;
|
|
5288
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5289
|
+
"circle",
|
|
5290
|
+
{
|
|
5291
|
+
cx,
|
|
5292
|
+
cy,
|
|
5293
|
+
r: r2,
|
|
5294
|
+
fill: "none",
|
|
5295
|
+
stroke: color,
|
|
5296
|
+
strokeWidth: width,
|
|
5297
|
+
opacity,
|
|
5298
|
+
children: animated && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5299
|
+
"animateTransform",
|
|
5300
|
+
{
|
|
5301
|
+
attributeName: "transform",
|
|
5302
|
+
type: "rotate",
|
|
5303
|
+
from: `0 ${cx} ${cy}`,
|
|
5304
|
+
to: `${i % 2 === 0 ? 360 : -360} ${cx} ${cy}`,
|
|
5305
|
+
dur: `${8 + i * 4}s`,
|
|
5306
|
+
repeatCount: "indefinite"
|
|
5307
|
+
}
|
|
5308
|
+
)
|
|
5309
|
+
},
|
|
5310
|
+
i
|
|
5311
|
+
);
|
|
5312
|
+
});
|
|
5313
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: rings });
|
|
5314
|
+
}
|
|
5315
|
+
function EffectMarkers({ cx, cy, r: r2, effectTypes, baseColor }) {
|
|
5316
|
+
if (effectTypes.length === 0) return null;
|
|
5317
|
+
const seen = /* @__PURE__ */ new Set();
|
|
5318
|
+
const categories = [];
|
|
5319
|
+
for (const t of effectTypes) {
|
|
5320
|
+
const cat = EFFECT_TYPE_TO_CATEGORY[t];
|
|
5321
|
+
if (!seen.has(cat)) {
|
|
5322
|
+
seen.add(cat);
|
|
5323
|
+
categories.push({ type: t, category: cat });
|
|
5324
|
+
}
|
|
5325
|
+
}
|
|
5326
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: categories.map(({ type, category }, i) => {
|
|
5327
|
+
const angle = Math.PI * 2 * i / categories.length - Math.PI / 2;
|
|
5328
|
+
const mx = cx + r2 * Math.cos(angle);
|
|
5329
|
+
const my = cy + r2 * Math.sin(angle);
|
|
5330
|
+
const markerColor = EFFECT_CATEGORY_COLORS[category].color;
|
|
5331
|
+
const s = r2 * 0.12;
|
|
5332
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
5333
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: mx, cy: my, r: s + 1, fill: markerColor, fillOpacity: 0.2 }),
|
|
5334
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: mx, cy: my, r: s * 0.6, fill: markerColor })
|
|
5335
|
+
] }, type);
|
|
5336
|
+
}) });
|
|
5337
|
+
}
|
|
5338
|
+
function AtomGlyph({ cx, cy, radius, fieldCount, stateCount, persistence, effectTypes, color, animated, showLabels, name }) {
|
|
5339
|
+
const coreR = radius * 0.25;
|
|
5340
|
+
const spokeInner = coreR + 2;
|
|
5341
|
+
const spokeOuter = coreR + radius * 0.15;
|
|
5342
|
+
const ringBase = coreR + radius * 0.18;
|
|
5343
|
+
const markerR = ringBase + Math.min(stateCount, 5) * (radius * 0.25) * 0.25 + radius * 0.08;
|
|
5344
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
5345
|
+
/* @__PURE__ */ jsxRuntime.jsx(PersistenceCore, { cx, cy, r: coreR, persistence, color }),
|
|
5346
|
+
/* @__PURE__ */ jsxRuntime.jsx(FieldSpokes, { cx, cy, innerR: spokeInner, outerR: spokeOuter, count: fieldCount, color }),
|
|
5347
|
+
/* @__PURE__ */ jsxRuntime.jsx(StateRings, { cx, cy, baseR: ringBase, count: stateCount, color, animated }),
|
|
5348
|
+
/* @__PURE__ */ jsxRuntime.jsx(EffectMarkers, { cx, cy, r: markerR, effectTypes, baseColor: color }),
|
|
5349
|
+
showLabels && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5350
|
+
"text",
|
|
5351
|
+
{
|
|
5352
|
+
x: cx,
|
|
5353
|
+
y: cy + radius + 12,
|
|
5354
|
+
textAnchor: "middle",
|
|
5355
|
+
fill: color,
|
|
5356
|
+
fontSize: radius * 0.14,
|
|
5357
|
+
fontFamily: "Inter, sans-serif",
|
|
5358
|
+
fontWeight: 500,
|
|
5359
|
+
opacity: 0.8,
|
|
5360
|
+
children: name
|
|
5361
|
+
}
|
|
5362
|
+
)
|
|
5363
|
+
] });
|
|
5364
|
+
}
|
|
5365
|
+
function MoleculeGlyph({ cx, cy, radius, children, color, animated, showLabels, name }) {
|
|
5366
|
+
const count = children.length || 1;
|
|
5367
|
+
const childR = radius / (count <= 3 ? 2.8 : 3.5);
|
|
5368
|
+
const orbitR = radius * 0.5;
|
|
5369
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
5370
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r: orbitR, fill: "none", stroke: color, strokeWidth: 0.8, strokeDasharray: "3 2", opacity: 0.3 }),
|
|
5371
|
+
children.map((child, i) => {
|
|
5372
|
+
const angle = Math.PI * 2 * i / count - Math.PI / 2;
|
|
5373
|
+
const childCx = cx + orbitR * Math.cos(angle);
|
|
5374
|
+
const childCy = cy + orbitR * Math.sin(angle);
|
|
5375
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
5376
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: cx, y1: cy, x2: childCx, y2: childCy, stroke: color, strokeWidth: 0.5, opacity: 0.2 }),
|
|
5377
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5378
|
+
AtomGlyph,
|
|
5379
|
+
{
|
|
5380
|
+
cx: childCx,
|
|
5381
|
+
cy: childCy,
|
|
5382
|
+
radius: childR,
|
|
5383
|
+
fieldCount: child.fieldCount ?? 3,
|
|
5384
|
+
stateCount: child.stateCount ?? 2,
|
|
5385
|
+
persistence: child.persistence ?? "persistent",
|
|
5386
|
+
effectTypes: child.effectTypes ?? ["render-ui"],
|
|
5387
|
+
color,
|
|
5388
|
+
animated,
|
|
5389
|
+
showLabels: false,
|
|
5390
|
+
name: child.name
|
|
5391
|
+
}
|
|
5392
|
+
)
|
|
5393
|
+
] }, child.name);
|
|
5394
|
+
}),
|
|
5395
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r: radius * 0.04, fill: color, opacity: 0.5 }),
|
|
5396
|
+
showLabels && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5397
|
+
"text",
|
|
5398
|
+
{
|
|
5399
|
+
x: cx,
|
|
5400
|
+
y: cy + radius + 12,
|
|
5401
|
+
textAnchor: "middle",
|
|
5402
|
+
fill: color,
|
|
5403
|
+
fontSize: radius * 0.12,
|
|
5404
|
+
fontFamily: "Inter, sans-serif",
|
|
5405
|
+
fontWeight: 500,
|
|
5406
|
+
opacity: 0.8,
|
|
5407
|
+
children: name
|
|
5408
|
+
}
|
|
5409
|
+
)
|
|
5410
|
+
] });
|
|
5411
|
+
}
|
|
5412
|
+
function OrganismGlyph({ cx, cy, radius, children, connections, color, animated, showLabels, name }) {
|
|
5413
|
+
const count = children.length || 1;
|
|
5414
|
+
const childR = radius / (count <= 3 ? 3 : 4);
|
|
5415
|
+
const spreadX = radius * 0.6;
|
|
5416
|
+
const positions = children.map((_, i) => {
|
|
5417
|
+
const offset = (i - (count - 1) / 2) * (spreadX * 2 / Math.max(count - 1, 1));
|
|
5418
|
+
return { x: cx + offset, y: cy };
|
|
5419
|
+
});
|
|
5420
|
+
const nameToIdx = {};
|
|
5421
|
+
children.forEach((c, i) => {
|
|
5422
|
+
nameToIdx[c.name] = i;
|
|
5423
|
+
});
|
|
5424
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
5425
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5426
|
+
"rect",
|
|
5427
|
+
{
|
|
5428
|
+
x: cx - radius,
|
|
5429
|
+
y: cy - radius * 0.7,
|
|
5430
|
+
width: radius * 2,
|
|
5431
|
+
height: radius * 1.4,
|
|
5432
|
+
rx: radius * 0.08,
|
|
5433
|
+
fill: color,
|
|
5434
|
+
fillOpacity: 0.03,
|
|
5435
|
+
stroke: color,
|
|
5436
|
+
strokeWidth: 0.8,
|
|
5437
|
+
strokeDasharray: "6 3",
|
|
5438
|
+
opacity: 0.4
|
|
5439
|
+
}
|
|
5440
|
+
),
|
|
5441
|
+
connections.map((conn, i) => {
|
|
5442
|
+
const fromIdx = nameToIdx[conn.from];
|
|
5443
|
+
const toIdx = nameToIdx[conn.to];
|
|
5444
|
+
if (fromIdx == null || toIdx == null) return null;
|
|
5445
|
+
const from = positions[fromIdx];
|
|
5446
|
+
const to = positions[toIdx];
|
|
5447
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
5448
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5449
|
+
"line",
|
|
5450
|
+
{
|
|
5451
|
+
x1: from.x + childR,
|
|
5452
|
+
y1: from.y,
|
|
5453
|
+
x2: to.x - childR,
|
|
5454
|
+
y2: to.y,
|
|
5455
|
+
stroke: color,
|
|
5456
|
+
strokeWidth: 1,
|
|
5457
|
+
opacity: 0.4,
|
|
5458
|
+
markerEnd: "none"
|
|
5459
|
+
}
|
|
5460
|
+
),
|
|
5461
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5462
|
+
"polygon",
|
|
5463
|
+
{
|
|
5464
|
+
points: `${to.x - childR - 4},${to.y - 3} ${to.x - childR},${to.y} ${to.x - childR - 4},${to.y + 3}`,
|
|
5465
|
+
fill: color,
|
|
5466
|
+
opacity: 0.5
|
|
5467
|
+
}
|
|
5468
|
+
),
|
|
5469
|
+
showLabels && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5470
|
+
"text",
|
|
5471
|
+
{
|
|
5472
|
+
x: (from.x + to.x) / 2,
|
|
5473
|
+
y: from.y - childR - 4,
|
|
5474
|
+
textAnchor: "middle",
|
|
5475
|
+
fill: color,
|
|
5476
|
+
fontSize: radius * 0.06,
|
|
5477
|
+
fontFamily: "Inter, sans-serif",
|
|
5478
|
+
opacity: 0.5,
|
|
5479
|
+
children: conn.event
|
|
5480
|
+
}
|
|
5481
|
+
)
|
|
5482
|
+
] }, i);
|
|
5483
|
+
}),
|
|
5484
|
+
children.map((child, i) => {
|
|
5485
|
+
const pos = positions[i];
|
|
5486
|
+
return /* @__PURE__ */ jsxRuntime.jsx("g", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5487
|
+
AtomGlyph,
|
|
5488
|
+
{
|
|
5489
|
+
cx: pos.x,
|
|
5490
|
+
cy: pos.y,
|
|
5491
|
+
radius: childR,
|
|
5492
|
+
fieldCount: child.fieldCount ?? 3,
|
|
5493
|
+
stateCount: child.stateCount ?? 2,
|
|
5494
|
+
persistence: child.persistence ?? "persistent",
|
|
5495
|
+
effectTypes: child.effectTypes ?? ["render-ui"],
|
|
5496
|
+
color,
|
|
5497
|
+
animated,
|
|
5498
|
+
showLabels,
|
|
5499
|
+
name: child.name
|
|
5500
|
+
}
|
|
5501
|
+
) }, child.name);
|
|
5502
|
+
}),
|
|
5503
|
+
showLabels && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5504
|
+
"text",
|
|
5505
|
+
{
|
|
5506
|
+
x: cx,
|
|
5507
|
+
y: cy + radius * 0.7 + 14,
|
|
5508
|
+
textAnchor: "middle",
|
|
5509
|
+
fill: color,
|
|
5510
|
+
fontSize: radius * 0.1,
|
|
5511
|
+
fontFamily: "Inter, sans-serif",
|
|
5512
|
+
fontWeight: 600,
|
|
5513
|
+
opacity: 0.8,
|
|
5514
|
+
children: name
|
|
5515
|
+
}
|
|
5516
|
+
)
|
|
5517
|
+
] });
|
|
5518
|
+
}
|
|
5519
|
+
var AvlBehaviorGlyph = ({
|
|
5520
|
+
name,
|
|
5521
|
+
level = "atom",
|
|
5522
|
+
domain,
|
|
5523
|
+
color: colorOverride,
|
|
5524
|
+
fieldCount = 4,
|
|
5525
|
+
stateCount = 2,
|
|
5526
|
+
persistence = "persistent",
|
|
5527
|
+
effectTypes = [],
|
|
5528
|
+
children: childBehaviors,
|
|
5529
|
+
connections = [],
|
|
5530
|
+
size = "md",
|
|
5531
|
+
showLabels = false,
|
|
5532
|
+
animated = false,
|
|
5533
|
+
className,
|
|
5534
|
+
onClick
|
|
5535
|
+
}) => {
|
|
5536
|
+
const resolvedColor = colorOverride ?? (domain ? DOMAIN_COLORS[domain] ?? "#14b8a6" : "#14b8a6");
|
|
5537
|
+
const dim = SIZE_MAP[size];
|
|
5538
|
+
const radius = dim * 0.4;
|
|
5539
|
+
const cx = dim / 2;
|
|
5540
|
+
const cy = dim / 2;
|
|
5541
|
+
const vb = level === "organism" ? `0 0 ${dim * 1.5} ${dim}` : `0 0 ${dim} ${dim}`;
|
|
5542
|
+
const svgW = level === "organism" ? dim * 1.5 : dim;
|
|
5543
|
+
const glyphId = React8.useMemo(() => `avl-bg-${Math.random().toString(36).slice(2, 8)}`, []);
|
|
5544
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5545
|
+
"svg",
|
|
5546
|
+
{
|
|
5547
|
+
viewBox: vb,
|
|
5548
|
+
width: svgW,
|
|
5549
|
+
height: dim,
|
|
5550
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5551
|
+
className: cn("inline-block", onClick && "cursor-pointer", className),
|
|
5552
|
+
onClick,
|
|
5553
|
+
role: onClick ? "button" : void 0,
|
|
5554
|
+
"aria-label": `${name} behavior glyph`,
|
|
5555
|
+
children: [
|
|
5556
|
+
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("radialGradient", { id: `${glyphId}-bg`, cx: "50%", cy: "50%", r: "50%", children: [
|
|
5557
|
+
/* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0%", stopColor: resolvedColor, stopOpacity: 0.06 }),
|
|
5558
|
+
/* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "100%", stopColor: resolvedColor, stopOpacity: 0 })
|
|
5559
|
+
] }) }),
|
|
5560
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: level === "organism" ? dim * 0.75 : cx, cy, r: radius * 1.3, fill: `url(#${glyphId}-bg)` }),
|
|
5561
|
+
level === "atom" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5562
|
+
AtomGlyph,
|
|
5563
|
+
{
|
|
5564
|
+
cx,
|
|
5565
|
+
cy,
|
|
5566
|
+
radius,
|
|
5567
|
+
fieldCount,
|
|
5568
|
+
stateCount,
|
|
5569
|
+
persistence,
|
|
5570
|
+
effectTypes,
|
|
5571
|
+
color: resolvedColor,
|
|
5572
|
+
animated,
|
|
5573
|
+
showLabels,
|
|
5574
|
+
name
|
|
5575
|
+
}
|
|
5576
|
+
),
|
|
5577
|
+
level === "molecule" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5578
|
+
MoleculeGlyph,
|
|
5579
|
+
{
|
|
5580
|
+
cx,
|
|
5581
|
+
cy,
|
|
5582
|
+
radius,
|
|
5583
|
+
children: childBehaviors ?? [],
|
|
5584
|
+
color: resolvedColor,
|
|
5585
|
+
animated,
|
|
5586
|
+
showLabels,
|
|
5587
|
+
name
|
|
5588
|
+
}
|
|
5589
|
+
),
|
|
5590
|
+
level === "organism" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5591
|
+
OrganismGlyph,
|
|
5592
|
+
{
|
|
5593
|
+
cx: dim * 0.75,
|
|
5594
|
+
cy,
|
|
5595
|
+
radius: radius * 1.5,
|
|
5596
|
+
children: childBehaviors ?? [],
|
|
5597
|
+
connections,
|
|
5598
|
+
color: resolvedColor,
|
|
5599
|
+
animated,
|
|
5600
|
+
showLabels,
|
|
5601
|
+
name
|
|
5602
|
+
}
|
|
5603
|
+
)
|
|
5604
|
+
]
|
|
5605
|
+
}
|
|
5606
|
+
);
|
|
5607
|
+
};
|
|
5608
|
+
AvlBehaviorGlyph.displayName = "AvlBehaviorGlyph";
|
|
5201
5609
|
|
|
5202
5610
|
// components/organisms/avl/avl-schema-parser.ts
|
|
5203
5611
|
function getEntity(orbital) {
|
|
@@ -6822,6 +7230,7 @@ exports.AVL_FIELD_TYPE_SHAPES = AVL_FIELD_TYPE_SHAPES;
|
|
|
6822
7230
|
exports.AVL_OPERATOR_COLORS = AVL_OPERATOR_COLORS;
|
|
6823
7231
|
exports.AvlApplication = AvlApplication;
|
|
6824
7232
|
exports.AvlApplicationScene = AvlApplicationScene;
|
|
7233
|
+
exports.AvlBehaviorGlyph = AvlBehaviorGlyph;
|
|
6825
7234
|
exports.AvlBinding = AvlBinding;
|
|
6826
7235
|
exports.AvlBindingRef = AvlBindingRef;
|
|
6827
7236
|
exports.AvlClickTarget = AvlClickTarget;
|
|
@@ -6846,11 +7255,14 @@ exports.AvlSExpr = AvlSExpr;
|
|
|
6846
7255
|
exports.AvlSlotMap = AvlSlotMap;
|
|
6847
7256
|
exports.AvlState = AvlState;
|
|
6848
7257
|
exports.AvlStateMachine = AvlStateMachine;
|
|
7258
|
+
exports.AvlSwimLane = AvlSwimLane;
|
|
6849
7259
|
exports.AvlTrait = AvlTrait;
|
|
6850
7260
|
exports.AvlTraitScene = AvlTraitScene;
|
|
6851
7261
|
exports.AvlTransition = AvlTransition;
|
|
7262
|
+
exports.AvlTransitionLane = AvlTransitionLane;
|
|
6852
7263
|
exports.AvlTransitionScene = AvlTransitionScene;
|
|
6853
7264
|
exports.CONNECTION_COLORS = CONNECTION_COLORS;
|
|
7265
|
+
exports.DOMAIN_COLORS = DOMAIN_COLORS;
|
|
6854
7266
|
exports.EFFECT_CATEGORY_COLORS = EFFECT_CATEGORY_COLORS;
|
|
6855
7267
|
exports.EFFECT_TYPE_TO_CATEGORY = EFFECT_TYPE_TO_CATEGORY;
|
|
6856
7268
|
exports.STATE_COLORS = STATE_COLORS;
|
package/dist/avl/index.d.cts
CHANGED
|
@@ -319,6 +319,94 @@ interface AvlExprTreeProps {
|
|
|
319
319
|
}
|
|
320
320
|
declare const AvlExprTree: React.FC<AvlExprTreeProps>;
|
|
321
321
|
|
|
322
|
+
interface AvlTransitionLaneEffect {
|
|
323
|
+
type: AvlEffectType | string;
|
|
324
|
+
}
|
|
325
|
+
interface AvlTransitionLaneProps {
|
|
326
|
+
event: string;
|
|
327
|
+
guard?: string;
|
|
328
|
+
effects: AvlTransitionLaneEffect[];
|
|
329
|
+
width: number;
|
|
330
|
+
x?: number;
|
|
331
|
+
y?: number;
|
|
332
|
+
isBackward?: boolean;
|
|
333
|
+
isSelfLoop?: boolean;
|
|
334
|
+
color?: string;
|
|
335
|
+
onTransitionClick?: () => void;
|
|
336
|
+
}
|
|
337
|
+
declare const AvlTransitionLane: React.FC<AvlTransitionLaneProps>;
|
|
338
|
+
|
|
339
|
+
interface AvlSwimLaneProps {
|
|
340
|
+
listenedEvents: string[];
|
|
341
|
+
emittedEvents: string[];
|
|
342
|
+
centerWidth: number;
|
|
343
|
+
height: number;
|
|
344
|
+
color?: string;
|
|
345
|
+
children: React.ReactNode;
|
|
346
|
+
}
|
|
347
|
+
declare const AvlSwimLane: React.FC<AvlSwimLaneProps>;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* AvlBehaviorGlyph - Visual identity for a behavior.
|
|
351
|
+
*
|
|
352
|
+
* Generates a unique glyph from behavior properties:
|
|
353
|
+
* - Core shape = persistence type
|
|
354
|
+
* - Spokes = field count
|
|
355
|
+
* - Rings = state count
|
|
356
|
+
* - Markers = effect types used
|
|
357
|
+
* - Color = domain hue
|
|
358
|
+
* - Composition = child glyphs + event wiring (molecule/organism)
|
|
359
|
+
*/
|
|
360
|
+
|
|
361
|
+
declare const DOMAIN_COLORS: Record<string, string>;
|
|
362
|
+
type BehaviorLevel = 'atom' | 'molecule' | 'organism';
|
|
363
|
+
type GlyphSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
364
|
+
interface BehaviorGlyphChild {
|
|
365
|
+
name: string;
|
|
366
|
+
fieldCount?: number;
|
|
367
|
+
stateCount?: number;
|
|
368
|
+
persistence?: AvlPersistenceKind;
|
|
369
|
+
effectTypes?: AvlEffectType[];
|
|
370
|
+
}
|
|
371
|
+
interface BehaviorGlyphConnection {
|
|
372
|
+
from: string;
|
|
373
|
+
to: string;
|
|
374
|
+
event: string;
|
|
375
|
+
}
|
|
376
|
+
interface AvlBehaviorGlyphProps {
|
|
377
|
+
/** Behavior name */
|
|
378
|
+
name: string;
|
|
379
|
+
/** Composition level */
|
|
380
|
+
level?: BehaviorLevel;
|
|
381
|
+
/** Domain for color coding */
|
|
382
|
+
domain?: string;
|
|
383
|
+
/** Override color (otherwise derived from domain) */
|
|
384
|
+
color?: string;
|
|
385
|
+
/** Entity field count (drives spoke count) */
|
|
386
|
+
fieldCount?: number;
|
|
387
|
+
/** State count (drives ring count) */
|
|
388
|
+
stateCount?: number;
|
|
389
|
+
/** Persistence type (drives core shape) */
|
|
390
|
+
persistence?: AvlPersistenceKind;
|
|
391
|
+
/** Effect types used (drives markers on rings) */
|
|
392
|
+
effectTypes?: AvlEffectType[];
|
|
393
|
+
/** Child behaviors for molecule/organism composition */
|
|
394
|
+
children?: BehaviorGlyphChild[];
|
|
395
|
+
/** Event connections between children (organism level) */
|
|
396
|
+
connections?: BehaviorGlyphConnection[];
|
|
397
|
+
/** Size preset */
|
|
398
|
+
size?: GlyphSize;
|
|
399
|
+
/** Show text labels */
|
|
400
|
+
showLabels?: boolean;
|
|
401
|
+
/** Animate orbital rings */
|
|
402
|
+
animated?: boolean;
|
|
403
|
+
/** Additional className */
|
|
404
|
+
className?: string;
|
|
405
|
+
/** Click handler */
|
|
406
|
+
onClick?: () => void;
|
|
407
|
+
}
|
|
408
|
+
declare const AvlBehaviorGlyph: React.FC<AvlBehaviorGlyphProps>;
|
|
409
|
+
|
|
322
410
|
/**
|
|
323
411
|
* AVL layout utilities for positioning atoms in composed diagrams.
|
|
324
412
|
*/
|
|
@@ -626,4 +714,4 @@ interface AvlClickTargetProps {
|
|
|
626
714
|
}
|
|
627
715
|
declare const AvlClickTarget: React.FC<AvlClickTargetProps>;
|
|
628
716
|
|
|
629
|
-
export { AVL_FIELD_TYPE_SHAPES, AVL_OPERATOR_COLORS, type ApplicationLevelData, AvlApplication, type AvlApplicationProps, AvlApplicationScene, type AvlApplicationSceneProps, type AvlBaseProps, AvlBinding, type AvlBindingProps, AvlBindingRef, type AvlBindingRefProps, AvlClickTarget, type AvlClickTargetProps, AvlClosedCircuit, type AvlClosedCircuitProps, type AvlClosedCircuitState, type AvlClosedCircuitTransition, AvlCosmicZoom, type AvlCosmicZoomProps, AvlEffect, type AvlEffectProps, type AvlEffectType, AvlEmitListen, type AvlEmitListenProps, AvlEntity, type AvlEntityProps, AvlEvent, type AvlEventProps, AvlExprTree, type AvlExprTreeNode, type AvlExprTreeProps, AvlField, type AvlFieldProps, AvlFieldType, type AvlFieldTypeKind, type AvlFieldTypeProps, AvlGuard, type AvlGuardProps, AvlLiteral, type AvlLiteralProps, AvlOperator, type AvlOperatorNamespace, type AvlOperatorProps, AvlOrbital, type AvlOrbitalProps, AvlOrbitalScene, type AvlOrbitalSceneProps, AvlOrbitalUnit, type AvlOrbitalUnitPage, type AvlOrbitalUnitProps, type AvlOrbitalUnitTrait, AvlPage, type AvlPageProps, AvlPersistence, type AvlPersistenceKind, type AvlPersistenceProps, AvlSExpr, type AvlSExprProps, AvlSlotMap, type AvlSlotMapProps, type AvlSlotMapSlot, AvlState, AvlStateMachine, type AvlStateMachineProps, type AvlStateMachineState, type AvlStateMachineTransition, type AvlStateProps, AvlTrait, type AvlTraitProps, AvlTraitScene, type AvlTraitSceneProps, AvlTransition, type AvlTransitionProps, AvlTransitionScene, type AvlTransitionSceneProps, CONNECTION_COLORS, type CrossLink, EFFECT_CATEGORY_COLORS, EFFECT_TYPE_TO_CATEGORY, type EffectCategory, type OrbitalLevelData, STATE_COLORS, type StateRole, type TraitLevelData, type TransitionLevelData, type ZoomLevel, arcPath, curveControlPoint, getStateRole, gridPositions, parseApplicationLevel, parseOrbitalLevel, parseTraitLevel, parseTransitionLevel, radialPositions, ringPositions };
|
|
717
|
+
export { AVL_FIELD_TYPE_SHAPES, AVL_OPERATOR_COLORS, type ApplicationLevelData, AvlApplication, type AvlApplicationProps, AvlApplicationScene, type AvlApplicationSceneProps, type AvlBaseProps, AvlBehaviorGlyph, type AvlBehaviorGlyphProps, AvlBinding, type AvlBindingProps, AvlBindingRef, type AvlBindingRefProps, AvlClickTarget, type AvlClickTargetProps, AvlClosedCircuit, type AvlClosedCircuitProps, type AvlClosedCircuitState, type AvlClosedCircuitTransition, AvlCosmicZoom, type AvlCosmicZoomProps, AvlEffect, type AvlEffectProps, type AvlEffectType, AvlEmitListen, type AvlEmitListenProps, AvlEntity, type AvlEntityProps, AvlEvent, type AvlEventProps, AvlExprTree, type AvlExprTreeNode, type AvlExprTreeProps, AvlField, type AvlFieldProps, AvlFieldType, type AvlFieldTypeKind, type AvlFieldTypeProps, AvlGuard, type AvlGuardProps, AvlLiteral, type AvlLiteralProps, AvlOperator, type AvlOperatorNamespace, type AvlOperatorProps, AvlOrbital, type AvlOrbitalProps, AvlOrbitalScene, type AvlOrbitalSceneProps, AvlOrbitalUnit, type AvlOrbitalUnitPage, type AvlOrbitalUnitProps, type AvlOrbitalUnitTrait, AvlPage, type AvlPageProps, AvlPersistence, type AvlPersistenceKind, type AvlPersistenceProps, AvlSExpr, type AvlSExprProps, AvlSlotMap, type AvlSlotMapProps, type AvlSlotMapSlot, AvlState, AvlStateMachine, type AvlStateMachineProps, type AvlStateMachineState, type AvlStateMachineTransition, type AvlStateProps, AvlSwimLane, type AvlSwimLaneProps, AvlTrait, type AvlTraitProps, AvlTraitScene, type AvlTraitSceneProps, AvlTransition, AvlTransitionLane, type AvlTransitionLaneProps, type AvlTransitionProps, AvlTransitionScene, type AvlTransitionSceneProps, type BehaviorGlyphChild, type BehaviorGlyphConnection, type BehaviorLevel, CONNECTION_COLORS, type CrossLink, DOMAIN_COLORS, EFFECT_CATEGORY_COLORS, EFFECT_TYPE_TO_CATEGORY, type EffectCategory, type GlyphSize, type OrbitalLevelData, STATE_COLORS, type StateRole, type TraitLevelData, type TransitionLevelData, type ZoomLevel, arcPath, curveControlPoint, getStateRole, gridPositions, parseApplicationLevel, parseOrbitalLevel, parseTraitLevel, parseTransitionLevel, radialPositions, ringPositions };
|
package/dist/avl/index.d.ts
CHANGED
|
@@ -32,5 +32,8 @@ export { AvlClosedCircuit, type AvlClosedCircuitProps, type AvlClosedCircuitStat
|
|
|
32
32
|
export { AvlEmitListen, type AvlEmitListenProps } from '../components/molecules/avl';
|
|
33
33
|
export { AvlSlotMap, type AvlSlotMapProps, type AvlSlotMapSlot } from '../components/molecules/avl';
|
|
34
34
|
export { AvlExprTree, type AvlExprTreeProps, type AvlExprTreeNode } from '../components/molecules/avl';
|
|
35
|
+
export { AvlBehaviorGlyph, type AvlBehaviorGlyphProps, type BehaviorLevel, type GlyphSize, type BehaviorGlyphChild, type BehaviorGlyphConnection, DOMAIN_COLORS } from '../components/molecules/avl';
|
|
36
|
+
export { AvlTransitionLane, type AvlTransitionLaneProps } from '../components/molecules/avl';
|
|
37
|
+
export { AvlSwimLane, type AvlSwimLaneProps } from '../components/molecules/avl';
|
|
35
38
|
export { ringPositions, arcPath, radialPositions, gridPositions, curveControlPoint } from '../components/molecules/avl';
|
|
36
39
|
export { AvlCosmicZoom, type AvlCosmicZoomProps, AvlApplicationScene, type AvlApplicationSceneProps, AvlOrbitalScene, type AvlOrbitalSceneProps, AvlTraitScene, type AvlTraitSceneProps, AvlTransitionScene, type AvlTransitionSceneProps, AvlClickTarget, type AvlClickTargetProps, parseApplicationLevel, parseOrbitalLevel, parseTraitLevel, parseTransitionLevel, type ApplicationLevelData, type OrbitalLevelData, type TraitLevelData, type TransitionLevelData, type CrossLink, type ZoomLevel, } from '../components/organisms/avl';
|