@cratis/scene.react 4.28.0 → 4.30.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.
Files changed (193) hide show
  1. package/core/CoreToolbar.tsx +37 -6
  2. package/core/coreComponentMetadata.ts +1 -0
  3. package/core/coreComponents.ts +2 -0
  4. package/core/coreDescriptors.ts +13 -0
  5. package/core/corePackage.ts +1 -0
  6. package/dist/cjs/core/CoreToolbar.js +44 -4
  7. package/dist/cjs/core/CoreToolbar.js.map +1 -1
  8. package/dist/cjs/core/coreComponentMetadata.js +6 -0
  9. package/dist/cjs/core/coreComponentMetadata.js.map +1 -1
  10. package/dist/cjs/core/coreComponents.js +3 -1
  11. package/dist/cjs/core/coreComponents.js.map +1 -1
  12. package/dist/cjs/core/coreDescriptors.js +27 -0
  13. package/dist/cjs/core/coreDescriptors.js.map +1 -1
  14. package/dist/cjs/core/corePackage.js +2 -1
  15. package/dist/cjs/core/corePackage.js.map +1 -1
  16. package/dist/cjs/index.js +36 -0
  17. package/dist/cjs/index.js.map +1 -1
  18. package/dist/cjs/navigation/SceneNavigationContext.js.map +1 -1
  19. package/dist/cjs/navigation/SceneNavigationHost.js +34 -18
  20. package/dist/cjs/navigation/SceneNavigationHost.js.map +1 -1
  21. package/dist/cjs/navigation/region/NavigationRegionClassNames.js +21 -0
  22. package/dist/cjs/navigation/region/NavigationRegionClassNames.js.map +1 -0
  23. package/dist/cjs/navigation/region/NavigationRegionView.js +283 -0
  24. package/dist/cjs/navigation/region/NavigationRegionView.js.map +1 -0
  25. package/dist/cjs/navigation/region/SceneNavigationModelContext.js +22 -0
  26. package/dist/cjs/navigation/region/SceneNavigationModelContext.js.map +1 -0
  27. package/dist/cjs/navigation/region/currentModuleOf.js +15 -0
  28. package/dist/cjs/navigation/region/currentModuleOf.js.map +1 -0
  29. package/dist/cjs/navigation/region/navigationDestinations.js +46 -0
  30. package/dist/cjs/navigation/region/navigationDestinations.js.map +1 -0
  31. package/dist/cjs/navigation/region/navigationItemActive.js +31 -0
  32. package/dist/cjs/navigation/region/navigationItemActive.js.map +1 -0
  33. package/dist/cjs/navigation/region/navigationItemDestination.js +34 -0
  34. package/dist/cjs/navigation/region/navigationItemDestination.js.map +1 -0
  35. package/dist/cjs/navigation/useSceneHistoryNavigation.js +3 -1
  36. package/dist/cjs/navigation/useSceneHistoryNavigation.js.map +1 -1
  37. package/dist/cjs/slices/CoreSliceDialog.js +21 -0
  38. package/dist/cjs/slices/CoreSliceDialog.js.map +1 -0
  39. package/dist/cjs/slices/SliceCommandFieldsContext.js +22 -0
  40. package/dist/cjs/slices/SliceCommandFieldsContext.js.map +1 -0
  41. package/dist/cjs/slices/SliceDialogView.js +254 -0
  42. package/dist/cjs/slices/SliceDialogView.js.map +1 -0
  43. package/dist/cjs/slices/SliceInvokerContext.js +40 -0
  44. package/dist/cjs/slices/SliceInvokerContext.js.map +1 -0
  45. package/dist/cjs/slices/createAnnouncingInvoker.js +27 -0
  46. package/dist/cjs/slices/createAnnouncingInvoker.js.map +1 -0
  47. package/dist/cjs/slices/createDryRunInvoker.js +38 -0
  48. package/dist/cjs/slices/createDryRunInvoker.js.map +1 -0
  49. package/dist/cjs/slices/sliceDialogDestination.js +41 -0
  50. package/dist/cjs/slices/sliceDialogDestination.js.map +1 -0
  51. package/dist/esm/core/CoreToolbar.d.ts.map +1 -1
  52. package/dist/esm/core/CoreToolbar.js +47 -7
  53. package/dist/esm/core/CoreToolbar.js.map +1 -1
  54. package/dist/esm/core/coreComponentMetadata.d.ts.map +1 -1
  55. package/dist/esm/core/coreComponentMetadata.js +6 -0
  56. package/dist/esm/core/coreComponentMetadata.js.map +1 -1
  57. package/dist/esm/core/coreComponents.d.ts.map +1 -1
  58. package/dist/esm/core/coreComponents.js +3 -1
  59. package/dist/esm/core/coreComponents.js.map +1 -1
  60. package/dist/esm/core/coreDescriptors.d.ts.map +1 -1
  61. package/dist/esm/core/coreDescriptors.js +27 -0
  62. package/dist/esm/core/coreDescriptors.js.map +1 -1
  63. package/dist/esm/core/corePackage.d.ts.map +1 -1
  64. package/dist/esm/core/corePackage.js +2 -1
  65. package/dist/esm/core/corePackage.js.map +1 -1
  66. package/dist/esm/index.d.ts +1 -0
  67. package/dist/esm/index.d.ts.map +1 -1
  68. package/dist/esm/index.js +14 -0
  69. package/dist/esm/index.js.map +1 -1
  70. package/dist/esm/navigation/SceneNavigationContext.d.ts +1 -0
  71. package/dist/esm/navigation/SceneNavigationContext.d.ts.map +1 -1
  72. package/dist/esm/navigation/SceneNavigationContext.js.map +1 -1
  73. package/dist/esm/navigation/SceneNavigationHost.d.ts +5 -1
  74. package/dist/esm/navigation/SceneNavigationHost.d.ts.map +1 -1
  75. package/dist/esm/navigation/SceneNavigationHost.js +35 -19
  76. package/dist/esm/navigation/SceneNavigationHost.js.map +1 -1
  77. package/dist/esm/navigation/SceneNavigationState.d.ts +1 -0
  78. package/dist/esm/navigation/SceneNavigationState.d.ts.map +1 -1
  79. package/dist/esm/navigation/index.d.ts +8 -0
  80. package/dist/esm/navigation/index.d.ts.map +1 -1
  81. package/dist/esm/navigation/index.js +8 -0
  82. package/dist/esm/navigation/index.js.map +1 -1
  83. package/dist/esm/navigation/region/NavigationRegionClassNames.d.ts +12 -0
  84. package/dist/esm/navigation/region/NavigationRegionClassNames.d.ts.map +1 -0
  85. package/dist/esm/navigation/region/NavigationRegionClassNames.js +19 -0
  86. package/dist/esm/navigation/region/NavigationRegionClassNames.js.map +1 -0
  87. package/dist/esm/navigation/region/NavigationRegionView.d.ts +20 -0
  88. package/dist/esm/navigation/region/NavigationRegionView.d.ts.map +1 -0
  89. package/dist/esm/navigation/region/NavigationRegionView.js +281 -0
  90. package/dist/esm/navigation/region/NavigationRegionView.js.map +1 -0
  91. package/dist/esm/navigation/region/SceneNavigationModel.d.ts +9 -0
  92. package/dist/esm/navigation/region/SceneNavigationModel.d.ts.map +1 -0
  93. package/dist/esm/navigation/region/SceneNavigationModel.js +2 -0
  94. package/dist/esm/navigation/region/SceneNavigationModel.js.map +1 -0
  95. package/dist/esm/navigation/region/SceneNavigationModelContext.d.ts +9 -0
  96. package/dist/esm/navigation/region/SceneNavigationModelContext.d.ts.map +1 -0
  97. package/dist/esm/navigation/region/SceneNavigationModelContext.js +19 -0
  98. package/dist/esm/navigation/region/SceneNavigationModelContext.js.map +1 -0
  99. package/dist/esm/navigation/region/currentModuleOf.d.ts +3 -0
  100. package/dist/esm/navigation/region/currentModuleOf.d.ts.map +1 -0
  101. package/dist/esm/navigation/region/currentModuleOf.js +13 -0
  102. package/dist/esm/navigation/region/currentModuleOf.js.map +1 -0
  103. package/dist/esm/navigation/region/navigationDestinations.d.ts +4 -0
  104. package/dist/esm/navigation/region/navigationDestinations.d.ts.map +1 -0
  105. package/dist/esm/navigation/region/navigationDestinations.js +44 -0
  106. package/dist/esm/navigation/region/navigationDestinations.js.map +1 -0
  107. package/dist/esm/navigation/region/navigationItemActive.d.ts +5 -0
  108. package/dist/esm/navigation/region/navigationItemActive.d.ts.map +1 -0
  109. package/dist/esm/navigation/region/navigationItemActive.js +29 -0
  110. package/dist/esm/navigation/region/navigationItemActive.js.map +1 -0
  111. package/dist/esm/navigation/region/navigationItemDestination.d.ts +5 -0
  112. package/dist/esm/navigation/region/navigationItemDestination.d.ts.map +1 -0
  113. package/dist/esm/navigation/region/navigationItemDestination.js +31 -0
  114. package/dist/esm/navigation/region/navigationItemDestination.js.map +1 -0
  115. package/dist/esm/navigation/useSceneHistoryNavigation.d.ts.map +1 -1
  116. package/dist/esm/navigation/useSceneHistoryNavigation.js +3 -1
  117. package/dist/esm/navigation/useSceneHistoryNavigation.js.map +1 -1
  118. package/dist/esm/slices/CoreSliceDialog.d.ts +3 -0
  119. package/dist/esm/slices/CoreSliceDialog.d.ts.map +1 -0
  120. package/dist/esm/slices/CoreSliceDialog.js +19 -0
  121. package/dist/esm/slices/CoreSliceDialog.js.map +1 -0
  122. package/dist/esm/slices/InvocationResult.d.ts +10 -0
  123. package/dist/esm/slices/InvocationResult.d.ts.map +1 -0
  124. package/dist/esm/slices/InvocationResult.js +2 -0
  125. package/dist/esm/slices/InvocationResult.js.map +1 -0
  126. package/dist/esm/slices/InvocationValidationError.d.ts +5 -0
  127. package/dist/esm/slices/InvocationValidationError.d.ts.map +1 -0
  128. package/dist/esm/slices/InvocationValidationError.js +2 -0
  129. package/dist/esm/slices/InvocationValidationError.js.map +1 -0
  130. package/dist/esm/slices/SliceCommandField.d.ts +7 -0
  131. package/dist/esm/slices/SliceCommandField.d.ts.map +1 -0
  132. package/dist/esm/slices/SliceCommandField.js +2 -0
  133. package/dist/esm/slices/SliceCommandField.js.map +1 -0
  134. package/dist/esm/slices/SliceCommandFieldsContext.d.ts +10 -0
  135. package/dist/esm/slices/SliceCommandFieldsContext.d.ts.map +1 -0
  136. package/dist/esm/slices/SliceCommandFieldsContext.js +19 -0
  137. package/dist/esm/slices/SliceCommandFieldsContext.js.map +1 -0
  138. package/dist/esm/slices/SliceDialogView.d.ts +12 -0
  139. package/dist/esm/slices/SliceDialogView.d.ts.map +1 -0
  140. package/dist/esm/slices/SliceDialogView.js +250 -0
  141. package/dist/esm/slices/SliceDialogView.js.map +1 -0
  142. package/dist/esm/slices/SliceInvoker.d.ts +5 -0
  143. package/dist/esm/slices/SliceInvoker.d.ts.map +1 -0
  144. package/dist/esm/slices/SliceInvoker.js +2 -0
  145. package/dist/esm/slices/SliceInvoker.js.map +1 -0
  146. package/dist/esm/slices/SliceInvokerContext.d.ts +11 -0
  147. package/dist/esm/slices/SliceInvokerContext.d.ts.map +1 -0
  148. package/dist/esm/slices/SliceInvokerContext.js +36 -0
  149. package/dist/esm/slices/SliceInvokerContext.js.map +1 -0
  150. package/dist/esm/slices/createAnnouncingInvoker.d.ts +3 -0
  151. package/dist/esm/slices/createAnnouncingInvoker.d.ts.map +1 -0
  152. package/dist/esm/slices/createAnnouncingInvoker.js +25 -0
  153. package/dist/esm/slices/createAnnouncingInvoker.js.map +1 -0
  154. package/dist/esm/slices/createDryRunInvoker.d.ts +15 -0
  155. package/dist/esm/slices/createDryRunInvoker.d.ts.map +1 -0
  156. package/dist/esm/slices/createDryRunInvoker.js +36 -0
  157. package/dist/esm/slices/createDryRunInvoker.js.map +1 -0
  158. package/dist/esm/slices/index.d.ts +12 -0
  159. package/dist/esm/slices/index.d.ts.map +1 -0
  160. package/dist/esm/slices/index.js +12 -0
  161. package/dist/esm/slices/index.js.map +1 -0
  162. package/dist/esm/slices/sliceDialogDestination.d.ts +10 -0
  163. package/dist/esm/slices/sliceDialogDestination.d.ts.map +1 -0
  164. package/dist/esm/slices/sliceDialogDestination.js +38 -0
  165. package/dist/esm/slices/sliceDialogDestination.js.map +1 -0
  166. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  167. package/index.ts +1 -0
  168. package/navigation/SceneNavigationContext.tsx +3 -0
  169. package/navigation/SceneNavigationHost.tsx +35 -9
  170. package/navigation/SceneNavigationState.ts +3 -0
  171. package/navigation/index.ts +8 -0
  172. package/navigation/region/NavigationRegionClassNames.ts +46 -0
  173. package/navigation/region/NavigationRegionView.tsx +234 -0
  174. package/navigation/region/SceneNavigationModel.ts +29 -0
  175. package/navigation/region/SceneNavigationModelContext.tsx +25 -0
  176. package/navigation/region/currentModuleOf.ts +14 -0
  177. package/navigation/region/navigationDestinations.ts +41 -0
  178. package/navigation/region/navigationItemActive.ts +39 -0
  179. package/navigation/region/navigationItemDestination.ts +29 -0
  180. package/navigation/useSceneHistoryNavigation.ts +2 -1
  181. package/package.json +5 -5
  182. package/slices/CoreSliceDialog.tsx +14 -0
  183. package/slices/InvocationResult.ts +27 -0
  184. package/slices/InvocationValidationError.ts +13 -0
  185. package/slices/SliceCommandField.ts +19 -0
  186. package/slices/SliceCommandFieldsContext.tsx +28 -0
  187. package/slices/SliceDialogView.tsx +176 -0
  188. package/slices/SliceInvoker.ts +19 -0
  189. package/slices/SliceInvokerContext.tsx +47 -0
  190. package/slices/createAnnouncingInvoker.ts +17 -0
  191. package/slices/createDryRunInvoker.ts +43 -0
  192. package/slices/index.ts +14 -0
  193. package/slices/sliceDialogDestination.ts +40 -0
