@dxos/plugin-space 0.8.3 → 0.8.4-main.1da679c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/CollectionMain-D2B75XBS.mjs +31 -0
- package/dist/lib/browser/CollectionMain-D2B75XBS.mjs.map +7 -0
- package/dist/lib/browser/ObjectDetailsPanel-J7KGPJJK.mjs +90 -0
- package/dist/lib/browser/ObjectDetailsPanel-J7KGPJJK.mjs.map +7 -0
- package/dist/lib/browser/RecordMain-TEBGAVSL.mjs +68 -0
- package/dist/lib/browser/RecordMain-TEBGAVSL.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-M2RH72VL.mjs → app-graph-builder-FC4D5PF6.mjs} +190 -36
- package/dist/lib/browser/app-graph-builder-FC4D5PF6.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-F7ISRRBV.mjs → app-graph-serializer-NI4BCIQO.mjs} +15 -15
- package/dist/lib/browser/app-graph-serializer-NI4BCIQO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-YMCZR6EZ.mjs → chunk-CBYL62HG.mjs} +5 -4
- package/dist/lib/browser/chunk-CBYL62HG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-7Y4M7GXO.mjs → chunk-ELJDGQTO.mjs} +6 -6
- package/dist/lib/browser/{chunk-7Y4M7GXO.mjs.map → chunk-ELJDGQTO.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-PTKYMZWO.mjs → chunk-FBCGT5YY.mjs} +2 -2
- package/dist/lib/browser/{chunk-NFUKCRGE.mjs → chunk-IIY4XVBZ.mjs} +440 -376
- package/dist/lib/browser/chunk-IIY4XVBZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-V24VASAJ.mjs → chunk-S33AYKSS.mjs} +189 -34
- package/dist/lib/browser/chunk-S33AYKSS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-BXNL6SDI.mjs → chunk-TUQZO5P4.mjs} +4 -3
- package/dist/lib/browser/chunk-TUQZO5P4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TW7O2EPP.mjs → chunk-URST7EEN.mjs} +68 -8
- package/dist/lib/browser/chunk-URST7EEN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4ZKSFDXM.mjs → chunk-WZYRDFW7.mjs} +76 -14
- package/dist/lib/browser/chunk-WZYRDFW7.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-PI7TKANR.mjs → identity-created-PW2BA46S.mjs} +7 -7
- package/dist/lib/browser/identity-created-PW2BA46S.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +95 -24
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-RWU6ZE4H.mjs → intent-resolver-2RWP2F23.mjs} +183 -28
- package/dist/lib/browser/intent-resolver-2RWP2F23.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-QIKHSNT2.mjs → react-root-QUDHNVV5.mjs} +10 -10
- package/dist/lib/browser/{react-root-QIKHSNT2.mjs.map → react-root-QUDHNVV5.mjs.map} +2 -2
- package/dist/lib/browser/{react-surface-W56UD53I.mjs → react-surface-S47ZR44T.mjs} +59 -27
- package/dist/lib/browser/react-surface-S47ZR44T.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-WREJNMIC.mjs → schema-defs-ATNBAQEU.mjs} +6 -6
- package/dist/lib/browser/schema-defs-ATNBAQEU.mjs.map +7 -0
- package/dist/lib/browser/{settings-K54STC5A.mjs → settings-NTC766QW.mjs} +6 -6
- package/dist/lib/browser/{settings-K54STC5A.mjs.map → settings-NTC766QW.mjs.map} +1 -1
- package/dist/lib/browser/{spaces-ready-3PDRDHPC.mjs → spaces-ready-NX7NRVSB.mjs} +19 -17
- package/dist/lib/browser/spaces-ready-NX7NRVSB.mjs.map +7 -0
- package/dist/lib/browser/{state-HRZ4VRXU.mjs → state-LAGTPHDQ.mjs} +6 -6
- package/dist/lib/browser/state-LAGTPHDQ.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs +32 -0
- package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-7ADOXZ5W.mjs +91 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-7ADOXZ5W.mjs.map +7 -0
- package/dist/lib/node-esm/RecordMain-WLYJMYER.mjs +70 -0
- package/dist/lib/node-esm/RecordMain-WLYJMYER.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-BCHVZ4OM.mjs → app-graph-builder-KREU52XR.mjs} +190 -36
- package/dist/lib/node-esm/app-graph-builder-KREU52XR.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-TXRGGNP2.mjs → app-graph-serializer-L3IXSQ2I.mjs} +15 -15
- package/dist/lib/node-esm/app-graph-serializer-L3IXSQ2I.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3CP67AYY.mjs → chunk-FJZNSJC4.mjs} +5 -4
- package/dist/lib/node-esm/chunk-FJZNSJC4.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-BSLREHIX.mjs → chunk-HC677WUJ.mjs} +4 -3
- package/dist/lib/node-esm/chunk-HC677WUJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-MSWEFAPD.mjs → chunk-HWNG4MEU.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-JBQKU4K5.mjs → chunk-LGNPMOXU.mjs} +76 -14
- package/dist/lib/node-esm/chunk-LGNPMOXU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GH2FGJXH.mjs → chunk-Q6AAQLQG.mjs} +6 -6
- package/dist/lib/node-esm/{chunk-GH2FGJXH.mjs.map → chunk-Q6AAQLQG.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-LA6AVVH6.mjs → chunk-QUPBTNWJ.mjs} +440 -376
- package/dist/lib/node-esm/chunk-QUPBTNWJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-D4QMPPS7.mjs → chunk-RXDT5LA5.mjs} +68 -8
- package/dist/lib/node-esm/chunk-RXDT5LA5.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HO7AIKQS.mjs → chunk-TEUN2E4F.mjs} +189 -34
- package/dist/lib/node-esm/chunk-TEUN2E4F.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-35CTAQWI.mjs → identity-created-MWTLGQRU.mjs} +7 -7
- package/dist/lib/node-esm/identity-created-MWTLGQRU.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +95 -24
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-JO6L2VXC.mjs → intent-resolver-ORRPXJMN.mjs} +183 -28
- package/dist/lib/node-esm/intent-resolver-ORRPXJMN.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-YFGL3B4J.mjs → react-root-2WBNW4VQ.mjs} +10 -10
- package/dist/lib/node-esm/{react-root-YFGL3B4J.mjs.map → react-root-2WBNW4VQ.mjs.map} +2 -2
- package/dist/lib/node-esm/{react-surface-CVAPDLEZ.mjs → react-surface-MI5G3TD6.mjs} +59 -27
- package/dist/lib/node-esm/react-surface-MI5G3TD6.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-4MEJETVX.mjs → schema-defs-7LEPK3R6.mjs} +6 -6
- package/dist/lib/node-esm/schema-defs-7LEPK3R6.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-TD76LTQS.mjs → settings-RWOW2SE5.mjs} +6 -6
- package/dist/lib/node-esm/{settings-TD76LTQS.mjs.map → settings-RWOW2SE5.mjs.map} +1 -1
- package/dist/lib/node-esm/{spaces-ready-FJMGPAVV.mjs → spaces-ready-KD57IOYI.mjs} +19 -17
- package/dist/lib/node-esm/spaces-ready-KD57IOYI.mjs.map +7 -0
- package/dist/lib/node-esm/{state-XQNDCN37.mjs → state-JKO4JKA2.mjs} +6 -6
- package/dist/lib/node-esm/state-JKO4JKA2.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.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-serializer.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +9 -3
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +11 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts +2 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
- package/dist/types/src/components/CollectionMain.d.ts +1 -0
- package/dist/types/src/components/CollectionMain.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +4 -3
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +1584 -3
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +5 -3
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.d.ts +3 -2
- package/dist/types/src/components/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.stories.d.ts +1584 -4
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/ObjectDetailsPanel.d.ts +9 -0
- package/dist/types/src/components/ObjectDetailsPanel.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/PersistenceStatus.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts +1 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
- package/dist/types/src/components/RecordMain.d.ts +7 -0
- package/dist/types/src/components/RecordMain.d.ts.map +1 -0
- package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +1411 -2
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts +1417 -3
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +1418 -4
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/status.d.ts +5 -5
- package/dist/types/src/components/ViewEditor.d.ts +8 -0
- package/dist/types/src/components/ViewEditor.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +14 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -0
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1402 -410
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +82 -22
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +32 -5
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +54 -53
- package/src/SpacePlugin.ts +81 -16
- package/src/capabilities/app-graph-builder.ts +232 -22
- package/src/capabilities/app-graph-serializer.ts +6 -6
- package/src/capabilities/capabilities.ts +9 -3
- package/src/capabilities/identity-created.ts +3 -5
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +136 -15
- package/src/capabilities/react-root.tsx +2 -1
- package/src/capabilities/react-surface.tsx +73 -22
- package/src/capabilities/schema-defs.ts +3 -2
- package/src/capabilities/spaces-ready.ts +10 -7
- package/src/capabilities/state.ts +3 -2
- package/src/components/AwaitingObject.tsx +5 -7
- package/src/components/CollectionMain.tsx +2 -0
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +9 -8
- package/src/components/CreateDialog/CreateObjectDialog.tsx +47 -33
- package/src/components/CreateDialog/CreateObjectPanel.tsx +18 -7
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +1 -1
- package/src/components/JoinDialog.tsx +1 -1
- package/src/components/MembersContainer.stories.tsx +35 -10
- package/src/components/MembersContainer.tsx +13 -13
- package/src/components/MenuFooter.tsx +2 -3
- package/src/components/ObjectDetailsPanel.tsx +79 -0
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +2 -1
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +3 -2
- package/src/components/PersistenceStatus.tsx +5 -6
- package/src/components/PopoverRenameObject.tsx +7 -13
- package/src/components/PopoverRenameSpace.tsx +1 -1
- package/src/components/RecordMain.tsx +43 -0
- package/src/components/SchemaContainer.tsx +2 -2
- package/src/components/SpacePluginSettings.tsx +6 -7
- package/src/components/SpacePresence.stories.tsx +8 -5
- package/src/components/SpacePresence.tsx +7 -7
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +9 -6
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +8 -8
- package/src/components/SyncStatus/SyncStatus.stories.tsx +12 -18
- package/src/components/SyncStatus/SyncStatus.tsx +4 -3
- package/src/components/SyncStatus/save-tracker.ts +3 -3
- package/src/components/SyncStatus/status.ts +4 -4
- package/src/components/ViewEditor.tsx +59 -0
- package/src/components/index.ts +7 -1
- package/src/events.ts +2 -1
- package/src/hooks/useActiveSpace.ts +2 -2
- package/src/hooks/useInputSurfaceLookup.tsx +1 -1
- package/src/translations.ts +74 -9
- package/src/types/types.ts +66 -9
- package/src/util.tsx +177 -33
- package/dist/lib/browser/app-graph-builder-M2RH72VL.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-F7ISRRBV.mjs.map +0 -7
- package/dist/lib/browser/chunk-4ZKSFDXM.mjs.map +0 -7
- package/dist/lib/browser/chunk-BXNL6SDI.mjs.map +0 -7
- package/dist/lib/browser/chunk-NFUKCRGE.mjs.map +0 -7
- package/dist/lib/browser/chunk-TW7O2EPP.mjs.map +0 -7
- package/dist/lib/browser/chunk-V24VASAJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-YMCZR6EZ.mjs.map +0 -7
- package/dist/lib/browser/identity-created-PI7TKANR.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-RWU6ZE4H.mjs.map +0 -7
- package/dist/lib/browser/react-surface-W56UD53I.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-WREJNMIC.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-ILTVSSS3.mjs +0 -124
- package/dist/lib/browser/schema-tools-ILTVSSS3.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-3PDRDHPC.mjs.map +0 -7
- package/dist/lib/browser/state-HRZ4VRXU.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-6LK5HLLE.cjs +0 -364
- package/dist/lib/node/app-graph-builder-6LK5HLLE.cjs.map +0 -7
- package/dist/lib/node/app-graph-serializer-HKHBNHA3.cjs +0 -89
- package/dist/lib/node/app-graph-serializer-HKHBNHA3.cjs.map +0 -7
- package/dist/lib/node/chunk-3X4EA4XL.cjs +0 -37
- package/dist/lib/node/chunk-3X4EA4XL.cjs.map +0 -7
- package/dist/lib/node/chunk-5WLAXYE3.cjs +0 -125
- package/dist/lib/node/chunk-5WLAXYE3.cjs.map +0 -7
- package/dist/lib/node/chunk-6P2DB4QQ.cjs +0 -36
- package/dist/lib/node/chunk-6P2DB4QQ.cjs.map +0 -7
- package/dist/lib/node/chunk-DOC5XEZ4.cjs +0 -184
- package/dist/lib/node/chunk-DOC5XEZ4.cjs.map +0 -7
- package/dist/lib/node/chunk-NCHF433F.cjs +0 -1921
- package/dist/lib/node/chunk-NCHF433F.cjs.map +0 -7
- package/dist/lib/node/chunk-NL5Y4EDX.cjs +0 -38
- package/dist/lib/node/chunk-NL5Y4EDX.cjs.map +0 -7
- package/dist/lib/node/chunk-ULJZPATP.cjs +0 -312
- package/dist/lib/node/chunk-ULJZPATP.cjs.map +0 -7
- package/dist/lib/node/chunk-XHWVT7LW.cjs +0 -572
- package/dist/lib/node/chunk-XHWVT7LW.cjs.map +0 -7
- package/dist/lib/node/identity-created-FF4WZ2WY.cjs +0 -42
- package/dist/lib/node/identity-created-FF4WZ2WY.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -278
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-AV4CMM3Z.cjs +0 -609
- package/dist/lib/node/intent-resolver-AV4CMM3Z.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/react-root-RQUU3A45.cjs +0 -51
- package/dist/lib/node/react-root-RQUU3A45.cjs.map +0 -7
- package/dist/lib/node/react-surface-AZFJLE72.cjs +0 -351
- package/dist/lib/node/react-surface-AZFJLE72.cjs.map +0 -7
- package/dist/lib/node/schema-defs-OB2X2HBH.cjs +0 -42
- package/dist/lib/node/schema-defs-OB2X2HBH.cjs.map +0 -7
- package/dist/lib/node/schema-tools-IYREN4IH.cjs +0 -147
- package/dist/lib/node/schema-tools-IYREN4IH.cjs.map +0 -7
- package/dist/lib/node/settings-P2EQ7VKQ.cjs +0 -38
- package/dist/lib/node/settings-P2EQ7VKQ.cjs.map +0 -7
- package/dist/lib/node/spaces-ready-DXPOHYV7.cjs +0 -210
- package/dist/lib/node/spaces-ready-DXPOHYV7.cjs.map +0 -7
- package/dist/lib/node/state-M35DK75Z.cjs +0 -61
- package/dist/lib/node/state-M35DK75Z.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -48
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-BCHVZ4OM.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-TXRGGNP2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3CP67AYY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BSLREHIX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-D4QMPPS7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HO7AIKQS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JBQKU4K5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LA6AVVH6.mjs.map +0 -7
- package/dist/lib/node-esm/identity-created-35CTAQWI.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-JO6L2VXC.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-CVAPDLEZ.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-4MEJETVX.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-SRLCRZ3B.mjs +0 -126
- package/dist/lib/node-esm/schema-tools-SRLCRZ3B.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-FJMGPAVV.mjs.map +0 -7
- package/dist/lib/node-esm/state-XQNDCN37.mjs.map +0 -7
- package/dist/types/src/capabilities/schema-tool.test.d.ts +0 -2
- package/dist/types/src/capabilities/schema-tool.test.d.ts.map +0 -1
- package/dist/types/src/capabilities/schema-tools.d.ts +0 -13
- package/dist/types/src/capabilities/schema-tools.d.ts.map +0 -1
- package/src/capabilities/schema-tool.test.ts +0 -44
- package/src/capabilities/schema-tools.ts +0 -125
- /package/dist/lib/browser/{chunk-PTKYMZWO.mjs.map → chunk-FBCGT5YY.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-MSWEFAPD.mjs.map → chunk-HWNG4MEU.mjs.map} +0 -0
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useInputSurfaceLookup,
|
|
3
3
|
usePath
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ELJDGQTO.mjs";
|
|
5
5
|
import {
|
|
6
6
|
SpaceCapabilities
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TUQZO5P4.mjs";
|
|
8
8
|
import {
|
|
9
9
|
COMPOSER_SPACE_LOCK,
|
|
10
10
|
getSpaceDisplayName
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-S33AYKSS.mjs";
|
|
12
12
|
import {
|
|
13
13
|
SpaceAction,
|
|
14
14
|
SpaceForm
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-URST7EEN.mjs";
|
|
16
16
|
import {
|
|
17
17
|
SPACE_PLUGIN,
|
|
18
18
|
meta
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-FBCGT5YY.mjs";
|
|
20
20
|
|
|
21
|
-
//
|
|
21
|
+
// src/components/AwaitingObject.tsx
|
|
22
22
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
23
|
-
import { CheckCircle, CircleDashed, CircleNotch } from "@phosphor-icons/react";
|
|
24
23
|
import React, { useCallback, useEffect, useState } from "react";
|
|
25
|
-
import {
|
|
24
|
+
import { LayoutAction, createIntent, useIntentDispatcher, useLayout } from "@dxos/app-framework";
|
|
26
25
|
import { useClient } from "@dxos/react-client";
|
|
27
26
|
import { Filter, fullyQualifiedId, useQuery } from "@dxos/react-client/echo";
|
|
28
|
-
import { Button, Toast, useTranslation } from "@dxos/react-ui";
|
|
29
|
-
import { getSize, mx } from "@dxos/react-ui-theme";
|
|
27
|
+
import { Button, Icon, Toast, useTranslation } from "@dxos/react-ui";
|
|
30
28
|
var WAIT_FOR_OBJECT_TIMEOUT = 18e4;
|
|
31
29
|
var TOAST_TIMEOUT = 24e4;
|
|
32
30
|
var AwaitingObject = ({ id }) => {
|
|
@@ -87,12 +85,16 @@ var AwaitingObject = ({ id }) => {
|
|
|
87
85
|
onOpenChange: setOpen
|
|
88
86
|
}, /* @__PURE__ */ React.createElement(Toast.Body, null, /* @__PURE__ */ React.createElement(Toast.Title, {
|
|
89
87
|
classNames: "flex items-center gap-2"
|
|
90
|
-
}, found ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
88
|
+
}, found ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Icon, {
|
|
89
|
+
icon: "ph--check-circle--regular",
|
|
90
|
+
size: 5
|
|
91
|
+
}), /* @__PURE__ */ React.createElement("span", null, t("found object label"))) : waiting ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Icon, {
|
|
92
|
+
icon: "ph--circle-notch--regular",
|
|
93
|
+
size: 5,
|
|
94
|
+
classNames: "animate-spin"
|
|
95
|
+
}), /* @__PURE__ */ React.createElement("span", null, t("waiting for object label"))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Icon, {
|
|
96
|
+
icon: "ph--circle-dashed--regular",
|
|
97
|
+
size: 5
|
|
96
98
|
}), /* @__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, {
|
|
97
99
|
altText: t("go to object alt"),
|
|
98
100
|
asChild: true
|
|
@@ -117,36 +119,57 @@ var AwaitingObject = ({ id }) => {
|
|
|
117
119
|
}
|
|
118
120
|
};
|
|
119
121
|
|
|
120
|
-
//
|
|
122
|
+
// src/components/CreateDialog/CreateObjectDialog.tsx
|
|
121
123
|
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
122
|
-
import { pipe } from "effect";
|
|
124
|
+
import { Effect, pipe } from "effect";
|
|
123
125
|
import React3, { useCallback as useCallback3, useRef, useState as useState2 } from "react";
|
|
124
126
|
import { Capabilities, LayoutAction as LayoutAction2, chain, createIntent as createIntent2, useCapabilities, useIntentDispatcher as useIntentDispatcher2, usePluginManager } from "@dxos/app-framework";
|
|
125
|
-
import { Query, Type as Type2 } from "@dxos/echo";
|
|
127
|
+
import { Obj, Query, Type as Type2 } from "@dxos/echo";
|
|
126
128
|
import { invariant } from "@dxos/invariant";
|
|
127
129
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
128
130
|
import { getSpace, isLiveObject, isSpace, useQuery as useQuery2, useSpaces } from "@dxos/react-client/echo";
|
|
129
|
-
import { Button as Button2, Dialog, Icon as
|
|
131
|
+
import { Button as Button2, Dialog, Icon as Icon3, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
130
132
|
import { cardDialogContent, cardDialogHeader } from "@dxos/react-ui-stack";
|
|
131
|
-
import { DataType } from "@dxos/schema";
|
|
133
|
+
import { DataType, typenameFromQuery } from "@dxos/schema";
|
|
132
134
|
import { isNonNullable as isNonNullable2 } from "@dxos/util";
|
|
133
135
|
|
|
134
|
-
//
|
|
136
|
+
// src/capabilities/index.ts
|
|
137
|
+
import { lazy } from "@dxos/app-framework";
|
|
138
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-FC4D5PF6.mjs"));
|
|
139
|
+
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-NI4BCIQO.mjs"));
|
|
140
|
+
var IdentityCreated = lazy(() => import("./identity-created-PW2BA46S.mjs"));
|
|
141
|
+
var IntentResolver = lazy(() => import("./intent-resolver-2RWP2F23.mjs"));
|
|
142
|
+
var ReactRoot = lazy(() => import("./react-root-QUDHNVV5.mjs"));
|
|
143
|
+
var ReactSurface = lazy(() => import("./react-surface-S47ZR44T.mjs"));
|
|
144
|
+
var SchemaDefs = lazy(() => import("./schema-defs-ATNBAQEU.mjs"));
|
|
145
|
+
var SpaceSettings = lazy(() => import("./settings-NTC766QW.mjs"));
|
|
146
|
+
var SpaceState = lazy(() => import("./state-LAGTPHDQ.mjs"));
|
|
147
|
+
var SpacesReady = lazy(() => import("./spaces-ready-NX7NRVSB.mjs"));
|
|
148
|
+
|
|
149
|
+
// src/components/CreateDialog/CreateObjectPanel.tsx
|
|
135
150
|
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
151
|
+
import { Option } from "effect";
|
|
136
152
|
import React2, { useCallback as useCallback2 } from "react";
|
|
137
153
|
import { Type } from "@dxos/echo";
|
|
138
|
-
import { getTypeAnnotation } from "@dxos/echo-schema";
|
|
139
|
-
import { Icon, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
154
|
+
import { ViewAnnotation, getTypeAnnotation } from "@dxos/echo-schema";
|
|
155
|
+
import { Icon as Icon2, toLocalizedString, useDefaultValue, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
140
156
|
import { Form } from "@dxos/react-ui-form";
|
|
141
157
|
import { SearchList } from "@dxos/react-ui-searchlist";
|
|
142
158
|
import { cardDialogOverflow, cardDialogPaddedOverflow, cardDialogSearchListRoot } from "@dxos/react-ui-stack";
|
|
143
159
|
import { isNonNullable } from "@dxos/util";
|
|
144
|
-
var CreateObjectPanel = ({ forms, spaces, typename, target,
|
|
160
|
+
var CreateObjectPanel = ({ forms, spaces, typename, target, views, initialFormValues: _initialFormValues, defaultSpaceId, resolve, onTargetChange, onTypenameChange, onCreateObject }) => {
|
|
145
161
|
var _effect = _useSignals2();
|
|
146
162
|
try {
|
|
147
163
|
const { t } = useTranslation2(SPACE_PLUGIN);
|
|
164
|
+
const initialFormValues = useDefaultValue(_initialFormValues, () => ({}));
|
|
148
165
|
const form = forms.find((form2) => Type.getTypename(form2.objectSchema) === typename);
|
|
149
|
-
const options = forms.
|
|
166
|
+
const options = forms.filter((form2) => {
|
|
167
|
+
if (views == null) {
|
|
168
|
+
return true;
|
|
169
|
+
} else {
|
|
170
|
+
return views === ViewAnnotation.get(form2.objectSchema).pipe(Option.getOrElse(() => false));
|
|
171
|
+
}
|
|
172
|
+
}).map((form2) => getTypeAnnotation(form2.objectSchema)).filter(isNonNullable).sort((a, b) => {
|
|
150
173
|
const nameA = t("typename label", {
|
|
151
174
|
ns: a.typename,
|
|
152
175
|
defaultValue: a.typename
|
|
@@ -198,9 +221,7 @@ var CreateObjectPanel = ({ forms, spaces, typename, target, name: initialName, d
|
|
|
198
221
|
className: cardDialogOverflow
|
|
199
222
|
}, /* @__PURE__ */ React2.createElement(Form, {
|
|
200
223
|
autoFocus: true,
|
|
201
|
-
values:
|
|
202
|
-
name: initialName
|
|
203
|
-
},
|
|
224
|
+
values: initialFormValues,
|
|
204
225
|
schema: form.formSchema,
|
|
205
226
|
testId: "create-object-form",
|
|
206
227
|
onSave: handleCreateObject,
|
|
@@ -274,7 +295,7 @@ var SelectSchema = ({ options, resolve, onChange }) => {
|
|
|
274
295
|
classNames: "flex items-center gap-2"
|
|
275
296
|
}, /* @__PURE__ */ React2.createElement("span", {
|
|
276
297
|
className: "flex gap-2 items-center grow truncate"
|
|
277
|
-
}, /* @__PURE__ */ React2.createElement(
|
|
298
|
+
}, /* @__PURE__ */ React2.createElement(Icon2, {
|
|
278
299
|
icon: resolve?.(option.typename).icon ?? "ph--placeholder--regular",
|
|
279
300
|
size: 5
|
|
280
301
|
}), t("typename label", {
|
|
@@ -286,24 +307,10 @@ var SelectSchema = ({ options, resolve, onChange }) => {
|
|
|
286
307
|
}
|
|
287
308
|
};
|
|
288
309
|
|
|
289
|
-
//
|
|
290
|
-
|
|
291
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-M2RH72VL.mjs"));
|
|
292
|
-
var AppGraphSerializer = lazy(() => import("./app-graph-serializer-F7ISRRBV.mjs"));
|
|
293
|
-
var IdentityCreated = lazy(() => import("./identity-created-PI7TKANR.mjs"));
|
|
294
|
-
var IntentResolver = lazy(() => import("./intent-resolver-RWU6ZE4H.mjs"));
|
|
295
|
-
var ReactRoot = lazy(() => import("./react-root-QIKHSNT2.mjs"));
|
|
296
|
-
var ReactSurface = lazy(() => import("./react-surface-W56UD53I.mjs"));
|
|
297
|
-
var SchemaDefs = lazy(() => import("./schema-defs-WREJNMIC.mjs"));
|
|
298
|
-
var SchemaTools = lazy(() => import("./schema-tools-ILTVSSS3.mjs"));
|
|
299
|
-
var SpaceSettings = lazy(() => import("./settings-K54STC5A.mjs"));
|
|
300
|
-
var SpaceState = lazy(() => import("./state-HRZ4VRXU.mjs"));
|
|
301
|
-
var SpacesReady = lazy(() => import("./spaces-ready-3PDRDHPC.mjs"));
|
|
302
|
-
|
|
303
|
-
// packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx
|
|
304
|
-
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx";
|
|
310
|
+
// src/components/CreateDialog/CreateObjectDialog.tsx
|
|
311
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/CreateDialog/CreateObjectDialog.tsx";
|
|
305
312
|
var CREATE_OBJECT_DIALOG = `${SPACE_PLUGIN}/CreateObjectDialog`;
|
|
306
|
-
var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename,
|
|
313
|
+
var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, views, initialFormValues, onCreateObject, shouldNavigate: _shouldNavigate }) => {
|
|
307
314
|
var _effect = _useSignals3();
|
|
308
315
|
try {
|
|
309
316
|
const closeRef = useRef(null);
|
|
@@ -311,17 +318,17 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
|
|
|
311
318
|
const { t } = useTranslation3(SPACE_PLUGIN);
|
|
312
319
|
const client = useClient2();
|
|
313
320
|
const spaces = useSpaces();
|
|
314
|
-
const {
|
|
321
|
+
const { dispatch } = useIntentDispatcher2();
|
|
315
322
|
const forms = useCapabilities(SpaceCapabilities.ObjectForm);
|
|
316
323
|
const [target, setTarget] = useState2(initialTarget);
|
|
317
324
|
const [typename, setTypename] = useState2(initialTypename);
|
|
318
325
|
const space = isSpace(target) ? target : getSpace(target);
|
|
319
326
|
const queryCollections = useQuery2(space, Query.type(DataType.QueryCollection));
|
|
320
|
-
const hiddenTypenames = queryCollections.map((collection) => collection.query
|
|
327
|
+
const hiddenTypenames = queryCollections.map((collection) => typenameFromQuery(collection.query)).filter(isNonNullable2);
|
|
321
328
|
const resolve = useCallback3((typename2) => manager.context.getCapabilities(Capabilities.Metadata).find(({ id }) => id === typename2)?.metadata ?? {}, [
|
|
322
329
|
manager
|
|
323
330
|
]);
|
|
324
|
-
const handleCreateObject = useCallback3(
|
|
331
|
+
const handleCreateObject = useCallback3(({ form, data = {} }) => Effect.gen(function* () {
|
|
325
332
|
if (!target) {
|
|
326
333
|
return;
|
|
327
334
|
}
|
|
@@ -329,18 +336,17 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
|
|
|
329
336
|
const space2 = isSpace(target) ? target : getSpace(target);
|
|
330
337
|
invariant(space2, "Missing space", {
|
|
331
338
|
F: __dxlog_file,
|
|
332
|
-
L:
|
|
333
|
-
S:
|
|
339
|
+
L: 83,
|
|
340
|
+
S: this,
|
|
334
341
|
A: [
|
|
335
342
|
"space",
|
|
336
343
|
"'Missing space'"
|
|
337
344
|
]
|
|
338
345
|
});
|
|
339
|
-
const
|
|
346
|
+
const { object } = yield* dispatch(form.getIntent(data, {
|
|
340
347
|
space: space2
|
|
341
348
|
}));
|
|
342
|
-
|
|
343
|
-
if (isLiveObject(object)) {
|
|
349
|
+
if (isLiveObject(object) && !Obj.instanceOf(DataType.StoredSchema, object)) {
|
|
344
350
|
const hidden = form.hidden || hiddenTypenames.includes(Type2.getTypename(form.objectSchema));
|
|
345
351
|
const addObjectIntent = createIntent2(SpaceAction.AddObject, {
|
|
346
352
|
target,
|
|
@@ -349,14 +355,15 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
|
|
|
349
355
|
});
|
|
350
356
|
const shouldNavigate = _shouldNavigate ?? (() => true);
|
|
351
357
|
if (shouldNavigate(object)) {
|
|
352
|
-
|
|
358
|
+
yield* dispatch(pipe(addObjectIntent, chain(LayoutAction2.Open, {
|
|
353
359
|
part: "main"
|
|
354
360
|
})));
|
|
355
361
|
} else {
|
|
356
|
-
|
|
362
|
+
yield* dispatch(addObjectIntent);
|
|
357
363
|
}
|
|
364
|
+
onCreateObject?.(object);
|
|
358
365
|
}
|
|
359
|
-
}, [
|
|
366
|
+
}).pipe(Effect.runPromise), [
|
|
360
367
|
dispatch,
|
|
361
368
|
target,
|
|
362
369
|
resolve,
|
|
@@ -374,7 +381,7 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
|
|
|
374
381
|
}, /* @__PURE__ */ React3.createElement(Dialog.Title, null, t("create object dialog title", {
|
|
375
382
|
object: t("typename label", {
|
|
376
383
|
ns: typename,
|
|
377
|
-
defaultValue: "Item"
|
|
384
|
+
defaultValue: views ? "View" : "Item"
|
|
378
385
|
})
|
|
379
386
|
})), /* @__PURE__ */ React3.createElement(Dialog.Close, {
|
|
380
387
|
asChild: true
|
|
@@ -383,15 +390,16 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
|
|
|
383
390
|
density: "fine",
|
|
384
391
|
variant: "ghost",
|
|
385
392
|
autoFocus: true
|
|
386
|
-
}, /* @__PURE__ */ React3.createElement(
|
|
393
|
+
}, /* @__PURE__ */ React3.createElement(Icon3, {
|
|
387
394
|
icon: "ph--x--regular",
|
|
388
395
|
size: 4
|
|
389
396
|
})))), /* @__PURE__ */ React3.createElement(CreateObjectPanel, {
|
|
390
397
|
forms,
|
|
391
398
|
spaces,
|
|
392
399
|
target,
|
|
400
|
+
views,
|
|
393
401
|
typename,
|
|
394
|
-
|
|
402
|
+
initialFormValues,
|
|
395
403
|
defaultSpaceId: client.spaces.default.id,
|
|
396
404
|
resolve,
|
|
397
405
|
onTargetChange: setTarget,
|
|
@@ -404,12 +412,12 @@ var CreateObjectDialog = ({ target: initialTarget, typename: initialTypename, na
|
|
|
404
412
|
}
|
|
405
413
|
};
|
|
406
414
|
|
|
407
|
-
//
|
|
415
|
+
// src/components/CreateDialog/CreateSpaceDialog.tsx
|
|
408
416
|
import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
|
|
409
|
-
import { Effect } from "effect";
|
|
417
|
+
import { Effect as Effect2 } from "effect";
|
|
410
418
|
import React4, { useCallback as useCallback4, useRef as useRef2 } from "react";
|
|
411
|
-
import {
|
|
412
|
-
import { Button as Button3, Dialog as Dialog2, Icon as
|
|
419
|
+
import { LayoutAction as LayoutAction3, createIntent as createIntent3, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
420
|
+
import { Button as Button3, Dialog as Dialog2, Icon as Icon4, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
413
421
|
import { Form as Form2 } from "@dxos/react-ui-form";
|
|
414
422
|
import { cardDialogContent as cardDialogContent2, cardDialogHeader as cardDialogHeader2 } from "@dxos/react-ui-stack";
|
|
415
423
|
var CREATE_SPACE_DIALOG = `${SPACE_PLUGIN}/CreateSpaceDialog`;
|
|
@@ -424,7 +432,7 @@ var CreateSpaceDialog = () => {
|
|
|
424
432
|
const { dispatch } = useIntentDispatcher3();
|
|
425
433
|
const inputSurfaceLookup = useInputSurfaceLookup();
|
|
426
434
|
const handleCreateSpace = useCallback4(async (data) => {
|
|
427
|
-
const program =
|
|
435
|
+
const program = Effect2.gen(function* () {
|
|
428
436
|
const { space } = yield* dispatch(createIntent3(SpaceAction.Create, data));
|
|
429
437
|
yield* dispatch(createIntent3(LayoutAction3.SwitchWorkspace, {
|
|
430
438
|
part: "workspace",
|
|
@@ -437,7 +445,7 @@ var CreateSpaceDialog = () => {
|
|
|
437
445
|
}
|
|
438
446
|
}));
|
|
439
447
|
});
|
|
440
|
-
await
|
|
448
|
+
await Effect2.runPromise(program);
|
|
441
449
|
}, [
|
|
442
450
|
dispatch
|
|
443
451
|
]);
|
|
@@ -456,7 +464,7 @@ var CreateSpaceDialog = () => {
|
|
|
456
464
|
density: "fine",
|
|
457
465
|
variant: "ghost",
|
|
458
466
|
autoFocus: true
|
|
459
|
-
}, /* @__PURE__ */ React4.createElement(
|
|
467
|
+
}, /* @__PURE__ */ React4.createElement(Icon4, {
|
|
460
468
|
icon: "ph--x--regular",
|
|
461
469
|
size: 4
|
|
462
470
|
})))), /* @__PURE__ */ React4.createElement("div", {
|
|
@@ -477,39 +485,17 @@ var CreateSpaceDialog = () => {
|
|
|
477
485
|
}
|
|
478
486
|
};
|
|
479
487
|
|
|
480
|
-
//
|
|
488
|
+
// src/components/CollectionSection.tsx
|
|
481
489
|
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
482
490
|
import React5 from "react";
|
|
483
491
|
import { useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
484
|
-
|
|
485
|
-
var CollectionMain = ({ collection }) => {
|
|
492
|
+
var CollectionSection = ({ collection }) => {
|
|
486
493
|
var _effect = _useSignals5();
|
|
487
494
|
try {
|
|
488
495
|
const { t } = useTranslation5(SPACE_PLUGIN);
|
|
489
496
|
return /* @__PURE__ */ React5.createElement("div", {
|
|
490
|
-
role: "none",
|
|
491
|
-
className: mx2(baseSurface, "min-bs-screen is-full flex items-center justify-center p-8"),
|
|
492
|
-
"data-testid": "composer.firstRunMessage"
|
|
493
|
-
}, /* @__PURE__ */ React5.createElement("p", {
|
|
494
|
-
role: "alert",
|
|
495
|
-
className: mx2(descriptionMessage, "rounded-md p-8 font-normal text-lg max-is-[24rem] break-words")
|
|
496
|
-
}, collection.name ?? t("unnamed collection label")));
|
|
497
|
-
} finally {
|
|
498
|
-
_effect.f();
|
|
499
|
-
}
|
|
500
|
-
};
|
|
501
|
-
|
|
502
|
-
// packages/plugins/plugin-space/src/components/CollectionSection.tsx
|
|
503
|
-
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
504
|
-
import React6 from "react";
|
|
505
|
-
import { useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
506
|
-
var CollectionSection = ({ collection }) => {
|
|
507
|
-
var _effect = _useSignals6();
|
|
508
|
-
try {
|
|
509
|
-
const { t } = useTranslation6(SPACE_PLUGIN);
|
|
510
|
-
return /* @__PURE__ */ React6.createElement("div", {
|
|
511
497
|
className: "min-bs-[3.5rem] grid grid-rows-subgrid grid-cols-subgrid items-center"
|
|
512
|
-
}, /* @__PURE__ */
|
|
498
|
+
}, /* @__PURE__ */ React5.createElement("span", {
|
|
513
499
|
className: "truncate"
|
|
514
500
|
}, collection.name ?? t("unnamed collection label")));
|
|
515
501
|
} finally {
|
|
@@ -517,23 +503,23 @@ var CollectionSection = ({ collection }) => {
|
|
|
517
503
|
}
|
|
518
504
|
};
|
|
519
505
|
|
|
520
|
-
//
|
|
521
|
-
import { useSignals as
|
|
522
|
-
import
|
|
523
|
-
import {
|
|
506
|
+
// src/components/JoinDialog.tsx
|
|
507
|
+
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
508
|
+
import React6, { useCallback as useCallback5 } from "react";
|
|
509
|
+
import { LayoutAction as LayoutAction4, createIntent as createIntent4, useAppGraph, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
|
|
524
510
|
import { Trigger } from "@dxos/async";
|
|
525
511
|
import { ObservabilityAction } from "@dxos/plugin-observability/types";
|
|
526
512
|
import { useClient as useClient3 } from "@dxos/react-client";
|
|
527
|
-
import { Dialog as Dialog3, useTranslation as
|
|
513
|
+
import { Dialog as Dialog3, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
528
514
|
import { JoinPanel } from "@dxos/shell/react";
|
|
529
515
|
var JOIN_DIALOG = `${SPACE_PLUGIN}/JoinDialog`;
|
|
530
516
|
var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
531
|
-
var _effect =
|
|
517
|
+
var _effect = _useSignals6();
|
|
532
518
|
try {
|
|
533
519
|
const { dispatchPromise: dispatch } = useIntentDispatcher4();
|
|
534
520
|
const client = useClient3();
|
|
535
521
|
const { graph } = useAppGraph();
|
|
536
|
-
const { t } =
|
|
522
|
+
const { t } = useTranslation6(SPACE_PLUGIN);
|
|
537
523
|
const handleDone = useCallback5(async (result) => {
|
|
538
524
|
const spaceKey = result?.spaceKey;
|
|
539
525
|
if (!spaceKey) {
|
|
@@ -614,16 +600,16 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
614
600
|
client,
|
|
615
601
|
graph
|
|
616
602
|
]);
|
|
617
|
-
return /* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ React6.createElement(Dialog3.Content, null, /* @__PURE__ */ React6.createElement(Dialog3.Title, {
|
|
618
604
|
classNames: "sr-only"
|
|
619
605
|
}, t("join space label", {
|
|
620
606
|
ns: "os"
|
|
621
|
-
})), /* @__PURE__ */
|
|
607
|
+
})), /* @__PURE__ */ React6.createElement(JoinPanel, {
|
|
622
608
|
...props,
|
|
623
|
-
exitActionParent: /* @__PURE__ */
|
|
609
|
+
exitActionParent: /* @__PURE__ */ React6.createElement(Dialog3.Close, {
|
|
624
610
|
asChild: true
|
|
625
611
|
}),
|
|
626
|
-
doneActionParent: /* @__PURE__ */
|
|
612
|
+
doneActionParent: /* @__PURE__ */ React6.createElement(Dialog3.Close, {
|
|
627
613
|
asChild: true
|
|
628
614
|
}),
|
|
629
615
|
onDone: handleDone
|
|
@@ -633,25 +619,22 @@ var JoinDialog = ({ navigableCollections, onDone, ...props }) => {
|
|
|
633
619
|
}
|
|
634
620
|
};
|
|
635
621
|
|
|
636
|
-
//
|
|
637
|
-
import { useSignals as
|
|
638
|
-
import {
|
|
639
|
-
import React8, { useCallback as useCallback6, useMemo, useState as useState3 } from "react";
|
|
622
|
+
// src/components/MembersContainer.tsx
|
|
623
|
+
import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
|
|
624
|
+
import React7, { useCallback as useCallback6, useMemo, useState as useState3 } from "react";
|
|
640
625
|
import { QR } from "react-qr-rounded";
|
|
641
626
|
import { createIntent as createIntent5, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
|
|
642
|
-
import { Type as Type3 } from "@dxos/echo";
|
|
643
627
|
import { log } from "@dxos/log";
|
|
644
628
|
import { useConfig } from "@dxos/react-client";
|
|
645
629
|
import { fullyQualifiedId as fullyQualifiedId2, useSpaceInvitations } from "@dxos/react-client/echo";
|
|
646
630
|
import { Invitation, InvitationEncoder } from "@dxos/react-client/invitations";
|
|
647
|
-
import { Button as Button4, Clipboard, Icon as
|
|
648
|
-
import {
|
|
631
|
+
import { Button as Button4, Clipboard, Icon as Icon5, Input, useId, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
632
|
+
import { ControlFrame, ControlFrameItem, ControlItemInput, ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
649
633
|
import { StackItem } from "@dxos/react-ui-stack";
|
|
650
|
-
import { getSize as getSize2, mx as mx3 } from "@dxos/react-ui-theme";
|
|
651
634
|
import { DataType as DataType2 } from "@dxos/schema";
|
|
652
635
|
import { AuthCode, BifurcatedAction, Centered, Emoji, InvitationList, SpaceMemberList, Viewport } from "@dxos/shell/react";
|
|
653
636
|
import { hexToEmoji } from "@dxos/util";
|
|
654
|
-
var __dxlog_file2 = "/
|
|
637
|
+
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/MembersContainer.tsx";
|
|
655
638
|
var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
656
639
|
var handleInvitationEvent = (invitation, subscription) => {
|
|
657
640
|
const invitationCode = InvitationEncoder.encode(invitation);
|
|
@@ -661,7 +644,7 @@ var handleInvitationEvent = (invitation, subscription) => {
|
|
|
661
644
|
authCode: invitation.authCode
|
|
662
645
|
}), void 0, {
|
|
663
646
|
F: __dxlog_file2,
|
|
664
|
-
L:
|
|
647
|
+
L: 39,
|
|
665
648
|
S: void 0,
|
|
666
649
|
C: (f, a) => f(...a)
|
|
667
650
|
});
|
|
@@ -669,9 +652,9 @@ var handleInvitationEvent = (invitation, subscription) => {
|
|
|
669
652
|
}
|
|
670
653
|
};
|
|
671
654
|
var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
672
|
-
var _effect =
|
|
655
|
+
var _effect = _useSignals7();
|
|
673
656
|
try {
|
|
674
|
-
const { t } =
|
|
657
|
+
const { t } = useTranslation7(SPACE_PLUGIN);
|
|
675
658
|
const config = useConfig();
|
|
676
659
|
const { dispatchPromise: dispatch } = useIntentDispatcher5();
|
|
677
660
|
const invitations = useSpaceInvitations(space.key);
|
|
@@ -683,7 +666,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
683
666
|
setInternalActiveAction(nextAction);
|
|
684
667
|
localStorage.setItem(activeActionKey, nextAction);
|
|
685
668
|
};
|
|
686
|
-
const target = space.properties[
|
|
669
|
+
const target = space.properties[DataType2.Collection.typename]?.target?.objects[0]?.target;
|
|
687
670
|
const locked = space.properties[COMPOSER_SPACE_LOCK];
|
|
688
671
|
const handleChangeLocked = useCallback6(() => {
|
|
689
672
|
space.properties[COMPOSER_SPACE_LOCK] = !locked;
|
|
@@ -699,7 +682,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
699
682
|
description: t("invite one description", {
|
|
700
683
|
ns: "os"
|
|
701
684
|
}),
|
|
702
|
-
icon: () => /* @__PURE__ */
|
|
685
|
+
icon: () => /* @__PURE__ */ React7.createElement(Icon5, {
|
|
703
686
|
icon: "ph--user-plus--regular",
|
|
704
687
|
size: 5
|
|
705
688
|
}),
|
|
@@ -724,7 +707,7 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
724
707
|
description: t("invite many description", {
|
|
725
708
|
ns: "os"
|
|
726
709
|
}),
|
|
727
|
-
icon: () => /* @__PURE__ */
|
|
710
|
+
icon: () => /* @__PURE__ */ React7.createElement(Icon5, {
|
|
728
711
|
icon: "ph--users-three--regular",
|
|
729
712
|
size: 5
|
|
730
713
|
}),
|
|
@@ -754,44 +737,44 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
754
737
|
const handleBack = () => {
|
|
755
738
|
setSelectedInvitation(null);
|
|
756
739
|
};
|
|
757
|
-
return /* @__PURE__ */
|
|
740
|
+
return /* @__PURE__ */ React7.createElement(Clipboard.Provider, null, /* @__PURE__ */ React7.createElement(StackItem.Content, {
|
|
758
741
|
classNames: "block overflow-y-auto"
|
|
759
|
-
}, /* @__PURE__ */
|
|
742
|
+
}, /* @__PURE__ */ React7.createElement(ControlPage, null, /* @__PURE__ */ React7.createElement(ControlSection, {
|
|
760
743
|
title: t("members verbose label"),
|
|
761
744
|
description: t("members description")
|
|
762
|
-
}, /* @__PURE__ */
|
|
745
|
+
}, /* @__PURE__ */ React7.createElement(ControlFrame, null, /* @__PURE__ */ React7.createElement(ControlFrameItem, {
|
|
763
746
|
title: t("members label")
|
|
764
|
-
}, /* @__PURE__ */
|
|
747
|
+
}, /* @__PURE__ */ React7.createElement(SpaceMemberList, {
|
|
765
748
|
spaceKey: space.key,
|
|
766
749
|
includeSelf: true
|
|
767
|
-
})), locked && /* @__PURE__ */
|
|
750
|
+
})), locked && /* @__PURE__ */ React7.createElement(ControlFrameItem, {
|
|
768
751
|
title: t("invitations label")
|
|
769
|
-
}, /* @__PURE__ */
|
|
752
|
+
}, /* @__PURE__ */ React7.createElement("p", {
|
|
770
753
|
className: "text-description mbe-2"
|
|
771
|
-
}, t("locked space description"))), !locked && /* @__PURE__ */
|
|
754
|
+
}, t("locked space description"))), !locked && /* @__PURE__ */ React7.createElement(ControlFrameItem, {
|
|
772
755
|
title: t("invitations label")
|
|
773
|
-
}, selectedInvitation && /* @__PURE__ */
|
|
756
|
+
}, selectedInvitation && /* @__PURE__ */ React7.createElement(InvitationSection, {
|
|
774
757
|
...selectedInvitation,
|
|
775
758
|
onBack: handleBack
|
|
776
|
-
}), !selectedInvitation && /* @__PURE__ */
|
|
759
|
+
}), !selectedInvitation && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("p", {
|
|
777
760
|
className: "text-description mbe-2"
|
|
778
|
-
}, t("space invitation description")), /* @__PURE__ */
|
|
761
|
+
}, t("space invitation description")), /* @__PURE__ */ React7.createElement(InvitationList, {
|
|
779
762
|
className: "mb-2",
|
|
780
763
|
send: handleSend,
|
|
781
764
|
invitations: visibleInvitations ?? [],
|
|
782
765
|
onClickRemove: (invitation) => invitation.cancel(),
|
|
783
766
|
createInvitationUrl
|
|
784
|
-
}), /* @__PURE__ */
|
|
767
|
+
}), /* @__PURE__ */ React7.createElement(BifurcatedAction, {
|
|
785
768
|
actions: inviteActions,
|
|
786
769
|
activeAction,
|
|
787
770
|
onChangeActiveAction: setActiveAction,
|
|
788
771
|
"data-testid": "membersContainer.createInvitation"
|
|
789
|
-
})))), /* @__PURE__ */
|
|
790
|
-
className: "justify-center
|
|
791
|
-
}, /* @__PURE__ */
|
|
772
|
+
})))), /* @__PURE__ */ React7.createElement("div", {
|
|
773
|
+
className: "justify-center p-0 mbs-4 container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
|
|
774
|
+
}, /* @__PURE__ */ React7.createElement(ControlItemInput, {
|
|
792
775
|
title: t("space locked label"),
|
|
793
776
|
description: t("space locked description")
|
|
794
|
-
}, /* @__PURE__ */
|
|
777
|
+
}, /* @__PURE__ */ React7.createElement(Input.Switch, {
|
|
795
778
|
checked: locked,
|
|
796
779
|
onCheckedChange: handleChangeLocked,
|
|
797
780
|
classNames: "justify-self-end"
|
|
@@ -801,26 +784,26 @@ var MembersContainer = ({ space, createInvitationUrl }) => {
|
|
|
801
784
|
}
|
|
802
785
|
};
|
|
803
786
|
var InvitationSection = ({ state = Invitation.State.INIT, authCode, invitationId = "never", url = "never", onBack }) => {
|
|
804
|
-
var _effect =
|
|
787
|
+
var _effect = _useSignals7();
|
|
805
788
|
try {
|
|
806
789
|
const activeView = state < 0 ? "init" : state >= Invitation.State.CANCELLED ? "complete" : state >= Invitation.State.READY_FOR_AUTHENTICATION && authCode ? "auth-code" : "qr-code";
|
|
807
|
-
return /* @__PURE__ */
|
|
790
|
+
return /* @__PURE__ */ React7.createElement(Viewport.Root, {
|
|
808
791
|
activeView
|
|
809
|
-
}, /* @__PURE__ */
|
|
792
|
+
}, /* @__PURE__ */ React7.createElement(Viewport.Views, null, /* @__PURE__ */ React7.createElement(Viewport.View, {
|
|
810
793
|
id: "init"
|
|
811
|
-
}), /* @__PURE__ */
|
|
794
|
+
}), /* @__PURE__ */ React7.createElement(Viewport.View, {
|
|
812
795
|
id: "complete"
|
|
813
|
-
}, /* @__PURE__ */
|
|
796
|
+
}, /* @__PURE__ */ React7.createElement(InvitationComplete, {
|
|
814
797
|
statusValue: state
|
|
815
|
-
})), /* @__PURE__ */
|
|
798
|
+
})), /* @__PURE__ */ React7.createElement(Viewport.View, {
|
|
816
799
|
id: "auth-code"
|
|
817
|
-
}, /* @__PURE__ */
|
|
800
|
+
}, /* @__PURE__ */ React7.createElement(InvitationAuthCode, {
|
|
818
801
|
id: invitationId,
|
|
819
802
|
code: authCode ?? "never",
|
|
820
803
|
onCancel: onBack
|
|
821
|
-
})), /* @__PURE__ */
|
|
804
|
+
})), /* @__PURE__ */ React7.createElement(Viewport.View, {
|
|
822
805
|
id: "qr-code"
|
|
823
|
-
}, /* @__PURE__ */
|
|
806
|
+
}, /* @__PURE__ */ React7.createElement(InvitationQR, {
|
|
824
807
|
id: invitationId,
|
|
825
808
|
url,
|
|
826
809
|
onCancel: onBack
|
|
@@ -830,36 +813,36 @@ var InvitationSection = ({ state = Invitation.State.INIT, authCode, invitationId
|
|
|
830
813
|
}
|
|
831
814
|
};
|
|
832
815
|
var InvitationQR = ({ id, url, onCancel }) => {
|
|
833
|
-
var _effect =
|
|
816
|
+
var _effect = _useSignals7();
|
|
834
817
|
try {
|
|
835
|
-
const { t } =
|
|
818
|
+
const { t } = useTranslation7("os");
|
|
836
819
|
const qrLabel = useId("members-container__qr-code");
|
|
837
820
|
const emoji = hexToEmoji(id);
|
|
838
|
-
return /* @__PURE__ */
|
|
821
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("p", {
|
|
839
822
|
className: "text-description"
|
|
840
823
|
}, t("qr code description", {
|
|
841
824
|
ns: SPACE_PLUGIN
|
|
842
|
-
})), /* @__PURE__ */
|
|
825
|
+
})), /* @__PURE__ */ React7.createElement("div", {
|
|
843
826
|
role: "group",
|
|
844
827
|
className: "grid grid-cols-[1fr_min-content] mlb-2 gap-2"
|
|
845
|
-
}, /* @__PURE__ */
|
|
828
|
+
}, /* @__PURE__ */ React7.createElement("div", {
|
|
846
829
|
role: "none",
|
|
847
830
|
className: "is-full aspect-square relative text-description"
|
|
848
|
-
}, /* @__PURE__ */
|
|
831
|
+
}, /* @__PURE__ */ React7.createElement(QR, {
|
|
849
832
|
rounding: 100,
|
|
850
833
|
backgroundColor: "transparent",
|
|
851
834
|
color: "currentColor",
|
|
852
835
|
"aria-labelledby": qrLabel,
|
|
853
836
|
errorCorrectionLevel: "Q",
|
|
854
837
|
cutout: true
|
|
855
|
-
}, url ?? "never"), /* @__PURE__ */
|
|
838
|
+
}, url ?? "never"), /* @__PURE__ */ React7.createElement(Centered, null, /* @__PURE__ */ React7.createElement(Emoji, {
|
|
856
839
|
text: emoji
|
|
857
|
-
}))), /* @__PURE__ */
|
|
840
|
+
}))), /* @__PURE__ */ React7.createElement("span", {
|
|
858
841
|
id: qrLabel,
|
|
859
842
|
className: "sr-only"
|
|
860
|
-
}, t("qr label")), /* @__PURE__ */
|
|
843
|
+
}, t("qr label")), /* @__PURE__ */ React7.createElement(Clipboard.Button, {
|
|
861
844
|
value: url ?? "never"
|
|
862
|
-
})), /* @__PURE__ */
|
|
845
|
+
})), /* @__PURE__ */ React7.createElement(Button4, {
|
|
863
846
|
variant: "ghost",
|
|
864
847
|
onClick: onCancel
|
|
865
848
|
}, t("cancel label")));
|
|
@@ -868,22 +851,22 @@ var InvitationQR = ({ id, url, onCancel }) => {
|
|
|
868
851
|
}
|
|
869
852
|
};
|
|
870
853
|
var InvitationAuthCode = ({ id, code, onCancel }) => {
|
|
871
|
-
var _effect =
|
|
854
|
+
var _effect = _useSignals7();
|
|
872
855
|
try {
|
|
873
|
-
const { t } =
|
|
856
|
+
const { t } = useTranslation7("os");
|
|
874
857
|
const emoji = hexToEmoji(id);
|
|
875
|
-
return /* @__PURE__ */
|
|
858
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("p", {
|
|
876
859
|
className: "text-description"
|
|
877
|
-
}, t("auth other device emoji message")), emoji && /* @__PURE__ */
|
|
860
|
+
}, t("auth other device emoji message")), emoji && /* @__PURE__ */ React7.createElement(Emoji, {
|
|
878
861
|
text: emoji,
|
|
879
862
|
className: "mli-auto mlb-2 text-center"
|
|
880
|
-
}), /* @__PURE__ */
|
|
863
|
+
}), /* @__PURE__ */ React7.createElement("p", {
|
|
881
864
|
className: "text-description"
|
|
882
|
-
}, t("auth code message")), /* @__PURE__ */
|
|
865
|
+
}, t("auth code message")), /* @__PURE__ */ React7.createElement(AuthCode, {
|
|
883
866
|
code,
|
|
884
867
|
large: true,
|
|
885
868
|
classNames: "mli-auto mlb-2 text-center grow"
|
|
886
|
-
}), /* @__PURE__ */
|
|
869
|
+
}), /* @__PURE__ */ React7.createElement(Button4, {
|
|
887
870
|
variant: "ghost",
|
|
888
871
|
onClick: onCancel
|
|
889
872
|
}, t("cancel label")));
|
|
@@ -892,65 +875,69 @@ var InvitationAuthCode = ({ id, code, onCancel }) => {
|
|
|
892
875
|
}
|
|
893
876
|
};
|
|
894
877
|
var InvitationComplete = ({ statusValue }) => {
|
|
895
|
-
var _effect =
|
|
878
|
+
var _effect = _useSignals7();
|
|
896
879
|
try {
|
|
897
|
-
return statusValue > 0 ? /* @__PURE__ */
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
880
|
+
return statusValue > 0 ? /* @__PURE__ */ React7.createElement(Icon5, {
|
|
881
|
+
icon: "ph--check--regular",
|
|
882
|
+
size: 6,
|
|
883
|
+
classNames: "m-1.5"
|
|
884
|
+
}) : /* @__PURE__ */ React7.createElement(Icon5, {
|
|
885
|
+
icon: "ph--x--regular",
|
|
886
|
+
size: 6,
|
|
887
|
+
classNames: "m-1.5"
|
|
901
888
|
});
|
|
902
889
|
} finally {
|
|
903
890
|
_effect.f();
|
|
904
891
|
}
|
|
905
892
|
};
|
|
906
893
|
|
|
907
|
-
//
|
|
908
|
-
import { useSignals as
|
|
909
|
-
import
|
|
910
|
-
import React9 from "react";
|
|
894
|
+
// src/components/MenuFooter.tsx
|
|
895
|
+
import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
|
|
896
|
+
import React8 from "react";
|
|
911
897
|
import { getSpace as getSpace2 } from "@dxos/client/echo";
|
|
912
898
|
import { useClient as useClient4 } from "@dxos/react-client";
|
|
913
|
-
import { DropdownMenu, toLocalizedString as toLocalizedString2, useTranslation as
|
|
899
|
+
import { DropdownMenu, Icon as Icon6, toLocalizedString as toLocalizedString2, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
914
900
|
var MenuFooter = ({ object }) => {
|
|
915
|
-
var _effect =
|
|
901
|
+
var _effect = _useSignals8();
|
|
916
902
|
try {
|
|
917
|
-
const { t } =
|
|
903
|
+
const { t } = useTranslation8(SPACE_PLUGIN);
|
|
918
904
|
const client = useClient4();
|
|
919
905
|
const space = getSpace2(object);
|
|
920
906
|
const spaceName = space ? getSpaceDisplayName(space, {
|
|
921
907
|
personal: client.spaces.default === space
|
|
922
908
|
}) : "";
|
|
923
|
-
return space ? /* @__PURE__ */
|
|
909
|
+
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", {
|
|
924
910
|
className: "pis-2 mbe-2 text-xs grid grid-cols-[max-content_1fr] gap-2"
|
|
925
|
-
}, /* @__PURE__ */
|
|
911
|
+
}, /* @__PURE__ */ React8.createElement("dt", {
|
|
926
912
|
className: "uppercase text-[.75em] tracking-wide font-medium mbs-px self-start"
|
|
927
|
-
}, t("location label")), /* @__PURE__ */
|
|
913
|
+
}, t("location label")), /* @__PURE__ */ React8.createElement("dd", {
|
|
928
914
|
className: "line-clamp-3"
|
|
929
|
-
}, /* @__PURE__ */
|
|
930
|
-
|
|
915
|
+
}, /* @__PURE__ */ React8.createElement(Icon6, {
|
|
916
|
+
icon: "ph--planet--regular",
|
|
917
|
+
classNames: "inline-block mie-1"
|
|
931
918
|
}), toLocalizedString2(spaceName, t)))) : null;
|
|
932
919
|
} finally {
|
|
933
920
|
_effect.f();
|
|
934
921
|
}
|
|
935
922
|
};
|
|
936
923
|
|
|
937
|
-
//
|
|
938
|
-
import { useSignals as
|
|
939
|
-
import
|
|
924
|
+
// src/components/ObjectSettings/ObjectSettingsContainer.tsx
|
|
925
|
+
import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
|
|
926
|
+
import React10, { useMemo as useMemo2 } from "react";
|
|
940
927
|
import { Surface } from "@dxos/app-framework";
|
|
941
|
-
import { Clipboard as Clipboard2 } from "@dxos/react-ui";
|
|
928
|
+
import { Clipboard as Clipboard2, Toolbar } from "@dxos/react-ui";
|
|
942
929
|
import { StackItem as StackItem2 } from "@dxos/react-ui-stack";
|
|
943
930
|
|
|
944
|
-
//
|
|
945
|
-
import { useSignals as
|
|
946
|
-
import
|
|
947
|
-
import { Input as Input2, useTranslation as
|
|
931
|
+
// src/components/ObjectSettings/BaseObjectSettings.tsx
|
|
932
|
+
import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
|
|
933
|
+
import React9, { useRef as useRef3 } from "react";
|
|
934
|
+
import { Input as Input2, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
948
935
|
var BaseObjectSettings = ({ classNames, children, object }) => {
|
|
949
|
-
var _effect =
|
|
936
|
+
var _effect = _useSignals9();
|
|
950
937
|
try {
|
|
951
|
-
const { t } =
|
|
938
|
+
const { t } = useTranslation9(meta.id);
|
|
952
939
|
const inputRef = useRef3(null);
|
|
953
|
-
return /* @__PURE__ */
|
|
940
|
+
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(Input2.Root, null, /* @__PURE__ */ React9.createElement(Input2.Label, null, t("name label")), /* @__PURE__ */ React9.createElement(Input2.TextInput, {
|
|
954
941
|
ref: inputRef,
|
|
955
942
|
placeholder: t("name placeholder"),
|
|
956
943
|
// TODO(burdon): Use annotation to get the name field.
|
|
@@ -969,26 +956,26 @@ var BaseObjectSettings = ({ classNames, children, object }) => {
|
|
|
969
956
|
}
|
|
970
957
|
};
|
|
971
958
|
|
|
972
|
-
//
|
|
959
|
+
// src/components/ObjectSettings/ObjectSettingsContainer.tsx
|
|
973
960
|
var ObjectSettingsContainer = ({ object, role }) => {
|
|
974
|
-
var _effect =
|
|
961
|
+
var _effect = _useSignals10();
|
|
975
962
|
try {
|
|
976
963
|
const data = useMemo2(() => ({
|
|
977
964
|
subject: object
|
|
978
965
|
}), [
|
|
979
966
|
object
|
|
980
967
|
]);
|
|
981
|
-
return /* @__PURE__ */
|
|
982
|
-
toolbar:
|
|
983
|
-
}, /* @__PURE__ */
|
|
968
|
+
return /* @__PURE__ */ React10.createElement(Clipboard2.Provider, null, /* @__PURE__ */ React10.createElement(StackItem2.Content, {
|
|
969
|
+
toolbar: true
|
|
970
|
+
}, /* @__PURE__ */ React10.createElement(Toolbar.Root, null), /* @__PURE__ */ React10.createElement("div", {
|
|
984
971
|
role: "none",
|
|
985
972
|
className: "overflow-y-auto pli-cardSpacingInline plb-cardSpacingBlock"
|
|
986
|
-
}, /* @__PURE__ */
|
|
973
|
+
}, /* @__PURE__ */ React10.createElement(BaseObjectSettings, {
|
|
987
974
|
object
|
|
988
|
-
}, /* @__PURE__ */
|
|
975
|
+
}, /* @__PURE__ */ React10.createElement(Surface, {
|
|
989
976
|
role: "base-object-settings",
|
|
990
977
|
data
|
|
991
|
-
})), /* @__PURE__ */
|
|
978
|
+
})), /* @__PURE__ */ React10.createElement(Surface, {
|
|
992
979
|
role: "object-settings",
|
|
993
980
|
data
|
|
994
981
|
}))));
|
|
@@ -997,17 +984,16 @@ var ObjectSettingsContainer = ({ object, role }) => {
|
|
|
997
984
|
}
|
|
998
985
|
};
|
|
999
986
|
|
|
1000
|
-
//
|
|
1001
|
-
import { useSignals as
|
|
1002
|
-
import {
|
|
1003
|
-
import React12, { useEffect as useEffect2, useState as useState4 } from "react";
|
|
987
|
+
// src/components/PersistenceStatus.tsx
|
|
988
|
+
import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
|
|
989
|
+
import React11, { useEffect as useEffect2, useState as useState4 } from "react";
|
|
1004
990
|
import { debounce } from "@dxos/async";
|
|
1005
|
-
import { Tooltip, useTranslation as
|
|
1006
|
-
import {
|
|
991
|
+
import { Icon as Icon7, Tooltip, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
992
|
+
import { mx, staticPlaceholderText, warningText } from "@dxos/react-ui-theme";
|
|
1007
993
|
var PersistenceStatus = ({ db }) => {
|
|
1008
|
-
var _effect =
|
|
994
|
+
var _effect = _useSignals11();
|
|
1009
995
|
try {
|
|
1010
|
-
const { t } =
|
|
996
|
+
const { t } = useTranslation10(SPACE_PLUGIN);
|
|
1011
997
|
const [displayMessage, setDisplayMessage] = useState4(false);
|
|
1012
998
|
const [status, naturalSetStatus] = useState4(0);
|
|
1013
999
|
const [prevStatus, setPrevStatus] = useState4(0);
|
|
@@ -1024,32 +1010,38 @@ var PersistenceStatus = ({ db }) => {
|
|
|
1024
1010
|
]);
|
|
1025
1011
|
switch (status) {
|
|
1026
1012
|
case 2:
|
|
1027
|
-
return /* @__PURE__ */
|
|
1013
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
1028
1014
|
className: "flex items-center"
|
|
1029
|
-
}, /* @__PURE__ */
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1015
|
+
}, /* @__PURE__ */ React11.createElement(Icon7, {
|
|
1016
|
+
icon: "ph--warning--regular",
|
|
1017
|
+
size: 4,
|
|
1018
|
+
classNames: "me-1"
|
|
1019
|
+
}), /* @__PURE__ */ React11.createElement("span", {
|
|
1020
|
+
className: mx("text-sm", warningText)
|
|
1033
1021
|
}, t("persistence error label")));
|
|
1034
1022
|
case 1:
|
|
1035
|
-
return /* @__PURE__ */
|
|
1023
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
1036
1024
|
className: "flex items-center"
|
|
1037
|
-
}, /* @__PURE__ */
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1025
|
+
}, /* @__PURE__ */ React11.createElement(Icon7, {
|
|
1026
|
+
icon: "ph--arrows-counter-clockwise--regular",
|
|
1027
|
+
size: 4,
|
|
1028
|
+
classNames: "me-1"
|
|
1029
|
+
}), /* @__PURE__ */ React11.createElement("span", {
|
|
1030
|
+
className: mx("text-sm", staticPlaceholderText)
|
|
1041
1031
|
}, t("persistence pending label")));
|
|
1042
1032
|
case 0:
|
|
1043
1033
|
default:
|
|
1044
|
-
return /* @__PURE__ */
|
|
1034
|
+
return /* @__PURE__ */ React11.createElement(Tooltip.Trigger, {
|
|
1045
1035
|
delayDuration: 400,
|
|
1046
1036
|
role: "status",
|
|
1047
1037
|
content: t("persisted locally message"),
|
|
1048
1038
|
className: "flex items-center"
|
|
1049
|
-
}, /* @__PURE__ */
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1039
|
+
}, /* @__PURE__ */ React11.createElement(Icon7, {
|
|
1040
|
+
icon: "ph--check-circle--regular",
|
|
1041
|
+
size: 4,
|
|
1042
|
+
classNames: "me-1"
|
|
1043
|
+
}), displayMessage && /* @__PURE__ */ React11.createElement("span", {
|
|
1044
|
+
className: mx("text-sm", staticPlaceholderText)
|
|
1053
1045
|
}, t("persisted locally label")));
|
|
1054
1046
|
}
|
|
1055
1047
|
} finally {
|
|
@@ -1057,38 +1049,34 @@ var PersistenceStatus = ({ db }) => {
|
|
|
1057
1049
|
}
|
|
1058
1050
|
};
|
|
1059
1051
|
|
|
1060
|
-
//
|
|
1061
|
-
import { useSignals as
|
|
1062
|
-
import
|
|
1063
|
-
import {
|
|
1052
|
+
// src/components/PopoverRenameObject.tsx
|
|
1053
|
+
import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
|
|
1054
|
+
import React12, { useCallback as useCallback7, useRef as useRef4, useState as useState5 } from "react";
|
|
1055
|
+
import { LayoutAction as LayoutAction5, createIntent as createIntent6, useIntentDispatcher as useIntentDispatcher6 } from "@dxos/app-framework";
|
|
1056
|
+
import { Obj as Obj2 } from "@dxos/echo";
|
|
1064
1057
|
import { log as log2 } from "@dxos/log";
|
|
1065
|
-
import { Button as Button5, Input as Input3, useTranslation as
|
|
1066
|
-
var __dxlog_file3 = "/
|
|
1058
|
+
import { Button as Button5, Input as Input3, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
1059
|
+
var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/PopoverRenameObject.tsx";
|
|
1067
1060
|
var POPOVER_RENAME_OBJECT = `${SPACE_PLUGIN}/PopoverRenameObject`;
|
|
1068
|
-
var PopoverRenameObject = ({ object
|
|
1069
|
-
var _effect =
|
|
1061
|
+
var PopoverRenameObject = ({ object }) => {
|
|
1062
|
+
var _effect = _useSignals12();
|
|
1070
1063
|
try {
|
|
1071
|
-
const { t } =
|
|
1064
|
+
const { t } = useTranslation11(SPACE_PLUGIN);
|
|
1072
1065
|
const doneButton = useRef4(null);
|
|
1073
|
-
const
|
|
1074
|
-
const [name, setName] = useState5(object.name || object.title || "");
|
|
1066
|
+
const [name, setName] = useState5(Obj2.getLabel(object));
|
|
1075
1067
|
const { dispatchPromise: dispatch } = useIntentDispatcher6();
|
|
1076
1068
|
const handleDone = useCallback7(() => {
|
|
1077
1069
|
try {
|
|
1078
|
-
|
|
1079
|
-
} catch {
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
S: void 0,
|
|
1089
|
-
C: (f, a) => f(...a)
|
|
1090
|
-
});
|
|
1091
|
-
}
|
|
1070
|
+
name && Obj2.setLabel(object, name);
|
|
1071
|
+
} catch (err) {
|
|
1072
|
+
log2.error("Failed to rename object", {
|
|
1073
|
+
err
|
|
1074
|
+
}, {
|
|
1075
|
+
F: __dxlog_file3,
|
|
1076
|
+
L: 27,
|
|
1077
|
+
S: void 0,
|
|
1078
|
+
C: (f, a) => f(...a)
|
|
1079
|
+
});
|
|
1092
1080
|
}
|
|
1093
1081
|
void dispatch(createIntent6(LayoutAction5.UpdatePopover, {
|
|
1094
1082
|
part: "popover",
|
|
@@ -1102,21 +1090,21 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1102
1090
|
object,
|
|
1103
1091
|
name
|
|
1104
1092
|
]);
|
|
1105
|
-
return /* @__PURE__ */
|
|
1093
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
1106
1094
|
role: "none",
|
|
1107
1095
|
className: "p-2 flex gap-2"
|
|
1108
|
-
}, /* @__PURE__ */
|
|
1096
|
+
}, /* @__PURE__ */ React12.createElement("div", {
|
|
1109
1097
|
role: "none",
|
|
1110
1098
|
className: "flex-1"
|
|
1111
|
-
}, /* @__PURE__ */
|
|
1099
|
+
}, /* @__PURE__ */ React12.createElement(Input3.Root, null, /* @__PURE__ */ React12.createElement(Input3.Label, {
|
|
1112
1100
|
srOnly: true
|
|
1113
|
-
}, t("object name label")), /* @__PURE__ */
|
|
1101
|
+
}, t("object name label")), /* @__PURE__ */ React12.createElement(Input3.TextInput, {
|
|
1114
1102
|
placeholder: t("object placeholder"),
|
|
1115
1103
|
value: name,
|
|
1116
1104
|
"data-testid": "spacePlugin.renameObject.input",
|
|
1117
1105
|
onChange: ({ target: { value } }) => setName(value),
|
|
1118
1106
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1119
|
-
}))), /* @__PURE__ */
|
|
1107
|
+
}))), /* @__PURE__ */ React12.createElement(Button5, {
|
|
1120
1108
|
ref: doneButton,
|
|
1121
1109
|
classNames: "self-stretch",
|
|
1122
1110
|
onClick: handleDone
|
|
@@ -1128,16 +1116,16 @@ var PopoverRenameObject = ({ object: obj }) => {
|
|
|
1128
1116
|
}
|
|
1129
1117
|
};
|
|
1130
1118
|
|
|
1131
|
-
//
|
|
1132
|
-
import { useSignals as
|
|
1133
|
-
import
|
|
1134
|
-
import {
|
|
1135
|
-
import { Button as Button6, Input as Input4, Popover, useTranslation as
|
|
1119
|
+
// src/components/PopoverRenameSpace.tsx
|
|
1120
|
+
import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
|
|
1121
|
+
import React13, { useCallback as useCallback8, useRef as useRef5, useState as useState6 } from "react";
|
|
1122
|
+
import { LayoutAction as LayoutAction6, createIntent as createIntent7, useIntentDispatcher as useIntentDispatcher7 } from "@dxos/app-framework";
|
|
1123
|
+
import { Button as Button6, Input as Input4, Popover, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
1136
1124
|
var POPOVER_RENAME_SPACE = `${SPACE_PLUGIN}/PopoverRenameSpace`;
|
|
1137
1125
|
var PopoverRenameSpace = ({ space }) => {
|
|
1138
|
-
var _effect =
|
|
1126
|
+
var _effect = _useSignals13();
|
|
1139
1127
|
try {
|
|
1140
|
-
const { t } =
|
|
1128
|
+
const { t } = useTranslation12(SPACE_PLUGIN);
|
|
1141
1129
|
const doneButton = useRef5(null);
|
|
1142
1130
|
const [name, setName] = useState6(space.properties.name ?? "");
|
|
1143
1131
|
const { dispatchPromise: dispatch } = useIntentDispatcher7();
|
|
@@ -1155,24 +1143,24 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
1155
1143
|
space,
|
|
1156
1144
|
name
|
|
1157
1145
|
]);
|
|
1158
|
-
return /* @__PURE__ */
|
|
1146
|
+
return /* @__PURE__ */ React13.createElement("div", {
|
|
1159
1147
|
role: "none",
|
|
1160
1148
|
className: "p-2 flex gap-2"
|
|
1161
|
-
}, /* @__PURE__ */
|
|
1149
|
+
}, /* @__PURE__ */ React13.createElement("div", {
|
|
1162
1150
|
role: "none",
|
|
1163
1151
|
className: "flex-1"
|
|
1164
|
-
}, /* @__PURE__ */
|
|
1152
|
+
}, /* @__PURE__ */ React13.createElement(Input4.Root, null, /* @__PURE__ */ React13.createElement(Input4.Label, {
|
|
1165
1153
|
srOnly: true
|
|
1166
|
-
}, t("space name label")), /* @__PURE__ */
|
|
1154
|
+
}, t("space name label")), /* @__PURE__ */ React13.createElement(Input4.TextInput, {
|
|
1167
1155
|
defaultValue: space.properties.name ?? "",
|
|
1168
1156
|
placeholder: t("unnamed space label"),
|
|
1169
1157
|
onChange: ({ target: { value } }) => setName(value),
|
|
1170
1158
|
// TODO(wittjosiah): Ideally this should access the popover context to close the popover.
|
|
1171
1159
|
// Currently this is not possible because Radix does not expose the popover context.
|
|
1172
1160
|
onKeyDown: ({ key }) => key === "Enter" && doneButton.current?.click()
|
|
1173
|
-
}))), /* @__PURE__ */
|
|
1161
|
+
}))), /* @__PURE__ */ React13.createElement(Popover.Close, {
|
|
1174
1162
|
asChild: true
|
|
1175
|
-
}, /* @__PURE__ */
|
|
1163
|
+
}, /* @__PURE__ */ React13.createElement(Button6, {
|
|
1176
1164
|
ref: doneButton,
|
|
1177
1165
|
classNames: "self-stretch",
|
|
1178
1166
|
onClick: handleDone
|
|
@@ -1184,11 +1172,11 @@ var PopoverRenameSpace = ({ space }) => {
|
|
|
1184
1172
|
}
|
|
1185
1173
|
};
|
|
1186
1174
|
|
|
1187
|
-
//
|
|
1188
|
-
import { useSignals as
|
|
1189
|
-
import
|
|
1190
|
-
import { useTranslation as
|
|
1191
|
-
import {
|
|
1175
|
+
// src/components/SchemaContainer.tsx
|
|
1176
|
+
import { useSignals as _useSignals14 } from "@preact-signals/safe-react/tracking";
|
|
1177
|
+
import React14, { useEffect as useEffect3, useState as useState7 } from "react";
|
|
1178
|
+
import { useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
1179
|
+
import { ControlPage as ControlPage2, ControlSection as ControlSection2, controlItemClasses } from "@dxos/react-ui-form";
|
|
1192
1180
|
import { StackItem as StackItem3 } from "@dxos/react-ui-stack";
|
|
1193
1181
|
var useQuerySpaceSchemas = (space) => {
|
|
1194
1182
|
const [schemas, setSchemas] = useState7([]);
|
|
@@ -1204,38 +1192,38 @@ var useQuerySpaceSchemas = (space) => {
|
|
|
1204
1192
|
return schemas;
|
|
1205
1193
|
};
|
|
1206
1194
|
var SchemaContainer = ({ space }) => {
|
|
1207
|
-
var _effect =
|
|
1195
|
+
var _effect = _useSignals14();
|
|
1208
1196
|
try {
|
|
1209
|
-
const { t } =
|
|
1197
|
+
const { t } = useTranslation13(SPACE_PLUGIN);
|
|
1210
1198
|
const schemas = useQuerySpaceSchemas(space);
|
|
1211
|
-
return /* @__PURE__ */
|
|
1199
|
+
return /* @__PURE__ */ React14.createElement(StackItem3.Content, {
|
|
1212
1200
|
classNames: "block overflow-y-auto"
|
|
1213
|
-
}, /* @__PURE__ */
|
|
1201
|
+
}, /* @__PURE__ */ React14.createElement(ControlPage2, null, /* @__PURE__ */ React14.createElement(ControlSection2, {
|
|
1214
1202
|
title: t("schema verbose label"),
|
|
1215
1203
|
description: t("schema description")
|
|
1216
|
-
}, /* @__PURE__ */
|
|
1204
|
+
}, /* @__PURE__ */ React14.createElement("div", {
|
|
1217
1205
|
role: "none",
|
|
1218
1206
|
className: controlItemClasses
|
|
1219
|
-
}, schemas.length === 0 && /* @__PURE__ */
|
|
1207
|
+
}, schemas.length === 0 && /* @__PURE__ */ React14.createElement("div", {
|
|
1220
1208
|
className: "text-center plb-4"
|
|
1221
|
-
}, t("no schemas found message")), schemas.map((schema) => /* @__PURE__ */
|
|
1209
|
+
}, t("no schemas found message")), schemas.map((schema) => /* @__PURE__ */ React14.createElement("div", {
|
|
1222
1210
|
key: schema.id
|
|
1223
|
-
}, /* @__PURE__ */
|
|
1211
|
+
}, /* @__PURE__ */ React14.createElement("div", null, schema.typename)))))));
|
|
1224
1212
|
} finally {
|
|
1225
1213
|
_effect.f();
|
|
1226
1214
|
}
|
|
1227
1215
|
};
|
|
1228
1216
|
|
|
1229
|
-
//
|
|
1230
|
-
import { useSignals as
|
|
1231
|
-
import { Option } from "effect";
|
|
1232
|
-
import
|
|
1217
|
+
// src/components/SpacePresence.tsx
|
|
1218
|
+
import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
|
|
1219
|
+
import { Option as Option2 } from "effect";
|
|
1220
|
+
import React15, { forwardRef, useCallback as useCallback9, useEffect as useEffect4, useState as useState8 } from "react";
|
|
1233
1221
|
import { useAppGraph as useAppGraph2, useCapability } from "@dxos/app-framework";
|
|
1234
1222
|
import { generateName } from "@dxos/display-name";
|
|
1235
1223
|
import { PublicKey, useClient as useClient5 } from "@dxos/react-client";
|
|
1236
|
-
import { getSpace as getSpace3, useMembers
|
|
1224
|
+
import { fullyQualifiedId as fullyQualifiedId3, getSpace as getSpace3, useMembers } from "@dxos/react-client/echo";
|
|
1237
1225
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
1238
|
-
import { Avatar,
|
|
1226
|
+
import { Avatar, List, ListItem, Popover as Popover2, Tooltip as Tooltip2, useDefaultValue as useDefaultValue2, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
1239
1227
|
import { AttentionGlyph, useAttended, useAttention } from "@dxos/react-ui-attention";
|
|
1240
1228
|
import { ComplexMap, keyToFallback } from "@dxos/util";
|
|
1241
1229
|
var REFRESH_INTERVAL = 5e3;
|
|
@@ -1243,7 +1231,7 @@ var ACTIVITY_DURATION = 3e4;
|
|
|
1243
1231
|
var noViewers = new ComplexMap(PublicKey.hash);
|
|
1244
1232
|
var getName = (identity) => identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
|
|
1245
1233
|
var SpacePresence = ({ object, spaceKey }) => {
|
|
1246
|
-
var _effect =
|
|
1234
|
+
var _effect = _useSignals15();
|
|
1247
1235
|
try {
|
|
1248
1236
|
const spaceState = useCapability(SpaceCapabilities.MutableState);
|
|
1249
1237
|
const client = useClient5();
|
|
@@ -1273,7 +1261,7 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1273
1261
|
lastSeen
|
|
1274
1262
|
};
|
|
1275
1263
|
}).toSorted((a, b) => a.lastSeen - b.lastSeen);
|
|
1276
|
-
return /* @__PURE__ */
|
|
1264
|
+
return /* @__PURE__ */ React15.createElement(FullPresence, {
|
|
1277
1265
|
members: membersForObject
|
|
1278
1266
|
});
|
|
1279
1267
|
} finally {
|
|
@@ -1281,46 +1269,46 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1281
1269
|
}
|
|
1282
1270
|
};
|
|
1283
1271
|
var FullPresence = (props) => {
|
|
1284
|
-
var _effect =
|
|
1272
|
+
var _effect = _useSignals15();
|
|
1285
1273
|
try {
|
|
1286
1274
|
const { size = 9, onMemberClick } = props;
|
|
1287
|
-
const members =
|
|
1275
|
+
const members = useDefaultValue2(props.members, () => []);
|
|
1288
1276
|
if (members.length === 0) {
|
|
1289
1277
|
return null;
|
|
1290
1278
|
}
|
|
1291
|
-
return /* @__PURE__ */
|
|
1279
|
+
return /* @__PURE__ */ React15.createElement("div", {
|
|
1292
1280
|
className: "dx-avatar-group",
|
|
1293
1281
|
"data-testid": "spacePlugin.presence"
|
|
1294
|
-
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */
|
|
1282
|
+
}, members.slice(0, 3).map((member, i) => /* @__PURE__ */ React15.createElement(Tooltip2.Trigger, {
|
|
1295
1283
|
key: member.identity.identityKey.toHex(),
|
|
1296
1284
|
side: "bottom",
|
|
1297
1285
|
content: getName(member.identity),
|
|
1298
1286
|
className: "grid focus:outline-none"
|
|
1299
|
-
}, /* @__PURE__ */
|
|
1287
|
+
}, /* @__PURE__ */ React15.createElement(PresenceAvatar, {
|
|
1300
1288
|
identity: member.identity,
|
|
1301
1289
|
match: member.currentlyAttended,
|
|
1302
1290
|
index: members.length - i,
|
|
1303
1291
|
onClick: () => onMemberClick?.(member),
|
|
1304
1292
|
size
|
|
1305
|
-
}))), members.length > 3 && /* @__PURE__ */
|
|
1293
|
+
}))), members.length > 3 && /* @__PURE__ */ React15.createElement(Popover2.Root, null, /* @__PURE__ */ React15.createElement(Popover2.Trigger, {
|
|
1306
1294
|
className: "grid focus:outline-none"
|
|
1307
|
-
}, /* @__PURE__ */
|
|
1295
|
+
}, /* @__PURE__ */ React15.createElement(Avatar.Root, null, /* @__PURE__ */ React15.createElement(Avatar.Content, {
|
|
1308
1296
|
status: "inactive",
|
|
1309
1297
|
style: {
|
|
1310
1298
|
zIndex: members.length - 4
|
|
1311
1299
|
},
|
|
1312
1300
|
fallback: `+${members.length - 3}`,
|
|
1313
1301
|
size
|
|
1314
|
-
}))), /* @__PURE__ */
|
|
1302
|
+
}))), /* @__PURE__ */ React15.createElement(Popover2.Portal, null, /* @__PURE__ */ React15.createElement(Popover2.Content, {
|
|
1315
1303
|
side: "bottom"
|
|
1316
|
-
}, /* @__PURE__ */
|
|
1304
|
+
}, /* @__PURE__ */ React15.createElement(Popover2.Arrow, null), /* @__PURE__ */ React15.createElement(Popover2.Viewport, {
|
|
1317
1305
|
classNames: "max-bs-56"
|
|
1318
|
-
}, /* @__PURE__ */
|
|
1306
|
+
}, /* @__PURE__ */ React15.createElement(List, null, members.map((member) => /* @__PURE__ */ React15.createElement(ListItem.Root, {
|
|
1319
1307
|
key: member.identity.identityKey.toHex(),
|
|
1320
1308
|
classNames: "flex gap-2 items-center cursor-pointer mbe-2",
|
|
1321
1309
|
onClick: () => onMemberClick?.(member),
|
|
1322
1310
|
"data-testid": "identity-list-item"
|
|
1323
|
-
}, /* @__PURE__ */
|
|
1311
|
+
}, /* @__PURE__ */ React15.createElement(PresenceAvatar, {
|
|
1324
1312
|
identity: member.identity,
|
|
1325
1313
|
size,
|
|
1326
1314
|
showName: true,
|
|
@@ -1331,11 +1319,11 @@ var FullPresence = (props) => {
|
|
|
1331
1319
|
}
|
|
1332
1320
|
};
|
|
1333
1321
|
var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match, index, onClick, size }, forwardedRef) => {
|
|
1334
|
-
var _effect =
|
|
1322
|
+
var _effect = _useSignals15();
|
|
1335
1323
|
try {
|
|
1336
1324
|
const status = match ? "current" : "active";
|
|
1337
1325
|
const fallbackValue = keyToFallback(identity.identityKey);
|
|
1338
|
-
return /* @__PURE__ */
|
|
1326
|
+
return /* @__PURE__ */ React15.createElement(Avatar.Root, null, /* @__PURE__ */ React15.createElement(Avatar.Content, {
|
|
1339
1327
|
status,
|
|
1340
1328
|
hue: identity.profile?.data?.hue || fallbackValue.hue,
|
|
1341
1329
|
"data-testid": "spacePlugin.presence.member",
|
|
@@ -1349,7 +1337,7 @@ var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match, in
|
|
|
1349
1337
|
onClick,
|
|
1350
1338
|
fallback: identity.profile?.data?.emoji || fallbackValue.emoji,
|
|
1351
1339
|
ref: forwardedRef
|
|
1352
|
-
}), /* @__PURE__ */
|
|
1340
|
+
}), /* @__PURE__ */ React15.createElement(Avatar.Label, {
|
|
1353
1341
|
classNames: showName ? "text-sm truncate pli-2" : "sr-only"
|
|
1354
1342
|
}, getName(identity)));
|
|
1355
1343
|
} finally {
|
|
@@ -1357,7 +1345,7 @@ var PresenceAvatar = /* @__PURE__ */ forwardRef(({ identity, showName, match, in
|
|
|
1357
1345
|
}
|
|
1358
1346
|
});
|
|
1359
1347
|
var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
1360
|
-
var _effect =
|
|
1348
|
+
var _effect = _useSignals15();
|
|
1361
1349
|
try {
|
|
1362
1350
|
const { hasAttention, isAncestor, isRelated } = useAttention(id);
|
|
1363
1351
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
@@ -1365,7 +1353,7 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1365
1353
|
const attended = useAttended();
|
|
1366
1354
|
const startOfAttention = attended.at(-1);
|
|
1367
1355
|
const path = usePath(graph, startOfAttention);
|
|
1368
|
-
const containsAttended = !open && !isAttended && id &&
|
|
1356
|
+
const containsAttended = !open && !isAttended && id && Option2.isSome(path) ? path.value.includes(id) : false;
|
|
1369
1357
|
const getActiveViewers = (viewers2) => {
|
|
1370
1358
|
const moment = Date.now();
|
|
1371
1359
|
return Array.from(viewers2.values()).filter((viewer) => moment - viewer.lastSeen < ACTIVITY_DURATION);
|
|
@@ -1382,7 +1370,7 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1382
1370
|
}, [
|
|
1383
1371
|
viewers
|
|
1384
1372
|
]);
|
|
1385
|
-
return /* @__PURE__ */
|
|
1373
|
+
return /* @__PURE__ */ React15.createElement(SmallPresence, {
|
|
1386
1374
|
count: activeViewers.length,
|
|
1387
1375
|
attended: isAttended,
|
|
1388
1376
|
containsAttended
|
|
@@ -1392,16 +1380,16 @@ var SmallPresenceLive = ({ id, open, viewers }) => {
|
|
|
1392
1380
|
}
|
|
1393
1381
|
};
|
|
1394
1382
|
var SmallPresence = ({ count = 0, attended, containsAttended }) => {
|
|
1395
|
-
var _effect =
|
|
1383
|
+
var _effect = _useSignals15();
|
|
1396
1384
|
try {
|
|
1397
|
-
const { t } =
|
|
1398
|
-
return /* @__PURE__ */
|
|
1385
|
+
const { t } = useTranslation14(SPACE_PLUGIN);
|
|
1386
|
+
return /* @__PURE__ */ React15.createElement(Tooltip2.Trigger, {
|
|
1399
1387
|
asChild: true,
|
|
1400
1388
|
content: t("presence label", {
|
|
1401
1389
|
count
|
|
1402
1390
|
}),
|
|
1403
1391
|
side: "bottom"
|
|
1404
|
-
}, /* @__PURE__ */
|
|
1392
|
+
}, /* @__PURE__ */ React15.createElement(AttentionGlyph, {
|
|
1405
1393
|
attended,
|
|
1406
1394
|
containsAttended,
|
|
1407
1395
|
presence: count > 1 ? "many" : count === 1 ? "one" : "none",
|
|
@@ -1412,46 +1400,44 @@ var SmallPresence = ({ count = 0, attended, containsAttended }) => {
|
|
|
1412
1400
|
}
|
|
1413
1401
|
};
|
|
1414
1402
|
|
|
1415
|
-
//
|
|
1416
|
-
import { useSignals as
|
|
1417
|
-
import
|
|
1403
|
+
// src/components/SpacePluginSettings.tsx
|
|
1404
|
+
import { useSignals as _useSignals16 } from "@preact-signals/safe-react/tracking";
|
|
1405
|
+
import React16 from "react";
|
|
1418
1406
|
import { createIntent as createIntent8, useIntentDispatcher as useIntentDispatcher8 } from "@dxos/app-framework";
|
|
1419
1407
|
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1420
1408
|
import { useSpaces as useSpaces2 } from "@dxos/react-client/echo";
|
|
1421
|
-
import { Input as Input5,
|
|
1422
|
-
import {
|
|
1409
|
+
import { IconButton, Input as Input5, List as List2, ListItem as ListItem2, toLocalizedString as toLocalizedString3, useTranslation as useTranslation15 } from "@dxos/react-ui";
|
|
1410
|
+
import { ControlGroup, ControlItemInput as ControlItemInput2, ControlPage as ControlPage3, ControlSection as ControlSection3, controlItemClasses as controlItemClasses2 } from "@dxos/react-ui-form";
|
|
1423
1411
|
var SpacePluginSettings = ({ settings }) => {
|
|
1424
|
-
var _effect =
|
|
1412
|
+
var _effect = _useSignals16();
|
|
1425
1413
|
try {
|
|
1426
|
-
const { t } =
|
|
1414
|
+
const { t } = useTranslation15(SPACE_PLUGIN);
|
|
1427
1415
|
const client = useClient6();
|
|
1428
1416
|
const spaces = useSpaces2({
|
|
1429
1417
|
all: settings.showHidden
|
|
1430
1418
|
});
|
|
1431
1419
|
const { dispatchPromise: dispatch } = useIntentDispatcher8();
|
|
1432
|
-
return /* @__PURE__ */
|
|
1420
|
+
return /* @__PURE__ */ React16.createElement(ControlPage3, null, /* @__PURE__ */ React16.createElement(ControlSection3, {
|
|
1433
1421
|
title: t("space settings label"),
|
|
1434
1422
|
description: t("space settings description")
|
|
1435
|
-
}, /* @__PURE__ */
|
|
1436
|
-
|
|
1437
|
-
}, /* @__PURE__ */
|
|
1438
|
-
label: t("show hidden spaces label")
|
|
1439
|
-
}, /* @__PURE__ */ React17.createElement(Input5.Switch, {
|
|
1423
|
+
}, /* @__PURE__ */ React16.createElement(ControlGroup, null, /* @__PURE__ */ React16.createElement(ControlItemInput2, {
|
|
1424
|
+
title: t("show hidden spaces label")
|
|
1425
|
+
}, /* @__PURE__ */ React16.createElement(Input5.Switch, {
|
|
1440
1426
|
checked: settings.showHidden,
|
|
1441
1427
|
onCheckedChange: (checked) => settings.showHidden = !!checked
|
|
1442
|
-
}))), /* @__PURE__ */
|
|
1428
|
+
}))), /* @__PURE__ */ React16.createElement(List2, {
|
|
1443
1429
|
classNames: [
|
|
1444
1430
|
controlItemClasses2,
|
|
1445
1431
|
"flex flex-col gap-trimSm"
|
|
1446
1432
|
]
|
|
1447
|
-
}, spaces.map((space) => /* @__PURE__ */
|
|
1433
|
+
}, spaces.map((space) => /* @__PURE__ */ React16.createElement(ListItem2.Root, {
|
|
1448
1434
|
key: space.id,
|
|
1449
1435
|
classNames: "is-full items-center"
|
|
1450
|
-
}, /* @__PURE__ */
|
|
1436
|
+
}, /* @__PURE__ */ React16.createElement(ListItem2.Heading, {
|
|
1451
1437
|
classNames: "grow truncate !min-bs-0"
|
|
1452
1438
|
}, toLocalizedString3(getSpaceDisplayName(space, {
|
|
1453
1439
|
personal: space === client.spaces.default
|
|
1454
|
-
}), t)), /* @__PURE__ */
|
|
1440
|
+
}), t)), /* @__PURE__ */ React16.createElement(IconButton, {
|
|
1455
1441
|
icon: "ph--faders--regular",
|
|
1456
1442
|
onClick: () => dispatch(createIntent8(SpaceAction.OpenSettings, {
|
|
1457
1443
|
space
|
|
@@ -1463,29 +1449,29 @@ var SpacePluginSettings = ({ settings }) => {
|
|
|
1463
1449
|
}
|
|
1464
1450
|
};
|
|
1465
1451
|
|
|
1466
|
-
//
|
|
1467
|
-
import { useSignals as
|
|
1468
|
-
import { pipe as pipe2
|
|
1469
|
-
import
|
|
1470
|
-
import {
|
|
1452
|
+
// src/components/SpaceSettings/SpaceSettingsContainer.tsx
|
|
1453
|
+
import { useSignals as _useSignals17 } from "@preact-signals/safe-react/tracking";
|
|
1454
|
+
import { Schema, pipe as pipe2 } from "effect";
|
|
1455
|
+
import React17, { useCallback as useCallback10, useMemo as useMemo3, useState as useState9 } from "react";
|
|
1456
|
+
import { LayoutAction as LayoutAction7, chain as chain2, createIntent as createIntent9, useIntentDispatcher as useIntentDispatcher9 } from "@dxos/app-framework";
|
|
1471
1457
|
import { log as log3 } from "@dxos/log";
|
|
1472
1458
|
import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1473
1459
|
import { useClient as useClient7 } from "@dxos/react-client";
|
|
1474
1460
|
import { SpaceState as SpaceState2 } from "@dxos/react-client/echo";
|
|
1475
|
-
import { Button as Button7, Input as Input6, useMulticastObservable, useTranslation as
|
|
1476
|
-
import {
|
|
1461
|
+
import { Button as Button7, Input as Input6, useMulticastObservable, useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
1462
|
+
import { ControlItem, ControlItemInput as ControlItemInput3, ControlPage as ControlPage4, ControlSection as ControlSection4, Form as Form3 } from "@dxos/react-ui-form";
|
|
1477
1463
|
import { HuePicker, IconPicker } from "@dxos/react-ui-pickers";
|
|
1478
1464
|
import { StackItem as StackItem4 } from "@dxos/react-ui-stack";
|
|
1479
|
-
var __dxlog_file4 = "/
|
|
1465
|
+
var __dxlog_file4 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/SpaceSettings/SpaceSettingsContainer.tsx";
|
|
1480
1466
|
var FormSchema = SpaceForm.pipe(Schema.extend(Schema.Struct({
|
|
1481
1467
|
archived: Schema.Boolean.annotations({
|
|
1482
1468
|
title: "Archive space"
|
|
1483
1469
|
})
|
|
1484
1470
|
})));
|
|
1485
1471
|
var SpaceSettingsContainer = ({ space }) => {
|
|
1486
|
-
var _effect =
|
|
1472
|
+
var _effect = _useSignals17();
|
|
1487
1473
|
try {
|
|
1488
|
-
const { t } =
|
|
1474
|
+
const { t } = useTranslation16(SPACE_PLUGIN);
|
|
1489
1475
|
const { dispatchPromise: dispatch } = useIntentDispatcher9();
|
|
1490
1476
|
const client = useClient7();
|
|
1491
1477
|
const archived = useMulticastObservable(space.state) === SpaceState2.SPACE_INACTIVE;
|
|
@@ -1551,10 +1537,10 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1551
1537
|
onValueChange,
|
|
1552
1538
|
type
|
|
1553
1539
|
]);
|
|
1554
|
-
return /* @__PURE__ */
|
|
1540
|
+
return /* @__PURE__ */ React17.createElement(ControlItemInput3, {
|
|
1555
1541
|
title: label,
|
|
1556
1542
|
description: t("display name description")
|
|
1557
|
-
}, /* @__PURE__ */
|
|
1543
|
+
}, /* @__PURE__ */ React17.createElement(Input6.TextInput, {
|
|
1558
1544
|
value: getValue(),
|
|
1559
1545
|
onChange: handleChange,
|
|
1560
1546
|
placeholder: t("display name input placeholder"),
|
|
@@ -1570,10 +1556,10 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1570
1556
|
onValueChange,
|
|
1571
1557
|
type
|
|
1572
1558
|
]);
|
|
1573
|
-
return /* @__PURE__ */
|
|
1559
|
+
return /* @__PURE__ */ React17.createElement(ControlItem, {
|
|
1574
1560
|
title: label,
|
|
1575
1561
|
description: t("icon description")
|
|
1576
|
-
}, /* @__PURE__ */
|
|
1562
|
+
}, /* @__PURE__ */ React17.createElement(IconPicker, {
|
|
1577
1563
|
value: getValue(),
|
|
1578
1564
|
onChange: handleChange,
|
|
1579
1565
|
onReset: handleEmojiReset,
|
|
@@ -1590,10 +1576,10 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1590
1576
|
onValueChange,
|
|
1591
1577
|
type
|
|
1592
1578
|
]);
|
|
1593
|
-
return /* @__PURE__ */
|
|
1579
|
+
return /* @__PURE__ */ React17.createElement(ControlItem, {
|
|
1594
1580
|
title: label,
|
|
1595
1581
|
description: t("hue description")
|
|
1596
|
-
}, /* @__PURE__ */
|
|
1582
|
+
}, /* @__PURE__ */ React17.createElement(HuePicker, {
|
|
1597
1583
|
value: getValue(),
|
|
1598
1584
|
onChange: handleChange,
|
|
1599
1585
|
onReset: handleHueReset,
|
|
@@ -1605,10 +1591,10 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1605
1591
|
onValueChange,
|
|
1606
1592
|
type
|
|
1607
1593
|
]);
|
|
1608
|
-
return /* @__PURE__ */
|
|
1594
|
+
return /* @__PURE__ */ React17.createElement(ControlItemInput3, {
|
|
1609
1595
|
title: label,
|
|
1610
1596
|
description: t("edge replication description")
|
|
1611
|
-
}, /* @__PURE__ */
|
|
1597
|
+
}, /* @__PURE__ */ React17.createElement(Input6.Switch, {
|
|
1612
1598
|
checked: getValue(),
|
|
1613
1599
|
onCheckedChange: handleChange,
|
|
1614
1600
|
classNames: "justify-self-end"
|
|
@@ -1620,10 +1606,10 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1620
1606
|
type,
|
|
1621
1607
|
getValue
|
|
1622
1608
|
]);
|
|
1623
|
-
return /* @__PURE__ */
|
|
1609
|
+
return /* @__PURE__ */ React17.createElement(ControlItemInput3, {
|
|
1624
1610
|
title: label,
|
|
1625
1611
|
description: t("archive space description")
|
|
1626
|
-
}, /* @__PURE__ */
|
|
1612
|
+
}, /* @__PURE__ */ React17.createElement(Button7, {
|
|
1627
1613
|
disabled: space === client.spaces.default,
|
|
1628
1614
|
onClick: handleChange
|
|
1629
1615
|
}, getValue() ? t("unarchive space label") : t("archive space label")));
|
|
@@ -1632,39 +1618,39 @@ var SpaceSettingsContainer = ({ space }) => {
|
|
|
1632
1618
|
t,
|
|
1633
1619
|
space
|
|
1634
1620
|
]);
|
|
1635
|
-
return /* @__PURE__ */
|
|
1636
|
-
classNames: "block overflow-y-auto
|
|
1637
|
-
}, /* @__PURE__ */
|
|
1621
|
+
return /* @__PURE__ */ React17.createElement(StackItem4.Content, {
|
|
1622
|
+
classNames: "block overflow-y-auto"
|
|
1623
|
+
}, /* @__PURE__ */ React17.createElement(ControlPage4, null, /* @__PURE__ */ React17.createElement(ControlSection4, {
|
|
1638
1624
|
title: t("space properties settings verbose label", {
|
|
1639
1625
|
ns: SPACE_PLUGIN
|
|
1640
1626
|
}),
|
|
1641
1627
|
description: t("space properties settings description", {
|
|
1642
1628
|
ns: SPACE_PLUGIN
|
|
1643
1629
|
})
|
|
1644
|
-
}, /* @__PURE__ */
|
|
1630
|
+
}, /* @__PURE__ */ React17.createElement(Form3, {
|
|
1645
1631
|
schema: FormSchema,
|
|
1646
1632
|
values,
|
|
1647
1633
|
autoSave: true,
|
|
1648
1634
|
onSave: handleSave,
|
|
1649
1635
|
Custom: customElements,
|
|
1650
1636
|
outerSpacing: false,
|
|
1651
|
-
classNames: "container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]
|
|
1637
|
+
classNames: "container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
|
|
1652
1638
|
}))));
|
|
1653
1639
|
} finally {
|
|
1654
1640
|
_effect.f();
|
|
1655
1641
|
}
|
|
1656
1642
|
};
|
|
1657
1643
|
|
|
1658
|
-
//
|
|
1659
|
-
import { useSignals as
|
|
1660
|
-
import { Option as
|
|
1661
|
-
import
|
|
1644
|
+
// src/components/SyncStatus/InlineSyncStatus.tsx
|
|
1645
|
+
import { useSignals as _useSignals18 } from "@preact-signals/safe-react/tracking";
|
|
1646
|
+
import { Option as Option3 } from "effect";
|
|
1647
|
+
import React18, { useEffect as useEffect5, useState as useState10 } from "react";
|
|
1662
1648
|
import { useAppGraph as useAppGraph3 } from "@dxos/app-framework";
|
|
1663
1649
|
import { EdgeStatus } from "@dxos/protocols/proto/dxos/client/services";
|
|
1664
1650
|
import { EdgeReplicationSetting as EdgeReplicationSetting2 } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1665
1651
|
import { useClient as useClient8 } from "@dxos/react-client";
|
|
1666
1652
|
import { useSpaceSyncState } from "@dxos/react-client/echo";
|
|
1667
|
-
import { Tooltip as Tooltip3, useTranslation as
|
|
1653
|
+
import { Tooltip as Tooltip3, useTranslation as useTranslation17 } from "@dxos/react-ui";
|
|
1668
1654
|
import { AttentionGlyph as AttentionGlyph2, useAttended as useAttended2, useAttention as useAttention2 } from "@dxos/react-ui-attention";
|
|
1669
1655
|
var useEdgeStatus = () => {
|
|
1670
1656
|
const [status, setStatus] = useState10(EdgeStatus.NOT_CONNECTED);
|
|
@@ -1679,9 +1665,9 @@ var useEdgeStatus = () => {
|
|
|
1679
1665
|
return status;
|
|
1680
1666
|
};
|
|
1681
1667
|
var InlineSyncStatus = ({ space, open }) => {
|
|
1682
|
-
var _effect =
|
|
1668
|
+
var _effect = _useSignals18();
|
|
1683
1669
|
try {
|
|
1684
|
-
const { t } =
|
|
1670
|
+
const { t } = useTranslation17(SPACE_PLUGIN);
|
|
1685
1671
|
const id = space.id;
|
|
1686
1672
|
const { hasAttention, isAncestor, isRelated } = useAttention2(id);
|
|
1687
1673
|
const isAttended = hasAttention || isAncestor || isRelated;
|
|
@@ -1689,16 +1675,16 @@ var InlineSyncStatus = ({ space, open }) => {
|
|
|
1689
1675
|
const attended = useAttended2();
|
|
1690
1676
|
const startOfAttention = attended.at(-1);
|
|
1691
1677
|
const path = usePath(graph, startOfAttention);
|
|
1692
|
-
const containsAttended = !open && !isAttended && id &&
|
|
1678
|
+
const containsAttended = !open && !isAttended && id && Option3.isSome(path) ? path.value.includes(id) : false;
|
|
1693
1679
|
const connectedToEdge = useEdgeStatus() === EdgeStatus.CONNECTED;
|
|
1694
1680
|
const edgeSyncEnabled = space.internal.data.edgeReplication === EdgeReplicationSetting2.ENABLED;
|
|
1695
1681
|
const syncState = useSpaceSyncState(space);
|
|
1696
1682
|
const syncing = connectedToEdge && edgeSyncEnabled && syncState && syncState.missingOnLocal > 0;
|
|
1697
|
-
return /* @__PURE__ */
|
|
1683
|
+
return /* @__PURE__ */ React18.createElement(Tooltip3.Trigger, {
|
|
1698
1684
|
asChild: true,
|
|
1699
1685
|
content: t("syncing label"),
|
|
1700
1686
|
side: "bottom"
|
|
1701
|
-
}, /* @__PURE__ */
|
|
1687
|
+
}, /* @__PURE__ */ React18.createElement(AttentionGlyph2, {
|
|
1702
1688
|
syncing,
|
|
1703
1689
|
attended: isAttended,
|
|
1704
1690
|
containsAttended,
|
|
@@ -1709,17 +1695,17 @@ var InlineSyncStatus = ({ space, open }) => {
|
|
|
1709
1695
|
}
|
|
1710
1696
|
};
|
|
1711
1697
|
|
|
1712
|
-
//
|
|
1713
|
-
import { useSignals as
|
|
1714
|
-
import
|
|
1698
|
+
// src/components/SyncStatus/SyncStatus.tsx
|
|
1699
|
+
import { useSignals as _useSignals19 } from "@preact-signals/safe-react/tracking";
|
|
1700
|
+
import React19, { useEffect as useEffect6, useState as useState11 } from "react";
|
|
1715
1701
|
import { StatusBar } from "@dxos/plugin-status-bar";
|
|
1716
1702
|
import { useClient as useClient9 } from "@dxos/react-client";
|
|
1717
1703
|
import { getSyncSummary, useSyncState } from "@dxos/react-client/echo";
|
|
1718
|
-
import { Icon as
|
|
1704
|
+
import { Icon as Icon8, useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
1719
1705
|
|
|
1720
|
-
//
|
|
1706
|
+
// src/components/SyncStatus/save-tracker.ts
|
|
1721
1707
|
import { Context } from "@dxos/context";
|
|
1722
|
-
var __dxlog_file5 = "/
|
|
1708
|
+
var __dxlog_file5 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/SyncStatus/save-tracker.ts";
|
|
1723
1709
|
var createClientSaveTracker = (client, cb) => {
|
|
1724
1710
|
const CleanupFns = {};
|
|
1725
1711
|
const state = {};
|
|
@@ -1756,15 +1742,15 @@ var createSpaceSaveTracker = (space, cb) => {
|
|
|
1756
1742
|
}
|
|
1757
1743
|
let hasUnsavedChanges = false;
|
|
1758
1744
|
let lastFlushPromise;
|
|
1759
|
-
space.
|
|
1745
|
+
space.db.saveStateChanged.on(ctx, ({ unsavedDocuments }) => {
|
|
1760
1746
|
hasUnsavedChanges = unsavedDocuments.length > 0;
|
|
1761
1747
|
});
|
|
1762
|
-
space.
|
|
1748
|
+
space.db.saveStateChanged.debounce(500).on(ctx, () => {
|
|
1763
1749
|
if (hasUnsavedChanges) {
|
|
1764
1750
|
lastFlushPromise = void 0;
|
|
1765
1751
|
cb("saving");
|
|
1766
1752
|
} else {
|
|
1767
|
-
const flushPromise = space.
|
|
1753
|
+
const flushPromise = space.db.flush();
|
|
1768
1754
|
lastFlushPromise = flushPromise;
|
|
1769
1755
|
void flushPromise.then(() => {
|
|
1770
1756
|
if (lastFlushPromise === flushPromise) {
|
|
@@ -1779,7 +1765,7 @@ var createSpaceSaveTracker = (space, cb) => {
|
|
|
1779
1765
|
};
|
|
1780
1766
|
};
|
|
1781
1767
|
|
|
1782
|
-
//
|
|
1768
|
+
// src/components/SyncStatus/status.ts
|
|
1783
1769
|
var getStatus = ({ offline, saved, needsToUpload, needsToDownload }) => {
|
|
1784
1770
|
if (!saved) {
|
|
1785
1771
|
return "saving locally";
|
|
@@ -1808,10 +1794,10 @@ var getIcon = (status) => {
|
|
|
1808
1794
|
}
|
|
1809
1795
|
};
|
|
1810
1796
|
|
|
1811
|
-
//
|
|
1797
|
+
// src/components/SyncStatus/SyncStatus.tsx
|
|
1812
1798
|
var SYNC_STALLED_TIMEOUT = 5e3;
|
|
1813
1799
|
var SyncStatus = () => {
|
|
1814
|
-
var _effect =
|
|
1800
|
+
var _effect = _useSignals19();
|
|
1815
1801
|
try {
|
|
1816
1802
|
const client = useClient9();
|
|
1817
1803
|
const state = useSyncState();
|
|
@@ -1821,7 +1807,7 @@ var SyncStatus = () => {
|
|
|
1821
1807
|
setSaved(state2 === "saved");
|
|
1822
1808
|
});
|
|
1823
1809
|
}, []);
|
|
1824
|
-
return /* @__PURE__ */
|
|
1810
|
+
return /* @__PURE__ */ React19.createElement(SyncStatusIndicator, {
|
|
1825
1811
|
state,
|
|
1826
1812
|
saved
|
|
1827
1813
|
});
|
|
@@ -1830,9 +1816,9 @@ var SyncStatus = () => {
|
|
|
1830
1816
|
}
|
|
1831
1817
|
};
|
|
1832
1818
|
var SyncStatusIndicator = ({ state, saved }) => {
|
|
1833
|
-
var _effect =
|
|
1819
|
+
var _effect = _useSignals19();
|
|
1834
1820
|
try {
|
|
1835
|
-
const { t } =
|
|
1821
|
+
const { t } = useTranslation18(SPACE_PLUGIN);
|
|
1836
1822
|
const summary = getSyncSummary(state);
|
|
1837
1823
|
const offline = Object.values(state).length === 0;
|
|
1838
1824
|
const needsToUpload = summary.differentDocuments > 0 || summary.missingOnRemote > 0;
|
|
@@ -1859,12 +1845,12 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1859
1845
|
needsToDownload
|
|
1860
1846
|
]);
|
|
1861
1847
|
const title = t(`${status} label`);
|
|
1862
|
-
const icon = /* @__PURE__ */
|
|
1848
|
+
const icon = /* @__PURE__ */ React19.createElement(Icon8, {
|
|
1863
1849
|
icon: getIcon(status),
|
|
1864
1850
|
size: 4,
|
|
1865
1851
|
classNames
|
|
1866
1852
|
});
|
|
1867
|
-
return /* @__PURE__ */
|
|
1853
|
+
return /* @__PURE__ */ React19.createElement(StatusBar.Item, {
|
|
1868
1854
|
title
|
|
1869
1855
|
}, icon);
|
|
1870
1856
|
} finally {
|
|
@@ -1872,13 +1858,88 @@ var SyncStatusIndicator = ({ state, saved }) => {
|
|
|
1872
1858
|
}
|
|
1873
1859
|
};
|
|
1874
1860
|
|
|
1861
|
+
// src/components/ViewEditor.tsx
|
|
1862
|
+
import { useSignals as _useSignals20 } from "@preact-signals/safe-react/tracking";
|
|
1863
|
+
import React20, { useCallback as useCallback11 } from "react";
|
|
1864
|
+
import { createIntent as createIntent10, useIntentDispatcher as useIntentDispatcher10 } from "@dxos/app-framework";
|
|
1865
|
+
import { Filter as Filter2, Query as Query2, Type as Type3 } from "@dxos/echo";
|
|
1866
|
+
import { invariant as invariant2 } from "@dxos/invariant";
|
|
1867
|
+
import { useClient as useClient10 } from "@dxos/react-client";
|
|
1868
|
+
import { getSpace as getSpace4, useSchema } from "@dxos/react-client/echo";
|
|
1869
|
+
import { ViewEditor as NaturalViewEditor } from "@dxos/react-ui-form";
|
|
1870
|
+
import { typenameFromQuery as typenameFromQuery2 } from "@dxos/schema";
|
|
1871
|
+
var __dxlog_file6 = "/__w/dxos/dxos/packages/plugins/plugin-space/src/components/ViewEditor.tsx";
|
|
1872
|
+
var ViewEditor = ({ view }) => {
|
|
1873
|
+
var _effect = _useSignals20();
|
|
1874
|
+
try {
|
|
1875
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher10();
|
|
1876
|
+
const client = useClient10();
|
|
1877
|
+
const space = getSpace4(view);
|
|
1878
|
+
const typename = view.query ? typenameFromQuery2(view.query) : void 0;
|
|
1879
|
+
const schema = useSchema(client, space, typename);
|
|
1880
|
+
const handleUpdateQuery = useCallback11((typename2) => {
|
|
1881
|
+
invariant2(schema, void 0, {
|
|
1882
|
+
F: __dxlog_file6,
|
|
1883
|
+
L: 28,
|
|
1884
|
+
S: void 0,
|
|
1885
|
+
A: [
|
|
1886
|
+
"schema",
|
|
1887
|
+
""
|
|
1888
|
+
]
|
|
1889
|
+
});
|
|
1890
|
+
invariant2(Type3.isMutable(schema), void 0, {
|
|
1891
|
+
F: __dxlog_file6,
|
|
1892
|
+
L: 29,
|
|
1893
|
+
S: void 0,
|
|
1894
|
+
A: [
|
|
1895
|
+
"Type.isMutable(schema)",
|
|
1896
|
+
""
|
|
1897
|
+
]
|
|
1898
|
+
});
|
|
1899
|
+
const newQuery = Query2.select(Filter2.typename(typename2));
|
|
1900
|
+
view.query = newQuery.ast;
|
|
1901
|
+
schema.updateTypename(typename2);
|
|
1902
|
+
}, [
|
|
1903
|
+
view,
|
|
1904
|
+
schema
|
|
1905
|
+
]);
|
|
1906
|
+
const handleDelete = useCallback11((fieldId) => {
|
|
1907
|
+
void dispatch(createIntent10(SpaceAction.DeleteField, {
|
|
1908
|
+
view,
|
|
1909
|
+
fieldId
|
|
1910
|
+
}));
|
|
1911
|
+
}, [
|
|
1912
|
+
dispatch,
|
|
1913
|
+
view
|
|
1914
|
+
]);
|
|
1915
|
+
if (!space || !schema) {
|
|
1916
|
+
return null;
|
|
1917
|
+
}
|
|
1918
|
+
return /* @__PURE__ */ React20.createElement(NaturalViewEditor, {
|
|
1919
|
+
registry: space.db.schemaRegistry,
|
|
1920
|
+
schema,
|
|
1921
|
+
view,
|
|
1922
|
+
onQueryChanged: Type3.isMutable(schema) ? handleUpdateQuery : void 0,
|
|
1923
|
+
onDelete: Type3.isMutable(schema) ? handleDelete : void 0,
|
|
1924
|
+
outerSpacing: false
|
|
1925
|
+
});
|
|
1926
|
+
} finally {
|
|
1927
|
+
_effect.f();
|
|
1928
|
+
}
|
|
1929
|
+
};
|
|
1930
|
+
|
|
1931
|
+
// src/components/index.ts
|
|
1932
|
+
import { lazy as lazy2 } from "react";
|
|
1933
|
+
var CollectionMain = lazy2(() => import("./CollectionMain-D2B75XBS.mjs"));
|
|
1934
|
+
var ObjectDetailsPanel = lazy2(() => import("./ObjectDetailsPanel-J7KGPJJK.mjs"));
|
|
1935
|
+
var RecordMain = lazy2(() => import("./RecordMain-TEBGAVSL.mjs"));
|
|
1936
|
+
|
|
1875
1937
|
export {
|
|
1876
1938
|
AwaitingObject,
|
|
1877
1939
|
CREATE_OBJECT_DIALOG,
|
|
1878
1940
|
CreateObjectDialog,
|
|
1879
1941
|
CREATE_SPACE_DIALOG,
|
|
1880
1942
|
CreateSpaceDialog,
|
|
1881
|
-
CollectionMain,
|
|
1882
1943
|
CollectionSection,
|
|
1883
1944
|
JOIN_DIALOG,
|
|
1884
1945
|
JoinDialog,
|
|
@@ -1901,6 +1962,10 @@ export {
|
|
|
1901
1962
|
InlineSyncStatus,
|
|
1902
1963
|
SyncStatus,
|
|
1903
1964
|
SyncStatusIndicator,
|
|
1965
|
+
ViewEditor,
|
|
1966
|
+
CollectionMain,
|
|
1967
|
+
ObjectDetailsPanel,
|
|
1968
|
+
RecordMain,
|
|
1904
1969
|
AppGraphBuilder,
|
|
1905
1970
|
AppGraphSerializer,
|
|
1906
1971
|
IdentityCreated,
|
|
@@ -1908,9 +1973,8 @@ export {
|
|
|
1908
1973
|
ReactRoot,
|
|
1909
1974
|
ReactSurface,
|
|
1910
1975
|
SchemaDefs,
|
|
1911
|
-
SchemaTools,
|
|
1912
1976
|
SpaceSettings,
|
|
1913
1977
|
SpaceState,
|
|
1914
1978
|
SpacesReady
|
|
1915
1979
|
};
|
|
1916
|
-
//# sourceMappingURL=chunk-
|
|
1980
|
+
//# sourceMappingURL=chunk-IIY4XVBZ.mjs.map
|