@cratis/scene.blueprint.default 4.40.0 → 4.42.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 (251) hide show
  1. package/ComponentName.ts +9 -0
  2. package/defaultBlueprint.ts +1 -0
  3. package/defaultBlueprintComponents.ts +4 -1
  4. package/dist/cjs/ComponentName.js +3 -0
  5. package/dist/cjs/ComponentName.js.map +1 -1
  6. package/dist/cjs/defaultBlueprint.js +20 -1
  7. package/dist/cjs/defaultBlueprint.js.map +1 -1
  8. package/dist/cjs/defaultBlueprintComponentMetadata.js +11 -0
  9. package/dist/cjs/defaultBlueprintComponentMetadata.js.map +1 -1
  10. package/dist/cjs/defaultBlueprintComponents.js +17 -0
  11. package/dist/cjs/defaultBlueprintComponents.js.map +1 -1
  12. package/dist/cjs/foundation/ActionButton.js.map +1 -1
  13. package/dist/cjs/foundation/ActionButtonControl.js +46 -0
  14. package/dist/cjs/foundation/ActionButtonControl.js.map +1 -0
  15. package/dist/cjs/foundation/DialogFrame.js +196 -0
  16. package/dist/cjs/foundation/DialogFrame.js.map +1 -0
  17. package/dist/cjs/foundation/FormScreenBody.js +13 -3
  18. package/dist/cjs/foundation/FormScreenBody.js.map +1 -1
  19. package/dist/cjs/foundation/Notice.js +51 -0
  20. package/dist/cjs/foundation/Notice.js.map +1 -0
  21. package/dist/cjs/foundation/formModel.js +1 -0
  22. package/dist/cjs/foundation/formModel.js.map +1 -1
  23. package/dist/cjs/foundation/foundationComponentMetadata.js +22 -0
  24. package/dist/cjs/foundation/foundationComponentMetadata.js.map +1 -1
  25. package/dist/cjs/foundation/foundationDescriptors.js +89 -0
  26. package/dist/cjs/foundation/foundationDescriptors.js.map +1 -1
  27. package/dist/cjs/foundation/foundationSamples.js +29 -0
  28. package/dist/cjs/foundation/foundationSamples.js.map +1 -1
  29. package/dist/cjs/foundation/foundationStrings.js +3 -1
  30. package/dist/cjs/foundation/foundationStrings.js.map +1 -1
  31. package/dist/cjs/foundation/templates/boardScreenTemplate.js +76 -0
  32. package/dist/cjs/foundation/templates/boardScreenTemplate.js.map +1 -0
  33. package/dist/cjs/foundation/templates/dashboardScreenTemplate.js +128 -0
  34. package/dist/cjs/foundation/templates/dashboardScreenTemplate.js.map +1 -0
  35. package/dist/cjs/foundation/templates/dialogTemplates.js +254 -0
  36. package/dist/cjs/foundation/templates/dialogTemplates.js.map +1 -0
  37. package/dist/cjs/foundation/templates/formScreenTemplate.js +71 -0
  38. package/dist/cjs/foundation/templates/formScreenTemplate.js.map +1 -0
  39. package/dist/cjs/foundation/templates/index.js +57 -0
  40. package/dist/cjs/foundation/templates/index.js.map +1 -0
  41. package/dist/cjs/foundation/templates/listScreenTemplate.js +124 -0
  42. package/dist/cjs/foundation/templates/listScreenTemplate.js.map +1 -0
  43. package/dist/cjs/foundation/templates/masterDetailScreenTemplate.js +79 -0
  44. package/dist/cjs/foundation/templates/masterDetailScreenTemplate.js.map +1 -0
  45. package/dist/cjs/foundation/templates/recordPageTemplate.js +137 -0
  46. package/dist/cjs/foundation/templates/recordPageTemplate.js.map +1 -0
  47. package/dist/cjs/foundation/templates/stateScreenTemplates.js +252 -0
  48. package/dist/cjs/foundation/templates/stateScreenTemplates.js.map +1 -0
  49. package/dist/cjs/foundation/templates/templateParts.js +38 -0
  50. package/dist/cjs/foundation/templates/templateParts.js.map +1 -0
  51. package/dist/cjs/foundation/templates/wizardScreenTemplate.js +95 -0
  52. package/dist/cjs/foundation/templates/wizardScreenTemplate.js.map +1 -0
  53. package/dist/cjs/foundation/templates/workspaceScreenTemplate.js +62 -0
  54. package/dist/cjs/foundation/templates/workspaceScreenTemplate.js.map +1 -0
  55. package/dist/cjs/gallery/GalleryDialogPreview.js +62 -0
  56. package/dist/cjs/gallery/GalleryDialogPreview.js.map +1 -0
  57. package/dist/cjs/gallery/GalleryScreenPreview.js +78 -4
  58. package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -1
  59. package/dist/cjs/gallery/applicationChrome.js +18 -1
  60. package/dist/cjs/gallery/applicationChrome.js.map +1 -1
  61. package/dist/cjs/gallery/composeScreen.js +5 -3
  62. package/dist/cjs/gallery/composeScreen.js.map +1 -1
  63. package/dist/cjs/gallery/dialogTemplates.js +41 -36
  64. package/dist/cjs/gallery/dialogTemplates.js.map +1 -1
  65. package/dist/cjs/gallery/screens.js +87 -3
  66. package/dist/cjs/gallery/screens.js.map +1 -1
  67. package/dist/cjs/index.js +61 -5
  68. package/dist/cjs/index.js.map +1 -1
  69. package/dist/esm/ComponentName.d.ts +3 -0
  70. package/dist/esm/ComponentName.d.ts.map +1 -1
  71. package/dist/esm/ComponentName.js +3 -0
  72. package/dist/esm/ComponentName.js.map +1 -1
  73. package/dist/esm/defaultBlueprint.d.ts.map +1 -1
  74. package/dist/esm/defaultBlueprint.js +20 -1
  75. package/dist/esm/defaultBlueprint.js.map +1 -1
  76. package/dist/esm/defaultBlueprintComponentMetadata.js +11 -0
  77. package/dist/esm/defaultBlueprintComponentMetadata.js.map +1 -1
  78. package/dist/esm/defaultBlueprintComponents.d.ts.map +1 -1
  79. package/dist/esm/defaultBlueprintComponents.js +17 -0
  80. package/dist/esm/defaultBlueprintComponents.js.map +1 -1
  81. package/dist/esm/foundation/ActionButton.d.ts +1 -1
  82. package/dist/esm/foundation/ActionButton.d.ts.map +1 -1
  83. package/dist/esm/foundation/ActionButton.js.map +1 -1
  84. package/dist/esm/foundation/ActionButtonControl.d.ts +3 -0
  85. package/dist/esm/foundation/ActionButtonControl.d.ts.map +1 -0
  86. package/dist/esm/foundation/ActionButtonControl.js +44 -0
  87. package/dist/esm/foundation/ActionButtonControl.js.map +1 -0
  88. package/dist/esm/foundation/DialogFrame.d.ts +14 -0
  89. package/dist/esm/foundation/DialogFrame.d.ts.map +1 -0
  90. package/dist/esm/foundation/DialogFrame.js +190 -0
  91. package/dist/esm/foundation/DialogFrame.js.map +1 -0
  92. package/dist/esm/foundation/FormScreenBody.d.ts.map +1 -1
  93. package/dist/esm/foundation/FormScreenBody.js +13 -3
  94. package/dist/esm/foundation/FormScreenBody.js.map +1 -1
  95. package/dist/esm/foundation/Notice.d.ts +3 -0
  96. package/dist/esm/foundation/Notice.d.ts.map +1 -0
  97. package/dist/esm/foundation/Notice.js +49 -0
  98. package/dist/esm/foundation/Notice.js.map +1 -0
  99. package/dist/esm/foundation/formModel.d.ts +2 -1
  100. package/dist/esm/foundation/formModel.d.ts.map +1 -1
  101. package/dist/esm/foundation/formModel.js +1 -0
  102. package/dist/esm/foundation/formModel.js.map +1 -1
  103. package/dist/esm/foundation/foundationComponentMetadata.d.ts.map +1 -1
  104. package/dist/esm/foundation/foundationComponentMetadata.js +22 -0
  105. package/dist/esm/foundation/foundationComponentMetadata.js.map +1 -1
  106. package/dist/esm/foundation/foundationDescriptors.d.ts.map +1 -1
  107. package/dist/esm/foundation/foundationDescriptors.js +89 -0
  108. package/dist/esm/foundation/foundationDescriptors.js.map +1 -1
  109. package/dist/esm/foundation/foundationSamples.d.ts.map +1 -1
  110. package/dist/esm/foundation/foundationSamples.js +29 -0
  111. package/dist/esm/foundation/foundationSamples.js.map +1 -1
  112. package/dist/esm/foundation/foundationStrings.d.ts +2 -0
  113. package/dist/esm/foundation/foundationStrings.d.ts.map +1 -1
  114. package/dist/esm/foundation/foundationStrings.js +3 -1
  115. package/dist/esm/foundation/foundationStrings.js.map +1 -1
  116. package/dist/esm/foundation/index.d.ts +4 -0
  117. package/dist/esm/foundation/index.d.ts.map +1 -1
  118. package/dist/esm/foundation/index.js +4 -0
  119. package/dist/esm/foundation/index.js.map +1 -1
  120. package/dist/esm/foundation/templates/boardScreenTemplate.d.ts +3 -0
  121. package/dist/esm/foundation/templates/boardScreenTemplate.d.ts.map +1 -0
  122. package/dist/esm/foundation/templates/boardScreenTemplate.js +74 -0
  123. package/dist/esm/foundation/templates/boardScreenTemplate.js.map +1 -0
  124. package/dist/esm/foundation/templates/dashboardScreenTemplate.d.ts +3 -0
  125. package/dist/esm/foundation/templates/dashboardScreenTemplate.d.ts.map +1 -0
  126. package/dist/esm/foundation/templates/dashboardScreenTemplate.js +126 -0
  127. package/dist/esm/foundation/templates/dashboardScreenTemplate.js.map +1 -0
  128. package/dist/esm/foundation/templates/dialogTemplates.d.ts +20 -0
  129. package/dist/esm/foundation/templates/dialogTemplates.d.ts.map +1 -0
  130. package/dist/esm/foundation/templates/dialogTemplates.js +243 -0
  131. package/dist/esm/foundation/templates/dialogTemplates.js.map +1 -0
  132. package/dist/esm/foundation/templates/formScreenTemplate.d.ts +3 -0
  133. package/dist/esm/foundation/templates/formScreenTemplate.d.ts.map +1 -0
  134. package/dist/esm/foundation/templates/formScreenTemplate.js +69 -0
  135. package/dist/esm/foundation/templates/formScreenTemplate.js.map +1 -0
  136. package/dist/esm/foundation/templates/index.d.ts +13 -0
  137. package/dist/esm/foundation/templates/index.d.ts.map +1 -0
  138. package/dist/esm/foundation/templates/index.js +27 -0
  139. package/dist/esm/foundation/templates/index.js.map +1 -0
  140. package/dist/esm/foundation/templates/listScreenTemplate.d.ts +3 -0
  141. package/dist/esm/foundation/templates/listScreenTemplate.d.ts.map +1 -0
  142. package/dist/esm/foundation/templates/listScreenTemplate.js +122 -0
  143. package/dist/esm/foundation/templates/listScreenTemplate.js.map +1 -0
  144. package/dist/esm/foundation/templates/masterDetailScreenTemplate.d.ts +3 -0
  145. package/dist/esm/foundation/templates/masterDetailScreenTemplate.d.ts.map +1 -0
  146. package/dist/esm/foundation/templates/masterDetailScreenTemplate.js +77 -0
  147. package/dist/esm/foundation/templates/masterDetailScreenTemplate.js.map +1 -0
  148. package/dist/esm/foundation/templates/recordPageTemplate.d.ts +3 -0
  149. package/dist/esm/foundation/templates/recordPageTemplate.d.ts.map +1 -0
  150. package/dist/esm/foundation/templates/recordPageTemplate.js +135 -0
  151. package/dist/esm/foundation/templates/recordPageTemplate.js.map +1 -0
  152. package/dist/esm/foundation/templates/stateScreenTemplates.d.ts +8 -0
  153. package/dist/esm/foundation/templates/stateScreenTemplates.d.ts.map +1 -0
  154. package/dist/esm/foundation/templates/stateScreenTemplates.js +245 -0
  155. package/dist/esm/foundation/templates/stateScreenTemplates.js.map +1 -0
  156. package/dist/esm/foundation/templates/templateParts.d.ts +6 -0
  157. package/dist/esm/foundation/templates/templateParts.d.ts.map +1 -0
  158. package/dist/esm/foundation/templates/templateParts.js +33 -0
  159. package/dist/esm/foundation/templates/templateParts.js.map +1 -0
  160. package/dist/esm/foundation/templates/wizardScreenTemplate.d.ts +3 -0
  161. package/dist/esm/foundation/templates/wizardScreenTemplate.d.ts.map +1 -0
  162. package/dist/esm/foundation/templates/wizardScreenTemplate.js +93 -0
  163. package/dist/esm/foundation/templates/wizardScreenTemplate.js.map +1 -0
  164. package/dist/esm/foundation/templates/workspaceScreenTemplate.d.ts +3 -0
  165. package/dist/esm/foundation/templates/workspaceScreenTemplate.d.ts.map +1 -0
  166. package/dist/esm/foundation/templates/workspaceScreenTemplate.js +60 -0
  167. package/dist/esm/foundation/templates/workspaceScreenTemplate.js.map +1 -0
  168. package/dist/esm/gallery/FoundationDialogs.stories.d.ts +35 -0
  169. package/dist/esm/gallery/FoundationDialogs.stories.d.ts.map +1 -0
  170. package/dist/esm/gallery/FoundationDialogs.stories.js +38 -0
  171. package/dist/esm/gallery/FoundationDialogs.stories.js.map +1 -0
  172. package/dist/esm/gallery/GalleryDialogPreview.d.ts +17 -0
  173. package/dist/esm/gallery/GalleryDialogPreview.d.ts.map +1 -0
  174. package/dist/esm/gallery/GalleryDialogPreview.js +59 -0
  175. package/dist/esm/gallery/GalleryDialogPreview.js.map +1 -0
  176. package/dist/esm/gallery/GalleryScreenPreview.d.ts +13 -2
  177. package/dist/esm/gallery/GalleryScreenPreview.d.ts.map +1 -1
  178. package/dist/esm/gallery/GalleryScreenPreview.js +77 -5
  179. package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -1
  180. package/dist/esm/gallery/applicationChrome.d.ts.map +1 -1
  181. package/dist/esm/gallery/applicationChrome.js +18 -1
  182. package/dist/esm/gallery/applicationChrome.js.map +1 -1
  183. package/dist/esm/gallery/composeScreen.d.ts.map +1 -1
  184. package/dist/esm/gallery/composeScreen.js +5 -3
  185. package/dist/esm/gallery/composeScreen.js.map +1 -1
  186. package/dist/esm/gallery/dialogTemplates.d.ts.map +1 -1
  187. package/dist/esm/gallery/dialogTemplates.js +42 -37
  188. package/dist/esm/gallery/dialogTemplates.js.map +1 -1
  189. package/dist/esm/gallery/index.d.ts +1 -0
  190. package/dist/esm/gallery/index.d.ts.map +1 -1
  191. package/dist/esm/gallery/index.js +1 -0
  192. package/dist/esm/gallery/index.js.map +1 -1
  193. package/dist/esm/gallery/screens.d.ts.map +1 -1
  194. package/dist/esm/gallery/screens.js +87 -3
  195. package/dist/esm/gallery/screens.js.map +1 -1
  196. package/dist/esm/index.js +17 -1
  197. package/dist/esm/index.js.map +1 -1
  198. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  199. package/foundation/ActionButton.tsx +1 -1
  200. package/foundation/ActionButtonControl.tsx +37 -0
  201. package/foundation/DialogFrame.tsx +138 -0
  202. package/foundation/FormScreenBody.tsx +6 -3
  203. package/foundation/Notice.tsx +33 -0
  204. package/foundation/formModel.ts +1 -0
  205. package/foundation/foundationComponentMetadata.ts +3 -0
  206. package/foundation/foundationDescriptors.ts +41 -0
  207. package/foundation/foundationSamples.ts +3 -0
  208. package/foundation/foundationStrings.ts +2 -0
  209. package/foundation/index.ts +4 -0
  210. package/foundation/templates/boardScreenTemplate.ts +28 -0
  211. package/foundation/templates/dashboardScreenTemplate.ts +37 -0
  212. package/foundation/templates/dialogTemplates.ts +114 -0
  213. package/foundation/templates/formScreenTemplate.ts +28 -0
  214. package/foundation/templates/index.ts +28 -0
  215. package/foundation/templates/listScreenTemplate.ts +37 -0
  216. package/foundation/templates/masterDetailScreenTemplate.ts +28 -0
  217. package/foundation/templates/recordPageTemplate.ts +36 -0
  218. package/foundation/templates/stateScreenTemplates.ts +107 -0
  219. package/foundation/templates/templateParts.ts +30 -0
  220. package/foundation/templates/wizardScreenTemplate.ts +33 -0
  221. package/foundation/templates/workspaceScreenTemplate.ts +27 -0
  222. package/gallery/FoundationDialogs.stories.tsx +74 -0
  223. package/gallery/GalleryDialogPreview.tsx +68 -0
  224. package/gallery/GalleryScreenPreview.tsx +64 -5
  225. package/gallery/applicationChrome.ts +6 -1
  226. package/gallery/composeScreen.ts +4 -2
  227. package/gallery/dialogTemplates.ts +22 -17
  228. package/gallery/index.ts +1 -0
  229. package/gallery/screens.ts +18 -2
  230. package/package.json +10 -8
  231. package/sampleData/foundation-en.json +661 -0
  232. package/shell/layout.css +219 -0
  233. package/thumbnails/BoardScreen.svg +15 -0
  234. package/thumbnails/ConfirmDialog.svg +12 -0
  235. package/thumbnails/DashboardScreen.svg +18 -0
  236. package/thumbnails/DetailDialog.svg +11 -0
  237. package/thumbnails/ErrorScreen.svg +11 -0
  238. package/thumbnails/FilterDialog.svg +16 -0
  239. package/thumbnails/ForbiddenScreen.svg +10 -0
  240. package/thumbnails/FormDialog.svg +12 -0
  241. package/thumbnails/FormScreen.svg +14 -0
  242. package/thumbnails/ListScreen.svg +16 -0
  243. package/thumbnails/LoginScreen.svg +12 -0
  244. package/thumbnails/LookupDialog.svg +13 -0
  245. package/thumbnails/MasterDetailScreen.svg +22 -0
  246. package/thumbnails/NotFoundScreen.svg +9 -0
  247. package/thumbnails/QuickCreateDialog.svg +12 -0
  248. package/thumbnails/RecordPage.svg +17 -0
  249. package/thumbnails/SideSheet.svg +13 -0
  250. package/thumbnails/WizardScreen.svg +16 -0
  251. package/thumbnails/WorkspaceScreen.svg +12 -0
