@cratis/scene.blueprint.default 4.35.0 → 4.37.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 (175) hide show
  1. package/ComponentName.ts +21 -0
  2. package/defaultBlueprintComponents.ts +8 -1
  3. package/dist/cjs/ComponentName.js +7 -0
  4. package/dist/cjs/ComponentName.js.map +1 -1
  5. package/dist/cjs/defaultBlueprint.js +2 -0
  6. package/dist/cjs/defaultBlueprint.js.map +1 -1
  7. package/dist/cjs/defaultBlueprintComponentMetadata.js +2 -0
  8. package/dist/cjs/defaultBlueprintComponentMetadata.js.map +1 -1
  9. package/dist/cjs/defaultBlueprintComponents.js +15 -1
  10. package/dist/cjs/defaultBlueprintComponents.js.map +1 -1
  11. package/dist/cjs/foundation/ActivityFeed.js +122 -0
  12. package/dist/cjs/foundation/ActivityFeed.js.map +1 -0
  13. package/dist/cjs/foundation/ApprovalChainStepper.js +130 -0
  14. package/dist/cjs/foundation/ApprovalChainStepper.js.map +1 -0
  15. package/dist/cjs/foundation/AvatarStack.js +73 -0
  16. package/dist/cjs/foundation/AvatarStack.js.map +1 -0
  17. package/dist/cjs/foundation/ChecklistSection.js +174 -0
  18. package/dist/cjs/foundation/ChecklistSection.js.map +1 -0
  19. package/dist/cjs/foundation/FileUploader.js +218 -0
  20. package/dist/cjs/foundation/FileUploader.js.map +1 -0
  21. package/dist/cjs/foundation/FileUploaderHandler.js +17 -0
  22. package/dist/cjs/foundation/FileUploaderHandler.js.map +1 -0
  23. package/dist/cjs/foundation/OrgTree.js +188 -0
  24. package/dist/cjs/foundation/OrgTree.js.map +1 -0
  25. package/dist/cjs/foundation/PermissionMatrix.js +136 -0
  26. package/dist/cjs/foundation/PermissionMatrix.js.map +1 -0
  27. package/dist/cjs/foundation/activityModel.js +63 -0
  28. package/dist/cjs/foundation/activityModel.js.map +1 -0
  29. package/dist/cjs/foundation/approvalModel.js +87 -0
  30. package/dist/cjs/foundation/approvalModel.js.map +1 -0
  31. package/dist/cjs/foundation/avatarModel.js +42 -0
  32. package/dist/cjs/foundation/avatarModel.js.map +1 -0
  33. package/dist/cjs/foundation/checklistModel.js +59 -0
  34. package/dist/cjs/foundation/checklistModel.js.map +1 -0
  35. package/dist/cjs/foundation/formatting.js +11 -0
  36. package/dist/cjs/foundation/formatting.js.map +1 -1
  37. package/dist/cjs/foundation/foundationComponentMetadata.js +47 -0
  38. package/dist/cjs/foundation/foundationComponentMetadata.js.map +1 -1
  39. package/dist/cjs/foundation/foundationDescriptors.js +246 -0
  40. package/dist/cjs/foundation/foundationDescriptors.js.map +1 -1
  41. package/dist/cjs/foundation/foundationSamples.js +230 -0
  42. package/dist/cjs/foundation/foundationSamples.js.map +1 -1
  43. package/dist/cjs/foundation/foundationStrings.js +27 -1
  44. package/dist/cjs/foundation/foundationStrings.js.map +1 -1
  45. package/dist/cjs/foundation/orgModel.js +106 -0
  46. package/dist/cjs/foundation/orgModel.js.map +1 -0
  47. package/dist/cjs/foundation/permissionModel.js +84 -0
  48. package/dist/cjs/foundation/permissionModel.js.map +1 -0
  49. package/dist/cjs/foundation/uploadModel.js +71 -0
  50. package/dist/cjs/foundation/uploadModel.js.map +1 -0
  51. package/dist/cjs/index.js +59 -0
  52. package/dist/cjs/index.js.map +1 -1
  53. package/dist/esm/ComponentName.d.ts +8 -1
  54. package/dist/esm/ComponentName.d.ts.map +1 -1
  55. package/dist/esm/ComponentName.js +7 -0
  56. package/dist/esm/ComponentName.js.map +1 -1
  57. package/dist/esm/defaultBlueprint.js +2 -0
  58. package/dist/esm/defaultBlueprint.js.map +1 -1
  59. package/dist/esm/defaultBlueprintComponentMetadata.js +2 -0
  60. package/dist/esm/defaultBlueprintComponentMetadata.js.map +1 -1
  61. package/dist/esm/defaultBlueprintComponents.d.ts.map +1 -1
  62. package/dist/esm/defaultBlueprintComponents.js +15 -1
  63. package/dist/esm/defaultBlueprintComponents.js.map +1 -1
  64. package/dist/esm/foundation/ActivityFeed.d.ts +3 -0
  65. package/dist/esm/foundation/ActivityFeed.d.ts.map +1 -0
  66. package/dist/esm/foundation/ActivityFeed.js +120 -0
  67. package/dist/esm/foundation/ActivityFeed.js.map +1 -0
  68. package/dist/esm/foundation/ApprovalChainStepper.d.ts +3 -0
  69. package/dist/esm/foundation/ApprovalChainStepper.d.ts.map +1 -0
  70. package/dist/esm/foundation/ApprovalChainStepper.js +128 -0
  71. package/dist/esm/foundation/ApprovalChainStepper.js.map +1 -0
  72. package/dist/esm/foundation/AvatarStack.d.ts +3 -0
  73. package/dist/esm/foundation/AvatarStack.d.ts.map +1 -0
  74. package/dist/esm/foundation/AvatarStack.js +71 -0
  75. package/dist/esm/foundation/AvatarStack.js.map +1 -0
  76. package/dist/esm/foundation/ChecklistSection.d.ts +3 -0
  77. package/dist/esm/foundation/ChecklistSection.d.ts.map +1 -0
  78. package/dist/esm/foundation/ChecklistSection.js +172 -0
  79. package/dist/esm/foundation/ChecklistSection.js.map +1 -0
  80. package/dist/esm/foundation/FileUploader.d.ts +3 -0
  81. package/dist/esm/foundation/FileUploader.d.ts.map +1 -0
  82. package/dist/esm/foundation/FileUploader.js +216 -0
  83. package/dist/esm/foundation/FileUploader.js.map +1 -0
  84. package/dist/esm/foundation/FileUploaderHandler.d.ts +8 -0
  85. package/dist/esm/foundation/FileUploaderHandler.d.ts.map +1 -0
  86. package/dist/esm/foundation/FileUploaderHandler.js +14 -0
  87. package/dist/esm/foundation/FileUploaderHandler.js.map +1 -0
  88. package/dist/esm/foundation/Foundation.stories.d.ts +16 -0
  89. package/dist/esm/foundation/Foundation.stories.d.ts.map +1 -1
  90. package/dist/esm/foundation/Foundation.stories.js +16 -0
  91. package/dist/esm/foundation/Foundation.stories.js.map +1 -1
  92. package/dist/esm/foundation/OrgTree.d.ts +3 -0
  93. package/dist/esm/foundation/OrgTree.d.ts.map +1 -0
  94. package/dist/esm/foundation/OrgTree.js +186 -0
  95. package/dist/esm/foundation/OrgTree.js.map +1 -0
  96. package/dist/esm/foundation/PermissionMatrix.d.ts +3 -0
  97. package/dist/esm/foundation/PermissionMatrix.d.ts.map +1 -0
  98. package/dist/esm/foundation/PermissionMatrix.js +134 -0
  99. package/dist/esm/foundation/PermissionMatrix.js.map +1 -0
  100. package/dist/esm/foundation/activityModel.d.ts +22 -0
  101. package/dist/esm/foundation/activityModel.d.ts.map +1 -0
  102. package/dist/esm/foundation/activityModel.js +58 -0
  103. package/dist/esm/foundation/activityModel.js.map +1 -0
  104. package/dist/esm/foundation/approvalModel.d.ts +27 -0
  105. package/dist/esm/foundation/approvalModel.d.ts.map +1 -0
  106. package/dist/esm/foundation/approvalModel.js +81 -0
  107. package/dist/esm/foundation/approvalModel.js.map +1 -0
  108. package/dist/esm/foundation/avatarModel.d.ts +11 -0
  109. package/dist/esm/foundation/avatarModel.d.ts.map +1 -0
  110. package/dist/esm/foundation/avatarModel.js +38 -0
  111. package/dist/esm/foundation/avatarModel.js.map +1 -0
  112. package/dist/esm/foundation/checklistModel.d.ts +17 -0
  113. package/dist/esm/foundation/checklistModel.d.ts.map +1 -0
  114. package/dist/esm/foundation/checklistModel.js +53 -0
  115. package/dist/esm/foundation/checklistModel.js.map +1 -0
  116. package/dist/esm/foundation/formatting.d.ts +1 -0
  117. package/dist/esm/foundation/formatting.d.ts.map +1 -1
  118. package/dist/esm/foundation/formatting.js +11 -1
  119. package/dist/esm/foundation/formatting.js.map +1 -1
  120. package/dist/esm/foundation/foundationComponentMetadata.d.ts.map +1 -1
  121. package/dist/esm/foundation/foundationComponentMetadata.js +47 -0
  122. package/dist/esm/foundation/foundationComponentMetadata.js.map +1 -1
  123. package/dist/esm/foundation/foundationDescriptors.d.ts.map +1 -1
  124. package/dist/esm/foundation/foundationDescriptors.js +246 -0
  125. package/dist/esm/foundation/foundationDescriptors.js.map +1 -1
  126. package/dist/esm/foundation/foundationSamples.d.ts.map +1 -1
  127. package/dist/esm/foundation/foundationSamples.js +230 -0
  128. package/dist/esm/foundation/foundationSamples.js.map +1 -1
  129. package/dist/esm/foundation/foundationStrings.d.ts +26 -0
  130. package/dist/esm/foundation/foundationStrings.d.ts.map +1 -1
  131. package/dist/esm/foundation/foundationStrings.js +27 -1
  132. package/dist/esm/foundation/foundationStrings.js.map +1 -1
  133. package/dist/esm/foundation/index.d.ts +15 -0
  134. package/dist/esm/foundation/index.d.ts.map +1 -1
  135. package/dist/esm/foundation/index.js +15 -0
  136. package/dist/esm/foundation/index.js.map +1 -1
  137. package/dist/esm/foundation/orgModel.d.ts +20 -0
  138. package/dist/esm/foundation/orgModel.d.ts.map +1 -0
  139. package/dist/esm/foundation/orgModel.js +99 -0
  140. package/dist/esm/foundation/orgModel.js.map +1 -0
  141. package/dist/esm/foundation/permissionModel.d.ts +24 -0
  142. package/dist/esm/foundation/permissionModel.d.ts.map +1 -0
  143. package/dist/esm/foundation/permissionModel.js +77 -0
  144. package/dist/esm/foundation/permissionModel.js.map +1 -0
  145. package/dist/esm/foundation/uploadModel.d.ts +31 -0
  146. package/dist/esm/foundation/uploadModel.d.ts.map +1 -0
  147. package/dist/esm/foundation/uploadModel.js +65 -0
  148. package/dist/esm/foundation/uploadModel.js.map +1 -0
  149. package/dist/esm/index.js +16 -1
  150. package/dist/esm/index.js.map +1 -1
  151. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  152. package/foundation/ActivityFeed.tsx +61 -0
  153. package/foundation/ApprovalChainStepper.tsx +66 -0
  154. package/foundation/AvatarStack.tsx +43 -0
  155. package/foundation/ChecklistSection.tsx +80 -0
  156. package/foundation/FileUploader.tsx +122 -0
  157. package/foundation/FileUploaderHandler.tsx +22 -0
  158. package/foundation/Foundation.stories.tsx +16 -0
  159. package/foundation/OrgTree.tsx +101 -0
  160. package/foundation/PermissionMatrix.tsx +82 -0
  161. package/foundation/activityModel.ts +65 -0
  162. package/foundation/approvalModel.ts +88 -0
  163. package/foundation/avatarModel.ts +36 -0
  164. package/foundation/checklistModel.ts +62 -0
  165. package/foundation/formatting.ts +9 -0
  166. package/foundation/foundationComponentMetadata.ts +7 -0
  167. package/foundation/foundationDescriptors.ts +153 -0
  168. package/foundation/foundationSamples.ts +59 -0
  169. package/foundation/foundationStrings.ts +26 -0
  170. package/foundation/index.ts +15 -0
  171. package/foundation/orgModel.ts +85 -0
  172. package/foundation/permissionModel.ts +85 -0
  173. package/foundation/uploadModel.ts +66 -0
  174. package/package.json +8 -8
  175. package/shell/layout.css +418 -0
