@cratis/scene.components 4.9.0 → 4.10.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.
@@ -5,6 +5,8 @@ import { PackageKind, ScenePackage } from '@cratis/scene.model';
5
5
  import { ScenePackageBundle } from '@cratis/scene.react';
6
6
  import { cratisComponents, cratisComponentsPackageName } from './cratisComponents';
7
7
  import { cratisComponentsDescriptors } from './cratisComponentsDescriptors';
8
+ import { CommandFieldPropertyEditor } from './forms/CommandFieldPropertyEditor';
9
+ import { CommandFormDesigner } from './forms/CommandFormDesigner';
8
10
  import { generateCommandFieldsAction } from './forms/generateCommandFieldsAction';
9
11
 
10
12
  /**
@@ -119,6 +121,12 @@ export const cratisComponentsPackage: ScenePackageBundle = {
119
121
  components: cratisComponents,
120
122
  descriptors: cratisComponentsDescriptors,
121
123
  designTime: {
124
+ designers: {
125
+ commandFormDesigner: CommandFormDesigner,
126
+ },
127
+ propertyEditors: {
128
+ commandBinding: CommandFieldPropertyEditor,
129
+ },
122
130
  actions: {
123
131
  [generateCommandFieldsAction.descriptor.id]: generateCommandFieldsAction,
124
132
  },
@@ -3,6 +3,8 @@
3
3
  var scene_model = require('@cratis/scene.model');
4
4
  var cratisComponents = require('./cratisComponents.js');
5
5
  var cratisComponentsDescriptors = require('./cratisComponentsDescriptors.js');
6
+ var CommandFieldPropertyEditor = require('./forms/CommandFieldPropertyEditor.js');
7
+ var CommandFormDesigner = require('./forms/CommandFormDesigner.js');
6
8
  var generateCommandFieldsAction = require('./forms/generateCommandFieldsAction.js');
7
9
 
8
10
  // Copyright (c) Cratis. All rights reserved.
@@ -134,6 +136,12 @@ var generateCommandFieldsAction = require('./forms/generateCommandFieldsAction.j
134
136
  components: cratisComponents.cratisComponents,
135
137
  descriptors: cratisComponentsDescriptors.cratisComponentsDescriptors,
136
138
  designTime: {
139
+ designers: {
140
+ commandFormDesigner: CommandFormDesigner.CommandFormDesigner
141
+ },
142
+ propertyEditors: {
143
+ commandBinding: CommandFieldPropertyEditor.CommandFieldPropertyEditor
144
+ },
137
145
  actions: {
138
146
  [generateCommandFieldsAction.generateCommandFieldsAction.descriptor.id]: generateCommandFieldsAction.generateCommandFieldsAction
139
147
  }
@@ -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 { 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 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","generateCommandFieldsAction","descriptor","id"],"mappings":";;;;;;;AAAA;AACA;AAQA;;;;;;;;;;;;;;;;;;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,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Ae,QAAA;AAAqB;AACrE;AAEA;;;;;;UAOaC,uBAAAA,GAA8C;IACvDC,QAAAA,EAAU5B,+BAAAA;IACVS,UAAAA,EAAYoB,iCAAAA;IACZC,WAAAA,EAAaC,uDAAAA;IACbZ,UAAAA,EAAY;QACRK,OAAAA,EAAS;AACL,YAAA,CAACQ,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 { 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,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YAAA;AAAsB,SAAA;QAClCC,eAAAA,EAAiB;AAAC,YAAA,gBAAA;AAAkB,YAAA,eAAA;AAAiB,YAAA;AAAc,SAAA;AACnEC,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;AACpB,SAAA;QACAX,OAAAA,EAAS;AACL,YAAA,CAACY,uDAAAA,CAA4BC,UAAU,CAACC,EAAE,GAAGF;AACjD;AACJ;AACJ;;;"}
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var scene_model = require('@cratis/scene.model');
5
+
6
+ /**
7
+ * Package-side editor for a command form property. It writes through the generic Scene edit boundary.
8
+ */ function CommandFieldPropertyEditor({ context, property, value, setValue }) {
9
+ return /*#__PURE__*/ jsxRuntime.jsx("input", {
10
+ "aria-label": property.label,
11
+ value: typeof value === 'string' ? value : '',
12
+ onChange: (event)=>{
13
+ const next = event.currentTarget.value;
14
+ setValue(next);
15
+ context.submitEdits([
16
+ {
17
+ kind: scene_model.SceneEditKind.SetProperty,
18
+ nodeId: context.element.id,
19
+ path: property.path,
20
+ value: next
21
+ }
22
+ ]);
23
+ }
24
+ });
25
+ }
26
+
27
+ exports.CommandFieldPropertyEditor = CommandFieldPropertyEditor;
28
+ //# sourceMappingURL=CommandFieldPropertyEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandFieldPropertyEditor.js","sources":["../../../forms/CommandFieldPropertyEditor.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 { SceneEditKind } from '@cratis/scene.model';\nimport { DesignTimePropertyEditorProps } from '@cratis/scene.react';\n\n/**\n * Package-side editor for a command form property. It writes through the generic Scene edit boundary.\n */\nexport function CommandFieldPropertyEditor({ context, property, value, setValue }: DesignTimePropertyEditorProps) {\n return <input aria-label={property.label} value={typeof value === 'string' ? value : ''} onChange={event => {\n const next = event.currentTarget.value;\n setValue(next);\n context.submitEdits([{ kind: SceneEditKind.SetProperty, nodeId: context.element.id, path: property.path, value: next }]);\n }} />;\n}\n"],"names":["CommandFieldPropertyEditor","context","property","value","setValue","_jsx","input","aria-label","label","onChange","event","next","currentTarget","submitEdits","kind","SceneEditKind","SetProperty","nodeId","element","id","path"],"mappings":";;;;;AAMA;;IAGO,SAASA,0BAAAA,CAA2B,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,QAAQ,EAAiC,EAAA;AAC5G,IAAA,qBAAOC,cAAA,CAACC,OAAAA,EAAAA;AAAMC,QAAAA,YAAAA,EAAYL,SAASM,KAAK;QAAEL,KAAAA,EAAO,OAAOA,KAAAA,KAAU,QAAA,GAAWA,KAAAA,GAAQ,EAAA;AAAIM,QAAAA,QAAAA,EAAUC,CAAAA,KAAAA,GAAAA;AAC/F,YAAA,MAAMC,IAAAA,GAAOD,KAAAA,CAAME,aAAa,CAACT,KAAK;YACtCC,QAAAA,CAASO,IAAAA,CAAAA;AACTV,YAAAA,OAAAA,CAAQY,WAAW,CAAC;AAAC,gBAAA;AAAEC,oBAAAA,IAAAA,EAAMC,0BAAcC,WAAW;oBAAEC,MAAAA,EAAQhB,OAAAA,CAAQiB,OAAO,CAACC,EAAE;AAAEC,oBAAAA,IAAAA,EAAMlB,SAASkB,IAAI;oBAAEjB,KAAAA,EAAOQ;AAAK;AAAE,aAAA,CAAA;AAC3H,QAAA;;AACJ;;"}
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+
5
+ // Copyright (c) Cratis. All rights reserved.
6
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
7
+ /**
8
+ * Generic package-side command form designer. It reads only the shared design-time context and submits Scene edits.
9
+ */ function CommandFormDesigner({ context }) {
10
+ const canGenerate = context.capabilities['commandForm.generateFields'] === true && context.permissions.edit !== false;
11
+ return /*#__PURE__*/ jsxRuntime.jsx("button", {
12
+ type: "button",
13
+ disabled: !canGenerate,
14
+ onClick: ()=>context.submitAction('Cratis.Components.commandForm.generateFields', []),
15
+ children: "Generate fields"
16
+ });
17
+ }
18
+
19
+ exports.CommandFormDesigner = CommandFormDesigner;
20
+ //# sourceMappingURL=CommandFormDesigner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandFormDesigner.js","sources":["../../../forms/CommandFormDesigner.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 { DesignTimeComponentProps } from '@cratis/scene.react';\n\n/**\n * Generic package-side command form designer. It reads only the shared design-time context and submits Scene edits.\n */\nexport function CommandFormDesigner({ context }: DesignTimeComponentProps) {\n const canGenerate = context.capabilities['commandForm.generateFields'] === true && context.permissions.edit !== false;\n return <button type='button' disabled={!canGenerate} onClick={() => context.submitAction('Cratis.Components.commandForm.generateFields', [])}>\n Generate fields\n </button>;\n}\n"],"names":["CommandFormDesigner","context","canGenerate","capabilities","permissions","edit","_jsx","button","type","disabled","onClick","submitAction"],"mappings":";;;;AAAA;AACA;AAIA;;AAEC,IACM,SAASA,mBAAAA,CAAoB,EAAEC,OAAO,EAA4B,EAAA;IACrE,MAAMC,WAAAA,GAAcD,OAAAA,CAAQE,YAAY,CAAC,4BAAA,CAA6B,KAAK,IAAA,IAAQF,OAAAA,CAAQG,WAAW,CAACC,IAAI,KAAK,KAAA;AAChH,IAAA,qBAAOC,cAAA,CAACC,QAAAA,EAAAA;QAAOC,IAAAA,EAAK,QAAA;AAASC,QAAAA,QAAAA,EAAU,CAACP,WAAAA;AAAaQ,QAAAA,OAAAA,EAAS,IAAMT,OAAAA,CAAQU,YAAY,CAAC,gDAAgD,EAAE,CAAA;AAAG,QAAA,QAAA,EAAA;;AAGlJ;;"}
@@ -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;AAwBzD,eAAO,MAAM,+BAA+B,EAAE,YA+E7C,CAAC;AASF,eAAO,MAAM,uBAAuB,EAAE,kBASrC,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;AA0BzD,eAAO,MAAM,+BAA+B,EAAE,YA+E7C,CAAC;AASF,eAAO,MAAM,uBAAuB,EAAE,kBAerC,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import { PackageKind } from '@cratis/scene.model';
2
2
  import { cratisComponents, cratisComponentsPackageName } from './cratisComponents.js';
