@almadar/ui 2.43.0 → 2.45.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 +1613 -1317
- package/dist/avl/index.d.cts +4 -0
- package/dist/avl/index.js +594 -298
- package/dist/components/index.cjs +402 -115
- package/dist/components/index.js +402 -115
- package/dist/components/organisms/avl/FlowCanvas.d.ts +4 -0
- package/dist/components/organisms/debug/WalkMinimap.d.ts +17 -0
- package/dist/providers/index.cjs +165 -164
- package/dist/providers/index.js +41 -40
- package/dist/runtime/EntitySchemaContext.d.ts +5 -0
- package/dist/runtime/index.cjs +402 -115
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +402 -116
- package/package.json +1 -1
package/dist/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React114 from 'react';
|
|
2
|
+
import React114__default, { createContext, useCallback, useState, useRef, useEffect, useMemo, useLayoutEffect, lazy, useContext, useSyncExternalStore } from 'react';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { EventBusContext } from '@almadar/ui/providers';
|
|
5
5
|
import 'react-dom';
|
|
@@ -384,7 +384,7 @@ function addWatch(entityType, callback) {
|
|
|
384
384
|
function useEntityRef(entityType) {
|
|
385
385
|
const versionRef = useRef(0);
|
|
386
386
|
const dataRef = useRef([]);
|
|
387
|
-
const getSnapshotStable =
|
|
387
|
+
const getSnapshotStable = React114__default.useCallback(() => {
|
|
388
388
|
const currentVersion = getVersion(entityType);
|
|
389
389
|
if (currentVersion !== versionRef.current) {
|
|
390
390
|
versionRef.current = currentVersion;
|
|
@@ -397,7 +397,7 @@ function useEntityRef(entityType) {
|
|
|
397
397
|
function useEntityById(entityType, id) {
|
|
398
398
|
const versionRef = useRef(0);
|
|
399
399
|
const dataRef = useRef(null);
|
|
400
|
-
const getSnapshotStable =
|
|
400
|
+
const getSnapshotStable = React114__default.useCallback(() => {
|
|
401
401
|
if (!id) return null;
|
|
402
402
|
const currentVersion = getVersion(entityType);
|
|
403
403
|
if (currentVersion !== versionRef.current) {
|
|
@@ -713,6 +713,7 @@ function useSelectionOptional() {
|
|
|
713
713
|
const context = useContext(SelectionContext);
|
|
714
714
|
return context;
|
|
715
715
|
}
|
|
716
|
+
createContext(null);
|
|
716
717
|
function cn(...inputs) {
|
|
717
718
|
return twMerge(clsx(inputs));
|
|
718
719
|
}
|
|
@@ -853,7 +854,7 @@ var positionStyles = {
|
|
|
853
854
|
fixed: "fixed",
|
|
854
855
|
sticky: "sticky"
|
|
855
856
|
};
|
|
856
|
-
var Box =
|
|
857
|
+
var Box = React114__default.forwardRef(
|
|
857
858
|
({
|
|
858
859
|
padding,
|
|
859
860
|
paddingX,
|
|
@@ -1124,7 +1125,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1124
1125
|
const IconComp = value;
|
|
1125
1126
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1126
1127
|
}
|
|
1127
|
-
if (
|
|
1128
|
+
if (React114__default.isValidElement(value)) {
|
|
1128
1129
|
return value;
|
|
1129
1130
|
}
|
|
1130
1131
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -1133,7 +1134,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1133
1134
|
}
|
|
1134
1135
|
return value;
|
|
1135
1136
|
}
|
|
1136
|
-
var Button =
|
|
1137
|
+
var Button = React114__default.forwardRef(
|
|
1137
1138
|
({
|
|
1138
1139
|
className,
|
|
1139
1140
|
variant = "primary",
|
|
@@ -1229,7 +1230,7 @@ var sizeStyles3 = {
|
|
|
1229
1230
|
md: "px-2.5 py-1 text-sm",
|
|
1230
1231
|
lg: "px-3 py-1.5 text-base"
|
|
1231
1232
|
};
|
|
1232
|
-
var Badge =
|
|
1233
|
+
var Badge = React114__default.forwardRef(
|
|
1233
1234
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
1234
1235
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
1235
1236
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -1256,7 +1257,7 @@ var Badge = React113__default.forwardRef(
|
|
|
1256
1257
|
}
|
|
1257
1258
|
);
|
|
1258
1259
|
Badge.displayName = "Badge";
|
|
1259
|
-
var Input =
|
|
1260
|
+
var Input = React114__default.forwardRef(
|
|
1260
1261
|
({
|
|
1261
1262
|
className,
|
|
1262
1263
|
inputType,
|
|
@@ -1368,7 +1369,7 @@ var Input = React113__default.forwardRef(
|
|
|
1368
1369
|
}
|
|
1369
1370
|
);
|
|
1370
1371
|
Input.displayName = "Input";
|
|
1371
|
-
var Label =
|
|
1372
|
+
var Label = React114__default.forwardRef(
|
|
1372
1373
|
({ className, required, children, ...props }, ref) => {
|
|
1373
1374
|
return /* @__PURE__ */ jsxs(
|
|
1374
1375
|
"label",
|
|
@@ -1388,7 +1389,7 @@ var Label = React113__default.forwardRef(
|
|
|
1388
1389
|
}
|
|
1389
1390
|
);
|
|
1390
1391
|
Label.displayName = "Label";
|
|
1391
|
-
var Textarea =
|
|
1392
|
+
var Textarea = React114__default.forwardRef(
|
|
1392
1393
|
({ className, error, ...props }, ref) => {
|
|
1393
1394
|
return /* @__PURE__ */ jsx(
|
|
1394
1395
|
"textarea",
|
|
@@ -1411,7 +1412,7 @@ var Textarea = React113__default.forwardRef(
|
|
|
1411
1412
|
}
|
|
1412
1413
|
);
|
|
1413
1414
|
Textarea.displayName = "Textarea";
|
|
1414
|
-
var Select =
|
|
1415
|
+
var Select = React114__default.forwardRef(
|
|
1415
1416
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
1416
1417
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
1417
1418
|
/* @__PURE__ */ jsxs(
|
|
@@ -1447,7 +1448,7 @@ var Select = React113__default.forwardRef(
|
|
|
1447
1448
|
}
|
|
1448
1449
|
);
|
|
1449
1450
|
Select.displayName = "Select";
|
|
1450
|
-
var Checkbox =
|
|
1451
|
+
var Checkbox = React114__default.forwardRef(
|
|
1451
1452
|
({ className, label, id, ...props }, ref) => {
|
|
1452
1453
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
1453
1454
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -1523,7 +1524,7 @@ var shadowStyles2 = {
|
|
|
1523
1524
|
md: "shadow",
|
|
1524
1525
|
lg: "shadow-lg"
|
|
1525
1526
|
};
|
|
1526
|
-
var Card =
|
|
1527
|
+
var Card = React114__default.forwardRef(
|
|
1527
1528
|
({
|
|
1528
1529
|
className,
|
|
1529
1530
|
variant = "bordered",
|
|
@@ -1559,9 +1560,9 @@ var Card = React113__default.forwardRef(
|
|
|
1559
1560
|
}
|
|
1560
1561
|
);
|
|
1561
1562
|
Card.displayName = "Card";
|
|
1562
|
-
var CardHeader =
|
|
1563
|
+
var CardHeader = React114__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
1563
1564
|
CardHeader.displayName = "CardHeader";
|
|
1564
|
-
var CardTitle =
|
|
1565
|
+
var CardTitle = React114__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1565
1566
|
"h3",
|
|
1566
1567
|
{
|
|
1567
1568
|
ref,
|
|
@@ -1574,11 +1575,11 @@ var CardTitle = React113__default.forwardRef(({ className, ...props }, ref) => /
|
|
|
1574
1575
|
}
|
|
1575
1576
|
));
|
|
1576
1577
|
CardTitle.displayName = "CardTitle";
|
|
1577
|
-
var CardContent =
|
|
1578
|
+
var CardContent = React114__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
1578
1579
|
CardContent.displayName = "CardContent";
|
|
1579
1580
|
var CardBody = CardContent;
|
|
1580
1581
|
CardBody.displayName = "CardBody";
|
|
1581
|
-
var CardFooter =
|
|
1582
|
+
var CardFooter = React114__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1582
1583
|
"div",
|
|
1583
1584
|
{
|
|
1584
1585
|
ref,
|
|
@@ -1593,7 +1594,7 @@ var sizeStyles4 = {
|
|
|
1593
1594
|
md: "h-6 w-6",
|
|
1594
1595
|
lg: "h-8 w-8"
|
|
1595
1596
|
};
|
|
1596
|
-
var Spinner =
|
|
1597
|
+
var Spinner = React114__default.forwardRef(
|
|
1597
1598
|
({ className, size = "md", ...props }, ref) => {
|
|
1598
1599
|
return /* @__PURE__ */ jsx(
|
|
1599
1600
|
"div",
|
|
@@ -1607,7 +1608,7 @@ var Spinner = React113__default.forwardRef(
|
|
|
1607
1608
|
}
|
|
1608
1609
|
);
|
|
1609
1610
|
Spinner.displayName = "Spinner";
|
|
1610
|
-
var Radio =
|
|
1611
|
+
var Radio = React114__default.forwardRef(
|
|
1611
1612
|
({
|
|
1612
1613
|
label,
|
|
1613
1614
|
helperText,
|
|
@@ -1711,7 +1712,7 @@ var Radio = React113__default.forwardRef(
|
|
|
1711
1712
|
}
|
|
1712
1713
|
);
|
|
1713
1714
|
Radio.displayName = "Radio";
|
|
1714
|
-
var Switch =
|
|
1715
|
+
var Switch = React114.forwardRef(
|
|
1715
1716
|
({
|
|
1716
1717
|
checked,
|
|
1717
1718
|
defaultChecked = false,
|
|
@@ -1722,10 +1723,10 @@ var Switch = React113.forwardRef(
|
|
|
1722
1723
|
name,
|
|
1723
1724
|
className
|
|
1724
1725
|
}, ref) => {
|
|
1725
|
-
const [isChecked, setIsChecked] =
|
|
1726
|
+
const [isChecked, setIsChecked] = React114.useState(
|
|
1726
1727
|
checked !== void 0 ? checked : defaultChecked
|
|
1727
1728
|
);
|
|
1728
|
-
|
|
1729
|
+
React114.useEffect(() => {
|
|
1729
1730
|
if (checked !== void 0) {
|
|
1730
1731
|
setIsChecked(checked);
|
|
1731
1732
|
}
|
|
@@ -1883,7 +1884,7 @@ var sizeStyles5 = {
|
|
|
1883
1884
|
md: "w-2.5 h-2.5",
|
|
1884
1885
|
lg: "w-3 h-3"
|
|
1885
1886
|
};
|
|
1886
|
-
var StatusDot =
|
|
1887
|
+
var StatusDot = React114__default.forwardRef(
|
|
1887
1888
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
1888
1889
|
return /* @__PURE__ */ jsx(
|
|
1889
1890
|
"span",
|
|
@@ -1930,7 +1931,7 @@ var iconMap2 = {
|
|
|
1930
1931
|
down: TrendingDown,
|
|
1931
1932
|
flat: ArrowRight
|
|
1932
1933
|
};
|
|
1933
|
-
var TrendIndicator =
|
|
1934
|
+
var TrendIndicator = React114__default.forwardRef(
|
|
1934
1935
|
({
|
|
1935
1936
|
className,
|
|
1936
1937
|
value,
|
|
@@ -1989,7 +1990,7 @@ var thumbSizes = {
|
|
|
1989
1990
|
md: "w-4 h-4",
|
|
1990
1991
|
lg: "w-5 h-5"
|
|
1991
1992
|
};
|
|
1992
|
-
var RangeSlider =
|
|
1993
|
+
var RangeSlider = React114__default.forwardRef(
|
|
1993
1994
|
({
|
|
1994
1995
|
className,
|
|
1995
1996
|
min = 0,
|
|
@@ -2192,7 +2193,7 @@ var paddingClasses = {
|
|
|
2192
2193
|
md: "py-16",
|
|
2193
2194
|
lg: "py-24"
|
|
2194
2195
|
};
|
|
2195
|
-
var ContentSection =
|
|
2196
|
+
var ContentSection = React114__default.forwardRef(
|
|
2196
2197
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
2197
2198
|
return /* @__PURE__ */ jsx(
|
|
2198
2199
|
Box,
|
|
@@ -2231,7 +2232,7 @@ var animatedStyles = {
|
|
|
2231
2232
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
2232
2233
|
"none": {}
|
|
2233
2234
|
};
|
|
2234
|
-
var AnimatedReveal =
|
|
2235
|
+
var AnimatedReveal = React114__default.forwardRef(
|
|
2235
2236
|
({
|
|
2236
2237
|
trigger = "scroll",
|
|
2237
2238
|
animation = "fade-up",
|
|
@@ -2384,7 +2385,7 @@ function applyMorphAnimation(container, animate, duration, delay, easing) {
|
|
|
2384
2385
|
el.style.opacity = animate ? "1" : "0";
|
|
2385
2386
|
});
|
|
2386
2387
|
}
|
|
2387
|
-
var AnimatedGraphic =
|
|
2388
|
+
var AnimatedGraphic = React114__default.forwardRef(
|
|
2388
2389
|
({
|
|
2389
2390
|
src,
|
|
2390
2391
|
svgContent,
|
|
@@ -2407,7 +2408,7 @@ var AnimatedGraphic = React113__default.forwardRef(
|
|
|
2407
2408
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
2408
2409
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
2409
2410
|
const prevAnimateRef = useRef(animate);
|
|
2410
|
-
const setRef =
|
|
2411
|
+
const setRef = React114__default.useCallback(
|
|
2411
2412
|
(node) => {
|
|
2412
2413
|
containerRef.current = node;
|
|
2413
2414
|
if (typeof ref === "function") ref(node);
|
|
@@ -2649,7 +2650,7 @@ var ErrorState = ({
|
|
|
2649
2650
|
);
|
|
2650
2651
|
};
|
|
2651
2652
|
ErrorState.displayName = "ErrorState";
|
|
2652
|
-
var ErrorBoundary = class extends
|
|
2653
|
+
var ErrorBoundary = class extends React114__default.Component {
|
|
2653
2654
|
constructor(props) {
|
|
2654
2655
|
super(props);
|
|
2655
2656
|
__publicField(this, "reset", () => {
|
|
@@ -3242,7 +3243,7 @@ function bindTraitStateGetter(getter) {
|
|
|
3242
3243
|
}
|
|
3243
3244
|
}
|
|
3244
3245
|
exposeOnWindow();
|
|
3245
|
-
var MarkdownContent =
|
|
3246
|
+
var MarkdownContent = React114__default.memo(
|
|
3246
3247
|
({ content, direction, className }) => {
|
|
3247
3248
|
const { t: _t } = useTranslate();
|
|
3248
3249
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -3308,7 +3309,7 @@ var MarkdownContent = React113__default.memo(
|
|
|
3308
3309
|
"th",
|
|
3309
3310
|
{
|
|
3310
3311
|
...props,
|
|
3311
|
-
className: "border border-gray-300 dark:border-gray-600 bg-
|
|
3312
|
+
className: "border border-gray-300 dark:border-gray-600 bg-[var(--color-muted)] px-4 py-2 text-left font-semibold",
|
|
3312
3313
|
children
|
|
3313
3314
|
}
|
|
3314
3315
|
);
|
|
@@ -3425,7 +3426,7 @@ function computeFoldRegions(code) {
|
|
|
3425
3426
|
}
|
|
3426
3427
|
var LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
3427
3428
|
var HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
3428
|
-
var CodeBlock =
|
|
3429
|
+
var CodeBlock = React114__default.memo(
|
|
3429
3430
|
({
|
|
3430
3431
|
code: rawCode,
|
|
3431
3432
|
language = "text",
|
|
@@ -3586,7 +3587,7 @@ var CodeBlock = React113__default.memo(
|
|
|
3586
3587
|
{
|
|
3587
3588
|
justify: "between",
|
|
3588
3589
|
align: "center",
|
|
3589
|
-
className: "px-3 py-2 bg-
|
|
3590
|
+
className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-gray-700",
|
|
3590
3591
|
children: [
|
|
3591
3592
|
showLanguageBadge && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: language }),
|
|
3592
3593
|
showCopyButton && /* @__PURE__ */ jsx(
|
|
@@ -3635,12 +3636,12 @@ GameAudioContext.displayName = "GameAudioContext";
|
|
|
3635
3636
|
|
|
3636
3637
|
// components/organisms/component-registry.generated.ts
|
|
3637
3638
|
function lazyThree(name, loader) {
|
|
3638
|
-
const Lazy =
|
|
3639
|
+
const Lazy = React114__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
3639
3640
|
function ThreeWrapper(props) {
|
|
3640
|
-
return
|
|
3641
|
-
|
|
3641
|
+
return React114__default.createElement(
|
|
3642
|
+
React114__default.Suspense,
|
|
3642
3643
|
{ fallback: null },
|
|
3643
|
-
|
|
3644
|
+
React114__default.createElement(Lazy, props)
|
|
3644
3645
|
);
|
|
3645
3646
|
}
|
|
3646
3647
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -3667,7 +3668,7 @@ function SuspenseConfigProvider({
|
|
|
3667
3668
|
config,
|
|
3668
3669
|
children
|
|
3669
3670
|
}) {
|
|
3670
|
-
return
|
|
3671
|
+
return React114__default.createElement(
|
|
3671
3672
|
SuspenseConfigContext.Provider,
|
|
3672
3673
|
{ value: config },
|
|
3673
3674
|
children
|
|
@@ -37,4 +37,9 @@ export declare function useEntitySchema(): EntitySchemaContextValue;
|
|
|
37
37
|
* Get a specific entity's schema definition.
|
|
38
38
|
*/
|
|
39
39
|
export declare function useEntityDefinition(entityName: string): ResolvedEntity | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Safe version of useEntitySchema that returns null when no provider is present.
|
|
42
|
+
* Used by UISlotRenderer which may render outside an EntitySchemaProvider (compiled mode).
|
|
43
|
+
*/
|
|
44
|
+
export declare function useEntitySchemaOptional(): EntitySchemaContextValue | null;
|
|
40
45
|
export default EntitySchemaProvider;
|