@cratis/scene.react 4.2.1 → 4.3.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/SceneElementView.tsx +13 -4
- package/core/CoreNavigationBar.tsx +53 -0
- package/core/coreComponents.ts +2 -0
- package/core/coreDescriptors.ts +75 -0
- package/core/corePackage.ts +3 -0
- package/core/index.ts +2 -0
- package/dist/cjs/SceneElementView.js +6 -2
- package/dist/cjs/SceneElementView.js.map +1 -1
- package/dist/cjs/core/CoreNavigationBar.js +49 -0
- package/dist/cjs/core/CoreNavigationBar.js.map +1 -0
- package/dist/cjs/core/coreComponents.js +3 -1
- package/dist/cjs/core/coreComponents.js.map +1 -1
- package/dist/cjs/core/coreDescriptors.js +162 -0
- package/dist/cjs/core/coreDescriptors.js.map +1 -0
- package/dist/cjs/core/corePackage.js +5 -2
- package/dist/cjs/core/corePackage.js.map +1 -1
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/packages/ScenePackageBundle.js +33 -1
- package/dist/cjs/packages/ScenePackageBundle.js.map +1 -1
- package/dist/esm/SceneElementView.d.ts +3 -2
- package/dist/esm/SceneElementView.d.ts.map +1 -1
- package/dist/esm/SceneElementView.js +7 -3
- package/dist/esm/SceneElementView.js.map +1 -1
- package/dist/esm/core/CoreNavigationBar.d.ts +3 -0
- package/dist/esm/core/CoreNavigationBar.d.ts.map +1 -0
- package/dist/esm/core/CoreNavigationBar.js +47 -0
- package/dist/esm/core/CoreNavigationBar.js.map +1 -0
- package/dist/esm/core/coreComponents.d.ts.map +1 -1
- package/dist/esm/core/coreComponents.js +3 -1
- package/dist/esm/core/coreComponents.js.map +1 -1
- package/dist/esm/core/coreDescriptors.d.ts +3 -0
- package/dist/esm/core/coreDescriptors.d.ts.map +1 -0
- package/dist/esm/core/coreDescriptors.js +160 -0
- package/dist/esm/core/coreDescriptors.js.map +1 -0
- package/dist/esm/core/corePackage.d.ts.map +1 -1
- package/dist/esm/core/corePackage.js +5 -2
- package/dist/esm/core/corePackage.js.map +1 -1
- package/dist/esm/core/index.d.ts +2 -0
- package/dist/esm/core/index.d.ts.map +1 -1
- package/dist/esm/core/index.js +2 -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/ScenePackageBundle.d.ts +2 -1
- package/dist/esm/packages/ScenePackageBundle.d.ts.map +1 -1
- package/dist/esm/packages/ScenePackageBundle.js +33 -1
- package/dist/esm/packages/ScenePackageBundle.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/packages/ScenePackageBundle.ts +49 -2
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
|
|
3
5
|
// Copyright (c) Cratis. All rights reserved.
|
|
4
6
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
7
|
/**
|
|
@@ -15,7 +17,8 @@
|
|
|
15
17
|
return `${packageName}:${componentName}`;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
|
-
* Checks that a bundle provides everything its manifest declares, and declares everything it provides
|
|
20
|
+
* Checks that a bundle provides everything its manifest declares, and declares everything it provides, and that
|
|
21
|
+
* every descriptor it ships is for a component it declares and is well formed.
|
|
19
22
|
*
|
|
20
23
|
* A manifest that promises a component the bundle does not register renders as `UnresolvedComponent` at
|
|
21
24
|
* runtime — a blank box, far from where the mistake was made. A component registered but not declared is
|
|
@@ -59,6 +62,35 @@
|
|
|
59
62
|
problems.push(`declares the theme '${name}' but provides no definition for it`);
|
|
60
63
|
}
|
|
61
64
|
}
|
|
65
|
+
problems.push(...validateDescriptors(bundle));
|
|
66
|
+
return problems;
|
|
67
|
+
}
|
|
68
|
+
function validateDescriptors(bundle) {
|
|
69
|
+
const problems = [];
|
|
70
|
+
const declared = new Set(bundle.manifest.components.map((name)=>componentRegistryKey(bundle.manifest.name, name)));
|
|
71
|
+
const described = new Set();
|
|
72
|
+
for (const descriptor of bundle.descriptors ?? []){
|
|
73
|
+
if (!declared.has(descriptor.component)) {
|
|
74
|
+
problems.push(`describes '${descriptor.component}', which the manifest does not declare as a component`);
|
|
75
|
+
}
|
|
76
|
+
if (described.has(descriptor.component)) {
|
|
77
|
+
problems.push(`describes '${descriptor.component}' more than once`);
|
|
78
|
+
}
|
|
79
|
+
described.add(descriptor.component);
|
|
80
|
+
const paths = new Set();
|
|
81
|
+
for (const property of descriptor.properties){
|
|
82
|
+
if (paths.has(property.path)) {
|
|
83
|
+
problems.push(`'${descriptor.component}' describes the property '${property.path}' more than once`);
|
|
84
|
+
}
|
|
85
|
+
paths.add(property.path);
|
|
86
|
+
if (property.valueType === scene_model.PropertyValueType.Collection && property.item === undefined) {
|
|
87
|
+
problems.push(`'${descriptor.component}' describes the collection '${property.path}' without describing its items`);
|
|
88
|
+
}
|
|
89
|
+
if (property.valueType === scene_model.PropertyValueType.Enum && (property.choices ?? []).length === 0) {
|
|
90
|
+
problems.push(`'${descriptor.component}' describes the enum '${property.path}' without choices`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
62
94
|
return problems;
|
|
63
95
|
}
|
|
64
96
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScenePackageBundle.js","sources":["../../../packages/ScenePackageBundle.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 { DialogTemplate, Layout, ScenePackage, Screen, ScreenTemplate, Theme } from '@cratis/scene.model';\nimport { ComponentRegistry } from '../renderer';\n\n/**\n * What a package actually ships to a React renderer, as opposed to what it *declares*.\n *\n * `ScenePackage` is the declaration — a name, a kind, dependencies, and the names of what it\n * contributes. It is deliberately platform-agnostic and lives in `Scene.Model`, because Stage's build and\n * Studio's design-time queries both read it without ever loading a component. A bundle is the other half:\n * the real React components, layouts, screens and themes behind those names, which only a renderer needs.\n *\n * A package publishes exactly one bundle, as a named export following its own name —\n * `primeReactPackage`, `cratisComponentsPackage`, `corePackage`. A host loads it from the module the\n * declaration's `ScenePackage.module` names.\n */\nexport interface ScenePackageBundle {\n /**\n * The package's own declaration. Its `components`, `layouts` and `themes` name lists must agree with\n * what this bundle actually provides — {@link validatePackageBundle} is what proves they do.\n */\n manifest: ScenePackage;\n\n /**\n * The components this package provides, keyed by {@link componentRegistryKey}.\n */\n components: ComponentRegistry;\n\n /**\n * The application shells this package provides, if any. Only a blueprint has these.\n */\n layouts?: Layout[];\n\n /**\n * The screen templates this package provides — the shapes that go inside a layout, each declaring\n * which of its parent's slots it fills.\n */\n screenTemplates?: ScreenTemplate[];\n\n /**\n * The dialog templates this package provides.\n */\n dialogTemplates?: DialogTemplate[];\n\n /**\n * Sample screens this package ships — a layout package's gallery, so a preview has real content to\n * put through the real engine rather than a mockup.\n */\n screens?: Screen[];\n\n /**\n * The themes this package ships, if any.\n */\n themes?: Theme[];\n}\n\n/**\n * The key a component is registered and looked up under: the package that provides it, then the bare name\n * a screen refers to it by.\n *\n * A screen writes a bare name (`button`) or a package-qualified one (`PrimeReact.button`);\n * `resolveComponentName` turns either into a `{ name, package }` pair, and this turns that pair into the\n * registry key. Nothing should build this string by hand — the separator is an implementation detail of\n * the registry, deliberately not the `.` used for qualification in a screen, so a package name containing\n * dots stays unambiguous.\n */\nexport function componentRegistryKey(packageName: string, componentName: string): string {\n return `${packageName}:${componentName}`;\n}\n\n/**\n * Checks that a bundle provides everything its manifest declares, and declares everything it provides.\n *\n * A manifest that promises a component the bundle does not register renders as `UnresolvedComponent` at\n * runtime — a blank box, far from where the mistake was made. A component registered but not declared is\n * invisible to `resolveComponentName`, so a screen can never name it. Both are silent failures, which is\n * why every package's specs run this.\n */\nexport function validatePackageBundle(bundle: ScenePackageBundle): string[] {\n const problems: string[] = [];\n const { manifest } = bundle;\n\n for (const name of manifest.components) {\n if (!(componentRegistryKey(manifest.name, name) in bundle.components)) {\n problems.push(`declares the component '${name}' but registers no implementation for it`);\n }\n }\n\n const declared = new Set(manifest.components.map((name) => componentRegistryKey(manifest.name, name)));\n for (const key of Object.keys(bundle.components)) {\n if (!declared.has(key)) {\n problems.push(`registers '${key}', which the manifest does not declare`);\n }\n }\n\n const providedLayouts = new Set((bundle.layouts ?? []).map((layout) => layout.name));\n for (const name of manifest.layouts) {\n if (!providedLayouts.has(name)) {\n problems.push(`declares the layout '${name}' but provides no definition for it`);\n }\n }\n\n const providedScreenTemplates = new Set((bundle.screenTemplates ?? []).map((template) => template.name));\n for (const name of manifest.screenTemplates) {\n if (!providedScreenTemplates.has(name)) {\n problems.push(`declares the screen template '${name}' but provides no definition for it`);\n }\n }\n\n const providedDialogTemplates = new Set((bundle.dialogTemplates ?? []).map((template) => template.name));\n for (const name of manifest.dialogTemplates) {\n if (!providedDialogTemplates.has(name)) {\n problems.push(`declares the dialog template '${name}' but provides no definition for it`);\n }\n }\n\n const providedThemes = new Set((bundle.themes ?? []).map((theme) => theme.name));\n for (const name of manifest.themes) {\n if (!providedThemes.has(name)) {\n problems.push(`declares the theme '${name}' but provides no definition for it`);\n }\n }\n\n return problems;\n}\n\n/**\n * Merges the component registries of several bundles into the single registry a renderer consumes.\n *\n * Keys carry their package name, so nothing collides and merge order does not matter — which package wins\n * a *bare* name is decided earlier, by `resolveComponentName` walking the profile's priority order.\n */\nexport function mergePackageRegistries(bundles: ScenePackageBundle[]): ComponentRegistry {\n return Object.assign({}, ...bundles.map((bundle) => bundle.components)) as ComponentRegistry;\n}\n"],"names":["componentRegistryKey","packageName","componentName","validatePackageBundle","bundle","problems","manifest","name","components","push","declared","Set","map","key","Object","keys","has","providedLayouts","layouts","layout","providedScreenTemplates","screenTemplates","template","providedDialogTemplates","dialogTemplates","providedThemes","themes","theme","mergePackageRegistries","bundles","assign"],"mappings":";;AAAA;AACA;AAyDA;;;;;;;;;AASC,IACM,SAASA,oBAAAA,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C,QAAA,IAAI,CAACD,cAAAA,CAAeT,GAAG,CAACT,IAAAA,CAAAA,EAAO;AAC3BF,YAAAA,QAAAA,CAASI,IAAI,CAAC,CAAC,oBAAoB,EAAEF,IAAAA,CAAK,mCAAmC,CAAC,CAAA;AAClF,QAAA;AACJ,IAAA;IAEA,OAAOF,QAAAA;AACX;AAEA;;;;;IAMO,SAASuB,sBAAAA,CAAuBC,OAA6B,EAAA;IAChE,OAAOf,MAAAA,CAAOgB,MAAM,CAAC,EAAC,EAAA,GAAMD,OAAAA,CAAQjB,GAAG,CAAC,CAACR,MAAAA,GAAWA,MAAAA,CAAOI,UAAU,CAAA,CAAA;AACzE;;;;"}
|
|
1
|
+
{"version":3,"file":"ScenePackageBundle.js","sources":["../../../packages/ScenePackageBundle.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 { ComponentDescriptor, DialogTemplate, Layout, PropertyValueType, ScenePackage, Screen, ScreenTemplate, Theme } from '@cratis/scene.model';\nimport { ComponentRegistry } from '../renderer';\n\n/**\n * What a package actually ships to a React renderer, as opposed to what it *declares*.\n *\n * `ScenePackage` is the declaration — a name, a kind, dependencies, and the names of what it\n * contributes. It is deliberately platform-agnostic and lives in `Scene.Model`, because Stage's build and\n * Studio's design-time queries both read it without ever loading a component. A bundle is the other half:\n * the real React components, layouts, screens and themes behind those names, which only a renderer needs.\n *\n * A package publishes exactly one bundle, as a named export following its own name —\n * `primeReactPackage`, `cratisComponentsPackage`, `corePackage`. A host loads it from the module the\n * declaration's `ScenePackage.module` names.\n */\nexport interface ScenePackageBundle {\n /**\n * The package's own declaration. Its `components`, `layouts` and `themes` name lists must agree with\n * what this bundle actually provides — {@link validatePackageBundle} is what proves they do.\n */\n manifest: ScenePackage;\n\n /**\n * The components this package provides, keyed by {@link componentRegistryKey}.\n */\n components: ComponentRegistry;\n\n /**\n * The application shells this package provides, if any. Only a blueprint has these.\n */\n layouts?: Layout[];\n\n /**\n * The screen templates this package provides — the shapes that go inside a layout, each declaring\n * which of its parent's slots it fills.\n */\n screenTemplates?: ScreenTemplate[];\n\n /**\n * The dialog templates this package provides.\n */\n dialogTemplates?: DialogTemplate[];\n\n /**\n * Sample screens this package ships — a layout package's gallery, so a preview has real content to\n * put through the real engine rather than a mockup.\n */\n screens?: Screen[];\n\n /**\n * What can be edited on this package's components - one {@link ComponentDescriptor} per component that is\n * editable at design time. They are data, so Studio reads them without rendering anything, and they travel with\n * the components they describe rather than in a registry of their own. {@link validatePackageBundle} checks\n * that every descriptor names a component the manifest declares.\n */\n descriptors?: ComponentDescriptor[];\n\n /**\n * The themes this package ships, if any.\n */\n themes?: Theme[];\n}\n\n/**\n * The key a component is registered and looked up under: the package that provides it, then the bare name\n * a screen refers to it by.\n *\n * A screen writes a bare name (`button`) or a package-qualified one (`PrimeReact.button`);\n * `resolveComponentName` turns either into a `{ name, package }` pair, and this turns that pair into the\n * registry key. Nothing should build this string by hand — the separator is an implementation detail of\n * the registry, deliberately not the `.` used for qualification in a screen, so a package name containing\n * dots stays unambiguous.\n */\nexport function componentRegistryKey(packageName: string, componentName: string): string {\n return `${packageName}:${componentName}`;\n}\n\n/**\n * Checks that a bundle provides everything its manifest declares, and declares everything it provides, and that\n * every descriptor it ships is for a component it declares and is well formed.\n *\n * A manifest that promises a component the bundle does not register renders as `UnresolvedComponent` at\n * runtime — a blank box, far from where the mistake was made. A component registered but not declared is\n * invisible to `resolveComponentName`, so a screen can never name it. Both are silent failures, which is\n * why every package's specs run this.\n */\nexport function validatePackageBundle(bundle: ScenePackageBundle): string[] {\n const problems: string[] = [];\n const { manifest } = bundle;\n\n for (const name of manifest.components) {\n if (!(componentRegistryKey(manifest.name, name) in bundle.components)) {\n problems.push(`declares the component '${name}' but registers no implementation for it`);\n }\n }\n\n const declared = new Set(manifest.components.map((name) => componentRegistryKey(manifest.name, name)));\n for (const key of Object.keys(bundle.components)) {\n if (!declared.has(key)) {\n problems.push(`registers '${key}', which the manifest does not declare`);\n }\n }\n\n const providedLayouts = new Set((bundle.layouts ?? []).map((layout) => layout.name));\n for (const name of manifest.layouts) {\n if (!providedLayouts.has(name)) {\n problems.push(`declares the layout '${name}' but provides no definition for it`);\n }\n }\n\n const providedScreenTemplates = new Set((bundle.screenTemplates ?? []).map((template) => template.name));\n for (const name of manifest.screenTemplates) {\n if (!providedScreenTemplates.has(name)) {\n problems.push(`declares the screen template '${name}' but provides no definition for it`);\n }\n }\n\n const providedDialogTemplates = new Set((bundle.dialogTemplates ?? []).map((template) => template.name));\n for (const name of manifest.dialogTemplates) {\n if (!providedDialogTemplates.has(name)) {\n problems.push(`declares the dialog template '${name}' but provides no definition for it`);\n }\n }\n\n const providedThemes = new Set((bundle.themes ?? []).map((theme) => theme.name));\n for (const name of manifest.themes) {\n if (!providedThemes.has(name)) {\n problems.push(`declares the theme '${name}' but provides no definition for it`);\n }\n }\n\n problems.push(...validateDescriptors(bundle));\n return problems;\n}\n\nfunction validateDescriptors(bundle: ScenePackageBundle): string[] {\n const problems: string[] = [];\n const declared = new Set(bundle.manifest.components.map((name) => componentRegistryKey(bundle.manifest.name, name)));\n const described = new Set<string>();\n\n for (const descriptor of bundle.descriptors ?? []) {\n if (!declared.has(descriptor.component)) {\n problems.push(`describes '${descriptor.component}', which the manifest does not declare as a component`);\n }\n\n if (described.has(descriptor.component)) {\n problems.push(`describes '${descriptor.component}' more than once`);\n }\n\n described.add(descriptor.component);\n\n const paths = new Set<string>();\n for (const property of descriptor.properties) {\n if (paths.has(property.path)) {\n problems.push(`'${descriptor.component}' describes the property '${property.path}' more than once`);\n }\n\n paths.add(property.path);\n\n if (property.valueType === PropertyValueType.Collection && property.item === undefined) {\n problems.push(`'${descriptor.component}' describes the collection '${property.path}' without describing its items`);\n }\n\n if (property.valueType === PropertyValueType.Enum && (property.choices ?? []).length === 0) {\n problems.push(`'${descriptor.component}' describes the enum '${property.path}' without choices`);\n }\n }\n }\n\n return problems;\n}\n\n/**\n * Merges the component registries of several bundles into the single registry a renderer consumes.\n *\n * Keys carry their package name, so nothing collides and merge order does not matter — which package wins\n * a *bare* name is decided earlier, by `resolveComponentName` walking the profile's priority order.\n */\nexport function mergePackageRegistries(bundles: ScenePackageBundle[]): ComponentRegistry {\n return Object.assign({}, ...bundles.map((bundle) => bundle.components)) as ComponentRegistry;\n}\n"],"names":["componentRegistryKey","packageName","componentName","validatePackageBundle","bundle","problems","manifest","name","components","push","declared","Set","map","key","Object","keys","has","providedLayouts","layouts","layout","providedScreenTemplates","screenTemplates","template","providedDialogTemplates","dialogTemplates","providedThemes","themes","theme","validateDescriptors","described","descriptor","descriptors","component","add","paths","property","properties","path","valueType","PropertyValueType","Collection","item","undefined","Enum","choices","length","mergePackageRegistries","bundles","assign"],"mappings":";;;;AAAA;AACA;AAiEA;;;;;;;;;AASC,IACM,SAASA,oBAAAA,CAAqBC,WAAmB,EAAEC,aAAqB,EAAA;AAC3E,IAAA,OAAO,CAAA,EAAGD,WAAAA,CAAY,CAAC,EAAEC,aAAAA,CAAAA,CAAe;AAC5C;AAEA;;;;;;;;IASO,SAASC,qBAAAA,CAAsBC,MAA0B,EAAA;AAC5D,IAAA,MAAMC,WAAqB,EAAE;IAC7B,MAAM,EAAEC,QAAQ,EAAE,GAAGF,MAAAA;AAErB,IAAA,KAAK,MAAMG,IAAAA,IAAQD,QAAAA,CAASE,UAAU,CAAE;QACpC,IAAI,EAAER,oBAAAA,CAAqBM,QAAAA,CAASC,IAAI,EAAEA,IAAAA,CAAAA,IAASH,MAAAA,CAAOI,UAAS,CAAA,EAAI;AACnEH,YAAAA,QAAAA,CAASI,IAAI,CAAC,CAAC,wBAAwB,EAAEF,IAAAA,CAAK,wCAAwC,CAAC,CAAA;AAC3F,QAAA;AACJ,IAAA;AAEA,IAAA,MAAMG,QAAAA,GAAW,IAAIC,GAAAA,CAAIL,QAAAA,CAASE,UAAU,CAACI,GAAG,CAAC,CAACL,IAAAA,GAASP,oBAAAA,CAAqBM,QAAAA,CAAS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AAC,EAAGC,MAAM,KAAK,CAAA,EAAG;AACxFxC,gBAAAA,QAAAA,CAASI,IAAI,CAAC,CAAC,CAAC,EAAEqB,UAAAA,CAAWE,SAAS,CAAC,sBAAsB,EAAEG,QAAAA,CAASE,IAAI,CAAC,iBAAiB,CAAC,CAAA;AACnG,YAAA;AACJ,QAAA;AACJ,IAAA;IAEA,OAAOhC,QAAAA;AACX;AAEA;;;;;IAMO,SAASyC,sBAAAA,CAAuBC,OAA6B,EAAA;IAChE,OAAOjC,MAAAA,CAAOkC,MAAM,CAAC,EAAC,EAAA,GAAMD,OAAAA,CAAQnC,GAAG,CAAC,CAACR,MAAAA,GAAWA,MAAAA,CAAOI,UAAU,CAAA,CAAA;AACzE;;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { BindingResolver } from '@cratis/scene.engine';
|
|
2
|
-
import { SceneElement } from '@cratis/scene.model';
|
|
2
|
+
import { EffectiveConfiguration, SceneElement } from '@cratis/scene.model';
|
|
3
3
|
import { ComponentRegistry } from './renderer';
|
|
4
4
|
export interface SceneElementViewProps {
|
|
5
5
|
element: SceneElement;
|
|
6
6
|
registry: ComponentRegistry;
|
|
7
7
|
resolveBinding: BindingResolver;
|
|
8
|
+
configuration?: EffectiveConfiguration;
|
|
8
9
|
}
|
|
9
|
-
export declare function SceneElementView({ element, registry, resolveBinding }: SceneElementViewProps): import("react").JSX.Element;
|
|
10
|
+
export declare function SceneElementView({ element, registry, resolveBinding, configuration }: SceneElementViewProps): import("react").JSX.Element;
|
|
10
11
|
//# sourceMappingURL=SceneElementView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneElementView.d.ts","sourceRoot":"","sources":["../../SceneElementView.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"SceneElementView.d.ts","sourceRoot":"","sources":["../../SceneElementView.tsx"],"names":[],"mappings":"AAIA,OAAO,EAA8C,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAuB,MAAM,YAAY,CAAC;AAEpE,MAAM,WAAW,qBAAqB;IAClC,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,cAAc,EAAE,eAAe,CAAC;IAQhC,aAAa,CAAC,EAAE,sBAAsB,CAAC;CAC1C;AAMD,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,EAAE,qBAAqB,+BAI3G"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import { renderElement } from '@cratis/scene.engine';
|
|
3
|
+
import { applyEffectiveConfiguration, renderElement } from '@cratis/scene.engine';
|
|
4
4
|
import { createReactRenderer } from './renderer/createReactRenderer.js';
|
|
5
5
|
import './interactions/useInteractions.js';
|
|
6
6
|
import './interactions/NotificationHost.js';
|
|
@@ -8,12 +8,16 @@ import './interactions/NotificationHost.js';
|
|
|
8
8
|
/**
|
|
9
9
|
* Renders a Scene element tree with the real `Scene.React` renderer - the WYSIWYG building block Studio's
|
|
10
10
|
* preview surface and Stage's shipped web bundle both consume unmodified.
|
|
11
|
-
*/ function SceneElementView({ element, registry, resolveBinding }) {
|
|
11
|
+
*/ function SceneElementView({ element, registry, resolveBinding, configuration }) {
|
|
12
12
|
const renderer = useMemo(()=>createReactRenderer(registry), [
|
|
13
13
|
registry
|
|
14
14
|
]);
|
|
15
|
+
const configured = useMemo(()=>configuration ? applyEffectiveConfiguration(element, configuration) : element, [
|
|
16
|
+
element,
|
|
17
|
+
configuration
|
|
18
|
+
]);
|
|
15
19
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
16
|
-
children: renderElement(
|
|
20
|
+
children: renderElement(configured, renderer, resolveBinding)
|
|
17
21
|
});
|
|
18
22
|
}
|
|
19
23
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneElementView.js","sources":["../../SceneElementView.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport { renderElement, BindingResolver } from '@cratis/scene.engine';\nimport { SceneElement } from '@cratis/scene.model';\nimport { ComponentRegistry, createReactRenderer } from './renderer';\n\nexport interface SceneElementViewProps {\n element: SceneElement;\n registry: ComponentRegistry;\n resolveBinding: BindingResolver;\n}\n\n/**\n * Renders a Scene element tree with the real `Scene.React` renderer - the WYSIWYG building block Studio's\n * preview surface and Stage's shipped web bundle both consume unmodified.\n */\nexport function SceneElementView({ element, registry, resolveBinding }: SceneElementViewProps) {\n const renderer = useMemo(() => createReactRenderer(registry), [registry]);\n return <>{renderElement(
|
|
1
|
+
{"version":3,"file":"SceneElementView.js","sources":["../../SceneElementView.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport { applyEffectiveConfiguration, renderElement, BindingResolver } from '@cratis/scene.engine';\nimport { EffectiveConfiguration, SceneElement } from '@cratis/scene.model';\nimport { ComponentRegistry, createReactRenderer } from './renderer';\n\nexport interface SceneElementViewProps {\n element: SceneElement;\n registry: ComponentRegistry;\n resolveBinding: BindingResolver;\n\n /**\n * The resolved configuration of the template chain the element sits in, from `resolveEffectiveConfiguration`.\n * When given, each configurable component renders with its resolved properties - what a screen's own values add\n * to an inherited template. It is the same data the editor shows, and the same code path whether the screen is\n * being edited or played: there is no design-time mode.\n */\n configuration?: EffectiveConfiguration;\n}\n\n/**\n * Renders a Scene element tree with the real `Scene.React` renderer - the WYSIWYG building block Studio's\n * preview surface and Stage's shipped web bundle both consume unmodified.\n */\nexport function SceneElementView({ element, registry, resolveBinding, configuration }: SceneElementViewProps) {\n const renderer = useMemo(() => createReactRenderer(registry), [registry]);\n const configured = useMemo(() => configuration ? applyEffectiveConfiguration(element, configuration) : element, [element, configuration]);\n return <>{renderElement(configured, renderer, resolveBinding)}</>;\n}\n"],"names":["SceneElementView","element","registry","resolveBinding","configuration","renderer","useMemo","createReactRenderer","configured","applyEffectiveConfiguration","_jsx","_Fragment","renderElement"],"mappings":";;;;;;;AAsBA;;;IAIO,SAASA,gBAAAA,CAAiB,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,cAAc,EAAEC,aAAa,EAAyB,EAAA;AACxG,IAAA,MAAMC,QAAAA,GAAWC,OAAAA,CAAQ,IAAMC,mBAAAA,CAAoBL,QAAAA,CAAAA,EAAW;AAACA,QAAAA;AAAS,KAAA,CAAA;AACxE,IAAA,MAAMM,aAAaF,OAAAA,CAAQ,IAAMF,gBAAgBK,2BAAAA,CAA4BR,OAAAA,EAASG,iBAAiBH,OAAAA,EAAS;AAACA,QAAAA,OAAAA;AAASG,QAAAA;AAAc,KAAA,CAAA;IACxI,qBAAOM,GAAA,CAAAC,QAAA,EAAA;AAAGC,QAAAA,QAAAA,EAAAA,aAAAA,CAAcJ,YAAYH,QAAAA,EAAUF,cAAAA;;AAClD;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoreNavigationBar.d.ts","sourceRoot":"","sources":["../../../core/CoreNavigationBar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAuBvD,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,wBAAwB,+BA0BtE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
function isNavigationBarItem(value) {
|
|
6
|
+
const candidate = value;
|
|
7
|
+
return candidate !== null && typeof candidate === 'object' && typeof candidate.id === 'string' && typeof candidate.label === 'string';
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The `core:navigationBar` component: a list of navigation items, the first of which a template author normally
|
|
11
|
+
* fixes as Home and the rest of which consumers of the template can add to.
|
|
12
|
+
*
|
|
13
|
+
* It reads `items` from the property bag it is given and nothing else, so it renders the same whether a screen is
|
|
14
|
+
* being played or edited - configuration is resolved into the bag before it gets here. An item names its destination
|
|
15
|
+
* as a screen, and activating it emits a host-neutral navigation event, the same as `core:navigate`. An item's icon
|
|
16
|
+
* is carried on the node as data attributes for a host to render; icon catalogs are not this component's business.
|
|
17
|
+
*/ function CoreNavigationBar({ element }) {
|
|
18
|
+
const items = Array.isArray(element.properties.items) ? element.properties.items.filter(isNavigationBarItem) : [];
|
|
19
|
+
const title = typeof element.properties.title === 'string' ? element.properties.title : undefined;
|
|
20
|
+
return /*#__PURE__*/ jsx("nav", {
|
|
21
|
+
"data-scene-id": element.id,
|
|
22
|
+
"aria-label": title,
|
|
23
|
+
children: items.map((item)=>{
|
|
24
|
+
const targetScreen = item.destination?.screen ?? '';
|
|
25
|
+
const navigate = ()=>globalThis.dispatchEvent(new CustomEvent('cratis.scene.navigate', {
|
|
26
|
+
detail: {
|
|
27
|
+
targetScreen,
|
|
28
|
+
element,
|
|
29
|
+
item
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
return /*#__PURE__*/ jsx("button", {
|
|
33
|
+
type: "button",
|
|
34
|
+
"data-scene-item": item.id,
|
|
35
|
+
"data-scene-icon-library": item.icon?.library,
|
|
36
|
+
"data-scene-icon-key": item.icon?.key,
|
|
37
|
+
"data-scene-icon-variant": item.icon?.variant,
|
|
38
|
+
disabled: targetScreen === '',
|
|
39
|
+
onClick: navigate,
|
|
40
|
+
children: item.label
|
|
41
|
+
}, item.id);
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { CoreNavigationBar };
|
|
47
|
+
//# sourceMappingURL=CoreNavigationBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoreNavigationBar.js","sources":["../../../core/CoreNavigationBar.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 { RegisteredComponentProps } from '../renderer';\n\ninterface NavigationBarItem {\n id: string;\n label: string;\n icon?: { library: string; key: string; variant?: string };\n destination?: { screen: string };\n}\n\nfunction isNavigationBarItem(value: unknown): value is NavigationBarItem {\n const candidate = value as Partial<NavigationBarItem> | null;\n return candidate !== null && typeof candidate === 'object' && typeof candidate.id === 'string' && typeof candidate.label === 'string';\n}\n\n/**\n * The `core:navigationBar` component: a list of navigation items, the first of which a template author normally\n * fixes as Home and the rest of which consumers of the template can add to.\n *\n * It reads `items` from the property bag it is given and nothing else, so it renders the same whether a screen is\n * being played or edited - configuration is resolved into the bag before it gets here. An item names its destination\n * as a screen, and activating it emits a host-neutral navigation event, the same as `core:navigate`. An item's icon\n * is carried on the node as data attributes for a host to render; icon catalogs are not this component's business.\n */\nexport function CoreNavigationBar({ element }: RegisteredComponentProps) {\n const items = Array.isArray(element.properties.items) ? element.properties.items.filter(isNavigationBarItem) : [];\n const title = typeof element.properties.title === 'string' ? element.properties.title : undefined;\n\n return (\n <nav data-scene-id={element.id} aria-label={title}>\n {items.map(item => {\n const targetScreen = item.destination?.screen ?? '';\n const navigate = () => globalThis.dispatchEvent(new CustomEvent('cratis.scene.navigate', { detail: { targetScreen, element, item } }));\n return (\n <button\n key={item.id}\n type='button'\n data-scene-item={item.id}\n data-scene-icon-library={item.icon?.library}\n data-scene-icon-key={item.icon?.key}\n data-scene-icon-variant={item.icon?.variant}\n disabled={targetScreen === ''}\n onClick={navigate}\n >\n {item.label}\n </button>\n );\n })}\n </nav>\n );\n}\n"],"names":["isNavigationBarItem","value","candidate","id","label","CoreNavigationBar","element","items","Array","isArray","properties","filter","title","undefined","_jsx","nav","data-scene-id","aria-label","map","item","targetScreen","destination","screen","navigate","globalThis","dispatchEvent","CustomEvent","detail","button","type","data-scene-item","data-scene-icon-library","icon","library","data-scene-icon-key","key","data-scene-icon-variant","variant","disabled","onClick"],"mappings":";;AAAA;AACA;AAWA,SAASA,oBAAoBC,KAAc,EAAA;AACvC,IAAA,MAAMC,SAAAA,GAAYD,KAAAA;AAClB,IAAA,OAAOC,SAAAA,KAAc,IAAA,IAAQ,OAAOA,SAAAA,KAAc,QAAA,IAAY,OAAOA,SAAAA,CAAUC,EAAE,KAAK,QAAA,IAAY,OAAOD,SAAAA,CAAUE,KAAK,KAAK,QAAA;AACjI;AAEA;;;;;;;;AAQC,IACM,SAASC,iBAAAA,CAAkB,EAAEC,OAAO,EAA4B,EAAA;AACnE,IAAA,MAAMC,QAAQC,KAAAA,CAAMC,OAAO,CAACH,OAAAA,CAAQI,UAAU,CAACH,KAAK,CAAA,GAAID,OAAAA,CAAQI,UAAU,CAACH,KAAK,CAACI,MAAM,CAACX,uBAAuB,EAAE;AACjH,IAAA,MAAMY,KAAAA,GAAQ,OAAON,OAAAA,CAAQI,UAAU,CAACE,KAAK,KAAK,QAAA,GAAWN,OAAAA,CAAQI,UAAU,CAACE,KAAK,GAAGC,SAAAA;AAExF,IAAA,qBACIC,GAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeV,QAAQH,EAAE;QAAEc,YAAAA,EAAYL,KAAAA;kBACvCL,KAAAA,CAAMW,GAAG,CAACC,CAAAA,IAAAA,GAAAA;AACP,YAAA,MAAMC,YAAAA,GAAeD,IAAAA,CAAKE,WAAW,EAAEC,MAAAA,IAAU,EAAA;AACjD,YAAA,MAAMC,WAAW,IAAMC,UAAAA,CAAWC,aAAa,CAAC,IAAIC,YAAY,uBAAA,EAAyB;oBAAEC,MAAAA,EAAQ;AAAEP,wBAAAA,YAAAA;AAAcd,wBAAAA,OAAAA;AAASa,wBAAAA;AAAK;AAAE,iBAAA,CAAA,CAAA;AACnI,YAAA,qBACIL,GAAA,CAACc,QAAAA,EAAAA;gBAEGC,IAAAA,EAAK,QAAA;AACLC,gBAAAA,iBAAAA,EAAiBX,KAAKhB,EAAE;gBACxB4B,yBAAAA,EAAyBZ,IAAAA,CAAKa,IAAI,EAAEC,OAAAA;gBACpCC,qBAAAA,EAAqBf,IAAAA,CAAKa,IAAI,EAAEG,GAAAA;gBAChCC,yBAAAA,EAAyBjB,IAAAA,CAAKa,IAAI,EAAEK,OAAAA;AACpCC,gBAAAA,QAAAA,EAAUlB,YAAAA,KAAiB,EAAA;gBAC3BmB,OAAAA,EAAShB,QAAAA;AAERJ,gBAAAA,QAAAA,EAAAA,IAAAA,CAAKf;AATDe,aAAAA,EAAAA,IAAAA,CAAKhB,EAAE,CAAA;AAYxB,QAAA,CAAA;;AAGZ;;"}
|
|
@@ -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;AAwBhD,eAAO,MAAM,cAAc,EAAE,iBAgB5B,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { componentRegistryKey } from '../packages/ScenePackageBundle.js';
|
|
|
2
2
|
import { CoreText } from './CoreText.js';
|
|
3
3
|
import { CoreButton } from './CoreButton.js';
|
|
4
4
|
import { CoreCard } from './CoreCard.js';
|
|
5
|
+
import { CoreNavigationBar } from './CoreNavigationBar.js';
|
|
5
6
|
import { CoreFile, CoreCode, CoreField, CoreSummary, CoreColumn, CoreTable, CoreTitle, CoreNavigate, CoreSection, CoreAction, CoreData } from './ScreenplayCoreComponents.js';
|
|
6
7
|
|
|
7
8
|
// Copyright (c) Cratis. All rights reserved.
|
|
@@ -23,7 +24,8 @@ import { CoreFile, CoreCode, CoreField, CoreSummary, CoreColumn, CoreTable, Core
|
|
|
23
24
|
[componentRegistryKey('core', 'summary')]: CoreSummary,
|
|
24
25
|
[componentRegistryKey('core', 'field')]: CoreField,
|
|
25
26
|
[componentRegistryKey('core', 'code')]: CoreCode,
|
|
26
|
-
[componentRegistryKey('core', 'file')]: CoreFile
|
|
27
|
+
[componentRegistryKey('core', 'file')]: CoreFile,
|
|
28
|
+
[componentRegistryKey('core', 'navigationBar')]: CoreNavigationBar
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
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 {\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};\n"],"names":["coreComponents","componentRegistryKey","CoreText","CoreButton","CoreCard","CoreData","CoreAction","CoreSection","CoreNavigate","CoreTitle","CoreTable","CoreColumn","CoreSummary","CoreField","CoreCode","CoreFile"],"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 {\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};\n"],"names":["coreComponents","componentRegistryKey","CoreText","CoreButton","CoreCard","CoreData","CoreAction","CoreSection","CoreNavigate","CoreTitle","CoreTable","CoreColumn","CoreSummary","CoreField","CoreCode","CoreFile","CoreNavigationBar"],"mappings":";;;;;;;AAAA;AACA;AAsBA;;;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;AACrD;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coreDescriptors.d.ts","sourceRoot":"","sources":["../../../core/coreDescriptors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAqB,MAAM,qBAAqB,CAAC;AAY7E,eAAO,MAAM,eAAe,EAAE,mBAAmB,EA2DhD,CAAC"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { PropertyValueType } from '@cratis/scene.model';
|
|
2
|
+
import { componentRegistryKey } from '../packages/ScenePackageBundle.js';
|
|
3
|
+
|
|
4
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
5
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
6
|
+
const key = (name)=>componentRegistryKey('core', name);
|
|
7
|
+
/**
|
|
8
|
+
* What can be edited on the `core` package's components.
|
|
9
|
+
*
|
|
10
|
+
* Only the components an author configures by hand are described: a button's label, an action's command and its
|
|
11
|
+
* argument mapping, a column's heading, and the navigation bar. The Screenplay structural components - `data`,
|
|
12
|
+
* `section`, `summary` - have nothing to edit that is not already a node in the tree.
|
|
13
|
+
*/ const coreDescriptors = [
|
|
14
|
+
{
|
|
15
|
+
component: key('button'),
|
|
16
|
+
displayName: 'Button',
|
|
17
|
+
properties: [
|
|
18
|
+
{
|
|
19
|
+
path: 'label',
|
|
20
|
+
label: 'Label',
|
|
21
|
+
group: 'Content',
|
|
22
|
+
valueType: PropertyValueType.String,
|
|
23
|
+
default: ''
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
component: key('action'),
|
|
29
|
+
displayName: 'Command action',
|
|
30
|
+
description: 'Invokes a modeled command. The command and its argument mapping are stored on the element; the host that handles the command event reads them.',
|
|
31
|
+
properties: [
|
|
32
|
+
{
|
|
33
|
+
path: 'label',
|
|
34
|
+
label: 'Label',
|
|
35
|
+
group: 'Content',
|
|
36
|
+
valueType: PropertyValueType.String
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
path: 'command',
|
|
40
|
+
label: 'Command',
|
|
41
|
+
group: 'Behavior',
|
|
42
|
+
valueType: PropertyValueType.String,
|
|
43
|
+
editorKind: 'stateChangeReference',
|
|
44
|
+
constraints: {
|
|
45
|
+
required: true
|
|
46
|
+
},
|
|
47
|
+
description: 'The state change this action submits.'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
path: 'arguments',
|
|
51
|
+
label: 'Argument mapping',
|
|
52
|
+
group: 'Behavior',
|
|
53
|
+
valueType: PropertyValueType.Collection,
|
|
54
|
+
description: 'Where each command argument comes from.',
|
|
55
|
+
item: {
|
|
56
|
+
label: 'Argument',
|
|
57
|
+
properties: [
|
|
58
|
+
{
|
|
59
|
+
path: 'name',
|
|
60
|
+
label: 'Argument',
|
|
61
|
+
group: 'Behavior',
|
|
62
|
+
valueType: PropertyValueType.String,
|
|
63
|
+
constraints: {
|
|
64
|
+
required: true
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
path: 'source',
|
|
69
|
+
label: 'Source',
|
|
70
|
+
group: 'Behavior',
|
|
71
|
+
valueType: PropertyValueType.String,
|
|
72
|
+
editorKind: 'bindingPath',
|
|
73
|
+
constraints: {
|
|
74
|
+
required: true
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
component: key('column'),
|
|
84
|
+
displayName: 'Table column',
|
|
85
|
+
properties: [
|
|
86
|
+
{
|
|
87
|
+
path: 'property',
|
|
88
|
+
label: 'Result field',
|
|
89
|
+
group: 'Data',
|
|
90
|
+
valueType: PropertyValueType.String,
|
|
91
|
+
editorKind: 'resultField',
|
|
92
|
+
constraints: {
|
|
93
|
+
required: true
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
path: 'label',
|
|
98
|
+
label: 'Heading',
|
|
99
|
+
group: 'Content',
|
|
100
|
+
valueType: PropertyValueType.String
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
component: key('navigationBar'),
|
|
106
|
+
displayName: 'Navigation bar',
|
|
107
|
+
description: 'A list of navigation items. A template author fixes the first item (Home) and can expose the list so that screens add their own.',
|
|
108
|
+
properties: [
|
|
109
|
+
{
|
|
110
|
+
path: 'title',
|
|
111
|
+
label: 'Title',
|
|
112
|
+
group: 'Content',
|
|
113
|
+
valueType: PropertyValueType.String,
|
|
114
|
+
default: 'Navigation'
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
path: 'items',
|
|
118
|
+
label: 'Items',
|
|
119
|
+
group: 'Content',
|
|
120
|
+
valueType: PropertyValueType.Collection,
|
|
121
|
+
default: [],
|
|
122
|
+
item: {
|
|
123
|
+
label: 'Navigation item',
|
|
124
|
+
properties: [
|
|
125
|
+
{
|
|
126
|
+
path: 'label',
|
|
127
|
+
label: 'Label',
|
|
128
|
+
group: 'Content',
|
|
129
|
+
valueType: PropertyValueType.String,
|
|
130
|
+
constraints: {
|
|
131
|
+
required: true,
|
|
132
|
+
minimumLength: 1
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
path: 'icon',
|
|
137
|
+
label: 'Icon',
|
|
138
|
+
group: 'Content',
|
|
139
|
+
valueType: PropertyValueType.Icon,
|
|
140
|
+
editorKind: 'iconPicker'
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
path: 'destination',
|
|
144
|
+
label: 'Destination',
|
|
145
|
+
group: 'Content',
|
|
146
|
+
valueType: PropertyValueType.Destination,
|
|
147
|
+
editorKind: 'screenPicker',
|
|
148
|
+
constraints: {
|
|
149
|
+
required: true
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
];
|
|
158
|
+
|
|
159
|
+
export { coreDescriptors };
|
|
160
|
+
//# sourceMappingURL=coreDescriptors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coreDescriptors.js","sources":["../../../core/coreDescriptors.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 { ComponentDescriptor, PropertyValueType } from '@cratis/scene.model';\nimport { componentRegistryKey } from '../packages';\n\nconst key = (name: string) => componentRegistryKey('core', name);\n\n/**\n * What can be edited on the `core` package's components.\n *\n * Only the components an author configures by hand are described: a button's label, an action's command and its\n * argument mapping, a column's heading, and the navigation bar. The Screenplay structural components - `data`,\n * `section`, `summary` - have nothing to edit that is not already a node in the tree.\n */\nexport const coreDescriptors: ComponentDescriptor[] = [\n {\n component: key('button'),\n displayName: 'Button',\n properties: [\n { path: 'label', label: 'Label', group: 'Content', valueType: PropertyValueType.String, default: '' },\n ],\n },\n {\n component: key('action'),\n displayName: 'Command action',\n description: 'Invokes a modeled command. The command and its argument mapping are stored on the element; the host that handles the command event reads them.',\n properties: [\n { path: 'label', label: 'Label', group: 'Content', valueType: PropertyValueType.String },\n {\n path: 'command', label: 'Command', group: 'Behavior', valueType: PropertyValueType.String,\n editorKind: 'stateChangeReference', constraints: { required: true },\n description: 'The state change this action submits.',\n },\n {\n path: 'arguments', label: 'Argument mapping', group: 'Behavior', valueType: PropertyValueType.Collection,\n description: 'Where each command argument comes from.',\n item: {\n label: 'Argument',\n properties: [\n { path: 'name', label: 'Argument', group: 'Behavior', valueType: PropertyValueType.String, constraints: { required: true } },\n { path: 'source', label: 'Source', group: 'Behavior', valueType: PropertyValueType.String, editorKind: 'bindingPath', constraints: { required: true } },\n ],\n },\n },\n ],\n },\n {\n component: key('column'),\n displayName: 'Table column',\n properties: [\n { path: 'property', label: 'Result field', group: 'Data', valueType: PropertyValueType.String, editorKind: 'resultField', constraints: { required: true } },\n { path: 'label', label: 'Heading', group: 'Content', valueType: PropertyValueType.String },\n ],\n },\n {\n component: key('navigationBar'),\n displayName: 'Navigation bar',\n description: 'A list of navigation items. A template author fixes the first item (Home) and can expose the list so that screens add their own.',\n properties: [\n { path: 'title', label: 'Title', group: 'Content', valueType: PropertyValueType.String, default: 'Navigation' },\n {\n path: 'items', label: 'Items', group: 'Content', valueType: PropertyValueType.Collection, default: [],\n item: {\n label: 'Navigation item',\n properties: [\n { path: 'label', label: 'Label', group: 'Content', valueType: PropertyValueType.String, constraints: { required: true, minimumLength: 1 } },\n { path: 'icon', label: 'Icon', group: 'Content', valueType: PropertyValueType.Icon, editorKind: 'iconPicker' },\n { path: 'destination', label: 'Destination', group: 'Content', valueType: PropertyValueType.Destination, editorKind: 'screenPicker', constraints: { required: true } },\n ],\n },\n },\n ],\n },\n];\n"],"names":["key","name","componentRegistryKey","coreDescriptors","component","displayName","properties","path","label","group","valueType","PropertyValueType","String","default","description","editorKind","constraints","required","Collection","item","minimumLength","Icon","Destination"],"mappings":";;;AAAA;AACA;AAKA,MAAMA,GAAAA,GAAM,CAACC,IAAAA,GAAiBC,oBAAAA,CAAqB,MAAA,EAAQD,IAAAA,CAAAA;AAE3D;;;;;;UAOaE,eAAAA,GAAyC;AAClD,IAAA;AACIC,QAAAA,SAAAA,EAAWJ,GAAAA,CAAI,QAAA,CAAA;QACfK,WAAAA,EAAa,QAAA;QACbC,UAAAA,EAAY;AACR,YAAA;gBAAEC,IAAAA,EAAM,OAAA;gBAASC,KAAAA,EAAO,OAAA;gBAASC,KAAAA,EAAO,SAAA;AAAWC,gBAAAA,SAAAA,EAAWC,kBAAkBC,MAAM;gBAAEC,OAAAA,EAAS;AAAG;AACvG;AACL,KAAA;AACA,IAAA;AACIT,QAAAA,SAAAA,EAAWJ,GAAAA,CAAI,QAAA,CAAA;QACfK,WAAAA,EAAa,gBAAA;QACbS,WAAAA,EAAa,gJAAA;QACbR,UAAAA,EAAY;AACR,YAAA;gBAAEC,I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C,4BAAAA,SAAAA,EAAWC,kBAAkBU,IAAI;4BAAEN,UAAAA,EAAY;AAAa,yBAAA;AAC7G,wBAAA;4BAAER,IAAAA,EAAM,aAAA;4BAAeC,KAAAA,EAAO,aAAA;4BAAeC,KAAAA,EAAO,SAAA;AAAWC,4BAAAA,SAAAA,EAAWC,kBAAkBW,WAAW;4BAAEP,UAAAA,EAAY,cAAA;4BAAgBC,WAAAA,EAAa;gCAAEC,QAAAA,EAAU;AAAK;AAAE;AACxK;AACL;AACJ;AACH;AACL;;;"}
|
|
@@ -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;
|
|
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,YA+BjC,CAAC;AAKF,eAAO,MAAM,WAAW,EAAE,kBAIzB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PackageKind } from '@cratis/scene.model';
|
|
2
2
|
import { coreComponents } from './coreComponents.js';
|
|
3
|
+
import { coreDescriptors } from './coreDescriptors.js';
|
|
3
4
|
|
|
4
5
|
// Copyright (c) Cratis. All rights reserved.
|
|
5
6
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
@@ -28,7 +29,8 @@ import { coreComponents } from './coreComponents.js';
|
|
|
28
29
|
'summary',
|
|
29
30
|
'field',
|
|
30
31
|
'code',
|
|
31
|
-
'file'
|
|
32
|
+
'file',
|
|
33
|
+
'navigationBar'
|
|
32
34
|
],
|
|
33
35
|
layouts: [],
|
|
34
36
|
screenTemplates: [],
|
|
@@ -44,7 +46,8 @@ import { coreComponents } from './coreComponents.js';
|
|
|
44
46
|
* The `core` package as a loadable bundle.
|
|
45
47
|
*/ const corePackage = {
|
|
46
48
|
manifest: corePackageManifest,
|
|
47
|
-
components: coreComponents
|
|
49
|
+
components: coreComponents,
|
|
50
|
+
descriptors: coreDescriptors
|
|
48
51
|
};
|
|
49
52
|
|
|
50
53
|
export { corePackage, corePackageManifest };
|
|
@@ -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';\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 ],\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};\n"],"names":["corePackageManifest","name","version","kind","PackageKind","ComponentLibrary","dependencies","components","layouts","screenTemplates","dialogTemplates","themes","displayName","description","module","license","licenseUrl","corePackage","manifest","coreComponents"],"mappings":"
|
|
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 ],\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;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
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './CoreText';
|
|
2
2
|
export * from './CoreButton';
|
|
3
3
|
export * from './CoreCard';
|
|
4
|
+
export * from './CoreNavigationBar';
|
|
5
|
+
export * from './coreDescriptors';
|
|
4
6
|
export * from './ScreenplayCoreComponents';
|
|
5
7
|
export * from './coreComponents';
|
|
6
8
|
export * from './corePackage';
|
|
@@ -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,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,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
package/dist/esm/core/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './CoreText';
|
|
2
2
|
export * from './CoreButton';
|
|
3
3
|
export * from './CoreCard';
|
|
4
|
+
export * from './CoreNavigationBar';
|
|
5
|
+
export * from './coreDescriptors';
|
|
4
6
|
export * from './ScreenplayCoreComponents';
|
|
5
7
|
export * from './coreComponents';
|
|
6
8
|
export * from './corePackage';
|
|
@@ -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,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,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -5,6 +5,8 @@ export { InteractiveComponent } from './renderer/InteractiveComponent.js';
|
|
|
5
5
|
export { CoreText } from './core/CoreText.js';
|
|
6
6
|
export { CoreButton } from './core/CoreButton.js';
|
|
7
7
|
export { CoreCard } from './core/CoreCard.js';
|
|
8
|
+
export { CoreNavigationBar } from './core/CoreNavigationBar.js';
|
|
9
|
+
export { coreDescriptors } from './core/coreDescriptors.js';
|
|
8
10
|
export { CoreAction, CoreCode, CoreColumn, CoreData, CoreField, CoreFile, CoreNavigate, CoreSection, CoreSummary, CoreTable, CoreTitle } from './core/ScreenplayCoreComponents.js';
|
|
9
11
|
export { coreComponents } from './core/coreComponents.js';
|
|
10
12
|
export { corePackage, corePackageManifest } from './core/corePackage.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":";;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DialogTemplate, Layout, ScenePackage, Screen, ScreenTemplate, Theme } from '@cratis/scene.model';
|
|
1
|
+
import { ComponentDescriptor, DialogTemplate, Layout, ScenePackage, Screen, ScreenTemplate, Theme } from '@cratis/scene.model';
|
|
2
2
|
import { ComponentRegistry } from '../renderer';
|
|
3
3
|
export interface ScenePackageBundle {
|
|
4
4
|
manifest: ScenePackage;
|
|
@@ -7,6 +7,7 @@ export interface ScenePackageBundle {
|
|
|
7
7
|
screenTemplates?: ScreenTemplate[];
|
|
8
8
|
dialogTemplates?: DialogTemplate[];
|
|
9
9
|
screens?: Screen[];
|
|
10
|
+
descriptors?: ComponentDescriptor[];
|
|
10
11
|
themes?: Theme[];
|
|
11
12
|
}
|
|
12
13
|
export declare function componentRegistryKey(packageName: string, componentName: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScenePackageBundle.d.ts","sourceRoot":"","sources":["../../../packages/ScenePackageBundle.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ScenePackageBundle.d.ts","sourceRoot":"","sources":["../../../packages/ScenePackageBundle.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,EAAqB,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAClJ,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAchD,MAAM,WAAW,kBAAkB;IAK/B,QAAQ,EAAE,YAAY,CAAC;IAKvB,UAAU,EAAE,iBAAiB,CAAC;IAK9B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAMnB,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IAKnC,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IAMnC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAQnB,WAAW,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAKpC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;CACpB;AAYD,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAEvF;AAWD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,EAAE,CA+C1E;AA6CD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,iBAAiB,CAEvF"}
|