@cratis/scene.blueprint.default 4.12.0 → 4.14.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 (121) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/gallery/GalleryScreenPreview.js +6 -3
  3. package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -1
  4. package/dist/cjs/gallery/TemplatePreviewState.js +17 -0
  5. package/dist/cjs/gallery/TemplatePreviewState.js.map +1 -0
  6. package/dist/cjs/gallery/applyTemplatePreviewState.js +91 -0
  7. package/dist/cjs/gallery/applyTemplatePreviewState.js.map +1 -0
  8. package/dist/cjs/gallery/authTemplates.js +25 -6
  9. package/dist/cjs/gallery/authTemplates.js.map +1 -1
  10. package/dist/cjs/gallery/dialogTemplates.js +13 -3
  11. package/dist/cjs/gallery/dialogTemplates.js.map +1 -1
  12. package/dist/cjs/gallery/navigation.js +7 -0
  13. package/dist/cjs/gallery/navigation.js.map +1 -1
  14. package/dist/cjs/gallery/nesting.js +13 -3
  15. package/dist/cjs/gallery/nesting.js.map +1 -1
  16. package/dist/cjs/gallery/screens.js +10 -1
  17. package/dist/cjs/gallery/screens.js.map +1 -1
  18. package/dist/cjs/gallery/statusTemplates.js +19 -5
  19. package/dist/cjs/gallery/statusTemplates.js.map +1 -1
  20. package/dist/cjs/gallery/supportTemplates.js +23 -6
  21. package/dist/cjs/gallery/supportTemplates.js.map +1 -1
  22. package/dist/cjs/gallery/widgets.js +20 -6
  23. package/dist/cjs/gallery/widgets.js.map +1 -1
  24. package/dist/cjs/gallery/workspaceTemplates.js +137 -8
  25. package/dist/cjs/gallery/workspaceTemplates.js.map +1 -1
  26. package/dist/cjs/index.js +10 -0
  27. package/dist/cjs/index.js.map +1 -1
  28. package/dist/cjs/layouts/appShell.js +5 -1
  29. package/dist/cjs/layouts/appShell.js.map +1 -1
  30. package/dist/cjs/layouts/fullPage.js +5 -1
  31. package/dist/cjs/layouts/fullPage.js.map +1 -1
  32. package/dist/cjs/templateProvenance.js +46 -0
  33. package/dist/cjs/templateProvenance.js.map +1 -0
  34. package/dist/esm/gallery/ApplicationScreens.stories.d.ts +1 -0
  35. package/dist/esm/gallery/ApplicationScreens.stories.d.ts.map +1 -1
  36. package/dist/esm/gallery/ApplicationScreens.stories.js +2 -1
  37. package/dist/esm/gallery/ApplicationScreens.stories.js.map +1 -1
  38. package/dist/esm/gallery/GalleryScreenPreview.d.ts +3 -1
  39. package/dist/esm/gallery/GalleryScreenPreview.d.ts.map +1 -1
  40. package/dist/esm/gallery/GalleryScreenPreview.js +6 -3
  41. package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -1
  42. package/dist/esm/gallery/PreviewStates.stories.d.ts +36 -0
  43. package/dist/esm/gallery/PreviewStates.stories.d.ts.map +1 -0
  44. package/dist/esm/gallery/PreviewStates.stories.js +27 -0
  45. package/dist/esm/gallery/PreviewStates.stories.js.map +1 -0
  46. package/dist/esm/gallery/TemplatePreviewState.d.ts +7 -0
  47. package/dist/esm/gallery/TemplatePreviewState.d.ts.map +1 -0
  48. package/dist/esm/gallery/TemplatePreviewState.js +15 -0
  49. package/dist/esm/gallery/TemplatePreviewState.js.map +1 -0
  50. package/dist/esm/gallery/applyTemplatePreviewState.d.ts +6 -0
  51. package/dist/esm/gallery/applyTemplatePreviewState.d.ts.map +1 -0
  52. package/dist/esm/gallery/applyTemplatePreviewState.js +87 -0
  53. package/dist/esm/gallery/applyTemplatePreviewState.js.map +1 -0
  54. package/dist/esm/gallery/authTemplates.d.ts.map +1 -1
  55. package/dist/esm/gallery/authTemplates.js +25 -6
  56. package/dist/esm/gallery/authTemplates.js.map +1 -1
  57. package/dist/esm/gallery/dialogTemplates.d.ts.map +1 -1
  58. package/dist/esm/gallery/dialogTemplates.js +13 -3
  59. package/dist/esm/gallery/dialogTemplates.js.map +1 -1
  60. package/dist/esm/gallery/index.d.ts +2 -0
  61. package/dist/esm/gallery/index.d.ts.map +1 -1
  62. package/dist/esm/gallery/index.js +2 -0
  63. package/dist/esm/gallery/index.js.map +1 -1
  64. package/dist/esm/gallery/navigation.d.ts.map +1 -1
  65. package/dist/esm/gallery/navigation.js +7 -0
  66. package/dist/esm/gallery/navigation.js.map +1 -1
  67. package/dist/esm/gallery/nesting.d.ts.map +1 -1
  68. package/dist/esm/gallery/nesting.js +13 -3
  69. package/dist/esm/gallery/nesting.js.map +1 -1
  70. package/dist/esm/gallery/screens.d.ts.map +1 -1
  71. package/dist/esm/gallery/screens.js +10 -1
  72. package/dist/esm/gallery/screens.js.map +1 -1
  73. package/dist/esm/gallery/statusTemplates.d.ts.map +1 -1
  74. package/dist/esm/gallery/statusTemplates.js +19 -5
  75. package/dist/esm/gallery/statusTemplates.js.map +1 -1
  76. package/dist/esm/gallery/supportTemplates.d.ts.map +1 -1
  77. package/dist/esm/gallery/supportTemplates.js +23 -6
  78. package/dist/esm/gallery/supportTemplates.js.map +1 -1
  79. package/dist/esm/gallery/widgets.d.ts +1 -1
  80. package/dist/esm/gallery/widgets.d.ts.map +1 -1
  81. package/dist/esm/gallery/widgets.js +20 -6
  82. package/dist/esm/gallery/widgets.js.map +1 -1
  83. package/dist/esm/gallery/workspaceTemplates.d.ts +1 -0
  84. package/dist/esm/gallery/workspaceTemplates.d.ts.map +1 -1
  85. package/dist/esm/gallery/workspaceTemplates.js +139 -11
  86. package/dist/esm/gallery/workspaceTemplates.js.map +1 -1
  87. package/dist/esm/index.d.ts +1 -0
  88. package/dist/esm/index.d.ts.map +1 -1
  89. package/dist/esm/index.js +4 -1
  90. package/dist/esm/index.js.map +1 -1
  91. package/dist/esm/layouts/appShell.d.ts.map +1 -1
  92. package/dist/esm/layouts/appShell.js +5 -1
  93. package/dist/esm/layouts/appShell.js.map +1 -1
  94. package/dist/esm/layouts/fullPage.d.ts.map +1 -1
  95. package/dist/esm/layouts/fullPage.js +5 -1
  96. package/dist/esm/layouts/fullPage.js.map +1 -1
  97. package/dist/esm/templateProvenance.d.ts +4 -0
  98. package/dist/esm/templateProvenance.d.ts.map +1 -0
  99. package/dist/esm/templateProvenance.js +43 -0
  100. package/dist/esm/templateProvenance.js.map +1 -0
  101. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  102. package/gallery/ApplicationScreens.stories.tsx +4 -1
  103. package/gallery/GalleryScreenPreview.tsx +8 -3
  104. package/gallery/PreviewStates.stories.tsx +56 -0
  105. package/gallery/TemplatePreviewState.ts +20 -0
  106. package/gallery/applyTemplatePreviewState.ts +69 -0
  107. package/gallery/authTemplates.ts +7 -0
  108. package/gallery/dialogTemplates.ts +4 -0
  109. package/gallery/index.ts +2 -0
  110. package/gallery/navigation.ts +1 -0
  111. package/gallery/nesting.ts +4 -0
  112. package/gallery/screens.ts +2 -1
  113. package/gallery/statusTemplates.ts +6 -1
  114. package/gallery/supportTemplates.ts +7 -1
  115. package/gallery/widgets.ts +14 -5
  116. package/gallery/workspaceTemplates.ts +64 -4
  117. package/index.ts +1 -0
  118. package/layouts/appShell.ts +2 -0
  119. package/layouts/fullPage.ts +2 -0
  120. package/package.json +8 -7
  121. package/templateProvenance.ts +37 -0
