@cratis/scene.blueprint.default 4.32.0 → 4.34.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 -1
- package/dist/cjs/defaultBlueprintComponentMetadata.js +2 -2
- package/dist/cjs/defaultBlueprintComponents.js +10 -2
- package/dist/cjs/defaultBlueprintComponents.js.map +1 -1
- package/dist/cjs/foundation/ChartWrapper.js +520 -0
- package/dist/cjs/foundation/ChartWrapper.js.map +1 -0
- package/dist/cjs/foundation/ColumnChooser.js +156 -0
- package/dist/cjs/foundation/ColumnChooser.js.map +1 -0
- package/dist/cjs/foundation/FilterBuilder.js +307 -0
- package/dist/cjs/foundation/FilterBuilder.js.map +1 -0
- package/dist/cjs/foundation/SavedViewsMenu.js +199 -0
- package/dist/cjs/foundation/SavedViewsMenu.js.map +1 -0
- package/dist/cjs/foundation/chartGeometry.js +101 -0
- package/dist/cjs/foundation/chartGeometry.js.map +1 -0
- package/dist/cjs/foundation/columnModel.js +43 -0
- package/dist/cjs/foundation/columnModel.js.map +1 -0
- package/dist/cjs/foundation/filterModel.js +123 -0
- package/dist/cjs/foundation/filterModel.js.map +1 -0
- package/dist/cjs/foundation/foundationComponentMetadata.js +28 -0
- package/dist/cjs/foundation/foundationComponentMetadata.js.map +1 -1
- package/dist/cjs/foundation/foundationDescriptors.js +153 -0
- package/dist/cjs/foundation/foundationDescriptors.js.map +1 -1
- package/dist/cjs/foundation/foundationSamples.js +130 -0
- package/dist/cjs/foundation/foundationSamples.js.map +1 -1
- package/dist/cjs/foundation/foundationStrings.js +25 -0
- package/dist/cjs/foundation/foundationStrings.js.map +1 -1
- package/dist/cjs/foundation/useElementWidth.js +31 -0
- package/dist/cjs/foundation/useElementWidth.js.map +1 -0
- package/dist/cjs/foundation/viewModel.js +24 -0
- package/dist/cjs/foundation/viewModel.js.map +1 -0
- package/dist/cjs/index.js +91 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/preview-host/ApplicationDocument.js +17 -0
- package/dist/cjs/preview-host/ApplicationDocument.js.map +1 -0
- package/dist/cjs/preview-host/ApplicationHost.js +113 -0
- package/dist/cjs/preview-host/ApplicationHost.js.map +1 -0
- package/dist/cjs/preview-host/FlowArrangementView.js +75 -0
- package/dist/cjs/preview-host/FlowArrangementView.js.map +1 -0
- package/dist/cjs/preview-host/PreviewProblem.js +32 -0
- package/dist/cjs/preview-host/PreviewProblem.js.map +1 -0
- package/dist/cjs/preview-host/PreviewProblemsView.js +51 -0
- package/dist/cjs/preview-host/PreviewProblemsView.js.map +1 -0
- package/dist/cjs/preview-host/PreviewSliceFragment.js +55 -0
- package/dist/cjs/preview-host/PreviewSliceFragment.js.map +1 -0
- package/dist/cjs/preview-host/PreviewTarget.js +17 -0
- package/dist/cjs/preview-host/PreviewTarget.js.map +1 -0
- package/dist/cjs/preview-host/PreviewTemplate.js +49 -0
- package/dist/cjs/preview-host/PreviewTemplate.js.map +1 -0
- package/dist/cjs/preview-host/PreviewToast.js +45 -0
- package/dist/cjs/preview-host/PreviewToast.js.map +1 -0
- package/dist/cjs/preview-host/ScenePreviewHost.js +290 -0
- package/dist/cjs/preview-host/ScenePreviewHost.js.map +1 -0
- package/dist/cjs/preview-host/composeApplication.js +249 -0
- package/dist/cjs/preview-host/composeApplication.js.map +1 -0
- package/dist/cjs/preview-host/defaultApplicationChrome.js +43 -0
- package/dist/cjs/preview-host/defaultApplicationChrome.js.map +1 -0
- package/dist/cjs/preview-host/diagnosePreview.js +100 -0
- package/dist/cjs/preview-host/diagnosePreview.js.map +1 -0
- package/dist/cjs/preview-host/previewProfile.js +53 -0
- package/dist/cjs/preview-host/previewProfile.js.map +1 -0
- package/dist/cjs/preview-host/previewSampleData.js +116 -0
- package/dist/cjs/preview-host/previewSampleData.js.map +1 -0
- package/dist/cjs/preview-host/resolvePreviewPlan.js +126 -0
- package/dist/cjs/preview-host/resolvePreviewPlan.js.map +1 -0
- package/dist/cjs/preview-host/useSizeClass.js +23 -0
- package/dist/cjs/preview-host/useSizeClass.js.map +1 -0
- 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 -1
- package/dist/esm/defaultBlueprintComponentMetadata.js +2 -2
- package/dist/esm/defaultBlueprintComponents.d.ts.map +1 -1
- package/dist/esm/defaultBlueprintComponents.js +10 -2
- package/dist/esm/defaultBlueprintComponents.js.map +1 -1
- package/dist/esm/foundation/ChartWrapper.d.ts +5 -0
- package/dist/esm/foundation/ChartWrapper.d.ts.map +1 -0
- package/dist/esm/foundation/ChartWrapper.js +517 -0
- package/dist/esm/foundation/ChartWrapper.js.map +1 -0
- package/dist/esm/foundation/ColumnChooser.d.ts +3 -0
- package/dist/esm/foundation/ColumnChooser.d.ts.map +1 -0
- package/dist/esm/foundation/ColumnChooser.js +154 -0
- package/dist/esm/foundation/ColumnChooser.js.map +1 -0
- package/dist/esm/foundation/FilterBuilder.d.ts +3 -0
- package/dist/esm/foundation/FilterBuilder.d.ts.map +1 -0
- package/dist/esm/foundation/FilterBuilder.js +305 -0
- package/dist/esm/foundation/FilterBuilder.js.map +1 -0
- package/dist/esm/foundation/Foundation.stories.d.ts +16 -0
- package/dist/esm/foundation/Foundation.stories.d.ts.map +1 -1
- package/dist/esm/foundation/Foundation.stories.js +16 -0
- package/dist/esm/foundation/Foundation.stories.js.map +1 -1
- package/dist/esm/foundation/SavedViewsMenu.d.ts +4 -0
- package/dist/esm/foundation/SavedViewsMenu.d.ts.map +1 -0
- package/dist/esm/foundation/SavedViewsMenu.js +196 -0
- package/dist/esm/foundation/SavedViewsMenu.js.map +1 -0
- package/dist/esm/foundation/chartGeometry.d.ts +34 -0
- package/dist/esm/foundation/chartGeometry.d.ts.map +1 -0
- package/dist/esm/foundation/chartGeometry.js +93 -0
- package/dist/esm/foundation/chartGeometry.js.map +1 -0
- package/dist/esm/foundation/columnModel.d.ts +11 -0
- package/dist/esm/foundation/columnModel.d.ts.map +1 -0
- package/dist/esm/foundation/columnModel.js +38 -0
- package/dist/esm/foundation/columnModel.js.map +1 -0
- package/dist/esm/foundation/filterModel.d.ts +33 -0
- package/dist/esm/foundation/filterModel.d.ts.map +1 -0
- package/dist/esm/foundation/filterModel.js +112 -0
- package/dist/esm/foundation/filterModel.js.map +1 -0
- package/dist/esm/foundation/foundationComponentMetadata.d.ts.map +1 -1
- package/dist/esm/foundation/foundationComponentMetadata.js +28 -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 +154 -1
- 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 +130 -0
- package/dist/esm/foundation/foundationSamples.js.map +1 -1
- package/dist/esm/foundation/foundationStrings.d.ts +25 -0
- package/dist/esm/foundation/foundationStrings.d.ts.map +1 -1
- package/dist/esm/foundation/foundationStrings.js +25 -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/useElementWidth.d.ts +3 -0
- package/dist/esm/foundation/useElementWidth.d.ts.map +1 -0
- package/dist/esm/foundation/useElementWidth.js +29 -0
- package/dist/esm/foundation/useElementWidth.js.map +1 -0
- package/dist/esm/foundation/viewModel.d.ts +7 -0
- package/dist/esm/foundation/viewModel.d.ts.map +1 -0
- package/dist/esm/foundation/viewModel.js +22 -0
- package/dist/esm/foundation/viewModel.js.map +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +26 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/preview-host/ApplicationDocument.d.ts +7 -0
- package/dist/esm/preview-host/ApplicationDocument.d.ts.map +1 -0
- package/dist/esm/preview-host/ApplicationDocument.js +15 -0
- package/dist/esm/preview-host/ApplicationDocument.js.map +1 -0
- package/dist/esm/preview-host/ApplicationHost.d.ts +21 -0
- package/dist/esm/preview-host/ApplicationHost.d.ts.map +1 -0
- package/dist/esm/preview-host/ApplicationHost.js +111 -0
- package/dist/esm/preview-host/ApplicationHost.js.map +1 -0
- package/dist/esm/preview-host/FlowArrangementView.d.ts +7 -0
- package/dist/esm/preview-host/FlowArrangementView.d.ts.map +1 -0
- package/dist/esm/preview-host/FlowArrangementView.js +73 -0
- package/dist/esm/preview-host/FlowArrangementView.js.map +1 -0
- package/dist/esm/preview-host/PreviewProblem.d.ts +26 -0
- package/dist/esm/preview-host/PreviewProblem.d.ts.map +1 -0
- package/dist/esm/preview-host/PreviewProblem.js +28 -0
- package/dist/esm/preview-host/PreviewProblem.js.map +1 -0
- package/dist/esm/preview-host/PreviewProblemsView.d.ts +7 -0
- package/dist/esm/preview-host/PreviewProblemsView.d.ts.map +1 -0
- package/dist/esm/preview-host/PreviewProblemsView.js +49 -0
- package/dist/esm/preview-host/PreviewProblemsView.js.map +1 -0
- package/dist/esm/preview-host/PreviewSliceFragment.d.ts +3 -0
- package/dist/esm/preview-host/PreviewSliceFragment.d.ts.map +1 -0
- package/dist/esm/preview-host/PreviewSliceFragment.js +53 -0
- package/dist/esm/preview-host/PreviewSliceFragment.js.map +1 -0
- package/dist/esm/preview-host/PreviewTarget.d.ts +10 -0
- package/dist/esm/preview-host/PreviewTarget.d.ts.map +1 -0
- package/dist/esm/preview-host/PreviewTarget.js +15 -0
- package/dist/esm/preview-host/PreviewTarget.js.map +1 -0
- package/dist/esm/preview-host/PreviewTemplate.d.ts +5 -0
- package/dist/esm/preview-host/PreviewTemplate.d.ts.map +1 -0
- package/dist/esm/preview-host/PreviewTemplate.js +45 -0
- package/dist/esm/preview-host/PreviewTemplate.js.map +1 -0
- package/dist/esm/preview-host/PreviewToast.d.ts +10 -0
- package/dist/esm/preview-host/PreviewToast.d.ts.map +1 -0
- package/dist/esm/preview-host/PreviewToast.js +43 -0
- package/dist/esm/preview-host/PreviewToast.js.map +1 -0
- package/dist/esm/preview-host/ScenePreviewHost.d.ts +32 -0
- package/dist/esm/preview-host/ScenePreviewHost.d.ts.map +1 -0
- package/dist/esm/preview-host/ScenePreviewHost.js +288 -0
- package/dist/esm/preview-host/ScenePreviewHost.js.map +1 -0
- package/dist/esm/preview-host/composeApplication.d.ts +34 -0
- package/dist/esm/preview-host/composeApplication.d.ts.map +1 -0
- package/dist/esm/preview-host/composeApplication.js +239 -0
- package/dist/esm/preview-host/composeApplication.js.map +1 -0
- package/dist/esm/preview-host/defaultApplicationChrome.d.ts +4 -0
- package/dist/esm/preview-host/defaultApplicationChrome.d.ts.map +1 -0
- package/dist/esm/preview-host/defaultApplicationChrome.js +41 -0
- package/dist/esm/preview-host/defaultApplicationChrome.js.map +1 -0
- package/dist/esm/preview-host/diagnosePreview.d.ts +22 -0
- package/dist/esm/preview-host/diagnosePreview.d.ts.map +1 -0
- package/dist/esm/preview-host/diagnosePreview.js +98 -0
- package/dist/esm/preview-host/diagnosePreview.js.map +1 -0
- package/dist/esm/preview-host/index.d.ts +18 -0
- package/dist/esm/preview-host/index.d.ts.map +1 -0
- package/dist/esm/preview-host/index.js +18 -0
- package/dist/esm/preview-host/index.js.map +1 -0
- package/dist/esm/preview-host/previewProfile.d.ts +6 -0
- package/dist/esm/preview-host/previewProfile.d.ts.map +1 -0
- package/dist/esm/preview-host/previewProfile.js +49 -0
- package/dist/esm/preview-host/previewProfile.js.map +1 -0
- package/dist/esm/preview-host/previewSampleData.d.ts +22 -0
- package/dist/esm/preview-host/previewSampleData.d.ts.map +1 -0
- package/dist/esm/preview-host/previewSampleData.js +113 -0
- package/dist/esm/preview-host/previewSampleData.js.map +1 -0
- package/dist/esm/preview-host/resolvePreviewPlan.d.ts +18 -0
- package/dist/esm/preview-host/resolvePreviewPlan.d.ts.map +1 -0
- package/dist/esm/preview-host/resolvePreviewPlan.js +124 -0
- package/dist/esm/preview-host/resolvePreviewPlan.js.map +1 -0
- package/dist/esm/preview-host/useSizeClass.d.ts +3 -0
- package/dist/esm/preview-host/useSizeClass.d.ts.map +1 -0
- package/dist/esm/preview-host/useSizeClass.js +21 -0
- package/dist/esm/preview-host/useSizeClass.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/foundation/ChartWrapper.tsx +252 -0
- package/foundation/ColumnChooser.tsx +73 -0
- package/foundation/FilterBuilder.tsx +144 -0
- package/foundation/Foundation.stories.tsx +16 -0
- package/foundation/SavedViewsMenu.tsx +94 -0
- package/foundation/chartGeometry.ts +108 -0
- package/foundation/columnModel.ts +39 -0
- package/foundation/filterModel.ts +111 -0
- package/foundation/foundationComponentMetadata.ts +4 -0
- package/foundation/foundationDescriptors.ts +86 -1
- package/foundation/foundationSamples.ts +19 -0
- package/foundation/foundationStrings.ts +25 -0
- package/foundation/index.ts +9 -0
- package/foundation/useElementWidth.ts +31 -0
- package/foundation/viewModel.ts +21 -0
- package/index.ts +1 -0
- package/package.json +8 -8
- package/preview-host/ApplicationDocument.ts +31 -0
- package/preview-host/ApplicationHost.tsx +114 -0
- package/preview-host/FlowArrangementView.tsx +59 -0
- package/preview-host/PreviewProblem.ts +68 -0
- package/preview-host/PreviewProblemsView.tsx +31 -0
- package/preview-host/PreviewSliceFragment.ts +43 -0
- package/preview-host/PreviewTarget.ts +19 -0
- package/preview-host/PreviewTemplate.tsx +45 -0
- package/preview-host/PreviewToast.tsx +32 -0
- package/preview-host/ScenePreviewHost.tsx +250 -0
- package/preview-host/composeApplication.ts +273 -0
- package/preview-host/defaultApplicationChrome.ts +33 -0
- package/preview-host/diagnosePreview.ts +132 -0
- package/preview-host/index.ts +20 -0
- package/preview-host/previewProfile.ts +47 -0
- package/preview-host/previewSampleData.ts +144 -0
- package/preview-host/resolvePreviewPlan.ts +100 -0
- package/preview-host/useSizeClass.ts +23 -0
- package/shell/layout.css +307 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_engine = require('@cratis/scene.engine');
|
|
4
|
+
var previewProfile = require('./previewProfile.js');
|
|
5
|
+
|
|
6
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
7
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
8
|
+
const noSample = {
|
|
9
|
+
packs: []
|
|
10
|
+
};
|
|
11
|
+
/** The names of the queries a document binds: every `query` it names, in bindings and on components. */ function collectQueryNames(value) {
|
|
12
|
+
const names = new Set();
|
|
13
|
+
const visit = (candidate)=>{
|
|
14
|
+
if (candidate === null || typeof candidate !== 'object') return;
|
|
15
|
+
if (Array.isArray(candidate)) {
|
|
16
|
+
candidate.forEach(visit);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
for (const [key, entry] of Object.entries(candidate)){
|
|
20
|
+
if (key === 'query' && typeof entry === 'string' && entry.length > 0) names.add(entry);
|
|
21
|
+
else visit(entry);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
visit(value);
|
|
25
|
+
return [
|
|
26
|
+
...names
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
function readPath(source, path) {
|
|
30
|
+
if (!path) return source;
|
|
31
|
+
return path.split('.').reduce((current, segment)=>{
|
|
32
|
+
if (current === null || current === undefined || typeof current !== 'object') return undefined;
|
|
33
|
+
if (Array.isArray(current)) return /^(0|[1-9][0-9]*)$/.test(segment) ? current[Number(segment)] : undefined;
|
|
34
|
+
return Object.hasOwn(current, segment) ? current[segment] : undefined;
|
|
35
|
+
}, source);
|
|
36
|
+
}
|
|
37
|
+
function shapeOfFields(name, fields) {
|
|
38
|
+
return {
|
|
39
|
+
name,
|
|
40
|
+
fields: fields.map((field)=>({
|
|
41
|
+
name: field.name,
|
|
42
|
+
type: field.type
|
|
43
|
+
}))
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function scalar(value) {
|
|
47
|
+
return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' ? value : undefined;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Plugs the sample data resolution into what a preview renders with (PRV6). Nothing here decides what a row looks like - that is
|
|
51
|
+
* `resolveSampleData` - this only asks it, with the application profile's selection, for the queries the document binds and the
|
|
52
|
+
* commands its slices accept. It is design/preview time only: a production host never builds one (SD6).
|
|
53
|
+
*
|
|
54
|
+
* @param application The document whose profile carries the selection and whose bindings are scanned.
|
|
55
|
+
* @param sample The packs, session override and seed.
|
|
56
|
+
*/ function createPreviewSampleData(application, sample = noSample) {
|
|
57
|
+
const profile = previewProfile.previewProfile(application.uiProfiles);
|
|
58
|
+
const context = {
|
|
59
|
+
packs: sample.packs,
|
|
60
|
+
profile,
|
|
61
|
+
sessionActivePack: sample.sessionActivePack,
|
|
62
|
+
blueprintDefaultPack: sample.blueprintDefaultPack,
|
|
63
|
+
locale: sample.locale,
|
|
64
|
+
seed: sample.seed,
|
|
65
|
+
rowCount: sample.rowCount,
|
|
66
|
+
isDesignOrPreview: true
|
|
67
|
+
};
|
|
68
|
+
const rows = (target, shape)=>{
|
|
69
|
+
const known = shape ?? sample.shapes?.[target];
|
|
70
|
+
const resolved = scene_engine.resolveSampleData({
|
|
71
|
+
target,
|
|
72
|
+
...known === undefined ? {} : {
|
|
73
|
+
shape: known
|
|
74
|
+
}
|
|
75
|
+
}, context);
|
|
76
|
+
if (resolved.rows.length > 0 || !target.includes('.')) return resolved;
|
|
77
|
+
const short = target.slice(target.lastIndexOf('.') + 1);
|
|
78
|
+
return scene_engine.resolveSampleData({
|
|
79
|
+
target: short,
|
|
80
|
+
...known === undefined ? {} : {
|
|
81
|
+
shape: known
|
|
82
|
+
}
|
|
83
|
+
}, context);
|
|
84
|
+
};
|
|
85
|
+
const queryResults = {};
|
|
86
|
+
for (const name of collectQueryNames([
|
|
87
|
+
application.screens,
|
|
88
|
+
application.screenTemplates,
|
|
89
|
+
application.dialogTemplates ?? [],
|
|
90
|
+
application.layouts
|
|
91
|
+
])){
|
|
92
|
+
const resolved = rows(name);
|
|
93
|
+
if (resolved.rows.length > 0) queryResults[name] = resolved.rows;
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
rows,
|
|
97
|
+
queryResults,
|
|
98
|
+
resolveBinding: (binding)=>binding.query ? readPath(queryResults[binding.query], binding.path) : undefined,
|
|
99
|
+
commandFields: (command, fields)=>{
|
|
100
|
+
const first = rows(command, shapeOfFields(command, fields)).rows[0];
|
|
101
|
+
if (!first) return fields;
|
|
102
|
+
return fields.map((field)=>{
|
|
103
|
+
const key = Object.keys(first).find((candidate)=>candidate.toLowerCase() === field.name.toLowerCase());
|
|
104
|
+
const value = key === undefined ? undefined : scalar(first[key]);
|
|
105
|
+
return value === undefined ? field : {
|
|
106
|
+
...field,
|
|
107
|
+
initialValue: value
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
exports.collectQueryNames = collectQueryNames;
|
|
115
|
+
exports.createPreviewSampleData = createPreviewSampleData;
|
|
116
|
+
//# sourceMappingURL=previewSampleData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"previewSampleData.js","sources":["../../../preview-host/previewSampleData.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 { BindingExpression, SampleDataPack, SampleShape } from '@cratis/scene.model';\nimport { BindingResolver, SampleDataResolution, resolveSampleData } from '@cratis/scene.engine';\nimport type { SliceCommandField } from '@cratis/scene.react';\nimport { ApplicationDocument } from './ApplicationDocument';\nimport { previewProfile } from './previewProfile';\n\n/**\n * Which sample data a preview shows (spec 11, PRV6). The active pack is the application profile's (`sampleData.activePack`),\n * chosen once for the whole application; `sessionActivePack` is the preview strip's selector, a session-only override of that\n * setting - not a second source of truth. Resolution is `resolveSampleData`'s: bound pack, active pack, the blueprint's default\n * pack, then generated data, and the same seed gives the same rows every time.\n */\nexport interface PreviewSampleData {\n /** Every pack available: the blueprints' and the author's own. */\n packs: SampleDataPack[];\n\n /** The preview strip's choice for this session: a pack id, or the empty string for generated data. Absent leaves the profile's. */\n sessionActivePack?: string;\n\n /** The default pack of the blueprint the templates came from. */\n blueprintDefaultPack?: string;\n\n /** The locale of generated data when no pack supplies one. */\n locale?: string;\n\n /** The seed for generated data; 1 by default, so previews are stable. */\n seed?: number;\n\n /** The number of generated rows. */\n rowCount?: number;\n\n /** The shape of the rows of each read model or query, by name, for generating rows where no pack has them. */\n shapes?: Record<string, SampleShape>;\n}\n\n/** What a preview reads its data from. */\nexport interface PreviewSampleDataSource {\n /** The rows for a read model or query; empty when nothing supplies any. */\n rows(target: string, shape?: SampleShape): SampleDataResolution;\n\n /** The rows of every query the document binds, by query name - the `queryResults` of the render scope. */\n queryResults: Record<string, unknown>;\n\n /** Resolves a binding that names a query against the sample rows. */\n resolveBinding: BindingResolver;\n\n /** Starting values for a command's fields from the sample rows, for the task dialog of a slice. */\n commandFields(command: string, fields: SliceCommandField[]): SliceCommandField[];\n}\n\nconst noSample: PreviewSampleData = { packs: [] };\n\n/** The names of the queries a document binds: every `query` it names, in bindings and on components. */\nexport function collectQueryNames(value: unknown): string[] {\n const names = new Set<string>();\n const visit = (candidate: unknown) => {\n if (candidate === null || typeof candidate !== 'object') return;\n if (Array.isArray(candidate)) {\n candidate.forEach(visit);\n return;\n }\n\n for (const [key, entry] of Object.entries(candidate as Record<string, unknown>)) {\n if (key === 'query' && typeof entry === 'string' && entry.length > 0) names.add(entry);\n else visit(entry);\n }\n };\n\n visit(value);\n return [...names];\n}\n\nfunction readPath(source: unknown, path: string): unknown {\n if (!path) return source;\n return path.split('.').reduce<unknown>((current, segment) => {\n if (current === null || current === undefined || typeof current !== 'object') return undefined;\n if (Array.isArray(current)) return /^(0|[1-9][0-9]*)$/.test(segment) ? current[Number(segment)] : undefined;\n return Object.hasOwn(current, segment) ? (current as Record<string, unknown>)[segment] : undefined;\n }, source);\n}\n\nfunction shapeOfFields(name: string, fields: SliceCommandField[]): SampleShape {\n return { name, fields: fields.map(field => ({ name: field.name, type: field.type })) };\n}\n\nfunction scalar(value: unknown): string | number | boolean | undefined {\n return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' ? value : undefined;\n}\n\n/**\n * Plugs the sample data resolution into what a preview renders with (PRV6). Nothing here decides what a row looks like - that is\n * `resolveSampleData` - this only asks it, with the application profile's selection, for the queries the document binds and the\n * commands its slices accept. It is design/preview time only: a production host never builds one (SD6).\n *\n * @param application The document whose profile carries the selection and whose bindings are scanned.\n * @param sample The packs, session override and seed.\n */\nexport function createPreviewSampleData(application: ApplicationDocument, sample: PreviewSampleData = noSample): PreviewSampleDataSource {\n const profile = previewProfile(application.uiProfiles);\n const context = {\n packs: sample.packs,\n profile,\n sessionActivePack: sample.sessionActivePack,\n blueprintDefaultPack: sample.blueprintDefaultPack,\n locale: sample.locale,\n seed: sample.seed,\n rowCount: sample.rowCount,\n isDesignOrPreview: true,\n };\n\n const rows = (target: string, shape?: SampleShape): SampleDataResolution => {\n const known = shape ?? sample.shapes?.[target];\n const resolved = resolveSampleData({ target, ...(known === undefined ? {} : { shape: known }) }, context);\n if (resolved.rows.length > 0 || !target.includes('.')) return resolved;\n\n const short = target.slice(target.lastIndexOf('.') + 1);\n return resolveSampleData({ target: short, ...(known === undefined ? {} : { shape: known }) }, context);\n };\n\n const queryResults: Record<string, unknown> = {};\n for (const name of collectQueryNames([application.screens, application.screenTemplates, application.dialogTemplates ?? [], application.layouts])) {\n const resolved = rows(name);\n if (resolved.rows.length > 0) queryResults[name] = resolved.rows;\n }\n\n return {\n rows,\n queryResults,\n resolveBinding: (binding: BindingExpression) => binding.query ? readPath(queryResults[binding.query], binding.path) : undefined,\n commandFields: (command, fields) => {\n const first = rows(command, shapeOfFields(command, fields)).rows[0];\n if (!first) return fields;\n\n return fields.map(field => {\n const key = Object.keys(first).find(candidate => candidate.toLowerCase() === field.name.toLowerCase());\n const value = key === undefined ? undefined : scalar(first[key]);\n return value === undefined ? field : { ...field, initialValue: value };\n });\n },\n };\n}\n"],"names":["noSample","packs","collectQueryNames","value","names","Set","visit","candidate","Array","isArray","forEach","key","entry","Object","entries","length","add","readPath","source","path","split","reduce","current","segment","undefined","test","Number","hasOwn","shapeOfFields","name","fields","map","field","type","scalar","createPreviewSampleData","application","sample","profile","previewProfile","uiProfiles","context","sessionActivePack","blueprintDefaultPack","locale","seed","rowCount","isDesignOrPreview","rows","target","shape","known","shapes","resolved","resolveSampleData","includes","short","slice","lastIndexOf","queryResults","screens","screenTemplates","dialogTemplates","layouts","resolveBinding","binding","query","commandFields","command","first","keys","find","toLowerCase","initialValue"],"mappings":";;;;;AAAA;AACA;AAoDA,MAAMA,QAAAA,GAA8B;AAAEC,IAAAA,KAAAA,EAAO;AAAG,CAAA;AAEhD,yGACO,SAASC,iBAAAA,CAAkBC,KAAc,EAAA;AAC5C,IAAA,MAAMC,QAAQ,IAAIC,GAAAA,EAAAA;AAClB,IAAA,MAAMC,QAAQ,CAACC,SAAAA,GAAAA;AACX,QAAA,IAAIA,SAAAA,KAAc,IAAA,IAAQ,OAAOA,SAAAA,KAAc,QAAA,EAAU;QACzD,IAAIC,KAAAA,CAAMC,OAAO,CAACF,SAAAA,CAAAA,EAAY;AAC1BA,YAAAA,SAAAA,CAAUG,OAAO,CAACJ,KAAAA,CAAAA;AAClB,YAAA;AACJ,QAAA;QAEA,KAAK,MAAM,CAACK,GAAAA,EAAKC,KAAAA,CAAM,IAAIC,MAAAA,CAAOC,OAAO,CAACP,SAAAA,CAAAA,CAAuC;YAC7E,IAAII,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AI,CAAC2C,WAAW,EAAA,CAAA;AACnG,gBAAA,MAAMrE,QAAQQ,GAAAA,KAAQa,SAAAA,GAAYA,YAAYU,MAAAA,CAAOmC,KAAK,CAAC1D,GAAAA,CAAI,CAAA;gBAC/D,OAAOR,KAAAA,KAAUqB,YAAYQ,KAAAA,GAAQ;AAAE,oBAAA,GAAGA,KAAK;oBAAEyC,YAAAA,EAActE;AAAM,iBAAA;AACzE,YAAA,CAAA,CAAA;AACJ,QAAA;AACJ,KAAA;AACJ;;;"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var scene_engine = require('@cratis/scene.engine');
|
|
5
|
+
var PreviewTarget = require('./PreviewTarget.js');
|
|
6
|
+
var PreviewProblem = require('./PreviewProblem.js');
|
|
7
|
+
|
|
8
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
9
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
10
|
+
const error = (code, message, nodeId)=>({
|
|
11
|
+
code,
|
|
12
|
+
severity: PreviewProblem.PreviewProblemSeverity.Error,
|
|
13
|
+
message,
|
|
14
|
+
...nodeId === undefined ? {} : {
|
|
15
|
+
nodeId
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
/** The feature a qualified id names, and the display names of the features above it, outermost first. */ function featurePath(structure, qualified) {
|
|
19
|
+
const [moduleId, ...rest] = qualified.split('.');
|
|
20
|
+
let features = structure.modules.find((module)=>module.id === moduleId)?.features;
|
|
21
|
+
const names = [];
|
|
22
|
+
let found;
|
|
23
|
+
for (const id of rest){
|
|
24
|
+
found = features?.find((candidate)=>candidate.id === id);
|
|
25
|
+
if (!found) return undefined;
|
|
26
|
+
names.push(found.name);
|
|
27
|
+
features = found.features;
|
|
28
|
+
}
|
|
29
|
+
return found ? {
|
|
30
|
+
feature: found,
|
|
31
|
+
names
|
|
32
|
+
} : undefined;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Resolves a preview target against the application structure (PRV3): a module previews its first feature, a feature itself,
|
|
36
|
+
* a slice the page of the feature it belongs to with the slice itself opened (State Change) or isolated (State View).
|
|
37
|
+
* A target that is not in the structure resolves to a problem, not to a blank screen.
|
|
38
|
+
*/ function resolvePreviewPlan(structure, target) {
|
|
39
|
+
const index = structure instanceof scene_engine.ApplicationStructureIndex ? structure : new scene_engine.ApplicationStructureIndex(structure);
|
|
40
|
+
if (PreviewTarget.isSliceTarget(target)) {
|
|
41
|
+
const slice = index.findSlice(target.slice);
|
|
42
|
+
if (!slice) return {
|
|
43
|
+
problems: [
|
|
44
|
+
error(PreviewProblem.PreviewProblemCode.TargetNotFound, `The slice '${target.slice}' is not in the application.`, target.slice)
|
|
45
|
+
]
|
|
46
|
+
};
|
|
47
|
+
if (slice.kind === scene_model.SliceKind.Automation) {
|
|
48
|
+
return {
|
|
49
|
+
problems: [
|
|
50
|
+
error(PreviewProblem.PreviewProblemCode.SliceNotPreviewable, `The slice '${target.slice}' is an automation: it reacts to events and has nothing to show.`, target.slice)
|
|
51
|
+
]
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const segments = target.slice.split('.');
|
|
55
|
+
const module = segments[0];
|
|
56
|
+
const featureId = segments.length > 2 ? segments.slice(0, -1).join('.') : undefined;
|
|
57
|
+
const moduleNode = index.findModule(module);
|
|
58
|
+
const path = featureId ? featurePath(index.structure, featureId) : undefined;
|
|
59
|
+
const containerFeature = featureId ?? index.firstFeatureId(module);
|
|
60
|
+
return {
|
|
61
|
+
plan: {
|
|
62
|
+
kind: slice.kind === scene_model.SliceKind.StateChange ? 'stateChange' : 'stateView',
|
|
63
|
+
module,
|
|
64
|
+
feature: containerFeature,
|
|
65
|
+
slice: target.slice,
|
|
66
|
+
...slice.kind === scene_model.SliceKind.StateChange ? {
|
|
67
|
+
command: slice.command ?? slice.id
|
|
68
|
+
} : {},
|
|
69
|
+
breadcrumb: [
|
|
70
|
+
moduleNode?.name ?? module,
|
|
71
|
+
...path?.names ?? [],
|
|
72
|
+
slice.name
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
problems: []
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const moduleNode = index.findModule(target.module);
|
|
79
|
+
if (!moduleNode) return {
|
|
80
|
+
problems: [
|
|
81
|
+
error(PreviewProblem.PreviewProblemCode.TargetNotFound, `The module '${target.module}' is not in the application.`, target.module)
|
|
82
|
+
]
|
|
83
|
+
};
|
|
84
|
+
if (target.feature === undefined) {
|
|
85
|
+
const first = index.firstFeatureId(target.module);
|
|
86
|
+
if (first === undefined) return {
|
|
87
|
+
problems: [
|
|
88
|
+
error(PreviewProblem.PreviewProblemCode.ModuleWithoutFeatures, `The module '${moduleNode.name}' has no feature to show.`, target.module)
|
|
89
|
+
]
|
|
90
|
+
};
|
|
91
|
+
return {
|
|
92
|
+
plan: {
|
|
93
|
+
kind: 'module',
|
|
94
|
+
module: target.module,
|
|
95
|
+
feature: first,
|
|
96
|
+
breadcrumb: [
|
|
97
|
+
moduleNode.name,
|
|
98
|
+
...featurePath(index.structure, first)?.names ?? []
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
problems: []
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
const qualified = target.feature.startsWith(`${target.module}.`) ? target.feature : `${target.module}.${target.feature}`;
|
|
105
|
+
const path = featurePath(index.structure, qualified);
|
|
106
|
+
if (!path) return {
|
|
107
|
+
problems: [
|
|
108
|
+
error(PreviewProblem.PreviewProblemCode.TargetNotFound, `The feature '${qualified}' is not in the application.`, qualified)
|
|
109
|
+
]
|
|
110
|
+
};
|
|
111
|
+
return {
|
|
112
|
+
plan: {
|
|
113
|
+
kind: 'feature',
|
|
114
|
+
module: target.module,
|
|
115
|
+
feature: qualified,
|
|
116
|
+
breadcrumb: [
|
|
117
|
+
moduleNode.name,
|
|
118
|
+
...path.names
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
problems: []
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
exports.resolvePreviewPlan = resolvePreviewPlan;
|
|
126
|
+
//# sourceMappingURL=resolvePreviewPlan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolvePreviewPlan.js","sources":["../../../preview-host/resolvePreviewPlan.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 { ApplicationStructure, FeatureNode, SliceKind } from '@cratis/scene.model';\nimport { ApplicationStructureIndex } from '@cratis/scene.engine';\nimport { PreviewTarget, isSliceTarget } from './PreviewTarget';\nimport { PreviewProblem, PreviewProblemCode, PreviewProblemSeverity } from './PreviewProblem';\n\n/** What a target resolved to in the application structure. */\nexport interface PreviewPlan {\n /** `module`, `feature`, `stateChange` or `stateView`. */\n kind: 'module' | 'feature' | 'stateChange' | 'stateView';\n\n /** The module the preview is in. */\n module: string;\n\n /** The qualified id of the feature whose screen is the page: the module's first feature, the feature itself, or the slice's feature. */\n feature?: string;\n\n /** The qualified id of the slice, for a slice target. */\n slice?: string;\n\n /** The command a State Change slice accepts. */\n command?: string;\n\n /** The display names from the module down to the target - what the preview strip shows as `Sales › Orders` (PRV7). */\n breadcrumb: string[];\n}\n\nexport interface PreviewPlanResult {\n plan?: PreviewPlan;\n problems: PreviewProblem[];\n}\n\nconst error = (code: PreviewProblemCode, message: string, nodeId?: string): PreviewProblem => ({ code, severity: PreviewProblemSeverity.Error, message, ...(nodeId === undefined ? {} : { nodeId }) });\n\n/** The feature a qualified id names, and the display names of the features above it, outermost first. */\nfunction featurePath(structure: ApplicationStructure, qualified: string): { feature: FeatureNode; names: string[] } | undefined {\n const [moduleId, ...rest] = qualified.split('.');\n let features = structure.modules.find(module => module.id === moduleId)?.features;\n const names: string[] = [];\n let found: FeatureNode | undefined;\n for (const id of rest) {\n found = features?.find(candidate => candidate.id === id);\n if (!found) return undefined;\n names.push(found.name);\n features = found.features;\n }\n\n return found ? { feature: found, names } : undefined;\n}\n\n/**\n * Resolves a preview target against the application structure (PRV3): a module previews its first feature, a feature itself,\n * a slice the page of the feature it belongs to with the slice itself opened (State Change) or isolated (State View).\n * A target that is not in the structure resolves to a problem, not to a blank screen.\n */\nexport function resolvePreviewPlan(structure: ApplicationStructure | ApplicationStructureIndex, target: PreviewTarget): PreviewPlanResult {\n const index = structure instanceof ApplicationStructureIndex ? structure : new ApplicationStructureIndex(structure);\n\n if (isSliceTarget(target)) {\n const slice = index.findSlice(target.slice);\n if (!slice) return { problems: [error(PreviewProblemCode.TargetNotFound, `The slice '${target.slice}' is not in the application.`, target.slice)] };\n if (slice.kind === SliceKind.Automation) {\n return { problems: [error(PreviewProblemCode.SliceNotPreviewable, `The slice '${target.slice}' is an automation: it reacts to events and has nothing to show.`, target.slice)] };\n }\n\n const segments = target.slice.split('.');\n const module = segments[0];\n const featureId = segments.length > 2 ? segments.slice(0, -1).join('.') : undefined;\n const moduleNode = index.findModule(module);\n const path = featureId ? featurePath(index.structure, featureId) : undefined;\n const containerFeature = featureId ?? index.firstFeatureId(module);\n return {\n plan: {\n kind: slice.kind === SliceKind.StateChange ? 'stateChange' : 'stateView',\n module,\n feature: containerFeature,\n slice: target.slice,\n ...(slice.kind === SliceKind.StateChange ? { command: slice.command ?? slice.id } : {}),\n breadcrumb: [moduleNode?.name ?? module, ...(path?.names ?? []), slice.name],\n },\n problems: [],\n };\n }\n\n const moduleNode = index.findModule(target.module);\n if (!moduleNode) return { problems: [error(PreviewProblemCode.TargetNotFound, `The module '${target.module}' is not in the application.`, target.module)] };\n\n if (target.feature === undefined) {\n const first = index.firstFeatureId(target.module);\n if (first === undefined) return { problems: [error(PreviewProblemCode.ModuleWithoutFeatures, `The module '${moduleNode.name}' has no feature to show.`, target.module)] };\n return { plan: { kind: 'module', module: target.module, feature: first, breadcrumb: [moduleNode.name, ...(featurePath(index.structure, first)?.names ?? [])] }, problems: [] };\n }\n\n const qualified = target.feature.startsWith(`${target.module}.`) ? target.feature : `${target.module}.${target.feature}`;\n const path = featurePath(index.structure, qualified);\n if (!path) return { problems: [error(PreviewProblemCode.TargetNotFound, `The feature '${qualified}' is not in the application.`, qualified)] };\n return { plan: { kind: 'feature', module: target.module, feature: qualified, breadcrumb: [moduleNode.name, ...path.names] }, problems: [] };\n}\n"],"names":["error","code","message","nodeId","severity","PreviewProblemSeverity","Error","undefined","featurePath","structure","qualified","moduleId","rest","split","features","modules","find","module","id","names","found","candidate","push","name","feature","resolvePreviewPlan","target","index","ApplicationStructureIndex","isSliceTarget","slice","findSlice","problems","PreviewProblemCode","TargetNotFound","kind","SliceKind","Automation","SliceNotPreviewable","segments","featureId","length","join","moduleNode","findModule","path","containerFeature","firstFeatureId","plan","StateChange","command","breadcrumb","first","ModuleWithoutFeatures","startsWith"],"mappings":";;;;;;;AAAA;AACA;AAiCA,MAAMA,KAAAA,GAAQ,CAACC,IAAAA,EAA0BC,OAAAA,EAAiBC,UAAqC;AAAEF,QAAAA,IAAAA;AAAMG,QAAAA,QAAAA,EAAUC,sCAAuBC,KAAK;AAAEJ,QAAAA,OAAAA;QAAS,GAAIC,MAAAA,KAAWI,SAAAA,GAAY,EAAC,GAAI;AAAEJ,YAAAA;;KAAU,CAAA;AAEpM,0GACA,SAASK,WAAAA,CAAYC,SAA+B,EAAEC,SAAiB,EAAA;AACnE,IAAA,MAAM,CAACC,QAAAA,EAAU,GAAGC,KAAK,GAAGF,SAAAA,CAAUG,KAAK,CAAC,GAAA,CAAA;IAC5C,IAAIC,QAAAA,GAAWL,SAAAA,CAAUM,OAAO,CAACC,IAAI,CAACC,CAAAA,MAAAA,GAAUA,MAAAA,CAAOC,EAAE,KAAKP,QAAAA,CAAAA,EAAWG,QAAAA;AACzE,IAAA,MAAMK,QAAkB,EAAE;IAC1B,IAAIC,KAAAA;IACJ,KAAK,MAAMF,MAAMN,IAAAA,CAAM;AACnBQ,QAAAA,KAAAA,GAAQN,UAAU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AYmB,KAAAA,CAAMlB,SAAS,EAAEC,SAAAA,CAAAA;IAC1C,IAAI,CAACmC,MAAM,OAAO;QAAEb,QAAAA,EAAU;YAAChC,KAAAA,CAAMiC,iCAAAA,CAAmBC,cAAc,EAAE,CAAC,aAAa,EAAExB,SAAAA,CAAU,4BAA4B,CAAC,EAAEA,SAAAA;AAAW;AAAC,KAAA;IAC7I,OAAO;QAAEsC,IAAAA,EAAM;YAAEb,IAAAA,EAAM,SAAA;AAAWlB,YAAAA,MAAAA,EAAQS,OAAOT,MAAM;YAAEO,OAAAA,EAASd,SAAAA;YAAWyC,UAAAA,EAAY;AAACR,gBAAAA,UAAAA,CAAWpB,IAAI;AAAKsB,gBAAAA,GAAAA,IAAAA,CAAK1B;AAAM;AAAC,SAAA;AAAGa,QAAAA,QAAAA,EAAU;AAAG,KAAA;AAC9I;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
var scene_engine = require('@cratis/scene.engine');
|
|
5
|
+
|
|
6
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
7
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
8
|
+
/**
|
|
9
|
+
* Tracks the browser window's {@link SizeClass}, recomputing whenever it resizes across a boundary the
|
|
10
|
+
* shared engine cares about. This is what lets a modeled `when width compact` override actually take
|
|
11
|
+
* effect on a narrow window instead of the arrangement engine's size-aware logic never being asked.
|
|
12
|
+
*/ function useSizeClass() {
|
|
13
|
+
const [sizeClass, setSizeClass] = react.useState(()=>scene_engine.computeSizeClass(globalThis.innerWidth, globalThis.innerHeight));
|
|
14
|
+
react.useEffect(()=>{
|
|
15
|
+
const onResize = ()=>setSizeClass(scene_engine.computeSizeClass(globalThis.innerWidth, globalThis.innerHeight));
|
|
16
|
+
globalThis.addEventListener('resize', onResize);
|
|
17
|
+
return ()=>globalThis.removeEventListener('resize', onResize);
|
|
18
|
+
}, []);
|
|
19
|
+
return sizeClass;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.useSizeClass = useSizeClass;
|
|
23
|
+
//# sourceMappingURL=useSizeClass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSizeClass.js","sources":["../../../preview-host/useSizeClass.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 { useEffect, useState } from 'react';\nimport type { SizeClass } from '@cratis/scene.model';\nimport { computeSizeClass } from '@cratis/scene.engine';\n\n/**\n * Tracks the browser window's {@link SizeClass}, recomputing whenever it resizes across a boundary the\n * shared engine cares about. This is what lets a modeled `when width compact` override actually take\n * effect on a narrow window instead of the arrangement engine's size-aware logic never being asked.\n */\nexport function useSizeClass(): SizeClass {\n const [sizeClass, setSizeClass] = useState<SizeClass>(() => computeSizeClass(globalThis.innerWidth, globalThis.innerHeight));\n\n useEffect(() => {\n const onResize = () => setSizeClass(computeSizeClass(globalThis.innerWidth, globalThis.innerHeight));\n globalThis.addEventListener('resize', onResize);\n return () => globalThis.removeEventListener('resize', onResize);\n }, []);\n\n return sizeClass;\n}\n"],"names":["useSizeClass","sizeClass","setSizeClass","useState","computeSizeClass","globalThis","innerWidth","innerHeight","useEffect","onResize","addEventListener","removeEventListener"],"mappings":";;;;;AAAA;AACA;AAMA;;;;AAIC,IACM,SAASA,YAAAA,GAAAA;IACZ,MAAM,CAACC,SAAAA,EAAWC,YAAAA,CAAa,GAAGC,cAAAA,CAAoB,IAAMC,6BAAAA,CAAiBC,UAAAA,CAAWC,UAAU,EAAED,UAAAA,CAAWE,WAAW,CAAA,CAAA;IAE1HC,eAAAA,CAAU,IAAA;QACN,MAAMC,QAAAA,GAAW,IAAMP,YAAAA,CAAaE,6BAAAA,CAAiBC,WAAWC,UAAU,EAAED,WAAWE,WAAW,CAAA,CAAA;QAClGF,UAAAA,CAAWK,gBAAgB,CAAC,QAAA,EAAUD,QAAAA,CAAAA;AACtC,QAAA,OAAO,IAAMJ,UAAAA,CAAWM,mBAAmB,CAAC,QAAA,EAAUF,QAAAA,CAAAA;AAC1D,IAAA,CAAA,EAAG,EAAE,CAAA;IAEL,OAAOR,SAAAA;AACX;;"}
|
|
@@ -18,6 +18,10 @@ export declare enum ComponentName {
|
|
|
18
18
|
EmptyState = "emptyState",
|
|
19
19
|
StatCard = "statCard",
|
|
20
20
|
TrendChip = "trendChip",
|
|
21
|
-
StatusChip = "statusChip"
|
|
21
|
+
StatusChip = "statusChip",
|
|
22
|
+
ChartWrapper = "chartWrapper",
|
|
23
|
+
FilterBuilder = "filterBuilder",
|
|
24
|
+
ColumnChooser = "columnChooser",
|
|
25
|
+
SavedViewsMenu = "savedViewsMenu"
|
|
22
26
|
}
|
|
23
27
|
//# 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;
|
|
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"}
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
/** One key figure with its label, trend and comparison period. */ ComponentName["StatCard"] = "statCard";
|
|
29
29
|
/** A change drawn as a direction, a magnitude and whether it is good. */ ComponentName["TrendChip"] = "trendChip";
|
|
30
30
|
/** A status as a semantic color, an icon and its text. */ ComponentName["StatusChip"] = "statusChip";
|
|
31
|
+
/** One chart - line, bar, stacked, donut or funnel - with its legend and a table of the same data. */ ComponentName["ChartWrapper"] = "chartWrapper";
|
|
32
|
+
/** Conditions on fields, joined by AND or OR in nested groups. */ ComponentName["FilterBuilder"] = "filterBuilder";
|
|
33
|
+
/** Which columns a table shows, and in what order. */ ComponentName["ColumnChooser"] = "columnChooser";
|
|
34
|
+
/** A list's saved views as a menu button. */ ComponentName["SavedViewsMenu"] = "savedViewsMenu";
|
|
31
35
|
return ComponentName;
|
|
32
36
|
}({});
|
|
33
37
|
|
|
@@ -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"],"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;
|
|
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;;"}
|
|
@@ -4,13 +4,13 @@ import { ComponentName } from './ComponentName.js';
|
|
|
4
4
|
import { defaultBlueprintComponentMetadata } from './defaultBlueprintComponentMetadata.js';
|
|
5
5
|
import './foundation/ComponentState.js';
|
|
6
6
|
import 'react/jsx-runtime';
|
|
7
|
+
import 'react';
|
|
7
8
|
import { foundationDescriptors } from './foundation/foundationDescriptors.js';
|
|
8
9
|
import './foundation/foundationComponentMetadata.js';
|
|
9
10
|
import './foundation/foundationSamples.js';
|
|
10
11
|
import { defaultBlueprintComponents } from './defaultBlueprintComponents.js';
|
|
11
12
|
import { defaultBlueprintName } from './packageName.js';
|
|
12
13
|
import { defaultBlueprintThemes } from './themes/defaultBlueprintThemes.js';
|
|
13
|
-
import 'react';
|
|
14
14
|
import './gallery/elements.js';
|
|
15
15
|
import './gallery/navigation.js';
|
|
16
16
|
import { LayoutName } from './layouts/LayoutName.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ComponentCategory } from '@cratis/scene.model';
|
|
2
2
|
import './foundation/ComponentState.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
|
+
import 'react';
|
|
5
|
+
import { componentMetadata, navigationDesignMode } from '@cratis/scene.react';
|
|
4
6
|
import './foundation/foundationDescriptors.js';
|
|
5
7
|
import { foundationComponentMetadata } from './foundation/foundationComponentMetadata.js';
|
|
6
8
|
import './foundation/foundationSamples.js';
|
|
7
|
-
import { componentMetadata, navigationDesignMode } from '@cratis/scene.react';
|
|
8
9
|
import './defaultBlueprintComponents.js';
|
|
9
|
-
import 'react';
|
|
10
10
|
|
|
11
11
|
// Copyright (c) Cratis. All rights reserved.
|
|
12
12
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
@@ -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,iBAyBxC,CAAC"}
|
|
@@ -7,10 +7,14 @@ import { EmptyState } from './foundation/EmptyState.js';
|
|
|
7
7
|
import { TrendChip } from './foundation/TrendChip.js';
|
|
8
8
|
import { StatusChip } from './foundation/StatusChip.js';
|
|
9
9
|
import { StatCard } from './foundation/StatCard.js';
|
|
10
|
+
import 'react';
|
|
11
|
+
import { ChartWrapper } from './foundation/ChartWrapper.js';
|
|
12
|
+
import { FilterBuilder } from './foundation/FilterBuilder.js';
|
|
13
|
+
import { ColumnChooser } from './foundation/ColumnChooser.js';
|
|
14
|
+
import { SavedViewsMenu } from './foundation/SavedViewsMenu.js';
|
|
10
15
|
import './foundation/foundationDescriptors.js';
|
|
11
16
|
import './foundation/foundationComponentMetadata.js';
|
|
12
17
|
import './foundation/foundationSamples.js';
|
|
13
|
-
import 'react';
|
|
14
18
|
import { AppShell } from './shell/AppShell.js';
|
|
15
19
|
import { FullPageShell } from './shell/FullPageShell.js';
|
|
16
20
|
import { Topbar } from './shell/Topbar.js';
|
|
@@ -57,7 +61,11 @@ import { LayoutModeSwitcher } from './shell/LayoutModeSwitcher.js';
|
|
|
57
61
|
[componentRegistryKey(defaultBlueprintName, ComponentName.EmptyState)]: EmptyState,
|
|
58
62
|
[componentRegistryKey(defaultBlueprintName, ComponentName.StatCard)]: StatCard,
|
|
59
63
|
[componentRegistryKey(defaultBlueprintName, ComponentName.TrendChip)]: TrendChip,
|
|
60
|
-
[componentRegistryKey(defaultBlueprintName, ComponentName.StatusChip)]: StatusChip
|
|
64
|
+
[componentRegistryKey(defaultBlueprintName, ComponentName.StatusChip)]: StatusChip,
|
|
65
|
+
[componentRegistryKey(defaultBlueprintName, ComponentName.ChartWrapper)]: ChartWrapper,
|
|
66
|
+
[componentRegistryKey(defaultBlueprintName, ComponentName.FilterBuilder)]: FilterBuilder,
|
|
67
|
+
[componentRegistryKey(defaultBlueprintName, ComponentName.ColumnChooser)]: ColumnChooser,
|
|
68
|
+
[componentRegistryKey(defaultBlueprintName, ComponentName.SavedViewsMenu)]: SavedViewsMenu
|
|
61
69
|
};
|
|
62
70
|
|
|
63
71
|
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 { EmptyState, 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};\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"],"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 { 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAyBA;;;;;;;UAQaA,0BAAAA,GAAgD;AACzD,IAAA,CAACC,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcC,QAAQ,IAAIA,QAAAA;AACtE,IAAA,CAACH,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcE,aAAa,IAAIA,aAAAA;AAC3E,IAAA,CAACJ,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcG,MAAM,IAAIA,MAAAA;AACpE,IAAA,CAACL,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcI,OAAO,IAAIA,OAAAA;AACrE,IAAA,CAACN,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcK,IAAI,IAAIA,IAAAA;AAClE,IAAA,CAACP,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcM,QAAQ,IAAIA,QAAAA;AACtE,IAAA,CAACR,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcO,UAAU,IAAIA,UAAAA;AACxE,IAAA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AA,CAACvB,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcsB,aAAa,IAAIA,aAAAA;AAC3E,IAAA,CAACxB,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcuB,aAAa,IAAIA,aAAAA;AAC3E,IAAA,CAACzB,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcwB,cAAc,IAAIA;AAChF;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { RegisteredComponentProps } from '@cratis/scene.react';
|
|
2
|
+
import { ChartKind } from './chartGeometry';
|
|
3
|
+
export declare function readChartKind(value: unknown): ChartKind;
|
|
4
|
+
export declare function ChartWrapper({ element, interactions }: RegisteredComponentProps): import("react").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=ChartWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartWrapper.d.ts","sourceRoot":"","sources":["../../../foundation/ChartWrapper.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAwF,MAAM,iBAAiB,CAAC;AAQlI,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAEvD;AA+KD,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,wBAAwB,+BA4D/E"}
|