@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.
Files changed (80) hide show
  1. package/core/coreComponents.ts +2 -0
  2. package/core/coreDescriptors.ts +6 -0
  3. package/core/corePackage.ts +1 -0
  4. package/dist/cjs/core/coreComponents.js +3 -1
  5. package/dist/cjs/core/coreComponents.js.map +1 -1
  6. package/dist/cjs/core/coreDescriptors.js +16 -0
  7. package/dist/cjs/core/coreDescriptors.js.map +1 -1
  8. package/dist/cjs/core/corePackage.js +2 -1
  9. package/dist/cjs/core/corePackage.js.map +1 -1
  10. package/dist/cjs/index.js +11 -0
  11. package/dist/cjs/index.js.map +1 -1
  12. package/dist/cjs/navigation/CoreOutlet.js +32 -0
  13. package/dist/cjs/navigation/CoreOutlet.js.map +1 -0
  14. package/dist/cjs/navigation/SceneNavigationContext.js +2 -0
  15. package/dist/cjs/navigation/SceneNavigationContext.js.map +1 -1
  16. package/dist/cjs/navigation/SceneNavigationHost.js +46 -29
  17. package/dist/cjs/navigation/SceneNavigationHost.js.map +1 -1
  18. package/dist/cjs/navigation/SceneOutletContext.js +14 -0
  19. package/dist/cjs/navigation/SceneOutletContext.js.map +1 -0
  20. package/dist/cjs/navigation/collectOutletOwners.js +36 -0
  21. package/dist/cjs/navigation/collectOutletOwners.js.map +1 -0
  22. package/dist/cjs/navigation/placeInOutlet.js +65 -0
  23. package/dist/cjs/navigation/placeInOutlet.js.map +1 -0
  24. package/dist/cjs/navigation/useSceneHistoryNavigation.js +22 -6
  25. package/dist/cjs/navigation/useSceneHistoryNavigation.js.map +1 -1
  26. package/dist/esm/core/coreComponents.d.ts.map +1 -1
  27. package/dist/esm/core/coreComponents.js +3 -1
  28. package/dist/esm/core/coreComponents.js.map +1 -1
  29. package/dist/esm/core/coreDescriptors.d.ts.map +1 -1
  30. package/dist/esm/core/coreDescriptors.js +16 -0
  31. package/dist/esm/core/coreDescriptors.js.map +1 -1
  32. package/dist/esm/core/corePackage.d.ts.map +1 -1
  33. package/dist/esm/core/corePackage.js +2 -1
  34. package/dist/esm/core/corePackage.js.map +1 -1
  35. package/dist/esm/index.js +5 -1
  36. package/dist/esm/index.js.map +1 -1
  37. package/dist/esm/navigation/CoreOutlet.d.ts +3 -0
  38. package/dist/esm/navigation/CoreOutlet.d.ts.map +1 -0
  39. package/dist/esm/navigation/CoreOutlet.js +30 -0
  40. package/dist/esm/navigation/CoreOutlet.js.map +1 -0
  41. package/dist/esm/navigation/SceneNavigationContext.d.ts +3 -0
  42. package/dist/esm/navigation/SceneNavigationContext.d.ts.map +1 -1
  43. package/dist/esm/navigation/SceneNavigationContext.js +3 -2
  44. package/dist/esm/navigation/SceneNavigationContext.js.map +1 -1
  45. package/dist/esm/navigation/SceneNavigationHost.d.ts.map +1 -1
  46. package/dist/esm/navigation/SceneNavigationHost.js +47 -30
  47. package/dist/esm/navigation/SceneNavigationHost.js.map +1 -1
  48. package/dist/esm/navigation/SceneNavigationState.d.ts +2 -0
  49. package/dist/esm/navigation/SceneNavigationState.d.ts.map +1 -1
  50. package/dist/esm/navigation/SceneOutletContext.d.ts +9 -0
  51. package/dist/esm/navigation/SceneOutletContext.d.ts.map +1 -0
  52. package/dist/esm/navigation/SceneOutletContext.js +11 -0
  53. package/dist/esm/navigation/SceneOutletContext.js.map +1 -0
  54. package/dist/esm/navigation/collectOutletOwners.d.ts +4 -0
  55. package/dist/esm/navigation/collectOutletOwners.d.ts.map +1 -0
  56. package/dist/esm/navigation/collectOutletOwners.js +33 -0
  57. package/dist/esm/navigation/collectOutletOwners.js.map +1 -0
  58. package/dist/esm/navigation/index.d.ts +4 -0
  59. package/dist/esm/navigation/index.d.ts.map +1 -1
  60. package/dist/esm/navigation/index.js +4 -0
  61. package/dist/esm/navigation/index.js.map +1 -1
  62. package/dist/esm/navigation/placeInOutlet.d.ts +4 -0
  63. package/dist/esm/navigation/placeInOutlet.d.ts.map +1 -0
  64. package/dist/esm/navigation/placeInOutlet.js +63 -0
  65. package/dist/esm/navigation/placeInOutlet.js.map +1 -0
  66. package/dist/esm/navigation/useSceneHistoryNavigation.d.ts +2 -1
  67. package/dist/esm/navigation/useSceneHistoryNavigation.d.ts.map +1 -1
  68. package/dist/esm/navigation/useSceneHistoryNavigation.js +22 -6
  69. package/dist/esm/navigation/useSceneHistoryNavigation.js.map +1 -1
  70. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  71. package/navigation/CoreOutlet.tsx +26 -0
  72. package/navigation/SceneNavigationContext.tsx +10 -0
  73. package/navigation/SceneNavigationHost.tsx +12 -6
  74. package/navigation/SceneNavigationState.ts +13 -0
  75. package/navigation/SceneOutletContext.tsx +19 -0
  76. package/navigation/collectOutletOwners.ts +30 -0
  77. package/navigation/index.ts +4 -0
  78. package/navigation/placeInOutlet.ts +68 -0
  79. package/navigation/useSceneHistoryNavigation.ts +20 -5
  80. package/package.json +5 -5
@@ -7,6 +7,7 @@ import { CoreText } from './CoreText';
7
7
  import { CoreButton } from './CoreButton';
8
8
  import { CoreCard } from './CoreCard';
9
9
  import { CoreNavigationBar } from './CoreNavigationBar';
10
+ import { CoreOutlet } from '../navigation/CoreOutlet';
10
11
  import {
11
12
  CoreAction,
12
13
  CoreCode,
@@ -41,4 +42,5 @@ export const coreComponents: ComponentRegistry = {
41
42
  [componentRegistryKey('core', 'code')]: CoreCode,
42
43
  [componentRegistryKey('core', 'file')]: CoreFile,
43
44
  [componentRegistryKey('core', 'navigationBar')]: CoreNavigationBar,
45
+ [componentRegistryKey('core', 'outlet')]: CoreOutlet,
44
46
  };
@@ -53,6 +53,12 @@ export const coreDescriptors: ComponentDescriptor[] = [
53
53
  { path: 'label', label: 'Heading', group: 'Content', valueType: PropertyValueType.String },
54
54
  ],
55
55
  },
56
+ {
57
+ component: key('outlet'),
58
+ displayName: 'Outlet',
59
+ description: 'A named region another screen opens into. Placing a screen here keeps this screen on the page, and the placed screen may declare outlets of its own.',
60
+ properties: [{ path: 'name', label: 'Name', group: 'Navigation', valueType: PropertyValueType.String, constraints: { required: true } }],
61
+ },
56
62
  {
57
63
  component: key('navigationBar'),
58
64
  displayName: 'Navigation bar',
@@ -34,6 +34,7 @@ export const corePackageManifest: ScenePackage = {
34
34
  'code',
35
35
  'file',
36
36
  'navigationBar',
37
+ 'outlet',
37
38
  ],
38
39
  layouts: [],
39
40
  screenTemplates: [],
@@ -6,6 +6,7 @@ require('@cratis/scene.engine');
6
6
  require('@cratis/scene.model');
7
7
  require('../interactions/useInteractions.js');
8
8
  require('../interactions/NotificationHost.js');
9
+ var CoreOutlet = require('../navigation/CoreOutlet.js');
9
10
  var ScenePackageBundle = require('../packages/ScenePackageBundle.js');
10
11
  require('../packages/runDesignTimeAction.js');
11
12
  var CoreText = require('./CoreText.js');
@@ -34,7 +35,8 @@ var ScreenplayCoreComponents = require('./ScreenplayCoreComponents.js');
34
35
  [ScenePackageBundle.componentRegistryKey('core', 'field')]: ScreenplayCoreComponents.CoreField,
35
36
  [ScenePackageBundle.componentRegistryKey('core', 'code')]: ScreenplayCoreComponents.CoreCode,
36
37
  [ScenePackageBundle.componentRegistryKey('core', 'file')]: ScreenplayCoreComponents.CoreFile,
37
- [ScenePackageBundle.componentRegistryKey('core', 'navigationBar')]: CoreNavigationBar.CoreNavigationBar
38
+ [ScenePackageBundle.componentRegistryKey('core', 'navigationBar')]: CoreNavigationBar.CoreNavigationBar,
39
+ [ScenePackageBundle.componentRegistryKey('core', 'outlet')]: CoreOutlet.CoreOutlet
38
40
  };
39
41
 
40
42
  exports.coreComponents = coreComponents;
