@almadar/ui 6.3.0 → 6.5.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 +2461 -1553
- package/dist/avl/index.d.cts +206 -17
- package/dist/avl/index.d.ts +206 -17
- package/dist/avl/index.js +1445 -540
- package/dist/components/index.cjs +2035 -1489
- package/dist/components/index.d.cts +197 -1
- package/dist/components/index.d.ts +197 -1
- package/dist/components/index.js +1037 -490
- package/dist/hooks/index.cjs +2 -0
- package/dist/hooks/index.js +2 -0
- package/dist/lib/drawable/three/index.cjs +4 -3
- package/dist/lib/drawable/three/index.js +4 -3
- package/dist/locales/index.cjs +6 -0
- package/dist/locales/index.js +6 -0
- package/dist/marketing/index.cjs +1 -1
- package/dist/marketing/index.js +1 -1
- package/dist/providers/index.cjs +1957 -1319
- package/dist/providers/index.d.cts +4 -1
- package/dist/providers/index.d.ts +4 -1
- package/dist/providers/index.js +1018 -380
- package/dist/runtime/index.cjs +1922 -1284
- package/dist/runtime/index.js +1022 -384
- package/locales/ar.json +2 -0
- package/locales/en.json +2 -0
- package/locales/sl.json +2 -0
- package/package.json +4 -3
package/dist/avl/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as React96 from 'react';
|
|
3
|
+
import React96__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId } from 'react';
|
|
4
4
|
import { getAllPages, matchPathAmong, CurrentPagePathProvider, NavStackProvider, OrbitalProvider, EventBusContext, useTraitScopeChain, useNavStack, ServerBridgeProvider, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge, EntityBindingContext, useEntitySchema, RenderSlotProvider, useEntitySchemaOptional, useEntityBindingSnapshot, TraitScopeProvider, useTraitScope, useCurrentPagePath, useRenderSlot, useGameAudioContextOptional } from '@almadar/ui/providers';
|
|
5
5
|
import { createLogger, setNamespaceLevel, isLogLevelEnabled } from '@almadar/logger';
|
|
6
6
|
import ELK from 'elkjs/lib/elk.bundled.js';
|
|
@@ -68,7 +68,7 @@ import ReactMarkdown from 'react-markdown';
|
|
|
68
68
|
import remarkGfm from 'remark-gfm';
|
|
69
69
|
import remarkMath from 'remark-math';
|
|
70
70
|
import rehypeKatex from 'rehype-katex';
|
|
71
|
-
import { useDroppable, useDraggable, DndContext, DragOverlay, useSensors, useSensor, PointerSensor, KeyboardSensor, pointerWithin, rectIntersection, closestCorners } from '@dnd-kit/core';
|
|
71
|
+
import { useDroppable, useDraggable as useDraggable$1, DndContext, DragOverlay, useSensors, useSensor, PointerSensor, KeyboardSensor, pointerWithin, rectIntersection, closestCorners } from '@dnd-kit/core';
|
|
72
72
|
import { sortableKeyboardCoordinates, useSortable, arrayMove, SortableContext, rectSortingStrategy, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
73
73
|
import { CSS } from '@dnd-kit/utilities';
|
|
74
74
|
import { ordered, lib } from 'emojilib';
|
|
@@ -3301,7 +3301,7 @@ var init_Typography = __esm({
|
|
|
3301
3301
|
if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
|
|
3302
3302
|
body = formatValue(body, format);
|
|
3303
3303
|
}
|
|
3304
|
-
return
|
|
3304
|
+
return React96__default.createElement(
|
|
3305
3305
|
Component,
|
|
3306
3306
|
{
|
|
3307
3307
|
id,
|
|
@@ -3647,7 +3647,7 @@ var init_Box = __esm({
|
|
|
3647
3647
|
fixed: "fixed",
|
|
3648
3648
|
sticky: "sticky"
|
|
3649
3649
|
};
|
|
3650
|
-
Box =
|
|
3650
|
+
Box = React96__default.forwardRef(
|
|
3651
3651
|
({
|
|
3652
3652
|
padding,
|
|
3653
3653
|
paddingX,
|
|
@@ -3712,7 +3712,7 @@ var init_Box = __esm({
|
|
|
3712
3712
|
onPointerDown?.(e);
|
|
3713
3713
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
3714
3714
|
const isClickable = action || onClick;
|
|
3715
|
-
return
|
|
3715
|
+
return React96__default.createElement(
|
|
3716
3716
|
Component,
|
|
3717
3717
|
{
|
|
3718
3718
|
ref,
|
|
@@ -3808,7 +3808,7 @@ var init_Stack = __esm({
|
|
|
3808
3808
|
};
|
|
3809
3809
|
const isHorizontal = direction === "horizontal";
|
|
3810
3810
|
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";
|
|
3811
|
-
return
|
|
3811
|
+
return React96__default.createElement(
|
|
3812
3812
|
Component,
|
|
3813
3813
|
{
|
|
3814
3814
|
className: cn(
|
|
@@ -4300,7 +4300,7 @@ var init_MiniStateMachine = __esm({
|
|
|
4300
4300
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
4301
4301
|
const tc = transitionCounts[s.name] ?? 0;
|
|
4302
4302
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
4303
|
-
return /* @__PURE__ */ jsxs(
|
|
4303
|
+
return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
4304
4304
|
/* @__PURE__ */ jsx(
|
|
4305
4305
|
AvlState,
|
|
4306
4306
|
{
|
|
@@ -4583,7 +4583,7 @@ function resolveMarkerExpression(expression, entity, config, state) {
|
|
|
4583
4583
|
function isPlainObject(value) {
|
|
4584
4584
|
if (value === null || value === void 0 || typeof value !== "object") return false;
|
|
4585
4585
|
if (Array.isArray(value)) return false;
|
|
4586
|
-
if (
|
|
4586
|
+
if (React96__default.isValidElement(value)) return false;
|
|
4587
4587
|
if (value instanceof Date) return false;
|
|
4588
4588
|
if (typeof value === "function") return false;
|
|
4589
4589
|
return true;
|
|
@@ -4592,7 +4592,7 @@ function isEvaluatorResolvedData(value) {
|
|
|
4592
4592
|
return evaluatorResolvedData.has(value);
|
|
4593
4593
|
}
|
|
4594
4594
|
function brandResolved(value) {
|
|
4595
|
-
if (value !== null && typeof value === "object" && !
|
|
4595
|
+
if (value !== null && typeof value === "object" && !React96__default.isValidElement(value) && !(value instanceof Date)) {
|
|
4596
4596
|
resolvedMarkerFree.add(value);
|
|
4597
4597
|
}
|
|
4598
4598
|
}
|
|
@@ -4625,7 +4625,7 @@ function walkValue(value, scopeTrait, entity, config, state) {
|
|
|
4625
4625
|
}
|
|
4626
4626
|
const resolved = resolveMarkerExpression(value.expression, entity, config, state);
|
|
4627
4627
|
markerResolutionCache.set(value, { entity, config, state, resolved });
|
|
4628
|
-
if (resolved !== null && typeof resolved === "object" && !
|
|
4628
|
+
if (resolved !== null && typeof resolved === "object" && !React96__default.isValidElement(resolved) && !(resolved instanceof Date)) {
|
|
4629
4629
|
resolvedMarkerFree.add(resolved);
|
|
4630
4630
|
evaluatorResolvedData.add(resolved);
|
|
4631
4631
|
}
|
|
@@ -4876,7 +4876,7 @@ var init_Icon = __esm({
|
|
|
4876
4876
|
const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
|
|
4877
4877
|
const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
|
|
4878
4878
|
const family = useIconFamily();
|
|
4879
|
-
const RenderedComponent =
|
|
4879
|
+
const RenderedComponent = React96__default.useMemo(() => {
|
|
4880
4880
|
if (directIcon) return null;
|
|
4881
4881
|
return effectiveName ? resolveIconForFamily(effectiveName) : null;
|
|
4882
4882
|
}, [directIcon, effectiveName, family]);
|
|
@@ -5005,7 +5005,7 @@ var init_atlasSlice = __esm({
|
|
|
5005
5005
|
}
|
|
5006
5006
|
});
|
|
5007
5007
|
function useAtlasSliceDataUrl(asset) {
|
|
5008
|
-
const [, bump] =
|
|
5008
|
+
const [, bump] = React96.useReducer((x) => x + 1, 0);
|
|
5009
5009
|
if (!isAtlasAsset(asset)) return void 0;
|
|
5010
5010
|
const key = `${asset.atlas}#${asset.sprite}`;
|
|
5011
5011
|
const cached = sliceDataUrlCache.get(key);
|
|
@@ -5068,13 +5068,13 @@ function AtlasImage({
|
|
|
5068
5068
|
style,
|
|
5069
5069
|
"aria-hidden": ariaHidden
|
|
5070
5070
|
}) {
|
|
5071
|
-
const [, bump] =
|
|
5072
|
-
const canvasRef =
|
|
5071
|
+
const [, bump] = React96.useReducer((x) => x + 1, 0);
|
|
5072
|
+
const canvasRef = React96.useRef(null);
|
|
5073
5073
|
const sliced = isAtlasAsset(asset);
|
|
5074
5074
|
const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
|
|
5075
5075
|
const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
5076
5076
|
const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
|
|
5077
|
-
|
|
5077
|
+
React96.useEffect(() => {
|
|
5078
5078
|
const canvas = canvasRef.current;
|
|
5079
5079
|
if (!canvas || !img || !rect) return;
|
|
5080
5080
|
canvas.width = rect.sw;
|
|
@@ -5150,7 +5150,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
5150
5150
|
const IconComp = value;
|
|
5151
5151
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
5152
5152
|
}
|
|
5153
|
-
if (
|
|
5153
|
+
if (React96__default.isValidElement(value)) {
|
|
5154
5154
|
return value;
|
|
5155
5155
|
}
|
|
5156
5156
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -5227,7 +5227,7 @@ var init_Button = __esm({
|
|
|
5227
5227
|
md: "h-icon-default w-icon-default",
|
|
5228
5228
|
lg: "h-icon-default w-icon-default"
|
|
5229
5229
|
};
|
|
5230
|
-
Button =
|
|
5230
|
+
Button = React96__default.forwardRef(
|
|
5231
5231
|
({
|
|
5232
5232
|
className,
|
|
5233
5233
|
variant = "primary",
|
|
@@ -5297,7 +5297,7 @@ var Dialog;
|
|
|
5297
5297
|
var init_Dialog = __esm({
|
|
5298
5298
|
"components/core/atoms/Dialog.tsx"() {
|
|
5299
5299
|
init_cn();
|
|
5300
|
-
Dialog =
|
|
5300
|
+
Dialog = React96__default.forwardRef(
|
|
5301
5301
|
({
|
|
5302
5302
|
role = "dialog",
|
|
5303
5303
|
"aria-modal": ariaModal = true,
|
|
@@ -5507,7 +5507,6 @@ var init_Modal = __esm({
|
|
|
5507
5507
|
),
|
|
5508
5508
|
style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
|
|
5509
5509
|
onClick: handleOverlayClick,
|
|
5510
|
-
"aria-hidden": "true",
|
|
5511
5510
|
children: /* @__PURE__ */ jsxs(
|
|
5512
5511
|
Dialog,
|
|
5513
5512
|
{
|
|
@@ -5742,7 +5741,7 @@ var init_Drawer = __esm({
|
|
|
5742
5741
|
};
|
|
5743
5742
|
const widthClass = width in sizeWidths ? sizeWidths[width] : "";
|
|
5744
5743
|
const widthStyle = width in sizeWidths ? void 0 : { width };
|
|
5745
|
-
const
|
|
5744
|
+
const positionClasses2 = position === "right" ? "right-0 border-l" : "left-0 border-r";
|
|
5746
5745
|
const drawerSign = position === "right" ? 1 : -1;
|
|
5747
5746
|
const slideTransform = position === "right" ? "translateX(100%)" : "translateX(-100%)";
|
|
5748
5747
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -5764,7 +5763,7 @@ var init_Drawer = __esm({
|
|
|
5764
5763
|
className: cn(
|
|
5765
5764
|
"fixed top-0 bottom-0 z-50",
|
|
5766
5765
|
"flex flex-col max-h-screen",
|
|
5767
|
-
|
|
5766
|
+
positionClasses2,
|
|
5768
5767
|
widthClass,
|
|
5769
5768
|
drawerAnim,
|
|
5770
5769
|
className
|
|
@@ -5860,7 +5859,7 @@ var init_Badge = __esm({
|
|
|
5860
5859
|
md: "px-2.5 py-1 text-sm",
|
|
5861
5860
|
lg: "px-3 py-1.5 text-base"
|
|
5862
5861
|
};
|
|
5863
|
-
Badge =
|
|
5862
|
+
Badge = React96__default.forwardRef(
|
|
5864
5863
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
5865
5864
|
const iconSizes3 = {
|
|
5866
5865
|
sm: "h-icon-default w-icon-default",
|
|
@@ -6210,7 +6209,7 @@ var init_SvgFlow = __esm({
|
|
|
6210
6209
|
width = 100,
|
|
6211
6210
|
height = 100
|
|
6212
6211
|
}) => {
|
|
6213
|
-
const markerId =
|
|
6212
|
+
const markerId = React96__default.useMemo(() => {
|
|
6214
6213
|
flowIdCounter += 1;
|
|
6215
6214
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
6216
6215
|
}, []);
|
|
@@ -6803,7 +6802,7 @@ var init_SvgRing = __esm({
|
|
|
6803
6802
|
width = 100,
|
|
6804
6803
|
height = 100
|
|
6805
6804
|
}) => {
|
|
6806
|
-
const gradientId =
|
|
6805
|
+
const gradientId = React96__default.useMemo(() => {
|
|
6807
6806
|
ringIdCounter += 1;
|
|
6808
6807
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
6809
6808
|
}, []);
|
|
@@ -6984,7 +6983,7 @@ var init_Input = __esm({
|
|
|
6984
6983
|
init_cn();
|
|
6985
6984
|
init_Icon();
|
|
6986
6985
|
init_useEventBus();
|
|
6987
|
-
Input =
|
|
6986
|
+
Input = React96__default.forwardRef(
|
|
6988
6987
|
({
|
|
6989
6988
|
className,
|
|
6990
6989
|
inputType,
|
|
@@ -7008,9 +7007,9 @@ var init_Input = __esm({
|
|
|
7008
7007
|
const eventBus = useEventBus();
|
|
7009
7008
|
const type = inputType || htmlType || "text";
|
|
7010
7009
|
const isDeclarative = typeof onChange === "string";
|
|
7011
|
-
const [localValue, setLocalValue] =
|
|
7012
|
-
const pendingEchoRef =
|
|
7013
|
-
|
|
7010
|
+
const [localValue, setLocalValue] = React96__default.useState(value);
|
|
7011
|
+
const pendingEchoRef = React96__default.useRef(/* @__PURE__ */ new Set());
|
|
7012
|
+
React96__default.useEffect(() => {
|
|
7014
7013
|
if (!isDeclarative) return;
|
|
7015
7014
|
const incoming = value == null ? "" : String(value);
|
|
7016
7015
|
if (pendingEchoRef.current.has(incoming)) {
|
|
@@ -7177,7 +7176,7 @@ var Label;
|
|
|
7177
7176
|
var init_Label = __esm({
|
|
7178
7177
|
"components/core/atoms/Label.tsx"() {
|
|
7179
7178
|
init_cn();
|
|
7180
|
-
Label =
|
|
7179
|
+
Label = React96__default.forwardRef(
|
|
7181
7180
|
({ className, required, children, ...props }, ref) => {
|
|
7182
7181
|
return /* @__PURE__ */ jsxs(
|
|
7183
7182
|
"label",
|
|
@@ -7204,7 +7203,7 @@ var init_Textarea = __esm({
|
|
|
7204
7203
|
"components/core/atoms/Textarea.tsx"() {
|
|
7205
7204
|
init_cn();
|
|
7206
7205
|
init_useEventBus();
|
|
7207
|
-
Textarea =
|
|
7206
|
+
Textarea = React96__default.forwardRef(
|
|
7208
7207
|
({ className, error, onChange, ...props }, ref) => {
|
|
7209
7208
|
const eventBus = useEventBus();
|
|
7210
7209
|
const handleChange = (e) => {
|
|
@@ -7454,7 +7453,7 @@ var init_Select = __esm({
|
|
|
7454
7453
|
init_cn();
|
|
7455
7454
|
init_Icon();
|
|
7456
7455
|
init_useEventBus();
|
|
7457
|
-
Select =
|
|
7456
|
+
Select = React96__default.forwardRef(
|
|
7458
7457
|
(props, _ref) => {
|
|
7459
7458
|
const { multiple, searchable, clearable } = props;
|
|
7460
7459
|
if (multiple || searchable || clearable) {
|
|
@@ -7471,7 +7470,7 @@ var init_Checkbox = __esm({
|
|
|
7471
7470
|
"components/core/atoms/Checkbox.tsx"() {
|
|
7472
7471
|
init_cn();
|
|
7473
7472
|
init_useEventBus();
|
|
7474
|
-
Checkbox =
|
|
7473
|
+
Checkbox = React96__default.forwardRef(
|
|
7475
7474
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
7476
7475
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
7477
7476
|
const eventBus = useEventBus();
|
|
@@ -7525,7 +7524,7 @@ var init_Spinner = __esm({
|
|
|
7525
7524
|
md: "h-6 w-6",
|
|
7526
7525
|
lg: "h-8 w-8"
|
|
7527
7526
|
};
|
|
7528
|
-
Spinner =
|
|
7527
|
+
Spinner = React96__default.forwardRef(
|
|
7529
7528
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
7530
7529
|
if (overlay) {
|
|
7531
7530
|
return /* @__PURE__ */ jsx(
|
|
@@ -7615,7 +7614,7 @@ var init_Card = __esm({
|
|
|
7615
7614
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
7616
7615
|
"tile-image-first": "p-0 overflow-hidden"
|
|
7617
7616
|
};
|
|
7618
|
-
Card =
|
|
7617
|
+
Card = React96__default.forwardRef(
|
|
7619
7618
|
({
|
|
7620
7619
|
className,
|
|
7621
7620
|
variant = "bordered",
|
|
@@ -7664,9 +7663,9 @@ var init_Card = __esm({
|
|
|
7664
7663
|
}
|
|
7665
7664
|
);
|
|
7666
7665
|
Card.displayName = "Card";
|
|
7667
|
-
CardHeader =
|
|
7666
|
+
CardHeader = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
7668
7667
|
CardHeader.displayName = "CardHeader";
|
|
7669
|
-
CardTitle =
|
|
7668
|
+
CardTitle = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7670
7669
|
"h3",
|
|
7671
7670
|
{
|
|
7672
7671
|
ref,
|
|
@@ -7679,11 +7678,11 @@ var init_Card = __esm({
|
|
|
7679
7678
|
}
|
|
7680
7679
|
));
|
|
7681
7680
|
CardTitle.displayName = "CardTitle";
|
|
7682
|
-
CardContent =
|
|
7681
|
+
CardContent = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
7683
7682
|
CardContent.displayName = "CardContent";
|
|
7684
7683
|
CardBody = CardContent;
|
|
7685
7684
|
CardBody.displayName = "CardBody";
|
|
7686
|
-
CardFooter =
|
|
7685
|
+
CardFooter = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7687
7686
|
"div",
|
|
7688
7687
|
{
|
|
7689
7688
|
ref,
|
|
@@ -7770,7 +7769,7 @@ var init_FilterPill = __esm({
|
|
|
7770
7769
|
md: "w-3.5 h-3.5",
|
|
7771
7770
|
lg: "w-4 h-4"
|
|
7772
7771
|
};
|
|
7773
|
-
FilterPill =
|
|
7772
|
+
FilterPill = React96__default.forwardRef(
|
|
7774
7773
|
({
|
|
7775
7774
|
className,
|
|
7776
7775
|
variant = "default",
|
|
@@ -7899,8 +7898,8 @@ var init_Avatar = __esm({
|
|
|
7899
7898
|
actionPayload
|
|
7900
7899
|
}) => {
|
|
7901
7900
|
const eventBus = useEventBus();
|
|
7902
|
-
const [imgFailed, setImgFailed] =
|
|
7903
|
-
|
|
7901
|
+
const [imgFailed, setImgFailed] = React96__default.useState(false);
|
|
7902
|
+
React96__default.useEffect(() => {
|
|
7904
7903
|
setImgFailed(false);
|
|
7905
7904
|
}, [src]);
|
|
7906
7905
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -8013,7 +8012,7 @@ var init_Center = __esm({
|
|
|
8013
8012
|
as: Component = "div"
|
|
8014
8013
|
}) => {
|
|
8015
8014
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
8016
|
-
return
|
|
8015
|
+
return React96__default.createElement(Component, {
|
|
8017
8016
|
className: cn(
|
|
8018
8017
|
inline ? "inline-flex" : "flex",
|
|
8019
8018
|
horizontal && "justify-center",
|
|
@@ -8281,7 +8280,7 @@ var init_Radio = __esm({
|
|
|
8281
8280
|
md: "w-2.5 h-2.5",
|
|
8282
8281
|
lg: "w-3 h-3"
|
|
8283
8282
|
};
|
|
8284
|
-
Radio =
|
|
8283
|
+
Radio = React96__default.forwardRef(
|
|
8285
8284
|
({
|
|
8286
8285
|
label,
|
|
8287
8286
|
helperText,
|
|
@@ -8298,12 +8297,12 @@ var init_Radio = __esm({
|
|
|
8298
8297
|
onChange,
|
|
8299
8298
|
...props
|
|
8300
8299
|
}, ref) => {
|
|
8301
|
-
const reactId =
|
|
8300
|
+
const reactId = React96__default.useId();
|
|
8302
8301
|
const baseId = id || `radio-${reactId}`;
|
|
8303
8302
|
const hasError = !!error;
|
|
8304
8303
|
const eventBus = useEventBus();
|
|
8305
|
-
const [selected, setSelected] =
|
|
8306
|
-
|
|
8304
|
+
const [selected, setSelected] = React96__default.useState(value);
|
|
8305
|
+
React96__default.useEffect(() => {
|
|
8307
8306
|
if (value !== void 0) setSelected(value);
|
|
8308
8307
|
}, [value]);
|
|
8309
8308
|
const pick = (next, e) => {
|
|
@@ -8485,7 +8484,7 @@ var init_Switch = __esm({
|
|
|
8485
8484
|
"components/core/atoms/Switch.tsx"() {
|
|
8486
8485
|
"use client";
|
|
8487
8486
|
init_cn();
|
|
8488
|
-
Switch =
|
|
8487
|
+
Switch = React96.forwardRef(
|
|
8489
8488
|
({
|
|
8490
8489
|
checked,
|
|
8491
8490
|
defaultChecked = false,
|
|
@@ -8496,10 +8495,10 @@ var init_Switch = __esm({
|
|
|
8496
8495
|
name,
|
|
8497
8496
|
className
|
|
8498
8497
|
}, ref) => {
|
|
8499
|
-
const [isChecked, setIsChecked] =
|
|
8498
|
+
const [isChecked, setIsChecked] = React96.useState(
|
|
8500
8499
|
checked !== void 0 ? checked : defaultChecked
|
|
8501
8500
|
);
|
|
8502
|
-
|
|
8501
|
+
React96.useEffect(() => {
|
|
8503
8502
|
if (checked !== void 0) {
|
|
8504
8503
|
setIsChecked(checked);
|
|
8505
8504
|
}
|
|
@@ -8777,7 +8776,7 @@ var Aside;
|
|
|
8777
8776
|
var init_Aside = __esm({
|
|
8778
8777
|
"components/core/atoms/Aside.tsx"() {
|
|
8779
8778
|
init_cn();
|
|
8780
|
-
Aside =
|
|
8779
|
+
Aside = React96__default.forwardRef(
|
|
8781
8780
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
8782
8781
|
);
|
|
8783
8782
|
Aside.displayName = "Aside";
|
|
@@ -8856,9 +8855,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
8856
8855
|
className
|
|
8857
8856
|
}) => {
|
|
8858
8857
|
const { t } = useTranslate();
|
|
8859
|
-
const [isVisible, setIsVisible] =
|
|
8860
|
-
const timeoutRef =
|
|
8861
|
-
const triggerRef =
|
|
8858
|
+
const [isVisible, setIsVisible] = React96__default.useState(false);
|
|
8859
|
+
const timeoutRef = React96__default.useRef(null);
|
|
8860
|
+
const triggerRef = React96__default.useRef(null);
|
|
8862
8861
|
const handleMouseEnter = () => {
|
|
8863
8862
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8864
8863
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -8869,7 +8868,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
8869
8868
|
};
|
|
8870
8869
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
8871
8870
|
const open = isVisible || revealed;
|
|
8872
|
-
|
|
8871
|
+
React96__default.useEffect(() => {
|
|
8873
8872
|
return () => {
|
|
8874
8873
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8875
8874
|
};
|
|
@@ -9079,7 +9078,7 @@ var init_StatusDot = __esm({
|
|
|
9079
9078
|
md: "w-2.5 h-2.5",
|
|
9080
9079
|
lg: "w-3 h-3"
|
|
9081
9080
|
};
|
|
9082
|
-
StatusDot =
|
|
9081
|
+
StatusDot = React96__default.forwardRef(
|
|
9083
9082
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
9084
9083
|
return /* @__PURE__ */ jsx(
|
|
9085
9084
|
"span",
|
|
@@ -9133,7 +9132,7 @@ var init_TrendIndicator = __esm({
|
|
|
9133
9132
|
down: "trending-down",
|
|
9134
9133
|
flat: "arrow-right"
|
|
9135
9134
|
};
|
|
9136
|
-
TrendIndicator =
|
|
9135
|
+
TrendIndicator = React96__default.forwardRef(
|
|
9137
9136
|
({
|
|
9138
9137
|
className,
|
|
9139
9138
|
value,
|
|
@@ -9202,7 +9201,7 @@ var init_RangeSlider = __esm({
|
|
|
9202
9201
|
md: "w-4 h-4",
|
|
9203
9202
|
lg: "w-5 h-5"
|
|
9204
9203
|
};
|
|
9205
|
-
RangeSlider =
|
|
9204
|
+
RangeSlider = React96__default.forwardRef(
|
|
9206
9205
|
({
|
|
9207
9206
|
className,
|
|
9208
9207
|
min = 0,
|
|
@@ -9859,7 +9858,7 @@ var init_ContentSection = __esm({
|
|
|
9859
9858
|
md: "py-16",
|
|
9860
9859
|
lg: "py-24"
|
|
9861
9860
|
};
|
|
9862
|
-
ContentSection =
|
|
9861
|
+
ContentSection = React96__default.forwardRef(
|
|
9863
9862
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
9864
9863
|
return /* @__PURE__ */ jsx(
|
|
9865
9864
|
Box,
|
|
@@ -10393,7 +10392,7 @@ var init_AnimatedReveal = __esm({
|
|
|
10393
10392
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
10394
10393
|
"none": {}
|
|
10395
10394
|
};
|
|
10396
|
-
AnimatedReveal =
|
|
10395
|
+
AnimatedReveal = React96__default.forwardRef(
|
|
10397
10396
|
({
|
|
10398
10397
|
trigger = "scroll",
|
|
10399
10398
|
animation = "fade-up",
|
|
@@ -10553,7 +10552,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
10553
10552
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
10554
10553
|
"use client";
|
|
10555
10554
|
init_cn();
|
|
10556
|
-
AnimatedGraphic =
|
|
10555
|
+
AnimatedGraphic = React96__default.forwardRef(
|
|
10557
10556
|
({
|
|
10558
10557
|
src,
|
|
10559
10558
|
svgContent,
|
|
@@ -10576,7 +10575,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
10576
10575
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
10577
10576
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
10578
10577
|
const prevAnimateRef = useRef(animate);
|
|
10579
|
-
const setRef =
|
|
10578
|
+
const setRef = React96__default.useCallback(
|
|
10580
10579
|
(node) => {
|
|
10581
10580
|
containerRef.current = node;
|
|
10582
10581
|
if (typeof ref === "function") ref(node);
|
|
@@ -11328,9 +11327,9 @@ function ControlButton({
|
|
|
11328
11327
|
className
|
|
11329
11328
|
}) {
|
|
11330
11329
|
const eventBus = useEventBus();
|
|
11331
|
-
const [isPressed, setIsPressed] =
|
|
11330
|
+
const [isPressed, setIsPressed] = React96.useState(false);
|
|
11332
11331
|
const actualPressed = pressed ?? isPressed;
|
|
11333
|
-
const handlePointerDown =
|
|
11332
|
+
const handlePointerDown = React96.useCallback(
|
|
11334
11333
|
(e) => {
|
|
11335
11334
|
e.preventDefault();
|
|
11336
11335
|
if (disabled) return;
|
|
@@ -11340,7 +11339,7 @@ function ControlButton({
|
|
|
11340
11339
|
},
|
|
11341
11340
|
[disabled, pressEvent, eventBus, onPress]
|
|
11342
11341
|
);
|
|
11343
|
-
const handlePointerUp =
|
|
11342
|
+
const handlePointerUp = React96.useCallback(
|
|
11344
11343
|
(e) => {
|
|
11345
11344
|
e.preventDefault();
|
|
11346
11345
|
if (disabled) return;
|
|
@@ -11350,7 +11349,7 @@ function ControlButton({
|
|
|
11350
11349
|
},
|
|
11351
11350
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
11352
11351
|
);
|
|
11353
|
-
const handlePointerLeave =
|
|
11352
|
+
const handlePointerLeave = React96.useCallback(
|
|
11354
11353
|
(e) => {
|
|
11355
11354
|
if (isPressed) {
|
|
11356
11355
|
setIsPressed(false);
|
|
@@ -11609,18 +11608,18 @@ function ControlGrid({
|
|
|
11609
11608
|
className
|
|
11610
11609
|
}) {
|
|
11611
11610
|
const eventBus = useEventBus();
|
|
11612
|
-
const [active, setActive] =
|
|
11613
|
-
const [coarse, setCoarse] =
|
|
11611
|
+
const [active, setActive] = React96.useState(/* @__PURE__ */ new Set());
|
|
11612
|
+
const [coarse, setCoarse] = React96.useState(
|
|
11614
11613
|
() => typeof window !== "undefined" && window.matchMedia("(pointer: coarse)").matches
|
|
11615
11614
|
);
|
|
11616
|
-
|
|
11615
|
+
React96.useEffect(() => {
|
|
11617
11616
|
if (visibility !== "auto" || typeof window === "undefined") return;
|
|
11618
11617
|
const mq = window.matchMedia("(pointer: coarse)");
|
|
11619
11618
|
const onChange = (e) => setCoarse(e.matches);
|
|
11620
11619
|
mq.addEventListener("change", onChange);
|
|
11621
11620
|
return () => mq.removeEventListener("change", onChange);
|
|
11622
11621
|
}, [visibility]);
|
|
11623
|
-
const handlePress =
|
|
11622
|
+
const handlePress = React96.useCallback(
|
|
11624
11623
|
(id) => {
|
|
11625
11624
|
setActive((prev) => new Set(prev).add(id));
|
|
11626
11625
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -11634,7 +11633,7 @@ function ControlGrid({
|
|
|
11634
11633
|
},
|
|
11635
11634
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
11636
11635
|
);
|
|
11637
|
-
const handleRelease =
|
|
11636
|
+
const handleRelease = React96.useCallback(
|
|
11638
11637
|
(id) => {
|
|
11639
11638
|
setActive((prev) => {
|
|
11640
11639
|
const next = new Set(prev);
|
|
@@ -11997,7 +11996,7 @@ function GameMenu({
|
|
|
11997
11996
|
}) {
|
|
11998
11997
|
const resolvedOptions = (options?.length ? options : void 0) ?? (menuItems?.length ? menuItems : void 0) ?? DEFAULT_MENU_OPTIONS;
|
|
11999
11998
|
const eventBus = useEventBus();
|
|
12000
|
-
const handleOptionClick =
|
|
11999
|
+
const handleOptionClick = React96.useCallback(
|
|
12001
12000
|
(option) => {
|
|
12002
12001
|
if (option.event) {
|
|
12003
12002
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -12233,7 +12232,7 @@ function StateGraph({
|
|
|
12233
12232
|
}) {
|
|
12234
12233
|
const eventBus = useEventBus();
|
|
12235
12234
|
const nodes = states ?? [];
|
|
12236
|
-
const positions =
|
|
12235
|
+
const positions = React96.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
12237
12236
|
return /* @__PURE__ */ jsxs(
|
|
12238
12237
|
Box,
|
|
12239
12238
|
{
|
|
@@ -12304,8 +12303,8 @@ function MiniMap({
|
|
|
12304
12303
|
tileAssets,
|
|
12305
12304
|
unitAssets
|
|
12306
12305
|
}) {
|
|
12307
|
-
const canvasRef =
|
|
12308
|
-
const imgCacheRef =
|
|
12306
|
+
const canvasRef = React96.useRef(null);
|
|
12307
|
+
const imgCacheRef = React96.useRef(/* @__PURE__ */ new Map());
|
|
12309
12308
|
function loadImg(url) {
|
|
12310
12309
|
const cached = imgCacheRef.current.get(url);
|
|
12311
12310
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -12321,7 +12320,7 @@ function MiniMap({
|
|
|
12321
12320
|
imgCacheRef.current.set(url, img);
|
|
12322
12321
|
return null;
|
|
12323
12322
|
}
|
|
12324
|
-
|
|
12323
|
+
React96.useEffect(() => {
|
|
12325
12324
|
const canvas = canvasRef.current;
|
|
12326
12325
|
if (!canvas) return;
|
|
12327
12326
|
const ctx = canvas.getContext("2d");
|
|
@@ -13555,7 +13554,7 @@ function proceduralShapes(view, pos, fade, progress) {
|
|
|
13555
13554
|
}
|
|
13556
13555
|
}
|
|
13557
13556
|
}
|
|
13558
|
-
function expandFxItem(view, node, epochNowMs, dim, projector) {
|
|
13557
|
+
function expandFxItem(view, node, epochNowMs, dim, projector, fontFamily) {
|
|
13559
13558
|
if (view.space === "screen") return [];
|
|
13560
13559
|
const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
|
|
13561
13560
|
const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
|
|
@@ -13592,6 +13591,7 @@ function expandFxItem(view, node, epochNowMs, dim, projector) {
|
|
|
13592
13591
|
}
|
|
13593
13592
|
if (view.message) {
|
|
13594
13593
|
const pxSize = projector && view.size !== void 0 ? Math.max(10, Math.round(view.size * projector.tileWidth)) : void 0;
|
|
13594
|
+
const family = fontFamily ?? "system-ui, sans-serif";
|
|
13595
13595
|
const text = {
|
|
13596
13596
|
type: "draw-text",
|
|
13597
13597
|
text: view.message,
|
|
@@ -13599,18 +13599,18 @@ function expandFxItem(view, node, epochNowMs, dim, projector) {
|
|
|
13599
13599
|
offsetY: -(0.15 + 0.55 * progress),
|
|
13600
13600
|
color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
|
|
13601
13601
|
opacity: fade,
|
|
13602
|
-
|
|
13602
|
+
font: `bold ${pxSize ?? 14}px ${family}`
|
|
13603
13603
|
};
|
|
13604
13604
|
out.push(text);
|
|
13605
13605
|
}
|
|
13606
13606
|
return out;
|
|
13607
13607
|
}
|
|
13608
|
-
function expandFxLayer(node, epochNowMs, dim, projector) {
|
|
13608
|
+
function expandFxLayer(node, epochNowMs, dim, projector, fontFamily) {
|
|
13609
13609
|
if (!Array.isArray(node.items)) return [];
|
|
13610
13610
|
const out = [];
|
|
13611
13611
|
for (const item of node.items) {
|
|
13612
13612
|
if (!item || typeof item.id !== "string") continue;
|
|
13613
|
-
out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector));
|
|
13613
|
+
out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector, fontFamily));
|
|
13614
13614
|
}
|
|
13615
13615
|
return out;
|
|
13616
13616
|
}
|
|
@@ -13677,7 +13677,7 @@ function paintDrawable(painter, node, dctx) {
|
|
|
13677
13677
|
break;
|
|
13678
13678
|
case "draw-fx-layer": {
|
|
13679
13679
|
const epochNow = dctx.time > 0 && typeof performance !== "undefined" ? performance.timeOrigin + dctx.time : 0;
|
|
13680
|
-
for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector)) paintDrawable(painter, child, dctx);
|
|
13680
|
+
for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector, dctx.fontFamily)) paintDrawable(painter, child, dctx);
|
|
13681
13681
|
break;
|
|
13682
13682
|
}
|
|
13683
13683
|
}
|
|
@@ -13787,7 +13787,7 @@ function Canvas2D({
|
|
|
13787
13787
|
const registerChildDrawable = useCallback((node) => {
|
|
13788
13788
|
childDrawablesRef.current.push(node);
|
|
13789
13789
|
}, []);
|
|
13790
|
-
const hasJsxChildren =
|
|
13790
|
+
const hasJsxChildren = React96.Children.count(children) > 0;
|
|
13791
13791
|
function isDrawableLayer(node) {
|
|
13792
13792
|
return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
|
|
13793
13793
|
}
|
|
@@ -14345,7 +14345,7 @@ function Canvas({
|
|
|
14345
14345
|
if (mode !== "3d") return;
|
|
14346
14346
|
const next = childDrawablesRef.current;
|
|
14347
14347
|
canvasLog.debug("children:adopt", { registered: next.length, adopted: childDrawables.length });
|
|
14348
|
-
if (next.length === 0 &&
|
|
14348
|
+
if (next.length === 0 && React96.Children.count(children) > 0) return;
|
|
14349
14349
|
setChildDrawables(
|
|
14350
14350
|
(prev) => prev.length === next.length && JSON.stringify(prev) === JSON.stringify(next) ? prev : [...next]
|
|
14351
14351
|
);
|
|
@@ -14383,7 +14383,7 @@ function Canvas({
|
|
|
14383
14383
|
};
|
|
14384
14384
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14385
14385
|
/* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Canvas3DHost, { ...props3d }) }),
|
|
14386
|
-
|
|
14386
|
+
React96.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 }) })
|
|
14387
14387
|
] });
|
|
14388
14388
|
}
|
|
14389
14389
|
return /* @__PURE__ */ jsx(
|
|
@@ -14541,7 +14541,7 @@ function LinearView({
|
|
|
14541
14541
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
14542
14542
|
const isDone = i < currentIdx;
|
|
14543
14543
|
const isCurrent = i === currentIdx;
|
|
14544
|
-
return /* @__PURE__ */ jsxs(
|
|
14544
|
+
return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
14545
14545
|
i > 0 && /* @__PURE__ */ jsx(
|
|
14546
14546
|
Typography,
|
|
14547
14547
|
{
|
|
@@ -15076,7 +15076,7 @@ function SequenceBar({
|
|
|
15076
15076
|
else onSlotRemove?.(index);
|
|
15077
15077
|
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
15078
15078
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
15079
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
15079
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
15080
15080
|
i > 0 && /* @__PURE__ */ jsx(
|
|
15081
15081
|
Typography,
|
|
15082
15082
|
{
|
|
@@ -15774,7 +15774,7 @@ var init_LearningCanvas = __esm({
|
|
|
15774
15774
|
if (drawables?.length && projector) {
|
|
15775
15775
|
const painter = createWebPainter(ctx, invalidateRef.current);
|
|
15776
15776
|
const timeMs = needsAnim && typeof performance !== "undefined" ? performance.now() : 0;
|
|
15777
|
-
const dctx = { projector, time: timeMs, invalidate: invalidateRef.current };
|
|
15777
|
+
const dctx = { projector, time: timeMs, invalidate: invalidateRef.current, fontFamily: themeBodyFont(canvas) };
|
|
15778
15778
|
for (const node of drawables) {
|
|
15779
15779
|
paintDrawable(painter, node, dctx);
|
|
15780
15780
|
}
|
|
@@ -15936,7 +15936,7 @@ var init_ErrorBoundary = __esm({
|
|
|
15936
15936
|
}
|
|
15937
15937
|
);
|
|
15938
15938
|
};
|
|
15939
|
-
ErrorBoundary = class extends
|
|
15939
|
+
ErrorBoundary = class extends React96__default.Component {
|
|
15940
15940
|
constructor(props) {
|
|
15941
15941
|
super(props);
|
|
15942
15942
|
__publicField(this, "reset", () => {
|
|
@@ -16205,7 +16205,7 @@ var init_Container = __esm({
|
|
|
16205
16205
|
as: Component = "div"
|
|
16206
16206
|
}) => {
|
|
16207
16207
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
16208
|
-
return
|
|
16208
|
+
return React96__default.createElement(
|
|
16209
16209
|
Component,
|
|
16210
16210
|
{
|
|
16211
16211
|
className: cn(
|
|
@@ -17142,7 +17142,7 @@ var init_FloatingActionButton = __esm({
|
|
|
17142
17142
|
document.addEventListener("mousedown", handleClickOutside);
|
|
17143
17143
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
17144
17144
|
}, [isExpanded, actions]);
|
|
17145
|
-
const
|
|
17145
|
+
const positionClasses2 = {
|
|
17146
17146
|
"bottom-right": "bottom-6 right-6",
|
|
17147
17147
|
"bottom-left": "bottom-6 left-6",
|
|
17148
17148
|
"bottom-center": "bottom-6 left-1/2 -translate-x-1/2",
|
|
@@ -17151,7 +17151,7 @@ var init_FloatingActionButton = __esm({
|
|
|
17151
17151
|
"top-center": "top-6 left-1/2 -translate-x-1/2"
|
|
17152
17152
|
};
|
|
17153
17153
|
if (resolvedAction && (!actions || actions.length === 0)) {
|
|
17154
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50",
|
|
17154
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50", positionClasses2[position], className), children: /* @__PURE__ */ jsx(
|
|
17155
17155
|
Button,
|
|
17156
17156
|
{
|
|
17157
17157
|
variant: resolvedAction.variant || "primary",
|
|
@@ -17179,7 +17179,7 @@ var init_FloatingActionButton = __esm({
|
|
|
17179
17179
|
ref: fabRef,
|
|
17180
17180
|
className: cn(
|
|
17181
17181
|
"fixed z-50 flex flex-col items-end gap-3",
|
|
17182
|
-
|
|
17182
|
+
positionClasses2[position],
|
|
17183
17183
|
position.includes("left") && "items-start",
|
|
17184
17184
|
className
|
|
17185
17185
|
),
|
|
@@ -19288,9 +19288,11 @@ var init_Tabs = __esm({
|
|
|
19288
19288
|
}
|
|
19289
19289
|
};
|
|
19290
19290
|
const handleKeyDown = (e, index) => {
|
|
19291
|
-
|
|
19291
|
+
const prevKey = orientation === "vertical" ? "ArrowUp" : "ArrowLeft";
|
|
19292
|
+
const nextKey = orientation === "vertical" ? "ArrowDown" : "ArrowRight";
|
|
19293
|
+
if (e.key === prevKey || e.key === nextKey) {
|
|
19292
19294
|
e.preventDefault();
|
|
19293
|
-
const direction = e.key ===
|
|
19295
|
+
const direction = e.key === prevKey ? -1 : 1;
|
|
19294
19296
|
const nextIndex = (index + direction + safeItems.length) % safeItems.length;
|
|
19295
19297
|
const nextTab = safeItems[nextIndex];
|
|
19296
19298
|
if (nextTab && !nextTab.disabled) {
|
|
@@ -19629,7 +19631,7 @@ function useLanguageReady(language) {
|
|
|
19629
19631
|
}, [language]);
|
|
19630
19632
|
return ready;
|
|
19631
19633
|
}
|
|
19632
|
-
var dynamicallyLoaded, codeLanguageLoader, orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log4, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
19634
|
+
var dynamicallyLoaded, codeLanguageLoader, orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log4, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, HIGHLIGHT_CAPACITY_BYTES, CodeBlock;
|
|
19633
19635
|
var init_CodeBlock = __esm({
|
|
19634
19636
|
"components/core/molecules/markdown/CodeBlock.tsx"() {
|
|
19635
19637
|
init_cn();
|
|
@@ -19862,7 +19864,8 @@ var init_CodeBlock = __esm({
|
|
|
19862
19864
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
19863
19865
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
19864
19866
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
19865
|
-
|
|
19867
|
+
HIGHLIGHT_CAPACITY_BYTES = 512 * 1024;
|
|
19868
|
+
CodeBlock = React96__default.memo(
|
|
19866
19869
|
({
|
|
19867
19870
|
code: rawCode,
|
|
19868
19871
|
language = "text",
|
|
@@ -19892,6 +19895,8 @@ var init_CodeBlock = __esm({
|
|
|
19892
19895
|
const isOrb = language === "orb";
|
|
19893
19896
|
const isLolo = language === "lolo";
|
|
19894
19897
|
const activeStyle = isOrb ? orbStyle : isLolo ? loloStyle : dark;
|
|
19898
|
+
const overCapacity = code.length > HIGHLIGHT_CAPACITY_BYTES;
|
|
19899
|
+
const plainCodeColor = activeStyle['code[class*="language-"]']?.color ?? "#d4d4d4";
|
|
19895
19900
|
const languageReady = useLanguageReady(language);
|
|
19896
19901
|
const eventBus = useEventBus();
|
|
19897
19902
|
const { t } = useTranslate();
|
|
@@ -19958,8 +19963,8 @@ var init_CodeBlock = __esm({
|
|
|
19958
19963
|
const isFoldable = foldableProp ?? true;
|
|
19959
19964
|
const [collapsed, setCollapsed] = useState(() => /* @__PURE__ */ new Set());
|
|
19960
19965
|
const foldRegions = useMemo(
|
|
19961
|
-
() => isFoldable ? computeFoldRegions(code) : [],
|
|
19962
|
-
[code, isFoldable]
|
|
19966
|
+
() => isFoldable && !overCapacity ? computeFoldRegions(code) : [],
|
|
19967
|
+
[code, isFoldable, overCapacity]
|
|
19963
19968
|
);
|
|
19964
19969
|
const foldStartMap = useMemo(() => {
|
|
19965
19970
|
const m = /* @__PURE__ */ new Map();
|
|
@@ -19993,8 +19998,67 @@ var init_CodeBlock = __esm({
|
|
|
19993
19998
|
useEffect(() => {
|
|
19994
19999
|
setCollapsed(/* @__PURE__ */ new Set());
|
|
19995
20000
|
}, [code]);
|
|
20001
|
+
const editableOverCapacity = editableValue.length > HIGHLIGHT_CAPACITY_BYTES;
|
|
20002
|
+
const editableHighlightedElement = useMemo(
|
|
20003
|
+
() => editableOverCapacity ? /* @__PURE__ */ jsx(
|
|
20004
|
+
"div",
|
|
20005
|
+
{
|
|
20006
|
+
style: {
|
|
20007
|
+
padding: "1rem",
|
|
20008
|
+
margin: 0,
|
|
20009
|
+
whiteSpace: "pre",
|
|
20010
|
+
minWidth: "100%",
|
|
20011
|
+
color: plainCodeColor,
|
|
20012
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
|
|
20013
|
+
fontSize: "13px",
|
|
20014
|
+
lineHeight: "1.5"
|
|
20015
|
+
},
|
|
20016
|
+
children: editableValue || " "
|
|
20017
|
+
}
|
|
20018
|
+
) : /* @__PURE__ */ jsx(
|
|
20019
|
+
SyntaxHighlighter,
|
|
20020
|
+
{
|
|
20021
|
+
PreTag: "div",
|
|
20022
|
+
language,
|
|
20023
|
+
style: activeStyle,
|
|
20024
|
+
wrapLines: errorLines && errorLines.size > 0,
|
|
20025
|
+
lineProps: errorLineProps,
|
|
20026
|
+
customStyle: {
|
|
20027
|
+
backgroundColor: "transparent",
|
|
20028
|
+
borderRadius: 0,
|
|
20029
|
+
padding: "1rem",
|
|
20030
|
+
margin: 0,
|
|
20031
|
+
whiteSpace: "pre",
|
|
20032
|
+
minWidth: "100%",
|
|
20033
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
|
|
20034
|
+
fontSize: "13px",
|
|
20035
|
+
lineHeight: "1.5"
|
|
20036
|
+
},
|
|
20037
|
+
codeTagProps: {
|
|
20038
|
+
style: {
|
|
20039
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
|
|
20040
|
+
fontSize: "13px",
|
|
20041
|
+
lineHeight: "1.5"
|
|
20042
|
+
}
|
|
20043
|
+
},
|
|
20044
|
+
children: editableValue || " "
|
|
20045
|
+
}
|
|
20046
|
+
),
|
|
20047
|
+
[editableValue, editableOverCapacity, plainCodeColor, language, activeStyle, errorLines, errorLineProps, languageReady]
|
|
20048
|
+
);
|
|
19996
20049
|
const highlightedElement = useMemo(
|
|
19997
|
-
() => /* @__PURE__ */ jsx(
|
|
20050
|
+
() => overCapacity ? /* @__PURE__ */ jsx(
|
|
20051
|
+
"div",
|
|
20052
|
+
{
|
|
20053
|
+
style: {
|
|
20054
|
+
margin: 0,
|
|
20055
|
+
whiteSpace: "pre",
|
|
20056
|
+
minWidth: "100%",
|
|
20057
|
+
color: plainCodeColor
|
|
20058
|
+
},
|
|
20059
|
+
children: code
|
|
20060
|
+
}
|
|
20061
|
+
) : /* @__PURE__ */ jsx(
|
|
19998
20062
|
SyntaxHighlighter,
|
|
19999
20063
|
{
|
|
20000
20064
|
PreTag: "div",
|
|
@@ -20016,7 +20080,7 @@ var init_CodeBlock = __esm({
|
|
|
20016
20080
|
children: code
|
|
20017
20081
|
}
|
|
20018
20082
|
),
|
|
20019
|
-
[code, language, activeStyle, languageReady]
|
|
20083
|
+
[code, overCapacity, plainCodeColor, language, activeStyle, languageReady]
|
|
20020
20084
|
);
|
|
20021
20085
|
useLayoutEffect(() => {
|
|
20022
20086
|
const container = codeRef.current;
|
|
@@ -20345,35 +20409,7 @@ var init_CodeBlock = __esm({
|
|
|
20345
20409
|
overflow: "hidden",
|
|
20346
20410
|
pointerEvents: "none"
|
|
20347
20411
|
},
|
|
20348
|
-
children:
|
|
20349
|
-
SyntaxHighlighter,
|
|
20350
|
-
{
|
|
20351
|
-
PreTag: "div",
|
|
20352
|
-
language,
|
|
20353
|
-
style: activeStyle,
|
|
20354
|
-
wrapLines: errorLines && errorLines.size > 0,
|
|
20355
|
-
lineProps: errorLineProps,
|
|
20356
|
-
customStyle: {
|
|
20357
|
-
backgroundColor: "transparent",
|
|
20358
|
-
borderRadius: 0,
|
|
20359
|
-
padding: "1rem",
|
|
20360
|
-
margin: 0,
|
|
20361
|
-
whiteSpace: "pre",
|
|
20362
|
-
minWidth: "100%",
|
|
20363
|
-
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
|
|
20364
|
-
fontSize: "13px",
|
|
20365
|
-
lineHeight: "1.5"
|
|
20366
|
-
},
|
|
20367
|
-
codeTagProps: {
|
|
20368
|
-
style: {
|
|
20369
|
-
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
|
|
20370
|
-
fontSize: "13px",
|
|
20371
|
-
lineHeight: "1.5"
|
|
20372
|
-
}
|
|
20373
|
-
},
|
|
20374
|
-
children: editableValue || " "
|
|
20375
|
-
}
|
|
20376
|
-
)
|
|
20412
|
+
children: editableHighlightedElement
|
|
20377
20413
|
}
|
|
20378
20414
|
),
|
|
20379
20415
|
/* @__PURE__ */ jsx(
|
|
@@ -20445,14 +20481,77 @@ var init_CodeBlock = __esm({
|
|
|
20445
20481
|
CodeBlock.displayName = "CodeBlock";
|
|
20446
20482
|
}
|
|
20447
20483
|
});
|
|
20484
|
+
function loadMermaid() {
|
|
20485
|
+
mermaidModule ?? (mermaidModule = import('mermaid').then((m) => m.default));
|
|
20486
|
+
return mermaidModule;
|
|
20487
|
+
}
|
|
20488
|
+
var mermaidModule, MermaidDiagram;
|
|
20489
|
+
var init_MermaidDiagram = __esm({
|
|
20490
|
+
"components/core/molecules/markdown/MermaidDiagram.tsx"() {
|
|
20491
|
+
init_Box();
|
|
20492
|
+
init_Typography();
|
|
20493
|
+
init_CodeBlock();
|
|
20494
|
+
init_cn();
|
|
20495
|
+
mermaidModule = null;
|
|
20496
|
+
MermaidDiagram = React96__default.memo(
|
|
20497
|
+
({ code, className }) => {
|
|
20498
|
+
const { resolvedMode } = useTheme();
|
|
20499
|
+
const containerRef = useRef(null);
|
|
20500
|
+
const [error, setError] = useState(null);
|
|
20501
|
+
const reactId = useId();
|
|
20502
|
+
useEffect(() => {
|
|
20503
|
+
let active = true;
|
|
20504
|
+
void (async () => {
|
|
20505
|
+
try {
|
|
20506
|
+
const mermaid = await loadMermaid();
|
|
20507
|
+
mermaid.initialize({
|
|
20508
|
+
startOnLoad: false,
|
|
20509
|
+
securityLevel: "strict",
|
|
20510
|
+
theme: resolvedMode === "dark" ? "dark" : "default"
|
|
20511
|
+
});
|
|
20512
|
+
const domId = `mermaid-${reactId.replace(/[^a-zA-Z0-9]/g, "")}`;
|
|
20513
|
+
const { svg } = await mermaid.render(domId, code);
|
|
20514
|
+
if (!active || !containerRef.current) return;
|
|
20515
|
+
containerRef.current.innerHTML = svg;
|
|
20516
|
+
setError(null);
|
|
20517
|
+
} catch (err) {
|
|
20518
|
+
if (active) setError(err instanceof Error ? err.message : String(err));
|
|
20519
|
+
}
|
|
20520
|
+
})();
|
|
20521
|
+
return () => {
|
|
20522
|
+
active = false;
|
|
20523
|
+
};
|
|
20524
|
+
}, [code, resolvedMode, reactId]);
|
|
20525
|
+
return /* @__PURE__ */ jsxs(Box, { className: cn("not-prose my-4", className), children: [
|
|
20526
|
+
error !== null && /* @__PURE__ */ jsxs(Box, { className: "space-y-2 mb-2", children: [
|
|
20527
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-error whitespace-pre-wrap", children: error }),
|
|
20528
|
+
/* @__PURE__ */ jsx(CodeBlock, { code, language: "mermaid" })
|
|
20529
|
+
] }),
|
|
20530
|
+
/* @__PURE__ */ jsx(
|
|
20531
|
+
Box,
|
|
20532
|
+
{
|
|
20533
|
+
ref: containerRef,
|
|
20534
|
+
"data-testid": "mermaid-diagram",
|
|
20535
|
+
className: "overflow-x-auto",
|
|
20536
|
+
style: error !== null ? { display: "none" } : void 0
|
|
20537
|
+
}
|
|
20538
|
+
)
|
|
20539
|
+
] });
|
|
20540
|
+
},
|
|
20541
|
+
(prev, next) => prev.code === next.code && prev.className === next.className
|
|
20542
|
+
);
|
|
20543
|
+
MermaidDiagram.displayName = "MermaidDiagram";
|
|
20544
|
+
}
|
|
20545
|
+
});
|
|
20448
20546
|
var MarkdownContent;
|
|
20449
20547
|
var init_MarkdownContent = __esm({
|
|
20450
20548
|
"components/core/molecules/markdown/MarkdownContent.tsx"() {
|
|
20451
20549
|
init_katex_min();
|
|
20452
20550
|
init_Box();
|
|
20453
20551
|
init_CodeBlock();
|
|
20552
|
+
init_MermaidDiagram();
|
|
20454
20553
|
init_cn();
|
|
20455
|
-
MarkdownContent =
|
|
20554
|
+
MarkdownContent = React96__default.memo(
|
|
20456
20555
|
({ content, direction = "ltr", className }) => {
|
|
20457
20556
|
const { t: _t } = useTranslate();
|
|
20458
20557
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -20497,6 +20596,9 @@ var init_MarkdownContent = __esm({
|
|
|
20497
20596
|
if (!inline) {
|
|
20498
20597
|
const match = /language-(\w+)/.exec(codeClassName ?? "");
|
|
20499
20598
|
const code = String(children).replace(/\n$/, "");
|
|
20599
|
+
if (match?.[1] === "mermaid") {
|
|
20600
|
+
return /* @__PURE__ */ jsx(MermaidDiagram, { code });
|
|
20601
|
+
}
|
|
20500
20602
|
if (match) {
|
|
20501
20603
|
return /* @__PURE__ */ jsx(
|
|
20502
20604
|
CodeBlock,
|
|
@@ -21779,7 +21881,7 @@ var init_StateMachineView = __esm({
|
|
|
21779
21881
|
style: { top: title ? 30 : 0 },
|
|
21780
21882
|
children: [
|
|
21781
21883
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
21782
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
21884
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React96__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
21783
21885
|
StateNode2,
|
|
21784
21886
|
{
|
|
21785
21887
|
state,
|
|
@@ -26693,6 +26795,183 @@ var init_CodeRunnerPanel = __esm({
|
|
|
26693
26795
|
CodeRunnerPanel.displayName = "CodeRunnerPanel";
|
|
26694
26796
|
}
|
|
26695
26797
|
});
|
|
26798
|
+
function matchesQuery(query, text) {
|
|
26799
|
+
if (!query) return true;
|
|
26800
|
+
let qi = 0;
|
|
26801
|
+
const q = query.toLowerCase();
|
|
26802
|
+
const t = text.toLowerCase();
|
|
26803
|
+
for (let ti = 0; ti < t.length && qi < q.length; ti++) {
|
|
26804
|
+
if (t[ti] === q[qi]) qi++;
|
|
26805
|
+
}
|
|
26806
|
+
return qi === q.length;
|
|
26807
|
+
}
|
|
26808
|
+
function commandMatches(command, query) {
|
|
26809
|
+
if (!query) return true;
|
|
26810
|
+
if (matchesQuery(query, command.label)) return true;
|
|
26811
|
+
return (command.keywords ?? []).some((keyword) => matchesQuery(query, keyword));
|
|
26812
|
+
}
|
|
26813
|
+
var UNGROUPED, CommandPalette;
|
|
26814
|
+
var init_CommandPalette = __esm({
|
|
26815
|
+
"components/core/molecules/CommandPalette.tsx"() {
|
|
26816
|
+
"use client";
|
|
26817
|
+
init_Box();
|
|
26818
|
+
init_Stack();
|
|
26819
|
+
init_Typography();
|
|
26820
|
+
init_Icon();
|
|
26821
|
+
init_Input();
|
|
26822
|
+
init_Badge();
|
|
26823
|
+
init_cn();
|
|
26824
|
+
init_useEventBus();
|
|
26825
|
+
init_Modal();
|
|
26826
|
+
UNGROUPED = /* @__PURE__ */ Symbol("command-palette-ungrouped");
|
|
26827
|
+
CommandPalette = ({
|
|
26828
|
+
open,
|
|
26829
|
+
onOpenChange,
|
|
26830
|
+
commands,
|
|
26831
|
+
onSelect,
|
|
26832
|
+
placeholder = "Type a command...",
|
|
26833
|
+
emptyLabel = "No matching commands",
|
|
26834
|
+
className
|
|
26835
|
+
}) => {
|
|
26836
|
+
const eventBus = useEventBus();
|
|
26837
|
+
const [query, setQuery] = useState("");
|
|
26838
|
+
const [highlightIndex, setHighlightIndex] = useState(0);
|
|
26839
|
+
const filtered = useMemo(
|
|
26840
|
+
() => commands.filter((command) => commandMatches(command, query)),
|
|
26841
|
+
[commands, query]
|
|
26842
|
+
);
|
|
26843
|
+
const groups = useMemo(() => {
|
|
26844
|
+
const order = [];
|
|
26845
|
+
const byGroup = /* @__PURE__ */ new Map();
|
|
26846
|
+
for (const command of filtered) {
|
|
26847
|
+
const key = command.group ?? UNGROUPED;
|
|
26848
|
+
if (!byGroup.has(key)) {
|
|
26849
|
+
byGroup.set(key, []);
|
|
26850
|
+
order.push(key);
|
|
26851
|
+
}
|
|
26852
|
+
byGroup.get(key).push(command);
|
|
26853
|
+
}
|
|
26854
|
+
return order.map((key) => ({ group: key === UNGROUPED ? void 0 : key, items: byGroup.get(key) }));
|
|
26855
|
+
}, [filtered]);
|
|
26856
|
+
const resetQuery = useCallback(() => {
|
|
26857
|
+
setQuery("");
|
|
26858
|
+
setHighlightIndex(0);
|
|
26859
|
+
}, []);
|
|
26860
|
+
const handleClose = useCallback(() => {
|
|
26861
|
+
resetQuery();
|
|
26862
|
+
onOpenChange(false);
|
|
26863
|
+
}, [onOpenChange, resetQuery]);
|
|
26864
|
+
const handleSelect = useCallback(
|
|
26865
|
+
(command) => {
|
|
26866
|
+
if (command.disabled) return;
|
|
26867
|
+
if (command.event) eventBus.emit(`UI:${command.event}`, { commandId: command.id });
|
|
26868
|
+
if (command.action) eventBus.emit(`UI:${command.action}`, command.actionPayload ?? {});
|
|
26869
|
+
onSelect?.(command);
|
|
26870
|
+
handleClose();
|
|
26871
|
+
},
|
|
26872
|
+
[eventBus, onSelect, handleClose]
|
|
26873
|
+
);
|
|
26874
|
+
const handleQueryChange = useCallback((e) => {
|
|
26875
|
+
setQuery(e.target.value);
|
|
26876
|
+
setHighlightIndex(0);
|
|
26877
|
+
}, []);
|
|
26878
|
+
const handleKeyDown = useCallback(
|
|
26879
|
+
(e) => {
|
|
26880
|
+
if (filtered.length === 0) return;
|
|
26881
|
+
if (e.key === "ArrowDown") {
|
|
26882
|
+
e.preventDefault();
|
|
26883
|
+
setHighlightIndex((prev) => prev < filtered.length - 1 ? prev + 1 : 0);
|
|
26884
|
+
} else if (e.key === "ArrowUp") {
|
|
26885
|
+
e.preventDefault();
|
|
26886
|
+
setHighlightIndex((prev) => prev > 0 ? prev - 1 : filtered.length - 1);
|
|
26887
|
+
} else if (e.key === "Enter") {
|
|
26888
|
+
e.preventDefault();
|
|
26889
|
+
const command = filtered[highlightIndex];
|
|
26890
|
+
if (command) handleSelect(command);
|
|
26891
|
+
}
|
|
26892
|
+
},
|
|
26893
|
+
[filtered, highlightIndex, handleSelect]
|
|
26894
|
+
);
|
|
26895
|
+
return /* @__PURE__ */ jsx(
|
|
26896
|
+
Modal,
|
|
26897
|
+
{
|
|
26898
|
+
isOpen: open,
|
|
26899
|
+
onClose: handleClose,
|
|
26900
|
+
onExited: resetQuery,
|
|
26901
|
+
showCloseButton: false,
|
|
26902
|
+
size: "md",
|
|
26903
|
+
className,
|
|
26904
|
+
children: /* @__PURE__ */ jsx(Box, { "data-testid": "command-palette", children: /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
|
|
26905
|
+
/* @__PURE__ */ jsx(
|
|
26906
|
+
Input,
|
|
26907
|
+
{
|
|
26908
|
+
inputType: "search",
|
|
26909
|
+
placeholder,
|
|
26910
|
+
value: query,
|
|
26911
|
+
onChange: handleQueryChange,
|
|
26912
|
+
onKeyDown: handleKeyDown,
|
|
26913
|
+
leftIcon: "search",
|
|
26914
|
+
clearable: query.length > 0,
|
|
26915
|
+
onClear: resetQuery,
|
|
26916
|
+
autoFocus: true,
|
|
26917
|
+
"data-testid": "command-palette-input"
|
|
26918
|
+
}
|
|
26919
|
+
),
|
|
26920
|
+
filtered.length === 0 ? /* @__PURE__ */ jsx(Box, { className: "px-2 py-6 text-center", "data-testid": "command-palette-empty", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "muted", children: emptyLabel }) }) : /* @__PURE__ */ jsx(
|
|
26921
|
+
Box,
|
|
26922
|
+
{
|
|
26923
|
+
className: "max-h-80 overflow-y-auto",
|
|
26924
|
+
role: "listbox",
|
|
26925
|
+
"aria-label": placeholder,
|
|
26926
|
+
children: /* @__PURE__ */ jsx(VStack, { gap: "none", children: groups.map(({ group, items }) => /* @__PURE__ */ jsxs(Box, { children: [
|
|
26927
|
+
group ? /* @__PURE__ */ jsx(
|
|
26928
|
+
Typography,
|
|
26929
|
+
{
|
|
26930
|
+
variant: "caption",
|
|
26931
|
+
color: "muted",
|
|
26932
|
+
className: "px-3 pt-2 pb-1 block",
|
|
26933
|
+
children: group
|
|
26934
|
+
}
|
|
26935
|
+
) : null,
|
|
26936
|
+
items.map((command) => {
|
|
26937
|
+
const index = filtered.indexOf(command);
|
|
26938
|
+
const isHighlighted = index === highlightIndex;
|
|
26939
|
+
return /* @__PURE__ */ jsxs(
|
|
26940
|
+
Box,
|
|
26941
|
+
{
|
|
26942
|
+
as: "button",
|
|
26943
|
+
role: "option",
|
|
26944
|
+
"aria-selected": isHighlighted,
|
|
26945
|
+
"aria-disabled": command.disabled || void 0,
|
|
26946
|
+
"data-testid": `command-palette-item-${command.id}`,
|
|
26947
|
+
onMouseEnter: () => !command.disabled && setHighlightIndex(index),
|
|
26948
|
+
onClick: () => handleSelect(command),
|
|
26949
|
+
className: cn(
|
|
26950
|
+
"w-full flex items-center gap-3 px-3 py-2 text-start rounded-sm",
|
|
26951
|
+
"text-sm transition-colors",
|
|
26952
|
+
"focus:outline-none",
|
|
26953
|
+
isHighlighted && "bg-muted",
|
|
26954
|
+
command.disabled && "opacity-50 cursor-not-allowed"
|
|
26955
|
+
),
|
|
26956
|
+
children: [
|
|
26957
|
+
command.icon ? /* @__PURE__ */ jsx(Icon, { icon: command.icon, size: "sm", className: "flex-shrink-0" }) : null,
|
|
26958
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "flex-1 truncate", children: command.label }),
|
|
26959
|
+
command.shortcut ? /* @__PURE__ */ jsx(Badge, { variant: "neutral", size: "sm", children: command.shortcut }) : null
|
|
26960
|
+
]
|
|
26961
|
+
},
|
|
26962
|
+
command.id
|
|
26963
|
+
);
|
|
26964
|
+
})
|
|
26965
|
+
] }, String(group ?? "__ungrouped__"))) })
|
|
26966
|
+
}
|
|
26967
|
+
)
|
|
26968
|
+
] }) })
|
|
26969
|
+
}
|
|
26970
|
+
);
|
|
26971
|
+
};
|
|
26972
|
+
CommandPalette.displayName = "CommandPalette";
|
|
26973
|
+
}
|
|
26974
|
+
});
|
|
26696
26975
|
function formatCount(count) {
|
|
26697
26976
|
if (count >= 1e3) {
|
|
26698
26977
|
return `${(count / 1e3).toFixed(1)}k`;
|
|
@@ -27968,7 +28247,7 @@ var init_Menu = __esm({
|
|
|
27968
28247
|
"bottom-end": "bottom-start"
|
|
27969
28248
|
};
|
|
27970
28249
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
27971
|
-
const triggerElement =
|
|
28250
|
+
const triggerElement = React96__default.isValidElement(trigger) ? React96__default.cloneElement(trigger, {
|
|
27972
28251
|
ref: triggerRef,
|
|
27973
28252
|
onClick: handleToggle
|
|
27974
28253
|
}) : /* @__PURE__ */ jsx(
|
|
@@ -28071,14 +28350,14 @@ function useDataDnd(args) {
|
|
|
28071
28350
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
28072
28351
|
const enabled = isZone || Boolean(dndRoot);
|
|
28073
28352
|
const eventBus = useEventBus();
|
|
28074
|
-
const parentRoot =
|
|
28353
|
+
const parentRoot = React96__default.useContext(RootCtx);
|
|
28075
28354
|
const isRoot = enabled && parentRoot === null;
|
|
28076
|
-
const zoneId =
|
|
28355
|
+
const zoneId = React96__default.useId();
|
|
28077
28356
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
28078
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
28079
|
-
const optimisticOrdersRef =
|
|
28357
|
+
const [optimisticOrders, setOptimisticOrders] = React96__default.useState(() => /* @__PURE__ */ new Map());
|
|
28358
|
+
const optimisticOrdersRef = React96__default.useRef(optimisticOrders);
|
|
28080
28359
|
optimisticOrdersRef.current = optimisticOrders;
|
|
28081
|
-
const clearOptimisticOrder =
|
|
28360
|
+
const clearOptimisticOrder = React96__default.useCallback((group) => {
|
|
28082
28361
|
setOptimisticOrders((prev) => {
|
|
28083
28362
|
if (!prev.has(group)) return prev;
|
|
28084
28363
|
const next = new Map(prev);
|
|
@@ -28103,7 +28382,7 @@ function useDataDnd(args) {
|
|
|
28103
28382
|
const raw = it[dndItemIdField];
|
|
28104
28383
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
28105
28384
|
}).join("|");
|
|
28106
|
-
const itemIds =
|
|
28385
|
+
const itemIds = React96__default.useMemo(
|
|
28107
28386
|
() => orderedItems.map((it, idx) => {
|
|
28108
28387
|
const raw = it[dndItemIdField];
|
|
28109
28388
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -28114,7 +28393,7 @@ function useDataDnd(args) {
|
|
|
28114
28393
|
const raw = it[dndItemIdField];
|
|
28115
28394
|
return raw != null ? String(raw) : `__${idx}`;
|
|
28116
28395
|
}).join("|");
|
|
28117
|
-
|
|
28396
|
+
React96__default.useEffect(() => {
|
|
28118
28397
|
const root = isRoot ? null : parentRoot;
|
|
28119
28398
|
if (root) {
|
|
28120
28399
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -28122,20 +28401,20 @@ function useDataDnd(args) {
|
|
|
28122
28401
|
clearOptimisticOrder(ownGroup);
|
|
28123
28402
|
}
|
|
28124
28403
|
}, [itemsContentSig, ownGroup]);
|
|
28125
|
-
const zonesRef =
|
|
28126
|
-
const registerZone =
|
|
28404
|
+
const zonesRef = React96__default.useRef(/* @__PURE__ */ new Map());
|
|
28405
|
+
const registerZone = React96__default.useCallback((zoneId2, meta2) => {
|
|
28127
28406
|
zonesRef.current.set(zoneId2, meta2);
|
|
28128
28407
|
}, []);
|
|
28129
|
-
const unregisterZone =
|
|
28408
|
+
const unregisterZone = React96__default.useCallback((zoneId2) => {
|
|
28130
28409
|
zonesRef.current.delete(zoneId2);
|
|
28131
28410
|
}, []);
|
|
28132
|
-
const [activeDrag, setActiveDrag] =
|
|
28133
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
28134
|
-
const meta =
|
|
28411
|
+
const [activeDrag, setActiveDrag] = React96__default.useState(null);
|
|
28412
|
+
const [overZoneGroup, setOverZoneGroup] = React96__default.useState(null);
|
|
28413
|
+
const meta = React96__default.useMemo(
|
|
28135
28414
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
28136
28415
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
28137
28416
|
);
|
|
28138
|
-
|
|
28417
|
+
React96__default.useEffect(() => {
|
|
28139
28418
|
const target = isRoot ? null : parentRoot;
|
|
28140
28419
|
if (!target) {
|
|
28141
28420
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -28154,7 +28433,7 @@ function useDataDnd(args) {
|
|
|
28154
28433
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
28155
28434
|
const sensors = useAlmadarDndSensors(true);
|
|
28156
28435
|
const collisionDetection = almadarDndCollisionDetection;
|
|
28157
|
-
const findZoneByItem =
|
|
28436
|
+
const findZoneByItem = React96__default.useCallback(
|
|
28158
28437
|
(id) => {
|
|
28159
28438
|
for (const z of zonesRef.current.values()) {
|
|
28160
28439
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -28163,7 +28442,7 @@ function useDataDnd(args) {
|
|
|
28163
28442
|
},
|
|
28164
28443
|
[]
|
|
28165
28444
|
);
|
|
28166
|
-
|
|
28445
|
+
React96__default.useCallback(
|
|
28167
28446
|
(group) => {
|
|
28168
28447
|
for (const z of zonesRef.current.values()) {
|
|
28169
28448
|
if (z.group === group) return z;
|
|
@@ -28172,7 +28451,7 @@ function useDataDnd(args) {
|
|
|
28172
28451
|
},
|
|
28173
28452
|
[]
|
|
28174
28453
|
);
|
|
28175
|
-
const handleDragEnd =
|
|
28454
|
+
const handleDragEnd = React96__default.useCallback(
|
|
28176
28455
|
(event) => {
|
|
28177
28456
|
const { active, over } = event;
|
|
28178
28457
|
const activeIdStr = String(active.id);
|
|
@@ -28263,8 +28542,8 @@ function useDataDnd(args) {
|
|
|
28263
28542
|
},
|
|
28264
28543
|
[eventBus]
|
|
28265
28544
|
);
|
|
28266
|
-
const sortableData =
|
|
28267
|
-
const SortableItem =
|
|
28545
|
+
const sortableData = React96__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
28546
|
+
const SortableItem = React96__default.useCallback(
|
|
28268
28547
|
({ id, children }) => {
|
|
28269
28548
|
const {
|
|
28270
28549
|
attributes,
|
|
@@ -28304,7 +28583,7 @@ function useDataDnd(args) {
|
|
|
28304
28583
|
id: droppableId,
|
|
28305
28584
|
data: sortableData
|
|
28306
28585
|
});
|
|
28307
|
-
const ctx =
|
|
28586
|
+
const ctx = React96__default.useContext(RootCtx);
|
|
28308
28587
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
28309
28588
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
28310
28589
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -28319,7 +28598,7 @@ function useDataDnd(args) {
|
|
|
28319
28598
|
showForeignPlaceholder,
|
|
28320
28599
|
ctxAvailable: ctx != null
|
|
28321
28600
|
});
|
|
28322
|
-
|
|
28601
|
+
React96__default.useEffect(() => {
|
|
28323
28602
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
28324
28603
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
28325
28604
|
return /* @__PURE__ */ jsx(
|
|
@@ -28333,11 +28612,11 @@ function useDataDnd(args) {
|
|
|
28333
28612
|
}
|
|
28334
28613
|
);
|
|
28335
28614
|
};
|
|
28336
|
-
const rootContextValue =
|
|
28615
|
+
const rootContextValue = React96__default.useMemo(
|
|
28337
28616
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
28338
28617
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
28339
28618
|
);
|
|
28340
|
-
const handleDragStart =
|
|
28619
|
+
const handleDragStart = React96__default.useCallback((event) => {
|
|
28341
28620
|
const sourceZone = findZoneByItem(event.active.id);
|
|
28342
28621
|
const rect = event.active.rect.current.initial;
|
|
28343
28622
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -28356,7 +28635,7 @@ function useDataDnd(args) {
|
|
|
28356
28635
|
isRoot
|
|
28357
28636
|
});
|
|
28358
28637
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
28359
|
-
const handleDragOver =
|
|
28638
|
+
const handleDragOver = React96__default.useCallback((event) => {
|
|
28360
28639
|
const { active, over } = event;
|
|
28361
28640
|
const overData = over?.data?.current;
|
|
28362
28641
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -28426,7 +28705,7 @@ function useDataDnd(args) {
|
|
|
28426
28705
|
return next;
|
|
28427
28706
|
});
|
|
28428
28707
|
}, []);
|
|
28429
|
-
const handleDragCancel =
|
|
28708
|
+
const handleDragCancel = React96__default.useCallback((event) => {
|
|
28430
28709
|
setActiveDrag(null);
|
|
28431
28710
|
setOverZoneGroup(null);
|
|
28432
28711
|
dndLog.warn("dragCancel", {
|
|
@@ -28434,12 +28713,12 @@ function useDataDnd(args) {
|
|
|
28434
28713
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
28435
28714
|
});
|
|
28436
28715
|
}, []);
|
|
28437
|
-
const handleDragEndWithCleanup =
|
|
28716
|
+
const handleDragEndWithCleanup = React96__default.useCallback((event) => {
|
|
28438
28717
|
handleDragEnd(event);
|
|
28439
28718
|
setActiveDrag(null);
|
|
28440
28719
|
setOverZoneGroup(null);
|
|
28441
28720
|
}, [handleDragEnd]);
|
|
28442
|
-
const wrapContainer =
|
|
28721
|
+
const wrapContainer = React96__default.useCallback(
|
|
28443
28722
|
(children) => {
|
|
28444
28723
|
if (!enabled) return children;
|
|
28445
28724
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -28493,7 +28772,7 @@ var init_useDataDnd = __esm({
|
|
|
28493
28772
|
init_useAlmadarDndCollision();
|
|
28494
28773
|
init_Box();
|
|
28495
28774
|
dndLog = createLogger("almadar:ui:dnd");
|
|
28496
|
-
RootCtx =
|
|
28775
|
+
RootCtx = React96__default.createContext(null);
|
|
28497
28776
|
}
|
|
28498
28777
|
});
|
|
28499
28778
|
function renderIconInput(icon, props) {
|
|
@@ -29008,7 +29287,7 @@ function DataList({
|
|
|
29008
29287
|
}) {
|
|
29009
29288
|
const eventBus = useEventBus();
|
|
29010
29289
|
const { t } = useTranslate();
|
|
29011
|
-
const [visibleCount, setVisibleCount] =
|
|
29290
|
+
const [visibleCount, setVisibleCount] = React96__default.useState(pageSize || Infinity);
|
|
29012
29291
|
const fieldDefs = fields ?? columns ?? [];
|
|
29013
29292
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
29014
29293
|
const dnd = useDataDnd({
|
|
@@ -29024,14 +29303,14 @@ function DataList({
|
|
|
29024
29303
|
dndRoot
|
|
29025
29304
|
});
|
|
29026
29305
|
const orderedData = dnd.orderedItems;
|
|
29027
|
-
const allData =
|
|
29306
|
+
const allData = React96__default.useMemo(
|
|
29028
29307
|
() => sortRows(orderedData, sortBy, sortDirection),
|
|
29029
29308
|
[orderedData, sortBy, sortDirection]
|
|
29030
29309
|
);
|
|
29031
29310
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
29032
29311
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
29033
29312
|
const hasRenderProp = typeof children === "function";
|
|
29034
|
-
|
|
29313
|
+
React96__default.useEffect(() => {
|
|
29035
29314
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
29036
29315
|
const childrenTypeOf = typeof children;
|
|
29037
29316
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -29151,7 +29430,7 @@ function DataList({
|
|
|
29151
29430
|
return v === void 0 || v === null || v === "" ? raw : String(v);
|
|
29152
29431
|
};
|
|
29153
29432
|
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("py-2", className), children: [
|
|
29154
|
-
groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
29433
|
+
groups2.map((group, gi) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
29155
29434
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
29156
29435
|
group.items.map((itemData, index) => {
|
|
29157
29436
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -29367,7 +29646,7 @@ function DataList({
|
|
|
29367
29646
|
className
|
|
29368
29647
|
),
|
|
29369
29648
|
children: [
|
|
29370
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
29649
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
29371
29650
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
29372
29651
|
group.items.map(
|
|
29373
29652
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -29454,7 +29733,7 @@ var init_FormSection = __esm({
|
|
|
29454
29733
|
columns = 1,
|
|
29455
29734
|
className
|
|
29456
29735
|
}) => {
|
|
29457
|
-
const [collapsed, setCollapsed] =
|
|
29736
|
+
const [collapsed, setCollapsed] = React96__default.useState(defaultCollapsed);
|
|
29458
29737
|
const { t } = useTranslate();
|
|
29459
29738
|
const eventBus = useEventBus();
|
|
29460
29739
|
const gridClass = {
|
|
@@ -29462,7 +29741,7 @@ var init_FormSection = __esm({
|
|
|
29462
29741
|
2: "grid-cols-1 md:grid-cols-2",
|
|
29463
29742
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
29464
29743
|
}[columns];
|
|
29465
|
-
|
|
29744
|
+
React96__default.useCallback(() => {
|
|
29466
29745
|
if (collapsible) {
|
|
29467
29746
|
setCollapsed((prev) => !prev);
|
|
29468
29747
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -29735,6 +30014,112 @@ var init_GridPicker = __esm({
|
|
|
29735
30014
|
GridPicker.displayName = "GridPicker";
|
|
29736
30015
|
}
|
|
29737
30016
|
});
|
|
30017
|
+
function useDraggable({ payload, disabled = false }) {
|
|
30018
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
30019
|
+
const eventBus = useEventBus();
|
|
30020
|
+
const handleDragStart = useCallback(
|
|
30021
|
+
(e) => {
|
|
30022
|
+
if (disabled) {
|
|
30023
|
+
e.preventDefault();
|
|
30024
|
+
return;
|
|
30025
|
+
}
|
|
30026
|
+
e.dataTransfer.setData(ALMADAR_DND_MIME, JSON.stringify(payload));
|
|
30027
|
+
e.dataTransfer.effectAllowed = "copy";
|
|
30028
|
+
setIsDragging(true);
|
|
30029
|
+
eventBus.emit("UI:DRAG_START", { kind: payload.kind, data: payload.data });
|
|
30030
|
+
},
|
|
30031
|
+
[disabled, payload, eventBus]
|
|
30032
|
+
);
|
|
30033
|
+
const handleDragEnd = useCallback(
|
|
30034
|
+
(e) => {
|
|
30035
|
+
setIsDragging(false);
|
|
30036
|
+
eventBus.emit("UI:DRAG_END", { kind: payload.kind, data: payload.data });
|
|
30037
|
+
},
|
|
30038
|
+
[payload, eventBus]
|
|
30039
|
+
);
|
|
30040
|
+
const dragProps = useMemo(
|
|
30041
|
+
() => ({
|
|
30042
|
+
draggable: !disabled,
|
|
30043
|
+
onDragStart: handleDragStart,
|
|
30044
|
+
onDragEnd: handleDragEnd,
|
|
30045
|
+
"aria-grabbed": isDragging
|
|
30046
|
+
}),
|
|
30047
|
+
[disabled, handleDragStart, handleDragEnd, isDragging]
|
|
30048
|
+
);
|
|
30049
|
+
return { dragProps, isDragging };
|
|
30050
|
+
}
|
|
30051
|
+
var ALMADAR_DND_MIME;
|
|
30052
|
+
var init_useDraggable = __esm({
|
|
30053
|
+
"hooks/useDraggable.ts"() {
|
|
30054
|
+
"use client";
|
|
30055
|
+
init_useEventBus();
|
|
30056
|
+
ALMADAR_DND_MIME = "application/x-almadar-dnd";
|
|
30057
|
+
}
|
|
30058
|
+
});
|
|
30059
|
+
function parsePayload(e) {
|
|
30060
|
+
try {
|
|
30061
|
+
const raw = e.dataTransfer.getData(ALMADAR_DND_MIME);
|
|
30062
|
+
if (!raw) return null;
|
|
30063
|
+
const parsed = JSON.parse(raw);
|
|
30064
|
+
if (typeof parsed.kind !== "string" || !parsed.data) return null;
|
|
30065
|
+
return parsed;
|
|
30066
|
+
} catch {
|
|
30067
|
+
return null;
|
|
30068
|
+
}
|
|
30069
|
+
}
|
|
30070
|
+
function hasAlmadarPayload(e) {
|
|
30071
|
+
return e.dataTransfer.types.includes(ALMADAR_DND_MIME);
|
|
30072
|
+
}
|
|
30073
|
+
function useDropZone({ accepts, onDrop, disabled = false }) {
|
|
30074
|
+
const [isOver, setIsOver] = useState(false);
|
|
30075
|
+
const eventBus = useEventBus();
|
|
30076
|
+
const handleDragOver = useCallback(
|
|
30077
|
+
(e) => {
|
|
30078
|
+
if (disabled) return;
|
|
30079
|
+
if (!hasAlmadarPayload(e)) return;
|
|
30080
|
+
e.preventDefault();
|
|
30081
|
+
e.dataTransfer.dropEffect = "copy";
|
|
30082
|
+
setIsOver(true);
|
|
30083
|
+
},
|
|
30084
|
+
[disabled]
|
|
30085
|
+
);
|
|
30086
|
+
const handleDragLeave = useCallback(
|
|
30087
|
+
(e) => {
|
|
30088
|
+
setIsOver(false);
|
|
30089
|
+
},
|
|
30090
|
+
[]
|
|
30091
|
+
);
|
|
30092
|
+
const handleDrop = useCallback(
|
|
30093
|
+
(e) => {
|
|
30094
|
+
e.preventDefault();
|
|
30095
|
+
setIsOver(false);
|
|
30096
|
+
if (disabled) return;
|
|
30097
|
+
const payload = parsePayload(e);
|
|
30098
|
+
if (!payload) return;
|
|
30099
|
+
if (!accepts.includes(payload.kind)) return;
|
|
30100
|
+
const position = { x: e.clientX, y: e.clientY };
|
|
30101
|
+
onDrop(payload, position);
|
|
30102
|
+
eventBus.emit("UI:DROP", { kind: payload.kind, data: payload.data, ...position });
|
|
30103
|
+
},
|
|
30104
|
+
[disabled, accepts, onDrop, eventBus]
|
|
30105
|
+
);
|
|
30106
|
+
const dropProps = useMemo(
|
|
30107
|
+
() => ({
|
|
30108
|
+
onDragOver: handleDragOver,
|
|
30109
|
+
onDragLeave: handleDragLeave,
|
|
30110
|
+
onDrop: handleDrop
|
|
30111
|
+
}),
|
|
30112
|
+
[handleDragOver, handleDragLeave, handleDrop]
|
|
30113
|
+
);
|
|
30114
|
+
return { dropProps, isOver };
|
|
30115
|
+
}
|
|
30116
|
+
var init_useDropZone = __esm({
|
|
30117
|
+
"hooks/useDropZone.ts"() {
|
|
30118
|
+
"use client";
|
|
30119
|
+
init_useEventBus();
|
|
30120
|
+
init_useDraggable();
|
|
30121
|
+
}
|
|
30122
|
+
});
|
|
29738
30123
|
function fileIcon(name) {
|
|
29739
30124
|
const ext = name.split(".").pop()?.toLowerCase() ?? "";
|
|
29740
30125
|
switch (ext) {
|
|
@@ -29760,6 +30145,13 @@ function fileIcon(name) {
|
|
|
29760
30145
|
return "file";
|
|
29761
30146
|
}
|
|
29762
30147
|
}
|
|
30148
|
+
function siblingsOf(target, roots, childrenByParent) {
|
|
30149
|
+
if (target.parentId) {
|
|
30150
|
+
const parentSiblings = childrenByParent.get(target.parentId);
|
|
30151
|
+
if (parentSiblings?.some((sibling) => sibling.id === target.id)) return parentSiblings;
|
|
30152
|
+
}
|
|
30153
|
+
return roots;
|
|
30154
|
+
}
|
|
29763
30155
|
function ancestorsOf(id, byId) {
|
|
29764
30156
|
const out = /* @__PURE__ */ new Set();
|
|
29765
30157
|
if (!id) return out;
|
|
@@ -29777,6 +30169,8 @@ var init_FileTree = __esm({
|
|
|
29777
30169
|
init_Box();
|
|
29778
30170
|
init_Typography();
|
|
29779
30171
|
init_Icon();
|
|
30172
|
+
init_useDraggable();
|
|
30173
|
+
init_useDropZone();
|
|
29780
30174
|
TreeNodeItem = ({
|
|
29781
30175
|
node,
|
|
29782
30176
|
depth,
|
|
@@ -29860,10 +30254,12 @@ var init_FileTree = __esm({
|
|
|
29860
30254
|
depth,
|
|
29861
30255
|
indent,
|
|
29862
30256
|
childrenByParent,
|
|
30257
|
+
roots,
|
|
29863
30258
|
onNodeSelect,
|
|
29864
30259
|
onNodeAction,
|
|
29865
30260
|
nodeActionIcon,
|
|
29866
30261
|
nodeActionLabel,
|
|
30262
|
+
onNodeReorder,
|
|
29867
30263
|
selectedId,
|
|
29868
30264
|
look,
|
|
29869
30265
|
isExpanded,
|
|
@@ -29874,6 +30270,7 @@ var init_FileTree = __esm({
|
|
|
29874
30270
|
const expanded = hasChildren && isExpanded(item.id, depth);
|
|
29875
30271
|
const isSelected = selectedId !== void 0 && selectedId !== "" && item.id === selectedId;
|
|
29876
30272
|
const nav = look === "nav";
|
|
30273
|
+
const rowRef = useRef(null);
|
|
29877
30274
|
const handleClick = useCallback(() => {
|
|
29878
30275
|
if (hasChildren && !onNodeSelect) onToggle(item.id, expanded);
|
|
29879
30276
|
onNodeSelect?.(item.id);
|
|
@@ -29886,16 +30283,50 @@ var init_FileTree = __esm({
|
|
|
29886
30283
|
e.stopPropagation();
|
|
29887
30284
|
onNodeAction?.(item.id);
|
|
29888
30285
|
}, [item.id, onNodeAction]);
|
|
30286
|
+
const { dragProps } = useDraggable({
|
|
30287
|
+
payload: { kind: "tree-node", data: { id: item.id } },
|
|
30288
|
+
disabled: !onNodeReorder
|
|
30289
|
+
});
|
|
30290
|
+
const handleRowDrop = useCallback(
|
|
30291
|
+
(payload, position) => {
|
|
30292
|
+
if (!onNodeReorder) return;
|
|
30293
|
+
const draggedId = typeof payload.data.id === "string" ? payload.data.id : void 0;
|
|
30294
|
+
if (!draggedId || draggedId === item.id) return;
|
|
30295
|
+
const rect = rowRef.current?.getBoundingClientRect();
|
|
30296
|
+
if (!rect || rect.height === 0) return;
|
|
30297
|
+
const relY = position.y - rect.top;
|
|
30298
|
+
const third = rect.height / 3;
|
|
30299
|
+
if (relY >= third && relY <= third * 2) {
|
|
30300
|
+
const existingChildren = childrenByParent.get(item.id);
|
|
30301
|
+
onNodeReorder(draggedId, item.id, existingChildren ? existingChildren.length : 0);
|
|
30302
|
+
return;
|
|
30303
|
+
}
|
|
30304
|
+
const siblings = siblingsOf(item, roots, childrenByParent);
|
|
30305
|
+
const newParentId = siblings === roots ? null : item.parentId ?? null;
|
|
30306
|
+
const targetIndex = siblings.findIndex((sibling) => sibling.id === item.id);
|
|
30307
|
+
const index = relY < third ? targetIndex < 0 ? 0 : targetIndex : targetIndex < 0 ? siblings.length : targetIndex + 1;
|
|
30308
|
+
onNodeReorder(draggedId, newParentId, index);
|
|
30309
|
+
},
|
|
30310
|
+
[onNodeReorder, item, roots, childrenByParent]
|
|
30311
|
+
);
|
|
30312
|
+
const { dropProps } = useDropZone({
|
|
30313
|
+
accepts: ["tree-node"],
|
|
30314
|
+
onDrop: handleRowDrop,
|
|
30315
|
+
disabled: !onNodeReorder
|
|
30316
|
+
});
|
|
29889
30317
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
29890
30318
|
/* @__PURE__ */ jsxs(
|
|
29891
30319
|
Box,
|
|
29892
30320
|
{
|
|
30321
|
+
ref: rowRef,
|
|
29893
30322
|
className: `group/treerow flex items-center gap-1.5 px-2 cursor-pointer rounded-sm transition-colors ${nav ? "py-1" : "py-0.5"} ${isSelected ? "bg-primary text-primary-foreground" : nav ? "text-foreground hover:bg-muted" : "hover:bg-muted"}`,
|
|
29894
30323
|
style: { paddingLeft: depth * indent + 8 },
|
|
29895
30324
|
onClick: handleClick,
|
|
29896
30325
|
role: "treeitem",
|
|
29897
30326
|
"aria-selected": isSelected,
|
|
29898
30327
|
"aria-expanded": hasChildren ? expanded : void 0,
|
|
30328
|
+
...dragProps,
|
|
30329
|
+
...dropProps,
|
|
29899
30330
|
children: [
|
|
29900
30331
|
hasChildren ? /* @__PURE__ */ jsx(Box, { onClick: handleChevron, className: "flex items-center flex-shrink-0", role: "button", "aria-label": expanded ? "Collapse" : "Expand", children: /* @__PURE__ */ jsx(
|
|
29901
30332
|
Icon,
|
|
@@ -29942,10 +30373,12 @@ var init_FileTree = __esm({
|
|
|
29942
30373
|
depth: depth + 1,
|
|
29943
30374
|
indent,
|
|
29944
30375
|
childrenByParent,
|
|
30376
|
+
roots,
|
|
29945
30377
|
onNodeSelect,
|
|
29946
30378
|
onNodeAction,
|
|
29947
30379
|
nodeActionIcon,
|
|
29948
30380
|
nodeActionLabel,
|
|
30381
|
+
onNodeReorder,
|
|
29949
30382
|
selectedId,
|
|
29950
30383
|
look,
|
|
29951
30384
|
isExpanded,
|
|
@@ -29963,14 +30396,15 @@ var init_FileTree = __esm({
|
|
|
29963
30396
|
onNodeAction,
|
|
29964
30397
|
nodeActionIcon,
|
|
29965
30398
|
nodeActionLabel,
|
|
30399
|
+
onNodeReorder,
|
|
29966
30400
|
className,
|
|
29967
30401
|
indent = 16
|
|
29968
30402
|
}) => {
|
|
29969
30403
|
const [overrides, setOverrides] = useState(() => /* @__PURE__ */ new Map());
|
|
29970
|
-
const byId =
|
|
29971
|
-
const selectedAncestors =
|
|
29972
|
-
const lastSelectedRef =
|
|
29973
|
-
|
|
30404
|
+
const byId = React96__default.useMemo(() => new Map(items.map((node) => [node.id, node])), [items]);
|
|
30405
|
+
const selectedAncestors = React96__default.useMemo(() => ancestorsOf(selectedId, byId), [selectedId, byId]);
|
|
30406
|
+
const lastSelectedRef = React96__default.useRef(selectedId);
|
|
30407
|
+
React96__default.useEffect(() => {
|
|
29974
30408
|
if (selectedId === lastSelectedRef.current) return;
|
|
29975
30409
|
lastSelectedRef.current = selectedId;
|
|
29976
30410
|
setOverrides((prev) => {
|
|
@@ -30011,10 +30445,12 @@ var init_FileTree = __esm({
|
|
|
30011
30445
|
depth: 0,
|
|
30012
30446
|
indent,
|
|
30013
30447
|
childrenByParent,
|
|
30448
|
+
roots,
|
|
30014
30449
|
onNodeSelect,
|
|
30015
30450
|
onNodeAction,
|
|
30016
30451
|
nodeActionIcon,
|
|
30017
30452
|
nodeActionLabel,
|
|
30453
|
+
onNodeReorder,
|
|
30018
30454
|
selectedId,
|
|
30019
30455
|
look,
|
|
30020
30456
|
isExpanded,
|
|
@@ -30034,6 +30470,7 @@ var init_FileTree = __esm({
|
|
|
30034
30470
|
onNodeAction,
|
|
30035
30471
|
nodeActionIcon,
|
|
30036
30472
|
nodeActionLabel,
|
|
30473
|
+
onNodeReorder,
|
|
30037
30474
|
className,
|
|
30038
30475
|
indent = 16
|
|
30039
30476
|
}) => {
|
|
@@ -30048,6 +30485,7 @@ var init_FileTree = __esm({
|
|
|
30048
30485
|
onNodeAction,
|
|
30049
30486
|
nodeActionIcon,
|
|
30050
30487
|
nodeActionLabel,
|
|
30488
|
+
onNodeReorder,
|
|
30051
30489
|
className,
|
|
30052
30490
|
indent
|
|
30053
30491
|
}
|
|
@@ -30800,7 +31238,7 @@ var init_Flex = __esm({
|
|
|
30800
31238
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
30801
31239
|
}
|
|
30802
31240
|
}
|
|
30803
|
-
return
|
|
31241
|
+
return React96__default.createElement(Component, {
|
|
30804
31242
|
className: cn(
|
|
30805
31243
|
inline ? "inline-flex" : "flex",
|
|
30806
31244
|
directionStyles[direction],
|
|
@@ -30919,7 +31357,7 @@ var init_Grid = __esm({
|
|
|
30919
31357
|
as: Component = "div"
|
|
30920
31358
|
}) => {
|
|
30921
31359
|
const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
|
|
30922
|
-
return
|
|
31360
|
+
return React96__default.createElement(
|
|
30923
31361
|
Component,
|
|
30924
31362
|
{
|
|
30925
31363
|
className: cn(
|
|
@@ -31341,9 +31779,9 @@ var init_Popover = __esm({
|
|
|
31341
31779
|
onMouseLeave: handleClose,
|
|
31342
31780
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
31343
31781
|
};
|
|
31344
|
-
const childElement =
|
|
31782
|
+
const childElement = React96__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
31345
31783
|
const childPointerDown = childElement.props.onPointerDown;
|
|
31346
|
-
const triggerElement =
|
|
31784
|
+
const triggerElement = React96__default.cloneElement(
|
|
31347
31785
|
childElement,
|
|
31348
31786
|
{
|
|
31349
31787
|
ref: triggerRef,
|
|
@@ -31957,9 +32395,9 @@ var init_Tooltip = __esm({
|
|
|
31957
32395
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
31958
32396
|
};
|
|
31959
32397
|
}, []);
|
|
31960
|
-
const triggerElement =
|
|
32398
|
+
const triggerElement = React96__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
31961
32399
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
31962
|
-
const trigger =
|
|
32400
|
+
const trigger = React96__default.cloneElement(triggerElement, {
|
|
31963
32401
|
ref: triggerRef,
|
|
31964
32402
|
onMouseEnter: handleMouseEnter,
|
|
31965
32403
|
onMouseLeave: handleMouseLeave,
|
|
@@ -32049,7 +32487,7 @@ var init_WizardProgress = __esm({
|
|
|
32049
32487
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
32050
32488
|
const isActive = index === currentStep;
|
|
32051
32489
|
const isCompleted = index < currentStep;
|
|
32052
|
-
return /* @__PURE__ */ jsxs(
|
|
32490
|
+
return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
32053
32491
|
/* @__PURE__ */ jsx(
|
|
32054
32492
|
"button",
|
|
32055
32493
|
{
|
|
@@ -33111,6 +33549,8 @@ var init_MathCanvas = __esm({
|
|
|
33111
33549
|
gridColor = "var(--color-border, #9ca3af)",
|
|
33112
33550
|
axisColor = "var(--color-muted-foreground, #374151)",
|
|
33113
33551
|
showTickLabels = false,
|
|
33552
|
+
tickLabelFontSize = 10,
|
|
33553
|
+
labelFontSize = 12,
|
|
33114
33554
|
showCurveLabels = false,
|
|
33115
33555
|
curves = [],
|
|
33116
33556
|
points = [],
|
|
@@ -33182,18 +33622,18 @@ var init_MathCanvas = __esm({
|
|
|
33182
33622
|
let kx = 0;
|
|
33183
33623
|
for (let x = Math.ceil(xMin / gridStep) * gridStep; x <= xMax; x += gridStep, kx++) {
|
|
33184
33624
|
if (kx % labelEveryX === 0 && x !== 0) {
|
|
33185
|
-
out.push({ type: "text", x: mapX(x), y: xAxisY + 12, text: formatTick(x), color: "#6b7280", fontSize:
|
|
33625
|
+
out.push({ type: "text", x: mapX(x), y: xAxisY + 12, text: formatTick(x), color: "#6b7280", fontSize: tickLabelFontSize, align: "center" });
|
|
33186
33626
|
}
|
|
33187
33627
|
}
|
|
33188
33628
|
const labelEveryY = Math.max(1, Math.ceil((yMax - yMin) / gridStep / Math.floor(plotH / 28)));
|
|
33189
33629
|
let ky = 0;
|
|
33190
33630
|
for (let y = Math.ceil(yMin / gridStep) * gridStep; y <= yMax; y += gridStep, ky++) {
|
|
33191
33631
|
if (ky % labelEveryY === 0 && y !== 0) {
|
|
33192
|
-
out.push({ type: "text", x: yAxisX - 6, y: mapY(y), text: formatTick(y), color: "#6b7280", fontSize:
|
|
33632
|
+
out.push({ type: "text", x: yAxisX - 6, y: mapY(y), text: formatTick(y), color: "#6b7280", fontSize: tickLabelFontSize, align: "right" });
|
|
33193
33633
|
}
|
|
33194
33634
|
}
|
|
33195
33635
|
if (xMin <= 0 && xMax >= 0 && yMin <= 0 && yMax >= 0) {
|
|
33196
|
-
out.push({ type: "text", x: yAxisX - 6, y: xAxisY + 12, text: "0", color: "#6b7280", fontSize:
|
|
33636
|
+
out.push({ type: "text", x: yAxisX - 6, y: xAxisY + 12, text: "0", color: "#6b7280", fontSize: tickLabelFontSize, align: "right" });
|
|
33197
33637
|
}
|
|
33198
33638
|
}
|
|
33199
33639
|
for (const region of regions) {
|
|
@@ -33224,7 +33664,7 @@ var init_MathCanvas = __esm({
|
|
|
33224
33664
|
y: (mapY(region.samples[mid].y) + mapY(baseline)) / 2,
|
|
33225
33665
|
text: region.label,
|
|
33226
33666
|
color,
|
|
33227
|
-
fontSize:
|
|
33667
|
+
fontSize: labelFontSize
|
|
33228
33668
|
});
|
|
33229
33669
|
}
|
|
33230
33670
|
}
|
|
@@ -33263,7 +33703,7 @@ var init_MathCanvas = __esm({
|
|
|
33263
33703
|
const py = mapY(guide.at);
|
|
33264
33704
|
out.push({ type: "line", x1: margin, y1: py, x2: width - margin, y2: py, color, dash });
|
|
33265
33705
|
if (guide.label) {
|
|
33266
|
-
out.push({ type: "text", x: width - margin - 4, y: py - 8, text: guide.label, color, fontSize:
|
|
33706
|
+
out.push({ type: "text", x: width - margin - 4, y: py - 8, text: guide.label, color, fontSize: labelFontSize, align: "right" });
|
|
33267
33707
|
}
|
|
33268
33708
|
}
|
|
33269
33709
|
}
|
|
@@ -33306,7 +33746,7 @@ var init_MathCanvas = __esm({
|
|
|
33306
33746
|
y: mapY(lastInRange.y) - 6,
|
|
33307
33747
|
text: curve.label,
|
|
33308
33748
|
color: curve.color ?? "#2563eb",
|
|
33309
|
-
fontSize:
|
|
33749
|
+
fontSize: labelFontSize
|
|
33310
33750
|
});
|
|
33311
33751
|
}
|
|
33312
33752
|
}
|
|
@@ -33343,7 +33783,7 @@ var init_MathCanvas = __esm({
|
|
|
33343
33783
|
y: xAxisY - peak - 8,
|
|
33344
33784
|
text: hop.label,
|
|
33345
33785
|
color,
|
|
33346
|
-
fontSize:
|
|
33786
|
+
fontSize: labelFontSize,
|
|
33347
33787
|
align: "center"
|
|
33348
33788
|
});
|
|
33349
33789
|
}
|
|
@@ -33370,7 +33810,7 @@ var init_MathCanvas = __esm({
|
|
|
33370
33810
|
y: mapY(angle.y + 1.35 * radius * Math.sin(rad)),
|
|
33371
33811
|
text: angle.label,
|
|
33372
33812
|
color,
|
|
33373
|
-
fontSize:
|
|
33813
|
+
fontSize: labelFontSize,
|
|
33374
33814
|
align: "center"
|
|
33375
33815
|
});
|
|
33376
33816
|
}
|
|
@@ -33387,7 +33827,7 @@ var init_MathCanvas = __esm({
|
|
|
33387
33827
|
fill: isOpen ? "#ffffff" : p.color ?? "#dc2626"
|
|
33388
33828
|
});
|
|
33389
33829
|
if (p.label) {
|
|
33390
|
-
out.push({ type: "text", x: mapX(p.x) + 8, y: mapY(p.y) - 8, text: p.label, color: p.color ?? "#111827", fontSize:
|
|
33830
|
+
out.push({ type: "text", x: mapX(p.x) + 8, y: mapY(p.y) - 8, text: p.label, color: p.color ?? "#111827", fontSize: labelFontSize });
|
|
33391
33831
|
}
|
|
33392
33832
|
}
|
|
33393
33833
|
for (const v of vectors) {
|
|
@@ -33398,7 +33838,7 @@ var init_MathCanvas = __esm({
|
|
|
33398
33838
|
const y2 = mapY(v.y + v.vy);
|
|
33399
33839
|
out.push({ type: "arrow", x1, y1, x2, y2, color: v.color ?? "#7c3aed", lineWidth: 2 });
|
|
33400
33840
|
if (v.label) {
|
|
33401
|
-
out.push({ type: "text", x: x2 + 6, y: y2 - 6, text: v.label, color: v.color ?? "#7c3aed", fontSize:
|
|
33841
|
+
out.push({ type: "text", x: x2 + 6, y: y2 - 6, text: v.label, color: v.color ?? "#7c3aed", fontSize: labelFontSize });
|
|
33402
33842
|
}
|
|
33403
33843
|
}
|
|
33404
33844
|
out.push(...shapes);
|
|
@@ -33417,6 +33857,8 @@ var init_MathCanvas = __esm({
|
|
|
33417
33857
|
gridColor,
|
|
33418
33858
|
axisColor,
|
|
33419
33859
|
showTickLabels,
|
|
33860
|
+
tickLabelFontSize,
|
|
33861
|
+
labelFontSize,
|
|
33420
33862
|
showCurveLabels,
|
|
33421
33863
|
curves,
|
|
33422
33864
|
points,
|
|
@@ -34704,13 +35146,13 @@ var init_MapView = __esm({
|
|
|
34704
35146
|
shadowSize: [41, 41]
|
|
34705
35147
|
});
|
|
34706
35148
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
34707
|
-
const { useEffect:
|
|
35149
|
+
const { useEffect: useEffect68, useRef: useRef67, useCallback: useCallback99, useState: useState107 } = React96__default;
|
|
34708
35150
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
34709
35151
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
34710
35152
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
34711
35153
|
const map = useMap();
|
|
34712
|
-
const prevRef =
|
|
34713
|
-
|
|
35154
|
+
const prevRef = useRef67({ centerLat, centerLng, zoom });
|
|
35155
|
+
useEffect68(() => {
|
|
34714
35156
|
const prev = prevRef.current;
|
|
34715
35157
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
34716
35158
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -34721,7 +35163,7 @@ var init_MapView = __esm({
|
|
|
34721
35163
|
}
|
|
34722
35164
|
function MapClickHandler({ onMapClick }) {
|
|
34723
35165
|
const map = useMap();
|
|
34724
|
-
|
|
35166
|
+
useEffect68(() => {
|
|
34725
35167
|
if (!onMapClick) return;
|
|
34726
35168
|
const handler = (e) => {
|
|
34727
35169
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -34749,8 +35191,8 @@ var init_MapView = __esm({
|
|
|
34749
35191
|
showAttribution = true
|
|
34750
35192
|
}) {
|
|
34751
35193
|
const eventBus = useEventBus2();
|
|
34752
|
-
const [clickedPosition, setClickedPosition] =
|
|
34753
|
-
const handleMapClick =
|
|
35194
|
+
const [clickedPosition, setClickedPosition] = useState107(null);
|
|
35195
|
+
const handleMapClick = useCallback99((lat, lng) => {
|
|
34754
35196
|
if (showClickedPin) {
|
|
34755
35197
|
setClickedPosition({ lat, lng });
|
|
34756
35198
|
}
|
|
@@ -34759,7 +35201,7 @@ var init_MapView = __esm({
|
|
|
34759
35201
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
34760
35202
|
}
|
|
34761
35203
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
34762
|
-
const handleMarkerClick =
|
|
35204
|
+
const handleMarkerClick = useCallback99((marker) => {
|
|
34763
35205
|
onMarkerClick?.(marker);
|
|
34764
35206
|
if (markerClickEvent) {
|
|
34765
35207
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -35649,8 +36091,8 @@ function TableView({
|
|
|
35649
36091
|
}) {
|
|
35650
36092
|
const eventBus = useEventBus();
|
|
35651
36093
|
const { t } = useTranslate();
|
|
35652
|
-
const [visibleCount, setVisibleCount] =
|
|
35653
|
-
const [localSelected, setLocalSelected] =
|
|
36094
|
+
const [visibleCount, setVisibleCount] = React96__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
36095
|
+
const [localSelected, setLocalSelected] = React96__default.useState(/* @__PURE__ */ new Set());
|
|
35654
36096
|
const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
|
|
35655
36097
|
const actionDefs = Array.isArray(itemActions) ? itemActions : [];
|
|
35656
36098
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
@@ -35671,7 +36113,7 @@ function TableView({
|
|
|
35671
36113
|
const hasMore = pageSize > 0 && visibleCount < ordered2.length;
|
|
35672
36114
|
const hasRenderProp = typeof children === "function";
|
|
35673
36115
|
const idField = dndItemIdField ?? "id";
|
|
35674
|
-
|
|
36116
|
+
React96__default.useEffect(() => {
|
|
35675
36117
|
tableViewLog.debug("render", {
|
|
35676
36118
|
rowCount: data.length,
|
|
35677
36119
|
colCount: colDefs.length,
|
|
@@ -35721,7 +36163,7 @@ function TableView({
|
|
|
35721
36163
|
};
|
|
35722
36164
|
eventBus.emit(`UI:${rowClickEvent}`, payload);
|
|
35723
36165
|
};
|
|
35724
|
-
const colFloors =
|
|
36166
|
+
const colFloors = React96__default.useMemo(
|
|
35725
36167
|
() => colDefs.map((col) => {
|
|
35726
36168
|
const longest = data.reduce((widest, row) => {
|
|
35727
36169
|
const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
|
|
@@ -35864,12 +36306,12 @@ function TableView({
|
|
|
35864
36306
|
]
|
|
35865
36307
|
}
|
|
35866
36308
|
);
|
|
35867
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
36309
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React96__default.Fragment, { children: rowInner }, id);
|
|
35868
36310
|
};
|
|
35869
36311
|
const items = Array.from(data);
|
|
35870
36312
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
35871
36313
|
let runningIndex = 0;
|
|
35872
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
36314
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
35873
36315
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
35874
36316
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
35875
36317
|
] }, gi)) });
|
|
@@ -37238,7 +37680,7 @@ var init_StepFlow = __esm({
|
|
|
37238
37680
|
className
|
|
37239
37681
|
}) => {
|
|
37240
37682
|
if (orientation === "vertical") {
|
|
37241
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
37683
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React96__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
37242
37684
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
37243
37685
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
37244
37686
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -37249,7 +37691,7 @@ var init_StepFlow = __esm({
|
|
|
37249
37691
|
] })
|
|
37250
37692
|
] }) }, index)) });
|
|
37251
37693
|
}
|
|
37252
|
-
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(
|
|
37694
|
+
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(React96__default.Fragment, { children: [
|
|
37253
37695
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
37254
37696
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
37255
37697
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -38239,7 +38681,7 @@ var init_LikertScale = __esm({
|
|
|
38239
38681
|
md: "text-base",
|
|
38240
38682
|
lg: "text-lg"
|
|
38241
38683
|
};
|
|
38242
|
-
LikertScale =
|
|
38684
|
+
LikertScale = React96__default.forwardRef(
|
|
38243
38685
|
({
|
|
38244
38686
|
question,
|
|
38245
38687
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -38251,7 +38693,7 @@ var init_LikertScale = __esm({
|
|
|
38251
38693
|
variant = "radios",
|
|
38252
38694
|
className
|
|
38253
38695
|
}, ref) => {
|
|
38254
|
-
const groupId =
|
|
38696
|
+
const groupId = React96__default.useId();
|
|
38255
38697
|
const eventBus = useEventBus();
|
|
38256
38698
|
const handleSelect = useCallback(
|
|
38257
38699
|
(next) => {
|
|
@@ -40674,7 +41116,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
40674
41116
|
"aria-label": t("aria.breadcrumb"),
|
|
40675
41117
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
40676
41118
|
const isLast = idx === items.length - 1;
|
|
40677
|
-
return /* @__PURE__ */ jsxs(
|
|
41119
|
+
return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
40678
41120
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
40679
41121
|
Icon,
|
|
40680
41122
|
{
|
|
@@ -41339,7 +41781,7 @@ var init_PageHeader = __esm({
|
|
|
41339
41781
|
info: "bg-info/10 text-info"
|
|
41340
41782
|
};
|
|
41341
41783
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
41342
|
-
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(
|
|
41784
|
+
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(React96__default.Fragment, { children: [
|
|
41343
41785
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
41344
41786
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
41345
41787
|
"a",
|
|
@@ -41697,7 +42139,7 @@ var init_Section = __esm({
|
|
|
41697
42139
|
as: Component = "section"
|
|
41698
42140
|
}) => {
|
|
41699
42141
|
const hasHeader = title || description || action;
|
|
41700
|
-
return
|
|
42142
|
+
return React96__default.createElement(
|
|
41701
42143
|
Component,
|
|
41702
42144
|
{
|
|
41703
42145
|
className: cn(
|
|
@@ -42071,7 +42513,7 @@ var init_WizardContainer = __esm({
|
|
|
42071
42513
|
const isCompleted = index < currentStep;
|
|
42072
42514
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
42073
42515
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
42074
|
-
return /* @__PURE__ */ jsxs(
|
|
42516
|
+
return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
42075
42517
|
/* @__PURE__ */ jsx(
|
|
42076
42518
|
Button,
|
|
42077
42519
|
{
|
|
@@ -43858,7 +44300,7 @@ var init_ImportPreviewTree = __esm({
|
|
|
43858
44300
|
const renderUnit = (unit, childrenByParent, depth) => {
|
|
43859
44301
|
const summary = fieldSummary(unit);
|
|
43860
44302
|
const children = childrenByParent.get(unit.ref) ?? [];
|
|
43861
|
-
return /* @__PURE__ */ jsxs(
|
|
44303
|
+
return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
43862
44304
|
/* @__PURE__ */ jsxs(
|
|
43863
44305
|
Box,
|
|
43864
44306
|
{
|
|
@@ -43955,7 +44397,7 @@ var init_ImportProgress = __esm({
|
|
|
43955
44397
|
PIPELINE.map((key, index) => {
|
|
43956
44398
|
const isComplete = index < currentIndex;
|
|
43957
44399
|
const isActive = index === currentIndex;
|
|
43958
|
-
return /* @__PURE__ */ jsxs(
|
|
44400
|
+
return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
43959
44401
|
index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
|
|
43960
44402
|
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
|
|
43961
44403
|
/* @__PURE__ */ jsx(
|
|
@@ -44083,6 +44525,69 @@ var init_ReflectionBlock = __esm({
|
|
|
44083
44525
|
ReflectionBlock.displayName = "ReflectionBlock";
|
|
44084
44526
|
}
|
|
44085
44527
|
});
|
|
44528
|
+
var positionClasses, FloatingToolbar;
|
|
44529
|
+
var init_FloatingToolbar = __esm({
|
|
44530
|
+
"components/core/molecules/FloatingToolbar.tsx"() {
|
|
44531
|
+
"use client";
|
|
44532
|
+
init_Button();
|
|
44533
|
+
init_Box();
|
|
44534
|
+
init_Divider();
|
|
44535
|
+
init_Typography();
|
|
44536
|
+
init_ButtonGroup();
|
|
44537
|
+
init_cn();
|
|
44538
|
+
init_useEventBus();
|
|
44539
|
+
positionClasses = {
|
|
44540
|
+
"bottom-center": "bottom-6 left-1/2 -translate-x-1/2",
|
|
44541
|
+
"bottom-left": "bottom-6 left-6",
|
|
44542
|
+
"bottom-right": "bottom-6 right-6"
|
|
44543
|
+
};
|
|
44544
|
+
FloatingToolbar = ({
|
|
44545
|
+
items,
|
|
44546
|
+
position = "bottom-center",
|
|
44547
|
+
children,
|
|
44548
|
+
className
|
|
44549
|
+
}) => {
|
|
44550
|
+
const eventBus = useEventBus();
|
|
44551
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50", positionClasses[position]), children: /* @__PURE__ */ jsxs(
|
|
44552
|
+
ButtonGroup,
|
|
44553
|
+
{
|
|
44554
|
+
variant: "default",
|
|
44555
|
+
orientation: "horizontal",
|
|
44556
|
+
className: cn(
|
|
44557
|
+
"items-center gap-1 rounded-full border border-border",
|
|
44558
|
+
"bg-card/95 backdrop-blur-sm shadow-elevation-popover p-1",
|
|
44559
|
+
className
|
|
44560
|
+
),
|
|
44561
|
+
children: [
|
|
44562
|
+
items.map((item) => /* @__PURE__ */ jsx(
|
|
44563
|
+
Button,
|
|
44564
|
+
{
|
|
44565
|
+
variant: item.active ? "primary" : "ghost",
|
|
44566
|
+
size: "sm",
|
|
44567
|
+
icon: item.icon,
|
|
44568
|
+
action: item.action,
|
|
44569
|
+
actionPayload: item.actionPayload,
|
|
44570
|
+
disabled: item.disabled,
|
|
44571
|
+
"aria-pressed": item.active,
|
|
44572
|
+
"aria-label": item.label,
|
|
44573
|
+
className: "rounded-full",
|
|
44574
|
+
"data-testid": item.testId ?? `floating-toolbar-item-${item.id}`,
|
|
44575
|
+
onClick: () => {
|
|
44576
|
+
if (item.event) eventBus.emit(`UI:${item.event}`, { actionId: item.id });
|
|
44577
|
+
},
|
|
44578
|
+
children: /* @__PURE__ */ jsx(Typography, { as: "span", className: "sr-only", children: item.label })
|
|
44579
|
+
},
|
|
44580
|
+
item.id
|
|
44581
|
+
)),
|
|
44582
|
+
children && items.length > 0 && /* @__PURE__ */ jsx(Divider, { orientation: "vertical", className: "h-6 mx-1" }),
|
|
44583
|
+
children
|
|
44584
|
+
]
|
|
44585
|
+
}
|
|
44586
|
+
) });
|
|
44587
|
+
};
|
|
44588
|
+
FloatingToolbar.displayName = "FloatingToolbar";
|
|
44589
|
+
}
|
|
44590
|
+
});
|
|
44086
44591
|
|
|
44087
44592
|
// components/core/molecules/index.ts
|
|
44088
44593
|
var init_molecules2 = __esm({
|
|
@@ -44833,7 +45338,7 @@ var init_DetailPanel = __esm({
|
|
|
44833
45338
|
}) => {
|
|
44834
45339
|
const eventBus = useEventBus();
|
|
44835
45340
|
const { t } = useTranslate();
|
|
44836
|
-
const [titleDraft, setTitleDraft] =
|
|
45341
|
+
const [titleDraft, setTitleDraft] = React96__default.useState(null);
|
|
44837
45342
|
const isFieldDefArray = (arr) => {
|
|
44838
45343
|
if (!arr || arr.length === 0) return false;
|
|
44839
45344
|
const first = arr[0];
|
|
@@ -45226,8 +45731,224 @@ var init_DetailPanel = __esm({
|
|
|
45226
45731
|
DetailPanel.displayName = "DetailPanel";
|
|
45227
45732
|
}
|
|
45228
45733
|
});
|
|
45734
|
+
var SplitPane;
|
|
45735
|
+
var init_SplitPane = __esm({
|
|
45736
|
+
"components/core/organisms/layout/SplitPane.tsx"() {
|
|
45737
|
+
"use client";
|
|
45738
|
+
init_cn();
|
|
45739
|
+
SplitPane = ({
|
|
45740
|
+
direction = "horizontal",
|
|
45741
|
+
ratio: ratioProp = 50,
|
|
45742
|
+
minSize = 100,
|
|
45743
|
+
resizable = true,
|
|
45744
|
+
left,
|
|
45745
|
+
right,
|
|
45746
|
+
className,
|
|
45747
|
+
leftClassName,
|
|
45748
|
+
rightClassName,
|
|
45749
|
+
onRatioChange
|
|
45750
|
+
}) => {
|
|
45751
|
+
const [uncontrolledRatio, setUncontrolledRatio] = useState(ratioProp);
|
|
45752
|
+
const ratio = onRatioChange ? ratioProp : uncontrolledRatio;
|
|
45753
|
+
const containerRef = useRef(null);
|
|
45754
|
+
const isDragging = useRef(false);
|
|
45755
|
+
const handlePointerDown = useCallback(
|
|
45756
|
+
(e) => {
|
|
45757
|
+
if (!resizable) return;
|
|
45758
|
+
e.preventDefault();
|
|
45759
|
+
isDragging.current = true;
|
|
45760
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
45761
|
+
const handlePointerMove = (ev) => {
|
|
45762
|
+
if (!isDragging.current || !containerRef.current) return;
|
|
45763
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
45764
|
+
let newRatio;
|
|
45765
|
+
if (direction === "horizontal") {
|
|
45766
|
+
const x = ev.clientX - rect.left;
|
|
45767
|
+
newRatio = x / rect.width * 100;
|
|
45768
|
+
} else {
|
|
45769
|
+
const y = ev.clientY - rect.top;
|
|
45770
|
+
newRatio = y / rect.height * 100;
|
|
45771
|
+
}
|
|
45772
|
+
const minRatio = minSize / (direction === "horizontal" ? rect.width : rect.height) * 100;
|
|
45773
|
+
const maxRatio = 100 - minRatio;
|
|
45774
|
+
newRatio = Math.max(minRatio, Math.min(maxRatio, newRatio));
|
|
45775
|
+
if (onRatioChange) {
|
|
45776
|
+
onRatioChange(newRatio);
|
|
45777
|
+
} else {
|
|
45778
|
+
setUncontrolledRatio(newRatio);
|
|
45779
|
+
}
|
|
45780
|
+
};
|
|
45781
|
+
const handlePointerUp = () => {
|
|
45782
|
+
isDragging.current = false;
|
|
45783
|
+
document.removeEventListener("pointermove", handlePointerMove);
|
|
45784
|
+
document.removeEventListener("pointerup", handlePointerUp);
|
|
45785
|
+
document.removeEventListener("pointercancel", handlePointerUp);
|
|
45786
|
+
};
|
|
45787
|
+
document.addEventListener("pointermove", handlePointerMove);
|
|
45788
|
+
document.addEventListener("pointerup", handlePointerUp);
|
|
45789
|
+
document.addEventListener("pointercancel", handlePointerUp);
|
|
45790
|
+
},
|
|
45791
|
+
[direction, minSize, resizable, onRatioChange]
|
|
45792
|
+
);
|
|
45793
|
+
const isHorizontal = direction === "horizontal";
|
|
45794
|
+
return /* @__PURE__ */ jsxs(
|
|
45795
|
+
"div",
|
|
45796
|
+
{
|
|
45797
|
+
ref: containerRef,
|
|
45798
|
+
className: cn(
|
|
45799
|
+
"flex w-full h-full",
|
|
45800
|
+
isHorizontal ? "flex-row" : "flex-col",
|
|
45801
|
+
className
|
|
45802
|
+
),
|
|
45803
|
+
children: [
|
|
45804
|
+
/* @__PURE__ */ jsx(
|
|
45805
|
+
"div",
|
|
45806
|
+
{
|
|
45807
|
+
className: cn("flex flex-col overflow-auto", leftClassName),
|
|
45808
|
+
style: {
|
|
45809
|
+
[isHorizontal ? "width" : "height"]: `${ratio}%`,
|
|
45810
|
+
flexShrink: 0
|
|
45811
|
+
},
|
|
45812
|
+
children: left
|
|
45813
|
+
}
|
|
45814
|
+
),
|
|
45815
|
+
resizable && /* @__PURE__ */ jsx(
|
|
45816
|
+
"div",
|
|
45817
|
+
{
|
|
45818
|
+
onPointerDown: handlePointerDown,
|
|
45819
|
+
className: cn(
|
|
45820
|
+
"flex-shrink-0 bg-border transition-colors touch-none",
|
|
45821
|
+
isHorizontal ? "w-1 cursor-col-resize hover:w-1.5 hover:bg-muted-foreground" : "h-1 cursor-row-resize hover:h-1.5 hover:bg-muted-foreground"
|
|
45822
|
+
)
|
|
45823
|
+
}
|
|
45824
|
+
),
|
|
45825
|
+
/* @__PURE__ */ jsx("div", { className: cn("flex flex-col flex-1 min-h-0 min-w-0 overflow-auto", rightClassName), children: right })
|
|
45826
|
+
]
|
|
45827
|
+
}
|
|
45828
|
+
);
|
|
45829
|
+
};
|
|
45830
|
+
SplitPane.displayName = "SplitPane";
|
|
45831
|
+
}
|
|
45832
|
+
});
|
|
45833
|
+
var DockLayout;
|
|
45834
|
+
var init_DockLayout = __esm({
|
|
45835
|
+
"components/core/organisms/layout/DockLayout.tsx"() {
|
|
45836
|
+
"use client";
|
|
45837
|
+
init_Box();
|
|
45838
|
+
init_Stack();
|
|
45839
|
+
init_cn();
|
|
45840
|
+
init_SplitPane();
|
|
45841
|
+
DockLayout = ({
|
|
45842
|
+
rail,
|
|
45843
|
+
sidebar,
|
|
45844
|
+
main,
|
|
45845
|
+
bottomPanel,
|
|
45846
|
+
statusBar,
|
|
45847
|
+
secondarySidebar,
|
|
45848
|
+
railWidth = 56,
|
|
45849
|
+
secondarySidebarWidth = 280,
|
|
45850
|
+
sidebarCollapsed = false,
|
|
45851
|
+
sidebarWidth = 20,
|
|
45852
|
+
onSidebarWidthChange,
|
|
45853
|
+
sidebarMinSize = 160,
|
|
45854
|
+
bottomPanelCollapsed = false,
|
|
45855
|
+
bottomPanelHeight = 30,
|
|
45856
|
+
onBottomPanelHeightChange,
|
|
45857
|
+
bottomPanelMinSize = 120,
|
|
45858
|
+
secondarySidebarCollapsed = false,
|
|
45859
|
+
className,
|
|
45860
|
+
railClassName,
|
|
45861
|
+
sidebarClassName,
|
|
45862
|
+
mainClassName,
|
|
45863
|
+
bottomPanelClassName,
|
|
45864
|
+
statusBarClassName,
|
|
45865
|
+
secondarySidebarClassName
|
|
45866
|
+
}) => {
|
|
45867
|
+
const showSidebar = Boolean(sidebar) && !sidebarCollapsed;
|
|
45868
|
+
const showBottomPanel = Boolean(bottomPanel) && !bottomPanelCollapsed;
|
|
45869
|
+
const showSecondarySidebar = Boolean(secondarySidebar) && !secondarySidebarCollapsed;
|
|
45870
|
+
const centerRow = /* @__PURE__ */ jsxs(HStack, { gap: "none", className: "flex-1 min-h-0 min-w-0", children: [
|
|
45871
|
+
/* @__PURE__ */ jsx(Box, { className: cn("flex-1 min-w-0 min-h-0 overflow-auto", mainClassName), children: main }),
|
|
45872
|
+
showSecondarySidebar && /* @__PURE__ */ jsx(
|
|
45873
|
+
Box,
|
|
45874
|
+
{
|
|
45875
|
+
className: cn(
|
|
45876
|
+
"flex-shrink-0 h-full overflow-auto border-l border-border",
|
|
45877
|
+
secondarySidebarClassName
|
|
45878
|
+
),
|
|
45879
|
+
style: { width: secondarySidebarWidth },
|
|
45880
|
+
children: secondarySidebar
|
|
45881
|
+
}
|
|
45882
|
+
)
|
|
45883
|
+
] });
|
|
45884
|
+
const sidebarAndCenter = showSidebar ? /* @__PURE__ */ jsx(
|
|
45885
|
+
SplitPane,
|
|
45886
|
+
{
|
|
45887
|
+
direction: "horizontal",
|
|
45888
|
+
ratio: sidebarWidth,
|
|
45889
|
+
onRatioChange: onSidebarWidthChange,
|
|
45890
|
+
minSize: sidebarMinSize,
|
|
45891
|
+
resizable: true,
|
|
45892
|
+
left: /* @__PURE__ */ jsx(Box, { className: cn("h-full overflow-auto", sidebarClassName), children: sidebar }),
|
|
45893
|
+
right: centerRow,
|
|
45894
|
+
className: "flex-1 min-h-0 min-w-0"
|
|
45895
|
+
}
|
|
45896
|
+
) : centerRow;
|
|
45897
|
+
const body = /* @__PURE__ */ jsxs(HStack, { gap: "none", className: "flex-1 min-h-0 min-w-0", children: [
|
|
45898
|
+
rail && /* @__PURE__ */ jsx(
|
|
45899
|
+
Box,
|
|
45900
|
+
{
|
|
45901
|
+
className: cn(
|
|
45902
|
+
"flex-shrink-0 min-h-0 overflow-auto border-r border-border",
|
|
45903
|
+
railClassName
|
|
45904
|
+
),
|
|
45905
|
+
style: { width: railWidth },
|
|
45906
|
+
children: rail
|
|
45907
|
+
}
|
|
45908
|
+
),
|
|
45909
|
+
sidebarAndCenter
|
|
45910
|
+
] });
|
|
45911
|
+
const bodyPlusBottom = showBottomPanel ? /* @__PURE__ */ jsx(
|
|
45912
|
+
SplitPane,
|
|
45913
|
+
{
|
|
45914
|
+
direction: "vertical",
|
|
45915
|
+
ratio: 100 - bottomPanelHeight,
|
|
45916
|
+
onRatioChange: (topRatio) => onBottomPanelHeightChange?.(100 - topRatio),
|
|
45917
|
+
minSize: bottomPanelMinSize,
|
|
45918
|
+
resizable: true,
|
|
45919
|
+
left: body,
|
|
45920
|
+
right: /* @__PURE__ */ jsx(
|
|
45921
|
+
Box,
|
|
45922
|
+
{
|
|
45923
|
+
className: cn(
|
|
45924
|
+
"h-full overflow-auto border-t border-border",
|
|
45925
|
+
bottomPanelClassName
|
|
45926
|
+
),
|
|
45927
|
+
children: bottomPanel
|
|
45928
|
+
}
|
|
45929
|
+
),
|
|
45930
|
+
className: "flex-1 min-h-0"
|
|
45931
|
+
}
|
|
45932
|
+
) : body;
|
|
45933
|
+
return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: cn("w-full h-full overflow-hidden", className), children: [
|
|
45934
|
+
bodyPlusBottom,
|
|
45935
|
+
statusBar && /* @__PURE__ */ jsx(
|
|
45936
|
+
Box,
|
|
45937
|
+
{
|
|
45938
|
+
className: cn(
|
|
45939
|
+
"flex-shrink-0 border-t border-border bg-background",
|
|
45940
|
+
statusBarClassName
|
|
45941
|
+
),
|
|
45942
|
+
children: statusBar
|
|
45943
|
+
}
|
|
45944
|
+
)
|
|
45945
|
+
] });
|
|
45946
|
+
};
|
|
45947
|
+
DockLayout.displayName = "DockLayout";
|
|
45948
|
+
}
|
|
45949
|
+
});
|
|
45229
45950
|
function extractTitle(children) {
|
|
45230
|
-
if (!
|
|
45951
|
+
if (!React96__default.isValidElement(children)) return void 0;
|
|
45231
45952
|
const props = children.props;
|
|
45232
45953
|
if (typeof props.title === "string") {
|
|
45233
45954
|
return props.title;
|
|
@@ -45589,7 +46310,7 @@ var init_Form = __esm({
|
|
|
45589
46310
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
45590
46311
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
45591
46312
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
45592
|
-
const normalizedInitialData =
|
|
46313
|
+
const normalizedInitialData = React96__default.useMemo(() => {
|
|
45593
46314
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
45594
46315
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
45595
46316
|
const merged = entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
@@ -45608,7 +46329,7 @@ var init_Form = __esm({
|
|
|
45608
46329
|
}
|
|
45609
46330
|
return normalized;
|
|
45610
46331
|
}, [entity, initialData]);
|
|
45611
|
-
const entityDerivedFields =
|
|
46332
|
+
const entityDerivedFields = React96__default.useMemo(() => {
|
|
45612
46333
|
if (fields && fields.length > 0) return void 0;
|
|
45613
46334
|
if (!resolvedEntity) return void 0;
|
|
45614
46335
|
return resolvedEntity.fields.map(
|
|
@@ -45629,16 +46350,16 @@ var init_Form = __esm({
|
|
|
45629
46350
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
45630
46351
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
45631
46352
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
45632
|
-
const [formData, setFormData] =
|
|
46353
|
+
const [formData, setFormData] = React96__default.useState(
|
|
45633
46354
|
normalizedInitialData
|
|
45634
46355
|
);
|
|
45635
|
-
const [collapsedSections, setCollapsedSections] =
|
|
46356
|
+
const [collapsedSections, setCollapsedSections] = React96__default.useState(
|
|
45636
46357
|
/* @__PURE__ */ new Set()
|
|
45637
46358
|
);
|
|
45638
|
-
const [submitError, setSubmitError] =
|
|
45639
|
-
const formRef =
|
|
46359
|
+
const [submitError, setSubmitError] = React96__default.useState(null);
|
|
46360
|
+
const formRef = React96__default.useRef(null);
|
|
45640
46361
|
const formMode = props.mode;
|
|
45641
|
-
const mountedRef =
|
|
46362
|
+
const mountedRef = React96__default.useRef(false);
|
|
45642
46363
|
if (!mountedRef.current) {
|
|
45643
46364
|
mountedRef.current = true;
|
|
45644
46365
|
debug("forms", "mount", {
|
|
@@ -45651,7 +46372,7 @@ var init_Form = __esm({
|
|
|
45651
46372
|
});
|
|
45652
46373
|
}
|
|
45653
46374
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
45654
|
-
const evalContext =
|
|
46375
|
+
const evalContext = React96__default.useMemo(
|
|
45655
46376
|
() => ({
|
|
45656
46377
|
formValues: formData,
|
|
45657
46378
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -45660,7 +46381,7 @@ var init_Form = __esm({
|
|
|
45660
46381
|
}),
|
|
45661
46382
|
[formData, externalContext]
|
|
45662
46383
|
);
|
|
45663
|
-
|
|
46384
|
+
React96__default.useEffect(() => {
|
|
45664
46385
|
debug("forms", "initialData-sync", {
|
|
45665
46386
|
mode: formMode,
|
|
45666
46387
|
normalizedInitialData,
|
|
@@ -45671,7 +46392,7 @@ var init_Form = __esm({
|
|
|
45671
46392
|
setFormData(normalizedInitialData);
|
|
45672
46393
|
}
|
|
45673
46394
|
}, [normalizedInitialData]);
|
|
45674
|
-
const processCalculations =
|
|
46395
|
+
const processCalculations = React96__default.useCallback(
|
|
45675
46396
|
(changedFieldId, newFormData) => {
|
|
45676
46397
|
if (!hiddenCalculations.length) return;
|
|
45677
46398
|
const context = {
|
|
@@ -45696,7 +46417,7 @@ var init_Form = __esm({
|
|
|
45696
46417
|
},
|
|
45697
46418
|
[hiddenCalculations, externalContext, eventBus]
|
|
45698
46419
|
);
|
|
45699
|
-
const checkViolations =
|
|
46420
|
+
const checkViolations = React96__default.useCallback(
|
|
45700
46421
|
(changedFieldId, newFormData) => {
|
|
45701
46422
|
if (!violationTriggers.length) return;
|
|
45702
46423
|
const context = {
|
|
@@ -45734,7 +46455,7 @@ var init_Form = __esm({
|
|
|
45734
46455
|
processCalculations(name, newFormData);
|
|
45735
46456
|
checkViolations(name, newFormData);
|
|
45736
46457
|
};
|
|
45737
|
-
const isFieldVisible =
|
|
46458
|
+
const isFieldVisible = React96__default.useCallback(
|
|
45738
46459
|
(fieldName2) => {
|
|
45739
46460
|
const condition = conditionalFields[fieldName2];
|
|
45740
46461
|
if (!condition) return true;
|
|
@@ -45742,7 +46463,7 @@ var init_Form = __esm({
|
|
|
45742
46463
|
},
|
|
45743
46464
|
[conditionalFields, evalContext]
|
|
45744
46465
|
);
|
|
45745
|
-
const isSectionVisible =
|
|
46466
|
+
const isSectionVisible = React96__default.useCallback(
|
|
45746
46467
|
(section) => {
|
|
45747
46468
|
if (!section.condition) return true;
|
|
45748
46469
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -45818,7 +46539,7 @@ var init_Form = __esm({
|
|
|
45818
46539
|
eventBus.emit(`UI:${onCancel}`);
|
|
45819
46540
|
}
|
|
45820
46541
|
};
|
|
45821
|
-
const renderField =
|
|
46542
|
+
const renderField = React96__default.useCallback(
|
|
45822
46543
|
(field) => {
|
|
45823
46544
|
const fieldName2 = field.name || field.field;
|
|
45824
46545
|
if (!fieldName2) return null;
|
|
@@ -45840,7 +46561,7 @@ var init_Form = __esm({
|
|
|
45840
46561
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
45841
46562
|
);
|
|
45842
46563
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
45843
|
-
const normalizedFields =
|
|
46564
|
+
const normalizedFields = React96__default.useMemo(() => {
|
|
45844
46565
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
45845
46566
|
return effectiveFields.map((field) => {
|
|
45846
46567
|
if (typeof field === "string") {
|
|
@@ -45875,7 +46596,7 @@ var init_Form = __esm({
|
|
|
45875
46596
|
};
|
|
45876
46597
|
});
|
|
45877
46598
|
}, [effectiveFields, resolvedEntity, fieldOverrides]);
|
|
45878
|
-
const schemaFields =
|
|
46599
|
+
const schemaFields = React96__default.useMemo(() => {
|
|
45879
46600
|
if (normalizedFields.length === 0) return null;
|
|
45880
46601
|
if (isDebugEnabled()) {
|
|
45881
46602
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -45885,7 +46606,7 @@ var init_Form = __esm({
|
|
|
45885
46606
|
}
|
|
45886
46607
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
45887
46608
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
45888
|
-
const sectionElements =
|
|
46609
|
+
const sectionElements = React96__default.useMemo(() => {
|
|
45889
46610
|
if (!sections || sections.length === 0) return null;
|
|
45890
46611
|
return sections.map((section) => {
|
|
45891
46612
|
if (!isSectionVisible(section)) {
|
|
@@ -46721,7 +47442,7 @@ var init_List = __esm({
|
|
|
46721
47442
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
46722
47443
|
return [];
|
|
46723
47444
|
}, [entity]);
|
|
46724
|
-
const getItemActions =
|
|
47445
|
+
const getItemActions = React96__default.useCallback(
|
|
46725
47446
|
(item) => {
|
|
46726
47447
|
if (!itemActions) return [];
|
|
46727
47448
|
if (typeof itemActions === "function") {
|
|
@@ -47203,7 +47924,7 @@ var init_MediaGallery = __esm({
|
|
|
47203
47924
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
47204
47925
|
);
|
|
47205
47926
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
47206
|
-
const items =
|
|
47927
|
+
const items = React96__default.useMemo(() => {
|
|
47207
47928
|
if (propItems && propItems.length > 0) return propItems;
|
|
47208
47929
|
if (entityData.length === 0) return [];
|
|
47209
47930
|
return entityData.map((record, idx) => {
|
|
@@ -47368,7 +48089,7 @@ var init_MediaGallery = __esm({
|
|
|
47368
48089
|
}
|
|
47369
48090
|
});
|
|
47370
48091
|
function extractTitle2(children) {
|
|
47371
|
-
if (!
|
|
48092
|
+
if (!React96__default.isValidElement(children)) return void 0;
|
|
47372
48093
|
const props = children.props;
|
|
47373
48094
|
if (typeof props.title === "string") {
|
|
47374
48095
|
return props.title;
|
|
@@ -47642,7 +48363,7 @@ var init_debugRegistry = __esm({
|
|
|
47642
48363
|
}
|
|
47643
48364
|
});
|
|
47644
48365
|
function useDebugData() {
|
|
47645
|
-
const [data, setData] =
|
|
48366
|
+
const [data, setData] = React96.useState(() => ({
|
|
47646
48367
|
traits: [],
|
|
47647
48368
|
ticks: [],
|
|
47648
48369
|
guards: [],
|
|
@@ -47656,7 +48377,7 @@ function useDebugData() {
|
|
|
47656
48377
|
},
|
|
47657
48378
|
lastUpdate: Date.now()
|
|
47658
48379
|
}));
|
|
47659
|
-
|
|
48380
|
+
React96.useEffect(() => {
|
|
47660
48381
|
const updateData = () => {
|
|
47661
48382
|
setData({
|
|
47662
48383
|
traits: getAllTraits(),
|
|
@@ -47765,12 +48486,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
47765
48486
|
return positions;
|
|
47766
48487
|
}
|
|
47767
48488
|
function WalkMinimap() {
|
|
47768
|
-
const [walkStep, setWalkStep] =
|
|
47769
|
-
const [traits2, setTraits] =
|
|
47770
|
-
const [coveredEdges, setCoveredEdges] =
|
|
47771
|
-
const [completedTraits, setCompletedTraits] =
|
|
47772
|
-
const prevTraitRef =
|
|
47773
|
-
|
|
48489
|
+
const [walkStep, setWalkStep] = React96.useState(null);
|
|
48490
|
+
const [traits2, setTraits] = React96.useState([]);
|
|
48491
|
+
const [coveredEdges, setCoveredEdges] = React96.useState([]);
|
|
48492
|
+
const [completedTraits, setCompletedTraits] = React96.useState(/* @__PURE__ */ new Set());
|
|
48493
|
+
const prevTraitRef = React96.useRef(null);
|
|
48494
|
+
React96.useEffect(() => {
|
|
47774
48495
|
const interval = setInterval(() => {
|
|
47775
48496
|
const w = window;
|
|
47776
48497
|
const step = w.__orbitalWalkStep;
|
|
@@ -48206,15 +48927,15 @@ var init_EntitiesTab = __esm({
|
|
|
48206
48927
|
});
|
|
48207
48928
|
function EventFlowTab({ events: events2 }) {
|
|
48208
48929
|
const { t } = useTranslate();
|
|
48209
|
-
const [filter, setFilter] =
|
|
48210
|
-
const containerRef =
|
|
48211
|
-
const [autoScroll, setAutoScroll] =
|
|
48212
|
-
|
|
48930
|
+
const [filter, setFilter] = React96.useState("all");
|
|
48931
|
+
const containerRef = React96.useRef(null);
|
|
48932
|
+
const [autoScroll, setAutoScroll] = React96.useState(true);
|
|
48933
|
+
React96.useEffect(() => {
|
|
48213
48934
|
if (autoScroll && containerRef.current) {
|
|
48214
48935
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
48215
48936
|
}
|
|
48216
48937
|
}, [events2.length, autoScroll]);
|
|
48217
|
-
const filteredEvents =
|
|
48938
|
+
const filteredEvents = React96.useMemo(() => {
|
|
48218
48939
|
if (filter === "all") return events2;
|
|
48219
48940
|
return events2.filter((e) => e.type === filter);
|
|
48220
48941
|
}, [events2, filter]);
|
|
@@ -48330,7 +49051,7 @@ var init_EventFlowTab = __esm({
|
|
|
48330
49051
|
});
|
|
48331
49052
|
function GuardsPanel({ guards }) {
|
|
48332
49053
|
const { t } = useTranslate();
|
|
48333
|
-
const [filter, setFilter] =
|
|
49054
|
+
const [filter, setFilter] = React96.useState("all");
|
|
48334
49055
|
if (guards.length === 0) {
|
|
48335
49056
|
return /* @__PURE__ */ jsx(
|
|
48336
49057
|
EmptyState,
|
|
@@ -48343,7 +49064,7 @@ function GuardsPanel({ guards }) {
|
|
|
48343
49064
|
}
|
|
48344
49065
|
const passedCount = guards.filter((g) => g.result).length;
|
|
48345
49066
|
const failedCount = guards.length - passedCount;
|
|
48346
|
-
const filteredGuards =
|
|
49067
|
+
const filteredGuards = React96.useMemo(() => {
|
|
48347
49068
|
if (filter === "all") return guards;
|
|
48348
49069
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
48349
49070
|
return guards.filter((g) => !g.result);
|
|
@@ -48506,10 +49227,10 @@ function EffectBadge({ effect }) {
|
|
|
48506
49227
|
}
|
|
48507
49228
|
function TransitionTimeline({ transitions }) {
|
|
48508
49229
|
const { t } = useTranslate();
|
|
48509
|
-
const containerRef =
|
|
48510
|
-
const [autoScroll, setAutoScroll] =
|
|
48511
|
-
const [expandedId, setExpandedId] =
|
|
48512
|
-
|
|
49230
|
+
const containerRef = React96.useRef(null);
|
|
49231
|
+
const [autoScroll, setAutoScroll] = React96.useState(true);
|
|
49232
|
+
const [expandedId, setExpandedId] = React96.useState(null);
|
|
49233
|
+
React96.useEffect(() => {
|
|
48513
49234
|
if (autoScroll && containerRef.current) {
|
|
48514
49235
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
48515
49236
|
}
|
|
@@ -48789,9 +49510,9 @@ function getAllEvents(traits2) {
|
|
|
48789
49510
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
48790
49511
|
const eventBus = useEventBus();
|
|
48791
49512
|
const { t } = useTranslate();
|
|
48792
|
-
const [log11, setLog] =
|
|
48793
|
-
const prevStatesRef =
|
|
48794
|
-
|
|
49513
|
+
const [log11, setLog] = React96.useState([]);
|
|
49514
|
+
const prevStatesRef = React96.useRef(/* @__PURE__ */ new Map());
|
|
49515
|
+
React96.useEffect(() => {
|
|
48795
49516
|
for (const trait of traits2) {
|
|
48796
49517
|
const prev = prevStatesRef.current.get(trait.id);
|
|
48797
49518
|
if (prev && prev !== trait.currentState) {
|
|
@@ -48960,10 +49681,10 @@ function VerifyModePanel({
|
|
|
48960
49681
|
localCount
|
|
48961
49682
|
}) {
|
|
48962
49683
|
const { t } = useTranslate();
|
|
48963
|
-
const [expanded, setExpanded] =
|
|
48964
|
-
const scrollRef =
|
|
48965
|
-
const prevCountRef =
|
|
48966
|
-
|
|
49684
|
+
const [expanded, setExpanded] = React96.useState(true);
|
|
49685
|
+
const scrollRef = React96.useRef(null);
|
|
49686
|
+
const prevCountRef = React96.useRef(0);
|
|
49687
|
+
React96.useEffect(() => {
|
|
48967
49688
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
48968
49689
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
48969
49690
|
}
|
|
@@ -49020,10 +49741,10 @@ function RuntimeDebugger({
|
|
|
49020
49741
|
schema
|
|
49021
49742
|
}) {
|
|
49022
49743
|
const { t } = useTranslate();
|
|
49023
|
-
const [isCollapsed, setIsCollapsed] =
|
|
49024
|
-
const [isVisible, setIsVisible] =
|
|
49744
|
+
const [isCollapsed, setIsCollapsed] = React96.useState(mode === "verify" ? true : defaultCollapsed);
|
|
49745
|
+
const [isVisible, setIsVisible] = React96.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
49025
49746
|
const debugData = useDebugData();
|
|
49026
|
-
|
|
49747
|
+
React96.useEffect(() => {
|
|
49027
49748
|
if (mode === "inline") return;
|
|
49028
49749
|
return onDebugToggle((enabled) => {
|
|
49029
49750
|
setIsVisible(enabled);
|
|
@@ -49032,7 +49753,7 @@ function RuntimeDebugger({
|
|
|
49032
49753
|
}
|
|
49033
49754
|
});
|
|
49034
49755
|
}, [mode]);
|
|
49035
|
-
|
|
49756
|
+
React96.useEffect(() => {
|
|
49036
49757
|
if (mode === "inline") return;
|
|
49037
49758
|
const handleKeyDown = (e) => {
|
|
49038
49759
|
if (e.key === "`" && isVisible) {
|
|
@@ -49047,7 +49768,7 @@ function RuntimeDebugger({
|
|
|
49047
49768
|
if (!isVisible) {
|
|
49048
49769
|
return null;
|
|
49049
49770
|
}
|
|
49050
|
-
const
|
|
49771
|
+
const positionClasses2 = {
|
|
49051
49772
|
"bottom-right": "bottom-4 right-4",
|
|
49052
49773
|
"bottom-left": "bottom-4 left-4",
|
|
49053
49774
|
"top-right": "top-4 right-4",
|
|
@@ -49176,7 +49897,7 @@ function RuntimeDebugger({
|
|
|
49176
49897
|
className: cn(
|
|
49177
49898
|
"runtime-debugger",
|
|
49178
49899
|
"fixed",
|
|
49179
|
-
|
|
49900
|
+
positionClasses2[position],
|
|
49180
49901
|
isCollapsed ? "runtime-debugger--collapsed" : "runtime-debugger--expanded",
|
|
49181
49902
|
className
|
|
49182
49903
|
),
|
|
@@ -49258,6 +49979,7 @@ var init_SegmentRenderer = __esm({
|
|
|
49258
49979
|
"use client";
|
|
49259
49980
|
init_MarkdownContent();
|
|
49260
49981
|
init_CodeBlock();
|
|
49982
|
+
init_MermaidDiagram();
|
|
49261
49983
|
init_QuizBlock();
|
|
49262
49984
|
init_ActivationBlock();
|
|
49263
49985
|
init_ConnectionBlock();
|
|
@@ -49289,6 +50011,9 @@ var init_SegmentRenderer = __esm({
|
|
|
49289
50011
|
return /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `md-${index}`);
|
|
49290
50012
|
}
|
|
49291
50013
|
if (segment.type === "code") {
|
|
50014
|
+
if (segment.language === "mermaid") {
|
|
50015
|
+
return /* @__PURE__ */ jsx(MermaidDiagram, { code: segment.content }, `code-${index}`);
|
|
50016
|
+
}
|
|
49292
50017
|
if (segment.runnable && onRunCodeSimulation) {
|
|
49293
50018
|
return /* @__PURE__ */ jsx(
|
|
49294
50019
|
CodeRunnerPanel,
|
|
@@ -49421,99 +50146,6 @@ var init_ShowcaseOrganism = __esm({
|
|
|
49421
50146
|
ShowcaseOrganism.displayName = "ShowcaseOrganism";
|
|
49422
50147
|
}
|
|
49423
50148
|
});
|
|
49424
|
-
var SplitPane;
|
|
49425
|
-
var init_SplitPane = __esm({
|
|
49426
|
-
"components/core/organisms/layout/SplitPane.tsx"() {
|
|
49427
|
-
"use client";
|
|
49428
|
-
init_cn();
|
|
49429
|
-
SplitPane = ({
|
|
49430
|
-
direction = "horizontal",
|
|
49431
|
-
ratio: initialRatio = 50,
|
|
49432
|
-
minSize = 100,
|
|
49433
|
-
resizable = true,
|
|
49434
|
-
left,
|
|
49435
|
-
right,
|
|
49436
|
-
className,
|
|
49437
|
-
leftClassName,
|
|
49438
|
-
rightClassName
|
|
49439
|
-
}) => {
|
|
49440
|
-
const [ratio, setRatio] = useState(initialRatio);
|
|
49441
|
-
const containerRef = useRef(null);
|
|
49442
|
-
const isDragging = useRef(false);
|
|
49443
|
-
const handlePointerDown = useCallback(
|
|
49444
|
-
(e) => {
|
|
49445
|
-
if (!resizable) return;
|
|
49446
|
-
e.preventDefault();
|
|
49447
|
-
isDragging.current = true;
|
|
49448
|
-
e.currentTarget.setPointerCapture(e.pointerId);
|
|
49449
|
-
const handlePointerMove = (ev) => {
|
|
49450
|
-
if (!isDragging.current || !containerRef.current) return;
|
|
49451
|
-
const rect = containerRef.current.getBoundingClientRect();
|
|
49452
|
-
let newRatio;
|
|
49453
|
-
if (direction === "horizontal") {
|
|
49454
|
-
const x = ev.clientX - rect.left;
|
|
49455
|
-
newRatio = x / rect.width * 100;
|
|
49456
|
-
} else {
|
|
49457
|
-
const y = ev.clientY - rect.top;
|
|
49458
|
-
newRatio = y / rect.height * 100;
|
|
49459
|
-
}
|
|
49460
|
-
const minRatio = minSize / (direction === "horizontal" ? rect.width : rect.height) * 100;
|
|
49461
|
-
const maxRatio = 100 - minRatio;
|
|
49462
|
-
newRatio = Math.max(minRatio, Math.min(maxRatio, newRatio));
|
|
49463
|
-
setRatio(newRatio);
|
|
49464
|
-
};
|
|
49465
|
-
const handlePointerUp = () => {
|
|
49466
|
-
isDragging.current = false;
|
|
49467
|
-
document.removeEventListener("pointermove", handlePointerMove);
|
|
49468
|
-
document.removeEventListener("pointerup", handlePointerUp);
|
|
49469
|
-
document.removeEventListener("pointercancel", handlePointerUp);
|
|
49470
|
-
};
|
|
49471
|
-
document.addEventListener("pointermove", handlePointerMove);
|
|
49472
|
-
document.addEventListener("pointerup", handlePointerUp);
|
|
49473
|
-
document.addEventListener("pointercancel", handlePointerUp);
|
|
49474
|
-
},
|
|
49475
|
-
[direction, minSize, resizable]
|
|
49476
|
-
);
|
|
49477
|
-
const isHorizontal = direction === "horizontal";
|
|
49478
|
-
return /* @__PURE__ */ jsxs(
|
|
49479
|
-
"div",
|
|
49480
|
-
{
|
|
49481
|
-
ref: containerRef,
|
|
49482
|
-
className: cn(
|
|
49483
|
-
"flex w-full h-full",
|
|
49484
|
-
isHorizontal ? "flex-row" : "flex-col",
|
|
49485
|
-
className
|
|
49486
|
-
),
|
|
49487
|
-
children: [
|
|
49488
|
-
/* @__PURE__ */ jsx(
|
|
49489
|
-
"div",
|
|
49490
|
-
{
|
|
49491
|
-
className: cn("overflow-auto", leftClassName),
|
|
49492
|
-
style: {
|
|
49493
|
-
[isHorizontal ? "width" : "height"]: `${ratio}%`,
|
|
49494
|
-
flexShrink: 0
|
|
49495
|
-
},
|
|
49496
|
-
children: left
|
|
49497
|
-
}
|
|
49498
|
-
),
|
|
49499
|
-
resizable && /* @__PURE__ */ jsx(
|
|
49500
|
-
"div",
|
|
49501
|
-
{
|
|
49502
|
-
onPointerDown: handlePointerDown,
|
|
49503
|
-
className: cn(
|
|
49504
|
-
"flex-shrink-0 bg-border transition-colors touch-none",
|
|
49505
|
-
isHorizontal ? "w-1 cursor-col-resize hover:w-1.5 hover:bg-muted-foreground" : "h-1 cursor-row-resize hover:h-1.5 hover:bg-muted-foreground"
|
|
49506
|
-
)
|
|
49507
|
-
}
|
|
49508
|
-
),
|
|
49509
|
-
/* @__PURE__ */ jsx("div", { className: cn("flex-1 overflow-auto", rightClassName), children: right })
|
|
49510
|
-
]
|
|
49511
|
-
}
|
|
49512
|
-
);
|
|
49513
|
-
};
|
|
49514
|
-
SplitPane.displayName = "SplitPane";
|
|
49515
|
-
}
|
|
49516
|
-
});
|
|
49517
50149
|
var StatCard;
|
|
49518
50150
|
var init_StatCard = __esm({
|
|
49519
50151
|
"components/core/organisms/StatCard.tsx"() {
|
|
@@ -49552,7 +50184,7 @@ var init_StatCard = __esm({
|
|
|
49552
50184
|
const labelToUse = propLabel ?? propTitle;
|
|
49553
50185
|
const eventBus = useEventBus();
|
|
49554
50186
|
const { t } = useTranslate();
|
|
49555
|
-
const handleActionClick =
|
|
50187
|
+
const handleActionClick = React96__default.useCallback(() => {
|
|
49556
50188
|
if (action?.event) {
|
|
49557
50189
|
eventBus.emit(`UI:${action.event}`, {});
|
|
49558
50190
|
}
|
|
@@ -49563,7 +50195,7 @@ var init_StatCard = __esm({
|
|
|
49563
50195
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
49564
50196
|
const isLoading = externalLoading ?? false;
|
|
49565
50197
|
const error = externalError;
|
|
49566
|
-
const computeMetricValue =
|
|
50198
|
+
const computeMetricValue = React96__default.useCallback(
|
|
49567
50199
|
(metric, items) => {
|
|
49568
50200
|
if (metric.value !== void 0) {
|
|
49569
50201
|
return metric.value;
|
|
@@ -49602,7 +50234,7 @@ var init_StatCard = __esm({
|
|
|
49602
50234
|
},
|
|
49603
50235
|
[]
|
|
49604
50236
|
);
|
|
49605
|
-
const schemaStats =
|
|
50237
|
+
const schemaStats = React96__default.useMemo(() => {
|
|
49606
50238
|
if (!metrics || metrics.length === 0) return null;
|
|
49607
50239
|
return metrics.map((metric) => ({
|
|
49608
50240
|
label: metric.label,
|
|
@@ -49610,7 +50242,7 @@ var init_StatCard = __esm({
|
|
|
49610
50242
|
format: metric.format
|
|
49611
50243
|
}));
|
|
49612
50244
|
}, [metrics, data, computeMetricValue]);
|
|
49613
|
-
const calculatedTrend =
|
|
50245
|
+
const calculatedTrend = React96__default.useMemo(() => {
|
|
49614
50246
|
if (manualTrend !== void 0) return manualTrend;
|
|
49615
50247
|
if (previousValue === void 0 || currentValue === void 0)
|
|
49616
50248
|
return void 0;
|
|
@@ -50250,8 +50882,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
50250
50882
|
] });
|
|
50251
50883
|
};
|
|
50252
50884
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
50253
|
-
const endRef =
|
|
50254
|
-
|
|
50885
|
+
const endRef = React96__default.useRef(null);
|
|
50886
|
+
React96__default.useEffect(() => {
|
|
50255
50887
|
if (!autoScroll) return;
|
|
50256
50888
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
50257
50889
|
}, [activities.length, autoScroll]);
|
|
@@ -50345,7 +50977,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
50345
50977
|
};
|
|
50346
50978
|
SubagentRichCard = ({ subagent }) => {
|
|
50347
50979
|
const { t } = useTranslate();
|
|
50348
|
-
const activities =
|
|
50980
|
+
const activities = React96__default.useMemo(
|
|
50349
50981
|
() => subagentMessagesToActivities(subagent.messages),
|
|
50350
50982
|
[subagent.messages]
|
|
50351
50983
|
);
|
|
@@ -50422,8 +51054,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
50422
51054
|
] });
|
|
50423
51055
|
};
|
|
50424
51056
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
50425
|
-
const endRef =
|
|
50426
|
-
|
|
51057
|
+
const endRef = React96__default.useRef(null);
|
|
51058
|
+
React96__default.useEffect(() => {
|
|
50427
51059
|
if (!autoScroll) return;
|
|
50428
51060
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
50429
51061
|
}, [messages.length, autoScroll]);
|
|
@@ -50858,7 +51490,7 @@ var init_Timeline = __esm({
|
|
|
50858
51490
|
}) => {
|
|
50859
51491
|
const { t } = useTranslate();
|
|
50860
51492
|
const entityData = entity ?? [];
|
|
50861
|
-
const items =
|
|
51493
|
+
const items = React96__default.useMemo(() => {
|
|
50862
51494
|
if (propItems) return propItems;
|
|
50863
51495
|
if (entityData.length === 0) return [];
|
|
50864
51496
|
return entityData.map((record, idx) => {
|
|
@@ -50960,7 +51592,7 @@ var init_Timeline = __esm({
|
|
|
50960
51592
|
}
|
|
50961
51593
|
});
|
|
50962
51594
|
function extractToastProps(children) {
|
|
50963
|
-
if (!
|
|
51595
|
+
if (!React96__default.isValidElement(children)) {
|
|
50964
51596
|
if (typeof children === "string") {
|
|
50965
51597
|
return { message: children };
|
|
50966
51598
|
}
|
|
@@ -51002,7 +51634,7 @@ var init_ToastSlot = __esm({
|
|
|
51002
51634
|
eventBus.emit(`${prefix}CLOSE`);
|
|
51003
51635
|
};
|
|
51004
51636
|
if (!isVisible) return null;
|
|
51005
|
-
const isCustomContent =
|
|
51637
|
+
const isCustomContent = React96__default.isValidElement(children) && !message;
|
|
51006
51638
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
51007
51639
|
Toast,
|
|
51008
51640
|
{
|
|
@@ -51070,6 +51702,7 @@ var init_component_registry_generated = __esm({
|
|
|
51070
51702
|
init_ChoiceButton();
|
|
51071
51703
|
init_CodeBlock();
|
|
51072
51704
|
init_CodeRunnerPanel();
|
|
51705
|
+
init_CommandPalette();
|
|
51073
51706
|
init_CommunityLinks();
|
|
51074
51707
|
init_ConditionalWrapper();
|
|
51075
51708
|
init_ConfettiEffect();
|
|
@@ -51097,6 +51730,7 @@ var init_component_registry_generated = __esm({
|
|
|
51097
51730
|
init_DocSearch();
|
|
51098
51731
|
init_DocSidebar();
|
|
51099
51732
|
init_DocTOC();
|
|
51733
|
+
init_DockLayout();
|
|
51100
51734
|
init_DocumentDetails();
|
|
51101
51735
|
init_DocumentPanel();
|
|
51102
51736
|
init_DocumentViewer();
|
|
@@ -51127,6 +51761,7 @@ var init_component_registry_generated = __esm({
|
|
|
51127
51761
|
init_FlipCard();
|
|
51128
51762
|
init_FlipContainer();
|
|
51129
51763
|
init_FloatingActionButton();
|
|
51764
|
+
init_FloatingToolbar();
|
|
51130
51765
|
init_Form();
|
|
51131
51766
|
init_FormField();
|
|
51132
51767
|
init_FormSection();
|
|
@@ -51342,6 +51977,7 @@ var init_component_registry_generated = __esm({
|
|
|
51342
51977
|
"ChoiceButton": ChoiceButton,
|
|
51343
51978
|
"CodeBlock": CodeBlock,
|
|
51344
51979
|
"CodeRunnerPanel": CodeRunnerPanel,
|
|
51980
|
+
"CommandPalette": CommandPalette,
|
|
51345
51981
|
"CommunityLinks": CommunityLinks,
|
|
51346
51982
|
"ConditionalWrapper": ConditionalWrapper,
|
|
51347
51983
|
"ConfettiEffect": ConfettiEffect,
|
|
@@ -51371,6 +52007,7 @@ var init_component_registry_generated = __esm({
|
|
|
51371
52007
|
"DocSearch": DocSearch,
|
|
51372
52008
|
"DocSidebar": DocSidebar,
|
|
51373
52009
|
"DocTOC": DocTOC,
|
|
52010
|
+
"DockLayout": DockLayout,
|
|
51374
52011
|
"DocumentDetails": DocumentDetails,
|
|
51375
52012
|
"DocumentPanel": DocumentPanel,
|
|
51376
52013
|
"DocumentViewer": DocumentViewer,
|
|
@@ -51401,6 +52038,7 @@ var init_component_registry_generated = __esm({
|
|
|
51401
52038
|
"FlipCard": FlipCard,
|
|
51402
52039
|
"FlipContainer": FlipContainer,
|
|
51403
52040
|
"FloatingActionButton": FloatingActionButton,
|
|
52041
|
+
"FloatingToolbar": FloatingToolbar,
|
|
51404
52042
|
"Form": Form,
|
|
51405
52043
|
"FormField": FormField,
|
|
51406
52044
|
"FormLayout": FormLayout,
|
|
@@ -51588,7 +52226,7 @@ function SuspenseConfigProvider({
|
|
|
51588
52226
|
config,
|
|
51589
52227
|
children
|
|
51590
52228
|
}) {
|
|
51591
|
-
return
|
|
52229
|
+
return React96__default.createElement(
|
|
51592
52230
|
SuspenseConfigContext.Provider,
|
|
51593
52231
|
{ value: config },
|
|
51594
52232
|
children
|
|
@@ -51636,7 +52274,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
51636
52274
|
}
|
|
51637
52275
|
return { name: field, label: humanizeFieldName(field) };
|
|
51638
52276
|
}
|
|
51639
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
52277
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React96__default.isValidElement(field) && !(field instanceof Date)) {
|
|
51640
52278
|
const obj = field;
|
|
51641
52279
|
const fieldName2 = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
51642
52280
|
if (!fieldName2) return field;
|
|
@@ -51689,7 +52327,7 @@ function enrichDetailFields(fields, entityDef) {
|
|
|
51689
52327
|
const meta = metaFor(field);
|
|
51690
52328
|
return meta ? { key: field, ...meta } : field;
|
|
51691
52329
|
}
|
|
51692
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
52330
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React96__default.isValidElement(field) && !(field instanceof Date)) {
|
|
51693
52331
|
const obj = field;
|
|
51694
52332
|
const fieldName2 = typeof obj.key === "string" ? obj.key : typeof obj.name === "string" ? obj.name : void 0;
|
|
51695
52333
|
if (!fieldName2 || obj.type) return field;
|
|
@@ -52148,7 +52786,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
52148
52786
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
52149
52787
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
52150
52788
|
}
|
|
52151
|
-
return /* @__PURE__ */ jsx(
|
|
52789
|
+
return /* @__PURE__ */ jsx(React96__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
52152
52790
|
}
|
|
52153
52791
|
if (!child || typeof child !== "object") return null;
|
|
52154
52792
|
const childId = `${parentId}-${index}`;
|
|
@@ -52205,7 +52843,7 @@ function isPatternConfig(value) {
|
|
|
52205
52843
|
if (value === null || value === void 0) return false;
|
|
52206
52844
|
if (typeof value !== "object") return false;
|
|
52207
52845
|
if (Array.isArray(value)) return false;
|
|
52208
|
-
if (
|
|
52846
|
+
if (React96__default.isValidElement(value)) return false;
|
|
52209
52847
|
if (value instanceof Date) return false;
|
|
52210
52848
|
if (typeof value === "function") return false;
|
|
52211
52849
|
const record = value;
|
|
@@ -52218,9 +52856,9 @@ function renderPatternValue(value) {
|
|
|
52218
52856
|
if (typeof value === "string") return renderPatternChildren(value, () => {
|
|
52219
52857
|
});
|
|
52220
52858
|
if (value instanceof Date) return value.toLocaleString();
|
|
52221
|
-
if (
|
|
52859
|
+
if (React96__default.isValidElement(value)) return value;
|
|
52222
52860
|
if (Array.isArray(value)) {
|
|
52223
|
-
return value.map((item, index) => /* @__PURE__ */ jsx(
|
|
52861
|
+
return value.map((item, index) => /* @__PURE__ */ jsx(React96__default.Fragment, { children: renderPatternValue(item) }, index));
|
|
52224
52862
|
}
|
|
52225
52863
|
if (isPatternConfig(value)) {
|
|
52226
52864
|
const { type, ...props } = value;
|
|
@@ -52230,7 +52868,7 @@ function renderPatternValue(value) {
|
|
|
52230
52868
|
return null;
|
|
52231
52869
|
}
|
|
52232
52870
|
function isPlainConfigObject(value) {
|
|
52233
|
-
if (
|
|
52871
|
+
if (React96__default.isValidElement(value)) return false;
|
|
52234
52872
|
if (value instanceof Date) return false;
|
|
52235
52873
|
const proto = Object.getPrototypeOf(value);
|
|
52236
52874
|
return proto === Object.prototype || proto === null;
|
|
@@ -52404,7 +53042,7 @@ function SlotContentRenderer({
|
|
|
52404
53042
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
52405
53043
|
const slotVal = restProps[slotKey];
|
|
52406
53044
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
52407
|
-
if (
|
|
53045
|
+
if (React96__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
52408
53046
|
const typelessChildren = !Array.isArray(slotVal) && typeof slotVal === "object" && !("type" in slotVal) && Array.isArray(slotVal.children) ? slotVal.children : void 0;
|
|
52409
53047
|
if (typelessChildren !== void 0 || Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
52410
53048
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
@@ -52458,7 +53096,7 @@ function SlotContentRenderer({
|
|
|
52458
53096
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
52459
53097
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
52460
53098
|
const sample = resolvedItems[0];
|
|
52461
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
53099
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React96__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
52462
53100
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
52463
53101
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
52464
53102
|
}
|
|
@@ -52822,7 +53460,7 @@ var AvlTransition = ({
|
|
|
52822
53460
|
opacity = 1,
|
|
52823
53461
|
className
|
|
52824
53462
|
}) => {
|
|
52825
|
-
const ids =
|
|
53463
|
+
const ids = React96__default.useMemo(() => {
|
|
52826
53464
|
avlTransitionId += 1;
|
|
52827
53465
|
return { arrow: `avl-tr-${avlTransitionId}-arrow` };
|
|
52828
53466
|
}, []);
|
|
@@ -53383,7 +54021,7 @@ var AvlStateMachine = ({
|
|
|
53383
54021
|
color = "var(--color-primary)",
|
|
53384
54022
|
animated = false
|
|
53385
54023
|
}) => {
|
|
53386
|
-
const ids =
|
|
54024
|
+
const ids = React96__default.useMemo(() => {
|
|
53387
54025
|
avlSmId += 1;
|
|
53388
54026
|
const base = `avl-sm-${avlSmId}`;
|
|
53389
54027
|
return { glow: `${base}-glow`, grad: `${base}-grad` };
|
|
@@ -53582,7 +54220,7 @@ var AvlOrbitalUnit = ({
|
|
|
53582
54220
|
color = "var(--color-primary)",
|
|
53583
54221
|
animated = false
|
|
53584
54222
|
}) => {
|
|
53585
|
-
const ids =
|
|
54223
|
+
const ids = React96__default.useMemo(() => {
|
|
53586
54224
|
avlOuId += 1;
|
|
53587
54225
|
const base = `avl-ou-${avlOuId}`;
|
|
53588
54226
|
return { glow: `${base}-glow`, grad: `${base}-grad` };
|
|
@@ -53678,7 +54316,7 @@ var AvlClosedCircuit = ({
|
|
|
53678
54316
|
color = "var(--color-primary)",
|
|
53679
54317
|
animated = false
|
|
53680
54318
|
}) => {
|
|
53681
|
-
const ids =
|
|
54319
|
+
const ids = React96__default.useMemo(() => {
|
|
53682
54320
|
avlCcId += 1;
|
|
53683
54321
|
const base = `avl-cc-${avlCcId}`;
|
|
53684
54322
|
return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
|
|
@@ -53833,7 +54471,7 @@ var AvlEmitListen = ({
|
|
|
53833
54471
|
color = "var(--color-primary)",
|
|
53834
54472
|
animated = false
|
|
53835
54473
|
}) => {
|
|
53836
|
-
const ids =
|
|
54474
|
+
const ids = React96__default.useMemo(() => {
|
|
53837
54475
|
avlElId += 1;
|
|
53838
54476
|
const base = `avl-el-${avlElId}`;
|
|
53839
54477
|
return { arrow: `${base}-arrow`, grad: `${base}-grad` };
|
|
@@ -54107,7 +54745,7 @@ function renderNode(node, color, glowId) {
|
|
|
54107
54745
|
const baseR = node.type === "operator" ? 20 : 16;
|
|
54108
54746
|
const r2 = Math.max(baseR, labelLen * 3.5 + 6);
|
|
54109
54747
|
const nc = nodeColor(node.type, color);
|
|
54110
|
-
return /* @__PURE__ */ jsxs(
|
|
54748
|
+
return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
54111
54749
|
node.children.map((child, i) => {
|
|
54112
54750
|
const childR = Math.max(
|
|
54113
54751
|
child.type === "operator" ? 20 : 16,
|
|
@@ -54164,7 +54802,7 @@ var AvlExprTree = ({
|
|
|
54164
54802
|
className,
|
|
54165
54803
|
color = "var(--color-primary)"
|
|
54166
54804
|
}) => {
|
|
54167
|
-
const ids =
|
|
54805
|
+
const ids = React96__default.useMemo(() => {
|
|
54168
54806
|
avlEtId += 1;
|
|
54169
54807
|
return { glow: `avl-et-${avlEtId}-glow` };
|
|
54170
54808
|
}, []);
|
|
@@ -54999,7 +55637,7 @@ var SystemNode = ({ data }) => {
|
|
|
54999
55637
|
stateChain.length > 0 && /* @__PURE__ */ jsx("svg", { width: stateChain.length * 14 + 2, height: 10, viewBox: `0 0 ${stateChain.length * 14 + 2} 10`, children: stateChain.map((s, i) => {
|
|
55000
55638
|
const tc = transitionCounts[s.name] ?? 0;
|
|
55001
55639
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
55002
|
-
return /* @__PURE__ */ jsxs(
|
|
55640
|
+
return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
55003
55641
|
/* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial ?? void 0, isTerminal: s.isTerminal ?? void 0 }),
|
|
55004
55642
|
i < stateChain.length - 1 && /* @__PURE__ */ jsx("line", { x1: i * 14 + 12, y1: 5, x2: i * 14 + 15, y2: 5, stroke: "var(--color-border)", strokeWidth: 0.5 })
|
|
55005
55643
|
] }, s.name);
|
|
@@ -56086,7 +56724,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
56086
56724
|
}
|
|
56087
56725
|
return substituted;
|
|
56088
56726
|
}
|
|
56089
|
-
if (body !== null && typeof body === "object" && !
|
|
56727
|
+
if (body !== null && typeof body === "object" && !React96__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
56090
56728
|
const out = {};
|
|
56091
56729
|
for (const [k, v] of Object.entries(body)) {
|
|
56092
56730
|
out[k] = recur(v);
|
|
@@ -56119,7 +56757,7 @@ function deferLambdaEntityExprs(value) {
|
|
|
56119
56757
|
}
|
|
56120
56758
|
return arr.map((v) => deferLambdaEntityExprs(v));
|
|
56121
56759
|
}
|
|
56122
|
-
if (value !== null && typeof value === "object" && !
|
|
56760
|
+
if (value !== null && typeof value === "object" && !React96__default.isValidElement(value) && !(value instanceof Date) && typeof value !== "function" && !isRenderBindingMarker(value)) {
|
|
56123
56761
|
const out = {};
|
|
56124
56762
|
for (const [k, v] of Object.entries(value)) {
|
|
56125
56763
|
out[k] = deferLambdaEntityExprs(v);
|
|
@@ -56133,7 +56771,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
56133
56771
|
const resolvedBody = deferLambdaEntityExprs(
|
|
56134
56772
|
resolveLambdaBindings(lambdaBody, params, item, index)
|
|
56135
56773
|
);
|
|
56136
|
-
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" ||
|
|
56774
|
+
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React96__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
|
|
56137
56775
|
return null;
|
|
56138
56776
|
}
|
|
56139
56777
|
const record = resolvedBody;
|
|
@@ -56152,7 +56790,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
56152
56790
|
props: childProps,
|
|
56153
56791
|
priority: 0
|
|
56154
56792
|
};
|
|
56155
|
-
return
|
|
56793
|
+
return React96__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
56156
56794
|
};
|
|
56157
56795
|
}
|
|
56158
56796
|
function convertNode(node, callerKey) {
|
|
@@ -56172,7 +56810,7 @@ function convertNode(node, callerKey) {
|
|
|
56172
56810
|
});
|
|
56173
56811
|
return anyChanged ? mapped : node;
|
|
56174
56812
|
}
|
|
56175
|
-
if (typeof node === "object" && !
|
|
56813
|
+
if (typeof node === "object" && !React96__default.isValidElement(node) && !(node instanceof Date)) {
|
|
56176
56814
|
return convertObjectProps(node);
|
|
56177
56815
|
}
|
|
56178
56816
|
return node;
|
|
@@ -58129,13 +58767,12 @@ function useCanvasDraggable({
|
|
|
58129
58767
|
payload,
|
|
58130
58768
|
disabled
|
|
58131
58769
|
}) {
|
|
58132
|
-
const { setNodeRef, attributes, listeners: listeners7, isDragging, transform } = useDraggable({
|
|
58770
|
+
const { setNodeRef, attributes, listeners: listeners7, isDragging, transform } = useDraggable$1({
|
|
58133
58771
|
id,
|
|
58134
58772
|
data: { payload },
|
|
58135
58773
|
disabled
|
|
58136
58774
|
});
|
|
58137
58775
|
const style = {
|
|
58138
|
-
transform: CSS.Translate.toString(transform),
|
|
58139
58776
|
cursor: disabled ? "not-allowed" : isDragging ? "grabbing" : "grab",
|
|
58140
58777
|
opacity: isDragging ? 0.5 : 1,
|
|
58141
58778
|
touchAction: "none"
|
|
@@ -58187,6 +58824,21 @@ function defaultEmit(eventBus, drop) {
|
|
|
58187
58824
|
log9.info("default-emit:behavior", { behaviorName, level: target.level });
|
|
58188
58825
|
return;
|
|
58189
58826
|
}
|
|
58827
|
+
if (payload.kind === "pattern-instance") {
|
|
58828
|
+
const fromPath = payload.data["fromPath"];
|
|
58829
|
+
if (typeof fromPath !== "string") {
|
|
58830
|
+
log9.warn("default-emit:pattern-instance:missing-fromPath");
|
|
58831
|
+
return;
|
|
58832
|
+
}
|
|
58833
|
+
const out = { fromPath, loc: payload.data["loc"] };
|
|
58834
|
+
if (resolved) {
|
|
58835
|
+
out.toParentPath = resolved.parentPath;
|
|
58836
|
+
out.toIndex = resolved.index;
|
|
58837
|
+
}
|
|
58838
|
+
eventBus.emit("UI:PATTERN_MOVE", out);
|
|
58839
|
+
log9.info("default-emit:pattern-instance", { fromPath, level: target.level });
|
|
58840
|
+
return;
|
|
58841
|
+
}
|
|
58190
58842
|
log9.debug("default-emit:unhandled-kind", { kind: payload.kind });
|
|
58191
58843
|
}
|
|
58192
58844
|
function CanvasDndProvider({
|
|
@@ -58196,10 +58848,17 @@ function CanvasDndProvider({
|
|
|
58196
58848
|
}) {
|
|
58197
58849
|
const eventBus = useEventBus();
|
|
58198
58850
|
const sensors = useAlmadarDndSensors(false);
|
|
58199
|
-
const [activePayload, setActivePayload] =
|
|
58200
|
-
const
|
|
58851
|
+
const [activePayload, setActivePayload] = React96__default.useState(null);
|
|
58852
|
+
const lastPointerRef = React96__default.useRef(null);
|
|
58853
|
+
const trackPointer = React96__default.useCallback((ev) => {
|
|
58854
|
+
lastPointerRef.current = { x: ev.clientX, y: ev.clientY };
|
|
58855
|
+
}, []);
|
|
58856
|
+
const handleDragStart = React96__default.useCallback((e) => {
|
|
58201
58857
|
const data = e.active.data.current;
|
|
58202
58858
|
const payload = data?.payload;
|
|
58859
|
+
const activator = e.activatorEvent;
|
|
58860
|
+
lastPointerRef.current = activator instanceof MouseEvent ? { x: activator.clientX, y: activator.clientY } : null;
|
|
58861
|
+
document.addEventListener("pointermove", trackPointer);
|
|
58203
58862
|
if (payload) {
|
|
58204
58863
|
setActivePayload(payload);
|
|
58205
58864
|
eventBus.emit("UI:DRAG_START", { kind: payload.kind, data: payload.data });
|
|
@@ -58207,9 +58866,10 @@ function CanvasDndProvider({
|
|
|
58207
58866
|
} else {
|
|
58208
58867
|
log9.warn("dragStart:missing-payload", { id: e.active.id });
|
|
58209
58868
|
}
|
|
58210
|
-
}, [eventBus]);
|
|
58211
|
-
const handleDragEnd =
|
|
58869
|
+
}, [eventBus, trackPointer]);
|
|
58870
|
+
const handleDragEnd = React96__default.useCallback((e) => {
|
|
58212
58871
|
setActivePayload(null);
|
|
58872
|
+
document.removeEventListener("pointermove", trackPointer);
|
|
58213
58873
|
const activeData = e.active.data.current;
|
|
58214
58874
|
const payload = activeData?.payload;
|
|
58215
58875
|
const overData = e.over?.data.current;
|
|
@@ -58230,17 +58890,24 @@ function CanvasDndProvider({
|
|
|
58230
58890
|
log9.debug("dragEnd:rejected:kind", { kind: payload.kind, accepts: [...accepts] });
|
|
58231
58891
|
return;
|
|
58232
58892
|
}
|
|
58233
|
-
const
|
|
58234
|
-
const cursor = activator && typeof activator.clientX === "number" && typeof activator.clientY === "number" ? { x: activator.clientX + e.delta.x, y: activator.clientY + e.delta.y } : null;
|
|
58893
|
+
const cursor = lastPointerRef.current;
|
|
58235
58894
|
const resolved = target.resolvePath && cursor ? target.resolvePath(cursor) : null;
|
|
58895
|
+
log9.debug("dragEnd:resolve", {
|
|
58896
|
+
hasResolver: !!target.resolvePath,
|
|
58897
|
+
cursorX: cursor?.x,
|
|
58898
|
+
cursorY: cursor?.y,
|
|
58899
|
+
resolvedParent: resolved?.parentPath ?? null,
|
|
58900
|
+
resolvedIndex: resolved?.index ?? null
|
|
58901
|
+
});
|
|
58236
58902
|
const drop = { payload, target, cursor, resolved };
|
|
58237
58903
|
const suppressed = onDrop ? onDrop(drop) === true : false;
|
|
58238
58904
|
if (!suppressed) defaultEmit(eventBus, drop);
|
|
58239
|
-
}, [eventBus, onDrop]);
|
|
58240
|
-
const handleDragCancel =
|
|
58905
|
+
}, [eventBus, onDrop, trackPointer]);
|
|
58906
|
+
const handleDragCancel = React96__default.useCallback(() => {
|
|
58241
58907
|
setActivePayload(null);
|
|
58908
|
+
document.removeEventListener("pointermove", trackPointer);
|
|
58242
58909
|
log9.info("dragCancel");
|
|
58243
|
-
}, []);
|
|
58910
|
+
}, [trackPointer]);
|
|
58244
58911
|
return /* @__PURE__ */ jsxs(
|
|
58245
58912
|
DndContext,
|
|
58246
58913
|
{
|
|
@@ -58251,7 +58918,14 @@ function CanvasDndProvider({
|
|
|
58251
58918
|
onDragCancel: handleDragCancel,
|
|
58252
58919
|
children: [
|
|
58253
58920
|
children,
|
|
58254
|
-
renderOverlay ?
|
|
58921
|
+
renderOverlay ? (
|
|
58922
|
+
/* pointer-events none on the WRAPPER, not just the rendered content:
|
|
58923
|
+
dnd-kit doesn't default it, and the overlay rides exactly under the
|
|
58924
|
+
cursor — with hit-testing on, `resolvePath`'s elementFromPoint sees
|
|
58925
|
+
the overlay instead of the drop target and every drop degrades to
|
|
58926
|
+
the caller's fallback position. */
|
|
58927
|
+
/* @__PURE__ */ jsx(DragOverlay, { dropAnimation: null, style: { pointerEvents: "none" }, children: activePayload ? renderOverlay(activePayload) : null })
|
|
58928
|
+
) : null
|
|
58255
58929
|
]
|
|
58256
58930
|
}
|
|
58257
58931
|
);
|
|
@@ -58320,6 +58994,34 @@ function deriveEditFocusFromElement(el) {
|
|
|
58320
58994
|
if (entity !== null) focus.entity = entity;
|
|
58321
58995
|
return focus;
|
|
58322
58996
|
}
|
|
58997
|
+
function withNodeTransition(focus, nodeTransitionEvent) {
|
|
58998
|
+
const transition = nodeTransitionEvent ?? focus.transition;
|
|
58999
|
+
return transition ? { ...focus, transition } : { ...focus };
|
|
59000
|
+
}
|
|
59001
|
+
|
|
59002
|
+
// components/avl/lib/compute-insertion-index.ts
|
|
59003
|
+
function computeInsertionIndex(childRects, pointer, axis) {
|
|
59004
|
+
for (let i = 0; i < childRects.length; i++) {
|
|
59005
|
+
const rect = childRects[i];
|
|
59006
|
+
const mid = axis === "vertical" ? rect.top + rect.height / 2 : rect.left + rect.width / 2;
|
|
59007
|
+
const pos = axis === "vertical" ? pointer.y : pointer.x;
|
|
59008
|
+
if (pos < mid) return i;
|
|
59009
|
+
}
|
|
59010
|
+
return childRects.length;
|
|
59011
|
+
}
|
|
59012
|
+
|
|
59013
|
+
// components/avl/lib/resolve-direct-children.ts
|
|
59014
|
+
function resolveDirectChildren(containerPath, candidates) {
|
|
59015
|
+
const prefix = `${containerPath}.children.`;
|
|
59016
|
+
return candidates.reduce((acc, { path, ref }) => {
|
|
59017
|
+
if (!path.startsWith(prefix)) return acc;
|
|
59018
|
+
const rest = path.slice(prefix.length);
|
|
59019
|
+
if (!rest || rest.includes(".")) return acc;
|
|
59020
|
+
const index = Number(rest);
|
|
59021
|
+
if (Number.isFinite(index)) acc.push({ index, ref });
|
|
59022
|
+
return acc;
|
|
59023
|
+
}, []).sort((a, b) => a.index - b.index).map(({ ref }) => ref);
|
|
59024
|
+
}
|
|
58323
59025
|
function entityNameOf(ref) {
|
|
58324
59026
|
if (!ref) return void 0;
|
|
58325
59027
|
if (typeof ref === "string") return ref;
|
|
@@ -58605,6 +59307,13 @@ function rectRelativeTo(el, container, zoom) {
|
|
|
58605
59307
|
height: (u.bottom - u.top) / z
|
|
58606
59308
|
};
|
|
58607
59309
|
}
|
|
59310
|
+
function resolveLayoutAxis(el) {
|
|
59311
|
+
let cur = el;
|
|
59312
|
+
while (getComputedStyle(cur).display === "contents" && cur.firstElementChild) {
|
|
59313
|
+
cur = cur.firstElementChild;
|
|
59314
|
+
}
|
|
59315
|
+
return getComputedStyle(cur).flexDirection === "row" ? "horizontal" : "vertical";
|
|
59316
|
+
}
|
|
58608
59317
|
var OrbPreviewNodeInner = (props) => {
|
|
58609
59318
|
const data = props.data;
|
|
58610
59319
|
const screenSize = useContext(ScreenSizeContext);
|
|
@@ -58674,7 +59383,11 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
58674
59383
|
rect: rect ?? void 0
|
|
58675
59384
|
});
|
|
58676
59385
|
const focus = deriveEditFocusFromElement(patternEl);
|
|
58677
|
-
if (focus)
|
|
59386
|
+
if (focus) {
|
|
59387
|
+
eventBus.emit("UI:ELEMENT_SELECTED", {
|
|
59388
|
+
focus: { ...withNodeTransition(focus, data.transitionEvent) }
|
|
59389
|
+
});
|
|
59390
|
+
}
|
|
58678
59391
|
} else {
|
|
58679
59392
|
setSelectedRect(null);
|
|
58680
59393
|
select(null);
|
|
@@ -58710,6 +59423,17 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
58710
59423
|
unsub2();
|
|
58711
59424
|
};
|
|
58712
59425
|
}, [eventBus]);
|
|
59426
|
+
const [reorderDragActive, setReorderDragActive] = useState(false);
|
|
59427
|
+
useEffect(() => {
|
|
59428
|
+
const unsub1 = eventBus.on("UI:DRAG_START", (e) => {
|
|
59429
|
+
if (e.payload?.kind === "pattern-instance") setReorderDragActive(true);
|
|
59430
|
+
});
|
|
59431
|
+
const unsub2 = eventBus.on("UI:DRAG_END", () => setReorderDragActive(false));
|
|
59432
|
+
return () => {
|
|
59433
|
+
unsub1();
|
|
59434
|
+
unsub2();
|
|
59435
|
+
};
|
|
59436
|
+
}, [eventBus]);
|
|
58713
59437
|
const resolveL2Path = useCallback(
|
|
58714
59438
|
(cursor) => {
|
|
58715
59439
|
const hit = document.elementFromPoint(cursor.x, cursor.y);
|
|
@@ -58720,21 +59444,34 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
58720
59444
|
el = el.parentElement;
|
|
58721
59445
|
}
|
|
58722
59446
|
if (!el) return null;
|
|
58723
|
-
const containerPath = el.dataset?.patternPath;
|
|
58724
|
-
if (!
|
|
58725
|
-
|
|
58726
|
-
|
|
58727
|
-
|
|
58728
|
-
const
|
|
58729
|
-
|
|
58730
|
-
|
|
58731
|
-
|
|
58732
|
-
|
|
58733
|
-
|
|
58734
|
-
|
|
58735
|
-
|
|
58736
|
-
|
|
58737
|
-
|
|
59447
|
+
const containerPath = el.dataset?.patternPath ?? "root";
|
|
59448
|
+
if (!el.dataset?.patternPath) {
|
|
59449
|
+
const rootEl = el.querySelector('[data-pattern-path="root"]');
|
|
59450
|
+
if (rootEl instanceof HTMLElement) el = rootEl;
|
|
59451
|
+
}
|
|
59452
|
+
const directChildren = resolveDirectChildren(
|
|
59453
|
+
containerPath,
|
|
59454
|
+
Array.from(el.querySelectorAll("[data-pattern-path]")).map((child) => ({
|
|
59455
|
+
path: child.dataset.patternPath ?? "",
|
|
59456
|
+
ref: child
|
|
59457
|
+
}))
|
|
59458
|
+
);
|
|
59459
|
+
const childRects = directChildren.map((child) => {
|
|
59460
|
+
const u = absUnion(child);
|
|
59461
|
+
if (u) return { ...u, width: u.right - u.left, height: u.bottom - u.top };
|
|
59462
|
+
const raw = child.getBoundingClientRect();
|
|
59463
|
+
return { top: raw.top, left: raw.left, right: raw.right, bottom: raw.bottom, width: raw.width, height: raw.height };
|
|
59464
|
+
});
|
|
59465
|
+
const axis = resolveLayoutAxis(el);
|
|
59466
|
+
const insertIndex = computeInsertionIndex(childRects, cursor, axis);
|
|
59467
|
+
orbPreviewLog.debug("resolveL2Path", {
|
|
59468
|
+
containerPath,
|
|
59469
|
+
childCount: childRects.length,
|
|
59470
|
+
axis,
|
|
59471
|
+
cursorY: cursor.y,
|
|
59472
|
+
mids: childRects.map((r2) => axis === "vertical" ? r2.top + r2.height / 2 : r2.left + r2.width / 2),
|
|
59473
|
+
insertIndex
|
|
59474
|
+
});
|
|
58738
59475
|
return { parentPath: containerPath, index: insertIndex };
|
|
58739
59476
|
},
|
|
58740
59477
|
[]
|
|
@@ -58754,13 +59491,35 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
58754
59491
|
const { setNodeRef: l2SetNodeRef, isOver: l2IsOver } = useCanvasDroppable({
|
|
58755
59492
|
id: `orb-l2-${data.orbitalName}-${data.traitName ?? ""}-${data.transitionEvent ?? ""}`,
|
|
58756
59493
|
target: l2Target,
|
|
58757
|
-
accepts: ["pattern"],
|
|
59494
|
+
accepts: ["pattern", "pattern-instance"],
|
|
59495
|
+
disabled: !isExpanded
|
|
59496
|
+
});
|
|
59497
|
+
const reorderDataRef = useRef({ fromPath: "", loc: {} });
|
|
59498
|
+
const {
|
|
59499
|
+
setNodeRef: reorderSetNodeRef,
|
|
59500
|
+
listeners: reorderListeners
|
|
59501
|
+
} = useCanvasDraggable({
|
|
59502
|
+
id: `orb-l2-reorder-${data.orbitalName}-${data.traitName ?? ""}-${data.transitionEvent ?? ""}`,
|
|
59503
|
+
payload: { kind: "pattern-instance", data: reorderDataRef.current },
|
|
58758
59504
|
disabled: !isExpanded
|
|
58759
59505
|
});
|
|
59506
|
+
const handleContentPointerDown = useCallback((e) => {
|
|
59507
|
+
const patternEl = e.target.closest("[data-pattern]");
|
|
59508
|
+
const fromPath = patternEl?.getAttribute("data-pattern-path");
|
|
59509
|
+
if (!fromPath) return;
|
|
59510
|
+
reorderDataRef.current.fromPath = fromPath;
|
|
59511
|
+
reorderDataRef.current.loc = {
|
|
59512
|
+
orbitalName: data.orbitalName,
|
|
59513
|
+
traitName: data.traitName,
|
|
59514
|
+
transitionEvent: data.transitionEvent
|
|
59515
|
+
};
|
|
59516
|
+
reorderListeners?.onPointerDown?.(e);
|
|
59517
|
+
}, [reorderListeners, data.orbitalName, data.traitName, data.transitionEvent]);
|
|
58760
59518
|
const setContentRef = useCallback((el) => {
|
|
58761
59519
|
contentRef.current = el;
|
|
58762
59520
|
l2SetNodeRef(el);
|
|
58763
|
-
|
|
59521
|
+
reorderSetNodeRef(el);
|
|
59522
|
+
}, [l2SetNodeRef, reorderSetNodeRef]);
|
|
58764
59523
|
const statusBorder = isRunning ? "var(--color-primary)" : isError ? "var(--color-danger)" : isSuccess ? "var(--color-success)" : null;
|
|
58765
59524
|
const borderWidth = isRunning || isError || isSuccess ? "2px" : "1.5px";
|
|
58766
59525
|
const borderColor = statusBorder ?? (hovered ? "var(--color-primary)" : colors.border);
|
|
@@ -58920,10 +59679,11 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
58920
59679
|
Box,
|
|
58921
59680
|
{
|
|
58922
59681
|
ref: setContentRef,
|
|
58923
|
-
className: `orb-preview-live nodrag relative${dragActive || l2IsOver ? " drag-active" : ""}`,
|
|
59682
|
+
className: `orb-preview-live nodrag relative${dragActive || reorderDragActive || l2IsOver ? " drag-active" : ""}`,
|
|
58924
59683
|
onClick: handleContentClick,
|
|
58925
59684
|
onMouseMove: handleContentMouseMove,
|
|
58926
59685
|
onMouseLeave: handleContentMouseLeave,
|
|
59686
|
+
onPointerDown: handleContentPointerDown,
|
|
58927
59687
|
children: [
|
|
58928
59688
|
hoverRect && /* @__PURE__ */ jsx(
|
|
58929
59689
|
"div",
|
|
@@ -58995,7 +59755,7 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
58995
59755
|
}
|
|
58996
59756
|
);
|
|
58997
59757
|
};
|
|
58998
|
-
var OrbPreviewNode =
|
|
59758
|
+
var OrbPreviewNode = React96__default.memo(OrbPreviewNodeInner);
|
|
58999
59759
|
OrbPreviewNode.displayName = "OrbPreviewNode";
|
|
59000
59760
|
orbPreviewLog.debug("export-resolved", () => ({
|
|
59001
59761
|
type: typeof OrbPreviewNode,
|
|
@@ -59100,7 +59860,7 @@ var EventFlowEdgeInner = (props) => {
|
|
|
59100
59860
|
) })
|
|
59101
59861
|
] });
|
|
59102
59862
|
};
|
|
59103
|
-
var EventFlowEdge =
|
|
59863
|
+
var EventFlowEdge = React96__default.memo(EventFlowEdgeInner);
|
|
59104
59864
|
EventFlowEdge.displayName = "EventFlowEdge";
|
|
59105
59865
|
|
|
59106
59866
|
// components/avl/molecules/BehaviorComposeNode.tsx
|
|
@@ -59247,7 +60007,7 @@ var BehaviorComposeNodeInner = (props) => {
|
|
|
59247
60007
|
}
|
|
59248
60008
|
);
|
|
59249
60009
|
};
|
|
59250
|
-
var BehaviorComposeNode =
|
|
60010
|
+
var BehaviorComposeNode = React96__default.memo(BehaviorComposeNodeInner);
|
|
59251
60011
|
BehaviorComposeNode.displayName = "BehaviorComposeNode";
|
|
59252
60012
|
|
|
59253
60013
|
// components/avl/lib/avl-behavior-compose-converter.ts
|
|
@@ -59443,9 +60203,14 @@ function findPatternInTree(root, path) {
|
|
|
59443
60203
|
}
|
|
59444
60204
|
var FIELD_TYPE_OPTIONS = FieldTypeSchema.options.map((v) => ({ value: v, label: v }));
|
|
59445
60205
|
var EFFECT_TYPE_OPTIONS = Object.keys(EFFECT_TYPE_TO_CATEGORY).map((v) => ({ value: v, label: v }));
|
|
59446
|
-
function OrbInspector({ node, schema, editable = false, userType = "builder", themeManifest, onSchemaChange, onClose }) {
|
|
59447
|
-
const { selected:
|
|
59448
|
-
const
|
|
60206
|
+
function OrbInspector({ node, schema, editable = false, userType = "builder", themeManifest, defaultTab, onTabChange, onSchemaChange, onClose, selectedPattern: selectedPatternProp }) {
|
|
60207
|
+
const { selected: contextSelectedPattern } = useContext(PatternSelectionContext);
|
|
60208
|
+
const selectedPattern = selectedPatternProp !== void 0 ? selectedPatternProp : contextSelectedPattern;
|
|
60209
|
+
const [activeTab, setActiveTab] = useState(defaultTab ?? "inspector");
|
|
60210
|
+
const handleTabChange = useCallback((tab) => {
|
|
60211
|
+
setActiveTab(tab);
|
|
60212
|
+
onTabChange?.(tab);
|
|
60213
|
+
}, [onTabChange]);
|
|
59449
60214
|
const eventBus = useEventBus();
|
|
59450
60215
|
const { t } = useTranslate();
|
|
59451
60216
|
const orbitalName = node.orbitalName ?? "";
|
|
@@ -59600,10 +60365,10 @@ function OrbInspector({ node, schema, editable = false, userType = "builder", th
|
|
|
59600
60365
|
}
|
|
59601
60366
|
)
|
|
59602
60367
|
] }),
|
|
59603
|
-
/* @__PURE__ */ jsx(Box, { className: "flex px-4 gap-4", children: ["inspector", "
|
|
60368
|
+
/* @__PURE__ */ jsx(Box, { className: "flex px-4 gap-4", children: ["inspector", "design", "prototype", "code"].filter((tab) => tab !== "code" || userType === "architect").map((tab) => /* @__PURE__ */ jsx(
|
|
59604
60369
|
"button",
|
|
59605
60370
|
{
|
|
59606
|
-
onClick: () =>
|
|
60371
|
+
onClick: () => handleTabChange(tab),
|
|
59607
60372
|
className: `pb-2 text-xs font-medium border-b-2 cursor-pointer bg-transparent border-x-0 border-t-0 px-0 capitalize ${activeTab === tab ? "border-[var(--color-primary)] text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"}`,
|
|
59608
60373
|
children: t(`orbInspector.tab.${tab}`)
|
|
59609
60374
|
},
|
|
@@ -59629,26 +60394,8 @@ function OrbInspector({ node, schema, editable = false, userType = "builder", th
|
|
|
59629
60394
|
onChange: editable ? (code) => eventBus.emit("UI:CODE_CHANGE", { code }) : void 0
|
|
59630
60395
|
}
|
|
59631
60396
|
) })
|
|
59632
|
-
) : activeTab === "
|
|
59633
|
-
/* ──
|
|
59634
|
-
Variant + size pills are clickable when `editable` and emit
|
|
59635
|
-
`UI:PROP_CHANGE` with the selection context. The page-level
|
|
59636
|
-
dispatcher routes those events to the project schemaEditor or
|
|
59637
|
-
to the theme manifest based on `selection.sourceSchemaName`. */
|
|
59638
|
-
/* @__PURE__ */ jsx(
|
|
59639
|
-
StylesTab,
|
|
59640
|
-
{
|
|
59641
|
-
patternType,
|
|
59642
|
-
patternDef,
|
|
59643
|
-
patternConfig,
|
|
59644
|
-
editable,
|
|
59645
|
-
onPropChange: handlePropChange,
|
|
59646
|
-
themeManifest,
|
|
59647
|
-
isDesignSystem: selectedPattern?.nodeData.sourceSchemaName === "__design_system__"
|
|
59648
|
-
}
|
|
59649
|
-
)
|
|
59650
|
-
) : (
|
|
59651
|
-
/* ── Inspector Tab ── */
|
|
60397
|
+
) : activeTab === "design" ? (
|
|
60398
|
+
/* ── Design Tab ── Pattern Props + Styles + render-ui source. */
|
|
59652
60399
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
59653
60400
|
selectedPattern && patternDef?.propsSchema && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
59654
60401
|
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-xs uppercase tracking-wider mb-2", children: t("avl.props") }),
|
|
@@ -59684,6 +60431,97 @@ function OrbInspector({ node, schema, editable = false, userType = "builder", th
|
|
|
59684
60431
|
] }, propName);
|
|
59685
60432
|
}) })
|
|
59686
60433
|
] }),
|
|
60434
|
+
/* @__PURE__ */ jsx(
|
|
60435
|
+
StylesTab,
|
|
60436
|
+
{
|
|
60437
|
+
patternType,
|
|
60438
|
+
patternDef,
|
|
60439
|
+
patternConfig,
|
|
60440
|
+
editable,
|
|
60441
|
+
onPropChange: handlePropChange,
|
|
60442
|
+
themeManifest,
|
|
60443
|
+
isDesignSystem: selectedPattern?.nodeData.sourceSchemaName === "__design_system__"
|
|
60444
|
+
}
|
|
60445
|
+
),
|
|
60446
|
+
userType === "architect" && patterns.length > 0 && !selectedPattern && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3", children: [
|
|
60447
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-xs uppercase tracking-wider mb-2", children: "render-ui" }),
|
|
60448
|
+
/* @__PURE__ */ jsx(Box, { className: "bg-muted/20 rounded-md p-3 font-mono text-xs leading-relaxed overflow-x-auto", children: patterns.map((entry, i) => /* @__PURE__ */ jsxs(Box, { children: [
|
|
60449
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground text-xs", children: [
|
|
60450
|
+
"slot: ",
|
|
60451
|
+
entry.slot
|
|
60452
|
+
] }),
|
|
60453
|
+
/* @__PURE__ */ jsx(OrbPatternTree, { config: entry.pattern, depth: 0 })
|
|
60454
|
+
] }, i)) })
|
|
60455
|
+
] })
|
|
60456
|
+
] })
|
|
60457
|
+
) : activeTab === "prototype" ? (
|
|
60458
|
+
/* ── Prototype Tab ── State Transition + Trigger + Guard + Effects. */
|
|
60459
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
60460
|
+
isExpanded && fromState && toState && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
60461
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-xs uppercase tracking-wider mb-2", children: t("avl.transition") }),
|
|
60462
|
+
/* @__PURE__ */ jsxs("svg", { width: "100%", height: 44, viewBox: "0 0 280 44", children: [
|
|
60463
|
+
/* @__PURE__ */ jsx(AvlState, { x: 8, y: 8, name: fromState, role: getStateRole(fromState), width: 90, height: 26 }),
|
|
60464
|
+
/* @__PURE__ */ jsx("line", { x1: 104, y1: 21, x2: 158, y2: 21, stroke: "var(--color-foreground)", strokeWidth: 2, markerEnd: "url(#orb-arrow)" }),
|
|
60465
|
+
/* @__PURE__ */ jsx(AvlState, { x: 164, y: 8, name: toState, role: getStateRole(toState), width: 90, height: 26 }),
|
|
60466
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("marker", { id: "orb-arrow", markerWidth: 8, markerHeight: 6, refX: 8, refY: 3, orient: "auto", children: /* @__PURE__ */ jsx("path", { d: "M0,0 L8,3 L0,6 Z", fill: "var(--color-foreground)" }) }) })
|
|
60467
|
+
] }),
|
|
60468
|
+
traitName && /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground text-xs", children: [
|
|
60469
|
+
traitName,
|
|
60470
|
+
entityName ? t("orbInspector.onEntity", { entity: entityName }) : ""
|
|
60471
|
+
] })
|
|
60472
|
+
] }),
|
|
60473
|
+
isExpanded && transitionEvent && /* @__PURE__ */ jsx(Box, { className: "px-4 py-2 border-b border-border/40", children: /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
60474
|
+
/* @__PURE__ */ jsx("svg", { width: 16, height: 16, children: /* @__PURE__ */ jsx(AvlEvent, { x: 8, y: 8, size: 12 }) }),
|
|
60475
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "font-semibold text-xs", children: transitionEvent })
|
|
60476
|
+
] }) }),
|
|
60477
|
+
userType === "architect" && (transition?.guard ?? guard ?? editable) && isExpanded && /* @__PURE__ */ jsx(Box, { className: "px-4 py-2 border-b border-border/40", children: /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
60478
|
+
/* @__PURE__ */ jsx("svg", { width: 16, height: 16, children: /* @__PURE__ */ jsx(AvlGuard, { x: 8, y: 8, size: 12 }) }),
|
|
60479
|
+
editable ? /* @__PURE__ */ jsx(
|
|
60480
|
+
Input,
|
|
60481
|
+
{
|
|
60482
|
+
defaultValue: formatExpression(transition?.guard ?? guard),
|
|
60483
|
+
placeholder: t("orbInspector.guardExpression"),
|
|
60484
|
+
className: "flex-1 text-xs font-mono h-6",
|
|
60485
|
+
onBlur: (e) => handleGuardChange(e.target.value)
|
|
60486
|
+
}
|
|
60487
|
+
) : /* @__PURE__ */ jsx(Typography, { variant: "small", className: "font-mono text-xs text-muted-foreground", children: formatExpression(transition?.guard ?? guard) })
|
|
60488
|
+
] }) }),
|
|
60489
|
+
userType === "architect" && (effectTypes.length > 0 || editable) && isExpanded && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
60490
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground text-xs uppercase tracking-wider mb-2", children: [
|
|
60491
|
+
t("avl.effects"),
|
|
60492
|
+
" (",
|
|
60493
|
+
effectTypes.length,
|
|
60494
|
+
")"
|
|
60495
|
+
] }),
|
|
60496
|
+
/* @__PURE__ */ jsx(Box, { className: "flex flex-col gap-1.5", children: effectTypes.map((type, i) => {
|
|
60497
|
+
const isKnown = KNOWN_EFFECTS.has(type);
|
|
60498
|
+
const category = EFFECT_TYPE_TO_CATEGORY[type];
|
|
60499
|
+
const catColor = category ? EFFECT_CATEGORY_COLORS[category] : void 0;
|
|
60500
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
60501
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground text-xs w-4 text-right shrink-0", children: [
|
|
60502
|
+
i + 1,
|
|
60503
|
+
"."
|
|
60504
|
+
] }),
|
|
60505
|
+
isKnown && /* @__PURE__ */ jsx("svg", { width: 16, height: 16, children: /* @__PURE__ */ jsx(AvlEffect, { x: 8, y: 8, effectType: type, size: 6, showBackground: true }) }),
|
|
60506
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-xs flex-1", style: { color: catColor?.color }, children: effectSummary(type) }),
|
|
60507
|
+
editable && /* @__PURE__ */ jsx(
|
|
60508
|
+
Button,
|
|
60509
|
+
{
|
|
60510
|
+
variant: "ghost",
|
|
60511
|
+
size: "sm",
|
|
60512
|
+
onClick: () => handleRemoveEffect(i),
|
|
60513
|
+
className: "shrink-0 p-0.5 h-6 w-6",
|
|
60514
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" })
|
|
60515
|
+
}
|
|
60516
|
+
)
|
|
60517
|
+
] }, i);
|
|
60518
|
+
}) }),
|
|
60519
|
+
editable && /* @__PURE__ */ jsx(AddEffectButton, { onAdd: handleAddEffect })
|
|
60520
|
+
] })
|
|
60521
|
+
] })
|
|
60522
|
+
) : (
|
|
60523
|
+
/* ── Inspector Tab (overview) ── orbital-scoped sections only. */
|
|
60524
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
59687
60525
|
userType === "architect" && (selectedPattern && isEntityPattern || !selectedPattern && !isExpanded) && entity && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
59688
60526
|
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-xs uppercase tracking-wider mb-2", children: t("avl.entity") }),
|
|
59689
60527
|
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2 mb-2", children: [
|
|
@@ -59787,77 +60625,6 @@ function OrbInspector({ node, schema, editable = false, userType = "builder", th
|
|
|
59787
60625
|
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-xs font-semibold", children: tr.name }),
|
|
59788
60626
|
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-xs", children: t("orbInspector.statesCount", { count: tr.stateCount }) })
|
|
59789
60627
|
] }, tr.name)) })
|
|
59790
|
-
] }),
|
|
59791
|
-
isExpanded && fromState && toState && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
59792
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-xs uppercase tracking-wider mb-2", children: t("avl.transition") }),
|
|
59793
|
-
/* @__PURE__ */ jsxs("svg", { width: "100%", height: 44, viewBox: "0 0 280 44", children: [
|
|
59794
|
-
/* @__PURE__ */ jsx(AvlState, { x: 8, y: 8, name: fromState, role: getStateRole(fromState), width: 90, height: 26 }),
|
|
59795
|
-
/* @__PURE__ */ jsx("line", { x1: 104, y1: 21, x2: 158, y2: 21, stroke: "var(--color-foreground)", strokeWidth: 2, markerEnd: "url(#orb-arrow)" }),
|
|
59796
|
-
/* @__PURE__ */ jsx(AvlState, { x: 164, y: 8, name: toState, role: getStateRole(toState), width: 90, height: 26 }),
|
|
59797
|
-
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("marker", { id: "orb-arrow", markerWidth: 8, markerHeight: 6, refX: 8, refY: 3, orient: "auto", children: /* @__PURE__ */ jsx("path", { d: "M0,0 L8,3 L0,6 Z", fill: "var(--color-foreground)" }) }) })
|
|
59798
|
-
] }),
|
|
59799
|
-
traitName && /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground text-xs", children: [
|
|
59800
|
-
traitName,
|
|
59801
|
-
entityName ? t("orbInspector.onEntity", { entity: entityName }) : ""
|
|
59802
|
-
] })
|
|
59803
|
-
] }),
|
|
59804
|
-
isExpanded && transitionEvent && /* @__PURE__ */ jsx(Box, { className: "px-4 py-2 border-b border-border/40", children: /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
59805
|
-
/* @__PURE__ */ jsx("svg", { width: 16, height: 16, children: /* @__PURE__ */ jsx(AvlEvent, { x: 8, y: 8, size: 12 }) }),
|
|
59806
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "font-semibold text-xs", children: transitionEvent })
|
|
59807
|
-
] }) }),
|
|
59808
|
-
userType === "architect" && (transition?.guard ?? guard ?? editable) && isExpanded && /* @__PURE__ */ jsx(Box, { className: "px-4 py-2 border-b border-border/40", children: /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
59809
|
-
/* @__PURE__ */ jsx("svg", { width: 16, height: 16, children: /* @__PURE__ */ jsx(AvlGuard, { x: 8, y: 8, size: 12 }) }),
|
|
59810
|
-
editable ? /* @__PURE__ */ jsx(
|
|
59811
|
-
Input,
|
|
59812
|
-
{
|
|
59813
|
-
defaultValue: formatExpression(transition?.guard ?? guard),
|
|
59814
|
-
placeholder: t("orbInspector.guardExpression"),
|
|
59815
|
-
className: "flex-1 text-xs font-mono h-6",
|
|
59816
|
-
onBlur: (e) => handleGuardChange(e.target.value)
|
|
59817
|
-
}
|
|
59818
|
-
) : /* @__PURE__ */ jsx(Typography, { variant: "small", className: "font-mono text-xs text-muted-foreground", children: formatExpression(transition?.guard ?? guard) })
|
|
59819
|
-
] }) }),
|
|
59820
|
-
userType === "architect" && (effectTypes.length > 0 || editable) && isExpanded && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
59821
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground text-xs uppercase tracking-wider mb-2", children: [
|
|
59822
|
-
t("avl.effects"),
|
|
59823
|
-
" (",
|
|
59824
|
-
effectTypes.length,
|
|
59825
|
-
")"
|
|
59826
|
-
] }),
|
|
59827
|
-
/* @__PURE__ */ jsx(Box, { className: "flex flex-col gap-1.5", children: effectTypes.map((type, i) => {
|
|
59828
|
-
const isKnown = KNOWN_EFFECTS.has(type);
|
|
59829
|
-
const category = EFFECT_TYPE_TO_CATEGORY[type];
|
|
59830
|
-
const catColor = category ? EFFECT_CATEGORY_COLORS[category] : void 0;
|
|
59831
|
-
return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
59832
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground text-xs w-4 text-right shrink-0", children: [
|
|
59833
|
-
i + 1,
|
|
59834
|
-
"."
|
|
59835
|
-
] }),
|
|
59836
|
-
isKnown && /* @__PURE__ */ jsx("svg", { width: 16, height: 16, children: /* @__PURE__ */ jsx(AvlEffect, { x: 8, y: 8, effectType: type, size: 6, showBackground: true }) }),
|
|
59837
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-xs flex-1", style: { color: catColor?.color }, children: effectSummary(type) }),
|
|
59838
|
-
editable && /* @__PURE__ */ jsx(
|
|
59839
|
-
Button,
|
|
59840
|
-
{
|
|
59841
|
-
variant: "ghost",
|
|
59842
|
-
size: "sm",
|
|
59843
|
-
onClick: () => handleRemoveEffect(i),
|
|
59844
|
-
className: "shrink-0 p-0.5 h-6 w-6",
|
|
59845
|
-
children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" })
|
|
59846
|
-
}
|
|
59847
|
-
)
|
|
59848
|
-
] }, i);
|
|
59849
|
-
}) }),
|
|
59850
|
-
editable && /* @__PURE__ */ jsx(AddEffectButton, { onAdd: handleAddEffect })
|
|
59851
|
-
] }),
|
|
59852
|
-
userType === "architect" && patterns.length > 0 && !selectedPattern && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3", children: [
|
|
59853
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-xs uppercase tracking-wider mb-2", children: "render-ui" }),
|
|
59854
|
-
/* @__PURE__ */ jsx(Box, { className: "bg-muted/20 rounded-md p-3 font-mono text-xs leading-relaxed overflow-x-auto", children: patterns.map((entry, i) => /* @__PURE__ */ jsxs(Box, { children: [
|
|
59855
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground text-xs", children: [
|
|
59856
|
-
"slot: ",
|
|
59857
|
-
entry.slot
|
|
59858
|
-
] }),
|
|
59859
|
-
/* @__PURE__ */ jsx(OrbPatternTree, { config: entry.pattern, depth: 0 })
|
|
59860
|
-
] }, i)) })
|
|
59861
60628
|
] })
|
|
59862
60629
|
] })
|
|
59863
60630
|
) })
|
|
@@ -60056,6 +60823,133 @@ function TokenRow({ group, tokenKey, value, isColor, onPropChange }) {
|
|
|
60056
60823
|
] });
|
|
60057
60824
|
}
|
|
60058
60825
|
|
|
60826
|
+
// components/avl/organisms/LayersPanel.tsx
|
|
60827
|
+
init_FileTree();
|
|
60828
|
+
function isSExprObject(value) {
|
|
60829
|
+
return value !== null && value !== void 0 && typeof value === "object" && !Array.isArray(value);
|
|
60830
|
+
}
|
|
60831
|
+
function normalizeChildren(children) {
|
|
60832
|
+
if (children === void 0 || children === null) return [];
|
|
60833
|
+
return Array.isArray(children) ? children : [children];
|
|
60834
|
+
}
|
|
60835
|
+
function distinguishingSuffix(config) {
|
|
60836
|
+
if (typeof config.label === "string" && config.label.length > 0) return config.label;
|
|
60837
|
+
if (typeof config.text === "string" && config.text.length > 0) return config.text;
|
|
60838
|
+
if (typeof config.content === "string" && config.content.length > 0) return config.content;
|
|
60839
|
+
return void 0;
|
|
60840
|
+
}
|
|
60841
|
+
function patternRowLabel(value) {
|
|
60842
|
+
if (isSExprObject(value)) {
|
|
60843
|
+
const type = typeof value.type === "string" ? value.type : "unknown";
|
|
60844
|
+
const suffix = distinguishingSuffix(value);
|
|
60845
|
+
return suffix ? `${type} \u2014 ${suffix}` : type;
|
|
60846
|
+
}
|
|
60847
|
+
return value === void 0 || value === null ? "unknown" : String(value);
|
|
60848
|
+
}
|
|
60849
|
+
function pushPatternRows(items, slotId, slotIndex, parentRowId, patternPath, config) {
|
|
60850
|
+
const id = `${slotId}/pattern:${slotIndex}:${patternPath}`;
|
|
60851
|
+
items.push({ id, label: patternRowLabel(config), parentId: parentRowId, icon: "component" });
|
|
60852
|
+
if (!isSExprObject(config)) return;
|
|
60853
|
+
normalizeChildren(config.children).forEach((child, index) => {
|
|
60854
|
+
if (!isSExprObject(child)) return;
|
|
60855
|
+
pushPatternRows(items, slotId, slotIndex, id, `${patternPath}.children.${index}`, child);
|
|
60856
|
+
});
|
|
60857
|
+
}
|
|
60858
|
+
function schemaToLayerItems(schema) {
|
|
60859
|
+
const items = [];
|
|
60860
|
+
const seenSlotIds = /* @__PURE__ */ new Set();
|
|
60861
|
+
for (const appOrbital of parseApplicationLevel(schema).orbitals) {
|
|
60862
|
+
const orbitalId = `orbital:${appOrbital.name}`;
|
|
60863
|
+
items.push({ id: orbitalId, label: appOrbital.name, icon: "box" });
|
|
60864
|
+
const orbitalData = parseOrbitalLevel(schema, appOrbital.name);
|
|
60865
|
+
if (!orbitalData) continue;
|
|
60866
|
+
for (const page of orbitalData.pages) {
|
|
60867
|
+
items.push({
|
|
60868
|
+
id: `${orbitalId}/page:${page.name}`,
|
|
60869
|
+
label: page.name,
|
|
60870
|
+
parentId: orbitalId,
|
|
60871
|
+
icon: "file-text"
|
|
60872
|
+
});
|
|
60873
|
+
}
|
|
60874
|
+
for (const traitInfo of orbitalData.traits) {
|
|
60875
|
+
const traitId = `${orbitalId}/trait:${traitInfo.name}`;
|
|
60876
|
+
items.push({ id: traitId, label: traitInfo.name, parentId: orbitalId, icon: "git-branch" });
|
|
60877
|
+
const traitData = parseTraitLevel(schema, appOrbital.name, traitInfo.name);
|
|
60878
|
+
if (!traitData) continue;
|
|
60879
|
+
traitData.transitions.forEach((transition, transitionIndex) => {
|
|
60880
|
+
const transitionId = `${traitId}/transition:${transitionIndex}`;
|
|
60881
|
+
items.push({
|
|
60882
|
+
id: transitionId,
|
|
60883
|
+
label: transition.event || `${transition.from} \u2192 ${transition.to}`,
|
|
60884
|
+
parentId: traitId,
|
|
60885
|
+
icon: "zap"
|
|
60886
|
+
});
|
|
60887
|
+
const renderUiEffects = transition.effects.filter((effect) => effect.type === "render-ui");
|
|
60888
|
+
renderUiEffects.forEach((effect, slotIndex) => {
|
|
60889
|
+
const slotName = String(effect.args[0] ?? "main");
|
|
60890
|
+
const slotId = `${transitionId}/slot:${slotName}`;
|
|
60891
|
+
if (!seenSlotIds.has(slotId)) {
|
|
60892
|
+
seenSlotIds.add(slotId);
|
|
60893
|
+
items.push({ id: slotId, label: slotName, parentId: transitionId, icon: "layout-panel-top" });
|
|
60894
|
+
}
|
|
60895
|
+
pushPatternRows(items, slotId, slotIndex, slotId, "root", effect.args[1]);
|
|
60896
|
+
});
|
|
60897
|
+
});
|
|
60898
|
+
}
|
|
60899
|
+
}
|
|
60900
|
+
return items;
|
|
60901
|
+
}
|
|
60902
|
+
function parseLayerId(id) {
|
|
60903
|
+
const [head, ...rest] = id.split("/");
|
|
60904
|
+
const orbitalMatch = /^orbital:(.+)$/.exec(head ?? "");
|
|
60905
|
+
if (!orbitalMatch) return null;
|
|
60906
|
+
const parts = { orbitalName: orbitalMatch[1] };
|
|
60907
|
+
for (const segment of rest) {
|
|
60908
|
+
const pageMatch = /^page:(.+)$/.exec(segment);
|
|
60909
|
+
if (pageMatch) {
|
|
60910
|
+
parts.pageName = pageMatch[1];
|
|
60911
|
+
continue;
|
|
60912
|
+
}
|
|
60913
|
+
const traitMatch = /^trait:(.+)$/.exec(segment);
|
|
60914
|
+
if (traitMatch) {
|
|
60915
|
+
parts.traitName = traitMatch[1];
|
|
60916
|
+
continue;
|
|
60917
|
+
}
|
|
60918
|
+
const transitionMatch = /^transition:(\d+)$/.exec(segment);
|
|
60919
|
+
if (transitionMatch) {
|
|
60920
|
+
parts.transitionIndex = Number(transitionMatch[1]);
|
|
60921
|
+
continue;
|
|
60922
|
+
}
|
|
60923
|
+
const slotMatch = /^slot:(.+)$/.exec(segment);
|
|
60924
|
+
if (slotMatch) {
|
|
60925
|
+
parts.slotName = slotMatch[1];
|
|
60926
|
+
continue;
|
|
60927
|
+
}
|
|
60928
|
+
const patternMatch = /^pattern:(\d+):(.+)$/.exec(segment);
|
|
60929
|
+
if (patternMatch) {
|
|
60930
|
+
parts.patternSlotIndex = Number(patternMatch[1]);
|
|
60931
|
+
parts.patternPath = patternMatch[2];
|
|
60932
|
+
continue;
|
|
60933
|
+
}
|
|
60934
|
+
return null;
|
|
60935
|
+
}
|
|
60936
|
+
return parts;
|
|
60937
|
+
}
|
|
60938
|
+
var LayersPanel = ({ schema, selectedId, onSelect, onReorder }) => {
|
|
60939
|
+
const items = useMemo(() => schemaToLayerItems(schema), [schema]);
|
|
60940
|
+
return /* @__PURE__ */ jsx(
|
|
60941
|
+
FileTree,
|
|
60942
|
+
{
|
|
60943
|
+
items,
|
|
60944
|
+
look: "nav",
|
|
60945
|
+
selectedId,
|
|
60946
|
+
onNodeSelect: onSelect,
|
|
60947
|
+
onNodeReorder: onReorder
|
|
60948
|
+
}
|
|
60949
|
+
);
|
|
60950
|
+
};
|
|
60951
|
+
LayersPanel.displayName = "LayersPanel";
|
|
60952
|
+
|
|
60059
60953
|
// components/avl/organisms/FlowCanvas.tsx
|
|
60060
60954
|
init_Box();
|
|
60061
60955
|
init_Typography();
|
|
@@ -60273,7 +61167,7 @@ var TraitCardNodeInner = (props) => {
|
|
|
60273
61167
|
}
|
|
60274
61168
|
);
|
|
60275
61169
|
};
|
|
60276
|
-
var TraitCardNode =
|
|
61170
|
+
var TraitCardNode = React96__default.memo(TraitCardNodeInner);
|
|
60277
61171
|
TraitCardNode.displayName = "TraitCardNode";
|
|
60278
61172
|
|
|
60279
61173
|
// components/avl/organisms/FlowCanvas.tsx
|
|
@@ -60322,7 +61216,10 @@ function FlowCanvasInner({
|
|
|
60322
61216
|
userType = "builder",
|
|
60323
61217
|
themeManifest,
|
|
60324
61218
|
nodePositions,
|
|
60325
|
-
onPositionsChange
|
|
61219
|
+
onPositionsChange,
|
|
61220
|
+
onSelectedNodeChange,
|
|
61221
|
+
onSelectedPatternChange,
|
|
61222
|
+
externalInspector = false
|
|
60326
61223
|
}) {
|
|
60327
61224
|
const { t } = useTranslate();
|
|
60328
61225
|
const NODE_TYPES2 = useMemo(() => ({
|
|
@@ -60349,7 +61246,7 @@ function FlowCanvasInner({
|
|
|
60349
61246
|
initialOrbital
|
|
60350
61247
|
);
|
|
60351
61248
|
const [expandedBehaviorAlias, setExpandedBehaviorAlias] = useState(void 0);
|
|
60352
|
-
const screenSizeUserOverrideRef =
|
|
61249
|
+
const screenSizeUserOverrideRef = React96__default.useRef(false);
|
|
60353
61250
|
const [screenSize, setScreenSize] = useState(
|
|
60354
61251
|
() => typeof window === "undefined" ? "laptop" : detectScreenSize(window.innerWidth)
|
|
60355
61252
|
);
|
|
@@ -60366,15 +61263,23 @@ function FlowCanvasInner({
|
|
|
60366
61263
|
screenSizeUserOverrideRef.current = true;
|
|
60367
61264
|
setScreenSize(size);
|
|
60368
61265
|
}, []);
|
|
60369
|
-
const [selectedNode,
|
|
60370
|
-
const
|
|
61266
|
+
const [selectedNode, setSelectedNodeInternal] = useState(initialSelectedNode ?? null);
|
|
61267
|
+
const setSelectedNode = useCallback((node) => {
|
|
61268
|
+
setSelectedNodeInternal(node);
|
|
61269
|
+
onSelectedNodeChange?.(node);
|
|
61270
|
+
}, [onSelectedNodeChange]);
|
|
61271
|
+
const [selectedPattern, setSelectedPatternInternal] = useState(null);
|
|
61272
|
+
const setSelectedPattern = useCallback((p) => {
|
|
61273
|
+
setSelectedPatternInternal(p);
|
|
61274
|
+
onSelectedPatternChange?.(p);
|
|
61275
|
+
}, [onSelectedPatternChange]);
|
|
60371
61276
|
const patternSelectionValue = useMemo(() => ({
|
|
60372
61277
|
selected: selectedPattern,
|
|
60373
61278
|
select: (p) => {
|
|
60374
61279
|
setSelectedPattern(p);
|
|
60375
61280
|
if (p) setSelectedNode(p.nodeData);
|
|
60376
61281
|
}
|
|
60377
|
-
}), [selectedPattern]);
|
|
61282
|
+
}), [selectedPattern, setSelectedNode, setSelectedPattern]);
|
|
60378
61283
|
const [atBehaviorLevel, setAtBehaviorLevel] = useState(composeLevel === "behavior");
|
|
60379
61284
|
const { composeNodes, composeEdges, overviewNodes, overviewEdges, expandedNodes, expandedEdges, behaviorExpandedNodes, behaviorExpandedEdges, traitExpandedNodes, traitExpandedEdges } = useMemo(() => {
|
|
60380
61285
|
const t2 = perfStart("compose-graph");
|
|
@@ -60409,9 +61314,9 @@ function FlowCanvasInner({
|
|
|
60409
61314
|
const [nodes, setNodes, onNodesChange] = useNodesState(activeNodes);
|
|
60410
61315
|
const [edges, setEdges, onEdgesChange] = useEdgesState(activeEdges);
|
|
60411
61316
|
const reactFlow = useReactFlow();
|
|
60412
|
-
const savedPositionsRef =
|
|
61317
|
+
const savedPositionsRef = React96__default.useRef(nodePositions);
|
|
60413
61318
|
savedPositionsRef.current = nodePositions;
|
|
60414
|
-
const nodesRef =
|
|
61319
|
+
const nodesRef = React96__default.useRef(nodes);
|
|
60415
61320
|
nodesRef.current = nodes;
|
|
60416
61321
|
useEffect(() => {
|
|
60417
61322
|
setEdges([]);
|
|
@@ -60485,10 +61390,10 @@ function FlowCanvasInner({
|
|
|
60485
61390
|
const orbitalName = nodeData.orbitalName ?? node.id;
|
|
60486
61391
|
onNodeClick?.({ level: "overview", orbital: orbitalName });
|
|
60487
61392
|
onNodeSelect?.(orbitalName);
|
|
60488
|
-
}, [level, expandedOrbital, onNodeClick, onNodeSelect]);
|
|
61393
|
+
}, [level, expandedOrbital, onNodeClick, onNodeSelect, setSelectedNode]);
|
|
60489
61394
|
const handleClosePanel = useCallback(() => {
|
|
60490
61395
|
setSelectedNode(null);
|
|
60491
|
-
}, []);
|
|
61396
|
+
}, [setSelectedNode]);
|
|
60492
61397
|
const handleKeyDown = useCallback((e) => {
|
|
60493
61398
|
if (e.key === "Escape") {
|
|
60494
61399
|
if (selectedNode) {
|
|
@@ -60513,7 +61418,7 @@ function FlowCanvasInner({
|
|
|
60513
61418
|
setSelectedPattern(null);
|
|
60514
61419
|
}
|
|
60515
61420
|
}
|
|
60516
|
-
}, [level, onLevelChange, selectedNode, selectedPattern, onPatternDelete, atBehaviorLevel, composeLevel, expandedOrbital]);
|
|
61421
|
+
}, [level, onLevelChange, selectedNode, selectedPattern, onPatternDelete, atBehaviorLevel, composeLevel, expandedOrbital, setSelectedNode]);
|
|
60517
61422
|
useEffect(() => {
|
|
60518
61423
|
document.addEventListener("keydown", handleKeyDown);
|
|
60519
61424
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
@@ -60536,7 +61441,7 @@ function FlowCanvasInner({
|
|
|
60536
61441
|
setExpandedOrbital(void 0);
|
|
60537
61442
|
setSelectedNode(null);
|
|
60538
61443
|
}
|
|
60539
|
-
}, [level, onLevelChange, selectedNode, composeLevel, atBehaviorLevel, expandedOrbital]);
|
|
61444
|
+
}, [level, onLevelChange, selectedNode, composeLevel, atBehaviorLevel, expandedOrbital, setSelectedNode]);
|
|
60540
61445
|
const eventBus = useEventBus();
|
|
60541
61446
|
const handleConnect = useCallback((connection) => {
|
|
60542
61447
|
if (!connection.sourceHandle?.startsWith("event-") || !onEventWire) return;
|
|
@@ -60682,7 +61587,7 @@ function FlowCanvasInner({
|
|
|
60682
61587
|
}
|
|
60683
61588
|
)
|
|
60684
61589
|
] }),
|
|
60685
|
-
selectedNode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
61590
|
+
!externalInspector && selectedNode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
60686
61591
|
/* @__PURE__ */ jsx(
|
|
60687
61592
|
Box,
|
|
60688
61593
|
{
|
|
@@ -60748,7 +61653,7 @@ var ZoomBreadcrumb = ({
|
|
|
60748
61653
|
if (eventName && band === "detail") {
|
|
60749
61654
|
segments.push({ icon: "\u26A1", label: eventName });
|
|
60750
61655
|
}
|
|
60751
|
-
return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(
|
|
61656
|
+
return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
60752
61657
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
|
|
60753
61658
|
/* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
|
|
60754
61659
|
/* @__PURE__ */ jsx("span", { children: seg.label })
|
|
@@ -61089,7 +61994,7 @@ var EventWireOverlay = ({
|
|
|
61089
61994
|
containerW,
|
|
61090
61995
|
containerH
|
|
61091
61996
|
}) => {
|
|
61092
|
-
const ids =
|
|
61997
|
+
const ids = React96__default.useMemo(() => {
|
|
61093
61998
|
avlOczWireId += 1;
|
|
61094
61999
|
return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
|
|
61095
62000
|
}, []);
|
|
@@ -61456,7 +62361,7 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
61456
62361
|
borderRadius: 6,
|
|
61457
62362
|
border: `1px solid ${color}`
|
|
61458
62363
|
},
|
|
61459
|
-
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(
|
|
62364
|
+
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
61460
62365
|
i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
|
|
61461
62366
|
i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
|
|
61462
62367
|
Box,
|
|
@@ -61946,4 +62851,4 @@ var AvlClickTarget = ({
|
|
|
61946
62851
|
};
|
|
61947
62852
|
AvlClickTarget.displayName = "AvlClickTarget";
|
|
61948
62853
|
|
|
61949
|
-
export { AVL_FIELD_TYPE_SHAPES, AVL_OPERATOR_COLORS, AvlApplication, AvlBackwardEdge, AvlBehaviorGlyph, AvlBinding, AvlBindingEdge, AvlBindingRef, AvlClickTarget, AvlClosedCircuit, AvlCosmicZoom, AvlEffect, AvlEmitListen, AvlEntity, AvlEvent, AvlEventWireEdge, AvlExprTree, AvlField, AvlFieldType, AvlGuard, AvlLiteral, AvlOperator, AvlOrbital, AvlOrbitalNode, AvlOrbitalUnit, AvlOrbitalsCosmicZoom, AvlPage, AvlPageEdge, AvlPersistence, AvlSExpr, AvlSlotMap, AvlState, AvlStateMachine, AvlSwimLane, AvlTrait, AvlTraitScene, AvlTransition, AvlTransitionEdge, AvlTransitionLane, AvlTransitionScene, BehaviorComposeNode, BehaviorView, CONNECTION_COLORS, CanvasDndProvider, DOMAIN_COLORS, DetailView, EFFECT_CATEGORY_COLORS, EFFECT_TYPE_TO_CATEGORY, EventFlowEdge, FlowCanvas, MiniStateMachine, ModuleCard, OrbInspector, OrbPreviewNode, STATE_COLORS, SystemNode, ZOOM_BAND_THRESHOLDS, ZoomBandContext, ZoomBreadcrumb, ZoomLegend, arcPath, behaviorsToComposeGraph, computeTraitLayout, computeZoomBand, curveControlPoint, deriveEditFocusFromElement, edgePath, getStateRole, gridPositions, orbitalToExpandedGraph, parseApplicationLevel, parseOrbitalLevel, parseTraitLevel, parseTransitionLevel, radialPositions, registryEntryToCanvasEntry, ringPositions, schemaToFlowGraph, schemaToOverviewGraph, useCanvasDraggable, useCanvasDroppable, useZoomBand, zoomProgress };
|
|
62854
|
+
export { AVL_FIELD_TYPE_SHAPES, AVL_OPERATOR_COLORS, AvlApplication, AvlBackwardEdge, AvlBehaviorGlyph, AvlBinding, AvlBindingEdge, AvlBindingRef, AvlClickTarget, AvlClosedCircuit, AvlCosmicZoom, AvlEffect, AvlEmitListen, AvlEntity, AvlEvent, AvlEventWireEdge, AvlExprTree, AvlField, AvlFieldType, AvlGuard, AvlLiteral, AvlOperator, AvlOrbital, AvlOrbitalNode, AvlOrbitalUnit, AvlOrbitalsCosmicZoom, AvlPage, AvlPageEdge, AvlPersistence, AvlSExpr, AvlSlotMap, AvlState, AvlStateMachine, AvlSwimLane, AvlTrait, AvlTraitScene, AvlTransition, AvlTransitionEdge, AvlTransitionLane, AvlTransitionScene, BehaviorComposeNode, BehaviorView, CONNECTION_COLORS, CanvasDndProvider, DOMAIN_COLORS, DetailView, EFFECT_CATEGORY_COLORS, EFFECT_TYPE_TO_CATEGORY, EventFlowEdge, FlowCanvas, LayersPanel, MiniStateMachine, ModuleCard, OrbInspector, OrbPreviewNode, STATE_COLORS, SystemNode, ZOOM_BAND_THRESHOLDS, ZoomBandContext, ZoomBreadcrumb, ZoomLegend, arcPath, behaviorsToComposeGraph, computeTraitLayout, computeZoomBand, curveControlPoint, deriveEditFocusFromElement, edgePath, getStateRole, gridPositions, orbitalToExpandedGraph, parseApplicationLevel, parseLayerId, parseOrbitalLevel, parseTraitLevel, parseTransitionLevel, radialPositions, registryEntryToCanvasEntry, ringPositions, schemaToFlowGraph, schemaToLayerItems, schemaToOverviewGraph, useCanvasDraggable, useCanvasDroppable, useZoomBand, zoomProgress };
|