@@ -0,0 +1,106 @@
1
+ 'use strict';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /** A person or unit in an organization, with who they report to. */ /** Reads nodes out of a property value, dropping entries without an id and keeping the first of a repeated id. */ function readOrgNodes(value) {
6
+ if (!Array.isArray(value)) return [];
7
+ const seen = new Set();
8
+ return value.flatMap((entry)=>{
9
+ if (typeof entry !== 'object' || entry === null || Array.isArray(entry)) return [];
10
+ const { id, label, title, parentId } = entry;
11
+ if (typeof id !== 'string' || id.length === 0 || seen.has(id)) return [];
12
+ seen.add(id);
13
+ return [
14
+ {
15
+ id,
16
+ label: typeof label === 'string' && label.length > 0 ? label : id,
17
+ ...typeof title === 'string' ? {
18
+ title
19
+ } : {},
20
+ ...typeof parentId === 'string' && parentId.length > 0 ? {
21
+ parentId
22
+ } : {}
23
+ }
24
+ ];
25
+ });
26
+ }
27
+ /**
28
+ * Builds the tree from the flat rows a query returns.
29
+ *
30
+ * Someone whose manager is not in the data becomes a root rather than vanishing, and a reporting cycle is broken at the node that closes it
31
+ * - which becomes a root - so malformed data draws something and never loops. Siblings keep the order of the rows.
32
+ */ function buildOrgTree(nodes) {
33
+ const known = new Set(nodes.map((node)=>node.id));
34
+ const parentOf = new Map(nodes.map((node)=>[
35
+ node.id,
36
+ node.parentId !== undefined && known.has(node.parentId) && node.parentId !== node.id ? node.parentId : undefined
37
+ ]));
38
+ for (const node of nodes){
39
+ const path = new Set([
40
+ node.id
41
+ ]);
42
+ for(let current = parentOf.get(node.id); current !== undefined; current = parentOf.get(current)){
43
+ if (path.has(current)) {
44
+ parentOf.set(node.id, undefined);
45
+ break;
46
+ }
47
+ path.add(current);
48
+ }
49
+ }
50
+ const placed = new Map(nodes.map((node)=>[
51
+ node.id,
52
+ {
53
+ ...node,
54
+ children: [],
55
+ depth: 0
56
+ }
57
+ ]));
58
+ const roots = [];
59
+ for (const node of nodes){
60
+ const parent = parentOf.get(node.id);
61
+ if (parent === undefined) roots.push(placed.get(node.id));
62
+ else placed.get(parent).children.push(placed.get(node.id));
63
+ }
64
+ const assignDepth = (level, depth)=>level.forEach((node)=>{
65
+ node.depth = depth;
66
+ assignDepth(node.children, depth + 1);
67
+ });
68
+ assignDepth(roots, 1);
69
+ return roots;
70
+ }
71
+ /** The nodes that can be reached from the roots with the given expansion, in the order they are drawn. */ function visibleNodes(roots, expanded) {
72
+ return roots.flatMap((node)=>[
73
+ node,
74
+ ...expanded.has(node.id) ? visibleNodes(node.children, expanded) : []
75
+ ]);
76
+ }
77
+ /** The ids of every node down to a depth: what is expanded when the tree first opens. */ function expandedToDepth(roots, depth) {
78
+ const result = new Set();
79
+ const walk = (level)=>level.forEach((node)=>{
80
+ if (node.depth < depth && node.children.length > 0) result.add(node.id);
81
+ walk(node.children);
82
+ });
83
+ walk(roots);
84
+ return result;
85
+ }
86
+ /** The number of people below a node, at any depth. */ const descendantCount = (node)=>node.children.reduce((sum, child)=>sum + 1 + descendantCount(child), 0);
87
+ /** For each node, the nodes that share its parent (itself included, in order) and its parent: what a tree needs for its set size and position, and for Left to go up. */ function placements(roots) {
88
+ const result = new Map();
89
+ const walk = (level, parent)=>level.forEach((node)=>{
90
+ result.set(node.id, {
91
+ siblings: level,
92
+ parent
93
+ });
94
+ walk(node.children, node);
95
+ });
96
+ walk(roots);
97
+ return result;
98
+ }
99
+
100
+ exports.buildOrgTree = buildOrgTree;
101
+ exports.descendantCount = descendantCount;
102
+ exports.expandedToDepth = expandedToDepth;
103
+ exports.placements = placements;
104
+ exports.readOrgNodes = readOrgNodes;
105
+ exports.visibleNodes = visibleNodes;
106
+ //# sourceMappingURL=orgModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orgModel.js","sources":["../../../foundation/orgModel.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/** A person or unit in an organization, with who they report to. */\nexport interface OrgNode {\n id: string;\n label: string;\n title?: string;\n parentId?: string;\n}\n\n/** A node placed in the tree. */\nexport interface OrgTreeNode extends OrgNode {\n children: OrgTreeNode[];\n depth: number;\n}\n\n/** Reads nodes out of a property value, dropping entries without an id and keeping the first of a repeated id. */\nexport function readOrgNodes(value: unknown): OrgNode[] {\n if (!Array.isArray(value)) return [];\n\n const seen = new Set<string>();\n return value.flatMap((entry): OrgNode[] => {\n if (typeof entry !== 'object' || entry === null || Array.isArray(entry)) return [];\n const { id, label, title, parentId } = entry as Record<string, unknown>;\n if (typeof id !== 'string' || id.length === 0 || seen.has(id)) return [];\n seen.add(id);\n return [{ id, label: typeof label === 'string' && label.length > 0 ? label : id, ...(typeof title === 'string' ? { title } : {}), ...(typeof parentId === 'string' && parentId.length > 0 ? { parentId } : {}) }];\n });\n}\n\n/**\n * Builds the tree from the flat rows a query returns.\n *\n * Someone whose manager is not in the data becomes a root rather than vanishing, and a reporting cycle is broken at the node that closes it\n * - which becomes a root - so malformed data draws something and never loops. Siblings keep the order of the rows.\n */\nexport function buildOrgTree(nodes: OrgNode[]): OrgTreeNode[] {\n const known = new Set(nodes.map(node => node.id));\n const parentOf = new Map<string, string | undefined>(nodes.map(node => [node.id, node.parentId !== undefined && known.has(node.parentId) && node.parentId !== node.id ? node.parentId : undefined]));\n\n for (const node of nodes) {\n const path = new Set<string>([node.id]);\n for (let current = parentOf.get(node.id); current !== undefined; current = parentOf.get(current)) {\n if (path.has(current)) { parentOf.set(node.id, undefined); break; }\n path.add(current);\n }\n }\n\n const placed = new Map<string, OrgTreeNode>(nodes.map(node => [node.id, { ...node, children: [], depth: 0 }]));\n const roots: OrgTreeNode[] = [];\n for (const node of nodes) {\n const parent = parentOf.get(node.id);\n if (parent === undefined) roots.push(placed.get(node.id)!);\n else placed.get(parent)!.children.push(placed.get(node.id)!);\n }\n\n const assignDepth = (level: OrgTreeNode[], depth: number) => level.forEach(node => { node.depth = depth; assignDepth(node.children, depth + 1); });\n assignDepth(roots, 1);\n return roots;\n}\n\n/** The nodes that can be reached from the roots with the given expansion, in the order they are drawn. */\nexport function visibleNodes(roots: OrgTreeNode[], expanded: ReadonlySet<string>): OrgTreeNode[] {\n return roots.flatMap(node => [node, ...(expanded.has(node.id) ? visibleNodes(node.children, expanded) : [])]);\n}\n\n/** The ids of every node down to a depth: what is expanded when the tree first opens. */\nexport function expandedToDepth(roots: OrgTreeNode[], depth: number): Set<string> {\n const result = new Set<string>();\n const walk = (level: OrgTreeNode[]) => level.forEach(node => { if (node.depth < depth && node.children.length > 0) result.add(node.id); walk(node.children); });\n walk(roots);\n return result;\n}\n\n/** The number of people below a node, at any depth. */\nexport const descendantCount = (node: OrgTreeNode): number => node.children.reduce((sum, child) => sum + 1 + descendantCount(child), 0);\n\n/** For each node, the nodes that share its parent (itself included, in order) and its parent: what a tree needs for its set size and position, and for Left to go up. */\nexport function placements(roots: OrgTreeNode[]): Map<string, { siblings: OrgTreeNode[]; parent?: OrgTreeNode }> {\n const result = new Map<string, { siblings: OrgTreeNode[]; parent?: OrgTreeNode }>();\n const walk = (level: OrgTreeNode[], parent?: OrgTreeNode) => level.forEach(node => { result.set(node.id, { siblings: level, parent }); walk(node.children, node); });\n walk(roots);\n return result;\n}\n"],"names":["readOrgNodes","value","Array","isArray","seen","Set","flatMap","entry","id","label","title","parentId","length","has","add","buildOrgTree","nodes","known","map","node","parentOf","Map","undefined","path","current","get","set","placed","children","depth","roots","parent","push","assignDepth","level","forEach","visibleNodes","expanded","expandedToDepth","result","walk","descendantCount","reduce","sum","child","placements","siblings"],"mappings":";;AAAA;AACA;AAEA,wLAeO,SAASA,aA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AK,GAAGA,KAAAA,IAASV,KAAKS,QAAQ,CAAChB,MAAM,GAAG,CAAA,EAAG2B,MAAAA,CAAOzB,GAAG,CAACK,KAAKX,EAAE,CAAA;AAAGgC,YAAAA,IAAAA,CAAKrB,KAAKS,QAAQ,CAAA;AAAG,QAAA,CAAA,CAAA;IAC7JY,IAAAA,CAAKV,KAAAA,CAAAA;IACL,OAAOS,MAAAA;AACX;AAEA,wDACO,MAAME,kBAAkB,CAACtB,IAAAA,GAA8BA,KAAKS,QAAQ,CAACc,MAAM,CAAC,CAACC,GAAAA,EAAKC,KAAAA,GAAUD,MAAM,CAAA,GAAIF,eAAAA,CAAgBG,QAAQ,CAAA;AAErI,0KACO,SAASC,UAAAA,CAAWf,KAAoB,EAAA;AAC3C,IAAA,MAAMS,SAAS,IAAIlB,GAAAA,EAAAA;AACnB,IAAA,MAAMmB,OAAO,CAACN,KAAAA,EAAsBH,SAAyBG,KAAAA,CAAMC,OAAO,CAAChB,CAAAA,IAAAA,GAAAA;AAAUoB,YAAAA,MAAAA,CAAOb,GAAG,CAACP,IAAAA,CAAKX,EAAE,EAAE;gBAAEsC,QAAAA,EAAUZ,KAAAA;AAAOH,gBAAAA;AAAO,aAAA,CAAA;YAAIS,IAAAA,CAAKrB,IAAAA,CAAKS,QAAQ,EAAET,IAAAA,CAAAA;AAAO,QAAA,CAAA,CAAA;IAClKqB,IAAAA,CAAKV,KAAAA,CAAAA;IACL,OAAOS,MAAAA;AACX;;;;;;;"}
@@ -0,0 +1,84 @@
1
+ 'use strict';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /** A role: a column of the matrix. */ const records = (value)=>Array.isArray(value) ? value.filter((entry)=>typeof entry === 'object' && entry !== null && !Array.isArray(entry)) : [];
6
+ /** Reads roles, dropping those without an id and repeated ids. */ function readRoles(value) {
7
+ const seen = new Set();
8
+ return records(value).flatMap((entry)=>{
9
+ if (typeof entry.id !== 'string' || entry.id.length === 0 || seen.has(entry.id)) return [];
10
+ seen.add(entry.id);
11
+ return [
12
+ {
13
+ id: entry.id,
14
+ label: typeof entry.label === 'string' && entry.label.length > 0 ? entry.label : entry.id
15
+ }
16
+ ];
17
+ });
18
+ }
19
+ /** Reads permissions, dropping those without an id and repeated ids. */ function readPermissions(value) {
20
+ const seen = new Set();
21
+ return records(value).flatMap((entry)=>{
22
+ if (typeof entry.id !== 'string' || entry.id.length === 0 || seen.has(entry.id)) return [];
23
+ seen.add(entry.id);
24
+ return [
25
+ {
26
+ id: entry.id,
27
+ label: typeof entry.label === 'string' && entry.label.length > 0 ? entry.label : entry.id,
28
+ ...typeof entry.group === 'string' && entry.group.length > 0 ? {
29
+ group: entry.group
30
+ } : {}
31
+ }
32
+ ];
33
+ });
34
+ }
35
+ /** Reads grants, keeping each pair once and only for a role and a permission that exist: a grant of something that was deleted is not shown as held. */ function readGrants(value, roles, permissions) {
36
+ const roleIds = new Set(roles.map((role)=>role.id));
37
+ const permissionIds = new Set(permissions.map((permission)=>permission.id));
38
+ const seen = new Set();
39
+ return records(value).flatMap((entry)=>{
40
+ const { role, permission } = entry;
41
+ if (typeof role !== 'string' || typeof permission !== 'string' || !roleIds.has(role) || !permissionIds.has(permission)) return [];
42
+ const key = `${role}\u0000${permission}`;
43
+ if (seen.has(key)) return [];
44
+ seen.add(key);
45
+ return [
46
+ {
47
+ role,
48
+ permission
49
+ }
50
+ ];
51
+ });
52
+ }
53
+ /** Whether a role holds a permission. */ const isGranted = (grants, role, permission)=>grants.some((grant)=>grant.role === role && grant.permission === permission);
54
+ /** Grants a permission to a role, or takes it away, leaving every other grant as it was. */ const setGrant = (grants, role, permission, granted)=>granted ? isGranted(grants, role, permission) ? grants : [
55
+ ...grants,
56
+ {
57
+ role,
58
+ permission
59
+ }
60
+ ] : grants.filter((grant)=>!(grant.role === role && grant.permission === permission));
61
+ /** Groups the permissions into runs by their group, in the order first seen, with the ungrouped ones in a run of their own. */ function sectionsOf(permissions) {
62
+ const sections = [];
63
+ for (const permission of permissions){
64
+ const section = sections.find((candidate)=>candidate.group === permission.group);
65
+ if (section) section.permissions.push(permission);
66
+ else sections.push({
67
+ ...permission.group === undefined ? {} : {
68
+ group: permission.group
69
+ },
70
+ permissions: [
71
+ permission
72
+ ]
73
+ });
74
+ }
75
+ return sections;
76
+ }
77
+
78
+ exports.isGranted = isGranted;
79
+ exports.readGrants = readGrants;
80
+ exports.readPermissions = readPermissions;
81
+ exports.readRoles = readRoles;
82
+ exports.sectionsOf = sectionsOf;
83
+ exports.setGrant = setGrant;
84
+ //# sourceMappingURL=permissionModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissionModel.js","sources":["../../../foundation/permissionModel.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/** A role: a column of the matrix. */\nexport interface MatrixRole {\n id: string;\n label: string;\n}\n\n/** A permission: a row of the matrix, optionally in a named group. */\nexport interface MatrixPermission {\n id: string;\n label: string;\n group?: string;\n}\n\n/** One role holding one permission. */\nexport interface MatrixGrant {\n role: string;\n permission: string;\n}\n\n/** A named run of permissions, for the group heading rows. */\nexport interface MatrixSection {\n group?: string;\n permissions: MatrixPermission[];\n}\n\nconst records = (value: unknown): Record<string, unknown>[] =>\n Array.isArray(value) ? value.filter((entry): entry is Record<string, unknown> => typeof entry === 'object' && entry !== null && !Array.isArray(entry)) : [];\n\n/** Reads roles, dropping those without an id and repeated ids. */\nexport function readRoles(value: unknown): MatrixRole[] {\n const seen = new Set<string>();\n return records(value).flatMap(entry => {\n if (typeof entry.id !== 'string' || entry.id.length === 0 || seen.has(entry.id)) return [];\n seen.add(entry.id);\n return [{ id: entry.id, label: typeof entry.label === 'string' && entry.label.length > 0 ? entry.label : entry.id }];\n });\n}\n\n/** Reads permissions, dropping those without an id and repeated ids. */\nexport function readPermissions(value: unknown): MatrixPermission[] {\n const seen = new Set<string>();\n return records(value).flatMap(entry => {\n if (typeof entry.id !== 'string' || entry.id.length === 0 || seen.has(entry.id)) return [];\n seen.add(entry.id);\n return [{ id: entry.id, label: typeof entry.label === 'string' && entry.label.length > 0 ? entry.label : entry.id, ...(typeof entry.group === 'string' && entry.group.length > 0 ? { group: entry.group } : {}) }];\n });\n}\n\n/** Reads grants, keeping each pair once and only for a role and a permission that exist: a grant of something that was deleted is not shown as held. */\nexport function readGrants(value: unknown, roles: MatrixRole[], permissions: MatrixPermission[]): MatrixGrant[] {\n const roleIds = new Set(roles.map(role => role.id));\n const permissionIds = new Set(permissions.map(permission => permission.id));\n const seen = new Set<string>();\n\n return records(value).flatMap(entry => {\n const { role, permission } = entry;\n if (typeof role !== 'string' || typeof permission !== 'string' || !roleIds.has(role) || !permissionIds.has(permission)) return [];\n const key = `${role}\\u0000${permission}`;\n if (seen.has(key)) return [];\n seen.add(key);\n return [{ role, permission }];\n });\n}\n\n/** Whether a role holds a permission. */\nexport const isGranted = (grants: MatrixGrant[], role: string, permission: string): boolean => grants.some(grant => grant.role === role && grant.permission === permission);\n\n/** Grants a permission to a role, or takes it away, leaving every other grant as it was. */\nexport const setGrant = (grants: MatrixGrant[], role: string, permission: string, granted: boolean): MatrixGrant[] =>\n granted ? (isGranted(grants, role, permission) ? grants : [...grants, { role, permission }]) : grants.filter(grant => !(grant.role === role && grant.permission === permission));\n\n/** Groups the permissions into runs by their group, in the order first seen, with the ungrouped ones in a run of their own. */\nexport function sectionsOf(permissions: MatrixPermission[]): MatrixSection[] {\n const sections: MatrixSection[] = [];\n for (const permission of permissions) {\n const section = sections.find(candidate => candidate.group === permission.group);\n if (section) section.permissions.push(permission);\n else sections.push({ ...(permission.group === undefined ? {} : { group: permission.group }), permissions: [permission] });\n }\n\n return sections;\n}\n"],"names":["records","value","Array","isArray","filter","entry","readRoles","seen","Set","flatMap","id","length","has","add","label","readPermissions","group","readGrants","roles","permissions","roleIds","map","role","permissionIds","permission","key","isGranted","grants","some","grant","setGrant","granted","sectionsOf","sections","section","find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,YAAaA,SAAAA,CAAUpB,KAAK,KAAKQ,UAAAA,CAAWR,KAAK,CAAA;AAC/E,QAAA,IAAIkB,OAAAA,EAASA,OAAAA,CAAQf,WAAW,CAACkB,IAAI,CAACb,UAAAA,CAAAA;AACjCS,aAAAA,QAAAA,CAASI,IAAI,CAAC;AAAE,YAAA,GAAIb,UAAAA,CAAWR,KAAK,KAAKsB,SAAAA,GAAY,EAAC,GAAI;AAAEtB,gBAAAA,KAAAA,EAAOQ,WAAWR;aAAO;YAAGG,WAAAA,EAAa;AAACK,gBAAAA;AAAW;AAAC,SAAA,CAAA;AAC3H,IAAA;IAEA,OAAOS,QAAAA;AACX;;;;;;;"}
@@ -0,0 +1,71 @@
1
+ 'use strict';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /** Where a file is in being uploaded. */ var UploadStatus = /*#__PURE__*/ function(UploadStatus) {
6
+ UploadStatus["Queued"] = "queued";
7
+ UploadStatus["Uploading"] = "uploading";
8
+ UploadStatus["Done"] = "done";
9
+ UploadStatus["Failed"] = "failed";
10
+ return UploadStatus;
11
+ }({});
12
+ /** Why a file was refused. */ var UploadRefusal = /*#__PURE__*/ function(UploadRefusal) {
13
+ UploadRefusal["WrongType"] = "wrongType";
14
+ UploadRefusal["TooLarge"] = "tooLarge";
15
+ UploadRefusal["Single"] = "single";
16
+ return UploadRefusal;
17
+ }({});
18
+ /** Whether a file matches an `accept` list; an empty list accepts everything, and matching ignores case. */ function matchesAccept(file, accept) {
19
+ const patterns = accept.split(',').map((pattern)=>pattern.trim().toLowerCase()).filter((pattern)=>pattern.length > 0);
20
+ if (patterns.length === 0) return true;
21
+ const name = file.name.toLowerCase();
22
+ const type = file.type.toLowerCase();
23
+ return patterns.some((pattern)=>pattern.startsWith('.') ? name.endsWith(pattern) : pattern.endsWith('/*') ? type.startsWith(pattern.slice(0, -1)) : type === pattern);
24
+ }
25
+ /** Sorts a selection into the files to take and the reasons for refusing the others. Only the first is taken when one file is allowed. */ function checkSelection(files, rules, alreadySelected = 0) {
26
+ const accepted = [];
27
+ const refused = [];
28
+ for (const file of files){
29
+ if (!matchesAccept(file, rules.accept)) refused.push({
30
+ file,
31
+ reason: "wrongType"
32
+ });
33
+ else if (rules.maximumBytes > 0 && file.size > rules.maximumBytes) refused.push({
34
+ file,
35
+ reason: "tooLarge"
36
+ });
37
+ else if (!rules.multiple && alreadySelected + accepted.length >= 1) refused.push({
38
+ file,
39
+ reason: "single"
40
+ });
41
+ else accepted.push(file);
42
+ }
43
+ return {
44
+ accepted,
45
+ refused
46
+ };
47
+ }
48
+ /** A file size in the largest unit that keeps it under 1024, for the locale. */ function formatBytes(bytes, locale) {
49
+ const units = [
50
+ 'B',
51
+ 'KB',
52
+ 'MB',
53
+ 'GB'
54
+ ];
55
+ let value = bytes;
56
+ let unit = 0;
57
+ while(value >= 1024 && unit < units.length - 1){
58
+ value /= 1024;
59
+ unit++;
60
+ }
61
+ return `${new Intl.NumberFormat(locale, {
62
+ maximumFractionDigits: unit === 0 ? 0 : 1
63
+ }).format(value)} ${units[unit]}`;
64
+ }
65
+
66
+ exports.UploadRefusal = UploadRefusal;
67
+ exports.UploadStatus = UploadStatus;
68
+ exports.checkSelection = checkSelection;
69
+ exports.formatBytes = formatBytes;
70
+ exports.matchesAccept = matchesAccept;
71
+ //# sourceMappingURL=uploadModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploadModel.js","sources":["../../../foundation/uploadModel.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/** Where a file is in being uploaded. */\nexport enum UploadStatus {\n Queued = 'queued',\n Uploading = 'uploading',\n Done = 'done',\n Failed = 'failed',\n}\n\n/** The rules a selection is checked against before anything is sent. */\nexport interface UploadRules {\n /** A comma-separated `accept` list: extensions (`.pdf`), MIME types (`image/png`) and wildcards (`image/*`). */\n accept: string;\n maximumBytes: number;\n multiple: boolean;\n}\n\n/** What the checker needs of a file. */\nexport interface SelectedFile {\n name: string;\n size: number;\n type: string;\n}\n\n/** Why a file was refused. */\nexport enum UploadRefusal {\n WrongType = 'wrongType',\n TooLarge = 'tooLarge',\n Single = 'single',\n}\n\n/** Whether a file matches an `accept` list; an empty list accepts everything, and matching ignores case. */\nexport function matchesAccept(file: SelectedFile, accept: string): boolean {\n const patterns = accept.split(',').map(pattern => pattern.trim().toLowerCase()).filter(pattern => pattern.length > 0);\n if (patterns.length === 0) return true;\n\n const name = file.name.toLowerCase();\n const type = file.type.toLowerCase();\n return patterns.some(pattern => pattern.startsWith('.') ? name.endsWith(pattern) : pattern.endsWith('/*') ? type.startsWith(pattern.slice(0, -1)) : type === pattern);\n}\n\n/** Sorts a selection into the files to take and the reasons for refusing the others. Only the first is taken when one file is allowed. */\nexport function checkSelection<T extends SelectedFile>(files: T[], rules: UploadRules, alreadySelected = 0): { accepted: T[]; refused: { file: T; reason: UploadRefusal }[] } {\n const accepted: T[] = [];\n const refused: { file: T; reason: UploadRefusal }[] = [];\n\n for (const file of files) {\n if (!matchesAccept(file, rules.accept)) refused.push({ file, reason: UploadRefusal.WrongType });\n else if (rules.maximumBytes > 0 && file.size > rules.maximumBytes) refused.push({ file, reason: UploadRefusal.TooLarge });\n else if (!rules.multiple && alreadySelected + accepted.length >= 1) refused.push({ file, reason: UploadRefusal.Single });\n else accepted.push(file);\n }\n\n return { accepted, refused };\n}\n\n/** A file size in the largest unit that keeps it under 1024, for the locale. */\nexport function formatBytes(bytes: number, locale: string): string {\n const units = ['B', 'KB', 'MB', 'GB'];\n let value = bytes;\n let unit = 0;\n while (value >= 1024 && unit < units.length - 1) { value /= 1024; unit++; }\n return `${new Intl.NumberFormat(locale, { maximumFractionDigits: unit === 0 ? 0 : 1 }).format(value)} ${units[unit]}`;\n}\n"],"names":["UploadStatus","UploadRefusal","matchesAccept","file","accept","patterns","split","map","pattern","trim","toLowerCase","filter","length","name","type","some","startsWith","endsWith","slice","checkSelection","files","rules","alreadySelected","accepted","refused","push","reason","maximumBytes","size","multiple","formatBytes","bytes","locale","units","value","unit","Intl","NumberFormat","maximumFractionDigits","format"],"mappings":";;AAAA;AACA;AAEA,0CACO,IAAKA,YAAAA,iBAAAA,SAAAA,YAAAA,EAAAA;;;;;AAAAA,IAAAA,OAAAA,YAAAA;AAKX,CAAA,CAAA,EAAA;AAiBD,+BACO,IAAKC,aAAAA,iBAAAA,SAAAA,aAAAA,EAAAA;;;;AAAAA,IAAAA,OAAAA,aAAAA;AAIX,CAAA,CAAA,EAAA;AAED,6GACO,SAASC,aAAAA,CAAcC,IAAkB,EAAEC,MAAc,EAAA;IAC5D,MAAMC,QAAAA,GAAWD,OAAOE,KAAK,CAAC,KAAKC,GAAG,CAACC,CAAAA,OAAAA,GAAWA,OAAAA,CAAQC,IAAI,EAAA,CAAGC,WAAW,IAAIC,MAAM,CAACH,CAAAA,OAAAA,GAAWA,OAAAA,CAAQI,MAAM,GAAG,CAAA,CAAA;AACnH,IAAA,IAAIP,QAAAA,CAASO,MAAM,KAAK,CAAA,EAAG,OAAO,IAAA;AAElC,IAAA,MAAMC,IAAAA,GAAOV,IAAAA,CAAKU,IAAI,CAACH,WAAW,EAAA;AAClC,IAAA,MAAMI,IAAAA,GAAOX,IAAAA,CAAKW,IAAI,CAACJ,WAAW,EAAA;IAClC,OAAOL,QAAAA,CAASU,IAAI,CAACP,CAAAA,OAAAA,GAAWA,OAAAA,CAAQQ,UAAU,CAAC,GAAA,CAAA,GAAOH,IAAAA,CAAKI,QAAQ,CAACT,OAAAA,CAAAA,GAAWA,QAAQS,QAAQ,CAAC,IAAA,CAAA,GAAQH,IAAAA,CAAKE,UAAU,CAACR,OAAAA,CAAQU,KAAK,CAAC,CAAA,EAAG,EAAC,CAAA,CAAA,GAAMJ,IAAAA,KAASN,OAAAA,CAAAA;AACjK;AAEA,2IACO,SAASW,cAAAA,CAAuCC,KAAU,EAAEC,KAAkB,EAAEC,eAAAA,GAAk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AAC1E,IAAA,OAAO,CAAA,EAAG,IAAIC,IAAAA,CAAKC,YAAY,CAACL,MAAAA,EAAQ;QAAEM,qBAAAA,EAAuBH,IAAAA,KAAS,IAAI,CAAA,GAAI;KAAE,CAAA,CAAGI,MAAM,CAACL,KAAAA,CAAAA,CAAO,CAAC,EAAED,KAAK,CAACE,KAAK,CAAA,CAAE;AACzH;;;;;;"}
package/dist/cjs/index.js CHANGED
@@ -74,6 +74,21 @@ var columnModel = require('./foundation/columnModel.js');
74
74
  var ColumnChooser = require('./foundation/ColumnChooser.js');
