@cratis/scene.react 4.20.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.
Files changed (36) hide show
  1. package/NavBar/extractNavigationItem.ts +13 -3
  2. package/core/CoreToolbar.tsx +153 -0
  3. package/core/coreComponents.ts +3 -0
  4. package/core/corePackage.ts +2 -0
  5. package/core/index.ts +1 -0
  6. package/dist/cjs/NavBar/extractNavigationItem.js +12 -3
  7. package/dist/cjs/NavBar/extractNavigationItem.js.map +1 -1
  8. package/dist/cjs/core/CoreToolbar.js +183 -0
  9. package/dist/cjs/core/CoreToolbar.js.map +1 -0
  10. package/dist/cjs/core/coreComponents.js +4 -1
  11. package/dist/cjs/core/coreComponents.js.map +1 -1
  12. package/dist/cjs/core/corePackage.js +3 -1
  13. package/dist/cjs/core/corePackage.js.map +1 -1
  14. package/dist/cjs/index.js +5 -0
  15. package/dist/cjs/index.js.map +1 -1
  16. package/dist/esm/NavBar/extractNavigationItem.d.ts.map +1 -1
  17. package/dist/esm/NavBar/extractNavigationItem.js +12 -3
  18. package/dist/esm/NavBar/extractNavigationItem.js.map +1 -1
  19. package/dist/esm/core/CoreToolbar.d.ts +8 -0
  20. package/dist/esm/core/CoreToolbar.d.ts.map +1 -0
  21. package/dist/esm/core/CoreToolbar.js +178 -0
  22. package/dist/esm/core/CoreToolbar.js.map +1 -0
  23. package/dist/esm/core/coreComponents.d.ts.map +1 -1
  24. package/dist/esm/core/coreComponents.js +4 -1
  25. package/dist/esm/core/coreComponents.js.map +1 -1
  26. package/dist/esm/core/corePackage.d.ts.map +1 -1
  27. package/dist/esm/core/corePackage.js +3 -1
  28. package/dist/esm/core/corePackage.js.map +1 -1
  29. package/dist/esm/core/index.d.ts +1 -0
  30. package/dist/esm/core/index.d.ts.map +1 -1
  31. package/dist/esm/core/index.js +1 -0
  32. package/dist/esm/core/index.js.map +1 -1
  33. package/dist/esm/index.js +1 -0
  34. package/dist/esm/index.js.map +1 -1
  35. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  36. package/package.json +5 -5
@@ -1,12 +1,13 @@
1
1
  // Copyright (c) Cratis. All rights reserved.
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
 
4
- import { BindingExpression, Contribution, ExternalComponent, NavigationItem } from '@cratis/scene.model';
4
+ import { BindingExpression, Contribution, DestinationReference, ExternalComponent, NavigationItem } from '@cratis/scene.model';
5
5
 
