@protobase/ui 0.123.0 → 0.123.1

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 (262) hide show
  1. package/dist/account/messages.d.ts +2 -2
  2. package/dist/activity-chart/messages.d.ts +2 -2
  3. package/dist/app/charts/messages.d.ts +2 -2
  4. package/dist/app/confirm-sign-in-messages.d.ts +2 -2
  5. package/dist/app/conversation-page/conversation-page.d.ts +5 -4
  6. package/dist/app/conversation-page/conversation-page.js +14 -11
  7. package/dist/app/conversation-page/messages.d.ts +2 -2
  8. package/dist/app/conversation-page/thread-panel.d.ts +6 -2
  9. package/dist/app/conversation-page/thread-panel.js +12 -6
  10. package/dist/app/conversation-page/use-conversation-typing.d.ts +8 -0
  11. package/dist/app/conversation-page/use-conversation-typing.js +20 -0
  12. package/dist/app/create/messages.d.ts +2 -2
  13. package/dist/app/delete/messages.d.ts +2 -2
  14. package/dist/app/displays/messages.d.ts +2 -2
  15. package/dist/app/embedded-list/messages.d.ts +2 -2
  16. package/dist/app/export/messages.d.ts +2 -2
  17. package/dist/app/field-messages.d.ts +2 -2
  18. package/dist/app/field-types/custom-step-container/messages.d.ts +2 -2
  19. package/dist/app/field-types/runner-install/messages.d.ts +2 -2
  20. package/dist/app/field-types/workflow/definition.d.ts +1 -1
  21. package/dist/app/field-types/workflow/messages.d.ts +2 -2
  22. package/dist/app/field-types/workflow/pins/pin-text.d.ts +1 -1
  23. package/dist/app/field-types/workflow-page/messages.d.ts +2 -2
  24. package/dist/app/field-types/workflow-run/messages.d.ts +2 -2
  25. package/dist/app/field-types/workflow-status/messages.d.ts +2 -2
  26. package/dist/app/file-viewers/messages.d.ts +2 -2
  27. package/dist/app/focus/messages.d.ts +2 -2
  28. package/dist/app/gallery/gallery-layout.d.ts +2 -2
  29. package/dist/app/gallery/messages.d.ts +2 -2
  30. package/dist/app/hand-order/messages.d.ts +2 -2
  31. package/dist/app/history/messages.d.ts +2 -2
  32. package/dist/app/import/messages.d.ts +2 -2
  33. package/dist/app/list-edit/messages.d.ts +2 -2
  34. package/dist/app/list-messages.d.ts +2 -2
  35. package/dist/app/messages.d.ts +2 -2
  36. package/dist/app/new-version/messages.d.ts +2 -2
  37. package/dist/app/pages/messages.d.ts +2 -2
  38. package/dist/app/record-chart/messages.d.ts +2 -2
  39. package/dist/app/record-messages.d.ts +2 -2
  40. package/dist/app/record-mode/shown-layout.d.ts +1 -1
  41. package/dist/app/record-row/messages.d.ts +2 -2
  42. package/dist/app/related-cards/messages.d.ts +2 -2
  43. package/dist/app/runtime/messages.d.ts +2 -2
  44. package/dist/app/saved/messages.d.ts +2 -2
  45. package/dist/app/search/messages.d.ts +2 -2
  46. package/dist/app/searches/messages.d.ts +2 -2
  47. package/dist/app-shell/messages.d.ts +2 -2
  48. package/dist/assistant-dock/messages.d.ts +2 -2
  49. package/dist/auth/messages.d.ts +2 -2
  50. package/dist/calls/messages.d.ts +2 -2
  51. package/dist/data-grid/column-spec.d.ts +1 -1
  52. package/dist/data-grid/messages.d.ts +2 -2
  53. package/dist/filter-panel/messages.d.ts +2 -2
  54. package/dist/inline-child-table/messages.d.ts +2 -2
  55. package/dist/invitations/messages.d.ts +2 -2
  56. package/dist/mailbox/messages.d.ts +2 -2
  57. package/dist/mentions/messages.d.ts +2 -2
  58. package/dist/mocks/customers.d.ts +1 -1
  59. package/dist/mocks/invoices.d.ts +2 -2
  60. package/dist/mocks/orders.d.ts +2 -2
  61. package/dist/notifications/bell/messages.d.ts +2 -2
  62. package/dist/organizations/messages.d.ts +2 -2
  63. package/dist/package.js +1 -1
  64. package/dist/primitives/messages.d.ts +2 -2
  65. package/dist/record-view/messages.d.ts +2 -2
  66. package/dist/record-view/use-autosave.d.ts +1 -1
  67. package/dist/relay/relay-context.js +1 -1
  68. package/dist/relay/relay-store.d.ts +1 -1
  69. package/dist/relay/relay-store.js +11 -18
  70. package/dist/relay/typing-line.d.ts +1 -6
  71. package/dist/relay/typing-line.js +4 -26
  72. package/dist/relay/use-relay-typing.d.ts +8 -0
  73. package/dist/relay/use-relay-typing.js +38 -0
  74. package/dist/relay/use-typing-sender.d.ts +5 -2
  75. package/dist/relay/use-typing-sender.js +5 -27
  76. package/dist/shell/assets/{account-page-D15oXHUN.js → account-page-DS2lZVD1.js} +2 -2
  77. package/dist/shell/assets/{app-CG26wvV-.js → app-1IZYQXW2.js} +13 -13
  78. package/dist/shell/assets/{assistant-shell-vuaTWe1u.js → assistant-shell-BIpWuqnT.js} +2 -2
  79. package/dist/shell/assets/board-display-Buo0YyZ5.js +2 -0
  80. package/dist/shell/assets/calendar-display-10AgoW3N.js +2 -0
  81. package/dist/shell/assets/{call-rings-CN1O37Vm.js → call-rings-BUUwC1QU.js} +2 -2
  82. package/dist/shell/assets/{calls-BgpYzNDg.js → calls-eQ3_Fp6k.js} +2 -2
  83. package/dist/shell/assets/{circle-alert-CYtCwklT.js → circle-alert-D7B_KeB7.js} +2 -2
  84. package/dist/shell/assets/{composed-page-CfvP7zgM.js → composed-page-Btkd6u0m.js} +2 -2
  85. package/dist/shell/assets/{composer-section-D8Iupdnl.js → composer-section-DUmPQLgo.js} +2 -2
  86. package/dist/shell/assets/{connect-route-2GF04qVw.js → connect-route-DQIlzdmb.js} +2 -2
  87. package/dist/shell/assets/{copy-field-Od-pW31E.js → copy-field-BfYo47Io.js} +2 -2
  88. package/dist/shell/assets/{create-route-BOGcWPvp.js → create-route-CSTAtNAw.js} +2 -2
  89. package/dist/shell/assets/{custom-step-container-field-B0JbqL0W.js → custom-step-container-field-Dxltzn8J.js} +4 -4
  90. package/dist/shell/assets/embedded-list-7l7TUHug.js +3 -0
  91. package/dist/shell/assets/{export-dialog-Cj0urwkZ.js → export-dialog-DWcXdfEj.js} +2 -2
  92. package/dist/shell/assets/{first-organization-page-Cr_eunjI.js → first-organization-page-77PHesxY.js} +2 -2
  93. package/dist/shell/assets/{graph-view-Ck8qrE0y.js → graph-view-DQOQDrmJ.js} +2 -2
  94. package/dist/shell/assets/{group-donut-_2BqPybE.js → group-donut-BGfuQ6iU.js} +2 -2
  95. package/dist/shell/assets/{guest-call-page-BKpxRWu7.js → guest-call-page-BdV2Hwhv.js} +3 -3
  96. package/dist/shell/assets/{html-viewer-PjyNPHSq.js → html-viewer-CXABej3u.js} +2 -2
  97. package/dist/shell/assets/{import-dialog-K0rhUDim.js → import-dialog-Cqu_xO6L.js} +2 -2
  98. package/dist/shell/assets/import-table-dialog-MwfAiAmM.js +2 -0
  99. package/dist/shell/assets/{index-xBA_aU0w.js → index-DJQ4glyU.js} +1 -1
  100. package/dist/shell/assets/invitations-page-C6LjToJR.js +2 -0
  101. package/dist/shell/assets/{layout-grid-Cr-RvgOt.js → layout-grid-C_uTX3Tb.js} +2 -2
  102. package/dist/shell/assets/{legend-item-BOIlaOng.js → legend-item-DzqFlC4D.js} +2 -2
  103. package/dist/shell/assets/list-page-CTGtveKF.js +4 -0
  104. package/dist/shell/assets/{maplibre-BOy1wGSA.js → maplibre-aCJmOb1H.js} +2 -2
  105. package/dist/shell/assets/{markdown-content-BrnTSgUW.js → markdown-content-CDmFTB6r.js} +2 -2
  106. package/dist/shell/assets/members-page-Defqhu24.js +2 -0
  107. package/dist/shell/assets/{message-content-BLdexhtW.js → message-content-CeLDUud8.js} +3 -3
  108. package/dist/shell/assets/messages-XnV72On0.js +2 -0
  109. package/dist/shell/assets/organization-page-Cdfaqvsh.js +2 -0
  110. package/dist/shell/assets/organizations-page-C37kxzUq.js +2 -0
  111. package/dist/shell/assets/{pending-invitation-row-2aTEUX6U.js → pending-invitation-row-Cyu7Ucej.js} +2 -2
  112. package/dist/shell/assets/{period-chart-Bf1e1Rfd.js → period-chart-T4rBI9Y2.js} +2 -2
  113. package/dist/shell/assets/{person-row-DM8AgaGL.js → person-row-DjxZAaa3.js} +2 -2
  114. package/dist/shell/assets/public-form-page-DaPFaXOT.js +2 -0
  115. package/dist/shell/assets/{record-lines-DO-JkjJw.js → record-lines-CSeqYQnm.js} +2 -2
  116. package/dist/shell/assets/{record-map-BM3T3O3d.js → record-map-l-E3DvxV.js} +2 -2
  117. package/dist/shell/assets/{record-opens-1_hpMdpy.js → record-opens-DPMtZw1p.js} +2 -2
  118. package/dist/shell/assets/record-page-DK2-zwXx.js +3 -0
  119. package/dist/shell/assets/{record-preview-WMGeft1g.js → record-preview-0BdCZkO9.js} +2 -2
  120. package/dist/shell/assets/{records-map-DA4QJ5o1.js → records-map-DSg2fbqb.js} +2 -2
  121. package/dist/shell/assets/render-node-qPc-4XAK.js +3 -0
  122. package/dist/shell/assets/reorder-button-Z_evPIxl.js +2 -0
  123. package/dist/shell/assets/{run-trace-view-DZqLuDCs.js → run-trace-view-ChuThRe4.js} +2 -2
  124. package/dist/shell/assets/{runner-install-field-CZFX7YDn.js → runner-install-field-8Ap9WvhK.js} +2 -2
  125. package/dist/shell/assets/{runtime-update-BSvbTfZB.js → runtime-update-B4DPgHIL.js} +2 -2
  126. package/dist/shell/assets/shared-protobase-ui-ClTsd7Ce.js +1 -0
  127. package/dist/shell/assets/{sheet-source-8s0DvsVl.js → sheet-source-D0v07JHr.js} +3 -3
  128. package/dist/shell/assets/sign-in-policy-page-CV3iE_o8.js +2 -0
  129. package/dist/shell/assets/start-block-queries-DJX-JI2P.js +2 -0
  130. package/dist/shell/assets/step-catalog-DSHlXxWA.js +2 -0
  131. package/dist/shell/assets/{step-panel-k-OfcV1o.js → step-panel-CF6x9K8Y.js} +2 -2
  132. package/dist/shell/assets/timeline-display-DpVKeXjG.js +2 -0
  133. package/dist/shell/assets/{trash-C576xGNJ.js → trash-Ccs0JhuD.js} +2 -2
  134. package/dist/shell/assets/{update-set-OSkktpzc.js → update-set-L1kw--38.js} +2 -2
  135. package/dist/shell/assets/use-calendar-move-DHCS22jF.js +2 -0
  136. package/dist/shell/assets/{use-display-rows-xrXX3vo7.js → use-display-rows-DcY7w9cN.js} +2 -2
  137. package/dist/shell/assets/{use-my-invitations-BzmabmV5.js → use-my-invitations-Dodu_ib9.js} +2 -2
  138. package/dist/shell/assets/{use-paged-search-1j6rT5dX.js → use-paged-search-Crpqw2e-.js} +2 -2
  139. package/dist/shell/assets/{use-run-trace-DhxoDhjX.js → use-run-trace-Cozaxsfl.js} +2 -2
  140. package/dist/shell/assets/{use-workflow-page-Dof4TXvO.js → use-workflow-page-eP9jGrad.js} +2 -2
  141. package/dist/shell/assets/{use-workflow-types-DlnnSIon.js → use-workflow-types-DjJ87TLL.js} +2 -2
  142. package/dist/shell/assets/{workflow-canvas-04KWcras.js → workflow-canvas-NJSHRDav.js} +4 -4
  143. package/dist/shell/assets/{workflow-field-DnRl3Zn3.js → workflow-field-D_pqVGeK.js} +3 -3
  144. package/dist/shell/assets/{workflow-graph-editor-CW-k7iPq.js → workflow-graph-editor-D4zxMPy4.js} +2 -2
  145. package/dist/shell/assets/{workflow-run-field-Cb04vQvU.js → workflow-run-field-DcL-8XS_.js} +3 -3
  146. package/dist/shell/assets/workflow-status-field-15bq7T5K.js +2 -0
  147. package/dist/shell/assets/workflow-workbench-CC_mXUfW.js +4 -0
  148. package/dist/shell/index.html +3 -3
  149. package/dist/shell/protobase.shell.json +2 -2
  150. package/dist/shell/protobase.sw.js +2 -2
  151. package/dist/shell-source-maps/assets/{account-page-D15oXHUN.js.map → account-page-DS2lZVD1.js.map} +1 -1
  152. package/dist/shell-source-maps/assets/{app-CG26wvV-.js.map → app-1IZYQXW2.js.map} +1 -1
  153. package/dist/shell-source-maps/assets/{assistant-shell-vuaTWe1u.js.map → assistant-shell-BIpWuqnT.js.map} +1 -1
  154. package/dist/shell-source-maps/assets/{board-display-DPYwY014.js.map → board-display-Buo0YyZ5.js.map} +1 -1
  155. package/dist/shell-source-maps/assets/{calendar-display-CPqQ_x_H.js.map → calendar-display-10AgoW3N.js.map} +1 -1
  156. package/dist/shell-source-maps/assets/{call-rings-CN1O37Vm.js.map → call-rings-BUUwC1QU.js.map} +1 -1
  157. package/dist/shell-source-maps/assets/{calls-BgpYzNDg.js.map → calls-eQ3_Fp6k.js.map} +1 -1
  158. package/dist/shell-source-maps/assets/{circle-alert-CYtCwklT.js.map → circle-alert-D7B_KeB7.js.map} +1 -1
  159. package/dist/shell-source-maps/assets/{composed-page-CfvP7zgM.js.map → composed-page-Btkd6u0m.js.map} +1 -1
  160. package/dist/shell-source-maps/assets/{composer-section-D8Iupdnl.js.map → composer-section-DUmPQLgo.js.map} +1 -1
  161. package/dist/shell-source-maps/assets/{connect-route-2GF04qVw.js.map → connect-route-DQIlzdmb.js.map} +1 -1
  162. package/dist/shell-source-maps/assets/{copy-field-Od-pW31E.js.map → copy-field-BfYo47Io.js.map} +1 -1
  163. package/dist/shell-source-maps/assets/{create-route-BOGcWPvp.js.map → create-route-CSTAtNAw.js.map} +1 -1
  164. package/dist/shell-source-maps/assets/{custom-step-container-field-B0JbqL0W.js.map → custom-step-container-field-Dxltzn8J.js.map} +1 -1
  165. package/dist/shell-source-maps/assets/{embedded-list-BiErfCKc.js.map → embedded-list-7l7TUHug.js.map} +1 -1
  166. package/dist/shell-source-maps/assets/{export-dialog-Cj0urwkZ.js.map → export-dialog-DWcXdfEj.js.map} +1 -1
  167. package/dist/shell-source-maps/assets/{first-organization-page-Cr_eunjI.js.map → first-organization-page-77PHesxY.js.map} +1 -1
  168. package/dist/shell-source-maps/assets/{graph-view-Ck8qrE0y.js.map → graph-view-DQOQDrmJ.js.map} +1 -1
  169. package/dist/shell-source-maps/assets/{group-donut-_2BqPybE.js.map → group-donut-BGfuQ6iU.js.map} +1 -1
  170. package/dist/shell-source-maps/assets/{guest-call-page-BKpxRWu7.js.map → guest-call-page-BdV2Hwhv.js.map} +1 -1
  171. package/dist/shell-source-maps/assets/{html-viewer-PjyNPHSq.js.map → html-viewer-CXABej3u.js.map} +1 -1
  172. package/dist/shell-source-maps/assets/{import-dialog-K0rhUDim.js.map → import-dialog-Cqu_xO6L.js.map} +1 -1
  173. package/dist/shell-source-maps/assets/{import-table-dialog-QNdJfEUq.js.map → import-table-dialog-MwfAiAmM.js.map} +1 -1
  174. package/dist/shell-source-maps/assets/{invitations-page-BA90Dbkk.js.map → invitations-page-C6LjToJR.js.map} +1 -1
  175. package/dist/shell-source-maps/assets/{layout-grid-Cr-RvgOt.js.map → layout-grid-C_uTX3Tb.js.map} +1 -1
  176. package/dist/shell-source-maps/assets/{legend-item-BOIlaOng.js.map → legend-item-DzqFlC4D.js.map} +1 -1
  177. package/dist/shell-source-maps/assets/{list-page-lR1G4P0j.js.map → list-page-CTGtveKF.js.map} +1 -1
  178. package/dist/shell-source-maps/assets/{maplibre-BOy1wGSA.js.map → maplibre-aCJmOb1H.js.map} +1 -1
  179. package/dist/shell-source-maps/assets/{markdown-content-BrnTSgUW.js.map → markdown-content-CDmFTB6r.js.map} +1 -1
  180. package/dist/shell-source-maps/assets/{members-page-VcGQ0wXn.js.map → members-page-Defqhu24.js.map} +1 -1
  181. package/dist/shell-source-maps/assets/{message-content-BLdexhtW.js.map → message-content-CeLDUud8.js.map} +1 -1
  182. package/dist/shell-source-maps/assets/{messages-DPRjc1DX.js.map → messages-XnV72On0.js.map} +1 -1
  183. package/dist/shell-source-maps/assets/{organization-page-DprBMbrZ.js.map → organization-page-Cdfaqvsh.js.map} +1 -1
  184. package/dist/shell-source-maps/assets/{organizations-page--4KynkcH.js.map → organizations-page-C37kxzUq.js.map} +1 -1
  185. package/dist/shell-source-maps/assets/{pending-invitation-row-2aTEUX6U.js.map → pending-invitation-row-Cyu7Ucej.js.map} +1 -1
  186. package/dist/shell-source-maps/assets/{period-chart-Bf1e1Rfd.js.map → period-chart-T4rBI9Y2.js.map} +1 -1
  187. package/dist/shell-source-maps/assets/{person-row-DM8AgaGL.js.map → person-row-DjxZAaa3.js.map} +1 -1
  188. package/dist/shell-source-maps/assets/{public-form-page-Dk47d12N.js.map → public-form-page-DaPFaXOT.js.map} +1 -1
  189. package/dist/shell-source-maps/assets/{record-lines-DO-JkjJw.js.map → record-lines-CSeqYQnm.js.map} +1 -1
  190. package/dist/shell-source-maps/assets/{record-map-BM3T3O3d.js.map → record-map-l-E3DvxV.js.map} +1 -1
  191. package/dist/shell-source-maps/assets/{record-opens-1_hpMdpy.js.map → record-opens-DPMtZw1p.js.map} +1 -1
  192. package/dist/shell-source-maps/assets/record-page-DK2-zwXx.js.map +1 -0
  193. package/dist/shell-source-maps/assets/{record-preview-WMGeft1g.js.map → record-preview-0BdCZkO9.js.map} +1 -1
  194. package/dist/shell-source-maps/assets/{records-map-DA4QJ5o1.js.map → records-map-DSg2fbqb.js.map} +1 -1
  195. package/dist/shell-source-maps/assets/{render-node-BYXtHiwx.js.map → render-node-qPc-4XAK.js.map} +1 -1
  196. package/dist/shell-source-maps/assets/{reorder-button-DlbkRsr1.js.map → reorder-button-Z_evPIxl.js.map} +1 -1
  197. package/dist/shell-source-maps/assets/{run-trace-view-DZqLuDCs.js.map → run-trace-view-ChuThRe4.js.map} +1 -1
  198. package/dist/shell-source-maps/assets/{runner-install-field-CZFX7YDn.js.map → runner-install-field-8Ap9WvhK.js.map} +1 -1
  199. package/dist/shell-source-maps/assets/{runtime-update-BSvbTfZB.js.map → runtime-update-B4DPgHIL.js.map} +1 -1
  200. package/dist/shell-source-maps/assets/{sheet-source-8s0DvsVl.js.map → sheet-source-D0v07JHr.js.map} +1 -1
  201. package/dist/shell-source-maps/assets/{sign-in-policy-page-BJN_TfWv.js.map → sign-in-policy-page-CV3iE_o8.js.map} +1 -1
  202. package/dist/shell-source-maps/assets/{start-block-queries-nfDrEnQD.js.map → start-block-queries-DJX-JI2P.js.map} +1 -1
  203. package/dist/shell-source-maps/assets/{step-catalog-QhL8OPW4.js.map → step-catalog-DSHlXxWA.js.map} +1 -1
  204. package/dist/shell-source-maps/assets/{step-panel-k-OfcV1o.js.map → step-panel-CF6x9K8Y.js.map} +1 -1
  205. package/dist/shell-source-maps/assets/{timeline-display-CbqpZrs6.js.map → timeline-display-DpVKeXjG.js.map} +1 -1
  206. package/dist/shell-source-maps/assets/{trash-C576xGNJ.js.map → trash-Ccs0JhuD.js.map} +1 -1
  207. package/dist/shell-source-maps/assets/{update-set-OSkktpzc.js.map → update-set-L1kw--38.js.map} +1 -1
  208. package/dist/shell-source-maps/assets/{use-calendar-move-DJbTVBiR.js.map → use-calendar-move-DHCS22jF.js.map} +1 -1
  209. package/dist/shell-source-maps/assets/{use-display-rows-xrXX3vo7.js.map → use-display-rows-DcY7w9cN.js.map} +1 -1
  210. package/dist/shell-source-maps/assets/{use-my-invitations-BzmabmV5.js.map → use-my-invitations-Dodu_ib9.js.map} +1 -1
  211. package/dist/shell-source-maps/assets/{use-paged-search-1j6rT5dX.js.map → use-paged-search-Crpqw2e-.js.map} +1 -1
  212. package/dist/shell-source-maps/assets/{use-run-trace-DhxoDhjX.js.map → use-run-trace-Cozaxsfl.js.map} +1 -1
  213. package/dist/shell-source-maps/assets/{use-workflow-page-Dof4TXvO.js.map → use-workflow-page-eP9jGrad.js.map} +1 -1
  214. package/dist/shell-source-maps/assets/{use-workflow-types-DlnnSIon.js.map → use-workflow-types-DjJ87TLL.js.map} +1 -1
  215. package/dist/shell-source-maps/assets/{workflow-canvas-04KWcras.js.map → workflow-canvas-NJSHRDav.js.map} +1 -1
  216. package/dist/shell-source-maps/assets/{workflow-field-DnRl3Zn3.js.map → workflow-field-D_pqVGeK.js.map} +1 -1
  217. package/dist/shell-source-maps/assets/{workflow-graph-editor-CW-k7iPq.js.map → workflow-graph-editor-D4zxMPy4.js.map} +1 -1
  218. package/dist/shell-source-maps/assets/{workflow-run-field-Cb04vQvU.js.map → workflow-run-field-DcL-8XS_.js.map} +1 -1
  219. package/dist/shell-source-maps/assets/{workflow-status-field-D4-yEdIA.js.map → workflow-status-field-15bq7T5K.js.map} +1 -1
  220. package/dist/shell-source-maps/assets/{workflow-workbench-BBRBLI2p.js.map → workflow-workbench-CC_mXUfW.js.map} +1 -1
  221. package/dist/status/messages.d.ts +2 -2
  222. package/dist/typing/conversation-typing.d.ts +15 -0
  223. package/dist/typing/conversation-typing.js +11 -0
  224. package/dist/typing/record-channel-typing.d.ts +14 -0
  225. package/dist/typing/record-channel-typing.js +33 -0
  226. package/dist/typing/typers-store.d.ts +15 -0
  227. package/dist/typing/typers-store.js +31 -0
  228. package/dist/typing/typing-names.d.ts +11 -0
  229. package/dist/typing/typing-names.js +29 -0
  230. package/dist/typing/typing.d.ts +49 -0
  231. package/dist/typing/typing.js +102 -0
  232. package/dist/typing/use-record-typing.d.ts +11 -0
  233. package/dist/typing/use-record-typing.js +51 -0
  234. package/dist/typing/use-typing-box.d.ts +16 -0
  235. package/dist/typing/use-typing-box.js +30 -0
  236. package/dist/users/messages.d.ts +2 -2
  237. package/package.json +5 -5
  238. package/dist/relay/typing.d.ts +0 -37
  239. package/dist/relay/typing.js +0 -78
  240. package/dist/shell/assets/board-display-DPYwY014.js +0 -2
  241. package/dist/shell/assets/calendar-display-CPqQ_x_H.js +0 -2
  242. package/dist/shell/assets/embedded-list-BiErfCKc.js +0 -3
  243. package/dist/shell/assets/import-table-dialog-QNdJfEUq.js +0 -2
  244. package/dist/shell/assets/invitations-page-BA90Dbkk.js +0 -2
  245. package/dist/shell/assets/list-page-lR1G4P0j.js +0 -4
  246. package/dist/shell/assets/members-page-VcGQ0wXn.js +0 -2
  247. package/dist/shell/assets/messages-DPRjc1DX.js +0 -2
  248. package/dist/shell/assets/organization-page-DprBMbrZ.js +0 -2
  249. package/dist/shell/assets/organizations-page--4KynkcH.js +0 -2
  250. package/dist/shell/assets/public-form-page-Dk47d12N.js +0 -2
  251. package/dist/shell/assets/record-page-C7tfbihg.js +0 -3
  252. package/dist/shell/assets/render-node-BYXtHiwx.js +0 -3
  253. package/dist/shell/assets/reorder-button-DlbkRsr1.js +0 -2
  254. package/dist/shell/assets/shared-protobase-ui-CDYOdP3n.js +0 -1
  255. package/dist/shell/assets/sign-in-policy-page-BJN_TfWv.js +0 -2
  256. package/dist/shell/assets/start-block-queries-nfDrEnQD.js +0 -2
  257. package/dist/shell/assets/step-catalog-QhL8OPW4.js +0 -2
  258. package/dist/shell/assets/timeline-display-CbqpZrs6.js +0 -2
  259. package/dist/shell/assets/use-calendar-move-DJbTVBiR.js +0 -2
  260. package/dist/shell/assets/workflow-status-field-D4-yEdIA.js +0 -2
  261. package/dist/shell/assets/workflow-workbench-BBRBLI2p.js +0 -4
  262. package/dist/shell-source-maps/assets/record-page-C7tfbihg.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { MessageValue } from "../locale/messages.js";