75
75
  var viewModel = require('./foundation/viewModel.js');
76
76
  var SavedViewsMenu = require('./foundation/SavedViewsMenu.js');
77
+ var checklistModel = require('./foundation/checklistModel.js');
78
+ var ChecklistSection = require('./foundation/ChecklistSection.js');
79
+ var activityModel = require('./foundation/activityModel.js');
80
+ var ActivityFeed = require('./foundation/ActivityFeed.js');
81
+ var avatarModel = require('./foundation/avatarModel.js');
82
+ var AvatarStack = require('./foundation/AvatarStack.js');
83
+ var uploadModel = require('./foundation/uploadModel.js');
84
+ var FileUploaderHandler = require('./foundation/FileUploaderHandler.js');
85
+ var FileUploader = require('./foundation/FileUploader.js');
86
+ var approvalModel = require('./foundation/approvalModel.js');
87
+ var ApprovalChainStepper = require('./foundation/ApprovalChainStepper.js');
88
+ var orgModel = require('./foundation/orgModel.js');
89
+ var OrgTree = require('./foundation/OrgTree.js');
90
+ var permissionModel = require('./foundation/permissionModel.js');
91
+ var PermissionMatrix = require('./foundation/PermissionMatrix.js');
77
92
  var foundationDescriptors = require('./foundation/foundationDescriptors.js');