6
6
  /**
7
7
  * Reads a {@link NavigationItem} out of a {@link Contribution} to the built-in `Navigation` contribution
8
8
  * point. `Contribution.content` carries an {@link ExternalComponent} whose open `properties` bag holds the
9
- * navigation-specific values (`label`, `targetScreen`, `routeParameterBindings`, `order`, `group`) - the
9
+ * navigation-specific values (`label`, `targetScreen`, `routeParameterBindings`, `order`, `group`, and the
10
+ * optional `id`, `icon`, `presentation`, `destination` and `hierarchy`) - the
10
11
  * same names as {@link NavigationItem}'s own fields. This property-bag contract is Scene#2's own choice,
11
12
  * made without a real Screenplay-to-Scene translation to confirm it against (Stage#37 hasn't been built
12
13
  * yet) - whoever builds that seam should either produce contributions matching this contract or this
@@ -21,20 +22,29 @@ export function extractNavigationItem(contribution: Contribution): NavigationIte
21
22
  return undefined;
22
23
  }
23
24
 
24
- const { label, targetScreen, routeParameterBindings, order, group } = content.properties as Record<string, unknown>;
25
+ const { id, label, icon, presentation, targetScreen, routeParameterBindings, destination, order, group, hierarchy } = content.properties as Record<string, unknown>;
25
26
  if (typeof label !== 'string' || typeof targetScreen !== 'string') {
26
27
  return undefined;
27
28
  }
28
29
 
29
30
  return {
31
+ id: typeof id === 'string' ? id : undefined,
30
32
  label,
33
+ icon: typeof icon === 'string' ? icon : undefined,
34
+ presentation: typeof presentation === 'string' ? presentation : undefined,
31
35
  targetScreen,
32
36
  routeParameterBindings: isBindingExpressionRecord(routeParameterBindings) ? routeParameterBindings : {},
33
37
  order: typeof order === 'number' ? order : contribution.order,
38
+ destination: isDestination(destination) ? destination : undefined,
34
39
  group: typeof group === 'string' ? group : undefined,
40
+ hierarchy: Array.isArray(hierarchy) ? hierarchy.filter((part): part is string => typeof part === 'string') : undefined,
35
41
  };
36
42
  }
37
43
 
44
+ function isDestination(value: unknown): value is DestinationReference {
45
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
46
+ }
47
+
38
48
  function isBindingExpressionRecord(value: unknown): value is Record<string, BindingExpression> {
39
49
  return typeof value === 'object' && value !== null && !Array.isArray(value);
40
50
  }
@@ -0,0 +1,153 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { useContext } from 'react';
5
+ import { BindingScope, resolveBindingExpression } from '@cratis/scene.engine';
6
+ import { BindingExpression, BindingSourceKind, DestinationKind, DestinationReference } from '@cratis/scene.model';
7
+ import { RegisteredComponentProps, useRenderBindingScope } from '../renderer';
8
+ import { SceneNavigationContextInternal } from '../navigation/SceneNavigationContext';
9
+
10
+ /** How a toolbar item shows its icon and label - the `mode` an item's presentation hint can name. */
11
+ export type ToolbarItemMode = 'icon' | 'text' | 'both';
12
+
13
+ function textProperty(properties: Record<string, unknown>, name: string): string | undefined {
14
+ return typeof properties[name] === 'string' ? properties[name] : undefined;
15
+ }
16
+
17
+ function recordProperty(properties: Record<string, unknown>, name: string): Record<string, unknown> {
18
+ const value = properties[name];
19
+ return value !== null && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {};
20
+ }
21
+
22
+ function isDestination(value: unknown): value is DestinationReference {
23
+ if (value === null || typeof value !== 'object' || Array.isArray(value)) return false;
24
+ return ['screen', 'module', 'route', 'dialog', 'outlet'].some(key => typeof (value as Record<string, unknown>)[key] === 'string');
25
+ }
26
+
27
+ function isBinding(value: unknown): value is BindingExpression {
28
+ return value !== null && typeof value === 'object' && typeof (value as BindingExpression).path === 'string';
29
+ }
30
+
31
+ function literal(value: unknown): BindingExpression {
32
+ return { kind: BindingSourceKind.Literal, path: '', value } as BindingExpression;
33
+ }
34
+
35
+ function resolveParameters(parameters: Record<string, unknown>, scope: BindingScope): Record<string, unknown> {
36
+ return Object.fromEntries(Object.entries(parameters).map(([name, binding]) =>
37
+ [name, isBinding(binding) ? resolveBindingExpression(binding, scope) : binding]));
38
+ }
39
+
40
+ /**
41
+ * An authored destination with its route parameters read now, against the scope the item renders in.
42
+ *
43
+ * A navigation host resolves a destination against its own scope, which cannot see what the screen's components
44
+ * publish - a table's selected row, an input's value - so the item resolves them where it is, and hands the host
45
+ * literals. (The renderer leaves a destination's bindings alone, unlike the rest of an element's properties.)
46
+ */
47
+ function withResolvedParameters(destination: DestinationReference, scope: BindingScope): DestinationReference {
48
+ const bindings = destination.routeParameterBindings;
49
+ if (!bindings) return destination;
50
+ return {
51
+ ...destination,
52
+ routeParameterBindings: Object.fromEntries(Object.entries(bindings).map(([name, binding]) =>
53
+ [name, literal(resolveBindingExpression(binding, scope))])),
54
+ };
55
+ }
56
+
57
+ /** The mode the item's authored presentation asks for; anything it does not name shows both. */
58
+ export function toolbarItemMode(presentation: Record<string, unknown>): ToolbarItemMode {
59
+ const mode = presentation.mode;
60
+ return mode === 'icon' || mode === 'text' ? mode : 'both';
61
+ }
62
+
63
+ /**
64
+ * Where activating a toolbar item goes.
65
+ *
66
+ * The destination the document authored wins. Without one, a `Navigate` item opens its target screen - its
67
+ * parameters become route parameter bindings - and a `Dialog` item opens its target dialog template.
68
+ */
69
+ export function toolbarItemDestination(properties: Record<string, unknown>): DestinationReference | undefined {
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'))
76
+ .map(([name, value]) => [name, literal(value)])) as Record<string, BindingExpression>;
77
+ if (kind === 'navigate') return { screen: target, routeParameterBindings };
78
+ if (kind === 'dialog') return { kind: DestinationKind.Dialog, dialog: target, routeParameterBindings };
79
+ return undefined;
80
+ }
81
+
82
+ /**
83
+ * The `core:toolbar` component: the items a screen's toolbar groups, in the order they were authored.
84
+ * The items are `core:toolbarItem` elements in its `items` slot.
85
+ */
86
+ export function CoreToolbar({ element, slots }: RegisteredComponentProps) {
87
+ const name = textProperty(element.properties, 'name');
88
+ return <div data-scene-id={element.id} data-scene-toolbar={name} role='toolbar' aria-label={name}>{slots.items}</div>;
89
+ }
90
+
91
+ /**
92
+ * The `core:toolbarItem` component: one toolbar entry with a label, an icon, presentation hints and what it does.
93
+ *
94
+ * - An `Action` item announces the command it targets with the host-neutral `cratis.scene.command` event, carrying its
95
+ * parameters resolved against the binding scope.
96
+ * - A `Navigate` or `Dialog` item executes its destination through the enclosing navigation host - a screen in an
97
+ * outlet, a dialog - and, outside one, announces it with the host-neutral `cratis.scene.navigate` event.
98
+ *
99
+ * Presentation: `mode` is `icon`, `text` or `both` (the default); an icon-only item keeps its label as its accessible name.
100
+ * Every presentation hint - `placement`, `density` or whatever a package reads - is also carried on the node as a
101
+ * `data-scene-presentation-<name>` attribute so a theme can style by it.
102
+ */
103
+ export function CoreToolbarItem({ element }: RegisteredComponentProps) {
104
+ const navigation = useContext(SceneNavigationContextInternal);
105
+ const scope = useRenderBindingScope();
106
+ const name = textProperty(element.properties, 'name') ?? element.id;
107
+ const kind = textProperty(element.properties, 'kind')?.toLowerCase();
108
+ const target = textProperty(element.properties, 'target') ?? '';
109
+ const label = textProperty(element.properties, 'label') ?? name;
110
+ const icon = textProperty(element.properties, 'icon');
111
+ const presentation = recordProperty(element.properties, 'presentation');
112
+ const mode = toolbarItemMode(presentation);
113
+ const destination = toolbarItemDestination(element.properties);
114
+ const attributes = Object.fromEntries(Object.entries(presentation)
115
+ .filter(([key]) => /^[A-Za-z][A-Za-z0-9-]*$/.test(key))
116
+ .map(([key, value]) => [`data-scene-presentation-${key.toLowerCase()}`, String(value)]));
117
+
118
+ const activate = () => {
119
+ if (kind === 'action') {
120
+ const args = resolveParameters(recordProperty(element.properties, 'parameters'), scope);
121
+ globalThis.dispatchEvent(new CustomEvent('cratis.scene.command', { detail: { command: target, element, arguments: args } }));
122
+ return;
123
+ }
124
+
125
+ if (!destination) return;
126
+ const resolved = withResolvedParameters(destination, scope);
127
+ if (navigation) {
128
+ navigation.navigate(resolved);
129
+ } else {
130
+ globalThis.dispatchEvent(new CustomEvent('cratis.scene.navigate', {
131
+ detail: { targetScreen: destination.screen ?? '', dialog: destination.dialog, destination: resolved, element },
132
+ }));
133
+ }
134
+ };
135
+
136
+ return (
137
+ <button
138
+ type='button'
139
+ data-scene-id={element.id}
140
+ data-scene-toolbar-item={name}
141
+ data-scene-icon={icon}
142
+ data-scene-mode={mode}
143
+ aria-label={mode === 'icon' ? label : undefined}
144
+ title={mode === 'icon' ? label : undefined}
145
+ disabled={kind !== 'action' && !destination}
146
+ onClick={activate}
147
+ {...attributes}
148
+ >
149
+ {mode !== 'text' && icon && <span aria-hidden='true' data-scene-icon-name={icon} />}
150
+ {mode !== 'icon' && label}
151
+ </button>
152
+ );
153
+ }
@@ -7,6 +7,7 @@ import { CoreText } from './CoreText';
7
7
  import { CoreButton } from './CoreButton';