@@ -4,9 +4,28 @@ var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
  var scene_react = require('@cratis/scene.react');
6
6
  var LayoutConfigProvider = require('../configuration/LayoutConfigProvider.js');
7
+ var ComponentName = require('../ComponentName.js');
7
8
  var defaultBlueprintComponents = require('../defaultBlueprintComponents.js');
9
+ require('../foundation/ComponentState.js');
10
+ require('../foundation/ActivityFeed.js');
11
+ require('../foundation/ApprovalChainStepper.js');
12
+ require('../foundation/foundationDescriptors.js');
13
+ require('../foundation/foundationComponentMetadata.js');
14
+ var foundationSamples = require('../foundation/foundationSamples.js');
15
+ var packageName = require('../packageName.js');
8
16
  var defaultBlueprintThemes = require('../themes/defaultBlueprintThemes.js');
9
17
  var LayoutThemeProvider = require('../themes/LayoutThemeProvider.js');
18
+ require('../foundation/templates/boardScreenTemplate.js');
19
+ require('../foundation/templates/dashboardScreenTemplate.js');
20
+ require('../foundation/templates/formScreenTemplate.js');
21
+ require('../foundation/templates/listScreenTemplate.js');
22
+ require('../foundation/templates/masterDetailScreenTemplate.js');
23
+ require('../foundation/templates/recordPageTemplate.js');
24
+ require('../foundation/templates/wizardScreenTemplate.js');
25
+ require('../foundation/templates/workspaceScreenTemplate.js');
26
+ require('../foundation/templates/templateParts.js');
27
+ require('../foundation/templates/dialogTemplates.js');
28
+ require('../foundation/templates/stateScreenTemplates.js');
10
29
  var composeScreen = require('./composeScreen.js');
11
30
  var previewProfile = require('./previewProfile.js');
12
31
  var resolveElementNames = require('./resolveElementNames.js');
@@ -24,6 +43,56 @@ var applyTemplatePreviewState = require('./applyTemplatePreviewState.js');
24
43
  ...scene_react.coreComponents,
25
44
  ...defaultBlueprintComponents.defaultBlueprintComponents
26
45
  };
