@dxos/react-ui-form 0.8.4-main.fffef41 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +0 -1
  3. package/dist/lib/browser/index.mjs +4005 -2402
  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 +87 -0
  7. package/dist/lib/browser/translations.mjs.map +7 -0
  8. package/dist/lib/node-esm/index.mjs +4005 -2402
  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 +89 -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 +73 -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 +135 -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 +192 -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 +52 -0
  22. package/dist/types/src/components/Form/FormField.d.ts.map +1 -0
  23. package/dist/types/src/components/Form/FormFieldComponent.d.ts +98 -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 +26 -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 +50 -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 +123 -0
  34. package/dist/types/src/components/Form/Layout/FormLayout.stories.d.ts.map +1 -0
  35. package/dist/types/src/components/Form/Layout/FormLayout.stories.test.d.ts +2 -0
  36. package/dist/types/src/components/Form/Layout/FormLayout.stories.test.d.ts.map +1 -0
  37. package/dist/types/src/components/Form/Layout/FormLayout.test.d.ts +2 -0
  38. package/dist/types/src/components/Form/Layout/FormLayout.test.d.ts.map +1 -0
  39. package/dist/types/src/components/Form/Layout/annotation.d.ts +30 -0
  40. package/dist/types/src/components/Form/Layout/annotation.d.ts.map +1 -0
  41. package/dist/types/src/components/Form/Layout/index.d.ts +4 -0
  42. package/dist/types/src/components/Form/Layout/index.d.ts.map +1 -0
  43. package/dist/types/src/components/Form/Layout/parser.d.ts +31 -0
  44. package/dist/types/src/components/Form/Layout/parser.d.ts.map +1 -0
  45. package/dist/types/src/components/Form/Layout/parser.test.d.ts +2 -0
  46. package/dist/types/src/components/Form/Layout/parser.test.d.ts.map +1 -0
  47. package/dist/types/src/components/Form/fields/ArrayField.d.ts +18 -0
  48. package/dist/types/src/components/Form/fields/ArrayField.d.ts.map +1 -0
  49. package/dist/types/src/components/Form/fields/BooleanField.d.ts +4 -0
  50. package/dist/types/src/components/Form/fields/BooleanField.d.ts.map +1 -0
  51. package/dist/types/src/components/Form/fields/DateField.d.ts +4 -0
  52. package/dist/types/src/components/Form/fields/DateField.d.ts.map +1 -0
  53. package/dist/types/src/components/Form/fields/GeoPointField.d.ts +5 -0
  54. package/dist/types/src/components/Form/fields/GeoPointField.d.ts.map +1 -0
  55. package/dist/types/src/components/Form/fields/InlineRefField.d.ts +13 -0
  56. package/dist/types/src/components/Form/fields/InlineRefField.d.ts.map +1 -0
  57. package/dist/types/src/components/Form/fields/MarkdownField.d.ts +11 -0
  58. package/dist/types/src/components/Form/fields/MarkdownField.d.ts.map +1 -0
  59. package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts +89 -0
  60. package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts.map +1 -0
  61. package/dist/types/src/components/Form/fields/NumberField.d.ts +4 -0
  62. package/dist/types/src/components/Form/fields/NumberField.d.ts.map +1 -0
  63. package/dist/types/src/components/Form/fields/RefField.d.ts +34 -0
  64. package/dist/types/src/components/Form/fields/RefField.d.ts.map +1 -0
  65. package/dist/types/src/components/Form/fields/RefField.test.d.ts +2 -0
  66. package/dist/types/src/components/Form/fields/RefField.test.d.ts.map +1 -0
  67. package/dist/types/src/components/Form/fields/SelectField.d.ts +13 -0
  68. package/dist/types/src/components/Form/fields/SelectField.d.ts.map +1 -0
  69. package/dist/types/src/components/Form/fields/SelectOptionField.d.ts +5 -0
  70. package/dist/types/src/components/Form/fields/SelectOptionField.d.ts.map +1 -0
  71. package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts +89 -0
  72. package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts.map +1 -0
  73. package/dist/types/src/components/Form/fields/TextAreaField.d.ts +4 -0
  74. package/dist/types/src/components/Form/fields/TextAreaField.d.ts.map +1 -0
  75. package/dist/types/src/components/Form/fields/TextField.d.ts +4 -0
  76. package/dist/types/src/components/Form/fields/TextField.d.ts.map +1 -0
  77. package/dist/types/src/components/Form/fields/TupleField.d.ts +6 -0
  78. package/dist/types/src/components/Form/fields/TupleField.d.ts.map +1 -0
  79. package/dist/types/src/components/Form/fields/index.d.ts +14 -0
  80. package/dist/types/src/components/Form/fields/index.d.ts.map +1 -0
  81. package/dist/types/src/components/Form/index.d.ts +5 -4
  82. package/dist/types/src/components/Form/index.d.ts.map +1 -1
  83. package/dist/types/src/components/Form/meta-tags.d.ts +30 -0
  84. package/dist/types/src/components/Form/meta-tags.d.ts.map +1 -0
  85. package/dist/types/src/components/Form/meta-tags.test.d.ts +2 -0
  86. package/dist/types/src/components/Form/meta-tags.test.d.ts.map +1 -0
  87. package/dist/types/src/components/ObjectForm/ObjectForm.d.ts +8 -0
  88. package/dist/types/src/components/ObjectForm/ObjectForm.d.ts.map +1 -0
  89. package/dist/types/src/components/ObjectForm/ObjectForm.stories.d.ts +87 -0
  90. package/dist/types/src/components/ObjectForm/ObjectForm.stories.d.ts.map +1 -0
  91. package/dist/types/src/components/ObjectForm/index.d.ts +2 -0
  92. package/dist/types/src/components/ObjectForm/index.d.ts.map +1 -0
  93. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts +39 -12
  94. package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -1
  95. package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts +69 -58
  96. package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts.map +1 -1
  97. package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts +9 -0
  98. package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts.map +1 -0
  99. package/dist/types/src/components/ObjectProperties/ObjectProperties.stories.d.ts +132 -0
  100. package/dist/types/src/components/ObjectProperties/ObjectProperties.stories.d.ts.map +1 -0
  101. package/dist/types/src/components/ObjectProperties/ObjectProperties.test.d.ts +2 -0
  102. package/dist/types/src/components/ObjectProperties/ObjectProperties.test.d.ts.map +1 -0
  103. package/dist/types/src/components/ObjectProperties/index.d.ts +2 -0
  104. package/dist/types/src/components/ObjectProperties/index.d.ts.map +1 -0
  105. package/dist/types/src/components/ObjectTree/ObjectTree.d.ts +9 -0
  106. package/dist/types/src/components/ObjectTree/ObjectTree.d.ts.map +1 -0
  107. package/dist/types/src/components/ObjectTree/ObjectTree.stories.d.ts +91 -0
  108. package/dist/types/src/components/ObjectTree/ObjectTree.stories.d.ts.map +1 -0
  109. package/dist/types/src/components/ObjectTree/index.d.ts +2 -0
  110. package/dist/types/src/components/ObjectTree/index.d.ts.map +1 -0
  111. package/dist/types/src/components/RefEditor/RefEditor.d.ts +73 -0
  112. package/dist/types/src/components/RefEditor/RefEditor.d.ts.map +1 -0
  113. package/dist/types/src/components/RefEditor/RefEditor.stories.d.ts +92 -0
  114. package/dist/types/src/components/RefEditor/RefEditor.stories.d.ts.map +1 -0
  115. package/dist/types/src/components/RefEditor/index.d.ts +3 -0
  116. package/dist/types/src/components/RefEditor/index.d.ts.map +1 -0
  117. package/dist/types/src/components/RefEditor/ref-editor-extension.d.ts +47 -0
  118. package/dist/types/src/components/RefEditor/ref-editor-extension.d.ts.map +1 -0
  119. package/dist/types/src/components/Settings/Settings.d.ts +51 -0
  120. package/dist/types/src/components/Settings/Settings.d.ts.map +1 -0
  121. package/dist/types/src/components/Settings/Settings.stories.d.ts +89 -0
  122. package/dist/types/src/components/Settings/Settings.stories.d.ts.map +1 -0
  123. package/dist/types/src/components/Settings/SettingsFieldSet.d.ts +43 -0
  124. package/dist/types/src/components/Settings/SettingsFieldSet.d.ts.map +1 -0
  125. package/dist/types/src/components/Settings/SettingsItem.d.ts +16 -0
  126. package/dist/types/src/components/Settings/SettingsItem.d.ts.map +1 -0
  127. package/dist/types/src/components/Settings/SettingsSelectField.d.ts +18 -0
  128. package/dist/types/src/components/Settings/SettingsSelectField.d.ts.map +1 -0
  129. package/dist/types/src/components/Settings/index.d.ts +4 -0
  130. package/dist/types/src/components/Settings/index.d.ts.map +1 -0
  131. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +15 -19
  132. package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
  133. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +75 -64
  134. package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
  135. package/dist/types/src/components/index.d.ts +5 -1
  136. package/dist/types/src/components/index.d.ts.map +1 -1
  137. package/dist/types/src/components/testing.d.ts +13 -6
  138. package/dist/types/src/components/testing.d.ts.map +1 -1
  139. package/dist/types/src/hooks/index.d.ts +2 -3
  140. package/dist/types/src/hooks/index.d.ts.map +1 -1
  141. package/dist/types/src/hooks/useFormHandler.d.ts +82 -0
  142. package/dist/types/src/hooks/useFormHandler.d.ts.map +1 -0
  143. package/dist/types/src/hooks/useKeyHandler.d.ts +7 -0
  144. package/dist/types/src/hooks/useKeyHandler.d.ts.map +1 -0
  145. package/dist/types/src/index.d.ts +0 -2
  146. package/dist/types/src/index.d.ts.map +1 -1
  147. package/dist/types/src/translations.d.ts +70 -59
  148. package/dist/types/src/translations.d.ts.map +1 -1
  149. package/dist/types/src/util/field-type.d.ts +19 -0
  150. package/dist/types/src/util/field-type.d.ts.map +1 -0
  151. package/dist/types/src/util/field.d.ts +3 -3
  152. package/dist/types/src/util/field.d.ts.map +1 -1
  153. package/dist/types/src/util/formatting.d.ts +2 -2
  154. package/dist/types/src/util/formatting.d.ts.map +1 -1
  155. package/dist/types/src/util/index.d.ts +2 -1
  156. package/dist/types/src/util/index.d.ts.map +1 -1
  157. package/dist/types/src/util/properties.d.ts +35 -0
  158. package/dist/types/src/util/properties.d.ts.map +1 -0
  159. package/dist/types/src/util/properties.test.d.ts +2 -0
  160. package/dist/types/src/util/properties.test.d.ts.map +1 -0
  161. package/dist/types/src/util/refs.d.ts +2 -2
  162. package/dist/types/src/util/refs.d.ts.map +1 -1
  163. package/dist/types/tsconfig.tsbuildinfo +1 -1
  164. package/package.json +64 -52
  165. package/src/components/FieldEditor/FieldEditor.stories.tsx +44 -25
  166. package/src/components/FieldEditor/FieldEditor.test.tsx +4 -2
  167. package/src/components/FieldEditor/FieldEditor.tsx +91 -86
  168. package/src/components/Form/AUDIT.md +17 -0
  169. package/src/components/Form/Form.stories.tsx +147 -252
  170. package/src/components/Form/Form.tsx +461 -108
  171. package/src/components/Form/FormField.tsx +345 -0
  172. package/src/components/Form/FormFieldComponent.stories.tsx +65 -0
  173. package/src/components/Form/FormFieldComponent.tsx +253 -0
  174. package/src/components/Form/FormFieldSet.tsx +213 -0
  175. package/src/components/Form/FormTooltipsContext.ts +25 -0
  176. package/src/components/Form/Layout/FormLayout.stories.test.tsx +51 -0
  177. package/src/components/Form/Layout/FormLayout.stories.tsx +422 -0
  178. package/src/components/Form/Layout/FormLayout.test.ts +59 -0
  179. package/src/components/Form/Layout/FormLayout.tsx +251 -0
  180. package/src/components/Form/Layout/annotation.ts +38 -0
  181. package/src/components/Form/Layout/index.ts +7 -0
  182. package/src/components/Form/Layout/parser.test.ts +120 -0
  183. package/src/components/Form/Layout/parser.ts +167 -0
  184. package/src/components/Form/README.md +3 -0
  185. package/src/components/Form/fields/ArrayField.tsx +173 -0
  186. package/src/components/Form/fields/BooleanField.tsx +22 -0
  187. package/src/components/Form/fields/DateField.tsx +101 -0
  188. package/src/components/Form/fields/GeoPointField.tsx +124 -0
  189. package/src/components/Form/fields/InlineRefField.tsx +138 -0
  190. package/src/components/Form/fields/MarkdownField.stories.tsx +206 -0
  191. package/src/components/Form/fields/MarkdownField.tsx +167 -0
  192. package/src/components/Form/fields/NumberField.tsx +76 -0
  193. package/src/components/Form/fields/RefField.test.ts +45 -0
  194. package/src/components/Form/fields/RefField.tsx +266 -0
  195. package/src/components/Form/fields/SelectField.tsx +77 -0
  196. package/src/components/Form/{custom/SelectOptionsInput.stories.tsx → fields/SelectOptionField.stories.tsx} +23 -18
  197. package/src/components/Form/{custom/SelectOptionsInput.tsx → fields/SelectOptionField.tsx} +33 -26
  198. package/src/components/Form/fields/TextAreaField.tsx +38 -0
  199. package/src/components/Form/fields/TextField.tsx +38 -0
  200. package/src/components/Form/{custom/TupleInput.tsx → fields/TupleField.tsx} +17 -9
  201. package/src/components/Form/fields/index.ts +17 -0
  202. package/src/components/Form/index.ts +6 -4
  203. package/src/components/Form/meta-tags.test.ts +47 -0
  204. package/src/components/Form/meta-tags.ts +33 -0
  205. package/src/components/ObjectForm/ObjectForm.stories.tsx +62 -0
  206. package/src/components/ObjectForm/ObjectForm.tsx +111 -0
  207. package/src/components/{ControlSection → ObjectForm}/index.ts +1 -1
  208. package/src/components/ObjectPicker/ObjectPicker.stories.tsx +26 -21
  209. package/src/components/ObjectPicker/ObjectPicker.tsx +123 -82
  210. package/src/components/ObjectProperties/ObjectProperties.stories.tsx +350 -0
  211. package/src/components/ObjectProperties/ObjectProperties.test.tsx +111 -0
  212. package/src/components/ObjectProperties/ObjectProperties.tsx +146 -0
  213. package/src/components/ObjectProperties/index.ts +5 -0
  214. package/src/components/ObjectTree/ObjectTree.stories.tsx +134 -0
  215. package/src/components/ObjectTree/ObjectTree.tsx +190 -0
  216. package/src/components/ObjectTree/index.ts +5 -0
  217. package/src/components/RefEditor/RefEditor.stories.tsx +148 -0
  218. package/src/components/RefEditor/RefEditor.tsx +275 -0
  219. package/src/components/RefEditor/index.ts +6 -0
  220. package/src/components/RefEditor/ref-editor-extension.ts +254 -0
  221. package/src/components/Settings/AUDIT.md +51 -0
  222. package/src/components/Settings/Settings.stories.tsx +104 -0
  223. package/src/components/Settings/Settings.tsx +81 -0
  224. package/src/components/Settings/SettingsFieldSet.tsx +257 -0
  225. package/src/components/Settings/SettingsItem.tsx +58 -0
  226. package/src/components/Settings/SettingsSelectField.tsx +59 -0
  227. package/src/components/Settings/index.ts +7 -0
  228. package/src/components/ViewEditor/ViewEditor.stories.tsx +70 -76
  229. package/src/components/ViewEditor/ViewEditor.test.tsx +17 -13
  230. package/src/components/ViewEditor/ViewEditor.tsx +340 -226
  231. package/src/components/index.ts +5 -1
  232. package/src/components/testing.tsx +24 -11
  233. package/src/hooks/index.ts +2 -3
  234. package/src/hooks/useFormHandler.ts +380 -0
  235. package/src/hooks/useKeyHandler.tsx +37 -0
  236. package/src/index.ts +0 -4
  237. package/src/translations.ts +76 -64
  238. package/src/util/field-type.ts +60 -0
  239. package/src/util/field.ts +25 -25
  240. package/src/util/formatting.ts +22 -22
  241. package/src/util/index.ts +2 -1
  242. package/src/util/properties.test.ts +153 -0
  243. package/src/util/properties.ts +100 -0
  244. package/src/util/refs.ts +16 -15
  245. package/src/vite-env.d.ts +10 -0
  246. package/dist/types/src/components/ControlSection/ControlSection.d.ts +0 -23
  247. package/dist/types/src/components/ControlSection/ControlSection.d.ts.map +0 -1
  248. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts +0 -83
  249. package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts.map +0 -1
  250. package/dist/types/src/components/ControlSection/index.d.ts +0 -2
  251. package/dist/types/src/components/ControlSection/index.d.ts.map +0 -1
  252. package/dist/types/src/components/Form/ArrayField.d.ts +0 -16
  253. package/dist/types/src/components/Form/ArrayField.d.ts.map +0 -1
  254. package/dist/types/src/components/Form/Defaults.d.ts +0 -14
  255. package/dist/types/src/components/Form/Defaults.d.ts.map +0 -1
  256. package/dist/types/src/components/Form/FormActions.d.ts +0 -9
  257. package/dist/types/src/components/Form/FormActions.d.ts.map +0 -1
  258. package/dist/types/src/components/Form/FormContent.d.ts +0 -63
  259. package/dist/types/src/components/Form/FormContent.d.ts.map +0 -1
  260. package/dist/types/src/components/Form/FormContext.d.ts +0 -23
  261. package/dist/types/src/components/Form/FormContext.d.ts.map +0 -1
  262. package/dist/types/src/components/Form/Input.d.ts +0 -29
  263. package/dist/types/src/components/Form/Input.d.ts.map +0 -1
  264. package/dist/types/src/components/Form/RefField.d.ts +0 -22
  265. package/dist/types/src/components/Form/RefField.d.ts.map +0 -1
  266. package/dist/types/src/components/Form/custom/GeoPointInput.d.ts +0 -4
  267. package/dist/types/src/components/Form/custom/GeoPointInput.d.ts.map +0 -1
  268. package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts +0 -4
  269. package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts.map +0 -1
  270. package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts +0 -78
  271. package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts.map +0 -1
  272. package/dist/types/src/components/Form/custom/TupleInput.d.ts +0 -6
  273. package/dist/types/src/components/Form/custom/TupleInput.d.ts.map +0 -1
  274. package/dist/types/src/components/Form/custom/index.d.ts +0 -4
  275. package/dist/types/src/components/Form/custom/index.d.ts.map +0 -1
  276. package/dist/types/src/components/Form/factory.d.ts +0 -8
  277. package/dist/types/src/components/Form/factory.d.ts.map +0 -1
  278. package/dist/types/src/hooks/useForm.d.ts +0 -67
  279. package/dist/types/src/hooks/useForm.d.ts.map +0 -1
  280. package/dist/types/src/hooks/useQueryRefOptions.d.ts +0 -29
  281. package/dist/types/src/hooks/useQueryRefOptions.d.ts.map +0 -1
  282. package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts +0 -8
  283. package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts.map +0 -1
  284. package/dist/types/src/util/schema.d.ts +0 -3
  285. package/dist/types/src/util/schema.d.ts.map +0 -1
  286. package/src/components/ControlSection/ControlSection.stories.tsx +0 -38
  287. package/src/components/ControlSection/ControlSection.tsx +0 -153
  288. package/src/components/Form/ArrayField.tsx +0 -125
  289. package/src/components/Form/Defaults.tsx +0 -205
  290. package/src/components/Form/FormActions.tsx +0 -54
  291. package/src/components/Form/FormContent.tsx +0 -362
  292. package/src/components/Form/FormContext.tsx +0 -110
  293. package/src/components/Form/Input.tsx +0 -54
  294. package/src/components/Form/RefField.tsx +0 -283
  295. package/src/components/Form/custom/GeoPointInput.tsx +0 -80
  296. package/src/components/Form/custom/index.ts +0 -7
  297. package/src/components/Form/factory.tsx +0 -31
  298. package/src/hooks/useForm.ts +0 -296
  299. package/src/hooks/useQueryRefOptions.ts +0 -62
  300. package/src/hooks/useRefQueryLookupHandler.ts +0 -39
  301. package/src/util/schema.ts +0 -12