78
93
  var foundationComponentMetadata = require('./foundation/foundationComponentMetadata.js');
79
94
  var foundationSamples = require('./foundation/foundationSamples.js');
@@ -268,6 +283,7 @@ exports.PermissionRule = PermissionRule.PermissionRule;
268
283
  exports.readPermissionRule = PermissionRule.readPermissionRule;
269
284
  exports.NumberFormat = formatting.NumberFormat;
270
285
  exports.formatDate = formatting.formatDate;
286
+ exports.formatDay = formatting.formatDay;
271
287
  exports.formatNumber = formatting.formatNumber;
272
288
  exports.isRightToLeft = formatting.isRightToLeft;
273
289
  exports.readLocale = formatting.readLocale;
@@ -316,6 +332,49 @@ exports.ColumnChooser = ColumnChooser.ColumnChooser;
316
332
  exports.readViews = viewModel.readViews;
317
333
  exports.SavedViewsMenu = SavedViewsMenu.SavedViewsMenu;
318
334
  exports.savedViewActionOutput = SavedViewsMenu.savedViewActionOutput;
335
+ exports.completed = checklistModel.completed;
336
+ exports.doneTaskIds = checklistModel.doneTaskIds;
337
+ exports.isOverdue = checklistModel.isOverdue;
338
+ exports.readChecklist = checklistModel.readChecklist;
339
+ exports.toggleTask = checklistModel.toggleTask;
340
+ exports.ChecklistSection = ChecklistSection.ChecklistSection;
341
+ exports.ActivityKind = activityModel.ActivityKind;
342
+ exports.dayOf = activityModel.dayOf;
343
+ exports.groupByDay = activityModel.groupByDay;
344
+ exports.readActivity = activityModel.readActivity;
345
+ exports.ActivityFeed = ActivityFeed.ActivityFeed;
346
+ exports.initialsOf = avatarModel.initialsOf;
347
+ exports.readPeople = avatarModel.readPeople;
348
+ exports.visiblePeople = avatarModel.visiblePeople;
349
+ exports.AvatarStack = AvatarStack.AvatarStack;
350
+ exports.UploadRefusal = uploadModel.UploadRefusal;
351
+ exports.UploadStatus = uploadModel.UploadStatus;
352
+ exports.checkSelection = uploadModel.checkSelection;
353
+ exports.formatBytes = uploadModel.formatBytes;
354
+ exports.matchesAccept = uploadModel.matchesAccept;
355
+ exports.FileUploaderHandlerProvider = FileUploaderHandler.FileUploaderHandlerProvider;
356
+ exports.useFileUploaderHandler = FileUploaderHandler.useFileUploaderHandler;
357
+ exports.FileUploader = FileUploader.FileUploader;
358
+ exports.ApprovalState = approvalModel.ApprovalState;
359
+ exports.ChainOutcome = approvalModel.ChainOutcome;
360
+ exports.chainOutcome = approvalModel.chainOutcome;
361
+ exports.effectiveSteps = approvalModel.effectiveSteps;
362
+ exports.readSteps = approvalModel.readSteps;
363
+ exports.ApprovalChainStepper = ApprovalChainStepper.ApprovalChainStepper;
364
+ exports.buildOrgTree = orgModel.buildOrgTree;
365
+ exports.descendantCount = orgModel.descendantCount;
366
+ exports.expandedToDepth = orgModel.expandedToDepth;
367
+ exports.placements = orgModel.placements;
368
+ exports.readOrgNodes = orgModel.readOrgNodes;
369
+ exports.visibleNodes = orgModel.visibleNodes;
370
+ exports.OrgTree = OrgTree.OrgTree;
371
+ exports.isGranted = permissionModel.isGranted;
372
+ exports.readGrants = permissionModel.readGrants;
373
+ exports.readPermissions = permissionModel.readPermissions;
374
+ exports.readRoles = permissionModel.readRoles;
375
+ exports.sectionsOf = permissionModel.sectionsOf;
376
+ exports.setGrant = permissionModel.setGrant;
377
+ exports.PermissionMatrix = PermissionMatrix.PermissionMatrix;
319
378
  exports.bindable = foundationDescriptors.bindable;