@@ -0,0 +1,87 @@
1
+ import { TemplatePreviewState } from './TemplatePreviewState.js';
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
+ /** What a table in a preview says when its data could not be loaded. */ const previewErrorMessage = 'The data could not be loaded. Try again in a moment.';
6
+ /**
7
+ * Puts every data-bearing element of a composed screen into one data state, leaving everything else - the
8
+ * shell, headers, actions and static content - exactly as authored.
9
+ *
10
+ * A data-bearing element is one whose `rows` are records: the seeded rows are what a query would return,
11
+ * so the states are expressed as a query's outcomes in the table's own vocabulary - no rows, `loading`, or
12
+ * an `error` message - rather than by swapping in a different component. The authored tree is not changed.
13
+ */ function applyTemplatePreviewState(element, state) {
14
+ if (state === TemplatePreviewState.Populated) return element;
15
+ return transform(element, state);
16
+ }
17
+ /** Whether a composed screen contains anything a data state changes. */ function hasPreviewData(element) {
18
+ const properties = element.properties;
19
+ if (isDataBearing(properties)) return true;
20
+ return childrenOf(element).some(hasPreviewData);
21
+ }
22
+ function transform(element, state) {
23
+ const external = element;
24
+ const panel = element;
25
+ let result = element;
26
+ if (isDataBearing(external.properties)) {
27
+ result = {
28
+ ...result,
29
+ properties: {
30
+ ...external.properties,
31
+ ...stateProperties(state)
32
+ }
33
+ };
34
+ }
35
+ if (external.slots) {
36
+ const slots = Object.fromEntries(Object.entries(external.slots).map(([name, children])=>[
37
+ name,
38
+ children.map((child)=>transform(child, state))
39
+ ]));
40
+ result = {
41
+ ...result,
42
+ slots
43
+ };
44
+ }
45
+ if (Array.isArray(panel.children)) {
46
+ result = {
47
+ ...result,
48
+ children: panel.children.map((child)=>transform(child, state))
49
+ };
50
+ }
51
+ return result;
52
+ }
53
+ function stateProperties(state) {
54
+ switch(state){
55
+ case TemplatePreviewState.Empty:
56
+ return {
57
+ rows: []
58
+ };
59
+ case TemplatePreviewState.Loading:
60
+ return {
61
+ rows: [],
62
+ loading: true
63
+ };
64
+ case TemplatePreviewState.Error:
65
+ return {
66
+ rows: [],
67
+ error: previewErrorMessage
68
+ };
69
+ default:
70
+ return {};
71
+ }
72
+ }
73
+ function isDataBearing(properties) {
74
+ const rows = properties?.rows;
75
+ return Array.isArray(rows) && rows.every((row)=>typeof row === 'object' && row !== null && !Array.isArray(row));
76
+ }
77
+ function childrenOf(element) {
78
+ const external = element;
79
+ const panel = element;
80
+ return [
81
+ ...Object.values(external.slots ?? {}).flat(),
82
+ ...Array.isArray(panel.children) ? panel.children : []
83
+ ];
84
+ }
85
+
86
+ export { applyTemplatePreviewState, hasPreviewData, previewErrorMessage };
87
+ //# sourceMappingURL=applyTemplatePreviewState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyTemplatePreviewState.js","sources":["../../../gallery/applyTemplatePreviewState.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, Panel, SceneElement } from '@cratis/scene.model';\nimport { TemplatePreviewState } from './TemplatePreviewState';\n\n/** What a table in a preview says when its data could not be loaded. */\nexport const previewErrorMessage = 'The data could not be loaded. Try again in a moment.';\n\n/**\n * Puts every data-bearing element of a composed screen into one data state, leaving everything else - the\n * shell, headers, actions and static content - exactly as authored.\n *\n * A data-bearing element is one whose `rows` are records: the seeded rows are what a query would return,\n * so the states are expressed as a query's outcomes in the table's own vocabulary - no rows, `loading`, or\n * an `error` message - rather than by swapping in a different component. The authored tree is not changed.\n */\nexport function applyTemplatePreviewState<T extends SceneElement>(element: T, state: TemplatePreviewState): T {\n if (state === TemplatePreviewState.Populated) return element;\n return transform(element, state) as T;\n}\n\n/** Whether a composed screen contains anything a data state changes. */\nexport function hasPreviewData(element: SceneElement): boolean {\n const properties = (element as Partial<ExternalComponent>).properties;\n if (isDataBearing(properties)) return true;\n return childrenOf(element).some(hasPreviewData);\n}\n\nfunction transform(element: SceneElement, state: TemplatePreviewState): SceneElement {\n const external = element as Partial<ExternalComponent>;\n const panel = element as Partial<Panel>;\n let result: SceneElement = element;\n\n if (isDataBearing(external.properties)) {\n result = { ...result, properties: { ...external.properties, ...stateProperties(state) } } as SceneElement;\n }\n\n if (external.slots) {\n const slots = Object.fromEntries(Object.entries(external.slots).map(([name, children]) => [name, children.map(child => transform(child, state))]));\n result = { ...result, slots } as SceneElement;\n }\n\n if (Array.isArray(panel.children)) {\n result = { ...result, children: panel.children.map(child => transform(child, state)) } as SceneElement;\n }\n\n return result;\n}\n\nfunction stateProperties(state: TemplatePreviewState): Record<string, unknown> {\n switch (state) {\n case TemplatePreviewState.Empty: return { rows: [] };\n case TemplatePreviewState.Loading: return { rows: [], loading: true };\n case TemplatePreviewState.Error: return { rows: [], error: previewErrorMessage };\n default: return {};\n }\n}\n\nfunction isDataBearing(properties: Record<string, unknown> | undefined): boolean {\n const rows = properties?.rows;\n return Array.isArray(rows) && rows.every(row => typeof row === 'object' && row !== null && !Array.isArray(row));\n}\n\nfunction childrenOf(element: SceneElement): SceneElement[] {\n const external = element as Partial<ExternalComponent>;\n const panel = element as Partial<Panel>;\n return [...Object.values(external.slots ?? {}).flat(), ...(Array.isArray(panel.children) ? panel.children : [])];\n}\n"],"names":["previewErrorMessage","applyTemplatePreviewState","element","state","TemplatePreviewState","Populated","transform","hasPreviewData","properties","isDataBearing","childrenOf","some","external","panel","result","stateProperties","slots","Object","fromEntries","entries","map","name","children","child","Array","isArray","Empty","rows","Loading","loading","Error","error","every","row","values","flat"],"mappings":";;AAAA;AACA;AAKA,yEACO,MAAMA,mBAAAA,GAAsB;AAEnC;;;;;;;AAOC,IACM,SAASC,yBAAAA,CAAkDC,OAAU,EAAEC,KAA2B,EAAA;AACrG,IAAA,IAAIA,KAAAA,KAAUC,oBAAAA,CAAqBC,SAAS,EAAE,OAAOH,OAAAA;AACrD,IAAA,OAAOI,UAAUJ,OAAAA,EAASC,KAAAA,CAAAA;AAC9B;AAEA,yEACO,SAASI,cAAAA,CAAeL,OAAqB,EAAA;IAChD,MAAMM,UAAAA,GAAa,OAACN,CAAuCM,UAAU;IACrE,IAAIC,aAAAA,CAAcD,aAAa,OAAO,IAAA;IACtC,OAAOE,UAAAA,CAAWR,OAAAA,CAAAA,CAASS,IAAI,CAACJ,cAAAA,CAAAA;AACpC;AAEA,SAASD,SAAAA,CAAUJ,OAAqB,EAAEC,KAA2B,EAAA;AACjE,IAAA,MAAMS,QAAAA,GAAWV,OAAAA;AACjB,IAAA,MAAMW,KAAAA,GAAQX,OAAAA;AACd,IAAA,IAAIY,MAAAA,GAAuBZ,OAAAA;IAE3B,IAAIO,aAAAA,CAAcG,QAAAA,CAASJ,UAAU,CAAA,EAAG;QACpCM,MAAAA,GAAS;AAAE,YAAA,GAAGA,MAAM;YAAEN,UAAAA,EAAY;AAAE,gBAAA,GAAGI,SAASJ,UAAU;AAAE,gBAAA,GAAGO,gBAAgBZ,KAAAA;AAAO;AAAE,SAAA;AAC5F,IAAA;IAEA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EAAYmB,IAAAA;AACzB,IAAA,OAAOH,MAAMC,OAAO,CAACE,IAAAA,CAAAA,IAASA,IAAAA,CAAKK,KAAK,CAACC,CAAAA,GAAAA,GAAO,OAAOA,QAAQ,QAAA,IAAYA,GAAAA,KAAQ,QAAQ,CAACT,KAAAA,CAAMC,OAAO,CAACQ,GAAAA,CAAAA,CAAAA;AAC9G;AAEA,SAASvB,WAAWR,OAAqB,EAAA;AACrC,IAAA,MAAMU,QAAAA,GAAWV,OAAAA;AACjB,IAAA,MAAMW,KAAAA,GAAQX,OAAAA;IACd,OAAO;AAAIe,QAAAA,GAAAA,MAAAA,CAAOiB,MAAM,CAACtB,QAAAA,CAASI,KAAK,IAAI,IAAImB,IAAI,EAAA;WAAQX,KAAAA,CAAMC,OAAO,CAACZ,KAAAA,CAAMS,QAAQ,IAAIT,KAAAA,CAAMS,QAAQ,GAAG;AAAI,KAAA;AACpH;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"authTemplates.d.ts","sourceRoot":"","sources":["../../../gallery/authTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA2BrD,eAAO,MAAM,aAAa,EAAE,cAmB3B,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,cAmB9B,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,cAgBpC,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,cAiBjC,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,cAiBlC,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,cAiBhC,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE,cAAc,EAOzC,CAAC"}
1
+ {"version":3,"file":"authTemplates.d.ts","sourceRoot":"","sources":["../../../gallery/authTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA4BrD,eAAO,MAAM,aAAa,EAAE,cAoB3B,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,cAoB9B,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,cAiBpC,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,cAkBjC,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,cAkBlC,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,cAkBhC,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE,cAAc,EAOzC,CAAC"}
@@ -7,6 +7,7 @@ import '../layouts/fullPage.js';
7
7
  import { TemplateSlotName } from './TemplateSlotName.js';
8
8
  import { card, text, button, externalComponent } from './elements.js';
9
9
  import { field, formActions } from './widgets.js';
10
+ import { defaultBlueprintTemplateProvenance } from '../templateProvenance.js';
10
11
 
11
12
  // Copyright (c) Cratis. All rights reserved.
12
13
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
@@ -60,7 +61,10 @@ import { field, formActions } from './widgets.js';
60
61
  ]