46
+ /** Components that are chrome or controls rather than data-showing regions, and so do not own the five states. */ const withoutStates = new Set([
47
+ ComponentName.ComponentName.EmptyState,
48
+ ComponentName.ComponentName.TrendChip,
49
+ ComponentName.ComponentName.StatusChip,
50
+ ComponentName.ComponentName.BulkBar,
51
+ ComponentName.ComponentName.GlobalSearch,
52
+ ComponentName.ComponentName.NotificationsButton
53
+ ]);
54
+ /** Sets the forced state on every region that owns the five states, leaving chrome and controls as they are. */ function forceComponentState(element, forced) {
55
+ const external = element;
56
+ const children = element.children;
57
+ const slots = external.slots ? Object.fromEntries(Object.entries(external.slots).map(([slot, inner])=>[
58
+ slot,
59
+ inner.map((child)=>forceComponentState(child, forced))
60
+ ])) : undefined;
61
+ const bare = typeof external.componentName === 'string' ? external.componentName.substring(external.componentName.lastIndexOf(':') + 1) : undefined;
62
+ const owns = bare !== undefined && external.componentName.includes(packageName.defaultBlueprintName) && bare in foundationSamples.foundationSamples && foundationSamples.foundationSamples[bare].stateful && !withoutStates.has(bare);
63
+ return {
64
+ ...element,
65
+ ...owns ? {
66
+ properties: {
67
+ ...external.properties,
68
+ ...forced
69
+ }
70
+ } : {},
71
+ ...slots ? {
72
+ slots
73
+ } : {},
74
+ ...children ? {
75
+ children: children.map((child)=>forceComponentState(child, forced))
76
+ } : {}
77
+ };
78
+ }
79
+ /**
80
+ * A pack as the query results the templates bind to: one entry for each set, keyed by the set's shape name.
81
+ *
82
+ * The state is a property of the *data*, not of the template: Empty answers every query with no rows; Loading and Error withhold the answer, which is
83
+ * what a query that has not come back or has failed looks like to a component, so each shows its own skeleton or error exactly as it will in an application.
84
+ * The elements themselves are untouched, which is why the same template previews in every state with no per-template code.
85
+ */ const queryResultsOf = (pack, state = TemplatePreviewState.TemplatePreviewState.Populated)=>{
86
+ if (pack === undefined) return undefined;
87
+ if (state === TemplatePreviewState.TemplatePreviewState.Empty) return Object.fromEntries(pack.sets.map((set)=>[
88
+ set.shape,
89
+ []
90
+ ]));
91
+ return Object.fromEntries(pack.sets.map((set)=>[
92
+ set.shape,
93
+ set.rows
94
+ ]));
95
+ };
27
96
  /**
28
97
  * Boots one gallery screen through the real engine.
29
98
  *
@@ -36,16 +105,18 @@ var applyTemplatePreviewState = require('./applyTemplatePreviewState.js');
36
105
  * come out as `UnresolvedComponent`'s dashed red box naming what is missing. That is the designed outcome:
37
106
  * a preview of a blueprint against half a profile should look visibly incomplete rather than quietly
38
107
  * wrong.
39
- */ function GalleryScreenPreview({ screenName, initialConfig, themes = defaultBlueprintThemes.defaultBlueprintThemes, registry = galleryPreviewRegistry, state = TemplatePreviewState.TemplatePreviewState.Populated }) {
108
+ */ function GalleryScreenPreview({ screenName, initialConfig, themes = defaultBlueprintThemes.defaultBlueprintThemes, registry = galleryPreviewRegistry, state = TemplatePreviewState.TemplatePreviewState.Populated, pack, forceState }) {
40
109
  const element = react.useMemo(()=>{
41
110
  const screen = screens.galleryScreen(screenName);
42
111
  if (!screen) {
43
112
  throw new Error(`The gallery has no screen named '${screenName}'.`);
44
113
  }
45
- return applyTemplatePreviewState.applyTemplatePreviewState(resolveElementNames.resolveElementComponentNames(composeScreen.composeScreenElement(screen), previewProfile.galleryPreviewProfile, previewProfile.galleryComponentCatalog), state);
114
+ const resolved = applyTemplatePreviewState.applyTemplatePreviewState(resolveElementNames.resolveElementComponentNames(composeScreen.composeScreenElement(screen), previewProfile.galleryPreviewProfile, previewProfile.galleryComponentCatalog), state);
115
+ return forceState ? forceComponentState(resolved, forceState) : resolved;
46
116
  }, [
47
117
  screenName,
48
- state
118
+ state,
119
+ forceState
49
120
  ]);
50
121
  return /*#__PURE__*/ jsxRuntime.jsx(LayoutConfigProvider.LayoutConfigProvider, {
51
122
  initialConfig: initialConfig,
@@ -55,12 +126,15 @@ var applyTemplatePreviewState = require('./applyTemplatePreviewState.js');
55
126
  children: /*#__PURE__*/ jsxRuntime.jsx(scene_react.SceneElementView, {
56
127
  element: element,
57
128
  registry: registry,
58
- resolveBinding: ()=>undefined
129
+ resolveBinding: ()=>undefined,
130
+ queryResults: queryResultsOf(pack, state)
59
131
  })
60
132
  })
61
133
  });
62
134
  }
63
135
 
64
136
  exports.GalleryScreenPreview = GalleryScreenPreview;
137
+ exports.forceComponentState = forceComponentState;
65
138
  exports.galleryPreviewRegistry = galleryPreviewRegistry;
139
+ exports.queryResultsOf = queryResultsOf;
66
140
  //# sourceMappingURL=GalleryScreenPreview.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GalleryScreenPreview.js","sources":["../../../gallery/GalleryScreenPreview.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 } from 'react';\nimport { Theme } from '@cratis/scene.model';\nimport { ComponentRegistry, SceneElementView, coreComponents } from '@cratis/scene.react';\nimport { LayoutConfigProvider, LayoutConfigState } from '../configuration';\nimport { defaultBlueprintComponents } from '../defaultBlueprintComponents';\nimport { LayoutThemeProvider, defaultBlueprintThemes } from '../themes';\nimport { composeScreenElement } from './composeScreen';\nimport { galleryComponentCatalog, galleryPreviewProfile } from './previewProfile';\nimport { resolveElementComponentNames } from './resolveElementNames';\nimport { galleryScreen } from './screens';\nimport { TemplatePreviewState } from './TemplatePreviewState';\nimport { applyTemplatePreviewState } from './applyTemplatePreviewState';\n\n/**\n * The registry a preview resolves against when a host does not supply one: `core` plus this blueprint.\n *\n * Merged by hand rather than through `mergePackageRegistries`, because reaching for this blueprint's\n * *bundle* here would be circular - the bundle is assembled from the gallery this file belongs to. Registry\n * keys carry their package name, so merge order cannot cause a collision either way.\n */\nexport const galleryPreviewRegistry: ComponentRegistry = { ...coreComponents, ...defaultBlueprintComponents };\n\nexport interface GalleryScreenPreviewProps {\n /** The name of the gallery screen to boot. */\n screenName: string;\n\n /** Configuration to start from - a story pinning a mode, or a host restoring a session. */\n initialConfig?: Partial<LayoutConfigState>;\n\n /** The themes the configurator may switch between. Defaults to the two this blueprint ships. */\n themes?: Theme[];\n\n /** The component registry to render against. Defaults to `core` plus this blueprint's own components. */\n registry?: ComponentRegistry;\n\n /** The data state to show. Defaults to the seeded, populated records. */\n state?: TemplatePreviewState;\n}\n\n/**\n * Boots one gallery screen through the real engine.\n *\n * Nothing here is a preview-only path: the screen is a real {@link Screen}, its element tree is resolved by\n * the real `resolveComponentName`, and it is rendered by the real `SceneElementView` against the real\n * registry. That is the point of shipping a gallery at all - a mockup proves that someone can draw a\n * dashboard, and this proves the blueprint renders one.\n *\n * Component names belonging to packages the host has not loaded resolve but find no implementation, and\n * come out as `UnresolvedComponent`'s dashed red box naming what is missing. That is the designed outcome:\n * a preview of a blueprint against half a profile should look visibly incomplete rather than quietly\n * wrong.\n */\nexport function GalleryScreenPreview({ screenName, initialConfig, themes = defaultBlueprintThemes, registry = galleryPreviewRegistry, state = TemplatePreviewState.Populated }: GalleryScreenPreviewProps) {\n const element = useMemo(() => {\n const screen = galleryScreen(screenName);\n if (!screen) {\n throw new Error(`The gallery has no screen named '${screenName}'.`);\n }\n\n return applyTemplatePreviewState(resolveElementComponentNames(composeScreenElement(screen), galleryPreviewProfile, galleryComponentCatalog), state);\n }, [screenName, state]);\n\n return (\n <LayoutConfigProvider initialConfig={initialConfig} storage={null}>\n <LayoutThemeProvider themes={themes}>\n <SceneElementView element={element} registry={registry} resolveBinding={() => undefined} />\n </LayoutThemeProvider>\n </LayoutConfigProvider>\n );\n}\n"],"names":["galleryPreviewRegistry","coreComponents","defaultBlueprintComponents","GalleryScreenPreview","screenName","initialConfig","themes","defaultBlueprintThemes","registry","state","TemplatePreviewState","Populated","element","useMemo","screen","galleryScreen","Error","applyTemplatePreviewState","resolveElementComponentNames","composeScreenElement","galleryPreviewProfile","galleryComponentCatalog","_jsx","LayoutConfigProvider","storage","LayoutThemeProvider","SceneElementView","resolveBinding","undefined"],"mappings":";;;;;;;;;;;;;;;;AAgBA;;;;;;UAOaA,sBAAAA,GAA4C;AAAE,IAAA,GAAGC,0BAAc;AAAE,IAAA,GAAGC;AAA2B;AAmB5G;;;;;;;;;;;;AAYC,IACM,SAASC,oBAAAA,CAAqB,EAAEC,UAAU,EAAEC,aAAa,EAAEC,MAAAA,GAASC,6CAAsB,EAAEC,QAAAA,GAAWR,sBAAsB,EAAES,KAAAA,GAAQC,yCAAAA,CAAqBC,SAAS,EAA6B,EAAA;AACrM,IAAA,MAAMC,UAAUC,aAAAA,CAAQ,IAAA;AACpB,QAAA,MAAMC,SAASC,qBAAAA,CAAcX,UAAAA,CAAAA;AAC7B,QAAA,IAAI,CAACU,MAAAA,EAAQ;AACT,YAAA,MAAM,IAAIE,KAAAA,CAAM,CAAC,iCAAiC,EAAEZ,UAAAA,CAAW,EAAE,CAAC,CAAA;AACtE,QAAA;AAEA,QAAA,OAAOa,mDAAAA,CAA0BC,gDAAAA,CAA6BC,kCAAAA,CAAqBL,MAAAA,CAAAA,EAASM,sCAAuBC,sCAAAA,CAAAA,EAA0BZ,KAAAA,CAAAA;IACjJ,CAAA,EAAG;AAACL,QAAAA,UAAAA;AAAYK,QAAAA;AAAM,KAAA,CAAA;AAEtB,IAAA,qBACIa,cAAA,CAACC,yCAAAA,EAAAA;QAAqBlB,aAAAA,EAAeA,aAAAA;QAAemB,OAAAA,EAAS,IAAA;AACzD,QAAA,QAAA,gBAAAF,cAAA,CAACG,uCAAAA,EAAAA;YAAoBnB,MAAAA,EAAQA,MAAAA;AACzB,YAAA,QAAA,gBAAAgB,cAAA,CAACI,4BAAAA,EAAAA;gBAAiBd,OAAAA,EAASA,OAAAA;gBAASJ,QAAAA,EAAUA,QAAAA;AAAUmB,gBAAAA,cAAAA,EAAgB,IAAMC;;;;AAI9F;;;"}