3
3
  import { cratisComponentsDescriptors } from './cratisComponentsDescriptors.js';
4
+ import { CommandFieldPropertyEditor } from './forms/CommandFieldPropertyEditor.js';
5
+ import { CommandFormDesigner } from './forms/CommandFormDesigner.js';
4
6
  import { generateCommandFieldsAction } from './forms/generateCommandFieldsAction.js';
5
7
 
6
8
  // Copyright (c) Cratis. All rights reserved.
@@ -132,6 +134,12 @@ import { generateCommandFieldsAction } from './forms/generateCommandFieldsAction
132
134
  components: cratisComponents,
133
135
  descriptors: cratisComponentsDescriptors,
134
136
  designTime: {
137
+ designers: {
138
+ commandFormDesigner: CommandFormDesigner
139
+ },
140
+ propertyEditors: {
141
+ commandBinding: CommandFieldPropertyEditor
142
+ },
135
143
  actions: {
136
144
  [generateCommandFieldsAction.descriptor.id]: generateCommandFieldsAction
137
145
  }
@@ -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 { 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 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","generateCommandFieldsAction","descriptor","id"],"mappings":";;;;;AAAA;AACA;AAQA;;;;;;;;;;;;;;;;;;UAmBaA,+BAAAA,GAAgD;IACzDC,IAAAA,EAAMC,2BAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,YAAYC,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,QA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AAA,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,gBAAAA;IACZC,WAAAA,EAAaC,2BAAAA;IACbZ,UAAAA,EAAY;QACRK,OAAAA,EAAS;AACL,YAAA,CAACQ,2BAAAA,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 { 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,GA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AAA,EAAY,mDAAA;IACZC,UAAAA,EAAY;AACRC,QAAAA,QAAAA,EAAU,EAAE;QACZC,SAAAA,EAAW;AAAC,YAAA;AAAsB,SAAA;QAClCC,eAAAA,EAAiB;AAAC,YAAA,gBAAA;AAAkB,YAAA,eAAA;AAAiB,YAAA;AAAc,SAAA;AACnEC,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,gBAAAA;IACZC,WAAAA,EAAaC,2BAAAA;IACbZ,UAAAA,EAAY;QACRE,SAAAA,EAAW;YACPW,mBAAAA,EAAqBC;AACzB,SAAA;QACAX,eAAAA,EAAiB;YACbY,cAAAA,EAAgBC;AACpB,SAAA;QACAX,OAAAA,EAAS;AACL,YAAA,CAACY,2BAAAA,CAA4BC,UAAU,CAACC,EAAE,GAAGF;AACjD;AACJ;AACJ;;"}
@@ -0,0 +1,3 @@
1
+ import { DesignTimePropertyEditorProps } from '@cratis/scene.react';
2
+ export declare function CommandFieldPropertyEditor({ context, property, value, setValue }: DesignTimePropertyEditorProps): import("react").JSX.Element;
3
+ //# sourceMappingURL=CommandFieldPropertyEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandFieldPropertyEditor.d.ts","sourceRoot":"","sources":["../../../forms/CommandFieldPropertyEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAKpE,wBAAgB,0BAA0B,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,6BAA6B,+BAM/G"}
@@ -0,0 +1,26 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { SceneEditKind } from '@cratis/scene.model';
3
+
4
+ /**
5
+ * Package-side editor for a command form property. It writes through the generic Scene edit boundary.
6
+ */ function CommandFieldPropertyEditor({ context, property, value, setValue }) {
7
+ return /*#__PURE__*/ jsx("input", {
8
+ "aria-label": property.label,
9
+ value: typeof value === 'string' ? value : '',
10
+ onChange: (event)=>{
11
+ const next = event.currentTarget.value;
12
+ setValue(next);
13
+ context.submitEdits([
14
+ {
15
+ kind: SceneEditKind.SetProperty,
16
+ nodeId: context.element.id,
17
+ path: property.path,
18
+ value: next
19
+ }
20
+ ]);
21
+ }
22
+ });
23
+ }
24
+
25
+ export { CommandFieldPropertyEditor };
26
+ //# sourceMappingURL=CommandFieldPropertyEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandFieldPropertyEditor.js","sources":["../../../forms/CommandFieldPropertyEditor.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 { SceneEditKind } from '@cratis/scene.model';\nimport { DesignTimePropertyEditorProps } from '@cratis/scene.react';\n\n/**\n * Package-side editor for a command form property. It writes through the generic Scene edit boundary.\n */\nexport function CommandFieldPropertyEditor({ context, property, value, setValue }: DesignTimePropertyEditorProps) {\n return <input aria-label={property.label} value={typeof value === 'string' ? value : ''} onChange={event => {\n const next = event.currentTarget.value;\n setValue(next);\n context.submitEdits([{ kind: SceneEditKind.SetProperty, nodeId: context.element.id, path: property.path, value: next }]);\n }} />;\n}\n"],"names":["CommandFieldPropertyEditor","context","property","value","setValue","_jsx","input","aria-label","label","onChange","event","next","currentTarget","submitEdits","kind","SceneEditKind","SetProperty","nodeId","element","id","path"],"mappings":";;;AAMA;;IAGO,SAASA,0BAAAA,CAA2B,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,QAAQ,EAAiC,EAAA;AAC5G,IAAA,qBAAOC,GAAA,CAACC,OAAAA,EAAAA;AAAMC,QAAAA,YAAAA,EAAYL,SAASM,KAAK;QAAEL,KAAAA,EAAO,OAAOA,KAAAA,KAAU,QAAA,GAAWA,KAAAA,GAAQ,EAAA;AAAIM,QAAAA,QAAAA,EAAUC,CAAAA,KAAAA,GAAAA;AAC/F,YAAA,MAAMC,IAAAA,GAAOD,KAAAA,CAAME,aAAa,CAACT,KAAK;YACtCC,QAAAA,CAASO,IAAAA,CAAAA;AACTV,YAAAA,OAAAA,CAAQY,WAAW,CAAC;AAAC,gBAAA;AAAEC,oBAAAA,IAAAA,EAAMC,cAAcC,WAAW;oBAAEC,MAAAA,EAAQhB,OAAAA,CAAQiB,OAAO,CAACC,EAAE;AAAEC,oBAAAA,IAAAA,EAAMlB,SAASkB,IAAI;oBAAEjB,KAAAA,EAAOQ;AAAK;AAAE,aAAA,CAAA;AAC3H,QAAA;;AACJ;;"}
@@ -0,0 +1,3 @@
1
+ import { DesignTimeComponentProps } from '@cratis/scene.react';
2
+ export declare function CommandFormDesigner({ context }: DesignTimeComponentProps): import("react").JSX.Element;
3
+ //# sourceMappingURL=CommandFormDesigner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandFormDesigner.d.ts","sourceRoot":"","sources":["../../../forms/CommandFormDesigner.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAK/D,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,EAAE,wBAAwB,+BAKxE"}
@@ -0,0 +1,18 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /**
6
+ * Generic package-side command form designer. It reads only the shared design-time context and submits Scene edits.
7
+ */ function CommandFormDesigner({ context }) {
8
+ const canGenerate = context.capabilities['commandForm.generateFields'] === true && context.permissions.edit !== false;
9
+ return /*#__PURE__*/ jsx("button", {
10
+ type: "button",
11
+ disabled: !canGenerate,
12
+ onClick: ()=>context.submitAction('Cratis.Components.commandForm.generateFields', []),
13
+ children: "Generate fields"
14
+ });
15
+ }
16
+
17
+ export { CommandFormDesigner };
18
+ //# sourceMappingURL=CommandFormDesigner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandFormDesigner.js","sources":["../../../forms/CommandFormDesigner.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 { DesignTimeComponentProps } from '@cratis/scene.react';\n\n/**\n * Generic package-side command form designer. It reads only the shared design-time context and submits Scene edits.\n */\nexport function CommandFormDesigner({ context }: DesignTimeComponentProps) {\n const canGenerate = context.capabilities['commandForm.generateFields'] === true && context.permissions.edit !== false;\n return <button type='button' disabled={!canGenerate} onClick={() => context.submitAction('Cratis.Components.commandForm.generateFields', [])}>\n Generate fields\n </button>;\n}\n"],"names":["CommandFormDesigner","context","canGenerate","capabilities","permissions","edit","_jsx","button","type","disabled","onClick","submitAction"],"mappings":";;AAAA;AACA;AAIA;;AAEC,IACM,SAASA,mBAAAA,CAAoB,EAAEC,OAAO,EAA4B,EAAA;IACrE,MAAMC,WAAAA,GAAcD,OAAAA,CAAQE,YAAY,CAAC,4BAAA,CAA6B,KAAK,IAAA,IAAQF,OAAAA,CAAQG,WAAW,CAACC,IAAI,KAAK,KAAA;AAChH,IAAA,qBAAOC,GAAA,CAACC,QAAAA,EAAAA;QAAOC,IAAAA,EAAK,QAAA;AAASC,QAAAA,QAAAA,EAAU,CAACP,WAAAA;AAAaQ,QAAAA,OAAAA,EAAS,IAAMT,OAAAA,CAAQU,YAAY,CAAC,gDAAgD,EAAE,CAAA;AAAG,QAAA,QAAA,EAAA;;AAGlJ;;"}