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