@cratis/scene.components 4.15.0 → 4.17.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 (62) hide show
  1. package/cratisComponentsDescriptors.ts +16 -0
  2. package/cratisComponentsPackage.ts +9 -125
  3. package/cratisComponentsPackageManifest.ts +106 -0
  4. package/cratisComponentsRuntimePackage.ts +22 -0
  5. package/designTime/cratisComponentsDesignTime.ts +22 -0
  6. package/dist/cjs/cratisComponentsDescriptors.js +68 -1
  7. package/dist/cjs/cratisComponentsDescriptors.js.map +1 -1
  8. package/dist/cjs/cratisComponentsPackage.js +10 -144
  9. package/dist/cjs/cratisComponentsPackage.js.map +1 -1
  10. package/dist/cjs/cratisComponentsPackageManifest.js +126 -0
  11. package/dist/cjs/cratisComponentsPackageManifest.js.map +1 -0
  12. package/dist/cjs/cratisComponentsRuntimePackage.js +24 -0
  13. package/dist/cjs/cratisComponentsRuntimePackage.js.map +1 -0
  14. package/dist/cjs/designTime/cratisComponentsDesignTime.js +24 -0
  15. package/dist/cjs/designTime/cratisComponentsDesignTime.js.map +1 -0
  16. package/dist/cjs/forms/generateCommandFieldsAction.js +10 -1
  17. package/dist/cjs/forms/generateCommandFieldsAction.js.map +1 -1
  18. package/dist/cjs/index.js +6 -1
  19. package/dist/cjs/index.js.map +1 -1
  20. package/dist/cjs/runtime.js +15 -0
  21. package/dist/cjs/runtime.js.map +1 -0
  22. package/dist/cjs/toolbar/SceneToolbarButton.js +34 -2
  23. package/dist/cjs/toolbar/SceneToolbarButton.js.map +1 -1
  24. package/dist/esm/cratisComponentsDescriptors.d.ts.map +1 -1
  25. package/dist/esm/cratisComponentsDescriptors.js +68 -1
  26. package/dist/esm/cratisComponentsDescriptors.js.map +1 -1
  27. package/dist/esm/cratisComponentsPackage.d.ts +1 -2
  28. package/dist/esm/cratisComponentsPackage.d.ts.map +1 -1
  29. package/dist/esm/cratisComponentsPackage.js +10 -144
  30. package/dist/esm/cratisComponentsPackage.js.map +1 -1
  31. package/dist/esm/cratisComponentsPackageManifest.d.ts +3 -0
  32. package/dist/esm/cratisComponentsPackageManifest.d.ts.map +1 -0
  33. package/dist/esm/cratisComponentsPackageManifest.js +124 -0
  34. package/dist/esm/cratisComponentsPackageManifest.js.map +1 -0
  35. package/dist/esm/cratisComponentsRuntimePackage.d.ts +3 -0
  36. package/dist/esm/cratisComponentsRuntimePackage.d.ts.map +1 -0
  37. package/dist/esm/cratisComponentsRuntimePackage.js +22 -0
  38. package/dist/esm/cratisComponentsRuntimePackage.js.map +1 -0
  39. package/dist/esm/designTime/cratisComponentsDesignTime.d.ts +3 -0
  40. package/dist/esm/designTime/cratisComponentsDesignTime.d.ts.map +1 -0
  41. package/dist/esm/designTime/cratisComponentsDesignTime.js +22 -0
  42. package/dist/esm/designTime/cratisComponentsDesignTime.js.map +1 -0
  43. package/dist/esm/forms/generateCommandFieldsAction.js +10 -1
  44. package/dist/esm/forms/generateCommandFieldsAction.js.map +1 -1
  45. package/dist/esm/index.d.ts +2 -0
  46. package/dist/esm/index.d.ts.map +1 -1
  47. package/dist/esm/index.js +4 -1
  48. package/dist/esm/index.js.map +1 -1
  49. package/dist/esm/runtime.d.ts +5 -0
  50. package/dist/esm/runtime.d.ts.map +1 -0
  51. package/dist/esm/runtime.js +5 -0
  52. package/dist/esm/runtime.js.map +1 -0
  53. package/dist/esm/toolbar/SceneToolbarButton.d.ts +1 -1
  54. package/dist/esm/toolbar/SceneToolbarButton.d.ts.map +1 -1
  55. package/dist/esm/toolbar/SceneToolbarButton.js +34 -2
  56. package/dist/esm/toolbar/SceneToolbarButton.js.map +1 -1
  57. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  58. package/forms/generateCommandFieldsAction.ts +5 -1
  59. package/index.ts +2 -0
  60. package/package.json +12 -7
  61. package/runtime.ts +9 -0
  62. package/toolbar/SceneToolbarButton.tsx +24 -2
@@ -87,6 +87,21 @@ const commandFormProperties: PropertyDescriptor[] = [
87
87
  * Arc proxy classes by name and are configured through their own tooling. A package adds a descriptor here the
88
88
  * same way it adds a component to the manifest.
89
89
  */
90
+ const toolbarButtonProperties: PropertyDescriptor[] = [
91
+ { path: 'title', label: 'Label', group: 'Content', valueType: PropertyValueType.String, description: 'The accessible name and tooltip.' },
92
+ { path: 'icon', label: 'Icon', group: 'Content', valueType: PropertyValueType.Icon, editorKind: 'icon' },
93
+ { path: 'text', label: 'Text', group: 'Content', valueType: PropertyValueType.String, description: 'Short text shown instead of the icon.' },
94
+ { path: 'active', label: 'Active', group: 'Presentation', valueType: PropertyValueType.Boolean, default: false },
95
+ {
96
+ path: 'tooltipPosition', label: 'Tooltip position', group: 'Presentation', valueType: PropertyValueType.Enum, default: 'right',
97
+ choices: [{ value: 'top', label: 'Top' }, { value: 'right', label: 'Right' }, { value: 'bottom', label: 'Bottom' }, { value: 'left', label: 'Left' }],
98
+ },
99
+ {
100
+ path: 'destination', label: 'Destination', group: 'Navigation', valueType: PropertyValueType.Destination,
101
+ description: 'The screen, slice or dialog the button opens - executed by the enclosing navigation host.',
102
+ },
103
+ ];
104
+
90
105
  export const cratisComponentsDescriptors: ComponentDescriptor[] = [
91
106
  { component: key('dataTable'), displayName: 'Data table', properties: dataTableProperties },
92
107
  { component: key('table'), displayName: 'Table', properties: dataTableProperties },
@@ -104,4 +119,5 @@ export const cratisComponentsDescriptors: ComponentDescriptor[] = [
104
119
  description: 'Creates a deterministic editable field layout from the selected command metadata.',
105
120
  }],
106
121
  },
