@cratis/scene.blueprint.invoicing 0.0.0-stage → 4.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/README.md +66 -2
  2. package/blueprint.ts +16 -0
  3. package/blueprintCatalog.json +132 -0
  4. package/dist/cjs/blueprint.js +19 -0
  5. package/dist/cjs/blueprint.js.map +1 -0
  6. package/dist/cjs/index.js +69 -0
  7. package/dist/cjs/index.js.map +1 -0
  8. package/dist/cjs/invoicingApplication.js +49 -0
  9. package/dist/cjs/invoicingApplication.js.map +1 -0
  10. package/dist/cjs/invoicingParts.js +151 -0
  11. package/dist/cjs/invoicingParts.js.map +1 -0
  12. package/dist/cjs/invoicingQueries.js +66 -0
  13. package/dist/cjs/invoicingQueries.js.map +1 -0
  14. package/dist/cjs/invoicingScreenSet.js +47 -0
  15. package/dist/cjs/invoicingScreenSet.js.map +1 -0
  16. package/dist/cjs/manifest.js +87 -0
  17. package/dist/cjs/manifest.js.map +1 -0
  18. package/dist/cjs/navigation.js +117 -0
  19. package/dist/cjs/navigation.js.map +1 -0
  20. package/dist/cjs/package.json +3 -0
  21. package/dist/cjs/packageName.js +8 -0
  22. package/dist/cjs/packageName.js.map +1 -0
  23. package/dist/cjs/screens/index.js +22 -0
  24. package/dist/cjs/screens/index.js.map +1 -0
  25. package/dist/cjs/templateProvenance.js +24 -0
  26. package/dist/cjs/templateProvenance.js.map +1 -0
  27. package/dist/cjs/templates/calendarTemplate.js +109 -0
  28. package/dist/cjs/templates/calendarTemplate.js.map +1 -0
  29. package/dist/cjs/templates/dashboardTemplates.js +153 -0
  30. package/dist/cjs/templates/dashboardTemplates.js.map +1 -0
  31. package/dist/cjs/templates/formTemplates.js +51 -0
  32. package/dist/cjs/templates/formTemplates.js.map +1 -0
  33. package/dist/cjs/templates/index.js +27 -0
  34. package/dist/cjs/templates/index.js.map +1 -0
  35. package/dist/cjs/templates/listTemplates.js +166 -0
  36. package/dist/cjs/templates/listTemplates.js.map +1 -0
  37. package/dist/cjs/templates/recordTemplates.js +144 -0
  38. package/dist/cjs/templates/recordTemplates.js.map +1 -0
  39. package/dist/esm/blueprint.d.ts +3 -0
  40. package/dist/esm/blueprint.d.ts.map +1 -0
  41. package/dist/esm/blueprint.js +17 -0
  42. package/dist/esm/blueprint.js.map +1 -0
  43. package/dist/esm/index.d.ts +12 -0
  44. package/dist/esm/index.d.ts.map +1 -0
  45. package/dist/esm/index.js +18 -0
  46. package/dist/esm/index.js.map +1 -0
  47. package/dist/esm/invoicingApplication.d.ts +10 -0
  48. package/dist/esm/invoicingApplication.d.ts.map +1 -0
  49. package/dist/esm/invoicingApplication.js +44 -0
  50. package/dist/esm/invoicingApplication.js.map +1 -0
  51. package/dist/esm/invoicingParts.d.ts +16 -0
  52. package/dist/esm/invoicingParts.d.ts.map +1 -0
  53. package/dist/esm/invoicingParts.js +133 -0
  54. package/dist/esm/invoicingParts.js.map +1 -0
  55. package/dist/esm/invoicingQueries.d.ts +39 -0
  56. package/dist/esm/invoicingQueries.d.ts.map +1 -0
  57. package/dist/esm/invoicingQueries.js +58 -0
  58. package/dist/esm/invoicingQueries.js.map +1 -0
  59. package/dist/esm/invoicingScreenSet.d.ts +7 -0
  60. package/dist/esm/invoicingScreenSet.d.ts.map +1 -0
  61. package/dist/esm/invoicingScreenSet.js +45 -0
  62. package/dist/esm/invoicingScreenSet.js.map +1 -0
  63. package/dist/esm/manifest.d.ts +3 -0
  64. package/dist/esm/manifest.d.ts.map +1 -0
  65. package/dist/esm/manifest.js +85 -0
  66. package/dist/esm/manifest.js.map +1 -0
  67. package/dist/esm/navigation.d.ts +5 -0
  68. package/dist/esm/navigation.d.ts.map +1 -0
  69. package/dist/esm/navigation.js +113 -0
  70. package/dist/esm/navigation.js.map +1 -0
  71. package/dist/esm/package.json +3 -0
  72. package/dist/esm/packageName.d.ts +2 -0
  73. package/dist/esm/packageName.d.ts.map +1 -0
  74. package/dist/esm/packageName.js +6 -0
  75. package/dist/esm/packageName.js.map +1 -0
  76. package/dist/esm/screens/index.d.ts +3 -0
  77. package/dist/esm/screens/index.d.ts.map +1 -0
  78. package/dist/esm/screens/index.js +20 -0
  79. package/dist/esm/screens/index.js.map +1 -0
  80. package/dist/esm/templateProvenance.d.ts +3 -0
  81. package/dist/esm/templateProvenance.d.ts.map +1 -0
  82. package/dist/esm/templateProvenance.js +22 -0
  83. package/dist/esm/templateProvenance.js.map +1 -0
  84. package/dist/esm/templates/calendarTemplate.d.ts +3 -0
  85. package/dist/esm/templates/calendarTemplate.d.ts.map +1 -0
  86. package/dist/esm/templates/calendarTemplate.js +107 -0
  87. package/dist/esm/templates/calendarTemplate.js.map +1 -0
  88. package/dist/esm/templates/dashboardTemplates.d.ts +3 -0
  89. package/dist/esm/templates/dashboardTemplates.d.ts.map +1 -0
  90. package/dist/esm/templates/dashboardTemplates.js +151 -0
  91. package/dist/esm/templates/dashboardTemplates.js.map +1 -0
  92. package/dist/esm/templates/formTemplates.d.ts +3 -0
  93. package/dist/esm/templates/formTemplates.d.ts.map +1 -0
  94. package/dist/esm/templates/formTemplates.js +49 -0
  95. package/dist/esm/templates/formTemplates.js.map +1 -0
  96. package/dist/esm/templates/index.d.ts +8 -0
  97. package/dist/esm/templates/index.d.ts.map +1 -0
  98. package/dist/esm/templates/index.js +18 -0
  99. package/dist/esm/templates/index.js.map +1 -0
  100. package/dist/esm/templates/listTemplates.d.ts +4 -0
  101. package/dist/esm/templates/listTemplates.d.ts.map +1 -0
  102. package/dist/esm/templates/listTemplates.js +163 -0
  103. package/dist/esm/templates/listTemplates.js.map +1 -0
  104. package/dist/esm/templates/recordTemplates.d.ts +3 -0
  105. package/dist/esm/templates/recordTemplates.d.ts.map +1 -0
  106. package/dist/esm/templates/recordTemplates.js +142 -0
  107. package/dist/esm/templates/recordTemplates.js.map +1 -0
  108. package/dist/esm/tsconfig.tsbuildinfo +1 -0
  109. package/index.ts +14 -0
  110. package/invoicingApplication.ts +28 -0
  111. package/invoicingParts.ts +58 -0
  112. package/invoicingQueries.ts +58 -0
  113. package/invoicingScreenSet.ts +22 -0
  114. package/manifest.ts +41 -0
  115. package/navigation.ts +54 -0
  116. package/package.json +78 -4
  117. package/packageName.ts +5 -0
  118. package/sampleData/invoicing-en.json +988 -0
  119. package/screens/index.ts +20 -0
  120. package/templateProvenance.ts +15 -0
  121. package/templates/calendarTemplate.ts +57 -0
  122. package/templates/dashboardTemplates.ts +76 -0
  123. package/templates/formTemplates.ts +34 -0
  124. package/templates/index.ts +18 -0
  125. package/templates/listTemplates.ts +106 -0
  126. package/templates/recordTemplates.ts +79 -0
  127. package/thumbnails/InvoicePage.svg +17 -0
  128. package/thumbnails/InvoicesList.svg +29 -0
  129. package/thumbnails/InvoicingDueDates.svg +34 -0
  130. package/thumbnails/InvoicingOverview.svg +15 -0
  131. package/thumbnails/InvoicingQuickCreateInvoice.svg +12 -0
  132. package/thumbnails/InvoicingRecordPayment.svg +12 -0
  133. package/thumbnails/PaymentsList.svg +29 -0
  134. package/thumbnails/invoicing.svg +14 -0
