@almadar/ui 5.70.0 → 5.71.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 +1953 -1802
- package/dist/avl/index.d.cts +93 -56
- package/dist/avl/index.js +677 -526
- package/dist/components/avl/molecules/AvlEventWireEdge.d.ts +2 -1
- package/dist/components/avl/molecules/AvlTransitionEdge.d.ts +2 -1
- package/dist/components/avl/molecules/avl-behavior-compose-converter.d.ts +7 -5
- package/dist/components/avl/molecules/avl-behavior-compose-types.d.ts +41 -21
- package/dist/components/avl/molecules/avl-canvas-types.d.ts +10 -7
- package/dist/components/avl/molecules/avl-preview-converter.d.ts +5 -5
- package/dist/components/avl/molecules/avl-preview-types.d.ts +15 -4
- package/dist/components/avl/organisms/FlowCanvas.d.ts +2 -2
- package/dist/components/avl/organisms/avl-schema-parser.d.ts +18 -16
- package/dist/components/core/atoms/Button.d.ts +2 -0
- package/dist/components/core/atoms/ConditionalWrapper.d.ts +5 -4
- package/dist/components/core/molecules/Carousel.d.ts +2 -2
- package/dist/components/core/molecules/OrbitalVisualization.d.ts +4 -3
- package/dist/components/core/molecules/PageHeader.d.ts +3 -3
- package/dist/components/core/molecules/RepeatableFormSection.d.ts +4 -3
- package/dist/components/core/molecules/ViolationAlert.d.ts +2 -0
- package/dist/components/core/molecules/WizardContainer.d.ts +23 -22
- package/dist/components/core/organisms/CardGrid.d.ts +2 -2
- package/dist/components/core/organisms/CustomPattern.d.ts +3 -4
- package/dist/components/core/organisms/DataTable.d.ts +2 -2
- package/dist/components/core/organisms/DetailPanel.d.ts +1 -1
- package/dist/components/core/organisms/Form.d.ts +11 -11
- package/dist/components/core/organisms/List.d.ts +3 -5
- package/dist/components/core/organisms/StatCard.d.ts +2 -2
- package/dist/components/core/organisms/book/types.d.ts +1 -1
- package/dist/components/core/organisms/debug/RuntimeDebugger.d.ts +2 -1
- package/dist/components/core/organisms/debug/tabs/EventDispatcherTab.d.ts +2 -1
- package/dist/components/core/organisms/layout/DashboardGrid.d.ts +0 -2
- package/dist/components/core/organisms/types.d.ts +3 -2
- package/dist/components/game/atoms/ScoreDisplay.d.ts +3 -1
- package/dist/components/game/molecules/three/hooks/useSceneGraph.d.ts +2 -1
- package/dist/components/game/molecules/three/index.cjs +37 -24
- package/dist/components/game/molecules/three/index.js +37 -24
- package/dist/components/game/organisms/PinballBoard.d.ts +4 -4
- package/dist/components/game/organisms/boardEntity.d.ts +6 -6
- package/dist/components/game/organisms/puzzles/debugger/DebuggerBoard.d.ts +16 -2
- package/dist/components/game/organisms/puzzles/event-handler/puzzleObject.d.ts +21 -10
- package/dist/components/game/organisms/puzzles/state-architect/StateJsonView.d.ts +2 -1
- package/dist/components/index.cjs +1690 -1562
- package/dist/components/index.js +569 -441
- package/dist/docs/index.cjs +107 -104
- package/dist/docs/index.d.cts +2 -0
- package/dist/docs/index.js +38 -35
- package/dist/lib/getNestedValue.d.ts +2 -13
- package/dist/marketing/index.cjs +97 -98
- package/dist/marketing/index.d.cts +2 -0
- package/dist/marketing/index.js +54 -55
- package/dist/providers/index.cjs +1663 -1535
- package/dist/providers/index.js +554 -426
- package/dist/runtime/index.cjs +1721 -1593
- package/dist/runtime/index.js +560 -432
- package/package.json +1 -1
package/dist/docs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React10 = require('react');
|
|
4
4
|
var logger = require('@almadar/logger');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var LucideIcons2 = require('lucide-react');
|
|
@@ -44,7 +44,7 @@ function _interopNamespace(e) {
|
|
|
44
44
|
return Object.freeze(n);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
var
|
|
47
|
+
var React10__default = /*#__PURE__*/_interopDefault(React10);
|
|
48
48
|
var LucideIcons2__namespace = /*#__PURE__*/_interopNamespace(LucideIcons2);
|
|
49
49
|
var SyntaxHighlighter__default = /*#__PURE__*/_interopDefault(SyntaxHighlighter);
|
|
50
50
|
var dark__default = /*#__PURE__*/_interopDefault(dark);
|
|
@@ -2570,17 +2570,17 @@ var init_EventBusProvider = __esm({
|
|
|
2570
2570
|
"use client";
|
|
2571
2571
|
logger.createLogger("almadar:eventbus");
|
|
2572
2572
|
logger.createLogger("almadar:eventbus:subscribe");
|
|
2573
|
-
EventBusContext =
|
|
2573
|
+
EventBusContext = React10.createContext(null);
|
|
2574
2574
|
}
|
|
2575
2575
|
});
|
|
2576
2576
|
function useTraitScope() {
|
|
2577
|
-
return
|
|
2577
|
+
return React10.useContext(TraitScopeContext);
|
|
2578
2578
|
}
|
|
2579
2579
|
var TraitScopeContext;
|
|
2580
2580
|
var init_TraitScopeProvider = __esm({
|
|
2581
2581
|
"providers/TraitScopeProvider.tsx"() {
|
|
2582
2582
|
"use client";
|
|
2583
|
-
TraitScopeContext =
|
|
2583
|
+
TraitScopeContext = React10.createContext(null);
|
|
2584
2584
|
}
|
|
2585
2585
|
});
|
|
2586
2586
|
function getGlobalEventBus() {
|
|
@@ -2590,10 +2590,10 @@ function getGlobalEventBus() {
|
|
|
2590
2590
|
return null;
|
|
2591
2591
|
}
|
|
2592
2592
|
function useEventBus() {
|
|
2593
|
-
const context =
|
|
2593
|
+
const context = React10.useContext(EventBusContext);
|
|
2594
2594
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
2595
2595
|
const scope = useTraitScope();
|
|
2596
|
-
return
|
|
2596
|
+
return React10.useMemo(() => {
|
|
2597
2597
|
if (!scope) {
|
|
2598
2598
|
return {
|
|
2599
2599
|
...baseBus,
|
|
@@ -2704,24 +2704,24 @@ var init_useEventBus = __esm({
|
|
|
2704
2704
|
});
|
|
2705
2705
|
function useTapReveal(options = {}) {
|
|
2706
2706
|
const { onReveal, onDismiss, refs, enabled = true } = options;
|
|
2707
|
-
const [revealed, setRevealed] =
|
|
2708
|
-
const onRevealRef =
|
|
2709
|
-
const onDismissRef =
|
|
2707
|
+
const [revealed, setRevealed] = React10.useState(false);
|
|
2708
|
+
const onRevealRef = React10.useRef(onReveal);
|
|
2709
|
+
const onDismissRef = React10.useRef(onDismiss);
|
|
2710
2710
|
onRevealRef.current = onReveal;
|
|
2711
2711
|
onDismissRef.current = onDismiss;
|
|
2712
|
-
const reveal =
|
|
2712
|
+
const reveal = React10.useCallback(() => {
|
|
2713
2713
|
setRevealed((wasRevealed) => {
|
|
2714
2714
|
if (!wasRevealed) onRevealRef.current?.();
|
|
2715
2715
|
return true;
|
|
2716
2716
|
});
|
|
2717
2717
|
}, []);
|
|
2718
|
-
const dismiss =
|
|
2718
|
+
const dismiss = React10.useCallback(() => {
|
|
2719
2719
|
setRevealed((wasRevealed) => {
|
|
2720
2720
|
if (wasRevealed) onDismissRef.current?.();
|
|
2721
2721
|
return false;
|
|
2722
2722
|
});
|
|
2723
2723
|
}, []);
|
|
2724
|
-
const onPointerDown =
|
|
2724
|
+
const onPointerDown = React10.useCallback(
|
|
2725
2725
|
(e) => {
|
|
2726
2726
|
if (!enabled || e.pointerType === "mouse") return;
|
|
2727
2727
|
if (revealed) dismiss();
|
|
@@ -2729,7 +2729,7 @@ function useTapReveal(options = {}) {
|
|
|
2729
2729
|
},
|
|
2730
2730
|
[enabled, revealed, reveal, dismiss]
|
|
2731
2731
|
);
|
|
2732
|
-
|
|
2732
|
+
React10.useEffect(() => {
|
|
2733
2733
|
if (!revealed || typeof document === "undefined") return;
|
|
2734
2734
|
const onDocDown = (ev) => {
|
|
2735
2735
|
const target = ev.target;
|
|
@@ -2858,7 +2858,7 @@ var init_Box = __esm({
|
|
|
2858
2858
|
fixed: "fixed",
|
|
2859
2859
|
sticky: "sticky"
|
|
2860
2860
|
};
|
|
2861
|
-
exports.Box =
|
|
2861
|
+
exports.Box = React10__default.default.forwardRef(
|
|
2862
2862
|
({
|
|
2863
2863
|
padding,
|
|
2864
2864
|
paddingX,
|
|
@@ -2890,20 +2890,20 @@ var init_Box = __esm({
|
|
|
2890
2890
|
...rest
|
|
2891
2891
|
}, ref) => {
|
|
2892
2892
|
const eventBus = useEventBus();
|
|
2893
|
-
const handleClick =
|
|
2893
|
+
const handleClick = React10.useCallback((e) => {
|
|
2894
2894
|
if (action) {
|
|
2895
2895
|
e.stopPropagation();
|
|
2896
2896
|
eventBus.emit(`UI:${action}`, actionPayload ?? {});
|
|
2897
2897
|
}
|
|
2898
2898
|
onClick?.(e);
|
|
2899
2899
|
}, [action, actionPayload, eventBus, onClick]);
|
|
2900
|
-
const handleMouseEnter =
|
|
2900
|
+
const handleMouseEnter = React10.useCallback((e) => {
|
|
2901
2901
|
if (hoverEvent) {
|
|
2902
2902
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
2903
2903
|
}
|
|
2904
2904
|
onMouseEnter?.(e);
|
|
2905
2905
|
}, [hoverEvent, eventBus, onMouseEnter]);
|
|
2906
|
-
const handleMouseLeave =
|
|
2906
|
+
const handleMouseLeave = React10.useCallback((e) => {
|
|
2907
2907
|
if (hoverEvent) {
|
|
2908
2908
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
2909
2909
|
}
|
|
@@ -2911,19 +2911,19 @@ var init_Box = __esm({
|
|
|
2911
2911
|
}, [hoverEvent, eventBus, onMouseLeave]);
|
|
2912
2912
|
const { triggerProps } = useTapReveal({
|
|
2913
2913
|
enabled: tapReveal && !!hoverEvent,
|
|
2914
|
-
onReveal:
|
|
2914
|
+
onReveal: React10.useCallback(() => {
|
|
2915
2915
|
if (hoverEvent) eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
2916
2916
|
}, [hoverEvent, eventBus]),
|
|
2917
|
-
onDismiss:
|
|
2917
|
+
onDismiss: React10.useCallback(() => {
|
|
2918
2918
|
if (hoverEvent) eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
2919
2919
|
}, [hoverEvent, eventBus])
|
|
2920
2920
|
});
|
|
2921
|
-
const handlePointerDown =
|
|
2921
|
+
const handlePointerDown = React10.useCallback((e) => {
|
|
2922
2922
|
if (hoverEvent && tapReveal) triggerProps.onPointerDown(e);
|
|
2923
2923
|
onPointerDown?.(e);
|
|
2924
2924
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
2925
2925
|
const isClickable = action || onClick;
|
|
2926
|
-
return
|
|
2926
|
+
return React10__default.default.createElement(
|
|
2927
2927
|
Component,
|
|
2928
2928
|
{
|
|
2929
2929
|
ref,
|
|
@@ -3019,9 +3019,8 @@ var init_Stack = __esm({
|
|
|
3019
3019
|
};
|
|
3020
3020
|
const isHorizontal = direction === "horizontal";
|
|
3021
3021
|
const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
Comp,
|
|
3022
|
+
return React10__default.default.createElement(
|
|
3023
|
+
Component,
|
|
3025
3024
|
{
|
|
3026
3025
|
className: cn(
|
|
3027
3026
|
"flex",
|
|
@@ -3037,9 +3036,9 @@ var init_Stack = __esm({
|
|
|
3037
3036
|
onClick: action || onClick ? handleClick : void 0,
|
|
3038
3037
|
onKeyDown,
|
|
3039
3038
|
role,
|
|
3040
|
-
tabIndex
|
|
3041
|
-
|
|
3042
|
-
|
|
3039
|
+
tabIndex
|
|
3040
|
+
},
|
|
3041
|
+
children
|
|
3043
3042
|
);
|
|
3044
3043
|
};
|
|
3045
3044
|
exports.VStack = (props) => /* @__PURE__ */ jsxRuntime.jsx(Stack, { direction: "vertical", ...props });
|
|
@@ -3136,9 +3135,8 @@ var init_Typography = __esm({
|
|
|
3136
3135
|
}) => {
|
|
3137
3136
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
3138
3137
|
const Component = as || defaultElements[variant];
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
Comp,
|
|
3138
|
+
return React10__default.default.createElement(
|
|
3139
|
+
Component,
|
|
3142
3140
|
{
|
|
3143
3141
|
id,
|
|
3144
3142
|
className: cn(
|
|
@@ -3151,9 +3149,9 @@ var init_Typography = __esm({
|
|
|
3151
3149
|
overflow && overflowStyles2[overflow],
|
|
3152
3150
|
className
|
|
3153
3151
|
),
|
|
3154
|
-
style
|
|
3155
|
-
|
|
3156
|
-
|
|
3152
|
+
style
|
|
3153
|
+
},
|
|
3154
|
+
children ?? content
|
|
3157
3155
|
);
|
|
3158
3156
|
};
|
|
3159
3157
|
exports.Typography.displayName = "Typography";
|
|
@@ -3197,7 +3195,7 @@ function getIconFamilyServerSnapshot() {
|
|
|
3197
3195
|
return DEFAULT_FAMILY;
|
|
3198
3196
|
}
|
|
3199
3197
|
function useIconFamily() {
|
|
3200
|
-
return
|
|
3198
|
+
return React10.useSyncExternalStore(
|
|
3201
3199
|
subscribeIconFamily,
|
|
3202
3200
|
getIconFamilySnapshot,
|
|
3203
3201
|
getIconFamilyServerSnapshot
|
|
@@ -3218,7 +3216,7 @@ function loadLib(key, importer) {
|
|
|
3218
3216
|
return p;
|
|
3219
3217
|
}
|
|
3220
3218
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
3221
|
-
const Lazy =
|
|
3219
|
+
const Lazy = React10__default.default.lazy(async () => {
|
|
3222
3220
|
const lib = await loadLib(libKey, importer);
|
|
3223
3221
|
const Comp = pick(lib);
|
|
3224
3222
|
if (!Comp) {
|
|
@@ -3228,7 +3226,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
3228
3226
|
return { default: Comp };
|
|
3229
3227
|
});
|
|
3230
3228
|
const Wrapped = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3231
|
-
|
|
3229
|
+
React10__default.default.Suspense,
|
|
3232
3230
|
{
|
|
3233
3231
|
fallback: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3234
3232
|
"span",
|
|
@@ -3896,9 +3894,10 @@ function resolveIcon(name) {
|
|
|
3896
3894
|
function doResolve(name) {
|
|
3897
3895
|
if (iconAliases[name]) return iconAliases[name];
|
|
3898
3896
|
const pascalName = kebabToPascal2(name);
|
|
3899
|
-
const
|
|
3897
|
+
const lucideMap = LucideIcons2__namespace;
|
|
3898
|
+
const directLookup = lucideMap[pascalName];
|
|
3900
3899
|
if (directLookup && typeof directLookup === "object") return directLookup;
|
|
3901
|
-
const asIs =
|
|
3900
|
+
const asIs = lucideMap[name];
|
|
3902
3901
|
if (asIs && typeof asIs === "object") return asIs;
|
|
3903
3902
|
return LucideIcons2__namespace.HelpCircle;
|
|
3904
3903
|
}
|
|
@@ -3954,7 +3953,7 @@ var init_Icon = __esm({
|
|
|
3954
3953
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
3955
3954
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
3956
3955
|
const family = useIconFamily();
|
|
3957
|
-
const RenderedComponent =
|
|
3956
|
+
const RenderedComponent = React10__default.default.useMemo(() => {
|
|
3958
3957
|
if (directIcon) return null;
|
|
3959
3958
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
3960
3959
|
}, [directIcon, effectiveName, family]);
|
|
@@ -4004,6 +4003,9 @@ var init_Icon = __esm({
|
|
|
4004
4003
|
exports.Icon.displayName = "Icon";
|
|
4005
4004
|
}
|
|
4006
4005
|
});
|
|
4006
|
+
function isIconLike(v) {
|
|
4007
|
+
return typeof v.render === "function";
|
|
4008
|
+
}
|
|
4007
4009
|
function resolveIconProp(value, sizeClass) {
|
|
4008
4010
|
if (!value) return null;
|
|
4009
4011
|
if (typeof value === "string") {
|
|
@@ -4013,10 +4015,10 @@ function resolveIconProp(value, sizeClass) {
|
|
|
4013
4015
|
const IconComp = value;
|
|
4014
4016
|
return /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: sizeClass });
|
|
4015
4017
|
}
|
|
4016
|
-
if (
|
|
4018
|
+
if (React10__default.default.isValidElement(value)) {
|
|
4017
4019
|
return value;
|
|
4018
4020
|
}
|
|
4019
|
-
if (typeof value === "object" && value !== null &&
|
|
4021
|
+
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
4020
4022
|
const IconComp = value;
|
|
4021
4023
|
return /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: sizeClass });
|
|
4022
4024
|
}
|
|
@@ -4089,7 +4091,7 @@ var init_Button = __esm({
|
|
|
4089
4091
|
md: "h-icon-default w-icon-default",
|
|
4090
4092
|
lg: "h-icon-default w-icon-default"
|
|
4091
4093
|
};
|
|
4092
|
-
exports.Button =
|
|
4094
|
+
exports.Button = React10__default.default.forwardRef(
|
|
4093
4095
|
({
|
|
4094
4096
|
className,
|
|
4095
4097
|
variant = "primary",
|
|
@@ -4105,6 +4107,7 @@ var init_Button = __esm({
|
|
|
4105
4107
|
label,
|
|
4106
4108
|
children,
|
|
4107
4109
|
onClick,
|
|
4110
|
+
"data-testid": dataTestId,
|
|
4108
4111
|
...props
|
|
4109
4112
|
}, ref) => {
|
|
4110
4113
|
const eventBus = useEventBus();
|
|
@@ -4137,7 +4140,7 @@ var init_Button = __esm({
|
|
|
4137
4140
|
),
|
|
4138
4141
|
onClick: handleClick,
|
|
4139
4142
|
...props,
|
|
4140
|
-
"data-testid":
|
|
4143
|
+
"data-testid": dataTestId ?? (action ? `action-${action}` : void 0),
|
|
4141
4144
|
children: [
|
|
4142
4145
|
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.Loader2, { className: "h-icon-default w-icon-default animate-spin" }) : resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0", children: resolvedLeftIcon }),
|
|
4143
4146
|
children || label,
|
|
@@ -4161,7 +4164,7 @@ var init_Spinner = __esm({
|
|
|
4161
4164
|
md: "h-6 w-6",
|
|
4162
4165
|
lg: "h-8 w-8"
|
|
4163
4166
|
};
|
|
4164
|
-
Spinner =
|
|
4167
|
+
Spinner = React10__default.default.forwardRef(
|
|
4165
4168
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
4166
4169
|
if (overlay) {
|
|
4167
4170
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4251,7 +4254,7 @@ var init_Card = __esm({
|
|
|
4251
4254
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
4252
4255
|
"tile-image-first": "p-0 overflow-hidden"
|
|
4253
4256
|
};
|
|
4254
|
-
exports.Card =
|
|
4257
|
+
exports.Card = React10__default.default.forwardRef(
|
|
4255
4258
|
({
|
|
4256
4259
|
className,
|
|
4257
4260
|
variant = "bordered",
|
|
@@ -4299,9 +4302,9 @@ var init_Card = __esm({
|
|
|
4299
4302
|
}
|
|
4300
4303
|
);
|
|
4301
4304
|
exports.Card.displayName = "Card";
|
|
4302
|
-
CardHeader =
|
|
4305
|
+
CardHeader = React10__default.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
4303
4306
|
CardHeader.displayName = "CardHeader";
|
|
4304
|
-
CardTitle =
|
|
4307
|
+
CardTitle = React10__default.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4305
4308
|
"h3",
|
|
4306
4309
|
{
|
|
4307
4310
|
ref,
|
|
@@ -4314,11 +4317,11 @@ var init_Card = __esm({
|
|
|
4314
4317
|
}
|
|
4315
4318
|
));
|
|
4316
4319
|
CardTitle.displayName = "CardTitle";
|
|
4317
|
-
CardContent =
|
|
4320
|
+
CardContent = React10__default.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
|
|
4318
4321
|
CardContent.displayName = "CardContent";
|
|
4319
4322
|
CardBody = CardContent;
|
|
4320
4323
|
CardBody.displayName = "CardBody";
|
|
4321
|
-
CardFooter =
|
|
4324
|
+
CardFooter = React10__default.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4322
4325
|
"div",
|
|
4323
4326
|
{
|
|
4324
4327
|
ref,
|
|
@@ -4988,7 +4991,7 @@ var init_en = __esm({
|
|
|
4988
4991
|
}
|
|
4989
4992
|
});
|
|
4990
4993
|
function useTranslate() {
|
|
4991
|
-
return
|
|
4994
|
+
return React10.useContext(I18nContext);
|
|
4992
4995
|
}
|
|
4993
4996
|
var _meta, coreMessages, coreLocale, I18nContext;
|
|
4994
4997
|
var init_useTranslate = __esm({
|
|
@@ -4997,7 +5000,7 @@ var init_useTranslate = __esm({
|
|
|
4997
5000
|
init_en();
|
|
4998
5001
|
({ $meta: _meta, ...coreMessages } = en_default);
|
|
4999
5002
|
coreLocale = coreMessages;
|
|
5000
|
-
I18nContext =
|
|
5003
|
+
I18nContext = React10.createContext({
|
|
5001
5004
|
locale: "en",
|
|
5002
5005
|
direction: "ltr",
|
|
5003
5006
|
t: (key, params) => {
|
|
@@ -5021,7 +5024,7 @@ var init_Input = __esm({
|
|
|
5021
5024
|
init_Icon();
|
|
5022
5025
|
init_useTranslate();
|
|
5023
5026
|
init_useEventBus();
|
|
5024
|
-
exports.Input =
|
|
5027
|
+
exports.Input = React10__default.default.forwardRef(
|
|
5025
5028
|
({
|
|
5026
5029
|
className,
|
|
5027
5030
|
inputType,
|
|
@@ -5189,7 +5192,7 @@ var init_DocSidebar = __esm({
|
|
|
5189
5192
|
init_Icon();
|
|
5190
5193
|
init_useTranslate();
|
|
5191
5194
|
DocSidebarCategory = ({ item, depth }) => {
|
|
5192
|
-
const [expanded, setExpanded] =
|
|
5195
|
+
const [expanded, setExpanded] = React10.useState(
|
|
5193
5196
|
() => item.items?.some(function hasActive(child) {
|
|
5194
5197
|
if (child.active) return true;
|
|
5195
5198
|
return child.items?.some(hasActive) ?? false;
|
|
@@ -5370,7 +5373,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
5370
5373
|
"aria-label": t("aria.breadcrumb"),
|
|
5371
5374
|
children: /* @__PURE__ */ jsxRuntime.jsx(exports.HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
5372
5375
|
const isLast = idx === items.length - 1;
|
|
5373
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5376
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React10__default.default.Fragment, { children: [
|
|
5374
5377
|
idx > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5375
5378
|
exports.Icon,
|
|
5376
5379
|
{
|
|
@@ -5428,7 +5431,7 @@ var init_Textarea = __esm({
|
|
|
5428
5431
|
"components/core/atoms/Textarea.tsx"() {
|
|
5429
5432
|
init_cn();
|
|
5430
5433
|
init_useEventBus();
|
|
5431
|
-
Textarea =
|
|
5434
|
+
Textarea = React10__default.default.forwardRef(
|
|
5432
5435
|
({ className, error, onChange, ...props }, ref) => {
|
|
5433
5436
|
const eventBus = useEventBus();
|
|
5434
5437
|
const handleChange = (e) => {
|
|
@@ -5504,7 +5507,7 @@ var init_Badge = __esm({
|
|
|
5504
5507
|
md: "px-2.5 py-1 text-sm",
|
|
5505
5508
|
lg: "px-3 py-1.5 text-base"
|
|
5506
5509
|
};
|
|
5507
|
-
Badge =
|
|
5510
|
+
Badge = React10__default.default.forwardRef(
|
|
5508
5511
|
({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
|
|
5509
5512
|
const iconSizes = {
|
|
5510
5513
|
sm: "h-icon-default w-icon-default",
|
|
@@ -5601,11 +5604,11 @@ var init_Tabs = __esm({
|
|
|
5601
5604
|
const eventBus = useEventBus();
|
|
5602
5605
|
const { t } = useTranslate();
|
|
5603
5606
|
const initialActive = safeItems.find((item) => item.active)?.id;
|
|
5604
|
-
const [internalActiveTab, setInternalActiveTab] =
|
|
5607
|
+
const [internalActiveTab, setInternalActiveTab] = React10.useState(
|
|
5605
5608
|
defaultActiveTab || initialActive || safeItems[0]?.id || ""
|
|
5606
5609
|
);
|
|
5607
5610
|
const activeTab = controlledActiveTab !== void 0 ? controlledActiveTab : internalActiveTab;
|
|
5608
|
-
const tabRefs =
|
|
5611
|
+
const tabRefs = React10.useRef({});
|
|
5609
5612
|
const handleTabChange = (tabId, tabEvent) => {
|
|
5610
5613
|
if (controlledActiveTab === void 0) {
|
|
5611
5614
|
setInternalActiveTab(tabId);
|
|
@@ -6097,7 +6100,7 @@ var init_CodeBlock = __esm({
|
|
|
6097
6100
|
};
|
|
6098
6101
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
6099
6102
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
6100
|
-
exports.DocCodeBlock =
|
|
6103
|
+
exports.DocCodeBlock = React10__default.default.memo(
|
|
6101
6104
|
({
|
|
6102
6105
|
code: rawCode,
|
|
6103
6106
|
language = "text",
|
|
@@ -6129,16 +6132,16 @@ var init_CodeBlock = __esm({
|
|
|
6129
6132
|
const activeStyle = isOrb ? orbStyle : isLolo ? loloStyle : dark__default.default;
|
|
6130
6133
|
const eventBus = useEventBus();
|
|
6131
6134
|
const { t } = useTranslate();
|
|
6132
|
-
const scrollRef =
|
|
6133
|
-
const codeRef =
|
|
6134
|
-
const savedScrollLeftRef =
|
|
6135
|
-
const [copied, setCopied] =
|
|
6136
|
-
const [wrap, setWrap] =
|
|
6137
|
-
const [activeFileIndex, setActiveFileIndex] =
|
|
6135
|
+
const scrollRef = React10.useRef(null);
|
|
6136
|
+
const codeRef = React10.useRef(null);
|
|
6137
|
+
const savedScrollLeftRef = React10.useRef(0);
|
|
6138
|
+
const [copied, setCopied] = React10.useState(false);
|
|
6139
|
+
const [wrap, setWrap] = React10.useState(wordWrap);
|
|
6140
|
+
const [activeFileIndex, setActiveFileIndex] = React10.useState(0);
|
|
6138
6141
|
const activeFile = files?.[activeFileIndex];
|
|
6139
6142
|
const activeCode = activeFile?.code ?? code;
|
|
6140
6143
|
const activeLanguage = activeFile?.language ?? language;
|
|
6141
|
-
const diffLines =
|
|
6144
|
+
const diffLines = React10.useMemo(() => {
|
|
6142
6145
|
if (propDiff) return propDiff;
|
|
6143
6146
|
if (mode === "diff" && oldValue !== void 0 && newValue !== void 0) {
|
|
6144
6147
|
return generateDiff(oldValue, newValue);
|
|
@@ -6147,19 +6150,19 @@ var init_CodeBlock = __esm({
|
|
|
6147
6150
|
}, [propDiff, mode, oldValue, newValue]);
|
|
6148
6151
|
const isViewerMode = !!(title || files || showLineNumbers || diffLines || mode === "diff" || actions);
|
|
6149
6152
|
const effectiveCopy = showCopy ?? showCopyButton;
|
|
6150
|
-
const [editableValue, setEditableValue] =
|
|
6151
|
-
const [editableTextareaKey, setEditableTextareaKey] =
|
|
6152
|
-
const lastPropCodeRef =
|
|
6153
|
-
const editableTextareaRef =
|
|
6154
|
-
const editableOverlayRef =
|
|
6155
|
-
|
|
6153
|
+
const [editableValue, setEditableValue] = React10.useState(code);
|
|
6154
|
+
const [editableTextareaKey, setEditableTextareaKey] = React10.useState(0);
|
|
6155
|
+
const lastPropCodeRef = React10.useRef(code);
|
|
6156
|
+
const editableTextareaRef = React10.useRef(null);
|
|
6157
|
+
const editableOverlayRef = React10.useRef(null);
|
|
6158
|
+
React10.useEffect(() => {
|
|
6156
6159
|
if (code !== lastPropCodeRef.current) {
|
|
6157
6160
|
lastPropCodeRef.current = code;
|
|
6158
6161
|
setEditableValue(code);
|
|
6159
6162
|
setEditableTextareaKey((k) => k + 1);
|
|
6160
6163
|
}
|
|
6161
6164
|
}, [code]);
|
|
6162
|
-
const handleEditableScroll =
|
|
6165
|
+
const handleEditableScroll = React10.useCallback(() => {
|
|
6163
6166
|
const ta = editableTextareaRef.current;
|
|
6164
6167
|
const ov = editableOverlayRef.current;
|
|
6165
6168
|
if (ta && ov) {
|
|
@@ -6167,7 +6170,7 @@ var init_CodeBlock = __esm({
|
|
|
6167
6170
|
ov.scrollLeft = ta.scrollLeft;
|
|
6168
6171
|
}
|
|
6169
6172
|
}, []);
|
|
6170
|
-
const errorLineProps =
|
|
6173
|
+
const errorLineProps = React10.useMemo(() => {
|
|
6171
6174
|
if (!errorLines || errorLines.size === 0) {
|
|
6172
6175
|
return LINE_PROPS_FN;
|
|
6173
6176
|
}
|
|
@@ -6190,17 +6193,17 @@ var init_CodeBlock = __esm({
|
|
|
6190
6193
|
};
|
|
6191
6194
|
}, [errorLines]);
|
|
6192
6195
|
const isFoldable = foldableProp ?? true;
|
|
6193
|
-
const [collapsed, setCollapsed] =
|
|
6194
|
-
const foldRegions =
|
|
6196
|
+
const [collapsed, setCollapsed] = React10.useState(() => /* @__PURE__ */ new Set());
|
|
6197
|
+
const foldRegions = React10.useMemo(
|
|
6195
6198
|
() => isFoldable ? computeFoldRegions(code) : [],
|
|
6196
6199
|
[code, isFoldable]
|
|
6197
6200
|
);
|
|
6198
|
-
const foldStartMap =
|
|
6201
|
+
const foldStartMap = React10.useMemo(() => {
|
|
6199
6202
|
const m = /* @__PURE__ */ new Map();
|
|
6200
6203
|
for (const r2 of foldRegions) m.set(r2.start, r2);
|
|
6201
6204
|
return m;
|
|
6202
6205
|
}, [foldRegions]);
|
|
6203
|
-
const hiddenLines =
|
|
6206
|
+
const hiddenLines = React10.useMemo(() => {
|
|
6204
6207
|
const h = /* @__PURE__ */ new Set();
|
|
6205
6208
|
for (const r2 of foldRegions) {
|
|
6206
6209
|
if (!collapsed.has(r2.start)) continue;
|
|
@@ -6208,13 +6211,13 @@ var init_CodeBlock = __esm({
|
|
|
6208
6211
|
}
|
|
6209
6212
|
return h;
|
|
6210
6213
|
}, [foldRegions, collapsed]);
|
|
6211
|
-
const collapsedRef =
|
|
6214
|
+
const collapsedRef = React10.useRef(collapsed);
|
|
6212
6215
|
collapsedRef.current = collapsed;
|
|
6213
|
-
const foldStartMapRef =
|
|
6216
|
+
const foldStartMapRef = React10.useRef(foldStartMap);
|
|
6214
6217
|
foldStartMapRef.current = foldStartMap;
|
|
6215
|
-
const hiddenLinesRef =
|
|
6218
|
+
const hiddenLinesRef = React10.useRef(hiddenLines);
|
|
6216
6219
|
hiddenLinesRef.current = hiddenLines;
|
|
6217
|
-
const toggleFold =
|
|
6220
|
+
const toggleFold = React10.useCallback((lineNum) => {
|
|
6218
6221
|
setCollapsed((prev) => {
|
|
6219
6222
|
const next = new Set(prev);
|
|
6220
6223
|
if (next.has(lineNum)) next.delete(lineNum);
|
|
@@ -6222,12 +6225,12 @@ var init_CodeBlock = __esm({
|
|
|
6222
6225
|
return next;
|
|
6223
6226
|
});
|
|
6224
6227
|
}, []);
|
|
6225
|
-
const toggleFoldRef =
|
|
6228
|
+
const toggleFoldRef = React10.useRef(toggleFold);
|
|
6226
6229
|
toggleFoldRef.current = toggleFold;
|
|
6227
|
-
|
|
6230
|
+
React10.useEffect(() => {
|
|
6228
6231
|
setCollapsed(/* @__PURE__ */ new Set());
|
|
6229
6232
|
}, [code]);
|
|
6230
|
-
const highlightedElement =
|
|
6233
|
+
const highlightedElement = React10.useMemo(
|
|
6231
6234
|
() => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6232
6235
|
SyntaxHighlighter__default.default,
|
|
6233
6236
|
{
|
|
@@ -6252,7 +6255,7 @@ var init_CodeBlock = __esm({
|
|
|
6252
6255
|
),
|
|
6253
6256
|
[code, language, activeStyle]
|
|
6254
6257
|
);
|
|
6255
|
-
|
|
6258
|
+
React10.useLayoutEffect(() => {
|
|
6256
6259
|
const container = codeRef.current;
|
|
6257
6260
|
if (!container) return;
|
|
6258
6261
|
container.querySelectorAll(".fold-toggle, .fold-summary").forEach((el) => el.remove());
|
|
@@ -6296,17 +6299,17 @@ var init_CodeBlock = __esm({
|
|
|
6296
6299
|
}
|
|
6297
6300
|
});
|
|
6298
6301
|
}, [collapsed, hiddenLines, foldStartMap, foldRegions, isFoldable]);
|
|
6299
|
-
|
|
6302
|
+
React10.useLayoutEffect(() => {
|
|
6300
6303
|
const el = scrollRef.current;
|
|
6301
6304
|
return () => {
|
|
6302
6305
|
if (el) savedScrollLeftRef.current = el.scrollLeft;
|
|
6303
6306
|
};
|
|
6304
6307
|
}, [language, code]);
|
|
6305
|
-
|
|
6308
|
+
React10.useLayoutEffect(() => {
|
|
6306
6309
|
const el = scrollRef.current;
|
|
6307
6310
|
if (el) el.scrollLeft = savedScrollLeftRef.current;
|
|
6308
6311
|
}, [language, code]);
|
|
6309
|
-
|
|
6312
|
+
React10.useEffect(() => {
|
|
6310
6313
|
const el = scrollRef.current;
|
|
6311
6314
|
if (!el) return;
|
|
6312
6315
|
const handle = () => {
|
|
@@ -6326,7 +6329,7 @@ var init_CodeBlock = __esm({
|
|
|
6326
6329
|
eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: false });
|
|
6327
6330
|
}
|
|
6328
6331
|
};
|
|
6329
|
-
const handleSelectionCopy =
|
|
6332
|
+
const handleSelectionCopy = React10.useCallback((e) => {
|
|
6330
6333
|
if (hiddenLinesRef.current.size === 0) return;
|
|
6331
6334
|
const sel = typeof window !== "undefined" ? window.getSelection() : null;
|
|
6332
6335
|
if (!sel || sel.rangeCount === 0 || sel.isCollapsed) return;
|
|
@@ -6772,13 +6775,13 @@ function DocSearch({
|
|
|
6772
6775
|
}) {
|
|
6773
6776
|
const { t } = useTranslate();
|
|
6774
6777
|
const resolvedPlaceholder = placeholder ?? t("docSearch.placeholder");
|
|
6775
|
-
const [query, setQuery] =
|
|
6776
|
-
const [results, setResults] =
|
|
6777
|
-
const [isOpen, setIsOpen] =
|
|
6778
|
-
const [activeIndex, setActiveIndex] =
|
|
6779
|
-
const containerRef =
|
|
6780
|
-
const debounceRef =
|
|
6781
|
-
|
|
6778
|
+
const [query, setQuery] = React10.useState("");
|
|
6779
|
+
const [results, setResults] = React10.useState([]);
|
|
6780
|
+
const [isOpen, setIsOpen] = React10.useState(false);
|
|
6781
|
+
const [activeIndex, setActiveIndex] = React10.useState(-1);
|
|
6782
|
+
const containerRef = React10.useRef(null);
|
|
6783
|
+
const debounceRef = React10.useRef(void 0);
|
|
6784
|
+
React10.useEffect(() => {
|
|
6782
6785
|
function handleClickOutside(e) {
|
|
6783
6786
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
6784
6787
|
setIsOpen(false);
|
|
@@ -6787,7 +6790,7 @@ function DocSearch({
|
|
|
6787
6790
|
document.addEventListener("mousedown", handleClickOutside);
|
|
6788
6791
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
6789
6792
|
}, []);
|
|
6790
|
-
const performSearch =
|
|
6793
|
+
const performSearch = React10.useCallback(
|
|
6791
6794
|
(value) => {
|
|
6792
6795
|
if (!onSearch || !value.trim()) {
|
|
6793
6796
|
setResults([]);
|
|
@@ -6809,7 +6812,7 @@ function DocSearch({
|
|
|
6809
6812
|
},
|
|
6810
6813
|
[onSearch]
|
|
6811
6814
|
);
|
|
6812
|
-
const handleChange =
|
|
6815
|
+
const handleChange = React10.useCallback(
|
|
6813
6816
|
(e) => {
|
|
6814
6817
|
const value = e.target.value;
|
|
6815
6818
|
setQuery(value);
|
|
@@ -6822,18 +6825,18 @@ function DocSearch({
|
|
|
6822
6825
|
},
|
|
6823
6826
|
[performSearch]
|
|
6824
6827
|
);
|
|
6825
|
-
const handleFocus =
|
|
6828
|
+
const handleFocus = React10.useCallback(() => {
|
|
6826
6829
|
if (results.length > 0) {
|
|
6827
6830
|
setIsOpen(true);
|
|
6828
6831
|
}
|
|
6829
6832
|
}, [results]);
|
|
6830
|
-
const navigateTo =
|
|
6833
|
+
const navigateTo = React10.useCallback((href) => {
|
|
6831
6834
|
setIsOpen(false);
|
|
6832
6835
|
setQuery("");
|
|
6833
6836
|
setResults([]);
|
|
6834
6837
|
window.location.href = href;
|
|
6835
6838
|
}, []);
|
|
6836
|
-
const handleKeyDown =
|
|
6839
|
+
const handleKeyDown = React10.useCallback(
|
|
6837
6840
|
(e) => {
|
|
6838
6841
|
if (e.key === "Escape") {
|
|
6839
6842
|
setIsOpen(false);
|
|
@@ -6860,7 +6863,7 @@ function DocSearch({
|
|
|
6860
6863
|
},
|
|
6861
6864
|
[isOpen, results, activeIndex, navigateTo]
|
|
6862
6865
|
);
|
|
6863
|
-
|
|
6866
|
+
React10.useEffect(() => {
|
|
6864
6867
|
return () => {
|
|
6865
6868
|
if (debounceRef.current) {
|
|
6866
6869
|
clearTimeout(debounceRef.current);
|
package/dist/docs/index.d.cts
CHANGED
|
@@ -267,6 +267,8 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
267
267
|
label?: string;
|
|
268
268
|
/** Disable the button (greys out, blocks click events) */
|
|
269
269
|
disabled?: boolean;
|
|
270
|
+
/** Test identifier for automated tests */
|
|
271
|
+
'data-testid'?: string;
|
|
270
272
|
}
|
|
271
273
|
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
272
274
|
|