@almadar/ui 5.33.1 → 5.34.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 +1980 -1398
- package/dist/avl/index.js +921 -339
- package/dist/components/index.cjs +1752 -1731
- package/dist/components/index.js +844 -821
- package/dist/providers/index.cjs +1805 -1223
- package/dist/providers/index.js +897 -315
- package/dist/runtime/index.cjs +1845 -1263
- package/dist/runtime/index.js +901 -319
- package/package.json +1 -1
package/dist/runtime/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React82 from 'react';
|
|
2
|
+
import React82__default, { createContext, useMemo, useContext, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
6
|
import { EventBusContext, useTraitScope, OrbitalProvider, TraitScopeProvider, VerificationProvider } from '@almadar/ui/providers';
|
|
7
7
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
8
8
|
import * as LucideIcons2 from 'lucide-react';
|
|
9
|
-
import { Loader2, X, List, Printer, ChevronRight, ChevronLeft, GitBranch, Pencil, Eye, Plus, ArrowRight, Trash, Code, FileText, WrapText, Check, Copy, AlertTriangle, Trash2, ZoomOut, ZoomIn, Download,
|
|
9
|
+
import { Loader2, X, Lightbulb, CheckCircle, List, Printer, ChevronRight, ChevronLeft, GitBranch, Pencil, Eye, Plus, ArrowRight, Trash, Code, FileText, WrapText, Check, Copy, RotateCcw, Play, Terminal, XCircle, AlertTriangle, Trash2, Link2, ZoomOut, ZoomIn, Download, Menu as Menu$1, Package, Calendar, MoreHorizontal, Image as Image$1, Upload, ArrowLeft, HelpCircle, PauseCircle, Search, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, Minus, Eraser, TrendingUp, TrendingDown, AlertCircle, Circle, Clock, CheckCircle2, Pause, SkipForward, Bug, Send, ChevronUp, ChevronDown, Wrench, Tag, User, DollarSign, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
|
|
10
10
|
import * as PhosphorIcons from '@phosphor-icons/react';
|
|
11
11
|
import * as TablerIcons from '@tabler/icons-react';
|
|
12
12
|
import * as FaIcons from 'react-icons/fa';
|
|
@@ -393,7 +393,7 @@ var init_Box = __esm({
|
|
|
393
393
|
fixed: "fixed",
|
|
394
394
|
sticky: "sticky"
|
|
395
395
|
};
|
|
396
|
-
Box =
|
|
396
|
+
Box = React82__default.forwardRef(
|
|
397
397
|
({
|
|
398
398
|
padding,
|
|
399
399
|
paddingX,
|
|
@@ -443,7 +443,7 @@ var init_Box = __esm({
|
|
|
443
443
|
onMouseLeave?.(e);
|
|
444
444
|
}, [hoverEvent, eventBus, onMouseLeave]);
|
|
445
445
|
const isClickable = action || onClick;
|
|
446
|
-
return
|
|
446
|
+
return React82__default.createElement(
|
|
447
447
|
Component,
|
|
448
448
|
{
|
|
449
449
|
ref,
|
|
@@ -1234,7 +1234,7 @@ var init_Icon = __esm({
|
|
|
1234
1234
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1235
1235
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1236
1236
|
const family = useIconFamily();
|
|
1237
|
-
const RenderedComponent =
|
|
1237
|
+
const RenderedComponent = React82__default.useMemo(() => {
|
|
1238
1238
|
if (directIcon) return null;
|
|
1239
1239
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1240
1240
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1293,7 +1293,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1293
1293
|
const IconComp = value;
|
|
1294
1294
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1295
1295
|
}
|
|
1296
|
-
if (
|
|
1296
|
+
if (React82__default.isValidElement(value)) {
|
|
1297
1297
|
return value;
|
|
1298
1298
|
}
|
|
1299
1299
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -1369,7 +1369,7 @@ var init_Button = __esm({
|
|
|
1369
1369
|
md: "h-icon-default w-icon-default",
|
|
1370
1370
|
lg: "h-icon-default w-icon-default"
|
|
1371
1371
|
};
|
|
1372
|
-
Button =
|
|
1372
|
+
Button = React82__default.forwardRef(
|
|
1373
1373
|
({
|
|
1374
1374
|
className,
|
|
1375
1375
|
variant = "primary",
|
|
@@ -1434,7 +1434,7 @@ var Dialog;
|
|
|
1434
1434
|
var init_Dialog = __esm({
|
|
1435
1435
|
"components/core/atoms/Dialog.tsx"() {
|
|
1436
1436
|
init_cn();
|
|
1437
|
-
Dialog =
|
|
1437
|
+
Dialog = React82__default.forwardRef(
|
|
1438
1438
|
({
|
|
1439
1439
|
role = "dialog",
|
|
1440
1440
|
"aria-modal": ariaModal = true,
|
|
@@ -2048,7 +2048,7 @@ var init_Badge = __esm({
|
|
|
2048
2048
|
md: "px-2.5 py-1 text-sm",
|
|
2049
2049
|
lg: "px-3 py-1.5 text-base"
|
|
2050
2050
|
};
|
|
2051
|
-
Badge =
|
|
2051
|
+
Badge = React82__default.forwardRef(
|
|
2052
2052
|
({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2053
2053
|
const iconSizes3 = {
|
|
2054
2054
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2384,7 +2384,7 @@ var init_SvgFlow = __esm({
|
|
|
2384
2384
|
width = 100,
|
|
2385
2385
|
height = 100
|
|
2386
2386
|
}) => {
|
|
2387
|
-
const markerId =
|
|
2387
|
+
const markerId = React82__default.useMemo(() => {
|
|
2388
2388
|
flowIdCounter += 1;
|
|
2389
2389
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2390
2390
|
}, []);
|
|
@@ -2977,7 +2977,7 @@ var init_SvgRing = __esm({
|
|
|
2977
2977
|
width = 100,
|
|
2978
2978
|
height = 100
|
|
2979
2979
|
}) => {
|
|
2980
|
-
const gradientId =
|
|
2980
|
+
const gradientId = React82__default.useMemo(() => {
|
|
2981
2981
|
ringIdCounter += 1;
|
|
2982
2982
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
2983
2983
|
}, []);
|
|
@@ -3158,7 +3158,7 @@ var init_Input = __esm({
|
|
|
3158
3158
|
init_cn();
|
|
3159
3159
|
init_Icon();
|
|
3160
3160
|
init_useEventBus();
|
|
3161
|
-
Input =
|
|
3161
|
+
Input = React82__default.forwardRef(
|
|
3162
3162
|
({
|
|
3163
3163
|
className,
|
|
3164
3164
|
inputType,
|
|
@@ -3318,7 +3318,7 @@ var Label;
|
|
|
3318
3318
|
var init_Label = __esm({
|
|
3319
3319
|
"components/core/atoms/Label.tsx"() {
|
|
3320
3320
|
init_cn();
|
|
3321
|
-
Label =
|
|
3321
|
+
Label = React82__default.forwardRef(
|
|
3322
3322
|
({ className, required, children, ...props }, ref) => {
|
|
3323
3323
|
return /* @__PURE__ */ jsxs(
|
|
3324
3324
|
"label",
|
|
@@ -3345,7 +3345,7 @@ var init_Textarea = __esm({
|
|
|
3345
3345
|
"components/core/atoms/Textarea.tsx"() {
|
|
3346
3346
|
init_cn();
|
|
3347
3347
|
init_useEventBus();
|
|
3348
|
-
Textarea =
|
|
3348
|
+
Textarea = React82__default.forwardRef(
|
|
3349
3349
|
({ className, error, onChange, ...props }, ref) => {
|
|
3350
3350
|
const eventBus = useEventBus();
|
|
3351
3351
|
const handleChange = (e) => {
|
|
@@ -3584,7 +3584,7 @@ var init_Select = __esm({
|
|
|
3584
3584
|
init_cn();
|
|
3585
3585
|
init_Icon();
|
|
3586
3586
|
init_useEventBus();
|
|
3587
|
-
Select =
|
|
3587
|
+
Select = React82__default.forwardRef(
|
|
3588
3588
|
(props, _ref) => {
|
|
3589
3589
|
const { multiple, searchable, clearable } = props;
|
|
3590
3590
|
if (multiple || searchable || clearable) {
|
|
@@ -3601,7 +3601,7 @@ var init_Checkbox = __esm({
|
|
|
3601
3601
|
"components/core/atoms/Checkbox.tsx"() {
|
|
3602
3602
|
init_cn();
|
|
3603
3603
|
init_useEventBus();
|
|
3604
|
-
Checkbox =
|
|
3604
|
+
Checkbox = React82__default.forwardRef(
|
|
3605
3605
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
3606
3606
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3607
3607
|
const eventBus = useEventBus();
|
|
@@ -3655,7 +3655,7 @@ var init_Spinner = __esm({
|
|
|
3655
3655
|
md: "h-6 w-6",
|
|
3656
3656
|
lg: "h-8 w-8"
|
|
3657
3657
|
};
|
|
3658
|
-
Spinner =
|
|
3658
|
+
Spinner = React82__default.forwardRef(
|
|
3659
3659
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
3660
3660
|
if (overlay) {
|
|
3661
3661
|
return /* @__PURE__ */ jsx(
|
|
@@ -3745,7 +3745,7 @@ var init_Card = __esm({
|
|
|
3745
3745
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
3746
3746
|
"tile-image-first": "p-0 overflow-hidden"
|
|
3747
3747
|
};
|
|
3748
|
-
Card =
|
|
3748
|
+
Card = React82__default.forwardRef(
|
|
3749
3749
|
({
|
|
3750
3750
|
className,
|
|
3751
3751
|
variant = "bordered",
|
|
@@ -3793,9 +3793,9 @@ var init_Card = __esm({
|
|
|
3793
3793
|
}
|
|
3794
3794
|
);
|
|
3795
3795
|
Card.displayName = "Card";
|
|
3796
|
-
CardHeader =
|
|
3796
|
+
CardHeader = React82__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3797
3797
|
CardHeader.displayName = "CardHeader";
|
|
3798
|
-
CardTitle =
|
|
3798
|
+
CardTitle = React82__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3799
3799
|
"h3",
|
|
3800
3800
|
{
|
|
3801
3801
|
ref,
|
|
@@ -3808,11 +3808,11 @@ var init_Card = __esm({
|
|
|
3808
3808
|
}
|
|
3809
3809
|
));
|
|
3810
3810
|
CardTitle.displayName = "CardTitle";
|
|
3811
|
-
CardContent =
|
|
3811
|
+
CardContent = React82__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3812
3812
|
CardContent.displayName = "CardContent";
|
|
3813
3813
|
CardBody = CardContent;
|
|
3814
3814
|
CardBody.displayName = "CardBody";
|
|
3815
|
-
CardFooter =
|
|
3815
|
+
CardFooter = React82__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3816
3816
|
"div",
|
|
3817
3817
|
{
|
|
3818
3818
|
ref,
|
|
@@ -3867,7 +3867,7 @@ var init_FilterPill = __esm({
|
|
|
3867
3867
|
md: "w-3.5 h-3.5",
|
|
3868
3868
|
lg: "w-4 h-4"
|
|
3869
3869
|
};
|
|
3870
|
-
FilterPill =
|
|
3870
|
+
FilterPill = React82__default.forwardRef(
|
|
3871
3871
|
({
|
|
3872
3872
|
className,
|
|
3873
3873
|
variant = "default",
|
|
@@ -3996,8 +3996,8 @@ var init_Avatar = __esm({
|
|
|
3996
3996
|
actionPayload
|
|
3997
3997
|
}) => {
|
|
3998
3998
|
const eventBus = useEventBus();
|
|
3999
|
-
const [imgFailed, setImgFailed] =
|
|
4000
|
-
|
|
3999
|
+
const [imgFailed, setImgFailed] = React82__default.useState(false);
|
|
4000
|
+
React82__default.useEffect(() => {
|
|
4001
4001
|
setImgFailed(false);
|
|
4002
4002
|
}, [src]);
|
|
4003
4003
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4382,7 +4382,7 @@ var init_Radio = __esm({
|
|
|
4382
4382
|
md: "w-2.5 h-2.5",
|
|
4383
4383
|
lg: "w-3 h-3"
|
|
4384
4384
|
};
|
|
4385
|
-
Radio =
|
|
4385
|
+
Radio = React82__default.forwardRef(
|
|
4386
4386
|
({
|
|
4387
4387
|
label,
|
|
4388
4388
|
helperText,
|
|
@@ -4399,12 +4399,12 @@ var init_Radio = __esm({
|
|
|
4399
4399
|
onChange,
|
|
4400
4400
|
...props
|
|
4401
4401
|
}, ref) => {
|
|
4402
|
-
const reactId =
|
|
4402
|
+
const reactId = React82__default.useId();
|
|
4403
4403
|
const baseId = id || `radio-${reactId}`;
|
|
4404
4404
|
const hasError = !!error;
|
|
4405
4405
|
const eventBus = useEventBus();
|
|
4406
|
-
const [selected, setSelected] =
|
|
4407
|
-
|
|
4406
|
+
const [selected, setSelected] = React82__default.useState(value);
|
|
4407
|
+
React82__default.useEffect(() => {
|
|
4408
4408
|
if (value !== void 0) setSelected(value);
|
|
4409
4409
|
}, [value]);
|
|
4410
4410
|
const pick = (next, e) => {
|
|
@@ -4586,7 +4586,7 @@ var init_Switch = __esm({
|
|
|
4586
4586
|
"components/core/atoms/Switch.tsx"() {
|
|
4587
4587
|
"use client";
|
|
4588
4588
|
init_cn();
|
|
4589
|
-
Switch =
|
|
4589
|
+
Switch = React82.forwardRef(
|
|
4590
4590
|
({
|
|
4591
4591
|
checked,
|
|
4592
4592
|
defaultChecked = false,
|
|
@@ -4597,10 +4597,10 @@ var init_Switch = __esm({
|
|
|
4597
4597
|
name,
|
|
4598
4598
|
className
|
|
4599
4599
|
}, ref) => {
|
|
4600
|
-
const [isChecked, setIsChecked] =
|
|
4600
|
+
const [isChecked, setIsChecked] = React82.useState(
|
|
4601
4601
|
checked !== void 0 ? checked : defaultChecked
|
|
4602
4602
|
);
|
|
4603
|
-
|
|
4603
|
+
React82.useEffect(() => {
|
|
4604
4604
|
if (checked !== void 0) {
|
|
4605
4605
|
setIsChecked(checked);
|
|
4606
4606
|
}
|
|
@@ -5131,7 +5131,7 @@ var Aside;
|
|
|
5131
5131
|
var init_Aside = __esm({
|
|
5132
5132
|
"components/core/atoms/Aside.tsx"() {
|
|
5133
5133
|
init_cn();
|
|
5134
|
-
Aside =
|
|
5134
|
+
Aside = React82__default.forwardRef(
|
|
5135
5135
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
5136
5136
|
);
|
|
5137
5137
|
Aside.displayName = "Aside";
|
|
@@ -5209,8 +5209,8 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5209
5209
|
className
|
|
5210
5210
|
}) => {
|
|
5211
5211
|
const { t } = useTranslate();
|
|
5212
|
-
const [isVisible, setIsVisible] =
|
|
5213
|
-
const timeoutRef =
|
|
5212
|
+
const [isVisible, setIsVisible] = React82__default.useState(false);
|
|
5213
|
+
const timeoutRef = React82__default.useRef(null);
|
|
5214
5214
|
const handleMouseEnter = () => {
|
|
5215
5215
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5216
5216
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5219,7 +5219,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5219
5219
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5220
5220
|
setIsVisible(false);
|
|
5221
5221
|
};
|
|
5222
|
-
|
|
5222
|
+
React82__default.useEffect(() => {
|
|
5223
5223
|
return () => {
|
|
5224
5224
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5225
5225
|
};
|
|
@@ -5429,7 +5429,7 @@ var init_StatusDot = __esm({
|
|
|
5429
5429
|
md: "w-2.5 h-2.5",
|
|
5430
5430
|
lg: "w-3 h-3"
|
|
5431
5431
|
};
|
|
5432
|
-
StatusDot =
|
|
5432
|
+
StatusDot = React82__default.forwardRef(
|
|
5433
5433
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5434
5434
|
return /* @__PURE__ */ jsx(
|
|
5435
5435
|
"span",
|
|
@@ -5483,7 +5483,7 @@ var init_TrendIndicator = __esm({
|
|
|
5483
5483
|
down: "trending-down",
|
|
5484
5484
|
flat: "arrow-right"
|
|
5485
5485
|
};
|
|
5486
|
-
TrendIndicator =
|
|
5486
|
+
TrendIndicator = React82__default.forwardRef(
|
|
5487
5487
|
({
|
|
5488
5488
|
className,
|
|
5489
5489
|
value,
|
|
@@ -5550,7 +5550,7 @@ var init_RangeSlider = __esm({
|
|
|
5550
5550
|
md: "w-4 h-4",
|
|
5551
5551
|
lg: "w-5 h-5"
|
|
5552
5552
|
};
|
|
5553
|
-
RangeSlider =
|
|
5553
|
+
RangeSlider = React82__default.forwardRef(
|
|
5554
5554
|
({
|
|
5555
5555
|
className,
|
|
5556
5556
|
min = 0,
|
|
@@ -6058,7 +6058,7 @@ var init_ContentSection = __esm({
|
|
|
6058
6058
|
md: "py-16",
|
|
6059
6059
|
lg: "py-24"
|
|
6060
6060
|
};
|
|
6061
|
-
ContentSection =
|
|
6061
|
+
ContentSection = React82__default.forwardRef(
|
|
6062
6062
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
6063
6063
|
return /* @__PURE__ */ jsx(
|
|
6064
6064
|
Box,
|
|
@@ -6592,7 +6592,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6592
6592
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6593
6593
|
"none": {}
|
|
6594
6594
|
};
|
|
6595
|
-
AnimatedReveal =
|
|
6595
|
+
AnimatedReveal = React82__default.forwardRef(
|
|
6596
6596
|
({
|
|
6597
6597
|
trigger = "scroll",
|
|
6598
6598
|
animation = "fade-up",
|
|
@@ -6752,7 +6752,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6752
6752
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6753
6753
|
"use client";
|
|
6754
6754
|
init_cn();
|
|
6755
|
-
AnimatedGraphic =
|
|
6755
|
+
AnimatedGraphic = React82__default.forwardRef(
|
|
6756
6756
|
({
|
|
6757
6757
|
src,
|
|
6758
6758
|
svgContent,
|
|
@@ -6775,7 +6775,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6775
6775
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6776
6776
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6777
6777
|
const prevAnimateRef = useRef(animate);
|
|
6778
|
-
const setRef =
|
|
6778
|
+
const setRef = React82__default.useCallback(
|
|
6779
6779
|
(node) => {
|
|
6780
6780
|
containerRef.current = node;
|
|
6781
6781
|
if (typeof ref === "function") ref(node);
|
|
@@ -7000,9 +7000,9 @@ function ScoreDisplay({
|
|
|
7000
7000
|
...rest
|
|
7001
7001
|
}) {
|
|
7002
7002
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
7003
|
-
const [displayValue, setDisplayValue] =
|
|
7004
|
-
const [isAnimating, setIsAnimating] =
|
|
7005
|
-
|
|
7003
|
+
const [displayValue, setDisplayValue] = React82.useState(resolvedValue);
|
|
7004
|
+
const [isAnimating, setIsAnimating] = React82.useState(false);
|
|
7005
|
+
React82.useEffect(() => {
|
|
7006
7006
|
if (!animated || displayValue === resolvedValue) {
|
|
7007
7007
|
setDisplayValue(resolvedValue);
|
|
7008
7008
|
return;
|
|
@@ -7073,9 +7073,9 @@ function ControlButton({
|
|
|
7073
7073
|
className
|
|
7074
7074
|
}) {
|
|
7075
7075
|
const eventBus = useEventBus();
|
|
7076
|
-
const [isPressed, setIsPressed] =
|
|
7076
|
+
const [isPressed, setIsPressed] = React82.useState(false);
|
|
7077
7077
|
const actualPressed = pressed ?? isPressed;
|
|
7078
|
-
const handlePointerDown =
|
|
7078
|
+
const handlePointerDown = React82.useCallback(
|
|
7079
7079
|
(e) => {
|
|
7080
7080
|
e.preventDefault();
|
|
7081
7081
|
if (disabled) return;
|
|
@@ -7085,7 +7085,7 @@ function ControlButton({
|
|
|
7085
7085
|
},
|
|
7086
7086
|
[disabled, pressEvent, eventBus, onPress]
|
|
7087
7087
|
);
|
|
7088
|
-
const handlePointerUp =
|
|
7088
|
+
const handlePointerUp = React82.useCallback(
|
|
7089
7089
|
(e) => {
|
|
7090
7090
|
e.preventDefault();
|
|
7091
7091
|
if (disabled) return;
|
|
@@ -7095,7 +7095,7 @@ function ControlButton({
|
|
|
7095
7095
|
},
|
|
7096
7096
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
7097
7097
|
);
|
|
7098
|
-
const handlePointerLeave =
|
|
7098
|
+
const handlePointerLeave = React82.useCallback(
|
|
7099
7099
|
(e) => {
|
|
7100
7100
|
if (isPressed) {
|
|
7101
7101
|
setIsPressed(false);
|
|
@@ -7598,8 +7598,8 @@ function XPBar({
|
|
|
7598
7598
|
}) {
|
|
7599
7599
|
const sizes = sizeMap9[size];
|
|
7600
7600
|
const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
|
|
7601
|
-
const [fillWidth, setFillWidth] =
|
|
7602
|
-
|
|
7601
|
+
const [fillWidth, setFillWidth] = React82.useState(animated ? 0 : percentage);
|
|
7602
|
+
React82.useEffect(() => {
|
|
7603
7603
|
if (!animated) {
|
|
7604
7604
|
setFillWidth(percentage);
|
|
7605
7605
|
return;
|
|
@@ -8036,9 +8036,9 @@ function MiniMap({
|
|
|
8036
8036
|
viewportRect,
|
|
8037
8037
|
className
|
|
8038
8038
|
}) {
|
|
8039
|
-
const canvasRef =
|
|
8040
|
-
const frameRef =
|
|
8041
|
-
|
|
8039
|
+
const canvasRef = React82.useRef(null);
|
|
8040
|
+
const frameRef = React82.useRef(0);
|
|
8041
|
+
React82.useEffect(() => {
|
|
8042
8042
|
const canvas = canvasRef.current;
|
|
8043
8043
|
if (!canvas) return;
|
|
8044
8044
|
const ctx = canvas.getContext("2d");
|
|
@@ -8212,7 +8212,7 @@ var init_ErrorBoundary = __esm({
|
|
|
8212
8212
|
}
|
|
8213
8213
|
);
|
|
8214
8214
|
};
|
|
8215
|
-
ErrorBoundary = class extends
|
|
8215
|
+
ErrorBoundary = class extends React82__default.Component {
|
|
8216
8216
|
constructor(props) {
|
|
8217
8217
|
super(props);
|
|
8218
8218
|
__publicField(this, "reset", () => {
|
|
@@ -9247,8 +9247,8 @@ function ActionButtons({
|
|
|
9247
9247
|
disabled
|
|
9248
9248
|
}) {
|
|
9249
9249
|
const eventBus = useEventBus();
|
|
9250
|
-
const [activeButtons, setActiveButtons] =
|
|
9251
|
-
const handlePress =
|
|
9250
|
+
const [activeButtons, setActiveButtons] = React82.useState(/* @__PURE__ */ new Set());
|
|
9251
|
+
const handlePress = React82.useCallback(
|
|
9252
9252
|
(id) => {
|
|
9253
9253
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
9254
9254
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -9256,7 +9256,7 @@ function ActionButtons({
|
|
|
9256
9256
|
},
|
|
9257
9257
|
[actionEvent, eventBus, onAction]
|
|
9258
9258
|
);
|
|
9259
|
-
const handleRelease =
|
|
9259
|
+
const handleRelease = React82.useCallback(
|
|
9260
9260
|
(id) => {
|
|
9261
9261
|
setActiveButtons((prev) => {
|
|
9262
9262
|
const next = new Set(prev);
|
|
@@ -9452,6 +9452,85 @@ var init_ActionPalette = __esm({
|
|
|
9452
9452
|
ActionPalette.displayName = "ActionPalette";
|
|
9453
9453
|
}
|
|
9454
9454
|
});
|
|
9455
|
+
var ActivationBlock;
|
|
9456
|
+
var init_ActivationBlock = __esm({
|
|
9457
|
+
"components/core/molecules/ActivationBlock.tsx"() {
|
|
9458
|
+
"use client";
|
|
9459
|
+
init_useEventBus();
|
|
9460
|
+
init_cn();
|
|
9461
|
+
ActivationBlock = ({
|
|
9462
|
+
question,
|
|
9463
|
+
savedResponse,
|
|
9464
|
+
saveEvent = "SAVE_ACTIVATION",
|
|
9465
|
+
className
|
|
9466
|
+
}) => {
|
|
9467
|
+
const [response, setResponse] = useState(savedResponse ?? "");
|
|
9468
|
+
const [isExpanded, setIsExpanded] = useState(!savedResponse);
|
|
9469
|
+
const { emit } = useEventBus();
|
|
9470
|
+
const handleSubmit = () => {
|
|
9471
|
+
emit(`UI:${saveEvent}`, { response });
|
|
9472
|
+
setIsExpanded(false);
|
|
9473
|
+
};
|
|
9474
|
+
return /* @__PURE__ */ jsx(
|
|
9475
|
+
"div",
|
|
9476
|
+
{
|
|
9477
|
+
className: cn(
|
|
9478
|
+
"bg-indigo-50 dark:bg-indigo-900/20 border-2 border-indigo-200 dark:border-indigo-800 rounded-lg p-5 mb-6",
|
|
9479
|
+
className
|
|
9480
|
+
),
|
|
9481
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
9482
|
+
/* @__PURE__ */ jsx(Lightbulb, { className: "text-indigo-600 dark:text-indigo-400 flex-shrink-0 mt-1", size: 24 }),
|
|
9483
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
9484
|
+
/* @__PURE__ */ jsx("h4", { className: "font-semibold text-indigo-900 dark:text-indigo-100 mb-2", children: "Before You Begin..." }),
|
|
9485
|
+
/* @__PURE__ */ jsx("p", { className: "text-gray-700 dark:text-gray-300 mb-3 text-sm md:text-base", children: question }),
|
|
9486
|
+
isExpanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9487
|
+
/* @__PURE__ */ jsx(
|
|
9488
|
+
"textarea",
|
|
9489
|
+
{
|
|
9490
|
+
className: "w-full p-3 border border-indigo-300 dark:border-indigo-700 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-indigo-500 focus:border-transparent text-sm",
|
|
9491
|
+
placeholder: "Jot down your thoughts...",
|
|
9492
|
+
value: response,
|
|
9493
|
+
onChange: (e) => setResponse(e.target.value),
|
|
9494
|
+
rows: 3
|
|
9495
|
+
}
|
|
9496
|
+
),
|
|
9497
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2 mt-3", children: [
|
|
9498
|
+
/* @__PURE__ */ jsx(
|
|
9499
|
+
"button",
|
|
9500
|
+
{
|
|
9501
|
+
onClick: handleSubmit,
|
|
9502
|
+
className: "px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 text-sm font-medium transition-colors",
|
|
9503
|
+
children: "Continue to Lesson \u2192"
|
|
9504
|
+
}
|
|
9505
|
+
),
|
|
9506
|
+
/* @__PURE__ */ jsx(
|
|
9507
|
+
"button",
|
|
9508
|
+
{
|
|
9509
|
+
onClick: () => {
|
|
9510
|
+
emit(`UI:${saveEvent}`, { response: "" });
|
|
9511
|
+
setIsExpanded(false);
|
|
9512
|
+
},
|
|
9513
|
+
className: "px-4 py-2 text-indigo-600 dark:text-indigo-400 hover:underline text-sm",
|
|
9514
|
+
children: "Skip for now"
|
|
9515
|
+
}
|
|
9516
|
+
)
|
|
9517
|
+
] })
|
|
9518
|
+
] }) : /* @__PURE__ */ jsx(
|
|
9519
|
+
"button",
|
|
9520
|
+
{
|
|
9521
|
+
onClick: () => setIsExpanded(true),
|
|
9522
|
+
className: "text-sm text-indigo-600 dark:text-indigo-400 hover:underline font-medium",
|
|
9523
|
+
children: "\u2713 Answered \xB7 Edit response"
|
|
9524
|
+
}
|
|
9525
|
+
)
|
|
9526
|
+
] })
|
|
9527
|
+
] })
|
|
9528
|
+
}
|
|
9529
|
+
);
|
|
9530
|
+
};
|
|
9531
|
+
ActivationBlock.displayName = "ActivationBlock";
|
|
9532
|
+
}
|
|
9533
|
+
});
|
|
9455
9534
|
var variantBorderClasses, variantIconColors, iconMap2, Alert;
|
|
9456
9535
|
var init_Alert = __esm({
|
|
9457
9536
|
"components/core/molecules/Alert.tsx"() {
|
|
@@ -12477,102 +12556,6 @@ var init_BehaviorView = __esm({
|
|
|
12477
12556
|
BehaviorView.displayName = "BehaviorView";
|
|
12478
12557
|
}
|
|
12479
12558
|
});
|
|
12480
|
-
var MIN_DIAGRAM_WIDTH, ScaledDiagram;
|
|
12481
|
-
var init_ScaledDiagram = __esm({
|
|
12482
|
-
"components/core/molecules/ScaledDiagram.tsx"() {
|
|
12483
|
-
init_Box();
|
|
12484
|
-
init_cn();
|
|
12485
|
-
MIN_DIAGRAM_WIDTH = 200;
|
|
12486
|
-
ScaledDiagram = ({
|
|
12487
|
-
children,
|
|
12488
|
-
className
|
|
12489
|
-
}) => {
|
|
12490
|
-
const { t: _t } = useTranslate();
|
|
12491
|
-
const wrapperRef = useRef(null);
|
|
12492
|
-
const contentRef = useRef(null);
|
|
12493
|
-
const [layout, setLayout] = useState(null);
|
|
12494
|
-
const measure = useCallback(() => {
|
|
12495
|
-
const wrapper = wrapperRef.current;
|
|
12496
|
-
const content = contentRef.current;
|
|
12497
|
-
if (!wrapper || !content) return;
|
|
12498
|
-
const containerW = wrapper.clientWidth;
|
|
12499
|
-
if (containerW <= 0) return;
|
|
12500
|
-
let diagramW = 0;
|
|
12501
|
-
let diagramH = 0;
|
|
12502
|
-
const children2 = content.children;
|
|
12503
|
-
for (let i = 0; i < children2.length; i++) {
|
|
12504
|
-
const child = children2[i];
|
|
12505
|
-
const w = child.style?.width;
|
|
12506
|
-
const h = child.style?.height;
|
|
12507
|
-
if (w && /^\d+/.test(w) && h && /^\d+/.test(h)) {
|
|
12508
|
-
diagramW = parseFloat(w);
|
|
12509
|
-
diagramH = parseFloat(h);
|
|
12510
|
-
break;
|
|
12511
|
-
}
|
|
12512
|
-
if (child.offsetWidth > MIN_DIAGRAM_WIDTH) {
|
|
12513
|
-
diagramW = child.offsetWidth;
|
|
12514
|
-
diagramH = child.offsetHeight;
|
|
12515
|
-
break;
|
|
12516
|
-
}
|
|
12517
|
-
}
|
|
12518
|
-
if (diagramW < MIN_DIAGRAM_WIDTH || diagramH <= 0) {
|
|
12519
|
-
setLayout(null);
|
|
12520
|
-
return;
|
|
12521
|
-
}
|
|
12522
|
-
const s = Math.min(1, containerW / diagramW);
|
|
12523
|
-
setLayout({ scale: s, height: diagramH * s });
|
|
12524
|
-
}, []);
|
|
12525
|
-
useEffect(() => {
|
|
12526
|
-
const content = contentRef.current;
|
|
12527
|
-
if (!content) return;
|
|
12528
|
-
let raf1 = requestAnimationFrame(() => {
|
|
12529
|
-
requestAnimationFrame(() => measure());
|
|
12530
|
-
});
|
|
12531
|
-
const mo = new MutationObserver(() => {
|
|
12532
|
-
requestAnimationFrame(() => measure());
|
|
12533
|
-
});
|
|
12534
|
-
mo.observe(content, { childList: true, subtree: true, attributes: true });
|
|
12535
|
-
return () => {
|
|
12536
|
-
cancelAnimationFrame(raf1);
|
|
12537
|
-
mo.disconnect();
|
|
12538
|
-
};
|
|
12539
|
-
}, [measure, children]);
|
|
12540
|
-
useEffect(() => {
|
|
12541
|
-
const wrapper = wrapperRef.current;
|
|
12542
|
-
if (!wrapper) return;
|
|
12543
|
-
const ro = new ResizeObserver(() => measure());
|
|
12544
|
-
ro.observe(wrapper);
|
|
12545
|
-
return () => ro.disconnect();
|
|
12546
|
-
}, [measure]);
|
|
12547
|
-
const hasLayout = layout !== null;
|
|
12548
|
-
return /* @__PURE__ */ jsx(
|
|
12549
|
-
Box,
|
|
12550
|
-
{
|
|
12551
|
-
ref: wrapperRef,
|
|
12552
|
-
className: cn("w-full", className),
|
|
12553
|
-
style: {
|
|
12554
|
-
// Only clip overflow once we have a valid measurement
|
|
12555
|
-
overflow: hasLayout ? "hidden" : void 0,
|
|
12556
|
-
height: hasLayout ? layout.height : void 0
|
|
12557
|
-
},
|
|
12558
|
-
children: /* @__PURE__ */ jsx(
|
|
12559
|
-
Box,
|
|
12560
|
-
{
|
|
12561
|
-
ref: contentRef,
|
|
12562
|
-
style: {
|
|
12563
|
-
width: "max-content",
|
|
12564
|
-
transformOrigin: "top left",
|
|
12565
|
-
transform: hasLayout && layout.scale < 1 ? `scale(${layout.scale})` : void 0
|
|
12566
|
-
},
|
|
12567
|
-
children
|
|
12568
|
-
}
|
|
12569
|
-
)
|
|
12570
|
-
}
|
|
12571
|
-
);
|
|
12572
|
-
};
|
|
12573
|
-
ScaledDiagram.displayName = "ScaledDiagram";
|
|
12574
|
-
}
|
|
12575
|
-
});
|
|
12576
12559
|
|
|
12577
12560
|
// node_modules/katex/dist/katex.min.css
|
|
12578
12561
|
var init_katex_min = __esm({
|
|
@@ -13012,7 +12995,7 @@ var init_CodeBlock = __esm({
|
|
|
13012
12995
|
};
|
|
13013
12996
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
13014
12997
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
13015
|
-
CodeBlock =
|
|
12998
|
+
CodeBlock = React82__default.memo(
|
|
13016
12999
|
({
|
|
13017
13000
|
code: rawCode,
|
|
13018
13001
|
language = "text",
|
|
@@ -13599,7 +13582,7 @@ var init_MarkdownContent = __esm({
|
|
|
13599
13582
|
init_Box();
|
|
13600
13583
|
init_CodeBlock();
|
|
13601
13584
|
init_cn();
|
|
13602
|
-
MarkdownContent =
|
|
13585
|
+
MarkdownContent = React82__default.memo(
|
|
13603
13586
|
({ content, direction = "ltr", className }) => {
|
|
13604
13587
|
const { t: _t } = useTranslate();
|
|
13605
13588
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -13764,6 +13747,227 @@ var init_MarkdownContent = __esm({
|
|
|
13764
13747
|
MarkdownContent.displayName = "MarkdownContent";
|
|
13765
13748
|
}
|
|
13766
13749
|
});
|
|
13750
|
+
|
|
13751
|
+
// components/core/molecules/lessonSegmentUtils.ts
|
|
13752
|
+
function parseMarkdownWithCodeBlocks(content) {
|
|
13753
|
+
const segments = [];
|
|
13754
|
+
const codeBlockRegex = /```([\w-]+)?(?:\s+(run))?\n([\s\S]*?)```/g;
|
|
13755
|
+
let lastIndex = 0;
|
|
13756
|
+
let match;
|
|
13757
|
+
while ((match = codeBlockRegex.exec(content)) !== null) {
|
|
13758
|
+
const before = content.slice(lastIndex, match.index);
|
|
13759
|
+
if (before.trim()) {
|
|
13760
|
+
segments.push({ type: "markdown", content: before });
|
|
13761
|
+
}
|
|
13762
|
+
const rawLanguage = match[1] ?? "text";
|
|
13763
|
+
const runModifier = !!match[2];
|
|
13764
|
+
const suffixRunnable = rawLanguage.endsWith("-runnable");
|
|
13765
|
+
const runnable = runModifier || suffixRunnable;
|
|
13766
|
+
const baseLanguage = suffixRunnable ? rawLanguage.slice(0, -"-runnable".length) || "text" : rawLanguage;
|
|
13767
|
+
segments.push({ type: "code", language: baseLanguage, content: match[3].trim(), runnable });
|
|
13768
|
+
lastIndex = codeBlockRegex.lastIndex;
|
|
13769
|
+
}
|
|
13770
|
+
const remaining = content.slice(lastIndex);
|
|
13771
|
+
if (remaining.trim()) {
|
|
13772
|
+
segments.push({ type: "markdown", content: remaining });
|
|
13773
|
+
}
|
|
13774
|
+
return segments;
|
|
13775
|
+
}
|
|
13776
|
+
var init_lessonSegmentUtils = __esm({
|
|
13777
|
+
"components/core/molecules/lessonSegmentUtils.ts"() {
|
|
13778
|
+
}
|
|
13779
|
+
});
|
|
13780
|
+
var BLOOM_CONFIG, BloomQuizBlock;
|
|
13781
|
+
var init_BloomQuizBlock = __esm({
|
|
13782
|
+
"components/core/molecules/BloomQuizBlock.tsx"() {
|
|
13783
|
+
"use client";
|
|
13784
|
+
init_MarkdownContent();
|
|
13785
|
+
init_CodeBlock();
|
|
13786
|
+
init_lessonSegmentUtils();
|
|
13787
|
+
init_useEventBus();
|
|
13788
|
+
init_cn();
|
|
13789
|
+
BLOOM_CONFIG = {
|
|
13790
|
+
remember: { color: "bg-gray-500", bgColor: "bg-gray-50 dark:bg-gray-900/30", label: "Remember" },
|
|
13791
|
+
understand: { color: "bg-blue-500", bgColor: "bg-blue-50 dark:bg-blue-900/30", label: "Understand" },
|
|
13792
|
+
apply: { color: "bg-green-500", bgColor: "bg-green-50 dark:bg-green-900/30", label: "Apply" },
|
|
13793
|
+
analyze: { color: "bg-yellow-500", bgColor: "bg-yellow-50 dark:bg-yellow-900/30", label: "Analyze" },
|
|
13794
|
+
evaluate: { color: "bg-orange-500", bgColor: "bg-orange-50 dark:bg-orange-900/30", label: "Evaluate" },
|
|
13795
|
+
create: { color: "bg-purple-500", bgColor: "bg-purple-50 dark:bg-purple-900/30", label: "Create" }
|
|
13796
|
+
};
|
|
13797
|
+
BloomQuizBlock = ({
|
|
13798
|
+
level,
|
|
13799
|
+
question,
|
|
13800
|
+
answer,
|
|
13801
|
+
index,
|
|
13802
|
+
isAnswered,
|
|
13803
|
+
answerEvent = "ANSWER_BLOOM",
|
|
13804
|
+
className
|
|
13805
|
+
}) => {
|
|
13806
|
+
const [revealed, setRevealed] = useState(false);
|
|
13807
|
+
const config = BLOOM_CONFIG[level];
|
|
13808
|
+
const { emit } = useEventBus();
|
|
13809
|
+
const questionSegments = useMemo(() => parseMarkdownWithCodeBlocks(question), [question]);
|
|
13810
|
+
const answerSegments = useMemo(() => parseMarkdownWithCodeBlocks(answer), [answer]);
|
|
13811
|
+
const handleReveal = () => {
|
|
13812
|
+
if (!revealed) {
|
|
13813
|
+
emit(`UI:${answerEvent}`, { index: index ?? 0, level });
|
|
13814
|
+
}
|
|
13815
|
+
setRevealed(!revealed);
|
|
13816
|
+
};
|
|
13817
|
+
return /* @__PURE__ */ jsxs(
|
|
13818
|
+
"div",
|
|
13819
|
+
{
|
|
13820
|
+
className: cn(
|
|
13821
|
+
"rounded-lg border border-indigo-100 dark:border-indigo-800 p-4 my-4 transition-all",
|
|
13822
|
+
config.bgColor,
|
|
13823
|
+
className
|
|
13824
|
+
),
|
|
13825
|
+
children: [
|
|
13826
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-3", children: [
|
|
13827
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
13828
|
+
index !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-gray-500 dark:text-gray-400 font-medium text-sm", children: [
|
|
13829
|
+
"Question ",
|
|
13830
|
+
index + 1
|
|
13831
|
+
] }),
|
|
13832
|
+
/* @__PURE__ */ jsx("span", { className: cn(config.color, "text-white text-xs px-2 py-1 rounded-full font-medium"), children: config.label })
|
|
13833
|
+
] }),
|
|
13834
|
+
isAnswered && /* @__PURE__ */ jsx(CheckCircle, { className: "text-green-600 dark:text-green-400 flex-shrink-0", size: 20 })
|
|
13835
|
+
] }),
|
|
13836
|
+
/* @__PURE__ */ jsx("div", { className: "font-semibold text-indigo-900 dark:text-indigo-200 mb-3 space-y-2", children: questionSegments.map(
|
|
13837
|
+
(segment, idx) => segment.type === "markdown" ? /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `q-md-${idx}`) : /* @__PURE__ */ jsx(
|
|
13838
|
+
CodeBlock,
|
|
13839
|
+
{
|
|
13840
|
+
language: segment.language ?? "text",
|
|
13841
|
+
code: segment.content
|
|
13842
|
+
},
|
|
13843
|
+
`q-code-${idx}`
|
|
13844
|
+
)
|
|
13845
|
+
) }),
|
|
13846
|
+
/* @__PURE__ */ jsx(
|
|
13847
|
+
"button",
|
|
13848
|
+
{
|
|
13849
|
+
type: "button",
|
|
13850
|
+
className: "inline-flex items-center rounded-md bg-indigo-600 dark:bg-indigo-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-indigo-700 dark:hover:bg-indigo-600 transition-colors",
|
|
13851
|
+
onClick: handleReveal,
|
|
13852
|
+
children: revealed ? "Hide Answer" : "Reveal Answer"
|
|
13853
|
+
}
|
|
13854
|
+
),
|
|
13855
|
+
revealed && /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-white/80 dark:bg-gray-800/80 p-3 text-sm text-slate-800 dark:text-gray-200 shadow-sm border border-indigo-100 dark:border-indigo-800 mt-3 space-y-2", children: [
|
|
13856
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-gray-600 dark:text-gray-400 mb-1 font-medium uppercase tracking-wide", children: "Answer:" }),
|
|
13857
|
+
answerSegments.map(
|
|
13858
|
+
(segment, idx) => segment.type === "markdown" ? /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `a-md-${idx}`) : /* @__PURE__ */ jsx(
|
|
13859
|
+
CodeBlock,
|
|
13860
|
+
{
|
|
13861
|
+
language: segment.language ?? "text",
|
|
13862
|
+
code: segment.content
|
|
13863
|
+
},
|
|
13864
|
+
`a-code-${idx}`
|
|
13865
|
+
)
|
|
13866
|
+
)
|
|
13867
|
+
] })
|
|
13868
|
+
]
|
|
13869
|
+
}
|
|
13870
|
+
);
|
|
13871
|
+
};
|
|
13872
|
+
BloomQuizBlock.displayName = "BloomQuizBlock";
|
|
13873
|
+
}
|
|
13874
|
+
});
|
|
13875
|
+
var MIN_DIAGRAM_WIDTH, ScaledDiagram;
|
|
13876
|
+
var init_ScaledDiagram = __esm({
|
|
13877
|
+
"components/core/molecules/ScaledDiagram.tsx"() {
|
|
13878
|
+
init_Box();
|
|
13879
|
+
init_cn();
|
|
13880
|
+
MIN_DIAGRAM_WIDTH = 200;
|
|
13881
|
+
ScaledDiagram = ({
|
|
13882
|
+
children,
|
|
13883
|
+
className
|
|
13884
|
+
}) => {
|
|
13885
|
+
const { t: _t } = useTranslate();
|
|
13886
|
+
const wrapperRef = useRef(null);
|
|
13887
|
+
const contentRef = useRef(null);
|
|
13888
|
+
const [layout, setLayout] = useState(null);
|
|
13889
|
+
const measure = useCallback(() => {
|
|
13890
|
+
const wrapper = wrapperRef.current;
|
|
13891
|
+
const content = contentRef.current;
|
|
13892
|
+
if (!wrapper || !content) return;
|
|
13893
|
+
const containerW = wrapper.clientWidth;
|
|
13894
|
+
if (containerW <= 0) return;
|
|
13895
|
+
let diagramW = 0;
|
|
13896
|
+
let diagramH = 0;
|
|
13897
|
+
const children2 = content.children;
|
|
13898
|
+
for (let i = 0; i < children2.length; i++) {
|
|
13899
|
+
const child = children2[i];
|
|
13900
|
+
const w = child.style?.width;
|
|
13901
|
+
const h = child.style?.height;
|
|
13902
|
+
if (w && /^\d+/.test(w) && h && /^\d+/.test(h)) {
|
|
13903
|
+
diagramW = parseFloat(w);
|
|
13904
|
+
diagramH = parseFloat(h);
|
|
13905
|
+
break;
|
|
13906
|
+
}
|
|
13907
|
+
if (child.offsetWidth > MIN_DIAGRAM_WIDTH) {
|
|
13908
|
+
diagramW = child.offsetWidth;
|
|
13909
|
+
diagramH = child.offsetHeight;
|
|
13910
|
+
break;
|
|
13911
|
+
}
|
|
13912
|
+
}
|
|
13913
|
+
if (diagramW < MIN_DIAGRAM_WIDTH || diagramH <= 0) {
|
|
13914
|
+
setLayout(null);
|
|
13915
|
+
return;
|
|
13916
|
+
}
|
|
13917
|
+
const s = Math.min(1, containerW / diagramW);
|
|
13918
|
+
setLayout({ scale: s, height: diagramH * s });
|
|
13919
|
+
}, []);
|
|
13920
|
+
useEffect(() => {
|
|
13921
|
+
const content = contentRef.current;
|
|
13922
|
+
if (!content) return;
|
|
13923
|
+
let raf1 = requestAnimationFrame(() => {
|
|
13924
|
+
requestAnimationFrame(() => measure());
|
|
13925
|
+
});
|
|
13926
|
+
const mo = new MutationObserver(() => {
|
|
13927
|
+
requestAnimationFrame(() => measure());
|
|
13928
|
+
});
|
|
13929
|
+
mo.observe(content, { childList: true, subtree: true, attributes: true });
|
|
13930
|
+
return () => {
|
|
13931
|
+
cancelAnimationFrame(raf1);
|
|
13932
|
+
mo.disconnect();
|
|
13933
|
+
};
|
|
13934
|
+
}, [measure, children]);
|
|
13935
|
+
useEffect(() => {
|
|
13936
|
+
const wrapper = wrapperRef.current;
|
|
13937
|
+
if (!wrapper) return;
|
|
13938
|
+
const ro = new ResizeObserver(() => measure());
|
|
13939
|
+
ro.observe(wrapper);
|
|
13940
|
+
return () => ro.disconnect();
|
|
13941
|
+
}, [measure]);
|
|
13942
|
+
const hasLayout = layout !== null;
|
|
13943
|
+
return /* @__PURE__ */ jsx(
|
|
13944
|
+
Box,
|
|
13945
|
+
{
|
|
13946
|
+
ref: wrapperRef,
|
|
13947
|
+
className: cn("w-full", className),
|
|
13948
|
+
style: {
|
|
13949
|
+
// Only clip overflow once we have a valid measurement
|
|
13950
|
+
overflow: hasLayout ? "hidden" : void 0,
|
|
13951
|
+
height: hasLayout ? layout.height : void 0
|
|
13952
|
+
},
|
|
13953
|
+
children: /* @__PURE__ */ jsx(
|
|
13954
|
+
Box,
|
|
13955
|
+
{
|
|
13956
|
+
ref: contentRef,
|
|
13957
|
+
style: {
|
|
13958
|
+
width: "max-content",
|
|
13959
|
+
transformOrigin: "top left",
|
|
13960
|
+
transform: hasLayout && layout.scale < 1 ? `scale(${layout.scale})` : void 0
|
|
13961
|
+
},
|
|
13962
|
+
children
|
|
13963
|
+
}
|
|
13964
|
+
)
|
|
13965
|
+
}
|
|
13966
|
+
);
|
|
13967
|
+
};
|
|
13968
|
+
ScaledDiagram.displayName = "ScaledDiagram";
|
|
13969
|
+
}
|
|
13970
|
+
});
|
|
13767
13971
|
function useLongPress(onLongPress, options = {}) {
|
|
13768
13972
|
const { duration = 500, moveThreshold = 10 } = options;
|
|
13769
13973
|
const timerRef = useRef(null);
|
|
@@ -14695,7 +14899,7 @@ var init_StateMachineView = __esm({
|
|
|
14695
14899
|
style: { top: title ? 30 : 0 },
|
|
14696
14900
|
children: [
|
|
14697
14901
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
14698
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
14902
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React82__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
14699
14903
|
StateNode,
|
|
14700
14904
|
{
|
|
14701
14905
|
state,
|
|
@@ -15410,7 +15614,7 @@ function tryParseOrbitalSchema(code) {
|
|
|
15410
15614
|
}
|
|
15411
15615
|
return null;
|
|
15412
15616
|
}
|
|
15413
|
-
function
|
|
15617
|
+
function parseMarkdownWithCodeBlocks2(content) {
|
|
15414
15618
|
if (!content) return [];
|
|
15415
15619
|
const segments = [];
|
|
15416
15620
|
const codeBlockRegex = /```(\w+)?\n([\s\S]*?)```/g;
|
|
@@ -15449,7 +15653,7 @@ function parseContentSegments(content) {
|
|
|
15449
15653
|
while ((match = tagRegex.exec(content)) !== null) {
|
|
15450
15654
|
const before = content.slice(lastIndex, match.index);
|
|
15451
15655
|
if (before.trim()) {
|
|
15452
|
-
segments.push(...
|
|
15656
|
+
segments.push(...parseMarkdownWithCodeBlocks2(before));
|
|
15453
15657
|
}
|
|
15454
15658
|
segments.push({
|
|
15455
15659
|
type: "quiz",
|
|
@@ -15460,7 +15664,7 @@ function parseContentSegments(content) {
|
|
|
15460
15664
|
}
|
|
15461
15665
|
const remaining = content.slice(lastIndex);
|
|
15462
15666
|
if (remaining.trim()) {
|
|
15463
|
-
segments.push(...
|
|
15667
|
+
segments.push(...parseMarkdownWithCodeBlocks2(remaining));
|
|
15464
15668
|
}
|
|
15465
15669
|
return segments;
|
|
15466
15670
|
}
|
|
@@ -20484,6 +20688,169 @@ var init_ClassifierBoard = __esm({
|
|
|
20484
20688
|
ClassifierBoard.displayName = "ClassifierBoard";
|
|
20485
20689
|
}
|
|
20486
20690
|
});
|
|
20691
|
+
var CodeRunnerPanel;
|
|
20692
|
+
var init_CodeRunnerPanel = __esm({
|
|
20693
|
+
"components/core/organisms/CodeRunnerPanel.tsx"() {
|
|
20694
|
+
"use client";
|
|
20695
|
+
init_Box();
|
|
20696
|
+
init_Button();
|
|
20697
|
+
init_Badge();
|
|
20698
|
+
init_Typography();
|
|
20699
|
+
init_Stack();
|
|
20700
|
+
init_CodeBlock();
|
|
20701
|
+
init_useEventBus();
|
|
20702
|
+
init_cn();
|
|
20703
|
+
CodeRunnerPanel = ({
|
|
20704
|
+
code: initialCode,
|
|
20705
|
+
language,
|
|
20706
|
+
runnable = true,
|
|
20707
|
+
onRun,
|
|
20708
|
+
runEvent = "RUN_CODE",
|
|
20709
|
+
className
|
|
20710
|
+
}) => {
|
|
20711
|
+
const eventBus = useEventBus();
|
|
20712
|
+
const { t } = useTranslate();
|
|
20713
|
+
const [code, setCode] = useState(initialCode);
|
|
20714
|
+
const [output, setOutput] = useState(null);
|
|
20715
|
+
const [error, setError] = useState(null);
|
|
20716
|
+
const [isRunning, setIsRunning] = useState(false);
|
|
20717
|
+
const handleRun = useCallback(async () => {
|
|
20718
|
+
if (!onRun) return;
|
|
20719
|
+
setIsRunning(true);
|
|
20720
|
+
setError(null);
|
|
20721
|
+
setOutput(null);
|
|
20722
|
+
try {
|
|
20723
|
+
const result = await onRun(code);
|
|
20724
|
+
setOutput(result);
|
|
20725
|
+
eventBus.emit(`UI:${runEvent}`, { language, exitCode: result.exitCode });
|
|
20726
|
+
} catch (err) {
|
|
20727
|
+
const message = err instanceof Error ? err.message : t("common.error");
|
|
20728
|
+
setError(message);
|
|
20729
|
+
eventBus.emit(`UI:${runEvent}`, { language, exitCode: 1, error: message });
|
|
20730
|
+
} finally {
|
|
20731
|
+
setIsRunning(false);
|
|
20732
|
+
}
|
|
20733
|
+
}, [code, language, onRun, runEvent, eventBus, t]);
|
|
20734
|
+
const handleReset = useCallback(() => {
|
|
20735
|
+
setCode(initialCode);
|
|
20736
|
+
setOutput(null);
|
|
20737
|
+
setError(null);
|
|
20738
|
+
}, [initialCode]);
|
|
20739
|
+
if (!runnable || !onRun) {
|
|
20740
|
+
return /* @__PURE__ */ jsx(Box, { className, children: /* @__PURE__ */ jsx(CodeBlock, { language, code }) });
|
|
20741
|
+
}
|
|
20742
|
+
const hasOutput = output !== null || error !== null;
|
|
20743
|
+
return /* @__PURE__ */ jsxs(Box, { className: cn("space-y-3", className), children: [
|
|
20744
|
+
/* @__PURE__ */ jsx(
|
|
20745
|
+
CodeBlock,
|
|
20746
|
+
{
|
|
20747
|
+
language,
|
|
20748
|
+
code,
|
|
20749
|
+
editable: true,
|
|
20750
|
+
onChange: setCode,
|
|
20751
|
+
showLanguageBadge: true,
|
|
20752
|
+
showCopyButton: true
|
|
20753
|
+
}
|
|
20754
|
+
),
|
|
20755
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "sm", justify: "between", children: [
|
|
20756
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "sm", children: [
|
|
20757
|
+
/* @__PURE__ */ jsx(
|
|
20758
|
+
Button,
|
|
20759
|
+
{
|
|
20760
|
+
variant: "primary",
|
|
20761
|
+
size: "sm",
|
|
20762
|
+
onClick: handleRun,
|
|
20763
|
+
disabled: isRunning,
|
|
20764
|
+
className: "min-w-[5rem]",
|
|
20765
|
+
children: isRunning ? /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
|
|
20766
|
+
/* @__PURE__ */ jsx(RotateCcw, { size: 16, className: "animate-spin" }),
|
|
20767
|
+
t("common.loading")
|
|
20768
|
+
] }) : /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
|
|
20769
|
+
/* @__PURE__ */ jsx(Play, { size: 16 }),
|
|
20770
|
+
"Run"
|
|
20771
|
+
] })
|
|
20772
|
+
}
|
|
20773
|
+
),
|
|
20774
|
+
/* @__PURE__ */ jsx(
|
|
20775
|
+
Button,
|
|
20776
|
+
{
|
|
20777
|
+
variant: "secondary",
|
|
20778
|
+
size: "sm",
|
|
20779
|
+
onClick: handleReset,
|
|
20780
|
+
disabled: isRunning,
|
|
20781
|
+
children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
|
|
20782
|
+
/* @__PURE__ */ jsx(RotateCcw, { size: 16 }),
|
|
20783
|
+
"Reset"
|
|
20784
|
+
] })
|
|
20785
|
+
}
|
|
20786
|
+
)
|
|
20787
|
+
] }),
|
|
20788
|
+
output && /* @__PURE__ */ jsxs(
|
|
20789
|
+
Badge,
|
|
20790
|
+
{
|
|
20791
|
+
variant: output.exitCode === 0 ? "success" : "danger",
|
|
20792
|
+
size: "sm",
|
|
20793
|
+
children: [
|
|
20794
|
+
"Exit ",
|
|
20795
|
+
output.exitCode
|
|
20796
|
+
]
|
|
20797
|
+
}
|
|
20798
|
+
)
|
|
20799
|
+
] }),
|
|
20800
|
+
hasOutput && /* @__PURE__ */ jsxs(Box, { className: "rounded-lg border border-gray-700 bg-[#0d0d0d] overflow-hidden", children: [
|
|
20801
|
+
/* @__PURE__ */ jsxs(
|
|
20802
|
+
HStack,
|
|
20803
|
+
{
|
|
20804
|
+
gap: "sm",
|
|
20805
|
+
align: "center",
|
|
20806
|
+
className: "px-3 py-2 bg-gray-800 border-b border-gray-700",
|
|
20807
|
+
children: [
|
|
20808
|
+
/* @__PURE__ */ jsx(Terminal, { size: 16, className: "text-gray-400" }),
|
|
20809
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-300 font-medium", children: "Output" })
|
|
20810
|
+
]
|
|
20811
|
+
}
|
|
20812
|
+
),
|
|
20813
|
+
/* @__PURE__ */ jsx(VStack, { gap: "none", className: "p-3 font-mono text-sm", children: error ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-red-400 whitespace-pre-wrap", children: error }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20814
|
+
output?.stdout ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-200 whitespace-pre-wrap", children: output.stdout }) : null,
|
|
20815
|
+
output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-red-400 whitespace-pre-wrap", children: output.stderr }) : null,
|
|
20816
|
+
!output?.stdout && !output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500 italic", children: "No output" }) : null,
|
|
20817
|
+
output && output.testResults.length > 0 && /* @__PURE__ */ jsx(Box, { className: "mt-3 pt-3 border-t border-gray-700 space-y-2", children: output.testResults.map((test, index) => /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "start", className: "text-xs", children: [
|
|
20818
|
+
test.passed ? /* @__PURE__ */ jsx(CheckCircle, { size: 14, className: "text-green-400 mt-0.5" }) : /* @__PURE__ */ jsx(XCircle, { size: 14, className: "text-red-400 mt-0.5" }),
|
|
20819
|
+
/* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1", children: [
|
|
20820
|
+
/* @__PURE__ */ jsxs(
|
|
20821
|
+
Typography,
|
|
20822
|
+
{
|
|
20823
|
+
variant: "small",
|
|
20824
|
+
className: test.passed ? "text-green-400" : "text-red-400",
|
|
20825
|
+
children: [
|
|
20826
|
+
"Test ",
|
|
20827
|
+
index + 1,
|
|
20828
|
+
": ",
|
|
20829
|
+
test.passed ? "passed" : "failed"
|
|
20830
|
+
]
|
|
20831
|
+
}
|
|
20832
|
+
),
|
|
20833
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
|
|
20834
|
+
"Input: ",
|
|
20835
|
+
test.input
|
|
20836
|
+
] }),
|
|
20837
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
|
|
20838
|
+
"Expected: ",
|
|
20839
|
+
test.expectedOutput
|
|
20840
|
+
] }),
|
|
20841
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
|
|
20842
|
+
"Actual: ",
|
|
20843
|
+
test.actualOutput
|
|
20844
|
+
] })
|
|
20845
|
+
] })
|
|
20846
|
+
] }, index)) })
|
|
20847
|
+
] }) })
|
|
20848
|
+
] })
|
|
20849
|
+
] });
|
|
20850
|
+
};
|
|
20851
|
+
CodeRunnerPanel.displayName = "CodeRunnerPanel";
|
|
20852
|
+
}
|
|
20853
|
+
});
|
|
20487
20854
|
function CombatLog({
|
|
20488
20855
|
events: events2,
|
|
20489
20856
|
maxVisible = 50,
|
|
@@ -20734,6 +21101,31 @@ var init_ConfirmDialog = __esm({
|
|
|
20734
21101
|
ConfirmDialog.displayName = "ConfirmDialog";
|
|
20735
21102
|
}
|
|
20736
21103
|
});
|
|
21104
|
+
var ConnectionBlock;
|
|
21105
|
+
var init_ConnectionBlock = __esm({
|
|
21106
|
+
"components/core/molecules/ConnectionBlock.tsx"() {
|
|
21107
|
+
"use client";
|
|
21108
|
+
init_MarkdownContent();
|
|
21109
|
+
init_cn();
|
|
21110
|
+
ConnectionBlock = ({ content, className }) => /* @__PURE__ */ jsx(
|
|
21111
|
+
"div",
|
|
21112
|
+
{
|
|
21113
|
+
className: cn(
|
|
21114
|
+
"bg-emerald-50 dark:bg-emerald-900/20 border-l-4 border-emerald-500 rounded-r-lg p-5 mb-6",
|
|
21115
|
+
className
|
|
21116
|
+
),
|
|
21117
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
21118
|
+
/* @__PURE__ */ jsx(Link2, { className: "text-emerald-600 dark:text-emerald-400 flex-shrink-0 mt-1", size: 20 }),
|
|
21119
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
21120
|
+
/* @__PURE__ */ jsx("h4", { className: "font-semibold text-emerald-900 dark:text-emerald-100 mb-2", children: "Building On What You Know" }),
|
|
21121
|
+
/* @__PURE__ */ jsx("div", { className: "prose dark:prose-invert prose-sm max-w-none text-gray-700 dark:text-gray-300", children: /* @__PURE__ */ jsx(MarkdownContent, { content }) })
|
|
21122
|
+
] })
|
|
21123
|
+
] })
|
|
21124
|
+
}
|
|
21125
|
+
);
|
|
21126
|
+
ConnectionBlock.displayName = "ConnectionBlock";
|
|
21127
|
+
}
|
|
21128
|
+
});
|
|
20737
21129
|
function CounterMinimal({
|
|
20738
21130
|
entity,
|
|
20739
21131
|
size = "md",
|
|
@@ -20958,7 +21350,7 @@ function CraftingRecipe({
|
|
|
20958
21350
|
className
|
|
20959
21351
|
}) {
|
|
20960
21352
|
const eventBus = useEventBus();
|
|
20961
|
-
const handleCraft =
|
|
21353
|
+
const handleCraft = React82.useCallback(() => {
|
|
20962
21354
|
onCraft?.();
|
|
20963
21355
|
if (craftEvent) {
|
|
20964
21356
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -20975,7 +21367,7 @@ function CraftingRecipe({
|
|
|
20975
21367
|
children: [
|
|
20976
21368
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
20977
21369
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
20978
|
-
return /* @__PURE__ */ jsxs(
|
|
21370
|
+
return /* @__PURE__ */ jsxs(React82.Fragment, { children: [
|
|
20979
21371
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
20980
21372
|
ItemSlot,
|
|
20981
21373
|
{
|
|
@@ -21038,8 +21430,8 @@ function DPad({
|
|
|
21038
21430
|
}) {
|
|
21039
21431
|
const eventBus = useEventBus();
|
|
21040
21432
|
const sizes = sizeMap15[size];
|
|
21041
|
-
const [activeDirections, setActiveDirections] =
|
|
21042
|
-
const handlePress =
|
|
21433
|
+
const [activeDirections, setActiveDirections] = React82.useState(/* @__PURE__ */ new Set());
|
|
21434
|
+
const handlePress = React82.useCallback(
|
|
21043
21435
|
(direction) => {
|
|
21044
21436
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
21045
21437
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -21047,7 +21439,7 @@ function DPad({
|
|
|
21047
21439
|
},
|
|
21048
21440
|
[directionEvent, eventBus, onDirection]
|
|
21049
21441
|
);
|
|
21050
|
-
const handleRelease =
|
|
21442
|
+
const handleRelease = React82.useCallback(
|
|
21051
21443
|
(direction) => {
|
|
21052
21444
|
setActiveDirections((prev) => {
|
|
21053
21445
|
const next = new Set(prev);
|
|
@@ -21854,8 +22246,8 @@ var init_Menu = __esm({
|
|
|
21854
22246
|
"bottom-end": "bottom-start"
|
|
21855
22247
|
};
|
|
21856
22248
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
21857
|
-
const triggerChild =
|
|
21858
|
-
const triggerElement =
|
|
22249
|
+
const triggerChild = React82__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
22250
|
+
const triggerElement = React82__default.cloneElement(
|
|
21859
22251
|
triggerChild,
|
|
21860
22252
|
{
|
|
21861
22253
|
ref: triggerRef,
|
|
@@ -21989,14 +22381,14 @@ function useDataDnd(args) {
|
|
|
21989
22381
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
21990
22382
|
const enabled = isZone || Boolean(dndRoot);
|
|
21991
22383
|
const eventBus = useEventBus();
|
|
21992
|
-
const parentRoot =
|
|
22384
|
+
const parentRoot = React82__default.useContext(RootCtx);
|
|
21993
22385
|
const isRoot = enabled && parentRoot === null;
|
|
21994
|
-
const zoneId =
|
|
22386
|
+
const zoneId = React82__default.useId();
|
|
21995
22387
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
21996
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
21997
|
-
const optimisticOrdersRef =
|
|
22388
|
+
const [optimisticOrders, setOptimisticOrders] = React82__default.useState(() => /* @__PURE__ */ new Map());
|
|
22389
|
+
const optimisticOrdersRef = React82__default.useRef(optimisticOrders);
|
|
21998
22390
|
optimisticOrdersRef.current = optimisticOrders;
|
|
21999
|
-
const clearOptimisticOrder =
|
|
22391
|
+
const clearOptimisticOrder = React82__default.useCallback((group) => {
|
|
22000
22392
|
setOptimisticOrders((prev) => {
|
|
22001
22393
|
if (!prev.has(group)) return prev;
|
|
22002
22394
|
const next = new Map(prev);
|
|
@@ -22021,7 +22413,7 @@ function useDataDnd(args) {
|
|
|
22021
22413
|
const raw = it[dndItemIdField];
|
|
22022
22414
|
return String(raw ?? `__idx_${idx}`);
|
|
22023
22415
|
}).join("|");
|
|
22024
|
-
const itemIds =
|
|
22416
|
+
const itemIds = React82__default.useMemo(
|
|
22025
22417
|
() => orderedItems.map((it, idx) => {
|
|
22026
22418
|
const raw = it[dndItemIdField];
|
|
22027
22419
|
return raw ?? `__idx_${idx}`;
|
|
@@ -22029,7 +22421,7 @@ function useDataDnd(args) {
|
|
|
22029
22421
|
[itemIdsSignature]
|
|
22030
22422
|
);
|
|
22031
22423
|
const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
|
|
22032
|
-
|
|
22424
|
+
React82__default.useEffect(() => {
|
|
22033
22425
|
const root = isRoot ? null : parentRoot;
|
|
22034
22426
|
if (root) {
|
|
22035
22427
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -22037,20 +22429,20 @@ function useDataDnd(args) {
|
|
|
22037
22429
|
clearOptimisticOrder(ownGroup);
|
|
22038
22430
|
}
|
|
22039
22431
|
}, [itemsContentSig, ownGroup]);
|
|
22040
|
-
const zonesRef =
|
|
22041
|
-
const registerZone =
|
|
22432
|
+
const zonesRef = React82__default.useRef(/* @__PURE__ */ new Map());
|
|
22433
|
+
const registerZone = React82__default.useCallback((zoneId2, meta2) => {
|
|
22042
22434
|
zonesRef.current.set(zoneId2, meta2);
|
|
22043
22435
|
}, []);
|
|
22044
|
-
const unregisterZone =
|
|
22436
|
+
const unregisterZone = React82__default.useCallback((zoneId2) => {
|
|
22045
22437
|
zonesRef.current.delete(zoneId2);
|
|
22046
22438
|
}, []);
|
|
22047
|
-
const [activeDrag, setActiveDrag] =
|
|
22048
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
22049
|
-
const meta =
|
|
22439
|
+
const [activeDrag, setActiveDrag] = React82__default.useState(null);
|
|
22440
|
+
const [overZoneGroup, setOverZoneGroup] = React82__default.useState(null);
|
|
22441
|
+
const meta = React82__default.useMemo(
|
|
22050
22442
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
22051
22443
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
22052
22444
|
);
|
|
22053
|
-
|
|
22445
|
+
React82__default.useEffect(() => {
|
|
22054
22446
|
const target = isRoot ? null : parentRoot;
|
|
22055
22447
|
if (!target) {
|
|
22056
22448
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -22069,7 +22461,7 @@ function useDataDnd(args) {
|
|
|
22069
22461
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
22070
22462
|
const sensors = useAlmadarDndSensors(true);
|
|
22071
22463
|
const collisionDetection = almadarDndCollisionDetection;
|
|
22072
|
-
const findZoneByItem =
|
|
22464
|
+
const findZoneByItem = React82__default.useCallback(
|
|
22073
22465
|
(id) => {
|
|
22074
22466
|
for (const z of zonesRef.current.values()) {
|
|
22075
22467
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -22078,7 +22470,7 @@ function useDataDnd(args) {
|
|
|
22078
22470
|
},
|
|
22079
22471
|
[]
|
|
22080
22472
|
);
|
|
22081
|
-
|
|
22473
|
+
React82__default.useCallback(
|
|
22082
22474
|
(group) => {
|
|
22083
22475
|
for (const z of zonesRef.current.values()) {
|
|
22084
22476
|
if (z.group === group) return z;
|
|
@@ -22087,7 +22479,7 @@ function useDataDnd(args) {
|
|
|
22087
22479
|
},
|
|
22088
22480
|
[]
|
|
22089
22481
|
);
|
|
22090
|
-
const handleDragEnd =
|
|
22482
|
+
const handleDragEnd = React82__default.useCallback(
|
|
22091
22483
|
(event) => {
|
|
22092
22484
|
const { active, over } = event;
|
|
22093
22485
|
const activeIdStr = String(active.id);
|
|
@@ -22178,8 +22570,8 @@ function useDataDnd(args) {
|
|
|
22178
22570
|
},
|
|
22179
22571
|
[eventBus]
|
|
22180
22572
|
);
|
|
22181
|
-
const sortableData =
|
|
22182
|
-
const SortableItem =
|
|
22573
|
+
const sortableData = React82__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
22574
|
+
const SortableItem = React82__default.useCallback(
|
|
22183
22575
|
({ id, children }) => {
|
|
22184
22576
|
const {
|
|
22185
22577
|
attributes,
|
|
@@ -22219,7 +22611,7 @@ function useDataDnd(args) {
|
|
|
22219
22611
|
id: droppableId,
|
|
22220
22612
|
data: sortableData
|
|
22221
22613
|
});
|
|
22222
|
-
const ctx =
|
|
22614
|
+
const ctx = React82__default.useContext(RootCtx);
|
|
22223
22615
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
22224
22616
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
22225
22617
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -22234,7 +22626,7 @@ function useDataDnd(args) {
|
|
|
22234
22626
|
showForeignPlaceholder,
|
|
22235
22627
|
ctxAvailable: ctx != null
|
|
22236
22628
|
});
|
|
22237
|
-
|
|
22629
|
+
React82__default.useEffect(() => {
|
|
22238
22630
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
22239
22631
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
22240
22632
|
return /* @__PURE__ */ jsx(
|
|
@@ -22248,11 +22640,11 @@ function useDataDnd(args) {
|
|
|
22248
22640
|
}
|
|
22249
22641
|
);
|
|
22250
22642
|
};
|
|
22251
|
-
const rootContextValue =
|
|
22643
|
+
const rootContextValue = React82__default.useMemo(
|
|
22252
22644
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
22253
22645
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
22254
22646
|
);
|
|
22255
|
-
const handleDragStart =
|
|
22647
|
+
const handleDragStart = React82__default.useCallback((event) => {
|
|
22256
22648
|
const sourceZone = findZoneByItem(event.active.id);
|
|
22257
22649
|
const rect = event.active.rect.current.initial;
|
|
22258
22650
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -22271,7 +22663,7 @@ function useDataDnd(args) {
|
|
|
22271
22663
|
isRoot
|
|
22272
22664
|
});
|
|
22273
22665
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
22274
|
-
const handleDragOver =
|
|
22666
|
+
const handleDragOver = React82__default.useCallback((event) => {
|
|
22275
22667
|
const { active, over } = event;
|
|
22276
22668
|
const overData = over?.data?.current;
|
|
22277
22669
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -22341,7 +22733,7 @@ function useDataDnd(args) {
|
|
|
22341
22733
|
return next;
|
|
22342
22734
|
});
|
|
22343
22735
|
}, []);
|
|
22344
|
-
const handleDragCancel =
|
|
22736
|
+
const handleDragCancel = React82__default.useCallback((event) => {
|
|
22345
22737
|
setActiveDrag(null);
|
|
22346
22738
|
setOverZoneGroup(null);
|
|
22347
22739
|
dndLog.warn("dragCancel", {
|
|
@@ -22349,12 +22741,12 @@ function useDataDnd(args) {
|
|
|
22349
22741
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
22350
22742
|
});
|
|
22351
22743
|
}, []);
|
|
22352
|
-
const handleDragEndWithCleanup =
|
|
22744
|
+
const handleDragEndWithCleanup = React82__default.useCallback((event) => {
|
|
22353
22745
|
handleDragEnd(event);
|
|
22354
22746
|
setActiveDrag(null);
|
|
22355
22747
|
setOverZoneGroup(null);
|
|
22356
22748
|
}, [handleDragEnd]);
|
|
22357
|
-
const wrapContainer =
|
|
22749
|
+
const wrapContainer = React82__default.useCallback(
|
|
22358
22750
|
(children) => {
|
|
22359
22751
|
if (!enabled) return children;
|
|
22360
22752
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -22408,7 +22800,7 @@ var init_useDataDnd = __esm({
|
|
|
22408
22800
|
init_useAlmadarDndCollision();
|
|
22409
22801
|
init_Box();
|
|
22410
22802
|
dndLog = createLogger("almadar:ui:dnd");
|
|
22411
|
-
RootCtx =
|
|
22803
|
+
RootCtx = React82__default.createContext(null);
|
|
22412
22804
|
}
|
|
22413
22805
|
});
|
|
22414
22806
|
function renderIconInput(icon, props) {
|
|
@@ -22934,7 +23326,7 @@ function DataList({
|
|
|
22934
23326
|
}) {
|
|
22935
23327
|
const eventBus = useEventBus();
|
|
22936
23328
|
const { t } = useTranslate();
|
|
22937
|
-
const [visibleCount, setVisibleCount] =
|
|
23329
|
+
const [visibleCount, setVisibleCount] = React82__default.useState(pageSize || Infinity);
|
|
22938
23330
|
const fieldDefs = fields ?? columns ?? [];
|
|
22939
23331
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
22940
23332
|
const dnd = useDataDnd({
|
|
@@ -22953,7 +23345,7 @@ function DataList({
|
|
|
22953
23345
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
22954
23346
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
22955
23347
|
const hasRenderProp = typeof children === "function";
|
|
22956
|
-
|
|
23348
|
+
React82__default.useEffect(() => {
|
|
22957
23349
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
22958
23350
|
const childrenTypeOf = typeof children;
|
|
22959
23351
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -23058,7 +23450,7 @@ function DataList({
|
|
|
23058
23450
|
const items2 = data.map((item) => item);
|
|
23059
23451
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
23060
23452
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
23061
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
23453
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
23062
23454
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
23063
23455
|
group.items.map((itemData, index) => {
|
|
23064
23456
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -23199,7 +23591,7 @@ function DataList({
|
|
|
23199
23591
|
className
|
|
23200
23592
|
),
|
|
23201
23593
|
children: [
|
|
23202
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
23594
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
23203
23595
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
23204
23596
|
group.items.map(
|
|
23205
23597
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -24115,7 +24507,7 @@ var init_Grid = __esm({
|
|
|
24115
24507
|
as: Component = "div"
|
|
24116
24508
|
}) => {
|
|
24117
24509
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
24118
|
-
return
|
|
24510
|
+
return React82__default.createElement(
|
|
24119
24511
|
Component,
|
|
24120
24512
|
{
|
|
24121
24513
|
className: cn(
|
|
@@ -24303,8 +24695,8 @@ var init_Popover = __esm({
|
|
|
24303
24695
|
onMouseEnter: handleOpen,
|
|
24304
24696
|
onMouseLeave: handleClose
|
|
24305
24697
|
};
|
|
24306
|
-
const childElement =
|
|
24307
|
-
const triggerElement =
|
|
24698
|
+
const childElement = React82__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
24699
|
+
const triggerElement = React82__default.cloneElement(
|
|
24308
24700
|
childElement,
|
|
24309
24701
|
{
|
|
24310
24702
|
ref: triggerRef,
|
|
@@ -24894,8 +25286,8 @@ var init_Tooltip = __esm({
|
|
|
24894
25286
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
24895
25287
|
};
|
|
24896
25288
|
}, []);
|
|
24897
|
-
const triggerElement =
|
|
24898
|
-
const trigger =
|
|
25289
|
+
const triggerElement = React82__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
25290
|
+
const trigger = React82__default.cloneElement(triggerElement, {
|
|
24899
25291
|
ref: triggerRef,
|
|
24900
25292
|
onMouseEnter: handleMouseEnter,
|
|
24901
25293
|
onMouseLeave: handleMouseLeave,
|
|
@@ -24981,7 +25373,7 @@ var init_WizardProgress = __esm({
|
|
|
24981
25373
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
24982
25374
|
const isActive = index === currentStep;
|
|
24983
25375
|
const isCompleted = index < currentStep;
|
|
24984
|
-
return /* @__PURE__ */ jsxs(
|
|
25376
|
+
return /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
24985
25377
|
/* @__PURE__ */ jsx(
|
|
24986
25378
|
"button",
|
|
24987
25379
|
{
|
|
@@ -26033,7 +26425,7 @@ function InventoryGrid({
|
|
|
26033
26425
|
const eventBus = useEventBus();
|
|
26034
26426
|
const slotCount = totalSlots ?? items.length;
|
|
26035
26427
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
26036
|
-
const handleSelect =
|
|
26428
|
+
const handleSelect = React82.useCallback(
|
|
26037
26429
|
(id) => {
|
|
26038
26430
|
onSelect?.(id);
|
|
26039
26431
|
if (selectEvent) {
|
|
@@ -26250,31 +26642,31 @@ function GameCanvas2D({
|
|
|
26250
26642
|
assetBaseUrl = "https://almadar-kflow-assets.web.app/shared/",
|
|
26251
26643
|
className
|
|
26252
26644
|
}) {
|
|
26253
|
-
const canvasRef =
|
|
26254
|
-
const rafRef =
|
|
26255
|
-
const frameRef =
|
|
26256
|
-
const lastTimeRef =
|
|
26257
|
-
const imageCache =
|
|
26645
|
+
const canvasRef = React82.useRef(null);
|
|
26646
|
+
const rafRef = React82.useRef(0);
|
|
26647
|
+
const frameRef = React82.useRef(0);
|
|
26648
|
+
const lastTimeRef = React82.useRef(0);
|
|
26649
|
+
const imageCache = React82.useRef(/* @__PURE__ */ new Map());
|
|
26258
26650
|
const emit = useEmitEvent();
|
|
26259
|
-
const onDrawRef =
|
|
26651
|
+
const onDrawRef = React82.useRef(onDraw);
|
|
26260
26652
|
onDrawRef.current = onDraw;
|
|
26261
|
-
const onTickRef =
|
|
26653
|
+
const onTickRef = React82.useRef(onTick);
|
|
26262
26654
|
onTickRef.current = onTick;
|
|
26263
|
-
const tickEventRef =
|
|
26655
|
+
const tickEventRef = React82.useRef(tickEvent);
|
|
26264
26656
|
tickEventRef.current = tickEvent;
|
|
26265
|
-
const drawEventRef =
|
|
26657
|
+
const drawEventRef = React82.useRef(drawEvent);
|
|
26266
26658
|
drawEventRef.current = drawEvent;
|
|
26267
|
-
const emitRef =
|
|
26659
|
+
const emitRef = React82.useRef(emit);
|
|
26268
26660
|
emitRef.current = emit;
|
|
26269
|
-
const assetBaseUrlRef =
|
|
26661
|
+
const assetBaseUrlRef = React82.useRef(assetBaseUrl);
|
|
26270
26662
|
assetBaseUrlRef.current = assetBaseUrl;
|
|
26271
|
-
const backgroundImageRef =
|
|
26663
|
+
const backgroundImageRef = React82.useRef(backgroundImage);
|
|
26272
26664
|
backgroundImageRef.current = backgroundImage;
|
|
26273
|
-
const widthRef =
|
|
26665
|
+
const widthRef = React82.useRef(width);
|
|
26274
26666
|
widthRef.current = width;
|
|
26275
|
-
const heightRef =
|
|
26667
|
+
const heightRef = React82.useRef(height);
|
|
26276
26668
|
heightRef.current = height;
|
|
26277
|
-
const loadImage =
|
|
26669
|
+
const loadImage = React82.useCallback((url) => {
|
|
26278
26670
|
const fullUrl = url.startsWith("http") ? url : `${assetBaseUrlRef.current}${url}`;
|
|
26279
26671
|
const cached = imageCache.current.get(fullUrl);
|
|
26280
26672
|
if (cached?.complete && cached.naturalWidth > 0) return cached;
|
|
@@ -26286,7 +26678,7 @@ function GameCanvas2D({
|
|
|
26286
26678
|
}
|
|
26287
26679
|
return null;
|
|
26288
26680
|
}, []);
|
|
26289
|
-
|
|
26681
|
+
React82.useEffect(() => {
|
|
26290
26682
|
const canvas = canvasRef.current;
|
|
26291
26683
|
if (!canvas) return;
|
|
26292
26684
|
const ctx = canvas.getContext("2d");
|
|
@@ -26592,7 +26984,7 @@ function TurnPanel({
|
|
|
26592
26984
|
className
|
|
26593
26985
|
}) {
|
|
26594
26986
|
const eventBus = useEventBus();
|
|
26595
|
-
const handleAction =
|
|
26987
|
+
const handleAction = React82.useCallback(
|
|
26596
26988
|
(event) => {
|
|
26597
26989
|
if (event) {
|
|
26598
26990
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -26738,7 +27130,7 @@ function UnitCommandBar({
|
|
|
26738
27130
|
className
|
|
26739
27131
|
}) {
|
|
26740
27132
|
const eventBus = useEventBus();
|
|
26741
|
-
const handleCommand =
|
|
27133
|
+
const handleCommand = React82.useCallback(
|
|
26742
27134
|
(event) => {
|
|
26743
27135
|
if (event) {
|
|
26744
27136
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -27223,7 +27615,7 @@ function GameMenu({
|
|
|
27223
27615
|
} catch {
|
|
27224
27616
|
}
|
|
27225
27617
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
27226
|
-
const handleOptionClick =
|
|
27618
|
+
const handleOptionClick = React82.useCallback(
|
|
27227
27619
|
(option) => {
|
|
27228
27620
|
if (option.event && eventBus) {
|
|
27229
27621
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -27337,7 +27729,7 @@ function GameOverScreen({
|
|
|
27337
27729
|
} catch {
|
|
27338
27730
|
}
|
|
27339
27731
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
27340
|
-
const handleActionClick =
|
|
27732
|
+
const handleActionClick = React82.useCallback(
|
|
27341
27733
|
(action) => {
|
|
27342
27734
|
if (action.event && eventBus) {
|
|
27343
27735
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -28079,7 +28471,7 @@ var init_MapView = __esm({
|
|
|
28079
28471
|
shadowSize: [41, 41]
|
|
28080
28472
|
});
|
|
28081
28473
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
28082
|
-
const { useEffect: useEffect73, useRef: useRef67, useCallback:
|
|
28474
|
+
const { useEffect: useEffect73, useRef: useRef67, useCallback: useCallback113, useState: useState107 } = React82__default;
|
|
28083
28475
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
28084
28476
|
const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
28085
28477
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -28124,8 +28516,8 @@ var init_MapView = __esm({
|
|
|
28124
28516
|
showAttribution = true
|
|
28125
28517
|
}) {
|
|
28126
28518
|
const eventBus = useEventBus3();
|
|
28127
|
-
const [clickedPosition, setClickedPosition] =
|
|
28128
|
-
const handleMapClick =
|
|
28519
|
+
const [clickedPosition, setClickedPosition] = useState107(null);
|
|
28520
|
+
const handleMapClick = useCallback113((lat, lng) => {
|
|
28129
28521
|
if (showClickedPin) {
|
|
28130
28522
|
setClickedPosition({ lat, lng });
|
|
28131
28523
|
}
|
|
@@ -28134,7 +28526,7 @@ var init_MapView = __esm({
|
|
|
28134
28526
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
28135
28527
|
}
|
|
28136
28528
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
28137
|
-
const handleMarkerClick =
|
|
28529
|
+
const handleMarkerClick = useCallback113((marker) => {
|
|
28138
28530
|
onMarkerClick?.(marker);
|
|
28139
28531
|
if (markerClickEvent) {
|
|
28140
28532
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -28985,8 +29377,8 @@ function TableView({
|
|
|
28985
29377
|
}) {
|
|
28986
29378
|
const eventBus = useEventBus();
|
|
28987
29379
|
const { t } = useTranslate();
|
|
28988
|
-
const [visibleCount, setVisibleCount] =
|
|
28989
|
-
const [localSelected, setLocalSelected] =
|
|
29380
|
+
const [visibleCount, setVisibleCount] = React82__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
29381
|
+
const [localSelected, setLocalSelected] = React82__default.useState(/* @__PURE__ */ new Set());
|
|
28990
29382
|
const colDefs = columns ?? fields ?? [];
|
|
28991
29383
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
28992
29384
|
const dnd = useDataDnd({
|
|
@@ -29181,12 +29573,12 @@ function TableView({
|
|
|
29181
29573
|
]
|
|
29182
29574
|
}
|
|
29183
29575
|
);
|
|
29184
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
29576
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React82__default.Fragment, { children: rowInner }, id);
|
|
29185
29577
|
};
|
|
29186
29578
|
const items = data.map((row) => row);
|
|
29187
29579
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
29188
29580
|
let runningIndex = 0;
|
|
29189
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
29581
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
29190
29582
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
29191
29583
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
29192
29584
|
] }, gi)) });
|
|
@@ -30543,7 +30935,7 @@ var init_StepFlow = __esm({
|
|
|
30543
30935
|
className
|
|
30544
30936
|
}) => {
|
|
30545
30937
|
if (orientation === "vertical") {
|
|
30546
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
30938
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React82__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
30547
30939
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
30548
30940
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30549
30941
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -30554,7 +30946,7 @@ var init_StepFlow = __esm({
|
|
|
30554
30946
|
] })
|
|
30555
30947
|
] }) }, index)) });
|
|
30556
30948
|
}
|
|
30557
|
-
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(
|
|
30949
|
+
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(React82__default.Fragment, { children: [
|
|
30558
30950
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
30559
30951
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30560
30952
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -31539,7 +31931,7 @@ var init_LikertScale = __esm({
|
|
|
31539
31931
|
md: "text-base",
|
|
31540
31932
|
lg: "text-lg"
|
|
31541
31933
|
};
|
|
31542
|
-
LikertScale =
|
|
31934
|
+
LikertScale = React82__default.forwardRef(
|
|
31543
31935
|
({
|
|
31544
31936
|
question,
|
|
31545
31937
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -31551,7 +31943,7 @@ var init_LikertScale = __esm({
|
|
|
31551
31943
|
variant = "radios",
|
|
31552
31944
|
className
|
|
31553
31945
|
}, ref) => {
|
|
31554
|
-
const groupId =
|
|
31946
|
+
const groupId = React82__default.useId();
|
|
31555
31947
|
const eventBus = useEventBus();
|
|
31556
31948
|
const handleSelect = useCallback(
|
|
31557
31949
|
(next) => {
|
|
@@ -33833,7 +34225,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
33833
34225
|
"aria-label": t("aria.breadcrumb"),
|
|
33834
34226
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
33835
34227
|
const isLast = idx === items.length - 1;
|
|
33836
|
-
return /* @__PURE__ */ jsxs(
|
|
34228
|
+
return /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
33837
34229
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
33838
34230
|
Icon,
|
|
33839
34231
|
{
|
|
@@ -34702,7 +35094,7 @@ var init_MiniStateMachine = __esm({
|
|
|
34702
35094
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
34703
35095
|
const tc = transitionCounts[s.name] ?? 0;
|
|
34704
35096
|
const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
|
|
34705
|
-
return /* @__PURE__ */ jsxs(
|
|
35097
|
+
return /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
34706
35098
|
/* @__PURE__ */ jsx(
|
|
34707
35099
|
AvlState,
|
|
34708
35100
|
{
|
|
@@ -34906,7 +35298,7 @@ var init_PageHeader = __esm({
|
|
|
34906
35298
|
info: "bg-info/10 text-info"
|
|
34907
35299
|
};
|
|
34908
35300
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
34909
|
-
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(
|
|
35301
|
+
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(React82__default.Fragment, { children: [
|
|
34910
35302
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
34911
35303
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
34912
35304
|
"a",
|
|
@@ -35635,7 +36027,7 @@ var init_WizardContainer = __esm({
|
|
|
35635
36027
|
const isCompleted = index < currentStep;
|
|
35636
36028
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
35637
36029
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
35638
|
-
return /* @__PURE__ */ jsxs(
|
|
36030
|
+
return /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
35639
36031
|
/* @__PURE__ */ jsx(
|
|
35640
36032
|
Button,
|
|
35641
36033
|
{
|
|
@@ -36837,6 +37229,73 @@ var init_GraphCanvas = __esm({
|
|
|
36837
37229
|
GraphCanvas.displayName = "GraphCanvas";
|
|
36838
37230
|
}
|
|
36839
37231
|
});
|
|
37232
|
+
var ReflectionBlock;
|
|
37233
|
+
var init_ReflectionBlock = __esm({
|
|
37234
|
+
"components/core/molecules/ReflectionBlock.tsx"() {
|
|
37235
|
+
"use client";
|
|
37236
|
+
init_useEventBus();
|
|
37237
|
+
init_cn();
|
|
37238
|
+
ReflectionBlock = ({
|
|
37239
|
+
prompt,
|
|
37240
|
+
index,
|
|
37241
|
+
savedNote,
|
|
37242
|
+
saveEvent = "SAVE_REFLECTION",
|
|
37243
|
+
className
|
|
37244
|
+
}) => {
|
|
37245
|
+
const [note, setNote] = useState(savedNote ?? "");
|
|
37246
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
37247
|
+
const { emit } = useEventBus();
|
|
37248
|
+
const handleSave = () => {
|
|
37249
|
+
emit(`UI:${saveEvent}`, { index, note });
|
|
37250
|
+
setIsExpanded(false);
|
|
37251
|
+
};
|
|
37252
|
+
return /* @__PURE__ */ jsx(
|
|
37253
|
+
"div",
|
|
37254
|
+
{
|
|
37255
|
+
className: cn(
|
|
37256
|
+
"my-6 border-l-4 border-amber-400 bg-amber-50 dark:bg-amber-900/20 rounded-r-lg p-4",
|
|
37257
|
+
className
|
|
37258
|
+
),
|
|
37259
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
37260
|
+
/* @__PURE__ */ jsx(PauseCircle, { className: "text-amber-600 dark:text-amber-400 flex-shrink-0 mt-1", size: 20 }),
|
|
37261
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
37262
|
+
/* @__PURE__ */ jsx("div", { className: "font-medium text-amber-900 dark:text-amber-100 mb-2", children: "Pause & Reflect" }),
|
|
37263
|
+
/* @__PURE__ */ jsx("p", { className: "text-gray-700 dark:text-gray-300 text-sm mb-3", children: prompt }),
|
|
37264
|
+
isExpanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37265
|
+
/* @__PURE__ */ jsx(
|
|
37266
|
+
"textarea",
|
|
37267
|
+
{
|
|
37268
|
+
className: "w-full p-2 border border-amber-300 dark:border-amber-700 rounded text-sm bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-amber-500 focus:border-transparent",
|
|
37269
|
+
placeholder: "Your thoughts...",
|
|
37270
|
+
value: note,
|
|
37271
|
+
onChange: (e) => setNote(e.target.value),
|
|
37272
|
+
rows: 2
|
|
37273
|
+
}
|
|
37274
|
+
),
|
|
37275
|
+
/* @__PURE__ */ jsx(
|
|
37276
|
+
"button",
|
|
37277
|
+
{
|
|
37278
|
+
onClick: handleSave,
|
|
37279
|
+
className: "mt-2 text-sm px-3 py-1 bg-amber-600 text-white rounded hover:bg-amber-700 transition-colors",
|
|
37280
|
+
children: "Save & Continue"
|
|
37281
|
+
}
|
|
37282
|
+
)
|
|
37283
|
+
] }) : /* @__PURE__ */ jsx(
|
|
37284
|
+
"button",
|
|
37285
|
+
{
|
|
37286
|
+
onClick: () => setIsExpanded(true),
|
|
37287
|
+
className: "text-sm text-amber-600 dark:text-amber-400 hover:underline",
|
|
37288
|
+
children: savedNote ? "\u2713 Answered \xB7 Edit" : "Answer this question"
|
|
37289
|
+
}
|
|
37290
|
+
)
|
|
37291
|
+
] })
|
|
37292
|
+
] })
|
|
37293
|
+
}
|
|
37294
|
+
);
|
|
37295
|
+
};
|
|
37296
|
+
ReflectionBlock.displayName = "ReflectionBlock";
|
|
37297
|
+
}
|
|
37298
|
+
});
|
|
36840
37299
|
|
|
36841
37300
|
// components/core/molecules/index.ts
|
|
36842
37301
|
var init_molecules2 = __esm({
|
|
@@ -37919,7 +38378,7 @@ var init_DetailPanel = __esm({
|
|
|
37919
38378
|
}
|
|
37920
38379
|
});
|
|
37921
38380
|
function extractTitle(children) {
|
|
37922
|
-
if (!
|
|
38381
|
+
if (!React82__default.isValidElement(children)) return void 0;
|
|
37923
38382
|
const props = children.props;
|
|
37924
38383
|
if (typeof props.title === "string") {
|
|
37925
38384
|
return props.title;
|
|
@@ -37974,7 +38433,7 @@ function LinearView({
|
|
|
37974
38433
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
37975
38434
|
const isDone = i < currentIdx;
|
|
37976
38435
|
const isCurrent = i === currentIdx;
|
|
37977
|
-
return /* @__PURE__ */ jsxs(
|
|
38436
|
+
return /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
37978
38437
|
i > 0 && /* @__PURE__ */ jsx(
|
|
37979
38438
|
Typography,
|
|
37980
38439
|
{
|
|
@@ -38932,12 +39391,12 @@ var init_Form = __esm({
|
|
|
38932
39391
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
38933
39392
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
38934
39393
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
38935
|
-
const normalizedInitialData =
|
|
39394
|
+
const normalizedInitialData = React82__default.useMemo(() => {
|
|
38936
39395
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
38937
39396
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
38938
39397
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
38939
39398
|
}, [entity, initialData]);
|
|
38940
|
-
const entityDerivedFields =
|
|
39399
|
+
const entityDerivedFields = React82__default.useMemo(() => {
|
|
38941
39400
|
if (fields && fields.length > 0) return void 0;
|
|
38942
39401
|
if (!resolvedEntity) return void 0;
|
|
38943
39402
|
return resolvedEntity.fields.map(
|
|
@@ -38957,16 +39416,16 @@ var init_Form = __esm({
|
|
|
38957
39416
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
38958
39417
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
38959
39418
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
38960
|
-
const [formData, setFormData] =
|
|
39419
|
+
const [formData, setFormData] = React82__default.useState(
|
|
38961
39420
|
normalizedInitialData
|
|
38962
39421
|
);
|
|
38963
|
-
const [collapsedSections, setCollapsedSections] =
|
|
39422
|
+
const [collapsedSections, setCollapsedSections] = React82__default.useState(
|
|
38964
39423
|
/* @__PURE__ */ new Set()
|
|
38965
39424
|
);
|
|
38966
|
-
const [submitError, setSubmitError] =
|
|
38967
|
-
const formRef =
|
|
39425
|
+
const [submitError, setSubmitError] = React82__default.useState(null);
|
|
39426
|
+
const formRef = React82__default.useRef(null);
|
|
38968
39427
|
const formMode = props.mode;
|
|
38969
|
-
const mountedRef =
|
|
39428
|
+
const mountedRef = React82__default.useRef(false);
|
|
38970
39429
|
if (!mountedRef.current) {
|
|
38971
39430
|
mountedRef.current = true;
|
|
38972
39431
|
debug("forms", "mount", {
|
|
@@ -38979,7 +39438,7 @@ var init_Form = __esm({
|
|
|
38979
39438
|
});
|
|
38980
39439
|
}
|
|
38981
39440
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
38982
|
-
const evalContext =
|
|
39441
|
+
const evalContext = React82__default.useMemo(
|
|
38983
39442
|
() => ({
|
|
38984
39443
|
formValues: formData,
|
|
38985
39444
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -38988,7 +39447,7 @@ var init_Form = __esm({
|
|
|
38988
39447
|
}),
|
|
38989
39448
|
[formData, externalContext]
|
|
38990
39449
|
);
|
|
38991
|
-
|
|
39450
|
+
React82__default.useEffect(() => {
|
|
38992
39451
|
debug("forms", "initialData-sync", {
|
|
38993
39452
|
mode: formMode,
|
|
38994
39453
|
normalizedInitialData,
|
|
@@ -38999,7 +39458,7 @@ var init_Form = __esm({
|
|
|
38999
39458
|
setFormData(normalizedInitialData);
|
|
39000
39459
|
}
|
|
39001
39460
|
}, [normalizedInitialData]);
|
|
39002
|
-
const processCalculations =
|
|
39461
|
+
const processCalculations = React82__default.useCallback(
|
|
39003
39462
|
(changedFieldId, newFormData) => {
|
|
39004
39463
|
if (!hiddenCalculations.length) return;
|
|
39005
39464
|
const context = {
|
|
@@ -39024,7 +39483,7 @@ var init_Form = __esm({
|
|
|
39024
39483
|
},
|
|
39025
39484
|
[hiddenCalculations, externalContext, eventBus]
|
|
39026
39485
|
);
|
|
39027
|
-
const checkViolations =
|
|
39486
|
+
const checkViolations = React82__default.useCallback(
|
|
39028
39487
|
(changedFieldId, newFormData) => {
|
|
39029
39488
|
if (!violationTriggers.length) return;
|
|
39030
39489
|
const context = {
|
|
@@ -39062,7 +39521,7 @@ var init_Form = __esm({
|
|
|
39062
39521
|
processCalculations(name, newFormData);
|
|
39063
39522
|
checkViolations(name, newFormData);
|
|
39064
39523
|
};
|
|
39065
|
-
const isFieldVisible =
|
|
39524
|
+
const isFieldVisible = React82__default.useCallback(
|
|
39066
39525
|
(fieldName) => {
|
|
39067
39526
|
const condition = conditionalFields[fieldName];
|
|
39068
39527
|
if (!condition) return true;
|
|
@@ -39070,7 +39529,7 @@ var init_Form = __esm({
|
|
|
39070
39529
|
},
|
|
39071
39530
|
[conditionalFields, evalContext]
|
|
39072
39531
|
);
|
|
39073
|
-
const isSectionVisible =
|
|
39532
|
+
const isSectionVisible = React82__default.useCallback(
|
|
39074
39533
|
(section) => {
|
|
39075
39534
|
if (!section.condition) return true;
|
|
39076
39535
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -39146,7 +39605,7 @@ var init_Form = __esm({
|
|
|
39146
39605
|
eventBus.emit(`UI:${onCancel}`);
|
|
39147
39606
|
}
|
|
39148
39607
|
};
|
|
39149
|
-
const renderField =
|
|
39608
|
+
const renderField = React82__default.useCallback(
|
|
39150
39609
|
(field) => {
|
|
39151
39610
|
const fieldName = field.name || field.field;
|
|
39152
39611
|
if (!fieldName) return null;
|
|
@@ -39167,7 +39626,7 @@ var init_Form = __esm({
|
|
|
39167
39626
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
39168
39627
|
);
|
|
39169
39628
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
39170
|
-
const normalizedFields =
|
|
39629
|
+
const normalizedFields = React82__default.useMemo(() => {
|
|
39171
39630
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
39172
39631
|
return effectiveFields.map((field) => {
|
|
39173
39632
|
if (typeof field === "string") {
|
|
@@ -39190,7 +39649,7 @@ var init_Form = __esm({
|
|
|
39190
39649
|
return field;
|
|
39191
39650
|
});
|
|
39192
39651
|
}, [effectiveFields, resolvedEntity]);
|
|
39193
|
-
const schemaFields =
|
|
39652
|
+
const schemaFields = React82__default.useMemo(() => {
|
|
39194
39653
|
if (normalizedFields.length === 0) return null;
|
|
39195
39654
|
if (isDebugEnabled()) {
|
|
39196
39655
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -39200,7 +39659,7 @@ var init_Form = __esm({
|
|
|
39200
39659
|
}
|
|
39201
39660
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
39202
39661
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
39203
|
-
const sectionElements =
|
|
39662
|
+
const sectionElements = React82__default.useMemo(() => {
|
|
39204
39663
|
if (!sections || sections.length === 0) return null;
|
|
39205
39664
|
return sections.map((section) => {
|
|
39206
39665
|
if (!isSectionVisible(section)) {
|
|
@@ -40475,7 +40934,7 @@ var init_List = __esm({
|
|
|
40475
40934
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
40476
40935
|
return [];
|
|
40477
40936
|
}, [entity]);
|
|
40478
|
-
const getItemActions =
|
|
40937
|
+
const getItemActions = React82__default.useCallback(
|
|
40479
40938
|
(item) => {
|
|
40480
40939
|
if (!itemActions) return [];
|
|
40481
40940
|
if (typeof itemActions === "function") {
|
|
@@ -40951,7 +41410,7 @@ var init_MediaGallery = __esm({
|
|
|
40951
41410
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
40952
41411
|
);
|
|
40953
41412
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
40954
|
-
const items =
|
|
41413
|
+
const items = React82__default.useMemo(() => {
|
|
40955
41414
|
if (propItems) return propItems;
|
|
40956
41415
|
if (entityData.length === 0) return [];
|
|
40957
41416
|
return entityData.map((record, idx) => ({
|
|
@@ -41112,7 +41571,7 @@ var init_MediaGallery = __esm({
|
|
|
41112
41571
|
}
|
|
41113
41572
|
});
|
|
41114
41573
|
function extractTitle2(children) {
|
|
41115
|
-
if (!
|
|
41574
|
+
if (!React82__default.isValidElement(children)) return void 0;
|
|
41116
41575
|
const props = children.props;
|
|
41117
41576
|
if (typeof props.title === "string") {
|
|
41118
41577
|
return props.title;
|
|
@@ -41543,7 +42002,7 @@ var init_debugRegistry = __esm({
|
|
|
41543
42002
|
}
|
|
41544
42003
|
});
|
|
41545
42004
|
function useDebugData() {
|
|
41546
|
-
const [data, setData] =
|
|
42005
|
+
const [data, setData] = React82.useState(() => ({
|
|
41547
42006
|
traits: [],
|
|
41548
42007
|
ticks: [],
|
|
41549
42008
|
guards: [],
|
|
@@ -41557,7 +42016,7 @@ function useDebugData() {
|
|
|
41557
42016
|
},
|
|
41558
42017
|
lastUpdate: Date.now()
|
|
41559
42018
|
}));
|
|
41560
|
-
|
|
42019
|
+
React82.useEffect(() => {
|
|
41561
42020
|
const updateData = () => {
|
|
41562
42021
|
setData({
|
|
41563
42022
|
traits: getAllTraits(),
|
|
@@ -41666,12 +42125,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
41666
42125
|
return positions;
|
|
41667
42126
|
}
|
|
41668
42127
|
function WalkMinimap() {
|
|
41669
|
-
const [walkStep, setWalkStep] =
|
|
41670
|
-
const [traits2, setTraits] =
|
|
41671
|
-
const [coveredEdges, setCoveredEdges] =
|
|
41672
|
-
const [completedTraits, setCompletedTraits] =
|
|
41673
|
-
const prevTraitRef =
|
|
41674
|
-
|
|
42128
|
+
const [walkStep, setWalkStep] = React82.useState(null);
|
|
42129
|
+
const [traits2, setTraits] = React82.useState([]);
|
|
42130
|
+
const [coveredEdges, setCoveredEdges] = React82.useState([]);
|
|
42131
|
+
const [completedTraits, setCompletedTraits] = React82.useState(/* @__PURE__ */ new Set());
|
|
42132
|
+
const prevTraitRef = React82.useRef(null);
|
|
42133
|
+
React82.useEffect(() => {
|
|
41675
42134
|
const interval = setInterval(() => {
|
|
41676
42135
|
const w = window;
|
|
41677
42136
|
const step = w.__orbitalWalkStep;
|
|
@@ -42107,15 +42566,15 @@ var init_EntitiesTab = __esm({
|
|
|
42107
42566
|
});
|
|
42108
42567
|
function EventFlowTab({ events: events2 }) {
|
|
42109
42568
|
const { t } = useTranslate();
|
|
42110
|
-
const [filter, setFilter] =
|
|
42111
|
-
const containerRef =
|
|
42112
|
-
const [autoScroll, setAutoScroll] =
|
|
42113
|
-
|
|
42569
|
+
const [filter, setFilter] = React82.useState("all");
|
|
42570
|
+
const containerRef = React82.useRef(null);
|
|
42571
|
+
const [autoScroll, setAutoScroll] = React82.useState(true);
|
|
42572
|
+
React82.useEffect(() => {
|
|
42114
42573
|
if (autoScroll && containerRef.current) {
|
|
42115
42574
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42116
42575
|
}
|
|
42117
42576
|
}, [events2.length, autoScroll]);
|
|
42118
|
-
const filteredEvents =
|
|
42577
|
+
const filteredEvents = React82.useMemo(() => {
|
|
42119
42578
|
if (filter === "all") return events2;
|
|
42120
42579
|
return events2.filter((e) => e.type === filter);
|
|
42121
42580
|
}, [events2, filter]);
|
|
@@ -42231,7 +42690,7 @@ var init_EventFlowTab = __esm({
|
|
|
42231
42690
|
});
|
|
42232
42691
|
function GuardsPanel({ guards }) {
|
|
42233
42692
|
const { t } = useTranslate();
|
|
42234
|
-
const [filter, setFilter] =
|
|
42693
|
+
const [filter, setFilter] = React82.useState("all");
|
|
42235
42694
|
if (guards.length === 0) {
|
|
42236
42695
|
return /* @__PURE__ */ jsx(
|
|
42237
42696
|
EmptyState,
|
|
@@ -42244,7 +42703,7 @@ function GuardsPanel({ guards }) {
|
|
|
42244
42703
|
}
|
|
42245
42704
|
const passedCount = guards.filter((g) => g.result).length;
|
|
42246
42705
|
const failedCount = guards.length - passedCount;
|
|
42247
|
-
const filteredGuards =
|
|
42706
|
+
const filteredGuards = React82.useMemo(() => {
|
|
42248
42707
|
if (filter === "all") return guards;
|
|
42249
42708
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
42250
42709
|
return guards.filter((g) => !g.result);
|
|
@@ -42407,10 +42866,10 @@ function EffectBadge({ effect }) {
|
|
|
42407
42866
|
}
|
|
42408
42867
|
function TransitionTimeline({ transitions }) {
|
|
42409
42868
|
const { t } = useTranslate();
|
|
42410
|
-
const containerRef =
|
|
42411
|
-
const [autoScroll, setAutoScroll] =
|
|
42412
|
-
const [expandedId, setExpandedId] =
|
|
42413
|
-
|
|
42869
|
+
const containerRef = React82.useRef(null);
|
|
42870
|
+
const [autoScroll, setAutoScroll] = React82.useState(true);
|
|
42871
|
+
const [expandedId, setExpandedId] = React82.useState(null);
|
|
42872
|
+
React82.useEffect(() => {
|
|
42414
42873
|
if (autoScroll && containerRef.current) {
|
|
42415
42874
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42416
42875
|
}
|
|
@@ -42690,9 +43149,9 @@ function getAllEvents(traits2) {
|
|
|
42690
43149
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
42691
43150
|
const eventBus = useEventBus();
|
|
42692
43151
|
const { t } = useTranslate();
|
|
42693
|
-
const [log12, setLog] =
|
|
42694
|
-
const prevStatesRef =
|
|
42695
|
-
|
|
43152
|
+
const [log12, setLog] = React82.useState([]);
|
|
43153
|
+
const prevStatesRef = React82.useRef(/* @__PURE__ */ new Map());
|
|
43154
|
+
React82.useEffect(() => {
|
|
42696
43155
|
for (const trait of traits2) {
|
|
42697
43156
|
const prev = prevStatesRef.current.get(trait.id);
|
|
42698
43157
|
if (prev && prev !== trait.currentState) {
|
|
@@ -42861,10 +43320,10 @@ function VerifyModePanel({
|
|
|
42861
43320
|
localCount
|
|
42862
43321
|
}) {
|
|
42863
43322
|
const { t } = useTranslate();
|
|
42864
|
-
const [expanded, setExpanded] =
|
|
42865
|
-
const scrollRef =
|
|
42866
|
-
const prevCountRef =
|
|
42867
|
-
|
|
43323
|
+
const [expanded, setExpanded] = React82.useState(true);
|
|
43324
|
+
const scrollRef = React82.useRef(null);
|
|
43325
|
+
const prevCountRef = React82.useRef(0);
|
|
43326
|
+
React82.useEffect(() => {
|
|
42868
43327
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
42869
43328
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
42870
43329
|
}
|
|
@@ -42921,10 +43380,10 @@ function RuntimeDebugger({
|
|
|
42921
43380
|
schema
|
|
42922
43381
|
}) {
|
|
42923
43382
|
const { t } = useTranslate();
|
|
42924
|
-
const [isCollapsed, setIsCollapsed] =
|
|
42925
|
-
const [isVisible, setIsVisible] =
|
|
43383
|
+
const [isCollapsed, setIsCollapsed] = React82.useState(mode === "verify" ? true : defaultCollapsed);
|
|
43384
|
+
const [isVisible, setIsVisible] = React82.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
42926
43385
|
const debugData = useDebugData();
|
|
42927
|
-
|
|
43386
|
+
React82.useEffect(() => {
|
|
42928
43387
|
if (mode === "inline") return;
|
|
42929
43388
|
return onDebugToggle((enabled) => {
|
|
42930
43389
|
setIsVisible(enabled);
|
|
@@ -42933,7 +43392,7 @@ function RuntimeDebugger({
|
|
|
42933
43392
|
}
|
|
42934
43393
|
});
|
|
42935
43394
|
}, [mode]);
|
|
42936
|
-
|
|
43395
|
+
React82.useEffect(() => {
|
|
42937
43396
|
if (mode === "inline") return;
|
|
42938
43397
|
const handleKeyDown = (e) => {
|
|
42939
43398
|
if (e.key === "`" && isVisible) {
|
|
@@ -43153,6 +43612,117 @@ var init_RuntimeDebugger2 = __esm({
|
|
|
43153
43612
|
RuntimeDebugger.displayName = "RuntimeDebugger";
|
|
43154
43613
|
}
|
|
43155
43614
|
});
|
|
43615
|
+
var SegmentRenderer;
|
|
43616
|
+
var init_SegmentRenderer = __esm({
|
|
43617
|
+
"components/core/organisms/SegmentRenderer.tsx"() {
|
|
43618
|
+
"use client";
|
|
43619
|
+
init_MarkdownContent();
|
|
43620
|
+
init_CodeBlock();
|
|
43621
|
+
init_QuizBlock();
|
|
43622
|
+
init_ActivationBlock();
|
|
43623
|
+
init_ConnectionBlock();
|
|
43624
|
+
init_ReflectionBlock();
|
|
43625
|
+
init_BloomQuizBlock();
|
|
43626
|
+
init_CodeRunnerPanel();
|
|
43627
|
+
init_cn();
|
|
43628
|
+
SegmentRenderer = ({
|
|
43629
|
+
segments,
|
|
43630
|
+
className,
|
|
43631
|
+
containerClassName,
|
|
43632
|
+
userProgress,
|
|
43633
|
+
onRunCodeSimulation,
|
|
43634
|
+
onRenderVisualization
|
|
43635
|
+
}) => {
|
|
43636
|
+
if (segments.length === 0) return null;
|
|
43637
|
+
let reflectIndex = 0;
|
|
43638
|
+
let bloomIndex = 0;
|
|
43639
|
+
return /* @__PURE__ */ jsx(
|
|
43640
|
+
"div",
|
|
43641
|
+
{
|
|
43642
|
+
className: cn(
|
|
43643
|
+
"border border-gray-200 dark:border-gray-700 rounded-lg p-2 md:p-4 overflow-x-auto space-y-6",
|
|
43644
|
+
containerClassName,
|
|
43645
|
+
className
|
|
43646
|
+
),
|
|
43647
|
+
children: segments.map((segment, index) => {
|
|
43648
|
+
if (segment.type === "markdown") {
|
|
43649
|
+
return /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `md-${index}`);
|
|
43650
|
+
}
|
|
43651
|
+
if (segment.type === "code") {
|
|
43652
|
+
if (segment.runnable && onRunCodeSimulation) {
|
|
43653
|
+
return /* @__PURE__ */ jsx(
|
|
43654
|
+
CodeRunnerPanel,
|
|
43655
|
+
{
|
|
43656
|
+
language: segment.language,
|
|
43657
|
+
code: segment.content,
|
|
43658
|
+
runnable: true,
|
|
43659
|
+
onRun: (code) => onRunCodeSimulation(code, segment.language)
|
|
43660
|
+
},
|
|
43661
|
+
`code-${index}`
|
|
43662
|
+
);
|
|
43663
|
+
}
|
|
43664
|
+
return /* @__PURE__ */ jsx(
|
|
43665
|
+
CodeBlock,
|
|
43666
|
+
{
|
|
43667
|
+
language: segment.language ?? "text",
|
|
43668
|
+
code: segment.content
|
|
43669
|
+
},
|
|
43670
|
+
`code-${index}`
|
|
43671
|
+
);
|
|
43672
|
+
}
|
|
43673
|
+
if (segment.type === "quiz") {
|
|
43674
|
+
return /* @__PURE__ */ jsx(QuizBlock, { question: segment.question, answer: segment.answer }, `quiz-${index}`);
|
|
43675
|
+
}
|
|
43676
|
+
if (segment.type === "activate") {
|
|
43677
|
+
return /* @__PURE__ */ jsx(
|
|
43678
|
+
ActivationBlock,
|
|
43679
|
+
{
|
|
43680
|
+
question: segment.question,
|
|
43681
|
+
savedResponse: userProgress?.activationResponse
|
|
43682
|
+
},
|
|
43683
|
+
`activate-${index}`
|
|
43684
|
+
);
|
|
43685
|
+
}
|
|
43686
|
+
if (segment.type === "connect") {
|
|
43687
|
+
return /* @__PURE__ */ jsx(ConnectionBlock, { content: segment.content }, `connect-${index}`);
|
|
43688
|
+
}
|
|
43689
|
+
if (segment.type === "reflect") {
|
|
43690
|
+
const ri = reflectIndex++;
|
|
43691
|
+
return /* @__PURE__ */ jsx(
|
|
43692
|
+
ReflectionBlock,
|
|
43693
|
+
{
|
|
43694
|
+
prompt: segment.prompt,
|
|
43695
|
+
index: ri,
|
|
43696
|
+
savedNote: userProgress?.reflectionNotes?.[ri]
|
|
43697
|
+
},
|
|
43698
|
+
`reflect-${index}`
|
|
43699
|
+
);
|
|
43700
|
+
}
|
|
43701
|
+
if (segment.type === "bloom") {
|
|
43702
|
+
const bi = bloomIndex++;
|
|
43703
|
+
return /* @__PURE__ */ jsx(
|
|
43704
|
+
BloomQuizBlock,
|
|
43705
|
+
{
|
|
43706
|
+
level: segment.level,
|
|
43707
|
+
question: segment.question,
|
|
43708
|
+
answer: segment.answer,
|
|
43709
|
+
index: bi,
|
|
43710
|
+
isAnswered: userProgress?.bloomAnswered?.[bi]
|
|
43711
|
+
},
|
|
43712
|
+
`bloom-${index}`
|
|
43713
|
+
);
|
|
43714
|
+
}
|
|
43715
|
+
if (segment.type === "visualization") {
|
|
43716
|
+
return onRenderVisualization ? onRenderVisualization(segment.visualizationType, segment.description, index) ?? null : null;
|
|
43717
|
+
}
|
|
43718
|
+
return null;
|
|
43719
|
+
})
|
|
43720
|
+
}
|
|
43721
|
+
);
|
|
43722
|
+
};
|
|
43723
|
+
SegmentRenderer.displayName = "SegmentRenderer";
|
|
43724
|
+
}
|
|
43725
|
+
});
|
|
43156
43726
|
function TraitSlot({
|
|
43157
43727
|
slotNumber,
|
|
43158
43728
|
equippedItem,
|
|
@@ -43382,7 +43952,7 @@ function SequenceBar({
|
|
|
43382
43952
|
onSlotRemove(index);
|
|
43383
43953
|
}, [onSlotRemove, playing]);
|
|
43384
43954
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
43385
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
43955
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
43386
43956
|
i > 0 && /* @__PURE__ */ jsx(
|
|
43387
43957
|
Typography,
|
|
43388
43958
|
{
|
|
@@ -44361,7 +44931,7 @@ var init_StatCard = __esm({
|
|
|
44361
44931
|
const labelToUse = propLabel ?? propTitle;
|
|
44362
44932
|
const eventBus = useEventBus();
|
|
44363
44933
|
const { t } = useTranslate();
|
|
44364
|
-
const handleActionClick =
|
|
44934
|
+
const handleActionClick = React82__default.useCallback(() => {
|
|
44365
44935
|
if (action?.event) {
|
|
44366
44936
|
eventBus.emit(`UI:${action.event}`, {});
|
|
44367
44937
|
}
|
|
@@ -44372,7 +44942,7 @@ var init_StatCard = __esm({
|
|
|
44372
44942
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
44373
44943
|
const isLoading = externalLoading ?? false;
|
|
44374
44944
|
const error = externalError;
|
|
44375
|
-
const computeMetricValue =
|
|
44945
|
+
const computeMetricValue = React82__default.useCallback(
|
|
44376
44946
|
(metric, items) => {
|
|
44377
44947
|
if (metric.value !== void 0) {
|
|
44378
44948
|
return metric.value;
|
|
@@ -44411,7 +44981,7 @@ var init_StatCard = __esm({
|
|
|
44411
44981
|
},
|
|
44412
44982
|
[]
|
|
44413
44983
|
);
|
|
44414
|
-
const schemaStats =
|
|
44984
|
+
const schemaStats = React82__default.useMemo(() => {
|
|
44415
44985
|
if (!metrics || metrics.length === 0) return null;
|
|
44416
44986
|
return metrics.map((metric) => ({
|
|
44417
44987
|
label: metric.label,
|
|
@@ -44419,7 +44989,7 @@ var init_StatCard = __esm({
|
|
|
44419
44989
|
format: metric.format
|
|
44420
44990
|
}));
|
|
44421
44991
|
}, [metrics, data, computeMetricValue]);
|
|
44422
|
-
const calculatedTrend =
|
|
44992
|
+
const calculatedTrend = React82__default.useMemo(() => {
|
|
44423
44993
|
if (manualTrend !== void 0) return manualTrend;
|
|
44424
44994
|
if (previousValue === void 0 || currentValue === void 0)
|
|
44425
44995
|
return void 0;
|
|
@@ -45384,7 +45954,7 @@ var init_Timeline = __esm({
|
|
|
45384
45954
|
}) => {
|
|
45385
45955
|
const { t } = useTranslate();
|
|
45386
45956
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
45387
|
-
const items =
|
|
45957
|
+
const items = React82__default.useMemo(() => {
|
|
45388
45958
|
if (propItems) return propItems;
|
|
45389
45959
|
if (entityData.length === 0) return [];
|
|
45390
45960
|
return entityData.map((record, idx) => {
|
|
@@ -45491,7 +46061,7 @@ var init_Timeline = __esm({
|
|
|
45491
46061
|
}
|
|
45492
46062
|
});
|
|
45493
46063
|
function extractToastProps(children) {
|
|
45494
|
-
if (!
|
|
46064
|
+
if (!React82__default.isValidElement(children)) {
|
|
45495
46065
|
if (typeof children === "string") {
|
|
45496
46066
|
return { message: children };
|
|
45497
46067
|
}
|
|
@@ -45529,7 +46099,7 @@ var init_ToastSlot = __esm({
|
|
|
45529
46099
|
eventBus.emit("UI:CLOSE");
|
|
45530
46100
|
};
|
|
45531
46101
|
if (!isVisible) return null;
|
|
45532
|
-
const isCustomContent =
|
|
46102
|
+
const isCustomContent = React82__default.isValidElement(children) && !message;
|
|
45533
46103
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
45534
46104
|
Toast,
|
|
45535
46105
|
{
|
|
@@ -46063,7 +46633,7 @@ var init_WorldMapTemplate = __esm({
|
|
|
46063
46633
|
}
|
|
46064
46634
|
});
|
|
46065
46635
|
function lazyThree(name, loader) {
|
|
46066
|
-
const Lazy =
|
|
46636
|
+
const Lazy = React82__default.lazy(
|
|
46067
46637
|
() => loader().then((m) => {
|
|
46068
46638
|
const Resolved = m[name];
|
|
46069
46639
|
if (!Resolved) {
|
|
@@ -46075,13 +46645,13 @@ function lazyThree(name, loader) {
|
|
|
46075
46645
|
})
|
|
46076
46646
|
);
|
|
46077
46647
|
function ThreeWrapper(props) {
|
|
46078
|
-
return
|
|
46648
|
+
return React82__default.createElement(
|
|
46079
46649
|
ThreeBoundary,
|
|
46080
46650
|
{ name },
|
|
46081
|
-
|
|
46082
|
-
|
|
46651
|
+
React82__default.createElement(
|
|
46652
|
+
React82__default.Suspense,
|
|
46083
46653
|
{ fallback: null },
|
|
46084
|
-
|
|
46654
|
+
React82__default.createElement(Lazy, props)
|
|
46085
46655
|
)
|
|
46086
46656
|
);
|
|
46087
46657
|
}
|
|
@@ -46097,6 +46667,7 @@ var init_component_registry_generated = __esm({
|
|
|
46097
46667
|
init_ActionButtons();
|
|
46098
46668
|
init_ActionPalette();
|
|
46099
46669
|
init_ActionTile();
|
|
46670
|
+
init_ActivationBlock();
|
|
46100
46671
|
init_ComponentPatterns();
|
|
46101
46672
|
init_AnimatedCounter();
|
|
46102
46673
|
init_AnimatedGraphic();
|
|
@@ -46109,6 +46680,7 @@ var init_component_registry_generated = __esm({
|
|
|
46109
46680
|
init_BattleBoard();
|
|
46110
46681
|
init_BattleTemplate();
|
|
46111
46682
|
init_BehaviorView();
|
|
46683
|
+
init_BloomQuizBlock();
|
|
46112
46684
|
init_BookChapterView();
|
|
46113
46685
|
init_BookCoverPage();
|
|
46114
46686
|
init_BookNavBar();
|
|
@@ -46136,12 +46708,14 @@ var init_component_registry_generated = __esm({
|
|
|
46136
46708
|
init_ChoiceButton();
|
|
46137
46709
|
init_ClassifierBoard();
|
|
46138
46710
|
init_CodeBlock();
|
|
46711
|
+
init_CodeRunnerPanel();
|
|
46139
46712
|
init_CombatLog();
|
|
46140
46713
|
init_ComboCounter();
|
|
46141
46714
|
init_CommunityLinks();
|
|
46142
46715
|
init_ConditionalWrapper();
|
|
46143
46716
|
init_ConfettiEffect();
|
|
46144
46717
|
init_ConfirmDialog();
|
|
46718
|
+
init_ConnectionBlock();
|
|
46145
46719
|
init_Container();
|
|
46146
46720
|
init_ContentRenderer();
|
|
46147
46721
|
init_ContentSection();
|
|
@@ -46269,6 +46843,7 @@ var init_component_registry_generated = __esm({
|
|
|
46269
46843
|
init_QuizBlock();
|
|
46270
46844
|
init_Radio();
|
|
46271
46845
|
init_RangeSlider();
|
|
46846
|
+
init_ReflectionBlock();
|
|
46272
46847
|
init_RelationSelect();
|
|
46273
46848
|
init_RepeatableFormSection();
|
|
46274
46849
|
init_ReplyTree();
|
|
@@ -46283,6 +46858,7 @@ var init_component_registry_generated = __esm({
|
|
|
46283
46858
|
init_SearchInput();
|
|
46284
46859
|
init_Section();
|
|
46285
46860
|
init_SectionHeader();
|
|
46861
|
+
init_SegmentRenderer();
|
|
46286
46862
|
init_Select();
|
|
46287
46863
|
init_SequenceBar();
|
|
46288
46864
|
init_SequencerBoard();
|
|
@@ -46374,7 +46950,7 @@ var init_component_registry_generated = __esm({
|
|
|
46374
46950
|
init_WorldMapBoard();
|
|
46375
46951
|
init_WorldMapTemplate();
|
|
46376
46952
|
init_XPBar();
|
|
46377
|
-
ThreeBoundary = class extends
|
|
46953
|
+
ThreeBoundary = class extends React82__default.Component {
|
|
46378
46954
|
constructor() {
|
|
46379
46955
|
super(...arguments);
|
|
46380
46956
|
__publicField(this, "state", { failed: false });
|
|
@@ -46384,7 +46960,7 @@ var init_component_registry_generated = __esm({
|
|
|
46384
46960
|
}
|
|
46385
46961
|
render() {
|
|
46386
46962
|
if (this.state.failed) {
|
|
46387
|
-
return
|
|
46963
|
+
return React82__default.createElement(
|
|
46388
46964
|
"div",
|
|
46389
46965
|
{
|
|
46390
46966
|
"data-testid": "three-unavailable",
|
|
@@ -46408,6 +46984,7 @@ var init_component_registry_generated = __esm({
|
|
|
46408
46984
|
"ActionButtons": ActionButtons,
|
|
46409
46985
|
"ActionPalette": ActionPalette,
|
|
46410
46986
|
"ActionTile": ActionTile,
|
|
46987
|
+
"ActivationBlock": ActivationBlock,
|
|
46411
46988
|
"Alert": AlertPattern,
|
|
46412
46989
|
"AlertPattern": AlertPattern,
|
|
46413
46990
|
"AnimatedCounter": AnimatedCounter,
|
|
@@ -46421,6 +46998,7 @@ var init_component_registry_generated = __esm({
|
|
|
46421
46998
|
"BattleBoard": BattleBoard,
|
|
46422
46999
|
"BattleTemplate": BattleTemplate,
|
|
46423
47000
|
"BehaviorView": BehaviorView,
|
|
47001
|
+
"BloomQuizBlock": BloomQuizBlock,
|
|
46424
47002
|
"BookChapterView": BookChapterView,
|
|
46425
47003
|
"BookCoverPage": BookCoverPage,
|
|
46426
47004
|
"BookNavBar": BookNavBar,
|
|
@@ -46451,12 +47029,14 @@ var init_component_registry_generated = __esm({
|
|
|
46451
47029
|
"ChoiceButton": ChoiceButton,
|
|
46452
47030
|
"ClassifierBoard": ClassifierBoard,
|
|
46453
47031
|
"CodeBlock": CodeBlock,
|
|
47032
|
+
"CodeRunnerPanel": CodeRunnerPanel,
|
|
46454
47033
|
"CombatLog": CombatLog,
|
|
46455
47034
|
"ComboCounter": ComboCounter,
|
|
46456
47035
|
"CommunityLinks": CommunityLinks,
|
|
46457
47036
|
"ConditionalWrapper": ConditionalWrapper,
|
|
46458
47037
|
"ConfettiEffect": ConfettiEffect,
|
|
46459
47038
|
"ConfirmDialog": ConfirmDialog,
|
|
47039
|
+
"ConnectionBlock": ConnectionBlock,
|
|
46460
47040
|
"Container": Container,
|
|
46461
47041
|
"ContentRenderer": ContentRenderer,
|
|
46462
47042
|
"ContentSection": ContentSection,
|
|
@@ -46593,6 +47173,7 @@ var init_component_registry_generated = __esm({
|
|
|
46593
47173
|
"QuizBlock": QuizBlock,
|
|
46594
47174
|
"Radio": Radio,
|
|
46595
47175
|
"RangeSlider": RangeSlider,
|
|
47176
|
+
"ReflectionBlock": ReflectionBlock,
|
|
46596
47177
|
"RelationSelect": RelationSelect,
|
|
46597
47178
|
"RepeatableFormSection": RepeatableFormSection,
|
|
46598
47179
|
"ReplyTree": ReplyTree,
|
|
@@ -46607,6 +47188,7 @@ var init_component_registry_generated = __esm({
|
|
|
46607
47188
|
"SearchInput": SearchInput,
|
|
46608
47189
|
"Section": Section,
|
|
46609
47190
|
"SectionHeader": SectionHeader,
|
|
47191
|
+
"SegmentRenderer": SegmentRenderer,
|
|
46610
47192
|
"Select": Select,
|
|
46611
47193
|
"SequenceBar": SequenceBar,
|
|
46612
47194
|
"SequencerBoard": SequencerBoard,
|
|
@@ -46720,7 +47302,7 @@ function SuspenseConfigProvider({
|
|
|
46720
47302
|
config,
|
|
46721
47303
|
children
|
|
46722
47304
|
}) {
|
|
46723
|
-
return
|
|
47305
|
+
return React82__default.createElement(
|
|
46724
47306
|
SuspenseConfigContext.Provider,
|
|
46725
47307
|
{ value: config },
|
|
46726
47308
|
children
|
|
@@ -47210,7 +47792,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
47210
47792
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
47211
47793
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
47212
47794
|
}
|
|
47213
|
-
return /* @__PURE__ */ jsx(
|
|
47795
|
+
return /* @__PURE__ */ jsx(React82__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
47214
47796
|
}
|
|
47215
47797
|
if (!child || typeof child !== "object") return null;
|
|
47216
47798
|
const childId = `${parentId}-${index}`;
|
|
@@ -47250,14 +47832,14 @@ function isPatternConfig(value) {
|
|
|
47250
47832
|
if (value === null || value === void 0) return false;
|
|
47251
47833
|
if (typeof value !== "object") return false;
|
|
47252
47834
|
if (Array.isArray(value)) return false;
|
|
47253
|
-
if (
|
|
47835
|
+
if (React82__default.isValidElement(value)) return false;
|
|
47254
47836
|
if (value instanceof Date) return false;
|
|
47255
47837
|
if (typeof value === "function") return false;
|
|
47256
47838
|
const record = value;
|
|
47257
47839
|
return "type" in record && typeof record.type === "string";
|
|
47258
47840
|
}
|
|
47259
47841
|
function isPlainConfigObject(value) {
|
|
47260
|
-
if (
|
|
47842
|
+
if (React82__default.isValidElement(value)) return false;
|
|
47261
47843
|
if (value instanceof Date) return false;
|
|
47262
47844
|
const proto = Object.getPrototypeOf(value);
|
|
47263
47845
|
return proto === Object.prototype || proto === null;
|
|
@@ -47685,7 +48267,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
47685
48267
|
if (Array.isArray(body)) {
|
|
47686
48268
|
return body.map((b) => recur(b));
|
|
47687
48269
|
}
|
|
47688
|
-
if (body !== null && typeof body === "object" && !
|
|
48270
|
+
if (body !== null && typeof body === "object" && !React82__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
47689
48271
|
const out = {};
|
|
47690
48272
|
for (const [k, v] of Object.entries(body)) {
|
|
47691
48273
|
out[k] = recur(v);
|
|
@@ -47704,7 +48286,7 @@ function getSlotContentRenderer2() {
|
|
|
47704
48286
|
function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
47705
48287
|
return (item, index) => {
|
|
47706
48288
|
const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
|
|
47707
|
-
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" ||
|
|
48289
|
+
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React82__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
|
|
47708
48290
|
return null;
|
|
47709
48291
|
}
|
|
47710
48292
|
const record = resolvedBody;
|
|
@@ -47723,7 +48305,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
47723
48305
|
props: childProps,
|
|
47724
48306
|
priority: 0
|
|
47725
48307
|
};
|
|
47726
|
-
return
|
|
48308
|
+
return React82__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
47727
48309
|
};
|
|
47728
48310
|
}
|
|
47729
48311
|
function convertNode(node, callerKey) {
|
|
@@ -47742,7 +48324,7 @@ function convertNode(node, callerKey) {
|
|
|
47742
48324
|
});
|
|
47743
48325
|
return anyChanged ? mapped : node;
|
|
47744
48326
|
}
|
|
47745
|
-
if (typeof node === "object" && !
|
|
48327
|
+
if (typeof node === "object" && !React82__default.isValidElement(node) && !(node instanceof Date)) {
|
|
47746
48328
|
return convertObjectProps(node);
|
|
47747
48329
|
}
|
|
47748
48330
|
return node;
|