@dxos/plugin-space 0.8.4-main.3a94e84 → 0.8.4-main.406dc2a
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 → CollectionMain-AX7KKXWP.mjs} +4 -4
- package/dist/lib/browser/CollectionMain-AX7KKXWP.mjs.map +7 -0
- package/dist/lib/browser/ObjectDetailsPanel-MQBHG666.mjs +145 -0
- package/dist/lib/browser/ObjectDetailsPanel-MQBHG666.mjs.map +7 -0
- package/dist/lib/browser/ObjectSettings-KNUZFCGS.mjs +151 -0
- package/dist/lib/browser/ObjectSettings-KNUZFCGS.mjs.map +7 -0
- package/dist/lib/browser/RecordMain-H4DVHICS.mjs +116 -0
- package/dist/lib/browser/RecordMain-H4DVHICS.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-7CZZJS3S.mjs → app-graph-builder-3R5GGT46.mjs} +102 -61
- package/dist/lib/browser/app-graph-builder-3R5GGT46.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-H6AW7KGS.mjs → app-graph-serializer-25Z5BG22.mjs} +14 -14
- package/dist/lib/browser/app-graph-serializer-25Z5BG22.mjs.map +7 -0
- package/dist/lib/browser/{chunk-V7MJSSBQ.mjs → chunk-522KZGQF.mjs} +310 -342
- package/dist/lib/browser/chunk-522KZGQF.mjs.map +7 -0
- package/dist/lib/browser/chunk-7XOTWRZ3.mjs +166 -0
- package/dist/lib/browser/chunk-7XOTWRZ3.mjs.map +7 -0
- package/dist/lib/browser/chunk-EIXZABXD.mjs +19 -0
- package/dist/lib/browser/chunk-EIXZABXD.mjs.map +7 -0
- package/dist/lib/browser/chunk-IRKDREHY.mjs +11 -0
- package/dist/lib/browser/chunk-IRKDREHY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XUYKJUU7.mjs → chunk-OV6D543A.mjs} +99 -44
- package/dist/lib/browser/chunk-OV6D543A.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QACNNDOT.mjs → chunk-PTGRQQ6J.mjs} +13 -10
- package/dist/lib/browser/chunk-PTGRQQ6J.mjs.map +7 -0
- package/dist/lib/browser/chunk-RLI2IAHK.mjs +20 -0
- package/dist/lib/browser/chunk-RLI2IAHK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SGTQ52SU.mjs → chunk-WS2PJDES.mjs} +22 -12
- package/dist/lib/browser/chunk-WS2PJDES.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-23XJJV2N.mjs → identity-created-PW2BA46S.mjs} +4 -4
- package/dist/lib/browser/{identity-created-23XJJV2N.mjs.map → identity-created-PW2BA46S.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +36 -53
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-TIXVDYN7.mjs → intent-resolver-ICGUSVH6.mjs} +52 -45
- package/dist/lib/browser/intent-resolver-ICGUSVH6.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-N2J7TDRX.mjs → react-root-H56QN474.mjs} +11 -11
- package/dist/lib/browser/react-root-H56QN474.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-TPNLWJJH.mjs → react-surface-VOE2ILKO.mjs} +57 -77
- package/dist/lib/browser/react-surface-VOE2ILKO.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-Z6FC4AHC.mjs → schema-defs-7R7RKCAE.mjs} +5 -5
- package/dist/lib/browser/schema-defs-7R7RKCAE.mjs.map +7 -0
- package/dist/lib/browser/{settings-4IMP5RYT.mjs → settings-OBFJ67ZG.mjs} +5 -5
- package/dist/lib/browser/{settings-4IMP5RYT.mjs.map → settings-OBFJ67ZG.mjs.map} +1 -1
- package/dist/lib/browser/{spaces-ready-TOPG6IV4.mjs → spaces-ready-MFIVK6I6.mjs} +18 -16
- package/dist/lib/browser/spaces-ready-MFIVK6I6.mjs.map +7 -0
- package/dist/lib/browser/{state-QYZAB45H.mjs → state-LSPRFIRO.mjs} +7 -7
- package/dist/lib/browser/state-LSPRFIRO.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{CollectionMain-ZJIFCWKZ.mjs → CollectionMain-EU57SRYK.mjs} +4 -4
- package/dist/lib/node-esm/CollectionMain-EU57SRYK.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-NABA2S56.mjs +146 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-NABA2S56.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectSettings-GXGTITF5.mjs +152 -0
- package/dist/lib/node-esm/ObjectSettings-GXGTITF5.mjs.map +7 -0
- package/dist/lib/node-esm/RecordMain-MYFTAQ2U.mjs +117 -0
- package/dist/lib/node-esm/RecordMain-MYFTAQ2U.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-KGIGWC72.mjs → app-graph-builder-VGRMD5TP.mjs} +102 -61
- package/dist/lib/node-esm/app-graph-builder-VGRMD5TP.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-2ICUGQQT.mjs → app-graph-serializer-U4GHXWRG.mjs} +14 -14
- package/dist/lib/node-esm/app-graph-serializer-U4GHXWRG.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JH6F4C3I.mjs → chunk-4F25JKVT.mjs} +22 -12
- package/dist/lib/node-esm/chunk-4F25JKVT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-6X5DLJM5.mjs → chunk-DG5YEEPZ.mjs} +310 -342
- package/dist/lib/node-esm/chunk-DG5YEEPZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-H5UPFRRH.mjs +21 -0
- package/dist/lib/node-esm/chunk-H5UPFRRH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-P442DOQ3.mjs → chunk-HAKW2RFD.mjs} +13 -10
- package/dist/lib/node-esm/chunk-HAKW2RFD.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HWNG4MEU.mjs → chunk-MWNATOXL.mjs} +2 -4
- package/dist/lib/node-esm/chunk-MWNATOXL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PAAWJ4RE.mjs +167 -0
- package/dist/lib/node-esm/chunk-PAAWJ4RE.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SVFKU7EW.mjs +20 -0
- package/dist/lib/node-esm/chunk-SVFKU7EW.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4AOMYKDE.mjs → chunk-TNUWML33.mjs} +99 -44
- package/dist/lib/node-esm/chunk-TNUWML33.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-IJQO6GCR.mjs → identity-created-MWTLGQRU.mjs} +4 -4
- package/dist/lib/node-esm/{identity-created-IJQO6GCR.mjs.map → identity-created-MWTLGQRU.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +36 -53
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-MHGHRGDT.mjs → intent-resolver-KVB2A4YC.mjs} +52 -45
- package/dist/lib/node-esm/intent-resolver-KVB2A4YC.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-KW3TGJGY.mjs → react-root-56PGW5PH.mjs} +11 -11
- package/dist/lib/node-esm/react-root-56PGW5PH.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-UUIUUD6P.mjs → react-surface-NYEQ23A4.mjs} +57 -77
- package/dist/lib/node-esm/react-surface-NYEQ23A4.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-WHJM7UZE.mjs → schema-defs-RYG5DSUE.mjs} +5 -5
- package/dist/lib/node-esm/schema-defs-RYG5DSUE.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-SAOBPND3.mjs → settings-QGWWNMMZ.mjs} +5 -5
- package/dist/lib/node-esm/{settings-SAOBPND3.mjs.map → settings-QGWWNMMZ.mjs.map} +1 -1
- package/dist/lib/node-esm/{spaces-ready-HIUKNDZK.mjs → spaces-ready-TC27M7MP.mjs} +18 -16
- package/dist/lib/node-esm/spaces-ready-TC27M7MP.mjs.map +7 -0
- package/dist/lib/node-esm/{state-ZVEHQ4BJ.mjs → state-TCGOPLRO.mjs} +7 -7
- package/dist/lib/node-esm/state-TCGOPLRO.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/SpacePlugin.d.ts +1 -1
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-serializer.d.ts +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +5 -4
- 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/CreateDialog/CreateObjectDialog.d.ts +3 -3
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +1604 -4
- 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/CreateDialog/CreateSpaceDialog.d.ts +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts +1 -1
- package/dist/types/src/components/JoinDialog.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 +1604 -5
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ObjectDetailsPanel/ObjectDetailsPanel.d.ts +9 -0
- package/dist/types/src/components/ObjectDetailsPanel/ObjectDetailsPanel.d.ts.map +1 -0
- package/dist/types/src/components/ObjectDetailsPanel/ObjectForm.d.ts +10 -0
- package/dist/types/src/components/ObjectDetailsPanel/ObjectForm.d.ts.map +1 -0
- package/dist/types/src/components/ObjectDetailsPanel/index.d.ts +3 -0
- package/dist/types/src/components/ObjectDetailsPanel/index.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts +1 -1
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.stories.d.ts +1440 -0
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts +1 -1
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/index.d.ts +2 -1
- package/dist/types/src/components/ObjectSettings/index.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts +2 -2
- package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts +1 -1
- package/dist/types/src/components/PopoverRenameSpace.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 +1432 -4
- 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 +1437 -4
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +1438 -5
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor.d.ts +1 -1
- package/dist/types/src/components/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +9 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -1
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts +1 -1
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -1
- package/dist/types/src/hooks/usePath.d.ts +1 -1
- package/dist/types/src/hooks/usePath.d.ts.map +1 -1
- package/dist/types/src/hooks/useTypeOptions.d.ts +10 -0
- package/dist/types/src/hooks/useTypeOptions.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1236 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +78 -96
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +10 -7
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +63 -58
- package/src/SpacePlugin.ts +206 -220
- package/src/capabilities/app-graph-builder.ts +127 -69
- package/src/capabilities/app-graph-serializer.ts +7 -7
- package/src/capabilities/capabilities.ts +18 -12
- package/src/capabilities/identity-created.ts +1 -1
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +40 -28
- package/src/capabilities/react-root.tsx +4 -3
- package/src/capabilities/react-surface.tsx +50 -107
- package/src/capabilities/schema-defs.ts +3 -2
- package/src/capabilities/spaces-ready.ts +11 -8
- package/src/capabilities/state.ts +5 -4
- package/src/components/AwaitingObject.tsx +3 -3
- package/src/components/CollectionMain.tsx +2 -2
- package/src/components/CollectionSection.tsx +2 -2
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +11 -10
- package/src/components/CreateDialog/CreateObjectDialog.tsx +24 -13
- package/src/components/CreateDialog/CreateObjectPanel.tsx +22 -11
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +6 -5
- package/src/components/JoinDialog.tsx +7 -7
- package/src/components/MembersContainer.stories.tsx +36 -10
- package/src/components/MembersContainer.tsx +13 -14
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/ObjectDetailsPanel/ObjectDetailsPanel.tsx +52 -0
- package/src/components/ObjectDetailsPanel/ObjectForm.tsx +75 -0
- package/src/components/ObjectDetailsPanel/index.ts +7 -0
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +4 -3
- package/src/components/ObjectSettings/BaseObjectSettings.stories.tsx +63 -0
- package/src/components/ObjectSettings/BaseObjectSettings.tsx +96 -26
- package/src/components/ObjectSettings/ForeignKeys.tsx +3 -3
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +3 -2
- package/src/components/ObjectSettings/index.ts +3 -1
- package/src/components/PersistenceStatus.tsx +2 -2
- package/src/components/PopoverRenameObject.tsx +9 -15
- package/src/components/PopoverRenameSpace.tsx +4 -4
- package/src/components/RecordMain.tsx +87 -0
- package/src/components/SchemaContainer.tsx +5 -5
- package/src/components/SpacePluginSettings.tsx +8 -9
- package/src/components/SpacePresence.stories.tsx +23 -22
- package/src/components/SpacePresence.tsx +10 -10
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +17 -9
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +19 -18
- package/src/components/SyncStatus/InlineSyncStatus.tsx +7 -7
- package/src/components/SyncStatus/SyncStatus.stories.tsx +6 -7
- package/src/components/SyncStatus/SyncStatus.tsx +93 -5
- package/src/components/ViewEditor.tsx +14 -20
- package/src/components/index.ts +2 -1
- package/src/events.ts +7 -7
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useActiveSpace.ts +2 -2
- package/src/hooks/useInputSurfaceLookup.tsx +2 -2
- package/src/hooks/usePath.ts +1 -1
- package/src/hooks/useTypeOptions.ts +59 -0
- package/src/meta.ts +1 -3
- package/src/translations.ts +11 -8
- package/src/types/types.ts +21 -13
- package/src/util.tsx +97 -40
- package/dist/lib/browser/CollectionMain-D2B75XBS.mjs.map +0 -7
- package/dist/lib/browser/ObjectDetailsPanel-YPTDQKMG.mjs +0 -88
- package/dist/lib/browser/ObjectDetailsPanel-YPTDQKMG.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-7CZZJS3S.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-H6AW7KGS.mjs.map +0 -7
- package/dist/lib/browser/chunk-CEFHNVU7.mjs +0 -20
- package/dist/lib/browser/chunk-CEFHNVU7.mjs.map +0 -7
- package/dist/lib/browser/chunk-FBCGT5YY.mjs +0 -13
- package/dist/lib/browser/chunk-FBCGT5YY.mjs.map +0 -7
- package/dist/lib/browser/chunk-JS3MMC42.mjs +0 -19
- package/dist/lib/browser/chunk-JS3MMC42.mjs.map +0 -7
- package/dist/lib/browser/chunk-QACNNDOT.mjs.map +0 -7
- package/dist/lib/browser/chunk-SGTQ52SU.mjs.map +0 -7
- package/dist/lib/browser/chunk-V7MJSSBQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-VLBRSGJ2.mjs +0 -94
- package/dist/lib/browser/chunk-VLBRSGJ2.mjs.map +0 -7
- package/dist/lib/browser/chunk-XUYKJUU7.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-TIXVDYN7.mjs.map +0 -7
- package/dist/lib/browser/react-root-N2J7TDRX.mjs.map +0 -7
- package/dist/lib/browser/react-surface-TPNLWJJH.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-Z6FC4AHC.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-BNP4JTD7.mjs +0 -124
- package/dist/lib/browser/schema-tools-BNP4JTD7.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-TOPG6IV4.mjs.map +0 -7
- package/dist/lib/browser/state-QYZAB45H.mjs.map +0 -7
- package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs.map +0 -7
- package/dist/lib/node-esm/ObjectDetailsPanel-QKZEDSZK.mjs +0 -89
- package/dist/lib/node-esm/ObjectDetailsPanel-QKZEDSZK.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-KGIGWC72.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-2ICUGQQT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4AOMYKDE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5HHYE264.mjs +0 -20
- package/dist/lib/node-esm/chunk-5HHYE264.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5T3ZH23B.mjs +0 -21
- package/dist/lib/node-esm/chunk-5T3ZH23B.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6X5DLJM5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HWNG4MEU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JH6F4C3I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-P442DOQ3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SSLBYZEY.mjs +0 -96
- package/dist/lib/node-esm/chunk-SSLBYZEY.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-MHGHRGDT.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-KW3TGJGY.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-UUIUUD6P.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-WHJM7UZE.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-KWW5PTML.mjs +0 -126
- package/dist/lib/node-esm/schema-tools-KWW5PTML.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-HIUKNDZK.mjs.map +0 -7
- package/dist/lib/node-esm/state-ZVEHQ4BJ.mjs.map +0 -7
- package/dist/types/src/capabilities/schema-tool.test.d.ts +0 -2
- package/dist/types/src/capabilities/schema-tool.test.d.ts.map +0 -1
- package/dist/types/src/capabilities/schema-tools.d.ts +0 -13
- package/dist/types/src/capabilities/schema-tools.d.ts.map +0 -1
- package/dist/types/src/components/ObjectDetailsPanel.d.ts +0 -9
- package/dist/types/src/components/ObjectDetailsPanel.d.ts.map +0 -1
- package/src/capabilities/schema-tool.test.ts +0 -44
- package/src/capabilities/schema-tools.ts +0 -125
- package/src/components/ObjectDetailsPanel.tsx +0 -77
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useIntentDispatcher, useLayout } from '@dxos/app-framework';
|
|
8
8
|
import { useClient } from '@dxos/react-client';
|
|
9
9
|
import { Filter, fullyQualifiedId, useQuery } from '@dxos/react-client/echo';
|
|
10
10
|
import { Button, Icon, Toast, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { meta } from '../meta';
|
|
13
13
|
import { SpaceAction } from '../types';
|
|
14
14
|
|
|
15
15
|
const WAIT_FOR_OBJECT_TIMEOUT = 180e3; // 3 minutes
|
|
@@ -19,7 +19,7 @@ export const AwaitingObject = ({ id }: { id: string }) => {
|
|
|
19
19
|
const [open, setOpen] = useState(true);
|
|
20
20
|
const [waiting, setWaiting] = useState(true);
|
|
21
21
|
const [found, setFound] = useState(false);
|
|
22
|
-
const { t } = useTranslation(
|
|
22
|
+
const { t } = useTranslation(meta.id);
|
|
23
23
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
24
24
|
const layout = useLayout();
|
|
25
25
|
|
|
@@ -8,10 +8,10 @@ import { useTranslation } from '@dxos/react-ui';
|
|
|
8
8
|
import { baseSurface, descriptionMessage, mx } from '@dxos/react-ui-theme';
|
|
9
9
|
import { type DataType } from '@dxos/schema';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { meta } from '../meta';
|
|
12
12
|
|
|
13
13
|
export const CollectionMain = ({ collection }: { collection: DataType.Collection }) => {
|
|
14
|
-
const { t } = useTranslation(
|
|
14
|
+
const { t } = useTranslation(meta.id);
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
17
|
<div
|
|
@@ -7,10 +7,10 @@ import React from 'react';
|
|
|
7
7
|
import { useTranslation } from '@dxos/react-ui';
|
|
8
8
|
import { type DataType } from '@dxos/schema';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { meta } from '../meta';
|
|
11
11
|
|
|
12
12
|
export const CollectionSection = ({ collection }: { collection: DataType.Collection }) => {
|
|
13
|
-
const { t } = useTranslation(
|
|
13
|
+
const { t } = useTranslation(meta.id);
|
|
14
14
|
// TODO(wittjosiah): Better placeholder.
|
|
15
15
|
return (
|
|
16
16
|
<div className='min-bs-[3.5rem] grid grid-rows-subgrid grid-cols-subgrid items-center'>
|
|
@@ -2,47 +2,48 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useEffect } from 'react';
|
|
9
7
|
|
|
8
|
+
import { IntentPlugin } from '@dxos/app-framework';
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { Filter, Obj, Type } from '@dxos/echo';
|
|
11
11
|
import { useQuery, useSpace } from '@dxos/react-client/echo';
|
|
12
12
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
13
|
import { Dialog } from '@dxos/react-ui';
|
|
14
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
14
15
|
import { DataType } from '@dxos/schema';
|
|
15
16
|
import { translations as shellTranslations } from '@dxos/shell/react';
|
|
16
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
17
17
|
|
|
18
|
-
import { CreateObjectDialog, type CreateObjectDialogProps } from './CreateObjectDialog';
|
|
19
18
|
import { translations } from '../../translations';
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
import { CreateObjectDialog, type CreateObjectDialogProps } from './CreateObjectDialog';
|
|
21
|
+
|
|
22
|
+
const Story = (props: CreateObjectDialogProps) => {
|
|
22
23
|
return (
|
|
23
24
|
<Dialog.Root open>
|
|
24
25
|
<Dialog.Overlay blockAlign='start'>
|
|
25
|
-
<CreateObjectDialog {...
|
|
26
|
+
<CreateObjectDialog {...props} />
|
|
26
27
|
</Dialog.Overlay>
|
|
27
28
|
</Dialog.Root>
|
|
28
29
|
);
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
// TODO(wittjosiah): Story should be for CreateObjectPanel.
|
|
32
|
-
const meta
|
|
33
|
+
const meta = {
|
|
33
34
|
title: 'plugins/plugin-space/CreateObjectDialog',
|
|
34
35
|
component: CreateObjectDialog,
|
|
35
36
|
render: Story,
|
|
36
37
|
decorators: [
|
|
38
|
+
withTheme, // TODO(wittjosiah): Try to write story which does not depend on plugin manager.
|
|
39
|
+
withPluginManager({ plugins: [IntentPlugin()] }),
|
|
37
40
|
withClientProvider({ createIdentity: true, createSpace: true, types: [DataType.Collection] }),
|
|
38
|
-
withTheme,
|
|
39
|
-
withLayout(),
|
|
40
41
|
],
|
|
41
42
|
parameters: {
|
|
42
43
|
translations: [...translations, ...shellTranslations],
|
|
43
44
|
},
|
|
44
45
|
args: {},
|
|
45
|
-
}
|
|
46
|
+
} satisfies Meta<typeof CreateObjectDialog>;
|
|
46
47
|
|
|
47
48
|
export default meta;
|
|
48
49
|
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
6
7
|
import React, { useCallback, useRef, useState } from 'react';
|
|
7
8
|
|
|
8
9
|
import {
|
|
@@ -17,20 +18,24 @@ import {
|
|
|
17
18
|
import { Obj, Query, Type } from '@dxos/echo';
|
|
18
19
|
import { invariant } from '@dxos/invariant';
|
|
19
20
|
import { useClient } from '@dxos/react-client';
|
|
20
|
-
import { getSpace, isLiveObject, isSpace,
|
|
21
|
+
import { type Space, getSpace, isLiveObject, isSpace, useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
21
22
|
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
22
23
|
import { cardDialogContent, cardDialogHeader } from '@dxos/react-ui-stack';
|
|
23
|
-
import { DataType } from '@dxos/schema';
|
|
24
|
+
import { DataType, getTypenameFromQuery } from '@dxos/schema';
|
|
24
25
|
import { isNonNullable } from '@dxos/util';
|
|
25
26
|
|
|
26
|
-
import { CreateObjectPanel, type CreateObjectPanelProps } from './CreateObjectPanel';
|
|
27
27
|
import { SpaceCapabilities } from '../../capabilities';
|
|
28
|
-
import {
|
|
28
|
+
import { meta } from '../../meta';
|
|
29
29
|
import { SpaceAction } from '../../types';
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
import { CreateObjectPanel, type CreateObjectPanelProps } from './CreateObjectPanel';
|
|
32
|
+
|
|
33
|
+
export const CREATE_OBJECT_DIALOG = `${meta.id}/CreateObjectDialog`;
|
|
32
34
|
|
|
33
|
-
export type CreateObjectDialogProps = Pick<
|
|
35
|
+
export type CreateObjectDialogProps = Pick<
|
|
36
|
+
CreateObjectPanelProps,
|
|
37
|
+
'target' | 'views' | 'typename' | 'initialFormValues'
|
|
38
|
+
> & {
|
|
34
39
|
onCreateObject?: (object: Obj.Any) => void;
|
|
35
40
|
shouldNavigate?: (object: Obj.Any) => boolean;
|
|
36
41
|
};
|
|
@@ -38,13 +43,14 @@ export type CreateObjectDialogProps = Pick<CreateObjectPanelProps, 'target' | 't
|
|
|
38
43
|
export const CreateObjectDialog = ({
|
|
39
44
|
target: initialTarget,
|
|
40
45
|
typename: initialTypename,
|
|
41
|
-
|
|
46
|
+
views,
|
|
47
|
+
initialFormValues,
|
|
42
48
|
onCreateObject,
|
|
43
49
|
shouldNavigate: _shouldNavigate,
|
|
44
50
|
}: CreateObjectDialogProps) => {
|
|
45
51
|
const closeRef = useRef<HTMLButtonElement | null>(null);
|
|
46
52
|
const manager = usePluginManager();
|
|
47
|
-
const { t } = useTranslation(
|
|
53
|
+
const { t } = useTranslation(meta.id);
|
|
48
54
|
const client = useClient();
|
|
49
55
|
const spaces = useSpaces();
|
|
50
56
|
const { dispatch } = useIntentDispatcher();
|
|
@@ -53,7 +59,9 @@ export const CreateObjectDialog = ({
|
|
|
53
59
|
const [typename, setTypename] = useState<string | undefined>(initialTypename);
|
|
54
60
|
const space = isSpace(target) ? target : getSpace(target);
|
|
55
61
|
const queryCollections = useQuery(space, Query.type(DataType.QueryCollection));
|
|
56
|
-
const hiddenTypenames = queryCollections
|
|
62
|
+
const hiddenTypenames = queryCollections
|
|
63
|
+
.map((collection) => getTypenameFromQuery(collection.query))
|
|
64
|
+
.filter(isNonNullable);
|
|
57
65
|
|
|
58
66
|
const resolve = useCallback<NonNullable<CreateObjectPanelProps['resolve']>>(
|
|
59
67
|
(typename) =>
|
|
@@ -81,7 +89,7 @@ export const CreateObjectDialog = ({
|
|
|
81
89
|
const addObjectIntent = createIntent(SpaceAction.AddObject, { target, object, hidden });
|
|
82
90
|
const shouldNavigate = _shouldNavigate ?? (() => true);
|
|
83
91
|
if (shouldNavigate(object)) {
|
|
84
|
-
yield* dispatch(pipe(addObjectIntent, chain(LayoutAction.Open, { part: 'main' })));
|
|
92
|
+
yield* dispatch(Function.pipe(addObjectIntent, chain(LayoutAction.Open, { part: 'main' })));
|
|
85
93
|
} else {
|
|
86
94
|
yield* dispatch(addObjectIntent);
|
|
87
95
|
}
|
|
@@ -98,7 +106,9 @@ export const CreateObjectDialog = ({
|
|
|
98
106
|
<Dialog.Content classNames={cardDialogContent}>
|
|
99
107
|
<div role='none' className={cardDialogHeader}>
|
|
100
108
|
<Dialog.Title>
|
|
101
|
-
{t('create object dialog title', {
|
|
109
|
+
{t('create object dialog title', {
|
|
110
|
+
object: t('typename label', { ns: typename, defaultValue: views ? 'View' : 'Item' }),
|
|
111
|
+
})}
|
|
102
112
|
</Dialog.Title>
|
|
103
113
|
<Dialog.Close asChild>
|
|
104
114
|
<Button ref={closeRef} density='fine' variant='ghost' autoFocus>
|
|
@@ -111,8 +121,9 @@ export const CreateObjectDialog = ({
|
|
|
111
121
|
forms={forms}
|
|
112
122
|
spaces={spaces}
|
|
113
123
|
target={target}
|
|
124
|
+
views={views}
|
|
114
125
|
typename={typename}
|
|
115
|
-
|
|
126
|
+
initialFormValues={initialFormValues}
|
|
116
127
|
defaultSpaceId={client.spaces.default.id}
|
|
117
128
|
resolve={resolve}
|
|
118
129
|
onTargetChange={setTarget}
|
|
@@ -2,20 +2,21 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import * as Option from 'effect/Option';
|
|
5
6
|
import React, { useCallback } from 'react';
|
|
6
7
|
|
|
7
8
|
import { Type } from '@dxos/echo';
|
|
8
|
-
import {
|
|
9
|
-
import { type
|
|
10
|
-
import { Icon, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { type BaseObject, type TypeAnnotation, ViewAnnotation, getTypeAnnotation } from '@dxos/echo/internal';
|
|
10
|
+
import { type Space, type SpaceId } from '@dxos/react-client/echo';
|
|
11
|
+
import { Icon, toLocalizedString, useDefaultValue, useTranslation } from '@dxos/react-ui';
|
|
11
12
|
import { Form } from '@dxos/react-ui-form';
|
|
12
13
|
import { SearchList } from '@dxos/react-ui-searchlist';
|
|
13
14
|
import { cardDialogOverflow, cardDialogPaddedOverflow, cardDialogSearchListRoot } from '@dxos/react-ui-stack';
|
|
14
15
|
import { type DataType } from '@dxos/schema';
|
|
15
|
-
import {
|
|
16
|
+
import { type MaybePromise, isNonNullable } from '@dxos/util';
|
|
16
17
|
|
|
17
18
|
import { useInputSurfaceLookup } from '../../hooks';
|
|
18
|
-
import {
|
|
19
|
+
import { meta } from '../../meta';
|
|
19
20
|
import { type ObjectForm } from '../../types';
|
|
20
21
|
import { getSpaceDisplayName } from '../../util';
|
|
21
22
|
|
|
@@ -24,7 +25,8 @@ export type CreateObjectPanelProps = {
|
|
|
24
25
|
spaces: Space[];
|
|
25
26
|
typename?: string;
|
|
26
27
|
target?: Space | DataType.Collection;
|
|
27
|
-
|
|
28
|
+
views?: boolean;
|
|
29
|
+
initialFormValues?: Partial<BaseObject>;
|
|
28
30
|
defaultSpaceId?: SpaceId;
|
|
29
31
|
resolve?: (typename: string) => Record<string, any>;
|
|
30
32
|
onTargetChange?: (target: Space) => void;
|
|
@@ -37,16 +39,25 @@ export const CreateObjectPanel = ({
|
|
|
37
39
|
spaces,
|
|
38
40
|
typename,
|
|
39
41
|
target,
|
|
40
|
-
|
|
42
|
+
views,
|
|
43
|
+
initialFormValues: _initialFormValues,
|
|
41
44
|
defaultSpaceId,
|
|
42
45
|
resolve,
|
|
43
46
|
onTargetChange,
|
|
44
47
|
onTypenameChange,
|
|
45
48
|
onCreateObject,
|
|
46
49
|
}: CreateObjectPanelProps) => {
|
|
47
|
-
const { t } = useTranslation(
|
|
50
|
+
const { t } = useTranslation(meta.id);
|
|
51
|
+
const initialFormValues = useDefaultValue(_initialFormValues, () => ({}));
|
|
48
52
|
const form = forms.find((form) => Type.getTypename(form.objectSchema) === typename);
|
|
49
53
|
const options: TypeAnnotation[] = forms
|
|
54
|
+
.filter((form) => {
|
|
55
|
+
if (views == null) {
|
|
56
|
+
return true;
|
|
57
|
+
} else {
|
|
58
|
+
return views === ViewAnnotation.get(form.objectSchema).pipe(Option.getOrElse(() => false));
|
|
59
|
+
}
|
|
60
|
+
})
|
|
50
61
|
.map((form) => getTypeAnnotation(form.objectSchema))
|
|
51
62
|
.filter(isNonNullable)
|
|
52
63
|
.sort((a, b) => {
|
|
@@ -88,7 +99,7 @@ export const CreateObjectPanel = ({
|
|
|
88
99
|
<div role='none' className={cardDialogOverflow}>
|
|
89
100
|
<Form
|
|
90
101
|
autoFocus
|
|
91
|
-
values={
|
|
102
|
+
values={initialFormValues}
|
|
92
103
|
schema={form.formSchema}
|
|
93
104
|
testId='create-object-form'
|
|
94
105
|
onSave={handleCreateObject}
|
|
@@ -104,7 +115,7 @@ const SelectSpace = ({
|
|
|
104
115
|
defaultSpaceId,
|
|
105
116
|
onChange,
|
|
106
117
|
}: { onChange?: (space: Space) => void } & Pick<CreateObjectPanelProps, 'spaces' | 'defaultSpaceId'>) => {
|
|
107
|
-
const { t } = useTranslation(
|
|
118
|
+
const { t } = useTranslation(meta.id);
|
|
108
119
|
|
|
109
120
|
return (
|
|
110
121
|
<SearchList.Root label={t('space input label')} classNames={cardDialogSearchListRoot}>
|
|
@@ -145,7 +156,7 @@ const SelectSchema = ({
|
|
|
145
156
|
options: TypeAnnotation[];
|
|
146
157
|
onChange: (type: string) => void;
|
|
147
158
|
} & Pick<CreateObjectPanelProps, 'resolve'>) => {
|
|
148
|
-
const { t } = useTranslation(
|
|
159
|
+
const { t } = useTranslation(meta.id);
|
|
149
160
|
|
|
150
161
|
return (
|
|
151
162
|
<SearchList.Root label={t('schema input label')} classNames={cardDialogSearchListRoot}>
|
|
@@ -2,26 +2,27 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import type * as Schema from 'effect/Schema';
|
|
6
7
|
import React, { useCallback, useRef } from 'react';
|
|
7
8
|
|
|
8
|
-
import {
|
|
9
|
+
import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
10
|
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
10
11
|
import { Form } from '@dxos/react-ui-form';
|
|
11
12
|
import { cardDialogContent, cardDialogHeader } from '@dxos/react-ui-stack';
|
|
12
13
|
|
|
13
14
|
import { useInputSurfaceLookup } from '../../hooks';
|
|
14
|
-
import {
|
|
15
|
+
import { meta } from '../../meta';
|
|
15
16
|
import { SpaceAction, SpaceForm } from '../../types';
|
|
16
17
|
|
|
17
|
-
export const CREATE_SPACE_DIALOG = `${
|
|
18
|
+
export const CREATE_SPACE_DIALOG = `${meta.id}/CreateSpaceDialog`;
|
|
18
19
|
|
|
19
20
|
type FormValues = Schema.Schema.Type<typeof SpaceForm>;
|
|
20
21
|
const initialValues: FormValues = { edgeReplication: true };
|
|
21
22
|
|
|
22
23
|
export const CreateSpaceDialog = () => {
|
|
23
24
|
const closeRef = useRef<HTMLButtonElement | null>(null);
|
|
24
|
-
const { t } = useTranslation(
|
|
25
|
+
const { t } = useTranslation(meta.id);
|
|
25
26
|
const { dispatch } = useIntentDispatcher();
|
|
26
27
|
|
|
27
28
|
const inputSurfaceLookup = useInputSurfaceLookup();
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useAppGraph, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { Trigger } from '@dxos/async';
|
|
9
9
|
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
10
10
|
import { useClient } from '@dxos/react-client';
|
|
@@ -13,9 +13,9 @@ import { type InvitationResult } from '@dxos/react-client/invitations';
|
|
|
13
13
|
import { Dialog, useTranslation } from '@dxos/react-ui';
|
|
14
14
|
import { JoinPanel, type JoinPanelProps } from '@dxos/shell/react';
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import { meta } from '../meta';
|
|
17
17
|
|
|
18
|
-
export const JOIN_DIALOG = `${
|
|
18
|
+
export const JOIN_DIALOG = `${meta.id}/JoinDialog`;
|
|
19
19
|
|
|
20
20
|
export type JoinDialogProps = JoinPanelProps & {
|
|
21
21
|
navigableCollections?: boolean;
|
|
@@ -25,7 +25,7 @@ export const JoinDialog = ({ navigableCollections, onDone, ...props }: JoinDialo
|
|
|
25
25
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
26
26
|
const client = useClient();
|
|
27
27
|
const { graph } = useAppGraph();
|
|
28
|
-
const { t } = useTranslation(
|
|
28
|
+
const { t } = useTranslation(meta.id);
|
|
29
29
|
|
|
30
30
|
const handleDone = useCallback(
|
|
31
31
|
async (result: InvitationResult | null) => {
|
|
@@ -39,10 +39,10 @@ export const JoinDialog = ({ navigableCollections, onDone, ...props }: JoinDialo
|
|
|
39
39
|
createIntent(LayoutAction.AddToast, {
|
|
40
40
|
part: 'toast',
|
|
41
41
|
subject: {
|
|
42
|
-
id: `${
|
|
42
|
+
id: `${meta.id}/join-success`,
|
|
43
43
|
duration: 5_000,
|
|
44
|
-
title: ['join success label', { ns:
|
|
45
|
-
closeLabel: ['dismiss label', { ns:
|
|
44
|
+
title: ['join success label', { ns: meta.id }],
|
|
45
|
+
closeLabel: ['dismiss label', { ns: meta.id }],
|
|
46
46
|
},
|
|
47
47
|
}),
|
|
48
48
|
),
|
|
@@ -2,29 +2,55 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React from 'react';
|
|
8
7
|
|
|
8
|
+
import { IntentPlugin } from '@dxos/app-framework';
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { useSpace } from '@dxos/react-client/echo';
|
|
9
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
12
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
10
13
|
import { translations as shellTranslations } from '@dxos/shell/react';
|
|
11
|
-
import {
|
|
14
|
+
import { render } from '@dxos/storybook-utils';
|
|
12
15
|
|
|
13
|
-
import { MembersContainer } from './MembersContainer';
|
|
14
16
|
import { translations } from '../translations';
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
import { MembersContainer } from './MembersContainer';
|
|
19
|
+
|
|
20
|
+
const DefaultStory = () => {
|
|
21
|
+
const space = useSpace();
|
|
22
|
+
if (!space) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<MembersContainer
|
|
28
|
+
space={space}
|
|
29
|
+
createInvitationUrl={(invitationCode) => `https://dxos.org/invite/${invitationCode}`}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const meta = {
|
|
17
35
|
title: 'plugins/plugin-space/MembersContainer',
|
|
18
|
-
component: MembersContainer,
|
|
19
|
-
|
|
36
|
+
component: MembersContainer as any,
|
|
37
|
+
render: render(DefaultStory),
|
|
38
|
+
decorators: [
|
|
39
|
+
withTheme, // TODO(wittjosiah): Try to write story which does not depend on plugin manager.
|
|
40
|
+
withPluginManager({ plugins: [IntentPlugin()] }),
|
|
41
|
+
withClientProvider({
|
|
42
|
+
createIdentity: true,
|
|
43
|
+
createSpace: true,
|
|
44
|
+
}),
|
|
45
|
+
],
|
|
20
46
|
parameters: {
|
|
21
47
|
layout: 'fullscreen',
|
|
22
48
|
translations: [...translations, ...shellTranslations],
|
|
23
49
|
},
|
|
24
|
-
}
|
|
50
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
25
51
|
|
|
26
52
|
export default meta;
|
|
27
53
|
|
|
28
|
-
type Story = StoryObj<typeof
|
|
54
|
+
type Story = StoryObj<typeof meta>;
|
|
29
55
|
|
|
30
56
|
export const Default: Story = {};
|
|
@@ -8,10 +8,10 @@ import { QR } from 'react-qr-rounded';
|
|
|
8
8
|
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
9
|
import { log } from '@dxos/log';
|
|
10
10
|
import { useConfig } from '@dxos/react-client';
|
|
11
|
-
import { fullyQualifiedId, useSpaceInvitations
|
|
11
|
+
import { type Space, fullyQualifiedId, useSpaceInvitations } from '@dxos/react-client/echo';
|
|
12
12
|
import { type CancellableInvitationObservable, Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
|
|
13
13
|
import { Button, Clipboard, Icon, Input, useId, useTranslation } from '@dxos/react-ui';
|
|
14
|
-
import {
|
|
14
|
+
import { ControlFrame, ControlFrameItem, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
15
15
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
16
16
|
import { DataType } from '@dxos/schema';
|
|
17
17
|
import {
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from '@dxos/shell/react';
|
|
27
27
|
import { hexToEmoji } from '@dxos/util';
|
|
28
28
|
|
|
29
|
-
import {
|
|
29
|
+
import { meta } from '../meta';
|
|
30
30
|
import { SpaceAction } from '../types';
|
|
31
31
|
import { COMPOSER_SPACE_LOCK } from '../util';
|
|
32
32
|
|
|
@@ -41,14 +41,13 @@ const handleInvitationEvent = (invitation: Invitation, subscription: ZenObservab
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
export
|
|
45
|
-
space,
|
|
46
|
-
createInvitationUrl,
|
|
47
|
-
}: {
|
|
44
|
+
export type MembersContainerProps = {
|
|
48
45
|
space: Space;
|
|
49
46
|
createInvitationUrl: (invitationCode: string) => string;
|
|
50
|
-
}
|
|
51
|
-
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const MembersContainer = ({ space, createInvitationUrl }: MembersContainerProps) => {
|
|
50
|
+
const { t } = useTranslation(meta.id);
|
|
52
51
|
const config = useConfig();
|
|
53
52
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
54
53
|
const invitations = useSpaceInvitations(space.key);
|
|
@@ -76,7 +75,7 @@ export const MembersContainer = ({
|
|
|
76
75
|
inviteOne: {
|
|
77
76
|
label: t('invite one label', { ns: 'os' }),
|
|
78
77
|
description: t('invite one description', { ns: 'os' }),
|
|
79
|
-
icon:
|
|
78
|
+
icon: 'ph--user-plus--regular',
|
|
80
79
|
testId: 'membersContainer.inviteOne',
|
|
81
80
|
onClick: async () => {
|
|
82
81
|
const { data: invitation } = await dispatch(
|
|
@@ -98,7 +97,7 @@ export const MembersContainer = ({
|
|
|
98
97
|
inviteMany: {
|
|
99
98
|
label: t('invite many label', { ns: 'os' }),
|
|
100
99
|
description: t('invite many description', { ns: 'os' }),
|
|
101
|
-
icon:
|
|
100
|
+
icon: 'ph--users-three--regular',
|
|
102
101
|
testId: 'membersContainer.inviteMany',
|
|
103
102
|
onClick: async () => {
|
|
104
103
|
const { data: invitation } = await dispatch(
|
|
@@ -131,7 +130,7 @@ export const MembersContainer = ({
|
|
|
131
130
|
|
|
132
131
|
return (
|
|
133
132
|
<Clipboard.Provider>
|
|
134
|
-
<StackItem.Content
|
|
133
|
+
<StackItem.Content scrollable>
|
|
135
134
|
<ControlPage>
|
|
136
135
|
<ControlSection title={t('members verbose label')} description={t('members description')}>
|
|
137
136
|
<ControlFrame>
|
|
@@ -168,7 +167,7 @@ export const MembersContainer = ({
|
|
|
168
167
|
)}
|
|
169
168
|
</ControlFrame>
|
|
170
169
|
{/* TODO(wittjosiah): Make ControlItemInput & ControlFrame compatible. */}
|
|
171
|
-
<div className='justify-center
|
|
170
|
+
<div className='justify-center p-0 mbs-4 container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'>
|
|
172
171
|
<ControlItemInput title={t('space locked label')} description={t('space locked description')}>
|
|
173
172
|
<Input.Switch checked={locked} onCheckedChange={handleChangeLocked} classNames='justify-self-end' />
|
|
174
173
|
</ControlItemInput>
|
|
@@ -231,7 +230,7 @@ const InvitationQR = ({ id, url, onCancel }: { id: string; url: string; onCancel
|
|
|
231
230
|
const emoji = hexToEmoji(id);
|
|
232
231
|
return (
|
|
233
232
|
<>
|
|
234
|
-
<p className='text-description'>{t('qr code description', { ns:
|
|
233
|
+
<p className='text-description'>{t('qr code description', { ns: meta.id })}</p>
|
|
235
234
|
<div role='group' className='grid grid-cols-[1fr_min-content] mlb-2 gap-2'>
|
|
236
235
|
<div role='none' className='is-full aspect-square relative text-description'>
|
|
237
236
|
<QR
|
|
@@ -9,11 +9,11 @@ import { type Obj } from '@dxos/echo';
|
|
|
9
9
|
import { useClient } from '@dxos/react-client';
|
|
10
10
|
import { DropdownMenu, Icon, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { meta } from '../meta';
|
|
13
13
|
import { getSpaceDisplayName } from '../util';
|
|
14
14
|
|
|
15
15
|
export const MenuFooter = ({ object }: { object: Obj.Any }) => {
|
|
16
|
-
const { t } = useTranslation(
|
|
16
|
+
const { t } = useTranslation(meta.id);
|
|
17
17
|
const client = useClient();
|
|
18
18
|
const space = getSpace(object);
|
|
19
19
|
const spaceName = space ? getSpaceDisplayName(space, { personal: client.spaces.default === space }) : '';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { useClient } from '@dxos/react-client';
|
|
8
|
+
import { Filter, getSpace, useQuery, useSchema } from '@dxos/react-client/echo';
|
|
9
|
+
import { Callout, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { useSelected } from '@dxos/react-ui-attention';
|
|
11
|
+
import { type DataType } from '@dxos/schema';
|
|
12
|
+
import { getTypenameFromQuery } from '@dxos/schema';
|
|
13
|
+
import { isNonNullable } from '@dxos/util';
|
|
14
|
+
|
|
15
|
+
import { meta } from '../../meta';
|
|
16
|
+
|
|
17
|
+
import { ObjectForm } from './ObjectForm';
|
|
18
|
+
|
|
19
|
+
type RowDetailsPanelProps = { objectId: string; view: DataType.View };
|
|
20
|
+
|
|
21
|
+
export const ObjectDetailsPanel = ({ objectId, view }: RowDetailsPanelProps) => {
|
|
22
|
+
const { t } = useTranslation(meta.id);
|
|
23
|
+
const client = useClient();
|
|
24
|
+
const space = getSpace(view);
|
|
25
|
+
const typename = view.query ? getTypenameFromQuery(view.query.ast) : undefined;
|
|
26
|
+
const schema = useSchema(client, space, typename);
|
|
27
|
+
|
|
28
|
+
const queriedObjects = useQuery(space, schema ? Filter.type(schema) : Filter.nothing());
|
|
29
|
+
const selectedRows = useSelected(objectId, 'multi');
|
|
30
|
+
const selectedObjects = selectedRows.map((id) => queriedObjects.find((obj) => obj.id === id)).filter(isNonNullable);
|
|
31
|
+
|
|
32
|
+
if (selectedObjects.length === 0) {
|
|
33
|
+
return (
|
|
34
|
+
<div role='none' className='plb-cardSpacingBlock pli-cardSpacingInline'>
|
|
35
|
+
<Callout.Root classNames='is-full'>
|
|
36
|
+
<Callout.Title>{t('row details no selection label')}</Callout.Title>
|
|
37
|
+
</Callout.Root>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div role='none' className='bs-full is-full flex flex-col p-2 gap-1 overflow-y-auto'>
|
|
44
|
+
{schema &&
|
|
45
|
+
selectedObjects.map((object) => (
|
|
46
|
+
<div key={object.id} className='border border-separator rounded'>
|
|
47
|
+
<ObjectForm object={object} schema={schema} />
|
|
48
|
+
</div>
|
|
49
|
+
))}
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
};
|