@dxos/react-ui-form 0.8.4-staging.60fe92afc8 → 0.9.1-main.c7dcc2e112

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 (282) hide show
  1. package/dist/lib/browser/index.mjs +2221 -2147
  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 +2221 -2147
  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/FieldEditor/FieldEditor.d.ts +3 -3
  8. package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
  9. package/dist/types/src/components/Form/Form.d.ts +15 -110
  10. package/dist/types/src/components/Form/Form.d.ts.map +1 -1
  11. package/dist/types/src/components/Form/Form.stories.d.ts +3 -37
  12. package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
  13. package/dist/types/src/components/Form/FormControls.d.ts +66 -0
  14. package/dist/types/src/components/Form/FormControls.d.ts.map +1 -0
  15. package/dist/types/src/components/Form/FormField/FieldHeader.d.ts +19 -0
  16. package/dist/types/src/components/Form/FormField/FieldHeader.d.ts.map +1 -0
  17. package/dist/types/src/components/Form/FormField/FormField.d.ts +30 -0
  18. package/dist/types/src/components/Form/FormField/FormField.d.ts.map +1 -0
  19. package/dist/types/src/components/Form/FormField/FormFieldWrapper.d.ts +47 -0
  20. package/dist/types/src/components/Form/FormField/FormFieldWrapper.d.ts.map +1 -0
  21. package/dist/types/src/components/Form/{FormFieldComponent.stories.d.ts → FormField/FormFieldWrapper.stories.d.ts} +3 -3
  22. package/dist/types/src/components/Form/FormField/FormFieldWrapper.stories.d.ts.map +1 -0
  23. package/dist/types/src/components/Form/{fields → FormField/fields/ArrayField}/ArrayField.d.ts +2 -2
  24. package/dist/types/src/components/Form/FormField/fields/ArrayField/ArrayField.d.ts.map +1 -0
  25. package/dist/types/src/components/Form/FormField/fields/ArrayField/ArrayField.stories.d.ts +87 -0
  26. package/dist/types/src/components/Form/FormField/fields/ArrayField/ArrayField.stories.d.ts.map +1 -0
  27. package/dist/types/src/components/Form/FormField/fields/ArrayField/index.d.ts +2 -0
  28. package/dist/types/src/components/Form/FormField/fields/ArrayField/index.d.ts.map +1 -0
  29. package/dist/types/src/components/Form/FormField/fields/BooleanField/BooleanField.d.ts +4 -0
  30. package/dist/types/src/components/Form/FormField/fields/BooleanField/BooleanField.d.ts.map +1 -0
  31. package/dist/types/src/components/Form/FormField/fields/BooleanField/BooleanField.stories.d.ts +88 -0
  32. package/dist/types/src/components/Form/FormField/fields/BooleanField/BooleanField.stories.d.ts.map +1 -0
  33. package/dist/types/src/components/Form/FormField/fields/BooleanField/index.d.ts +2 -0
  34. package/dist/types/src/components/Form/FormField/fields/BooleanField/index.d.ts.map +1 -0
  35. package/dist/types/src/components/Form/FormField/fields/DateField/DateField.d.ts +4 -0
  36. package/dist/types/src/components/Form/FormField/fields/DateField/DateField.d.ts.map +1 -0
  37. package/dist/types/src/components/Form/FormField/fields/DateField/DateField.stories.d.ts +88 -0
  38. package/dist/types/src/components/Form/FormField/fields/DateField/DateField.stories.d.ts.map +1 -0
  39. package/dist/types/src/components/Form/FormField/fields/DateField/index.d.ts +2 -0
  40. package/dist/types/src/components/Form/FormField/fields/DateField/index.d.ts.map +1 -0
  41. package/dist/types/src/components/Form/{fields → FormField/fields/GeoPointField}/GeoPointField.d.ts +2 -2
  42. package/dist/types/src/components/Form/FormField/fields/GeoPointField/GeoPointField.d.ts.map +1 -0
  43. package/dist/types/src/components/Form/FormField/fields/GeoPointField/GeoPointField.stories.d.ts +88 -0
  44. package/dist/types/src/components/Form/FormField/fields/GeoPointField/GeoPointField.stories.d.ts.map +1 -0
  45. package/dist/types/src/components/Form/FormField/fields/GeoPointField/index.d.ts +2 -0
  46. package/dist/types/src/components/Form/FormField/fields/GeoPointField/index.d.ts.map +1 -0
  47. package/dist/types/src/components/Form/{fields → FormField/fields/MarkdownField}/MarkdownField.d.ts +2 -2
  48. package/dist/types/src/components/Form/FormField/fields/MarkdownField/MarkdownField.d.ts.map +1 -0
  49. package/dist/types/src/components/Form/FormField/fields/MarkdownField/MarkdownField.stories.d.ts.map +1 -0
  50. package/dist/types/src/components/Form/FormField/fields/MarkdownField/index.d.ts +2 -0
  51. package/dist/types/src/components/Form/FormField/fields/MarkdownField/index.d.ts.map +1 -0
  52. package/dist/types/src/components/Form/FormField/fields/NumberField/NumberField.d.ts +4 -0
  53. package/dist/types/src/components/Form/FormField/fields/NumberField/NumberField.d.ts.map +1 -0
  54. package/dist/types/src/components/Form/FormField/fields/NumberField/NumberField.stories.d.ts +88 -0
  55. package/dist/types/src/components/Form/FormField/fields/NumberField/NumberField.stories.d.ts.map +1 -0
  56. package/dist/types/src/components/Form/FormField/fields/NumberField/index.d.ts +2 -0
  57. package/dist/types/src/components/Form/FormField/fields/NumberField/index.d.ts.map +1 -0
  58. package/dist/types/src/components/Form/FormField/fields/RefField/InlineRefField.d.ts.map +1 -0
  59. package/dist/types/src/components/Form/FormField/fields/RefField/RefField.d.ts +16 -0
  60. package/dist/types/src/components/Form/FormField/fields/RefField/RefField.d.ts.map +1 -0
  61. package/dist/types/src/components/Form/FormField/fields/RefField/RefField.stories.d.ts +92 -0
  62. package/dist/types/src/components/Form/FormField/fields/RefField/RefField.stories.d.ts.map +1 -0
  63. package/dist/types/src/components/Form/FormField/fields/RefField/RefField.test.d.ts.map +1 -0
  64. package/dist/types/src/components/Form/FormField/fields/RefField/index.d.ts +3 -0
  65. package/dist/types/src/components/Form/FormField/fields/RefField/index.d.ts.map +1 -0
  66. package/dist/types/src/components/Form/{fields → FormField/fields/SelectField}/SelectField.d.ts +2 -2
  67. package/dist/types/src/components/Form/FormField/fields/SelectField/SelectField.d.ts.map +1 -0
  68. package/dist/types/src/components/Form/FormField/fields/SelectField/SelectField.stories.d.ts +88 -0
  69. package/dist/types/src/components/Form/FormField/fields/SelectField/SelectField.stories.d.ts.map +1 -0
  70. package/dist/types/src/components/Form/FormField/fields/SelectField/index.d.ts +2 -0
  71. package/dist/types/src/components/Form/FormField/fields/SelectField/index.d.ts.map +1 -0
  72. package/dist/types/src/components/Form/FormField/fields/SelectOptionField/SelectOptionField.d.ts +5 -0
  73. package/dist/types/src/components/Form/FormField/fields/SelectOptionField/SelectOptionField.d.ts.map +1 -0
  74. package/dist/types/src/components/Form/FormField/fields/SelectOptionField/SelectOptionField.stories.d.ts.map +1 -0
  75. package/dist/types/src/components/Form/FormField/fields/SelectOptionField/index.d.ts +2 -0
  76. package/dist/types/src/components/Form/FormField/fields/SelectOptionField/index.d.ts.map +1 -0
  77. package/dist/types/src/components/Form/FormField/fields/TextAreaField/TextAreaField.d.ts +4 -0
  78. package/dist/types/src/components/Form/FormField/fields/TextAreaField/TextAreaField.d.ts.map +1 -0
  79. package/dist/types/src/components/Form/FormField/fields/TextAreaField/TextAreaField.stories.d.ts +88 -0
  80. package/dist/types/src/components/Form/FormField/fields/TextAreaField/TextAreaField.stories.d.ts.map +1 -0
  81. package/dist/types/src/components/Form/FormField/fields/TextAreaField/index.d.ts +2 -0
  82. package/dist/types/src/components/Form/FormField/fields/TextAreaField/index.d.ts.map +1 -0
  83. package/dist/types/src/components/Form/FormField/fields/TextField/TextField.d.ts +4 -0
  84. package/dist/types/src/components/Form/FormField/fields/TextField/TextField.d.ts.map +1 -0
  85. package/dist/types/src/components/Form/FormField/fields/TextField/TextField.stories.d.ts +88 -0
  86. package/dist/types/src/components/Form/FormField/fields/TextField/TextField.stories.d.ts.map +1 -0
  87. package/dist/types/src/components/Form/FormField/fields/TextField/index.d.ts +2 -0
  88. package/dist/types/src/components/Form/FormField/fields/TextField/index.d.ts.map +1 -0
  89. package/dist/types/src/components/Form/{fields → FormField/fields/TupleField}/TupleField.d.ts +2 -2
  90. package/dist/types/src/components/Form/FormField/fields/TupleField/TupleField.d.ts.map +1 -0
  91. package/dist/types/src/components/Form/FormField/fields/TupleField/TupleField.stories.d.ts +88 -0
  92. package/dist/types/src/components/Form/FormField/fields/TupleField/TupleField.stories.d.ts.map +1 -0
  93. package/dist/types/src/components/Form/FormField/fields/TupleField/index.d.ts +2 -0
  94. package/dist/types/src/components/Form/FormField/fields/TupleField/index.d.ts.map +1 -0
  95. package/dist/types/src/components/Form/{fields → FormField/fields}/index.d.ts +0 -1
  96. package/dist/types/src/components/Form/FormField/fields/index.d.ts.map +1 -0
  97. package/dist/types/src/components/Form/FormField/index.d.ts +5 -0
  98. package/dist/types/src/components/Form/FormField/index.d.ts.map +1 -0
  99. package/dist/types/src/components/Form/{FormFieldSet.d.ts → FormFieldSet/FormFieldSet.d.ts} +4 -3
  100. package/dist/types/src/components/Form/FormFieldSet/FormFieldSet.d.ts.map +1 -0
  101. package/dist/types/src/components/Form/FormFieldSet/index.d.ts +2 -0
  102. package/dist/types/src/components/Form/FormFieldSet/index.d.ts.map +1 -0
  103. package/dist/types/src/components/Form/FormLayout/FormLayout.d.ts.map +1 -0
  104. package/dist/types/src/components/Form/FormLayout/FormLayout.stories.d.ts.map +1 -0
  105. package/dist/types/src/components/Form/FormLayout/FormLayout.stories.test.d.ts.map +1 -0
  106. package/dist/types/src/components/Form/FormLayout/FormLayout.test.d.ts.map +1 -0
  107. package/dist/types/src/components/Form/FormLayout/index.d.ts +3 -0
  108. package/dist/types/src/components/Form/FormLayout/index.d.ts.map +1 -0
  109. package/dist/types/src/components/Form/FormLayout/parser.d.ts.map +1 -0
  110. package/dist/types/src/components/Form/FormLayout/parser.test.d.ts.map +1 -0
  111. package/dist/types/src/components/Form/index.d.ts +3 -5
  112. package/dist/types/src/components/Form/index.d.ts.map +1 -1
  113. package/dist/types/src/components/Form/meta-tags.d.ts +2 -2
  114. package/dist/types/src/components/ObjectForm/ObjectForm.d.ts.map +1 -1
  115. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts +6 -23
  116. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -1
  117. package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts.map +1 -1
  118. package/dist/types/src/components/RefEditor/RefEditor.stories.d.ts.map +1 -1
  119. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +1 -1
  120. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
  121. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
  122. package/dist/types/src/hooks/index.d.ts +1 -0
  123. package/dist/types/src/hooks/index.d.ts.map +1 -1
  124. package/dist/types/src/hooks/useFormContext.d.ts +37 -0
  125. package/dist/types/src/hooks/useFormContext.d.ts.map +1 -0
  126. package/dist/types/src/hooks/useFormHandler.d.ts +1 -4
  127. package/dist/types/src/hooks/useFormHandler.d.ts.map +1 -1
  128. package/dist/types/src/index.d.ts +1 -0
  129. package/dist/types/src/index.d.ts.map +1 -1
  130. package/dist/types/src/{components/testing.d.ts → testing/TestLayout.d.ts} +1 -1
  131. package/dist/types/src/testing/TestLayout.d.ts.map +1 -0
  132. package/dist/types/src/testing/index.d.ts +3 -0
  133. package/dist/types/src/testing/index.d.ts.map +1 -0
  134. package/dist/types/src/testing/schema.d.ts +43 -0
  135. package/dist/types/src/testing/schema.d.ts.map +1 -0
  136. package/dist/types/src/types.d.ts +112 -0
  137. package/dist/types/src/types.d.ts.map +1 -0
  138. package/dist/types/src/util/index.d.ts +1 -0
  139. package/dist/types/src/util/index.d.ts.map +1 -1
  140. package/dist/types/src/util/omit.d.ts +12 -0
  141. package/dist/types/src/util/omit.d.ts.map +1 -0
  142. package/dist/types/tsconfig.tsbuildinfo +1 -1
  143. package/package.json +35 -34
  144. package/src/components/FieldEditor/FieldEditor.stories.tsx +1 -1
  145. package/src/components/FieldEditor/FieldEditor.test.tsx +1 -1
  146. package/src/components/FieldEditor/FieldEditor.tsx +5 -4
  147. package/src/components/Form/Form.stories.tsx +4 -49
  148. package/src/components/Form/Form.tsx +18 -447
  149. package/src/components/Form/FormControls.tsx +320 -0
  150. package/src/components/Form/FormField/FieldHeader.tsx +36 -0
  151. package/src/components/Form/{FormField.tsx → FormField/FormField.tsx} +35 -59
  152. package/src/components/Form/{FormFieldComponent.stories.tsx → FormField/FormFieldWrapper.stories.tsx} +24 -17
  153. package/src/components/Form/{FormFieldComponent.tsx → FormField/FormFieldWrapper.tsx} +21 -95
  154. package/src/components/Form/FormField/fields/ArrayField/ArrayField.stories.tsx +103 -0
  155. package/src/components/Form/FormField/fields/ArrayField/ArrayField.tsx +269 -0
  156. package/src/components/Form/FormField/fields/ArrayField/index.ts +5 -0
  157. package/src/components/Form/FormField/fields/BooleanField/BooleanField.stories.tsx +52 -0
  158. package/src/components/Form/{fields → FormField/fields/BooleanField}/BooleanField.tsx +10 -3
  159. package/src/components/Form/FormField/fields/BooleanField/index.ts +5 -0
  160. package/src/components/Form/FormField/fields/DateField/DateField.stories.tsx +60 -0
  161. package/src/components/Form/{fields → FormField/fields/DateField}/DateField.tsx +4 -2
  162. package/src/components/Form/FormField/fields/DateField/index.ts +5 -0
  163. package/src/components/Form/FormField/fields/GeoPointField/GeoPointField.stories.tsx +53 -0
  164. package/src/components/Form/{fields → FormField/fields/GeoPointField}/GeoPointField.tsx +4 -3
  165. package/src/components/Form/FormField/fields/GeoPointField/index.ts +5 -0
  166. package/src/components/Form/{fields → FormField/fields/MarkdownField}/MarkdownField.stories.tsx +6 -6
  167. package/src/components/Form/{fields → FormField/fields/MarkdownField}/MarkdownField.tsx +3 -2
  168. package/src/components/Form/FormField/fields/MarkdownField/index.ts +5 -0
  169. package/src/components/Form/FormField/fields/NumberField/NumberField.stories.tsx +52 -0
  170. package/src/components/Form/{fields → FormField/fields/NumberField}/NumberField.tsx +27 -2
  171. package/src/components/Form/FormField/fields/NumberField/index.ts +5 -0
  172. package/src/components/Form/{fields → FormField/fields/RefField}/InlineRefField.tsx +8 -7
  173. package/src/components/Form/FormField/fields/RefField/RefField.stories.tsx +97 -0
  174. package/src/components/Form/{fields → FormField/fields/RefField}/RefField.test.ts +2 -1
  175. package/src/components/Form/{fields → FormField/fields/RefField}/RefField.tsx +6 -25
  176. package/src/components/Form/FormField/fields/RefField/index.ts +6 -0
  177. package/src/components/Form/FormField/fields/SelectField/SelectField.stories.tsx +53 -0
  178. package/src/components/Form/{fields → FormField/fields/SelectField}/SelectField.tsx +4 -2
  179. package/src/components/Form/FormField/fields/SelectField/index.ts +5 -0
  180. package/src/components/Form/{fields → FormField/fields/SelectOptionField}/SelectOptionField.stories.tsx +5 -5
  181. package/src/components/Form/{fields → FormField/fields/SelectOptionField}/SelectOptionField.tsx +55 -53
  182. package/src/components/Form/FormField/fields/SelectOptionField/index.ts +5 -0
  183. package/src/components/Form/FormField/fields/TextAreaField/TextAreaField.stories.tsx +53 -0
  184. package/src/components/Form/{fields → FormField/fields/TextAreaField}/TextAreaField.tsx +4 -2
  185. package/src/components/Form/FormField/fields/TextAreaField/index.ts +5 -0
  186. package/src/components/Form/FormField/fields/TextField/TextField.stories.tsx +52 -0
  187. package/src/components/Form/{fields → FormField/fields/TextField}/TextField.tsx +4 -2
  188. package/src/components/Form/FormField/fields/TextField/index.ts +5 -0
  189. package/src/components/Form/FormField/fields/TupleField/TupleField.stories.tsx +55 -0
  190. package/src/components/Form/{fields → FormField/fields/TupleField}/TupleField.tsx +4 -2
  191. package/src/components/Form/FormField/fields/TupleField/index.ts +5 -0
  192. package/src/components/Form/{fields → FormField/fields}/index.ts +0 -1
  193. package/src/components/Form/FormField/index.ts +8 -0
  194. package/src/components/Form/{FormFieldSet.tsx → FormFieldSet/FormFieldSet.tsx} +16 -32
  195. package/src/components/Form/FormFieldSet/index.ts +5 -0
  196. package/src/components/Form/{Layout → FormLayout}/FormLayout.stories.tsx +4 -4
  197. package/src/components/Form/{Layout → FormLayout}/FormLayout.tsx +7 -6
  198. package/src/components/Form/{Layout → FormLayout}/index.ts +1 -2
  199. package/src/components/Form/index.ts +3 -5
  200. package/src/components/Form/meta-tags.ts +1 -1
  201. package/src/components/ObjectForm/ObjectForm.tsx +15 -14
  202. package/src/components/ObjectPicker/ObjectPicker.tsx +19 -27
  203. package/src/components/ObjectProperties/ObjectProperties.stories.tsx +1 -1
  204. package/src/components/ObjectProperties/ObjectProperties.test.tsx +1 -1
  205. package/src/components/ObjectProperties/ObjectProperties.tsx +2 -1
  206. package/src/components/RefEditor/RefEditor.stories.tsx +0 -1
  207. package/src/components/ViewEditor/ViewEditor.stories.tsx +4 -5
  208. package/src/components/ViewEditor/ViewEditor.test.tsx +1 -1
  209. package/src/components/ViewEditor/ViewEditor.tsx +98 -128
  210. package/src/hooks/index.ts +1 -0
  211. package/src/hooks/useFormContext.ts +86 -0
  212. package/src/hooks/useFormHandler.ts +1 -4
  213. package/src/index.ts +1 -0
  214. package/src/{components/testing.tsx → testing/TestLayout.tsx} +1 -1
  215. package/src/testing/index.ts +7 -0
  216. package/src/testing/schema.ts +59 -0
  217. package/src/types.ts +134 -0
  218. package/src/util/index.ts +1 -0
  219. package/src/util/omit.ts +47 -0
  220. package/src/vitest-setup.ts +40 -0
  221. package/dist/types/src/components/Form/FormField.d.ts +0 -52
  222. package/dist/types/src/components/Form/FormField.d.ts.map +0 -1
  223. package/dist/types/src/components/Form/FormFieldComponent.d.ts +0 -98
  224. package/dist/types/src/components/Form/FormFieldComponent.d.ts.map +0 -1
  225. package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts.map +0 -1
  226. package/dist/types/src/components/Form/FormFieldSet.d.ts.map +0 -1
  227. package/dist/types/src/components/Form/FormTooltipsContext.d.ts +0 -19
  228. package/dist/types/src/components/Form/FormTooltipsContext.d.ts.map +0 -1
  229. package/dist/types/src/components/Form/Layout/FormLayout.d.ts.map +0 -1
  230. package/dist/types/src/components/Form/Layout/FormLayout.stories.d.ts.map +0 -1
  231. package/dist/types/src/components/Form/Layout/FormLayout.stories.test.d.ts.map +0 -1
  232. package/dist/types/src/components/Form/Layout/FormLayout.test.d.ts.map +0 -1
  233. package/dist/types/src/components/Form/Layout/annotation.d.ts +0 -30
  234. package/dist/types/src/components/Form/Layout/annotation.d.ts.map +0 -1
  235. package/dist/types/src/components/Form/Layout/index.d.ts +0 -4
  236. package/dist/types/src/components/Form/Layout/index.d.ts.map +0 -1
  237. package/dist/types/src/components/Form/Layout/parser.d.ts.map +0 -1
  238. package/dist/types/src/components/Form/Layout/parser.test.d.ts.map +0 -1
  239. package/dist/types/src/components/Form/fields/ArrayField.d.ts.map +0 -1
  240. package/dist/types/src/components/Form/fields/BooleanField.d.ts +0 -4
  241. package/dist/types/src/components/Form/fields/BooleanField.d.ts.map +0 -1
  242. package/dist/types/src/components/Form/fields/DateField.d.ts +0 -4
  243. package/dist/types/src/components/Form/fields/DateField.d.ts.map +0 -1
  244. package/dist/types/src/components/Form/fields/GeoPointField.d.ts.map +0 -1
  245. package/dist/types/src/components/Form/fields/InlineRefField.d.ts.map +0 -1
  246. package/dist/types/src/components/Form/fields/MarkdownField.d.ts.map +0 -1
  247. package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts.map +0 -1
  248. package/dist/types/src/components/Form/fields/NumberField.d.ts +0 -4
  249. package/dist/types/src/components/Form/fields/NumberField.d.ts.map +0 -1
  250. package/dist/types/src/components/Form/fields/RefField.d.ts +0 -34
  251. package/dist/types/src/components/Form/fields/RefField.d.ts.map +0 -1
  252. package/dist/types/src/components/Form/fields/RefField.test.d.ts.map +0 -1
  253. package/dist/types/src/components/Form/fields/SelectField.d.ts.map +0 -1
  254. package/dist/types/src/components/Form/fields/SelectOptionField.d.ts +0 -5
  255. package/dist/types/src/components/Form/fields/SelectOptionField.d.ts.map +0 -1
  256. package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts.map +0 -1
  257. package/dist/types/src/components/Form/fields/TextAreaField.d.ts +0 -4
  258. package/dist/types/src/components/Form/fields/TextAreaField.d.ts.map +0 -1
  259. package/dist/types/src/components/Form/fields/TextField.d.ts +0 -4
  260. package/dist/types/src/components/Form/fields/TextField.d.ts.map +0 -1
  261. package/dist/types/src/components/Form/fields/TupleField.d.ts.map +0 -1
  262. package/dist/types/src/components/Form/fields/index.d.ts.map +0 -1
  263. package/dist/types/src/components/testing.d.ts.map +0 -1
  264. package/src/components/Form/AUDIT.md +0 -17
  265. package/src/components/Form/FormTooltipsContext.ts +0 -25
  266. package/src/components/Form/Layout/annotation.ts +0 -38
  267. package/src/components/Form/README.md +0 -3
  268. package/src/components/Form/fields/ArrayField.tsx +0 -173
  269. /package/dist/types/src/components/Form/{fields → FormField/fields/MarkdownField}/MarkdownField.stories.d.ts +0 -0
  270. /package/dist/types/src/components/Form/{fields → FormField/fields/RefField}/InlineRefField.d.ts +0 -0
  271. /package/dist/types/src/components/Form/{fields → FormField/fields/RefField}/RefField.test.d.ts +0 -0
  272. /package/dist/types/src/components/Form/{fields → FormField/fields/SelectOptionField}/SelectOptionField.stories.d.ts +0 -0
  273. /package/dist/types/src/components/Form/{Layout → FormLayout}/FormLayout.d.ts +0 -0
  274. /package/dist/types/src/components/Form/{Layout → FormLayout}/FormLayout.stories.d.ts +0 -0
  275. /package/dist/types/src/components/Form/{Layout → FormLayout}/FormLayout.stories.test.d.ts +0 -0
  276. /package/dist/types/src/components/Form/{Layout → FormLayout}/FormLayout.test.d.ts +0 -0
  277. /package/dist/types/src/components/Form/{Layout → FormLayout}/parser.d.ts +0 -0
  278. /package/dist/types/src/components/Form/{Layout → FormLayout}/parser.test.d.ts +0 -0
  279. /package/src/components/Form/{Layout → FormLayout}/FormLayout.stories.test.tsx +0 -0
  280. /package/src/components/Form/{Layout → FormLayout}/FormLayout.test.ts +0 -0
  281. /package/src/components/Form/{Layout → FormLayout}/parser.test.ts +0 -0
  282. /package/src/components/Form/{Layout → FormLayout}/parser.ts +0 -0
