@cratis/scene.blueprint.approvals 0.0.0-stage → 4.53.1

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 (130) hide show
  1. package/README.md +66 -2
  2. package/approvalsApplication.ts +28 -0
  3. package/approvalsParts.ts +50 -0
  4. package/approvalsQueries.ts +58 -0
  5. package/approvalsScreenSet.ts +24 -0
  6. package/blueprint.ts +16 -0
  7. package/blueprintCatalog.json +171 -0
  8. package/dist/cjs/approvalsApplication.js +49 -0
  9. package/dist/cjs/approvalsApplication.js.map +1 -0
  10. package/dist/cjs/approvalsParts.js +131 -0
  11. package/dist/cjs/approvalsParts.js.map +1 -0
  12. package/dist/cjs/approvalsQueries.js +68 -0
  13. package/dist/cjs/approvalsQueries.js.map +1 -0
  14. package/dist/cjs/approvalsScreenSet.js +61 -0
  15. package/dist/cjs/approvalsScreenSet.js.map +1 -0
  16. package/dist/cjs/blueprint.js +19 -0
  17. package/dist/cjs/blueprint.js.map +1 -0
  18. package/dist/cjs/index.js +67 -0
  19. package/dist/cjs/index.js.map +1 -0
  20. package/dist/cjs/manifest.js +71 -0
  21. package/dist/cjs/manifest.js.map +1 -0
  22. package/dist/cjs/navigation.js +117 -0
  23. package/dist/cjs/navigation.js.map +1 -0
  24. package/dist/cjs/package.json +3 -0
  25. package/dist/cjs/packageName.js +8 -0
  26. package/dist/cjs/packageName.js.map +1 -0
  27. package/dist/cjs/screens/index.js +23 -0
  28. package/dist/cjs/screens/index.js.map +1 -0
  29. package/dist/cjs/templateProvenance.js +24 -0
  30. package/dist/cjs/templateProvenance.js.map +1 -0
  31. package/dist/cjs/templates/formTemplates.js +111 -0
  32. package/dist/cjs/templates/formTemplates.js.map +1 -0
  33. package/dist/cjs/templates/index.js +31 -0
  34. package/dist/cjs/templates/index.js.map +1 -0
  35. package/dist/cjs/templates/listTemplates.js +221 -0
  36. package/dist/cjs/templates/listTemplates.js.map +1 -0
  37. package/dist/cjs/templates/recordTemplates.js +97 -0
  38. package/dist/cjs/templates/recordTemplates.js.map +1 -0
  39. package/dist/cjs/templates/wizardTemplate.js +77 -0
  40. package/dist/cjs/templates/wizardTemplate.js.map +1 -0
  41. package/dist/esm/approvalsApplication.d.ts +10 -0
  42. package/dist/esm/approvalsApplication.d.ts.map +1 -0
  43. package/dist/esm/approvalsApplication.js +44 -0
  44. package/dist/esm/approvalsApplication.js.map +1 -0
  45. package/dist/esm/approvalsParts.d.ts +13 -0
  46. package/dist/esm/approvalsParts.d.ts.map +1 -0
  47. package/dist/esm/approvalsParts.js +114 -0
  48. package/dist/esm/approvalsParts.js.map +1 -0
  49. package/dist/esm/approvalsQueries.d.ts +51 -0
  50. package/dist/esm/approvalsQueries.d.ts.map +1 -0
  51. package/dist/esm/approvalsQueries.js +63 -0
  52. package/dist/esm/approvalsQueries.js.map +1 -0
  53. package/dist/esm/approvalsScreenSet.d.ts +7 -0
  54. package/dist/esm/approvalsScreenSet.d.ts.map +1 -0
  55. package/dist/esm/approvalsScreenSet.js +59 -0
  56. package/dist/esm/approvalsScreenSet.js.map +1 -0
  57. package/dist/esm/blueprint.d.ts +3 -0
  58. package/dist/esm/blueprint.d.ts.map +1 -0
  59. package/dist/esm/blueprint.js +17 -0
  60. package/dist/esm/blueprint.js.map +1 -0
  61. package/dist/esm/index.d.ts +12 -0
  62. package/dist/esm/index.d.ts.map +1 -0
  63. package/dist/esm/index.js +17 -0
  64. package/dist/esm/index.js.map +1 -0
  65. package/dist/esm/manifest.d.ts +3 -0
  66. package/dist/esm/manifest.d.ts.map +1 -0
  67. package/dist/esm/manifest.js +69 -0
  68. package/dist/esm/manifest.js.map +1 -0
  69. package/dist/esm/navigation.d.ts +5 -0
  70. package/dist/esm/navigation.d.ts.map +1 -0
  71. package/dist/esm/navigation.js +113 -0
  72. package/dist/esm/navigation.js.map +1 -0
  73. package/dist/esm/package.json +3 -0
  74. package/dist/esm/packageName.d.ts +2 -0
  75. package/dist/esm/packageName.d.ts.map +1 -0
  76. package/dist/esm/packageName.js +6 -0
  77. package/dist/esm/packageName.js.map +1 -0
  78. package/dist/esm/screens/index.d.ts +3 -0
  79. package/dist/esm/screens/index.d.ts.map +1 -0
  80. package/dist/esm/screens/index.js +21 -0
  81. package/dist/esm/screens/index.js.map +1 -0
  82. package/dist/esm/templateProvenance.d.ts +3 -0
  83. package/dist/esm/templateProvenance.d.ts.map +1 -0
  84. package/dist/esm/templateProvenance.js +22 -0
  85. package/dist/esm/templateProvenance.js.map +1 -0
  86. package/dist/esm/templates/formTemplates.d.ts +6 -0
  87. package/dist/esm/templates/formTemplates.d.ts.map +1 -0
  88. package/dist/esm/templates/formTemplates.js +106 -0
  89. package/dist/esm/templates/formTemplates.js.map +1 -0
  90. package/dist/esm/templates/index.d.ts +7 -0
  91. package/dist/esm/templates/index.d.ts.map +1 -0
  92. package/dist/esm/templates/index.js +20 -0
  93. package/dist/esm/templates/index.js.map +1 -0
  94. package/dist/esm/templates/listTemplates.d.ts +6 -0
  95. package/dist/esm/templates/listTemplates.d.ts.map +1 -0
  96. package/dist/esm/templates/listTemplates.js +216 -0
  97. package/dist/esm/templates/listTemplates.js.map +1 -0
  98. package/dist/esm/templates/recordTemplates.d.ts +3 -0
  99. package/dist/esm/templates/recordTemplates.d.ts.map +1 -0
  100. package/dist/esm/templates/recordTemplates.js +95 -0
  101. package/dist/esm/templates/recordTemplates.js.map +1 -0
  102. package/dist/esm/templates/wizardTemplate.d.ts +3 -0
  103. package/dist/esm/templates/wizardTemplate.d.ts.map +1 -0
  104. package/dist/esm/templates/wizardTemplate.js +75 -0
  105. package/dist/esm/templates/wizardTemplate.js.map +1 -0
  106. package/dist/esm/tsconfig.tsbuildinfo +1 -0
  107. package/index.ts +14 -0
  108. package/manifest.ts +44 -0
  109. package/navigation.ts +54 -0
  110. package/package.json +78 -4
  111. package/packageName.ts +5 -0
  112. package/sampleData/approvals-general.json +1269 -0
  113. package/sampleData/approvals-nordic.json +1269 -0
  114. package/screens/index.ts +21 -0
  115. package/templateProvenance.ts +15 -0
  116. package/templates/formTemplates.ts +61 -0
  117. package/templates/index.ts +19 -0
  118. package/templates/listTemplates.ts +116 -0
  119. package/templates/recordTemplates.ts +45 -0
  120. package/templates/wizardTemplate.ts +33 -0
  121. package/thumbnails/AllRequests.svg +13 -0
  122. package/thumbnails/ApprovalInbox.svg +23 -0
  123. package/thumbnails/DecisionDialog.svg +11 -0
  124. package/thumbnails/MyRequests.svg +13 -0
  125. package/thumbnails/NewRequestWizard.svg +14 -0
  126. package/thumbnails/RequestPage.svg +11 -0
  127. package/thumbnails/RequestTypeEditForm.svg +14 -0
  128. package/thumbnails/RequestTypeQuickCreate.svg +11 -0
  129. package/thumbnails/RequestTypes.svg +13 -0
  130. package/thumbnails/approvals.svg +9 -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 './approvalsQueries';
