@flowgram.ai/form-materials 0.1.31 → 0.2.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 (37) hide show
  1. package/bin/materials.js +21 -5
  2. package/dist/esm/index.js +453 -50
  3. package/dist/esm/index.js.map +1 -1
  4. package/dist/index.d.mts +161 -29
  5. package/dist/index.d.ts +161 -29
  6. package/dist/index.js +463 -54
  7. package/dist/index.js.map +1 -1
  8. package/package.json +4 -4
  9. package/src/components/batch-variable-selector/config.json +5 -0
  10. package/src/components/batch-variable-selector/index.tsx +18 -0
  11. package/src/components/constant-input/config.json +6 -0
  12. package/src/components/constant-input/index.tsx +81 -0
  13. package/src/components/constant-input/types.ts +18 -0
  14. package/src/components/dynamic-value-input/config.json +5 -0
  15. package/src/components/dynamic-value-input/index.tsx +77 -0
  16. package/src/components/dynamic-value-input/styles.tsx +19 -0
  17. package/src/components/index.ts +6 -3
  18. package/src/components/json-schema-editor/hooks.tsx +33 -22
  19. package/src/components/type-selector/index.tsx +5 -2
  20. package/src/components/type-selector/types.ts +4 -18
  21. package/src/components/variable-selector/config.json +1 -1
  22. package/src/components/variable-selector/index.tsx +76 -16
  23. package/src/components/variable-selector/styles.tsx +43 -0
  24. package/src/components/variable-selector/use-variable-tree.tsx +29 -7
  25. package/src/effects/index.ts +2 -0
  26. package/src/effects/provide-batch-input/config.json +5 -0
  27. package/src/effects/provide-batch-input/index.ts +38 -0
  28. package/src/effects/provide-batch-outputs/config.json +5 -0
  29. package/src/effects/provide-batch-outputs/index.ts +34 -0
  30. package/src/index.ts +3 -0
  31. package/src/typings/flow-value/config.json +5 -0
  32. package/src/typings/flow-value/index.ts +27 -0
  33. package/src/typings/index.ts +1 -0
  34. package/src/utils/format-legacy-refs/config.json +5 -0
  35. package/src/utils/format-legacy-refs/index.ts +153 -0
  36. package/src/utils/format-legacy-refs/readme.md +38 -0
  37. package/src/utils/index.ts +1 -0
@@ -0,0 +1,38 @@
1
+ # Notice
2
+
3
+ In `@flowgram.ai/form-materials@0.2.0`, for introducing loop-related materials,
4
+
5
+ The FlowRefValueSchema type definition is updated:
6
+
7
+ ```typescript
8
+ interface LegacyFlowRefValueSchema {
9
+ type: 'ref';
10
+ content: string;
11
+ }
12
+
13
+ interface NewFlowRefValueSchema {
14
+ type: 'ref';
15
+ content: string[];
16
+ }
17
+ ```
18
+
19
+
20
+
21
+ For making sure backend json will not be changed in your application, we provide `format-legacy-ref` utils for upgrading
22
+
23
+
24
+ How to use:
25
+
26
+ 1. Call formatLegacyRefOnSubmit on the formData before submitting
27
+ 2. Call formatLegacyRefOnInit on the formData after submitting
28
+
29
+ Example:
30
+
31
+ ```typescript
32
+ import { formatLegacyRefOnSubmit, formatLegacyRefOnInit } from '@flowgram.ai/form-materials';
33
+
34
+ formMeta: {
35
+ formatOnSubmit: (data) => formatLegacyRefOnSubmit(data),
36
+ formatOnInit: (data) => formatLegacyRefOnInit(data),
37
+ }
38
+ ```
@@ -0,0 +1 @@
1
+ export * from './format-legacy-refs';