122
+ { component: key('toolbarButton'), displayName: 'Toolbar button', properties: toolbarButtonProperties },
107
123
  ];
@@ -1,136 +1,20 @@
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 { PackageKind, ScenePackage } from '@cratis/scene.model';
5
4
  import { ScenePackageBundle } from '@cratis/scene.react';
6
- import { cratisComponents, cratisComponentsPackageName } from './cratisComponents';
7
- import { cratisComponentsDescriptors } from './cratisComponentsDescriptors';
8
- import { CommandFieldPropertyEditor } from './forms/CommandFieldPropertyEditor';
9
- import { CommandFormDesigner } from './forms/CommandFormDesigner';
10
- import { CommandFormLayoutEditor } from './forms/CommandFormLayoutEditor';
11
- import { generateCommandFieldsAction } from './forms/generateCommandFieldsAction';
5
+ import { cratisComponentsDesignTime } from './designTime/cratisComponentsDesignTime';
6
+ import { cratisComponentsRuntimePackage } from './cratisComponentsRuntimePackage';
12
7
 
13
- /**
14
- * The `Cratis.Components` package's declaration - what a profile gets when it lists this package.
15
- *
16
- * This is the concrete case the whole package-dependency mechanism exists for. `@cratis/components` is
17
- * not a self-contained library: every component in it is a wrapper over a PrimeReact widget, and its own
18
- * styling is a `--cratis-*` token layer (`@cratis/components/tokens`) plus the component stylesheets and
19
- * compiled Tailwind utilities in `@cratis/components/styles`. Activate it in a profile without PrimeReact
20
- * and nothing renders; activate it without Tailwind and everything renders unstyled. Both are stated as
21
- * dependencies so a package picker can say so while the profile is being configured, instead of leaving
22
- * it to be discovered when the page opens.
23
- *
24
- * The version ranges are the real ones the library carries. `>=11.0.0` for PrimeReact: version 3.0.0
25
- * declares `primereact@^11` as a peer dependency and is built against version 11's component set, so the
26
- * span across the major boundary that the previous `>=10.9.0` range described is over. The `--cratis-*`
27
- * tokens still resolve a version 10 theme variable as their last fallback, but that is an upgrade-window
28
- * courtesy for an application with a compiled version 10 stylesheet still on the page - not a version of
29
- * PrimeReact this package can be activated against. `^4.0.0` for Tailwind, because the utility sheet is
30
- * compiled against Tailwind 4.
31
- */
32
- export const cratisComponentsPackageManifest: ScenePackage = {
33
- name: cratisComponentsPackageName,
34
- version: '3.0.0',
35
- kind: PackageKind.ComponentLibrary,
36
- dependencies: [
37
- { name: 'PrimeReact', versionRange: '>=11.0.0' },
38
- { name: 'Tailwind', versionRange: '^4.0.0' },
39
- ],
40
- components: [
41
- 'page',
42
- 'dataPage',
43
- 'formElement',
44
- 'singleResult',
45
- 'queryInputForm',
46
- 'dataTable',
47
- 'table',
48
- 'observableDataTable',
49
- 'commandForm',
50
- 'inputTextField',
51
- 'numberField',
52
- 'checkboxField',
53
- 'textAreaField',
54
- 'dropdownField',
55
- 'sliderField',
56
- 'calendarField',
57
- 'colorPickerField',
58
- 'multiSelectField',
59
- 'chipsField',
60
- 'radioButtonField',
61
- 'radioGroupField',
62
- 'dialog',
63
- 'confirmationDialog',
64
- 'busyIndicatorDialog',
65
- 'commandDialog',
66
- 'stepperCommandDialog',
67
- 'icon',
68
- 'tooltip',
69
- 'dropdown',
70
- 'errorBoundary',
71
- 'objectContentEditor',
72
- 'objectNavigationalBar',
73
- 'schemaEditor',
74
- 'timeMachine',
75
- 'filterPanel',
76
- 'toolbar',
77
- 'toolbarButton',
78
- 'toolbarGroup',
79
- 'toolbarSeparator',
80
- ],
81
-
82
- // A component library ships components, and nothing else. Layouts, screen templates and dialog
83
- // templates all belong to a Blueprint: they are decisions about what an application looks like as a
84
- // whole, and this package deliberately makes none of them - it provides the Arc-bound composites a
85
- // template is *built from*, so that a blueprint can place a `dataPage` in a slot and configure it,
86
- // rather than shipping one opinionated data page nobody can rearrange.
87
- layouts: [],
88
- screenTemplates: [],
89
- dialogTemplates: [],
90
-
91
- // No themes either, for a different reason: `@cratis/components` has no palette of its own. It reads
92
- // a `--cratis-*` variable layer that resolves whatever is in front of it - the `--p-*` properties a
93
- // PrimeReact 11 preset emits at runtime, or a Scene theme through this package's token bridge.
94
- // Shipping a theme here would be this library asserting a look it was specifically built not to have.
95
- themes: [],
96
-
97
- displayName: 'Cratis Components',
98
- description: "Cratis' Arc-bound data, form and dialog composites, built on PrimeReact and Tailwind. dataTable and table accept optional object-valued queryArguments for collection queries. singleResult displays one read-only scalar own resultField of an optional model using an explicit query, object queryArguments and enabled: true. queryInputForm commits explicit string inputs on submit to the same optional-single runtime; drafts never execute a query.",
99
- module: '@cratis/scene.components',
100
- license: 'MIT',
101
- licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',
102
- designTime: {
103
- previews: [],
104
- designers: ['commandFormDesigner'],
105
- propertyEditors: ['commandBinding', 'commandFields', 'fieldWidths', 'commandFormLayout'],
106
- propertyDisplays: [],
107
- actions: ['Cratis.Components.commandForm.generateFields'],
108
- },
109
- assets: ['@cratis/components/styles', '@cratis/components/tokens'],
110
- runtimeSingletons: ['react', '@cratis/arc', '@cratis/components'],
111
- };
8
+ export { cratisComponentsPackageManifest } from './cratisComponentsPackageManifest';
112
9
 