8
8
  import { CoreCard } from './CoreCard';
9
9
  import { CoreNavigationBar } from './CoreNavigationBar';
10
+ import { CoreToolbar, CoreToolbarItem } from './CoreToolbar';
10
11
  import { CoreOutlet } from '../navigation/CoreOutlet';
11
12
  import {
12
13
  CoreAction,
@@ -43,4 +44,6 @@ export const coreComponents: ComponentRegistry = {
43
44
  [componentRegistryKey('core', 'file')]: CoreFile,
44
45
  [componentRegistryKey('core', 'navigationBar')]: CoreNavigationBar,
45
46
  [componentRegistryKey('core', 'outlet')]: CoreOutlet,
47
+ [componentRegistryKey('core', 'toolbar')]: CoreToolbar,
48
+ [componentRegistryKey('core', 'toolbarItem')]: CoreToolbarItem,
46
49
  };
@@ -35,6 +35,8 @@ export const corePackageManifest: ScenePackage = {
35
35
  'file',
36
36
  'navigationBar',
37
37
  'outlet',
38
+ 'toolbar',
39
+ 'toolbarItem',
38
40
  ],
39
41
  layouts: [],
40
42
  screenTemplates: [],
package/core/index.ts CHANGED
@@ -5,6 +5,7 @@ export * from './CoreText';
5
5
  export * from './CoreButton';
6
6
  export * from './CoreCard';
7
7
  export * from './CoreNavigationBar';
8
+ export * from './CoreToolbar';
8
9
  export * from './coreDescriptors';
9
10
  export * from './ScreenplayCoreComponents';
10
11
  export * from './coreComponents';
@@ -5,7 +5,8 @@
5
5
  /**
6
6
  * Reads a {@link NavigationItem} out of a {@link Contribution} to the built-in `Navigation` contribution
7
7
  * point. `Contribution.content` carries an {@link ExternalComponent} whose open `properties` bag holds the
8
- * navigation-specific values (`label`, `targetScreen`, `routeParameterBindings`, `order`, `group`) - the
8
+ * navigation-specific values (`label`, `targetScreen`, `routeParameterBindings`, `order`, `group`, and the
9
+ * optional `id`, `icon`, `presentation`, `destination` and `hierarchy`) - the
9
10
  * same names as {@link NavigationItem}'s own fields. This property-bag contract is Scene#2's own choice,
10
11
  * made without a real Screenplay-to-Scene translation to confirm it against (Stage#37 hasn't been built
11
12
  * yet) - whoever builds that seam should either produce contributions matching this contract or this
@@ -18,18 +19,26 @@
18
19
  if (!content.properties) {
19
20
  return undefined;
20
21
  }
21
- const { label, targetScreen, routeParameterBindings, order, group } = content.properties;
22
+ const { id, label, icon, presentation, targetScreen, routeParameterBindings, destination, order, group, hierarchy } = content.properties;
22
23
  if (typeof label !== 'string' || typeof targetScreen !== 'string') {
23
24
  return undefined;
24
25
  }
25
26
  return {
27
+ id: typeof id === 'string' ? id : undefined,
26
28
  label,
29
+ icon: typeof icon === 'string' ? icon : undefined,
30
+ presentation: typeof presentation === 'string' ? presentation : undefined,
27
31
  targetScreen,
28
32
  routeParameterBindings: isBindingExpressionRecord(routeParameterBindings) ? routeParameterBindings : {},
29
33
  order: typeof order === 'number' ? order : contribution.order,
30
- group: typeof group === 'string' ? group : undefined
34
+ destination: isDestination(destination) ? destination : undefined,
35
+ group: typeof group === 'string' ? group : undefined,
36
+ hierarchy: Array.isArray(hierarchy) ? hierarchy.filter((part)=>typeof part === 'string') : undefined
31
37
  };
32
38
  }
39
+ function isDestination(value) {
40
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
41
+ }
33
42
  function isBindingExpressionRecord(value) {
34
43
  return typeof value === 'object' && value !== null && !Array.isArray(value);
35
44
  }
@@ -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","value","Array","isArray"],"mappings":";;AAAA;AACA;AAIA;;;;;;;;;;;IAYO,SAASA,qBAAAA,CAAsBC,YAA0B,EAAA;IAC5D,MAAMC,OAAAA,GAAUD,aAAaC,OAAO;IACpC,IAAI,CAACA,OAAAA,CAAQC,UAAU,EAAE;QACrB,OAAOC,SAAAA;AACX,IAAA;AAEA,IAAA,MAAM,EAAEC,KAAK,EAAEC,YAAY,EAAEC,sBAAsB,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGP,QAAQC,UAAU;AACxF,IAAA,IAAI,OAAOE,KAAAA,KAAU,QAAA,IAAY,OAAOC,iBAAiB,QAAA,EAAU;QAC/D,OAAOF,SAAAA;AACX,IAAA;IAEA,OAAO;AACHC,QAAAA,KAAAA;AACAC,QAAAA,YAAAA;QACAC,sBAAAA,EAAwBG,yBAAAA,CAA0BH,sBAAAA,CAAAA,GAA0BA,sBAAAA,GAAyB,EAAC;AACtGC,QAAAA,KAAAA,EAAO,OAAOA,KAAAA,KAAU,QAAA,GAAWA,KAAAA,GAAQP,aAAaO,KAAK;QAC7DC,KAAAA,EAAO,OAAOA,KAAAA,KAAU,QAAA,GAAWA,KAAAA,GAAQL;AAC/C,KAAA;AACJ;AAEA,SAASM,0BAA0BC,KAAc,EAAA;IAC7C,OAAO,OAAOA,UAAU,QAAA,IAAYA,KAAAA,KAAU,QAAQ,CAACC,KAAAA,CAAMC,OAAO,CAACF,KAAAA,CAAAA;AACzE;;"}
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","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,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,183 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var scene_engine = require('@cratis/scene.engine');
6
+ var scene_model = require('@cratis/scene.model');
7
+ var RenderBindingScopeContext = require('../renderer/RenderBindingScopeContext.js');
8
+ require('../interactions/useInteractions.js');
9
+ require('../interactions/NotificationHost.js');
10
+ var SceneNavigationContext = require('../navigation/SceneNavigationContext.js');
11
+
12
+ function textProperty(properties, name) {
13
+ return typeof properties[name] === 'string' ? properties[name] : undefined;
14
+ }
15
+ function recordProperty(properties, name) {
16
+ const value = properties[name];
17
+ return value !== null && typeof value === 'object' && !Array.isArray(value) ? value : {};
18
+ }
19
+ function isDestination(value) {
20
+ if (value === null || typeof value !== 'object' || Array.isArray(value)) return false;
21
+ return [
22
+ 'screen',
23
+ 'module',
24
+ 'route',
25
+ 'dialog',
26
+ 'outlet'
27
+ ].some((key)=>typeof value[key] === 'string');
28
+ }
29
+ function isBinding(value) {
30
+ return value !== null && typeof value === 'object' && typeof value.path === 'string';
31
+ }
32
+ function literal(value) {
33
+ return {
34
+ kind: scene_model.BindingSourceKind.Literal,
35
+ path: '',
36
+ value
37
+ };
38
+ }
39
+ function resolveParameters(parameters, scope) {
40
+ return Object.fromEntries(Object.entries(parameters).map(([name, binding])=>[
41
+ name,
42
+ isBinding(binding) ? scene_engine.resolveBindingExpression(binding, scope) : binding
43
+ ]));
44
+ }
45
+ /**
46
+ * An authored destination with its route parameters read now, against the scope the item renders in.
47
+ *
48
+ * A navigation host resolves a destination against its own scope, which cannot see what the screen's components
49
+ * publish - a table's selected row, an input's value - so the item resolves them where it is, and hands the host
50
+ * literals. (The renderer leaves a destination's bindings alone, unlike the rest of an element's properties.)
51
+ */ function withResolvedParameters(destination, scope) {
52
+ const bindings = destination.routeParameterBindings;
53
+ if (!bindings) return destination;
54
+ return {
55
+ ...destination,
56
+ routeParameterBindings: Object.fromEntries(Object.entries(bindings).map(([name, binding])=>[
57
+ name,
58
+ literal(scene_engine.resolveBindingExpression(binding, scope))
59
+ ]))
60
+ };
61
+ }
62
+ /** The mode the item's authored presentation asks for; anything it does not name shows both. */ function toolbarItemMode(presentation) {
63
+ const mode = presentation.mode;
64
+ return mode === 'icon' || mode === 'text' ? mode : 'both';
65
+ }
66
+ /**
67
+ * Where activating a toolbar item goes.
68
+ *
69
+ * The destination the document authored wins. Without one, a `Navigate` item opens its target screen - its
70
+ * parameters become route parameter bindings - and a `Dialog` item opens its target dialog template.
71
+ */ function toolbarItemDestination(properties) {
72
+ if (isDestination(properties.destination)) return properties.destination;
73
+ const kind = textProperty(properties, 'kind')?.toLowerCase();
74
+ const target = textProperty(properties, 'target');
75
+ if (!target) return undefined;
76
+ // The renderer has already read each parameter's binding by the time the item sees it, so a parameter is a value.
77
+ const routeParameterBindings = Object.fromEntries(Object.entries(recordProperty(properties, 'parameters')).map(([name, value])=>[
78
+ name,
79
+ literal(value)
80
+ ]));
81
+ if (kind === 'navigate') return {
82
+ screen: target,
83
+ routeParameterBindings
84
+ };
85
+ if (kind === 'dialog') return {
86
+ kind: scene_model.DestinationKind.Dialog,
87
+ dialog: target,
88
+ routeParameterBindings
89
+ };
90
+ return undefined;
91
+ }
92
+ /**
93
+ * The `core:toolbar` component: the items a screen's toolbar groups, in the order they were authored.
94
+ * The items are `core:toolbarItem` elements in its `items` slot.
95
+ */ function CoreToolbar({ element, slots }) {
96
+ const name = textProperty(element.properties, 'name');
97
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
98
+ "data-scene-id": element.id,
99
+ "data-scene-toolbar": name,
100
+ role: "toolbar",
101
+ "aria-label": name,
102
+ children: slots.items
103
+ });
104
+ }
105
+ /**
106
+ * The `core:toolbarItem` component: one toolbar entry with a label, an icon, presentation hints and what it does.
107
+ *
108
+ * - An `Action` item announces the command it targets with the host-neutral `cratis.scene.command` event, carrying its
109
+ * parameters resolved against the binding scope.
110
+ * - A `Navigate` or `Dialog` item executes its destination through the enclosing navigation host - a screen in an
111
+ * outlet, a dialog - and, outside one, announces it with the host-neutral `cratis.scene.navigate` event.
112
+ *
113
+ * Presentation: `mode` is `icon`, `text` or `both` (the default); an icon-only item keeps its label as its accessible name.
114
+ * Every presentation hint - `placement`, `density` or whatever a package reads - is also carried on the node as a
115
+ * `data-scene-presentation-<name>` attribute so a theme can style by it.
116
+ */ function CoreToolbarItem({ element }) {
117
+ const navigation = react.useContext(SceneNavigationContext.SceneNavigationContextInternal);
118
+ const scope = RenderBindingScopeContext.useRenderBindingScope();
119
+ const name = textProperty(element.properties, 'name') ?? element.id;
120
+ const kind = textProperty(element.properties, 'kind')?.toLowerCase();
121
+ const target = textProperty(element.properties, 'target') ?? '';
122
+ const label = textProperty(element.properties, 'label') ?? name;
123
+ const icon = textProperty(element.properties, 'icon');
124
+ const presentation = recordProperty(element.properties, 'presentation');
125
+ const mode = toolbarItemMode(presentation);
126
+ const destination = toolbarItemDestination(element.properties);
127
+ const attributes = Object.fromEntries(Object.entries(presentation).filter(([key])=>/^[A-Za-z][A-Za-z0-9-]*$/.test(key)).map(([key, value])=>[
128
+ `data-scene-presentation-${key.toLowerCase()}`,
129
+ String(value)
130
+ ]));
131
+ const activate = ()=>{
132
+ if (kind === 'action') {
133
+ const args = resolveParameters(recordProperty(element.properties, 'parameters'), scope);
134
+ globalThis.dispatchEvent(new CustomEvent('cratis.scene.command', {
135
+ detail: {
136
+ command: target,
137
+ element,
138
+ arguments: args
139
+ }
140
+ }));
141
+ return;
142
+ }
143
+ if (!destination) return;
144
+ const resolved = withResolvedParameters(destination, scope);
145
+ if (navigation) {
146
+ navigation.navigate(resolved);
147
+ } else {
148
+ globalThis.dispatchEvent(new CustomEvent('cratis.scene.navigate', {
149
+ detail: {
150
+ targetScreen: destination.screen ?? '',
151
+ dialog: destination.dialog,
152
+ destination: resolved,
153
+ element
154
+ }
155
+ }));
156
+ }
157
+ };
158
+ return /*#__PURE__*/ jsxRuntime.jsxs("button", {
159
+ type: "button",
160
+ "data-scene-id": element.id,
161
+ "data-scene-toolbar-item": name,
162
+ "data-scene-icon": icon,
163
+ "data-scene-mode": mode,
164
+ "aria-label": mode === 'icon' ? label : undefined,
165
+ title: mode === 'icon' ? label : undefined,
166
+ disabled: kind !== 'action' && !destination,
167
+ onClick: activate,
168
+ ...attributes,
169
+ children: [
170
+ mode !== 'text' && icon && /*#__PURE__*/ jsxRuntime.jsx("span", {
171
+ "aria-hidden": "true",
172
+ "data-scene-icon-name": icon
173
+ }),
174
+ mode !== 'icon' && label
175
+ ]
176
+ });
177
+ }
178
+
179
+ exports.CoreToolbar = CoreToolbar;
180
+ exports.CoreToolbarItem = CoreToolbarItem;
181
+ exports.toolbarItemDestination = toolbarItemDestination;
182
+ exports.toolbarItemMode = toolbarItemMode;
183
+ //# 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,QAAA,OAAA;AAAS,QAAA,QAAA;AAAU,QAAA;KAAS,CAACI,IAAI,CAACC,CAAAA,GAAAA,GAAO,OAAO,KAAkC,CAACA,GAAAA,CAAI,KAAK,QAAA,CAAA;AAC5H;AAEA,SAASC,UAAUN,KAAc,EAAA;IAC7B,OAAOA,KAAAA,KAAU,QAAQ,OAAOA,KAAAA,KAAU,YAAY,OAAQA,KAAAA,CAA4BO,IAAI,KAAK,QAAA;AACvG;AAEA,SAASC,QAAQR,KAAc,EAAA;IAC3B,OAAO;AAAES,QAAAA,IAAAA,EAAMC,8BAAkBC,OAAO;QAAEJ,IAAAA,EAAM,EAAA;AAAIP,QAAAA;AAAM,KAAA;AAC9D;AAEA,SAASY,iBAAAA,CAAkBC,UAAmC,EAAEC,KAAmB,EAAA;AAC/E,IAAA,OAAO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GJ,UAAU;;YAEb1B,IAAAA,KAAS,MAAA,IAAUyB,sBAAQd,cAAA,CAACuC,MAAAA,EAAAA;gBAAKC,aAAAA,EAAY,MAAA;gBAAOC,sBAAAA,EAAsB3B;;AAC1EzB,YAAAA,IAAAA,KAAS,MAAA,IAAUwB;;;AAGhC;;;;;"}
@@ -13,6 +13,7 @@ var CoreText = require('./CoreText.js');
13
13
  var CoreButton = require('./CoreButton.js');
