@dxos/plugin-thread 0.8.4-main.74a063c4e0 → 0.8.4-main.765dc60934
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/neutral/ChannelArticle-ACZD7YFT.mjs +28 -0
- package/dist/lib/neutral/ChannelArticle-ACZD7YFT.mjs.map +7 -0
- package/dist/lib/neutral/ChannelChat-6YTD5HWL.mjs +10 -0
- package/dist/lib/neutral/ThreadCompanion-NQWPS2H6.mjs +208 -0
- package/dist/lib/neutral/ThreadCompanion-NQWPS2H6.mjs.map +7 -0
- package/dist/lib/neutral/ThreadContainer-XYEPEOSD.mjs +61 -0
- package/dist/lib/neutral/ThreadContainer-XYEPEOSD.mjs.map +7 -0
- package/dist/lib/neutral/ThreadPlugin.mjs +80 -0
- package/dist/lib/neutral/ThreadPlugin.mjs.map +7 -0
- package/dist/lib/neutral/ThreadPlugin.node.mjs +40 -0
- package/dist/lib/neutral/ThreadPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/ThreadSettings-5MKTDK3A.mjs +15 -0
- package/dist/lib/neutral/ThreadSettings-5MKTDK3A.mjs.map +7 -0
- package/dist/lib/{browser/add-message-MJDIN4K4.mjs → neutral/add-message-FBIROBEZ.mjs} +14 -24
- package/dist/lib/neutral/add-message-FBIROBEZ.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-7Q6MA6RT.mjs +120 -0
- package/dist/lib/neutral/app-graph-builder-7Q6MA6RT.mjs.map +7 -0
- package/dist/lib/neutral/append-channel-message-FTFAD3PK.mjs +40 -0
- package/dist/lib/neutral/append-channel-message-FTFAD3PK.mjs.map +7 -0
- package/dist/lib/neutral/blueprint-definition-S3EBOH4R.mjs +15 -0
- package/dist/lib/neutral/blueprint-definition-S3EBOH4R.mjs.map +7 -0
- package/dist/lib/neutral/blueprints/index.mjs +8 -0
- package/dist/lib/neutral/capabilities/index.mjs +25 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{browser/blueprints/index.mjs → neutral/chunk-5T5LPLBN.mjs} +5 -6
- package/dist/lib/neutral/chunk-5T5LPLBN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7GHUS3IX.mjs +20 -0
- package/dist/lib/neutral/chunk-7GHUS3IX.mjs.map +7 -0
- package/dist/lib/neutral/chunk-D5LGFCUY.mjs +55 -0
- package/dist/lib/neutral/chunk-D5LGFCUY.mjs.map +7 -0
- package/dist/lib/neutral/chunk-JLY4NVTA.mjs +38 -0
- package/dist/lib/neutral/chunk-JLY4NVTA.mjs.map +7 -0
- package/dist/lib/neutral/chunk-KRXHIW4P.mjs +164 -0
- package/dist/lib/neutral/chunk-KRXHIW4P.mjs.map +7 -0
- package/dist/lib/{browser/chunk-2QNKWX4H.mjs → neutral/chunk-PE7IH7EL.mjs} +97 -85
- package/dist/lib/neutral/chunk-PE7IH7EL.mjs.map +7 -0
- package/dist/lib/neutral/chunk-QFDT33VT.mjs +69 -0
- package/dist/lib/neutral/chunk-QFDT33VT.mjs.map +7 -0
- package/dist/lib/neutral/chunk-QK4QZUR5.mjs +8 -0
- package/dist/lib/neutral/chunk-QK4QZUR5.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +539 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +15 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/{browser/create-N2ZVTONJ.mjs → neutral/create-OAQJ6LXN.mjs} +11 -14
- package/dist/lib/neutral/create-OAQJ6LXN.mjs.map +7 -0
- package/dist/lib/neutral/create-channel-3E4FJ662.mjs +19 -0
- package/dist/lib/neutral/create-channel-3E4FJ662.mjs.map +7 -0
- package/dist/lib/neutral/create-object-HIEWSBZB.mjs +27 -0
- package/dist/lib/neutral/create-object-HIEWSBZB.mjs.map +7 -0
- package/dist/lib/{browser/create-proposals-VTOSWUOX.mjs → neutral/create-proposals-GRYZXRMV.mjs} +5 -6
- package/dist/lib/neutral/create-proposals-GRYZXRMV.mjs.map +7 -0
- package/dist/lib/{browser/delete-QZZE655Y.mjs → neutral/delete-HCCG5RVR.mjs} +8 -10
- package/dist/lib/neutral/delete-HCCG5RVR.mjs.map +7 -0
- package/dist/lib/{browser/delete-message-JTBPACDE.mjs → neutral/delete-message-DHFRACB4.mjs} +10 -20
- package/dist/lib/neutral/delete-message-DHFRACB4.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +10 -0
- package/dist/lib/neutral/index.mjs +28 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/markdown-BUORNCPG.mjs +83 -0
- package/dist/lib/neutral/markdown-BUORNCPG.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +10 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/on-create-space-OEBRKOAM.mjs +23 -0
- package/dist/lib/neutral/on-create-space-OEBRKOAM.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs +13 -0
- package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-XY23GVZH.mjs +76 -0
- package/dist/lib/neutral/react-surface-XY23GVZH.mjs.map +7 -0
- package/dist/lib/{browser/restore-KKQHFLYO.mjs → neutral/restore-P4ZLXLF7.mjs} +6 -7
- package/dist/lib/neutral/restore-P4ZLXLF7.mjs.map +7 -0
- package/dist/lib/{browser/restore-message-YN4BJQIZ.mjs → neutral/restore-message-AUBOP2DF.mjs} +9 -18
- package/dist/lib/neutral/restore-message-AUBOP2DF.mjs.map +7 -0
- package/dist/lib/{browser/select-VBJ3MBLN.mjs → neutral/select-LIVAMBCE.mjs} +7 -9
- package/dist/lib/neutral/select-LIVAMBCE.mjs.map +7 -0
- package/dist/lib/neutral/settings-HK4EB6TF.mjs +30 -0
- package/dist/lib/neutral/settings-HK4EB6TF.mjs.map +7 -0
- package/dist/lib/neutral/state-UU7VEAKV.mjs +22 -0
- package/dist/lib/neutral/state-UU7VEAKV.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +58 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/lib/{browser/toggle-resolved-OX7UEZG5.mjs → neutral/toggle-resolved-RQBDQZSV.mjs} +12 -21
- package/dist/lib/neutral/toggle-resolved-RQBDQZSV.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +90 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +12 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/undo-mappings-HOKL2L3M.mjs +54 -0
- package/dist/lib/neutral/undo-mappings-HOKL2L3M.mjs.map +7 -0
- package/dist/types/src/ThreadPlugin.d.ts +1 -0
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/ThreadPlugin.node.d.ts +4 -0
- package/dist/types/src/ThreadPlugin.node.d.ts.map +1 -0
- package/dist/types/src/ThreadPlugin.test.d.ts +2 -0
- package/dist/types/src/ThreadPlugin.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/thread-blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +2 -2
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +10 -9
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +2 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +51 -0
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -0
- package/dist/types/src/components/Chat/index.d.ts +2 -0
- package/dist/types/src/components/Chat/index.d.ts.map +1 -0
- package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts.map +1 -1
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts +70 -70
- package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts.map +1 -1
- package/dist/types/src/components/MessagePanel/MessagePanel.d.ts.map +1 -1
- package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts.map +1 -1
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts +70 -70
- package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts +13 -0
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.stories.d.ts +162 -0
- package/dist/types/src/containers/ChannelArticle/ChannelArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelArticle/index.d.ts +2 -0
- package/dist/types/src/containers/{CallDebugPanel → ChannelArticle}/index.d.ts.map +1 -1
- package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts +20 -0
- package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts.map +1 -0
- package/dist/types/src/containers/ChannelChat/index.d.ts +4 -0
- package/dist/types/src/containers/ChannelChat/index.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts.map +1 -1
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts +20 -0
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts.map +1 -0
- package/dist/types/src/containers/{ChatContainer/ChatContainer.stories.d.ts → ThreadContainer/ThreadContainer.stories.d.ts} +71 -71
- package/dist/types/src/containers/ThreadContainer/ThreadContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ThreadContainer/index.d.ts +4 -0
- package/dist/types/src/containers/ThreadContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +3 -4
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts +3 -3
- package/dist/types/src/extensions/threads.d.ts.map +1 -1
- package/dist/types/src/hooks/analytics.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +0 -4
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useStatus.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/add-message.d.ts +3 -3
- package/dist/types/src/operations/add-message.d.ts.map +1 -1
- package/dist/types/src/operations/append-channel-message.d.ts +5 -0
- package/dist/types/src/operations/append-channel-message.d.ts.map +1 -0
- package/dist/types/src/operations/create-channel.d.ts +3 -3
- package/dist/types/src/operations/create-channel.d.ts.map +1 -1
- package/dist/types/src/operations/create-proposals.d.ts +3 -3
- package/dist/types/src/operations/create-proposals.d.ts.map +1 -1
- package/dist/types/src/operations/create.d.ts +3 -3
- package/dist/types/src/operations/create.d.ts.map +1 -1
- package/dist/types/src/operations/delete-message.d.ts +3 -3
- package/dist/types/src/operations/delete-message.d.ts.map +1 -1
- package/dist/types/src/operations/delete.d.ts +3 -3
- package/dist/types/src/operations/delete.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -2
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/on-create-space.d.ts +3 -3
- package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
- package/dist/types/src/operations/restore-message.d.ts +3 -3
- package/dist/types/src/operations/restore-message.d.ts.map +1 -1
- package/dist/types/src/operations/restore.d.ts +3 -3
- package/dist/types/src/operations/restore.d.ts.map +1 -1
- package/dist/types/src/operations/select.d.ts +3 -3
- package/dist/types/src/operations/select.d.ts.map +1 -1
- package/dist/types/src/operations/toggle-resolved.d.ts +3 -3
- package/dist/types/src/operations/toggle-resolved.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/testing/data.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +70 -70
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +2 -1
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/ThreadCapabilities.d.ts +13 -0
- package/dist/types/src/types/ThreadCapabilities.d.ts.map +1 -0
- package/dist/types/src/{operations/definitions.d.ts → types/ThreadOperation.d.ts} +856 -1650
- package/dist/types/src/types/ThreadOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +6 -3
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +126 -106
- package/src/ThreadPlugin.node.ts +39 -0
- package/src/ThreadPlugin.test.ts +37 -0
- package/src/ThreadPlugin.tsx +12 -65
- package/src/blueprints/thread-blueprint.ts +3 -4
- package/src/capabilities/app-graph-builder.ts +21 -71
- package/src/capabilities/blueprint-definition.ts +2 -0
- package/src/capabilities/create-object.ts +29 -0
- package/src/capabilities/index.ts +3 -3
- package/src/capabilities/markdown.ts +9 -5
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +19 -34
- package/src/capabilities/settings.ts +1 -3
- package/src/capabilities/undo-mappings.ts +1 -1
- package/src/components/Chat/Chat.tsx +258 -0
- package/src/components/Chat/index.ts +5 -0
- package/src/components/CommentsPanel/CommentsPanel.stories.tsx +6 -4
- package/src/components/CommentsPanel/CommentsPanel.tsx +4 -4
- package/src/components/CommentsPanel/CommentsThread.tsx +2 -3
- package/src/components/MessagePanel/MessagePanel.tsx +10 -11
- package/src/components/ThreadSettings/ThreadSettings.stories.tsx +2 -1
- package/src/components/ThreadSettings/ThreadSettings.tsx +0 -1
- package/src/components/index.ts +1 -1
- package/src/containers/ChannelArticle/ChannelArticle.stories.tsx +105 -0
- package/src/containers/ChannelArticle/ChannelArticle.tsx +42 -0
- package/src/containers/ChannelArticle/index.ts +5 -0
- package/src/containers/ChannelChat/ChannelChat.tsx +75 -0
- package/src/containers/ChannelChat/index.ts +8 -0
- package/src/containers/ThreadCompanion/ThreadCompanion.tsx +10 -12
- package/src/containers/{ChatContainer/ChatContainer.stories.tsx → ThreadContainer/ThreadContainer.stories.tsx} +10 -11
- package/src/containers/ThreadContainer/ThreadContainer.tsx +75 -0
- package/src/containers/ThreadContainer/index.ts +8 -0
- package/src/containers/index.ts +3 -4
- package/src/extensions/command.ts +1 -1
- package/src/extensions/threads.ts +15 -15
- package/src/hooks/analytics.ts +1 -1
- package/src/hooks/index.ts +0 -5
- package/src/index.ts +4 -4
- package/src/meta.ts +1 -2
- package/src/operations/add-message.ts +9 -9
- package/src/operations/append-channel-message.ts +37 -0
- package/src/operations/create-channel.ts +4 -4
- package/src/operations/create-proposals.ts +3 -3
- package/src/operations/create.ts +7 -7
- package/src/operations/delete-message.ts +7 -7
- package/src/operations/delete.ts +4 -4
- package/src/operations/index.ts +2 -4
- package/src/operations/on-create-space.ts +4 -4
- package/src/operations/restore-message.ts +6 -6
- package/src/operations/restore.ts +4 -4
- package/src/operations/select.ts +3 -3
- package/src/operations/toggle-resolved.ts +9 -9
- package/src/plugin.ts +11 -0
- package/src/testing/index.ts +1 -1
- package/src/translations.ts +3 -3
- package/src/types/Settings.ts +1 -1
- package/src/types/ThreadCapabilities.ts +26 -0
- package/src/{operations/definitions.ts → types/ThreadOperation.ts} +14 -13
- package/src/types/index.ts +4 -2
- package/src/types/types.ts +0 -2
- package/src/util.ts +36 -4
- package/dist/lib/browser/add-message-MJDIN4K4.mjs.map +0 -7
- package/dist/lib/browser/blueprints/index.mjs.map +0 -7
- package/dist/lib/browser/chunk-2QNKWX4H.mjs.map +0 -7
- package/dist/lib/browser/chunk-7T7J6ZR6.mjs +0 -61
- package/dist/lib/browser/chunk-7T7J6ZR6.mjs.map +0 -7
- package/dist/lib/browser/create-N2ZVTONJ.mjs.map +0 -7
- package/dist/lib/browser/create-channel-Y4H3535D.mjs +0 -21
- package/dist/lib/browser/create-channel-Y4H3535D.mjs.map +0 -7
- package/dist/lib/browser/create-channel-thread-6N7TKEAW.mjs +0 -28
- package/dist/lib/browser/create-channel-thread-6N7TKEAW.mjs.map +0 -7
- package/dist/lib/browser/create-proposals-VTOSWUOX.mjs.map +0 -7
- package/dist/lib/browser/delete-QZZE655Y.mjs.map +0 -7
- package/dist/lib/browser/delete-message-JTBPACDE.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -2334
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/on-create-space-2UGS234J.mjs +0 -25
- package/dist/lib/browser/on-create-space-2UGS234J.mjs.map +0 -7
- package/dist/lib/browser/operations/index.mjs +0 -14
- package/dist/lib/browser/operations/index.mjs.map +0 -7
- package/dist/lib/browser/restore-KKQHFLYO.mjs.map +0 -7
- package/dist/lib/browser/restore-message-YN4BJQIZ.mjs.map +0 -7
- package/dist/lib/browser/select-VBJ3MBLN.mjs.map +0 -7
- package/dist/lib/browser/toggle-resolved-OX7UEZG5.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -12
- package/dist/lib/node-esm/add-message-X6IRTANN.mjs +0 -98
- package/dist/lib/node-esm/add-message-X6IRTANN.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -38
- package/dist/lib/node-esm/blueprints/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-I6LAZYVU.mjs +0 -260
- package/dist/lib/node-esm/chunk-I6LAZYVU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UGSMYQLZ.mjs +0 -62
- package/dist/lib/node-esm/chunk-UGSMYQLZ.mjs.map +0 -7
- package/dist/lib/node-esm/create-A6XQZR7M.mjs +0 -56
- package/dist/lib/node-esm/create-A6XQZR7M.mjs.map +0 -7
- package/dist/lib/node-esm/create-channel-KA5T23ZS.mjs +0 -22
- package/dist/lib/node-esm/create-channel-KA5T23ZS.mjs.map +0 -7
- package/dist/lib/node-esm/create-channel-thread-44PXAPGM.mjs +0 -29
- package/dist/lib/node-esm/create-channel-thread-44PXAPGM.mjs.map +0 -7
- package/dist/lib/node-esm/create-proposals-HDBVDNUX.mjs +0 -58
- package/dist/lib/node-esm/create-proposals-HDBVDNUX.mjs.map +0 -7
- package/dist/lib/node-esm/delete-3RAWD5GG.mjs +0 -60
- package/dist/lib/node-esm/delete-3RAWD5GG.mjs.map +0 -7
- package/dist/lib/node-esm/delete-message-QQHNJBHY.mjs +0 -65
- package/dist/lib/node-esm/delete-message-QQHNJBHY.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -2335
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/on-create-space-ZURB6UKR.mjs +0 -26
- package/dist/lib/node-esm/on-create-space-ZURB6UKR.mjs.map +0 -7
- package/dist/lib/node-esm/operations/index.mjs +0 -15
- package/dist/lib/node-esm/operations/index.mjs.map +0 -7
- package/dist/lib/node-esm/restore-PDYEKDE3.mjs +0 -34
- package/dist/lib/node-esm/restore-PDYEKDE3.mjs.map +0 -7
- package/dist/lib/node-esm/restore-message-OB32YYKF.mjs +0 -43
- package/dist/lib/node-esm/restore-message-OB32YYKF.mjs.map +0 -7
- package/dist/lib/node-esm/select-6KETLVWY.mjs +0 -27
- package/dist/lib/node-esm/select-6KETLVWY.mjs.map +0 -7
- package/dist/lib/node-esm/toggle-resolved-V74EBRQZ.mjs +0 -46
- package/dist/lib/node-esm/toggle-resolved-V74EBRQZ.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -13
- package/dist/types/src/calls/call-manager.d.ts +0 -87
- package/dist/types/src/calls/call-manager.d.ts.map +0 -1
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts +0 -66
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +0 -1
- package/dist/types/src/calls/index.d.ts +0 -7
- package/dist/types/src/calls/index.d.ts.map +0 -1
- package/dist/types/src/calls/media-manager.d.ts +0 -60
- package/dist/types/src/calls/media-manager.d.ts.map +0 -1
- package/dist/types/src/calls/speaking-monitor.d.ts +0 -24
- package/dist/types/src/calls/speaking-monitor.d.ts.map +0 -1
- package/dist/types/src/calls/types.d.ts +0 -45
- package/dist/types/src/calls/types.d.ts.map +0 -1
- package/dist/types/src/calls/util/audio.d.ts +0 -6
- package/dist/types/src/calls/util/audio.d.ts.map +0 -1
- package/dist/types/src/calls/util/calls-service.d.ts +0 -77
- package/dist/types/src/calls/util/calls-service.d.ts.map +0 -1
- package/dist/types/src/calls/util/history-cache.d.ts +0 -11
- package/dist/types/src/calls/util/history-cache.d.ts.map +0 -1
- package/dist/types/src/calls/util/index.d.ts +0 -5
- package/dist/types/src/calls/util/index.d.ts.map +0 -1
- package/dist/types/src/calls/util/media.d.ts +0 -6
- package/dist/types/src/calls/util/media.d.ts.map +0 -1
- package/dist/types/src/calls/util/stub-media-streams.d.ts +0 -18
- package/dist/types/src/calls/util/stub-media-streams.d.ts.map +0 -1
- package/dist/types/src/calls/util/task-scheduling.d.ts +0 -17
- package/dist/types/src/calls/util/task-scheduling.d.ts.map +0 -1
- package/dist/types/src/calls-service.stories.d.ts +0 -23
- package/dist/types/src/calls-service.stories.d.ts.map +0 -1
- package/dist/types/src/capabilities/call-manager.d.ts +0 -6
- package/dist/types/src/capabilities/call-manager.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root.d.ts +0 -9
- package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
- package/dist/types/src/components/Call/Call.d.ts +0 -17
- package/dist/types/src/components/Call/Call.d.ts.map +0 -1
- package/dist/types/src/components/Call/Toolbar.d.ts +0 -16
- package/dist/types/src/components/Call/Toolbar.d.ts.map +0 -1
- package/dist/types/src/components/Call/index.d.ts +0 -3
- package/dist/types/src/components/Call/index.d.ts.map +0 -1
- package/dist/types/src/components/Lobby/Lobby.d.ts +0 -15
- package/dist/types/src/components/Lobby/Lobby.d.ts.map +0 -1
- package/dist/types/src/components/Lobby/index.d.ts +0 -2
- package/dist/types/src/components/Lobby/index.d.ts.map +0 -1
- package/dist/types/src/components/Media/AudioStream.d.ts +0 -6
- package/dist/types/src/components/Media/AudioStream.d.ts.map +0 -1
- package/dist/types/src/components/Media/VideoObject.d.ts +0 -15
- package/dist/types/src/components/Media/VideoObject.d.ts.map +0 -1
- package/dist/types/src/components/Media/VideoObject.stories.d.ts +0 -22
- package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +0 -1
- package/dist/types/src/components/Media/index.d.ts +0 -3
- package/dist/types/src/components/Media/index.d.ts.map +0 -1
- package/dist/types/src/components/Participant/Participant.d.ts +0 -6
- package/dist/types/src/components/Participant/Participant.d.ts.map +0 -1
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts +0 -11
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +0 -1
- package/dist/types/src/components/Participant/index.d.ts +0 -3
- package/dist/types/src/components/Participant/index.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts +0 -32
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +0 -178
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts +0 -21
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts +0 -12
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts +0 -164
- package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts.map +0 -1
- package/dist/types/src/components/ResponsiveGrid/index.d.ts +0 -4
- package/dist/types/src/components/ResponsiveGrid/index.d.ts.map +0 -1
- package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts +0 -15
- package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts.map +0 -1
- package/dist/types/src/containers/CallDebugPanel/index.d.ts +0 -2
- package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts +0 -3
- package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts.map +0 -1
- package/dist/types/src/containers/CallSidebar/index.d.ts +0 -2
- package/dist/types/src/containers/CallSidebar/index.d.ts.map +0 -1
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts +0 -12
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +0 -1
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts +0 -162
- package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/ChannelContainer/index.d.ts +0 -2
- package/dist/types/src/containers/ChannelContainer/index.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +0 -20
- package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/ChatContainer/index.d.ts +0 -4
- package/dist/types/src/containers/ChatContainer/index.d.ts.map +0 -1
- package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts +0 -2
- package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts.map +0 -1
- package/dist/types/src/hooks/useDebugMode.d.ts +0 -2
- package/dist/types/src/hooks/useDebugMode.d.ts.map +0 -1
- package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts +0 -2
- package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts.map +0 -1
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts +0 -3
- package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +0 -1
- package/dist/types/src/operations/create-channel-thread.d.ts +0 -5
- package/dist/types/src/operations/create-channel-thread.d.ts.map +0 -1
- package/dist/types/src/operations/definitions.d.ts.map +0 -1
- package/dist/types/src/testing/stories.d.ts +0 -3
- package/dist/types/src/testing/stories.d.ts.map +0 -1
- package/dist/types/src/types/Channel.d.ts +0 -711
- package/dist/types/src/types/Channel.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -23
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/src/calls/call-manager.ts +0 -270
- package/src/calls/call-swarm-synchronizer.ts +0 -350
- package/src/calls/index.ts +0 -10
- package/src/calls/media-manager.ts +0 -378
- package/src/calls/speaking-monitor.ts +0 -85
- package/src/calls/types.ts +0 -74
- package/src/calls/util/audio.ts +0 -58
- package/src/calls/util/calls-service.ts +0 -580
- package/src/calls/util/history-cache.ts +0 -27
- package/src/calls/util/index.ts +0 -8
- package/src/calls/util/media.ts +0 -52
- package/src/calls/util/stub-media-streams.ts +0 -127
- package/src/calls/util/task-scheduling.ts +0 -92
- package/src/calls-service.stories.tsx +0 -230
- package/src/capabilities/call-manager.ts +0 -27
- package/src/capabilities/react-root.tsx +0 -20
- package/src/components/Call/Call.tsx +0 -93
- package/src/components/Call/Toolbar.tsx +0 -199
- package/src/components/Call/index.ts +0 -6
- package/src/components/Lobby/Lobby.tsx +0 -122
- package/src/components/Lobby/index.ts +0 -5
- package/src/components/Media/AudioStream.tsx +0 -67
- package/src/components/Media/VideoObject.stories.tsx +0 -59
- package/src/components/Media/VideoObject.tsx +0 -58
- package/src/components/Media/index.ts +0 -6
- package/src/components/Participant/Participant.tsx +0 -77
- package/src/components/Participant/ParticipantGrid.tsx +0 -88
- package/src/components/Participant/index.ts +0 -6
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +0 -157
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +0 -341
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +0 -134
- package/src/components/ResponsiveGrid/ResponsivePanel.stories.tsx +0 -53
- package/src/components/ResponsiveGrid/ResponsivePanel.tsx +0 -31
- package/src/components/ResponsiveGrid/index.ts +0 -7
- package/src/containers/CallDebugPanel/CallDebugPanel.tsx +0 -173
- package/src/containers/CallDebugPanel/index.ts +0 -5
- package/src/containers/CallSidebar/CallSidebar.tsx +0 -18
- package/src/containers/CallSidebar/index.ts +0 -5
- package/src/containers/ChannelContainer/ChannelContainer.stories.tsx +0 -61
- package/src/containers/ChannelContainer/ChannelContainer.tsx +0 -223
- package/src/containers/ChannelContainer/index.ts +0 -5
- package/src/containers/ChatContainer/ChatContainer.tsx +0 -131
- package/src/containers/ChatContainer/index.ts +0 -8
- package/src/hooks/useBlackCanvasStreamTrack.tsx +0 -27
- package/src/hooks/useDebugMode.ts +0 -25
- package/src/hooks/useInaudibleAudioStreamTrack.tsx +0 -27
- package/src/hooks/useVideoStreamTrack.tsx +0 -36
- package/src/operations/create-channel-thread.ts +0 -26
- package/src/testing/stories.ts +0 -51
- package/src/types/Channel.ts +0 -37
- package/src/types/capabilities.ts +0 -36
- package/src/typings/peermetrics-webrtc-stats.d.ts +0 -46
- package/src/typings.d.ts +0 -8
- /package/dist/lib/{browser/chunk-J5LGTIGS.mjs.map → neutral/ChannelChat-6YTD5HWL.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/hooks}/index.mjs.map +0 -0
|
@@ -13,7 +13,6 @@ import { type Settings } from '#types';
|
|
|
13
13
|
|
|
14
14
|
export type ThreadSettingsProps = AppSurface.SettingsArticleProps<Settings.Settings>;
|
|
15
15
|
|
|
16
|
-
// TODO(burdon): Settings.
|
|
17
16
|
export const ThreadSettings = ({ settings: _settings }: ThreadSettingsProps) => {
|
|
18
17
|
const { t: _t } = useTranslation(meta.id);
|
|
19
18
|
return <SettingsForm.Viewport></SettingsForm.Viewport>;
|
package/src/components/index.ts
CHANGED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import { Capability } from '@dxos/app-framework';
|
|
10
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
12
|
+
import { Feed, Query } from '@dxos/echo';
|
|
13
|
+
import { createFeedServiceLayer } from '@dxos/echo-db';
|
|
14
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
15
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
16
|
+
import { SpacePlugin } from '@dxos/plugin-space/testing';
|
|
17
|
+
import { corePlugins } from '@dxos/plugin-testing';
|
|
18
|
+
import { Config } from '@dxos/react-client';
|
|
19
|
+
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
20
|
+
import { withLayout, withTheme, Loading } from '@dxos/react-ui/testing';
|
|
21
|
+
import { Channel, Message, Thread } from '@dxos/types';
|
|
22
|
+
|
|
23
|
+
import { translations } from '#translations';
|
|
24
|
+
|
|
25
|
+
import { ThreadPlugin } from '../../ThreadPlugin';
|
|
26
|
+
import { ChannelArticle, type ChannelArticleProps } from './ChannelArticle';
|
|
27
|
+
|
|
28
|
+
// TODO(wittjosiah): Channel doesn't render full height.
|
|
29
|
+
const DefaultStory = ({ roomId }: ChannelArticleProps) => {
|
|
30
|
+
const [space] = useSpaces();
|
|
31
|
+
const [channel] = useQuery(space?.db, Query.type(Channel.Channel));
|
|
32
|
+
if (!channel) {
|
|
33
|
+
return <Loading data={{ channel }} />;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return <ChannelArticle subject={channel} attendableId='story' roomId={roomId} role='article' />;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const meta = {
|
|
40
|
+
title: 'plugins/plugin-thread/containers/ChannelArticle',
|
|
41
|
+
component: ChannelArticle,
|
|
42
|
+
render: DefaultStory,
|
|
43
|
+
decorators: [
|
|
44
|
+
withTheme(),
|
|
45
|
+
withLayout({ layout: 'column' }),
|
|
46
|
+
withPluginManager({
|
|
47
|
+
capabilities: [
|
|
48
|
+
Capability.contributes(AppCapabilities.Schema, [Channel.Channel, Feed.Feed, Thread.Thread, Message.Message]),
|
|
49
|
+
],
|
|
50
|
+
plugins: [
|
|
51
|
+
...corePlugins(),
|
|
52
|
+
ClientPlugin({
|
|
53
|
+
types: [Channel.Channel, Feed.Feed, Thread.Thread, Message.Message],
|
|
54
|
+
config: new Config({
|
|
55
|
+
runtime: {
|
|
56
|
+
services: {
|
|
57
|
+
edge: {
|
|
58
|
+
url: 'https://edge.dxos.workers.dev/',
|
|
59
|
+
},
|
|
60
|
+
iceProviders: [
|
|
61
|
+
{
|
|
62
|
+
urls: 'https://edge.dxos.workers.dev/ice',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
}),
|
|
68
|
+
onClientInitialized: ({ client }) =>
|
|
69
|
+
Effect.gen(function* () {
|
|
70
|
+
const { personalSpace } = yield* initializeIdentity(client);
|
|
71
|
+
const channel = personalSpace.db.add(Channel.make({ name: 'general' }));
|
|
72
|
+
const feed = yield* Effect.promise(() => channel.feed.load());
|
|
73
|
+
const seed = [
|
|
74
|
+
Message.make({ sender: { role: 'user' }, blocks: [{ _tag: 'text', text: 'Hello, channel.' }] }),
|
|
75
|
+
Message.make({
|
|
76
|
+
sender: { role: 'user' },
|
|
77
|
+
blocks: [{ _tag: 'text', text: 'Messages are stored in the feed.' }],
|
|
78
|
+
}),
|
|
79
|
+
];
|
|
80
|
+
yield* Feed.append(feed, seed).pipe(Effect.provide(createFeedServiceLayer(personalSpace.queues)));
|
|
81
|
+
}),
|
|
82
|
+
}),
|
|
83
|
+
SpacePlugin({}),
|
|
84
|
+
ThreadPlugin(),
|
|
85
|
+
],
|
|
86
|
+
}),
|
|
87
|
+
],
|
|
88
|
+
parameters: {
|
|
89
|
+
translations,
|
|
90
|
+
},
|
|
91
|
+
} satisfies Meta<typeof ChannelArticle>;
|
|
92
|
+
|
|
93
|
+
export default meta;
|
|
94
|
+
|
|
95
|
+
type Story = StoryObj<typeof meta>;
|
|
96
|
+
|
|
97
|
+
export const Default: Story = {
|
|
98
|
+
args: {
|
|
99
|
+
// Fixed room for testing.
|
|
100
|
+
subject: undefined,
|
|
101
|
+
attendableId: 'story',
|
|
102
|
+
role: 'article',
|
|
103
|
+
roomId: '04a1d1911703b8e929d0649021a965',
|
|
104
|
+
},
|
|
105
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
9
|
+
import { Panel } from '@dxos/react-ui';
|
|
10
|
+
import { type Channel } from '@dxos/types';
|
|
11
|
+
|
|
12
|
+
import { ChannelChat } from '../ChannelChat';
|
|
13
|
+
|
|
14
|
+
export type ChannelArticleProps = AppSurface.ObjectArticleProps<
|
|
15
|
+
Channel.Channel | undefined,
|
|
16
|
+
{
|
|
17
|
+
roomId?: string;
|
|
18
|
+
fullscreen?: boolean;
|
|
19
|
+
}
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Renders the channel chat. The "Start video call" action and the in-call surface
|
|
24
|
+
* are contributed by plugin-calls — this container is call-agnostic.
|
|
25
|
+
*/
|
|
26
|
+
// TODO(burdon): Create Radix style layout.
|
|
27
|
+
// TODO(burdon): Restore graph-driven toolbar so plugin-calls can contribute a "Start video call" action (F-1.1).
|
|
28
|
+
export const ChannelArticle = ({ subject: channel }: ChannelArticleProps) => {
|
|
29
|
+
const space = getSpace(channel);
|
|
30
|
+
|
|
31
|
+
if (channel && space) {
|
|
32
|
+
return (
|
|
33
|
+
<Panel.Root classNames='dx-document'>
|
|
34
|
+
<Panel.Content asChild>
|
|
35
|
+
<ChannelChat classNames='border' space={space} channel={channel} />
|
|
36
|
+
</Panel.Content>
|
|
37
|
+
</Panel.Root>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
|
+
import { Filter, Obj, Query } from '@dxos/echo';
|
|
9
|
+
import { type Space, useMembers, useQuery } from '@dxos/react-client/echo';
|
|
10
|
+
import { useIdentity } from '@dxos/react-client/halo';
|
|
11
|
+
import { type Channel, Message } from '@dxos/types';
|
|
12
|
+
import { composable, composableProps } from '@dxos/ui-theme';
|
|
13
|
+
|
|
14
|
+
import { Chat } from '#components';
|
|
15
|
+
import { useStatus } from '#hooks';
|
|
16
|
+
import { ThreadOperation } from '#types';
|
|
17
|
+
|
|
18
|
+
export type ChannelChatProps = {
|
|
19
|
+
space: Space;
|
|
20
|
+
channel: Channel.Channel;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Channel chat: composer pinned to the bottom of the panel, messages scrolling
|
|
25
|
+
* above it (newest at the bottom). Threading via `Message.threadId` is
|
|
26
|
+
* intentionally not reconstructed in this round.
|
|
27
|
+
*
|
|
28
|
+
* Externally-synced channels (any Channel carrying foreign-key `Obj.Meta`,
|
|
29
|
+
* e.g. Slack/Discord-sourced rooms) render read-only — the composer is
|
|
30
|
+
* suppressed because there's no local-write path back to the source.
|
|
31
|
+
*/
|
|
32
|
+
export const ChannelChat = composable<HTMLDivElement, ChannelChatProps>(
|
|
33
|
+
({ space, channel, ...props }, forwardedRef) => {
|
|
34
|
+
const identity = useIdentity()!;
|
|
35
|
+
const members = useMembers(space.id);
|
|
36
|
+
const id = Obj.getDXN(channel).toString();
|
|
37
|
+
const activity = useStatus(space, id);
|
|
38
|
+
const { invokePromise } = useOperationInvoker();
|
|
39
|
+
|
|
40
|
+
const feed = channel.feed?.target;
|
|
41
|
+
const messages = useQuery(
|
|
42
|
+
space.db,
|
|
43
|
+
feed ? Query.select(Filter.type(Message.Message)).from(feed) : Query.select(Filter.nothing()),
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const readOnly = Obj.getMeta(channel).keys.length > 0;
|
|
47
|
+
|
|
48
|
+
const handleSend = (text: string) => {
|
|
49
|
+
if (readOnly) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
void invokePromise(ThreadOperation.AppendChannelMessage, {
|
|
53
|
+
channel,
|
|
54
|
+
sender: { identityDid: identity.did },
|
|
55
|
+
text,
|
|
56
|
+
});
|
|
57
|
+
return true;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Chat
|
|
62
|
+
{...composableProps(props)}
|
|
63
|
+
id={id}
|
|
64
|
+
identity={identity}
|
|
65
|
+
members={members}
|
|
66
|
+
messages={messages}
|
|
67
|
+
activity={activity}
|
|
68
|
+
onSend={handleSend}
|
|
69
|
+
orientation='bottom'
|
|
70
|
+
readOnly={readOnly}
|
|
71
|
+
ref={forwardedRef}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
);
|
|
@@ -6,11 +6,11 @@ import { useAtomValue } from '@effect-atom/atom-react';
|
|
|
6
6
|
import React, { useCallback, useMemo } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Capabilities } from '@dxos/app-framework';
|
|
9
|
-
import { useCapabilities, useCapability, useOperationInvoker
|
|
9
|
+
import { useCapabilities, useCapability, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
10
10
|
import { AppCapabilities, CollaborationOperation, LayoutOperation } from '@dxos/app-toolkit';
|
|
11
11
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
12
|
-
import { Filter, Obj, Query, Relation } from '@dxos/echo';
|
|
13
|
-
import {
|
|
12
|
+
import { Filter, Obj, Query, Ref, Relation } from '@dxos/echo';
|
|
13
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
14
14
|
import { useIdentity } from '@dxos/react-client/halo';
|
|
15
15
|
import { Panel, ScrollArea, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
16
16
|
import { getParentId, useAttention } from '@dxos/react-ui-attention';
|
|
@@ -19,7 +19,7 @@ import { AnchoredTo, Thread } from '@dxos/types';
|
|
|
19
19
|
|
|
20
20
|
import { CommentsPanel, type CommentsPanelProps } from '#components';
|
|
21
21
|
import { meta } from '#meta';
|
|
22
|
-
import { ThreadOperation } from '#
|
|
22
|
+
import { ThreadOperation } from '#types';
|
|
23
23
|
import { ThreadCapabilities, type ViewState } from '#types';
|
|
24
24
|
|
|
25
25
|
const initialViewState: ViewState = { showResolvedThreads: false };
|
|
@@ -33,7 +33,6 @@ export type ThreadCompanionProps = AppSurface.ObjectArticleProps<
|
|
|
33
33
|
|
|
34
34
|
export const ThreadCompanion = ({ attendableId, subject }: ThreadCompanionProps) => {
|
|
35
35
|
const { t } = useTranslation(meta.id);
|
|
36
|
-
const manager = usePluginManager();
|
|
37
36
|
const { invokePromise } = useOperationInvoker();
|
|
38
37
|
const identity = useIdentity();
|
|
39
38
|
const subjectId = Obj.getDXN(subject).toString();
|
|
@@ -66,6 +65,7 @@ export const ThreadCompanion = ({ attendableId, subject }: ThreadCompanionProps)
|
|
|
66
65
|
[registry, viewStoreAtom, subjectId],
|
|
67
66
|
);
|
|
68
67
|
|
|
68
|
+
const commentConfigs = useCapabilities(AppCapabilities.CommentConfig);
|
|
69
69
|
const anchorSorts = useCapabilities(AppCapabilities.AnchorSort);
|
|
70
70
|
const sort = useMemo(
|
|
71
71
|
() => anchorSorts.find(({ key }) => key === Obj.getTypename(subject))?.sort,
|
|
@@ -93,14 +93,12 @@ export const ThreadCompanion = ({ attendableId, subject }: ThreadCompanionProps)
|
|
|
93
93
|
// Scroll plank into view (deck handler).
|
|
94
94
|
void invokePromise(LayoutOperation.ScrollIntoView, { subject: parentId });
|
|
95
95
|
|
|
96
|
-
// Scroll within content to anchor (
|
|
96
|
+
// Scroll within content to anchor (comment config per typename).
|
|
97
97
|
if (anchor.anchor && parentId) {
|
|
98
98
|
const typename = Obj.getTypename(subject);
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
.
|
|
102
|
-
if (metadata?.scrollToAnchor) {
|
|
103
|
-
void invokePromise(metadata.scrollToAnchor, {
|
|
99
|
+
const commentConfig = commentConfigs.find(({ id }) => id === typename);
|
|
100
|
+
if (commentConfig?.scrollToAnchor) {
|
|
101
|
+
void invokePromise(commentConfig.scrollToAnchor, {
|
|
104
102
|
subject: parentId,
|
|
105
103
|
cursor: anchor.anchor,
|
|
106
104
|
ref: threadId,
|
|
@@ -109,7 +107,7 @@ export const ThreadCompanion = ({ attendableId, subject }: ThreadCompanionProps)
|
|
|
109
107
|
}
|
|
110
108
|
}
|
|
111
109
|
},
|
|
112
|
-
[state.current, invokePromise, registry, stateAtom, parentId, subject,
|
|
110
|
+
[state.current, invokePromise, registry, stateAtom, parentId, subject, commentConfigs],
|
|
113
111
|
);
|
|
114
112
|
|
|
115
113
|
const handleComment = useCallback(
|
|
@@ -19,10 +19,9 @@ import { Thread as ThreadComponent } from '@dxos/react-ui-thread';
|
|
|
19
19
|
import { withLayout, Loading } from '@dxos/react-ui/testing';
|
|
20
20
|
import { Message, Thread } from '@dxos/types';
|
|
21
21
|
|
|
22
|
-
import {
|
|
22
|
+
import { translations } from '#translations';
|
|
23
23
|
|
|
24
|
-
import {
|
|
25
|
-
import { ChatContainer } from './ChatContainer';
|
|
24
|
+
import { ThreadContainer } from './ThreadContainer';
|
|
26
25
|
|
|
27
26
|
random.seed(1);
|
|
28
27
|
|
|
@@ -30,26 +29,26 @@ const DefaultStory = () => {
|
|
|
30
29
|
const client = useClient();
|
|
31
30
|
const identity = useIdentity();
|
|
32
31
|
const [space, setSpace] = useState<Space>();
|
|
33
|
-
const [
|
|
32
|
+
const [thread, setThread] = useState<Thread.Thread | null>();
|
|
34
33
|
|
|
35
34
|
useAsyncEffect(async () => {
|
|
36
35
|
if (identity) {
|
|
37
36
|
const space = await client.spaces.create();
|
|
38
|
-
const
|
|
37
|
+
const thread = space.db.add(Thread.make({ status: 'active' }));
|
|
39
38
|
setSpace(space);
|
|
40
|
-
|
|
39
|
+
setThread(thread);
|
|
41
40
|
}
|
|
42
41
|
}, [identity]);
|
|
43
42
|
|
|
44
|
-
if (!identity || !
|
|
45
|
-
return <Loading data={{ identity: !!identity, space: !!space,
|
|
43
|
+
if (!identity || !thread || !space) {
|
|
44
|
+
return <Loading data={{ identity: !!identity, space: !!space, thread: !!thread }} />;
|
|
46
45
|
}
|
|
47
46
|
|
|
48
|
-
return <
|
|
47
|
+
return <ThreadContainer space={space} thread={thread} />;
|
|
49
48
|
};
|
|
50
49
|
|
|
51
50
|
const meta = {
|
|
52
|
-
title: 'plugins/plugin-thread/containers/
|
|
51
|
+
title: 'plugins/plugin-thread/containers/ThreadContainer',
|
|
53
52
|
component: ThreadComponent.Root as any,
|
|
54
53
|
render: DefaultStory,
|
|
55
54
|
decorators: [
|
|
@@ -71,7 +70,7 @@ const meta = {
|
|
|
71
70
|
}),
|
|
72
71
|
withClientProvider({
|
|
73
72
|
createSpace: true,
|
|
74
|
-
types: [Thread.Thread,
|
|
73
|
+
types: [Thread.Thread, Message.Message],
|
|
75
74
|
}),
|
|
76
75
|
],
|
|
77
76
|
parameters: {
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Obj, Ref } from '@dxos/echo';
|
|
8
|
+
import { type Space, useMembers } from '@dxos/react-client/echo';
|
|
9
|
+
import { useIdentity } from '@dxos/react-client/halo';
|
|
10
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
11
|
+
import { type ThreadRootProps } from '@dxos/react-ui-thread';
|
|
12
|
+
import { Message, type Thread } from '@dxos/types';
|
|
13
|
+
import { composable, composableProps } from '@dxos/ui-theme';
|
|
14
|
+
import { isNonNullable } from '@dxos/util';
|
|
15
|
+
|
|
16
|
+
import { Chat } from '#components';
|
|
17
|
+
import { useStatus } from '#hooks';
|
|
18
|
+
|
|
19
|
+
export type ThreadContainerProps = ThemedClassName<
|
|
20
|
+
{
|
|
21
|
+
space: Space;
|
|
22
|
+
thread: Thread.Thread;
|
|
23
|
+
context?: Obj.Unknown;
|
|
24
|
+
autoFocusTextbox?: boolean;
|
|
25
|
+
} & Pick<ThreadRootProps, 'current'>
|
|
26
|
+
>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Renders an AutoMerge {@link Thread} as a chat: appends new messages by pushing
|
|
30
|
+
* onto `thread.messages`. Used for comment threads and the meeting in-call chat.
|
|
31
|
+
*/
|
|
32
|
+
export const ThreadContainer = composable<HTMLDivElement, ThreadContainerProps>(
|
|
33
|
+
({ space, thread, context, autoFocusTextbox, current, ...props }, forwardedRef) => {
|
|
34
|
+
const id = Obj.getDXN(thread).toString();
|
|
35
|
+
const identity = useIdentity()!;
|
|
36
|
+
const members = useMembers(space?.id);
|
|
37
|
+
const activity = useStatus(space, id);
|
|
38
|
+
|
|
39
|
+
const messages = useMemo(
|
|
40
|
+
() => thread.messages.map((message) => message.target).filter(isNonNullable),
|
|
41
|
+
[thread.messages],
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const handleSend = (text: string) => {
|
|
45
|
+
Obj.update(thread, (thread) => {
|
|
46
|
+
thread.messages.push(
|
|
47
|
+
Ref.make(
|
|
48
|
+
Obj.make(Message.Message, {
|
|
49
|
+
created: new Date().toISOString(),
|
|
50
|
+
sender: { identityDid: identity.did },
|
|
51
|
+
blocks: [{ _tag: 'text', text }],
|
|
52
|
+
properties: context ? { context: Ref.make(context) } : undefined,
|
|
53
|
+
}),
|
|
54
|
+
),
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
return true;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Chat
|
|
62
|
+
{...composableProps(props)}
|
|
63
|
+
id={id}
|
|
64
|
+
identity={identity}
|
|
65
|
+
members={members}
|
|
66
|
+
messages={messages}
|
|
67
|
+
activity={activity}
|
|
68
|
+
onSend={handleSend}
|
|
69
|
+
autoFocusTextbox={autoFocusTextbox}
|
|
70
|
+
current={current}
|
|
71
|
+
ref={forwardedRef}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
);
|
package/src/containers/index.ts
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { type ComponentType, lazy } from 'react';
|
|
6
6
|
|
|
7
|
-
export const
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
export const ChatContainer: ComponentType<any> = lazy(() => import('./ChatContainer'));
|
|
7
|
+
export const ChannelChat: ComponentType<any> = lazy(() => import('./ChannelChat'));
|
|
8
|
+
export const ChannelArticle: ComponentType<any> = lazy(() => import('./ChannelArticle'));
|
|
9
|
+
export const ThreadContainer: ComponentType<any> = lazy(() => import('./ThreadContainer'));
|
|
11
10
|
export const ThreadCompanion: ComponentType<any> = lazy(() => import('./ThreadCompanion'));
|
|
@@ -29,7 +29,7 @@ const parser = StreamLanguage.define<{ count: number }>({
|
|
|
29
29
|
const styles = HighlightStyle.define([
|
|
30
30
|
{
|
|
31
31
|
tag: tags.tagName,
|
|
32
|
-
class: mx('dx-tag dx-tag--indigo text-base-
|
|
32
|
+
class: mx('dx-tag dx-tag--indigo text-base-foreground font-medium'),
|
|
33
33
|
},
|
|
34
34
|
]);
|
|
35
35
|
|
|
@@ -8,12 +8,12 @@ import { type Atom, type Registry } from '@effect-atom/atom-react';
|
|
|
8
8
|
|
|
9
9
|
import { Filter, Obj, Query, Relation } from '@dxos/echo';
|
|
10
10
|
import { createDocAccessor, getTextInRange } from '@dxos/echo-db';
|
|
11
|
-
import {
|
|
12
|
-
import { type Markdown } from '@dxos/plugin-markdown
|
|
11
|
+
import { OperationInvoker } from '@dxos/operation';
|
|
12
|
+
import { type Markdown } from '@dxos/plugin-markdown';
|
|
13
13
|
import { AnchoredTo, Thread } from '@dxos/types';
|
|
14
14
|
import { comments, createExternalCommentSync } from '@dxos/ui-editor';
|
|
15
15
|
|
|
16
|
-
import { ThreadOperation } from '#
|
|
16
|
+
import { ThreadOperation } from '#types';
|
|
17
17
|
import { type ThreadState } from '#types';
|
|
18
18
|
|
|
19
19
|
// TODO(burdon): Factor out.
|
|
@@ -73,8 +73,8 @@ export const threads = (
|
|
|
73
73
|
const name = getName(doc, anchor.anchor);
|
|
74
74
|
const thread = Relation.getSource(anchor) as Thread.Thread;
|
|
75
75
|
if (name && name !== thread.name) {
|
|
76
|
-
Obj.
|
|
77
|
-
|
|
76
|
+
Obj.update(thread, (thread) => {
|
|
77
|
+
thread.name = name;
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -130,8 +130,8 @@ export const threads = (
|
|
|
130
130
|
|
|
131
131
|
const thread = query.results.find((object) => Relation.getSource(object).id === id);
|
|
132
132
|
if (thread) {
|
|
133
|
-
Relation.
|
|
134
|
-
|
|
133
|
+
Relation.update(thread, (thread) => {
|
|
134
|
+
thread.anchor = undefined;
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
},
|
|
@@ -139,11 +139,11 @@ export const threads = (
|
|
|
139
139
|
const draft = registry.get(stateAtom).drafts[objectId]?.find((d) => Relation.getDXN(d).toString() === id);
|
|
140
140
|
if (draft) {
|
|
141
141
|
const thread = Relation.getSource(draft) as Thread.Thread;
|
|
142
|
-
Obj.
|
|
143
|
-
|
|
142
|
+
Obj.update(thread, (thread) => {
|
|
143
|
+
thread.name = getName(doc, cursor);
|
|
144
144
|
});
|
|
145
|
-
Relation.
|
|
146
|
-
|
|
145
|
+
Relation.update(draft, (draft) => {
|
|
146
|
+
draft.anchor = cursor;
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
|
|
@@ -151,11 +151,11 @@ export const threads = (
|
|
|
151
151
|
if (relation) {
|
|
152
152
|
const thread = Relation.getSource(relation);
|
|
153
153
|
if (Obj.instanceOf(Thread.Thread, thread)) {
|
|
154
|
-
Obj.
|
|
155
|
-
|
|
154
|
+
Obj.update(thread, (thread) => {
|
|
155
|
+
thread.name = getName(doc, cursor);
|
|
156
156
|
});
|
|
157
|
-
Relation.
|
|
158
|
-
|
|
157
|
+
Relation.update(relation, (relation) => {
|
|
158
|
+
relation.anchor = cursor;
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
}
|
package/src/hooks/analytics.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { useCallback } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
8
|
import { Obj } from '@dxos/echo';
|
|
9
|
-
import { ObservabilityOperation } from '@dxos/plugin-observability
|
|
9
|
+
import { ObservabilityOperation } from '@dxos/plugin-observability';
|
|
10
10
|
import { useOnTransition } from '@dxos/react-ui';
|
|
11
11
|
import { type ContentBlock } from '@dxos/types';
|
|
12
12
|
|
package/src/hooks/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
|
|
5
|
+
export * from './blueprints';
|
|
6
|
+
// TODO(wittjosiah): Hooks should not be exported from the plugin package at all.
|
|
7
|
+
// Either refactor callers to not need them or factor them out to a shared package.
|
|
7
8
|
export * from './hooks';
|
|
8
9
|
export * from './meta';
|
|
9
|
-
|
|
10
|
-
export * from './ThreadPlugin';
|
|
10
|
+
export * from './types';
|
package/src/meta.ts
CHANGED
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
import { type Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
|
-
// TODO(wittjosiah): Needs screenshots.
|
|
9
8
|
export const meta: Plugin.Meta = {
|
|
10
9
|
id: 'org.dxos.plugin.thread',
|
|
11
|
-
name: '
|
|
10
|
+
name: 'Threads',
|
|
12
11
|
description: trim`
|
|
13
12
|
Multi-modal communication platform supporting text chat, voice, and video conferencing.
|
|
14
13
|
Create threaded conversations and add contextual comments directly on any workspace object.
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
8
9
|
import { Obj, Ref, Relation } from '@dxos/echo';
|
|
9
10
|
import { invariant } from '@dxos/invariant';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
11
|
+
import { ObservabilityOperation } from '@dxos/plugin-observability';
|
|
12
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
13
13
|
import { AnchoredTo, Message, Thread } from '@dxos/types';
|
|
14
14
|
|
|
15
15
|
import { ThreadCapabilities } from '../types';
|
|
16
|
-
import {
|
|
16
|
+
import { ThreadOperation } from '../types';
|
|
17
17
|
|
|
18
|
-
const handler: Operation.WithHandler<typeof AddMessage> = AddMessage.pipe(
|
|
18
|
+
const handler: Operation.WithHandler<typeof ThreadOperation.AddMessage> = ThreadOperation.AddMessage.pipe(
|
|
19
19
|
Operation.withHandler(
|
|
20
20
|
Effect.fnUntraced(function* ({ anchor, subject, sender, text }) {
|
|
21
21
|
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
@@ -30,15 +30,15 @@ const handler: Operation.WithHandler<typeof AddMessage> = AddMessage.pipe(
|
|
|
30
30
|
sender,
|
|
31
31
|
blocks: [{ _tag: 'text', text }],
|
|
32
32
|
});
|
|
33
|
-
Obj.
|
|
34
|
-
|
|
33
|
+
Obj.update(thread, (thread) => {
|
|
34
|
+
thread.messages.push(Ref.make(message));
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
const state = registry.get(stateAtom);
|
|
38
38
|
const draft = state.drafts[subjectId]?.find((a: { id: string }) => a.id === anchor.id);
|
|
39
39
|
if (draft) {
|
|
40
|
-
Obj.
|
|
41
|
-
|
|
40
|
+
Obj.update(thread, (thread) => {
|
|
41
|
+
thread.status = 'active';
|
|
42
42
|
});
|
|
43
43
|
registry.set(stateAtom, {
|
|
44
44
|
...state,
|