@dxos/plugin-space 0.8.4-main.84f28bd → 0.8.4-main.a4bbb77
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-AX7KKXWP.mjs +31 -0
- package/dist/lib/browser/CollectionMain-AX7KKXWP.mjs.map +7 -0
- package/dist/lib/browser/ObjectDetailsPanel-ETI5YBTH.mjs +90 -0
- package/dist/lib/browser/ObjectDetailsPanel-ETI5YBTH.mjs.map +7 -0
- package/dist/lib/browser/RecordMain-TEBGAVSL.mjs +68 -0
- package/dist/lib/browser/RecordMain-TEBGAVSL.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-PMDF6PJV.mjs → app-graph-builder-W7RVDAUA.mjs} +202 -48
- package/dist/lib/browser/app-graph-builder-W7RVDAUA.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-UKYMBX4O.mjs → app-graph-serializer-VLHVTDX4.mjs} +14 -14
- package/dist/lib/browser/app-graph-serializer-VLHVTDX4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GVTXQCIW.mjs → chunk-2BFVC5K6.mjs} +431 -373
- package/dist/lib/browser/chunk-2BFVC5K6.mjs.map +7 -0
- package/dist/lib/browser/chunk-E2I747A7.mjs +20 -0
- package/dist/lib/browser/chunk-E2I747A7.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-VLBRSGJ2.mjs → chunk-ELJDGQTO.mjs} +3 -3
- package/dist/lib/browser/{chunk-VLBRSGJ2.mjs.map → chunk-ELJDGQTO.mjs.map} +3 -3
- package/dist/lib/browser/chunk-IRKDREHY.mjs +11 -0
- package/dist/lib/browser/chunk-IRKDREHY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-S6NY637J.mjs → chunk-JCHSUOPF.mjs} +70 -10
- package/dist/lib/browser/chunk-JCHSUOPF.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WBSEOLEM.mjs → chunk-PN27K4I7.mjs} +209 -54
- package/dist/lib/browser/chunk-PN27K4I7.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6VLSHG4A.mjs → chunk-ZIZ2JLW6.mjs} +71 -9
- package/dist/lib/browser/chunk-ZIZ2JLW6.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 +95 -26
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-WK5WYFH3.mjs → intent-resolver-HA7DPAUE.mjs} +185 -30
- package/dist/lib/browser/intent-resolver-HA7DPAUE.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-7S6FIC5G.mjs → react-root-YQUJU64P.mjs} +11 -11
- package/dist/lib/browser/react-root-YQUJU64P.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-6C3YJNDK.mjs → react-surface-HTXYMRSW.mjs} +78 -46
- package/dist/lib/browser/react-surface-HTXYMRSW.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-K3B3OAH4.mjs → schema-defs-R56ZDBZ7.mjs} +5 -5
- package/dist/lib/browser/schema-defs-R56ZDBZ7.mjs.map +7 -0
- package/dist/lib/browser/{settings-XNWYRWNM.mjs → settings-5XPQMSPO.mjs} +5 -5
- package/dist/lib/browser/{settings-XNWYRWNM.mjs.map → settings-5XPQMSPO.mjs.map} +1 -1
- package/dist/lib/browser/{spaces-ready-K7NSNBHM.mjs → spaces-ready-YY77ANIF.mjs} +17 -15
- package/dist/lib/browser/spaces-ready-YY77ANIF.mjs.map +7 -0
- package/dist/lib/browser/{state-522XTUR4.mjs → state-Y4RVCG4A.mjs} +7 -7
- package/dist/lib/browser/state-Y4RVCG4A.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/CollectionMain-EU57SRYK.mjs +32 -0
- package/dist/lib/node-esm/CollectionMain-EU57SRYK.mjs.map +7 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-TQ5GN4QJ.mjs +91 -0
- package/dist/lib/node-esm/ObjectDetailsPanel-TQ5GN4QJ.mjs.map +7 -0
- package/dist/lib/node-esm/RecordMain-WLYJMYER.mjs +70 -0
- package/dist/lib/node-esm/RecordMain-WLYJMYER.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-TO72W6MI.mjs → app-graph-builder-5ZJJUMQI.mjs} +202 -48
- package/dist/lib/node-esm/app-graph-builder-5ZJJUMQI.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-LA3IZDXJ.mjs → app-graph-serializer-EZJSGJUT.mjs} +14 -14
- package/dist/lib/node-esm/app-graph-serializer-EZJSGJUT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SXD6T2N4.mjs → chunk-5XRYHWL7.mjs} +71 -9
- package/dist/lib/node-esm/chunk-5XRYHWL7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2THX6G4C.mjs → chunk-6WNZW6KT.mjs} +70 -10
- package/dist/lib/node-esm/chunk-6WNZW6KT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OUBADVJE.mjs → chunk-BLPXWPLB.mjs} +431 -373
- package/dist/lib/node-esm/chunk-BLPXWPLB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-IJVBBVCL.mjs +21 -0
- package/dist/lib/node-esm/chunk-IJVBBVCL.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-SSLBYZEY.mjs → chunk-Q6AAQLQG.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-SSLBYZEY.mjs.map → chunk-Q6AAQLQG.mjs.map} +3 -3
- 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-HJJHLWKY.mjs → chunk-XDQXUZMK.mjs} +209 -54
- package/dist/lib/node-esm/chunk-XDQXUZMK.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 +95 -26
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-HSR27ME4.mjs → intent-resolver-LQNHMPIX.mjs} +185 -30
- package/dist/lib/node-esm/intent-resolver-LQNHMPIX.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-HUK3ANLV.mjs → react-root-UTLJEIKE.mjs} +11 -11
- package/dist/lib/node-esm/react-root-UTLJEIKE.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-AGAWX7DD.mjs → react-surface-LYDYON3U.mjs} +78 -46
- package/dist/lib/node-esm/react-surface-LYDYON3U.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-4MCDG4DV.mjs → schema-defs-7IMJPIWS.mjs} +5 -5
- package/dist/lib/node-esm/schema-defs-7IMJPIWS.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-YGKHGFPH.mjs → settings-XBSK5KHH.mjs} +5 -5
- package/dist/lib/node-esm/{settings-YGKHGFPH.mjs.map → settings-XBSK5KHH.mjs.map} +1 -1
- package/dist/lib/node-esm/{spaces-ready-UM2P3DCR.mjs → spaces-ready-YX4IHT4P.mjs} +17 -15
- package/dist/lib/node-esm/spaces-ready-YX4IHT4P.mjs.map +7 -0
- package/dist/lib/node-esm/{state-C4IOXPZP.mjs → state-HOHAVPUO.mjs} +7 -7
- package/dist/lib/node-esm/state-HOHAVPUO.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 +11 -5
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +11 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts +2 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
- package/dist/types/src/components/CollectionMain.d.ts +1 -0
- package/dist/types/src/components/CollectionMain.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +5 -4
- 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/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/ObjectDetailsPanel.d.ts +9 -0
- package/dist/types/src/components/ObjectDetailsPanel.d.ts.map +1 -0
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/PersistenceStatus.d.ts.map +1 -1
- package/dist/types/src/components/PopoverRenameObject.d.ts +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 +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/SyncStatus/status.d.ts +5 -5
- package/dist/types/src/components/ViewEditor.d.ts +8 -0
- package/dist/types/src/components/ViewEditor.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +14 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -0
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/hooks/useActiveSpace.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1262 -11
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +124 -64
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +34 -7
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +61 -60
- package/src/SpacePlugin.ts +205 -137
- package/src/capabilities/app-graph-builder.ts +249 -36
- package/src/capabilities/app-graph-serializer.ts +7 -7
- package/src/capabilities/capabilities.ts +15 -9
- package/src/capabilities/identity-created.ts +1 -1
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +140 -19
- package/src/capabilities/react-root.tsx +4 -3
- package/src/capabilities/react-surface.tsx +93 -42
- package/src/capabilities/schema-defs.ts +3 -2
- package/src/capabilities/spaces-ready.ts +10 -7
- package/src/capabilities/state.ts +5 -4
- package/src/components/AwaitingObject.tsx +7 -9
- package/src/components/CollectionMain.tsx +4 -2
- package/src/components/CollectionSection.tsx +2 -2
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +11 -10
- package/src/components/CreateDialog/CreateObjectDialog.tsx +50 -36
- package/src/components/CreateDialog/CreateObjectPanel.tsx +22 -11
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +4 -4
- package/src/components/JoinDialog.tsx +7 -7
- package/src/components/MembersContainer.stories.tsx +36 -10
- package/src/components/MembersContainer.tsx +17 -16
- package/src/components/MenuFooter.tsx +4 -5
- package/src/components/ObjectDetailsPanel.tsx +79 -0
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +3 -2
- package/src/components/ObjectSettings/ForeignKeys.tsx +2 -2
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +3 -2
- package/src/components/PersistenceStatus.tsx +7 -8
- package/src/components/PopoverRenameObject.tsx +10 -16
- package/src/components/PopoverRenameSpace.tsx +4 -4
- package/src/components/RecordMain.tsx +43 -0
- package/src/components/SchemaContainer.tsx +4 -4
- package/src/components/SpacePluginSettings.tsx +8 -9
- package/src/components/SpacePresence.stories.tsx +23 -22
- package/src/components/SpacePresence.tsx +9 -9
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +17 -9
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +17 -17
- package/src/components/SyncStatus/InlineSyncStatus.tsx +2 -2
- package/src/components/SyncStatus/SyncStatus.stories.tsx +6 -7
- package/src/components/SyncStatus/SyncStatus.tsx +5 -4
- package/src/components/SyncStatus/status.ts +4 -4
- package/src/components/ViewEditor.tsx +59 -0
- package/src/components/index.ts +7 -1
- package/src/events.ts +7 -6
- package/src/hooks/useActiveSpace.ts +2 -2
- package/src/hooks/useInputSurfaceLookup.tsx +1 -1
- package/src/meta.ts +1 -3
- package/src/translations.ts +68 -5
- package/src/types/types.ts +70 -12
- package/src/util.tsx +199 -55
- package/dist/lib/browser/app-graph-builder-PMDF6PJV.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-UKYMBX4O.mjs.map +0 -7
- package/dist/lib/browser/chunk-6VLSHG4A.mjs.map +0 -7
- package/dist/lib/browser/chunk-C7KGJTAL.mjs +0 -18
- package/dist/lib/browser/chunk-C7KGJTAL.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-GVTXQCIW.mjs.map +0 -7
- package/dist/lib/browser/chunk-S6NY637J.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBSEOLEM.mjs.map +0 -7
- package/dist/lib/browser/chunk-XXIPJLJF.mjs +0 -19
- package/dist/lib/browser/chunk-XXIPJLJF.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-WK5WYFH3.mjs.map +0 -7
- package/dist/lib/browser/react-root-7S6FIC5G.mjs.map +0 -7
- package/dist/lib/browser/react-surface-6C3YJNDK.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-K3B3OAH4.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-K7NSNBHM.mjs.map +0 -7
- package/dist/lib/browser/state-522XTUR4.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-TO72W6MI.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-LA3IZDXJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2THX6G4C.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-72QMMRKC.mjs +0 -19
- package/dist/lib/node-esm/chunk-72QMMRKC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AT7LGFER.mjs +0 -20
- package/dist/lib/node-esm/chunk-AT7LGFER.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HJJHLWKY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HWNG4MEU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OUBADVJE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SXD6T2N4.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-HSR27ME4.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-HUK3ANLV.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-AGAWX7DD.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-4MCDG4DV.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-UM2P3DCR.mjs.map +0 -7
- package/dist/lib/node-esm/state-C4IOXPZP.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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { Option } from 'effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
8
8
|
import { SubscriptionList } from '@dxos/async';
|
|
9
9
|
import { Filter, Obj, Type } from '@dxos/echo';
|
|
10
10
|
import { scheduledEffect } from '@dxos/echo-signals/core';
|
|
@@ -14,13 +14,14 @@ import { ClientCapabilities } from '@dxos/plugin-client';
|
|
|
14
14
|
import { DeckCapabilities } from '@dxos/plugin-deck';
|
|
15
15
|
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
16
16
|
import { PublicKey } from '@dxos/react-client';
|
|
17
|
-
import { FQ_ID_LENGTH,
|
|
17
|
+
import { FQ_ID_LENGTH, SpaceState, parseFullyQualifiedId } from '@dxos/react-client/echo';
|
|
18
18
|
import { ComplexMap, reduceGroupBy } from '@dxos/util';
|
|
19
19
|
|
|
20
|
-
import { SpaceCapabilities } from './capabilities';
|
|
21
20
|
import { SpaceAction } from '../types';
|
|
22
21
|
import { COMPOSER_SPACE_LOCK, SHARED } from '../util';
|
|
23
22
|
|
|
23
|
+
import { SpaceCapabilities } from './capabilities';
|
|
24
|
+
|
|
24
25
|
const ACTIVE_NODE_BROADCAST_INTERVAL = 30_000;
|
|
25
26
|
const WAIT_FOR_OBJECT_TIMEOUT = 5_000;
|
|
26
27
|
|
|
@@ -66,12 +67,14 @@ export default async (context: PluginContext) => {
|
|
|
66
67
|
return;
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
const
|
|
70
|
-
|
|
70
|
+
const id = active[0];
|
|
71
|
+
const node = graph.getNode(id).pipe(Option.getOrNull);
|
|
72
|
+
if (!node && id.length === FQ_ID_LENGTH) {
|
|
73
|
+
void graph.initialize(id);
|
|
71
74
|
const timeout = setTimeout(async () => {
|
|
72
|
-
const node = graph.getNode(
|
|
75
|
+
const node = graph.getNode(id).pipe(Option.getOrNull);
|
|
73
76
|
if (!node) {
|
|
74
|
-
await dispatch(createIntent(SpaceAction.WaitForObject, { id
|
|
77
|
+
await dispatch(createIntent(SpaceAction.WaitForObject, { id }));
|
|
75
78
|
}
|
|
76
79
|
}, WAIT_FOR_OBJECT_TIMEOUT);
|
|
77
80
|
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
import { effect } from '@preact/signals-core';
|
|
6
6
|
|
|
7
|
-
import { Capabilities,
|
|
7
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
8
8
|
import { PublicKey } from '@dxos/keys';
|
|
9
9
|
import { LocalStorageStore } from '@dxos/local-storage';
|
|
10
10
|
import { ComplexMap } from '@dxos/util';
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
import { SPACE_PLUGIN } from '../meta';
|
|
12
|
+
import { meta } from '../meta';
|
|
14
13
|
import { type PluginState } from '../types';
|
|
15
14
|
|
|
15
|
+
import { SpaceCapabilities } from './capabilities';
|
|
16
|
+
|
|
16
17
|
export default (context: PluginContext) => {
|
|
17
|
-
const state = new LocalStorageStore<PluginState>(
|
|
18
|
+
const state = new LocalStorageStore<PluginState>(meta.id, {
|
|
18
19
|
awaiting: undefined,
|
|
19
20
|
spaceNames: {},
|
|
20
21
|
viewersByObject: {},
|
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { CheckCircle, CircleDashed, CircleNotch } from '@phosphor-icons/react';
|
|
6
5
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
7
6
|
|
|
8
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useIntentDispatcher, useLayout } from '@dxos/app-framework';
|
|
9
8
|
import { useClient } from '@dxos/react-client';
|
|
10
9
|
import { Filter, fullyQualifiedId, useQuery } from '@dxos/react-client/echo';
|
|
11
|
-
import { Button, Toast, useTranslation } from '@dxos/react-ui';
|
|
12
|
-
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
10
|
+
import { Button, Icon, Toast, useTranslation } from '@dxos/react-ui';
|
|
13
11
|
|
|
14
|
-
import {
|
|
12
|
+
import { meta } from '../meta';
|
|
15
13
|
import { SpaceAction } from '../types';
|
|
16
14
|
|
|
17
15
|
const WAIT_FOR_OBJECT_TIMEOUT = 180e3; // 3 minutes
|
|
@@ -21,7 +19,7 @@ export const AwaitingObject = ({ id }: { id: string }) => {
|
|
|
21
19
|
const [open, setOpen] = useState(true);
|
|
22
20
|
const [waiting, setWaiting] = useState(true);
|
|
23
21
|
const [found, setFound] = useState(false);
|
|
24
|
-
const { t } = useTranslation(
|
|
22
|
+
const { t } = useTranslation(meta.id);
|
|
25
23
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
26
24
|
const layout = useLayout();
|
|
27
25
|
|
|
@@ -66,17 +64,17 @@ export const AwaitingObject = ({ id }: { id: string }) => {
|
|
|
66
64
|
<Toast.Title classNames='flex items-center gap-2'>
|
|
67
65
|
{found ? (
|
|
68
66
|
<>
|
|
69
|
-
<
|
|
67
|
+
<Icon icon='ph--check-circle--regular' size={5} />
|
|
70
68
|
<span>{t('found object label')}</span>
|
|
71
69
|
</>
|
|
72
70
|
) : waiting ? (
|
|
73
71
|
<>
|
|
74
|
-
<
|
|
72
|
+
<Icon icon='ph--circle-notch--regular' size={5} classNames='animate-spin' />
|
|
75
73
|
<span>{t('waiting for object label')}</span>
|
|
76
74
|
</>
|
|
77
75
|
) : (
|
|
78
76
|
<>
|
|
79
|
-
<
|
|
77
|
+
<Icon icon='ph--circle-dashed--regular' size={5} />
|
|
80
78
|
<span>{t('object not found label')}</span>
|
|
81
79
|
</>
|
|
82
80
|
)}
|
|
@@ -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
|
|
@@ -28,3 +28,5 @@ export const CollectionMain = ({ collection }: { collection: DataType.Collection
|
|
|
28
28
|
</div>
|
|
29
29
|
);
|
|
30
30
|
};
|
|
31
|
+
|
|
32
|
+
export default CollectionMain;
|
|
@@ -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,7 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { pipe } from 'effect';
|
|
5
|
+
import { Effect, pipe } from 'effect';
|
|
6
6
|
import React, { useCallback, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import {
|
|
@@ -14,44 +14,53 @@ import {
|
|
|
14
14
|
useIntentDispatcher,
|
|
15
15
|
usePluginManager,
|
|
16
16
|
} from '@dxos/app-framework';
|
|
17
|
-
import { Query, Type
|
|
17
|
+
import { Obj, Query, Type } from '@dxos/echo';
|
|
18
18
|
import { invariant } from '@dxos/invariant';
|
|
19
19
|
import { useClient } from '@dxos/react-client';
|
|
20
|
-
import { getSpace, isLiveObject, isSpace,
|
|
20
|
+
import { type Space, getSpace, isLiveObject, isSpace, useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
21
21
|
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
22
22
|
import { cardDialogContent, cardDialogHeader } from '@dxos/react-ui-stack';
|
|
23
|
-
import { DataType } from '@dxos/schema';
|
|
23
|
+
import { DataType, typenameFromQuery } from '@dxos/schema';
|
|
24
24
|
import { isNonNullable } from '@dxos/util';
|
|
25
25
|
|
|
26
|
-
import { CreateObjectPanel, type CreateObjectPanelProps } from './CreateObjectPanel';
|
|
27
26
|
import { SpaceCapabilities } from '../../capabilities';
|
|
28
|
-
import {
|
|
27
|
+
import { meta } from '../../meta';
|
|
29
28
|
import { SpaceAction } from '../../types';
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
import { CreateObjectPanel, type CreateObjectPanelProps } from './CreateObjectPanel';
|
|
31
|
+
|
|
32
|
+
export const CREATE_OBJECT_DIALOG = `${meta.id}/CreateObjectDialog`;
|
|
32
33
|
|
|
33
|
-
export type CreateObjectDialogProps = Pick<
|
|
34
|
+
export type CreateObjectDialogProps = Pick<
|
|
35
|
+
CreateObjectPanelProps,
|
|
36
|
+
'target' | 'views' | 'typename' | 'initialFormValues'
|
|
37
|
+
> & {
|
|
38
|
+
onCreateObject?: (object: Obj.Any) => void;
|
|
34
39
|
shouldNavigate?: (object: Obj.Any) => boolean;
|
|
35
40
|
};
|
|
36
41
|
|
|
37
42
|
export const CreateObjectDialog = ({
|
|
38
43
|
target: initialTarget,
|
|
39
44
|
typename: initialTypename,
|
|
40
|
-
|
|
45
|
+
views,
|
|
46
|
+
initialFormValues,
|
|
47
|
+
onCreateObject,
|
|
41
48
|
shouldNavigate: _shouldNavigate,
|
|
42
49
|
}: CreateObjectDialogProps) => {
|
|
43
50
|
const closeRef = useRef<HTMLButtonElement | null>(null);
|
|
44
51
|
const manager = usePluginManager();
|
|
45
|
-
const { t } = useTranslation(
|
|
52
|
+
const { t } = useTranslation(meta.id);
|
|
46
53
|
const client = useClient();
|
|
47
54
|
const spaces = useSpaces();
|
|
48
|
-
const {
|
|
55
|
+
const { dispatch } = useIntentDispatcher();
|
|
49
56
|
const forms = useCapabilities(SpaceCapabilities.ObjectForm);
|
|
50
57
|
const [target, setTarget] = useState<Space | DataType.Collection | undefined>(initialTarget);
|
|
51
58
|
const [typename, setTypename] = useState<string | undefined>(initialTypename);
|
|
52
59
|
const space = isSpace(target) ? target : getSpace(target);
|
|
53
60
|
const queryCollections = useQuery(space, Query.type(DataType.QueryCollection));
|
|
54
|
-
const hiddenTypenames = queryCollections
|
|
61
|
+
const hiddenTypenames = queryCollections
|
|
62
|
+
.map((collection) => typenameFromQuery(collection.query))
|
|
63
|
+
.filter(isNonNullable);
|
|
55
64
|
|
|
56
65
|
const resolve = useCallback<NonNullable<CreateObjectPanelProps['resolve']>>(
|
|
57
66
|
(typename) =>
|
|
@@ -60,31 +69,33 @@ export const CreateObjectDialog = ({
|
|
|
60
69
|
);
|
|
61
70
|
|
|
62
71
|
const handleCreateObject = useCallback<NonNullable<CreateObjectPanelProps['onCreateObject']>>(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
({ form, data = {} }) =>
|
|
73
|
+
Effect.gen(function* () {
|
|
74
|
+
if (!target) {
|
|
75
|
+
// TODO(wittjosiah): UI feedback.
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// NOTE: Must close before navigating or attention won't follow object.
|
|
80
|
+
closeRef.current?.click();
|
|
68
81
|
|
|
69
|
-
|
|
70
|
-
|
|
82
|
+
const space = isSpace(target) ? target : getSpace(target);
|
|
83
|
+
invariant(space, 'Missing space');
|
|
84
|
+
const { object } = yield* dispatch(form.getIntent(data, { space }));
|
|
85
|
+
if (isLiveObject(object) && !Obj.instanceOf(DataType.StoredSchema, object)) {
|
|
86
|
+
// TODO(wittjosiah): Selection in navtree isn't working as expected when hidden typenames evals to true.
|
|
87
|
+
const hidden = form.hidden || hiddenTypenames.includes(Type.getTypename(form.objectSchema));
|
|
88
|
+
const addObjectIntent = createIntent(SpaceAction.AddObject, { target, object, hidden });
|
|
89
|
+
const shouldNavigate = _shouldNavigate ?? (() => true);
|
|
90
|
+
if (shouldNavigate(object)) {
|
|
91
|
+
yield* dispatch(pipe(addObjectIntent, chain(LayoutAction.Open, { part: 'main' })));
|
|
92
|
+
} else {
|
|
93
|
+
yield* dispatch(addObjectIntent);
|
|
94
|
+
}
|
|
71
95
|
|
|
72
|
-
|
|
73
|
-
invariant(space, 'Missing space');
|
|
74
|
-
const result = await dispatch(form.getIntent(data, { space }));
|
|
75
|
-
const object = result.data?.object;
|
|
76
|
-
if (isLiveObject(object)) {
|
|
77
|
-
// TODO(wittjosiah): Selection in navtree isn't working as expected when hidden typenames evals to true.
|
|
78
|
-
const hidden = form.hidden || hiddenTypenames.includes(Type.getTypename(form.objectSchema));
|
|
79
|
-
const addObjectIntent = createIntent(SpaceAction.AddObject, { target, object, hidden });
|
|
80
|
-
const shouldNavigate = _shouldNavigate ?? (() => true);
|
|
81
|
-
if (shouldNavigate(object)) {
|
|
82
|
-
await dispatch(pipe(addObjectIntent, chain(LayoutAction.Open, { part: 'main' })));
|
|
83
|
-
} else {
|
|
84
|
-
await dispatch(addObjectIntent);
|
|
96
|
+
onCreateObject?.(object);
|
|
85
97
|
}
|
|
86
|
-
}
|
|
87
|
-
},
|
|
98
|
+
}).pipe(Effect.runPromise),
|
|
88
99
|
[dispatch, target, resolve, hiddenTypenames, _shouldNavigate],
|
|
89
100
|
);
|
|
90
101
|
|
|
@@ -94,7 +105,9 @@ export const CreateObjectDialog = ({
|
|
|
94
105
|
<Dialog.Content classNames={cardDialogContent}>
|
|
95
106
|
<div role='none' className={cardDialogHeader}>
|
|
96
107
|
<Dialog.Title>
|
|
97
|
-
{t('create object dialog title', {
|
|
108
|
+
{t('create object dialog title', {
|
|
109
|
+
object: t('typename label', { ns: typename, defaultValue: views ? 'View' : 'Item' }),
|
|
110
|
+
})}
|
|
98
111
|
</Dialog.Title>
|
|
99
112
|
<Dialog.Close asChild>
|
|
100
113
|
<Button ref={closeRef} density='fine' variant='ghost' autoFocus>
|
|
@@ -107,8 +120,9 @@ export const CreateObjectDialog = ({
|
|
|
107
120
|
forms={forms}
|
|
108
121
|
spaces={spaces}
|
|
109
122
|
target={target}
|
|
123
|
+
views={views}
|
|
110
124
|
typename={typename}
|
|
111
|
-
|
|
125
|
+
initialFormValues={initialFormValues}
|
|
112
126
|
defaultSpaceId={client.spaces.default.id}
|
|
113
127
|
resolve={resolve}
|
|
114
128
|
onTargetChange={setTarget}
|
|
@@ -2,20 +2,21 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Option } from 'effect';
|
|
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-schema';
|
|
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}>
|
|
@@ -5,23 +5,23 @@
|
|
|
5
5
|
import { Effect, type Schema } from 'effect';
|
|
6
6
|
import React, { useCallback, useRef } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
9
|
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { Form } from '@dxos/react-ui-form';
|
|
11
11
|
import { cardDialogContent, cardDialogHeader } from '@dxos/react-ui-stack';
|
|
12
12
|
|
|
13
13
|
import { useInputSurfaceLookup } from '../../hooks';
|
|
14
|
-
import {
|
|
14
|
+
import { meta } from '../../meta';
|
|
15
15
|
import { SpaceAction, SpaceForm } from '../../types';
|
|
16
16
|
|
|
17
|
-
export const CREATE_SPACE_DIALOG = `${
|
|
17
|
+
export const CREATE_SPACE_DIALOG = `${meta.id}/CreateSpaceDialog`;
|
|
18
18
|
|
|
19
19
|
type FormValues = Schema.Schema.Type<typeof SpaceForm>;
|
|
20
20
|
const initialValues: FormValues = { edgeReplication: true };
|
|
21
21
|
|
|
22
22
|
export const CreateSpaceDialog = () => {
|
|
23
23
|
const closeRef = useRef<HTMLButtonElement | null>(null);
|
|
24
|
-
const { t } = useTranslation(
|
|
24
|
+
const { t } = useTranslation(meta.id);
|
|
25
25
|
const { dispatch } = useIntentDispatcher();
|
|
26
26
|
|
|
27
27
|
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 = {};
|