14
14
  var CoreCard = require('./CoreCard.js');
15
15
  var CoreNavigationBar = require('./CoreNavigationBar.js');
16
+ var CoreToolbar = require('./CoreToolbar.js');
16
17
  var ScreenplayCoreComponents = require('./ScreenplayCoreComponents.js');
17
18
 
18
19
  // Copyright (c) Cratis. All rights reserved.
@@ -36,7 +37,9 @@ var ScreenplayCoreComponents = require('./ScreenplayCoreComponents.js');
36
37
  [ScenePackageBundle.componentRegistryKey('core', 'code')]: ScreenplayCoreComponents.CoreCode,
37
38
  [ScenePackageBundle.componentRegistryKey('core', 'file')]: ScreenplayCoreComponents.CoreFile,
38
39
  [ScenePackageBundle.componentRegistryKey('core', 'navigationBar')]: CoreNavigationBar.CoreNavigationBar,
39
- [ScenePackageBundle.componentRegistryKey('core', 'outlet')]: CoreOutlet.CoreOutlet
40
+ [ScenePackageBundle.componentRegistryKey('core', 'outlet')]: CoreOutlet.CoreOutlet,
41
+ [ScenePackageBundle.componentRegistryKey('core', 'toolbar')]: CoreToolbar.CoreToolbar,
42
+ [ScenePackageBundle.componentRegistryKey('core', 'toolbarItem')]: CoreToolbar.CoreToolbarItem
40
43
  };
