@cratis/scene.components 4.70.1 → 4.71.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.
@@ -1,6 +1,7 @@
1
1
  // Copyright (c) Cratis. All rights reserved.
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
 
4
+ import { elementNodeId } from '@cratis/scene.engine';
4
5
  import { SceneEditKind } from '@cratis/scene.model';
5
6
  import { DesignTimePropertyEditorProps } from '@cratis/scene.react';
6
7
 
@@ -11,6 +12,6 @@ export function CommandFieldPropertyEditor({ context, property, value, setValue
11
12
  return <input aria-label={property.label} value={typeof value === 'string' ? value : ''} onChange={event => {
12
13
  const next = event.currentTarget.value;
13
14
  setValue(next);
14
- context.submitEdits([{ kind: SceneEditKind.SetProperty, nodeId: context.element.id, path: property.path, value: next }]);
15
+ context.submitEdits([{ kind: SceneEditKind.SetProperty, nodeId: elementNodeId(context.element.id), path: property.path, value: next }]);
15
16
  }} />;
16
17
  }
@@ -3,7 +3,7 @@
3
3
 
4
4
  import { KeyboardEvent, useState } from 'react';
5
5
  import { CommandFormLayout, SceneEditKind } from '@cratis/scene.model';
6
- import { CommandFormLayoutKey, applyCommandFormLayoutKey } from '@cratis/scene.engine';
6
+ import { CommandFormLayoutKey, applyCommandFormLayoutKey, elementNodeId } from '@cratis/scene.engine';
7
7
  import { DesignTimePropertyEditorProps } from '@cratis/scene.react';
8
8
  import { commandFormLayout } from './commandFormLayout';
9
9
 
@@ -35,7 +35,7 @@ export function CommandFormLayoutEditor({ context, property, value, setValue }:
35
35
 
36
36
  const commit = (next: CommandFormLayout) => {
37
37
  setValue(next);
38
- context.submitEdits([{ kind: SceneEditKind.SetProperty, nodeId: context.element.id, path: property.path, value: next }]);
38
+ context.submitEdits([{ kind: SceneEditKind.SetProperty, nodeId: elementNodeId(context.element.id), path: property.path, value: next }]);
39
39
  };
40
40
 
41
41
  return <div role='group' aria-label={property.label} aria-describedby={`${context.element.id}-layout-help`}>
@@ -1,6 +1,7 @@
1
1
  // Copyright (c) Cratis. All rights reserved.
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
 
4
+ import { elementNodeId } from '@cratis/scene.engine';
4
5
  import { DesignTimeAction, DesignTimeActionContext, DesignTimeActionResult } from '@cratis/scene.react';
5
6
  import { DesignTimeActionPlacement, SceneEditKind } from '@cratis/scene.model';
6
7
 
@@ -32,9 +33,11 @@ function generateCommandFields(context: DesignTimeActionContext): DesignTimeActi
32
33
  diagnostics: [],
33
34
  edits: [{
34
35
  kind: SceneEditKind.SetProperty,
35
- nodeId: context.element.id,
36
+ nodeId: elementNodeId(context.element.id),
36
37
  path: 'inputs',
38
+ // A collection item is addressed by its id, so an item without one is refused by the editing engine and nothing is generated.
37
39
  value: properties.map((property, index) => ({
40
+ id: property.name,
38
41
  property: property.name,
39
42
  type: property.type === 'Guid' || property.type === 'guid' ? 'guid' : 'string',
40
43
  label: property.label ?? humanize(property.name),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/scene.components",
3
- "version": "4.70.1",
3
+ "version": "4.71.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",
@@ -59,17 +59,17 @@
59
59
  "build-storybook": "storybook build"
60
60
  },
61
61
  "dependencies": {
62
- "@cratis/scene.engine": "4.70.1",
63
- "@cratis/scene.model": "4.70.1",
64
- "@cratis/scene.react": "4.70.1"
62
+ "@cratis/scene.engine": "4.71.0",
63
+ "@cratis/scene.model": "4.71.0",
64
+ "@cratis/scene.react": "4.71.0"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@cratis/arc": "22.76.0",
68
68
  "@cratis/arc.react": "22.76.0",
69
69
  "@cratis/components": "4.26.4",
70
- "@cratis/scene.engine": "4.70.1",
71
- "@cratis/scene.model": "4.70.1",
72
- "@cratis/scene.react": "4.70.1",
70
+ "@cratis/scene.engine": "4.71.0",
71
+ "@cratis/scene.model": "4.71.0",
72
+ "@cratis/scene.react": "4.71.0",
73
73
  "@storybook/addon-links": "^10.6.1",
74
74
  "@storybook/react": "^10.6.1",
75
75
  "@storybook/react-vite": "^10.6.1",