@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,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var scene_engine = require('@cratis/scene.engine');
|
|
5
|
+
var FlowArrangementView = require('./FlowArrangementView.js');
|
|
6
|
+
var useSizeClass = require('./useSizeClass.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
|
+
/** The name the template wrapper is registered under. */ const previewTemplateComponent = 'Scene:template';
|
|
11
|
+
function isFlowArrangement(arrangement) {
|
|
12
|
+
return !!arrangement && typeof arrangement === 'object' && 'root' in arrangement;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A screen's content inside the screen template it names.
|
|
16
|
+
*
|
|
17
|
+
* The template's own `arrangement flow` positions its slots - header, body, aside - exactly as the document wrote it, evaluated
|
|
18
|
+
* for the window's current size class. A template with no flow arrangement stacks them. It sits inside the shell's content
|
|
19
|
+
* slot, so the shell, not this, owns the chrome around it. Stage and the preview host render templates with this one component.
|
|
20
|
+
*/ function PreviewTemplate({ element, slots }) {
|
|
21
|
+
const sizeClass = useSizeClass.useSizeClass();
|
|
22
|
+
const arrangement = element.properties?.arrangement;
|
|
23
|
+
const nodes = {};
|
|
24
|
+
for (const [name, content] of Object.entries(slots)){
|
|
25
|
+
nodes[name] = /*#__PURE__*/ jsxRuntime.jsx("section", {
|
|
26
|
+
className: "scene-template-slot",
|
|
27
|
+
"data-slot": name,
|
|
28
|
+
children: content
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
32
|
+
className: "scene-template",
|
|
33
|
+
"data-scene-id": element.id,
|
|
34
|
+
children: isFlowArrangement(arrangement) ? /*#__PURE__*/ jsxRuntime.jsx(FlowArrangementView.FlowArrangementView, {
|
|
35
|
+
node: scene_engine.evaluateFlowArrangement(arrangement, sizeClass),
|
|
36
|
+
slots: nodes
|
|
37
|
+
}) : Object.entries(nodes).map(([name, node])=>/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
38
|
+
children: node
|
|
39
|
+
}, name))
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/** The components the preview host and the Stage add to the registry for composed screens. */ const previewComponents = {
|
|
43
|
+
[previewTemplateComponent]: PreviewTemplate
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
exports.PreviewTemplate = PreviewTemplate;
|
|
47
|
+
exports.previewComponents = previewComponents;
|
|
48
|
+
exports.previewTemplateComponent = previewTemplateComponent;
|
|
49
|
+
//# sourceMappingURL=PreviewTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreviewTemplate.js","sources":["../../../preview-host/PreviewTemplate.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 type { ReactNode } from 'react';\nimport type { FlowArrangement } from '@cratis/scene.model';\nimport { evaluateFlowArrangement } from '@cratis/scene.engine';\nimport type { ComponentRegistry, RegisteredComponentProps } from '@cratis/scene.react';\nimport { FlowArrangementView } from './FlowArrangementView';\nimport { useSizeClass } from './useSizeClass';\n\n/** The name the template wrapper is registered under. */\nexport const previewTemplateComponent = 'Scene:template';\n\nfunction isFlowArrangement(arrangement: unknown): arrangement is FlowArrangement {\n return !!arrangement && typeof arrangement === 'object' && 'root' in arrangement;\n}\n\n/**\n * A screen's content inside the screen template it names.\n *\n * The template's own `arrangement flow` positions its slots - header, body, aside - exactly as the document wrote it, evaluated\n * for the window's current size class. A template with no flow arrangement stacks them. It sits inside the shell's content\n * slot, so the shell, not this, owns the chrome around it. Stage and the preview host render templates with this one component.\n */\nexport function PreviewTemplate({ element, slots }: RegisteredComponentProps) {\n const sizeClass = useSizeClass();\n const arrangement = (element.properties as Record<string, unknown> | undefined)?.arrangement;\n const nodes: Record<string, ReactNode> = {};\n for (const [name, content] of Object.entries(slots)) {\n nodes[name] = <section className='scene-template-slot' data-slot={name}>{content}</section>;\n }\n\n return (\n <div className='scene-template' data-scene-id={element.id}>\n {isFlowArrangement(arrangement)\n ? <FlowArrangementView node={evaluateFlowArrangement(arrangement, sizeClass)} slots={nodes} />\n : Object.entries(nodes).map(([name, node]) => <div key={name}>{node}</div>)}\n </div>\n );\n}\n\n/** The components the preview host and the Stage add to the registry for composed screens. */\nexport const previewComponents: ComponentRegistry = {\n [previewTemplateComponent]: PreviewTemplate,\n};\n"],"names":["previewTemplateComponent","isFlowArrangement","arrangement","PreviewTemplate","element","slots","sizeClass","useSizeClass","properties","nodes","name","content","Object","entries","_jsx","section","className","data-slot","div","data-scene-id","id","FlowArrangementView","node","evaluateFlowArrangement","map","previewComponents"],"mappings":";;;;;;;AAAA;AACA;AASA,0DACO,MAAMA,wBAAAA,GAA2B;AAExC,SAASC,kBAAkBC,WAAoB,EAAA;AAC3C,IAAA,OAAO,CAAC,CAACA,WAAAA,IAAe,OAAOA,WAAAA,KAAgB,YAAY,MAAA,IAAUA,WAAAA;AACzE;AAEA;;;;;;AAMC,IACM,SAASC,eAAAA,CAAgB,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACxE,IAAA,MAAMC,SAAAA,GAAYC,yBAAAA,EAAAA;IAClB,MAAML,WAAAA,GAAeE,OAAAA,CAAQI,UAAU,EAA0CN,WAAAA;AACjF,IAAA,MAAMO,QAAmC,EAAC;IAC1C,KAAK,MAAM,CAACC,IAAAA,EAAMC,OAAAA,CAAQ,IAAIC,MAAAA,CAAOC,OAAO,CAACR,KAAAA,CAAAA,CAAQ;QACjDI,KAAK,CAACC,IAAAA,CAAK,iBAAGI,cAAA,CAACC,SAAAA,EAAAA;YAAQC,SAAAA,EAAU,qBAAA;YAAsBC,WAAAA,EAAWP,IAAAA;AAAOC,YAAAA,QAAAA,EAAAA;;AAC7E,IAAA;AAEA,IAAA,qBACIG,cAAA,CAACI,KAAAA,EAAAA;QAAIF,SAAAA,EAAU,gBAAA;AAAiBG,QAAAA,eAAAA,EAAef,QAAQgB,EAAE;AACpDnB,QAAAA,QAAAA,EAAAA,iBAAAA,CAAkBC,6BACbY,cAAA,CAACO,uCAAAA,EAAAA;AAAoBC,YAAAA,IAAAA,EAAMC,qCAAwBrB,WAAAA,EAAaI,SAAAA,CAAAA;YAAYD,KAAAA,EAAOI;aACnFG,MAAAA,CAAOC,OAAO,CAACJ,KAAAA,CAAAA,CAAOe,GAAG,CAAC,CAAC,CAACd,IAAAA,EAAMY,IAAAA,CAAK,iBAAKR,cAAA,CAACI,KAAAA,EAAAA;AAAgBI,gBAAAA,QAAAA,EAAAA;AAAPZ,aAAAA,EAAAA,IAAAA,CAAAA;;AAGxE;AAEA,+FACO,MAAMe,iBAAAA,GAAuC;AAChD,IAAA,CAACzB,2BAA2BG;AAChC;;;;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
|
|
5
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
6
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
7
|
+
/**
|
|
8
|
+
* The toast that confirms a dry run: "Command would be sent", with the payload in an expandable detail. Nothing was sent to
|
|
9
|
+
* Chronicle or Arc.
|
|
10
|
+
*/ function PreviewToast({ invocation, onDismiss }) {
|
|
11
|
+
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
12
|
+
className: "scene-preview-toast",
|
|
13
|
+
role: "status",
|
|
14
|
+
"data-scene-preview-toast": true,
|
|
15
|
+
children: [
|
|
16
|
+
/*#__PURE__*/ jsxRuntime.jsx("strong", {
|
|
17
|
+
children: "Command would be sent"
|
|
18
|
+
}),
|
|
19
|
+
/*#__PURE__*/ jsxRuntime.jsxs("span", {
|
|
20
|
+
children: [
|
|
21
|
+
" · ",
|
|
22
|
+
invocation.command ?? invocation.sliceId
|
|
23
|
+
]
|
|
24
|
+
}),
|
|
25
|
+
/*#__PURE__*/ jsxRuntime.jsxs("details", {
|
|
26
|
+
children: [
|
|
27
|
+
/*#__PURE__*/ jsxRuntime.jsx("summary", {
|
|
28
|
+
children: "Payload"
|
|
29
|
+
}),
|
|
30
|
+
/*#__PURE__*/ jsxRuntime.jsx("pre", {
|
|
31
|
+
children: JSON.stringify(invocation.payload, null, 2)
|
|
32
|
+
})
|
|
33
|
+
]
|
|
34
|
+
}),
|
|
35
|
+
/*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
36
|
+
type: "button",
|
|
37
|
+
onClick: onDismiss,
|
|
38
|
+
children: "Dismiss"
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
exports.PreviewToast = PreviewToast;
|
|
45
|
+
//# sourceMappingURL=PreviewToast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreviewToast.js","sources":["../../../preview-host/PreviewToast.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\n/** What a dry run reports (PRV5). */\nexport interface PreviewInvocation {\n /** The qualified id of the slice. */\n sliceId: string;\n\n /** The command the slice accepts, when known. */\n command?: string;\n\n /** The payload that would have been sent. */\n payload: Record<string, unknown>;\n}\n\n/**\n * The toast that confirms a dry run: \"Command would be sent\", with the payload in an expandable detail. Nothing was sent to\n * Chronicle or Arc.\n */\nexport function PreviewToast({ invocation, onDismiss }: { invocation: PreviewInvocation; onDismiss(): void }) {\n return (\n <div className='scene-preview-toast' role='status' data-scene-preview-toast>\n <strong>Command would be sent</strong>\n <span> · {invocation.command ?? invocation.sliceId}</span>\n <details>\n <summary>Payload</summary>\n <pre>{JSON.stringify(invocation.payload, null, 2)}</pre>\n </details>\n <button type='button' onClick={onDismiss}>Dismiss</button>\n </div>\n );\n}\n"],"names":["PreviewToast","invocation","onDismiss","_jsxs","div","className","role","data-scene-preview-toast","_jsx","strong","span","command","sliceId","details","summary","pre","JSON","stringify","payload","button","type","onClick"],"mappings":";;;;AAAA;AACA;AAcA;;;AAGC,IACM,SAASA,YAAAA,CAAa,EAAEC,UAAU,EAAEC,SAAS,EAAwD,EAAA;AACxG,IAAA,qBACIC,eAAA,CAACC,KAAAA,EAAAA;QAAIC,SAAAA,EAAU,qBAAA;QAAsBC,IAAAA,EAAK,QAAA;QAASC,0BAAwB,EAAA,IAAA;;0BACvEC,cAAA,CAACC,QAAAA,EAAAA;AAAO,gBAAA,QAAA,EAAA;;0BACRN,eAAA,CAACO,MAAAA,EAAAA;;AAAK,oBAAA,KAAA;oBAAIT,UAAAA,CAAWU,OAAO,IAAIV,UAAAA,CAAWW;;;0BAC3CT,eAAA,CAACU,SAAAA,EAAAA;;kCACGL,cAAA,CAACM,SAAAA,EAAAA;AAAQ,wBAAA,QAAA,EAAA;;kCACTN,cAAA,CAACO,KAAAA,EAAAA;AAAKC,wBAAAA,QAAAA,EAAAA,IAAAA,CAAKC,SAAS,CAAChB,UAAAA,CAAWiB,OAAO,EAAE,IAAA,EAAM,CAAA;;;;0BAEnDV,cAAA,CAACW,QAAAA,EAAAA;gBAAOC,IAAAA,EAAK,QAAA;gBAASC,OAAAA,EAASnB,SAAAA;AAAW,gBAAA,QAAA,EAAA;;;;AAGtD;;"}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
var scene_model = require('@cratis/scene.model');
|
|
6
|
+
var scene_engine = require('@cratis/scene.engine');
|
|
7
|
+
var scene_react = require('@cratis/scene.react');
|
|
8
|
+
var ComponentName = require('../ComponentName.js');
|
|
9
|
+
var elements = require('../gallery/elements.js');
|
|
10
|
+
var SlotName = require('../layouts/SlotName.js');
|
|
11
|
+
var LayoutName = require('../layouts/LayoutName.js');
|
|
12
|
+
require('../layouts/shellComponents.js');
|
|
13
|
+
require('../layouts/appShell.js');
|
|
14
|
+
require('../layouts/fullPage.js');
|
|
15
|
+
var previewProfile = require('./previewProfile.js');
|
|
16
|
+
var ApplicationHost = require('./ApplicationHost.js');
|
|
17
|
+
var diagnosePreview = require('./diagnosePreview.js');
|
|
18
|
+
var PreviewProblem = require('./PreviewProblem.js');
|
|
19
|
+
var PreviewProblemsView = require('./PreviewProblemsView.js');
|
|
20
|
+
var previewSampleData = require('./previewSampleData.js');
|
|
21
|
+
var PreviewSliceFragment = require('./PreviewSliceFragment.js');
|
|
22
|
+
var PreviewToast = require('./PreviewToast.js');
|
|
23
|
+
|
|
24
|
+
const previewPageScreen = '#preview-page';
|
|
25
|
+
const noNavigation = {
|
|
26
|
+
application: {
|
|
27
|
+
regions: []
|
|
28
|
+
},
|
|
29
|
+
modules: []
|
|
30
|
+
};
|
|
31
|
+
/** The page a slice preview happens over when its feature has no screen of its own, or a State View's fragment is shown. */ function minimalPage(layout, content) {
|
|
32
|
+
return {
|
|
33
|
+
name: previewPageScreen,
|
|
34
|
+
layout,
|
|
35
|
+
slotContent: {
|
|
36
|
+
[SlotName.SlotName.Content]: content
|
|
37
|
+
},
|
|
38
|
+
forms: [],
|
|
39
|
+
contributions: []
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Renders the effective application (spec 10, PRV1-PRV9) from an in-memory document: the real shell, its navigation regions, the
|
|
44
|
+
* first feature of a module, a feature, or a slice - a State Change slice as its task dialog over a minimal host page, a State View
|
|
45
|
+
* slice as its data fragment.
|
|
46
|
+
*
|
|
47
|
+
* - **One code path**: the composition and the host are the Stage's own (`composeApplicationScreen`, `ApplicationHost`); nothing
|
|
48
|
+
* here draws a shell, a menu or a dialog (PRV9).
|
|
49
|
+
* - **Read-only**: no design affordances, no edits (PRV8) - a toolbar button without a slice shows no warning badge here; it is
|
|
50
|
+
* reported as a problem instead. A model that cannot render - an unknown target, a feature without a screen,
|
|
51
|
+
* a layout or template nobody provides - gives a {@link PreviewProblemsView} and `onProblems`, not a blank screen.
|
|
52
|
+
* - **Navigation** keeps to an in-memory history; a different module swaps the shell's effective navigation (PRV4).
|
|
53
|
+
* - **Dialogs** submit through the dry-run invoker unless one is given: validation runs, nothing is sent, a toast says so (PRV5).
|
|
54
|
+
* - **Data** is the active sample data pack's (PRV6); the same seed shows the same rows.
|
|
55
|
+
* - The strip (`Previewing`, sample data, `Exit preview · Esc`) is the host application's: this reports the breadcrumb and calls
|
|
56
|
+
* `onExit` on Escape.
|
|
57
|
+
*/ function ScenePreviewHost({ document: application, structure, navigation = noNavigation, target, sampleData, registry, invoker, onInvoked, fieldsFor, composition = {}, theme, isVisible, history, onProblems, onSelectProblem, onBreadcrumbChange, onExit, children }) {
|
|
58
|
+
const index = react.useMemo(()=>structure instanceof scene_engine.ApplicationStructureIndex ? structure : new scene_engine.ApplicationStructureIndex(structure), [
|
|
59
|
+
structure
|
|
60
|
+
]);
|
|
61
|
+
const compose = react.useMemo(()=>({
|
|
62
|
+
logo: navigation.application.logo,
|
|
63
|
+
...composition
|
|
64
|
+
}), [
|
|
65
|
+
composition,
|
|
66
|
+
navigation.application.logo
|
|
67
|
+
]);
|
|
68
|
+
const diagnosis = react.useMemo(()=>diagnosePreview.diagnosePreview({
|
|
69
|
+
document: application,
|
|
70
|
+
structure: index,
|
|
71
|
+
navigation,
|
|
72
|
+
target,
|
|
73
|
+
packs: sampleData?.packs,
|
|
74
|
+
composition: compose
|
|
75
|
+
}), [
|
|
76
|
+
application,
|
|
77
|
+
compose,
|
|
78
|
+
index,
|
|
79
|
+
navigation,
|
|
80
|
+
sampleData?.packs,
|
|
81
|
+
target
|
|
82
|
+
]);
|
|
83
|
+
const problems = react.useMemo(()=>{
|
|
84
|
+
const found = [
|
|
85
|
+
...diagnosis.problems
|
|
86
|
+
];
|
|
87
|
+
const { plan, screen } = diagnosis;
|
|
88
|
+
if (plan?.kind === 'stateView' && screen && plan.slice) {
|
|
89
|
+
const slice = index.findSlice(plan.slice);
|
|
90
|
+
if (slice && PreviewSliceFragment.findSliceFragment(screen, plan.slice, slice).length === 0) {
|
|
91
|
+
found.push({
|
|
92
|
+
code: PreviewProblem.PreviewProblemCode.SliceFragmentMissing,
|
|
93
|
+
severity: PreviewProblem.PreviewProblemSeverity.Warning,
|
|
94
|
+
message: `Nothing on the screen '${screen.name}' is bound to the State View '${plan.slice}', so its page is shown.`,
|
|
95
|
+
nodeId: plan.slice
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return found;
|
|
100
|
+
}, [
|
|
101
|
+
diagnosis,
|
|
102
|
+
index
|
|
103
|
+
]);
|
|
104
|
+
const key = JSON.stringify(problems);
|
|
105
|
+
const reported = react.useRef(undefined);
|
|
106
|
+
react.useEffect(()=>{
|
|
107
|
+
if (reported.current === key) return;
|
|
108
|
+
reported.current = key;
|
|
109
|
+
onProblems?.(problems);
|
|
110
|
+
}, [
|
|
111
|
+
key,
|
|
112
|
+
onProblems,
|
|
113
|
+
problems
|
|
114
|
+
]);
|
|
115
|
+
const breadcrumb = diagnosis.plan?.breadcrumb;
|
|
116
|
+
const breadcrumbKey = breadcrumb?.join('\u0000');
|
|
117
|
+
react.useEffect(()=>{
|
|
118
|
+
if (breadcrumb) onBreadcrumbChange?.(breadcrumb);
|
|
119
|
+
// `breadcrumbKey` is the value of `breadcrumb`.
|
|
120
|
+
}, [
|
|
121
|
+
breadcrumbKey,
|
|
122
|
+
onBreadcrumbChange
|
|
123
|
+
]);
|
|
124
|
+
const [memoryHistory] = react.useState(()=>scene_react.createMemorySceneHistory());
|
|
125
|
+
const [toast, setToast] = react.useState();
|
|
126
|
+
const dryRun = react.useMemo(()=>scene_react.createDryRunInvoker({
|
|
127
|
+
onInvoked: (invocation)=>{
|
|
128
|
+
setToast(invocation);
|
|
129
|
+
onInvoked?.(invocation);
|
|
130
|
+
}
|
|
131
|
+
}), [
|
|
132
|
+
onInvoked
|
|
133
|
+
]);
|
|
134
|
+
const samples = react.useMemo(()=>previewSampleData.createPreviewSampleData(application, sampleData), [
|
|
135
|
+
application,
|
|
136
|
+
sampleData
|
|
137
|
+
]);
|
|
138
|
+
const fields = react.useMemo(()=>(command, slice)=>samples.commandFields(command, fieldsFor?.(command, slice) ?? []), [
|
|
139
|
+
fieldsFor,
|
|
140
|
+
samples
|
|
141
|
+
]);
|
|
142
|
+
const page = react.useMemo(()=>{
|
|
143
|
+
const { plan, screen } = diagnosis;
|
|
144
|
+
if (!plan) return undefined;
|
|
145
|
+
if (!screen) {
|
|
146
|
+
// A slice whose feature has no screen of its own: a minimal host page, headed with where it is.
|
|
147
|
+
if (plan.slice === undefined) return undefined;
|
|
148
|
+
const layout = previewProfile.previewProfile(application.uiProfiles).layout ?? LayoutName.LayoutName.AppShell;
|
|
149
|
+
const header = elements.externalComponent('preview-page-header', ComponentName.ComponentName.PageHeader, {
|
|
150
|
+
title: plan.breadcrumb.slice(0, -1).join(' › ') || plan.breadcrumb[0]
|
|
151
|
+
});
|
|
152
|
+
return {
|
|
153
|
+
screens: [
|
|
154
|
+
...application.screens,
|
|
155
|
+
minimalPage(layout, [
|
|
156
|
+
header
|
|
157
|
+
])
|
|
158
|
+
],
|
|
159
|
+
initial: previewPageScreen
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
if (plan.kind === 'stateView' && plan.slice) {
|
|
163
|
+
const slice = index.findSlice(plan.slice);
|
|
164
|
+
const fragment = slice ? PreviewSliceFragment.findSliceFragment(screen, plan.slice, slice) : [];
|
|
165
|
+
if (fragment.length > 0) return {
|
|
166
|
+
screens: [
|
|
167
|
+
...application.screens,
|
|
168
|
+
minimalPage(screen.layout, fragment)
|
|
169
|
+
],
|
|
170
|
+
initial: previewPageScreen
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
screens: application.screens,
|
|
175
|
+
initial: screen.name
|
|
176
|
+
};
|
|
177
|
+
}, [
|
|
178
|
+
application.screens,
|
|
179
|
+
application.uiProfiles,
|
|
180
|
+
diagnosis,
|
|
181
|
+
index
|
|
182
|
+
]);
|
|
183
|
+
const hostApplication = react.useMemo(()=>page ? {
|
|
184
|
+
...application,
|
|
185
|
+
screens: page.screens
|
|
186
|
+
} : application, [
|
|
187
|
+
application,
|
|
188
|
+
page
|
|
189
|
+
]);
|
|
190
|
+
const navigationModel = react.useMemo(()=>({
|
|
191
|
+
structure: index,
|
|
192
|
+
navigation,
|
|
193
|
+
isVisible
|
|
194
|
+
}), [
|
|
195
|
+
index,
|
|
196
|
+
isVisible,
|
|
197
|
+
navigation
|
|
198
|
+
]);
|
|
199
|
+
const onKeyDown = react.useCallback((event)=>{
|
|
200
|
+
if (event.key === 'Escape' && !event.defaultPrevented) onExit?.();
|
|
201
|
+
}, [
|
|
202
|
+
onExit
|
|
203
|
+
]);
|
|
204
|
+
if (PreviewProblem.hasBlockingProblem(problems) || !page) {
|
|
205
|
+
return /*#__PURE__*/ jsxRuntime.jsx(PreviewProblemsView.PreviewProblemsView, {
|
|
206
|
+
problems: problems.filter((problem)=>problem.severity === PreviewProblem.PreviewProblemSeverity.Error),
|
|
207
|
+
onSelectProblem: onSelectProblem
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
const body = /*#__PURE__*/ jsxRuntime.jsx(scene_react.SliceInvokerProvider, {
|
|
211
|
+
invoker: invoker ?? dryRun,
|
|
212
|
+
warnEmptySlices: false,
|
|
213
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(scene_react.SliceCommandFieldsProvider, {
|
|
214
|
+
fieldsFor: fields,
|
|
215
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
216
|
+
className: "scene-preview-host",
|
|
217
|
+
"data-scene-preview": diagnosis.plan?.kind,
|
|
218
|
+
"data-preview-breadcrumb": breadcrumb?.join(' › '),
|
|
219
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(ApplicationHost.ApplicationHost, {
|
|
220
|
+
application: hostApplication,
|
|
221
|
+
composition: compose,
|
|
222
|
+
navigationModel: navigationModel,
|
|
223
|
+
registry: registry,
|
|
224
|
+
initialScreen: page.initial,
|
|
225
|
+
history: history ?? memoryHistory,
|
|
226
|
+
resolveBinding: samples.resolveBinding,
|
|
227
|
+
queryResults: samples.queryResults,
|
|
228
|
+
children: [
|
|
229
|
+
diagnosis.plan?.kind === 'stateChange' && /*#__PURE__*/ jsxRuntime.jsx(OpenSliceDialog, {
|
|
230
|
+
index: index,
|
|
231
|
+
plan: diagnosis.plan
|
|
232
|
+
}),
|
|
233
|
+
/*#__PURE__*/ jsxRuntime.jsx(EscapeToExit, {
|
|
234
|
+
onKeyDown: onKeyDown,
|
|
235
|
+
enabled: onExit !== undefined
|
|
236
|
+
}),
|
|
237
|
+
toast && invoker === undefined && /*#__PURE__*/ jsxRuntime.jsx(PreviewToast.PreviewToast, {
|
|
238
|
+
invocation: toast,
|
|
239
|
+
onDismiss: ()=>setToast(undefined)
|
|
240
|
+
}),
|
|
241
|
+
children
|
|
242
|
+
]
|
|
243
|
+
})
|
|
244
|
+
})
|
|
245
|
+
})
|
|
246
|
+
});
|
|
247
|
+
return theme ? /*#__PURE__*/ jsxRuntime.jsx(scene_react.SceneThemeProvider, {
|
|
248
|
+
theme: theme,
|
|
249
|
+
children: body
|
|
250
|
+
}) : body;
|
|
251
|
+
}
|
|
252
|
+
/** Opens the task dialog of a State Change slice once the page is up - the slice preview (PRV3). */ function OpenSliceDialog({ index, plan }) {
|
|
253
|
+
const navigation = scene_react.useSceneNavigation();
|
|
254
|
+
const opened = react.useRef(false);
|
|
255
|
+
react.useEffect(()=>{
|
|
256
|
+
if (opened.current || plan.slice === undefined) return;
|
|
257
|
+
const slice = index.findSlice(plan.slice);
|
|
258
|
+
if (!slice || slice.kind !== scene_model.SliceKind.StateChange) return;
|
|
259
|
+
const destination = scene_react.sliceDialogDestination(scene_engine.resolveToolbarButton(index, {
|
|
260
|
+
id: plan.slice,
|
|
261
|
+
title: slice.name,
|
|
262
|
+
slice: plan.slice
|
|
263
|
+
}));
|
|
264
|
+
if (destination === undefined) return;
|
|
265
|
+
opened.current = true;
|
|
266
|
+
navigation.navigate(destination);
|
|
267
|
+
}, [
|
|
268
|
+
index,
|
|
269
|
+
navigation,
|
|
270
|
+
plan.slice
|
|
271
|
+
]);
|
|
272
|
+
return null;
|
|
273
|
+
}
|
|
274
|
+
/** Exits the preview on Escape, unless something - an open dialog - already used the key. */ function EscapeToExit({ onKeyDown, enabled }) {
|
|
275
|
+
const navigation = scene_react.useSceneNavigation();
|
|
276
|
+
const dialogOpen = navigation.currentDialog !== undefined;
|
|
277
|
+
react.useEffect(()=>{
|
|
278
|
+
if (!enabled || dialogOpen) return undefined;
|
|
279
|
+
globalThis.addEventListener('keydown', onKeyDown);
|
|
280
|
+
return ()=>globalThis.removeEventListener('keydown', onKeyDown);
|
|
281
|
+
}, [
|
|
282
|
+
dialogOpen,
|
|
283
|
+
enabled,
|
|
284
|
+
onKeyDown
|
|
285
|
+
]);
|
|
286
|
+
return null;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
exports.ScenePreviewHost = ScenePreviewHost;
|
|
290
|
+
//# sourceMappingURL=ScenePreviewHost.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScenePreviewHost.js","sources":["../../../preview-host/ScenePreviewHost.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 { ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { ApplicationStructure, NavigationModel, Screen, SliceKind, Theme } from '@cratis/scene.model';\nimport { ApplicationStructureIndex, EffectiveNavItem, resolveToolbarButton } from '@cratis/scene.engine';\nimport {\n ComponentRegistry, SceneHistory, SceneThemeProvider, SliceCommandFieldsProvider, SliceCommandFieldsSource, SliceInvoker,\n SliceInvokerProvider, createDryRunInvoker, createMemorySceneHistory, sliceDialogDestination, useSceneNavigation,\n} from '@cratis/scene.react';\nimport { ComponentName } from '../ComponentName';\nimport { externalComponent } from '../gallery/elements';\nimport { LayoutName, SlotName } from '../layouts';\nimport { previewProfile } from './previewProfile';\nimport { ApplicationDocument } from './ApplicationDocument';\nimport { ApplicationHost } from './ApplicationHost';\nimport { CompositionOptions } from './composeApplication';\nimport { diagnosePreview } from './diagnosePreview';\nimport { PreviewProblem, PreviewProblemCode, PreviewProblemSeverity, hasBlockingProblem } from './PreviewProblem';\nimport { PreviewProblemsView } from './PreviewProblemsView';\nimport { PreviewSampleData, createPreviewSampleData } from './previewSampleData';\nimport { findSliceFragment } from './PreviewSliceFragment';\nimport { PreviewTarget } from './PreviewTarget';\nimport { PreviewInvocation, PreviewToast } from './PreviewToast';\nimport { PreviewPlan } from './resolvePreviewPlan';\n\nexport interface ScenePreviewHostProps {\n /** The document to preview - the in-memory one, unsaved edits included. */\n document: ApplicationDocument;\n\n /** The modules, features and slices of the application. */\n structure: ApplicationStructure | ApplicationStructureIndex;\n\n /** The application and module navigation regions; none when absent. */\n navigation?: NavigationModel;\n\n /** What to preview: a module, a feature or a slice. */\n target: PreviewTarget;\n\n /** The sample data to preview with; none when absent. */\n sampleData?: PreviewSampleData;\n\n /** The components to draw with. */\n registry: ComponentRegistry;\n\n /** What a submitted slice dialog goes through; a dry run, which only validates and reports, when absent (PRV5). */\n invoker?: SliceInvoker;\n\n /** Called for every dry run that passes validation, with what would have been sent. */\n onInvoked?(invocation: PreviewInvocation): void;\n\n /** The fields of a command, for the slice dialogs; the preview's sample rows fill their starting values. */\n fieldsFor?: SliceCommandFieldsSource;\n\n /** What the host decides about composition, such as the packages names resolve against. */\n composition?: CompositionOptions;\n\n /** The theme to apply; Studio passes the application's selected one (PRV9). */\n theme?: Theme;\n\n /** Hides a navigation item the preview user is not allowed to see. */\n isVisible?(item: EffectiveNavItem): boolean;\n\n /** Keeps the preview's navigation; an in-memory history by default, so a preview never touches the host's address (PRV4). */\n history?: SceneHistory;\n\n /** Called with the problems found - blocking or not - whenever they change (PRV8). */\n onProblems?(problems: PreviewProblem[]): void;\n\n /** Called when the author follows a problem to its node. */\n onSelectProblem?(problem: PreviewProblem): void;\n\n /** Called with what is being previewed, `Sales`, `Orders`, ... - the strip's breadcrumb (PRV7). */\n onBreadcrumbChange?(breadcrumb: string[]): void;\n\n /** Called when Escape is pressed with no dialog open: the host exits the preview (PRV7). */\n onExit?(): void;\n\n /** Extra content inside the host, such as a design layer's strip. */\n children?: ReactNode;\n}\n\nconst previewPageScreen = '#preview-page';\nconst noNavigation: NavigationModel = { application: { regions: [] }, modules: [] };\n\n/** The page a slice preview happens over when its feature has no screen of its own, or a State View's fragment is shown. */\nfunction minimalPage(layout: string, content: Screen['slotContent'][string]): Screen {\n return {\n name: previewPageScreen,\n layout,\n slotContent: { [SlotName.Content]: content },\n forms: [],\n contributions: [],\n };\n}\n\n/**\n * Renders the effective application (spec 10, PRV1-PRV9) from an in-memory document: the real shell, its navigation regions, the\n * first feature of a module, a feature, or a slice - a State Change slice as its task dialog over a minimal host page, a State View\n * slice as its data fragment.\n *\n * - **One code path**: the composition and the host are the Stage's own (`composeApplicationScreen`, `ApplicationHost`); nothing\n * here draws a shell, a menu or a dialog (PRV9).\n * - **Read-only**: no design affordances, no edits (PRV8) - a toolbar button without a slice shows no warning badge here; it is\n * reported as a problem instead. A model that cannot render - an unknown target, a feature without a screen,\n * a layout or template nobody provides - gives a {@link PreviewProblemsView} and `onProblems`, not a blank screen.\n * - **Navigation** keeps to an in-memory history; a different module swaps the shell's effective navigation (PRV4).\n * - **Dialogs** submit through the dry-run invoker unless one is given: validation runs, nothing is sent, a toast says so (PRV5).\n * - **Data** is the active sample data pack's (PRV6); the same seed shows the same rows.\n * - The strip (`Previewing`, sample data, `Exit preview · Esc`) is the host application's: this reports the breadcrumb and calls\n * `onExit` on Escape.\n */\nexport function ScenePreviewHost({\n document: application, structure, navigation = noNavigation, target, sampleData, registry, invoker, onInvoked, fieldsFor, composition = {},\n theme, isVisible, history, onProblems, onSelectProblem, onBreadcrumbChange, onExit, children,\n}: ScenePreviewHostProps) {\n const index = useMemo(() => structure instanceof ApplicationStructureIndex ? structure : new ApplicationStructureIndex(structure), [structure]);\n const compose = useMemo<CompositionOptions>(() => ({ logo: navigation.application.logo, ...composition }), [composition, navigation.application.logo]);\n const diagnosis = useMemo(\n () => diagnosePreview({ document: application, structure: index, navigation, target, packs: sampleData?.packs, composition: compose }),\n [application, compose, index, navigation, sampleData?.packs, target]);\n\n const problems = useMemo(() => {\n const found = [...diagnosis.problems];\n const { plan, screen } = diagnosis;\n if (plan?.kind === 'stateView' && screen && plan.slice) {\n const slice = index.findSlice(plan.slice);\n if (slice && findSliceFragment(screen, plan.slice, slice).length === 0) {\n found.push({ code: PreviewProblemCode.SliceFragmentMissing, severity: PreviewProblemSeverity.Warning, message: `Nothing on the screen '${screen.name}' is bound to the State View '${plan.slice}', so its page is shown.`, nodeId: plan.slice });\n }\n }\n\n return found;\n }, [diagnosis, index]);\n\n const key = JSON.stringify(problems);\n const reported = useRef<string | undefined>(undefined);\n useEffect(() => {\n if (reported.current === key) return;\n reported.current = key;\n onProblems?.(problems);\n }, [key, onProblems, problems]);\n\n const breadcrumb = diagnosis.plan?.breadcrumb;\n const breadcrumbKey = breadcrumb?.join('\\u0000');\n useEffect(() => {\n if (breadcrumb) onBreadcrumbChange?.(breadcrumb);\n // `breadcrumbKey` is the value of `breadcrumb`.\n }, [breadcrumbKey, onBreadcrumbChange]);\n\n const [memoryHistory] = useState(() => createMemorySceneHistory());\n const [toast, setToast] = useState<PreviewInvocation>();\n const dryRun = useMemo(() => createDryRunInvoker({\n onInvoked: invocation => {\n setToast(invocation);\n onInvoked?.(invocation);\n },\n }), [onInvoked]);\n\n const samples = useMemo(() => createPreviewSampleData(application, sampleData), [application, sampleData]);\n const fields = useMemo<SliceCommandFieldsSource>(() => (command, slice) => samples.commandFields(command, fieldsFor?.(command, slice) ?? []), [fieldsFor, samples]);\n\n const page = useMemo(() => {\n const { plan, screen } = diagnosis;\n if (!plan) return undefined;\n\n if (!screen) {\n // A slice whose feature has no screen of its own: a minimal host page, headed with where it is.\n if (plan.slice === undefined) return undefined;\n const layout = previewProfile(application.uiProfiles).layout ?? LayoutName.AppShell;\n const header = externalComponent('preview-page-header', ComponentName.PageHeader, { title: plan.breadcrumb.slice(0, -1).join(' › ') || plan.breadcrumb[0] });\n return { screens: [...application.screens, minimalPage(layout, [header])], initial: previewPageScreen };\n }\n\n if (plan.kind === 'stateView' && plan.slice) {\n const slice = index.findSlice(plan.slice);\n const fragment = slice ? findSliceFragment(screen, plan.slice, slice) : [];\n if (fragment.length > 0) return { screens: [...application.screens, minimalPage(screen.layout, fragment)], initial: previewPageScreen };\n }\n\n return { screens: application.screens, initial: screen.name };\n }, [application.screens, application.uiProfiles, diagnosis, index]);\n\n const hostApplication = useMemo(() => page ? { ...application, screens: page.screens } : application, [application, page]);\n const navigationModel = useMemo(() => ({ structure: index, navigation, isVisible }), [index, isVisible, navigation]);\n\n const onKeyDown = useCallback((event: KeyboardEvent) => {\n if (event.key === 'Escape' && !event.defaultPrevented) onExit?.();\n }, [onExit]);\n\n if (hasBlockingProblem(problems) || !page) {\n return <PreviewProblemsView problems={problems.filter(problem => problem.severity === PreviewProblemSeverity.Error)} onSelectProblem={onSelectProblem} />;\n }\n\n const body = (\n <SliceInvokerProvider invoker={invoker ?? dryRun} warnEmptySlices={false}>\n <SliceCommandFieldsProvider fieldsFor={fields}>\n <div className='scene-preview-host' data-scene-preview={diagnosis.plan?.kind} data-preview-breadcrumb={breadcrumb?.join(' › ')}>\n <ApplicationHost\n application={hostApplication}\n composition={compose}\n navigationModel={navigationModel}\n registry={registry}\n initialScreen={page.initial}\n history={history ?? memoryHistory}\n resolveBinding={samples.resolveBinding}\n queryResults={samples.queryResults}>\n {diagnosis.plan?.kind === 'stateChange' && <OpenSliceDialog index={index} plan={diagnosis.plan} />}\n <EscapeToExit onKeyDown={onKeyDown} enabled={onExit !== undefined} />\n {toast && invoker === undefined && <PreviewToast invocation={toast} onDismiss={() => setToast(undefined)} />}\n {children}\n </ApplicationHost>\n </div>\n </SliceCommandFieldsProvider>\n </SliceInvokerProvider>\n );\n\n return theme ? <SceneThemeProvider theme={theme}>{body}</SceneThemeProvider> : body;\n}\n\n/** Opens the task dialog of a State Change slice once the page is up - the slice preview (PRV3). */\nfunction OpenSliceDialog({ index, plan }: { index: ApplicationStructureIndex; plan: PreviewPlan }) {\n const navigation = useSceneNavigation();\n const opened = useRef(false);\n useEffect(() => {\n if (opened.current || plan.slice === undefined) return;\n const slice = index.findSlice(plan.slice);\n if (!slice || slice.kind !== SliceKind.StateChange) return;\n\n const destination = sliceDialogDestination(resolveToolbarButton(index, { id: plan.slice, title: slice.name, slice: plan.slice }));\n if (destination === undefined) return;\n opened.current = true;\n navigation.navigate(destination);\n }, [index, navigation, plan.slice]);\n\n return null;\n}\n\n/** Exits the preview on Escape, unless something - an open dialog - already used the key. */\nfunction EscapeToExit({ onKeyDown, enabled }: { onKeyDown(event: KeyboardEvent): void; enabled: boolean }) {\n const navigation = useSceneNavigation();\n const dialogOpen = navigation.currentDialog !== undefined;\n useEffect(() => {\n if (!enabled || dialogOpen) return undefined;\n globalThis.addEventListener('keydown', onKeyDown);\n return () => globalThis.removeEventListener('keydown', onKeyDown);\n }, [dialogOpen, enabled, onKeyDown]);\n\n return null;\n}\n"],"names":["previewPageScreen","noNavigation","application","regions","modules","minimalPage","layout","content","name","slotContent","SlotName","Content","forms","contributions","ScenePreviewHost","document","structure","navigation","target","sampleData","registry","invoker","onInvoked","fieldsFor","composition","theme","isVisible","history","onProblems","onSelectProblem","onBreadcrumbChange","onExit","children","index","useMemo","ApplicationStructureIndex","compose","logo","diagnosis","diagnosePreview","packs","problems","found","plan","screen","kind","slice","findSlice","findSliceFragment","length","push","code","PreviewProblemCode","SliceFragmentMissing","severity","PreviewProblemSeverity","Warning","message","nodeId","key","JSON","stringify","reported","useRef","undefined","useEffect","current","breadcrumb","breadcrumbKey","join","memoryHistory","useState","createMemorySceneHistory","toast","setToast","dryRun","createDryRunInvoker","invocation","samples","createPreviewSampleData","fields","command","commandFields","page","previewProfile","uiProfiles","LayoutName","AppShell","header","externalComponent","ComponentName","PageHeader","title","screens","initial","fragment","hostApplication","navigationModel","onKeyDown","useCallback","event","defaultPrevented","hasBlockingProblem","_jsx","PreviewProblemsView","filter","problem","Error","body","SliceInvokerProvider","warnEmptySlices","SliceCommandFieldsProvider","div","className","data-scene-preview","data-preview-breadcrumb","_jsxs","ApplicationHost","initialScreen","resolveBinding","queryResults","OpenSliceDialog","EscapeToExit","enabled","PreviewToast","onDismiss","SceneThemeProvider","useSceneNavigation","opened","SliceKind","StateChange","destination","sliceDialogDestination","resolveToolbarButton","id","navigate","dialogOpen","currentDialog","globalThis","addEventListener","removeEventListener"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkFA,MAAMA,iBAAAA,GAAoB,eAAA;AAC1B,MAAMC,YAAAA,GAAgC;IAAEC,WAAAA,EAAa;AAAEC,QAAAA,OAAAA,EAAS;AAAG,KAAA;AAAGC,IAAAA,OAAAA,EAAS;AAAG,CAAA;AAElF,6HACA,SAASC,WAAAA,CAAYC,MAAc,EAAEC,OAAsC,EAAA;IACvE,OAAO;QACHC,IAAAA,EAAMR,iBAAAA;AACNM,QAAAA,MAAAA;QACAG,WAAAA,EAAa;YAAE,CAACC,iBAAAA,CAASC,OAAO,GAAGJ;AAAQ,SAAA;AAC3CK,QAAAA,KAAAA,EAAO,EAAE;AACTC,QAAAA,aAAAA,EAAe;AACnB,KAAA;AACJ;AAEA;;;;;;;;;;;;;;;AAeC,IACM,SAASC,gBAAAA,CAAiB,EAC7BC,QAAAA,EAAU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