@cratis/scene.blueprint.default 4.35.0 → 4.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ComponentName.ts +12 -0
- package/defaultBlueprintComponents.ts +5 -1
- package/dist/cjs/ComponentName.js +4 -0
- package/dist/cjs/ComponentName.js.map +1 -1
- package/dist/cjs/defaultBlueprint.js +1 -0
- package/dist/cjs/defaultBlueprint.js.map +1 -1
- package/dist/cjs/defaultBlueprintComponentMetadata.js +1 -0
- package/dist/cjs/defaultBlueprintComponentMetadata.js.map +1 -1
- package/dist/cjs/defaultBlueprintComponents.js +9 -1
- package/dist/cjs/defaultBlueprintComponents.js.map +1 -1
- package/dist/cjs/foundation/ActivityFeed.js +122 -0
- package/dist/cjs/foundation/ActivityFeed.js.map +1 -0
- package/dist/cjs/foundation/AvatarStack.js +73 -0
- package/dist/cjs/foundation/AvatarStack.js.map +1 -0
- package/dist/cjs/foundation/ChecklistSection.js +174 -0
- package/dist/cjs/foundation/ChecklistSection.js.map +1 -0
- package/dist/cjs/foundation/FileUploader.js +218 -0
- package/dist/cjs/foundation/FileUploader.js.map +1 -0
- package/dist/cjs/foundation/FileUploaderHandler.js +17 -0
- package/dist/cjs/foundation/FileUploaderHandler.js.map +1 -0
- package/dist/cjs/foundation/activityModel.js +63 -0
- package/dist/cjs/foundation/activityModel.js.map +1 -0
- package/dist/cjs/foundation/avatarModel.js +42 -0
- package/dist/cjs/foundation/avatarModel.js.map +1 -0
- package/dist/cjs/foundation/checklistModel.js +59 -0
- package/dist/cjs/foundation/checklistModel.js.map +1 -0
- package/dist/cjs/foundation/formatting.js +11 -0
- package/dist/cjs/foundation/formatting.js.map +1 -1
- package/dist/cjs/foundation/foundationComponentMetadata.js +26 -0
- package/dist/cjs/foundation/foundationComponentMetadata.js.map +1 -1
- package/dist/cjs/foundation/foundationDescriptors.js +128 -0
- package/dist/cjs/foundation/foundationDescriptors.js.map +1 -1
- package/dist/cjs/foundation/foundationSamples.js +114 -0
- package/dist/cjs/foundation/foundationSamples.js.map +1 -1
- package/dist/cjs/foundation/foundationStrings.js +15 -0
- package/dist/cjs/foundation/foundationStrings.js.map +1 -1
- package/dist/cjs/foundation/uploadModel.js +71 -0
- package/dist/cjs/foundation/uploadModel.js.map +1 -0
- package/dist/cjs/index.js +33 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/ComponentName.d.ts +5 -1
- package/dist/esm/ComponentName.d.ts.map +1 -1
- package/dist/esm/ComponentName.js +4 -0
- package/dist/esm/ComponentName.js.map +1 -1
- package/dist/esm/defaultBlueprint.js +1 -0
- package/dist/esm/defaultBlueprint.js.map +1 -1
- package/dist/esm/defaultBlueprintComponentMetadata.js +1 -0
- package/dist/esm/defaultBlueprintComponentMetadata.js.map +1 -1
- package/dist/esm/defaultBlueprintComponents.d.ts.map +1 -1
- package/dist/esm/defaultBlueprintComponents.js +9 -1
- package/dist/esm/defaultBlueprintComponents.js.map +1 -1
- package/dist/esm/foundation/ActivityFeed.d.ts +3 -0
- package/dist/esm/foundation/ActivityFeed.d.ts.map +1 -0
- package/dist/esm/foundation/ActivityFeed.js +120 -0
- package/dist/esm/foundation/ActivityFeed.js.map +1 -0
- package/dist/esm/foundation/AvatarStack.d.ts +3 -0
- package/dist/esm/foundation/AvatarStack.d.ts.map +1 -0
- package/dist/esm/foundation/AvatarStack.js +71 -0
- package/dist/esm/foundation/AvatarStack.js.map +1 -0
- package/dist/esm/foundation/ChecklistSection.d.ts +3 -0
- package/dist/esm/foundation/ChecklistSection.d.ts.map +1 -0
- package/dist/esm/foundation/ChecklistSection.js +172 -0
- package/dist/esm/foundation/ChecklistSection.js.map +1 -0
- package/dist/esm/foundation/FileUploader.d.ts +3 -0
- package/dist/esm/foundation/FileUploader.d.ts.map +1 -0
- package/dist/esm/foundation/FileUploader.js +216 -0
- package/dist/esm/foundation/FileUploader.js.map +1 -0
- package/dist/esm/foundation/FileUploaderHandler.d.ts +8 -0
- package/dist/esm/foundation/FileUploaderHandler.d.ts.map +1 -0
- package/dist/esm/foundation/FileUploaderHandler.js +14 -0
- package/dist/esm/foundation/FileUploaderHandler.js.map +1 -0
- package/dist/esm/foundation/Foundation.stories.d.ts +8 -0
- package/dist/esm/foundation/Foundation.stories.d.ts.map +1 -1
- package/dist/esm/foundation/Foundation.stories.js +8 -0
- package/dist/esm/foundation/Foundation.stories.js.map +1 -1
- package/dist/esm/foundation/activityModel.d.ts +22 -0
- package/dist/esm/foundation/activityModel.d.ts.map +1 -0
- package/dist/esm/foundation/activityModel.js +58 -0
- package/dist/esm/foundation/activityModel.js.map +1 -0
- package/dist/esm/foundation/avatarModel.d.ts +11 -0
- package/dist/esm/foundation/avatarModel.d.ts.map +1 -0
- package/dist/esm/foundation/avatarModel.js +38 -0
- package/dist/esm/foundation/avatarModel.js.map +1 -0
- package/dist/esm/foundation/checklistModel.d.ts +17 -0
- package/dist/esm/foundation/checklistModel.d.ts.map +1 -0
- package/dist/esm/foundation/checklistModel.js +53 -0
- package/dist/esm/foundation/checklistModel.js.map +1 -0
- package/dist/esm/foundation/formatting.d.ts +1 -0
- package/dist/esm/foundation/formatting.d.ts.map +1 -1
- package/dist/esm/foundation/formatting.js +11 -1
- package/dist/esm/foundation/formatting.js.map +1 -1
- package/dist/esm/foundation/foundationComponentMetadata.d.ts.map +1 -1
- package/dist/esm/foundation/foundationComponentMetadata.js +26 -0
- package/dist/esm/foundation/foundationComponentMetadata.js.map +1 -1
- package/dist/esm/foundation/foundationDescriptors.d.ts.map +1 -1
- package/dist/esm/foundation/foundationDescriptors.js +128 -0
- package/dist/esm/foundation/foundationDescriptors.js.map +1 -1
- package/dist/esm/foundation/foundationSamples.d.ts.map +1 -1
- package/dist/esm/foundation/foundationSamples.js +114 -0
- package/dist/esm/foundation/foundationSamples.js.map +1 -1
- package/dist/esm/foundation/foundationStrings.d.ts +15 -0
- package/dist/esm/foundation/foundationStrings.d.ts.map +1 -1
- package/dist/esm/foundation/foundationStrings.js +15 -0
- package/dist/esm/foundation/foundationStrings.js.map +1 -1
- package/dist/esm/foundation/index.d.ts +9 -0
- package/dist/esm/foundation/index.d.ts.map +1 -1
- package/dist/esm/foundation/index.js +9 -0
- package/dist/esm/foundation/index.js.map +1 -1
- package/dist/esm/foundation/uploadModel.d.ts +31 -0
- package/dist/esm/foundation/uploadModel.d.ts.map +1 -0
- package/dist/esm/foundation/uploadModel.js +65 -0
- package/dist/esm/foundation/uploadModel.js.map +1 -0
- package/dist/esm/index.js +10 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/foundation/ActivityFeed.tsx +61 -0
- package/foundation/AvatarStack.tsx +43 -0
- package/foundation/ChecklistSection.tsx +80 -0
- package/foundation/FileUploader.tsx +122 -0
- package/foundation/FileUploaderHandler.tsx +22 -0
- package/foundation/Foundation.stories.tsx +8 -0
- package/foundation/activityModel.ts +65 -0
- package/foundation/avatarModel.ts +36 -0
- package/foundation/checklistModel.ts +62 -0
- package/foundation/formatting.ts +9 -0
- package/foundation/foundationComponentMetadata.ts +4 -0
- package/foundation/foundationDescriptors.ts +79 -0
- package/foundation/foundationSamples.ts +29 -0
- package/foundation/foundationStrings.ts +15 -0
- package/foundation/index.ts +9 -0
- package/foundation/uploadModel.ts +66 -0
- package/package.json +8 -8
- package/shell/layout.css +234 -0
|
@@ -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,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nModel = 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');
|
|
77
86
|
var foundationDescriptors = require('./foundation/foundationDescriptors.js');
|
|
78
87
|
var foundationComponentMetadata = require('./foundation/foundationComponentMetadata.js');
|
|
79
88
|
var foundationSamples = require('./foundation/foundationSamples.js');
|
|
@@ -268,6 +277,7 @@ exports.PermissionRule = PermissionRule.PermissionRule;
|
|
|
268
277
|
exports.readPermissionRule = PermissionRule.readPermissionRule;
|
|
269
278
|
exports.NumberFormat = formatting.NumberFormat;
|
|
270
279
|
exports.formatDate = formatting.formatDate;
|
|
280
|
+
exports.formatDay = formatting.formatDay;
|
|
271
281
|
exports.formatNumber = formatting.formatNumber;
|
|
272
282
|
exports.isRightToLeft = formatting.isRightToLeft;
|
|
273
283
|
exports.readLocale = formatting.readLocale;
|
|
@@ -316,6 +326,29 @@ exports.ColumnChooser = ColumnChooser.ColumnChooser;
|
|
|
316
326
|
exports.readViews = viewModel.readViews;
|
|
317
327
|
exports.SavedViewsMenu = SavedViewsMenu.SavedViewsMenu;
|
|
318
328
|
exports.savedViewActionOutput = SavedViewsMenu.savedViewActionOutput;
|
|
329
|
+
exports.completed = checklistModel.completed;
|
|
330
|
+
exports.doneTaskIds = checklistModel.doneTaskIds;
|
|
331
|
+
exports.isOverdue = checklistModel.isOverdue;
|
|
332
|
+
exports.readChecklist = checklistModel.readChecklist;
|
|
333
|
+
exports.toggleTask = checklistModel.toggleTask;
|
|
334
|
+
exports.ChecklistSection = ChecklistSection.ChecklistSection;
|
|
335
|
+
exports.ActivityKind = activityModel.ActivityKind;
|
|
336
|
+
exports.dayOf = activityModel.dayOf;
|
|
337
|
+
exports.groupByDay = activityModel.groupByDay;
|
|
338
|
+
exports.readActivity = activityModel.readActivity;
|
|
339
|
+
exports.ActivityFeed = ActivityFeed.ActivityFeed;
|
|
340
|
+
exports.initialsOf = avatarModel.initialsOf;
|
|
341
|
+
exports.readPeople = avatarModel.readPeople;
|
|
342
|
+
exports.visiblePeople = avatarModel.visiblePeople;
|
|
343
|
+
exports.AvatarStack = AvatarStack.AvatarStack;
|
|
344
|
+
exports.UploadRefusal = uploadModel.UploadRefusal;
|
|
345
|
+
exports.UploadStatus = uploadModel.UploadStatus;
|
|
346
|
+
exports.checkSelection = uploadModel.checkSelection;
|
|
347
|
+
exports.formatBytes = uploadModel.formatBytes;
|
|
348
|
+
exports.matchesAccept = uploadModel.matchesAccept;
|
|
349
|
+
exports.FileUploaderHandlerProvider = FileUploaderHandler.FileUploaderHandlerProvider;
|
|
350
|
+
exports.useFileUploaderHandler = FileUploaderHandler.useFileUploaderHandler;
|
|
351
|
+
exports.FileUploader = FileUploader.FileUploader;
|
|
319
352
|
exports.bindable = foundationDescriptors.bindable;
|
|
320
353
|
exports.foundationDescriptors = foundationDescriptors.foundationDescriptors;
|
|
321
354
|
exports.list = foundationDescriptors.list;
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -22,6 +22,10 @@ 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"
|
|
26
30
|
}
|
|
27
31
|
//# 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;
|
|
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;CAChC"}
|
|
@@ -32,6 +32,10 @@
|
|
|
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";
|
|
35
39
|
return ComponentName;
|
|
36
40
|
}({});
|
|
37
41
|
|
|
@@ -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;
|
|
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"],"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;gEAGc,aAAA,CAAA,kBAAA,CAAA,GAAA,kBAAA;sDAGV,aAAA,CAAA,cAAA,CAAA,GAAA,cAAA;2DAGK,aAAA,CAAA,aAAA,CAAA,GAAA,aAAA;kEAGO,aAAA,CAAA,cAAA,CAAA,GAAA,cAAA;AAlFnDA,IAAAA,OAAAA,aAAAA;AAoFX,CAAA,CAAA,EAAA;;"}
|
|
@@ -5,6 +5,7 @@ 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';
|
|
8
9
|
import { foundationDescriptors } from './foundation/foundationDescriptors.js';
|
|
9
10
|
import './foundation/foundationComponentMetadata.js';
|
|
10
11
|
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":"
|
|
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,7 @@ 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';
|
|
6
7
|
import './foundation/foundationDescriptors.js';
|
|
7
8
|
import { foundationComponentMetadata } from './foundation/foundationComponentMetadata.js';
|
|
8
9
|
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":"
|
|
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,YAAA,EAAc;AAAC,QA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,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 +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,
|
|
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,iBA6BxC,CAAC"}
|
|
@@ -12,6 +12,10 @@ 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';
|
|
15
19
|
import './foundation/foundationDescriptors.js';
|
|
16
20
|
import './foundation/foundationComponentMetadata.js';
|
|
17
21
|
import './foundation/foundationSamples.js';
|
|
@@ -65,7 +69,11 @@ import { LayoutModeSwitcher } from './shell/LayoutModeSwitcher.js';
|
|
|
65
69
|
[componentRegistryKey(defaultBlueprintName, ComponentName.ChartWrapper)]: ChartWrapper,
|
|
66
70
|
[componentRegistryKey(defaultBlueprintName, ComponentName.FilterBuilder)]: FilterBuilder,
|
|
67
71
|
[componentRegistryKey(defaultBlueprintName, ComponentName.ColumnChooser)]: ColumnChooser,
|
|
68
|
-
[componentRegistryKey(defaultBlueprintName, ComponentName.SavedViewsMenu)]: SavedViewsMenu
|
|
72
|
+
[componentRegistryKey(defaultBlueprintName, ComponentName.SavedViewsMenu)]: SavedViewsMenu,
|
|
73
|
+
[componentRegistryKey(defaultBlueprintName, ComponentName.ChecklistSection)]: ChecklistSection,
|
|
74
|
+
[componentRegistryKey(defaultBlueprintName, ComponentName.ActivityFeed)]: ActivityFeed,
|
|
75
|
+
[componentRegistryKey(defaultBlueprintName, ComponentName.AvatarStack)]: AvatarStack,
|
|
76
|
+
[componentRegistryKey(defaultBlueprintName, ComponentName.FileUploader)]: FileUploader
|
|
69
77
|
};
|
|
70
78
|
|
|
71
79
|
export { defaultBlueprintComponents };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultBlueprintComponents.js","sources":["../../defaultBlueprintComponents.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 { ComponentRegistry, componentRegistryKey } from '@cratis/scene.react';\nimport { ComponentName } from './ComponentName';\nimport { defaultBlueprintName } from './packageName';\nimport { ChartWrapper, ColumnChooser, EmptyState, FilterBuilder, SavedViewsMenu, StatCard, StatusChip, TrendChip } from './foundation';\nimport {\n AppShell,\n Breadcrumb,\n ConfigPanel,\n Footer,\n FullPageShell,\n LayoutModeSwitcher,\n Logo,\n Mask,\n Menu,\n MenuItem,\n PageHeader,\n RightPanel,\n Sidebar,\n ThemeSwitcher,\n Topbar,\n UserMenu,\n} from './shell';\n\n/**\n * The components this package registers, keyed the way the renderer looks them up.\n *\n * Every key is built with `componentRegistryKey` rather than written out, because the separator between\n * package and component name is the registry's own business - it is deliberately not the `.` a screen uses\n * to qualify a name, so that a package name containing dots stays unambiguous. Building a key by hand is\n * how a component ends up registered under something no lookup will ever produce.\n */\nexport const defaultBlueprintComponents: ComponentRegistry = {\n [componentRegistryKey(defaultBlueprintName, ComponentName.AppShell)]: AppShell,\n [componentRegistryKey(defaultBlueprintName, ComponentName.FullPageShell)]: FullPageShell,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Topbar)]: Topbar,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Sidebar)]: Sidebar,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Menu)]: Menu,\n [componentRegistryKey(defaultBlueprintName, ComponentName.MenuItem)]: MenuItem,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Breadcrumb)]: Breadcrumb,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Footer)]: Footer,\n [componentRegistryKey(defaultBlueprintName, ComponentName.RightPanel)]: RightPanel,\n [componentRegistryKey(defaultBlueprintName, ComponentName.ConfigPanel)]: ConfigPanel,\n [componentRegistryKey(defaultBlueprintName, ComponentName.PageHeader)]: PageHeader,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Mask)]: Mask,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Logo)]: Logo,\n [componentRegistryKey(defaultBlueprintName, ComponentName.UserMenu)]: UserMenu,\n [componentRegistryKey(defaultBlueprintName, ComponentName.ThemeSwitcher)]: ThemeSwitcher,\n [componentRegistryKey(defaultBlueprintName, ComponentName.LayoutModeSwitcher)]: LayoutModeSwitcher,\n [componentRegistryKey(defaultBlueprintName, ComponentName.EmptyState)]: EmptyState,\n [componentRegistryKey(defaultBlueprintName, ComponentName.StatCard)]: StatCard,\n [componentRegistryKey(defaultBlueprintName, ComponentName.TrendChip)]: TrendChip,\n [componentRegistryKey(defaultBlueprintName, ComponentName.StatusChip)]: StatusChip,\n [componentRegistryKey(defaultBlueprintName, ComponentName.ChartWrapper)]: ChartWrapper,\n [componentRegistryKey(defaultBlueprintName, ComponentName.FilterBuilder)]: FilterBuilder,\n [componentRegistryKey(defaultBlueprintName, ComponentName.ColumnChooser)]: ColumnChooser,\n [componentRegistryKey(defaultBlueprintName, ComponentName.SavedViewsMenu)]: SavedViewsMenu,\n};\n"],"names":["defaultBlueprintComponents","componentRegistryKey","defaultBlueprintName","ComponentName","AppShell","FullPageShell","Topbar","Sidebar","Menu","MenuItem","Breadcrumb","Footer","RightPanel","ConfigPanel","PageHeader","Mask","Logo","UserMenu","ThemeSwitcher","LayoutModeSwitcher","EmptyState","StatCard","TrendChip","StatusChip","ChartWrapper","FilterBuilder","ColumnChooser","SavedViewsMenu"],"mappings":"
|
|
1
|
+
{"version":3,"file":"defaultBlueprintComponents.js","sources":["../../defaultBlueprintComponents.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 { ComponentRegistry, componentRegistryKey } from '@cratis/scene.react';\nimport { ComponentName } from './ComponentName';\nimport { defaultBlueprintName } from './packageName';\nimport { ActivityFeed, AvatarStack, ChartWrapper, ChecklistSection, ColumnChooser, FileUploader, EmptyState, FilterBuilder, SavedViewsMenu, StatCard, StatusChip, TrendChip } from './foundation';\nimport {\n AppShell,\n Breadcrumb,\n ConfigPanel,\n Footer,\n FullPageShell,\n LayoutModeSwitcher,\n Logo,\n Mask,\n Menu,\n MenuItem,\n PageHeader,\n RightPanel,\n Sidebar,\n ThemeSwitcher,\n Topbar,\n UserMenu,\n} from './shell';\n\n/**\n * The components this package registers, keyed the way the renderer looks them up.\n *\n * Every key is built with `componentRegistryKey` rather than written out, because the separator between\n * package and component name is the registry's own business - it is deliberately not the `.` a screen uses\n * to qualify a name, so that a package name containing dots stays unambiguous. Building a key by hand is\n * how a component ends up registered under something no lookup will ever produce.\n */\nexport const defaultBlueprintComponents: ComponentRegistry = {\n [componentRegistryKey(defaultBlueprintName, ComponentName.AppShell)]: AppShell,\n [componentRegistryKey(defaultBlueprintName, ComponentName.FullPageShell)]: FullPageShell,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Topbar)]: Topbar,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Sidebar)]: Sidebar,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Menu)]: Menu,\n [componentRegistryKey(defaultBlueprintName, ComponentName.MenuItem)]: MenuItem,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Breadcrumb)]: Breadcrumb,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Footer)]: Footer,\n [componentRegistryKey(defaultBlueprintName, ComponentName.RightPanel)]: RightPanel,\n [componentRegistryKey(defaultBlueprintName, ComponentName.ConfigPanel)]: ConfigPanel,\n [componentRegistryKey(defaultBlueprintName, ComponentName.PageHeader)]: PageHeader,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Mask)]: Mask,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Logo)]: Logo,\n [componentRegistryKey(defaultBlueprintName, ComponentName.UserMenu)]: UserMenu,\n [componentRegistryKey(defaultBlueprintName, ComponentName.ThemeSwitcher)]: ThemeSwitcher,\n [componentRegistryKey(defaultBlueprintName, ComponentName.LayoutModeSwitcher)]: LayoutModeSwitcher,\n [componentRegistryKey(defaultBlueprintName, ComponentName.EmptyState)]: EmptyState,\n [componentRegistryKey(defaultBlueprintName, ComponentName.StatCard)]: StatCard,\n [componentRegistryKey(defaultBlueprintName, ComponentName.TrendChip)]: TrendChip,\n [componentRegistryKey(defaultBlueprintName, ComponentName.StatusChip)]: StatusChip,\n [componentRegistryKey(defaultBlueprintName, ComponentName.ChartWrapper)]: ChartWrapper,\n [componentRegistryKey(defaultBlueprintName, ComponentName.FilterBuilder)]: FilterBuilder,\n [componentRegistryKey(defaultBlueprintName, ComponentName.ColumnChooser)]: ColumnChooser,\n [componentRegistryKey(defaultBlueprintName, ComponentName.SavedViewsMenu)]: SavedViewsMenu,\n [componentRegistryKey(defaultBlueprintName, ComponentName.ChecklistSection)]: ChecklistSection,\n [componentRegistryKey(defaultBlueprintName, ComponentName.ActivityFeed)]: ActivityFeed,\n [componentRegistryKey(defaultBlueprintName, ComponentName.AvatarStack)]: AvatarStack,\n [componentRegistryKey(defaultBlueprintName, ComponentName.FileUploader)]: FileUploader,\n};\n"],"names":["defaultBlueprintComponents","componentRegistryKey","defaultBlueprintName","ComponentName","AppShell","FullPageShell","Topbar","Sidebar","Menu","MenuItem","Breadcrumb","Footer","RightPanel","ConfigPanel","PageHeader","Mask","Logo","UserMenu","ThemeSwitcher","LayoutModeSwitcher","EmptyState","StatCard","TrendChip","StatusChip","ChartWrapper","FilterBuilder","ColumnChooser","SavedViewsMenu","ChecklistSection","ActivityFeed","AvatarStack","FileUploader"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAyBA;;;;;;;UAQaA,0BAAAA,GAAgD;AACzD,IAAA,CAACC,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcC,QAAQ,IAAIA,QAAAA;AACt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Root":"","sources":["../../../foundation/ActivityFeed.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAqB/D,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,wBAAwB,+BAkC/E"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { readOptionalString } from '../shell/elementProperties.js';
|
|
4
|
+
import { readActivity, groupByDay, ActivityKind } from './activityModel.js';
|
|
5
|
+
import { readComponentState, ComponentState } from './ComponentState.js';
|
|
6
|
+
import { FoundationIcon } from './FoundationIcon.js';
|
|
7
|
+
import { readLocale, formatDay, formatDate } from './formatting.js';
|
|
8
|
+
import { readFoundationStrings } from './foundationStrings.js';
|
|
9
|
+
import { FoundationFrame } from './StateFrame.js';
|
|
10
|
+
|
|
11
|
+
const icons = {
|
|
12
|
+
[ActivityKind.Comment]: 'user',
|
|
13
|
+
[ActivityKind.Change]: 'refresh',
|
|
14
|
+
[ActivityKind.Status]: 'check',
|
|
15
|
+
[ActivityKind.System]: 'info'
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The `activityFeed` component: what happened to a record, newest first, under a heading for each day.
|
|
19
|
+
*
|
|
20
|
+
* `entries` carry an id, who (`actor`), what (`action`), the instant (`at`, ISO 8601), a `kind` and an optional `body` such as a comment's
|
|
21
|
+
* text. The feed is an ordered list; each entry names its kind in words for assistive technology as well as by icon, and its time is a
|
|
22
|
+
* `time` element formatted for the locale. Content is supplied by the application - this only lays it out - and a feed of any length
|
|
23
|
+
* stays one list. `order="ascending"` reads oldest first, and `timeZone` fixes the zone days are cut in.
|
|
24
|
+
*/ function ActivityFeed({ element, interactions }) {
|
|
25
|
+
const entries = useMemo(()=>readActivity(element.properties.entries), [
|
|
26
|
+
element.properties.entries
|
|
27
|
+
]);
|
|
28
|
+
const strings = readFoundationStrings(element);
|
|
29
|
+
const locale = readLocale(element);
|
|
30
|
+
const timeZone = readOptionalString(element, 'timeZone');
|
|
31
|
+
const days = useMemo(()=>groupByDay(entries, element.properties.order === 'ascending', timeZone), [
|
|
32
|
+
entries,
|
|
33
|
+
element.properties.order,
|
|
34
|
+
timeZone
|
|
35
|
+
]);
|
|
36
|
+
const state = readComponentState(element, entries.length > 0);
|
|
37
|
+
const kindText = {
|
|
38
|
+
comment: strings.activityComment,
|
|
39
|
+
change: strings.activityChange,
|
|
40
|
+
status: strings.activityStatus,
|
|
41
|
+
system: strings.activitySystem
|
|
42
|
+
};
|
|
43
|
+
const emptyElement = state === ComponentState.Empty ? {
|
|
44
|
+
...element,
|
|
45
|
+
properties: {
|
|
46
|
+
emptyHeadline: strings.activityEmpty,
|
|
47
|
+
...element.properties
|
|
48
|
+
}
|
|
49
|
+
} : element;
|
|
50
|
+
return /*#__PURE__*/ jsx(FoundationFrame, {
|
|
51
|
+
element: emptyElement,
|
|
52
|
+
interactions: interactions,
|
|
53
|
+
name: "activity-feed",
|
|
54
|
+
state: state,
|
|
55
|
+
skeleton: [
|
|
56
|
+
60,
|
|
57
|
+
90,
|
|
58
|
+
70,
|
|
59
|
+
85
|
|
60
|
+
],
|
|
61
|
+
children: (state === ComponentState.Ready || state === ComponentState.Partial) && days.map((day)=>/*#__PURE__*/ jsxs("section", {
|
|
62
|
+
className: "foundation-activity-day",
|
|
63
|
+
children: [
|
|
64
|
+
/*#__PURE__*/ jsx("h3", {
|
|
65
|
+
className: "foundation-activity-heading",
|
|
66
|
+
children: /*#__PURE__*/ jsx("time", {
|
|
67
|
+
dateTime: day.day,
|
|
68
|
+
children: formatDay(day.day, locale)
|
|
69
|
+
})
|
|
70
|
+
}),
|
|
71
|
+
/*#__PURE__*/ jsx("ol", {
|
|
72
|
+
className: "foundation-activity-list",
|
|
73
|
+
children: day.entries.map((entry)=>/*#__PURE__*/ jsxs("li", {
|
|
74
|
+
className: "foundation-activity-entry",
|
|
75
|
+
"data-kind": entry.kind,
|
|
76
|
+
children: [
|
|
77
|
+
/*#__PURE__*/ jsx("span", {
|
|
78
|
+
className: "foundation-activity-icon",
|
|
79
|
+
children: /*#__PURE__*/ jsx(FoundationIcon, {
|
|
80
|
+
name: icons[entry.kind]
|
|
81
|
+
})
|
|
82
|
+
}),
|
|
83
|
+
/*#__PURE__*/ jsxs("div", {
|
|
84
|
+
className: "foundation-activity-content",
|
|
85
|
+
children: [
|
|
86
|
+
/*#__PURE__*/ jsxs("p", {
|
|
87
|
+
className: "foundation-activity-summary",
|
|
88
|
+
children: [
|
|
89
|
+
/*#__PURE__*/ jsx("span", {
|
|
90
|
+
className: "foundation-visually-hidden",
|
|
91
|
+
children: `${kindText[entry.kind]}: `
|
|
92
|
+
}),
|
|
93
|
+
/*#__PURE__*/ jsx("strong", {
|
|
94
|
+
children: entry.actor
|
|
95
|
+
}),
|
|
96
|
+
" ",
|
|
97
|
+
entry.action
|
|
98
|
+
]
|
|
99
|
+
}),
|
|
100
|
+
entry.body && /*#__PURE__*/ jsx("p", {
|
|
101
|
+
className: "foundation-activity-body",
|
|
102
|
+
children: entry.body
|
|
103
|
+
}),
|
|
104
|
+
/*#__PURE__*/ jsx("time", {
|
|
105
|
+
className: "foundation-count",
|
|
106
|
+
dateTime: entry.at,
|
|
107
|
+
children: formatDate(entry.at, locale, true)
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
}, entry.id))
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
}, day.day))
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export { ActivityFeed };
|
|
120
|
+
//# sourceMappingURL=ActivityFeed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityFeed.js","sources":["../../../foundation/ActivityFeed.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { readOptionalString } from '../shell/elementProperties';\nimport { ActivityKind, groupByDay, readActivity } from './activityModel';\nimport { ComponentState, readComponentState } from './ComponentState';\nimport { FoundationIcon, FoundationIconName } from './FoundationIcon';\nimport { formatDate, formatDay, readLocale } from './formatting';\nimport { readFoundationStrings } from './foundationStrings';\nimport { FoundationFrame } from './StateFrame';\n\nconst icons: Record<ActivityKind, FoundationIconName> = {\n [ActivityKind.Comment]: 'user', [ActivityKind.Change]: 'refresh', [ActivityKind.Status]: 'check', [ActivityKind.System]: 'info',\n};\n\n/**\n * The `activityFeed` component: what happened to a record, newest first, under a heading for each day.\n *\n * `entries` carry an id, who (`actor`), what (`action`), the instant (`at`, ISO 8601), a `kind` and an optional `body` such as a comment's\n * text. The feed is an ordered list; each entry names its kind in words for assistive technology as well as by icon, and its time is a\n * `time` element formatted for the locale. Content is supplied by the application - this only lays it out - and a feed of any length\n * stays one list. `order=\"ascending\"` reads oldest first, and `timeZone` fixes the zone days are cut in.\n */\nexport function ActivityFeed({ element, interactions }: RegisteredComponentProps) {\n const entries = useMemo(() => readActivity(element.properties.entries), [element.properties.entries]);\n const strings = readFoundationStrings(element);\n const locale = readLocale(element);\n const timeZone = readOptionalString(element, 'timeZone');\n const days = useMemo(() => groupByDay(entries, element.properties.order === 'ascending', timeZone), [entries, element.properties.order, timeZone]);\n const state = readComponentState(element, entries.length > 0);\n const kindText: Record<ActivityKind, string> = { comment: strings.activityComment, change: strings.activityChange, status: strings.activityStatus, system: strings.activitySystem };\n const emptyElement = state === ComponentState.Empty ? { ...element, properties: { emptyHeadline: strings.activityEmpty, ...element.properties } } : element;\n\n return (\n <FoundationFrame element={emptyElement} interactions={interactions} name='activity-feed' state={state} skeleton={[60, 90, 70, 85]}>\n {(state === ComponentState.Ready || state === ComponentState.Partial) && days.map(day => (\n <section key={day.day} className='foundation-activity-day'>\n <h3 className='foundation-activity-heading'><time dateTime={day.day}>{formatDay(day.day, locale)}</time></h3>\n <ol className='foundation-activity-list'>\n {day.entries.map(entry => (\n <li key={entry.id} className='foundation-activity-entry' data-kind={entry.kind}>\n <span className='foundation-activity-icon'><FoundationIcon name={icons[entry.kind]} /></span>\n <div className='foundation-activity-content'>\n <p className='foundation-activity-summary'>\n <span className='foundation-visually-hidden'>{`${kindText[entry.kind]}: `}</span>\n <strong>{entry.actor}</strong> {entry.action}\n </p>\n {entry.body && <p className='foundation-activity-body'>{entry.body}</p>}\n <time className='foundation-count' dateTime={entry.at}>{formatDate(entry.at, locale, true)}</time>\n </div>\n </li>\n ))}\n </ol>\n </section>\n ))}\n </FoundationFrame>\n );\n}\n\n"],"names":["icons","ActivityKind","Comment","Change","Status","System","ActivityFeed","element","interactions","entries","useMemo","readActivity","properties","strings","readFoundationStrings","locale","readLocale","timeZone","readOptionalString","days","groupByDay","order","state","readComponentState","length","kindText","comment","activityComment","change","activityChange","status","activityStatus","system","activitySystem","emptyElement","ComponentState","Empty","emptyHeadline","activityEmpty","_jsx","FoundationFrame","name","skeleton","Ready","Partial","map","day","_jsxs","section","className","h3","time","dateTime","formatDay","ol","entry","li","data-kind","kind","span","FoundationIcon","div","p","strong","actor","action","body","at","formatDate","id"],"mappings":";;;;;;;;;;AAaA,MAAMA,KAAAA,GAAkD;IACpD,CAACC,YAAAA,CAAaC,OAAO,GAAG,MAAA;IAAQ,CAACD,YAAAA,CAAaE,MAAM,GAAG,SAAA;IAAW,CAACF,YAAAA,CAAaG,MAAM,GAAG,OAAA;IAAS,CAACH,YAAAA,CAAaI,MAAM,GAAG;AAC7H,CAAA;AAEA;;;;;;;AAOC,IACM,SAASC,YAAAA,CAAa,EAAEC,OAAO,EAAEC,YAAY,EAA4B,EAAA;IAC5E,MAAMC,OAAAA,GAAUC,QAAQ,IAAMC,YAAAA,CAAaJ,QAAQK,UAAU,CAACH,OAAO,CAAA,EAAG;QAACF,OAAAA,CAAQK,UAAU,CAACH;AAAQ,KAAA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,wDAAAA,QAAAA,EAAAA,KAAAA,CAAMS;;AAAe,oDAAA,GAAA;AAAET,oDAAAA,KAAAA,CAAMU;;;4CAEzCV,KAAAA,CAAMW,IAAI,kBAAI3B,GAAA,CAACuB,GAAAA,EAAAA;gDAAEb,SAAAA,EAAU,0BAAA;AAA4BM,gDAAAA,QAAAA,EAAAA,KAAAA,CAAMW;;0DAC9D3B,GAAA,CAACY,MAAAA,EAAAA;gDAAKF,SAAAA,EAAU,kBAAA;AAAmBG,gDAAAA,QAAAA,EAAUG,MAAMY,EAAE;0DAAGC,UAAAA,CAAWb,KAAAA,CAAMY,EAAE,EAAEpD,MAAAA,EAAQ,IAAA;;;;;AARpFwC,6BAAAA,EAAAA,KAAAA,CAAMc,EAAE,CAAA;;;AAJfvB,aAAAA,EAAAA,GAAAA,CAAIA,GAAG,CAAA;;AAqBrC;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvatarStack.d.ts","sourceRoot":"","sources":["../../../foundation/AvatarStack.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAa/D,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,wBAAwB,+BAyB9E"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { readPeople, visiblePeople, initialsOf } from './avatarModel.js';
|
|
4
|
+
import { readComponentState, ComponentState } from './ComponentState.js';
|
|
5
|
+
import { readFoundationStrings, formatText } from './foundationStrings.js';
|
|
6
|
+
import { FoundationFrame } from './StateFrame.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The `avatarStack` component: overlapping avatars for the people on a record, with a "+N" chip for the rest.
|
|
10
|
+
*
|
|
11
|
+
* `people` are names with an optional picture; without one the avatar shows the person's initials. The stack is a labelled group ("5 people"),
|
|
12
|
+
* each avatar is an image named after its person, and the overflow chip says how many more in words. `max` is how many are shown (4 by
|
|
13
|
+
* default) and `size` is `small` or `medium`.
|
|
14
|
+
*/ function AvatarStack({ element, interactions }) {
|
|
15
|
+
const people = useMemo(()=>readPeople(element.properties.people), [
|
|
16
|
+
element.properties.people
|
|
17
|
+
]);
|
|
18
|
+
const strings = readFoundationStrings(element);
|
|
19
|
+
const { shown, hidden } = visiblePeople(people, typeof element.properties.max === 'number' ? element.properties.max : 4);
|
|
20
|
+
const state = readComponentState(element, people.length > 0);
|
|
21
|
+
const size = element.properties.size === 'small' ? 'small' : 'medium';
|
|
22
|
+
return /*#__PURE__*/ jsx(FoundationFrame, {
|
|
23
|
+
element: element,
|
|
24
|
+
interactions: interactions,
|
|
25
|
+
name: "avatar-stack",
|
|
26
|
+
state: state,
|
|
27
|
+
skeleton: [
|
|
28
|
+
35
|
|
29
|
+
],
|
|
30
|
+
children: (state === ComponentState.Ready || state === ComponentState.Partial) && /*#__PURE__*/ jsxs("ul", {
|
|
31
|
+
className: "foundation-avatars",
|
|
32
|
+
role: "group",
|
|
33
|
+
"aria-label": formatText(strings.avatarPeople, {
|
|
34
|
+
count: people.length
|
|
35
|
+
}),
|
|
36
|
+
"data-size": size,
|
|
37
|
+
children: [
|
|
38
|
+
shown.map((person)=>/*#__PURE__*/ jsx("li", {
|
|
39
|
+
className: "foundation-avatar",
|
|
40
|
+
role: "img",
|
|
41
|
+
"aria-label": person.name,
|
|
42
|
+
title: person.name,
|
|
43
|
+
children: person.imageUrl ? /*#__PURE__*/ jsx("img", {
|
|
44
|
+
src: person.imageUrl,
|
|
45
|
+
alt: ""
|
|
46
|
+
}) : /*#__PURE__*/ jsx("span", {
|
|
47
|
+
"aria-hidden": "true",
|
|
48
|
+
children: initialsOf(person.name)
|
|
49
|
+
})
|
|
50
|
+
}, person.name)),
|
|
51
|
+
hidden > 0 && /*#__PURE__*/ jsx("li", {
|
|
52
|
+
className: "foundation-avatar foundation-avatar-more",
|
|
53
|
+
role: "img",
|
|
54
|
+
"aria-label": formatText(strings.avatarOverflow, {
|
|
55
|
+
count: hidden
|
|
56
|
+
}),
|
|
57
|
+
children: /*#__PURE__*/ jsxs("span", {
|
|
58
|
+
"aria-hidden": "true",
|
|
59
|
+
children: [
|
|
60
|
+
"+",
|
|
61
|
+
hidden
|
|
62
|
+
]
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
]
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export { AvatarStack };
|
|
71
|
+
//# sourceMappingURL=AvatarStack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvatarStack.js","sources":["../../../foundation/AvatarStack.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { initialsOf, readPeople, visiblePeople } from './avatarModel';\nimport { ComponentState, readComponentState } from './ComponentState';\nimport { formatText, readFoundationStrings } from './foundationStrings';\nimport { FoundationFrame } from './StateFrame';\n\n/**\n * The `avatarStack` component: overlapping avatars for the people on a record, with a \"+N\" chip for the rest.\n *\n * `people` are names with an optional picture; without one the avatar shows the person's initials. The stack is a labelled group (\"5 people\"),\n * each avatar is an image named after its person, and the overflow chip says how many more in words. `max` is how many are shown (4 by\n * default) and `size` is `small` or `medium`.\n */\nexport function AvatarStack({ element, interactions }: RegisteredComponentProps) {\n const people = useMemo(() => readPeople(element.properties.people), [element.properties.people]);\n const strings = readFoundationStrings(element);\n const { shown, hidden } = visiblePeople(people, typeof element.properties.max === 'number' ? element.properties.max : 4);\n const state = readComponentState(element, people.length > 0);\n const size = element.properties.size === 'small' ? 'small' : 'medium';\n\n return (\n <FoundationFrame element={element} interactions={interactions} name='avatar-stack' state={state} skeleton={[35]}>\n {(state === ComponentState.Ready || state === ComponentState.Partial) && (\n <ul className='foundation-avatars' role='group' aria-label={formatText(strings.avatarPeople, { count: people.length })} data-size={size}>\n {shown.map(person => (\n <li key={person.name} className='foundation-avatar' role='img' aria-label={person.name} title={person.name}>\n {person.imageUrl ? <img src={person.imageUrl} alt='' /> : <span aria-hidden='true'>{initialsOf(person.name)}</span>}\n </li>\n ))}\n {hidden > 0 && (\n <li className='foundation-avatar foundation-avatar-more' role='img' aria-label={formatText(strings.avatarOverflow, { count: hidden })}>\n <span aria-hidden='true'>+{hidden}</span>\n </li>\n )}\n </ul>\n )}\n </FoundationFrame>\n );\n}\n"],"names":["AvatarStack","element","interactions","people","useMemo","readPeople","properties","strings","readFoundationStrings","shown","hidden","visiblePeople","max","state","readComponentState","length","size","_jsx","FoundationFrame","name","skeleton","ComponentState","Ready","Partial","_jsxs","ul","className","role","aria-label","formatText","avatarPeople","count","data-size","map","person","li","title","imageUrl","img","src","alt","span","aria-hidden","initialsOf","avatarOverflow"],"mappings":";;;;;;;AAUA;;;;;;AAMC,IACM,SAASA,WAAAA,CAAY,EAAEC,OAAO,EAAEC,YAAY,EAA4B,EAAA;IAC3E,MAAMC,MAAAA,GAASC,QAAQ,IAAMC,UAAAA,CAAWJ,QAAQK,UAAU,CAACH,MAAM,CAAA,EAAG;QAACF,OAAAA,CAAQK,UAAU,CAACH;AAAO,KAAA,CAAA;AAC/F,IAAA,MAAMI,UAAUC,qBAAAA,CAAsBP,OAAAA,CAAAA;AACtC,IAAA,MAAM,EAAEQ,KAAK,EAAEC,MAAM,EAAE,GAAGC,cAAcR,MAAAA,EAAQ,OAAOF,QAAQK,UAAU,CAACM,GAAG,KAAK,QAAA,GAAWX,QAAQK,UAAU,CAACM,GAAG,GAAG,CAAA,CAAA;AACtH,IAAA,MAAMC,KAAAA,GAAQC,kBAAAA,CAAmBb,OAAAA,EAASE,MAAAA,CAAOY,MAAM,GAAG,CAAA,CAAA;AAC1D,IAAA,MAAMC,OAAOf,OAAAA,CAAQK,UAAU,CAACU,IAAI,KAAK,UAAU,O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