@dxos/plugin-space 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7
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/CollectionArticle-WPLUW5HF.mjs +111 -0
- package/dist/lib/browser/CollectionArticle-WPLUW5HF.mjs.map +7 -0
- package/dist/lib/browser/CollectionSection-H2MBNI63.mjs +23 -0
- package/dist/lib/browser/CollectionSection-H2MBNI63.mjs.map +7 -0
- package/dist/lib/browser/CreateObjectDialog-M3NRXGWW.mjs +142 -0
- package/dist/lib/browser/CreateObjectDialog-M3NRXGWW.mjs.map +7 -0
- package/dist/lib/browser/CreateSpaceDialog-3M2LAWV6.mjs +64 -0
- package/dist/lib/browser/CreateSpaceDialog-3M2LAWV6.mjs.map +7 -0
- package/dist/lib/browser/InlineSyncStatus-K5MZ3YMZ.mjs +53 -0
- package/dist/lib/browser/InlineSyncStatus-K5MZ3YMZ.mjs.map +7 -0
- package/dist/lib/browser/JoinDialog-PBK2RE5F.mjs +115 -0
- package/dist/lib/browser/JoinDialog-PBK2RE5F.mjs.map +7 -0
- package/dist/lib/browser/MembersContainer-OGYV2L4M.mjs +257 -0
- package/dist/lib/browser/MembersContainer-OGYV2L4M.mjs.map +7 -0
- package/dist/lib/browser/MenuFooter-XCBDK7WP.mjs +37 -0
- package/dist/lib/browser/MenuFooter-XCBDK7WP.mjs.map +7 -0
- package/dist/lib/browser/ObjectCardStack-UYS2TMK6.mjs +64 -0
- package/dist/lib/browser/ObjectCardStack-UYS2TMK6.mjs.map +7 -0
- package/dist/lib/browser/ObjectDetails-B2BJLOK5.mjs +43 -0
- package/dist/lib/browser/ObjectDetails-B2BJLOK5.mjs.map +7 -0
- package/dist/lib/browser/ObjectRenamePopover-JNPJIFIR.mjs +70 -0
- package/dist/lib/browser/ObjectRenamePopover-JNPJIFIR.mjs.map +7 -0
- package/dist/lib/browser/{RecordArticle-W57QE7QV.mjs → RecordArticle-BO2XHBFN.mjs} +23 -18
- package/dist/lib/browser/RecordArticle-BO2XHBFN.mjs.map +7 -0
- package/dist/lib/browser/SchemaContainer-QWCSIZBS.mjs +49 -0
- package/dist/lib/browser/SchemaContainer-QWCSIZBS.mjs.map +7 -0
- package/dist/lib/browser/SmallPresenceLive-AHHLBAUP.mjs +9 -0
- package/dist/lib/browser/SmallPresenceLive-AHHLBAUP.mjs.map +7 -0
- package/dist/lib/browser/SpacePluginSettings-QGZKNQLK.mjs +59 -0
- package/dist/lib/browser/SpacePluginSettings-QGZKNQLK.mjs.map +7 -0
- package/dist/lib/browser/SpacePresence-JIWLBUWO.mjs +12 -0
- package/dist/lib/browser/SpacePresence-JIWLBUWO.mjs.map +7 -0
- package/dist/lib/browser/SpaceRenamePopover-ZL6RRZ2B.mjs +62 -0
- package/dist/lib/browser/SpaceRenamePopover-ZL6RRZ2B.mjs.map +7 -0
- package/dist/lib/browser/SpaceSettingsContainer-MIOOT63N.mjs +242 -0
- package/dist/lib/browser/SpaceSettingsContainer-MIOOT63N.mjs.map +7 -0
- package/dist/lib/browser/SyncStatus-JSCSODPL.mjs +141 -0
- package/dist/lib/browser/SyncStatus-JSCSODPL.mjs.map +7 -0
- package/dist/lib/browser/ViewEditor-3FX5HDRT.mjs +113 -0
- package/dist/lib/browser/ViewEditor-3FX5HDRT.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-JORZZE3P.mjs +1203 -0
- package/dist/lib/browser/app-graph-builder-JORZZE3P.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-7AT7QMSK.mjs → app-graph-serializer-UZWWGLGY.mjs} +11 -10
- package/dist/lib/browser/app-graph-serializer-UZWWGLGY.mjs.map +7 -0
- package/dist/lib/browser/chunk-3A3FUI2R.mjs +576 -0
- package/dist/lib/browser/chunk-3A3FUI2R.mjs.map +7 -0
- package/dist/lib/browser/{chunk-CCRSHECL.mjs → chunk-6IT5IBB5.mjs} +74 -105
- package/dist/lib/browser/chunk-6IT5IBB5.mjs.map +7 -0
- package/dist/lib/browser/chunk-6OA75CWN.mjs +77 -0
- package/dist/lib/browser/chunk-6OA75CWN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ZT2VPYRM.mjs → chunk-AUX3RRLY.mjs} +37 -12
- package/dist/lib/browser/chunk-AUX3RRLY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-HSMQFM57.mjs → chunk-CBWGVOJE.mjs} +2 -2
- package/dist/lib/browser/{chunk-HSMQFM57.mjs.map → chunk-CBWGVOJE.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-4WZUGLQQ.mjs → chunk-ICXESMDI.mjs} +13 -12
- package/dist/lib/browser/chunk-ICXESMDI.mjs.map +7 -0
- package/dist/lib/browser/chunk-RJUOHI3B.mjs +19 -0
- package/dist/lib/browser/{chunk-ASV6DYFH.mjs.map → chunk-RJUOHI3B.mjs.map} +1 -1
- package/dist/lib/browser/chunk-SJCNERZI.mjs +115 -0
- package/dist/lib/browser/chunk-SJCNERZI.mjs.map +7 -0
- package/dist/lib/browser/{chunk-AWVAX26X.mjs → chunk-SSTUPFZ2.mjs} +3 -3
- package/dist/lib/browser/chunk-UYOJYBGW.mjs +168 -0
- package/dist/lib/browser/chunk-UYOJYBGW.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +34 -32
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/{identity-created-VCFYLSBB.mjs → identity-created-ETXNQYR6.mjs} +5 -5
- package/dist/lib/browser/identity-created-ETXNQYR6.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +99 -155
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{operation-resolver-SIRQT36Z.mjs → operation-resolver-D4LHB4D4.mjs} +95 -115
- package/dist/lib/browser/operation-resolver-D4LHB4D4.mjs.map +7 -0
- package/dist/lib/browser/{react-root-PI7VTZUZ.mjs → react-root-ARQTOU44.mjs} +9 -9
- package/dist/lib/browser/react-root-ARQTOU44.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-BPE7VWI7.mjs → react-surface-TO4KE77V.mjs} +97 -115
- package/dist/lib/browser/react-surface-TO4KE77V.mjs.map +7 -0
- package/dist/lib/browser/repair-NUVEV4AK.mjs +31 -0
- package/dist/lib/browser/repair-NUVEV4AK.mjs.map +7 -0
- package/dist/lib/browser/{settings-ZS2AQ73E.mjs → settings-RUDP2Q56.mjs} +6 -5
- package/dist/lib/browser/settings-RUDP2Q56.mjs.map +7 -0
- package/dist/lib/browser/{spaces-ready-OQDGWUOS.mjs → spaces-ready-B2GYL5IN.mjs} +15 -14
- package/dist/lib/browser/spaces-ready-B2GYL5IN.mjs.map +7 -0
- package/dist/lib/browser/{state-7YZQB2KY.mjs → state-I6JDZCDE.mjs} +8 -8
- package/dist/lib/browser/state-I6JDZCDE.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/CollectionArticle-JGVNBX66.mjs +112 -0
- package/dist/lib/node-esm/CollectionArticle-JGVNBX66.mjs.map +7 -0
- package/dist/lib/node-esm/CollectionSection-BI66Y34F.mjs +24 -0
- package/dist/lib/node-esm/CollectionSection-BI66Y34F.mjs.map +7 -0
- package/dist/lib/node-esm/CreateObjectDialog-GCAWIXTK.mjs +143 -0
- package/dist/lib/node-esm/CreateObjectDialog-GCAWIXTK.mjs.map +7 -0
- package/dist/lib/node-esm/CreateSpaceDialog-J47M5FPQ.mjs +65 -0
- package/dist/lib/node-esm/CreateSpaceDialog-J47M5FPQ.mjs.map +7 -0
- package/dist/lib/node-esm/InlineSyncStatus-BLD57LB5.mjs +54 -0
- package/dist/lib/node-esm/InlineSyncStatus-BLD57LB5.mjs.map +7 -0
- package/dist/lib/node-esm/JoinDialog-XCOYKSHA.mjs +116 -0
- package/dist/lib/node-esm/JoinDialog-XCOYKSHA.mjs.map +7 -0
- package/dist/lib/node-esm/MembersContainer-4PV3Z4BA.mjs +258 -0
- package/dist/lib/node-esm/MembersContainer-4PV3Z4BA.mjs.map +7 -0
- package/dist/lib/node-esm/MenuFooter-PXG2GV6A.mjs +38 -0
- package/dist/lib/node-esm/MenuFooter-PXG2GV6A.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectCardStack-DXBIXQI3.mjs +65 -0
- package/dist/lib/node-esm/ObjectCardStack-DXBIXQI3.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectDetails-F3JBIK5E.mjs +44 -0
- package/dist/lib/node-esm/ObjectDetails-F3JBIK5E.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectRenamePopover-BRPKVNVF.mjs +71 -0
- package/dist/lib/node-esm/ObjectRenamePopover-BRPKVNVF.mjs.map +7 -0
- package/dist/lib/node-esm/{RecordArticle-SSV74Z46.mjs → RecordArticle-XUIT25PP.mjs} +23 -18
- package/dist/lib/node-esm/RecordArticle-XUIT25PP.mjs.map +7 -0
- package/dist/lib/node-esm/SchemaContainer-5G4R3Z6O.mjs +50 -0
- package/dist/lib/node-esm/SchemaContainer-5G4R3Z6O.mjs.map +7 -0
- package/dist/lib/node-esm/SmallPresenceLive-4K7RJS74.mjs +10 -0
- package/dist/lib/node-esm/SmallPresenceLive-4K7RJS74.mjs.map +7 -0
- package/dist/lib/node-esm/SpacePluginSettings-PENV4GHL.mjs +60 -0
- package/dist/lib/node-esm/SpacePluginSettings-PENV4GHL.mjs.map +7 -0
- package/dist/lib/node-esm/SpacePresence-H3VZWFJV.mjs +13 -0
- package/dist/lib/node-esm/SpacePresence-H3VZWFJV.mjs.map +7 -0
- package/dist/lib/node-esm/SpaceRenamePopover-XEMTI4PU.mjs +63 -0
- package/dist/lib/node-esm/SpaceRenamePopover-XEMTI4PU.mjs.map +7 -0
- package/dist/lib/node-esm/SpaceSettingsContainer-WI4D7RWA.mjs +243 -0
- package/dist/lib/node-esm/SpaceSettingsContainer-WI4D7RWA.mjs.map +7 -0
- package/dist/lib/node-esm/SyncStatus-TPCFGM4S.mjs +142 -0
- package/dist/lib/node-esm/SyncStatus-TPCFGM4S.mjs.map +7 -0
- package/dist/lib/node-esm/ViewEditor-CUQVNM2H.mjs +114 -0
- package/dist/lib/node-esm/ViewEditor-CUQVNM2H.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-WTM6SSX7.mjs +1204 -0
- package/dist/lib/node-esm/app-graph-builder-WTM6SSX7.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-WJ2TIQG6.mjs → app-graph-serializer-RT2RQTV2.mjs} +11 -10
- package/dist/lib/node-esm/app-graph-serializer-RT2RQTV2.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2KM3ZHSP.mjs +577 -0
- package/dist/lib/node-esm/chunk-2KM3ZHSP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JOBIWCBC.mjs → chunk-2OLR2ZKH.mjs} +13 -12
- package/dist/lib/node-esm/chunk-2OLR2ZKH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-5KTTTTEX.mjs +20 -0
- package/dist/lib/node-esm/{chunk-CVXULIYC.mjs.map → chunk-5KTTTTEX.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-SL4BJSUG.mjs → chunk-63N5JJXI.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-SL4BJSUG.mjs.map → chunk-63N5JJXI.mjs.map} +1 -1
- package/dist/lib/node-esm/chunk-EDC2RUJU.mjs +169 -0
- package/dist/lib/node-esm/chunk-EDC2RUJU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-MPL6NHQX.mjs → chunk-EVNSLSQS.mjs} +74 -105
- package/dist/lib/node-esm/chunk-EVNSLSQS.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GEGWQVZX.mjs +78 -0
- package/dist/lib/node-esm/chunk-GEGWQVZX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-IV7VKVGC.mjs +117 -0
- package/dist/lib/node-esm/chunk-IV7VKVGC.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2SW6S2BB.mjs → chunk-RYQQXNI7.mjs} +37 -12
- package/dist/lib/node-esm/chunk-RYQQXNI7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HREWB23G.mjs → chunk-XYLDAH5C.mjs} +3 -3
- package/dist/lib/node-esm/cli/index.mjs +34 -32
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/{identity-created-2SJABVJD.mjs → identity-created-U5LGULVL.mjs} +5 -5
- package/dist/lib/node-esm/identity-created-U5LGULVL.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +99 -155
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{operation-resolver-ZE3XJL5J.mjs → operation-resolver-IL2AHNPN.mjs} +95 -115
- package/dist/lib/node-esm/operation-resolver-IL2AHNPN.mjs.map +7 -0
- package/dist/lib/node-esm/{react-root-KUXM33JI.mjs → react-root-ZGMTYSXL.mjs} +9 -9
- package/dist/lib/node-esm/react-root-ZGMTYSXL.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-STCQKUZ4.mjs → react-surface-LK26ZXWC.mjs} +97 -115
- package/dist/lib/node-esm/react-surface-LK26ZXWC.mjs.map +7 -0
- package/dist/lib/node-esm/{repair-G3ZW3VG3.mjs → repair-LRZHFPSJ.mjs} +6 -25
- package/dist/lib/node-esm/repair-LRZHFPSJ.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-PVI2VG56.mjs → settings-3EKSEAAG.mjs} +6 -5
- package/dist/lib/node-esm/settings-3EKSEAAG.mjs.map +7 -0
- package/dist/lib/node-esm/{spaces-ready-R744OHQG.mjs → spaces-ready-QK3EHBOS.mjs} +15 -14
- package/dist/lib/node-esm/spaces-ready-QK3EHBOS.mjs.map +7 -0
- package/dist/lib/node-esm/{state-XE5YGPHM.mjs → state-W36RRYUO.mjs} +8 -8
- package/dist/lib/node-esm/state-W36RRYUO.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +2 -2
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/extensions/collections.d.ts +33 -0
- package/dist/types/src/capabilities/app-graph-builder/extensions/collections.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/extensions/companions.d.ts +19 -0
- package/dist/types/src/capabilities/app-graph-builder/extensions/companions.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/extensions/index.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/extensions/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/extensions/settings.d.ts +12 -0
- package/dist/types/src/capabilities/app-graph-builder/extensions/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/extensions/shared.d.ts +57 -0
- package/dist/types/src/capabilities/app-graph-builder/extensions/shared.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/extensions/shared.test.d.ts +2 -0
- package/dist/types/src/capabilities/app-graph-builder/extensions/shared.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/extensions/spaces.d.ts +24 -0
- package/dist/types/src/capabilities/app-graph-builder/extensions/spaces.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/extensions/types.d.ts +38 -0
- package/dist/types/src/capabilities/app-graph-builder/extensions/types.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts +2 -2
- package/dist/types/src/capabilities/app-graph-serializer/app-graph-serializer.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-serializer/index.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-serializer/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/identity-created/identity-created.d.ts +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts +1 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/repair/repair.d.ts +1 -1
- package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +4 -3
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/spaces-ready/spaces-ready.d.ts +1 -1
- package/dist/types/src/capabilities/spaces-ready/spaces-ready.d.ts.map +1 -1
- package/dist/types/src/capabilities/state/state.d.ts +1 -1
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -1
- package/dist/types/src/cli/commands/database/add.d.ts +0 -1
- package/dist/types/src/cli/commands/database/add.d.ts.map +1 -1
- package/dist/types/src/cli/plugin.d.ts.map +1 -1
- package/dist/types/src/components/AwaitingObject/AwaitingObject.d.ts.map +1 -0
- package/dist/types/src/components/AwaitingObject/index.d.ts +2 -0
- package/dist/types/src/components/AwaitingObject/index.d.ts.map +1 -0
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +12 -5
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/index.d.ts +1 -2
- package/dist/types/src/components/CreateDialog/index.d.ts.map +1 -1
- package/dist/types/src/components/ObjectDetails/BaseObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectDetails/BaseObjectSettings.stories.d.ts +68 -14
- package/dist/types/src/components/ObjectDetails/BaseObjectSettings.stories.d.ts.map +1 -1
- package/dist/types/src/components/ObjectDetails/index.d.ts +2 -2
- package/dist/types/src/components/ObjectDetails/index.d.ts.map +1 -1
- package/dist/types/src/components/ObjectForm/ObjectForm.d.ts.map +1 -0
- package/dist/types/src/components/ObjectForm/index.d.ts +2 -0
- package/dist/types/src/components/ObjectForm/index.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/index.d.ts +2 -2
- package/dist/types/src/components/SyncStatus/index.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -23
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/CollectionArticle/CollectionArticle.d.ts +8 -0
- package/dist/types/src/containers/CollectionArticle/CollectionArticle.d.ts.map +1 -0
- package/dist/types/src/containers/CollectionArticle/index.d.ts +3 -0
- package/dist/types/src/containers/CollectionArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/CollectionSection/CollectionSection.d.ts +5 -0
- package/dist/types/src/containers/CollectionSection/CollectionSection.d.ts.map +1 -0
- package/dist/types/src/containers/CollectionSection/index.d.ts +3 -0
- package/dist/types/src/containers/CollectionSection/index.d.ts.map +1 -0
- package/dist/types/src/{components/CreateDialog → containers/CreateObjectDialog}/CreateObjectDialog.d.ts +5 -3
- package/dist/types/src/containers/CreateObjectDialog/CreateObjectDialog.d.ts.map +1 -0
- package/dist/types/src/containers/CreateObjectDialog/index.d.ts +3 -0
- package/dist/types/src/containers/CreateObjectDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/CreateSpaceDialog/CreateSpaceDialog.d.ts.map +1 -0
- package/dist/types/src/containers/CreateSpaceDialog/index.d.ts +3 -0
- package/dist/types/src/containers/CreateSpaceDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/InlineSyncStatus/InlineSyncStatus.d.ts.map +1 -0
- package/dist/types/src/containers/InlineSyncStatus/index.d.ts +3 -0
- package/dist/types/src/containers/InlineSyncStatus/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/JoinDialog/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/containers/JoinDialog/index.d.ts +3 -0
- package/dist/types/src/containers/JoinDialog/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/MembersContainer/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/containers/MembersContainer/index.d.ts +3 -0
- package/dist/types/src/containers/MembersContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/MenuFooter/MenuFooter.d.ts.map +1 -0
- package/dist/types/src/containers/MenuFooter/index.d.ts +3 -0
- package/dist/types/src/containers/MenuFooter/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/ObjectCardStack/ObjectCardStack.d.ts +4 -1
- package/dist/types/src/containers/ObjectCardStack/ObjectCardStack.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/ObjectCardStack/index.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/ObjectDetails/ObjectDetails.d.ts +2 -1
- package/dist/types/src/containers/ObjectDetails/ObjectDetails.d.ts.map +1 -0
- package/dist/types/src/containers/ObjectDetails/index.d.ts +3 -0
- package/dist/types/src/containers/ObjectDetails/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/ObjectRenamePopover/ObjectRenamePopover.d.ts.map +1 -1
- package/dist/types/src/containers/ObjectRenamePopover/index.d.ts +3 -0
- package/dist/types/src/containers/ObjectRenamePopover/index.d.ts.map +1 -0
- package/dist/types/src/containers/RecordArticle/RecordArticle.d.ts +4 -0
- package/dist/types/src/containers/RecordArticle/RecordArticle.d.ts.map +1 -0
- package/dist/types/src/containers/RecordArticle/index.d.ts +3 -0
- package/dist/types/src/containers/RecordArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/SchemaContainer/SchemaContainer.d.ts.map +1 -0
- package/dist/types/src/containers/SchemaContainer/index.d.ts +3 -0
- package/dist/types/src/containers/SchemaContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/SmallPresenceLive/index.d.ts +2 -0
- package/dist/types/src/containers/SmallPresenceLive/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/SpacePluginSettings}/SpacePluginSettings.d.ts +1 -1
- package/dist/types/src/containers/SpacePluginSettings/SpacePluginSettings.d.ts.map +1 -0
- package/dist/types/src/containers/SpacePluginSettings/index.d.ts +3 -0
- package/dist/types/src/containers/SpacePluginSettings/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/SpacePresence/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/SpacePresence/SpacePresence.stories.d.ts +67 -13
- package/dist/types/src/{components → containers}/SpacePresence/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/containers/SpacePresence/index.d.ts +3 -0
- package/dist/types/src/containers/SpacePresence/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/SpaceRenamePopover/SpaceRenamePopover.d.ts.map +1 -1
- package/dist/types/src/containers/SpaceRenamePopover/index.d.ts +3 -0
- package/dist/types/src/containers/SpaceRenamePopover/index.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceSettingsContainer/SpaceSettingsContainer.d.ts +10 -0
- package/dist/types/src/containers/SpaceSettingsContainer/SpaceSettingsContainer.d.ts.map +1 -0
- package/dist/types/src/{components/SpaceSettings → containers/SpaceSettingsContainer}/SpaceSettingsContainer.stories.d.ts +71 -14
- package/dist/types/src/{components/SpaceSettings → containers/SpaceSettingsContainer}/SpaceSettingsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/SpaceSettingsContainer/index.d.ts +3 -0
- package/dist/types/src/containers/SpaceSettingsContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/SyncStatus/SyncStatus.stories.d.ts +67 -13
- package/dist/types/src/{components → containers}/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/containers/SyncStatus/index.d.ts +3 -0
- package/dist/types/src/containers/SyncStatus/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/ViewEditor}/ViewEditor.d.ts +1 -1
- package/dist/types/src/containers/ViewEditor/ViewEditor.d.ts.map +1 -0
- package/dist/types/src/containers/ViewEditor/index.d.ts +3 -0
- package/dist/types/src/containers/ViewEditor/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +23 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/helpers/query.d.ts.map +1 -1
- package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +67 -13
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +1 -1
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/types/form.d.ts +0 -2
- package/dist/types/src/types/form.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +63 -124
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +6 -121
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +67 -66
- package/src/SpacePlugin.ts +75 -63
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +17 -602
- package/src/capabilities/app-graph-builder/extensions/collections.ts +351 -0
- package/src/capabilities/app-graph-builder/extensions/companions.ts +80 -0
- package/src/capabilities/app-graph-builder/extensions/index.ts +9 -0
- package/src/capabilities/app-graph-builder/extensions/settings.ts +60 -0
- package/src/capabilities/app-graph-builder/extensions/shared.test.ts +112 -0
- package/src/capabilities/app-graph-builder/extensions/shared.ts +171 -0
- package/src/capabilities/app-graph-builder/extensions/spaces.ts +338 -0
- package/src/capabilities/app-graph-builder/extensions/types.ts +421 -0
- package/src/capabilities/app-graph-serializer/app-graph-serializer.ts +6 -5
- package/src/capabilities/identity-created/identity-created.ts +4 -4
- package/src/capabilities/operation-resolver/operation-resolver.ts +97 -94
- package/src/capabilities/react-root/react-root.tsx +3 -3
- package/src/capabilities/react-surface/react-surface.tsx +78 -98
- package/src/capabilities/repair/repair.ts +3 -28
- package/src/capabilities/settings/settings.ts +3 -2
- package/src/capabilities/spaces-ready/spaces-ready.ts +8 -7
- package/src/capabilities/state/state.ts +7 -5
- package/src/cli/commands/database/add.ts +8 -10
- package/src/cli/commands/database/query/query.ts +1 -1
- package/src/cli/commands/database/remove.ts +2 -2
- package/src/cli/commands/database/stats.ts +1 -1
- package/src/cli/plugin.ts +34 -27
- package/src/components/{AwaitingObject.tsx → AwaitingObject/AwaitingObject.tsx} +6 -5
- package/src/components/AwaitingObject/index.ts +5 -0
- package/src/components/CreateDialog/CreateObjectPanel.tsx +86 -111
- package/src/components/CreateDialog/index.ts +1 -2
- package/src/components/ObjectDetails/BaseObjectSettings.stories.tsx +10 -10
- package/src/components/ObjectDetails/BaseObjectSettings.tsx +5 -5
- package/src/components/ObjectDetails/ForeignKeys.tsx +1 -1
- package/src/components/ObjectDetails/index.ts +2 -3
- package/src/components/{ObjectCardStack → ObjectForm}/ObjectForm.tsx +4 -4
- package/src/components/{JoinDialog → ObjectForm}/index.ts +1 -1
- package/src/components/SyncStatus/index.ts +2 -2
- package/src/components/index.ts +2 -18
- package/src/constants.ts +5 -5
- package/src/containers/CollectionArticle/CollectionArticle.tsx +133 -0
- package/src/containers/CollectionArticle/index.ts +7 -0
- package/src/{components → containers/CollectionSection}/CollectionSection.tsx +4 -4
- package/src/containers/CollectionSection/index.ts +7 -0
- package/src/{components/CreateDialog → containers/CreateObjectDialog}/CreateObjectDialog.tsx +62 -42
- package/src/containers/CreateObjectDialog/index.ts +6 -0
- package/src/{components/CreateDialog → containers/CreateSpaceDialog}/CreateSpaceDialog.tsx +6 -6
- package/src/containers/CreateSpaceDialog/index.ts +7 -0
- package/src/{components/SyncStatus → containers/InlineSyncStatus}/InlineSyncStatus.tsx +8 -19
- package/src/containers/InlineSyncStatus/index.ts +7 -0
- package/src/{components → containers}/JoinDialog/JoinDialog.tsx +10 -9
- package/src/containers/JoinDialog/index.ts +6 -0
- package/src/{components → containers}/MembersContainer/MembersContainer.tsx +50 -53
- package/src/containers/MembersContainer/index.ts +7 -0
- package/src/{components → containers/MenuFooter}/MenuFooter.tsx +5 -5
- package/src/containers/MenuFooter/index.ts +7 -0
- package/src/containers/ObjectCardStack/ObjectCardStack.tsx +82 -0
- package/src/containers/ObjectDetails/ObjectDetails.tsx +36 -0
- package/src/containers/ObjectDetails/index.ts +7 -0
- package/src/{components → containers}/ObjectRenamePopover/ObjectRenamePopover.tsx +4 -4
- package/src/containers/ObjectRenamePopover/index.ts +7 -0
- package/src/{components → containers/RecordArticle}/RecordArticle.tsx +29 -27
- package/src/containers/RecordArticle/index.ts +7 -0
- package/src/{components → containers/SchemaContainer}/SchemaContainer.tsx +22 -18
- package/src/containers/SchemaContainer/index.ts +7 -0
- package/src/containers/SmallPresenceLive/index.ts +5 -0
- package/src/containers/SpacePluginSettings/SpacePluginSettings.tsx +65 -0
- package/src/containers/SpacePluginSettings/index.ts +7 -0
- package/src/{components → containers}/SpacePresence/SpacePresence.stories.tsx +2 -2
- package/src/{components → containers}/SpacePresence/SpacePresence.tsx +11 -22
- package/src/containers/SpacePresence/index.ts +6 -0
- package/src/{components → containers}/SpaceRenamePopover/SpaceRenamePopover.tsx +4 -4
- package/src/containers/SpaceRenamePopover/index.ts +7 -0
- package/src/{components/SpaceSettings → containers/SpaceSettingsContainer}/SpaceSettingsContainer.stories.tsx +3 -3
- package/src/containers/SpaceSettingsContainer/SpaceSettingsContainer.tsx +202 -0
- package/src/containers/SpaceSettingsContainer/index.ts +7 -0
- package/src/{components → containers}/SyncStatus/SyncStatus.stories.tsx +2 -2
- package/src/{components → containers}/SyncStatus/SyncStatus.tsx +5 -7
- package/src/containers/SyncStatus/index.ts +7 -0
- package/src/{components → containers/ViewEditor}/ViewEditor.tsx +11 -10
- package/src/containers/ViewEditor/index.ts +7 -0
- package/src/containers/index.ts +28 -0
- package/src/helpers/query.test.ts +1 -1
- package/src/helpers/query.ts +20 -7
- package/src/hooks/useActiveSpace.ts +8 -7
- package/src/hooks/useInputSurfaceLookup.tsx +3 -3
- package/src/index.ts +2 -1
- package/src/meta.ts +1 -1
- package/src/translations.ts +30 -4
- package/src/types/capabilities.ts +8 -8
- package/src/types/events.ts +7 -6
- package/src/types/form.ts +1 -8
- package/src/types/types.ts +61 -76
- package/src/util.ts +82 -0
- package/dist/lib/browser/CollectionArticle-XPNA6EHZ.mjs +0 -129
- package/dist/lib/browser/CollectionArticle-XPNA6EHZ.mjs.map +0 -7
- package/dist/lib/browser/ObjectCardStack-TWHN6C2Y.mjs +0 -148
- package/dist/lib/browser/ObjectCardStack-TWHN6C2Y.mjs.map +0 -7
- package/dist/lib/browser/ObjectDetails-GEDIISKK.mjs +0 -142
- package/dist/lib/browser/ObjectDetails-GEDIISKK.mjs.map +0 -7
- package/dist/lib/browser/RecordArticle-W57QE7QV.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-SJHTZXZF.mjs +0 -523
- package/dist/lib/browser/app-graph-builder-SJHTZXZF.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-7AT7QMSK.mjs.map +0 -7
- package/dist/lib/browser/chunk-3X2EA2OA.mjs +0 -1898
- package/dist/lib/browser/chunk-3X2EA2OA.mjs.map +0 -7
- package/dist/lib/browser/chunk-4WZUGLQQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-ASV6DYFH.mjs +0 -19
- package/dist/lib/browser/chunk-CCRSHECL.mjs.map +0 -7
- package/dist/lib/browser/chunk-SUI34XSA.mjs +0 -772
- package/dist/lib/browser/chunk-SUI34XSA.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZT2VPYRM.mjs.map +0 -7
- package/dist/lib/browser/identity-created-VCFYLSBB.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-SIRQT36Z.mjs.map +0 -7
- package/dist/lib/browser/react-root-PI7VTZUZ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-BPE7VWI7.mjs.map +0 -7
- package/dist/lib/browser/repair-CJG26D52.mjs +0 -50
- package/dist/lib/browser/repair-CJG26D52.mjs.map +0 -7
- package/dist/lib/browser/settings-ZS2AQ73E.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-OQDGWUOS.mjs.map +0 -7
- package/dist/lib/browser/state-7YZQB2KY.mjs.map +0 -7
- package/dist/lib/node-esm/CollectionArticle-WGHNZNO2.mjs +0 -130
- package/dist/lib/node-esm/CollectionArticle-WGHNZNO2.mjs.map +0 -7
- package/dist/lib/node-esm/ObjectCardStack-C5ZXRKP7.mjs +0 -149
- package/dist/lib/node-esm/ObjectCardStack-C5ZXRKP7.mjs.map +0 -7
- package/dist/lib/node-esm/ObjectDetails-6ZLDRKCO.mjs +0 -143
- package/dist/lib/node-esm/ObjectDetails-6ZLDRKCO.mjs.map +0 -7
- package/dist/lib/node-esm/RecordArticle-SSV74Z46.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-HZ3XXDFZ.mjs +0 -524
- package/dist/lib/node-esm/app-graph-builder-HZ3XXDFZ.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-WJ2TIQG6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2SW6S2BB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7KMYUWSR.mjs +0 -773
- package/dist/lib/node-esm/chunk-7KMYUWSR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CVXULIYC.mjs +0 -20
- package/dist/lib/node-esm/chunk-EYS3L2NO.mjs +0 -1899
- package/dist/lib/node-esm/chunk-EYS3L2NO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JOBIWCBC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MPL6NHQX.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-2SJABVJD.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-ZE3XJL5J.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-KUXM33JI.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-STCQKUZ4.mjs.map +0 -7
- package/dist/lib/node-esm/repair-G3ZW3VG3.mjs.map +0 -7
- package/dist/lib/node-esm/settings-PVI2VG56.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-R744OHQG.mjs.map +0 -7
- package/dist/lib/node-esm/state-XE5YGPHM.mjs.map +0 -7
- package/dist/types/src/components/AwaitingObject.d.ts.map +0 -1
- package/dist/types/src/components/CollectionArticle.d.ts +0 -9
- package/dist/types/src/components/CollectionArticle.d.ts.map +0 -1
- package/dist/types/src/components/CollectionSection.d.ts +0 -5
- package/dist/types/src/components/CollectionSection.d.ts.map +0 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +0 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +0 -1604
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +0 -1
- package/dist/types/src/components/JoinDialog/index.d.ts +0 -2
- package/dist/types/src/components/JoinDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts +0 -1600
- package/dist/types/src/components/MembersContainer/MembersContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/MembersContainer/index.d.ts +0 -2
- package/dist/types/src/components/MembersContainer/index.d.ts.map +0 -1
- package/dist/types/src/components/MenuFooter.d.ts.map +0 -1
- package/dist/types/src/components/ObjectCardStack/ObjectCardStack.d.ts.map +0 -1
- package/dist/types/src/components/ObjectCardStack/ObjectForm.d.ts.map +0 -1
- package/dist/types/src/components/ObjectDetails/ObjectDetails.d.ts.map +0 -1
- package/dist/types/src/components/ObjectRenamePopover/index.d.ts +0 -2
- package/dist/types/src/components/ObjectRenamePopover/index.d.ts.map +0 -1
- package/dist/types/src/components/RecordArticle.d.ts +0 -5
- package/dist/types/src/components/RecordArticle.d.ts.map +0 -1
- package/dist/types/src/components/RecordArticle.stories.d.ts +0 -1600
- package/dist/types/src/components/RecordArticle.stories.d.ts.map +0 -1
- package/dist/types/src/components/SchemaContainer.d.ts.map +0 -1
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +0 -1
- package/dist/types/src/components/SpacePresence/index.d.ts +0 -2
- package/dist/types/src/components/SpacePresence/index.d.ts.map +0 -1
- package/dist/types/src/components/SpaceRenamePopover/index.d.ts +0 -2
- package/dist/types/src/components/SpaceRenamePopover/index.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts +0 -7
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +0 -1
- package/dist/types/src/components/SpaceSettings/index.d.ts +0 -2
- package/dist/types/src/components/SpaceSettings/index.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +0 -1
- package/dist/types/src/components/ViewEditor.d.ts.map +0 -1
- package/src/components/CollectionArticle.tsx +0 -158
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +0 -91
- package/src/components/MembersContainer/MembersContainer.stories.tsx +0 -56
- package/src/components/MembersContainer/index.ts +0 -5
- package/src/components/ObjectCardStack/ObjectCardStack.tsx +0 -67
- package/src/components/ObjectDetails/ObjectDetails.tsx +0 -32
- package/src/components/ObjectRenamePopover/index.ts +0 -5
- package/src/components/RecordArticle.stories.tsx +0 -115
- package/src/components/SpacePluginSettings.tsx +0 -62
- package/src/components/SpacePresence/index.ts +0 -5
- package/src/components/SpaceRenamePopover/index.ts +0 -5
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +0 -220
- package/src/components/SpaceSettings/index.ts +0 -5
- package/src/util.tsx +0 -779
- /package/dist/lib/browser/{chunk-AWVAX26X.mjs.map → chunk-SSTUPFZ2.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-HREWB23G.mjs.map → chunk-XYLDAH5C.mjs.map} +0 -0
- /package/dist/types/src/components/{AwaitingObject.d.ts → AwaitingObject/AwaitingObject.d.ts} +0 -0
- /package/dist/types/src/components/{ObjectCardStack → ObjectForm}/ObjectForm.d.ts +0 -0
- /package/dist/types/src/{components/CreateDialog → containers/CreateSpaceDialog}/CreateSpaceDialog.d.ts +0 -0
- /package/dist/types/src/{components/SyncStatus → containers/InlineSyncStatus}/InlineSyncStatus.d.ts +0 -0
- /package/dist/types/src/{components → containers}/JoinDialog/JoinDialog.d.ts +0 -0
- /package/dist/types/src/{components → containers}/MembersContainer/MembersContainer.d.ts +0 -0
- /package/dist/types/src/{components → containers/MenuFooter}/MenuFooter.d.ts +0 -0
- /package/dist/types/src/{components → containers}/ObjectCardStack/index.d.ts +0 -0
- /package/dist/types/src/{components → containers}/ObjectRenamePopover/ObjectRenamePopover.d.ts +0 -0
- /package/dist/types/src/{components → containers/SchemaContainer}/SchemaContainer.d.ts +0 -0
- /package/dist/types/src/{components → containers}/SpacePresence/SpacePresence.d.ts +0 -0
- /package/dist/types/src/{components → containers}/SpaceRenamePopover/SpaceRenamePopover.d.ts +0 -0
- /package/dist/types/src/{components → containers}/SyncStatus/SyncStatus.d.ts +0 -0
- /package/src/{components → containers}/ObjectCardStack/index.ts +0 -0
|
@@ -1,1898 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useInputSurfaceLookup,
|
|
3
|
-
usePath,
|
|
4
|
-
useTypeOptions
|
|
5
|
-
} from "./chunk-4WZUGLQQ.mjs";
|
|
6
|
-
import {
|
|
7
|
-
COMPOSER_SPACE_LOCK,
|
|
8
|
-
getSpaceDisplayName
|
|
9
|
-
} from "./chunk-SUI34XSA.mjs";
|
|
10
|
-
import {
|
|
11
|
-
SpaceCapabilities,
|
|
12
|
-
SpaceForm,
|
|
13
|
-
SpaceOperation
|
|
14
|
-
} from "./chunk-CCRSHECL.mjs";
|
|
15
|
-
import {
|
|
16
|
-
meta
|
|
17
|
-
} from "./chunk-HSMQFM57.mjs";
|
|
18
|
-
|
|
19
|
-
// src/components/AwaitingObject.tsx
|
|
20
|
-
import React, { useCallback, useEffect, useState } from "react";
|
|
21
|
-
import { Common } from "@dxos/app-framework";
|
|
22
|
-
import { useLayout, useOperationInvoker } from "@dxos/app-framework/react";
|
|
23
|
-
import { Obj } from "@dxos/echo";
|
|
24
|
-
import { useClient } from "@dxos/react-client";
|
|
25
|
-
import { Filter, useQuery } from "@dxos/react-client/echo";
|
|
26
|
-
import { Button, Icon, Toast, useTranslation } from "@dxos/react-ui";
|
|
27
|
-
import { osTranslations } from "@dxos/ui-theme";
|
|
28
|
-
var WAIT_FOR_OBJECT_TIMEOUT = 3 * 60 * 1e3;
|
|
29
|
-
var TOAST_TIMEOUT = 4 * 60 * 1e3;
|
|
30
|
-
var AwaitingObject = ({ id }) => {
|
|
31
|
-
const { t } = useTranslation(meta.id);
|
|
32
|
-
const { invokePromise } = useOperationInvoker();
|
|
33
|
-
const [open, setOpen] = useState(true);
|
|
34
|
-
const [waiting, setWaiting] = useState(true);
|
|
35
|
-
const [found, setFound] = useState(false);
|
|
36
|
-
const layout = useLayout();
|
|
37
|
-
const client = useClient();
|
|
38
|
-
const objects = useQuery(client.spaces, Filter.everything());
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
if (!id) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const timeout = setTimeout(() => setWaiting(false), WAIT_FOR_OBJECT_TIMEOUT);
|
|
44
|
-
return () => clearTimeout(timeout);
|
|
45
|
-
}, [
|
|
46
|
-
id
|
|
47
|
-
]);
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
if (objects.findIndex((object) => Obj.getDXN(object).toString() === id) > -1) {
|
|
50
|
-
setFound(true);
|
|
51
|
-
if (layout.active.includes(id)) {
|
|
52
|
-
setOpen(false);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}, [
|
|
56
|
-
id,
|
|
57
|
-
objects,
|
|
58
|
-
layout
|
|
59
|
-
]);
|
|
60
|
-
const handleClose = useCallback(async () => invokePromise(SpaceOperation.WaitForObject, {
|
|
61
|
-
id: void 0
|
|
62
|
-
}), [
|
|
63
|
-
invokePromise
|
|
64
|
-
]);
|
|
65
|
-
const handleNavigate = useCallback(() => {
|
|
66
|
-
void invokePromise(Common.LayoutOperation.Open, {
|
|
67
|
-
subject: [
|
|
68
|
-
id
|
|
69
|
-
]
|
|
70
|
-
});
|
|
71
|
-
void handleClose();
|
|
72
|
-
}, [
|
|
73
|
-
id,
|
|
74
|
-
handleClose,
|
|
75
|
-
invokePromise
|
|
76
|
-
]);
|
|
77
|
-
return /* @__PURE__ */ React.createElement(Toast.Root, {
|
|
78
|
-
open,
|
|
79
|
-
duration: TOAST_TIMEOUT,
|
|
80
|
-
onOpenChange: setOpen
|
|
81
|
-
}, /* @__PURE__ */ React.createElement(Toast.Body, null, /* @__PURE__ */ React.createElement(Toast.Title, {
|
|
82
|
-
classNames: "flex items-center gap-2"
|
|
83
|
-
}, found ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Icon, {
|
|
84
|
-
icon: "ph--check-circle--regular",
|
|
85
|
-
size: 5
|
|
86
|
-
}), /* @__PURE__ */ React.createElement("span", null, t("found object label"))) : waiting ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Icon, {
|
|
87
|
-
icon: "ph--circle-notch--regular",
|
|
88
|
-
size: 5,
|
|
89
|
-
classNames: "animate-spin"
|
|
90
|
-
}), /* @__PURE__ */ React.createElement("span", null, t("waiting for object label"))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Icon, {
|
|
91
|
-
icon: "ph--circle-dashed--regular",
|
|
92
|
-
size: 5
|
|
93
|
-
}), /* @__PURE__ */ React.createElement("span", null, t("object not found label")))), /* @__PURE__ */ React.createElement(Toast.Description, null, t(found ? "found object description" : waiting ? "waiting for object description" : "object not found description"))), /* @__PURE__ */ React.createElement(Toast.Actions, null, found ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Toast.Action, {
|
|
94
|
-
altText: t("go to object alt"),
|
|
95
|
-
asChild: true
|
|
96
|
-
}, /* @__PURE__ */ React.createElement(Button, {
|
|
97
|
-
variant: "primary",
|
|
98
|
-
onClick: handleNavigate
|
|
99
|
-
}, t("go to object label"))), /* @__PURE__ */ React.createElement(Toast.Close, {
|
|
100
|
-
asChild: true
|
|
101
|
-
}, /* @__PURE__ */ React.createElement(Button, {
|
|
102
|
-
onClick: handleClose
|
|
103
|
-
}, t("close label", {
|
|
104
|
-
ns: osTranslations
|
|
105
|
-
})))) : /* @__PURE__ */ React.createElement(Toast.Close, {
|
|
106
|
-
asChild: true
|
|
107
|
-
}, /* @__PURE__ */ React.createElement(Button, {
|
|
108
|
-
onClick: handleClose
|
|
109
|
-
}, t(waiting ? "close label" : "confirm label", {
|
|
110
|
-
ns: osTranslations
|
|
111
|
-
})))));
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
// src/components/CreateDialog/CreateObjectDialog.tsx
|
|
115
|
-
import * as Effect from "effect/Effect";
|
|
116
|
-
import React3, { useCallback as useCallback3, useMemo as useMemo2, useRef, useState as useState2 } from "react";
|
|
117
|
-
import { Capability, Common as Common2 } from "@dxos/app-framework";
|
|
118
|
-
import { useOperationInvoker as useOperationInvoker2, usePluginManager } from "@dxos/app-framework/react";
|
|
119
|
-
import { Database, Obj as Obj3, Type } from "@dxos/echo";
|
|
120
|
-
import { EntityKind, getTypeAnnotation as getTypeAnnotation2 } from "@dxos/echo/internal";
|
|
121
|
-
import { runAndForwardErrors } from "@dxos/effect";
|
|
122
|
-
import { invariant } from "@dxos/invariant";
|
|
123
|
-
import { Operation } from "@dxos/operation";
|
|
124
|
-
import { useClient as useClient2 } from "@dxos/react-client";
|
|
125
|
-
import { useSpaces } from "@dxos/react-client/echo";
|
|
126
|
-
import { Dialog, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
127
|
-
|
|
128
|
-
// src/components/CreateDialog/CreateObjectPanel.tsx
|
|
129
|
-
import * as Option from "effect/Option";
|
|
130
|
-
import React2, { useCallback as useCallback2, useMemo } from "react";
|
|
131
|
-
import { Obj as Obj2 } from "@dxos/echo";
|
|
132
|
-
import { getTypeAnnotation } from "@dxos/echo/internal";
|
|
133
|
-
import { toLocalizedString, useDefaultValue, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
134
|
-
import { Form, omitId } from "@dxos/react-ui-form";
|
|
135
|
-
import { SearchList, useSearchListResults } from "@dxos/react-ui-searchlist";
|
|
136
|
-
import { ViewAnnotation } from "@dxos/schema";
|
|
137
|
-
import { isNonNullable } from "@dxos/util";
|
|
138
|
-
var CreateObjectPanel = ({ schemas, spaces, typename, target, views, initialFormValues: _initialFormValues, defaultSpaceId, resolve, onTargetChange, onTypenameChange, onCreateObject }) => {
|
|
139
|
-
const { t } = useTranslation2(meta.id);
|
|
140
|
-
const initialFormValues = useDefaultValue(_initialFormValues, () => ({}));
|
|
141
|
-
const metadata = typename && resolve?.(typename);
|
|
142
|
-
const options = schemas.filter((schema) => {
|
|
143
|
-
if (views == null) {
|
|
144
|
-
return true;
|
|
145
|
-
} else {
|
|
146
|
-
return views === ViewAnnotation.get(schema).pipe(Option.getOrElse(() => false));
|
|
147
|
-
}
|
|
148
|
-
}).map((schema) => getTypeAnnotation(schema)).filter(isNonNullable).sort((a, b) => {
|
|
149
|
-
const nameA = t("typename label", {
|
|
150
|
-
ns: a.typename,
|
|
151
|
-
defaultValue: a.typename
|
|
152
|
-
});
|
|
153
|
-
const nameB = t("typename label", {
|
|
154
|
-
ns: b.typename,
|
|
155
|
-
defaultValue: b.typename
|
|
156
|
-
});
|
|
157
|
-
return nameA.localeCompare(nameB);
|
|
158
|
-
});
|
|
159
|
-
const handleCreateObject = useCallback2(async (props) => {
|
|
160
|
-
if (!metadata) {
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
await onCreateObject?.({
|
|
164
|
-
metadata,
|
|
165
|
-
data: props
|
|
166
|
-
});
|
|
167
|
-
}, [
|
|
168
|
-
onCreateObject,
|
|
169
|
-
metadata
|
|
170
|
-
]);
|
|
171
|
-
const handleSetTypename = useCallback2(async (typename2) => {
|
|
172
|
-
const metadata2 = resolve?.(typename2);
|
|
173
|
-
if (metadata2 && !metadata2.inputSchema) {
|
|
174
|
-
await onCreateObject?.({
|
|
175
|
-
metadata: metadata2
|
|
176
|
-
});
|
|
177
|
-
} else {
|
|
178
|
-
onTypenameChange?.(typename2);
|
|
179
|
-
}
|
|
180
|
-
}, [
|
|
181
|
-
resolve,
|
|
182
|
-
onCreateObject
|
|
183
|
-
]);
|
|
184
|
-
const inputSurfaceLookup = useInputSurfaceLookup({
|
|
185
|
-
target
|
|
186
|
-
});
|
|
187
|
-
return !metadata ? /* @__PURE__ */ React2.createElement(SelectSchema, {
|
|
188
|
-
options,
|
|
189
|
-
resolve,
|
|
190
|
-
onChange: handleSetTypename
|
|
191
|
-
}) : !target ? /* @__PURE__ */ React2.createElement(SelectSpace, {
|
|
192
|
-
spaces,
|
|
193
|
-
defaultSpaceId,
|
|
194
|
-
onChange: onTargetChange
|
|
195
|
-
}) : metadata.inputSchema ? /* @__PURE__ */ React2.createElement(Form.Root, {
|
|
196
|
-
testId: "create-object-form",
|
|
197
|
-
autoFocus: true,
|
|
198
|
-
schema: omitId(metadata.inputSchema),
|
|
199
|
-
values: initialFormValues,
|
|
200
|
-
db: Obj2.isObject(target) ? Obj2.getDatabase(target) : target,
|
|
201
|
-
fieldProvider: inputSurfaceLookup,
|
|
202
|
-
onSave: handleCreateObject
|
|
203
|
-
}, /* @__PURE__ */ React2.createElement(Form.Viewport, null, /* @__PURE__ */ React2.createElement(Form.Content, null, /* @__PURE__ */ React2.createElement(Form.FieldSet, null), /* @__PURE__ */ React2.createElement(Form.Submit, null)))) : null;
|
|
204
|
-
};
|
|
205
|
-
var SelectSpace = ({ spaces, defaultSpaceId, onChange }) => {
|
|
206
|
-
const { t } = useTranslation2(meta.id);
|
|
207
|
-
const sortedSpaces = useMemo(() => [
|
|
208
|
-
...spaces
|
|
209
|
-
].sort((a, b) => {
|
|
210
|
-
const labelA = toLocalizedString(getSpaceDisplayName(a, {
|
|
211
|
-
personal: a.id === defaultSpaceId
|
|
212
|
-
}), t);
|
|
213
|
-
const labelB = toLocalizedString(getSpaceDisplayName(b, {
|
|
214
|
-
personal: b.id === defaultSpaceId
|
|
215
|
-
}), t);
|
|
216
|
-
return labelA.localeCompare(labelB);
|
|
217
|
-
}), [
|
|
218
|
-
spaces,
|
|
219
|
-
defaultSpaceId,
|
|
220
|
-
t
|
|
221
|
-
]);
|
|
222
|
-
const { results, handleSearch } = useSearchListResults({
|
|
223
|
-
items: sortedSpaces,
|
|
224
|
-
extract: (space) => toLocalizedString(getSpaceDisplayName(space, {
|
|
225
|
-
personal: space.id === defaultSpaceId
|
|
226
|
-
}), t)
|
|
227
|
-
});
|
|
228
|
-
return /* @__PURE__ */ React2.createElement(SearchList.Root, {
|
|
229
|
-
onSearch: handleSearch
|
|
230
|
-
}, /* @__PURE__ */ React2.createElement("div", {
|
|
231
|
-
"aria-label": t("space input label"),
|
|
232
|
-
role: "combobox",
|
|
233
|
-
"aria-expanded": "true"
|
|
234
|
-
}, /* @__PURE__ */ React2.createElement(SearchList.Input, {
|
|
235
|
-
autoFocus: true,
|
|
236
|
-
"data-testid": "create-object-form.space-input",
|
|
237
|
-
placeholder: t("space input placeholder")
|
|
238
|
-
}), /* @__PURE__ */ React2.createElement(SearchList.Content, null, /* @__PURE__ */ React2.createElement(SearchList.Viewport, null, results.map((space) => /* @__PURE__ */ React2.createElement(SearchList.Item, {
|
|
239
|
-
key: space.id,
|
|
240
|
-
value: space.id,
|
|
241
|
-
label: toLocalizedString(getSpaceDisplayName(space, {
|
|
242
|
-
personal: space.id === defaultSpaceId
|
|
243
|
-
}), t),
|
|
244
|
-
onSelect: () => onChange?.(space.db),
|
|
245
|
-
classNames: "flex items-center gap-2"
|
|
246
|
-
}))))));
|
|
247
|
-
};
|
|
248
|
-
var SelectSchema = ({ options, resolve, onChange }) => {
|
|
249
|
-
const { t } = useTranslation2(meta.id);
|
|
250
|
-
const { results, handleSearch } = useSearchListResults({
|
|
251
|
-
items: options,
|
|
252
|
-
extract: (option) => t("typename label", {
|
|
253
|
-
ns: option.typename,
|
|
254
|
-
defaultValue: option.typename
|
|
255
|
-
})
|
|
256
|
-
});
|
|
257
|
-
return /* @__PURE__ */ React2.createElement(SearchList.Root, {
|
|
258
|
-
onSearch: handleSearch
|
|
259
|
-
}, /* @__PURE__ */ React2.createElement("div", {
|
|
260
|
-
"aria-label": t("schema input label"),
|
|
261
|
-
role: "combobox",
|
|
262
|
-
"aria-expanded": "true"
|
|
263
|
-
}, /* @__PURE__ */ React2.createElement(SearchList.Input, {
|
|
264
|
-
autoFocus: true,
|
|
265
|
-
"data-testid": "create-object-form.schema-input",
|
|
266
|
-
placeholder: t("schema input placeholder")
|
|
267
|
-
}), /* @__PURE__ */ React2.createElement(SearchList.Content, null, /* @__PURE__ */ React2.createElement(SearchList.Viewport, null, results.map((option) => /* @__PURE__ */ React2.createElement(SearchList.Item, {
|
|
268
|
-
key: option.typename,
|
|
269
|
-
value: option.typename,
|
|
270
|
-
label: t("typename label", {
|
|
271
|
-
ns: option.typename,
|
|
272
|
-
defaultValue: option.typename
|
|
273
|
-
}),
|
|
274
|
-
icon: resolve?.(option.typename)?.icon ?? "ph--placeholder--regular",
|
|
275
|
-
onSelect: () => onChange(option.typename),
|
|
276
|
-
classNames: "flex items-center gap-2"
|
|
277
|
-
}))))));
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
// src/components/CreateDialog/CreateObjectDialog.tsx
|
|
281
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx";
|
|
282
|
-
var CREATE_OBJECT_DIALOG = `${meta.id}/CreateObjectDialog`;
|
|
283
|
-
var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, views, initialFormValues, onCreateObject, shouldNavigate: _shouldNavigate }) => {
|
|
284
|
-
const manager = usePluginManager();
|
|
285
|
-
const { t } = useTranslation3(meta.id);
|
|
286
|
-
const operationInvoker = useOperationInvoker2();
|
|
287
|
-
const [target, setTarget] = useState2(initialTarget);
|
|
288
|
-
const [typename, setTypename] = useState2(initialTypename);
|
|
289
|
-
const client = useClient2();
|
|
290
|
-
const spaces = useSpaces();
|
|
291
|
-
const closeRef = useRef(null);
|
|
292
|
-
const resolve = useCallback3((typename2) => {
|
|
293
|
-
const metadata = manager.capabilities.getAll(Common2.Capability.Metadata).find(({ id }) => id === typename2)?.metadata;
|
|
294
|
-
return metadata?.createObject ? metadata : void 0;
|
|
295
|
-
}, [
|
|
296
|
-
manager
|
|
297
|
-
]);
|
|
298
|
-
const db = Database.isDatabase(target) ? target : target && Obj3.getDatabase(target);
|
|
299
|
-
const schemas = db?.schemaRegistry.query({
|
|
300
|
-
location: [
|
|
301
|
-
"runtime"
|
|
302
|
-
],
|
|
303
|
-
includeSystem: false
|
|
304
|
-
}).runSync();
|
|
305
|
-
const userSchemas = useMemo2(() => schemas?.filter((schema) => getTypeAnnotation2(schema)?.kind !== EntityKind.Relation).filter((schema) => !!resolve(Type.getTypename(schema))) ?? [], [
|
|
306
|
-
schemas
|
|
307
|
-
]);
|
|
308
|
-
const handleCreateObject = useCallback3(({ metadata, data = {} }) => Effect.gen(function* () {
|
|
309
|
-
if (!target) {
|
|
310
|
-
return;
|
|
311
|
-
}
|
|
312
|
-
closeRef.current?.click();
|
|
313
|
-
const db2 = Database.isDatabase(target) ? target : target && Obj3.getDatabase(target);
|
|
314
|
-
invariant(db2, "Missing database", {
|
|
315
|
-
F: __dxlog_file,
|
|
316
|
-
L: 85,
|
|
317
|
-
S: this,
|
|
318
|
-
A: [
|
|
319
|
-
"db",
|
|
320
|
-
"'Missing database'"
|
|
321
|
-
]
|
|
322
|
-
});
|
|
323
|
-
const object = yield* metadata.createObject(data, {
|
|
324
|
-
db: db2
|
|
325
|
-
});
|
|
326
|
-
if (Obj3.isObject(object) && !Obj3.instanceOf(Type.PersistentType, object)) {
|
|
327
|
-
const hidden = !metadata.addToCollectionOnCreate;
|
|
328
|
-
yield* operationInvoker.invoke(SpaceOperation.AddObject, {
|
|
329
|
-
target,
|
|
330
|
-
object,
|
|
331
|
-
hidden
|
|
332
|
-
});
|
|
333
|
-
const shouldNavigate = _shouldNavigate ?? (() => true);
|
|
334
|
-
if (shouldNavigate(object)) {
|
|
335
|
-
yield* Effect.promise(() => operationInvoker.invokePromise(Common2.LayoutOperation.Open, {
|
|
336
|
-
subject: [
|
|
337
|
-
Obj3.getDXN(object).toString()
|
|
338
|
-
]
|
|
339
|
-
}));
|
|
340
|
-
}
|
|
341
|
-
onCreateObject?.(object);
|
|
342
|
-
}
|
|
343
|
-
}).pipe(Effect.provideService(Capability.Service, manager.capabilities), Effect.provideService(Operation.Service, operationInvoker), runAndForwardErrors), [
|
|
344
|
-
target,
|
|
345
|
-
_shouldNavigate,
|
|
346
|
-
onCreateObject,
|
|
347
|
-
manager.capabilities,
|
|
348
|
-
operationInvoker
|
|
349
|
-
]);
|
|
350
|
-
return /* @__PURE__ */ React3.createElement(Dialog.Content, null, /* @__PURE__ */ React3.createElement(Dialog.Header, null, /* @__PURE__ */ React3.createElement(Dialog.Title, null, t("create object dialog title", {
|
|
351
|
-
object: t("typename label", {
|
|
352
|
-
ns: typename,
|
|
353
|
-
defaultValue: views ? "View" : "Object"
|
|
354
|
-
})
|
|
355
|
-
})), /* @__PURE__ */ React3.createElement(Dialog.Close, {
|
|
356
|
-
asChild: true
|
|
357
|
-
}, /* @__PURE__ */ React3.createElement(Dialog.CloseIconButton, {
|
|
358
|
-
ref: closeRef
|
|
359
|
-
}))), /* @__PURE__ */ React3.createElement(CreateObjectPanel, {
|
|
360
|
-
schemas: userSchemas,
|
|
361
|
-
spaces,
|
|
362
|
-
target,
|
|
363
|
-
views,
|
|
364
|
-
typename,
|
|
365
|
-
initialFormValues,
|
|
366
|
-
defaultSpaceId: client.spaces.default.id,
|
|
367
|
-
resolve,
|
|
368
|
-
onTargetChange: setTarget,
|
|
369
|
-
onTypenameChange: setTypename,
|
|
370
|
-
onCreateObject: handleCreateObject
|
|
371
|
-
}));
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
// src/components/CreateDialog/CreateSpaceDialog.tsx
|
|
375
|
-
import * as Effect2 from "effect/Effect";
|
|
376
|
-
import React4, { useCallback as useCallback4, useRef as useRef2 } from "react";
|
|
377
|
-
import { Common as Common3 } from "@dxos/app-framework";
|
|
378
|
-
import { useOperationInvoker as useOperationInvoker3 } from "@dxos/app-framework/react";
|
|
379
|
-
import { runAndForwardErrors as runAndForwardErrors2 } from "@dxos/effect";
|
|
380
|
-
import { Dialog as Dialog2, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
381
|
-
import { Form as Form2 } from "@dxos/react-ui-form";
|
|
382
|
-
var CREATE_SPACE_DIALOG = `${meta.id}/CreateSpaceDialog`;
|
|
383
|
-
var initialValues = {
|
|
384
|
-
edgeReplication: true
|
|
385
|
-
};
|
|
386
|
-
var CreateSpaceDialog = () => {
|
|
387
|
-
const closeRef = useRef2(null);
|
|
388
|
-
const { t } = useTranslation4(meta.id);
|
|
389
|
-
const { invokePromise } = useOperationInvoker3();
|
|
390
|
-
const inputSurfaceLookup = useInputSurfaceLookup();
|
|
391
|
-
const handleCreateSpace = useCallback4(async (data) => {
|
|
392
|
-
const program = Effect2.gen(function* () {
|
|
393
|
-
const { data: result } = yield* Effect2.promise(() => invokePromise(SpaceOperation.Create, data));
|
|
394
|
-
if (result?.space) {
|
|
395
|
-
yield* Effect2.promise(() => invokePromise(Common3.LayoutOperation.SwitchWorkspace, {
|
|
396
|
-
subject: result.space.id
|
|
397
|
-
}));
|
|
398
|
-
yield* Effect2.promise(() => invokePromise(Common3.LayoutOperation.UpdateDialog, {
|
|
399
|
-
state: false
|
|
400
|
-
}));
|
|
401
|
-
}
|
|
402
|
-
});
|
|
403
|
-
await runAndForwardErrors2(program);
|
|
404
|
-
}, [
|
|
405
|
-
invokePromise
|
|
406
|
-
]);
|
|
407
|
-
return /* @__PURE__ */ React4.createElement(Dialog2.Content, null, /* @__PURE__ */ React4.createElement(Dialog2.Header, null, /* @__PURE__ */ React4.createElement(Dialog2.Title, null, t("create space dialog title")), /* @__PURE__ */ React4.createElement(Dialog2.Close, {
|
|
408
|
-
asChild: true
|
|
409
|
-
}, /* @__PURE__ */ React4.createElement(Dialog2.CloseIconButton, {
|
|
410
|
-
ref: closeRef
|
|
411
|
-
}))), /* @__PURE__ */ React4.createElement(Form2.Root, {
|
|
412
|
-
testId: "create-space-form",
|
|
413
|
-
autoFocus: true,
|
|
414
|
-
schema: SpaceForm,
|
|
415
|
-
values: initialValues,
|
|
416
|
-
fieldProvider: inputSurfaceLookup,
|
|
417
|
-
onSave: handleCreateSpace
|
|
418
|
-
}, /* @__PURE__ */ React4.createElement(Form2.Viewport, null, /* @__PURE__ */ React4.createElement(Form2.Content, null, /* @__PURE__ */ React4.createElement(Form2.FieldSet, null), /* @__PURE__ */ React4.createElement(Form2.Submit, null)))));
|
|
419
|
-
};
|
|
420
|
-
|
|
421
|
-
// src/components/CollectionSection.tsx
|
|
422
|
-
import React5 from "react";
|
|
423
|
-
import { useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
424
|
-
var CollectionSection = ({ role, subject }) => {
|
|
425
|
-
const { t } = useTranslation5(meta.id);
|
|
426
|
-
return /* @__PURE__ */ React5.createElement("div", {
|
|
427
|
-
role,
|
|
428
|
-
className: "min-bs-[3.5rem] grid grid-rows-subgrid grid-cols-subgrid items-center"
|
|
429
|
-
}, /* @__PURE__ */ React5.createElement("span", {
|
|
430
|
-
className: "truncate"
|
|
431
|
-
}, subject.name ?? t("unnamed collection label")));
|
|
432
|
-
};
|
|
433
|
-
|
|
434
|
-
// src/components/JoinDialog/JoinDialog.tsx
|
|
435
|
-
import React6, { useCallback as useCallback5 } from "react";
|
|
436
|
-
import { Common as Common4 } from "@dxos/app-framework";
|
|
437
|
-
import { useAppGraph, useOperationInvoker as useOperationInvoker4 } from "@dxos/app-framework/react";
|
|
438
|
-
import { Trigger } from "@dxos/async";
|
|
439
|
-
import { Graph } from "@dxos/plugin-graph";
|
|
440
|
-
import { ObservabilityOperation } from "@dxos/plugin-observability/types";
|
|
441
|
-
import { useClient as useClient3 } from "@dxos/react-client";
|
|
442
|
-
import { Dialog as Dialog3, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
443
|
-
import { JoinPanel } from "@dxos/shell/react";
|
|
444
|
-
import { osTranslations as osTranslations2 } from "@dxos/ui-theme";
|
|
445
|
-
var JOIN_DIALOG = `${meta.id}/JoinDialog`;
|
|
446
|
-
var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
447
|
-
const { invokePromise } = useOperationInvoker4();
|
|
448
|
-
const client = useClient3();
|
|
449
|
-
const { graph } = useAppGraph();
|
|
450
|
-
const { t } = useTranslation6(meta.id);
|
|
451
|
-
const handleDone = useCallback5(async (result) => {
|
|
452
|
-
const spaceKey = result?.spaceKey;
|
|
453
|
-
if (!spaceKey) {
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
await Promise.all([
|
|
457
|
-
invokePromise(Common4.LayoutOperation.AddToast, {
|
|
458
|
-
id: `${meta.id}/join-success`,
|
|
459
|
-
duration: 5e3,
|
|
460
|
-
title: [
|
|
461
|
-
"join success label",
|
|
462
|
-
{
|
|
463
|
-
ns: meta.id
|
|
464
|
-
}
|
|
465
|
-
],
|
|
466
|
-
closeLabel: [
|
|
467
|
-
"dismiss label",
|
|
468
|
-
{
|
|
469
|
-
ns: meta.id
|
|
470
|
-
}
|
|
471
|
-
]
|
|
472
|
-
}),
|
|
473
|
-
invokePromise(Common4.LayoutOperation.UpdateDialog, {
|
|
474
|
-
state: false
|
|
475
|
-
})
|
|
476
|
-
]);
|
|
477
|
-
let space = client.spaces.get(spaceKey);
|
|
478
|
-
if (!space) {
|
|
479
|
-
const trigger = new Trigger();
|
|
480
|
-
client.spaces.subscribe(() => {
|
|
481
|
-
const space2 = client.spaces.get(spaceKey);
|
|
482
|
-
if (space2) {
|
|
483
|
-
trigger.wake(space2);
|
|
484
|
-
}
|
|
485
|
-
});
|
|
486
|
-
space = await trigger.wait();
|
|
487
|
-
}
|
|
488
|
-
await invokePromise(Common4.LayoutOperation.SwitchWorkspace, {
|
|
489
|
-
subject: space.id
|
|
490
|
-
});
|
|
491
|
-
const target = result?.target || (navigableCollections ? space?.id : void 0);
|
|
492
|
-
if (target) {
|
|
493
|
-
await Graph.waitForPath(graph, {
|
|
494
|
-
target
|
|
495
|
-
}).catch(() => {
|
|
496
|
-
});
|
|
497
|
-
await Promise.all([
|
|
498
|
-
invokePromise(Common4.LayoutOperation.Open, {
|
|
499
|
-
subject: [
|
|
500
|
-
target
|
|
501
|
-
]
|
|
502
|
-
}),
|
|
503
|
-
invokePromise(Common4.LayoutOperation.Expose, {
|
|
504
|
-
subject: target
|
|
505
|
-
})
|
|
506
|
-
]);
|
|
507
|
-
}
|
|
508
|
-
await onDone?.(result);
|
|
509
|
-
if (space) {
|
|
510
|
-
await invokePromise(ObservabilityOperation.SendEvent, {
|
|
511
|
-
name: "space.join",
|
|
512
|
-
properties: {
|
|
513
|
-
spaceId: space.id
|
|
514
|
-
}
|
|
515
|
-
});
|
|
516
|
-
}
|
|
517
|
-
}, [
|
|
518
|
-
invokePromise,
|
|
519
|
-
client,
|
|
520
|
-
graph,
|
|
521
|
-
navigableCollections,
|
|
522
|
-
onDone
|
|
523
|
-
]);
|
|
524
|
-
return /* @__PURE__ */ React6.createElement(Dialog3.Content, null, /* @__PURE__ */ React6.createElement(Dialog3.Title, {
|
|
525
|
-
classNames: "sr-only"
|
|
526
|
-
}, t("join space label", {
|
|
527
|
-
ns: osTranslations2
|
|
528
|
-
})), /* @__PURE__ */ React6.createElement(JoinPanel, {
|
|
529
|
-
...props,
|
|
530
|
-
exitActionParent: /* @__PURE__ */ React6.createElement(Dialog3.Close, {
|
|
531
|
-
asChild: true
|
|
532
|
-
}),
|
|
533
|
-
doneActionParent: /* @__PURE__ */ React6.createElement(Dialog3.Close, {
|
|
534
|
-
asChild: true
|
|
535
|
-
}),
|
|
536
|
-
onDone: handleDone
|
|
537
|
-
}));
|
|
538
|
-
};
|
|
539
|
-
|
|
540
|
-
// src/components/MembersContainer/MembersContainer.tsx
|
|
541
|
-
import React7, { useCallback as useCallback6, useMemo as useMemo3, useState as useState3 } from "react";
|
|
542
|
-
import { QR } from "react-qr-rounded";
|
|
543
|
-
import { useOperationInvoker as useOperationInvoker5 } from "@dxos/app-framework/react";
|
|
544
|
-
import { Obj as Obj4 } from "@dxos/echo";
|
|
545
|
-
import { log } from "@dxos/log";
|
|
546
|
-
import { useConfig } from "@dxos/react-client";
|
|
547
|
-
import { useSpaceInvitations } from "@dxos/react-client/echo";
|
|
548
|
-
import { Invitation, InvitationEncoder } from "@dxos/react-client/invitations";
|
|
549
|
-
import { Button as Button2, Clipboard, Icon as Icon2, Input, useId, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
550
|
-
import { ControlFrame, ControlFrameItem, ControlItemInput, ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
551
|
-
import { Layout } from "@dxos/react-ui-mosaic";
|
|
552
|
-
import { Collection } from "@dxos/schema";
|
|
553
|
-
import { AuthCode, BifurcatedAction, Centered, Emoji, InvitationList, SpaceMemberList, Viewport, translationKey as shellTranslationKey } from "@dxos/shell/react";
|
|
554
|
-
import { hexToEmoji } from "@dxos/util";
|
|
555
|
-
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/MembersContainer/MembersContainer.tsx";
|
|
556
|
-
var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
557
|
-
var handleInvitationEvent = (invitation, subscription) => {
|
|
558
|
-
const invitationCode = InvitationEncoder.encode(invitation);
|
|
559
|
-
if (invitation.state === Invitation.State.CONNECTING) {
|
|
560
|
-
log.info(JSON.stringify({
|
|
561
|
-
invitationCode,
|
|
562
|
-
authCode: invitation.authCode
|
|
563
|
-
}), void 0, {
|
|
564
|
-
F: __dxlog_file2,
|
|
565
|
-
L: 41,
|
|
566
|
-
S: void 0,
|
|
567
|
-
C: (f, a) => f(...a)
|
|
568
|
-
});
|
|
569
|
-
subscription.unsubscribe();
|
|
570
|
-
}
|
|
571
|
-
};
|
|
572
|
-
var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
573
|
-
const { t } = useTranslation7(meta.id);
|
|
574
|
-
const config = useConfig();
|
|
575
|
-
const { invokePromise } = useOperationInvoker5();
|
|
576
|
-
const invitations = useSpaceInvitations(space.key);
|
|
577
|
-
const visibleInvitations = invitations?.filter((invitation) => ![
|
|
578
|
-
Invitation.State.CANCELLED
|
|
579
|
-
].includes(invitation.get().state));
|
|
580
|
-
const [activeAction, setInternalActiveAction] = useState3(localStorage.getItem(activeActionKey) ?? "inviteMany");
|
|
581
|
-
const setActiveAction = (nextAction) => {
|
|
582
|
-
setInternalActiveAction(nextAction);
|
|
583
|
-
localStorage.setItem(activeActionKey, nextAction);
|
|
584
|
-
};
|
|
585
|
-
const target = space.properties[Collection.Collection.typename]?.target?.objects[0]?.target;
|
|
586
|
-
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
587
|
-
const handleChangeLocked = useCallback6(() => {
|
|
588
|
-
Obj4.change(space.properties, (p) => {
|
|
589
|
-
p[COMPOSER_SPACE_LOCK] = !locked;
|
|
590
|
-
});
|
|
591
|
-
}, [
|
|
592
|
-
locked,
|
|
593
|
-
space
|
|
594
|
-
]);
|
|
595
|
-
const inviteActions = useMemo3(() => ({
|
|
596
|
-
inviteOne: {
|
|
597
|
-
label: t("invite one label", {
|
|
598
|
-
ns: shellTranslationKey
|
|
599
|
-
}),
|
|
600
|
-
description: t("invite one description", {
|
|
601
|
-
ns: shellTranslationKey
|
|
602
|
-
}),
|
|
603
|
-
icon: "ph--user-plus--regular",
|
|
604
|
-
testId: "membersContainer.inviteOne",
|
|
605
|
-
onClick: async () => {
|
|
606
|
-
const { data: invitation } = await invokePromise(SpaceOperation.Share, {
|
|
607
|
-
space,
|
|
608
|
-
type: Invitation.Type.INTERACTIVE,
|
|
609
|
-
authMethod: Invitation.AuthMethod.SHARED_SECRET,
|
|
610
|
-
multiUse: false,
|
|
611
|
-
target: target && Obj4.getDXN(target).toString()
|
|
612
|
-
});
|
|
613
|
-
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
|
|
614
|
-
const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
},
|
|
618
|
-
inviteMany: {
|
|
619
|
-
label: t("invite many label", {
|
|
620
|
-
ns: shellTranslationKey
|
|
621
|
-
}),
|
|
622
|
-
description: t("invite many description", {
|
|
623
|
-
ns: shellTranslationKey
|
|
624
|
-
}),
|
|
625
|
-
icon: "ph--users-three--regular",
|
|
626
|
-
testId: "membersContainer.inviteMany",
|
|
627
|
-
onClick: async () => {
|
|
628
|
-
const { data: invitation } = await invokePromise(SpaceOperation.Share, {
|
|
629
|
-
space,
|
|
630
|
-
type: Invitation.Type.DELEGATED,
|
|
631
|
-
authMethod: Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
|
|
632
|
-
multiUse: true,
|
|
633
|
-
target: target && Obj4.getDXN(target).toString()
|
|
634
|
-
});
|
|
635
|
-
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
|
|
636
|
-
const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
}), [
|
|
641
|
-
t,
|
|
642
|
-
space,
|
|
643
|
-
target,
|
|
644
|
-
invokePromise
|
|
645
|
-
]);
|
|
646
|
-
const [selectedInvitation, setSelectedInvitation] = useState3(null);
|
|
647
|
-
const handleSend = (event) => {
|
|
648
|
-
setSelectedInvitation(event.invitation);
|
|
649
|
-
};
|
|
650
|
-
const handleBack = () => {
|
|
651
|
-
setSelectedInvitation(null);
|
|
652
|
-
};
|
|
653
|
-
return /* @__PURE__ */ React7.createElement(Clipboard.Provider, null, /* @__PURE__ */ React7.createElement(Layout.Container, {
|
|
654
|
-
scrollable: true
|
|
655
|
-
}, /* @__PURE__ */ React7.createElement(ControlPage, null, /* @__PURE__ */ React7.createElement(ControlSection, {
|
|
656
|
-
title: t("members verbose label"),
|
|
657
|
-
description: t("members description")
|
|
658
|
-
}, /* @__PURE__ */ React7.createElement(ControlFrame, null, /* @__PURE__ */ React7.createElement(ControlFrameItem, {
|
|
659
|
-
title: t("members label")
|
|
660
|
-
}, /* @__PURE__ */ React7.createElement(SpaceMemberList, {
|
|
661
|
-
spaceKey: space.key,
|
|
662
|
-
includeSelf: true
|
|
663
|
-
})), locked && /* @__PURE__ */ React7.createElement(ControlFrameItem, {
|
|
664
|
-
title: t("invitations label")
|
|
665
|
-
}, /* @__PURE__ */ React7.createElement("p", {
|
|
666
|
-
className: "text-description mbe-2"
|
|
667
|
-
}, t("locked space description"))), !locked && /* @__PURE__ */ React7.createElement(ControlFrameItem, {
|
|
668
|
-
title: t("invitations label")
|
|
669
|
-
}, selectedInvitation && /* @__PURE__ */ React7.createElement(InvitationSection, {
|
|
670
|
-
...selectedInvitation,
|
|
671
|
-
onBack: handleBack
|
|
672
|
-
}), !selectedInvitation && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("p", {
|
|
673
|
-
className: "text-description mbe-2"
|
|
674
|
-
}, t("space invitation description")), /* @__PURE__ */ React7.createElement(InvitationList, {
|
|
675
|
-
className: "mb-2",
|
|
676
|
-
send: handleSend,
|
|
677
|
-
invitations: visibleInvitations ?? [],
|
|
678
|
-
onClickRemove: (invitation) => invitation.cancel(),
|
|
679
|
-
createInvitationUrl
|
|
680
|
-
}), /* @__PURE__ */ React7.createElement(BifurcatedAction, {
|
|
681
|
-
actions: inviteActions,
|
|
682
|
-
activeAction,
|
|
683
|
-
onChangeActiveAction: setActiveAction,
|
|
684
|
-
"data-testid": "membersContainer.createInvitation"
|
|
685
|
-
})))), /* @__PURE__ */ React7.createElement("div", {
|
|
686
|
-
className: "justify-center p-0 mbs-4 container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
|
|
687
|
-
}, /* @__PURE__ */ React7.createElement(ControlItemInput, {
|
|
688
|
-
title: t("space locked label"),
|
|
689
|
-
description: t("space locked description")
|
|
690
|
-
}, /* @__PURE__ */ React7.createElement(Input.Switch, {
|
|
691
|
-
checked: locked,
|
|
692
|
-
onCheckedChange: handleChangeLocked,
|
|
693
|
-
classNames: "justify-self-end"
|
|
694
|
-
})))))));
|
|
695
|
-
};
|
|
696
|
-
var InvitationSection = ({ state = Invitation.State.INIT, authCode, invitationId = "never", url = "never", onBack }) => {
|
|
697
|
-
const activeView = state < 0 ? "init" : state >= Invitation.State.CANCELLED ? "complete" : state >= Invitation.State.READY_FOR_AUTHENTICATION && authCode ? "auth-code" : "qr-code";
|
|
698
|
-
return /* @__PURE__ */ React7.createElement(Viewport.Root, {
|
|
699
|
-
activeView
|
|
700
|
-
}, /* @__PURE__ */ React7.createElement(Viewport.Views, null, /* @__PURE__ */ React7.createElement(Viewport.View, {
|
|
701
|
-
id: "init"
|
|
702
|
-
}), /* @__PURE__ */ React7.createElement(Viewport.View, {
|
|
703
|
-
id: "complete"
|
|
704
|
-
}, /* @__PURE__ */ React7.createElement(InvitationComplete, {
|
|
705
|
-
statusValue: state
|
|
706
|
-
})), /* @__PURE__ */ React7.createElement(Viewport.View, {
|
|
707
|
-
id: "auth-code"
|
|
708
|
-
}, /* @__PURE__ */ React7.createElement(InvitationAuthCode, {
|
|
709
|
-
id: invitationId,
|
|
710
|
-
code: authCode ?? "never",
|
|
711
|
-
onCancel: onBack
|
|
712
|
-
})), /* @__PURE__ */ React7.createElement(Viewport.View, {
|
|
713
|
-
id: "qr-code"
|
|
714
|
-
}, /* @__PURE__ */ React7.createElement(InvitationQR, {
|
|
715
|
-
id: invitationId,
|
|
716
|
-
url,
|
|
717
|
-
onCancel: onBack
|
|
718
|
-
}))));
|
|
719
|
-
};
|
|
720
|
-
var InvitationQR = ({ id, url, onCancel }) => {
|
|
721
|
-
const { t } = useTranslation7(shellTranslationKey);
|
|
722
|
-
const qrLabel = useId("members-container__qr-code");
|
|
723
|
-
const emoji = hexToEmoji(id);
|
|
724
|
-
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("p", {
|
|
725
|
-
className: "text-description"
|
|
726
|
-
}, t("qr code description", {
|
|
727
|
-
ns: meta.id
|
|
728
|
-
})), /* @__PURE__ */ React7.createElement("div", {
|
|
729
|
-
role: "group",
|
|
730
|
-
className: "grid grid-cols-[1fr_min-content] mlb-2 gap-2"
|
|
731
|
-
}, /* @__PURE__ */ React7.createElement("div", {
|
|
732
|
-
role: "none",
|
|
733
|
-
className: "is-full aspect-square relative text-description"
|
|
734
|
-
}, /* @__PURE__ */ React7.createElement(QR, {
|
|
735
|
-
rounding: 100,
|
|
736
|
-
backgroundColor: "transparent",
|
|
737
|
-
color: "currentColor",
|
|
738
|
-
"aria-labelledby": qrLabel,
|
|
739
|
-
errorCorrectionLevel: "Q",
|
|
740
|
-
cutout: true
|
|
741
|
-
}, url ?? "never"), /* @__PURE__ */ React7.createElement(Centered, null, /* @__PURE__ */ React7.createElement(Emoji, {
|
|
742
|
-
text: emoji
|
|
743
|
-
}))), /* @__PURE__ */ React7.createElement("span", {
|
|
744
|
-
id: qrLabel,
|
|
745
|
-
className: "sr-only"
|
|
746
|
-
}, t("qr label")), /* @__PURE__ */ React7.createElement(Clipboard.Button, {
|
|
747
|
-
value: url ?? "never"
|
|
748
|
-
})), /* @__PURE__ */ React7.createElement(Button2, {
|
|
749
|
-
variant: "ghost",
|
|
750
|
-
onClick: onCancel
|
|
751
|
-
}, t("cancel label")));
|
|
752
|
-
};
|
|
753
|
-
var InvitationAuthCode = ({ id, code, onCancel }) => {
|
|
754
|
-
const { t } = useTranslation7(shellTranslationKey);
|
|
755
|
-
const emoji = hexToEmoji(id);
|
|
756
|
-
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("p", {
|
|
757
|
-
className: "text-description"
|
|
758
|
-
}, t("auth other device emoji message")), emoji && /* @__PURE__ */ React7.createElement(Emoji, {
|
|
759
|
-
text: emoji,
|
|
760
|
-
className: "mli-auto mlb-2 text-center"
|
|
761
|
-
}), /* @__PURE__ */ React7.createElement("p", {
|
|
762
|
-
className: "text-description"
|
|
763
|
-
}, t("auth code message")), /* @__PURE__ */ React7.createElement(AuthCode, {
|
|
764
|
-
code,
|
|
765
|
-
large: true,
|
|
766
|
-
classNames: "mli-auto mlb-2 text-center grow"
|
|
767
|
-
}), /* @__PURE__ */ React7.createElement(Button2, {
|
|
768
|
-
variant: "ghost",
|
|
769
|
-
onClick: onCancel
|
|
770
|
-
}, t("cancel label")));
|
|
771
|
-
};
|
|
772
|
-
var InvitationComplete = ({ statusValue }) => {
|
|
773
|
-
return statusValue > 0 ? /* @__PURE__ */ React7.createElement(Icon2, {
|
|
774
|
-
icon: "ph--check--regular",
|
|
775
|
-
size: 6,
|
|
776
|
-
classNames: "m-1.5"
|
|
777
|
-
}) : /* @__PURE__ */ React7.createElement(Icon2, {
|
|
778
|
-
icon: "ph--x--regular",
|
|
779
|
-
size: 6,
|
|
780
|
-
classNames: "m-1.5"
|
|
781
|
-
});
|
|
782
|
-
};
|
|
783
|
-
|
|
784
|
-
// src/components/MenuFooter.tsx
|
|
785
|
-
import React8 from "react";
|
|
786
|
-
import { getSpace } from "@dxos/client/echo";
|
|
787
|
-
import { useClient as useClient4 } from "@dxos/react-client";
|
|
788
|
-
import { DropdownMenu, Icon as Icon3, toLocalizedString as toLocalizedString2, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
789
|
-
var MenuFooter = ({ object }) => {
|
|
790
|
-
const { t } = useTranslation8(meta.id);
|
|
791
|
-
const client = useClient4();
|
|
792
|
-
const space = getSpace(object);
|
|
793
|
-
const spaceName = space ? getSpaceDisplayName(space, {
|
|
794
|
-
personal: client.spaces.default === space
|
|
795
|
-
}) : "";
|
|
796
|
-
return space ? /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(DropdownMenu.Separator, null), /* @__PURE__ */ React8.createElement(DropdownMenu.GroupLabel, null, t("menu footer label")), /* @__PURE__ */ React8.createElement("dl", {
|
|
797
|
-
className: "pis-2 mbe-2 text-xs grid grid-cols-[max-content_1fr] gap-2"
|
|
798
|
-
}, /* @__PURE__ */ React8.createElement("dt", {
|
|
799
|
-
className: "uppercase text-[.75em] tracking-wide font-medium mbs-px self-start"
|
|
800
|
-
}, t("location label")), /* @__PURE__ */ React8.createElement("dd", {
|
|
801
|
-
className: "line-clamp-3"
|
|
802
|
-
}, /* @__PURE__ */ React8.createElement(Icon3, {
|
|
803
|
-
icon: "ph--planet--regular",
|
|
804
|
-
classNames: "inline-block mie-1"
|
|
805
|
-
}), toLocalizedString2(spaceName, t)))) : null;
|
|
806
|
-
};
|
|
807
|
-
|
|
808
|
-
// src/components/ObjectRenamePopover/ObjectRenamePopover.tsx
|
|
809
|
-
import React9, { useCallback as useCallback7, useRef as useRef3, useState as useState4 } from "react";
|
|
810
|
-
import { Common as Common5 } from "@dxos/app-framework";
|
|
811
|
-
import { useOperationInvoker as useOperationInvoker6 } from "@dxos/app-framework/react";
|
|
812
|
-
import { Obj as Obj5 } from "@dxos/echo";
|
|
813
|
-
import { log as log2 } from "@dxos/log";
|
|
814
|
-
import { Button as Button3, Input as Input2, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
815
|
-
import { osTranslations as osTranslations3 } from "@dxos/ui-theme";
|
|
816
|
-
var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/ObjectRenamePopover/ObjectRenamePopover.tsx";
|
|
817
|
-
var OBJECT_RENAME_POPOVER = `${meta.id}/ObjectRenamePopover`;
|
|
818
|
-
var ObjectRenamePopover = ({ object }) => {
|
|
819
|
-
const { t } = useTranslation9(meta.id);
|
|
820
|
-
const doneButton = useRef3(null);
|
|
821
|
-
const [name, setName] = useState4(Obj5.getLabel(object));
|
|
822
|
-
const { invokePromise } = useOperationInvoker6();
|
|
823
|
-
const handleDone = useCallback7(() => {
|
|
824
|
-
try {
|
|
825
|
-
name && Obj5.change(object, () => Obj5.setLabel(object, name));
|
|
826
|
-
} catch (err) {
|
|
827
|
-
log2.error("Failed to rename object", {
|
|
828
|
-
err
|
|
829
|
-
}, {
|
|
830
|
-
F: __dxlog_file3,
|
|
831
|
-
L: 28,
|
|
832
|
-
S: void 0,
|
|
833
|
-
C: (f, a) => f(...a)
|
|
834
|
-
});
|
|
835
|
-
}
|
|
836
|
-
void invokePromise(Common5.LayoutOperation.UpdatePopover, {
|
|
837
|
-
anchorId: "",
|
|
838
|
-
state: false
|
|
839
|
-
});
|
|
840
|
-
}, [
|
|
841
|
-
object,
|
|
842
|
-
name,
|
|
843
|
-
invokePromise
|
|
844
|
-
]);
|
|
845
|
-
return /* @__PURE__ */ React9.createElement("div", {
|
|
846
|
-
role: "none",
|
|
847
|
-
className: "p-2 flex gap-2"
|
|
848
|
-
}, /* @__PURE__ */ React9.createElement("div", {
|
|
849
|
-
role: "none",
|
|
850
|
-
className: "flex-1"
|
|
851
|
-
}, /* @__PURE__ */ React9.createElement(Input2.Root, null, /* @__PURE__ */ React9.createElement(Input2.Label, {
|
|
852
|
-
srOnly: true
|
|
853
|
-
}, t("object name label")), /* @__PURE__ */ React9.createElement(Input2.TextInput, {
|
|
854
|
-
placeholder: t("object placeholder"),
|
|
855
|
-
value: name,
|
|
856
|
-
"data-testid": "spacePlugin.renameObject.input",
|
|
857
|
-
onChange: ({ target: { value: value2 } }) => setName(value2),
|
|
858
|
-
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
859
|
-
}))), /* @__PURE__ */ React9.createElement(Button3, {
|
|
860
|
-
ref: doneButton,
|
|
861
|
-
classNames: "self-stretch",
|
|
862
|
-
onClick: handleDone
|
|
863
|
-
}, t("done label", {
|
|
864
|
-
ns: osTranslations3
|
|
865
|
-
})));
|
|
866
|
-
};
|
|
867
|
-
|
|
868
|
-
// src/components/SchemaContainer.tsx
|
|
869
|
-
import React10, { useEffect as useEffect2, useState as useState5 } from "react";
|
|
870
|
-
import { useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
871
|
-
import { ControlPage as ControlPage2, ControlSection as ControlSection2, controlItemClasses } from "@dxos/react-ui-form";
|
|
872
|
-
import { Layout as Layout2 } from "@dxos/react-ui-mosaic";
|
|
873
|
-
var SchemaContainer = ({ space }) => {
|
|
874
|
-
const { t } = useTranslation10(meta.id);
|
|
875
|
-
const schemas = useQuerySpaceSchemas(space);
|
|
876
|
-
return /* @__PURE__ */ React10.createElement(Layout2.Container, {
|
|
877
|
-
scrollable: true
|
|
878
|
-
}, /* @__PURE__ */ React10.createElement(ControlPage2, null, /* @__PURE__ */ React10.createElement(ControlSection2, {
|
|
879
|
-
title: t("schema verbose label"),
|
|
880
|
-
description: t("schema description")
|
|
881
|
-
}, /* @__PURE__ */ React10.createElement("div", {
|
|
882
|
-
role: "none",
|
|
883
|
-
className: controlItemClasses
|
|
884
|
-
}, schemas.length === 0 && /* @__PURE__ */ React10.createElement("div", {
|
|
885
|
-
className: "text-center plb-4"
|
|
886
|
-
}, t("no schemas found message")), schemas.map((schema) => /* @__PURE__ */ React10.createElement("div", {
|
|
887
|
-
role: "none",
|
|
888
|
-
key: schema.id
|
|
889
|
-
}, schema.typename))))));
|
|
890
|
-
};
|
|
891
|
-
var useQuerySpaceSchemas = (space) => {
|
|
892
|
-
const [schemas, setSchemas] = useState5([]);
|
|
893
|
-
useEffect2(() => {
|
|
894
|
-
const query = space.db.schemaRegistry.query();
|
|
895
|
-
const initialResults = query.runSync();
|
|
896
|
-
setSchemas(initialResults);
|
|
897
|
-
const unsubscribe = query.subscribe(() => setSchemas(query.results));
|
|
898
|
-
return () => unsubscribe();
|
|
899
|
-
}, [
|
|
900
|
-
space
|
|
901
|
-
]);
|
|
902
|
-
return schemas;
|
|
903
|
-
};
|
|
904
|
-
|
|
905
|
-
// src/components/SpacePluginSettings.tsx
|
|
906
|
-
import React11 from "react";
|
|
907
|
-
import { useOperationInvoker as useOperationInvoker7 } from "@dxos/app-framework/react";
|
|
908
|
-
import { useClient as useClient5 } from "@dxos/react-client";
|
|
909
|
-
import { useSpaces as useSpaces2 } from "@dxos/react-client/echo";
|
|
910
|
-
import { IconButton, Input as Input3, List, ListItem, toLocalizedString as toLocalizedString3, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
911
|
-
import { ControlGroup, ControlItemInput as ControlItemInput2, ControlPage as ControlPage3, ControlSection as ControlSection3, controlItemClasses as controlItemClasses2 } from "@dxos/react-ui-form";
|
|
912
|
-
var SpacePluginSettings = ({ settings, onSettingsChange }) => {
|
|
913
|
-
const { t } = useTranslation11(meta.id);
|
|
914
|
-
const client = useClient5();
|
|
915
|
-
const spaces = useSpaces2({
|
|
916
|
-
all: settings.showHidden
|
|
917
|
-
});
|
|
918
|
-
const { invokePromise } = useOperationInvoker7();
|
|
919
|
-
return /* @__PURE__ */ React11.createElement(ControlPage3, null, /* @__PURE__ */ React11.createElement(ControlSection3, {
|
|
920
|
-
title: t("space settings label"),
|
|
921
|
-
description: t("space settings description")
|
|
922
|
-
}, /* @__PURE__ */ React11.createElement(ControlGroup, null, /* @__PURE__ */ React11.createElement(ControlItemInput2, {
|
|
923
|
-
title: t("show hidden spaces label")
|
|
924
|
-
}, /* @__PURE__ */ React11.createElement(Input3.Switch, {
|
|
925
|
-
checked: settings.showHidden,
|
|
926
|
-
onCheckedChange: (checked) => onSettingsChange((s) => ({
|
|
927
|
-
...s,
|
|
928
|
-
showHidden: !!checked
|
|
929
|
-
}))
|
|
930
|
-
}))), /* @__PURE__ */ React11.createElement(List, {
|
|
931
|
-
classNames: [
|
|
932
|
-
controlItemClasses2,
|
|
933
|
-
"flex flex-col gap-trimSm"
|
|
934
|
-
]
|
|
935
|
-
}, spaces.map((space) => /* @__PURE__ */ React11.createElement(ListItem.Root, {
|
|
936
|
-
key: space.id,
|
|
937
|
-
classNames: "is-full items-center"
|
|
938
|
-
}, /* @__PURE__ */ React11.createElement(ListItem.Heading, {
|
|
939
|
-
classNames: "grow truncate !min-bs-0"
|
|
940
|
-
}, toLocalizedString3(getSpaceDisplayName(space, {
|
|
941
|
-
personal: space === client.spaces.default
|
|
942
|
-
}), t)), /* @__PURE__ */ React11.createElement(IconButton, {
|
|
943
|
-
icon: "ph--faders--regular",
|
|
944
|
-
onClick: () => invokePromise(SpaceOperation.OpenSettings, {
|
|
945
|
-
space
|
|
946
|
-
}),
|
|
947
|
-
label: t("open space settings label")
|
|
948
|
-
}))))));
|
|
949
|
-
};
|
|
950
|
-
|
|
951
|
-
// src/components/SpacePresence/SpacePresence.tsx
|
|
952
|
-
import * as Option2 from "effect/Option";
|
|
953
|
-
import React12, { forwardRef, useCallback as useCallback8, useEffect as useEffect3, useState as useState6 } from "react";
|
|
954
|
-
import { useAppGraph as useAppGraph2, useAtomCapability } from "@dxos/app-framework/react";
|
|
955
|
-
import { generateName } from "@dxos/display-name";
|
|
956
|
-
import { Obj as Obj6 } from "@dxos/echo";
|
|
957
|
-
import { PublicKey } from "@dxos/react-client";
|
|
958
|
-
import { useMembers, useSpace } from "@dxos/react-client/echo";
|
|
959
|
-
import { useIdentity } from "@dxos/react-client/halo";
|
|
960
|
-
import { Avatar, List as List2, ListItem as ListItem2, Popover, Tooltip, useDefaultValue as useDefaultValue2, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
961
|
-
import { AttentionGlyph, useAttended, useAttention } from "@dxos/react-ui-attention";
|
|
962
|
-
import { ComplexMap, keyToFallback } from "@dxos/util";
|
|
963
|
-
var REFRESH_INTERVAL = 5e3;
|
|
964
|
-
var ACTIVITY_DURATION = 3e4;
|
|
965
|
-
var noViewers = new ComplexMap(PublicKey.hash);
|
|
966
|
-
var getName = (identity) => identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
|
|
967
|
-
var SpacePresence = ({ object, spaceId }) => {
|
|
968
|
-
const ephemeral = useAtomCapability(SpaceCapabilities.EphemeralState);
|
|
969
|
-
const identity = useIdentity();
|
|
970
|
-
const db = Obj6.getDatabase(object);
|
|
971
|
-
const space = useSpace(spaceId ?? db?.spaceId);
|
|
972
|
-
const spaceMembers = useMembers(spaceId ?? db?.spaceId);
|
|
973
|
-
const [_moment, setMoment] = useState6(Date.now());
|
|
974
|
-
useEffect3(() => {
|
|
975
|
-
const interval = setInterval(() => setMoment(Date.now()), REFRESH_INTERVAL);
|
|
976
|
-
return () => clearInterval(interval);
|
|
977
|
-
}, []);
|
|
978
|
-
const memberOnline = useCallback8((member) => member.presence === 1, []);
|
|
979
|
-
const memberIsNotSelf = useCallback8((member) => !identity?.identityKey.equals(member.identity.identityKey), [
|
|
980
|
-
identity?.identityKey
|
|
981
|
-
]);
|
|
982
|
-
if (!identity || !ephemeral || !space) {
|
|
983
|
-
return null;
|
|
984
|
-
}
|
|
985
|
-
const currentObjectViewers = ephemeral.viewersByObject[Obj6.getDXN(object).toString()] ?? noViewers;
|
|
986
|
-
const membersForObject = spaceMembers.filter((member) => memberOnline(member) && memberIsNotSelf(member)).filter((member) => currentObjectViewers.has(member.identity.identityKey)).map((member) => {
|
|
987
|
-
const objectView = currentObjectViewers.get(member.identity.identityKey);
|
|
988
|
-
const lastSeen = objectView?.lastSeen ?? -Infinity;
|
|
989
|
-
const currentlyAttended = objectView?.currentlyAttended ?? false;
|
|
990
|
-
return {
|
|
991
|
-
...member,
|
|
992
|
-
currentlyAttended,
|
|
993
|
-
lastSeen
|
|
994
|
-
};
|
|
995
|
-
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
996
|
-
return /* @__PURE__ */ React12.createElement(FullPresence, {
|
|
997
|
-
members: membersForObject
|
|
998
|
-
});
|
|
999
|
-
};
|
|
1000
|
-
var FullPresence = (props) => {
|
|
1001
|
-
const { size = 9, onMemberClick } = props;
|
|
1002
|
-
const members = useDefaultValue2(props.members, () => []);
|
|
1003
|
-
if (members.length === 0) {
|
|
1004
|
-
return null;
|
|
1005
|
-
}
|
|
1006
|
-
return /* @__PURE__ */ React12.createElement("div", {
|
|
1007
|
-
className: "dx-avatar-group",
|
|
1008
|
-
"data-testid": "spacePlugin.presence"
|
|
1009
|
-
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */ React12.createElement(Tooltip.Trigger, {
|
|
1010
|
-
key: member.identity.identityKey.toHex(),
|
|
1011
|
-
side: "bottom",
|
|
1012
|
-
content: getName(member.identity),
|
|
1013
|
-
className: "grid focus:outline-none"
|
|
1014
|
-
}, /* @__PURE__ */ React12.createElement(PresenceAvatar, {
|
|
1015
|
-
identity: member.identity,
|
|
1016
|
-
match: member.currentlyAttended,
|
|
1017
|
-
index: members.length - i,
|
|
1018
|
-
onClick: () => onMemberClick?.(member),
|
|
1019
|
-
size
|
|
1020
|
-
}))), members.length > 3 && /* @__PURE__ */ React12.createElement(Popover.Root, null, /* @__PURE__ */ React12.createElement(Popover.Trigger, {
|
|
1021
|
-
className: "grid focus:outline-none"
|
|
1022
|
-
}, /* @__PURE__ */ React12.createElement(Avatar.Root, null, /* @__PURE__ */ React12.createElement(Avatar.Content, {
|
|
1023
|
-
status: "inactive",
|
|
1024
|
-
style: {
|
|
1025
|
-
zIndex: members.length - 4
|
|
1026
|
-
},
|
|
1027
|
-
fallback: `+${members.length - 3}`,
|
|
1028
|
-
size
|
|
1029
|
-
}))), /* @__PURE__ */ React12.createElement(Popover.Portal, null, /* @__PURE__ */ React12.createElement(Popover.Content, {
|
|
1030
|
-
side: "bottom"
|
|
1031
|
-
}, /* @__PURE__ */ React12.createElement(Popover.Arrow, null), /* @__PURE__ */ React12.createElement(Popover.Viewport, {
|
|
1032
|
-
classNames: "max-bs-56"
|
|
1033
|
-
}, /* @__PURE__ */ React12.createElement(List2, null, members.map((member) => /* @__PURE__ */ React12.createElement(ListItem2.Root, {
|
|
1034
|
-
key: member.identity.identityKey.toHex(),
|
|
1035
|
-
classNames: "flex gap-2 items-center cursor-pointer mbe-2",
|
|
1036
|
-
onClick: () => onMemberClick?.(member),
|
|
1037
|
-
"data-testid": "identity-list-item"
|
|
1038
|
-
}, /* @__PURE__ */ React12.createElement(PresenceAvatar, {
|
|
1039
|
-
identity: member.identity,
|
|
1040
|
-
size,
|
|
1041
|
-
showName: true,
|
|
1042
|
-
match: member.currentlyAttended
|
|
1043
|
-
})))))))));
|
|
1044
|
-
};
|
|
1045
|
-
var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match: match2, index, onClick, size }, forwardedRef) => {
|
|
1046
|
-
const status = match2 ? "current" : "active";
|
|
1047
|
-
const fallbackValue = keyToFallback(identity.identityKey);
|
|
1048
|
-
return /* @__PURE__ */ React12.createElement(Avatar.Root, null, /* @__PURE__ */ React12.createElement(Avatar.Content, {
|
|
1049
|
-
status,
|
|
1050
|
-
hue: identity.profile?.data?.hue || fallbackValue.hue,
|
|
1051
|
-
"data-testid": "spacePlugin.presence.member",
|
|
1052
|
-
"data-status": status,
|
|
1053
|
-
size,
|
|
1054
|
-
...index ? {
|
|
1055
|
-
style: {
|
|
1056
|
-
zIndex: index
|
|
1057
|
-
}
|
|
1058
|
-
} : {},
|
|
1059
|
-
onClick,
|
|
1060
|
-
fallback: identity.profile?.data?.emoji || fallbackValue.emoji,
|
|
1061
|
-
ref: forwardedRef
|
|
1062
|
-
}), /* @__PURE__ */ React12.createElement(Avatar.Label, {
|
|
1063
|
-
classNames: showName ? "text-sm truncate pli-2" : "sr-only"
|
|
1064
|
-
}, getName(identity)));
|
|
1065
|
-
});
|
|
1066
|
-
var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
1067
|
-
const { hasAttention, isAncestor, isRelated } = useAttention(id);
|
|
1068
|
-
const isAttended = hasAttention || isAncestor || isRelated;
|
|
1069
|
-
const { graph } = useAppGraph2();
|
|
1070
|
-
const attended = useAttended();
|
|
1071
|
-
const startOfAttention = attended.at(-1);
|
|
1072
|
-
const path = usePath(graph, startOfAttention);
|
|
1073
|
-
const containsAttended = !open && !isAttended && id && Option2.isSome(path) ? path.value.includes(id) : false;
|
|
1074
|
-
const getActiveViewers = (viewers2) => {
|
|
1075
|
-
const moment = Date.now();
|
|
1076
|
-
return Array.from(viewers2.values()).filter((viewer) => moment - viewer.lastSeen < ACTIVITY_DURATION);
|
|
1077
|
-
};
|
|
1078
|
-
const [activeViewers, setActiveViewers] = useState6(viewers ? getActiveViewers(viewers) : []);
|
|
1079
|
-
useEffect3(() => {
|
|
1080
|
-
if (viewers) {
|
|
1081
|
-
setActiveViewers(getActiveViewers(viewers));
|
|
1082
|
-
const interval = setInterval(() => {
|
|
1083
|
-
setActiveViewers(getActiveViewers(viewers));
|
|
1084
|
-
}, REFRESH_INTERVAL);
|
|
1085
|
-
return () => clearInterval(interval);
|
|
1086
|
-
}
|
|
1087
|
-
}, [
|
|
1088
|
-
viewers
|
|
1089
|
-
]);
|
|
1090
|
-
return /* @__PURE__ */ React12.createElement(SmallPresence, {
|
|
1091
|
-
count: activeViewers.length,
|
|
1092
|
-
attended: isAttended,
|
|
1093
|
-
containsAttended
|
|
1094
|
-
});
|
|
1095
|
-
};
|
|
1096
|
-
var SmallPresence = ({ count = 0, attended, containsAttended }) => {
|
|
1097
|
-
const { t } = useTranslation12(meta.id);
|
|
1098
|
-
return /* @__PURE__ */ React12.createElement(Tooltip.Trigger, {
|
|
1099
|
-
asChild: true,
|
|
1100
|
-
content: t("presence label", {
|
|
1101
|
-
count
|
|
1102
|
-
}),
|
|
1103
|
-
side: "bottom"
|
|
1104
|
-
}, /* @__PURE__ */ React12.createElement(AttentionGlyph, {
|
|
1105
|
-
attended,
|
|
1106
|
-
containsAttended,
|
|
1107
|
-
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
1108
|
-
classNames: "self-center mie-1"
|
|
1109
|
-
}));
|
|
1110
|
-
};
|
|
1111
|
-
|
|
1112
|
-
// src/components/SpaceRenamePopover/SpaceRenamePopover.tsx
|
|
1113
|
-
import React13, { useCallback as useCallback9, useRef as useRef4, useState as useState7 } from "react";
|
|
1114
|
-
import { Common as Common6 } from "@dxos/app-framework";
|
|
1115
|
-
import { useOperationInvoker as useOperationInvoker8 } from "@dxos/app-framework/react";
|
|
1116
|
-
import { Obj as Obj7 } from "@dxos/echo";
|
|
1117
|
-
import { Button as Button4, Input as Input4, Popover as Popover2, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
1118
|
-
import { osTranslations as osTranslations4 } from "@dxos/ui-theme";
|
|
1119
|
-
var SPACE_RENAME_POPOVER = `${meta.id}/SpaceRenamePopover`;
|
|
1120
|
-
var SpaceRenamePopover = ({ space }) => {
|
|
1121
|
-
const { t } = useTranslation13(meta.id);
|
|
1122
|
-
const doneButton = useRef4(null);
|
|
1123
|
-
const [name, setName] = useState7(space.properties.name ?? "");
|
|
1124
|
-
const { invokePromise } = useOperationInvoker8();
|
|
1125
|
-
const handleDone = useCallback9(() => {
|
|
1126
|
-
Obj7.change(space.properties, (p) => {
|
|
1127
|
-
p.name = name;
|
|
1128
|
-
});
|
|
1129
|
-
void invokePromise(Common6.LayoutOperation.UpdatePopover, {
|
|
1130
|
-
anchorId: "",
|
|
1131
|
-
state: false
|
|
1132
|
-
});
|
|
1133
|
-
}, [
|
|
1134
|
-
space,
|
|
1135
|
-
name,
|
|
1136
|
-
invokePromise
|
|
1137
|
-
]);
|
|
1138
|
-
return /* @__PURE__ */ React13.createElement("div", {
|
|
1139
|
-
role: "none",
|
|
1140
|
-
className: "p-2 flex gap-2"
|
|
1141
|
-
}, /* @__PURE__ */ React13.createElement("div", {
|
|
1142
|
-
role: "none",
|
|
1143
|
-
className: "flex-1"
|
|
1144
|
-
}, /* @__PURE__ */ React13.createElement(Input4.Root, null, /* @__PURE__ */ React13.createElement(Input4.Label, {
|
|
1145
|
-
srOnly: true
|
|
1146
|
-
}, t("space name label")), /* @__PURE__ */ React13.createElement(Input4.TextInput, {
|
|
1147
|
-
defaultValue: space.properties.name ?? "",
|
|
1148
|
-
placeholder: t("unnamed space label"),
|
|
1149
|
-
onChange: ({ target: { value: value2 } }) => setName(value2),
|
|
1150
|
-
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
1151
|
-
// Currently this is not possible because Radix does not expose the popover context.
|
|
1152
|
-
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1153
|
-
}))), /* @__PURE__ */ React13.createElement(Popover2.Close, {
|
|
1154
|
-
asChild: true
|
|
1155
|
-
}, /* @__PURE__ */ React13.createElement(Button4, {
|
|
1156
|
-
ref: doneButton,
|
|
1157
|
-
classNames: "self-stretch",
|
|
1158
|
-
onClick: handleDone
|
|
1159
|
-
}, t("done label", {
|
|
1160
|
-
ns: osTranslations4
|
|
1161
|
-
}))));
|
|
1162
|
-
};
|
|
1163
|
-
|
|
1164
|
-
// src/components/SpaceSettings/SpaceSettingsContainer.tsx
|
|
1165
|
-
import * as Schema from "effect/Schema";
|
|
1166
|
-
import React14, { forwardRef as forwardRef2, useCallback as useCallback10, useMemo as useMemo4, useState as useState8 } from "react";
|
|
1167
|
-
import { Common as Common7 } from "@dxos/app-framework";
|
|
1168
|
-
import { useCapabilities, useOperationInvoker as useOperationInvoker9 } from "@dxos/app-framework/react";
|
|
1169
|
-
import { Obj as Obj8 } from "@dxos/echo";
|
|
1170
|
-
import { log as log3 } from "@dxos/log";
|
|
1171
|
-
import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1172
|
-
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1173
|
-
import { SpaceState } from "@dxos/react-client/echo";
|
|
1174
|
-
import { Button as Button5, Input as Input5, useFileDownload, useMulticastObservable, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
1175
|
-
import { ControlItem, ControlItemInput as ControlItemInput3, ControlPage as ControlPage4, ControlSection as ControlSection4, Form as Form3 } from "@dxos/react-ui-form";
|
|
1176
|
-
import { Layout as Layout3 } from "@dxos/react-ui-mosaic";
|
|
1177
|
-
import { HuePicker, IconPicker } from "@dxos/react-ui-pickers";
|
|
1178
|
-
var __dxlog_file4 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsContainer.tsx";
|
|
1179
|
-
var SpaceFormSchema = SpaceForm.pipe(Schema.extend(Schema.Struct({
|
|
1180
|
-
archived: Schema.Boolean.annotations({
|
|
1181
|
-
title: "Archive Space"
|
|
1182
|
-
})
|
|
1183
|
-
})));
|
|
1184
|
-
var SpaceSettingsContainer = /* @__PURE__ */ forwardRef2(({ space }, forwardedRef) => {
|
|
1185
|
-
const { t } = useTranslation14(meta.id);
|
|
1186
|
-
const { invokePromise } = useOperationInvoker9();
|
|
1187
|
-
const client = useClient6();
|
|
1188
|
-
const archived = useMulticastObservable(space.state) === SpaceState.SPACE_INACTIVE;
|
|
1189
|
-
const [edgeReplication, setEdgeReplication] = useState8(space.internal.data.edgeReplication === EdgeReplicationSetting.ENABLED);
|
|
1190
|
-
const toggleEdgeReplication = useCallback10(async (next) => {
|
|
1191
|
-
setEdgeReplication(next);
|
|
1192
|
-
await space?.internal.setEdgeReplicationPreference(next ? EdgeReplicationSetting.ENABLED : EdgeReplicationSetting.DISABLED).catch((err) => {
|
|
1193
|
-
log3.catch(err, void 0, {
|
|
1194
|
-
F: __dxlog_file4,
|
|
1195
|
-
L: 58,
|
|
1196
|
-
S: void 0,
|
|
1197
|
-
C: (f, a) => f(...a)
|
|
1198
|
-
});
|
|
1199
|
-
setEdgeReplication(!next);
|
|
1200
|
-
});
|
|
1201
|
-
}, [
|
|
1202
|
-
space
|
|
1203
|
-
]);
|
|
1204
|
-
const handleSave = useCallback10((properties) => {
|
|
1205
|
-
void toggleEdgeReplication(properties.edgeReplication ?? false);
|
|
1206
|
-
const nameChanged = properties.name !== space.properties.name;
|
|
1207
|
-
const iconChanged = properties.icon !== space.properties.icon;
|
|
1208
|
-
const hueChanged = properties.hue !== space.properties.hue;
|
|
1209
|
-
if (nameChanged || iconChanged || hueChanged) {
|
|
1210
|
-
Obj8.change(space.properties, (p) => {
|
|
1211
|
-
if (nameChanged) {
|
|
1212
|
-
p.name = properties.name;
|
|
1213
|
-
}
|
|
1214
|
-
if (iconChanged) {
|
|
1215
|
-
p.icon = properties.icon;
|
|
1216
|
-
}
|
|
1217
|
-
if (hueChanged) {
|
|
1218
|
-
p.hue = properties.hue;
|
|
1219
|
-
}
|
|
1220
|
-
});
|
|
1221
|
-
}
|
|
1222
|
-
if (properties.archived && !archived) {
|
|
1223
|
-
void (async () => {
|
|
1224
|
-
await invokePromise(SpaceOperation.Close, {
|
|
1225
|
-
space
|
|
1226
|
-
});
|
|
1227
|
-
await invokePromise(Common7.LayoutOperation.SwitchWorkspace, {
|
|
1228
|
-
subject: client.spaces.default.id
|
|
1229
|
-
});
|
|
1230
|
-
})();
|
|
1231
|
-
} else if (!properties.archived && archived) {
|
|
1232
|
-
void invokePromise(SpaceOperation.Open, {
|
|
1233
|
-
space
|
|
1234
|
-
});
|
|
1235
|
-
}
|
|
1236
|
-
}, [
|
|
1237
|
-
space,
|
|
1238
|
-
toggleEdgeReplication,
|
|
1239
|
-
archived
|
|
1240
|
-
]);
|
|
1241
|
-
const values = useMemo4(() => ({
|
|
1242
|
-
name: space.properties.name,
|
|
1243
|
-
icon: space.properties.icon,
|
|
1244
|
-
hue: space.properties.hue,
|
|
1245
|
-
edgeReplication,
|
|
1246
|
-
archived
|
|
1247
|
-
}), [
|
|
1248
|
-
space.properties.name,
|
|
1249
|
-
space.properties.icon,
|
|
1250
|
-
space.properties.hue,
|
|
1251
|
-
edgeReplication,
|
|
1252
|
-
archived
|
|
1253
|
-
]);
|
|
1254
|
-
const fieldMap = useMemo4(() => ({
|
|
1255
|
-
name: ({ type, label, getValue, onValueChange }) => {
|
|
1256
|
-
const handleChange = useCallback10(({ target: { value: value2 } }) => onValueChange(type, value2), [
|
|
1257
|
-
onValueChange,
|
|
1258
|
-
type
|
|
1259
|
-
]);
|
|
1260
|
-
return /* @__PURE__ */ React14.createElement(ControlItemInput3, {
|
|
1261
|
-
title: label,
|
|
1262
|
-
description: t("display name description")
|
|
1263
|
-
}, /* @__PURE__ */ React14.createElement(Input5.TextInput, {
|
|
1264
|
-
value: getValue(),
|
|
1265
|
-
onChange: handleChange,
|
|
1266
|
-
placeholder: t("display name input placeholder"),
|
|
1267
|
-
classNames: "min-is-64"
|
|
1268
|
-
}));
|
|
1269
|
-
},
|
|
1270
|
-
icon: ({ type, label, getValue, onValueChange }) => {
|
|
1271
|
-
const handleChange = useCallback10((icon) => onValueChange(type, icon), [
|
|
1272
|
-
onValueChange,
|
|
1273
|
-
type
|
|
1274
|
-
]);
|
|
1275
|
-
const handleReset = useCallback10(() => onValueChange(type, void 0), [
|
|
1276
|
-
onValueChange,
|
|
1277
|
-
type
|
|
1278
|
-
]);
|
|
1279
|
-
return /* @__PURE__ */ React14.createElement(ControlItem, {
|
|
1280
|
-
title: label,
|
|
1281
|
-
description: t("icon description")
|
|
1282
|
-
}, /* @__PURE__ */ React14.createElement(IconPicker, {
|
|
1283
|
-
value: getValue(),
|
|
1284
|
-
onChange: handleChange,
|
|
1285
|
-
onReset: handleReset,
|
|
1286
|
-
classNames: "justify-self-end"
|
|
1287
|
-
}));
|
|
1288
|
-
},
|
|
1289
|
-
hue: ({ type, label, getValue, onValueChange }) => {
|
|
1290
|
-
const handleChange = useCallback10((nextHue) => onValueChange(type, nextHue), [
|
|
1291
|
-
onValueChange,
|
|
1292
|
-
type
|
|
1293
|
-
]);
|
|
1294
|
-
const handleReset = useCallback10(() => onValueChange(type, void 0), [
|
|
1295
|
-
onValueChange,
|
|
1296
|
-
type
|
|
1297
|
-
]);
|
|
1298
|
-
return /* @__PURE__ */ React14.createElement(ControlItem, {
|
|
1299
|
-
title: label,
|
|
1300
|
-
description: t("hue description")
|
|
1301
|
-
}, /* @__PURE__ */ React14.createElement(HuePicker, {
|
|
1302
|
-
value: getValue(),
|
|
1303
|
-
onChange: handleChange,
|
|
1304
|
-
onReset: handleReset,
|
|
1305
|
-
classNames: "justify-self-end"
|
|
1306
|
-
}));
|
|
1307
|
-
},
|
|
1308
|
-
edgeReplication: ({ type, label, getValue, onValueChange }) => {
|
|
1309
|
-
const handleChange = useCallback10((checked) => onValueChange(type, checked), [
|
|
1310
|
-
onValueChange,
|
|
1311
|
-
type
|
|
1312
|
-
]);
|
|
1313
|
-
return /* @__PURE__ */ React14.createElement(ControlItemInput3, {
|
|
1314
|
-
title: label,
|
|
1315
|
-
description: t("edge replication description")
|
|
1316
|
-
}, /* @__PURE__ */ React14.createElement(Input5.Switch, {
|
|
1317
|
-
checked: getValue(),
|
|
1318
|
-
onCheckedChange: handleChange,
|
|
1319
|
-
classNames: "justify-self-end"
|
|
1320
|
-
}));
|
|
1321
|
-
},
|
|
1322
|
-
archived: ({ type, label, getValue, onValueChange }) => {
|
|
1323
|
-
const handleChange = useCallback10(() => onValueChange(type, !getValue()), [
|
|
1324
|
-
onValueChange,
|
|
1325
|
-
type,
|
|
1326
|
-
getValue
|
|
1327
|
-
]);
|
|
1328
|
-
return /* @__PURE__ */ React14.createElement(ControlItemInput3, {
|
|
1329
|
-
title: label,
|
|
1330
|
-
description: t("archive space description")
|
|
1331
|
-
}, /* @__PURE__ */ React14.createElement(Button5, {
|
|
1332
|
-
disabled: space === client.spaces.default,
|
|
1333
|
-
variant: getValue() ? "default" : "destructive",
|
|
1334
|
-
onClick: handleChange
|
|
1335
|
-
}, getValue() ? t("unarchive space label") : t("archive space label")));
|
|
1336
|
-
}
|
|
1337
|
-
}), [
|
|
1338
|
-
t,
|
|
1339
|
-
space
|
|
1340
|
-
]);
|
|
1341
|
-
const download = useFileDownload();
|
|
1342
|
-
const handleBackup = useCallback10(async () => {
|
|
1343
|
-
const archive = await space.internal.export();
|
|
1344
|
-
download(new Blob([
|
|
1345
|
-
archive.contents
|
|
1346
|
-
]), archive.filename);
|
|
1347
|
-
}, [
|
|
1348
|
-
space,
|
|
1349
|
-
download
|
|
1350
|
-
]);
|
|
1351
|
-
const repairs = useCapabilities(SpaceCapabilities.Repair);
|
|
1352
|
-
const handleRepair = useCallback10(async () => {
|
|
1353
|
-
await Promise.all(repairs.map((repair) => repair({
|
|
1354
|
-
space,
|
|
1355
|
-
isDefault: client.spaces.default === space
|
|
1356
|
-
})));
|
|
1357
|
-
}, [
|
|
1358
|
-
client,
|
|
1359
|
-
space,
|
|
1360
|
-
repairs
|
|
1361
|
-
]);
|
|
1362
|
-
return /* @__PURE__ */ React14.createElement(Layout3.Container, {
|
|
1363
|
-
scrollable: true,
|
|
1364
|
-
ref: forwardedRef
|
|
1365
|
-
}, /* @__PURE__ */ React14.createElement(ControlPage4, null, /* @__PURE__ */ React14.createElement(ControlSection4, {
|
|
1366
|
-
title: t("space properties settings verbose label"),
|
|
1367
|
-
description: t("space properties settings description", {
|
|
1368
|
-
ns: meta.id
|
|
1369
|
-
})
|
|
1370
|
-
}, /* @__PURE__ */ React14.createElement(Form3.Root, {
|
|
1371
|
-
fieldMap,
|
|
1372
|
-
schema: SpaceFormSchema,
|
|
1373
|
-
values,
|
|
1374
|
-
autoSave: true,
|
|
1375
|
-
onSave: handleSave
|
|
1376
|
-
}, /* @__PURE__ */ React14.createElement(Form3.FieldSet, null))), /* @__PURE__ */ React14.createElement(ControlSection4, {
|
|
1377
|
-
title: t("space controls title"),
|
|
1378
|
-
description: t("space controls description")
|
|
1379
|
-
}, /* @__PURE__ */ React14.createElement("div", {
|
|
1380
|
-
role: "none",
|
|
1381
|
-
className: "container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
|
|
1382
|
-
}, /* @__PURE__ */ React14.createElement(ControlItemInput3, {
|
|
1383
|
-
title: t("backup space title"),
|
|
1384
|
-
description: t("backup space description")
|
|
1385
|
-
}, /* @__PURE__ */ React14.createElement(Button5, {
|
|
1386
|
-
onClick: handleBackup
|
|
1387
|
-
}, t("download backup label"))), /* @__PURE__ */ React14.createElement(ControlItemInput3, {
|
|
1388
|
-
title: t("repair space title"),
|
|
1389
|
-
description: t("repair space description")
|
|
1390
|
-
}, /* @__PURE__ */ React14.createElement(Button5, {
|
|
1391
|
-
onClick: handleRepair
|
|
1392
|
-
}, t("repair space label")))))));
|
|
1393
|
-
});
|
|
1394
|
-
SpaceSettingsContainer.displayName = "SpaceSettingsContainer";
|
|
1395
|
-
|
|
1396
|
-
// src/components/SyncStatus/InlineSyncStatus.tsx
|
|
1397
|
-
import * as Option3 from "effect/Option";
|
|
1398
|
-
import React15, { useEffect as useEffect4, useState as useState9 } from "react";
|
|
1399
|
-
import { useAppGraph as useAppGraph3 } from "@dxos/app-framework/react";
|
|
1400
|
-
import { EdgeStatus } from "@dxos/protocols/proto/dxos/client/services";
|
|
1401
|
-
import { EdgeReplicationSetting as EdgeReplicationSetting2 } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1402
|
-
import { useClient as useClient7 } from "@dxos/react-client";
|
|
1403
|
-
import { useSpaceSyncState } from "@dxos/react-client/echo";
|
|
1404
|
-
import { Tooltip as Tooltip2, useTranslation as useTranslation15 } from "@dxos/react-ui";
|
|
1405
|
-
import { AttentionGlyph as AttentionGlyph2, useAttended as useAttended2, useAttention as useAttention2 } from "@dxos/react-ui-attention";
|
|
1406
|
-
var useEdgeStatus = () => {
|
|
1407
|
-
const [status, setStatus] = useState9(EdgeStatus.ConnectionState.NOT_CONNECTED);
|
|
1408
|
-
const client = useClient7();
|
|
1409
|
-
useEffect4(() => {
|
|
1410
|
-
client.services.services.EdgeAgentService?.queryEdgeStatus().subscribe(({ status: status2 }) => {
|
|
1411
|
-
setStatus(status2.state);
|
|
1412
|
-
});
|
|
1413
|
-
}, [
|
|
1414
|
-
client
|
|
1415
|
-
]);
|
|
1416
|
-
return status;
|
|
1417
|
-
};
|
|
1418
|
-
var InlineSyncStatus = ({ space, open }) => {
|
|
1419
|
-
const { t } = useTranslation15(meta.id);
|
|
1420
|
-
const id = space.id;
|
|
1421
|
-
const { hasAttention, isAncestor, isRelated } = useAttention2(id);
|
|
1422
|
-
const isAttended = hasAttention || isAncestor || isRelated;
|
|
1423
|
-
const { graph } = useAppGraph3();
|
|
1424
|
-
const attended = useAttended2();
|
|
1425
|
-
const startOfAttention = attended.at(-1);
|
|
1426
|
-
const path = usePath(graph, startOfAttention);
|
|
1427
|
-
const containsAttended = !open && !isAttended && id && Option3.isSome(path) ? path.value.includes(id) : false;
|
|
1428
|
-
const connectedToEdge = useEdgeStatus() === EdgeStatus.ConnectionState.CONNECTED;
|
|
1429
|
-
const edgeSyncEnabled = space.internal.data.edgeReplication === EdgeReplicationSetting2.ENABLED;
|
|
1430
|
-
const syncState = useSpaceSyncState(space);
|
|
1431
|
-
const syncing = connectedToEdge && edgeSyncEnabled && syncState && syncState.missingOnLocal > 0;
|
|
1432
|
-
return /* @__PURE__ */ React15.createElement(Tooltip2.Trigger, {
|
|
1433
|
-
asChild: true,
|
|
1434
|
-
content: t("syncing label"),
|
|
1435
|
-
side: "bottom"
|
|
1436
|
-
}, /* @__PURE__ */ React15.createElement(AttentionGlyph2, {
|
|
1437
|
-
syncing,
|
|
1438
|
-
attended: isAttended,
|
|
1439
|
-
containsAttended,
|
|
1440
|
-
classNames: "self-center mie-1"
|
|
1441
|
-
}));
|
|
1442
|
-
};
|
|
1443
|
-
|
|
1444
|
-
// src/components/SyncStatus/SyncStatus.tsx
|
|
1445
|
-
import React16, { useEffect as useEffect5, useState as useState10 } from "react";
|
|
1446
|
-
import { StatusBar } from "@dxos/plugin-status-bar";
|
|
1447
|
-
import { EdgeStatus as EdgeStatus2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
1448
|
-
import { useClient as useClient8 } from "@dxos/react-client";
|
|
1449
|
-
import { useStream } from "@dxos/react-client/devtools";
|
|
1450
|
-
import { getSyncSummary, useSyncState } from "@dxos/react-client/echo";
|
|
1451
|
-
import { Icon as Icon4, Popover as Popover3, useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
1452
|
-
import { mx } from "@dxos/ui-theme";
|
|
1453
|
-
import { Unit } from "@dxos/util";
|
|
1454
|
-
|
|
1455
|
-
// src/components/SyncStatus/save-tracker.ts
|
|
1456
|
-
import { Context } from "@dxos/context";
|
|
1457
|
-
var __dxlog_file5 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
|
|
1458
|
-
var createClientSaveTracker = (client, cb) => {
|
|
1459
|
-
const CleanupFns = {};
|
|
1460
|
-
const state = {};
|
|
1461
|
-
const install = (spaces) => {
|
|
1462
|
-
for (const space of spaces) {
|
|
1463
|
-
if (state[space.id]) {
|
|
1464
|
-
continue;
|
|
1465
|
-
}
|
|
1466
|
-
state[space.id] = "saved";
|
|
1467
|
-
CleanupFns[space.id] = createSpaceSaveTracker(space, (s) => {
|
|
1468
|
-
state[space.id] = s;
|
|
1469
|
-
cb(Object.values(state).some((s2) => s2 === "saving") ? "saving" : "saved");
|
|
1470
|
-
});
|
|
1471
|
-
}
|
|
1472
|
-
};
|
|
1473
|
-
client.spaces.subscribe((spaces) => {
|
|
1474
|
-
install(spaces);
|
|
1475
|
-
});
|
|
1476
|
-
install(client.spaces.get());
|
|
1477
|
-
return () => {
|
|
1478
|
-
for (const unsubscribe of Object.values(CleanupFns)) {
|
|
1479
|
-
unsubscribe();
|
|
1480
|
-
}
|
|
1481
|
-
};
|
|
1482
|
-
};
|
|
1483
|
-
var createSpaceSaveTracker = (space, cb) => {
|
|
1484
|
-
const ctx = new Context(void 0, {
|
|
1485
|
-
F: __dxlog_file5,
|
|
1486
|
-
L: 40
|
|
1487
|
-
});
|
|
1488
|
-
void space.waitUntilReady().then(() => {
|
|
1489
|
-
if (ctx.disposed) {
|
|
1490
|
-
return;
|
|
1491
|
-
}
|
|
1492
|
-
let hasUnsavedChanges = false;
|
|
1493
|
-
let lastFlushPromise;
|
|
1494
|
-
space.internal.db.saveStateChanged.on(ctx, ({ unsavedDocuments }) => {
|
|
1495
|
-
hasUnsavedChanges = unsavedDocuments.length > 0;
|
|
1496
|
-
});
|
|
1497
|
-
space.internal.db.saveStateChanged.debounce(500).on(ctx, () => {
|
|
1498
|
-
if (hasUnsavedChanges) {
|
|
1499
|
-
lastFlushPromise = void 0;
|
|
1500
|
-
cb("saving");
|
|
1501
|
-
} else {
|
|
1502
|
-
const flushPromise = space.db.flush();
|
|
1503
|
-
lastFlushPromise = flushPromise;
|
|
1504
|
-
void flushPromise.then(() => {
|
|
1505
|
-
if (lastFlushPromise === flushPromise) {
|
|
1506
|
-
cb("saved");
|
|
1507
|
-
}
|
|
1508
|
-
});
|
|
1509
|
-
}
|
|
1510
|
-
});
|
|
1511
|
-
});
|
|
1512
|
-
return () => {
|
|
1513
|
-
void ctx.dispose();
|
|
1514
|
-
};
|
|
1515
|
-
};
|
|
1516
|
-
|
|
1517
|
-
// src/components/SyncStatus/status.ts
|
|
1518
|
-
var getStatus = ({ offline, saved, needsToUpload, needsToDownload }) => {
|
|
1519
|
-
if (!saved) {
|
|
1520
|
-
return "saving locally";
|
|
1521
|
-
} else if (!offline && needsToDownload) {
|
|
1522
|
-
return "downloading";
|
|
1523
|
-
} else if (!offline && needsToUpload) {
|
|
1524
|
-
return "uploading";
|
|
1525
|
-
} else if (offline && !needsToUpload && !needsToDownload) {
|
|
1526
|
-
return "offline persisted";
|
|
1527
|
-
} else {
|
|
1528
|
-
return "remote synced";
|
|
1529
|
-
}
|
|
1530
|
-
};
|
|
1531
|
-
var getIcon = (status) => {
|
|
1532
|
-
switch (status) {
|
|
1533
|
-
case "saving locally":
|
|
1534
|
-
return "ph--download--regular";
|
|
1535
|
-
case "downloading":
|
|
1536
|
-
return "ph--cloud-arrow-down--regular";
|
|
1537
|
-
case "uploading":
|
|
1538
|
-
return "ph--cloud-arrow-up--regular";
|
|
1539
|
-
case "offline persisted":
|
|
1540
|
-
return "ph--check-circle--regular";
|
|
1541
|
-
case "remote synced":
|
|
1542
|
-
return "ph--cloud-check--regular";
|
|
1543
|
-
}
|
|
1544
|
-
};
|
|
1545
|
-
|
|
1546
|
-
// src/components/SyncStatus/SyncStatus.tsx
|
|
1547
|
-
var SYNC_STALLED_TIMEOUT = 5e3;
|
|
1548
|
-
var SyncStatus = () => {
|
|
1549
|
-
const client = useClient8();
|
|
1550
|
-
const state = useSyncState();
|
|
1551
|
-
const [saved, setSaved] = useState10(true);
|
|
1552
|
-
useEffect5(() => createClientSaveTracker(client, (state2) => setSaved(state2 === "saved")), []);
|
|
1553
|
-
return /* @__PURE__ */ React16.createElement(SyncStatusIndicator, {
|
|
1554
|
-
state,
|
|
1555
|
-
saved
|
|
1556
|
-
});
|
|
1557
|
-
};
|
|
1558
|
-
var SyncStatusIndicator = ({ state, saved }) => {
|
|
1559
|
-
const { t } = useTranslation16(meta.id);
|
|
1560
|
-
const summary = getSyncSummary(state);
|
|
1561
|
-
const offline = Object.values(state).length === 0;
|
|
1562
|
-
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
1563
|
-
const needsToDownload = summary.differentDocuments > 0 || summary.missingOnLocal > 0;
|
|
1564
|
-
const status = getStatus({
|
|
1565
|
-
offline,
|
|
1566
|
-
saved,
|
|
1567
|
-
needsToUpload,
|
|
1568
|
-
needsToDownload
|
|
1569
|
-
});
|
|
1570
|
-
const [classNames, setClassNames] = useState10();
|
|
1571
|
-
useEffect5(() => {
|
|
1572
|
-
setClassNames(void 0);
|
|
1573
|
-
if (offline || !needsToUpload && !needsToDownload) {
|
|
1574
|
-
return;
|
|
1575
|
-
}
|
|
1576
|
-
const t2 = setTimeout(() => {
|
|
1577
|
-
setClassNames("text-orange-500");
|
|
1578
|
-
}, SYNC_STALLED_TIMEOUT);
|
|
1579
|
-
return () => clearTimeout(t2);
|
|
1580
|
-
}, [
|
|
1581
|
-
offline,
|
|
1582
|
-
needsToUpload,
|
|
1583
|
-
needsToDownload
|
|
1584
|
-
]);
|
|
1585
|
-
const title = t(`${status} label`);
|
|
1586
|
-
const icon = /* @__PURE__ */ React16.createElement(Icon4, {
|
|
1587
|
-
icon: getIcon(status),
|
|
1588
|
-
classNames
|
|
1589
|
-
});
|
|
1590
|
-
return /* @__PURE__ */ React16.createElement(Popover3.Root, null, /* @__PURE__ */ React16.createElement(Popover3.Trigger, {
|
|
1591
|
-
asChild: true
|
|
1592
|
-
}, /* @__PURE__ */ React16.createElement(StatusBar.Item, {
|
|
1593
|
-
title
|
|
1594
|
-
}, icon)), /* @__PURE__ */ React16.createElement(Popover3.Portal, null, /* @__PURE__ */ React16.createElement(Popover3.Content, null, /* @__PURE__ */ React16.createElement(EdgeConnectionPopover, null), /* @__PURE__ */ React16.createElement(Popover3.Arrow, null))));
|
|
1595
|
-
};
|
|
1596
|
-
var useEdgeStatus2 = () => {
|
|
1597
|
-
const client = useClient8();
|
|
1598
|
-
const { status } = useStream(() => client.services.services.EdgeAgentService.queryEdgeStatus(), {});
|
|
1599
|
-
return status;
|
|
1600
|
-
};
|
|
1601
|
-
var EdgeConnectionPopover = () => {
|
|
1602
|
-
const status = useEdgeStatus2();
|
|
1603
|
-
const { t } = useTranslation16(meta.id);
|
|
1604
|
-
const isConnected = status?.state === EdgeStatus2.ConnectionState.CONNECTED;
|
|
1605
|
-
return /* @__PURE__ */ React16.createElement("div", {
|
|
1606
|
-
className: "min-is-[240px] p-2"
|
|
1607
|
-
}, /* @__PURE__ */ React16.createElement("div", {
|
|
1608
|
-
className: "flex items-center gap-2 mbe-2"
|
|
1609
|
-
}, /* @__PURE__ */ React16.createElement(Icon4, {
|
|
1610
|
-
icon: isConnected ? "ph--check-circle--regular" : "ph--warning-circle--regular",
|
|
1611
|
-
classNames: mx(isConnected ? "text-successText" : "text-errorText animate-pulse")
|
|
1612
|
-
}), /* @__PURE__ */ React16.createElement("span", {
|
|
1613
|
-
className: "font-medium text-sm"
|
|
1614
|
-
}, isConnected ? t("sync edge connected label") : t("sync edge disconnected label"))), status?.state === EdgeStatus2.ConnectionState.NOT_CONNECTED && /* @__PURE__ */ React16.createElement("div", {
|
|
1615
|
-
className: "flex items-center gap-2 text-sm text-description"
|
|
1616
|
-
}, /* @__PURE__ */ React16.createElement(Icon4, {
|
|
1617
|
-
icon: "ph--cloud-x--regular"
|
|
1618
|
-
}), /* @__PURE__ */ React16.createElement("span", null, t("sync no connection label"))), status?.state === EdgeStatus2.ConnectionState.CONNECTED && /* @__PURE__ */ React16.createElement("div", {
|
|
1619
|
-
className: "space-y-2"
|
|
1620
|
-
}, /* @__PURE__ */ React16.createElement("div", {
|
|
1621
|
-
className: "flex items-center justify-between text-sm"
|
|
1622
|
-
}, /* @__PURE__ */ React16.createElement("div", {
|
|
1623
|
-
className: "flex items-center gap-2 text-description"
|
|
1624
|
-
}, /* @__PURE__ */ React16.createElement(Icon4, {
|
|
1625
|
-
icon: "ph--timer--regular"
|
|
1626
|
-
}), /* @__PURE__ */ React16.createElement("span", null, t("sync latency label"))), /* @__PURE__ */ React16.createElement(UnitValue, {
|
|
1627
|
-
value: status.rtt,
|
|
1628
|
-
format: Unit.Millisecond
|
|
1629
|
-
})), /* @__PURE__ */ React16.createElement("div", {
|
|
1630
|
-
className: "flex items-center justify-between text-sm"
|
|
1631
|
-
}, /* @__PURE__ */ React16.createElement("div", {
|
|
1632
|
-
className: "flex items-center gap-2 text-description"
|
|
1633
|
-
}, /* @__PURE__ */ React16.createElement(Icon4, {
|
|
1634
|
-
icon: "ph--arrow-up--regular"
|
|
1635
|
-
}), /* @__PURE__ */ React16.createElement("span", null, t("sync upload label"))), /* @__PURE__ */ React16.createElement(UnitValue, {
|
|
1636
|
-
value: status.rateBytesUp,
|
|
1637
|
-
format: Unit.Kilobyte,
|
|
1638
|
-
suffix: "/s"
|
|
1639
|
-
})), /* @__PURE__ */ React16.createElement("div", {
|
|
1640
|
-
className: "flex items-center justify-between text-sm"
|
|
1641
|
-
}, /* @__PURE__ */ React16.createElement("div", {
|
|
1642
|
-
className: "flex items-center gap-2 text-sm text-description"
|
|
1643
|
-
}, /* @__PURE__ */ React16.createElement(Icon4, {
|
|
1644
|
-
icon: "ph--arrow-down--regular"
|
|
1645
|
-
}), /* @__PURE__ */ React16.createElement("span", null, t("sync download label"))), /* @__PURE__ */ React16.createElement(UnitValue, {
|
|
1646
|
-
value: status.rateBytesDown,
|
|
1647
|
-
format: Unit.Kilobyte,
|
|
1648
|
-
suffix: "/s"
|
|
1649
|
-
}))));
|
|
1650
|
-
};
|
|
1651
|
-
var UnitValue = ({ value: input, format, suffix }) => {
|
|
1652
|
-
const { formattedValue, unit } = format(input);
|
|
1653
|
-
return /* @__PURE__ */ React16.createElement("span", {
|
|
1654
|
-
className: "font-mono"
|
|
1655
|
-
}, formattedValue, /* @__PURE__ */ React16.createElement("span", {
|
|
1656
|
-
className: "mis-1 text-subdued"
|
|
1657
|
-
}, unit.symbol, suffix));
|
|
1658
|
-
};
|
|
1659
|
-
|
|
1660
|
-
// src/helpers/query.ts
|
|
1661
|
-
import * as Array2 from "effect/Array";
|
|
1662
|
-
import * as Effect3 from "effect/Effect";
|
|
1663
|
-
import * as EffectFunction from "effect/Function";
|
|
1664
|
-
import * as Match from "effect/Match";
|
|
1665
|
-
import * as Option4 from "effect/Option";
|
|
1666
|
-
import * as SchemaAST from "effect/SchemaAST";
|
|
1667
|
-
import { DXN, Filter as Filter2, Query } from "@dxos/echo";
|
|
1668
|
-
import { ReferenceAnnotationId, getTypeAnnotation as getTypeAnnotation3, unwrapOptional } from "@dxos/echo/internal";
|
|
1669
|
-
import { runAndForwardErrors as runAndForwardErrors3 } from "@dxos/effect";
|
|
1670
|
-
import { log as log4 } from "@dxos/log";
|
|
1671
|
-
import { Person } from "@dxos/types";
|
|
1672
|
-
var __dxlog_file6 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/helpers/query.ts";
|
|
1673
|
-
var evalQuery = (queryString) => {
|
|
1674
|
-
const globals = {
|
|
1675
|
-
Query,
|
|
1676
|
-
Filter: Filter2,
|
|
1677
|
-
Person
|
|
1678
|
-
};
|
|
1679
|
-
try {
|
|
1680
|
-
return new Function(...Object.keys(globals), `return ${queryString}`)(...Object.values(globals));
|
|
1681
|
-
} catch (err) {
|
|
1682
|
-
log4.catch(err, void 0, {
|
|
1683
|
-
F: __dxlog_file6,
|
|
1684
|
-
L: 33,
|
|
1685
|
-
S: void 0,
|
|
1686
|
-
C: (f, a) => f(...a)
|
|
1687
|
-
});
|
|
1688
|
-
return Query.select(Filter2.nothing());
|
|
1689
|
-
}
|
|
1690
|
-
};
|
|
1691
|
-
var resolveSchemaWithRegistry = (registry, query) => {
|
|
1692
|
-
const resolve = Effect3.fn(function* (dxn) {
|
|
1693
|
-
const typename = DXN.parse(dxn).asTypeDXN()?.type;
|
|
1694
|
-
if (!typename) {
|
|
1695
|
-
return Option4.none();
|
|
1696
|
-
}
|
|
1697
|
-
const query2 = registry.query({
|
|
1698
|
-
typename,
|
|
1699
|
-
location: [
|
|
1700
|
-
"database",
|
|
1701
|
-
"runtime"
|
|
1702
|
-
]
|
|
1703
|
-
});
|
|
1704
|
-
const schemas = yield* Effect3.promise(() => query2.run());
|
|
1705
|
-
return Array2.head(schemas);
|
|
1706
|
-
});
|
|
1707
|
-
return resolveSchema(query, resolve).pipe(Effect3.map((schema) => Option4.getOrUndefined(schema)), runAndForwardErrors3);
|
|
1708
|
-
};
|
|
1709
|
-
var resolveSchema = (query, resolve) => {
|
|
1710
|
-
return Match.value(query).pipe(
|
|
1711
|
-
Match.withReturnType(),
|
|
1712
|
-
// TODO(wittjosiah): Reconcile with filter match?
|
|
1713
|
-
Match.when({
|
|
1714
|
-
type: "select"
|
|
1715
|
-
}, ({ filter }) => typenameFromFilter(filter).pipe(Option4.map((typename) => resolve(typename)), Option4.getOrElse(() => Effect3.succeed(Option4.none())))),
|
|
1716
|
-
Match.when({
|
|
1717
|
-
type: "filter"
|
|
1718
|
-
}, ({ filter }) => typenameFromFilter(filter).pipe(Option4.map((typename) => resolve(typename)), Option4.getOrElse(() => Effect3.succeed(Option4.none())))),
|
|
1719
|
-
Match.when({
|
|
1720
|
-
type: "reference-traversal"
|
|
1721
|
-
}, ({ anchor, property }) => resolveSchema(anchor, resolve).pipe(Effect3.map((base) => base.pipe(Option4.map((schema) => SchemaAST.getPropertySignatures(schema.ast)), Option4.flatMap((properties) => Array2.findFirst(properties, (p) => p.name === property)), Option4.flatMap((property2) => SchemaAST.getAnnotation(ReferenceAnnotationId)(unwrapOptional(property2))), Option4.map((annotation) => annotation.typename))), Effect3.flatMap(Option4.match({
|
|
1722
|
-
onNone: () => Effect3.succeed(Option4.none()),
|
|
1723
|
-
onSome: (typename) => resolve(DXN.fromTypename(typename).toString())
|
|
1724
|
-
})))),
|
|
1725
|
-
Match.when({
|
|
1726
|
-
type: "relation",
|
|
1727
|
-
filter: Match.defined
|
|
1728
|
-
}, ({ filter }) => typenameFromFilter(filter).pipe(Option4.map((typename) => resolve(typename)), Option4.getOrElse(() => Effect3.succeed(Option4.none())))),
|
|
1729
|
-
Match.when({
|
|
1730
|
-
type: "relation-traversal"
|
|
1731
|
-
}, ({ anchor, direction }) => resolveSchema(anchor, resolve).pipe(Effect3.map((base) => base.pipe(Option4.map((schema) => getTypeAnnotation3(schema)), Option4.flatMap((annotation) => Option4.fromNullable(direction === "source" ? annotation?.sourceSchema : annotation?.targetSchema)))), Effect3.flatMap(Option4.match({
|
|
1732
|
-
onNone: () => Effect3.succeed(Option4.none()),
|
|
1733
|
-
onSome: (typename) => resolve(typename)
|
|
1734
|
-
})))),
|
|
1735
|
-
Match.when({
|
|
1736
|
-
type: "options"
|
|
1737
|
-
}, ({ query: query2 }) => resolveSchema(query2, resolve)),
|
|
1738
|
-
Match.orElse((_q) => {
|
|
1739
|
-
return Effect3.succeed(Option4.none());
|
|
1740
|
-
})
|
|
1741
|
-
);
|
|
1742
|
-
};
|
|
1743
|
-
var typenameFromFilter = (filter) => Match.value(filter).pipe(Match.withReturnType(), Match.when({
|
|
1744
|
-
type: "object"
|
|
1745
|
-
}, ({ typename }) => Option4.fromNullable(typename)), Match.when({
|
|
1746
|
-
type: "and"
|
|
1747
|
-
}, ({ filters }) => EffectFunction.pipe(filters, Array2.map(typenameFromFilter), Array2.findFirst(Option4.isSome), Option4.flatten)), Match.when({
|
|
1748
|
-
type: "or"
|
|
1749
|
-
}, ({ filters }) => EffectFunction.pipe(filters, Array2.map(typenameFromFilter), Array2.findFirst(Option4.isSome), Option4.flatten)), Match.orElse(() => Option4.none()));
|
|
1750
|
-
var getQueryTarget = (query, space) => {
|
|
1751
|
-
return Match.value(query).pipe(Match.when({
|
|
1752
|
-
type: "options"
|
|
1753
|
-
}, ({ options }) => {
|
|
1754
|
-
return Option4.fromNullable(options.queues).pipe(Option4.flatMap((queues) => Array2.head(queues)), Option4.flatMap((queueDxn) => Option4.fromNullable(DXN.tryParse(queueDxn))), Option4.flatMap((queueDxn) => Option4.fromNullable(space?.queues.get(queueDxn))), Option4.getOrElse(() => space?.db));
|
|
1755
|
-
}), Match.orElse(() => space?.db));
|
|
1756
|
-
};
|
|
1757
|
-
|
|
1758
|
-
// src/components/ViewEditor.tsx
|
|
1759
|
-
import * as Schema2 from "effect/Schema";
|
|
1760
|
-
import React17, { useCallback as useCallback11, useState as useState11 } from "react";
|
|
1761
|
-
import { useOperationInvoker as useOperationInvoker10 } from "@dxos/app-framework/react";
|
|
1762
|
-
import { DXN as DXN2, Filter as Filter3, Obj as Obj9, Query as Query2, Tag, Type as Type2 } from "@dxos/echo";
|
|
1763
|
-
import { useClient as useClient9 } from "@dxos/react-client";
|
|
1764
|
-
import { getSpace as getSpace2, useQuery as useQuery2 } from "@dxos/react-client/echo";
|
|
1765
|
-
import { useAsyncEffect } from "@dxos/react-ui";
|
|
1766
|
-
import { ViewEditor as NaturalViewEditor } from "@dxos/react-ui-form";
|
|
1767
|
-
import { View } from "@dxos/schema";
|
|
1768
|
-
var ViewEditor = ({ view }) => {
|
|
1769
|
-
const { invokePromise } = useOperationInvoker10();
|
|
1770
|
-
const client = useClient9();
|
|
1771
|
-
const space = getSpace2(view);
|
|
1772
|
-
const [schema, setSchema] = useState11(() => Schema2.Struct({}));
|
|
1773
|
-
const tags = useQuery2(space?.db, Filter3.type(Tag.Tag));
|
|
1774
|
-
const types = useTypeOptions({
|
|
1775
|
-
space,
|
|
1776
|
-
annotation: {
|
|
1777
|
-
location: [
|
|
1778
|
-
"database",
|
|
1779
|
-
"runtime"
|
|
1780
|
-
],
|
|
1781
|
-
kind: [
|
|
1782
|
-
"user"
|
|
1783
|
-
],
|
|
1784
|
-
registered: [
|
|
1785
|
-
"registered"
|
|
1786
|
-
]
|
|
1787
|
-
}
|
|
1788
|
-
});
|
|
1789
|
-
useAsyncEffect(async () => {
|
|
1790
|
-
if (!view?.query || !space) {
|
|
1791
|
-
return;
|
|
1792
|
-
}
|
|
1793
|
-
const foundSchema = await resolveSchemaWithRegistry(space.db.schemaRegistry, view.query.ast);
|
|
1794
|
-
if (foundSchema && foundSchema !== schema) {
|
|
1795
|
-
setSchema(() => foundSchema);
|
|
1796
|
-
}
|
|
1797
|
-
}, [
|
|
1798
|
-
client,
|
|
1799
|
-
space,
|
|
1800
|
-
view,
|
|
1801
|
-
schema
|
|
1802
|
-
]);
|
|
1803
|
-
const handleQueryChanged = useCallback11(async (newQuery, target) => {
|
|
1804
|
-
if (!view || !space) {
|
|
1805
|
-
return;
|
|
1806
|
-
}
|
|
1807
|
-
const queue = target && DXN2.tryParse(target) ? target : void 0;
|
|
1808
|
-
const query = queue ? Query2.fromAst(newQuery).options({
|
|
1809
|
-
queues: [
|
|
1810
|
-
queue
|
|
1811
|
-
]
|
|
1812
|
-
}) : Query2.fromAst(newQuery);
|
|
1813
|
-
Obj9.change(view, (v) => {
|
|
1814
|
-
v.query.ast = query.ast;
|
|
1815
|
-
});
|
|
1816
|
-
const newSchema = await resolveSchemaWithRegistry(space.db.schemaRegistry, query.ast);
|
|
1817
|
-
if (!newSchema) {
|
|
1818
|
-
return;
|
|
1819
|
-
}
|
|
1820
|
-
const newView = View.make({
|
|
1821
|
-
query,
|
|
1822
|
-
jsonSchema: Type2.toJsonSchema(newSchema)
|
|
1823
|
-
});
|
|
1824
|
-
Obj9.change(view, (v) => {
|
|
1825
|
-
v.projection = Obj9.getSnapshot(newView).projection;
|
|
1826
|
-
});
|
|
1827
|
-
setSchema(() => newSchema);
|
|
1828
|
-
}, [
|
|
1829
|
-
view,
|
|
1830
|
-
schema
|
|
1831
|
-
]);
|
|
1832
|
-
const handleDelete = useCallback11((fieldId) => {
|
|
1833
|
-
void invokePromise(SpaceOperation.DeleteField, {
|
|
1834
|
-
view,
|
|
1835
|
-
fieldId
|
|
1836
|
-
});
|
|
1837
|
-
}, [
|
|
1838
|
-
invokePromise,
|
|
1839
|
-
view
|
|
1840
|
-
]);
|
|
1841
|
-
if (!space || !schema) {
|
|
1842
|
-
return null;
|
|
1843
|
-
}
|
|
1844
|
-
return /* @__PURE__ */ React17.createElement(NaturalViewEditor, {
|
|
1845
|
-
registry: space.db.schemaRegistry,
|
|
1846
|
-
schema,
|
|
1847
|
-
view,
|
|
1848
|
-
mode: "tag",
|
|
1849
|
-
tags,
|
|
1850
|
-
types,
|
|
1851
|
-
onQueryChanged: handleQueryChanged,
|
|
1852
|
-
onDelete: Type2.isMutable(schema) ? handleDelete : void 0
|
|
1853
|
-
});
|
|
1854
|
-
};
|
|
1855
|
-
|
|
1856
|
-
// src/components/index.ts
|
|
1857
|
-
import { lazy } from "react";
|
|
1858
|
-
var CollectionArticle = lazy(() => import("./CollectionArticle-XPNA6EHZ.mjs"));
|
|
1859
|
-
var ObjectCardStack = lazy(() => import("./ObjectCardStack-TWHN6C2Y.mjs"));
|
|
1860
|
-
var ObjectDetails = lazy(() => import("./ObjectDetails-GEDIISKK.mjs"));
|
|
1861
|
-
var RecordArticle = lazy(() => import("./RecordArticle-W57QE7QV.mjs"));
|
|
1862
|
-
|
|
1863
|
-
export {
|
|
1864
|
-
AwaitingObject,
|
|
1865
|
-
CREATE_OBJECT_DIALOG,
|
|
1866
|
-
CreateObjectDialog,
|
|
1867
|
-
CREATE_SPACE_DIALOG,
|
|
1868
|
-
CreateSpaceDialog,
|
|
1869
|
-
CollectionSection,
|
|
1870
|
-
JOIN_DIALOG,
|
|
1871
|
-
JoinDialog,
|
|
1872
|
-
MembersContainer,
|
|
1873
|
-
MenuFooter,
|
|
1874
|
-
OBJECT_RENAME_POPOVER,
|
|
1875
|
-
ObjectRenamePopover,
|
|
1876
|
-
SchemaContainer,
|
|
1877
|
-
useQuerySpaceSchemas,
|
|
1878
|
-
SpacePluginSettings,
|
|
1879
|
-
SpacePresence,
|
|
1880
|
-
FullPresence,
|
|
1881
|
-
SmallPresenceLive,
|
|
1882
|
-
SmallPresence,
|
|
1883
|
-
SPACE_RENAME_POPOVER,
|
|
1884
|
-
SpaceRenamePopover,
|
|
1885
|
-
SpaceSettingsContainer,
|
|
1886
|
-
InlineSyncStatus,
|
|
1887
|
-
SyncStatus,
|
|
1888
|
-
SyncStatusIndicator,
|
|
1889
|
-
evalQuery,
|
|
1890
|
-
resolveSchemaWithRegistry,
|
|
1891
|
-
getQueryTarget,
|
|
1892
|
-
ViewEditor,
|
|
1893
|
-
CollectionArticle,
|
|
1894
|
-
ObjectCardStack,
|
|
1895
|
-
ObjectDetails,
|
|
1896
|
-
RecordArticle
|
|
1897
|
-
};
|
|
1898
|
-
//# sourceMappingURL=chunk-3X2EA2OA.mjs.map
|