61
62
  },
62
63
  displayName: 'Sign in',
63
- description: 'Email and password beside the branding panel.'
64
+ description: 'Email and password beside the branding panel.',
65
+ metadata: {
66
+ ...defaultBlueprintTemplateProvenance
67
+ }
64
68
  };
65
69
  /** Register. */ const registerTemplate = {
66
70
  name: 'Register',
@@ -91,7 +95,10 @@ import { field, formActions } from './widgets.js';
91
95
  ]
92
96
  },
93
97
  displayName: 'Register',
94
- description: 'Account creation with a password strength meter and the terms checkbox.'
98
+ description: 'Account creation with a password strength meter and the terms checkbox.',
99
+ metadata: {
100
+ ...defaultBlueprintTemplateProvenance
101
+ }
95
102
  };
96
103
  /** Forgotten password: ask for the address. */ const forgotPasswordTemplate = {
97
104
  name: 'ForgotPassword',
@@ -117,7 +124,10 @@ import { field, formActions } from './widgets.js';
117
124
  ]
118
125
  },
119
126
  displayName: 'Forgotten password',
120
- description: 'One field and one button - the whole point is that it asks for nothing else.'
127
+ description: 'One field and one button - the whole point is that it asks for nothing else.',
128
+ metadata: {
129
+ ...defaultBlueprintTemplateProvenance
130
+ }
121
131
  };
122
132
  /** New password: the other end of the link. */ const newPasswordTemplate = {
123
133
  name: 'NewPassword',
@@ -146,7 +156,10 @@ import { field, formActions } from './widgets.js';
146
156
  ]
147
157
  },
148
158
  displayName: 'New password',
149
- description: 'Where a reset link lands: choose it, confirm it, done.'
159
+ description: 'Where a reset link lands: choose it, confirm it, done.',
160
+ metadata: {
161
+ ...defaultBlueprintTemplateProvenance
162
+ }
150
163
  };
151
164
  /** Verification: the code from the email. */ const verificationTemplate = {
152
165
  name: 'Verification',
@@ -180,7 +193,10 @@ import { field, formActions } from './widgets.js';
180
193
  ]
181
194
  },
182
195
  displayName: 'Verification',
183
- description: 'The code step, with the progress indicator that tells you how much is left.'
196
+ description: 'The code step, with the progress indicator that tells you how much is left.',
197
+ metadata: {
198
+ ...defaultBlueprintTemplateProvenance
199
+ }
184
200
  };
185
201
  /** Lock screen: the session is still there, the person has to prove they are. */ const lockScreenTemplate = {
186
202
  name: 'LockScreen',
@@ -211,7 +227,10 @@ import { field, formActions } from './widgets.js';
211
227
  ]
212
228
  },
213
229
  displayName: 'Lock screen',
214
- description: 'One person, one password, and no way to lose what was open.'
230
+ description: 'One person, one password, and no way to lose what was open.',
231
+ metadata: {
232
+ ...defaultBlueprintTemplateProvenance
233
+ }
215
234
  };