113
10
  /**
114
- * The `Cratis.Components` package as a loadable bundle - the manifest above, plus the React components
115
- * behind the names it declares.
11
+ * The `Cratis.Components` package as a loadable bundle - the manifest, the React components behind the names
12
+ * it declares, and the design-time contributions a designer loads.
116
13
  *
117
- * No `layouts`, `screenTemplates`, `dialogTemplates` or `themes` are provided, matching a manifest that
118
- * declares none of them; `validatePackageBundle` is what proves the two halves agree.
14
+ * A runtime host that must not load design-time code imports `cratisComponentsRuntimePackage` from
15
+ * `@cratis/scene.components/runtime` instead; that entry reaches no designer, editor or action.
119
16
  */
120
17
  export const cratisComponentsPackage: ScenePackageBundle = {
121
- manifest: cratisComponentsPackageManifest,
122
- components: cratisComponents,
123
- descriptors: cratisComponentsDescriptors,
124
- designTime: {
125
- designers: {
126
- commandFormDesigner: CommandFormDesigner,
127
- },
128
- propertyEditors: {
129
- commandBinding: CommandFieldPropertyEditor,
130
- commandFormLayout: CommandFormLayoutEditor,
131
- },
132
- actions: {
133
- [generateCommandFieldsAction.descriptor.id]: generateCommandFieldsAction,
134
- },
135
- },
18
+ ...cratisComponentsRuntimePackage,
19
+ designTime: cratisComponentsDesignTime,
136
20
  };
