@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.
- package/cratisComponentsPackage.ts +8 -0
- package/dist/cjs/cratisComponentsPackage.js +8 -0
- package/dist/cjs/cratisComponentsPackage.js.map +1 -1
- package/dist/cjs/forms/CommandFieldPropertyEditor.js +28 -0
- package/dist/cjs/forms/CommandFieldPropertyEditor.js.map +1 -0
- package/dist/cjs/forms/CommandFormDesigner.js +20 -0
- package/dist/cjs/forms/CommandFormDesigner.js.map +1 -0
- package/dist/esm/cratisComponentsPackage.d.ts.map +1 -1
- package/dist/esm/cratisComponentsPackage.js +8 -0
- package/dist/esm/cratisComponentsPackage.js.map +1 -1
- package/dist/esm/forms/CommandFieldPropertyEditor.d.ts +3 -0
- package/dist/esm/forms/CommandFieldPropertyEditor.d.ts.map +1 -0
- package/dist/esm/forms/CommandFieldPropertyEditor.js +26 -0
- package/dist/esm/forms/CommandFieldPropertyEditor.js.map +1 -0
- package/dist/esm/forms/CommandFormDesigner.d.ts +3 -0
- package/dist/esm/forms/CommandFormDesigner.d.ts.map +1 -0
- package/dist/esm/forms/CommandFormDesigner.js +18 -0
- package/dist/esm/forms/CommandFormDesigner.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/forms/CommandFieldPropertyEditor.tsx +16 -0
- package/forms/CommandFormDesigner.tsx +14 -0
- package/package.json +7 -7
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { SceneEditKind } from '@cratis/scene.model';
|
|
5
|
+
import { DesignTimePropertyEditorProps } from '@cratis/scene.react';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Package-side editor for a command form property. It writes through the generic Scene edit boundary.
|
|
9
|
+
*/
|
|
10
|
+
export function CommandFieldPropertyEditor({ context, property, value, setValue }: DesignTimePropertyEditorProps) {
|
|
11
|
+
return <input aria-label={property.label} value={typeof value === 'string' ? value : ''} onChange={event => {
|
|
12
|
+
const next = event.currentTarget.value;
|
|
13
|
+
setValue(next);
|
|
14
|
+
context.submitEdits([{ kind: SceneEditKind.SetProperty, nodeId: context.element.id, path: property.path, value: next }]);
|
|
15
|
+
}} />;
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { DesignTimeComponentProps } from '@cratis/scene.react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Generic package-side command form designer. It reads only the shared design-time context and submits Scene edits.
|
|
8
|
+
*/
|
|
9
|
+
export function CommandFormDesigner({ context }: DesignTimeComponentProps) {
|
|
10
|
+
const canGenerate = context.capabilities['commandForm.generateFields'] === true && context.permissions.edit !== false;
|
|
11
|
+
return <button type='button' disabled={!canGenerate} onClick={() => context.submitAction('Cratis.Components.commandForm.generateFields', [])}>
|
|
12
|
+
Generate fields
|
|
13
|
+
</button>;
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cratis/scene.components",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.10.0",
|
|
4
4
|
"description": "The Cratis Components package: exposes @cratis/components' Arc-bound data, form and dialog composites as Scene components. Built on PrimeReact and Tailwind, and declares both as dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cratis",
|
|
@@ -54,17 +54,17 @@
|
|
|
54
54
|
"build-storybook": "storybook build"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@cratis/scene.engine": "4.
|
|
58
|
-
"@cratis/scene.model": "4.
|
|
59
|
-
"@cratis/scene.react": "4.
|
|
57
|
+
"@cratis/scene.engine": "4.10.0",
|
|
58
|
+
"@cratis/scene.model": "4.10.0",
|
|
59
|
+
"@cratis/scene.react": "4.10.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@cratis/arc": "22.50.5",
|
|
63
63
|
"@cratis/arc.react": "22.50.5",
|
|
64
64
|
"@cratis/components": "4.25.0",
|
|
65
|
-
"@cratis/scene.engine": "4.
|
|
66
|
-
"@cratis/scene.model": "4.
|
|
67
|
-
"@cratis/scene.react": "4.
|
|
65
|
+
"@cratis/scene.engine": "4.10.0",
|
|
66
|
+
"@cratis/scene.model": "4.10.0",
|
|
67
|
+
"@cratis/scene.react": "4.10.0",
|
|
68
68
|
"@storybook/addon-links": "^10.6.1",
|
|
69
69
|
"@storybook/react": "^10.6.1",
|
|
70
70
|
"@storybook/react-vite": "^10.6.1",
|