320
379
  exports.foundationDescriptors = foundationDescriptors.foundationDescriptors;
321
380
  exports.list = foundationDescriptors.list;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -22,6 +22,13 @@ export declare enum ComponentName {
22
22
  ChartWrapper = "chartWrapper",
23
23
  FilterBuilder = "filterBuilder",
24
24
  ColumnChooser = "columnChooser",
25
- SavedViewsMenu = "savedViewsMenu"
25
+ SavedViewsMenu = "savedViewsMenu",
26
+ ChecklistSection = "checklistSection",
27
+ ActivityFeed = "activityFeed",
28
+ AvatarStack = "avatarStack",
29
+ FileUploader = "fileUploader",
30
+ ApprovalChainStepper = "approvalChainStepper",
31
+ OrgTree = "orgTree",
32
+ PermissionMatrix = "permissionMatrix"
26
33
  }
27
34
  //# sourceMappingURL=ComponentName.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComponentName.d.ts","sourceRoot":"","sources":["../../ComponentName.ts"],"names":[],"mappings":"AAWA,oBAAY,aAAa;IAErB,QAAQ,aAAa;IAGrB,aAAa,kBAAkB;IAG/B,MAAM,WAAW;IAGjB,OAAO,YAAY;IAGnB,IAAI,SAAS;IAGb,QAAQ,aAAa;IAGrB,UAAU,eAAe;IAGzB,MAAM,WAAW;IAGjB,UAAU,eAAe;IAGzB,WAAW,gBAAgB;IAG3B,UAAU,eAAe;IAGzB,IAAI,SAAS;IAGb,IAAI,SAAS;IAGb,QAAQ,aAAa;IAGrB,aAAa,kBAAkB;IAG/B,kBAAkB,uBAAuB;IAGzC,UAAU,eAAe;IAGzB,QAAQ,aAAa;IAGrB,SAAS,cAAc;IAGvB,UAAU,eAAe;IAGzB,YAAY,iBAAiB;IAG7B,aAAa,kBAAkB;IAG/B,aAAa,kBAAkB;IAG/B,cAAc,mBAAmB;CACpC"}
1
+ {"version":3,"file":"ComponentName.d.ts","sourceRoot":"","sources":["../../ComponentName.ts"],"names":[],"mappings":"AAWA,oBAAY,aAAa;IAErB,QAAQ,aAAa;IAGrB,aAAa,kBAAkB;IAG/B,MAAM,WAAW;IAGjB,OAAO,YAAY;IAGnB,IAAI,SAAS;IAGb,QAAQ,aAAa;IAGrB,UAAU,eAAe;IAGzB,MAAM,WAAW;IAGjB,UAAU,eAAe;IAGzB,WAAW,gBAAgB;IAG3B,UAAU,eAAe;IAGzB,IAAI,SAAS;IAGb,IAAI,SAAS;IAGb,QAAQ,aAAa;IAGrB,aAAa,kBAAkB;IAG/B,kBAAkB,uBAAuB;IAGzC,UAAU,eAAe;IAGzB,QAAQ,aAAa;IAGrB,SAAS,cAAc;IAGvB,UAAU,eAAe;IAGzB,YAAY,iBAAiB;IAG7B,aAAa,kBAAkB;IAG/B,aAAa,kBAAkB;IAG/B,cAAc,mBAAmB;IAGjC,gBAAgB,qBAAqB;IAGrC,YAAY,iBAAiB;IAG7B,WAAW,gBAAgB;IAG3B,YAAY,iBAAiB;IAG7B,oBAAoB,yBAAyB;IAG7C,OAAO,YAAY;IAGnB,gBAAgB,qBAAqB;CACxC"}
@@ -32,6 +32,13 @@
32
32
  /** Conditions on fields, joined by AND or OR in nested groups. */ ComponentName["FilterBuilder"] = "filterBuilder";
33
33
  /** Which columns a table shows, and in what order. */ ComponentName["ColumnChooser"] = "columnChooser";
34
34
  /** A list's saved views as a menu button. */ ComponentName["SavedViewsMenu"] = "savedViewsMenu";
35
+ /** Sections of tasks with owner, due date and progress. */ ComponentName["ChecklistSection"] = "checklistSection";
36
+ /** What happened to a record, grouped by day. */ ComponentName["ActivityFeed"] = "activityFeed";
37
+ /** Overlapping avatars for the people on a record. */ ComponentName["AvatarStack"] = "avatarStack";
38
+ /** A drop zone and file picker with type and size checks. */ ComponentName["FileUploader"] = "fileUploader";
39
+ /** The steps a request goes through, who decides each, and where it stands. */ ComponentName["ApprovalChainStepper"] = "approvalChainStepper";
40
+ /** An organization as an expandable tree. */ ComponentName["OrgTree"] = "orgTree";
41
+ /** Roles across, permissions down, a checkbox where they meet. */ ComponentName["PermissionMatrix"] = "permissionMatrix";
35
42
  return ComponentName;
36
43
  }({});
37
44
 
