@pyric/ui 0.1.0-alpha.10

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 (603) hide show
  1. package/LICENSE +216 -0
  2. package/README.md +79 -0
  3. package/dist/agents/ContextWindowUsage.d.ts +67 -0
  4. package/dist/agents/ContextWindowUsage.d.ts.map +1 -0
  5. package/dist/agents/ContextWindowUsage.js +115 -0
  6. package/dist/agents/ContextWindowUsage.js.map +1 -0
  7. package/dist/agents/EmptyState.d.ts +18 -0
  8. package/dist/agents/EmptyState.d.ts.map +1 -0
  9. package/dist/agents/EmptyState.js +11 -0
  10. package/dist/agents/EmptyState.js.map +1 -0
  11. package/dist/agents/Fold.d.ts +37 -0
  12. package/dist/agents/Fold.d.ts.map +1 -0
  13. package/dist/agents/Fold.js +18 -0
  14. package/dist/agents/Fold.js.map +1 -0
  15. package/dist/agents/Modal.d.ts +25 -0
  16. package/dist/agents/Modal.d.ts.map +1 -0
  17. package/dist/agents/Modal.js +28 -0
  18. package/dist/agents/Modal.js.map +1 -0
  19. package/dist/agents/PulsingDot.d.ts +21 -0
  20. package/dist/agents/PulsingDot.d.ts.map +1 -0
  21. package/dist/agents/PulsingDot.js +18 -0
  22. package/dist/agents/PulsingDot.js.map +1 -0
  23. package/dist/agents/index.d.ts +15 -0
  24. package/dist/agents/index.d.ts.map +1 -0
  25. package/dist/agents/index.js +15 -0
  26. package/dist/agents/index.js.map +1 -0
  27. package/dist/auth/authApi.d.ts +32 -0
  28. package/dist/auth/authApi.d.ts.map +1 -0
  29. package/dist/auth/authApi.js +27 -0
  30. package/dist/auth/authApi.js.map +1 -0
  31. package/dist/auth/claims.d.ts +27 -0
  32. package/dist/auth/claims.d.ts.map +1 -0
  33. package/dist/auth/claims.js +58 -0
  34. package/dist/auth/claims.js.map +1 -0
  35. package/dist/auth/components/AuthProviderToggles.d.ts +31 -0
  36. package/dist/auth/components/AuthProviderToggles.d.ts.map +1 -0
  37. package/dist/auth/components/AuthProviderToggles.js +48 -0
  38. package/dist/auth/components/AuthProviderToggles.js.map +1 -0
  39. package/dist/auth/components/AuthSignInHelper.d.ts +57 -0
  40. package/dist/auth/components/AuthSignInHelper.d.ts.map +1 -0
  41. package/dist/auth/components/AuthSignInHelper.js +69 -0
  42. package/dist/auth/components/AuthSignInHelper.js.map +1 -0
  43. package/dist/auth/components/AuthUserForm.d.ts +84 -0
  44. package/dist/auth/components/AuthUserForm.d.ts.map +1 -0
  45. package/dist/auth/components/AuthUserForm.js +89 -0
  46. package/dist/auth/components/AuthUserForm.js.map +1 -0
  47. package/dist/auth/components/AuthUserList.d.ts +62 -0
  48. package/dist/auth/components/AuthUserList.d.ts.map +1 -0
  49. package/dist/auth/components/AuthUserList.js +46 -0
  50. package/dist/auth/components/AuthUserList.js.map +1 -0
  51. package/dist/auth/components/ClaimsField.d.ts +22 -0
  52. package/dist/auth/components/ClaimsField.d.ts.map +1 -0
  53. package/dist/auth/components/ClaimsField.js +11 -0
  54. package/dist/auth/components/ClaimsField.js.map +1 -0
  55. package/dist/auth/components/confirmActions.d.ts +40 -0
  56. package/dist/auth/components/confirmActions.d.ts.map +1 -0
  57. package/dist/auth/components/confirmActions.js +49 -0
  58. package/dist/auth/components/confirmActions.js.map +1 -0
  59. package/dist/auth/controller.d.ts +73 -0
  60. package/dist/auth/controller.d.ts.map +1 -0
  61. package/dist/auth/controller.js +139 -0
  62. package/dist/auth/controller.js.map +1 -0
  63. package/dist/auth/hooks/index.d.ts +7 -0
  64. package/dist/auth/hooks/index.d.ts.map +1 -0
  65. package/dist/auth/hooks/index.js +7 -0
  66. package/dist/auth/hooks/index.js.map +1 -0
  67. package/dist/auth/hooks/useAuthFlowHelper.d.ts +30 -0
  68. package/dist/auth/hooks/useAuthFlowHelper.d.ts.map +1 -0
  69. package/dist/auth/hooks/useAuthFlowHelper.js +30 -0
  70. package/dist/auth/hooks/useAuthFlowHelper.js.map +1 -0
  71. package/dist/auth/hooks/useAuthProviderConfig.d.ts +37 -0
  72. package/dist/auth/hooks/useAuthProviderConfig.d.ts.map +1 -0
  73. package/dist/auth/hooks/useAuthProviderConfig.js +98 -0
  74. package/dist/auth/hooks/useAuthProviderConfig.js.map +1 -0
  75. package/dist/auth/hooks/useAuthUserEditor.d.ts +30 -0
  76. package/dist/auth/hooks/useAuthUserEditor.d.ts.map +1 -0
  77. package/dist/auth/hooks/useAuthUserEditor.js +27 -0
  78. package/dist/auth/hooks/useAuthUserEditor.js.map +1 -0
  79. package/dist/auth/hooks/useAuthUsers.d.ts +38 -0
  80. package/dist/auth/hooks/useAuthUsers.d.ts.map +1 -0
  81. package/dist/auth/hooks/useAuthUsers.js +111 -0
  82. package/dist/auth/hooks/useAuthUsers.js.map +1 -0
  83. package/dist/auth/index.d.ts +11 -0
  84. package/dist/auth/index.d.ts.map +1 -0
  85. package/dist/auth/index.js +13 -0
  86. package/dist/auth/index.js.map +1 -0
  87. package/dist/auth/providers.d.ts +11 -0
  88. package/dist/auth/providers.d.ts.map +1 -0
  89. package/dist/auth/providers.js +28 -0
  90. package/dist/auth/providers.js.map +1 -0
  91. package/dist/auth/reducers/userEditor.d.ts +55 -0
  92. package/dist/auth/reducers/userEditor.d.ts.map +1 -0
  93. package/dist/auth/reducers/userEditor.js +136 -0
  94. package/dist/auth/reducers/userEditor.js.map +1 -0
  95. package/dist/events/components/ActivityActionItems.d.ts +45 -0
  96. package/dist/events/components/ActivityActionItems.d.ts.map +1 -0
  97. package/dist/events/components/ActivityActionItems.js +68 -0
  98. package/dist/events/components/ActivityActionItems.js.map +1 -0
  99. package/dist/events/components/ActivityGrid.d.ts +65 -0
  100. package/dist/events/components/ActivityGrid.d.ts.map +1 -0
  101. package/dist/events/components/ActivityGrid.js +61 -0
  102. package/dist/events/components/ActivityGrid.js.map +1 -0
  103. package/dist/events/components/ActivityGridRow.d.ts +31 -0
  104. package/dist/events/components/ActivityGridRow.d.ts.map +1 -0
  105. package/dist/events/components/ActivityGridRow.js +23 -0
  106. package/dist/events/components/ActivityGridRow.js.map +1 -0
  107. package/dist/events/components/ProposedChangeDiff.d.ts +46 -0
  108. package/dist/events/components/ProposedChangeDiff.d.ts.map +1 -0
  109. package/dist/events/components/ProposedChangeDiff.js +60 -0
  110. package/dist/events/components/ProposedChangeDiff.js.map +1 -0
  111. package/dist/events/components/format.d.ts +11 -0
  112. package/dist/events/components/format.d.ts.map +1 -0
  113. package/dist/events/components/format.js +26 -0
  114. package/dist/events/components/format.js.map +1 -0
  115. package/dist/events/components/index.d.ts +6 -0
  116. package/dist/events/components/index.d.ts.map +1 -0
  117. package/dist/events/components/index.js +6 -0
  118. package/dist/events/components/index.js.map +1 -0
  119. package/dist/events/digest.d.ts +167 -0
  120. package/dist/events/digest.d.ts.map +1 -0
  121. package/dist/events/digest.js +426 -0
  122. package/dist/events/digest.js.map +1 -0
  123. package/dist/events/hooks/index.d.ts +3 -0
  124. package/dist/events/hooks/index.d.ts.map +1 -0
  125. package/dist/events/hooks/index.js +3 -0
  126. package/dist/events/hooks/index.js.map +1 -0
  127. package/dist/events/hooks/useActivityDigest.d.ts +27 -0
  128. package/dist/events/hooks/useActivityDigest.d.ts.map +1 -0
  129. package/dist/events/hooks/useActivityDigest.js +18 -0
  130. package/dist/events/hooks/useActivityDigest.js.map +1 -0
  131. package/dist/events/hooks/useActivityStream.d.ts +44 -0
  132. package/dist/events/hooks/useActivityStream.d.ts.map +1 -0
  133. package/dist/events/hooks/useActivityStream.js +38 -0
  134. package/dist/events/hooks/useActivityStream.js.map +1 -0
  135. package/dist/events/index.d.ts +15 -0
  136. package/dist/events/index.d.ts.map +1 -0
  137. package/dist/events/index.js +14 -0
  138. package/dist/events/index.js.map +1 -0
  139. package/dist/events/types.d.ts +160 -0
  140. package/dist/events/types.d.ts.map +1 -0
  141. package/dist/events/types.js +21 -0
  142. package/dist/events/types.js.map +1 -0
  143. package/dist/firestore/components/CollectionList.d.ts +22 -0
  144. package/dist/firestore/components/CollectionList.d.ts.map +1 -0
  145. package/dist/firestore/components/CollectionList.js +21 -0
  146. package/dist/firestore/components/CollectionList.js.map +1 -0
  147. package/dist/firestore/components/DeleteWithConfirm.d.ts +38 -0
  148. package/dist/firestore/components/DeleteWithConfirm.d.ts.map +1 -0
  149. package/dist/firestore/components/DeleteWithConfirm.js +33 -0
  150. package/dist/firestore/components/DeleteWithConfirm.js.map +1 -0
  151. package/dist/firestore/components/DocumentEditor.d.ts +47 -0
  152. package/dist/firestore/components/DocumentEditor.d.ts.map +1 -0
  153. package/dist/firestore/components/DocumentEditor.js +176 -0
  154. package/dist/firestore/components/DocumentEditor.js.map +1 -0
  155. package/dist/firestore/components/DocumentList.d.ts +63 -0
  156. package/dist/firestore/components/DocumentList.d.ts.map +1 -0
  157. package/dist/firestore/components/DocumentList.js +53 -0
  158. package/dist/firestore/components/DocumentList.js.map +1 -0
  159. package/dist/firestore/components/DocumentPreview.d.ts +68 -0
  160. package/dist/firestore/components/DocumentPreview.d.ts.map +1 -0
  161. package/dist/firestore/components/DocumentPreview.js +76 -0
  162. package/dist/firestore/components/DocumentPreview.js.map +1 -0
  163. package/dist/firestore/components/FieldRenderer.d.ts +17 -0
  164. package/dist/firestore/components/FieldRenderer.d.ts.map +1 -0
  165. package/dist/firestore/components/FieldRenderer.js +16 -0
  166. package/dist/firestore/components/FieldRenderer.js.map +1 -0
  167. package/dist/firestore/components/QueryBuilder.d.ts +25 -0
  168. package/dist/firestore/components/QueryBuilder.d.ts.map +1 -0
  169. package/dist/firestore/components/QueryBuilder.js +78 -0
  170. package/dist/firestore/components/QueryBuilder.js.map +1 -0
  171. package/dist/firestore/components/ReferencePicker.d.ts +33 -0
  172. package/dist/firestore/components/ReferencePicker.d.ts.map +1 -0
  173. package/dist/firestore/components/ReferencePicker.js +42 -0
  174. package/dist/firestore/components/ReferencePicker.js.map +1 -0
  175. package/dist/firestore/components/TreeEntry.d.ts +15 -0
  176. package/dist/firestore/components/TreeEntry.d.ts.map +1 -0
  177. package/dist/firestore/components/TreeEntry.js +23 -0
  178. package/dist/firestore/components/TreeEntry.js.map +1 -0
  179. package/dist/firestore/components/context.d.ts +18 -0
  180. package/dist/firestore/components/context.d.ts.map +1 -0
  181. package/dist/firestore/components/context.js +7 -0
  182. package/dist/firestore/components/context.js.map +1 -0
  183. package/dist/firestore/fieldEditors/array.d.ts +3 -0
  184. package/dist/firestore/fieldEditors/array.d.ts.map +1 -0
  185. package/dist/firestore/fieldEditors/array.js +16 -0
  186. package/dist/firestore/fieldEditors/array.js.map +1 -0
  187. package/dist/firestore/fieldEditors/boolean.d.ts +3 -0
  188. package/dist/firestore/fieldEditors/boolean.d.ts.map +1 -0
  189. package/dist/firestore/fieldEditors/boolean.js +13 -0
  190. package/dist/firestore/fieldEditors/boolean.js.map +1 -0
  191. package/dist/firestore/fieldEditors/bytes.d.ts +4 -0
  192. package/dist/firestore/fieldEditors/bytes.d.ts.map +1 -0
  193. package/dist/firestore/fieldEditors/bytes.js +31 -0
  194. package/dist/firestore/fieldEditors/bytes.js.map +1 -0
  195. package/dist/firestore/fieldEditors/geopoint.d.ts +4 -0
  196. package/dist/firestore/fieldEditors/geopoint.d.ts.map +1 -0
  197. package/dist/firestore/fieldEditors/geopoint.js +32 -0
  198. package/dist/firestore/fieldEditors/geopoint.js.map +1 -0
  199. package/dist/firestore/fieldEditors/map.d.ts +3 -0
  200. package/dist/firestore/fieldEditors/map.d.ts.map +1 -0
  201. package/dist/firestore/fieldEditors/map.js +19 -0
  202. package/dist/firestore/fieldEditors/map.js.map +1 -0
  203. package/dist/firestore/fieldEditors/null.d.ts +3 -0
  204. package/dist/firestore/fieldEditors/null.d.ts.map +1 -0
  205. package/dist/firestore/fieldEditors/null.js +17 -0
  206. package/dist/firestore/fieldEditors/null.js.map +1 -0
  207. package/dist/firestore/fieldEditors/number.d.ts +3 -0
  208. package/dist/firestore/fieldEditors/number.d.ts.map +1 -0
  209. package/dist/firestore/fieldEditors/number.js +24 -0
  210. package/dist/firestore/fieldEditors/number.js.map +1 -0
  211. package/dist/firestore/fieldEditors/reference.d.ts +4 -0
  212. package/dist/firestore/fieldEditors/reference.d.ts.map +1 -0
  213. package/dist/firestore/fieldEditors/reference.js +49 -0
  214. package/dist/firestore/fieldEditors/reference.js.map +1 -0
  215. package/dist/firestore/fieldEditors/registry.d.ts +16 -0
  216. package/dist/firestore/fieldEditors/registry.d.ts.map +1 -0
  217. package/dist/firestore/fieldEditors/registry.js +42 -0
  218. package/dist/firestore/fieldEditors/registry.js.map +1 -0
  219. package/dist/firestore/fieldEditors/string.d.ts +3 -0
  220. package/dist/firestore/fieldEditors/string.d.ts.map +1 -0
  221. package/dist/firestore/fieldEditors/string.js +13 -0
  222. package/dist/firestore/fieldEditors/string.js.map +1 -0
  223. package/dist/firestore/fieldEditors/timestamp.d.ts +4 -0
  224. package/dist/firestore/fieldEditors/timestamp.d.ts.map +1 -0
  225. package/dist/firestore/fieldEditors/timestamp.js +52 -0
  226. package/dist/firestore/fieldEditors/timestamp.js.map +1 -0
  227. package/dist/firestore/fieldEditors/types.d.ts +64 -0
  228. package/dist/firestore/fieldEditors/types.d.ts.map +1 -0
  229. package/dist/firestore/fieldEditors/types.js +2 -0
  230. package/dist/firestore/fieldEditors/types.js.map +1 -0
  231. package/dist/firestore/fieldEditors/vector.d.ts +29 -0
  232. package/dist/firestore/fieldEditors/vector.d.ts.map +1 -0
  233. package/dist/firestore/fieldEditors/vector.js +93 -0
  234. package/dist/firestore/fieldEditors/vector.js.map +1 -0
  235. package/dist/firestore/firestoreApi.d.ts +35 -0
  236. package/dist/firestore/firestoreApi.d.ts.map +1 -0
  237. package/dist/firestore/firestoreApi.js +29 -0
  238. package/dist/firestore/firestoreApi.js.map +1 -0
  239. package/dist/firestore/hooks/coerceError.d.ts +17 -0
  240. package/dist/firestore/hooks/coerceError.d.ts.map +1 -0
  241. package/dist/firestore/hooks/coerceError.js +41 -0
  242. package/dist/firestore/hooks/coerceError.js.map +1 -0
  243. package/dist/firestore/hooks/index.d.ts +10 -0
  244. package/dist/firestore/hooks/index.d.ts.map +1 -0
  245. package/dist/firestore/hooks/index.js +10 -0
  246. package/dist/firestore/hooks/index.js.map +1 -0
  247. package/dist/firestore/hooks/useCollectionList.d.ts +37 -0
  248. package/dist/firestore/hooks/useCollectionList.d.ts.map +1 -0
  249. package/dist/firestore/hooks/useCollectionList.js +51 -0
  250. package/dist/firestore/hooks/useCollectionList.js.map +1 -0
  251. package/dist/firestore/hooks/useDocumentEditor.d.ts +61 -0
  252. package/dist/firestore/hooks/useDocumentEditor.d.ts.map +1 -0
  253. package/dist/firestore/hooks/useDocumentEditor.js +71 -0
  254. package/dist/firestore/hooks/useDocumentEditor.js.map +1 -0
  255. package/dist/firestore/hooks/useDocumentList.d.ts +50 -0
  256. package/dist/firestore/hooks/useDocumentList.d.ts.map +1 -0
  257. package/dist/firestore/hooks/useDocumentList.js +162 -0
  258. package/dist/firestore/hooks/useDocumentList.js.map +1 -0
  259. package/dist/firestore/hooks/useDocumentSubcollections.d.ts +29 -0
  260. package/dist/firestore/hooks/useDocumentSubcollections.d.ts.map +1 -0
  261. package/dist/firestore/hooks/useDocumentSubcollections.js +48 -0
  262. package/dist/firestore/hooks/useDocumentSubcollections.js.map +1 -0
  263. package/dist/firestore/hooks/useFirestoreCollection.d.ts +14 -0
  264. package/dist/firestore/hooks/useFirestoreCollection.d.ts.map +1 -0
  265. package/dist/firestore/hooks/useFirestoreCollection.js +36 -0
  266. package/dist/firestore/hooks/useFirestoreCollection.js.map +1 -0
  267. package/dist/firestore/hooks/useFirestoreDoc.d.ts +17 -0
  268. package/dist/firestore/hooks/useFirestoreDoc.d.ts.map +1 -0
  269. package/dist/firestore/hooks/useFirestoreDoc.js +35 -0
  270. package/dist/firestore/hooks/useFirestoreDoc.js.map +1 -0
  271. package/dist/firestore/hooks/useQueryBuilder.d.ts +51 -0
  272. package/dist/firestore/hooks/useQueryBuilder.d.ts.map +1 -0
  273. package/dist/firestore/hooks/useQueryBuilder.js +110 -0
  274. package/dist/firestore/hooks/useQueryBuilder.js.map +1 -0
  275. package/dist/firestore/hooks/useRecursiveDelete.d.ts +40 -0
  276. package/dist/firestore/hooks/useRecursiveDelete.d.ts.map +1 -0
  277. package/dist/firestore/hooks/useRecursiveDelete.js +44 -0
  278. package/dist/firestore/hooks/useRecursiveDelete.js.map +1 -0
  279. package/dist/firestore/hooks/useReferencePicker.d.ts +70 -0
  280. package/dist/firestore/hooks/useReferencePicker.d.ts.map +1 -0
  281. package/dist/firestore/hooks/useReferencePicker.js +140 -0
  282. package/dist/firestore/hooks/useReferencePicker.js.map +1 -0
  283. package/dist/firestore/import/parseImport.d.ts +55 -0
  284. package/dist/firestore/import/parseImport.d.ts.map +1 -0
  285. package/dist/firestore/import/parseImport.js +101 -0
  286. package/dist/firestore/import/parseImport.js.map +1 -0
  287. package/dist/firestore/index.d.ts +21 -0
  288. package/dist/firestore/index.d.ts.map +1 -0
  289. package/dist/firestore/index.js +29 -0
  290. package/dist/firestore/index.js.map +1 -0
  291. package/dist/firestore/reducers/defaults.d.ts +10 -0
  292. package/dist/firestore/reducers/defaults.d.ts.map +1 -0
  293. package/dist/firestore/reducers/defaults.js +37 -0
  294. package/dist/firestore/reducers/defaults.js.map +1 -0
  295. package/dist/firestore/reducers/documentEditor.d.ts +23 -0
  296. package/dist/firestore/reducers/documentEditor.d.ts.map +1 -0
  297. package/dist/firestore/reducers/documentEditor.js +201 -0
  298. package/dist/firestore/reducers/documentEditor.js.map +1 -0
  299. package/dist/firestore/reducers/tree.d.ts +28 -0
  300. package/dist/firestore/reducers/tree.d.ts.map +1 -0
  301. package/dist/firestore/reducers/tree.js +129 -0
  302. package/dist/firestore/reducers/tree.js.map +1 -0
  303. package/dist/firestore/reducers/types.d.ts +115 -0
  304. package/dist/firestore/reducers/types.d.ts.map +1 -0
  305. package/dist/firestore/reducers/types.js +2 -0
  306. package/dist/firestore/reducers/types.js.map +1 -0
  307. package/dist/firestore/reducers/validation.d.ts +25 -0
  308. package/dist/firestore/reducers/validation.d.ts.map +1 -0
  309. package/dist/firestore/reducers/validation.js +121 -0
  310. package/dist/firestore/reducers/validation.js.map +1 -0
  311. package/dist/firestore/types.d.ts +77 -0
  312. package/dist/firestore/types.d.ts.map +1 -0
  313. package/dist/firestore/types.js +196 -0
  314. package/dist/firestore/types.js.map +1 -0
  315. package/dist/firestore/validation/ids.d.ts +23 -0
  316. package/dist/firestore/validation/ids.d.ts.map +1 -0
  317. package/dist/firestore/validation/ids.js +46 -0
  318. package/dist/firestore/validation/ids.js.map +1 -0
  319. package/dist/firestore/valueEquality.d.ts +4 -0
  320. package/dist/firestore/valueEquality.d.ts.map +1 -0
  321. package/dist/firestore/valueEquality.js +44 -0
  322. package/dist/firestore/valueEquality.js.map +1 -0
  323. package/dist/index.d.ts +2 -0
  324. package/dist/index.d.ts.map +1 -0
  325. package/dist/index.js +2 -0
  326. package/dist/index.js.map +1 -0
  327. package/dist/primitives/Badge.d.ts +28 -0
  328. package/dist/primitives/Badge.d.ts.map +1 -0
  329. package/dist/primitives/Badge.js +11 -0
  330. package/dist/primitives/Badge.js.map +1 -0
  331. package/dist/primitives/ConfirmDialog.d.ts +42 -0
  332. package/dist/primitives/ConfirmDialog.d.ts.map +1 -0
  333. package/dist/primitives/ConfirmDialog.js +61 -0
  334. package/dist/primitives/ConfirmDialog.js.map +1 -0
  335. package/dist/primitives/CopyButton.d.ts +28 -0
  336. package/dist/primitives/CopyButton.d.ts.map +1 -0
  337. package/dist/primitives/CopyButton.js +27 -0
  338. package/dist/primitives/CopyButton.js.map +1 -0
  339. package/dist/primitives/JsonView.d.ts +29 -0
  340. package/dist/primitives/JsonView.d.ts.map +1 -0
  341. package/dist/primitives/JsonView.js +56 -0
  342. package/dist/primitives/JsonView.js.map +1 -0
  343. package/dist/primitives/SegmentedControl.d.ts +37 -0
  344. package/dist/primitives/SegmentedControl.d.ts.map +1 -0
  345. package/dist/primitives/SegmentedControl.js +18 -0
  346. package/dist/primitives/SegmentedControl.js.map +1 -0
  347. package/dist/primitives/Toast.d.ts +48 -0
  348. package/dist/primitives/Toast.d.ts.map +1 -0
  349. package/dist/primitives/Toast.js +60 -0
  350. package/dist/primitives/Toast.js.map +1 -0
  351. package/dist/primitives/VirtualList.d.ts +37 -0
  352. package/dist/primitives/VirtualList.d.ts.map +1 -0
  353. package/dist/primitives/VirtualList.js +47 -0
  354. package/dist/primitives/VirtualList.js.map +1 -0
  355. package/dist/primitives/hooks/useContainerSize.d.ts +29 -0
  356. package/dist/primitives/hooks/useContainerSize.d.ts.map +1 -0
  357. package/dist/primitives/hooks/useContainerSize.js +45 -0
  358. package/dist/primitives/hooks/useContainerSize.js.map +1 -0
  359. package/dist/primitives/hooks/useUpdateHighlights.d.ts +18 -0
  360. package/dist/primitives/hooks/useUpdateHighlights.d.ts.map +1 -0
  361. package/dist/primitives/hooks/useUpdateHighlights.js +84 -0
  362. package/dist/primitives/hooks/useUpdateHighlights.js.map +1 -0
  363. package/dist/primitives/index.d.ts +11 -0
  364. package/dist/primitives/index.d.ts.map +1 -0
  365. package/dist/primitives/index.js +11 -0
  366. package/dist/primitives/index.js.map +1 -0
  367. package/dist/primitives/useConfirm.d.ts +34 -0
  368. package/dist/primitives/useConfirm.d.ts.map +1 -0
  369. package/dist/primitives/useConfirm.js +63 -0
  370. package/dist/primitives/useConfirm.js.map +1 -0
  371. package/dist/rtdb/components/RtdbPathBar.d.ts +31 -0
  372. package/dist/rtdb/components/RtdbPathBar.d.ts.map +1 -0
  373. package/dist/rtdb/components/RtdbPathBar.js +47 -0
  374. package/dist/rtdb/components/RtdbPathBar.js.map +1 -0
  375. package/dist/rtdb/components/RtdbTree.d.ts +38 -0
  376. package/dist/rtdb/components/RtdbTree.d.ts.map +1 -0
  377. package/dist/rtdb/components/RtdbTree.js +104 -0
  378. package/dist/rtdb/components/RtdbTree.js.map +1 -0
  379. package/dist/rtdb/editor.d.ts +25 -0
  380. package/dist/rtdb/editor.d.ts.map +1 -0
  381. package/dist/rtdb/editor.js +79 -0
  382. package/dist/rtdb/editor.js.map +1 -0
  383. package/dist/rtdb/hooks/useRtdbTree.d.ts +33 -0
  384. package/dist/rtdb/hooks/useRtdbTree.d.ts.map +1 -0
  385. package/dist/rtdb/hooks/useRtdbTree.js +67 -0
  386. package/dist/rtdb/hooks/useRtdbTree.js.map +1 -0
  387. package/dist/rtdb/index.d.ts +17 -0
  388. package/dist/rtdb/index.d.ts.map +1 -0
  389. package/dist/rtdb/index.js +21 -0
  390. package/dist/rtdb/index.js.map +1 -0
  391. package/dist/rtdb/pathInput.d.ts +28 -0
  392. package/dist/rtdb/pathInput.d.ts.map +1 -0
  393. package/dist/rtdb/pathInput.js +40 -0
  394. package/dist/rtdb/pathInput.js.map +1 -0
  395. package/dist/rtdb/reducers/tree.d.ts +86 -0
  396. package/dist/rtdb/reducers/tree.d.ts.map +1 -0
  397. package/dist/rtdb/reducers/tree.js +131 -0
  398. package/dist/rtdb/reducers/tree.js.map +1 -0
  399. package/dist/rtdb/rtdbApi.d.ts +20 -0
  400. package/dist/rtdb/rtdbApi.d.ts.map +1 -0
  401. package/dist/rtdb/rtdbApi.js +2 -0
  402. package/dist/rtdb/rtdbApi.js.map +1 -0
  403. package/dist/rtdb/values.d.ts +50 -0
  404. package/dist/rtdb/values.d.ts.map +1 -0
  405. package/dist/rtdb/values.js +186 -0
  406. package/dist/rtdb/values.js.map +1 -0
  407. package/dist/rules/components/DenialInspector.d.ts +18 -0
  408. package/dist/rules/components/DenialInspector.d.ts.map +1 -0
  409. package/dist/rules/components/DenialInspector.js +58 -0
  410. package/dist/rules/components/DenialInspector.js.map +1 -0
  411. package/dist/rules/components/format.d.ts +56 -0
  412. package/dist/rules/components/format.d.ts.map +1 -0
  413. package/dist/rules/components/format.js +137 -0
  414. package/dist/rules/components/format.js.map +1 -0
  415. package/dist/rules/components/index.d.ts +4 -0
  416. package/dist/rules/components/index.d.ts.map +1 -0
  417. package/dist/rules/components/index.js +4 -0
  418. package/dist/rules/components/index.js.map +1 -0
  419. package/dist/rules/components/scope.d.ts +10 -0
  420. package/dist/rules/components/scope.d.ts.map +1 -0
  421. package/dist/rules/components/scope.js +72 -0
  422. package/dist/rules/components/scope.js.map +1 -0
  423. package/dist/rules/hooks/index.d.ts +2 -0
  424. package/dist/rules/hooks/index.d.ts.map +1 -0
  425. package/dist/rules/hooks/index.js +2 -0
  426. package/dist/rules/hooks/index.js.map +1 -0
  427. package/dist/rules/hooks/useDenialTrace.d.ts +51 -0
  428. package/dist/rules/hooks/useDenialTrace.d.ts.map +1 -0
  429. package/dist/rules/hooks/useDenialTrace.js +58 -0
  430. package/dist/rules/hooks/useDenialTrace.js.map +1 -0
  431. package/dist/rules/index.d.ts +14 -0
  432. package/dist/rules/index.d.ts.map +1 -0
  433. package/dist/rules/index.js +13 -0
  434. package/dist/rules/index.js.map +1 -0
  435. package/dist/rules/types.d.ts +75 -0
  436. package/dist/rules/types.d.ts.map +1 -0
  437. package/dist/rules/types.js +2 -0
  438. package/dist/rules/types.js.map +1 -0
  439. package/dist/storage/collisionRename.d.ts +73 -0
  440. package/dist/storage/collisionRename.d.ts.map +1 -0
  441. package/dist/storage/collisionRename.js +113 -0
  442. package/dist/storage/collisionRename.js.map +1 -0
  443. package/dist/storage/components/DeleteSelectionWithConfirm.d.ts +66 -0
  444. package/dist/storage/components/DeleteSelectionWithConfirm.d.ts.map +1 -0
  445. package/dist/storage/components/DeleteSelectionWithConfirm.js +82 -0
  446. package/dist/storage/components/DeleteSelectionWithConfirm.js.map +1 -0
  447. package/dist/storage/components/ObjectBrowser.d.ts +78 -0
  448. package/dist/storage/components/ObjectBrowser.d.ts.map +1 -0
  449. package/dist/storage/components/ObjectBrowser.js +60 -0
  450. package/dist/storage/components/ObjectBrowser.js.map +1 -0
  451. package/dist/storage/components/ObjectInspector.d.ts +43 -0
  452. package/dist/storage/components/ObjectInspector.d.ts.map +1 -0
  453. package/dist/storage/components/ObjectInspector.js +92 -0
  454. package/dist/storage/components/ObjectInspector.js.map +1 -0
  455. package/dist/storage/components/PathBreadcrumb.d.ts +30 -0
  456. package/dist/storage/components/PathBreadcrumb.d.ts.map +1 -0
  457. package/dist/storage/components/PathBreadcrumb.js +26 -0
  458. package/dist/storage/components/PathBreadcrumb.js.map +1 -0
  459. package/dist/storage/components/UploadDropzone.d.ts +50 -0
  460. package/dist/storage/components/UploadDropzone.d.ts.map +1 -0
  461. package/dist/storage/components/UploadDropzone.js +109 -0
  462. package/dist/storage/components/UploadDropzone.js.map +1 -0
  463. package/dist/storage/folderPlaceholder.d.ts +20 -0
  464. package/dist/storage/folderPlaceholder.d.ts.map +1 -0
  465. package/dist/storage/folderPlaceholder.js +34 -0
  466. package/dist/storage/folderPlaceholder.js.map +1 -0
  467. package/dist/storage/hooks/index.d.ts +9 -0
  468. package/dist/storage/hooks/index.d.ts.map +1 -0
  469. package/dist/storage/hooks/index.js +9 -0
  470. package/dist/storage/hooks/index.js.map +1 -0
  471. package/dist/storage/hooks/useMetadataEditor.d.ts +114 -0
  472. package/dist/storage/hooks/useMetadataEditor.d.ts.map +1 -0
  473. package/dist/storage/hooks/useMetadataEditor.js +193 -0
  474. package/dist/storage/hooks/useMetadataEditor.js.map +1 -0
  475. package/dist/storage/hooks/useObjectUpload.d.ts +105 -0
  476. package/dist/storage/hooks/useObjectUpload.d.ts.map +1 -0
  477. package/dist/storage/hooks/useObjectUpload.js +134 -0
  478. package/dist/storage/hooks/useObjectUpload.js.map +1 -0
  479. package/dist/storage/hooks/usePathState.d.ts +43 -0
  480. package/dist/storage/hooks/usePathState.d.ts.map +1 -0
  481. package/dist/storage/hooks/usePathState.js +42 -0
  482. package/dist/storage/hooks/usePathState.js.map +1 -0
  483. package/dist/storage/hooks/useStorageDelete.d.ts +74 -0
  484. package/dist/storage/hooks/useStorageDelete.d.ts.map +1 -0
  485. package/dist/storage/hooks/useStorageDelete.js +120 -0
  486. package/dist/storage/hooks/useStorageDelete.js.map +1 -0
  487. package/dist/storage/hooks/useStorageList.d.ts +72 -0
  488. package/dist/storage/hooks/useStorageList.d.ts.map +1 -0
  489. package/dist/storage/hooks/useStorageList.js +164 -0
  490. package/dist/storage/hooks/useStorageList.js.map +1 -0
  491. package/dist/storage/hooks/useStorageObject.d.ts +33 -0
  492. package/dist/storage/hooks/useStorageObject.d.ts.map +1 -0
  493. package/dist/storage/hooks/useStorageObject.js +114 -0
  494. package/dist/storage/hooks/useStorageObject.js.map +1 -0
  495. package/dist/storage/hooks/useStorageRulesGate.d.ts +116 -0
  496. package/dist/storage/hooks/useStorageRulesGate.d.ts.map +1 -0
  497. package/dist/storage/hooks/useStorageRulesGate.js +150 -0
  498. package/dist/storage/hooks/useStorageRulesGate.js.map +1 -0
  499. package/dist/storage/hooks/useStorageSelection.d.ts +32 -0
  500. package/dist/storage/hooks/useStorageSelection.d.ts.map +1 -0
  501. package/dist/storage/hooks/useStorageSelection.js +55 -0
  502. package/dist/storage/hooks/useStorageSelection.js.map +1 -0
  503. package/dist/storage/index.d.ts +11 -0
  504. package/dist/storage/index.d.ts.map +1 -0
  505. package/dist/storage/index.js +17 -0
  506. package/dist/storage/index.js.map +1 -0
  507. package/dist/storage/pendingPrefixes.d.ts +77 -0
  508. package/dist/storage/pendingPrefixes.d.ts.map +1 -0
  509. package/dist/storage/pendingPrefixes.js +104 -0
  510. package/dist/storage/pendingPrefixes.js.map +1 -0
  511. package/dist/storage/previews.d.ts +51 -0
  512. package/dist/storage/previews.d.ts.map +1 -0
  513. package/dist/storage/previews.js +73 -0
  514. package/dist/storage/previews.js.map +1 -0
  515. package/dist/storage/storageApi.d.ts +30 -0
  516. package/dist/storage/storageApi.d.ts.map +1 -0
  517. package/dist/storage/storageApi.js +20 -0
  518. package/dist/storage/storageApi.js.map +1 -0
  519. package/dist/traffic/components/RuleHeatmap.d.ts +34 -0
  520. package/dist/traffic/components/RuleHeatmap.d.ts.map +1 -0
  521. package/dist/traffic/components/RuleHeatmap.js +40 -0
  522. package/dist/traffic/components/RuleHeatmap.js.map +1 -0
  523. package/dist/traffic/components/TrafficDetail.d.ts +33 -0
  524. package/dist/traffic/components/TrafficDetail.d.ts.map +1 -0
  525. package/dist/traffic/components/TrafficDetail.js +28 -0
  526. package/dist/traffic/components/TrafficDetail.js.map +1 -0
  527. package/dist/traffic/components/TrafficGroupRow.d.ts +28 -0
  528. package/dist/traffic/components/TrafficGroupRow.d.ts.map +1 -0
  529. package/dist/traffic/components/TrafficGroupRow.js +25 -0
  530. package/dist/traffic/components/TrafficGroupRow.js.map +1 -0
  531. package/dist/traffic/components/TrafficLineChart.d.ts +37 -0
  532. package/dist/traffic/components/TrafficLineChart.d.ts.map +1 -0
  533. package/dist/traffic/components/TrafficLineChart.js +49 -0
  534. package/dist/traffic/components/TrafficLineChart.js.map +1 -0
  535. package/dist/traffic/components/TrafficLog.d.ts +52 -0
  536. package/dist/traffic/components/TrafficLog.d.ts.map +1 -0
  537. package/dist/traffic/components/TrafficLog.js +34 -0
  538. package/dist/traffic/components/TrafficLog.js.map +1 -0
  539. package/dist/traffic/components/TrafficMetricCards.d.ts +26 -0
  540. package/dist/traffic/components/TrafficMetricCards.d.ts.map +1 -0
  541. package/dist/traffic/components/TrafficMetricCards.js +24 -0
  542. package/dist/traffic/components/TrafficMetricCards.js.map +1 -0
  543. package/dist/traffic/components/TrafficRow.d.ts +40 -0
  544. package/dist/traffic/components/TrafficRow.d.ts.map +1 -0
  545. package/dist/traffic/components/TrafficRow.js +27 -0
  546. package/dist/traffic/components/TrafficRow.js.map +1 -0
  547. package/dist/traffic/components/TrafficStats.d.ts +18 -0
  548. package/dist/traffic/components/TrafficStats.d.ts.map +1 -0
  549. package/dist/traffic/components/TrafficStats.js +19 -0
  550. package/dist/traffic/components/TrafficStats.js.map +1 -0
  551. package/dist/traffic/components/TrafficTimeline.d.ts +88 -0
  552. package/dist/traffic/components/TrafficTimeline.d.ts.map +1 -0
  553. package/dist/traffic/components/TrafficTimeline.js +86 -0
  554. package/dist/traffic/components/TrafficTimeline.js.map +1 -0
  555. package/dist/traffic/components/format.d.ts +13 -0
  556. package/dist/traffic/components/format.d.ts.map +1 -0
  557. package/dist/traffic/components/format.js +24 -0
  558. package/dist/traffic/components/format.js.map +1 -0
  559. package/dist/traffic/components/index.d.ts +11 -0
  560. package/dist/traffic/components/index.d.ts.map +1 -0
  561. package/dist/traffic/components/index.js +11 -0
  562. package/dist/traffic/components/index.js.map +1 -0
  563. package/dist/traffic/hooks/index.d.ts +8 -0
  564. package/dist/traffic/hooks/index.d.ts.map +1 -0
  565. package/dist/traffic/hooks/index.js +8 -0
  566. package/dist/traffic/hooks/index.js.map +1 -0
  567. package/dist/traffic/hooks/useRuleHeatmap.d.ts +33 -0
  568. package/dist/traffic/hooks/useRuleHeatmap.d.ts.map +1 -0
  569. package/dist/traffic/hooks/useRuleHeatmap.js +54 -0
  570. package/dist/traffic/hooks/useRuleHeatmap.js.map +1 -0
  571. package/dist/traffic/hooks/useTrafficBuckets.d.ts +71 -0
  572. package/dist/traffic/hooks/useTrafficBuckets.d.ts.map +1 -0
  573. package/dist/traffic/hooks/useTrafficBuckets.js +74 -0
  574. package/dist/traffic/hooks/useTrafficBuckets.js.map +1 -0
  575. package/dist/traffic/hooks/useTrafficFilter.d.ts +40 -0
  576. package/dist/traffic/hooks/useTrafficFilter.d.ts.map +1 -0
  577. package/dist/traffic/hooks/useTrafficFilter.js +33 -0
  578. package/dist/traffic/hooks/useTrafficFilter.js.map +1 -0
  579. package/dist/traffic/hooks/useTrafficGroups.d.ts +47 -0
  580. package/dist/traffic/hooks/useTrafficGroups.d.ts.map +1 -0
  581. package/dist/traffic/hooks/useTrafficGroups.js +73 -0
  582. package/dist/traffic/hooks/useTrafficGroups.js.map +1 -0
  583. package/dist/traffic/hooks/useTrafficMetrics.d.ts +66 -0
  584. package/dist/traffic/hooks/useTrafficMetrics.d.ts.map +1 -0
  585. package/dist/traffic/hooks/useTrafficMetrics.js +156 -0
  586. package/dist/traffic/hooks/useTrafficMetrics.js.map +1 -0
  587. package/dist/traffic/hooks/useTrafficMonitor.d.ts +56 -0
  588. package/dist/traffic/hooks/useTrafficMonitor.d.ts.map +1 -0
  589. package/dist/traffic/hooks/useTrafficMonitor.js +58 -0
  590. package/dist/traffic/hooks/useTrafficMonitor.js.map +1 -0
  591. package/dist/traffic/hooks/useTrafficStats.d.ts +32 -0
  592. package/dist/traffic/hooks/useTrafficStats.d.ts.map +1 -0
  593. package/dist/traffic/hooks/useTrafficStats.js +45 -0
  594. package/dist/traffic/hooks/useTrafficStats.js.map +1 -0
  595. package/dist/traffic/index.d.ts +4 -0
  596. package/dist/traffic/index.d.ts.map +1 -0
  597. package/dist/traffic/index.js +3 -0
  598. package/dist/traffic/index.js.map +1 -0
  599. package/dist/traffic/types.d.ts +72 -0
  600. package/dist/traffic/types.d.ts.map +1 -0
  601. package/dist/traffic/types.js +10 -0
  602. package/dist/traffic/types.js.map +1 -0
  603. package/package.json +127 -0