@@ -1 +1 @@
1
- {"version":3,"file":"coreComponents.js","sources":["../../../core/coreComponents.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 { ComponentRegistry } from '../renderer';\nimport { componentRegistryKey } from '../packages';\nimport { CoreText } from './CoreText';\nimport { CoreButton } from './CoreButton';\nimport { CoreCard } from './CoreCard';\nimport { CoreNavigationBar } from './CoreNavigationBar';\nimport {\n CoreAction,\n CoreCode,\n CoreColumn,\n CoreData,\n CoreField,\n CoreFile,\n CoreNavigate,\n CoreSection,\n CoreSummary,\n CoreTable,\n CoreTitle,\n} from './ScreenplayCoreComponents';\n\n/**\n * The `core` package's component registry - the final fallback every `ui profile` resolves against\n * regardless of which other packages it lists (Scene#3).\n */\nexport const coreComponents: ComponentRegistry = {\n [componentRegistryKey('core', 'text')]: CoreText,\n [componentRegistryKey('core', 'button')]: CoreButton,\n [componentRegistryKey('core', 'card')]: CoreCard,\n [componentRegistryKey('core', 'data')]: CoreData,\n [componentRegistryKey('core', 'action')]: CoreAction,\n [componentRegistryKey('core', 'section')]: CoreSection,\n [componentRegistryKey('core', 'navigate')]: CoreNavigate,\n [componentRegistryKey('core', 'title')]: CoreTitle,\n [componentRegistryKey('core', 'table')]: CoreTable,\n [componentRegistryKey('core', 'column')]: CoreColumn,\n [componentRegistryKey('core', 'summary')]: CoreSummary,\n [componentRegistryKey('core', 'field')]: CoreField,\n [componentRegistryKey('core', 'code')]: CoreCode,\n [componentRegistryKey('core', 'file')]: CoreFile,\n [componentRegistryKey('core', 'navigationBar')]: CoreNavigationBar,\n};\n"],"names":["coreComponents","componentRegistryKey","CoreText","CoreButton","CoreCard","CoreData","CoreAction","CoreSection","CoreNavigate","CoreTitle","CoreTable","CoreColumn","CoreSummary","CoreField","CoreCode","CoreFile","CoreNavigationBar"],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AAsBA;;;UAIaA,cAAAA,GAAoC;IAC7C,CAACC,uCAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUC,iBAAAA;IACxC,CAACD,uCAAAA,CAAqB,MAAA,EAAQ,QAAA,CAAA,GAAYE,qBAAAA;IAC1C,CAACF,uCAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUG,iBAAAA;IACxC,CAACH,uCAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUI,iCAAAA;IACxC,CAACJ,uCAAAA,CAAqB,MAAA,EAAQ,QAAA,CAAA,GAAYK,mCAAAA;IAC1C,CAACL,uCAAAA,CAAqB,MAAA,EAAQ,SAAA,CAAA,GAAaM,oCAAAA;IAC3C,CAACN,uCAAAA,CAAqB,MAAA,EAAQ,UAAA,CAAA,GAAcO,qCAAAA;IAC5C,CAACP,uCAAAA,CAAqB,MAAA,EAAQ,OAAA,CAAA,GAAWQ,kCAAAA;IACzC,CAACR,uCAAAA,CAAqB,MAAA,EAAQ,OAAA,CAAA,GAAWS,kCAAAA;IACzC,CAACT,uCAAAA,CAAqB,MAAA,EAAQ,QAAA,CAAA,GAAYU,mCAAAA;IAC1C,CAACV,uCAAAA,CAAqB,MAAA,EAAQ,SAAA,CAAA,GAAaW,oCAAAA;IAC3C,CAACX,uCAAAA,CAAqB,MAAA,EAAQ,OAAA,CAAA,GAAWY,kCAAAA;IACzC,CAACZ,uCAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUa,iCAAAA;IACxC,CAACb,uCAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUc,iCAAAA;IACxC,CAACd,uCAAAA,CAAqB,MAAA,EAAQ,eAAA,CAAA,GAAmBe;AACrD;;"}
1
+ {"version":3,"file":"coreComponents.js","sources":["../../../core/coreComponents.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 { ComponentRegistry } from '../renderer';\nimport { componentRegistryKey } from '../packages';\nimport { CoreText } from './CoreText';\nimport { CoreButton } from './CoreButton';\nimport { CoreCard } from './CoreCard';\nimport { CoreNavigationBar } from './CoreNavigationBar';\nimport { CoreOutlet } from '../navigation/CoreOutlet';\nimport {\n CoreAction,\n CoreCode,\n CoreColumn,\n CoreData,\n CoreField,\n CoreFile,\n CoreNavigate,\n CoreSection,\n CoreSummary,\n CoreTable,\n CoreTitle,\n} from './ScreenplayCoreComponents';\n\n/**\n * The `core` package's component registry - the final fallback every `ui profile` resolves against\n * regardless of which other packages it lists (Scene#3).\n */\nexport const coreComponents: ComponentRegistry = {\n [componentRegistryKey('core', 'text')]: CoreText,\n [componentRegistryKey('core', 'button')]: CoreButton,\n [componentRegistryKey('core', 'card')]: CoreCard,\n [componentRegistryKey('core', 'data')]: CoreData,\n [componentRegistryKey('core', 'action')]: CoreAction,\n [componentRegistryKey('core', 'section')]: CoreSection,\n [componentRegistryKey('core', 'navigate')]: CoreNavigate,\n [componentRegistryKey('core', 'title')]: CoreTitle,\n [componentRegistryKey('core', 'table')]: CoreTable,\n [componentRegistryKey('core', 'column')]: CoreColumn,\n [componentRegistryKey('core', 'summary')]: CoreSummary,\n [componentRegistryKey('core', 'field')]: CoreField,\n [componentRegistryKey('core', 'code')]: CoreCode,\n [componentRegistryKey('core', 'file')]: CoreFile,\n [componentRegistryKey('core', 'navigationBar')]: CoreNavigationBar,\n [componentRegistryKey('core', 'outlet')]: CoreOutlet,\n};\n"],"names":["coreComponents","componentRegistryKey","CoreText","CoreButton","CoreCard","CoreData","CoreAction","CoreSection","CoreNavigate","CoreTitle","CoreTable","CoreColumn","CoreSummary","CoreField","CoreCode","CoreFile","CoreNavigationBar","CoreOutlet"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AAuBA;;;UAIaA,cAAAA,GAAoC;IAC7C,CAACC,uCAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUC,iBAAAA;IACxC,CAACD,uCAAAA,CAAqB,MAAA,EAAQ,QAAA,CAAA,GAAYE,qBAAAA;IAC1C,CAACF,uCAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUG,iBAAAA;IACxC,CAACH,uCAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUI,iCAAAA;IACxC,CAACJ,uCAAAA,CAAqB,MAAA,EAAQ,QAAA,CAAA,GAAYK,mCAAAA;IAC1C,CAACL,uCAAAA,CAAqB,MAAA,EAAQ,SAAA,CAAA,GAAaM,oCAAAA;IAC3C,CAACN,uCAAAA,CAAqB,MAAA,EAAQ,UAAA,CAAA,GAAcO,qCAAAA;IAC5C,CAACP,uCAAAA,CAAqB,MAAA,EAAQ,OAAA,CAAA,GAAWQ,kCAAAA;IACzC,CAACR,uCAAAA,CAAqB,MAAA,EAAQ,OAAA,CAAA,GAAWS,kCAAAA;IACzC,CAACT,uCAAAA,CAAqB,MAAA,EAAQ,QAAA,CAAA,GAAYU,mCAAAA;IAC1C,CAACV,uCAAAA,CAAqB,MAAA,EAAQ,SAAA,CAAA,GAAaW,oCAAAA;IAC3C,CAACX,uCAAAA,CAAqB,MAAA,EAAQ,OAAA,CAAA,GAAWY,kCAAAA;IACzC,CAACZ,uCAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUa,iCAAAA;IACxC,CAACb,uCAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUc,iCAAAA;IACxC,CAACd,uCAAAA,CAAqB,MAAA,EAAQ,eAAA,CAAA,GAAmBe,mCAAAA;IACjD,CAACf,uCAAAA,CAAqB,MAAA,EAAQ,QAAA,CAAA,GAAYgB;AAC9C;;"}
@@ -109,6 +109,22 @@ const key = (name)=>ScenePackageBundle.componentRegistryKey('core', name);
109
109
  }
110
110
  ]
111
111
  },
