@dxos/plugin-space 0.8.4-main.b97322e → 0.8.4-main.c4373fc
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-YPTDQKMG.mjs → ObjectDetailsPanel-SJ4XUXXX.mjs} +11 -9
- package/dist/lib/browser/ObjectDetailsPanel-SJ4XUXXX.mjs.map +7 -0
- package/dist/lib/browser/RecordMain-FHPCS6GM.mjs +68 -0
- package/dist/lib/browser/RecordMain-FHPCS6GM.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-7CZZJS3S.mjs → app-graph-builder-Y2LBZX2G.mjs} +102 -61
- package/dist/lib/browser/app-graph-builder-Y2LBZX2G.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-H6AW7KGS.mjs → app-graph-serializer-425OVRTW.mjs} +14 -14
- package/dist/lib/browser/app-graph-serializer-425OVRTW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-V7MJSSBQ.mjs → chunk-6KVKMOGQ.mjs} +148 -157
- package/dist/lib/browser/chunk-6KVKMOGQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VLBRSGJ2.mjs → chunk-CVZAZRW4.mjs} +4 -4
- package/dist/lib/browser/chunk-CVZAZRW4.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-SGTQ52SU.mjs → chunk-OYHC63NL.mjs} +16 -10
- package/dist/lib/browser/chunk-OYHC63NL.mjs.map +7 -0
- package/dist/lib/browser/chunk-PUF3B7XO.mjs +20 -0
- package/dist/lib/browser/chunk-PUF3B7XO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XUYKJUU7.mjs → chunk-X6COEDOD.mjs} +99 -44
- package/dist/lib/browser/chunk-X6COEDOD.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QACNNDOT.mjs → chunk-YZJWWMNB.mjs} +11 -10
- package/dist/lib/browser/chunk-YZJWWMNB.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 +20 -40
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-TIXVDYN7.mjs → intent-resolver-2TBYHOBA.mjs} +47 -42
- package/dist/lib/browser/intent-resolver-2TBYHOBA.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-N2J7TDRX.mjs → react-root-KMJXJ5VX.mjs} +11 -11
- package/dist/lib/browser/react-root-KMJXJ5VX.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-TPNLWJJH.mjs → react-surface-YAJUAMER.mjs} +53 -42
- package/dist/lib/browser/react-surface-YAJUAMER.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-Z6FC4AHC.mjs → schema-defs-2OCPV7JF.mjs} +5 -5
- package/dist/lib/browser/schema-defs-2OCPV7JF.mjs.map +7 -0
- package/dist/lib/browser/{settings-4IMP5RYT.mjs → settings-UYYJ225A.mjs} +5 -5
- package/dist/lib/browser/{settings-4IMP5RYT.mjs.map → settings-UYYJ225A.mjs.map} +1 -1
- package/dist/lib/browser/{spaces-ready-TOPG6IV4.mjs → spaces-ready-YNZPWXA3.mjs} +18 -16
- package/dist/lib/browser/spaces-ready-YNZPWXA3.mjs.map +7 -0
- package/dist/lib/browser/{state-QYZAB45H.mjs → state-BPU73TYO.mjs} +7 -7
- package/dist/lib/browser/state-BPU73TYO.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-QKZEDSZK.mjs → ObjectDetailsPanel-P7D727OV.mjs} +11 -9
- package/dist/lib/node-esm/ObjectDetailsPanel-P7D727OV.mjs.map +7 -0
- package/dist/lib/node-esm/RecordMain-V73AEB6N.mjs +70 -0
- package/dist/lib/node-esm/RecordMain-V73AEB6N.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-KGIGWC72.mjs → app-graph-builder-DMNLDT7E.mjs} +102 -61
- package/dist/lib/node-esm/app-graph-builder-DMNLDT7E.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-2ICUGQQT.mjs → app-graph-serializer-ZEDSY77N.mjs} +14 -14
- package/dist/lib/node-esm/app-graph-serializer-ZEDSY77N.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-36TAYXV7.mjs +21 -0
- package/dist/lib/node-esm/chunk-36TAYXV7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-P442DOQ3.mjs → chunk-7UIEPBQJ.mjs} +11 -10
- package/dist/lib/node-esm/chunk-7UIEPBQJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JH6F4C3I.mjs → chunk-ADEZJQE3.mjs} +16 -10
- package/dist/lib/node-esm/chunk-ADEZJQE3.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SSLBYZEY.mjs → chunk-FLRC6XWU.mjs} +4 -4
- package/dist/lib/node-esm/chunk-FLRC6XWU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-6X5DLJM5.mjs → chunk-L26ZIGHA.mjs} +148 -157
- package/dist/lib/node-esm/chunk-L26ZIGHA.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-SVFKU7EW.mjs +20 -0
- package/dist/lib/node-esm/chunk-SVFKU7EW.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4AOMYKDE.mjs → chunk-ZFCCFELA.mjs} +99 -44
- package/dist/lib/node-esm/chunk-ZFCCFELA.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 +20 -40
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-MHGHRGDT.mjs → intent-resolver-YOG27WOG.mjs} +47 -42
- package/dist/lib/node-esm/intent-resolver-YOG27WOG.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-KW3TGJGY.mjs → react-root-27QMJZD2.mjs} +11 -11
- package/dist/lib/node-esm/react-root-27QMJZD2.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-UUIUUD6P.mjs → react-surface-RC73GAN5.mjs} +53 -42
- package/dist/lib/node-esm/react-surface-RC73GAN5.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-WHJM7UZE.mjs → schema-defs-X2Z7F2EV.mjs} +5 -5
- package/dist/lib/node-esm/schema-defs-X2Z7F2EV.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-SAOBPND3.mjs → settings-Q736OQRP.mjs} +5 -5
- package/dist/lib/node-esm/{settings-SAOBPND3.mjs.map → settings-Q736OQRP.mjs.map} +1 -1
- package/dist/lib/node-esm/{spaces-ready-HIUKNDZK.mjs → spaces-ready-XZQD7Q65.mjs} +18 -16
- package/dist/lib/node-esm/spaces-ready-XZQD7Q65.mjs.map +7 -0
- package/dist/lib/node-esm/{state-ZVEHQ4BJ.mjs → state-BY75TM32.mjs} +7 -7
- package/dist/lib/node-esm/state-BY75TM32.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 +4 -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 +1584 -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 +1584 -5
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ObjectDetailsPanel.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
- 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/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 +1412 -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 +1417 -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 +1418 -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 +8 -2
- 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/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/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1216 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +76 -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 +60 -58
- package/src/SpacePlugin.ts +204 -219
- package/src/capabilities/app-graph-builder.ts +127 -69
- package/src/capabilities/app-graph-serializer.ts +7 -7
- package/src/capabilities/capabilities.ts +12 -11
- package/src/capabilities/identity-created.ts +1 -1
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +37 -25
- package/src/capabilities/react-root.tsx +4 -3
- package/src/capabilities/react-surface.tsx +52 -38
- 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.tsx +7 -5
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +4 -3
- package/src/components/ObjectSettings/ForeignKeys.tsx +3 -3
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +3 -2
- 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 +43 -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 +3 -3
- package/src/components/SyncStatus/SyncStatus.stories.tsx +6 -7
- package/src/components/SyncStatus/SyncStatus.tsx +4 -3
- package/src/components/ViewEditor.tsx +13 -18
- package/src/components/index.ts +1 -0
- package/src/events.ts +7 -7
- package/src/hooks/useActiveSpace.ts +2 -2
- package/src/hooks/useInputSurfaceLookup.tsx +2 -2
- package/src/hooks/usePath.ts +1 -1
- package/src/meta.ts +1 -3
- package/src/translations.ts +9 -8
- package/src/types/types.ts +17 -13
- package/src/util.tsx +97 -40
- package/dist/lib/browser/CollectionMain-D2B75XBS.mjs.map +0 -7
- 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.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.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.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/src/capabilities/schema-tool.test.ts +0 -44
- package/src/capabilities/schema-tools.ts +0 -125
|
@@ -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 }) : '';
|
|
@@ -4,25 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type JsonPath, setValue } from '@dxos/echo
|
|
7
|
+
import { type JsonPath, setValue } from '@dxos/echo/internal';
|
|
8
8
|
import { invariant } from '@dxos/invariant';
|
|
9
9
|
import { useClient } from '@dxos/react-client';
|
|
10
|
-
import {
|
|
10
|
+
import { Filter, getSpace, useQuery, useSchema } from '@dxos/react-client/echo';
|
|
11
11
|
import { Callout, useTranslation } from '@dxos/react-ui';
|
|
12
12
|
import { useSelected } from '@dxos/react-ui-attention';
|
|
13
13
|
import { Form, useRefQueryLookupHandler } from '@dxos/react-ui-form';
|
|
14
14
|
import { type DataType } from '@dxos/schema';
|
|
15
|
+
import { getTypenameFromQuery } from '@dxos/schema';
|
|
15
16
|
import { isNonNullable } from '@dxos/util';
|
|
16
17
|
|
|
17
|
-
import {
|
|
18
|
+
import { meta } from '../meta';
|
|
18
19
|
|
|
19
20
|
type RowDetailsPanelProps = { objectId: string; view: DataType.View };
|
|
20
21
|
|
|
21
22
|
const ObjectDetailsPanel = ({ objectId, view }: RowDetailsPanelProps) => {
|
|
22
|
-
const { t } = useTranslation(
|
|
23
|
+
const { t } = useTranslation(meta.id);
|
|
23
24
|
const client = useClient();
|
|
24
25
|
const space = getSpace(view);
|
|
25
|
-
const
|
|
26
|
+
const typename = view.query ? getTypenameFromQuery(view.query.ast) : undefined;
|
|
27
|
+
const schema = useSchema(client, space, typename);
|
|
26
28
|
|
|
27
29
|
const queriedObjects = useQuery(space, schema ? Filter.type(schema) : Filter.nothing());
|
|
28
30
|
const selectedRows = useSelected(objectId, 'multi');
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
import React, { useCallback, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Obj } from '@dxos/echo';
|
|
8
|
-
import { ForeignKey } from '@dxos/echo
|
|
8
|
+
import { ForeignKey } from '@dxos/echo/internal';
|
|
9
9
|
import { IconButton, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { Form } from '@dxos/react-ui-form';
|
|
11
11
|
|
|
12
|
+
import { meta } from '../../meta';
|
|
13
|
+
|
|
12
14
|
import { ForeignKeys } from './ForeignKeys';
|
|
13
|
-
import { SPACE_PLUGIN } from '../../meta';
|
|
14
15
|
|
|
15
16
|
const initialValues = {
|
|
16
17
|
source: '',
|
|
@@ -22,7 +23,7 @@ export type AdvancedObjectSettingsProps = {
|
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
export const AdvancedObjectSettings = ({ object }: AdvancedObjectSettingsProps) => {
|
|
25
|
-
const { t } = useTranslation(
|
|
26
|
+
const { t } = useTranslation(meta.id);
|
|
26
27
|
const [adding, setAdding] = useState(false);
|
|
27
28
|
const { keys } = Obj.getMeta(object);
|
|
28
29
|
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type ForeignKey } from '@dxos/echo
|
|
7
|
+
import { type ForeignKey } from '@dxos/echo/internal';
|
|
8
8
|
import { IconButton, List, ListItem, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { meta } from '../../meta';
|
|
11
11
|
|
|
12
12
|
export type ForeignKeysProps = {
|
|
13
13
|
keys: ForeignKey[];
|
|
@@ -31,7 +31,7 @@ type KeyItemProps = {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
const KeyItem = ({ forignKey, onDelete }: KeyItemProps) => {
|
|
34
|
-
const { t } = useTranslation(
|
|
34
|
+
const { t } = useTranslation(meta.id);
|
|
35
35
|
|
|
36
36
|
const handleDelete = useCallback(() => {
|
|
37
37
|
onDelete?.(forignKey);
|
|
@@ -6,7 +6,7 @@ import React, { useMemo } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Surface } from '@dxos/app-framework';
|
|
8
8
|
import { type Obj } from '@dxos/echo';
|
|
9
|
-
import { Clipboard } from '@dxos/react-ui';
|
|
9
|
+
import { Clipboard, Toolbar } from '@dxos/react-ui';
|
|
10
10
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
11
11
|
|
|
12
12
|
import { BaseObjectSettings } from './BaseObjectSettings';
|
|
@@ -21,7 +21,8 @@ export const ObjectSettingsContainer = ({ object, role }: ObjectSettingsContaine
|
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
23
|
<Clipboard.Provider>
|
|
24
|
-
<StackItem.Content toolbar
|
|
24
|
+
<StackItem.Content toolbar>
|
|
25
|
+
<Toolbar.Root></Toolbar.Root>
|
|
25
26
|
<div role='none' className='overflow-y-auto pli-cardSpacingInline plb-cardSpacingBlock'>
|
|
26
27
|
<BaseObjectSettings object={object}>
|
|
27
28
|
<Surface role='base-object-settings' data={data} />
|
|
@@ -9,7 +9,7 @@ import { type EchoDatabase } from '@dxos/react-client/echo';
|
|
|
9
9
|
import { Icon, Tooltip, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { mx, staticPlaceholderText, warningText } from '@dxos/react-ui-theme';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { meta } from '../meta';
|
|
13
13
|
|
|
14
14
|
enum Status {
|
|
15
15
|
PERSISTED_LOCALLY = 0,
|
|
@@ -19,7 +19,7 @@ enum Status {
|
|
|
19
19
|
|
|
20
20
|
// TODO(zan): This now has no usages. Remove it?
|
|
21
21
|
export const PersistenceStatus = ({ db }: { db: EchoDatabase }) => {
|
|
22
|
-
const { t } = useTranslation(
|
|
22
|
+
const { t } = useTranslation(meta.id);
|
|
23
23
|
const [displayMessage, setDisplayMessage] = useState(false);
|
|
24
24
|
const [status, naturalSetStatus] = useState<Status>(Status.PERSISTED_LOCALLY);
|
|
25
25
|
const [prevStatus, setPrevStatus] = useState<Status>(Status.PERSISTED_LOCALLY);
|
|
@@ -4,33 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
8
9
|
import { type Live } from '@dxos/live-object';
|
|
9
10
|
import { log } from '@dxos/log';
|
|
10
11
|
import { Button, Input, useTranslation } from '@dxos/react-ui';
|
|
11
12
|
|
|
12
|
-
import {
|
|
13
|
+
import { meta } from '../meta';
|
|
13
14
|
|
|
14
|
-
export const POPOVER_RENAME_OBJECT = `${
|
|
15
|
+
export const POPOVER_RENAME_OBJECT = `${meta.id}/PopoverRenameObject`;
|
|
15
16
|
|
|
16
|
-
export const PopoverRenameObject = ({ object
|
|
17
|
-
const { t } = useTranslation(
|
|
17
|
+
export const PopoverRenameObject = ({ object }: { object: Live<any> }) => {
|
|
18
|
+
const { t } = useTranslation(meta.id);
|
|
18
19
|
const doneButton = useRef<HTMLButtonElement>(null);
|
|
19
|
-
|
|
20
|
-
const object = obj as any;
|
|
21
|
-
// TODO(burdon): Field should not be hardcoded field.
|
|
22
|
-
const [name, setName] = useState(object.name || object.title || '');
|
|
20
|
+
const [name, setName] = useState(Obj.getLabel(object));
|
|
23
21
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
24
22
|
|
|
25
23
|
const handleDone = useCallback(() => {
|
|
26
24
|
try {
|
|
27
|
-
|
|
25
|
+
name && Obj.setLabel(object, name);
|
|
28
26
|
} catch (err) {
|
|
29
|
-
|
|
30
|
-
object.title = name;
|
|
31
|
-
} catch {
|
|
32
|
-
log.error('Failed to rename object', { err });
|
|
33
|
-
}
|
|
27
|
+
log.error('Failed to rename object', { err });
|
|
34
28
|
}
|
|
35
29
|
void dispatch(
|
|
36
30
|
createIntent(LayoutAction.UpdatePopover, {
|