@cratis/scene.components 4.14.0 → 4.15.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 (34) hide show
  1. package/cratisComponentsDescriptors.ts +5 -0
  2. package/cratisComponentsPackage.ts +3 -1
  3. package/dist/cjs/cratisComponentsDescriptors.js +18 -0
  4. package/dist/cjs/cratisComponentsDescriptors.js.map +1 -1
  5. package/dist/cjs/cratisComponentsPackage.js +5 -2
  6. package/dist/cjs/cratisComponentsPackage.js.map +1 -1
  7. package/dist/cjs/forms/CommandFormLayoutEditor.js +73 -0
  8. package/dist/cjs/forms/CommandFormLayoutEditor.js.map +1 -0
  9. package/dist/cjs/forms/CommandFormRuntime.js +5 -3
  10. package/dist/cjs/forms/CommandFormRuntime.js.map +1 -1
  11. package/dist/cjs/forms/SceneCommandForm.js +5 -1
  12. package/dist/cjs/forms/SceneCommandForm.js.map +1 -1
  13. package/dist/esm/cratisComponentsDescriptors.d.ts.map +1 -1
  14. package/dist/esm/cratisComponentsDescriptors.js +18 -0
  15. package/dist/esm/cratisComponentsDescriptors.js.map +1 -1
  16. package/dist/esm/cratisComponentsPackage.d.ts.map +1 -1
  17. package/dist/esm/cratisComponentsPackage.js +5 -2
  18. package/dist/esm/cratisComponentsPackage.js.map +1 -1
  19. package/dist/esm/forms/CommandFormLayoutEditor.d.ts +3 -0
  20. package/dist/esm/forms/CommandFormLayoutEditor.d.ts.map +1 -0
  21. package/dist/esm/forms/CommandFormLayoutEditor.js +71 -0
  22. package/dist/esm/forms/CommandFormLayoutEditor.js.map +1 -0
  23. package/dist/esm/forms/CommandFormRuntime.d.ts +2 -1
  24. package/dist/esm/forms/CommandFormRuntime.d.ts.map +1 -1
  25. package/dist/esm/forms/CommandFormRuntime.js +6 -4
  26. package/dist/esm/forms/CommandFormRuntime.js.map +1 -1
  27. package/dist/esm/forms/SceneCommandForm.d.ts.map +1 -1
  28. package/dist/esm/forms/SceneCommandForm.js +6 -2
  29. package/dist/esm/forms/SceneCommandForm.js.map +1 -1
  30. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  31. package/forms/CommandFormLayoutEditor.tsx +49 -0
  32. package/forms/CommandFormRuntime.tsx +9 -5
  33. package/forms/SceneCommandForm.tsx +2 -0
  34. package/package.json +7 -7
@@ -52,6 +52,11 @@ const commandFormProperties: PropertyDescriptor[] = [
52
52
  },