112
+ {
113
+ component: key('outlet'),
114
+ displayName: 'Outlet',
115
+ description: 'A named region another screen opens into. Placing a screen here keeps this screen on the page, and the placed screen may declare outlets of its own.',
116
+ properties: [
117
+ {
118
+ path: 'name',
119
+ label: 'Name',
120
+ group: 'Navigation',
121
+ valueType: scene_model.PropertyValueType.String,
122
+ constraints: {
123
+ required: true
124
+ }
125
+ }
126
+ ]
127
+ },
112
128
  {
113
129
  component: key('navigationBar'),
114
130
  displayName: 'Navigation bar',
@@ -1 +1 @@
1
- {"version":3,"file":"coreDescriptors.js","sources":["../../../core/coreDescriptors.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 { ComponentDescriptor, PropertyValueType } from '@cratis/scene.model';\nimport { componentRegistryKey } from '../packages';\n\nconst key = (name: string) => componentRegistryKey('core', name);\n\n/**\n * What can be edited on the `core` package's components.\n *\n * Only the components an author configures by hand are described: a button's label, an action's command and its\n * argument mapping, a column's heading, and the navigation bar. The Screenplay structural components - `data`,\n * `section`, `summary` - have nothing to edit that is not already a node in the tree.\n */\nexport const coreDescriptors: ComponentDescriptor[] = [\n {\n component: key('button'),\n displayName: 'Button',\n properties: [\n { path: 'label', label: 'Label', group: 'Content', valueType: PropertyValueType.String, default: '' },\n ],\n },\n {\n component: key('action'),\n displayName: 'Command action',\n description: 'Invokes a modeled command. The command and its argument mapping are stored on the element; the host that handles the command event reads them.',\n properties: [\n { path: 'label', label: 'Label', group: 'Content', valueType: PropertyValueType.String },\n {\n path: 'command', label: 'Command', group: 'Behavior', valueType: PropertyValueType.String,\n editorKind: 'stateChangeReference', constraints: { required: true },\n description: 'The state change this action submits.',\n },\n {\n path: 'arguments', label: 'Argument mapping', group: 'Behavior', valueType: PropertyValueType.Collection,\n description: 'Where each command argument comes from.',\n item: {\n label: 'Argument',\n properties: [\n { path: 'name', label: 'Argument', group: 'Behavior', valueType: PropertyValueType.String, constraints: { required: true } },\n { path: 'source', label: 'Source', group: 'Behavior', valueType: PropertyValueType.String, editorKind: 'bindingPath', constraints: { required: true } },\n ],\n },\n },\n ],\n },\n {\n component: key('column'),\n displayName: 'Table column',\n properties: [\n { path: 'property', label: 'Result field', group: 'Data', valueType: PropertyValueType.String, editorKind: 'resultField', constraints: { required: true } },\n { path: 'label', label: 'Heading', group: 'Content', valueType: PropertyValueType.String },\n ],\n },\n {\n component: key('navigationBar'),\n displayName: 'Navigation bar',\n description: 'A list of navigation items. A template author fixes the first item (Home) and can expose the list so that screens add their own.',\n properties: [\n { path: 'title', label: 'Title', group: 'Content', valueType: PropertyValueType.String, default: 'Navigation' },\n {\n path: 'items', label: 'Items', group: 'Content', valueType: PropertyValueType.Collection, default: [],\n item: {\n label: 'Navigation item',\n properties: [\n { path: 'label', label: 'Label', group: 'Content', valueType: PropertyValueType.String, constraints: { required: true, minimumLength: 1 } },\n { path: 'icon', label: 'Icon', group: 'Content', valueType: PropertyValueType.Icon, editorKind: 'iconPicker' },\n { path: 'destination', label: 'Destination', group: 'Content', valueType: PropertyValueType.Destination, editorKind: 'screenPicker', constraints: { required: true } },\n ],\n },\n },\n ],\n },\n];\n"],"names":["key","name","componentRegistryKey","coreDescriptors","component","displayName","properties","path","label","group","valueType","PropertyValueType","String","default","description","editorKind","constraints","required","Collection","item","minimumLength","Icon","Destination"],"mappings":";;;;;;;;;;;AAAA;AACA;AAKA,MAAMA,GAAAA,GAAM,CAACC,IAAAA,GAAiBC,uCAAAA,CAAqB,MAAA,EAAQD,IAAAA,CAAAA;AAE3D;;;;;;UAOaE,eAAAA,GAAyC;AAClD,IAAA;AACIC,QAAAA,SAAAA,EAAWJ,GAAAA,CAAI,QAAA,CAAA;QACfK,WAAAA,EAAa,QAAA;QACbC,UAAAA,EAAY;AACR,YAAA;gBAAEC,IAAAA,EAAM,OAAA;gBAASC,KAAAA,EAAO,OAAA;gBAASC,KAAAA,EAAO,SAAA;AAAWC,gBAAAA,SAAAA,EAAWC,8BAAkBC,MAAM;gBAAEC,OAAAA,EAAS;AAAG;AACvG;AACL,KAAA;AACA,IAAA;AACIT,QAAAA,SAAAA,EAAWJ,GAAAA,CAAI,QAAA,CAAA;QACfK,WAAAA,EAAa,gBAAA;QACbS,WAAAA,EAAa,gJAAA;QACbR,UAAAA,EAAY;AACR,YAAA;gBAAEC,IAAAA,EAAM,OAAA;gBAASC,KAAAA,EAAO,OAAA;gBAASC,KAAAA,EAAO,SAAA;AAAWC,gBAAAA,SAAAA,EAAWC,8BAAkBC;AAAO,aAAA;AACvF,YAAA;gBACIL,IAAAA,EAAM,SAAA;gBAAWC,KAAAA,EAAO,SAAA;gBAAWC,KAAAA,EAAO,UAAA;AAAYC,gBAAAA,SAAAA,EAAWC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4BAAgBC,WAAAA,EAAa;gCAAEC,QAAAA,EAAU;AAAK;AAAE;AACxK;AACL;AACJ;AACH;AACL;;;"}
1
+ {"version":3,"file":"coreDescriptors.js","sources":["../../../core/coreDescriptors.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 { ComponentDescriptor, PropertyValueType } from '@cratis/scene.model';\nimport { componentRegistryKey } from '../packages';\n\nconst key = (name: string) => componentRegistryKey('core', name);\n\n/**\n * What can be edited on the `core` package's components.\n *\n * Only the components an author configures by hand are described: a button's label, an action's command and its\n * argument mapping, a column's heading, and the navigation bar. The Screenplay structural components - `data`,\n * `section`, `summary` - have nothing to edit that is not already a node in the tree.\n */\nexport const coreDescriptors: ComponentDescriptor[] = [\n {\n component: key('button'),\n displayName: 'Button',\n properties: [\n { path: 'label', label: 'Label', group: 'Content', valueType: PropertyValueType.String, default: '' },\n ],\n },\n {\n component: key('action'),\n displayName: 'Command action',\n description: 'Invokes a modeled command. The command and its argument mapping are stored on the element; the host that handles the command event reads them.',\n properties: [\n { path: 'label', label: 'Label', group: 'Content', valueType: PropertyValueType.String },\n {\n path: 'command', label: 'Command', group: 'Behavior', valueType: PropertyValueType.String,\n editorKind: 'stateChangeReference', constraints: { required: true },\n description: 'The state change this action submits.',\n },\n {\n path: 'arguments', label: 'Argument mapping', group: 'Behavior', valueType: PropertyValueType.Collection,\n description: 'Where each command argument comes from.',\n item: {\n label: 'Argument',\n properties: [\n { path: 'name', label: 'Argument', group: 'Behavior', valueType: PropertyValueType.String, constraints: { required: true } },\n { path: 'source', label: 'Source', group: 'Behavior', valueType: PropertyValueType.String, editorKind: 'bindingPath', constraints: { required: true } },\n ],\n },\n },\n ],\n },\n {\n component: key('column'),\n displayName: 'Table column',\n properties: [\n { path: 'property', label: 'Result field', group: 'Data', valueType: PropertyValueType.String, editorKind: 'resultField', constraints: { required: true } },\n { path: 'label', label: 'Heading', group: 'Content', valueType: PropertyValueType.String },\n ],\n },\n {\n component: key('outlet'),\n displayName: 'Outlet',\n description: 'A named region another screen opens into. Placing a screen here keeps this screen on the page, and the placed screen may declare outlets of its own.',\n properties: [{ path: 'name', label: 'Name', group: 'Navigation', valueType: PropertyValueType.String, constraints: { required: true } }],\n },\n {\n component: key('navigationBar'),\n displayName: 'Navigation bar',\n description: 'A list of navigation items. A template author fixes the first item (Home) and can expose the list so that screens add their own.',\n properties: [\n { path: 'title', label: 'Title', group: 'Content', valueType: PropertyValueType.String, default: 'Navigation' },\n {\n path: 'items', label: 'Items', group: 'Content', valueType: PropertyValueType.Collection, default: [],\n item: {\n label: 'Navigation item',\n properties: [\n { path: 'label', label: 'Label', group: 'Content', valueType: PropertyValueType.String, constraints: { required: true, minimumLength: 1 } },\n { path: 'icon', label: 'Icon', group: 'Content', valueType: PropertyValueType.Icon, editorKind: 'iconPicker' },\n { path: 'destination', label: 'Destination', group: 'Content', valueType: PropertyValueType.Destination, editorKind: 'screenPicker', constraints: { required: true } },\n ],\n },\n },\n ],\n },\n];\n"],"names":["key","name","componentRegistryKey","coreDescriptors","component","displayName","properties","path","label","group","valueType","PropertyValueType","String","default","description","editorKind","constraints","required","Collection","item","minimumLength","Icon","Destination"],"mappings":";;;;;;;;;;;AAAA;AACA;AAKA,MAAMA,GAAAA,GAAM,CAACC,IAAAA,GAAiBC,uCAAAA,CAAqB,MAAA,EAAQD,IAAAA,CAAAA;AAE3D;;;;;;UAOaE,eAAAA,GAAyC;AAClD,IAAA;AACIC,QAAAA,SAAAA,EAAWJ,GAAAA,CAAI,QAAA,CAAA;QACfK,WAAAA,EAAa,QAAA;QACbC,UAAAA,EAAY;AACR,YAAA;gBAAEC,IAAAA,EAAM,OAAA;gBAASC,KAAAA,EAAO,OAAA;gBAASC,KAAAA,EAAO,SAAA;AAAWC,gBAAAA,SAAAA,EAAWC,8BAAkBC,MAAM;gBAAEC,OAAAA,EAAS;AAAG;AACvG;AACL,KAAA;AACA,IAAA;AACIT,QAAAA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AAA;AAAWC,gBAAAA,SAAAA,EAAWC,8BAAkBO,UAAU;AAAEL,gBAAAA,OAAAA,EAAS,EAAE;gBACrGM,IAAAA,EAAM;oBACFX,KAAAA,EAAO,iBAAA;oBACPF,UAAAA,EAAY;AACR,wBAAA;4BAAEC,IAAAA,EAAM,OAAA;4BAASC,KAAAA,EAAO,OAAA;4BAASC,KAAAA,EAAO,SAAA;AAAWC,4BAAAA,SAAAA,EAAWC,8BAAkBC,MAAM;4BAAEI,WAAAA,EAAa;gCAAEC,QAAAA,EAAU,IAAA;gCAAMG,aAAAA,EAAe;AAAE;AAAE,yBAAA;AAC1I,wBAAA;4BAAEb,IAAAA,EAAM,MAAA;4BAAQC,KAAAA,EAAO,MAAA;4BAAQC,KAAAA,EAAO,SAAA;AAAWC,4BAAAA,SAAAA,EAAWC,8BAAkBU,IAAI;4BAAEN,UAAAA,EAAY;AAAa,yBAAA;AAC7G,wBAAA;4BAAER,IAAAA,EAAM,aAAA;4BAAeC,KAAAA,EAAO,aAAA;4BAAeC,KAAAA,EAAO,SAAA;AAAWC,4BAAAA,SAAAA,EAAWC,8BAAkBW,WAAW;4BAAEP,UAAAA,EAAY,cAAA;4BAAgBC,WAAAA,EAAa;gCAAEC,QAAAA,EAAU;AAAK;AAAE;AACxK;AACL;AACJ;AACH;AACL;;;"}
@@ -32,7 +32,8 @@ var coreDescriptors = require('./coreDescriptors.js');
32
32
  'field',
33
33
  'code',
34
34
  'file',
35
- 'navigationBar'
35
+ 'navigationBar',
36
+ 'outlet'
36
37
  ],
