@almadar/ui 2.24.8 → 2.24.9
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/components/atoms/AnimatedGraphic.d.ts +29 -0
- package/dist/components/atoms/AnimatedReveal.d.ts +24 -0
- package/dist/components/atoms/index.d.ts +2 -0
- package/dist/components/index.cjs +1292 -1008
- package/dist/components/index.js +428 -146
- package/dist/docs/index.cjs +2 -1
- package/dist/docs/index.js +2 -1
- package/dist/marketing/index.cjs +295 -11
- package/dist/marketing/index.d.cts +54 -1
- package/dist/marketing/index.d.ts +4 -0
- package/dist/marketing/index.js +295 -13
- package/dist/providers/index.cjs +410 -125
- package/dist/providers/index.js +322 -37
- package/dist/runtime/index.cjs +1178 -893
- package/dist/runtime/index.js +418 -133
- package/package.json +1 -1
package/dist/providers/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React112 = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var providers = require('@almadar/ui/providers');
|
|
6
6
|
require('react-dom');
|
|
@@ -41,7 +41,7 @@ function _interopNamespace(e) {
|
|
|
41
41
|
return Object.freeze(n);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var React112__namespace = /*#__PURE__*/_interopNamespace(React112);
|
|
45
45
|
var LucideIcons__namespace = /*#__PURE__*/_interopNamespace(LucideIcons);
|
|
46
46
|
var L__default = /*#__PURE__*/_interopDefault(L);
|
|
47
47
|
var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
|
|
@@ -153,7 +153,7 @@ var BUILT_IN_THEMES = [
|
|
|
153
153
|
hasDarkMode: true
|
|
154
154
|
}
|
|
155
155
|
];
|
|
156
|
-
var ThemeContext =
|
|
156
|
+
var ThemeContext = React112.createContext(void 0);
|
|
157
157
|
var THEME_STORAGE_KEY = "theme";
|
|
158
158
|
var MODE_STORAGE_KEY = "theme-mode";
|
|
159
159
|
function getSystemMode() {
|
|
@@ -173,14 +173,14 @@ var ThemeProvider = ({
|
|
|
173
173
|
defaultMode = "system",
|
|
174
174
|
targetRef
|
|
175
175
|
}) => {
|
|
176
|
-
const availableThemes =
|
|
176
|
+
const availableThemes = React112.useMemo(() => {
|
|
177
177
|
const themeMap = /* @__PURE__ */ new Map();
|
|
178
178
|
BUILT_IN_THEMES.forEach((t) => themeMap.set(t.name, t));
|
|
179
179
|
themes.forEach((t) => themeMap.set(t.name, t));
|
|
180
180
|
return Array.from(themeMap.values());
|
|
181
181
|
}, [themes]);
|
|
182
182
|
const isScoped = !!targetRef;
|
|
183
|
-
const [theme, setThemeState] =
|
|
183
|
+
const [theme, setThemeState] = React112.useState(() => {
|
|
184
184
|
if (isScoped || typeof window === "undefined") return defaultTheme;
|
|
185
185
|
const stored = localStorage.getItem(THEME_STORAGE_KEY);
|
|
186
186
|
const validThemes = [
|
|
@@ -192,7 +192,7 @@ var ThemeProvider = ({
|
|
|
192
192
|
}
|
|
193
193
|
return defaultTheme;
|
|
194
194
|
});
|
|
195
|
-
const [mode, setModeState] =
|
|
195
|
+
const [mode, setModeState] = React112.useState(() => {
|
|
196
196
|
if (isScoped || typeof window === "undefined") return defaultMode;
|
|
197
197
|
const stored = localStorage.getItem(MODE_STORAGE_KEY);
|
|
198
198
|
if (stored === "light" || stored === "dark" || stored === "system") {
|
|
@@ -200,14 +200,14 @@ var ThemeProvider = ({
|
|
|
200
200
|
}
|
|
201
201
|
return defaultMode;
|
|
202
202
|
});
|
|
203
|
-
const [resolvedMode, setResolvedMode] =
|
|
203
|
+
const [resolvedMode, setResolvedMode] = React112.useState(
|
|
204
204
|
() => resolveMode(mode)
|
|
205
205
|
);
|
|
206
|
-
const appliedTheme =
|
|
206
|
+
const appliedTheme = React112.useMemo(
|
|
207
207
|
() => `${theme}-${resolvedMode}`,
|
|
208
208
|
[theme, resolvedMode]
|
|
209
209
|
);
|
|
210
|
-
|
|
210
|
+
React112.useEffect(() => {
|
|
211
211
|
const updateResolved = () => {
|
|
212
212
|
setResolvedMode(resolveMode(mode));
|
|
213
213
|
};
|
|
@@ -220,7 +220,7 @@ var ThemeProvider = ({
|
|
|
220
220
|
}
|
|
221
221
|
return void 0;
|
|
222
222
|
}, [mode]);
|
|
223
|
-
|
|
223
|
+
React112.useEffect(() => {
|
|
224
224
|
if (isScoped) {
|
|
225
225
|
if (targetRef?.current) {
|
|
226
226
|
targetRef.current.setAttribute("data-theme", appliedTheme);
|
|
@@ -234,7 +234,7 @@ var ThemeProvider = ({
|
|
|
234
234
|
root.classList.remove("light", "dark");
|
|
235
235
|
root.classList.add(resolvedMode);
|
|
236
236
|
}, [appliedTheme, resolvedMode, targetRef, isScoped]);
|
|
237
|
-
const setTheme =
|
|
237
|
+
const setTheme = React112.useCallback(
|
|
238
238
|
(newTheme) => {
|
|
239
239
|
const validTheme = availableThemes.find((t) => t.name === newTheme);
|
|
240
240
|
if (validTheme) {
|
|
@@ -250,17 +250,17 @@ var ThemeProvider = ({
|
|
|
250
250
|
},
|
|
251
251
|
[availableThemes]
|
|
252
252
|
);
|
|
253
|
-
const setMode =
|
|
253
|
+
const setMode = React112.useCallback((newMode) => {
|
|
254
254
|
setModeState(newMode);
|
|
255
255
|
if (!isScoped && typeof window !== "undefined") {
|
|
256
256
|
localStorage.setItem(MODE_STORAGE_KEY, newMode);
|
|
257
257
|
}
|
|
258
258
|
}, []);
|
|
259
|
-
const toggleMode =
|
|
259
|
+
const toggleMode = React112.useCallback(() => {
|
|
260
260
|
const newMode = resolvedMode === "dark" ? "light" : "dark";
|
|
261
261
|
setMode(newMode);
|
|
262
262
|
}, [resolvedMode, setMode]);
|
|
263
|
-
const contextValue =
|
|
263
|
+
const contextValue = React112.useMemo(
|
|
264
264
|
() => ({
|
|
265
265
|
theme,
|
|
266
266
|
mode,
|
|
@@ -356,15 +356,15 @@ var fallbackEventBus = {
|
|
|
356
356
|
}
|
|
357
357
|
};
|
|
358
358
|
function useEventBus() {
|
|
359
|
-
const context =
|
|
359
|
+
const context = React112.useContext(providers.EventBusContext);
|
|
360
360
|
return context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
361
361
|
}
|
|
362
|
-
var EventBusContext2 =
|
|
362
|
+
var EventBusContext2 = React112.createContext(null);
|
|
363
363
|
function EventBusProvider({ children, debug: debug2 = false }) {
|
|
364
|
-
const listenersRef =
|
|
365
|
-
const anyListenersRef =
|
|
366
|
-
const deprecationWarningShown =
|
|
367
|
-
const getSelectedEntity =
|
|
364
|
+
const listenersRef = React112.useRef(/* @__PURE__ */ new Map());
|
|
365
|
+
const anyListenersRef = React112.useRef(/* @__PURE__ */ new Set());
|
|
366
|
+
const deprecationWarningShown = React112.useRef(false);
|
|
367
|
+
const getSelectedEntity = React112.useCallback(() => {
|
|
368
368
|
if (!deprecationWarningShown.current) {
|
|
369
369
|
console.warn(
|
|
370
370
|
"[EventBus] getSelectedEntity is deprecated. Use SelectionProvider and useSelection hook instead. See SelectionProvider.tsx for migration guide."
|
|
@@ -373,7 +373,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
373
373
|
}
|
|
374
374
|
return null;
|
|
375
375
|
}, []);
|
|
376
|
-
const clearSelectedEntity =
|
|
376
|
+
const clearSelectedEntity = React112.useCallback(() => {
|
|
377
377
|
if (!deprecationWarningShown.current) {
|
|
378
378
|
console.warn(
|
|
379
379
|
"[EventBus] clearSelectedEntity is deprecated. Use SelectionProvider and useSelection hook instead. See SelectionProvider.tsx for migration guide."
|
|
@@ -381,7 +381,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
381
381
|
deprecationWarningShown.current = true;
|
|
382
382
|
}
|
|
383
383
|
}, []);
|
|
384
|
-
const emit =
|
|
384
|
+
const emit = React112.useCallback((type, payload) => {
|
|
385
385
|
const event = {
|
|
386
386
|
type,
|
|
387
387
|
payload,
|
|
@@ -415,7 +415,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
}, [debug2]);
|
|
418
|
-
const on =
|
|
418
|
+
const on = React112.useCallback((type, listener) => {
|
|
419
419
|
if (!listenersRef.current.has(type)) {
|
|
420
420
|
listenersRef.current.set(type, /* @__PURE__ */ new Set());
|
|
421
421
|
}
|
|
@@ -434,18 +434,18 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
434
434
|
}
|
|
435
435
|
};
|
|
436
436
|
}, [debug2]);
|
|
437
|
-
const once =
|
|
437
|
+
const once = React112.useCallback((type, listener) => {
|
|
438
438
|
const wrappedListener = (event) => {
|
|
439
439
|
listenersRef.current.get(type)?.delete(wrappedListener);
|
|
440
440
|
listener(event);
|
|
441
441
|
};
|
|
442
442
|
return on(type, wrappedListener);
|
|
443
443
|
}, [on]);
|
|
444
|
-
const hasListeners =
|
|
444
|
+
const hasListeners = React112.useCallback((type) => {
|
|
445
445
|
const listeners6 = listenersRef.current.get(type);
|
|
446
446
|
return listeners6 !== void 0 && listeners6.size > 0;
|
|
447
447
|
}, []);
|
|
448
|
-
const onAny =
|
|
448
|
+
const onAny = React112.useCallback((listener) => {
|
|
449
449
|
anyListenersRef.current.add(listener);
|
|
450
450
|
if (debug2) {
|
|
451
451
|
console.log(`[EventBus] onAny subscribed, total: ${anyListenersRef.current.size}`);
|
|
@@ -457,7 +457,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
457
457
|
}
|
|
458
458
|
};
|
|
459
459
|
}, [debug2]);
|
|
460
|
-
const contextValue =
|
|
460
|
+
const contextValue = React112.useMemo(
|
|
461
461
|
() => ({
|
|
462
462
|
emit,
|
|
463
463
|
on,
|
|
@@ -469,7 +469,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
469
469
|
}),
|
|
470
470
|
[emit, on, once, hasListeners, onAny, getSelectedEntity, clearSelectedEntity]
|
|
471
471
|
);
|
|
472
|
-
|
|
472
|
+
React112.useEffect(() => {
|
|
473
473
|
setGlobalEventBus(contextValue);
|
|
474
474
|
return () => {
|
|
475
475
|
setGlobalEventBus(null);
|
|
@@ -477,7 +477,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
477
477
|
}, [contextValue]);
|
|
478
478
|
return /* @__PURE__ */ jsxRuntime.jsx(EventBusContext2.Provider, { value: contextValue, children });
|
|
479
479
|
}
|
|
480
|
-
var SelectionContext =
|
|
480
|
+
var SelectionContext = React112.createContext(null);
|
|
481
481
|
var defaultCompareEntities = (a, b) => {
|
|
482
482
|
if (a === b) return true;
|
|
483
483
|
if (!a || !b) return false;
|
|
@@ -494,8 +494,8 @@ function SelectionProvider({
|
|
|
494
494
|
compareEntities = defaultCompareEntities
|
|
495
495
|
}) {
|
|
496
496
|
const eventBus = useEventBus();
|
|
497
|
-
const [selected, setSelectedState] =
|
|
498
|
-
const setSelected =
|
|
497
|
+
const [selected, setSelectedState] = React112.useState(null);
|
|
498
|
+
const setSelected = React112.useCallback(
|
|
499
499
|
(entity) => {
|
|
500
500
|
setSelectedState(entity);
|
|
501
501
|
if (debug2) {
|
|
@@ -504,19 +504,19 @@ function SelectionProvider({
|
|
|
504
504
|
},
|
|
505
505
|
[debug2]
|
|
506
506
|
);
|
|
507
|
-
const clearSelection =
|
|
507
|
+
const clearSelection = React112.useCallback(() => {
|
|
508
508
|
setSelectedState(null);
|
|
509
509
|
if (debug2) {
|
|
510
510
|
console.log("[SelectionProvider] Selection cleared");
|
|
511
511
|
}
|
|
512
512
|
}, [debug2]);
|
|
513
|
-
const isSelected =
|
|
513
|
+
const isSelected = React112.useCallback(
|
|
514
514
|
(entity) => {
|
|
515
515
|
return compareEntities(selected, entity);
|
|
516
516
|
},
|
|
517
517
|
[selected, compareEntities]
|
|
518
518
|
);
|
|
519
|
-
|
|
519
|
+
React112.useEffect(() => {
|
|
520
520
|
const handleSelect = (event) => {
|
|
521
521
|
const row = event.payload?.row;
|
|
522
522
|
if (row) {
|
|
@@ -554,14 +554,14 @@ function SelectionProvider({
|
|
|
554
554
|
return /* @__PURE__ */ jsxRuntime.jsx(SelectionContext.Provider, { value: contextValue, children });
|
|
555
555
|
}
|
|
556
556
|
function useSelection() {
|
|
557
|
-
const context =
|
|
557
|
+
const context = React112.useContext(SelectionContext);
|
|
558
558
|
if (!context) {
|
|
559
559
|
throw new Error("useSelection must be used within a SelectionProvider");
|
|
560
560
|
}
|
|
561
561
|
return context;
|
|
562
562
|
}
|
|
563
563
|
function useSelectionOptional() {
|
|
564
|
-
const context =
|
|
564
|
+
const context = React112.useContext(SelectionContext);
|
|
565
565
|
return context;
|
|
566
566
|
}
|
|
567
567
|
function cn(...inputs) {
|
|
@@ -704,7 +704,7 @@ var positionStyles = {
|
|
|
704
704
|
fixed: "fixed",
|
|
705
705
|
sticky: "sticky"
|
|
706
706
|
};
|
|
707
|
-
var Box =
|
|
707
|
+
var Box = React112__namespace.default.forwardRef(
|
|
708
708
|
({
|
|
709
709
|
padding,
|
|
710
710
|
paddingX,
|
|
@@ -733,20 +733,20 @@ var Box = React110__namespace.default.forwardRef(
|
|
|
733
733
|
...rest
|
|
734
734
|
}, ref) => {
|
|
735
735
|
const eventBus = useEventBus();
|
|
736
|
-
const handleClick =
|
|
736
|
+
const handleClick = React112.useCallback((e) => {
|
|
737
737
|
if (action) {
|
|
738
738
|
e.stopPropagation();
|
|
739
739
|
eventBus.emit(`UI:${action}`, actionPayload ?? {});
|
|
740
740
|
}
|
|
741
741
|
onClick?.(e);
|
|
742
742
|
}, [action, actionPayload, eventBus, onClick]);
|
|
743
|
-
const handleMouseEnter =
|
|
743
|
+
const handleMouseEnter = React112.useCallback((e) => {
|
|
744
744
|
if (hoverEvent) {
|
|
745
745
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
746
746
|
}
|
|
747
747
|
onMouseEnter?.(e);
|
|
748
748
|
}, [hoverEvent, eventBus, onMouseEnter]);
|
|
749
|
-
const handleMouseLeave =
|
|
749
|
+
const handleMouseLeave = React112.useCallback((e) => {
|
|
750
750
|
if (hoverEvent) {
|
|
751
751
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
752
752
|
}
|
|
@@ -921,7 +921,8 @@ var variantStyles2 = {
|
|
|
921
921
|
].join(" "),
|
|
922
922
|
ghost: [
|
|
923
923
|
"bg-transparent text-muted-foreground",
|
|
924
|
-
"
|
|
924
|
+
"border border-transparent",
|
|
925
|
+
"hover:text-primary-foreground hover:bg-primary hover:border-primary",
|
|
925
926
|
"active:scale-[var(--active-scale)]"
|
|
926
927
|
].join(" "),
|
|
927
928
|
danger: [
|
|
@@ -974,7 +975,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
974
975
|
const IconComp = value;
|
|
975
976
|
return /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: sizeClass });
|
|
976
977
|
}
|
|
977
|
-
if (
|
|
978
|
+
if (React112__namespace.default.isValidElement(value)) {
|
|
978
979
|
return value;
|
|
979
980
|
}
|
|
980
981
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -983,7 +984,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
983
984
|
}
|
|
984
985
|
return value;
|
|
985
986
|
}
|
|
986
|
-
var Button =
|
|
987
|
+
var Button = React112__namespace.default.forwardRef(
|
|
987
988
|
({
|
|
988
989
|
className,
|
|
989
990
|
variant = "primary",
|
|
@@ -1079,7 +1080,7 @@ var sizeStyles3 = {
|
|
|
1079
1080
|
md: "px-2.5 py-1 text-sm",
|
|
1080
1081
|
lg: "px-3 py-1.5 text-base"
|
|
1081
1082
|
};
|
|
1082
|
-
var Badge =
|
|
1083
|
+
var Badge = React112__namespace.default.forwardRef(
|
|
1083
1084
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
1084
1085
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
1085
1086
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -1106,7 +1107,7 @@ var Badge = React110__namespace.default.forwardRef(
|
|
|
1106
1107
|
}
|
|
1107
1108
|
);
|
|
1108
1109
|
Badge.displayName = "Badge";
|
|
1109
|
-
var Input =
|
|
1110
|
+
var Input = React112__namespace.default.forwardRef(
|
|
1110
1111
|
({
|
|
1111
1112
|
className,
|
|
1112
1113
|
inputType,
|
|
@@ -1218,7 +1219,7 @@ var Input = React110__namespace.default.forwardRef(
|
|
|
1218
1219
|
}
|
|
1219
1220
|
);
|
|
1220
1221
|
Input.displayName = "Input";
|
|
1221
|
-
var Label =
|
|
1222
|
+
var Label = React112__namespace.default.forwardRef(
|
|
1222
1223
|
({ className, required, children, ...props }, ref) => {
|
|
1223
1224
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1224
1225
|
"label",
|
|
@@ -1238,7 +1239,7 @@ var Label = React110__namespace.default.forwardRef(
|
|
|
1238
1239
|
}
|
|
1239
1240
|
);
|
|
1240
1241
|
Label.displayName = "Label";
|
|
1241
|
-
var Textarea =
|
|
1242
|
+
var Textarea = React112__namespace.default.forwardRef(
|
|
1242
1243
|
({ className, error, ...props }, ref) => {
|
|
1243
1244
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1244
1245
|
"textarea",
|
|
@@ -1261,7 +1262,7 @@ var Textarea = React110__namespace.default.forwardRef(
|
|
|
1261
1262
|
}
|
|
1262
1263
|
);
|
|
1263
1264
|
Textarea.displayName = "Textarea";
|
|
1264
|
-
var Select =
|
|
1265
|
+
var Select = React112__namespace.default.forwardRef(
|
|
1265
1266
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
1266
1267
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
1267
1268
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1297,7 +1298,7 @@ var Select = React110__namespace.default.forwardRef(
|
|
|
1297
1298
|
}
|
|
1298
1299
|
);
|
|
1299
1300
|
Select.displayName = "Select";
|
|
1300
|
-
var Checkbox =
|
|
1301
|
+
var Checkbox = React112__namespace.default.forwardRef(
|
|
1301
1302
|
({ className, label, id, ...props }, ref) => {
|
|
1302
1303
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
1303
1304
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
|
|
@@ -1373,7 +1374,7 @@ var shadowStyles2 = {
|
|
|
1373
1374
|
md: "shadow",
|
|
1374
1375
|
lg: "shadow-lg"
|
|
1375
1376
|
};
|
|
1376
|
-
var Card =
|
|
1377
|
+
var Card = React112__namespace.default.forwardRef(
|
|
1377
1378
|
({
|
|
1378
1379
|
className,
|
|
1379
1380
|
variant = "bordered",
|
|
@@ -1409,9 +1410,9 @@ var Card = React110__namespace.default.forwardRef(
|
|
|
1409
1410
|
}
|
|
1410
1411
|
);
|
|
1411
1412
|
Card.displayName = "Card";
|
|
1412
|
-
var CardHeader =
|
|
1413
|
+
var CardHeader = React112__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
1413
1414
|
CardHeader.displayName = "CardHeader";
|
|
1414
|
-
var CardTitle =
|
|
1415
|
+
var CardTitle = React112__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1415
1416
|
"h3",
|
|
1416
1417
|
{
|
|
1417
1418
|
ref,
|
|
@@ -1424,11 +1425,11 @@ var CardTitle = React110__namespace.default.forwardRef(({ className, ...props },
|
|
|
1424
1425
|
}
|
|
1425
1426
|
));
|
|
1426
1427
|
CardTitle.displayName = "CardTitle";
|
|
1427
|
-
var CardContent =
|
|
1428
|
+
var CardContent = React112__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
|
|
1428
1429
|
CardContent.displayName = "CardContent";
|
|
1429
1430
|
var CardBody = CardContent;
|
|
1430
1431
|
CardBody.displayName = "CardBody";
|
|
1431
|
-
var CardFooter =
|
|
1432
|
+
var CardFooter = React112__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1432
1433
|
"div",
|
|
1433
1434
|
{
|
|
1434
1435
|
ref,
|
|
@@ -1443,7 +1444,7 @@ var sizeStyles4 = {
|
|
|
1443
1444
|
md: "h-6 w-6",
|
|
1444
1445
|
lg: "h-8 w-8"
|
|
1445
1446
|
};
|
|
1446
|
-
var Spinner =
|
|
1447
|
+
var Spinner = React112__namespace.default.forwardRef(
|
|
1447
1448
|
({ className, size = "md", ...props }, ref) => {
|
|
1448
1449
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1449
1450
|
"div",
|
|
@@ -1457,7 +1458,7 @@ var Spinner = React110__namespace.default.forwardRef(
|
|
|
1457
1458
|
}
|
|
1458
1459
|
);
|
|
1459
1460
|
Spinner.displayName = "Spinner";
|
|
1460
|
-
var Radio =
|
|
1461
|
+
var Radio = React112__namespace.default.forwardRef(
|
|
1461
1462
|
({
|
|
1462
1463
|
label,
|
|
1463
1464
|
helperText,
|
|
@@ -1561,7 +1562,7 @@ var Radio = React110__namespace.default.forwardRef(
|
|
|
1561
1562
|
}
|
|
1562
1563
|
);
|
|
1563
1564
|
Radio.displayName = "Radio";
|
|
1564
|
-
var Switch =
|
|
1565
|
+
var Switch = React112__namespace.forwardRef(
|
|
1565
1566
|
({
|
|
1566
1567
|
checked,
|
|
1567
1568
|
defaultChecked = false,
|
|
@@ -1572,10 +1573,10 @@ var Switch = React110__namespace.forwardRef(
|
|
|
1572
1573
|
name,
|
|
1573
1574
|
className
|
|
1574
1575
|
}, ref) => {
|
|
1575
|
-
const [isChecked, setIsChecked] =
|
|
1576
|
+
const [isChecked, setIsChecked] = React112__namespace.useState(
|
|
1576
1577
|
checked !== void 0 ? checked : defaultChecked
|
|
1577
1578
|
);
|
|
1578
|
-
|
|
1579
|
+
React112__namespace.useEffect(() => {
|
|
1579
1580
|
if (checked !== void 0) {
|
|
1580
1581
|
setIsChecked(checked);
|
|
1581
1582
|
}
|
|
@@ -1733,7 +1734,7 @@ var sizeStyles5 = {
|
|
|
1733
1734
|
md: "w-2.5 h-2.5",
|
|
1734
1735
|
lg: "w-3 h-3"
|
|
1735
1736
|
};
|
|
1736
|
-
var StatusDot =
|
|
1737
|
+
var StatusDot = React112__namespace.default.forwardRef(
|
|
1737
1738
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
1738
1739
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1739
1740
|
"span",
|
|
@@ -1780,7 +1781,7 @@ var iconMap2 = {
|
|
|
1780
1781
|
down: LucideIcons.TrendingDown,
|
|
1781
1782
|
flat: LucideIcons.ArrowRight
|
|
1782
1783
|
};
|
|
1783
|
-
var TrendIndicator =
|
|
1784
|
+
var TrendIndicator = React112__namespace.default.forwardRef(
|
|
1784
1785
|
({
|
|
1785
1786
|
className,
|
|
1786
1787
|
value,
|
|
@@ -1839,7 +1840,7 @@ var thumbSizes = {
|
|
|
1839
1840
|
md: "w-4 h-4",
|
|
1840
1841
|
lg: "w-5 h-5"
|
|
1841
1842
|
};
|
|
1842
|
-
var RangeSlider =
|
|
1843
|
+
var RangeSlider = React112__namespace.default.forwardRef(
|
|
1843
1844
|
({
|
|
1844
1845
|
className,
|
|
1845
1846
|
min = 0,
|
|
@@ -1857,14 +1858,14 @@ var RangeSlider = React110__namespace.default.forwardRef(
|
|
|
1857
1858
|
formatValue: formatValue5,
|
|
1858
1859
|
...props
|
|
1859
1860
|
}, ref) => {
|
|
1860
|
-
const [isDragging, setIsDragging] =
|
|
1861
|
-
const [showTip, setShowTip] =
|
|
1862
|
-
const inputRef =
|
|
1861
|
+
const [isDragging, setIsDragging] = React112.useState(false);
|
|
1862
|
+
const [showTip, setShowTip] = React112.useState(false);
|
|
1863
|
+
const inputRef = React112.useRef(null);
|
|
1863
1864
|
const eventBus = useSafeEventBus();
|
|
1864
1865
|
const percentage = max !== min ? (value - min) / (max - min) * 100 : 0;
|
|
1865
1866
|
const bufferedPercentage = buffered !== void 0 ? Math.min(buffered, 100) : void 0;
|
|
1866
1867
|
const displayValue = formatValue5 ? formatValue5(value) : String(value);
|
|
1867
|
-
const handleChange =
|
|
1868
|
+
const handleChange = React112.useCallback(
|
|
1868
1869
|
(e) => {
|
|
1869
1870
|
const newValue = Number(e.target.value);
|
|
1870
1871
|
onChange?.(newValue);
|
|
@@ -2042,7 +2043,7 @@ var paddingClasses = {
|
|
|
2042
2043
|
md: "py-16",
|
|
2043
2044
|
lg: "py-24"
|
|
2044
2045
|
};
|
|
2045
|
-
var ContentSection =
|
|
2046
|
+
var ContentSection = React112__namespace.default.forwardRef(
|
|
2046
2047
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
2047
2048
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2048
2049
|
Box,
|
|
@@ -2061,6 +2062,289 @@ var ContentSection = React110__namespace.default.forwardRef(
|
|
|
2061
2062
|
}
|
|
2062
2063
|
);
|
|
2063
2064
|
ContentSection.displayName = "ContentSection";
|
|
2065
|
+
var initialStyles = {
|
|
2066
|
+
"fade-up": { opacity: 0, transform: "translateY(24px)" },
|
|
2067
|
+
"fade-down": { opacity: 0, transform: "translateY(-24px)" },
|
|
2068
|
+
"fade-in": { opacity: 0 },
|
|
2069
|
+
"fade-left": { opacity: 0, transform: "translateX(24px)" },
|
|
2070
|
+
"fade-right": { opacity: 0, transform: "translateX(-24px)" },
|
|
2071
|
+
"scale": { opacity: 0, transform: "scale(0.92)" },
|
|
2072
|
+
"scale-up": { opacity: 0, transform: "scale(0.92) translateY(16px)" },
|
|
2073
|
+
"none": {}
|
|
2074
|
+
};
|
|
2075
|
+
var animatedStyles = {
|
|
2076
|
+
"fade-up": { opacity: 1, transform: "translateY(0)" },
|
|
2077
|
+
"fade-down": { opacity: 1, transform: "translateY(0)" },
|
|
2078
|
+
"fade-in": { opacity: 1 },
|
|
2079
|
+
"fade-left": { opacity: 1, transform: "translateX(0)" },
|
|
2080
|
+
"fade-right": { opacity: 1, transform: "translateX(0)" },
|
|
2081
|
+
"scale": { opacity: 1, transform: "scale(1)" },
|
|
2082
|
+
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
2083
|
+
"none": {}
|
|
2084
|
+
};
|
|
2085
|
+
var AnimatedReveal = React112__namespace.default.forwardRef(
|
|
2086
|
+
({
|
|
2087
|
+
trigger = "scroll",
|
|
2088
|
+
animation = "fade-up",
|
|
2089
|
+
duration = 600,
|
|
2090
|
+
delay = 0,
|
|
2091
|
+
threshold = 0.15,
|
|
2092
|
+
once = true,
|
|
2093
|
+
animate: manualAnimate,
|
|
2094
|
+
easing = "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
2095
|
+
children,
|
|
2096
|
+
className,
|
|
2097
|
+
style,
|
|
2098
|
+
...props
|
|
2099
|
+
}, forwardedRef) => {
|
|
2100
|
+
const [isAnimated, setIsAnimated] = React112.useState(false);
|
|
2101
|
+
const internalRef = React112.useRef(null);
|
|
2102
|
+
const hasAnimated = React112.useRef(false);
|
|
2103
|
+
const setRef = React112.useCallback(
|
|
2104
|
+
(node) => {
|
|
2105
|
+
internalRef.current = node;
|
|
2106
|
+
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
2107
|
+
else if (forwardedRef) forwardedRef.current = node;
|
|
2108
|
+
},
|
|
2109
|
+
[forwardedRef]
|
|
2110
|
+
);
|
|
2111
|
+
React112.useEffect(() => {
|
|
2112
|
+
if (trigger !== "scroll") return;
|
|
2113
|
+
const el = internalRef.current;
|
|
2114
|
+
if (!el) return;
|
|
2115
|
+
const observer = new IntersectionObserver(
|
|
2116
|
+
([entry]) => {
|
|
2117
|
+
if (entry.isIntersecting) {
|
|
2118
|
+
if (once && hasAnimated.current) return;
|
|
2119
|
+
hasAnimated.current = true;
|
|
2120
|
+
setIsAnimated(true);
|
|
2121
|
+
} else if (!once) {
|
|
2122
|
+
setIsAnimated(false);
|
|
2123
|
+
}
|
|
2124
|
+
},
|
|
2125
|
+
{ threshold }
|
|
2126
|
+
);
|
|
2127
|
+
observer.observe(el);
|
|
2128
|
+
return () => observer.disconnect();
|
|
2129
|
+
}, [trigger, threshold, once]);
|
|
2130
|
+
const handleMouseEnter = trigger === "hover" ? () => setIsAnimated(true) : void 0;
|
|
2131
|
+
const handleMouseLeave = trigger === "hover" ? () => {
|
|
2132
|
+
if (!once || !hasAnimated.current) {
|
|
2133
|
+
hasAnimated.current = true;
|
|
2134
|
+
setIsAnimated(false);
|
|
2135
|
+
}
|
|
2136
|
+
} : void 0;
|
|
2137
|
+
React112.useEffect(() => {
|
|
2138
|
+
if (trigger === "manual" && manualAnimate !== void 0) {
|
|
2139
|
+
setIsAnimated(manualAnimate);
|
|
2140
|
+
}
|
|
2141
|
+
}, [trigger, manualAnimate]);
|
|
2142
|
+
const active = isAnimated;
|
|
2143
|
+
const currentStyle = active ? animatedStyles[animation] : initialStyles[animation];
|
|
2144
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2145
|
+
"div",
|
|
2146
|
+
{
|
|
2147
|
+
ref: setRef,
|
|
2148
|
+
className: cn("will-change-[opacity,transform]", className),
|
|
2149
|
+
style: {
|
|
2150
|
+
...currentStyle,
|
|
2151
|
+
transitionProperty: "opacity, transform",
|
|
2152
|
+
transitionDuration: `${duration}ms`,
|
|
2153
|
+
transitionDelay: `${delay}ms`,
|
|
2154
|
+
transitionTimingFunction: easing,
|
|
2155
|
+
...style
|
|
2156
|
+
},
|
|
2157
|
+
onMouseEnter: handleMouseEnter,
|
|
2158
|
+
onMouseLeave: handleMouseLeave,
|
|
2159
|
+
...props,
|
|
2160
|
+
children: typeof children === "function" ? children(active) : children
|
|
2161
|
+
}
|
|
2162
|
+
);
|
|
2163
|
+
}
|
|
2164
|
+
);
|
|
2165
|
+
AnimatedReveal.displayName = "AnimatedReveal";
|
|
2166
|
+
function useFetchedSvg(src) {
|
|
2167
|
+
const [svg, setSvg] = React112.useState(null);
|
|
2168
|
+
const cache = React112.useRef({});
|
|
2169
|
+
React112.useEffect(() => {
|
|
2170
|
+
if (!src) {
|
|
2171
|
+
setSvg(null);
|
|
2172
|
+
return;
|
|
2173
|
+
}
|
|
2174
|
+
if (cache.current[src]) {
|
|
2175
|
+
setSvg(cache.current[src]);
|
|
2176
|
+
return;
|
|
2177
|
+
}
|
|
2178
|
+
let cancelled = false;
|
|
2179
|
+
fetch(src).then((res) => {
|
|
2180
|
+
if (!res.ok) throw new Error(`Failed to fetch SVG: ${res.status}`);
|
|
2181
|
+
return res.text();
|
|
2182
|
+
}).then((text) => {
|
|
2183
|
+
if (cancelled) return;
|
|
2184
|
+
cache.current[src] = text;
|
|
2185
|
+
setSvg(text);
|
|
2186
|
+
}).catch(() => {
|
|
2187
|
+
if (!cancelled) setSvg(null);
|
|
2188
|
+
});
|
|
2189
|
+
return () => {
|
|
2190
|
+
cancelled = true;
|
|
2191
|
+
};
|
|
2192
|
+
}, [src]);
|
|
2193
|
+
return svg;
|
|
2194
|
+
}
|
|
2195
|
+
function applyDrawAnimation(container, animate, duration, delay, easing) {
|
|
2196
|
+
const paths = container.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
2197
|
+
paths.forEach((el) => {
|
|
2198
|
+
if ("getTotalLength" in el && typeof el.getTotalLength === "function") {
|
|
2199
|
+
const len = el.getTotalLength();
|
|
2200
|
+
el.style.strokeDasharray = `${len}`;
|
|
2201
|
+
el.style.strokeDashoffset = animate ? "0" : `${len}`;
|
|
2202
|
+
el.style.transition = `stroke-dashoffset ${duration}ms ${easing} ${delay}ms`;
|
|
2203
|
+
}
|
|
2204
|
+
});
|
|
2205
|
+
}
|
|
2206
|
+
function applyFillAnimation(container, animate, duration, delay, easing, fillColor) {
|
|
2207
|
+
const paths = container.querySelectorAll("path, circle, ellipse, rect, polygon");
|
|
2208
|
+
paths.forEach((el) => {
|
|
2209
|
+
if ("getTotalLength" in el && typeof el.getTotalLength === "function") {
|
|
2210
|
+
const geom = el;
|
|
2211
|
+
const len = geom.getTotalLength();
|
|
2212
|
+
geom.style.strokeDasharray = `${len}`;
|
|
2213
|
+
geom.style.strokeDashoffset = animate ? "0" : `${len}`;
|
|
2214
|
+
geom.style.transition = `stroke-dashoffset ${duration * 0.6}ms ${easing} ${delay}ms, fill-opacity ${duration * 0.4}ms ${easing} ${delay + duration * 0.6}ms`;
|
|
2215
|
+
}
|
|
2216
|
+
if (fillColor) el.style.fill = fillColor;
|
|
2217
|
+
el.style.fillOpacity = animate ? "1" : "0";
|
|
2218
|
+
});
|
|
2219
|
+
}
|
|
2220
|
+
function applyPulseAnimation(container, animate, duration) {
|
|
2221
|
+
const svg = container.querySelector("svg");
|
|
2222
|
+
if (!svg) return;
|
|
2223
|
+
if (animate) {
|
|
2224
|
+
svg.style.animation = `ag-pulse ${duration}ms ease-in-out infinite`;
|
|
2225
|
+
} else {
|
|
2226
|
+
svg.style.animation = "none";
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
function applyMorphAnimation(container, animate, duration, delay, easing) {
|
|
2230
|
+
const paths = container.querySelectorAll("path, circle, ellipse, rect, polygon");
|
|
2231
|
+
paths.forEach((el) => {
|
|
2232
|
+
el.style.transition = `all ${duration}ms ${easing} ${delay}ms`;
|
|
2233
|
+
el.style.transform = animate ? "scale(1)" : "scale(0)";
|
|
2234
|
+
el.style.transformOrigin = "center";
|
|
2235
|
+
el.style.opacity = animate ? "1" : "0";
|
|
2236
|
+
});
|
|
2237
|
+
}
|
|
2238
|
+
var AnimatedGraphic = React112__namespace.default.forwardRef(
|
|
2239
|
+
({
|
|
2240
|
+
src,
|
|
2241
|
+
svgContent,
|
|
2242
|
+
animation = "draw",
|
|
2243
|
+
animate = false,
|
|
2244
|
+
duration = 1200,
|
|
2245
|
+
delay = 0,
|
|
2246
|
+
easing = "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
2247
|
+
width,
|
|
2248
|
+
height,
|
|
2249
|
+
strokeColor,
|
|
2250
|
+
fillColor,
|
|
2251
|
+
alt,
|
|
2252
|
+
className,
|
|
2253
|
+
style,
|
|
2254
|
+
children,
|
|
2255
|
+
...props
|
|
2256
|
+
}, ref) => {
|
|
2257
|
+
const containerRef = React112.useRef(null);
|
|
2258
|
+
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
2259
|
+
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
2260
|
+
const prevAnimateRef = React112.useRef(animate);
|
|
2261
|
+
const setRef = React112__namespace.default.useCallback(
|
|
2262
|
+
(node) => {
|
|
2263
|
+
containerRef.current = node;
|
|
2264
|
+
if (typeof ref === "function") ref(node);
|
|
2265
|
+
else if (ref) ref.current = node;
|
|
2266
|
+
},
|
|
2267
|
+
[ref]
|
|
2268
|
+
);
|
|
2269
|
+
React112.useEffect(() => {
|
|
2270
|
+
const el = containerRef.current;
|
|
2271
|
+
if (!el || !strokeColor) return;
|
|
2272
|
+
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
2273
|
+
paths.forEach((p2) => {
|
|
2274
|
+
p2.style.stroke = strokeColor;
|
|
2275
|
+
});
|
|
2276
|
+
}, [resolvedSvg, strokeColor]);
|
|
2277
|
+
React112.useEffect(() => {
|
|
2278
|
+
const el = containerRef.current;
|
|
2279
|
+
if (!el || !resolvedSvg) return;
|
|
2280
|
+
if (animation === "draw" || animation === "fill") {
|
|
2281
|
+
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
2282
|
+
paths.forEach((p2) => {
|
|
2283
|
+
if ("getTotalLength" in p2 && typeof p2.getTotalLength === "function") {
|
|
2284
|
+
const len = p2.getTotalLength();
|
|
2285
|
+
p2.style.strokeDasharray = `${len}`;
|
|
2286
|
+
p2.style.strokeDashoffset = `${len}`;
|
|
2287
|
+
}
|
|
2288
|
+
if (animation === "fill") {
|
|
2289
|
+
p2.style.fillOpacity = "0";
|
|
2290
|
+
}
|
|
2291
|
+
});
|
|
2292
|
+
}
|
|
2293
|
+
if (animation === "morph") {
|
|
2294
|
+
const paths = el.querySelectorAll("path, circle, ellipse, rect, polygon");
|
|
2295
|
+
paths.forEach((p2) => {
|
|
2296
|
+
p2.style.transform = "scale(0)";
|
|
2297
|
+
p2.style.transformOrigin = "center";
|
|
2298
|
+
p2.style.opacity = "0";
|
|
2299
|
+
});
|
|
2300
|
+
}
|
|
2301
|
+
}, [resolvedSvg, animation]);
|
|
2302
|
+
React112.useEffect(() => {
|
|
2303
|
+
const el = containerRef.current;
|
|
2304
|
+
if (!el) return;
|
|
2305
|
+
const id = requestAnimationFrame(() => {
|
|
2306
|
+
switch (animation) {
|
|
2307
|
+
case "draw":
|
|
2308
|
+
applyDrawAnimation(el, animate, duration, delay, easing);
|
|
2309
|
+
break;
|
|
2310
|
+
case "fill":
|
|
2311
|
+
applyFillAnimation(el, animate, duration, delay, easing, fillColor);
|
|
2312
|
+
break;
|
|
2313
|
+
case "pulse":
|
|
2314
|
+
applyPulseAnimation(el, animate, duration);
|
|
2315
|
+
break;
|
|
2316
|
+
case "morph":
|
|
2317
|
+
applyMorphAnimation(el, animate, duration, delay, easing);
|
|
2318
|
+
break;
|
|
2319
|
+
}
|
|
2320
|
+
});
|
|
2321
|
+
prevAnimateRef.current = animate;
|
|
2322
|
+
return () => cancelAnimationFrame(id);
|
|
2323
|
+
}, [animate, animation, duration, delay, easing, fillColor, resolvedSvg]);
|
|
2324
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2325
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `@keyframes ag-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.04); opacity: 0.85; } }` }),
|
|
2326
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2327
|
+
"div",
|
|
2328
|
+
{
|
|
2329
|
+
ref: setRef,
|
|
2330
|
+
className: cn("inline-flex items-center justify-center", className),
|
|
2331
|
+
style: { width, height, ...style },
|
|
2332
|
+
role: alt ? "img" : void 0,
|
|
2333
|
+
"aria-label": alt,
|
|
2334
|
+
...props,
|
|
2335
|
+
children: resolvedSvg ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2336
|
+
"div",
|
|
2337
|
+
{
|
|
2338
|
+
className: "w-full h-full [&>svg]:w-full [&>svg]:h-full",
|
|
2339
|
+
dangerouslySetInnerHTML: { __html: resolvedSvg }
|
|
2340
|
+
}
|
|
2341
|
+
) : children
|
|
2342
|
+
}
|
|
2343
|
+
)
|
|
2344
|
+
] });
|
|
2345
|
+
}
|
|
2346
|
+
);
|
|
2347
|
+
AnimatedGraphic.displayName = "AnimatedGraphic";
|
|
2064
2348
|
|
|
2065
2349
|
// locales/en.json
|
|
2066
2350
|
var en_default = {
|
|
@@ -2171,7 +2455,7 @@ var en_default = {
|
|
|
2171
2455
|
// hooks/useTranslate.ts
|
|
2172
2456
|
var { $meta: _meta, ...coreMessages } = en_default;
|
|
2173
2457
|
var coreLocale = coreMessages;
|
|
2174
|
-
var I18nContext =
|
|
2458
|
+
var I18nContext = React112.createContext({
|
|
2175
2459
|
locale: "en",
|
|
2176
2460
|
direction: "ltr",
|
|
2177
2461
|
t: (key) => coreLocale[key] ?? key
|
|
@@ -2180,7 +2464,7 @@ var I18nContext = React110.createContext({
|
|
|
2180
2464
|
I18nContext.displayName = "I18nContext";
|
|
2181
2465
|
I18nContext.Provider;
|
|
2182
2466
|
function useTranslate() {
|
|
2183
|
-
return
|
|
2467
|
+
return React112.useContext(I18nContext);
|
|
2184
2468
|
}
|
|
2185
2469
|
var ErrorState = ({
|
|
2186
2470
|
title,
|
|
@@ -2216,7 +2500,7 @@ var ErrorState = ({
|
|
|
2216
2500
|
);
|
|
2217
2501
|
};
|
|
2218
2502
|
ErrorState.displayName = "ErrorState";
|
|
2219
|
-
var ErrorBoundary = class extends
|
|
2503
|
+
var ErrorBoundary = class extends React112__namespace.default.Component {
|
|
2220
2504
|
constructor(props) {
|
|
2221
2505
|
super(props);
|
|
2222
2506
|
__publicField(this, "reset", () => {
|
|
@@ -2315,7 +2599,7 @@ function executeNotify(message, options, config) {
|
|
|
2315
2599
|
function executeEmit(event, payload, config) {
|
|
2316
2600
|
config.eventBus.emit(event, payload);
|
|
2317
2601
|
}
|
|
2318
|
-
var ClientEffectConfigContext =
|
|
2602
|
+
var ClientEffectConfigContext = React112.createContext(null);
|
|
2319
2603
|
ClientEffectConfigContext.Provider;
|
|
2320
2604
|
var effectIdCounter = 0;
|
|
2321
2605
|
function generateEffectId() {
|
|
@@ -2554,14 +2838,14 @@ var OfflineExecutor = class {
|
|
|
2554
2838
|
}
|
|
2555
2839
|
};
|
|
2556
2840
|
function useOfflineExecutor(options) {
|
|
2557
|
-
const executorRef =
|
|
2558
|
-
const [state, setState] =
|
|
2841
|
+
const executorRef = React112.useRef(null);
|
|
2842
|
+
const [state, setState] = React112.useState({
|
|
2559
2843
|
isOffline: false,
|
|
2560
2844
|
syncQueue: [],
|
|
2561
2845
|
localEffectsProcessed: 0,
|
|
2562
2846
|
effectsSynced: 0
|
|
2563
2847
|
});
|
|
2564
|
-
|
|
2848
|
+
React112.useEffect(() => {
|
|
2565
2849
|
const executor = new OfflineExecutor({
|
|
2566
2850
|
...options,
|
|
2567
2851
|
onQueueChange: (queue) => {
|
|
@@ -2576,7 +2860,7 @@ function useOfflineExecutor(options) {
|
|
|
2576
2860
|
executorRef.current = null;
|
|
2577
2861
|
};
|
|
2578
2862
|
}, []);
|
|
2579
|
-
|
|
2863
|
+
React112.useEffect(() => {
|
|
2580
2864
|
if (!options.autoSync || !options.serverUrl) return;
|
|
2581
2865
|
const handleOnline = async () => {
|
|
2582
2866
|
if (executorRef.current) {
|
|
@@ -2590,13 +2874,13 @@ function useOfflineExecutor(options) {
|
|
|
2590
2874
|
window.addEventListener("online", handleOnline);
|
|
2591
2875
|
return () => window.removeEventListener("online", handleOnline);
|
|
2592
2876
|
}, [options.autoSync, options.serverUrl, options.authToken]);
|
|
2593
|
-
const executeEffects =
|
|
2877
|
+
const executeEffects = React112.useCallback((effects) => {
|
|
2594
2878
|
executorRef.current?.executeClientEffects(effects);
|
|
2595
2879
|
if (executorRef.current) {
|
|
2596
2880
|
setState(executorRef.current.getState());
|
|
2597
2881
|
}
|
|
2598
2882
|
}, []);
|
|
2599
|
-
const processEventOffline =
|
|
2883
|
+
const processEventOffline = React112.useCallback(
|
|
2600
2884
|
(event, payload, effects) => {
|
|
2601
2885
|
const result = executorRef.current?.processEventOffline(event, payload, effects);
|
|
2602
2886
|
if (executorRef.current) {
|
|
@@ -2606,7 +2890,7 @@ function useOfflineExecutor(options) {
|
|
|
2606
2890
|
},
|
|
2607
2891
|
[]
|
|
2608
2892
|
);
|
|
2609
|
-
const sync =
|
|
2893
|
+
const sync = React112.useCallback(async () => {
|
|
2610
2894
|
if (!executorRef.current || !options.serverUrl) return 0;
|
|
2611
2895
|
const count = await executorRef.current.syncPendingEffects(
|
|
2612
2896
|
options.serverUrl,
|
|
@@ -2615,7 +2899,7 @@ function useOfflineExecutor(options) {
|
|
|
2615
2899
|
setState(executorRef.current.getState());
|
|
2616
2900
|
return count;
|
|
2617
2901
|
}, [options.serverUrl, options.authToken]);
|
|
2618
|
-
const clearQueue =
|
|
2902
|
+
const clearQueue = React112.useCallback(() => {
|
|
2619
2903
|
executorRef.current?.clearQueue();
|
|
2620
2904
|
if (executorRef.current) {
|
|
2621
2905
|
setState(executorRef.current.getState());
|
|
@@ -2631,7 +2915,7 @@ function useOfflineExecutor(options) {
|
|
|
2631
2915
|
clearQueue
|
|
2632
2916
|
};
|
|
2633
2917
|
}
|
|
2634
|
-
|
|
2918
|
+
React112.createContext(null);
|
|
2635
2919
|
var defaultIcon = L__default.default.icon({
|
|
2636
2920
|
iconUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",
|
|
2637
2921
|
iconRetinaUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",
|
|
@@ -2809,7 +3093,7 @@ function bindTraitStateGetter(getter) {
|
|
|
2809
3093
|
}
|
|
2810
3094
|
}
|
|
2811
3095
|
exposeOnWindow();
|
|
2812
|
-
var MarkdownContent =
|
|
3096
|
+
var MarkdownContent = React112__namespace.default.memo(
|
|
2813
3097
|
({ content, direction, className }) => {
|
|
2814
3098
|
const { t: _t } = useTranslate();
|
|
2815
3099
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -2911,7 +3195,7 @@ var MarkdownContent = React110__namespace.default.memo(
|
|
|
2911
3195
|
(prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
|
|
2912
3196
|
);
|
|
2913
3197
|
MarkdownContent.displayName = "MarkdownContent";
|
|
2914
|
-
var CodeBlock =
|
|
3198
|
+
var CodeBlock = React112__namespace.default.memo(
|
|
2915
3199
|
({
|
|
2916
3200
|
code: rawCode,
|
|
2917
3201
|
language = "text",
|
|
@@ -2923,20 +3207,20 @@ var CodeBlock = React110__namespace.default.memo(
|
|
|
2923
3207
|
const code = typeof rawCode === "string" ? rawCode : String(rawCode ?? "");
|
|
2924
3208
|
const eventBus = useEventBus();
|
|
2925
3209
|
const { t: _t } = useTranslate();
|
|
2926
|
-
const scrollRef =
|
|
2927
|
-
const savedScrollLeftRef =
|
|
2928
|
-
const [copied, setCopied] =
|
|
2929
|
-
|
|
3210
|
+
const scrollRef = React112.useRef(null);
|
|
3211
|
+
const savedScrollLeftRef = React112.useRef(0);
|
|
3212
|
+
const [copied, setCopied] = React112.useState(false);
|
|
3213
|
+
React112.useLayoutEffect(() => {
|
|
2930
3214
|
const el = scrollRef.current;
|
|
2931
3215
|
return () => {
|
|
2932
3216
|
if (el) savedScrollLeftRef.current = el.scrollLeft;
|
|
2933
3217
|
};
|
|
2934
3218
|
}, [language, code]);
|
|
2935
|
-
|
|
3219
|
+
React112.useLayoutEffect(() => {
|
|
2936
3220
|
const el = scrollRef.current;
|
|
2937
3221
|
if (el) el.scrollLeft = savedScrollLeftRef.current;
|
|
2938
3222
|
}, [language, code]);
|
|
2939
|
-
|
|
3223
|
+
React112.useEffect(() => {
|
|
2940
3224
|
const el = scrollRef.current;
|
|
2941
3225
|
if (!el) return;
|
|
2942
3226
|
const handle = () => {
|
|
@@ -3022,18 +3306,18 @@ CodeBlock.displayName = "CodeBlock";
|
|
|
3022
3306
|
|
|
3023
3307
|
// lib/debug.ts
|
|
3024
3308
|
typeof window !== "undefined" && (localStorage.getItem("debug") === "true" || process.env.NODE_ENV === "development");
|
|
3025
|
-
|
|
3026
|
-
var GameAudioContext =
|
|
3309
|
+
React112.lazy(() => import('react-markdown'));
|
|
3310
|
+
var GameAudioContext = React112.createContext(null);
|
|
3027
3311
|
GameAudioContext.displayName = "GameAudioContext";
|
|
3028
3312
|
|
|
3029
3313
|
// components/organisms/component-registry.generated.ts
|
|
3030
3314
|
function lazyThree(name, loader) {
|
|
3031
|
-
const Lazy =
|
|
3315
|
+
const Lazy = React112__namespace.default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
3032
3316
|
function ThreeWrapper(props) {
|
|
3033
|
-
return
|
|
3034
|
-
|
|
3317
|
+
return React112__namespace.default.createElement(
|
|
3318
|
+
React112__namespace.default.Suspense,
|
|
3035
3319
|
{ fallback: null },
|
|
3036
|
-
|
|
3320
|
+
React112__namespace.default.createElement(Lazy, props)
|
|
3037
3321
|
);
|
|
3038
3322
|
}
|
|
3039
3323
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -3054,13 +3338,13 @@ lazyThree("PhysicsObject3D", () => import('@almadar/ui/components/organisms/game
|
|
|
3054
3338
|
lazyThree("Scene3D", () => import('@almadar/ui/components/organisms/game/three'));
|
|
3055
3339
|
lazyThree("TileRenderer", () => import('@almadar/ui/components/organisms/game/three'));
|
|
3056
3340
|
lazyThree("UnitRenderer", () => import('@almadar/ui/components/organisms/game/three'));
|
|
3057
|
-
var SuspenseConfigContext =
|
|
3058
|
-
|
|
3341
|
+
var SuspenseConfigContext = React112.createContext({ enabled: false });
|
|
3342
|
+
React112.createContext(false);
|
|
3059
3343
|
function SuspenseConfigProvider({
|
|
3060
3344
|
config,
|
|
3061
3345
|
children
|
|
3062
3346
|
}) {
|
|
3063
|
-
return
|
|
3347
|
+
return React112__namespace.default.createElement(
|
|
3064
3348
|
SuspenseConfigContext.Provider,
|
|
3065
3349
|
{ value: config },
|
|
3066
3350
|
children
|
|
@@ -3105,8 +3389,8 @@ function VerificationProvider({
|
|
|
3105
3389
|
}) {
|
|
3106
3390
|
const isEnabled = enabled ?? (typeof process !== "undefined" && process.env?.NODE_ENV !== "production");
|
|
3107
3391
|
const eventBus = useEventBus();
|
|
3108
|
-
const pendingRef =
|
|
3109
|
-
|
|
3392
|
+
const pendingRef = React112.useRef(/* @__PURE__ */ new Map());
|
|
3393
|
+
React112.useEffect(() => {
|
|
3110
3394
|
if (!isEnabled) return;
|
|
3111
3395
|
if (!eventBus.onAny) return;
|
|
3112
3396
|
const unsub = eventBus.onAny((evt) => {
|
|
@@ -3133,7 +3417,7 @@ function VerificationProvider({
|
|
|
3133
3417
|
})) : [];
|
|
3134
3418
|
recordTransition({
|
|
3135
3419
|
traitName: parsed.traitName,
|
|
3136
|
-
from: pending?.from ??
|
|
3420
|
+
from: pending?.from ?? payload["currentState"] ?? newState,
|
|
3137
3421
|
to: newState,
|
|
3138
3422
|
event: parsed.event,
|
|
3139
3423
|
effects,
|
|
@@ -3144,10 +3428,11 @@ function VerificationProvider({
|
|
|
3144
3428
|
const pending = pendingRef.current.get(key);
|
|
3145
3429
|
pendingRef.current.delete(key);
|
|
3146
3430
|
const errorMsg = payload["error"] ?? "Unknown error";
|
|
3431
|
+
const fromState = pending?.from ?? payload["currentState"] ?? "unknown";
|
|
3147
3432
|
recordTransition({
|
|
3148
3433
|
traitName: parsed.traitName,
|
|
3149
|
-
from:
|
|
3150
|
-
to:
|
|
3434
|
+
from: fromState,
|
|
3435
|
+
to: fromState,
|
|
3151
3436
|
// state didn't change on error
|
|
3152
3437
|
event: parsed.event,
|
|
3153
3438
|
effects: [{
|
|
@@ -3167,7 +3452,7 @@ function VerificationProvider({
|
|
|
3167
3452
|
);
|
|
3168
3453
|
return unsub;
|
|
3169
3454
|
}, [isEnabled, eventBus]);
|
|
3170
|
-
|
|
3455
|
+
React112.useEffect(() => {
|
|
3171
3456
|
if (!isEnabled) return;
|
|
3172
3457
|
if (!runtimeManager) return;
|
|
3173
3458
|
runtimeManager.setObserver({
|
|
@@ -3189,11 +3474,11 @@ function VerificationProvider({
|
|
|
3189
3474
|
"pass"
|
|
3190
3475
|
);
|
|
3191
3476
|
}, [isEnabled, runtimeManager]);
|
|
3192
|
-
|
|
3477
|
+
React112.useEffect(() => {
|
|
3193
3478
|
if (!isEnabled) return;
|
|
3194
3479
|
bindEventBus(eventBus);
|
|
3195
3480
|
}, [isEnabled, eventBus]);
|
|
3196
|
-
|
|
3481
|
+
React112.useEffect(() => {
|
|
3197
3482
|
if (!isEnabled) return;
|
|
3198
3483
|
if (traitStateGetter) {
|
|
3199
3484
|
bindTraitStateGetter(traitStateGetter);
|
|
@@ -3217,7 +3502,7 @@ function OrbitalProvider({
|
|
|
3217
3502
|
suspense = false,
|
|
3218
3503
|
verification
|
|
3219
3504
|
}) {
|
|
3220
|
-
const suspenseConfig =
|
|
3505
|
+
const suspenseConfig = React112.useMemo(
|
|
3221
3506
|
() => ({ enabled: suspense }),
|
|
3222
3507
|
[suspense]
|
|
3223
3508
|
);
|
|
@@ -3237,43 +3522,43 @@ function OrbitalProvider({
|
|
|
3237
3522
|
);
|
|
3238
3523
|
}
|
|
3239
3524
|
OrbitalProvider.displayName = "OrbitalProvider";
|
|
3240
|
-
var FetchedDataContext =
|
|
3525
|
+
var FetchedDataContext = React112.createContext(null);
|
|
3241
3526
|
function FetchedDataProvider({
|
|
3242
3527
|
initialData,
|
|
3243
3528
|
children
|
|
3244
3529
|
}) {
|
|
3245
|
-
const [state, setState] =
|
|
3530
|
+
const [state, setState] = React112.useState(() => ({
|
|
3246
3531
|
data: initialData || {},
|
|
3247
3532
|
fetchedAt: {},
|
|
3248
3533
|
loading: false,
|
|
3249
3534
|
error: null
|
|
3250
3535
|
}));
|
|
3251
|
-
const getData =
|
|
3536
|
+
const getData = React112.useCallback(
|
|
3252
3537
|
(entityName) => {
|
|
3253
3538
|
return state.data[entityName] || [];
|
|
3254
3539
|
},
|
|
3255
3540
|
[state.data]
|
|
3256
3541
|
);
|
|
3257
|
-
const getById =
|
|
3542
|
+
const getById = React112.useCallback(
|
|
3258
3543
|
(entityName, id) => {
|
|
3259
3544
|
const records = state.data[entityName];
|
|
3260
3545
|
return records?.find((r) => r.id === id);
|
|
3261
3546
|
},
|
|
3262
3547
|
[state.data]
|
|
3263
3548
|
);
|
|
3264
|
-
const hasData =
|
|
3549
|
+
const hasData = React112.useCallback(
|
|
3265
3550
|
(entityName) => {
|
|
3266
3551
|
return entityName in state.data && state.data[entityName].length > 0;
|
|
3267
3552
|
},
|
|
3268
3553
|
[state.data]
|
|
3269
3554
|
);
|
|
3270
|
-
const getFetchedAt =
|
|
3555
|
+
const getFetchedAt = React112.useCallback(
|
|
3271
3556
|
(entityName) => {
|
|
3272
3557
|
return state.fetchedAt[entityName];
|
|
3273
3558
|
},
|
|
3274
3559
|
[state.fetchedAt]
|
|
3275
3560
|
);
|
|
3276
|
-
const setData =
|
|
3561
|
+
const setData = React112.useCallback((data) => {
|
|
3277
3562
|
const now = Date.now();
|
|
3278
3563
|
setState((prev) => ({
|
|
3279
3564
|
...prev,
|
|
@@ -3292,14 +3577,14 @@ function FetchedDataProvider({
|
|
|
3292
3577
|
error: null
|
|
3293
3578
|
}));
|
|
3294
3579
|
}, []);
|
|
3295
|
-
const clearData =
|
|
3580
|
+
const clearData = React112.useCallback(() => {
|
|
3296
3581
|
setState((prev) => ({
|
|
3297
3582
|
...prev,
|
|
3298
3583
|
data: {},
|
|
3299
3584
|
fetchedAt: {}
|
|
3300
3585
|
}));
|
|
3301
3586
|
}, []);
|
|
3302
|
-
const clearEntity =
|
|
3587
|
+
const clearEntity = React112.useCallback((entityName) => {
|
|
3303
3588
|
setState((prev) => {
|
|
3304
3589
|
const newData = { ...prev.data };
|
|
3305
3590
|
const newFetchedAt = { ...prev.fetchedAt };
|
|
@@ -3312,13 +3597,13 @@ function FetchedDataProvider({
|
|
|
3312
3597
|
};
|
|
3313
3598
|
});
|
|
3314
3599
|
}, []);
|
|
3315
|
-
const setLoading =
|
|
3600
|
+
const setLoading = React112.useCallback((loading) => {
|
|
3316
3601
|
setState((prev) => ({ ...prev, loading }));
|
|
3317
3602
|
}, []);
|
|
3318
|
-
const setError =
|
|
3603
|
+
const setError = React112.useCallback((error) => {
|
|
3319
3604
|
setState((prev) => ({ ...prev, error, loading: false }));
|
|
3320
3605
|
}, []);
|
|
3321
|
-
const contextValue =
|
|
3606
|
+
const contextValue = React112.useMemo(
|
|
3322
3607
|
() => ({
|
|
3323
3608
|
getData,
|
|
3324
3609
|
getById,
|
|
@@ -3349,10 +3634,10 @@ function FetchedDataProvider({
|
|
|
3349
3634
|
return /* @__PURE__ */ jsxRuntime.jsx(FetchedDataContext.Provider, { value: contextValue, children });
|
|
3350
3635
|
}
|
|
3351
3636
|
function useFetchedDataContext() {
|
|
3352
|
-
return
|
|
3637
|
+
return React112.useContext(FetchedDataContext);
|
|
3353
3638
|
}
|
|
3354
3639
|
function useFetchedData() {
|
|
3355
|
-
const context =
|
|
3640
|
+
const context = React112.useContext(FetchedDataContext);
|
|
3356
3641
|
if (!context) {
|
|
3357
3642
|
return {
|
|
3358
3643
|
getData: () => [],
|
|
@@ -3392,15 +3677,15 @@ function useFetchedEntity(entityName) {
|
|
|
3392
3677
|
error: context.error
|
|
3393
3678
|
};
|
|
3394
3679
|
}
|
|
3395
|
-
var OfflineModeContext =
|
|
3680
|
+
var OfflineModeContext = React112.createContext(null);
|
|
3396
3681
|
function OfflineModeProvider({
|
|
3397
3682
|
children,
|
|
3398
3683
|
...executorOptions
|
|
3399
3684
|
}) {
|
|
3400
|
-
const [forceOffline, setForceOffline] =
|
|
3685
|
+
const [forceOffline, setForceOffline] = React112.useState(false);
|
|
3401
3686
|
const executor = useOfflineExecutor(executorOptions);
|
|
3402
3687
|
const effectivelyOffline = executor.isOffline || forceOffline;
|
|
3403
|
-
const contextValue =
|
|
3688
|
+
const contextValue = React112.useMemo(
|
|
3404
3689
|
() => ({
|
|
3405
3690
|
...executor,
|
|
3406
3691
|
forceOffline,
|
|
@@ -3412,14 +3697,14 @@ function OfflineModeProvider({
|
|
|
3412
3697
|
return /* @__PURE__ */ jsxRuntime.jsx(OfflineModeContext.Provider, { value: contextValue, children });
|
|
3413
3698
|
}
|
|
3414
3699
|
function useOfflineMode() {
|
|
3415
|
-
const context =
|
|
3700
|
+
const context = React112.useContext(OfflineModeContext);
|
|
3416
3701
|
if (!context) {
|
|
3417
3702
|
throw new Error("useOfflineMode must be used within OfflineModeProvider");
|
|
3418
3703
|
}
|
|
3419
3704
|
return context;
|
|
3420
3705
|
}
|
|
3421
3706
|
function useOptionalOfflineMode() {
|
|
3422
|
-
return
|
|
3707
|
+
return React112.useContext(OfflineModeContext);
|
|
3423
3708
|
}
|
|
3424
3709
|
|
|
3425
3710
|
exports.EventBusContext = EventBusContext2;
|