216
235
  /** The six authentication templates. */ const authTemplates = [
217
236
  loginTemplate,
@@ -1 +1 @@
1
- {"version":3,"file":"authTemplates.js","sources":["../../../gallery/authTemplates.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 { ScreenTemplate } from '@cratis/scene.model';\nimport { ComponentName } from '../ComponentName';\nimport { SlotName } from '../layouts';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, card, externalComponent, text } from './elements';\nimport { field, formActions } from './widgets';\n\n/**\n * The six screens that stand between someone and the application: sign in, register, forgotten password,\n * new password, verification and the lock screen.\n *\n * All six fit the full-page layout's `content` slot and fill its `aside` with the branding half. That\n * split - a colored panel of brand next to a narrow column of form - is the shape the premium PrimeTek\n * templates use for every one of them, and the reason it works is that it gives the form somewhere to be\n * *small*, which is what a sign-in form should be.\n */\n\n/** The branding half every authentication screen shares. */\nfunction brandingAside(id: string, headline: string, supporting: string) {\n return [\n externalComponent(`${id}-logo`, ComponentName.Logo, { label: 'Contoso', initials: 'C' }),\n text(`${id}-headline`, headline),\n text(`${id}-supporting`, supporting),\n ];\n}\n\n/** Sign in. */\nexport const loginTemplate: ScreenTemplate = {\n name: 'Login',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('login', 'Welcome back', 'Everything your team shipped since you were last here is waiting.'),\n [TemplateSlotName.Body]: [\n card('login-card', [\n text('login-title', 'Sign in'),\n field('login-email', 'Email', 'inputText', { placeholder: 'you@contoso.com' }),\n field('login-password', 'Password', 'password', { feedback: false }),\n field('login-remember', 'Keep me signed in', 'checkbox', {}),\n formActions('login-actions', 'Sign in', 'Use a different account'),\n button('login-forgot', 'I forgot my password', { link: true, targetScreen: 'ForgotPassword' }),\n ]),\n ],\n },\n displayName: 'Sign in',\n description: 'Email and password beside the branding panel.',\n};\n\n/** Register. */\nexport const registerTemplate: ScreenTemplate = {\n name: 'Register',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('register', 'Start in two minutes', 'No card, no call, no sales engineer. Just an account.'),\n [TemplateSlotName.Body]: [\n card('register-card', [\n text('register-title', 'Create your account'),\n field('register-name', 'Full name', 'inputText', {}),\n field('register-email', 'Work email', 'inputText', { placeholder: 'you@contoso.com' }),\n field('register-password', 'Password', 'password', { feedback: true }),\n field('register-terms', 'I accept the terms of service', 'checkbox', {}),\n formActions('register-actions', 'Create account', 'I already have one'),\n ]),\n ],\n },\n displayName: 'Register',\n description: 'Account creation with a password strength meter and the terms checkbox.',\n};\n\n/** Forgotten password: ask for the address. */\nexport const forgotPasswordTemplate: ScreenTemplate = {\n name: 'ForgotPassword',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('forgot', 'It happens', 'Tell us the address you signed up with and we will send a link.'),\n [TemplateSlotName.Body]: [\n card('forgot-card', [\n text('forgot-title', 'Reset your password'),\n field('forgot-email', 'Email', 'inputText', { placeholder: 'you@contoso.com' }),\n formActions('forgot-actions', 'Send the link', 'Back to sign in'),\n ]),\n ],\n },\n displayName: 'Forgotten password',\n description: 'One field and one button - the whole point is that it asks for nothing else.',\n};\n\n/** New password: the other end of the link. */\nexport const newPasswordTemplate: ScreenTemplate = {\n name: 'NewPassword',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('new-password', 'Almost there', 'Choose something you have not used anywhere else.'),\n [TemplateSlotName.Body]: [\n card('new-password-card', [\n text('new-password-title', 'Choose a new password'),\n field('new-password-value', 'New password', 'password', { feedback: true }),\n field('new-password-confirm', 'Confirm it', 'password', { feedback: false }),\n formActions('new-password-actions', 'Set the password', 'Cancel'),\n ]),\n ],\n },\n displayName: 'New password',\n description: 'Where a reset link lands: choose it, confirm it, done.',\n};\n\n/** Verification: the code from the email. */\nexport const verificationTemplate: ScreenTemplate = {\n name: 'Verification',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('verification', 'Check your email', 'We sent a six-digit code. It expires in ten minutes.'),\n [TemplateSlotName.Body]: [\n card('verification-card', [\n text('verification-title', 'Enter the code'),\n externalComponent('verification-steps', 'steps', { model: ['Account', 'Verify', 'Done'], activeIndex: 1 }),\n field('verification-code', 'Six-digit code', 'inputText', { maxLength: 6 }),\n formActions('verification-actions', 'Verify', 'Send it again'),\n ]),\n ],\n },\n displayName: 'Verification',\n description: 'The code step, with the progress indicator that tells you how much is left.',\n};\n\n/** Lock screen: the session is still there, the person has to prove they are. */\nexport const lockScreenTemplate: ScreenTemplate = {\n name: 'LockScreen',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('lock', 'Locked', 'Your work is exactly where you left it.'),\n [TemplateSlotName.Body]: [\n card('lock-card', [\n externalComponent('lock-avatar', 'avatar', { label: 'AN', size: 'xlarge', shape: 'circle' }),\n text('lock-name', 'Amelia Nyquist'),\n field('lock-password', 'Password', 'password', { feedback: false }),\n formActions('lock-actions', 'Unlock', 'Sign in as someone else'),\n ]),\n ],\n },\n displayName: 'Lock screen',\n description: 'One person, one password, and no way to lose what was open.',\n};\n\n/** The six authentication templates. */\nexport const authTemplates: ScreenTemplate[] = [\n loginTemplate,\n registerTemplate,\n forgotPasswordTemplate,\n newPasswordTemplate,\n verificationTemplate,\n lockScreenTemplate,\n];\n"],"names":["brandingAside","id","headline","supporting","externalComponent","ComponentName","Logo","label","initials","text","loginTemplate","name","fitsSlot","SlotName","Content","slots","Aside","TemplateSlotName","Body","content","card","field","placeholder","feedback","formActions","button","link","targetScreen","displayName","description","registerTemplate","forgotPasswordTemplate","newPasswordTemplate","verificationTemplate","model","activeIndex","maxLength","lockScreenTemplate","size","shape","authTemplates"],"mappings":";;;;;;;;;;AAAA;AACA;AASA;;;;;;;;iEAWA,SAASA,aAAAA,CAAcC,EAAU,EAAEC,QAAgB,EAAEC,UAAkB,EAAA;IACnE,OAAO;AACHC,QAAAA,iBAAAA,CAAkB,GAAGH,EAAAA,CAAG,KAAK,CAAC,EAAEI,aAAAA,CAAcC,IAAI,EAAE;YAAEC,KAAAA,EAAO,SAAA;YAAWC,QAAAA,EAAU;AAAI,SAAA,CAAA;AACtFC,QAAAA,IAAAA,CAAK,CAAA,EAAGR,EAAAA,CAAG,SAAS,CAAC,EAAEC,QAAAA,CAAAA;AACvBO,QAAA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,IAAI,GAAG;AACrBE,YAAAA,IAAAA,CAAK,WAAA,EAAa;AACdhB,gBAAAA,iBAAAA,CAAkB,eAAe,QAAA,EAAU;oBAAEG,KAAAA,EAAO,IAAA;oBAAM+B,IAAAA,EAAM,QAAA;oBAAUC,KAAAA,EAAO;AAAS,iBAAA,CAAA;AAC1F9B,gBAAAA,IAAAA,CAAK,WAAA,EAAa,gBAAA,CAAA;gBAClBY,KAAAA,CAAM,eAAA,EAAiB,YAAY,UAAA,EAAY;oBAAEE,QAAAA,EAAU;AAAM,iBAAA,CAAA;AACjEC,gBAAAA,WAAAA,CAAY,gBAAgB,QAAA,EAAU,yBAAA;AACzC,aAAA;AACJ;AACL,KAAA;IACAI,WAAAA,EAAa,aAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,yCACO,MAAMW,aAAAA,GAAkC;AAC3C9B,IAAAA,aAAAA;AACAoB,IAAAA,gBAAAA;AACAC,IAAAA,sBAAAA;AACAC,IAAAA,mBAAAA;AACAC,IAAAA,oBAAAA;AACAI,IAAAA;;;"}
1
+ {"version":3,"file":"authTemplates.js","sources":["../../../gallery/authTemplates.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 { ScreenTemplate } from '@cratis/scene.model';\nimport { ComponentName } from '../ComponentName';\nimport { SlotName } from '../layouts';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, card, externalComponent, text } from './elements';\nimport { field, formActions } from './widgets';\nimport { defaultBlueprintTemplateProvenance } from '../templateProvenance';\n\n/**\n * The six screens that stand between someone and the application: sign in, register, forgotten password,\n * new password, verification and the lock screen.\n *\n * All six fit the full-page layout's `content` slot and fill its `aside` with the branding half. That\n * split - a colored panel of brand next to a narrow column of form - is the shape the premium PrimeTek\n * templates use for every one of them, and the reason it works is that it gives the form somewhere to be\n * *small*, which is what a sign-in form should be.\n */\n\n/** The branding half every authentication screen shares. */\nfunction brandingAside(id: string, headline: string, supporting: string) {\n return [\n externalComponent(`${id}-logo`, ComponentName.Logo, { label: 'Contoso', initials: 'C' }),\n text(`${id}-headline`, headline),\n text(`${id}-supporting`, supporting),\n ];\n}\n\n/** Sign in. */\nexport const loginTemplate: ScreenTemplate = {\n name: 'Login',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('login', 'Welcome back', 'Everything your team shipped since you were last here is waiting.'),\n [TemplateSlotName.Body]: [\n card('login-card', [\n text('login-title', 'Sign in'),\n field('login-email', 'Email', 'inputText', { placeholder: 'you@contoso.com' }),\n field('login-password', 'Password', 'password', { feedback: false }),\n field('login-remember', 'Keep me signed in', 'checkbox', {}),\n formActions('login-actions', 'Sign in', 'Use a different account'),\n button('login-forgot', 'I forgot my password', { link: true, targetScreen: 'ForgotPassword' }),\n ]),\n ],\n },\n displayName: 'Sign in',\n description: 'Email and password beside the branding panel.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** Register. */\nexport const registerTemplate: ScreenTemplate = {\n name: 'Register',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('register', 'Start in two minutes', 'No card, no call, no sales engineer. Just an account.'),\n [TemplateSlotName.Body]: [\n card('register-card', [\n text('register-title', 'Create your account'),\n field('register-name', 'Full name', 'inputText', {}),\n field('register-email', 'Work email', 'inputText', { placeholder: 'you@contoso.com' }),\n field('register-password', 'Password', 'password', { feedback: true }),\n field('register-terms', 'I accept the terms of service', 'checkbox', {}),\n formActions('register-actions', 'Create account', 'I already have one'),\n ]),\n ],\n },\n displayName: 'Register',\n description: 'Account creation with a password strength meter and the terms checkbox.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** Forgotten password: ask for the address. */\nexport const forgotPasswordTemplate: ScreenTemplate = {\n name: 'ForgotPassword',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('forgot', 'It happens', 'Tell us the address you signed up with and we will send a link.'),\n [TemplateSlotName.Body]: [\n card('forgot-card', [\n text('forgot-title', 'Reset your password'),\n field('forgot-email', 'Email', 'inputText', { placeholder: 'you@contoso.com' }),\n formActions('forgot-actions', 'Send the link', 'Back to sign in'),\n ]),\n ],\n },\n displayName: 'Forgotten password',\n description: 'One field and one button - the whole point is that it asks for nothing else.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** New password: the other end of the link. */\nexport const newPasswordTemplate: ScreenTemplate = {\n name: 'NewPassword',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('new-password', 'Almost there', 'Choose something you have not used anywhere else.'),\n [TemplateSlotName.Body]: [\n card('new-password-card', [\n text('new-password-title', 'Choose a new password'),\n field('new-password-value', 'New password', 'password', { feedback: true }),\n field('new-password-confirm', 'Confirm it', 'password', { feedback: false }),\n formActions('new-password-actions', 'Set the password', 'Cancel'),\n ]),\n ],\n },\n displayName: 'New password',\n description: 'Where a reset link lands: choose it, confirm it, done.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** Verification: the code from the email. */\nexport const verificationTemplate: ScreenTemplate = {\n name: 'Verification',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('verification', 'Check your email', 'We sent a six-digit code. It expires in ten minutes.'),\n [TemplateSlotName.Body]: [\n card('verification-card', [\n text('verification-title', 'Enter the code'),\n externalComponent('verification-steps', 'steps', { model: ['Account', 'Verify', 'Done'], activeIndex: 1 }),\n field('verification-code', 'Six-digit code', 'inputText', { maxLength: 6 }),\n formActions('verification-actions', 'Verify', 'Send it again'),\n ]),\n ],\n },\n displayName: 'Verification',\n description: 'The code step, with the progress indicator that tells you how much is left.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** Lock screen: the session is still there, the person has to prove they are. */\nexport const lockScreenTemplate: ScreenTemplate = {\n name: 'LockScreen',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('lock', 'Locked', 'Your work is exactly where you left it.'),\n [TemplateSlotName.Body]: [\n card('lock-card', [\n externalComponent('lock-avatar', 'avatar', { label: 'AN', size: 'xlarge', shape: 'circle' }),\n text('lock-name', 'Amelia Nyquist'),\n field('lock-password', 'Password', 'password', { feedback: false }),\n formActions('lock-actions', 'Unlock', 'Sign in as someone else'),\n ]),\n ],\n },\n displayName: 'Lock screen',\n description: 'One person, one password, and no way to lose what was open.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The six authentication templates. */\nexport const authTemplates: ScreenTemplate[] = [\n loginTemplate,\n registerTemplate,\n forgotPasswordTemplate,\n newPasswordTemplate,\n verificationTemplate,\n lockScreenTemplate,\n];\n"],"names":["brandingAside","id","headline","supporting","externalComponent","ComponentName","Logo","label","initials","text","loginTemplate","name","fitsSlot","SlotName","Content","slots","Aside","TemplateSlotName","Body","content","card","field","placeholder","feedback","formActions","button","link","targetScreen","displayName","description","metadata","defaultBlueprintTemplateProvenance","registerTemplate","forgotPasswordTemplate","newPasswordTemplate","verificationTemplate","model","activeIndex","maxLength","lockScreenTemplate","size","shape","authTemplates"],"mappings":";;;;;;;;;;;AAAA;AACA;AAUA;;;;;;;;iEAWA,SAASA,aAAAA,CAAcC,EAAU,EAAEC,QAAgB,EAAEC,UAAkB,EAAA;IACnE,OAAO;AACHC,QAAAA,iBAAAA,CAAkB,GAAGH,EAAAA,CAAG,KAAK,CAAC,EAAEI,aAAAA,CAAcC,IAAI,EAAE;YAAEC,KAAAA,EAAO,SAAA;YAAWC,QAAAA,EAAU;AAAI,SAAA,CAAA;AACtFC,QAAAA,IAAAA,CAAK,CAAA,EAAGR,EA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,MAAM,kBAAkB,EAAE,cAgBhC,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,cAmBlC,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,cAAc,EAAsE,CAAC"}
1
+ {"version":3,"file":"dialogTemplates.d.ts","sourceRoot":"","sources":["../../../gallery/dialogTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAiBrD,eAAO,MAAM,qBAAqB,EAAE,cAgBnC,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,cAiBhC,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,cAoBlC,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,cAAc,EAAsE,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { TemplateSlotName } from './TemplateSlotName.js';
2
2
  import { panel, button, text, externalComponent, card } from './elements.js';
3
3
  import { field } from './widgets.js';
4
+ import { defaultBlueprintTemplateProvenance } from '../templateProvenance.js';
4
5
 
5
6
  // Copyright (c) Cratis. All rights reserved.
6
7
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
@@ -48,7 +49,10 @@ import { field } from './widgets.js';
48
49
  ]
49
50
  },
50
51
  displayName: 'Confirmation dialog',
51
- description: 'One question with the consequence spelled out, and a way back.'
52
+ description: 'One question with the consequence spelled out, and a way back.',
53
+ metadata: {
54
+ ...defaultBlueprintTemplateProvenance
55
+ }
52
56
  };