1
+ {"version":3,"file":"GalleryScreenPreview.js","sources":["../../../gallery/GalleryScreenPreview.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 } from 'react';\nimport { ExternalComponent, SampleDataPack, SceneElement, Theme } from '@cratis/scene.model';\nimport { ComponentRegistry, SceneElementView, coreComponents } from '@cratis/scene.react';\nimport { LayoutConfigProvider, LayoutConfigState } from '../configuration';\nimport { ComponentName } from '../ComponentName';\nimport { defaultBlueprintComponents } from '../defaultBlueprintComponents';\nimport { ComponentState, foundationSamples } from '../foundation';\nimport { defaultBlueprintName } from '../packageName';\nimport { LayoutThemeProvider, defaultBlueprintThemes } from '../themes';\nimport { composeScreenElement } from './composeScreen';\nimport { galleryComponentCatalog, galleryPreviewProfile } from './previewProfile';\nimport { resolveElementComponentNames } from './resolveElementNames';\nimport { galleryScreen } from './screens';\nimport { TemplatePreviewState } from './TemplatePreviewState';\nimport { applyTemplatePreviewState } from './applyTemplatePreviewState';\n\n/**\n * The registry a preview resolves against when a host does not supply one: `core` plus this blueprint.\n *\n * Merged by hand rather than through `mergePackageRegistries`, because reaching for this blueprint's\n * *bundle* here would be circular - the bundle is assembled from the gallery this file belongs to. Registry\n * keys carry their package name, so merge order cannot cause a collision either way.\n */\nexport const galleryPreviewRegistry: ComponentRegistry = { ...coreComponents, ...defaultBlueprintComponents };\n\nexport interface GalleryScreenPreviewProps {\n /** The name of the gallery screen to boot. */\n screenName: string;\n\n /** Configuration to start from - a story pinning a mode, or a host restoring a session. */\n initialConfig?: Partial<LayoutConfigState>;\n\n /** The themes the configurator may switch between. Defaults to the two this blueprint ships. */\n themes?: Theme[];\n\n /** The component registry to render against. Defaults to `core` plus this blueprint's own components. */\n registry?: ComponentRegistry;\n\n /** The data state to show. Defaults to the seeded, populated records. */\n state?: TemplatePreviewState;\n\n /**\n * The sample-data pack that stands in for the queries the templates bind to: each set's `shape` is a query name and its `rows` that query's result.\n * Templates carry no rows of their own - they declare where the data comes from (spec SD1) - so a preview of a foundation template needs one.\n */\n pack?: SampleDataPack;\n\n /**\n * A standard state (spec Part B 1.4) to force on every foundation component that owns the five states: loading, error, no-permission or partial.\n * This is how a designer inspects each one on a real template - it only sets the `state` property the components already read, so there is no\n * second code path. `error`, `permissionSubject` and `failedRegions` give the state its message.\n */\n forceState?: ForcedComponentState;\n}\n\n/** The standard states a preview can force on a template's components. */\nexport interface ForcedComponentState {\n state: ComponentState;\n error?: string;\n permissionSubject?: string;\n failedRegions?: string[];\n}\n\n/** Components that are chrome or controls rather than data-showing regions, and so do not own the five states. */\nconst withoutStates = new Set<string>([\n ComponentName.EmptyState, ComponentName.TrendChip, ComponentName.StatusChip, ComponentName.BulkBar, ComponentName.GlobalSearch, ComponentName.NotificationsButton,\n]);\n\n/** Sets the forced state on every region that owns the five states, leaving chrome and controls as they are. */\nexport function forceComponentState(element: SceneElement, forced: ForcedComponentState): SceneElement {\n const external = element as Partial<ExternalComponent>;\n const children = (element as { children?: SceneElement[] }).children;\n const slots = external.slots ? Object.fromEntries(Object.entries(external.slots).map(([slot, inner]) => [slot, inner.map(child => forceComponentState(child, forced))])) : undefined;\n const bare = typeof external.componentName === 'string' ? external.componentName.substring(external.componentName.lastIndexOf(':') + 1) : undefined;\n const owns = bare !== undefined && external.componentName!.includes(defaultBlueprintName) && (bare in foundationSamples) && foundationSamples[bare].stateful && !withoutStates.has(bare);\n\n return {\n ...element,\n ...(owns ? { properties: { ...external.properties, ...forced } } : {}),\n ...(slots ? { slots } : {}),\n ...(children ? { children: children.map(child => forceComponentState(child, forced)) } : {}),\n } as SceneElement;\n}\n\n/**\n * A pack as the query results the templates bind to: one entry for each set, keyed by the set's shape name.\n *\n * The state is a property of the *data*, not of the template: Empty answers every query with no rows; Loading and Error withhold the answer, which is\n * what a query that has not come back or has failed looks like to a component, so each shows its own skeleton or error exactly as it will in an application.\n * The elements themselves are untouched, which is why the same template previews in every state with no per-template code.\n */\nexport const queryResultsOf = (pack: SampleDataPack | undefined, state: TemplatePreviewState = TemplatePreviewState.Populated): Record<string, unknown> | undefined => {\n if (pack === undefined) return undefined;\n if (state === TemplatePreviewState.Empty) return Object.fromEntries(pack.sets.map(set => [set.shape, []]));\n return Object.fromEntries(pack.sets.map(set => [set.shape, set.rows]));\n};\n\n/**\n * Boots one gallery screen through the real engine.\n *\n * Nothing here is a preview-only path: the screen is a real {@link Screen}, its element tree is resolved by\n * the real `resolveComponentName`, and it is rendered by the real `SceneElementView` against the real\n * registry. That is the point of shipping a gallery at all - a mockup proves that someone can draw a\n * dashboard, and this proves the blueprint renders one.\n *\n * Component names belonging to packages the host has not loaded resolve but find no implementation, and\n * come out as `UnresolvedComponent`'s dashed red box naming what is missing. That is the designed outcome:\n * a preview of a blueprint against half a profile should look visibly incomplete rather than quietly\n * wrong.\n */\nexport function GalleryScreenPreview({ screenName, initialConfig, themes = defaultBlueprintThemes, registry = galleryPreviewRegistry, state = TemplatePreviewState.Populated, pack, forceState }: GalleryScreenPreviewProps) {\n const element = useMemo(() => {\n const screen = galleryScreen(screenName);\n if (!screen) {\n throw new Error(`The gallery has no screen named '${screenName}'.`);\n }\n\n const resolved = applyTemplatePreviewState(resolveElementComponentNames(composeScreenElement(screen), galleryPreviewProfile, galleryComponentCatalog), state);\n return forceState ? forceComponentState(resolved, forceState) : resolved;\n }, [screenName, state, forceState]);\n\n return (\n <LayoutConfigProvider initialConfig={initialConfig} storage={null}>\n <LayoutThemeProvider themes={themes}>\n <SceneElementView element={element} registry={registry} resolveBinding={() => undefined} queryResults={queryResultsOf(pack, state)} />\n </LayoutThemeProvider>\n </LayoutConfigProvider>\n );\n}\n"],"names":["galleryPreviewRegistry","coreComponents","defaultBlueprintComponents","withoutStates","Set","ComponentName","EmptyState","TrendChip","StatusChip","BulkBar","GlobalSearch","NotificationsButton","forceComponentState","element","forced","external","children","slots","Object","fromEntries","entries","map","slot","inner","child","undefined","bare","componentName","substring","lastIndexOf","owns","includes","defaultBlueprintName","foundationSamples","stateful","has","properties","queryResultsOf","pack","state","TemplatePreviewState","Populated","Empty","sets","set","shape","rows","GalleryScreenPreview","screenName","initialConfig","themes","defaultBlueprintThemes","registry","forceState","useMemo","screen","galleryScreen","Error","resolved","applyTemplatePreviewState","resolveElementComponentNames","composeScreenElement","galleryPreviewProfile","galleryComponentCatalog","_jsx","LayoutConfigProvider","storage","LayoutThemeProvider","SceneElementView","resolveBinding","queryResults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA;;;;;;UAOaA,sBAAAA,GAA4C;AAAE,IAAA,GAAGC,0BAAc;AAAE,IAAA,GAAGC;AAA2B;AAwC5G,mHACA,MAAMC,aAAAA,GAAgB,IAAIC,GAAAA,CAAY;AAClCC,IAAAA,2BAAAA,CAAcC,UAAU;AAAED,IAAAA,2BAAAA,CAAcE,SAAS;AAAEF,IAAAA,2BAAAA,CAAcG,UAAU;AAAEH,IAAAA,2BAAAA,CAAcI,OAAO;AAAEJ,IAAAA,2BAAAA,CAAcK,Y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6BC,kCAAAA,CAAqBN,MAAAA,CAAAA,EAASO,sCAAuBC,sCAAAA,CAAAA,EAA0BxB,KAAAA,CAAAA;QACvJ,OAAOc,UAAAA,GAAazC,mBAAAA,CAAoB8C,QAAAA,EAAUL,UAAAA,CAAAA,GAAcK,QAAAA;IACpE,CAAA,EAAG;AAACV,QAAAA,UAAAA;AAAYT,QAAAA,KAAAA;AAAOc,QAAAA;AAAW,KAAA,CAAA;AAElC,IAAA,qBACIW,cAAA,CAACC,yCAAAA,EAAAA;QAAqBhB,aAAAA,EAAeA,aAAAA;QAAeiB,OAAAA,EAAS,IAAA;AACzD,QAAA,QAAA,gBAAAF,cAAA,CAACG,uCAAAA,EAAAA;YAAoBjB,MAAAA,EAAQA,MAAAA;AACzB,YAAA,QAAA,gBAAAc,cAAA,CAACI,4BAAAA,EAAAA;gBAAiBvD,OAAAA,EAASA,OAAAA;gBAASuC,QAAAA,EAAUA,QAAAA;AAAUiB,gBAAAA,cAAAA,EAAgB,IAAM5C,SAAAA;AAAW6C,gBAAAA,YAAAA,EAAcjC,eAAeC,IAAAA,EAAMC,KAAAA;;;;AAI5I;;;;;"}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
+ var scene_model = require('@cratis/scene.model');
3
4
  var ComponentName = require('../ComponentName.js');
4
5
  var SlotName = require('../layouts/SlotName.js');
5
- require('@cratis/scene.model');
6
6
  require('../layouts/shellComponents.js');
7
7
  require('../layouts/appShell.js');
8
8
  require('../layouts/fullPage.js');
@@ -64,6 +64,23 @@ var navigation = require('./navigation.js');
64
64
  logo('topbar-logo')
65
65
  ],
