@cratis/scene.blueprint.administration 0.0.0-stage → 4.50.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/administrationApplication.ts +28 -0
  2. package/administrationParts.ts +52 -0
  3. package/administrationQueries.ts +62 -0
  4. package/administrationScreenSet.ts +22 -0
  5. package/blueprint.ts +16 -0
  6. package/blueprintCatalog.json +132 -0
  7. package/dist/cjs/administrationApplication.js +49 -0
  8. package/dist/cjs/administrationApplication.js.map +1 -0
  9. package/dist/cjs/administrationParts.js +131 -0
  10. package/dist/cjs/administrationParts.js.map +1 -0
  11. package/dist/cjs/administrationQueries.js +69 -0
  12. package/dist/cjs/administrationQueries.js.map +1 -0
  13. package/dist/cjs/administrationScreenSet.js +47 -0
  14. package/dist/cjs/administrationScreenSet.js.map +1 -0
  15. package/dist/cjs/blueprint.js +19 -0
  16. package/dist/cjs/blueprint.js.map +1 -0
  17. package/dist/cjs/index.js +68 -0
  18. package/dist/cjs/index.js.map +1 -0
  19. package/dist/cjs/manifest.js +65 -0
  20. package/dist/cjs/manifest.js.map +1 -0
  21. package/dist/cjs/navigation.js +117 -0
  22. package/dist/cjs/navigation.js.map +1 -0
  23. package/dist/cjs/package.json +3 -0
  24. package/dist/cjs/packageName.js +8 -0
  25. package/dist/cjs/packageName.js.map +1 -0
  26. package/dist/cjs/screens/index.js +22 -0
  27. package/dist/cjs/screens/index.js.map +1 -0
  28. package/dist/cjs/templateProvenance.js +24 -0
  29. package/dist/cjs/templateProvenance.js.map +1 -0
  30. package/dist/cjs/templates/dialogTemplates.js +51 -0
  31. package/dist/cjs/templates/dialogTemplates.js.map +1 -0
  32. package/dist/cjs/templates/index.js +27 -0
  33. package/dist/cjs/templates/index.js.map +1 -0
  34. package/dist/cjs/templates/listTemplates.js +157 -0
  35. package/dist/cjs/templates/listTemplates.js.map +1 -0
  36. package/dist/cjs/templates/recordTemplates.js +103 -0
  37. package/dist/cjs/templates/recordTemplates.js.map +1 -0
  38. package/dist/cjs/templates/rolesTemplate.js +65 -0
  39. package/dist/cjs/templates/rolesTemplate.js.map +1 -0
  40. package/dist/cjs/templates/settingsTemplate.js +45 -0
  41. package/dist/cjs/templates/settingsTemplate.js.map +1 -0
  42. package/dist/esm/administrationApplication.d.ts +10 -0
  43. package/dist/esm/administrationApplication.d.ts.map +1 -0
  44. package/dist/esm/administrationApplication.js +44 -0
  45. package/dist/esm/administrationApplication.js.map +1 -0
  46. package/dist/esm/administrationParts.d.ts +15 -0
  47. package/dist/esm/administrationParts.d.ts.map +1 -0
  48. package/dist/esm/administrationParts.js +114 -0
  49. package/dist/esm/administrationParts.js.map +1 -0
  50. package/dist/esm/administrationQueries.d.ts +42 -0
  51. package/dist/esm/administrationQueries.d.ts.map +1 -0
  52. package/dist/esm/administrationQueries.js +61 -0
  53. package/dist/esm/administrationQueries.js.map +1 -0
  54. package/dist/esm/administrationScreenSet.d.ts +7 -0
  55. package/dist/esm/administrationScreenSet.d.ts.map +1 -0
  56. package/dist/esm/administrationScreenSet.js +45 -0
  57. package/dist/esm/administrationScreenSet.js.map +1 -0
  58. package/dist/esm/blueprint.d.ts +3 -0
  59. package/dist/esm/blueprint.d.ts.map +1 -0
  60. package/dist/esm/blueprint.js +17 -0
  61. package/dist/esm/blueprint.js.map +1 -0
  62. package/dist/esm/index.d.ts +12 -0
  63. package/dist/esm/index.d.ts.map +1 -0
  64. package/dist/esm/index.js +18 -0
  65. package/dist/esm/index.js.map +1 -0
  66. package/dist/esm/manifest.d.ts +3 -0
  67. package/dist/esm/manifest.d.ts.map +1 -0
  68. package/dist/esm/manifest.js +63 -0
  69. package/dist/esm/manifest.js.map +1 -0
  70. package/dist/esm/navigation.d.ts +5 -0
  71. package/dist/esm/navigation.d.ts.map +1 -0
  72. package/dist/esm/navigation.js +113 -0
  73. package/dist/esm/navigation.js.map +1 -0
  74. package/dist/esm/package.json +3 -0
  75. package/dist/esm/packageName.d.ts +2 -0
  76. package/dist/esm/packageName.d.ts.map +1 -0
  77. package/dist/esm/packageName.js +6 -0
  78. package/dist/esm/packageName.js.map +1 -0
  79. package/dist/esm/screens/index.d.ts +3 -0
  80. package/dist/esm/screens/index.d.ts.map +1 -0
  81. package/dist/esm/screens/index.js +20 -0
  82. package/dist/esm/screens/index.js.map +1 -0
  83. package/dist/esm/templateProvenance.d.ts +3 -0
  84. package/dist/esm/templateProvenance.d.ts.map +1 -0
  85. package/dist/esm/templateProvenance.js +22 -0
  86. package/dist/esm/templateProvenance.js.map +1 -0
  87. package/dist/esm/templates/dialogTemplates.d.ts +3 -0
  88. package/dist/esm/templates/dialogTemplates.d.ts.map +1 -0
  89. package/dist/esm/templates/dialogTemplates.js +49 -0
  90. package/dist/esm/templates/dialogTemplates.js.map +1 -0
  91. package/dist/esm/templates/index.d.ts +8 -0
  92. package/dist/esm/templates/index.d.ts.map +1 -0
  93. package/dist/esm/templates/index.js +18 -0
  94. package/dist/esm/templates/index.js.map +1 -0
  95. package/dist/esm/templates/listTemplates.d.ts +4 -0
  96. package/dist/esm/templates/listTemplates.d.ts.map +1 -0
  97. package/dist/esm/templates/listTemplates.js +154 -0
  98. package/dist/esm/templates/listTemplates.js.map +1 -0
  99. package/dist/esm/templates/recordTemplates.d.ts +3 -0
  100. package/dist/esm/templates/recordTemplates.d.ts.map +1 -0
  101. package/dist/esm/templates/recordTemplates.js +101 -0
  102. package/dist/esm/templates/recordTemplates.js.map +1 -0
  103. package/dist/esm/templates/rolesTemplate.d.ts +3 -0
  104. package/dist/esm/templates/rolesTemplate.d.ts.map +1 -0
  105. package/dist/esm/templates/rolesTemplate.js +63 -0
  106. package/dist/esm/templates/rolesTemplate.js.map +1 -0
  107. package/dist/esm/templates/settingsTemplate.d.ts +3 -0
  108. package/dist/esm/templates/settingsTemplate.d.ts.map +1 -0
  109. package/dist/esm/templates/settingsTemplate.js +43 -0
  110. package/dist/esm/templates/settingsTemplate.js.map +1 -0
  111. package/dist/esm/tsconfig.tsbuildinfo +1 -0
  112. package/index.ts +14 -0
  113. package/manifest.ts +41 -0
  114. package/navigation.ts +54 -0
  115. package/package.json +79 -5
  116. package/packageName.ts +5 -0
  117. package/sampleData/admin-default.json +1034 -0
  118. package/screens/index.ts +20 -0
  119. package/templateProvenance.ts +15 -0
  120. package/templates/dialogTemplates.ts +34 -0
  121. package/templates/index.ts +23 -0
  122. package/templates/listTemplates.ts +94 -0
  123. package/templates/recordTemplates.ts +44 -0
  124. package/templates/rolesTemplate.ts +39 -0
  125. package/templates/settingsTemplate.ts +28 -0
  126. package/thumbnails/AdministrationAuditLog.svg +13 -0
  127. package/thumbnails/AdministrationInviteUser.svg +12 -0
  128. package/thumbnails/AdministrationQuickCreateRole.svg +12 -0
  129. package/thumbnails/AdministrationRoles.svg +20 -0
  130. package/thumbnails/AdministrationSettings.svg +17 -0
  131. package/thumbnails/AdministrationUserList.svg +13 -0
  132. package/thumbnails/AdministrationUserPage.svg +18 -0
  133. package/thumbnails/administration.svg +14 -0
  134. package/README.md +0 -3
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 './administrationQueries';
7
+ export * from './administrationParts';
8
+ export * from './administrationScreenSet';
9
+ export * from './templates';
10
+ export * from './screens';
11
+ export * from './navigation';
12
+ export * from './manifest';
13
+ export * from './blueprint';
14
+ export * from './administrationApplication';
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 { administrationBlueprintName } from './packageName';
6
+ import { administrationScreenDefinitions } from './administrationScreenSet';
7
+ import { administrationDialogTemplates, administrationScreenTemplates } from './templates';
8
+
9
+ const description = 'Users, roles and permissions, settings and an audit log for an administrator: a user list and page, a roles list beside its permission matrix, a settings form and a read-only audit log.';
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 administrationBlueprintManifest: ScenePackage = {
17
+ name: administrationBlueprintName,
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: administrationScreenTemplates.map(template => template.name),
24
+ dialogTemplates: administrationDialogTemplates.map(template => template.name),
25
+ themes: [],
26
+ displayName: 'Administration',
27
+ description,
28
+ module: '@cratis/scene.blueprint.administration',
29
+ license: 'MIT',
30
+ licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',
31
+ sampleData: [{ id: 'admin-default', title: 'Administration · Default', locale: 'en-GB', path: 'sampleData/admin-default.json' }],
32
+ blueprint: {
33
+ domain: 'administration',
34
+ description,
35
+ thumbnail: 'thumbnails/administration.svg',
36
+ screenSet: administrationScreenDefinitions.map(({ name, title, description: screenDescription, template, parent, order }) => ({
37
+ name, title, description: screenDescription, template, ...(parent === undefined ? {} : { parent }), ...(order === undefined ? {} : { order }),
38
+ })),
39
+ defaultSampleData: 'admin-default',
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 { administrationScreenDefinitions } from './administrationScreenSet';
6
+
7
+ /** The module the blueprint's screens live in, and so the first segment of every screen's qualified name. */
8
+ export const administrationModule = 'admin';
9
+
10
+ /**
11
+ * The application structure the screen set implies: one module, `admin`, a feature for each screen and the sub-features beneath it (`admin.users.record` is the
12
+ * `record` feature of `users`). 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 administrationStructure: ApplicationStructure = (() => {
15
+ interface Node { id: string; name: string; features: Node[]; slices: never[] }
16
+ const root: Node = { id: administrationModule, name: 'Administration', features: [], slices: [] };
17
+ for (const screen of administrationScreenDefinitions) {
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 four places an administrator goes: Users, Roles, Settings and Audit log.
35
+ */
36
+ export const administrationNavigation: NavigationModel = {
37
+ application: {
38
+ logo: { image: '', title: 'Administration' },
39
+ regions: [{ region: NavigationRegionKind.Topbar, items: [{ id: 'admin', title: 'Administration', target: { module: administrationModule } }] }],
40
+ },
41
+ modules: [{
42
+ module: administrationModule,
43
+ regions: [{
44
+ region: NavigationRegionKind.Sidebar,
45
+ mode: NavigationRegionMode.Override,
46
+ items: [
47
+ { id: 'users', title: 'Users', target: { module: administrationModule, feature: 'users' } },
48
+ { id: 'roles', title: 'Roles', target: { module: administrationModule, feature: 'roles' } },
49
+ { id: 'settings', title: 'Settings', target: { module: administrationModule, feature: 'settings' } },
50
+ { id: 'audit', title: 'Audit log', target: { module: administrationModule, feature: 'audit' } },
51
+ ],
52
+ }],
53
+ }],
54
+ };
package/package.json CHANGED
@@ -1,6 +1,80 @@
1
1
  {
2
- "name": "@cratis/scene.blueprint.administration",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "@cratis/scene.blueprint.administration",
3
+ "version": "4.50.0",
4
+ "description": "Users, roles and permissions, settings and an audit log for an administrator.",
5
+ "keywords": [
6
+ "cratis",
7
+ "scene",
8
+ "react",
9
+ "ui",
10
+ "blueprint",
11
+ "administration"
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.50.0",
55
+ "@cratis/scene.engine": "4.50.0",
56
+ "@cratis/scene.model": "4.50.0",
57
+ "@cratis/scene.react": "4.50.0"
58
+ },
59
+ "devDependencies": {
60
+ "@cratis/scene.blueprint.default": "4.50.0",
61
+ "@cratis/scene.engine": "4.50.0",
62
+ "@cratis/scene.model": "4.50.0",
63
+ "@cratis/scene.react": "4.50.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
+ }
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 administrationBlueprintName = 'Cratis.Blueprint.Administration';