53
57
  /** Form: a short capture that does not deserve a page of its own. */ const formDialogTemplate = {
54
58
  name: 'FormDialog',
@@ -94,7 +98,10 @@ import { field } from './widgets.js';
94
98
  ]
95
99
  },
96
100
  displayName: 'Form dialog',
97
- description: 'A handful of fields captured without leaving the page underneath.'
101
+ description: 'A handful of fields captured without leaving the page underneath.',
102
+ metadata: {
103
+ ...defaultBlueprintTemplateProvenance
104
+ }
98
105
  };
99
106
  /** Detail: a record shown over the list it came from. */ const detailDialogTemplate = {
100
107
  name: 'DetailDialog',
@@ -144,7 +151,10 @@ import { field } from './widgets.js';
144
151
  ]
145
152
  },
146
153
  displayName: 'Detail dialog',
147
- description: 'A record over the list it came from, with a route to the full page.'
154
+ description: 'A record over the list it came from, with a route to the full page.',
155
+ metadata: {
156
+ ...defaultBlueprintTemplateProvenance
157
+ }
148
158
  };
149
159
  /** The dialog templates this blueprint provides. */ const galleryDialogTemplates = [
150
160
  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';\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};\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};\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};\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","formDialogTemplate","field","placeholder","options","rows","detailDialogTemplate","SidePanel","card","value","align","targetScreen","galleryDialogTemplates"],"mappings":";;;;AAAA;AACA;AAOA;;;;;;;;AAQC,gFAGM,MAAMA,qBAAAA,GAAwC;IACjDC,IAAAA,EAAM,eAAA;IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,iBAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEH,YAAAA,IAAAA,EAAME,iBAAiBE;AAAK,SAAA;AAAG,QAAA;AAAEJ,YAAAA,IAAAA,EAAME,iBAAiBG;AAAQ;AAAE,KAAA;IAC/GC,OAAAA,EAAS;QACL,CAACJ,gBAAAA,CAAiBC,MAAM,GAAG;AAACI,YAAAA,IAAAA,CAAK,eAAA,EAAiB,uBAAA;AAAyB,SAAA;QAC3E,CAACL,gBAAAA,CAAiBE,IAAI,GAAG;AACrBG,YAAAA,IAAAA,CAAK,iBAAA,EAAmB,2EAAA,CAAA;AACxBC,YAAAA,iBAAAA,CAAkB,gBAAgB,SAAA,EAAW;gBAAEC,QAAAA,EAAU,MAAA;gBAAQF,IAAAA,EAAM;AAAuC,aAAA;AACjH,SAAA;QACD,CAACL,gBAAAA,CAAiBG,OAAO,GAAG;AACxBK,YAAAA,KAAAA,CAAM,iBAAA,EAAmB;AAACC,gBAAAA,MAAAA,CAAO,eAAe,SAAA,EAAW;oBAAEF,QAAAA,EAAU;AAAS,iBAAA,CAAA;AAAIE,gBAAAA,MAAAA,CAAO,cAAc,SAAA,EAAW;oBAAEF,QAAAA,EAAU;AAAY,iBAAA;AAAG,aAAA;AAClJ;AACL,KAAA;IACAG,WAAAA,EAAa,qBAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,sEACO,MAAMC,kBAAAA,GAAqC;IAC9Cd,IAAAA,EAAM,YAAA;IACNC,KAAAA,EAAO;AAA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"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 },\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 },\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 },\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","formDialogTemplate","field","placeholder","options","rows","detailDialogTemplate","SidePanel","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oBK,IAAAA;;;"}
@@ -17,4 +17,6 @@ export * from './componentNames';
17
17
  export * from './previewProfile';
18
18
  export * from './resolveElementNames';
19
19
  export * from './GalleryScreenPreview';
20
+ export * from './TemplatePreviewState';
21
+ export * from './applyTemplatePreviewState';
20
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../gallery/index.ts"],"names":[],"mappings":"AAGA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../gallery/index.ts"],"names":[],"mappings":"AAGA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
@@ -17,4 +17,6 @@ export * from './componentNames';
17
17
  export * from './previewProfile';
18
18
  export * from './resolveElementNames';
19
19
  export * from './GalleryScreenPreview';
20
+ export * from './TemplatePreviewState';
21
+ export * from './applyTemplatePreviewState';
20
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../gallery/index.ts"],"names":[],"mappings":"AAGA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../gallery/index.ts"],"names":[],"mappings":"AAGA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../gallery/navigation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD,eAAO,MAAM,2BAA2B,eAAe,CAAC;AAUxD,eAAO,MAAM,iBAAiB,EAAE,eAAe,EAW9C,CAAC;AASF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,YAAY,CAU7F;AASD,eAAO,MAAM,uBAAuB,EAAE,YAAY,EAI/C,CAAC;AAGJ,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,EAAE,CAE/D;AAGD,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAA8D,CAAC"}
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../gallery/navigation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD,eAAO,MAAM,2BAA2B,eAAe,CAAC;AAUxD,eAAO,MAAM,iBAAiB,EAAE,eAAe,EAY9C,CAAC;AASF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,YAAY,CAU7F;AASD,eAAO,MAAM,uBAAuB,EAAE,YAAY,EAI/C,CAAC;AAGJ,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,EAAE,CAE/D;AAGD,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAA8D,CAAC"}
@@ -33,6 +33,13 @@ import { externalComponent } from './elements.js';
33
33
  group: 'Workspace',
34
34
  order: 30
35
35
  },
