@rebasepro/cms 0.24.0 → 0.24.1-canary.g56af4a4

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 (804) hide show
  1. package/dist/collection_editor/CollectionEditorDialogsContext.js +10 -0
  2. package/dist/collection_editor/CollectionEditorDialogsContext.js.map +1 -0
  3. package/dist/collection_editor/ConfigControllerProvider.js +274 -0
  4. package/dist/collection_editor/ConfigControllerProvider.js.map +1 -0
  5. package/dist/collection_editor/api/generateCollectionApi.js +64 -0
  6. package/dist/collection_editor/api/generateCollectionApi.js.map +1 -0
  7. package/dist/collection_editor/collection_wire.d.ts +13 -0
  8. package/dist/collection_editor/collection_wire.js +49 -0
  9. package/dist/collection_editor/collection_wire.js.map +1 -0
  10. package/dist/collection_editor/liveSchemaClient.js +130 -0
  11. package/dist/collection_editor/liveSchemaClient.js.map +1 -0
  12. package/dist/collection_editor/relation_kinds.js +74 -0
  13. package/dist/collection_editor/relation_kinds.js.map +1 -0
  14. package/dist/collection_editor/serializable_types.d.ts +4 -1
  15. package/dist/collection_editor/serializable_utils.js +504 -0
  16. package/dist/collection_editor/serializable_utils.js.map +1 -0
  17. package/dist/collection_editor/ui/EditorCollectionAction.js +37 -0
  18. package/dist/collection_editor/ui/EditorCollectionAction.js.map +1 -0
  19. package/dist/collection_editor/ui/MissingReferenceWidget.js +39 -0
  20. package/dist/collection_editor/ui/MissingReferenceWidget.js.map +1 -0
  21. package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.js +160 -0
  22. package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.js.map +1 -0
  23. package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.js +61 -0
  24. package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.js.map +1 -0
  25. package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.js +731 -0
  26. package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.js.map +1 -0
  27. package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.js +220 -0
  28. package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.js.map +1 -0
  29. package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.js +160 -0
  30. package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.js.map +1 -0
  31. package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.js +394 -0
  32. package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.js.map +1 -0
  33. package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.js +616 -0
  34. package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.js.map +1 -0
  35. package/dist/collection_editor/ui/collection_editor/CollectionStudioView.js +68 -0
  36. package/dist/collection_editor/ui/collection_editor/CollectionStudioView.js.map +1 -0
  37. package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.js +11 -0
  38. package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.js.map +1 -0
  39. package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.js +148 -0
  40. package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.js.map +1 -0
  41. package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.js +244 -0
  42. package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.js.map +1 -0
  43. package/dist/collection_editor/ui/collection_editor/EnumForm.js +222 -0
  44. package/dist/collection_editor/ui/collection_editor/EnumForm.js.map +1 -0
  45. package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.js +204 -0
  46. package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.js.map +1 -0
  47. package/dist/collection_editor/ui/collection_editor/GetCodeDialog.js +108 -0
  48. package/dist/collection_editor/ui/collection_editor/GetCodeDialog.js.map +1 -0
  49. package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.js +163 -0
  50. package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.js.map +1 -0
  51. package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.js +59 -0
  52. package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.js.map +1 -0
  53. package/dist/collection_editor/ui/collection_editor/PropertyEditView.js +640 -0
  54. package/dist/collection_editor/ui/collection_editor/PropertyEditView.js.map +1 -0
  55. package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.js +141 -0
  56. package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.js.map +1 -0
  57. package/dist/collection_editor/ui/collection_editor/PropertyTree.js +210 -0
  58. package/dist/collection_editor/ui/collection_editor/PropertyTree.js.map +1 -0
  59. package/dist/collection_editor/ui/collection_editor/RouterCollectionStudioView.js +31 -0
  60. package/dist/collection_editor/ui/collection_editor/RouterCollectionStudioView.js.map +1 -0
  61. package/dist/collection_editor/ui/collection_editor/RouterCollectionsStudioView.js +25 -0
  62. package/dist/collection_editor/ui/collection_editor/RouterCollectionsStudioView.js.map +1 -0
  63. package/dist/{SchemaChangeDialog-CcFSXvkK.js → collection_editor/ui/collection_editor/SchemaChangeDialog.js} +42 -59
  64. package/dist/collection_editor/ui/collection_editor/SchemaChangeDialog.js.map +1 -0
  65. package/dist/collection_editor/ui/collection_editor/SwitchControl.js +24 -0
  66. package/dist/collection_editor/ui/collection_editor/SwitchControl.js.map +1 -0
  67. package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.js +66 -0
  68. package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.js.map +1 -0
  69. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.js +61 -0
  70. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.js.map +1 -0
  71. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.js +188 -0
  72. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.js.map +1 -0
  73. package/dist/collection_editor/ui/collection_editor/import/clean_import_data.d.ts +12 -0
  74. package/dist/collection_editor/ui/collection_editor/import/clean_import_data.js +74 -0
  75. package/dist/collection_editor/ui/collection_editor/import/clean_import_data.js.map +1 -0
  76. package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.js +100 -0
  77. package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.js.map +1 -0
  78. package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.js +34 -0
  79. package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.js.map +1 -0
  80. package/dist/collection_editor/ui/collection_editor/properties/CommonPropertyFields.js +75 -0
  81. package/dist/collection_editor/ui/collection_editor/properties/CommonPropertyFields.js.map +1 -0
  82. package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.js +338 -0
  83. package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.js.map +1 -0
  84. package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.js +83 -0
  85. package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.js.map +1 -0
  86. package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.js +15 -0
  87. package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.js.map +1 -0
  88. package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.js +121 -0
  89. package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.js.map +1 -0
  90. package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.js +127 -0
  91. package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.js.map +1 -0
  92. package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.js +151 -0
  93. package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.js.map +1 -0
  94. package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.js +77 -0
  95. package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.js.map +1 -0
  96. package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.js +254 -0
  97. package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.js.map +1 -0
  98. package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.js +71 -0
  99. package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.js.map +1 -0
  100. package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.js +356 -0
  101. package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.js.map +1 -0
  102. package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.js +173 -0
  103. package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.js.map +1 -0
  104. package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.js +79 -0
  105. package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.js.map +1 -0
  106. package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.js +34 -0
  107. package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.js.map +1 -0
  108. package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.js +47 -0
  109. package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.js.map +1 -0
  110. package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.js +47 -0
  111. package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.js.map +1 -0
  112. package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.js +62 -0
  113. package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.js.map +1 -0
  114. package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.js +119 -0
  115. package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.js.map +1 -0
  116. package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +10 -0
  117. package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.js +178 -0
  118. package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.js.map +1 -0
  119. package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.js +23 -0
  120. package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.js.map +1 -0
  121. package/dist/collection_editor/ui/collection_editor/templates/blog_template.js +116 -0
  122. package/dist/collection_editor/ui/collection_editor/templates/blog_template.js.map +1 -0
  123. package/dist/collection_editor/ui/collection_editor/templates/pages_template.js +182 -0
  124. package/dist/collection_editor/ui/collection_editor/templates/pages_template.js.map +1 -0
  125. package/dist/collection_editor/ui/collection_editor/templates/products_template.js +87 -0
  126. package/dist/collection_editor/ui/collection_editor/templates/products_template.js.map +1 -0
  127. package/dist/collection_editor/ui/collection_editor/templates/users_template.js +46 -0
  128. package/dist/collection_editor/ui/collection_editor/templates/users_template.js.map +1 -0
  129. package/dist/collection_editor/ui/collection_editor/util.js +20 -0
  130. package/dist/collection_editor/ui/collection_editor/util.js.map +1 -0
  131. package/dist/collection_editor/ui/collection_editor/utils/strings.js +2 -0
  132. package/dist/collection_editor/ui/collection_editor/utils/supported_fields.js +37 -0
  133. package/dist/collection_editor/ui/collection_editor/utils/supported_fields.js.map +1 -0
  134. package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.js +192 -0
  135. package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.js.map +1 -0
  136. package/dist/collection_editor/useCollectionEditorController.js +12 -0
  137. package/dist/collection_editor/useCollectionEditorController.js.map +1 -0
  138. package/dist/collection_editor/useCollectionsConfigController.js +12 -0
  139. package/dist/collection_editor/useCollectionsConfigController.js.map +1 -0
  140. package/dist/collection_editor/useJsonCollectionsConfigController.js +191 -0
  141. package/dist/collection_editor/useJsonCollectionsConfigController.js.map +1 -0
  142. package/dist/collection_editor/useLiveSchemaEditing.js +214 -0
  143. package/dist/collection_editor/useLiveSchemaEditing.js.map +1 -0
  144. package/dist/collection_editor/useLocalCollectionsConfigController.js +228 -0
  145. package/dist/collection_editor/useLocalCollectionsConfigController.js.map +1 -0
  146. package/dist/collection_editor/useSafeSnackbarController.js +13 -0
  147. package/dist/collection_editor/useSafeSnackbarController.js.map +1 -0
  148. package/dist/collection_editor/validateCollectionJson.js +289 -0
  149. package/dist/collection_editor/validateCollectionJson.js.map +1 -0
  150. package/dist/collection_editor_ui.js +7 -33
  151. package/dist/components/AdditionalFieldValue.js +60 -0
  152. package/dist/components/AdditionalFieldValue.js.map +1 -0
  153. package/dist/components/AdminModeSyncer.js +41 -0
  154. package/dist/components/AdminModeSyncer.js.map +1 -0
  155. package/dist/components/ArrayContainer.d.ts +8 -2
  156. package/dist/components/ArrayContainer.js +363 -0
  157. package/dist/components/ArrayContainer.js.map +1 -0
  158. package/dist/components/ClearFilterSortButton.js +33 -0
  159. package/dist/components/ClearFilterSortButton.js.map +1 -0
  160. package/dist/components/CollectionEditorDialogs.js +49 -0
  161. package/dist/components/CollectionEditorDialogs.js.map +1 -0
  162. package/dist/components/CollectionPanel.js +95 -0
  163. package/dist/components/CollectionPanel.js.map +1 -0
  164. package/dist/components/CollectionTableBinding/CollectionRowActions.js +165 -0
  165. package/dist/components/CollectionTableBinding/CollectionRowActions.js.map +1 -0
  166. package/dist/components/CollectionTableBinding/CollectionTableBinding.js +329 -0
  167. package/dist/components/CollectionTableBinding/CollectionTableBinding.js.map +1 -0
  168. package/dist/components/CollectionTableBinding/PropertyTableCell.js +311 -0
  169. package/dist/components/CollectionTableBinding/PropertyTableCell.js.map +1 -0
  170. package/dist/components/CollectionTableBinding/column_utils.js +85 -0
  171. package/dist/components/CollectionTableBinding/column_utils.js.map +1 -0
  172. package/dist/components/CollectionTableBinding/fields/CompactEntityCellField.js +45 -0
  173. package/dist/components/CollectionTableBinding/fields/CompactEntityCellField.js.map +1 -0
  174. package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.js +66 -0
  175. package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.js.map +1 -0
  176. package/dist/components/CollectionTableBinding/fields/TableReferenceField.js +86 -0
  177. package/dist/components/CollectionTableBinding/fields/TableReferenceField.js.map +1 -0
  178. package/dist/components/CollectionTableBinding/fields/TableRelationField.js +93 -0
  179. package/dist/components/CollectionTableBinding/fields/TableRelationField.js.map +1 -0
  180. package/dist/components/CollectionTableBinding/fields/TableRelationSelectorField.js +33 -0
  181. package/dist/components/CollectionTableBinding/fields/TableRelationSelectorField.js.map +1 -0
  182. package/dist/components/CollectionTableBinding/fields/TableStorageUpload.js +171 -0
  183. package/dist/components/CollectionTableBinding/fields/TableStorageUpload.js.map +1 -0
  184. package/dist/components/CollectionTableBinding/fields/VirtualTableSelect.js +91 -0
  185. package/dist/components/CollectionTableBinding/fields/VirtualTableSelect.js.map +1 -0
  186. package/dist/components/CollectionTableBinding/fields/VirtualTableUserSelect.js +36 -0
  187. package/dist/components/CollectionTableBinding/fields/VirtualTableUserSelect.js.map +1 -0
  188. package/dist/components/CollectionTableBinding/index.js +6 -0
  189. package/dist/components/CollectionTableBinding/internal/CollectionTableToolbar.js +50 -0
  190. package/dist/components/CollectionTableBinding/internal/CollectionTableToolbar.js.map +1 -0
  191. package/dist/components/CollectionTableBinding/internal/EntityTableCell.d.ts +2 -0
  192. package/dist/components/CollectionTableBinding/internal/EntityTableCell.js +223 -0
  193. package/dist/components/CollectionTableBinding/internal/EntityTableCell.js.map +1 -0
  194. package/dist/components/CollectionTableBinding/internal/EntityTableCellActions.js +58 -0
  195. package/dist/components/CollectionTableBinding/internal/EntityTableCellActions.js.map +1 -0
  196. package/dist/components/CollectionTableBinding/internal/TableCellOpener.js +53 -0
  197. package/dist/components/CollectionTableBinding/internal/TableCellOpener.js.map +1 -0
  198. package/dist/components/CollectionTableBinding/internal/common.js +40 -0
  199. package/dist/components/CollectionTableBinding/internal/common.js.map +1 -0
  200. package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.js +270 -0
  201. package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.js.map +1 -0
  202. package/dist/components/CollectionTableBinding/internal/popup_field/useDraggable.js +68 -0
  203. package/dist/components/CollectionTableBinding/internal/popup_field/useDraggable.js.map +1 -0
  204. package/dist/components/CollectionTableBinding/internal/popup_field/useWindowSize.js +24 -0
  205. package/dist/components/CollectionTableBinding/internal/popup_field/useWindowSize.js.map +1 -0
  206. package/dist/components/CollectionTableBinding/table_bindings.js +306 -0
  207. package/dist/components/CollectionTableBinding/table_bindings.js.map +1 -0
  208. package/dist/components/CollectionViewBinding/BoardCardBinding.js +160 -0
  209. package/dist/components/CollectionViewBinding/BoardCardBinding.js.map +1 -0
  210. package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.js +471 -0
  211. package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.js.map +1 -0
  212. package/dist/components/CollectionViewBinding/CollectionCardViewBinding.js +108 -0
  213. package/dist/components/CollectionViewBinding/CollectionCardViewBinding.js.map +1 -0
  214. package/dist/components/CollectionViewBinding/CollectionListViewBinding.js +988 -0
  215. package/dist/components/CollectionViewBinding/CollectionListViewBinding.js.map +1 -0
  216. package/dist/components/CollectionViewBinding/CollectionViewActions.js +146 -0
  217. package/dist/components/CollectionViewBinding/CollectionViewActions.js.map +1 -0
  218. package/dist/components/CollectionViewBinding/CollectionViewBinding.js +1209 -0
  219. package/dist/components/CollectionViewBinding/CollectionViewBinding.js.map +1 -0
  220. package/dist/components/CollectionViewBinding/CollectionViewStartActions.js +133 -0
  221. package/dist/components/CollectionViewBinding/CollectionViewStartActions.js.map +1 -0
  222. package/dist/components/CollectionViewBinding/EntityCardBinding.js +133 -0
  223. package/dist/components/CollectionViewBinding/EntityCardBinding.js.map +1 -0
  224. package/dist/components/CollectionViewBinding/FilterPresetsButton.js +203 -0
  225. package/dist/components/CollectionViewBinding/FilterPresetsButton.js.map +1 -0
  226. package/dist/components/CollectionViewBinding/FiltersDialog.js +148 -0
  227. package/dist/components/CollectionViewBinding/FiltersDialog.js.map +1 -0
  228. package/dist/components/CollectionViewBinding/SearchExplanation.js +86 -0
  229. package/dist/components/CollectionViewBinding/SearchExplanation.js.map +1 -0
  230. package/dist/components/CollectionViewBinding/SearchHighlight.js +262 -0
  231. package/dist/components/CollectionViewBinding/SearchHighlight.js.map +1 -0
  232. package/dist/components/CollectionViewBinding/SlotValue.js +117 -0
  233. package/dist/components/CollectionViewBinding/SlotValue.js.map +1 -0
  234. package/dist/components/CollectionViewBinding/SortButton.js +214 -0
  235. package/dist/components/CollectionViewBinding/SortButton.js.map +1 -0
  236. package/dist/components/CollectionViewBinding/SplitListCloseButton.js +41 -0
  237. package/dist/components/CollectionViewBinding/SplitListCloseButton.js.map +1 -0
  238. package/dist/components/CollectionViewBinding/SplitListShowButton.js +29 -0
  239. package/dist/components/CollectionViewBinding/SplitListShowButton.js.map +1 -0
  240. package/dist/components/CollectionViewBinding/SplitListView.js +311 -0
  241. package/dist/components/CollectionViewBinding/SplitListView.js.map +1 -0
  242. package/dist/components/CollectionViewBinding/SplitViewContext.js +21 -0
  243. package/dist/components/CollectionViewBinding/SplitViewContext.js.map +1 -0
  244. package/dist/components/CollectionViewBinding/ViewModeToggle.js +150 -0
  245. package/dist/components/CollectionViewBinding/ViewModeToggle.js.map +1 -0
  246. package/dist/components/CollectionViewBinding/hooks/useCollectionInlineEditor.js +49 -0
  247. package/dist/components/CollectionViewBinding/hooks/useCollectionInlineEditor.js.map +1 -0
  248. package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.js +122 -0
  249. package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.js.map +1 -0
  250. package/dist/components/CollectionViewBinding/useBoardDataController.js +530 -0
  251. package/dist/components/CollectionViewBinding/useBoardDataController.js.map +1 -0
  252. package/dist/components/CollectionViewBinding/usePreviewSlots.d.ts +4 -1
  253. package/dist/components/CollectionViewBinding/usePreviewSlots.js +384 -0
  254. package/dist/components/CollectionViewBinding/usePreviewSlots.js.map +1 -0
  255. package/dist/components/CollectionViewBinding/useSelectionController.js +104 -0
  256. package/dist/components/CollectionViewBinding/useSelectionController.js.map +1 -0
  257. package/dist/components/CollectionViewBinding/utils.js +21 -0
  258. package/dist/components/CollectionViewBinding/utils.js.map +1 -0
  259. package/dist/components/DefaultAppBar.js +179 -0
  260. package/dist/components/DefaultAppBar.js.map +1 -0
  261. package/dist/components/DefaultDrawer.js +364 -0
  262. package/dist/components/DefaultDrawer.js.map +1 -0
  263. package/dist/components/DeleteEntityDialog.js +256 -0
  264. package/dist/components/DeleteEntityDialog.js.map +1 -0
  265. package/dist/components/DetailViewBinding.js +504 -0
  266. package/dist/components/DetailViewBinding.js.map +1 -0
  267. package/dist/components/DrawerNavigationGroup.js +74 -0
  268. package/dist/components/DrawerNavigationGroup.js.map +1 -0
  269. package/dist/components/DrawerNavigationItem.d.ts +8 -0
  270. package/dist/components/DrawerNavigationItem.js +45 -0
  271. package/dist/components/DrawerNavigationItem.js.map +1 -0
  272. package/dist/components/EditFormActions.js +210 -0
  273. package/dist/components/EditFormActions.js.map +1 -0
  274. package/dist/components/EditViewBinding.js +802 -0
  275. package/dist/components/EditViewBinding.js.map +1 -0
  276. package/dist/components/EntityDisplayHeader.js +139 -0
  277. package/dist/components/EntityDisplayHeader.js.map +1 -0
  278. package/dist/components/EntityIdentityBar.js +364 -0
  279. package/dist/components/EntityIdentityBar.js.map +1 -0
  280. package/dist/components/EntityInspector.js +96 -0
  281. package/dist/components/EntityInspector.js.map +1 -0
  282. package/dist/components/EntityPreviewBinding.js +282 -0
  283. package/dist/components/EntityPreviewBinding.js.map +1 -0
  284. package/dist/components/EntityPreviewNesting.js +53 -0
  285. package/dist/components/EntityPreviewNesting.js.map +1 -0
  286. package/dist/components/EntityViewBinding.js +246 -0
  287. package/dist/components/EntityViewBinding.js.map +1 -0
  288. package/dist/components/FieldCaption.js +17 -0
  289. package/dist/components/FieldCaption.js.map +1 -0
  290. package/dist/components/HomePage/ContentHomePage.js +326 -0
  291. package/dist/components/HomePage/ContentHomePage.js.map +1 -0
  292. package/dist/components/HomePage/FavouritesView.js +44 -0
  293. package/dist/components/HomePage/FavouritesView.js.map +1 -0
  294. package/dist/components/HomePage/HomePageDnD.js +436 -0
  295. package/dist/components/HomePage/HomePageDnD.js.map +1 -0
  296. package/dist/components/HomePage/NavigationCard.js +59 -0
  297. package/dist/components/HomePage/NavigationCard.js.map +1 -0
  298. package/dist/components/HomePage/NavigationCardBinding.js +70 -0
  299. package/dist/components/HomePage/NavigationCardBinding.js.map +1 -0
  300. package/dist/components/HomePage/NavigationGroup.js +98 -0
  301. package/dist/components/HomePage/NavigationGroup.js.map +1 -0
  302. package/dist/components/HomePage/RenameGroupDialog.js +89 -0
  303. package/dist/components/HomePage/RenameGroupDialog.js.map +1 -0
  304. package/dist/components/InlineEntityPreview.js +116 -0
  305. package/dist/components/InlineEntityPreview.js.map +1 -0
  306. package/dist/{JsonPreviewBinding-v0w3H0fp.js → components/JsonPreviewBinding.js} +2 -2
  307. package/dist/components/JsonPreviewBinding.js.map +1 -0
  308. package/dist/components/NavigationLoadingErrorView.js +27 -0
  309. package/dist/components/NavigationLoadingErrorView.js.map +1 -0
  310. package/dist/components/PickerTrigger.js +27 -0
  311. package/dist/components/PickerTrigger.js.map +1 -0
  312. package/dist/components/PropertyCollectionView.js +215 -0
  313. package/dist/components/PropertyCollectionView.js.map +1 -0
  314. package/dist/components/PropertyConfigBadge.js +19 -0
  315. package/dist/components/PropertyConfigBadge.js.map +1 -0
  316. package/dist/components/PropertyKeyHint.js +58 -0
  317. package/dist/components/PropertyKeyHint.js.map +1 -0
  318. package/dist/components/RebaseAuthGate.js +35 -0
  319. package/dist/components/RebaseAuthGate.js.map +1 -0
  320. package/dist/components/RebaseCMS.js +44 -0
  321. package/dist/components/RebaseCMS.js.map +1 -0
  322. package/dist/components/RebaseLayout.js +59 -0
  323. package/dist/components/RebaseLayout.js.map +1 -0
  324. package/dist/components/RebaseNavigation.js +211 -0
  325. package/dist/components/RebaseNavigation.js.map +1 -0
  326. package/dist/components/RebaseRouteDefs.js +96 -0
  327. package/dist/components/RebaseRouteDefs.js.map +1 -0
  328. package/dist/components/RebaseShell.js +50 -0
  329. package/dist/components/RebaseShell.js.map +1 -0
  330. package/dist/components/ReferenceTable/SelectionTableBinding.js +224 -0
  331. package/dist/components/ReferenceTable/SelectionTableBinding.js.map +1 -0
  332. package/dist/components/ReferenceWidget.js +100 -0
  333. package/dist/components/ReferenceWidget.js.map +1 -0
  334. package/dist/components/RelationSelector.js +625 -0
  335. package/dist/components/RelationSelector.js.map +1 -0
  336. package/dist/components/SearchIconsView.js +52 -0
  337. package/dist/components/SearchIconsView.js.map +1 -0
  338. package/dist/components/SelectableTable/SelectableTable.d.ts +1 -1
  339. package/dist/components/SelectableTable/SelectableTable.js +158 -0
  340. package/dist/components/SelectableTable/SelectableTable.js.map +1 -0
  341. package/dist/components/SelectableTable/SelectableTableContext.js +8 -0
  342. package/dist/components/SelectableTable/SelectableTableContext.js.map +1 -0
  343. package/dist/components/SelectableTable/SelectionStore.js +29 -0
  344. package/dist/components/SelectableTable/SelectionStore.js.map +1 -0
  345. package/dist/components/SelectableTable/filters/BooleanFilterField.js +28 -0
  346. package/dist/components/SelectableTable/filters/BooleanFilterField.js.map +1 -0
  347. package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
  348. package/dist/components/SelectableTable/filters/DateTimeFilterField.js +93 -0
  349. package/dist/components/SelectableTable/filters/DateTimeFilterField.js.map +1 -0
  350. package/dist/components/SelectableTable/filters/FilterFieldBinding.js +132 -0
  351. package/dist/components/SelectableTable/filters/FilterFieldBinding.js.map +1 -0
  352. package/dist/components/SelectableTable/filters/ReferenceFilterField.js +157 -0
  353. package/dist/components/SelectableTable/filters/ReferenceFilterField.js.map +1 -0
  354. package/dist/components/SelectableTable/filters/RelationFilterField.js +169 -0
  355. package/dist/components/SelectableTable/filters/RelationFilterField.js.map +1 -0
  356. package/dist/components/SelectableTable/filters/StringNumberFilterField.js +181 -0
  357. package/dist/components/SelectableTable/filters/StringNumberFilterField.js.map +1 -0
  358. package/dist/components/SelectableTable/filters/null_filter.js +36 -0
  359. package/dist/components/SelectableTable/filters/null_filter.js.map +1 -0
  360. package/dist/components/SideDialogs.js +149 -0
  361. package/dist/components/SideDialogs.js.map +1 -0
  362. package/dist/components/SidePanelBinding.js +287 -0
  363. package/dist/components/SidePanelBinding.js.map +1 -0
  364. package/dist/components/SidePanelProvider.js +69 -0
  365. package/dist/components/SidePanelProvider.js.map +1 -0
  366. package/dist/components/UserSelector.d.ts +2 -0
  367. package/dist/components/UserSelector.js +418 -0
  368. package/dist/components/UserSelector.js.map +1 -0
  369. package/dist/components/admin/CreationResultDialog.js +118 -0
  370. package/dist/components/admin/CreationResultDialog.js.map +1 -0
  371. package/dist/components/app/AppBar.js +14 -0
  372. package/dist/components/app/AppBar.js.map +1 -0
  373. package/dist/components/app/Drawer.js +26 -0
  374. package/dist/components/app/Drawer.js.map +1 -0
  375. package/dist/components/app/Scaffold.js +229 -0
  376. package/dist/components/app/Scaffold.js.map +1 -0
  377. package/dist/components/app/useApp.js +24 -0
  378. package/dist/components/app/useApp.js.map +1 -0
  379. package/dist/components/common/ActionMenuLabel.js +30 -0
  380. package/dist/components/common/ActionMenuLabel.js.map +1 -0
  381. package/dist/components/common/default_entity_actions.js +590 -0
  382. package/dist/components/common/default_entity_actions.js.map +1 -0
  383. package/dist/components/drawer_expansion.d.ts +25 -0
  384. package/dist/components/drawer_expansion.js +44 -0
  385. package/dist/components/drawer_expansion.js.map +1 -0
  386. package/dist/components/field_configs.d.ts +2 -2
  387. package/dist/components/field_configs.js +431 -0
  388. package/dist/components/field_configs.js.map +1 -0
  389. package/dist/components/field_ids.d.ts +11 -0
  390. package/dist/components/field_ids.js +58 -0
  391. package/dist/components/field_ids.js.map +1 -0
  392. package/dist/components/history/EntityHistoryEntry.js +151 -0
  393. package/dist/components/history/EntityHistoryEntry.js.map +1 -0
  394. package/dist/components/history/EntityHistoryView.js +157 -0
  395. package/dist/components/history/EntityHistoryView.js.map +1 -0
  396. package/dist/components/history/UserChip.js +21 -0
  397. package/dist/components/history/UserChip.js.map +1 -0
  398. package/dist/components/history/index.js +4 -0
  399. package/dist/components/lazy_record_views.d.ts +10 -0
  400. package/dist/components/lazy_record_views.js +57 -0
  401. package/dist/components/lazy_record_views.js.map +1 -0
  402. package/dist/contexts/BreacrumbsContext.js +28 -0
  403. package/dist/contexts/BreacrumbsContext.js.map +1 -0
  404. package/dist/contexts/EditorAIControllerContext.d.ts +18 -0
  405. package/dist/contexts/EditorAIControllerContext.js +29 -0
  406. package/dist/contexts/EditorAIControllerContext.js.map +1 -0
  407. package/dist/contexts/SideDialogsControllerContext.js +7 -0
  408. package/dist/contexts/SideDialogsControllerContext.js.map +1 -0
  409. package/dist/data_export/export/BasicExportAction.js +151 -0
  410. package/dist/data_export/export/BasicExportAction.js.map +1 -0
  411. package/dist/data_export/export/ExportCollectionAction.js +297 -0
  412. package/dist/data_export/export/ExportCollectionAction.js.map +1 -0
  413. package/dist/data_export/export/additional_fields.js +40 -0
  414. package/dist/data_export/export/additional_fields.js.map +1 -0
  415. package/dist/data_export/export/export.d.ts +35 -0
  416. package/dist/data_export/export/export.js +400 -0
  417. package/dist/data_export/export/export.js.map +1 -0
  418. package/dist/data_export/export/fetch_export_data.d.ts +17 -7
  419. package/dist/data_export/export/fetch_export_data.js +67 -0
  420. package/dist/data_export/export/fetch_export_data.js.map +1 -0
  421. package/dist/data_export/export/index.d.ts +4 -2
  422. package/dist/data_export/export/index.js +5 -0
  423. package/dist/data_import/components/DataNewPropertiesMapping.js +207 -0
  424. package/dist/data_import/components/DataNewPropertiesMapping.js.map +1 -0
  425. package/dist/data_import/components/ImportConversionProblems.js +89 -0
  426. package/dist/data_import/components/ImportConversionProblems.js.map +1 -0
  427. package/dist/data_import/components/ImportFileUpload.js +43 -0
  428. package/dist/data_import/components/ImportFileUpload.js.map +1 -0
  429. package/dist/data_import/components/ImportNewPropertyFieldPreview.js +42 -0
  430. package/dist/data_import/components/ImportNewPropertyFieldPreview.js.map +1 -0
  431. package/dist/data_import/components/ImportSaveInProgress.js +105 -0
  432. package/dist/data_import/components/ImportSaveInProgress.js.map +1 -0
  433. package/dist/data_import/hooks/useImportConfig.js +34 -0
  434. package/dist/data_import/hooks/useImportConfig.js.map +1 -0
  435. package/dist/{import-DjQoRrIU.js → data_import/import/ImportCollectionAction.js} +53 -43
  436. package/dist/data_import/import/ImportCollectionAction.js.map +1 -0
  437. package/dist/data_import/import/index.js +2 -0
  438. package/dist/data_import/utils/csv.js +146 -0
  439. package/dist/data_import/utils/csv.js.map +1 -0
  440. package/dist/data_import/utils/data.js +366 -0
  441. package/dist/data_import/utils/data.js.map +1 -0
  442. package/dist/data_import/utils/file_headers.js +32 -0
  443. package/dist/data_import/utils/file_headers.js.map +1 -0
  444. package/dist/data_import/utils/file_to_json.js +149 -0
  445. package/dist/data_import/utils/file_to_json.js.map +1 -0
  446. package/dist/data_import/utils/get_import_inference_type.js +14 -0
  447. package/dist/data_import/utils/get_import_inference_type.js.map +1 -0
  448. package/dist/data_import/utils/id_column.js +27 -0
  449. package/dist/data_import/utils/id_column.js.map +1 -0
  450. package/dist/data_import/utils/import_columns.js +92 -0
  451. package/dist/data_import/utils/import_columns.js.map +1 -0
  452. package/dist/data_import/utils/save_entities.d.ts +33 -4
  453. package/dist/data_import/utils/save_entities.js +244 -0
  454. package/dist/data_import/utils/save_entities.js.map +1 -0
  455. package/dist/data_import/utils/transforms.js +83 -0
  456. package/dist/data_import/utils/transforms.js.map +1 -0
  457. package/dist/editor/components/SlashCommandMenu.js +497 -0
  458. package/dist/editor/components/SlashCommandMenu.js.map +1 -0
  459. package/dist/editor/components/editor-bubble-item.js +24 -0
  460. package/dist/editor/components/editor-bubble-item.js.map +1 -0
  461. package/dist/editor/components/editor-bubble.js +97 -0
  462. package/dist/editor/components/editor-bubble.js.map +1 -0
  463. package/dist/editor/components/image-bubble.js +148 -0
  464. package/dist/editor/components/image-bubble.js.map +1 -0
  465. package/dist/editor/components/table-bubble.js +406 -0
  466. package/dist/editor/components/table-bubble.js.map +1 -0
  467. package/dist/editor/editor.js +423 -0
  468. package/dist/editor/editor.js.map +1 -0
  469. package/dist/editor/extensions/HighlightDecorationExtension.js +74 -0
  470. package/dist/editor/extensions/HighlightDecorationExtension.js.map +1 -0
  471. package/dist/editor/extensions/Image.d.ts +7 -1
  472. package/dist/editor/extensions/Image.js +160 -0
  473. package/dist/editor/extensions/Image.js.map +1 -0
  474. package/dist/editor/extensions/TextLoadingDecorationExtension.js +82 -0
  475. package/dist/editor/extensions/TextLoadingDecorationExtension.js.map +1 -0
  476. package/dist/editor/extensions/clipboard.js +63 -0
  477. package/dist/editor/extensions/clipboard.js.map +1 -0
  478. package/dist/editor/extensions/drag-and-drop.js +354 -0
  479. package/dist/editor/extensions/drag-and-drop.js.map +1 -0
  480. package/dist/editor/hooks/useProseMirror.js +101 -0
  481. package/dist/editor/hooks/useProseMirror.js.map +1 -0
  482. package/dist/editor/hooks/useProseMirrorContext.js +11 -0
  483. package/dist/editor/hooks/useProseMirrorContext.js.map +1 -0
  484. package/dist/editor/markdown.js +154 -0
  485. package/dist/editor/markdown.js.map +1 -0
  486. package/dist/editor/nodeViews/ImageComponent.js +35 -0
  487. package/dist/editor/nodeViews/ImageComponent.js.map +1 -0
  488. package/dist/editor/nodeViews/ReactNodeView.js +57 -0
  489. package/dist/editor/nodeViews/ReactNodeView.js.map +1 -0
  490. package/dist/editor/nodeViews/TaskItemComponent.js +29 -0
  491. package/dist/editor/nodeViews/TaskItemComponent.js.map +1 -0
  492. package/dist/editor/nodeViews/index.js +21 -0
  493. package/dist/editor/nodeViews/index.js.map +1 -0
  494. package/dist/editor/plugins/index.js +54 -0
  495. package/dist/editor/plugins/index.js.map +1 -0
  496. package/dist/editor/plugins/inputrules.js +54 -0
  497. package/dist/editor/plugins/inputrules.js.map +1 -0
  498. package/dist/editor/plugins/placeholderPlugin.js +38 -0
  499. package/dist/editor/plugins/placeholderPlugin.js.map +1 -0
  500. package/dist/editor/plugins/slashCommandPlugin.js +40 -0
  501. package/dist/editor/plugins/slashCommandPlugin.js.map +1 -0
  502. package/dist/editor/sanitize-html.js +190 -0
  503. package/dist/editor/sanitize-html.js.map +1 -0
  504. package/dist/{markdown-CCqp8ibf.js → editor/schema.js} +2 -159
  505. package/dist/editor/schema.js.map +1 -0
  506. package/dist/editor/selectors/link-selector.js +118 -0
  507. package/dist/editor/selectors/link-selector.js.map +1 -0
  508. package/dist/editor/selectors/node-selector.js +118 -0
  509. package/dist/editor/selectors/node-selector.js.map +1 -0
  510. package/dist/editor/selectors/text-buttons.js +71 -0
  511. package/dist/editor/selectors/text-buttons.js.map +1 -0
  512. package/dist/editor/utils/prosemirror-utils.js +92 -0
  513. package/dist/editor/utils/prosemirror-utils.js.map +1 -0
  514. package/dist/editor/utils/remove_classes.js +16 -0
  515. package/dist/editor/utils/remove_classes.js.map +1 -0
  516. package/dist/editor.js +1 -3147
  517. package/dist/form/EntityForm.js +734 -0
  518. package/dist/form/EntityForm.js.map +1 -0
  519. package/dist/form/EntityFormActions.js +101 -0
  520. package/dist/form/EntityFormActions.js.map +1 -0
  521. package/dist/form/EntityFormBinding.js +257 -0
  522. package/dist/form/EntityFormBinding.js.map +1 -0
  523. package/dist/form/PropertyFieldBinding.js +298 -0
  524. package/dist/form/PropertyFieldBinding.js.map +1 -0
  525. package/dist/form/components/ErrorFocus.js +33 -0
  526. package/dist/form/components/ErrorFocus.js.map +1 -0
  527. package/dist/form/components/FieldBlock.js +118 -0
  528. package/dist/form/components/FieldBlock.js.map +1 -0
  529. package/dist/form/components/FieldHelperText.js +56 -0
  530. package/dist/form/components/FieldHelperText.js.map +1 -0
  531. package/dist/form/components/FormRail.js +118 -0
  532. package/dist/form/components/FormRail.js.map +1 -0
  533. package/dist/form/components/FormSections.js +63 -0
  534. package/dist/form/components/FormSections.js.map +1 -0
  535. package/dist/form/components/LabelWithIcon.js +29 -0
  536. package/dist/form/components/LabelWithIcon.js.map +1 -0
  537. package/dist/form/components/LocalChangesMenu.js +127 -0
  538. package/dist/form/components/LocalChangesMenu.js.map +1 -0
  539. package/dist/form/components/StorageItemPreview.js +46 -0
  540. package/dist/form/components/StorageItemPreview.js.map +1 -0
  541. package/dist/form/components/StorageUploadProgress.js +84 -0
  542. package/dist/form/components/StorageUploadProgress.js.map +1 -0
  543. package/dist/form/components/useRailVisible.js +43 -0
  544. package/dist/form/components/useRailVisible.js.map +1 -0
  545. package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.js +84 -0
  546. package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.js.map +1 -0
  547. package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.js +125 -0
  548. package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.js.map +1 -0
  549. package/dist/form/field_bindings/BinaryFieldBinding.js +135 -0
  550. package/dist/form/field_bindings/BinaryFieldBinding.js.map +1 -0
  551. package/dist/form/field_bindings/BlockFieldBinding.js +164 -0
  552. package/dist/form/field_bindings/BlockFieldBinding.js.map +1 -0
  553. package/dist/form/field_bindings/DateTimeFieldBinding.js +47 -0
  554. package/dist/form/field_bindings/DateTimeFieldBinding.js.map +1 -0
  555. package/dist/form/field_bindings/GeopointFieldBinding.js +148 -0
  556. package/dist/form/field_bindings/GeopointFieldBinding.js.map +1 -0
  557. package/dist/form/field_bindings/KeyValueFieldBinding.js +450 -0
  558. package/dist/form/field_bindings/KeyValueFieldBinding.js.map +1 -0
  559. package/dist/form/field_bindings/MapFieldBinding.js +77 -0
  560. package/dist/form/field_bindings/MapFieldBinding.js.map +1 -0
  561. package/dist/form/field_bindings/MarkdownEditorFieldBinding.js +215 -0
  562. package/dist/form/field_bindings/MarkdownEditorFieldBinding.js.map +1 -0
  563. package/dist/form/field_bindings/MultiSelectFieldBinding.js +88 -0
  564. package/dist/form/field_bindings/MultiSelectFieldBinding.js.map +1 -0
  565. package/dist/form/field_bindings/MultipleRelationFieldBinding.js +118 -0
  566. package/dist/form/field_bindings/MultipleRelationFieldBinding.js.map +1 -0
  567. package/dist/form/field_bindings/ReadOnlyFieldBinding.js +52 -0
  568. package/dist/form/field_bindings/ReadOnlyFieldBinding.js.map +1 -0
  569. package/dist/form/field_bindings/ReferenceFieldBinding.js +99 -0
  570. package/dist/form/field_bindings/ReferenceFieldBinding.js.map +1 -0
  571. package/dist/form/field_bindings/RelationFieldBinding.js +135 -0
  572. package/dist/form/field_bindings/RelationFieldBinding.js.map +1 -0
  573. package/dist/form/field_bindings/RepeatFieldBinding.js +103 -0
  574. package/dist/form/field_bindings/RepeatFieldBinding.js.map +1 -0
  575. package/dist/form/field_bindings/SelectFieldBinding.js +80 -0
  576. package/dist/form/field_bindings/SelectFieldBinding.js.map +1 -0
  577. package/dist/form/field_bindings/StorageUploadFieldBinding.js +266 -0
  578. package/dist/form/field_bindings/StorageUploadFieldBinding.js.map +1 -0
  579. package/dist/form/field_bindings/SwitchFieldBinding.js +41 -0
  580. package/dist/form/field_bindings/SwitchFieldBinding.js.map +1 -0
  581. package/dist/form/field_bindings/TextFieldBinding.js +114 -0
  582. package/dist/form/field_bindings/TextFieldBinding.js.map +1 -0
  583. package/dist/form/field_bindings/UserSelectFieldBinding.js +48 -0
  584. package/dist/form/field_bindings/UserSelectFieldBinding.js.map +1 -0
  585. package/dist/form/field_bindings/VectorFieldBinding.js +147 -0
  586. package/dist/form/field_bindings/VectorFieldBinding.js.map +1 -0
  587. package/dist/form/form_keyboard_scope.d.ts +26 -0
  588. package/dist/form/form_keyboard_scope.js +39 -0
  589. package/dist/form/form_keyboard_scope.js.map +1 -0
  590. package/dist/form/form_uploads.d.ts +24 -0
  591. package/dist/form/form_uploads.js +31 -0
  592. package/dist/form/form_uploads.js.map +1 -0
  593. package/dist/form/form_utils.d.ts +24 -0
  594. package/dist/form/form_utils.js +280 -0
  595. package/dist/form/form_utils.js.map +1 -0
  596. package/dist/form/resolve_cell_property.d.ts +32 -0
  597. package/dist/form/resolve_cell_property.js +80 -0
  598. package/dist/form/resolve_cell_property.js.map +1 -0
  599. package/dist/form/resolve_form_properties.d.ts +2 -1
  600. package/dist/form/resolve_form_properties.js +78 -0
  601. package/dist/form/resolve_form_properties.js.map +1 -0
  602. package/dist/form/useClearRestoreValue.js +27 -0
  603. package/dist/form/useClearRestoreValue.js.map +1 -0
  604. package/dist/form/useUndoableDiscard.js +36 -0
  605. package/dist/form/useUndoableDiscard.js.map +1 -0
  606. package/dist/form/validation.d.ts +20 -0
  607. package/dist/form/validation.js +416 -0
  608. package/dist/form/validation.js.map +1 -0
  609. package/dist/hooks/navigation/contexts/CollectionRegistryContext.js +22 -0
  610. package/dist/hooks/navigation/contexts/CollectionRegistryContext.js.map +1 -0
  611. package/dist/hooks/navigation/contexts/NavigationStateContext.js +15 -0
  612. package/dist/hooks/navigation/contexts/NavigationStateContext.js.map +1 -0
  613. package/dist/hooks/navigation/contexts/UrlContext.js +22 -0
  614. package/dist/hooks/navigation/contexts/UrlContext.js.map +1 -0
  615. package/dist/hooks/navigation/useAsyncResolver.js +68 -0
  616. package/dist/hooks/navigation/useAsyncResolver.js.map +1 -0
  617. package/dist/hooks/navigation/useBuildCollectionRegistryController.js +141 -0
  618. package/dist/hooks/navigation/useBuildCollectionRegistryController.js.map +1 -0
  619. package/dist/hooks/navigation/useBuildNavigationStateController.js +77 -0
  620. package/dist/hooks/navigation/useBuildNavigationStateController.js.map +1 -0
  621. package/dist/hooks/navigation/useBuildUrlController.js +57 -0
  622. package/dist/hooks/navigation/useBuildUrlController.js.map +1 -0
  623. package/dist/hooks/navigation/useNavigationResolution.js +177 -0
  624. package/dist/hooks/navigation/useNavigationResolution.js.map +1 -0
  625. package/dist/hooks/navigation/useResolvedCollections.js +56 -0
  626. package/dist/hooks/navigation/useResolvedCollections.js.map +1 -0
  627. package/dist/hooks/navigation/useResolvedViews.js +94 -0
  628. package/dist/hooks/navigation/useResolvedViews.js.map +1 -0
  629. package/dist/hooks/navigation/useTopLevelNavigation.js +162 -0
  630. package/dist/hooks/navigation/useTopLevelNavigation.js.map +1 -0
  631. package/dist/hooks/navigation/utils.js +125 -0
  632. package/dist/hooks/navigation/utils.js.map +1 -0
  633. package/dist/hooks/useAdminContext.js +45 -0
  634. package/dist/hooks/useAdminContext.js.map +1 -0
  635. package/dist/hooks/useBreadcrumbsController.js +17 -0
  636. package/dist/hooks/useBreadcrumbsController.js.map +1 -0
  637. package/dist/hooks/useBuildSideDialogsController.js +96 -0
  638. package/dist/hooks/useBuildSideDialogsController.js.map +1 -0
  639. package/dist/hooks/useBuildSidePanel.js +208 -0
  640. package/dist/hooks/useBuildSidePanel.js.map +1 -0
  641. package/dist/hooks/useChildViewSource.js +41 -0
  642. package/dist/hooks/useChildViewSource.js.map +1 -0
  643. package/dist/hooks/useEntityDisplay.js +136 -0
  644. package/dist/hooks/useEntityDisplay.js.map +1 -0
  645. package/dist/hooks/useEntityDisplayTitle.js +34 -0
  646. package/dist/hooks/useEntityDisplayTitle.js.map +1 -0
  647. package/dist/hooks/useHistory.js +137 -0
  648. package/dist/hooks/useHistory.js.map +1 -0
  649. package/dist/hooks/useRecordActions.js +108 -0
  650. package/dist/hooks/useRecordActions.js.map +1 -0
  651. package/dist/hooks/useReferencePaths.js +32 -0
  652. package/dist/hooks/useReferencePaths.js.map +1 -0
  653. package/dist/hooks/useResolvedNavigationFrom.js +83 -0
  654. package/dist/hooks/useResolvedNavigationFrom.js.map +1 -0
  655. package/dist/hooks/useResolvedUsers.js +109 -0
  656. package/dist/hooks/useResolvedUsers.js.map +1 -0
  657. package/dist/hooks/useSelectionDialog.js +53 -0
  658. package/dist/hooks/useSelectionDialog.js.map +1 -0
  659. package/dist/hooks/useSideDialogsController.js +8 -0
  660. package/dist/hooks/useSideDialogsController.js.map +1 -0
  661. package/dist/hooks/useSidePanel.js +15 -0
  662. package/dist/hooks/useSidePanel.js.map +1 -0
  663. package/dist/hooks/useStorageReferenceResolver.d.ts +4 -2
  664. package/dist/hooks/useStorageReferenceResolver.js +49 -0
  665. package/dist/hooks/useStorageReferenceResolver.js.map +1 -0
  666. package/dist/index.d.ts +1 -0
  667. package/dist/index.js +149 -3867
  668. package/dist/preview/PropertyPreview.js +260 -0
  669. package/dist/preview/PropertyPreview.js.map +1 -0
  670. package/dist/preview/compact_text.js +52 -0
  671. package/dist/preview/compact_text.js.map +1 -0
  672. package/dist/preview/components/ArrayEnumPreview.js +24 -0
  673. package/dist/preview/components/ArrayEnumPreview.js.map +1 -0
  674. package/dist/preview/components/BooleanPreview.js +25 -0
  675. package/dist/preview/components/BooleanPreview.js.map +1 -0
  676. package/dist/preview/components/DatePreview.d.ts +3 -2
  677. package/dist/preview/components/DatePreview.js +87 -0
  678. package/dist/preview/components/DatePreview.js.map +1 -0
  679. package/dist/preview/components/EmptyValue.js +13 -0
  680. package/dist/preview/components/EmptyValue.js.map +1 -0
  681. package/dist/preview/components/EnumValuesChip.js +26 -0
  682. package/dist/preview/components/EnumValuesChip.js.map +1 -0
  683. package/dist/preview/components/ImagePreview.d.ts +7 -1
  684. package/dist/preview/components/ImagePreview.js +112 -0
  685. package/dist/preview/components/ImagePreview.js.map +1 -0
  686. package/dist/preview/components/InlineEntityListPreview.js +31 -0
  687. package/dist/preview/components/InlineEntityListPreview.js.map +1 -0
  688. package/dist/preview/components/ReferencePreview.js +162 -0
  689. package/dist/preview/components/ReferencePreview.js.map +1 -0
  690. package/dist/preview/components/RelationPreview.js +196 -0
  691. package/dist/preview/components/RelationPreview.js.map +1 -0
  692. package/dist/preview/components/StorageMarkdown.d.ts +2 -1
  693. package/dist/preview/components/StorageMarkdown.js +49 -0
  694. package/dist/preview/components/StorageMarkdown.js.map +1 -0
  695. package/dist/preview/components/StorageThumbnail.js +183 -0
  696. package/dist/preview/components/StorageThumbnail.js.map +1 -0
  697. package/dist/preview/components/UrlComponentPreview.d.ts +3 -1
  698. package/dist/preview/components/UrlComponentPreview.js +88 -0
  699. package/dist/preview/components/UrlComponentPreview.js.map +1 -0
  700. package/dist/preview/components/UserPreview.js +30 -0
  701. package/dist/preview/components/UserPreview.js.map +1 -0
  702. package/dist/preview/components/date_fns_locales.js +124 -0
  703. package/dist/preview/components/date_fns_locales.js.map +1 -0
  704. package/dist/preview/components/storageRenditions.d.ts +10 -0
  705. package/dist/preview/components/storageRenditions.js +93 -0
  706. package/dist/preview/components/storageRenditions.js.map +1 -0
  707. package/dist/preview/property_previews/ArrayOfMapsPreview.js +44 -0
  708. package/dist/preview/property_previews/ArrayOfMapsPreview.js.map +1 -0
  709. package/dist/preview/property_previews/ArrayOfReferencesPreview.js +48 -0
  710. package/dist/preview/property_previews/ArrayOfReferencesPreview.js.map +1 -0
  711. package/dist/preview/property_previews/ArrayOfRelationsPreview.js +50 -0
  712. package/dist/preview/property_previews/ArrayOfRelationsPreview.js.map +1 -0
  713. package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.js +30 -0
  714. package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.js.map +1 -0
  715. package/dist/preview/property_previews/ArrayOfStringsPreview.js +42 -0
  716. package/dist/preview/property_previews/ArrayOfStringsPreview.js.map +1 -0
  717. package/dist/preview/property_previews/ArrayOneOfPreview.js +47 -0
  718. package/dist/preview/property_previews/ArrayOneOfPreview.js.map +1 -0
  719. package/dist/preview/property_previews/ArrayPropertyEnumPreview.js +25 -0
  720. package/dist/preview/property_previews/ArrayPropertyEnumPreview.js.map +1 -0
  721. package/dist/preview/property_previews/ArrayPropertyPreview.js +48 -0
  722. package/dist/preview/property_previews/ArrayPropertyPreview.js.map +1 -0
  723. package/dist/preview/property_previews/MapPropertyPreview.js +137 -0
  724. package/dist/preview/property_previews/MapPropertyPreview.js.map +1 -0
  725. package/dist/preview/property_previews/NumberPropertyPreview.js +34 -0
  726. package/dist/preview/property_previews/NumberPropertyPreview.js.map +1 -0
  727. package/dist/preview/property_previews/SkeletonPropertyComponent.js +151 -0
  728. package/dist/preview/property_previews/SkeletonPropertyComponent.js.map +1 -0
  729. package/dist/preview/property_previews/StringPropertyPreview.js +49 -0
  730. package/dist/preview/property_previews/StringPropertyPreview.js.map +1 -0
  731. package/dist/preview/util.d.ts +4 -3
  732. package/dist/{util-D7ebttKT.js → preview/util.js} +8 -5
  733. package/dist/preview/util.js.map +1 -0
  734. package/dist/routes/CustomViewRoute.js +26 -0
  735. package/dist/routes/CustomViewRoute.js.map +1 -0
  736. package/dist/routes/RebaseRoute.js +311 -0
  737. package/dist/routes/RebaseRoute.js.map +1 -0
  738. package/dist/selection/SelectionMenu.js +90 -0
  739. package/dist/selection/SelectionMenu.js.map +1 -0
  740. package/dist/selection/resolve_selection.js +79 -0
  741. package/dist/selection/resolve_selection.js.map +1 -0
  742. package/dist/util/caller_scopes.js +25 -0
  743. package/dist/util/caller_scopes.js.map +1 -0
  744. package/dist/util/collection_open_mode.d.ts +20 -0
  745. package/dist/util/collection_open_mode.js +32 -0
  746. package/dist/util/collection_open_mode.js.map +1 -0
  747. package/dist/util/dataControllerAdapter.js +65 -0
  748. package/dist/util/dataControllerAdapter.js.map +1 -0
  749. package/dist/util/entity_actions.d.ts +5 -0
  750. package/dist/util/entity_actions.js +77 -0
  751. package/dist/util/entity_actions.js.map +1 -0
  752. package/dist/util/entity_pages.d.ts +37 -3
  753. package/dist/util/entity_pages.js +71 -0
  754. package/dist/util/entity_pages.js.map +1 -0
  755. package/dist/util/find_entities_by_ids.d.ts +23 -0
  756. package/dist/util/find_entities_by_ids.js +55 -0
  757. package/dist/util/find_entities_by_ids.js.map +1 -0
  758. package/dist/util/fit_inline_actions.js +40 -0
  759. package/dist/util/fit_inline_actions.js.map +1 -0
  760. package/dist/util/format_collection_date.d.ts +29 -0
  761. package/dist/util/format_collection_date.js +60 -0
  762. package/dist/util/format_collection_date.js.map +1 -0
  763. package/dist/util/map_with_concurrency.js +46 -0
  764. package/dist/util/map_with_concurrency.js.map +1 -0
  765. package/dist/util/navigation_utils.js +44 -0
  766. package/dist/util/navigation_utils.js.map +1 -0
  767. package/dist/util/number_format.js +33 -0
  768. package/dist/util/number_format.js.map +1 -0
  769. package/dist/util/previews.js +71 -0
  770. package/dist/util/previews.js.map +1 -0
  771. package/dist/util/propertyConfigMapper.js +83 -0
  772. package/dist/util/propertyConfigMapper.js.map +1 -0
  773. package/dist/util/property_utils.js +141 -0
  774. package/dist/util/property_utils.js.map +1 -0
  775. package/dist/util/resolutions.js +55 -0
  776. package/dist/util/resolutions.js.map +1 -0
  777. package/dist/util/view_constants.js +35 -0
  778. package/dist/util/view_constants.js.map +1 -0
  779. package/dist/util/view_mode.js +112 -0
  780. package/dist/util/view_mode.js.map +1 -0
  781. package/package.json +13 -9
  782. package/dist/CollectionEditorDialog-p5-I-Apu.js +0 -3669
  783. package/dist/CollectionEditorDialog-p5-I-Apu.js.map +0 -1
  784. package/dist/JsonPreviewBinding-v0w3H0fp.js.map +0 -1
  785. package/dist/PropertyEditView-DDB_X-00.js +0 -3837
  786. package/dist/PropertyEditView-DDB_X-00.js.map +0 -1
  787. package/dist/RouterCollectionsStudioView-SGBV4CMg.js +0 -212
  788. package/dist/RouterCollectionsStudioView-SGBV4CMg.js.map +0 -1
  789. package/dist/SchemaChangeDialog-CcFSXvkK.js.map +0 -1
  790. package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +0 -13
  791. package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +0 -8
  792. package/dist/collection_editor_ui.js.map +0 -1
  793. package/dist/editor.js.map +0 -1
  794. package/dist/export-DCHuPD1a.js +0 -520
  795. package/dist/export-DCHuPD1a.js.map +0 -1
  796. package/dist/history-CBd6SBRs.js +0 -314
  797. package/dist/history-CBd6SBRs.js.map +0 -1
  798. package/dist/import-DjQoRrIU.js.map +0 -1
  799. package/dist/index.js.map +0 -1
  800. package/dist/markdown-CCqp8ibf.js.map +0 -1
  801. package/dist/rolldown-runtime-D7D4PA-g.js +0 -13
  802. package/dist/util-BRvKFMLa.js +0 -27773
  803. package/dist/util-BRvKFMLa.js.map +0 -1
  804. package/dist/util-D7ebttKT.js.map +0 -1