37
38
  layouts: [],
38
39
  screenTemplates: [],
@@ -1 +1 @@
1
- {"version":3,"file":"corePackage.js","sources":["../../../core/corePackage.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 { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle } from '../packages';\nimport { coreComponents } from './coreComponents';\nimport { coreDescriptors } from './coreDescriptors';\n\n/**\n * The `core` package's declaration. Every other package is loaded by a host that reads its manifest;\n * `core` ships inside the renderer itself, because Scene#3 guarantees a bare name always has somewhere to\n * resolve regardless of which packages a profile lists. It is still declared the same way as any other -\n * a package picker should be able to show it, and the dependency resolver should be able to reason about\n * it, without a special case.\n */\nexport const corePackageManifest: ScenePackage = {\n name: 'core',\n version: '1.0.0',\n kind: PackageKind.ComponentLibrary,\n dependencies: [],\n components: [\n 'text',\n 'button',\n 'card',\n 'data',\n 'action',\n 'section',\n 'navigate',\n 'title',\n 'table',\n 'column',\n 'summary',\n 'field',\n 'code',\n 'file',\n 'navigationBar',\n ],\n layouts: [],\n screenTemplates: [],\n dialogTemplates: [],\n themes: [],\n displayName: 'Core',\n description: 'The built-in fallback vocabulary every ui profile resolves against.',\n module: '@cratis/scene.react',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n\n/**\n * The `core` package as a loadable bundle.\n */\nexport const corePackage: ScenePackageBundle = {\n manifest: corePackageManifest,\n components: coreComponents,\n descriptors: coreDescriptors,\n};\n"],"names":["corePackageManifest","name","version","kind","PackageKind","ComponentLibrary","dependencies","components","layouts","screenTemplates","dialogTemplates","themes","displayName","description","module","license","licenseUrl","corePackage","manifest","coreComponents","descriptors","coreDescriptors"],"mappings":";;;;;;AAAA;AACA;AAOA;;;;;;UAOaA,mBAAAA,GAAoC;IAC7CC,IAAAA,EAAM,MAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,wBAAYC,gBAAgB;AAClCC,IAAAA,YAAAA,EAAc,EAAE;IAChBC,UAAAA,EAAY;AACR,QAAA,MAAA;AACA,QAAA,QAAA;AACA,QAAA,MAAA;AACA,QAAA,MAAA;AACA,QAAA,QAAA;AACA,QAAA,SAAA;AACA,QAAA,UAAA;AACA,QAAA,OAAA;AACA,QAAA,OAAA;AACA,QAAA,QAAA;AACA,QAAA,SAAA;AACA,QAAA,OAAA;AACA,QAAA,MAAA;AACA,QAAA,MAAA;AACA,QAAA;AACH,KAAA;AACDC,IAAAA,OAAAA,EAAS,EAAE;AACXC,IAAAA,eAAAA,EAAiB,EAAE;AACnBC,IAAAA,eAAAA,EAAiB,EAAE;AACnBC,IAAAA,MAAAA,EAAQ,EAAE;IACVC,WAAAA,EAAa,MAAA;IACbC,WAAAA,EAAa,qEAAA;IACbC,MAAAA,EAAQ,qBAAA;IACRC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;AAEA;;UAGaC,WAAAA,GAAkC;IAC3CC,QAAAA,EAAUlB,mBAAAA;IACVO,UAAAA,EAAYY,6BAAAA;IACZC,WAAAA,EAAaC;AACjB;;;"}
1
+ {"version":3,"file":"corePackage.js","sources":["../../../core/corePackage.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 { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle } from '../packages';\nimport { coreComponents } from './coreComponents';\nimport { coreDescriptors } from './coreDescriptors';\n\n/**\n * The `core` package's declaration. Every other package is loaded by a host that reads its manifest;\n * `core` ships inside the renderer itself, because Scene#3 guarantees a bare name always has somewhere to\n * resolve regardless of which packages a profile lists. It is still declared the same way as any other -\n * a package picker should be able to show it, and the dependency resolver should be able to reason about\n * it, without a special case.\n */\nexport const corePackageManifest: ScenePackage = {\n name: 'core',\n version: '1.0.0',\n kind: PackageKind.ComponentLibrary,\n dependencies: [],\n components: [\n 'text',\n 'button',\n 'card',\n 'data',\n 'action',\n 'section',\n 'navigate',\n 'title',\n 'table',\n 'column',\n 'summary',\n 'field',\n 'code',\n 'file',\n 'navigationBar',\n 'outlet',\n ],\n layouts: [],\n screenTemplates: [],\n dialogTemplates: [],\n themes: [],\n displayName: 'Core',\n description: 'The built-in fallback vocabulary every ui profile resolves against.',\n module: '@cratis/scene.react',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n\n/**\n * The `core` package as a loadable bundle.\n */\nexport const corePackage: ScenePackageBundle = {\n manifest: corePackageManifest,\n components: coreComponents,\n descriptors: coreDescriptors,\n};\n"],"names":["corePackageManifest","name","version","kind","PackageKind","ComponentLibrary","dependencies","components","layouts","screenTemplates","dialogTemplates","themes","displayName","description","module","license","licenseUrl","corePackage","manifest","coreComponents","descriptors","coreDescriptors"],"mappings":";;;;;;AAAA;AACA;AAOA;;;;;;UAOaA,mBAAAA,GAAoC;IAC7CC,IAAAA,EAAM,MAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,wBAAYC,gBAAgB;AAClCC,IAAAA,YAAAA,EAAc,EAAE;IAChBC,UAAAA,EAAY;AACR,QAAA,MAAA;AACA,QAAA,QAAA;AACA,QAAA,MAAA;AACA,QAAA,MAAA;AACA,QAAA,QAAA;AACA,QAAA,SAAA;AACA,QAAA,UAAA;AACA,QAAA,OAAA;AACA,QAAA,OAAA;AACA,QAAA,QAAA;AACA,QAAA,SAAA;AACA,QAAA,OAAA;AACA,QAAA,MAAA;AACA,QAAA,MAAA;AACA,QAAA,eAAA;AACA,QAAA;AACH,KAAA;AACDC,IAAAA,OAAAA,EAAS,EAAE;AACXC,IAAAA,eAAAA,EAAiB,EAAE;AACnBC,IAAAA,eAAAA,EAAiB,EAAE;AACnBC,IAAAA,MAAAA,EAAQ,EAAE;IACVC,WAAAA,EAAa,MAAA;IACbC,WAAAA,EAAa,qEAAA;IACbC,MAAAA,EAAQ,qBAAA;IACRC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;AAEA;;UAGaC,WAAAA,GAAkC;IAC3CC,QAAAA,EAAUlB,mBAAAA;IACVO,UAAAA,EAAYY,6BAAAA;IACZC,WAAAA,EAAaC;AACjB;;;"}
package/dist/cjs/index.js CHANGED
@@ -32,6 +32,10 @@ var navigationRouteKey = require('./navigation/navigationRouteKey.js');
32
32
  var resolveDestination = require('./navigation/resolveDestination.js');
33
33
  var sceneRoutesFrom = require('./navigation/sceneRoutesFrom.js');
34
34
  var useSceneHistoryNavigation = require('./navigation/useSceneHistoryNavigation.js');