53
53
  { 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.' },
54
54
  { 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.' },
55
+ {
56
+ path: 'widthSizeClass', label: 'Width size class', group: 'Layout', valueType: PropertyValueType.Enum, default: 'Regular',
57
+ choices: [{ value: 'Regular', label: 'Regular' }, { value: 'Compact', label: 'Compact' }],
58
+ description: 'The width size class the host evaluated. At Compact the fields of a manual form stack in one column in reading order.',
59
+ },
55
60
  { path: 'fieldWidths', label: 'Legacy field widths', group: 'Layout', valueType: PropertyValueType.Object, editorKind: 'fieldWidths' },
56
61
  {
57
62
  path: 'inputs', label: 'Fields', group: 'Layout', valueType: PropertyValueType.Collection, editorKind: 'commandFields',
@@ -7,6 +7,7 @@ import { cratisComponents, cratisComponentsPackageName } from './cratisComponent
7
7
  import { cratisComponentsDescriptors } from './cratisComponentsDescriptors';
8
8
  import { CommandFieldPropertyEditor } from './forms/CommandFieldPropertyEditor';
9
9
  import { CommandFormDesigner } from './forms/CommandFormDesigner';
10
+ import { CommandFormLayoutEditor } from './forms/CommandFormLayoutEditor';
10
11
  import { generateCommandFieldsAction } from './forms/generateCommandFieldsAction';
11
12
 
12
13
  /**
@@ -101,7 +102,7 @@ export const cratisComponentsPackageManifest: ScenePackage = {
101
102
  designTime: {
102
103
  previews: [],
103
104
  designers: ['commandFormDesigner'],
104
- propertyEditors: ['commandBinding', 'commandFields', 'fieldWidths'],
105
+ propertyEditors: ['commandBinding', 'commandFields', 'fieldWidths', 'commandFormLayout'],
105
106
  propertyDisplays: [],
106
107
  actions: ['Cratis.Components.commandForm.generateFields'],
107
108
  },
@@ -126,6 +127,7 @@ export const cratisComponentsPackage: ScenePackageBundle = {
126
127
  },
127
128
  propertyEditors: {
128
129
  commandBinding: CommandFieldPropertyEditor,
130
+ commandFormLayout: CommandFormLayoutEditor,
129
131
  },
130
132
  actions: {
131
133
  [generateCommandFieldsAction.descriptor.id]: generateCommandFieldsAction,
@@ -111,6 +111,24 @@ const commandFormProperties = [
111
111
  editorKind: 'commandFormLayout',
112
112
  description: 'Typed command-form geometry: columns, gaps and field placements. Independent of auto/manual field generation.'
113
113
  },
114
+ {
115
+ path: 'widthSizeClass',
116
+ label: 'Width size class',
117
+ group: 'Layout',
118
+ valueType: scene_model.PropertyValueType.Enum,
119
+ default: 'Regular',
120
+ choices: [
121
+ {
122
+ value: 'Regular',
123
+ label: 'Regular'
124
+ },
125
+ {
126
+ value: 'Compact',
127
+ label: 'Compact'
128
+ }
129
+ ],
130
+ description: 'The width size class the host evaluated. At Compact the fields of a manual form stack in one column in reading order.'
131
+ },
114
132
  {
115
133
  path: 'fieldWidths',
116
134
  label: 'Legacy field widths',
@@ -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 { 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,mBAAAA,GAA4C;AAC9C,IAAA;QACIC,IAAAA,EAAM,OAAA;QAASC,KAAAA,EAAO,OAAA;QAASC,KAAAA,EAAO,MAAA;AAAQC,QAAAA,SAAAA,EAAWC,8BAAkBC,cAAc;QAAEC,UAAAA,EAAY,cAAA;QACvGC,WAAAA,EAAa,4CAAA;QACbC,WAAAA,EAAa;YAAEC,QAAAA,EAAU,IAAA;YAAMC,YAAAA,EAAc;AAACC,gBAAAA,4BAAAA,CAAiBC;AAAW;AAAC;AAC/E,KAAA;AACA,IAAA;QAAEZ,IAAAA,EAAM,cAAA;QAAgBC,KAAAA,EAAO,eAAA;QAAiBC,KAAAA,EAAO,SAAA;AAAWC,QAAAA,SAAAA,EAAWC,8BAAkBS,MAAM;QAAEC,OAAAA,EAAS;AAAG,KAAA;AACnH,IAAA;QACId,IAAAA,EAAM,SAAA;QAAWC,KAAAA,EAAO,cAAA;QAAgBC,KAAAA,EAAO,MAAA;AAAQC,QAAAA,SAAAA,EAAWC,8BAAkBS,MAAM;QAAEP,UAAAA,EAAY,aAAA;QACxGC,WAAAA,EAAa;AACjB,KAAA;AACA,IAAA;QACIP,IAAAA,EAAM,oBAAA;Q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AC9D,IAAA;AAAEC,QAAAA,SAAAA,EAAWrC,GAAAA,CAAI,WAAA,CAAA;QAAcsC,WAAAA,EAAa,YAAA;QAAcH,UAAAA,EAAYhC;AAAoB,KAAA;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 */\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,mBAAAA,GAA4C;AAC9C,IAAA;QACIC,IAAAA,EAAM,OAAA;QAASC,KAAAA,EAAO,OAAA;QAASC,KAAAA,EAAO,MAAA;AAAQC,QAAAA,SAAAA,EAAWC,8BAAkBC,cAAc;QAAEC,UAAAA,EAAY,cAAA;QACvGC,WAAAA,EAAa,4CAAA;QACbC,WAAAA,EAAa;YAAEC,QAAAA,EAAU,IAAA;YAAMC,YAAAA,EAAc;AAACC,gBAAAA,4BAAAA,CAAiBC;AAAW;AAAC;AAC/E,KAAA;AACA,IAAA;QAAEZ,IAAAA,EAAM,cAAA;QAAgBC,KAAAA,EAAO,eAAA;QAAiBC,KAAAA,EAAO,SAAA;AAAWC,QAAAA,SAAAA,EAAWC,8BAAkBS,MAAM;QAAEC,OAAAA,EAAS;AAAG,KAAA;AACnH,IAAA;QACId,IAAAA,EAAM,SAAA;QAAWC,KAAAA,EAAO,cAAA;QAAgBC,KAAAA,EAAO,MAAA;AAAQC,QAAAA,SAA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Aa;AACjB;AAAE;AACN;;;"}
@@ -5,6 +5,7 @@ var cratisComponents = require('./cratisComponents.js');
5
5
  var cratisComponentsDescriptors = require('./cratisComponentsDescriptors.js');
6
6
  var CommandFieldPropertyEditor = require('./forms/CommandFieldPropertyEditor.js');
7
7
  var CommandFormDesigner = require('./forms/CommandFormDesigner.js');
8
+ var CommandFormLayoutEditor = require('./forms/CommandFormLayoutEditor.js');
8
9
  var generateCommandFieldsAction = require('./forms/generateCommandFieldsAction.js');
9
10
 
10
11
  // Copyright (c) Cratis. All rights reserved.
@@ -108,7 +109,8 @@ var generateCommandFieldsAction = require('./forms/generateCommandFieldsAction.j
108
109
  propertyEditors: [
109
110
  'commandBinding',
110
111
  'commandFields',
111
- 'fieldWidths'
112
+ 'fieldWidths',
113
+ 'commandFormLayout'
112
114
  ],
113
115
  propertyDisplays: [],
114
116
  actions: [
@@ -140,7 +142,8 @@ var generateCommandFieldsAction = require('./forms/generateCommandFieldsAction.j
140
142
  commandFormDesigner: CommandFormDesigner.CommandFormDesigner
141
143
  },
142
144
  propertyEditors: {
143
- commandBinding: CommandFieldPropertyEditor.CommandFieldPropertyEditor
145
+ commandBinding: CommandFieldPropertyEditor.CommandFieldPropertyEditor,
146
+ commandFormLayout: CommandFormLayoutEditor.CommandFormLayoutEditor
144
147
  },
145
148
  actions: {
146
149
  [generateCommandFieldsAction.generateCommandFieldsAction.descriptor.id]: generateCommandFieldsAction.generateCommandFieldsAction
@@ -1 +1 @@
1
- {"version":3,"file":"cratisComponentsPackage.js","sources":["../../cratisComponentsPackage.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 '@cratis/scene.react';\nimport { cratisComponents, cratisComponentsPackageName } from './cratisComponents';\nimport { cratisComponentsDescriptors } from './cratisComponentsDescriptors';\nimport { CommandFieldPropertyEditor } from './forms/CommandFieldPropertyEditor';\nimport { CommandFormDesigner } from './forms/CommandFormDesigner';\nimport { generateCommandFieldsAction } from './forms/generateCommandFieldsAction';\n\n/**\n * The `Cratis.Components` package's declaration - what a profile gets when it lists this package.\n *\n * This is the concrete case the whole package-dependency mechanism exists for. `@cratis/components` is\n * not a self-contained library: every component in it is a wrapper over a PrimeReact widget, and its own\n * styling is a `--cratis-*` token layer (`@cratis/components/tokens`) plus the component stylesheets and\n * compiled Tailwind utilities in `@cratis/components/styles`. Activate it in a profile without PrimeReact\n * and nothing renders; activate it without Tailwind and everything renders unstyled. Both are stated as\n * dependencies so a package picker can say so while the profile is being configured, instead of leaving\n * it to be discovered when the page opens.\n *\n * The version ranges are the real ones the library carries. `>=11.0.0` for PrimeReact: version 3.0.0\n * declares `primereact@^11` as a peer dependency and is built against version 11's component set, so the\n * span across the major boundary that the previous `>=10.9.0` range described is over. The `--cratis-*`\n * tokens still resolve a version 10 theme variable as their last fallback, but that is an upgrade-window\n * courtesy for an application with a compiled version 10 stylesheet still on the page - not a version of\n * PrimeReact this package can be activated against. `^4.0.0` for Tailwind, because the utility sheet is\n * compiled against Tailwind 4.\n */\nexport const cratisComponentsPackageManifest: ScenePackage = {\n name: cratisComponentsPackageName,\n version: '3.0.0',\n kind: PackageKind.ComponentLibrary,\n dependencies: [\n { name: 'PrimeReact', versionRange: '>=11.0.0' },\n { name: 'Tailwind', versionRange: '^4.0.0' },\n ],\n components: [\n 'page',\n 'dataPage',\n 'formElement',\n 'singleResult',\n 'queryInputForm',\n 'dataTable',\n 'table',\n 'observableDataTable',\n 'commandForm',\n 'inputTextField',\n 'numberField',\n 'checkboxField',\n 'textAreaField',\n 'dropdownField',\n 'sliderField',\n 'calendarField',\n 'colorPickerField',\n 'multiSelectField',\n 'chipsField',\n 'radioButtonField',\n 'radioGroupField',\n 'dialog',\n 'confirmationDialog',\n 'busyIndicatorDialog',\n 'commandDialog',\n 'stepperCommandDialog',\n 'icon',\n 'tooltip',\n 'dropdown',\n 'errorBoundary',\n 'objectContentEditor',\n 'objectNavigationalBar',\n 'schemaEditor',\n 'timeMachine',\n 'filterPanel',\n 'toolbar',\n 'toolbarButton',\n 'toolbarGroup',\n 'toolbarSeparator',\n ],\n\n // A component library ships components, and nothing else. Layouts, screen templates and dialog\n // templates all belong to a Blueprint: they are decisions about what an application looks like as a\n // whole, and this package deliberately makes none of them - it provides the Arc-bound composites a\n // template is *built from*, so that a blueprint can place a `dataPage` in a slot and configure it,\n // rather than shipping one opinionated data page nobody can rearrange.\n layouts: [],\n screenTemplates: [],\n dialogTemplates: [],\n\n // No themes either, for a different reason: `@cratis/components` has no palette of its own. It reads\n // a `--cratis-*` variable layer that resolves whatever is in front of it - the `--p-*` properties a\n // PrimeReact 11 preset emits at runtime, or a Scene theme through this package's token bridge.\n // Shipping a theme here would be this library asserting a look it was specifically built not to have.\n themes: [],\n\n displayName: 'Cratis Components',\n 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.\",\n module: '@cratis/scene.components',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n designTime: {\n previews: [],\n designers: ['commandFormDesigner'],\n propertyEditors: ['commandBinding', 'commandFields', 'fieldWidths'],\n propertyDisplays: [],\n actions: ['Cratis.Components.commandForm.generateFields'],\n },\n assets: ['@cratis/components/styles', '@cratis/components/tokens'],\n runtimeSingletons: ['react', '@cratis/arc', '@cratis/components'],\n};\n\n/**\n * The `Cratis.Components` package as a loadable bundle - the manifest above, plus the React components\n * behind the names it declares.\n *\n * No `layouts`, `screenTemplates`, `dialogTemplates` or `themes` are provided, matching a manifest that\n * declares none of them; `validatePackageBundle` is what proves the two halves agree.\n */\nexport const cratisComponentsPackage: ScenePackageBundle = {\n manifest: cratisComponentsPackageManifest,\n components: cratisComponents,\n descriptors: cratisComponentsDescriptors,\n designTime: {\n designers: {\n commandFormDesigner: CommandFormDesigner,\n },\n propertyEditors: {\n commandBinding: CommandFieldPropertyEditor,\n },\n actions: {\n [generateCommandFieldsAction.descriptor.id]: generateCommandFieldsAction,\n },\n },\n};\n"],"names":["cratisComponentsPackageManifest","name","cratisComponentsPackageName","version","kind","PackageKind","ComponentLibrary","dependencies","versionRange","components","layouts","screenTemplates","dialogTemplates","themes","displayName","description","module","license","licenseUrl","designTime","previews","designers","propertyEditors","propertyDisplays","actions","assets","runtimeSingletons","cratisComponentsPackage","manifest","cratisComponents","descriptors","cratisComponentsDescriptors","commandFormDesigner","CommandFormDesigner","commandBinding","CommandFieldPropertyEditor","generateCommandFieldsAction","descriptor","id"],"mappings":";;;;;;;;;AAAA;AACA;AAUA;;;;;;;;;;;;;;;;;;UAmBaA,+BAAAA,GAAgD;IACzDC,IAAAA,EAAMC,4CAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,wBAAYC,gBAAgB;IAClCC,YAAAA,EAAc;AACV,QAAA;YAAEN,IAAAA,EAAM,YAAA;YAAcO,YAAAA,EAAc;AAAW,SAAA;AAC/C,QAAA;YAAEP,IAAAA,EAAM,UAAA;YAAYO,YAAAA,EAAc;AAAS;AAC9C,KAAA;IACDC,UAAAA,EAAY;AACR,QAAA,MAAA;AACA,QAAA,UAAA;AACA,QAAA,aAAA;AACA,QAAA,cAAA;AACA,QAAA,gBAAA;AACA,QAAA,WAAA;AACA,QAAA,OAAA;AACA,QAAA,qBAAA;AACA,QAAA,aAAA;AACA,QAAA,gBAAA;AACA,QAAA,aAAA;AACA,QAAA,eAAA;AACA,QAAA,eAAA;AACA,QAAA,eAAA;AACA,QAAA,aAAA;AACA,QAAA,eAAA;AACA,QAAA,kBAAA;AACA,QAAA,kBAAA;AACA,QAAA,YAAA;AACA,QAAA,kBAAA;AACA,QAAA,iBAAA;AACA,QAAA,QAAA;AACA,QAAA,oBAA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SAAA;QACAX,OAAAA,EAAS;AACL,YAAA,CAACY,uDAAAA,CAA4BC,UAAU,CAACC,EAAE,GAAGF;AACjD;AACJ;AACJ;;;"}
1
+ {"version":3,"file":"cratisComponentsPackage.js","sources":["../../cratisComponentsPackage.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 '@cratis/scene.react';\nimport { cratisComponents, cratisComponentsPackageName } from './cratisComponents';\nimport { cratisComponentsDescriptors } from './cratisComponentsDescriptors';\nimport { CommandFieldPropertyEditor } from './forms/CommandFieldPropertyEditor';\nimport { CommandFormDesigner } from './forms/CommandFormDesigner';\nimport { CommandFormLayoutEditor } from './forms/CommandFormLayoutEditor';\nimport { generateCommandFieldsAction } from './forms/generateCommandFieldsAction';\n\n/**\n * The `Cratis.Components` package's declaration - what a profile gets when it lists this package.\n *\n * This is the concrete case the whole package-dependency mechanism exists for. `@cratis/components` is\n * not a self-contained library: every component in it is a wrapper over a PrimeReact widget, and its own\n * styling is a `--cratis-*` token layer (`@cratis/components/tokens`) plus the component stylesheets and\n * compiled Tailwind utilities in `@cratis/components/styles`. Activate it in a profile without PrimeReact\n * and nothing renders; activate it without Tailwind and everything renders unstyled. Both are stated as\n * dependencies so a package picker can say so while the profile is being configured, instead of leaving\n * it to be discovered when the page opens.\n *\n * The version ranges are the real ones the library carries. `>=11.0.0` for PrimeReact: version 3.0.0\n * declares `primereact@^11` as a peer dependency and is built against version 11's component set, so the\n * span across the major boundary that the previous `>=10.9.0` range described is over. The `--cratis-*`\n * tokens still resolve a version 10 theme variable as their last fallback, but that is an upgrade-window\n * courtesy for an application with a compiled version 10 stylesheet still on the page - not a version of\n * PrimeReact this package can be activated against. `^4.0.0` for Tailwind, because the utility sheet is\n * compiled against Tailwind 4.\n */\nexport const cratisComponentsPackageManifest: ScenePackage = {\n name: cratisComponentsPackageName,\n version: '3.0.0',\n kind: PackageKind.ComponentLibrary,\n dependencies: [\n { name: 'PrimeReact', versionRange: '>=11.0.0' },\n { name: 'Tailwind', versionRange: '^4.0.0' },\n ],\n components: [\n 'page',\n 'dataPage',\n 'formElement',\n 'singleResult',\n 'queryInputForm',\n 'dataTable',\n 'table',\n 'observableDataTable',\n 'commandForm',\n 'inputTextField',\n 'numberField',\n 'checkboxField',\n 'textAreaField',\n 'dropdownField',\n 'sliderField',\n 'calendarField',\n 'colorPickerField',\n 'multiSelectField',\n 'chipsField',\n 'radioButtonField',\n 'radioGroupField',\n 'dialog',\n 'confirmationDialog',\n 'busyIndicatorDialog',\n 'commandDialog',\n 'stepperCommandDialog',\n 'icon',\n 'tooltip',\n 'dropdown',\n 'errorBoundary',\n 'objectContentEditor',\n 'objectNavigationalBar',\n 'schemaEditor',\n 'timeMachine',\n 'filterPanel',\n 'toolbar',\n 'toolbarButton',\n 'toolbarGroup',\n 'toolbarSeparator',\n ],\n\n // A component library ships components, and nothing else. Layouts, screen templates and dialog\n // templates all belong to a Blueprint: they are decisions about what an application looks like as a\n // whole, and this package deliberately makes none of them - it provides the Arc-bound composites a\n // template is *built from*, so that a blueprint can place a `dataPage` in a slot and configure it,\n // rather than shipping one opinionated data page nobody can rearrange.\n layouts: [],\n screenTemplates: [],\n dialogTemplates: [],\n\n // No themes either, for a different reason: `@cratis/components` has no palette of its own. It reads\n // a `--cratis-*` variable layer that resolves whatever is in front of it - the `--p-*` properties a\n // PrimeReact 11 preset emits at runtime, or a Scene theme through this package's token bridge.\n // Shipping a theme here would be this library asserting a look it was specifically built not to have.\n themes: [],\n\n displayName: 'Cratis Components',\n 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.\",\n module: '@cratis/scene.components',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n designTime: {\n previews: [],\n designers: ['commandFormDesigner'],\n propertyEditors: ['commandBinding', 'commandFields', 'fieldWidths', 'commandFormLayout'],\n propertyDisplays: [],\n actions: ['Cratis.Components.commandForm.generateFields'],\n },\n assets: ['@cratis/components/styles', '@cratis/components/tokens'],\n runtimeSingletons: ['react', '@cratis/arc', '@cratis/components'],\n};\n\n/**\n * The `Cratis.Components` package as a loadable bundle - the manifest above, plus the React components\n * behind the names it declares.\n *\n * No `layouts`, `screenTemplates`, `dialogTemplates` or `themes` are provided, matching a manifest that\n * declares none of them; `validatePackageBundle` is what proves the two halves agree.\n */\nexport const cratisComponentsPackage: ScenePackageBundle = {\n manifest: cratisComponentsPackageManifest,\n components: cratisComponents,\n descriptors: cratisComponentsDescriptors,\n designTime: {\n designers: {\n commandFormDesigner: CommandFormDesigner,\n },\n propertyEditors: {\n commandBinding: CommandFieldPropertyEditor,\n commandFormLayout: CommandFormLayoutEditor,\n },\n actions: {\n [generateCommandFieldsAction.descriptor.id]: generateCommandFieldsAction,\n },\n },\n};\n"],"names":["cratisComponentsPackageManifest","name","cratisComponentsPackageName","version","kind","PackageKind","ComponentLibrary","dependencies","versionRange","components","layouts","screenTemplates","dialogTemplates","themes","displayName","description","module","license","licenseUrl","designTime","previews","designers","propertyEditors","propertyDisplays","actions","assets","runtimeSingletons","cratisComponentsPackage","manifest","cratisComponents","descriptors","cratisComponentsDescriptors","commandFormDesigner","CommandFormDesigner","commandBinding","CommandFieldPropertyEditor","commandFormLayout","CommandFormLayoutEditor","generateCommandFieldsAction","descriptor","id"],"mappings":";;;;;;;;;;AAAA;AACA;AAWA;;;;;;;;;;;;;;;;;;UAmBaA,+BAAAA,GAAgD;IACzDC,IAAAA,EAAMC,4CAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,wBAAYC,gBAAgB;IAClCC,YAAAA,EAAc;AACV,QAAA;YAAEN,IAAAA,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BAAA;AAAkB,YAAA,eAAA;AAAiB,YAAA,aAAA;AAAe,YAAA;AAAoB,SAAA;AACxFC,QAAAA,gBAAAA,EAAkB,EAAE;QACpBC,OAAAA,EAAS;AAAC,YAAA;AAA+C;AAC7D,KAAA;IACAC,MAAAA,EAAQ;AAAC,QAAA,2BAAA;AAA6B,QAAA;AAA4B,KAAA;IAClEC,iBAAAA,EAAmB;AAAC,QAAA,OAAA;AAAS,QAAA,aAAA;AAAe,QAAA;AAAqB;AACrE;AAEA;;;;;;UAOaC,uBAAAA,GAA8C;IACvDC,QAAAA,EAAU5B,+BAAAA;IACVS,UAAAA,EAAYoB,iCAAAA;IACZC,WAAAA,EAAaC,uDAAAA;IACbZ,UAAAA,EAAY;QACRE,SAAAA,EAAW;YACPW,mBAAAA,EAAqBC;AACzB,SAAA;QACAX,eAAAA,EAAiB;YACbY,cAAAA,EAAgBC,qDAAAA;YAChBC,iBAAAA,EAAmBC;AACvB,SAAA;QACAb,OAAAA,EAAS;AACL,YAAA,CAACc,uDAAAA,CAA4BC,UAAU,CAACC,EAAE,GAAGF;AACjD;AACJ;AACJ;;;"}
@@ -0,0 +1,73 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var scene_model = require('@cratis/scene.model');
6
+ var scene_engine = require('@cratis/scene.engine');
7
+ var commandFormLayout = require('./commandFormLayout.js');
8
+
9
+ const layoutKeys = new Set(Object.values(scene_engine.CommandFormLayoutKey));
10
+ /**
11
+ * Arranges a command form's fields from the keyboard. Each placed field is a focusable cell: the arrow keys
12
+ * move it one cell, and Shift with an arrow key resizes it. A valid change is submitted as one canonical
13
+ * edit of the `layout` property; an invalid one is announced and the committed layout is kept.
14
+ */ function CommandFormLayoutEditor({ context, property, value, setValue }) {
15
+ const layout = commandFormLayout.commandFormLayout({
16
+ layout: value
17
+ });
18
+ const [problem, setProblem] = react.useState();
19
+ if (!layout) return /*#__PURE__*/ jsxRuntime.jsxs("p", {
20
+ role: "note",
21
+ children: [
22
+ property.label,
23
+ ": no layout is authored yet."
24
+ ]
25
+ });
26
+ const onKeyDown = (field)=>(event)=>{
27
+ if (!layoutKeys.has(event.key)) return;
28
+ event.preventDefault();
29
+ const draft = scene_engine.applyCommandFormLayoutKey(layout, field, event.key, event.shiftKey, layout.placements.map((placement)=>placement.field));
30
+ if (!draft) return;
31
+ if (!draft.isValid) {
32
+ setProblem(draft.diagnostics[0].message);
33
+ return;
34
+ }
35
+ setProblem(undefined);
36
+ commit(draft.draft);
37
+ };
38
+ const commit = (next)=>{
39
+ setValue(next);
40
+ context.submitEdits([
41
+ {
42
+ kind: scene_model.SceneEditKind.SetProperty,
43
+ nodeId: context.element.id,
44
+ path: property.path,
45
+ value: next
46
+ }
47
+ ]);
48
+ };
49
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
50
+ role: "group",
51
+ "aria-label": property.label,
52
+ "aria-describedby": `${context.element.id}-layout-help`,
53
+ children: [
54
+ /*#__PURE__*/ jsxRuntime.jsx("p", {
55
+ id: `${context.element.id}-layout-help`,
56
+ children: "Arrow keys move a field. Shift and an arrow key resize it."
57
+ }),
58
+ layout.placements.map((placement)=>/*#__PURE__*/ jsxRuntime.jsx("button", {
59
+ type: "button",
60
+ onKeyDown: onKeyDown(placement.field),
61
+ "aria-label": `${placement.field}: row ${placement.row}, column ${placement.column}, spans ${placement.columnSpan ?? 1} column(s) and ${placement.rowSpan ?? 1} row(s)`,
62
+ children: placement.field
63
+ }, placement.field)),
64
+ problem && /*#__PURE__*/ jsxRuntime.jsx("p", {
65
+ role: "alert",
66
+ children: problem
67
+ })
68
+ ]
69
+ });
70
+ }
71
+
72
+ exports.CommandFormLayoutEditor = CommandFormLayoutEditor;
73
+ //# sourceMappingURL=CommandFormLayoutEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandFormLayoutEditor.js","sources":["../../../forms/CommandFormLayoutEditor.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 { KeyboardEvent, useState } from 'react';\nimport { CommandFormLayout, SceneEditKind } from '@cratis/scene.model';\nimport { CommandFormLayoutKey, applyCommandFormLayoutKey } from '@cratis/scene.engine';\nimport { DesignTimePropertyEditorProps } from '@cratis/scene.react';\nimport { commandFormLayout } from './commandFormLayout';\n\nconst layoutKeys = new Set<string>(Object.values(CommandFormLayoutKey));\n\n/**\n * Arranges a command form's fields from the keyboard. Each placed field is a focusable cell: the arrow keys\n * move it one cell, and Shift with an arrow key resizes it. A valid change is submitted as one canonical\n * edit of the `layout` property; an invalid one is announced and the committed layout is kept.\n */\nexport function CommandFormLayoutEditor({ context, property, value, setValue }: DesignTimePropertyEditorProps) {\n const layout = commandFormLayout({ layout: value });\n const [problem, setProblem] = useState<string>();\n if (!layout) return <p role='note'>{property.label}: no layout is authored yet.</p>;\n\n const onKeyDown = (field: string) => (event: KeyboardEvent<HTMLButtonElement>) => {\n if (!layoutKeys.has(event.key)) return;\n event.preventDefault();\n const draft = applyCommandFormLayoutKey(layout, field, event.key as CommandFormLayoutKey, event.shiftKey, layout.placements.map(placement => placement.field));\n if (!draft) return;\n if (!draft.isValid) {\n setProblem(draft.diagnostics[0].message);\n return;\n }\n\n setProblem(undefined);\n commit(draft.draft);\n };\n\n const commit = (next: CommandFormLayout) => {\n setValue(next);\n context.submitEdits([{ kind: SceneEditKind.SetProperty, nodeId: context.element.id, path: property.path, value: next }]);\n };\n\n return <div role='group' aria-label={property.label} aria-describedby={`${context.element.id}-layout-help`}>\n <p id={`${context.element.id}-layout-help`}>Arrow keys move a field. Shift and an arrow key resize it.</p>\n {layout.placements.map(placement => <button key={placement.field} type='button' onKeyDown={onKeyDown(placement.field)}\n aria-label={`${placement.field}: row ${placement.row}, column ${placement.column}, spans ${placement.columnSpan ?? 1} column(s) and ${placement.rowSpan ?? 1} row(s)`}>\n {placement.field}\n </button>)}\n {problem && <p role='alert'>{problem}</p>}\n </div>;\n}\n"],"names":["layoutKeys","Set","Object","values","CommandFormLayoutKey","CommandFormLayoutEditor","context","property","value","setValue","layout","commandFormLayout","problem","setProblem","useState","_jsxs","p","role","label","onKeyDown","field","event","has","key","preventDefault","draft","applyCommandFormLayoutKey","shiftKey","placements","map","placement","isValid","diagnostics","message","undefined","commit","next","submitEdits","kind","SceneEditKind","SetProperty","nodeId","element","id","path","div","aria-label","aria-describedby","_jsx","button","type","row","column","columnSpan","rowSpan"],"mappings":";;;;;;;;AASA,MAAMA,UAAAA,GAAa,IAAIC,GAAAA,CAAYC,MAAAA,CAAOC,MAAM,CAACC,iCAAAA,CAAAA,CAAAA;AAEjD;;;;IAKO,SAASC,uBAAAA,CAAwB,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,QAAQ,EAAiC,EAAA;AACzG,IAAA,MAAMC,SAASC,mCAAAA,CAAkB;QAAED,MAAAA,EAAQF;AAAM,KAAA,CAAA;IACjD,MAAM,CAACI,OAAAA,EAASC,UAAAA,CAAW,GAAGC,cAAAA,EAAAA;IAC9B,IAAI,CAACJ,MAAAA,EAAQ,qBAAOK,eAAA,CAACC,GAAAA,EAAAA;QAAEC,IAAAA,EAAK,MAAA;;AAAQV,YAAAA,QAAAA,CAASW,KAAK;AAAC,YAAA;;;IAEnD,MAAMC,SAAAA,GAAY,CAACC,KAAAA,GAAkB,CAACC,KAAAA,GAAAA;AAClC,YAAA,IAAI,CAACrB,UAAAA,CAAWsB,GAAG,CAACD,KAAAA,CAAME,GAAG,CAAA,EAAG;AAChCF,YAAAA,KAAAA,CAAMG,cAAc,EAAA;AACpB,YAAA,MAAMC,QAAQC,sCAAAA,CAA0BhB,MAAAA,EAAQU,OAAOC,KAAAA,CAAME,GAAG,EAA0BF,KAAAA,CAAMM,QAAQ,EAAEjB,MAAAA,CAAOkB,UAAU,CAACC,GAAG,CAACC,CAAAA,SAAAA,GAAaA,UAAUV,KAAK,CAAA,CAAA;AAC5J,YAAA,IAAI,CAACK,KA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AAK,CAAC,MAAM,EAAEU,SAAAA,CAAUqB,GAAG,CAAC,SAAS,EAAErB,SAAAA,CAAUsB,MAAM,CAAC,QAAQ,EAAEtB,SAAAA,CAAUuB,UAAU,IAAI,CAAA,CAAE,eAAe,EAAEvB,SAAAA,CAAUwB,OAAO,IAAI,CAAA,CAAE,OAAO,CAAC;AACpKxB,oBAAAA,QAAAA,EAAAA,SAAAA,CAAUV;AAFkCU,iBAAAA,EAAAA,SAAAA,CAAUV,KAAK,CAAA,CAAA;AAI/DR,YAAAA,OAAAA,kBAAWoC,cAAA,CAAChC,GAAAA,EAAAA;gBAAEC,IAAAA,EAAK,OAAA;AAASL,gBAAAA,QAAAA,EAAAA;;;;AAErC;;"}
@@ -50,7 +50,7 @@ const NativeAutoCommandForm = CommandForm.AutoCommandForm;
50
50
  }
51
51
  return undefined;
52
52
  }
53
- /** Private lazy entry point: importing the Scene registry must not import Arc. */ function CommandFormRuntime({ command, inputs, exclude, submitLabel, columns = 1, layout }) {
53
+ /** Private lazy entry point: importing the Scene registry must not import Arc. */ function CommandFormRuntime({ command, inputs, exclude, submitLabel, columns = 1, layout, compact = false }) {
54
54
  const error = capability(command, inputs, exclude);
55
55
  if (error) return /*#__PURE__*/ jsxRuntime.jsx("div", {
56
56
  role: "alert",
@@ -58,18 +58,20 @@ const NativeAutoCommandForm = CommandForm.AutoCommandForm;
58
58
  });
59
59
  // The registry's never-argument constructor is erased; Arc creates this checked proxy with no args.
60
60
  if (inputs) {
61
- const formLayout = scene_engine.normalizeCommandFormLayout(layout, inputs);
62
- const diagnostics = scene_engine.validateCommandFormLayout(formLayout, inputs.map((input)=>input.property));
61
+ const authoredLayout = scene_engine.normalizeCommandFormLayout(layout, inputs);
62
+ const diagnostics = scene_engine.validateCommandFormLayout(authoredLayout, inputs.map((input)=>input.property));
63
63
  if (diagnostics.length) return /*#__PURE__*/ jsxRuntime.jsx("div", {
64
64
  role: "alert",
65
65
  children: diagnostics[0].message
66
66
  });
67
+ const formLayout = compact ? scene_engine.stackCommandFormLayout(authoredLayout) : authoredLayout;
67
68
  const columnsCss = formLayout.columns.map((column)=>scene_engine.formWidthToCss(column.width) ?? 'minmax(0, 1fr)').join(' ') || `repeat(${Math.max(1, columns)}, minmax(0, 1fr))`;
68
69
  return /*#__PURE__*/ jsxRuntime.jsxs(commands.CommandForm, {
69
70
  command: command,
70
71
  showTitles: false,
71
72
  children: [
72
73
  /*#__PURE__*/ jsxRuntime.jsx("div", {
74
+ "data-scene-form-columns": formLayout.columns.length,
73
75
  style: {
74
76
  display: 'grid',
75
77
  gridTemplateColumns: columnsCss,
@@ -1 +1 @@
1
- {"version":3,"file":"CommandFormRuntime.js","sources":["../../../forms/CommandFormRuntime.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 type { ComponentType, ReactNode } from 'react';\nimport { AutoCommandForm } from '@cratis/components/CommandForm';\nimport { CommandForm } from '@cratis/arc.react/commands';\nimport { formWidthToCss, normalizeCommandFormLayout, validateCommandFormLayout } from '@cratis/scene.engine';\nimport { Guid } from '@cratis/fundamentals';\nimport type { BoundConstructor } from '../bindings';\nimport type { CommandInput } from './commandInputs';\nimport type { CommandFormLayout } from '@cratis/scene.model';\nimport { CommandFormSubmit } from './CommandFormSubmit';\nimport { ExplicitCommandField } from './ExplicitCommandField';\n\ninterface CommandFormRuntimeProps {\n command: BoundConstructor;\n inputs?: CommandInput[];\n exclude?: string[];\n submitLabel: string;\n columns?: number;\n layout?: CommandFormLayout;\n}\n\n// Runtime bindings erase the proxy's keys; the optional footer is a Components >=4.13 contract.\nconst NativeAutoCommandForm = AutoCommandForm as unknown as ComponentType<{\n command: BoundConstructor;\n exclude?: string[];\n footer?: ReactNode;\n}>;\n\ntype Descriptor = { name: string; type: unknown; isOptional: boolean };\n\n/** Verify the whole command before mounting any native form: partial forms must never execute. */\nfunction capability(command: BoundConstructor, inputs?: CommandInput[], exclude?: string[]): string | undefined {\n let descriptors: unknown;\n try { descriptors = (new command() as { propertyDescriptors?: unknown }).propertyDescriptors; }\n catch { return 'Unable to inspect command proxy'; }\n if (!Array.isArray(descriptors)) return 'Command proxy has no property descriptors';\n const byName = new Map<string, Descriptor>();\n for (const descriptor of descriptors) {\n if (!descriptor || typeof descriptor.name !== 'string' || !descriptor.name ||\n typeof descriptor.isOptional !== 'boolean' || byName.has(descriptor.name)) return 'Ambiguous or invalid command property descriptors';\n byName.set(descriptor.name, descriptor);\n }\n if (inputs) {\n for (const input of inputs) {\n const descriptor = byName.get(input.property);\n if (!descriptor) return `Unknown command property '${input.property}'`;\n if (descriptor.type !== (input.type === 'guid' ? Guid : String)) return `Command property '${input.property}' type does not match '${input.type}'`;\n }\n for (const descriptor of byName.values()) {\n if (!descriptor.isOptional && !inputs.some(input => input.property === descriptor.name)) return `Required command property '${descriptor.name}' has no input`;\n }\n } else {\n for (const descriptor of byName.values()) {\n if (!descriptor.isOptional && (exclude?.includes(descriptor.name) ||\n ![String, Number, Boolean, Date].includes(descriptor.type as typeof String))) {\n return `Required command property '${descriptor.name}' has no supported automatic field; declare inputs`;\n }\n }\n }\n return undefined;\n}\n\n/** Private lazy entry point: importing the Scene registry must not import Arc. */\nexport default function CommandFormRuntime({ command, inputs, exclude, submitLabel, columns = 1, layout }: CommandFormRuntimeProps) {\n const error = capability(command, inputs, exclude);\n if (error) return <div role='alert'>{error}</div>;\n // The registry's never-argument constructor is erased; Arc creates this checked proxy with no args.\n if (inputs) {\n const formLayout = normalizeCommandFormLayout(layout, inputs);\n const diagnostics = validateCommandFormLayout(formLayout, inputs.map(input => input.property));\n if (diagnostics.length) return <div role='alert'>{diagnostics[0].message}</div>;\n const columnsCss = formLayout.columns.map(column => formWidthToCss(column.width) ?? 'minmax(0, 1fr)').join(' ') || `repeat(${Math.max(1, columns)}, minmax(0, 1fr))`;\n return <CommandForm command={command as unknown as new () => object} showTitles={false}>\n <div style={{ display: 'grid', gridTemplateColumns: columnsCss, columnGap: formWidthToCss(formLayout.columnGap) ?? '1rem', rowGap: formWidthToCss(formLayout.rowGap) ?? '1rem' }}>\n {inputs.map(input => <ExplicitCommandField key={input.property} input={input} placement={formLayout.placements.find(placement => placement.field === input.property) ?? input.placement} />)}\n </div>\n <CommandFormSubmit label={submitLabel} />\n </CommandForm>;\n }\n return <NativeAutoCommandForm command={command} exclude={exclude} footer={<CommandFormSubmit label={submitLabel} />} />;\n}\n"],"names":["NativeAutoCommandForm","AutoCommandForm","capability","command","inputs","exclude","descriptors","propertyDescriptors","Array","isArray","byName","Map","descriptor","name","isOptional","has","set","input","get","property","type","Guid","String","values","some","includes","Number","Boolean","Date","undefined","CommandFormRuntime","submitLabel","columns","layout","error","_jsx","div","role","formLayout","normalizeCommandFormLayout","diagnostics","validateCommandFormLayout","map","length","message","columnsCss","column","formWidthToCss","width","join","Math","max","_jsxs","CommandForm","showTitles","style","display","gridTemplateColumns","columnGap","rowGap","ExplicitCommandField","placement","placements","find","field","CommandFormSubmit","label","footer"],"mappings":";;;;;;;;;;;;AAAA;AACA;AAsBA;AACA,MAAMA,qBAAAA,GAAwBC,2BAAAA;AAQ9B,mGACA,SAASC,UAAAA,CAAWC,OAAyB,EAAEC,MAAuB,EAAEC,OAAkB,EAAA;IACtF,IAAIC,WAAAA;IACJ,IAAI;QAAEA,WAAAA,GAAe,IAAIH,OAAAA,EAAAA,CAAgDI,mBAAmB;AAAE,IAAA,CAAA,CAC9F,OAAM;QAAE,OAAO,iCAAA;AAAmC,IAAA;AAClD,IAAA,IAAI,CAACC,KAAAA,CAAMC,OAAO,CAACH,cAAc,OAAO,2CAAA;AACxC,IAAA,MAAMI,SAAS,IAAIC,GAAAA,EAAAA;IACnB,KAAK,MAAMC,cAAcN,WAAAA,CAAa;QAClC,IAAI,CAACM,cAAc,OAAOA,UAAAA,CAAWC,IAAI,KAAK,QAAA,IAAY,CAACD,UAAAA,CAAWC,IAAI,IACtE,OAAOD,UAAAA,CAAWE,UAAU,KAAK,SAAA,IAAaJ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eAAA,CAACC,oBAAAA,EAAAA;YAAYlD,OAAAA,EAASA,OAAAA;YAAwCmD,UAAAA,EAAY,KAAA;;8BAC7EnB,cAAA,CAACC,KAAAA,EAAAA;oBAAImB,KAAAA,EAAO;wBAAEC,OAAAA,EAAS,MAAA;wBAAQC,mBAAAA,EAAqBZ,UAAAA;wBAAYa,SAAAA,EAAWX,2BAAAA,CAAeT,UAAAA,CAAWoB,SAAS,CAAA,IAAK,MAAA;wBAAQC,MAAAA,EAAQZ,2BAAAA,CAAeT,UAAAA,CAAWqB,MAAM,CAAA,IAAK;AAAO,qBAAA;AAC1KvD,oBAAAA,QAAAA,EAAAA,MAAAA,CAAOsC,GAAG,CAACzB,CAAAA,KAAAA,iBAASkB,cAAA,CAACyB,yCAAAA,EAAAA;4BAA0C3C,KAAAA,EAAOA,KAAAA;AAAO4C,4BAAAA,SAAAA,EAAWvB,UAAAA,CAAWwB,UAAU,CAACC,IAAI,CAACF,CAAAA,SAAAA,GAAaA,SAAAA,CAAUG,KAAK,KAAK/C,KAAAA,CAAME,QAAQ,CAAA,IAAKF,MAAM4C;AAA9H5C,yBAAAA,EAAAA,KAAAA,CAAME,QAAQ,CAAA;;8BAElEgB,cAAA,CAAC8B,mCAAAA,EAAAA;oBAAkBC,KAAAA,EAAOnC;;;;AAElC,IAAA;AACA,IAAA,qBAAOI,cAAA,CAACnC,qBAAAA,EAAAA;QAAsBG,OAAAA,EAASA,OAAAA;QAASE,OAAAA,EAASA,OAAAA;AAAS8D,QAAAA,MAAAA,gBAAQhC,cAAA,CAAC8B,mCAAAA,EAAAA;YAAkBC,KAAAA,EAAOnC;;;AACxG;;"}
1
+ {"version":3,"file":"CommandFormRuntime.js","sources":["../../../forms/CommandFormRuntime.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 type { ComponentType, ReactNode } from 'react';\nimport { AutoCommandForm } from '@cratis/components/CommandForm';\nimport { CommandForm } from '@cratis/arc.react/commands';\nimport { formWidthToCss, normalizeCommandFormLayout, stackCommandFormLayout, validateCommandFormLayout } from '@cratis/scene.engine';\nimport { Guid } from '@cratis/fundamentals';\nimport type { BoundConstructor } from '../bindings';\nimport type { CommandInput } from './commandInputs';\nimport type { CommandFormLayout } from '@cratis/scene.model';\nimport { CommandFormSubmit } from './CommandFormSubmit';\nimport { ExplicitCommandField } from './ExplicitCommandField';\n\ninterface CommandFormRuntimeProps {\n command: BoundConstructor;\n inputs?: CommandInput[];\n exclude?: string[];\n submitLabel: string;\n columns?: number;\n layout?: CommandFormLayout;\n\n /** At a compact width the fields stack in one column, in reading order. */\n compact?: boolean;\n}\n\n// Runtime bindings erase the proxy's keys; the optional footer is a Components >=4.13 contract.\nconst NativeAutoCommandForm = AutoCommandForm as unknown as ComponentType<{\n command: BoundConstructor;\n exclude?: string[];\n footer?: ReactNode;\n}>;\n\ntype Descriptor = { name: string; type: unknown; isOptional: boolean };\n\n/** Verify the whole command before mounting any native form: partial forms must never execute. */\nfunction capability(command: BoundConstructor, inputs?: CommandInput[], exclude?: string[]): string | undefined {\n let descriptors: unknown;\n try { descriptors = (new command() as { propertyDescriptors?: unknown }).propertyDescriptors; }\n catch { return 'Unable to inspect command proxy'; }\n if (!Array.isArray(descriptors)) return 'Command proxy has no property descriptors';\n const byName = new Map<string, Descriptor>();\n for (const descriptor of descriptors) {\n if (!descriptor || typeof descriptor.name !== 'string' || !descriptor.name ||\n typeof descriptor.isOptional !== 'boolean' || byName.has(descriptor.name)) return 'Ambiguous or invalid command property descriptors';\n byName.set(descriptor.name, descriptor);\n }\n if (inputs) {\n for (const input of inputs) {\n const descriptor = byName.get(input.property);\n if (!descriptor) return `Unknown command property '${input.property}'`;\n if (descriptor.type !== (input.type === 'guid' ? Guid : String)) return `Command property '${input.property}' type does not match '${input.type}'`;\n }\n for (const descriptor of byName.values()) {\n if (!descriptor.isOptional && !inputs.some(input => input.property === descriptor.name)) return `Required command property '${descriptor.name}' has no input`;\n }\n } else {\n for (const descriptor of byName.values()) {\n if (!descriptor.isOptional && (exclude?.includes(descriptor.name) ||\n ![String, Number, Boolean, Date].includes(descriptor.type as typeof String))) {\n return `Required command property '${descriptor.name}' has no supported automatic field; declare inputs`;\n }\n }\n }\n return undefined;\n}\n\n/** Private lazy entry point: importing the Scene registry must not import Arc. */\nexport default function CommandFormRuntime({ command, inputs, exclude, submitLabel, columns = 1, layout, compact = false }: CommandFormRuntimeProps) {\n const error = capability(command, inputs, exclude);\n if (error) return <div role='alert'>{error}</div>;\n // The registry's never-argument constructor is erased; Arc creates this checked proxy with no args.\n if (inputs) {\n const authoredLayout = normalizeCommandFormLayout(layout, inputs);\n const diagnostics = validateCommandFormLayout(authoredLayout, inputs.map(input => input.property));\n if (diagnostics.length) return <div role='alert'>{diagnostics[0].message}</div>;\n const formLayout = compact ? stackCommandFormLayout(authoredLayout) : authoredLayout;\n const columnsCss = formLayout.columns.map(column => formWidthToCss(column.width) ?? 'minmax(0, 1fr)').join(' ') || `repeat(${Math.max(1, columns)}, minmax(0, 1fr))`;\n return <CommandForm command={command as unknown as new () => object} showTitles={false}>\n <div data-scene-form-columns={formLayout.columns.length} style={{ display: 'grid', gridTemplateColumns: columnsCss, columnGap: formWidthToCss(formLayout.columnGap) ?? '1rem', rowGap: formWidthToCss(formLayout.rowGap) ?? '1rem' }}>\n {inputs.map(input => <ExplicitCommandField key={input.property} input={input} placement={formLayout.placements.find(placement => placement.field === input.property) ?? input.placement} />)}\n </div>\n <CommandFormSubmit label={submitLabel} />\n </CommandForm>;\n }\n return <NativeAutoCommandForm command={command} exclude={exclude} footer={<CommandFormSubmit label={submitLabel} />} />;\n}\n"],"names":["NativeAutoCommandForm","AutoCommandForm","capability","command","inputs","exclude","descriptors","propertyDescriptors","Array","isArray","byName","Map","descriptor","name","isOptional","has","set","input","get","property","type","Guid","String","values","some","includes","Number","Boolean","Date","undefined","CommandFormRuntime","submitLabel","columns","layout","compact","error","_jsx","div","role","authoredLayout","normalizeCommandFormLayout","diagnostics","validateCommandFormLayout","map","length","message","formLayout","stackCommandFormLayout","columnsCss","column","formWidthToCss","width","join","Math","max","_jsxs","CommandForm","showTitles","data-scene-form-columns","style","display","gridTemplateColumns","columnGap","rowGap","ExplicitCommandField","placement","placements","find","field","CommandFormSubmit","label","footer"],"mappings":";;;;;;;;;;;;AAAA;AACA;AAyBA;AACA,MAAMA,qBAAAA,GAAwBC,2BAAAA;AAQ9B,mGACA,SAASC,UAAAA,CAAWC,OAAyB,EAAEC,MAAuB,EAAEC,OAAkB,EAAA;IACtF,IAAIC,WAAAA;IACJ,IAAI;QAAEA,WAAAA,GAAe,IAAIH,OAAAA,EAAAA,CAAgDI,mBAAmB;AAAE,IAAA,CAAA,CAC9F,OAAM;QAAE,OAAO,iCAAA;AAAmC,IAAA;AAClD,IAAA,IAAI,CAACC,KAAAA,CAAMC,OAAO,CAACH,cAAc,OAAO,2CAAA;AACxC,IAAA,MAAMI,SAAS,IAAIC,GAAAA,EAAAA;IACnB,KAAK,MAAMC,cAAcN,WAAAA,CAAa;QAClC,IAAI,CAACM,cAAc,OAAOA,UAAAA,CAAWC,IAAI,KAAK,QAAA,IAAY,CAACD,UAAAA,CAAWC,IAAI,IACtE,OAAOD,UAAAA,CAAWE,UAAU,KAAK,SAAA,IAAaJ,MAAAA,CAAOK,GAAG,CAACH,UAAAA,CAAWC,IAAI,CAAA,EAAG,OAAO,mDAAA;AACtFH,QAAAA,MAAAA,CAAOM,GAAG,CAACJ,UAAAA,CAAWC,IAAI,EAAED,UAAAA,CAAAA;AAChC,IAAA;AACA,IAAA,IAAIR,MAAAA,EAAQ;QACR,KAAK,MAAMa,SAASb,MAAAA,CAAQ;AACxB,YAAA,MAAMQ,UAAAA,GAAaF,MAAAA,CAAOQ,GAAG,CAACD,MAAME,QAAQ,CAAA;YAC5C,IAAI,CAACP,UAAAA,EAAY,OAAO,CAAC,0BAA0B,EAAEK,KAAAA,CAAME,QAAQ,CAAC,CAAC,CAAC;YACtE,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,UAAAA,CAAWgB,SAAS,CAAA,IAAK,MAAA;wBAAQC,MAAAA,EAAQb,2BAAAA,CAAeJ,UAAAA,CAAWiB,MAAM,CAAA,IAAK;AAAO,qBAAA;AAC9N3D,oBAAAA,QAAAA,EAAAA,MAAAA,CAAOuC,GAAG,CAAC1B,CAAAA,KAAAA,iBAASmB,cAAA,CAAC4B,yCAAAA,EAAAA;4BAA0C/C,KAAAA,EAAOA,KAAAA;AAAOgD,4BAAAA,SAAAA,EAAWnB,UAAAA,CAAWoB,UAAU,CAACC,IAAI,CAACF,CAAAA,SAAAA,GAAaA,SAAAA,CAAUG,KAAK,KAAKnD,KAAAA,CAAME,QAAQ,CAAA,IAAKF,MAAMgD;AAA9HhD,yBAAAA,EAAAA,KAAAA,CAAME,QAAQ,CAAA;;8BAElEiB,cAAA,CAACiC,mCAAAA,EAAAA;oBAAkBC,KAAAA,EAAOvC;;;;AAElC,IAAA;AACA,IAAA,qBAAOK,cAAA,CAACpC,qBAAAA,EAAAA;QAAsBG,OAAAA,EAASA,OAAAA;QAASE,OAAAA,EAASA,OAAAA;AAASkE,QAAAA,MAAAA,gBAAQnC,cAAA,CAACiC,mCAAAA,EAAAA;YAAkBC,KAAAA,EAAOvC;;;AACxG;;"}
@@ -2,6 +2,7 @@
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
+ var scene_model = require('@cratis/scene.model');
5
6
  var BindingKind = require('../bindings/BindingKind.js');
6
7
  var resolveElementBinding = require('../bindings/resolveElementBinding.js');
7
8
  var MissingBinding = require('../bindings/MissingBinding.js');
@@ -53,7 +54,10 @@ function commandKey(command) {
53
54
  },
54
55
  ...commandFormLayout.commandFormLayout(element.properties) === undefined ? {} : {
55
56
  layout: commandFormLayout.commandFormLayout(element.properties)
56
- }
57
+ },
58
+ ...properties.stringProperty(element.properties, 'widthSizeClass') === scene_model.WidthSizeClass.Compact ? {
59
+ compact: true
60
+ } : {}
57
61
  }, commandKey(target))
58
62
  });
59
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SceneCommandForm.js","sources":["../../../forms/SceneCommandForm.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 { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding } from '../bindings';\nimport type { BoundConstructor } from '../bindings';\nimport { numberProperty, stringArrayProperty, stringProperty, unionProperty } from '../properties';\nimport { commandFormLayout } from './commandFormLayout';\nimport { commandInputs } from './commandInputs';\n\nconst CommandFormRuntime = lazy(() => import('./CommandFormRuntime'));\n\n// Arc's useCommand constructs the proxy only on mount. Key by the actual registered class,\n// not its Scene name (which may be re-registered with a different route or roles).\nconst commandKeys = new WeakMap<BoundConstructor, number>();\nlet nextCommandKey = 0;\nfunction commandKey(command: BoundConstructor): number {\n let key = commandKeys.get(command);\n if (key === undefined) {\n key = ++nextCommandKey;\n commandKeys.set(command, key);\n }\n return key;\n}\n\n/**\n * Auto mode follows supported native proxy descriptors; opt-in inputs bind exactly named fields\n * inside a single native Arc form. Neither mode consumes the content slot.\n */\nexport function SceneCommandForm({ element }: RegisteredComponentProps) {\n const { name, target } = resolveElementBinding(element, BindingKind.Command);\n if (!target) return <MissingBinding element={element} kind={BindingKind.Command} name={name} />;\n\n const mode = unionProperty(element.properties, 'mode', ['auto', 'manual'] as const) ?? (Object.hasOwn(element.properties, 'inputs') ? 'manual' : 'auto');\n const inputs = mode === 'manual' ? commandInputs(element.properties) : undefined;\n if (mode === 'manual' && !inputs) return <div role='alert'>Invalid command form inputs declaration</div>;\n\n return (\n <ArcRuntimeBoundary>\n <CommandFormRuntime\n key={commandKey(target)}\n command={target}\n inputs={inputs}\n exclude={stringArrayProperty(element.properties, 'exclude')}\n submitLabel={stringProperty(element.properties, 'submitLabel') ?? 'Submit'}\n {...(numberProperty(element.properties, 'columns') === undefined ? {} : { columns: numberProperty(element.properties, 'columns') })}\n {...(commandFormLayout(element.properties) === undefined ? {} : { layout: commandFormLayout(element.properties) })}\n />\n </ArcRuntimeBoundary>\n );\n}\n"],"names":["CommandFormRuntime","lazy","commandKeys","WeakMap","nextCommandKey","commandKey","command","key","get","undefined","set","SceneCommandForm","element","name","target","resolveElementBinding","BindingKind","Command","_jsx","MissingBinding","kind","mode","unionProperty","properties","Object","hasOwn","inputs","commandInputs","div","role","ArcRuntimeBoundary","exclude","stringArrayProperty","submitLabel","stringProperty","numberProperty","columns","commandFormLayout","layout"],"mappings":";;;;;;;;;;;;AAWA,MAAMA,kBAAAA,iBAAqBC,UAAAA,CAAK,IAAM,oDAAO,yBAAA,KAAA,CAAA;AAE7C;AACA;AACA,MAAMC,cAAc,IAAIC,OAAAA,EAAAA;AACxB,IAAIC,cAAAA,GAAiB,CAAA;AACrB,SAASC,WAAWC,OAAyB,EAAA;IACzC,IAAIC,GAAAA,GAAML,WAAAA,CAAYM,GAAG,CAACF,OAAAA,CAAAA;AAC1B,IAAA,IAAIC,QAAQE,SAAAA,EAAW;AACnBF,QAAAA,GAAAA,GAAM,EAAEH,cAAAA;QACRF,WAAAA,CAAYQ,GAAG,CAACJ,OAAAA,EAASC,GAAAA,CAAAA;AAC7B,IAAA;IACA,OAAOA,GAAAA;AACX;AAEA;;;AAGC,IACM,SAASI,gBAAAA,CAAiB,EAAEC,OAAO,EAA4B,EAAA;IAClE,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGC,2CAAAA,CAAsBH,OAAAA,EAASI,uBAAAA,CAAYC,OAAO,CAAA;IAC3E,IAAI,CAACH,MAAAA,EAAQ,qBAAOI,cAAA,CAACC,6BAAAA,EAAAA;QAAeP,OAAAA,EAASA,OAAAA;AAASQ,QAAAA,IAAAA,EAAMJ,wBAAYC,OAAO;QAAEJ,IAAAA,EAAMA;;AAEvF,IAAA,MAAMQ,IAAAA,GAAOC,wBAAAA,CAAcV,OAAAA,CAAQW,UAAU,EAAE,MAAA,EAAQ;AAAC,QAAA,MAAA;AAAQ,QAAA;KAAS,CAAA,KAAeC,OAAOC,MAAM,CAACb,QAAQW,UAAU,EAAE,QAAA,CAAA,GAAY,QAAA,GAAW,MAAK,CAAA;AACtJ,IAAA,MAAMG,SAASL,IAAAA,KAAS,QAAA,GAAWM,2BAAAA,CAAcf,OAAAA,CAAQW,UAAU,CAAA,GAAId,SAAAA;AACvE,IAAA,IAAIY,IAAAA,KAAS,QAAA,IAAY,CAACK,MAAAA,EAAQ,qBAAOR,cAAA,CAACU,KAAAA,EAAAA;QAAIC,IAAAA,EAAK,OAAA;AAAQ,QAAA,QAAA,EAAA;;AAE3D,IAAA,qBACIX,cAAA,CAACY,qCAAAA,EAAAA;AACG,QAAA,QAAA,gBAAAZ,cAAA,CAAClB,kBAAAA,EAAAA;YAEGM,OAAAA,EAASQ,MAAAA;YACTY,MAAAA,EAAQA,MAAAA;YACRK,OAAAA,EAASC,8BAAAA,CAAoBpB,OAAAA,CAAQW,UAAU,EAAE,SAAA,CAAA;AACjDU,YAAAA,WAAAA,EAAaC,yBAAAA,CAAetB,OAAAA,CAAQW,UAAU,EAAE,aAAA,CAAA,IAAkB,QAAA;AACjE,YAAA,GAAIY,0BAAevB,OAAAA,CAAQW,UAAU,EAAE,SAAA,CAAA,KAAed,SAAAA,GAAY,EAAC,GAAI;gBAAE2B,OAAAA,EAASD,yBAAAA,CAAevB,OAAAA,CAAQW,UAAU,EAAE,SAAA;aAAY;AACjI,YAAA,GAAIc,oCAAkBzB,OAAAA,CAAQW,UAAU,CAAA,KAAMd,SAAAA,GAAY,EAAC,GAAI;gBAAE6B,MAAAA,EAAQD,mCAAAA,CAAkBzB,QAAQW,UAAU;;WANzGlB,UAAAA,CAAWS,MAAAA,CAAAA;;AAUhC;;"}
1
+ {"version":3,"file":"SceneCommandForm.js","sources":["../../../forms/SceneCommandForm.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 { lazy } from 'react';\nimport { WidthSizeClass } from '@cratis/scene.model';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding } from '../bindings';\nimport type { BoundConstructor } from '../bindings';\nimport { numberProperty, stringArrayProperty, stringProperty, unionProperty } from '../properties';\nimport { commandFormLayout } from './commandFormLayout';\nimport { commandInputs } from './commandInputs';\n\nconst CommandFormRuntime = lazy(() => import('./CommandFormRuntime'));\n\n// Arc's useCommand constructs the proxy only on mount. Key by the actual registered class,\n// not its Scene name (which may be re-registered with a different route or roles).\nconst commandKeys = new WeakMap<BoundConstructor, number>();\nlet nextCommandKey = 0;\nfunction commandKey(command: BoundConstructor): number {\n let key = commandKeys.get(command);\n if (key === undefined) {\n key = ++nextCommandKey;\n commandKeys.set(command, key);\n }\n return key;\n}\n\n/**\n * Auto mode follows supported native proxy descriptors; opt-in inputs bind exactly named fields\n * inside a single native Arc form. Neither mode consumes the content slot.\n */\nexport function SceneCommandForm({ element }: RegisteredComponentProps) {\n const { name, target } = resolveElementBinding(element, BindingKind.Command);\n if (!target) return <MissingBinding element={element} kind={BindingKind.Command} name={name} />;\n\n const mode = unionProperty(element.properties, 'mode', ['auto', 'manual'] as const) ?? (Object.hasOwn(element.properties, 'inputs') ? 'manual' : 'auto');\n const inputs = mode === 'manual' ? commandInputs(element.properties) : undefined;\n if (mode === 'manual' && !inputs) return <div role='alert'>Invalid command form inputs declaration</div>;\n\n return (\n <ArcRuntimeBoundary>\n <CommandFormRuntime\n key={commandKey(target)}\n command={target}\n inputs={inputs}\n exclude={stringArrayProperty(element.properties, 'exclude')}\n submitLabel={stringProperty(element.properties, 'submitLabel') ?? 'Submit'}\n {...(numberProperty(element.properties, 'columns') === undefined ? {} : { columns: numberProperty(element.properties, 'columns') })}\n {...(commandFormLayout(element.properties) === undefined ? {} : { layout: commandFormLayout(element.properties) })}\n {...(stringProperty(element.properties, 'widthSizeClass') === WidthSizeClass.Compact ? { compact: true } : {})}\n />\n </ArcRuntimeBoundary>\n );\n}\n"],"names":["CommandFormRuntime","lazy","commandKeys","WeakMap","nextCommandKey","commandKey","command","key","get","undefined","set","SceneCommandForm","element","name","target","resolveElementBinding","BindingKind","Command","_jsx","MissingBinding","kind","mode","unionProperty","properties","Object","hasOwn","inputs","commandInputs","div","role","ArcRuntimeBoundary","exclude","stringArrayProperty","submitLabel","stringProperty","numberProperty","columns","commandFormLayout","layout","WidthSizeClass","Compact","compact"],"mappings":";;;;;;;;;;;;;AAYA,MAAMA,kBAAAA,iBAAqBC,UAAAA,CAAK,IAAM,oDAAO,yBAAA,KAAA,CAAA;AAE7C;AACA;AACA,MAAMC,cAAc,IAAIC,OAAAA,EAAAA;AACxB,IAAIC,cAAAA,GAAiB,CAAA;AACrB,SAASC,WAAWC,OAAyB,EAAA;IACzC,IAAIC,GAAAA,GAAML,WAAAA,CAAYM,GAAG,CAACF,OAAAA,CAAAA;AAC1B,IAAA,IAAIC,QAAQE,SAAAA,EAAW;AACnBF,QAAAA,GAAAA,GAAM,EAAEH,cAAAA;QACRF,WAAAA,CAAYQ,GAAG,CAACJ,OAAAA,EAASC,GAAAA,CAAAA;AAC7B,IAAA;IACA,OAAOA,GAAAA;AACX;AAEA;;;AAGC,IACM,SAASI,gBAAAA,CAAiB,EAAEC,OAAO,EAA4B,EAAA;IAClE,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGC,2CAAAA,CAAsBH,OAAAA,EAASI,uBAAAA,CAAYC,OAAO,CAAA;IAC3E,IAAI,CAACH,MAAAA,EAAQ,qBAAOI,cAAA,CAACC,6BAAAA,EAAAA;QAAeP,OAAAA,EAASA,OAAAA;AAASQ,QAAAA,IAAAA,EAAMJ,wBAAYC,OAAO;QAAEJ,IAAAA,EAAMA;;AAEvF,IAAA,MAAMQ,IAAAA,GAAOC,wBAAAA,CAAcV,OAAAA,CAAQW,UAAU,EAAE,MAAA,EAAQ;AAAC,QAAA,MAA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 -1 +1 @@
1
- {"version":3,"file":"cratisComponentsDescriptors.d.ts","sourceRoot":"","sources":["../../cratisComponentsDescriptors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkC,mBAAmB,EAAsF,MAAM,qBAAqB,CAAC;AAiF9K,eAAO,MAAM,2BAA2B,EAAE,mBAAmB,EAiB5D,CAAC"}
1
+ {"version":3,"file":"cratisComponentsDescriptors.d.ts","sourceRoot":"","sources":["../../cratisComponentsDescriptors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkC,mBAAmB,EAAsF,MAAM,qBAAqB,CAAC;AAsF9K,eAAO,MAAM,2BAA2B,EAAE,mBAAmB,EAiB5D,CAAC"}
@@ -109,6 +109,24 @@ const commandFormProperties = [
109
109
  editorKind: 'commandFormLayout',
110
110
  description: 'Typed command-form geometry: columns, gaps and field placements. Independent of auto/manual field generation.'
111
111
  },
112
+ {
113
+ path: 'widthSizeClass',
114
+ label: 'Width size class',
115
+ group: 'Layout',
116
+ valueType: PropertyValueType.Enum,
117
+ default: 'Regular',
118
+ choices: [
119
+ {
120
+ value: 'Regular',
121
+ label: 'Regular'
122
+ },
123
+ {
124
+ value: 'Compact',
125
+ label: 'Compact'
126
+ }
127
+ ],
128
+ description: 'The width size class the host evaluated. At Compact the fields of a manual form stack in one column in reading order.'
129
+ },
112
130
  {
113
131
  path: 'fieldWidths',
114
132
  label: 'Legacy field widths',
@@ -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 { 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,oBAAAA,CAAqB,mBAAA,EAAqBD,IAAAA,CAAAA;AAExE;;;;;;;;AAQC,IACD,MAAME,mBAAAA,GAA4C;AAC9C,IAAA;QACIC,IAAAA,EAAM,OAAA;QAASC,KAAAA,EAAO,OAAA;QAASC,KAAAA,EAAO,MAAA;AAAQC,QAAAA,SAAAA,EAAWC,kBAAkBC,cAAc;QAAEC,UAAAA,EAAY,cAAA;QACvGC,WAAAA,EAAa,4CAAA;QACbC,WAAAA,EAAa;YAAEC,QAAAA,EAAU,IAAA;YAAMC,YAAAA,EAAc;AAACC,gBAAAA,gBAAAA,CAAiBC;AAAW;AAAC;AAC/E,KAAA;AACA,IAAA;QAAEZ,IAAAA,EAAM,cAAA;QAAgBC,KAAAA,EAAO,eAAA;QAAiBC,KAAAA,EAAO,SAAA;AAAWC,QAAAA,SAAAA,EAAWC,kBAAkBS,MAAM;QAAEC,OAAAA,EAAS;AAAG,KAAA;AACnH,IAAA;QACId,IAAAA,EAAM,SAAA;QAAWC,KAAAA,EAAO,cAAA;QAAgBC,KAAAA,EAAO,MAAA;AAAQC,QAAAA,SAAAA,EAAWC,kBAAkBS,MAAM;QAAEP,UAAAA,EAAY,aAAA;QACxGC,W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,EAAS;AAAS;AAC1H,CAAA;AAED;;;;;;UAOakB,2BAAAA,GAAqD;AAC9D,IAAA;AAAEC,QAAAA,SAAAA,EAAWrC,GAAAA,CAAI,WAAA,CAAA;QAAcsC,WAAAA,EAAa,YAAA;QAAcH,UAAAA,EAAYhC;AAAoB,KAAA;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,0BAA0BC,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 */\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,oBAAAA,CAAqB,mBAAA,EAAqBD,IAAAA,CAAAA;AAExE;;;;;;;;AAQC,IACD,MAAME,mBAAAA,GAA4C;AAC9C,IAAA;QACIC,IAAAA,EAAM,OAAA;QAASC,KAAAA,EAAO,OAAA;QAASC,KAAAA,EAAO,MAAA;AAAQC,QAAAA,SAAAA,EAAWC,kBAAkBC,cAAc;QAAEC,UAAAA,EAAY,cAAA;QACvGC,WAAAA,EAAa,4CAAA;QACbC,WAAAA,EAAa;YAAEC,QAAAA,EAAU,IAAA;YAAMC,YAAAA,EAAc;AAACC,gBAAAA,gBAAAA,CAAiBC;AAAW;AAAC;AAC/E,KAAA;AACA,IAAA;QAAEZ,IAAAA,EAAM,cAAA;QAAgBC,KAAAA,EAAO,eAAA;QAAiBC,KAAAA,EAAO,SAAA;AAAWC,QAAAA,SAAAA,EAAWC,kBAAkBS,MAAM;QAAEC,OAAAA,EAAS;AAAG,KAAA;AACnH,IAAA;QACId,IAAAA,EAAM,SAAA;QAAWC,KAAAA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BC,OAAO;gBAC5CC,YAAAA,EAAc,+BAAA;gBACdjC,WAAAA,EAAa;AACjB;AAAE;AACN;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"cratisComponentsPackage.d.ts","sourceRoot":"","sources":["../../cratisComponentsPackage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AA0BzD,eAAO,MAAM,+BAA+B,EAAE,YA+E7C,CAAC;AASF,eAAO,MAAM,uBAAuB,EAAE,kBAerC,CAAC"}
1
+ {"version":3,"file":"cratisComponentsPackage.d.ts","sourceRoot":"","sources":["../../cratisComponentsPackage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AA2BzD,eAAO,MAAM,+BAA+B,EAAE,YA+E7C,CAAC;AASF,eAAO,MAAM,uBAAuB,EAAE,kBAgBrC,CAAC"}
@@ -3,6 +3,7 @@ import { cratisComponents, cratisComponentsPackageName } from './cratisComponent
3
3
  import { cratisComponentsDescriptors } from './cratisComponentsDescriptors.js';
4
4
  import { CommandFieldPropertyEditor } from './forms/CommandFieldPropertyEditor.js';
5
5
  import { CommandFormDesigner } from './forms/CommandFormDesigner.js';
6
+ import { CommandFormLayoutEditor } from './forms/CommandFormLayoutEditor.js';
6
7
  import { generateCommandFieldsAction } from './forms/generateCommandFieldsAction.js';
7
8
 
8
9
  // Copyright (c) Cratis. All rights reserved.
@@ -106,7 +107,8 @@ import { generateCommandFieldsAction } from './forms/generateCommandFieldsAction
106
107
  propertyEditors: [
107
108
  'commandBinding',
108
109
  'commandFields',
109
- 'fieldWidths'
110
+ 'fieldWidths',
111
+ 'commandFormLayout'
110
112
  ],
111
113
  propertyDisplays: [],
112
114
  actions: [
@@ -138,7 +140,8 @@ import { generateCommandFieldsAction } from './forms/generateCommandFieldsAction
138
140
  commandFormDesigner: CommandFormDesigner
139
141
  },
140
142
  propertyEditors: {
141
- commandBinding: CommandFieldPropertyEditor
143
+ commandBinding: CommandFieldPropertyEditor,
144
+ commandFormLayout: CommandFormLayoutEditor
142
145
  },
143
146
  actions: {
144
147
  [generateCommandFieldsAction.descriptor.id]: generateCommandFieldsAction