@cratis/scene.engine 4.26.0 → 4.28.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/dist/cjs/editing/resolveEffectiveConfiguration.js +8 -0
- package/dist/cjs/editing/resolveEffectiveConfiguration.js.map +1 -1
- package/dist/cjs/index.js +38 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/navigation/NavigationDiagnosticCode.js +5 -0
- package/dist/cjs/navigation/NavigationDiagnosticCode.js.map +1 -1
- package/dist/cjs/navigation/NavigationEditKind.js +16 -0
- package/dist/cjs/navigation/NavigationEditKind.js.map +1 -0
- package/dist/cjs/navigation/NavigationItemOrigin.js +14 -0
- package/dist/cjs/navigation/NavigationItemOrigin.js.map +1 -0
- package/dist/cjs/navigation/NavigationSourcesKind.js +16 -0
- package/dist/cjs/navigation/NavigationSourcesKind.js.map +1 -0
- package/dist/cjs/navigation/diagnoseNavigation.js +8 -1
- package/dist/cjs/navigation/diagnoseNavigation.js.map +1 -1
- package/dist/cjs/navigation/diagnoseNavigationRegions.js +99 -0
- package/dist/cjs/navigation/diagnoseNavigationRegions.js.map +1 -0
- package/dist/cjs/navigation/effectiveNavigation.js +133 -0
- package/dist/cjs/navigation/effectiveNavigation.js.map +1 -0
- package/dist/cjs/navigation/navigationEdits.js +230 -0
- package/dist/cjs/navigation/navigationEdits.js.map +1 -0
- package/dist/cjs/navigation/navigationRegions.js +42 -0
- package/dist/cjs/navigation/navigationRegions.js.map +1 -0
- package/dist/cjs/structure/ApplicationStructureIndex.js +10 -0
- package/dist/cjs/structure/ApplicationStructureIndex.js.map +1 -1
- package/dist/cjs/toolbar/SliceDialogSource.js +14 -0
- package/dist/cjs/toolbar/SliceDialogSource.js.map +1 -0
- package/dist/cjs/toolbar/ToolbarDiagnosticCode.js +16 -0
- package/dist/cjs/toolbar/ToolbarDiagnosticCode.js.map +1 -0
- package/dist/cjs/toolbar/ToolbarDiagnosticSeverity.js +14 -0
- package/dist/cjs/toolbar/ToolbarDiagnosticSeverity.js.map +1 -0
- package/dist/cjs/toolbar/sliceDialogFor.js +38 -0
- package/dist/cjs/toolbar/sliceDialogFor.js.map +1 -0
- package/dist/cjs/toolbar/toolbarButtons.js +93 -0
- package/dist/cjs/toolbar/toolbarButtons.js.map +1 -0
- package/dist/cjs/toolbar/validateToolbarButtons.js +59 -0
- package/dist/cjs/toolbar/validateToolbarButtons.js.map +1 -0
- package/dist/cjs/validateNavigationDestinations.js +2 -0
- package/dist/cjs/validateNavigationDestinations.js.map +1 -1
- package/dist/esm/editing/resolveEffectiveConfiguration.d.ts.map +1 -1
- package/dist/esm/editing/resolveEffectiveConfiguration.js +8 -0
- package/dist/esm/editing/resolveEffectiveConfiguration.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/navigation/EffectiveNavItem.d.ts +14 -0
- package/dist/esm/navigation/EffectiveNavItem.d.ts.map +1 -0
- package/dist/esm/navigation/EffectiveNavItem.js +2 -0
- package/dist/esm/navigation/EffectiveNavItem.js.map +1 -0
- package/dist/esm/navigation/EffectiveNavigationRegion.d.ts +11 -0
- package/dist/esm/navigation/EffectiveNavigationRegion.d.ts.map +1 -0
- package/dist/esm/navigation/EffectiveNavigationRegion.js +2 -0
- package/dist/esm/navigation/EffectiveNavigationRegion.js.map +1 -0
- package/dist/esm/navigation/NavigationDiagnosticCode.d.ts +6 -1
- package/dist/esm/navigation/NavigationDiagnosticCode.d.ts.map +1 -1
- package/dist/esm/navigation/NavigationDiagnosticCode.js +5 -0
- package/dist/esm/navigation/NavigationDiagnosticCode.js.map +1 -1
- package/dist/esm/navigation/NavigationEdit.d.ts +13 -0
- package/dist/esm/navigation/NavigationEdit.d.ts.map +1 -0
- package/dist/esm/navigation/NavigationEdit.js +2 -0
- package/dist/esm/navigation/NavigationEdit.js.map +1 -0
- package/dist/esm/navigation/NavigationEditKind.d.ts +7 -0
- package/dist/esm/navigation/NavigationEditKind.d.ts.map +1 -0
- package/dist/esm/navigation/NavigationEditKind.js +14 -0
- package/dist/esm/navigation/NavigationEditKind.js.map +1 -0
- package/dist/esm/navigation/NavigationEditOutcome.d.ts +7 -0
- package/dist/esm/navigation/NavigationEditOutcome.d.ts.map +1 -0
- package/dist/esm/navigation/NavigationEditOutcome.js +2 -0
- package/dist/esm/navigation/NavigationEditOutcome.js.map +1 -0
- package/dist/esm/navigation/NavigationEditPlan.d.ts +6 -0
- package/dist/esm/navigation/NavigationEditPlan.d.ts.map +1 -0
- package/dist/esm/navigation/NavigationEditPlan.js +2 -0
- package/dist/esm/navigation/NavigationEditPlan.js.map +1 -0
- package/dist/esm/navigation/NavigationGraph.d.ts +4 -1
- package/dist/esm/navigation/NavigationGraph.d.ts.map +1 -1
- package/dist/esm/navigation/NavigationItemOrigin.d.ts +5 -0
- package/dist/esm/navigation/NavigationItemOrigin.d.ts.map +1 -0
- package/dist/esm/navigation/NavigationItemOrigin.js +12 -0
- package/dist/esm/navigation/NavigationItemOrigin.js.map +1 -0
- package/dist/esm/navigation/NavigationSources.d.ts +6 -0
- package/dist/esm/navigation/NavigationSources.d.ts.map +1 -0
- package/dist/esm/navigation/NavigationSources.js +2 -0
- package/dist/esm/navigation/NavigationSources.js.map +1 -0
- package/dist/esm/navigation/NavigationSourcesKind.d.ts +7 -0
- package/dist/esm/navigation/NavigationSourcesKind.d.ts.map +1 -0
- package/dist/esm/navigation/NavigationSourcesKind.js +14 -0
- package/dist/esm/navigation/NavigationSourcesKind.js.map +1 -0
- package/dist/esm/navigation/ResolvedNavigationTarget.d.ts +6 -0
- package/dist/esm/navigation/ResolvedNavigationTarget.d.ts.map +1 -0
- package/dist/esm/navigation/ResolvedNavigationTarget.js +2 -0
- package/dist/esm/navigation/ResolvedNavigationTarget.js.map +1 -0
- package/dist/esm/navigation/diagnoseNavigation.d.ts.map +1 -1
- package/dist/esm/navigation/diagnoseNavigation.js +8 -1
- package/dist/esm/navigation/diagnoseNavigation.js.map +1 -1
- package/dist/esm/navigation/diagnoseNavigationRegions.d.ts +8 -0
- package/dist/esm/navigation/diagnoseNavigationRegions.d.ts.map +1 -0
- package/dist/esm/navigation/diagnoseNavigationRegions.js +97 -0
- package/dist/esm/navigation/diagnoseNavigationRegions.js.map +1 -0
- package/dist/esm/navigation/effectiveNavigation.d.ts +5 -0
- package/dist/esm/navigation/effectiveNavigation.d.ts.map +1 -0
- package/dist/esm/navigation/effectiveNavigation.js +131 -0
- package/dist/esm/navigation/effectiveNavigation.js.map +1 -0
- package/dist/esm/navigation/index.d.ts +14 -0
- package/dist/esm/navigation/index.d.ts.map +1 -1
- package/dist/esm/navigation/index.js +14 -0
- package/dist/esm/navigation/index.js.map +1 -1
- package/dist/esm/navigation/navigationEdits.d.ts +11 -0
- package/dist/esm/navigation/navigationEdits.d.ts.map +1 -0
- package/dist/esm/navigation/navigationEdits.js +225 -0
- package/dist/esm/navigation/navigationEdits.js.map +1 -0
- package/dist/esm/navigation/navigationRegions.d.ts +9 -0
- package/dist/esm/navigation/navigationRegions.d.ts.map +1 -0
- package/dist/esm/navigation/navigationRegions.js +34 -0
- package/dist/esm/navigation/navigationRegions.js.map +1 -0
- package/dist/esm/structure/ApplicationStructureIndex.d.ts +1 -0
- package/dist/esm/structure/ApplicationStructureIndex.d.ts.map +1 -1
- package/dist/esm/structure/ApplicationStructureIndex.js +10 -0
- package/dist/esm/structure/ApplicationStructureIndex.js.map +1 -1
- package/dist/esm/toolbar/ResolvedToolbarButton.d.ts +13 -0
- package/dist/esm/toolbar/ResolvedToolbarButton.d.ts.map +1 -0
- package/dist/esm/toolbar/ResolvedToolbarButton.js +2 -0
- package/dist/esm/toolbar/ResolvedToolbarButton.js.map +1 -0
- package/dist/esm/toolbar/SliceDialog.d.ts +8 -0
- package/dist/esm/toolbar/SliceDialog.d.ts.map +1 -0
- package/dist/esm/toolbar/SliceDialog.js +2 -0
- package/dist/esm/toolbar/SliceDialog.js.map +1 -0
- package/dist/esm/toolbar/SliceDialogSource.d.ts +5 -0
- package/dist/esm/toolbar/SliceDialogSource.d.ts.map +1 -0
- package/dist/esm/toolbar/SliceDialogSource.js +12 -0
- package/dist/esm/toolbar/SliceDialogSource.js.map +1 -0
- package/dist/esm/toolbar/ToolbarDiagnostic.d.ts +9 -0
- package/dist/esm/toolbar/ToolbarDiagnostic.d.ts.map +1 -0
- package/dist/esm/toolbar/ToolbarDiagnostic.js +2 -0
- package/dist/esm/toolbar/ToolbarDiagnostic.js.map +1 -0
- package/dist/esm/toolbar/ToolbarDiagnosticCode.d.ts +6 -0
- package/dist/esm/toolbar/ToolbarDiagnosticCode.d.ts.map +1 -0
- package/dist/esm/toolbar/ToolbarDiagnosticCode.js +14 -0
- package/dist/esm/toolbar/ToolbarDiagnosticCode.js.map +1 -0
- package/dist/esm/toolbar/ToolbarDiagnosticSeverity.d.ts +5 -0
- package/dist/esm/toolbar/ToolbarDiagnosticSeverity.d.ts.map +1 -0
- package/dist/esm/toolbar/ToolbarDiagnosticSeverity.js +12 -0
- package/dist/esm/toolbar/ToolbarDiagnosticSeverity.js.map +1 -0
- package/dist/esm/toolbar/index.d.ts +10 -0
- package/dist/esm/toolbar/index.d.ts.map +1 -0
- package/dist/esm/toolbar/index.js +10 -0
- package/dist/esm/toolbar/index.js.map +1 -0
- package/dist/esm/toolbar/sliceDialogFor.d.ts +5 -0
- package/dist/esm/toolbar/sliceDialogFor.d.ts.map +1 -0
- package/dist/esm/toolbar/sliceDialogFor.js +35 -0
- package/dist/esm/toolbar/sliceDialogFor.js.map +1 -0
- package/dist/esm/toolbar/toolbarButtons.d.ts +10 -0
- package/dist/esm/toolbar/toolbarButtons.d.ts.map +1 -0
- package/dist/esm/toolbar/toolbarButtons.js +89 -0
- package/dist/esm/toolbar/toolbarButtons.js.map +1 -0
- package/dist/esm/toolbar/validateToolbarButtons.d.ts +5 -0
- package/dist/esm/toolbar/validateToolbarButtons.d.ts.map +1 -0
- package/dist/esm/toolbar/validateToolbarButtons.js +57 -0
- package/dist/esm/toolbar/validateToolbarButtons.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/validateNavigationDestinations.js +2 -0
- package/dist/esm/validateNavigationDestinations.js.map +1 -1
- package/editing/resolveEffectiveConfiguration.ts +13 -0
- package/index.ts +1 -0
- package/navigation/EffectiveNavItem.ts +37 -0
- package/navigation/EffectiveNavigationRegion.ts +26 -0
- package/navigation/NavigationDiagnosticCode.ts +15 -0
- package/navigation/NavigationEdit.ts +36 -0
- package/navigation/NavigationEditKind.ts +19 -0
- package/navigation/NavigationEditOutcome.ts +18 -0
- package/navigation/NavigationEditPlan.ts +15 -0
- package/navigation/NavigationGraph.ts +10 -1
- package/navigation/NavigationItemOrigin.ts +13 -0
- package/navigation/NavigationSources.ts +15 -0
- package/navigation/NavigationSourcesKind.ts +19 -0
- package/navigation/ResolvedNavigationTarget.ts +19 -0
- package/navigation/diagnoseNavigation.ts +7 -1
- package/navigation/diagnoseNavigationRegions.ts +122 -0
- package/navigation/effectiveNavigation.ts +105 -0
- package/navigation/index.ts +14 -0
- package/navigation/navigationEdits.ts +176 -0
- package/navigation/navigationRegions.ts +39 -0
- package/package.json +3 -3
- package/structure/ApplicationStructureIndex.ts +11 -0
- package/toolbar/ResolvedToolbarButton.ts +34 -0
- package/toolbar/SliceDialog.ts +21 -0
- package/toolbar/SliceDialogSource.ts +13 -0
- package/toolbar/ToolbarDiagnostic.ts +22 -0
- package/toolbar/ToolbarDiagnosticCode.ts +17 -0
- package/toolbar/ToolbarDiagnosticSeverity.ts +13 -0
- package/toolbar/index.ts +12 -0
- package/toolbar/sliceDialogFor.ts +31 -0
- package/toolbar/toolbarButtons.ts +83 -0
- package/toolbar/validateToolbarButtons.ts +61 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var SliceDialogSource = require('./SliceDialogSource.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
|
+
/** The dialog template used when a slice names none. */ const defaultSliceDialogTemplate = 'FormDialog';
|
|
9
|
+
/**
|
|
10
|
+
* Works out the task dialog a state change slice opens, once, so no host decides it again (TB4): the slice's own
|
|
11
|
+
* dialog template when it names one, else the default form dialog.
|
|
12
|
+
*
|
|
13
|
+
* The C# engine (`SliceDialogs.For`) resolves the same dialog; both are asserted against `toolbar-slice-fixtures.json`.
|
|
14
|
+
*
|
|
15
|
+
* @param index The modules, features and slices of the application.
|
|
16
|
+
* @param sliceId The slice's qualified id.
|
|
17
|
+
* @param defaultTemplate The template used when the slice names none; {@link defaultSliceDialogTemplate} when absent.
|
|
18
|
+
* @returns The dialog, or undefined when there is no such slice or it is not a state change.
|
|
19
|
+
*/ function sliceDialogFor(index, sliceId, defaultTemplate) {
|
|
20
|
+
const slice = index.findSlice(sliceId);
|
|
21
|
+
if (slice?.kind !== scene_model.SliceKind.StateChange) return undefined;
|
|
22
|
+
const command = slice.command ?? slice.id;
|
|
23
|
+
return slice.dialogTemplate ? {
|
|
24
|
+
slice: sliceId,
|
|
25
|
+
command,
|
|
26
|
+
template: slice.dialogTemplate,
|
|
27
|
+
source: SliceDialogSource.SliceDialogSource.Slice
|
|
28
|
+
} : {
|
|
29
|
+
slice: sliceId,
|
|
30
|
+
command,
|
|
31
|
+
template: defaultTemplate ?? defaultSliceDialogTemplate,
|
|
32
|
+
source: SliceDialogSource.SliceDialogSource.Default
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
exports.defaultSliceDialogTemplate = defaultSliceDialogTemplate;
|
|
37
|
+
exports.sliceDialogFor = sliceDialogFor;
|
|
38
|
+
//# sourceMappingURL=sliceDialogFor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliceDialogFor.js","sources":["../../../toolbar/sliceDialogFor.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 { SliceKind } from '@cratis/scene.model';\nimport { ApplicationStructureIndex } from '../structure';\nimport { SliceDialog } from './SliceDialog';\nimport { SliceDialogSource } from './SliceDialogSource';\n\n/** The dialog template used when a slice names none. */\nexport const defaultSliceDialogTemplate = 'FormDialog';\n\n/**\n * Works out the task dialog a state change slice opens, once, so no host decides it again (TB4): the slice's own\n * dialog template when it names one, else the default form dialog.\n *\n * The C# engine (`SliceDialogs.For`) resolves the same dialog; both are asserted against `toolbar-slice-fixtures.json`.\n *\n * @param index The modules, features and slices of the application.\n * @param sliceId The slice's qualified id.\n * @param defaultTemplate The template used when the slice names none; {@link defaultSliceDialogTemplate} when absent.\n * @returns The dialog, or undefined when there is no such slice or it is not a state change.\n */\nexport function sliceDialogFor(index: ApplicationStructureIndex, sliceId: string, defaultTemplate?: string): SliceDialog | undefined {\n const slice = index.findSlice(sliceId);\n if (slice?.kind !== SliceKind.StateChange) return undefined;\n\n const command = slice.command ?? slice.id;\n return slice.dialogTemplate\n ? { slice: sliceId, command, template: slice.dialogTemplate, source: SliceDialogSource.Slice }\n : { slice: sliceId, command, template: defaultTemplate ?? defaultSliceDialogTemplate, source: SliceDialogSource.Default };\n}\n"],"names":["defaultSliceDialogTemplate","sliceDialogFor","index","sliceId","defaultTemplate","slice","findSlice","kind","SliceKind","StateChange","undefined","command","id","dialogTemplate","template","source","SliceDialogSource","Slice","Default"],"mappings":";;;;;AAAA;AACA;AAOA,yDACO,MAAMA,0BAAAA,GAA6B;AAE1C;;;;;;;;;;AAUC,IACM,SAASC,cAAAA,CAAeC,KAAgC,EAAEC,OAAe,EAAEC,eAAwB,EAAA;IACtG,MAAMC,KAAAA,GAAQH,KAAAA,CAAMI,SAAS,CAACH,OAAAA,CAAAA;AAC9B,IAAA,IAAIE,KAAAA,EAAOE,IAAAA,KAASC,qBAAAA,CAAUC,WAAW,EAAE,OAAOC,SAAAA;AAElD,IAAA,MAAMC,OAAAA,GAAUN,KAAAA,CAAMM,OAAO,IAAIN,MAAMO,EAAE;IACzC,OAAOP,KAAAA,CAAMQ,cAAc,GACrB;QAAER,KAAAA,EAAOF,OAAAA;AAASQ,QAAAA,OAAAA;AAASG,QAAAA,QAAAA,EAAUT,MAAMQ,cAAc;AAAEE,QAAAA,MAAAA,EAAQC,oCAAkBC;KAAM,GAC3F;QAAEZ,KAAAA,EAAOF,OAAAA;AAASQ,QAAAA,OAAAA;AAASG,QAAAA,QAAAA,EAAUV,eAAAA,IAAmBJ,0BAAAA;AAA4Be,QAAAA,MAAAA,EAAQC,oCAAkBE;AAAQ,KAAA;AAChI;;;"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var sliceDialogFor = require('./sliceDialogFor.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
|
+
function text(properties, name) {
|
|
9
|
+
const value = properties[name];
|
|
10
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Reads a button from the properties of a `core:toolbarItem` element: `label` (or `name`), `kind`, `slice`,
|
|
14
|
+
* `emphasis`, `icon` and `target`.
|
|
15
|
+
*
|
|
16
|
+
* The C# engine (`ToolbarButtons.FromItem`) reads the same; both are asserted against `toolbar-slice-fixtures.json`.
|
|
17
|
+
*
|
|
18
|
+
* @param id The element id.
|
|
19
|
+
* @param properties The element properties.
|
|
20
|
+
* @returns The button, or undefined when the item does not invoke a command or slice - a navigate or dialog item.
|
|
21
|
+
*/ function toolbarButtonFromItem(id, properties) {
|
|
22
|
+
const slice = text(properties, 'slice');
|
|
23
|
+
const action = text(properties, 'kind')?.toLowerCase() === 'action';
|
|
24
|
+
if (slice === undefined && !action) return undefined;
|
|
25
|
+
const button = {
|
|
26
|
+
id,
|
|
27
|
+
title: text(properties, 'label') ?? text(properties, 'name') ?? id
|
|
28
|
+
};
|
|
29
|
+
if (slice !== undefined) button.slice = slice;
|
|
30
|
+
const emphasis = text(properties, 'emphasis')?.toLowerCase();
|
|
31
|
+
if (emphasis === scene_model.ToolbarEmphasis.Primary || emphasis === scene_model.ToolbarEmphasis.Secondary || emphasis === scene_model.ToolbarEmphasis.Quiet) button.emphasis = emphasis;
|
|
32
|
+
const icon = text(properties, 'icon');
|
|
33
|
+
if (icon !== undefined) button.icon = icon;
|
|
34
|
+
const target = text(properties, 'target');
|
|
35
|
+
if (target !== undefined) button.target = target;
|
|
36
|
+
return button;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Converts a hand-authored button to a slice-backed one: a button with no slice whose command is accepted by exactly
|
|
40
|
+
* one state change slice names that slice instead.
|
|
41
|
+
* @param index The modules, features and slices of the application.
|
|
42
|
+
* @param button The button.
|
|
43
|
+
* @returns The button to use, and whether it was converted. A button that cannot be converted is returned as it is.
|
|
44
|
+
*/ function normalizeToolbarButton(index, button) {
|
|
45
|
+
if (button.slice || !button.target) return {
|
|
46
|
+
button,
|
|
47
|
+
converted: false
|
|
48
|
+
};
|
|
49
|
+
const matches = index.findSlicesByCommand(button.target);
|
|
50
|
+
if (matches.length !== 1) return {
|
|
51
|
+
button,
|
|
52
|
+
converted: false
|
|
53
|
+
};
|
|
54
|
+
const { target, ...rest } = button;
|
|
55
|
+
return {
|
|
56
|
+
button: {
|
|
57
|
+
...rest,
|
|
58
|
+
slice: matches[0]
|
|
59
|
+
},
|
|
60
|
+
converted: true
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Resolves a button: its slice, command and task dialog, without any rendering. This is what a renderer, Stage and the
|
|
65
|
+
* Studio preview call.
|
|
66
|
+
*
|
|
67
|
+
* The C# engine (`ToolbarButtons.Resolve`) resolves the same; both are asserted against `toolbar-slice-fixtures.json`.
|
|
68
|
+
*
|
|
69
|
+
* @param index The modules, features and slices of the application.
|
|
70
|
+
* @param button The button.
|
|
71
|
+
* @param defaultDialogTemplate The dialog template used when a slice names none.
|
|
72
|
+
*/ function resolveToolbarButton(index, button, defaultDialogTemplate) {
|
|
73
|
+
const { button: normalized, converted } = normalizeToolbarButton(index, button);
|
|
74
|
+
const dialog = normalized.slice ? sliceDialogFor.sliceDialogFor(index, normalized.slice, defaultDialogTemplate) : undefined;
|
|
75
|
+
const resolved = {
|
|
76
|
+
id: normalized.id,
|
|
77
|
+
title: normalized.title,
|
|
78
|
+
emphasis: normalized.emphasis ?? scene_model.ToolbarEmphasis.Secondary,
|
|
79
|
+
converted
|
|
80
|
+
};
|
|
81
|
+
if (normalized.icon !== undefined) resolved.icon = normalized.icon;
|
|
82
|
+
if (normalized.slice) resolved.slice = normalized.slice;
|
|
83
|
+
if (dialog) {
|
|
84
|
+
resolved.command = dialog.command;
|
|
85
|
+
resolved.dialog = dialog;
|
|
86
|
+
}
|
|
87
|
+
return resolved;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
exports.normalizeToolbarButton = normalizeToolbarButton;
|
|
91
|
+
exports.resolveToolbarButton = resolveToolbarButton;
|
|
92
|
+
exports.toolbarButtonFromItem = toolbarButtonFromItem;
|
|
93
|
+
//# sourceMappingURL=toolbarButtons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbarButtons.js","sources":["../../../toolbar/toolbarButtons.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 { ToolbarButton, ToolbarEmphasis } from '@cratis/scene.model';\nimport { ApplicationStructureIndex } from '../structure';\nimport { ResolvedToolbarButton } from './ResolvedToolbarButton';\nimport { sliceDialogFor } from './sliceDialogFor';\n\nfunction text(properties: Record<string, unknown>, name: string): string | undefined {\n const value = properties[name];\n return typeof value === 'string' && value.length > 0 ? value : undefined;\n}\n\n/**\n * Reads a button from the properties of a `core:toolbarItem` element: `label` (or `name`), `kind`, `slice`,\n * `emphasis`, `icon` and `target`.\n *\n * The C# engine (`ToolbarButtons.FromItem`) reads the same; both are asserted against `toolbar-slice-fixtures.json`.\n *\n * @param id The element id.\n * @param properties The element properties.\n * @returns The button, or undefined when the item does not invoke a command or slice - a navigate or dialog item.\n */\nexport function toolbarButtonFromItem(id: string, properties: Record<string, unknown>): ToolbarButton | undefined {\n const slice = text(properties, 'slice');\n const action = text(properties, 'kind')?.toLowerCase() === 'action';\n if (slice === undefined && !action) return undefined;\n\n const button: ToolbarButton = { id, title: text(properties, 'label') ?? text(properties, 'name') ?? id };\n if (slice !== undefined) button.slice = slice;\n\n const emphasis = text(properties, 'emphasis')?.toLowerCase();\n if (emphasis === ToolbarEmphasis.Primary || emphasis === ToolbarEmphasis.Secondary || emphasis === ToolbarEmphasis.Quiet) button.emphasis = emphasis;\n\n const icon = text(properties, 'icon');\n if (icon !== undefined) button.icon = icon;\n\n const target = text(properties, 'target');\n if (target !== undefined) button.target = target;\n return button;\n}\n\n/**\n * Converts a hand-authored button to a slice-backed one: a button with no slice whose command is accepted by exactly\n * one state change slice names that slice instead.\n * @param index The modules, features and slices of the application.\n * @param button The button.\n * @returns The button to use, and whether it was converted. A button that cannot be converted is returned as it is.\n */\nexport function normalizeToolbarButton(index: ApplicationStructureIndex, button: ToolbarButton): { button: ToolbarButton; converted: boolean } {\n if (button.slice || !button.target) return { button, converted: false };\n\n const matches = index.findSlicesByCommand(button.target);\n if (matches.length !== 1) return { button, converted: false };\n\n const { target, ...rest } = button;\n void target;\n return { button: { ...rest, slice: matches[0] }, converted: true };\n}\n\n/**\n * Resolves a button: its slice, command and task dialog, without any rendering. This is what a renderer, Stage and the\n * Studio preview call.\n *\n * The C# engine (`ToolbarButtons.Resolve`) resolves the same; both are asserted against `toolbar-slice-fixtures.json`.\n *\n * @param index The modules, features and slices of the application.\n * @param button The button.\n * @param defaultDialogTemplate The dialog template used when a slice names none.\n */\nexport function resolveToolbarButton(index: ApplicationStructureIndex, button: ToolbarButton, defaultDialogTemplate?: string): ResolvedToolbarButton {\n const { button: normalized, converted } = normalizeToolbarButton(index, button);\n const dialog = normalized.slice ? sliceDialogFor(index, normalized.slice, defaultDialogTemplate) : undefined;\n const resolved: ResolvedToolbarButton = { id: normalized.id, title: normalized.title, emphasis: normalized.emphasis ?? ToolbarEmphasis.Secondary, converted };\n if (normalized.icon !== undefined) resolved.icon = normalized.icon;\n if (normalized.slice) resolved.slice = normalized.slice;\n if (dialog) {\n resolved.command = dialog.command;\n resolved.dialog = dialog;\n }\n\n return resolved;\n}\n"],"names":["text","properties","name","value","length","undefined","toolbarButtonFromItem","id","slice","action","toLowerCase","button","title","emphasis","ToolbarEmphasis","Primary","Secondary","Quiet","icon","target","normalizeToolbarButton","index","converted","matches","findSlicesByCommand","rest","resolveToolbarButton","defaultDialogTemplate","normalized","dialog","sliceDialogFor","resolved","command"],"mappings":";;;;;AAAA;AACA;AAOA,SAASA,IAAAA,CAAKC,UAAmC,EAAEC,IAAY,EAAA;IAC3D,MAAMC,KAAAA,GAAQF,UAAU,CAACC,IAAAA,CAAK;AAC9B,IAAA,OAAO,OAAOC,KAAAA,KAAU,QAAA,IAAYA,MAAMC,MAAM,GAAG,IAAID,KAAAA,GAAQE,SAAAA;AACnE;AAEA;;;;;;;;;AASC,IACM,SAASC,qBAAAA,CAAsBC,EAAU,EAAEN,UAAmC,EAAA;IACjF,MAAMO,KAAAA,GAAQR,KAAKC,UAAAA,EAAY,OAAA,CAAA;AAC/B,IAAA,MAAMQ,MAAAA,GAAST,IAAAA,CAAKC,UAAAA,EAAY,MAAA,CAAA,EAASS,WAAAA,EAAAA,KAAkB,QAAA;AAC3D,IAAA,IAAIF,KAAAA,KAAUH,SAAAA,IAAa,CAACI,MAAAA,EAAQ,OAAOJ,SAAAA;AAE3C,IAAA,MAAMM,MAA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|
|
4
|
+
var ApplicationStructureIndex = require('../structure/ApplicationStructureIndex.js');
|
|
5
|
+
var ToolbarDiagnosticCode = require('./ToolbarDiagnosticCode.js');
|
|
6
|
+
var ToolbarDiagnosticSeverity = require('./ToolbarDiagnosticSeverity.js');
|
|
7
|
+
var toolbarButtons = require('./toolbarButtons.js');
|
|
8
|
+
|
|
9
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
10
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
11
|
+
/**
|
|
12
|
+
* Validates the buttons of a toolbar against the application structure: a button must invoke a state change slice
|
|
13
|
+
* (TB3), and a button without a slice is allowed but flagged (TB5). A hand-authored button that names a command is
|
|
14
|
+
* converted first, and a button whose command no single slice accepts is a legacy button that still validates.
|
|
15
|
+
*
|
|
16
|
+
* The C# engine (`ToolbarButtonValidation.Validate`) reports the same codes, severities and messages in the same
|
|
17
|
+
* order; both are asserted against `toolbar-slice-fixtures.json`.
|
|
18
|
+
*
|
|
19
|
+
* @param structure The modules, features and slices of the application.
|
|
20
|
+
* @param toolbar The toolbar.
|
|
21
|
+
* @returns The problems found, in button order.
|
|
22
|
+
*/ function validateToolbarButtons(structure, toolbar) {
|
|
23
|
+
const index = structure instanceof ApplicationStructureIndex.ApplicationStructureIndex ? structure : new ApplicationStructureIndex.ApplicationStructureIndex(structure);
|
|
24
|
+
const diagnostics = [];
|
|
25
|
+
for (const authored of toolbar.buttons){
|
|
26
|
+
const { button } = toolbarButtons.normalizeToolbarButton(index, authored);
|
|
27
|
+
if (!button.slice) {
|
|
28
|
+
if (!button.target) {
|
|
29
|
+
diagnostics.push({
|
|
30
|
+
code: ToolbarDiagnosticCode.ToolbarDiagnosticCode.ToolbarButtonSliceEmpty,
|
|
31
|
+
severity: ToolbarDiagnosticSeverity.ToolbarDiagnosticSeverity.Warning,
|
|
32
|
+
message: `Toolbar button '${button.id}' has no slice to invoke.`,
|
|
33
|
+
button: button.id
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const slice = index.findSlice(button.slice);
|
|
39
|
+
if (!slice) {
|
|
40
|
+
diagnostics.push({
|
|
41
|
+
code: ToolbarDiagnosticCode.ToolbarDiagnosticCode.ToolbarButtonSliceNotFound,
|
|
42
|
+
severity: ToolbarDiagnosticSeverity.ToolbarDiagnosticSeverity.Error,
|
|
43
|
+
message: `Toolbar button '${button.id}' invokes slice '${button.slice}', which does not exist.`,
|
|
44
|
+
button: button.id
|
|
45
|
+
});
|
|
46
|
+
} else if (slice.kind !== scene_model.SliceKind.StateChange) {
|
|
47
|
+
diagnostics.push({
|
|
48
|
+
code: ToolbarDiagnosticCode.ToolbarDiagnosticCode.ToolbarButtonSliceNotStateChange,
|
|
49
|
+
severity: ToolbarDiagnosticSeverity.ToolbarDiagnosticSeverity.Error,
|
|
50
|
+
message: `Toolbar button '${button.id}' invokes slice '${button.slice}', which is ${slice.kind === scene_model.SliceKind.StateView ? 'a state view' : 'an automation'}; only a state change can be invoked from a toolbar.`,
|
|
51
|
+
button: button.id
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return diagnostics;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
exports.validateToolbarButtons = validateToolbarButtons;
|
|
59
|
+
//# sourceMappingURL=validateToolbarButtons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateToolbarButtons.js","sources":["../../../toolbar/validateToolbarButtons.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, SliceKind, Toolbar } from '@cratis/scene.model';\nimport { ApplicationStructureIndex } from '../structure';\nimport { ToolbarDiagnostic } from './ToolbarDiagnostic';\nimport { ToolbarDiagnosticCode } from './ToolbarDiagnosticCode';\nimport { ToolbarDiagnosticSeverity } from './ToolbarDiagnosticSeverity';\nimport { normalizeToolbarButton } from './toolbarButtons';\n\n/**\n * Validates the buttons of a toolbar against the application structure: a button must invoke a state change slice\n * (TB3), and a button without a slice is allowed but flagged (TB5). A hand-authored button that names a command is\n * converted first, and a button whose command no single slice accepts is a legacy button that still validates.\n *\n * The C# engine (`ToolbarButtonValidation.Validate`) reports the same codes, severities and messages in the same\n * order; both are asserted against `toolbar-slice-fixtures.json`.\n *\n * @param structure The modules, features and slices of the application.\n * @param toolbar The toolbar.\n * @returns The problems found, in button order.\n */\nexport function validateToolbarButtons(structure: ApplicationStructure | ApplicationStructureIndex, toolbar: Toolbar): ToolbarDiagnostic[] {\n const index = structure instanceof ApplicationStructureIndex ? structure : new ApplicationStructureIndex(structure);\n const diagnostics: ToolbarDiagnostic[] = [];\n\n for (const authored of toolbar.buttons) {\n const { button } = normalizeToolbarButton(index, authored);\n if (!button.slice) {\n if (!button.target) {\n diagnostics.push({\n code: ToolbarDiagnosticCode.ToolbarButtonSliceEmpty,\n severity: ToolbarDiagnosticSeverity.Warning,\n message: `Toolbar button '${button.id}' has no slice to invoke.`,\n button: button.id,\n });\n }\n\n continue;\n }\n\n const slice = index.findSlice(button.slice);\n if (!slice) {\n diagnostics.push({\n code: ToolbarDiagnosticCode.ToolbarButtonSliceNotFound,\n severity: ToolbarDiagnosticSeverity.Error,\n message: `Toolbar button '${button.id}' invokes slice '${button.slice}', which does not exist.`,\n button: button.id,\n });\n } else if (slice.kind !== SliceKind.StateChange) {\n diagnostics.push({\n code: ToolbarDiagnosticCode.ToolbarButtonSliceNotStateChange,\n severity: ToolbarDiagnosticSeverity.Error,\n message: `Toolbar button '${button.id}' invokes slice '${button.slice}', which is ${slice.kind === SliceKind.StateView ? 'a state view' : 'an automation'}; only a state change can be invoked from a toolbar.`,\n button: button.id,\n });\n }\n }\n\n return diagnostics;\n}\n"],"names":["validateToolbarButtons","structure","toolbar","index","ApplicationStructureIndex","diagnostics","authored","buttons","button","normalizeToolbarButton","slice","target","push","code","ToolbarDiagnosticCode","ToolbarButtonSliceEmpty","severity","ToolbarDiagnosticSeverity","Warning","message","id","findSlice","ToolbarButtonSliceNotFound","Error","kind","SliceKind","StateChange","ToolbarButtonSliceNotStateChange","StateView"],"mappings":";;;;;;;;AAAA;AACA;AASA;;;;;;;;;;;AAWC,IACM,SAASA,sBAAAA,CAAuBC,SAA2D,EAAEC,OAAgB,EAAA;AAChH,IAAA,MAAMC,KAAAA,GAAQF,SAAAA,YAAqBG,mDAAAA,GAA4BH,SAAAA,GAAY,IAAIG,mDAAAA,CAA0BH,SAAAA,CAAAA;AACzG,IAAA,MAAMI,cAAmC,EAAE;AAE3C,IAAA,KAAK,MAAMC,QAAAA,IAAYJ,OAAAA,CAAQK,OAAO,CAAE;AACpC,QAAA,MAAM,EAAEC,MAAM,EAAE,GAAGC,sCAAuBN,KAAAA,EAAOG,QAAAA,CAAAA;QACjD,IAAI,CAACE,MAAAA,CAAOE,KAAK,EAAE;YACf,IAAI,CAACF,MAAAA,CAAOG,MAAM,EAAE;AAChBN,gBAAAA,WAAAA,CAAYO,IAAI,CAAC;AACbC,oBAAAA,IAAAA,EAAMC,4CAAsBC,uBAAuB;AACnDC,oBAAAA,QAAAA,EAAUC,oDAA0BC,OAAO;AAC3CC,oBAAAA,OAAAA,EAAS,CAAC,gBAAgB,EAAEX,OAAOY,EAAE,CAAC,yBAAyB,CAAC;AAChEZ,oBAAAA,MAAAA,EAAQA,OAAOY;AACnB,iBAAA,CAAA;AACJ,YAAA;AAEA,YAAA;AACJ,QAAA;AAEA,QAAA,MAAMV,KAAAA,GAAQP,KAAAA,CAAMkB,SAAS,CAACb,OAAOE,KAAK,CAAA;AAC1C,QAAA,IAAI,CAACA,KAAAA,EAAO;AACRL,YAAAA,WAAAA,CAAYO,IAAI,CAAC;AACbC,gBAAAA,IAAAA,EAAMC,4CAAsBQ,0BAA0B;AACtDN,gBAAAA,QAAAA,EAAUC,oDAA0BM,KAAK;AACzCJ,gBAAAA,OAAAA,EAAS,CAAC,gBAAgB,EAAEX,MAAAA,CAAOY,EAAE,CAAC,iBAAiB,EAAEZ,MAAAA,CAAOE,KAAK,CAAC,wBAAwB,CAAC;AAC/FF,gBAAAA,MAAAA,EAAQA,OAAOY;AACnB,aAAA,CAAA;AACJ,QAAA,CAAA,MAAO,IAAIV,KAAAA,CAAMc,IAAI,KAAKC,qBAAAA,CAAUC,WAAW,EAAE;AAC7CrB,YAAAA,WAAAA,CAAYO,IAAI,CAAC;AACbC,gBAAAA,IAAAA,EAAMC,4CAAsBa,gCAAgC;AAC5DX,gBAAAA,QAAAA,EAAUC,oDAA0BM,KAAK;gBACzCJ,OAAAA,EAAS,CAAC,gBAAgB,EAAEX,MAAAA,CAAOY,EAAE,CAAC,iBAAiB,EAAEZ,MAAAA,CAAOE,KAAK,CAAC,YAAY,EAAEA,KAAAA,CAAMc,IAAI,KAAKC,qBAAAA,CAAUG,SAAS,GAAG,cAAA,GAAiB,eAAA,CAAgB,oDAAoD,CAAC;AAC/MpB,gBAAAA,MAAAA,EAAQA,OAAOY;AACnB,aAAA,CAAA;AACJ,QAAA;AACJ,IAAA;IAEA,OAAOf,WAAAA;AACX;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var diagnoseNavigation = require('./navigation/diagnoseNavigation.js');
|
|
4
|
+
require('./navigation/navigationRegions.js');
|
|
5
|
+
require('@cratis/scene.model');
|
|
4
6
|
|
|
5
7
|
// Copyright (c) Cratis. All rights reserved.
|
|
6
8
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateNavigationDestinations.js","sources":["../../validateNavigationDestinations.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 { DestinationReference, DialogTemplate, Layout, Screen, ScreenTemplate } from '@cratis/scene.model';\nimport { NavigationDiagnostic, diagnoseNavigation } from './navigation';\n\n/**\n * A navigation problem as {@link validateNavigationDestinations} reports it.\n */\nexport type NavigationDestinationDiagnostic = NavigationDiagnostic;\n\n/**\n * Validates destinations against the outlet/route declarations owned by layouts and templates, and - when\n * the screens and dialog templates are given - against the targets that actually exist.\n *\n * A shorthand for {@link diagnoseNavigation} over destinations without entry identities.\n */\nexport function validateNavigationDestinations(\n destinations: DestinationReference[],\n surfaces: { layouts?: Layout[]; screenTemplates?: ScreenTemplate[]; screens?: Screen[]; dialogTemplates?: DialogTemplate[] } = {},\n): NavigationDestinationDiagnostic[] {\n return diagnoseNavigation({ entries: destinations.map(destination => ({ destination })), ...surfaces });\n}\n"],"names":["validateNavigationDestinations","destinations","surfaces","diagnoseNavigation","entries","map","destination"],"mappings":"
|
|
1
|
+
{"version":3,"file":"validateNavigationDestinations.js","sources":["../../validateNavigationDestinations.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 { DestinationReference, DialogTemplate, Layout, Screen, ScreenTemplate } from '@cratis/scene.model';\nimport { NavigationDiagnostic, diagnoseNavigation } from './navigation';\n\n/**\n * A navigation problem as {@link validateNavigationDestinations} reports it.\n */\nexport type NavigationDestinationDiagnostic = NavigationDiagnostic;\n\n/**\n * Validates destinations against the outlet/route declarations owned by layouts and templates, and - when\n * the screens and dialog templates are given - against the targets that actually exist.\n *\n * A shorthand for {@link diagnoseNavigation} over destinations without entry identities.\n */\nexport function validateNavigationDestinations(\n destinations: DestinationReference[],\n surfaces: { layouts?: Layout[]; screenTemplates?: ScreenTemplate[]; screens?: Screen[]; dialogTemplates?: DialogTemplate[] } = {},\n): NavigationDestinationDiagnostic[] {\n return diagnoseNavigation({ entries: destinations.map(destination => ({ destination })), ...surfaces });\n}\n"],"names":["validateNavigationDestinations","destinations","surfaces","diagnoseNavigation","entries","map","destination"],"mappings":";;;;;;AAAA;AACA;AAUA;;;;;AAKC,IACM,SAASA,8BAAAA,CACZC,YAAoC,EACpCC,QAAAA,GAA+H,EAAE,EAAA;AAEjI,IAAA,OAAOC,qCAAAA,CAAmB;AAAEC,QAAAA,OAAAA,EAASH,YAAAA,CAAaI,GAAG,CAACC,CAAAA,eAAgB;AAAEA,gBAAAA;aAAY,CAAA,CAAA;AAAK,QAAA,GAAGJ;AAAS,KAAA,CAAA;AACzG;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveEffectiveConfiguration.d.ts","sourceRoot":"","sources":["../../../editing/resolveEffectiveConfiguration.ts"],"names":[],"mappings":"AAGA,OAAO,EAEH,sBAAsB,EAA0B,oBAAoB,EACvE,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAA2B,MAAM,qBAAqB,CAAC;AAIjF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"resolveEffectiveConfiguration.d.ts","sourceRoot":"","sources":["../../../editing/resolveEffectiveConfiguration.ts"],"names":[],"mappings":"AAGA,OAAO,EAEH,sBAAsB,EAA0B,oBAAoB,EACvE,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAA2B,MAAM,qBAAqB,CAAC;AAIjF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAiHhD,wBAAgB,6BAA6B,CACzC,aAAa,EAAE,aAAa,EAC5B,qBAAqB,EAAE,oBAAoB,EAAE,EAC7C,OAAO,EAAE,iBAAiB,GAC3B,sBAAsB,CAiGxB"}
|
|
@@ -52,6 +52,14 @@ function collectionValue(grant, matching, instance, items, diagnostics) {
|
|
|
52
52
|
diagnostics.push(errorDiagnostic(DiagnosticCode.ContributionTypeMismatch, `The saved value of '${grant.path}' set by '${instance}' is ignored: a collection takes items.`, context));
|
|
53
53
|
continue;
|
|
54
54
|
}
|
|
55
|
+
if (contribution.replaceOwnerItems === true) {
|
|
56
|
+
if (!grant.operations.includes(CollectionOperation.Replace)) {
|
|
57
|
+
diagnostics.push(errorDiagnostic(DiagnosticCode.ContributionOperationNotPermitted, `'${instance}' replaces the items it inherits in '${grant.path}', but replacing items is not exposed. It is ignored and kept.`, context));
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
items.splice(0, items.length);
|
|
61
|
+
contributed = true;
|
|
62
|
+
}
|
|
55
63
|
if (contribution.items.length > 0 && !grant.operations.includes(CollectionOperation.Add)) {
|
|
56
64
|
diagnostics.push(errorDiagnostic(DiagnosticCode.ContributionOperationNotPermitted, `'${instance}' has items in '${grant.path}', but adding items is not exposed. They are ignored and kept.`, context));
|
|
57
65
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveEffectiveConfiguration.js","sources":["../../../editing/resolveEffectiveConfiguration.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 {\n CollectionOperation, DiagnosticCode, EffectiveCollectionItem, EffectiveComponentConfiguration,\n EffectiveConfiguration, EffectivePropertyValue, InstanceContribution, PropertyValueType, SceneDiagnostic, ValueSource,\n} from '@cratis/scene.model';\nimport { DescriptorCatalog, findComponentDescriptor } from './DescriptorCatalog';\nimport { errorDiagnostic } from './diagnostics';\nimport { computeExposureGrants, ExposureGrant, grantKey } from './exposureGrants';\nimport { cloneData, getValueAtPath, setValueAtPath } from './pathAccess';\nimport { TemplateChain } from './TemplateChain';\nimport { validateItemValues, validateValue } from './validateValue';\n\n/**\n * Splits a flat collection item as it is stored on an element - `{ id, label, ... }` - into its id and fields.\n */\nfunction toEffectiveItem(item: unknown, index: number): EffectiveCollectionItem {\n const { id, ...values } = (item !== null && typeof item === 'object' ? item : {}) as Record<string, unknown>;\n return { id: typeof id === 'string' && id.length > 0 ? id : `owner-${index}`, values, origin: 'owner', fixed: true };\n}\n\nfunction toFlatItem(item: EffectiveCollectionItem): Record<string, unknown> {\n return { id: item.id, ...item.values };\n}\n\nfunction scalarValue(grant: ExposureGrant, matching: InstanceContribution[], instance: string, current: EffectivePropertyValue, diagnostics: SceneDiagnostic[]): void {\n for (const contribution of matching) {\n const problem = contribution.value === undefined ? 'a value is required' : validateValue(grant.descriptor, contribution.value);\n if (problem) {\n diagnostics.push(errorDiagnostic(\n DiagnosticCode.ContributionTypeMismatch,\n `The saved value of '${grant.path}' set by '${instance}' is ignored: ${problem}. It is kept, and applies again when it fits.`,\n { instance, component: grant.component, path: grant.path }));\n continue;\n }\n\n current.value = contribution.value;\n current.source = ValueSource.Instance;\n current.contributedBy = instance;\n }\n}\n\nfunction collectionValue(grant: ExposureGrant, matching: InstanceContribution[], instance: string, items: EffectiveCollectionItem[], diagnostics: SceneDiagnostic[]): boolean {\n let contributed = false;\n\n for (const contribution of matching) {\n const context = { instance, component: grant.component, path: grant.path };\n if (contribution.items === undefined) {\n diagnostics.push(errorDiagnostic(DiagnosticCode.ContributionTypeMismatch, `The saved value of '${grant.path}' set by '${instance}' is ignored: a collection takes items.`, context));\n continue;\n }\n\n if (contribution.items.length > 0 && !grant.operations.includes(CollectionOperation.Add)) {\n diagnostics.push(errorDiagnostic(\n DiagnosticCode.ContributionOperationNotPermitted,\n `'${instance}' has items in '${grant.path}', but adding items is not exposed. They are ignored and kept.`,\n context));\n continue;\n }\n\n for (const item of contribution.items) {\n const itemContext = { ...context, itemId: item.id };\n if (items.some(existing => existing.id === item.id)) {\n diagnostics.push(errorDiagnostic(DiagnosticCode.DuplicateCollectionItem, `The item id '${item.id}' in '${grant.path}' is already used.`, itemContext));\n continue;\n }\n\n const values: Record<string, unknown> = {};\n for (const [field, value] of Object.entries(item.values)) {\n if (grant.editableFields !== undefined && !grant.editableFields.includes(field)) {\n diagnostics.push(errorDiagnostic(DiagnosticCode.ContributionOperationNotPermitted, `The field '${field}' of '${grant.path}' is not exposed for editing.`, itemContext));\n continue;\n }\n\n const problem = validateItemValues(grant.descriptor.item, { [field]: value }).find(candidate => candidate.field === field);\n if (problem) {\n diagnostics.push(errorDiagnostic(\n problem.problem.startsWith('is not a field') ? DiagnosticCode.UnknownCollectionField : DiagnosticCode.ContributionTypeMismatch,\n `The field '${field}' of an item in '${grant.path}' is ignored: ${problem.problem}.`,\n itemContext));\n continue;\n }\n\n values[field] = value;\n }\n\n items.push({ id: item.id, values, origin: instance, fixed: false });\n contributed = true;\n }\n }\n\n return contributed;\n}\n\n/**\n * Resolves what every configurable component in a template chain is worth: the owner's own values, with each\n * instance's contributions applied in nesting order.\n *\n * This is the one merge. The editor shows its result and the runtime renders from it, so what an author sees is\n * what Play renders. Order is fixed: the owner's value first, then each level from the outermost inwards, so a\n * later level wins a scalar and appends to a collection after the earlier ones.\n *\n * Nothing in the persisted data is changed. A contribution that cannot apply - the exposure was withdrawn, the\n * property's type changed, the component is gone - is reported in `diagnostics` and left out of the result, and\n * stays in `instanceContributions`, so restoring the exposure brings its value back.\n *\n * @param templateChain The nesting, from {@link resolveTemplateChain} or built by hand.\n * @param instanceContributions What each instance has set.\n * @param catalog The descriptors saying what each component supports.\n */\nexport function resolveEffectiveConfiguration(\n templateChain: TemplateChain,\n instanceContributions: InstanceContribution[],\n catalog: DescriptorCatalog,\n): EffectiveConfiguration {\n const grants = computeExposureGrants(templateChain, catalog);\n const diagnostics: SceneDiagnostic[] = [...templateChain.diagnostics, ...grants.diagnostics];\n const handled = new Set<InstanceContribution>();\n const components = new Map<string, EffectiveComponentConfiguration>();\n\n for (const grant of grants.exposed) {\n const owner = templateChain.levels[grant.ownerLevel];\n const element = owner.elements.find(candidate => candidate.id === grant.component)!;\n\n let configuration = components.get(grant.component);\n if (!configuration) {\n configuration = { component: grant.component, owner: owner.owner, properties: cloneData(element.properties), values: [] };\n components.set(grant.component, configuration);\n }\n\n const stored = getValueAtPath(element.properties, grant.path);\n const base = stored === undefined ? cloneData(grant.descriptor.default) : cloneData(stored);\n const isCollection = grant.descriptor.valueType === PropertyValueType.Collection;\n const baseItems = isCollection && Array.isArray(base) ? base.map(toEffectiveItem) : [];\n const items = [...baseItems];\n\n const current: EffectivePropertyValue = {\n path: grant.path,\n value: base,\n source: stored === undefined ? ValueSource.Default : ValueSource.Local,\n inheritedValue: base,\n };\n let contributed = false;\n\n for (let index = grant.ownerLevel + 1; index < templateChain.levels.length; index++) {\n const instance = templateChain.levels[index].instance;\n if (!grants.byInstance.get(instance)?.has(grantKey(grant.component, grant.path))) continue;\n\n const effectiveGrant = grants.byInstance.get(instance)!.get(grantKey(grant.component, grant.path))!;\n const matching = instanceContributions.filter(contribution =>\n contribution.instance === instance && contribution.component === grant.component && contribution.path === grant.path);\n for (const contribution of matching) handled.add(contribution);\n\n if (isCollection) {\n if (collectionValue(effectiveGrant, matching, instance, items, diagnostics)) {\n contributed = true;\n current.contributedBy = instance;\n }\n } else {\n scalarValue(effectiveGrant, matching, instance, current, diagnostics);\n }\n }\n\n const maximumItems = grant.descriptor.constraints?.maximumItems;\n if (isCollection && maximumItems !== undefined && items.length > maximumItems) {\n // Saved items that no longer fit - the owner lowered the limit after they were added - are left out of\n // the result in order and kept in the saved data, like any other saved value that no longer fits.\n const dropped = items.splice(maximumItems);\n diagnostics.push(errorDiagnostic(\n DiagnosticCode.ContributionTypeMismatch,\n `'${grant.path}' on '${grant.component}' allows at most ${maximumItems} items; ${dropped.map(item => `'${item.id}'`).join(', ')} ${dropped.length === 1 ? 'is' : 'are'} ignored and kept.`,\n { instance: current.contributedBy ?? owner.instance, component: grant.component, path: grant.path }));\n }\n\n if (isCollection) {\n current.items = items;\n current.inheritedValue = baseItems.map(toFlatItem);\n current.value = items.map(toFlatItem);\n if (contributed) current.source = ValueSource.Instance;\n }\n\n if (current.value !== undefined) setValueAtPath(configuration.properties, grant.path, current.value);\n configuration.values.push(current);\n }\n\n const levelOf = new Map(templateChain.levels.map((chainLevel, index) => [chainLevel.instance, index]));\n for (const contribution of instanceContributions) {\n const contributorLevel = levelOf.get(contribution.instance);\n if (contributorLevel === undefined || handled.has(contribution)) continue;\n\n const context = { instance: contribution.instance, component: contribution.component, path: contribution.path };\n const owner = templateChain.levels.slice(0, contributorLevel).find(chainLevel => chainLevel.elements.some(element => element.id === contribution.component));\n if (!owner) {\n diagnostics.push(errorDiagnostic(\n DiagnosticCode.ContributionTargetMissing,\n `'${contribution.instance}' has saved values for '${contribution.component}', which is not in any layout or template above it. They are kept.`,\n context));\n } else if (!findComponentDescriptor(catalog, owner.elements.find(element => element.id === contribution.component)!.componentName)) {\n diagnostics.push(errorDiagnostic(\n DiagnosticCode.MissingComponentDescriptor,\n `'${contribution.instance}' has saved values for '${contribution.component}', but nothing describes that component any more. They are kept.`,\n context));\n } else {\n diagnostics.push(errorDiagnostic(\n DiagnosticCode.ContributionNotExposed,\n `'${contribution.instance}' has a saved value for '${contribution.path}' on '${contribution.component}', which is not exposed to it. It is ignored and kept.`,\n context));\n }\n }\n\n return { components: [...components.values()], diagnostics };\n}\n"],"names":["toEffectiveItem","item","index","id","values","length","origin","fixed","toFlatItem","scalarValue","grant","matching","instance","current","diagnostics","contribution","problem","value","undefined","validateValue","descriptor","push","errorDiagnostic","DiagnosticCode","ContributionTypeMismatch","path","component","source","ValueSource","Instance","contributedBy","collectionValue","items","contributed","context","operations","includes","CollectionOperation","Add","ContributionOperationNotPermitted","itemContext","itemId","some","existing","DuplicateCollectionItem","field","Object","entries","editableFields","validateItemValues","find","candidate","startsWith","UnknownCollectionField","resolveEffectiveConfiguration","templateChain","instanceContributions","catalog","grants","computeExposureGrants","handled","Set","components","Map","exposed","owner","levels","ownerLevel","element","elements","configuration","get","properties","cloneData","set","stored","getValueAtPath","base","default","isCollection","valueType","PropertyValueType","Collection","baseItems","Array","isArray","map","Default","Local","inheritedValue","byInstance","has","grantKey","effectiveGrant","filter","add","maximumItems","constraints","dropped","splice","join","setValueAtPath","levelOf","chainLevel","contributorLevel","slice","ContributionTargetMissing","findComponentDescriptor","componentName","MissingComponentDescriptor","ContributionNotExposed"],"mappings":";;;;;;;AAAA;AACA;AAaA;;AAEC,IACD,SAASA,eAAAA,CAAgBC,IAAa,EAAEC,KAAa,EAAA;AACjD,IAAA,MAAM,EAAE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AQjE,EAAE,KAAKY,YAAAA,CAAaW,SAAS,CAAA,CAAA;AAC1J,QAAA,IAAI,CAACuC,KAAAA,EAAO;AACRnD,YAAAA,WAAAA,CAAYO,IAAI,CAACC,eAAAA,CACbC,eAAemF,yBAAyB,EACxC,CAAC,CAAC,EAAE3F,aAAaH,QAAQ,CAAC,wBAAwB,EAAEG,YAAAA,CAAaW,SAAS,CAAC,kEAAkE,CAAC,EAC9IQ,OAAAA,CAAAA,CAAAA;AACR,QAAA,CAAA,MAAO,IAAI,CAACyE,uBAAAA,CAAwBlD,SAASQ,KAAAA,CAAMI,QAAQ,CAACnB,IAAI,CAACkB,CAAAA,OAAAA,GAAWA,QAAQjE,EAAE,KAAKY,aAAaW,SAAS,CAAA,CAAGkF,aAAa,CAAA,EAAG;AAChI9F,YAAAA,WAAAA,CAAYO,IAAI,CAACC,eAAAA,CACbC,eAAesF,0BAA0B,EACzC,CAAC,CAAC,EAAE9F,aAAaH,QAAQ,CAAC,wBAAwB,EAAEG,YAAAA,CAAaW,SAAS,CAAC,gEAAgE,CAAC,EAC5IQ,OAAAA,CAAAA,CAAAA;QACR,CAAA,MAAO;YACHpB,WAAAA,CAAYO,IAAI,CAACC,eAAAA,CACbC,cAAAA,CAAeuF,sBAAsB,EACrC,CAAC,CAAC,EAAE/F,YAAAA,CAAaH,QAAQ,CAAC,yBAAyB,EAAEG,YAAAA,CAAaU,IAAI,CAAC,MAAM,EAAEV,aAAaW,SAAS,CAAC,sDAAsD,CAAC,EAC7JQ,OAAAA,CAAAA,CAAAA;AACR,QAAA;AACJ,IAAA;IAEA,OAAO;QAAE4B,UAAAA,EAAY;AAAIA,YAAAA,GAAAA,UAAAA,CAAW1D,MAAM;AAAG,SAAA;AAAEU,QAAAA;AAAY,KAAA;AAC/D;;"}
|
|
1
|
+
{"version":3,"file":"resolveEffectiveConfiguration.js","sources":["../../../editing/resolveEffectiveConfiguration.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 {\n CollectionOperation, DiagnosticCode, EffectiveCollectionItem, EffectiveComponentConfiguration,\n EffectiveConfiguration, EffectivePropertyValue, InstanceContribution, PropertyValueType, SceneDiagnostic, ValueSource,\n} from '@cratis/scene.model';\nimport { DescriptorCatalog, findComponentDescriptor } from './DescriptorCatalog';\nimport { errorDiagnostic } from './diagnostics';\nimport { computeExposureGrants, ExposureGrant, grantKey } from './exposureGrants';\nimport { cloneData, getValueAtPath, setValueAtPath } from './pathAccess';\nimport { TemplateChain } from './TemplateChain';\nimport { validateItemValues, validateValue } from './validateValue';\n\n/**\n * Splits a flat collection item as it is stored on an element - `{ id, label, ... }` - into its id and fields.\n */\nfunction toEffectiveItem(item: unknown, index: number): EffectiveCollectionItem {\n const { id, ...values } = (item !== null && typeof item === 'object' ? item : {}) as Record<string, unknown>;\n return { id: typeof id === 'string' && id.length > 0 ? id : `owner-${index}`, values, origin: 'owner', fixed: true };\n}\n\nfunction toFlatItem(item: EffectiveCollectionItem): Record<string, unknown> {\n return { id: item.id, ...item.values };\n}\n\nfunction scalarValue(grant: ExposureGrant, matching: InstanceContribution[], instance: string, current: EffectivePropertyValue, diagnostics: SceneDiagnostic[]): void {\n for (const contribution of matching) {\n const problem = contribution.value === undefined ? 'a value is required' : validateValue(grant.descriptor, contribution.value);\n if (problem) {\n diagnostics.push(errorDiagnostic(\n DiagnosticCode.ContributionTypeMismatch,\n `The saved value of '${grant.path}' set by '${instance}' is ignored: ${problem}. It is kept, and applies again when it fits.`,\n { instance, component: grant.component, path: grant.path }));\n continue;\n }\n\n current.value = contribution.value;\n current.source = ValueSource.Instance;\n current.contributedBy = instance;\n }\n}\n\nfunction collectionValue(grant: ExposureGrant, matching: InstanceContribution[], instance: string, items: EffectiveCollectionItem[], diagnostics: SceneDiagnostic[]): boolean {\n let contributed = false;\n\n for (const contribution of matching) {\n const context = { instance, component: grant.component, path: grant.path };\n if (contribution.items === undefined) {\n diagnostics.push(errorDiagnostic(DiagnosticCode.ContributionTypeMismatch, `The saved value of '${grant.path}' set by '${instance}' is ignored: a collection takes items.`, context));\n continue;\n }\n\n if (contribution.replaceOwnerItems === true) {\n if (!grant.operations.includes(CollectionOperation.Replace)) {\n diagnostics.push(errorDiagnostic(\n DiagnosticCode.ContributionOperationNotPermitted,\n `'${instance}' replaces the items it inherits in '${grant.path}', but replacing items is not exposed. It is ignored and kept.`,\n context));\n continue;\n }\n\n items.splice(0, items.length);\n contributed = true;\n }\n\n if (contribution.items.length > 0 && !grant.operations.includes(CollectionOperation.Add)) {\n diagnostics.push(errorDiagnostic(\n DiagnosticCode.ContributionOperationNotPermitted,\n `'${instance}' has items in '${grant.path}', but adding items is not exposed. They are ignored and kept.`,\n context));\n continue;\n }\n\n for (const item of contribution.items) {\n const itemContext = { ...context, itemId: item.id };\n if (items.some(existing => existing.id === item.id)) {\n diagnostics.push(errorDiagnostic(DiagnosticCode.DuplicateCollectionItem, `The item id '${item.id}' in '${grant.path}' is already used.`, itemContext));\n continue;\n }\n\n const values: Record<string, unknown> = {};\n for (const [field, value] of Object.entries(item.values)) {\n if (grant.editableFields !== undefined && !grant.editableFields.includes(field)) {\n diagnostics.push(errorDiagnostic(DiagnosticCode.ContributionOperationNotPermitted, `The field '${field}' of '${grant.path}' is not exposed for editing.`, itemContext));\n continue;\n }\n\n const problem = validateItemValues(grant.descriptor.item, { [field]: value }).find(candidate => candidate.field === field);\n if (problem) {\n diagnostics.push(errorDiagnostic(\n problem.problem.startsWith('is not a field') ? DiagnosticCode.UnknownCollectionField : DiagnosticCode.ContributionTypeMismatch,\n `The field '${field}' of an item in '${grant.path}' is ignored: ${problem.problem}.`,\n itemContext));\n continue;\n }\n\n values[field] = value;\n }\n\n items.push({ id: item.id, values, origin: instance, fixed: false });\n contributed = true;\n }\n }\n\n return contributed;\n}\n\n/**\n * Resolves what every configurable component in a template chain is worth: the owner's own values, with each\n * instance's contributions applied in nesting order.\n *\n * This is the one merge. The editor shows its result and the runtime renders from it, so what an author sees is\n * what Play renders. Order is fixed: the owner's value first, then each level from the outermost inwards, so a\n * later level wins a scalar and appends to a collection after the earlier ones.\n *\n * Nothing in the persisted data is changed. A contribution that cannot apply - the exposure was withdrawn, the\n * property's type changed, the component is gone - is reported in `diagnostics` and left out of the result, and\n * stays in `instanceContributions`, so restoring the exposure brings its value back.\n *\n * @param templateChain The nesting, from {@link resolveTemplateChain} or built by hand.\n * @param instanceContributions What each instance has set.\n * @param catalog The descriptors saying what each component supports.\n */\nexport function resolveEffectiveConfiguration(\n templateChain: TemplateChain,\n instanceContributions: InstanceContribution[],\n catalog: DescriptorCatalog,\n): EffectiveConfiguration {\n const grants = computeExposureGrants(templateChain, catalog);\n const diagnostics: SceneDiagnostic[] = [...templateChain.diagnostics, ...grants.diagnostics];\n const handled = new Set<InstanceContribution>();\n const components = new Map<string, EffectiveComponentConfiguration>();\n\n for (const grant of grants.exposed) {\n const owner = templateChain.levels[grant.ownerLevel];\n const element = owner.elements.find(candidate => candidate.id === grant.component)!;\n\n let configuration = components.get(grant.component);\n if (!configuration) {\n configuration = { component: grant.component, owner: owner.owner, properties: cloneData(element.properties), values: [] };\n components.set(grant.component, configuration);\n }\n\n const stored = getValueAtPath(element.properties, grant.path);\n const base = stored === undefined ? cloneData(grant.descriptor.default) : cloneData(stored);\n const isCollection = grant.descriptor.valueType === PropertyValueType.Collection;\n const baseItems = isCollection && Array.isArray(base) ? base.map(toEffectiveItem) : [];\n const items = [...baseItems];\n\n const current: EffectivePropertyValue = {\n path: grant.path,\n value: base,\n source: stored === undefined ? ValueSource.Default : ValueSource.Local,\n inheritedValue: base,\n };\n let contributed = false;\n\n for (let index = grant.ownerLevel + 1; index < templateChain.levels.length; index++) {\n const instance = templateChain.levels[index].instance;\n if (!grants.byInstance.get(instance)?.has(grantKey(grant.component, grant.path))) continue;\n\n const effectiveGrant = grants.byInstance.get(instance)!.get(grantKey(grant.component, grant.path))!;\n const matching = instanceContributions.filter(contribution =>\n contribution.instance === instance && contribution.component === grant.component && contribution.path === grant.path);\n for (const contribution of matching) handled.add(contribution);\n\n if (isCollection) {\n if (collectionValue(effectiveGrant, matching, instance, items, diagnostics)) {\n contributed = true;\n current.contributedBy = instance;\n }\n } else {\n scalarValue(effectiveGrant, matching, instance, current, diagnostics);\n }\n }\n\n const maximumItems = grant.descriptor.constraints?.maximumItems;\n if (isCollection && maximumItems !== undefined && items.length > maximumItems) {\n // Saved items that no longer fit - the owner lowered the limit after they were added - are left out of\n // the result in order and kept in the saved data, like any other saved value that no longer fits.\n const dropped = items.splice(maximumItems);\n diagnostics.push(errorDiagnostic(\n DiagnosticCode.ContributionTypeMismatch,\n `'${grant.path}' on '${grant.component}' allows at most ${maximumItems} items; ${dropped.map(item => `'${item.id}'`).join(', ')} ${dropped.length === 1 ? 'is' : 'are'} ignored and kept.`,\n { instance: current.contributedBy ?? owner.instance, component: grant.component, path: grant.path }));\n }\n\n if (isCollection) {\n current.items = items;\n current.inheritedValue = baseItems.map(toFlatItem);\n current.value = items.map(toFlatItem);\n if (contributed) current.source = ValueSource.Instance;\n }\n\n if (current.value !== undefined) setValueAtPath(configuration.properties, grant.path, current.value);\n configuration.values.push(current);\n }\n\n const levelOf = new Map(templateChain.levels.map((chainLevel, index) => [chainLevel.instance, index]));\n for (const contribution of instanceContributions) {\n const contributorLevel = levelOf.get(contribution.instance);\n if (contributorLevel === undefined || handled.has(contribution)) continue;\n\n const context = { instance: contribution.instance, component: contribution.component, path: contribution.path };\n const owner = templateChain.levels.slice(0, contributorLevel).find(chainLevel => chainLevel.elements.some(element => element.id === contribution.component));\n if (!owner) {\n diagnostics.push(errorDiagnostic(\n DiagnosticCode.ContributionTargetMissing,\n `'${contribution.instance}' has saved values for '${contribution.component}', which is not in any layout or template above it. They are kept.`,\n context));\n } else if (!findComponentDescriptor(catalog, owner.elements.find(element => element.id === contribution.component)!.componentName)) {\n diagnostics.push(errorDiagnostic(\n DiagnosticCode.MissingComponentDescriptor,\n `'${contribution.instance}' has saved values for '${contribution.component}', but nothing describes that component any more. They are kept.`,\n context));\n } else {\n diagnostics.push(errorDiagnostic(\n DiagnosticCode.ContributionNotExposed,\n `'${contribution.instance}' has a saved value for '${contribution.path}' on '${contribution.component}', which is not exposed to it. It is ignored and kept.`,\n context));\n }\n }\n\n return { components: [...components.values()], diagnostics };\n}\n"],"names":["toEffectiveItem","item","index","id","values","length","origin","fixed","toFlatItem","scalarValue","grant","matching","instance","current","diagnostics","contribution","problem","value","undefined","validateValue","descriptor","push","errorDiagnostic","DiagnosticCode","ContributionTypeMismatch","path","component","source","ValueSource","Instance","contributedBy","collectionValue","items","contributed","context","replaceOwnerItems","operations","includes","CollectionOperation","Replace","ContributionOperationNotPermitted","splice","Add","itemContext","itemId","some","existing","DuplicateCollectionItem","field","Object","entries","editableFields","validateItemValues","find","candidate","startsWith","UnknownCollectionField","resolveEffectiveConfiguration","templateChain","instanceContributions","catalog","grants","computeExposureGrants","handled","Set","components","Map","exposed","owner","levels","ownerLevel","element","elements","configuration","get","properties","cloneData","set","stored","getValueAtPath","base","default","isCollection","valueType","PropertyValueType","Collection","baseItems","Array","isArray","map","Default","Local","inheritedValue","byInstance","has","grantKey","effectiveGrant","filter","add","maximumItems","constraints","dropped","join","setValueAtPath","levelOf","chainLevel","contributorLevel","slice","ContributionTargetMissing","findComponentDescriptor","componentName","MissingComponentDescriptor","ContributionNotExposed"],"mappings":";;;;;;;AAAA;AACA;AAaA;;AAEC,IACD,SAASA,eAAAA,CAAgBC,IAAa,EAAEC,KAAa,EAAA;AACjD,IAAA,MAAM,EAAEC,EAAE,EAAE,GAAGC,MAAAA,EAAQ,GAAIH,IAAAA,KAAS,IAAA,IAAQ,OAAOA,IAAAA,KAAS,QAAA,GAAWA,IAAAA,GAAO,EAAC;IAC/E,OAAO;QAAEE,EAAAA,EAAI,OAAOA,EAAAA,KAAO,QAAA,IAAYA,EAAAA,CAAGE,MAAM,GAAG,CAAA,GAAIF,EAAAA,GAAK,CAAC,MAAM,EAAED,KAAAA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AE+B,UAAAA,EAAY;AAAIA,YAAAA,GAAAA,UAAAA,CAAW7D,MAAM;AAAG,SAAA;AAAEU,QAAAA;AAAY,KAAA;AAC/D;;"}
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAGA,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAA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AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kCAAkC,CAAC;AACjD,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -58,6 +58,13 @@ export { NavigationDiagnosticCode } from './navigation/NavigationDiagnosticCode.
|
|
|
58
58
|
export { diagnoseNavigation } from './navigation/diagnoseNavigation.js';
|
|
59
59
|
export { navigationEntriesFrom } from './navigation/navigationEntriesFrom.js';
|
|
60
60
|
export { authoredRouteKey, navigationTarget } from './navigation/navigationRoute.js';
|
|
61
|
+
export { applicationItems, collectItemIds, findModuleNavigation, findNavigationRegion, modeOfModuleRegion, navigationRegionOrder, primarySlot } from './navigation/navigationRegions.js';
|
|
62
|
+
export { NavigationItemOrigin } from './navigation/NavigationItemOrigin.js';
|
|
63
|
+
export { NavigationSourcesKind } from './navigation/NavigationSourcesKind.js';
|
|
64
|
+
export { effectiveNavigation } from './navigation/effectiveNavigation.js';
|
|
65
|
+
export { diagnoseNavigationRegions } from './navigation/diagnoseNavigationRegions.js';
|
|
66
|
+
export { NavigationEditKind } from './navigation/NavigationEditKind.js';
|
|
67
|
+
export { addNavItem, applyNavigationEdits, setApplicationLogo, switchRegionMode } from './navigation/navigationEdits.js';
|
|
61
68
|
export { validateNavigationDestinations } from './validateNavigationDestinations.js';
|
|
62
69
|
export { errorDiagnostic, hasErrors, warningDiagnostic } from './editing/diagnostics.js';
|
|
63
70
|
export { dialogTemplateNodeId, elementNodeId, flowNodeId, freeformNodeId, layoutNodeId, ownerArrangementId, placementNodeId, scopeInstanceId, scopeNodeId, screenNodeId, screenTemplateNodeId, slotNodeId } from './editing/nodeIds.js';
|
|
@@ -90,4 +97,10 @@ export { describeSampleDataCatalog, generatedSampleDataName, sampleDataLabelSepa
|
|
|
90
97
|
export { findDescriptorSampleRowLiterals, findSampleRowLiterals, findTemplateSampleRowLiterals } from './sampleData/findSampleRowLiterals.js';
|
|
91
98
|
export { StructureDiagnosticCode } from './structure/StructureDiagnosticCode.js';
|
|
92
99
|
export { ApplicationStructureIndex } from './structure/ApplicationStructureIndex.js';
|
|
100
|
+
export { ToolbarDiagnosticCode } from './toolbar/ToolbarDiagnosticCode.js';
|
|
101
|
+
export { ToolbarDiagnosticSeverity } from './toolbar/ToolbarDiagnosticSeverity.js';
|
|
102
|
+
export { SliceDialogSource } from './toolbar/SliceDialogSource.js';
|
|
103
|
+
export { defaultSliceDialogTemplate, sliceDialogFor } from './toolbar/sliceDialogFor.js';
|
|
104
|
+
export { normalizeToolbarButton, resolveToolbarButton, toolbarButtonFromItem } from './toolbar/toolbarButtons.js';
|
|
105
|
+
export { validateToolbarButtons } from './toolbar/validateToolbarButtons.js';
|
|
93
106
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NavigationItemOrigin } from './NavigationItemOrigin';
|
|
2
|
+
import { ResolvedNavigationTarget } from './ResolvedNavigationTarget';
|
|
3
|
+
export interface EffectiveNavItem {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
slot: string;
|
|
8
|
+
target?: ResolvedNavigationTarget;
|
|
9
|
+
origin: NavigationItemOrigin;
|
|
10
|
+
readOnly: boolean;
|
|
11
|
+
reason: string;
|
|
12
|
+
children?: EffectiveNavItem[];
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=EffectiveNavItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EffectiveNavItem.d.ts","sourceRoot":"","sources":["../../../navigation/EffectiveNavItem.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAKtE,MAAM,WAAW,gBAAgB;IAE7B,EAAE,EAAE,MAAM,CAAC;IAGX,KAAK,EAAE,MAAM,CAAC;IAGd,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,IAAI,EAAE,MAAM,CAAC;IAGb,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAGlC,MAAM,EAAE,oBAAoB,CAAC;IAG7B,QAAQ,EAAE,OAAO,CAAC;IAGlB,MAAM,EAAE,MAAM,CAAC;IAGf,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EffectiveNavItem.js","sourceRoot":"","sources":["../../../navigation/EffectiveNavItem.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NavigationRegionKind, NavigationRegionMode } from '@cratis/scene.model';
|
|
2
|
+
import { EffectiveNavItem } from './EffectiveNavItem';
|
|
3
|
+
import { NavigationSources } from './NavigationSources';
|
|
4
|
+
export interface EffectiveNavigationRegion {
|
|
5
|
+
region: NavigationRegionKind;
|
|
6
|
+
module?: string;
|
|
7
|
+
mode?: NavigationRegionMode;
|
|
8
|
+
sources: NavigationSources;
|
|
9
|
+
items: EffectiveNavItem[];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=EffectiveNavigationRegion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EffectiveNavigationRegion.d.ts","sourceRoot":"","sources":["../../../navigation/EffectiveNavigationRegion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAKxD,MAAM,WAAW,yBAAyB;IAEtC,MAAM,EAAE,oBAAoB,CAAC;IAG7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAG5B,OAAO,EAAE,iBAAiB,CAAC;IAG3B,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EffectiveNavigationRegion.js","sourceRoot":"","sources":["../../../navigation/EffectiveNavigationRegion.ts"],"names":[],"mappings":""}
|
|
@@ -4,6 +4,11 @@ export declare enum NavigationDiagnosticCode {
|
|
|
4
4
|
MissingOutlet = "missingOutlet",
|
|
5
5
|
IncompatibleOutlet = "incompatibleOutlet",
|
|
6
6
|
NavigationCycle = "navigationCycle",
|
|
7
|
-
UnavailableTarget = "unavailableTarget"
|
|
7
|
+
UnavailableTarget = "unavailableTarget",
|
|
8
|
+
NavTargetMissing = "navTargetMissing",
|
|
9
|
+
NavSlotUnknown = "navSlotUnknown",
|
|
10
|
+
NavDuplicateId = "navDuplicateId",
|
|
11
|
+
NavModuleWithoutFeatures = "navModuleWithoutFeatures",
|
|
12
|
+
NavTargetOutOfScope = "navTargetOutOfScope"
|
|
8
13
|
}
|
|
9
14
|
//# sourceMappingURL=NavigationDiagnosticCode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationDiagnosticCode.d.ts","sourceRoot":"","sources":["../../../navigation/NavigationDiagnosticCode.ts"],"names":[],"mappings":"AAOA,oBAAY,wBAAwB;IAEhC,cAAc,mBAAmB;IAGjC,eAAe,oBAAoB;IAGnC,aAAa,kBAAkB;IAG/B,kBAAkB,uBAAuB;IAGzC,eAAe,oBAAoB;IAGnC,iBAAiB,sBAAsB;
|
|
1
|
+
{"version":3,"file":"NavigationDiagnosticCode.d.ts","sourceRoot":"","sources":["../../../navigation/NavigationDiagnosticCode.ts"],"names":[],"mappings":"AAOA,oBAAY,wBAAwB;IAEhC,cAAc,mBAAmB;IAGjC,eAAe,oBAAoB;IAGnC,aAAa,kBAAkB;IAG/B,kBAAkB,uBAAuB;IAGzC,eAAe,oBAAoB;IAGnC,iBAAiB,sBAAsB;IAGvC,gBAAgB,qBAAqB;IAGrC,cAAc,mBAAmB;IAGjC,cAAc,mBAAmB;IAGjC,wBAAwB,6BAA6B;IAGrD,mBAAmB,wBAAwB;CAC9C"}
|
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
/** A destination names an outlet that cannot host what it opens. */ NavigationDiagnosticCode["IncompatibleOutlet"] = "incompatibleOutlet";
|
|
11
11
|
/** Screens are placed in outlets owned by each other, so composition never terminates. */ NavigationDiagnosticCode["NavigationCycle"] = "navigationCycle";
|
|
12
12
|
/** A destination opens a screen or dialog that does not exist, or names nothing to open. */ NavigationDiagnosticCode["UnavailableTarget"] = "unavailableTarget";
|
|
13
|
+
/** A navigation item has no target, or targets a module or feature the application does not have. */ NavigationDiagnosticCode["NavTargetMissing"] = "navTargetMissing";
|
|
14
|
+
/** A navigation item renders into a slot the layout does not declare. */ NavigationDiagnosticCode["NavSlotUnknown"] = "navSlotUnknown";
|
|
15
|
+
/** Two navigation items of one region share an id. */ NavigationDiagnosticCode["NavDuplicateId"] = "navDuplicateId";
|
|
16
|
+
/** A navigation item targets a module that has no feature to go to. */ NavigationDiagnosticCode["NavModuleWithoutFeatures"] = "navModuleWithoutFeatures";
|
|
17
|
+
/** A module's own navigation item targets a different module. */ NavigationDiagnosticCode["NavTargetOutOfScope"] = "navTargetOutOfScope";
|
|
13
18
|
return NavigationDiagnosticCode;
|
|
14
19
|
}({});
|
|
15
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationDiagnosticCode.js","sources":["../../../navigation/NavigationDiagnosticCode.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 * What is wrong with a navigation destination. The values are shared with the C# engine so both report\n * the same code for the same model.\n */\nexport enum NavigationDiagnosticCode {\n /** Two destinations that go to different targets share one URL. */\n DuplicateRoute = 'duplicateRoute',\n\n /** Two surfaces declare an outlet with the same name, so a destination cannot tell them apart. */\n DuplicateOutlet = 'duplicateOutlet',\n\n /** A destination names an outlet that no layout or screen template declares. */\n MissingOutlet = 'missingOutlet',\n\n /** A destination names an outlet that cannot host what it opens. */\n IncompatibleOutlet = 'incompatibleOutlet',\n\n /** Screens are placed in outlets owned by each other, so composition never terminates. */\n NavigationCycle = 'navigationCycle',\n\n /** A destination opens a screen or dialog that does not exist, or names nothing to open. */\n UnavailableTarget = 'unavailableTarget',\n}\n"],"names":["NavigationDiagnosticCode"],"mappings":"AAAA;AACA;AAEA;;;IAIO,IAAKA,wBAAAA,iBAAAA,SAAAA,wBAAAA,EAAAA;wEACyD,wBAAA,CAAA,gBAAA,CAAA,GAAA,gBAAA;uGAG+B,wBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAA;qFAGlB,wBAAA,CAAA,eAAA,CAAA,GAAA,eAAA;yEAGZ,wBAAA,CAAA,oBAAA,CAAA,GAAA,oBAAA;+FAGsB,wBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAA;iGAGE,wBAAA,CAAA,mBAAA,CAAA,GAAA,mBAAA;
|
|
1
|
+
{"version":3,"file":"NavigationDiagnosticCode.js","sources":["../../../navigation/NavigationDiagnosticCode.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 * What is wrong with a navigation destination. The values are shared with the C# engine so both report\n * the same code for the same model.\n */\nexport enum NavigationDiagnosticCode {\n /** Two destinations that go to different targets share one URL. */\n DuplicateRoute = 'duplicateRoute',\n\n /** Two surfaces declare an outlet with the same name, so a destination cannot tell them apart. */\n DuplicateOutlet = 'duplicateOutlet',\n\n /** A destination names an outlet that no layout or screen template declares. */\n MissingOutlet = 'missingOutlet',\n\n /** A destination names an outlet that cannot host what it opens. */\n IncompatibleOutlet = 'incompatibleOutlet',\n\n /** Screens are placed in outlets owned by each other, so composition never terminates. */\n NavigationCycle = 'navigationCycle',\n\n /** A destination opens a screen or dialog that does not exist, or names nothing to open. */\n UnavailableTarget = 'unavailableTarget',\n\n /** A navigation item has no target, or targets a module or feature the application does not have. */\n NavTargetMissing = 'navTargetMissing',\n\n /** A navigation item renders into a slot the layout does not declare. */\n NavSlotUnknown = 'navSlotUnknown',\n\n /** Two navigation items of one region share an id. */\n NavDuplicateId = 'navDuplicateId',\n\n /** A navigation item targets a module that has no feature to go to. */\n NavModuleWithoutFeatures = 'navModuleWithoutFeatures',\n\n /** A module's own navigation item targets a different module. */\n NavTargetOutOfScope = 'navTargetOutOfScope',\n}\n"],"names":["NavigationDiagnosticCode"],"mappings":"AAAA;AACA;AAEA;;;IAIO,IAAKA,wBAAAA,iBAAAA,SAAAA,wBAAAA,EAAAA;wEACyD,wBAAA,CAAA,gBAAA,CAAA,GAAA,gBAAA;uGAG+B,wBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAA;qFAGlB,wBAAA,CAAA,eAAA,CAAA,GAAA,eAAA;yEAGZ,wBAAA,CAAA,oBAAA,CAAA,GAAA,oBAAA;+FAGsB,wBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAA;iGAGE,wBAAA,CAAA,mBAAA,CAAA,GAAA,mBAAA;0GAGS,wBAAA,CAAA,kBAAA,CAAA,GAAA,kBAAA;8EAG5B,wBAAA,CAAA,gBAAA,CAAA,GAAA,gBAAA;2DAGnB,wBAAA,CAAA,gBAAA,CAAA,GAAA,gBAAA;4EAGiB,wBAAA,CAAA,0BAAA,CAAA,GAAA,0BAAA;sEAGN,wBAAA,CAAA,qBAAA,CAAA,GAAA,qBAAA;AA/BvDA,IAAAA,OAAAA,wBAAAA;AAiCX,CAAA,CAAA,EAAA;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApplicationLogo, NavigationRegionKind, NavigationRegionMode, NavItem } from '@cratis/scene.model';
|
|
2
|
+
import { NavigationEditKind } from './NavigationEditKind';
|
|
3
|
+
export interface NavigationEdit {
|
|
4
|
+
kind: NavigationEditKind;
|
|
5
|
+
module?: string;
|
|
6
|
+
region?: NavigationRegionKind;
|
|
7
|
+
mode?: NavigationRegionMode;
|
|
8
|
+
items?: NavItem[];
|
|
9
|
+
parent?: string;
|
|
10
|
+
item?: NavItem;
|
|
11
|
+
logo?: ApplicationLogo;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=NavigationEdit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationEdit.d.ts","sourceRoot":"","sources":["../../../navigation/NavigationEdit.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAO1D,MAAM,WAAW,cAAc;IAE3B,IAAI,EAAE,kBAAkB,CAAC;IAGzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAG9B,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAG5B,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;IAGlB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,IAAI,CAAC,EAAE,OAAO,CAAC;IAGf,IAAI,CAAC,EAAE,eAAe,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationEdit.js","sourceRoot":"","sources":["../../../navigation/NavigationEdit.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationEditKind.d.ts","sourceRoot":"","sources":["../../../navigation/NavigationEditKind.ts"],"names":[],"mappings":"AAMA,oBAAY,kBAAkB;IAE1B,aAAa,kBAAkB;IAG/B,cAAc,mBAAmB;IAGjC,OAAO,YAAY;IAGnB,OAAO,YAAY;CACtB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/**
|
|
4
|
+
* What a navigation edit does. The values are shared with the C# engine.
|
|
5
|
+
*/ var NavigationEditKind = /*#__PURE__*/ function(NavigationEditKind) {
|
|
6
|
+
/** Sets how a module's region relates to the application's. */ NavigationEditKind["SetRegionMode"] = "setRegionMode";
|
|
7
|
+
/** Replaces the items a level holds in a region. */ NavigationEditKind["SetRegionItems"] = "setRegionItems";
|
|
8
|
+
/** Adds an item, or a sub-item, after the ones already there. */ NavigationEditKind["AddItem"] = "addItem";
|
|
9
|
+
/** Sets the application logo. */ NavigationEditKind["SetLogo"] = "setLogo";
|
|
10
|
+
return NavigationEditKind;
|
|
11
|
+
}({});
|
|
12
|
+
|
|
13
|
+
export { NavigationEditKind };
|
|
14
|
+
//# sourceMappingURL=NavigationEditKind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationEditKind.js","sources":["../../../navigation/NavigationEditKind.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 * What a navigation edit does. The values are shared with the C# engine.\n */\nexport enum NavigationEditKind {\n /** Sets how a module's region relates to the application's. */\n SetRegionMode = 'setRegionMode',\n\n /** Replaces the items a level holds in a region. */\n SetRegionItems = 'setRegionItems',\n\n /** Adds an item, or a sub-item, after the ones already there. */\n AddItem = 'addItem',\n\n /** Sets the application logo. */\n SetLogo = 'setLogo',\n}\n"],"names":["NavigationEditKind"],"mappings":"AAAA;AACA;AAEA;;IAGO,IAAKA,kBAAAA,iBAAAA,SAAAA,kBAAAA,EAAAA;oEACqD,kBAAA,CAAA,eAAA,CAAA,GAAA,eAAA;yDAGX,kBAAA,CAAA,gBAAA,CAAA,GAAA,gBAAA;sEAGa,kBAAA,CAAA,SAAA,CAAA,GAAA,SAAA;sCAGhC,kBAAA,CAAA,SAAA,CAAA,GAAA,SAAA;AAVvBA,IAAAA,OAAAA,kBAAAA;AAYX,CAAA,CAAA,EAAA;;"}
|