@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,160 @@
1
+ /**
2
+ * The events/activity domain types. These are a local, structurally-
3
+ * compatible mirror of `pyric`'s unified `SandboxEvent` union (and its
4
+ * `EventProvenance`) — the `@pyric/ui` packages never import `pyric` so
5
+ * the headless layer stays decoupled from the sandbox impl (the same
6
+ * stance the sibling `traffic/` area takes with `RequestEvent`).
7
+ *
8
+ * `sandbox.onEvent` / `sandbox.history()` are assignable as an
9
+ * `ActivitySource` / `ActivityEvent[]` with zero adapter code: every
10
+ * field here is a subset (by name + shape) of the matching field on the
11
+ * sandbox type. A production audit feed satisfying the same shape works
12
+ * too.
13
+ *
14
+ * Unlike `traffic/` (which models only Firestore `request` events, one
15
+ * row per evaluated op), the events area aggregates the FULL stream —
16
+ * Firestore `request`/`write` plus the cross-service `service_mutation`
17
+ * envelope (auth / storage / rtdb) — into category bands. So the local
18
+ * types cover the union members the digest reads, not just one kind.
19
+ */
20
+ /** Which sandbox service emitted an event. Absent ⇒ `'firestore'`. */
21
+ export type ActivityService = 'firestore' | 'auth' | 'storage' | 'rtdb';
22
+ /** Who initiated the op behind an event. Absent ⇒ the served app. */
23
+ export type ActivityActor = {
24
+ kind: 'app';
25
+ } | {
26
+ kind: 'studio';
27
+ } | {
28
+ kind: 'agent';
29
+ name: string;
30
+ } | {
31
+ kind: 'app-builder';
32
+ };
33
+ /**
34
+ * The auth lens an op ran under. `admin` bypasses rules, `as` evaluates
35
+ * rules as a specific uid (impersonation), `app-session` is the app's
36
+ * own signed-in user. Absent ⇒ `app-session`.
37
+ */
38
+ export type ActivityLens = {
39
+ mode: 'admin';
40
+ } | {
41
+ mode: 'as';
42
+ uid: string;
43
+ } | {
44
+ mode: 'app-session';
45
+ };
46
+ /** Identity in effect for an op. `null` is anonymous / signed out. */
47
+ export interface ActivityAuthState {
48
+ uid: string;
49
+ token?: Record<string, unknown>;
50
+ }
51
+ /**
52
+ * Provenance carried by every event. All optional + additive — pre-
53
+ * provenance emitters omit them (read as firestore / app / app-session).
54
+ */
55
+ export interface ActivityProvenance {
56
+ service?: ActivityService;
57
+ actor?: ActivityActor;
58
+ authLens?: ActivityLens;
59
+ /** Set when the op is part of an agent plan (dry-run / accept). */
60
+ planId?: string;
61
+ }
62
+ /** Firestore op outcome — present on `request` events only. */
63
+ export type ActivityResult = 'allow' | 'deny' | 'unsupported';
64
+ /**
65
+ * A Firestore `request` event — one per evaluated op. The digest reads
66
+ * these for denials (`result === 'deny'`) and, when no `write` event is
67
+ * present, for the allow trail. Structurally a subset of `RequestEvent`.
68
+ */
69
+ export interface ActivityRequestEvent extends ActivityProvenance {
70
+ kind: 'request';
71
+ id: string;
72
+ at: number;
73
+ method: 'get' | 'list' | 'create' | 'update' | 'set' | 'delete';
74
+ path: string;
75
+ auth: ActivityAuthState | null;
76
+ result: ActivityResult;
77
+ /** Simulator debug trail. Used to surface the deciding rule on denials. */
78
+ reasons: string[];
79
+ request?: {
80
+ resourceData?: Record<string, unknown>;
81
+ };
82
+ resourceBefore?: {
83
+ data: Record<string, unknown> | null;
84
+ exists: boolean;
85
+ };
86
+ resourceAfter?: {
87
+ data: Record<string, unknown> | null;
88
+ exists: boolean;
89
+ };
90
+ matchedRule?: {
91
+ ruleIndex: number;
92
+ operations: string[];
93
+ };
94
+ origin: 'user' | 'listener' | 'transaction' | 'batch';
95
+ groupId?: string;
96
+ triggeredBy?: {
97
+ method: string;
98
+ path: string;
99
+ };
100
+ }
101
+ /**
102
+ * A committed Firestore write — `create`/`update`/`set`/`delete` that
103
+ * the rule engine allowed and the keyspace applied. The digest leads
104
+ * with these for the added/updated/removed bands (richer than `request`:
105
+ * carries prior/next state for the change summary). Subset of
106
+ * `WriteSandboxEvent`.
107
+ */
108
+ export interface ActivityWriteEvent extends ActivityProvenance {
109
+ kind: 'write';
110
+ id: string;
111
+ at: number;
112
+ method: 'create' | 'update' | 'set' | 'delete';
113
+ path: string;
114
+ auth: ActivityAuthState | null;
115
+ data?: Record<string, unknown>;
116
+ priorState: Record<string, unknown> | null;
117
+ nextState: Record<string, unknown> | null;
118
+ groupId?: string;
119
+ }
120
+ /**
121
+ * Cross-service mutation — the unified envelope auth / storage / rtdb
122
+ * emit. The digest maps `service` + `op` to a band (signed-in, added,
123
+ * updated, removed, …). Subset of `ServiceMutationEvent`.
124
+ */
125
+ export interface ActivityServiceMutationEvent extends ActivityProvenance {
126
+ kind: 'service_mutation';
127
+ id: string;
128
+ at: number;
129
+ service: 'auth' | 'storage' | 'rtdb';
130
+ op: string;
131
+ path?: string;
132
+ auth: ActivityAuthState | null;
133
+ before?: unknown;
134
+ after?: unknown;
135
+ detail?: Record<string, unknown>;
136
+ }
137
+ /**
138
+ * The union members the activity digest aggregates. This is a SUBSET of
139
+ * `pyric`'s `SandboxEvent` — the listener-lifecycle / snapshot-delivery /
140
+ * session-boundary kinds carry no user-visible mutation, so the digest
141
+ * ignores them. The reducer accepts any object with a `kind` and skips
142
+ * the kinds it doesn't model, so a full `SandboxEvent[]` passes through
143
+ * cleanly (the extra kinds fall into the "unknown ⇒ skipped" branch).
144
+ */
145
+ export type ActivityEvent = ActivityRequestEvent | ActivityWriteEvent | ActivityServiceMutationEvent;
146
+ /**
147
+ * The widened input the reducer accepts: any `ActivityEvent`, plus a
148
+ * permissive escape for unmodelled `SandboxEvent` kinds carrying a
149
+ * string `kind` (skipped). Lets `sandbox.history()` flow in unfiltered.
150
+ */
151
+ export type AnyActivityEvent = ActivityEvent | {
152
+ kind: string;
153
+ [k: string]: unknown;
154
+ };
155
+ /**
156
+ * A subscription: register a callback, get an unsubscribe.
157
+ * `sandbox.onEvent` matches this signature.
158
+ */
159
+ export type ActivitySource = (cb: (event: AnyActivityEvent) => void) => () => void;
160
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/events/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,sEAAsE;AACtE,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAExE,qEAAqE;AACrE,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,GACf;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC;AAE5B;;;;GAIG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC3B;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC;AAE5B,sEAAsE;AACtE,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,KAAK,CAA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AC,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAE3C;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,CAC3B,EAAE,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,KAClC,MAAM,IAAI,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The events/activity domain types. These are a local, structurally-
3
+ * compatible mirror of `pyric`'s unified `SandboxEvent` union (and its
4
+ * `EventProvenance`) — the `@pyric/ui` packages never import `pyric` so
5
+ * the headless layer stays decoupled from the sandbox impl (the same
6
+ * stance the sibling `traffic/` area takes with `RequestEvent`).
7
+ *
8
+ * `sandbox.onEvent` / `sandbox.history()` are assignable as an
9
+ * `ActivitySource` / `ActivityEvent[]` with zero adapter code: every
10
+ * field here is a subset (by name + shape) of the matching field on the
11
+ * sandbox type. A production audit feed satisfying the same shape works
12
+ * too.
13
+ *
14
+ * Unlike `traffic/` (which models only Firestore `request` events, one
15
+ * row per evaluated op), the events area aggregates the FULL stream —
16
+ * Firestore `request`/`write` plus the cross-service `service_mutation`
17
+ * envelope (auth / storage / rtdb) — into category bands. So the local
18
+ * types cover the union members the digest reads, not just one kind.
19
+ */
20
+ export {};
21
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/events/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG"}
@@ -0,0 +1,22 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { CollectionReference } from 'pyric/firestore';
3
+ export interface CollectionListProps {
4
+ collections: CollectionReference[];
5
+ isLoading?: boolean;
6
+ error?: Error;
7
+ /** Fired when a list item is clicked. Consumer wires navigation. */
8
+ onSelect?: (collection: CollectionReference) => void;
9
+ /** Optional empty-state node. Rendered when `collections.length`
10
+ * is 0 and the list isn't loading. */
11
+ emptyState?: ReactNode;
12
+ className?: string;
13
+ }
14
+ /**
15
+ * Headless collection list. Takes a pre-fetched array of references
16
+ * (from `useCollectionList`) plus a select callback. Renders one
17
+ * row per collection with `data-pyric-collection-id` for styling
18
+ * and testing. The library does not own the data fetch — the hook
19
+ * does — so this component is a thin presentational layer.
20
+ */
21
+ export declare function CollectionList({ collections, isLoading, error, onSelect, emptyState, className, }: CollectionListProps): import("react").JSX.Element;
22
+ //# sourceMappingURL=CollectionList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollectionList.d.ts","sourceRoot":"","sources":["../../../src/firestore/components/CollectionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,mBAAmB,EAAE,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,oEAAoE;IACpE,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACrD;2CACuC;IACvC,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAC7B,WAAW,EACX,SAAS,EACT,KAAK,EACL,QAAQ,EACR,UAAU,EACV,SAAS,GACV,EAAE,mBAAmB,+BAgDrB"}
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * Headless collection list. Takes a pre-fetched array of references
4
+ * (from `useCollectionList`) plus a select callback. Renders one
5
+ * row per collection with `data-pyric-collection-id` for styling
6
+ * and testing. The library does not own the data fetch — the hook
7
+ * does — so this component is a thin presentational layer.
8
+ */
9
+ export function CollectionList({ collections, isLoading, error, onSelect, emptyState, className, }) {
10
+ if (error) {
11
+ return (_jsx("div", { className: className, "data-pyric-ui": "collection-list", "data-pyric-error": "", role: "alert", children: error.message }));
12
+ }
13
+ if (isLoading && collections.length === 0) {
14
+ return (_jsx("div", { className: className, "data-pyric-ui": "collection-list", "data-pyric-loading": "" }));
15
+ }
16
+ if (collections.length === 0) {
17
+ return (_jsx("div", { className: className, "data-pyric-ui": "collection-list", "data-pyric-empty": "", children: emptyState }));
18
+ }
19
+ return (_jsx("ul", { className: className, "data-pyric-ui": "collection-list", children: collections.map((coll) => (_jsx("li", { "data-pyric-collection-entry": true, "data-pyric-collection-id": coll.id, children: _jsx("button", { type: "button", onClick: () => onSelect?.(coll), "data-pyric-collection-select": true, children: coll.id }) }, coll.path))) }));
20
+ }
21
+ //# sourceMappingURL=CollectionList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollectionList.js","sourceRoot":"","sources":["../../../src/firestore/components/CollectionList.tsx"],"names":[],"mappings":";AAeA;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,WAAW,EACX,SAAS,EACT,KAAK,EACL,QAAQ,EACR,UAAU,EACV,SAAS,GACW;IACpB,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CACL,cACE,SAAS,EAAE,SAAS,mBACN,iBAAiB,sBACd,EAAE,EACnB,IAAI,EAAC,OAAO,YAEX,KAAK,CAAC,OAAO,GACV,CACP,CAAC;IACJ,CAAC;IACD,IAAI,SAAS,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1C,OAAO,CACL,cACE,SAAS,EAAE,SAAS,mBACN,iBAAiB,wBACZ,EAAE,GACrB,CACH,CAAC;IACJ,CAAC;IACD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,CACL,cAAK,SAAS,EAAE,SAAS,mBAAgB,iBAAiB,sBAAkB,EAAE,YAC3E,UAAU,GACP,CACP,CAAC;IACJ,CAAC;IACD,OAAO,CACL,aAAI,SAAS,EAAE,SAAS,mBAAgB,iBAAiB,YACtD,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACzB,8EAG4B,IAAI,CAAC,EAAE,YAEjC,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,kDAG9B,IAAI,CAAC,EAAE,GACD,IAVJ,IAAI,CAAC,IAAI,CAWX,CACN,CAAC,GACC,CACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { CollectionReference, DocumentReference } from 'pyric/firestore';
3
+ import { type RecursiveDeleteImpl } from '../hooks/useRecursiveDelete.js';
4
+ export interface DeleteWithConfirmProps {
5
+ /** The doc / collection to delete. */
6
+ target: DocumentReference | CollectionReference;
7
+ /** Implementation that walks the tree + deletes. Consumer-supplied.
8
+ * Sandbox-backed apps usually wire `pyric/sandbox` introspection;
9
+ * production apps usually call a Cloud Function. */
10
+ impl: RecursiveDeleteImpl;
11
+ /** Confirm-dialog title. Defaults to a sensible derivation from
12
+ * the target's path. */
13
+ title?: string;
14
+ /** Confirm-dialog body. */
15
+ body?: ReactNode;
16
+ /** Label on the destructive button. */
17
+ confirmLabel?: string;
18
+ /** Fired after the delete iterator finishes successfully. */
19
+ onDeleted?: () => void;
20
+ /** Optional render override for the trigger button. */
21
+ renderTrigger?: (props: {
22
+ onClick: () => void;
23
+ isRunning: boolean;
24
+ progress: number;
25
+ }) => ReactNode;
26
+ /** Class forwarded to the default trigger button. */
27
+ className?: string;
28
+ }
29
+ /**
30
+ * Composition that wires `useConfirm` + `useRecursiveDelete`. Requires
31
+ * a `<ConfirmProvider>` ancestor.
32
+ *
33
+ * The default trigger renders a plain `<button>` carrying the
34
+ * destructive intent (the consumer styles via `[data-pyric-destructive]`).
35
+ * Consumers wanting different chrome pass `renderTrigger`.
36
+ */
37
+ export declare function DeleteWithConfirm({ target, impl, title, body, confirmLabel, onDeleted, renderTrigger, className, }: DeleteWithConfirmProps): import("react").JSX.Element;
38
+ //# sourceMappingURL=DeleteWithConfirm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeleteWithConfirm.d.ts","sourceRoot":"","sources":["../../../src/firestore/components/DeleteWithConfirm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,gCAAgC,CAAC;AAExC,MAAM,WAAW,sBAAsB;IACrC,sCAAsC;IACtC,MAAM,EAAE,iBAAiB,GAAG,mBAAmB,CAAC;IAChD;;yDAEqD;IACrD,IAAI,EAAE,mBAAmB,CAAC;IAC1B;6BACyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,uDAAuD;IACvD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE;QACtB,OAAO,EAAE,MAAM,IAAI,CAAC;QACpB,SAAS,EAAE,OAAO,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;KAClB,KAAK,SAAS,CAAC;IAChB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,YAAuB,EACvB,SAAS,EACT,aAAa,EACb,SAAS,GACV,EAAE,sBAAsB,+BAiCxB"}
@@ -0,0 +1,33 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useConfirm } from '../../primitives/useConfirm.js';
3
+ import { useRecursiveDelete, } from '../hooks/useRecursiveDelete.js';
4
+ /**
5
+ * Composition that wires `useConfirm` + `useRecursiveDelete`. Requires
6
+ * a `<ConfirmProvider>` ancestor.
7
+ *
8
+ * The default trigger renders a plain `<button>` carrying the
9
+ * destructive intent (the consumer styles via `[data-pyric-destructive]`).
10
+ * Consumers wanting different chrome pass `renderTrigger`.
11
+ */
12
+ export function DeleteWithConfirm({ target, impl, title, body, confirmLabel = 'Delete', onDeleted, renderTrigger, className, }) {
13
+ const confirm = useConfirm();
14
+ const { delete: runDelete, isRunning, progress, error } = useRecursiveDelete(impl);
15
+ const handleClick = async () => {
16
+ const ok = await confirm({
17
+ title: title ?? `Delete ${target.path}?`,
18
+ body,
19
+ destructive: true,
20
+ confirmLabel,
21
+ });
22
+ if (!ok)
23
+ return;
24
+ await runDelete(target);
25
+ if (!error)
26
+ onDeleted?.();
27
+ };
28
+ if (renderTrigger) {
29
+ return _jsx(_Fragment, { children: renderTrigger({ onClick: handleClick, isRunning, progress }) });
30
+ }
31
+ return (_jsx("button", { type: "button", onClick: handleClick, className: className, disabled: isRunning, "data-pyric-ui": "delete-with-confirm", "data-pyric-destructive": "", "data-pyric-running": isRunning ? '' : undefined, children: isRunning ? `Deleting… (${progress})` : confirmLabel }));
32
+ }
33
+ //# sourceMappingURL=DeleteWithConfirm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeleteWithConfirm.js","sourceRoot":"","sources":["../../../src/firestore/components/DeleteWithConfirm.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EACL,kBAAkB,GAEnB,MAAM,gCAAgC,CAAC;AA4BxC;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,MAAM,EACN,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,YAAY,GAAG,QAAQ,EACvB,SAAS,EACT,aAAa,EACb,SAAS,GACc;IACvB,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAEnF,MAAM,WAAW,GAAG,KAAK,IAAI,EAAE;QAC7B,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC;YACvB,KAAK,EAAE,KAAK,IAAI,UAAU,MAAM,CAAC,IAAI,GAAG;YACxC,IAAI;YACJ,WAAW,EAAE,IAAI;YACjB,YAAY;SACb,CAAC,CAAC;QACH,IAAI,CAAC,EAAE;YAAE,OAAO;QAChB,MAAM,SAAS,CAAC,MAAM,CAAC,CAAC;QACxB,IAAI,CAAC,KAAK;YAAE,SAAS,EAAE,EAAE,CAAC;IAC5B,CAAC,CAAC;IAEF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,4BAAG,aAAa,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,GAAI,CAAC;IAC7E,CAAC;IAED,OAAO,CACL,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,SAAS,mBACL,qBAAqB,4BACZ,EAAE,wBACL,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,YAE7C,SAAS,CAAC,CAAC,CAAC,cAAc,QAAQ,GAAG,CAAC,CAAC,CAAC,YAAY,GAC9C,CACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type UseDocumentEditorResult } from '../hooks/useDocumentEditor.js';
3
+ import type { FieldEditorRegistry } from '../fieldEditors/types.js';
4
+ export interface DocumentEditorRootProps {
5
+ /** Initial document data. Built into the editor's tree on first
6
+ * mount; later changes don't rebuild — call `editor.reset()` to
7
+ * re-initialize from a fresh `initial`. */
8
+ initial?: Record<string, unknown>;
9
+ /** Override or extend the built-in field editors. */
10
+ fieldEditors?: FieldEditorRegistry;
11
+ /** Called on every state change with the latest editor state. The
12
+ * parent typically watches `state.isValid` + `state.isDirty` to
13
+ * enable/disable a Save button. */
14
+ onChange?: (state: UseDocumentEditorResult) => void;
15
+ children: ReactNode;
16
+ className?: string;
17
+ }
18
+ /**
19
+ * Wires the `useDocumentEditor` hook + field-editor registry into a
20
+ * React context so `<DocumentEditor.Fields>` and `<DocumentEditor.AddField>`
21
+ * can render the tree without prop drilling.
22
+ *
23
+ * Pattern: hook + compound component. Consumers wanting full control
24
+ * over the layout call `useDocumentEditor` directly and render their
25
+ * own tree; consumers wanting the default rendering use this.
26
+ */
27
+ export declare function DocumentEditorRoot({ initial, fieldEditors, onChange, children, className, }: DocumentEditorRootProps): import("react").JSX.Element;
28
+ /** Read access to the underlying editor state from inside a Root. */
29
+ export declare function useDocumentEditorContext(): UseDocumentEditorResult;
30
+ /**
31
+ * Renders the top-level fields of the document. For finer control,
32
+ * a consumer can call `useDocumentEditorContext()` and render the
33
+ * tree themselves.
34
+ */
35
+ export declare function DocumentEditorFields(): import("react").JSX.Element;
36
+ /**
37
+ * Compound root export. Consumers pattern-match via dot access:
38
+ *
39
+ * <DocumentEditor.Root initial={data} onChange={…}>
40
+ * <DocumentEditor.Fields />
41
+ * </DocumentEditor.Root>
42
+ */
43
+ export declare const DocumentEditor: {
44
+ Root: typeof DocumentEditorRoot;
45
+ Fields: typeof DocumentEditorFields;
46
+ };
47
+ //# sourceMappingURL=DocumentEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentEditor.d.ts","sourceRoot":"","sources":["../../../src/firestore/components/DocumentEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,EAAqB,KAAK,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAEhG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAsBpE,MAAM,WAAW,uBAAuB;IACtC;;gDAE4C;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,qDAAqD;IACrD,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC;;wCAEoC;IACpC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACpD,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,SAAS,GACV,EAAE,uBAAuB,+BA6BzB;AAED,qEAAqE;AACrE,wBAAgB,wBAAwB,IAAI,uBAAuB,CAElE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,gCAiBnC;AAkOD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;CAG1B,CAAC"}
@@ -0,0 +1,176 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { createContext, useContext, useEffect, useRef } from 'react';
3
+ import { useDocumentEditor } from '../hooks/useDocumentEditor.js';
4
+ import { mergeFieldEditors } from '../fieldEditors/registry.js';
5
+ import { useContainerSize } from '../../primitives/hooks/useContainerSize.js';
6
+ const Ctx = createContext(null);
7
+ function useEditorContext() {
8
+ const ctx = useContext(Ctx);
9
+ if (!ctx) {
10
+ throw new Error('DocumentEditor.* components must render inside <DocumentEditor.Root>');
11
+ }
12
+ return ctx;
13
+ }
14
+ /**
15
+ * Wires the `useDocumentEditor` hook + field-editor registry into a
16
+ * React context so `<DocumentEditor.Fields>` and `<DocumentEditor.AddField>`
17
+ * can render the tree without prop drilling.
18
+ *
19
+ * Pattern: hook + compound component. Consumers wanting full control
20
+ * over the layout call `useDocumentEditor` directly and render their
21
+ * own tree; consumers wanting the default rendering use this.
22
+ */
23
+ export function DocumentEditorRoot({ initial, fieldEditors, onChange, children, className, }) {
24
+ const editor = useDocumentEditor({ initial });
25
+ const registry = mergeFieldEditors(fieldEditors);
26
+ // Hold the latest onChange in a ref so the effect's deps don't
27
+ // include the callback — avoids re-firing onChange on every parent
28
+ // re-render that produces a new function identity.
29
+ const onChangeRef = useRef(onChange);
30
+ onChangeRef.current = onChange;
31
+ useEffect(() => {
32
+ onChangeRef.current?.(editor);
33
+ }, [editor]);
34
+ const { ref: rootRef, size } = useContainerSize();
35
+ return (_jsx(Ctx.Provider, { value: { editor, fieldEditors: registry }, children: _jsx("div", { ref: rootRef, className: className, "data-pyric-ui": "document-editor", "data-pyric-is-valid": editor.isValid ? '' : undefined, "data-pyric-is-dirty": editor.isDirty ? '' : undefined, "data-size": size, children: children }) }));
36
+ }
37
+ /** Read access to the underlying editor state from inside a Root. */
38
+ export function useDocumentEditorContext() {
39
+ return useEditorContext().editor;
40
+ }
41
+ /**
42
+ * Renders the top-level fields of the document. For finer control,
43
+ * a consumer can call `useDocumentEditorContext()` and render the
44
+ * tree themselves.
45
+ */
46
+ export function DocumentEditorFields() {
47
+ const { editor } = useEditorContext();
48
+ // Stable INSERTION order, never re-sorted by the (currently being
49
+ // typed) key — `childIds` already preserves the order fields were
50
+ // added in, which is exactly what must stay stable while a row's
51
+ // name is edited. Sorting here was the cause of rows visibly
52
+ // reordering mid-keystroke.
53
+ const rootChildren = editor.tree.childIds[editor.tree.rootId] ?? [];
54
+ return (_jsxs("div", { "data-pyric-editor-fields": true, children: [rootChildren.map((id) => (_jsx(Field, { nodeId: id, path: fieldPath(editor, id) }, id))), _jsx(AddMapEntry, { parentId: editor.tree.rootId })] }));
55
+ }
56
+ function fieldPath(editor, nodeId) {
57
+ const segments = [];
58
+ let current = editor.tree.nodes[nodeId];
59
+ while (current && current.parentId != null) {
60
+ const parent = editor.tree.nodes[current.parentId];
61
+ if (!parent)
62
+ break;
63
+ if (parent.type === 'array') {
64
+ const idx = (editor.tree.childIds[parent.id] ?? []).indexOf(current.id);
65
+ segments.unshift(`[${idx}]`);
66
+ }
67
+ else {
68
+ segments.unshift(current.key ?? '');
69
+ }
70
+ current = parent;
71
+ }
72
+ // Join — array index segments don't take a leading dot.
73
+ return segments.reduce((acc, seg) => {
74
+ if (seg.startsWith('['))
75
+ return `${acc}${seg}`;
76
+ return acc ? `${acc}.${seg}` : seg;
77
+ }, '');
78
+ }
79
+ function Field({ nodeId, path }) {
80
+ const { editor, fieldEditors } = useEditorContext();
81
+ const node = editor.tree.nodes[nodeId];
82
+ if (!node)
83
+ return null;
84
+ if (node.type === 'map') {
85
+ return _jsx(MapField, { node: node, path: path });
86
+ }
87
+ if (node.type === 'array') {
88
+ return _jsx(ArrayField, { node: node, path: path });
89
+ }
90
+ const contract = fieldEditors[node.type];
91
+ const EditComponent = contract?.Edit;
92
+ if (!EditComponent)
93
+ return null;
94
+ // Errors are computed on every keystroke (so Save can gate on
95
+ // `isValid`), but only DISPLAYED once the field has been touched
96
+ // (blurred) or a submit attempt swept the tree — otherwise a
97
+ // freshly-added empty row would show "required" before the user
98
+ // has typed anything.
99
+ const showError = node.touched ? node.error : undefined;
100
+ return (_jsxs("div", { "data-pyric-field-entry": true, "data-field-name": node.key ?? undefined, "data-pyric-error": showError ? '' : undefined, onBlur: () => editor.touch(node.id), children: [_jsx(FieldChrome, { node: node, path: path }), _jsx(EditComponent, { value: node.value, path: path, error: showError, onChange: (v) => editor.setValue(node.id, v) })] }));
101
+ }
102
+ /**
103
+ * Per-field chrome: the field's key input (for map children), the
104
+ * type selector, and the remove button. Inline at every non-root
105
+ * node so consumers can hide individual pieces via `data-*` CSS.
106
+ */
107
+ function FieldChrome({ node, path }) {
108
+ const { editor } = useEditorContext();
109
+ const parent = node.parentId != null ? editor.tree.nodes[node.parentId] : null;
110
+ const inMap = parent?.type === 'map';
111
+ const isRoot = node.id === editor.tree.rootId;
112
+ if (isRoot)
113
+ return null;
114
+ return (_jsxs("div", { "data-pyric-field-chrome": true, "data-pyric-field-path": path, children: [inMap ? (_jsx("input", { type: "text", value: node.key ?? '', onChange: (e) => editor.setKey(node.id, e.target.value), "aria-label": "Field name", "data-pyric-field-key-input": true, "aria-invalid": node.touched && node.error ? 'true' : undefined })) : null, _jsx(TypeSelect, { node: node }), _jsx("button", { type: "button", onClick: () => editor.remove(node.id), "data-pyric-remove": true, "aria-label": "Remove field", children: "\u00D7" })] }));
115
+ }
116
+ const ALL_TYPES = [
117
+ 'string',
118
+ 'number',
119
+ 'boolean',
120
+ 'null',
121
+ 'timestamp',
122
+ 'geopoint',
123
+ 'reference',
124
+ 'bytes',
125
+ 'vector',
126
+ 'map',
127
+ 'array',
128
+ ];
129
+ function TypeSelect({ node }) {
130
+ const { editor } = useEditorContext();
131
+ const parent = node.parentId != null ? editor.tree.nodes[node.parentId] : null;
132
+ // Firestore disallows nested arrays — filter that option out
133
+ // when the parent is an array.
134
+ const options = ALL_TYPES.filter((t) => !(parent?.type === 'array' && t === 'array'));
135
+ return (_jsx("select", { value: node.type, onChange: (e) => editor.setType(node.id, e.target.value), "aria-label": "Field type", "data-pyric-field-type-select": true, children: options.map((t) => (_jsx("option", { value: t, children: t }, t))) }));
136
+ }
137
+ function MapField({ node, path }) {
138
+ const { editor } = useEditorContext();
139
+ // Stable insertion order — same rationale as `DocumentEditorFields`.
140
+ const children = editor.tree.childIds[node.id] ?? [];
141
+ return (_jsxs("div", { "data-pyric-field-entry": true, "data-pyric-field-type": "map", "data-field-name": node.key ?? undefined, children: [node.id !== editor.tree.rootId ? _jsx(FieldChrome, { node: node, path: path }) : null, _jsx("div", { "data-pyric-map-children": true, children: children.map((childId) => {
142
+ const child = editor.tree.nodes[childId];
143
+ if (!child)
144
+ return null;
145
+ const childPath = path ? `${path}.${child.key ?? ''}` : child.key ?? '';
146
+ return _jsx(Field, { nodeId: childId, path: childPath }, childId);
147
+ }) }), _jsx(AddMapEntry, { parentId: node.id })] }));
148
+ }
149
+ function ArrayField({ node, path }) {
150
+ const { editor } = useEditorContext();
151
+ const children = editor.tree.childIds[node.id] ?? [];
152
+ return (_jsxs("div", { "data-pyric-field-entry": true, "data-pyric-field-type": "array", "data-field-name": node.key ?? undefined, children: [_jsx(FieldChrome, { node: node, path: path }), _jsx("ol", { "data-pyric-array-children": true, children: children.map((childId, idx) => {
153
+ const childPath = path ? `${path}[${idx}]` : `[${idx}]`;
154
+ return (_jsx("li", { "data-field-index": String(idx), children: _jsx(Field, { nodeId: childId, path: childPath }) }, childId));
155
+ }) }), _jsx(AddArrayEntry, { parentId: node.id })] }));
156
+ }
157
+ function AddMapEntry({ parentId }) {
158
+ const { editor } = useEditorContext();
159
+ return (_jsx("button", { type: "button", "data-pyric-add-map-entry": true, onClick: () => editor.addMapEntry(parentId, '', 'string'), children: "+ Add field" }));
160
+ }
161
+ function AddArrayEntry({ parentId }) {
162
+ const { editor } = useEditorContext();
163
+ return (_jsx("button", { type: "button", "data-pyric-add-array-entry": true, onClick: () => editor.addArrayEntry(parentId, 'string'), children: "+ Add item" }));
164
+ }
165
+ /**
166
+ * Compound root export. Consumers pattern-match via dot access:
167
+ *
168
+ * <DocumentEditor.Root initial={data} onChange={…}>
169
+ * <DocumentEditor.Fields />
170
+ * </DocumentEditor.Root>
171
+ */
172
+ export const DocumentEditor = {
173
+ Root: DocumentEditorRoot,
174
+ Fields: DocumentEditorFields,
175
+ };
176
+ //# sourceMappingURL=DocumentEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentEditor.js","sourceRoot":"","sources":["../../../src/firestore/components/DocumentEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAgC,MAAM,+BAA+B,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAIhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAO9E,MAAM,GAAG,GAAG,aAAa,CAAuB,IAAI,CAAC,CAAC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J,CAAC;AAED,SAAS,aAAa,CAAC,EAAE,QAAQ,EAAwB;IACvD,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACtC,OAAO,CACL,iBACE,IAAI,EAAC,QAAQ,sCAEb,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,2BAGhD,CACV,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,kBAAkB;IACxB,MAAM,EAAE,oBAAoB;CAC7B,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { DocumentReference, QueryDocumentSnapshot } from 'pyric/firestore';
3
+ export interface DocumentListProps {
4
+ documents: QueryDocumentSnapshot[];
5
+ isLoading?: boolean;
6
+ error?: Error;
7
+ hasMore?: boolean;
8
+ onSelect?: (ref: DocumentReference) => void;
9
+ /** Fired when the user requests another page. Wire to the hook's
10
+ * `loadMore`. The component will not render a Load More button
11
+ * when this is undefined. */
12
+ onLoadMore?: () => void;
13
+ /**
14
+ * Optional renderer for the row label. Default renders the doc id.
15
+ * Override to show a field value alongside, an icon, etc.
16
+ */
17
+ renderLabel?: (doc: QueryDocumentSnapshot) => ReactNode;
18
+ /**
19
+ * Optional per-row action(s), rendered as a SIBLING of the row's
20
+ * select button inside the entry (not nested in it — so the action
21
+ * carries its own click handling without an invalid button-in-button).
22
+ * Used for row-level affordances like delete.
23
+ */
24
+ renderRowAction?: (doc: QueryDocumentSnapshot) => ReactNode;
25
+ emptyState?: ReactNode;
26
+ className?: string;
27
+ /** Stable collection/query identity used to reset update highlighting when
28
+ * the rendered list changes scope. */
29
+ updateScope?: string;
30
+ /**
31
+ * Above this row count, the list switches to virtualization via
32
+ * `<VirtualList>`. Default 100. Set to `Infinity` to disable
33
+ * (e.g. when measuring layout shifts is more important than
34
+ * scroll perf).
35
+ */
36
+ virtualizeThreshold?: number;
37
+ /**
38
+ * Estimated row height when virtualizing. Default 36 — matches
39
+ * a single-line text button at 13px font + ~10px padding. Pass
40
+ * a function for variable sizing (TanStack measures the actual
41
+ * height via ResizeObserver after the first paint anyway).
42
+ */
43
+ rowHeight?: number | ((index: number) => number);
44
+ /**
45
+ * Pixel height the virtualized scroll container fills. Only
46
+ * applies when `documents.length > virtualizeThreshold`. Default
47
+ * `'60vh'` — consumers usually constrain via their layout.
48
+ */
49
+ virtualizedHeight?: number | string;
50
+ }
51
+ /**
52
+ * Headless document list. Below `virtualizeThreshold`, renders a
53
+ * plain `<ul>`; above it, switches to TanStack-Virtual via
54
+ * `<VirtualList>` so 10k-doc collections don't bloat the DOM.
55
+ *
56
+ * The hook owns pagination state; this component just renders. The
57
+ * Load More button only renders when `hasMore` is true AND
58
+ * `onLoadMore` is provided. Consumers wanting infinite scroll
59
+ * trigger `onLoadMore` from a sentinel `IntersectionObserver` in
60
+ * their own code — the component doesn't bake that policy in.
61
+ */
62
+ export declare function DocumentList({ documents, isLoading, error, hasMore, onSelect, onLoadMore, renderLabel, renderRowAction, emptyState, className, updateScope, virtualizeThreshold, rowHeight, virtualizedHeight, }: DocumentListProps): import("react").JSX.Element;
63
+ //# sourceMappingURL=DocumentList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentList.d.ts","sourceRoot":"","sources":["../../../src/firestore/components/DocumentList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAehF,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,qBAAqB,EAAE,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,GAAG,EA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