41
44
 
42
45
  exports.coreComponents = 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":";;;;;;;;;;;;;;;;;AAAA;AACA;AAuBA;;;UAIaA,cAAAA,GAAoC;IAC7C,CAACC,uCAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUC,iBAAAA;IACxC,CAACD,uCAAAA,CAAqB,MAAA,EAAQ,QAAA,CAAA,GAAYE,qBAAAA;IAC1C,CAACF,uCAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUG,iBAAAA;IACxC,CAACH,uCAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUI,iCAAAA;IACxC,CAACJ,uCAAAA,CAAqB,MAAA,EAAQ,QAAA,CAAA,GAAYK,mCAAAA;IAC1C,CAACL,uCAAAA,CAAqB,MAAA,EAAQ,SAAA,CAAA,GAAaM,oCAAAA;IAC3C,CAACN,uCAAAA,CAAqB,MAAA,EAAQ,UAAA,CAAA,GAAcO,qCAAAA;IAC5C,CAACP,uCAAAA,CAAqB,MAAA,EAAQ,OAAA,CAAA,GAAWQ,kCAAAA;IACzC,CAACR,uCAAAA,CAAqB,MAAA,EAAQ,OAAA,CAAA,GAAWS,kCAAAA;IACzC,CAACT,uCAAAA,CAAqB,MAAA,EAAQ,QAAA,CAAA,GAAYU,mCAAAA;IAC1C,CAACV,uCAAAA,CAAqB,MAAA,EAAQ,SAAA,CAAA,GAAaW,oCAAAA;IAC3C,CAACX,uCAAAA,CAAqB,MAAA,EAAQ,OAAA,CAAA,GAAWY,kCAAAA;IACzC,CAACZ,uCAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUa,iCAAAA;IACxC,CAACb,uCAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUc,iCAAAA;IACxC,CAACd,uCAAAA,CAAqB,MAAA,EAAQ,eAAA,CAAA,GAAmBe,mCAAAA;IACjD,CAACf,uCAAAA,CAAqB,MAAA,EAAQ,QAAA,CAAA,GAAYgB;AAC9C;;"}
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,uCAAAA,CAAqB,MAAA,EAAQ,MAAA,CAAA,GAAUC,iBAAAA;IACxC,CAACD,uCAA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
34
  'file',
