@almadar/ui 2.23.0 → 2.24.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/components/atoms/PatternTile.d.ts +41 -0
- package/dist/components/atoms/index.d.ts +1 -0
- package/dist/components/index.cjs +2136 -1124
- package/dist/components/index.js +1272 -264
- package/dist/components/molecules/EdgeDecoration.d.ts +35 -0
- package/dist/components/molecules/GeometricPattern.d.ts +33 -0
- package/dist/components/molecules/index.d.ts +2 -0
- package/dist/docs/index.cjs +3 -3
- package/dist/docs/index.js +3 -3
- package/dist/marketing/index.cjs +1035 -23
- package/dist/marketing/index.d.cts +112 -1
- package/dist/marketing/index.d.ts +6 -0
- package/dist/marketing/index.js +1034 -26
- package/dist/providers/index.cjs +125 -125
- package/dist/providers/index.js +37 -37
- package/dist/runtime/enrichFromResponse.d.ts +1 -1
- package/dist/runtime/index.cjs +1006 -998
- package/dist/runtime/index.js +247 -239
- package/package.json +1 -1
- package/themes/almadar-website.css +36 -34
package/dist/providers/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React110 = 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 React110__namespace = /*#__PURE__*/_interopNamespace(React110);
|
|
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 = React110.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 = React110.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] = React110.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] = React110.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] = React110.useState(
|
|
204
204
|
() => resolveMode(mode)
|
|
205
205
|
);
|
|
206
|
-
const appliedTheme =
|
|
206
|
+
const appliedTheme = React110.useMemo(
|
|
207
207
|
() => `${theme}-${resolvedMode}`,
|
|
208
208
|
[theme, resolvedMode]
|
|
209
209
|
);
|
|
210
|
-
|
|
210
|
+
React110.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
|
+
React110.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 = React110.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 = React110.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 = React110.useCallback(() => {
|
|
260
260
|
const newMode = resolvedMode === "dark" ? "light" : "dark";
|
|
261
261
|
setMode(newMode);
|
|
262
262
|
}, [resolvedMode, setMode]);
|
|
263
|
-
const contextValue =
|
|
263
|
+
const contextValue = React110.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 = React110.useContext(providers.EventBusContext);
|
|
360
360
|
return context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
361
361
|
}
|
|
362
|
-
var EventBusContext2 =
|
|
362
|
+
var EventBusContext2 = React110.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 = React110.useRef(/* @__PURE__ */ new Map());
|
|
365
|
+
const anyListenersRef = React110.useRef(/* @__PURE__ */ new Set());
|
|
366
|
+
const deprecationWarningShown = React110.useRef(false);
|
|
367
|
+
const getSelectedEntity = React110.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 = React110.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 = React110.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 = React110.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 = React110.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 = React110.useCallback((type) => {
|
|
445
445
|
const listeners7 = listenersRef.current.get(type);
|
|
446
446
|
return listeners7 !== void 0 && listeners7.size > 0;
|
|
447
447
|
}, []);
|
|
448
|
-
const onAny =
|
|
448
|
+
const onAny = React110.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 = React110.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
|
+
React110.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 = React110.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] = React110.useState(null);
|
|
498
|
+
const setSelected = React110.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 = React110.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 = React110.useCallback(
|
|
514
514
|
(entity) => {
|
|
515
515
|
return compareEntities(selected, entity);
|
|
516
516
|
},
|
|
517
517
|
[selected, compareEntities]
|
|
518
518
|
);
|
|
519
|
-
|
|
519
|
+
React110.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 = React110.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 = React110.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 = React110__namespace.default.forwardRef(
|
|
708
708
|
({
|
|
709
709
|
padding,
|
|
710
710
|
paddingX,
|
|
@@ -733,20 +733,20 @@ var Box = React108__namespace.default.forwardRef(
|
|
|
733
733
|
...rest
|
|
734
734
|
}, ref) => {
|
|
735
735
|
const eventBus = useEventBus();
|
|
736
|
-
const handleClick =
|
|
736
|
+
const handleClick = React110.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 = React110.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 = React110.useCallback((e) => {
|
|
750
750
|
if (hoverEvent) {
|
|
751
751
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
752
752
|
}
|
|
@@ -914,9 +914,9 @@ var variantStyles2 = {
|
|
|
914
914
|
"active:scale-[var(--active-scale)] active:shadow-[var(--shadow-active)]"
|
|
915
915
|
].join(" "),
|
|
916
916
|
secondary: [
|
|
917
|
-
"bg-
|
|
918
|
-
"border-[length:var(--border-width
|
|
919
|
-
"hover:bg-[var(--color-
|
|
917
|
+
"bg-transparent text-[var(--color-accent)]",
|
|
918
|
+
"border-[length:var(--border-width)] border-[var(--color-accent)]",
|
|
919
|
+
"hover:bg-[var(--color-accent)] hover:text-white",
|
|
920
920
|
"active:scale-[var(--active-scale)]"
|
|
921
921
|
].join(" "),
|
|
922
922
|
ghost: [
|
|
@@ -974,7 +974,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
974
974
|
const IconComp = value;
|
|
975
975
|
return /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: sizeClass });
|
|
976
976
|
}
|
|
977
|
-
if (
|
|
977
|
+
if (React110__namespace.default.isValidElement(value)) {
|
|
978
978
|
return value;
|
|
979
979
|
}
|
|
980
980
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -983,7 +983,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
983
983
|
}
|
|
984
984
|
return value;
|
|
985
985
|
}
|
|
986
|
-
var Button =
|
|
986
|
+
var Button = React110__namespace.default.forwardRef(
|
|
987
987
|
({
|
|
988
988
|
className,
|
|
989
989
|
variant = "primary",
|
|
@@ -1078,7 +1078,7 @@ var sizeStyles3 = {
|
|
|
1078
1078
|
md: "px-2.5 py-1 text-sm",
|
|
1079
1079
|
lg: "px-3 py-1.5 text-base"
|
|
1080
1080
|
};
|
|
1081
|
-
var Badge =
|
|
1081
|
+
var Badge = React110__namespace.default.forwardRef(
|
|
1082
1082
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
1083
1083
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
1084
1084
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -1105,7 +1105,7 @@ var Badge = React108__namespace.default.forwardRef(
|
|
|
1105
1105
|
}
|
|
1106
1106
|
);
|
|
1107
1107
|
Badge.displayName = "Badge";
|
|
1108
|
-
var Input =
|
|
1108
|
+
var Input = React110__namespace.default.forwardRef(
|
|
1109
1109
|
({
|
|
1110
1110
|
className,
|
|
1111
1111
|
inputType,
|
|
@@ -1217,7 +1217,7 @@ var Input = React108__namespace.default.forwardRef(
|
|
|
1217
1217
|
}
|
|
1218
1218
|
);
|
|
1219
1219
|
Input.displayName = "Input";
|
|
1220
|
-
var Label =
|
|
1220
|
+
var Label = React110__namespace.default.forwardRef(
|
|
1221
1221
|
({ className, required, children, ...props }, ref) => {
|
|
1222
1222
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1223
1223
|
"label",
|
|
@@ -1237,7 +1237,7 @@ var Label = React108__namespace.default.forwardRef(
|
|
|
1237
1237
|
}
|
|
1238
1238
|
);
|
|
1239
1239
|
Label.displayName = "Label";
|
|
1240
|
-
var Textarea =
|
|
1240
|
+
var Textarea = React110__namespace.default.forwardRef(
|
|
1241
1241
|
({ className, error, ...props }, ref) => {
|
|
1242
1242
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1243
1243
|
"textarea",
|
|
@@ -1260,7 +1260,7 @@ var Textarea = React108__namespace.default.forwardRef(
|
|
|
1260
1260
|
}
|
|
1261
1261
|
);
|
|
1262
1262
|
Textarea.displayName = "Textarea";
|
|
1263
|
-
var Select =
|
|
1263
|
+
var Select = React110__namespace.default.forwardRef(
|
|
1264
1264
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
1265
1265
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
1266
1266
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1296,7 +1296,7 @@ var Select = React108__namespace.default.forwardRef(
|
|
|
1296
1296
|
}
|
|
1297
1297
|
);
|
|
1298
1298
|
Select.displayName = "Select";
|
|
1299
|
-
var Checkbox =
|
|
1299
|
+
var Checkbox = React110__namespace.default.forwardRef(
|
|
1300
1300
|
({ className, label, id, ...props }, ref) => {
|
|
1301
1301
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
1302
1302
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
|
|
@@ -1370,7 +1370,7 @@ var shadowStyles2 = {
|
|
|
1370
1370
|
md: "shadow-[var(--shadow-main)]",
|
|
1371
1371
|
lg: "shadow-[var(--shadow-lg)]"
|
|
1372
1372
|
};
|
|
1373
|
-
var Card =
|
|
1373
|
+
var Card = React110__namespace.default.forwardRef(
|
|
1374
1374
|
({
|
|
1375
1375
|
className,
|
|
1376
1376
|
variant = "bordered",
|
|
@@ -1406,9 +1406,9 @@ var Card = React108__namespace.default.forwardRef(
|
|
|
1406
1406
|
}
|
|
1407
1407
|
);
|
|
1408
1408
|
Card.displayName = "Card";
|
|
1409
|
-
var CardHeader =
|
|
1409
|
+
var CardHeader = React110__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
1410
1410
|
CardHeader.displayName = "CardHeader";
|
|
1411
|
-
var CardTitle =
|
|
1411
|
+
var CardTitle = React110__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1412
1412
|
"h3",
|
|
1413
1413
|
{
|
|
1414
1414
|
ref,
|
|
@@ -1421,11 +1421,11 @@ var CardTitle = React108__namespace.default.forwardRef(({ className, ...props },
|
|
|
1421
1421
|
}
|
|
1422
1422
|
));
|
|
1423
1423
|
CardTitle.displayName = "CardTitle";
|
|
1424
|
-
var CardContent =
|
|
1424
|
+
var CardContent = React110__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
|
|
1425
1425
|
CardContent.displayName = "CardContent";
|
|
1426
1426
|
var CardBody = CardContent;
|
|
1427
1427
|
CardBody.displayName = "CardBody";
|
|
1428
|
-
var CardFooter =
|
|
1428
|
+
var CardFooter = React110__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1429
1429
|
"div",
|
|
1430
1430
|
{
|
|
1431
1431
|
ref,
|
|
@@ -1440,7 +1440,7 @@ var sizeStyles4 = {
|
|
|
1440
1440
|
md: "h-6 w-6",
|
|
1441
1441
|
lg: "h-8 w-8"
|
|
1442
1442
|
};
|
|
1443
|
-
var Spinner =
|
|
1443
|
+
var Spinner = React110__namespace.default.forwardRef(
|
|
1444
1444
|
({ className, size = "md", ...props }, ref) => {
|
|
1445
1445
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1446
1446
|
"div",
|
|
@@ -1454,7 +1454,7 @@ var Spinner = React108__namespace.default.forwardRef(
|
|
|
1454
1454
|
}
|
|
1455
1455
|
);
|
|
1456
1456
|
Spinner.displayName = "Spinner";
|
|
1457
|
-
var Radio =
|
|
1457
|
+
var Radio = React110__namespace.default.forwardRef(
|
|
1458
1458
|
({
|
|
1459
1459
|
label,
|
|
1460
1460
|
helperText,
|
|
@@ -1558,7 +1558,7 @@ var Radio = React108__namespace.default.forwardRef(
|
|
|
1558
1558
|
}
|
|
1559
1559
|
);
|
|
1560
1560
|
Radio.displayName = "Radio";
|
|
1561
|
-
var Switch =
|
|
1561
|
+
var Switch = React110__namespace.forwardRef(
|
|
1562
1562
|
({
|
|
1563
1563
|
checked,
|
|
1564
1564
|
defaultChecked = false,
|
|
@@ -1569,10 +1569,10 @@ var Switch = React108__namespace.forwardRef(
|
|
|
1569
1569
|
name,
|
|
1570
1570
|
className
|
|
1571
1571
|
}, ref) => {
|
|
1572
|
-
const [isChecked, setIsChecked] =
|
|
1572
|
+
const [isChecked, setIsChecked] = React110__namespace.useState(
|
|
1573
1573
|
checked !== void 0 ? checked : defaultChecked
|
|
1574
1574
|
);
|
|
1575
|
-
|
|
1575
|
+
React110__namespace.useEffect(() => {
|
|
1576
1576
|
if (checked !== void 0) {
|
|
1577
1577
|
setIsChecked(checked);
|
|
1578
1578
|
}
|
|
@@ -1730,7 +1730,7 @@ var sizeStyles5 = {
|
|
|
1730
1730
|
md: "w-2.5 h-2.5",
|
|
1731
1731
|
lg: "w-3 h-3"
|
|
1732
1732
|
};
|
|
1733
|
-
var StatusDot =
|
|
1733
|
+
var StatusDot = React110__namespace.default.forwardRef(
|
|
1734
1734
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
1735
1735
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1736
1736
|
"span",
|
|
@@ -1777,7 +1777,7 @@ var iconMap2 = {
|
|
|
1777
1777
|
down: LucideIcons.TrendingDown,
|
|
1778
1778
|
flat: LucideIcons.ArrowRight
|
|
1779
1779
|
};
|
|
1780
|
-
var TrendIndicator =
|
|
1780
|
+
var TrendIndicator = React110__namespace.default.forwardRef(
|
|
1781
1781
|
({
|
|
1782
1782
|
className,
|
|
1783
1783
|
value,
|
|
@@ -1836,7 +1836,7 @@ var thumbSizes = {
|
|
|
1836
1836
|
md: "w-4 h-4",
|
|
1837
1837
|
lg: "w-5 h-5"
|
|
1838
1838
|
};
|
|
1839
|
-
var RangeSlider =
|
|
1839
|
+
var RangeSlider = React110__namespace.default.forwardRef(
|
|
1840
1840
|
({
|
|
1841
1841
|
className,
|
|
1842
1842
|
min = 0,
|
|
@@ -1854,14 +1854,14 @@ var RangeSlider = React108__namespace.default.forwardRef(
|
|
|
1854
1854
|
formatValue: formatValue5,
|
|
1855
1855
|
...props
|
|
1856
1856
|
}, ref) => {
|
|
1857
|
-
const [isDragging, setIsDragging] =
|
|
1858
|
-
const [showTip, setShowTip] =
|
|
1859
|
-
const inputRef =
|
|
1857
|
+
const [isDragging, setIsDragging] = React110.useState(false);
|
|
1858
|
+
const [showTip, setShowTip] = React110.useState(false);
|
|
1859
|
+
const inputRef = React110.useRef(null);
|
|
1860
1860
|
const eventBus = useSafeEventBus();
|
|
1861
1861
|
const percentage = max !== min ? (value - min) / (max - min) * 100 : 0;
|
|
1862
1862
|
const bufferedPercentage = buffered !== void 0 ? Math.min(buffered, 100) : void 0;
|
|
1863
1863
|
const displayValue = formatValue5 ? formatValue5(value) : String(value);
|
|
1864
|
-
const handleChange =
|
|
1864
|
+
const handleChange = React110.useCallback(
|
|
1865
1865
|
(e) => {
|
|
1866
1866
|
const newValue = Number(e.target.value);
|
|
1867
1867
|
onChange?.(newValue);
|
|
@@ -2039,7 +2039,7 @@ var paddingClasses = {
|
|
|
2039
2039
|
md: "py-16",
|
|
2040
2040
|
lg: "py-24"
|
|
2041
2041
|
};
|
|
2042
|
-
var ContentSection =
|
|
2042
|
+
var ContentSection = React110__namespace.default.forwardRef(
|
|
2043
2043
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
2044
2044
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2045
2045
|
Box,
|
|
@@ -2052,7 +2052,7 @@ var ContentSection = React108__namespace.default.forwardRef(
|
|
|
2052
2052
|
paddingClasses[padding],
|
|
2053
2053
|
className
|
|
2054
2054
|
),
|
|
2055
|
-
children
|
|
2055
|
+
children
|
|
2056
2056
|
}
|
|
2057
2057
|
);
|
|
2058
2058
|
}
|
|
@@ -2168,7 +2168,7 @@ var en_default = {
|
|
|
2168
2168
|
// hooks/useTranslate.ts
|
|
2169
2169
|
var { $meta: _meta, ...coreMessages } = en_default;
|
|
2170
2170
|
var coreLocale = coreMessages;
|
|
2171
|
-
var I18nContext =
|
|
2171
|
+
var I18nContext = React110.createContext({
|
|
2172
2172
|
locale: "en",
|
|
2173
2173
|
direction: "ltr",
|
|
2174
2174
|
t: (key) => coreLocale[key] ?? key
|
|
@@ -2177,7 +2177,7 @@ var I18nContext = React108.createContext({
|
|
|
2177
2177
|
I18nContext.displayName = "I18nContext";
|
|
2178
2178
|
I18nContext.Provider;
|
|
2179
2179
|
function useTranslate() {
|
|
2180
|
-
return
|
|
2180
|
+
return React110.useContext(I18nContext);
|
|
2181
2181
|
}
|
|
2182
2182
|
var ErrorState = ({
|
|
2183
2183
|
title,
|
|
@@ -2213,7 +2213,7 @@ var ErrorState = ({
|
|
|
2213
2213
|
);
|
|
2214
2214
|
};
|
|
2215
2215
|
ErrorState.displayName = "ErrorState";
|
|
2216
|
-
var ErrorBoundary = class extends
|
|
2216
|
+
var ErrorBoundary = class extends React110__namespace.default.Component {
|
|
2217
2217
|
constructor(props) {
|
|
2218
2218
|
super(props);
|
|
2219
2219
|
__publicField(this, "reset", () => {
|
|
@@ -2312,7 +2312,7 @@ function executeNotify(message, options, config) {
|
|
|
2312
2312
|
function executeEmit(event, payload, config) {
|
|
2313
2313
|
config.eventBus.emit(event, payload);
|
|
2314
2314
|
}
|
|
2315
|
-
var ClientEffectConfigContext =
|
|
2315
|
+
var ClientEffectConfigContext = React110.createContext(null);
|
|
2316
2316
|
ClientEffectConfigContext.Provider;
|
|
2317
2317
|
var effectIdCounter = 0;
|
|
2318
2318
|
function generateEffectId() {
|
|
@@ -2551,14 +2551,14 @@ var OfflineExecutor = class {
|
|
|
2551
2551
|
}
|
|
2552
2552
|
};
|
|
2553
2553
|
function useOfflineExecutor(options) {
|
|
2554
|
-
const executorRef =
|
|
2555
|
-
const [state, setState] =
|
|
2554
|
+
const executorRef = React110.useRef(null);
|
|
2555
|
+
const [state, setState] = React110.useState({
|
|
2556
2556
|
isOffline: false,
|
|
2557
2557
|
syncQueue: [],
|
|
2558
2558
|
localEffectsProcessed: 0,
|
|
2559
2559
|
effectsSynced: 0
|
|
2560
2560
|
});
|
|
2561
|
-
|
|
2561
|
+
React110.useEffect(() => {
|
|
2562
2562
|
const executor = new OfflineExecutor({
|
|
2563
2563
|
...options,
|
|
2564
2564
|
onQueueChange: (queue) => {
|
|
@@ -2573,7 +2573,7 @@ function useOfflineExecutor(options) {
|
|
|
2573
2573
|
executorRef.current = null;
|
|
2574
2574
|
};
|
|
2575
2575
|
}, []);
|
|
2576
|
-
|
|
2576
|
+
React110.useEffect(() => {
|
|
2577
2577
|
if (!options.autoSync || !options.serverUrl) return;
|
|
2578
2578
|
const handleOnline = async () => {
|
|
2579
2579
|
if (executorRef.current) {
|
|
@@ -2587,13 +2587,13 @@ function useOfflineExecutor(options) {
|
|
|
2587
2587
|
window.addEventListener("online", handleOnline);
|
|
2588
2588
|
return () => window.removeEventListener("online", handleOnline);
|
|
2589
2589
|
}, [options.autoSync, options.serverUrl, options.authToken]);
|
|
2590
|
-
const executeEffects =
|
|
2590
|
+
const executeEffects = React110.useCallback((effects) => {
|
|
2591
2591
|
executorRef.current?.executeClientEffects(effects);
|
|
2592
2592
|
if (executorRef.current) {
|
|
2593
2593
|
setState(executorRef.current.getState());
|
|
2594
2594
|
}
|
|
2595
2595
|
}, []);
|
|
2596
|
-
const processEventOffline =
|
|
2596
|
+
const processEventOffline = React110.useCallback(
|
|
2597
2597
|
(event, payload, effects) => {
|
|
2598
2598
|
const result = executorRef.current?.processEventOffline(event, payload, effects);
|
|
2599
2599
|
if (executorRef.current) {
|
|
@@ -2603,7 +2603,7 @@ function useOfflineExecutor(options) {
|
|
|
2603
2603
|
},
|
|
2604
2604
|
[]
|
|
2605
2605
|
);
|
|
2606
|
-
const sync =
|
|
2606
|
+
const sync = React110.useCallback(async () => {
|
|
2607
2607
|
if (!executorRef.current || !options.serverUrl) return 0;
|
|
2608
2608
|
const count = await executorRef.current.syncPendingEffects(
|
|
2609
2609
|
options.serverUrl,
|
|
@@ -2612,7 +2612,7 @@ function useOfflineExecutor(options) {
|
|
|
2612
2612
|
setState(executorRef.current.getState());
|
|
2613
2613
|
return count;
|
|
2614
2614
|
}, [options.serverUrl, options.authToken]);
|
|
2615
|
-
const clearQueue =
|
|
2615
|
+
const clearQueue = React110.useCallback(() => {
|
|
2616
2616
|
executorRef.current?.clearQueue();
|
|
2617
2617
|
if (executorRef.current) {
|
|
2618
2618
|
setState(executorRef.current.getState());
|
|
@@ -2628,7 +2628,7 @@ function useOfflineExecutor(options) {
|
|
|
2628
2628
|
clearQueue
|
|
2629
2629
|
};
|
|
2630
2630
|
}
|
|
2631
|
-
|
|
2631
|
+
React110.createContext(null);
|
|
2632
2632
|
var defaultIcon = L__default.default.icon({
|
|
2633
2633
|
iconUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",
|
|
2634
2634
|
iconRetinaUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",
|
|
@@ -2793,7 +2793,7 @@ function bindTraitStateGetter(getter) {
|
|
|
2793
2793
|
}
|
|
2794
2794
|
}
|
|
2795
2795
|
exposeOnWindow();
|
|
2796
|
-
var MarkdownContent =
|
|
2796
|
+
var MarkdownContent = React110__namespace.default.memo(
|
|
2797
2797
|
({ content, direction, className }) => {
|
|
2798
2798
|
const { t: _t } = useTranslate();
|
|
2799
2799
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2894,7 +2894,7 @@ var MarkdownContent = React108__namespace.default.memo(
|
|
|
2894
2894
|
(prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
|
|
2895
2895
|
);
|
|
2896
2896
|
MarkdownContent.displayName = "MarkdownContent";
|
|
2897
|
-
var CodeBlock =
|
|
2897
|
+
var CodeBlock = React110__namespace.default.memo(
|
|
2898
2898
|
({
|
|
2899
2899
|
code,
|
|
2900
2900
|
language = "text",
|
|
@@ -2905,20 +2905,20 @@ var CodeBlock = React108__namespace.default.memo(
|
|
|
2905
2905
|
}) => {
|
|
2906
2906
|
const eventBus = useEventBus();
|
|
2907
2907
|
const { t: _t } = useTranslate();
|
|
2908
|
-
const scrollRef =
|
|
2909
|
-
const savedScrollLeftRef =
|
|
2910
|
-
const [copied, setCopied] =
|
|
2911
|
-
|
|
2908
|
+
const scrollRef = React110.useRef(null);
|
|
2909
|
+
const savedScrollLeftRef = React110.useRef(0);
|
|
2910
|
+
const [copied, setCopied] = React110.useState(false);
|
|
2911
|
+
React110.useLayoutEffect(() => {
|
|
2912
2912
|
const el = scrollRef.current;
|
|
2913
2913
|
return () => {
|
|
2914
2914
|
if (el) savedScrollLeftRef.current = el.scrollLeft;
|
|
2915
2915
|
};
|
|
2916
2916
|
}, [language, code]);
|
|
2917
|
-
|
|
2917
|
+
React110.useLayoutEffect(() => {
|
|
2918
2918
|
const el = scrollRef.current;
|
|
2919
2919
|
if (el) el.scrollLeft = savedScrollLeftRef.current;
|
|
2920
2920
|
}, [language, code]);
|
|
2921
|
-
|
|
2921
|
+
React110.useEffect(() => {
|
|
2922
2922
|
const el = scrollRef.current;
|
|
2923
2923
|
if (!el) return;
|
|
2924
2924
|
const handle = () => {
|
|
@@ -3004,18 +3004,18 @@ CodeBlock.displayName = "CodeBlock";
|
|
|
3004
3004
|
|
|
3005
3005
|
// lib/debug.ts
|
|
3006
3006
|
typeof window !== "undefined" && (localStorage.getItem("debug") === "true" || process.env.NODE_ENV === "development");
|
|
3007
|
-
|
|
3008
|
-
var GameAudioContext =
|
|
3007
|
+
React110.lazy(() => import('react-markdown'));
|
|
3008
|
+
var GameAudioContext = React110.createContext(null);
|
|
3009
3009
|
GameAudioContext.displayName = "GameAudioContext";
|
|
3010
3010
|
|
|
3011
3011
|
// components/organisms/component-registry.generated.ts
|
|
3012
3012
|
function lazyThree(name, loader) {
|
|
3013
|
-
const Lazy =
|
|
3013
|
+
const Lazy = React110__namespace.default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
3014
3014
|
function ThreeWrapper(props) {
|
|
3015
|
-
return
|
|
3016
|
-
|
|
3015
|
+
return React110__namespace.default.createElement(
|
|
3016
|
+
React110__namespace.default.Suspense,
|
|
3017
3017
|
{ fallback: null },
|
|
3018
|
-
|
|
3018
|
+
React110__namespace.default.createElement(Lazy, props)
|
|
3019
3019
|
);
|
|
3020
3020
|
}
|
|
3021
3021
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -3036,13 +3036,13 @@ lazyThree("PhysicsObject3D", () => import('@almadar/ui/components/organisms/game
|
|
|
3036
3036
|
lazyThree("Scene3D", () => import('@almadar/ui/components/organisms/game/three'));
|
|
3037
3037
|
lazyThree("TileRenderer", () => import('@almadar/ui/components/organisms/game/three'));
|
|
3038
3038
|
lazyThree("UnitRenderer", () => import('@almadar/ui/components/organisms/game/three'));
|
|
3039
|
-
var SuspenseConfigContext =
|
|
3040
|
-
|
|
3039
|
+
var SuspenseConfigContext = React110.createContext({ enabled: false });
|
|
3040
|
+
React110.createContext(false);
|
|
3041
3041
|
function SuspenseConfigProvider({
|
|
3042
3042
|
config,
|
|
3043
3043
|
children
|
|
3044
3044
|
}) {
|
|
3045
|
-
return
|
|
3045
|
+
return React110__namespace.default.createElement(
|
|
3046
3046
|
SuspenseConfigContext.Provider,
|
|
3047
3047
|
{ value: config },
|
|
3048
3048
|
children
|
|
@@ -3087,8 +3087,8 @@ function VerificationProvider({
|
|
|
3087
3087
|
}) {
|
|
3088
3088
|
const isEnabled = enabled ?? (typeof process !== "undefined" && process.env?.NODE_ENV !== "production");
|
|
3089
3089
|
const eventBus = useEventBus();
|
|
3090
|
-
const pendingRef =
|
|
3091
|
-
|
|
3090
|
+
const pendingRef = React110.useRef(/* @__PURE__ */ new Map());
|
|
3091
|
+
React110.useEffect(() => {
|
|
3092
3092
|
if (!isEnabled) return;
|
|
3093
3093
|
if (!eventBus.onAny) return;
|
|
3094
3094
|
const unsub = eventBus.onAny((evt) => {
|
|
@@ -3149,7 +3149,7 @@ function VerificationProvider({
|
|
|
3149
3149
|
);
|
|
3150
3150
|
return unsub;
|
|
3151
3151
|
}, [isEnabled, eventBus]);
|
|
3152
|
-
|
|
3152
|
+
React110.useEffect(() => {
|
|
3153
3153
|
if (!isEnabled) return;
|
|
3154
3154
|
if (!runtimeManager) return;
|
|
3155
3155
|
runtimeManager.setObserver({
|
|
@@ -3171,11 +3171,11 @@ function VerificationProvider({
|
|
|
3171
3171
|
"pass"
|
|
3172
3172
|
);
|
|
3173
3173
|
}, [isEnabled, runtimeManager]);
|
|
3174
|
-
|
|
3174
|
+
React110.useEffect(() => {
|
|
3175
3175
|
if (!isEnabled) return;
|
|
3176
3176
|
bindEventBus(eventBus);
|
|
3177
3177
|
}, [isEnabled, eventBus]);
|
|
3178
|
-
|
|
3178
|
+
React110.useEffect(() => {
|
|
3179
3179
|
if (!isEnabled) return;
|
|
3180
3180
|
if (traitStateGetter) {
|
|
3181
3181
|
bindTraitStateGetter(traitStateGetter);
|
|
@@ -3199,7 +3199,7 @@ function OrbitalProvider({
|
|
|
3199
3199
|
suspense = false,
|
|
3200
3200
|
verification
|
|
3201
3201
|
}) {
|
|
3202
|
-
const suspenseConfig =
|
|
3202
|
+
const suspenseConfig = React110.useMemo(
|
|
3203
3203
|
() => ({ enabled: suspense }),
|
|
3204
3204
|
[suspense]
|
|
3205
3205
|
);
|
|
@@ -3219,43 +3219,43 @@ function OrbitalProvider({
|
|
|
3219
3219
|
);
|
|
3220
3220
|
}
|
|
3221
3221
|
OrbitalProvider.displayName = "OrbitalProvider";
|
|
3222
|
-
var FetchedDataContext =
|
|
3222
|
+
var FetchedDataContext = React110.createContext(null);
|
|
3223
3223
|
function FetchedDataProvider({
|
|
3224
3224
|
initialData,
|
|
3225
3225
|
children
|
|
3226
3226
|
}) {
|
|
3227
|
-
const [state, setState] =
|
|
3227
|
+
const [state, setState] = React110.useState(() => ({
|
|
3228
3228
|
data: initialData || {},
|
|
3229
3229
|
fetchedAt: {},
|
|
3230
3230
|
loading: false,
|
|
3231
3231
|
error: null
|
|
3232
3232
|
}));
|
|
3233
|
-
const getData =
|
|
3233
|
+
const getData = React110.useCallback(
|
|
3234
3234
|
(entityName) => {
|
|
3235
3235
|
return state.data[entityName] || [];
|
|
3236
3236
|
},
|
|
3237
3237
|
[state.data]
|
|
3238
3238
|
);
|
|
3239
|
-
const getById =
|
|
3239
|
+
const getById = React110.useCallback(
|
|
3240
3240
|
(entityName, id) => {
|
|
3241
3241
|
const records = state.data[entityName];
|
|
3242
3242
|
return records?.find((r) => r.id === id);
|
|
3243
3243
|
},
|
|
3244
3244
|
[state.data]
|
|
3245
3245
|
);
|
|
3246
|
-
const hasData =
|
|
3246
|
+
const hasData = React110.useCallback(
|
|
3247
3247
|
(entityName) => {
|
|
3248
3248
|
return entityName in state.data && state.data[entityName].length > 0;
|
|
3249
3249
|
},
|
|
3250
3250
|
[state.data]
|
|
3251
3251
|
);
|
|
3252
|
-
const getFetchedAt =
|
|
3252
|
+
const getFetchedAt = React110.useCallback(
|
|
3253
3253
|
(entityName) => {
|
|
3254
3254
|
return state.fetchedAt[entityName];
|
|
3255
3255
|
},
|
|
3256
3256
|
[state.fetchedAt]
|
|
3257
3257
|
);
|
|
3258
|
-
const setData =
|
|
3258
|
+
const setData = React110.useCallback((data) => {
|
|
3259
3259
|
const now = Date.now();
|
|
3260
3260
|
setState((prev) => ({
|
|
3261
3261
|
...prev,
|
|
@@ -3274,14 +3274,14 @@ function FetchedDataProvider({
|
|
|
3274
3274
|
error: null
|
|
3275
3275
|
}));
|
|
3276
3276
|
}, []);
|
|
3277
|
-
const clearData =
|
|
3277
|
+
const clearData = React110.useCallback(() => {
|
|
3278
3278
|
setState((prev) => ({
|
|
3279
3279
|
...prev,
|
|
3280
3280
|
data: {},
|
|
3281
3281
|
fetchedAt: {}
|
|
3282
3282
|
}));
|
|
3283
3283
|
}, []);
|
|
3284
|
-
const clearEntity =
|
|
3284
|
+
const clearEntity = React110.useCallback((entityName) => {
|
|
3285
3285
|
setState((prev) => {
|
|
3286
3286
|
const newData = { ...prev.data };
|
|
3287
3287
|
const newFetchedAt = { ...prev.fetchedAt };
|
|
@@ -3294,13 +3294,13 @@ function FetchedDataProvider({
|
|
|
3294
3294
|
};
|
|
3295
3295
|
});
|
|
3296
3296
|
}, []);
|
|
3297
|
-
const setLoading =
|
|
3297
|
+
const setLoading = React110.useCallback((loading) => {
|
|
3298
3298
|
setState((prev) => ({ ...prev, loading }));
|
|
3299
3299
|
}, []);
|
|
3300
|
-
const setError =
|
|
3300
|
+
const setError = React110.useCallback((error) => {
|
|
3301
3301
|
setState((prev) => ({ ...prev, error, loading: false }));
|
|
3302
3302
|
}, []);
|
|
3303
|
-
const contextValue =
|
|
3303
|
+
const contextValue = React110.useMemo(
|
|
3304
3304
|
() => ({
|
|
3305
3305
|
getData,
|
|
3306
3306
|
getById,
|
|
@@ -3331,10 +3331,10 @@ function FetchedDataProvider({
|
|
|
3331
3331
|
return /* @__PURE__ */ jsxRuntime.jsx(FetchedDataContext.Provider, { value: contextValue, children });
|
|
3332
3332
|
}
|
|
3333
3333
|
function useFetchedDataContext() {
|
|
3334
|
-
return
|
|
3334
|
+
return React110.useContext(FetchedDataContext);
|
|
3335
3335
|
}
|
|
3336
3336
|
function useFetchedData() {
|
|
3337
|
-
const context =
|
|
3337
|
+
const context = React110.useContext(FetchedDataContext);
|
|
3338
3338
|
if (!context) {
|
|
3339
3339
|
return {
|
|
3340
3340
|
getData: () => [],
|
|
@@ -3374,15 +3374,15 @@ function useFetchedEntity(entityName) {
|
|
|
3374
3374
|
error: context.error
|
|
3375
3375
|
};
|
|
3376
3376
|
}
|
|
3377
|
-
var OfflineModeContext =
|
|
3377
|
+
var OfflineModeContext = React110.createContext(null);
|
|
3378
3378
|
function OfflineModeProvider({
|
|
3379
3379
|
children,
|
|
3380
3380
|
...executorOptions
|
|
3381
3381
|
}) {
|
|
3382
|
-
const [forceOffline, setForceOffline] =
|
|
3382
|
+
const [forceOffline, setForceOffline] = React110.useState(false);
|
|
3383
3383
|
const executor = useOfflineExecutor(executorOptions);
|
|
3384
3384
|
const effectivelyOffline = executor.isOffline || forceOffline;
|
|
3385
|
-
const contextValue =
|
|
3385
|
+
const contextValue = React110.useMemo(
|
|
3386
3386
|
() => ({
|
|
3387
3387
|
...executor,
|
|
3388
3388
|
forceOffline,
|
|
@@ -3394,14 +3394,14 @@ function OfflineModeProvider({
|
|
|
3394
3394
|
return /* @__PURE__ */ jsxRuntime.jsx(OfflineModeContext.Provider, { value: contextValue, children });
|
|
3395
3395
|
}
|
|
3396
3396
|
function useOfflineMode() {
|
|
3397
|
-
const context =
|
|
3397
|
+
const context = React110.useContext(OfflineModeContext);
|
|
3398
3398
|
if (!context) {
|
|
3399
3399
|
throw new Error("useOfflineMode must be used within OfflineModeProvider");
|
|
3400
3400
|
}
|
|
3401
3401
|
return context;
|
|
3402
3402
|
}
|
|
3403
3403
|
function useOptionalOfflineMode() {
|
|
3404
|
-
return
|
|
3404
|
+
return React110.useContext(OfflineModeContext);
|
|
3405
3405
|
}
|
|
3406
3406
|
|
|
3407
3407
|
exports.EventBusContext = EventBusContext2;
|