36
+ {
37
+ label: 'Customers',
38
+ targetScreen: 'MasterDetail',
39
+ icon: 'pi pi-users',
40
+ group: 'Workspace',
41
+ order: 35
42
+ },
36
43
  {
37
44
  label: 'New product',
38
45
  targetScreen: 'FormPage',
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.js","sources":["../../../gallery/navigation.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 { Contribution, SceneElement } from '@cratis/scene.model';\nimport { ComponentName } from '../ComponentName';\nimport { NavigationEntry } from './NavigationEntry';\nimport { externalComponent } from './elements';\n\n/** The contribution point the built-in navigation aggregation reads. */\nexport const navigationContributionPoint = 'Navigation';\n\n/**\n * The gallery's navigation, declared once.\n *\n * One list, two consumers: the sidebar menu renders it as `menuItem` elements, and the same elements go to\n * the `Navigation` contribution point where `aggregateContributions` + `extractNavigationItem` turn them\n * back into navigation items. A blueprint that maintained a menu *and* a separate navigation declaration\n * would have two lists that agree right up until someone adds a screen to one of them.\n */\nexport const navigationEntries: NavigationEntry[] = [\n { label: 'Dashboard', targetScreen: 'Dashboard', icon: 'pi pi-home', group: 'Workspace', order: 10 },\n { label: 'Products', targetScreen: 'CrudList', icon: 'pi pi-box', group: 'Workspace', order: 20 },\n { label: 'Product detail', targetScreen: 'DetailView', icon: 'pi pi-file', group: 'Workspace', order: 30 },\n { label: 'New product', targetScreen: 'FormPage', icon: 'pi pi-plus-circle', group: 'Workspace', order: 40 },\n { label: 'Invoices', targetScreen: 'Invoice', icon: 'pi pi-receipt', group: 'Workspace', order: 50 },\n { label: 'Nothing yet', targetScreen: 'Empty', icon: 'pi pi-inbox', group: 'Workspace', order: 60 },\n { label: 'Users', targetScreen: 'UserManagement', icon: 'pi pi-users', group: 'Administration', order: 10 },\n { label: 'Your profile', targetScreen: 'ProfileSettings', icon: 'pi pi-user', group: 'Administration', order: 20 },\n { label: 'Documentation', targetScreen: 'Documentation', icon: 'pi pi-book', group: 'Support', order: 10 },\n { label: 'Help', targetScreen: 'Help', icon: 'pi pi-question-circle', group: 'Support', order: 20 },\n];\n\n/**\n * The element one navigation entry becomes.\n *\n * `routeParameterBindings` is present and empty rather than omitted, because that is what\n * `extractNavigationItem` expects to read - and an omitted bag and an empty one are the same thing right\n * up until something iterates it.\n */\nexport function navigationElement(entry: NavigationEntry, activeScreen?: string): SceneElement {\n return externalComponent(`nav-${entry.targetScreen}`, ComponentName.MenuItem, {\n label: entry.label,\n targetScreen: entry.targetScreen,\n routeParameterBindings: {},\n order: entry.order,\n group: entry.group,\n icon: entry.icon,\n isActive: entry.targetScreen === activeScreen,\n });\n}\n\n/**\n * The navigation as contributions to the `Navigation` contribution point.\n *\n * A screen carries these in its `contributions`, and anything bound to the contribution point recomputes\n * from whatever is currently in scope - so a screen that contributes an extra entry gets it in the\n * navigation without the navigation knowing that screen exists.\n */\nexport const navigationContributions: Contribution[] = navigationEntries.map(entry => ({\n contributionPointName: navigationContributionPoint,\n content: navigationElement(entry),\n order: entry.order,\n}));\n\n/** The navigation entries of one group, in order. */\nexport function entriesInGroup(group: string): NavigationEntry[] {\n return navigationEntries.filter(entry => entry.group === group).sort((first, second) => first.order - second.order);\n}\n\n/** Every group named by the navigation, in first-declared order. */\nexport const navigationGroups: string[] = [...new Set(navigationEntries.map(entry => entry.group))];\n"],"names":["navigationContributionPoint","navigationEntries","label","targetScreen","icon","group","order","navigationElement","entry","activeScreen","externalComponent","ComponentName","MenuItem","routeParameterBindings","isActive","navigationContributions","map","contributionPointName","content","entriesInGroup","filter","sort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CAACZ,CAAAA,KAAAA,GAASA,KAAAA,CAAMH,KAAK,KAAKA,KAAAA,CAAAA,CAAOgB,IAAI,CAAC,CAACC,KAAAA,EAAOC,MAAAA,GAAWD,MAAMhB,KAAK,GAAGiB,OAAOjB,KAAK,CAAA;AACtH;AAEA,qEACO,MAAMkB,gBAAAA,GAA6B;AAAI,IAAA,GAAA,IAAIC,IAAIxB,iBAAAA,CAAkBe,GAAG,CAACR,CAAAA,KAAAA,GAASA,MAAMH,KAAK,CAAA;;;"}
1
+ {"version":3,"file":"navigation.js","sources":["../../../gallery/navigation.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 { Contribution, SceneElement } from '@cratis/scene.model';\nimport { ComponentName } from '../ComponentName';\nimport { NavigationEntry } from './NavigationEntry';\nimport { externalComponent } from './elements';\n\n/** The contribution point the built-in navigation aggregation reads. */\nexport const navigationContributionPoint = 'Navigation';\n\n/**\n * The gallery's navigation, declared once.\n *\n * One list, two consumers: the sidebar menu renders it as `menuItem` elements, and the same elements go to\n * the `Navigation` contribution point where `aggregateContributions` + `extractNavigationItem` turn them\n * back into navigation items. A blueprint that maintained a menu *and* a separate navigation declaration\n * would have two lists that agree right up until someone adds a screen to one of them.\n */\nexport const navigationEntries: NavigationEntry[] = [\n { label: 'Dashboard', targetScreen: 'Dashboard', icon: 'pi pi-home', group: 'Workspace', order: 10 },\n { label: 'Products', targetScreen: 'CrudList', icon: 'pi pi-box', group: 'Workspace', order: 20 },\n { label: 'Product detail', targetScreen: 'DetailView', icon: 'pi pi-file', group: 'Workspace', order: 30 },\n { label: 'Customers', targetScreen: 'MasterDetail', icon: 'pi pi-users', group: 'Workspace', order: 35 },\n { label: 'New product', targetScreen: 'FormPage', icon: 'pi pi-plus-circle', group: 'Workspace', order: 40 },\n { label: 'Invoices', targetScreen: 'Invoice', icon: 'pi pi-receipt', group: 'Workspace', order: 50 },\n { label: 'Nothing yet', targetScreen: 'Empty', icon: 'pi pi-inbox', group: 'Workspace', order: 60 },\n { label: 'Users', targetScreen: 'UserManagement', icon: 'pi pi-users', group: 'Administration', order: 10 },\n { label: 'Your profile', targetScreen: 'ProfileSettings', icon: 'pi pi-user', group: 'Administration', order: 20 },\n { label: 'Documentation', targetScreen: 'Documentation', icon: 'pi pi-book', group: 'Support', order: 10 },\n { label: 'Help', targetScreen: 'Help', icon: 'pi pi-question-circle', group: 'Support', order: 20 },\n];\n\n/**\n * The element one navigation entry becomes.\n *\n * `routeParameterBindings` is present and empty rather than omitted, because that is what\n * `extractNavigationItem` expects to read - and an omitted bag and an empty one are the same thing right\n * up until something iterates it.\n */\nexport function navigationElement(entry: NavigationEntry, activeScreen?: string): SceneElement {\n return externalComponent(`nav-${entry.targetScreen}`, ComponentName.MenuItem, {\n label: entry.label,\n targetScreen: entry.targetScreen,\n routeParameterBindings: {},\n order: entry.order,\n group: entry.group,\n icon: entry.icon,\n isActive: entry.targetScreen === activeScreen,\n });\n}\n\n/**\n * The navigation as contributions to the `Navigation` contribution point.\n *\n * A screen carries these in its `contributions`, and anything bound to the contribution point recomputes\n * from whatever is currently in scope - so a screen that contributes an extra entry gets it in the\n * navigation without the navigation knowing that screen exists.\n */\nexport const navigationContributions: Contribution[] = navigationEntries.map(entry => ({\n contributionPointName: navigationContributionPoint,\n content: navigationElement(entry),\n order: entry.order,\n}));\n\n/** The navigation entries of one group, in order. */\nexport function entriesInGroup(group: string): NavigationEntry[] {\n return navigationEntries.filter(entry => entry.group === group).sort((first, second) => first.order - second.order);\n}\n\n/** Every group named by the navigation, in first-declared order. */\nexport const navigationGroups: string[] = [...new Set(navigationEntries.map(entry => entry.group))];\n"],"names":["navigationContributionPoint","navigationEntries","label","targetScreen","icon","group","order","navigationElement","entry","activeScreen","externalComponent","ComponentName","MenuItem","routeParameterBindings","isActive","navigationContributions","map","contributionPointName","content","entriesInGroup","filter","sort","first","second","navigationGroups","Set"],"mappings":";;;AAAA;AACA;AAOA,yEACO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MF;AACjB,KAAA,CAAA;AAEA,sDACO,SAASa,cAAAA,CAAed,KAAa,EAAA;AACxC,IAAA,OAAOJ,kBAAkBmB,MAAM,CAACZ,CAAAA,KAAAA,GAASA,KAAAA,CAAMH,KAAK,KAAKA,KAAAA,CAAAA,CAAOgB,IAAI,CAAC,CAACC,KAAAA,EAAOC,MAAAA,GAAWD,MAAMhB,KAAK,GAAGiB,OAAOjB,KAAK,CAAA;AACtH;AAEA,qEACO,MAAMkB,gBAAAA,GAA6B;AAAI,IAAA,GAAA,IAAIC,IAAIxB,iBAAAA,CAAkBe,GAAG,CAACR,CAAAA,KAAAA,GAASA,MAAMH,KAAK,CAAA;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"nesting.d.ts","sourceRoot":"","sources":["../../../gallery/nesting.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA0BrD,eAAO,MAAM,uBAAuB,EAAE,cASrC,CAAC;AAQF,eAAO,MAAM,sBAAsB,EAAE,cAYpC,CAAC;AAQF,eAAO,MAAM,oBAAoB,EAAE,cAYlC,CAAC;AAGF,eAAO,MAAM,qBAAqB,EAAE,cAAc,EAA4E,CAAC"}
1
+ {"version":3,"file":"nesting.d.ts","sourceRoot":"","sources":["../../../gallery/nesting.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA2BrD,eAAO,MAAM,uBAAuB,EAAE,cAUrC,CAAC;AAQF,eAAO,MAAM,sBAAsB,EAAE,cAapC,CAAC;AAQF,eAAO,MAAM,oBAAoB,EAAE,cAalC,CAAC;AAGF,eAAO,MAAM,qBAAqB,EAAE,cAAc,EAA4E,CAAC"}
@@ -7,6 +7,7 @@ import '../layouts/fullPage.js';
7
7
  import { TemplateSlotName } from './TemplateSlotName.js';
8
8
  import { button, externalComponent } from './elements.js';
9
9
  import { pageHeader } from './widgets.js';
10
+ import { defaultBlueprintTemplateProvenance } from '../templateProvenance.js';
10
11
 
11
12
  // Copyright (c) Cratis. All rights reserved.
12
13
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
@@ -46,7 +47,10 @@ import { pageHeader } from './widgets.js';
46
47
  ]
47
48
  },
48
49
  displayName: 'Module workspace',
49
- description: 'Module level: fits the application layout content slot and offers a body for one feature.'
50
+ description: 'Module level: fits the application layout content slot and offers a body for one feature.',
51
+ metadata: {
52
+ ...defaultBlueprintTemplateProvenance
53
+ }
50
54
  };