35
+ var CoreOutlet = require('./navigation/CoreOutlet.js');
36
+ var SceneOutletContext = require('./navigation/SceneOutletContext.js');
37
+ var collectOutletOwners = require('./navigation/collectOutletOwners.js');
38
+ var placeInOutlet = require('./navigation/placeInOutlet.js');
35
39
  var IconAdapterRegistry = require('./icons/IconAdapterRegistry.js');
36
40
  var IconAdapterContext = require('./icons/IconAdapterContext.js');
37
41
  var useIconGlyph = require('./icons/useIconGlyph.js');
@@ -101,6 +105,7 @@ exports.corePackage = corePackage.corePackage;
101
105
  exports.corePackageManifest = corePackage.corePackageManifest;
102
106
  exports.NavBar = NavBar.NavBar;
103
107
  exports.extractNavigationItem = extractNavigationItem.extractNavigationItem;
108
+ exports.SceneNavigationContextInternal = SceneNavigationContext.SceneNavigationContextInternal;
104
109
  exports.SceneNavigationProvider = SceneNavigationContext.SceneNavigationProvider;
105
110
  exports.useSceneNavigation = SceneNavigationContext.useSceneNavigation;
106
111
  exports.SceneNavigationHost = SceneNavigationHost.SceneNavigationHost;
@@ -114,6 +119,12 @@ exports.navigationRouteKey = navigationRouteKey.navigationRouteKey;
114
119
  exports.resolveDestination = resolveDestination.resolveDestination;
115
120
  exports.sceneRoutesFrom = sceneRoutesFrom.sceneRoutesFrom;
116
121
  exports.useSceneHistoryNavigation = useSceneHistoryNavigation.useSceneHistoryNavigation;
122
+ exports.CoreOutlet = CoreOutlet.CoreOutlet;
123
+ exports.SceneOutletContext = SceneOutletContext.SceneOutletContext;
124
+ exports.useSceneOutlets = SceneOutletContext.useSceneOutlets;
125
+ exports.collectOutletOwners = collectOutletOwners.collectOutletOwners;
126
+ exports.outletComponentName = collectOutletOwners.outletComponentName;
127
+ exports.placeInOutlet = placeInOutlet.placeInOutlet;
117
128
  exports.IconAdapterRegistry = IconAdapterRegistry.IconAdapterRegistry;
118
129
  exports.createIconAdapterRegistry = IconAdapterRegistry.createIconAdapterRegistry;
119
130
  exports.IconAdapterProvider = IconAdapterContext.IconAdapterProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var SceneElementView = require('../SceneElementView.js');
6
+ var SceneNavigationContext = require('./SceneNavigationContext.js');
7
+ var SceneOutletContext = require('./SceneOutletContext.js');
8
+
9
+ /**
10
+ * A nested outlet a screen declares: `core:outlet` with a `name`. Inside a navigation host it renders the
11
+ * screen placed in that outlet - which may declare outlets of its own, so composition nests to any depth -
12
+ * and nothing while the outlet is empty. Outside a navigation host it renders the empty region.
13
+ */ function CoreOutlet({ element }) {
14
+ const name = typeof element.properties.name === 'string' ? element.properties.name : '';
15
+ const navigation = react.useContext(SceneNavigationContext.SceneNavigationContextInternal);
16
+ const outlets = SceneOutletContext.useSceneOutlets();
17
+ const placed = navigation?.outlets[name];
18
+ const screen = placed && outlets ? outlets.screens[placed] : undefined;
19
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
20
+ "data-scene-outlet": name,
21
+ "data-scene-outlet-screen": placed,
22
+ children: screen && outlets && /*#__PURE__*/ jsxRuntime.jsx(SceneElementView.SceneElementView, {
23
+ element: screen,
24
+ registry: outlets.registry,
25
+ dataContext: navigation?.bindingScope.dataContext,
26
+ queryResults: navigation?.bindingScope.queryResults
27
+ })
28
+ });
29
+ }
30
+
31
+ exports.CoreOutlet = CoreOutlet;
32
+ //# sourceMappingURL=CoreOutlet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoreOutlet.js","sources":["../../../navigation/CoreOutlet.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 { useContext } from 'react';\nimport { RegisteredComponentProps } from '../renderer/ComponentRegistry';\nimport { SceneElementView } from '../SceneElementView';\nimport { SceneNavigationContextInternal } from './SceneNavigationContext';\nimport { useSceneOutlets } from './SceneOutletContext';\n\n/**\n * A nested outlet a screen declares: `core:outlet` with a `name`. Inside a navigation host it renders the\n * screen placed in that outlet - which may declare outlets of its own, so composition nests to any depth -\n * and nothing while the outlet is empty. Outside a navigation host it renders the empty region.\n */\nexport function CoreOutlet({ element }: RegisteredComponentProps) {\n const name = typeof element.properties.name === 'string' ? element.properties.name : '';\n const navigation = useContext(SceneNavigationContextInternal);\n const outlets = useSceneOutlets();\n const placed = navigation?.outlets[name];\n const screen = placed && outlets ? outlets.screens[placed] : undefined;\n\n return <div data-scene-outlet={name} data-scene-outlet-screen={placed}>\n {screen && outlets && <SceneElementView element={screen} registry={outlets.registry}\n dataContext={navigation?.bindingScope.dataContext} queryResults={navigation?.bindingScope.queryResults} />}\n </div>;\n}\n"],"names":["CoreOutlet","element","name","properties","navigation","useContext","SceneNavigationContextInternal","outlets","useSceneOutlets","placed","screen","screens","undefined","_jsx","div","data-scene-outlet","data-scene-outlet-screen","SceneElementView","registry","dataContext","bindingScope","queryResults"],"mappings":";;;;;;;;AASA;;;;AAIC,IACM,SAASA,UAAAA,CAAW,EAAEC,OAAO,EAA4B,EAAA;AAC5D,IAAA,MAAMC,IAAAA,GAAO,OAAOD,OAAAA,CAAQE,UAAU,CAACD,IAAI,KAAK,QAAA,GAAWD,OAAAA,CAAQE,UAAU,CAACD,IAAI,GAAG,EAAA;AACrF,IAAA,MAAME,aAAaC,gBAAAA,CAAWC,qDAAAA,CAAAA;AAC9B,IAAA,MAAMC,OAAAA,GAAUC,kCAAAA,EAAAA;AAChB,IAAA,MAAMC,MAAAA,GAASL,UAAAA,EAAYG,OAAO,CAACL,IAAAA,CAAK;AACxC,IAAA,MAAMQ,SAASD,MAAAA,IAAUF,OAAAA,GAAUA,QAAQI,OAAO,CAACF,OAAO,GAAGG,SAAAA;AAE7D,IAAA,qBAAOC,cAAA,CAACC,KAAAA,EAAAA;QAAIC,mBAAAA,EAAmBb,IAAAA;QAAMc,0BAAAA,EAA0BP,MAAAA;AAC1DC,QAAAA,QAAAA,EAAAA,MAAAA,IAAUH,yBAAWM,cAAA,CAACI,iCAAAA,EAAAA;YAAiBhB,OAAAA,EAASS,MAAAA;AAAQQ,YAAAA,QAAAA,EAAUX,QAAQW,QAAQ;AAC/EC,YAAAA,WAAAA,EAAaf,YAAYgB,YAAAA,CAAaD,WAAAA;AAAaE,YAAAA,YAAAA,EAAcjB,YAAYgB,YAAAA,CAAaC;;;AAEtG;;"}
@@ -4,6 +4,7 @@ var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
 
6
6
  const Context = /*#__PURE__*/ react.createContext(undefined);