@@ -0,0 +1,530 @@
1
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
2
+ import { CollectionWindow, getRelationIncludeParams, useData, useRebaseContext } from "@rebasepro/app";
3
+ //#region src/components/CollectionViewBinding/useBoardDataController.tsx
4
+ var DEFAULT_PAGE_SIZE$1 = 20;
5
+ /**
6
+ * How long a column waits for its subscription's first payload before reading
7
+ * once over HTTP instead. Long enough that a healthy socket always wins the
8
+ * race, short enough that a dead one does not hold a blank board.
9
+ */
10
+ var LIVE_FIRST_PAINT_TIMEOUT_MS = 2500;
11
+ /**
12
+ * Shallow equality for entity value records.
13
+ * Handles primitives and reference equality for nested values.
14
+ * Avoids JSON.stringify allocation on every comparison.
15
+ */
16
+ function shallowEqualValues(a, b) {
17
+ if (a === b) return true;
18
+ if (!a || !b) return false;
19
+ const keysA = Object.keys(a);
20
+ const keysB = Object.keys(b);
21
+ if (keysA.length !== keysB.length) return false;
22
+ for (const key of keysA) if (a[key] !== b[key]) return false;
23
+ return true;
24
+ }
25
+ /**
26
+ * Hook that manages per-column data loading for the Kanban board.
27
+ * Each column gets its own independent query to the data source.
28
+ */
29
+ function useBoardDataController({ fullPath, collection, columnProperty, columns, orderProperty, pageSize = DEFAULT_PAGE_SIZE$1, searchString, filterValues }) {
30
+ const context = useRebaseContext();
31
+ const dataClient = useData();
32
+ const resolvedPath = fullPath;
33
+ const dataClientRef = useRef(dataClient);
34
+ const collectionRef = useRef(collection);
35
+ const contextRef = useRef(context);
36
+ dataClientRef.current = dataClient;
37
+ collectionRef.current = collection;
38
+ contextRef.current = context;
39
+ const filterValuesRef = useRef(filterValues);
40
+ const columnPropertyRef = useRef(columnProperty);
41
+ const orderPropertyRef = useRef(orderProperty);
42
+ const searchStringRef = useRef(searchString);
43
+ const resolvedPathRef = useRef(resolvedPath);
44
+ const pageSizeRef = useRef(pageSize);
45
+ pageSizeRef.current = pageSize;
46
+ filterValuesRef.current = filterValues;
47
+ columnPropertyRef.current = columnProperty;
48
+ orderPropertyRef.current = orderProperty;
49
+ searchStringRef.current = searchString;
50
+ resolvedPathRef.current = resolvedPath;
51
+ const [columnItemCounts, setColumnItemCounts] = useState(() => {
52
+ const initial = {};
53
+ columns.forEach((col) => {
54
+ initial[col] = pageSize;
55
+ });
56
+ return initial;
57
+ });
58
+ const [columnData, setColumnData] = useState(() => {
59
+ const initial = {};
60
+ columns.forEach((col) => {
61
+ initial[col] = {
62
+ entities: [],
63
+ loading: true,
64
+ hasMore: true,
65
+ error: void 0,
66
+ totalCount: void 0
67
+ };
68
+ });
69
+ return initial;
70
+ });
71
+ const unsubscribersRef = useRef({});
72
+ const windowsRef = useRef({});
73
+ const isCleaningUpRef = useRef(false);
74
+ const pendingItemsRef = useRef({});
75
+ const columnsKey = useMemo(() => [...columns].sort().join(","), [columns]);
76
+ const filterKey = useMemo(() => JSON.stringify(filterValues), [filterValues]);
77
+ const prevColumnItemCountsRef = useRef(columnItemCounts);
78
+ const [subscriptionVersion, setSubscriptionVersion] = useState(0);
79
+ useEffect(() => {
80
+ setSubscriptionVersion((v) => v + 1);
81
+ }, [
82
+ columnsKey,
83
+ resolvedPath,
84
+ columnProperty,
85
+ orderProperty,
86
+ searchString,
87
+ filterKey,
88
+ pageSize
89
+ ]);
90
+ useEffect(() => {
91
+ return () => {
92
+ isCleaningUpRef.current = true;
93
+ Object.values(unsubscribersRef.current).forEach((unsub) => unsub?.());
94
+ unsubscribersRef.current = {};
95
+ };
96
+ }, []);
97
+ /**
98
+ * Check if a column value is excluded by the active filter on the columnProperty.
99
+ * E.g. if the user sets "Status IN (Open, In Progress)", this returns true
100
+ * for "Waiting on Customer" since that column should show as empty.
101
+ */
102
+ const isColumnExcludedByFilter = useCallback((column, filterValues, colProperty) => {
103
+ if (!filterValues || !colProperty) return false;
104
+ const filterForColumn = filterValues[colProperty];
105
+ if (!filterForColumn || !Array.isArray(filterForColumn)) return false;
106
+ const [op, val] = filterForColumn;
107
+ if (op === "==" && typeof val === "string") return column !== val;
108
+ if (op === "!=" && typeof val === "string") return column === val;
109
+ if (op === "in" && Array.isArray(val)) return !val.map(String).includes(column);
110
+ if (op === "not-in" && Array.isArray(val)) return val.map(String).includes(column);
111
+ return false;
112
+ }, []);
113
+ const subscribeToColumn = useCallback((column, itemCount) => {
114
+ if (isCleaningUpRef.current) return;
115
+ const currentDataClient = dataClientRef.current;
116
+ const currentCollection = collectionRef.current;
117
+ const currentContext = contextRef.current;
118
+ const currentFilterValues = filterValuesRef.current;
119
+ const currentColumnProperty = columnPropertyRef.current;
120
+ const currentOrderProperty = orderPropertyRef.current;
121
+ const currentSearchString = searchStringRef.current;
122
+ const currentResolvedPath = resolvedPathRef.current;
123
+ if (isColumnExcludedByFilter(column, currentFilterValues, currentColumnProperty)) {
124
+ setColumnData((prev) => ({
125
+ ...prev,
126
+ [column]: {
127
+ entities: [],
128
+ loading: false,
129
+ hasMore: false,
130
+ error: void 0,
131
+ totalCount: 0
132
+ }
133
+ }));
134
+ return;
135
+ }
136
+ const whereFilter = {
137
+ ...currentFilterValues ?? {},
138
+ [currentColumnProperty]: ["==", column]
139
+ };
140
+ const orderByParam = currentOrderProperty ? [currentOrderProperty, "asc"] : void 0;
141
+ let active = true;
142
+ const isCurrent = () => active && !isCleaningUpRef.current;
143
+ let updateSequence = 0;
144
+ setColumnData((prev) => ({
145
+ ...prev,
146
+ [column]: {
147
+ ...prev[column],
148
+ loading: true,
149
+ error: void 0
150
+ }
151
+ }));
152
+ const onUpdate = async (entities, state) => {
153
+ if (!isCurrent()) return;
154
+ const sequence = ++updateSequence;
155
+ const pendingMap = pendingItemsRef.current;
156
+ const mergedEntities = entities.map((e) => {
157
+ const pending = pendingMap[String(e.id)];
158
+ if (pending) {
159
+ const expectedCol = pending.expectedValues[currentColumnProperty];
160
+ const expectedOrder = currentOrderProperty ? pending.expectedValues[currentOrderProperty] : void 0;
161
+ let caughtUp = true;
162
+ if (e.values?.[currentColumnProperty] !== expectedCol) caughtUp = false;
163
+ if (currentOrderProperty && e.values?.[currentOrderProperty] !== expectedOrder) caughtUp = false;
164
+ if (caughtUp) {
165
+ delete pendingMap[String(e.id)];
166
+ return e;
167
+ }
168
+ return {
169
+ ...e,
170
+ values: {
171
+ ...e.values,
172
+ ...pending.expectedValues
173
+ }
174
+ };
175
+ }
176
+ return e;
177
+ });
178
+ Object.values(pendingMap).forEach((pending) => {
179
+ if (pending.expectedValues[currentColumnProperty] === column) {
180
+ if (!mergedEntities.some((e) => String(e.id) === String(pending.entity.id))) mergedEntities.push(pending.entity);
181
+ }
182
+ });
183
+ let processed = mergedEntities.filter((e) => e.values?.[currentColumnProperty] === column);
184
+ if (currentOrderProperty) processed = [...processed].sort((a, b) => {
185
+ const valA = a.values?.[currentOrderProperty];
186
+ const valB = b.values?.[currentOrderProperty];
187
+ const isAEmpty = valA === void 0 || valA === null || valA === "";
188
+ const isBEmpty = valB === void 0 || valB === null || valB === "";
189
+ if (isAEmpty && isBEmpty) return 0;
190
+ if (isAEmpty) return 1;
191
+ if (isBEmpty) return -1;
192
+ return valA < valB ? -1 : valA > valB ? 1 : 0;
193
+ });
194
+ if (currentCollection.browserCallbacks?.afterRead) try {
195
+ processed = await Promise.all(processed.map(async (entity) => {
196
+ const processedRow = await currentCollection.browserCallbacks.afterRead({
197
+ collection: currentCollection,
198
+ path: currentResolvedPath,
199
+ row: {
200
+ id: entity.id,
201
+ ...entity.values
202
+ },
203
+ context: currentContext
204
+ });
205
+ return {
206
+ ...entity,
207
+ values: processedRow
208
+ };
209
+ }));
210
+ } catch (e) {
211
+ console.error("Error in afterRead callback:", e);
212
+ }
213
+ if (!isCurrent() || sequence !== updateSequence) return;
214
+ const newHasMore = !state.complete && !state.error;
215
+ setColumnData((prev) => {
216
+ const existing = prev[column];
217
+ if (existing && !existing.loading && existing.entities.length === processed.length) {
218
+ let identical = true;
219
+ for (let i = 0; i < processed.length; i++) {
220
+ const a = existing.entities[i];
221
+ const b = processed[i];
222
+ if (a.id !== b.id) {
223
+ identical = false;
224
+ break;
225
+ }
226
+ if (!shallowEqualValues(a.values, b.values)) {
227
+ identical = false;
228
+ break;
229
+ }
230
+ }
231
+ if (identical && existing.hasMore === newHasMore && !state.loading && existing.error === state.error) return prev;
232
+ }
233
+ return {
234
+ ...prev,
235
+ [column]: {
236
+ entities: processed,
237
+ loading: state.loading,
238
+ hasMore: newHasMore,
239
+ error: state.error,
240
+ totalCount: prev[column]?.totalCount
241
+ }
242
+ };
243
+ });
244
+ };
245
+ const collectionWindow = new CollectionWindow({
246
+ accessor: currentDataClient.collection(currentResolvedPath),
247
+ query: {
248
+ where: whereFilter,
249
+ orderBy: orderByParam,
250
+ include: getRelationIncludeParams(currentCollection),
251
+ searchString: currentSearchString
252
+ },
253
+ pageSize: pageSizeRef.current,
254
+ target: itemCount,
255
+ fallbackToFind: true,
256
+ firstPaintTimeoutMs: LIVE_FIRST_PAINT_TIMEOUT_MS,
257
+ onChange: (state) => {
258
+ if (!isCurrent()) return;
259
+ if (state.rows) {
260
+ onUpdate(state.rows, state);
261
+ return;
262
+ }
263
+ if (state.error) {
264
+ console.error(`Error loading column ${column}:`, state.error);
265
+ setColumnData((prev) => ({
266
+ ...prev,
267
+ [column]: {
268
+ ...prev[column],
269
+ entities: prev[column]?.entities ?? [],
270
+ loading: false,
271
+ hasMore: false,
272
+ error: state.error
273
+ }
274
+ }));
275
+ }
276
+ }
277
+ });
278
+ windowsRef.current[column] = collectionWindow;
279
+ unsubscribersRef.current[column] = () => {
280
+ active = false;
281
+ collectionWindow.dispose();
282
+ if (windowsRef.current[column] === collectionWindow) delete windowsRef.current[column];
283
+ };
284
+ collectionWindow.start();
285
+ }, []);
286
+ useEffect(() => {
287
+ isCleaningUpRef.current = false;
288
+ const existingUnsubscribers = { ...unsubscribersRef.current };
289
+ unsubscribersRef.current = {};
290
+ Object.values(existingUnsubscribers).forEach((unsub) => {
291
+ try {
292
+ unsub?.();
293
+ } catch (e) {}
294
+ });
295
+ const currentDataClient = dataClientRef.current;
296
+ collectionRef.current;
297
+ const currentFilterValues = filterValuesRef.current;
298
+ const currentColumnProperty = columnPropertyRef.current;
299
+ const currentSearchString = searchStringRef.current;
300
+ const currentResolvedPath = resolvedPathRef.current;
301
+ const currentColumns = columns;
302
+ const currentColumnItemCounts = columnItemCounts;
303
+ let cancelled = false;
304
+ const timeoutId = setTimeout(() => {
305
+ if (isCleaningUpRef.current) return;
306
+ currentColumns.forEach((column) => {
307
+ const itemCount = currentColumnItemCounts[column] ?? pageSize;
308
+ subscribeToColumn(column, itemCount);
309
+ if (isColumnExcludedByFilter(column, currentFilterValues, currentColumnProperty)) return;
310
+ const accessor = currentDataClient.collection(currentResolvedPath);
311
+ if (accessor.count) {
312
+ const whereFilter = {
313
+ ...currentFilterValues ?? {},
314
+ [currentColumnProperty]: ["==", column]
315
+ };
316
+ accessor.count({
317
+ where: whereFilter,
318
+ searchString: currentSearchString
319
+ }).then((count) => {
320
+ if (cancelled || isCleaningUpRef.current) return;
321
+ setColumnData((prev) => ({
322
+ ...prev,
323
+ [column]: {
324
+ ...prev[column],
325
+ totalCount: count
326
+ }
327
+ }));
328
+ }).catch((e) => {
329
+ console.warn(`Failed to get count for column ${column}:`, e);
330
+ });
331
+ }
332
+ });
333
+ prevColumnItemCountsRef.current = { ...currentColumnItemCounts };
334
+ }, 0);
335
+ return () => {
336
+ cancelled = true;
337
+ clearTimeout(timeoutId);
338
+ isCleaningUpRef.current = true;
339
+ const unsubscribers = { ...unsubscribersRef.current };
340
+ unsubscribersRef.current = {};
341
+ Object.values(unsubscribers).forEach((unsub) => {
342
+ try {
343
+ unsub?.();
344
+ } catch (e) {}
345
+ });
346
+ };
347
+ }, [
348
+ subscriptionVersion,
349
+ subscribeToColumn,
350
+ pageSize
351
+ ]);
352
+ const lastProcessedVersionRef = useRef(subscriptionVersion);
353
+ useEffect(() => {
354
+ if (subscriptionVersion !== lastProcessedVersionRef.current) {
355
+ lastProcessedVersionRef.current = subscriptionVersion;
356
+ prevColumnItemCountsRef.current = { ...columnItemCounts };
357
+ return;
358
+ }
359
+ const prevCounts = prevColumnItemCountsRef.current;
360
+ columns.forEach((column) => {
361
+ const prevCount = prevCounts[column] ?? pageSize;
362
+ const newCount = columnItemCounts[column] ?? pageSize;
363
+ if (newCount > prevCount && !isCleaningUpRef.current) windowsRef.current[column]?.setTarget(newCount);
364
+ });
365
+ prevColumnItemCountsRef.current = { ...columnItemCounts };
366
+ }, [
367
+ columnItemCounts,
368
+ columns,
369
+ pageSize,
370
+ subscribeToColumn,
371
+ subscriptionVersion
372
+ ]);
373
+ const loadMoreColumn = useCallback((column) => {
374
+ setColumnItemCounts((prev) => ({
375
+ ...prev,
376
+ [column]: (prev[column] ?? pageSize) + pageSize
377
+ }));
378
+ }, [pageSize]);
379
+ /**
380
+ * Drop the optimistic overlay for the moves matching `predicate`.
381
+ *
382
+ * An entry is otherwise released only when the database "catches up" to
383
+ * it, which a refused write never does: the card would stay where it was
384
+ * dropped, on top of whatever the database re-delivers. A refresh is a
385
+ * request for what the database says, so it lets go of them.
386
+ */
387
+ const dropPendingMoves = useCallback((predicate) => {
388
+ const pendingMap = pendingItemsRef.current;
389
+ for (const [id, pending] of Object.entries(pendingMap)) if (predicate(pending.expectedValues)) delete pendingMap[id];
390
+ }, []);
391
+ const refreshColumn = useCallback((column) => {
392
+ dropPendingMoves((expected) => expected[columnPropertyRef.current] === column);
393
+ setColumnItemCounts((prev) => ({
394
+ ...prev,
395
+ [column]: pageSize
396
+ }));
397
+ prevColumnItemCountsRef.current = {
398
+ ...prevColumnItemCountsRef.current,
399
+ [column]: pageSize
400
+ };
401
+ const unsubscribe = unsubscribersRef.current[column];
402
+ delete unsubscribersRef.current[column];
403
+ try {
404
+ unsubscribe?.();
405
+ } catch (e) {}
406
+ setTimeout(() => {
407
+ if (!isCleaningUpRef.current) subscribeToColumn(column, pageSize);
408
+ }, 0);
409
+ }, [
410
+ pageSize,
411
+ subscribeToColumn,
412
+ dropPendingMoves
413
+ ]);
414
+ const refreshAll = useCallback(() => {
415
+ dropPendingMoves(() => true);
416
+ const reset = {};
417
+ columns.forEach((col) => {
418
+ reset[col] = pageSize;
419
+ });
420
+ setColumnItemCounts(reset);
421
+ setSubscriptionVersion((v) => v + 1);
422
+ }, [
423
+ columns,
424
+ pageSize,
425
+ dropPendingMoves
426
+ ]);
427
+ const moveItemOptimistically = useCallback((itemId, sourceColumn, targetColumn, newValues, newIndex) => {
428
+ setColumnData((prev) => {
429
+ const updated = { ...prev };
430
+ let itemToMove;
431
+ const sourceEntities = [...updated[sourceColumn]?.entities || []];
432
+ const itemIndex = sourceEntities.findIndex((e) => String(e.id) === itemId);
433
+ if (itemIndex !== -1) {
434
+ itemToMove = sourceEntities[itemIndex];
435
+ sourceEntities.splice(itemIndex, 1);
436
+ }
437
+ if (itemToMove) {
438
+ const newValuesMerged = {
439
+ ...itemToMove.values,
440
+ ...newValues || {}
441
+ };
442
+ const updatedEntity = {
443
+ ...itemToMove,
444
+ values: newValuesMerged
445
+ };
446
+ pendingItemsRef.current[String(updatedEntity.id)] = {
447
+ entity: updatedEntity,
448
+ expectedValues: newValuesMerged
449
+ };
450
+ const targetEntities = sourceColumn === targetColumn ? sourceEntities : [...updated[targetColumn]?.entities || []];
451
+ if (newIndex !== void 0 && newIndex >= 0 && newIndex <= targetEntities.length) targetEntities.splice(newIndex, 0, updatedEntity);
452
+ else {
453
+ targetEntities.push(updatedEntity);
454
+ if (orderPropertyRef.current) {
455
+ const orderProp = orderPropertyRef.current;
456
+ targetEntities.sort((a, b) => {
457
+ const valA = a.values?.[orderProp];
458
+ const valB = b.values?.[orderProp];
459
+ const isAEmpty = valA === void 0 || valA === null || valA === "";
460
+ const isBEmpty = valB === void 0 || valB === null || valB === "";
461
+ if (isAEmpty && isBEmpty) return 0;
462
+ if (isAEmpty) return 1;
463
+ if (isBEmpty) return -1;
464
+ return valA < valB ? -1 : valA > valB ? 1 : 0;
465
+ });
466
+ }
467
+ }
468
+ updated[sourceColumn] = {
469
+ ...updated[sourceColumn],
470
+ entities: sourceColumn === targetColumn ? targetEntities : sourceEntities,
471
+ totalCount: sourceColumn === targetColumn ? updated[sourceColumn].totalCount : Math.max(0, (updated[sourceColumn].totalCount ?? 0) - 1)
472
+ };
473
+ if (sourceColumn !== targetColumn) updated[targetColumn] = {
474
+ ...updated[targetColumn],
475
+ entities: targetEntities,
476
+ totalCount: (updated[targetColumn].totalCount ?? 0) + 1
477
+ };
478
+ } else if (sourceColumn !== targetColumn) {
479
+ if (updated[sourceColumn]?.totalCount !== void 0) updated[sourceColumn] = {
480
+ ...updated[sourceColumn],
481
+ totalCount: Math.max(0, (updated[sourceColumn].totalCount ?? 0) - 1)
482
+ };
483
+ if (updated[targetColumn]?.totalCount !== void 0) updated[targetColumn] = {
484
+ ...updated[targetColumn],
485
+ totalCount: (updated[targetColumn].totalCount ?? 0) + 1
486
+ };
487
+ }
488
+ return updated;
489
+ });
490
+ }, []);
491
+ const decrementColumnCounts = useCallback((columnDeltas) => {
492
+ setColumnData((prev) => {
493
+ const updated = { ...prev };
494
+ for (const [column, delta] of Object.entries(columnDeltas)) if (updated[column]?.totalCount !== void 0) updated[column] = {
495
+ ...updated[column],
496
+ totalCount: Math.max(0, (updated[column].totalCount ?? 0) - delta)
497
+ };
498
+ return updated;
499
+ });
500
+ }, []);
501
+ const loading = useMemo(() => {
502
+ return Object.values(columnData).some((col) => col.loading);
503
+ }, [columnData]);
504
+ const error = useMemo(() => {
505
+ return Object.values(columnData).map((col) => col.error).filter(Boolean)[0];
506
+ }, [columnData]);
507
+ return useMemo(() => ({
508
+ columnData,
509
+ loadMoreColumn,
510
+ refreshColumn,
511
+ refreshAll,
512
+ moveItemOptimistically,
513
+ decrementColumnCounts,
514
+ loading,
515
+ error
516
+ }), [
517
+ columnData,
518
+ loadMoreColumn,
519
+ refreshColumn,
520
+ refreshAll,
521
+ moveItemOptimistically,
522
+ decrementColumnCounts,
523
+ loading,
524
+ error
525
+ ]);
526
+ }
527
+ //#endregion
528
+ export { useBoardDataController };
529
+
530
+ //# sourceMappingURL=useBoardDataController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBoardDataController.js","names":[],"sources":["../../../src/components/CollectionViewBinding/useBoardDataController.tsx"],"sourcesContent":["\nimport { Entity, FilterValues } from \"@rebasepro/types\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { CollectionWindow, CollectionWindowState, getRelationIncludeParams, useData, useRebaseContext } from \"@rebasepro/app\";\nimport type { AdminCollection } from \"@rebasepro/cms-types\";\n\nconst DEFAULT_PAGE_SIZE = 20;\n\n/**\n * How long a column waits for its subscription's first payload before reading\n * once over HTTP instead. Long enough that a healthy socket always wins the\n * race, short enough that a dead one does not hold a blank board.\n */\nconst LIVE_FIRST_PAINT_TIMEOUT_MS = 2500;\n\n/**\n * Shallow equality for entity value records.\n * Handles primitives and reference equality for nested values.\n * Avoids JSON.stringify allocation on every comparison.\n */\nfunction shallowEqualValues(\n a: Record<string, unknown> | undefined,\n b: Record<string, unknown> | undefined\n): boolean {\n if (a === b) return true;\n if (!a || !b) return false;\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n if (keysA.length !== keysB.length) return false;\n for (const key of keysA) {\n if (a[key] !== b[key]) return false;\n }\n return true;\n}\n\n/**\n * Data state for a single board column\n */\nexport interface BoardColumnData<M extends Record<string, unknown> = Record<string, unknown>> {\n /** Entities loaded for this column */\n entities: Entity<M>[];\n /** Whether the column is currently loading data */\n loading: boolean;\n /** Whether there are more items to load */\n hasMore: boolean;\n /** Error if loading failed */\n error?: Error;\n /** Total count of entities in this column */\n totalCount?: number;\n}\n\n/**\n * Controller for managing per-column data in a Kanban board\n */\nexport interface BoardDataController<M extends Record<string, unknown> = any, COLUMN extends string = string> {\n /** Data state for each column */\n columnData: Record<COLUMN, BoardColumnData<M>>;\n /** Load more items for a specific column */\n loadMoreColumn: (column: COLUMN) => void;\n /** Refresh data for a specific column */\n refreshColumn: (column: COLUMN) => void;\n /** Refresh all columns */\n refreshAll: () => void;\n /** Update column counts and optionally move item optimistically */\n moveItemOptimistically: (itemId: string, sourceColumn: COLUMN, targetColumn: COLUMN, newValues?: Record<string, any>, newIndex?: number) => void;\n /** Decrement column counts (for optimistic updates when deleting items) */\n decrementColumnCounts: (columnDeltas: Record<COLUMN, number>) => void;\n /** Whether any column is loading */\n loading: boolean;\n /** Any error from any column */\n error?: Error;\n}\n\nexport interface UseBoardDataControllerProps<M extends Record<string, unknown> = Record<string, unknown>> {\n /** Full path to the collection */\n fullPath: string;\n /** The entity collection configuration */\n collection: AdminCollection<M>;\n /** Property key used for column assignment */\n columnProperty: string;\n /** Array of column values (enum values from columnProperty) */\n columns: string[];\n /** Property key used for ordering within columns */\n orderProperty?: string;\n /** Number of items to load per page per column */\n pageSize?: number;\n /** Text search string to filter entities */\n searchString?: string;\n /** Additional filter values */\n filterValues?: FilterValues<string>;\n}\n\n/**\n * Hook that manages per-column data loading for the Kanban board.\n * Each column gets its own independent query to the data source.\n */\nexport function useBoardDataController<M extends Record<string, unknown> = any, COLUMN extends string = string>({\n fullPath,\n collection,\n columnProperty,\n columns,\n orderProperty,\n pageSize = DEFAULT_PAGE_SIZE,\n searchString,\n filterValues\n}: UseBoardDataControllerProps<M>): BoardDataController<M, COLUMN> {\n\n const context = useRebaseContext();\n const dataClient = useData();\n // v4: use fullPath directly instead of resolveIdsFrom\n const resolvedPath = fullPath;\n\n // Stable refs for objects that shouldn't trigger re-subscriptions\n const dataClientRef = useRef(dataClient);\n const collectionRef = useRef(collection);\n const contextRef = useRef(context);\n dataClientRef.current = dataClient;\n collectionRef.current = collection;\n contextRef.current = context;\n\n // Store filter/order params in refs so they're accessible without causing re-subscriptions\n const filterValuesRef = useRef(filterValues);\n const columnPropertyRef = useRef(columnProperty);\n const orderPropertyRef = useRef(orderProperty);\n const searchStringRef = useRef(searchString);\n const resolvedPathRef = useRef(resolvedPath);\n const pageSizeRef = useRef(pageSize);\n pageSizeRef.current = pageSize;\n filterValuesRef.current = filterValues;\n columnPropertyRef.current = columnProperty;\n orderPropertyRef.current = orderProperty;\n searchStringRef.current = searchString;\n resolvedPathRef.current = resolvedPath;\n\n // Track item count per column for pagination\n const [columnItemCounts, setColumnItemCounts] = useState<Record<string, number>>(() => {\n const initial: Record<string, number> = {};\n columns.forEach(col => {\n initial[col] = pageSize;\n });\n return initial;\n });\n\n // Per-column data state\n const [columnData, setColumnData] = useState<Record<string, BoardColumnData<M>>>(() => {\n const initial: Record<string, BoardColumnData<M>> = {};\n columns.forEach(col => {\n initial[col] = {\n entities: [],\n loading: true,\n hasMore: true,\n error: undefined,\n totalCount: undefined\n };\n });\n return initial;\n });\n\n // Track cleanup functions for subscriptions\n const unsubscribersRef = useRef<Record<string, () => void>>({});\n\n // Each column's rows, read a page at a time — see `CollectionWindow`.\n const windowsRef = useRef<Record<string, CollectionWindow<Record<string, unknown>>>>({});\n\n // Flag to prevent race conditions during cleanup\n const isCleaningUpRef = useRef(false);\n\n // Track items that are currently in an optimistic state (awaiting DB sync)\n const pendingItemsRef = useRef<Record<string, { entity: Entity<M>, expectedValues: Record<string, any> }>>({});\n\n // Stable keys for dependency comparison\n const columnsKey = useMemo(() => [...columns].sort().join(\",\"), [columns]);\n const filterKey = useMemo(() => JSON.stringify(filterValues), [filterValues]);\n\n // Track previous column item counts to detect which column changed\n const prevColumnItemCountsRef = useRef<Record<string, number>>(columnItemCounts);\n\n // Version counter to trigger full re-subscription when params change (not just load-more)\n const [subscriptionVersion, setSubscriptionVersion] = useState(0);\n\n // Trigger full re-subscription when key params change\n useEffect(() => {\n setSubscriptionVersion(v => v + 1);\n }, [columnsKey, resolvedPath, columnProperty, orderProperty, searchString, filterKey, pageSize]);\n\n // Cleanup subscriptions on unmount\n useEffect(() => {\n return () => {\n isCleaningUpRef.current = true;\n Object.values(unsubscribersRef.current).forEach(unsub => unsub?.());\n unsubscribersRef.current = {};\n };\n }, []);\n\n /**\n * Check if a column value is excluded by the active filter on the columnProperty.\n * E.g. if the user sets \"Status IN (Open, In Progress)\", this returns true\n * for \"Waiting on Customer\" since that column should show as empty.\n */\n const isColumnExcludedByFilter = useCallback((column: string, filterValues?: FilterValues<string>, colProperty?: string): boolean => {\n if (!filterValues || !colProperty) return false;\n const filterForColumn = filterValues[colProperty as keyof typeof filterValues];\n if (!filterForColumn || !Array.isArray(filterForColumn)) return false;\n\n const [op, val] = filterForColumn as [string, unknown];\n\n if (op === \"==\" && typeof val === \"string\") {\n return column !== val;\n }\n if (op === \"!=\" && typeof val === \"string\") {\n return column === val;\n }\n if (op === \"in\" && Array.isArray(val)) {\n return !val.map(String).includes(column);\n }\n if (op === \"not-in\" && Array.isArray(val)) {\n return val.map(String).includes(column);\n }\n\n return false;\n }, []);\n\n // Helper function to subscribe to a single column - uses refs to avoid dependency issues\n const subscribeToColumn = useCallback((column: string, itemCount: number) => {\n // Skip if we're in the middle of cleanup\n if (isCleaningUpRef.current) return;\n\n const currentDataClient = dataClientRef.current;\n const currentCollection = collectionRef.current;\n const currentContext = contextRef.current;\n const currentFilterValues = filterValuesRef.current;\n const currentColumnProperty = columnPropertyRef.current;\n const currentOrderProperty = orderPropertyRef.current;\n const currentSearchString = searchStringRef.current;\n const currentResolvedPath = resolvedPathRef.current;\n\n // If the column is excluded by the active filter on the column property,\n // set it as empty immediately without querying.\n const excluded = isColumnExcludedByFilter(column, currentFilterValues, currentColumnProperty);\n if (excluded) {\n setColumnData(prev => ({\n ...prev,\n [column]: {\n entities: [],\n loading: false,\n hasMore: false,\n error: undefined,\n totalCount: 0\n }\n }));\n return;\n }\n\n // Build filter map for this column — pass FilterValues directly\n const whereFilter: FilterValues<string> = {\n ...(currentFilterValues ?? {}),\n [currentColumnProperty]: [\"==\", column]\n };\n\n const orderByParam: [string, \"asc\" | \"desc\"] | undefined = currentOrderProperty ? [currentOrderProperty, \"asc\"] : undefined;\n\n // Whether this subscription is still the column's current one. Every\n // answer — live, fallback or one-shot — checks it before it paints:\n // a read issued for the previous search, or for the page size before a\n // load-more, can resolve after the one that replaced it, and it would\n // otherwise overwrite the newer rows. `isCleaningUpRef` cannot say\n // this: it is one flag for the whole board, and the next subscription\n // sets it straight back to false.\n let active = true;\n const isCurrent = () => active && !isCleaningUpRef.current;\n // `afterRead` below is awaited, so two answers can finish out of\n // order; only the latest one paints.\n let updateSequence = 0;\n\n // Mark column as loading\n setColumnData(prev => ({\n ...prev,\n [column]: {\n ...prev[column],\n loading: true,\n error: undefined\n }\n }));\n\n // onUpdate callback\n const onUpdate = async (entities: Entity<M>[], state: Omit<CollectionWindowState, \"rows\">) => {\n if (!isCurrent()) return;\n const sequence = ++updateSequence;\n\n const pendingMap = pendingItemsRef.current;\n\n // Apply pending updates to incoming entities\n const mergedEntities = entities.map(e => {\n const pending = pendingMap[String(e.id)];\n if (pending) {\n // Check if DB entity has caught up to the expected column and order\n const expectedCol = pending.expectedValues[currentColumnProperty];\n const expectedOrder = currentOrderProperty ? pending.expectedValues[currentOrderProperty] : undefined;\n\n let caughtUp = true;\n if (e.values?.[currentColumnProperty] !== expectedCol) {\n caughtUp = false;\n }\n if (currentOrderProperty && e.values?.[currentOrderProperty] !== expectedOrder) {\n caughtUp = false;\n }\n\n if (caughtUp) {\n // DB has caught up, clear pending state\n delete pendingMap[String(e.id)];\n return e; // Use the real DB entity\n }\n\n // DB hasn't caught up, overlay expected values\n return { ...e,\nvalues: { ...e.values,\n...pending.expectedValues } };\n }\n return e;\n });\n\n // Add any pending items that belong to this column but aren't in the incoming entities yet\n // (e.g. backend hasn't moved them to this column yet)\n Object.values(pendingMap).forEach(pending => {\n if (pending.expectedValues[currentColumnProperty] === column) {\n if (!mergedEntities.some(e => String(e.id) === String(pending.entity.id))) {\n mergedEntities.push(pending.entity);\n }\n }\n });\n\n // Always filter in memory to only show entities that belong to this specific column.\n // This is required because text search returns all matches, and the overlay above\n // moves a card dragged out of this column to its new one before the server has.\n let processed = mergedEntities.filter(e => e.values?.[currentColumnProperty] === column);\n\n // Sort locally if orderProperty is defined: pending cards are appended above, and\n // the overlay can change a card's order key, so the order the rows arrived in is\n // not the order to show.\n if (currentOrderProperty) {\n processed = [...processed].sort((a, b) => {\n const valA = a.values?.[currentOrderProperty] as string | undefined | null;\n const valB = b.values?.[currentOrderProperty] as string | undefined | null;\n\n const isAEmpty = valA === undefined || valA === null || valA === \"\";\n const isBEmpty = valB === undefined || valB === null || valB === \"\";\n\n if (isAEmpty && isBEmpty) return 0;\n if (isAEmpty) return 1;\n if (isBEmpty) return -1;\n\n return valA < valB ? -1 : valA > valB ? 1 : 0;\n });\n }\n\n // Apply the panel's own afterRead callbacks if any — `browserCallbacks`,\n // not `callbacks`: the latter already ran on the server before these\n // rows arrived, and running it again here applied it twice.\n // afterRead operates on flat rows; unwrap the Entity view-model\n // before invoking and re-wrap the processed row after.\n if (currentCollection.browserCallbacks?.afterRead) {\n try {\n processed = await Promise.all(\n processed.map(async (entity) => {\n const processedRow = await currentCollection.browserCallbacks!.afterRead!({\n collection: currentCollection,\n path: currentResolvedPath,\n row: { id: entity.id, ...entity.values },\n context: currentContext\n });\n return {\n ...entity,\n values: processedRow as M\n };\n })\n );\n } catch (e) {\n console.error(\"Error in afterRead callback:\", e);\n }\n }\n\n // `afterRead` above is awaited; the subscription may have been\n // replaced in the meantime.\n if (!isCurrent() || sequence !== updateSequence) return;\n\n // More exists until a page comes back short — never \"the rows\n // asked for did not all fit under the read ceiling\". A column\n // whose next page failed stops asking, rather than retrying on\n // every scroll.\n const newHasMore = !state.complete && !state.error;\n\n // Compare with current state — skip update if identical to avoid UI flash\n setColumnData(prev => {\n const existing = prev[column];\n if (existing && !existing.loading && existing.entities.length === processed.length) {\n // Quick structural equality check: same IDs in same order with same values\n let identical = true;\n for (let i = 0; i < processed.length; i++) {\n const a = existing.entities[i];\n const b = processed[i];\n if (a.id !== b.id) {\n identical = false;\n break;\n }\n // Shallow-compare values to avoid JSON.stringify allocations\n // entity.values are flat records from the DB, so shallow suffices\n if (!shallowEqualValues(a.values, b.values)) {\n identical = false;\n break;\n }\n }\n if (identical && existing.hasMore === newHasMore && !state.loading && existing.error === state.error) {\n // Data is the same — return previous reference to prevent re-render\n return prev;\n }\n }\n\n return {\n ...prev,\n [column]: {\n entities: processed,\n loading: state.loading,\n hasMore: newHasMore,\n error: state.error,\n totalCount: prev[column]?.totalCount // Keep existing count\n }\n };\n });\n };\n\n const accessor = currentDataClient.collection(currentResolvedPath);\n\n // Eagerly include relations to avoid N+1 fetches.\n const includeParams = getRelationIncludeParams(currentCollection);\n\n // The column's first page is live; every later page is read by\n // offset, only past the rows already held, and never above the API's\n // read ceiling. The column used to grow one read instead and clamp it\n // at that ceiling, so it said it was finished at 1,000 cards while its\n // own header counted thousands more.\n const collectionWindow = new CollectionWindow({\n accessor,\n query: {\n where: whereFilter,\n orderBy: orderByParam,\n include: includeParams,\n // Read into a local at the top of this function and then used\n // nowhere, in both places it was read. The board took a search\n // term, re-subscribed every column when it changed, and\n // returned the same rows.\n searchString: currentSearchString\n },\n pageSize: pageSizeRef.current,\n target: itemCount,\n // A live subscription that fails is not the same thing as a column\n // with nothing in it, but that is exactly what this used to render:\n // entities cleared, no error surfaced, and a column reading \"No\n // items\" above a header still counting eleven of them. Read once\n // over HTTP instead — the board loses its live updates, not its\n // contents — and only report the failure if that fails too.\n fallbackToFind: true,\n // A subscription that is never going to answer takes the client's\n // full 30s watchdog to say so, and the board spins the whole time.\n // If the socket has not delivered shortly after mount, read once\n // over HTTP and paint that; the live data still wins whenever it\n // arrives. Costs nothing when realtime is healthy.\n firstPaintTimeoutMs: LIVE_FIRST_PAINT_TIMEOUT_MS,\n onChange: (state) => {\n if (!isCurrent()) return;\n if (state.rows) {\n void onUpdate(state.rows as Entity<M>[], state);\n return;\n }\n if (state.error) {\n console.error(`Error loading column ${column}:`, state.error);\n setColumnData(prev => ({\n ...prev,\n [column]: {\n ...prev[column],\n entities: prev[column]?.entities ?? [],\n loading: false,\n hasMore: false,\n error: state.error\n }\n }));\n }\n }\n });\n windowsRef.current[column] = collectionWindow;\n unsubscribersRef.current[column] = () => {\n active = false;\n collectionWindow.dispose();\n if (windowsRef.current[column] === collectionWindow) delete windowsRef.current[column];\n };\n collectionWindow.start();\n }, []); // No dependencies - uses refs for all values\n\n // Main effect for all column subscriptions - runs when subscriptionVersion changes (i.e., key params change)\n useEffect(() => {\n // Mark that we're setting up new subscriptions\n isCleaningUpRef.current = false;\n\n // Clean up all existing subscriptions synchronously\n const existingUnsubscribers = { ...unsubscribersRef.current };\n unsubscribersRef.current = {};\n Object.values(existingUnsubscribers).forEach(unsub => {\n try {\n unsub?.();\n } catch (e) {\n // Ignore cleanup errors\n }\n });\n\n const currentDataClient = dataClientRef.current;\n const currentCollection = collectionRef.current;\n const currentFilterValues = filterValuesRef.current;\n const currentColumnProperty = columnPropertyRef.current;\n const currentSearchString = searchStringRef.current;\n const currentResolvedPath = resolvedPathRef.current;\n const currentColumns = columns;\n const currentColumnItemCounts = columnItemCounts;\n\n // Set by this run's cleanup, so a count issued for the previous search\n // or filter cannot land after the one that replaced it.\n let cancelled = false;\n\n // Small delay to ensure Firestore has cleaned up previous listeners\n const timeoutId = setTimeout(() => {\n if (isCleaningUpRef.current) return;\n\n currentColumns.forEach(column => {\n const itemCount = currentColumnItemCounts[column] ?? pageSize;\n subscribeToColumn(column, itemCount);\n\n // Skip count query for columns excluded by the filter — subscribeToColumn\n // already set them to totalCount: 0.\n if (isColumnExcludedByFilter(column, currentFilterValues, currentColumnProperty)) {\n return;\n }\n\n // Count query for column (for display in column header)\n const accessor = currentDataClient.collection(currentResolvedPath);\n if (accessor.count) {\n\n const whereFilter: FilterValues<string> = {\n ...(currentFilterValues ?? {}),\n [currentColumnProperty]: [\"==\", column]\n };\n\n accessor.count({\n where: whereFilter,\n // Or the column header counts the unsearched collection\n // while the column beneath it shows searched rows.\n searchString: currentSearchString\n }).then(count => {\n if (cancelled || isCleaningUpRef.current) return;\n setColumnData(prev => ({\n ...prev,\n [column]: {\n ...prev[column],\n totalCount: count\n }\n }));\n }).catch(e => {\n console.warn(`Failed to get count for column ${column}:`, e);\n });\n }\n });\n\n // Update the ref after subscribing all\n prevColumnItemCountsRef.current = { ...currentColumnItemCounts };\n }, 0);\n\n return () => {\n cancelled = true;\n clearTimeout(timeoutId);\n isCleaningUpRef.current = true;\n const unsubscribers = { ...unsubscribersRef.current };\n unsubscribersRef.current = {};\n Object.values(unsubscribers).forEach(unsub => {\n try {\n unsub?.();\n } catch (e) {\n // Ignore cleanup errors\n }\n });\n };\n\n }, [subscriptionVersion, subscribeToColumn, pageSize]);\n\n // Track which subscription version last updated the counts\n const lastProcessedVersionRef = useRef(subscriptionVersion);\n\n // Separate effect to handle individual column load-more WITHOUT triggering full re-subscription\n useEffect(() => {\n // If subscriptionVersion changed, the main effect will handle everything\n // Skip this effect to avoid race conditions\n if (subscriptionVersion !== lastProcessedVersionRef.current) {\n lastProcessedVersionRef.current = subscriptionVersion;\n prevColumnItemCountsRef.current = { ...columnItemCounts };\n return;\n }\n\n const prevCounts = prevColumnItemCountsRef.current;\n\n columns.forEach(column => {\n const prevCount = prevCounts[column] ?? pageSize;\n const newCount = columnItemCounts[column] ?? pageSize;\n\n // Only this column asked for more: its window reads the next page,\n // and nothing it already holds is read again.\n if (newCount > prevCount && !isCleaningUpRef.current) {\n windowsRef.current[column]?.setTarget(newCount);\n }\n });\n\n // Update the ref\n prevColumnItemCountsRef.current = { ...columnItemCounts };\n }, [columnItemCounts, columns, pageSize, subscribeToColumn, subscriptionVersion]);\n\n const loadMoreColumn = useCallback((column: COLUMN) => {\n setColumnItemCounts(prev => ({\n ...prev,\n [column]: (prev[column] ?? pageSize) + pageSize\n }));\n }, [pageSize]);\n\n /**\n * Drop the optimistic overlay for the moves matching `predicate`.\n *\n * An entry is otherwise released only when the database \"catches up\" to\n * it, which a refused write never does: the card would stay where it was\n * dropped, on top of whatever the database re-delivers. A refresh is a\n * request for what the database says, so it lets go of them.\n */\n const dropPendingMoves = useCallback((predicate: (expectedValues: Record<string, any>) => boolean) => {\n const pendingMap = pendingItemsRef.current;\n for (const [id, pending] of Object.entries(pendingMap)) {\n if (predicate(pending.expectedValues)) delete pendingMap[id];\n }\n }, []);\n\n const refreshColumn = useCallback((column: COLUMN) => {\n dropPendingMoves(expected => expected[columnPropertyRef.current] === column);\n // Back to one page, and re-subscribed here: the load-more effect only\n // re-subscribes a column whose count went *up*, so resetting the count\n // alone reached nothing.\n setColumnItemCounts(prev => ({\n ...prev,\n [column]: pageSize\n }));\n prevColumnItemCountsRef.current = { ...prevColumnItemCountsRef.current, [column]: pageSize };\n const unsubscribe = unsubscribersRef.current[column];\n delete unsubscribersRef.current[column];\n try {\n unsubscribe?.();\n } catch (e) {\n // Ignore cleanup errors\n }\n setTimeout(() => {\n if (!isCleaningUpRef.current) {\n subscribeToColumn(column, pageSize);\n }\n }, 0);\n }, [pageSize, subscribeToColumn, dropPendingMoves]);\n\n const refreshAll = useCallback(() => {\n dropPendingMoves(() => true);\n const reset: Record<string, number> = {};\n columns.forEach(col => {\n reset[col] = pageSize;\n });\n setColumnItemCounts(reset);\n // A new subscription version re-subscribes and re-counts every column.\n setSubscriptionVersion(v => v + 1);\n }, [columns, pageSize, dropPendingMoves]);\n\n // Optimistic update for when moving an item\n const moveItemOptimistically = useCallback((itemId: string, sourceColumn: COLUMN, targetColumn: COLUMN, newValues?: Record<string, any>, newIndex?: number) => {\n setColumnData(prev => {\n const updated = { ...prev };\n let itemToMove: Entity<M> | undefined;\n\n const sourceEntities = [...(updated[sourceColumn]?.entities || [])];\n const itemIndex = sourceEntities.findIndex(e => String(e.id) === itemId);\n\n if (itemIndex !== -1) {\n itemToMove = sourceEntities[itemIndex];\n sourceEntities.splice(itemIndex, 1);\n }\n\n if (itemToMove) {\n const newValuesMerged = {\n ...itemToMove.values,\n ...(newValues || {})\n };\n\n const updatedEntity = {\n ...itemToMove,\n values: newValuesMerged\n };\n\n // Store in pending items ref\n pendingItemsRef.current[String(updatedEntity.id)] = {\n entity: updatedEntity,\n expectedValues: newValuesMerged\n };\n\n const targetEntities = sourceColumn === targetColumn ? sourceEntities : [...(updated[targetColumn]?.entities || [])];\n\n if (newIndex !== undefined && newIndex >= 0 && newIndex <= targetEntities.length) {\n targetEntities.splice(newIndex, 0, updatedEntity);\n } else {\n targetEntities.push(updatedEntity);\n if (orderPropertyRef.current) {\n const orderProp = orderPropertyRef.current;\n targetEntities.sort((a, b) => {\n const valA = a.values?.[orderProp] as string | undefined | null;\n const valB = b.values?.[orderProp] as string | undefined | null;\n\n // Handle nulls/empty strings to match Postgres NULLS LAST (ASC) behavior\n const isAEmpty = valA === undefined || valA === null || valA === \"\";\n const isBEmpty = valB === undefined || valB === null || valB === \"\";\n\n if (isAEmpty && isBEmpty) return 0;\n if (isAEmpty) return 1; // A is null, B is not -> A goes after B\n if (isBEmpty) return -1; // B is null, A is not -> A goes before B\n\n return valA < valB ? -1 : valA > valB ? 1 : 0;\n });\n }\n }\n\n updated[sourceColumn] = {\n ...updated[sourceColumn],\n entities: sourceColumn === targetColumn ? targetEntities : sourceEntities,\n totalCount: sourceColumn === targetColumn\n ? updated[sourceColumn].totalCount\n : Math.max(0, (updated[sourceColumn].totalCount ?? 0) - 1)\n };\n\n if (sourceColumn !== targetColumn) {\n updated[targetColumn] = {\n ...updated[targetColumn],\n entities: targetEntities,\n totalCount: (updated[targetColumn].totalCount ?? 0) + 1\n };\n }\n\n } else if (sourceColumn !== targetColumn) {\n // If item not found locally but counts need update\n if (updated[sourceColumn]?.totalCount !== undefined) {\n updated[sourceColumn] = {\n ...updated[sourceColumn],\n totalCount: Math.max(0, (updated[sourceColumn].totalCount ?? 0) - 1)\n };\n }\n if (updated[targetColumn]?.totalCount !== undefined) {\n updated[targetColumn] = {\n ...updated[targetColumn],\n totalCount: (updated[targetColumn].totalCount ?? 0) + 1\n };\n }\n }\n\n return updated;\n });\n }, []);\n\n // Optimistic update for column counts when deleting items\n const decrementColumnCounts = useCallback((columnDeltas: Record<COLUMN, number>) => {\n setColumnData(prev => {\n const updated = { ...prev };\n\n for (const [column, delta] of Object.entries(columnDeltas) as [COLUMN, number][]) {\n if (updated[column]?.totalCount !== undefined) {\n updated[column] = {\n ...updated[column],\n totalCount: Math.max(0, (updated[column].totalCount ?? 0) - delta)\n };\n }\n }\n\n return updated;\n });\n }, []);\n\n // Aggregate loading and error state\n const loading = useMemo(() => {\n return Object.values(columnData).some((col) => col.loading);\n }, [columnData]);\n\n const error = useMemo(() => {\n const errors = Object.values(columnData)\n .map((col) => col.error)\n .filter(Boolean);\n return errors[0];\n }, [columnData]);\n\n return useMemo(() => ({\n columnData: columnData as Record<COLUMN, BoardColumnData<M>>,\n loadMoreColumn,\n refreshColumn,\n refreshAll,\n moveItemOptimistically,\n decrementColumnCounts,\n loading,\n error\n }), [\n columnData,\n loadMoreColumn,\n refreshColumn,\n refreshAll,\n moveItemOptimistically,\n decrementColumnCounts,\n loading,\n error\n ]);\n}\n"],"mappings":";;;AAMA,IAAM,sBAAoB;;;;;;AAO1B,IAAM,8BAA8B;;;;;;AAOpC,SAAS,mBACL,GACA,GACO;CACP,IAAI,MAAM,GAAG,OAAO;CACpB,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO;CACrB,MAAM,QAAQ,OAAO,KAAK,CAAC;CAC3B,MAAM,QAAQ,OAAO,KAAK,CAAC;CAC3B,IAAI,MAAM,WAAW,MAAM,QAAQ,OAAO;CAC1C,KAAK,MAAM,OAAO,OACd,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO;CAElC,OAAO;AACX;;;;;AA+DA,SAAgB,uBAAgG,EAC5G,UACA,YACA,gBACA,SACA,eACA,WAAW,qBACX,cACA,gBAC+D;CAE/D,MAAM,UAAU,iBAAiB;CACjC,MAAM,aAAa,QAAQ;CAE3B,MAAM,eAAe;CAGrB,MAAM,gBAAgB,OAAO,UAAU;CACvC,MAAM,gBAAgB,OAAO,UAAU;CACvC,MAAM,aAAa,OAAO,OAAO;CACjC,cAAc,UAAU;CACxB,cAAc,UAAU;CACxB,WAAW,UAAU;CAGrB,MAAM,kBAAkB,OAAO,YAAY;CAC3C,MAAM,oBAAoB,OAAO,cAAc;CAC/C,MAAM,mBAAmB,OAAO,aAAa;CAC7C,MAAM,kBAAkB,OAAO,YAAY;CAC3C,MAAM,kBAAkB,OAAO,YAAY;CAC3C,MAAM,cAAc,OAAO,QAAQ;CACnC,YAAY,UAAU;CACtB,gBAAgB,UAAU;CAC1B,kBAAkB,UAAU;CAC5B,iBAAiB,UAAU;CAC3B,gBAAgB,UAAU;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;EACA;EACA;EACA;EACA;EACA;EACA;CACJ,IAAI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACJ,CAAC;AACL"}
@@ -1,6 +1,7 @@
1
1
  import type { Property, RelationProperty } from "@rebasepro/types";
