@dxos/plugin-space 0.8.2-staging.7ac8446 → 0.8.2
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/app-graph-builder-DCWUULKX.mjs +328 -0
- package/dist/lib/browser/app-graph-builder-DCWUULKX.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-DSF2U3A5.mjs → app-graph-serializer-MLU7XI2P.mjs} +10 -10
- package/dist/lib/browser/app-graph-serializer-MLU7XI2P.mjs.map +7 -0
- package/dist/lib/browser/{chunk-KVRYWFZU.mjs → chunk-3LN4LJN6.mjs} +3 -8
- package/dist/lib/{node-esm/chunk-PIYAWT5N.mjs.map → browser/chunk-3LN4LJN6.mjs.map} +3 -3
- package/dist/lib/browser/chunk-7Y4M7GXO.mjs +94 -0
- package/dist/lib/browser/chunk-7Y4M7GXO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LO5UL6RU.mjs → chunk-N5QMRLKI.mjs} +78 -173
- package/dist/lib/browser/chunk-N5QMRLKI.mjs.map +7 -0
- package/dist/lib/browser/chunk-Q4BTFH2P.mjs +1900 -0
- package/dist/lib/browser/chunk-Q4BTFH2P.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5BDV575R.mjs → chunk-VEBKN45O.mjs} +21 -10
- package/dist/lib/browser/chunk-VEBKN45O.mjs.map +7 -0
- package/dist/lib/browser/chunk-W46VVHFM.mjs +288 -0
- package/dist/lib/browser/chunk-W46VVHFM.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-JR7BNXFH.mjs → identity-created-O63SIYOF.mjs} +5 -5
- package/dist/lib/browser/identity-created-O63SIYOF.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +34 -54
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-RKYILWWQ.mjs → intent-resolver-KBF3YU6I.mjs} +116 -108
- package/dist/lib/browser/intent-resolver-KBF3YU6I.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-6H7NX2M2.mjs → react-root-PVKJE4EZ.mjs} +6 -5
- package/dist/lib/browser/{react-surface-7AGLOVMK.mjs → react-surface-252P4NCK.mjs} +121 -54
- package/dist/lib/browser/react-surface-252P4NCK.mjs.map +7 -0
- package/dist/lib/browser/schema-defs-JMN74RNK.mjs +26 -0
- package/dist/lib/browser/schema-defs-JMN74RNK.mjs.map +7 -0
- package/dist/lib/browser/{schema-tools-YAXPRIXP.mjs → schema-tools-JIEMHUXV.mjs} +26 -26
- package/dist/lib/browser/schema-tools-JIEMHUXV.mjs.map +7 -0
- package/dist/lib/browser/{settings-PJPTJUPE.mjs → settings-2IN2WLUK.mjs} +4 -4
- package/dist/lib/browser/settings-2IN2WLUK.mjs.map +7 -0
- package/dist/lib/browser/{spaces-ready-BSSP7HHG.mjs → spaces-ready-L4QAGTDE.mjs} +20 -19
- package/dist/lib/browser/spaces-ready-L4QAGTDE.mjs.map +7 -0
- package/dist/lib/browser/{state-X7VLCC6E.mjs → state-6HOSHLIN.mjs} +3 -5
- package/dist/lib/browser/state-6HOSHLIN.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -7
- package/dist/lib/node/app-graph-builder-WC445X77.cjs +328 -0
- package/dist/lib/node/app-graph-builder-WC445X77.cjs.map +7 -0
- package/dist/lib/node/{app-graph-serializer-JELGJUAY.cjs → app-graph-serializer-UPQOQVMJ.cjs} +22 -22
- package/dist/lib/node/app-graph-serializer-UPQOQVMJ.cjs.map +7 -0
- package/dist/lib/node/chunk-5WLAXYE3.cjs +125 -0
- package/dist/lib/node/chunk-5WLAXYE3.cjs.map +7 -0
- package/dist/lib/node/{chunk-IKIDS6XF.cjs → chunk-7GQGM4ZF.cjs} +7 -13
- package/dist/lib/node/{chunk-IKIDS6XF.cjs.map → chunk-7GQGM4ZF.cjs.map} +3 -3
- package/dist/lib/node/{chunk-TUZWEPGX.cjs → chunk-COQYISES.cjs} +100 -198
- package/dist/lib/node/chunk-COQYISES.cjs.map +7 -0
- package/dist/lib/node/{chunk-PU2EYH4E.cjs → chunk-DXL5TDFP.cjs} +25 -14
- package/dist/lib/node/chunk-DXL5TDFP.cjs.map +7 -0
- package/dist/lib/node/chunk-FXHI7JNY.cjs +315 -0
- package/dist/lib/node/chunk-FXHI7JNY.cjs.map +7 -0
- package/dist/lib/node/chunk-Q3YZEYZT.cjs +1904 -0
- package/dist/lib/node/chunk-Q3YZEYZT.cjs.map +7 -0
- package/dist/lib/node/{identity-created-XU4HFV2T.cjs → identity-created-UXEAUGC7.cjs} +7 -7
- package/dist/lib/node/identity-created-UXEAUGC7.cjs.map +7 -0
- package/dist/lib/node/index.cjs +83 -105
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-VJ7YV74L.cjs → intent-resolver-SVFJKUH7.cjs} +161 -152
- package/dist/lib/node/intent-resolver-SVFJKUH7.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-root-TEL5RW3N.cjs → react-root-DDPDUMCG.cjs} +11 -10
- package/dist/lib/node/{react-root-TEL5RW3N.cjs.map → react-root-DDPDUMCG.cjs.map} +1 -1
- package/dist/lib/node/{react-surface-2H3S5TY5.cjs → react-surface-JUIU37BX.cjs} +144 -77
- package/dist/lib/node/react-surface-JUIU37BX.cjs.map +7 -0
- package/dist/lib/node/{schema-PPJ5BZ3A.cjs → schema-defs-XLFBG3XK.cjs} +14 -12
- package/dist/lib/node/schema-defs-XLFBG3XK.cjs.map +7 -0
- package/dist/lib/node/{schema-tools-BLIMOZYY.cjs → schema-tools-ZG6Z2QRC.cjs} +32 -32
- package/dist/lib/node/schema-tools-ZG6Z2QRC.cjs.map +7 -0
- package/dist/lib/node/{settings-WVFP2UEP.cjs → settings-FOH7EB5C.cjs} +7 -7
- package/dist/lib/node/settings-FOH7EB5C.cjs.map +7 -0
- package/dist/lib/node/{spaces-ready-7DNZSUOG.cjs → spaces-ready-VXQYCBII.cjs} +27 -26
- package/dist/lib/node/spaces-ready-VXQYCBII.cjs.map +7 -0
- package/dist/lib/node/{state-5KX6WBJH.cjs → state-ZT3MTZXB.cjs} +7 -9
- package/dist/lib/node/state-ZT3MTZXB.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +15 -15
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/app-graph-builder-E7CCGPQJ.mjs +329 -0
- package/dist/lib/node-esm/app-graph-builder-E7CCGPQJ.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-FXONFKOE.mjs → app-graph-serializer-UCMSLPIA.mjs} +10 -10
- package/dist/lib/node-esm/app-graph-serializer-UCMSLPIA.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PIYAWT5N.mjs → chunk-4X4Y63ND.mjs} +3 -8
- package/dist/lib/{browser/chunk-KVRYWFZU.mjs.map → node-esm/chunk-4X4Y63ND.mjs.map} +3 -3
- package/dist/lib/node-esm/chunk-FTELJGEG.mjs +289 -0
- package/dist/lib/node-esm/chunk-FTELJGEG.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GH2FGJXH.mjs +96 -0
- package/dist/lib/node-esm/chunk-GH2FGJXH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HL2Z2GNW.mjs +1901 -0
- package/dist/lib/node-esm/chunk-HL2Z2GNW.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3ZOUV4DF.mjs → chunk-OSPEGYX3.mjs} +21 -10
- package/dist/lib/node-esm/chunk-OSPEGYX3.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZGLK25WQ.mjs → chunk-XAZNQ3QN.mjs} +78 -173
- package/dist/lib/node-esm/chunk-XAZNQ3QN.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-WJKAS2PV.mjs → identity-created-ZECO4NH3.mjs} +5 -5
- package/dist/lib/node-esm/identity-created-ZECO4NH3.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +34 -54
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-ZFNSA4CM.mjs → intent-resolver-K2UDBF2R.mjs} +116 -108
- package/dist/lib/node-esm/intent-resolver-K2UDBF2R.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-PRBJMWLQ.mjs → react-root-6F7B3OVO.mjs} +6 -5
- package/dist/lib/{browser/react-root-6H7NX2M2.mjs.map → node-esm/react-root-6F7B3OVO.mjs.map} +1 -1
- package/dist/lib/node-esm/{react-surface-RCZG2PNF.mjs → react-surface-NP3Y6BNZ.mjs} +121 -54
- package/dist/lib/node-esm/react-surface-NP3Y6BNZ.mjs.map +7 -0
- package/dist/lib/node-esm/schema-defs-QZJS6UXN.mjs +27 -0
- package/dist/lib/node-esm/schema-defs-QZJS6UXN.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-tools-IU7EX5A5.mjs → schema-tools-2Y4D42PD.mjs} +26 -26
- package/dist/lib/node-esm/schema-tools-2Y4D42PD.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-FJZPC2TV.mjs → settings-Q4XDFSYD.mjs} +4 -4
- package/dist/lib/node-esm/settings-Q4XDFSYD.mjs.map +7 -0
- package/dist/lib/node-esm/{spaces-ready-7X5PGB2V.mjs → spaces-ready-JHKPD4PH.mjs} +20 -19
- package/dist/lib/node-esm/spaces-ready-JHKPD4PH.mjs.map +7 -0
- package/dist/lib/node-esm/{state-Z6E2YTNC.mjs → state-4ATRHSKA.mjs} +3 -5
- package/dist/lib/node-esm/state-4ATRHSKA.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -7
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -179
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +2 -2
- package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -8
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts +2 -2
- package/dist/types/src/capabilities/identity-created.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +9 -184
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -3
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts +4 -0
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema-tools.d.ts +3 -3
- package/dist/types/src/capabilities/schema-tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts +2 -2
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +2 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
- package/dist/types/src/components/CollectionMain.d.ts.map +1 -1
- package/dist/types/src/components/CollectionSection.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +2 -2
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/MenuFooter.d.ts +2 -2
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/{ObjectSettingsContainer → ObjectSettings}/AdvancedObjectSettings.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/{ObjectSettingsContainer → ObjectSettings}/BaseObjectSettings.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts.map +1 -0
- package/dist/types/src/components/{ObjectSettingsContainer → ObjectSettings}/ObjectSettingsContainer.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/PersistenceStatus.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts +2 -2
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts.map +1 -1
- package/dist/types/src/components/SchemaContainer.d.ts +13 -0
- package/dist/types/src/components/SchemaContainer.d.ts.map +1 -0
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts +0 -2
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +7 -0
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/SpaceSettings/index.d.ts +0 -1
- package/dist/types/src/components/SpaceSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +1 -8
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/save-tracker.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/status.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useActiveSpace.d.ts +4 -0
- package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -0
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts +14 -0
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -0
- package/dist/types/src/hooks/usePath.d.ts +3 -2
- package/dist/types/src/hooks/usePath.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +17 -242
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/collection.d.ts +9 -8
- package/dist/types/src/types/collection.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +173 -146
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +36 -20
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +54 -47
- package/src/SpacePlugin.tsx +11 -20
- package/src/capabilities/app-graph-builder.ts +377 -230
- package/src/capabilities/app-graph-serializer.ts +8 -8
- package/src/capabilities/capabilities.ts +0 -9
- package/src/capabilities/identity-created.ts +5 -5
- package/src/capabilities/index.ts +2 -2
- package/src/capabilities/intent-resolver.ts +107 -111
- package/src/capabilities/react-surface.tsx +111 -50
- package/src/capabilities/schema-defs.ts +30 -0
- package/src/capabilities/schema-tool.test.ts +2 -3
- package/src/capabilities/schema-tools.ts +29 -29
- package/src/capabilities/settings.ts +2 -2
- package/src/capabilities/spaces-ready.ts +17 -15
- package/src/capabilities/state.ts +3 -5
- package/src/components/AwaitingObject.tsx +1 -1
- package/src/components/CollectionMain.tsx +2 -5
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +4 -4
- package/src/components/CreateDialog/CreateObjectDialog.tsx +4 -4
- package/src/components/CreateDialog/CreateObjectPanel.tsx +3 -25
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +6 -3
- package/src/components/MembersContainer.stories.tsx +1 -5
- package/src/components/MembersContainer.tsx +80 -54
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/{ObjectSettingsContainer → ObjectSettings}/AdvancedObjectSettings.tsx +4 -4
- package/src/components/{ObjectSettingsContainer → ObjectSettings}/BaseObjectSettings.tsx +2 -2
- package/src/components/{ObjectSettingsContainer → ObjectSettings}/ObjectSettingsContainer.tsx +4 -4
- package/src/components/PersistenceStatus.tsx +11 -14
- package/src/components/PopoverRenameObject.tsx +15 -9
- package/src/components/PopoverRenameSpace.tsx +9 -1
- package/src/components/SchemaContainer.tsx +59 -0
- package/src/components/SpacePluginSettings.tsx +27 -2
- package/src/components/SpacePresence.stories.tsx +1 -1
- package/src/components/SpacePresence.tsx +60 -65
- package/src/components/SpaceSettings/{SpacePropertiesForm.stories.tsx → SpaceSettingsContainer.stories.tsx} +6 -6
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +159 -39
- package/src/components/SpaceSettings/index.ts +0 -1
- package/src/components/SyncStatus/InlineSyncStatus.tsx +15 -24
- package/src/components/SyncStatus/SyncStatus.tsx +6 -69
- package/src/components/index.ts +2 -3
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useActiveSpace.ts +20 -0
- package/src/hooks/useInputSurfaceLookup.tsx +31 -0
- package/src/hooks/usePath.ts +9 -6
- package/src/index.ts +3 -2
- package/src/translations.ts +19 -7
- package/src/types/collection.ts +6 -4
- package/src/types/index.ts +0 -1
- package/src/types/types.ts +130 -101
- package/src/util.tsx +75 -172
- package/dist/lib/browser/app-graph-builder-GMFCSOLG.mjs +0 -315
- package/dist/lib/browser/app-graph-builder-GMFCSOLG.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-DSF2U3A5.mjs.map +0 -7
- package/dist/lib/browser/chunk-5BDV575R.mjs.map +0 -7
- package/dist/lib/browser/chunk-AYW4IDRT.mjs +0 -275
- package/dist/lib/browser/chunk-AYW4IDRT.mjs.map +0 -7
- package/dist/lib/browser/chunk-JZXWPMLA.mjs +0 -2081
- package/dist/lib/browser/chunk-JZXWPMLA.mjs.map +0 -7
- package/dist/lib/browser/chunk-LO5UL6RU.mjs.map +0 -7
- package/dist/lib/browser/identity-created-JR7BNXFH.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-RKYILWWQ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-7AGLOVMK.mjs.map +0 -7
- package/dist/lib/browser/schema-FHTA26SW.mjs +0 -24
- package/dist/lib/browser/schema-FHTA26SW.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-YAXPRIXP.mjs.map +0 -7
- package/dist/lib/browser/settings-PJPTJUPE.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-BSSP7HHG.mjs.map +0 -7
- package/dist/lib/browser/state-X7VLCC6E.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-DPY7AUZE.cjs +0 -318
- package/dist/lib/node/app-graph-builder-DPY7AUZE.cjs.map +0 -7
- package/dist/lib/node/app-graph-serializer-JELGJUAY.cjs.map +0 -7
- package/dist/lib/node/chunk-3GKCNADA.cjs +0 -2074
- package/dist/lib/node/chunk-3GKCNADA.cjs.map +0 -7
- package/dist/lib/node/chunk-PU2EYH4E.cjs.map +0 -7
- package/dist/lib/node/chunk-TUZWEPGX.cjs.map +0 -7
- package/dist/lib/node/chunk-WDEIFDTX.cjs +0 -300
- package/dist/lib/node/chunk-WDEIFDTX.cjs.map +0 -7
- package/dist/lib/node/identity-created-XU4HFV2T.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-VJ7YV74L.cjs.map +0 -7
- package/dist/lib/node/react-surface-2H3S5TY5.cjs.map +0 -7
- package/dist/lib/node/schema-PPJ5BZ3A.cjs.map +0 -7
- package/dist/lib/node/schema-tools-BLIMOZYY.cjs.map +0 -7
- package/dist/lib/node/settings-WVFP2UEP.cjs.map +0 -7
- package/dist/lib/node/spaces-ready-7DNZSUOG.cjs.map +0 -7
- package/dist/lib/node/state-5KX6WBJH.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-42IGWRPL.mjs +0 -316
- package/dist/lib/node-esm/app-graph-builder-42IGWRPL.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-FXONFKOE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3ZOUV4DF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BEWBZ4Q4.mjs +0 -2082
- package/dist/lib/node-esm/chunk-BEWBZ4Q4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FC4UHDPL.mjs +0 -276
- package/dist/lib/node-esm/chunk-FC4UHDPL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZGLK25WQ.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-WJKAS2PV.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-ZFNSA4CM.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-RCZG2PNF.mjs.map +0 -7
- package/dist/lib/node-esm/schema-OUZKVYM5.mjs +0 -25
- package/dist/lib/node-esm/schema-OUZKVYM5.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-IU7EX5A5.mjs.map +0 -7
- package/dist/lib/node-esm/settings-FJZPC2TV.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-7X5PGB2V.mjs.map +0 -7
- package/dist/lib/node-esm/state-Z6E2YTNC.mjs.map +0 -7
- package/dist/types/src/capabilities/schema.d.ts +0 -4
- package/dist/types/src/capabilities/schema.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettingsContainer/AdvancedObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettingsContainer/BaseObjectSettings.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettingsContainer/ForeignKeys.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettingsContainer/ObjectSettingsContainer.d.ts.map +0 -1
- package/dist/types/src/components/ObjectSettingsContainer/index.d.ts.map +0 -1
- package/dist/types/src/components/PopoverAddSpace.d.ts +0 -4
- package/dist/types/src/components/PopoverAddSpace.d.ts.map +0 -1
- package/dist/types/src/components/ShareSpaceButton.d.ts +0 -9
- package/dist/types/src/components/ShareSpaceButton.d.ts.map +0 -1
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts +0 -10
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.d.ts +0 -7
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.stories.d.ts +0 -7
- package/dist/types/src/components/SpaceSettings/SpacePropertiesForm.stories.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/Space.d.ts +0 -13
- package/dist/types/src/components/SyncStatus/Space.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts +0 -9
- package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/sync-state.d.ts +0 -18
- package/dist/types/src/components/SyncStatus/sync-state.d.ts.map +0 -1
- package/dist/types/src/types/thread.d.ts +0 -128
- package/dist/types/src/types/thread.d.ts.map +0 -1
- package/src/capabilities/schema.ts +0 -27
- package/src/components/PopoverAddSpace.tsx +0 -46
- package/src/components/ShareSpaceButton.stories.tsx +0 -27
- package/src/components/ShareSpaceButton.tsx +0 -32
- package/src/components/SpaceSettings/SpacePropertiesForm.tsx +0 -136
- package/src/components/SyncStatus/Space.tsx +0 -133
- package/src/components/SyncStatus/SyncStatusDetail.stories.tsx +0 -89
- package/src/components/SyncStatus/sync-state.ts +0 -101
- package/src/types/thread.ts +0 -24
- /package/dist/lib/{node-esm/react-root-PRBJMWLQ.mjs.map → browser/react-root-PVKJE4EZ.mjs.map} +0 -0
- /package/dist/types/src/components/{ObjectSettingsContainer → ObjectSettings}/ForeignKeys.d.ts +0 -0
- /package/dist/types/src/components/{ObjectSettingsContainer → ObjectSettings}/index.d.ts +0 -0
- /package/src/components/{ObjectSettingsContainer → ObjectSettings}/ForeignKeys.tsx +0 -0
- /package/src/components/{ObjectSettingsContainer → ObjectSettings}/index.ts +0 -0
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { Option } from 'effect';
|
|
6
|
+
import React, { forwardRef, useCallback, useEffect, useState } from 'react';
|
|
6
7
|
|
|
7
8
|
import { useAppGraph, useCapability } from '@dxos/app-framework';
|
|
8
9
|
import { generateName } from '@dxos/display-name';
|
|
@@ -16,10 +17,12 @@ import {
|
|
|
16
17
|
type Size,
|
|
17
18
|
type ThemedClassName,
|
|
18
19
|
Tooltip,
|
|
20
|
+
Popover,
|
|
19
21
|
useTranslation,
|
|
20
22
|
List,
|
|
21
23
|
ListItem,
|
|
22
24
|
useDefaultValue,
|
|
25
|
+
type DxAvatar,
|
|
23
26
|
} from '@dxos/react-ui';
|
|
24
27
|
import { AttentionGlyph, useAttended, useAttention, type AttentionGlyphProps } from '@dxos/react-ui-attention';
|
|
25
28
|
import { ComplexMap, keyToFallback } from '@dxos/util';
|
|
@@ -114,40 +117,38 @@ export const FullPresence = (props: MemberPresenceProps) => {
|
|
|
114
117
|
return (
|
|
115
118
|
<div className='dx-avatar-group' data-testid='spacePlugin.presence'>
|
|
116
119
|
{members.slice(0, 3).map((member, i) => (
|
|
117
|
-
<Tooltip.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
</Tooltip.Content>
|
|
132
|
-
</Tooltip.Portal>
|
|
133
|
-
</Tooltip.Root>
|
|
120
|
+
<Tooltip.Trigger
|
|
121
|
+
key={member.identity.identityKey.toHex()}
|
|
122
|
+
side='bottom'
|
|
123
|
+
content={getName(member.identity)}
|
|
124
|
+
className='grid focus:outline-none'
|
|
125
|
+
>
|
|
126
|
+
<PresenceAvatar
|
|
127
|
+
identity={member.identity}
|
|
128
|
+
match={member.currentlyAttended} // TODO(Zan): Match always true now we're showing 'members viewing current object'.
|
|
129
|
+
index={members.length - i}
|
|
130
|
+
onClick={() => onMemberClick?.(member)}
|
|
131
|
+
size={size}
|
|
132
|
+
/>
|
|
133
|
+
</Tooltip.Trigger>
|
|
134
134
|
))}
|
|
135
135
|
|
|
136
136
|
{members.length > 3 && (
|
|
137
|
-
<
|
|
138
|
-
<
|
|
137
|
+
<Popover.Root>
|
|
138
|
+
<Popover.Trigger className='grid focus:outline-none'>
|
|
139
139
|
<Avatar.Root>
|
|
140
140
|
{/* TODO(wittjosiah): Make text fit. */}
|
|
141
141
|
<Avatar.Content
|
|
142
142
|
status='inactive'
|
|
143
143
|
style={{ zIndex: members.length - 4 }}
|
|
144
144
|
fallback={`+${members.length - 3}`}
|
|
145
|
+
size={size}
|
|
145
146
|
/>
|
|
146
147
|
</Avatar.Root>
|
|
147
|
-
</
|
|
148
|
-
<
|
|
149
|
-
<
|
|
150
|
-
<
|
|
148
|
+
</Popover.Trigger>
|
|
149
|
+
<Popover.Portal>
|
|
150
|
+
<Popover.Content side='bottom'>
|
|
151
|
+
<Popover.Arrow />
|
|
151
152
|
<List classNames='max-h-56 overflow-y-auto'>
|
|
152
153
|
{members.map((member) => (
|
|
153
154
|
<ListItem.Root
|
|
@@ -157,13 +158,13 @@ export const FullPresence = (props: MemberPresenceProps) => {
|
|
|
157
158
|
data-testid='identity-list-item'
|
|
158
159
|
>
|
|
159
160
|
{/* TODO(Zan): Match always true now we're showing 'members viewing current object'. */}
|
|
160
|
-
<
|
|
161
|
+
<PresenceAvatar identity={member.identity} size={size} showName match={member.currentlyAttended} />
|
|
161
162
|
</ListItem.Root>
|
|
162
163
|
))}
|
|
163
164
|
</List>
|
|
164
|
-
</
|
|
165
|
-
</
|
|
166
|
-
</
|
|
165
|
+
</Popover.Content>
|
|
166
|
+
</Popover.Portal>
|
|
167
|
+
</Popover.Root>
|
|
167
168
|
)}
|
|
168
169
|
</div>
|
|
169
170
|
);
|
|
@@ -177,26 +178,28 @@ type PresenceAvatarProps = Pick<AvatarContentProps, 'size'> & {
|
|
|
177
178
|
onClick?: () => void;
|
|
178
179
|
};
|
|
179
180
|
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
<Avatar.
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
181
|
+
const PresenceAvatar = forwardRef<DxAvatar, PresenceAvatarProps>(
|
|
182
|
+
({ identity, showName, match, index, onClick, size }, forwardedRef) => {
|
|
183
|
+
const status = match ? 'current' : 'active';
|
|
184
|
+
const fallbackValue = keyToFallback(identity.identityKey);
|
|
185
|
+
return (
|
|
186
|
+
<Avatar.Root>
|
|
187
|
+
<Avatar.Content
|
|
188
|
+
status={status}
|
|
189
|
+
hue={identity.profile?.data?.hue || fallbackValue.hue}
|
|
190
|
+
data-testid='spacePlugin.presence.member'
|
|
191
|
+
data-status={status}
|
|
192
|
+
size={size}
|
|
193
|
+
{...(index ? { style: { zIndex: index } } : {})}
|
|
194
|
+
onClick={onClick}
|
|
195
|
+
fallback={identity.profile?.data?.emoji || fallbackValue.emoji}
|
|
196
|
+
ref={forwardedRef}
|
|
197
|
+
/>
|
|
198
|
+
<Avatar.Label classNames={showName ? 'text-sm truncate pli-2' : 'sr-only'}>{getName(identity)}</Avatar.Label>
|
|
199
|
+
</Avatar.Root>
|
|
200
|
+
);
|
|
201
|
+
},
|
|
202
|
+
);
|
|
200
203
|
|
|
201
204
|
export type SmallPresenceLiveProps = {
|
|
202
205
|
id?: string;
|
|
@@ -215,7 +218,7 @@ export const SmallPresenceLive = ({ id, open, viewers }: SmallPresenceLiveProps)
|
|
|
215
218
|
const attended = useAttended();
|
|
216
219
|
const startOfAttention = attended.at(-1);
|
|
217
220
|
const path = usePath(graph, startOfAttention);
|
|
218
|
-
const containsAttended = !open && !isAttended && id && path ? path.includes(id) : false;
|
|
221
|
+
const containsAttended = !open && !isAttended && id && Option.isSome(path) ? path.value.includes(id) : false;
|
|
219
222
|
|
|
220
223
|
const getActiveViewers = (viewers: ComplexMap<PublicKey, ObjectViewerProps>): ObjectViewerProps[] => {
|
|
221
224
|
const moment = Date.now();
|
|
@@ -247,21 +250,13 @@ export const SmallPresence = ({ count = 0, attended, containsAttended }: SmallPr
|
|
|
247
250
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
248
251
|
|
|
249
252
|
return (
|
|
250
|
-
<Tooltip.
|
|
251
|
-
<
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
</Tooltip.Trigger>
|
|
259
|
-
<Tooltip.Portal>
|
|
260
|
-
<Tooltip.Content side='bottom'>
|
|
261
|
-
<span>{t('presence label', { count })}</span>
|
|
262
|
-
<Tooltip.Arrow />
|
|
263
|
-
</Tooltip.Content>
|
|
264
|
-
</Tooltip.Portal>
|
|
265
|
-
</Tooltip.Root>
|
|
253
|
+
<Tooltip.Trigger asChild content={t('presence label', { count })} side='bottom'>
|
|
254
|
+
<AttentionGlyph
|
|
255
|
+
attended={attended}
|
|
256
|
+
containsAttended={containsAttended}
|
|
257
|
+
presence={count > 1 ? 'many' : count === 1 ? 'one' : 'none'}
|
|
258
|
+
classNames='self-center mie-1'
|
|
259
|
+
/>
|
|
260
|
+
</Tooltip.Trigger>
|
|
266
261
|
);
|
|
267
262
|
};
|
|
@@ -10,21 +10,21 @@ import React from 'react';
|
|
|
10
10
|
import { useClientProvider, withClientProvider } from '@dxos/react-client/testing';
|
|
11
11
|
import { withTheme } from '@dxos/storybook-utils';
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { SpaceSettingsContainer, type SpaceSettingsContainerProps } from './SpaceSettingsContainer';
|
|
14
14
|
import translations from '../../translations';
|
|
15
15
|
|
|
16
|
-
const Story = (args: Partial<
|
|
16
|
+
const Story = (args: Partial<SpaceSettingsContainerProps>) => {
|
|
17
17
|
const { space } = useClientProvider();
|
|
18
18
|
return (
|
|
19
19
|
<div role='none' className='p-2 border border-primary-500 rounded'>
|
|
20
|
-
<
|
|
20
|
+
<SpaceSettingsContainer {...args} space={space!} />
|
|
21
21
|
</div>
|
|
22
22
|
);
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
const meta: Meta = {
|
|
26
|
-
title: 'plugins/plugin-space/
|
|
27
|
-
component:
|
|
26
|
+
title: 'plugins/plugin-space/SpaceSettingsContainer',
|
|
27
|
+
component: SpaceSettingsContainer,
|
|
28
28
|
render: Story,
|
|
29
29
|
decorators: [withClientProvider({ createIdentity: true, createSpace: true }), withTheme],
|
|
30
30
|
parameters: {
|
|
@@ -35,4 +35,4 @@ const meta: Meta = {
|
|
|
35
35
|
|
|
36
36
|
export default meta;
|
|
37
37
|
|
|
38
|
-
export const Default: StoryObj<typeof
|
|
38
|
+
export const Default: StoryObj<typeof SpaceSettingsContainer> = {};
|
|
@@ -2,62 +2,182 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { pipe, Schema } from 'effect';
|
|
6
|
+
import React, { type ChangeEvent, useCallback, useMemo, useState } from 'react';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { chain, createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
|
+
import { log } from '@dxos/log';
|
|
10
|
+
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
11
|
+
import { useClient } from '@dxos/react-client';
|
|
12
|
+
import { SpaceState, type Space } from '@dxos/react-client/echo';
|
|
13
|
+
import { Button, Input, useMulticastObservable, useTranslation } from '@dxos/react-ui';
|
|
14
|
+
import {
|
|
15
|
+
Form,
|
|
16
|
+
type InputComponent,
|
|
17
|
+
ControlItem,
|
|
18
|
+
ControlItemInput,
|
|
19
|
+
ControlSection,
|
|
20
|
+
ControlPage,
|
|
21
|
+
} from '@dxos/react-ui-form';
|
|
22
|
+
import { HuePicker, IconPicker } from '@dxos/react-ui-pickers';
|
|
12
23
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
13
|
-
import { byPosition } from '@dxos/util';
|
|
14
24
|
|
|
15
|
-
import { SpaceCapabilities } from '../../capabilities';
|
|
16
25
|
import { SPACE_PLUGIN } from '../../meta';
|
|
26
|
+
import { SpaceAction, SpaceForm } from '../../types';
|
|
17
27
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
28
|
+
const FormSchema = SpaceForm.pipe(
|
|
29
|
+
Schema.extend(Schema.Struct({ archived: Schema.Boolean.annotations({ title: 'Archive space' }) })),
|
|
30
|
+
);
|
|
21
31
|
|
|
22
32
|
export type SpaceSettingsContainerProps = {
|
|
23
33
|
space: Space;
|
|
24
34
|
};
|
|
25
35
|
|
|
36
|
+
// TODO(wittjosiah): Handle space migrations here?
|
|
26
37
|
export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) => {
|
|
27
38
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
39
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
40
|
+
const client = useClient();
|
|
41
|
+
const archived = useMulticastObservable(space.state) === SpaceState.SPACE_INACTIVE;
|
|
42
|
+
const [edgeReplication, setEdgeReplication] = useState(
|
|
43
|
+
space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED,
|
|
44
|
+
);
|
|
45
|
+
const toggleEdgeReplication = useCallback(
|
|
46
|
+
async (next: boolean) => {
|
|
47
|
+
setEdgeReplication(next);
|
|
48
|
+
await space?.internal
|
|
49
|
+
.setEdgeReplicationPreference(next ? EdgeReplicationSetting.ENABLED : EdgeReplicationSetting.DISABLED)
|
|
50
|
+
.catch((err: unknown) => {
|
|
51
|
+
log.catch(err);
|
|
52
|
+
setEdgeReplication(!next);
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
[space],
|
|
56
|
+
);
|
|
31
57
|
|
|
32
|
-
const
|
|
33
|
-
(
|
|
34
|
-
|
|
58
|
+
const handleSave = useCallback(
|
|
59
|
+
(properties: Schema.Schema.Type<typeof FormSchema>) => {
|
|
60
|
+
void toggleEdgeReplication(properties.edgeReplication);
|
|
61
|
+
if (properties.name !== space.properties.name) {
|
|
62
|
+
space.properties.name = properties.name;
|
|
63
|
+
}
|
|
64
|
+
if (properties.icon !== space.properties.icon) {
|
|
65
|
+
space.properties.icon = properties.icon;
|
|
66
|
+
}
|
|
67
|
+
if (properties.hue !== space.properties.hue) {
|
|
68
|
+
space.properties.hue = properties.hue;
|
|
69
|
+
}
|
|
70
|
+
if (properties.archived && !archived) {
|
|
71
|
+
void dispatch(
|
|
72
|
+
pipe(
|
|
73
|
+
createIntent(SpaceAction.Close, { space }),
|
|
74
|
+
chain(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: client.spaces.default.id }),
|
|
75
|
+
),
|
|
76
|
+
);
|
|
77
|
+
} else if (!properties.archived && archived) {
|
|
78
|
+
void dispatch(createIntent(SpaceAction.Open, { space }));
|
|
79
|
+
}
|
|
35
80
|
},
|
|
36
|
-
[
|
|
81
|
+
[space, toggleEdgeReplication, archived],
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
const values = useMemo(
|
|
85
|
+
() => ({
|
|
86
|
+
name: space.properties.name,
|
|
87
|
+
icon: space.properties.icon,
|
|
88
|
+
hue: space.properties.hue,
|
|
89
|
+
edgeReplication,
|
|
90
|
+
archived,
|
|
91
|
+
}),
|
|
92
|
+
[space.properties.name, space.properties.icon, space.properties.hue, edgeReplication, archived],
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const customElements: Partial<Record<string, InputComponent>> = useMemo(
|
|
96
|
+
() => ({
|
|
97
|
+
name: ({ type, label, getValue, onValueChange }) => {
|
|
98
|
+
const handleChange = useCallback(
|
|
99
|
+
({ target: { value } }: ChangeEvent<HTMLInputElement>) => onValueChange(type, value),
|
|
100
|
+
[onValueChange, type],
|
|
101
|
+
);
|
|
102
|
+
return (
|
|
103
|
+
<ControlItemInput title={label} description={t('display name description')}>
|
|
104
|
+
<Input.TextInput
|
|
105
|
+
value={getValue()}
|
|
106
|
+
onChange={handleChange}
|
|
107
|
+
placeholder={t('display name input placeholder')}
|
|
108
|
+
classNames='min-is-64'
|
|
109
|
+
/>
|
|
110
|
+
</ControlItemInput>
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
icon: ({ type, label, getValue, onValueChange }) => {
|
|
114
|
+
const handleChange = useCallback((nextEmoji: string) => onValueChange(type, nextEmoji), [onValueChange, type]);
|
|
115
|
+
const handleEmojiReset = useCallback(() => onValueChange(type, undefined), [onValueChange, type]);
|
|
116
|
+
return (
|
|
117
|
+
<ControlItem title={label} description={t('icon description')}>
|
|
118
|
+
<IconPicker
|
|
119
|
+
value={getValue()}
|
|
120
|
+
onChange={handleChange}
|
|
121
|
+
onReset={handleEmojiReset}
|
|
122
|
+
classNames='justify-self-end'
|
|
123
|
+
iconSize={5}
|
|
124
|
+
/>
|
|
125
|
+
</ControlItem>
|
|
126
|
+
);
|
|
127
|
+
},
|
|
128
|
+
hue: ({ type, label, getValue, onValueChange }) => {
|
|
129
|
+
const handleChange = useCallback((nextHue: string) => onValueChange(type, nextHue), [onValueChange, type]);
|
|
130
|
+
const handleHueReset = useCallback(() => onValueChange(type, undefined), [onValueChange, type]);
|
|
131
|
+
return (
|
|
132
|
+
<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
|
+
/>
|
|
139
|
+
</ControlItem>
|
|
140
|
+
);
|
|
141
|
+
},
|
|
142
|
+
edgeReplication: ({ type, label, getValue, onValueChange }) => {
|
|
143
|
+
const handleChange = useCallback((checked: boolean) => onValueChange(type, checked), [onValueChange, type]);
|
|
144
|
+
return (
|
|
145
|
+
<ControlItemInput title={label} description={t('edge replication description')}>
|
|
146
|
+
<Input.Switch checked={getValue()} onCheckedChange={handleChange} classNames='justify-self-end' />
|
|
147
|
+
</ControlItemInput>
|
|
148
|
+
);
|
|
149
|
+
},
|
|
150
|
+
archived: ({ type, label, getValue, onValueChange }) => {
|
|
151
|
+
const handleChange = useCallback(() => onValueChange(type, !getValue()), [onValueChange, type, getValue]);
|
|
152
|
+
return (
|
|
153
|
+
<ControlItemInput title={label} description={t('archive space description')}>
|
|
154
|
+
<Button disabled={space === client.spaces.default} onClick={handleChange}>
|
|
155
|
+
{getValue() ? t('unarchive space label') : t('archive space label')}
|
|
156
|
+
</Button>
|
|
157
|
+
</ControlItemInput>
|
|
158
|
+
);
|
|
159
|
+
},
|
|
160
|
+
}),
|
|
161
|
+
[t, space],
|
|
37
162
|
);
|
|
38
163
|
|
|
39
164
|
return (
|
|
40
|
-
<StackItem.Content classNames='
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
</Accordion.Item>
|
|
57
|
-
))}
|
|
58
|
-
</>
|
|
59
|
-
)}
|
|
60
|
-
</Accordion.Root>
|
|
165
|
+
<StackItem.Content classNames='block overflow-y-auto pli-2'>
|
|
166
|
+
<ControlPage>
|
|
167
|
+
<ControlSection
|
|
168
|
+
title={t('space properties settings verbose label', { ns: SPACE_PLUGIN })}
|
|
169
|
+
description={t('space properties settings description', { ns: SPACE_PLUGIN })}
|
|
170
|
+
>
|
|
171
|
+
<Form
|
|
172
|
+
schema={FormSchema}
|
|
173
|
+
values={values}
|
|
174
|
+
autoSave
|
|
175
|
+
onSave={handleSave}
|
|
176
|
+
Custom={customElements}
|
|
177
|
+
classNames='p-0 container-max-width [&_[role="form"]]:grid [&_[role="form"]]:grid-cols-1 md:[&_[role="form"]]:grid-cols-[1fr_min-content] [&_[role="form"]]:gap-4'
|
|
178
|
+
/>
|
|
179
|
+
</ControlSection>
|
|
180
|
+
</ControlPage>
|
|
61
181
|
</StackItem.Content>
|
|
62
182
|
);
|
|
63
183
|
};
|
|
@@ -2,24 +2,23 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Option } from 'effect';
|
|
5
6
|
import React, { useEffect, useState } from 'react';
|
|
6
7
|
|
|
7
8
|
import { useAppGraph } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
9
|
+
import { EdgeStatus } from '@dxos/protocols/proto/dxos/client/services';
|
|
9
10
|
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
10
11
|
import { useClient } from '@dxos/react-client';
|
|
11
|
-
import { type Space } from '@dxos/react-client/echo';
|
|
12
|
+
import { type Space, useSpaceSyncState } from '@dxos/react-client/echo';
|
|
12
13
|
import { Tooltip, useTranslation } from '@dxos/react-ui';
|
|
13
14
|
import { AttentionGlyph, useAttended, useAttention } from '@dxos/react-ui-attention';
|
|
14
15
|
|
|
15
|
-
import { useSpaceSyncState } from './sync-state';
|
|
16
16
|
import { usePath } from '../../hooks';
|
|
17
17
|
import { SPACE_PLUGIN } from '../../meta';
|
|
18
18
|
|
|
19
|
-
const useEdgeStatus = ():
|
|
20
|
-
const [status, setStatus] = useState(
|
|
19
|
+
const useEdgeStatus = (): EdgeStatus => {
|
|
20
|
+
const [status, setStatus] = useState(EdgeStatus.NOT_CONNECTED);
|
|
21
21
|
const client = useClient();
|
|
22
|
-
|
|
23
22
|
useEffect(() => {
|
|
24
23
|
client.services.services.EdgeAgentService?.queryEdgeStatus().subscribe(({ status }) => {
|
|
25
24
|
setStatus(status);
|
|
@@ -42,30 +41,22 @@ export const InlineSyncStatus = ({ space, open }: { space: Space; open?: boolean
|
|
|
42
41
|
const attended = useAttended();
|
|
43
42
|
const startOfAttention = attended.at(-1);
|
|
44
43
|
const path = usePath(graph, startOfAttention);
|
|
45
|
-
const containsAttended = !open && !isAttended && id && path ? path.includes(id) : false;
|
|
44
|
+
const containsAttended = !open && !isAttended && id && Option.isSome(path) ? path.value.includes(id) : false;
|
|
46
45
|
|
|
47
|
-
const connectedToEdge = useEdgeStatus() ===
|
|
46
|
+
const connectedToEdge = useEdgeStatus() === EdgeStatus.CONNECTED;
|
|
48
47
|
// TODO(wittjosiah): This is not reactive.
|
|
49
48
|
const edgeSyncEnabled = space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED;
|
|
50
49
|
const syncState = useSpaceSyncState(space);
|
|
51
50
|
const syncing = connectedToEdge && edgeSyncEnabled && syncState && syncState.missingOnLocal > 0;
|
|
52
51
|
|
|
53
52
|
return (
|
|
54
|
-
<Tooltip.
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
</Tooltip.Trigger>
|
|
63
|
-
<Tooltip.Portal>
|
|
64
|
-
<Tooltip.Content side='bottom' classNames='z-[70]'>
|
|
65
|
-
<span>{t('syncing label')}</span>
|
|
66
|
-
<Tooltip.Arrow />
|
|
67
|
-
</Tooltip.Content>
|
|
68
|
-
</Tooltip.Portal>
|
|
69
|
-
</Tooltip.Root>
|
|
53
|
+
<Tooltip.Trigger asChild content={t('syncing label')} side='bottom'>
|
|
54
|
+
<AttentionGlyph
|
|
55
|
+
syncing={syncing}
|
|
56
|
+
attended={isAttended}
|
|
57
|
+
containsAttended={containsAttended}
|
|
58
|
+
classNames='self-center mie-1'
|
|
59
|
+
/>
|
|
60
|
+
</Tooltip.Trigger>
|
|
70
61
|
);
|
|
71
62
|
};
|
|
@@ -2,22 +2,19 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { StatusBar } from '@dxos/plugin-status-bar';
|
|
8
8
|
import { useClient } from '@dxos/react-client';
|
|
9
|
-
import { type
|
|
10
|
-
import { Icon,
|
|
11
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
12
|
-
import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
13
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
9
|
+
import { getSyncSummary, type SpaceSyncStateMap, useSyncState } from '@dxos/react-client/echo';
|
|
10
|
+
import { Icon, useTranslation } from '@dxos/react-ui';
|
|
14
11
|
|
|
15
|
-
import { SpaceRowContainer, SYNC_STALLED_TIMEOUT } from './Space';
|
|
16
12
|
import { createClientSaveTracker } from './save-tracker';
|
|
17
13
|
import { getIcon, getStatus } from './status';
|
|
18
|
-
import { type PeerSyncState, type SpaceSyncStateMap, getSyncSummary, useSyncState } from './sync-state';
|
|
19
14
|
import { SPACE_PLUGIN } from '../../meta';
|
|
20
15
|
|
|
16
|
+
const SYNC_STALLED_TIMEOUT = 5_000;
|
|
17
|
+
|
|
21
18
|
export const SyncStatus = () => {
|
|
22
19
|
const client = useClient();
|
|
23
20
|
const state = useSyncState();
|
|
@@ -57,65 +54,5 @@ export const SyncStatusIndicator = ({ state, saved }: { state: SpaceSyncStateMap
|
|
|
57
54
|
const title = t(`${status} label`);
|
|
58
55
|
const icon = <Icon icon={getIcon(status)} size={4} classNames={classNames} />;
|
|
59
56
|
|
|
60
|
-
|
|
61
|
-
return <StatusBar.Item title={title}>{icon}</StatusBar.Item>;
|
|
62
|
-
} else {
|
|
63
|
-
return (
|
|
64
|
-
<Popover.Root>
|
|
65
|
-
<Popover.Trigger asChild>
|
|
66
|
-
<StatusBar.Button title={title}>{icon}</StatusBar.Button>
|
|
67
|
-
</Popover.Trigger>
|
|
68
|
-
<Popover.Portal>
|
|
69
|
-
<Popover.Content>
|
|
70
|
-
<SyncStatusDetail state={state} summary={summary} debug={false} />
|
|
71
|
-
<Popover.Arrow />
|
|
72
|
-
</Popover.Content>
|
|
73
|
-
</Popover.Portal>
|
|
74
|
-
</Popover.Root>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export type SyncStatusDetailProps = ThemedClassName<{
|
|
80
|
-
state: SpaceSyncStateMap;
|
|
81
|
-
summary: PeerSyncState;
|
|
82
|
-
debug?: boolean;
|
|
83
|
-
}>;
|
|
84
|
-
|
|
85
|
-
// TODO(wittjosiah): This currently does not show `differentDocuments` at all.
|
|
86
|
-
export const SyncStatusDetail = ({ classNames, state, summary, debug }: SyncStatusDetailProps) => {
|
|
87
|
-
const [showAll, setShowAll] = useState(false);
|
|
88
|
-
const { t } = useTranslation(SPACE_PLUGIN);
|
|
89
|
-
const entries = Object.entries(state)
|
|
90
|
-
.filter(([_, value]) => showAll || value.missingOnLocal + value.missingOnRemote > 0)
|
|
91
|
-
.toSorted(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
|
|
92
|
-
|
|
93
|
-
const handleCheckedChange = useCallback((state: boolean) => setShowAll(state), [setShowAll]);
|
|
94
|
-
|
|
95
|
-
// TODO(burdon): Normalize to max document count?
|
|
96
|
-
return (
|
|
97
|
-
<div className={mx('flex flex-col gap-3 p-2 text-xs min-w-[400px]', classNames)}>
|
|
98
|
-
<div role='none' className='flex items-center'>
|
|
99
|
-
<h1 className='flex-1'>{t('sync status title')}</h1>
|
|
100
|
-
<div className='flex items-center gap-2'>
|
|
101
|
-
<Input.Root>
|
|
102
|
-
<Input.Label classNames='text-xs'>{t('show all label')}</Input.Label>
|
|
103
|
-
<Input.Checkbox checked={showAll} onCheckedChange={handleCheckedChange} />
|
|
104
|
-
</Input.Root>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
<div className='flex flex-col gap-2'>
|
|
108
|
-
{entries.length === 0 && (
|
|
109
|
-
<div role='none' className='flex justify-center'>
|
|
110
|
-
{/* TODO(wittjosiah): This text should be updated once status includes different documents. */}
|
|
111
|
-
{t('no sync status label')}
|
|
112
|
-
</div>
|
|
113
|
-
)}
|
|
114
|
-
{entries.map(([spaceId, state]) => (
|
|
115
|
-
<SpaceRowContainer key={spaceId} spaceId={spaceId as SpaceId} state={state} />
|
|
116
|
-
))}
|
|
117
|
-
</div>
|
|
118
|
-
{debug && <SyntaxHighlighter language='json'>{JSON.stringify(summary, null, 2)}</SyntaxHighlighter>}
|
|
119
|
-
</div>
|
|
120
|
-
);
|
|
57
|
+
return <StatusBar.Item title={title}>{icon}</StatusBar.Item>;
|
|
121
58
|
};
|
package/src/components/index.ts
CHANGED
|
@@ -9,12 +9,11 @@ export * from './CollectionSection';
|
|
|
9
9
|
export * from './JoinDialog';
|
|
10
10
|
export * from './MembersContainer';
|
|
11
11
|
export * from './MenuFooter';
|
|
12
|
-
export * from './
|
|
12
|
+
export * from './ObjectSettings';
|
|
13
13
|
export * from './PersistenceStatus';
|
|
14
|
-
export * from './PopoverAddSpace';
|
|
15
14
|
export * from './PopoverRenameObject';
|
|
16
15
|
export * from './PopoverRenameSpace';
|
|
17
|
-
export * from './
|
|
16
|
+
export * from './SchemaContainer';
|
|
18
17
|
export * from './SpacePresence';
|
|
19
18
|
export * from './SpacePluginSettings';
|
|
20
19
|
export * from './SpaceSettings';
|