@dxos/react-ui-form 0.8.4-main.e8ec1fe → 0.8.4-main.effb148878

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 (268) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +0 -1
  3. package/dist/lib/browser/index.mjs +3240 -2345
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/translations.mjs +83 -0
  7. package/dist/lib/browser/translations.mjs.map +7 -0
  8. package/dist/lib/node-esm/index.mjs +3240 -2345
  9. package/dist/lib/node-esm/index.mjs.map +4 -4
  10. package/dist/lib/node-esm/meta.json +1 -1
  11. package/dist/lib/node-esm/translations.mjs +85 -0
  12. package/dist/lib/node-esm/translations.mjs.map +7 -0
  13. package/dist/types/src/components/FieldEditor/FieldEditor.d.ts +8 -7
  14. package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
  15. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts +69 -59
  16. package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
  17. package/dist/types/src/components/Form/Form.d.ts +123 -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 +175 -137
  20. package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
  21. package/dist/types/src/components/Form/FormField.d.ts +48 -0
  22. package/dist/types/src/components/Form/FormField.d.ts.map +1 -0
  23. package/dist/types/src/components/Form/FormFieldComponent.d.ts +95 -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 +21 -0
  28. package/dist/types/src/components/Form/FormFieldSet.d.ts.map +1 -0
  29. package/dist/types/src/components/Form/FormTooltipsContext.d.ts +19 -0
  30. package/dist/types/src/components/Form/FormTooltipsContext.d.ts.map +1 -0
  31. package/dist/types/src/components/Form/Layout/FormLayout.d.ts +25 -0
  32. package/dist/types/src/components/Form/Layout/FormLayout.d.ts.map +1 -0
  33. package/dist/types/src/components/Form/Layout/FormLayout.stories.d.ts +116 -0
  34. package/dist/types/src/components/Form/Layout/FormLayout.stories.d.ts.map +1 -0
  35. package/dist/types/src/components/Form/Layout/annotation.d.ts +30 -0
  36. package/dist/types/src/components/Form/Layout/annotation.d.ts.map +1 -0
  37. package/dist/types/src/components/Form/Layout/index.d.ts +4 -0
  38. package/dist/types/src/components/Form/Layout/index.d.ts.map +1 -0
  39. package/dist/types/src/components/Form/Layout/parser.d.ts +31 -0
  40. package/dist/types/src/components/Form/Layout/parser.d.ts.map +1 -0
  41. package/dist/types/src/components/Form/Layout/parser.test.d.ts +2 -0
  42. package/dist/types/src/components/Form/Layout/parser.test.d.ts.map +1 -0
  43. package/dist/types/src/components/Form/fields/ArrayField.d.ts +18 -0
  44. package/dist/types/src/components/Form/fields/ArrayField.d.ts.map +1 -0
  45. package/dist/types/src/components/Form/fields/BooleanField.d.ts +4 -0
  46. package/dist/types/src/components/Form/fields/BooleanField.d.ts.map +1 -0
  47. package/dist/types/src/components/Form/fields/DateField.d.ts +4 -0
  48. package/dist/types/src/components/Form/fields/DateField.d.ts.map +1 -0
  49. package/dist/types/src/components/Form/fields/GeoPointField.d.ts +5 -0
  50. package/dist/types/src/components/Form/fields/GeoPointField.d.ts.map +1 -0
  51. package/dist/types/src/components/Form/fields/MarkdownField.d.ts +11 -0
  52. package/dist/types/src/components/Form/fields/MarkdownField.d.ts.map +1 -0
  53. package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts +85 -0
  54. package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts.map +1 -0
  55. package/dist/types/src/components/Form/fields/NumberField.d.ts +4 -0
  56. package/dist/types/src/components/Form/fields/NumberField.d.ts.map +1 -0
  57. package/dist/types/src/components/Form/fields/RefField.d.ts +22 -0
  58. package/dist/types/src/components/Form/fields/RefField.d.ts.map +1 -0
  59. package/dist/types/src/components/Form/fields/SelectField.d.ts +13 -0
  60. package/dist/types/src/components/Form/fields/SelectField.d.ts.map +1 -0
  61. package/dist/types/src/components/Form/fields/SelectOptionField.d.ts +5 -0
  62. package/dist/types/src/components/Form/fields/SelectOptionField.d.ts.map +1 -0
  63. package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts +85 -0
  64. package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts.map +1 -0
  65. package/dist/types/src/components/Form/fields/TextAreaField.d.ts +4 -0
  66. package/dist/types/src/components/Form/fields/TextAreaField.d.ts.map +1 -0
  67. package/dist/types/src/components/Form/fields/TextField.d.ts +4 -0
  68. package/dist/types/src/components/Form/fields/TextField.d.ts.map +1 -0
  69. package/dist/types/src/components/Form/fields/TupleField.d.ts +6 -0
  70. package/dist/types/src/components/Form/fields/TupleField.d.ts.map +1 -0
  71. package/dist/types/src/components/Form/fields/index.d.ts +13 -0
  72. package/dist/types/src/components/Form/fields/index.d.ts.map +1 -0
  73. package/dist/types/src/components/Form/index.d.ts +4 -4
  74. package/dist/types/src/components/Form/index.d.ts.map +1 -1
  75. package/dist/types/src/components/ObjectForm/ObjectForm.d.ts +8 -0
  76. package/dist/types/src/components/ObjectForm/ObjectForm.d.ts.map +1 -0
  77. package/dist/types/src/components/ObjectForm/index.d.ts +2 -0
  78. package/dist/types/src/components/ObjectForm/index.d.ts.map +1 -0
  79. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts +37 -10
  80. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -1
  81. package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts +65 -58
  82. package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts.map +1 -1
  83. package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts +9 -0
  84. package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts.map +1 -0
  85. package/dist/types/src/components/ObjectProperties/ObjectProperties.stories.d.ts +128 -0
  86. package/dist/types/src/components/ObjectProperties/ObjectProperties.stories.d.ts.map +1 -0
  87. package/dist/types/src/components/ObjectProperties/ObjectProperties.test.d.ts +2 -0
  88. package/dist/types/src/components/ObjectProperties/ObjectProperties.test.d.ts.map +1 -0
  89. package/dist/types/src/components/ObjectProperties/index.d.ts +2 -0
  90. package/dist/types/src/components/ObjectProperties/index.d.ts.map +1 -0
  91. package/dist/types/src/components/ObjectTree/ObjectTree.d.ts +9 -0
  92. package/dist/types/src/components/ObjectTree/ObjectTree.d.ts.map +1 -0
  93. package/dist/types/src/components/ObjectTree/ObjectTree.stories.d.ts +87 -0
  94. package/dist/types/src/components/ObjectTree/ObjectTree.stories.d.ts.map +1 -0
  95. package/dist/types/src/components/ObjectTree/index.d.ts +2 -0
  96. package/dist/types/src/components/ObjectTree/index.d.ts.map +1 -0
  97. package/dist/types/src/components/Settings/Settings.d.ts +51 -0
  98. package/dist/types/src/components/Settings/Settings.d.ts.map +1 -0
  99. package/dist/types/src/components/Settings/Settings.stories.d.ts +85 -0
  100. package/dist/types/src/components/Settings/Settings.stories.d.ts.map +1 -0
  101. package/dist/types/src/components/Settings/SettingsFieldSet.d.ts +43 -0
  102. package/dist/types/src/components/Settings/SettingsFieldSet.d.ts.map +1 -0
  103. package/dist/types/src/components/Settings/SettingsItem.d.ts +16 -0
  104. package/dist/types/src/components/Settings/SettingsItem.d.ts.map +1 -0
  105. package/dist/types/src/components/Settings/SettingsSelectField.d.ts +18 -0
  106. package/dist/types/src/components/Settings/SettingsSelectField.d.ts.map +1 -0
  107. package/dist/types/src/components/Settings/index.d.ts +4 -0
  108. package/dist/types/src/components/Settings/index.d.ts.map +1 -0
  109. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +14 -18
  110. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
  111. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +71 -64
  112. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
  113. package/dist/types/src/components/index.d.ts +4 -1
  114. package/dist/types/src/components/index.d.ts.map +1 -1
  115. package/dist/types/src/components/testing.d.ts +13 -6
  116. package/dist/types/src/components/testing.d.ts.map +1 -1
  117. package/dist/types/src/hooks/index.d.ts +2 -3
  118. package/dist/types/src/hooks/index.d.ts.map +1 -1
  119. package/dist/types/src/hooks/useFormHandler.d.ts +82 -0
  120. package/dist/types/src/hooks/useFormHandler.d.ts.map +1 -0
  121. package/dist/types/src/hooks/useKeyHandler.d.ts +7 -0
  122. package/dist/types/src/hooks/useKeyHandler.d.ts.map +1 -0
  123. package/dist/types/src/index.d.ts +0 -2
  124. package/dist/types/src/index.d.ts.map +1 -1
  125. package/dist/types/src/translations.d.ts +66 -59
  126. package/dist/types/src/translations.d.ts.map +1 -1
  127. package/dist/types/src/util/field-type.d.ts +19 -0
  128. package/dist/types/src/util/field-type.d.ts.map +1 -0
  129. package/dist/types/src/util/field.d.ts +3 -3
  130. package/dist/types/src/util/field.d.ts.map +1 -1
  131. package/dist/types/src/util/formatting.d.ts +2 -2
  132. package/dist/types/src/util/formatting.d.ts.map +1 -1
  133. package/dist/types/src/util/index.d.ts +2 -1
  134. package/dist/types/src/util/index.d.ts.map +1 -1
  135. package/dist/types/src/util/properties.d.ts +17 -0
  136. package/dist/types/src/util/properties.d.ts.map +1 -0
  137. package/dist/types/src/util/properties.test.d.ts +2 -0
  138. package/dist/types/src/util/properties.test.d.ts.map +1 -0
  139. package/dist/types/src/util/refs.d.ts +2 -2
  140. package/dist/types/src/util/refs.d.ts.map +1 -1
  141. package/dist/types/tsconfig.tsbuildinfo +1 -1
  142. package/package.json +61 -52
  143. package/src/components/FieldEditor/FieldEditor.stories.tsx +44 -25
  144. package/src/components/FieldEditor/FieldEditor.test.tsx +0 -1
  145. package/src/components/FieldEditor/FieldEditor.tsx +84 -84
  146. package/src/components/Form/AUDIT.md +17 -0
  147. package/src/components/Form/Form.stories.tsx +134 -252
  148. package/src/components/Form/Form.tsx +417 -109
  149. package/src/components/Form/FormField.tsx +332 -0
  150. package/src/components/Form/FormFieldComponent.stories.tsx +65 -0
  151. package/src/components/Form/FormFieldComponent.tsx +206 -0
  152. package/src/components/Form/FormFieldSet.tsx +173 -0
  153. package/src/components/Form/FormTooltipsContext.ts +25 -0
  154. package/src/components/Form/Layout/FormLayout.stories.tsx +339 -0
  155. package/src/components/Form/Layout/FormLayout.tsx +123 -0
  156. package/src/components/Form/Layout/annotation.ts +38 -0
  157. package/src/components/Form/Layout/index.ts +7 -0
  158. package/src/components/Form/Layout/parser.test.ts +120 -0
  159. package/src/components/Form/Layout/parser.ts +167 -0
  160. package/src/components/Form/README.md +3 -0
  161. package/src/components/Form/fields/ArrayField.tsx +185 -0
  162. package/src/components/Form/fields/BooleanField.tsx +22 -0
  163. package/src/components/Form/fields/DateField.tsx +95 -0
  164. package/src/components/Form/fields/GeoPointField.tsx +124 -0
  165. package/src/components/Form/fields/MarkdownField.stories.tsx +206 -0
  166. package/src/components/Form/fields/MarkdownField.tsx +168 -0
  167. package/src/components/Form/fields/NumberField.tsx +39 -0
  168. package/src/components/Form/fields/RefField.tsx +232 -0
  169. package/src/components/Form/fields/SelectField.tsx +77 -0
  170. package/src/components/Form/{custom/SelectOptionsInput.stories.tsx → fields/SelectOptionField.stories.tsx} +23 -18
  171. package/src/components/Form/{custom/SelectOptionsInput.tsx → fields/SelectOptionField.tsx} +32 -25
  172. package/src/components/Form/fields/TextAreaField.tsx +38 -0
  173. package/src/components/Form/fields/TextField.tsx +38 -0
  174. package/src/components/Form/{custom/TupleInput.tsx → fields/TupleField.tsx} +17 -9
  175. package/src/components/Form/fields/index.ts +16 -0
  176. package/src/components/Form/index.ts +5 -4
  177. package/src/components/ObjectForm/ObjectForm.tsx +115 -0
  178. package/src/components/{ControlSection → ObjectForm}/index.ts +1 -1
  179. package/src/components/ObjectPicker/ObjectPicker.stories.tsx +26 -21
  180. package/src/components/ObjectPicker/ObjectPicker.tsx +122 -81
  181. package/src/components/ObjectProperties/ObjectProperties.stories.tsx +350 -0
  182. package/src/components/ObjectProperties/ObjectProperties.test.tsx +108 -0
  183. package/src/components/ObjectProperties/ObjectProperties.tsx +147 -0
  184. package/src/components/ObjectProperties/index.ts +5 -0
  185. package/src/components/ObjectTree/ObjectTree.stories.tsx +134 -0
  186. package/src/components/ObjectTree/ObjectTree.tsx +190 -0
  187. package/src/components/ObjectTree/index.ts +5 -0
  188. package/src/components/Settings/AUDIT.md +51 -0
  189. package/src/components/Settings/Settings.stories.tsx +104 -0
  190. package/src/components/Settings/Settings.tsx +81 -0
  191. package/src/components/Settings/SettingsFieldSet.tsx +257 -0
  192. package/src/components/Settings/SettingsItem.tsx +58 -0
  193. package/src/components/Settings/SettingsSelectField.tsx +59 -0
  194. package/src/components/Settings/index.ts +7 -0
  195. package/src/components/ViewEditor/ViewEditor.stories.tsx +62 -71
  196. package/src/components/ViewEditor/ViewEditor.test.tsx +10 -10
  197. package/src/components/ViewEditor/ViewEditor.tsx +308 -217
  198. package/src/components/index.ts +4 -1
  199. package/src/components/testing.tsx +24 -11
  200. package/src/hooks/index.ts +2 -3
  201. package/src/hooks/useFormHandler.ts +380 -0
  202. package/src/hooks/useKeyHandler.tsx +37 -0
  203. package/src/index.ts +0 -4
  204. package/src/translations.ts +71 -64
  205. package/src/util/field-type.ts +60 -0
  206. package/src/util/field.ts +25 -25
  207. package/src/util/formatting.ts +22 -22
  208. package/src/util/index.ts +2 -1
  209. package/src/util/properties.test.ts +78 -0
  210. package/src/util/properties.ts +38 -0
  211. package/src/util/refs.ts +13 -15
  212. package/src/vite-env.d.ts +10 -0
  213. package/dist/types/src/components/ControlSection/ControlSection.d.ts +0 -23
  214. package/dist/types/src/components/ControlSection/ControlSection.d.ts.map +0 -1
  215. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts +0 -83
  216. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts.map +0 -1
  217. package/dist/types/src/components/ControlSection/index.d.ts +0 -2
  218. package/dist/types/src/components/ControlSection/index.d.ts.map +0 -1
  219. package/dist/types/src/components/Form/ArrayField.d.ts +0 -16
  220. package/dist/types/src/components/Form/ArrayField.d.ts.map +0 -1
  221. package/dist/types/src/components/Form/Defaults.d.ts +0 -14
  222. package/dist/types/src/components/Form/Defaults.d.ts.map +0 -1
  223. package/dist/types/src/components/Form/FormActions.d.ts +0 -9
  224. package/dist/types/src/components/Form/FormActions.d.ts.map +0 -1
  225. package/dist/types/src/components/Form/FormContent.d.ts +0 -63
  226. package/dist/types/src/components/Form/FormContent.d.ts.map +0 -1
  227. package/dist/types/src/components/Form/FormContext.d.ts +0 -23
  228. package/dist/types/src/components/Form/FormContext.d.ts.map +0 -1
  229. package/dist/types/src/components/Form/Input.d.ts +0 -29
  230. package/dist/types/src/components/Form/Input.d.ts.map +0 -1
  231. package/dist/types/src/components/Form/RefField.d.ts +0 -22
  232. package/dist/types/src/components/Form/RefField.d.ts.map +0 -1
  233. package/dist/types/src/components/Form/custom/GeoPointInput.d.ts +0 -4
  234. package/dist/types/src/components/Form/custom/GeoPointInput.d.ts.map +0 -1
  235. package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts +0 -4
  236. package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts.map +0 -1
  237. package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts +0 -78
  238. package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts.map +0 -1
  239. package/dist/types/src/components/Form/custom/TupleInput.d.ts +0 -6
  240. package/dist/types/src/components/Form/custom/TupleInput.d.ts.map +0 -1
  241. package/dist/types/src/components/Form/custom/index.d.ts +0 -4
  242. package/dist/types/src/components/Form/custom/index.d.ts.map +0 -1
  243. package/dist/types/src/components/Form/factory.d.ts +0 -8
  244. package/dist/types/src/components/Form/factory.d.ts.map +0 -1
  245. package/dist/types/src/hooks/useForm.d.ts +0 -67
  246. package/dist/types/src/hooks/useForm.d.ts.map +0 -1
  247. package/dist/types/src/hooks/useQueryRefOptions.d.ts +0 -29
  248. package/dist/types/src/hooks/useQueryRefOptions.d.ts.map +0 -1
  249. package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts +0 -8
  250. package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts.map +0 -1
  251. package/dist/types/src/util/schema.d.ts +0 -3
  252. package/dist/types/src/util/schema.d.ts.map +0 -1
  253. package/src/components/ControlSection/ControlSection.stories.tsx +0 -38
  254. package/src/components/ControlSection/ControlSection.tsx +0 -153
  255. package/src/components/Form/ArrayField.tsx +0 -125
  256. package/src/components/Form/Defaults.tsx +0 -205
  257. package/src/components/Form/FormActions.tsx +0 -54
  258. package/src/components/Form/FormContent.tsx +0 -362
  259. package/src/components/Form/FormContext.tsx +0 -110
  260. package/src/components/Form/Input.tsx +0 -54
  261. package/src/components/Form/RefField.tsx +0 -283
  262. package/src/components/Form/custom/GeoPointInput.tsx +0 -80
  263. package/src/components/Form/custom/index.ts +0 -7
  264. package/src/components/Form/factory.tsx +0 -31
  265. package/src/hooks/useForm.ts +0 -296
  266. package/src/hooks/useQueryRefOptions.ts +0 -62
  267. package/src/hooks/useRefQueryLookupHandler.ts +0 -39
  268. package/src/util/schema.ts +0 -12
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
@@ -1,12 +1,19 @@
1
1
  import React, { type PropsWithChildren } from 'react';