@@ -1 +1 @@
1
- {"version":3,"file":"ComponentName.js","sources":["../../ComponentName.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 bare names this package declares components under.\n *\n * A page template writes a bare name and `resolveComponentName` decides which active package wins it, so\n * these names are public API: renaming one breaks every template that referenced it, in this package and\n * in anyone else's. Keeping them in one enum means the manifest, the registry and every template\n * reference the same symbol, and the specs can prove all three agree rather than hoping they do.\n */\nexport enum ComponentName {\n /** The application shell - topbar, sidebar, breadcrumb, content, footer and an optional right panel. */\n AppShell = 'appShell',\n\n /** The chrome-less shell - content, an optional branding aside, and the configurator. */\n FullPageShell = 'fullPageShell',\n\n /** The fixed strip across the top of the application shell. */\n Topbar = 'topbar',\n\n /** The sidebar's own chrome, inside the shell-positioned panel. */\n Sidebar = 'sidebar',\n\n /** A navigation list. */\n Menu = 'menu',\n\n /** One entry in a navigation list, optionally with a submenu. */\n MenuItem = 'menuItem',\n\n /** The trail above the content. */\n Breadcrumb = 'breadcrumb',\n\n /** The strip below the content. */\n Footer = 'footer',\n\n /** The inspector panel down the right-hand edge. */\n RightPanel = 'rightPanel',\n\n /** The floating configurator: color scheme, layout mode, menu theme and theme. */\n ConfigPanel = 'configPanel',\n\n /** A screen's title, subtitle and actions. */\n PageHeader = 'pageHeader',\n\n /** The scrim behind a floating sidebar, which also closes it. */\n Mask = 'mask',\n\n /** The brand mark. */\n Logo = 'logo',\n\n /** The signed-in user's avatar and menu. */\n UserMenu = 'userMenu',\n\n /** Switches between the themes a host offers. */\n ThemeSwitcher = 'themeSwitcher',\n\n /** Switches between the layout modes. */\n LayoutModeSwitcher = 'layoutModeSwitcher',\n\n /** An icon, a headline, a hint and one primary action: what a region says when it has nothing to show. */\n EmptyState = 'emptyState',\n\n /** One key figure with its label, trend and comparison period. */\n StatCard = 'statCard',\n\n /** A change drawn as a direction, a magnitude and whether it is good. */\n TrendChip = 'trendChip',\n\n /** A status as a semantic color, an icon and its text. */\n StatusChip = 'statusChip',\n\n /** One chart - line, bar, stacked, donut or funnel - with its legend and a table of the same data. */\n ChartWrapper = 'chartWrapper',\n\n /** Conditions on fields, joined by AND or OR in nested groups. */\n FilterBuilder = 'filterBuilder',\n\n /** Which columns a table shows, and in what order. */\n ColumnChooser = 'columnChooser',\n\n /** A list's saved views as a menu button. */\n SavedViewsMenu = 'savedViewsMenu',\n}\n"],"names":["ComponentName"],"mappings":"AAAA;AACA;AAEA;;;;;;;IAQO,IAAKA,aAAAA,iBAAAA,SAAAA,aAAAA,EAAAA;6GAC8F,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;8FAGf,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;oEAG1B,aAAA,CAAA,QAAA,CAAA,GAAA,QAAA;wEAGI,aAAA,CAAA,SAAA,CAAA,GAAA,SAAA;8BAG1C,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;sEAGwC,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;wCAG9B,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;wCAGA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAA;yDAGiB,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;uFAG8B,aAAA,CAAA,aAAA,CAAA,GAAA,aAAA;mDAGpC,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;sEAGmB,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;2BAG3C,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;iDAGsB,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;sDAGK,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;8CAGR,aAAA,CAAA,oBAAA,CAAA,GAAA,oBAAA;+GAGiE,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;uEAGxC,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;8EAGO,aAAA,CAAA,WAAA,CAAA,GAAA,WAAA;+DAGf,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;2GAG4C,aAAA,CAAA,cAAA,CAAA,GAAA,cAAA;uEAGpC,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;2DAGZ,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;kDAGT,aAAA,CAAA,gBAAA,CAAA,GAAA,gBAAA;AAtEnCA,IAAAA,OAAAA,aAAAA;AAwEX,CAAA,CAAA,EAAA;;"}
1
+ {"version":3,"file":"ComponentName.js","sources":["../../ComponentName.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 bare names this package declares components under.\n *\n * A page template writes a bare name and `resolveComponentName` decides which active package wins it, so\n * these names are public API: renaming one breaks every template that referenced it, in this package and\n * in anyone else's. Keeping them in one enum means the manifest, the registry and every template\n * reference the same symbol, and the specs can prove all three agree rather than hoping they do.\n */\nexport enum ComponentName {\n /** The application shell - topbar, sidebar, breadcrumb, content, footer and an optional right panel. */\n AppShell = 'appShell',\n\n /** The chrome-less shell - content, an optional branding aside, and the configurator. */\n FullPageShell = 'fullPageShell',\n\n /** The fixed strip across the top of the application shell. */\n Topbar = 'topbar',\n\n /** The sidebar's own chrome, inside the shell-positioned panel. */\n Sidebar = 'sidebar',\n\n /** A navigation list. */\n Menu = 'menu',\n\n /** One entry in a navigation list, optionally with a submenu. */\n MenuItem = 'menuItem',\n\n /** The trail above the content. */\n Breadcrumb = 'breadcrumb',\n\n /** The strip below the content. */\n Footer = 'footer',\n\n /** The inspector panel down the right-hand edge. */\n RightPanel = 'rightPanel',\n\n /** The floating configurator: color scheme, layout mode, menu theme and theme. */\n ConfigPanel = 'configPanel',\n\n /** A screen's title, subtitle and actions. */\n PageHeader = 'pageHeader',\n\n /** The scrim behind a floating sidebar, which also closes it. */\n Mask = 'mask',\n\n /** The brand mark. */\n Logo = 'logo',\n\n /** The signed-in user's avatar and menu. */\n UserMenu = 'userMenu',\n\n /** Switches between the themes a host offers. */\n ThemeSwitcher = 'themeSwitcher',\n\n /** Switches between the layout modes. */\n LayoutModeSwitcher = 'layoutModeSwitcher',\n\n /** An icon, a headline, a hint and one primary action: what a region says when it has nothing to show. */\n EmptyState = 'emptyState',\n\n /** One key figure with its label, trend and comparison period. */\n StatCard = 'statCard',\n\n /** A change drawn as a direction, a magnitude and whether it is good. */\n TrendChip = 'trendChip',\n\n /** A status as a semantic color, an icon and its text. */\n StatusChip = 'statusChip',\n\n /** One chart - line, bar, stacked, donut or funnel - with its legend and a table of the same data. */\n ChartWrapper = 'chartWrapper',\n\n /** Conditions on fields, joined by AND or OR in nested groups. */\n FilterBuilder = 'filterBuilder',\n\n /** Which columns a table shows, and in what order. */\n ColumnChooser = 'columnChooser',\n\n /** A list's saved views as a menu button. */\n SavedViewsMenu = 'savedViewsMenu',\n\n /** Sections of tasks with owner, due date and progress. */\n ChecklistSection = 'checklistSection',\n\n /** What happened to a record, grouped by day. */\n ActivityFeed = 'activityFeed',\n\n /** Overlapping avatars for the people on a record. */\n AvatarStack = 'avatarStack',\n\n /** A drop zone and file picker with type and size checks. */\n FileUploader = 'fileUploader',\n\n /** The steps a request goes through, who decides each, and where it stands. */\n ApprovalChainStepper = 'approvalChainStepper',\n\n /** An organization as an expandable tree. */\n OrgTree = 'orgTree',\n\n /** Roles across, permissions down, a checkbox where they meet. */\n PermissionMatrix = 'permissionMatrix',\n}\n"],"names":["ComponentName"],"mappings":"AAAA;AACA;AAEA;;;;;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AAA,GAAA,aAAA;kEAGO,aAAA,CAAA,cAAA,CAAA,GAAA,cAAA;oFAGkB,aAAA,CAAA,sBAAA,CAAA,GAAA,sBAAA;kDAGlC,aAAA,CAAA,SAAA,CAAA,GAAA,SAAA;uEAGqB,aAAA,CAAA,kBAAA,CAAA,GAAA,kBAAA;AA3FxDA,IAAAA,OAAAA,aAAAA;AA6FX,CAAA,CAAA,EAAA;;"}
@@ -5,6 +5,8 @@ import { defaultBlueprintComponentMetadata } from './defaultBlueprintComponentMe
5
5
  import './foundation/ComponentState.js';
6
6
  import 'react/jsx-runtime';
7
7
  import 'react';
8
+ import './foundation/ActivityFeed.js';
9
+ import './foundation/ApprovalChainStepper.js';
8
10
  import { foundationDescriptors } from './foundation/foundationDescriptors.js';
9
11
  import './foundation/foundationComponentMetadata.js';
10
12
  import './foundation/foundationSamples.js';
