@cratis/scene.react 4.16.0 → 4.17.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/core/coreComponents.ts +2 -0
- package/core/coreDescriptors.ts +6 -0
- package/core/corePackage.ts +1 -0
- package/dist/cjs/core/coreComponents.js +3 -1
- package/dist/cjs/core/coreComponents.js.map +1 -1
- package/dist/cjs/core/coreDescriptors.js +16 -0
- package/dist/cjs/core/coreDescriptors.js.map +1 -1
- package/dist/cjs/core/corePackage.js +2 -1
- package/dist/cjs/core/corePackage.js.map +1 -1
- package/dist/cjs/index.js +11 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/navigation/CoreOutlet.js +32 -0
- package/dist/cjs/navigation/CoreOutlet.js.map +1 -0
- package/dist/cjs/navigation/SceneNavigationContext.js +2 -0
- package/dist/cjs/navigation/SceneNavigationContext.js.map +1 -1
- package/dist/cjs/navigation/SceneNavigationHost.js +46 -29
- package/dist/cjs/navigation/SceneNavigationHost.js.map +1 -1
- package/dist/cjs/navigation/SceneOutletContext.js +14 -0
- package/dist/cjs/navigation/SceneOutletContext.js.map +1 -0
- package/dist/cjs/navigation/collectOutletOwners.js +36 -0
- package/dist/cjs/navigation/collectOutletOwners.js.map +1 -0
- package/dist/cjs/navigation/placeInOutlet.js +65 -0
- package/dist/cjs/navigation/placeInOutlet.js.map +1 -0
- package/dist/cjs/navigation/useSceneHistoryNavigation.js +22 -6
- package/dist/cjs/navigation/useSceneHistoryNavigation.js.map +1 -1
- package/dist/esm/core/coreComponents.d.ts.map +1 -1
- package/dist/esm/core/coreComponents.js +3 -1
- package/dist/esm/core/coreComponents.js.map +1 -1
- package/dist/esm/core/coreDescriptors.d.ts.map +1 -1
- package/dist/esm/core/coreDescriptors.js +16 -0
- package/dist/esm/core/coreDescriptors.js.map +1 -1
- package/dist/esm/core/corePackage.d.ts.map +1 -1
- package/dist/esm/core/corePackage.js +2 -1
- package/dist/esm/core/corePackage.js.map +1 -1
- package/dist/esm/index.js +5 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/navigation/CoreOutlet.d.ts +3 -0
- package/dist/esm/navigation/CoreOutlet.d.ts.map +1 -0
- package/dist/esm/navigation/CoreOutlet.js +30 -0
- package/dist/esm/navigation/CoreOutlet.js.map +1 -0
- package/dist/esm/navigation/SceneNavigationContext.d.ts +3 -0
- package/dist/esm/navigation/SceneNavigationContext.d.ts.map +1 -1
- package/dist/esm/navigation/SceneNavigationContext.js +3 -2
- package/dist/esm/navigation/SceneNavigationContext.js.map +1 -1
- package/dist/esm/navigation/SceneNavigationHost.d.ts.map +1 -1
- package/dist/esm/navigation/SceneNavigationHost.js +47 -30
- package/dist/esm/navigation/SceneNavigationHost.js.map +1 -1
- package/dist/esm/navigation/SceneNavigationState.d.ts +2 -0
- package/dist/esm/navigation/SceneNavigationState.d.ts.map +1 -1
- package/dist/esm/navigation/SceneOutletContext.d.ts +9 -0
- package/dist/esm/navigation/SceneOutletContext.d.ts.map +1 -0
- package/dist/esm/navigation/SceneOutletContext.js +11 -0
- package/dist/esm/navigation/SceneOutletContext.js.map +1 -0
- package/dist/esm/navigation/collectOutletOwners.d.ts +4 -0
- package/dist/esm/navigation/collectOutletOwners.d.ts.map +1 -0
- package/dist/esm/navigation/collectOutletOwners.js +33 -0
- package/dist/esm/navigation/collectOutletOwners.js.map +1 -0
- package/dist/esm/navigation/index.d.ts +4 -0
- package/dist/esm/navigation/index.d.ts.map +1 -1
- package/dist/esm/navigation/index.js +4 -0
- package/dist/esm/navigation/index.js.map +1 -1
- package/dist/esm/navigation/placeInOutlet.d.ts +4 -0
- package/dist/esm/navigation/placeInOutlet.d.ts.map +1 -0
- package/dist/esm/navigation/placeInOutlet.js +63 -0
- package/dist/esm/navigation/placeInOutlet.js.map +1 -0
- package/dist/esm/navigation/useSceneHistoryNavigation.d.ts +2 -1
- package/dist/esm/navigation/useSceneHistoryNavigation.d.ts.map +1 -1
- package/dist/esm/navigation/useSceneHistoryNavigation.js +22 -6
- package/dist/esm/navigation/useSceneHistoryNavigation.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/navigation/CoreOutlet.tsx +26 -0
- package/navigation/SceneNavigationContext.tsx +10 -0
- package/navigation/SceneNavigationHost.tsx +12 -6
- package/navigation/SceneNavigationState.ts +13 -0
- package/navigation/SceneOutletContext.tsx +19 -0
- package/navigation/collectOutletOwners.ts +30 -0
- package/navigation/index.ts +4 -0
- package/navigation/placeInOutlet.ts +68 -0
- package/navigation/useSceneHistoryNavigation.ts +20 -5
- package/package.json +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SceneOutletContext.js","sources":["../../../navigation/SceneOutletContext.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 { createContext, useContext } from 'react';\nimport { SceneElement } from '@cratis/scene.model';\nimport { ComponentRegistry } from '../renderer';\n\n/** What a nested outlet needs to render the screen placed in it. */\nexport interface SceneOutletContextValue {\n screens: Record<string, SceneElement>;\n registry: ComponentRegistry;\n}\n\nexport const SceneOutletContext = createContext<SceneOutletContextValue | undefined>(undefined);\n\n/** The screens and registry of the enclosing navigation host, or undefined outside one. */\nexport function useSceneOutlets(): SceneOutletContextValue | undefined {\n return useContext(SceneOutletContext);\n}\n"],"names":["SceneOutletContext","createContext","undefined","useSceneOutlets","useContext"],"mappings":";;AAAA;AACA;AAYO,MAAMA,kBAAAA,iBAAqBC,aAAAA,CAAmDC,SAAAA;AAErF,4FACO,SAASC,eAAAA,GAAAA;AACZ,IAAA,OAAOC,UAAAA,CAAWJ,kBAAAA,CAAAA;AACtB;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectOutletOwners.d.ts","sourceRoot":"","sources":["../../../navigation/collectOutletOwners.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAOjD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASjG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
/** The registry key of the component that declares a nested outlet. */ const outletComponentName = 'core:outlet';
|
|
4
|
+
/**
|
|
5
|
+
* Which screen declares each nested outlet: every `core:outlet` element, by its `name`, mapped to the screen
|
|
6
|
+
* whose tree contains it. A screen that declares an outlet another screen also declares keeps the first one,
|
|
7
|
+
* in screen order - the same rule navigation diagnostics report as a duplicate outlet.
|
|
8
|
+
*/ function collectOutletOwners(screens) {
|
|
9
|
+
const owners = {};
|
|
10
|
+
for (const [screen, element] of Object.entries(screens)){
|
|
11
|
+
for (const outlet of outletNames(element)){
|
|
12
|
+
if (!(outlet in owners)) owners[outlet] = screen;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return owners;
|
|
16
|
+
}
|
|
17
|
+
function outletNames(element) {
|
|
18
|
+
const node = element;
|
|
19
|
+
const own = node.componentName === outletComponentName && typeof node.properties?.name === 'string' ? [
|
|
20
|
+
node.properties.name
|
|
21
|
+
] : [];
|
|
22
|
+
const children = [
|
|
23
|
+
...Object.values(node.slots ?? {}).flat(),
|
|
24
|
+
...Array.isArray(node.children) ? node.children : []
|
|
25
|
+
];
|
|
26
|
+
return [
|
|
27
|
+
...own,
|
|
28
|
+
...children.flatMap(outletNames)
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { collectOutletOwners, outletComponentName };
|
|
33
|
+
//# sourceMappingURL=collectOutletOwners.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectOutletOwners.js","sources":["../../../navigation/collectOutletOwners.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 { SceneElement } from '@cratis/scene.model';\n\n/** The registry key of the component that declares a nested outlet. */\nexport const outletComponentName = 'core:outlet';\n\n/**\n * Which screen declares each nested outlet: every `core:outlet` element, by its `name`, mapped to the screen\n * whose tree contains it. A screen that declares an outlet another screen also declares keeps the first one,\n * in screen order - the same rule navigation diagnostics report as a duplicate outlet.\n */\nexport function collectOutletOwners(screens: Record<string, SceneElement>): Record<string, string> {\n const owners: Record<string, string> = {};\n for (const [screen, element] of Object.entries(screens)) {\n for (const outlet of outletNames(element)) {\n if (!(outlet in owners)) owners[outlet] = screen;\n }\n }\n\n return owners;\n}\n\nfunction outletNames(element: SceneElement): string[] {\n const node = element as { componentName?: string; properties?: Record<string, unknown>; slots?: Record<string, SceneElement[]>; children?: SceneElement[] };\n const own = node.componentName === outletComponentName && typeof node.properties?.name === 'string' ? [node.properties.name] : [];\n const children = [...Object.values(node.slots ?? {}).flat(), ...(Array.isArray(node.children) ? node.children : [])];\n return [...own, ...children.flatMap(outletNames)];\n}\n"],"names":["outletComponentName","collectOutletOwners","screens","owners","screen","element","Object","entries","outlet","outletNames","node","own","componentName","properties","name","children","values","slots","flat","Array","isArray","flatMap"],"mappings":"AAAA;AACA;AAIA,wEACO,MAAMA,mBAAAA,GAAsB;AAEnC;;;;IAKO,SAASC,mBAAAA,CAAoBC,OAAqC,EAAA;AACrE,IAAA,MAAMC,SAAiC,EAAC;IACxC,KAAK,MAAM,CAACC,MAAAA,EAAQC,OAAAA,CAAQ,IAAIC,MAAAA,CAAOC,OAAO,CAACL,OAAAA,CAAAA,CAAU;QACrD,KAAK,MAAMM,MAAAA,IAAUC,WAAAA,CAAYJ,OAAAA,CAAAA,CAAU;YACvC,IAAI,EAAEG,MAAAA,IAAUL,MAAK,GAAIA,MAAM,CAACK,OAAO,GAAGJ,MAAAA;AAC9C,QAAA;AACJ,IAAA;IAEA,OAAOD,MAAAA;AACX;AAEA,SAASM,YAAYJ,OAAqB,EAAA;AACtC,IAAA,MAAMK,IAAAA,GAAOL,OAAAA;IACb,MAAMM,GAAAA,GAAMD,IAAAA,CAAKE,aAAa,KAAKZ,mBAAAA,IAAuB,OAAOU,IAAAA,CAAKG,UAAU,EAAEC,IAAAA,KAAS,QAAA,GAAW;QAACJ,IAAAA,CAAKG,UAAU,CAACC;AAAK,KAAA,GAAG,EAAE;AACjI,IAAA,MAAMC,QAAAA,GAAW;AAAIT,QAAAA,GAAAA,MAAAA,CAAOU,MAAM,CAACN,IAAAA,CAAKO,KAAK,IAAI,IAAIC,IAAI,EAAA;WAAQC,KAAAA,CAAMC,OAAO,CAACV,IAAAA,CAAKK,QAAQ,IAAIL,IAAAA,CAAKK,QAAQ,GAAG;AAAI,KAAA;IACpH,OAAO;AAAIJ,QAAAA,GAAAA,GAAAA;AAAQI,QAAAA,GAAAA,QAAAA,CAASM,OAAO,CAACZ,WAAAA;AAAa,KAAA;AACrD;;"}
|
|
@@ -15,4 +15,8 @@ export * from './navigationRouteKey';
|
|
|
15
15
|
export * from './resolveDestination';
|
|
16
16
|
export * from './sceneRoutesFrom';
|
|
17
17
|
export * from './useSceneHistoryNavigation';
|
|
18
|
+
export * from './CoreOutlet';
|
|
19
|
+
export * from './SceneOutletContext';
|
|
20
|
+
export * from './collectOutletOwners';
|
|
21
|
+
export * from './placeInOutlet';
|
|
18
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../navigation/index.ts"],"names":[],"mappings":"AAGA,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../navigation/index.ts"],"names":[],"mappings":"AAGA,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC"}
|
|
@@ -15,4 +15,8 @@ export * from './navigationRouteKey';
|
|
|
15
15
|
export * from './resolveDestination';
|
|
16
16
|
export * from './sceneRoutesFrom';
|
|
17
17
|
export * from './useSceneHistoryNavigation';
|
|
18
|
+
export * from './CoreOutlet';
|
|
19
|
+
export * from './SceneOutletContext';
|
|
20
|
+
export * from './collectOutletOwners';
|
|
21
|
+
export * from './placeInOutlet';
|
|
18
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../navigation/index.ts"],"names":[],"mappings":"AAGA,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../navigation/index.ts"],"names":[],"mappings":"AAGA,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DestinationReference } from '@cratis/scene.model';
|
|
2
|
+
import { SceneNavigationState } from './SceneNavigationState';
|
|
3
|
+
export declare function placeInOutlet(current: SceneNavigationState, screen: string, outlet: string | undefined, owners: Record<string, string>, destinations?: DestinationReference[]): Pick<SceneNavigationState, 'primary' | 'outlets'>;
|
|
4
|
+
//# sourceMappingURL=placeInOutlet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeInOutlet.d.ts","sourceRoot":"","sources":["../../../navigation/placeInOutlet.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAa9D,wBAAgB,aAAa,CACzB,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,YAAY,GAAE,oBAAoB,EAAO,GAC1C,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,SAAS,CAAC,CAmBnD"}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
/** The most levels of nesting a placement follows before it stops, so a cyclic model cannot loop forever. */ const maximumDepth = 32;
|
|
4
|
+
/**
|
|
5
|
+
* Places a screen, recursively composing nested outlets.
|
|
6
|
+
*
|
|
7
|
+
* When `outlet` is a nested outlet - one a screen declares with `core:outlet` - the screen goes into it, and
|
|
8
|
+
* the screen that declares it is placed first: where it already is, or, when it is not on the page, where a
|
|
9
|
+
* known destination puts it, up to the primary region. Outlets declared by screens that are no longer on the
|
|
10
|
+
* page are dropped. Any other outlet replaces the primary region and clears every nested placement.
|
|
11
|
+
*/ function placeInOutlet(current, screen, outlet, owners, destinations = []) {
|
|
12
|
+
const primary = current.primary ?? current.screen;
|
|
13
|
+
const placements = {
|
|
14
|
+
...current.outlets ?? {}
|
|
15
|
+
};
|
|
16
|
+
let root = primary;
|
|
17
|
+
let target = {
|
|
18
|
+
screen,
|
|
19
|
+
outlet
|
|
20
|
+
};
|
|
21
|
+
for(let depth = 0; target && depth < maximumDepth; depth++){
|
|
22
|
+
const owner = target.outlet === undefined ? undefined : owners[target.outlet];
|
|
23
|
+
if (owner === undefined) {
|
|
24
|
+
root = target.screen;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
placements[target.outlet] = target.screen;
|
|
28
|
+
if (isOnPage(owner, root, placements, owners)) break;
|
|
29
|
+
target = {
|
|
30
|
+
screen: owner,
|
|
31
|
+
outlet: destinations.find((destination)=>destination.screen === owner && destination.outlet)?.outlet
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
primary: root,
|
|
36
|
+
outlets: reachable(root, placements, owners)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** Whether a screen is the root or shown in an outlet reachable from it. */ function isOnPage(screen, root, placements, owners) {
|
|
40
|
+
return screen === root || Object.values(reachable(root, placements, owners)).includes(screen);
|
|
41
|
+
}
|
|
42
|
+
/** Only the placements reachable from the root through the outlets each placed screen declares. */ function reachable(root, placements, owners) {
|
|
43
|
+
const kept = {};
|
|
44
|
+
const pending = [
|
|
45
|
+
root
|
|
46
|
+
];
|
|
47
|
+
const seen = new Set();
|
|
48
|
+
while(pending.length > 0){
|
|
49
|
+
const screen = pending.shift();
|
|
50
|
+
if (seen.has(screen)) continue;
|
|
51
|
+
seen.add(screen);
|
|
52
|
+
for (const [outlet, placed] of Object.entries(placements)){
|
|
53
|
+
if (owners[outlet] === screen) {
|
|
54
|
+
kept[outlet] = placed;
|
|
55
|
+
pending.push(placed);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return kept;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { placeInOutlet };
|
|
63
|
+
//# sourceMappingURL=placeInOutlet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeInOutlet.js","sources":["../../../navigation/placeInOutlet.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 { DestinationReference } from '@cratis/scene.model';\nimport { SceneNavigationState } from './SceneNavigationState';\n\n/** The most levels of nesting a placement follows before it stops, so a cyclic model cannot loop forever. */\nconst maximumDepth = 32;\n\n/**\n * Places a screen, recursively composing nested outlets.\n *\n * When `outlet` is a nested outlet - one a screen declares with `core:outlet` - the screen goes into it, and\n * the screen that declares it is placed first: where it already is, or, when it is not on the page, where a\n * known destination puts it, up to the primary region. Outlets declared by screens that are no longer on the\n * page are dropped. Any other outlet replaces the primary region and clears every nested placement.\n */\nexport function placeInOutlet(\n current: SceneNavigationState,\n screen: string,\n outlet: string | undefined,\n owners: Record<string, string>,\n destinations: DestinationReference[] = [],\n): Pick<SceneNavigationState, 'primary' | 'outlets'> {\n const primary = current.primary ?? current.screen;\n const placements: Record<string, string> = { ...(current.outlets ?? {}) };\n let root = primary;\n\n let target: { screen: string; outlet: string | undefined } | undefined = { screen, outlet };\n for (let depth = 0; target && depth < maximumDepth; depth++) {\n const owner = target.outlet === undefined ? undefined : owners[target.outlet];\n if (owner === undefined) {\n root = target.screen;\n break;\n }\n\n placements[target.outlet!] = target.screen;\n if (isOnPage(owner, root, placements, owners)) break;\n target = { screen: owner, outlet: destinations.find(destination => destination.screen === owner && destination.outlet)?.outlet };\n }\n\n return { primary: root, outlets: reachable(root, placements, owners) };\n}\n\n/** Whether a screen is the root or shown in an outlet reachable from it. */\nfunction isOnPage(screen: string, root: string, placements: Record<string, string>, owners: Record<string, string>): boolean {\n return screen === root || Object.values(reachable(root, placements, owners)).includes(screen);\n}\n\n/** Only the placements reachable from the root through the outlets each placed screen declares. */\nfunction reachable(root: string, placements: Record<string, string>, owners: Record<string, string>): Record<string, string> {\n const kept: Record<string, string> = {};\n const pending = [root];\n const seen = new Set<string>();\n while (pending.length > 0) {\n const screen = pending.shift()!;\n if (seen.has(screen)) continue;\n seen.add(screen);\n for (const [outlet, placed] of Object.entries(placements)) {\n if (owners[outlet] === screen) {\n kept[outlet] = placed;\n pending.push(placed);\n }\n }\n }\n\n return kept;\n}\n"],"names":["maximumDepth","placeInOutlet","current","screen","outlet","owners","destinations","primary","placements","outlets","root","target","depth","owner","undefined","isOnPage","find","destination","reachable","Object","values","includes","kept","pending","seen","Set","length","shift","has","add","placed","entries","push"],"mappings":"AAAA;AACA;AAKA,8GACA,MAAMA,YAAAA,GAAe,EAAA;AAErB;;;;;;;AAOC,IACM,SAASC,aAAAA,CACZC,OAA6B,EAC7BC,MAAc,EACdC,MAA0B,EAC1BC,MAA8B,EAC9BC,YAAAA,GAAuC,EAAE,EAAA;AAEzC,IAAA,MAAMC,OAAAA,GAAUL,OAAAA,CAAQK,OAAO,IAAIL,QAAQC,MAAM;AACjD,IAAA,MAAMK,UAAAA,GAAqC;AAAE,QAAA,GAAIN,OAAAA,CAAQO,OAAO,IAAI;AAAI,KAAA;AACxE,IAAA,IAAIC,IAAAA,GAAOH,OAAAA;AAEX,IAAA,IAAII,MAAAA,GAAqE;AAAER,QAAAA,MAAAA;AAAQC,QAAAA;AAAO,KAAA;AAC1F,IAAA,IAAK,IAAIQ,KAAAA,GAAQ,CAAA,EAAGD,MAAAA,IAAUC,KAAAA,GAAQZ,cAAcY,KAAAA,EAAAA,CAAS;QACzD,MAAMC,KAAAA,GAAQF,MAAAA,CAAOP,MAAM,KAAKU,SAAAA,GAAYA,YAAYT,MAAM,CAACM,MAAAA,CAAOP,MAAM,CAAC;AAC7E,QAAA,IAAIS,UAAUC,SAAAA,EAAW;AACrBJ,YAAAA,IAAAA,GAAOC,OAAOR,MAAM;AACpB,YAAA;AACJ,QAAA;AAEAK,QAAAA,UAAU,CAACG,MAAAA,CAAOP,MAAM,CAAE,GAAGO,OAAOR,MAAM;AAC1C,QAAA,IAAIY,QAAAA,CAASF,KAAAA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AAA,CAAO,KAAKD,MAAAA,EAAQ;gBAC3BmB,IAAI,CAAClB,OAAO,GAAG0B,MAAAA;AACfP,gBAAAA,OAAAA,CAAQS,IAAI,CAACF,MAAAA,CAAAA;AACjB,YAAA;AACJ,QAAA;AACJ,IAAA;IAEA,OAAOR,IAAAA;AACX;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BindingScope } from '@cratis/scene.engine';
|
|
2
|
+
import { DestinationReference } from '@cratis/scene.model';
|
|
2
3
|
import { SceneHistory } from './SceneHistory';
|
|
3
4
|
import { SceneNavigationContextValue } from './SceneNavigationContext';
|
|
4
5
|
import { SceneRoute } from './SceneRoute';
|
|
5
|
-
export declare function useSceneHistoryNavigation(history: SceneHistory, routes: SceneRoute[], initialScreen: string, bindingScope: BindingScope): SceneNavigationContextValue;
|
|
6
|
+
export declare function useSceneHistoryNavigation(history: SceneHistory, routes: SceneRoute[], initialScreen: string, bindingScope: BindingScope, outletOwners?: Record<string, string>, destinations?: DestinationReference[]): SceneNavigationContextValue;
|
|
6
7
|
//# sourceMappingURL=useSceneHistoryNavigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSceneHistoryNavigation.d.ts","sourceRoot":"","sources":["../../../navigation/useSceneHistoryNavigation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;
|
|
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,CAmE7B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useCallback, useMemo, useState, useRef, useEffect } from 'react';
|
|
2
2
|
import { DestinationKind } from '@cratis/scene.model';
|
|
3
3
|
import { matchSceneRoute } from './matchSceneRoute.js';
|
|
4
|
+
import { placeInOutlet } from './placeInOutlet.js';
|
|
4
5
|
import { resolveDestination } from './resolveDestination.js';
|
|
5
6
|
|
|
6
7
|
// Copyright (c) Cratis. All rights reserved.
|
|
@@ -9,16 +10,24 @@ import { resolveDestination } from './resolveDestination.js';
|
|
|
9
10
|
* Keeps a navigation host's state in a {@link SceneHistory}: every navigation and every dialog is an entry,
|
|
10
11
|
* so back and forward step through them, a refresh restores the stored entry, and a deep link is matched
|
|
11
12
|
* against the route table. Closing a dialog goes back to the entry that opened it.
|
|
12
|
-
*/ function useSceneHistoryNavigation(history, routes, initialScreen, bindingScope) {
|
|
13
|
+
*/ function useSceneHistoryNavigation(history, routes, initialScreen, bindingScope, outletOwners = {}, destinations = []) {
|
|
13
14
|
const fromLocation = useCallback((url)=>{
|
|
14
15
|
const match = url ? matchSceneRoute(url, routes) : undefined;
|
|
15
|
-
|
|
16
|
+
if (!match) return undefined;
|
|
17
|
+
const start = {
|
|
18
|
+
screen: initialScreen};
|
|
19
|
+
const placement = placeInOutlet(start, match.route.screen, match.route.outlet, outletOwners, destinations);
|
|
20
|
+
return {
|
|
16
21
|
screen: match.route.screen,
|
|
17
22
|
url,
|
|
18
23
|
outlet: match.route.outlet,
|
|
19
|
-
parameters: match.parameters
|
|
20
|
-
|
|
24
|
+
parameters: match.parameters,
|
|
25
|
+
...placement
|
|
26
|
+
};
|
|
21
27
|
}, [
|
|
28
|
+
destinations,
|
|
29
|
+
initialScreen,
|
|
30
|
+
outletOwners,
|
|
22
31
|
routes
|
|
23
32
|
]);
|
|
24
33
|
const fallback = useMemo(()=>({
|
|
@@ -59,17 +68,22 @@ import { resolveDestination } from './resolveDestination.js';
|
|
|
59
68
|
dialog: resolution.dialog
|
|
60
69
|
});
|
|
61
70
|
} else if (resolution.kind !== DestinationKind.External) {
|
|
71
|
+
const screen = destination.screen ?? destination.slice ?? state.screen;
|
|
72
|
+
const placement = placeInOutlet(state, screen, resolution.outlet, outletOwners, destinations);
|
|
62
73
|
go({
|
|
63
|
-
screen
|
|
74
|
+
screen,
|
|
64
75
|
url: resolution.url,
|
|
65
76
|
outlet: resolution.outlet,
|
|
66
|
-
parameters: resolution.parameters
|
|
77
|
+
parameters: resolution.parameters,
|
|
78
|
+
...placement
|
|
67
79
|
});
|
|
68
80
|
}
|
|
69
81
|
return resolution;
|
|
70
82
|
}, [
|
|
71
83
|
bindingScope,
|
|
84
|
+
destinations,
|
|
72
85
|
go,
|
|
86
|
+
outletOwners,
|
|
73
87
|
state
|
|
74
88
|
]);
|
|
75
89
|
const closeDialog = useCallback((result)=>{
|
|
@@ -85,6 +99,8 @@ import { resolveDestination } from './resolveDestination.js';
|
|
|
85
99
|
]);
|
|
86
100
|
return useMemo(()=>({
|
|
87
101
|
currentScreen: state.screen,
|
|
102
|
+
primaryScreen: state.primary ?? state.screen,
|
|
103
|
+
outlets: state.outlets ?? {},
|
|
88
104
|
currentUrl: state.url,
|
|
89
105
|
currentOutlet: state.outlet,
|
|
90
106
|
currentDialog: state.dialog,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSceneHistoryNavigation.js","sources":["../../../navigation/useSceneHistoryNavigation.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 { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { BindingScope } from '@cratis/scene.engine';\nimport { DestinationKind, DestinationReference } from '@cratis/scene.model';\nimport { DialogResult } from './DialogResult';\nimport { matchSceneRoute } from './matchSceneRoute';\nimport { resolveDestination } from './resolveDestination';\nimport { SceneHistory } from './SceneHistory';\nimport { SceneNavigationContextValue } from './SceneNavigationContext';\nimport { SceneNavigationState } from './SceneNavigationState';\nimport { SceneRoute } from './SceneRoute';\n\n/**\n * Keeps a navigation host's state in a {@link SceneHistory}: every navigation and every dialog is an entry,\n * so back and forward step through them, a refresh restores the stored entry, and a deep link is matched\n * against the route table. Closing a dialog goes back to the entry that opened it.\n */\nexport function useSceneHistoryNavigation(history: SceneHistory
|
|
1
|
+
{"version":3,"file":"useSceneHistoryNavigation.js","sources":["../../../navigation/useSceneHistoryNavigation.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 { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { BindingScope } from '@cratis/scene.engine';\nimport { DestinationKind, DestinationReference } from '@cratis/scene.model';\nimport { DialogResult } from './DialogResult';\nimport { matchSceneRoute } from './matchSceneRoute';\nimport { placeInOutlet } from './placeInOutlet';\nimport { resolveDestination } from './resolveDestination';\nimport { SceneHistory } from './SceneHistory';\nimport { SceneNavigationContextValue } from './SceneNavigationContext';\nimport { SceneNavigationState } from './SceneNavigationState';\nimport { SceneRoute } from './SceneRoute';\n\n/**\n * Keeps a navigation host's state in a {@link SceneHistory}: every navigation and every dialog is an entry,\n * so back and forward step through them, a refresh restores the stored entry, and a deep link is matched\n * against the route table. Closing a dialog goes back to the entry that opened it.\n */\nexport function useSceneHistoryNavigation(\n history: SceneHistory,\n routes: SceneRoute[],\n initialScreen: string,\n bindingScope: BindingScope,\n outletOwners: Record<string, string> = {},\n destinations: DestinationReference[] = [],\n): SceneNavigationContextValue {\n const fromLocation = useCallback((url: string | undefined): SceneNavigationState | undefined => {\n const match = url ? matchSceneRoute(url, routes) : undefined;\n if (!match) return undefined;\n const start: SceneNavigationState = { screen: initialScreen, parameters: {} };\n const placement = placeInOutlet(start, match.route.screen, match.route.outlet, outletOwners, destinations);\n return { screen: match.route.screen, url, outlet: match.route.outlet, parameters: match.parameters, ...placement };\n }, [destinations, initialScreen, outletOwners, routes]);\n const fallback = useMemo<SceneNavigationState>(() => ({ screen: initialScreen, url: initialScreen, parameters: {} }), [initialScreen]);\n\n const [unresolvedUrl] = useState(() => {\n const url = history.location();\n return !history.state() && url && !fromLocation(url) ? url : undefined;\n });\n const [state, setState] = useState<SceneNavigationState>(() => history.state() ?? fromLocation(history.location()) ?? fallback);\n const [dialogResult, setDialogResult] = useState<DialogResult>();\n\n // Back and forward restore the stored entry, or match a URL the host never wrote against the current routes.\n const restore = useRef((url: string | undefined, stored: SceneNavigationState | undefined) => stored ?? fromLocation(url) ?? fallback);\n restore.current = (url, stored) => stored ?? fromLocation(url) ?? fallback;\n const initialState = useRef(state);\n\n // The current entry is written once, when a history is attached; later entries are written by navigate.\n useEffect(() => {\n history.replace(initialState.current);\n return history.listen((url, stored) => setState(restore.current(url, stored)));\n }, [history]);\n\n const go = useCallback((next: SceneNavigationState) => {\n history.push(next);\n setState(next);\n }, [history]);\n\n const navigate = useCallback((destination: DestinationReference) => {\n const resolution = resolveDestination(destination, bindingScope);\n if (resolution.kind === DestinationKind.Dialog) {\n if (resolution.dialog) go({ ...state, dialog: resolution.dialog });\n } else if (resolution.kind !== DestinationKind.External) {\n const screen = destination.screen ?? destination.slice ?? state.screen;\n const placement = placeInOutlet(state, screen, resolution.outlet, outletOwners, destinations);\n go({ screen, url: resolution.url, outlet: resolution.outlet, parameters: resolution.parameters, ...placement });\n }\n\n return resolution;\n }, [bindingScope, destinations, go, outletOwners, state]);\n\n const closeDialog = useCallback((result?: unknown) => {\n if (!state.dialog) return;\n setDialogResult({ dialog: state.dialog, result });\n history.back();\n }, [history, state.dialog]);\n\n return useMemo(() => ({\n currentScreen: state.screen,\n primaryScreen: state.primary ?? state.screen,\n outlets: state.outlets ?? {},\n currentUrl: state.url,\n currentOutlet: state.outlet,\n currentDialog: state.dialog,\n currentParameters: state.parameters,\n dialogResult,\n unresolvedUrl,\n bindingScope,\n navigate,\n closeDialog,\n back: () => history.back(),\n }), [bindingScope, closeDialog, dialogResult, history, navigate, state, unresolvedUrl]);\n}\n"],"names":["useSceneHistoryNavigation","history","routes","initialScreen","bindingScope","outletOwners","destinations","fromLocation","useCallback","url","match","matchSceneRoute","undefined","start","screen","placement","placeInOutlet","route","outlet","parameters","fallback","useMemo","unresolvedUrl","useState","location","state","setState","dialogResult","setDialogResult","restore","useRef","stored","current","initialState","useEffect","replace","listen","go","next","push","navigate","destination","resolution","resolveDestination","kind","DestinationKind","Dialog","dialog","External","slice","closeDialog","result","back","currentScreen","primaryScreen","primary","outlets","currentUrl","currentOutlet","currentDialog","currentParameters"],"mappings":";;;;;;AAAA;AACA;AAcA;;;;AAIC,IACM,SAASA,yBAAAA,CACZC,OAAqB,EACrBC,MAAoB,EACpBC,aAAqB,EACrBC,YAA0B,EAC1BC,YAAAA,GAAuC,EAAE,EACzCC,eAAuC,EAAE,EAAA;IAEzC,MAAMC,YAAAA,GAAeC,YAAY,CAACC,GAAAA,GAAAA;AAC9B,QAAA,MAAMC,KAAAA,GAAQD,GAAAA,GAAME,eAAAA,CAAgBF,GAAAA,EAAKP,MAAAA,CAAAA,GAAUU,SAAAA;QACnD,IAAI,CAACF,OAAO,OAAOE,SAAAA;AACnB,QAAA,MAAMC,KAAAA,GAA8B;YAAEC,MAAAA,EAAQX,aAA8B,CAAA;AAC5E,QAAA,MAAMY,SAAAA,GAAYC,aAAAA,CAAcH,KAAAA,EAAOH,KAAAA,CAAMO,KAAK,CAACH,MAAM,EAAEJ,KAAAA,CAAMO,KAAK,CAACC,MAAM,EAAEb,YAAAA,EAAcC,YAAAA,CAAAA;QAC7F,OAAO;YAAEQ,MAAAA,EAAQJ,KAAAA,CAAMO,KAAK,CAACH,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