@dxos/react-ui-form 0.8.4-main.7ace549 → 0.8.4-main.937b3ca

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 (167) hide show
  1. package/dist/lib/browser/index.mjs +2191 -2283
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node-esm/index.mjs +2191 -2283
  5. package/dist/lib/node-esm/index.mjs.map +4 -4
  6. package/dist/lib/node-esm/meta.json +1 -1
  7. package/dist/types/src/components/ControlSection/ControlSection.d.ts +2 -2
  8. package/dist/types/src/components/ControlSection/ControlSection.d.ts.map +1 -1
  9. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts +7 -4
  10. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts.map +1 -1
  11. package/dist/types/src/components/FieldEditor/FieldEditor.d.ts +6 -5
  12. package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
  13. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts +9 -3
  14. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
  15. package/dist/types/src/components/Form/Form-old.stories.d.ts +131 -0
  16. package/dist/types/src/components/Form/Form-old.stories.d.ts.map +1 -0
  17. package/dist/types/src/components/Form/Form.d.ts +81 -27
  18. package/dist/types/src/components/Form/Form.d.ts.map +1 -1
  19. package/dist/types/src/components/Form/Form.stories.d.ts +53 -92
  20. package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
  21. package/dist/types/src/components/Form/FormField.d.ts +37 -0
  22. package/dist/types/src/components/Form/FormField.d.ts.map +1 -0
  23. package/dist/types/src/components/Form/FormFieldComponent.d.ts +78 -0
  24. package/dist/types/src/components/Form/FormFieldComponent.d.ts.map +1 -0
  25. package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts +9 -0
  26. package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts.map +1 -0
  27. package/dist/types/src/components/Form/FormFieldSet.d.ts +19 -0
  28. package/dist/types/src/components/Form/FormFieldSet.d.ts.map +1 -0
  29. package/dist/types/src/components/Form/fields/ArrayField.d.ts +18 -0
  30. package/dist/types/src/components/Form/fields/ArrayField.d.ts.map +1 -0
  31. package/dist/types/src/components/Form/fields/BooleanField.d.ts +4 -0
  32. package/dist/types/src/components/Form/fields/BooleanField.d.ts.map +1 -0
  33. package/dist/types/src/components/Form/fields/GeoPointField.d.ts +5 -0
  34. package/dist/types/src/components/Form/fields/GeoPointField.d.ts.map +1 -0
  35. package/dist/types/src/components/Form/fields/MarkdownField.d.ts +4 -0
  36. package/dist/types/src/components/Form/fields/MarkdownField.d.ts.map +1 -0
  37. package/dist/types/src/components/Form/fields/NumberField.d.ts +4 -0
  38. package/dist/types/src/components/Form/fields/NumberField.d.ts.map +1 -0
  39. package/dist/types/src/components/Form/fields/RefField.d.ts +14 -0
  40. package/dist/types/src/components/Form/fields/RefField.d.ts.map +1 -0
  41. package/dist/types/src/components/Form/fields/SelectField.d.ts +10 -0
  42. package/dist/types/src/components/Form/fields/SelectField.d.ts.map +1 -0
  43. package/dist/types/src/components/Form/fields/SelectOptionField.d.ts +5 -0
  44. package/dist/types/src/components/Form/fields/SelectOptionField.d.ts.map +1 -0
  45. package/dist/types/src/components/Form/{custom/SelectOptionsInput.stories.d.ts → fields/SelectOptionField.stories.d.ts} +6 -3
  46. package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts.map +1 -0
  47. package/dist/types/src/components/Form/fields/TextAreaField.d.ts +4 -0
  48. package/dist/types/src/components/Form/fields/TextAreaField.d.ts.map +1 -0
  49. package/dist/types/src/components/Form/fields/TextField.d.ts +4 -0
  50. package/dist/types/src/components/Form/fields/TextField.d.ts.map +1 -0
  51. package/dist/types/src/components/Form/fields/TupleField.d.ts +6 -0
  52. package/dist/types/src/components/Form/fields/TupleField.d.ts.map +1 -0
  53. package/dist/types/src/components/Form/fields/index.d.ts +12 -0
  54. package/dist/types/src/components/Form/fields/index.d.ts.map +1 -0
  55. package/dist/types/src/components/Form/index.d.ts +2 -4
  56. package/dist/types/src/components/Form/index.d.ts.map +1 -1
  57. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts +14 -9
  58. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -1
  59. package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts +5 -2
  60. package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts.map +1 -1
  61. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +6 -8
  62. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
  63. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +5 -2
  64. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
  65. package/dist/types/src/components/testing.d.ts +0 -2
  66. package/dist/types/src/components/testing.d.ts.map +1 -1
  67. package/dist/types/src/hooks/index.d.ts +2 -3
  68. package/dist/types/src/hooks/index.d.ts.map +1 -1
  69. package/dist/types/src/hooks/useFormHandler.d.ts +82 -0
  70. package/dist/types/src/hooks/useFormHandler.d.ts.map +1 -0
  71. package/dist/types/src/hooks/useKeyHandler.d.ts +6 -0
  72. package/dist/types/src/hooks/useKeyHandler.d.ts.map +1 -0
  73. package/dist/types/src/translations.d.ts +6 -3
  74. package/dist/types/src/translations.d.ts.map +1 -1
  75. package/dist/types/src/util/index.d.ts +1 -1
  76. package/dist/types/src/util/index.d.ts.map +1 -1
  77. package/dist/types/src/util/properties.d.ts +7 -0
  78. package/dist/types/src/util/properties.d.ts.map +1 -0
  79. package/dist/types/src/util/refs.d.ts +1 -2
  80. package/dist/types/src/util/refs.d.ts.map +1 -1
  81. package/dist/types/tsconfig.tsbuildinfo +1 -1
  82. package/package.json +49 -44
  83. package/src/components/ControlSection/ControlSection.tsx +8 -8
  84. package/src/components/FieldEditor/FieldEditor.stories.tsx +42 -21
  85. package/src/components/FieldEditor/FieldEditor.tsx +72 -75
  86. package/src/components/Form/Form-old.stories.tsx +314 -0
  87. package/src/components/Form/Form.stories.tsx +146 -246
  88. package/src/components/Form/Form.tsx +319 -110
  89. package/src/components/Form/FormField.tsx +286 -0
  90. package/src/components/Form/FormFieldComponent.stories.tsx +65 -0
  91. package/src/components/Form/FormFieldComponent.tsx +174 -0
  92. package/src/components/Form/FormFieldSet.tsx +125 -0
  93. package/src/components/Form/README.md +3 -0
  94. package/src/components/Form/fields/ArrayField.tsx +151 -0
  95. package/src/components/Form/fields/BooleanField.tsx +22 -0
  96. package/src/components/Form/fields/GeoPointField.tsx +120 -0
  97. package/src/components/Form/fields/MarkdownField.tsx +78 -0
  98. package/src/components/Form/fields/NumberField.tsx +39 -0
  99. package/src/components/Form/fields/RefField.tsx +181 -0
  100. package/src/components/Form/fields/SelectField.tsx +65 -0
  101. package/src/components/Form/{custom/SelectOptionsInput.stories.tsx → fields/SelectOptionField.stories.tsx} +17 -14
  102. package/src/components/Form/{custom/SelectOptionsInput.tsx → fields/SelectOptionField.tsx} +20 -14
  103. package/src/components/Form/fields/TextAreaField.tsx +38 -0
  104. package/src/components/Form/fields/TextField.tsx +38 -0
  105. package/src/components/Form/{custom/TupleInput.tsx → fields/TupleField.tsx} +15 -8
  106. package/src/components/Form/fields/index.ts +15 -0
  107. package/src/components/Form/index.ts +3 -4
  108. package/src/components/ObjectPicker/ObjectPicker.stories.tsx +15 -8
  109. package/src/components/ObjectPicker/ObjectPicker.tsx +76 -62
  110. package/src/components/ViewEditor/ViewEditor.stories.tsx +29 -25
  111. package/src/components/ViewEditor/ViewEditor.test.tsx +6 -2
  112. package/src/components/ViewEditor/ViewEditor.tsx +220 -154
  113. package/src/components/testing.tsx +9 -7
  114. package/src/hooks/index.ts +2 -3
  115. package/src/hooks/useFormHandler.ts +356 -0
  116. package/src/hooks/useKeyHandler.tsx +37 -0
  117. package/src/translations.ts +8 -6
  118. package/src/util/index.ts +1 -1
  119. package/src/util/properties.ts +18 -0
  120. package/src/util/refs.ts +7 -13
  121. package/dist/types/src/components/Form/ArrayField.d.ts +0 -16
  122. package/dist/types/src/components/Form/ArrayField.d.ts.map +0 -1
  123. package/dist/types/src/components/Form/Defaults.d.ts +0 -14
  124. package/dist/types/src/components/Form/Defaults.d.ts.map +0 -1
  125. package/dist/types/src/components/Form/FormActions.d.ts +0 -9
  126. package/dist/types/src/components/Form/FormActions.d.ts.map +0 -1
  127. package/dist/types/src/components/Form/FormContent.d.ts +0 -63
  128. package/dist/types/src/components/Form/FormContent.d.ts.map +0 -1
  129. package/dist/types/src/components/Form/FormContext.d.ts +0 -23
  130. package/dist/types/src/components/Form/FormContext.d.ts.map +0 -1
  131. package/dist/types/src/components/Form/Input.d.ts +0 -29
  132. package/dist/types/src/components/Form/Input.d.ts.map +0 -1
  133. package/dist/types/src/components/Form/RefField.d.ts +0 -22
  134. package/dist/types/src/components/Form/RefField.d.ts.map +0 -1
  135. package/dist/types/src/components/Form/custom/GeoPointInput.d.ts +0 -4
  136. package/dist/types/src/components/Form/custom/GeoPointInput.d.ts.map +0 -1
  137. package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts +0 -4
  138. package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts.map +0 -1
  139. package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts.map +0 -1
  140. package/dist/types/src/components/Form/custom/TupleInput.d.ts +0 -6
  141. package/dist/types/src/components/Form/custom/TupleInput.d.ts.map +0 -1
  142. package/dist/types/src/components/Form/custom/index.d.ts +0 -4
  143. package/dist/types/src/components/Form/custom/index.d.ts.map +0 -1
  144. package/dist/types/src/components/Form/factory.d.ts +0 -8
  145. package/dist/types/src/components/Form/factory.d.ts.map +0 -1
  146. package/dist/types/src/hooks/useForm.d.ts +0 -67
  147. package/dist/types/src/hooks/useForm.d.ts.map +0 -1
  148. package/dist/types/src/hooks/useQueryRefOptions.d.ts +0 -29
  149. package/dist/types/src/hooks/useQueryRefOptions.d.ts.map +0 -1
  150. package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts +0 -8
  151. package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts.map +0 -1
  152. package/dist/types/src/util/schema.d.ts +0 -3
  153. package/dist/types/src/util/schema.d.ts.map +0 -1
  154. package/src/components/Form/ArrayField.tsx +0 -127
  155. package/src/components/Form/Defaults.tsx +0 -205
  156. package/src/components/Form/FormActions.tsx +0 -59
  157. package/src/components/Form/FormContent.tsx +0 -362
  158. package/src/components/Form/FormContext.tsx +0 -110
  159. package/src/components/Form/Input.tsx +0 -54
  160. package/src/components/Form/RefField.tsx +0 -283
  161. package/src/components/Form/custom/GeoPointInput.tsx +0 -80
  162. package/src/components/Form/custom/index.ts +0 -7
  163. package/src/components/Form/factory.tsx +0 -34
  164. package/src/hooks/useForm.ts +0 -296
  165. package/src/hooks/useQueryRefOptions.ts +0 -62
  166. package/src/hooks/useRefQueryLookupHandler.ts +0 -39
  167. package/src/util/schema.ts +0 -12
