@cratis/scene.blueprint.default 4.41.0 → 4.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ComponentName.ts +9 -0
- package/defaultBlueprintComponents.ts +4 -1
- package/dist/cjs/ComponentName.js +3 -0
- package/dist/cjs/ComponentName.js.map +1 -1
- package/dist/cjs/defaultBlueprint.js +2 -0
- package/dist/cjs/defaultBlueprint.js.map +1 -1
- package/dist/cjs/defaultBlueprintComponentMetadata.js +2 -0
- package/dist/cjs/defaultBlueprintComponentMetadata.js.map +1 -1
- package/dist/cjs/defaultBlueprintComponents.js +8 -0
- package/dist/cjs/defaultBlueprintComponents.js.map +1 -1
- package/dist/cjs/foundation/ActionButton.js.map +1 -1
- package/dist/cjs/foundation/ActionButtonControl.js +46 -0
- package/dist/cjs/foundation/ActionButtonControl.js.map +1 -0
- package/dist/cjs/foundation/DialogFrame.js +196 -0
- package/dist/cjs/foundation/DialogFrame.js.map +1 -0
- package/dist/cjs/foundation/FormScreenBody.js +13 -3
- package/dist/cjs/foundation/FormScreenBody.js.map +1 -1
- package/dist/cjs/foundation/Notice.js +51 -0
- package/dist/cjs/foundation/Notice.js.map +1 -0
- package/dist/cjs/foundation/formModel.js +1 -0
- package/dist/cjs/foundation/formModel.js.map +1 -1
- package/dist/cjs/foundation/foundationComponentMetadata.js +22 -0
- package/dist/cjs/foundation/foundationComponentMetadata.js.map +1 -1
- package/dist/cjs/foundation/foundationDescriptors.js +89 -0
- package/dist/cjs/foundation/foundationDescriptors.js.map +1 -1
- package/dist/cjs/foundation/foundationSamples.js +29 -0
- package/dist/cjs/foundation/foundationSamples.js.map +1 -1
- package/dist/cjs/foundation/foundationStrings.js +3 -1
- package/dist/cjs/foundation/foundationStrings.js.map +1 -1
- package/dist/cjs/foundation/templates/dialogTemplates.js +254 -0
- package/dist/cjs/foundation/templates/dialogTemplates.js.map +1 -0
- package/dist/cjs/foundation/templates/index.js +18 -0
- package/dist/cjs/foundation/templates/index.js.map +1 -1
- package/dist/cjs/foundation/templates/stateScreenTemplates.js +252 -0
- package/dist/cjs/foundation/templates/stateScreenTemplates.js.map +1 -0
- package/dist/cjs/gallery/GalleryDialogPreview.js +62 -0
- package/dist/cjs/gallery/GalleryDialogPreview.js.map +1 -0
- package/dist/cjs/gallery/GalleryScreenPreview.js +2 -0
- package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -1
- package/dist/cjs/gallery/dialogTemplates.js +41 -36
- package/dist/cjs/gallery/dialogTemplates.js.map +1 -1
- package/dist/cjs/gallery/screens.js +4 -1
- package/dist/cjs/gallery/screens.js.map +1 -1
- package/dist/cjs/index.js +36 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/ComponentName.d.ts +3 -0
- package/dist/esm/ComponentName.d.ts.map +1 -1
- package/dist/esm/ComponentName.js +3 -0
- package/dist/esm/ComponentName.js.map +1 -1
- package/dist/esm/defaultBlueprint.js +2 -0
- package/dist/esm/defaultBlueprint.js.map +1 -1
- package/dist/esm/defaultBlueprintComponentMetadata.js +2 -0
- package/dist/esm/defaultBlueprintComponentMetadata.js.map +1 -1
- package/dist/esm/defaultBlueprintComponents.d.ts.map +1 -1
- package/dist/esm/defaultBlueprintComponents.js +8 -0
- package/dist/esm/defaultBlueprintComponents.js.map +1 -1
- package/dist/esm/foundation/ActionButton.d.ts +1 -1
- package/dist/esm/foundation/ActionButton.d.ts.map +1 -1
- package/dist/esm/foundation/ActionButton.js.map +1 -1
- package/dist/esm/foundation/ActionButtonControl.d.ts +3 -0
- package/dist/esm/foundation/ActionButtonControl.d.ts.map +1 -0
- package/dist/esm/foundation/ActionButtonControl.js +44 -0
- package/dist/esm/foundation/ActionButtonControl.js.map +1 -0
- package/dist/esm/foundation/DialogFrame.d.ts +14 -0
- package/dist/esm/foundation/DialogFrame.d.ts.map +1 -0
- package/dist/esm/foundation/DialogFrame.js +190 -0
- package/dist/esm/foundation/DialogFrame.js.map +1 -0
- package/dist/esm/foundation/FormScreenBody.d.ts.map +1 -1
- package/dist/esm/foundation/FormScreenBody.js +13 -3
- package/dist/esm/foundation/FormScreenBody.js.map +1 -1
- package/dist/esm/foundation/Notice.d.ts +3 -0
- package/dist/esm/foundation/Notice.d.ts.map +1 -0
- package/dist/esm/foundation/Notice.js +49 -0
- package/dist/esm/foundation/Notice.js.map +1 -0
- package/dist/esm/foundation/formModel.d.ts +2 -1
- package/dist/esm/foundation/formModel.d.ts.map +1 -1
- package/dist/esm/foundation/formModel.js +1 -0
- package/dist/esm/foundation/formModel.js.map +1 -1
- package/dist/esm/foundation/foundationComponentMetadata.d.ts.map +1 -1
- package/dist/esm/foundation/foundationComponentMetadata.js +22 -0
- package/dist/esm/foundation/foundationComponentMetadata.js.map +1 -1
- package/dist/esm/foundation/foundationDescriptors.d.ts.map +1 -1
- package/dist/esm/foundation/foundationDescriptors.js +89 -0
- package/dist/esm/foundation/foundationDescriptors.js.map +1 -1
- package/dist/esm/foundation/foundationSamples.d.ts.map +1 -1
- package/dist/esm/foundation/foundationSamples.js +29 -0
- package/dist/esm/foundation/foundationSamples.js.map +1 -1
- package/dist/esm/foundation/foundationStrings.d.ts +2 -0
- package/dist/esm/foundation/foundationStrings.d.ts.map +1 -1
- package/dist/esm/foundation/foundationStrings.js +3 -1
- package/dist/esm/foundation/foundationStrings.js.map +1 -1
- package/dist/esm/foundation/index.d.ts +3 -0
- package/dist/esm/foundation/index.d.ts.map +1 -1
- package/dist/esm/foundation/index.js +3 -0
- package/dist/esm/foundation/index.js.map +1 -1
- package/dist/esm/foundation/templates/dialogTemplates.d.ts +20 -0
- package/dist/esm/foundation/templates/dialogTemplates.d.ts.map +1 -0
- package/dist/esm/foundation/templates/dialogTemplates.js +243 -0
- package/dist/esm/foundation/templates/dialogTemplates.js.map +1 -0
- package/dist/esm/foundation/templates/index.d.ts +2 -0
- package/dist/esm/foundation/templates/index.d.ts.map +1 -1
- package/dist/esm/foundation/templates/index.js +2 -0
- package/dist/esm/foundation/templates/index.js.map +1 -1
- package/dist/esm/foundation/templates/stateScreenTemplates.d.ts +8 -0
- package/dist/esm/foundation/templates/stateScreenTemplates.d.ts.map +1 -0
- package/dist/esm/foundation/templates/stateScreenTemplates.js +245 -0
- package/dist/esm/foundation/templates/stateScreenTemplates.js.map +1 -0
- package/dist/esm/gallery/FoundationDialogs.stories.d.ts +35 -0
- package/dist/esm/gallery/FoundationDialogs.stories.d.ts.map +1 -0
- package/dist/esm/gallery/FoundationDialogs.stories.js +38 -0
- package/dist/esm/gallery/FoundationDialogs.stories.js.map +1 -0
- package/dist/esm/gallery/GalleryDialogPreview.d.ts +17 -0
- package/dist/esm/gallery/GalleryDialogPreview.d.ts.map +1 -0
- package/dist/esm/gallery/GalleryDialogPreview.js +59 -0
- package/dist/esm/gallery/GalleryDialogPreview.js.map +1 -0
- package/dist/esm/gallery/GalleryScreenPreview.js +2 -0
- package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -1
- package/dist/esm/gallery/dialogTemplates.d.ts.map +1 -1
- package/dist/esm/gallery/dialogTemplates.js +42 -37
- package/dist/esm/gallery/dialogTemplates.js.map +1 -1
- package/dist/esm/gallery/index.d.ts +1 -0
- package/dist/esm/gallery/index.d.ts.map +1 -1
- package/dist/esm/gallery/index.js +1 -0
- package/dist/esm/gallery/index.js.map +1 -1
- package/dist/esm/gallery/screens.d.ts.map +1 -1
- package/dist/esm/gallery/screens.js +4 -1
- package/dist/esm/gallery/screens.js.map +1 -1
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/foundation/ActionButton.tsx +1 -1
- package/foundation/ActionButtonControl.tsx +37 -0
- package/foundation/DialogFrame.tsx +138 -0
- package/foundation/FormScreenBody.tsx +6 -3
- package/foundation/Notice.tsx +33 -0
- package/foundation/formModel.ts +1 -0
- package/foundation/foundationComponentMetadata.ts +3 -0
- package/foundation/foundationDescriptors.ts +41 -0
- package/foundation/foundationSamples.ts +3 -0
- package/foundation/foundationStrings.ts +2 -0
- package/foundation/index.ts +3 -0
- package/foundation/templates/dialogTemplates.ts +114 -0
- package/foundation/templates/index.ts +2 -0
- package/foundation/templates/stateScreenTemplates.ts +107 -0
- package/gallery/FoundationDialogs.stories.tsx +74 -0
- package/gallery/GalleryDialogPreview.tsx +68 -0
- package/gallery/dialogTemplates.ts +22 -17
- package/gallery/index.ts +1 -0
- package/gallery/screens.ts +3 -2
- package/package.json +8 -8
- package/sampleData/foundation-en.json +149 -0
- package/shell/layout.css +219 -0
- package/thumbnails/ConfirmDialog.svg +12 -0
- package/thumbnails/DetailDialog.svg +11 -0
- package/thumbnails/ErrorScreen.svg +11 -0
- package/thumbnails/FilterDialog.svg +16 -0
- package/thumbnails/ForbiddenScreen.svg +10 -0
- package/thumbnails/FormDialog.svg +12 -0
- package/thumbnails/LoginScreen.svg +12 -0
- package/thumbnails/LookupDialog.svg +13 -0
- package/thumbnails/NotFoundScreen.svg +9 -0
- package/thumbnails/QuickCreateDialog.svg +12 -0
- package/thumbnails/SideSheet.svg +13 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { panel, externalComponent } from '../../gallery/elements.js';
|
|
2
|
+
import { actionButton } from './dialogTemplates.js';
|
|
3
|
+
import { column, slotLeaf } from '../../layouts/flowBuilders.js';
|
|
4
|
+
import { component, fromQuery, foundationTemplateProvenance, thumbnailOf } from './templateParts.js';
|
|
5
|
+
|
|
6
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
7
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
8
|
+
const metadataOf = (name, type)=>({
|
|
9
|
+
...foundationTemplateProvenance,
|
|
10
|
+
type,
|
|
11
|
+
category: `Foundation / ${type}`,
|
|
12
|
+
thumbnail: thumbnailOf(name)
|
|
13
|
+
});
|
|
14
|
+
/** The way back every state screen offers: home, which is always somewhere the person is allowed to be. */ const backToDashboard = (id)=>actionButton(id, {
|
|
15
|
+
label: 'Back to the dashboard',
|
|
16
|
+
emphasis: 'secondary',
|
|
17
|
+
targetScreen: 'DashboardScreen'
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* The sign-in screen: the logo, the sign-in form, a slot for the identity providers the application offers (`providers` - buttons, each starting its
|
|
21
|
+
* provider's flow, which the application fills), an error area that is a live region and says why a sign-in failed, and a link to help. The form is
|
|
22
|
+
* made of the foundation's form components, so it validates and announces like every other form.
|
|
23
|
+
*/ const loginScreenTemplate = {
|
|
24
|
+
name: 'LoginScreen',
|
|
25
|
+
fitsSlot: 'content',
|
|
26
|
+
slots: [
|
|
27
|
+
{
|
|
28
|
+
name: 'logo'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'error'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'form'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'providers'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'help'
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
arrangement: {
|
|
44
|
+
root: column([
|
|
45
|
+
slotLeaf('logo'),
|
|
46
|
+
slotLeaf('error'),
|
|
47
|
+
slotLeaf('form'),
|
|
48
|
+
slotLeaf('providers'),
|
|
49
|
+
slotLeaf('help')
|
|
50
|
+
], 16)
|
|
51
|
+
},
|
|
52
|
+
content: {
|
|
53
|
+
logo: [
|
|
54
|
+
externalComponent('login-logo', 'logo', {
|
|
55
|
+
label: 'Contoso',
|
|
56
|
+
initials: 'C'
|
|
57
|
+
})
|
|
58
|
+
],
|
|
59
|
+
error: [
|
|
60
|
+
component('login-error', 'notice', {
|
|
61
|
+
text: fromQuery('SignInError', '0.message'),
|
|
62
|
+
tone: 'danger'
|
|
63
|
+
})
|
|
64
|
+
],
|
|
65
|
+
form: [
|
|
66
|
+
component('login-form', 'formScreenBody', {
|
|
67
|
+
mode: 'create',
|
|
68
|
+
saveAndNew: false,
|
|
69
|
+
strings: {
|
|
70
|
+
formSave: 'Sign in',
|
|
71
|
+
formCancel: 'Clear'
|
|
72
|
+
},
|
|
73
|
+
sections: fromQuery('SignInSections'),
|
|
74
|
+
values: fromQuery('SignInValues', '0'),
|
|
75
|
+
errors: fromQuery('FormErrors', '0')
|
|
76
|
+
})
|
|
77
|
+
],
|
|
78
|
+
providers: [
|
|
79
|
+
panel('login-providers', [
|
|
80
|
+
actionButton('login-microsoft', {
|
|
81
|
+
label: 'Continue with Microsoft',
|
|
82
|
+
emphasis: 'secondary'
|
|
83
|
+
}),
|
|
84
|
+
actionButton('login-github', {
|
|
85
|
+
label: 'Continue with GitHub',
|
|
86
|
+
emphasis: 'secondary'
|
|
87
|
+
})
|
|
88
|
+
])
|
|
89
|
+
],
|
|
90
|
+
help: [
|
|
91
|
+
actionButton('login-help', {
|
|
92
|
+
label: 'Need help signing in?',
|
|
93
|
+
emphasis: 'quiet',
|
|
94
|
+
targetScreen: 'ForbiddenScreen'
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
displayName: 'Sign in',
|
|
99
|
+
description: 'A sign-in form with a slot for identity providers, an error area and a help link.',
|
|
100
|
+
metadata: metadataOf('LoginScreen', 'Auth')
|
|
101
|
+
};
|
|
102
|
+
/** The wrong address: what happened in words, a search, and the way home. */ const notFoundScreenTemplate = {
|
|
103
|
+
name: 'NotFoundScreen',
|
|
104
|
+
fitsSlot: 'content',
|
|
105
|
+
slots: [
|
|
106
|
+
{
|
|
107
|
+
name: 'message'
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'search'
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'actions'
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
arrangement: {
|
|
117
|
+
root: column([
|
|
118
|
+
slotLeaf('message'),
|
|
119
|
+
slotLeaf('search'),
|
|
120
|
+
slotLeaf('actions')
|
|
121
|
+
], 16)
|
|
122
|
+
},
|
|
123
|
+
content: {
|
|
124
|
+
message: [
|
|
125
|
+
component('not-found-message', 'emptyState', {
|
|
126
|
+
icon: 'file',
|
|
127
|
+
headline: 'That page is not here',
|
|
128
|
+
hint: 'The link may be old, or the thing it pointed at may have been removed.'
|
|
129
|
+
})
|
|
130
|
+
],
|
|
131
|
+
search: [
|
|
132
|
+
component('not-found-search', 'globalSearch', {
|
|
133
|
+
label: 'Search the application',
|
|
134
|
+
placeholder: 'Search instead'
|
|
135
|
+
})
|
|
136
|
+
],
|
|
137
|
+
actions: [
|
|
138
|
+
backToDashboard('not-found-home')
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
displayName: 'Not found',
|
|
142
|
+
description: 'A wrong address explained, with a search and a link home.',
|
|
143
|
+
metadata: metadataOf('NotFoundScreen', 'State')
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* The refusal: signed in, and still not allowed. It says so and offers to ask for access, and it shows nothing of what was refused - the template binds
|
|
147
|
+
* no data at all, so there is nothing to leak.
|
|
148
|
+
*/ const forbiddenScreenTemplate = {
|
|
149
|
+
name: 'ForbiddenScreen',
|
|
150
|
+
fitsSlot: 'content',
|
|
151
|
+
slots: [
|
|
152
|
+
{
|
|
153
|
+
name: 'message'
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: 'actions'
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
arrangement: {
|
|
160
|
+
root: column([
|
|
161
|
+
slotLeaf('message'),
|
|
162
|
+
slotLeaf('actions')
|
|
163
|
+
], 16)
|
|
164
|
+
},
|
|
165
|
+
content: {
|
|
166
|
+
message: [
|
|
167
|
+
component('forbidden-message', 'emptyState', {
|
|
168
|
+
icon: 'lock',
|
|
169
|
+
headline: 'You do not have access to this',
|
|
170
|
+
hint: 'Your account is signed in, but it is not allowed here. An administrator can change that.',
|
|
171
|
+
actionLabel: 'Request access'
|
|
172
|
+
})
|
|
173
|
+
],
|
|
174
|
+
actions: [
|
|
175
|
+
backToDashboard('forbidden-home')
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
displayName: 'Forbidden',
|
|
179
|
+
description: 'A refusal that offers to request access and shows none of what was refused.',
|
|
180
|
+
metadata: metadataOf('ForbiddenScreen', 'State')
|
|
181
|
+
};
|
|
182
|
+
/** The failure on our side: a plain message, a retry, and the support reference id a person can quote. */ const errorScreenTemplate = {
|
|
183
|
+
name: 'ErrorScreen',
|
|
184
|
+
fitsSlot: 'content',
|
|
185
|
+
slots: [
|
|
186
|
+
{
|
|
187
|
+
name: 'message'
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: 'reference'
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: 'actions'
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
arrangement: {
|
|
197
|
+
root: column([
|
|
198
|
+
slotLeaf('message'),
|
|
199
|
+
slotLeaf('reference'),
|
|
200
|
+
slotLeaf('actions')
|
|
201
|
+
], 16)
|
|
202
|
+
},
|
|
203
|
+
content: {
|
|
204
|
+
message: [
|
|
205
|
+
component('error-message', 'emptyState', {
|
|
206
|
+
icon: 'alert',
|
|
207
|
+
headline: 'Something went wrong on our side',
|
|
208
|
+
hint: 'The team has been told. Nothing you were working on was lost.',
|
|
209
|
+
actionLabel: 'Try again'
|
|
210
|
+
})
|
|
211
|
+
],
|
|
212
|
+
reference: [
|
|
213
|
+
panel('error-reference', [
|
|
214
|
+
externalComponent('error-reference-label', 'text', {
|
|
215
|
+
text: 'Support reference'
|
|
216
|
+
}),
|
|
217
|
+
externalComponent('error-reference-id', 'text', {
|
|
218
|
+
text: fromQuery('SupportReference', '0.id')
|
|
219
|
+
})
|
|
220
|
+
])
|
|
221
|
+
],
|
|
222
|
+
actions: [
|
|
223
|
+
backToDashboard('error-home')
|
|
224
|
+
]
|
|
225
|
+
},
|
|
226
|
+
displayName: 'Error',
|
|
227
|
+
description: 'A generic failure with a retry and the support reference id to quote.',
|
|
228
|
+
metadata: metadataOf('ErrorScreen', 'State')
|
|
229
|
+
};
|
|
230
|
+
/** The four auth and state screens of Part B 2.11. The legacy `Login`, `NotFound`, `AccessDenied` and `Error` remain as they were. */ const stateScreenTemplates = [
|
|
231
|
+
loginScreenTemplate,
|
|
232
|
+
notFoundScreenTemplate,
|
|
233
|
+
forbiddenScreenTemplate,
|
|
234
|
+
errorScreenTemplate
|
|
235
|
+
];
|
|
236
|
+
/** The earlier template each spec-named one stands beside: the old name keeps working, and is the alias of the new. */ const foundationTemplateAliases = {
|
|
237
|
+
LoginScreen: 'Login',
|
|
238
|
+
NotFoundScreen: 'NotFound',
|
|
239
|
+
ForbiddenScreen: 'AccessDenied',
|
|
240
|
+
ErrorScreen: 'Error',
|
|
241
|
+
QuickCreateDialog: 'FormDialog'
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export { errorScreenTemplate, forbiddenScreenTemplate, foundationTemplateAliases, loginScreenTemplate, notFoundScreenTemplate, stateScreenTemplates };
|
|
245
|
+
//# sourceMappingURL=stateScreenTemplates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stateScreenTemplates.js","sources":["../../../../foundation/templates/stateScreenTemplates.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, TemplateMetadata } from '@cratis/scene.model';\nimport { externalComponent, panel } from '../../gallery/elements';\nimport { actionButton } from './dialogTemplates';\nimport { column, slotLeaf } from '../../layouts/flowBuilders';\nimport { component, foundationTemplateProvenance, fromQuery, thumbnailOf } from './templateParts';\n\nconst metadataOf = (name: string, type: 'Auth' | 'State'): TemplateMetadata => ({ ...foundationTemplateProvenance, type, category: `Foundation / ${type}`, thumbnail: thumbnailOf(name) });\n\n/** The way back every state screen offers: home, which is always somewhere the person is allowed to be. */\nconst backToDashboard = (id: string) => actionButton(id, { label: 'Back to the dashboard', emphasis: 'secondary', targetScreen: 'DashboardScreen' });\n\n/**\n * The sign-in screen: the logo, the sign-in form, a slot for the identity providers the application offers (`providers` - buttons, each starting its\n * provider's flow, which the application fills), an error area that is a live region and says why a sign-in failed, and a link to help. The form is\n * made of the foundation's form components, so it validates and announces like every other form.\n */\nexport const loginScreenTemplate: ScreenTemplate = {\n name: 'LoginScreen',\n fitsSlot: 'content',\n slots: [{ name: 'logo' }, { name: 'error' }, { name: 'form' }, { name: 'providers' }, { name: 'help' }],\n arrangement: { root: column([slotLeaf('logo'), slotLeaf('error'), slotLeaf('form'), slotLeaf('providers'), slotLeaf('help')], 16) },\n content: {\n logo: [externalComponent('login-logo', 'logo', { label: 'Contoso', initials: 'C' })],\n error: [component('login-error', 'notice', { text: fromQuery('SignInError', '0.message'), tone: 'danger' })],\n form: [component('login-form', 'formScreenBody', {\n mode: 'create', saveAndNew: false, strings: { formSave: 'Sign in', formCancel: 'Clear' },\n sections: fromQuery('SignInSections'), values: fromQuery('SignInValues', '0'), errors: fromQuery('FormErrors', '0'),\n })],\n providers: [panel('login-providers', [actionButton('login-microsoft', { label: 'Continue with Microsoft', emphasis: 'secondary' }), actionButton('login-github', { label: 'Continue with GitHub', emphasis: 'secondary' })])],\n help: [actionButton('login-help', { label: 'Need help signing in?', emphasis: 'quiet', targetScreen: 'ForbiddenScreen' })],\n },\n displayName: 'Sign in',\n description: 'A sign-in form with a slot for identity providers, an error area and a help link.',\n metadata: metadataOf('LoginScreen', 'Auth'),\n};\n\n/** The wrong address: what happened in words, a search, and the way home. */\nexport const notFoundScreenTemplate: ScreenTemplate = {\n name: 'NotFoundScreen',\n fitsSlot: 'content',\n slots: [{ name: 'message' }, { name: 'search' }, { name: 'actions' }],\n arrangement: { root: column([slotLeaf('message'), slotLeaf('search'), slotLeaf('actions')], 16) },\n content: {\n message: [component('not-found-message', 'emptyState', { icon: 'file', headline: 'That page is not here', hint: 'The link may be old, or the thing it pointed at may have been removed.' })],\n search: [component('not-found-search', 'globalSearch', { label: 'Search the application', placeholder: 'Search instead' })],\n actions: [backToDashboard('not-found-home')],\n },\n displayName: 'Not found',\n description: 'A wrong address explained, with a search and a link home.',\n metadata: metadataOf('NotFoundScreen', 'State'),\n};\n\n/**\n * The refusal: signed in, and still not allowed. It says so and offers to ask for access, and it shows nothing of what was refused - the template binds\n * no data at all, so there is nothing to leak.\n */\nexport const forbiddenScreenTemplate: ScreenTemplate = {\n name: 'ForbiddenScreen',\n fitsSlot: 'content',\n slots: [{ name: 'message' }, { name: 'actions' }],\n arrangement: { root: column([slotLeaf('message'), slotLeaf('actions')], 16) },\n content: {\n message: [component('forbidden-message', 'emptyState', {\n icon: 'lock', headline: 'You do not have access to this', hint: 'Your account is signed in, but it is not allowed here. An administrator can change that.', actionLabel: 'Request access',\n })],\n actions: [backToDashboard('forbidden-home')],\n },\n displayName: 'Forbidden',\n description: 'A refusal that offers to request access and shows none of what was refused.',\n metadata: metadataOf('ForbiddenScreen', 'State'),\n};\n\n/** The failure on our side: a plain message, a retry, and the support reference id a person can quote. */\nexport const errorScreenTemplate: ScreenTemplate = {\n name: 'ErrorScreen',\n fitsSlot: 'content',\n slots: [{ name: 'message' }, { name: 'reference' }, { name: 'actions' }],\n arrangement: { root: column([slotLeaf('message'), slotLeaf('reference'), slotLeaf('actions')], 16) },\n content: {\n message: [component('error-message', 'emptyState', {\n icon: 'alert', headline: 'Something went wrong on our side', hint: 'The team has been told. Nothing you were working on was lost.', actionLabel: 'Try again',\n })],\n reference: [panel('error-reference', [\n externalComponent('error-reference-label', 'text', { text: 'Support reference' }),\n externalComponent('error-reference-id', 'text', { text: fromQuery('SupportReference', '0.id') }),\n ])],\n actions: [backToDashboard('error-home')],\n },\n displayName: 'Error',\n description: 'A generic failure with a retry and the support reference id to quote.',\n metadata: metadataOf('ErrorScreen', 'State'),\n};\n\n/** The four auth and state screens of Part B 2.11. The legacy `Login`, `NotFound`, `AccessDenied` and `Error` remain as they were. */\nexport const stateScreenTemplates: ScreenTemplate[] = [loginScreenTemplate, notFoundScreenTemplate, forbiddenScreenTemplate, errorScreenTemplate];\n\n/** The earlier template each spec-named one stands beside: the old name keeps working, and is the alias of the new. */\nexport const foundationTemplateAliases: Record<string, string> = {\n LoginScreen: 'Login',\n NotFoundScreen: 'NotFound',\n ForbiddenScreen: 'AccessDenied',\n ErrorScreen: 'Error',\n QuickCreateDialog: 'FormDialog',\n};\n"],"names":["metadataOf","name","type","foundationTemplateProvenance","category","thumbnail","thumbnailOf","backToDashboard","id","actionButton","label","emphasis","targetScreen","loginScreenTemplate","fitsSlot","slots","arrangement","root","column","slotLeaf","content","logo","externalComponent","initials","error","component","text","fromQuery","tone","form","mode","saveAndNew","strings","formSave","formCancel","sections","values","errors","providers","panel","help","displayName","description","metadata","notFoundScreenTemplate","message","icon","headline","hint","search","placeholder","actions","forbiddenScreenTemplate","actionLabel","errorScreenTemplate","reference","stateScreenTemplates","foundationTemplateAliases","LoginScreen","NotFoundScreen","ForbiddenScreen","ErrorScreen","QuickCreateDialog"],"mappings":";;;;;AAAA;AACA;AAQA,MAAMA,UAAAA,GAAa,CAACC,IAAAA,EAAcC,IAAAA,IAA8C;AAAE,QAAA,GAAGC,4BAA4B;AAAED,QAAAA,IAAAA;QAAME,QAAAA,EAAU,CAAC,aAAa,EAAEF,IAAAA,CAAAA,CAAM;AAAEG,QAAAA,SAAAA,EAAWC,WAAAA,CAAYL,IAAAA;KAAM,CAAA;AAExL,4GACA,MAAMM,eAAAA,GAAkB,CAACC,EAAAA,GAAeC,aAAaD,EAAAA,EAAI;QAAEE,KAAAA,EAAO,uBAAA;QAAyBC,QAAAA,EAAU,WAAA;QAAaC,YAAAA,EAAc;AAAkB,KAAA,CAAA;AAElJ;;;;UAKaC,mBAAAA,GAAsC;IAC/CZ,IAAAA,EAAM,aAAA;IACNa,QAAAA,EAAU,SAAA;IACVC,KAAAA,EAAO;AAAC,QAAA;YAAEd,IAAAA,EAAM;AAAO,SAAA;AAAG,QAAA;YAAEA,IAAAA,EAAM;AAAQ,SAAA;AAAG,QAAA;YAAEA,IAAAA,EAAM;AAAO,SAAA;AAAG,QAAA;YAAEA,I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.model';
|
|
3
|
+
import { GalleryDialogPreview } from './GalleryDialogPreview';
|
|
4
|
+
import { GalleryScreenPreview } from './GalleryScreenPreview';
|
|
5
|
+
declare const loadPack: () => Promise<{
|
|
6
|
+
pack: SampleDataPack;
|
|
7
|
+
}>;
|
|
8
|
+
declare const meta: {
|
|
9
|
+
title: string;
|
|
10
|
+
component: typeof GalleryDialogPreview;
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: string;
|
|
13
|
+
};
|
|
14
|
+
loaders: (typeof loadPack)[];
|
|
15
|
+
render: (args: import("./GalleryDialogPreview").GalleryDialogPreviewProps, { loaded }: import("storybook/internal/csf").StoryContext<import("@storybook/react").ReactRenderer, import("./GalleryDialogPreview").GalleryDialogPreviewProps>) => import("react").JSX.Element;
|
|
16
|
+
args: {
|
|
17
|
+
registry: import("@cratis/scene.react").ComponentRegistry;
|
|
18
|
+
dialogName: string;
|
|
19
|
+
};
|
|
20
|
+
tags: string[];
|
|
21
|
+
};
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof meta>;
|
|
24
|
+
export declare const Confirm: Story;
|
|
25
|
+
export declare const QuickCreate: Story;
|
|
26
|
+
export declare const Lookup: Story;
|
|
27
|
+
export declare const LookupEmpty: Story;
|
|
28
|
+
export declare const LookupLoading: Story;
|
|
29
|
+
export declare const LookupError: Story;
|
|
30
|
+
export declare const LookupNoPermission: Story;
|
|
31
|
+
export declare const LookupPartial: Story;
|
|
32
|
+
export declare const SideSheet: Story;
|
|
33
|
+
export declare const Filter: Story;
|
|
34
|
+
export declare const StateScreens: StoryObj<typeof GalleryScreenPreview>;
|
|
35
|
+
//# sourceMappingURL=FoundationDialogs.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FoundationDialogs.stories.d.ts","sourceRoot":"","sources":["../../../gallery/FoundationDialogs.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAM9D,QAAA,MAAM,QAAQ;UAA+D,cAAc;EAAG,CAAC;AAO/F,QAAA,MAAM,IAAI;;;;QAGQ,MAAM;;;;;;;;;CAKqB,CAAC;eAE/B,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAGjC,eAAO,MAAM,WAAW,EAAE,KAAqD,CAAC;AAGhF,eAAO,MAAM,MAAM,EAAE,KAAgD,CAAC;AAGtE,eAAO,MAAM,WAAW,EAAE,KAAmF,CAAC;AAG9G,eAAO,MAAM,aAAa,EAAE,KAA+F,CAAC;AAG5H,eAAO,MAAM,WAAW,EAAE,KAAiI,CAAC;AAG5J,eAAO,MAAM,kBAAkB,EAAE,KAAuI,CAAC;AAGzK,eAAO,MAAM,aAAa,EAAE,KAA4H,CAAC;AAGzJ,eAAO,MAAM,SAAS,EAAE,KAA6C,CAAC;AAGtE,eAAO,MAAM,MAAM,EAAE,KAAgD,CAAC;AAGtE,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,OAAO,oBAAoB,CAK9D,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { corePackage, mergePackageRegistries } from '@cratis/scene.react';
|
|
3
|
+
import { primeReactPackage } from '@cratis/scene.primereact';
|
|
4
|
+
import { defaultBlueprint } from '../defaultBlueprint';
|
|
5
|
+
import { ComponentState } from '../foundation';
|
|
6
|
+
import { GalleryDialogPreview } from './GalleryDialogPreview';
|
|
7
|
+
import { GalleryScreenPreview } from './GalleryScreenPreview';
|
|
8
|
+
import { TemplatePreviewState } from './TemplatePreviewState';
|
|
9
|
+
const registry = mergePackageRegistries([corePackage, primeReactPackage, defaultBlueprint]);
|
|
10
|
+
const packUrl = new URL('../sampleData/foundation-en.json', import.meta.url).href;
|
|
11
|
+
const loadPack = async () => ({ pack: await (await fetch(packUrl)).json() });
|
|
12
|
+
const meta = {
|
|
13
|
+
title: 'Blueprint/Foundation dialogs',
|
|
14
|
+
component: GalleryDialogPreview,
|
|
15
|
+
parameters: { layout: 'fullscreen' },
|
|
16
|
+
loaders: [loadPack],
|
|
17
|
+
render: (args, { loaded }) => _jsx(GalleryDialogPreview, { ...args, pack: loaded.pack }),
|
|
18
|
+
args: { registry, dialogName: 'ConfirmDialog' },
|
|
19
|
+
tags: ['autodocs'],
|
|
20
|
+
};
|
|
21
|
+
export default meta;
|
|
22
|
+
export const Confirm = {};
|
|
23
|
+
export const QuickCreate = { args: { dialogName: 'QuickCreateDialog' } };
|
|
24
|
+
export const Lookup = { args: { dialogName: 'LookupDialog' } };
|
|
25
|
+
export const LookupEmpty = { args: { dialogName: 'LookupDialog', state: TemplatePreviewState.Empty } };
|
|
26
|
+
export const LookupLoading = { args: { dialogName: 'LookupDialog', forceState: { state: ComponentState.Loading } } };
|
|
27
|
+
export const LookupError = { args: { dialogName: 'LookupDialog', forceState: { state: ComponentState.Error, error: 'The server did not answer' } } };
|
|
28
|
+
export const LookupNoPermission = { args: { dialogName: 'LookupDialog', forceState: { state: ComponentState.NoPermission, permissionSubject: 'the accounts' } } };
|
|
29
|
+
export const LookupPartial = { args: { dialogName: 'LookupDialog', forceState: { state: ComponentState.Partial, failedRegions: ['Accounts'] } } };
|
|
30
|
+
export const SideSheet = { args: { dialogName: 'SideSheet' } };
|
|
31
|
+
export const Filter = { args: { dialogName: 'FilterDialog' } };
|
|
32
|
+
export const StateScreens = {
|
|
33
|
+
loaders: [loadPack],
|
|
34
|
+
render: (args, { loaded }) => _jsx(GalleryScreenPreview, { ...args, registry: registry, pack: loaded.pack }),
|
|
35
|
+
args: { screenName: 'LoginScreen' },
|
|
36
|
+
argTypes: { screenName: { control: 'select', options: ['LoginScreen', 'NotFoundScreen', 'ForbiddenScreen', 'ErrorScreen'] } },
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=FoundationDialogs.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FoundationDialogs.stories.js","sourceRoot":"","sources":["../../../gallery/FoundationDialogs.stories.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,QAAQ,GAAG,sBAAsB,CAAC,CAAC,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAE5F,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,kCAAkC,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;AAClF,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAoB,EAAE,CAAC,CAAC;AAO/F,MAAM,IAAI,GAAG;IACT,KAAK,EAAE,8BAA8B;IACrC,SAAS,EAAE,oBAAoB;IAC/B,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE;IACpC,OAAO,EAAE,CAAC,QAAQ,CAAC;IACnB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE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,UAAU,EAAE,EAAE,KAAK,EAAE,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,EAAE,CAAC;AAGzJ,MAAM,CAAC,MAAM,SAAS,GAAU,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,CAAC;AAGtE,MAAM,CAAC,MAAM,MAAM,GAAU,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,CAAC;AAGtE,MAAM,CAAC,MAAM,YAAY,GAA0C;IAC/D,OAAO,EAAE,CAAC,QAAQ,CAAC;IACnB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAC,oBAAoB,OAAK,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAsB,GAAI;IACzH,IAAI,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE;IACnC,QAAQ,EAAE,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,aAAa,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,CAAC,EAAE,EAAE;CAChI,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DialogTemplate, SampleDataPack, Theme } from '@cratis/scene.model';
|
|
2
|
+
import { ComponentRegistry } from '@cratis/scene.react';
|
|
3
|
+
import { LayoutConfigState } from '../configuration';
|
|
4
|
+
import { ForcedComponentState } from './GalleryScreenPreview';
|
|
5
|
+
import { TemplatePreviewState } from './TemplatePreviewState';
|
|
6
|
+
export declare const galleryDialogTemplate: (name: string) => DialogTemplate | undefined;
|
|
7
|
+
export interface GalleryDialogPreviewProps {
|
|
8
|
+
dialogName: string;
|
|
9
|
+
initialConfig?: Partial<LayoutConfigState>;
|
|
10
|
+
themes?: Theme[];
|
|
11
|
+
registry?: ComponentRegistry;
|
|
12
|
+
state?: TemplatePreviewState;
|
|
13
|
+
pack?: SampleDataPack;
|
|
14
|
+
forceState?: ForcedComponentState;
|
|
15
|
+
}
|
|
16
|
+
export declare function GalleryDialogPreview({ dialogName, initialConfig, themes, registry, state, pack, forceState }: GalleryDialogPreviewProps): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=GalleryDialogPreview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GalleryDialogPreview.d.ts","sourceRoot":"","sources":["../../../gallery/GalleryDialogPreview.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAoB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAwB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAI3E,OAAO,EAAE,oBAAoB,EAA+D,MAAM,wBAAwB,CAAC;AAI3H,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,eAAO,MAAM,qBAAqB,SAAU,MAAM,KAAG,cAAc,GAAG,SAA4E,CAAC;AAEnJ,MAAM,WAAW,yBAAyB;IAEtC,UAAU,EAAE,MAAM,CAAC;IAGnB,aAAa,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAG3C,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IAGjB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAG7B,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAG7B,IAAI,CAAC,EAAE,cAAc,CAAC;IAGtB,UAAU,CAAC,EAAE,oBAAoB,CAAC;CACrC;AAOD,wBAAgB,oBAAoB,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,MAA+B,EAAE,QAAiC,EAAE,KAAsC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,yBAAyB,+BAoB1N"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { SceneElementView } from '@cratis/scene.react';
|
|
4
|
+
import { LayoutConfigProvider } from '../configuration/LayoutConfigProvider.js';
|
|
5
|
+
import { previewTemplateComponent, previewComponents } from '../preview-host/PreviewTemplate.js';
|
|
6
|
+
import { defaultBlueprintThemes } from '../themes/defaultBlueprintThemes.js';
|
|
7
|
+
import { LayoutThemeProvider } from '../themes/LayoutThemeProvider.js';
|
|
8
|
+
import { externalComponent } from './elements.js';
|
|
9
|
+
import { forceComponentState, galleryPreviewRegistry, queryResultsOf } from './GalleryScreenPreview.js';
|
|
10
|
+
import { galleryDialogTemplates } from './dialogTemplates.js';
|
|
11
|
+
import { galleryComponentCatalog, galleryPreviewProfile } from './previewProfile.js';
|
|
12
|
+
import { resolveElementComponentNames } from './resolveElementNames.js';
|
|
13
|
+
import { TemplatePreviewState } from './TemplatePreviewState.js';
|
|
14
|
+
|
|
15
|
+
/** One gallery dialog template by name, for a story or a host that opens a specific one. */ const galleryDialogTemplate = (name)=>galleryDialogTemplates.find((template)=>template.name === name);
|
|
16
|
+
/**
|
|
17
|
+
* Opens one gallery dialog template the way a host does: inside a `role="dialog" aria-modal="true"` element, with the template's content in the wrapper
|
|
18
|
+
* a screen's template gets. Nothing here is a preview-only path - the dialog is a real {@link DialogTemplate} rendered by the real `SceneElementView`,
|
|
19
|
+
* and the dialog's own frame gives the host element its focus handling, placement and labelling exactly as it does in an application.
|
|
20
|
+
*/ function GalleryDialogPreview({ dialogName, initialConfig, themes = defaultBlueprintThemes, registry = galleryPreviewRegistry, state = TemplatePreviewState.Populated, pack, forceState }) {
|
|
21
|
+
const template = galleryDialogTemplate(dialogName);
|
|
22
|
+
if (!template) throw new Error(`The gallery has no dialog template named '${dialogName}'.`);
|
|
23
|
+
const element = useMemo(()=>{
|
|
24
|
+
const composed = externalComponent(`dialog-${template.name}`, previewTemplateComponent, {}, template.content ?? {});
|
|
25
|
+
const resolved = resolveElementComponentNames(composed, galleryPreviewProfile, galleryComponentCatalog);
|
|
26
|
+
return forceState ? forceComponentState(resolved, forceState) : resolved;
|
|
27
|
+
}, [
|
|
28
|
+
template,
|
|
29
|
+
forceState
|
|
30
|
+
]);
|
|
31
|
+
const full = useMemo(()=>({
|
|
32
|
+
...registry,
|
|
33
|
+
...previewComponents
|
|
34
|
+
}), [
|
|
35
|
+
registry
|
|
36
|
+
]);
|
|
37
|
+
return /*#__PURE__*/ jsx(LayoutConfigProvider, {
|
|
38
|
+
initialConfig: initialConfig,
|
|
39
|
+
storage: null,
|
|
40
|
+
children: /*#__PURE__*/ jsx(LayoutThemeProvider, {
|
|
41
|
+
themes: themes,
|
|
42
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
43
|
+
role: "dialog",
|
|
44
|
+
"aria-modal": "true",
|
|
45
|
+
"aria-label": template.displayName ?? template.name,
|
|
46
|
+
"data-scene-dialog": template.name,
|
|
47
|
+
children: /*#__PURE__*/ jsx(SceneElementView, {
|
|
48
|
+
element: element,
|
|
49
|
+
registry: full,
|
|
50
|
+
resolveBinding: ()=>undefined,
|
|
51
|
+
queryResults: queryResultsOf(pack, state)
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { GalleryDialogPreview, galleryDialogTemplate };
|
|
59
|
+
//# sourceMappingURL=GalleryDialogPreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GalleryDialogPreview.js","sources":["../../../gallery/GalleryDialogPreview.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport { DialogTemplate, SampleDataPack, Theme } from '@cratis/scene.model';\nimport { ComponentRegistry, SceneElementView } from '@cratis/scene.react';\nimport { LayoutConfigProvider, LayoutConfigState } from '../configuration';\nimport { previewComponents, previewTemplateComponent } from '../preview-host/PreviewTemplate';\nimport { LayoutThemeProvider, defaultBlueprintThemes } from '../themes';\nimport { externalComponent } from './elements';\nimport { ForcedComponentState, forceComponentState, galleryPreviewRegistry, queryResultsOf } from './GalleryScreenPreview';\nimport { galleryDialogTemplates } from './dialogTemplates';\nimport { galleryComponentCatalog, galleryPreviewProfile } from './previewProfile';\nimport { resolveElementComponentNames } from './resolveElementNames';\nimport { TemplatePreviewState } from './TemplatePreviewState';\n\n/** One gallery dialog template by name, for a story or a host that opens a specific one. */\nexport const galleryDialogTemplate = (name: string): DialogTemplate | undefined => galleryDialogTemplates.find(template => template.name === name);\n\nexport interface GalleryDialogPreviewProps {\n /** The name of the gallery dialog template to open. */\n dialogName: string;\n\n /** Configuration to start from. */\n initialConfig?: Partial<LayoutConfigState>;\n\n /** The themes the preview may switch between. Defaults to the two this blueprint ships. */\n themes?: Theme[];\n\n /** The component registry to render against. Defaults to `core` plus this blueprint's own components. */\n registry?: ComponentRegistry;\n\n /** The data state to show. Defaults to the seeded, populated records. */\n state?: TemplatePreviewState;\n\n /** The sample-data pack that stands in for the queries the template binds to. */\n pack?: SampleDataPack;\n\n /** A standard state (spec Part B 1.4) to force on every foundation component of the dialog that owns the five states. */\n forceState?: ForcedComponentState;\n}\n\n/**\n * Opens one gallery dialog template the way a host does: inside a `role=\"dialog\" aria-modal=\"true\"` element, with the template's content in the wrapper\n * a screen's template gets. Nothing here is a preview-only path - the dialog is a real {@link DialogTemplate} rendered by the real `SceneElementView`,\n * and the dialog's own frame gives the host element its focus handling, placement and labelling exactly as it does in an application.\n */\nexport function GalleryDialogPreview({ dialogName, initialConfig, themes = defaultBlueprintThemes, registry = galleryPreviewRegistry, state = TemplatePreviewState.Populated, pack, forceState }: GalleryDialogPreviewProps) {\n const template = galleryDialogTemplate(dialogName);\n if (!template) throw new Error(`The gallery has no dialog template named '${dialogName}'.`);\n\n const element = useMemo(() => {\n const composed = externalComponent(`dialog-${template.name}`, previewTemplateComponent, {}, template.content ?? {});\n const resolved = resolveElementComponentNames(composed, galleryPreviewProfile, galleryComponentCatalog);\n return forceState ? forceComponentState(resolved, forceState) : resolved;\n }, [template, forceState]);\n const full = useMemo(() => ({ ...registry, ...previewComponents }), [registry]);\n\n return (\n <LayoutConfigProvider initialConfig={initialConfig} storage={null}>\n <LayoutThemeProvider themes={themes}>\n <div role='dialog' aria-modal='true' aria-label={template.displayName ?? template.name} data-scene-dialog={template.name}>\n <SceneElementView element={element} registry={full} resolveBinding={() => undefined} queryResults={queryResultsOf(pack, state)} />\n </div>\n </LayoutThemeProvider>\n </LayoutConfigProvider>\n );\n}\n"],"names":["galleryDialogTemplate","name","galleryDialogTemplates","find","template","GalleryDialogPreview","dialogName","initialConfig","themes","defaultBlueprintThemes","registry","galleryPreviewRegistry","state","TemplatePreviewState","Populated","pack","forceState","Error","element","useMemo","composed","externalComponent","previewTemplateComponent","content","resolved","resolveElementComponentNames","galleryPreviewProfile","galleryComponentCatalog","forceComponentState","full","previewComponents","_jsx","LayoutConfigProvider","storage","LayoutThemeProvider","div","role","aria-modal","aria-label","displayName","data-scene-dialog","SceneElementView","resolveBinding","undefined","queryResults","queryResultsOf"],"mappings":";;;;;;;;;;;;;;AAgBA,6FACO,MAAMA,qBAAAA,GAAwB,CAACC,IAAAA,GAA6CC,sBAAAA,CAAuBC,IAAI,CAACC,CAAAA,QAAAA,GAAYA,QAAAA,CAASH,IAAI,KAAKA,IAAAA;AAyB7I;;;;IAKO,SAASI,oBAAAA,CAAqB,EAAEC,UAAU,EAAEC,aAAa,EAAEC,MAAAA,GAASC,sBAAsB,EAAEC,QAAAA,GAAWC,sBAAsB,EAAEC,KAAAA,GAAQC,oBAAAA,CAAqBC,SAAS,EAAEC,IAAI,EAAEC,UAAU,EAA6B,EAAA;AACvN,IAAA,MAAMZ,WAAWJ,qBAAAA,CAAsBM,UAAAA,CAAAA;IACvC,IAAI,CAACF,QAAAA,EAAU,MAAM,IAAIa,KAAAA,CAAM,CAAC,0CAA0C,EAAEX,UAAAA,C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SAAAA;AAAWC,oBAAAA,YAAAA,EAAcC,eAAe9B,IAAAA,EAAMH,KAAAA;;;;;AAK5I;;"}
|
|
@@ -22,6 +22,8 @@ import '../foundation/templates/recordPageTemplate.js';
|
|
|
22
22
|
import '../foundation/templates/wizardScreenTemplate.js';
|
|
23
23
|
import '../foundation/templates/workspaceScreenTemplate.js';
|
|
24
24
|
import '../foundation/templates/templateParts.js';
|
|
25
|
+
import '../foundation/templates/dialogTemplates.js';
|
|
26
|
+
import '../foundation/templates/stateScreenTemplates.js';
|
|
25
27
|
import { composeScreenElement } from './composeScreen.js';
|
|
26
28
|
import { galleryComponentCatalog, galleryPreviewProfile } from './previewProfile.js';
|
|
27
29
|
import { resolveElementComponentNames } from './resolveElementNames.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryScreenPreview.js","sources":["../../../gallery/GalleryScreenPreview.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport { ExternalComponent, SampleDataPack, SceneElement, Theme } from '@cratis/scene.model';\nimport { ComponentRegistry, SceneElementView, coreComponents } from '@cratis/scene.react';\nimport { LayoutConfigProvider, LayoutConfigState } from '../configuration';\nimport { ComponentName } from '../ComponentName';\nimport { defaultBlueprintComponents } from '../defaultBlueprintComponents';\nimport { ComponentState, foundationSamples } from '../foundation';\nimport { defaultBlueprintName } from '../packageName';\nimport { LayoutThemeProvider, defaultBlueprintThemes } from '../themes';\nimport { composeScreenElement } from './composeScreen';\nimport { galleryComponentCatalog, galleryPreviewProfile } from './previewProfile';\nimport { resolveElementComponentNames } from './resolveElementNames';\nimport { galleryScreen } from './screens';\nimport { TemplatePreviewState } from './TemplatePreviewState';\nimport { applyTemplatePreviewState } from './applyTemplatePreviewState';\n\n/**\n * The registry a preview resolves against when a host does not supply one: `core` plus this blueprint.\n *\n * Merged by hand rather than through `mergePackageRegistries`, because reaching for this blueprint's\n * *bundle* here would be circular - the bundle is assembled from the gallery this file belongs to. Registry\n * keys carry their package name, so merge order cannot cause a collision either way.\n */\nexport const galleryPreviewRegistry: ComponentRegistry = { ...coreComponents, ...defaultBlueprintComponents };\n\nexport interface GalleryScreenPreviewProps {\n /** The name of the gallery screen to boot. */\n screenName: string;\n\n /** Configuration to start from - a story pinning a mode, or a host restoring a session. */\n initialConfig?: Partial<LayoutConfigState>;\n\n /** The themes the configurator may switch between. Defaults to the two this blueprint ships. */\n themes?: Theme[];\n\n /** The component registry to render against. Defaults to `core` plus this blueprint's own components. */\n registry?: ComponentRegistry;\n\n /** The data state to show. Defaults to the seeded, populated records. */\n state?: TemplatePreviewState;\n\n /**\n * The sample-data pack that stands in for the queries the templates bind to: each set's `shape` is a query name and its `rows` that query's result.\n * Templates carry no rows of their own - they declare where the data comes from (spec SD1) - so a preview of a foundation template needs one.\n */\n pack?: SampleDataPack;\n\n /**\n * A standard state (spec Part B 1.4) to force on every foundation component that owns the five states: loading, error, no-permission or partial.\n * This is how a designer inspects each one on a real template - it only sets the `state` property the components already read, so there is no\n * second code path. `error`, `permissionSubject` and `failedRegions` give the state its message.\n */\n forceState?: ForcedComponentState;\n}\n\n/** The standard states a preview can force on a template's components. */\nexport interface ForcedComponentState {\n state: ComponentState;\n error?: string;\n permissionSubject?: string;\n failedRegions?: string[];\n}\n\n/** Components that are chrome or controls rather than data-showing regions, and so do not own the five states. */\nconst withoutStates = new Set<string>([\n ComponentName.EmptyState, ComponentName.TrendChip, ComponentName.StatusChip, ComponentName.BulkBar, ComponentName.GlobalSearch, ComponentName.NotificationsButton,\n]);\n\n/** Sets the forced state on every region that owns the five states, leaving chrome and controls as they are. */\nexport function forceComponentState(element: SceneElement, forced: ForcedComponentState): SceneElement {\n const external = element as Partial<ExternalComponent>;\n const children = (element as { children?: SceneElement[] }).children;\n const slots = external.slots ? Object.fromEntries(Object.entries(external.slots).map(([slot, inner]) => [slot, inner.map(child => forceComponentState(child, forced))])) : undefined;\n const bare = typeof external.componentName === 'string' ? external.componentName.substring(external.componentName.lastIndexOf(':') + 1) : undefined;\n const owns = bare !== undefined && external.componentName!.includes(defaultBlueprintName) && (bare in foundationSamples) && foundationSamples[bare].stateful && !withoutStates.has(bare);\n\n return {\n ...element,\n ...(owns ? { properties: { ...external.properties, ...forced } } : {}),\n ...(slots ? { slots } : {}),\n ...(children ? { children: children.map(child => forceComponentState(child, forced)) } : {}),\n } as SceneElement;\n}\n\n/**\n * A pack as the query results the templates bind to: one entry for each set, keyed by the set's shape name.\n *\n * The state is a property of the *data*, not of the template: Empty answers every query with no rows; Loading and Error withhold the answer, which is\n * what a query that has not come back or has failed looks like to a component, so each shows its own skeleton or error exactly as it will in an application.\n * The elements themselves are untouched, which is why the same template previews in every state with no per-template code.\n */\nexport const queryResultsOf = (pack: SampleDataPack | undefined, state: TemplatePreviewState = TemplatePreviewState.Populated): Record<string, unknown> | undefined => {\n if (pack === undefined) return undefined;\n if (state === TemplatePreviewState.Empty) return Object.fromEntries(pack.sets.map(set => [set.shape, []]));\n return Object.fromEntries(pack.sets.map(set => [set.shape, set.rows]));\n};\n\n/**\n * Boots one gallery screen through the real engine.\n *\n * Nothing here is a preview-only path: the screen is a real {@link Screen}, its element tree is resolved by\n * the real `resolveComponentName`, and it is rendered by the real `SceneElementView` against the real\n * registry. That is the point of shipping a gallery at all - a mockup proves that someone can draw a\n * dashboard, and this proves the blueprint renders one.\n *\n * Component names belonging to packages the host has not loaded resolve but find no implementation, and\n * come out as `UnresolvedComponent`'s dashed red box naming what is missing. That is the designed outcome:\n * a preview of a blueprint against half a profile should look visibly incomplete rather than quietly\n * wrong.\n */\nexport function GalleryScreenPreview({ screenName, initialConfig, themes = defaultBlueprintThemes, registry = galleryPreviewRegistry, state = TemplatePreviewState.Populated, pack, forceState }: GalleryScreenPreviewProps) {\n const element = useMemo(() => {\n const screen = galleryScreen(screenName);\n if (!screen) {\n throw new Error(`The gallery has no screen named '${screenName}'.`);\n }\n\n const resolved = applyTemplatePreviewState(resolveElementComponentNames(composeScreenElement(screen), galleryPreviewProfile, galleryComponentCatalog), state);\n return forceState ? forceComponentState(resolved, forceState) : resolved;\n }, [screenName, state, forceState]);\n\n return (\n <LayoutConfigProvider initialConfig={initialConfig} storage={null}>\n <LayoutThemeProvider themes={themes}>\n <SceneElementView element={element} registry={registry} resolveBinding={() => undefined} queryResults={queryResultsOf(pack, state)} />\n </LayoutThemeProvider>\n </LayoutConfigProvider>\n );\n}\n"],"names":["galleryPreviewRegistry","coreComponents","defaultBlueprintComponents","withoutStates","Set","ComponentName","EmptyState","TrendChip","StatusChip","BulkBar","GlobalSearch","NotificationsButton","forceComponentState","element","forced","external","children","slots","Object","fromEntries","entries","map","slot","inner","child","undefined","bare","componentName","substring","lastIndexOf","owns","includes","defaultBlueprintName","foundationSamples","stateful","has","properties","queryResultsOf","pack","state","TemplatePreviewState","Populated","Empty","sets","set","shape","rows","GalleryScreenPreview","screenName","initialConfig","themes","defaultBlueprintThemes","registry","forceState","useMemo","screen","galleryScreen","Error","resolved","applyTemplatePreviewState","resolveElementComponentNames","composeScreenElement","galleryPreviewProfile","galleryComponentCatalog","_jsx","LayoutConfigProvider","storage","LayoutThemeProvider","SceneElementView","resolveBinding","queryResults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA;;;;;;UAOaA,sBAAAA,GAA4C;AAAE,IAAA,GAAGC,cAAc;AAAE,IAAA,GAAGC;AAA2B;AAwC5G,mHACA,MAAMC,aAAAA,GAAgB,IAAIC,GAAAA,CAAY;AAClCC,IAAAA,aAAAA,CAAcC,UAAU;AAAED,IAAAA,aAAAA,CAAcE,SAAS;AAAEF,IAAAA,aAAAA,CAAcG,UAAU;AAAEH,IAAAA,aAAAA,CAAcI,OAAO;AAAEJ,IAAAA,aAAAA,CAAcK,YAAY;AAAEL,IAAAA,aAAAA,CAAcM;AACjJ,CAAA,CAAA;AAED,iHACO,SAASC,mBAAAA,CAAoBC,OAAqB,EAAEC,MAA4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AAA,GAAazC,mBAAAA,CAAoB8C,QAAAA,EAAUL,UAAAA,CAAAA,GAAcK,QAAAA;IACpE,CAAA,EAAG;AAACV,QAAAA,UAAAA;AAAYT,QAAAA,KAAAA;AAAOc,QAAAA;AAAW,KAAA,CAAA;AAElC,IAAA,qBACIW,GAAA,CAACC,oBAAAA,EAAAA;QAAqBhB,aAAAA,EAAeA,aAAAA;QAAeiB,OAAAA,EAAS,IAAA;AACzD,QAAA,QAAA,gBAAAF,GAAA,CAACG,mBAAAA,EAAAA;YAAoBjB,MAAAA,EAAQA,MAAAA;AACzB,YAAA,QAAA,gBAAAc,GAAA,CAACI,gBAAAA,EAAAA;gBAAiBvD,OAAAA,EAASA,OAAAA;gBAASuC,QAAAA,EAAUA,QAAAA;AAAUiB,gBAAAA,cAAAA,EAAgB,IAAM5C,SAAAA;AAAW6C,gBAAAA,YAAAA,EAAcjC,eAAeC,IAAAA,EAAMC,KAAAA;;;;AAI5I;;"}
|
|
1
|
+
{"version":3,"file":"GalleryScreenPreview.js","sources":["../../../gallery/GalleryScreenPreview.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport { ExternalComponent, SampleDataPack, SceneElement, Theme } from '@cratis/scene.model';\nimport { ComponentRegistry, SceneElementView, coreComponents } from '@cratis/scene.react';\nimport { LayoutConfigProvider, LayoutConfigState } from '../configuration';\nimport { ComponentName } from '../ComponentName';\nimport { defaultBlueprintComponents } from '../defaultBlueprintComponents';\nimport { ComponentState, foundationSamples } from '../foundation';\nimport { defaultBlueprintName } from '../packageName';\nimport { LayoutThemeProvider, defaultBlueprintThemes } from '../themes';\nimport { composeScreenElement } from './composeScreen';\nimport { galleryComponentCatalog, galleryPreviewProfile } from './previewProfile';\nimport { resolveElementComponentNames } from './resolveElementNames';\nimport { galleryScreen } from './screens';\nimport { TemplatePreviewState } from './TemplatePreviewState';\nimport { applyTemplatePreviewState } from './applyTemplatePreviewState';\n\n/**\n * The registry a preview resolves against when a host does not supply one: `core` plus this blueprint.\n *\n * Merged by hand rather than through `mergePackageRegistries`, because reaching for this blueprint's\n * *bundle* here would be circular - the bundle is assembled from the gallery this file belongs to. Registry\n * keys carry their package name, so merge order cannot cause a collision either way.\n */\nexport const galleryPreviewRegistry: ComponentRegistry = { ...coreComponents, ...defaultBlueprintComponents };\n\nexport interface GalleryScreenPreviewProps {\n /** The name of the gallery screen to boot. */\n screenName: string;\n\n /** Configuration to start from - a story pinning a mode, or a host restoring a session. */\n initialConfig?: Partial<LayoutConfigState>;\n\n /** The themes the configurator may switch between. Defaults to the two this blueprint ships. */\n themes?: Theme[];\n\n /** The component registry to render against. Defaults to `core` plus this blueprint's own components. */\n registry?: ComponentRegistry;\n\n /** The data state to show. Defaults to the seeded, populated records. */\n state?: TemplatePreviewState;\n\n /**\n * The sample-data pack that stands in for the queries the templates bind to: each set's `shape` is a query name and its `rows` that query's result.\n * Templates carry no rows of their own - they declare where the data comes from (spec SD1) - so a preview of a foundation template needs one.\n */\n pack?: SampleDataPack;\n\n /**\n * A standard state (spec Part B 1.4) to force on every foundation component that owns the five states: loading, error, no-permission or partial.\n * This is how a designer inspects each one on a real template - it only sets the `state` property the components already read, so there is no\n * second code path. `error`, `permissionSubject` and `failedRegions` give the state its message.\n */\n forceState?: ForcedComponentState;\n}\n\n/** The standard states a preview can force on a template's components. */\nexport interface ForcedComponentState {\n state: ComponentState;\n error?: string;\n permissionSubject?: string;\n failedRegions?: string[];\n}\n\n/** Components that are chrome or controls rather than data-showing regions, and so do not own the five states. */\nconst withoutStates = new Set<string>([\n ComponentName.EmptyState, ComponentName.TrendChip, ComponentName.StatusChip, ComponentName.BulkBar, ComponentName.GlobalSearch, ComponentName.NotificationsButton,\n]);\n\n/** Sets the forced state on every region that owns the five states, leaving chrome and controls as they are. */\nexport function forceComponentState(element: SceneElement, forced: ForcedComponentState): SceneElement {\n const external = element as Partial<ExternalComponent>;\n const children = (element as { children?: SceneElement[] }).children;\n const slots = external.slots ? Object.fromEntries(Object.entries(external.slots).map(([slot, inner]) => [slot, inner.map(child => forceComponentState(child, forced))])) : undefined;\n const bare = typeof external.componentName === 'string' ? external.componentName.substring(external.componentName.lastIndexOf(':') + 1) : undefined;\n const owns = bare !== undefined && external.componentName!.includes(defaultBlueprintName) && (bare in foundationSamples) && foundationSamples[bare].stateful && !withoutStates.has(bare);\n\n return {\n ...element,\n ...(owns ? { properties: { ...external.properties, ...forced } } : {}),\n ...(slots ? { slots } : {}),\n ...(children ? { children: children.map(child => forceComponentState(child, forced)) } : {}),\n } as SceneElement;\n}\n\n/**\n * A pack as the query results the templates bind to: one entry for each set, keyed by the set's shape name.\n *\n * The state is a property of the *data*, not of the template: Empty answers every query with no rows; Loading and Error withhold the answer, which is\n * what a query that has not come back or has failed looks like to a component, so each shows its own skeleton or error exactly as it will in an application.\n * The elements themselves are untouched, which is why the same template previews in every state with no per-template code.\n */\nexport const queryResultsOf = (pack: SampleDataPack | undefined, state: TemplatePreviewState = TemplatePreviewState.Populated): Record<string, unknown> | undefined => {\n if (pack === undefined) return undefined;\n if (state === TemplatePreviewState.Empty) return Object.fromEntries(pack.sets.map(set => [set.shape, []]));\n return Object.fromEntries(pack.sets.map(set => [set.shape, set.rows]));\n};\n\n/**\n * Boots one gallery screen through the real engine.\n *\n * Nothing here is a preview-only path: the screen is a real {@link Screen}, its element tree is resolved by\n * the real `resolveComponentName`, and it is rendered by the real `SceneElementView` against the real\n * registry. That is the point of shipping a gallery at all - a mockup proves that someone can draw a\n * dashboard, and this proves the blueprint renders one.\n *\n * Component names belonging to packages the host has not loaded resolve but find no implementation, and\n * come out as `UnresolvedComponent`'s dashed red box naming what is missing. That is the designed outcome:\n * a preview of a blueprint against half a profile should look visibly incomplete rather than quietly\n * wrong.\n */\nexport function GalleryScreenPreview({ screenName, initialConfig, themes = defaultBlueprintThemes, registry = galleryPreviewRegistry, state = TemplatePreviewState.Populated, pack, forceState }: GalleryScreenPreviewProps) {\n const element = useMemo(() => {\n const screen = galleryScreen(screenName);\n if (!screen) {\n throw new Error(`The gallery has no screen named '${screenName}'.`);\n }\n\n const resolved = applyTemplatePreviewState(resolveElementComponentNames(composeScreenElement(screen), galleryPreviewProfile, galleryComponentCatalog), state);\n return forceState ? forceComponentState(resolved, forceState) : resolved;\n }, [screenName, state, forceState]);\n\n return (\n <LayoutConfigProvider initialConfig={initialConfig} storage={null}>\n <LayoutThemeProvider themes={themes}>\n <SceneElementView element={element} registry={registry} resolveBinding={() => undefined} queryResults={queryResultsOf(pack, state)} />\n </LayoutThemeProvider>\n </LayoutConfigProvider>\n );\n}\n"],"names":["galleryPreviewRegistry","coreComponents","defaultBlueprintComponents","withoutStates","Set","ComponentName","EmptyState","TrendChip","StatusChip","BulkBar","GlobalSearch","NotificationsButton","forceComponentState","element","forced","external","children","slots","Object","fromEntries","entries","map","slot","inner","child","undefined","bare","componentName","substring","lastIndexOf","owns","includes","defaultBlueprintName","foundationSamples","stateful","has","properties","queryResultsOf","pack","state","TemplatePreviewState","Populated","Empty","sets","set","shape","rows","GalleryScreenPreview","screenName","initialConfig","themes","defaultBlueprintThemes","registry","forceState","useMemo","screen","galleryScreen","Error","resolved","applyTemplatePreviewState","resolveElementComponentNames","composeScreenElement","galleryPreviewProfile","galleryComponentCatalog","_jsx","LayoutConfigProvider","storage","LayoutThemeProvider","SceneElementView","resolveBinding","queryResults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA;;;;;;UAOaA,sBAAAA,GAA4C;AAAE,IAAA,GAAGC,cAAc;AAAE,IAAA,GAAGC;AAA2B;AAwC5G,mHACA,MAAMC,aAAAA,GAAgB,IAAIC,GAAAA,CAAY;AAClCC,IAAAA,aAAAA,CAAcC,UAAU;AAAED,IAAAA,aAAAA,CAAcE,SAAS;AAAEF,IAAAA,aAAAA,CAAcG,UAAU;AAAEH,IAAAA,aAAAA,CAAcI,OAAO;AAAEJ,IAAAA,aAAAA,CA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CAA6BC,oBAAAA,CAAqBN,MAAAA,CAAAA,EAASO,uBAAuBC,uBAAAA,CAAAA,EAA0BxB,KAAAA,CAAAA;QACvJ,OAAOc,UAAAA,GAAazC,mBAAAA,CAAoB8C,QAAAA,EAAUL,UAAAA,CAAAA,GAAcK,QAAAA;IACpE,CAAA,EAAG;AAACV,QAAAA,UAAAA;AAAYT,QAAAA,KAAAA;AAAOc,QAAAA;AAAW,KAAA,CAAA;AAElC,IAAA,qBACIW,GAAA,CAACC,oBAAAA,EAAAA;QAAqBhB,aAAAA,EAAeA,aAAAA;QAAeiB,OAAAA,EAAS,IAAA;AACzD,QAAA,QAAA,gBAAAF,GAAA,CAACG,mBAAAA,EAAAA;YAAoBjB,MAAAA,EAAQA,MAAAA;AACzB,YAAA,QAAA,gBAAAc,GAAA,CAACI,gBAAAA,EAAAA;gBAAiBvD,OAAAA,EAASA,OAAAA;gBAASuC,QAAAA,EAAUA,QAAAA;AAAUiB,gBAAAA,cAAAA,EAAgB,IAAM5C,SAAAA;AAAW6C,gBAAAA,YAAAA,EAAcjC,eAAeC,IAAAA,EAAMC,KAAAA;;;;AAI5I;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialogTemplates.d.ts","sourceRoot":"","sources":["../../../gallery/dialogTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"dialogTemplates.d.ts","sourceRoot":"","sources":["../../../gallery/dialogTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAsBrD,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,EAAoG,CAAC"}
|