@@ -0,0 +1,37 @@
1
+ import { type AnyProperties } from '@dxos/echo/internal';
2
+ import { type CreateOptions, type FormFieldOptions, type FormFieldStateProps } from '#types';
3
+ import { type FormHandler } from './useFormHandler';
4
+ export type FormContextValue<T extends AnyProperties = any> = {
5
+ /**
6
+ * Form handler.
7
+ */
8
+ form: FormHandler<T>;
9
+ /**
10
+ * Testing.
11
+ */
12
+ testId?: string;
13
+ } & FormFieldOptions & Pick<CreateOptions, 'createFieldMap'>;
14
+ export declare const FormContextProvider: import("react").FC<{
15
+ /**
16
+ * Form handler.
17
+ */
18
+ form: FormHandler<any>;
19
+ /**
20
+ * Testing.
21
+ */
22
+ testId?: string;
23
+ } & FormFieldOptions & Pick<CreateOptions, "createFieldMap"> & {
24
+ children: React.ReactNode;
25
+ }>, useFormContext: (consumerName: string) => FormContextValue<any>;
26
+ /**
27
+ * Get the current form values.
28
+ */
29
+ export declare const useFormValues: {
30
+ <T extends AnyProperties>(componentName: string, path?: (string | number)[]): T;
31
+ <T extends AnyProperties>(componentName: string, path: (string | number)[] | undefined, defaultValue: () => T): T | undefined;
32
+ };
33
+ /**
34
+ * Get the state props for the given field.
35
+ */
36
+ export declare const useFormFieldState: (componentName: string, path?: (string | number)[]) => FormFieldStateProps;
37
+ //# sourceMappingURL=useFormContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormContext.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useFormContext.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAE7F,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAMpD,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,aAAa,GAAG,GAAG,IAAI;IAC5D;;OAEG;IACH,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IAErB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,gBAAgB,GAClB,IAAI,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;AAExC,eAAO,MAAO,mBAAmB;IAZ/B;;OAEG;;IAGH;;OAEG;aACM,MAAM;;;IAIkB,cAAc,iDAA2C,CAAC;AAE7F;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE;IAC1B,CAAC,CAAC,SAAS,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;IAChF,CAAC,CAAC,SAAS,aAAa,EACtB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,SAAS,EACrC,YAAY,EAAE,MAAM,CAAC,GACpB,CAAC,GAAG,SAAS,CAAC;CAsBlB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,kBAAmB,MAAM,SAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAQ,mBAezF,CAAC"}
@@ -4,10 +4,7 @@ import { type AnyProperties } from '@dxos/echo/internal';
4
4
  import { SchemaEx } from '@dxos/effect';