66
66
  end: [
67
+ // The topbar of Part B 2.1: logo, search, notifications, the environment, and the user. The search and the bell are the foundation
68
+ // components, so they work everywhere the shell does; the unread count is a query result, never a value.
69
+ elements.externalComponent('topbar-search', ComponentName.ComponentName.GlobalSearch, {
70
+ placeholder: 'Search',
71
+ label: 'Search the application'
72
+ }),
73
+ elements.externalComponent('topbar-notifications', ComponentName.ComponentName.NotificationsButton, {
74
+ count: {
75
+ kind: scene_model.BindingSourceKind.QueryResult,
76
+ query: 'NotificationCount',
77
+ path: '0.count'
78
+ }
79
+ }),
80
+ elements.externalComponent('topbar-environment', ComponentName.ComponentName.StatusChip, {
81
+ status: 'Production',
82
+ tone: 'info'
83
+ }),
67
84
  elements.externalComponent('topbar-user', ComponentName.ComponentName.UserMenu, {
68
85
  name: 'Amelia Nyquist',
69
86
  role: 'Owner',
@@ -1 +1 @@
1
- {"version":3,"file":"applicationChrome.js","sources":["../../../gallery/applicationChrome.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';\nimport { ComponentName } from '../ComponentName';\nimport { SlotName } from '../layouts';\nimport { defaultBlueprintThemes } from '../themes';\nimport { externalComponent } from './elements';\nimport { entriesInGroup, navigationElement, navigationGroups } from './navigation';\n\n/**\n * The chrome every screen in the application shell shares: the topbar, the sidebar, the menu, the footer\n * and the configurator.\n *\n * It is built once, per screen, rather than repeated in twenty templates. A screen template describes what\n * is *different* about a screen; if it also had to describe the topbar, then adding an item to the menu\n * would mean editing twenty files, and nineteen of them would eventually be missed.\n */\n\n/** The brand mark, shared by the topbar and the sidebar header. */\nfunction logo(id: string): SceneElement {\n return externalComponent(id, ComponentName.Logo, { label: 'Contoso', initials: 'C', targetScreen: 'Dashboard' });\n}\n\n/** One menu section per navigation group, each holding that group's entries. */\nfunction menuSections(activeScreen: string): SceneElement[] {\n return navigationGroups.map(group =>\n externalComponent(\n `menu-${group.toLowerCase()}`,\n ComponentName.Menu,\n { title: group, label: group },\n { items: entriesInGroup(group).map(entry => navigationElement(entry, activeScreen)) },\n ),\n );\n}\n\n/** The configurator, offering the themes this blueprint ships. */\nfunction configPanel(): SceneElement {\n return externalComponent(ComponentName.ConfigPanel, ComponentName.ConfigPanel, {\n title: 'Settings',\n themes: defaultBlueprintThemes.map(theme => ({ name: theme.name, label: theme.name, isDark: theme.isDark ?? false })),\n });\n}\n\n/** One trail entry: a label, and the screen it goes back to. */\nexport interface BreadcrumbEntry {\n /** What the entry is called. */\n label: string;\n\n /** The screen it navigates back to, or undefined for the current page. */\n targetScreen?: string;\n}\n\n/**\n * The application shell's slot content for one screen.\n *\n * Only the breadcrumb and which menu entry is marked active differ from screen to screen - everything else\n * is identical, which is the point of chrome.\n *\n * @param activeScreen The screen being rendered, so its menu entry is marked current.\n * @param breadcrumb The trail above the content.\n * @returns Slot content keyed by the {@link SlotName}s the `AppShell` layout declares.\n */\nexport function applicationChrome(activeScreen: string, breadcrumb: BreadcrumbEntry[]): Record<string, SceneElement[]> {\n return {\n [SlotName.Topbar]: [\n externalComponent(\n 'topbar',\n ComponentName.Topbar,\n {},\n {\n logo: [logo('topbar-logo')],\n end: [\n externalComponent('topbar-user', ComponentName.UserMenu, {\n name: 'Amelia Nyquist',\n role: 'Owner',\n initials: 'AN',\n items: [\n { label: 'Your profile', icon: 'pi pi-user', targetScreen: 'ProfileSettings' },\n { label: 'Help', icon: 'pi pi-question-circle', targetScreen: 'Help' },\n { label: 'Lock', icon: 'pi pi-lock', targetScreen: 'LockScreen' },\n ],\n }),\n ],\n },\n ),\n ],\n [SlotName.Sidebar]: [externalComponent('sidebar', ComponentName.Sidebar, { title: 'Contoso' }, { logo: [logo('sidebar-logo')] })],\n [SlotName.Menu]: menuSections(activeScreen),\n [SlotName.Breadcrumb]: [\n externalComponent('breadcrumb', ComponentName.Breadcrumb, {\n homeTargetScreen: 'Dashboard',\n items: breadcrumb,\n }),\n ],\n [SlotName.Footer]: [externalComponent('footer', ComponentName.Footer, { text: '© Contoso · Built with Cratis Scene' })],\n [SlotName.ConfigPanel]: [configPanel()],\n };\n}\n\n/**\n * The full-page shell's slot content: the configurator and nothing else.\n *\n * A sign-in screen has no navigation to render, but it does have to honor the chosen theme - it is very\n * often the first page anyone sees, and arriving at a light sign-in page before a dark application is a\n * jarring way to start.\n */\nexport function fullPageChrome(): Record<string, SceneElement[]> {\n return { [SlotName.ConfigPanel]: [configPanel()] };\n}\n"],"names":["logo","id","externalComponent","ComponentName","Logo","label","initials","targetScreen","menuSections","activeScreen","navigationGroups","map","group","toLowerCase","Menu","title","items","entriesInGroup","entry","navigationElement","configPanel","ConfigPanel","themes","defaultBlueprintThemes","theme","name","isDark","applicationChrome","breadcrumb","SlotName","Topbar","end","UserMenu","role","icon","Sidebar","Breadcrumb","homeTargetScreen","Footer","text","fullPageChrome"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AASA;;;;;;;AAOC,wEAGD,SAASA,IAAAA,CAAKC,EAAU,EAAA;AACpB,IAAA,OAAOC,0BAAAA,CAAkBD,EAAAA,EAAIE,2BAAAA,CAAcC,IAAI,EAAE;QAAEC,KAAAA,EAAO,SAAA;QAAWC,QAAAA,EAAU,GAAA;QAAKC,YAAAA,EAAc;AAAY,KAAA,CAAA;AAClH;AAEA,iFACA,SAASC,YAAAA,CAAaC,YAAoB,EAAA;AACtC,IAAA,OAAOC,2BAAAA,CAAiBC,GAAG,CAACC,CAAAA,QACxBV,0BAAAA,CACI,CAAC,KAAK,EAAEU,MAAMC,WAAW,EAAA,CAAA,CAAI,EAC7BV,2BAAAA,CAAcW,IAAI,EAClB;YAAEC,KAAAA,EAAOH,KAAAA;YAAOP,KAAAA,EAAOO;SAAM,EAC7B;AAAEI,YAAAA,KAAAA,EAAOC,0BAAeL,KAAAA,CAAAA,CAAOD,GAAG,CAACO,CAAAA,KAAAA,GAASC,6BAAkBD,KAAAA,EAAOT,YAAAA,CAAAA;AAAe,SAAA,CAAA,CAAA;AAGhG;AAEA,mEACA,SAASW,WAAAA,GAAAA;AACL,IAAA,OAAOlB,2BAAkBC,2BAAAA,CAAckB,WAAW,EAAElB,2BAAAA,CAAckB,WAAW,EAAE;QAC3EN,KAAAA,EAAO,UAAA;AACPO,QAAAA,MAAAA,EAAQC,6CAAAA,CAAuBZ,GAAG,CAACa,CAAAA,SAAU;AAAEC,gBAAAA,I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AASf,IAAI,GAAGN,YAAAA,CAAaC,YAAAA,CAAAA;QAC9B,CAACoB,iBAAAA,CAASO,UAAU,GAAG;YACnBlC,0BAAAA,CAAkB,YAAA,EAAcC,2BAAAA,CAAciC,UAAU,EAAE;gBACtDC,gBAAAA,EAAkB,WAAA;gBAClBrB,KAAAA,EAAOY;AACX,aAAA;AACH,SAAA;QACD,CAACC,iBAAAA,CAASS,MAAM,GAAG;YAACpC,0BAAAA,CAAkB,QAAA,EAAUC,2BAAAA,CAAcmC,MAAM,EAAE;gBAAEC,IAAAA,EAAM;AAAsC,aAAA;AAAG,SAAA;QACvH,CAACV,iBAAAA,CAASR,WAAW,GAAG;AAACD,YAAAA,WAAAA;AAAc;AAC3C,KAAA;AACJ;AAEA;;;;;;AAMC,IACM,SAASoB,cAAAA,GAAAA;IACZ,OAAO;QAAE,CAACX,iBAAAA,CAASR,WAAW,GAAG;AAACD,YAAAA,WAAAA;AAAc;AAAC,KAAA;AACrD;;;"}
1
+ {"version":3,"file":"applicationChrome.js","sources":["../../../gallery/applicationChrome.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 { BindingSourceKind, SceneElement } from '@cratis/scene.model';\nimport { ComponentName } from '../ComponentName';\nimport { SlotName } from '../layouts';\nimport { defaultBlueprintThemes } from '../themes';\nimport { externalComponent } from './elements';\nimport { entriesInGroup, navigationElement, navigationGroups } from './navigation';\n\n/**\n * The chrome every screen in the application shell shares: the topbar, the sidebar, the menu, the footer\n * and the configurator.\n *\n * It is built once, per screen, rather than repeated in twenty templates. A screen template describes what\n * is *different* about a screen; if it also had to describe the topbar, then adding an item to the menu\n * would mean editing twenty files, and nineteen of them would eventually be missed.\n */\n\n/** The brand mark, shared by the topbar and the sidebar header. */\nfunction logo(id: string): SceneElement {\n return externalComponent(id, ComponentName.Logo, { label: 'Contoso', initials: 'C', targetScreen: 'Dashboard' });\n}\n\n/** One menu section per navigation group, each holding that group's entries. */\nfunction menuSections(activeScreen: string): SceneElement[] {\n return navigationGroups.map(group =>\n externalComponent(\n `menu-${group.toLowerCase()}`,\n ComponentName.Menu,\n { title: group, label: group },\n { items: entriesInGroup(group).map(entry => navigationElement(entry, activeScreen)) },\n ),\n );\n}\n\n/** The configurator, offering the themes this blueprint ships. */\nfunction configPanel(): SceneElement {\n return externalComponent(ComponentName.ConfigPanel, ComponentName.ConfigPanel, {\n title: 'Settings',\n themes: defaultBlueprintThemes.map(theme => ({ name: theme.name, label: theme.name, isDark: theme.isDark ?? false })),\n });\n}\n\n/** One trail entry: a label, and the screen it goes back to. */\nexport interface BreadcrumbEntry {\n /** What the entry is called. */\n label: string;\n\n /** The screen it navigates back to, or undefined for the current page. */\n targetScreen?: string;\n}\n\n/**\n * The application shell's slot content for one screen.\n *\n * Only the breadcrumb and which menu entry is marked active differ from screen to screen - everything else\n * is identical, which is the point of chrome.\n *\n * @param activeScreen The screen being rendered, so its menu entry is marked current.\n * @param breadcrumb The trail above the content.\n * @returns Slot content keyed by the {@link SlotName}s the `AppShell` layout declares.\n */\nexport function applicationChrome(activeScreen: string, breadcrumb: BreadcrumbEntry[]): Record<string, SceneElement[]> {\n return {\n [SlotName.Topbar]: [\n externalComponent(\n 'topbar',\n ComponentName.Topbar,\n {},\n {\n logo: [logo('topbar-logo')],\n end: [\n // The topbar of Part B 2.1: logo, search, notifications, the environment, and the user. The search and the bell are the foundation\n // components, so they work everywhere the shell does; the unread count is a query result, never a value.\n externalComponent('topbar-search', ComponentName.GlobalSearch, { placeholder: 'Search', label: 'Search the application' }),\n externalComponent('topbar-notifications', ComponentName.NotificationsButton, { count: { kind: BindingSourceKind.QueryResult, query: 'NotificationCount', path: '0.count' } }),\n externalComponent('topbar-environment', ComponentName.StatusChip, { status: 'Production', tone: 'info' }),\n externalComponent('topbar-user', ComponentName.UserMenu, {\n name: 'Amelia Nyquist',\n role: 'Owner',\n initials: 'AN',\n items: [\n { label: 'Your profile', icon: 'pi pi-user', targetScreen: 'ProfileSettings' },\n { label: 'Help', icon: 'pi pi-question-circle', targetScreen: 'Help' },\n { label: 'Lock', icon: 'pi pi-lock', targetScreen: 'LockScreen' },\n ],\n }),\n ],\n },\n ),\n ],\n [SlotName.Sidebar]: [externalComponent('sidebar', ComponentName.Sidebar, { title: 'Contoso' }, { logo: [logo('sidebar-logo')] })],\n [SlotName.Menu]: menuSections(activeScreen),\n [SlotName.Breadcrumb]: [\n externalComponent('breadcrumb', ComponentName.Breadcrumb, {\n homeTargetScreen: 'Dashboard',\n items: breadcrumb,\n }),\n ],\n [SlotName.Footer]: [externalComponent('footer', ComponentName.Footer, { text: '© Contoso · Built with Cratis Scene' })],\n [SlotName.ConfigPanel]: [configPanel()],\n };\n}\n\n/**\n * The full-page shell's slot content: the configurator and nothing else.\n *\n * A sign-in screen has no navigation to render, but it does have to honor the chosen theme - it is very\n * often the first page anyone sees, and arriving at a light sign-in page before a dark application is a\n * jarring way to start.\n */\nexport function fullPageChrome(): Record<string, SceneElement[]> {\n return { [SlotName.ConfigPanel]: [configPanel()] };\n}\n"],"names":["logo","id","externalComponent","ComponentName","Logo","label","initials","targetScreen","menuSections","activeScreen","navigationGroups","map","group","toLowerCase","Menu","title","items","entriesInGroup","entry","navigationElement","configPanel","ConfigPanel","themes","defaultBlueprintThemes","theme","name","isDark","applicationChrome","breadcrumb","SlotName","Topbar","end","GlobalSearch","placeholder","NotificationsButton","count","kind","BindingSourceKind","QueryResult","query","path","StatusChip","status","tone","UserMenu","role","icon","Sidebar","Breadcrumb","homeTargetScreen","Footer","text","fullPageChrome"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AASA;;;;;;;AAOC,wEAGD,SAASA,IAAAA,CAAKC,EAAU,EAAA;AACpB,IAAA,OAAOC,0BAAAA,CAAkBD,EAAAA,EAAIE,2BAAAA,CAAcC,IAAI,EAAE;QAAEC,KAAAA,EAAO,SAAA;QAAWC,QAAAA,EAAU,GAAA;QAAKC,YAAAA,EAAc;AAAY,KA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9B,CAACoB,iBAAAA,CAASmB,UAAU,GAAG;YACnB9C,0BAAAA,CAAkB,YAAA,EAAcC,2BAAAA,CAAc6C,UAAU,EAAE;gBACtDC,gBAAAA,EAAkB,WAAA;gBAClBjC,KAAAA,EAAOY;AACX,aAAA;AACH,SAAA;QACD,CAACC,iBAAAA,CAASqB,MAAM,GAAG;YAAChD,0BAAAA,CAAkB,QAAA,EAAUC,2BAAAA,CAAc+C,MAAM,EAAE;gBAAEC,IAAAA,EAAM;AAAsC,aAAA;AAAG,SAAA;QACvH,CAACtB,iBAAAA,CAASR,WAAW,GAAG;AAACD,YAAAA,WAAAA;AAAc;AAC3C,KAAA;AACJ;AAEA;;;;;;AAMC,IACM,SAASgC,cAAAA,GAAAA;IACZ,OAAO;QAAE,CAACvB,iBAAAA,CAASR,WAAW,GAAG;AAACD,YAAAA,WAAAA;AAAc;AAAC,KAAA;AACrD;;;"}
@@ -61,13 +61,15 @@ function placeInside(outer, inner) {
61
61
  if (!inner.fitsSlot) {
62
62
  return outer;
63
63
  }
64
- const innerContent = inner.slots.flatMap((slot)=>inner.content?.[slot.name] ?? []);
64
+ // A container-qualified name (`WorkspaceScreen.moduleContent`) says which container; the slot's own name is what the container's content is keyed by.
65
+ const slot = inner.fitsSlot.substring(inner.fitsSlot.lastIndexOf('.') + 1);
66
+ const innerContent = inner.slots.flatMap((innerSlot)=>inner.content?.[innerSlot.name] ?? []);
65
67
  return {
66
68
  ...outer,
67
69
  content: {
68
70
  ...outer.content,
69
- [inner.fitsSlot]: [
70
- ...outer.content?.[inner.fitsSlot] ?? [],
71
+ [slot]: [
72
+ ...outer.content?.[slot] ?? [],
71
73
  ...innerContent
72
74
  ]
73
75
  }
@@ -1 +1 @@
1
- {"version":3,"file":"composeScreen.js","sources":["../../../gallery/composeScreen.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 { ExternalComponent, Layout, SceneElement, Screen, ScreenTemplate } from '@cratis/scene.model';\nimport { shellComponentForLayout } from '../layouts';\nimport { externalComponent } from './elements';\n\n/**\n * Turns a {@link ScreenTemplate}'s content into slot content on the {@link Layout} that contains it.\n *\n * The rule has two halves, and both matter. Content filed under a slot the *layout* also declares stays\n * under that name - which is how a sign-in template's branding half reaches the full-page layout's `aside`\n * region rather than being buried inside the form column. Everything else flows into the slot the\n * template's `fitsSlot` names, because that is what `fitsSlot` means: this template occupies that region.\n *\n * @param template The template to place.\n * @param layout The layout it is placed into.\n * @returns Slot content keyed by the layout's own slot names.\n */\nexport function templateContentInLayout(template: ScreenTemplate, layout: Layout): Record<string, SceneElement[]> {\n const layoutSlots = new Set(layout.slots.map(slot => slot.name));\n const placed: Record<string, SceneElement[]> = {};\n const ownSlotOrder = template.slots.map(slot => slot.name);\n const content = template.content ?? {};\n\n for (const slotName of ownSlotOrder) {\n const elements = content[slotName];\n if (!elements || elements.length === 0) {\n continue;\n }\n\n const target = layoutSlots.has(slotName) ? slotName : template.fitsSlot;\n if (!target) {\n continue;\n }\n\n placed[target] = [...(placed[target] ?? []), ...elements];\n }\n\n return placed;\n}\n\n/**\n * Folds a containment chain of screen templates into the outermost one.\n *\n * This is `fitsSlot` doing its job, applied repeatedly. A slice's template fits a slot on the feature's\n * template, which fits a slot on the module's, which fits a slot on the application layout - so the way to\n * place the slice is to place it in the feature, place *that* result in the module, and hand the module to\n * the layout. Folding from the inside out means the rule is written once and the chain can be any depth.\n *\n * The alternative - filing a nested template's content under its own `fitsSlot` at the top level - looks\n * right and is not: the layout has no `body` slot, so the content lands in a region nothing renders and\n * the screen comes up empty with nothing to explain it.\n *\n * @param chain The templates from outermost to innermost. A chain of one is returned unchanged.\n * @returns A template with the same slots and `fitsSlot` as the outermost, carrying the whole chain's content.\n */\nexport function nestScreenTemplates(chain: ScreenTemplate[]): ScreenTemplate {\n return chain.reduceRight((inner, outer) => (inner === outer ? outer : placeInside(outer, inner)));\n}\n\nfunction placeInside(outer: ScreenTemplate, inner: ScreenTemplate): ScreenTemplate {\n if (!inner.fitsSlot) {\n return outer;\n }\n\n const innerContent = inner.slots.flatMap(slot => inner.content?.[slot.name] ?? []);\n return {\n ...outer,\n content: {\n ...outer.content,\n [inner.fitsSlot]: [...(outer.content?.[inner.fitsSlot] ?? []), ...innerContent],\n },\n };\n}\n\n/**\n * Builds the element tree that renders a {@link Screen}.\n *\n * The screen's slot content becomes the shell component's slots one-for-one, which is the whole trick: a\n * layout's slots and a shell component's slots are the same vocabulary, so nothing has to translate\n * between them and a slot filled under a name the shell does not read is a spec failure rather than a\n * silently missing region.\n *\n * @param screen The screen to render.\n * @returns The shell element, ready for `SceneElementView`.\n */\nexport function composeScreenElement(screen: Screen): ExternalComponent {\n const shell = shellComponentForLayout(screen.layout);\n if (!shell) {\n throw new Error(`Screen '${screen.name}' names the layout '${screen.layout}', which this blueprint does not provide.`);\n }\n\n return externalComponent(`screen-${screen.name}`, shell, { screenName: screen.name }, screen.slotContent);\n}\n"],"names":["templateContentInLayout","template","layout","layoutSlots","Set","slots","map","slot","name","placed","ownSlotOrder","content","slotName","elements","length","target","has","fitsSlot","nestScreenTemplates","chain","reduceRight","inner","outer","placeInside","innerContent","flatMap","composeScreenElement","screen","shell","shellComponentForLayout","Error","externalComponent","screenName","slotContent"],"mappings":";;;;;;;;AAAA;AACA;AAMA;;;;;;;;;;;AAWC,IACM,SAASA,uBAAAA,CAAwBC,QAAwB,EAAEC,MAAc,EAAA;IAC5E,MAAMC,WAAAA,GAAc,IAAIC,GAAAA,CAAIF,MAAAA,CAAOG,KAAK,CAACC,GAAG,CAACC,CAAAA,IAAAA,GAAQA,IAAAA,CAAKC,IAAI,CAAA,CAAA;AAC9D,IAAA,MAAMC,SAAyC,EAAC;IAChD,MAAMC,YAAAA,GAAeT,SAASI,KAAK,CAACC,GAAG,CAACC,CAAAA,IAAAA,GAAQA,IAAAA,CAAKC,IAAI,CAAA;AACzD,IAAA,MAAMG,OAAAA,GAAUV,QAAAA,CAASU,OAAO,IA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AAQ,CAAC,IAAI,EAAE;AAAMO,gBAAAA,GAAAA;AAAa;AACnF;AACJ,KAAA;AACJ;AAEA;;;;;;;;;;IAWO,SAASE,oBAAAA,CAAqBC,MAAc,EAAA;IAC/C,MAAMC,KAAAA,GAAQC,uCAAAA,CAAwBF,MAAAA,CAAOzB,MAAM,CAAA;AACnD,IAAA,IAAI,CAAC0B,KAAAA,EAAO;AACR,QAAA,MAAM,IAAIE,KAAAA,CAAM,CAAC,QAAQ,EAAEH,MAAAA,CAAOnB,IAAI,CAAC,oBAAoB,EAAEmB,MAAAA,CAAOzB,MAAM,CAAC,yCAAyC,CAAC,CAAA;AACzH,IAAA;IAEA,OAAO6B,0BAAAA,CAAkB,CAAC,OAAO,EAAEJ,OAAOnB,IAAI,CAAA,CAAE,EAAEoB,KAAAA,EAAO;AAAEI,QAAAA,UAAAA,EAAYL,OAAOnB;AAAK,KAAA,EAAGmB,OAAOM,WAAW,CAAA;AAC5G;;;;"}
1
+ {"version":3,"file":"composeScreen.js","sources":["../../../gallery/composeScreen.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 { ExternalComponent, Layout, SceneElement, Screen, ScreenTemplate } from '@cratis/scene.model';\nimport { shellComponentForLayout } from '../layouts';\nimport { externalComponent } from './elements';\n\n/**\n * Turns a {@link ScreenTemplate}'s content into slot content on the {@link Layout} that contains it.\n *\n * The rule has two halves, and both matter. Content filed under a slot the *layout* also declares stays\n * under that name - which is how a sign-in template's branding half reaches the full-page layout's `aside`\n * region rather than being buried inside the form column. Everything else flows into the slot the\n * template's `fitsSlot` names, because that is what `fitsSlot` means: this template occupies that region.\n *\n * @param template The template to place.\n * @param layout The layout it is placed into.\n * @returns Slot content keyed by the layout's own slot names.\n */\nexport function templateContentInLayout(template: ScreenTemplate, layout: Layout): Record<string, SceneElement[]> {\n const layoutSlots = new Set(layout.slots.map(slot => slot.name));\n const placed: Record<string, SceneElement[]> = {};\n const ownSlotOrder = template.slots.map(slot => slot.name);\n const content = template.content ?? {};\n\n for (const slotName of ownSlotOrder) {\n const elements = content[slotName];\n if (!elements || elements.length === 0) {\n continue;\n }\n\n const target = layoutSlots.has(slotName) ? slotName : template.fitsSlot;\n if (!target) {\n continue;\n }\n\n placed[target] = [...(placed[target] ?? []), ...elements];\n }\n\n return placed;\n}\n\n/**\n * Folds a containment chain of screen templates into the outermost one.\n *\n * This is `fitsSlot` doing its job, applied repeatedly. A slice's template fits a slot on the feature's\n * template, which fits a slot on the module's, which fits a slot on the application layout - so the way to\n * place the slice is to place it in the feature, place *that* result in the module, and hand the module to\n * the layout. Folding from the inside out means the rule is written once and the chain can be any depth.\n *\n * The alternative - filing a nested template's content under its own `fitsSlot` at the top level - looks\n * right and is not: the layout has no `body` slot, so the content lands in a region nothing renders and\n * the screen comes up empty with nothing to explain it.\n *\n * @param chain The templates from outermost to innermost. A chain of one is returned unchanged.\n * @returns A template with the same slots and `fitsSlot` as the outermost, carrying the whole chain's content.\n */\nexport function nestScreenTemplates(chain: ScreenTemplate[]): ScreenTemplate {\n return chain.reduceRight((inner, outer) => (inner === outer ? outer : placeInside(outer, inner)));\n}\n\nfunction placeInside(outer: ScreenTemplate, inner: ScreenTemplate): ScreenTemplate {\n if (!inner.fitsSlot) {\n return outer;\n }\n\n // A container-qualified name (`WorkspaceScreen.moduleContent`) says which container; the slot's own name is what the container's content is keyed by.\n const slot = inner.fitsSlot.substring(inner.fitsSlot.lastIndexOf('.') + 1);\n const innerContent = inner.slots.flatMap(innerSlot => inner.content?.[innerSlot.name] ?? []);\n return {\n ...outer,\n content: {\n ...outer.content,\n [slot]: [...(outer.content?.[slot] ?? []), ...innerContent],\n },\n };\n}\n\n/**\n * Builds the element tree that renders a {@link Screen}.\n *\n * The screen's slot content becomes the shell component's slots one-for-one, which is the whole trick: a\n * layout's slots and a shell component's slots are the same vocabulary, so nothing has to translate\n * between them and a slot filled under a name the shell does not read is a spec failure rather than a\n * silently missing region.\n *\n * @param screen The screen to render.\n * @returns The shell element, ready for `SceneElementView`.\n */\nexport function composeScreenElement(screen: Screen): ExternalComponent {\n const shell = shellComponentForLayout(screen.layout);\n if (!shell) {\n throw new Error(`Screen '${screen.name}' names the layout '${screen.layout}', which this blueprint does not provide.`);\n }\n\n return externalComponent(`screen-${screen.name}`, shell, { screenName: screen.name }, screen.slotContent);\n}\n"],"names":["templateContentInLayout","template","layout","layoutSlots","Set","slots","map","slot","name","placed","ownSlotOrder","content","slotName","elements","length","target","has","fitsSlot","nestScreenTemplates","chain","reduceRight","inner","outer","placeInside","substring","lastIndexOf","innerContent","flatMap","innerSlot","composeScreenElement","screen","shell","shellComponentForLayout","Error","externalComponent","screenName","slotContent"],"mappings":";;;;;;;;AAAA;AACA;AAMA;;;;;;;;;;;AAWC,IACM,SAASA,uBAAAA,CAAwBC,QAAwB,EAAEC,MAAc,EAAA;IAC5E,MAAMC,WAAAA,GAAc,IAAIC,GAAAA,CAAIF,MAAAA,CAAOG,KAAK,CAACC,GAAG,CAACC,CAAAA,IAAAA,GAAQA,IAAAA,CAAKC,IAAI,CAAA,CAAA;AAC9D,IAAA,MAAMC,SAAyC,EAAC;IAChD,MAAMC,YAAAA,GAAeT,SAASI,KAAK,CAACC,GAAG,CAACC,CAAAA,IAAAA,GAAQA,IAAAA,CAAKC,IAAI,CAAA;AACzD,IAAA,MAAMG,OAAAA,GAAUV,QAAAA,CAASU,OAAO,IAAI,EAAC;IAErC,KAAK,MAAMC,YAAYF,YAAAA,CAAc;QACjC,MAAMG,QAAAA,GAAWF,OAAO,CAACC,QAAAA,CAAS;AAClC,QAAA,IAAI,CAACC,QAAAA,IAAYA,QAAAA,CAASC,MAAM,KAAK,CAAA,EAAG;AACpC,YAAA;AACJ,QAAA;AAEA,QAAA,MAAMC,SAASZ,WAAAA,CAAYa,GAAG,CAACJ,QAAAA,CAAAA,GAAYA,QAAAA,GAAWX,SAASgB,QAAQ;AACvE,QAAA,IAAI,CAACF,MAAAA,EA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AA,IAAI,CAAC6B,KAAAA,EAAO;AACR,QAAA,MAAM,IAAIE,KAAAA,CAAM,CAAC,QAAQ,EAAEH,MAAAA,CAAOtB,IAAI,CAAC,oBAAoB,EAAEsB,MAAAA,CAAO5B,MAAM,CAAC,yCAAyC,CAAC,CAAA;AACzH,IAAA;IAEA,OAAOgC,0BAAAA,CAAkB,CAAC,OAAO,EAAEJ,OAAOtB,IAAI,CAAA,CAAE,EAAEuB,KAAAA,EAAO;AAAEI,QAAAA,UAAAA,EAAYL,OAAOtB;AAAK,KAAA,EAAGsB,OAAOM,WAAW,CAAA;AAC5G;;;;"}
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
+ var dialogTemplates = require('../foundation/templates/dialogTemplates.js');
3
4
  var TemplateSlotName = require('./TemplateSlotName.js');
4
5
  var elements = require('./elements.js');
5
6
  var widgets = require('./widgets.js');
6
- var templateProvenance = require('../templateProvenance.js');
7
7
 
8
8
  // Copyright (c) Cratis. All rights reserved.
9
9
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
@@ -15,7 +15,12 @@ var templateProvenance = require('../templateProvenance.js');
15
15
  * *placed* - it fills a slot on whatever contains it, and the containment chain is what decides where it
16
16
  * appears. A dialog is *summoned*: it opens over the application from wherever the code that opened it
17
17
  * happens to be, so there is no parent slot for it to name.
18
- */ /** Confirm: one question, two answers, and enough context to answer it. */ const confirmDialogTemplate = {
18
+ */ /**
19
+ * Confirm: one question, two answers, and enough context to answer it - the consequences listed, and the confirming button naming what it does
20
+ * (`Archive product`, never `OK`). A destructive confirmation takes the danger tone: the heading and border are drawn in the danger colors and the
21
+ * confirming button is the danger button. The components blueprint has a `ConfirmDialog` of its own for a command; a reference names the blueprint
22
+ * (`resolveTemplateReference`), so the two never collide.
23
+ */ const confirmDialogTemplate = {
19
24
  name: 'ConfirmDialog',
20
25
  slots: [
21
26
  {
@@ -30,32 +35,33 @@ var templateProvenance = require('../templateProvenance.js');
30
35
  ],
31
36
  content: {
32
37
  [TemplateSlotName.TemplateSlotName.Header]: [
33
- elements.text('confirm-title', 'Archive this product?')
34
- ],
35
- [TemplateSlotName.TemplateSlotName.Body]: [
36
- elements.text('confirm-message', 'Bamboo Watch will stop appearing in the catalog. Existing orders keep it.'),
37
- elements.externalComponent('confirm-note', 'message', {
38
- severity: 'warn',
39
- text: 'This can be undone from the archive.'
38
+ elements.externalComponent('confirm-frame', 'dialogFrame', {
39
+ title: 'Archive this product?',
40
+ message: 'Bamboo Watch will stop appearing in the catalog.',
41
+ tone: 'danger',
42
+ consequences: [
43
+ 'Existing orders keep it',
44
+ 'It can be restored from the archive'
45
+ ]
40
46
  })
41
47
  ],
48
+ [TemplateSlotName.TemplateSlotName.Body]: [],
42
49
  [TemplateSlotName.TemplateSlotName.Actions]: [
43
50
  elements.panel('confirm-actions', [
44
- elements.button('confirm-yes', 'Archive', {
45
- severity: 'danger'
46
- }),
47
- elements.button('confirm-no', 'Keep it', {
48
- severity: 'secondary'
51
+ dialogTemplates.closingDialog(dialogTemplates.actionButton('confirm-no', {
52
+ label: 'Keep it',
53
+ emphasis: 'secondary'
54
+ })),
55
+ dialogTemplates.actionButton('confirm-yes', {
56
+ label: 'Archive product',
57
+ emphasis: 'danger'
49
58
  })
50
59
  ])
51
60
  ]
52
61
  },
53
62
  displayName: 'Confirmation dialog',
54
63
  description: 'One question with the consequence spelled out, and a way back.',
55
- metadata: {
56
- ...templateProvenance.defaultBlueprintTemplateProvenance,
57
- category: 'Foundation / Dialog'
58
- }
64
+ metadata: dialogTemplates.dialogMetadata('ConfirmDialog')
59
65
  };
60
66
  /** Form: a short capture that does not deserve a page of its own. */ const formDialogTemplate = {
61
67
  name: 'FormDialog',
@@ -72,7 +78,9 @@ var templateProvenance = require('../templateProvenance.js');
72
78
  ],
73
79
  content: {
74
80
  [TemplateSlotName.TemplateSlotName.Header]: [
75
- elements.text('form-dialog-title', 'Invite someone')
81
+ elements.externalComponent('form-dialog-frame', 'dialogFrame', {
82
+ title: 'Invite someone'
83
+ })
76
84
  ],
77
85
  [TemplateSlotName.TemplateSlotName.Body]: [
78
86
  widgets.field('form-dialog-email', 'Email', 'inputText', {
@@ -91,21 +99,18 @@ var templateProvenance = require('../templateProvenance.js');
91
99
  ],
92
100
  [TemplateSlotName.TemplateSlotName.Actions]: [
93
101
  elements.panel('form-dialog-actions', [
102
+ dialogTemplates.closingDialog(elements.button('form-dialog-cancel', 'Cancel', {
103
+ severity: 'secondary'
104
+ })),
94
105
  elements.button('form-dialog-send', 'Send invitation', {
95
106
  severity: 'primary'
96
- }),
97
- elements.button('form-dialog-cancel', 'Cancel', {
98
- severity: 'secondary'
99
107
  })
100
108
  ])
101
109
  ]
102
110
  },
103
111
  displayName: 'Form dialog',
104
112
  description: 'A handful of fields captured without leaving the page underneath.',
105
- metadata: {
106
- ...templateProvenance.defaultBlueprintTemplateProvenance,
107
- category: 'Foundation / Dialog'
108
- }
113
+ metadata: dialogTemplates.dialogMetadata('FormDialog', true)
109
114
  };
110
115
  /** Detail: a record shown over the list it came from. */ const detailDialogTemplate = {
111
116
  name: 'DetailDialog',
@@ -125,7 +130,9 @@ var templateProvenance = require('../templateProvenance.js');
125
130
  ],
126
131
  content: {
127
132
  [TemplateSlotName.TemplateSlotName.Header]: [
128
- elements.text('detail-dialog-title', 'ORD-4192')
133
+ elements.externalComponent('detail-dialog-frame', 'dialogFrame', {
134
+ title: 'ORD-4192'
135
+ })
129
136
  ],
130
137
  [TemplateSlotName.TemplateSlotName.Body]: [
131
138
  elements.card('detail-dialog-summary', [
@@ -144,27 +151,25 @@ var templateProvenance = require('../templateProvenance.js');
144
151
  ],
145
152
  [TemplateSlotName.TemplateSlotName.Actions]: [
146
153
  elements.panel('detail-dialog-actions', [
154
+ dialogTemplates.closingDialog(elements.button('detail-dialog-close', 'Close', {
155
+ severity: 'secondary'
156
+ })),
147
157
  elements.button('detail-dialog-open', 'Open full record', {
148
158
  severity: 'primary',
149
159
  targetScreen: 'DetailView'
150
- }),
151
- elements.button('detail-dialog-close', 'Close', {
152
- severity: 'secondary'
153
160
  })
154
161
  ])
155
162
  ]
156
163
  },
157
164
  displayName: 'Detail dialog',
158
165
  description: 'A record over the list it came from, with a route to the full page.',
159
- metadata: {
160
- ...templateProvenance.defaultBlueprintTemplateProvenance,
161
- category: 'Foundation / Dialog'
162
- }
166
+ metadata: dialogTemplates.dialogMetadata('DetailDialog', true)
163
167
  };
164
- /** The dialog templates this blueprint provides. */ const galleryDialogTemplates = [
168
+ /** The dialog templates this blueprint provides: the three the gallery began with, and the foundation's quick create, lookup, side sheet and filter dialogs. */ const galleryDialogTemplates = [
165
169
  confirmDialogTemplate,
166
170
  formDialogTemplate,
167
- detailDialogTemplate
171
+ detailDialogTemplate,
172
+ ...dialogTemplates.foundationDialogTemplates
168
173
  ];
169
174
 
170
175
  exports.confirmDialogTemplate = confirmDialogTemplate;
@@ -1 +1 @@
1
- {"version":3,"file":"dialogTemplates.js","sources":["../../../gallery/dialogTemplates.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 { DialogTemplate } from '@cratis/scene.model';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, card, externalComponent, panel, text } from './elements';\nimport { field } from './widgets';\nimport { defaultBlueprintTemplateProvenance } from '../templateProvenance';\n\n/**\n * The three dialog shapes an application repeats: confirm something destructive, capture a short form, and\n * show a record without leaving the list behind it.\n *\n * A dialog template has no `fitsSlot`, and that absence is the whole distinction. A screen template is\n * *placed* - it fills a slot on whatever contains it, and the containment chain is what decides where it\n * appears. A dialog is *summoned*: it opens over the application from wherever the code that opened it\n * happens to be, so there is no parent slot for it to name.\n */\n\n/** Confirm: one question, two answers, and enough context to answer it. */\nexport const confirmDialogTemplate: DialogTemplate = {\n name: 'ConfirmDialog',\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [text('confirm-title', 'Archive this product?')],\n [TemplateSlotName.Body]: [\n text('confirm-message', 'Bamboo Watch will stop appearing in the catalog. Existing orders keep it.'),\n externalComponent('confirm-note', 'message', { severity: 'warn', text: 'This can be undone from the archive.' }),\n ],\n [TemplateSlotName.Actions]: [\n panel('confirm-actions', [button('confirm-yes', 'Archive', { severity: 'danger' }), button('confirm-no', 'Keep it', { severity: 'secondary' })]),\n ],\n },\n displayName: 'Confirmation dialog',\n description: 'One question with the consequence spelled out, and a way back.',\n metadata: { ...defaultBlueprintTemplateProvenance, category: 'Foundation / Dialog' },\n};\n\n/** Form: a short capture that does not deserve a page of its own. */\nexport const formDialogTemplate: DialogTemplate = {\n name: 'FormDialog',\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [text('form-dialog-title', 'Invite someone')],\n [TemplateSlotName.Body]: [\n field('form-dialog-email', 'Email', 'inputText', { placeholder: 'them@contoso.com' }),\n field('form-dialog-role', 'Role', 'dropdown', { options: ['Viewer', 'Editor', 'Administrator'] }),\n field('form-dialog-message', 'Message', 'inputTextarea', { rows: 3 }),\n ],\n [TemplateSlotName.Actions]: [\n panel('form-dialog-actions', [button('form-dialog-send', 'Send invitation', { severity: 'primary' }), button('form-dialog-cancel', 'Cancel', { severity: 'secondary' })]),\n ],\n },\n displayName: 'Form dialog',\n description: 'A handful of fields captured without leaving the page underneath.',\n metadata: { ...defaultBlueprintTemplateProvenance, category: 'Foundation / Dialog' },\n};\n\n/** Detail: a record shown over the list it came from. */\nexport const detailDialogTemplate: DialogTemplate = {\n name: 'DetailDialog',\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [text('detail-dialog-title', 'ORD-4192')],\n [TemplateSlotName.Body]: [\n card('detail-dialog-summary', [\n text('detail-dialog-customer', 'Northwind Traders'),\n text('detail-dialog-total', '$1,240.00'),\n externalComponent('detail-dialog-status', 'tag', { value: 'Shipped', severity: 'success' }),\n ]),\n ],\n [TemplateSlotName.SidePanel]: [externalComponent('detail-dialog-timeline', 'timeline', { align: 'left' })],\n [TemplateSlotName.Actions]: [\n panel('detail-dialog-actions', [button('detail-dialog-open', 'Open full record', { severity: 'primary', targetScreen: 'DetailView' }), button('detail-dialog-close', 'Close', { severity: 'secondary' })]),\n ],\n },\n displayName: 'Detail dialog',\n description: 'A record over the list it came from, with a route to the full page.',\n metadata: { ...defaultBlueprintTemplateProvenance, category: 'Foundation / Dialog' },\n};\n\n/** The dialog templates this blueprint provides. */\nexport const galleryDialogTemplates: DialogTemplate[] = [confirmDialogTemplate, formDialogTemplate, detailDialogTemplate];\n"],"names":["confirmDialogTemplate","name","slots","TemplateSlotName","Header","Body","Actions","content","text","externalComponent","severity","panel","button","displayName","description","metadata","defaultBlueprintTemplateProvenance","category","formDialogTemplate","field","placeholder","options","rows","detailDialogTemplate","SidePanel","card","value","align","targetScreen","galleryDialogTemplates"],"mappings":";;;;;;;AAAA;AACA;AAQA;;;;;;;;AAQC,gFAGM,MAAMA,qBAAAA,GAAwC;IACjDC,IAAAA,EAAM,eAAA;IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,kCAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEH,YAAAA,IAAAA,EAAME,kCAAiBE;AAAK,SAAA;AAAG,QAAA;AAAEJ,YAAAA,IAAAA,EAAME,kCAAiBG;AAAQ;AAAE,KAAA;IAC/GC,OAAAA,EAAS;QACL,CAACJ,iCAAAA,CAAiBC,MAAM,GAAG;AAACI,YAAAA,aAAAA,CAAK,eAAA,EAAiB,uBAAA;AAAyB,SAAA;QAC3E,CAACL,iCAAAA,CAAiBE,IAAI,GAAG;AACrBG,YAAAA,aAAAA,CAAK,iBAAA,EAAmB,2EAAA,CAAA;AACxBC,YAAAA,0BAAAA,CAAkB,gBAAgB,SAAA,EAAW;gBAA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A;AAC5F,aAAA;AACJ,SAAA;QACD,CAACP,iCAAAA,CAAiBqB,SAAS,GAAG;AAACf,YAAAA,0BAAAA,CAAkB,0BAA0B,UAAA,EAAY;gBAAEkB,KAAAA,EAAO;AAAO,aAAA;AAAG,SAAA;QAC1G,CAACxB,iCAAAA,CAAiBG,OAAO,GAAG;AACxBK,YAAAA,cAAAA,CAAM,uBAAA,EAAyB;AAACC,gBAAAA,eAAAA,CAAO,sBAAsB,kBAAA,EAAoB;oBAAEF,QAAAA,EAAU,SAAA;oBAAWkB,YAAAA,EAAc;AAAa,iBAAA,CAAA;AAAIhB,gBAAAA,eAAAA,CAAO,uBAAuB,OAAA,EAAS;oBAAEF,QAAAA,EAAU;AAAY,iBAAA;AAAG,aAAA;AAC5M;AACL,KAAA;IACAG,WAAAA,EAAa,eAAA;IACbC,WAAAA,EAAa,qEAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGC,qDAAkC;QAAEC,QAAAA,EAAU;AAAsB;AACvF;AAEA,qDACO,MAAMY,sBAAAA,GAA2C;AAAC7B,IAAAA,qBAAAA;AAAuBkB,IAAAA,kBAAAA;AAAoBK,IAAAA;;;;;;"}
1
+ {"version":3,"file":"dialogTemplates.js","sources":["../../../gallery/dialogTemplates.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 { DialogTemplate } from '@cratis/scene.model';\nimport { actionButton, closingDialog, dialogMetadata, foundationDialogTemplates } from '../foundation/templates/dialogTemplates';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, card, externalComponent, panel, text } from './elements';\nimport { field } from './widgets';\n\n/**\n * The three dialog shapes an application repeats: confirm something destructive, capture a short form, and\n * show a record without leaving the list behind it.\n *\n * A dialog template has no `fitsSlot`, and that absence is the whole distinction. A screen template is\n * *placed* - it fills a slot on whatever contains it, and the containment chain is what decides where it\n * appears. A dialog is *summoned*: it opens over the application from wherever the code that opened it\n * happens to be, so there is no parent slot for it to name.\n */\n\n/**\n * Confirm: one question, two answers, and enough context to answer it - the consequences listed, and the confirming button naming what it does\n * (`Archive product`, never `OK`). A destructive confirmation takes the danger tone: the heading and border are drawn in the danger colors and the\n * confirming button is the danger button. The components blueprint has a `ConfirmDialog` of its own for a command; a reference names the blueprint\n * (`resolveTemplateReference`), so the two never collide.\n */\nexport const confirmDialogTemplate: DialogTemplate = {\n name: 'ConfirmDialog',\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [externalComponent('confirm-frame', 'dialogFrame', {\n title: 'Archive this product?', message: 'Bamboo Watch will stop appearing in the catalog.', tone: 'danger',\n consequences: ['Existing orders keep it', 'It can be restored from the archive'],\n })],\n [TemplateSlotName.Body]: [],\n [TemplateSlotName.Actions]: [\n panel('confirm-actions', [closingDialog(actionButton('confirm-no', { label: 'Keep it', emphasis: 'secondary' })), actionButton('confirm-yes', { label: 'Archive product', emphasis: 'danger' })]),\n ],\n },\n displayName: 'Confirmation dialog',\n description: 'One question with the consequence spelled out, and a way back.',\n metadata: dialogMetadata('ConfirmDialog'),\n};\n\n/** Form: a short capture that does not deserve a page of its own. */\nexport const formDialogTemplate: DialogTemplate = {\n name: 'FormDialog',\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [externalComponent('form-dialog-frame', 'dialogFrame', { title: 'Invite someone' })],\n [TemplateSlotName.Body]: [\n field('form-dialog-email', 'Email', 'inputText', { placeholder: 'them@contoso.com' }),\n field('form-dialog-role', 'Role', 'dropdown', { options: ['Viewer', 'Editor', 'Administrator'] }),\n field('form-dialog-message', 'Message', 'inputTextarea', { rows: 3 }),\n ],\n [TemplateSlotName.Actions]: [\n panel('form-dialog-actions', [closingDialog(button('form-dialog-cancel', 'Cancel', { severity: 'secondary' })), button('form-dialog-send', 'Send invitation', { severity: 'primary' })]),\n ],\n },\n displayName: 'Form dialog',\n description: 'A handful of fields captured without leaving the page underneath.',\n metadata: dialogMetadata('FormDialog', true),\n};\n\n/** Detail: a record shown over the list it came from. */\nexport const detailDialogTemplate: DialogTemplate = {\n name: 'DetailDialog',\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [externalComponent('detail-dialog-frame', 'dialogFrame', { title: 'ORD-4192' })],\n [TemplateSlotName.Body]: [\n card('detail-dialog-summary', [\n text('detail-dialog-customer', 'Northwind Traders'),\n text('detail-dialog-total', '$1,240.00'),\n externalComponent('detail-dialog-status', 'tag', { value: 'Shipped', severity: 'success' }),\n ]),\n ],\n [TemplateSlotName.SidePanel]: [externalComponent('detail-dialog-timeline', 'timeline', { align: 'left' })],\n [TemplateSlotName.Actions]: [\n panel('detail-dialog-actions', [closingDialog(button('detail-dialog-close', 'Close', { severity: 'secondary' })), button('detail-dialog-open', 'Open full record', { severity: 'primary', targetScreen: 'DetailView' })]),\n ],\n },\n displayName: 'Detail dialog',\n description: 'A record over the list it came from, with a route to the full page.',\n metadata: dialogMetadata('DetailDialog', true),\n};\n\n/** The dialog templates this blueprint provides: the three the gallery began with, and the foundation's quick create, lookup, side sheet and filter dialogs. */\nexport const galleryDialogTemplates: DialogTemplate[] = [confirmDialogTemplate, formDialogTemplate, detailDialogTemplate, ...foundationDialogTemplates];\n"],"names":["confirmDialogTemplate","name","slots","TemplateSlotName","Header","Body","Actions","content","externalComponent","title","message","tone","consequences","panel","closingDialog","actionButton","label","emphasis","displayName","description","metadata","dialogMetadata","formDialogTemplate","field","placeholder","options","rows","button","severity","detailDialogTemplate","SidePanel","card","text","value","align","targetScreen","galleryDialogTemplates","foundationDialogTemplates"],"mappings":";;;;;;;AAAA;AACA;AAQA;;;;;;;;;;;;;UAgBaA,qBAAAA,GAAwC;IACjDC,IAAAA,EAAM,eAAA;IACNC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