35
35
  'navigationBar',
36
- 'outlet'
36
+ 'outlet',
37
+ 'toolbar',
38
+ 'toolbarItem'
37
39
  ],
38
40
  layouts: [],
39
41
  screenTemplates: [],
@@ -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,wBAAYC,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,6BAAAA;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,wBAAYC,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,6BAAAA;IACZC,WAAAA,EAAaC;AACjB;;;"}
package/dist/cjs/index.js CHANGED
@@ -14,6 +14,7 @@ var CoreText = require('./core/CoreText.js');
14
14
  var CoreButton = require('./core/CoreButton.js');
15
15
  var CoreCard = require('./core/CoreCard.js');
16
16
  var CoreNavigationBar = require('./core/CoreNavigationBar.js');
17
+ var CoreToolbar = require('./core/CoreToolbar.js');
17
18
  var coreDescriptors = require('./core/coreDescriptors.js');
18
19
  var ScreenplayCoreComponents = require('./core/ScreenplayCoreComponents.js');
19
20
  var coreComponents = require('./core/coreComponents.js');
@@ -89,6 +90,10 @@ exports.CoreText = CoreText.CoreText;
89
90
  exports.CoreButton = CoreButton.CoreButton;
90
91
  exports.CoreCard = CoreCard.CoreCard;
91
92
  exports.CoreNavigationBar = CoreNavigationBar.CoreNavigationBar;
93
+ exports.CoreToolbar = CoreToolbar.CoreToolbar;
94
+ exports.CoreToolbarItem = CoreToolbar.CoreToolbarItem;
95
+ exports.toolbarItemDestination = CoreToolbar.toolbarItemDestination;
96
+ exports.toolbarItemMode = CoreToolbar.toolbarItemMode;
92
97
  exports.coreDescriptors = coreDescriptors.coreDescriptors;
93
98
  exports.CoreAction = ScreenplayCoreComponents.CoreAction;
94
99
  exports.CoreCode = ScreenplayCoreComponents.CoreCode;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"extractNavigationItem.d.ts","sourceRoot":"","sources":["../../../NavBar/extractNavigationItem.ts"],"names":[],"mappings":"AAGA,OAAO,EAAqB,YAAY,EAAqB,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAczG,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,YAAY,GAAG,cAAc,GAAG,SAAS,CAkB5F"}
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"}