@cratis/scene.react 4.19.0 → 4.21.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/NavBar/extractNavigationItem.ts +13 -3
- package/core/CoreToolbar.tsx +153 -0
- package/core/coreComponents.ts +3 -0
- package/core/corePackage.ts +2 -0
- package/core/index.ts +1 -0
- package/dist/cjs/NavBar/extractNavigationItem.js +12 -3
- package/dist/cjs/NavBar/extractNavigationItem.js.map +1 -1
- package/dist/cjs/core/CoreToolbar.js +183 -0
- package/dist/cjs/core/CoreToolbar.js.map +1 -0
- package/dist/cjs/core/coreComponents.js +4 -1
- package/dist/cjs/core/coreComponents.js.map +1 -1
- package/dist/cjs/core/corePackage.js +3 -1
- package/dist/cjs/core/corePackage.js.map +1 -1
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/packages/loadApprovedPackages.js +122 -0
- package/dist/cjs/packages/loadApprovedPackages.js.map +1 -0
- package/dist/esm/NavBar/extractNavigationItem.d.ts.map +1 -1
- package/dist/esm/NavBar/extractNavigationItem.js +12 -3
- package/dist/esm/NavBar/extractNavigationItem.js.map +1 -1
- package/dist/esm/core/CoreToolbar.d.ts +8 -0
- package/dist/esm/core/CoreToolbar.d.ts.map +1 -0
- package/dist/esm/core/CoreToolbar.js +178 -0
- package/dist/esm/core/CoreToolbar.js.map +1 -0
- package/dist/esm/core/coreComponents.d.ts.map +1 -1
- package/dist/esm/core/coreComponents.js +4 -1
- package/dist/esm/core/coreComponents.js.map +1 -1
- package/dist/esm/core/corePackage.d.ts.map +1 -1
- package/dist/esm/core/corePackage.js +3 -1
- package/dist/esm/core/corePackage.js.map +1 -1
- package/dist/esm/core/index.d.ts +1 -0
- package/dist/esm/core/index.d.ts.map +1 -1
- package/dist/esm/core/index.js +1 -0
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/packages/ApprovedPackageSet.d.ts +16 -0
- package/dist/esm/packages/ApprovedPackageSet.d.ts.map +1 -0
- package/dist/esm/packages/ApprovedPackageSet.js +2 -0
- package/dist/esm/packages/ApprovedPackageSet.js.map +1 -0
- package/dist/esm/packages/index.d.ts +2 -0
- package/dist/esm/packages/index.d.ts.map +1 -1
- package/dist/esm/packages/index.js +2 -0
- package/dist/esm/packages/index.js.map +1 -1
- package/dist/esm/packages/loadApprovedPackages.d.ts +18 -0
- package/dist/esm/packages/loadApprovedPackages.d.ts.map +1 -0
- package/dist/esm/packages/loadApprovedPackages.js +119 -0
- package/dist/esm/packages/loadApprovedPackages.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/packages/ApprovedPackageSet.ts +37 -0
- package/packages/index.ts +2 -0
- package/packages/loadApprovedPackages.ts +143 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var PackageHostConfiguration = require('./PackageHostConfiguration.js');
|
|
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
|
+
* Loads the runtime bundles of an approved package set through the host's importers.
|
|
9
|
+
*
|
|
10
|
+
* Nothing executes unless the host's policy allows executable imports. A package whose module cannot be imported,
|
|
11
|
+
* lacks its declared export, or whose bundle manifest differs from the declaration (name, version, components,
|
|
12
|
+
* layouts, templates, themes) contributes nothing and is reported - the declaration planning used and the code
|
|
13
|
+
* running must be the same package. Packages load in ordinal name order, so the result does not depend on the
|
|
14
|
+
* order the set was written in.
|
|
15
|
+
*/ async function loadApprovedPackages(set, importers, policy) {
|
|
16
|
+
const bundles = [];
|
|
17
|
+
const diagnostics = [];
|
|
18
|
+
const ordered = [
|
|
19
|
+
...set.packages
|
|
20
|
+
].sort((a, b)=>a.manifest.name < b.manifest.name ? -1 : a.manifest.name > b.manifest.name ? 1 : 0);
|
|
21
|
+
for (const { manifest, module } of ordered){
|
|
22
|
+
const label = `Package '${manifest.name}'`;
|
|
23
|
+
if (!policy.allowExecutableImports) {
|
|
24
|
+
diagnostics.push(`${label} brings executable code from '${module.npm}', but host policy forbids executable imports`);
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
const importer = Object.prototype.hasOwnProperty.call(importers, module.npm) ? importers[module.npm] : undefined;
|
|
28
|
+
if (!importer) {
|
|
29
|
+
diagnostics.push(`${label} is imported from '${module.npm}', which this host's build does not include`);
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
let loaded;
|
|
33
|
+
try {
|
|
34
|
+
loaded = await importer();
|
|
35
|
+
} catch (error) {
|
|
36
|
+
diagnostics.push(`${label} could not be loaded from '${module.npm}': ${error instanceof Error ? error.message : String(error)}`);
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const bundle = loaded[module.export];
|
|
40
|
+
if (!bundle || typeof bundle !== 'object' || !bundle.manifest || !bundle.components) {
|
|
41
|
+
diagnostics.push(`${label} expects '${module.npm}' to export a package bundle named '${module.export}', which it does not`);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const mismatches = declarationMismatches(manifest, bundle);
|
|
45
|
+
if (mismatches.length > 0) {
|
|
46
|
+
diagnostics.push(...mismatches.map((mismatch)=>`${label} does not match the bundle '${module.export}' of '${module.npm}': ${mismatch}`));
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
bundles.push(bundle);
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
bundles,
|
|
53
|
+
diagnostics
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function declarationMismatches(declared, bundle) {
|
|
57
|
+
const actual = bundle.manifest;
|
|
58
|
+
const mismatches = [];
|
|
59
|
+
if (actual.name !== declared.name) mismatches.push(`the bundle is named '${actual.name}'`);
|
|
60
|
+
if (actual.version !== declared.version) mismatches.push(`the set declares version ${declared.version} but the bundle is ${actual.version}`);
|
|
61
|
+
if (actual.kind !== declared.kind) mismatches.push(`the set declares kind ${declared.kind} but the bundle is ${actual.kind}`);
|
|
62
|
+
const lists = [
|
|
63
|
+
'components',
|
|
64
|
+
'layouts',
|
|
65
|
+
'screenTemplates',
|
|
66
|
+
'dialogTemplates',
|
|
67
|
+
'themes'
|
|
68
|
+
];
|
|
69
|
+
for (const list of lists){
|
|
70
|
+
const expected = [
|
|
71
|
+
...declared[list] ?? []
|
|
72
|
+
].sort();
|
|
73
|
+
const found = [
|
|
74
|
+
...actual[list] ?? []
|
|
75
|
+
].sort();
|
|
76
|
+
if (expected.join('\u0000') !== found.join('\u0000')) {
|
|
77
|
+
mismatches.push(`the set declares ${list} [${expected.join(', ')}] but the bundle declares [${found.join(', ')}]`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return mismatches;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Loads the approved package set and resolves the effective profile over the built-in and approved bundles in one
|
|
84
|
+
* step. Packages that failed to load are reported in the result's `diagnostics` and block the host, so a profile
|
|
85
|
+
* is never rendered with a silently missing package.
|
|
86
|
+
*/ async function resolveApprovedPackageHost(configuration) {
|
|
87
|
+
const { packageSet, importers, ...rest } = configuration;
|
|
88
|
+
const loaded = await loadApprovedPackages(packageSet, importers, configuration.policy);
|
|
89
|
+
const host = PackageHostConfiguration.resolvePackageHost({
|
|
90
|
+
...rest,
|
|
91
|
+
bundles: [
|
|
92
|
+
...configuration.bundles,
|
|
93
|
+
...loaded.bundles
|
|
94
|
+
]
|
|
95
|
+
});
|
|
96
|
+
if (loaded.diagnostics.length === 0) {
|
|
97
|
+
return host;
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
...host,
|
|
101
|
+
bundles: [],
|
|
102
|
+
components: {},
|
|
103
|
+
layouts: [],
|
|
104
|
+
screenTemplates: [],
|
|
105
|
+
dialogTemplates: [],
|
|
106
|
+
themes: [],
|
|
107
|
+
layout: undefined,
|
|
108
|
+
theme: undefined,
|
|
109
|
+
templates: [],
|
|
110
|
+
assets: [],
|
|
111
|
+
fonts: [],
|
|
112
|
+
blocked: true,
|
|
113
|
+
diagnostics: [
|
|
114
|
+
...loaded.diagnostics,
|
|
115
|
+
...host.diagnostics
|
|
116
|
+
]
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
exports.loadApprovedPackages = loadApprovedPackages;
|
|
121
|
+
exports.resolveApprovedPackageHost = resolveApprovedPackageHost;
|
|
122
|
+
//# sourceMappingURL=loadApprovedPackages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadApprovedPackages.js","sources":["../../../packages/loadApprovedPackages.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 { ApprovedPackageSet } from './ApprovedPackageSet';\nimport { PackageHostConfiguration, ResolvedPackageHost, resolvePackageHost } from './PackageHostConfiguration';\nimport { ScenePackageBundle } from './ScenePackageBundle';\n\n/**\n * How a host loads the modules of an approved package set: one loader per npm package name the set may import.\n *\n * A bundler resolves imports at build time, so the host lists them as literal `import()` calls\n * (`{ '@acme/scene.charts': () => import('@acme/scene.charts') }`). A set naming a module the host's build does\n * not include is a diagnostic, never an attempt to load an arbitrary specifier.\n */\nexport type ApprovedPackageImporters = Record<string, () => Promise<Record<string, unknown>>>;\n\n/** The outcome of loading an approved package set. */\nexport interface LoadedApprovedPackages {\n /** The bundles that loaded and match what the set declared, in ordinal package-name order. */\n bundles: ScenePackageBundle[];\n\n /** Every reason a package was not loaded or does not match its declaration. */\n diagnostics: string[];\n}\n\n/**\n * Loads the runtime bundles of an approved package set through the host's importers.\n *\n * Nothing executes unless the host's policy allows executable imports. A package whose module cannot be imported,\n * lacks its declared export, or whose bundle manifest differs from the declaration (name, version, components,\n * layouts, templates, themes) contributes nothing and is reported - the declaration planning used and the code\n * running must be the same package. Packages load in ordinal name order, so the result does not depend on the\n * order the set was written in.\n */\nexport async function loadApprovedPackages(\n set: ApprovedPackageSet,\n importers: ApprovedPackageImporters,\n policy: { allowExecutableImports: boolean },\n): Promise<LoadedApprovedPackages> {\n const bundles: ScenePackageBundle[] = [];\n const diagnostics: string[] = [];\n const ordered = [...set.packages].sort((a, b) => (a.manifest.name < b.manifest.name ? -1 : a.manifest.name > b.manifest.name ? 1 : 0));\n\n for (const { manifest, module } of ordered) {\n const label = `Package '${manifest.name}'`;\n if (!policy.allowExecutableImports) {\n diagnostics.push(`${label} brings executable code from '${module.npm}', but host policy forbids executable imports`);\n continue;\n }\n\n const importer = Object.prototype.hasOwnProperty.call(importers, module.npm) ? importers[module.npm] : undefined;\n if (!importer) {\n diagnostics.push(`${label} is imported from '${module.npm}', which this host's build does not include`);\n continue;\n }\n\n let loaded: Record<string, unknown>;\n try {\n loaded = await importer();\n } catch (error) {\n diagnostics.push(`${label} could not be loaded from '${module.npm}': ${error instanceof Error ? error.message : String(error)}`);\n continue;\n }\n\n const bundle = loaded[module.export] as ScenePackageBundle | undefined;\n if (!bundle || typeof bundle !== 'object' || !bundle.manifest || !bundle.components) {\n diagnostics.push(`${label} expects '${module.npm}' to export a package bundle named '${module.export}', which it does not`);\n continue;\n }\n\n const mismatches = declarationMismatches(manifest, bundle);\n if (mismatches.length > 0) {\n diagnostics.push(...mismatches.map(mismatch => `${label} does not match the bundle '${module.export}' of '${module.npm}': ${mismatch}`));\n continue;\n }\n\n bundles.push(bundle);\n }\n\n return { bundles, diagnostics };\n}\n\nfunction declarationMismatches(declared: ApprovedPackageSet['packages'][number]['manifest'], bundle: ScenePackageBundle): string[] {\n const actual = bundle.manifest;\n const mismatches: string[] = [];\n if (actual.name !== declared.name) mismatches.push(`the bundle is named '${actual.name}'`);\n if (actual.version !== declared.version) mismatches.push(`the set declares version ${declared.version} but the bundle is ${actual.version}`);\n if (actual.kind !== declared.kind) mismatches.push(`the set declares kind ${declared.kind} but the bundle is ${actual.kind}`);\n\n const lists = ['components', 'layouts', 'screenTemplates', 'dialogTemplates', 'themes'] as const;\n for (const list of lists) {\n const expected = [...(declared[list] ?? [])].sort();\n const found = [...(actual[list] ?? [])].sort();\n if (expected.join('\\u0000') !== found.join('\\u0000')) {\n mismatches.push(`the set declares ${list} [${expected.join(', ')}] but the bundle declares [${found.join(', ')}]`);\n }\n }\n\n return mismatches;\n}\n\n/** An approved package set and the importers that load it, resolved together with the built-in bundles. */\nexport interface ApprovedPackageHostConfiguration extends Omit<PackageHostConfiguration, 'bundles'> {\n /** The bundles the host ships. */\n bundles: ScenePackageBundle[];\n\n /** The custom packages the host approved. */\n packageSet: ApprovedPackageSet;\n\n /** The importers for the set's modules. */\n importers: ApprovedPackageImporters;\n}\n\n/**\n * Loads the approved package set and resolves the effective profile over the built-in and approved bundles in one\n * step. Packages that failed to load are reported in the result's `diagnostics` and block the host, so a profile\n * is never rendered with a silently missing package.\n */\nexport async function resolveApprovedPackageHost(configuration: ApprovedPackageHostConfiguration): Promise<ResolvedPackageHost> {\n const { packageSet, importers, ...rest } = configuration;\n const loaded = await loadApprovedPackages(packageSet, importers, configuration.policy);\n const host = resolvePackageHost({ ...rest, bundles: [...configuration.bundles, ...loaded.bundles] });\n if (loaded.diagnostics.length === 0) {\n return host;\n }\n\n return {\n ...host,\n bundles: [],\n components: {},\n layouts: [],\n screenTemplates: [],\n dialogTemplates: [],\n themes: [],\n layout: undefined,\n theme: undefined,\n templates: [],\n assets: [],\n fonts: [],\n blocked: true,\n diagnostics: [...loaded.diagnostics, ...host.diagnostics],\n };\n}\n"],"names":["loadApprovedPackages","set","importers","policy","bundles","diagnostics","ordered","packages","sort","a","b","manifest","name","module","label","allowExecutableImports","push","npm","importer","Object","prototype","hasOwnProperty","call","undefined","loaded","error","Error","message","String","bundle","export","components","mismatches","declarationMismatches","length","map","mismatch","declared","actual","version","kind","lists","list","expected","found","join","resolveApprovedPackageHost","configuration","packageSet","rest","host","resolvePackageHost","layouts","screenTemplates","dialogTemplates","themes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AOnB,WAAW;AAAK6C,YAAAA,GAAAA,IAAAA,CAAK7C;AAAY;AAC7D,KAAA;AACJ;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractNavigationItem.d.ts","sourceRoot":"","sources":["../../../NavBar/extractNavigationItem.ts"],"names":[],"mappings":"AAGA,OAAO,EAAqB,YAAY,
|
|
1
|
+
{"version":3,"file":"extractNavigationItem.d.ts","sourceRoot":"","sources":["../../../NavBar/extractNavigationItem.ts"],"names":[],"mappings":"AAGA,OAAO,EAAqB,YAAY,EAA2C,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAe/H,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,YAAY,GAAG,cAAc,GAAG,SAAS,CAuB5F"}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Reads a {@link NavigationItem} out of a {@link Contribution} to the built-in `Navigation` contribution
|
|
5
5
|
* point. `Contribution.content` carries an {@link ExternalComponent} whose open `properties` bag holds the
|
|
6
|
-
* navigation-specific values (`label`, `targetScreen`, `routeParameterBindings`, `order`, `group
|
|
6
|
+
* navigation-specific values (`label`, `targetScreen`, `routeParameterBindings`, `order`, `group`, and the
|
|
7
|
+
* optional `id`, `icon`, `presentation`, `destination` and `hierarchy`) - the
|
|
7
8
|
* same names as {@link NavigationItem}'s own fields. This property-bag contract is Scene#2's own choice,
|
|
8
9
|
* made without a real Screenplay-to-Scene translation to confirm it against (Stage#37 hasn't been built
|
|
9
10
|
* yet) - whoever builds that seam should either produce contributions matching this contract or this
|
|
@@ -16,18 +17,26 @@
|
|
|
16
17
|
if (!content.properties) {
|
|
17
18
|
return undefined;
|
|
18
19
|
}
|
|
19
|
-
const { label, targetScreen, routeParameterBindings, order, group } = content.properties;
|
|
20
|
+
const { id, label, icon, presentation, targetScreen, routeParameterBindings, destination, order, group, hierarchy } = content.properties;
|
|
20
21
|
if (typeof label !== 'string' || typeof targetScreen !== 'string') {
|
|
21
22
|
return undefined;
|
|
22
23
|
}
|
|
23
24
|
return {
|
|
25
|
+
id: typeof id === 'string' ? id : undefined,
|
|
24
26
|
label,
|
|
27
|
+
icon: typeof icon === 'string' ? icon : undefined,
|
|
28
|
+
presentation: typeof presentation === 'string' ? presentation : undefined,
|
|
25
29
|
targetScreen,
|
|
26
30
|
routeParameterBindings: isBindingExpressionRecord(routeParameterBindings) ? routeParameterBindings : {},
|
|
27
31
|
order: typeof order === 'number' ? order : contribution.order,
|
|
28
|
-
|
|
32
|
+
destination: isDestination(destination) ? destination : undefined,
|
|
33
|
+
group: typeof group === 'string' ? group : undefined,
|
|
34
|
+
hierarchy: Array.isArray(hierarchy) ? hierarchy.filter((part)=>typeof part === 'string') : undefined
|
|
29
35
|
};
|
|
30
36
|
}
|
|
37
|
+
function isDestination(value) {
|
|
38
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
39
|
+
}
|
|
31
40
|
function isBindingExpressionRecord(value) {
|
|
32
41
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
33
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractNavigationItem.js","sources":["../../../NavBar/extractNavigationItem.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { BindingExpression, Contribution, ExternalComponent, NavigationItem } from '@cratis/scene.model';\n\n/**\n * Reads a {@link NavigationItem} out of a {@link Contribution} to the built-in `Navigation` contribution\n * point. `Contribution.content` carries an {@link ExternalComponent} whose open `properties` bag holds the\n * navigation-specific values (`label`, `targetScreen`, `routeParameterBindings`, `order`, `group`) - the\n * same names as {@link NavigationItem}'s own fields. This property-bag contract is Scene#2's own choice,\n * made without a real Screenplay-to-Scene translation to confirm it against (Stage#37 hasn't been built\n * yet) - whoever builds that seam should either produce contributions matching this contract or this\n * function should move to match whatever Stage#37 actually emits.\n *\n * @param contribution The contribution to read.\n * @returns The extracted {@link NavigationItem}, or `undefined` when `contribution.content` isn't an {@link ExternalComponent} or is missing a required property.\n */\nexport function extractNavigationItem(contribution: Contribution): NavigationItem | undefined {\n const content = contribution.content as Partial<ExternalComponent>;\n if (!content.properties) {\n return undefined;\n }\n\n const { label, targetScreen, routeParameterBindings, order, group } = content.properties as Record<string, unknown>;\n if (typeof label !== 'string' || typeof targetScreen !== 'string') {\n return undefined;\n }\n\n return {\n label,\n targetScreen,\n routeParameterBindings: isBindingExpressionRecord(routeParameterBindings) ? routeParameterBindings : {},\n order: typeof order === 'number' ? order : contribution.order,\n group: typeof group === 'string' ? group : undefined,\n };\n}\n\nfunction isBindingExpressionRecord(value: unknown): value is Record<string, BindingExpression> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"],"names":["extractNavigationItem","contribution","content","properties","undefined","label","targetScreen","routeParameterBindings","order","group","isBindingExpressionRecord","
|
|
1
|
+
{"version":3,"file":"extractNavigationItem.js","sources":["../../../NavBar/extractNavigationItem.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { BindingExpression, Contribution, DestinationReference, ExternalComponent, NavigationItem } from '@cratis/scene.model';\n\n/**\n * Reads a {@link NavigationItem} out of a {@link Contribution} to the built-in `Navigation` contribution\n * point. `Contribution.content` carries an {@link ExternalComponent} whose open `properties` bag holds the\n * navigation-specific values (`label`, `targetScreen`, `routeParameterBindings`, `order`, `group`, and the\n * optional `id`, `icon`, `presentation`, `destination` and `hierarchy`) - the\n * same names as {@link NavigationItem}'s own fields. This property-bag contract is Scene#2's own choice,\n * made without a real Screenplay-to-Scene translation to confirm it against (Stage#37 hasn't been built\n * yet) - whoever builds that seam should either produce contributions matching this contract or this\n * function should move to match whatever Stage#37 actually emits.\n *\n * @param contribution The contribution to read.\n * @returns The extracted {@link NavigationItem}, or `undefined` when `contribution.content` isn't an {@link ExternalComponent} or is missing a required property.\n */\nexport function extractNavigationItem(contribution: Contribution): NavigationItem | undefined {\n const content = contribution.content as Partial<ExternalComponent>;\n if (!content.properties) {\n return undefined;\n }\n\n const { id, label, icon, presentation, targetScreen, routeParameterBindings, destination, order, group, hierarchy } = content.properties as Record<string, unknown>;\n if (typeof label !== 'string' || typeof targetScreen !== 'string') {\n return undefined;\n }\n\n return {\n id: typeof id === 'string' ? id : undefined,\n label,\n icon: typeof icon === 'string' ? icon : undefined,\n presentation: typeof presentation === 'string' ? presentation : undefined,\n targetScreen,\n routeParameterBindings: isBindingExpressionRecord(routeParameterBindings) ? routeParameterBindings : {},\n order: typeof order === 'number' ? order : contribution.order,\n destination: isDestination(destination) ? destination : undefined,\n group: typeof group === 'string' ? group : undefined,\n hierarchy: Array.isArray(hierarchy) ? hierarchy.filter((part): part is string => typeof part === 'string') : undefined,\n };\n}\n\nfunction isDestination(value: unknown): value is DestinationReference {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isBindingExpressionRecord(value: unknown): value is Record<string, BindingExpression> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"],"names":["extractNavigationItem","contribution","content","properties","undefined","id","label","icon","presentation","targetScreen","routeParameterBindings","destination","order","group","hierarchy","isBindingExpressionRecord","isDestination","Array","isArray","filter","part","value"],"mappings":"AAAA;AACA;AAIA;;;;;;;;;;;;IAaO,SAASA,qBAAAA,CAAsBC,YAA0B,EAAA;IAC5D,MAAMC,OAAAA,GAAUD,aAAaC,OAAO;IACpC,IAAI,CAACA,OAAAA,CAAQC,UAAU,EAAE;QACrB,OAAOC,SAAAA;AACX,IAAA;IAEA,MAAM,EAAEC,EAAE,EAAEC,KAAK,EAAEC,IAAI,EAAEC,YAAY,EAAEC,YAAY,EAAEC,sBAAsB,EAAEC,WAAW,EAAEC,KAAK,EAAEC,KAAK,EAAEC,SAAS,EAAE,GAAGZ,OAAAA,CAAQC,UAAU;AACxI,IAAA,IAAI,OAAOG,KAAAA,KAAU,QAAA,IAAY,OAAOG,iBAAiB,QAAA,EAAU;QAC/D,OAAOL,SAAAA;AACX,IAAA;IAEA,OAAO;QACHC,EAAAA,EAAI,OAAOA,EAAAA,KAAO,QAAA,GAAWA,EAAAA,GAAKD,SAAAA;AAClCE,QAAAA,KAAAA;QACAC,IAAAA,EAAM,OAAOA,IAAAA,KAAS,QAAA,GAAWA,IAAAA,GAAOH,SAAAA;QACxCI,YAAAA,EAAc,OAAOA,YAAAA,KAAiB,QAAA,GAAWA,YAAAA,GAAeJ,SAAAA;AAChEK,QAAAA,YAAAA;QACAC,sBAAAA,EAAwBK,yBAAAA,CAA0BL,sBAAAA,CAAAA,GAA0BA,sBAAAA,GAAyB,EAAC;AACtGE,QAAAA,KAAAA,EAAO,OAAOA,KAAAA,KAAU,QAAA,GAAWA,KAAAA,GAAQX,aAAaW,KAAK;QAC7DD,WAAAA,EAAaK,aAAAA,CAAcL,eAAeA,WAAAA,GAAcP,SAAAA;QACxDS,KAAAA,EAAO,OAAOA,KAAAA,KAAU,QAAA,GAAWA,KAAAA,GAAQT,SAAAA;QAC3CU,SAAAA,EAAWG,KAAAA,CAAMC,OAAO,CAACJ,SAAAA,CAAAA,GAAaA,SAAAA,CAAUK,MAAM,CAAC,CAACC,IAAAA,GAAyB,OAAOA,IAAAA,KAAS,QAAA,CAAA,GAAYhB;AACjH,KAAA;AACJ;AAEA,SAASY,cAAcK,KAAc,EAAA;IACjC,OAAO,OAAOA,UAAU,QAAA,IAAYA,KAAAA,KAAU,QAAQ,CAACJ,KAAAA,CAAMC,OAAO,CAACG,KAAAA,CAAAA;AACzE;AAEA,SAASN,0BAA0BM,KAAc,EAAA;IAC7C,OAAO,OAAOA,UAAU,QAAA,IAAYA,KAAAA,KAAU,QAAQ,CAACJ,KAAAA,CAAMC,OAAO,CAACG,KAAAA,CAAAA;AACzE;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DestinationReference } from '@cratis/scene.model';
|
|
2
|
+
import { RegisteredComponentProps } from '../renderer';
|
|
3
|
+
export type ToolbarItemMode = 'icon' | 'text' | 'both';
|
|
4
|
+
export declare function toolbarItemMode(presentation: Record<string, unknown>): ToolbarItemMode;
|
|
5
|
+
export declare function toolbarItemDestination(properties: Record<string, unknown>): DestinationReference | undefined;
|
|
6
|
+
export declare function CoreToolbar({ element, slots }: RegisteredComponentProps): import("react").JSX.Element;
|
|
7
|
+
export declare function CoreToolbarItem({ element }: RegisteredComponentProps): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=CoreToolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoreToolbar.d.ts","sourceRoot":"","sources":["../../../core/CoreToolbar.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAyD,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAClH,OAAO,EAAE,wBAAwB,EAAyB,MAAM,aAAa,CAAC;AAI9E,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AA+CvD,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,eAAe,CAGtF;AAQD,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,oBAAoB,GAAG,SAAS,CAW5G;AAMD,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,wBAAwB,+BAGvE;AAcD,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE,wBAAwB,+BAkDpE"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useContext } from 'react';
|
|
3
|
+
import { resolveBindingExpression } from '@cratis/scene.engine';
|
|
4
|
+
import { DestinationKind, BindingSourceKind } from '@cratis/scene.model';
|
|
5
|
+
import { useRenderBindingScope } from '../renderer/RenderBindingScopeContext.js';
|
|
6
|
+
import '../interactions/useInteractions.js';
|
|
7
|
+
import '../interactions/NotificationHost.js';
|
|
8
|
+
import { SceneNavigationContextInternal } from '../navigation/SceneNavigationContext.js';
|
|
9
|
+
|
|
10
|
+
function textProperty(properties, name) {
|
|
11
|
+
return typeof properties[name] === 'string' ? properties[name] : undefined;
|
|
12
|
+
}
|
|
13
|
+
function recordProperty(properties, name) {
|
|
14
|
+
const value = properties[name];
|
|
15
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
|
16
|
+
}
|
|
17
|
+
function isDestination(value) {
|
|
18
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value)) return false;
|
|
19
|
+
return [
|
|
20
|
+
'screen',
|
|
21
|
+
'module',
|
|
22
|
+
'route',
|
|
23
|
+
'dialog',
|
|
24
|
+
'outlet'
|
|
25
|
+
].some((key)=>typeof value[key] === 'string');
|
|
26
|
+
}
|
|
27
|
+
function isBinding(value) {
|
|
28
|
+
return value !== null && typeof value === 'object' && typeof value.path === 'string';
|
|
29
|
+
}
|
|
30
|
+
function literal(value) {
|
|
31
|
+
return {
|
|
32
|
+
kind: BindingSourceKind.Literal,
|
|
33
|
+
path: '',
|
|
34
|
+
value
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function resolveParameters(parameters, scope) {
|
|
38
|
+
return Object.fromEntries(Object.entries(parameters).map(([name, binding])=>[
|
|
39
|
+
name,
|
|
40
|
+
isBinding(binding) ? resolveBindingExpression(binding, scope) : binding
|
|
41
|
+
]));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* An authored destination with its route parameters read now, against the scope the item renders in.
|
|
45
|
+
*
|
|
46
|
+
* A navigation host resolves a destination against its own scope, which cannot see what the screen's components
|
|
47
|
+
* publish - a table's selected row, an input's value - so the item resolves them where it is, and hands the host
|
|
48
|
+
* literals. (The renderer leaves a destination's bindings alone, unlike the rest of an element's properties.)
|
|
49
|
+
*/ function withResolvedParameters(destination, scope) {
|
|
50
|
+
const bindings = destination.routeParameterBindings;
|
|
51
|
+
if (!bindings) return destination;
|
|
52
|
+
return {
|
|
53
|
+
...destination,
|
|
54
|
+
routeParameterBindings: Object.fromEntries(Object.entries(bindings).map(([name, binding])=>[
|
|
55
|
+
name,
|
|
56
|
+
literal(resolveBindingExpression(binding, scope))
|
|
57
|
+
]))
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/** The mode the item's authored presentation asks for; anything it does not name shows both. */ function toolbarItemMode(presentation) {
|
|
61
|
+
const mode = presentation.mode;
|
|
62
|
+
return mode === 'icon' || mode === 'text' ? mode : 'both';
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Where activating a toolbar item goes.
|
|
66
|
+
*
|
|
67
|
+
* The destination the document authored wins. Without one, a `Navigate` item opens its target screen - its
|
|
68
|
+
* parameters become route parameter bindings - and a `Dialog` item opens its target dialog template.
|
|
69
|
+
*/ function toolbarItemDestination(properties) {
|
|
70
|
+
if (isDestination(properties.destination)) return properties.destination;
|
|
71
|
+
const kind = textProperty(properties, 'kind')?.toLowerCase();
|
|
72
|
+
const target = textProperty(properties, 'target');
|
|
73
|
+
if (!target) return undefined;
|
|
74
|
+
// The renderer has already read each parameter's binding by the time the item sees it, so a parameter is a value.
|
|
75
|
+
const routeParameterBindings = Object.fromEntries(Object.entries(recordProperty(properties, 'parameters')).map(([name, value])=>[
|
|
76
|
+
name,
|
|
77
|
+
literal(value)
|
|
78
|
+
]));
|
|
79
|
+
if (kind === 'navigate') return {
|
|
80
|
+
screen: target,
|
|
81
|
+
routeParameterBindings
|
|
82
|
+
};
|
|
83
|
+
if (kind === 'dialog') return {
|
|
84
|
+
kind: DestinationKind.Dialog,
|
|
85
|
+
dialog: target,
|
|
86
|
+
routeParameterBindings
|
|
87
|
+
};
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The `core:toolbar` component: the items a screen's toolbar groups, in the order they were authored.
|
|
92
|
+
* The items are `core:toolbarItem` elements in its `items` slot.
|
|
93
|
+
*/ function CoreToolbar({ element, slots }) {
|
|
94
|
+
const name = textProperty(element.properties, 'name');
|
|
95
|
+
return /*#__PURE__*/ jsx("div", {
|
|
96
|
+
"data-scene-id": element.id,
|
|
97
|
+
"data-scene-toolbar": name,
|
|
98
|
+
role: "toolbar",
|
|
99
|
+
"aria-label": name,
|
|
100
|
+
children: slots.items
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The `core:toolbarItem` component: one toolbar entry with a label, an icon, presentation hints and what it does.
|
|
105
|
+
*
|
|
106
|
+
* - An `Action` item announces the command it targets with the host-neutral `cratis.scene.command` event, carrying its
|
|
107
|
+
* parameters resolved against the binding scope.
|
|
108
|
+
* - A `Navigate` or `Dialog` item executes its destination through the enclosing navigation host - a screen in an
|
|
109
|
+
* outlet, a dialog - and, outside one, announces it with the host-neutral `cratis.scene.navigate` event.
|
|
110
|
+
*
|
|
111
|
+
* Presentation: `mode` is `icon`, `text` or `both` (the default); an icon-only item keeps its label as its accessible name.
|
|
112
|
+
* Every presentation hint - `placement`, `density` or whatever a package reads - is also carried on the node as a
|
|
113
|
+
* `data-scene-presentation-<name>` attribute so a theme can style by it.
|
|
114
|
+
*/ function CoreToolbarItem({ element }) {
|
|
115
|
+
const navigation = useContext(SceneNavigationContextInternal);
|
|
116
|
+
const scope = useRenderBindingScope();
|
|
117
|
+
const name = textProperty(element.properties, 'name') ?? element.id;
|
|
118
|
+
const kind = textProperty(element.properties, 'kind')?.toLowerCase();
|
|
119
|
+
const target = textProperty(element.properties, 'target') ?? '';
|
|
120
|
+
const label = textProperty(element.properties, 'label') ?? name;
|
|
121
|
+
const icon = textProperty(element.properties, 'icon');
|
|
122
|
+
const presentation = recordProperty(element.properties, 'presentation');
|
|
123
|
+
const mode = toolbarItemMode(presentation);
|
|
124
|
+
const destination = toolbarItemDestination(element.properties);
|
|
125
|
+
const attributes = Object.fromEntries(Object.entries(presentation).filter(([key])=>/^[A-Za-z][A-Za-z0-9-]*$/.test(key)).map(([key, value])=>[
|
|
126
|
+
`data-scene-presentation-${key.toLowerCase()}`,
|
|
127
|
+
String(value)
|
|
128
|
+
]));
|
|
129
|
+
const activate = ()=>{
|
|
130
|
+
if (kind === 'action') {
|
|
131
|
+
const args = resolveParameters(recordProperty(element.properties, 'parameters'), scope);
|
|
132
|
+
globalThis.dispatchEvent(new CustomEvent('cratis.scene.command', {
|
|
133
|
+
detail: {
|
|
134
|
+
command: target,
|
|
135
|
+
element,
|
|
136
|
+
arguments: args
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (!destination) return;
|
|
142
|
+
const resolved = withResolvedParameters(destination, scope);
|
|
143
|
+
if (navigation) {
|
|
144
|
+
navigation.navigate(resolved);
|
|
145
|
+
} else {
|
|
146
|
+
globalThis.dispatchEvent(new CustomEvent('cratis.scene.navigate', {
|
|
147
|
+
detail: {
|
|
148
|
+
targetScreen: destination.screen ?? '',
|
|
149
|
+
dialog: destination.dialog,
|
|
150
|
+
destination: resolved,
|
|
151
|
+
element
|
|
152
|
+
}
|
|
153
|
+
}));
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
return /*#__PURE__*/ jsxs("button", {
|
|
157
|
+
type: "button",
|
|
158
|
+
"data-scene-id": element.id,
|
|
159
|
+
"data-scene-toolbar-item": name,
|
|
160
|
+
"data-scene-icon": icon,
|
|
161
|
+
"data-scene-mode": mode,
|
|
162
|
+
"aria-label": mode === 'icon' ? label : undefined,
|
|
163
|
+
title: mode === 'icon' ? label : undefined,
|
|
164
|
+
disabled: kind !== 'action' && !destination,
|
|
165
|
+
onClick: activate,
|
|
166
|
+
...attributes,
|
|
167
|
+
children: [
|
|
168
|
+
mode !== 'text' && icon && /*#__PURE__*/ jsx("span", {
|
|
169
|
+
"aria-hidden": "true",
|
|
170
|
+
"data-scene-icon-name": icon
|
|
171
|
+
}),
|
|
172
|
+
mode !== 'icon' && label
|
|
173
|
+
]
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export { CoreToolbar, CoreToolbarItem, toolbarItemDestination, toolbarItemMode };
|
|
178
|
+
//# sourceMappingURL=CoreToolbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoreToolbar.js","sources":["../../../core/CoreToolbar.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 { useContext } from 'react';\nimport { BindingScope, resolveBindingExpression } from '@cratis/scene.engine';\nimport { BindingExpression, BindingSourceKind, DestinationKind, DestinationReference } from '@cratis/scene.model';\nimport { RegisteredComponentProps, useRenderBindingScope } from '../renderer';\nimport { SceneNavigationContextInternal } from '../navigation/SceneNavigationContext';\n\n/** How a toolbar item shows its icon and label - the `mode` an item's presentation hint can name. */\nexport type ToolbarItemMode = 'icon' | 'text' | 'both';\n\nfunction textProperty(properties: Record<string, unknown>, name: string): string | undefined {\n return typeof properties[name] === 'string' ? properties[name] : undefined;\n}\n\nfunction recordProperty(properties: Record<string, unknown>, name: string): Record<string, unknown> {\n const value = properties[name];\n return value !== null && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {};\n}\n\nfunction isDestination(value: unknown): value is DestinationReference {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) return false;\n return ['screen', 'module', 'route', 'dialog', 'outlet'].some(key => typeof (value as Record<string, unknown>)[key] === 'string');\n}\n\nfunction isBinding(value: unknown): value is BindingExpression {\n return value !== null && typeof value === 'object' && typeof (value as BindingExpression).path === 'string';\n}\n\nfunction literal(value: unknown): BindingExpression {\n return { kind: BindingSourceKind.Literal, path: '', value } as BindingExpression;\n}\n\nfunction resolveParameters(parameters: Record<string, unknown>, scope: BindingScope): Record<string, unknown> {\n return Object.fromEntries(Object.entries(parameters).map(([name, binding]) =>\n [name, isBinding(binding) ? resolveBindingExpression(binding, scope) : binding]));\n}\n\n/**\n * An authored destination with its route parameters read now, against the scope the item renders in.\n *\n * A navigation host resolves a destination against its own scope, which cannot see what the screen's components\n * publish - a table's selected row, an input's value - so the item resolves them where it is, and hands the host\n * literals. (The renderer leaves a destination's bindings alone, unlike the rest of an element's properties.)\n */\nfunction withResolvedParameters(destination: DestinationReference, scope: BindingScope): DestinationReference {\n const bindings = destination.routeParameterBindings;\n if (!bindings) return destination;\n return {\n ...destination,\n routeParameterBindings: Object.fromEntries(Object.entries(bindings).map(([name, binding]) =>\n [name, literal(resolveBindingExpression(binding, scope))])),\n };\n}\n\n/** The mode the item's authored presentation asks for; anything it does not name shows both. */\nexport function toolbarItemMode(presentation: Record<string, unknown>): ToolbarItemMode {\n const mode = presentation.mode;\n return mode === 'icon' || mode === 'text' ? mode : 'both';\n}\n\n/**\n * Where activating a toolbar item goes.\n *\n * The destination the document authored wins. Without one, a `Navigate` item opens its target screen - its\n * parameters become route parameter bindings - and a `Dialog` item opens its target dialog template.\n */\nexport function toolbarItemDestination(properties: Record<string, unknown>): DestinationReference | undefined {\n if (isDestination(properties.destination)) return properties.destination;\n const kind = textProperty(properties, 'kind')?.toLowerCase();\n const target = textProperty(properties, 'target');\n if (!target) return undefined;\n // The renderer has already read each parameter's binding by the time the item sees it, so a parameter is a value.\n const routeParameterBindings = Object.fromEntries(Object.entries(recordProperty(properties, 'parameters'))\n .map(([name, value]) => [name, literal(value)])) as Record<string, BindingExpression>;\n if (kind === 'navigate') return { screen: target, routeParameterBindings };\n if (kind === 'dialog') return { kind: DestinationKind.Dialog, dialog: target, routeParameterBindings };\n return undefined;\n}\n\n/**\n * The `core:toolbar` component: the items a screen's toolbar groups, in the order they were authored.\n * The items are `core:toolbarItem` elements in its `items` slot.\n */\nexport function CoreToolbar({ element, slots }: RegisteredComponentProps) {\n const name = textProperty(element.properties, 'name');\n return <div data-scene-id={element.id} data-scene-toolbar={name} role='toolbar' aria-label={name}>{slots.items}</div>;\n}\n\n/**\n * The `core:toolbarItem` component: one toolbar entry with a label, an icon, presentation hints and what it does.\n *\n * - An `Action` item announces the command it targets with the host-neutral `cratis.scene.command` event, carrying its\n * parameters resolved against the binding scope.\n * - A `Navigate` or `Dialog` item executes its destination through the enclosing navigation host - a screen in an\n * outlet, a dialog - and, outside one, announces it with the host-neutral `cratis.scene.navigate` event.\n *\n * Presentation: `mode` is `icon`, `text` or `both` (the default); an icon-only item keeps its label as its accessible name.\n * Every presentation hint - `placement`, `density` or whatever a package reads - is also carried on the node as a\n * `data-scene-presentation-<name>` attribute so a theme can style by it.\n */\nexport function CoreToolbarItem({ element }: RegisteredComponentProps) {\n const navigation = useContext(SceneNavigationContextInternal);\n const scope = useRenderBindingScope();\n const name = textProperty(element.properties, 'name') ?? element.id;\n const kind = textProperty(element.properties, 'kind')?.toLowerCase();\n const target = textProperty(element.properties, 'target') ?? '';\n const label = textProperty(element.properties, 'label') ?? name;\n const icon = textProperty(element.properties, 'icon');\n const presentation = recordProperty(element.properties, 'presentation');\n const mode = toolbarItemMode(presentation);\n const destination = toolbarItemDestination(element.properties);\n const attributes = Object.fromEntries(Object.entries(presentation)\n .filter(([key]) => /^[A-Za-z][A-Za-z0-9-]*$/.test(key))\n .map(([key, value]) => [`data-scene-presentation-${key.toLowerCase()}`, String(value)]));\n\n const activate = () => {\n if (kind === 'action') {\n const args = resolveParameters(recordProperty(element.properties, 'parameters'), scope);\n globalThis.dispatchEvent(new CustomEvent('cratis.scene.command', { detail: { command: target, element, arguments: args } }));\n return;\n }\n\n if (!destination) return;\n const resolved = withResolvedParameters(destination, scope);\n if (navigation) {\n navigation.navigate(resolved);\n } else {\n globalThis.dispatchEvent(new CustomEvent('cratis.scene.navigate', {\n detail: { targetScreen: destination.screen ?? '', dialog: destination.dialog, destination: resolved, element },\n }));\n }\n };\n\n return (\n <button\n type='button'\n data-scene-id={element.id}\n data-scene-toolbar-item={name}\n data-scene-icon={icon}\n data-scene-mode={mode}\n aria-label={mode === 'icon' ? label : undefined}\n title={mode === 'icon' ? label : undefined}\n disabled={kind !== 'action' && !destination}\n onClick={activate}\n {...attributes}\n >\n {mode !== 'text' && icon && <span aria-hidden='true' data-scene-icon-name={icon} />}\n {mode !== 'icon' && label}\n </button>\n );\n}\n"],"names":["textProperty","properties","name","undefined","recordProperty","value","Array","isArray","isDestination","some","key","isBinding","path","literal","kind","BindingSourceKind","Literal","resolveParameters","parameters","scope","Object","fromEntries","entries","map","binding","resolveBindingExpression","withResolvedParameters","destination","bindings","routeParameterBindings","toolbarItemMode","presentation","mode","toolbarItemDestination","toLowerCase","target","screen","DestinationKind","Dialog","dialog","CoreToolbar","element","slots","_jsx","div","data-scene-id","id","data-scene-toolbar","role","aria-label","items","CoreToolbarItem","navigation","useContext","SceneNavigationContextInternal","useRenderBindingScope","label","icon","attributes","filter","test","String","activate","args","globalThis","dispatchEvent","CustomEvent","detail","command","arguments","resolved","navigate","targetScreen","_jsxs","button","type","data-scene-toolbar-item","data-scene-icon","data-scene-mode","title","disabled","onClick","span","aria-hidden","data-scene-icon-name"],"mappings":";;;;;;;;;AAYA,SAASA,YAAAA,CAAaC,UAAmC,EAAEC,IAAY,EAAA;IACnE,OAAO,OAAOD,UAAU,CAACC,IAAAA,CAAK,KAAK,QAAA,GAAWD,UAAU,CAACC,IAAAA,CAAK,GAAGC,SAAAA;AACrE;AAEA,SAASC,cAAAA,CAAeH,UAAmC,EAAEC,IAAY,EAAA;IACrE,MAAMG,KAAAA,GAAQJ,UAAU,CAACC,IAAAA,CAAK;IAC9B,OAAOG,KAAAA,KAAU,IAAA,IAAQ,OAAOA,KAAAA,KAAU,QAAA,IAAY,CAACC,KAAAA,CAAMC,OAAO,CAACF,KAAAA,CAAAA,GAASA,KAAAA,GAAmC,EAAC;AACtH;AAEA,SAASG,cAAcH,KAAc,EAAA;IACjC,IAAIA,KAAAA,KAAU,QAAQ,OAAOA,KAAAA,KAAU,YAAYC,KAAAA,CAAMC,OAAO,CAACF,KAAAA,CAAAA,EAAQ,OAAO,KAAA;IAChF,OAAO;AAAC,QAAA,QAAA;AAAU,QAAA,QAAA;AAAU,Q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ACjH,aAAA,CAAA,CAAA;AACJ,QAAA;AACJ,IAAA,CAAA;AAEA,IAAA,qBACIgC,IAAA,CAACC,QAAAA,EAAAA;QACGC,IAAAA,EAAK,QAAA;AACL9B,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;QACzB8B,yBAAAA,EAAyB1E,IAAAA;QACzB2E,iBAAAA,EAAiBpB,IAAAA;QACjBqB,iBAAAA,EAAiB9C,IAAAA;QACjBiB,YAAAA,EAAYjB,IAAAA,KAAS,SAASwB,KAAAA,GAAQrD,SAAAA;QACtC4E,KAAAA,EAAO/C,IAAAA,KAAS,SAASwB,KAAAA,GAAQrD,SAAAA;QACjC6E,QAAAA,EAAUlE,IAAAA,KAAS,YAAY,CAACa,WAAAA;QAChCsD,OAAAA,EAASnB,QAAAA;AACR,QAAA,GAAGJ,UAAU;;YAEb1B,IAAAA,KAAS,MAAA,IAAUyB,sBAAQd,GAAA,CAACuC,MAAAA,EAAAA;gBAAKC,aAAAA,EAAY,MAAA;gBAAOC,sBAAAA,EAAsB3B;;AAC1EzB,YAAAA,IAAAA,KAAS,MAAA,IAAUwB;;;AAGhC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreComponents.d.ts","sourceRoot":"","sources":["../../../core/coreComponents.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"coreComponents.d.ts","sourceRoot":"","sources":["../../../core/coreComponents.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AA0BhD,eAAO,MAAM,cAAc,EAAE,iBAmB5B,CAAC"}
|
|
@@ -11,6 +11,7 @@ import { CoreText } from './CoreText.js';
|
|
|
11
11
|
import { CoreButton } from './CoreButton.js';
|
|
12
12
|
import { CoreCard } from './CoreCard.js';
|
|
13
13
|
import { CoreNavigationBar } from './CoreNavigationBar.js';
|
|
14
|
+
import { CoreToolbarItem, CoreToolbar } from './CoreToolbar.js';
|
|
14
15
|
import { CoreFile, CoreCode, CoreField, CoreSummary, CoreColumn, CoreTable, CoreTitle, CoreNavigate, CoreSection, CoreAction, CoreData } from './ScreenplayCoreComponents.js';
|
|
15
16
|
|
|
16
17
|
// Copyright (c) Cratis. All rights reserved.
|
|
@@ -34,7 +35,9 @@ import { CoreFile, CoreCode, CoreField, CoreSummary, CoreColumn, CoreTable, Core
|
|
|
34
35
|
[componentRegistryKey('core', 'code')]: CoreCode,
|
|
35
36
|
[componentRegistryKey('core', 'file')]: CoreFile,
|
|
36
37
|
[componentRegistryKey('core', 'navigationBar')]: CoreNavigationBar,
|
|
37
|
-
[componentRegistryKey('core', 'outlet')]: CoreOutlet
|
|
38
|
+
[componentRegistryKey('core', 'outlet')]: CoreOutlet,
|
|
39
|
+
[componentRegistryKey('core', 'toolbar')]: CoreToolbar,
|
|
40
|
+
[componentRegistryKey('core', 'toolbarItem')]: CoreToolbarItem
|
|
38
41
|
};
|
|
39
42
|
|
|
40
43
|
export { coreComponents };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreComponents.js","sources":["../../../core/coreComponents.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentRegistry } from '../renderer';\nimport { componentRegistryKey } from '../packages';\nimport { CoreText } from './CoreText';\nimport { CoreButton } from './CoreButton';\nimport { CoreCard } from './CoreCard';\nimport { CoreNavigationBar } from './CoreNavigationBar';\nimport { CoreOutlet } from '../navigation/CoreOutlet';\nimport {\n CoreAction,\n CoreCode,\n CoreColumn,\n CoreData,\n CoreField,\n CoreFile,\n CoreNavigate,\n CoreSection,\n CoreSummary,\n CoreTable,\n CoreTitle,\n} from './ScreenplayCoreComponents';\n\n/**\n * The `core` package's component registry - the final fallback every `ui profile` resolves against\n * regardless of which other packages it lists (Scene#3).\n */\nexport const coreComponents: ComponentRegistry = {\n [componentRegistryKey('core', 'text')]: CoreText,\n [componentRegistryKey('core', 'button')]: CoreButton,\n [componentRegistryKey('core', 'card')]: CoreCard,\n [componentRegistryKey('core', 'data')]: CoreData,\n [componentRegistryKey('core', 'action')]: CoreAction,\n [componentRegistryKey('core', 'section')]: CoreSection,\n [componentRegistryKey('core', 'navigate')]: CoreNavigate,\n [componentRegistryKey('core', 'title')]: CoreTitle,\n [componentRegistryKey('core', 'table')]: CoreTable,\n [componentRegistryKey('core', 'column')]: CoreColumn,\n [componentRegistryKey('core', 'summary')]: CoreSummary,\n [componentRegistryKey('core', 'field')]: CoreField,\n [componentRegistryKey('core', 'code')]: CoreCode,\n [componentRegistryKey('core', 'file')]: CoreFile,\n [componentRegistryKey('core', 'navigationBar')]: CoreNavigationBar,\n [componentRegistryKey('core', 'outlet')]: CoreOutlet,\n};\n"],"names":["coreComponents","componentRegistryKey","CoreText","CoreButton","CoreCard","CoreData","CoreAction","CoreSection","CoreNavigate","CoreTitle","CoreTable","CoreColumn","CoreSummary","CoreField","CoreCode","CoreFile","CoreNavigationBar","CoreOutlet"],"mappings":"
|
|
1
|
+
{"version":3,"file":"coreComponents.js","sources":["../../../core/coreComponents.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentRegistry } from '../renderer';\nimport { componentRegistryKey } from '../packages';\nimport { CoreText } from './CoreText';\nimport { CoreButton } from './CoreButton';\nimport { CoreCard } from './CoreCard';\nimport { CoreNavigationBar } from './CoreNavigationBar';\nimport { CoreToolbar, CoreToolbarItem } from './CoreToolbar';\nimport { CoreOutlet } from '../navigation/CoreOutlet';\nimport {\n CoreAction,\n CoreCode,\n CoreColumn,\n CoreData,\n CoreField,\n CoreFile,\n CoreNavigate,\n CoreSection,\n CoreSummary,\n CoreTable,\n CoreTitle,\n} from './ScreenplayCoreComponents';\n\n/**\n * The `core` package's component registry - the final fallback every `ui profile` resolves against\n * regardless of which other packages it lists (Scene#3).\n */\nexport const coreComponents: ComponentRegistry = {\n [componentRegistryKey('core', 'text')]: CoreText,\n [componentRegistryKey('core', 'button')]: CoreButton,\n [componentRegistryKey('core', 'card')]: CoreCard,\n [componentRegistryKey('core', 'data')]: CoreData,\n [componentRegistryKey('core', 'action')]: CoreAction,\n [componentRegistryKey('core', 'section')]: CoreSection,\n [componentRegistryKey('core', 'navigate')]: CoreNavigate,\n [componentRegistryKey('core', 'title')]: CoreTitle,\n [componentRegistryKey('core', 'table')]: CoreTable,\n [componentRegistryKey('core', 'column')]: CoreColumn,\n [componentRegistryKey('core', 'summary')]: CoreSummary,\n [componentRegistryKey('core', 'field')]: CoreField,\n [componentRegistryKey('core', 'code')]: CoreCode,\n [componentRegistryKey('core', 'file')]: CoreFile,\n [componentRegistryKey('core', 'navigationBar')]: CoreNavigationBar,\n [componentRegistryKey('core', 'outlet')]: CoreOutlet,\n [componentRegistryKey('core', 'toolbar')]: CoreToolbar,\n [componentRegistryKey('core', 'toolbarItem')]: CoreToolbarItem,\n};\n"],"names":["coreComponents","componentRegistryKey","CoreText","CoreButton","CoreCard","CoreData","CoreAction","CoreSection","CoreNavigate","CoreTitle","CoreTable","CoreColumn","CoreSummary","CoreField","CoreCode","CoreFile","CoreNavigationBar","CoreOutlet","CoreToolbar","CoreToolbarItem"],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AAwBA;;;UAIaA,cAAAA,GAAoC;IAC7C,CAACC,oBAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUC,QAAAA;IACxC,CAACD,oBAAAA,CAAqB,MAAA,EAAQ,QAAA,CAAA,GAAYE,UAAAA;IAC1C,CAACF,oBAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUG,QAAAA;IACxC,CAACH,oBAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUI,QAAAA;IACxC,CAACJ,oBAAAA,CAAqB,MAAA,EAAQ,QAAA,CAAA,GAAYK,UAAAA;IAC1C,CAACL,oBAAAA,CAAqB,MAAA,EAAQ,SAAA,CAAA,GAAaM,WAAAA;IAC3C,CAACN,oBAAAA,CAAqB,MAAA,EAAQ,UAAA,CAAA,GAAcO,YAAAA;IAC5C,CAACP,oBAAAA,CAAqB,MAAA,EAAQ,OAAA,CAAA,GAAWQ,SAAAA;IACzC,CAACR,oBAAAA,CAAqB,MAAA,EAAQ,OAAA,CAAA,GAAWS,SAAAA;IACzC,CAACT,oBAAAA,CAAqB,MAAA,EAAQ,QAAA,CAAA,GAAYU,UAAAA;IAC1C,CAACV,oBAAAA,CAAqB,MAAA,EAAQ,SAAA,CAAA,GAAaW,WAAAA;IAC3C,CAACX,oBAAAA,CAAqB,MAAA,EAAQ,OAAA,CAAA,GAAWY,SAAAA;IACzC,CAACZ,oBAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUa,QAAAA;IACxC,CAACb,oBAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUc,QAAAA;IACxC,CAACd,oBAAAA,CAAqB,MAAA,EAAQ,eAAA,CAAA,GAAmBe,iBAAAA;IACjD,CAACf,oBAAAA,CAAqB,MAAA,EAAQ,QAAA,CAAA,GAAYgB,UAAAA;IAC1C,CAAChB,oBAAAA,CAAqB,MAAA,EAAQ,SAAA,CAAA,GAAaiB,WAAAA;IAC3C,CAACjB,oBAAAA,CAAqB,MAAA,EAAQ,aAAA,CAAA,GAAiBkB;AACnD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corePackage.d.ts","sourceRoot":"","sources":["../../../core/corePackage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAWjD,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"corePackage.d.ts","sourceRoot":"","sources":["../../../core/corePackage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAWjD,eAAO,MAAM,mBAAmB,EAAE,YAkCjC,CAAC;AAKF,eAAO,MAAM,WAAW,EAAE,kBAIzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corePackage.js","sources":["../../../core/corePackage.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle } from '../packages';\nimport { coreComponents } from './coreComponents';\nimport { coreDescriptors } from './coreDescriptors';\n\n/**\n * The `core` package's declaration. Every other package is loaded by a host that reads its manifest;\n * `core` ships inside the renderer itself, because Scene#3 guarantees a bare name always has somewhere to\n * resolve regardless of which packages a profile lists. It is still declared the same way as any other -\n * a package picker should be able to show it, and the dependency resolver should be able to reason about\n * it, without a special case.\n */\nexport const corePackageManifest: ScenePackage = {\n name: 'core',\n version: '1.0.0',\n kind: PackageKind.ComponentLibrary,\n dependencies: [],\n components: [\n 'text',\n 'button',\n 'card',\n 'data',\n 'action',\n 'section',\n 'navigate',\n 'title',\n 'table',\n 'column',\n 'summary',\n 'field',\n 'code',\n 'file',\n 'navigationBar',\n 'outlet',\n ],\n layouts: [],\n screenTemplates: [],\n dialogTemplates: [],\n themes: [],\n displayName: 'Core',\n description: 'The built-in fallback vocabulary every ui profile resolves against.',\n module: '@cratis/scene.react',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n\n/**\n * The `core` package as a loadable bundle.\n */\nexport const corePackage: ScenePackageBundle = {\n manifest: corePackageManifest,\n components: coreComponents,\n descriptors: coreDescriptors,\n};\n"],"names":["corePackageManifest","name","version","kind","PackageKind","ComponentLibrary","dependencies","components","layouts","screenTemplates","dialogTemplates","themes","displayName","description","module","license","licenseUrl","corePackage","manifest","coreComponents","descriptors","coreDescriptors"],"mappings":";;;;AAAA;AACA;AAOA;;;;;;UAOaA,mBAAAA,GAAoC;IAC7CC,IAAAA,EAAM,MAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,YAAYC,gBAAgB;AAClCC,IAAAA,YAAAA,EAAc,EAAE;IAChBC,UAAAA,EAAY;AACR,QAAA,MAAA;AACA,QAAA,QAAA;AACA,QAAA,MAAA;AACA,QAAA,MAAA;AACA,QAAA,QAAA;AACA,QAAA,SAAA;AACA,QAAA,UAAA;AACA,QAAA,OAAA;AACA,QAAA,OAAA;AACA,QAAA,QAAA;AACA,QAAA,SAAA;AACA,QAAA,OAAA;AACA,QAAA,MAAA;AACA,QAAA,MAAA;AACA,QAAA,eAAA;AACA,QAAA;AACH,KAAA;AACDC,IAAAA,OAAAA,EAAS,EAAE;AACXC,IAAAA,eAAAA,EAAiB,EAAE;AACnBC,IAAAA,eAAAA,EAAiB,EAAE;AACnBC,IAAAA,MAAAA,EAAQ,EAAE;IACVC,WAAAA,EAAa,MAAA;IACbC,WAAAA,EAAa,qEAAA;IACbC,MAAAA,EAAQ,qBAAA;IACRC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;AAEA;;UAGaC,WAAAA,GAAkC;IAC3CC,QAAAA,EAAUlB,mBAAAA;IACVO,UAAAA,EAAYY,cAAAA;IACZC,WAAAA,EAAaC;AACjB;;"}
|
|
1
|
+
{"version":3,"file":"corePackage.js","sources":["../../../core/corePackage.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle } from '../packages';\nimport { coreComponents } from './coreComponents';\nimport { coreDescriptors } from './coreDescriptors';\n\n/**\n * The `core` package's declaration. Every other package is loaded by a host that reads its manifest;\n * `core` ships inside the renderer itself, because Scene#3 guarantees a bare name always has somewhere to\n * resolve regardless of which packages a profile lists. It is still declared the same way as any other -\n * a package picker should be able to show it, and the dependency resolver should be able to reason about\n * it, without a special case.\n */\nexport const corePackageManifest: ScenePackage = {\n name: 'core',\n version: '1.0.0',\n kind: PackageKind.ComponentLibrary,\n dependencies: [],\n components: [\n 'text',\n 'button',\n 'card',\n 'data',\n 'action',\n 'section',\n 'navigate',\n 'title',\n 'table',\n 'column',\n 'summary',\n 'field',\n 'code',\n 'file',\n 'navigationBar',\n 'outlet',\n 'toolbar',\n 'toolbarItem',\n ],\n layouts: [],\n screenTemplates: [],\n dialogTemplates: [],\n themes: [],\n displayName: 'Core',\n description: 'The built-in fallback vocabulary every ui profile resolves against.',\n module: '@cratis/scene.react',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n\n/**\n * The `core` package as a loadable bundle.\n */\nexport const corePackage: ScenePackageBundle = {\n manifest: corePackageManifest,\n components: coreComponents,\n descriptors: coreDescriptors,\n};\n"],"names":["corePackageManifest","name","version","kind","PackageKind","ComponentLibrary","dependencies","components","layouts","screenTemplates","dialogTemplates","themes","displayName","description","module","license","licenseUrl","corePackage","manifest","coreComponents","descriptors","coreDescriptors"],"mappings":";;;;AAAA;AACA;AAOA;;;;;;UAOaA,mBAAAA,GAAoC;IAC7CC,IAAAA,EAAM,MAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,YAAYC,gBAAgB;AAClCC,IAAAA,YAAAA,EAAc,EAAE;IAChBC,UAAAA,EAAY;AACR,QAAA,MAAA;AACA,QAAA,QAAA;AACA,QAAA,MAAA;AACA,QAAA,MAAA;AACA,QAAA,QAAA;AACA,QAAA,SAAA;AACA,QAAA,UAAA;AACA,QAAA,OAAA;AACA,QAAA,OAAA;AACA,QAAA,QAAA;AACA,QAAA,SAAA;AACA,QAAA,OAAA;AACA,QAAA,MAAA;AACA,QAAA,MAAA;AACA,QAAA,eAAA;AACA,QAAA,QAAA;AACA,QAAA,SAAA;AACA,QAAA;AACH,KAAA;AACDC,IAAAA,OAAAA,EAAS,EAAE;AACXC,IAAAA,eAAAA,EAAiB,EAAE;AACnBC,IAAAA,eAAAA,EAAiB,EAAE;AACnBC,IAAAA,MAAAA,EAAQ,EAAE;IACVC,WAAAA,EAAa,MAAA;IACbC,WAAAA,EAAa,qEAAA;IACbC,MAAAA,EAAQ,qBAAA;IACRC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;AAEA;;UAGaC,WAAAA,GAAkC;IAC3CC,QAAAA,EAAUlB,mBAAAA;IACVO,UAAAA,EAAYY,cAAAA;IACZC,WAAAA,EAAaC;AACjB;;"}
|
package/dist/esm/core/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './CoreText';
|
|
|
2
2
|
export * from './CoreButton';
|
|
3
3
|
export * from './CoreCard';
|
|
4
4
|
export * from './CoreNavigationBar';
|
|
5
|
+
export * from './CoreToolbar';
|
|
5
6
|
export * from './coreDescriptors';
|
|
6
7
|
export * from './ScreenplayCoreComponents';
|
|
7
8
|
export * from './coreComponents';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/index.ts"],"names":[],"mappings":"AAGA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/index.ts"],"names":[],"mappings":"AAGA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
package/dist/esm/core/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from './CoreText';
|
|
|
2
2
|
export * from './CoreButton';
|
|
3
3
|
export * from './CoreCard';
|
|
4
4
|
export * from './CoreNavigationBar';
|
|
5
|
+
export * from './CoreToolbar';
|
|
5
6
|
export * from './coreDescriptors';
|
|
6
7
|
export * from './ScreenplayCoreComponents';
|
|
7
8
|
export * from './coreComponents';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core/index.ts"],"names":[],"mappings":"AAGA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core/index.ts"],"names":[],"mappings":"AAGA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export { CoreText } from './core/CoreText.js';
|
|
|
12
12
|
export { CoreButton } from './core/CoreButton.js';
|
|
13
13
|
export { CoreCard } from './core/CoreCard.js';
|
|
14
14
|
export { CoreNavigationBar } from './core/CoreNavigationBar.js';
|
|
15
|
+
export { CoreToolbar, CoreToolbarItem, toolbarItemDestination, toolbarItemMode } from './core/CoreToolbar.js';
|
|
15
16
|
export { coreDescriptors } from './core/coreDescriptors.js';
|
|
16
17
|
export { CoreAction, CoreCode, CoreColumn, CoreData, CoreField, CoreFile, CoreNavigate, CoreSection, CoreSummary, CoreTable, CoreTitle } from './core/ScreenplayCoreComponents.js';
|
|
17
18
|
export { coreComponents } from './core/coreComponents.js';
|
|
@@ -43,6 +44,7 @@ export { DesignTimeContractVersion } from './packages/DesignTimeContractVersion.
|
|
|
43
44
|
export { DesignTimeExtensionPoint, designTimeExtensionPointLabels } from './packages/DesignTimeExtensionPoint.js';
|
|
44
45
|
export { DesignTimeProvider, useDesignTimeContext } from './packages/DesignTimeProvider.js';
|
|
45
46
|
export { EmbeddedPackageHost } from './packages/EmbeddedPackageHost.js';
|
|
47
|
+
export { loadApprovedPackages, resolveApprovedPackageHost } from './packages/loadApprovedPackages.js';
|
|
46
48
|
export { loadDesignTimeContributions } from './packages/loadDesignTimeContributions.js';
|
|
47
49
|
export { isNetworkAsset } from './packages/isNetworkAsset.js';
|
|
48
50
|
export { PackageHostAssets } from './packages/PackageHostAssets.js';
|
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,16 @@
|
|
|
1
|
+
import { ScenePackage } from '@cratis/scene.model';
|
|
2
|
+
export interface PackageModuleReference {
|
|
3
|
+
npm: string;
|
|
4
|
+
version: string;
|
|
5
|
+
export: string;
|
|
6
|
+
styles?: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface ApprovedPackage {
|
|
9
|
+
manifest: ScenePackage;
|
|
10
|
+
module: PackageModuleReference;
|
|
11
|
+
}
|
|
12
|
+
export interface ApprovedPackageSet {
|
|
13
|
+
version: 1;
|
|
14
|
+
packages: ApprovedPackage[];
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=ApprovedPackageSet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApprovedPackageSet.d.ts","sourceRoot":"","sources":["../../../packages/ApprovedPackageSet.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAMnD,MAAM,WAAW,sBAAsB;IAEnC,GAAG,EAAE,MAAM,CAAC;IAGZ,OAAO,EAAE,MAAM,CAAC;IAGhB,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAGD,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,sBAAsB,CAAC;CAClC;AAMD,MAAM,WAAW,kBAAkB;IAC/B,OAAO,EAAE,CAAC,CAAC;IACX,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApprovedPackageSet.js","sourceRoot":"","sources":["../../../packages/ApprovedPackageSet.ts"],"names":[],"mappings":""}
|