@@ -0,0 +1,93 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { asVectorView } from '../types.js';
4
+ /** How many leading components to show in the truncated preview. The
5
+ * mock (`c-data.html`) renders four then an ellipsis. */
6
+ const PREVIEW_COUNT = 4;
7
+ /**
8
+ * Render a `[a, b, c, … ]` preview of the first {@link PREVIEW_COUNT}
9
+ * components. A vector that's already short enough is shown in full
10
+ * without the trailing ellipsis.
11
+ */
12
+ function previewText(values) {
13
+ if (values.length <= PREVIEW_COUNT) {
14
+ return `[${values.join(', ')}]`;
15
+ }
16
+ const head = values.slice(0, PREVIEW_COUNT).join(', ');
17
+ return `[${head}, …]`;
18
+ }
19
+ /**
20
+ * Read view for a vector (embedding). Mirrors the mock: a
21
+ * `vector · <dims>` type chip plus a truncated value preview. The full
22
+ * 768-float array is never rendered inline — it's noise and a perf
23
+ * hazard. `data-dimension` carries the dimension for styling/queries.
24
+ */
25
+ function VectorDisplay({ value, path }) {
26
+ const view = asVectorView(value);
27
+ if (!view) {
28
+ // Should be unreachable: the renderer only dispatches here when
29
+ // `inferType` already classified the value as `vector`. Render a
30
+ // defensive empty marker rather than throwing.
31
+ return (_jsx("span", { "data-pyric-field-type": "vector", "data-pyric-field-path": path }));
32
+ }
33
+ return (_jsxs("span", { "data-pyric-field-type": "vector", "data-pyric-field-path": path, "data-dimension": String(view.dimension), children: [_jsx("span", { "data-pyric-vector-dims": true, children: `vector · ${view.dimension}` }), _jsx("span", { "data-pyric-vector-preview": true, children: previewText(view.values) })] }));
34
+ }
35
+ /**
36
+ * Parse the textarea contents into a wire-sentinel vector, or an error.
37
+ * Accepts only a JSON array of numbers — the whole-value replace
38
+ * contract. Anything else (bad JSON, non-array, non-numeric element)
39
+ * is rejected and the previous value is kept by the caller.
40
+ */
41
+ export function parseVectorInput(text) {
42
+ let parsed;
43
+ try {
44
+ parsed = JSON.parse(text);
45
+ }
46
+ catch {
47
+ return { ok: false, error: 'Invalid JSON' };
48
+ }
49
+ if (!Array.isArray(parsed) || !parsed.every((n) => typeof n === 'number')) {
50
+ return { ok: false, error: 'Expected a JSON array of numbers' };
51
+ }
52
+ return { ok: true, value: { __type__: '__vector__', value: parsed } };
53
+ }
54
+ /**
55
+ * Edit affordance for a vector. Deliberately NOT a per-element grid —
56
+ * a 768-dim embedding isn't hand-tuned float by float. The contract is
57
+ * "replace the whole value": paste a JSON number array and commit. The
58
+ * dimension + a note are shown so the editor is honest about what it is.
59
+ *
60
+ * On commit, we emit the value back in the same wire-sentinel shape the
61
+ * read side already understands (`{__type__:'__vector__', value}`), so a
62
+ * round-trip through `inferType` re-classifies it as `vector`. Invalid
63
+ * JSON / non-numeric input leaves the previous value in place (same
64
+ * forgiving stance as the bytes + geopoint editors).
65
+ */
66
+ function VectorEdit({ value, onChange, error, path }) {
67
+ const view = asVectorView(value);
68
+ const initial = view ? JSON.stringify(view.values) : '[]';
69
+ const [draft, setDraft] = useState(initial);
70
+ const [parseError, setParseError] = useState(undefined);
71
+ const commit = (text) => {
72
+ setDraft(text);
73
+ const result = parseVectorInput(text);
74
+ if (!result.ok) {
75
+ setParseError(result.error);
76
+ return;
77
+ }
78
+ setParseError(undefined);
79
+ // Re-emit in the wire-sentinel shape so the read side + inferType
80
+ // recognize it as a vector again without depending on a backend
81
+ // VectorValue class being importable here.
82
+ onChange(result.value);
83
+ };
84
+ const dims = view ? view.dimension : 0;
85
+ const shown = parseError ?? error;
86
+ return (_jsxs("label", { "data-pyric-field-type": "vector", "data-pyric-field-path": path, "data-dimension": String(dims), "data-pyric-error": shown ? '' : undefined, children: [_jsx("span", { "data-pyric-vector-dims": true, children: `vector · ${dims}` }), _jsx("span", { "data-pyric-vector-note": true, children: "Replace whole. Paste a JSON number array." }), _jsx("textarea", { "data-pyric-vector-raw": true, value: draft, onChange: (e) => commit(e.target.value), "aria-invalid": shown ? 'true' : undefined, "aria-label": "Vector value (JSON number array)" }), shown ? _jsx("span", { "data-pyric-error-message": true, children: shown }) : null] }));
87
+ }
88
+ export const vectorEditor = {
89
+ type: 'vector',
90
+ Display: VectorDisplay,
91
+ Edit: VectorEdit,
92
+ };
93
+ //# sourceMappingURL=vector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vector.js","sourceRoot":"","sources":["../../../src/firestore/fieldEditors/vector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,YAAY,EAAmB,MAAM,aAAa,CAAC;AAG5D;0DAC0D;AAC1D,MAAM,aAAa,GAAG,CAAC,CAAC;AAExB;;;;GAIG;AACH,SAAS,WAAW,CAAC,MAAgB;IACnC,IAAI,MAAM,CAAC,MAAM,IAAI,aAAa,EAAE,CAAC;QACnC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;IAClC,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvD,OAAO,IAAI,IAAI,MAAM,CAAC;AACxB,CAAC;AAED;;;;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CAAC,kBACzB,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,gBAC7B,kCAAkC,GAC7C,EACD,KAAK,CAAC,CAAC,CAAC,2DAAgC,KAAK,GAAQ,CAAC,CAAC,CAAC,IAAI,IACvD,CACT,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAiC;IACxD,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,UAAU;CACjB,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { type ReactNode } from 'react';
2
+ /**
3
+ * The modular Firestore functions the data hooks call, as an INJECTABLE bundle.
4
+ *
5
+ * WHY: the hooks default to the in-process `pyric/firestore` API, but Pyric
6
+ * Studio's served mode drives the SAME ops over a SharedWorker via a PARALLEL
7
+ * modular client (`@pyric/cli/serve/worker`: its own `collection`/`getDocs`/...
8
+ * over a `MessagePort`, and a `ClientDb` that is not a `pyric/firestore`
9
+ * `Firestore`). Statically importing the in-process fns hardwires the hooks to
10
+ * the in-page sandbox; reading them from this context lets a consumer inject the
11
+ * worker client's fns so the hooks operate on the live worker backend without
12
+ * the hooks (or the components) knowing which backend they hit.
13
+ *
14
+ * The bundle is typed to the in-process signatures. A worker bundle is adapted
15
+ * (cast) to this shape at the Studio boundary: the worker handles + snapshots
16
+ * are runtime-compatible at the surface the hooks use (`.id` / `.data()` /
17
+ * `.docs` / `.ref`), which is the contract function-injection relies on.
18
+ *
19
+ * Default = the real `pyric/firestore` fns, so every existing consumer (the
20
+ * dev-seed review build, tests, any app embedding `@pyric/ui`) is unchanged: no
21
+ * provider needed unless you are swapping the backend.
22
+ */
23
+ export type FirestoreApi = Pick<typeof import('pyric/firestore'), 'addDoc' | 'collection' | 'deleteDoc' | 'doc' | 'getDoc' | 'getDocs' | 'limit' | 'onSnapshot' | 'query' | 'setDoc' | 'startAfter'>;
24
+ /** Read the active Firestore API bundle (defaults to in-process `pyric/firestore`). */
25
+ export declare function useFirestoreApi(): FirestoreApi;
26
+ /**
27
+ * Provide a Firestore API bundle to the subtree. Pyric Studio wraps its data
28
+ * surface with this, supplying the in-process bundle for dev-seed review and the
29
+ * SharedWorker client bundle under `pyric dev --ui`.
30
+ */
31
+ export declare function FirestoreApiProvider({ value, children, }: {
32
+ value: FirestoreApi;
33
+ children: ReactNode;
34
+ }): import("react").FunctionComponentElement<import("react").ProviderProps<FirestoreApi>>;
35
+ //# sourceMappingURL=firestoreApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firestoreApi.d.ts","sourceRoot":"","sources":["../../src/firestore/firestoreApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAejF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,cAAc,iBAAiB,CAAC,EAC9B,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,KAAK,GACL,QAAQ,GACR,SAAS,GACT,OAAO,GACP,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,YAAY,CACf,CAAC;AAkBF,uFAAuF;AACvF,wBAAgB,eAAe,IAAI,YAAY,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;CACrB,yFAEA"}
@@ -0,0 +1,29 @@
1
+ import { createContext, createElement, useContext } from 'react';
2
+ import { addDoc, collection, deleteDoc, doc, getDoc, getDocs, limit, onSnapshot, query, setDoc, startAfter, } from 'pyric/firestore';
3
+ const inProcessFirestoreApi = {
4
+ addDoc,
5
+ collection,
6
+ deleteDoc,
7
+ doc,
8
+ getDoc,
9
+ getDocs,
10
+ limit,
11
+ onSnapshot,
12
+ query,
13
+ setDoc,
14
+ startAfter,
15
+ };
16
+ const FirestoreApiContext = createContext(inProcessFirestoreApi);
17
+ /** Read the active Firestore API bundle (defaults to in-process `pyric/firestore`). */
18
+ export function useFirestoreApi() {
19
+ return useContext(FirestoreApiContext);
20
+ }
21
+ /**
22
+ * Provide a Firestore API bundle to the subtree. Pyric Studio wraps its data
23
+ * surface with this, supplying the in-process bundle for dev-seed review and the
24
+ * SharedWorker client bundle under `pyric dev --ui`.
25
+ */
26
+ export function FirestoreApiProvider({ value, children, }) {
27
+ return createElement(FirestoreApiContext.Provider, { value }, children);
28
+ }
29
+ //# sourceMappingURL=firestoreApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firestoreApi.js","sourceRoot":"","sources":["../../src/firestore/firestoreApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;AACjF,OAAO,EACL,MAAM,EACN,UAAU,EACV,SAAS,EACT,GAAG,EACH,MAAM,EACN,OAAO,EACP,KAAK,EACL,UAAU,EACV,KAAK,EACL,MAAM,EACN,UAAU,GACX,MAAM,iBAAiB,CAAC;AAsCzB,MAAM,qBAAqB,GAAiB;IAC1C,MAAM;IACN,UAAU;IACV,SAAS;IACT,GAAG;IACH,MAAM;IACN,OAAO;IACP,KAAK;IACL,UAAU;IACV,KAAK;IACL,MAAM;IACN,UAAU;CACX,CAAC;AAEF,MAAM,mBAAmB,GAAG,aAAa,CAAe,qBAAqB,CAAC,CAAC;AAE/E,uFAAuF;AACvF,MAAM,UAAU,eAAe;IAC7B,OAAO,UAAU,CAAC,mBAAmB,CAAC,CAAC;AACzC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,EACnC,KAAK,EACL,QAAQ,GAIT;IACC,OAAO,aAAa,CAAC,mBAAmB,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Coerce an arbitrary thrown value into an `Error` with a useful
3
+ * `.message`. The naive `new Error(String(err))` produces the literal
4
+ * string `"[object Object]"` when `err` is a non-Error object shape
5
+ * — which is exactly what Firestore's `onSnapshot` error callback
6
+ * receives for `FirestoreError`-like values (`{ code, message, …}`).
7
+ *
8
+ * Strategy:
9
+ * - `Error` → returned unchanged.
10
+ * - `string` → `new Error(value)`.
11
+ * - `{ message }` → `new Error(message)` (preserves Firestore's
12
+ * stringified message), with `code` appended when present.
13
+ * - anything else → `new Error(JSON.stringify(value))` (no more
14
+ * "[object Object]").
15
+ */
16
+ export declare function coerceError(value: unknown): Error;
17
+ //# sourceMappingURL=coerceError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coerceError.d.ts","sourceRoot":"","sources":["../../../src/firestore/hooks/coerceError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAkBjD"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Coerce an arbitrary thrown value into an `Error` with a useful
3
+ * `.message`. The naive `new Error(String(err))` produces the literal
4
+ * string `"[object Object]"` when `err` is a non-Error object shape
5
+ * — which is exactly what Firestore's `onSnapshot` error callback
6
+ * receives for `FirestoreError`-like values (`{ code, message, …}`).
7
+ *
8
+ * Strategy:
9
+ * - `Error` → returned unchanged.
10
+ * - `string` → `new Error(value)`.
11
+ * - `{ message }` → `new Error(message)` (preserves Firestore's
12
+ * stringified message), with `code` appended when present.
13
+ * - anything else → `new Error(JSON.stringify(value))` (no more
14
+ * "[object Object]").
15
+ */
16
+ export function coerceError(value) {
17
+ if (value instanceof Error)
18
+ return value;
19
+ if (typeof value === 'string')
20
+ return new Error(value);
21
+ if (value && typeof value === 'object') {
22
+ const obj = value;
23
+ const msg = typeof obj.message === 'string' ? obj.message : null;
24
+ const code = typeof obj.code === 'string' ? obj.code : null;
25
+ if (msg && code)
26
+ return new Error(`[${code}] ${msg}`);
27
+ if (msg)
28
+ return new Error(msg);
29
+ if (code)
30
+ return new Error(code);
31
+ try {
32
+ return new Error(JSON.stringify(value));
33
+ }
34
+ catch {
35
+ // Cyclic objects — bail to a type tag rather than crash.
36
+ return new Error(Object.prototype.toString.call(value));
37
+ }
38
+ }
39
+ return new Error(String(value));
40
+ }
41
+ //# sourceMappingURL=coerceError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coerceError.js","sourceRoot":"","sources":["../../../src/firestore/hooks/coerceError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,IAAI,KAAK,YAAY,KAAK;QAAE,OAAO,KAAK,CAAC;IACzC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;IACvD,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,MAAM,GAAG,GAAG,KAA8C,CAAC;QAC3D,MAAM,GAAG,GAAG,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;QACjE,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QAC5D,IAAI,GAAG,IAAI,IAAI;YAAE,OAAO,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC,CAAC;QACtD,IAAI,GAAG;YAAE,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,IAAI;YAAE,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC;YACH,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1C,CAAC;QAAC,MAAM,CAAC;YACP,yDAAyD;YACzD,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IACD,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,10 @@
1
+ export { useFirestoreDoc, type SubscriptionState } from './useFirestoreDoc.js';
2
+ export { useFirestoreCollection } from './useFirestoreCollection.js';
3
+ export { useDocumentEditor, type UseDocumentEditorOptions, type UseDocumentEditorResult, } from './useDocumentEditor.js';
4
+ export { useCollectionList, type UseCollectionListOptions, type UseCollectionListResult, } from './useCollectionList.js';
5
+ export { useDocumentList, type UseDocumentListOptions, type UseDocumentListResult, } from './useDocumentList.js';
6
+ export { useDocumentSubcollections, type ListSubcollections, type UseDocumentSubcollectionsOptions, type UseDocumentSubcollectionsResult, } from './useDocumentSubcollections.js';
7
+ export { useRecursiveDelete, type RecursiveDeleteImpl, type RecursiveDeleteProgress, type UseRecursiveDeleteResult, } from './useRecursiveDelete.js';
8
+ export { useReferencePicker, type BrowseLocation, type UseReferencePickerOptions, type UseReferencePickerResult, } from './useReferencePicker.js';
9
+ export { useQueryBuilder, QUERY_OPS, MULTI_VALUE_OPS, type QueryOp, type QueryCondition, type QueryBuilderState, type QueryBuilderActions, type UseQueryBuilderOptions, type UseQueryBuilderResult, } from './useQueryBuilder.js';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/firestore/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACL,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,yBAAyB,EACzB,KAAK,kBAAkB,EACvB,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,GACrC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,GAC9B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,eAAe,EACf,SAAS,EACT,eAAe,EACf,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,10 @@
1
+ export { useFirestoreDoc } from './useFirestoreDoc.js';
2
+ export { useFirestoreCollection } from './useFirestoreCollection.js';
3
+ export { useDocumentEditor, } from './useDocumentEditor.js';
4
+ export { useCollectionList, } from './useCollectionList.js';
5
+ export { useDocumentList, } from './useDocumentList.js';
6
+ export { useDocumentSubcollections, } from './useDocumentSubcollections.js';
7
+ export { useRecursiveDelete, } from './useRecursiveDelete.js';
8
+ export { useReferencePicker, } from './useReferencePicker.js';
9
+ export { useQueryBuilder, QUERY_OPS, MULTI_VALUE_OPS, } from './useQueryBuilder.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/firestore/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAA0B,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACL,iBAAiB,GAGlB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,iBAAiB,GAGlB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,eAAe,GAGhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,yBAAyB,GAI1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,kBAAkB,GAInB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,kBAAkB,GAInB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,eAAe,EACf,SAAS,EACT,eAAe,GAOhB,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { type CollectionReference, type DocumentReference, type Firestore } from 'pyric/firestore';
2
+ export interface UseCollectionListOptions {
3
+ firestore: Firestore;
4
+ /** Parent document, or `null`/`undefined` for root collections. */
5
+ parent?: DocumentReference | null;
6
+ /**
7
+ * Injected collection-listing function. The library doesn't ship
8
+ * a default — the modular Web SDK doesn't expose `listCollections`
9
+ * on the client. Sandbox-backed apps usually wire
10
+ * `pyric/sandbox`'s in-process listing; production apps either
11
+ * pass a known list (e.g. from a schema) or call a server proxy.
12
+ */
13
+ listCollections: (firestore: Firestore, parent: DocumentReference | null | undefined) => Promise<CollectionReference[]>;
14
+ }
15
+ export interface UseCollectionListResult {
16
+ collections: CollectionReference[];
17
+ isLoading: boolean;
18
+ error: Error | undefined;
19
+ /** Re-run the listing function. */
20
+ refresh: () => void;
21
+ /**
22
+ * Create a new collection by writing its first document. Firestore
23
+ * collections don't exist independently of their documents —
24
+ * `setDoc` on the first child path materializes the collection.
25
+ */
26
+ createCollection: (collectionId: string, firstDoc: {
27
+ id: string;
28
+ data: Record<string, unknown>;
29
+ }) => Promise<DocumentReference>;
30
+ }
31
+ /**
32
+ * Operational read + create for collections under a parent (or root).
33
+ * Listing is injected because the modular Web SDK doesn't expose a
34
+ * native `listCollections` on the client — see options docs.
35
+ */
36
+ export declare function useCollectionList({ firestore, parent, listCollections, }: UseCollectionListOptions): UseCollectionListResult;
37
+ //# sourceMappingURL=useCollectionList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCollectionList.d.ts","sourceRoot":"","sources":["../../../src/firestore/hooks/useCollectionList.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,SAAS,CAAC;IACrB,mEAAmE;IACnE,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC;;;;;;OAMG;IACH,eAAe,EAAE,CACf,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,KACzC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,mBAAmB,EAAE,CAAC;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,mCAAmC;IACnC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,gBAAgB,EAAE,CAChB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,KACpD,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,MAAM,EACN,eAAe,GAChB,EAAE,wBAAwB,GAAG,uBAAuB,CAgDpD"}
@@ -0,0 +1,51 @@
1
+ import { useCallback, useEffect, useRef, useState } from 'react';
2
+ import { collection as collFn, doc as docFn, setDoc, } from 'pyric/firestore';
3
+ /**
4
+ * Operational read + create for collections under a parent (or root).
5
+ * Listing is injected because the modular Web SDK doesn't expose a
6
+ * native `listCollections` on the client — see options docs.
7
+ */
8
+ export function useCollectionList({ firestore, parent, listCollections, }) {
9
+ const [collections, setCollections] = useState([]);
10
+ const [isLoading, setIsLoading] = useState(true);
11
+ const [error, setError] = useState(undefined);
12
+ const [tick, setTick] = useState(0);
13
+ // Stable-ref the injected lister so re-renders with a fresh
14
+ // closure identity don't loop the effect — see useReferencePicker
15
+ // for the same pattern + rationale.
16
+ const listCollectionsRef = useRef(listCollections);
17
+ listCollectionsRef.current = listCollections;
18
+ useEffect(() => {
19
+ let cancelled = false;
20
+ setIsLoading(true);
21
+ setError(undefined);
22
+ listCollectionsRef.current(firestore, parent)
23
+ .then((list) => {
24
+ if (cancelled)
25
+ return;
26
+ setCollections(list);
27
+ setIsLoading(false);
28
+ })
29
+ .catch((e) => {
30
+ if (cancelled)
31
+ return;
32
+ setError(e instanceof Error ? e : new Error(String(e)));
33
+ setIsLoading(false);
34
+ });
35
+ return () => {
36
+ cancelled = true;
37
+ };
38
+ }, [firestore, parent, tick]);
39
+ const refresh = useCallback(() => setTick((n) => n + 1), []);
40
+ const createCollection = useCallback(async (collectionId, firstDoc) => {
41
+ const parentColl = parent
42
+ ? collFn(parent, collectionId)
43
+ : collFn(firestore, collectionId);
44
+ const ref = docFn(parentColl, firstDoc.id);
45
+ await setDoc(ref, firstDoc.data);
46
+ setTick((n) => n + 1);
47
+ return ref;
48
+ }, [firestore, parent]);
49
+ return { collections, isLoading, error, refresh, createCollection };
50
+ }
51
+ //# sourceMappingURL=useCollectionList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCollectionList.js","sourceRoot":"","sources":["../../../src/firestore/hooks/useCollectionList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,OAA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,KAAK,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;QACL,OAAO,GAAG,EAAE;YACV,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IAE9B,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAE7D,MAAM,gBAAgB,GAAG,WAAW,CAClC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE;QAC/B,MAAM,UAAU,GAAG,MAAM;YACvB,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC;YAC9B,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QACpC,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC3C,MAAM,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACtB,OAAO,GAAG,CAAC;IACb,CAAC,EACD,CAAC,SAAS,EAAE,MAAM,CAAC,CACpB,CAAC;IAEF,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AACtE,CAAC"}
@@ -0,0 +1,61 @@
1
+ import type { FieldType } from '../types.js';
2
+ import type { DocumentEditorAction, DocumentEditorState } from '../reducers/types.js';
3
+ export interface UseDocumentEditorOptions {
4
+ /** Initial document data — the same shape a `DocumentSnapshot.data()`
5
+ * call returns. */
6
+ initial?: Record<string, unknown>;
7
+ }
8
+ export interface UseDocumentEditorResult extends DocumentEditorState {
9
+ /** Convenience: `errorCount === 0`. */
10
+ isValid: boolean;
11
+ /** `true` once any modifying action has fired since the last
12
+ * `reset`. Cleared by `reset`. Does NOT clear when the user
13
+ * manually re-enters the original values — checking that would
14
+ * require a full serialization comparison on every dispatch. */
15
+ isDirty: boolean;
16
+ /** Raw dispatch — drops to the reducer-action surface. Prefer the
17
+ * named helpers below. */
18
+ dispatch: (action: DocumentEditorAction) => void;
19
+ /** Update a leaf value. */
20
+ setValue: (nodeId: string, value: unknown) => void;
21
+ /** Switch a node's type. Map/array nodes drop their children. */
22
+ setType: (nodeId: string, newType: FieldType) => void;
23
+ /** Set a map-child's key. */
24
+ setKey: (nodeId: string, key: string) => void;
25
+ /** Append a child to a map. */
26
+ addMapEntry: (parentId: string, key: string, childType: FieldType) => void;
27
+ /** Append a child to an array. Nested arrays are silently
28
+ * rejected by the reducer (Firestore disallows them). */
29
+ addArrayEntry: (parentId: string, childType: FieldType) => void;
30
+ /** Remove a node (and all its descendants). Removing the root is
31
+ * a no-op. */
32
+ remove: (nodeId: string) => void;
33
+ /** Restore the tree to its initial state. Clears `isDirty`. */
34
+ reset: () => void;
35
+ /** Replace the editor with a newly delivered snapshot and adopt it as the
36
+ * clean baseline. Intended for live document viewers. */
37
+ replaceData: (data: Record<string, unknown>) => void;
38
+ /** Mark one node touched (dispatch on blur). Gates error display —
39
+ * a freshly-added row stays quiet until the user leaves it. */
40
+ touch: (nodeId: string) => void;
41
+ /** Mark every node touched (dispatch on a submit attempt) so any
42
+ * hidden errors surface at once. */
43
+ touchAll: () => void;
44
+ /** Serialize the tree back to a Firestore-shaped object suitable
45
+ * for `setDoc` / `updateDoc`. */
46
+ toData: () => Record<string, unknown>;
47
+ }
48
+ /**
49
+ * Headless document editor. Owns the entire edit state for one
50
+ * document via a pure reducer. Consumers either render the bundled
51
+ * `<DocumentEditor>` compound component over this hook, or render
52
+ * their own tree using the returned state.
53
+ *
54
+ * The hook builds its tree from `initial` on first mount. Changing
55
+ * `initial` later does NOT rebuild the tree; live viewers explicitly call
56
+ * `replaceData()` when a newer snapshot should become the clean baseline.
57
+ * This matches the firebase-tools-ui pattern of treating the editor as a
58
+ * stateful workspace while still allowing snapshot-driven reconciliation.
59
+ */
60
+ export declare function useDocumentEditor(options?: UseDocumentEditorOptions): UseDocumentEditorResult;
61
+ //# sourceMappingURL=useDocumentEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDocumentEditor.d.ts","sourceRoot":"","sources":["../../../src/firestore/hooks/useDocumentEditor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,wBAAwB;IACvC;wBACoB;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB;IAClE,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB;;;qEAGiE;IACjE,OAAO,EAAE,OAAO,CAAC;IACjB;+BAC2B;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACjD,2BAA2B;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD,iEAAiE;IACjE,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,KAAK,IAAI,CAAC;IACtD,6BAA6B;IAC7B,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,+BAA+B;IAC/B,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;IAC3E;8DAC0D;IAC1D,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;IAChE;mBACe;IACf,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,+DAA+D;IAC/D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB;6DACyD;IACzD,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACrD;oEACgE;IAChE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC;yCACqC;IACrC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;sCACkC;IAClC,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,wBAA6B,GACrC,uBAAuB,CA0FzB"}
@@ -0,0 +1,71 @@
1
+ import { useCallback, useMemo, useReducer, useRef } from 'react';
2
+ import { initState, reducer } from '../reducers/documentEditor.js';
3
+ import { treeToData } from '../reducers/tree.js';
4
+ /**
5
+ * Headless document editor. Owns the entire edit state for one
6
+ * document via a pure reducer. Consumers either render the bundled
7
+ * `<DocumentEditor>` compound component over this hook, or render
8
+ * their own tree using the returned state.
9
+ *
10
+ * The hook builds its tree from `initial` on first mount. Changing
11
+ * `initial` later does NOT rebuild the tree; live viewers explicitly call
12
+ * `replaceData()` when a newer snapshot should become the clean baseline.
13
+ * This matches the firebase-tools-ui pattern of treating the editor as a
14
+ * stateful workspace while still allowing snapshot-driven reconciliation.
15
+ */
16
+ export function useDocumentEditor(options = {}) {
17
+ const initial = options.initial ?? {};
18
+ // `useRef` so the initial snapshot is computed once. The reducer
19
+ // owns the live tree from there on.
20
+ const initialRef = useRef(null);
21
+ if (initialRef.current == null) {
22
+ initialRef.current = initState(initial);
23
+ }
24
+ const [state, dispatch] = useReducer(reducer, initialRef.current);
25
+ const setValue = useCallback((nodeId, value) => dispatch({ type: 'setValue', nodeId, value }), []);
26
+ const setType = useCallback((nodeId, newType) => dispatch({ type: 'setType', nodeId, newType }), []);
27
+ const setKey = useCallback((nodeId, key) => dispatch({ type: 'setKey', nodeId, key }), []);
28
+ const addMapEntry = useCallback((parentId, key, childType) => dispatch({ type: 'addMapEntry', parentId, key, childType }), []);
29
+ const addArrayEntry = useCallback((parentId, childType) => dispatch({ type: 'addArrayEntry', parentId, childType }), []);
30
+ const remove = useCallback((nodeId) => dispatch({ type: 'remove', nodeId }), []);
31
+ const reset = useCallback(() => dispatch({ type: 'reset' }), []);
32
+ const replaceData = useCallback((data) => dispatch({ type: 'replaceData', data }), []);
33
+ const touch = useCallback((nodeId) => dispatch({ type: 'touch', nodeId }), []);
34
+ const touchAll = useCallback(() => dispatch({ type: 'touchAll' }), []);
35
+ const toData = useCallback(() => treeToData(state.tree), [state.tree]);
36
+ const isDirty = state.tree !== state.initial;
37
+ const isValid = state.errorCount === 0;
38
+ return useMemo(() => ({
39
+ ...state,
40
+ isDirty,
41
+ isValid,
42
+ dispatch,
43
+ setValue,
44
+ setType,
45
+ setKey,
46
+ addMapEntry,
47
+ addArrayEntry,
48
+ remove,
49
+ reset,
50
+ replaceData,
51
+ touch,
52
+ touchAll,
53
+ toData,
54
+ }), [
55
+ state,
56
+ isDirty,
57
+ isValid,
58
+ setValue,
59
+ setType,
60
+ setKey,
61
+ addMapEntry,
62
+ addArrayEntry,
63
+ remove,
64
+ reset,
65
+ replaceData,
66
+ touch,
67
+ touchAll,
68
+ toData,
69
+ ]);
70
+ }
71
+ //# sourceMappingURL=useDocumentEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDocumentEditor.js","sourceRoot":"","sources":["../../../src/firestore/hooks/useDocumentEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,E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Z,GAAG,EAAE,CAAC,CAAC;QACL,GAAG,KAAK;QACR,OAAO;QACP,OAAO;QACP,QAAQ;QACR,QAAQ;QACR,OAAO;QACP,MAAM;QACN,WAAW;QACX,aAAa;QACb,MAAM;QACN,KAAK;QACL,WAAW;QACX,KAAK;QACL,QAAQ;QACR,MAAM;KACP,CAAC,EACF;QACE,KAAK;QACL,OAAO;QACP,OAAO;QACP,QAAQ;QACR,OAAO;QACP,MAAM;QACN,WAAW;QACX,aAAa;QACb,MAAM;QACN,KAAK;QACL,WAAW;QACX,KAAK;QACL,QAAQ;QACR,MAAM;KACP,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,50 @@
1
+ import type { CollectionReference, DocumentReference, Query, QueryDocumentSnapshot } from 'pyric/firestore';
2
+ export interface UseDocumentListOptions {
3
+ collection: CollectionReference;
4
+ /** Optional filter / sort. If omitted, the raw collection is used. */
5
+ query?: Query;
6
+ /** Page size for cursor-based pagination. Default 50. */
7
+ pageSize?: number;
8
+ /**
9
+ * `paged` preserves the historical get-based cursor behavior. `live` keeps
10
+ * the currently requested window under an `onSnapshot` subscription and
11
+ * grows that window when `loadMore` is requested. Default `paged`.
12
+ */
13
+ mode?: 'paged' | 'live';
14
+ }
15
+ export interface UseDocumentListResult {
16
+ documents: QueryDocumentSnapshot[];
17
+ isLoading: boolean;
18
+ error: Error | undefined;
19
+ /** Identifies the active live subscription. Consumers that diff result
20
+ * snapshots can include this in their scope so a re-subscription (including
21
+ * load-more) establishes a silent baseline instead of looking like writes. */
22
+ subscriptionGeneration: number;
23
+ /** True if there might be another page. The hook tracks this via
24
+ * the last fetch's length === pageSize. */
25
+ hasMore: boolean;
26
+ /** Fetch the next page; live mode grows and re-establishes its window. */
27
+ loadMore: () => void;
28
+ /** Create a document. If `id` is null, Firestore generates one
29
+ * via `addDoc`. With `onExisting: 'fail'` (CREATE semantics, the
30
+ * admin `create()` analog) an id that already exists rejects with
31
+ * `code: 'already-exists'` instead of silently overwriting —
32
+ * checked against the BACKEND (a `getDoc` probe), not any loaded
33
+ * page, so it is honest beyond pagination. Default: 'overwrite'
34
+ * (plain `setDoc`, the historical behavior). */
35
+ createDocument: (id: string | null, data: Record<string, unknown>, opts?: {
36
+ onExisting?: 'overwrite' | 'fail';
37
+ }) => Promise<DocumentReference>;
38
+ deleteDocument: (ref: DocumentReference) => Promise<void>;
39
+ /** Re-establish the active read/subscription. Useful after the consumer
40
+ * mutates data outside this hook. */
41
+ refresh: () => void;
42
+ }
43
+ /**
44
+ * Paginated document list with two acquisition strategies. The default
45
+ * `paged` mode uses `startAfter` and accumulates one-shot reads. `live` keeps
46
+ * the requested prefix under one `onSnapshot` listener; loading more grows
47
+ * that prefix and establishes a new subscription baseline.
48
+ */
49
+ export declare function useDocumentList({ collection, query, pageSize, mode, }: UseDocumentListOptions): UseDocumentListResult;
50
+ //# sourceMappingURL=useDocumentList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDocumentList.d.ts","sourceRoot":"","sources":["../../../src/firestore/hooks/useDocumentList.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,EACL,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAGzB,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,mBAAmB,CAAC;IAChC,sEAAsE;IACtE,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,qBAAqB,EAAE,CAAC;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB;;kFAE8E;IAC9E,sBAAsB,EAAE,MAAM,CAAC;IAC/B;gDAC4C;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;;;;qDAMiD;IACjD,cAAc,EAAE,CACd,EAAE,EAAE,MAAM,GAAG,IAAI,EACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,IAAI,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,CAAA;KAAE,KACzC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAChC,cAAc,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D;0CACsC;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,KAAK,EACL,QAAa,EACb,IAAc,GACf,EAAE,sBAAsB,GAAG,qBAAqB,CAgLhD"}