@@ -0,0 +1,106 @@
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 { PackageKind, ScenePackage } from '@cratis/scene.model';
5
+ import { cratisComponentsPackageName } from './cratisComponents';
6
+
7
+ /**
8
+ * The `Cratis.Components` package's declaration - what a profile gets when it lists this package.
9
+ *
10
+ * This is the concrete case the whole package-dependency mechanism exists for. `@cratis/components` is
11
+ * not a self-contained library: every component in it is a wrapper over a PrimeReact widget, and its own
12
+ * styling is a `--cratis-*` token layer (`@cratis/components/tokens`) plus the component stylesheets and
13
+ * compiled Tailwind utilities in `@cratis/components/styles`. Activate it in a profile without PrimeReact
14
+ * and nothing renders; activate it without Tailwind and everything renders unstyled. Both are stated as
15
+ * dependencies so a package picker can say so while the profile is being configured, instead of leaving
16
+ * it to be discovered when the page opens.
17
+ *
18
+ * The version ranges are the real ones the library carries. `>=11.0.0` for PrimeReact: version 3.0.0
19
+ * declares `primereact@^11` as a peer dependency and is built against version 11's component set, so the
20
+ * span across the major boundary that the previous `>=10.9.0` range described is over. The `--cratis-*`
21
+ * tokens still resolve a version 10 theme variable as their last fallback, but that is an upgrade-window
22
+ * courtesy for an application with a compiled version 10 stylesheet still on the page - not a version of
23
+ * PrimeReact this package can be activated against. `^4.0.0` for Tailwind, because the utility sheet is
24
+ * compiled against Tailwind 4.
25
+ */
26
+ export const cratisComponentsPackageManifest: ScenePackage = {
27
+ name: cratisComponentsPackageName,
28
+ version: '3.0.0',
29
+ kind: PackageKind.ComponentLibrary,
30
+ dependencies: [
31
+ { name: 'PrimeReact', versionRange: '>=11.0.0' },
32
+ { name: 'Tailwind', versionRange: '^4.0.0' },
33
+ ],
34
+ components: [
35
+ 'page',
36
+ 'dataPage',
37
+ 'formElement',
38
+ 'singleResult',
39
+ 'queryInputForm',
40
+ 'dataTable',
41
+ 'table',
42
+ 'observableDataTable',
43
+ 'commandForm',
44
+ 'inputTextField',
45
+ 'numberField',
46
+ 'checkboxField',
47
+ 'textAreaField',
48
+ 'dropdownField',
49
+ 'sliderField',
50
+ 'calendarField',
51
+ 'colorPickerField',
52
+ 'multiSelectField',
53
+ 'chipsField',
54
+ 'radioButtonField',
55
+ 'radioGroupField',
56
+ 'dialog',
57
+ 'confirmationDialog',
58
+ 'busyIndicatorDialog',
59
+ 'commandDialog',
60
+ 'stepperCommandDialog',
61
+ 'icon',
62
+ 'tooltip',
63
+ 'dropdown',
64
+ 'errorBoundary',
65
+ 'objectContentEditor',
66
+ 'objectNavigationalBar',
67
+ 'schemaEditor',
68
+ 'timeMachine',
69
+ 'filterPanel',
70
+ 'toolbar',
71
+ 'toolbarButton',
72
+ 'toolbarGroup',
73
+ 'toolbarSeparator',
74
+ ],
75
+
76
+ // A component library ships components, and nothing else. Layouts, screen templates and dialog
77
+ // templates all belong to a Blueprint: they are decisions about what an application looks like as a
78
+ // whole, and this package deliberately makes none of them - it provides the Arc-bound composites a
79
+ // template is *built from*, so that a blueprint can place a `dataPage` in a slot and configure it,
80
+ // rather than shipping one opinionated data page nobody can rearrange.
81
+ layouts: [],
82
+ screenTemplates: [],
83
+ dialogTemplates: [],
84
+
85
+ // No themes either, for a different reason: `@cratis/components` has no palette of its own. It reads
86
+ // a `--cratis-*` variable layer that resolves whatever is in front of it - the `--p-*` properties a
87
+ // PrimeReact 11 preset emits at runtime, or a Scene theme through this package's token bridge.
88
+ // Shipping a theme here would be this library asserting a look it was specifically built not to have.
89
+ themes: [],
90
+
91
+ displayName: 'Cratis Components',
92
+ description: "Cratis' Arc-bound data, form and dialog composites, built on PrimeReact and Tailwind. dataTable and table accept optional object-valued queryArguments for collection queries. singleResult displays one read-only scalar own resultField of an optional model using an explicit query, object queryArguments and enabled: true. queryInputForm commits explicit string inputs on submit to the same optional-single runtime; drafts never execute a query.",
93
+ module: '@cratis/scene.components',
94
+ license: 'MIT',
95
+ licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',
96
+ designTime: {
97
+ previews: [],
98
+ designers: ['commandFormDesigner'],
99
+ // `commandFields` and `fieldWidths` are host editor kinds (Studio implements them); the package does not ship them.
100
+ propertyEditors: ['commandBinding', 'commandFormLayout'],
101
+ propertyDisplays: [],
102
+ actions: ['Cratis.Components.commandForm.generateFields'],
103
+ },
104
+ assets: ['@cratis/components/styles', '@cratis/components/tokens'],
105
+ runtimeSingletons: ['react', '@cratis/arc', '@cratis/components'],
106
+ };
@@ -0,0 +1,22 @@
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 { ScenePackageBundle } from '@cratis/scene.react';
5
+ import { cratisComponents } from './cratisComponents';
6
+ import { cratisComponentsDescriptors } from './cratisComponentsDescriptors';
7
+ import { cratisComponentsPackageManifest } from './cratisComponentsPackageManifest';
8
+
9
+ /**
10
+ * The `Cratis.Components` package without design-time contributions: the manifest, the components and their
11
+ * descriptors. The manifest still names the design-time extensions - that is data a host reads without
12
+ * loading them - but no designer, editor or action module is reachable from this bundle, which is what a
13
+ * runtime host imports from `@cratis/scene.components/runtime`.
14
+ *
15
+ * No `layouts`, `screenTemplates`, `dialogTemplates` or `themes` are provided, matching a manifest that
16
+ * declares none of them; `validatePackageBundle` is what proves the two halves agree.
17
+ */
18
+ export const cratisComponentsRuntimePackage: ScenePackageBundle = {
19
+ manifest: cratisComponentsPackageManifest,
20
+ components: cratisComponents,
21
+ descriptors: cratisComponentsDescriptors,
22
+ };
@@ -0,0 +1,22 @@
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 { DesignTimeBundle } from '@cratis/scene.react';
5
+ import { CommandFieldPropertyEditor } from '../forms/CommandFieldPropertyEditor';
6
+ import { CommandFormDesigner } from '../forms/CommandFormDesigner';
7
+ import { CommandFormLayoutEditor } from '../forms/CommandFormLayoutEditor';
8
+ import { generateCommandFieldsAction } from '../forms/generateCommandFieldsAction';
9
+
10
+ /** Every design-time contribution of `Cratis.Components`, under the names its manifest declares. */
11
+ export const cratisComponentsDesignTime: DesignTimeBundle = {
12
+ designers: {
13
+ commandFormDesigner: CommandFormDesigner,
14
+ },
15
+ propertyEditors: {
16
+ commandBinding: CommandFieldPropertyEditor,
17
+ commandFormLayout: CommandFormLayoutEditor,
18
+ },
19
+ actions: {
20
+ [generateCommandFieldsAction.descriptor.id]: generateCommandFieldsAction,
21
+ },
22
+ };
@@ -230,7 +230,69 @@ const commandFormProperties = [
230
230
  * Only the query-bound tables are described so far; the form, dialog and editor composites carry
231
231
  * Arc proxy classes by name and are configured through their own tooling. A package adds a descriptor here the
232
232
  * same way it adds a component to the manifest.
233
- */ const cratisComponentsDescriptors = [
233
+ */ const toolbarButtonProperties = [
234
+ {
235
+ path: 'title',
236
+ label: 'Label',
237
+ group: 'Content',
238
+ valueType: scene_model.PropertyValueType.String,
239
+ description: 'The accessible name and tooltip.'
240
+ },
241
+ {
242
+ path: 'icon',
243
+ label: 'Icon',
244
+ group: 'Content',
245
+ valueType: scene_model.PropertyValueType.Icon,
246
+ editorKind: 'icon'
247
+ },
248
+ {
249
+ path: 'text',
250
+ label: 'Text',
251
+ group: 'Content',
252
+ valueType: scene_model.PropertyValueType.String,
253
+ description: 'Short text shown instead of the icon.'
254
+ },
255
+ {
256
+ path: 'active',
257
+ label: 'Active',
258
+ group: 'Presentation',
259
+ valueType: scene_model.PropertyValueType.Boolean,
260
+ default: false
261
+ },
262
+ {
263
+ path: 'tooltipPosition',
264
+ label: 'Tooltip position',
265
+ group: 'Presentation',
266
+ valueType: scene_model.PropertyValueType.Enum,
267
+ default: 'right',
268
+ choices: [
269
+ {
270
+ value: 'top',
271
+ label: 'Top'
272
+ },
273
+ {
274
+ value: 'right',
275
+ label: 'Right'
276
+ },
277
+ {
278
+ value: 'bottom',
279
+ label: 'Bottom'
280
+ },
281
+ {
282
+ value: 'left',
283
+ label: 'Left'
284
+ }
285
+ ]
286
+ },
287
+ {
288
+ path: 'destination',
289
+ label: 'Destination',
290
+ group: 'Navigation',
291
+ valueType: scene_model.PropertyValueType.Destination,
292
+ description: 'The screen, slice or dialog the button opens - executed by the enclosing navigation host.'
293
+ }
294
+ ];
295
+ const cratisComponentsDescriptors = [
234
296
  {
235
297
  component: key('dataTable'),
236
298
  displayName: 'Data table',
@@ -260,6 +322,11 @@ const commandFormProperties = [
260
322
  description: 'Creates a deterministic editable field layout from the selected command metadata.'
261
323
  }
262
324
  ]
325
+ },
326
+ {
327
+ component: key('toolbarButton'),
328
+ displayName: 'Toolbar button',
329
+ properties: toolbarButtonProperties
263
330
  }
264
331
  ];
265
332
 
@@ -1 +1 @@
1
- {"version":3,"file":"cratisComponentsDescriptors.js","sources":["../../cratisComponentsDescriptors.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 { BindingMode, BindingSourceKind, ComponentDescriptor, DesignTimeActionPlacement, PropertyDescriptor, PropertyValueType, QueryResultShape } from '@cratis/scene.model';\nimport { componentRegistryKey } from '@cratis/scene.react';\n\n// The package name, spelled out so describing components does not pull every adapter (and its UI dependencies) in\n// with it; the bundle's validation checks each key against the manifest.\nconst key = (name: string) => componentRegistryKey('Cratis.Components', name);\n\n/**\n * The properties every query-bound data table shares: which query feeds it, and the few settings that shape how\n * it shows the result.\n *\n * `query` is a `QueryReference`, so an editor binds it to a host-supplied query candidate and validates the\n * arguments against it. What is stored is a `QueryBinding`; a plain query name - what screens carried before\n * bindings existed - is still read, as a binding with no explicit connections. The columns are not properties:\n * they are the `content` slot's children, edited as nodes.\n */\nconst dataTableProperties: PropertyDescriptor[] = [\n {\n path: 'query', label: 'Query', group: 'Data', valueType: PropertyValueType.QueryReference, editorKind: 'queryBinding',\n description: 'The collection query that feeds the table.',\n constraints: { required: true, resultShapes: [QueryResultShape.Collection] },\n },\n { path: 'emptyMessage', label: 'Empty message', group: 'Content', valueType: PropertyValueType.String, default: '' },\n {\n path: 'dataKey', label: 'Row identity', group: 'Data', valueType: PropertyValueType.String, editorKind: 'resultField',\n description: 'The result field that identifies a row.',\n },\n {\n path: 'globalFilterFields', label: 'Searchable fields', group: 'Data', valueType: PropertyValueType.Object, editorKind: 'resultFieldList',\n description: 'The result fields the table\\'s search box looks in.',\n },\n {\n path: 'selectedItem', label: 'Selected item', group: 'Outputs', valueType: PropertyValueType.Object, readOnly: true,\n output: true, bindingMode: BindingMode.OneWay,\n description: 'The currently selected row, or null after selection is cleared.',\n },\n];\n\nconst commandFormProperties: PropertyDescriptor[] = [\n {\n path: 'command', label: 'Command', group: 'Command', valueType: PropertyValueType.String, editorKind: 'commandBinding',\n constraints: { required: true },\n description: 'The Arc command proxy rendered through the native command form runtime.',\n },\n {\n path: 'mode', label: 'Mode', group: 'Layout', valueType: PropertyValueType.Enum,\n choices: [{ value: 'auto', label: 'Auto' }, { value: 'manual', label: 'Manual' }], default: 'auto',\n description: 'Auto follows command metadata; manual renders explicit inputs inside the same native form boundary.',\n },\n { path: 'columns', label: 'Legacy columns', group: 'Layout', valueType: PropertyValueType.Number, default: 1, description: 'Backward-compatible column count used when no typed layout metadata is authored.' },\n { path: 'layout', label: 'Layout', group: 'Layout', valueType: PropertyValueType.Object, editorKind: 'commandFormLayout', description: 'Typed command-form geometry: columns, gaps and field placements. Independent of auto/manual field generation.' },\n {\n path: 'widthSizeClass', label: 'Width size class', group: 'Layout', valueType: PropertyValueType.Enum, default: 'Regular',\n choices: [{ value: 'Regular', label: 'Regular' }, { value: 'Compact', label: 'Compact' }],\n description: 'The width size class the host evaluated. At Compact the fields of a manual form stack in one column in reading order.',\n },\n { path: 'fieldWidths', label: 'Legacy field widths', group: 'Layout', valueType: PropertyValueType.Object, editorKind: 'fieldWidths' },\n {\n path: 'inputs', label: 'Fields', group: 'Layout', valueType: PropertyValueType.Collection, editorKind: 'commandFields',\n acceptedBindingKinds: [BindingSourceKind.DataContext, BindingSourceKind.ComponentProperty],\n item: {\n label: 'Field',\n properties: [\n { path: 'property', label: 'Property', group: 'Field', valueType: PropertyValueType.String },\n { path: 'type', label: 'Type', group: 'Field', valueType: PropertyValueType.Enum, choices: [{ value: 'string', label: 'String' }, { value: 'guid', label: 'Guid' }] },\n { path: 'label', label: 'Label', group: 'Field', valueType: PropertyValueType.String },\n { path: 'column', label: 'Legacy column', group: 'Layout', valueType: PropertyValueType.Number },\n { path: 'width', label: 'Legacy width token', group: 'Layout', valueType: PropertyValueType.String },\n { path: 'placement', label: 'Placement', group: 'Layout', valueType: PropertyValueType.Object, editorKind: 'commandFormFieldPlacement' },\n ],\n },\n },\n {\n path: 'exclude', label: 'Excluded fields', group: 'Command', valueType: PropertyValueType.Collection,\n item: { label: 'Excluded field', properties: [{ path: 'property', label: 'Property', group: 'Field', valueType: PropertyValueType.String }] },\n },\n { path: 'submitLabel', label: 'Submit label', group: 'Content', valueType: PropertyValueType.String, default: 'Submit' },\n];\n\n/**\n * What can be edited on the `Cratis.Components` package's components.\n *\n * Only the query-bound tables are described so far; the form, dialog and editor composites carry\n * Arc proxy classes by name and are configured through their own tooling. A package adds a descriptor here the\n * same way it adds a component to the manifest.\n */\nexport const cratisComponentsDescriptors: ComponentDescriptor[] = [\n { component: key('dataTable'), displayName: 'Data table', properties: dataTableProperties },\n { component: key('table'), displayName: 'Table', properties: dataTableProperties },\n { component: key('observableDataTable'), displayName: 'Live data table', properties: dataTableProperties },\n {\n component: key('commandForm'),\n displayName: 'Command form',\n editorKind: 'commandFormDesigner',\n properties: commandFormProperties,\n actions: [{\n id: 'Cratis.Components.commandForm.generateFields',\n label: 'Generate fields',\n placement: DesignTimeActionPlacement.Toolbar,\n availability: 'commandForm.canGenerateFields',\n description: 'Creates a deterministic editable field layout from the selected command metadata.',\n }],\n },\n];\n"],"names":["key","name","componentRegistryKey","dataTableProperties","path","label","group","valueType","PropertyValueType","QueryReference","editorKind","description","constraints","required","resultShapes","QueryResultShape","Collection","String","default","Object","readOnly","output","bindingMode","BindingMode","OneWay","commandFormProperties","Enum","choices","value","Number","acceptedBindingKinds","BindingSourceKind","DataContext","ComponentProperty","item","properties","cratisComponentsDescriptors","component","displayName","actions","id","placement","DesignTimeActionPlacement","Toolbar","availability"],"mappings":";;;;;AAAA;AACA;AAKA;AACA;AACA,MAAMA,GAAAA,GAAM,CAACC,IAAAA,GAAiBC,gCAAAA,CAAqB,mBAAA,EAAqBD,IAAAA,CAAAA;AAExE;;;;;;;;AAQC,IACD,MAAME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AA;AAC1F,IAAA;AAAEkC,QAAAA,SAAAA,EAAWrC,GAAAA,CAAI,OAAA,CAAA;QAAUsC,WAAAA,EAAa,OAAA;QAASH,UAAAA,EAAYhC;AAAoB,KAAA;AACjF,IAAA;AAAEkC,QAAAA,SAAAA,EAAWrC,GAAAA,CAAI,qBAAA,CAAA;QAAwBsC,WAAAA,EAAa,iBAAA;QAAmBH,UAAAA,EAAYhC;AAAoB,KAAA;AACzG,IAAA;AACIkC,QAAAA,SAAAA,EAAWrC,GAAAA,CAAI,aAAA,CAAA;QACfsC,WAAAA,EAAa,cAAA;QACb5B,UAAAA,EAAY,qBAAA;QACZyB,UAAAA,EAAYV,qBAAAA;QACZc,OAAAA,EAAS;AAAC,YAAA;gBACNC,EAAAA,EAAI,8CAAA;gBACJnC,KAAAA,EAAO,iBAAA;AACPoC,gBAAAA,SAAAA,EAAWC,sCAA0BC,OAAO;gBAC5CC,YAAAA,EAAc,+BAAA;gBACdjC,WAAAA,EAAa;AACjB;AAAE;AACN;;;"}
1
+ {"version":3,"file":"cratisComponentsDescriptors.js","sources":["../../cratisComponentsDescriptors.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 { BindingMode, BindingSourceKind, ComponentDescriptor, DesignTimeActionPlacement, PropertyDescriptor, PropertyValueType, QueryResultShape } from '@cratis/scene.model';\nimport { componentRegistryKey } from '@cratis/scene.react';\n\n// The package name, spelled out so describing components does not pull every adapter (and its UI dependencies) in\n// with it; the bundle's validation checks each key against the manifest.\nconst key = (name: string) => componentRegistryKey('Cratis.Components', name);\n\n/**\n * The properties every query-bound data table shares: which query feeds it, and the few settings that shape how\n * it shows the result.\n *\n * `query` is a `QueryReference`, so an editor binds it to a host-supplied query candidate and validates the\n * arguments against it. What is stored is a `QueryBinding`; a plain query name - what screens carried before\n * bindings existed - is still read, as a binding with no explicit connections. The columns are not properties:\n * they are the `content` slot's children, edited as nodes.\n */\nconst dataTableProperties: PropertyDescriptor[] = [\n {\n path: 'query', label: 'Query', group: 'Data', valueType: PropertyValueType.QueryReference, editorKind: 'queryBinding',\n description: 'The collection query that feeds the table.',\n constraints: { required: true, resultShapes: [QueryResultShape.Collection] },\n },\n { path: 'emptyMessage', label: 'Empty message', group: 'Content', valueType: PropertyValueType.String, default: '' },\n {\n path: 'dataKey', label: 'Row identity', group: 'Data', valueType: PropertyValueType.String, editorKind: 'resultField',\n description: 'The result field that identifies a row.',\n },\n {\n path: 'globalFilterFields', label: 'Searchable fields', group: 'Data', valueType: PropertyValueType.Object, editorKind: 'resultFieldList',\n description: 'The result fields the table\\'s search box looks in.',\n },\n {\n path: 'selectedItem', label: 'Selected item', group: 'Outputs', valueType: PropertyValueType.Object, readOnly: true,\n output: true, bindingMode: BindingMode.OneWay,\n description: 'The currently selected row, or null after selection is cleared.',\n },\n];\n\nconst commandFormProperties: PropertyDescriptor[] = [\n {\n path: 'command', label: 'Command', group: 'Command', valueType: PropertyValueType.String, editorKind: 'commandBinding',\n constraints: { required: true },\n description: 'The Arc command proxy rendered through the native command form runtime.',\n },\n {\n path: 'mode', label: 'Mode', group: 'Layout', valueType: PropertyValueType.Enum,\n choices: [{ value: 'auto', label: 'Auto' }, { value: 'manual', label: 'Manual' }], default: 'auto',\n description: 'Auto follows command metadata; manual renders explicit inputs inside the same native form boundary.',\n },\n { path: 'columns', label: 'Legacy columns', group: 'Layout', valueType: PropertyValueType.Number, default: 1, description: 'Backward-compatible column count used when no typed layout metadata is authored.' },\n { path: 'layout', label: 'Layout', group: 'Layout', valueType: PropertyValueType.Object, editorKind: 'commandFormLayout', description: 'Typed command-form geometry: columns, gaps and field placements. Independent of auto/manual field generation.' },\n {\n path: 'widthSizeClass', label: 'Width size class', group: 'Layout', valueType: PropertyValueType.Enum, default: 'Regular',\n choices: [{ value: 'Regular', label: 'Regular' }, { value: 'Compact', label: 'Compact' }],\n description: 'The width size class the host evaluated. At Compact the fields of a manual form stack in one column in reading order.',\n },\n { path: 'fieldWidths', label: 'Legacy field widths', group: 'Layout', valueType: PropertyValueType.Object, editorKind: 'fieldWidths' },\n {\n path: 'inputs', label: 'Fields', group: 'Layout', valueType: PropertyValueType.Collection, editorKind: 'commandFields',\n acceptedBindingKinds: [BindingSourceKind.DataContext, BindingSourceKind.ComponentProperty],\n item: {\n label: 'Field',\n properties: [\n { path: 'property', label: 'Property', group: 'Field', valueType: PropertyValueType.String },\n { path: 'type', label: 'Type', group: 'Field', valueType: PropertyValueType.Enum, choices: [{ value: 'string', label: 'String' }, { value: 'guid', label: 'Guid' }] },\n { path: 'label', label: 'Label', group: 'Field', valueType: PropertyValueType.String },\n { path: 'column', label: 'Legacy column', group: 'Layout', valueType: PropertyValueType.Number },\n { path: 'width', label: 'Legacy width token', group: 'Layout', valueType: PropertyValueType.String },\n { path: 'placement', label: 'Placement', group: 'Layout', valueType: PropertyValueType.Object, editorKind: 'commandFormFieldPlacement' },\n ],\n },\n },\n {\n path: 'exclude', label: 'Excluded fields', group: 'Command', valueType: PropertyValueType.Collection,\n item: { label: 'Excluded field', properties: [{ path: 'property', label: 'Property', group: 'Field', valueType: PropertyValueType.String }] },\n },\n { path: 'submitLabel', label: 'Submit label', group: 'Content', valueType: PropertyValueType.String, default: 'Submit' },\n];\n\n/**\n * What can be edited on the `Cratis.Components` package's components.\n *\n * Only the query-bound tables are described so far; the form, dialog and editor composites carry\n * Arc proxy classes by name and are configured through their own tooling. A package adds a descriptor here the\n * same way it adds a component to the manifest.\n */\nconst toolbarButtonProperties: PropertyDescriptor[] = [\n { path: 'title', label: 'Label', group: 'Content', valueType: PropertyValueType.String, description: 'The accessible name and tooltip.' },\n { path: 'icon', label: 'Icon', group: 'Content', valueType: PropertyValueType.Icon, editorKind: 'icon' },\n { path: 'text', label: 'Text', group: 'Content', valueType: PropertyValueType.String, description: 'Short text shown instead of the icon.' },\n { path: 'active', label: 'Active', group: 'Presentation', valueType: PropertyValueType.Boolean, default: false },\n {\n path: 'tooltipPosition', label: 'Tooltip position', group: 'Presentation', valueType: PropertyValueType.Enum, default: 'right',\n choices: [{ value: 'top', label: 'Top' }, { value: 'right', label: 'Right' }, { value: 'bottom', label: 'Bottom' }, { value: 'left', label: 'Left' }],\n },\n {\n path: 'destination', label: 'Destination', group: 'Navigation', valueType: PropertyValueType.Destination,\n description: 'The screen, slice or dialog the button opens - executed by the enclosing navigation host.',\n },\n];\n\nexport const cratisComponentsDescriptors: ComponentDescriptor[] = [\n { component: key('dataTable'), displayName: 'Data table', properties: dataTableProperties },\n { component: key('table'), displayName: 'Table', properties: dataTableProperties },\n { component: key('observableDataTable'), displayName: 'Live data table', properties: dataTableProperties },\n {\n component: key('commandForm'),\n displayName: 'Command form',\n editorKind: 'commandFormDesigner',\n properties: commandFormProperties,\n actions: [{\n id: 'Cratis.Components.commandForm.generateFields',\n label: 'Generate fields',\n placement: DesignTimeActionPlacement.Toolbar,\n availability: 'commandForm.canGenerateFields',\n description: 'Creates a deterministic editable field layout from the selected command metadata.',\n }],\n },\n { component: key('toolbarButton'), displayName: 'Toolbar button', properties: toolbarButtonProperties },\n];\n"],"names":["key","name","componentRegistryKey","dataTableProperties","path","label","group","valueType","PropertyValueType","QueryReference","editorKind","description","constraints","required","resultShapes","QueryResultShape","Collection","String","default","Object","readOnly","output","bindingMode","BindingMode","OneWay","commandFormProperties","Enum","choices","value","Number","acceptedBindingKinds","BindingSourceKind","DataContext","ComponentProperty","item","properties","toolbarButtonProperties","Icon","Boolean","Destination","cratisComponentsDescriptors","component","displayName","actions","id","placement","DesignTimeActionPlacement","Toolbar","availability"],"mappings":";;;;;AAAA;AACA;AAKA;AACA;AACA,MAAMA,GAAAA,GAAM,CAACC,IAAAA,GAAiBC,gCAAAA,CAAqB,mBAAA,EAAqBD,IAAAA,CAAAA;AAExE;;;;;;;;AAQC,IACD,MAAME,mBAAAA,GAA4C;AAC9C,IAAA;QACIC,IAAAA,EAAM,OAAA;QAASC,KAAAA,EAAO,OAAA;QAASC,KAAAA,EAAO,M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QAAc0C,WAAAA,EAAa,YAAA;QAAcP,UAAAA,EAAYhC;AAAoB,KAAA;AAC1F,IAAA;AAAEsC,QAAAA,SAAAA,EAAWzC,GAAAA,CAAI,OAAA,CAAA;QAAU0C,WAAAA,EAAa,OAAA;QAASP,UAAAA,EAAYhC;AAAoB,KAAA;AACjF,IAAA;AAAEsC,QAAAA,SAAAA,EAAWzC,GAAAA,CAAI,qBAAA,CAAA;QAAwB0C,WAAAA,EAAa,iBAAA;QAAmBP,UAAAA,EAAYhC;AAAoB,KAAA;AACzG,IAAA;AACIsC,QAAAA,SAAAA,EAAWzC,GAAAA,CAAI,aAAA,CAAA;QACf0C,WAAAA,EAAa,cAAA;QACbhC,UAAAA,EAAY,qBAAA;QACZyB,UAAAA,EAAYV,qBAAAA;QACZkB,OAAAA,EAAS;AAAC,YAAA;gBACNC,EAAAA,EAAI,8CAAA;gBACJvC,KAAAA,EAAO,iBAAA;AACPwC,gBAAAA,SAAAA,EAAWC,sCAA0BC,OAAO;gBAC5CC,YAAAA,EAAc,+BAAA;gBACdrC,WAAAA,EAAa;AACjB;AAAE;AACN,KAAA;AACA,IAAA;AAAE8B,QAAAA,SAAAA,EAAWzC,GAAAA,CAAI,eAAA,CAAA;QAAkB0C,WAAAA,EAAa,gBAAA;QAAkBP,UAAAA,EAAYC;AAAwB;;;"}
@@ -1,156 +1,22 @@
1
1
  'use strict';
2
2
 
3
- var scene_model = require('@cratis/scene.model');
4
- var cratisComponents = require('./cratisComponents.js');
5
- var cratisComponentsDescriptors = require('./cratisComponentsDescriptors.js');
6
- var CommandFieldPropertyEditor = require('./forms/CommandFieldPropertyEditor.js');
7
- var CommandFormDesigner = require('./forms/CommandFormDesigner.js');
8
- var CommandFormLayoutEditor = require('./forms/CommandFormLayoutEditor.js');
9
- var generateCommandFieldsAction = require('./forms/generateCommandFieldsAction.js');
3
+ var cratisComponentsDesignTime = require('./designTime/cratisComponentsDesignTime.js');
4
+ var cratisComponentsRuntimePackage = require('./cratisComponentsRuntimePackage.js');
5
+ var cratisComponentsPackageManifest = require('./cratisComponentsPackageManifest.js');
10
6
 
11
7
  // Copyright (c) Cratis. All rights reserved.
12
8
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
13
9
  /**
14
- * The `Cratis.Components` package's declaration - what a profile gets when it lists this package.
10
+ * The `Cratis.Components` package as a loadable bundle - the manifest, the React components behind the names
11
+ * it declares, and the design-time contributions a designer loads.
15
12
  *
16
- * This is the concrete case the whole package-dependency mechanism exists for. `@cratis/components` is
17
- * not a self-contained library: every component in it is a wrapper over a PrimeReact widget, and its own
18
- * styling is a `--cratis-*` token layer (`@cratis/components/tokens`) plus the component stylesheets and
19
- * compiled Tailwind utilities in `@cratis/components/styles`. Activate it in a profile without PrimeReact
20
- * and nothing renders; activate it without Tailwind and everything renders unstyled. Both are stated as
21
- * dependencies so a package picker can say so while the profile is being configured, instead of leaving
22
- * it to be discovered when the page opens.
23
- *
24
- * The version ranges are the real ones the library carries. `>=11.0.0` for PrimeReact: version 3.0.0
25
- * declares `primereact@^11` as a peer dependency and is built against version 11's component set, so the
26
- * span across the major boundary that the previous `>=10.9.0` range described is over. The `--cratis-*`
27
- * tokens still resolve a version 10 theme variable as their last fallback, but that is an upgrade-window
28
- * courtesy for an application with a compiled version 10 stylesheet still on the page - not a version of
29
- * PrimeReact this package can be activated against. `^4.0.0` for Tailwind, because the utility sheet is
30
- * compiled against Tailwind 4.
31
- */ const cratisComponentsPackageManifest = {
32
- name: cratisComponents.cratisComponentsPackageName,
33
- version: '3.0.0',
34
- kind: scene_model.PackageKind.ComponentLibrary,
35
- dependencies: [
36
- {
37
- name: 'PrimeReact',
38
- versionRange: '>=11.0.0'
39
- },
40
- {
41
- name: 'Tailwind',
42
- versionRange: '^4.0.0'
43
- }
44
- ],
45
- components: [
46
- 'page',
47
- 'dataPage',
48
- 'formElement',
49
- 'singleResult',
50
- 'queryInputForm',
51
- 'dataTable',
52
- 'table',
53
- 'observableDataTable',
54
- 'commandForm',
55
- 'inputTextField',
56
- 'numberField',
57
- 'checkboxField',
58
- 'textAreaField',
59
- 'dropdownField',
60
- 'sliderField',
61
- 'calendarField',
62
- 'colorPickerField',
63
- 'multiSelectField',
64
- 'chipsField',
65
- 'radioButtonField',
66
- 'radioGroupField',
67
- 'dialog',
68
- 'confirmationDialog',
69
- 'busyIndicatorDialog',
70
- 'commandDialog',
71
- 'stepperCommandDialog',
72
- 'icon',
73
- 'tooltip',
74
- 'dropdown',
75
- 'errorBoundary',
76
- 'objectContentEditor',
77
- 'objectNavigationalBar',
78
- 'schemaEditor',
79
- 'timeMachine',
80
- 'filterPanel',
81
- 'toolbar',
82
- 'toolbarButton',
83
- 'toolbarGroup',
84
- 'toolbarSeparator'
85
- ],
86
- // A component library ships components, and nothing else. Layouts, screen templates and dialog
87
- // templates all belong to a Blueprint: they are decisions about what an application looks like as a
88
- // whole, and this package deliberately makes none of them - it provides the Arc-bound composites a
89
- // template is *built from*, so that a blueprint can place a `dataPage` in a slot and configure it,
90
- // rather than shipping one opinionated data page nobody can rearrange.
91
- layouts: [],
92
- screenTemplates: [],
93
- dialogTemplates: [],
94
- // No themes either, for a different reason: `@cratis/components` has no palette of its own. It reads
95
- // a `--cratis-*` variable layer that resolves whatever is in front of it - the `--p-*` properties a
96
- // PrimeReact 11 preset emits at runtime, or a Scene theme through this package's token bridge.
97
- // Shipping a theme here would be this library asserting a look it was specifically built not to have.
98
- themes: [],
99
- displayName: 'Cratis Components',
100
- description: "Cratis' Arc-bound data, form and dialog composites, built on PrimeReact and Tailwind. dataTable and table accept optional object-valued queryArguments for collection queries. singleResult displays one read-only scalar own resultField of an optional model using an explicit query, object queryArguments and enabled: true. queryInputForm commits explicit string inputs on submit to the same optional-single runtime; drafts never execute a query.",
101
- module: '@cratis/scene.components',
102
- license: 'MIT',
103
- licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',
104
- designTime: {
105
- previews: [],
106
- designers: [
107
- 'commandFormDesigner'
108
- ],
109
- propertyEditors: [
110
- 'commandBinding',
111
- 'commandFields',
112
- 'fieldWidths',
113
- 'commandFormLayout'
114
- ],
115
- propertyDisplays: [],
116
- actions: [
117
- 'Cratis.Components.commandForm.generateFields'
118
- ]
119
- },
120
- assets: [
121
- '@cratis/components/styles',
122
- '@cratis/components/tokens'
123
- ],
124
- runtimeSingletons: [
125
- 'react',
126
- '@cratis/arc',
127
- '@cratis/components'
128
- ]
129
- };
130
- /**
131
- * The `Cratis.Components` package as a loadable bundle - the manifest above, plus the React components
132
- * behind the names it declares.
133
- *
134
- * No `layouts`, `screenTemplates`, `dialogTemplates` or `themes` are provided, matching a manifest that
135
- * declares none of them; `validatePackageBundle` is what proves the two halves agree.
13
+ * A runtime host that must not load design-time code imports `cratisComponentsRuntimePackage` from
14
+ * `@cratis/scene.components/runtime` instead; that entry reaches no designer, editor or action.
136
15
  */ const cratisComponentsPackage = {
137
- manifest: cratisComponentsPackageManifest,
138
- components: cratisComponents.cratisComponents,
139
- descriptors: cratisComponentsDescriptors.cratisComponentsDescriptors,
140
- designTime: {
141
- designers: {
142
- commandFormDesigner: CommandFormDesigner.CommandFormDesigner
143
- },
144
- propertyEditors: {
145
- commandBinding: CommandFieldPropertyEditor.CommandFieldPropertyEditor,
146
- commandFormLayout: CommandFormLayoutEditor.CommandFormLayoutEditor
147
- },
148
- actions: {
149
- [generateCommandFieldsAction.generateCommandFieldsAction.descriptor.id]: generateCommandFieldsAction.generateCommandFieldsAction
150
- }
151
- }
16
+ ...cratisComponentsRuntimePackage.cratisComponentsRuntimePackage,
17
+ designTime: cratisComponentsDesignTime.cratisComponentsDesignTime
152
18
  };
153
19
 
20
+ exports.cratisComponentsPackageManifest = cratisComponentsPackageManifest.cratisComponentsPackageManifest;
154
21
  exports.cratisComponentsPackage = cratisComponentsPackage;
155
- exports.cratisComponentsPackageManifest = cratisComponentsPackageManifest;
156
22
  //# sourceMappingURL=cratisComponentsPackage.js.map