5
5
  import { type ValidationError } from '@dxos/schema';
6
6
  import { type MaybePromise } from '@dxos/util';
7
- export type FormFieldStatus = {
8
- status?: 'error';
9
- error?: string;
10
- };
7
+ import { type FormFieldStatus } from '#types';
11
8
  /**
12
9
  * Form properties.
13
10
  */
@@ -1 +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,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,CA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
2
  export * from './hooks';
3
+ export * from './types';
3
4
  export * from './util';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
@@ -16,4 +16,4 @@ export declare const VIEW_EDITOR_DEBUG_SYMBOL: unique symbol;
16
16
  export declare const FIELD_EDITOR_DEBUG_SYMBOL: unique symbol;
17
17
  export declare const OBJECT_PROPERTIES_DEBUG_SYMBOL: unique symbol;
18
18
  export {};
19
- //# sourceMappingURL=testing.d.ts.map
19
+ //# sourceMappingURL=TestLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestLayout.d.ts","sourceRoot":"","sources":["../../../../src/testing/TestLayout.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"}
@@ -0,0 +1,3 @@
1
+ export * from './schema';
2
+ export * from './TestLayout';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AAEzB,cAAc,cAAc,CAAC"}
@@ -0,0 +1,43 @@
1
+ import * as Schema from 'effect/Schema';
2
+ import { Type } from '@dxos/echo';
3
+ /**
4
+ * Shared test schemas for form stories. Intentionally small, hand-written types
5
+ * (not `@dxos/types`) exercising the range of field renderers: scalars, nested
6
+ * structs, refs, ref arrays, enums, and the various formats.
7
+ */
8
+ export declare const Organization: Type.Obj<{
9
+ readonly name: string;
10
+ }, Schema.Struct.Fields>;
11
+ export type Organization = Type.InstanceType<typeof Organization>;
12
+ export declare const Person: Type.Obj<{
13
+ readonly name: string;
14
+ readonly ignore?: string | undefined;
15
+ readonly active?: boolean | undefined;
16
+ readonly address?: {
17
+ readonly street: string;
18
+ readonly city: string;
19
+ readonly state: string;
20
+ readonly zip: number;
21
+ } | undefined;
22
+ readonly employer?: import("@dxos/echo/internal").Ref<{
23
+ readonly name: string;
24
+ } & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown> | undefined;
25
+ readonly tags?: readonly import("@dxos/echo/internal").Ref<{
26
+ readonly label: string;
27
+ readonly hue?: string | undefined;
28
+ } & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown>[] | undefined;
29
+ readonly status?: "active" | "inactive" | undefined;
30
+ readonly notes?: string | undefined;
31
+ readonly location?: readonly [number, number, (number | undefined)?] | undefined;
32
+ readonly birthday?: string | undefined;
33
+ readonly meetingAt?: string | undefined;
34
+ readonly reminderAt?: string | undefined;
35
+ readonly tasks?: readonly string[] | undefined;
36
+ readonly locations?: readonly (readonly [number, number, (number | undefined)?])[] | undefined;
37
+ readonly identities?: readonly {
38
+ readonly type: string;
39
+ readonly value: string;
40
+ }[] | undefined;
41
+ }, Schema.Struct.Fields>;
42
+ export type Person = Type.InstanceType<typeof Person>;
43
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/testing/schema.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAqC,IAAI,EAAE,MAAM,YAAY,CAAC;AAErE;;;;GAIG;AAEH,eAAO,MAAM,YAAY;;wBAEmD,CAAC;AAE7E,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC;AAElE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAoCgD,CAAC;AAEpE,MAAM,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,MAAM,CAAC,CAAC"}
@@ -0,0 +1,112 @@
1
+ import type * as Schema from 'effect/Schema';
2
+ import type * as SchemaAST from 'effect/SchemaAST';
3
+ import { type FC, type FocusEvent, type ReactElement } from 'react';
4
+ import { type Database, type Entity, type Format, type Obj, type Type } from '@dxos/echo';
5
+ import { type URI } from '@dxos/keys';
6
+ import { type Palette } from '@dxos/react-ui';
7
+ import { type ProjectionModel } from '@dxos/schema';
8
+ /**
9
+ * Validation status of a field.
10
+ */
11
+ export type FormFieldStatus = {
12
+ status?: 'error';
13
+ error?: string;
14
+ };
15
+ /**
16
+ * FormPresentation mode.
17
+ * - full: Show label, control, and status.
18
+ * - compact: Show label and control.
19
+ * - inline: Control only.
20
+ * - static: Plain DOM; omit all undefined values.
21
+ */
22
+ export type FormPresentation = 'full' | 'compact' | 'inline' | 'static';
23
+ /**
24
+ * Dynamic props passed to input components.
25
+ */
26
+ export type FormFieldStateProps<T = any> = {
27
+ getStatus: () => FormFieldStatus;
28
+ getValue: () => T | undefined;
29
+ onBlur: (event: FocusEvent<HTMLElement>) => void;
30
+ onValueChange: (type: SchemaAST.AST, value: T) => void;
31
+ };
32
+ /**
33
+ * Props passed to input components.
34
+ */
35
+ export type FormFieldRendererProps<T = any> = {
36
+ /** Database the form is editing against; populated for fields whose value is an ECHO object/Ref. */
37
+ db?: Database.Database;
38
+ type: SchemaAST.AST;
39
+ format?: Format.TypeFormat;
40
+ readonly?: boolean;
41
+ label: string;
42
+ /**
43
+ * Dotted JSON path of this field within the form values (e.g. `runtime.client.storage.persistent`).
44
+ */
45
+ jsonPath?: string;
46
+ placeholder?: string;
47
+ autoFocus?: boolean;
48
+ layout?: FormPresentation;
49
+ } & FormFieldStateProps<T>;
50
+ export type FormFieldRenderer = FC<FormFieldRendererProps>;
51
+ export type FormFieldMap = Record<string, FormFieldRenderer>;
52
+ export type FormFieldProvider = (props: {
53
+ prop: string;
54
+ schema: Schema.Schema<any>;
55
+ fieldProps: FormFieldRendererProps;
56
+ }) => ReactElement | null | undefined;
57
+ /**
58
+ * Configuration for the inline "create a new referenced object" affordance, shared by every
59
+ * surface that can spawn a ref target (the picker, `RefField`, and the `Form*` props that forward
60
+ * to them). `onCreate` is intentionally NOT part of this group: its signature differs per consumer
61
+ * (the picker takes `(values)`, `RefField` takes `(schema, values)`).
62
+ */
63
+ export type CreateOptions = {
64
+ createOptionLabel?: [string, {
65
+ ns: string | readonly string[];
66
+ }];
67
+ createOptionIcon?: string;
68
+ createInitialValuePath?: string;
69
+ createFieldMap?: FormFieldMap;
70
+ };
71
+ export type RefOption = {
72
+ id: string;
73
+ label: string;
74
+ hue?: Palette;
75
+ };
76
+ /**
77
+ * Data plumbing for resolving and creating ref targets: how to look up the ref type, query
78
+ * candidate objects, map them to options, and persist a newly-created one.
79
+ */
80
+ export type RefFieldDataProps = {
81
+ useType?: (db?: Database.Database, typeUri?: URI.URI) => Type.AnyEntity;
82
+ useResults?: (db?: Database.Database, typename?: string) => Entity.Any[];
83
+ getOptions?: (objects: Entity.Any[], options?: {
84
+ parentLabel?: boolean;
85
+ getTypePlaceholder?: (typename: string) => string;
86
+ }) => RefOption[];
87
+ /**
88
+ * Persist a newly-created object. Called after the user fills out the inline create form and
89
+ * clicks Save. Should add the object to the database and return it (sync or async). The returned
90
+ * object is then wired into this slot's form value as a Ref.
91
+ */
92
+ onCreate?: (schema: Type.AnyEntity, values: any) => Obj.Unknown | Promise<Obj.Unknown> | undefined | void;
93
+ };
94
+ /**
95
+ * Form-wide field options carried by the form context and threaded down to every field. The
96
+ * canonical source for the config that `FormContextValue`, `FormFieldProps`, and `FormFieldSetProps`
97
+ * all share — so none of them has to reach "up" into another's props to express it.
98
+ */
99
+ export type FormFieldOptions = {
100
+ db?: Database.Database;
101
+ readonly?: boolean;
102
+ layout?: FormPresentation;
103
+ projection?: ProjectionModel;
104
+ fieldMap?: FormFieldMap;
105
+ fieldProvider?: FormFieldProvider;
106
+ /**
107
+ * Typename of the ref type that the create props apply to.
108
+ * When set, the create affordance is only offered to ref fields whose typename matches.
109
+ */
110
+ createTypename?: string;
111
+ };
112
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,SAAS,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,GAAG,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAC1F,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAMpD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,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CAAC,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;CAC3G,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  export * from './field';
2
2
  export * from './field-type';