@@ -0,0 +1,281 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { useContext, useMemo, useState, useRef } from 'react';
3
+ import { NavigationRegionKind, parseIconReference } from '@cratis/scene.model';
4
+ import { ApplicationStructureIndex, effectiveNavigation } from '@cratis/scene.engine';
5
+ import { SceneIcon } from '../../icons/SceneIcon.js';
6
+ import { useIconAdapters } from '../../icons/IconAdapterContext.js';
7
+ import { resolveDestination } from '../resolveDestination.js';
8
+ import { SceneNavigationContextInternal } from '../SceneNavigationContext.js';
9
+ import { defaultNavigationRegionClassNames } from './NavigationRegionClassNames.js';
10
+ import { useSceneNavigationModel } from './SceneNavigationModelContext.js';
11
+ import { currentModuleOf } from './currentModuleOf.js';
12
+ import { navigationItemActive } from './navigationItemActive.js';
13
+ import { defaultScreenFor, navigationItemDestination } from './navigationItemDestination.js';
14
+
15
+ function itemKey(path) {
16
+ return path.join('/');
17
+ }
18
+ function containsActive(item, isActive) {
19
+ return isActive(item) || (item.children ?? []).some((child)=>containsActive(child, isActive));
20
+ }
21
+ /**
22
+ * Renders the effective navigation of one region - a topbar or a sidebar - for the application or a module.
23
+ *
24
+ * - **Items** come from `effectiveNavigation`, so inherit/extend/override is already applied; nothing here re-implements
25
+ * it. A topbar is flat; a sidebar nests, collapses, and expands the parents of the active item.
26
+ * - **Active state** follows what the navigation host shows: an item is active (`aria-current`, `data-active`) when the
27
+ * screen it opens is the one in its slot, so items rendering into different slots are active at once.
28
+ * - **Activation** goes through the enclosing navigation host (`navigate`), which renders the target in the item's slot -
29
+ * the `outlet` of the destination; outside a host it announces `cratis.scene.navigate`.
30
+ * - **Authorization**: `isVisible` of the model hides items, it does not disable them.
31
+ * - **Keyboard**: arrows (left/right in a topbar, up/down in a sidebar), Home and End move between items; in a sidebar
32
+ * right expands and left collapses (or goes to the parent).
33
+ *
34
+ * Nothing here draws design chrome: items carry `data-read-only` and `data-origin` for a design layer to style.
35
+ */ function NavigationRegionView({ region, module, application = false, model: modelProp, label, expand = 'active', classNames, renderIcon, renderAdornment, hrefFor, onActivate }) {
36
+ const contextModel = useSceneNavigationModel();
37
+ const model = modelProp ?? contextModel;
38
+ if (!model) throw new Error('NavigationRegionView needs a navigation model: pass `model` or render it inside a SceneNavigationModelProvider.');
39
+ const navigation = useContext(SceneNavigationContextInternal);
40
+ const adapters = useIconAdapters();
41
+ const names = {
42
+ ...defaultNavigationRegionClassNames,
43
+ ...classNames
44
+ };
45
+ const index = useMemo(()=>model.structure instanceof ApplicationStructureIndex ? model.structure : new ApplicationStructureIndex(model.structure), [
46
+ model.structure
47
+ ]);
48
+ const screenFor = model.screenFor ?? defaultScreenFor;
49
+ const sidebar = region === NavigationRegionKind.Sidebar;
50
+ const placement = useMemo(()=>({
51
+ primaryScreen: navigation?.primaryScreen,
52
+ outlets: navigation?.outlets ?? {}
53
+ }), [
54
+ navigation?.outlets,
55
+ navigation?.primaryScreen
56
+ ]);
57
+ const scope = application ? undefined : module ?? currentModuleOf(index, placement.primaryScreen);
58
+ const resolved = useMemo(()=>effectiveNavigation(index, model.navigation, scope, region), [
59
+ index,
60
+ model.navigation,
61
+ scope,
62
+ region
63
+ ]);
64
+ const isActive = (item)=>placement.primaryScreen !== undefined && navigationItemActive(item, {
65
+ primaryScreen: placement.primaryScreen,
66
+ outlets: placement.outlets
67
+ }, screenFor, !sidebar);
68
+ const isVisible = model.isVisible ?? (()=>true);
69
+ const visible = useMemo(()=>{
70
+ const keep = (items)=>items.filter(isVisible).map((item)=>item.children ? {
71
+ ...item,
72
+ children: keep(item.children)
73
+ } : item);
74
+ return keep(resolved.items);
75
+ }, [
76
+ resolved,
77
+ model.isVisible
78
+ ]);
79
+ const activeKey = JSON.stringify([
80
+ placement.primaryScreen,
81
+ placement.outlets,
82
+ scope
83
+ ]);
84
+ const [toggled, setToggled] = useState({
85
+ key: activeKey,
86
+ state: {}
87
+ });
88
+ const overrides = toggled.key === activeKey ? toggled.state : {};
89
+ const [focused, setFocused] = useState();
90
+ const root = useRef(null);
91
+ const isExpanded = (item, key)=>overrides[key] ?? (expand === 'all' || containsActive(item, isActive));
92
+ const toggle = (key, expanded)=>setToggled({
93
+ key: activeKey,
94
+ state: {
95
+ ...overrides,
96
+ [key]: expanded
97
+ }
98
+ });
99
+ const activate = (item)=>{
100
+ const destination = navigationItemDestination(item, screenFor);
101
+ if (destination === undefined) return;
102
+ if (navigation) {
103
+ navigation.navigate(destination);
104
+ } else {
105
+ globalThis.dispatchEvent(new CustomEvent('cratis.scene.navigate', {
106
+ detail: {
107
+ targetScreen: destination.screen ?? '',
108
+ destination,
109
+ item
110
+ }
111
+ }));
112
+ }
113
+ onActivate?.(item, destination);
114
+ };
115
+ const links = ()=>Array.from(root.current?.querySelectorAll('[data-scene-nav-link]') ?? []);
116
+ const focusLink = (element)=>{
117
+ if (!element) return;
118
+ setFocused(element.getAttribute('data-scene-nav-link') ?? undefined);
119
+ element.focus();
120
+ };
121
+ const onKeyDown = (event)=>{
122
+ const all = links();
123
+ const position = all.findIndex((link)=>link === document.activeElement);
124
+ if (position < 0) return;
125
+ const next = sidebar ? 'ArrowDown' : 'ArrowRight';
126
+ const previous = sidebar ? 'ArrowUp' : 'ArrowLeft';
127
+ const current = all[position];
128
+ const key = current.getAttribute('data-scene-nav-link');
129
+ const owner = current.closest('[data-scene-nav-item]');
130
+ const hasChildren = owner?.getAttribute('data-scene-nav-parent') === 'true';
131
+ const expanded = owner?.getAttribute('data-expanded') === 'true';
132
+ let target;
133
+ if (event.key === next) target = all[Math.min(position + 1, all.length - 1)];
134
+ else if (event.key === previous) target = all[Math.max(position - 1, 0)];
135
+ else if (event.key === 'Home') target = all[0];
136
+ else if (event.key === 'End') target = all[all.length - 1];
137
+ else if (sidebar && event.key === 'ArrowRight' && hasChildren) {
138
+ if (!expanded) toggle(key, true);
139
+ else target = all[position + 1];
140
+ } else if (sidebar && event.key === 'ArrowLeft') {
141
+ if (hasChildren && expanded) toggle(key, false);
142
+ else {
143
+ const parent = owner?.parentElement?.closest('[data-scene-nav-item]')?.querySelector(':scope > [data-scene-nav-link]');
144
+ if (parent) target = parent;
145
+ }
146
+ } else return;
147
+ event.preventDefault();
148
+ focusLink(target);
149
+ };
150
+ const tabStop = focused ?? undefined;
151
+ const firstActive = (items, path)=>{
152
+ for (const item of items){
153
+ const key = itemKey([
154
+ ...path,
155
+ item.id
156
+ ]);
157
+ if (isActive(item)) return key;
158
+ const inner = firstActive(item.children ?? [], [
159
+ ...path,
160
+ item.id
161
+ ]);
162
+ if (inner !== undefined && isExpanded(item, key)) return inner;
163
+ }
164
+ return undefined;
165
+ };
166
+ const firstKey = visible.length > 0 ? itemKey([
167
+ visible[0].id
168
+ ]) : undefined;
169
+ const stop = tabStop ?? firstActive(visible, []) ?? firstKey;
170
+ const icon = (item)=>{
171
+ if (item.icon === undefined) return null;
172
+ const drawn = renderIcon ? renderIcon(item.icon) : adapters ? (()=>{
173
+ const reference = parseIconReference(item.icon);
174
+ return reference ? /*#__PURE__*/ jsx(SceneIcon, {
175
+ reference: reference,
176
+ adapters: adapters
177
+ }) : null;
178
+ })() : null;
179
+ return drawn === null ? null : /*#__PURE__*/ jsx("span", {
180
+ className: names.icon,
181
+ "aria-hidden": "true",
182
+ "data-scene-icon": item.icon,
183
+ children: drawn
184
+ });
185
+ };
186
+ const renderItems = (items, path, level)=>items.map((item)=>{
187
+ const key = itemKey([
188
+ ...path,
189
+ item.id
190
+ ]);
191
+ const destination = navigationItemDestination(item, screenFor);
192
+ const active = isActive(item);
193
+ const children = item.children ?? [];
194
+ const parent = sidebar && children.length > 0;
195
+ const expanded = parent && isExpanded(item, key);
196
+ const url = destination ? resolveDestination(destination).url : undefined;
197
+ const href = destination ? hrefFor ? hrefFor(destination, url) : url ? `#/${url}` : undefined : undefined;
198
+ const onClick = (event)=>{
199
+ if (event.metaKey || event.ctrlKey || event.shiftKey || event.button !== 0) return;
200
+ event.preventDefault();
201
+ if (destination) activate(item);
202
+ else if (parent) toggle(key, !expanded);
203
+ };
204
+ const content = /*#__PURE__*/ jsxs(Fragment, {
205
+ children: [
206
+ icon(item),
207
+ /*#__PURE__*/ jsx("span", {
208
+ className: names.label,
209
+ children: item.title
210
+ }),
211
+ renderAdornment?.(item)
212
+ ]
213
+ });
214
+ return /*#__PURE__*/ jsxs("li", {
215
+ className: names.item,
216
+ "data-scene-nav-item": item.id,
217
+ "data-scene-nav-parent": parent ? 'true' : undefined,
218
+ "data-active": active,
219
+ "data-active-descendant": !active && parent && children.some((child)=>containsActive(child, isActive)) ? true : undefined,
220
+ "data-expanded": parent ? expanded : undefined,
221
+ "data-origin": item.origin,
222
+ "data-read-only": item.readOnly,
223
+ "data-slot": item.slot,
224
+ "data-level": level,
225
+ children: [
226
+ destination || parent ? /*#__PURE__*/ jsx("a", {
227
+ className: names.link,
228
+ href: href ?? '#',
229
+ "data-scene-nav-link": key,
230
+ "aria-current": active ? 'page' : undefined,
231
+ "aria-expanded": parent && !destination ? expanded : undefined,
232
+ tabIndex: key === stop ? 0 : -1,
233
+ onClick: onClick,
234
+ onFocus: ()=>setFocused(key),
235
+ children: content
236
+ }) : /*#__PURE__*/ jsx("span", {
237
+ className: names.link,
238
+ "aria-disabled": "true",
239
+ "data-scene-nav-link": key,
240
+ tabIndex: -1,
241
+ children: content
242
+ }),
243
+ parent && /*#__PURE__*/ jsx("button", {
244
+ type: "button",
245
+ className: names.toggle,
246
+ tabIndex: -1,
247
+ "aria-expanded": expanded,
248
+ "aria-controls": `${key}-items`,
249
+ "aria-label": `${expanded ? 'Collapse' : 'Expand'} ${item.title}`,
250
+ onClick: ()=>toggle(key, !expanded)
251
+ }),
252
+ parent && expanded && /*#__PURE__*/ jsx("ul", {
253
+ id: `${key}-items`,
254
+ className: `${names.list} ${names.submenu}`,
255
+ children: renderItems(children, [
256
+ ...path,
257
+ item.id
258
+ ], level + 1)
259
+ })
260
+ ]
261
+ }, item.id);
262
+ });
263
+ return /*#__PURE__*/ jsx("nav", {
264
+ ref: root,
265
+ className: names.root,
266
+ "aria-label": label ?? (sidebar ? 'Sidebar' : 'Topbar'),
267
+ "data-scene-nav-region": region,
268
+ "data-scene-nav-sources": resolved.sources.kind,
269
+ "data-scene-nav-sources-label": resolved.sources.label,
270
+ "data-scene-nav-module": scope,
271
+ "data-scene-nav-mode": resolved.mode,
272
+ onKeyDown: onKeyDown,
273
+ children: /*#__PURE__*/ jsx("ul", {
274
+ className: names.list,
275
+ children: renderItems(visible, [], 0)
276
+ })
277
+ });
278
+ }
279
+
280
+ export { NavigationRegionView };
281
+ //# sourceMappingURL=NavigationRegionView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavigationRegionView.js","sources":["../../../../navigation/region/NavigationRegionView.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { KeyboardEvent, MouseEvent, ReactNode, useContext, useMemo, useRef, useState } from 'react';\nimport { DestinationReference, NavigationRegionKind, parseIconReference } from '@cratis/scene.model';\nimport { ApplicationStructureIndex, EffectiveNavItem, EffectiveNavigationRegion, effectiveNavigation } from '@cratis/scene.engine';\nimport { SceneIcon } from '../../icons/SceneIcon';\nimport { useIconAdapters } from '../../icons/IconAdapterContext';\nimport { resolveDestination } from '../resolveDestination';\nimport { SceneNavigationContextInternal } from '../SceneNavigationContext';\nimport { NavigationRegionClassNames, defaultNavigationRegionClassNames } from './NavigationRegionClassNames';\nimport { SceneNavigationModel } from './SceneNavigationModel';\nimport { useSceneNavigationModel } from './SceneNavigationModelContext';\nimport { currentModuleOf } from './currentModuleOf';\nimport { navigationItemActive } from './navigationItemActive';\nimport { defaultScreenFor, navigationItemDestination } from './navigationItemDestination';\n\nexport interface NavigationRegionViewProps {\n /** Which region to show. */\n region: NavigationRegionKind;\n\n /**\n * The module to show the region of. When absent the region follows the module of the screen on the page, so\n * navigating to another module recomputes the effective items in place; outside every module it is the application's.\n */\n module?: string;\n\n /** Pins the region to the application level, whatever screen is on the page. */\n application?: boolean;\n\n /** What to resolve against; the {@link SceneNavigationModelProvider}'s when absent. */\n model?: SceneNavigationModel;\n\n /**\n * Which sub-items of a sidebar show: only those of the parents of the active item and of items the user expanded\n * (`active`, the default), or all of them (`all`) - a design layer wants the whole hierarchy.\n */\n expand?: 'active' | 'all';\n\n /** The accessible name of the `nav` landmark. */\n label?: string;\n\n /** The class names to put on the nodes. */\n classNames?: Partial<NavigationRegionClassNames>;\n\n /**\n * Draws an item's icon from its qualified reference. By default the icon is drawn through the adapters of the\n * enclosing `IconAdapterProvider`, or not at all without one.\n */\n renderIcon?(icon: string): ReactNode;\n\n /**\n * Content a host adds to an item after its title - Studio design mode draws the lock of an inherited item here; Stage\n * ignores it. The item carries `origin` and `readOnly`.\n */\n renderAdornment?(item: EffectiveNavItem): ReactNode;\n\n /** The href of an item's link, for opening it in a new tab; the hash route of the destination by default. */\n hrefFor?(destination: DestinationReference, url: string | undefined): string | undefined;\n\n /** Called after an item has been activated and the host has navigated. */\n onActivate?(item: EffectiveNavItem, destination: DestinationReference): void;\n}\n\nfunction itemKey(path: string[]): string {\n return path.join('/');\n}\n\nfunction containsActive(item: EffectiveNavItem, isActive: (item: EffectiveNavItem) => boolean): boolean {\n return isActive(item) || (item.children ?? []).some(child => containsActive(child, isActive));\n}\n\n/**\n * Renders the effective navigation of one region - a topbar or a sidebar - for the application or a module.\n *\n * - **Items** come from `effectiveNavigation`, so inherit/extend/override is already applied; nothing here re-implements\n * it. A topbar is flat; a sidebar nests, collapses, and expands the parents of the active item.\n * - **Active state** follows what the navigation host shows: an item is active (`aria-current`, `data-active`) when the\n * screen it opens is the one in its slot, so items rendering into different slots are active at once.\n * - **Activation** goes through the enclosing navigation host (`navigate`), which renders the target in the item's slot -\n * the `outlet` of the destination; outside a host it announces `cratis.scene.navigate`.\n * - **Authorization**: `isVisible` of the model hides items, it does not disable them.\n * - **Keyboard**: arrows (left/right in a topbar, up/down in a sidebar), Home and End move between items; in a sidebar\n * right expands and left collapses (or goes to the parent).\n *\n * Nothing here draws design chrome: items carry `data-read-only` and `data-origin` for a design layer to style.\n */\nexport function NavigationRegionView({ region, module, application = false, model: modelProp, label, expand = 'active', classNames, renderIcon, renderAdornment, hrefFor, onActivate }: NavigationRegionViewProps) {\n const contextModel = useSceneNavigationModel();\n const model = modelProp ?? contextModel;\n if (!model) throw new Error('NavigationRegionView needs a navigation model: pass `model` or render it inside a SceneNavigationModelProvider.');\n\n const navigation = useContext(SceneNavigationContextInternal);\n const adapters = useIconAdapters();\n const names = { ...defaultNavigationRegionClassNames, ...classNames };\n const index = useMemo(() => model.structure instanceof ApplicationStructureIndex ? model.structure : new ApplicationStructureIndex(model.structure), [model.structure]);\n const screenFor = model.screenFor ?? defaultScreenFor;\n\n const sidebar = region === NavigationRegionKind.Sidebar;\n const placement = useMemo(() => ({ primaryScreen: navigation?.primaryScreen, outlets: navigation?.outlets ?? {} }), [navigation?.outlets, navigation?.primaryScreen]);\n const scope = application ? undefined : module ?? currentModuleOf(index, placement.primaryScreen);\n const resolved: EffectiveNavigationRegion = useMemo(() => effectiveNavigation(index, model.navigation, scope, region), [index, model.navigation, scope, region]);\n\n const isActive = (item: EffectiveNavItem) => placement.primaryScreen !== undefined && navigationItemActive(item, { primaryScreen: placement.primaryScreen, outlets: placement.outlets }, screenFor, !sidebar);\n const isVisible = model.isVisible ?? (() => true);\n const visible = useMemo(() => {\n const keep = (items: EffectiveNavItem[]): EffectiveNavItem[] => items.filter(isVisible).map(item => item.children ? { ...item, children: keep(item.children) } : item);\n return keep(resolved.items);\n }, [resolved, model.isVisible]);\n\n const activeKey = JSON.stringify([placement.primaryScreen, placement.outlets, scope]);\n const [toggled, setToggled] = useState<{ key: string; state: Record<string, boolean> }>({ key: activeKey, state: {} });\n const overrides = toggled.key === activeKey ? toggled.state : {};\n const [focused, setFocused] = useState<string>();\n const root = useRef<HTMLElement>(null);\n\n const isExpanded = (item: EffectiveNavItem, key: string) => overrides[key] ?? (expand === 'all' || containsActive(item, isActive));\n const toggle = (key: string, expanded: boolean) => setToggled({ key: activeKey, state: { ...overrides, [key]: expanded } });\n\n const activate = (item: EffectiveNavItem) => {\n const destination = navigationItemDestination(item, screenFor);\n if (destination === undefined) return;\n if (navigation) {\n navigation.navigate(destination);\n } else {\n globalThis.dispatchEvent(new CustomEvent('cratis.scene.navigate', { detail: { targetScreen: destination.screen ?? '', destination, item } }));\n }\n\n onActivate?.(item, destination);\n };\n\n const links = () => Array.from(root.current?.querySelectorAll<HTMLElement>('[data-scene-nav-link]') ?? []);\n const focusLink = (element: HTMLElement | undefined) => {\n if (!element) return;\n setFocused(element.getAttribute('data-scene-nav-link') ?? undefined);\n element.focus();\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n const all = links();\n const position = all.findIndex(link => link === document.activeElement);\n if (position < 0) return;\n const next = sidebar ? 'ArrowDown' : 'ArrowRight';\n const previous = sidebar ? 'ArrowUp' : 'ArrowLeft';\n const current = all[position];\n const key = current.getAttribute('data-scene-nav-link')!;\n const owner = current.closest('[data-scene-nav-item]') as HTMLElement | null;\n const hasChildren = owner?.getAttribute('data-scene-nav-parent') === 'true';\n const expanded = owner?.getAttribute('data-expanded') === 'true';\n\n let target: HTMLElement | undefined;\n if (event.key === next) target = all[Math.min(position + 1, all.length - 1)];\n else if (event.key === previous) target = all[Math.max(position - 1, 0)];\n else if (event.key === 'Home') target = all[0];\n else if (event.key === 'End') target = all[all.length - 1];\n else if (sidebar && event.key === 'ArrowRight' && hasChildren) {\n if (!expanded) toggle(key, true);\n else target = all[position + 1];\n } else if (sidebar && event.key === 'ArrowLeft') {\n if (hasChildren && expanded) toggle(key, false);\n else {\n const parent = owner?.parentElement?.closest('[data-scene-nav-item]')?.querySelector<HTMLElement>(':scope > [data-scene-nav-link]');\n if (parent) target = parent;\n }\n } else return;\n\n event.preventDefault();\n focusLink(target);\n };\n\n const tabStop = focused ?? undefined;\n const firstActive = (items: EffectiveNavItem[], path: string[]): string | undefined => {\n for (const item of items) {\n const key = itemKey([...path, item.id]);\n if (isActive(item)) return key;\n const inner = firstActive(item.children ?? [], [...path, item.id]);\n if (inner !== undefined && isExpanded(item, key)) return inner;\n }\n\n return undefined;\n };\n const firstKey = visible.length > 0 ? itemKey([visible[0].id]) : undefined;\n const stop = tabStop ?? firstActive(visible, []) ?? firstKey;\n\n const icon = (item: EffectiveNavItem) => {\n if (item.icon === undefined) return null;\n const drawn = renderIcon ? renderIcon(item.icon) : adapters ? (() => {\n const reference = parseIconReference(item.icon!);\n return reference ? <SceneIcon reference={reference} adapters={adapters} /> : null;\n })() : null;\n return drawn === null ? null : <span className={names.icon} aria-hidden='true' data-scene-icon={item.icon}>{drawn}</span>;\n };\n\n const renderItems = (items: EffectiveNavItem[], path: string[], level: number): ReactNode => items.map(item => {\n const key = itemKey([...path, item.id]);\n const destination = navigationItemDestination(item, screenFor);\n const active = isActive(item);\n const children = item.children ?? [];\n const parent = sidebar && children.length > 0;\n const expanded = parent && isExpanded(item, key);\n const url = destination ? resolveDestination(destination).url : undefined;\n const href = destination ? (hrefFor ? hrefFor(destination, url) : url ? `#/${url}` : undefined) : undefined;\n const onClick = (event: MouseEvent) => {\n if (event.metaKey || event.ctrlKey || event.shiftKey || event.button !== 0) return;\n event.preventDefault();\n if (destination) activate(item);\n else if (parent) toggle(key, !expanded);\n };\n const content = <>\n {icon(item)}\n <span className={names.label}>{item.title}</span>\n {renderAdornment?.(item)}\n </>;\n\n return <li key={item.id} className={names.item} data-scene-nav-item={item.id} data-scene-nav-parent={parent ? 'true' : undefined}\n data-active={active} data-active-descendant={!active && parent && children.some(child => containsActive(child, isActive)) ? true : undefined} data-expanded={parent ? expanded : undefined} data-origin={item.origin} data-read-only={item.readOnly}\n data-slot={item.slot} data-level={level}>\n {destination || parent\n ? <a className={names.link} href={href ?? '#'} data-scene-nav-link={key} aria-current={active ? 'page' : undefined}\n aria-expanded={parent && !destination ? expanded : undefined} tabIndex={key === stop ? 0 : -1}\n onClick={onClick} onFocus={() => setFocused(key)}>{content}</a>\n : <span className={names.link} aria-disabled='true' data-scene-nav-link={key} tabIndex={-1}>{content}</span>}\n {parent && <button type='button' className={names.toggle} tabIndex={-1} aria-expanded={expanded} aria-controls={`${key}-items`}\n aria-label={`${expanded ? 'Collapse' : 'Expand'} ${item.title}`} onClick={() => toggle(key, !expanded)} />}\n {parent && expanded && <ul id={`${key}-items`} className={`${names.list} ${names.submenu}`}>{renderItems(children, [...path, item.id], level + 1)}</ul>}\n </li>;\n });\n\n return <nav ref={root} className={names.root} aria-label={label ?? (sidebar ? 'Sidebar' : 'Topbar')} data-scene-nav-region={region}\n data-scene-nav-sources={resolved.sources.kind} data-scene-nav-sources-label={resolved.sources.label} data-scene-nav-module={scope}\n data-scene-nav-mode={resolved.mode} onKeyDown={onKeyDown}>\n <ul className={names.list}>{renderItems(visible, [], 0)}</ul>\n </nav>;\n}\n"],"names":["itemKey","path","join","containsActive","item","isActive","children","some","child","NavigationRegionView","region","module","application","model","modelProp","label","expand","classNames","renderIcon","renderAdornment","hrefFor","onActivate","contextModel","useSceneNavigationModel","Error","navigation","useContext","SceneNavigationContextInternal","adapters","useIconAdapters","names","defaultNavigationRegionClassNames","index","useMemo","structure","ApplicationStructureIndex","screenFor","defaultScreenFor","sidebar","NavigationRegionKind","Sidebar","placement","primaryScreen","outlets","scope","undefined","currentModuleOf","resolved","effectiveNavigation","navigationItemActive","isVisible","visible","keep","items","filter","map","activeKey","JSON","stringify","toggled","setToggled","useState","key","state","overrides","focused","setFocused","root","useRef","isExpanded","toggle","expanded","activate","destination","navigationItemDestination","navigate","globalThis","dispatchEvent","CustomEvent","detail","targetScreen","screen","links","Array","from","current","querySelectorAll","focusLink","element","getAttribute","focus","onKeyDown","event","all","position","findIndex","link","document","activeElement","next","previous","owner","closest","hasChildren","target","Math","min","length","max","parent","parentElement","querySelector","preventDefault","tabStop","firstActive","id","inner","firstKey","stop","icon","drawn","reference","parseIconReference","_jsx","SceneIcon","span","className","aria-hidden","data-scene-icon","renderItems","level","active","url","resolveDestination","href","onClick","metaKey","ctrlKey","shiftKey","button","content","_jsxs","_Fragment","title","li","data-scene-nav-item","data-scene-nav-parent","data-active","data-active-descendant","data-expanded","data-origin","origin","data-read-only","readOnly","data-slot","slot","data-level","a","data-scene-nav-link","aria-current","aria-expanded","tabIndex","onFocus","aria-disabled","type","aria-controls","aria-label","ul","list","submenu","nav","ref","data-scene-nav-region","data-scene-nav-sources","sources","kind","data-scene-nav-sources-label","data-scene-nav-module","data-scene-nav-mode","mode"],"mappings":";;;;;;;;;;;;;;AAgEA,SAASA,QAAQC,IAAc,EAAA;IAC3B,OAAOA,IAAAA,CAAKC,IAAI,CAAC,GAAA,CAAA;AACrB;AAEA,SAASC,cAAAA,CAAeC,IAAsB,EAAEC,QAA6C,EAAA;AACzF,IAAA,OAAOA,QAAAA,CAASD,IAAAA,CAAAA,IAAS,CAACA,KAAKE,QAAQ,IAAI,EAAC,EAAGC,IAAI,CAACC,CAAAA,KAAAA,GAASL,eAAeK,KAAAA,EAAOH,QAAAA,CAAAA,CAAAA;AACvF;AAEA;;;;;;;;;;;;;;AAcC,IACM,SAASI,oBAAAA,CAAqB,EAAEC,MAAM,EAAEC,MAAM,EAAEC,WAAAA,GAAc,KAAK,EAAEC,KAAAA,EAAOC,SAAS,EAAEC,KAAK,EAAEC,MAAAA,GAAS,QAAQ,EAAEC,UAAU,EAAEC,UAAU,EAAEC,eAAe,EAAEC,OAAO,EAAEC,UAAU,EAA6B,EAAA;AAC7M,IAAA,MAAMC,YAAAA,GAAeC,uBAAAA,EAAAA;AACrB,IAAA,MAAMV,QAAQC,SAAAA,IAAaQ,YAAAA;AAC3B,IAAA,IAAI,CAACT,KAAAA,EAAO,MAAM,IAAIW,KAAAA,CAAM,iHAAA,CAAA;AAE5B,IAAA,MAAMC,aAAaC,UAAAA,CAAWC,8BAAAA,CAAAA;AAC9B,IAAA,MAAMC,QAAAA,GAAWC,eAAAA,EAAAA;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A;AAAMG,4BAAAA,IAAAA,CAAK+G;AAAG,yBAAA,EAAEe,KAAAA,GAAQ,CAAA;;;AAVnI9H,aAAAA,EAAAA,IAAAA,CAAK+G,EAAE,CAAA;AAY3B,QAAA,CAAA,CAAA;AAEA,IAAA,qBAAOQ,GAAA,CAAC+C,KAAAA,EAAAA;QAAIC,GAAAA,EAAKxG,IAAAA;AAAM2D,QAAAA,SAAAA,EAAWhG,MAAMqC,IAAI;AAAEmG,QAAAA,YAAAA,EAAYvJ,KAAAA,KAAUuB,OAAAA,GAAU,SAAA,GAAY,QAAO,CAAA;QAAIsI,uBAAAA,EAAuBlK,MAAAA;QACxHmK,wBAAAA,EAAwB9H,QAAAA,CAAS+H,OAAO,CAACC,IAAI;QAAEC,8BAAAA,EAA8BjI,QAAAA,CAAS+H,OAAO,CAAC/J,KAAK;QAAEkK,uBAAAA,EAAuBrI,KAAAA;AAC5HsI,QAAAA,qBAAAA,EAAqBnI,SAASoI,IAAI;QAAExF,SAAAA,EAAWA,SAAAA;AAC/C,QAAA,QAAA,gBAAAgC,GAAA,CAAC4C,IAAAA,EAAAA;AAAGzC,YAAAA,SAAAA,EAAWhG,MAAM0I,IAAI;sBAAGvC,WAAAA,CAAY9E,OAAAA,EAAS,EAAE,EAAE,CAAA;;;AAE7D;;"}
@@ -0,0 +1,9 @@
1
+ import { ApplicationStructure, NavigationModel } from '@cratis/scene.model';
2
+ import { ApplicationStructureIndex, EffectiveNavItem } from '@cratis/scene.engine';
3
+ export interface SceneNavigationModel {
4
+ structure: ApplicationStructure | ApplicationStructureIndex;
5
+ navigation: NavigationModel;
6
+ screenFor?(item: EffectiveNavItem): string | undefined;
7
+ isVisible?(item: EffectiveNavItem): boolean;
8
+ }
9
+ //# sourceMappingURL=SceneNavigationModel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SceneNavigationModel.d.ts","sourceRoot":"","sources":["../../../../navigation/region/SceneNavigationModel.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAMnF,MAAM,WAAW,oBAAoB;IAEjC,SAAS,EAAE,oBAAoB,GAAG,yBAAyB,CAAC;IAG5D,UAAU,EAAE,eAAe,CAAC;IAM5B,SAAS,CAAC,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAAC;IAMvD,SAAS,CAAC,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC;CAC/C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=SceneNavigationModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SceneNavigationModel.js","sourceRoot":"","sources":["../../../../navigation/region/SceneNavigationModel.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { SceneNavigationModel } from './SceneNavigationModel';
3
+ export interface SceneNavigationModelProviderProps {
4
+ model: SceneNavigationModel;
5
+ children?: ReactNode;
6
+ }
7
+ export declare function SceneNavigationModelProvider({ model, children }: SceneNavigationModelProviderProps): import("react").JSX.Element;
8
+ export declare function useSceneNavigationModel(): SceneNavigationModel | undefined;
9
+ //# sourceMappingURL=SceneNavigationModelContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SceneNavigationModelContext.d.ts","sourceRoot":"","sources":["../../../../navigation/region/SceneNavigationModelContext.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAA6B,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,MAAM,WAAW,iCAAiC;IAC9C,KAAK,EAAE,oBAAoB,CAAC;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAMD,wBAAgB,4BAA4B,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,iCAAiC,+BAElG;AAGD,wBAAgB,uBAAuB,IAAI,oBAAoB,GAAG,SAAS,CAE1E"}
@@ -0,0 +1,19 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useContext, createContext } from 'react';
3
+
4
+ const Context = /*#__PURE__*/ createContext(undefined);
5
+ /**
6
+ * Supplies the application structure and navigation every navigation region below it renders - the topbar and sidebar
7
+ * components of a shell find what to show here, so a screen document does not carry the application's navigation.
8
+ */ function SceneNavigationModelProvider({ model, children }) {
9
+ return /*#__PURE__*/ jsx(Context.Provider, {
10
+ value: model,
11
+ children: children
12
+ });
13
+ }
14
+ /** The navigation model in scope, or undefined outside a {@link SceneNavigationModelProvider}. */ function useSceneNavigationModel() {
15
+ return useContext(Context);
16
+ }
17
+
18
+ export { SceneNavigationModelProvider, useSceneNavigationModel };
19
+ //# sourceMappingURL=SceneNavigationModelContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SceneNavigationModelContext.js","sources":["../../../../navigation/region/SceneNavigationModelContext.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ReactNode, createContext, useContext } from 'react';\nimport { SceneNavigationModel } from './SceneNavigationModel';\n\nconst Context = createContext<SceneNavigationModel | undefined>(undefined);\n\nexport interface SceneNavigationModelProviderProps {\n model: SceneNavigationModel;\n children?: ReactNode;\n}\n\n/**\n * Supplies the application structure and navigation every navigation region below it renders - the topbar and sidebar\n * components of a shell find what to show here, so a screen document does not carry the application's navigation.\n */\nexport function SceneNavigationModelProvider({ model, children }: SceneNavigationModelProviderProps) {\n return <Context.Provider value={model}>{children}</Context.Provider>;\n}\n\n/** The navigation model in scope, or undefined outside a {@link SceneNavigationModelProvider}. */\nexport function useSceneNavigationModel(): SceneNavigationModel | undefined {\n return useContext(Context);\n}\n"],"names":["Context","createContext","undefined","SceneNavigationModelProvider","model","children","_jsx","Provider","value","useSceneNavigationModel","useContext"],"mappings":";;;AAMA,MAAMA,wBAAUC,aAAAA,CAAgDC,SAAAA,CAAAA;AAOhE;;;AAGC,IACM,SAASC,4BAAAA,CAA6B,EAAEC,KAAK,EAAEC,QAAQ,EAAqC,EAAA;IAC/F,qBAAOC,GAAA,CAACN,QAAQO,QAAQ,EAAA;QAACC,KAAAA,EAAOJ,KAAAA;AAAQC,QAAAA,QAAAA,EAAAA;;AAC5C;AAEA,mGACO,SAASI,uBAAAA,GAAAA;AACZ,IAAA,OAAOC,UAAAA,CAAWV,OAAAA,CAAAA;AACtB;;"}
@@ -0,0 +1,3 @@
1
+ import { ApplicationStructureIndex } from '@cratis/scene.engine';
2
+ export declare function currentModuleOf(index: ApplicationStructureIndex, screen: string | undefined): string | undefined;
3
+ //# sourceMappingURL=currentModuleOf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currentModuleOf.d.ts","sourceRoot":"","sources":["../../../../navigation/region/currentModuleOf.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAMjE,wBAAgB,eAAe,CAAC,KAAK,EAAE,yBAAyB,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAIhH"}
@@ -0,0 +1,13 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ /**
4
+ * The module the screen on the page belongs to: the screen's qualified id starts with its module id, so `sales.orders`
5
+ * is in `sales`. Undefined for a screen outside every module - the application level.
6
+ */ function currentModuleOf(index, screen) {
7
+ if (screen === undefined) return undefined;
8
+ const module = screen.split('.')[0];
9
+ return index.findModule(module) ? module : undefined;
10
+ }
11
+
12
+ export { currentModuleOf };
13
+ //# sourceMappingURL=currentModuleOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currentModuleOf.js","sources":["../../../../navigation/region/currentModuleOf.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ApplicationStructureIndex } from '@cratis/scene.engine';\n\n/**\n * The module the screen on the page belongs to: the screen's qualified id starts with its module id, so `sales.orders`\n * is in `sales`. Undefined for a screen outside every module - the application level.\n */\nexport function currentModuleOf(index: ApplicationStructureIndex, screen: string | undefined): string | undefined {\n if (screen === undefined) return undefined;\n const module = screen.split('.')[0];\n return index.findModule(module) ? module : undefined;\n}\n"],"names":["currentModuleOf","index","screen","undefined","module","split","findModule"],"mappings":"AAAA;AACA;AAIA;;;AAGC,IACM,SAASA,eAAAA,CAAgBC,KAAgC,EAAEC,MAA0B,EAAA;IACxF,IAAIA,MAAAA,KAAWC,WAAW,OAAOA,SAAAA;AACjC,IAAA,MAAMC,SAASF,MAAAA,CAAOG,KAAK,CAAC,GAAA,CAAI,CAAC,CAAA,CAAE;AACnC,IAAA,OAAOJ,KAAAA,CAAMK,UAAU,CAACF,MAAAA,CAAAA,GAAUA,MAAAA,GAASD,SAAAA;AAC/C;;"}
@@ -0,0 +1,4 @@
1
+ import { ApplicationStructure, DestinationReference, NavigationModel } from '@cratis/scene.model';
2
+ import { ApplicationStructureIndex, EffectiveNavItem } from '@cratis/scene.engine';
3
+ export declare function navigationDestinations(structure: ApplicationStructure | ApplicationStructureIndex, navigation: NavigationModel, screenFor?: (item: EffectiveNavItem) => string | undefined): DestinationReference[];
4
+ //# sourceMappingURL=navigationDestinations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigationDestinations.d.ts","sourceRoot":"","sources":["../../../../navigation/region/navigationDestinations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAwB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACxH,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAuB,MAAM,sBAAsB,CAAC;AAYxG,wBAAgB,sBAAsB,CAClC,SAAS,EAAE,oBAAoB,GAAG,yBAAyB,EAC3D,UAAU,EAAE,eAAe,EAC3B,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,MAAM,GAAG,SAAS,GAC3D,oBAAoB,EAAE,CAoBxB"}
@@ -0,0 +1,44 @@
1
+ import { NavigationRegionKind } from '@cratis/scene.model';
2
+ import { ApplicationStructureIndex, effectiveNavigation } from '@cratis/scene.engine';
3
+ import { navigationItemDestination } from './navigationItemDestination.js';
4
+
5
+ // Copyright (c) Cratis. All rights reserved.
6
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
7
+ function flatten(items) {
8
+ return items.flatMap((item)=>[
9
+ item,
10
+ ...flatten(item.children ?? [])
11
+ ]);
12
+ }
13
+ /**
14
+ * Every destination the navigation of the application and of each module can lead to, once each: what a
15
+ * `SceneNavigationHost` is given as `destinations` so deep links to a navigation item resolve, and an item that renders
16
+ * into a nested outlet is placed with the screen that declares the outlet.
17
+ */ function navigationDestinations(structure, navigation, screenFor) {
18
+ const index = structure instanceof ApplicationStructureIndex ? structure : new ApplicationStructureIndex(structure);
19
+ const modules = [
20
+ undefined,
21
+ ...index.structure.modules.map((module)=>module.id)
22
+ ];
23
+ const seen = new Set();
24
+ const destinations = [];
25
+ for (const module of modules){
26
+ for (const region of [
27
+ NavigationRegionKind.Topbar,
28
+ NavigationRegionKind.Sidebar
29
+ ]){
30
+ for (const item of flatten(effectiveNavigation(index, navigation, module, region).items)){
31
+ const destination = navigationItemDestination(item, screenFor);
32
+ if (destination === undefined) continue;
33
+ const key = JSON.stringify(destination);
34
+ if (seen.has(key)) continue;
35
+ seen.add(key);
36
+ destinations.push(destination);
37
+ }
38
+ }
39
+ }
40
+ return destinations;
41
+ }
42
+
43
+ export { navigationDestinations };
44
+ //# sourceMappingURL=navigationDestinations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigationDestinations.js","sources":["../../../../navigation/region/navigationDestinations.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ApplicationStructure, DestinationReference, NavigationRegionKind, NavigationModel } from '@cratis/scene.model';\nimport { ApplicationStructureIndex, EffectiveNavItem, effectiveNavigation } from '@cratis/scene.engine';\nimport { navigationItemDestination } from './navigationItemDestination';\n\nfunction flatten(items: EffectiveNavItem[]): EffectiveNavItem[] {\n return items.flatMap(item => [item, ...flatten(item.children ?? [])]);\n}\n\n/**\n * Every destination the navigation of the application and of each module can lead to, once each: what a\n * `SceneNavigationHost` is given as `destinations` so deep links to a navigation item resolve, and an item that renders\n * into a nested outlet is placed with the screen that declares the outlet.\n */\nexport function navigationDestinations(\n structure: ApplicationStructure | ApplicationStructureIndex,\n navigation: NavigationModel,\n screenFor?: (item: EffectiveNavItem) => string | undefined,\n): DestinationReference[] {\n const index = structure instanceof ApplicationStructureIndex ? structure : new ApplicationStructureIndex(structure);\n const modules = [undefined, ...index.structure.modules.map(module => module.id)];\n const seen = new Set<string>();\n const destinations: DestinationReference[] = [];\n\n for (const module of modules) {\n for (const region of [NavigationRegionKind.Topbar, NavigationRegionKind.Sidebar]) {\n for (const item of flatten(effectiveNavigation(index, navigation, module, region).items)) {\n const destination = navigationItemDestination(item, screenFor);\n if (destination === undefined) continue;\n const key = JSON.stringify(destination);\n if (seen.has(key)) continue;\n seen.add(key);\n destinations.push(destination);\n }\n }\n }\n\n return destinations;\n}\n"],"names":["flatten","items","flatMap","item","children","navigationDestinations","structure","navigation","screenFor","index","ApplicationStructureIndex","modules","undefined","map","module","id","seen","Set","destinations","region","NavigationRegionKind","Topbar","Sidebar","effectiveNavigation","destination","navigationItemDestination","key","JSON","stringify","has","add","push"],"mappings":";;;;AAAA;AACA;AAMA,SAASA,QAAQC,KAAyB,EAAA;AACtC,IAAA,OAAOA,KAAAA,CAAMC,OAAO,CAACC,CAAAA,IAAAA,GAAQ;AAACA,YAAAA,IAAAA;eAASH,OAAAA,CAAQG,IAAAA,CAAKC,QAAQ,IAAI,EAAE;AAAE,SAAA,CAAA;AACxE;AAEA;;;;AAIC,IAC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ContextValue } from '../SceneNavigationContext';
3
+ export type NavigationPlacement = Pick<SceneNavigationContextValue, 'primaryScreen' | 'outlets'>;
4
+ export declare function navigationItemActive(item: EffectiveNavItem, placement: NavigationPlacement, screenFor?: (item: EffectiveNavItem) => string | undefined, matchModule?: boolean): boolean;
5
+ //# sourceMappingURL=navigationItemActive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigationItemActive.d.ts","sourceRoot":"","sources":["../../../../navigation/region/navigationItemActive.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAe,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAGxE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,2BAA2B,EAAE,eAAe,GAAG,SAAS,CAAC,CAAC;AAejG,wBAAgB,oBAAoB,CAChC,IAAI,EAAE,gBAAgB,EACtB,SAAS,EAAE,mBAAmB,EAC9B,SAAS,GAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,MAAM,GAAG,SAA4B,EAC5E,WAAW,UAAQ,GACpB,OAAO,CAUT"}
@@ -0,0 +1,29 @@
1
+ import { primarySlot } from '@cratis/scene.engine';
2
+ import { defaultScreenFor } from './navigationItemDestination.js';
3
+
4
+ // Copyright (c) Cratis. All rights reserved.
5
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
6
+ /**
7
+ * Whether a navigation item is the one the page shows.
8
+ *
9
+ * An item is active when the screen it opens is the one in the slot it renders into: the primary region for the
10
+ * `content` slot, the nested outlet of that name otherwise. So several items can be active at once - each is shown in
11
+ * its own slot - and closing a slot's screen un-highlights its item. With `matchModule` - a topbar - an item that targets
12
+ * a module without a feature is also active while any screen of that module is in its slot.
13
+ *
14
+ * @param item The effective item.
15
+ * @param placement What the host currently shows.
16
+ * @param screenFor Names the screen an item opens; the feature the item resolves to when absent.
17
+ * @param matchModule Whether a module item is active on any screen of the module; a topbar's are, a sidebar's are not.
18
+ */ function navigationItemActive(item, placement, screenFor = defaultScreenFor, matchModule = false) {
19
+ const screen = screenFor(item);
20
+ if (screen === undefined) return false;
21
+ const shown = item.slot === primarySlot ? placement.primaryScreen : placement.outlets[item.slot];
22
+ if (shown === undefined) return false;
23
+ if (shown === screen) return true;
24
+ const target = item.target;
25
+ return matchModule && target !== undefined && target.feature === undefined && shown.startsWith(`${target.module}.`);
26
+ }
27
+
28
+ export { navigationItemActive };
29
+ //# sourceMappingURL=navigationItemActive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigationItemActive.js","sources":["../../../../navigation/region/navigationItemActive.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { EffectiveNavItem, primarySlot } from '@cratis/scene.engine';\nimport { defaultScreenFor } from './navigationItemDestination';\nimport { SceneNavigationContextValue } from '../SceneNavigationContext';\n\n/** Where the navigation host is: the part of {@link SceneNavigationContextValue} that says what is on the page. */\nexport type NavigationPlacement = Pick<SceneNavigationContextValue, 'primaryScreen' | 'outlets'>;\n\n/**\n * Whether a navigation item is the one the page shows.\n *\n * An item is active when the screen it opens is the one in the slot it renders into: the primary region for the\n * `content` slot, the nested outlet of that name otherwise. So several items can be active at once - each is shown in\n * its own slot - and closing a slot's screen un-highlights its item. With `matchModule` - a topbar - an item that targets\n * a module without a feature is also active while any screen of that module is in its slot.\n *\n * @param item The effective item.\n * @param placement What the host currently shows.\n * @param screenFor Names the screen an item opens; the feature the item resolves to when absent.\n * @param matchModule Whether a module item is active on any screen of the module; a topbar's are, a sidebar's are not.\n */\nexport function navigationItemActive(\n item: EffectiveNavItem,\n placement: NavigationPlacement,\n screenFor: (item: EffectiveNavItem) => string | undefined = defaultScreenFor,\n matchModule = false,\n): boolean {\n const screen = screenFor(item);\n if (screen === undefined) return false;\n\n const shown = item.slot === primarySlot ? placement.primaryScreen : placement.outlets[item.slot];\n if (shown === undefined) return false;\n if (shown === screen) return true;\n\n const target = item.target;\n return matchModule && target !== undefined && target.feature === undefined && shown.startsWith(`${target.module}.`);\n}\n"],"names":["navigationItemActive","item","placement","screenFor","defaultScreenFor","matchModule","screen","undefined","shown","slot","primarySlot","primaryScreen","outlets","target","feature","startsWith","module"],"mappings":";;;AAAA;AACA;AASA;;;;;;;;;;;;IAaO,SAASA,oBAAAA,CACZC,IAAsB,EACtBC,SAA8B,EAC9BC,SAAAA,GAA4DC,gBAAgB,EAC5EC,WAAAA,GAAc,KAAK,EAAA;AAEnB,IAAA,MAAMC,SAASH,SAAAA,CAAUF,IAAAA,CAAAA;IACzB,IAAIK,MAAAA,KAAWC,WAAW,OAAO,KAAA;AAEjC,IAAA,MAAMC,KAAAA,GAAQP,IAAAA,CAAKQ,IAAI,KAAKC,WAAAA,GAAcR,SAAAA,CAAUS,aAAa,GAAGT,SAAAA,CAAUU,OAAO,CAACX,IAAAA,CAAKQ,IAAI,CAAC;IAChG,IAAID,KAAAA,KAAUD,WAAW,OAAO,KAAA;IAChC,IAAIC,KAAAA,KAAUF,QAAQ,OAAO,IAAA;IAE7B,MAAMO,MAAAA,GAASZ,KAAKY,MAAM;AAC1B,IAAA,OAAOR,WAAAA,IAAeQ,MAAAA,KAAWN,SAAAA,IAAaM,MAAAA,CAAOC,OAAO,KAAKP,SAAAA,IAAaC,KAAAA,CAAMO,UAAU,CAAC,CAAA,EAAGF,MAAAA,CAAOG,MAAM,CAAC,CAAC,CAAC,CAAA;AACtH;;"}
@@ -0,0 +1,5 @@
1
+ import { DestinationReference } from '@cratis/scene.model';
2
+ import { EffectiveNavItem } from '@cratis/scene.engine';
3
+ export declare function defaultScreenFor(item: EffectiveNavItem): string | undefined;
4
+ export declare function navigationItemDestination(item: EffectiveNavItem, screenFor?: (item: EffectiveNavItem) => string | undefined): DestinationReference | undefined;
5
+ //# sourceMappingURL=navigationItemDestination.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigationItemDestination.d.ts","sourceRoot":"","sources":["../../../../navigation/region/navigationItemDestination.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAe,MAAM,sBAAsB,CAAC;AAGrE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAE3E;AAUD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,gBAAgB,EAAE,SAAS,GAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,MAAM,GAAG,SAA4B,GAAG,oBAAoB,GAAG,SAAS,CAShL"}
@@ -0,0 +1,31 @@
1
+ import { DestinationKind } from '@cratis/scene.model';
2
+ import { primarySlot } from '@cratis/scene.engine';
3
+
4
+ // Copyright (c) Cratis. All rights reserved.
5
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
6
+ /** The screen an item opens by default: the qualified id of the feature it resolves to. */ function defaultScreenFor(item) {
7
+ return item.target?.resolvedFeature;
8
+ }
9
+ /**
10
+ * Where activating a navigation item goes: its stable module/feature identity, the screen it opens, and the slot it
11
+ * renders into as the outlet - the primary `content` slot is the host's primary outlet.
12
+ *
13
+ * @param item The effective item.
14
+ * @param screenFor Names the screen an item opens; {@link defaultScreenFor} when absent.
15
+ * @returns The destination, or undefined when the item leads nowhere.
16
+ */ function navigationItemDestination(item, screenFor = defaultScreenFor) {
17
+ const screen = screenFor(item);
18
+ if (screen === undefined || item.target === undefined) return undefined;
19
+ const resolved = item.target.resolvedFeature;
20
+ const destination = {
21
+ kind: DestinationKind.Outlet,
22
+ module: item.target.module,
23
+ screen
24
+ };
25
+ if (resolved !== undefined && resolved.startsWith(`${item.target.module}.`)) destination.feature = resolved.substring(item.target.module.length + 1);
26
+ if (item.slot !== primarySlot) destination.outlet = item.slot;
27
+ return destination;
28
+ }
29
+
30
+ export { defaultScreenFor, navigationItemDestination };
31
+ //# sourceMappingURL=navigationItemDestination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigationItemDestination.js","sources":["../../../../navigation/region/navigationItemDestination.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DestinationKind, DestinationReference } from '@cratis/scene.model';\nimport { EffectiveNavItem, primarySlot } from '@cratis/scene.engine';\n\n/** The screen an item opens by default: the qualified id of the feature it resolves to. */\nexport function defaultScreenFor(item: EffectiveNavItem): string | undefined {\n return item.target?.resolvedFeature;\n}\n\n/**\n * Where activating a navigation item goes: its stable module/feature identity, the screen it opens, and the slot it\n * renders into as the outlet - the primary `content` slot is the host's primary outlet.\n *\n * @param item The effective item.\n * @param screenFor Names the screen an item opens; {@link defaultScreenFor} when absent.\n * @returns The destination, or undefined when the item leads nowhere.\n */\nexport function navigationItemDestination(item: EffectiveNavItem, screenFor: (item: EffectiveNavItem) => string | undefined = defaultScreenFor): DestinationReference | undefined {\n const screen = screenFor(item);\n if (screen === undefined || item.target === undefined) return undefined;\n\n const resolved = item.target.resolvedFeature;\n const destination: DestinationReference = { kind: DestinationKind.Outlet, module: item.target.module, screen };\n if (resolved !== undefined && resolved.startsWith(`${item.target.module}.`)) destination.feature = resolved.substring(item.target.module.length + 1);\n if (item.slot !== primarySlot) destination.outlet = item.slot;\n return destination;\n}\n"],"names":["defaultScreenFor","item","target","resolvedFeature","navigationItemDestination","screenFor","screen","undefined","resolved","destination","kind","DestinationKind","Outlet","module","startsWith","feature","substring","length","slot","primarySlot","outlet"],"mappings":";;;AAAA;AACA;AAKA,4FACO,SAASA,gBAAAA,CAAiBC,IAAsB,EAAA;IACnD,OAAOA,IAAAA,CAAKC,MAAM,EAAEC,eAAAA;AACxB;AAEA;;;;;;;AAOC,IACM,SAASC,yBAAAA,CAA0BH,IAAsB,EAAEI,YAA4DL,gBAAgB,EAAA;AAC1I,IAAA,MAAMM,SAASD,SAAAA,CAAUJ,IAAAA,CAAAA;AACzB,IAAA,IAAIK,WAAWC,SAAAA,IAAaN,IAAAA,C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AO,GAC1C,2BAA2B,CAmE7B"}
1
+ {"version":3,"file":"useSceneHistoryNavigation.d.ts","sourceRoot":"","sources":["../../../navigation/useSceneHistoryNavigation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAmB,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAK5E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO1C,wBAAgB,yBAAyB,CACrC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,UAAU,EAAE,EACpB,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,YAAY,EAC1B,YAAY,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EACzC,YAAY,GAAE,oBAAoB,EAAO,GAC1C,2BAA2B,CAoE7B"}