@almadar/ui 5.153.0 → 5.155.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/{EntityBindingContext-CD9ZoXb4.d.cts → EntityBindingContext-BfZGeDfX.d.cts} +4 -2
- package/dist/{EntityBindingContext-CD9ZoXb4.d.ts → EntityBindingContext-BfZGeDfX.d.ts} +4 -2
- package/dist/NavStackContext-BoVV9nWb.d.cts +83 -0
- package/dist/NavStackContext-BoVV9nWb.d.ts +83 -0
- package/dist/avl/index.cjs +114 -31
- package/dist/avl/index.js +115 -32
- package/dist/components/index.cjs +44 -7
- package/dist/components/index.d.cts +30 -8
- package/dist/components/index.d.ts +30 -8
- package/dist/components/index.js +42 -9
- package/dist/hooks/index.cjs +4 -0
- package/dist/hooks/index.d.cts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/marketing/index.d.cts +2 -1
- package/dist/marketing/index.d.ts +2 -1
- package/dist/providers/index.cjs +220 -14
- package/dist/providers/index.d.cts +2 -1
- package/dist/providers/index.d.ts +2 -1
- package/dist/providers/index.js +220 -17
- package/dist/runtime/index.cjs +113 -30
- package/dist/runtime/index.d.cts +12 -5
- package/dist/runtime/index.d.ts +12 -5
- package/dist/runtime/index.js +114 -31
- package/package.json +4 -4
package/dist/components/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import * as React77 from 'react';
|
|
|
3
3
|
import React77__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, useState, useLayoutEffect, useId, Suspense, lazy, useSyncExternalStore } from 'react';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import { EventBusContext, useTraitScopeChain, useCurrentPagePath, useGameAudioContextOptional, useEntitySchemaOptional, useEntityBindingSnapshot, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
|
|
7
|
-
export { GameAudioContext, GameAudioProvider, useGameAudioContext } from '@almadar/ui/providers';
|
|
6
|
+
import { EventBusContext, useTraitScopeChain, useCurrentPagePath, useGameAudioContextOptional, useEntitySchemaOptional, useEntityBindingSnapshot, useTraitScope, TraitScopeProvider, useNavStack } from '@almadar/ui/providers';
|
|
7
|
+
export { GameAudioContext, GameAudioProvider, useGameAudioContext, useNavStack } from '@almadar/ui/providers';
|
|
8
8
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
9
9
|
import * as LucideIcons2 from 'lucide-react';
|
|
10
10
|
import { X, List, Printer, ChevronRight, ChevronLeft, Check, Copy, RotateCcw, Play, Terminal, CheckCircle, XCircle, ChevronDown, Search, ChevronUp, MoreHorizontal, ArrowLeft, DollarSign, Package, Calendar, Pencil, Eye, Image as Image$1, Upload, ZoomIn, TrendingUp, TrendingDown, Minus, AlertCircle, Circle, Clock, CheckCircle2, Loader2, Code, FileText, WrapText, HelpCircle, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, GitBranch, Plus, ArrowRight, Trash, Menu as Menu$1, AlertTriangle, Trash2, Eraser, ZoomOut, Download, Lightbulb, PauseCircle, Link2, Tag, User } from 'lucide-react';
|
|
@@ -16126,17 +16126,27 @@ var init_Breadcrumb = __esm({
|
|
|
16126
16126
|
init_useEventBus();
|
|
16127
16127
|
Breadcrumb = ({
|
|
16128
16128
|
items,
|
|
16129
|
+
fromNavStack = false,
|
|
16130
|
+
itemEvent,
|
|
16129
16131
|
separator = "chevron-right",
|
|
16130
16132
|
maxItems,
|
|
16131
16133
|
className
|
|
16132
16134
|
}) => {
|
|
16133
16135
|
const eventBus = useEventBus();
|
|
16134
16136
|
const { t } = useTranslate();
|
|
16135
|
-
const
|
|
16136
|
-
|
|
16137
|
+
const navStack = useNavStack();
|
|
16138
|
+
const sourceItems = fromNavStack ? navStack.entries.map((entry, i) => ({
|
|
16139
|
+
label: entry.label,
|
|
16140
|
+
path: entry.href,
|
|
16141
|
+
isCurrent: i === navStack.entries.length - 1,
|
|
16142
|
+
event: itemEvent
|
|
16143
|
+
})) : items ?? [];
|
|
16144
|
+
if (fromNavStack && sourceItems.length === 0) return null;
|
|
16145
|
+
const displayItems = maxItems && sourceItems.length > maxItems ? [
|
|
16146
|
+
...sourceItems.slice(0, 1),
|
|
16137
16147
|
{ label: "...", isCurrent: false },
|
|
16138
|
-
...
|
|
16139
|
-
] :
|
|
16148
|
+
...sourceItems.slice(-maxItems + 1)
|
|
16149
|
+
] : sourceItems;
|
|
16140
16150
|
return /* @__PURE__ */ jsx(
|
|
16141
16151
|
"nav",
|
|
16142
16152
|
{
|
|
@@ -16146,7 +16156,7 @@ var init_Breadcrumb = __esm({
|
|
|
16146
16156
|
const isLast = index === displayItems.length - 1;
|
|
16147
16157
|
const isEllipsis = item.label === "...";
|
|
16148
16158
|
return /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2", children: [
|
|
16149
|
-
isEllipsis ? /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: item.label }) : item.href || item.path ? /* @__PURE__ */ jsxs(
|
|
16159
|
+
isEllipsis ? /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: item.label }) : (item.href || item.path) && !item.event && !fromNavStack ? /* @__PURE__ */ jsxs(
|
|
16150
16160
|
"a",
|
|
16151
16161
|
{
|
|
16152
16162
|
href: item.href || item.path,
|
|
@@ -16172,7 +16182,12 @@ var init_Breadcrumb = __esm({
|
|
|
16172
16182
|
{
|
|
16173
16183
|
type: "button",
|
|
16174
16184
|
onClick: () => {
|
|
16175
|
-
|
|
16185
|
+
const href = item.path ?? item.href;
|
|
16186
|
+
if (item.event) {
|
|
16187
|
+
eventBus.emit(`UI:${item.event}`, { label: item.label, href, index });
|
|
16188
|
+
} else if (fromNavStack && href) {
|
|
16189
|
+
navStack.goTo(href);
|
|
16190
|
+
}
|
|
16176
16191
|
item.onClick?.();
|
|
16177
16192
|
},
|
|
16178
16193
|
className: cn(
|
|
@@ -43513,6 +43528,7 @@ var init_DetailPanel = __esm({
|
|
|
43513
43528
|
init_Box();
|
|
43514
43529
|
init_Stack();
|
|
43515
43530
|
init_SimpleGrid();
|
|
43531
|
+
init_Menu();
|
|
43516
43532
|
init_LoadingState();
|
|
43517
43533
|
init_ErrorState();
|
|
43518
43534
|
init_EmptyState();
|
|
@@ -43530,6 +43546,7 @@ var init_DetailPanel = __esm({
|
|
|
43530
43546
|
avatar,
|
|
43531
43547
|
sections: propSections,
|
|
43532
43548
|
actions,
|
|
43549
|
+
maxInlineActions,
|
|
43533
43550
|
backAction,
|
|
43534
43551
|
footer,
|
|
43535
43552
|
slideOver = false,
|
|
@@ -43764,7 +43781,7 @@ var init_DetailPanel = __esm({
|
|
|
43764
43781
|
}
|
|
43765
43782
|
) }),
|
|
43766
43783
|
/* @__PURE__ */ jsxs(HStack, { justify: "end", align: "center", gap: "xs", children: [
|
|
43767
|
-
otherActions.map((action, idx) => /* @__PURE__ */ jsx(
|
|
43784
|
+
(maxInlineActions != null ? otherActions.slice(0, maxInlineActions) : otherActions).map((action, idx) => /* @__PURE__ */ jsx(
|
|
43768
43785
|
Button,
|
|
43769
43786
|
{
|
|
43770
43787
|
variant: action.variant || "secondary",
|
|
@@ -43779,6 +43796,22 @@ var init_DetailPanel = __esm({
|
|
|
43779
43796
|
},
|
|
43780
43797
|
idx
|
|
43781
43798
|
)),
|
|
43799
|
+
maxInlineActions != null && otherActions.length > maxInlineActions && /* @__PURE__ */ jsx(
|
|
43800
|
+
Menu,
|
|
43801
|
+
{
|
|
43802
|
+
position: "bottom-end",
|
|
43803
|
+
trigger: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", children: /* @__PURE__ */ jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
|
|
43804
|
+
items: otherActions.slice(maxInlineActions).map((action) => ({
|
|
43805
|
+
// ONE firing path: onClick → handleActionClick (emits with
|
|
43806
|
+
// the {id, row} payload). Passing `event` too would make
|
|
43807
|
+
// Menu emit a second, payload-less copy of the same event.
|
|
43808
|
+
label: action.label,
|
|
43809
|
+
icon: action.icon,
|
|
43810
|
+
variant: action.variant === "danger" ? "danger" : "default",
|
|
43811
|
+
onClick: () => handleActionClick(action, normalizedData)
|
|
43812
|
+
}))
|
|
43813
|
+
}
|
|
43814
|
+
),
|
|
43782
43815
|
/* @__PURE__ */ jsx(
|
|
43783
43816
|
Button,
|
|
43784
43817
|
{
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -2847,6 +2847,10 @@ function useGitHubBranches(owner, repo, enabled = true) {
|
|
|
2847
2847
|
});
|
|
2848
2848
|
}
|
|
2849
2849
|
|
|
2850
|
+
Object.defineProperty(exports, "useNavStack", {
|
|
2851
|
+
enumerable: true,
|
|
2852
|
+
get: function () { return providers.useNavStack; }
|
|
2853
|
+
});
|
|
2850
2854
|
exports.ALMADAR_DND_MIME = ALMADAR_DND_MIME;
|
|
2851
2855
|
exports.DEFAULT_SLOTS = DEFAULT_SLOTS;
|
|
2852
2856
|
exports.I18nProvider = I18nProvider;
|
package/dist/hooks/index.d.cts
CHANGED
|
@@ -4,6 +4,7 @@ import { a as useEventBus } from '../useEventBus-Ckr4wqW3.cjs';
|
|
|
4
4
|
export { u as useEmitEvent, b as useEventListener } from '../useEventBus-Ckr4wqW3.cjs';
|
|
5
5
|
export { E as EventBusContextType } from '../event-bus-types-Bl78kokd.cjs';
|
|
6
6
|
export { D as DEFAULT_SLOTS, S as SlotAnimation, a as SlotChangeCallback, b as SlotContent, c as SlotRenderConfig, U as UISlotManager, u as useUISlotManager } from '../useUISlots-GNwGLlW2.cjs';
|
|
7
|
+
export { a as NavStackApi, u as useNavStack } from '../NavStackContext-BoVV9nWb.cjs';
|
|
7
8
|
import * as React$1 from 'react';
|
|
8
9
|
import React__default from 'react';
|
|
9
10
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { a as useEventBus } from '../useEventBus-CQWyAWpK.js';
|
|
|
4
4
|
export { u as useEmitEvent, b as useEventListener } from '../useEventBus-CQWyAWpK.js';
|
|
5
5
|
export { E as EventBusContextType } from '../event-bus-types-Bl78kokd.js';
|
|
6
6
|
export { D as DEFAULT_SLOTS, S as SlotAnimation, a as SlotChangeCallback, b as SlotContent, c as SlotRenderConfig, U as UISlotManager, u as useUISlotManager } from '../useUISlots-GNwGLlW2.js';
|
|
7
|
+
export { a as NavStackApi, u as useNavStack } from '../NavStackContext-BoVV9nWb.js';
|
|
7
8
|
import * as React$1 from 'react';
|
|
8
9
|
import React__default from 'react';
|
|
9
10
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createContext, useCallback, useState, useEffect, useMemo, useContext, useRef, useSyncExternalStore } from 'react';
|
|
2
2
|
import { createLogger } from '@almadar/logger';
|
|
3
3
|
import { EventBusContext, useTraitScopeChain } from '@almadar/ui/providers';
|
|
4
|
+
export { useNavStack } from '@almadar/ui/providers';
|
|
4
5
|
import { mergeEntityFrame } from '@almadar/core';
|
|
5
6
|
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
6
7
|
|
|
@@ -303,7 +303,8 @@ interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
303
303
|
/** When set, renders a small X button on the right of the badge that
|
|
304
304
|
* invokes this handler — turns the badge into a removable chip.
|
|
305
305
|
* Used by the TagInput molecule and other "list of removable values"
|
|
306
|
-
* surfaces.
|
|
306
|
+
* surfaces.
|
|
307
|
+
* @offByDefault */
|
|
307
308
|
onRemove?: () => void;
|
|
308
309
|
/** Accessible label for the remove button. Defaults to "Remove". */
|
|
309
310
|
removeLabel?: string;
|
|
@@ -303,7 +303,8 @@ interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
303
303
|
/** When set, renders a small X button on the right of the badge that
|
|
304
304
|
* invokes this handler — turns the badge into a removable chip.
|
|
305
305
|
* Used by the TagInput molecule and other "list of removable values"
|
|
306
|
-
* surfaces.
|
|
306
|
+
* surfaces.
|
|
307
|
+
* @offByDefault */
|
|
307
308
|
onRemove?: () => void;
|
|
308
309
|
/** Accessible label for the remove button. Defaults to "Remove". */
|
|
309
310
|
removeLabel?: string;
|
package/dist/providers/index.cjs
CHANGED
|
@@ -21400,17 +21400,27 @@ var init_Breadcrumb = __esm({
|
|
|
21400
21400
|
init_useEventBus();
|
|
21401
21401
|
Breadcrumb = ({
|
|
21402
21402
|
items,
|
|
21403
|
+
fromNavStack = false,
|
|
21404
|
+
itemEvent,
|
|
21403
21405
|
separator = "chevron-right",
|
|
21404
21406
|
maxItems,
|
|
21405
21407
|
className
|
|
21406
21408
|
}) => {
|
|
21407
21409
|
const eventBus = useEventBus();
|
|
21408
21410
|
const { t } = hooks.useTranslate();
|
|
21409
|
-
const
|
|
21410
|
-
|
|
21411
|
+
const navStack = providers.useNavStack();
|
|
21412
|
+
const sourceItems = fromNavStack ? navStack.entries.map((entry, i) => ({
|
|
21413
|
+
label: entry.label,
|
|
21414
|
+
path: entry.href,
|
|
21415
|
+
isCurrent: i === navStack.entries.length - 1,
|
|
21416
|
+
event: itemEvent
|
|
21417
|
+
})) : items ?? [];
|
|
21418
|
+
if (fromNavStack && sourceItems.length === 0) return null;
|
|
21419
|
+
const displayItems = maxItems && sourceItems.length > maxItems ? [
|
|
21420
|
+
...sourceItems.slice(0, 1),
|
|
21411
21421
|
{ label: "...", isCurrent: false },
|
|
21412
|
-
...
|
|
21413
|
-
] :
|
|
21422
|
+
...sourceItems.slice(-maxItems + 1)
|
|
21423
|
+
] : sourceItems;
|
|
21414
21424
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21415
21425
|
"nav",
|
|
21416
21426
|
{
|
|
@@ -21420,7 +21430,7 @@ var init_Breadcrumb = __esm({
|
|
|
21420
21430
|
const isLast = index === displayItems.length - 1;
|
|
21421
21431
|
const isEllipsis = item.label === "...";
|
|
21422
21432
|
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-center gap-2", children: [
|
|
21423
|
-
isEllipsis ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", color: "muted", children: item.label }) : item.href || item.path ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21433
|
+
isEllipsis ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", color: "muted", children: item.label }) : (item.href || item.path) && !item.event && !fromNavStack ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21424
21434
|
"a",
|
|
21425
21435
|
{
|
|
21426
21436
|
href: item.href || item.path,
|
|
@@ -21446,7 +21456,12 @@ var init_Breadcrumb = __esm({
|
|
|
21446
21456
|
{
|
|
21447
21457
|
type: "button",
|
|
21448
21458
|
onClick: () => {
|
|
21449
|
-
|
|
21459
|
+
const href = item.path ?? item.href;
|
|
21460
|
+
if (item.event) {
|
|
21461
|
+
eventBus.emit(`UI:${item.event}`, { label: item.label, href, index });
|
|
21462
|
+
} else if (fromNavStack && href) {
|
|
21463
|
+
navStack.goTo(href);
|
|
21464
|
+
}
|
|
21450
21465
|
item.onClick?.();
|
|
21451
21466
|
},
|
|
21452
21467
|
className: cn(
|
|
@@ -32041,13 +32056,13 @@ var init_MapView = __esm({
|
|
|
32041
32056
|
shadowSize: [41, 41]
|
|
32042
32057
|
});
|
|
32043
32058
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
32044
|
-
const { useEffect:
|
|
32059
|
+
const { useEffect: useEffect65, useRef: useRef64, useCallback: useCallback97, useState: useState95 } = React87__namespace.default;
|
|
32045
32060
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
32046
32061
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
32047
32062
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
32048
32063
|
const map = useMap();
|
|
32049
|
-
const prevRef =
|
|
32050
|
-
|
|
32064
|
+
const prevRef = useRef64({ centerLat, centerLng, zoom });
|
|
32065
|
+
useEffect65(() => {
|
|
32051
32066
|
const prev = prevRef.current;
|
|
32052
32067
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
32053
32068
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -32058,7 +32073,7 @@ var init_MapView = __esm({
|
|
|
32058
32073
|
}
|
|
32059
32074
|
function MapClickHandler({ onMapClick }) {
|
|
32060
32075
|
const map = useMap();
|
|
32061
|
-
|
|
32076
|
+
useEffect65(() => {
|
|
32062
32077
|
if (!onMapClick) return;
|
|
32063
32078
|
const handler = (e) => {
|
|
32064
32079
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -32086,8 +32101,8 @@ var init_MapView = __esm({
|
|
|
32086
32101
|
showAttribution = true
|
|
32087
32102
|
}) {
|
|
32088
32103
|
const eventBus = useEventBus2();
|
|
32089
|
-
const [clickedPosition, setClickedPosition] =
|
|
32090
|
-
const handleMapClick =
|
|
32104
|
+
const [clickedPosition, setClickedPosition] = useState95(null);
|
|
32105
|
+
const handleMapClick = useCallback97((lat, lng) => {
|
|
32091
32106
|
if (showClickedPin) {
|
|
32092
32107
|
setClickedPosition({ lat, lng });
|
|
32093
32108
|
}
|
|
@@ -32096,7 +32111,7 @@ var init_MapView = __esm({
|
|
|
32096
32111
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
32097
32112
|
}
|
|
32098
32113
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
32099
|
-
const handleMarkerClick =
|
|
32114
|
+
const handleMarkerClick = useCallback97((marker) => {
|
|
32100
32115
|
onMarkerClick?.(marker);
|
|
32101
32116
|
if (markerClickEvent) {
|
|
32102
32117
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -42328,6 +42343,7 @@ var init_DetailPanel = __esm({
|
|
|
42328
42343
|
init_Box();
|
|
42329
42344
|
init_Stack();
|
|
42330
42345
|
init_SimpleGrid();
|
|
42346
|
+
init_Menu();
|
|
42331
42347
|
init_LoadingState();
|
|
42332
42348
|
init_ErrorState();
|
|
42333
42349
|
init_EmptyState();
|
|
@@ -42345,6 +42361,7 @@ var init_DetailPanel = __esm({
|
|
|
42345
42361
|
avatar,
|
|
42346
42362
|
sections: propSections,
|
|
42347
42363
|
actions,
|
|
42364
|
+
maxInlineActions,
|
|
42348
42365
|
backAction,
|
|
42349
42366
|
footer,
|
|
42350
42367
|
slideOver = false,
|
|
@@ -42579,7 +42596,7 @@ var init_DetailPanel = __esm({
|
|
|
42579
42596
|
}
|
|
42580
42597
|
) }),
|
|
42581
42598
|
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { justify: "end", align: "center", gap: "xs", children: [
|
|
42582
|
-
otherActions.map((action, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
42599
|
+
(maxInlineActions != null ? otherActions.slice(0, maxInlineActions) : otherActions).map((action, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
42583
42600
|
Button,
|
|
42584
42601
|
{
|
|
42585
42602
|
variant: action.variant || "secondary",
|
|
@@ -42594,6 +42611,22 @@ var init_DetailPanel = __esm({
|
|
|
42594
42611
|
},
|
|
42595
42612
|
idx
|
|
42596
42613
|
)),
|
|
42614
|
+
maxInlineActions != null && otherActions.length > maxInlineActions && /* @__PURE__ */ jsxRuntime.jsx(
|
|
42615
|
+
Menu,
|
|
42616
|
+
{
|
|
42617
|
+
position: "bottom-end",
|
|
42618
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
|
|
42619
|
+
items: otherActions.slice(maxInlineActions).map((action) => ({
|
|
42620
|
+
// ONE firing path: onClick → handleActionClick (emits with
|
|
42621
|
+
// the {id, row} payload). Passing `event` too would make
|
|
42622
|
+
// Menu emit a second, payload-less copy of the same event.
|
|
42623
|
+
label: action.label,
|
|
42624
|
+
icon: action.icon,
|
|
42625
|
+
variant: action.variant === "danger" ? "danger" : "default",
|
|
42626
|
+
onClick: () => handleActionClick(action, normalizedData)
|
|
42627
|
+
}))
|
|
42628
|
+
}
|
|
42629
|
+
),
|
|
42597
42630
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
42598
42631
|
Button,
|
|
42599
42632
|
{
|
|
@@ -51218,12 +51251,18 @@ function ServerBridgeProvider({
|
|
|
51218
51251
|
} else if (effectType === "navigate") {
|
|
51219
51252
|
const route = effect[1];
|
|
51220
51253
|
const rawParams = effect[2];
|
|
51254
|
+
const rawOptions = effect[3];
|
|
51255
|
+
const optionsObj = rawOptions !== null && rawOptions !== void 0 && typeof rawOptions === "object" && !Array.isArray(rawOptions) ? rawOptions : void 0;
|
|
51256
|
+
const crumb = typeof optionsObj?.crumb === "string" ? optionsObj.crumb : void 0;
|
|
51221
51257
|
effects.push({
|
|
51222
51258
|
type: "navigate",
|
|
51223
51259
|
route,
|
|
51224
51260
|
params: rawParams !== null && rawParams !== void 0 && typeof rawParams === "object" && !Array.isArray(rawParams) ? rawParams : void 0,
|
|
51261
|
+
crumb,
|
|
51225
51262
|
traitName
|
|
51226
51263
|
});
|
|
51264
|
+
} else if (effectType === "navigate-back") {
|
|
51265
|
+
effects.push({ type: "navigate-back", traitName });
|
|
51227
51266
|
} else if (effectType === "notify") {
|
|
51228
51267
|
const message = effect[1];
|
|
51229
51268
|
effects.push({ type: "notify", message: typeof message === "string" ? message : void 0, traitName });
|
|
@@ -51488,6 +51527,170 @@ function GameAudioProvider2({
|
|
|
51488
51527
|
return /* @__PURE__ */ jsxRuntime.jsx(GameAudioContext2.Provider, { value, children });
|
|
51489
51528
|
}
|
|
51490
51529
|
GameAudioProvider2.displayName = "GameAudioProvider";
|
|
51530
|
+
function derivePageLabel(name) {
|
|
51531
|
+
const stripped = name.endsWith("Page") && name.length > 4 ? name.slice(0, -4) : name;
|
|
51532
|
+
return stripped.replace(/([a-z0-9])([A-Z])/g, "$1 $2");
|
|
51533
|
+
}
|
|
51534
|
+
function normalizePath(p) {
|
|
51535
|
+
let normalized = p.trim();
|
|
51536
|
+
if (!normalized.startsWith("/")) normalized = "/" + normalized;
|
|
51537
|
+
if (normalized.length > 1 && normalized.endsWith("/")) {
|
|
51538
|
+
normalized = normalized.slice(0, -1);
|
|
51539
|
+
}
|
|
51540
|
+
return normalized;
|
|
51541
|
+
}
|
|
51542
|
+
function matchNavPage(pages, path) {
|
|
51543
|
+
const hit = providers.matchPathAmong(pages, path, (p) => p.path);
|
|
51544
|
+
return hit ? hit.candidate : null;
|
|
51545
|
+
}
|
|
51546
|
+
function seedAncestors(pages, path) {
|
|
51547
|
+
const segments = normalizePath(path).split("/").filter(Boolean);
|
|
51548
|
+
const ancestors = [];
|
|
51549
|
+
for (let depth = 1; depth < segments.length; depth++) {
|
|
51550
|
+
const prefix = "/" + segments.slice(0, depth).join("/");
|
|
51551
|
+
const page = matchNavPage(pages, prefix);
|
|
51552
|
+
if (page) {
|
|
51553
|
+
ancestors.push({ href: prefix, label: derivePageLabel(page.name) });
|
|
51554
|
+
}
|
|
51555
|
+
}
|
|
51556
|
+
return ancestors;
|
|
51557
|
+
}
|
|
51558
|
+
function syncNavStack(state, pages, path, pending) {
|
|
51559
|
+
const normalized = normalizePath(path);
|
|
51560
|
+
const page = matchNavPage(pages, normalized);
|
|
51561
|
+
if (!page) return { state, orbital: null };
|
|
51562
|
+
const label = pending && normalizePath(pending.href) === normalized ? pending.crumb : derivePageLabel(page.name);
|
|
51563
|
+
const prior = state[page.orbital];
|
|
51564
|
+
const stack = prior && prior.length > 0 ? [...prior] : seedAncestors(pages, normalized);
|
|
51565
|
+
const existing = stack.findIndex((e) => e.href === normalized);
|
|
51566
|
+
if (existing >= 0) {
|
|
51567
|
+
stack.length = existing + 1;
|
|
51568
|
+
if (pending && normalizePath(pending.href) === normalized) {
|
|
51569
|
+
stack[existing] = { href: normalized, label };
|
|
51570
|
+
}
|
|
51571
|
+
} else {
|
|
51572
|
+
stack.push({ href: normalized, label });
|
|
51573
|
+
}
|
|
51574
|
+
return { state: { ...state, [page.orbital]: stack }, orbital: page.orbital };
|
|
51575
|
+
}
|
|
51576
|
+
function previousEntry(state, pages, path) {
|
|
51577
|
+
const page = matchNavPage(pages, normalizePath(path));
|
|
51578
|
+
if (!page) return null;
|
|
51579
|
+
const stack = state[page.orbital] ?? [];
|
|
51580
|
+
return stack.length >= 2 ? stack[stack.length - 2] : null;
|
|
51581
|
+
}
|
|
51582
|
+
function entriesFor(state, pages, path) {
|
|
51583
|
+
const page = matchNavPage(pages, normalizePath(path));
|
|
51584
|
+
if (!page) return [];
|
|
51585
|
+
return state[page.orbital] ?? [];
|
|
51586
|
+
}
|
|
51587
|
+
var INERT_API = {
|
|
51588
|
+
entries: [],
|
|
51589
|
+
canGoBack: false,
|
|
51590
|
+
beginNavigate: () => void 0,
|
|
51591
|
+
back: () => void 0,
|
|
51592
|
+
goTo: () => void 0
|
|
51593
|
+
};
|
|
51594
|
+
var NavStackContext = React87.createContext(INERT_API);
|
|
51595
|
+
function useNavStack2() {
|
|
51596
|
+
return React87.useContext(NavStackContext);
|
|
51597
|
+
}
|
|
51598
|
+
function loadStored(storageKey) {
|
|
51599
|
+
if (!storageKey) return {};
|
|
51600
|
+
try {
|
|
51601
|
+
const raw = window.sessionStorage.getItem(storageKey);
|
|
51602
|
+
if (!raw) return {};
|
|
51603
|
+
const parsed = JSON.parse(raw);
|
|
51604
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
51605
|
+
return parsed;
|
|
51606
|
+
}
|
|
51607
|
+
return {};
|
|
51608
|
+
} catch {
|
|
51609
|
+
return {};
|
|
51610
|
+
}
|
|
51611
|
+
}
|
|
51612
|
+
function persistStored(storageKey, state) {
|
|
51613
|
+
if (!storageKey) return;
|
|
51614
|
+
try {
|
|
51615
|
+
window.sessionStorage.setItem(storageKey, JSON.stringify(state));
|
|
51616
|
+
} catch {
|
|
51617
|
+
}
|
|
51618
|
+
}
|
|
51619
|
+
var NavStackProvider = ({
|
|
51620
|
+
pages,
|
|
51621
|
+
currentPath,
|
|
51622
|
+
navigate,
|
|
51623
|
+
storageKey,
|
|
51624
|
+
children
|
|
51625
|
+
}) => {
|
|
51626
|
+
const [state, setState] = React87.useState(() => loadStored(storageKey));
|
|
51627
|
+
const pendingCrumbRef = React87.useRef(null);
|
|
51628
|
+
const stateRef = React87.useRef(state);
|
|
51629
|
+
stateRef.current = state;
|
|
51630
|
+
React87.useEffect(() => {
|
|
51631
|
+
const pending = pendingCrumbRef.current;
|
|
51632
|
+
pendingCrumbRef.current = null;
|
|
51633
|
+
setState((prev) => {
|
|
51634
|
+
const next = syncNavStack(prev, pages, currentPath, pending);
|
|
51635
|
+
if (next.state !== prev) persistStored(storageKey, next.state);
|
|
51636
|
+
return next.state;
|
|
51637
|
+
});
|
|
51638
|
+
}, [currentPath, pages, storageKey]);
|
|
51639
|
+
const beginNavigate = React87.useCallback((href, crumb) => {
|
|
51640
|
+
pendingCrumbRef.current = crumb !== void 0 && crumb !== "" ? { href, crumb } : null;
|
|
51641
|
+
}, []);
|
|
51642
|
+
const back = React87.useCallback(() => {
|
|
51643
|
+
const prev = previousEntry(stateRef.current, pages, currentPath);
|
|
51644
|
+
if (prev) navigate(prev.href);
|
|
51645
|
+
}, [pages, currentPath, navigate]);
|
|
51646
|
+
const goTo = React87.useCallback(
|
|
51647
|
+
(href) => {
|
|
51648
|
+
navigate(href);
|
|
51649
|
+
},
|
|
51650
|
+
[navigate]
|
|
51651
|
+
);
|
|
51652
|
+
const entries = React87.useMemo(
|
|
51653
|
+
() => entriesFor(state, pages, currentPath),
|
|
51654
|
+
[state, pages, currentPath]
|
|
51655
|
+
);
|
|
51656
|
+
const api = React87.useMemo(
|
|
51657
|
+
() => ({
|
|
51658
|
+
entries,
|
|
51659
|
+
canGoBack: previousEntry(state, pages, currentPath) !== null,
|
|
51660
|
+
beginNavigate,
|
|
51661
|
+
back,
|
|
51662
|
+
goTo
|
|
51663
|
+
}),
|
|
51664
|
+
[entries, state, pages, currentPath, beginNavigate, back, goTo]
|
|
51665
|
+
);
|
|
51666
|
+
return /* @__PURE__ */ jsxRuntime.jsx(NavStackContext.Provider, { value: api, children });
|
|
51667
|
+
};
|
|
51668
|
+
NavStackProvider.displayName = "NavStackProvider";
|
|
51669
|
+
var NavStackRouterBridge = ({
|
|
51670
|
+
pages,
|
|
51671
|
+
storageKey = "almadar:navstack",
|
|
51672
|
+
children
|
|
51673
|
+
}) => {
|
|
51674
|
+
const location = reactRouterDom.useLocation();
|
|
51675
|
+
const routerNavigate = reactRouterDom.useNavigate();
|
|
51676
|
+
const navigate = React87.useCallback(
|
|
51677
|
+
(path) => {
|
|
51678
|
+
routerNavigate(path);
|
|
51679
|
+
},
|
|
51680
|
+
[routerNavigate]
|
|
51681
|
+
);
|
|
51682
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
51683
|
+
NavStackProvider,
|
|
51684
|
+
{
|
|
51685
|
+
pages,
|
|
51686
|
+
currentPath: location.pathname,
|
|
51687
|
+
navigate,
|
|
51688
|
+
storageKey,
|
|
51689
|
+
children
|
|
51690
|
+
}
|
|
51691
|
+
);
|
|
51692
|
+
};
|
|
51693
|
+
NavStackRouterBridge.displayName = "NavStackRouterBridge";
|
|
51491
51694
|
|
|
51492
51695
|
Object.defineProperty(exports, "ANONYMOUS_USER", {
|
|
51493
51696
|
enumerable: true,
|
|
@@ -51509,6 +51712,8 @@ exports.EventBusContext = EventBusContext2;
|
|
|
51509
51712
|
exports.EventBusProvider = EventBusProvider;
|
|
51510
51713
|
exports.GameAudioContext = GameAudioContext2;
|
|
51511
51714
|
exports.GameAudioProvider = GameAudioProvider2;
|
|
51715
|
+
exports.NavStackProvider = NavStackProvider;
|
|
51716
|
+
exports.NavStackRouterBridge = NavStackRouterBridge;
|
|
51512
51717
|
exports.NavigationProvider = NavigationProvider2;
|
|
51513
51718
|
exports.OfflineModeProvider = OfflineModeProvider;
|
|
51514
51719
|
exports.OrbitalProvider = OrbitalProvider;
|
|
@@ -51541,6 +51746,7 @@ exports.useGameAudioContextOptional = useGameAudioContextOptional2;
|
|
|
51541
51746
|
exports.useHasPermission = useHasPermission;
|
|
51542
51747
|
exports.useHasRole = useHasRole;
|
|
51543
51748
|
exports.useInitPayload = useInitPayload2;
|
|
51749
|
+
exports.useNavStack = useNavStack2;
|
|
51544
51750
|
exports.useNavigateTo = useNavigateTo2;
|
|
51545
51751
|
exports.useNavigation = useNavigation2;
|
|
51546
51752
|
exports.useNavigationId = useNavigationId2;
|
|
@@ -3,11 +3,12 @@ import { EntityRow, SExpr } from '@almadar/core';
|
|
|
3
3
|
export { ANONYMOUS_USER } from '@almadar/core';
|
|
4
4
|
import { U as UIThemeDefinition, j as UserData } from '../UserContext-g_LcDiGN.cjs';
|
|
5
5
|
export { a as CurrentPagePathContext, b as CurrentPagePathProvider, c as CurrentPagePathProviderProps, d as DesignThemeProvider, O as OrbitalThemeProvider, e as OrbitalThemeProviderProps, h as UserContext, i as UserContextValue, k as UserProvider, l as UserProviderProps, u as useCurrentPagePath, m as useDesignTheme, n as useHasPermission, o as useHasRole, q as useUser, r as useUserForEvaluation } from '../UserContext-g_LcDiGN.cjs';
|
|
6
|
-
export { E as EntityBindingContext, a as EntityBindingSource, b as EntitySchemaContextValue, c as EntitySchemaProvider, d as EntitySchemaProviderProps, S as SendEventResult, e as ServerBridgeContextValue, f as ServerBridgeProvider, g as ServerBridgeProviderProps, h as ServerBridgeTransport, i as ServerClientEffect, j as ServerResponseMeta, T as TraitContext, k as TraitContextValue, l as TraitInstance, m as TraitProvider, n as TraitProviderProps, u as useEntityBindingSnapshot, o as useEntitySchema, p as useEntitySchemaOptional, q as useServerBridge, r as useTrait, s as useTraitContext } from '../EntityBindingContext-
|
|
6
|
+
export { E as EntityBindingContext, a as EntityBindingSource, b as EntitySchemaContextValue, c as EntitySchemaProvider, d as EntitySchemaProviderProps, S as SendEventResult, e as ServerBridgeContextValue, f as ServerBridgeProvider, g as ServerBridgeProviderProps, h as ServerBridgeTransport, i as ServerClientEffect, j as ServerResponseMeta, T as TraitContext, k as TraitContextValue, l as TraitInstance, m as TraitProvider, n as TraitProviderProps, u as useEntityBindingSnapshot, o as useEntitySchema, p as useEntitySchemaOptional, q as useServerBridge, r as useTrait, s as useTraitContext } from '../EntityBindingContext-BfZGeDfX.cjs';
|
|
7
7
|
import { U as UseOfflineExecutorResult, a as UseOfflineExecutorOptions } from '../offline-executor-Qz4b6GpF.cjs';
|
|
8
8
|
export { N as NavigationContextValue, b as NavigationProvider, c as NavigationProviderProps, d as NavigationState, e as comparePathSpecificity, f as extractRouteParams, g as findPageByName, h as findPageByPath, i as getAllPages, j as getDefaultPage, m as matchPath, k as matchPathAmong, p as pathMatches, u as useActivePage, l as useInitPayload, n as useNavigateTo, o as useNavigation, q as useNavigationId, r as useNavigationState } from '../offline-executor-Qz4b6GpF.cjs';
|
|
9
9
|
import { E as EventBusContextType } from '../event-bus-types-Bl78kokd.cjs';
|
|
10
10
|
export { G as GameAudioContext, a as GameAudioContextValue, b as GameAudioProvider, c as GameAudioProviderProps, u as useGameAudioContext, d as useGameAudioContextOptional } from '../GameAudioProvider-CQAdPreB.cjs';
|
|
11
|
+
export { N as NavPageDecl, a as NavStackApi, b as NavStackProvider, c as NavStackProviderProps, d as NavStackRouterBridge, e as NavStackRouterBridgeProps, u as useNavStack } from '../NavStackContext-BoVV9nWb.cjs';
|
|
11
12
|
import '@almadar/core/patterns';
|
|
12
13
|
import '../types-B3nHgnMG.cjs';
|
|
13
14
|
|
|
@@ -3,11 +3,12 @@ import { EntityRow, SExpr } from '@almadar/core';
|
|
|
3
3
|
export { ANONYMOUS_USER } from '@almadar/core';
|
|
4
4
|
import { U as UIThemeDefinition, j as UserData } from '../UserContext-g_LcDiGN.js';
|
|
5
5
|
export { a as CurrentPagePathContext, b as CurrentPagePathProvider, c as CurrentPagePathProviderProps, d as DesignThemeProvider, O as OrbitalThemeProvider, e as OrbitalThemeProviderProps, h as UserContext, i as UserContextValue, k as UserProvider, l as UserProviderProps, u as useCurrentPagePath, m as useDesignTheme, n as useHasPermission, o as useHasRole, q as useUser, r as useUserForEvaluation } from '../UserContext-g_LcDiGN.js';
|
|
6
|
-
export { E as EntityBindingContext, a as EntityBindingSource, b as EntitySchemaContextValue, c as EntitySchemaProvider, d as EntitySchemaProviderProps, S as SendEventResult, e as ServerBridgeContextValue, f as ServerBridgeProvider, g as ServerBridgeProviderProps, h as ServerBridgeTransport, i as ServerClientEffect, j as ServerResponseMeta, T as TraitContext, k as TraitContextValue, l as TraitInstance, m as TraitProvider, n as TraitProviderProps, u as useEntityBindingSnapshot, o as useEntitySchema, p as useEntitySchemaOptional, q as useServerBridge, r as useTrait, s as useTraitContext } from '../EntityBindingContext-
|
|
6
|
+
export { E as EntityBindingContext, a as EntityBindingSource, b as EntitySchemaContextValue, c as EntitySchemaProvider, d as EntitySchemaProviderProps, S as SendEventResult, e as ServerBridgeContextValue, f as ServerBridgeProvider, g as ServerBridgeProviderProps, h as ServerBridgeTransport, i as ServerClientEffect, j as ServerResponseMeta, T as TraitContext, k as TraitContextValue, l as TraitInstance, m as TraitProvider, n as TraitProviderProps, u as useEntityBindingSnapshot, o as useEntitySchema, p as useEntitySchemaOptional, q as useServerBridge, r as useTrait, s as useTraitContext } from '../EntityBindingContext-BfZGeDfX.js';
|
|
7
7
|
import { U as UseOfflineExecutorResult, a as UseOfflineExecutorOptions } from '../offline-executor-Qz4b6GpF.js';
|
|
8
8
|
export { N as NavigationContextValue, b as NavigationProvider, c as NavigationProviderProps, d as NavigationState, e as comparePathSpecificity, f as extractRouteParams, g as findPageByName, h as findPageByPath, i as getAllPages, j as getDefaultPage, m as matchPath, k as matchPathAmong, p as pathMatches, u as useActivePage, l as useInitPayload, n as useNavigateTo, o as useNavigation, q as useNavigationId, r as useNavigationState } from '../offline-executor-Qz4b6GpF.js';
|
|
9
9
|
import { E as EventBusContextType } from '../event-bus-types-Bl78kokd.js';
|
|
10
10
|
export { G as GameAudioContext, a as GameAudioContextValue, b as GameAudioProvider, c as GameAudioProviderProps, u as useGameAudioContext, d as useGameAudioContextOptional } from '../GameAudioProvider-B48iXwz3.js';
|
|
11
|
+
export { N as NavPageDecl, a as NavStackApi, b as NavStackProvider, c as NavStackProviderProps, d as NavStackRouterBridge, e as NavStackRouterBridgeProps, u as useNavStack } from '../NavStackContext-BoVV9nWb.js';
|
|
11
12
|
import '@almadar/core/patterns';
|
|
12
13
|
import '../types-B3nHgnMG.js';
|
|
13
14
|
|