@@ -1 +1 @@
1
- {"version":3,"file":"defaultBlueprint.js","sources":["../../defaultBlueprint.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 { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle, describeComponents } from '@cratis/scene.react';\nimport { ComponentName } from './ComponentName';\nimport { defaultBlueprintComponentMetadata } from './defaultBlueprintComponentMetadata';\nimport { foundationDescriptors } from './foundation';\nimport { defaultBlueprintComponents } from './defaultBlueprintComponents';\nimport { galleryDialogTemplates, galleryScreenTemplates, galleryScreens } from './gallery';\nimport { LayoutName, defaultLayouts } from './layouts';\nimport { defaultBlueprintName } from './packageName';\nimport { defaultBlueprintThemes } from './themes';\n\n/**\n * The default blueprint's declaration.\n *\n * A blueprint is the package an application picks once to get a coherent shape: the {@link Layout}s that\n * are its base navigational look, the {@link ScreenTemplate}s and {@link DialogTemplate}s that go inside\n * them, the components that fill their slots, and the themes that color all of it. Picking the parts\n * separately is how an application ends up with a sidebar from one design language and a form from\n * another.\n *\n * The dependency list is what makes a blueprint honest about what it is built from. This one declares\n * PrimeReact - the shell's buttons, breadcrumb, overlay menu and drawer are PrimeReact 10 components - and\n * Cratis Components, which its screen templates fill their content with. A profile that activated this\n * blueprint without them would render a shell whose every control was a dashed red placeholder, and\n * `resolvePackageDependencies` exists to catch that when the profile is configured rather than when\n * someone opens the page.\n *\n * `layouts` lists only true application shells. A dashboard, a CRUD list or a sign-in screen is a screen\n * template, not a layout, and is listed as one.\n */\nexport const defaultBlueprintManifest: ScenePackage = {\n name: defaultBlueprintName,\n version: '1.0.0',\n kind: PackageKind.Blueprint,\n dependencies: [{ name: 'PrimeReact' }, { name: 'Cratis.Components' }],\n components: Object.values(ComponentName),\n layouts: Object.values(LayoutName),\n screenTemplates: galleryScreenTemplates.map(template => template.name),\n dialogTemplates: galleryDialogTemplates.map(template => template.name),\n themes: defaultBlueprintThemes.map(theme => theme.name),\n displayName: 'Cratis Default Blueprint',\n description: 'Application shells with eight menu modes, the components that fill their slots, and a full screen and dialog template set.',\n module: '@cratis/scene.blueprint.default',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n\n/**\n * The default blueprint as a loadable bundle.\n *\n * The manifest names things; this provides them. `validatePackageBundle` is what proves the two agree, and\n * this package's specs run it - a manifest promising a component the bundle never registered renders as a\n * dashed red placeholder somewhere deep inside a screen, a long way from the declaration that caused it.\n *\n * The screens are the gallery: real {@link Screen} instances naming a layout, a screen template and the\n * content that fills it, so a preview boots them through the real engine as a working miniature\n * application rather than a set of pictures.\n */\nexport const defaultBlueprint: ScenePackageBundle = {\n manifest: defaultBlueprintManifest,\n components: defaultBlueprintComponents,\n layouts: defaultLayouts,\n screenTemplates: galleryScreenTemplates,\n dialogTemplates: galleryDialogTemplates,\n screens: galleryScreens,\n themes: defaultBlueprintThemes,\n descriptors: describeComponents(defaultBlueprintManifest.name, foundationDescriptors, defaultBlueprintComponentMetadata),\n};\n"],"names":["defaultBlueprintManifest","name","defaultBlueprintName","version","kind","PackageKind","Blueprint","dependencies","components","Object","values","ComponentName","layouts","LayoutName","screenTemplates","galleryScreenTemplates","map","template","dialogTemplates","galleryDialogTemplates","themes","defaultBlueprintThemes","theme","displayName","description","module","license","licenseUrl","defaultBlueprint","manifest","defaultBlueprintComponents","defaultLayouts","screens","galleryScreens","descriptors","describeComponents","foundationDescriptors","defaultBlueprintComponentMetadata"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAaA;;;;;;;;;;;;;;;;;;UAmBaA,wBAAAA,GAAyC;IAClDC,IAAAA,EAAMC,oBAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,YAAYC,SAAS;IAC3BC,YAAAA,EAAc;AAAC,QAAA;YAAEN,IAAAA,EAAM;AAAa,SAAA;AAAG,QAAA;YAAEA,IAAAA,EAAM;AAAoB;AAAE,KAAA;IACrEO,UAAAA,EAAYC,MAAAA,CAAOC,MAAM,CAACC,aAAAA,CAAAA;IAC1BC,OAAAA,EAASH,MAAAA,CAAOC,MAAM,CAACG,UAAAA,CAAAA;AACvBC,IAAAA,eAAAA,EAAiBC,uBAAuBC,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAAShB,IAAI,CAAA;AACrEiB,IAAAA,eAAAA,EAAiBC,uBAAuBH,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAAShB,IAAI,CAAA;AACrEmB,IAAAA,MAAAA,EAAQC,uBAAuBL,GAAG,CAACM,CAAAA,KAAAA,GAASA,MAAMrB,IAAI,CAAA;IACtDsB,WAAAA,EAAa,0BAAA;IACbC,WAAAA,EAAa,4HAAA;IACbC,MAAAA,EAAQ,iCAAA;IACRC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;AAEA;;;;;;;;;;UAWaC,gBAAAA,GAAuC;IAChDC,QAAAA,EAAU7B,wBAAAA;IACVQ,UAAAA,EAAYsB,0BAAAA;IACZlB,OAAAA,EAASmB,cAAAA;IACTjB,eAAAA,EAAiBC,sBAAAA;IACjBG,eAAAA,EAAiBC,sBAAAA;IACjBa,OAAAA,EAASC,cAAAA;IACTb,MAAAA,EAAQC,sBAAAA;AACRa,IAAAA,WAAAA,EAAaC,kBAAAA,CAAmBnC,wBAAAA,CAAyBC,IAAI,EAAEmC,qBAAAA,EAAuBC,iCAAAA;AAC1F;;"}
1
+ {"version":3,"file":"defaultBlueprint.js","sources":["../../defaultBlueprint.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 { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle, describeComponents } from '@cratis/scene.react';\nimport { ComponentName } from './ComponentName';\nimport { defaultBlueprintComponentMetadata } from './defaultBlueprintComponentMetadata';\nimport { foundationDescriptors } from './foundation';\nimport { defaultBlueprintComponents } from './defaultBlueprintComponents';\nimport { galleryDialogTemplates, galleryScreenTemplates, galleryScreens } from './gallery';\nimport { LayoutName, defaultLayouts } from './layouts';\nimport { defaultBlueprintName } from './packageName';\nimport { defaultBlueprintThemes } from './themes';\n\n/**\n * The default blueprint's declaration.\n *\n * A blueprint is the package an application picks once to get a coherent shape: the {@link Layout}s that\n * are its base navigational look, the {@link ScreenTemplate}s and {@link DialogTemplate}s that go inside\n * them, the components that fill their slots, and the themes that color all of it. Picking the parts\n * separately is how an application ends up with a sidebar from one design language and a form from\n * another.\n *\n * The dependency list is what makes a blueprint honest about what it is built from. This one declares\n * PrimeReact - the shell's buttons, breadcrumb, overlay menu and drawer are PrimeReact 10 components - and\n * Cratis Components, which its screen templates fill their content with. A profile that activated this\n * blueprint without them would render a shell whose every control was a dashed red placeholder, and\n * `resolvePackageDependencies` exists to catch that when the profile is configured rather than when\n * someone opens the page.\n *\n * `layouts` lists only true application shells. A dashboard, a CRUD list or a sign-in screen is a screen\n * template, not a layout, and is listed as one.\n */\nexport const defaultBlueprintManifest: ScenePackage = {\n name: defaultBlueprintName,\n version: '1.0.0',\n kind: PackageKind.Blueprint,\n dependencies: [{ name: 'PrimeReact' }, { name: 'Cratis.Components' }],\n components: Object.values(ComponentName),\n layouts: Object.values(LayoutName),\n screenTemplates: galleryScreenTemplates.map(template => template.name),\n dialogTemplates: galleryDialogTemplates.map(template => template.name),\n themes: defaultBlueprintThemes.map(theme => theme.name),\n displayName: 'Cratis Default Blueprint',\n description: 'Application shells with eight menu modes, the components that fill their slots, and a full screen and dialog template set.',\n module: '@cratis/scene.blueprint.default',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n\n/**\n * The default blueprint as a loadable bundle.\n *\n * The manifest names things; this provides them. `validatePackageBundle` is what proves the two agree, and\n * this package's specs run it - a manifest promising a component the bundle never registered renders as a\n * dashed red placeholder somewhere deep inside a screen, a long way from the declaration that caused it.\n *\n * The screens are the gallery: real {@link Screen} instances naming a layout, a screen template and the\n * content that fills it, so a preview boots them through the real engine as a working miniature\n * application rather than a set of pictures.\n */\nexport const defaultBlueprint: ScenePackageBundle = {\n manifest: defaultBlueprintManifest,\n components: defaultBlueprintComponents,\n layouts: defaultLayouts,\n screenTemplates: galleryScreenTemplates,\n dialogTemplates: galleryDialogTemplates,\n screens: galleryScreens,\n themes: defaultBlueprintThemes,\n descriptors: describeComponents(defaultBlueprintManifest.name, foundationDescriptors, defaultBlueprintComponentMetadata),\n};\n"],"names":["defaultBlueprintManifest","name","defaultBlueprintName","version","kind","PackageKind","Blueprint","dependencies","components","Object","values","ComponentName","layouts","LayoutName","screenTemplates","galleryScreenTemplates","map","template","dialogTemplates","galleryDialogTemplates","themes","defaultBlueprintThemes","theme","displayName","description","module","license","licenseUrl","defaultBlueprint","manifest","defaultBlueprintComponents","defaultLayouts","screens","galleryScreens","descriptors","describeComponents","foundationDescriptors","defaultBlueprintComponentMetadata"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAaA;;;;;;;;;;;;;;;;;;UAmBaA,wBAAAA,GAAyC;IAClDC,IAAAA,EAAMC,oBAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,YAAYC,SAAS;IAC3BC,YAAAA,EAAc;AAAC,QAAA;YAAEN,IAAAA,EAAM;AAAa,SAAA;AAAG,QAAA;YAAEA,IAAAA,EAAM;AAAoB;AAAE,KAAA;IACrEO,UAAAA,EAAYC,MAAAA,CAAOC,MAAM,CAACC,aAAAA,CAAAA;IAC1BC,OAAAA,EAASH,MAAAA,CAAOC,MAAM,CAACG,UAAAA,CAAAA;AACvBC,IAAAA,eAAAA,EAAiBC,uBAAuBC,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAAShB,IAAI,CAAA;AACrEiB,IAAAA,eAAAA,EAAiBC,uBAAuBH,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAAShB,IAAI,CAAA;AACrEmB,IAAAA,MAAAA,EAAQC,uBAAuBL,GAAG,CAACM,CAAAA,KAAAA,GAASA,MAAMrB,IAAI,CAAA;IACtDsB,WAAAA,EAAa,0BAAA;IACbC,WAAAA,EAAa,4HAAA;IACbC,MAAAA,EAAQ,iCAAA;IACRC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;AAEA;;;;;;;;;;UAWaC,gBAAAA,GAAuC;IAChDC,QAAAA,EAAU7B,wBAAAA;IACVQ,UAAAA,EAAYsB,0BAAAA;IACZlB,OAAAA,EAASmB,cAAAA;IACTjB,eAAAA,EAAiBC,sBAAAA;IACjBG,eAAAA,EAAiBC,sBAAAA;IACjBa,OAAAA,EAASC,cAAAA;IACTb,MAAAA,EAAQC,sBAAAA;AACRa,IAAAA,WAAAA,EAAaC,kBAAAA,CAAmBnC,wBAAAA,CAAyBC,IAAI,EAAEmC,qBAAAA,EAAuBC,iCAAAA;AAC1F;;"}
@@ -3,6 +3,8 @@ import './foundation/ComponentState.js';
3
3
  import 'react/jsx-runtime';
4
4
  import 'react';
5
5
  import { componentMetadata, navigationDesignMode } from '@cratis/scene.react';
6
+ import './foundation/ActivityFeed.js';
7
+ import './foundation/ApprovalChainStepper.js';
6
8
  import './foundation/foundationDescriptors.js';
7
9
  import { foundationComponentMetadata } from './foundation/foundationComponentMetadata.js';
8
10
  import './foundation/foundationSamples.js';
@@ -1 +1 @@
1
- {"version":3,"file":"defaultBlueprintComponentMetadata.js","sources":["../../defaultBlueprintComponentMetadata.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 { ComponentCategory } from '@cratis/scene.model';\nimport { foundationComponentMetadata } from './foundation';\nimport { ComponentMetadata, componentMetadata as m, navigationDesignMode } from '@cratis/scene.react';\n\n/** The category, icon, keywords and picker badge of every component of the package (CMP1), keyed by bare component name. */\nexport const defaultBlueprintComponentMetadata: Record<string, ComponentMetadata> = {\n ...foundationComponentMetadata,\n appShell: m('Application shell', ComponentCategory.Layout, 'app-window', ['layout', 'frame', 'chrome']),\n fullPageShell: m('Full page shell', ComponentCategory.Layout, 'maximize', ['layout', 'fullscreen', 'frame']),\n topbar: m('Topbar', ComponentCategory.Navigation, 'panel-top', ['header', 'top bar', 'navigation'], 'Tp', navigationDesignMode()),\n sidebar: m('Side bar', ComponentCategory.Navigation, 'panel-left', ['navigation', 'menu', 'side panel'], 'Sb', navigationDesignMode({ sidebar: true })),\n menu: m('Menu', ComponentCategory.Navigation, 'menu', ['navigation', 'list', 'links']),\n menuItem: m('Menu item', ComponentCategory.Navigation, 'minus', ['link', 'entry', 'navigation']),\n breadcrumb: m('Breadcrumbs', ComponentCategory.Navigation, 'chevron-right', ['trail', 'path', 'navigation']),\n footer: m('Footer', ComponentCategory.Layout, 'panel-bottom', ['bottom', 'page footer']),\n rightPanel: m('Right panel', ComponentCategory.Layout, 'panel-right', ['side panel', 'drawer', 'aside']),\n configPanel: m('Config panel', ComponentCategory.Layout, 'settings', ['settings', 'layout options', 'preferences']),\n pageHeader: m('Page header', ComponentCategory.Layout, 'heading', ['title', 'header', 'page title']),\n mask: m('Mask', ComponentCategory.Feedback, 'layers', ['overlay', 'scrim', 'backdrop']),\n logo: m('Logo', ComponentCategory.DataDisplay, 'badge', ['brand', 'identity', 'image']),\n userMenu: m('User menu', ComponentCategory.Actions, 'circle-user', ['account', 'profile', 'sign out']),\n themeSwitcher: m('Theme switcher', ComponentCategory.Actions, 'palette', ['theme', 'dark mode', 'colors']),\n layoutModeSwitcher: m('Layout mode switcher', ComponentCategory.Actions, 'layout-dashboard', ['layout', 'mode', 'navigation style']),\n};\n"],"names":["defaultBlueprintComponentMetadata","foundationComponentMetadata","appShell","m","ComponentCategory","Layout","fullPageShell","topbar","Navigation","navigationDesignMode","sidebar","menu","menuItem","breadcrumb","footer","rightPanel","configPanel","pageHeader","mask","Feedback","logo","DataDisplay","userMenu","Actions","themeSwitcher","layoutModeSwitcher"],"mappings":";;;;;;;;;;AAAA;AACA;AAMA,6HACO,MAAMA,iCAAAA,GAAuE;AAChF,IAAA,GAAGC,2BAA2B;AAC9BC,IAAAA,QAAAA,EAAUC,iBAAAA,CAAE,mBAAA,EAAqBC,iBAAAA,CAAkBC,MAAM,EAAE,YAAA,EAAc;AAAC,QAAA,QAAA;AAAU,QAAA,OAAA;AAAS,QAAA;AAAS,KAAA,CAAA;AACtGC,IAAAA,aAAAA,EAAeH,iBAAAA,CAAE,iBAAA,EAAmBC,iBAAAA,CAAkBC,MAAM,EAAE,UAAA,EAAY;AAAC,QAAA,QAAA;AAAU,QAAA,YAAA;AAAc,QAAA;AAAQ,KAAA,CAAA;AAC3GE,IAAAA,MAAAA,EAAQJ,iBAAAA,CAAE,QAAA,EAAUC,iBAAAA,CAAkBI,UAAU,EAAE,WAAA,EAAa;AAAC,QAAA,QAAA;AAAU,QAAA,SAAA;AAAW,QAAA;AAAa,KAAA,EAAE,IAAA,EAAMC,oBAAAA,EAAAA,CAAAA;AAC1GC,IAAAA,OAAAA,EAASP,iBAAAA,CAAE,UAAA,EAAYC,iBAAAA,CAAkBI,UAAU,EAAE,Y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A,OAAA;AAAS,QAAA,QAAA;AAAU,QAAA;AAAa,KAAA,CAAA;AACnGa,IAAAA,IAAAA,EAAMf,iBAAAA,CAAE,MAAA,EAAQC,iBAAAA,CAAkBe,QAAQ,EAAE,QAAA,EAAU;AAAC,QAAA,SAAA;AAAW,QAAA,OAAA;AAAS,QAAA;AAAW,KAAA,CAAA;AACtFC,IAAAA,IAAAA,EAAMjB,iBAAAA,CAAE,MAAA,EAAQC,iBAAAA,CAAkBiB,WAAW,EAAE,OAAA,EAAS;AAAC,QAAA,OAAA;AAAS,QAAA,UAAA;AAAY,QAAA;AAAQ,KAAA,CAAA;AACtFC,IAAAA,QAAAA,EAAUnB,iBAAAA,CAAE,WAAA,EAAaC,iBAAAA,CAAkBmB,OAAO,EAAE,aAAA,EAAe;AAAC,QAAA,SAAA;AAAW,QAAA,SAAA;AAAW,QAAA;AAAW,KAAA,CAAA;AACrGC,IAAAA,aAAAA,EAAerB,iBAAAA,CAAE,gBAAA,EAAkBC,iBAAAA,CAAkBmB,OAAO,EAAE,SAAA,EAAW;AAAC,QAAA,OAAA;AAAS,QAAA,WAAA;AAAa,QAAA;AAAS,KAAA,CAAA;AACzGE,IAAAA,kBAAAA,EAAoBtB,iBAAAA,CAAE,sBAAA,EAAwBC,iBAAAA,CAAkBmB,OAAO,EAAE,kBAAA,EAAoB;AAAC,QAAA,QAAA;AAAU,QAAA,MAAA;AAAQ,QAAA;AAAmB,KAAA;AACvI;;"}
1
+ {"version":3,"file":"defaultBlueprintComponentMetadata.js","sources":["../../defaultBlueprintComponentMetadata.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 { ComponentCategory } from '@cratis/scene.model';\nimport { foundationComponentMetadata } from './foundation';\nimport { ComponentMetadata, componentMetadata as m, navigationDesignMode } from '@cratis/scene.react';\n\n/** The category, icon, keywords and picker badge of every component of the package (CMP1), keyed by bare component name. */\nexport const defaultBlueprintComponentMetadata: Record<string, ComponentMetadata> = {\n ...foundationComponentMetadata,\n appShell: m('Application shell', ComponentCategory.Layout, 'app-window', ['layout', 'frame', 'chrome']),\n fullPageShell: m('Full page shell', ComponentCategory.Layout, 'maximize', ['layout', 'fullscreen', 'frame']),\n topbar: m('Topbar', ComponentCategory.Navigation, 'panel-top', ['header', 'top bar', 'navigation'], 'Tp', navigationDesignMode()),\n sidebar: m('Side bar', ComponentCategory.Navigation, 'panel-left', ['navigation', 'menu', 'side panel'], 'Sb', navigationDesignMode({ sidebar: true })),\n menu: m('Menu', ComponentCategory.Navigation, 'menu', ['navigation', 'list', 'links']),\n menuItem: m('Menu item', ComponentCategory.Navigation, 'minus', ['link', 'entry', 'navigation']),\n breadcrumb: m('Breadcrumbs', ComponentCategory.Navigation, 'chevron-right', ['trail', 'path', 'navigation']),\n footer: m('Footer', ComponentCategory.Layout, 'panel-bottom', ['bottom', 'page footer']),\n rightPanel: m('Right panel', ComponentCategory.Layout, 'panel-right', ['side panel', 'drawer', 'aside']),\n configPanel: m('Config panel', ComponentCategory.Layout, 'settings', ['settings', 'layout options', 'preferences']),\n pageHeader: m('Page header', ComponentCategory.Layout, 'heading', ['title', 'header', 'page title']),\n mask: m('Mask', ComponentCategory.Feedback, 'layers', ['overlay', 'scrim', 'backdrop']),\n logo: m('Logo', ComponentCategory.DataDisplay, 'badge', ['brand', 'identity', 'image']),\n userMenu: m('User menu', ComponentCategory.Actions, 'circle-user', ['account', 'profile', 'sign out']),\n themeSwitcher: m('Theme switcher', ComponentCategory.Actions, 'palette', ['theme', 'dark mode', 'colors']),\n layoutModeSwitcher: m('Layout mode switcher', ComponentCategory.Actions, 'layout-dashboard', ['layout', 'mode', 'navigation style']),\n};\n"],"names":["defaultBlueprintComponentMetadata","foundationComponentMetadata","appShell","m","ComponentCategory","Layout","fullPageShell","topbar","Navigation","navigationDesignMode","sidebar","menu","menuItem","breadcrumb","footer","rightPanel","configPanel","pageHeader","mask","Feedback","logo","DataDisplay","userMenu","Actions","them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C,QAAA,SAAA;AAAW,QAAA,SAAA;AAAW,QAAA;AAAW,KAAA,CAAA;AACrGC,IAAAA,aAAAA,EAAerB,iBAAAA,CAAE,gBAAA,EAAkBC,iBAAAA,CAAkBmB,OAAO,EAAE,SAAA,EAAW;AAAC,QAAA,OAAA;AAAS,QAAA,WAAA;AAAa,QAAA;AAAS,KAAA,CAAA;AACzGE,IAAAA,kBAAAA,EAAoBtB,iBAAAA,CAAE,sBAAA,EAAwBC,iBAAAA,CAAkBmB,OAAO,EAAE,kBAAA,EAAoB;AAAC,QAAA,QAAA;AAAU,QAAA,MAAA;AAAQ,QAAA;AAAmB,KAAA;AACvI;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"defaultBlueprintComponents.d.ts","sourceRoot":"","sources":["../../defaultBlueprintComponents.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAwB,MAAM,qBAAqB,CAAC;AA+B9E,eAAO,MAAM,0BAA0B,EAAE,iBAyBxC,CAAC"}
1
+ {"version":3,"file":"defaultBlueprintComponents.d.ts","sourceRoot":"","sources":["../../defaultBlueprintComponents.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAwB,MAAM,qBAAqB,CAAC;AA+B9E,eAAO,MAAM,0BAA0B,EAAE,iBAgCxC,CAAC"}
@@ -12,6 +12,13 @@ import { ChartWrapper } from './foundation/ChartWrapper.js';
12
12
  import { FilterBuilder } from './foundation/FilterBuilder.js';
13
13
  import { ColumnChooser } from './foundation/ColumnChooser.js';
14
14
  import { SavedViewsMenu } from './foundation/SavedViewsMenu.js';
15
+ import { ChecklistSection } from './foundation/ChecklistSection.js';
16
+ import { ActivityFeed } from './foundation/ActivityFeed.js';
17
+ import { AvatarStack } from './foundation/AvatarStack.js';
18
+ import { FileUploader } from './foundation/FileUploader.js';
19
+ import { ApprovalChainStepper } from './foundation/ApprovalChainStepper.js';
20
+ import { OrgTree } from './foundation/OrgTree.js';
21
+ import { PermissionMatrix } from './foundation/PermissionMatrix.js';
15
22
  import './foundation/foundationDescriptors.js';
16
23
  import './foundation/foundationComponentMetadata.js';
17
24
  import './foundation/foundationSamples.js';
@@ -65,7 +72,14 @@ import { LayoutModeSwitcher } from './shell/LayoutModeSwitcher.js';
65
72
  [componentRegistryKey(defaultBlueprintName, ComponentName.ChartWrapper)]: ChartWrapper,
66
73
  [componentRegistryKey(defaultBlueprintName, ComponentName.FilterBuilder)]: FilterBuilder,
67
74
  [componentRegistryKey(defaultBlueprintName, ComponentName.ColumnChooser)]: ColumnChooser,
68
- [componentRegistryKey(defaultBlueprintName, ComponentName.SavedViewsMenu)]: SavedViewsMenu
75
+ [componentRegistryKey(defaultBlueprintName, ComponentName.SavedViewsMenu)]: SavedViewsMenu,
76
+ [componentRegistryKey(defaultBlueprintName, ComponentName.ChecklistSection)]: ChecklistSection,
77
+ [componentRegistryKey(defaultBlueprintName, ComponentName.ActivityFeed)]: ActivityFeed,
78
+ [componentRegistryKey(defaultBlueprintName, ComponentName.AvatarStack)]: AvatarStack,
79
+ [componentRegistryKey(defaultBlueprintName, ComponentName.FileUploader)]: FileUploader,
80
+ [componentRegistryKey(defaultBlueprintName, ComponentName.ApprovalChainStepper)]: ApprovalChainStepper,
81
+ [componentRegistryKey(defaultBlueprintName, ComponentName.OrgTree)]: OrgTree,
82
+ [componentRegistryKey(defaultBlueprintName, ComponentName.PermissionMatrix)]: PermissionMatrix
69
83
  };
70
84
 
71
85
  export { defaultBlueprintComponents };