@@ -9,7 +9,7 @@ declare const meta: {
9
9
  layout: string;
10
10
  translations: [{
11
11
  readonly 'en-US': {
12
- readonly "react-ui-form": {
12
+ readonly "@dxos/react-ui-form": {
13
13
  readonly 'fields label': "Fields";
14
14
  readonly 'hidden fields label': "Hidden Fields";
15
15
  readonly 'empty readonly ref field label': "(none)";
@@ -29,6 +29,9 @@ declare const meta: {
29
29
  readonly 'ref field combobox input placeholder': "Search…";
30
30
  readonly 'ref field placeholder_one': "Select…";
31
31
  readonly 'ref field placeholder_other': "Select items…";
32
+ readonly 'example placeholder': "Example";
33
+ readonly 'latitude placeholder': "Latitude (e.g., 40.7128)";
34
+ readonly 'longitude placeholder': "Longitude (e.g., -74.0060)";
32
35
  readonly 'cancel button label': "Cancel";
33
36
  readonly 'save button label': "Save";
34
37
  readonly 'format boolean': "Boolean";
@@ -67,7 +70,7 @@ declare const meta: {
67
70
  readonly 'select option delete': "Delete";
68
71
  readonly 'select option add': "Add option";
69
72
  readonly 'system schema title': "System type";
70
- readonly 'system schema description': "This is a system type and cannot be modified, though the view can still be configured.";
73
+ readonly 'system schema description': "System type: cannot add or remove fields.";
71
74
  };
72
75
  };
73
76
  }];
@@ -76,4 +79,4 @@ declare const meta: {
76
79
  export default meta;
77
80
  type Story = StoryObj<typeof meta>;
78
81
  export declare const Default: Story;
79
- //# sourceMappingURL=SelectOptionsInput.stories.d.ts.map
82
+ //# sourceMappingURL=SelectOptionField.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectOptionField.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectOptionField.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AA0CxC,QAAA,MAAM,IAAI;;eAEwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOA,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { type FormFieldComponentProps } from '../FormFieldComponent';
3
+ export declare const TextAreaField: ({ type, readonly, placeholder, onValueChange, onBlur, ...props }: FormFieldComponentProps<string>) => React.JSX.Element;
4
+ //# sourceMappingURL=TextAreaField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextAreaField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/TextAreaField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,aAAa,GAAI,kEAO3B,uBAAuB,CAAC,MAAM,CAAC,sBAoBjC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { type FormFieldComponentProps } from '../FormFieldComponent';
3
+ export declare const TextField: ({ type, readonly, placeholder, onValueChange, onBlur, ...props }: FormFieldComponentProps<string>) => React.JSX.Element;
4
+ //# sourceMappingURL=TextField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/TextField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,SAAS,GAAI,kEAOvB,uBAAuB,CAAC,MAAM,CAAC,sBAoBjC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { type FormFieldComponentProps } from '../FormFieldComponent';
3
+ export declare const TupleField: ({ binding, type, readonly, label, getStatus, getValue, onValueChange, onBlur, }: FormFieldComponentProps<Record<string, number>> & {
4
+ binding: string[];
5
+ }) => React.JSX.Element;
6
+ //# sourceMappingURL=TupleField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TupleField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/TupleField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAIrF,eAAO,MAAM,UAAU,GAAI,iFASxB,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG;IACnD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,sBA4BA,CAAC"}
@@ -0,0 +1,12 @@
1
+ export * from './ArrayField';
2
+ export * from './BooleanField';
3
+ export * from './GeoPointField';
4
+ export * from './MarkdownField';
5
+ export * from './NumberField';
6
+ export * from './RefField';
7
+ export * from './SelectField';
8
+ export * from './SelectOptionField';
9
+ export * from './TextField';
10
+ export * from './TextAreaField';
11
+ export * from './TupleField';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
@@ -1,6 +1,4 @@
1
- export * from './custom';
2
- export * from './Defaults';
1
+ export * from './fields';
3
2
  export * from './Form';
4
- export * from './FormContext';
5
- export * from './Input';
3
+ export * from './FormFieldComponent';
6
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AAEzB,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC"}
@@ -1,21 +1,26 @@
1
1
  import type * as Schema from 'effect/Schema';
2
2
  import React from 'react';
3
- import { type ThemedClassName } from '@dxos/react-ui';
4
- import { type QueryTag } from '../../hooks';
3
+ import { type Palette, type ThemedClassName } from '@dxos/react-ui';
4
+ export type RefOption = {
5
+ id: string;
6
+ label: string;
7
+ hue?: Palette;
8
+ };
5
9
  export type ObjectPickerContentProps = ThemedClassName<{
6
- options: QueryTag[];
10
+ options: RefOption[];
7
11
  selectedIds?: string[];
8
- createSchema?: Schema.Schema.AnyNoContext;
9
12
  createOptionLabel?: [string, {
10
13
  ns: string;
11
14
  }];
12
15
  createOptionIcon?: string;
16
+ createSchema?: Schema.Schema.AnyNoContext;
13
17
  createInitialValuePath?: string;
14
- onSelect: (id: string) => void;
15
18
  onCreate?: (values: any) => void;
19
+ onSelect: (id: string) => void;
16
20
  }>;
17
21
  export declare const ObjectPicker: {
18
22
  Root: ({ modal, modalId: propsModalId, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, value: propsValue, defaultValue, onValueChange: propsOnValueChange, placeholder, children, }: import("@dxos/react-ui-searchlist").ComboboxRootProps) => React.JSX.Element;
23
+ Portal: React.FC<import("@dxos/react-ui").PopoverPortalProps>;
19
24
  Trigger: React.ForwardRefExoticComponent<Omit<import("@dxos/react-ui").ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
20
25
  VirtualTrigger: {
21
26
  (props: import("@dxos/react-ui").PopoverVirtualTriggerProps & {
@@ -24,18 +29,18 @@ export declare const ObjectPicker: {
24
29
  displayName: string;
25
30
  };
26
31
  Content: React.ForwardRefExoticComponent<Omit<{
27
- options: QueryTag[];
32
+ options: RefOption[];
28
33
  selectedIds?: string[];
29
- createSchema?: Schema.Schema.AnyNoContext;
30
34
  createOptionLabel?: [string, {
31
35
  ns: string;
32
36
  }];
33
37
  createOptionIcon?: string;
38
+ createSchema?: Schema.Schema.AnyNoContext;
34
39
  createInitialValuePath?: string;
35
- onSelect: (id: string) => void;
36
40
  onCreate?: (values: any) => void;
41
+ onSelect: (id: string) => void;
37
42
  }, "className"> & {
38
- classNames?: import("@dxos/react-ui-types").ClassNameValue;
43
+ classNames?: import("@dxos/ui-types").ClassNameValue;
39
44
  } & React.RefAttributes<HTMLDivElement>>;
40
45
  };
41
46
  //# sourceMappingURL=ObjectPicker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectPicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectPicker/ObjectPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAA0F,MAAM,OAAO,CAAC;AAE/G,OAAO,EAAiB,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAGrF,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI5C,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC;IACrD,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IAC1C,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;CAClC,CAAC,CAAC;AAoIH,eAAO,MAAM,YAAY;;;;;0BA/F+E,CAAC;;;;;iBA7C9F,QAAQ,EAAE;sBACL,MAAM,EAAE;uBACP,MAAM,CAAC,MAAM,CAAC,YAAY;4BACrB,CAAC,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC;2BACzB,MAAM;iCACA,MAAM;kBACrB,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI;mBACnB,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI;;;;CA0IjC,CAAC"}
1
+ {"version":3,"file":"ObjectPicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectPicker/ObjectPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAgE,MAAM,OAAO,CAAC;AAErF,OAAO,EAAE,KAAK,OAAO,EAAW,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAM7F,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC;IACrD,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IAC1C,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,CAAC,CAAC;AA4IH,eAAO,MAAM,YAAY;;;;;;0BAxEf,CAAJ;;;;;iBA5EK,SAAS,EAAE;sBACN,MAAM,EAAE;4BACF,CAAC,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC;2BACzB,MAAM;uBACV,MAAM,CAAC,MAAM,CAAC,YAAY;iCAChB,MAAM;mBACpB,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI;kBACtB,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI;;;;CAmJ/B,CAAC"}
@@ -11,7 +11,7 @@ declare const meta: {
11
11
  };
12
12
  translations: [{
13
13
  readonly 'en-US': {
14
- readonly "react-ui-form": {
14
+ readonly "@dxos/react-ui-form": {
15
15
  readonly 'fields label': "Fields";
16
16
  readonly 'hidden fields label': "Hidden Fields";
17
17
  readonly 'empty readonly ref field label': "(none)";
@@ -31,6 +31,9 @@ declare const meta: {
31
31
  readonly 'ref field combobox input placeholder': "Search…";
32
32
  readonly 'ref field placeholder_one': "Select…";
33
33
  readonly 'ref field placeholder_other': "Select items…";
34
+ readonly 'example placeholder': "Example";
35
+ readonly 'latitude placeholder': "Latitude (e.g., 40.7128)";
36
+ readonly 'longitude placeholder': "Longitude (e.g., -74.0060)";
34
37
  readonly 'cancel button label': "Cancel";
35
38
  readonly 'save button label': "Save";
36
39
  readonly 'format boolean': "Boolean";
@@ -69,7 +72,7 @@ declare const meta: {
69
72
  readonly 'select option delete': "Delete";
70
73
  readonly 'select option add': "Add option";
71
74
  readonly 'system schema title': "System type";
72
- readonly 'system schema description': "This is a system type and cannot be modified, though the view can still be configured.";
75
+ readonly 'system schema description': "System type: cannot add or remove fields.";
73
76
  };
74
77
  };
75
78
  }];
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectPicker.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectPicker/ObjectPicker.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAoD,MAAM,OAAO,CAAC;AA2FzE,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgB2B,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAqFtB,CAAC"}
1
+ {"version":3,"file":"ObjectPicker.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectPicker/ObjectPicker.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAoD,MAAM,OAAO,CAAC;AA4FzE,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgB2B,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KA2FtB,CAAC"}
@@ -1,21 +1,19 @@
1
1
  import * as Schema from 'effect/Schema';
2
2
  import React from 'react';
3
- import { QueryAST } from '@dxos/echo';
4
- import { type SchemaRegistry } from '@dxos/echo-db';
3
+ import { QueryAST, type SchemaRegistry } from '@dxos/echo';
5
4
  import { type ThemedClassName } from '@dxos/react-ui';
6
5
  import { type QueryFormProps } from '@dxos/react-ui-components';
7
6
  import { ProjectionModel, type View } from '@dxos/schema';
8
- import { type FormProps } from '../Form';
9
7
  export type ViewEditorProps = ThemedClassName<{
10
8
  schema: Schema.Schema.AnyNoContext;
11
9
  view: View.View;
12
10
  mode?: 'schema' | 'tag';
13
- registry?: SchemaRegistry;
11
+ registry?: SchemaRegistry.SchemaRegistry;
14
12
  readonly?: boolean;
15
13
  showHeading?: boolean;
16
14
  onQueryChanged?: (query: QueryAST.Query, target?: string) => void;
17
15
  onDelete?: (fieldId: string) => void;
18
- } & Pick<FormProps<any>, 'outerSpacing'> & Pick<QueryFormProps, 'types' | 'tags'>>;
16
+ } & Pick<QueryFormProps, 'types' | 'tags'>>;
19
17
  /**
20
18
  * Schema-based object form.
21
19
  */
@@ -23,12 +21,12 @@ export declare const ViewEditor: React.ForwardRefExoticComponent<Omit<{
23
21
  schema: Schema.Schema.AnyNoContext;
24
22
  view: View.View;
25
23
  mode?: "schema" | "tag";
26
- registry?: SchemaRegistry;
24
+ registry?: SchemaRegistry.SchemaRegistry;
27
25
  readonly?: boolean;
28
26
  showHeading?: boolean;
29
27
  onQueryChanged?: (query: QueryAST.Query, target?: string) => void;
30
28
  onDelete?: (fieldId: string) => void;
31
- } & Pick<FormProps<any>, "outerSpacing"> & Pick<QueryFormProps, "types" | "tags">, "className"> & {
32
- classNames?: import("@dxos/react-ui-types").ClassNameValue;
29
+ } & Pick<QueryFormProps, "types" | "tags">, "className"> & {
30
+ classNames?: import("@dxos/ui-types").ClassNameValue;
33
31
  } & React.RefAttributes<ProjectionModel>>;
34
32
  //# sourceMappingURL=ViewEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ViewEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAA0E,MAAM,OAAO,CAAC;AAE/F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAEnE,OAAO,EAA8B,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI3E,OAAO,EAGL,eAAe,EAEf,KAAK,IAAI,EAEV,MAAM,cAAc,CAAC;AAItB,OAAO,EAAQ,KAAK,SAAS,EAAqD,MAAM,SAAS,CAAC;AAKlG,MAAM,MAAM,eAAe,GAAG,eAAe,CAC3C;IACE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACnC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IACxB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB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B,QAAQ,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAClE,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,MAAM,CAAC,CAC3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU;YAdX,MAAM,CAAC,MAAM,CAAC,YAAY;UAC5B,IAAI,CAAC,IAAI;WACR,QAAQ,GAAG,KAAK;eACZ,cAAc,CAAC,cAAc;eAC7B,OAAO;kBACJ,OAAO;qBACJ,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI;eACtD,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI;;;yCAkKvC,CAAC"}
@@ -17,7 +17,7 @@ declare const meta: {
17
17
  layout: string;
18
18
  translations: [{
19
19
  readonly 'en-US': {
20
- readonly "react-ui-form": {
20
+ readonly "@dxos/react-ui-form": {
21
21
  readonly 'fields label': "Fields";
22
22
  readonly 'hidden fields label': "Hidden Fields";
23
23
  readonly 'empty readonly ref field label': "(none)";
@@ -37,6 +37,9 @@ declare const meta: {
37
37
  readonly 'ref field combobox input placeholder': "Search…";
38
38
  readonly 'ref field placeholder_one': "Select…";
39
39
  readonly 'ref field placeholder_other': "Select items…";
40
+ readonly 'example placeholder': "Example";
41
+ readonly 'latitude placeholder': "Latitude (e.g., 40.7128)";
42
+ readonly 'longitude placeholder': "Longitude (e.g., -74.0060)";
40
43
  readonly 'cancel button label': "Cancel";
41
44
  readonly 'save button label': "Save";
42
45
  readonly 'format boolean': "Boolean";
@@ -75,7 +78,7 @@ declare const meta: {
75
78
  readonly 'select option delete': "Delete";
76
79
  readonly 'select option add': "Add option";
77
80
  readonly 'system schema title': "System type";
78
- readonly 'system schema description': "This is a system type and cannot be modified, though the view can still be configured.";
81
+ readonly 'system schema description': "System type: cannot add or remove fields.";
79
82
  };
80
83
  };
81
84
  }];
@@ -1 +1 @@
1
- {"version":3,"file":"ViewEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAA4D,MAAM,OAAO,CAAC;AAGjF,OAAO,EAAE,KAAK,UAAU,EAAU,MAAM,qBAAqB,CAAC;AAK9D,OAAO,EAAE,KAAK,eAAe,EAAE,IAAI,EAAwB,MAAM,cAAc,CAAC;AAMhF,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAWhE,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;IAChB,UAAU,EAAE,eAAe,CAAC;CAC7B,CAAC;AAEF,KAAK,UAAU,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,MAAM,CAAC,CAAC;AA2H7D,QAAA,MAAM,IAAI;;oBAzHmB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4IF,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAItB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAI1B,CAAC"}
1
+ {"version":3,"file":"ViewEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAA4D,MAAM,OAAO,CAAC;AAGjF,OAAO,EAAE,KAAK,UAAU,EAAwB,MAAM,qBAAqB,CAAC;AAK5E,OAAO,EAAE,KAAK,eAAe,EAAE,IAAI,EAAwB,MAAM,cAAc,CAAC;AAMhF,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAWhE,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;IAChB,UAAU,EAAE,eAAe,CAAC;CAC7B,CAAC;AAEF,KAAK,UAAU,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,MAAM,CAAC,CAAC;AA+H7D,QAAA,MAAM,IAAI;;oBA7HmB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgJF,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAItB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAI1B,CAAC"}
@@ -4,8 +4,6 @@ type TestLayoutProps = ThemedClassName<PropsWithChildren<{
4
4
  json?: any;
5
5
  }>>;
6
6
  export declare const TestLayout: ({ classNames, children, json }: TestLayoutProps) => React.JSX.Element;
7
- type TestPanelProps = ThemedClassName<PropsWithChildren>;
8
- export declare const TestPanel: ({ classNames, children }: TestPanelProps) => React.JSX.Element;
9
7
  export declare const VIEW_EDITOR_DEBUG_SYMBOL: unique symbol;
10
8
  export declare const FIELD_EDITOR_DEBUG_SYMBOL: unique symbol;
11
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/components/testing.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKtD,KAAK,eAAe,GAAG,eAAe,CAAC,iBAAiB,CAAC;IAAE,IAAI,CAAC,EAAE,GAAG,CAAA;CAAE,CAAC,CAAC,CAAC;AAE1E,eAAO,MAAM,UAAU,GAAI,gCAAgC,eAAe,sBAOzE,CAAC;AAEF,KAAK,cAAc,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAEzD,eAAO,MAAM,SAAS,GAAI,0BAA0B,cAAc,sBAEjE,CAAC;AAGF,eAAO,MAAM,wBAAwB,eAA4B,CAAC;AAClE,eAAO,MAAM,yBAAyB,eAA6B,CAAC"}
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/components/testing.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKtD,KAAK,eAAe,GAAG,eAAe,CAAC,iBAAiB,CAAC;IAAE,IAAI,CAAC,EAAE,GAAG,CAAA;CAAE,CAAC,CAAC,CAAC;AAE1E,eAAO,MAAM,UAAU,GAAI,gCAAgC,eAAe,sBASzE,CAAC;AASF,eAAO,MAAM,wBAAwB,eAA4B,CAAC;AAClE,eAAO,MAAM,yBAAyB,eAA6B,CAAC"}
@@ -1,4 +1,3 @@
1
- export * from './useForm';
2
- export * from './useRefQueryLookupHandler';
3
- export * from './useQueryRefOptions';
1
+ export * from './useFormHandler';
2
+ export * from './useKeyHandler';
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,82 @@
1
+ import type * as Schema from 'effect/Schema';
2
+ import type * as SchemaAST from 'effect/SchemaAST';
3
+ import { type AnyProperties } from '@dxos/echo/internal';
4
+ import { type JsonPath } from '@dxos/effect';
5
+ import { type ValidationError } from '@dxos/schema';
6
+ import { type MaybePromise } from '@dxos/util';
7
+ export type FormFieldStatus = {
8
+ status?: 'error';
9
+ error?: string;
10
+ };
11
+ /**
12
+ * Form properties.
13
+ */
14
+ export interface FormHandlerProps<T extends AnyProperties> {
15
+ /**
16
+ * Effect schema (Type literal).
17
+ */
18
+ schema?: Schema.Schema<T, any>;
19
+ /**
20
+ * Values for the form if controlled.
21
+ */
22
+ values?: Partial<T>;
23
+ /**
24
+ * Default values for the form which will be used if values is not provided.
25
+ */
26
+ defaultValues?: Partial<T>;
27
+ /**
28
+ * Auto-save the form when the values change.
29
+ */
30
+ autoSave?: boolean;
31
+ /**
32
+ * Callback for value changes. Note: This is called even when values are invalid.
33
+ * Sometimes the parent component may want to know about changes even if the form is
34
+ * in an invalid state.
35
+ */
36
+ onValuesChanged?: (values: Partial<T>, meta: FormUpdateMeta<T>) => void;
37
+ /**
38
+ * Custom validation function that runs only after schema validation passes.
39
+ * Use this for complex validation logic that can't be expressed in the schema.
40
+ * @returns Array of validation errors, or undefined if validation passes
41
+ */
42
+ onValidate?: (values: T) => ValidationError[] | undefined;
43
+ /**
44
+ * Called when the form is submitted and passes validation.
45
+ */
46
+ onSave?: (values: T, meta: FormUpdateMeta<T>) => MaybePromise<void>;
47
+ /**
48
+ * Called when the form is canceled.
49
+ */
50
+ onCancel?: () => void;
51
+ }
52
+ export type FormUpdateMeta<T extends AnyProperties> = {
53
+ changed: FormHandler<T>['changed'];
54
+ isValid: boolean;
55
+ };
56
+ /**
57
+ * Form handler properties and methods.
58
+ */
59
+ export type FormHandler<T extends AnyProperties> = Pick<FormHandlerProps<T>, 'schema' | 'autoSave'> & {
60
+ /** Initial values (which may not pass validation). */
61
+ values: Partial<T>;
62
+ /** Map of changed fields. */
63
+ changed: Record<JsonPath, boolean>;
64
+ touched: Record<JsonPath, boolean>;
65
+ /** Map of error strings. */
66
+ errors: Record<JsonPath, string>;
67
+ /** Whether the form can be saved (i.e., data is valid). */
68
+ isValid: boolean;
69
+ canSave: boolean;
70
+ onSave: () => void;
71
+ onCancel: () => void;
72
+ getStatus: (path: string | (string | number)[]) => FormFieldStatus;
73
+ getValue: <V>(path: (string | number)[]) => V | undefined;
74
+ onBlur: (path: (string | number)[]) => void;
75
+ onValueChange: <V>(path: (string | number)[], type: SchemaAST.AST, value: V) => void;
76
+ };
77
+ /**
78
+ * Creates a hook for managing form state, including values, validation, and submission.
79
+ * Deeply integrated with `@dxos/schema` for schema-based validation.
80
+ */
81
+ export declare const useFormHandler: <T extends AnyProperties>({ schema, autoSave, values: valuesProp, defaultValues: defaultValuesProp, onValuesChanged, onValidate, onSave, onCancel, ...props }: FormHandlerProps<T>) => FormHandler<T>;
82
+ //# sourceMappingURL=useFormHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormHandler.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useFormHandler.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EACL,KAAK,QAAQ,EAKd,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,KAAK,eAAe,EAAkB,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=> void;
6
+ //# sourceMappingURL=useKeyHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useKeyHandler.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useKeyHandler.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,aAAa,cAAc,GAAG,IAAI,EAAE,MAAM,WAAW,CAAC,GAAG,CAAC,SAuBvF,CAAC"}
@@ -1,7 +1,7 @@
1
- export declare const translationKey = "react-ui-form";
1
+ export declare const translationKey = "@dxos/react-ui-form";
2
2
  export declare const translations: [{
3
3
  readonly 'en-US': {
4
- readonly "react-ui-form": {
4
+ readonly "@dxos/react-ui-form": {
5
5
  readonly 'fields label': "Fields";
6
6
  readonly 'hidden fields label': "Hidden Fields";
7
7
  readonly 'empty readonly ref field label': "(none)";
@@ -21,6 +21,9 @@ export declare const translations: [{
21
21
  readonly 'ref field combobox input placeholder': "Search…";
22
22
  readonly 'ref field placeholder_one': "Select…";
23
23
  readonly 'ref field placeholder_other': "Select items…";
24
+ readonly 'example placeholder': "Example";
25
+ readonly 'latitude placeholder': "Latitude (e.g., 40.7128)";
26
+ readonly 'longitude placeholder': "Longitude (e.g., -74.0060)";
24
27
  readonly 'cancel button label': "Cancel";
25
28
  readonly 'save button label': "Save";
26
29
  readonly 'format boolean': "Boolean";
@@ -59,7 +62,7 @@ export declare const translations: [{
59
62
  readonly 'select option delete': "Delete";
60
63
  readonly 'select option add': "Add option";
61
64
  readonly 'system schema title': "System type";
62
- readonly 'system schema description': "This is a system type and cannot be modified, though the view can still be configured.";
65
+ readonly 'system schema description': "System type: cannot add or remove fields.";
63
66
  };
64
67
  };
65
68
  }];
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAE9C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8EM,CAAC"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,wBAAwB,CAAC;AAEpD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgFM,CAAC"}
@@ -1,5 +1,5 @@
1
1
  export * from './field';
2
2
  export * from './formatting';
3
+ export * from './properties';
3
4
  export * from './refs';
4
- export * from './schema';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type * as SchemaAST from 'effect/SchemaAST';
2
+ import { type SchemaProperty } from '@dxos/effect';
3
+ /**
4
+ * Get the property types of an AST and filter out properties that are not form inputs.
5
+ */
6
+ export declare const getFormProperties: (ast: SchemaAST.AST) => SchemaProperty[];
7
+ //# sourceMappingURL=properties.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../../../src/util/properties.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAAE,KAAK,cAAc,EAAiB,MAAM,cAAc,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,SAAS,CAAC,GAAG,KAAG,cAAc,EAIpE,CAAC"}
@@ -1,9 +1,8 @@
1
1
  import type * as SchemaAST from 'effect/SchemaAST';
2
- import { type SchemaProperty } from '@dxos/schema';
3
2
  type RefProps = {
4
3
  ast: SchemaAST.AST;
5
4
  isArray: boolean;
6
5
  };
7
- export declare const getRefProps: (property: SchemaProperty<any>) => RefProps | undefined;
6
+ export declare const getRefProps: (ast: SchemaAST.AST) => RefProps | undefined;
8
7
  export {};
9
8
  //# sourceMappingURL=refs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../../../src/util/refs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAInD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAInD,KAAK,QAAQ,GAAG;IACd,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,UAAU,cAAc,CAAC,GAAG,CAAC,KAAG,QAAQ,GAAG,SAoBtE,CAAC"}
1
+ {"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../../../src/util/refs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAKnD,KAAK,QAAQ,GAAG;IACd,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,KAAK,SAAS,CAAC,GAAG,KAAG,QAAQ,GAAG,SAiB3D,CAAC"}