@almadar/ui 5.140.0 → 5.142.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 +1380 -1226
- package/dist/avl/index.js +409 -255
- package/dist/{avl-schema-parser-B8Onmfsu.d.cts → avl-schema-parser-DAs12kxP.d.ts} +229 -2
- package/dist/{avl-schema-parser-B8Onmfsu.d.ts → avl-schema-parser-wOkfbwAh.d.cts} +229 -2
- package/dist/{cn-Do5Ra3l3.d.ts → cn-BDwC4QpH.d.ts} +1 -1
- package/dist/{cn-DkGYzPOg.d.cts → cn-rwc3svaX.d.cts} +1 -1
- package/dist/components/index.cjs +1364 -1210
- package/dist/components/index.d.cts +13 -6
- package/dist/components/index.d.ts +13 -6
- package/dist/components/index.js +400 -246
- package/dist/lib/drawable/three/index.cjs +542 -154
- package/dist/lib/drawable/three/index.d.cts +14 -171
- package/dist/lib/drawable/three/index.d.ts +14 -171
- package/dist/lib/drawable/three/index.js +518 -130
- package/dist/lib/index.d.cts +2 -2
- package/dist/lib/index.d.ts +2 -2
- package/dist/{paintDispatch-B5pPeSEp.d.cts → paintDispatch-BQn5Lyx1.d.cts} +160 -3
- package/dist/{paintDispatch-B5pPeSEp.d.ts → paintDispatch-BQn5Lyx1.d.ts} +160 -3
- package/dist/providers/index.cjs +1263 -1109
- package/dist/providers/index.js +384 -230
- package/dist/runtime/index.cjs +1241 -1087
- package/dist/runtime/index.js +389 -235
- package/package.json +4 -4
package/dist/runtime/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React85 from 'react';
|
|
2
|
+
import React85__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
|
|
3
3
|
import { EventBusContext, useTraitScopeChain, useEntitySchemaOptional, useEntityBindingSnapshot, useTraitScope, useEntitySchema, getAllPages, matchPathAmong, OrbitalProvider, TraitScopeProvider, ServerBridgeProvider, useCurrentPagePath, useGameAudioContextOptional, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge, EntityBindingContext } from '@almadar/ui/providers';
|
|
4
4
|
export { EntitySchemaProvider, ServerBridgeProvider, TraitContext, TraitProvider, useEntitySchema, useEntitySchemaOptional, useServerBridge, useTrait, useTraitContext } from '@almadar/ui/providers';
|
|
5
5
|
import { createLogger, setNamespaceLevel, isLogLevelEnabled } from '@almadar/logger';
|
|
@@ -825,7 +825,7 @@ function resolveMarkerExpression(expression, entity, config, state) {
|
|
|
825
825
|
function isPlainObject(value) {
|
|
826
826
|
if (value === null || value === void 0 || typeof value !== "object") return false;
|
|
827
827
|
if (Array.isArray(value)) return false;
|
|
828
|
-
if (
|
|
828
|
+
if (React85__default.isValidElement(value)) return false;
|
|
829
829
|
if (value instanceof Date) return false;
|
|
830
830
|
if (typeof value === "function") return false;
|
|
831
831
|
return true;
|
|
@@ -998,7 +998,7 @@ var init_Box = __esm({
|
|
|
998
998
|
fixed: "fixed",
|
|
999
999
|
sticky: "sticky"
|
|
1000
1000
|
};
|
|
1001
|
-
Box =
|
|
1001
|
+
Box = React85__default.forwardRef(
|
|
1002
1002
|
({
|
|
1003
1003
|
padding,
|
|
1004
1004
|
paddingX,
|
|
@@ -1063,7 +1063,7 @@ var init_Box = __esm({
|
|
|
1063
1063
|
onPointerDown?.(e);
|
|
1064
1064
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
1065
1065
|
const isClickable = action || onClick;
|
|
1066
|
-
return
|
|
1066
|
+
return React85__default.createElement(
|
|
1067
1067
|
Component,
|
|
1068
1068
|
{
|
|
1069
1069
|
ref,
|
|
@@ -1280,7 +1280,7 @@ var init_Icon = __esm({
|
|
|
1280
1280
|
const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
|
|
1281
1281
|
const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
|
|
1282
1282
|
const family = useIconFamily();
|
|
1283
|
-
const RenderedComponent =
|
|
1283
|
+
const RenderedComponent = React85__default.useMemo(() => {
|
|
1284
1284
|
if (directIcon) return null;
|
|
1285
1285
|
return effectiveName ? resolveIconForFamily(effectiveName) : null;
|
|
1286
1286
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1404,7 +1404,7 @@ var init_atlasSlice = __esm({
|
|
|
1404
1404
|
}
|
|
1405
1405
|
});
|
|
1406
1406
|
function useAtlasSliceDataUrl(asset) {
|
|
1407
|
-
const [, bump] =
|
|
1407
|
+
const [, bump] = React85.useReducer((x) => x + 1, 0);
|
|
1408
1408
|
if (!isAtlasAsset(asset)) return void 0;
|
|
1409
1409
|
const key = `${asset.atlas}#${asset.sprite}`;
|
|
1410
1410
|
const cached = sliceDataUrlCache.get(key);
|
|
@@ -1467,13 +1467,13 @@ function AtlasImage({
|
|
|
1467
1467
|
style,
|
|
1468
1468
|
"aria-hidden": ariaHidden
|
|
1469
1469
|
}) {
|
|
1470
|
-
const [, bump] =
|
|
1471
|
-
const canvasRef =
|
|
1470
|
+
const [, bump] = React85.useReducer((x) => x + 1, 0);
|
|
1471
|
+
const canvasRef = React85.useRef(null);
|
|
1472
1472
|
const sliced = isAtlasAsset(asset);
|
|
1473
1473
|
const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
|
|
1474
1474
|
const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
1475
1475
|
const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
|
|
1476
|
-
|
|
1476
|
+
React85.useEffect(() => {
|
|
1477
1477
|
const canvas = canvasRef.current;
|
|
1478
1478
|
if (!canvas || !img || !rect) return;
|
|
1479
1479
|
canvas.width = rect.sw;
|
|
@@ -1549,7 +1549,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1549
1549
|
const IconComp = value;
|
|
1550
1550
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1551
1551
|
}
|
|
1552
|
-
if (
|
|
1552
|
+
if (React85__default.isValidElement(value)) {
|
|
1553
1553
|
return value;
|
|
1554
1554
|
}
|
|
1555
1555
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -1626,7 +1626,7 @@ var init_Button = __esm({
|
|
|
1626
1626
|
md: "h-icon-default w-icon-default",
|
|
1627
1627
|
lg: "h-icon-default w-icon-default"
|
|
1628
1628
|
};
|
|
1629
|
-
Button =
|
|
1629
|
+
Button = React85__default.forwardRef(
|
|
1630
1630
|
({
|
|
1631
1631
|
className,
|
|
1632
1632
|
variant = "primary",
|
|
@@ -1696,7 +1696,7 @@ var Dialog;
|
|
|
1696
1696
|
var init_Dialog = __esm({
|
|
1697
1697
|
"components/core/atoms/Dialog.tsx"() {
|
|
1698
1698
|
init_cn();
|
|
1699
|
-
Dialog =
|
|
1699
|
+
Dialog = React85__default.forwardRef(
|
|
1700
1700
|
({
|
|
1701
1701
|
role = "dialog",
|
|
1702
1702
|
"aria-modal": ariaModal = true,
|
|
@@ -1907,7 +1907,7 @@ var init_Typography = __esm({
|
|
|
1907
1907
|
if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
|
|
1908
1908
|
body = formatValue(body, format);
|
|
1909
1909
|
}
|
|
1910
|
-
return
|
|
1910
|
+
return React85__default.createElement(
|
|
1911
1911
|
Component,
|
|
1912
1912
|
{
|
|
1913
1913
|
id,
|
|
@@ -2470,7 +2470,7 @@ var init_Badge = __esm({
|
|
|
2470
2470
|
md: "px-2.5 py-1 text-sm",
|
|
2471
2471
|
lg: "px-3 py-1.5 text-base"
|
|
2472
2472
|
};
|
|
2473
|
-
Badge =
|
|
2473
|
+
Badge = React85__default.forwardRef(
|
|
2474
2474
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2475
2475
|
const iconSizes3 = {
|
|
2476
2476
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2820,7 +2820,7 @@ var init_SvgFlow = __esm({
|
|
|
2820
2820
|
width = 100,
|
|
2821
2821
|
height = 100
|
|
2822
2822
|
}) => {
|
|
2823
|
-
const markerId =
|
|
2823
|
+
const markerId = React85__default.useMemo(() => {
|
|
2824
2824
|
flowIdCounter += 1;
|
|
2825
2825
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2826
2826
|
}, []);
|
|
@@ -3413,7 +3413,7 @@ var init_SvgRing = __esm({
|
|
|
3413
3413
|
width = 100,
|
|
3414
3414
|
height = 100
|
|
3415
3415
|
}) => {
|
|
3416
|
-
const gradientId =
|
|
3416
|
+
const gradientId = React85__default.useMemo(() => {
|
|
3417
3417
|
ringIdCounter += 1;
|
|
3418
3418
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3419
3419
|
}, []);
|
|
@@ -3594,7 +3594,7 @@ var init_Input = __esm({
|
|
|
3594
3594
|
init_cn();
|
|
3595
3595
|
init_Icon();
|
|
3596
3596
|
init_useEventBus();
|
|
3597
|
-
Input =
|
|
3597
|
+
Input = React85__default.forwardRef(
|
|
3598
3598
|
({
|
|
3599
3599
|
className,
|
|
3600
3600
|
inputType,
|
|
@@ -3618,9 +3618,9 @@ var init_Input = __esm({
|
|
|
3618
3618
|
const eventBus = useEventBus();
|
|
3619
3619
|
const type = inputType || htmlType || "text";
|
|
3620
3620
|
const isDeclarative = typeof onChange === "string";
|
|
3621
|
-
const [localValue, setLocalValue] =
|
|
3622
|
-
const pendingEchoRef =
|
|
3623
|
-
|
|
3621
|
+
const [localValue, setLocalValue] = React85__default.useState(value);
|
|
3622
|
+
const pendingEchoRef = React85__default.useRef(/* @__PURE__ */ new Set());
|
|
3623
|
+
React85__default.useEffect(() => {
|
|
3624
3624
|
if (!isDeclarative) return;
|
|
3625
3625
|
const incoming = value == null ? "" : String(value);
|
|
3626
3626
|
if (pendingEchoRef.current.has(incoming)) {
|
|
@@ -3780,7 +3780,7 @@ var Label;
|
|
|
3780
3780
|
var init_Label = __esm({
|
|
3781
3781
|
"components/core/atoms/Label.tsx"() {
|
|
3782
3782
|
init_cn();
|
|
3783
|
-
Label =
|
|
3783
|
+
Label = React85__default.forwardRef(
|
|
3784
3784
|
({ className, required, children, ...props }, ref) => {
|
|
3785
3785
|
return /* @__PURE__ */ jsxs(
|
|
3786
3786
|
"label",
|
|
@@ -3807,7 +3807,7 @@ var init_Textarea = __esm({
|
|
|
3807
3807
|
"components/core/atoms/Textarea.tsx"() {
|
|
3808
3808
|
init_cn();
|
|
3809
3809
|
init_useEventBus();
|
|
3810
|
-
Textarea =
|
|
3810
|
+
Textarea = React85__default.forwardRef(
|
|
3811
3811
|
({ className, error, onChange, ...props }, ref) => {
|
|
3812
3812
|
const eventBus = useEventBus();
|
|
3813
3813
|
const handleChange = (e) => {
|
|
@@ -4046,7 +4046,7 @@ var init_Select = __esm({
|
|
|
4046
4046
|
init_cn();
|
|
4047
4047
|
init_Icon();
|
|
4048
4048
|
init_useEventBus();
|
|
4049
|
-
Select =
|
|
4049
|
+
Select = React85__default.forwardRef(
|
|
4050
4050
|
(props, _ref) => {
|
|
4051
4051
|
const { multiple, searchable, clearable } = props;
|
|
4052
4052
|
if (multiple || searchable || clearable) {
|
|
@@ -4063,7 +4063,7 @@ var init_Checkbox = __esm({
|
|
|
4063
4063
|
"components/core/atoms/Checkbox.tsx"() {
|
|
4064
4064
|
init_cn();
|
|
4065
4065
|
init_useEventBus();
|
|
4066
|
-
Checkbox =
|
|
4066
|
+
Checkbox = React85__default.forwardRef(
|
|
4067
4067
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
4068
4068
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
4069
4069
|
const eventBus = useEventBus();
|
|
@@ -4117,7 +4117,7 @@ var init_Spinner = __esm({
|
|
|
4117
4117
|
md: "h-6 w-6",
|
|
4118
4118
|
lg: "h-8 w-8"
|
|
4119
4119
|
};
|
|
4120
|
-
Spinner =
|
|
4120
|
+
Spinner = React85__default.forwardRef(
|
|
4121
4121
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
4122
4122
|
if (overlay) {
|
|
4123
4123
|
return /* @__PURE__ */ jsx(
|
|
@@ -4207,7 +4207,7 @@ var init_Card = __esm({
|
|
|
4207
4207
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
4208
4208
|
"tile-image-first": "p-0 overflow-hidden"
|
|
4209
4209
|
};
|
|
4210
|
-
Card =
|
|
4210
|
+
Card = React85__default.forwardRef(
|
|
4211
4211
|
({
|
|
4212
4212
|
className,
|
|
4213
4213
|
variant = "bordered",
|
|
@@ -4256,9 +4256,9 @@ var init_Card = __esm({
|
|
|
4256
4256
|
}
|
|
4257
4257
|
);
|
|
4258
4258
|
Card.displayName = "Card";
|
|
4259
|
-
CardHeader =
|
|
4259
|
+
CardHeader = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
4260
4260
|
CardHeader.displayName = "CardHeader";
|
|
4261
|
-
CardTitle =
|
|
4261
|
+
CardTitle = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4262
4262
|
"h3",
|
|
4263
4263
|
{
|
|
4264
4264
|
ref,
|
|
@@ -4271,11 +4271,11 @@ var init_Card = __esm({
|
|
|
4271
4271
|
}
|
|
4272
4272
|
));
|
|
4273
4273
|
CardTitle.displayName = "CardTitle";
|
|
4274
|
-
CardContent =
|
|
4274
|
+
CardContent = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
4275
4275
|
CardContent.displayName = "CardContent";
|
|
4276
4276
|
CardBody = CardContent;
|
|
4277
4277
|
CardBody.displayName = "CardBody";
|
|
4278
|
-
CardFooter =
|
|
4278
|
+
CardFooter = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4279
4279
|
"div",
|
|
4280
4280
|
{
|
|
4281
4281
|
ref,
|
|
@@ -4362,7 +4362,7 @@ var init_FilterPill = __esm({
|
|
|
4362
4362
|
md: "w-3.5 h-3.5",
|
|
4363
4363
|
lg: "w-4 h-4"
|
|
4364
4364
|
};
|
|
4365
|
-
FilterPill =
|
|
4365
|
+
FilterPill = React85__default.forwardRef(
|
|
4366
4366
|
({
|
|
4367
4367
|
className,
|
|
4368
4368
|
variant = "default",
|
|
@@ -4491,8 +4491,8 @@ var init_Avatar = __esm({
|
|
|
4491
4491
|
actionPayload
|
|
4492
4492
|
}) => {
|
|
4493
4493
|
const eventBus = useEventBus();
|
|
4494
|
-
const [imgFailed, setImgFailed] =
|
|
4495
|
-
|
|
4494
|
+
const [imgFailed, setImgFailed] = React85__default.useState(false);
|
|
4495
|
+
React85__default.useEffect(() => {
|
|
4496
4496
|
setImgFailed(false);
|
|
4497
4497
|
}, [src]);
|
|
4498
4498
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4605,7 +4605,7 @@ var init_Center = __esm({
|
|
|
4605
4605
|
as: Component = "div"
|
|
4606
4606
|
}) => {
|
|
4607
4607
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
4608
|
-
return
|
|
4608
|
+
return React85__default.createElement(Component, {
|
|
4609
4609
|
className: cn(
|
|
4610
4610
|
inline ? "inline-flex" : "flex",
|
|
4611
4611
|
horizontal && "justify-center",
|
|
@@ -4873,7 +4873,7 @@ var init_Radio = __esm({
|
|
|
4873
4873
|
md: "w-2.5 h-2.5",
|
|
4874
4874
|
lg: "w-3 h-3"
|
|
4875
4875
|
};
|
|
4876
|
-
Radio =
|
|
4876
|
+
Radio = React85__default.forwardRef(
|
|
4877
4877
|
({
|
|
4878
4878
|
label,
|
|
4879
4879
|
helperText,
|
|
@@ -4890,12 +4890,12 @@ var init_Radio = __esm({
|
|
|
4890
4890
|
onChange,
|
|
4891
4891
|
...props
|
|
4892
4892
|
}, ref) => {
|
|
4893
|
-
const reactId =
|
|
4893
|
+
const reactId = React85__default.useId();
|
|
4894
4894
|
const baseId = id || `radio-${reactId}`;
|
|
4895
4895
|
const hasError = !!error;
|
|
4896
4896
|
const eventBus = useEventBus();
|
|
4897
|
-
const [selected, setSelected] =
|
|
4898
|
-
|
|
4897
|
+
const [selected, setSelected] = React85__default.useState(value);
|
|
4898
|
+
React85__default.useEffect(() => {
|
|
4899
4899
|
if (value !== void 0) setSelected(value);
|
|
4900
4900
|
}, [value]);
|
|
4901
4901
|
const pick = (next, e) => {
|
|
@@ -5077,7 +5077,7 @@ var init_Switch = __esm({
|
|
|
5077
5077
|
"components/core/atoms/Switch.tsx"() {
|
|
5078
5078
|
"use client";
|
|
5079
5079
|
init_cn();
|
|
5080
|
-
Switch =
|
|
5080
|
+
Switch = React85.forwardRef(
|
|
5081
5081
|
({
|
|
5082
5082
|
checked,
|
|
5083
5083
|
defaultChecked = false,
|
|
@@ -5088,10 +5088,10 @@ var init_Switch = __esm({
|
|
|
5088
5088
|
name,
|
|
5089
5089
|
className
|
|
5090
5090
|
}, ref) => {
|
|
5091
|
-
const [isChecked, setIsChecked] =
|
|
5091
|
+
const [isChecked, setIsChecked] = React85.useState(
|
|
5092
5092
|
checked !== void 0 ? checked : defaultChecked
|
|
5093
5093
|
);
|
|
5094
|
-
|
|
5094
|
+
React85.useEffect(() => {
|
|
5095
5095
|
if (checked !== void 0) {
|
|
5096
5096
|
setIsChecked(checked);
|
|
5097
5097
|
}
|
|
@@ -5254,7 +5254,7 @@ var init_Stack = __esm({
|
|
|
5254
5254
|
};
|
|
5255
5255
|
const isHorizontal = direction === "horizontal";
|
|
5256
5256
|
const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
|
|
5257
|
-
return
|
|
5257
|
+
return React85__default.createElement(
|
|
5258
5258
|
Component,
|
|
5259
5259
|
{
|
|
5260
5260
|
className: cn(
|
|
@@ -5454,7 +5454,7 @@ var Aside;
|
|
|
5454
5454
|
var init_Aside = __esm({
|
|
5455
5455
|
"components/core/atoms/Aside.tsx"() {
|
|
5456
5456
|
init_cn();
|
|
5457
|
-
Aside =
|
|
5457
|
+
Aside = React85__default.forwardRef(
|
|
5458
5458
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
5459
5459
|
);
|
|
5460
5460
|
Aside.displayName = "Aside";
|
|
@@ -5533,9 +5533,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5533
5533
|
className
|
|
5534
5534
|
}) => {
|
|
5535
5535
|
const { t } = useTranslate();
|
|
5536
|
-
const [isVisible, setIsVisible] =
|
|
5537
|
-
const timeoutRef =
|
|
5538
|
-
const triggerRef =
|
|
5536
|
+
const [isVisible, setIsVisible] = React85__default.useState(false);
|
|
5537
|
+
const timeoutRef = React85__default.useRef(null);
|
|
5538
|
+
const triggerRef = React85__default.useRef(null);
|
|
5539
5539
|
const handleMouseEnter = () => {
|
|
5540
5540
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5541
5541
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5546,7 +5546,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5546
5546
|
};
|
|
5547
5547
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
5548
5548
|
const open = isVisible || revealed;
|
|
5549
|
-
|
|
5549
|
+
React85__default.useEffect(() => {
|
|
5550
5550
|
return () => {
|
|
5551
5551
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5552
5552
|
};
|
|
@@ -5756,7 +5756,7 @@ var init_StatusDot = __esm({
|
|
|
5756
5756
|
md: "w-2.5 h-2.5",
|
|
5757
5757
|
lg: "w-3 h-3"
|
|
5758
5758
|
};
|
|
5759
|
-
StatusDot =
|
|
5759
|
+
StatusDot = React85__default.forwardRef(
|
|
5760
5760
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5761
5761
|
return /* @__PURE__ */ jsx(
|
|
5762
5762
|
"span",
|
|
@@ -5810,7 +5810,7 @@ var init_TrendIndicator = __esm({
|
|
|
5810
5810
|
down: "trending-down",
|
|
5811
5811
|
flat: "arrow-right"
|
|
5812
5812
|
};
|
|
5813
|
-
TrendIndicator =
|
|
5813
|
+
TrendIndicator = React85__default.forwardRef(
|
|
5814
5814
|
({
|
|
5815
5815
|
className,
|
|
5816
5816
|
value,
|
|
@@ -5879,7 +5879,7 @@ var init_RangeSlider = __esm({
|
|
|
5879
5879
|
md: "w-4 h-4",
|
|
5880
5880
|
lg: "w-5 h-5"
|
|
5881
5881
|
};
|
|
5882
|
-
RangeSlider =
|
|
5882
|
+
RangeSlider = React85__default.forwardRef(
|
|
5883
5883
|
({
|
|
5884
5884
|
className,
|
|
5885
5885
|
min = 0,
|
|
@@ -6455,7 +6455,7 @@ var init_ContentSection = __esm({
|
|
|
6455
6455
|
md: "py-16",
|
|
6456
6456
|
lg: "py-24"
|
|
6457
6457
|
};
|
|
6458
|
-
ContentSection =
|
|
6458
|
+
ContentSection = React85__default.forwardRef(
|
|
6459
6459
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
6460
6460
|
return /* @__PURE__ */ jsx(
|
|
6461
6461
|
Box,
|
|
@@ -6989,7 +6989,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6989
6989
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6990
6990
|
"none": {}
|
|
6991
6991
|
};
|
|
6992
|
-
AnimatedReveal =
|
|
6992
|
+
AnimatedReveal = React85__default.forwardRef(
|
|
6993
6993
|
({
|
|
6994
6994
|
trigger = "scroll",
|
|
6995
6995
|
animation = "fade-up",
|
|
@@ -7149,7 +7149,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
7149
7149
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
7150
7150
|
"use client";
|
|
7151
7151
|
init_cn();
|
|
7152
|
-
AnimatedGraphic =
|
|
7152
|
+
AnimatedGraphic = React85__default.forwardRef(
|
|
7153
7153
|
({
|
|
7154
7154
|
src,
|
|
7155
7155
|
svgContent,
|
|
@@ -7172,7 +7172,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
7172
7172
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
7173
7173
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
7174
7174
|
const prevAnimateRef = useRef(animate);
|
|
7175
|
-
const setRef =
|
|
7175
|
+
const setRef = React85__default.useCallback(
|
|
7176
7176
|
(node) => {
|
|
7177
7177
|
containerRef.current = node;
|
|
7178
7178
|
if (typeof ref === "function") ref(node);
|
|
@@ -7899,9 +7899,9 @@ function ControlButton({
|
|
|
7899
7899
|
className
|
|
7900
7900
|
}) {
|
|
7901
7901
|
const eventBus = useEventBus();
|
|
7902
|
-
const [isPressed, setIsPressed] =
|
|
7902
|
+
const [isPressed, setIsPressed] = React85.useState(false);
|
|
7903
7903
|
const actualPressed = pressed ?? isPressed;
|
|
7904
|
-
const handlePointerDown =
|
|
7904
|
+
const handlePointerDown = React85.useCallback(
|
|
7905
7905
|
(e) => {
|
|
7906
7906
|
e.preventDefault();
|
|
7907
7907
|
if (disabled) return;
|
|
@@ -7911,7 +7911,7 @@ function ControlButton({
|
|
|
7911
7911
|
},
|
|
7912
7912
|
[disabled, pressEvent, eventBus, onPress]
|
|
7913
7913
|
);
|
|
7914
|
-
const handlePointerUp =
|
|
7914
|
+
const handlePointerUp = React85.useCallback(
|
|
7915
7915
|
(e) => {
|
|
7916
7916
|
e.preventDefault();
|
|
7917
7917
|
if (disabled) return;
|
|
@@ -7921,7 +7921,7 @@ function ControlButton({
|
|
|
7921
7921
|
},
|
|
7922
7922
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
7923
7923
|
);
|
|
7924
|
-
const handlePointerLeave =
|
|
7924
|
+
const handlePointerLeave = React85.useCallback(
|
|
7925
7925
|
(e) => {
|
|
7926
7926
|
if (isPressed) {
|
|
7927
7927
|
setIsPressed(false);
|
|
@@ -8179,8 +8179,8 @@ function ControlGrid({
|
|
|
8179
8179
|
className
|
|
8180
8180
|
}) {
|
|
8181
8181
|
const eventBus = useEventBus();
|
|
8182
|
-
const [active, setActive] =
|
|
8183
|
-
const handlePress =
|
|
8182
|
+
const [active, setActive] = React85.useState(/* @__PURE__ */ new Set());
|
|
8183
|
+
const handlePress = React85.useCallback(
|
|
8184
8184
|
(id) => {
|
|
8185
8185
|
setActive((prev) => new Set(prev).add(id));
|
|
8186
8186
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -8194,7 +8194,7 @@ function ControlGrid({
|
|
|
8194
8194
|
},
|
|
8195
8195
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
8196
8196
|
);
|
|
8197
|
-
const handleRelease =
|
|
8197
|
+
const handleRelease = React85.useCallback(
|
|
8198
8198
|
(id) => {
|
|
8199
8199
|
setActive((prev) => {
|
|
8200
8200
|
const next = new Set(prev);
|
|
@@ -8552,7 +8552,7 @@ function GameMenu({
|
|
|
8552
8552
|
}) {
|
|
8553
8553
|
const resolvedOptions = (options?.length ? options : void 0) ?? (menuItems?.length ? menuItems : void 0) ?? DEFAULT_MENU_OPTIONS;
|
|
8554
8554
|
const eventBus = useEventBus();
|
|
8555
|
-
const handleOptionClick =
|
|
8555
|
+
const handleOptionClick = React85.useCallback(
|
|
8556
8556
|
(option) => {
|
|
8557
8557
|
if (option.event) {
|
|
8558
8558
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -8788,7 +8788,7 @@ function StateGraph({
|
|
|
8788
8788
|
}) {
|
|
8789
8789
|
const eventBus = useEventBus();
|
|
8790
8790
|
const nodes = states ?? [];
|
|
8791
|
-
const positions =
|
|
8791
|
+
const positions = React85.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
8792
8792
|
return /* @__PURE__ */ jsxs(
|
|
8793
8793
|
Box,
|
|
8794
8794
|
{
|
|
@@ -8859,8 +8859,8 @@ function MiniMap({
|
|
|
8859
8859
|
tileAssets,
|
|
8860
8860
|
unitAssets
|
|
8861
8861
|
}) {
|
|
8862
|
-
const canvasRef =
|
|
8863
|
-
const imgCacheRef =
|
|
8862
|
+
const canvasRef = React85.useRef(null);
|
|
8863
|
+
const imgCacheRef = React85.useRef(/* @__PURE__ */ new Map());
|
|
8864
8864
|
function loadImg(url) {
|
|
8865
8865
|
const cached = imgCacheRef.current.get(url);
|
|
8866
8866
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -8876,7 +8876,7 @@ function MiniMap({
|
|
|
8876
8876
|
imgCacheRef.current.set(url, img);
|
|
8877
8877
|
return null;
|
|
8878
8878
|
}
|
|
8879
|
-
|
|
8879
|
+
React85.useEffect(() => {
|
|
8880
8880
|
const canvas = canvasRef.current;
|
|
8881
8881
|
if (!canvas) return;
|
|
8882
8882
|
const ctx = canvas.getContext("2d");
|
|
@@ -9167,9 +9167,26 @@ var init_imageCache = __esm({
|
|
|
9167
9167
|
});
|
|
9168
9168
|
|
|
9169
9169
|
// lib/webPainter2d.ts
|
|
9170
|
+
function makeNoiseTile(alpha, color) {
|
|
9171
|
+
const tile = document.createElement("canvas");
|
|
9172
|
+
tile.width = NOISE_CELLS;
|
|
9173
|
+
tile.height = NOISE_CELLS;
|
|
9174
|
+
const t = tile.getContext("2d");
|
|
9175
|
+
if (t) {
|
|
9176
|
+
t.fillStyle = color;
|
|
9177
|
+
for (let y = 0; y < NOISE_CELLS; y++) {
|
|
9178
|
+
for (let x = 0; x < NOISE_CELLS; x++) {
|
|
9179
|
+
t.globalAlpha = noiseHash(x, y) * alpha;
|
|
9180
|
+
t.fillRect(x, y, 1, 1);
|
|
9181
|
+
}
|
|
9182
|
+
}
|
|
9183
|
+
}
|
|
9184
|
+
return tile;
|
|
9185
|
+
}
|
|
9170
9186
|
function createWebPainter(ctx, onAssetLoad) {
|
|
9171
9187
|
let vw = 0;
|
|
9172
9188
|
let vh = 0;
|
|
9189
|
+
const patternCache = /* @__PURE__ */ new Map();
|
|
9173
9190
|
const tracePoly = (points, closed) => {
|
|
9174
9191
|
if (points.length === 0) return;
|
|
9175
9192
|
ctx.beginPath();
|
|
@@ -9177,9 +9194,28 @@ function createWebPainter(ctx, onAssetLoad) {
|
|
|
9177
9194
|
for (let i = 1; i < points.length; i++) ctx.lineTo(points[i].x, points[i].y);
|
|
9178
9195
|
if (closed) ctx.closePath();
|
|
9179
9196
|
};
|
|
9197
|
+
const toCanvasPattern = (style) => {
|
|
9198
|
+
const key = JSON.stringify(style);
|
|
9199
|
+
let pattern = patternCache.get(key);
|
|
9200
|
+
if (pattern === void 0) {
|
|
9201
|
+
if (style.kind === "noise") {
|
|
9202
|
+
pattern = ctx.createPattern(makeNoiseTile(style.alpha ?? 0.12, style.color ?? "#000000"), "repeat");
|
|
9203
|
+
} else {
|
|
9204
|
+
const img = getOrLoadImage(style.url, onAssetLoad);
|
|
9205
|
+
if (!img) return "rgba(0,0,0,0)";
|
|
9206
|
+
pattern = ctx.createPattern(img, "repeat");
|
|
9207
|
+
}
|
|
9208
|
+
if (pattern && style.scale !== void 0 && style.scale !== 1) {
|
|
9209
|
+
pattern.setTransform(new DOMMatrix().scale(style.scale));
|
|
9210
|
+
}
|
|
9211
|
+
patternCache.set(key, pattern);
|
|
9212
|
+
}
|
|
9213
|
+
return pattern ?? "rgba(0,0,0,0)";
|
|
9214
|
+
};
|
|
9180
9215
|
const toCanvasStyle = (style) => {
|
|
9181
9216
|
if (typeof style === "string") return style;
|
|
9182
|
-
|
|
9217
|
+
if (style.kind === "noise" || style.kind === "image") return toCanvasPattern(style);
|
|
9218
|
+
const g = style.kind === "linear" ? ctx.createLinearGradient(style.x1, style.y1, style.x2, style.y2) : style.kind === "conic" ? ctx.createConicGradient(style.angle, style.cx, style.cy) : ctx.createRadialGradient(style.cx, style.cy, 0, style.cx, style.cy, style.r);
|
|
9183
9219
|
for (const stop of style.stops) g.addColorStop(stop.offset, stop.color);
|
|
9184
9220
|
return g;
|
|
9185
9221
|
};
|
|
@@ -9214,6 +9250,19 @@ function createWebPainter(ctx, onAssetLoad) {
|
|
|
9214
9250
|
ctx.shadowColor = shadow ? shadow.color : "transparent";
|
|
9215
9251
|
ctx.shadowBlur = shadow ? shadow.blur : 0;
|
|
9216
9252
|
},
|
|
9253
|
+
setBlend(mode) {
|
|
9254
|
+
ctx.globalCompositeOperation = mode ?? "source-over";
|
|
9255
|
+
},
|
|
9256
|
+
setLineDash(pattern, offset = 0) {
|
|
9257
|
+
ctx.setLineDash(pattern ? [...pattern] : []);
|
|
9258
|
+
ctx.lineDashOffset = offset;
|
|
9259
|
+
},
|
|
9260
|
+
setBlur(px) {
|
|
9261
|
+
ctx.filter = px && px > 0 ? `blur(${px}px)` : "none";
|
|
9262
|
+
},
|
|
9263
|
+
clipPath(d) {
|
|
9264
|
+
ctx.clip(new Path2D(d));
|
|
9265
|
+
},
|
|
9217
9266
|
resolveTexture(url) {
|
|
9218
9267
|
const img = getOrLoadImage(url, onAssetLoad);
|
|
9219
9268
|
if (!img) return null;
|
|
@@ -9289,13 +9338,18 @@ function createWebPainter(ctx, onAssetLoad) {
|
|
|
9289
9338
|
}
|
|
9290
9339
|
};
|
|
9291
9340
|
}
|
|
9292
|
-
var handleByImage, imageByHandle;
|
|
9341
|
+
var handleByImage, imageByHandle, noiseHash, NOISE_CELLS;
|
|
9293
9342
|
var init_webPainter2d = __esm({
|
|
9294
9343
|
"lib/webPainter2d.ts"() {
|
|
9295
9344
|
"use client";
|
|
9296
9345
|
init_imageCache();
|
|
9297
9346
|
handleByImage = /* @__PURE__ */ new WeakMap();
|
|
9298
9347
|
imageByHandle = /* @__PURE__ */ new WeakMap();
|
|
9348
|
+
noiseHash = (x, y) => {
|
|
9349
|
+
const s = Math.sin(x * 12.9898 + y * 78.233) * 43758.5453;
|
|
9350
|
+
return s - Math.floor(s);
|
|
9351
|
+
};
|
|
9352
|
+
NOISE_CELLS = 32;
|
|
9299
9353
|
}
|
|
9300
9354
|
});
|
|
9301
9355
|
|
|
@@ -9520,6 +9574,16 @@ function gradientStyle(g, ox, oy, scale) {
|
|
|
9520
9574
|
stops: g.stops
|
|
9521
9575
|
};
|
|
9522
9576
|
}
|
|
9577
|
+
if (g.kind === "conic") {
|
|
9578
|
+
if (!g.center) return void 0;
|
|
9579
|
+
return {
|
|
9580
|
+
kind: "conic",
|
|
9581
|
+
cx: ox + g.center.x * scale,
|
|
9582
|
+
cy: oy + g.center.y * scale,
|
|
9583
|
+
angle: g.angle ?? 0,
|
|
9584
|
+
stops: g.stops
|
|
9585
|
+
};
|
|
9586
|
+
}
|
|
9523
9587
|
if (!g.center || g.radius === void 0) return void 0;
|
|
9524
9588
|
return {
|
|
9525
9589
|
kind: "radial",
|
|
@@ -9529,6 +9593,13 @@ function gradientStyle(g, ox, oy, scale) {
|
|
|
9529
9593
|
stops: g.stops
|
|
9530
9594
|
};
|
|
9531
9595
|
}
|
|
9596
|
+
function patternStyle(p, unit) {
|
|
9597
|
+
if (p.kind === "image") {
|
|
9598
|
+
if (!p.url) return void 0;
|
|
9599
|
+
return { kind: "image", url: p.url, scale: (p.scale ?? 1) / unit };
|
|
9600
|
+
}
|
|
9601
|
+
return { kind: "noise", scale: (p.scale ?? 2) / unit, alpha: p.alpha, color: p.color };
|
|
9602
|
+
}
|
|
9532
9603
|
function DrawShape(props) {
|
|
9533
9604
|
const register = useContext(DrawableRegistryContext);
|
|
9534
9605
|
if (register) {
|
|
@@ -9557,7 +9628,9 @@ var init_DrawShape = __esm({
|
|
|
9557
9628
|
"radiusY",
|
|
9558
9629
|
"width",
|
|
9559
9630
|
"height",
|
|
9560
|
-
"strokeWidth"
|
|
9631
|
+
"strokeWidth",
|
|
9632
|
+
"strokeDashOffset",
|
|
9633
|
+
"blur"
|
|
9561
9634
|
];
|
|
9562
9635
|
lerp = (a, b, k) => a + (b - a) * k;
|
|
9563
9636
|
paintShape = (painter, rawNode, dctx) => {
|
|
@@ -9567,6 +9640,16 @@ var init_DrawShape = __esm({
|
|
|
9567
9640
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
9568
9641
|
const origin = dctx.projector.project(node.position);
|
|
9569
9642
|
const tileWidth = dctx.projector.tileWidth;
|
|
9643
|
+
const groupScale = dctx.groupScale ?? 1;
|
|
9644
|
+
const strokePx = (node.strokeWidth ?? 1) / groupScale;
|
|
9645
|
+
if (node.blendMode) painter.setBlend(node.blendMode);
|
|
9646
|
+
if (node.strokeDash && node.strokeDash.length > 0) {
|
|
9647
|
+
painter.setLineDash(
|
|
9648
|
+
node.strokeDash.map((v) => v / groupScale),
|
|
9649
|
+
(node.strokeDashOffset ?? 0) / groupScale
|
|
9650
|
+
);
|
|
9651
|
+
}
|
|
9652
|
+
if (node.blur !== void 0 && node.blur > 0) painter.setBlur(node.blur / groupScale);
|
|
9570
9653
|
if (node.rotate) {
|
|
9571
9654
|
const pivot = node.pivot ?? { x: 0.5, y: 0.5 };
|
|
9572
9655
|
const px = origin.x + pivot.x * tileWidth;
|
|
@@ -9575,15 +9658,18 @@ var init_DrawShape = __esm({
|
|
|
9575
9658
|
painter.rotate(node.rotate);
|
|
9576
9659
|
painter.translate(-px, -py);
|
|
9577
9660
|
}
|
|
9578
|
-
if (node.shadow) painter.setShadow({ color: node.shadow.color, blur: node.shadow.blur * tileWidth });
|
|
9661
|
+
if (node.shadow) painter.setShadow({ color: node.shadow.color, blur: node.shadow.blur * tileWidth * groupScale });
|
|
9579
9662
|
const fill = node.fill === "none" ? void 0 : node.fill;
|
|
9580
9663
|
const stroke = node.stroke === "none" ? void 0 : node.stroke;
|
|
9581
9664
|
const pxFill = node.gradient ? gradientStyle(node.gradient, origin.x, origin.y, tileWidth) ?? fill : fill;
|
|
9665
|
+
const pxStroke = node.strokeGradient ? gradientStyle(node.strokeGradient, origin.x, origin.y, tileWidth) ?? stroke : stroke;
|
|
9666
|
+
const patFill = node.fillPattern ? patternStyle(node.fillPattern, groupScale) : void 0;
|
|
9582
9667
|
switch (node.shape) {
|
|
9583
9668
|
case "cell": {
|
|
9584
9669
|
const pts = dctx.projector.cellPath(node.position);
|
|
9585
9670
|
if (pxFill) painter.fillPoly(pts, pxFill);
|
|
9586
|
-
if (
|
|
9671
|
+
if (patFill) painter.fillPoly(pts, patFill);
|
|
9672
|
+
if (pxStroke) painter.strokePoly(pts, pxStroke, strokePx, true);
|
|
9587
9673
|
break;
|
|
9588
9674
|
}
|
|
9589
9675
|
case "rect": {
|
|
@@ -9594,7 +9680,8 @@ var init_DrawShape = __esm({
|
|
|
9594
9680
|
const w = (node.width ?? 0) * tw;
|
|
9595
9681
|
const h = (node.height ?? 0) * tw;
|
|
9596
9682
|
if (pxFill) painter.fillRect(x, y, w, h, pxFill);
|
|
9597
|
-
if (
|
|
9683
|
+
if (patFill) painter.fillRect(x, y, w, h, patFill);
|
|
9684
|
+
if (pxStroke) painter.strokeRect(x, y, w, h, pxStroke, strokePx);
|
|
9598
9685
|
break;
|
|
9599
9686
|
}
|
|
9600
9687
|
case "ellipse": {
|
|
@@ -9605,7 +9692,8 @@ var init_DrawShape = __esm({
|
|
|
9605
9692
|
const rx = (node.radiusX ?? 0) * tw;
|
|
9606
9693
|
const ry = (node.radiusY ?? rx) * tw;
|
|
9607
9694
|
if (pxFill) painter.fillEllipse(cx, cy, rx, ry, pxFill);
|
|
9608
|
-
if (
|
|
9695
|
+
if (patFill) painter.fillEllipse(cx, cy, rx, ry, patFill);
|
|
9696
|
+
if (pxStroke) painter.strokeEllipse(cx, cy, rx, ry, pxStroke, strokePx);
|
|
9609
9697
|
break;
|
|
9610
9698
|
}
|
|
9611
9699
|
case "poly": {
|
|
@@ -9614,16 +9702,27 @@ var init_DrawShape = __esm({
|
|
|
9614
9702
|
y: origin.y + ((node.offsetY ?? 0) + pt.y) * tileWidth
|
|
9615
9703
|
}));
|
|
9616
9704
|
if (pxFill) painter.fillPoly(pts, pxFill);
|
|
9617
|
-
if (
|
|
9705
|
+
if (patFill) painter.fillPoly(pts, patFill);
|
|
9706
|
+
if (pxStroke) painter.strokePoly(pts, pxStroke, strokePx, true);
|
|
9618
9707
|
break;
|
|
9619
9708
|
}
|
|
9620
9709
|
case "path": {
|
|
9621
9710
|
if (!node.d) break;
|
|
9622
9711
|
painter.translate(origin.x + (node.offsetX ?? 0) * tileWidth, origin.y + (node.offsetY ?? 0) * tileWidth);
|
|
9623
9712
|
painter.scale(tileWidth, tileWidth);
|
|
9713
|
+
if (node.strokeDash && node.strokeDash.length > 0) {
|
|
9714
|
+
painter.setLineDash(
|
|
9715
|
+
node.strokeDash.map((v) => v / (groupScale * tileWidth)),
|
|
9716
|
+
(node.strokeDashOffset ?? 0) / (groupScale * tileWidth)
|
|
9717
|
+
);
|
|
9718
|
+
}
|
|
9719
|
+
if (node.blur !== void 0 && node.blur > 0) painter.setBlur(node.blur / (groupScale * tileWidth));
|
|
9624
9720
|
const localFill = node.gradient ? gradientStyle(node.gradient, 0, 0, 1) ?? fill : fill;
|
|
9721
|
+
const localStroke = node.strokeGradient ? gradientStyle(node.strokeGradient, 0, 0, 1) ?? stroke : stroke;
|
|
9722
|
+
const localPat = node.fillPattern ? patternStyle(node.fillPattern, groupScale * tileWidth) : void 0;
|
|
9625
9723
|
if (localFill) painter.fillPath(node.d, localFill);
|
|
9626
|
-
if (
|
|
9724
|
+
if (localPat) painter.fillPath(node.d, localPat);
|
|
9725
|
+
if (localStroke) painter.strokePath(node.d, localStroke, strokePx / tileWidth);
|
|
9627
9726
|
break;
|
|
9628
9727
|
}
|
|
9629
9728
|
}
|
|
@@ -9704,8 +9803,6 @@ var init_DrawTextLayer = __esm({
|
|
|
9704
9803
|
};
|
|
9705
9804
|
}
|
|
9706
9805
|
});
|
|
9707
|
-
|
|
9708
|
-
// lib/drawable/paintDispatch.ts
|
|
9709
9806
|
function paintDrawable(painter, node, dctx) {
|
|
9710
9807
|
switch (node.type) {
|
|
9711
9808
|
case "draw-sprite":
|
|
@@ -9726,10 +9823,20 @@ function paintDrawable(painter, node, dctx) {
|
|
|
9726
9823
|
if (node.scale !== void 0) painter.scale(node.scale, node.scale);
|
|
9727
9824
|
if (node.rotate !== void 0) painter.rotate(node.rotate);
|
|
9728
9825
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
9729
|
-
|
|
9826
|
+
if (node.clip) {
|
|
9827
|
+
const tw = dctx.projector.tileWidth;
|
|
9828
|
+
painter.scale(tw, tw);
|
|
9829
|
+
painter.clipPath(node.clip);
|
|
9830
|
+
painter.scale(1 / tw, 1 / tw);
|
|
9831
|
+
}
|
|
9832
|
+
const childCtx = node.scale !== void 0 && node.scale !== 1 ? { ...dctx, groupScale: (dctx.groupScale ?? 1) * node.scale } : dctx;
|
|
9833
|
+
for (const item of node.items) paintDrawable(painter, item, childCtx);
|
|
9730
9834
|
painter.restore();
|
|
9731
9835
|
break;
|
|
9732
9836
|
}
|
|
9837
|
+
case "draw-mesh":
|
|
9838
|
+
warnUnsupported2d("draw-mesh");
|
|
9839
|
+
break;
|
|
9733
9840
|
case "draw-sprite-layer":
|
|
9734
9841
|
paintSpriteLayer(painter, node, dctx);
|
|
9735
9842
|
break;
|
|
@@ -9741,6 +9848,7 @@ function paintDrawable(painter, node, dctx) {
|
|
|
9741
9848
|
break;
|
|
9742
9849
|
}
|
|
9743
9850
|
}
|
|
9851
|
+
var paint2dLog, warnedUnsupported2d, warnUnsupported2d;
|
|
9744
9852
|
var init_paintDispatch = __esm({
|
|
9745
9853
|
"lib/drawable/paintDispatch.ts"() {
|
|
9746
9854
|
init_contract();
|
|
@@ -9750,6 +9858,13 @@ var init_paintDispatch = __esm({
|
|
|
9750
9858
|
init_DrawSpriteLayer();
|
|
9751
9859
|
init_DrawShapeLayer();
|
|
9752
9860
|
init_DrawTextLayer();
|
|
9861
|
+
paint2dLog = createLogger("almadar:ui:drawable-2d");
|
|
9862
|
+
warnedUnsupported2d = /* @__PURE__ */ new Set();
|
|
9863
|
+
warnUnsupported2d = (kind) => {
|
|
9864
|
+
if (warnedUnsupported2d.has(kind)) return;
|
|
9865
|
+
warnedUnsupported2d.add(kind);
|
|
9866
|
+
paint2dLog.warn("unsupported drawable kind on the 2D painter \u2014 skipped", { kind });
|
|
9867
|
+
};
|
|
9753
9868
|
}
|
|
9754
9869
|
});
|
|
9755
9870
|
|
|
@@ -9764,6 +9879,7 @@ function collectDrawnItems(nodes) {
|
|
|
9764
9879
|
case "draw-shape":
|
|
9765
9880
|
case "draw-text":
|
|
9766
9881
|
case "draw-group":
|
|
9882
|
+
case "draw-mesh":
|
|
9767
9883
|
if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id });
|
|
9768
9884
|
break;
|
|
9769
9885
|
case "draw-sprite-layer":
|
|
@@ -9834,7 +9950,7 @@ function Canvas2D({
|
|
|
9834
9950
|
const registerChildDrawable = useCallback((node) => {
|
|
9835
9951
|
childDrawablesRef.current.push(node);
|
|
9836
9952
|
}, []);
|
|
9837
|
-
const hasJsxChildren =
|
|
9953
|
+
const hasJsxChildren = React85.Children.count(children) > 0;
|
|
9838
9954
|
function isDrawableLayer(node) {
|
|
9839
9955
|
return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
|
|
9840
9956
|
}
|
|
@@ -10363,6 +10479,8 @@ function Canvas({
|
|
|
10363
10479
|
showCoordinates,
|
|
10364
10480
|
showTileInfo,
|
|
10365
10481
|
fogOfWar,
|
|
10482
|
+
lighting,
|
|
10483
|
+
post,
|
|
10366
10484
|
tileClickEvent,
|
|
10367
10485
|
unitClickEvent,
|
|
10368
10486
|
tileHoverEvent,
|
|
@@ -10374,13 +10492,29 @@ function Canvas({
|
|
|
10374
10492
|
}) {
|
|
10375
10493
|
canvasLog.debug("Canvas render", { mode, drawablesCount: drawables?.length, projection, camera: camera ? JSON.stringify(camera) : void 0 });
|
|
10376
10494
|
const zoom = camera?.zoom;
|
|
10495
|
+
const childDrawablesRef = useRef([]);
|
|
10496
|
+
if (mode === "3d") childDrawablesRef.current = [];
|
|
10497
|
+
const registerChildDrawable = useCallback((node) => {
|
|
10498
|
+
childDrawablesRef.current.push(node);
|
|
10499
|
+
}, []);
|
|
10500
|
+
const [childDrawables, setChildDrawables] = useState([]);
|
|
10501
|
+
useEffect(() => {
|
|
10502
|
+
if (mode !== "3d") return;
|
|
10503
|
+
const next = childDrawablesRef.current;
|
|
10504
|
+
canvasLog.debug("children:adopt", { registered: next.length, adopted: childDrawables.length });
|
|
10505
|
+
if (next.length === 0 && React85.Children.count(children) > 0) return;
|
|
10506
|
+
setChildDrawables(
|
|
10507
|
+
(prev) => prev.length === next.length && JSON.stringify(prev) === JSON.stringify(next) ? prev : [...next]
|
|
10508
|
+
);
|
|
10509
|
+
});
|
|
10377
10510
|
if (mode === "3d") {
|
|
10378
10511
|
const props3d = {
|
|
10379
10512
|
className,
|
|
10380
|
-
drawables,
|
|
10513
|
+
drawables: [...drawables ?? [], ...childDrawables],
|
|
10381
10514
|
isLoading,
|
|
10382
10515
|
cameraMode: to3DCameraMode(camera?.mode),
|
|
10383
10516
|
...zoom !== void 0 ? { scale: zoom } : {},
|
|
10517
|
+
...camera?.fov !== void 0 ? { fov: camera.fov } : {},
|
|
10384
10518
|
...camera?.target !== void 0 ? { followTarget: camera.target } : {},
|
|
10385
10519
|
unitScale,
|
|
10386
10520
|
backgroundColor,
|
|
@@ -10392,6 +10526,8 @@ function Canvas({
|
|
|
10392
10526
|
showCoordinates,
|
|
10393
10527
|
showTileInfo,
|
|
10394
10528
|
fogOfWar,
|
|
10529
|
+
lighting,
|
|
10530
|
+
post,
|
|
10395
10531
|
tileClickEvent,
|
|
10396
10532
|
unitClickEvent,
|
|
10397
10533
|
tileHoverEvent,
|
|
@@ -10400,7 +10536,10 @@ function Canvas({
|
|
|
10400
10536
|
keyMap,
|
|
10401
10537
|
keyUpMap
|
|
10402
10538
|
};
|
|
10403
|
-
return /* @__PURE__ */
|
|
10539
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10540
|
+
/* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Canvas3DHost, { ...props3d }) }),
|
|
10541
|
+
React85.Children.count(children) > 0 && /* @__PURE__ */ jsx(DrawableRegistryContext.Provider, { value: registerChildDrawable, children: /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, children }) })
|
|
10542
|
+
] });
|
|
10404
10543
|
}
|
|
10405
10544
|
return /* @__PURE__ */ jsx(
|
|
10406
10545
|
Canvas2D,
|
|
@@ -10432,6 +10571,7 @@ var Canvas3DHost, canvasLog;
|
|
|
10432
10571
|
var init_Canvas = __esm({
|
|
10433
10572
|
"components/game/molecules/Canvas.tsx"() {
|
|
10434
10573
|
"use client";
|
|
10574
|
+
init_registry();
|
|
10435
10575
|
init_Canvas2D();
|
|
10436
10576
|
Canvas3DHost = lazy(
|
|
10437
10577
|
() => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.Canvas3DHost }))
|
|
@@ -10556,7 +10696,7 @@ function LinearView({
|
|
|
10556
10696
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
10557
10697
|
const isDone = i < currentIdx;
|
|
10558
10698
|
const isCurrent = i === currentIdx;
|
|
10559
|
-
return /* @__PURE__ */ jsxs(
|
|
10699
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
10560
10700
|
i > 0 && /* @__PURE__ */ jsx(
|
|
10561
10701
|
Typography,
|
|
10562
10702
|
{
|
|
@@ -11091,7 +11231,7 @@ function SequenceBar({
|
|
|
11091
11231
|
else onSlotRemove?.(index);
|
|
11092
11232
|
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
11093
11233
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
11094
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
11234
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
11095
11235
|
i > 0 && /* @__PURE__ */ jsx(
|
|
11096
11236
|
Typography,
|
|
11097
11237
|
{
|
|
@@ -11740,7 +11880,7 @@ var init_ErrorBoundary = __esm({
|
|
|
11740
11880
|
}
|
|
11741
11881
|
);
|
|
11742
11882
|
};
|
|
11743
|
-
ErrorBoundary = class extends
|
|
11883
|
+
ErrorBoundary = class extends React85__default.Component {
|
|
11744
11884
|
constructor(props) {
|
|
11745
11885
|
super(props);
|
|
11746
11886
|
__publicField(this, "reset", () => {
|
|
@@ -12009,7 +12149,7 @@ var init_Container = __esm({
|
|
|
12009
12149
|
as: Component = "div"
|
|
12010
12150
|
}) => {
|
|
12011
12151
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
12012
|
-
return
|
|
12152
|
+
return React85__default.createElement(
|
|
12013
12153
|
Component,
|
|
12014
12154
|
{
|
|
12015
12155
|
className: cn(
|
|
@@ -14974,7 +15114,7 @@ var init_CodeBlock = __esm({
|
|
|
14974
15114
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
14975
15115
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
14976
15116
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
14977
|
-
CodeBlock =
|
|
15117
|
+
CodeBlock = React85__default.memo(
|
|
14978
15118
|
({
|
|
14979
15119
|
code: rawCode,
|
|
14980
15120
|
language = "text",
|
|
@@ -15562,7 +15702,7 @@ var init_MarkdownContent = __esm({
|
|
|
15562
15702
|
init_Box();
|
|
15563
15703
|
init_CodeBlock();
|
|
15564
15704
|
init_cn();
|
|
15565
|
-
MarkdownContent =
|
|
15705
|
+
MarkdownContent = React85__default.memo(
|
|
15566
15706
|
({ content, direction = "ltr", className }) => {
|
|
15567
15707
|
const { t: _t } = useTranslate();
|
|
15568
15708
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -16839,7 +16979,7 @@ var init_StateMachineView = __esm({
|
|
|
16839
16979
|
style: { top: title ? 30 : 0 },
|
|
16840
16980
|
children: [
|
|
16841
16981
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
16842
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
16982
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React85__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
16843
16983
|
StateNode2,
|
|
16844
16984
|
{
|
|
16845
16985
|
state,
|
|
@@ -22580,8 +22720,8 @@ var init_Menu = __esm({
|
|
|
22580
22720
|
"bottom-end": "bottom-start"
|
|
22581
22721
|
};
|
|
22582
22722
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
22583
|
-
const triggerChild =
|
|
22584
|
-
const triggerElement =
|
|
22723
|
+
const triggerChild = React85__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
22724
|
+
const triggerElement = React85__default.cloneElement(
|
|
22585
22725
|
triggerChild,
|
|
22586
22726
|
{
|
|
22587
22727
|
ref: triggerRef,
|
|
@@ -22676,14 +22816,14 @@ function useDataDnd(args) {
|
|
|
22676
22816
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
22677
22817
|
const enabled = isZone || Boolean(dndRoot);
|
|
22678
22818
|
const eventBus = useEventBus();
|
|
22679
|
-
const parentRoot =
|
|
22819
|
+
const parentRoot = React85__default.useContext(RootCtx);
|
|
22680
22820
|
const isRoot = enabled && parentRoot === null;
|
|
22681
|
-
const zoneId =
|
|
22821
|
+
const zoneId = React85__default.useId();
|
|
22682
22822
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
22683
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
22684
|
-
const optimisticOrdersRef =
|
|
22823
|
+
const [optimisticOrders, setOptimisticOrders] = React85__default.useState(() => /* @__PURE__ */ new Map());
|
|
22824
|
+
const optimisticOrdersRef = React85__default.useRef(optimisticOrders);
|
|
22685
22825
|
optimisticOrdersRef.current = optimisticOrders;
|
|
22686
|
-
const clearOptimisticOrder =
|
|
22826
|
+
const clearOptimisticOrder = React85__default.useCallback((group) => {
|
|
22687
22827
|
setOptimisticOrders((prev) => {
|
|
22688
22828
|
if (!prev.has(group)) return prev;
|
|
22689
22829
|
const next = new Map(prev);
|
|
@@ -22708,7 +22848,7 @@ function useDataDnd(args) {
|
|
|
22708
22848
|
const raw = it[dndItemIdField];
|
|
22709
22849
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
22710
22850
|
}).join("|");
|
|
22711
|
-
const itemIds =
|
|
22851
|
+
const itemIds = React85__default.useMemo(
|
|
22712
22852
|
() => orderedItems.map((it, idx) => {
|
|
22713
22853
|
const raw = it[dndItemIdField];
|
|
22714
22854
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -22719,7 +22859,7 @@ function useDataDnd(args) {
|
|
|
22719
22859
|
const raw = it[dndItemIdField];
|
|
22720
22860
|
return raw != null ? String(raw) : `__${idx}`;
|
|
22721
22861
|
}).join("|");
|
|
22722
|
-
|
|
22862
|
+
React85__default.useEffect(() => {
|
|
22723
22863
|
const root = isRoot ? null : parentRoot;
|
|
22724
22864
|
if (root) {
|
|
22725
22865
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -22727,20 +22867,20 @@ function useDataDnd(args) {
|
|
|
22727
22867
|
clearOptimisticOrder(ownGroup);
|
|
22728
22868
|
}
|
|
22729
22869
|
}, [itemsContentSig, ownGroup]);
|
|
22730
|
-
const zonesRef =
|
|
22731
|
-
const registerZone =
|
|
22870
|
+
const zonesRef = React85__default.useRef(/* @__PURE__ */ new Map());
|
|
22871
|
+
const registerZone = React85__default.useCallback((zoneId2, meta2) => {
|
|
22732
22872
|
zonesRef.current.set(zoneId2, meta2);
|
|
22733
22873
|
}, []);
|
|
22734
|
-
const unregisterZone =
|
|
22874
|
+
const unregisterZone = React85__default.useCallback((zoneId2) => {
|
|
22735
22875
|
zonesRef.current.delete(zoneId2);
|
|
22736
22876
|
}, []);
|
|
22737
|
-
const [activeDrag, setActiveDrag] =
|
|
22738
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
22739
|
-
const meta =
|
|
22877
|
+
const [activeDrag, setActiveDrag] = React85__default.useState(null);
|
|
22878
|
+
const [overZoneGroup, setOverZoneGroup] = React85__default.useState(null);
|
|
22879
|
+
const meta = React85__default.useMemo(
|
|
22740
22880
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
22741
22881
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
22742
22882
|
);
|
|
22743
|
-
|
|
22883
|
+
React85__default.useEffect(() => {
|
|
22744
22884
|
const target = isRoot ? null : parentRoot;
|
|
22745
22885
|
if (!target) {
|
|
22746
22886
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -22759,7 +22899,7 @@ function useDataDnd(args) {
|
|
|
22759
22899
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
22760
22900
|
const sensors = useAlmadarDndSensors(true);
|
|
22761
22901
|
const collisionDetection = almadarDndCollisionDetection;
|
|
22762
|
-
const findZoneByItem =
|
|
22902
|
+
const findZoneByItem = React85__default.useCallback(
|
|
22763
22903
|
(id) => {
|
|
22764
22904
|
for (const z of zonesRef.current.values()) {
|
|
22765
22905
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -22768,7 +22908,7 @@ function useDataDnd(args) {
|
|
|
22768
22908
|
},
|
|
22769
22909
|
[]
|
|
22770
22910
|
);
|
|
22771
|
-
|
|
22911
|
+
React85__default.useCallback(
|
|
22772
22912
|
(group) => {
|
|
22773
22913
|
for (const z of zonesRef.current.values()) {
|
|
22774
22914
|
if (z.group === group) return z;
|
|
@@ -22777,7 +22917,7 @@ function useDataDnd(args) {
|
|
|
22777
22917
|
},
|
|
22778
22918
|
[]
|
|
22779
22919
|
);
|
|
22780
|
-
const handleDragEnd =
|
|
22920
|
+
const handleDragEnd = React85__default.useCallback(
|
|
22781
22921
|
(event) => {
|
|
22782
22922
|
const { active, over } = event;
|
|
22783
22923
|
const activeIdStr = String(active.id);
|
|
@@ -22868,8 +23008,8 @@ function useDataDnd(args) {
|
|
|
22868
23008
|
},
|
|
22869
23009
|
[eventBus]
|
|
22870
23010
|
);
|
|
22871
|
-
const sortableData =
|
|
22872
|
-
const SortableItem =
|
|
23011
|
+
const sortableData = React85__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
23012
|
+
const SortableItem = React85__default.useCallback(
|
|
22873
23013
|
({ id, children }) => {
|
|
22874
23014
|
const {
|
|
22875
23015
|
attributes,
|
|
@@ -22909,7 +23049,7 @@ function useDataDnd(args) {
|
|
|
22909
23049
|
id: droppableId,
|
|
22910
23050
|
data: sortableData
|
|
22911
23051
|
});
|
|
22912
|
-
const ctx =
|
|
23052
|
+
const ctx = React85__default.useContext(RootCtx);
|
|
22913
23053
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
22914
23054
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
22915
23055
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -22924,7 +23064,7 @@ function useDataDnd(args) {
|
|
|
22924
23064
|
showForeignPlaceholder,
|
|
22925
23065
|
ctxAvailable: ctx != null
|
|
22926
23066
|
});
|
|
22927
|
-
|
|
23067
|
+
React85__default.useEffect(() => {
|
|
22928
23068
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
22929
23069
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
22930
23070
|
return /* @__PURE__ */ jsx(
|
|
@@ -22938,11 +23078,11 @@ function useDataDnd(args) {
|
|
|
22938
23078
|
}
|
|
22939
23079
|
);
|
|
22940
23080
|
};
|
|
22941
|
-
const rootContextValue =
|
|
23081
|
+
const rootContextValue = React85__default.useMemo(
|
|
22942
23082
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
22943
23083
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
22944
23084
|
);
|
|
22945
|
-
const handleDragStart =
|
|
23085
|
+
const handleDragStart = React85__default.useCallback((event) => {
|
|
22946
23086
|
const sourceZone = findZoneByItem(event.active.id);
|
|
22947
23087
|
const rect = event.active.rect.current.initial;
|
|
22948
23088
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -22961,7 +23101,7 @@ function useDataDnd(args) {
|
|
|
22961
23101
|
isRoot
|
|
22962
23102
|
});
|
|
22963
23103
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
22964
|
-
const handleDragOver =
|
|
23104
|
+
const handleDragOver = React85__default.useCallback((event) => {
|
|
22965
23105
|
const { active, over } = event;
|
|
22966
23106
|
const overData = over?.data?.current;
|
|
22967
23107
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -23031,7 +23171,7 @@ function useDataDnd(args) {
|
|
|
23031
23171
|
return next;
|
|
23032
23172
|
});
|
|
23033
23173
|
}, []);
|
|
23034
|
-
const handleDragCancel =
|
|
23174
|
+
const handleDragCancel = React85__default.useCallback((event) => {
|
|
23035
23175
|
setActiveDrag(null);
|
|
23036
23176
|
setOverZoneGroup(null);
|
|
23037
23177
|
dndLog.warn("dragCancel", {
|
|
@@ -23039,12 +23179,12 @@ function useDataDnd(args) {
|
|
|
23039
23179
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
23040
23180
|
});
|
|
23041
23181
|
}, []);
|
|
23042
|
-
const handleDragEndWithCleanup =
|
|
23182
|
+
const handleDragEndWithCleanup = React85__default.useCallback((event) => {
|
|
23043
23183
|
handleDragEnd(event);
|
|
23044
23184
|
setActiveDrag(null);
|
|
23045
23185
|
setOverZoneGroup(null);
|
|
23046
23186
|
}, [handleDragEnd]);
|
|
23047
|
-
const wrapContainer =
|
|
23187
|
+
const wrapContainer = React85__default.useCallback(
|
|
23048
23188
|
(children) => {
|
|
23049
23189
|
if (!enabled) return children;
|
|
23050
23190
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -23098,7 +23238,7 @@ var init_useDataDnd = __esm({
|
|
|
23098
23238
|
init_useAlmadarDndCollision();
|
|
23099
23239
|
init_Box();
|
|
23100
23240
|
dndLog = createLogger("almadar:ui:dnd");
|
|
23101
|
-
RootCtx =
|
|
23241
|
+
RootCtx = React85__default.createContext(null);
|
|
23102
23242
|
}
|
|
23103
23243
|
});
|
|
23104
23244
|
function renderIconInput(icon, props) {
|
|
@@ -23640,7 +23780,7 @@ function DataList({
|
|
|
23640
23780
|
}) {
|
|
23641
23781
|
const eventBus = useEventBus();
|
|
23642
23782
|
const { t } = useTranslate();
|
|
23643
|
-
const [visibleCount, setVisibleCount] =
|
|
23783
|
+
const [visibleCount, setVisibleCount] = React85__default.useState(pageSize || Infinity);
|
|
23644
23784
|
const fieldDefs = fields ?? columns ?? [];
|
|
23645
23785
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
23646
23786
|
const dnd = useDataDnd({
|
|
@@ -23656,14 +23796,14 @@ function DataList({
|
|
|
23656
23796
|
dndRoot
|
|
23657
23797
|
});
|
|
23658
23798
|
const orderedData = dnd.orderedItems;
|
|
23659
|
-
const allData =
|
|
23799
|
+
const allData = React85__default.useMemo(
|
|
23660
23800
|
() => sortRows(orderedData, sortBy, sortDirection),
|
|
23661
23801
|
[orderedData, sortBy, sortDirection]
|
|
23662
23802
|
);
|
|
23663
23803
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
23664
23804
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
23665
23805
|
const hasRenderProp = typeof children === "function";
|
|
23666
|
-
|
|
23806
|
+
React85__default.useEffect(() => {
|
|
23667
23807
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
23668
23808
|
const childrenTypeOf = typeof children;
|
|
23669
23809
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -23778,7 +23918,7 @@ function DataList({
|
|
|
23778
23918
|
return v === void 0 || v === null || v === "" ? raw : String(v);
|
|
23779
23919
|
};
|
|
23780
23920
|
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("py-2", className), children: [
|
|
23781
|
-
groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
23921
|
+
groups2.map((group, gi) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
23782
23922
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
23783
23923
|
group.items.map((itemData, index) => {
|
|
23784
23924
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -23977,7 +24117,7 @@ function DataList({
|
|
|
23977
24117
|
className
|
|
23978
24118
|
),
|
|
23979
24119
|
children: [
|
|
23980
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
24120
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
23981
24121
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
23982
24122
|
group.items.map(
|
|
23983
24123
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -24064,7 +24204,7 @@ var init_FormSection = __esm({
|
|
|
24064
24204
|
columns = 1,
|
|
24065
24205
|
className
|
|
24066
24206
|
}) => {
|
|
24067
|
-
const [collapsed, setCollapsed] =
|
|
24207
|
+
const [collapsed, setCollapsed] = React85__default.useState(defaultCollapsed);
|
|
24068
24208
|
const { t } = useTranslate();
|
|
24069
24209
|
const eventBus = useEventBus();
|
|
24070
24210
|
const gridClass = {
|
|
@@ -24072,7 +24212,7 @@ var init_FormSection = __esm({
|
|
|
24072
24212
|
2: "grid-cols-1 md:grid-cols-2",
|
|
24073
24213
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
24074
24214
|
}[columns];
|
|
24075
|
-
|
|
24215
|
+
React85__default.useCallback(() => {
|
|
24076
24216
|
if (collapsible) {
|
|
24077
24217
|
setCollapsed((prev) => !prev);
|
|
24078
24218
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -25053,7 +25193,7 @@ var init_Flex = __esm({
|
|
|
25053
25193
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
25054
25194
|
}
|
|
25055
25195
|
}
|
|
25056
|
-
return
|
|
25196
|
+
return React85__default.createElement(Component, {
|
|
25057
25197
|
className: cn(
|
|
25058
25198
|
inline ? "inline-flex" : "flex",
|
|
25059
25199
|
directionStyles[direction],
|
|
@@ -25172,7 +25312,7 @@ var init_Grid = __esm({
|
|
|
25172
25312
|
as: Component = "div"
|
|
25173
25313
|
}) => {
|
|
25174
25314
|
const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
|
|
25175
|
-
return
|
|
25315
|
+
return React85__default.createElement(
|
|
25176
25316
|
Component,
|
|
25177
25317
|
{
|
|
25178
25318
|
className: cn(
|
|
@@ -25404,9 +25544,9 @@ var init_Popover = __esm({
|
|
|
25404
25544
|
onMouseLeave: handleClose,
|
|
25405
25545
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
25406
25546
|
};
|
|
25407
|
-
const childElement =
|
|
25547
|
+
const childElement = React85__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
25408
25548
|
const childPointerDown = childElement.props.onPointerDown;
|
|
25409
|
-
const triggerElement =
|
|
25549
|
+
const triggerElement = React85__default.cloneElement(
|
|
25410
25550
|
childElement,
|
|
25411
25551
|
{
|
|
25412
25552
|
ref: triggerRef,
|
|
@@ -26015,9 +26155,9 @@ var init_Tooltip = __esm({
|
|
|
26015
26155
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
26016
26156
|
};
|
|
26017
26157
|
}, []);
|
|
26018
|
-
const triggerElement =
|
|
26158
|
+
const triggerElement = React85__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
26019
26159
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
26020
|
-
const trigger =
|
|
26160
|
+
const trigger = React85__default.cloneElement(triggerElement, {
|
|
26021
26161
|
ref: triggerRef,
|
|
26022
26162
|
onMouseEnter: handleMouseEnter,
|
|
26023
26163
|
onMouseLeave: handleMouseLeave,
|
|
@@ -26107,7 +26247,7 @@ var init_WizardProgress = __esm({
|
|
|
26107
26247
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
26108
26248
|
const isActive = index === currentStep;
|
|
26109
26249
|
const isCompleted = index < currentStep;
|
|
26110
|
-
return /* @__PURE__ */ jsxs(
|
|
26250
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
26111
26251
|
/* @__PURE__ */ jsx(
|
|
26112
26252
|
"button",
|
|
26113
26253
|
{
|
|
@@ -27742,13 +27882,13 @@ var init_MapView = __esm({
|
|
|
27742
27882
|
shadowSize: [41, 41]
|
|
27743
27883
|
});
|
|
27744
27884
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
27745
|
-
const { useEffect:
|
|
27885
|
+
const { useEffect: useEffect60, useRef: useRef62, useCallback: useCallback90, useState: useState92 } = React85__default;
|
|
27746
27886
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
27747
27887
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
27748
27888
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
27749
27889
|
const map = useMap();
|
|
27750
|
-
const prevRef =
|
|
27751
|
-
|
|
27890
|
+
const prevRef = useRef62({ centerLat, centerLng, zoom });
|
|
27891
|
+
useEffect60(() => {
|
|
27752
27892
|
const prev = prevRef.current;
|
|
27753
27893
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
27754
27894
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -27759,7 +27899,7 @@ var init_MapView = __esm({
|
|
|
27759
27899
|
}
|
|
27760
27900
|
function MapClickHandler({ onMapClick }) {
|
|
27761
27901
|
const map = useMap();
|
|
27762
|
-
|
|
27902
|
+
useEffect60(() => {
|
|
27763
27903
|
if (!onMapClick) return;
|
|
27764
27904
|
const handler = (e) => {
|
|
27765
27905
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -27787,8 +27927,8 @@ var init_MapView = __esm({
|
|
|
27787
27927
|
showAttribution = true
|
|
27788
27928
|
}) {
|
|
27789
27929
|
const eventBus = useEventBus2();
|
|
27790
|
-
const [clickedPosition, setClickedPosition] =
|
|
27791
|
-
const handleMapClick =
|
|
27930
|
+
const [clickedPosition, setClickedPosition] = useState92(null);
|
|
27931
|
+
const handleMapClick = useCallback90((lat, lng) => {
|
|
27792
27932
|
if (showClickedPin) {
|
|
27793
27933
|
setClickedPosition({ lat, lng });
|
|
27794
27934
|
}
|
|
@@ -27797,7 +27937,7 @@ var init_MapView = __esm({
|
|
|
27797
27937
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
27798
27938
|
}
|
|
27799
27939
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
27800
|
-
const handleMarkerClick =
|
|
27940
|
+
const handleMarkerClick = useCallback90((marker) => {
|
|
27801
27941
|
onMarkerClick?.(marker);
|
|
27802
27942
|
if (markerClickEvent) {
|
|
27803
27943
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -28640,8 +28780,8 @@ function TableView({
|
|
|
28640
28780
|
}) {
|
|
28641
28781
|
const eventBus = useEventBus();
|
|
28642
28782
|
const { t } = useTranslate();
|
|
28643
|
-
const [visibleCount, setVisibleCount] =
|
|
28644
|
-
const [localSelected, setLocalSelected] =
|
|
28783
|
+
const [visibleCount, setVisibleCount] = React85__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
28784
|
+
const [localSelected, setLocalSelected] = React85__default.useState(/* @__PURE__ */ new Set());
|
|
28645
28785
|
const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
|
|
28646
28786
|
const actionDefs = Array.isArray(itemActions) ? itemActions : [];
|
|
28647
28787
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
@@ -28663,7 +28803,7 @@ function TableView({
|
|
|
28663
28803
|
const hasRenderProp = typeof children === "function";
|
|
28664
28804
|
const idField = dndItemIdField ?? "id";
|
|
28665
28805
|
const isCoarsePointer = useMediaQuery("(pointer: coarse)");
|
|
28666
|
-
|
|
28806
|
+
React85__default.useEffect(() => {
|
|
28667
28807
|
tableViewLog.debug("render", {
|
|
28668
28808
|
rowCount: data.length,
|
|
28669
28809
|
colCount: colDefs.length,
|
|
@@ -28720,7 +28860,7 @@ function TableView({
|
|
|
28720
28860
|
};
|
|
28721
28861
|
eventBus.emit(`UI:${itemClickEvent}`, payload);
|
|
28722
28862
|
};
|
|
28723
|
-
const colFloors =
|
|
28863
|
+
const colFloors = React85__default.useMemo(
|
|
28724
28864
|
() => colDefs.map((col) => {
|
|
28725
28865
|
const longest = data.reduce((widest, row) => {
|
|
28726
28866
|
const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
|
|
@@ -28882,12 +29022,12 @@ function TableView({
|
|
|
28882
29022
|
]
|
|
28883
29023
|
}
|
|
28884
29024
|
);
|
|
28885
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
29025
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React85__default.Fragment, { children: rowInner }, id);
|
|
28886
29026
|
};
|
|
28887
29027
|
const items = Array.from(data);
|
|
28888
29028
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
28889
29029
|
let runningIndex = 0;
|
|
28890
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
29030
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
28891
29031
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
28892
29032
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
28893
29033
|
] }, gi)) });
|
|
@@ -30112,7 +30252,7 @@ var init_StepFlow = __esm({
|
|
|
30112
30252
|
className
|
|
30113
30253
|
}) => {
|
|
30114
30254
|
if (orientation === "vertical") {
|
|
30115
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
30255
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React85__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
30116
30256
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
30117
30257
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30118
30258
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -30123,7 +30263,7 @@ var init_StepFlow = __esm({
|
|
|
30123
30263
|
] })
|
|
30124
30264
|
] }) }, index)) });
|
|
30125
30265
|
}
|
|
30126
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(
|
|
30266
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
30127
30267
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
30128
30268
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30129
30269
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -31113,7 +31253,7 @@ var init_LikertScale = __esm({
|
|
|
31113
31253
|
md: "text-base",
|
|
31114
31254
|
lg: "text-lg"
|
|
31115
31255
|
};
|
|
31116
|
-
LikertScale =
|
|
31256
|
+
LikertScale = React85__default.forwardRef(
|
|
31117
31257
|
({
|
|
31118
31258
|
question,
|
|
31119
31259
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -31125,7 +31265,7 @@ var init_LikertScale = __esm({
|
|
|
31125
31265
|
variant = "radios",
|
|
31126
31266
|
className
|
|
31127
31267
|
}, ref) => {
|
|
31128
|
-
const groupId =
|
|
31268
|
+
const groupId = React85__default.useId();
|
|
31129
31269
|
const eventBus = useEventBus();
|
|
31130
31270
|
const handleSelect = useCallback(
|
|
31131
31271
|
(next) => {
|
|
@@ -33414,7 +33554,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
33414
33554
|
"aria-label": t("aria.breadcrumb"),
|
|
33415
33555
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
33416
33556
|
const isLast = idx === items.length - 1;
|
|
33417
|
-
return /* @__PURE__ */ jsxs(
|
|
33557
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
33418
33558
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
33419
33559
|
Icon,
|
|
33420
33560
|
{
|
|
@@ -34283,7 +34423,7 @@ var init_MiniStateMachine = __esm({
|
|
|
34283
34423
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
34284
34424
|
const tc = transitionCounts[s.name] ?? 0;
|
|
34285
34425
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
34286
|
-
return /* @__PURE__ */ jsxs(
|
|
34426
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
34287
34427
|
/* @__PURE__ */ jsx(
|
|
34288
34428
|
AvlState,
|
|
34289
34429
|
{
|
|
@@ -34487,7 +34627,7 @@ var init_PageHeader = __esm({
|
|
|
34487
34627
|
info: "bg-info/10 text-info"
|
|
34488
34628
|
};
|
|
34489
34629
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
34490
|
-
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(
|
|
34630
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
34491
34631
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
34492
34632
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
34493
34633
|
"a",
|
|
@@ -34845,7 +34985,7 @@ var init_Section = __esm({
|
|
|
34845
34985
|
as: Component = "section"
|
|
34846
34986
|
}) => {
|
|
34847
34987
|
const hasHeader = title || description || action;
|
|
34848
|
-
return
|
|
34988
|
+
return React85__default.createElement(
|
|
34849
34989
|
Component,
|
|
34850
34990
|
{
|
|
34851
34991
|
className: cn(
|
|
@@ -35219,7 +35359,7 @@ var init_WizardContainer = __esm({
|
|
|
35219
35359
|
const isCompleted = index < currentStep;
|
|
35220
35360
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
35221
35361
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
35222
|
-
return /* @__PURE__ */ jsxs(
|
|
35362
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
35223
35363
|
/* @__PURE__ */ jsx(
|
|
35224
35364
|
Button,
|
|
35225
35365
|
{
|
|
@@ -37006,7 +37146,7 @@ var init_ImportPreviewTree = __esm({
|
|
|
37006
37146
|
const renderUnit = (unit, childrenByParent, depth) => {
|
|
37007
37147
|
const summary = fieldSummary(unit);
|
|
37008
37148
|
const children = childrenByParent.get(unit.ref) ?? [];
|
|
37009
|
-
return /* @__PURE__ */ jsxs(
|
|
37149
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
37010
37150
|
/* @__PURE__ */ jsxs(
|
|
37011
37151
|
Box,
|
|
37012
37152
|
{
|
|
@@ -37103,7 +37243,7 @@ var init_ImportProgress = __esm({
|
|
|
37103
37243
|
PIPELINE.map((key, index) => {
|
|
37104
37244
|
const isComplete = index < currentIndex;
|
|
37105
37245
|
const isActive = index === currentIndex;
|
|
37106
|
-
return /* @__PURE__ */ jsxs(
|
|
37246
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
37107
37247
|
index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
|
|
37108
37248
|
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
|
|
37109
37249
|
/* @__PURE__ */ jsx(
|
|
@@ -38205,18 +38345,30 @@ var init_DetailPanel = __esm({
|
|
|
38205
38345
|
DetailPanel.displayName = "DetailPanel";
|
|
38206
38346
|
}
|
|
38207
38347
|
});
|
|
38208
|
-
|
|
38209
|
-
|
|
38210
|
-
|
|
38348
|
+
function DrawGroup(props) {
|
|
38349
|
+
const register = useContext(DrawableRegistryContext);
|
|
38350
|
+
if (register) register({ ...props, type: "draw-group" });
|
|
38211
38351
|
return null;
|
|
38212
38352
|
}
|
|
38213
38353
|
var init_DrawGroup = __esm({
|
|
38214
38354
|
"components/game/atoms/DrawGroup.tsx"() {
|
|
38215
38355
|
"use client";
|
|
38356
|
+
init_registry();
|
|
38357
|
+
}
|
|
38358
|
+
});
|
|
38359
|
+
function DrawMesh(props) {
|
|
38360
|
+
const register = useContext(DrawableRegistryContext);
|
|
38361
|
+
if (register) register({ ...props, type: "draw-mesh" });
|
|
38362
|
+
return null;
|
|
38363
|
+
}
|
|
38364
|
+
var init_DrawMesh = __esm({
|
|
38365
|
+
"components/game/atoms/DrawMesh.tsx"() {
|
|
38366
|
+
"use client";
|
|
38367
|
+
init_registry();
|
|
38216
38368
|
}
|
|
38217
38369
|
});
|
|
38218
38370
|
function extractTitle(children) {
|
|
38219
|
-
if (!
|
|
38371
|
+
if (!React85__default.isValidElement(children)) return void 0;
|
|
38220
38372
|
const props = children.props;
|
|
38221
38373
|
if (typeof props.title === "string") {
|
|
38222
38374
|
return props.title;
|
|
@@ -38566,12 +38718,12 @@ var init_Form = __esm({
|
|
|
38566
38718
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
38567
38719
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
38568
38720
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
38569
|
-
const normalizedInitialData =
|
|
38721
|
+
const normalizedInitialData = React85__default.useMemo(() => {
|
|
38570
38722
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
38571
38723
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
38572
38724
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
38573
38725
|
}, [entity, initialData]);
|
|
38574
|
-
const entityDerivedFields =
|
|
38726
|
+
const entityDerivedFields = React85__default.useMemo(() => {
|
|
38575
38727
|
if (fields && fields.length > 0) return void 0;
|
|
38576
38728
|
if (!resolvedEntity) return void 0;
|
|
38577
38729
|
return resolvedEntity.fields.map(
|
|
@@ -38592,16 +38744,16 @@ var init_Form = __esm({
|
|
|
38592
38744
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
38593
38745
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
38594
38746
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
38595
|
-
const [formData, setFormData] =
|
|
38747
|
+
const [formData, setFormData] = React85__default.useState(
|
|
38596
38748
|
normalizedInitialData
|
|
38597
38749
|
);
|
|
38598
|
-
const [collapsedSections, setCollapsedSections] =
|
|
38750
|
+
const [collapsedSections, setCollapsedSections] = React85__default.useState(
|
|
38599
38751
|
/* @__PURE__ */ new Set()
|
|
38600
38752
|
);
|
|
38601
|
-
const [submitError, setSubmitError] =
|
|
38602
|
-
const formRef =
|
|
38753
|
+
const [submitError, setSubmitError] = React85__default.useState(null);
|
|
38754
|
+
const formRef = React85__default.useRef(null);
|
|
38603
38755
|
const formMode = props.mode;
|
|
38604
|
-
const mountedRef =
|
|
38756
|
+
const mountedRef = React85__default.useRef(false);
|
|
38605
38757
|
if (!mountedRef.current) {
|
|
38606
38758
|
mountedRef.current = true;
|
|
38607
38759
|
debug("forms", "mount", {
|
|
@@ -38614,7 +38766,7 @@ var init_Form = __esm({
|
|
|
38614
38766
|
});
|
|
38615
38767
|
}
|
|
38616
38768
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
38617
|
-
const evalContext =
|
|
38769
|
+
const evalContext = React85__default.useMemo(
|
|
38618
38770
|
() => ({
|
|
38619
38771
|
formValues: formData,
|
|
38620
38772
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -38623,7 +38775,7 @@ var init_Form = __esm({
|
|
|
38623
38775
|
}),
|
|
38624
38776
|
[formData, externalContext]
|
|
38625
38777
|
);
|
|
38626
|
-
|
|
38778
|
+
React85__default.useEffect(() => {
|
|
38627
38779
|
debug("forms", "initialData-sync", {
|
|
38628
38780
|
mode: formMode,
|
|
38629
38781
|
normalizedInitialData,
|
|
@@ -38634,7 +38786,7 @@ var init_Form = __esm({
|
|
|
38634
38786
|
setFormData(normalizedInitialData);
|
|
38635
38787
|
}
|
|
38636
38788
|
}, [normalizedInitialData]);
|
|
38637
|
-
const processCalculations =
|
|
38789
|
+
const processCalculations = React85__default.useCallback(
|
|
38638
38790
|
(changedFieldId, newFormData) => {
|
|
38639
38791
|
if (!hiddenCalculations.length) return;
|
|
38640
38792
|
const context = {
|
|
@@ -38659,7 +38811,7 @@ var init_Form = __esm({
|
|
|
38659
38811
|
},
|
|
38660
38812
|
[hiddenCalculations, externalContext, eventBus]
|
|
38661
38813
|
);
|
|
38662
|
-
const checkViolations =
|
|
38814
|
+
const checkViolations = React85__default.useCallback(
|
|
38663
38815
|
(changedFieldId, newFormData) => {
|
|
38664
38816
|
if (!violationTriggers.length) return;
|
|
38665
38817
|
const context = {
|
|
@@ -38697,7 +38849,7 @@ var init_Form = __esm({
|
|
|
38697
38849
|
processCalculations(name, newFormData);
|
|
38698
38850
|
checkViolations(name, newFormData);
|
|
38699
38851
|
};
|
|
38700
|
-
const isFieldVisible =
|
|
38852
|
+
const isFieldVisible = React85__default.useCallback(
|
|
38701
38853
|
(fieldName) => {
|
|
38702
38854
|
const condition = conditionalFields[fieldName];
|
|
38703
38855
|
if (!condition) return true;
|
|
@@ -38705,7 +38857,7 @@ var init_Form = __esm({
|
|
|
38705
38857
|
},
|
|
38706
38858
|
[conditionalFields, evalContext]
|
|
38707
38859
|
);
|
|
38708
|
-
const isSectionVisible =
|
|
38860
|
+
const isSectionVisible = React85__default.useCallback(
|
|
38709
38861
|
(section) => {
|
|
38710
38862
|
if (!section.condition) return true;
|
|
38711
38863
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -38781,7 +38933,7 @@ var init_Form = __esm({
|
|
|
38781
38933
|
eventBus.emit(`UI:${onCancel}`);
|
|
38782
38934
|
}
|
|
38783
38935
|
};
|
|
38784
|
-
const renderField =
|
|
38936
|
+
const renderField = React85__default.useCallback(
|
|
38785
38937
|
(field) => {
|
|
38786
38938
|
const fieldName = field.name || field.field;
|
|
38787
38939
|
if (!fieldName) return null;
|
|
@@ -38802,7 +38954,7 @@ var init_Form = __esm({
|
|
|
38802
38954
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
38803
38955
|
);
|
|
38804
38956
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
38805
|
-
const normalizedFields =
|
|
38957
|
+
const normalizedFields = React85__default.useMemo(() => {
|
|
38806
38958
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
38807
38959
|
return effectiveFields.map((field) => {
|
|
38808
38960
|
if (typeof field === "string") {
|
|
@@ -38826,7 +38978,7 @@ var init_Form = __esm({
|
|
|
38826
38978
|
return field;
|
|
38827
38979
|
});
|
|
38828
38980
|
}, [effectiveFields, resolvedEntity]);
|
|
38829
|
-
const schemaFields =
|
|
38981
|
+
const schemaFields = React85__default.useMemo(() => {
|
|
38830
38982
|
if (normalizedFields.length === 0) return null;
|
|
38831
38983
|
if (isDebugEnabled()) {
|
|
38832
38984
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -38836,7 +38988,7 @@ var init_Form = __esm({
|
|
|
38836
38988
|
}
|
|
38837
38989
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
38838
38990
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
38839
|
-
const sectionElements =
|
|
38991
|
+
const sectionElements = React85__default.useMemo(() => {
|
|
38840
38992
|
if (!sections || sections.length === 0) return null;
|
|
38841
38993
|
return sections.map((section) => {
|
|
38842
38994
|
if (!isSectionVisible(section)) {
|
|
@@ -39562,7 +39714,7 @@ var init_List = __esm({
|
|
|
39562
39714
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
39563
39715
|
return [];
|
|
39564
39716
|
}, [entity]);
|
|
39565
|
-
const getItemActions =
|
|
39717
|
+
const getItemActions = React85__default.useCallback(
|
|
39566
39718
|
(item) => {
|
|
39567
39719
|
if (!itemActions) return [];
|
|
39568
39720
|
if (typeof itemActions === "function") {
|
|
@@ -40043,7 +40195,7 @@ var init_MediaGallery = __esm({
|
|
|
40043
40195
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
40044
40196
|
);
|
|
40045
40197
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
40046
|
-
const items =
|
|
40198
|
+
const items = React85__default.useMemo(() => {
|
|
40047
40199
|
if (propItems && propItems.length > 0) return propItems;
|
|
40048
40200
|
if (entityData.length === 0) return [];
|
|
40049
40201
|
return entityData.map((record, idx) => {
|
|
@@ -40208,7 +40360,7 @@ var init_MediaGallery = __esm({
|
|
|
40208
40360
|
}
|
|
40209
40361
|
});
|
|
40210
40362
|
function extractTitle2(children) {
|
|
40211
|
-
if (!
|
|
40363
|
+
if (!React85__default.isValidElement(children)) return void 0;
|
|
40212
40364
|
const props = children.props;
|
|
40213
40365
|
if (typeof props.title === "string") {
|
|
40214
40366
|
return props.title;
|
|
@@ -40482,7 +40634,7 @@ var init_debugRegistry = __esm({
|
|
|
40482
40634
|
}
|
|
40483
40635
|
});
|
|
40484
40636
|
function useDebugData() {
|
|
40485
|
-
const [data, setData] =
|
|
40637
|
+
const [data, setData] = React85.useState(() => ({
|
|
40486
40638
|
traits: [],
|
|
40487
40639
|
ticks: [],
|
|
40488
40640
|
guards: [],
|
|
@@ -40496,7 +40648,7 @@ function useDebugData() {
|
|
|
40496
40648
|
},
|
|
40497
40649
|
lastUpdate: Date.now()
|
|
40498
40650
|
}));
|
|
40499
|
-
|
|
40651
|
+
React85.useEffect(() => {
|
|
40500
40652
|
const updateData = () => {
|
|
40501
40653
|
setData({
|
|
40502
40654
|
traits: getAllTraits(),
|
|
@@ -40605,12 +40757,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
40605
40757
|
return positions;
|
|
40606
40758
|
}
|
|
40607
40759
|
function WalkMinimap() {
|
|
40608
|
-
const [walkStep, setWalkStep] =
|
|
40609
|
-
const [traits2, setTraits] =
|
|
40610
|
-
const [coveredEdges, setCoveredEdges] =
|
|
40611
|
-
const [completedTraits, setCompletedTraits] =
|
|
40612
|
-
const prevTraitRef =
|
|
40613
|
-
|
|
40760
|
+
const [walkStep, setWalkStep] = React85.useState(null);
|
|
40761
|
+
const [traits2, setTraits] = React85.useState([]);
|
|
40762
|
+
const [coveredEdges, setCoveredEdges] = React85.useState([]);
|
|
40763
|
+
const [completedTraits, setCompletedTraits] = React85.useState(/* @__PURE__ */ new Set());
|
|
40764
|
+
const prevTraitRef = React85.useRef(null);
|
|
40765
|
+
React85.useEffect(() => {
|
|
40614
40766
|
const interval = setInterval(() => {
|
|
40615
40767
|
const w = window;
|
|
40616
40768
|
const step = w.__orbitalWalkStep;
|
|
@@ -41046,15 +41198,15 @@ var init_EntitiesTab = __esm({
|
|
|
41046
41198
|
});
|
|
41047
41199
|
function EventFlowTab({ events: events2 }) {
|
|
41048
41200
|
const { t } = useTranslate();
|
|
41049
|
-
const [filter, setFilter] =
|
|
41050
|
-
const containerRef =
|
|
41051
|
-
const [autoScroll, setAutoScroll] =
|
|
41052
|
-
|
|
41201
|
+
const [filter, setFilter] = React85.useState("all");
|
|
41202
|
+
const containerRef = React85.useRef(null);
|
|
41203
|
+
const [autoScroll, setAutoScroll] = React85.useState(true);
|
|
41204
|
+
React85.useEffect(() => {
|
|
41053
41205
|
if (autoScroll && containerRef.current) {
|
|
41054
41206
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
41055
41207
|
}
|
|
41056
41208
|
}, [events2.length, autoScroll]);
|
|
41057
|
-
const filteredEvents =
|
|
41209
|
+
const filteredEvents = React85.useMemo(() => {
|
|
41058
41210
|
if (filter === "all") return events2;
|
|
41059
41211
|
return events2.filter((e) => e.type === filter);
|
|
41060
41212
|
}, [events2, filter]);
|
|
@@ -41170,7 +41322,7 @@ var init_EventFlowTab = __esm({
|
|
|
41170
41322
|
});
|
|
41171
41323
|
function GuardsPanel({ guards }) {
|
|
41172
41324
|
const { t } = useTranslate();
|
|
41173
|
-
const [filter, setFilter] =
|
|
41325
|
+
const [filter, setFilter] = React85.useState("all");
|
|
41174
41326
|
if (guards.length === 0) {
|
|
41175
41327
|
return /* @__PURE__ */ jsx(
|
|
41176
41328
|
EmptyState,
|
|
@@ -41183,7 +41335,7 @@ function GuardsPanel({ guards }) {
|
|
|
41183
41335
|
}
|
|
41184
41336
|
const passedCount = guards.filter((g) => g.result).length;
|
|
41185
41337
|
const failedCount = guards.length - passedCount;
|
|
41186
|
-
const filteredGuards =
|
|
41338
|
+
const filteredGuards = React85.useMemo(() => {
|
|
41187
41339
|
if (filter === "all") return guards;
|
|
41188
41340
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
41189
41341
|
return guards.filter((g) => !g.result);
|
|
@@ -41346,10 +41498,10 @@ function EffectBadge({ effect }) {
|
|
|
41346
41498
|
}
|
|
41347
41499
|
function TransitionTimeline({ transitions }) {
|
|
41348
41500
|
const { t } = useTranslate();
|
|
41349
|
-
const containerRef =
|
|
41350
|
-
const [autoScroll, setAutoScroll] =
|
|
41351
|
-
const [expandedId, setExpandedId] =
|
|
41352
|
-
|
|
41501
|
+
const containerRef = React85.useRef(null);
|
|
41502
|
+
const [autoScroll, setAutoScroll] = React85.useState(true);
|
|
41503
|
+
const [expandedId, setExpandedId] = React85.useState(null);
|
|
41504
|
+
React85.useEffect(() => {
|
|
41353
41505
|
if (autoScroll && containerRef.current) {
|
|
41354
41506
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
41355
41507
|
}
|
|
@@ -41629,9 +41781,9 @@ function getAllEvents(traits2) {
|
|
|
41629
41781
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
41630
41782
|
const eventBus = useEventBus();
|
|
41631
41783
|
const { t } = useTranslate();
|
|
41632
|
-
const [log9, setLog] =
|
|
41633
|
-
const prevStatesRef =
|
|
41634
|
-
|
|
41784
|
+
const [log9, setLog] = React85.useState([]);
|
|
41785
|
+
const prevStatesRef = React85.useRef(/* @__PURE__ */ new Map());
|
|
41786
|
+
React85.useEffect(() => {
|
|
41635
41787
|
for (const trait of traits2) {
|
|
41636
41788
|
const prev = prevStatesRef.current.get(trait.id);
|
|
41637
41789
|
if (prev && prev !== trait.currentState) {
|
|
@@ -41800,10 +41952,10 @@ function VerifyModePanel({
|
|
|
41800
41952
|
localCount
|
|
41801
41953
|
}) {
|
|
41802
41954
|
const { t } = useTranslate();
|
|
41803
|
-
const [expanded, setExpanded] =
|
|
41804
|
-
const scrollRef =
|
|
41805
|
-
const prevCountRef =
|
|
41806
|
-
|
|
41955
|
+
const [expanded, setExpanded] = React85.useState(true);
|
|
41956
|
+
const scrollRef = React85.useRef(null);
|
|
41957
|
+
const prevCountRef = React85.useRef(0);
|
|
41958
|
+
React85.useEffect(() => {
|
|
41807
41959
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
41808
41960
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
41809
41961
|
}
|
|
@@ -41860,10 +42012,10 @@ function RuntimeDebugger({
|
|
|
41860
42012
|
schema
|
|
41861
42013
|
}) {
|
|
41862
42014
|
const { t } = useTranslate();
|
|
41863
|
-
const [isCollapsed, setIsCollapsed] =
|
|
41864
|
-
const [isVisible, setIsVisible] =
|
|
42015
|
+
const [isCollapsed, setIsCollapsed] = React85.useState(mode === "verify" ? true : defaultCollapsed);
|
|
42016
|
+
const [isVisible, setIsVisible] = React85.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
41865
42017
|
const debugData = useDebugData();
|
|
41866
|
-
|
|
42018
|
+
React85.useEffect(() => {
|
|
41867
42019
|
if (mode === "inline") return;
|
|
41868
42020
|
return onDebugToggle((enabled) => {
|
|
41869
42021
|
setIsVisible(enabled);
|
|
@@ -41872,7 +42024,7 @@ function RuntimeDebugger({
|
|
|
41872
42024
|
}
|
|
41873
42025
|
});
|
|
41874
42026
|
}, [mode]);
|
|
41875
|
-
|
|
42027
|
+
React85.useEffect(() => {
|
|
41876
42028
|
if (mode === "inline") return;
|
|
41877
42029
|
const handleKeyDown = (e) => {
|
|
41878
42030
|
if (e.key === "`" && isVisible) {
|
|
@@ -42392,7 +42544,7 @@ var init_StatCard = __esm({
|
|
|
42392
42544
|
const labelToUse = propLabel ?? propTitle;
|
|
42393
42545
|
const eventBus = useEventBus();
|
|
42394
42546
|
const { t } = useTranslate();
|
|
42395
|
-
const handleActionClick =
|
|
42547
|
+
const handleActionClick = React85__default.useCallback(() => {
|
|
42396
42548
|
if (action?.event) {
|
|
42397
42549
|
eventBus.emit(`UI:${action.event}`, {});
|
|
42398
42550
|
}
|
|
@@ -42403,7 +42555,7 @@ var init_StatCard = __esm({
|
|
|
42403
42555
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
42404
42556
|
const isLoading = externalLoading ?? false;
|
|
42405
42557
|
const error = externalError;
|
|
42406
|
-
const computeMetricValue =
|
|
42558
|
+
const computeMetricValue = React85__default.useCallback(
|
|
42407
42559
|
(metric, items) => {
|
|
42408
42560
|
if (metric.value !== void 0) {
|
|
42409
42561
|
return metric.value;
|
|
@@ -42442,7 +42594,7 @@ var init_StatCard = __esm({
|
|
|
42442
42594
|
},
|
|
42443
42595
|
[]
|
|
42444
42596
|
);
|
|
42445
|
-
const schemaStats =
|
|
42597
|
+
const schemaStats = React85__default.useMemo(() => {
|
|
42446
42598
|
if (!metrics || metrics.length === 0) return null;
|
|
42447
42599
|
return metrics.map((metric) => ({
|
|
42448
42600
|
label: metric.label,
|
|
@@ -42450,7 +42602,7 @@ var init_StatCard = __esm({
|
|
|
42450
42602
|
format: metric.format
|
|
42451
42603
|
}));
|
|
42452
42604
|
}, [metrics, data, computeMetricValue]);
|
|
42453
|
-
const calculatedTrend =
|
|
42605
|
+
const calculatedTrend = React85__default.useMemo(() => {
|
|
42454
42606
|
if (manualTrend !== void 0) return manualTrend;
|
|
42455
42607
|
if (previousValue === void 0 || currentValue === void 0)
|
|
42456
42608
|
return void 0;
|
|
@@ -43090,8 +43242,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
43090
43242
|
] });
|
|
43091
43243
|
};
|
|
43092
43244
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
43093
|
-
const endRef =
|
|
43094
|
-
|
|
43245
|
+
const endRef = React85__default.useRef(null);
|
|
43246
|
+
React85__default.useEffect(() => {
|
|
43095
43247
|
if (!autoScroll) return;
|
|
43096
43248
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
43097
43249
|
}, [activities.length, autoScroll]);
|
|
@@ -43185,7 +43337,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
43185
43337
|
};
|
|
43186
43338
|
SubagentRichCard = ({ subagent }) => {
|
|
43187
43339
|
const { t } = useTranslate();
|
|
43188
|
-
const activities =
|
|
43340
|
+
const activities = React85__default.useMemo(
|
|
43189
43341
|
() => subagentMessagesToActivities(subagent.messages),
|
|
43190
43342
|
[subagent.messages]
|
|
43191
43343
|
);
|
|
@@ -43262,8 +43414,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
43262
43414
|
] });
|
|
43263
43415
|
};
|
|
43264
43416
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
43265
|
-
const endRef =
|
|
43266
|
-
|
|
43417
|
+
const endRef = React85__default.useRef(null);
|
|
43418
|
+
React85__default.useEffect(() => {
|
|
43267
43419
|
if (!autoScroll) return;
|
|
43268
43420
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
43269
43421
|
}, [messages.length, autoScroll]);
|
|
@@ -43698,7 +43850,7 @@ var init_Timeline = __esm({
|
|
|
43698
43850
|
}) => {
|
|
43699
43851
|
const { t } = useTranslate();
|
|
43700
43852
|
const entityData = entity ?? [];
|
|
43701
|
-
const items =
|
|
43853
|
+
const items = React85__default.useMemo(() => {
|
|
43702
43854
|
if (propItems) return propItems;
|
|
43703
43855
|
if (entityData.length === 0) return [];
|
|
43704
43856
|
return entityData.map((record, idx) => {
|
|
@@ -43800,7 +43952,7 @@ var init_Timeline = __esm({
|
|
|
43800
43952
|
}
|
|
43801
43953
|
});
|
|
43802
43954
|
function extractToastProps(children) {
|
|
43803
|
-
if (!
|
|
43955
|
+
if (!React85__default.isValidElement(children)) {
|
|
43804
43956
|
if (typeof children === "string") {
|
|
43805
43957
|
return { message: children };
|
|
43806
43958
|
}
|
|
@@ -43842,7 +43994,7 @@ var init_ToastSlot = __esm({
|
|
|
43842
43994
|
eventBus.emit(`${prefix}CLOSE`);
|
|
43843
43995
|
};
|
|
43844
43996
|
if (!isVisible) return null;
|
|
43845
|
-
const isCustomContent =
|
|
43997
|
+
const isCustomContent = React85__default.isValidElement(children) && !message;
|
|
43846
43998
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
43847
43999
|
Toast,
|
|
43848
44000
|
{
|
|
@@ -43938,6 +44090,7 @@ var init_component_registry_generated = __esm({
|
|
|
43938
44090
|
init_DocTOC();
|
|
43939
44091
|
init_DocumentViewer();
|
|
43940
44092
|
init_DrawGroup();
|
|
44093
|
+
init_DrawMesh();
|
|
43941
44094
|
init_DrawShape();
|
|
43942
44095
|
init_DrawShapeLayer();
|
|
43943
44096
|
init_DrawSprite();
|
|
@@ -44206,6 +44359,7 @@ var init_component_registry_generated = __esm({
|
|
|
44206
44359
|
"DocTOC": DocTOC,
|
|
44207
44360
|
"DocumentViewer": DocumentViewer,
|
|
44208
44361
|
"DrawGroup": DrawGroup,
|
|
44362
|
+
"DrawMesh": DrawMesh,
|
|
44209
44363
|
"DrawShape": DrawShape,
|
|
44210
44364
|
"DrawShapeLayer": DrawShapeLayer,
|
|
44211
44365
|
"DrawSprite": DrawSprite,
|
|
@@ -44415,7 +44569,7 @@ function SuspenseConfigProvider({
|
|
|
44415
44569
|
config,
|
|
44416
44570
|
children
|
|
44417
44571
|
}) {
|
|
44418
|
-
return
|
|
44572
|
+
return React85__default.createElement(
|
|
44419
44573
|
SuspenseConfigContext.Provider,
|
|
44420
44574
|
{ value: config },
|
|
44421
44575
|
children
|
|
@@ -44457,7 +44611,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
44457
44611
|
}
|
|
44458
44612
|
return { name: field, label: humanizeFieldName(field) };
|
|
44459
44613
|
}
|
|
44460
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
44614
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React85__default.isValidElement(field) && !(field instanceof Date)) {
|
|
44461
44615
|
const obj = field;
|
|
44462
44616
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
44463
44617
|
if (!fieldName) return field;
|
|
@@ -44929,7 +45083,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
44929
45083
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
44930
45084
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
44931
45085
|
}
|
|
44932
|
-
return /* @__PURE__ */ jsx(
|
|
45086
|
+
return /* @__PURE__ */ jsx(React85__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
44933
45087
|
}
|
|
44934
45088
|
if (!child || typeof child !== "object") return null;
|
|
44935
45089
|
const childId = `${parentId}-${index}`;
|
|
@@ -44986,14 +45140,14 @@ function isPatternConfig(value) {
|
|
|
44986
45140
|
if (value === null || value === void 0) return false;
|
|
44987
45141
|
if (typeof value !== "object") return false;
|
|
44988
45142
|
if (Array.isArray(value)) return false;
|
|
44989
|
-
if (
|
|
45143
|
+
if (React85__default.isValidElement(value)) return false;
|
|
44990
45144
|
if (value instanceof Date) return false;
|
|
44991
45145
|
if (typeof value === "function") return false;
|
|
44992
45146
|
const record = value;
|
|
44993
45147
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
44994
45148
|
}
|
|
44995
45149
|
function isPlainConfigObject(value) {
|
|
44996
|
-
if (
|
|
45150
|
+
if (React85__default.isValidElement(value)) return false;
|
|
44997
45151
|
if (value instanceof Date) return false;
|
|
44998
45152
|
const proto = Object.getPrototypeOf(value);
|
|
44999
45153
|
return proto === Object.prototype || proto === null;
|
|
@@ -45134,7 +45288,7 @@ function SlotContentRenderer({
|
|
|
45134
45288
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
45135
45289
|
const slotVal = restProps[slotKey];
|
|
45136
45290
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
45137
|
-
if (
|
|
45291
|
+
if (React85__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
45138
45292
|
const typelessChildren = !Array.isArray(slotVal) && typeof slotVal === "object" && !("type" in slotVal) && Array.isArray(slotVal.children) ? slotVal.children : void 0;
|
|
45139
45293
|
if (typelessChildren !== void 0 || Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
45140
45294
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
@@ -45188,7 +45342,7 @@ function SlotContentRenderer({
|
|
|
45188
45342
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
45189
45343
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
45190
45344
|
const sample = resolvedItems[0];
|
|
45191
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
45345
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React85__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
45192
45346
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
45193
45347
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
45194
45348
|
}
|
|
@@ -45566,7 +45720,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
45566
45720
|
}
|
|
45567
45721
|
return substituted;
|
|
45568
45722
|
}
|
|
45569
|
-
if (body !== null && typeof body === "object" && !
|
|
45723
|
+
if (body !== null && typeof body === "object" && !React85__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
45570
45724
|
const out = {};
|
|
45571
45725
|
for (const [k, v] of Object.entries(body)) {
|
|
45572
45726
|
out[k] = recur(v);
|
|
@@ -45599,7 +45753,7 @@ function deferLambdaEntityExprs(value) {
|
|
|
45599
45753
|
}
|
|
45600
45754
|
return arr.map((v) => deferLambdaEntityExprs(v));
|
|
45601
45755
|
}
|
|
45602
|
-
if (value !== null && typeof value === "object" && !
|
|
45756
|
+
if (value !== null && typeof value === "object" && !React85__default.isValidElement(value) && !(value instanceof Date) && typeof value !== "function" && !isRenderBindingMarker(value)) {
|
|
45603
45757
|
const out = {};
|
|
45604
45758
|
for (const [k, v] of Object.entries(value)) {
|
|
45605
45759
|
out[k] = deferLambdaEntityExprs(v);
|
|
@@ -45613,7 +45767,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
45613
45767
|
const resolvedBody = deferLambdaEntityExprs(
|
|
45614
45768
|
resolveLambdaBindings(lambdaBody, params, item, index)
|
|
45615
45769
|
);
|
|
45616
|
-
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" ||
|
|
45770
|
+
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React85__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
|
|
45617
45771
|
return null;
|
|
45618
45772
|
}
|
|
45619
45773
|
const record = resolvedBody;
|
|
@@ -45632,7 +45786,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
45632
45786
|
props: childProps,
|
|
45633
45787
|
priority: 0
|
|
45634
45788
|
};
|
|
45635
|
-
return
|
|
45789
|
+
return React85__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
45636
45790
|
};
|
|
45637
45791
|
}
|
|
45638
45792
|
function convertNode(node, callerKey) {
|
|
@@ -45652,7 +45806,7 @@ function convertNode(node, callerKey) {
|
|
|
45652
45806
|
});
|
|
45653
45807
|
return anyChanged ? mapped : node;
|
|
45654
45808
|
}
|
|
45655
|
-
if (typeof node === "object" && !
|
|
45809
|
+
if (typeof node === "object" && !React85__default.isValidElement(node) && !(node instanceof Date)) {
|
|
45656
45810
|
return convertObjectProps(node);
|
|
45657
45811
|
}
|
|
45658
45812
|
return node;
|