@dxos/plugin-space 0.8.4-main.fd6878d → 0.8.4-main.fffef41
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/lib/browser/{CollectionMain-D2B75XBS.mjs → CollectionArticle-WTHWY4YS.mjs} +10 -10
- package/dist/lib/browser/CollectionArticle-WTHWY4YS.mjs.map +7 -0
- package/dist/lib/browser/ObjectDetailsPanel-2BRUBHP6.mjs +141 -0
- package/dist/lib/browser/ObjectDetailsPanel-2BRUBHP6.mjs.map +7 -0
- package/dist/lib/browser/ObjectSettings-5LLWCVEK.mjs +144 -0
- package/dist/lib/browser/ObjectSettings-5LLWCVEK.mjs.map +7 -0
- package/dist/lib/browser/RecordArticle-SXDRWTTU.mjs +116 -0
- package/dist/lib/browser/RecordArticle-SXDRWTTU.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-VZW75QPJ.mjs → app-graph-builder-DTM7BJ6D.mjs} +114 -97
- package/dist/lib/browser/app-graph-builder-DTM7BJ6D.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-YPHYVZAP.mjs → app-graph-serializer-TIKXF43P.mjs} +19 -19
- package/dist/lib/browser/app-graph-serializer-TIKXF43P.mjs.map +7 -0
- package/dist/lib/browser/chunk-AFUOMLX6.mjs +167 -0
- package/dist/lib/browser/chunk-AFUOMLX6.mjs.map +7 -0
- package/dist/lib/browser/{chunk-PSIBVBTA.mjs → chunk-CKACGS7T.mjs} +576 -500
- package/dist/lib/browser/chunk-CKACGS7T.mjs.map +7 -0
- package/dist/lib/browser/chunk-K5J7ZB5P.mjs +20 -0
- package/dist/lib/browser/chunk-K5J7ZB5P.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SMB4DGYO.mjs → chunk-KFUMADZF.mjs} +184 -60
- package/dist/lib/browser/chunk-KFUMADZF.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WAXS2ZVX.mjs → chunk-VGKOXAPE.mjs} +27 -13
- package/dist/lib/browser/chunk-VGKOXAPE.mjs.map +7 -0
- package/dist/lib/browser/chunk-VZBIIYFM.mjs +16 -0
- package/dist/lib/browser/chunk-VZBIIYFM.mjs.map +7 -0
- package/dist/lib/browser/chunk-WJXU4GKV.mjs +19 -0
- package/dist/lib/browser/chunk-WJXU4GKV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-3UFG6LQQ.mjs → chunk-ZQMSGD5J.mjs} +44 -22
- package/dist/lib/browser/chunk-ZQMSGD5J.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-T6ZNVE7S.mjs → identity-created-NAXTPQXE.mjs} +5 -5
- package/dist/lib/browser/identity-created-NAXTPQXE.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +89 -91
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-TS6CCKST.mjs → intent-resolver-3FNTO3VW.mjs} +103 -85
- package/dist/lib/browser/intent-resolver-3FNTO3VW.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-root-Q7VBWBES.mjs +30 -0
- package/dist/lib/browser/react-root-Q7VBWBES.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-V3ARS2BP.mjs → react-surface-TTHS332A.mjs} +75 -109
- package/dist/lib/browser/react-surface-TTHS332A.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-5LBA43X5.mjs → schema-defs-QPI2JU3X.mjs} +6 -6
- package/dist/lib/browser/schema-defs-QPI2JU3X.mjs.map +7 -0
- package/dist/lib/browser/{settings-FLLBP5KI.mjs → settings-45PGPO2V.mjs} +5 -5
- package/dist/lib/browser/{settings-FLLBP5KI.mjs.map → settings-45PGPO2V.mjs.map} +1 -1
- package/dist/lib/browser/{spaces-ready-FXEP6XEW.mjs → spaces-ready-QCND4DVY.mjs} +15 -14
- package/dist/lib/browser/spaces-ready-QCND4DVY.mjs.map +7 -0
- package/dist/lib/browser/{state-K3UBPKYP.mjs → state-Q7YRE5KG.mjs} +7 -7
- package/dist/lib/browser/state-Q7YRE5KG.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{CollectionMain-ZJIFCWKZ.mjs → CollectionArticle-KHXYT3SH.mjs} +10 -10
- package/dist/lib/node-esm/CollectionArticle-KHXYT3SH.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-6PZQIQG3.mjs +142 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-6PZQIQG3.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectSettings-OQSBOH7K.mjs +145 -0
- package/dist/lib/node-esm/ObjectSettings-OQSBOH7K.mjs.map +7 -0
- package/dist/lib/node-esm/RecordArticle-NACBH42P.mjs +117 -0
- package/dist/lib/node-esm/RecordArticle-NACBH42P.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-XNVQOJLE.mjs → app-graph-builder-FBJFWI4H.mjs} +114 -97
- package/dist/lib/node-esm/app-graph-builder-FBJFWI4H.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-PKVLWV6V.mjs → app-graph-serializer-BESQZAYU.mjs} +19 -19
- package/dist/lib/node-esm/app-graph-serializer-BESQZAYU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-S7MKRQHY.mjs → chunk-6VEONPNZ.mjs} +44 -22
- package/dist/lib/node-esm/chunk-6VEONPNZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6ZQGZBEP.mjs +168 -0
- package/dist/lib/node-esm/chunk-6ZQGZBEP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-BDEFTL6K.mjs +18 -0
- package/dist/lib/node-esm/chunk-BDEFTL6K.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-H4JILUJK.mjs +20 -0
- package/dist/lib/node-esm/chunk-H4JILUJK.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-CTQMR7E3.mjs → chunk-OK2L7N2F.mjs} +184 -60
- package/dist/lib/node-esm/chunk-OK2L7N2F.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HYIZVPOA.mjs → chunk-QBRPYAEL.mjs} +27 -13
- package/dist/lib/node-esm/chunk-QBRPYAEL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-KYUHPPRN.mjs → chunk-XGAMJC5C.mjs} +576 -500
- package/dist/lib/node-esm/chunk-XGAMJC5C.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-Z7BB6HC2.mjs +21 -0
- package/dist/lib/node-esm/chunk-Z7BB6HC2.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-AL7NNCKH.mjs → identity-created-OXLKCJE3.mjs} +5 -5
- package/dist/lib/node-esm/identity-created-OXLKCJE3.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +89 -91
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-W6P27SCF.mjs → intent-resolver-6O5FSB7Z.mjs} +103 -85
- package/dist/lib/node-esm/intent-resolver-6O5FSB7Z.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-N27KETKT.mjs → react-root-K66W3FMA.mjs} +13 -12
- package/dist/lib/node-esm/react-root-K66W3FMA.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-TNPAUQCM.mjs → react-surface-Y7FTEIDF.mjs} +75 -109
- package/dist/lib/node-esm/react-surface-Y7FTEIDF.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-TPWZPDCR.mjs → schema-defs-ZS2D47XW.mjs} +6 -6
- package/dist/lib/node-esm/schema-defs-ZS2D47XW.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-WKUWY3P6.mjs → settings-6FO65BA6.mjs} +5 -5
- package/dist/lib/node-esm/{settings-WKUWY3P6.mjs.map → settings-6FO65BA6.mjs.map} +1 -1
- package/dist/lib/node-esm/{spaces-ready-PQLLIO5W.mjs → spaces-ready-P7CKVXBE.mjs} +15 -14
- package/dist/lib/node-esm/spaces-ready-P7CKVXBE.mjs.map +7 -0
- package/dist/lib/node-esm/{state-4M5A6OSB.mjs → state-362I5BMK.mjs} +7 -7
- package/dist/lib/node-esm/state-362I5BMK.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/SpacePlugin.d.ts +1 -1
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +6 -5
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts +11 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts +2 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +1 -1
- package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
- package/dist/types/src/components/CollectionArticle.d.ts +6 -0
- package/dist/types/src/components/CollectionArticle.d.ts.map +1 -0
- package/dist/types/src/components/CollectionSection.d.ts +3 -4
- package/dist/types/src/components/CollectionSection.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +3 -3
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +1704 -4
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +6 -4
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/{JoinDialog.d.ts → JoinDialog/JoinDialog.d.ts} +1 -1
- package/dist/types/src/components/JoinDialog/JoinDialog.d.ts.map +1 -0
- package/dist/types/src/components/JoinDialog/index.d.ts +2 -0
- package/dist/types/src/components/JoinDialog/index.d.ts.map +1 -0
- package/dist/types/src/components/{MembersContainer.d.ts → MembersContainer/MembersContainer.d.ts} +3 -2
- package/dist/types/src/components/MembersContainer/MembersContainer.d.ts.map +1 -0
- package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts +1707 -0
- package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/MembersContainer/index.d.ts +2 -0
- package/dist/types/src/components/MembersContainer/index.d.ts.map +1 -0
- package/dist/types/src/components/ObjectDetailsPanel/ObjectDetailsPanel.d.ts +9 -0
- package/dist/types/src/components/ObjectDetailsPanel/ObjectDetailsPanel.d.ts.map +1 -0
- package/dist/types/src/components/ObjectDetailsPanel/ObjectForm.d.ts +10 -0
- package/dist/types/src/components/ObjectDetailsPanel/ObjectForm.d.ts.map +1 -0
- package/dist/types/src/components/ObjectDetailsPanel/index.d.ts +3 -0
- package/dist/types/src/components/ObjectDetailsPanel/index.d.ts.map +1 -0
- package/dist/types/src/components/ObjectRenamePopover/ObjectRenamePopover.d.ts +7 -0
- package/dist/types/src/components/ObjectRenamePopover/ObjectRenamePopover.d.ts.map +1 -0
- package/dist/types/src/components/ObjectRenamePopover/index.d.ts +2 -0
- package/dist/types/src/components/ObjectRenamePopover/index.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.stories.d.ts +1540 -0
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts +1 -1
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/index.d.ts +2 -1
- package/dist/types/src/components/ObjectSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/RecordArticle.d.ts +5 -0
- package/dist/types/src/components/RecordArticle.d.ts.map +1 -0
- package/dist/types/src/components/RecordArticle.stories.d.ts +1707 -0
- package/dist/types/src/components/RecordArticle.stories.d.ts.map +1 -0
- package/dist/types/src/components/SchemaContainer.d.ts +1 -1
- package/dist/types/src/components/SchemaContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/{SpacePresence.d.ts → SpacePresence/SpacePresence.d.ts} +4 -3
- package/dist/types/src/components/SpacePresence/SpacePresence.d.ts.map +1 -0
- package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts +1537 -0
- package/dist/types/src/components/SpacePresence/SpacePresence.stories.d.ts.map +1 -0
- package/dist/types/src/components/SpacePresence/index.d.ts +2 -0
- package/dist/types/src/components/SpacePresence/index.d.ts.map +1 -0
- package/dist/types/src/components/SpaceRenamePopover/SpaceRenamePopover.d.ts +7 -0
- package/dist/types/src/components/SpaceRenamePopover/SpaceRenamePopover.d.ts.map +1 -0
- package/dist/types/src/components/SpaceRenamePopover/index.d.ts +2 -0
- package/dist/types/src/components/SpaceRenamePopover/index.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +1537 -4
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +1538 -5
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor.d.ts +3 -4
- package/dist/types/src/components/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +10 -14
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/helpers/index.d.ts +2 -0
- package/dist/types/src/helpers/index.d.ts.map +1 -0
- package/dist/types/src/helpers/query.d.ts +8 -0
- package/dist/types/src/helpers/query.d.ts.map +1 -0
- package/dist/types/src/helpers/query.test.d.ts +2 -0
- package/dist/types/src/helpers/query.test.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -1
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts +1 -1
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -1
- package/dist/types/src/hooks/usePath.d.ts +1 -1
- package/dist/types/src/hooks/usePath.d.ts.map +1 -1
- package/dist/types/src/hooks/useTypeOptions.d.ts +10 -0
- package/dist/types/src/hooks/useTypeOptions.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1332 -22
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +92 -97
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +12 -8
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +65 -59
- package/src/SpacePlugin.ts +228 -218
- package/src/capabilities/app-graph-builder.ts +184 -135
- package/src/capabilities/app-graph-serializer.ts +12 -12
- package/src/capabilities/capabilities.ts +17 -11
- package/src/capabilities/identity-created.ts +2 -2
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +89 -62
- package/src/capabilities/react-root.tsx +4 -3
- package/src/capabilities/react-surface.tsx +69 -145
- package/src/capabilities/schema-defs.ts +1 -1
- package/src/capabilities/spaces-ready.ts +8 -5
- package/src/capabilities/state.ts +2 -2
- package/src/components/AwaitingObject.tsx +12 -14
- package/src/components/{CollectionMain.tsx → CollectionArticle.tsx} +7 -6
- package/src/components/CollectionSection.tsx +8 -6
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +15 -15
- package/src/components/CreateDialog/CreateObjectDialog.tsx +48 -31
- package/src/components/CreateDialog/CreateObjectPanel.tsx +22 -11
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +30 -11
- package/src/components/{JoinDialog.tsx → JoinDialog/JoinDialog.tsx} +26 -10
- package/src/components/JoinDialog/index.ts +5 -0
- package/src/components/MembersContainer/MembersContainer.stories.tsx +56 -0
- package/src/components/{MembersContainer.tsx → MembersContainer/MembersContainer.tsx} +21 -20
- package/src/components/MembersContainer/index.ts +5 -0
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/ObjectDetailsPanel/ObjectDetailsPanel.tsx +51 -0
- package/src/components/ObjectDetailsPanel/ObjectForm.tsx +72 -0
- package/src/components/ObjectDetailsPanel/index.ts +7 -0
- package/src/components/{PopoverRenameObject.tsx → ObjectRenamePopover/ObjectRenamePopover.tsx} +6 -6
- package/src/components/ObjectRenamePopover/index.ts +5 -0
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +3 -3
- package/src/components/ObjectSettings/BaseObjectSettings.stories.tsx +63 -0
- package/src/components/ObjectSettings/BaseObjectSettings.tsx +90 -26
- package/src/components/ObjectSettings/ForeignKeys.tsx +4 -4
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +4 -3
- package/src/components/ObjectSettings/index.ts +3 -1
- package/src/components/RecordArticle.stories.tsx +115 -0
- package/src/components/RecordArticle.tsx +114 -0
- package/src/components/SchemaContainer.tsx +23 -26
- package/src/components/SpacePluginSettings.tsx +15 -10
- package/src/components/{SpacePresence.stories.tsx → SpacePresence/SpacePresence.stories.tsx} +22 -22
- package/src/components/{SpacePresence.tsx → SpacePresence/SpacePresence.tsx} +16 -11
- package/src/components/SpacePresence/index.ts +5 -0
- package/src/components/{PopoverRenameSpace.tsx → SpaceRenamePopover/SpaceRenamePopover.tsx} +7 -6
- package/src/components/SpaceRenamePopover/index.ts +5 -0
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +15 -8
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +45 -24
- package/src/components/SyncStatus/InlineSyncStatus.tsx +8 -8
- package/src/components/SyncStatus/SyncStatus.stories.tsx +7 -8
- package/src/components/SyncStatus/SyncStatus.tsx +107 -11
- package/src/components/ViewEditor.tsx +51 -23
- package/src/components/index.ts +7 -8
- package/src/events.ts +6 -6
- package/src/helpers/index.ts +5 -0
- package/src/helpers/query.test.ts +24 -0
- package/src/helpers/query.ts +158 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useActiveSpace.ts +3 -2
- package/src/hooks/useInputSurfaceLookup.tsx +8 -3
- package/src/hooks/usePath.ts +1 -1
- package/src/hooks/useTypeOptions.ts +59 -0
- package/src/index.ts +1 -0
- package/src/meta.ts +6 -3
- package/src/translations.ts +26 -10
- package/src/types/types.ts +42 -23
- package/src/util.tsx +183 -62
- package/dist/lib/browser/CollectionMain-D2B75XBS.mjs.map +0 -7
- package/dist/lib/browser/ObjectDetailsPanel-SY6FYTYC.mjs +0 -88
- package/dist/lib/browser/ObjectDetailsPanel-SY6FYTYC.mjs.map +0 -7
- package/dist/lib/browser/RecordMain-TEBGAVSL.mjs +0 -68
- package/dist/lib/browser/RecordMain-TEBGAVSL.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-VZW75QPJ.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-YPHYVZAP.mjs.map +0 -7
- package/dist/lib/browser/chunk-3UFG6LQQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-CBYL62HG.mjs +0 -19
- package/dist/lib/browser/chunk-CBYL62HG.mjs.map +0 -7
- package/dist/lib/browser/chunk-DYKFFVN6.mjs +0 -94
- package/dist/lib/browser/chunk-DYKFFVN6.mjs.map +0 -7
- package/dist/lib/browser/chunk-FBCGT5YY.mjs +0 -13
- package/dist/lib/browser/chunk-FBCGT5YY.mjs.map +0 -7
- package/dist/lib/browser/chunk-PSIBVBTA.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q5EEPP3S.mjs +0 -20
- package/dist/lib/browser/chunk-Q5EEPP3S.mjs.map +0 -7
- package/dist/lib/browser/chunk-SMB4DGYO.mjs.map +0 -7
- package/dist/lib/browser/chunk-WAXS2ZVX.mjs.map +0 -7
- package/dist/lib/browser/identity-created-T6ZNVE7S.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-TS6CCKST.mjs.map +0 -7
- package/dist/lib/browser/react-root-RQGTZ2ZO.mjs +0 -29
- package/dist/lib/browser/react-root-RQGTZ2ZO.mjs.map +0 -7
- package/dist/lib/browser/react-surface-V3ARS2BP.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-5LBA43X5.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-LPL35WOJ.mjs +0 -124
- package/dist/lib/browser/schema-tools-LPL35WOJ.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-FXEP6XEW.mjs.map +0 -7
- package/dist/lib/browser/state-K3UBPKYP.mjs.map +0 -7
- package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs.map +0 -7
- package/dist/lib/node-esm/ObjectDetailsPanel-3MYLTMXN.mjs +0 -89
- package/dist/lib/node-esm/ObjectDetailsPanel-3MYLTMXN.mjs.map +0 -7
- package/dist/lib/node-esm/RecordMain-WLYJMYER.mjs +0 -70
- package/dist/lib/node-esm/RecordMain-WLYJMYER.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-XNVQOJLE.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-PKVLWV6V.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7MZ3J3LI.mjs +0 -21
- package/dist/lib/node-esm/chunk-7MZ3J3LI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CTQMR7E3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FJZNSJC4.mjs +0 -20
- package/dist/lib/node-esm/chunk-FJZNSJC4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HWNG4MEU.mjs +0 -15
- package/dist/lib/node-esm/chunk-HWNG4MEU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HYIZVPOA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KLG4Y4GY.mjs +0 -96
- package/dist/lib/node-esm/chunk-KLG4Y4GY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KYUHPPRN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-S7MKRQHY.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-AL7NNCKH.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-W6P27SCF.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-N27KETKT.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-TNPAUQCM.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-TPWZPDCR.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-PJE2FKWH.mjs +0 -126
- package/dist/lib/node-esm/schema-tools-PJE2FKWH.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-PQLLIO5W.mjs.map +0 -7
- package/dist/lib/node-esm/state-4M5A6OSB.mjs.map +0 -7
- package/dist/types/src/capabilities/schema-tool.test.d.ts +0 -2
- package/dist/types/src/capabilities/schema-tool.test.d.ts.map +0 -1
- package/dist/types/src/capabilities/schema-tools.d.ts +0 -13
- package/dist/types/src/capabilities/schema-tools.d.ts.map +0 -1
- package/dist/types/src/components/CollectionMain.d.ts +0 -7
- package/dist/types/src/components/CollectionMain.d.ts.map +0 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +0 -1
- package/dist/types/src/components/MembersContainer.d.ts.map +0 -1
- package/dist/types/src/components/MembersContainer.stories.d.ts +0 -8
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/ObjectDetailsPanel.d.ts +0 -9
- package/dist/types/src/components/ObjectDetailsPanel.d.ts.map +0 -1
- package/dist/types/src/components/PersistenceStatus.d.ts +0 -6
- package/dist/types/src/components/PersistenceStatus.d.ts.map +0 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts +0 -7
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +0 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts +0 -7
- package/dist/types/src/components/PopoverRenameSpace.d.ts.map +0 -1
- package/dist/types/src/components/RecordMain.d.ts +0 -7
- package/dist/types/src/components/RecordMain.d.ts.map +0 -1
- package/dist/types/src/components/SpacePresence.d.ts.map +0 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +0 -9
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +0 -1
- package/src/capabilities/schema-tool.test.ts +0 -44
- package/src/capabilities/schema-tools.ts +0 -125
- package/src/components/MembersContainer.stories.tsx +0 -31
- package/src/components/ObjectDetailsPanel.tsx +0 -77
- package/src/components/PersistenceStatus.tsx +0 -83
- package/src/components/RecordMain.tsx +0 -43
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Surface } from '@dxos/app-framework/react';
|
|
8
|
+
import { type SurfaceComponentProps } from '@dxos/app-framework/react';
|
|
9
|
+
import { Filter, type Obj, Ref, Relation } from '@dxos/echo';
|
|
10
|
+
import { type Space, getSpace, useQuery } from '@dxos/react-client/echo';
|
|
11
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
12
|
+
import { Masonry } from '@dxos/react-ui-masonry';
|
|
13
|
+
import { StackItem } from '@dxos/react-ui-stack';
|
|
14
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
15
|
+
import { isNonNullable } from '@dxos/util';
|
|
16
|
+
|
|
17
|
+
import { meta } from '../meta';
|
|
18
|
+
|
|
19
|
+
export const RecordArticle = ({ subject }: SurfaceComponentProps) => {
|
|
20
|
+
const { t } = useTranslation(meta.id);
|
|
21
|
+
const space = getSpace(subject);
|
|
22
|
+
const data = useMemo(() => ({ subject }), [subject]);
|
|
23
|
+
const related = useRelatedObjects(space, subject, {
|
|
24
|
+
references: true,
|
|
25
|
+
relations: true,
|
|
26
|
+
});
|
|
27
|
+
const singleColumn = related.length === 1;
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<StackItem.Content>
|
|
31
|
+
<div role='none' className={mx('flex flex-col gap-4 p-4 is-full overflow-y-auto')}>
|
|
32
|
+
<div role='none' className={mx('flex is-full card-max-width')}>
|
|
33
|
+
<Surface role='section' data={data} limit={1} />
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
{related.length > 0 && (
|
|
37
|
+
<div role='none' className={mx('flex flex-col gap-1', singleColumn ? 'card-max-width' : 'is-full')}>
|
|
38
|
+
<label className='mbs-2 text-sm text-description'>{t('related objects label')}</label>
|
|
39
|
+
<Masonry.Root<Obj.Any>
|
|
40
|
+
items={related}
|
|
41
|
+
render={Card}
|
|
42
|
+
columnCount={singleColumn ? 1 : undefined}
|
|
43
|
+
intrinsicHeight
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
)}
|
|
47
|
+
</div>
|
|
48
|
+
</StackItem.Content>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const Card = ({ data: subject }: { data: Obj.Any }) => {
|
|
53
|
+
const data = useMemo(() => ({ subject }), [subject]);
|
|
54
|
+
return <Surface role='card' data={data} limit={1} />;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// TODO(wittjosiah): This is a hack. ECHO needs to have a back reference index to easily query for related objects.
|
|
58
|
+
const useRelatedObjects = (
|
|
59
|
+
space?: Space,
|
|
60
|
+
record?: Obj.Any,
|
|
61
|
+
options: { references?: boolean; relations?: boolean } = {},
|
|
62
|
+
) => {
|
|
63
|
+
const objects = useQuery(space, Filter.everything());
|
|
64
|
+
return useMemo(() => {
|
|
65
|
+
if (!record) {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const related: Obj.Any[] = [];
|
|
70
|
+
|
|
71
|
+
// TODO(burdon): Change Person => Organization to relations.
|
|
72
|
+
if (options.references) {
|
|
73
|
+
const getReferences = (obj: Obj.Any): Ref.Any[] => {
|
|
74
|
+
return Object.getOwnPropertyNames(obj)
|
|
75
|
+
.map((name) => obj[name as keyof Obj.Any])
|
|
76
|
+
.filter((value) => Ref.isRef(value)) as Ref.Any[];
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const references = getReferences(record);
|
|
80
|
+
const referenceTargets = references.map((ref) => ref.target).filter(isNonNullable);
|
|
81
|
+
const referenceSources = objects.filter((obj) => {
|
|
82
|
+
const refs = getReferences(obj);
|
|
83
|
+
return refs.some((ref) => ref.target === record);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
related.push(...referenceTargets, ...referenceSources);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (options.relations) {
|
|
90
|
+
// TODO(dmaretskyi): Workaround until https://github.com/dxos/dxos/pull/10100 lands.
|
|
91
|
+
const isValidRelation = (obj: Obj.Any) => {
|
|
92
|
+
try {
|
|
93
|
+
return Relation.isRelation(obj) && Relation.getSource(obj) && Relation.getTarget(obj);
|
|
94
|
+
} catch {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const relations = objects.filter((obj) => Relation.isRelation(obj)).filter((obj) => isValidRelation(obj));
|
|
100
|
+
const targetObjects = relations
|
|
101
|
+
.filter((relation) => Relation.getTarget(relation) === record)
|
|
102
|
+
.map((relation) => Relation.getSource(relation));
|
|
103
|
+
const sourceObjects = relations
|
|
104
|
+
.filter((relation) => Relation.getSource(relation) === record)
|
|
105
|
+
.map((relation) => Relation.getTarget(relation));
|
|
106
|
+
|
|
107
|
+
related.push(...targetObjects, ...sourceObjects);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return related;
|
|
111
|
+
}, [record, objects]);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export default RecordArticle;
|
|
@@ -10,13 +10,32 @@ import { useTranslation } from '@dxos/react-ui';
|
|
|
10
10
|
import { ControlPage, ControlSection, controlItemClasses } from '@dxos/react-ui-form';
|
|
11
11
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { meta } from '../meta';
|
|
14
14
|
|
|
15
15
|
type SchemaPanelProps = { space: Space };
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
export const SchemaContainer = ({ space }: SchemaPanelProps) => {
|
|
18
|
+
const { t } = useTranslation(meta.id);
|
|
19
|
+
const schemas = useQuerySpaceSchemas(space);
|
|
20
|
+
|
|
21
|
+
// TODO(ZaymonFC): Support deleting Schema (DangerZone section).
|
|
22
|
+
return (
|
|
23
|
+
<StackItem.Content scrollable>
|
|
24
|
+
<ControlPage>
|
|
25
|
+
<ControlSection title={t('schema verbose label')} description={t('schema description')}>
|
|
26
|
+
<div role='none' className={controlItemClasses}>
|
|
27
|
+
{schemas.length === 0 && <div className='text-center plb-4'>{t('no schemas found message')}</div>}
|
|
28
|
+
{schemas.map((schema) => (
|
|
29
|
+
<div role='none' key={schema.id}>
|
|
30
|
+
{schema.typename}
|
|
31
|
+
</div>
|
|
32
|
+
))}
|
|
33
|
+
</div>
|
|
34
|
+
</ControlSection>
|
|
35
|
+
</ControlPage>
|
|
36
|
+
</StackItem.Content>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
20
39
|
|
|
21
40
|
/**
|
|
22
41
|
* Subscribe to and retrieve all schemas from a space's schema registry.
|
|
@@ -35,25 +54,3 @@ export const useQuerySpaceSchemas = (space: Space): Type.Schema[] => {
|
|
|
35
54
|
|
|
36
55
|
return schemas;
|
|
37
56
|
};
|
|
38
|
-
|
|
39
|
-
export const SchemaContainer = ({ space }: SchemaPanelProps) => {
|
|
40
|
-
const { t } = useTranslation(SPACE_PLUGIN);
|
|
41
|
-
const schemas = useQuerySpaceSchemas(space);
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<StackItem.Content classNames='block overflow-y-auto'>
|
|
45
|
-
<ControlPage>
|
|
46
|
-
<ControlSection title={t('schema verbose label')} description={t('schema description')}>
|
|
47
|
-
<div role='none' className={controlItemClasses}>
|
|
48
|
-
{schemas.length === 0 && <div className='text-center plb-4'>{t('no schemas found message')}</div>}
|
|
49
|
-
{schemas.map((schema) => (
|
|
50
|
-
<div key={schema.id}>
|
|
51
|
-
<div>{schema.typename}</div>
|
|
52
|
-
</div>
|
|
53
|
-
))}
|
|
54
|
-
</div>
|
|
55
|
-
</ControlSection>
|
|
56
|
-
</ControlPage>
|
|
57
|
-
</StackItem.Content>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
@@ -4,40 +4,45 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { createIntent
|
|
7
|
+
import { createIntent } from '@dxos/app-framework';
|
|
8
|
+
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
8
9
|
import { useClient } from '@dxos/react-client';
|
|
9
10
|
import { useSpaces } from '@dxos/react-client/echo';
|
|
10
11
|
import { IconButton, Input, List, ListItem, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import { ControlPage, ControlSection,
|
|
12
|
+
import { ControlGroup, ControlItemInput, ControlPage, ControlSection, controlItemClasses } from '@dxos/react-ui-form';
|
|
12
13
|
|
|
13
|
-
import {
|
|
14
|
+
import { meta } from '../meta';
|
|
14
15
|
import { SpaceAction, type SpaceSettingsProps } from '../types';
|
|
15
16
|
import { getSpaceDisplayName } from '../util';
|
|
16
17
|
|
|
17
18
|
export const SpacePluginSettings = ({ settings }: { settings: SpaceSettingsProps }) => {
|
|
18
|
-
const { t } = useTranslation(
|
|
19
|
+
const { t } = useTranslation(meta.id);
|
|
19
20
|
const client = useClient();
|
|
20
21
|
const spaces = useSpaces({ all: settings.showHidden });
|
|
21
22
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
22
23
|
|
|
23
|
-
// TODO(wittjosiah): Migrate to new form container.
|
|
24
24
|
return (
|
|
25
25
|
<ControlPage>
|
|
26
26
|
<ControlSection title={t('space settings label')} description={t('space settings description')}>
|
|
27
|
-
<
|
|
28
|
-
<
|
|
27
|
+
<ControlGroup>
|
|
28
|
+
<ControlItemInput title={t('show hidden spaces label')}>
|
|
29
29
|
<Input.Switch
|
|
30
30
|
checked={settings.showHidden}
|
|
31
31
|
onCheckedChange={(checked) => (settings.showHidden = !!checked)}
|
|
32
32
|
/>
|
|
33
|
-
</
|
|
34
|
-
</
|
|
33
|
+
</ControlItemInput>
|
|
34
|
+
</ControlGroup>
|
|
35
35
|
<List classNames={[controlItemClasses, 'flex flex-col gap-trimSm']}>
|
|
36
36
|
{spaces.map((space) => (
|
|
37
37
|
<ListItem.Root key={space.id} classNames='is-full items-center'>
|
|
38
38
|
{/* TODO(burdon): Should auto center and truncate; NOTE truncate doesn't work with flex grow. */}
|
|
39
39
|
<ListItem.Heading classNames='grow truncate !min-bs-0'>
|
|
40
|
-
{toLocalizedString(
|
|
40
|
+
{toLocalizedString(
|
|
41
|
+
getSpaceDisplayName(space, {
|
|
42
|
+
personal: space === client.spaces.default,
|
|
43
|
+
}),
|
|
44
|
+
t,
|
|
45
|
+
)}
|
|
41
46
|
</ListItem.Heading>
|
|
42
47
|
<IconButton
|
|
43
48
|
icon='ph--faders--regular'
|
package/src/components/{SpacePresence.stories.tsx → SpacePresence/SpacePresence.stories.tsx}
RENAMED
|
@@ -2,20 +2,18 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
8
|
import { IdentityDid, PublicKey } from '@dxos/keys';
|
|
11
9
|
import { HaloSpaceMember, SpaceMember } from '@dxos/react-client/echo';
|
|
12
|
-
import {
|
|
10
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
13
11
|
|
|
14
|
-
import { translations } from '
|
|
12
|
+
import { translations } from '../../translations';
|
|
15
13
|
|
|
16
14
|
import { FullPresence, type Member, type MemberPresenceProps, SmallPresence } from './SpacePresence';
|
|
17
15
|
|
|
18
|
-
const
|
|
16
|
+
const viewers = (n: number, currentlyAttended = true): Member[] =>
|
|
19
17
|
Array.from({ length: n }, () => ({
|
|
20
18
|
role: HaloSpaceMember.Role.ADMIN,
|
|
21
19
|
identity: { did: IdentityDid.random(), identityKey: PublicKey.random() },
|
|
@@ -24,6 +22,16 @@ const nViewers = (n: number, currentlyAttended = true): Member[] =>
|
|
|
24
22
|
currentlyAttended,
|
|
25
23
|
}));
|
|
26
24
|
|
|
25
|
+
const meta = {
|
|
26
|
+
title: 'plugins/plugin-space/SpacePresence',
|
|
27
|
+
decorators: [withTheme],
|
|
28
|
+
parameters: {
|
|
29
|
+
translations,
|
|
30
|
+
},
|
|
31
|
+
} satisfies Meta<typeof IdentityDid>;
|
|
32
|
+
|
|
33
|
+
export default meta;
|
|
34
|
+
|
|
27
35
|
export const Full = (props: MemberPresenceProps) => {
|
|
28
36
|
const p: MemberPresenceProps = {
|
|
29
37
|
...props,
|
|
@@ -32,31 +40,31 @@ export const Full = (props: MemberPresenceProps) => {
|
|
|
32
40
|
return (
|
|
33
41
|
<div className='p-4'>
|
|
34
42
|
<div className='p-3'>
|
|
35
|
-
<FullPresence members={
|
|
43
|
+
<FullPresence members={viewers(1)} {...p} />
|
|
36
44
|
</div>
|
|
37
45
|
<div className='p-3'>
|
|
38
|
-
<FullPresence members={
|
|
46
|
+
<FullPresence members={viewers(2)} {...p} />
|
|
39
47
|
</div>
|
|
40
48
|
<div className='p-3'>
|
|
41
|
-
<FullPresence members={
|
|
49
|
+
<FullPresence members={viewers(3)} {...p} />
|
|
42
50
|
</div>
|
|
43
51
|
<div className='p-3'>
|
|
44
|
-
<FullPresence members={
|
|
52
|
+
<FullPresence members={viewers(3, false)} {...p} />
|
|
45
53
|
</div>
|
|
46
54
|
<div className='p-3'>
|
|
47
|
-
<FullPresence members={
|
|
55
|
+
<FullPresence members={viewers(4)} {...p} />
|
|
48
56
|
</div>
|
|
49
57
|
<div className='p-3'>
|
|
50
|
-
<FullPresence members={
|
|
58
|
+
<FullPresence members={viewers(5)} {...p} />
|
|
51
59
|
</div>
|
|
52
60
|
<div className='p-3'>
|
|
53
|
-
<FullPresence members={
|
|
61
|
+
<FullPresence members={viewers(5, false)} {...p} />
|
|
54
62
|
</div>
|
|
55
63
|
<div className='p-3'>
|
|
56
|
-
<FullPresence members={
|
|
64
|
+
<FullPresence members={viewers(10)} {...p} />
|
|
57
65
|
</div>
|
|
58
66
|
<div className='p-3'>
|
|
59
|
-
<FullPresence members={
|
|
67
|
+
<FullPresence members={viewers(100)} {...p} />
|
|
60
68
|
</div>
|
|
61
69
|
</div>
|
|
62
70
|
);
|
|
@@ -98,11 +106,3 @@ export const Small = () => {
|
|
|
98
106
|
</div>
|
|
99
107
|
);
|
|
100
108
|
};
|
|
101
|
-
|
|
102
|
-
const meta: Meta = {
|
|
103
|
-
title: 'plugins/plugin-space/SpacePresence',
|
|
104
|
-
decorators: [withTheme, withLayout()],
|
|
105
|
-
parameters: { translations },
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
export default meta;
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Option from 'effect/Option';
|
|
6
6
|
import React, { forwardRef, useCallback, useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { useAppGraph, useCapability } from '@dxos/app-framework';
|
|
8
|
+
import { useAppGraph, useCapability } from '@dxos/app-framework/react';
|
|
9
9
|
import { generateName } from '@dxos/display-name';
|
|
10
|
-
import { type Type } from '@dxos/echo';
|
|
10
|
+
import { Obj, type Type } from '@dxos/echo';
|
|
11
11
|
import { PublicKey, useClient } from '@dxos/react-client';
|
|
12
|
-
import { type SpaceMember,
|
|
12
|
+
import { type SpaceMember, getSpace, useMembers } from '@dxos/react-client/echo';
|
|
13
13
|
import { type Identity, useIdentity } from '@dxos/react-client/halo';
|
|
14
14
|
import {
|
|
15
15
|
Avatar,
|
|
@@ -27,10 +27,10 @@ import {
|
|
|
27
27
|
import { AttentionGlyph, type AttentionGlyphProps, useAttended, useAttention } from '@dxos/react-ui-attention';
|
|
28
28
|
import { ComplexMap, keyToFallback } from '@dxos/util';
|
|
29
29
|
|
|
30
|
-
import { SpaceCapabilities } from '
|
|
31
|
-
import { usePath } from '
|
|
32
|
-
import {
|
|
33
|
-
import type
|
|
30
|
+
import { SpaceCapabilities } from '../../capabilities';
|
|
31
|
+
import { usePath } from '../../hooks';
|
|
32
|
+
import { meta } from '../../meta';
|
|
33
|
+
import { type ObjectViewerProps } from '../../types';
|
|
34
34
|
|
|
35
35
|
// TODO(thure): Get/derive these values from protocol
|
|
36
36
|
const REFRESH_INTERVAL = 5000;
|
|
@@ -42,7 +42,12 @@ const noViewers = new ComplexMap<PublicKey, ObjectViewerProps>(PublicKey.hash);
|
|
|
42
42
|
// TODO(wittjosiah): Factor out?
|
|
43
43
|
const getName = (identity: Identity) => identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
|
|
44
44
|
|
|
45
|
-
export
|
|
45
|
+
export type SpacePresenceProps = {
|
|
46
|
+
object: Type.Expando;
|
|
47
|
+
spaceKey?: PublicKey;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const SpacePresence = ({ object, spaceKey }: SpacePresenceProps) => {
|
|
46
51
|
// TODO(wittjosiah): Doesn't need to be mutable but readonly type messes with ComplexMap.
|
|
47
52
|
const spaceState = useCapability(SpaceCapabilities.MutableState);
|
|
48
53
|
const client = useClient();
|
|
@@ -70,7 +75,7 @@ export const SpacePresence = ({ object, spaceKey }: { object: Type.Expando; spac
|
|
|
70
75
|
return null;
|
|
71
76
|
}
|
|
72
77
|
|
|
73
|
-
const currentObjectViewers = spaceState.viewersByObject[
|
|
78
|
+
const currentObjectViewers = spaceState.viewersByObject[Obj.getDXN(object).toString()] ?? noViewers;
|
|
74
79
|
|
|
75
80
|
const membersForObject = spaceMembers
|
|
76
81
|
.filter((member) => memberOnline(member) && memberIsNotSelf(member))
|
|
@@ -254,7 +259,7 @@ export type SmallPresenceProps = {
|
|
|
254
259
|
} & Pick<AttentionGlyphProps, 'attended' | 'containsAttended'>;
|
|
255
260
|
|
|
256
261
|
export const SmallPresence = ({ count = 0, attended, containsAttended }: SmallPresenceProps) => {
|
|
257
|
-
const { t } = useTranslation(
|
|
262
|
+
const { t } = useTranslation(meta.id);
|
|
258
263
|
|
|
259
264
|
return (
|
|
260
265
|
<Tooltip.Trigger asChild content={t('presence label', { count })} side='bottom'>
|
|
@@ -4,16 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { LayoutAction, createIntent
|
|
8
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent } from '@dxos/app-framework';
|
|
8
|
+
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
9
|
+
import { type Space } from '@dxos/client/echo';
|
|
9
10
|
import { Button, Input, Popover, useTranslation } from '@dxos/react-ui';
|
|
10
11
|
|
|
11
|
-
import {
|
|
12
|
+
import { meta } from '../../meta';
|
|
12
13
|
|
|
13
|
-
export const
|
|
14
|
+
export const SPACE_RENAME_POPOVER = `${meta.id}/SpaceRenamePopover`;
|
|
14
15
|
|
|
15
|
-
export const
|
|
16
|
-
const { t } = useTranslation(
|
|
16
|
+
export const SpaceRenamePopover = ({ space }: { space: Space }) => {
|
|
17
|
+
const { t } = useTranslation(meta.id);
|
|
17
18
|
const doneButton = useRef<HTMLButtonElement>(null);
|
|
18
19
|
const [name, setName] = useState(space.properties.name ?? '');
|
|
19
20
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
@@ -2,38 +2,45 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
8
|
+
import { IntentPlugin } from '@dxos/app-framework';
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { useClientProvider, withClientProvider } from '@dxos/react-client/testing';
|
|
11
|
-
import { withTheme } from '@dxos/
|
|
11
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
12
12
|
|
|
13
13
|
import { translations } from '../../translations';
|
|
14
14
|
|
|
15
15
|
import { SpaceSettingsContainer, type SpaceSettingsContainerProps } from './SpaceSettingsContainer';
|
|
16
16
|
|
|
17
|
-
const Story = (
|
|
17
|
+
const Story = (props: Partial<SpaceSettingsContainerProps>) => {
|
|
18
18
|
const { space } = useClientProvider();
|
|
19
19
|
return (
|
|
20
20
|
<div role='none' className='p-2 border border-primary-500 rounded'>
|
|
21
|
-
<SpaceSettingsContainer {...
|
|
21
|
+
<SpaceSettingsContainer {...props} space={space!} />
|
|
22
22
|
</div>
|
|
23
23
|
);
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
const meta
|
|
26
|
+
const meta = {
|
|
27
27
|
title: 'plugins/plugin-space/SpaceSettingsContainer',
|
|
28
28
|
component: SpaceSettingsContainer,
|
|
29
29
|
render: Story,
|
|
30
|
-
decorators: [
|
|
30
|
+
decorators: [
|
|
31
|
+
withTheme,
|
|
32
|
+
withClientProvider({ createIdentity: true, createSpace: true }),
|
|
33
|
+
// TODO(wittjosiah): Try to write story which does not depend on plugin manager.
|
|
34
|
+
withPluginManager({ plugins: [IntentPlugin()] }),
|
|
35
|
+
],
|
|
31
36
|
parameters: {
|
|
32
37
|
translations,
|
|
33
38
|
layout: 'centered',
|
|
34
39
|
},
|
|
35
|
-
}
|
|
40
|
+
} satisfies Meta<typeof SpaceSettingsContainer>;
|
|
36
41
|
|
|
37
42
|
export default meta;
|
|
38
43
|
|
|
44
|
+
type Story = StoryObj<typeof meta>;
|
|
45
|
+
|
|
39
46
|
export const Default: StoryObj<typeof SpaceSettingsContainer> = {};
|
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Function from 'effect/Function';
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
6
7
|
import React, { type ChangeEvent, useCallback, useMemo, useState } from 'react';
|
|
7
8
|
|
|
8
|
-
import { LayoutAction, chain, createIntent
|
|
9
|
+
import { LayoutAction, chain, createIntent } from '@dxos/app-framework';
|
|
10
|
+
import { useIntentDispatcher } from '@dxos/app-framework/react';
|
|
9
11
|
import { log } from '@dxos/log';
|
|
10
12
|
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
11
13
|
import { useClient } from '@dxos/react-client';
|
|
12
14
|
import { type Space, SpaceState } from '@dxos/react-client/echo';
|
|
13
|
-
import { Button, Input, useMulticastObservable, useTranslation } from '@dxos/react-ui';
|
|
15
|
+
import { Button, Input, useFileDownload, useMulticastObservable, useTranslation } from '@dxos/react-ui';
|
|
14
16
|
import {
|
|
15
17
|
ControlItem,
|
|
16
18
|
ControlItemInput,
|
|
@@ -22,11 +24,15 @@ import {
|
|
|
22
24
|
import { HuePicker, IconPicker } from '@dxos/react-ui-pickers';
|
|
23
25
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
24
26
|
|
|
25
|
-
import {
|
|
27
|
+
import { meta } from '../../meta';
|
|
26
28
|
import { SpaceAction, SpaceForm } from '../../types';
|
|
27
29
|
|
|
28
30
|
const FormSchema = SpaceForm.pipe(
|
|
29
|
-
Schema.extend(
|
|
31
|
+
Schema.extend(
|
|
32
|
+
Schema.Struct({
|
|
33
|
+
archived: Schema.Boolean.annotations({ title: 'Archive Space' }),
|
|
34
|
+
}),
|
|
35
|
+
),
|
|
30
36
|
);
|
|
31
37
|
|
|
32
38
|
export type SpaceSettingsContainerProps = {
|
|
@@ -35,7 +41,7 @@ export type SpaceSettingsContainerProps = {
|
|
|
35
41
|
|
|
36
42
|
// TODO(wittjosiah): Handle space migrations here?
|
|
37
43
|
export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) => {
|
|
38
|
-
const { t } = useTranslation(
|
|
44
|
+
const { t } = useTranslation(meta.id);
|
|
39
45
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
40
46
|
const client = useClient();
|
|
41
47
|
const archived = useMulticastObservable(space.state) === SpaceState.SPACE_INACTIVE;
|
|
@@ -69,9 +75,12 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
69
75
|
}
|
|
70
76
|
if (properties.archived && !archived) {
|
|
71
77
|
void dispatch(
|
|
72
|
-
pipe(
|
|
78
|
+
Function.pipe(
|
|
73
79
|
createIntent(SpaceAction.Close, { space }),
|
|
74
|
-
chain(LayoutAction.SwitchWorkspace, {
|
|
80
|
+
chain(LayoutAction.SwitchWorkspace, {
|
|
81
|
+
part: 'workspace',
|
|
82
|
+
subject: client.spaces.default.id,
|
|
83
|
+
}),
|
|
75
84
|
),
|
|
76
85
|
);
|
|
77
86
|
} else if (!properties.archived && archived) {
|
|
@@ -111,31 +120,25 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
111
120
|
);
|
|
112
121
|
},
|
|
113
122
|
icon: ({ type, label, getValue, onValueChange }) => {
|
|
114
|
-
const handleChange = useCallback((
|
|
115
|
-
const
|
|
123
|
+
const handleChange = useCallback((icon: string) => onValueChange(type, icon), [onValueChange, type]);
|
|
124
|
+
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange, type]);
|
|
116
125
|
return (
|
|
117
126
|
<ControlItem title={label} description={t('icon description')}>
|
|
118
127
|
<IconPicker
|
|
119
128
|
value={getValue()}
|
|
120
129
|
onChange={handleChange}
|
|
121
|
-
onReset={
|
|
130
|
+
onReset={handleReset}
|
|
122
131
|
classNames='justify-self-end'
|
|
123
|
-
iconSize={5}
|
|
124
132
|
/>
|
|
125
133
|
</ControlItem>
|
|
126
134
|
);
|
|
127
135
|
},
|
|
128
136
|
hue: ({ type, label, getValue, onValueChange }) => {
|
|
129
137
|
const handleChange = useCallback((nextHue: string) => onValueChange(type, nextHue), [onValueChange, type]);
|
|
130
|
-
const
|
|
138
|
+
const handleReset = useCallback(() => onValueChange(type, undefined), [onValueChange, type]);
|
|
131
139
|
return (
|
|
132
140
|
<ControlItem title={label} description={t('hue description')}>
|
|
133
|
-
<HuePicker
|
|
134
|
-
value={getValue()}
|
|
135
|
-
onChange={handleChange}
|
|
136
|
-
onReset={handleHueReset}
|
|
137
|
-
classNames='[--hue-preview-size:1.25rem] justify-self-end'
|
|
138
|
-
/>
|
|
141
|
+
<HuePicker value={getValue()} onChange={handleChange} onReset={handleReset} classNames='justify-self-end' />
|
|
139
142
|
</ControlItem>
|
|
140
143
|
);
|
|
141
144
|
},
|
|
@@ -151,7 +154,11 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
151
154
|
const handleChange = useCallback(() => onValueChange(type, !getValue()), [onValueChange, type, getValue]);
|
|
152
155
|
return (
|
|
153
156
|
<ControlItemInput title={label} description={t('archive space description')}>
|
|
154
|
-
<Button
|
|
157
|
+
<Button
|
|
158
|
+
disabled={space === client.spaces.default}
|
|
159
|
+
variant={getValue() ? 'default' : 'destructive'}
|
|
160
|
+
onClick={handleChange}
|
|
161
|
+
>
|
|
155
162
|
{getValue() ? t('unarchive space label') : t('archive space label')}
|
|
156
163
|
</Button>
|
|
157
164
|
</ControlItemInput>
|
|
@@ -161,12 +168,20 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
161
168
|
[t, space],
|
|
162
169
|
);
|
|
163
170
|
|
|
171
|
+
const download = useFileDownload();
|
|
172
|
+
const handleBackup = useCallback(async () => {
|
|
173
|
+
const archive = await space.internal.export();
|
|
174
|
+
download(new Blob([archive.contents as Uint8Array<ArrayBuffer>]), archive.filename);
|
|
175
|
+
}, [space, download]);
|
|
176
|
+
|
|
164
177
|
return (
|
|
165
|
-
<StackItem.Content
|
|
178
|
+
<StackItem.Content scrollable>
|
|
166
179
|
<ControlPage>
|
|
167
180
|
<ControlSection
|
|
168
|
-
title={t('space properties settings verbose label', { ns:
|
|
169
|
-
description={t('space properties settings description', {
|
|
181
|
+
title={t('space properties settings verbose label', { ns: meta.id })}
|
|
182
|
+
description={t('space properties settings description', {
|
|
183
|
+
ns: meta.id,
|
|
184
|
+
})}
|
|
170
185
|
>
|
|
171
186
|
<Form
|
|
172
187
|
schema={FormSchema}
|
|
@@ -175,9 +190,15 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
175
190
|
onSave={handleSave}
|
|
176
191
|
Custom={customElements}
|
|
177
192
|
outerSpacing={false}
|
|
178
|
-
classNames='container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]
|
|
193
|
+
classNames='container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'
|
|
179
194
|
/>
|
|
180
195
|
</ControlSection>
|
|
196
|
+
<ControlItemInput
|
|
197
|
+
title={t('backup space label', { ns: meta.id })}
|
|
198
|
+
description={t('backup space description', { ns: meta.id })}
|
|
199
|
+
>
|
|
200
|
+
<Button onClick={handleBackup}>{t('download backup')}</Button>
|
|
201
|
+
</ControlItemInput>
|
|
181
202
|
</ControlPage>
|
|
182
203
|
</StackItem.Content>
|
|
183
204
|
);
|