7
+ /** The navigation context itself, for components that render outside a host as well as inside one. */ const SceneNavigationContextInternal = Context;
7
8
  function SceneNavigationProvider({ value, children }) {
8
9
  return /*#__PURE__*/ jsxRuntime.jsx(Context.Provider, {
9
10
  value: value,
@@ -16,6 +17,7 @@ function useSceneNavigation() {
16
17
  return context;
17
18
  }
18
19
 
20
+ exports.SceneNavigationContextInternal = SceneNavigationContextInternal;
19
21
  exports.SceneNavigationProvider = SceneNavigationProvider;
20
22
  exports.useSceneNavigation = useSceneNavigation;
21
23
  //# sourceMappingURL=SceneNavigationContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SceneNavigationContext.js","sources":["../../../navigation/SceneNavigationContext.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 { BindingScope } from '@cratis/scene.engine';\nimport { DestinationReference } from '@cratis/scene.model';\nimport { DestinationResolution } from './DestinationResolution';\nimport { DialogResult } from './DialogResult';\n\nexport interface SceneNavigationContextValue {\n currentScreen: string;\n currentUrl?: string;\n currentOutlet?: string;\n currentDialog?: string;\n\n /** The route parameters of the current entry - from the destination that opened it, or the deep link. */\n currentParameters: Record<string, string>;\n\n /** What the last dialog returned when it closed. */\n dialogResult?: DialogResult;\n\n /** A deep link that matched no route; the host fell back to its initial screen. */\n unresolvedUrl?: string;\n bindingScope: BindingScope;\n navigate(destination: DestinationReference): DestinationResolution;\n\n /** Closes the open dialog, returning to the entry that opened it, and records its result. */\n closeDialog(result?: unknown): void;\n\n /** Goes back one history entry. */\n back(): void;\n}\n\nconst Context = createContext<SceneNavigationContextValue | undefined>(undefined);\n\nexport interface SceneNavigationProviderProps {\n value: SceneNavigationContextValue;\n children: ReactNode;\n}\n\nexport function SceneNavigationProvider({ value, children }: SceneNavigationProviderProps) {\n return <Context.Provider value={value}>{children}</Context.Provider>;\n}\n\nexport function useSceneNavigation(): SceneNavigationContextValue {\n const context = useContext(Context);\n if (!context) throw new Error('No Scene navigation context is available.');\n return context;\n}\n"],"names":["Context","createContext","undefined","SceneNavigationProvider","value","children","_jsx","Provider","useSceneNavigation","context","useContext","Error"],"mappings":";;;;;AAiCA,MAAMA,wBAAUC,mBAAAA,CAAuDC,SAAAA,CAAAA;AAOhE,SAASC,uBAAAA,CAAwB,EAAEC,KAAK,EAAEC,QAAQ,EAAgC,EAAA;IACrF,qBAAOC,cAAA,CAACN,QAAQO,QAAQ,EAAA;QAACH,KAAAA,EAAOA,KAAAA;AAAQC,QAAAA,QAAAA,EAAAA;;AAC5C;AAEO,SAASG,kBAAAA,GAAAA;AACZ,IAAA,MAAMC,UAAUC,gBAAAA,CAAWV,OAAAA,CAAAA;AAC3B,IAAA,IAAI,CAACS,OAAAA,EAAS,MAAM,IAAIE,KAAAA,CAAM,2CAAA,CAAA;IAC9B,OAAOF,OAAAA;AACX;;;"}
1
+ {"version":3,"file":"SceneNavigationContext.js","sources":["../../../navigation/SceneNavigationContext.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 { BindingScope } from '@cratis/scene.engine';\nimport { DestinationReference } from '@cratis/scene.model';\nimport { DestinationResolution } from './DestinationResolution';\nimport { DialogResult } from './DialogResult';\n\nexport interface SceneNavigationContextValue {\n /** The screen the last navigation opened. */\n currentScreen: string;\n\n /** The screen in the primary region. */\n primaryScreen: string;\n\n /** Which screen each nested outlet shows, by outlet name. */\n outlets: Record<string, string>;\n currentUrl?: string;\n currentOutlet?: string;\n currentDialog?: string;\n\n /** The route parameters of the current entry - from the destination that opened it, or the deep link. */\n currentParameters: Record<string, string>;\n\n /** What the last dialog returned when it closed. */\n dialogResult?: DialogResult;\n\n /** A deep link that matched no route; the host fell back to its initial screen. */\n unresolvedUrl?: string;\n bindingScope: BindingScope;\n navigate(destination: DestinationReference): DestinationResolution;\n\n /** Closes the open dialog, returning to the entry that opened it, and records its result. */\n closeDialog(result?: unknown): void;\n\n /** Goes back one history entry. */\n back(): void;\n}\n\nconst Context = createContext<SceneNavigationContextValue | undefined>(undefined);\n\n/** The navigation context itself, for components that render outside a host as well as inside one. */\nexport const SceneNavigationContextInternal = Context;\n\nexport interface SceneNavigationProviderProps {\n value: SceneNavigationContextValue;\n children: ReactNode;\n}\n\nexport function SceneNavigationProvider({ value, children }: SceneNavigationProviderProps) {\n return <Context.Provider value={value}>{children}</Context.Provider>;\n}\n\nexport function useSceneNavigation(): SceneNavigationContextValue {\n const context = useContext(Context);\n if (!context) throw new Error('No Scene navigation context is available.');\n return context;\n}\n"],"names":["Context","createContext","undefined","SceneNavigationContextInternal","SceneNavigationProvider","value","children","_jsx","Provider","useSceneNavigation","context","useContext","Error"],"mappings":";;;;;AAwCA,MAAMA,wBAAUC,mBAAAA,CAAuDC,SAAAA,CAAAA;AAEvE,uGACO,MAAMC,8BAAAA,GAAiCH;AAOvC,SAASI,uBAAAA,CAAwB,EAAEC,KAAK,EAAEC,QAAQ,EAAgC,EAAA;IACrF,qBAAOC,cAAA,CAACP,QAAQQ,QAAQ,EAAA;QAACH,KAAAA,EAAOA,KAAAA;AAAQC,QAAAA,QAAAA,EAAAA;;AAC5C;AAEO,SAASG,kBAAAA,GAAAA;AACZ,IAAA,MAAMC,UAAUC,gBAAAA,CAAWX,OAAAA,CAAAA;AAC3B,IAAA,IAAI,CAACU,OAAAA,EAAS,MAAM,IAAIE,KAAAA,CAAM,2CAAA,CAAA;IAC9B,OAAOF,OAAAA;AACX;;;;"}
@@ -6,10 +6,14 @@ var SceneElementView = require('../SceneElementView.js');
6
6
  var createMemorySceneHistory = require('./createMemorySceneHistory.js');
7
7
  var SceneNavigationContext = require('./SceneNavigationContext.js');
8
8
  var sceneRoutesFrom = require('./sceneRoutesFrom.js');
9
+ var collectOutletOwners = require('./collectOutletOwners.js');
10
+ var SceneOutletContext = require('./SceneOutletContext.js');
9
11
  var useSceneHistoryNavigation = require('./useSceneHistoryNavigation.js');
10
12
 
11
13
  /**
12
- * Executes Scene destinations against an in-memory rendered hierarchy: screen routes replace outlets,
14
+ * Executes Scene destinations against an in-memory rendered hierarchy: a destination into a nested outlet -
15
+ * one a screen declares with `core:outlet` - places its screen there and keeps the screens above it, to any
16
+ * depth; any other screen route replaces the primary region,
13
17
  * dialog destinations render dialog content over the screen that opened them, and external destinations
14
18
  * only report their resolved action. Every navigation is a history entry.
15
19
  */ function SceneNavigationHost({ screens, dialogs = {}, initialScreen, registry, bindingScope = {}, history, destinations, routes }) {
@@ -19,37 +23,50 @@ var useSceneHistoryNavigation = require('./useSceneHistoryNavigation.js');
19
23
  routes,
20
24
  screens
21
25
  ]);
22
- const value = useSceneHistoryNavigation.useSceneHistoryNavigation(history ?? memoryHistory, routeTable, initialScreen, bindingScope);
23
- const screen = screens[value.currentScreen];
26
+ const outletOwners = react.useMemo(()=>collectOutletOwners.collectOutletOwners(screens), [
27
+ screens
28
+ ]);
29
+ const value = useSceneHistoryNavigation.useSceneHistoryNavigation(history ?? memoryHistory, routeTable, initialScreen, bindingScope, outletOwners, destinations);
30
+ const outletContext = react.useMemo(()=>({
31
+ screens,
32
+ registry
33
+ }), [
34
+ registry,
35
+ screens
36
+ ]);
37
+ const screen = screens[value.primaryScreen];
24
38
  const dialog = value.currentDialog ? dialogs[value.currentDialog] : undefined;
25
- return /*#__PURE__*/ jsxRuntime.jsxs(SceneNavigationContext.SceneNavigationProvider, {
39
+ return /*#__PURE__*/ jsxRuntime.jsx(SceneNavigationContext.SceneNavigationProvider, {
26
40
  value: value,
27
- children: [
28
- /*#__PURE__*/ jsxRuntime.jsx("div", {
29
- "data-scene-outlet": value.currentOutlet ?? 'primary',
30
- "data-scene-url": value.currentUrl,
31
- children: screen && /*#__PURE__*/ jsxRuntime.jsx(SceneElementView.SceneElementView, {
32
- element: screen,
33
- registry: registry,
34
- dataContext: bindingScope.dataContext,
35
- queryResults: bindingScope.queryResults,
36
- componentOutputs: bindingScope.componentOutputs
37
- })
38
- }),
39
- dialog && /*#__PURE__*/ jsxRuntime.jsx("div", {
40
- role: "dialog",
41
- "aria-modal": "true",
42
- "aria-label": value.currentDialog,
43
- "data-scene-dialog": value.currentDialog,
44
- children: /*#__PURE__*/ jsxRuntime.jsx(SceneElementView.SceneElementView, {
45
- element: dialog,
46
- registry: registry,
47
- dataContext: bindingScope.dataContext,
48
- queryResults: bindingScope.queryResults,
49
- componentOutputs: bindingScope.componentOutputs
41
+ children: /*#__PURE__*/ jsxRuntime.jsxs(SceneOutletContext.SceneOutletContext.Provider, {
42
+ value: outletContext,
43
+ children: [
44
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
45
+ "data-scene-outlet": value.primaryScreen === value.currentScreen ? value.currentOutlet ?? 'primary' : 'primary',
46
+ "data-scene-url": value.currentUrl,
47
+ children: screen && /*#__PURE__*/ jsxRuntime.jsx(SceneElementView.SceneElementView, {
48
+ element: screen,
49
+ registry: registry,
50
+ dataContext: bindingScope.dataContext,
51
+ queryResults: bindingScope.queryResults,
52
+ componentOutputs: bindingScope.componentOutputs
53
+ })
54
+ }),
55
+ dialog && /*#__PURE__*/ jsxRuntime.jsx("div", {
56
+ role: "dialog",
57
+ "aria-modal": "true",
58
+ "aria-label": value.currentDialog,
59
+ "data-scene-dialog": value.currentDialog,
60
+ children: /*#__PURE__*/ jsxRuntime.jsx(SceneElementView.SceneElementView, {
61
+ element: dialog,
62
+ registry: registry,
63
+ dataContext: bindingScope.dataContext,
64
+ queryResults: bindingScope.queryResults,
65
+ componentOutputs: bindingScope.componentOutputs
66
+ })
50
67
  })
51
- })
52
- ]
68
+ ]
69
+ })
53
70
  });
54
71
  }
55
72
 
@@ -1 +1 @@
1
- {"version":3,"file":"SceneNavigationHost.js","sources":["../../../navigation/SceneNavigationHost.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 { useMemo, useState } from 'react';\nimport { BindingScope } from '@cratis/scene.engine';\nimport { DestinationReference, SceneElement } from '@cratis/scene.model';\nimport { SceneElementView } from '../SceneElementView';\nimport { ComponentRegistry } from '../renderer';\nimport { createMemorySceneHistory } from './createMemorySceneHistory';\nimport { SceneHistory } from './SceneHistory';\nimport { SceneNavigationProvider } from './SceneNavigationContext';\nimport { SceneRoute } from './SceneRoute';\nimport { sceneRoutesFrom } from './sceneRoutesFrom';\nimport { useSceneHistoryNavigation } from './useSceneHistoryNavigation';\n\nexport interface SceneNavigationHostProps {\n screens: Record<string, SceneElement>;\n dialogs?: Record<string, SceneElement>;\n initialScreen: string;\n registry: ComponentRegistry;\n bindingScope?: BindingScope;\n\n /**\n * Where entries are recorded. `createBrowserSceneHistory()` drives the address bar, so deep links,\n * refresh and back/forward work; the default is an in-memory history for embedded hosts.\n */\n history?: SceneHistory;\n\n /** The destinations the application navigates to, so their route overrides can be deep linked. */\n destinations?: DestinationReference[];\n\n /** An explicit route table, used instead of the one derived from `screens` and `destinations`. */\n routes?: SceneRoute[];\n}\n\n/**\n * Executes Scene destinations against an in-memory rendered hierarchy: screen routes replace outlets,\n * dialog destinations render dialog content over the screen that opened them, and external destinations\n * only report their resolved action. Every navigation is a history entry.\n */\nexport function SceneNavigationHost({ screens, dialogs = {}, initialScreen, registry, bindingScope = {}, history, destinations, routes }: SceneNavigationHostProps) {\n const [memoryHistory] = useState(() => createMemorySceneHistory());\n const routeTable = useMemo(() => routes ?? sceneRoutesFrom(Object.keys(screens), destinations), [destinations, routes, screens]);\n const value = useSceneHistoryNavigation(history ?? memoryHistory, routeTable, initialScreen, bindingScope);\n\n const screen = screens[value.currentScreen];\n const dialog = value.currentDialog ? dialogs[value.currentDialog] : undefined;\n\n return <SceneNavigationProvider value={value}>\n <div data-scene-outlet={value.currentOutlet ?? 'primary'} data-scene-url={value.currentUrl}>\n {screen && <SceneElementView element={screen} registry={registry} dataContext={bindingScope.dataContext} queryResults={bindingScope.queryResults} componentOutputs={bindingScope.componentOutputs} />}\n </div>\n {dialog && <div role='dialog' aria-modal='true' aria-label={value.currentDialog} data-scene-dialog={value.currentDialog}>\n <SceneElementView element={dialog} registry={registry} dataContext={bindingScope.dataContext} queryResults={bindingScope.queryResults} componentOutputs={bindingScope.componentOutputs} />\n </div>}\n </SceneNavigationProvider>;\n}\n"],"names":["SceneNavigationHost","screens","dialogs","initialScreen","registry","bindingScope","history","destinations","routes","memoryHistory","useState","createMemorySceneHistory","routeTable","useMemo","sceneRoutesFrom","Object","keys","value","useSceneHistoryNavigation","screen","currentScreen","dialog","currentDialog","undefined","_jsxs","SceneNavigationProvider","_jsx","div","data-scene-outlet","currentOutlet","data-scene-url","currentUrl","SceneElementView","element","dataContext","queryResults","componentOutputs","role","aria-modal","aria-label","data-scene-dialog"],"mappings":";;;;;;;;;;AAmCA;;;;IAKO,SAASA,mBAAAA,CAAoB,EAAEC,OAAO,EAAEC,OAAAA,GAAU,EAAE,EAAEC,aAAa,EAAEC,QAAQ,EAAEC,YAAAA,GAAe,EAAE,EAAEC,OAAO,EAAEC,YAAY,EAAEC,MAAM,EAA4B,EAAA;AAC9J,IAAA,MAAM,CAACC,aAAAA,CAAc,GAAGC,cAAAA,CAAS,IAAMC,iDAAAA,EAAAA,CAAAA;IACvC,MAAMC,UAAAA,GAAaC,cAAQ,IAAML,MAAAA,IAAUM,gCAAgBC,MAAAA,CAAOC,IAAI,CAACf,OAAAA,CAAAA,EAAUM,YAAAA,CAAAA,EAAe;AAACA,QAAAA,YAAAA;AAAcC,QAAAA,MAAAA;AAAQP,QAAAA;AAAQ,KAAA,CAAA;AAC/H,IAAA,MAAMgB,KAAAA,GAAQC,mDAAAA,CAA0BZ,OAAAA,IAAWG,aAAAA,EAAeG,YAAYT,aAAAA,EAAeE,YAAAA,CAAAA;AAE7F,IAAA,MAAMc,MAAAA,GAASlB,OAAO,CAACgB,KAAAA,CAAMG,aAAa,CAAC;IAC3C,MAAMC,MAAAA,GAASJ,MAAMK,aAAa,GAAGpB,OAAO,CAACe,KAAAA,CAAMK,aAAa,CAAC,GAAGC,SAAAA;AAEpE,IAAA,qBAAOC,eAAA,CAACC,8CAAAA,EAAAA;QAAwBR,KAAAA,EAAOA,KAAAA;;0BACnCS,cAAA,CAACC,KAAAA,EAAAA;gBAAIC,mBAAAA,EAAmBX,KAAAA,CAAMY,aAAa,IAAI,SAAA;AAAWC,gBAAAA,gBAAAA,EAAgBb,MAAMc,UAAU;AACrFZ,gBAAAA,QAAAA,EAAAA,MAAAA,kBAAUO,cAAA,CAACM,iCAAAA,EAAAA;oBAAiBC,OAAAA,EAASd,MAAAA;oBAAQf,QAAAA,EAAUA,QAAAA;AAAU8B,oBAAAA,WAAAA,EAAa7B,aAAa6B,WAAW;AAAEC,oBAAAA,YAAAA,EAAc9B,aAAa8B,YAAY;AAAEC,oBAAAA,gBAAAA,EAAkB/B,aAAa+B;;;AAEpLf,YAAAA,MAAAA,kBAAUK,cAAA,CAACC,KAAAA,EAAAA;gBAAIU,IAAAA,EAAK,QAAA;gBAASC,YAAAA,EAAW,MAAA;AAAOC,gBAAAA,YAAAA,EAAYtB,MAAMK,aAAa;AAAEkB,gBAAAA,mBAAAA,EAAmBvB,MAAMK,aAAa;AACnH,gBAAA,QAAA,gBAAAI,cAAA,CAACM,iCAAAA,EAAAA;oBAAiBC,OAAAA,EAASZ,MAAAA;oBAAQjB,QAAAA,EAAUA,QAAAA;AAAU8B,oBAAAA,WAAAA,EAAa7B,aAAa6B,WAAW;AAAEC,oBAAAA,YAAAA,EAAc9B,aAAa8B,YAAY;AAAEC,oBAAAA,gBAAAA,EAAkB/B,aAAa+B;;;;;AAGlL;;"}
1
+ {"version":3,"file":"SceneNavigationHost.js","sources":["../../../navigation/SceneNavigationHost.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 { useMemo, useState } from 'react';\nimport { BindingScope } from '@cratis/scene.engine';\nimport { DestinationReference, SceneElement } from '@cratis/scene.model';\nimport { SceneElementView } from '../SceneElementView';\nimport { ComponentRegistry } from '../renderer';\nimport { createMemorySceneHistory } from './createMemorySceneHistory';\nimport { SceneHistory } from './SceneHistory';\nimport { SceneNavigationProvider } from './SceneNavigationContext';\nimport { SceneRoute } from './SceneRoute';\nimport { sceneRoutesFrom } from './sceneRoutesFrom';\nimport { collectOutletOwners } from './collectOutletOwners';\nimport { SceneOutletContext } from './SceneOutletContext';\nimport { useSceneHistoryNavigation } from './useSceneHistoryNavigation';\n\nexport interface SceneNavigationHostProps {\n screens: Record<string, SceneElement>;\n dialogs?: Record<string, SceneElement>;\n initialScreen: string;\n registry: ComponentRegistry;\n bindingScope?: BindingScope;\n\n /**\n * Where entries are recorded. `createBrowserSceneHistory()` drives the address bar, so deep links,\n * refresh and back/forward work; the default is an in-memory history for embedded hosts.\n */\n history?: SceneHistory;\n\n /** The destinations the application navigates to, so their route overrides can be deep linked. */\n destinations?: DestinationReference[];\n\n /** An explicit route table, used instead of the one derived from `screens` and `destinations`. */\n routes?: SceneRoute[];\n}\n\n/**\n * Executes Scene destinations against an in-memory rendered hierarchy: a destination into a nested outlet -\n * one a screen declares with `core:outlet` - places its screen there and keeps the screens above it, to any\n * depth; any other screen route replaces the primary region,\n * dialog destinations render dialog content over the screen that opened them, and external destinations\n * only report their resolved action. Every navigation is a history entry.\n */\nexport function SceneNavigationHost({ screens, dialogs = {}, initialScreen, registry, bindingScope = {}, history, destinations, routes }: SceneNavigationHostProps) {\n const [memoryHistory] = useState(() => createMemorySceneHistory());\n const routeTable = useMemo(() => routes ?? sceneRoutesFrom(Object.keys(screens), destinations), [destinations, routes, screens]);\n const outletOwners = useMemo(() => collectOutletOwners(screens), [screens]);\n const value = useSceneHistoryNavigation(history ?? memoryHistory, routeTable, initialScreen, bindingScope, outletOwners, destinations);\n const outletContext = useMemo(() => ({ screens, registry }), [registry, screens]);\n\n const screen = screens[value.primaryScreen];\n const dialog = value.currentDialog ? dialogs[value.currentDialog] : undefined;\n\n return <SceneNavigationProvider value={value}><SceneOutletContext.Provider value={outletContext}>\n <div data-scene-outlet={value.primaryScreen === value.currentScreen ? value.currentOutlet ?? 'primary' : 'primary'} data-scene-url={value.currentUrl}>\n {screen && <SceneElementView element={screen} registry={registry} dataContext={bindingScope.dataContext} queryResults={bindingScope.queryResults} componentOutputs={bindingScope.componentOutputs} />}\n </div>\n {dialog && <div role='dialog' aria-modal='true' aria-label={value.currentDialog} data-scene-dialog={value.currentDialog}>\n <SceneElementView element={dialog} registry={registry} dataContext={bindingScope.dataContext} queryResults={bindingScope.queryResults} componentOutputs={bindingScope.componentOutputs} />\n </div>}\n </SceneOutletContext.Provider></SceneNavigationProvider>;\n}\n"],"names":["SceneNavigationHost","screens","dialogs","initialScreen","registry","bindingScope","history","destinations","routes","memoryHistory","useState","createMemorySceneHistory","routeTable","useMemo","sceneRoutesFrom","Object","keys","outletOwners","collectOutletOwners","value","useSceneHistoryNavigation","outletContext","screen","primaryScreen","dialog","currentDialog","undefined","_jsx","SceneNavigationProvider","_jsxs","SceneOutletContext","Provider","div","data-scene-outlet","currentScreen","currentOutlet","data-scene-url","currentUrl","SceneElementView","element","dataContext","queryResults","componentOutputs","role","aria-modal","aria-label","data-scene-dialog"],"mappings":";;;;;;;;;;;;AAqCA;;;;;;IAOO,SAASA,mBAAAA,CAAoB,EAAEC,OAAO,EAAEC,OAAAA,GAAU,EAAE,EAAEC,aAAa,EAAEC,QAAQ,EAAEC,YAAAA,GAAe,EAAE,EAAEC,OAAO,EAAEC,YAAY,EAAEC,MAAM,EAA4B,EAAA;AAC9J,IAAA,MAAM,CAACC,aAAAA,CAAc,GAAGC,cAAAA,CAAS,IAAMC,iDAAAA,EAAAA,CAAAA;IACvC,MAAMC,UAAAA,GAAaC,cAAQ,IAAML,MAAAA,IAAUM,gCAAgBC,MAAAA,CAAOC,IAAI,CAACf,OAAAA,CAAAA,EAAUM,YAAAA,CAAAA,EAAe;AAACA,QAAAA,YAAAA;AAAcC,QAAAA,MAAAA;AAAQP,QAAAA;AAAQ,KAAA,CAAA;AAC/H,IAAA,MAAMgB,YAAAA,GAAeJ,aAAAA,CAAQ,IAAMK,uCAAAA,CAAoBjB,OAAAA,CAAAA,EAAU;AAACA,QAAAA;AAAQ,KAAA,CAAA;AAC1E,IAAA,MAAMkB,QAAQC,mDAAAA,CAA0Bd,OAAAA,IAAWG,eAAeG,UAAAA,EAAYT,aAAAA,EAAeE,cAAcY,YAAAA,EAAcV,YAAAA,CAAAA;IACzH,MAAMc,aAAAA,GAAgBR,aAAAA,CAAQ,KAAO;AAA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A,EAAUA,QAAAA;AAAUoC,wBAAAA,WAAAA,EAAanC,aAAamC,WAAW;AAAEC,wBAAAA,YAAAA,EAAcpC,aAAaoC,YAAY;AAAEC,wBAAAA,gBAAAA,EAAkBrC,aAAaqC;;;;;;AAGlL;;"}
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
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
+ const SceneOutletContext = /*#__PURE__*/ react.createContext(undefined);
8
+ /** The screens and registry of the enclosing navigation host, or undefined outside one. */ function useSceneOutlets() {
9
+ return react.useContext(SceneOutletContext);
10
+ }
11
+
12
+ exports.SceneOutletContext = SceneOutletContext;
13
+ exports.useSceneOutlets = useSceneOutlets;
14
+ //# sourceMappingURL=SceneOutletContext.js.map
@@ -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,mBAAAA,CAAmDC,SAAAA;AAErF,4FACO,SAASC,eAAAA,GAAAA;AACZ,IAAA,OAAOC,gBAAAA,CAAWJ,kBAAAA,CAAAA;AACtB;;;"}
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /** The registry key of the component that declares a nested outlet. */ const outletComponentName = 'core:outlet';
6
+ /**
7
+ * Which screen declares each nested outlet: every `core:outlet` element, by its `name`, mapped to the screen
8
+ * whose tree contains it. A screen that declares an outlet another screen also declares keeps the first one,
9
+ * in screen order - the same rule navigation diagnostics report as a duplicate outlet.
10
+ */ function collectOutletOwners(screens) {
11
+ const owners = {};
12
+ for (const [screen, element] of Object.entries(screens)){
13
+ for (const outlet of outletNames(element)){
14
+ if (!(outlet in owners)) owners[outlet] = screen;
15
+ }
16
+ }
17
+ return owners;
18
+ }
19
+ function outletNames(element) {
20
+ const node = element;
21
+ const own = node.componentName === outletComponentName && typeof node.properties?.name === 'string' ? [
22
+ node.properties.name
23
+ ] : [];
24
+ const children = [
25
+ ...Object.values(node.slots ?? {}).flat(),
26
+ ...Array.isArray(node.children) ? node.children : []
27
+ ];
28
+ return [
29
+ ...own,
30
+ ...children.flatMap(outletNames)
31
+ ];
32
+ }
33
+
34
+ exports.collectOutletOwners = collectOutletOwners;
35
+ exports.outletComponentName = outletComponentName;
36
+ //# 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;;;"}
@@ -0,0 +1,65 @@
1
+ 'use strict';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /** The most levels of nesting a placement follows before it stops, so a cyclic model cannot loop forever. */ const maximumDepth = 32;
6
+ /**
7
+ * Places a screen, recursively composing nested outlets.
8
+ *
9
+ * When `outlet` is a nested outlet - one a screen declares with `core:outlet` - the screen goes into it, and
10
+ * the screen that declares it is placed first: where it already is, or, when it is not on the page, where a
11
+ * known destination puts it, up to the primary region. Outlets declared by screens that are no longer on the
12
+ * page are dropped. Any other outlet replaces the primary region and clears every nested placement.
13
+ */ function placeInOutlet(current, screen, outlet, owners, destinations = []) {
14
+ const primary = current.primary ?? current.screen;
15
+ const placements = {
16
+ ...current.outlets ?? {}
17
+ };
18
+ let root = primary;
19
+ let target = {
20
+ screen,
21
+ outlet
22
+ };
23
+ for(let depth = 0; target && depth < maximumDepth; depth++){
24
+ const owner = target.outlet === undefined ? undefined : owners[target.outlet];
25
+ if (owner === undefined) {
26
+ root = target.screen;
27
+ break;
28
+ }
29
+ placements[target.outlet] = target.screen;
30
+ if (isOnPage(owner, root, placements, owners)) break;
31
+ target = {
32
+ screen: owner,
33
+ outlet: destinations.find((destination)=>destination.screen === owner && destination.outlet)?.outlet
34
+ };
35
+ }
36
+ return {
37
+ primary: root,
38
+ outlets: reachable(root, placements, owners)
39
+ };
40
+ }
41
+ /** Whether a screen is the root or shown in an outlet reachable from it. */ function isOnPage(screen, root, placements, owners) {
42
+ return screen === root || Object.values(reachable(root, placements, owners)).includes(screen);
43
+ }
44
+ /** Only the placements reachable from the root through the outlets each placed screen declares. */ function reachable(root, placements, owners) {
45
+ const kept = {};
46
+ const pending = [
47
+ root
48
+ ];
49
+ const seen = new Set();
50
+ while(pending.length > 0){
51
+ const screen = pending.shift();
52
+ if (seen.has(screen)) continue;
53
+ seen.add(screen);
54
+ for (const [outlet, placed] of Object.entries(placements)){
55
+ if (owners[outlet] === screen) {
56
+ kept[outlet] = placed;
57
+ pending.push(placed);
58
+ }
59
+ }
60
+ }
61
+ return kept;
62
+ }
63
+
64
+ exports.placeInOutlet = placeInOutlet;
65
+ //# 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,IAAU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