@cratis/scene.blueprint.default 4.13.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.
- package/README.md +2 -2
- package/dist/cjs/gallery/GalleryScreenPreview.js +6 -3
- package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -1
- package/dist/cjs/gallery/TemplatePreviewState.js +17 -0
- package/dist/cjs/gallery/TemplatePreviewState.js.map +1 -0
- package/dist/cjs/gallery/applyTemplatePreviewState.js +91 -0
- package/dist/cjs/gallery/applyTemplatePreviewState.js.map +1 -0
- package/dist/cjs/gallery/navigation.js +7 -0
- package/dist/cjs/gallery/navigation.js.map +1 -1
- package/dist/cjs/gallery/screens.js +10 -1
- package/dist/cjs/gallery/screens.js.map +1 -1
- package/dist/cjs/gallery/statusTemplates.js +2 -1
- package/dist/cjs/gallery/statusTemplates.js.map +1 -1
- package/dist/cjs/gallery/supportTemplates.js +2 -1
- package/dist/cjs/gallery/supportTemplates.js.map +1 -1
- package/dist/cjs/gallery/widgets.js +20 -6
- package/dist/cjs/gallery/widgets.js.map +1 -1
- package/dist/cjs/gallery/workspaceTemplates.js +116 -3
- package/dist/cjs/gallery/workspaceTemplates.js.map +1 -1
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/gallery/ApplicationScreens.stories.d.ts +1 -0
- package/dist/esm/gallery/ApplicationScreens.stories.d.ts.map +1 -1
- package/dist/esm/gallery/ApplicationScreens.stories.js +2 -1
- package/dist/esm/gallery/ApplicationScreens.stories.js.map +1 -1
- package/dist/esm/gallery/GalleryScreenPreview.d.ts +3 -1
- package/dist/esm/gallery/GalleryScreenPreview.d.ts.map +1 -1
- package/dist/esm/gallery/GalleryScreenPreview.js +6 -3
- package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -1
- package/dist/esm/gallery/PreviewStates.stories.d.ts +36 -0
- package/dist/esm/gallery/PreviewStates.stories.d.ts.map +1 -0
- package/dist/esm/gallery/PreviewStates.stories.js +27 -0
- package/dist/esm/gallery/PreviewStates.stories.js.map +1 -0
- package/dist/esm/gallery/TemplatePreviewState.d.ts +7 -0
- package/dist/esm/gallery/TemplatePreviewState.d.ts.map +1 -0
- package/dist/esm/gallery/TemplatePreviewState.js +15 -0
- package/dist/esm/gallery/TemplatePreviewState.js.map +1 -0
- package/dist/esm/gallery/applyTemplatePreviewState.d.ts +6 -0
- package/dist/esm/gallery/applyTemplatePreviewState.d.ts.map +1 -0
- package/dist/esm/gallery/applyTemplatePreviewState.js +87 -0
- package/dist/esm/gallery/applyTemplatePreviewState.js.map +1 -0
- package/dist/esm/gallery/index.d.ts +2 -0
- package/dist/esm/gallery/index.d.ts.map +1 -1
- package/dist/esm/gallery/index.js +2 -0
- package/dist/esm/gallery/index.js.map +1 -1
- package/dist/esm/gallery/navigation.d.ts.map +1 -1
- package/dist/esm/gallery/navigation.js +7 -0
- package/dist/esm/gallery/navigation.js.map +1 -1
- package/dist/esm/gallery/screens.d.ts.map +1 -1
- package/dist/esm/gallery/screens.js +10 -1
- package/dist/esm/gallery/screens.js.map +1 -1
- package/dist/esm/gallery/statusTemplates.js +2 -1
- package/dist/esm/gallery/statusTemplates.js.map +1 -1
- package/dist/esm/gallery/supportTemplates.js +2 -1
- package/dist/esm/gallery/supportTemplates.js.map +1 -1
- package/dist/esm/gallery/widgets.d.ts +1 -1
- package/dist/esm/gallery/widgets.d.ts.map +1 -1
- package/dist/esm/gallery/widgets.js +20 -6
- package/dist/esm/gallery/widgets.js.map +1 -1
- package/dist/esm/gallery/workspaceTemplates.d.ts +1 -0
- package/dist/esm/gallery/workspaceTemplates.d.ts.map +1 -1
- package/dist/esm/gallery/workspaceTemplates.js +118 -6
- package/dist/esm/gallery/workspaceTemplates.js.map +1 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/gallery/ApplicationScreens.stories.tsx +4 -1
- package/gallery/GalleryScreenPreview.tsx +8 -3
- package/gallery/PreviewStates.stories.tsx +56 -0
- package/gallery/TemplatePreviewState.ts +20 -0
- package/gallery/applyTemplatePreviewState.ts +69 -0
- package/gallery/index.ts +2 -0
- package/gallery/navigation.ts +1 -0
- package/gallery/screens.ts +2 -1
- package/gallery/statusTemplates.ts +1 -1
- package/gallery/supportTemplates.ts +1 -1
- package/gallery/widgets.ts +14 -5
- package/gallery/workspaceTemplates.ts +58 -4
- package/package.json +8 -7
|
@@ -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,IAAI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AAA,EAAS;AAAK,aAAA;AACpE,QAAA,KAAKzB,qBAAqB0B,KAAK;YAAE,OAAO;AAAEH,gBAAAA,IAAAA,EAAM,EAAE;gBAAEI,KAAAA,EAAO/B;AAAoB,aAAA;AAC/E,QAAA;AAAS,YAAA,OAAO,EAAC;AACrB;AACJ;AAEA,SAASS,cAAcD,UAA+C,EAAA;AAClE,IAAA,MAAMmB,OAAOnB,UAAAA,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;;"}
|
|
@@ -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,
|
|
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","first","second","navigationGroups","Set"],"mappings":";;;AAAA;AACA;AAOA,yEACO,MAAMA,2BAAAA,GAA8B;AAE3C;;;;;;;UAQaC,iBAAAA,GAAuC;AAChD,IAAA;QAAEC,KAAAA,EAAO,WAAA;QAAaC,YAAAA,EAAc,WAAA;QAAaC,IAAAA,EAAM,YAAA;QAAcC,KAAAA,EAAO,WAAA;QAAaC,KAAAA,EAAO;AAAG,KAAA;AACnG,IAAA;QAAEJ,KAAAA,EAAO,UAAA;QAAYC,YAAAA,EAAc,UAAA;QAAYC,IAAAA,EAAM,WAAA;QAAaC,KAAAA,EAAO,WAAA;QAAaC,KAAAA,EAAO;AAAG,KAAA;AAChG,IAAA;QAAEJ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ACM,SAASC,iBAAAA,CAAkBC,KAAsB,EAAEC,YAAqB,EAAA;IAC3E,OAAOC,iBAAAA,CAAkB,CAAC,IAAI,EAAEF,KAAAA,CAAML,YAAY,CAAA,CAAE,EAAEQ,aAAAA,CAAcC,QAAQ,EAAE;AAC1EV,QAAAA,KAAAA,EAAOM,MAAMN,KAAK;AAClBC,QAAAA,YAAAA,EAAcK,MAAML,YAAY;AAChCU,QAAAA,sBAAAA,EAAwB,EAAC;AACzBP,QAAAA,KAAAA,EAAOE,MAAMF,KAAK;AAClBD,QAAAA,KAAAA,EAAOG,MAAMH,KAAK;AAClBD,QAAAA,IAAAA,EAAMI,MAAMJ,IAAI;QAChBU,QAAAA,EAAUN,KAAAA,CAAML,YAAY,KAAKM;AACrC,KAAA,CAAA;AACJ;AAEA;;;;;;UAOaM,uBAAAA,GAA0Cd,iBAAAA,CAAkBe,GAAG,CAACR,CAAAA,SAAU;QACnFS,qBAAAA,EAAuBjB,2BAAAA;AACvBkB,QAAAA,OAAAA,EAASX,iBAAAA,CAAkBC,KAAAA,CAAAA;AAC3BF,QAAAA,KAAAA,EAAOE,MAAMF;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
|
+
{"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,MAAMA,2BAAAA,GAA8B;AAE3C;;;;;;;UAQaC,iBAAAA,GAAuC;AAChD,IAAA;QAAEC,KAAAA,EAAO,WAAA;QAAaC,YAAAA,EAAc,WAAA;QAAaC,IAAAA,EAAM,YAAA;QAAcC,KAAAA,EAAO,WAAA;QAAaC,KAAAA,EAAO;AAAG,KAAA;AACnG,IAAA;QAAEJ,KAAAA,EAAO,UAAA;QAAYC,YAAAA,EAAc,UAAA;QAAYC,IAAAA,EAAM,WAAA;QAAaC,KAAAA,EAAO,WAAA;QAAaC,KAAAA,EAAO;AAAG,KAAA;AAChG,IAAA;QAAEJ,KAAAA,EAAO,gBAAA;QAAkBC,YAAAA,EAAc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
@@ -1 +1 @@
|
|
|
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;
|
|
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
|
-
*
|
|
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',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screens.js","sources":["../../../gallery/screens.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 { Layout, Screen, ScreenTemplate } from '@cratis/scene.model';\nimport { LayoutName, appShellLayout, fullPageLayout } from '../layouts';\nimport { BreadcrumbEntry, applicationChrome, fullPageChrome } from './applicationChrome';\nimport { nestScreenTemplates, templateContentInLayout } from './composeScreen';\nimport { authTemplates } from './authTemplates';\nimport { navigationContributions } from './navigation';\nimport { nestingChainTemplates } from './nesting';\nimport { statusTemplates } from './statusTemplates';\nimport { supportTemplates } from './supportTemplates';\nimport { workspaceTemplates } from './workspaceTemplates';\n\n/**\n * The screen templates this blueprint provides.\n *\n * Ten shapes for inside the application shell, ten for the full-page shell, and the three-level nesting\n * chain that demonstrates how `fitsSlot` composes. The list is what the manifest's `screenTemplates` names\n * and what the bundle provides; `validatePackageBundle` proves the two agree.\n */\nexport const galleryScreenTemplates: ScreenTemplate[] = [\n ...workspaceTemplates,\n ...supportTemplates,\n ...authTemplates,\n ...statusTemplates,\n ...nestingChainTemplates,\n];\n\n/** Which layout each template renders inside - the application shell unless it is one of the chrome-less screens. */\nconst fullPageTemplateNames = new Set([...authTemplates, ...statusTemplates].map(template => template.name));\n\n/** The trail shown above each application-shell screen. */\nconst breadcrumbs: Record<string, BreadcrumbEntry[]> = {\n Dashboard: [{ label: 'Dashboard' }],\n CrudList: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products' }],\n DetailView: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products', targetScreen: 'CrudList' }, { label: 'Bamboo Watch' }],\n FormPage: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products', targetScreen: 'CrudList' }, { label: 'New product' }],\n Empty: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products' }],\n Documentation: [{ label: 'Support', targetScreen: 'Dashboard' }, { label: 'Documentation' }],\n ProfileSettings: [{ label: 'Administration', targetScreen: 'Dashboard' }, { label: 'Your profile' }],\n UserManagement: [{ label: 'Administration', targetScreen: 'Dashboard' }, { label: 'Users' }],\n Invoice: [{ label: 'Billing', targetScreen: 'Dashboard' }, { label: 'INV-2043' }],\n Help: [{ label: 'Support', targetScreen: 'Dashboard' }, { label: 'Help' }],\n ModuleWorkspace: [{ label: 'Operations' }],\n FeatureSection: [{ label: 'Operations', targetScreen: 'ModuleWorkspace' }, { label: 'Adjustments' }],\n SliceSection: [\n { label: 'Operations', targetScreen: 'ModuleWorkspace' },\n { label: 'Adjustments', targetScreen: 'FeatureSection' },\n { label: 'Record an adjustment' },\n ],\n};\n\n/**\n * Builds the {@link Screen} that instantiates one template.\n *\n * A screen is an instance, not a shape: it names the layout it renders in, the template it fills, the\n * content that fills it, and what it contributes elsewhere. Everything structural comes from the template,\n * which is why adding a screen is a handful of lines rather than another copy of the chrome.\n */\nfunction screenFor(template: ScreenTemplate): Screen {\n const isFullPage = fullPageTemplateNames.has(template.name);\n const layout: Layout = isFullPage ? fullPageLayout : appShellLayout;\n const chrome = isFullPage ? fullPageChrome() : applicationChrome(template.name, breadcrumbs[template.name] ?? [{ label: template.displayName ?? template.name }]);\n const placeable = nestScreenTemplates(containmentChainFor(template));\n\n return {\n name: template.name,\n layout: isFullPage ? LayoutName.FullPage : LayoutName.AppShell,\n screenTemplate: template.name,\n slotContent: mergeSlotContent(chrome, templateContentInLayout(placeable, layout)),\n forms: [],\n contributions: isFullPage ? [] : navigationContributions,\n };\n}\n\n/**\n * The chain of templates a screen renders through, outermost first.\n *\n * Almost every template fits the layout's own `content` slot, so its chain is just itself. The three\n * nesting-chain templates are the exception, and the only ones that need the walk - which is the honest\n * version of the story: nesting exists for the applications that need it, and costs nothing for the ones\n * that do not.\n */\nfunction containmentChainFor(template: ScreenTemplate): ScreenTemplate[] {\n const depth = nestingChainTemplates.findIndex(candidate => candidate.name === template.name);\n return depth < 0 ? [template] : nestingChainTemplates.slice(0, depth + 1);\n}\n\nfunction mergeSlotContent(chrome: Record<string, Screen['slotContent'][string]>, content: Record<string, Screen['slotContent'][string]>): Screen['slotContent'] {\n const merged: Screen['slotContent'] = { ...chrome };\n for (const [slotName, elements] of Object.entries(content)) {\n merged[slotName] = [...(merged[slotName] ?? []), ...elements];\n }\n\n return merged;\n}\n\n/**\n * The gallery: one screen per template, ready to boot through the real engine.\n *\n * These exist so a preview is a working miniature application rather than a set of pictures - the same\n * `Screen` shape Stage produces, put through the same `Scene.Engine` and `Scene.React`, with no separate\n * preview pipeline and nothing mocked.\n */\nexport const galleryScreens: Screen[] = galleryScreenTemplates.map(screenFor);\n\n/** One gallery screen by name, for a story or a host that boots a specific one. */\nexport function galleryScreen(name: string): Screen | undefined {\n return galleryScreens.find(screen => screen.name === name);\n}\n"],"names":["galleryScreenTemplates","workspaceTemplates","supportTemplates","authTemplates","statusTemplates","nestingChainTemplates","fullPageTemplateNames","Set","map","template","name","breadcrumbs","Dashboard","label","CrudList","targetScreen","DetailView","FormPage","Empty","Documentation","ProfileSettings","UserManagement","Invoice","Help","ModuleWorkspace","FeatureSection","SliceSection","screenFor","isFullPage","has","layout","fullPageLayout","appShellLayout","chrome","fullPageChrome","applicationChrome","displayName","placeable","nestScreenTemplates","containmentChainFor","LayoutName","FullPage","AppShell","screenTemplate","slotContent","mergeSlotContent","templateContentInLayout","forms","contributions","navigationContributions","depth","findIndex","candidate","slice","content","merged","slotName","elements","Object","entries","galleryScreens","galleryScreen","find","screen"],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AAaA;;;;;;UAOaA,sBAAAA,GAA2C;AACjDC,IAAAA,GAAAA,kBAAAA;AACAC,IAAAA,GAAAA,gBAAAA;AACAC,IAAAA,GAAAA,aAAAA;AACAC,IAAAA,GAAAA,eAAAA;AACAC,IAAAA,GAAAA;;AAGP,sHACA,MAAMC,qBAAAA,GAAwB,IAAIC,GAAAA,CAAI;AAAIJ,IAAAA,GAAAA,aAAAA;AAAkBC,IAAAA,GAAAA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X;AAEA;;;;;;AAMC,IACM,MAAMK,cAAAA,GAA2B5D,sBAAAA,CAAuBQ,GAAG,CAACmB,SAAAA;AAEnE,oFACO,SAASkC,aAAAA,CAAcnD,IAAY,EAAA;AACtC,IAAA,OAAOkD,eAAeE,IAAI,CAACC,CAAAA,MAAAA,GAAUA,MAAAA,CAAOrD,IAAI,KAAKA,IAAAA,CAAAA;AACzD;;"}
|
|
1
|
+
{"version":3,"file":"screens.js","sources":["../../../gallery/screens.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 { Layout, Screen, ScreenTemplate } from '@cratis/scene.model';\nimport { LayoutName, appShellLayout, fullPageLayout } from '../layouts';\nimport { BreadcrumbEntry, applicationChrome, fullPageChrome } from './applicationChrome';\nimport { nestScreenTemplates, templateContentInLayout } from './composeScreen';\nimport { authTemplates } from './authTemplates';\nimport { navigationContributions } from './navigation';\nimport { nestingChainTemplates } from './nesting';\nimport { statusTemplates } from './statusTemplates';\nimport { supportTemplates } from './supportTemplates';\nimport { workspaceTemplates } from './workspaceTemplates';\n\n/**\n * The screen templates this blueprint provides.\n *\n * Eleven shapes for inside the application shell, ten for the full-page shell, and the three-level nesting\n * chain that demonstrates how `fitsSlot` composes. The list is what the manifest's `screenTemplates` names\n * and what the bundle provides; `validatePackageBundle` proves the two agree.\n */\nexport const galleryScreenTemplates: ScreenTemplate[] = [\n ...workspaceTemplates,\n ...supportTemplates,\n ...authTemplates,\n ...statusTemplates,\n ...nestingChainTemplates,\n];\n\n/** Which layout each template renders inside - the application shell unless it is one of the chrome-less screens. */\nconst fullPageTemplateNames = new Set([...authTemplates, ...statusTemplates].map(template => template.name));\n\n/** The trail shown above each application-shell screen. */\nconst breadcrumbs: Record<string, BreadcrumbEntry[]> = {\n Dashboard: [{ label: 'Dashboard' }],\n CrudList: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products' }],\n MasterDetail: [{ label: 'Sales', targetScreen: 'Dashboard' }, { label: 'Customers' }],\n DetailView: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products', targetScreen: 'CrudList' }, { label: 'Bamboo Watch' }],\n FormPage: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products', targetScreen: 'CrudList' }, { label: 'New product' }],\n Empty: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products' }],\n Documentation: [{ label: 'Support', targetScreen: 'Dashboard' }, { label: 'Documentation' }],\n ProfileSettings: [{ label: 'Administration', targetScreen: 'Dashboard' }, { label: 'Your profile' }],\n UserManagement: [{ label: 'Administration', targetScreen: 'Dashboard' }, { label: 'Users' }],\n Invoice: [{ label: 'Billing', targetScreen: 'Dashboard' }, { label: 'INV-2043' }],\n Help: [{ label: 'Support', targetScreen: 'Dashboard' }, { label: 'Help' }],\n ModuleWorkspace: [{ label: 'Operations' }],\n FeatureSection: [{ label: 'Operations', targetScreen: 'ModuleWorkspace' }, { label: 'Adjustments' }],\n SliceSection: [\n { label: 'Operations', targetScreen: 'ModuleWorkspace' },\n { label: 'Adjustments', targetScreen: 'FeatureSection' },\n { label: 'Record an adjustment' },\n ],\n};\n\n/**\n * Builds the {@link Screen} that instantiates one template.\n *\n * A screen is an instance, not a shape: it names the layout it renders in, the template it fills, the\n * content that fills it, and what it contributes elsewhere. Everything structural comes from the template,\n * which is why adding a screen is a handful of lines rather than another copy of the chrome.\n */\nfunction screenFor(template: ScreenTemplate): Screen {\n const isFullPage = fullPageTemplateNames.has(template.name);\n const layout: Layout = isFullPage ? fullPageLayout : appShellLayout;\n const chrome = isFullPage ? fullPageChrome() : applicationChrome(template.name, breadcrumbs[template.name] ?? [{ label: template.displayName ?? template.name }]);\n const placeable = nestScreenTemplates(containmentChainFor(template));\n\n return {\n name: template.name,\n layout: isFullPage ? LayoutName.FullPage : LayoutName.AppShell,\n screenTemplate: template.name,\n slotContent: mergeSlotContent(chrome, templateContentInLayout(placeable, layout)),\n forms: [],\n contributions: isFullPage ? [] : navigationContributions,\n };\n}\n\n/**\n * The chain of templates a screen renders through, outermost first.\n *\n * Almost every template fits the layout's own `content` slot, so its chain is just itself. The three\n * nesting-chain templates are the exception, and the only ones that need the walk - which is the honest\n * version of the story: nesting exists for the applications that need it, and costs nothing for the ones\n * that do not.\n */\nfunction containmentChainFor(template: ScreenTemplate): ScreenTemplate[] {\n const depth = nestingChainTemplates.findIndex(candidate => candidate.name === template.name);\n return depth < 0 ? [template] : nestingChainTemplates.slice(0, depth + 1);\n}\n\nfunction mergeSlotContent(chrome: Record<string, Screen['slotContent'][string]>, content: Record<string, Screen['slotContent'][string]>): Screen['slotContent'] {\n const merged: Screen['slotContent'] = { ...chrome };\n for (const [slotName, elements] of Object.entries(content)) {\n merged[slotName] = [...(merged[slotName] ?? []), ...elements];\n }\n\n return merged;\n}\n\n/**\n * The gallery: one screen per template, ready to boot through the real engine.\n *\n * These exist so a preview is a working miniature application rather than a set of pictures - the same\n * `Screen` shape Stage produces, put through the same `Scene.Engine` and `Scene.React`, with no separate\n * preview pipeline and nothing mocked.\n */\nexport const galleryScreens: Screen[] = galleryScreenTemplates.map(screenFor);\n\n/** One gallery screen by name, for a story or a host that boots a specific one. */\nexport function galleryScreen(name: string): Screen | undefined {\n return galleryScreens.find(screen => screen.name === name);\n}\n"],"names":["galleryScreenTemplates","workspaceTemplates","supportTemplates","authTemplates","statusTemplates","nestingChainTemplates","fullPageTemplateNames","Set","map","template","name","breadcrumbs","Dashboard","label","CrudList","targetScreen","MasterDetail","DetailView","FormPage","Empty","Documentation","ProfileSettings","UserManagement","Invoice","Help","ModuleWorkspace","FeatureSection","SliceSection","screenFor","isFullPage","has","layout","fullPageLayout","appShellLayout","chrome","fullPageChrome","applicationChrome","displayName","placeable","nestScreenTemplates","containmentChainFor","LayoutName","FullPage","AppShell","screenTemplate","slotContent","mergeSlotContent","templateContentInLayout","forms","contributions","navigationContributions","depth","findIndex","candidate","slice","content","merged","slotName","elements","Object","entries","galleryScreens","gal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S,KAAA,GAAGJ,qBAAAA,CAAsBiD,KAAK,CAAC,CAAA,EAAGH,KAAAA,GAAQ,CAAA,CAAA;AAC3E;AAEA,SAASL,gBAAAA,CAAiBZ,MAAqD,EAAEqB,OAAsD,EAAA;AACnI,IAAA,MAAMC,MAAAA,GAAgC;AAAE,QAAA,GAAGtB;AAAO,KAAA;IAClD,KAAK,MAAM,CAACuB,QAAAA,EAAUC,QAAAA,CAAS,IAAIC,MAAAA,CAAOC,OAAO,CAACL,OAAAA,CAAAA,CAAU;QACxDC,MAAM,CAACC,SAAS,GAAG;eAAKD,MAAM,CAACC,QAAAA,CAAS,IAAI,EAAE;AAAMC,YAAAA,GAAAA;AAAS,SAAA;AACjE,IAAA;IAEA,OAAOF,MAAAA;AACX;AAEA;;;;;;AAMC,IACM,MAAMK,cAAAA,GAA2B7D,sBAAAA,CAAuBQ,GAAG,CAACoB,SAAAA;AAEnE,oFACO,SAASkC,aAAAA,CAAcpD,IAAY,EAAA;AACtC,IAAA,OAAOmD,eAAeE,IAAI,CAACC,CAAAA,MAAAA,GAAUA,MAAAA,CAAOtD,IAAI,KAAKA,IAAAA,CAAAA;AACzD;;"}
|
|
@@ -106,7 +106,8 @@ import { defaultBlueprintTemplateProvenance } from '../templateProvenance.js';
|
|
|
106
106
|
text('not-found-title', 'That page is not here'),
|
|
107
107
|
text('not-found-message', 'The link may be old, or the thing it pointed at may have been removed.'),
|
|
108
108
|
externalComponent('not-found-search', 'inputText', {
|
|
109
|
-
placeholder: 'Search instead'
|
|
109
|
+
placeholder: 'Search instead',
|
|
110
|
+
ariaLabel: 'Search'
|
|
110
111
|
}),
|
|
111
112
|
button('not-found-home', 'Back to the dashboard', {
|
|
112
113
|
severity: 'secondary',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusTemplates.js","sources":["../../../gallery/statusTemplates.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, panel, text } from './elements';\nimport { widget } from './widgets';\nimport { defaultBlueprintTemplateProvenance } from '../templateProvenance';\n\n/**\n * The four screens that are not part of anyone's plan: a server error, a refusal, a wrong address, and the\n * page that has to sell the product before any of the others exist.\n *\n * They use the full-page layout for the same reason the sign-in screens do - none of them has navigation\n * to render - and they matter more than their frequency suggests. An error page is the screen most likely\n * to be someone's first impression of how carefully an application was built.\n */\n\n/** Something broke on our side. */\nexport const errorTemplate: ScreenTemplate = {\n name: 'Error',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n card('error-card', [\n externalComponent('error-tag', 'tag', { value: '500', severity: 'danger' }),\n text('error-title', 'Something went wrong on our side'),\n text('error-message', 'The team has been told. Try again in a moment - nothing you were working on was lost.'),\n panel('error-actions', [\n button('error-retry', 'Try again', { severity: 'primary' }),\n button('error-home', 'Back to the dashboard', { severity: 'secondary', targetScreen: 'Dashboard' }),\n ]),\n ]),\n ],\n },\n displayName: 'Error',\n description: 'A server-side failure, said plainly, with a way onward.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** Signed in, and still not allowed. */\nexport const accessDeniedTemplate: ScreenTemplate = {\n name: 'AccessDenied',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n card('denied-card', [\n externalComponent('denied-tag', 'tag', { value: '403', severity: 'warning' }),\n text('denied-title', 'You do not have access to this'),\n text('denied-message', 'Your account is signed in, but it is not allowed here. An administrator can change that.'),\n panel('denied-actions', [\n button('denied-request', 'Request access', { severity: 'primary' }),\n button('denied-home', 'Back to the dashboard', { severity: 'secondary', targetScreen: 'Dashboard' }),\n ]),\n ]),\n ],\n },\n displayName: 'Access denied',\n description: 'A refusal that distinguishes \"not signed in\" from \"not allowed\".',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** No such address. */\nexport const notFoundTemplate: ScreenTemplate = {\n name: 'NotFound',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n card('not-found-card', [\n externalComponent('not-found-tag', 'tag', { value: '404', severity: 'info' }),\n text('not-found-title', 'That page is not here'),\n text('not-found-message', 'The link may be old, or the thing it pointed at may have been removed.'),\n externalComponent('not-found-search', 'inputText', { placeholder: 'Search instead' }),\n button('not-found-home', 'Back to the dashboard', { severity: 'secondary', targetScreen: 'Dashboard' }),\n ]),\n ],\n },\n displayName: 'Not found',\n description: 'A wrong address, with a search box rather than a dead end.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The page that has to do the selling. */\nexport const landingTemplate: ScreenTemplate = {\n name: 'Landing',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [\n panel('landing-nav', [\n externalComponent('landing-logo', ComponentName.Logo, { label: 'Contoso', initials: 'C' }),\n button('landing-signin', 'Sign in', { severity: 'secondary', targetScreen: 'Login' }),\n button('landing-start', 'Start free', { severity: 'primary', targetScreen: 'Register' }),\n ]),\n ],\n [TemplateSlotName.Body]: [\n card('landing-hero', [\n text('landing-headline', 'Ship the shell on day one'),\n text('landing-subhead', 'Eight menu modes, twenty screen templates and two themes, in one blueprint an application picks once.'),\n button('landing-cta', 'Start free', { severity: 'primary', targetScreen: 'Register' }),\n ]),\n widget('landing-feature-modes', 'Every mode people expect', [text('landing-modes-text', 'Static, overlay, slim, slim+, compact, horizontal, reveal and drawer.')]),\n widget('landing-feature-themes', 'Themeable to the token', [text('landing-themes-text', 'Ten semantic tokens define the whole shell. Swap them and everything follows.')]),\n widget('landing-feature-templates', 'The pages you were going to build anyway', [\n text('landing-templates-text', 'Dashboard, list, detail, form, invoice, settings, help - and every screen around signing in.'),\n ]),\n ],\n [TemplateSlotName.Actions]: [\n panel('landing-footer', [text('landing-copyright', '© Contoso'), button('landing-contact', 'Talk to us', { severity: 'secondary' })]),\n ],\n },\n displayName: 'Landing',\n description: 'The marketing front door, with its own navigation because it has no application chrome.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The four status and marketing templates. */\nexport const statusTemplates: ScreenTemplate[] = [errorTemplate, accessDeniedTemplate, notFoundTemplate, landingTemplate];\n"],"names":["errorTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Body","content","card","externalComponent","value","severity","text","panel","button","targetScreen","displayName","description","metadata","defaultBlueprintTemplateProvenance","accessDeniedTemplate","notFoundTemplate","placeholder","landingTemplate","Header","Actions","ComponentName","Logo","label","initials","widget","statusTemplates"],"mappings":";;;;;;;;;;;AAAA;AACA;AAUA;;;;;;;AAOC,wCAGM,MAAMA,aAAAA,GAAgC;IACzCC,IAAAA,EAAM,OAAA;AACNC,IAAAA,QAAAA,EAAUC,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAAiBC;AAAK;AAAE,KAAA;IACxCC,OAAAA,EAAS;QACL,CAACF,gBAAAA,CAAiBC,IAAI,GAAG;AACrBE,YAAAA,IAAAA,CAAK,YAAA,EAAc;AACfC,gBAAAA,iBAAAA,CAAkB,aAAa,KAAA,EAAO;oBAAEC,KAAAA,EAAO,KAAA;oBAAOC,QAAAA,EAAU;AAAS,iBAAA,CAAA;AACzEC,gBAAAA,IAAAA,CAAK,aAAA,EAAe,kCAAA,CAAA;AACpBA,gBAAAA,IAAAA,CAAK,eAAA,EAAiB,uFAAA,CAAA;AACtBC,gBAAAA,KAAAA,CAAM,eAAA,EAAiB;AACnBC,oBAAAA,MAAAA,CAAO,eAAe,WAAA,EAAa;wBAAEH,QAAAA,EAAU;AAAU,qBAAA,CAAA;AACzDG,oBAA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,MAAAA,CAAO,mBAAmB,YAAA,EAAc;oBAAEH,QAAAA,EAAU;AAAY,iBAAA;AAAG,aAAA;AACvI;AACL,KAAA;IACAK,WAAAA,EAAa,SAAA;IACbC,WAAAA,EAAa,yFAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGC;AAAmC;AACtD;AAEA,gDACO,MAAMY,eAAAA,GAAoC;AAAChC,IAAAA,aAAAA;AAAeqB,IAAAA,oBAAAA;AAAsBC,IAAAA,gBAAAA;AAAkBE,IAAAA;;;"}
|
|
1
|
+
{"version":3,"file":"statusTemplates.js","sources":["../../../gallery/statusTemplates.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, panel, text } from './elements';\nimport { widget } from './widgets';\nimport { defaultBlueprintTemplateProvenance } from '../templateProvenance';\n\n/**\n * The four screens that are not part of anyone's plan: a server error, a refusal, a wrong address, and the\n * page that has to sell the product before any of the others exist.\n *\n * They use the full-page layout for the same reason the sign-in screens do - none of them has navigation\n * to render - and they matter more than their frequency suggests. An error page is the screen most likely\n * to be someone's first impression of how carefully an application was built.\n */\n\n/** Something broke on our side. */\nexport const errorTemplate: ScreenTemplate = {\n name: 'Error',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n card('error-card', [\n externalComponent('error-tag', 'tag', { value: '500', severity: 'danger' }),\n text('error-title', 'Something went wrong on our side'),\n text('error-message', 'The team has been told. Try again in a moment - nothing you were working on was lost.'),\n panel('error-actions', [\n button('error-retry', 'Try again', { severity: 'primary' }),\n button('error-home', 'Back to the dashboard', { severity: 'secondary', targetScreen: 'Dashboard' }),\n ]),\n ]),\n ],\n },\n displayName: 'Error',\n description: 'A server-side failure, said plainly, with a way onward.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** Signed in, and still not allowed. */\nexport const accessDeniedTemplate: ScreenTemplate = {\n name: 'AccessDenied',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n card('denied-card', [\n externalComponent('denied-tag', 'tag', { value: '403', severity: 'warning' }),\n text('denied-title', 'You do not have access to this'),\n text('denied-message', 'Your account is signed in, but it is not allowed here. An administrator can change that.'),\n panel('denied-actions', [\n button('denied-request', 'Request access', { severity: 'primary' }),\n button('denied-home', 'Back to the dashboard', { severity: 'secondary', targetScreen: 'Dashboard' }),\n ]),\n ]),\n ],\n },\n displayName: 'Access denied',\n description: 'A refusal that distinguishes \"not signed in\" from \"not allowed\".',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** No such address. */\nexport const notFoundTemplate: ScreenTemplate = {\n name: 'NotFound',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n card('not-found-card', [\n externalComponent('not-found-tag', 'tag', { value: '404', severity: 'info' }),\n text('not-found-title', 'That page is not here'),\n text('not-found-message', 'The link may be old, or the thing it pointed at may have been removed.'),\n externalComponent('not-found-search', 'inputText', { placeholder: 'Search instead', ariaLabel: 'Search' }),\n button('not-found-home', 'Back to the dashboard', { severity: 'secondary', targetScreen: 'Dashboard' }),\n ]),\n ],\n },\n displayName: 'Not found',\n description: 'A wrong address, with a search box rather than a dead end.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The page that has to do the selling. */\nexport const landingTemplate: ScreenTemplate = {\n name: 'Landing',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [\n panel('landing-nav', [\n externalComponent('landing-logo', ComponentName.Logo, { label: 'Contoso', initials: 'C' }),\n button('landing-signin', 'Sign in', { severity: 'secondary', targetScreen: 'Login' }),\n button('landing-start', 'Start free', { severity: 'primary', targetScreen: 'Register' }),\n ]),\n ],\n [TemplateSlotName.Body]: [\n card('landing-hero', [\n text('landing-headline', 'Ship the shell on day one'),\n text('landing-subhead', 'Eight menu modes, twenty screen templates and two themes, in one blueprint an application picks once.'),\n button('landing-cta', 'Start free', { severity: 'primary', targetScreen: 'Register' }),\n ]),\n widget('landing-feature-modes', 'Every mode people expect', [text('landing-modes-text', 'Static, overlay, slim, slim+, compact, horizontal, reveal and drawer.')]),\n widget('landing-feature-themes', 'Themeable to the token', [text('landing-themes-text', 'Ten semantic tokens define the whole shell. Swap them and everything follows.')]),\n widget('landing-feature-templates', 'The pages you were going to build anyway', [\n text('landing-templates-text', 'Dashboard, list, detail, form, invoice, settings, help - and every screen around signing in.'),\n ]),\n ],\n [TemplateSlotName.Actions]: [\n panel('landing-footer', [text('landing-copyright', '© Contoso'), button('landing-contact', 'Talk to us', { severity: 'secondary' })]),\n ],\n },\n displayName: 'Landing',\n description: 'The marketing front door, with its own navigation because it has no application chrome.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The four status and marketing templates. */\nexport const statusTemplates: ScreenTemplate[] = [errorTemplate, accessDeniedTemplate, notFoundTemplate, landingTemplate];\n"],"names":["errorTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Body","content","card","externalComponent","value","severity","text","panel","button","targetScreen","displayName","description","metadata","defaultBlueprintTemplateProvenance","accessDeniedTemplate","notFoundTemplate","placeholder","ariaLabel","landingTemplate","Header","Actions","ComponentName","Logo","label","initials","widget","statusTemplates"],"mappings":";;;;;;;;;;;AAAA;AACA;AAUA;;;;;;;AAOC,wCAGM,MAAMA,aAAAA,GAAgC;IACzCC,IAAAA,EAAM,OAAA;AACNC,IAAAA,QAAAA,EAAUC,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAA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;AACDgB,YAAAA,MAAAA,CAAO,yBAAyB,0BAAA,EAA4B;AAACnB,gBAAAA,IAAAA,CAAK,oBAAA,EAAsB,uEAAA;AAAyE,aAAA,CAAA;AACjKmB,YAAAA,MAAAA,CAAO,0BAA0B,wBAAA,EAA0B;AAACnB,gBAAAA,IAAAA,CAAK,qBAAA,EAAuB,+EAAA;AAAiF,aAAA,CAAA;AACzKmB,YAAAA,MAAAA,CAAO,6BAA6B,0CAAA,EAA4C;AAC5EnB,gBAAAA,IAAAA,CAAK,wBAAA,EAA0B,8FAAA;AAClC,aAAA;AACJ,SAAA;QACD,CAACP,gBAAAA,CAAiBqB,OAAO,GAAG;AACxBb,YAAAA,KAAAA,CAAM,gBAAA,EAAkB;AAACD,gBAAAA,IAAAA,CAAK,mBAAA,EAAqB,WAAA,CAAA;AAAcE,gBAAAA,MAAAA,CAAO,mBAAmB,YAAA,EAAc;oBAAEH,QAAAA,EAAU;AAAY,iBAAA;AAAG,aAAA;AACvI;AACL,KAAA;IACAK,WAAAA,EAAa,SAAA;IACbC,WAAAA,EAAa,yFAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGC;AAAmC;AACtD;AAEA,gDACO,MAAMa,eAAAA,GAAoC;AAACjC,IAAAA,aAAAA;AAAeqB,IAAAA,oBAAAA;AAAsBC,IAAAA,gBAAAA;AAAkBG,IAAAA;;;"}
|
|
@@ -293,7 +293,8 @@ import { defaultBlueprintTemplateProvenance } from '../templateProvenance.js';
|
|
|
293
293
|
],
|
|
294
294
|
[TemplateSlotName.Body]: [
|
|
295
295
|
externalComponent('help-search', 'inputText', {
|
|
296
|
-
placeholder: 'Search help'
|
|
296
|
+
placeholder: 'Search help',
|
|
297
|
+
ariaLabel: 'Search help'
|
|
297
298
|
}),
|
|
298
299
|
widget('help-popular', 'Popular answers', [
|
|
299
300
|
text('help-1', 'How do I invite someone to the workspace?'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supportTemplates.js","sources":["../../../gallery/supportTemplates.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 { SlotName } from '../layouts';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, card, externalComponent, text } from './elements';\nimport { field, formActions, pageHeader, table, widget } from './widgets';\nimport { defaultBlueprintTemplateProvenance } from '../templateProvenance';\n\n/**\n * The five shapes an application needs that are not the CRUD loop: documentation, the signed-in user's own\n * settings, user administration, a printable document, and help.\n *\n * They are in the set because leaving them out is what makes a template line feel thin. Every real\n * application grows all five, and the ones that were never designed are the ones that end up looking like\n * a different product.\n */\n\n/** Documentation: a table of contents beside prose. */\nexport const documentationTemplate: ScreenTemplate = {\n name: 'Documentation',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.SidePanel }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.SidePanel]: [\n widget('docs-toc', 'On this page', [\n text('docs-toc-1', 'Getting started'),\n text('docs-toc-2', 'Configuring the shell'),\n text('docs-toc-3', 'Themes'),\n text('docs-toc-4', 'Publishing a blueprint'),\n ]),\n ],\n [TemplateSlotName.Body]: [\n pageHeader('docs-header', 'Getting started', 'Everything you need to run the blueprint locally'),\n card('docs-body', [\n text('docs-intro', 'Install the blueprint, add it to a ui profile, and pick a layout. The shell reads its mode from the configurator and remembers it.'),\n externalComponent('docs-note', 'message', { severity: 'info', text: 'The shell needs its stylesheet imported once, at the host.' }),\n ]),\n ],\n },\n displayName: 'Documentation',\n description: 'Prose with a table of contents beside it.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** Profile settings: the signed-in user editing their own account. */\nexport const profileSettingsTemplate: ScreenTemplate = {\n name: 'ProfileSettings',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [pageHeader('profile-header', 'Your profile', 'How you appear to everyone else in the workspace')],\n [TemplateSlotName.Body]: [\n card('profile-identity', [\n externalComponent('profile-avatar', 'avatar', { label: 'AN', size: 'large', shape: 'circle' }),\n field('profile-name', 'Display name', 'inputText', { value: 'Amelia Nyquist' }),\n field('profile-email', 'Email', 'inputText', { value: 'amelia@contoso.com' }),\n externalComponent('profile-photo', 'image', { alt: 'Your current photo' }),\n button('profile-photo-change', 'Change photo', { severity: 'secondary' }),\n ]),\n card('profile-security', [\n field('profile-current', 'Current password', 'password', {}),\n field('profile-new', 'New password', 'password', { feedback: true }),\n field('profile-notify', 'Email me about mentions', 'checkbox', { checked: true }),\n ]),\n ],\n [TemplateSlotName.Actions]: [formActions('profile-actions', 'Save changes')],\n },\n displayName: 'Profile settings',\n description: 'The signed-in user editing their own name, photo, password and notifications.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** User management: administering everybody else. */\nexport const userManagementTemplate: ScreenTemplate = {\n name: 'UserManagement',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Toolbar]: [\n pageHeader('users-header', 'Users', '34 people, 3 pending invitations', [button('users-invite', 'Invite people', { severity: 'primary', icon: 'pi pi-user-plus' })]),\n ],\n [TemplateSlotName.Body]: [\n table(\n 'users-table',\n [\n { field: 'name', header: 'Name' },\n { field: 'email', header: 'Email' },\n { field: 'role', header: 'Role' },\n { field: 'status', header: 'Status' },\n { field: 'lastSeen', header: 'Last seen' },\n ],\n [\n { name: 'Amelia Nyquist', email: 'amelia@contoso.com', role: 'Owner', status: 'Active', lastSeen: '2 minutes ago' },\n { name: 'Bjørn Holt', email: 'bjorn@contoso.com', role: 'Administrator', status: 'Active', lastSeen: 'Yesterday' },\n { name: 'Chidi Okafor', email: 'chidi@contoso.com', role: 'Editor', status: 'Active', lastSeen: '3 days ago' },\n { name: 'Dana Whitfield', email: 'dana@contoso.com', role: 'Viewer', status: 'Invited', lastSeen: 'Never' },\n ],\n ),\n ],\n },\n displayName: 'User management',\n description: 'The people table, with roles, status and an invitation action.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** Invoice: a printable document, which is a different shape from a screen. */\nexport const invoiceTemplate: ScreenTemplate = {\n name: 'Invoice',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [\n pageHeader('invoice-header', 'Invoice INV-2043', 'Issued 4 March · Due 3 April', [button('invoice-print', 'Print', { severity: 'secondary', icon: 'pi pi-print' })]),\n ],\n [TemplateSlotName.Body]: [\n card('invoice-parties', [\n text('invoice-from', 'From: Contoso Ltd, 4 Chandler Street, Dublin'),\n text('invoice-to', 'To: Northwind Traders, 18 Quay Road, Cork'),\n ]),\n table(\n 'invoice-lines',\n [\n { field: 'description', header: 'Description' },\n { field: 'quantity', header: 'Quantity' },\n { field: 'unitPrice', header: 'Unit price' },\n { field: 'amount', header: 'Amount' },\n ],\n [\n { description: 'Bamboo Watch', quantity: 12, unitPrice: '$65.00', amount: '$780.00' },\n { description: 'Blue Band', quantity: 4, unitPrice: '$79.00', amount: '$316.00' },\n { description: 'Expedited shipping', quantity: 1, unitPrice: '$144.00', amount: '$144.00' },\n ],\n ),\n card('invoice-total', [text('invoice-subtotal', 'Subtotal: $1,240.00'), text('invoice-vat', 'VAT (23%): $285.20'), text('invoice-due', 'Total due: $1,525.20')]),\n ],\n [TemplateSlotName.Actions]: [formActions('invoice-actions', 'Mark as paid', 'Send reminder')],\n },\n displayName: 'Invoice',\n description: 'A printable document: parties, line items and totals.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** Help: the answers, and a way to ask when they are not there. */\nexport const helpTemplate: ScreenTemplate = {\n name: 'Help',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n content: {\n [TemplateSlotName.Header]: [pageHeader('help-header', 'Help', 'Search the answers, or ask us directly')],\n [TemplateSlotName.Body]: [\n externalComponent('help-search', 'inputText', { placeholder: 'Search help' }),\n widget('help-popular', 'Popular answers', [\n text('help-1', 'How do I invite someone to the workspace?'),\n text('help-2', 'Why can I not see the sidebar on my phone?'),\n text('help-3', 'How do I change the theme?'),\n ]),\n ],\n [TemplateSlotName.SidePanel]: [\n widget('help-contact', 'Still stuck?', [text('help-contact-text', 'We answer within one working day.'), button('help-contact-button', 'Contact support', { severity: 'primary' })]),\n ],\n },\n displayName: 'Help',\n description: 'Searchable answers with a route to a human.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The five support templates. */\nexport const supportTemplates: ScreenTemplate[] = [documentationTemplate, profileSettingsTemplate, userManagementTemplate, invoiceTemplate, helpTemplate];\n"],"names":["documentationTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","SidePanel","Body","content","widget","text","pageHeader","card","externalComponent","severity","displayName","description","metadata","defaultBlueprintTemplateProvenance","profileSettingsTemplate","Header","Actions","label","size","shape","field","value","alt","button","feedback","checked","formActions","userManagementTemplate","Toolbar","icon","table","header","email","role","status","lastSeen","invoiceTemplate","quantity","unitPrice","amount","helpTemplate","placeholder","supportTemplates"],"mappings":";;;;;;;;;;AAAA;AACA;AASA;;;;;;;AAOC,4DAGM,MAAMA,qBAAAA,GAAwC;IACjDC,IAAAA,EAAM,eAAA;AACNC,IAAAA,QAAAA,EAAUC,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAAiBC;AAAU,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,iBAAiBE;AAAK;AAAE,KAAA;IAC9EC,OAAAA,EAAS;QACL,CAACH,gBAAAA,CAAiBC,SAAS,GAAG;AAC1BG,YAAAA,MAAAA,CAAO,YAAY,cAAA,EAAgB;AAC/BC,gBAAAA,IAAAA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
+
{"version":3,"file":"supportTemplates.js","sources":["../../../gallery/supportTemplates.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 { SlotName } from '../layouts';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, card, externalComponent, text } from './elements';\nimport { field, formActions, pageHeader, table, widget } from './widgets';\nimport { defaultBlueprintTemplateProvenance } from '../templateProvenance';\n\n/**\n * The five shapes an application needs that are not the CRUD loop: documentation, the signed-in user's own\n * settings, user administration, a printable document, and help.\n *\n * They are in the set because leaving them out is what makes a template line feel thin. Every real\n * application grows all five, and the ones that were never designed are the ones that end up looking like\n * a different product.\n */\n\n/** Documentation: a table of contents beside prose. */\nexport const documentationTemplate: ScreenTemplate = {\n name: 'Documentation',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.SidePanel }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.SidePanel]: [\n widget('docs-toc', 'On this page', [\n text('docs-toc-1', 'Getting started'),\n text('docs-toc-2', 'Configuring the shell'),\n text('docs-toc-3', 'Themes'),\n text('docs-toc-4', 'Publishing a blueprint'),\n ]),\n ],\n [TemplateSlotName.Body]: [\n pageHeader('docs-header', 'Getting started', 'Everything you need to run the blueprint locally'),\n card('docs-body', [\n text('docs-intro', 'Install the blueprint, add it to a ui profile, and pick a layout. The shell reads its mode from the configurator and remembers it.'),\n externalComponent('docs-note', 'message', { severity: 'info', text: 'The shell needs its stylesheet imported once, at the host.' }),\n ]),\n ],\n },\n displayName: 'Documentation',\n description: 'Prose with a table of contents beside it.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** Profile settings: the signed-in user editing their own account. */\nexport const profileSettingsTemplate: ScreenTemplate = {\n name: 'ProfileSettings',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [pageHeader('profile-header', 'Your profile', 'How you appear to everyone else in the workspace')],\n [TemplateSlotName.Body]: [\n card('profile-identity', [\n externalComponent('profile-avatar', 'avatar', { label: 'AN', size: 'large', shape: 'circle' }),\n field('profile-name', 'Display name', 'inputText', { value: 'Amelia Nyquist' }),\n field('profile-email', 'Email', 'inputText', { value: 'amelia@contoso.com' }),\n externalComponent('profile-photo', 'image', { alt: 'Your current photo' }),\n button('profile-photo-change', 'Change photo', { severity: 'secondary' }),\n ]),\n card('profile-security', [\n field('profile-current', 'Current password', 'password', {}),\n field('profile-new', 'New password', 'password', { feedback: true }),\n field('profile-notify', 'Email me about mentions', 'checkbox', { checked: true }),\n ]),\n ],\n [TemplateSlotName.Actions]: [formActions('profile-actions', 'Save changes')],\n },\n displayName: 'Profile settings',\n description: 'The signed-in user editing their own name, photo, password and notifications.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** User management: administering everybody else. */\nexport const userManagementTemplate: ScreenTemplate = {\n name: 'UserManagement',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Toolbar]: [\n pageHeader('users-header', 'Users', '34 people, 3 pending invitations', [button('users-invite', 'Invite people', { severity: 'primary', icon: 'pi pi-user-plus' })]),\n ],\n [TemplateSlotName.Body]: [\n table(\n 'users-table',\n [\n { field: 'name', header: 'Name' },\n { field: 'email', header: 'Email' },\n { field: 'role', header: 'Role' },\n { field: 'status', header: 'Status' },\n { field: 'lastSeen', header: 'Last seen' },\n ],\n [\n { name: 'Amelia Nyquist', email: 'amelia@contoso.com', role: 'Owner', status: 'Active', lastSeen: '2 minutes ago' },\n { name: 'Bjørn Holt', email: 'bjorn@contoso.com', role: 'Administrator', status: 'Active', lastSeen: 'Yesterday' },\n { name: 'Chidi Okafor', email: 'chidi@contoso.com', role: 'Editor', status: 'Active', lastSeen: '3 days ago' },\n { name: 'Dana Whitfield', email: 'dana@contoso.com', role: 'Viewer', status: 'Invited', lastSeen: 'Never' },\n ],\n ),\n ],\n },\n displayName: 'User management',\n description: 'The people table, with roles, status and an invitation action.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** Invoice: a printable document, which is a different shape from a screen. */\nexport const invoiceTemplate: ScreenTemplate = {\n name: 'Invoice',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [\n pageHeader('invoice-header', 'Invoice INV-2043', 'Issued 4 March · Due 3 April', [button('invoice-print', 'Print', { severity: 'secondary', icon: 'pi pi-print' })]),\n ],\n [TemplateSlotName.Body]: [\n card('invoice-parties', [\n text('invoice-from', 'From: Contoso Ltd, 4 Chandler Street, Dublin'),\n text('invoice-to', 'To: Northwind Traders, 18 Quay Road, Cork'),\n ]),\n table(\n 'invoice-lines',\n [\n { field: 'description', header: 'Description' },\n { field: 'quantity', header: 'Quantity' },\n { field: 'unitPrice', header: 'Unit price' },\n { field: 'amount', header: 'Amount' },\n ],\n [\n { description: 'Bamboo Watch', quantity: 12, unitPrice: '$65.00', amount: '$780.00' },\n { description: 'Blue Band', quantity: 4, unitPrice: '$79.00', amount: '$316.00' },\n { description: 'Expedited shipping', quantity: 1, unitPrice: '$144.00', amount: '$144.00' },\n ],\n ),\n card('invoice-total', [text('invoice-subtotal', 'Subtotal: $1,240.00'), text('invoice-vat', 'VAT (23%): $285.20'), text('invoice-due', 'Total due: $1,525.20')]),\n ],\n [TemplateSlotName.Actions]: [formActions('invoice-actions', 'Mark as paid', 'Send reminder')],\n },\n displayName: 'Invoice',\n description: 'A printable document: parties, line items and totals.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** Help: the answers, and a way to ask when they are not there. */\nexport const helpTemplate: ScreenTemplate = {\n name: 'Help',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n content: {\n [TemplateSlotName.Header]: [pageHeader('help-header', 'Help', 'Search the answers, or ask us directly')],\n [TemplateSlotName.Body]: [\n externalComponent('help-search', 'inputText', { placeholder: 'Search help', ariaLabel: 'Search help' }),\n widget('help-popular', 'Popular answers', [\n text('help-1', 'How do I invite someone to the workspace?'),\n text('help-2', 'Why can I not see the sidebar on my phone?'),\n text('help-3', 'How do I change the theme?'),\n ]),\n ],\n [TemplateSlotName.SidePanel]: [\n widget('help-contact', 'Still stuck?', [text('help-contact-text', 'We answer within one working day.'), button('help-contact-button', 'Contact support', { severity: 'primary' })]),\n ],\n },\n displayName: 'Help',\n description: 'Searchable answers with a route to a human.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The five support templates. */\nexport const supportTemplates: ScreenTemplate[] = [documentationTemplate, profileSettingsTemplate, userManagementTemplate, invoiceTemplate, helpTemplate];\n"],"names":["documentationTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","SidePanel","Body","content","widget","text","pageHeader","card","externalComponent","severity","displayName","description","metadata","defaultBlueprintTemplateProvenance","profileSettingsTemplate","Header","Actions","label","size","shape","field","value","alt","button","feedback","checked","formActions","userManagementTemplate","Toolbar","icon","table","header","email","role","status","lastSeen","invoiceTemplate","quantity","unitPrice","amount","helpTemplate","placeholder","ariaLabel","supportTemplates"],"mappings":";;;;;;;;;;AAAA;AACA;AASA;;;;;;;AAOC,4DAGM,MAAMA,qBAAAA,GAAwC;IACjDC,IAAAA,EAAM,eAAA;AACNC,IAAAA,QAAAA,EAAUC,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAAiBC;AAAU,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,iBAAiBE;AAAK;AAAE,KAAA;IAC9EC,OAAAA,EAAS;QACL,CAACH,gBAAAA,CAAiBC,SAAS,GAAG;AAC1BG,YAA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uBAAAA;AAAyBa,IAAAA,sBAAAA;AAAwBS,IAAAA,eAAAA;AAAiBI,IAAAA;;;"}
|
|
@@ -5,7 +5,7 @@ export declare function widget(id: string, title: string, content: SceneElement[
|
|
|
5
5
|
export declare function table(id: string, columns: {
|
|
6
6
|
field: string;
|
|
7
7
|
header: string;
|
|
8
|
-
}[], rows: Record<string, unknown>[]): SceneElement;
|
|
8
|
+
}[], rows: Record<string, unknown>[], emptyMessage?: string): SceneElement;
|
|
9
9
|
export declare function field(id: string, label: string, componentName: string, properties?: Record<string, unknown>): SceneElement;
|
|
10
10
|
export declare function formActions(id: string, confirmLabel: string, cancelLabel?: string): SceneElement;
|
|
11
11
|
export declare function emptyState(id: string, title: string, message: string, actionLabel: string): SceneElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets.d.ts","sourceRoot":"","sources":["../../../gallery/widgets.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAcnD,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,YAAY,EAAO,GAAG,YAAY,CAElH;AAMD,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAE5G;AAGD,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,YAAY,CAEvF;
|
|
1
|
+
{"version":3,"file":"widgets.d.ts","sourceRoot":"","sources":["../../../gallery/widgets.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAcnD,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,YAAY,EAAO,GAAG,YAAY,CAElH;AAMD,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAE5G;AAGD,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,YAAY,CAEvF;AASD,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,YAAY,SAAwB,GAAG,YAAY,CAOnK;AAMD,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,YAAY,CAE9H;AAGD,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,SAAW,GAAG,YAAY,CAElG;AAGD,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,YAAY,CAOxG"}
|
|
@@ -39,12 +39,20 @@ import { card, text, externalComponent, panel, button } from './elements.js';
|
|
|
39
39
|
title
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* A table with real columns and real rows, so a list template looks like a list.
|
|
44
|
+
*
|
|
45
|
+
* The properties are the table's own vocabulary - `rows` for the records and `pageSize` to page them - so
|
|
46
|
+
* a host with the real table loaded shows the rows rather than an empty grid. `emptyMessage` is what the
|
|
47
|
+
* same table says once the rows are gone, which is how a preview shows a template's empty state.
|
|
48
|
+
*/ function table(id, columns, rows, emptyMessage = 'Nothing to show yet') {
|
|
43
49
|
return externalComponent(id, 'dataTable', {
|
|
44
|
-
|
|
50
|
+
rows,
|
|
45
51
|
dataKey: columns[0]?.field ?? 'id',
|
|
46
|
-
|
|
47
|
-
rows
|
|
52
|
+
emptyMessage,
|
|
53
|
+
...rows.length > 8 ? {
|
|
54
|
+
pageSize: 8
|
|
55
|
+
} : {}
|
|
48
56
|
}, {
|
|
49
57
|
columns: columns.map((column)=>externalComponent(`${id}-${column.field}`, 'column', {
|
|
50
58
|
field: column.field,
|
|
@@ -53,10 +61,16 @@ import { card, text, externalComponent, panel, button } from './elements.js';
|
|
|
53
61
|
}))
|
|
54
62
|
});
|
|
55
63
|
}
|
|
56
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* One labeled input in a form template. The visible label is a separate text element, so the input carries
|
|
66
|
+
* the same words as its accessible name - otherwise a screen reader announces an unnamed field.
|
|
67
|
+
*/ function field(id, label, componentName, properties = {}) {
|
|
57
68
|
return panel(id, [
|
|
58
69
|
text(`${id}-label`, label),
|
|
59
|
-
externalComponent(`${id}-input`, componentName,
|
|
70
|
+
externalComponent(`${id}-input`, componentName, {
|
|
71
|
+
ariaLabel: label,
|
|
72
|
+
...properties
|
|
73
|
+
})
|
|
60
74
|
]);
|
|
61
75
|
}
|
|
62
76
|
/** A row of buttons closing a form. */ function formActions(id, confirmLabel, cancelLabel = 'Cancel') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets.js","sources":["../../../gallery/widgets.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 { button, card, externalComponent, panel, text } from './elements';\n\n/**\n * The repeated pieces the gallery's screen templates are built from.\n *\n * The gallery only earns its place if a preview shows something that looks like an application - a\n * dashboard with four stat cards over two columns of larger widgets, a list with real columns and real\n * rows. Seeded content that says \"Lorem ipsum\" proves the renderer runs and nothing else. These builders\n * are what keep twenty templates' worth of realistic content from becoming twenty pages of literals.\n */\n\n/** A screen's title, subtitle and actions - the furniture every template starts with. */\nexport function pageHeader(id: string, title: string, subtitle: string, actions: SceneElement[] = []): SceneElement {\n return externalComponent(id, ComponentName.PageHeader, { title, subtitle }, { actions });\n}\n\n/**\n * One of the four figures across the top of a dashboard - the composition Sakai's dashboard opens with,\n * and the one every template in the line has copied since.\n */\nexport function statCard(id: string, label: string, value: string, delta: string, icon: string): SceneElement {\n return card(id, [text(`${id}-label`, label), text(`${id}-value`, value), text(`${id}-delta`, delta)], { icon, variant: 'stat' });\n}\n\n/** A titled surface holding a widget's content. */\nexport function widget(id: string, title: string, content: SceneElement[]): SceneElement {\n return card(id, [text(`${id}-title`, title), ...content], { title });\n}\n\n
|
|
1
|
+
{"version":3,"file":"widgets.js","sources":["../../../gallery/widgets.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 { button, card, externalComponent, panel, text } from './elements';\n\n/**\n * The repeated pieces the gallery's screen templates are built from.\n *\n * The gallery only earns its place if a preview shows something that looks like an application - a\n * dashboard with four stat cards over two columns of larger widgets, a list with real columns and real\n * rows. Seeded content that says \"Lorem ipsum\" proves the renderer runs and nothing else. These builders\n * are what keep twenty templates' worth of realistic content from becoming twenty pages of literals.\n */\n\n/** A screen's title, subtitle and actions - the furniture every template starts with. */\nexport function pageHeader(id: string, title: string, subtitle: string, actions: SceneElement[] = []): SceneElement {\n return externalComponent(id, ComponentName.PageHeader, { title, subtitle }, { actions });\n}\n\n/**\n * One of the four figures across the top of a dashboard - the composition Sakai's dashboard opens with,\n * and the one every template in the line has copied since.\n */\nexport function statCard(id: string, label: string, value: string, delta: string, icon: string): SceneElement {\n return card(id, [text(`${id}-label`, label), text(`${id}-value`, value), text(`${id}-delta`, delta)], { icon, variant: 'stat' });\n}\n\n/** A titled surface holding a widget's content. */\nexport function widget(id: string, title: string, content: SceneElement[]): SceneElement {\n return card(id, [text(`${id}-title`, title), ...content], { title });\n}\n\n/**\n * A table with real columns and real rows, so a list template looks like a list.\n *\n * The properties are the table's own vocabulary - `rows` for the records and `pageSize` to page them - so\n * a host with the real table loaded shows the rows rather than an empty grid. `emptyMessage` is what the\n * same table says once the rows are gone, which is how a preview shows a template's empty state.\n */\nexport function table(id: string, columns: { field: string; header: string }[], rows: Record<string, unknown>[], emptyMessage = 'Nothing to show yet'): SceneElement {\n return externalComponent(\n id,\n 'dataTable',\n { rows, dataKey: columns[0]?.field ?? 'id', emptyMessage, ...(rows.length > 8 ? { pageSize: 8 } : {}) },\n { columns: columns.map(column => externalComponent(`${id}-${column.field}`, 'column', { field: column.field, header: column.header, sortable: true })) },\n );\n}\n\n/**\n * One labeled input in a form template. The visible label is a separate text element, so the input carries\n * the same words as its accessible name - otherwise a screen reader announces an unnamed field.\n */\nexport function field(id: string, label: string, componentName: string, properties: Record<string, unknown> = {}): SceneElement {\n return panel(id, [text(`${id}-label`, label), externalComponent(`${id}-input`, componentName, { ariaLabel: label, ...properties })]);\n}\n\n/** A row of buttons closing a form. */\nexport function formActions(id: string, confirmLabel: string, cancelLabel = 'Cancel'): SceneElement {\n return panel(id, [button(`${id}-confirm`, confirmLabel, { severity: 'primary' }), button(`${id}-cancel`, cancelLabel, { severity: 'secondary' })]);\n}\n\n/** The empty state a list shows before anything exists - the designed one, never a build-time apology. */\nexport function emptyState(id: string, title: string, message: string, actionLabel: string): SceneElement {\n return card(id, [\n externalComponent(`${id}-icon`, 'image', { alt: title }),\n text(`${id}-title`, title),\n text(`${id}-message`, message),\n button(`${id}-action`, actionLabel, { severity: 'primary' }),\n ]);\n}\n"],"names":["pageHeader","id","title","subtitle","actions","externalComponent","ComponentName","PageHeader","statCard","label","value","delta","icon","card","text","variant","widget","content","table","columns","rows","emptyMessage","dataKey","field","length","pageSize","map","column","header","sortable","componentName","properties","panel","ariaLabel","formActions","confirmLabel","cancelLabel","button","severity","emptyState","message","actionLabel","alt"],"mappings":";;;AAAA;AACA;AAMA;;;;;;;AAOC,8FAGM,SAASA,UAAAA,CAAWC,EAAU,EAAEC,KAAa,EAAEC,QAAgB,EAAEC,OAAAA,GAA0B,EAAE,EAAA;AAChG,IAAA,OAAOC,iBAAAA,CAAkBJ,EAAAA,EAAIK,aAAAA,CAAcC,UAAU,EAAE;AAAEL,QAAAA,KAAAA;AAAOC,QAAAA;KAAS,EAAG;AAAEC,QAAAA;AAAQ,KAAA,CAAA;AAC1F;AAEA;;;IAIO,SAASI,QAAAA,CAASP,EAAU,EAAEQ,KAAa,EAAEC,KAAa,EAAEC,KAAa,EAAEC,IAAY,EAAA;AAC1F,IAAA,OAAOC,KAAKZ,EAAAA,EAAI;AAACa,QAAAA,IAAAA,CAAK,CAAA,EAAGb,EAAAA,CAAG,MAAM,CAAC,EAAEQ,KAAAA,CAAAA;AAAQK,QAAAA,IAAAA,CAAK,CAAA,EAAGb,EAAAA,CAAG,MAAM,CAAC,EAAES,KAAAA,CAAAA;AAAQI,QAAAA,IAAAA,CAAK,CAAA,EAAGb,EAAAA,CAAG,MAAM,CAAC,EAAEU,KAAAA;KAAO,EAAE;AAAEC,QAAAA,IAAAA;QAAMG,OAAAA,EAAS;AAAO,KAAA,CAAA;AAClI;AAEA,oDACO,SAASC,MAAAA,CAAOf,EAAU,EAAEC,KAAa,EAAEe,OAAuB,EAAA;AACrE,IAAA,OAAOJ,KAAKZ,EAAAA,EAAI;AAACa,QAAAA,IAAAA,CAAK,CAAA,EAAGb,EAAAA,CAAG,MAAM,CAAC,EAAEC,KAAAA,CAAAA;AAAWe,QAAAA,GAAAA;KAAQ,E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C,WAAAA,GAAc,QAAQ,EAAA;AAChF,IAAA,OAAOJ,MAAM/B,EAAAA,EAAI;AAACoC,QAAAA,MAAAA,CAAO,CAAA,EAAGpC,EAAAA,CAAG,QAAQ,CAAC,EAAEkC,YAAAA,EAAc;YAAEG,QAAAA,EAAU;AAAU,SAAA,CAAA;AAAID,QAAAA,MAAAA,CAAO,CAAA,EAAGpC,EAAAA,CAAG,OAAO,CAAC,EAAEmC,WAAAA,EAAa;YAAEE,QAAAA,EAAU;AAAY,SAAA;AAAG,KAAA,CAAA;AACrJ;AAEA,2GACO,SAASC,UAAAA,CAAWtC,EAAU,EAAEC,KAAa,EAAEsC,OAAe,EAAEC,WAAmB,EAAA;AACtF,IAAA,OAAO5B,KAAKZ,EAAAA,EAAI;AACZI,QAAAA,iBAAAA,CAAkB,CAAA,EAAGJ,EAAAA,CAAG,KAAK,CAAC,EAAE,OAAA,EAAS;YAAEyC,GAAAA,EAAKxC;AAAM,SAAA,CAAA;AACtDY,QAAAA,IAAAA,CAAK,CAAA,EAAGb,EAAAA,CAAG,MAAM,CAAC,EAAEC,KAAAA,CAAAA;AACpBY,QAAAA,IAAAA,CAAK,CAAA,EAAGb,EAAAA,CAAG,QAAQ,CAAC,EAAEuC,OAAAA,CAAAA;AACtBH,QAAAA,MAAAA,CAAO,CAAA,EAAGpC,EAAAA,CAAG,OAAO,CAAC,EAAEwC,WAAAA,EAAa;YAAEH,QAAAA,EAAU;AAAU,SAAA;AAC7D,KAAA,CAAA;AACL;;"}
|
|
@@ -2,6 +2,7 @@ import { ScreenTemplate } from '@cratis/scene.model';
|
|
|
2
2
|
export declare const dashboardTemplate: ScreenTemplate;
|
|
3
3
|
export declare const crudListTemplate: ScreenTemplate;
|
|
4
4
|
export declare const detailViewTemplate: ScreenTemplate;
|
|
5
|
+
export declare const masterDetailTemplate: ScreenTemplate;
|
|
5
6
|
export declare const formPageTemplate: ScreenTemplate;
|
|
6
7
|
export declare const emptyTemplate: ScreenTemplate;
|
|
7
8
|
export declare const workspaceTemplates: ScreenTemplate[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaceTemplates.d.ts","sourceRoot":"","sources":["../../../gallery/workspaceTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AA0BrE,eAAO,MAAM,iBAAiB,EAAE,cA+D/B,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,cAmC9B,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,cA4BhC,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,cAqB9B,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE,cAY3B,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"workspaceTemplates.d.ts","sourceRoot":"","sources":["../../../gallery/workspaceTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AA0BrE,eAAO,MAAM,iBAAiB,EAAE,cA+D/B,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,cAmC9B,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,cA4BhC,CAAC;AASF,eAAO,MAAM,oBAAoB,EAAE,cA6ClC,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,cAqB9B,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE,cAY3B,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,cAAc,EAAqH,CAAC"}
|