@cratis/scene.components 4.15.0 → 4.16.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 (49) hide show
  1. package/cratisComponentsPackage.ts +9 -125
  2. package/cratisComponentsPackageManifest.ts +106 -0
  3. package/cratisComponentsRuntimePackage.ts +22 -0
  4. package/designTime/cratisComponentsDesignTime.ts +22 -0
  5. package/dist/cjs/cratisComponentsPackage.js +10 -144
  6. package/dist/cjs/cratisComponentsPackage.js.map +1 -1
  7. package/dist/cjs/cratisComponentsPackageManifest.js +126 -0
  8. package/dist/cjs/cratisComponentsPackageManifest.js.map +1 -0
  9. package/dist/cjs/cratisComponentsRuntimePackage.js +24 -0
  10. package/dist/cjs/cratisComponentsRuntimePackage.js.map +1 -0
  11. package/dist/cjs/designTime/cratisComponentsDesignTime.js +24 -0
  12. package/dist/cjs/designTime/cratisComponentsDesignTime.js.map +1 -0
  13. package/dist/cjs/forms/generateCommandFieldsAction.js +10 -1
  14. package/dist/cjs/forms/generateCommandFieldsAction.js.map +1 -1
  15. package/dist/cjs/index.js +6 -1
  16. package/dist/cjs/index.js.map +1 -1
  17. package/dist/cjs/runtime.js +15 -0
  18. package/dist/cjs/runtime.js.map +1 -0
  19. package/dist/esm/cratisComponentsPackage.d.ts +1 -2
  20. package/dist/esm/cratisComponentsPackage.d.ts.map +1 -1
  21. package/dist/esm/cratisComponentsPackage.js +10 -144
  22. package/dist/esm/cratisComponentsPackage.js.map +1 -1
  23. package/dist/esm/cratisComponentsPackageManifest.d.ts +3 -0
  24. package/dist/esm/cratisComponentsPackageManifest.d.ts.map +1 -0
  25. package/dist/esm/cratisComponentsPackageManifest.js +124 -0
  26. package/dist/esm/cratisComponentsPackageManifest.js.map +1 -0
  27. package/dist/esm/cratisComponentsRuntimePackage.d.ts +3 -0
  28. package/dist/esm/cratisComponentsRuntimePackage.d.ts.map +1 -0
  29. package/dist/esm/cratisComponentsRuntimePackage.js +22 -0
  30. package/dist/esm/cratisComponentsRuntimePackage.js.map +1 -0
  31. package/dist/esm/designTime/cratisComponentsDesignTime.d.ts +3 -0
  32. package/dist/esm/designTime/cratisComponentsDesignTime.d.ts.map +1 -0
  33. package/dist/esm/designTime/cratisComponentsDesignTime.js +22 -0
  34. package/dist/esm/designTime/cratisComponentsDesignTime.js.map +1 -0
  35. package/dist/esm/forms/generateCommandFieldsAction.js +10 -1
  36. package/dist/esm/forms/generateCommandFieldsAction.js.map +1 -1
  37. package/dist/esm/index.d.ts +2 -0
  38. package/dist/esm/index.d.ts.map +1 -1
  39. package/dist/esm/index.js +4 -1
  40. package/dist/esm/index.js.map +1 -1
  41. package/dist/esm/runtime.d.ts +5 -0
  42. package/dist/esm/runtime.d.ts.map +1 -0
  43. package/dist/esm/runtime.js +5 -0
  44. package/dist/esm/runtime.js.map +1 -0
  45. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  46. package/forms/generateCommandFieldsAction.ts +5 -1
  47. package/index.ts +2 -0
  48. package/package.json +12 -7
  49. package/runtime.ts +9 -0
@@ -13,16 +13,20 @@ export const generateCommandFieldsAction: DesignTimeAction = {
13
13
  description: 'Creates a deterministic editable field layout from the selected command metadata.',
14
14
  },