51
55
  /**
52
56
  * Feature level: fits the module workspace's `body` slot.
@@ -77,7 +81,10 @@ import { pageHeader } from './widgets.js';
77
81
  ]
78
82
  },
79
83
  displayName: 'Feature section',
80
- description: 'Feature level: fits a module workspace body slot and brings the action toolbar.'
84
+ description: 'Feature level: fits a module workspace body slot and brings the action toolbar.',
85
+ metadata: {
86
+ ...defaultBlueprintTemplateProvenance
87
+ }
81
88
  };
82
89
  /**
83
90
  * Slice level: fits the feature section's `body` slot.
@@ -112,7 +119,10 @@ import { pageHeader } from './widgets.js';
112
119
  ]
113
120
  },
114
121
  displayName: 'Slice section',
115
- description: 'Slice level: fits a feature section body slot and hosts one behavior.'
122
+ description: 'Slice level: fits a feature section body slot and hosts one behavior.',
123
+ metadata: {
124
+ ...defaultBlueprintTemplateProvenance
125
+ }
116
126
  };
117
127
  /** The chain, outermost first - what a spec walks to prove `fitsSlot` resolves at every level. */ const nestingChainTemplates = [
118
128
  moduleWorkspaceTemplate,
@@ -1 +1 @@
1
- {"version":3,"file":"nesting.js","sources":["../../../gallery/nesting.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 { ScreenTemplate } from '@cratis/scene.model';\nimport { ComponentName } from '../ComponentName';\nimport { SlotName, column, slotLeaf } from '../layouts';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, externalComponent } from './elements';\nimport { pageHeader } from './widgets';\n\n/**\n * A worked three-level chain, from the application layout down to a slice.\n *\n * The nesting rule is one rule applied at every depth: a template names, in `fitsSlot`, a slot declared by\n * whatever contains it. A module's template fits the application layout's `content`; a feature's template\n * fits a slot the module's template declares; a slice's fits one the feature's declares. Nothing here is a\n * special case for a particular level - which is exactly why the hierarchy can be arbitrarily deep without\n * a second mechanism.\n *\n * These three exist to make that concrete and to be asserted by a spec, because \"it composes recursively\"\n * is the kind of claim that is true in a design document and wrong in the code.\n */\n\n/**\n * Module level: fits the application shell's `content` slot.\n *\n * It brings its own header - a module always has a name and a description - and offers a body for the\n * feature inside it plus an optional side panel.\n */\nexport const moduleWorkspaceTemplate: ScreenTemplate = {\n name: 'ModuleWorkspace',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n content: {\n [TemplateSlotName.Header]: [pageHeader('module-header', 'Operations', 'Everything the operations module owns')],\n },\n displayName: 'Module workspace',\n description: 'Module level: fits the application layout content slot and offers a body for one feature.',\n};\n\n/**\n * Feature level: fits the module workspace's `body` slot.\n *\n * It brings a toolbar, because a feature is where actions belong - a module is a grouping, a slice is one\n * behavior, and the feature in between is what a user thinks of as a screen with buttons on it.\n */\nexport const featureSectionTemplate: ScreenTemplate = {\n name: 'FeatureSection',\n fitsSlot: TemplateSlotName.Body,\n slots: [{ name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Toolbar]: [\n button('feature-new', 'New', { severity: 'primary', icon: 'pi pi-plus' }),\n button('feature-export', 'Export', { severity: 'secondary', icon: 'pi pi-download' }),\n ],\n },\n displayName: 'Feature section',\n description: 'Feature level: fits a module workspace body slot and brings the action toolbar.',\n};\n\n/**\n * Slice level: fits the feature section's `body` slot.\n *\n * The end of the chain, and deliberately the thinnest thing in it - one behavior's surface, with somewhere\n * to put it and somewhere to put its actions.\n */\nexport const sliceSectionTemplate: ScreenTemplate = {\n name: 'SliceSection',\n fitsSlot: TemplateSlotName.Body,\n slots: [{ name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Body, { grow: 1 }), slotLeaf(TemplateSlotName.Actions)]),\n },\n content: {\n [TemplateSlotName.Body]: [externalComponent('slice-body', ComponentName.PageHeader, { title: 'Adjustment', subtitle: 'One behavior, one surface' })],\n },\n displayName: 'Slice section',\n description: 'Slice level: fits a feature section body slot and hosts one behavior.',\n};\n\n/** The chain, outermost first - what a spec walks to prove `fitsSlot` resolves at every level. */\nexport const nestingChainTemplates: ScreenTemplate[] = [moduleWorkspaceTemplate, featureSectionTemplate, sliceSectionTemplate];\n"],"names":["moduleWorkspaceTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","SidePanel","content","pageHeader","displayName","description","featureSectionTemplate","Toolbar","button","severity","icon","sliceSectionTemplate","Actions","arrangement","root","column","slotLeaf","grow","externalComponent","ComponentName","PageHeader","title","subtitle","nestingChainTemplates"],"mappings":";;;;;;;;;;AAAA;AACA;AASA;;;;;;;;;;;;;;;;UAmBaA,uBAAAA,GAA0C;IACnDC,IAAAA,EAAM,iBAAA;AACNC,IAAAA,QAAAA,EAAUC,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,iBAAiBE;AAAK,SAAA;AAAG,QAAA;AAAEP,YAAAA,IAAAA,EAAMK,iBAAiBG;AAAU;AAAE,KAAA;IACjHC,OAAAA,EAAS;QACL,CAACJ,gBAAAA,CAAiBC,MAAM,GAAG;AAACI,YAAAA,UAAAA,CAAW,iBAAiB,YAAA,EAAc,uCAAA;AAAyC;AACnH,KAAA;IACAC,WAAAA,EAAa,kBAAA;IACbC,WAAAA,EAAa;AACjB;AAEA;;;;;UAMaC,sBAAAA,GAAyC;IAClDb,IAAAA,EAAM,gBAAA;AACNC,IAAAA,QAAAA,EAAUI,i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AA;IACbC,WAAAA,EAAa;AACjB;AAEA,mGACO,MAAMkB,qBAAAA,GAA0C;AAAC/B,IAAAA,uBAAAA;AAAyBc,IAAAA,sBAAAA;AAAwBK,IAAAA;;;"}
1
+ {"version":3,"file":"nesting.js","sources":["../../../gallery/nesting.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 { ScreenTemplate } from '@cratis/scene.model';\nimport { ComponentName } from '../ComponentName';\nimport { SlotName, column, slotLeaf } from '../layouts';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, externalComponent } from './elements';\nimport { pageHeader } from './widgets';\nimport { defaultBlueprintTemplateProvenance } from '../templateProvenance';\n\n/**\n * A worked three-level chain, from the application layout down to a slice.\n *\n * The nesting rule is one rule applied at every depth: a template names, in `fitsSlot`, a slot declared by\n * whatever contains it. A module's template fits the application layout's `content`; a feature's template\n * fits a slot the module's template declares; a slice's fits one the feature's declares. Nothing here is a\n * special case for a particular level - which is exactly why the hierarchy can be arbitrarily deep without\n * a second mechanism.\n *\n * These three exist to make that concrete and to be asserted by a spec, because \"it composes recursively\"\n * is the kind of claim that is true in a design document and wrong in the code.\n */\n\n/**\n * Module level: fits the application shell's `content` slot.\n *\n * It brings its own header - a module always has a name and a description - and offers a body for the\n * feature inside it plus an optional side panel.\n */\nexport const moduleWorkspaceTemplate: ScreenTemplate = {\n name: 'ModuleWorkspace',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n content: {\n [TemplateSlotName.Header]: [pageHeader('module-header', 'Operations', 'Everything the operations module owns')],\n },\n displayName: 'Module workspace',\n description: 'Module level: fits the application layout content slot and offers a body for one feature.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/**\n * Feature level: fits the module workspace's `body` slot.\n *\n * It brings a toolbar, because a feature is where actions belong - a module is a grouping, a slice is one\n * behavior, and the feature in between is what a user thinks of as a screen with buttons on it.\n */\nexport const featureSectionTemplate: ScreenTemplate = {\n name: 'FeatureSection',\n fitsSlot: TemplateSlotName.Body,\n slots: [{ name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Toolbar]: [\n button('feature-new', 'New', { severity: 'primary', icon: 'pi pi-plus' }),\n button('feature-export', 'Export', { severity: 'secondary', icon: 'pi pi-download' }),\n ],\n },\n displayName: 'Feature section',\n description: 'Feature level: fits a module workspace body slot and brings the action toolbar.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/**\n * Slice level: fits the feature section's `body` slot.\n *\n * The end of the chain, and deliberately the thinnest thing in it - one behavior's surface, with somewhere\n * to put it and somewhere to put its actions.\n */\nexport const sliceSectionTemplate: ScreenTemplate = {\n name: 'SliceSection',\n fitsSlot: TemplateSlotName.Body,\n slots: [{ name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Body, { grow: 1 }), slotLeaf(TemplateSlotName.Actions)]),\n },\n content: {\n [TemplateSlotName.Body]: [externalComponent('slice-body', ComponentName.PageHeader, { title: 'Adjustment', subtitle: 'One behavior, one surface' })],\n },\n displayName: 'Slice section',\n description: 'Slice level: fits a feature section body slot and hosts one behavior.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The chain, outermost first - what a spec walks to prove `fitsSlot` resolves at every level. */\nexport const nestingChainTemplates: ScreenTemplate[] = [moduleWorkspaceTemplate, featureSectionTemplate, sliceSectionTemplate];\n"],"names":["moduleWorkspaceTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","SidePanel","content","pageHeader","displayName","description","metadata","defaultBlueprintTemplateProvenance","featureSectionTemplate","Toolbar","button","severity","icon","sliceSectionTemplate","Actions","arrangement","root","column","slotLeaf","grow","externalComponent","ComponentName","PageHeader","title","subtitle","nestingChainTemplates"],"mappings":";;;;;;;;;;;AAAA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S,CAE9D"}
1
+ {"version":3,"file":"screens.d.ts","sourceRoot":"","sources":["../../../gallery/screens.ts"],"names":[],"mappings":"AAGA,OAAO,EAAU,MAAM,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAkBrE,eAAO,MAAM,sBAAsB,EAAE,cAAc,EAMlD,CAAC;AA+EF,eAAO,MAAM,cAAc,EAAE,MAAM,EAA0C,CAAC;AAG9E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE9D"}
@@ -17,7 +17,7 @@ import { workspaceTemplates } from './workspaceTemplates.js';
17
17
  /**
18
18
  * The screen templates this blueprint provides.
19
19
  *
20
- * Ten shapes for inside the application shell, ten for the full-page shell, and the three-level nesting
20
+ * Eleven shapes for inside the application shell, ten for the full-page shell, and the three-level nesting
21
21
  * chain that demonstrates how `fitsSlot` composes. The list is what the manifest's `screenTemplates` names
22
22
  * and what the bundle provides; `validatePackageBundle` proves the two agree.
23
23
  */ const galleryScreenTemplates = [
@@ -46,6 +46,15 @@ import { workspaceTemplates } from './workspaceTemplates.js';
46
46
  label: 'Products'
47
47
  }
48
48
  ],
49
+ MasterDetail: [
50
+ {
51
+ label: 'Sales',
52
+ targetScreen: 'Dashboard'
53
+ },
54
+ {
55
+ label: 'Customers'
56
+ }
57
+ ],
49
58
  DetailView: [
50
59
  {
51
60
  label: 'Catalog',