@protobase/ui 0.121.11 → 0.121.12
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.
- package/dist/account/messages.d.ts +2 -2
- package/dist/app/app.js +3 -2
- package/dist/app/change-confirm/messages.d.ts +2 -2
- package/dist/app/charts/messages.d.ts +2 -2
- package/dist/app/confirm-sign-in-messages.d.ts +2 -2
- package/dist/app/conversation/message-composer.d.ts +5 -1
- package/dist/app/conversation/message-composer.js +10 -3
- package/dist/app/conversation-page/conversation-header.js +1 -1
- package/dist/app/conversation-page/conversation-message.js +1 -1
- package/dist/app/conversation-page/conversation-messages.js +1 -1
- package/dist/app/conversation-page/conversation-page.d.ts +5 -4
- package/dist/app/conversation-page/conversation-page.js +22 -6
- package/dist/app/conversation-page/message-editor.js +1 -1
- package/dist/app/conversation-page/message-ops.d.ts +3 -1
- package/dist/app/conversation-page/message-ops.js +7 -1
- package/dist/app/conversation-page/messages.d.ts +2 -2
- package/dist/app/conversation-page/reply-labels.js +1 -1
- package/dist/app/conversation-page/thread-panel.js +1 -1
- package/dist/app/conversation-page/use-message-writes.js +1 -1
- package/dist/app/create/messages.d.ts +2 -2
- package/dist/app/custom-section.d.ts +1 -1
- package/dist/app/delete/messages.d.ts +2 -2
- package/dist/app/displays/list-cards.d.ts +1 -1
- package/dist/app/displays/messages.d.ts +2 -2
- package/dist/app/export/messages.d.ts +2 -2
- package/dist/app/field-types/widget-part.d.ts +1 -1
- package/dist/app/field-types/workflow/definition.d.ts +1 -1
- package/dist/app/field-types/workflow/messages.d.ts +2 -2
- package/dist/app/field-types/workflow-page/messages.d.ts +2 -2
- package/dist/app/file-viewers/messages.d.ts +2 -2
- package/dist/app/focus/messages.d.ts +2 -2
- package/dist/app/hand-order/messages.d.ts +2 -2
- package/dist/app/history/messages.d.ts +2 -2
- package/dist/app/import/messages.d.ts +2 -2
- package/dist/app/list-messages.d.ts +2 -2
- package/dist/app/messages.d.ts +2 -2
- package/dist/app/meta-gate-messages.d.ts +2 -2
- package/dist/app/new-version/messages.d.ts +2 -2
- package/dist/app/pages/custom-boundary.d.ts +1 -1
- package/dist/app/pages/custom-chosen.d.ts +1 -1
- package/dist/app/pages/messages.d.ts +2 -2
- package/dist/app/record-messages.d.ts +2 -2
- package/dist/app/record-row/messages.d.ts +2 -2
- package/dist/app/related-cards/messages.d.ts +2 -2
- package/dist/app/saved/messages.d.ts +2 -2
- package/dist/app/saved/saved-list.d.ts +1 -1
- package/dist/app/saved/use-favorite.d.ts +1 -1
- package/dist/app/searches/messages.d.ts +2 -2
- package/dist/app/searches/use-save-search.d.ts +1 -1
- package/dist/app/use-nav-recent.d.ts +2 -2
- package/dist/app/use-nav-recent.js +5 -4
- package/dist/app-shell/messages.d.ts +2 -2
- package/dist/app-shell/nav.d.ts +5 -3
- package/dist/app-shell/record-marks.d.ts +1 -1
- package/dist/app-shell/record-marks.js +5 -3
- package/dist/app-shell/sidebar-records.d.ts +1 -1
- package/dist/app-shell/sidebar-records.js +6 -1
- package/dist/assistant-dock/messages.d.ts +2 -2
- package/dist/auth/messages.d.ts +2 -2
- package/dist/calls/messages.d.ts +2 -2
- package/dist/chat/composer.d.ts +3 -1
- package/dist/chat/composer.js +6 -2
- package/dist/chat/messages.d.ts +2 -2
- package/dist/compact-table/messages.d.ts +2 -2
- package/dist/data/api-provider.d.ts +33 -0
- package/dist/data/meta-data.d.ts +4 -0
- package/dist/data/use-live-updates.d.ts +5 -2
- package/dist/data/use-live-updates.js +25 -3
- package/dist/data/use-meta.js +1 -0
- package/dist/data-grid/messages.d.ts +2 -2
- package/dist/filter-panel/messages.d.ts +2 -2
- package/dist/index.d.ts +5 -1
- package/dist/index.js +5 -1
- package/dist/invitations/messages.d.ts +2 -2
- package/dist/locale/en.js +7 -2
- package/dist/locale/en.json.d.ts +5 -0
- package/dist/locale/messages.d.ts +10 -0
- package/dist/locale/nl.js +7 -2
- package/dist/locale/texts-gate.d.ts +1 -1
- package/dist/notifications/bell/messages.d.ts +2 -2
- package/dist/organizations/messages.d.ts +2 -2
- package/dist/package.js +1 -1
- package/dist/plugins/before-sign-in.d.ts +1 -1
- package/dist/plugins/plugin-api.exports.js +5 -1
- package/dist/primitives/messages.d.ts +2 -2
- package/dist/record-view/messages.d.ts +2 -2
- package/dist/relay/count-unread.d.ts +12 -0
- package/dist/relay/count-unread.js +34 -0
- package/dist/relay/relay-context.d.ts +17 -0
- package/dist/relay/relay-context.js +23 -0
- package/dist/relay/relay-provider.d.ts +11 -0
- package/dist/relay/relay-provider.js +58 -0
- package/dist/relay/relay-store.d.ts +31 -0
- package/dist/relay/relay-store.js +77 -0
- package/dist/relay/typing-line.d.ts +11 -0
- package/dist/relay/typing-line.js +30 -0
- package/dist/relay/typing.d.ts +37 -0
- package/dist/relay/typing.js +78 -0
- package/dist/relay/unread.d.ts +30 -0
- package/dist/relay/unread.js +35 -0
- package/dist/relay/use-relay-marks.d.ts +11 -0
- package/dist/relay/use-relay-marks.js +53 -0
- package/dist/relay/use-typing-sender.d.ts +11 -0
- package/dist/relay/use-typing-sender.js +32 -0
- package/dist/relay/use-unread-counts.d.ts +9 -0
- package/dist/relay/use-unread-counts.js +61 -0
- package/dist/relay/use-view-channel.d.ts +7 -0
- package/dist/relay/use-view-channel.js +21 -0
- package/dist/shell/assets/{account-page-Cz2-SP3Z.js → account-page-BsAc4o17.js} +2 -2
- package/dist/shell/assets/app-Bb88M0VJ.js +36 -0
- package/dist/shell/assets/{assistant-shell-CeW3U4tB.js → assistant-shell-CdVAnpMe.js} +2 -2
- package/dist/shell/assets/board-display-DKT7398I.js +2 -0
- package/dist/shell/assets/calendar-display-0c2dGTmG.js +2 -0
- package/dist/shell/assets/{call-rings-DwSrOHCr.js → call-rings-BV5na0xp.js} +2 -2
- package/dist/shell/assets/{calls-D1l4an28.js → calls-n9IoOXzL.js} +2 -2
- package/dist/shell/assets/{circle-alert-BEHXqTnA.js → circle-alert-kISSXwIV.js} +2 -2
- package/dist/shell/assets/{composed-page-CzszGryH.js → composed-page-hn7I0Ulk.js} +2 -2
- package/dist/shell/assets/{composer-section-v7aZuaJs.js → composer-section-Cb1kOpwt.js} +2 -2
- package/dist/shell/assets/{connect-route-B68buTBD.js → connect-route-l21XyxhS.js} +2 -2
- package/dist/shell/assets/{copy-field-CpG80Fod.js → copy-field-D22CFeg3.js} +2 -2
- package/dist/shell/assets/create-route-CSe9DhbY.js +2 -0
- package/dist/shell/assets/{custom-step-container-field-CooxBIkH.js → custom-step-container-field-C5l4j0FI.js} +4 -4
- package/dist/shell/assets/embedded-list-DjvOszEj.js +3 -0
- package/dist/shell/assets/en-DnsB2haa.js +2 -0
- package/dist/shell/assets/{export-dialog-CYGeeQBj.js → export-dialog-Bh3TSYyL.js} +2 -2
- package/dist/shell/assets/export-worker-DbK8hf_0.js +15 -0
- package/dist/shell/assets/{first-organization-page-B_TzRjNV.js → first-organization-page-BtfoRENE.js} +2 -2
- package/dist/shell/assets/{graph-view-DJGoThHW.js → graph-view-C4fwqz7Q.js} +2 -2
- package/dist/shell/assets/{group-donut-CtKQKKqq.js → group-donut-Bcnc0EaM.js} +2 -2
- package/dist/shell/assets/{guest-call-page-C2N1bb85.js → guest-call-page-D09z7u-V.js} +3 -3
- package/dist/shell/assets/{html-viewer-DHWsvJdf.js → html-viewer-BtwOBvDg.js} +2 -2
- package/dist/shell/assets/{import-dialog-BAmU6oMk.js → import-dialog-Dwx_yEfS.js} +2 -2
- package/dist/shell/assets/{import-table-dialog-C1TyvD2-.js → import-table-dialog-T3V3RoDY.js} +2 -2
- package/dist/shell/assets/{index-fJt7aRZ4.js → index-DvNpfiwE.js} +1 -1
- package/dist/shell/assets/invitations-page-X90SMPsK.js +2 -0
- package/dist/shell/assets/{layout-grid-CPhU6Mm7.js → layout-grid-Bp_eP5eU.js} +2 -2
- package/dist/shell/assets/{legend-item-DYmqDhq7.js → legend-item-CEZ-8FXv.js} +2 -2
- package/dist/shell/assets/list-page-BUtWO_Zd.js +4 -0
- package/dist/shell/assets/{maplibre-DXJkokbV.js → maplibre-Cv3xuTP_.js} +2 -2
- package/dist/shell/assets/{markdown-content-9-JeVEDq.js → markdown-content-jO-R6jpp.js} +2 -2
- package/dist/shell/assets/members-page-BZyldmfB.js +2 -0
- package/dist/shell/assets/{message-content-XnNocBEs.js → message-content-DJEa6jyY.js} +2 -2
- package/dist/shell/assets/messages-BIP4feL2.js +2 -0
- package/dist/shell/assets/nl-Ce2dHlet.js +2 -0
- package/dist/shell/assets/organization-page-CjQ7oJk4.js +2 -0
- package/dist/shell/assets/organizations-page-2cKqhNJh.js +2 -0
- package/dist/shell/assets/parse-worker-MvbeuzYJ.js +35 -0
- package/dist/shell/assets/{pending-invitation-row-C2tovkDY.js → pending-invitation-row-Cef2WdTI.js} +2 -2
- package/dist/shell/assets/{period-chart-DuLmYnEh.js → period-chart-BPq3Knz8.js} +2 -2
- package/dist/shell/assets/{person-row-B4SoiUz7.js → person-row-BLVor9QR.js} +2 -2
- package/dist/shell/assets/public-form-page-CMaHcrdf.js +2 -0
- package/dist/shell/assets/record-lines-jznjVtIQ.js +2 -0
- package/dist/shell/assets/{record-map-CUyHGUuT.js → record-map-9KEjeN_F.js} +2 -2
- package/dist/shell/assets/{record-opens-DtAuS5Iw.js → record-opens-CQLXpqJS.js} +2 -2
- package/dist/shell/assets/record-page-JFlxtSyg.js +3 -0
- package/dist/shell/assets/{record-preview-CF37imVo.js → record-preview-CUs7j-lh.js} +2 -2
- package/dist/shell/assets/{records-map-CLUkYUGA.js → records-map-CLF98-H0.js} +2 -2
- package/dist/shell/assets/render-node-DoB1k2WS.js +3 -0
- package/dist/shell/assets/reorder-button-Cg-WKutS.js +2 -0
- package/dist/shell/assets/{run-trace-view-B02ogfCg.js → run-trace-view-CmujelWd.js} +2 -2
- package/dist/shell/assets/{runner-install-field-B7d2ZTdV.js → runner-install-field-wpoIgnks.js} +2 -2
- package/dist/shell/assets/{runtime-update-LXdNfKZi.js → runtime-update-BaNRaM6l.js} +2 -2
- package/dist/shell/assets/shared-protobase-ui-630Rm7Jd.js +1 -0
- package/dist/shell/assets/sheet-source-7m5PMllh.js +3 -0
- package/dist/shell/assets/sign-in-policy-page-GgyC3l_6.js +2 -0
- package/dist/shell/assets/start-block-queries-B8K1ZsVK.js +2 -0
- package/dist/shell/assets/step-catalog-Dktva0VF.js +2 -0
- package/dist/shell/assets/{step-panel-C6qUOSA3.js → step-panel-CjUWMleA.js} +2 -2
- package/dist/shell/assets/timeline-display-CCPZ8VKv.js +2 -0
- package/dist/shell/assets/{trash-BiidFj0N.js → trash-BfIEK322.js} +2 -2
- package/dist/shell/assets/{update-set-B0qCO072.js → update-set-Drag3hOc.js} +2 -2
- package/dist/shell/assets/use-calendar-move-fM4kqYZF.js +2 -0
- package/dist/shell/assets/{use-display-rows-BpKLVhjZ.js → use-display-rows-CEB1AStC.js} +2 -2
- package/dist/shell/assets/use-my-invitations-DxoZihem.js +2 -0
- package/dist/shell/assets/{use-paged-search-BUf2evnc.js → use-paged-search-tHTP8FRX.js} +2 -2
- package/dist/shell/assets/{use-run-trace-D3CBWHfm.js → use-run-trace-b8SpFDRU.js} +2 -2
- package/dist/shell/assets/{use-workflow-page-DjHS4PFJ.js → use-workflow-page-oeKIRs_g.js} +2 -2
- package/dist/shell/assets/{use-workflow-types-D0XJQUAl.js → use-workflow-types-D1TLbN3E.js} +2 -2
- package/dist/shell/assets/{workflow-canvas-D1yNhbc_.js → workflow-canvas-CJQ0Ll0M.js} +4 -4
- package/dist/shell/assets/{workflow-field-BJb4Ns2G.js → workflow-field-CpGs8ZXh.js} +3 -3
- package/dist/shell/assets/{workflow-graph-editor-DzpB5Wg4.js → workflow-graph-editor-CLlL2jNQ.js} +2 -2
- package/dist/shell/assets/{workflow-run-field-BrkKGYZ3.js → workflow-run-field-R43RqM3Z.js} +3 -3
- package/dist/shell/assets/workflow-status-field-BaytFzWg.js +2 -0
- package/dist/shell/assets/workflow-workbench-DYClQZZ1.js +4 -0
- package/dist/shell/index.html +3 -3
- package/dist/shell/protobase.shell.json +2 -2
- package/dist/shell/protobase.sw.js +2 -2
- package/dist/shell-source-maps/assets/{account-page-Cz2-SP3Z.js.map → account-page-BsAc4o17.js.map} +1 -1
- package/dist/shell-source-maps/assets/app-Bb88M0VJ.js.map +1 -0
- package/dist/shell-source-maps/assets/{assistant-shell-CeW3U4tB.js.map → assistant-shell-CdVAnpMe.js.map} +1 -1
- package/dist/shell-source-maps/assets/{board-display-tgOCC0v0.js.map → board-display-DKT7398I.js.map} +1 -1
- package/dist/shell-source-maps/assets/{calendar-display-DRWz8QYh.js.map → calendar-display-0c2dGTmG.js.map} +1 -1
- package/dist/shell-source-maps/assets/{call-rings-DwSrOHCr.js.map → call-rings-BV5na0xp.js.map} +1 -1
- package/dist/shell-source-maps/assets/{calls-D1l4an28.js.map → calls-n9IoOXzL.js.map} +1 -1
- package/dist/shell-source-maps/assets/{circle-alert-BEHXqTnA.js.map → circle-alert-kISSXwIV.js.map} +1 -1
- package/dist/shell-source-maps/assets/{composed-page-CzszGryH.js.map → composed-page-hn7I0Ulk.js.map} +1 -1
- package/dist/shell-source-maps/assets/{composer-section-v7aZuaJs.js.map → composer-section-Cb1kOpwt.js.map} +1 -1
- package/dist/shell-source-maps/assets/{connect-route-B68buTBD.js.map → connect-route-l21XyxhS.js.map} +1 -1
- package/dist/shell-source-maps/assets/{copy-field-CpG80Fod.js.map → copy-field-D22CFeg3.js.map} +1 -1
- package/dist/shell-source-maps/assets/{create-route-BMWFJF8g.js.map → create-route-CSe9DhbY.js.map} +1 -1
- package/dist/shell-source-maps/assets/{custom-step-container-field-CooxBIkH.js.map → custom-step-container-field-C5l4j0FI.js.map} +1 -1
- package/dist/shell-source-maps/assets/{embedded-list-nfw7Gvsq.js.map → embedded-list-DjvOszEj.js.map} +1 -1
- package/dist/shell-source-maps/assets/en-DnsB2haa.js.map +1 -0
- package/dist/shell-source-maps/assets/{export-dialog-CYGeeQBj.js.map → export-dialog-Bh3TSYyL.js.map} +1 -1
- package/dist/shell-source-maps/assets/export-worker-DbK8hf_0.js.map +1 -0
- package/dist/shell-source-maps/assets/{first-organization-page-B_TzRjNV.js.map → first-organization-page-BtfoRENE.js.map} +1 -1
- package/dist/shell-source-maps/assets/{graph-view-DJGoThHW.js.map → graph-view-C4fwqz7Q.js.map} +1 -1
- package/dist/shell-source-maps/assets/{group-donut-CtKQKKqq.js.map → group-donut-Bcnc0EaM.js.map} +1 -1
- package/dist/shell-source-maps/assets/{guest-call-page-C2N1bb85.js.map → guest-call-page-D09z7u-V.js.map} +1 -1
- package/dist/shell-source-maps/assets/{html-viewer-DHWsvJdf.js.map → html-viewer-BtwOBvDg.js.map} +1 -1
- package/dist/shell-source-maps/assets/{import-dialog-BAmU6oMk.js.map → import-dialog-Dwx_yEfS.js.map} +1 -1
- package/dist/shell-source-maps/assets/{import-table-dialog-C1TyvD2-.js.map → import-table-dialog-T3V3RoDY.js.map} +1 -1
- package/dist/shell-source-maps/assets/{invitations-page-D_Z4B5Uu.js.map → invitations-page-X90SMPsK.js.map} +1 -1
- package/dist/shell-source-maps/assets/{layout-grid-CPhU6Mm7.js.map → layout-grid-Bp_eP5eU.js.map} +1 -1
- package/dist/shell-source-maps/assets/{legend-item-DYmqDhq7.js.map → legend-item-CEZ-8FXv.js.map} +1 -1
- package/dist/shell-source-maps/assets/{list-page-Cl4AAwTy.js.map → list-page-BUtWO_Zd.js.map} +1 -1
- package/dist/shell-source-maps/assets/{maplibre-DXJkokbV.js.map → maplibre-Cv3xuTP_.js.map} +1 -1
- package/dist/shell-source-maps/assets/{markdown-content-9-JeVEDq.js.map → markdown-content-jO-R6jpp.js.map} +1 -1
- package/dist/shell-source-maps/assets/{members-page-BIYD2hUu.js.map → members-page-BZyldmfB.js.map} +1 -1
- package/dist/shell-source-maps/assets/{message-content-XnNocBEs.js.map → message-content-DJEa6jyY.js.map} +1 -1
- package/dist/shell-source-maps/assets/{messages-DhhNH_o2.js.map → messages-BIP4feL2.js.map} +1 -1
- package/dist/shell-source-maps/assets/nl-Ce2dHlet.js.map +1 -0
- package/dist/shell-source-maps/assets/{organization-page-C7rfPxxc.js.map → organization-page-CjQ7oJk4.js.map} +1 -1
- package/dist/shell-source-maps/assets/{organizations-page-B5wqljdT.js.map → organizations-page-2cKqhNJh.js.map} +1 -1
- package/dist/shell-source-maps/assets/parse-worker-MvbeuzYJ.js.map +1 -0
- package/dist/shell-source-maps/assets/{pending-invitation-row-C2tovkDY.js.map → pending-invitation-row-Cef2WdTI.js.map} +1 -1
- package/dist/shell-source-maps/assets/{period-chart-DuLmYnEh.js.map → period-chart-BPq3Knz8.js.map} +1 -1
- package/dist/shell-source-maps/assets/{person-row-B4SoiUz7.js.map → person-row-BLVor9QR.js.map} +1 -1
- package/dist/shell-source-maps/assets/{public-form-page-BRHFIOvT.js.map → public-form-page-CMaHcrdf.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-lines-Bt1Un_65.js.map → record-lines-jznjVtIQ.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-map-CUyHGUuT.js.map → record-map-9KEjeN_F.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-opens-DtAuS5Iw.js.map → record-opens-CQLXpqJS.js.map} +1 -1
- package/dist/shell-source-maps/assets/record-page-JFlxtSyg.js.map +1 -0
- package/dist/shell-source-maps/assets/{record-preview-CF37imVo.js.map → record-preview-CUs7j-lh.js.map} +1 -1
- package/dist/shell-source-maps/assets/{records-map-CLUkYUGA.js.map → records-map-CLF98-H0.js.map} +1 -1
- package/dist/shell-source-maps/assets/render-node-DoB1k2WS.js.map +1 -0
- package/dist/shell-source-maps/assets/{reorder-button-BozBSEHe.js.map → reorder-button-Cg-WKutS.js.map} +1 -1
- package/dist/shell-source-maps/assets/{run-trace-view-B02ogfCg.js.map → run-trace-view-CmujelWd.js.map} +1 -1
- package/dist/shell-source-maps/assets/{runner-install-field-B7d2ZTdV.js.map → runner-install-field-wpoIgnks.js.map} +1 -1
- package/dist/shell-source-maps/assets/{runtime-update-LXdNfKZi.js.map → runtime-update-BaNRaM6l.js.map} +1 -1
- package/dist/shell-source-maps/assets/{sheet-source-G8rOez-U.js.map → sheet-source-7m5PMllh.js.map} +1 -1
- package/dist/shell-source-maps/assets/{sign-in-policy-page-DOTM6MOA.js.map → sign-in-policy-page-GgyC3l_6.js.map} +1 -1
- package/dist/shell-source-maps/assets/{start-block-queries-Dfg8kMRu.js.map → start-block-queries-B8K1ZsVK.js.map} +1 -1
- package/dist/shell-source-maps/assets/{step-catalog-CoBzB5jS.js.map → step-catalog-Dktva0VF.js.map} +1 -1
- package/dist/shell-source-maps/assets/{step-panel-C6qUOSA3.js.map → step-panel-CjUWMleA.js.map} +1 -1
- package/dist/shell-source-maps/assets/{timeline-display-5BAMjA9V.js.map → timeline-display-CCPZ8VKv.js.map} +1 -1
- package/dist/shell-source-maps/assets/{trash-BiidFj0N.js.map → trash-BfIEK322.js.map} +1 -1
- package/dist/shell-source-maps/assets/{update-set-B0qCO072.js.map → update-set-Drag3hOc.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-calendar-move-BGAc9T_n.js.map → use-calendar-move-fM4kqYZF.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-display-rows-BpKLVhjZ.js.map → use-display-rows-CEB1AStC.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-my-invitations-BQKKClDc.js.map → use-my-invitations-DxoZihem.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-paged-search-BUf2evnc.js.map → use-paged-search-tHTP8FRX.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-run-trace-D3CBWHfm.js.map → use-run-trace-b8SpFDRU.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-workflow-page-DjHS4PFJ.js.map → use-workflow-page-oeKIRs_g.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-workflow-types-D0XJQUAl.js.map → use-workflow-types-D1TLbN3E.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-canvas-D1yNhbc_.js.map → workflow-canvas-CJQ0Ll0M.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-field-BJb4Ns2G.js.map → workflow-field-CpGs8ZXh.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-graph-editor-DzpB5Wg4.js.map → workflow-graph-editor-CLlL2jNQ.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-run-field-BrkKGYZ3.js.map → workflow-run-field-R43RqM3Z.js.map} +1 -1
- package/dist/shell-source-maps/assets/workflow-status-field-BaytFzWg.js.map +1 -0
- package/dist/shell-source-maps/assets/{workflow-workbench-C-DxYJbt.js.map → workflow-workbench-DYClQZZ1.js.map} +1 -1
- package/dist/status/messages.d.ts +2 -2
- package/dist/users/messages.d.ts +2 -2
- package/package.json +5 -5
- package/dist/shell/assets/app-B3ocPAqs.js +0 -34
- package/dist/shell/assets/board-display-tgOCC0v0.js +0 -2
- package/dist/shell/assets/calendar-display-DRWz8QYh.js +0 -2
- package/dist/shell/assets/create-route-BMWFJF8g.js +0 -2
- package/dist/shell/assets/embedded-list-nfw7Gvsq.js +0 -3
- package/dist/shell/assets/en-0TxR0Vfb.js +0 -2
- package/dist/shell/assets/export-worker-AFqbgGzG.js +0 -15
- package/dist/shell/assets/invitations-page-D_Z4B5Uu.js +0 -2
- package/dist/shell/assets/list-page-Cl4AAwTy.js +0 -4
- package/dist/shell/assets/members-page-BIYD2hUu.js +0 -2
- package/dist/shell/assets/messages-DhhNH_o2.js +0 -2
- package/dist/shell/assets/nl-mDiTKi5y.js +0 -2
- package/dist/shell/assets/organization-page-C7rfPxxc.js +0 -2
- package/dist/shell/assets/organizations-page-B5wqljdT.js +0 -2
- package/dist/shell/assets/parse-worker-C5wWzRYH.js +0 -35
- package/dist/shell/assets/public-form-page-BRHFIOvT.js +0 -2
- package/dist/shell/assets/record-lines-Bt1Un_65.js +0 -2
- package/dist/shell/assets/record-page-DfvcIO5T.js +0 -3
- package/dist/shell/assets/render-node-CK68QvoX.js +0 -3
- package/dist/shell/assets/reorder-button-BozBSEHe.js +0 -2
- package/dist/shell/assets/shared-protobase-ui-B7gMFgle.js +0 -1
- package/dist/shell/assets/sheet-source-G8rOez-U.js +0 -3
- package/dist/shell/assets/sign-in-policy-page-DOTM6MOA.js +0 -2
- package/dist/shell/assets/start-block-queries-Dfg8kMRu.js +0 -2
- package/dist/shell/assets/step-catalog-CoBzB5jS.js +0 -2
- package/dist/shell/assets/timeline-display-5BAMjA9V.js +0 -2
- package/dist/shell/assets/use-calendar-move-BGAc9T_n.js +0 -2
- package/dist/shell/assets/use-my-invitations-BQKKClDc.js +0 -2
- package/dist/shell/assets/workflow-status-field-dbB3IT68.js +0 -2
- package/dist/shell/assets/workflow-workbench-C-DxYJbt.js +0 -4
- package/dist/shell-source-maps/assets/app-B3ocPAqs.js.map +0 -1
- package/dist/shell-source-maps/assets/en-0TxR0Vfb.js.map +0 -1
- package/dist/shell-source-maps/assets/export-worker-AFqbgGzG.js.map +0 -1
- package/dist/shell-source-maps/assets/nl-mDiTKi5y.js.map +0 -1
- package/dist/shell-source-maps/assets/parse-worker-C5wWzRYH.js.map +0 -1
- package/dist/shell-source-maps/assets/record-page-DfvcIO5T.js.map +0 -1
- package/dist/shell-source-maps/assets/render-node-CK68QvoX.js.map +0 -1
- package/dist/shell-source-maps/assets/workflow-status-field-dbB3IT68.js.map +0 -1
|
@@ -60,6 +60,7 @@ var exports = [
|
|
|
60
60
|
"StepList",
|
|
61
61
|
"Textarea",
|
|
62
62
|
"ToneEdge",
|
|
63
|
+
"TypingLine",
|
|
63
64
|
"allowDelayMs",
|
|
64
65
|
"buttonClass",
|
|
65
66
|
"chatDayLabel",
|
|
@@ -129,8 +130,11 @@ var exports = [
|
|
|
129
130
|
"useSignedInUser",
|
|
130
131
|
"useStatuses",
|
|
131
132
|
"useToast",
|
|
133
|
+
"useTypers",
|
|
134
|
+
"useTypingSender",
|
|
132
135
|
"useUnreadNotifications",
|
|
133
|
-
"useUpdateRecord"
|
|
136
|
+
"useUpdateRecord",
|
|
137
|
+
"useViewChannel"
|
|
134
138
|
];
|
|
135
139
|
//#endregion
|
|
136
140
|
export { exports };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MessageValue } from "../locale/messages.js";
|
|
2
2
|
//#region src/primitives/messages.d.ts
|
|
3
3
|
export declare const text: {
|
|
4
|
-
(id: "
|
|
5
|
-
rich(id: "
|
|
4
|
+
(id: "remove" | "close" | "loading" | "next" | "previous" | "dragToClose", values?: Record<string, MessageValue>): string;
|
|
5
|
+
rich(id: "remove" | "close" | "loading" | "next" | "previous" | "dragToClose", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
|
|
6
6
|
};
|
|
7
7
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MessageValue } from "../locale/messages.js";
|
|
2
2
|
//#region src/record-view/messages.d.ts
|
|
3
3
|
export declare const text: {
|
|
4
|
-
(id: "
|
|
5
|
-
rich(id: "
|
|
4
|
+
(id: "tabs" | "actions" | "saving" | "headingCount" | "headingCountRecords" | "savedDifferent" | "example" | "savedThis" | "keepMine" | "useTheirs" | "savedAgo" | "notSavedRetrying" | "lastEditedBy" | "lastUpdated" | "viewing", values?: Record<string, MessageValue>): string;
|
|
5
|
+
rich(id: "tabs" | "actions" | "saving" | "headingCount" | "headingCountRecords" | "savedDifferent" | "example" | "savedThis" | "keepMine" | "useTheirs" | "savedAgo" | "notSavedRetrying" | "lastEditedBy" | "lastUpdated" | "viewing", values: Record<string, MessageValue | import("react").ReactNode>): import("react").ReactNode;
|
|
6
6
|
};
|
|
7
7
|
//#endregion
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UnreadCounts } from "./unread.js";
|
|
2
|
+
import { Client } from "@protobase/client";
|
|
3
|
+
import { ConversationPageModel, ResourceModel } from "@protobase/schema";
|
|
4
|
+
//#region src/relay/count-unread.d.ts
|
|
5
|
+
type Models = Record<string, ResourceModel>;
|
|
6
|
+
/**
|
|
7
|
+
* The unread messages of `me` in the conversations `keys`, read as them in two requests: their read positions, then the
|
|
8
|
+
* messages after each one's own position by someone else, counted per conversation by the database. A conversation
|
|
9
|
+
* never opened counts from its first message. Nothing is counted when the read position resource has no `.author()`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const countUnread: (client: Client, models: Models, page: ConversationPageModel, keys: readonly string[], me: string) => Promise<UnreadCounts>;
|
|
12
|
+
//#endregion
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { literal, unreadFilter } from "./unread.js";
|
|
2
|
+
//#region src/relay/count-unread.ts
|
|
3
|
+
const byGroup = (groups) => Object.fromEntries(groups.map(({ value, count }) => [String(value), count]));
|
|
4
|
+
/**
|
|
5
|
+
* The unread messages of `me` in the conversations `keys`, read as them in two requests: their read positions, then the
|
|
6
|
+
* messages after each one's own position by someone else, counted per conversation by the database. A conversation
|
|
7
|
+
* never opened counts from its first message. Nothing is counted when the read position resource has no `.author()`.
|
|
8
|
+
*/
|
|
9
|
+
const countUnread = async (client, models, page, keys, me) => {
|
|
10
|
+
const position = page.readPosition;
|
|
11
|
+
const messages = models[page.resource];
|
|
12
|
+
if (!position || !messages || keys.length === 0) return {};
|
|
13
|
+
const author = models[position.resource]?.author;
|
|
14
|
+
if (author === void 0) return {};
|
|
15
|
+
const which = keys.map((key) => `${position.field} = ${literal(key)}`).join(" OR ");
|
|
16
|
+
const positions = await client.list(position.resource, {
|
|
17
|
+
filter: `${author} = ${JSON.stringify(me)} AND (${which})`,
|
|
18
|
+
pageSize: keys.length,
|
|
19
|
+
fields: [position.field, position.message]
|
|
20
|
+
});
|
|
21
|
+
const readTo = new Map(positions.items.map((item) => [String(item[position.field]), Number(item[position.message] ?? 0)]));
|
|
22
|
+
const filter = unreadFilter(page.field, messages.primaryKey[0], page.sender, me, keys.map((key) => ({
|
|
23
|
+
key,
|
|
24
|
+
readTo: readTo.get(key) ?? 0
|
|
25
|
+
})));
|
|
26
|
+
const counted = byGroup((await client.aggregate(page.resource, {
|
|
27
|
+
groupBy: page.field,
|
|
28
|
+
filter,
|
|
29
|
+
limit: keys.length
|
|
30
|
+
})).groups);
|
|
31
|
+
return Object.fromEntries(keys.map((key) => [key, counted[key] ?? 0]));
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { countUnread };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RelayStore } from "./relay-store.js";
|
|
2
|
+
import { RelayClient } from "@protobase/client";
|
|
3
|
+
//#region src/relay/relay-context.d.ts
|
|
4
|
+
/** The app's relay as the page follows it, for someone signed in to an app with `realtime.relay` (see `RelayProvider`). */
|
|
5
|
+
export type RelayContextValue = {
|
|
6
|
+
relay: RelayClient;
|
|
7
|
+
store: RelayStore;
|
|
8
|
+
me: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const RelayContext: import("react").Context<RelayContextValue | undefined>;
|
|
11
|
+
/** The relay the page follows, undefined in an app without one or for a visitor. */
|
|
12
|
+
export declare const useRelay: () => RelayContextValue | undefined;
|
|
13
|
+
/** Who of the others types on the channel `<resource>/<key>` now, by user id; empty without the relay. */
|
|
14
|
+
export declare const useTypers: (channel: string) => string[];
|
|
15
|
+
/** The channels on which someone other than the reader types now. */
|
|
16
|
+
export declare const useTypingChannels: () => Set<string>;
|
|
17
|
+
//#endregion
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { typersOn } from "./typing.js";
|
|
2
|
+
import { createContext, useContext, useSyncExternalStore } from "react";
|
|
3
|
+
//#region src/relay/relay-context.ts
|
|
4
|
+
const RelayContext = createContext(void 0);
|
|
5
|
+
/** The relay the page follows, undefined in an app without one or for a visitor. */
|
|
6
|
+
const useRelay = () => useContext(RelayContext);
|
|
7
|
+
const nobody = () => () => {};
|
|
8
|
+
const none = () => void 0;
|
|
9
|
+
/** Who of the others types on the channel `<resource>/<key>` now, by user id; empty without the relay. */
|
|
10
|
+
const useTypers = (channel) => {
|
|
11
|
+
const context = useRelay();
|
|
12
|
+
const typers = useSyncExternalStore(context?.store.subscribe ?? nobody, context?.store.typers ?? none, context?.store.typers ?? none);
|
|
13
|
+
return typers && context ? typersOn(typers, channel, context.me) : [];
|
|
14
|
+
};
|
|
15
|
+
/** The channels on which someone other than the reader types now. */
|
|
16
|
+
const useTypingChannels = () => {
|
|
17
|
+
const context = useRelay();
|
|
18
|
+
const typers = useSyncExternalStore(context?.store.subscribe ?? nobody, context?.store.typers ?? none, context?.store.typers ?? none);
|
|
19
|
+
if (!typers || !context) return /* @__PURE__ */ new Set();
|
|
20
|
+
return new Set([...typers.keys()].filter((channel) => typersOn(typers, channel, context.me).length > 0));
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { RelayContext, useRelay, useTypers, useTypingChannels };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/relay/relay-provider.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Follows the app's realtime relay for someone signed in, when the app has one: one socket for the page, which the
|
|
5
|
+
* conversation pages, the sidebar and the live updates beneath it share. It tells the relay the person is away while
|
|
6
|
+
* the page is hidden, and online again once it shows, connecting again at once then if it was down.
|
|
7
|
+
*/
|
|
8
|
+
export declare const RelayProvider: ({ children }: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}) => import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { useOptionalAuth } from "../auth/auth-provider.js";
|
|
2
|
+
import { useClient } from "../data/api-provider.js";
|
|
3
|
+
import { useAdminMeta } from "../app/meta-gate.js";
|
|
4
|
+
import { RelayContext } from "./relay-context.js";
|
|
5
|
+
import { createRelayStore } from "./relay-store.js";
|
|
6
|
+
import { useEffect, useState } from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
//#region src/relay/relay-provider.tsx
|
|
9
|
+
/** Whether the page is in view: `away` while it is hidden, as the relay's presence takes it. */
|
|
10
|
+
const presenceOfPage = () => document.visibilityState === "hidden" ? "away" : "online";
|
|
11
|
+
/**
|
|
12
|
+
* Follows the app's realtime relay for someone signed in, when the app has one: one socket for the page, which the
|
|
13
|
+
* conversation pages, the sidebar and the live updates beneath it share. It tells the relay the person is away while
|
|
14
|
+
* the page is hidden, and online again once it shows, connecting again at once then if it was down.
|
|
15
|
+
*/
|
|
16
|
+
const RelayProvider = ({ children }) => {
|
|
17
|
+
const meta = useAdminMeta();
|
|
18
|
+
const client = useClient();
|
|
19
|
+
const auth = useOptionalAuth();
|
|
20
|
+
const me = auth?.state.kind === "signed-in" ? auth.state.user.id : void 0;
|
|
21
|
+
const on = Boolean(meta.relay) && me !== void 0;
|
|
22
|
+
const [value, setValue] = useState();
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (!on) return;
|
|
25
|
+
const store = createRelayStore();
|
|
26
|
+
const stop = client.relay.follow(store.handlers);
|
|
27
|
+
const tell = () => {
|
|
28
|
+
client.relay.presence(presenceOfPage());
|
|
29
|
+
if (presenceOfPage() === "online") client.relay.reconnect();
|
|
30
|
+
};
|
|
31
|
+
const online = () => client.relay.reconnect();
|
|
32
|
+
tell();
|
|
33
|
+
document.addEventListener("visibilitychange", tell);
|
|
34
|
+
window.addEventListener("online", online);
|
|
35
|
+
setValue({
|
|
36
|
+
relay: client.relay,
|
|
37
|
+
store,
|
|
38
|
+
me
|
|
39
|
+
});
|
|
40
|
+
return () => {
|
|
41
|
+
document.removeEventListener("visibilitychange", tell);
|
|
42
|
+
window.removeEventListener("online", online);
|
|
43
|
+
stop();
|
|
44
|
+
store.stop();
|
|
45
|
+
setValue(void 0);
|
|
46
|
+
};
|
|
47
|
+
}, [
|
|
48
|
+
client,
|
|
49
|
+
on,
|
|
50
|
+
me
|
|
51
|
+
]);
|
|
52
|
+
return /* @__PURE__ */ jsx(RelayContext.Provider, {
|
|
53
|
+
value,
|
|
54
|
+
children
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { RelayProvider };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Typers } from "./typing.js";
|
|
2
|
+
import { RelayHandlers, RelayNotice } from "@protobase/client";
|
|
3
|
+
//#region src/relay/relay-store.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* What the page heard from the relay, for the places that show it: who types on which channel, kept until their typing
|
|
6
|
+
* runs out, and the notices and reconnects, handed to whoever listens. `handlers` follows the relay; `stop` ends it.
|
|
7
|
+
*/
|
|
8
|
+
export declare const createRelayStore: () => {
|
|
9
|
+
typers: () => Typers;
|
|
10
|
+
subscribe: (listener: () => void) => () => undefined;
|
|
11
|
+
onNotice: (listener: (notice: RelayNotice) => void) => () => undefined;
|
|
12
|
+
onResync: (listener: () => void) => () => undefined;
|
|
13
|
+
/** Remembers a message the page itself sent, by key, which no unread count takes; only the latest few. */
|
|
14
|
+
sent: (key: string) => void;
|
|
15
|
+
own: () => Set<string>;
|
|
16
|
+
/** Says the page shows the channel's records, such as an open conversation, until the returned function is called. */
|
|
17
|
+
view: (channel: string) => () => void;
|
|
18
|
+
/** Whether the page shows the channel now. */
|
|
19
|
+
viewing: (channel: string) => boolean;
|
|
20
|
+
/** Hears of each channel the page starts to show. */
|
|
21
|
+
onView: (listener: (channel: string) => void) => () => undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the page shows what the notice changed: a record of a channel resource itself, such as a renamed
|
|
24
|
+
* conversation, always; another only on a channel the page views, or on any while it views none, such as a list.
|
|
25
|
+
*/
|
|
26
|
+
shows: (notice: RelayNotice) => boolean;
|
|
27
|
+
handlers: RelayHandlers;
|
|
28
|
+
stop: () => void;
|
|
29
|
+
};
|
|
30
|
+
export type RelayStore = ReturnType<typeof createRelayStore>;
|
|
31
|
+
//#endregion
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { heardTyping, nextExpiry, withoutExpired } from "./typing.js";
|
|
2
|
+
//#region src/relay/relay-store.ts
|
|
3
|
+
/** How many of the page's own sent messages the store remembers, so the unread count leaves them out. */
|
|
4
|
+
const ownKept = 50;
|
|
5
|
+
/**
|
|
6
|
+
* What the page heard from the relay, for the places that show it: who types on which channel, kept until their typing
|
|
7
|
+
* runs out, and the notices and reconnects, handed to whoever listens. `handlers` follows the relay; `stop` ends it.
|
|
8
|
+
*/
|
|
9
|
+
const createRelayStore = () => {
|
|
10
|
+
let typers = /* @__PURE__ */ new Map();
|
|
11
|
+
let timer;
|
|
12
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
13
|
+
const noticeListeners = /* @__PURE__ */ new Set();
|
|
14
|
+
const resyncListeners = /* @__PURE__ */ new Set();
|
|
15
|
+
const own = [];
|
|
16
|
+
const viewed = /* @__PURE__ */ new Map();
|
|
17
|
+
const viewListeners = /* @__PURE__ */ new Set();
|
|
18
|
+
const listen = (set, listener) => {
|
|
19
|
+
set.add(listener);
|
|
20
|
+
return () => void set.delete(listener);
|
|
21
|
+
};
|
|
22
|
+
const set = (next) => {
|
|
23
|
+
if (next === typers) return;
|
|
24
|
+
typers = next;
|
|
25
|
+
for (const listener of [...listeners]) listener();
|
|
26
|
+
clearTimeout(timer);
|
|
27
|
+
const at = nextExpiry(typers);
|
|
28
|
+
if (at !== void 0) timer = setTimeout(() => set(withoutExpired(typers, Date.now())), Math.max(0, at - Date.now()));
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
typers: () => typers,
|
|
32
|
+
subscribe: (listener) => listen(listeners, listener),
|
|
33
|
+
onNotice: (listener) => listen(noticeListeners, listener),
|
|
34
|
+
onResync: (listener) => listen(resyncListeners, listener),
|
|
35
|
+
/** Remembers a message the page itself sent, by key, which no unread count takes; only the latest few. */
|
|
36
|
+
sent: (key) => {
|
|
37
|
+
own.push(key);
|
|
38
|
+
if (own.length > ownKept) own.shift();
|
|
39
|
+
},
|
|
40
|
+
own: () => new Set(own),
|
|
41
|
+
/** Says the page shows the channel's records, such as an open conversation, until the returned function is called. */
|
|
42
|
+
view: (channel) => {
|
|
43
|
+
viewed.set(channel, (viewed.get(channel) ?? 0) + 1);
|
|
44
|
+
for (const listener of [...viewListeners]) listener(channel);
|
|
45
|
+
return () => {
|
|
46
|
+
const left = (viewed.get(channel) ?? 1) - 1;
|
|
47
|
+
if (left > 0) viewed.set(channel, left);
|
|
48
|
+
else viewed.delete(channel);
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
/** Whether the page shows the channel now. */
|
|
52
|
+
viewing: (channel) => viewed.has(channel),
|
|
53
|
+
/** Hears of each channel the page starts to show. */
|
|
54
|
+
onView: (listener) => listen(viewListeners, listener),
|
|
55
|
+
/**
|
|
56
|
+
* Whether the page shows what the notice changed: a record of a channel resource itself, such as a renamed
|
|
57
|
+
* conversation, always; another only on a channel the page views, or on any while it views none, such as a list.
|
|
58
|
+
*/
|
|
59
|
+
shows: (notice) => viewed.size === 0 || viewed.has(notice.channel) || notice.channel === `${notice.resource}/${notice.key}`,
|
|
60
|
+
handlers: {
|
|
61
|
+
onEvent: (event) => set(heardTyping(typers, event, Date.now())),
|
|
62
|
+
onNotice: (notice) => {
|
|
63
|
+
for (const listener of [...noticeListeners]) listener(notice);
|
|
64
|
+
},
|
|
65
|
+
onStatus: (status) => {
|
|
66
|
+
if (status !== "open") set(/* @__PURE__ */ new Map());
|
|
67
|
+
},
|
|
68
|
+
onResync: () => {
|
|
69
|
+
set(/* @__PURE__ */ new Map());
|
|
70
|
+
for (const listener of [...resyncListeners]) listener();
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
stop: () => clearTimeout(timer)
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
//#endregion
|
|
77
|
+
export { createRelayStore };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/relay/typing-line.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 conversation's box saying who else types on its channel, by the names of the organization's members
|
|
6
|
+
* the page already has; it keeps its height while nobody does, so the box does not move.
|
|
7
|
+
*/
|
|
8
|
+
export declare const TypingLine: ({ channel }: {
|
|
9
|
+
channel: string;
|
|
10
|
+
}) => import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useTypers } from "./relay-context.js";
|
|
2
|
+
import { useMembers } from "../people/use-members.js";
|
|
3
|
+
import { text } from "../app/conversation-page/messages.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/relay/typing-line.tsx
|
|
6
|
+
/** The line for the names of those typing: one, two, or several; nothing for nobody. */
|
|
7
|
+
const typingText = (names) => {
|
|
8
|
+
if (names.length === 0) return "";
|
|
9
|
+
if (names.length === 1) return text("typingOne", { name: names[0] });
|
|
10
|
+
if (names.length === 2) return text("typingTwo", {
|
|
11
|
+
first: names[0],
|
|
12
|
+
second: names[1]
|
|
13
|
+
});
|
|
14
|
+
return text("typingMany");
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The line above a conversation's box saying who else types on its channel, by the names of the organization's members
|
|
18
|
+
* the page already has; it keeps its height while nobody does, so the box does not move.
|
|
19
|
+
*/
|
|
20
|
+
const TypingLine = ({ channel }) => {
|
|
21
|
+
const { member } = useMembers();
|
|
22
|
+
const names = useTypers(channel).map((id) => member(id)?.name ?? text("someone"));
|
|
23
|
+
return /* @__PURE__ */ jsx("p", {
|
|
24
|
+
className: "h-5 shrink-0 truncate px-4 text-xs text-muted-foreground",
|
|
25
|
+
"aria-live": "polite",
|
|
26
|
+
children: typingText(names)
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { TypingLine, typingText };
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
|
@@ -0,0 +1,78 @@
|
|
|
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 };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RelayNotice } from "@protobase/client";
|
|
2
|
+
//#region src/relay/unread.d.ts
|
|
3
|
+
/** Unread messages by conversation key, as the sidebar counts them. */
|
|
4
|
+
export type UnreadCounts = Readonly<Record<string, number>>;
|
|
5
|
+
/** What a group's unread count follows: the conversation resource and the message resource noticed on its channels. */
|
|
6
|
+
export type UnreadSource = {
|
|
7
|
+
conversations: string;
|
|
8
|
+
messages: string;
|
|
9
|
+
};
|
|
10
|
+
/** The key of the conversation a channel is of, or undefined for a channel of another resource. */
|
|
11
|
+
export declare const conversationKey: (channel: string, conversations: string) => string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* The counts once `notice` arrived, without reading anything: one more for a new message on a conversation's channel,
|
|
14
|
+
* unless the reader has it open, or sent it from this page (`own`, by message key). Anything else changes nothing.
|
|
15
|
+
*/
|
|
16
|
+
export declare const countNotice: (counts: UnreadCounts, notice: RelayNotice, source: UnreadSource, open: (channel: string) => boolean, own: ReadonlySet<string>) => UnreadCounts;
|
|
17
|
+
/** The counts with the open conversation read: nothing unread while the reader has it open. */
|
|
18
|
+
export declare const opened: (counts: UnreadCounts, key: string) => UnreadCounts;
|
|
19
|
+
/** A key as the filter takes it: a whole number bare, anything else quoted. */
|
|
20
|
+
export declare const literal: (key: string) => string;
|
|
21
|
+
/**
|
|
22
|
+
* The filter of the unread messages of `conversations`, each after its own read position and by someone else, which the
|
|
23
|
+
* count groups by conversation in the database; undefined for none. Each clause reads the index of a conversation's
|
|
24
|
+
* messages by key, so the count costs what is unread, not the whole history.
|
|
25
|
+
*/
|
|
26
|
+
export declare const unreadFilter: (field: string, key: string, sender: string, me: string, conversations: ReadonlyArray<{
|
|
27
|
+
key: string;
|
|
28
|
+
readTo: number;
|
|
29
|
+
}>) => string | undefined;
|
|
30
|
+
//#endregion
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/relay/unread.ts
|
|
2
|
+
/** The key of the conversation a channel is of, or undefined for a channel of another resource. */
|
|
3
|
+
const conversationKey = (channel, conversations) => channel.startsWith(`${conversations}/`) ? channel.slice(conversations.length + 1) : void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The counts once `notice` arrived, without reading anything: one more for a new message on a conversation's channel,
|
|
6
|
+
* unless the reader has it open, or sent it from this page (`own`, by message key). Anything else changes nothing.
|
|
7
|
+
*/
|
|
8
|
+
const countNotice = (counts, notice, source, open, own) => {
|
|
9
|
+
if (notice.kind !== "create" || notice.resource !== source.messages) return counts;
|
|
10
|
+
const key = conversationKey(notice.channel, source.conversations);
|
|
11
|
+
if (key === void 0 || open(notice.channel) || own.has(notice.key)) return counts;
|
|
12
|
+
return {
|
|
13
|
+
...counts,
|
|
14
|
+
[key]: (counts[key] ?? 0) + 1
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
/** The counts with the open conversation read: nothing unread while the reader has it open. */
|
|
18
|
+
const opened = (counts, key) => counts[key] ? {
|
|
19
|
+
...counts,
|
|
20
|
+
[key]: 0
|
|
21
|
+
} : counts;
|
|
22
|
+
/** A key as the filter takes it: a whole number bare, anything else quoted. */
|
|
23
|
+
const literal = (key) => /^-?\d+$/.test(key) ? key : JSON.stringify(key);
|
|
24
|
+
/**
|
|
25
|
+
* The filter of the unread messages of `conversations`, each after its own read position and by someone else, which the
|
|
26
|
+
* count groups by conversation in the database; undefined for none. Each clause reads the index of a conversation's
|
|
27
|
+
* messages by key, so the count costs what is unread, not the whole history.
|
|
28
|
+
*/
|
|
29
|
+
const unreadFilter = (field, key, sender, me, conversations) => {
|
|
30
|
+
if (conversations.length === 0) return;
|
|
31
|
+
const after = conversations.map((conversation) => `(${field} = ${literal(conversation.key)} AND ${key} > ${conversation.readTo})`).join(" OR ");
|
|
32
|
+
return `${sender} != ${JSON.stringify(me)} AND (${after})`;
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { conversationKey, countNotice, literal, opened, unreadFilter };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NavRecord, RecordMark } from "../app-shell/nav.js";
|
|
2
|
+
import { NavRecentModel, ViewModel } from "@protobase/schema";
|
|
3
|
+
//#region src/relay/use-relay-marks.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The sidebar's marks of a group's records from the relay, as its `nav.recent` asks: bold with the count of unread
|
|
6
|
+
* messages (`unread`), and "typing…" while someone else types in it (`typing`), but in the one open. Undefined for a group that asks for neither.
|
|
7
|
+
*/
|
|
8
|
+
export declare const relayMarks: (view: ViewModel, recent: NavRecentModel) => ((records: readonly NavRecord[]) => Record<string, RecordMark> | undefined) | undefined;
|
|
9
|
+
/** Two marks hooks as one: the second's mark of a record over the first's, field by field. */
|
|
10
|
+
export declare const mergeMarks: (first: ((records: readonly NavRecord[]) => Record<string, RecordMark> | undefined) | undefined, second: ((records: readonly NavRecord[]) => Record<string, RecordMark> | undefined) | undefined) => ((records: readonly NavRecord[]) => Record<string, RecordMark> | undefined) | undefined;
|
|
11
|
+
//#endregion
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { text } from "../app-shell/messages.js";
|
|
2
|
+
import { useTypingChannels } from "./relay-context.js";
|
|
3
|
+
import { useUnreadCounts } from "./use-unread-counts.js";
|
|
4
|
+
//#region src/relay/use-relay-marks.ts
|
|
5
|
+
const conversationOf = (view) => view.record && "conversation" in view.record ? view.record.conversation : void 0;
|
|
6
|
+
/**
|
|
7
|
+
* The sidebar's marks of a group's records from the relay, as its `nav.recent` asks: bold with the count of unread
|
|
8
|
+
* messages (`unread`), and "typing…" while someone else types in it (`typing`), but in the one open. Undefined for a group that asks for neither.
|
|
9
|
+
*/
|
|
10
|
+
const relayMarks = (view, recent) => {
|
|
11
|
+
if (!recent.typing && !recent.unread) return;
|
|
12
|
+
const page = recent.unread ? conversationOf(view) : void 0;
|
|
13
|
+
return (records) => {
|
|
14
|
+
const typing = useTypingChannels();
|
|
15
|
+
const unread = useUnreadCounts(view.resource, page, records.map((record) => record.id));
|
|
16
|
+
const marks = {};
|
|
17
|
+
for (const record of records) {
|
|
18
|
+
const count = unread?.[record.id] ?? 0;
|
|
19
|
+
const typed = recent.typing && !record.active && typing.has(`${view.resource}/${record.id}`);
|
|
20
|
+
if (count === 0 && !typed) continue;
|
|
21
|
+
marks[record.id] = {
|
|
22
|
+
...count > 0 && {
|
|
23
|
+
strong: true,
|
|
24
|
+
count,
|
|
25
|
+
label: text("unread", { count })
|
|
26
|
+
},
|
|
27
|
+
...typed && { typing: true }
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return marks;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
/** Two marks hooks as one: the second's mark of a record over the first's, field by field. */
|
|
34
|
+
const mergeMarks = (first, second) => {
|
|
35
|
+
if (!first || !second) return first ?? second;
|
|
36
|
+
return (records) => {
|
|
37
|
+
const a = first(records);
|
|
38
|
+
const b = second(records);
|
|
39
|
+
if (!a || !b) return a ?? b;
|
|
40
|
+
const merged = { ...a };
|
|
41
|
+
for (const [key, mark] of Object.entries(b)) {
|
|
42
|
+
const label = [a[key]?.label, mark.label].filter(Boolean).join(", ");
|
|
43
|
+
merged[key] = {
|
|
44
|
+
...a[key],
|
|
45
|
+
...mark,
|
|
46
|
+
...label && { label }
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return merged;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { mergeMarks, relayMarks };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/relay/use-typing-sender.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Tells the others on the channel while the reader types (see `typingSender`): `onText` with the box's text as it
|
|
4
|
+
* changes, `onSent` once a message went. Nothing without the relay, or before the channel is joined.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useTypingSender: (channel: string) => {
|
|
7
|
+
onText: (text: string) => void;
|
|
8
|
+
onSent: () => void;
|
|
9
|
+
dispose: () => void;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|