15
15
  isVisible: context => context.element.componentName.endsWith(':commandForm'),
16
- isEnabled: context => Array.isArray(context.commandMetadata?.properties) && !Array.isArray(context.element.properties.inputs),
16
+ isEnabled: context => Array.isArray(context.commandMetadata?.properties) && context.element.properties.inputs === undefined,
17
17
  execute: context => generateCommandFields(context),
18
18
  };
19
19
 
20
20
  function generateCommandFields(context: DesignTimeActionContext): DesignTimeActionResult {
21
21
  const properties = context.commandMetadata?.properties ?? [];
22
22
  if (!properties.length) return { edits: [], diagnostics: ['No command metadata was supplied.'] };
23
+ // Authored fields, or a binding that supplies them, are never overwritten.
23
24
  if (Array.isArray(context.element.properties.inputs)) {
24
25
  return { edits: [], diagnostics: ['The form already has authored fields; Generate fields will not overwrite them.'] };
25
26
  }
27
+ if (context.element.properties.inputs !== undefined) {
28
+ return { edits: [], diagnostics: ['The form\'s fields come from a binding; Generate fields will not overwrite it.'] };
29
+ }
26
30
 
27
31
  return {
28
32
  diagnostics: [],
package/index.ts CHANGED
@@ -13,3 +13,5 @@ export * from './toolbar';
13
13
  export * from './cratisComponents';
14
14
  export * from './cratisComponentsDescriptors';
15
15
  export * from './cratisComponentsPackage';
16
+ export * from './cratisComponentsRuntimePackage';
17
+ export * from './designTime/cratisComponentsDesignTime';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/scene.components",
3
- "version": "4.15.0",
3
+ "version": "4.16.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",
@@ -39,6 +39,11 @@
39
39
  "require": "./dist/cjs/index.js",
40
40
  "import": "./dist/esm/index.js"
41
41
  },
42
+ "./runtime": {
43
+ "types": "./dist/esm/runtime.d.ts",
44
+ "require": "./dist/cjs/runtime.js",
45
+ "import": "./dist/esm/runtime.js"
46
+ },
42
47
  "./styles": "./theme/sceneTokenBridge.css"
43
48
  },
44
49
  "scripts": {
@@ -54,17 +59,17 @@
54
59
  "build-storybook": "storybook build"
55
60
  },
56
61
  "dependencies": {
57
- "@cratis/scene.engine": "4.15.0",
58
- "@cratis/scene.model": "4.15.0",
59
- "@cratis/scene.react": "4.15.0"
62
+ "@cratis/scene.engine": "4.16.0",
63
+ "@cratis/scene.model": "4.16.0",
64
+ "@cratis/scene.react": "4.16.0"
60
65
  },
61
66
  "devDependencies": {
62
67
  "@cratis/arc": "22.50.5",
63
68
  "@cratis/arc.react": "22.50.5",
64
69
  "@cratis/components": "4.25.0",
65
- "@cratis/scene.engine": "4.15.0",
66
- "@cratis/scene.model": "4.15.0",
67
- "@cratis/scene.react": "4.15.0",
70
+ "@cratis/scene.engine": "4.16.0",
71
+ "@cratis/scene.model": "4.16.0",
72
+ "@cratis/scene.react": "4.16.0",
68
73
  "@storybook/addon-links": "^10.6.1",
69
74
  "@storybook/react": "^10.6.1",
70
75
  "@storybook/react-vite": "^10.6.1",
package/runtime.ts ADDED
@@ -0,0 +1,9 @@
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
+ // The runtime entry point, published as `@cratis/scene.components/runtime`. Nothing reachable from here is
5
+ // design-time code; the bundle content specification walks the built output to prove it.
6
+ export * from './cratisComponents';
7
+ export * from './cratisComponentsDescriptors';
8
+ export * from './cratisComponentsPackageManifest';
9
+ export * from './cratisComponentsRuntimePackage';