2
- import { type ThemedClassName } from '@dxos/react-ui';
3
- type TestLayoutProps = ThemedClassName<PropsWithChildren<{
2
+ type TestLayoutProps = PropsWithChildren<{
4
3
  json?: any;
5
- }>>;
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;
4
+ }>;
5
+ export declare const TestLayout: ({ children, json }: TestLayoutProps) => React.JSX.Element;
6
+ export declare const TestPanel: React.ForwardRefExoticComponent<Omit<Omit<{
7
+ children?: React.ReactNode | undefined;
8
+ }, "className"> & {
9
+ classNames?: import("@dxos/ui-types").ClassNameValue;
10
+ } & {
11
+ asChild?: boolean;
12
+ }, "className"> & {
13
+ classNames?: import("@dxos/ui-types").ClassNameValue;
14
+ } & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
9
15
  export declare const VIEW_EDITOR_DEBUG_SYMBOL: unique symbol;
10
16
  export declare const FIELD_EDITOR_DEBUG_SYMBOL: unique symbol;
17
+ export declare const OBJECT_PROPERTIES_DEBUG_SYMBOL: unique symbol;
11
18
  export {};
12
19
  //# sourceMappingURL=testing.d.ts.map
@@ -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;AAMtD,KAAK,eAAe,GAAG,iBAAiB,CAAC;IAAE,IAAI,CAAC,EAAE,GAAG,CAAA;CAAE,CAAC,CAAC;AAEzD,eAAO,MAAM,UAAU,uBAAwB,eAAe,sBAgB7D,CAAC;AAIF,eAAO,MAAM,SAAS;;;;;;;;2HAMpB,CAAC;AAGH,eAAO,MAAM,wBAAwB,eAA4B,CAAC;AAClE,eAAO,MAAM,yBAAyB,eAA6B,CAAC;AACpE,eAAO,MAAM,8BAA8B,eAAkC,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":"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"}
@@ -0,0 +1,7 @@
1
+ import { type RefObject } from 'react';
2
+ import { type FormHandler } from './useFormHandler';
3
+ /**
4
+ * Key handler.
5
+ */
6
+ export declare const useKeyHandler: (elRef: RefObject<HTMLDivElement | null>, form: FormHandler<any>) => void;
7
+ //# sourceMappingURL=useKeyHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useKeyHandler.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useKeyHandler.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAgC,MAAM,OAAO,CAAC;AAIrE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,aAAa,UAAW,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,QAAQ,WAAW,CAAC,GAAG,CAAC,SAuB5F,CAAC"}
@@ -1,6 +1,4 @@
1
- import { translations } from './translations';
2
1
  export * from './components';
