@cratis/scene.blueprint.default 4.13.0 → 4.15.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
|
@@ -14,8 +14,8 @@ var templateProvenance = require('../templateProvenance.js');
|
|
|
14
14
|
// Copyright (c) Cratis. All rights reserved.
|
|
15
15
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
16
16
|
/**
|
|
17
|
-
* The
|
|
18
|
-
* designed empty state.
|
|
17
|
+
* The six workhorse shapes inside an application shell: a dashboard, a list, master/detail, a detail, a
|
|
18
|
+
* form and the designed empty state.
|
|
19
19
|
*
|
|
20
20
|
* Every one fits the layout's `content` slot, and every one carries realistic seeded content rather than
|
|
21
21
|
* placeholder text. A gallery whose dashboard shows four boxes labeled "Card" proves the renderer runs; a
|
|
@@ -198,7 +198,8 @@ var templateProvenance = require('../templateProvenance.js');
|
|
|
198
198
|
})
|
|
199
199
|
]),
|
|
200
200
|
elements.externalComponent('crud-search', 'inputText', {
|
|
201
|
-
placeholder: 'Search products'
|
|
201
|
+
placeholder: 'Search products',
|
|
202
|
+
ariaLabel: 'Search products'
|
|
202
203
|
})
|
|
203
204
|
],
|
|
204
205
|
[TemplateSlotName.TemplateSlotName.Body]: [
|
|
@@ -322,6 +323,116 @@ var templateProvenance = require('../templateProvenance.js');
|
|
|
322
323
|
...templateProvenance.defaultBlueprintTemplateProvenance
|
|
323
324
|
}
|
|
324
325
|
};
|
|
326
|
+
/**
|
|
327
|
+
* Master/detail: the list and the selected record side by side, so working through records does not mean
|
|
328
|
+
* leaving the list. The detail region is an outlet that accepts detail screens, which is what lets a row's
|
|
329
|
+
* destination open a full detail screen in place.
|
|
330
|
+
*
|
|
331
|
+
* At a compact width the two stack, list first, because side-by-side on a phone is two unreadable halves.
|
|
332
|
+
*/ const masterDetailTemplate = {
|
|
333
|
+
name: 'MasterDetail',
|
|
334
|
+
fitsSlot: SlotName.SlotName.Content,
|
|
335
|
+
slots: [
|
|
336
|
+
{
|
|
337
|
+
name: TemplateSlotName.TemplateSlotName.Header
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
name: TemplateSlotName.TemplateSlotName.Primary
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: TemplateSlotName.TemplateSlotName.SidePanel
|
|
344
|
+
}
|
|
345
|
+
],
|
|
346
|
+
outlets: [
|
|
347
|
+
{
|
|
348
|
+
name: 'master-detail.detail',
|
|
349
|
+
description: 'The selected record.',
|
|
350
|
+
accepts: [
|
|
351
|
+
'Detail'
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
],
|
|
355
|
+
arrangement: {
|
|
356
|
+
root: flowBuilders.column([
|
|
357
|
+
flowBuilders.slotLeaf(TemplateSlotName.TemplateSlotName.Header),
|
|
358
|
+
flowBuilders.grid([
|
|
359
|
+
flowBuilders.slotLeaf(TemplateSlotName.TemplateSlotName.Primary),
|
|
360
|
+
flowBuilders.slotLeaf(TemplateSlotName.TemplateSlotName.SidePanel)
|
|
361
|
+
], 2, 16)
|
|
362
|
+
], 16),
|
|
363
|
+
overrides: [
|
|
364
|
+
{
|
|
365
|
+
width: scene_model.WidthSizeClass.Compact,
|
|
366
|
+
root: flowBuilders.column([
|
|
367
|
+
flowBuilders.slotLeaf(TemplateSlotName.TemplateSlotName.Header),
|
|
368
|
+
flowBuilders.slotLeaf(TemplateSlotName.TemplateSlotName.Primary),
|
|
369
|
+
flowBuilders.slotLeaf(TemplateSlotName.TemplateSlotName.SidePanel)
|
|
370
|
+
], 16)
|
|
371
|
+
}
|
|
372
|
+
]
|
|
373
|
+
},
|
|
374
|
+
content: {
|
|
375
|
+
[TemplateSlotName.TemplateSlotName.Header]: [
|
|
376
|
+
widgets.pageHeader('master-header', 'Customers', '1,204 customers, 38 with overdue invoices')
|
|
377
|
+
],
|
|
378
|
+
[TemplateSlotName.TemplateSlotName.Primary]: [
|
|
379
|
+
widgets.table('customers-table', [
|
|
380
|
+
{
|
|
381
|
+
field: 'name',
|
|
382
|
+
header: 'Customer'
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
field: 'city',
|
|
386
|
+
header: 'City'
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
field: 'balance',
|
|
390
|
+
header: 'Balance'
|
|
391
|
+
}
|
|
392
|
+
], [
|
|
393
|
+
{
|
|
394
|
+
name: 'Northwind Traders',
|
|
395
|
+
city: 'Seattle',
|
|
396
|
+
balance: '$4,200.00'
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
name: 'Contoso Ltd',
|
|
400
|
+
city: 'Oslo',
|
|
401
|
+
balance: '$0.00'
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
name: 'Fabrikam',
|
|
405
|
+
city: 'Lyon',
|
|
406
|
+
balance: '$12,940.50'
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
name: 'Adventure Works',
|
|
410
|
+
city: 'Denver',
|
|
411
|
+
balance: '$318.20'
|
|
412
|
+
}
|
|
413
|
+
], 'No customers match the search')
|
|
414
|
+
],
|
|
415
|
+
[TemplateSlotName.TemplateSlotName.SidePanel]: [
|
|
416
|
+
widgets.widget('customer-detail', 'Northwind Traders', [
|
|
417
|
+
elements.text('customer-contact', 'Contact: Amelia Nyquist'),
|
|
418
|
+
elements.text('customer-terms', 'Payment terms: 30 days'),
|
|
419
|
+
elements.externalComponent('customer-status', 'tag', {
|
|
420
|
+
value: 'Overdue',
|
|
421
|
+
severity: 'warning'
|
|
422
|
+
}),
|
|
423
|
+
elements.button('customer-open', 'Open customer', {
|
|
424
|
+
severity: 'primary'
|
|
425
|
+
})
|
|
426
|
+
])
|
|
427
|
+
]
|
|
428
|
+
},
|
|
429
|
+
displayName: 'Master/detail',
|
|
430
|
+
description: 'A list beside the selected record, stacking on narrow screens.',
|
|
431
|
+
metadata: {
|
|
432
|
+
...templateProvenance.defaultBlueprintTemplateProvenance,
|
|
433
|
+
type: 'Workspace'
|
|
434
|
+
}
|
|
435
|
+
};
|
|
325
436
|
/** The form: fields, grouped, with the actions that close them. */ const formPageTemplate = {
|
|
326
437
|
name: 'FormPage',
|
|
327
438
|
fitsSlot: SlotName.SlotName.Content,
|
|
@@ -397,6 +508,7 @@ var templateProvenance = require('../templateProvenance.js');
|
|
|
397
508
|
/** The five workspace templates. */ const workspaceTemplates = [
|
|
398
509
|
dashboardTemplate,
|
|
399
510
|
crudListTemplate,
|
|
511
|
+
masterDetailTemplate,
|
|
400
512
|
detailViewTemplate,
|
|
401
513
|
formPageTemplate,
|
|
402
514
|
emptyTemplate
|
|
@@ -407,5 +519,6 @@ exports.dashboardTemplate = dashboardTemplate;
|
|
|
407
519
|
exports.detailViewTemplate = detailViewTemplate;
|
|
408
520
|
exports.emptyTemplate = emptyTemplate;
|
|
409
521
|
exports.formPageTemplate = formPageTemplate;
|
|
522
|
+
exports.masterDetailTemplate = masterDetailTemplate;
|
|
410
523
|
exports.workspaceTemplates = workspaceTemplates;
|
|
411
524
|
//# sourceMappingURL=workspaceTemplates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaceTemplates.js","sources":["../../../gallery/workspaceTemplates.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, WidthSizeClass } from '@cratis/scene.model';\nimport { SlotName, column, grid, slotLeaf } from '../layouts';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, card, externalComponent, text } from './elements';\nimport { emptyState, field, formActions, pageHeader, statCard, table, widget } from './widgets';\nimport { defaultBlueprintTemplateProvenance, sakaiCompositionProvenance } from '../templateProvenance';\n\n/**\n * The five workhorse shapes inside an application shell: a dashboard, a list, a detail, a form and the\n * designed empty state.\n *\n * Every one fits the layout's `content` slot, and every one carries realistic seeded content rather than\n * placeholder text. A gallery whose dashboard shows four boxes labeled \"Card\" proves the renderer runs; a\n * gallery whose dashboard shows revenue, orders, customers and a real table proves the blueprint is worth\n * starting an application from.\n */\n\n/**\n * The dashboard: four figures across the top, then two columns of larger widgets.\n *\n * This is Sakai's composition, and the reason to copy it is that it is the arrangement people already read\n * fluently - the eye takes the row of numbers first and then settles into the detail.\n *\n * Its own arrangement collapses the two columns into one at a compact width, because a two-column widget\n * grid on a phone is two columns of unreadable slivers.\n */\nexport const dashboardTemplate: ScreenTemplate = {\n name: 'Dashboard',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Stats }, { name: TemplateSlotName.Primary }, { name: TemplateSlotName.Secondary }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Stats), grid([slotLeaf(TemplateSlotName.Primary, { span: 2 }), slotLeaf(TemplateSlotName.Secondary)], 3, 16)]),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column([slotLeaf(TemplateSlotName.Stats), slotLeaf(TemplateSlotName.Primary), slotLeaf(TemplateSlotName.Secondary)], 16),\n },\n ],\n },\n content: {\n [TemplateSlotName.Stats]: [\n statCard('stat-revenue', 'Revenue', '$284,120', '+12.4% this month', 'pi pi-dollar'),\n statCard('stat-orders', 'Orders', '1,842', '+3.1% this month', 'pi pi-shopping-cart'),\n statCard('stat-customers', 'Customers', '9,410', '+128 new', 'pi pi-users'),\n statCard('stat-open', 'Open tickets', '17', '-4 since Monday', 'pi pi-inbox'),\n ],\n [TemplateSlotName.Primary]: [\n widget('widget-revenue', 'Revenue over time', [\n table(\n 'revenue-table',\n [\n { field: 'month', header: 'Month' },\n { field: 'revenue', header: 'Revenue' },\n { field: 'change', header: 'Change' },\n ],\n [\n { month: 'March', revenue: '$284,120', change: '+12.4%' },\n { month: 'February', revenue: '$252,780', change: '+4.1%' },\n { month: 'January', revenue: '$242,830', change: '-1.8%' },\n { month: 'December', revenue: '$247,290', change: '+9.6%' },\n ],\n ),\n ]),\n widget('widget-orders', 'Recent orders', [\n table(\n 'orders-table',\n [\n { field: 'reference', header: 'Reference' },\n { field: 'customer', header: 'Customer' },\n { field: 'total', header: 'Total' },\n { field: 'status', header: 'Status' },\n ],\n [\n { reference: 'ORD-4192', customer: 'Northwind Traders', total: '$1,240.00', status: 'Shipped' },\n { reference: 'ORD-4191', customer: 'Contoso Ltd', total: '$318.50', status: 'Packing' },\n { reference: 'ORD-4188', customer: 'Fabrikam', total: '$2,980.00', status: 'Awaiting payment' },\n { reference: 'ORD-4184', customer: 'Adventure Works', total: '$76.20', status: 'Shipped' },\n ],\n ),\n ]),\n ],\n [TemplateSlotName.Secondary]: [\n widget('widget-activity', 'Activity', [externalComponent('activity-timeline', 'timeline', { align: 'left' })]),\n widget('widget-capacity', 'Warehouse capacity', [externalComponent('capacity-bar', 'progressBar', { value: 68 })]),\n ],\n },\n displayName: 'Dashboard',\n description: 'Four stat cards over two columns of widgets - the composition every template line opens with.',\n metadata: { ...sakaiCompositionProvenance },\n};\n\n/** The list: a filter toolbar, a real table, and the row actions a list needs. */\nexport const crudListTemplate: ScreenTemplate = {\n name: 'CrudList',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Toolbar]: [\n pageHeader('crud-header', 'Products', '412 products across 9 categories', [\n button('crud-new', 'New product', { severity: 'primary', icon: 'pi pi-plus' }),\n button('crud-import', 'Import', { severity: 'secondary', icon: 'pi pi-upload' }),\n ]),\n externalComponent('crud-search', 'inputText', { placeholder: 'Search products' }),\n ],\n [TemplateSlotName.Body]: [\n table(\n 'products-table',\n [\n { field: 'code', header: 'Code' },\n { field: 'name', header: 'Name' },\n { field: 'category', header: 'Category' },\n { field: 'price', header: 'Price' },\n { field: 'stock', header: 'In stock' },\n ],\n [\n { code: 'P-1001', name: 'Bamboo Watch', category: 'Accessories', price: '$65.00', stock: 24 },\n { code: 'P-1002', name: 'Black Watch', category: 'Accessories', price: '$72.00', stock: 61 },\n { code: 'P-1003', name: 'Blue Band', category: 'Fitness', price: '$79.00', stock: 2 },\n { code: 'P-1004', name: 'Blue T-Shirt', category: 'Clothing', price: '$29.00', stock: 25 },\n { code: 'P-1005', name: 'Bracelet', category: 'Accessories', price: '$15.00', stock: 73 },\n ],\n ),\n ],\n },\n displayName: 'List',\n description: 'A searchable table with a header, primary action and row data.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The detail: a summary panel beside the record's own sections. */\nexport const detailViewTemplate: ScreenTemplate = {\n name: 'DetailView',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n content: {\n [TemplateSlotName.Header]: [\n pageHeader('detail-header', 'Bamboo Watch', 'P-1001 · Accessories', [\n button('detail-edit', 'Edit', { severity: 'primary', icon: 'pi pi-pencil' }),\n button('detail-archive', 'Archive', { severity: 'secondary', icon: 'pi pi-inbox' }),\n ]),\n ],\n [TemplateSlotName.Body]: [\n widget('detail-description', 'Description', [\n text('detail-description-text', 'A bamboo-cased watch with a sapphire face and a recycled steel strap.'),\n ]),\n widget('detail-history', 'Price history', [externalComponent('detail-history-timeline', 'timeline', { align: 'left' })]),\n ],\n [TemplateSlotName.SidePanel]: [\n widget('detail-summary', 'Summary', [\n text('detail-stock', 'In stock: 24'),\n text('detail-reserved', 'Reserved: 3'),\n externalComponent('detail-status', 'tag', { value: 'Active', severity: 'success' }),\n ]),\n ],\n },\n displayName: 'Detail',\n description: 'One record: a header with actions, its sections, and a summary panel.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The form: fields, grouped, with the actions that close them. */\nexport const formPageTemplate: ScreenTemplate = {\n name: 'FormPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [pageHeader('form-header', 'New product', 'Everything marked with an asterisk is required')],\n [TemplateSlotName.Body]: [\n card('form-card', [\n field('form-name', 'Name', 'inputText', { placeholder: 'Bamboo Watch' }),\n field('form-code', 'Code', 'inputText', { placeholder: 'P-1001' }),\n field('form-category', 'Category', 'dropdown', { options: ['Accessories', 'Clothing', 'Fitness'] }),\n field('form-price', 'Price', 'inputNumber', { mode: 'currency', currency: 'USD' }),\n field('form-available', 'Available from', 'calendar', {}),\n field('form-notes', 'Notes', 'inputTextarea', { rows: 4 }),\n ]),\n ],\n [TemplateSlotName.Actions]: [formActions('form-actions', 'Create product')],\n },\n displayName: 'Form',\n description: 'A grouped form with the field types an application actually uses.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The empty state: what a list looks like before anything exists, designed rather than apologized for. */\nexport const emptyTemplate: ScreenTemplate = {\n name: 'Empty',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n emptyState('empty-state', 'No products yet', 'Products you create will show up here, with their stock and pricing.', 'Create the first product'),\n ],\n },\n displayName: 'Empty state',\n description: 'The designed empty state for a list that has nothing in it yet.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The five workspace templates. */\nexport const workspaceTemplates: ScreenTemplate[] = [dashboardTemplate, crudListTemplate, detailViewTemplate, formPageTemplate, emptyTemplate];\n"],"names":["dashboardTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Stats","Primary","Secondary","arrangement","root","column","slotLeaf","grid","span","overrides","width","WidthSizeClass","Compact","content","statCard","widget","table","field","header","month","revenue","change","reference","customer","total","status","externalComponent","align","value","displayName","description","metadata","sakaiCompositionProvenance","crudListTemplate","Toolbar","Body","pageHeader","button","severity","icon","placeholder","code","category","price","stock","defaultBlueprintTemplateProvenance","detailViewTemplate","Header","SidePanel","text","formPageTemplate","Actions","card","options","mode","currency","rows","formActions","emptyTemplate","emptyState","workspaceTemplates"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AASA;;;;;;;;;;;;;;;;UAmBaA,iBAAAA,GAAoC;IAC7CC,IAAAA,EAAM,WAAA;AACNC,IAAAA,QAAAA,EAAUC,kBAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,kCAAiBC;AAAM,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,kCAAiBE;AAAQ,SAAA;AAAG,QAAA;AAAEP,YAAAA,IAAAA,EAAMK,kCAAiBG;AAAU;AAAE,KAAA;IACnHC,WAAAA,EAAa;AACTC,QAAAA,IAAAA,EAAMC,mBAAAA,CAAO;AAACC,YAAAA,qBAAAA,CAASP,kCAAiBC,KAAK,CAAA;YAAGO,iBAAAA,CAAK;gBAACD,qBAAAA,CAASP,iCAAAA,CAAiBE,OAAO,EAAE;oBAAEO,IAAAA,EAAM;AAAE,iBAAA,CAAA;AAAIF,gBAAAA,qBAAAA,CAASP,kCAAiBG,SAAS;AAAE,aAAA,EAAE,CAAA,EAAG,EAAA;AAAI,SAAA,CAAA;QACrJO,SAAAA,EAAW;AACP,YAAA;AACIC,gBAAAA,KAAAA,EAAOC,2BAAeC,OAAO;AAC7BR,gBAAAA,IAAAA,EAAMC,mBAAAA,CAAO;AAACC,oBAAAA,qBAAAA,CAASP,kCAAiBC,KAAK,CAAA;AAAGM,oBAAAA,qBAAAA,CAASP,kCAAiBE,OAAO,CAAA;AAAGK,oBAAAA,qBAAAA,CAASP,kCAAiBG,SAAS;iBAAE,EAAE,EAAA;AAC/H;AACH;AACL,KAAA;IACAW,OAAAA,EAAS;QACL,CAACd,iCAAAA,CAAiBC,KAAK,GAAG;YACtBc,gBAAAA,CAAS,cAAA,EAAgB,SAAA,EAAW,UAAA,EAAY,mBAAA,EAAqB,cAAA,CAAA;YACrEA,gBAAAA,CAAS,aAAA,EAAe,Q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IACbC,WAAAA,EAAa,mEAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGc;AAAmC;AACtD;AAEA,4GACO,MAAMa,aAAAA,GAAgC;IACzChE,IAAAA,EAAM,OAAA;AACNC,IAAAA,QAAAA,EAAUC,kBAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,kCAAiBoC;AAAK;AAAE,KAAA;IACxCtB,OAAAA,EAAS;QACL,CAACd,iCAAAA,CAAiBoC,IAAI,GAAG;YACrBwB,kBAAAA,CAAW,aAAA,EAAe,mBAAmB,sEAAA,EAAwE,0BAAA;AACxH;AACL,KAAA;IACA9B,WAAAA,EAAa,aAAA;IACbC,WAAAA,EAAa,iEAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGc;AAAmC;AACtD;AAEA,qCACO,MAAMe,kBAAAA,GAAuC;AAACnE,IAAAA,iBAAAA;AAAmBwC,IAAAA,gBAAAA;AAAkBa,IAAAA,kBAAAA;AAAoBI,IAAAA,gBAAAA;AAAkBQ,IAAAA;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"workspaceTemplates.js","sources":["../../../gallery/workspaceTemplates.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, WidthSizeClass } from '@cratis/scene.model';\nimport { SlotName, column, grid, slotLeaf } from '../layouts';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, card, externalComponent, text } from './elements';\nimport { emptyState, field, formActions, pageHeader, statCard, table, widget } from './widgets';\nimport { defaultBlueprintTemplateProvenance, sakaiCompositionProvenance } from '../templateProvenance';\n\n/**\n * The six workhorse shapes inside an application shell: a dashboard, a list, master/detail, a detail, a\n * form and the designed empty state.\n *\n * Every one fits the layout's `content` slot, and every one carries realistic seeded content rather than\n * placeholder text. A gallery whose dashboard shows four boxes labeled \"Card\" proves the renderer runs; a\n * gallery whose dashboard shows revenue, orders, customers and a real table proves the blueprint is worth\n * starting an application from.\n */\n\n/**\n * The dashboard: four figures across the top, then two columns of larger widgets.\n *\n * This is Sakai's composition, and the reason to copy it is that it is the arrangement people already read\n * fluently - the eye takes the row of numbers first and then settles into the detail.\n *\n * Its own arrangement collapses the two columns into one at a compact width, because a two-column widget\n * grid on a phone is two columns of unreadable slivers.\n */\nexport const dashboardTemplate: ScreenTemplate = {\n name: 'Dashboard',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Stats }, { name: TemplateSlotName.Primary }, { name: TemplateSlotName.Secondary }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Stats), grid([slotLeaf(TemplateSlotName.Primary, { span: 2 }), slotLeaf(TemplateSlotName.Secondary)], 3, 16)]),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column([slotLeaf(TemplateSlotName.Stats), slotLeaf(TemplateSlotName.Primary), slotLeaf(TemplateSlotName.Secondary)], 16),\n },\n ],\n },\n content: {\n [TemplateSlotName.Stats]: [\n statCard('stat-revenue', 'Revenue', '$284,120', '+12.4% this month', 'pi pi-dollar'),\n statCard('stat-orders', 'Orders', '1,842', '+3.1% this month', 'pi pi-shopping-cart'),\n statCard('stat-customers', 'Customers', '9,410', '+128 new', 'pi pi-users'),\n statCard('stat-open', 'Open tickets', '17', '-4 since Monday', 'pi pi-inbox'),\n ],\n [TemplateSlotName.Primary]: [\n widget('widget-revenue', 'Revenue over time', [\n table(\n 'revenue-table',\n [\n { field: 'month', header: 'Month' },\n { field: 'revenue', header: 'Revenue' },\n { field: 'change', header: 'Change' },\n ],\n [\n { month: 'March', revenue: '$284,120', change: '+12.4%' },\n { month: 'February', revenue: '$252,780', change: '+4.1%' },\n { month: 'January', revenue: '$242,830', change: '-1.8%' },\n { month: 'December', revenue: '$247,290', change: '+9.6%' },\n ],\n ),\n ]),\n widget('widget-orders', 'Recent orders', [\n table(\n 'orders-table',\n [\n { field: 'reference', header: 'Reference' },\n { field: 'customer', header: 'Customer' },\n { field: 'total', header: 'Total' },\n { field: 'status', header: 'Status' },\n ],\n [\n { reference: 'ORD-4192', customer: 'Northwind Traders', total: '$1,240.00', status: 'Shipped' },\n { reference: 'ORD-4191', customer: 'Contoso Ltd', total: '$318.50', status: 'Packing' },\n { reference: 'ORD-4188', customer: 'Fabrikam', total: '$2,980.00', status: 'Awaiting payment' },\n { reference: 'ORD-4184', customer: 'Adventure Works', total: '$76.20', status: 'Shipped' },\n ],\n ),\n ]),\n ],\n [TemplateSlotName.Secondary]: [\n widget('widget-activity', 'Activity', [externalComponent('activity-timeline', 'timeline', { align: 'left' })]),\n widget('widget-capacity', 'Warehouse capacity', [externalComponent('capacity-bar', 'progressBar', { value: 68 })]),\n ],\n },\n displayName: 'Dashboard',\n description: 'Four stat cards over two columns of widgets - the composition every template line opens with.',\n metadata: { ...sakaiCompositionProvenance },\n};\n\n/** The list: a filter toolbar, a real table, and the row actions a list needs. */\nexport const crudListTemplate: ScreenTemplate = {\n name: 'CrudList',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Toolbar]: [\n pageHeader('crud-header', 'Products', '412 products across 9 categories', [\n button('crud-new', 'New product', { severity: 'primary', icon: 'pi pi-plus' }),\n button('crud-import', 'Import', { severity: 'secondary', icon: 'pi pi-upload' }),\n ]),\n externalComponent('crud-search', 'inputText', { placeholder: 'Search products', ariaLabel: 'Search products' }),\n ],\n [TemplateSlotName.Body]: [\n table(\n 'products-table',\n [\n { field: 'code', header: 'Code' },\n { field: 'name', header: 'Name' },\n { field: 'category', header: 'Category' },\n { field: 'price', header: 'Price' },\n { field: 'stock', header: 'In stock' },\n ],\n [\n { code: 'P-1001', name: 'Bamboo Watch', category: 'Accessories', price: '$65.00', stock: 24 },\n { code: 'P-1002', name: 'Black Watch', category: 'Accessories', price: '$72.00', stock: 61 },\n { code: 'P-1003', name: 'Blue Band', category: 'Fitness', price: '$79.00', stock: 2 },\n { code: 'P-1004', name: 'Blue T-Shirt', category: 'Clothing', price: '$29.00', stock: 25 },\n { code: 'P-1005', name: 'Bracelet', category: 'Accessories', price: '$15.00', stock: 73 },\n ],\n ),\n ],\n },\n displayName: 'List',\n description: 'A searchable table with a header, primary action and row data.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The detail: a summary panel beside the record's own sections. */\nexport const detailViewTemplate: ScreenTemplate = {\n name: 'DetailView',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n content: {\n [TemplateSlotName.Header]: [\n pageHeader('detail-header', 'Bamboo Watch', 'P-1001 · Accessories', [\n button('detail-edit', 'Edit', { severity: 'primary', icon: 'pi pi-pencil' }),\n button('detail-archive', 'Archive', { severity: 'secondary', icon: 'pi pi-inbox' }),\n ]),\n ],\n [TemplateSlotName.Body]: [\n widget('detail-description', 'Description', [\n text('detail-description-text', 'A bamboo-cased watch with a sapphire face and a recycled steel strap.'),\n ]),\n widget('detail-history', 'Price history', [externalComponent('detail-history-timeline', 'timeline', { align: 'left' })]),\n ],\n [TemplateSlotName.SidePanel]: [\n widget('detail-summary', 'Summary', [\n text('detail-stock', 'In stock: 24'),\n text('detail-reserved', 'Reserved: 3'),\n externalComponent('detail-status', 'tag', { value: 'Active', severity: 'success' }),\n ]),\n ],\n },\n displayName: 'Detail',\n description: 'One record: a header with actions, its sections, and a summary panel.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/**\n * Master/detail: the list and the selected record side by side, so working through records does not mean\n * leaving the list. The detail region is an outlet that accepts detail screens, which is what lets a row's\n * destination open a full detail screen in place.\n *\n * At a compact width the two stack, list first, because side-by-side on a phone is two unreadable halves.\n */\nexport const masterDetailTemplate: ScreenTemplate = {\n name: 'MasterDetail',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Primary }, { name: TemplateSlotName.SidePanel }],\n outlets: [{ name: 'master-detail.detail', description: 'The selected record.', accepts: ['Detail'] }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), grid([slotLeaf(TemplateSlotName.Primary), slotLeaf(TemplateSlotName.SidePanel)], 2, 16)], 16),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Primary), slotLeaf(TemplateSlotName.SidePanel)], 16),\n },\n ],\n },\n content: {\n [TemplateSlotName.Header]: [pageHeader('master-header', 'Customers', '1,204 customers, 38 with overdue invoices')],\n [TemplateSlotName.Primary]: [\n table(\n 'customers-table',\n [\n { field: 'name', header: 'Customer' },\n { field: 'city', header: 'City' },\n { field: 'balance', header: 'Balance' },\n ],\n [\n { name: 'Northwind Traders', city: 'Seattle', balance: '$4,200.00' },\n { name: 'Contoso Ltd', city: 'Oslo', balance: '$0.00' },\n { name: 'Fabrikam', city: 'Lyon', balance: '$12,940.50' },\n { name: 'Adventure Works', city: 'Denver', balance: '$318.20' },\n ],\n 'No customers match the search',\n ),\n ],\n [TemplateSlotName.SidePanel]: [\n widget('customer-detail', 'Northwind Traders', [\n text('customer-contact', 'Contact: Amelia Nyquist'),\n text('customer-terms', 'Payment terms: 30 days'),\n externalComponent('customer-status', 'tag', { value: 'Overdue', severity: 'warning' }),\n button('customer-open', 'Open customer', { severity: 'primary' }),\n ]),\n ],\n },\n displayName: 'Master/detail',\n description: 'A list beside the selected record, stacking on narrow screens.',\n metadata: { ...defaultBlueprintTemplateProvenance, type: 'Workspace' },\n};\n\n/** The form: fields, grouped, with the actions that close them. */\nexport const formPageTemplate: ScreenTemplate = {\n name: 'FormPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [pageHeader('form-header', 'New product', 'Everything marked with an asterisk is required')],\n [TemplateSlotName.Body]: [\n card('form-card', [\n field('form-name', 'Name', 'inputText', { placeholder: 'Bamboo Watch' }),\n field('form-code', 'Code', 'inputText', { placeholder: 'P-1001' }),\n field('form-category', 'Category', 'dropdown', { options: ['Accessories', 'Clothing', 'Fitness'] }),\n field('form-price', 'Price', 'inputNumber', { mode: 'currency', currency: 'USD' }),\n field('form-available', 'Available from', 'calendar', {}),\n field('form-notes', 'Notes', 'inputTextarea', { rows: 4 }),\n ]),\n ],\n [TemplateSlotName.Actions]: [formActions('form-actions', 'Create product')],\n },\n displayName: 'Form',\n description: 'A grouped form with the field types an application actually uses.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The empty state: what a list looks like before anything exists, designed rather than apologized for. */\nexport const emptyTemplate: ScreenTemplate = {\n name: 'Empty',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n emptyState('empty-state', 'No products yet', 'Products you create will show up here, with their stock and pricing.', 'Create the first product'),\n ],\n },\n displayName: 'Empty state',\n description: 'The designed empty state for a list that has nothing in it yet.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The five workspace templates. */\nexport const workspaceTemplates: ScreenTemplate[] = [dashboardTemplate, crudListTemplate, masterDetailTemplate, detailViewTemplate, formPageTemplate, emptyTemplate];\n"],"names":["dashboardTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Stats","Primary","Secondary","arrangement","root","column","slotLeaf","grid","span","overrides","width","WidthSizeClass","Compact","content","statCard","widget","table","field","header","month","revenue","change","reference","customer","total","status","externalComponent","align","value","displayName","description","metadata","sakaiCompositionProvenance","crudListTemplate","Toolbar","Body","pageHeader","button","severity","icon","placeholder","ariaLabel","code","category","price","stock","defaultBlueprintTemplateProvenance","detailViewTemplate","Header","SidePanel","text","masterDetailTemplate","outlets","accepts","city","balance","type","formPageTemplate","Actions","card","options","mode","currency","rows","formActions","emptyTemplate","emptyState","workspaceTemplates"],"mappings":";;;;;;;;;;;;;AAAA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BAAA;AAAkB;AAC/E,KAAA;IACAnC,WAAAA,EAAa,MAAA;IACbC,WAAAA,EAAa,mEAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGe;AAAmC;AACtD;AAEA,4GACO,MAAMmB,aAAAA,GAAgC;IACzCvE,IAAAA,EAAM,OAAA;AACNC,IAAAA,QAAAA,EAAUC,kBAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,kCAAiBoC;AAAK;AAAE,KAAA;IACxCtB,OAAAA,EAAS;QACL,CAACd,iCAAAA,CAAiBoC,IAAI,GAAG;YACrB+B,kBAAAA,CAAW,aAAA,EAAe,mBAAmB,sEAAA,EAAwE,0BAAA;AACxH;AACL,KAAA;IACArC,WAAAA,EAAa,aAAA;IACbC,WAAAA,EAAa,iEAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGe;AAAmC;AACtD;AAEA,qCACO,MAAMqB,kBAAAA,GAAuC;AAAC1E,IAAAA,iBAAAA;AAAmBwC,IAAAA,gBAAAA;AAAkBkB,IAAAA,oBAAAA;AAAsBJ,IAAAA,kBAAAA;AAAoBU,IAAAA,gBAAAA;AAAkBQ,IAAAA;;;;;;;;;"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -34,6 +34,8 @@ var componentNames = require('./gallery/componentNames.js');
|
|
|
34
34
|
var previewProfile = require('./gallery/previewProfile.js');
|
|
35
35
|
var resolveElementNames = require('./gallery/resolveElementNames.js');
|
|
36
36
|
var GalleryScreenPreview = require('./gallery/GalleryScreenPreview.js');
|
|
37
|
+
var TemplatePreviewState = require('./gallery/TemplatePreviewState.js');
|
|
38
|
+
var applyTemplatePreviewState = require('./gallery/applyTemplatePreviewState.js');
|
|
37
39
|
var elementProperties = require('./shell/elementProperties.js');
|
|
38
40
|
var ThemeOption = require('./shell/ThemeOption.js');
|
|
39
41
|
var AppShell = require('./shell/AppShell.js');
|
|
@@ -147,6 +149,7 @@ exports.dashboardTemplate = workspaceTemplates.dashboardTemplate;
|
|
|
147
149
|
exports.detailViewTemplate = workspaceTemplates.detailViewTemplate;
|
|
148
150
|
exports.emptyTemplate = workspaceTemplates.emptyTemplate;
|
|
149
151
|
exports.formPageTemplate = workspaceTemplates.formPageTemplate;
|
|
152
|
+
exports.masterDetailTemplate = workspaceTemplates.masterDetailTemplate;
|
|
150
153
|
exports.workspaceTemplates = workspaceTemplates.workspaceTemplates;
|
|
151
154
|
exports.documentationTemplate = supportTemplates.documentationTemplate;
|
|
152
155
|
exports.helpTemplate = supportTemplates.helpTemplate;
|
|
@@ -184,6 +187,10 @@ exports.galleryProfile = previewProfile.galleryProfile;
|
|
|
184
187
|
exports.resolveElementComponentNames = resolveElementNames.resolveElementComponentNames;
|
|
185
188
|
exports.GalleryScreenPreview = GalleryScreenPreview.GalleryScreenPreview;
|
|
186
189
|
exports.galleryPreviewRegistry = GalleryScreenPreview.galleryPreviewRegistry;
|
|
190
|
+
exports.TemplatePreviewState = TemplatePreviewState.TemplatePreviewState;
|
|
191
|
+
exports.applyTemplatePreviewState = applyTemplatePreviewState.applyTemplatePreviewState;
|
|
192
|
+
exports.hasPreviewData = applyTemplatePreviewState.hasPreviewData;
|
|
193
|
+
exports.previewErrorMessage = applyTemplatePreviewState.previewErrorMessage;
|
|
187
194
|
exports.readBoolean = elementProperties.readBoolean;
|
|
188
195
|
exports.readNumber = elementProperties.readNumber;
|
|
189
196
|
exports.readOptionalString = elementProperties.readOptionalString;
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -17,6 +17,7 @@ export default meta;
|
|
|
17
17
|
type Story = StoryObj<typeof meta>;
|
|
18
18
|
export declare const Dashboard: Story;
|
|
19
19
|
export declare const List: Story;
|
|
20
|
+
export declare const MasterDetail: Story;
|
|
20
21
|
export declare const Detail: Story;
|
|
21
22
|
export declare const Form: Story;
|
|
22
23
|
export declare const Empty: Story;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationScreens.stories.d.ts","sourceRoot":"","sources":["../../../gallery/ApplicationScreens.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAU9D,QAAA,MAAM,IAAI;;;;QAIF,MAAM;QACN,IAAI;YACA,WAAW;gBACP,SAAS;;;;;CAKoB,CAAC;eAE/B,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,SAAS,EAAE,KAA6C,CAAC;AAGtE,eAAO,MAAM,IAAI,EAAE,KAA4C,CAAC;AAGhE,eAAO,MAAM,MAAM,EAAE,KAA8C,CAAC;AAGpE,eAAO,MAAM,IAAI,EAAE,KAA4C,CAAC;AAGhE,eAAO,MAAM,KAAK,EAAE,KAAyC,CAAC;AAG9D,eAAO,MAAM,aAAa,EAAE,KAAiD,CAAC;AAG9E,eAAO,MAAM,eAAe,EAAE,KAAmD,CAAC;AAGlF,eAAO,MAAM,cAAc,EAAE,KAAkD,CAAC;AAGhF,eAAO,MAAM,OAAO,EAAE,KAA2C,CAAC;AAGlE,eAAO,MAAM,IAAI,EAAE,KAAwC,CAAC;AAG5D,eAAO,MAAM,eAAe,EAAE,KAAmD,CAAC;AAGlF,eAAO,MAAM,cAAc,EAAE,KAAkD,CAAC;AAGhF,eAAO,MAAM,YAAY,EAAE,KAAgD,CAAC"}
|
|
1
|
+
{"version":3,"file":"ApplicationScreens.stories.d.ts","sourceRoot":"","sources":["../../../gallery/ApplicationScreens.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAU9D,QAAA,MAAM,IAAI;;;;QAIF,MAAM;QACN,IAAI;YACA,WAAW;gBACP,SAAS;;;;;CAKoB,CAAC;eAE/B,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,SAAS,EAAE,KAA6C,CAAC;AAGtE,eAAO,MAAM,IAAI,EAAE,KAA4C,CAAC;AAGhE,eAAO,MAAM,YAAY,EAAE,KAAgD,CAAC;AAG5E,eAAO,MAAM,MAAM,EAAE,KAA8C,CAAC;AAGpE,eAAO,MAAM,IAAI,EAAE,KAA4C,CAAC;AAGhE,eAAO,MAAM,KAAK,EAAE,KAAyC,CAAC;AAG9D,eAAO,MAAM,aAAa,EAAE,KAAiD,CAAC;AAG9E,eAAO,MAAM,eAAe,EAAE,KAAmD,CAAC;AAGlF,eAAO,MAAM,cAAc,EAAE,KAAkD,CAAC;AAGhF,eAAO,MAAM,OAAO,EAAE,KAA2C,CAAC;AAGlE,eAAO,MAAM,IAAI,EAAE,KAAwC,CAAC;AAG5D,eAAO,MAAM,eAAe,EAAE,KAAmD,CAAC;AAGlF,eAAO,MAAM,cAAc,EAAE,KAAkD,CAAC;AAGhF,eAAO,MAAM,YAAY,EAAE,KAAgD,CAAC"}
|
|
@@ -6,7 +6,7 @@ const meta = {
|
|
|
6
6
|
layout: 'fullscreen',
|
|
7
7
|
docs: {
|
|
8
8
|
description: {
|
|
9
|
-
component: 'The
|
|
9
|
+
component: 'The eleven in-application screen templates plus the three-level nesting chain, each booted through the real engine as a screen.',
|
|
10
10
|
},
|
|
11
11
|
},
|
|
12
12
|
},
|
|
@@ -15,6 +15,7 @@ const meta = {
|
|
|
15
15
|
export default meta;
|
|
16
16
|
export const Dashboard = { args: { screenName: 'Dashboard' } };
|
|
17
17
|
export const List = { args: { screenName: 'CrudList' } };
|
|
18
|
+
export const MasterDetail = { args: { screenName: 'MasterDetail' } };
|
|
18
19
|
export const Detail = { args: { screenName: 'DetailView' } };
|
|
19
20
|
export const Form = { args: { screenName: 'FormPage' } };
|
|
20
21
|
export const Empty = { args: { screenName: 'Empty' } };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationScreens.stories.js","sourceRoot":"","sources":["../../../gallery/ApplicationScreens.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAU9D,MAAM,IAAI,GAAG;IACT,KAAK,EAAE,+BAA+B;IACtC,SAAS,EAAE,oBAAoB;IAC/B,UAAU,EAAE;QACR,MAAM,EAAE,YAAY;QACpB,IAAI,EAAE;YACF,WAAW,EAAE;gBACT,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"ApplicationScreens.stories.js","sourceRoot":"","sources":["../../../gallery/ApplicationScreens.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAU9D,MAAM,IAAI,GAAG;IACT,KAAK,EAAE,+BAA+B;IACtC,SAAS,EAAE,oBAAoB;IAC/B,UAAU,EAAE;QACR,MAAM,EAAE,YAAY;QACpB,IAAI,EAAE;YACF,WAAW,EAAE;gBACT,SAAS,EAAE,iIAAiI;aAC/I;SACJ;KACJ;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;CACuB,CAAC;AAE9C,eAAe,IAAI,CAAC;AAKpB,MAAM,CAAC,MAAM,SAAS,GAAU,EAAE,IAAI,EAAE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AM,CAAC,MAAM,YAAY,GAAU,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { Theme } from '@cratis/scene.model';
|
|
2
2
|
import { ComponentRegistry } from '@cratis/scene.react';
|
|
3
3
|
import { LayoutConfigState } from '../configuration';
|
|
4
|
+
import { TemplatePreviewState } from './TemplatePreviewState';
|
|
4
5
|
export declare const galleryPreviewRegistry: ComponentRegistry;
|
|
5
6
|
export interface GalleryScreenPreviewProps {
|
|
6
7
|
screenName: string;
|
|
7
8
|
initialConfig?: Partial<LayoutConfigState>;
|
|
8
9
|
themes?: Theme[];
|
|
9
10
|
registry?: ComponentRegistry;
|
|
11
|
+
state?: TemplatePreviewState;
|
|
10
12
|
}
|
|
11
|
-
export declare function GalleryScreenPreview({ screenName, initialConfig, themes, registry }: GalleryScreenPreviewProps): import("react").JSX.Element;
|
|
13
|
+
export declare function GalleryScreenPreview({ screenName, initialConfig, themes, registry, state }: GalleryScreenPreviewProps): import("react").JSX.Element;
|
|
12
14
|
//# sourceMappingURL=GalleryScreenPreview.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryScreenPreview.d.ts","sourceRoot":"","sources":["../../../gallery/GalleryScreenPreview.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAoC,MAAM,qBAAqB,CAAC;AAC1F,OAAO,EAAwB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"GalleryScreenPreview.d.ts","sourceRoot":"","sources":["../../../gallery/GalleryScreenPreview.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAoC,MAAM,qBAAqB,CAAC;AAC1F,OAAO,EAAwB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAO3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAU9D,eAAO,MAAM,sBAAsB,EAAE,iBAAwE,CAAC;AAE9G,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;CAChC;AAeD,wBAAgB,oBAAoB,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,MAA+B,EAAE,QAAiC,EAAE,KAAsC,EAAE,EAAE,yBAAyB,+BAiBxM"}
|
|
@@ -9,6 +9,8 @@ import { composeScreenElement } from './composeScreen.js';
|
|
|
9
9
|
import { galleryComponentCatalog, galleryPreviewProfile } from './previewProfile.js';
|
|
10
10
|
import { resolveElementComponentNames } from './resolveElementNames.js';
|
|
11
11
|
import { galleryScreen } from './screens.js';
|
|
12
|
+
import { TemplatePreviewState } from './TemplatePreviewState.js';
|
|
13
|
+
import { applyTemplatePreviewState } from './applyTemplatePreviewState.js';
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* The registry a preview resolves against when a host does not supply one: `core` plus this blueprint.
|
|
@@ -32,15 +34,16 @@ import { galleryScreen } from './screens.js';
|
|
|
32
34
|
* come out as `UnresolvedComponent`'s dashed red box naming what is missing. That is the designed outcome:
|
|
33
35
|
* a preview of a blueprint against half a profile should look visibly incomplete rather than quietly
|
|
34
36
|
* wrong.
|
|
35
|
-
*/ function GalleryScreenPreview({ screenName, initialConfig, themes = defaultBlueprintThemes, registry = galleryPreviewRegistry }) {
|
|
37
|
+
*/ function GalleryScreenPreview({ screenName, initialConfig, themes = defaultBlueprintThemes, registry = galleryPreviewRegistry, state = TemplatePreviewState.Populated }) {
|
|
36
38
|
const element = useMemo(()=>{
|
|
37
39
|
const screen = galleryScreen(screenName);
|
|
38
40
|
if (!screen) {
|
|
39
41
|
throw new Error(`The gallery has no screen named '${screenName}'.`);
|
|
40
42
|
}
|
|
41
|
-
return resolveElementComponentNames(composeScreenElement(screen), galleryPreviewProfile, galleryComponentCatalog);
|
|
43
|
+
return applyTemplatePreviewState(resolveElementComponentNames(composeScreenElement(screen), galleryPreviewProfile, galleryComponentCatalog), state);
|
|
42
44
|
}, [
|
|
43
|
-
screenName
|
|
45
|
+
screenName,
|
|
46
|
+
state
|
|
44
47
|
]);
|
|
45
48
|
return /*#__PURE__*/ jsx(LayoutConfigProvider, {
|
|
46
49
|
initialConfig: initialConfig,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryScreenPreview.js","sources":["../../../gallery/GalleryScreenPreview.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport { Theme } from '@cratis/scene.model';\nimport { ComponentRegistry, SceneElementView, coreComponents } from '@cratis/scene.react';\nimport { LayoutConfigProvider, LayoutConfigState } from '../configuration';\nimport { defaultBlueprintComponents } from '../defaultBlueprintComponents';\nimport { LayoutThemeProvider, defaultBlueprintThemes } from '../themes';\nimport { composeScreenElement } from './composeScreen';\nimport { galleryComponentCatalog, galleryPreviewProfile } from './previewProfile';\nimport { resolveElementComponentNames } from './resolveElementNames';\nimport { galleryScreen } from './screens';\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\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 }: GalleryScreenPreviewProps) {\n const element = useMemo(() => {\n const screen = galleryScreen(screenName);\n if (!screen) {\n throw new Error(`The gallery has no screen named '${screenName}'.`);\n }\n\n return resolveElementComponentNames(composeScreenElement(screen), galleryPreviewProfile, galleryComponentCatalog);\n }, [screenName]);\n\n return (\n <LayoutConfigProvider initialConfig={initialConfig} storage={null}>\n <LayoutThemeProvider themes={themes}>\n <SceneElementView element={element} registry={registry} resolveBinding={() => undefined} />\n </LayoutThemeProvider>\n </LayoutConfigProvider>\n );\n}\n"],"names":["galleryPreviewRegistry","coreComponents","defaultBlueprintComponents","GalleryScreenPreview","screenName","initialConfig","themes","defaultBlueprintThemes","registry","element","useMemo","screen","galleryScreen","Error","resolveElementComponentNames","composeScreenElement","galleryPreviewProfile","galleryComponentCatalog","_jsx","LayoutConfigProvider","storage","LayoutThemeProvider","SceneElementView","resolveBinding","undefined"],"mappings":"
|
|
1
|
+
{"version":3,"file":"GalleryScreenPreview.js","sources":["../../../gallery/GalleryScreenPreview.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport { Theme } from '@cratis/scene.model';\nimport { ComponentRegistry, SceneElementView, coreComponents } from '@cratis/scene.react';\nimport { LayoutConfigProvider, LayoutConfigState } from '../configuration';\nimport { defaultBlueprintComponents } from '../defaultBlueprintComponents';\nimport { LayoutThemeProvider, defaultBlueprintThemes } from '../themes';\nimport { composeScreenElement } from './composeScreen';\nimport { galleryComponentCatalog, galleryPreviewProfile } from './previewProfile';\nimport { resolveElementComponentNames } from './resolveElementNames';\nimport { galleryScreen } from './screens';\nimport { TemplatePreviewState } from './TemplatePreviewState';\nimport { applyTemplatePreviewState } from './applyTemplatePreviewState';\n\n/**\n * The registry a preview resolves against when a host does not supply one: `core` plus this blueprint.\n *\n * Merged by hand rather than through `mergePackageRegistries`, because reaching for this blueprint's\n * *bundle* here would be circular - the bundle is assembled from the gallery this file belongs to. Registry\n * keys carry their package name, so merge order cannot cause a collision either way.\n */\nexport const galleryPreviewRegistry: ComponentRegistry = { ...coreComponents, ...defaultBlueprintComponents };\n\nexport interface GalleryScreenPreviewProps {\n /** The name of the gallery screen to boot. */\n screenName: string;\n\n /** Configuration to start from - a story pinning a mode, or a host restoring a session. */\n initialConfig?: Partial<LayoutConfigState>;\n\n /** The themes the configurator may switch between. Defaults to the two this blueprint ships. */\n themes?: Theme[];\n\n /** The component registry to render against. Defaults to `core` plus this blueprint's own components. */\n registry?: ComponentRegistry;\n\n /** The data state to show. Defaults to the seeded, populated records. */\n state?: TemplatePreviewState;\n}\n\n/**\n * Boots one gallery screen through the real engine.\n *\n * Nothing here is a preview-only path: the screen is a real {@link Screen}, its element tree is resolved by\n * the real `resolveComponentName`, and it is rendered by the real `SceneElementView` against the real\n * registry. That is the point of shipping a gallery at all - a mockup proves that someone can draw a\n * dashboard, and this proves the blueprint renders one.\n *\n * Component names belonging to packages the host has not loaded resolve but find no implementation, and\n * come out as `UnresolvedComponent`'s dashed red box naming what is missing. That is the designed outcome:\n * a preview of a blueprint against half a profile should look visibly incomplete rather than quietly\n * wrong.\n */\nexport function GalleryScreenPreview({ screenName, initialConfig, themes = defaultBlueprintThemes, registry = galleryPreviewRegistry, state = TemplatePreviewState.Populated }: GalleryScreenPreviewProps) {\n const element = useMemo(() => {\n const screen = galleryScreen(screenName);\n if (!screen) {\n throw new Error(`The gallery has no screen named '${screenName}'.`);\n }\n\n return applyTemplatePreviewState(resolveElementComponentNames(composeScreenElement(screen), galleryPreviewProfile, galleryComponentCatalog), state);\n }, [screenName, state]);\n\n return (\n <LayoutConfigProvider initialConfig={initialConfig} storage={null}>\n <LayoutThemeProvider themes={themes}>\n <SceneElementView element={element} registry={registry} resolveBinding={() => undefined} />\n </LayoutThemeProvider>\n </LayoutConfigProvider>\n );\n}\n"],"names":["galleryPreviewRegistry","coreComponents","defaultBlueprintComponents","GalleryScreenPreview","screenName","initialConfig","themes","defaultBlueprintThemes","registry","state","TemplatePreviewState","Populated","element","useMemo","screen","galleryScreen","Error","applyTemplatePreviewState","resolveElementComponentNames","composeScreenElement","galleryPreviewProfile","galleryComponentCatalog","_jsx","LayoutConfigProvider","storage","LayoutThemeProvider","SceneElementView","resolveBinding","undefined"],"mappings":";;;;;;;;;;;;;;AAgBA;;;;;;UAOaA,sBAAAA,GAA4C;AAAE,IAAA,GAAGC,cAAc;AAAE,IAAA,GAAGC;AAA2B;AAmB5G;;;;;;;;;;;;AAYC,IACM,SAASC,oBAAAA,CAAqB,EAAEC,UAAU,EAAEC,aAAa,EAAEC,MAAAA,GAASC,sBAAsB,EAAEC,QAAAA,GAAWR,sBAAsB,EAAES,KAAAA,GAAQC,oBAAAA,CAAqBC,SAAS,EAA6B,EAAA;AACrM,IAAA,MAAMC,UAAUC,OAAAA,CAAQ,IAAA;AACpB,QAAA,MAAMC,SAASC,aAAAA,CAAcX,UAAAA,CAAAA;AAC7B,QAAA,IAAI,CAACU,MAAAA,EAAQ;AACT,YAAA,MAAM,IAAIE,KAAAA,CAAM,CAAC,iCAAiC,EAAEZ,UAAAA,CAAW,EAAE,CAAC,CAAA;AACtE,QAAA;AAEA,QAAA,OAAOa,yBAAAA,CAA0BC,4BAAAA,CAA6BC,oBAAAA,CAAqBL,MAAAA,CAAAA,EAASM,uBAAuBC,uBAAAA,CAAAA,EAA0BZ,KAAAA,CAAAA;IACjJ,CAAA,EAAG;AAACL,QAAAA,UAAAA;AAAYK,QAAAA;AAAM,KAAA,CAAA;AAEtB,IAAA,qBACIa,GAAA,CAACC,oBAAAA,EAAAA;QAAqBlB,aAAAA,EAAeA,aAAAA;QAAemB,OAAAA,EAAS,IAAA;AACzD,QAAA,QAAA,gBAAAF,GAAA,CAACG,mBAAAA,EAAAA;YAAoBnB,MAAAA,EAAQA,MAAAA;AACzB,YAAA,QAAA,gBAAAgB,GAAA,CAACI,gBAAAA,EAAAA;gBAAiBd,OAAAA,EAASA,OAAAA;gBAASJ,QAAAA,EAAUA,QAAAA;AAAUmB,gBAAAA,cAAAA,EAAgB,IAAMC;;;;AAI9F;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { GalleryScreenPreview } from './GalleryScreenPreview';
|
|
3
|
+
import { TemplatePreviewState } from './TemplatePreviewState';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: typeof GalleryScreenPreview;
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
args: {
|
|
16
|
+
registry: import("@cratis/scene.react").ComponentRegistry;
|
|
17
|
+
};
|
|
18
|
+
argTypes: {
|
|
19
|
+
state: {
|
|
20
|
+
control: "select";
|
|
21
|
+
options: TemplatePreviewState[];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
tags: string[];
|
|
25
|
+
};
|
|
26
|
+
export default meta;
|
|
27
|
+
type Story = StoryObj<typeof meta>;
|
|
28
|
+
export declare const ListPopulated: Story;
|
|
29
|
+
export declare const ListEmpty: Story;
|
|
30
|
+
export declare const ListLoading: Story;
|
|
31
|
+
export declare const ListError: Story;
|
|
32
|
+
export declare const MasterDetailPopulated: Story;
|
|
33
|
+
export declare const MasterDetailLoading: Story;
|
|
34
|
+
export declare const DashboardError: Story;
|
|
35
|
+
export declare const UsersEmpty: Story;
|
|
36
|
+
//# sourceMappingURL=PreviewStates.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreviewStates.stories.d.ts","sourceRoot":"","sources":["../../../gallery/PreviewStates.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAS9D,QAAA,MAAM,IAAI;;;;QAIF,MAAM;QACN,IAAI;YAAI,WAAW;gBAAI,SAAS;;;;;;;;;;;;;;CAKK,CAAC;eAE/B,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,aAAa,EAAE,KAAmF,CAAC;AAGhH,eAAO,MAAM,SAAS,EAAE,KAA+E,CAAC;AAGxG,eAAO,MAAM,WAAW,EAAE,KAAiF,CAAC;AAG5G,eAAO,MAAM,SAAS,EAAE,KAA+E,CAAC;AAGxG,eAAO,MAAM,qBAAqB,EAAE,KAAuF,CAAC;AAG5H,eAAO,MAAM,mBAAmB,EAAE,KAAqF,CAAC;AAGxH,eAAO,MAAM,cAAc,EAAE,KAAgF,CAAC;AAG9G,eAAO,MAAM,UAAU,EAAE,KAAqF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { corePackage, mergePackageRegistries } from '@cratis/scene.react';
|
|
2
|
+
import { primeReactPackage } from '@cratis/scene.primereact';
|
|
3
|
+
import { defaultBlueprint } from '../defaultBlueprint';
|
|
4
|
+
import { GalleryScreenPreview } from './GalleryScreenPreview';
|
|
5
|
+
import { TemplatePreviewState } from './TemplatePreviewState';
|
|
6
|
+
const registry = mergePackageRegistries([corePackage, primeReactPackage, defaultBlueprint]);
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Blueprint/Preview states',
|
|
9
|
+
component: GalleryScreenPreview,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'fullscreen',
|
|
12
|
+
docs: { description: { component: 'Populated, empty, loading and error states of the data templates, through the real packages.' } },
|
|
13
|
+
},
|
|
14
|
+
args: { registry },
|
|
15
|
+
argTypes: { state: { control: 'select', options: Object.values(TemplatePreviewState) } },
|
|
16
|
+
tags: ['autodocs'],
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
export const ListPopulated = { args: { screenName: 'CrudList', state: TemplatePreviewState.Populated } };
|
|
20
|
+
export const ListEmpty = { args: { screenName: 'CrudList', state: TemplatePreviewState.Empty } };
|
|
21
|
+
export const ListLoading = { args: { screenName: 'CrudList', state: TemplatePreviewState.Loading } };
|
|
22
|
+
export const ListError = { args: { screenName: 'CrudList', state: TemplatePreviewState.Error } };
|
|
23
|
+
export const MasterDetailPopulated = { args: { screenName: 'MasterDetail', state: TemplatePreviewState.Populated } };
|
|
24
|
+
export const MasterDetailLoading = { args: { screenName: 'MasterDetail', state: TemplatePreviewState.Loading } };
|
|
25
|
+
export const DashboardError = { args: { screenName: 'Dashboard', state: TemplatePreviewState.Error } };
|
|
26
|
+
export const UsersEmpty = { args: { screenName: 'UserManagement', state: TemplatePreviewState.Empty } };
|
|
27
|
+
//# sourceMappingURL=PreviewStates.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreviewStates.stories.js","sourceRoot":"","sources":["../../../gallery/PreviewStates.stories.tsx"],"names":[],"mappings":"AAIA,O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M,CAAC,MAAM,SAAS,GAAU,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,oBAAoB,CAAC,KAAK,EAAE,EAAE,CAAC;AAGxG,MAAM,CAAC,MAAM,qBAAqB,GAAU,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,oBAAoB,CAAC,SAAS,EAAE,EAAE,CAAC;AAG5H,MAAM,CAAC,MAAM,mBAAmB,GAAU,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,oBAAoB,CAAC,OAAO,EAAE,EAAE,CAAC;AAGxH,MAAM,CAAC,MAAM,cAAc,GAAU,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,oBAAoB,CAAC,KAAK,EAAE,EAAE,CAAC;AAG9G,MAAM,CAAC,MAAM,UAAU,GAAU,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,oBAAoB,CAAC,KAAK,EAAE,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplatePreviewState.d.ts","sourceRoot":"","sources":["../../../gallery/TemplatePreviewState.ts"],"names":[],"mappings":"AAOA,oBAAY,oBAAoB;IAE5B,SAAS,cAAc;IAGvB,KAAK,UAAU;IAGf,OAAO,YAAY;IAGnB,KAAK,UAAU;CAClB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/**
|
|
4
|
+
* The data states a template preview can show. A template is only worth choosing if it looks right in all
|
|
5
|
+
* four, because an application spends real time in each of them.
|
|
6
|
+
*/ var TemplatePreviewState = /*#__PURE__*/ function(TemplatePreviewState) {
|
|
7
|
+
/** The seeded, realistic records. */ TemplatePreviewState["Populated"] = "populated";
|
|
8
|
+
/** The query returned nothing; each table shows its empty message. */ TemplatePreviewState["Empty"] = "empty";
|
|
9
|
+
/** The query has not answered yet; each table announces that it is loading. */ TemplatePreviewState["Loading"] = "loading";
|
|
10
|
+
/** The query failed; each table announces the error in place of its rows. */ TemplatePreviewState["Error"] = "error";
|
|
11
|
+
return TemplatePreviewState;
|
|
12
|
+
}({});
|
|
13
|
+
|
|
14
|
+
export { TemplatePreviewState };
|
|
15
|
+
//# sourceMappingURL=TemplatePreviewState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplatePreviewState.js","sources":["../../../gallery/TemplatePreviewState.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\n/**\n * The data states a template preview can show. A template is only worth choosing if it looks right in all\n * four, because an application spends real time in each of them.\n */\nexport enum TemplatePreviewState {\n /** The seeded, realistic records. */\n Populated = 'populated',\n\n /** The query returned nothing; each table shows its empty message. */\n Empty = 'empty',\n\n /** The query has not answered yet; each table announces that it is loading. */\n Loading = 'loading',\n\n /** The query failed; each table announces the error in place of its rows. */\n Error = 'error',\n}\n"],"names":["TemplatePreviewState"],"mappings":"AAAA;AACA;AAEA;;;IAIO,IAAKA,oBAAAA,iBAAAA,SAAAA,oBAAAA,EAAAA;0CAC2B,oBAAA,CAAA,WAAA,CAAA,GAAA,WAAA;2EAGiC,oBAAA,CAAA,OAAA,CAAA,GAAA,OAAA;oFAGS,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAA;kFAGF,oBAAA,CAAA,OAAA,CAAA,GAAA,OAAA;AAVnEA,IAAAA,OAAAA,oBAAAA;AAYX,CAAA,CAAA,EAAA;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SceneElement } from '@cratis/scene.model';
|
|
2
|
+
import { TemplatePreviewState } from './TemplatePreviewState';
|
|
3
|
+
export declare const previewErrorMessage = "The data could not be loaded. Try again in a moment.";
|
|
4
|
+
export declare function applyTemplatePreviewState<T extends SceneElement>(element: T, state: TemplatePreviewState): T;
|
|
5
|
+
export declare function hasPreviewData(element: SceneElement): boolean;
|
|
6
|
+
//# sourceMappingURL=applyTemplatePreviewState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyTemplatePreviewState.d.ts","sourceRoot":"","sources":["../../../gallery/applyTemplatePreviewState.ts"],"names":[],"mappings":"AAGA,OAAO,EAA4B,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,eAAO,MAAM,mBAAmB,yDAAyD,CAAC;AAU1F,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,YAAY,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,oBAAoB,GAAG,CAAC,CAG5G;AAGD,wBAAgB,cAAc,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAI7D"}
|