@almadar/ui 4.41.2 → 4.42.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 +107 -21
- package/dist/avl/index.js +107 -21
- package/package.json +1 -1
package/dist/avl/index.cjs
CHANGED
|
@@ -46750,13 +46750,14 @@ var AvlSwimLane = ({
|
|
|
46750
46750
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
46751
46751
|
"text",
|
|
46752
46752
|
{
|
|
46753
|
-
x:
|
|
46753
|
+
x: totalWidth - 18,
|
|
46754
46754
|
y: ey + 4,
|
|
46755
46755
|
fontSize: 11,
|
|
46756
46756
|
fontWeight: 500,
|
|
46757
46757
|
fill: color,
|
|
46758
46758
|
opacity: 0.6,
|
|
46759
46759
|
fontFamily: "inherit",
|
|
46760
|
+
textAnchor: "end",
|
|
46760
46761
|
children: evt
|
|
46761
46762
|
}
|
|
46762
46763
|
),
|
|
@@ -52647,15 +52648,21 @@ function layoutOrbitals(count, containerW, containerH) {
|
|
|
52647
52648
|
const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
|
|
52648
52649
|
const rows = Math.ceil(count / cols);
|
|
52649
52650
|
const edgePad = 24;
|
|
52650
|
-
const
|
|
52651
|
-
const
|
|
52652
|
-
const
|
|
52653
|
-
const
|
|
52654
|
-
const
|
|
52655
|
-
const
|
|
52651
|
+
const fitMinCx = UNIT_DISPLAY_W / 2 + edgePad;
|
|
52652
|
+
const fitMinCy = UNIT_DISPLAY_H / 2 + edgePad;
|
|
52653
|
+
const fitMaxCx = Math.max(fitMinCx, containerW - UNIT_DISPLAY_W / 2 - edgePad);
|
|
52654
|
+
const fitMaxCy = Math.max(fitMinCy, containerH - UNIT_DISPLAY_H / 2 - edgePad);
|
|
52655
|
+
const fitStepX = cols > 1 ? (fitMaxCx - fitMinCx) / (cols - 1) : 0;
|
|
52656
|
+
const fitStepY = rows > 1 ? (fitMaxCy - fitMinCy) / (rows - 1) : 0;
|
|
52657
|
+
const stepX = Math.min(fitStepX, UNIT_DISPLAY_W * 3.5);
|
|
52658
|
+
const stepY = Math.min(fitStepY, UNIT_DISPLAY_H * 3.5);
|
|
52659
|
+
const gridW = (cols - 1) * stepX;
|
|
52660
|
+
const gridH = (rows - 1) * stepY;
|
|
52661
|
+
const originX = (containerW - gridW) / 2;
|
|
52662
|
+
const originY = (containerH - gridH) / 2;
|
|
52656
52663
|
return Array.from({ length: count }, (_, i) => ({
|
|
52657
|
-
cx:
|
|
52658
|
-
cy:
|
|
52664
|
+
cx: originX + i % cols * stepX,
|
|
52665
|
+
cy: originY + Math.floor(i / cols) * stepY
|
|
52659
52666
|
}));
|
|
52660
52667
|
}
|
|
52661
52668
|
var avlOczWireId = 0;
|
|
@@ -52935,6 +52942,10 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
52935
52942
|
const [pan, setPan] = React119.useState({ x: 0, y: 0 });
|
|
52936
52943
|
const dragStateRef = React119.useRef(null);
|
|
52937
52944
|
const transformWrapperRef = React119.useRef(null);
|
|
52945
|
+
React119.useEffect(() => {
|
|
52946
|
+
setZoom(1);
|
|
52947
|
+
setPan({ x: 0, y: 0 });
|
|
52948
|
+
}, [state.level]);
|
|
52938
52949
|
const clampZoom = React119.useCallback(
|
|
52939
52950
|
(z) => Math.max(minZoom, Math.min(maxZoom, z)),
|
|
52940
52951
|
[minZoom, maxZoom]
|
|
@@ -52994,7 +53005,7 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
52994
53005
|
};
|
|
52995
53006
|
wrapper.addEventListener("wheel", wheelListener, { passive: false });
|
|
52996
53007
|
return () => wrapper.removeEventListener("wheel", wheelListener);
|
|
52997
|
-
}, [clampZoom]);
|
|
53008
|
+
}, [clampZoom, state.level]);
|
|
52998
53009
|
const zoomIn = React119.useCallback(() => setZoom((z) => clampZoom(z * 1.2)), [clampZoom]);
|
|
52999
53010
|
const zoomOut = React119.useCallback(() => setZoom((z) => clampZoom(z / 1.2)), [clampZoom]);
|
|
53000
53011
|
const resetZoom = React119.useCallback(() => {
|
|
@@ -53249,14 +53260,42 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
53249
53260
|
paddingLeft: 24,
|
|
53250
53261
|
paddingRight: 24
|
|
53251
53262
|
},
|
|
53252
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
53253
|
-
|
|
53263
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
53264
|
+
"div",
|
|
53254
53265
|
{
|
|
53255
|
-
|
|
53256
|
-
|
|
53257
|
-
|
|
53266
|
+
ref: transformWrapperRef,
|
|
53267
|
+
onPointerDown: handlePointerDown,
|
|
53268
|
+
onPointerMove: handlePointerMove,
|
|
53269
|
+
onPointerUp: handlePointerUp,
|
|
53270
|
+
onPointerCancel: handlePointerUp,
|
|
53271
|
+
style: {
|
|
53272
|
+
position: "relative",
|
|
53273
|
+
width: "100%",
|
|
53274
|
+
height: "100%",
|
|
53275
|
+
cursor: dragStateRef.current ? "grabbing" : "grab",
|
|
53276
|
+
overflow: "hidden"
|
|
53277
|
+
},
|
|
53278
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
53279
|
+
"div",
|
|
53280
|
+
{
|
|
53281
|
+
style: {
|
|
53282
|
+
position: "absolute",
|
|
53283
|
+
inset: 0,
|
|
53284
|
+
transform: `translate(${pan.x}px, ${pan.y}px) scale(${zoom})`,
|
|
53285
|
+
transformOrigin: "0 0"
|
|
53286
|
+
},
|
|
53287
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 600 400", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
53288
|
+
AvlTraitScene,
|
|
53289
|
+
{
|
|
53290
|
+
data: traitLevelData,
|
|
53291
|
+
color,
|
|
53292
|
+
onTransitionClick: (idx) => handleTransitionSelect(idx)
|
|
53293
|
+
}
|
|
53294
|
+
) })
|
|
53295
|
+
}
|
|
53296
|
+
)
|
|
53258
53297
|
}
|
|
53259
|
-
)
|
|
53298
|
+
)
|
|
53260
53299
|
}
|
|
53261
53300
|
),
|
|
53262
53301
|
state.level === "transition" && transitionLevelData && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -53270,13 +53309,60 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
53270
53309
|
paddingLeft: 24,
|
|
53271
53310
|
paddingRight: 24
|
|
53272
53311
|
},
|
|
53273
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
53274
|
-
|
|
53312
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
53313
|
+
"div",
|
|
53275
53314
|
{
|
|
53276
|
-
|
|
53277
|
-
|
|
53315
|
+
ref: transformWrapperRef,
|
|
53316
|
+
onPointerDown: handlePointerDown,
|
|
53317
|
+
onPointerMove: handlePointerMove,
|
|
53318
|
+
onPointerUp: handlePointerUp,
|
|
53319
|
+
onPointerCancel: handlePointerUp,
|
|
53320
|
+
style: {
|
|
53321
|
+
position: "relative",
|
|
53322
|
+
width: "100%",
|
|
53323
|
+
height: "100%",
|
|
53324
|
+
cursor: dragStateRef.current ? "grabbing" : "grab",
|
|
53325
|
+
overflow: "hidden"
|
|
53326
|
+
},
|
|
53327
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
53328
|
+
"div",
|
|
53329
|
+
{
|
|
53330
|
+
style: {
|
|
53331
|
+
position: "absolute",
|
|
53332
|
+
inset: 0,
|
|
53333
|
+
transform: `translate(${pan.x}px, ${pan.y}px) scale(${zoom})`,
|
|
53334
|
+
transformOrigin: "0 0"
|
|
53335
|
+
},
|
|
53336
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 600 400", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
53337
|
+
AvlTransitionScene,
|
|
53338
|
+
{
|
|
53339
|
+
data: transitionLevelData,
|
|
53340
|
+
color
|
|
53341
|
+
}
|
|
53342
|
+
) })
|
|
53343
|
+
}
|
|
53344
|
+
)
|
|
53278
53345
|
}
|
|
53279
|
-
)
|
|
53346
|
+
)
|
|
53347
|
+
}
|
|
53348
|
+
),
|
|
53349
|
+
(state.level === "trait" || state.level === "transition") && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
53350
|
+
Box,
|
|
53351
|
+
{
|
|
53352
|
+
position: "absolute",
|
|
53353
|
+
style: {
|
|
53354
|
+
top: 12,
|
|
53355
|
+
right: 12,
|
|
53356
|
+
display: "flex",
|
|
53357
|
+
flexDirection: "column",
|
|
53358
|
+
gap: 4,
|
|
53359
|
+
zIndex: 30
|
|
53360
|
+
},
|
|
53361
|
+
children: [
|
|
53362
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "secondary", size: "sm", onClick: zoomIn, title: "Zoom in", action: "COSMIC_ZOOM_IN", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "plus", size: "sm" }) }),
|
|
53363
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "secondary", size: "sm", onClick: zoomOut, title: "Zoom out", action: "COSMIC_ZOOM_OUT", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "minus", size: "sm" }) }),
|
|
53364
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "secondary", size: "sm", onClick: resetZoom, title: "Reset", action: "COSMIC_ZOOM_RESET", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "maximize", size: "sm" }) })
|
|
53365
|
+
]
|
|
53280
53366
|
}
|
|
53281
53367
|
)
|
|
53282
53368
|
]
|
package/dist/avl/index.js
CHANGED
|
@@ -46704,13 +46704,14 @@ var AvlSwimLane = ({
|
|
|
46704
46704
|
/* @__PURE__ */ jsx(
|
|
46705
46705
|
"text",
|
|
46706
46706
|
{
|
|
46707
|
-
x:
|
|
46707
|
+
x: totalWidth - 18,
|
|
46708
46708
|
y: ey + 4,
|
|
46709
46709
|
fontSize: 11,
|
|
46710
46710
|
fontWeight: 500,
|
|
46711
46711
|
fill: color,
|
|
46712
46712
|
opacity: 0.6,
|
|
46713
46713
|
fontFamily: "inherit",
|
|
46714
|
+
textAnchor: "end",
|
|
46714
46715
|
children: evt
|
|
46715
46716
|
}
|
|
46716
46717
|
),
|
|
@@ -52601,15 +52602,21 @@ function layoutOrbitals(count, containerW, containerH) {
|
|
|
52601
52602
|
const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
|
|
52602
52603
|
const rows = Math.ceil(count / cols);
|
|
52603
52604
|
const edgePad = 24;
|
|
52604
|
-
const
|
|
52605
|
-
const
|
|
52606
|
-
const
|
|
52607
|
-
const
|
|
52608
|
-
const
|
|
52609
|
-
const
|
|
52605
|
+
const fitMinCx = UNIT_DISPLAY_W / 2 + edgePad;
|
|
52606
|
+
const fitMinCy = UNIT_DISPLAY_H / 2 + edgePad;
|
|
52607
|
+
const fitMaxCx = Math.max(fitMinCx, containerW - UNIT_DISPLAY_W / 2 - edgePad);
|
|
52608
|
+
const fitMaxCy = Math.max(fitMinCy, containerH - UNIT_DISPLAY_H / 2 - edgePad);
|
|
52609
|
+
const fitStepX = cols > 1 ? (fitMaxCx - fitMinCx) / (cols - 1) : 0;
|
|
52610
|
+
const fitStepY = rows > 1 ? (fitMaxCy - fitMinCy) / (rows - 1) : 0;
|
|
52611
|
+
const stepX = Math.min(fitStepX, UNIT_DISPLAY_W * 3.5);
|
|
52612
|
+
const stepY = Math.min(fitStepY, UNIT_DISPLAY_H * 3.5);
|
|
52613
|
+
const gridW = (cols - 1) * stepX;
|
|
52614
|
+
const gridH = (rows - 1) * stepY;
|
|
52615
|
+
const originX = (containerW - gridW) / 2;
|
|
52616
|
+
const originY = (containerH - gridH) / 2;
|
|
52610
52617
|
return Array.from({ length: count }, (_, i) => ({
|
|
52611
|
-
cx:
|
|
52612
|
-
cy:
|
|
52618
|
+
cx: originX + i % cols * stepX,
|
|
52619
|
+
cy: originY + Math.floor(i / cols) * stepY
|
|
52613
52620
|
}));
|
|
52614
52621
|
}
|
|
52615
52622
|
var avlOczWireId = 0;
|
|
@@ -52889,6 +52896,10 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
52889
52896
|
const [pan, setPan] = useState({ x: 0, y: 0 });
|
|
52890
52897
|
const dragStateRef = useRef(null);
|
|
52891
52898
|
const transformWrapperRef = useRef(null);
|
|
52899
|
+
useEffect(() => {
|
|
52900
|
+
setZoom(1);
|
|
52901
|
+
setPan({ x: 0, y: 0 });
|
|
52902
|
+
}, [state.level]);
|
|
52892
52903
|
const clampZoom = useCallback(
|
|
52893
52904
|
(z) => Math.max(minZoom, Math.min(maxZoom, z)),
|
|
52894
52905
|
[minZoom, maxZoom]
|
|
@@ -52948,7 +52959,7 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
52948
52959
|
};
|
|
52949
52960
|
wrapper.addEventListener("wheel", wheelListener, { passive: false });
|
|
52950
52961
|
return () => wrapper.removeEventListener("wheel", wheelListener);
|
|
52951
|
-
}, [clampZoom]);
|
|
52962
|
+
}, [clampZoom, state.level]);
|
|
52952
52963
|
const zoomIn = useCallback(() => setZoom((z) => clampZoom(z * 1.2)), [clampZoom]);
|
|
52953
52964
|
const zoomOut = useCallback(() => setZoom((z) => clampZoom(z / 1.2)), [clampZoom]);
|
|
52954
52965
|
const resetZoom = useCallback(() => {
|
|
@@ -53203,14 +53214,42 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
53203
53214
|
paddingLeft: 24,
|
|
53204
53215
|
paddingRight: 24
|
|
53205
53216
|
},
|
|
53206
|
-
children: /* @__PURE__ */ jsx(
|
|
53207
|
-
|
|
53217
|
+
children: /* @__PURE__ */ jsx(
|
|
53218
|
+
"div",
|
|
53208
53219
|
{
|
|
53209
|
-
|
|
53210
|
-
|
|
53211
|
-
|
|
53220
|
+
ref: transformWrapperRef,
|
|
53221
|
+
onPointerDown: handlePointerDown,
|
|
53222
|
+
onPointerMove: handlePointerMove,
|
|
53223
|
+
onPointerUp: handlePointerUp,
|
|
53224
|
+
onPointerCancel: handlePointerUp,
|
|
53225
|
+
style: {
|
|
53226
|
+
position: "relative",
|
|
53227
|
+
width: "100%",
|
|
53228
|
+
height: "100%",
|
|
53229
|
+
cursor: dragStateRef.current ? "grabbing" : "grab",
|
|
53230
|
+
overflow: "hidden"
|
|
53231
|
+
},
|
|
53232
|
+
children: /* @__PURE__ */ jsx(
|
|
53233
|
+
"div",
|
|
53234
|
+
{
|
|
53235
|
+
style: {
|
|
53236
|
+
position: "absolute",
|
|
53237
|
+
inset: 0,
|
|
53238
|
+
transform: `translate(${pan.x}px, ${pan.y}px) scale(${zoom})`,
|
|
53239
|
+
transformOrigin: "0 0"
|
|
53240
|
+
},
|
|
53241
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 600 400", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx(
|
|
53242
|
+
AvlTraitScene,
|
|
53243
|
+
{
|
|
53244
|
+
data: traitLevelData,
|
|
53245
|
+
color,
|
|
53246
|
+
onTransitionClick: (idx) => handleTransitionSelect(idx)
|
|
53247
|
+
}
|
|
53248
|
+
) })
|
|
53249
|
+
}
|
|
53250
|
+
)
|
|
53212
53251
|
}
|
|
53213
|
-
)
|
|
53252
|
+
)
|
|
53214
53253
|
}
|
|
53215
53254
|
),
|
|
53216
53255
|
state.level === "transition" && transitionLevelData && /* @__PURE__ */ jsx(
|
|
@@ -53224,13 +53263,60 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
53224
53263
|
paddingLeft: 24,
|
|
53225
53264
|
paddingRight: 24
|
|
53226
53265
|
},
|
|
53227
|
-
children: /* @__PURE__ */ jsx(
|
|
53228
|
-
|
|
53266
|
+
children: /* @__PURE__ */ jsx(
|
|
53267
|
+
"div",
|
|
53229
53268
|
{
|
|
53230
|
-
|
|
53231
|
-
|
|
53269
|
+
ref: transformWrapperRef,
|
|
53270
|
+
onPointerDown: handlePointerDown,
|
|
53271
|
+
onPointerMove: handlePointerMove,
|
|
53272
|
+
onPointerUp: handlePointerUp,
|
|
53273
|
+
onPointerCancel: handlePointerUp,
|
|
53274
|
+
style: {
|
|
53275
|
+
position: "relative",
|
|
53276
|
+
width: "100%",
|
|
53277
|
+
height: "100%",
|
|
53278
|
+
cursor: dragStateRef.current ? "grabbing" : "grab",
|
|
53279
|
+
overflow: "hidden"
|
|
53280
|
+
},
|
|
53281
|
+
children: /* @__PURE__ */ jsx(
|
|
53282
|
+
"div",
|
|
53283
|
+
{
|
|
53284
|
+
style: {
|
|
53285
|
+
position: "absolute",
|
|
53286
|
+
inset: 0,
|
|
53287
|
+
transform: `translate(${pan.x}px, ${pan.y}px) scale(${zoom})`,
|
|
53288
|
+
transformOrigin: "0 0"
|
|
53289
|
+
},
|
|
53290
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 600 400", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx(
|
|
53291
|
+
AvlTransitionScene,
|
|
53292
|
+
{
|
|
53293
|
+
data: transitionLevelData,
|
|
53294
|
+
color
|
|
53295
|
+
}
|
|
53296
|
+
) })
|
|
53297
|
+
}
|
|
53298
|
+
)
|
|
53232
53299
|
}
|
|
53233
|
-
)
|
|
53300
|
+
)
|
|
53301
|
+
}
|
|
53302
|
+
),
|
|
53303
|
+
(state.level === "trait" || state.level === "transition") && /* @__PURE__ */ jsxs(
|
|
53304
|
+
Box,
|
|
53305
|
+
{
|
|
53306
|
+
position: "absolute",
|
|
53307
|
+
style: {
|
|
53308
|
+
top: 12,
|
|
53309
|
+
right: 12,
|
|
53310
|
+
display: "flex",
|
|
53311
|
+
flexDirection: "column",
|
|
53312
|
+
gap: 4,
|
|
53313
|
+
zIndex: 30
|
|
53314
|
+
},
|
|
53315
|
+
children: [
|
|
53316
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", onClick: zoomIn, title: "Zoom in", action: "COSMIC_ZOOM_IN", children: /* @__PURE__ */ jsx(Icon, { name: "plus", size: "sm" }) }),
|
|
53317
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", onClick: zoomOut, title: "Zoom out", action: "COSMIC_ZOOM_OUT", children: /* @__PURE__ */ jsx(Icon, { name: "minus", size: "sm" }) }),
|
|
53318
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", onClick: resetZoom, title: "Reset", action: "COSMIC_ZOOM_RESET", children: /* @__PURE__ */ jsx(Icon, { name: "maximize", size: "sm" }) })
|
|
53319
|
+
]
|
|
53234
53320
|
}
|
|
53235
53321
|
)
|
|
53236
53322
|
]
|