3
3
  export * from './formatting';
4
+ export * from './omit';
4
5
  export * from './properties';
5
6
  export * from './refs';
6
7
  //# 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,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,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;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,12 @@
1
+ import * as Schema from 'effect/Schema';
2
+ import { Type } from '@dxos/echo';
3
+ export type ExcludeId<S extends Schema.Schema.AnyNoContext | Type.AnyEntity> = Omit<S extends Type.AnyEntity ? Type.InstanceType<S> : S extends Schema.Schema.AnyNoContext ? Schema.Schema.Type<S> : never, 'id'>;
4
+ export declare const omitId: <S extends Schema.Schema.AnyNoContext | Type.AnyEntity>(schemaOrType: S) => Schema.Schema<ExcludeId<S>, ExcludeId<S>>;
5
+ /**
6
+ * Drop fields annotated with `FormInputAnnotation.set(false)` from a schema so
7
+ * the form's validator doesn't trip on required-but-hidden fields. Used by
8
+ * the picker's inline create form, where a `FactoryAnnotation` typically
9
+ * supplies the hidden values (e.g. a backing-object Ref) outside the form.
10
+ */
11
+ export declare const omitHiddenFormFields: <S extends Schema.Schema.AnyNoContext>(schema: S) => S;
12
+ //# sourceMappingURL=omit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omit.d.ts","sourceRoot":"","sources":["../../../../src/util/omit.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAc,IAAI,EAAE,MAAM,YAAY,CAAC;AAG9C,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CACjF,CAAC,SAAS,IAAI,CAAC,SAAS,GACpB,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,GACpB,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,YAAY,GAClC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GACrB,KAAK,EACX,IAAI,CACL,CAAC;AAGF,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,gBAC5D,CAAC,KACd,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAO1C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,YAAY,UAAU,CAAC,KAAG,CAQtF,CAAC"}