3
2
  export * from './hooks';
4
3
  export * from './util';
5
- export { translations };
6
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
@@ -1,64 +1,71 @@
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": {
5
- readonly 'fields label': "Fields";
6
- readonly 'hidden fields label': "Hidden Fields";
7
- readonly 'empty readonly ref field label': "(none)";
8
- readonly 'add property button': "Add property";
9
- readonly 'field property label': "Property";
10
- readonly 'field property placeholder': "Property name";
11
- readonly 'field format label': "Type";
12
- readonly 'field path label': "Field path";
13
- readonly 'add field': "Add field";
14
- readonly 'delete field': "Delete field";
15
- readonly 'field limit reached': "Maximum number of fields reached";
16
- readonly 'boolean input true value': "Yes";
17
- readonly 'boolean input false value': "No";
18
- readonly 'show field label': "Show field";
19
- readonly 'hide field label': "Hide field";
20
- readonly 'delete field label': "Delete field";
21
- readonly 'ref field combobox input placeholder': "Search…";
22
- readonly 'ref field placeholder_one': "Select…";
23
- readonly 'ref field placeholder_other': "Select items…";
24
- readonly 'save button': "Save";
25
- readonly 'format boolean': "Boolean";
26
- readonly 'format currency': "Currency";
27
- readonly 'format date': "Date";
28
- readonly 'format date-time': "DateTime";
29
- readonly 'format did': "DID";
30
- readonly 'format duration': "Duration";
31
- readonly 'format dxn': "DXN";
32
- readonly 'format email': "Email";
33
- readonly 'format formula': "Formula";
34
- readonly 'format hostname': "Hostname";
35
- readonly 'format integer': "Integer";
36
- readonly 'format json': "JSON";
37
- readonly 'format lnglat': "Geopoint";
38
- readonly 'format markdown': "Markdown";
39
- readonly 'format percent': "Percent";
40
- readonly 'format ref': "Reference";
41
- readonly 'format regex': "RegExp";
42
- readonly 'format string': "String";
43
- readonly 'format single-select': "Select";
44
- readonly 'format multi-select': "Multi-select";
45
- readonly 'format text': "Long text";
46
- readonly 'format time': "Time";
47
- readonly 'format timestamp': "Timestamp";
48
- readonly 'format user': "User";
49
- readonly 'format number': "Number";
50
- readonly 'format uri': "URI";
51
- readonly 'format url': "URL";
52
- readonly 'format uuid': "UUID";
53
- readonly 'latitude label': "Latitude";
54
- readonly 'longitude label': "Longitude";
55
- readonly 'select option label': "Label";
56
- readonly 'select option label placeholder': "Option label";
57
- readonly 'select option color': "Color";
58
- readonly 'select option delete': "Delete";
59
- readonly 'select option add': "Add option";
60
- readonly 'system schema title': "System record type";
61
- readonly 'system schema description': "This is a system record type and cannot be modified, though the view can still be configured.";
4
+ readonly "@dxos/react-ui-form": {
5
+ readonly 'fields.label': 'Fields';
6
+ readonly 'hidden-fields.label': 'Hidden Fields';
7
+ readonly 'empty-readonly-ref-field.label': '(none)';
8
+ readonly 'field-property.label': 'Property';
9
+ readonly 'field-property.placeholder': 'Property name';
10
+ readonly 'field-format.label': 'Type';
11
+ readonly 'field-path.label': 'Field path';
12
+ readonly 'remove-item.button': 'Delete item';
13
+ readonly 'add-item.button': 'Add item';
14
+ readonly 'add-property-button.label': 'Add property';
15
+ readonly 'boolean-input-true.value': 'Yes';
16
+ readonly 'boolean-input-false.value': 'No';
17
+ readonly 'show-field.label': 'Show field';
18
+ readonly 'hide-field.label': 'Hide field';
19
+ readonly 'delete-field.label': 'Delete field';
20
+ readonly 'create-option.label': 'Create';
21
+ readonly 'add-tag.label': 'Add tag';
22
+ readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
23
+ readonly 'ref-field.placeholder': 'Select\u2026';
24
+ readonly 'ref-field.placeholder_one': 'Select\u2026';
25
+ readonly 'ref-field.placeholder_other': 'Select items\u2026';
26
+ readonly 'example.placeholder': 'Example';
27
+ readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
28
+ readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
29
+ readonly 'cancel-button.label': 'Cancel';
30
+ readonly 'save-button.label': 'Save';
31
+ readonly 'create-text.label': 'Create text';
32
+ readonly 'format.boolean.label': 'Boolean';
33
+ readonly 'format.currency.label': 'Currency';
34
+ readonly 'format.date.label': 'Date';
35
+ readonly 'format.date-time.label': 'DateTime';
36
+ readonly 'format.did.label': 'DID';
37
+ readonly 'format.duration.label': 'Duration';
38
+ readonly 'format.dxn.label': 'DXN';
39
+ readonly 'format.email.label': 'Email';
40
+ readonly 'format.formula.label': 'Formula';
41
+ readonly 'format.hostname.label': 'Hostname';
42
+ readonly 'format.integer.label': 'Integer';
43
+ readonly 'format.json.label': 'JSON';
44
+ readonly 'format.lnglat.label': 'Geopoint';
45
+ readonly 'format.markdown.label': 'Markdown';
46
+ readonly 'format.percent.label': 'Percent';
47
+ readonly 'format.ref.label': 'Reference';
48
+ readonly 'format.regex.label': 'RegExp';
49
+ readonly 'format.string.label': 'String';
50
+ readonly 'format.single-select.label': 'Select';
51
+ readonly 'format.multi-select.label': 'Multi-select';
52
+ readonly 'format.text.label': 'Long text';
53
+ readonly 'format.time.label': 'Time';
54
+ readonly 'format.timestamp.label': 'Timestamp';
55
+ readonly 'format.user.label': 'User';
56
+ readonly 'format.number.label': 'Number';
57
+ readonly 'format.uri.label': 'URI';
58
+ readonly 'format.url.label': 'URL';
59
+ readonly 'format.uuid.label': 'UUID';
60
+ readonly 'latitude.label': 'Latitude';
61
+ readonly 'longitude.label': 'Longitude';
62
+ readonly 'select-option.label': 'Label';
63
+ readonly 'select-option-label.placeholder': 'Option label';
64
+ readonly 'select-option-delete.button': 'Delete';
65
+ readonly 'select-option-add.button': 'Add option';
66
+ readonly 'system-schema.title': 'System type';
67
+ readonly 'system-schema.description': 'System type: cannot add or remove fields.';
68
+ readonly 'remove.button': 'Delete';
62
69
  };