@@ -0,0 +1,132 @@
1
+ import { type StoryObj } from '@storybook/react-vite';
2
+ import { Obj } from '@dxos/echo';
3
+ import { useClientStory } from '@dxos/react-client/testing';
4
+ export type ObjectPropertiesDebug = {
5
+ /** Live database the story is rendering against. */
6
+ db: ReturnType<typeof useClientStory>['space'] extends infer S ? (S extends {
7
+ db: infer D;
8
+ } ? D : never) : never;
9
+ /** Object whose properties are being edited. */
10
+ object: Obj.Unknown;
11
+ };
12
+ declare const meta: {
13
+ title: string;
14
+ component: any;
15
+ decorators: import("@storybook/react").Decorator[];
16
+ parameters: {
17
+ layout: string;
18
+ translations: [{
19
+ readonly 'en-US': {
20
+ readonly "@dxos/react-ui-form": {
21
+ readonly 'ref-editor.placeholder': "Type '@' to add a reference, or enter a value";
22
+ readonly 'ref-editor-auto.placeholder': 'Search by name, or enter a value';
23
+ readonly 'fields.label': 'Fields';
24
+ readonly 'hidden-fields.label': 'Hidden Fields';
25
+ readonly 'empty-readonly-ref-field.label': '(none)';
26
+ readonly 'field-property.label': 'Property';
27
+ readonly 'field-property.placeholder': 'Property name';
28
+ readonly 'field-format.label': 'Type';
29
+ readonly 'field-path.label': 'Field path';
30
+ readonly 'remove-item.button': 'Delete item';
31
+ readonly 'add-item.button': 'Add item';
32
+ readonly 'add-property-button.label': 'Add property';
33
+ readonly 'boolean-input-true.value': 'Yes';
34
+ readonly 'boolean-input-false.value': 'No';
35
+ readonly 'show-field.label': 'Show field';
36
+ readonly 'hide-field.label': 'Hide field';
37
+ readonly 'expand-fields.label': 'Expand';
38
+ readonly 'collapse-fields.label': 'Collapse';
39
+ readonly 'delete-field.label': 'Delete field';
40
+ readonly 'create-option.label': 'Create';
41
+ readonly 'add-tag.label': 'Add tag';
42
+ readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
43
+ readonly 'ref-field.placeholder': 'Select\u2026';
44
+ readonly 'ref-field.placeholder_one': 'Select\u2026';
45
+ readonly 'ref-field.placeholder_other': 'Select items\u2026';
46
+ readonly 'example.placeholder': 'Example';
47
+ readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
48
+ readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
49
+ readonly 'cancel-button.label': 'Cancel';
50
+ readonly 'save-button.label': 'Save';
51
+ readonly 'create-text.label': 'Create text';
52
+ readonly 'format.boolean.label': 'Boolean';
53
+ readonly 'format.currency.label': 'Currency';
54
+ readonly 'format.date.label': 'Date';
55
+ readonly 'format.date-time.label': 'DateTime';
56
+ readonly 'format.did.label': 'DID';
57
+ readonly 'format.duration.label': 'Duration';
58
+ readonly 'format.dxn.label': 'DXN';
59
+ readonly 'format.email.label': 'Email';
60
+ readonly 'format.formula.label': 'Formula';
61
+ readonly 'format.hostname.label': 'Hostname';
62
+ readonly 'format.integer.label': 'Integer';
63
+ readonly 'format.json.label': 'JSON';
64
+ readonly 'format.lnglat.label': 'Geopoint';
65
+ readonly 'format.markdown.label': 'Markdown';
66
+ readonly 'format.percent.label': 'Percent';
67
+ readonly 'format.ref.label': 'Reference';
68
+ readonly 'format.regex.label': 'RegExp';
69
+ readonly 'format.string.label': 'String';
70
+ readonly 'format.single-select.label': 'Select';
71
+ readonly 'format.multi-select.label': 'Multi-select';
72
+ readonly 'format.text.label': 'Long text';
73
+ readonly 'format.time.label': 'Time';
74
+ readonly 'format.timestamp.label': 'Timestamp';
75
+ readonly 'format.user.label': 'User';
76
+ readonly 'format.number.label': 'Number';
77
+ readonly 'format.uri.label': 'URI';
78
+ readonly 'format.url.label': 'URL';
79
+ readonly 'format.uuid.label': 'UUID';
80
+ readonly 'latitude.label': 'Latitude';
81
+ readonly 'longitude.label': 'Longitude';
82
+ readonly 'select-option.label': 'Label';
83
+ readonly 'select-option-label.placeholder': 'Option label';
84
+ readonly 'select-option-delete.button': 'Delete';
85
+ readonly 'select-option-add.button': 'Add option';
86
+ readonly 'system-schema.title': 'System type';
87
+ readonly 'system-schema.description': 'System type: cannot add or remove fields.';
88
+ readonly 'remove.button': 'Delete';
89
+ };
90
+ };
91
+ }];
92
+ };
93
+ };
94
+ export default meta;
95
+ type Story = StoryObj<typeof meta>;
96
+ /**
97
+ * Default Pipeline form — manual exploration. Includes the Tags picker (which
98
+ * is the only ref-array path that currently works end-to-end, by virtue of
99
+ * `Tag.Tag` being special-cased in `ObjectProperties.handleCreate`).
100
+ */
101
+ export declare const Default: Story;
102
+ /**
103
+ * Tag-creation play. Walks the inline create flow against the Tags picker and
104
+ * leaves the magazine in the post-Save state for assertions to inspect via
105
+ * `OBJECT_PROPERTIES_DEBUG_SYMBOL`.
106
+ *
107
+ * Expected end-state (currently passes):
108
+ * - new Tag.Tag exists in the DB with `label === "PinnedTag"`
109
+ * - `Obj.getMeta(object).tags` includes its DXN.
110
+ */
111
+ export declare const CreateTagPlay: Story;
112
+ /**
113
+ * Ref-array creation play. Walks Add → Open → Create → Save against
114
+ * `Article.authors`. After the fix, the new Author should be persisted AND
115
+ * wired into `article.authors[0]`. Today it persists to the DB but the array
116
+ * slot stays empty.
117
+ */
118
+ export declare const CreateRefArrayPlay: Story;
119
+ /**
120
+ * Ref-array creation against a schema with a hidden required field. `Note`
121
+ * mirrors the shape of `Subscription.Feed`: the form omits `backing` (a
122
+ * required `Ref` annotated `FormInputAnnotation.set(false)`) but the schema
123
+ * requires it. Without `omitHiddenFormFields` + `FactoryAnnotation`, the
124
+ * form's validator would reject Save and the popover would never close.
125
+ *
126
+ * Expected end-state after the fix:
127
+ * - new Note exists in DB with a synthesised `backing` ref
128
+ * - `notebook.notes[0]` references the new Note
129
+ * - the create form is gone
130
+ */
131
+ export declare const CreateHiddenFieldPlay: Story;
132
+ //# sourceMappingURL=ObjectProperties.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectProperties.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectProperties/ObjectProperties.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAKjE,OAAO,EAA2B,GAAG,EAAkB,MAAM,YAAY,CAAC;AAG1E,OAAO,EAAE,cAAc,EAAsB,MAAM,4BAA4B,CAAC;AA0EhF,MAAM,MAAM,qBAAqB,GAAG;IAClC,oDAAoD;IACpD,EAAE,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,OAAO,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS;QAAE,EAAE,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;IACjH,gDAAgD;IAChD,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC;CACrB,CAAC;AA8CF,QAAA,MAAM,IAAI;;eAEuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAME,CAAC;eAExB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA4DnC;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KAGrB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,EAAE,KAmC3B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAkChC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,EAAE,KA8BnC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ObjectProperties.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectProperties.test.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectProperties/ObjectProperties.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from './ObjectProperties';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectProperties/index.ts"],"names":[],"mappings":"AAIA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import * as Schema from 'effect/Schema';
2
+ import { type ReactElement, type RefAttributes } from 'react';
3
+ import { type ComposableProps } from '@dxos/ui-types';
4
+ export type ObjectTreeProps<T> = {
5
+ schema: Schema.Schema<T, any, never>;
6
+ value: T;
7
+ };
8
+ export declare const ObjectTree: <T>(props: ComposableProps<ObjectTreeProps<T>> & RefAttributes<HTMLDivElement>) => ReactElement | null;
9
+ //# sourceMappingURL=ObjectTree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectTree.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectTree/ObjectTree.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAc,EAAE,KAAK,YAAY,EAAkB,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAIrF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACrC,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAuBF,eAAO,MAAM,UAAU,EAAgC,CAAC,CAAC,EACvD,KAAK,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,cAAc,CAAC,KACvE,YAAY,GAAG,IAAI,CAAC"}
@@ -0,0 +1,91 @@
1
+ import { type StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
3
+ declare const meta: {
4
+ title: string;
5
+ component: <T>(props: import("@dxos/ui-types").ComposableProps<import("./ObjectTree").ObjectTreeProps<T>> & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
6
+ decorators: import("@storybook/react").Decorator[];
7
+ parameters: {
8
+ layout: string;
9
+ translations: [{
10
+ readonly 'en-US': {
11
+ readonly "@dxos/react-ui-form": {
12
+ readonly 'ref-editor.placeholder': "Type '@' to add a reference, or enter a value";
13
+ readonly 'ref-editor-auto.placeholder': 'Search by name, or enter a value';
14
+ readonly 'fields.label': 'Fields';
15
+ readonly 'hidden-fields.label': 'Hidden Fields';
16
+ readonly 'empty-readonly-ref-field.label': '(none)';
17
+ readonly 'field-property.label': 'Property';
18
+ readonly 'field-property.placeholder': 'Property name';
19
+ readonly 'field-format.label': 'Type';
20
+ readonly 'field-path.label': 'Field path';
21
+ readonly 'remove-item.button': 'Delete item';
22
+ readonly 'add-item.button': 'Add item';
23
+ readonly 'add-property-button.label': 'Add property';
24
+ readonly 'boolean-input-true.value': 'Yes';
25
+ readonly 'boolean-input-false.value': 'No';
26
+ readonly 'show-field.label': 'Show field';
27
+ readonly 'hide-field.label': 'Hide field';
28
+ readonly 'expand-fields.label': 'Expand';
29
+ readonly 'collapse-fields.label': 'Collapse';
30
+ readonly 'delete-field.label': 'Delete field';
31
+ readonly 'create-option.label': 'Create';
32
+ readonly 'add-tag.label': 'Add tag';
33
+ readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
34
+ readonly 'ref-field.placeholder': 'Select\u2026';
35
+ readonly 'ref-field.placeholder_one': 'Select\u2026';
36
+ readonly 'ref-field.placeholder_other': 'Select items\u2026';
37
+ readonly 'example.placeholder': 'Example';
38
+ readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
39
+ readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
40
+ readonly 'cancel-button.label': 'Cancel';
41
+ readonly 'save-button.label': 'Save';
42
+ readonly 'create-text.label': 'Create text';
43
+ readonly 'format.boolean.label': 'Boolean';
44
+ readonly 'format.currency.label': 'Currency';
45
+ readonly 'format.date.label': 'Date';
46
+ readonly 'format.date-time.label': 'DateTime';
47
+ readonly 'format.did.label': 'DID';
48
+ readonly 'format.duration.label': 'Duration';
49
+ readonly 'format.dxn.label': 'DXN';
50
+ readonly 'format.email.label': 'Email';
51
+ readonly 'format.formula.label': 'Formula';
52
+ readonly 'format.hostname.label': 'Hostname';
53
+ readonly 'format.integer.label': 'Integer';
54
+ readonly 'format.json.label': 'JSON';
55
+ readonly 'format.lnglat.label': 'Geopoint';
56
+ readonly 'format.markdown.label': 'Markdown';
57
+ readonly 'format.percent.label': 'Percent';
58
+ readonly 'format.ref.label': 'Reference';
59
+ readonly 'format.regex.label': 'RegExp';
60
+ readonly 'format.string.label': 'String';
61
+ readonly 'format.single-select.label': 'Select';
62
+ readonly 'format.multi-select.label': 'Multi-select';
63
+ readonly 'format.text.label': 'Long text';
64
+ readonly 'format.time.label': 'Time';
65
+ readonly 'format.timestamp.label': 'Timestamp';
66
+ readonly 'format.user.label': 'User';
67
+ readonly 'format.number.label': 'Number';
68
+ readonly 'format.uri.label': 'URI';
69
+ readonly 'format.url.label': 'URL';
70
+ readonly 'format.uuid.label': 'UUID';
71
+ readonly 'latitude.label': 'Latitude';
72
+ readonly 'longitude.label': 'Longitude';
73
+ readonly 'select-option.label': 'Label';
74
+ readonly 'select-option-label.placeholder': 'Option label';
75
+ readonly 'select-option-delete.button': 'Delete';
76
+ readonly 'select-option-add.button': 'Add option';
77
+ readonly 'system-schema.title': 'System type';
78
+ readonly 'system-schema.description': 'System type: cannot add or remove fields.';
79
+ readonly 'remove.button': 'Delete';
80
+ };
81
+ };
82
+ }];
83
+ };
84
+ };
85
+ export default meta;
86
+ type Story = StoryObj<typeof meta>;
87
+ export declare const Default: Story;
88
+ export declare const JSON: () => React.JSX.Element;
89
+ export declare const WithForm: () => React.JSX.Element;
90
+ export declare const WithReadOnlyForm: () => React.JSX.Element;
91
+ //# sourceMappingURL=ObjectTree.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectTree.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectTree/ObjectTree.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAmE1B,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQyB,CAAC;eAErB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,IAAI,yBAShB,CAAC;AAMF,eAAO,MAAM,QAAQ,yBAcpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,yBAS5B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './ObjectTree';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectTree/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC"}
@@ -0,0 +1,73 @@
1
+ import React from 'react';
2
+ import { type Database, Obj, type Type } from '@dxos/echo';
3
+ import { type ThemedClassName } from '@dxos/react-ui';
4
+ import { type EditorController, type EditorMenuProviderProps, type EditorViewProps } from '@dxos/react-ui-editor';
5
+ import { type RefEditorMode } from './ref-editor-extension';
6
+ export type RefEditorProps = ThemedClassName<{
7
+ /** Database queried for objects of {@link RefEditorProps.type}. */
8
+ db?: Database.Database;
9
+ /** ECHO object type whose instances are offered in the typeahead and referenced as `@<id>`. */
10
+ type: Type.AnyObj;
11
+ value?: string;
12
+ readonly?: boolean;
13
+ /**
14
+ * Content model:
15
+ * - `'ref'` (default): the picker only matches existing objects; selection inserts an
16
+ * `@<id>` reference (raw tokens accepted by `match` are also allowed).
17
+ * - `'email'`: the picker shows one item per (object, value) pair and selection captures the
18
+ * value; the content is an RFC 5322 mailbox list (`Name <email>, ...`) with the comma
19
+ * separators hidden inside the tags.
20
+ */
21
+ mode?: RefEditorMode;
22
+ /** Pluggable raw-token matcher (e.g. {@link EMAIL_REGEX}); matching tokens are accepted as values. */
23
+ match?: RegExp;
24
+ /** Display label for an object; defaults to `Obj.getLabel` falling back to the id. */
25
+ getLabel?: (object: Obj.Unknown) => string;
26
+ /** Values an object can be captured as in `'email'` mode (e.g. a person's email addresses). */
27
+ getValues?: (object: Obj.Unknown) => readonly string[];
28
+ /** Menu item icon. */
29
+ icon?: string;
30
+ /** Already-translated placeholder; defaults to a generic hint. */
31
+ placeholder?: string;
32
+ /** Open the typeahead while typing (the `@` trigger remains available but is not required). */
33
+ activateOnTyping?: boolean;
34
+ } & Omit<EditorViewProps, 'initialValue'> & Pick<EditorMenuProviderProps, 'numItems'>>;
35
+ /**
36
+ * Single-line input for a list of object references. Typing `@` (or any text, with
37
+ * `activateOnTyping`) opens a typeahead menu matching objects of the given type by label (and
38
+ * by their `getValues` values). The content model depends on {@link RefEditorProps.mode}.
39
+ * Resolved entries render as atomic tags with the object's label; raw tokens accepted by the
40
+ * pluggable `match` regexp render as neutral tags.
41
+ */
42
+ export declare const RefEditor: React.ForwardRefExoticComponent<Omit<{
43
+ /** Database queried for objects of {@link RefEditorProps.type}. */
44
+ db?: Database.Database;
45
+ /** ECHO object type whose instances are offered in the typeahead and referenced as `@<id>`. */
46
+ type: Type.AnyObj;
47
+ value?: string;
48
+ readonly?: boolean;
49
+ /**
50
+ * Content model:
51
+ * - `'ref'` (default): the picker only matches existing objects; selection inserts an
52
+ * `@<id>` reference (raw tokens accepted by `match` are also allowed).
53
+ * - `'email'`: the picker shows one item per (object, value) pair and selection captures the
54
+ * value; the content is an RFC 5322 mailbox list (`Name <email>, ...`) with the comma
55
+ * separators hidden inside the tags.
56
+ */
57
+ mode?: RefEditorMode;
58
+ /** Pluggable raw-token matcher (e.g. {@link EMAIL_REGEX}); matching tokens are accepted as values. */
59
+ match?: RegExp;
60
+ /** Display label for an object; defaults to `Obj.getLabel` falling back to the id. */
61
+ getLabel?: (object: Obj.Unknown) => string;
62
+ /** Values an object can be captured as in `'email'` mode (e.g. a person's email addresses). */
63
+ getValues?: (object: Obj.Unknown) => readonly string[];
64
+ /** Menu item icon. */
65
+ icon?: string;
66
+ /** Already-translated placeholder; defaults to a generic hint. */
67
+ placeholder?: string;
68
+ /** Open the typeahead while typing (the `@` trigger remains available but is not required). */
69
+ activateOnTyping?: boolean;
70
+ } & Omit<EditorViewProps, "initialValue"> & Pick<EditorMenuProviderProps, "numItems">, "className"> & {
71
+ classNames?: import("@dxos/ui-types").ClassNameValue;
72
+ } & React.RefAttributes<EditorController>>;
73
+ //# sourceMappingURL=RefEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RefEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/RefEditor/RefEditor.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA8D,MAAM,OAAO,CAAC;AAEnF,OAAO,EAAE,KAAK,QAAQ,EAAU,GAAG,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAEnE,OAAO,EAAE,KAAK,eAAe,EAAmC,MAAM,gBAAgB,CAAC;AACvF,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EAErB,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAGL,KAAK,aAAa,EAKnB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,cAAc,GAAG,eAAe,CAC1C;IACE,mEAAmE;IACnE,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACvB,+FAA+F;IAC/F,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,sGAAsG;IACtG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,KAAK,MAAM,CAAC;IAC3C,+FAA+F;IAC/F,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,KAAK,SAAS,MAAM,EAAE,CAAC;IACvD,sBAAsB;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+FAA+F;IAC/F,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,GAAG,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,GACvC,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC,CAC5C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,SAAS;IAtClB,mEAAmE;SAC9D,QAAQ,CAAC,QAAQ;IACtB,+FAA+F;UACzF,IAAI,CAAC,MAAM;YACT,MAAM;eACH,OAAO;IAClB;;;;;;;OAOG;WACI,aAAa;IACpB,sGAAsG;YAC9F,MAAM;IACd,sFAAsF;eAC3E,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,KAAK,MAAM;IAC1C,+FAA+F;gBACnF,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,KAAK,SAAS,MAAM,EAAE;IACtD,sBAAsB;WACf,MAAM;IACb,kEAAkE;kBACpD,MAAM;IACpB,+FAA+F;uBAC5E,OAAO;;;0CAmM7B,CAAC"}
@@ -0,0 +1,92 @@
1
+ import { type StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
3
+ import { type RefEditorProps } from './RefEditor';
4
+ type StoryProps = Partial<Pick<RefEditorProps, 'value' | 'mode' | 'activateOnTyping' | 'autoFocus'>>;
5
+ declare const meta: {
6
+ title: string;
7
+ render: ({ value: initialValue, ...args }: StoryProps) => React.JSX.Element;
8
+ decorators: import("@storybook/react").Decorator[];
9
+ parameters: {
10
+ translations: [{
11
+ readonly 'en-US': {
12
+ readonly "@dxos/react-ui-form": {
13
+ readonly 'ref-editor.placeholder': "Type '@' to add a reference, or enter a value";
14
+ readonly 'ref-editor-auto.placeholder': 'Search by name, or enter a value';
15
+ readonly 'fields.label': 'Fields';
16
+ readonly 'hidden-fields.label': 'Hidden Fields';
17
+ readonly 'empty-readonly-ref-field.label': '(none)';
18
+ readonly 'field-property.label': 'Property';
19
+ readonly 'field-property.placeholder': 'Property name';
20
+ readonly 'field-format.label': 'Type';
21
+ readonly 'field-path.label': 'Field path';
22
+ readonly 'remove-item.button': 'Delete item';
23
+ readonly 'add-item.button': 'Add item';
24
+ readonly 'add-property-button.label': 'Add property';
25
+ readonly 'boolean-input-true.value': 'Yes';
26
+ readonly 'boolean-input-false.value': 'No';
27
+ readonly 'show-field.label': 'Show field';
28
+ readonly 'hide-field.label': 'Hide field';
29
+ readonly 'expand-fields.label': 'Expand';
30
+ readonly 'collapse-fields.label': 'Collapse';
31
+ readonly 'delete-field.label': 'Delete field';
32
+ readonly 'create-option.label': 'Create';
33
+ readonly 'add-tag.label': 'Add tag';
34
+ readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
35
+ readonly 'ref-field.placeholder': 'Select\u2026';
36
+ readonly 'ref-field.placeholder_one': 'Select\u2026';
37
+ readonly 'ref-field.placeholder_other': 'Select items\u2026';
38
+ readonly 'example.placeholder': 'Example';
39
+ readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
40
+ readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
41
+ readonly 'cancel-button.label': 'Cancel';
42
+ readonly 'save-button.label': 'Save';
43
+ readonly 'create-text.label': 'Create text';
44
+ readonly 'format.boolean.label': 'Boolean';
45
+ readonly 'format.currency.label': 'Currency';
46
+ readonly 'format.date.label': 'Date';
47
+ readonly 'format.date-time.label': 'DateTime';
48
+ readonly 'format.did.label': 'DID';
49
+ readonly 'format.duration.label': 'Duration';
50
+ readonly 'format.dxn.label': 'DXN';
51
+ readonly 'format.email.label': 'Email';
52
+ readonly 'format.formula.label': 'Formula';
53
+ readonly 'format.hostname.label': 'Hostname';
54
+ readonly 'format.integer.label': 'Integer';
55
+ readonly 'format.json.label': 'JSON';
56
+ readonly 'format.lnglat.label': 'Geopoint';
57
+ readonly 'format.markdown.label': 'Markdown';
58
+ readonly 'format.percent.label': 'Percent';
59
+ readonly 'format.ref.label': 'Reference';
60
+ readonly 'format.regex.label': 'RegExp';
61
+ readonly 'format.string.label': 'String';
62
+ readonly 'format.single-select.label': 'Select';
63
+ readonly 'format.multi-select.label': 'Multi-select';
64
+ readonly 'format.text.label': 'Long text';
65
+ readonly 'format.time.label': 'Time';
66
+ readonly 'format.timestamp.label': 'Timestamp';
67
+ readonly 'format.user.label': 'User';
68
+ readonly 'format.number.label': 'Number';
69
+ readonly 'format.uri.label': 'URI';
70
+ readonly 'format.url.label': 'URL';
71
+ readonly 'format.uuid.label': 'UUID';
72
+ readonly 'latitude.label': 'Latitude';
73
+ readonly 'longitude.label': 'Longitude';
74
+ readonly 'select-option.label': 'Label';
75
+ readonly 'select-option-label.placeholder': 'Option label';
76
+ readonly 'select-option-delete.button': 'Delete';
77
+ readonly 'select-option-add.button': 'Add option';
78
+ readonly 'system-schema.title': 'System type';
79
+ readonly 'system-schema.description': 'System type: cannot add or remove fields.';
80
+ readonly 'remove.button': 'Delete';
81
+ };
82
+ };
83
+ }];
84
+ };
85
+ };
86
+ export default meta;
87
+ type Story = StoryObj<typeof meta>;
88
+ export declare const Default: Story;
89
+ export declare const ActivateOnTyping: Story;
90
+ export declare const EmailMode: Story;
91
+ export declare const WithEmail: Story;
92
+ //# sourceMappingURL=RefEditor.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RefEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/RefEditor/RefEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAA6B,MAAM,OAAO,CAAC;AAclD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAoD7D,KAAK,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,MAAM,GAAG,kBAAkB,GAAG,WAAW,CAAC,CAAC,CAAC;AA2BrG,QAAA,MAAM,IAAI;;+CAvB8C,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyC7B,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAK9B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAMvB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAIvB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './RefEditor';
2
+ export * from './ref-editor-extension';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/RefEditor/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { type Extension } from '@codemirror/state';
2
+ /**
3
+ * Display info for a resolved object reference.
4
+ */
5
+ export type RefInfo = {
6
+ label: string;
7
+ hue?: string;
8
+ };
9
+ /**
10
+ * Content model:
11
+ * - `'ref'`: whitespace-separated tokens; `@<id>` references to existing objects (and raw tokens
12
+ * accepted by the pluggable {@link RefEditorExtensionOptions.match} regexp).
13
+ * - `'email'`: comma-separated RFC 5322 mailboxes (`Name <email>` or bare `email`); the comma
14
+ * separators are consumed into the atomic tags so they are not visible.
15
+ */
16
+ export type RefEditorMode = 'ref' | 'email';
17
+ export type RefEditorExtensionOptions = {
18
+ mode?: RefEditorMode;
19
+ /** Resolve an object id referenced as `@<id>` to display info. */
20
+ getRef?: (id: string) => RefInfo | undefined;
21
+ /** Pluggable raw-token matcher (e.g. {@link EMAIL_REGEX}); matching tokens render as neutral tags. */
22
+ match?: RegExp;
23
+ };
24
+ /** Matches an object reference token (`@<object id>`). */
25
+ export declare const REF_REGEX: RegExp;
26
+ /** Matches a well-formed email address token. */
27
+ export declare const EMAIL_REGEX: RegExp;
28
+ /** Matches an RFC 5322 name-addr (`Name <email>`); group 1 = display name, group 2 = addr-spec. */
29
+ export declare const NAME_ADDR_REGEX: RegExp;
30
+ /** Formats an RFC 5322 mailbox (`Name <email>`). */
31
+ export declare const formatMailbox: (name: string | undefined, email: string) => string;
32
+ /**
33
+ * Effect dispatched when reference data changes out-of-band (e.g. objects finish loading) so that
34
+ * already-rendered reference decorations re-resolve without a document change.
35
+ */
36
+ export declare const refEditorRedecorate: import("@codemirror/state").StateEffectType<null>;
37
+ /**
38
+ * CodeMirror extension rendering reference-editor tokens as tags. Tags are atomic: the cursor
39
+ * cannot enter them and deletion removes the whole token.
40
+ * - `'ref'` mode: `@<id>` references resolve to the object's label (via
41
+ * {@link RefEditorExtensionOptions.getRef}); tokens accepted by the pluggable `match` regexp
42
+ * render as neutral tags.
43
+ * - `'email'` mode: RFC 5322 mailboxes render as tags labelled with the display name (falling
44
+ * back to the address); the trailing comma separator is hidden inside the tag's atomic range.
45
+ */
46
+ export declare const refEditor: ({ mode, getRef, match }?: RefEditorExtensionOptions) => Extension;
47
+ //# sourceMappingURL=ref-editor-extension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ref-editor-extension.d.ts","sourceRoot":"","sources":["../../../../../src/components/RefEditor/ref-editor-extension.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoB,KAAK,SAAS,EAA4C,MAAM,mBAAmB,CAAC;AAM/G;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,CAAC;AAE5C,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,kEAAkE;IAClE,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS,CAAC;IAC7C,sGAAsG;IACtG,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,SAAS,QAAsB,CAAC;AAE7C,iDAAiD;AACjD,eAAO,MAAM,WAAW,QAAqD,CAAC;AAE9E,mGAAmG;AACnG,eAAO,MAAM,eAAe,QAAiE,CAAC;AAE9F,oDAAoD;AACpD,eAAO,MAAM,aAAa,SAAU,MAAM,GAAG,SAAS,SAAS,MAAM,KAAG,MAA+C,CAAC;AAExH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,mDAA6B,CAAC;AAE9D;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,6BAAqC,yBAAyB,KAAQ,SAoH3F,CAAC"}
@@ -0,0 +1,51 @@
1
+ import React, { type PropsWithChildren } from 'react';
2
+ import { type Label, type ThemedClassName } from '@dxos/react-ui';
3
+ type SettingsRootProps = ThemedClassName<PropsWithChildren>;
4
+ declare function SettingsRoot({ children, classNames }: SettingsRootProps): React.JSX.Element;
5
+ declare namespace SettingsRoot {
6
+ var displayName: string;
7
+ }
8
+ type SettingsSectionProps = PropsWithChildren<{
9
+ title: Label;
10
+ description?: Label;
11
+ }>;
12
+ declare function SettingsSection({ title, description, children }: SettingsSectionProps): React.JSX.Element;
13
+ declare namespace SettingsSection {
14
+ var displayName: string;
15
+ }
16
+ export declare const Settings: {
17
+ Root: {
18
+ ({ children, classNames }: SettingsRootProps): React.JSX.Element;
19
+ displayName: string;
20
+ };
21
+ Viewport: React.ForwardRefExoticComponent<Omit<{}, "className"> & {
22
+ classNames?: import("@dxos/ui-types").ClassNameValue;
23
+ } & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
24
+ Section: {
25
+ ({ title, description, children }: SettingsSectionProps): React.JSX.Element;
26
+ displayName: string;
27
+ };
28
+ Panel: {
29
+ ({ classNames, children }: Omit<{
30
+ children?: React.ReactNode | undefined;
31
+ }, "className"> & {
32
+ classNames?: import("@dxos/ui-types").ClassNameValue;
33
+ }): React.JSX.Element;
34
+ displayName: string;
35
+ };
36
+ Item: {
37
+ ({ title, description, children }: {
38
+ title: Label;
39
+ description?: Label;
40
+ } & {
41
+ children?: React.ReactNode | undefined;
42
+ }): React.JSX.Element;
43
+ displayName: string;
44
+ };
45
+ FieldSet: {
46
+ <T extends Record<string, any>>({ schema, values, onValuesChanged, readonly, fieldMap, visible, sort, pathPrefix, }: import("./SettingsFieldSet").SettingsFieldSetProps<T>): React.JSX.Element;
47
+ displayName: string;
48
+ };
49
+ };
50
+ export {};
51
+ //# sourceMappingURL=Settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Settings.d.ts","sourceRoot":"","sources":["../../../../../src/components/Settings/Settings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,KAAK,KAAK,EAAc,KAAK,eAAe,EAAqC,MAAM,gBAAgB,CAAC;AAiBjH,KAAK,iBAAiB,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;8BAEtC,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,iBAAiB;;;;AA0BjE,KAAK,oBAAoB,GAAG,iBAAiB,CAAC;IAC5C,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,CAAC,CAAC;iCAEsB,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,oBAAoB;;;;AAiB/E,eAAO,MAAM,QAAQ;IACnB,IAAI;mCAjD0C,iBAAiB;;;IAkD/D,QAAQ;;;IACR,OAAO;2CApBkD,oBAAoB;;;IAqB7E,KAAK;;;;;;;;IACL,IAAI;;;;;;;;;IACJ,QAAQ;;;;CACT,CAAC"}