7
+ export * from './approvalsParts';
8
+ export * from './approvalsScreenSet';
9
+ export * from './templates';
10
+ export * from './screens';
11
+ export * from './navigation';
12
+ export * from './manifest';
13
+ export * from './blueprint';
14
+ export * from './approvalsApplication';
package/manifest.ts ADDED
@@ -0,0 +1,44 @@
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 { approvalsBlueprintName } from './packageName';
6
+ import { approvalsScreenDefinitions } from './approvalsScreenSet';
7
+ import { approvalsDialogTemplates, approvalsScreenTemplates } from './templates';
8
+
9
+ const description = 'Requests and approvals: an approver\'s inbox, my requests, a new-request wizard, request pages with their approval chain and the request types an organisation offers.';
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 approvalsBlueprintManifest: ScenePackage = {
17
+ name: approvalsBlueprintName,
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: approvalsScreenTemplates.map(template => template.name),
24
+ dialogTemplates: approvalsDialogTemplates.map(template => template.name),
25
+ themes: [],
26
+ displayName: 'Approvals and Requests',
27
+ description,
28
+ module: '@cratis/scene.blueprint.approvals',
29
+ license: 'MIT',
30
+ licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',
31
+ sampleData: [
32
+ { id: 'approvals-general', title: 'Approvals · General', locale: 'en-GB', path: 'sampleData/approvals-general.json' },
33
+ { id: 'approvals-nordic', title: 'Approvals · Nordic', locale: 'nb-NO', path: 'sampleData/approvals-nordic.json' },
34
+ ],
35
+ blueprint: {
36
+ domain: 'approvals',
37
+ description,
38
+ thumbnail: 'thumbnails/approvals.svg',
39
+ screenSet: approvalsScreenDefinitions.map(({ name, title, description: screenDescription, template, parent, order }) => ({
40
+ name, title, description: screenDescription, template, ...(parent === undefined ? {} : { parent }), ...(order === undefined ? {} : { order }),
41
+ })),
42
+ defaultSampleData: 'approvals-general',
43
+ },
44
+ };
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 { approvalsScreenDefinitions } from './approvalsScreenSet';
6
+
7
+ /** The module the blueprint's screens live in, and so the first segment of every screen's qualified name. */
8
+ export const approvalsModule = 'approvals';
9
+
10
+ /**
11
+ * The application structure the screen set implies: one module, `approvals`, a feature for each screen and the sub-features beneath it (`approvals.requests.new`
12
+ * is the `new` feature of `requests`). 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 approvalsStructure: ApplicationStructure = (() => {
15
+ interface Node { id: string; name: string; features: Node[]; slices: never[] }
16
+ const root: Node = { id: approvalsModule, name: 'Approvals', features: [], slices: [] };
17
+ for (const screen of approvalsScreenDefinitions) {
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 the four
34
+ * places of an approvals application: Inbox, My requests, All requests and Templates (for administrators).
35
+ */
36
+ export const approvalsNavigation: NavigationModel = {
37
+ application: {
38
+ logo: { image: '', title: 'Approvals' },
39
+ regions: [{ region: NavigationRegionKind.Topbar, items: [{ id: 'approvals', title: 'Approvals', target: { module: approvalsModule } }] }],
40
+ },
41
+ modules: [{
42
+ module: approvalsModule,
43
+ regions: [{
44
+ region: NavigationRegionKind.Sidebar,
45
+ mode: NavigationRegionMode.Override,
46
+ items: [
47
+ { id: 'inbox', title: 'Inbox', target: { module: approvalsModule, feature: 'inbox' } },
48
+ { id: 'requests', title: 'My requests', target: { module: approvalsModule, feature: 'requests' } },
49
+ { id: 'all', title: 'All requests', target: { module: approvalsModule, feature: 'all' } },
50
+ { id: 'templates', title: 'Templates', target: { module: approvalsModule, feature: 'templates' } },
51
+ ],
52
+ }],
53
+ }],
54
+ };
package/package.json CHANGED
@@ -1,6 +1,80 @@
1
1
  {
2
- "name": "@cratis/scene.blueprint.approvals",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
2
+ "name": "@cratis/scene.blueprint.approvals",
3
+ "version": "4.53.1",
4
+ "description": "Requests and approvals: an inbox, my requests, a request wizard, request pages with their approval chain and the request types an organisation offers.",
5
+ "keywords": [
6
+ "cratis",
7
+ "scene",
8
+ "react",
9
+ "ui",
10
+ "blueprint",
11
+ "approvals"
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.53.1",
55
+ "@cratis/scene.engine": "4.53.1",
56
+ "@cratis/scene.model": "4.53.1",
57
+ "@cratis/scene.react": "4.53.1"
58
+ },
59
+ "devDependencies": {
60
+ "@cratis/scene.blueprint.default": "4.53.1",
61
+ "@cratis/scene.engine": "4.53.1",
62
+ "@cratis/scene.model": "4.53.1",
63
+ "@cratis/scene.react": "4.53.1",
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 approvalsBlueprintName = 'Cratis.Blueprint.Approvals';