63
70
  };
64
71
  }];
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6EM,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;;;qBAIjB,cAAc,EAAE,QAAQ;qBACxB,qBAAqB,EAAE,eAAe;qBACtC,gCAAgC,EAAE,QAAQ;qBAE1C,sBAAsB,EAAE,UAAU;qBAClC,4BAA4B,EAAE,eAAe;qBAC7C,oBAAoB,EAAE,MAAM;qBAC5B,kBAAkB,EAAE,YAAY;qBAEhC,oBAAoB,EAAE,aAAa;qBACnC,iBAAiB,EAAE,UAAU;qBAC7B,2BAA2B,EAAE,cAAc;qBAC3C,0BAA0B,EAAE,KAAK;qBACjC,2BAA2B,EAAE,IAAI;qBACjC,kBAAkB,EAAE,YAAY;qBAChC,kBAAkB,EAAE,YAAY;qBAChC,oBAAoB,EAAE,cAAc;qBACpC,qBAAqB,EAAE,QAAQ;qBAC/B,eAAe,EAAE,SAAS;qBAE1B,sCAAsC,EAAE,cAAS;qBACjD,uBAAuB,EAAE,cAAS;qBAClC,2BAA2B,EAAE,cAAS;qBACtC,6BAA6B,EAAE,oBAAe;qBAE9C,qBAAqB,EAAE,SAAS;qBAChC,sBAAsB,EAAE,0BAA0B;qBAClD,uBAAuB,EAAE,4BAA4B;qBAErD,qBAAqB,EAAE,QAAQ;qBAC/B,mBAAmB,EAAE,MAAM;qBAC3B,mBAAmB,EAAE,aAAa;qBAGlC,sBAAsB,EAAE,SAAS;qBACjC,uBAAuB,EAAE,UAAU;qBACnC,mBAAmB,EAAE,MAAM;qBAC3B,wBAAwB,EAAE,UAAU;qBACpC,kBAAkB,EAAE,KAAK;qBACzB,uBAAuB,EAAE,UAAU;qBACnC,kBAAkB,EAAE,KAAK;qBACzB,oBAAoB,EAAE,OAAO;qBAC7B,sBAAsB,EAAE,SAAS;qBACjC,uBAAuB,EAAE,UAAU;qBACnC,sBAAsB,EAAE,SAAS;qBACjC,mBAAmB,EAAE,MAAM;qBAC3B,qBAAqB,EAAE,UAAU;qBACjC,uBAAuB,EAAE,UAAU;qBACnC,sBAAsB,EAAE,SAAS;qBACjC,kBAAkB,EAAE,WAAW;qBAC/B,oBAAoB,EAAE,QAAQ;qBAC9B,qBAAqB,EAAE,QAAQ;qBAC/B,4BAA4B,EAAE,QAAQ;qBACtC,2BAA2B,EAAE,cAAc;qBAC3C,mBAAmB,EAAE,WAAW;qBAChC,mBAAmB,EAAE,MAAM;qBAC3B,wBAAwB,EAAE,WAAW;qBACrC,mBAAmB,EAAE,MAAM;qBAC3B,qBAAqB,EAAE,QAAQ;qBAC/B,kBAAkB,EAAE,KAAK;qBACzB,kBAAkB,EAAE,KAAK;qBACzB,mBAAmB,EAAE,MAAM;qBAG3B,gBAAgB,EAAE,UAAU;qBAC5B,iBAAiB,EAAE,WAAW;qBAG9B,qBAAqB,EAAE,OAAO;qBAC9B,iCAAiC,EAAE,cAAc;qBACjD,6BAA6B,EAAE,QAAQ;qBACvC,0BAA0B,EAAE,YAAY;qBAGxC,qBAAqB,EAAE,aAAa;qBACpC,2BAA2B,EAAE,2CAA2C;qBACxE,eAAe,EAAE,QAAQ;;;EAIF,CAAC"}
@@ -0,0 +1,19 @@
1
+ import * as SchemaAST from 'effect/SchemaAST';
2
+ /**
3
+ * Detected field type for a schema property.
4
+ */
5
+ export type SettingsFieldType = 'boolean' | 'string' | 'number' | 'select' | 'struct';
6
+ export type SelectOption = {
7
+ value: string | number;
8
+ label?: string;
9
+ };
10
+ /**
11
+ * Detect the field type from an Effect Schema AST node.
12
+ */
13
+ export declare const detectFieldType: (ast: SchemaAST.AST) => SettingsFieldType | undefined;
14
+ /**
15
+ * Extract select options from a literal union AST node.
16
+ * Reads title annotations from individual literals for labels.
17
+ */
18
+ export declare const getSelectOptionsFromAst: (ast: SchemaAST.AST) => SelectOption[] | undefined;
19
+ //# sourceMappingURL=field-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-type.d.ts","sourceRoot":"","sources":["../../../../src/util/field-type.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAI9C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEtF,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,QAAS,SAAS,CAAC,GAAG,KAAG,iBAAiB,GAAG,SAkBxE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAAS,SAAS,CAAC,GAAG,KAAG,YAAY,EAAE,GAAG,SAc7E,CAAC"}
@@ -1,4 +1,4 @@
1
- import { FormatEnum, TypeEnum } from '@dxos/echo/internal';
1
+ import { Format, TypeEnum } from '@dxos/echo/internal';
2
2
  import { type ValidationError } from '@dxos/schema';