2
2
  import type { Entity } from "@rebasepro/types";
3
3
  import type { PropertyConfig, AdminCollection, EntityDisplayRole } from "@rebasepro/cms-types";
4
+ import { type FormatCollectionDateOptions } from "../../util/format_collection_date.js";
4
5
  import type { AuthController } from "@rebasepro/cms-types";
5
6
  import { ChipColorScheme } from "@rebasepro/ui";
6
7
  /**
@@ -132,7 +133,9 @@ export declare function useCollectionSlotKeys(collection: AdminCollection<Record
132
133
  * This is a pure function (no hooks) so it can be called inside
133
134
  * `React.memo` render functions or loops without violating hook rules.
134
135
  */
135
- export declare function resolveEntitySlots(entity: Entity<Record<string, unknown>>, collection: AdminCollection<Record<string, unknown>>, slotKeys: CollectionSlotKeys): EntityPreviewSlots;
136
+ export declare function resolveEntitySlots(entity: Entity<Record<string, unknown>>, collection: AdminCollection<Record<string, unknown>>, slotKeys: CollectionSlotKeys,
137
+ /** How the date slot is written: the relative phrases' language, say. */
138
+ dateOptions?: FormatCollectionDateOptions): EntityPreviewSlots;
136
139
  /**
137
140
  * The slots for one record, with `admin.display` resolvers applied.
138
141
  *