2
2
  //#region src/status/messages.d.ts
3
3
  export declare const text: {
4
- (id: "busy" | "cancel" | "save" | "online" | "away" | "today" | "never" | "custom" | "statusText" | "couldNotSave" | "until" | "clear" | "setStatus" | "editStatus" | "availability" | "automatic" | "doNotDisturb" | "doNotDisturbHint" | "statusPlaceholder" | "clearsAfter" | "thirtyMinutes" | "oneHour" | "fourHours" | "thisWeek" | "clearsAt" | "pickTime", values?: Record<string, MessageValue>): string;
5
- rich(id: "busy" | "cancel" | "save" | "online" | "away" | "today" | "never" | "custom" | "statusText" | "couldNotSave" | "until" | "clear" | "setStatus" | "editStatus" | "availability" | "automatic" | "doNotDisturb" | "doNotDisturbHint" | "statusPlaceholder" | "clearsAfter" | "thirtyMinutes" | "oneHour" | "fourHours" | "thisWeek" | "clearsAt" | "pickTime", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
4
+ (id: "busy" | "cancel" | "online" | "away" | "clear" | "custom" | "setStatus" | "editStatus" | "availability" | "automatic" | "doNotDisturb" | "doNotDisturbHint" | "statusText" | "statusPlaceholder" | "clearsAfter" | "never" | "thirtyMinutes" | "oneHour" | "fourHours" | "today" | "thisWeek" | "clearsAt" | "pickTime" | "save" | "couldNotSave" | "until", values?: Record<string, MessageValue>): string;
5
+ rich(id: "busy" | "cancel" | "online" | "away" | "clear" | "custom" | "setStatus" | "editStatus" | "availability" | "automatic" | "doNotDisturb" | "doNotDisturbHint" | "statusText" | "statusPlaceholder" | "clearsAfter" | "never" | "thirtyMinutes" | "oneHour" | "fourHours" | "today" | "thisWeek" | "clearsAt" | "pickTime" | "save" | "couldNotSave" | "until", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
6
6
  };
7
7
  //#endregion
@@ -0,0 +1,15 @@
1
+ import { TypingPayload } from "./typing.js";
2
+ //#region src/typing/conversation-typing.d.ts
3
+ /** A conversation's typing over the channel that carries it, the relay's or the record's own. */
4
+ export type ConversationTyping = {
5
+ /** Who else types in the thread of that first message's key, or outside threads for null, by user id. */
6
+ typers: (thread: string | null) => string[];
7
+ /** Tells the others the reader types or stopped; false when it cannot go now, such as before the channel is joined. */
8
+ send: (payload: TypingPayload) => boolean;
9
+ };
10
+ /**
11
+ * Which channel carries a conversation page's `typing`: the realtime relay's when the app has one, else the record's own
12
+ * channel (`client.channel`); none without `typing` or for a visitor, who is nobody to name.
13
+ */
14
+ export declare const typingTransport: (typing: boolean | undefined, relay: boolean, me: string | undefined) => "record" | "relay" | undefined;
15
+ //#endregion
@@ -0,0 +1,11 @@
1
+ //#region src/typing/conversation-typing.ts
2
+ /**
3
+ * Which channel carries a conversation page's `typing`: the realtime relay's when the app has one, else the record's own
4
+ * channel (`client.channel`); none without `typing` or for a visitor, who is nobody to name.
5
+ */
6
+ const typingTransport = (typing, relay, me) => {
7
+ if (!typing || me === void 0) return;
8
+ return relay ? "relay" : "record";
9
+ };
10
+ //#endregion
11
+ export { typingTransport };
@@ -0,0 +1,14 @@
1
+ import { TypingPayload } from "./typing.js";
2
+ import { TypersStore } from "./typers-store.js";
3
+ import { Channel } from "@protobase/client";
4
+ //#region src/typing/record-channel-typing.d.ts
5
+ /**
6
+ * Follows the typing on a record's channel (`client.channel(resource, key)`), named `<resource>/<key>`, into `store`,
7
+ * and sends the reader's: nobody shows as typing while the channel is not joined, as typing cannot be known then, and
8
+ * nothing goes then. `stop` stops following and forgets the typers; the caller leaves the channel.
9
+ */
10
+ export declare const followRecordTyping: (channel: Channel, name: string, store: TypersStore) => {
11
+ send: (payload: TypingPayload) => boolean;
12
+ stop: () => void;
13
+ };
14
+ //#endregion
@@ -0,0 +1,33 @@
1
+ import { typingEvent } from "./typing.js";
2
+ import { ChannelRefusal } from "@protobase/client";
3
+ //#region src/typing/record-channel-typing.ts
4
+ const dropRefusal = (error) => {
5
+ if (error instanceof ChannelRefusal) return;
6
+ throw error;
7
+ };
8
+ /**
9
+ * Follows the typing on a record's channel (`client.channel(resource, key)`), named `<resource>/<key>`, into `store`,
10
+ * and sends the reader's: nobody shows as typing while the channel is not joined, as typing cannot be known then, and
11
+ * nothing goes then. `stop` stops following and forgets the typers; the caller leaves the channel.
12
+ */
13
+ const followRecordTyping = (channel, name, store) => {
14
+ const offTyping = channel.on(typingEvent, (message) => {
15
+ if (message.user !== null && !message.server) store.heard(name, String(message.user), message.payload);
16
+ });
17
+ const offStatus = channel.onStatus((status) => status.state !== "joined" && store.clear());
18
+ const send = (payload) => {
19
+ if (channel.status().state !== "joined") return false;
20
+ channel.send(typingEvent, payload).catch(dropRefusal);
21
+ return true;
22
+ };
23
+ return {
24
+ send,
25
+ stop: () => {
26
+ offTyping();
27
+ offStatus();
28
+ store.clear();
29
+ }
30
+ };
31
+ };
32
+ //#endregion
33
+ export { followRecordTyping };
@@ -0,0 +1,15 @@
1
+ import { Typers } from "./typing.js";
2
+ //#region src/typing/typers-store.d.ts
3
+ /**
4
+ * Who types where, as a page heard it on its channels, each typer kept until their typing runs out: `heard` takes a
5
+ * typing payload, `clear` forgets everyone, such as while the channel is down, and `stop` ends the expiry timer.
6
+ */
7
+ export declare const createTypersStore: () => {
8
+ typers: () => Typers;
9
+ subscribe: (listener: () => void) => () => undefined;
10
+ heard: (channel: string, user: string, payload: unknown) => void;
11
+ clear: () => void;
12
+ stop: () => void;
13
+ };
14
+ export type TypersStore = ReturnType<typeof createTypersStore>;
15
+ //#endregion
@@ -0,0 +1,31 @@
1
+ import { heardTyping, nextExpiry, withoutExpired } from "./typing.js";
2
+ //#region src/typing/typers-store.ts
3
+ /**
4
+ * Who types where, as a page heard it on its channels, each typer kept until their typing runs out: `heard` takes a
5
+ * typing payload, `clear` forgets everyone, such as while the channel is down, and `stop` ends the expiry timer.
6
+ */
7
+ const createTypersStore = () => {
8
+ let typers = /* @__PURE__ */ new Map();
9
+ let timer;
10
+ const listeners = /* @__PURE__ */ new Set();
11
+ const set = (next) => {
12
+ if (next === typers) return;
13
+ typers = next;
14
+ for (const listener of [...listeners]) listener();
15
+ clearTimeout(timer);
16
+ const at = nextExpiry(typers);
17
+ if (at !== void 0) timer = setTimeout(() => set(withoutExpired(typers, Date.now())), Math.max(0, at - Date.now()));
18
+ };
19
+ return {
20
+ typers: () => typers,
21
+ subscribe: (listener) => {
22
+ listeners.add(listener);
23
+ return () => void listeners.delete(listener);
24
+ },
25
+ heard: (channel, user, payload) => set(heardTyping(typers, channel, user, payload, Date.now())),
26
+ clear: () => set(/* @__PURE__ */ new Map()),
27
+ stop: () => clearTimeout(timer)
28
+ };
29
+ };
30
+ //#endregion
31
+ export { createTypersStore };
@@ -0,0 +1,11 @@
1
+ //#region src/typing/typing-names.d.ts
2
+ /** The line for the names of those typing: one, two, or several; nothing for nobody. */
3
+ export declare const typingText: (names: readonly string[]) => string;
4
+ /**
5
+ * The line above a box saying who else types, by the user ids given, named as the organization's members the page
6
+ * already has; it keeps its height while nobody does, so the box does not move.
7
+ */
8
+ export declare const TypingNames: ({ users }: {
9
+ users: readonly string[];
10
+ }) => import("react").JSX.Element;
11
+ //#endregion
@@ -0,0 +1,29 @@
1
+ import { useMembers } from "../people/use-members.js";
2
+ import { text } from "../app/conversation-page/messages.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/typing/typing-names.tsx
5
+ /** The line for the names of those typing: one, two, or several; nothing for nobody. */
6
+ const typingText = (names) => {
7
+ if (names.length === 0) return "";
8
+ if (names.length === 1) return text("typingOne", { name: names[0] });
9
+ if (names.length === 2) return text("typingTwo", {
10
+ first: names[0],
11
+ second: names[1]
12
+ });
13
+ return text("typingMany");
14
+ };
15
+ /**
16
+ * The line above a box saying who else types, by the user ids given, named as the organization's members the page
17
+ * already has; it keeps its height while nobody does, so the box does not move.
18
+ */
19
+ const TypingNames = ({ users }) => {
20
+ const { member } = useMembers();
21
+ const names = users.map((id) => member(id)?.name ?? text("someone"));
22
+ return /* @__PURE__ */ jsx("p", {
23
+ className: "h-5 shrink-0 truncate px-4 text-xs text-muted-foreground",
24
+ "aria-live": "polite",
25
+ children: typingText(names)
26
+ });
27
+ };
28
+ //#endregion
29
+ export { TypingNames, typingText };
@@ -0,0 +1,49 @@
1
+ //#region src/typing/typing.d.ts
2
+ /**
3
+ * The event a conversation's typing goes as, on the record's channel, the relay's or the app's own, with
4
+ * `{ typing: boolean, thread }`: `thread` the key of the thread's first message typed in, or null outside threads.
5
+ */
6
+ export declare const typingEvent = "typing";
7
+ /** A typer sends that they type at most this often, and a page shows them typing this long after the last. */
8
+ export declare const typingSendGapMs = 3000;
9
+ export declare const typingShownMs = 6000;
10
+ /** What a box sends as its person types or stops: in the thread of that first message's key, or outside threads. */
11
+ export type TypingPayload = {
12
+ typing: boolean;
13
+ thread: string | number | null;
14
+ };
15
+ /**
16
+ * Where on a channel someone types: the channel itself outside threads, `<channel>?thread=<key>` in a thread, so the
17
+ * conversation's box and each thread's panel show only their own typers.
18
+ */
19
+ export declare const typingSpot: (channel: string, thread: string | number | null) => string;
20
+ /** Who types where: by spot (`typingSpot`), the user ids and until when they show. */
21
+ export type Typers = ReadonlyMap<string, ReadonlyMap<string, number>>;
22
+ /**
23
+ * The typers once `user` sent `payload` on the channel: typing in its spot until `typingShownMs` from now, or no longer
24
+ * when it says they stopped. A payload that is no typing changes nothing.
25
+ */
26
+ export declare const heardTyping: (typers: Typers, channel: string, user: string, payload: unknown, now: number) => Typers;
27
+ /** The typers still typing at `now`, the same object when none ran out. */
28
+ export declare const withoutExpired: (typers: Typers, now: number) => Typers;
29
+ /** When the next typer stops showing, to draw them again then; undefined for none. */
30
+ export declare const nextExpiry: (typers: Typers) => number | undefined;
31
+ /** Who else types in the spot, leaving out `me`, whose own other devices type there too. */
32
+ export declare const typersOn: (typers: Typers, spot: string, me: string | undefined) => string[];
33
+ /** The clock a sender waits on, so a test can stand in for it; `setTimer` answers the function that cancels it. */
34
+ export type Clock = {
35
+ now: () => number;
36
+ setTimer: (run: () => void, ms: number) => () => void;
37
+ };
38
+ /**
39
+ * What a box sends as its text changes: that its person types, at most once every `typingSendGapMs`, a change within a
40
+ * gap told once it has passed, and that they stopped, once, when they empty the box or send. `send` answers whether it
41
+ * could, such as not while the channel is down: one it could not counts as not sent, so the next change tries again.
42
+ * `dispose` cancels a send still waiting.
43
+ */
44
+ export declare const typingSender: (send: (typing: boolean) => boolean, clock: Clock) => {
45
+ onText: (text: string) => void;
46
+ onSent: () => void;
47
+ dispose: () => void;
48
+ };
49
+ //#endregion
@@ -0,0 +1,102 @@
1
+ //#region src/typing/typing.ts
2
+ /**
3
+ * The event a conversation's typing goes as, on the record's channel, the relay's or the app's own, with
4
+ * `{ typing: boolean, thread }`: `thread` the key of the thread's first message typed in, or null outside threads.
5
+ */
6
+ const typingEvent = "typing";
7
+ /** A typer sends that they type at most this often, and a page shows them typing this long after the last. */
8
+ const typingSendGapMs = 3e3;
9
+ const typingShownMs = 6e3;
10
+ /**
11
+ * Where on a channel someone types: the channel itself outside threads, `<channel>?thread=<key>` in a thread, so the
12
+ * conversation's box and each thread's panel show only their own typers.
13
+ */
14
+ const typingSpot = (channel, thread) => thread === null ? channel : `${channel}?thread=${thread}`;
15
+ const typingOf = (payload) => {
16
+ if (typeof payload !== "object" || payload === null) return;
17
+ const { typing, thread } = payload;
18
+ if (typeof typing !== "boolean") return;
19
+ if (thread === void 0 || thread === null) return {
20
+ typing,
21
+ thread: null
22
+ };
23
+ if (typeof thread !== "string" && typeof thread !== "number") return;
24
+ return {
25
+ typing,
26
+ thread
27
+ };
28
+ };
29
+ /**
30
+ * The typers once `user` sent `payload` on the channel: typing in its spot until `typingShownMs` from now, or no longer
31
+ * when it says they stopped. A payload that is no typing changes nothing.
32
+ */
33
+ const heardTyping = (typers, channel, user, payload, now) => {
34
+ const heard = typingOf(payload);
35
+ if (!heard) return typers;
36
+ const spot = typingSpot(channel, heard.thread);
37
+ const typing = new Map(typers.get(spot));
38
+ if (heard.typing) typing.set(user, now + typingShownMs);
39
+ else typing.delete(user);
40
+ const next = new Map(typers);
41
+ if (typing.size > 0) next.set(spot, typing);
42
+ else next.delete(spot);
43
+ return next;
44
+ };
45
+ /** The typers still typing at `now`, the same object when none ran out. */
46
+ const withoutExpired = (typers, now) => {
47
+ if (![...typers.values()].some((spot) => [...spot.values()].some((until) => until <= now))) return typers;
48
+ const next = /* @__PURE__ */ new Map();
49
+ for (const [name, spot] of typers) {
50
+ const left = new Map([...spot].filter(([, until]) => until > now));
51
+ if (left.size > 0) next.set(name, left);
52
+ }
53
+ return next;
54
+ };
55
+ /** When the next typer stops showing, to draw them again then; undefined for none. */
56
+ const nextExpiry = (typers) => {
57
+ const times = [...typers.values()].flatMap((spot) => [...spot.values()]);
58
+ return times.length === 0 ? void 0 : Math.min(...times);
59
+ };
60
+ /** Who else types in the spot, leaving out `me`, whose own other devices type there too. */
61
+ const typersOn = (typers, spot, me) => [...typers.get(spot)?.keys() ?? []].filter((user) => user !== me);
62
+ /**
63
+ * What a box sends as its text changes: that its person types, at most once every `typingSendGapMs`, a change within a
64
+ * gap told once it has passed, and that they stopped, once, when they empty the box or send. `send` answers whether it
65
+ * could, such as not while the channel is down: one it could not counts as not sent, so the next change tries again.
66
+ * `dispose` cancels a send still waiting.
67
+ */
68
+ const typingSender = (send, clock) => {
69
+ let sentAt = -Infinity;
70
+ let typing = false;
71
+ let cancel;
72
+ const announce = () => {
73
+ cancel = void 0;
74
+ if (!send(true)) return;
75
+ sentAt = clock.now();
76
+ typing = true;
77
+ };
78
+ const dispose = () => {
79
+ cancel?.();
80
+ cancel = void 0;
81
+ };
82
+ const stop = () => {
83
+ dispose();
84
+ if (!typing) return;
85
+ typing = false;
86
+ send(false);
87
+ };
88
+ const onText = (text) => {
89
+ if (text.trim() === "") return stop();
90
+ if (cancel) return;
91
+ const wait = sentAt + typingSendGapMs - clock.now();
92
+ if (wait <= 0) return announce();
93
+ cancel = clock.setTimer(announce, wait);
94
+ };
95
+ return {
96
+ onText,
97
+ onSent: stop,
98
+ dispose
99
+ };
100
+ };
101
+ //#endregion
102
+ export { heardTyping, nextExpiry, typersOn, typingEvent, typingSendGapMs, typingSender, typingShownMs, typingSpot, withoutExpired };
@@ -0,0 +1,11 @@
1
+ import { ConversationTyping } from "./conversation-typing.js";
2
+ //#region src/typing/use-record-typing.d.ts
3
+ /**
4
+ * A conversation's typing over the record's own channel (`client.channel(resource, key)`), which admits only those who
5
+ * may read the record (see `followRecordTyping`): joined while drawn with a record, left once not.
6
+ */
7
+ export declare const useRecordTyping: (record: {
8
+ resource: string;
9
+ key: string;
10
+ } | undefined, me: string | undefined) => ConversationTyping | undefined;
11
+ //#endregion
@@ -0,0 +1,51 @@
1
+ import { useClient } from "../data/api-provider.js";
2
+ import { typersOn, typingSpot } from "./typing.js";
3
+ import { createTypersStore } from "./typers-store.js";
4
+ import { followRecordTyping } from "./record-channel-typing.js";
5
+ import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
6
+ //#region src/typing/use-record-typing.ts
7
+ /**
8
+ * A conversation's typing over the record's own channel (`client.channel(resource, key)`), which admits only those who
9
+ * may read the record (see `followRecordTyping`): joined while drawn with a record, left once not.
10
+ */
11
+ const useRecordTyping = (record, me) => {
12
+ const client = useClient();
13
+ const [store] = useState(createTypersStore);
14
+ const followed = useRef(void 0);
15
+ const resource = record?.resource;
16
+ const key = record?.key;
17
+ useEffect(() => {
18
+ if (resource === void 0 || key === void 0) return;
19
+ const channel = client.channel(resource, key);
20
+ const following = followRecordTyping(channel, `${resource}/${key}`, store);
21
+ followed.current = following;
22
+ return () => {
23
+ followed.current = void 0;
24
+ following.stop();
25
+ channel.leave();
26
+ };
27
+ }, [
28
+ client,
29
+ store,
30
+ resource,
31
+ key
32
+ ]);
33
+ useEffect(() => () => store.stop(), [store]);
34
+ const typers = useSyncExternalStore(store.subscribe, store.typers, store.typers);
35
+ const send = useCallback((payload) => followed.current?.send(payload) ?? false, []);
36
+ return useMemo(() => {
37
+ if (resource === void 0 || key === void 0) return;
38
+ return {
39
+ typers: (thread) => typersOn(typers, typingSpot(`${resource}/${key}`, thread), me),
40
+ send
41
+ };
42
+ }, [
43
+ resource,
44
+ key,
45
+ typers,
46
+ me,
47
+ send
48
+ ]);
49
+ };
50
+ //#endregion
51
+ export { useRecordTyping };
@@ -0,0 +1,16 @@
1
+ import { ConversationTyping } from "./conversation-typing.js";
2
+ //#region src/typing/use-typing-box.d.ts
3
+ /**
4
+ * Tells the others while the reader types in a box (see `typingSender`), in the thread of that first message's key, or
5
+ * outside threads for null: `onText` with the box's text as it changes, `onSent` once a message went. Nothing without
6
+ * `typing`.
7
+ */
8
+ export declare const useTypingBox: (typing: ConversationTyping | undefined, thread: string | number | null) => {
9
+ onText: (text: string) => void;
10
+ onSent: () => void;
11
+ dispose: () => void;
12
+ } | {
13
+ onText: () => void;
14
+ onSent: () => void;
15
+ };
16
+ //#endregion
@@ -0,0 +1,30 @@
1
+ import { typingSender } from "./typing.js";
2
+ import { useEffect, useMemo } from "react";
3
+ //#region src/typing/use-typing-box.ts
4
+ const clock = {
5
+ now: () => Date.now(),
6
+ setTimer: (run, ms) => {
7
+ const timer = setTimeout(run, ms);
8
+ return () => clearTimeout(timer);
9
+ }
10
+ };
11
+ const nothing = {
12
+ onText: () => {},
13
+ onSent: () => {}
14
+ };
15
+ /**
16
+ * Tells the others while the reader types in a box (see `typingSender`), in the thread of that first message's key, or
17
+ * outside threads for null: `onText` with the box's text as it changes, `onSent` once a message went. Nothing without
18
+ * `typing`.
19
+ */
20
+ const useTypingBox = (typing, thread) => {
21
+ const send = typing?.send;
22
+ const sender = useMemo(() => send ? typingSender((on) => send({
23
+ typing: on,
24
+ thread
25
+ }), clock) : void 0, [send, thread]);
26
+ useEffect(() => () => sender?.onSent(), [sender]);
27
+ return sender ?? nothing;
28
+ };
29
+ //#endregion
30
+ export { useTypingBox };
@@ -1,7 +1,7 @@
1
1
  import { MessageValue } from "../locale/messages.js";
2
2
  //#region src/users/messages.d.ts
3
3
  export declare const text: {
4
- (id: "people" | "name" | "email" | "password" | "block" | "passwordOptional" | "inviteSomeone" | "inviteDescription" | "notAcceptedYet" | "sendingAgain" | "nobodyWaiting" | "blocked" | "couldNotReadRoles" | "addAnAccount" | "addDescription" | "addAccount" | "peopleDescription" | "findSomeone" | "emailAddress" | "keepOneRole" | "unblock", values?: Record<string, MessageValue>): string;
5
- rich(id: "people" | "name" | "email" | "password" | "block" | "passwordOptional" | "inviteSomeone" | "inviteDescription" | "notAcceptedYet" | "sendingAgain" | "nobodyWaiting" | "blocked" | "couldNotReadRoles" | "addAnAccount" | "addDescription" | "addAccount" | "peopleDescription" | "findSomeone" | "emailAddress" | "keepOneRole" | "unblock", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
4
+ (id: "name" | "email" | "password" | "passwordOptional" | "people" | "block" | "inviteSomeone" | "inviteDescription" | "notAcceptedYet" | "sendingAgain" | "nobodyWaiting" | "couldNotReadRoles" | "addAnAccount" | "addDescription" | "addAccount" | "peopleDescription" | "findSomeone" | "emailAddress" | "keepOneRole" | "blocked" | "unblock", values?: Record<string, MessageValue>): string;
5
+ rich(id: "name" | "email" | "password" | "passwordOptional" | "people" | "block" | "inviteSomeone" | "inviteDescription" | "notAcceptedYet" | "sendingAgain" | "nobodyWaiting" | "couldNotReadRoles" | "addAnAccount" | "addDescription" | "addAccount" | "peopleDescription" | "findSomeone" | "emailAddress" | "keepOneRole" | "blocked" | "unblock", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
6
6
  };
7
7
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/ui",
3
- "version": "0.123.0",
3
+ "version": "0.123.1",
4
4
  "description": "The Protobase admin app and the React hooks and components for custom UI.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -40,10 +40,10 @@
40
40
  "dependencies": {
41
41
  "@dnd-kit/core": "^6.3.1",
42
42
  "@dnd-kit/sortable": "^10.0.0",
43
- "@protobase/client": "0.123.0",
44
- "@protobase/layout": "0.123.0",
45
- "@protobase/schema": "0.123.0",
46
- "@protobase/workflows": "0.123.0",
43
+ "@protobase/client": "0.123.1",
44
+ "@protobase/layout": "0.123.1",
45
+ "@protobase/schema": "0.123.1",
46
+ "@protobase/workflows": "0.123.1",
47
47
  "@sentry/browser": "^11.7.0",
48
48
  "@tanstack/react-query": "^5.104.1",
49
49
  "@tanstack/react-table": "^9.2.6",
@@ -1,37 +0,0 @@
1
- import { RelayEvent } from "@protobase/client";
2
- //#region src/relay/typing.d.ts
3
- /** The event a conversation's typing goes as, on the record's relay channel, with `{ typing: boolean }`. */
4
- export declare const typingEvent = "typing";
5
- /** A typer sends that they type at most this often, and a page shows them typing this long after the last. */
6
- export declare const typingSendGapMs = 3000;
7
- export declare const typingShownMs = 6000;
8
- /** Who types on which channel: by channel, the user ids and until when they show. */
9
- export type Typers = ReadonlyMap<string, ReadonlyMap<string, number>>;
10
- /**
11
- * The typers once `event` arrived: its sender typing on its channel until `typingShownMs` from now, or no longer when it
12
- * says they stopped. Anything else, such as a direct event or another event, changes nothing.
13
- */
14
- export declare const heardTyping: (typers: Typers, event: RelayEvent, now: number) => Typers;
15
- /** The typers still typing at `now`, the same object when none ran out. */
16
- export declare const withoutExpired: (typers: Typers, now: number) => Typers;
17
- /** When the next typer stops showing, to draw them again then; undefined for none. */
18
- export declare const nextExpiry: (typers: Typers) => number | undefined;
19
- /** Who else types on the channel, leaving out `me`, whose own other devices type there too. */
20
- export declare const typersOn: (typers: Typers, channel: string, me: string | undefined) => string[];
21
- /** The clock a sender waits on, so a test can stand in for it; `setTimer` answers the function that cancels it. */
22
- export type Clock = {
23
- now: () => number;
24
- setTimer: (run: () => void, ms: number) => () => void;
25
- };
26
- /**
27
- * What a composer sends as its text changes: that its person types, at most once every `typingSendGapMs`, a change
28
- * within a gap told once it has passed, and that they stopped, once, when they empty the box or send. `send` answers
29
- * whether it could, such as not while the relay is down: one it could not counts as not sent, so the next change tries
30
- * again. `dispose` cancels a send still waiting.
31
- */
32
- export declare const typingSender: (send: (typing: boolean) => boolean, clock: Clock) => {
33
- onText: (text: string) => void;
34
- onSent: () => void;
35
- dispose: () => void;
36
- };
37
- //#endregion
@@ -1,78 +0,0 @@
1
- //#region src/relay/typing.ts
2
- /** The event a conversation's typing goes as, on the record's relay channel, with `{ typing: boolean }`. */
3
- const typingEvent = "typing";
4
- /** A typer sends that they type at most this often, and a page shows them typing this long after the last. */
5
- const typingSendGapMs = 3e3;
6
- const typingShownMs = 6e3;
7
- /**
8
- * The typers once `event` arrived: its sender typing on its channel until `typingShownMs` from now, or no longer when it
9
- * says they stopped. Anything else, such as a direct event or another event, changes nothing.
10
- */
11
- const heardTyping = (typers, event, now) => {
12
- if (event.event !== "typing" || event.channel === void 0 || typeof event.payload.typing !== "boolean") return typers;
13
- const channel = new Map(typers.get(event.channel));
14
- if (event.payload.typing) channel.set(event.from.user, now + typingShownMs);
15
- else channel.delete(event.from.user);
16
- const next = new Map(typers);
17
- if (channel.size > 0) next.set(event.channel, channel);
18
- else next.delete(event.channel);
19
- return next;
20
- };
21
- /** The typers still typing at `now`, the same object when none ran out. */
22
- const withoutExpired = (typers, now) => {
23
- if (![...typers.values()].some((channel) => [...channel.values()].some((until) => until <= now))) return typers;
24
- const next = /* @__PURE__ */ new Map();
25
- for (const [name, channel] of typers) {
26
- const left = new Map([...channel].filter(([, until]) => until > now));
27
- if (left.size > 0) next.set(name, left);
28
- }
29
- return next;
30
- };
31
- /** When the next typer stops showing, to draw them again then; undefined for none. */
32
- const nextExpiry = (typers) => {
33
- const times = [...typers.values()].flatMap((channel) => [...channel.values()]);
34
- return times.length === 0 ? void 0 : Math.min(...times);
35
- };
36
- /** Who else types on the channel, leaving out `me`, whose own other devices type there too. */
37
- const typersOn = (typers, channel, me) => [...typers.get(channel)?.keys() ?? []].filter((user) => user !== me);
38
- /**
39
- * What a composer sends as its text changes: that its person types, at most once every `typingSendGapMs`, a change
40
- * within a gap told once it has passed, and that they stopped, once, when they empty the box or send. `send` answers
41
- * whether it could, such as not while the relay is down: one it could not counts as not sent, so the next change tries
42
- * again. `dispose` cancels a send still waiting.
43
- */
44
- const typingSender = (send, clock) => {
45
- let sentAt = -Infinity;
46
- let typing = false;
47
- let cancel;
48
- const announce = () => {
49
- cancel = void 0;
50
- if (!send(true)) return;
51
- sentAt = clock.now();
52
- typing = true;
53
- };
54
- const dispose = () => {
55
- cancel?.();
56
- cancel = void 0;
57
- };
58
- const stop = () => {
59
- dispose();
60
- if (!typing) return;
61
- typing = false;
62
- send(false);
63
- };
64
- const onText = (text) => {
65
- if (text.trim() === "") return stop();
66
- if (cancel) return;
67
- const wait = sentAt + typingSendGapMs - clock.now();
68
- if (wait <= 0) return announce();
69
- cancel = clock.setTimer(announce, wait);
70
- };
71
- return {
72
- onText,
73
- onSent: stop,
74
- dispose
75
- };
76
- };
77
- //#endregion
78
- export { heardTyping, nextExpiry, typersOn, typingEvent, typingSendGapMs, typingSender, typingShownMs, withoutExpired };
@@ -1,2 +0,0 @@
1
- (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{Ba as r,Bs as i,Cr as a,Fa as o,Ga as s,Ja as c,Ml as l,Nn as u,Ol as d,Ra as f,Sc as p,Tc as m,Ts as h,Vs as g,_i as _,gi as v,hi as y,mi as b,sl as x,so as S,uc as C,vl as w,vs as T,vu as E,wn as D,xs as O,yi as k,yl as A,ys as j}from"./app-CG26wvV-.js";import{i as M}from"./vendor-t7Q7QbPu.js";import{w as N}from"./embedded-list-BiErfCKc.js";import{r as P}from"./record-preview-WMGeft1g.js";import{_ as F,a as ee,g as I,i as L,n as te,o as ne,t as re,v as ie}from"./lib-dnd-kit-core-xi-7xL_N.js";import{a as R,i as z,n as B,t as V}from"./lib-dnd-kit-sortable-CNDSKqCD.js";import{a as H,i as U,l as ae,n as W,o as G,r as K,s as q,t as oe}from"./messages-DPRjc1DX.js";import{n as se,r as J,t as ce}from"./board-dnd-pi-vIUTz.js";import{t as le}from"./use-display-rows-xrXX3vo7.js";var ue=e=>typeof e==`number`&&Number.isInteger(e),de=(e,t,n)=>{let r=0;for(;r<t&&ue(e[r])&&(r===0||e[r]>e[r-1]);)r+=1;let i=e.length;for(;i-1>n&&ue(e[i-1])&&(i===e.length||e[i-1]<e[i]);)--i;let a=Math.min(t,r),o=a===0?1:e[a-1]+1,s=Math.max(n,i-1);for(;s+1<e.length&&e[s+1]<=o+(s-a);)s+=1;return{first:a,last:s,start:o}},Y=e(t(),1),fe=({model:e,by:t,value:n,fields:r,filter:i,orderBy:a})=>{let{resources:o,views:s}=T(),c=P({resources:o,views:s,model:e,columns:r,filter:_(i,t,n),orderBy:a});return le(e,c.page,c.key,!0)},X=e(n(),1),pe=(e,t)=>{if(!t)return e;let n=new Map(e.map(e=>[e.key,e])),r=new Set(t);return[...t.flatMap(e=>n.get(e)??[]),...e.filter(e=>!r.has(e.key))]},me=({model:e,view:t,display:n,column:i,fields:o,filter:s,orderBy:c,limit:l,moves:f,movable:h,placeable:g,dragged:_})=>{let v=fe({model:e,by:n.by,value:i.value,fields:o,filter:s,orderBy:c}),y=b(e,t,n),S=new Set(v.rows.map(e=>e.key)),C=new Map(f.map(e=>[e.row.key,e])),w=v.rows.filter(e=>C.has(e.key)&&C.get(e.key).to!==i.value),T=f.filter(e=>e.to===i.value&&!S.has(e.row.key)).map(e=>e.row),E=v.rows.filter(e=>!w.includes(e)).map(e=>C.has(e.key)?C.get(e.key).row:e),D=f.findLast(e=>e.to===i.value&&e.order),O=pe([...T,...E],D?.order),j=O.slice(0,l),M=v.more||O.length>j.length,{setNodeRef:N,isOver:P}=I({id:J(i.value),data:{column:i,rows:j,more:M}}),F=v.total-w.length+T.length;if(i.value===null&&!v.loading&&F===0&&!P)return null;let ee=(t?.names?.plural??d(e.name)).toLowerCase(),L=t?.fields[n.by];return(0,X.jsxs)(`section`,{ref:N,"aria-label":`${i.label}, ${F}`,className:x(`flex w-72 shrink-0 snap-start flex-col gap-2 rounded-lg bg-surface p-2`,P&&`ring-2 ring-primary/30`),children:[(0,X.jsxs)(`header`,{className:`flex items-center justify-between gap-2 px-1 pt-0.5`,children:[(0,X.jsx)(`h2`,{className:`min-w-0 truncate text-body font-medium`,children:i.value===null?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i.label}):(0,X.jsx)(u,{value:i.value,hints:L,children:i.label})}),!v.loading&&(0,X.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:F.toLocaleString(A())})]}),v.loading?Array.from({length:3},(e,t)=>(0,X.jsx)(p,{className:`h-20`},t)):v.error?(0,X.jsx)(a,{title:k(`couldNotLoadRows`),error:v.error}):j.length===0?(0,X.jsx)(`p`,{className:`px-1 py-4 text-center text-xs text-muted-foreground`,children:k(`noPlural`,{plural:ee})}):(0,X.jsx)(V,{id:J(i.value),items:j.map(e=>e.key),strategy:R,children:(0,X.jsx)(`ul`,{className:`-mb-2 flex flex-col`,children:j.map(n=>(0,X.jsx)(he,{model:e,view:t,card:y,row:n,column:i,rows:j,more:M,draggable:(h||g)&&r(n.record,`update`),placeable:g,dragged:_},n.key))})}),l===void 0&&v.more&&(0,X.jsx)(m,{size:`sm`,variant:`ghost`,onClick:v.loadMore,children:k(`showMore`)})]})},he=({model:e,view:t,card:n,row:r,column:i,rows:a,more:o,draggable:s,placeable:c,dragged:l})=>{let{setNodeRef:u,setActivatorNodeRef:d,listeners:f,isDragging:p,isOver:m,active:h,transform:g,transition:_}=z({id:r.key,data:{row:r,column:i,rows:a,more:o},disabled:{draggable:!s,droppable:!c}}),v=m&&h?.data.current?.column?.value!==i.value;return(0,X.jsx)(`li`,{ref:e=>{u(e),d(e?.querySelector(`a[data-card-link]`)??e)},...f,onDragStart:e=>e.preventDefault(),onClickCapture:e=>{l()&&(e.preventDefault(),e.stopPropagation())},style:{transform:g?`translate3d(${g.x}px, ${g.y}px, 0)`:void 0,transition:_},className:x(`relative pb-2`,s&&`cursor-grab touch-manipulation`,p&&`opacity-40`,v&&`before:absolute before:inset-x-0 before:-top-1 before:h-0.5 before:rounded-full before:bg-primary`),children:(0,X.jsx)(N,{model:e,view:t,display:n,row:r,swipe:!1})})},ge=e=>e.kind===`and`?e.args.flatMap(ge):[e],_e=e=>e.kind===`string`?String(e.value):void 0,ve=(e,t)=>{if(e.kind===`compare`&&e.op===`=`&&e.field.path.join(`.`)===t){let t=_e(e.value);return t===void 0?void 0:[t]}if(e.kind===`in`&&e.field.path.join(`.`)===t){let t=e.values.map(_e);return t.every(e=>e!==void 0)?t:void 0}},ye=(e,t,n)=>{let r=E(e);if(!r.ok||!r.ast)return n;let i=ge(r.ast).map(e=>ve(e,t)).filter(e=>e!==void 0);return n.filter(e=>i.every(t=>e.value!==null&&t.includes(e.value)))},be=(e,t)=>t!==null&&Object.hasOwn(e,t)?e[t]:void 0,xe=(e,t)=>typeof e==`object`?e.set??t:void 0,Se=(e,t)=>{let n=e.fields[t];return n!==void 0&&!n.writeOnly&&!n.sensitive},Ce=(e,t,n,r)=>i=>{if(n===!0)return!e.fields[t]?.readOnly;if(typeof n==`object`){let r=e.fields[n.set??t];return!r||r.readOnly?!1:n.columns===void 0||i!==null&&n.columns.includes(i)}return r!==void 0&&be(r,i)!==void 0},we=(e,t,n)=>{let r=e.findIndex(e=>e.key===t.key);return r===-1?[...e.slice(0,n),t,...e.slice(n)]:B(e,r,n)},Z=(e,t,n)=>{let r=e.findIndex(e=>e.key===t.key);return{order:we(e,t,n),first:r===-1?n:Math.min(r,n),last:r===-1?n:Math.max(r,n)}},Te=(e,t,n,r,i,a,s,c,u)=>{let d=o(e,i.record),f=s.findIndex(e=>e.key===i.key),p=K(e,n,_(r,t,a.value),s.map(e=>e.record),f,c),m=u===void 0?[]:[{op:`reorder`,resource:e.name,field:n,keys:[d],start:u,etags:{[l(d)]:`*`}}];return[...(i.record[t]??null)===a.value?[]:[{op:`update`,resource:e.name,key:d,data:{[t]:a.value},etag:`*`}],...m,p]},Ee=(e,t,n,r)=>{let i=t=>l(o(e,t)),a=W(r.results,i),s=new Map(n.map(e=>{let n=i(e.record);return[n,a.has(n)?{...e.record,[t]:a.get(n)}:e.record]})),c=new Map;for(let e of r.results){let t=e.op===`reorder`||e.op===`move`?e.records:e.op===`update`?[e]:[];for(let{record:e,etag:n}of t)c.set(i(e),{record:e,etag:n})}return[...c].flatMap(([e,t])=>{let n=s.get(e);return n?[{before:n,...t}]:[]})},Q=e=>e!=null&&e!==``,De=({model:e,rank:t,rows:n,row:r,index:i,bounds:a,title:s})=>{let c=n.some(e=>e.key===r.key)?n.length-1:n.length,u;for(let d=i;d<=c;d++){let{order:i,first:f,last:p}=Z(n,r,d),m=i.map(e=>e.record[t]),h=de(m,f,p),g=new Map(i.map((t,n)=>[l(o(e,t.record)),n>=h.first&&n<=h.last?h.start+n-h.first:m[n]])),_=e=>g.has(e.key)?g.get(e.key):e.rank,v=Number(g.get(l(o(e,r.record)))),y=a.after.filter(e=>Q(_(e))&&Number(_(e))>=v),b=a.before.find(e=>Q(_(e))&&Number(_(e))<=v),x=b?oe(`dependsOn`,{record:b.title,other:s}):y[0]&&oe(`dependsOn`,{record:s,other:y[0].title});if(!x)return{place:{index:d},...u!==void 0&&{reason:u}};if(u??=x,d!==c||b)continue;let S=Math.max(...y.map(e=>Number(_(e))))+1;if(a.before.every(e=>!Q(_(e))||Number(_(e))>S))return{place:{index:d,bump:S},reason:u}}return{reason:u}},Oe=[`required`,`invalid-value`,`read-only`,`unknown-field`,`invalid-record`],ke=(e,t,n,r)=>{if(!C(e)||e.slug!==`invalid-record`)return;let a=e.errors.find(e=>e.field===`_record`&&e.code!==void 0&&!Oe.includes(e.code))?.code;if(a===void 0)return;let o=t.find(e=>Object.hasOwn(e.checks??{},a))?.checks?.[a]?.label;if(o===void 0)return k(`checkRefused`);let s=Object.fromEntries(g(o,r).values.map(e=>[e,String(n[e]??``)]));return i({locale:r,messages:{label:o}},`label`,s)},Ae=(e,t,n,r,i)=>({before:e,record:i.record,etag:i.record[t]===n?i.etag:r.etag}),je=({model:e,view:t,by:n,rank:r,filter:i,drop:a,set:s,labelOf:l,titleOf:u})=>{let d=h(),f=c(),p=D(),{resources:m}=T(),g=O()?.locale??w(),[_,v]=(0,Y.useState)([]),y=(0,Y.useRef)(void 0),b=e=>v(t=>t.filter(t=>t.row.key!==e)),x=r?[n,r]:[n],S=M({mutationFn:e=>e(),onError:e=>f.show(G(e,k(`couldNotUndo`),{place:`board`})),onSettled:()=>p(e.name)}),C=async(t,r)=>{let i=a&&be(a,r.value);if(!i)throw Error(`The column ${r.label} takes no cards`);let s=o(e,t.record),c=typeof t.record.etag==`string`?t.record.etag:`*`,l=await i({resource:e.name,record:t.record,recordKey:s,etag:c,to:r.value,client:d});return{landed:(await d.get(e.name,s)).record[n]??null,...l&&{undo:l}}},E=async(t,r,i)=>{let a=o(e,t.record),s=typeof t.record.etag==`string`?t.record.etag:`*`,c=await d.update(e.name,a,{[i]:r.value},s),l=await d.get(e.name,a),u=H(e,[Ae(t.record,i,r.value,c,l)],[i]);return{landed:l.record[n]??null,...u.length>0&&{undo:()=>d.batchWrite(u)}}},A=(t,n)=>({landed:n.value,undo:()=>d.batchWrite(H(e,t,x))}),j=(e,t,r)=>{let i={...e,record:{...e.record,[n]:t.value}},a=r?.map(e=>e.key);v(n=>[...n.filter(t=>t.row.key!==e.key),{row:i,to:t.value,...a&&{order:a}}])},N=async(n,i,a)=>{if(!e.position?.after)return{index:a.index};let o=await U(d,e,t,n.record),s=De({model:e,rank:r,rows:a.rows,row:n,index:a.index,bounds:o,title:u(n)}),c=!s.place||s.place.bump===void 0&&s.place.index===a.rows.findIndex(e=>e.key===n.key);if(s.reason!==void 0&&f.show({state:`warning`,title:c?q(`notMoved`):q(`movedToPlace`,{place:s.place.index+1}),description:s.reason}),!c)return s.place.index!==a.index&&j(n,i,Z(a.rows,n,s.place.index).order),s.place},P=async(t,a,o)=>{let s=await N(t,a,o);if(!s)return;let{order:c}=Z(o.rows,t,s.index);return A(Ee(e,r,c,await d.batchWrite(Te(e,n,r,i,t,a,c,o.more,s.bump))),a)},F=M({mutationFn:async({row:t,to:i,place:c})=>{if(c&&!r)throw Error(`A board places a card only by its rank`);let l=t.record[n]??null;if(a&&i.value!==l)return C(t,i);if(s!==void 0&&i.value!==l)return E(t,i,s);if(c)return P(t,i,c);let u=typeof t.record.etag==`string`?t.record.etag:`*`,f=await d.update(e.name,o(e,t.record),{[n]:i.value},u);return A([{before:t.record,record:f.record,etag:f.etag}],i)},onMutate:({row:e,to:t,place:n})=>j(e,t,n&&Z(n.rows,e,n.index).order),onSuccess:(e,{row:t,to:r})=>{if(!e)return;let{landed:i,undo:a}=e;y.current!==void 0&&f.dismiss(y.current),y.current=void 0;let o=t.record[n]??null,s=i===o?o===r.value?k(`orderChanged`):k(`stayedIn`,{column:l(i)}):k(`movedTo`,{column:l(i)});if(!a){f.show({state:`success`,title:s});return}let c=f.show({state:`success`,title:s,action:{label:k(`undo`),onClick:()=>{f.dismiss(c),y.current=void 0,S.mutate(a)}}});y.current=c},onError:(e,{row:t,to:r})=>{b(t.key);let i=(t.record[n]??null)===r.value?k(`couldNotReorder`):k(`couldNotMoveTo`,{to:r.label}),a=ke(e,Object.values(m),t.record,g);f.show(a===void 0?G(e,i,{place:`board`,title:u(t)}):{state:`error`,title:i,description:a})},onSettled:async(t,n,{row:r})=>{await p(e.name),b(r.key)}});return{moves:_,move:(e,t,n)=>F.mutate({row:e,to:t,...n&&{place:n}})}},$=(e,t)=>{let n=e.data.current;if(!n?.column||!n.rows)return;let r=n.more===!0;if(n.sortable)return{column:n.column,rows:n.rows,more:r,index:n.sortable.index};let i=n.rows.some(e=>e.key===t.key);return{column:n.column,rows:n.rows,more:r,index:i?n.rows.length-1:n.rows.length}},Me=({model:e,view:t,display:n,fields:r,filter:i,orderBy:a,limit:o})=>{let c=y(e,t,n),l=ye(i,n.by,c),u=b(e,t,n),d=j(e.name),{boardDrops:p}=s(),m=t?.list?.drag,h=typeof m?.board==`string`?m.board:void 0,g=h===void 0?void 0:p?.[h],_=xe(m?.board,n.by),x=Ce(e,n.by,m?.board,g),C=e=>f(d,`update`)&&x(e),w=_===void 0||r.includes(_)||!Se(e,_)?r:[...r,_],T=l.some(e=>C(e.value)),E=v(e),D=m?.rank===!0&&E!==void 0&&ae(e,d)!==void 0,O=E?`${E} asc`:a,A=e=>c.find(t=>t.value===e)?.label??String(e),M=e=>String(e.labels[u.title]??e.record[u.title]??e.key),{moves:P,move:I}=je({model:e,view:t,by:n.by,rank:E,filter:i,drop:g,set:_,labelOf:A,titleOf:M}),[R,z]=(0,Y.useState)(),B=(0,Y.useRef)(!1),V=ie(F(ee,{activationConstraint:{distance:4}}),F(ne,{activationConstraint:{delay:250,tolerance:5}}),F(L,{keyboardCodes:{start:[`Space`],cancel:[`Escape`],end:[`Space`,`Enter`]},coordinateGetter:ce}));if(h!==void 0&&!g)return(0,X.jsx)(S,{children:k.rich(`noDrop`,{drop:h})});let H=e=>l.find(t=>J(t.value)===e),U=e=>e.record[n.by]??null,W=(e,t)=>C(U(e))&&C(t.value),G=(e,t)=>{if(!t)return{over:k(`noColumn`)};let n=D?$(t,e):void 0;if(!n)return{over:H(t.id)?.label??k(`noColumn`)};let r=n.rows.some(t=>t.key===e.key)?n.rows.length:n.rows.length+1;return{over:k(`placeOf`,{column:n.column.label,place:n.index+1,count:r}),place:k(`place`,{column:n.column.label,place:n.index+1})}},K=(e,t)=>{let n=(D?$(t,e)?.column:void 0)??H(t.id);return n!==void 0&&n.value!==U(e)&&!W(e,n)};return(0,X.jsxs)(re,{sensors:V,collisionDetection:se,onDragStart:({active:e})=>{B.current=!0,z(e.data.current.row)},onDragEnd:({active:e,over:t})=>{z(void 0),setTimeout(()=>B.current=!1);let n=e.data.current.row;if(!t)return;let r=D?$(t,n):void 0;if(!r){let e=H(t.id);e&&e.value!==U(n)&&W(n,e)&&I(n,e);return}let i=r.rows.findIndex(e=>e.key===n.key);if(i!==-1||W(n,r.column)){if(i===-1&&(g||_!==void 0))return I(n,r.column);i!==r.index&&I(n,r.column,{rows:r.rows,more:r.more,index:r.index})}},onDragCancel:()=>{z(void 0),setTimeout(()=>B.current=!1)},accessibility:{announcements:{onDragStart:({active:e})=>k(`pickedUp`,{title:M(e.data.current.row)}),onDragOver:({active:e,over:t})=>k(`isOver`,{title:M(e.data.current.row),over:G(e.data.current.row,t).over}),onDragEnd:({active:e,over:t})=>{let n=e.data.current.row;if(!t||K(n,t))return k(`putBack`,{title:M(n)});let r=G(n,t);return k(`wasMovedTo`,{title:M(n),to:r.place??r.over})},onDragCancel:({active:e})=>k(`cancelled`,{title:M(e.data.current.row)})},screenReaderInstructions:{draggable:k(D?T?`boardAnywhere`:`boardWithin`:`boardAcross`)}},children:[(0,X.jsx)(`div`,{className:`relative min-w-0 flex-1 overflow-x-auto`,children:(0,X.jsx)(`div`,{className:`flex snap-x items-start gap-3 pb-2`,children:l.map(r=>(0,X.jsx)(me,{model:e,view:t,display:n,column:r,fields:w,filter:i,orderBy:O,limit:o,moves:P,movable:C(r.value),placeable:D,dragged:()=>B.current},J(r.value)))})}),(0,X.jsx)(te,{children:R&&(0,X.jsx)(N,{model:e,view:t,display:u,row:R,swipe:!1})})]})};export{Me as BoardDisplay};
2
- //# debugId=cf630634-d78e-4bc2-9b85-8b2f18c6b47e