3
3
  /**
4
4
  * Parse value by field value type.
@@ -8,13 +8,13 @@ import { type ValidationError } from '@dxos/schema';
8
8
  */
9
9
  export type ParseProps = {
10
10
  type?: TypeEnum;
11
- format?: FormatEnum;
11
+ format?: Format.TypeFormat;
12
12
  value: any;
13
13
  };
14
14
  export declare const parseValue: ({ type, format, value }: ParseProps) => any;
15
15
  export type CellClassesForFieldTypeProps = {
16
16
  type?: TypeEnum;
17
- format?: FormatEnum;
17
+ format?: Format.TypeFormat;
18
18
  };
19
19
  export declare const cellClassesForFieldType: ({ type, format }: CellClassesForFieldTypeProps) => string[] | undefined;
20
20
  export declare const pathNotUniqueError: (path: string) => ValidationError;
@@ -1 +1 @@
1
- {"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../src/util/field.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAe,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,GAAG,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,yBAAyB,UAAU,QAsF7D,CAAC;AAGF,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,kBAAkB,4BAA4B,KAAG,MAAM,EAAE,GAAG,SAyBnG,CAAC;AAGF,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,eAGhD,CAAC"}
1
+ {"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../src/util/field.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAe,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAC3B,KAAK,EAAE,GAAG,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,UAAU,4BAA6B,UAAU,QAsF7D,CAAC;AAGF,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,uBAAuB,qBAAsB,4BAA4B,KAAG,MAAM,EAAE,GAAG,SAyBnG,CAAC;AAGF,eAAO,MAAM,kBAAkB,SAAU,MAAM,KAAG,eAGhD,CAAC"}
@@ -1,7 +1,7 @@
1
- import { FormatEnum, TypeEnum } from '@dxos/echo/internal';
1
+ import { Format, TypeEnum } from '@dxos/echo/internal';
2
2
  type ValueFormatProps = {
3
3
  type: TypeEnum;
4
- format?: FormatEnum | undefined;
4
+ format?: Format.TypeFormat | undefined;
5
5
  value: any;
6
6
  locale?: string | undefined;
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../src/util/formatting.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAe,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAExE,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAChC,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF;;;GAGG;AAGH,eAAO,MAAM,gBAAgB,GAAI,iCAA6C,gBAAgB,KAAG,MAqFhG,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,iCAA6C,gBAAgB,KAAG,MA8DhG,CAAC"}
1
+ {"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../src/util/formatting.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAe,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpE,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC;IACvC,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF;;;GAGG;AAGH,eAAO,MAAM,gBAAgB,oCAAiD,gBAAgB,KAAG,MAqFhG,CAAC;AAEF,eAAO,MAAM,gBAAgB,oCAAiD,gBAAgB,KAAG,MA8DhG,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export * from './field';
2
+ export * from './field-type';
2
3
  export * from './formatting';
4
+ export * from './properties';
3
5
  export * from './refs';
4
- export * from './schema';
5
6
  //# 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,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,17 @@
1
+ import * 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
+ * The `FormInputAnnotation` is read from the raw property signature's AST (before
7
+ * `encodedBoundAST` is applied by `getProperties`), because `encodedBoundAST` strips
8
+ * annotations from non-keyword inner types (e.g., `Schema.Struct`, `Schema.Array`).
9
+ * Without this, fields like `Routine.input` (a JsonSchema struct) annotated
10
+ * `FormInputAnnotation.set(false)` would still render in the form.
11
+ *
12
+ * For optional fields, `prop.type` is the union `T | undefined` — the annotation
13
+ * lives on the inner `T`. Unwrap before reading so that the conventional pattern
14
+ * `Schema.String.pipe(FormInputAnnotation.set(false), Schema.optional)` works.
15
+ */
16
+ export declare const getFormProperties: (ast: SchemaAST.AST) => SchemaProperty[];
17
+ //# 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,SAAS,MAAM,kBAAkB,CAAC;AAG9C,OAAO,EAAE,KAAK,cAAc,EAAiB,MAAM,cAAc,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,QAAS,SAAS,CAAC,GAAG,KAAG,cAAc,EAcpE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=properties.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"properties.test.d.ts","sourceRoot":"","sources":["../../../../src/util/properties.test.ts"],"names":[],"mappings":""}
@@ -1,9 +1,9 @@
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;
5
+ typename?: string;
6
6
  };
7
- export declare const getRefProps: (property: SchemaProperty<any>) => RefProps | undefined;
7
+ export declare const getRefProps: (ast: SchemaAST.AST) => RefProps | undefined;
8
8
  export {};
9
9
  //# 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;AAMnD,KAAK,QAAQ,GAAG;IACd,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,WAAW,QAAS,SAAS,CAAC,GAAG,KAAG,QAAQ,GAAG,SAmB3D,CAAC"}