package/index.ts ADDED
@@ -0,0 +1,14 @@
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
+ export * from './packageName';
5
+ export * from './templateProvenance';
6
+ export * from './invoicingQueries';
7
+ export * from './invoicingParts';
8
+ export * from './invoicingScreenSet';
9
+ export * from './templates';
10
+ export * from './screens';
11
+ export * from './navigation';
12
+ export * from './manifest';
13
+ export * from './blueprint';
14
+ export * from './invoicingApplication';
@@ -0,0 +1,28 @@
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
+ import { UiProfile } from '@cratis/scene.model';
5
+ import { ApplicationStructureIndex } from '@cratis/scene.engine';
6
+ import { ApplicationDocument, CompositionOptions, defaultLayouts, previewProfile } from '@cratis/scene.blueprint.default';
7
+ import { invoicingNavigation, invoicingStructure } from './navigation';
8
+ import { invoicingScreens } from './screens';
9
+ import { invoicingDialogTemplates, invoicingScreenTemplates } from './templates';
10
+
11
+ /** The id of the sample-data pack a new application starts with. */
12
+ export const invoicingDefaultSampleDataId = 'invoicing-en';
13
+
14
+ /**
15
+ * The example application of the blueprint: the foundation's layouts, the Invoicing templates, the quick-create dialogs and their 5 screens, rendering against the
16
+ * foundation's packages with the default sample-data pack chosen. This is what a gallery previews and what the conformance fixture
17
+ * (`Samples/Invoicing/invoicing.play`) declares in Screenplay: the document, the structure and the navigation are the three things an application is made of.
18
+ */
19
+ export function invoicingApplication(sampleData: string = invoicingDefaultSampleDataId): ApplicationDocument {
20
+ const profile: UiProfile = { ...previewProfile(undefined), name: 'Invoicing', sampleData: { activePack: sampleData, mappings: [], bindings: [] } };
21
+ return { layouts: defaultLayouts, screenTemplates: invoicingScreenTemplates, dialogTemplates: invoicingDialogTemplates, screens: invoicingScreens, uiProfiles: [profile] };
22
+ }
23
+
24
+ /** What a host composes the screens with: the application's logo, which the shell's topbar shows. */
25
+ export const invoicingComposition: CompositionOptions = { logo: invoicingNavigation.application.logo };
26
+
27
+ /** The structure and navigation the shell's regions show and the items' destinations resolve against. */
28
+ export const invoicingNavigationModel = () => ({ structure: new ApplicationStructureIndex(invoicingStructure), navigation: invoicingNavigation });
@@ -0,0 +1,58 @@
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
+ import {
5
+ Behavior, BindingSourceKind, DialogTemplate, ExternalComponent, InteractionActionKind, InteractionTriggerKind, NavigateAction, OpenDialogAction, SceneElement, ScreenTemplate, TemplateMetadata, TemplateScope,
6
+ } from '@cratis/scene.model';
7
+ import { component, panel } from '@cratis/scene.blueprint.default';
8
+ import { invoicingTemplateProvenance } from './templateProvenance';
9
+
10
+ export { component, panel };
11
+
12
+ /** The category of every template of this blueprint (spec Part B 1.2: `Business / <domain>`). */
13
+ export const invoicingCategory = 'Business / Invoicing';
14
+
15
+ /** The package-relative thumbnail of a template. */
16
+ export const thumbnailOf = (templateName: string): string => `thumbnails/${templateName}.svg`;
17
+
18
+ /** The metadata of a screen template of this blueprint: provenance, a type from the vocabulary, the category, a thumbnail and the levels it applies at. */
19
+ export const invoicingMetadata = (name: string, type: 'Dashboard' | 'List' | 'Board' | 'Detail' | 'Form' | 'Dialog' | 'Workspace' | 'Calendar' | 'Timeline' | 'Inbox' | 'Profile' | 'Wizard', scopes: TemplateScope[]): TemplateMetadata =>
20
+ ({ ...invoicingTemplateProvenance, type, category: invoicingCategory, thumbnail: thumbnailOf(name), scopes });
21
+
22
+ /** A button of the foundation: a verb, its emphasis, and the permission rule every action declares (spec Part B 1.5). */
23
+ export const actionButton = (id: string, label: string, emphasis: 'primary' | 'secondary' | 'quiet' | 'danger', extra: Record<string, unknown> = {}, behaviors?: Behavior[]): ExternalComponent =>
24
+ ({ ...component(id, 'actionButton', { label, emphasis, permission: 'enabled', ...extra }), ...(behaviors ? { behaviors } : {}) });
25
+
26
+ /** What pressing an element does: open the named dialog template over the page. */
27
+ export const opensDialog = (dialogTemplate: string): Behavior[] =>
28
+ [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.OpenDialog, dialogTemplate } as OpenDialogAction] }] }];
29
+
30
+ /** What pressing an element does: go to the named screen. */
31
+ export const goesTo = (screen: string): Behavior[] =>
32
+ [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.Navigate, screen } as NavigateAction] }] }];
33
+
34
+ /**
35
+ * What choosing a row of a list does: open the record page, handing it the chosen row's id. The list is single-selection, so choosing a row is
36
+ * opening it - the way a table of records works everywhere.
37
+ */
38
+ export const opensRecordOnSelect = (listId: string, screen: string): Behavior[] => [{
39
+ bindings: [{
40
+ trigger: { kind: InteractionTriggerKind.Select },
41
+ actions: [{ kind: InteractionActionKind.Navigate, screen, arguments: [{ name: 'id', value: { kind: BindingSourceKind.ComponentProperty, componentId: listId, path: 'value' } }] } as NavigateAction],
42
+ }],
43
+ }];
44
+
45
+ /**
46
+ * What choosing a row of a list does: open the named dialog over the page - a side sheet with the row's detail, so the list stays where it was.
47
+ */
48
+ export const opensDialogOnSelect = (dialogTemplate: string): Behavior[] =>
49
+ [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Select }, actions: [{ kind: InteractionActionKind.OpenDialog, dialogTemplate } as OpenDialogAction] }] }];
50
+
51
+ /** What a Cancel or Close control does: close the dialog it was opened from. */
52
+ export const closesDialog = (): Behavior[] => [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.CloseDialog }] }] }];
53
+
54
+ /** An element with the given behaviors attached. */
55
+ export const withBehaviors = <T extends SceneElement>(element: T, behaviors: Behavior[]): T => ({ ...element, behaviors });
56
+
57
+ export type InvoicingScreenTemplate = ScreenTemplate;
58
+ export type InvoicingDialogTemplate = DialogTemplate;
@@ -0,0 +1,58 @@
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
+ import { BindingExpression, BindingSourceKind } from '@cratis/scene.model';
5
+
6
+ /**
7
+ * A property taken from a query result - never a value. A invoicing template declares *where* its data comes from and the sample-data pack, or the real
8
+ * query, supplies the rows (spec SD1); `path` reaches into the result (`0.value` is the first row's `value`, an empty path is the whole result).
9
+ */
10
+ export const fromQuery = (query: string, path = ''): BindingExpression => ({ kind: BindingSourceKind.QueryResult, query, path });
11
+
12
+ /** The queries of the screens that are not a plain list. Each is a shape the sample-data pack supplies rows for. */
13
+ export const InvoicingQuery = {
14
+ /** One row: the `locale` and `currency` the figures and dates are formatted in. */
15
+ Settings: 'InvoicingSettings',
16
+ Kpis: 'InvoicingKpis',
17
+ Aging: 'InvoicingAging',
18
+ InvoicedAndCollected: 'InvoicingInvoicedAndCollected',
19
+ Activity: 'InvoicingActivity',
20
+ DueDates: 'InvoicingDueDates',
21
+ DueColumns: 'InvoicingDueColumns',
22
+ FormErrors: 'InvoicingFormErrors',
23
+ } as const;
24
+
25
+ /** The entities a template is made for. */
26
+ export enum InvoicingEntityKind {
27
+ Invoice = 'Invoice',
28
+ Payment = 'Payment',
29
+ }
30
+
31
+ /** The read model (and so the shape) the records of each entity are queried from. */
32
+ export const invoicingEntityPlural: Record<InvoicingEntityKind, string> = {
33
+ [InvoicingEntityKind.Invoice]: 'Invoices',
34
+ [InvoicingEntityKind.Payment]: 'Payments',
35
+ };
36
+
37
+ /**
38
+ * The queries one entity's templates bind to, named from the entity so a template never spells one out: the records, the columns and filter fields of the
39
+ * list, its saved views and column choices, the selection, the sections of the quick form, and what the record page shows.
40
+ */
41
+ export const invoicingQueriesOf = (entity: InvoicingEntityKind) => ({
42
+ rows: invoicingEntityPlural[entity],
43
+ columns: `${entity}Columns`,
44
+ filterFields: `${entity}FilterFields`,
45
+ views: `${entity}Views`,
46
+ columnChoices: `${entity}ColumnChoices`,
47
+ selection: `${entity}Selection`,
48
+ quickSections: `${entity}QuickSections`,
49
+ record: `${entity}Record`,
50
+ sections: `${entity}Sections`,
51
+ summary: `${entity}Summary`,
52
+ activity: `${entity}Activity`,
53
+ tabs: `${entity}Tabs`,
54
+ });
55
+
56
+ /** The locale and currency of the data, bound onto every component that formats a figure or a date. */
57
+ export const localeOfData = { locale: fromQuery(InvoicingQuery.Settings, '0.locale') };
58
+ export const currencyOfData = { ...localeOfData, currency: fromQuery(InvoicingQuery.Settings, '0.currency') };
@@ -0,0 +1,22 @@
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
+ import { BlueprintScreen } from '@cratis/scene.model';
5
+
6
+ /** One ready-to-use screen: the qualified name that is also its place in the application (`invoicing.list.record` would be the `record` feature of `list`). */
7
+ export interface InvoicingScreenDefinition extends BlueprintScreen {
8
+ template: string;
9
+ description: string;
10
+ }
11
+
12
+ /**
13
+ * The screens the blueprint brings, in navigation order. This one list is what the manifest's screen set, the `Screen` instances, the application structure
14
+ * and the navigation are all derived from, so they cannot disagree about which screens exist or where they sit.
15
+ */
16
+ export const invoicingScreenDefinitions: InvoicingScreenDefinition[] = [
17
+ { name: 'invoicing.overview', title: 'Overview', template: 'InvoicingOverview', order: 0, description: 'What is owed, what is overdue and what came in this month.' },
18
+ { name: 'invoicing.list', title: 'Invoices', template: 'InvoicesList', order: 1, description: 'Every invoice with what is owed and its status.' },
19
+ { name: 'invoicing.record', title: 'Invoice', template: 'InvoicePage', parent: 'invoicing.list', description: 'One invoice: key facts, its lines, its payments and its activity.' },
20
+ { name: 'invoicing.payments', title: 'Payments', template: 'PaymentsList', order: 2, description: 'The payments received and the invoices they settled.' },
21
+ { name: 'invoicing.due', title: 'Due dates', template: 'InvoicingDueDates', order: 3, description: 'The day each invoice falls due, on a calendar.' },
22
+ ];
package/manifest.ts ADDED
@@ -0,0 +1,41 @@
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
+ import { PackageKind, ScenePackage } from '@cratis/scene.model';
5
+ import { invoicingBlueprintName } from './packageName';
6
+ import { invoicingScreenDefinitions } from './invoicingScreenSet';
7
+ import { invoicingDialogTemplates, invoicingScreenTemplates } from './templates';
8
+
9
+ const description = 'Invoices for a finance team: a receivables overview, an invoice list, an invoice page with its lines and payments, the payments received and a due-date calendar.';
10
+
11
+ /**
12
+ * This blueprint's declaration. A domain blueprint depends on the foundation set (`Cratis.Blueprint.Default`) and reuses its layouts, slots,
13
+ * components and themes - it ships none of its own - and adds what is specific to the domain: templates, a ready-to-use screen set, sample data
14
+ * and thumbnails. The package `version` is the blueprint's version: it is what a template reference pins and what "update available" compares.
15
+ */
16
+ export const invoicingBlueprintManifest: ScenePackage = {
17
+ name: invoicingBlueprintName,
18
+ version: '1.0.0',
19
+ kind: PackageKind.Blueprint,
20
+ dependencies: [{ name: 'Cratis.Blueprint.Default', versionRange: '^1.0.0' }],
21
+ components: [],
22
+ layouts: [],
23
+ screenTemplates: invoicingScreenTemplates.map(template => template.name),
24
+ dialogTemplates: invoicingDialogTemplates.map(template => template.name),
25
+ themes: [],
26
+ displayName: 'Invoicing',
27
+ description,
28
+ module: '@cratis/scene.blueprint.invoicing',
29
+ license: 'MIT',
30
+ licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',
31
+ sampleData: [{ id: 'invoicing-en', title: 'Invoicing · English', locale: 'en-GB', path: 'sampleData/invoicing-en.json', description: 'English invoicing data: twelve invoices for six customers from draft to paid, one invoice\'s lines and payments, the payments received and the receivables figures.', columns: ['Invoice', 'Customer', 'Issued', 'Due', 'Amount'], statusColumn: 'Status', statuses: { good: ['Paid'], pending: ['Draft', 'Sent'], bad: ['Overdue', 'Void'] } }],
32
+ blueprint: {
33
+ domain: 'invoicing',
34
+ description,
35
+ thumbnail: 'thumbnails/invoicing.svg',
36
+ screenSet: invoicingScreenDefinitions.map(({ name, title, description: screenDescription, template, parent, order }) => ({
37
+ name, title, description: screenDescription, template, ...(parent === undefined ? {} : { parent }), ...(order === undefined ? {} : { order }),
38
+ })),
39
+ defaultSampleData: 'invoicing-en',
40
+ },
41
+ };
package/navigation.ts ADDED
@@ -0,0 +1,54 @@
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
+ import { ApplicationStructure, NavigationModel, NavigationRegionKind, NavigationRegionMode } from '@cratis/scene.model';
5
+ import { invoicingScreenDefinitions } from './invoicingScreenSet';
6
+
7
+ /** The module the blueprint's screens live in, and so the first segment of every screen's qualified name. */
8
+ export const invoicingModule = 'invoicing';
9
+
10
+ /**
11
+ * The application structure the screen set implies: one module, `invoicing`, a feature for each screen and the sub-features beneath it (`invoicing.record` is the
12
+ * `record` feature of the module). Derived from the screen names, so a screen added to the set is part of the structure without a second edit.
13
+ */
14
+ export const invoicingStructure: ApplicationStructure = (() => {
15
+ interface Node { id: string; name: string; features: Node[]; slices: never[] }
16
+ const root: Node = { id: invoicingModule, name: 'Invoicing', features: [], slices: [] };
17
+ for (const screen of invoicingScreenDefinitions) {
18
+ let parent = root;
19
+ for (const id of screen.name.split('.').slice(1)) {
20
+ let node = parent.features.find(candidate => candidate.id === id);
21
+ if (!node) {
22
+ node = { id, name: screen.title, features: [], slices: [] };
23
+ parent.features.push(node);
24
+ }
25
+ parent = node;
26
+ }
27
+ }
28
+
29
+ return { modules: [{ id: root.id, name: root.name, features: root.features }] } as unknown as ApplicationStructure;
30
+ })();
31
+
32
+ /**
33
+ * The navigation of the application the blueprint is: the topbar names the module, and the module's sidebar - which overrides the application's - lists
34
+ * the places a team goes: Overview, Invoices, Payments, Due dates.
35
+ */
36
+ export const invoicingNavigation: NavigationModel = {
37
+ application: {
38
+ logo: { image: '', title: 'Invoicing' },
39
+ regions: [{ region: NavigationRegionKind.Topbar, items: [{ id: 'invoicing', title: 'Invoicing', target: { module: invoicingModule } }] }],
40
+ },
41
+ modules: [{
42
+ module: invoicingModule,
43
+ regions: [{
44
+ region: NavigationRegionKind.Sidebar,
45
+ mode: NavigationRegionMode.Override,
46
+ items: [
47
+ { id: 'overview', title: 'Overview', target: { module: invoicingModule, feature: 'overview' } },
48
+ { id: 'list', title: 'Invoices', target: { module: invoicingModule, feature: 'list' } },
49
+ { id: 'payments', title: 'Payments', target: { module: invoicingModule, feature: 'payments' } },
50
+ { id: 'due', title: 'Due dates', target: { module: invoicingModule, feature: 'due' } },
51
+ ],
52
+ }],
53
+ }],
54
+ };
package/package.json CHANGED
@@ -1,6 +1,80 @@
1
1
  {
2
- "name": "@cratis/scene.blueprint.invoicing",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
2
+ "name": "@cratis/scene.blueprint.invoicing",
3
+ "version": "4.71.0",
4
+ "description": "Invoices for a finance team: a receivables overview, an invoice list, an invoice page with its lines and payments, the payments received and a due-date calendar.",
5
+ "keywords": [
6
+ "cratis",
7
+ "scene",
8
+ "react",
9
+ "ui",
10
+ "blueprint",
11
+ "invoicing"
12
+ ],
13
+ "author": "Cratis",
14
+ "license": "MIT",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/Cratis/Scene.git"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "sampleData",
25
+ "thumbnails",
26
+ "blueprintCatalog.json",
27
+ "**/*.ts",
28
+ "**/*.tsx",
29
+ "!**/for_*/**"
30
+ ],
31
+ "main": "dist/cjs/index.js",
32
+ "module": "dist/esm/index.js",
33
+ "types": "dist/esm/index.d.ts",
34
+ "exports": {
35
+ "./package.json": "./package.json",
36
+ ".": {
37
+ "types": "./dist/esm/index.d.ts",
38
+ "require": "./dist/cjs/index.js",
39
+ "import": "./dist/esm/index.js"
40
+ }
41
+ },
42
+ "scripts": {
43
+ "prepare": "yarn g:build",
44
+ "clean": "yarn g:clean",
45
+ "build": "yarn g:build",
46
+ "lint": "yarn g:lint",
47
+ "lint:ci": "yarn g:lint:ci",
48
+ "test": "yarn g:test",
49
+ "test:browser": "yarn g:test --config ./vitest.browser.config.mts",
50
+ "ci": "yarn g:ci",
51
+ "up": "yarn g:up"
52
+ },
53
+ "dependencies": {
54
+ "@cratis/scene.blueprint.default": "4.71.0",
55
+ "@cratis/scene.engine": "4.71.0",
56
+ "@cratis/scene.model": "4.71.0",
57
+ "@cratis/scene.react": "4.71.0"
58
+ },
59
+ "devDependencies": {
60
+ "@cratis/scene.blueprint.default": "4.71.0",
61
+ "@cratis/scene.engine": "4.71.0",
62
+ "@cratis/scene.model": "4.71.0",
63
+ "@cratis/scene.react": "4.71.0",
64
+ "@primereact/core": "11.2.0",
65
+ "@primereact/headless": "11.2.0",
66
+ "primeicons": "8.0.2",
67
+ "primereact": "11.2.0",
68
+ "react": "^19.3.0",
69
+ "react-dom": "^19.3.0"
70
+ },
71
+ "peerDependencies": {
72
+ "@cratis/components": "^4.1.1",
73
+ "@primereact/core": "^11.0.0",
74
+ "@primereact/headless": "^11.0.0",
75
+ "primeicons": "^8.0.0",
76
+ "primereact": "^11.0.0",
77
+ "react": "^19.0.0",
78
+ "react-dom": "^19.0.0"
79
+ }
6
80
  }
package/packageName.ts ADDED
@@ -0,0 +1,5 @@
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 name this blueprint is known by inside a `ui profile`; every component registry key is built from it. */
5
+ export const invoicingBlueprintName = 'Cratis.Blueprint.Invoicing';