@dxos/plugin-space 0.8.4-main.dedc0f3 → 0.8.4-main.ead640a
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-MV535I2C.mjs +119 -0
- package/dist/lib/browser/RecordMain-MV535I2C.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-AFC6PNAB.mjs → app-graph-builder-6SNKPPKD.mjs} +61 -58
- package/dist/lib/browser/app-graph-builder-6SNKPPKD.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-Q7QG4EKW.mjs → app-graph-serializer-YGUHIKUW.mjs} +14 -14
- package/dist/lib/browser/app-graph-serializer-YGUHIKUW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WZYRDFW7.mjs → chunk-2IAM4LHT.mjs} +12 -4
- package/dist/lib/browser/chunk-2IAM4LHT.mjs.map +7 -0
- package/dist/lib/browser/{chunk-S33AYKSS.mjs → chunk-AB7EFWFA.mjs} +47 -38
- package/dist/lib/browser/chunk-AB7EFWFA.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-6GRF7NEF.mjs → chunk-KXSDZJ5T.mjs} +258 -289
- package/dist/lib/browser/chunk-KXSDZJ5T.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-TIVKWB5L.mjs +166 -0
- package/dist/lib/browser/chunk-TIVKWB5L.mjs.map +7 -0
- package/dist/lib/browser/{chunk-URST7EEN.mjs → chunk-WS2PJDES.mjs} +13 -9
- package/dist/lib/browser/chunk-WS2PJDES.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-T6ZNVE7S.mjs → identity-created-PW2BA46S.mjs} +3 -3
- package/dist/lib/browser/{identity-created-T6ZNVE7S.mjs.map → identity-created-PW2BA46S.mjs.map} +1 -1
- package/dist/lib/browser/index.mjs +34 -31
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-CO262Q44.mjs → intent-resolver-XQSUBM5U.mjs} +30 -28
- package/dist/lib/browser/intent-resolver-XQSUBM5U.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-K4IVLFYZ.mjs → react-root-OIXDY6US.mjs} +11 -11
- package/dist/lib/browser/react-root-OIXDY6US.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-TPUOK2LC.mjs → react-surface-I4BQVF7V.mjs} +42 -73
- package/dist/lib/browser/react-surface-I4BQVF7V.mjs.map +7 -0
- package/dist/lib/browser/{schema-defs-YDPFZELA.mjs → schema-defs-7R7RKCAE.mjs} +5 -5
- package/dist/lib/browser/{schema-defs-YDPFZELA.mjs.map → schema-defs-7R7RKCAE.mjs.map} +1 -1
- package/dist/lib/browser/{settings-ZYH2JWNI.mjs → settings-OBFJ67ZG.mjs} +5 -5
- package/dist/lib/browser/{settings-ZYH2JWNI.mjs.map → settings-OBFJ67ZG.mjs.map} +1 -1
- package/dist/lib/browser/{spaces-ready-3I5LISH4.mjs → spaces-ready-6YB55EJK.mjs} +8 -8
- package/dist/lib/browser/spaces-ready-6YB55EJK.mjs.map +7 -0
- package/dist/lib/browser/{state-2RGW7FQG.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-ME2BU65P.mjs +120 -0
- package/dist/lib/node-esm/RecordMain-ME2BU65P.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-OW2EBYRI.mjs → app-graph-builder-PYG5N3FB.mjs} +61 -58
- package/dist/lib/node-esm/app-graph-builder-PYG5N3FB.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-6PGC5WR5.mjs → app-graph-serializer-FVQ2WB3U.mjs} +14 -14
- package/dist/lib/node-esm/app-graph-serializer-FVQ2WB3U.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-RXDT5LA5.mjs → chunk-4F25JKVT.mjs} +13 -9
- package/dist/lib/node-esm/chunk-4F25JKVT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-LGNPMOXU.mjs → chunk-DNRBVD2G.mjs} +12 -4
- package/dist/lib/node-esm/chunk-DNRBVD2G.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GHL2523Z.mjs +167 -0
- package/dist/lib/node-esm/chunk-GHL2523Z.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-HWNG4MEU.mjs → chunk-MWNATOXL.mjs} +2 -4
- package/dist/lib/node-esm/chunk-MWNATOXL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-TEUN2E4F.mjs → chunk-QHAVT7PC.mjs} +47 -38
- package/dist/lib/node-esm/chunk-QHAVT7PC.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-NMCD2PSG.mjs → chunk-X55EOSEF.mjs} +258 -289
- package/dist/lib/node-esm/chunk-X55EOSEF.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-AL7NNCKH.mjs → identity-created-MWTLGQRU.mjs} +3 -3
- package/dist/lib/node-esm/{identity-created-AL7NNCKH.mjs.map → identity-created-MWTLGQRU.mjs.map} +1 -1
- package/dist/lib/node-esm/index.mjs +34 -31
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-EXPK4B76.mjs → intent-resolver-27YPEIWX.mjs} +30 -28
- package/dist/lib/node-esm/intent-resolver-27YPEIWX.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-4OQ7MPGW.mjs → react-root-K7YPW753.mjs} +11 -11
- package/dist/lib/node-esm/react-root-K7YPW753.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-WXEXIDB7.mjs → react-surface-F5LL3JUY.mjs} +42 -73
- package/dist/lib/node-esm/react-surface-F5LL3JUY.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-defs-OYBCWKAS.mjs → schema-defs-RYG5DSUE.mjs} +5 -5
- package/dist/lib/node-esm/{schema-defs-OYBCWKAS.mjs.map → schema-defs-RYG5DSUE.mjs.map} +1 -1
- package/dist/lib/node-esm/{settings-2RYFMMTP.mjs → settings-QGWWNMMZ.mjs} +5 -5
- package/dist/lib/node-esm/{settings-2RYFMMTP.mjs.map → settings-QGWWNMMZ.mjs.map} +1 -1
- package/dist/lib/node-esm/{spaces-ready-JAP22P57.mjs → spaces-ready-EPHL7RGX.mjs} +8 -8
- package/dist/lib/node-esm/spaces-ready-EPHL7RGX.mjs.map +7 -0
- package/dist/lib/node-esm/{state-7VBVBGNS.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.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +4 -3
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +80 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +1 -1
- 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.stories.d.ts +80 -1
- 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/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 +1500 -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/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 +1 -1
- 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 +1 -1
- package/dist/types/src/components/RecordMain.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +82 -3
- 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 +80 -1
- 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 +81 -2
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -4
- 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/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 +80 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +54 -52
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +6 -3
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +61 -59
- package/src/SpacePlugin.ts +206 -200
- package/src/capabilities/app-graph-builder.ts +53 -46
- package/src/capabilities/app-graph-serializer.ts +7 -7
- package/src/capabilities/capabilities.ts +15 -10
- package/src/capabilities/intent-resolver.ts +19 -19
- package/src/capabilities/react-root.tsx +2 -2
- package/src/capabilities/react-surface.tsx +31 -102
- package/src/capabilities/spaces-ready.ts +1 -1
- package/src/capabilities/state.ts +2 -2
- package/src/components/AwaitingObject.tsx +2 -2
- package/src/components/CollectionMain.tsx +2 -2
- package/src/components/CollectionSection.tsx +2 -2
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +5 -5
- package/src/components/CreateDialog/CreateObjectDialog.tsx +8 -7
- package/src/components/CreateDialog/CreateObjectPanel.tsx +6 -6
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +5 -4
- package/src/components/JoinDialog.tsx +6 -6
- package/src/components/MembersContainer.stories.tsx +6 -5
- package/src/components/MembersContainer.tsx +6 -6
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/{ObjectDetailsPanel.tsx → ObjectDetailsPanel/ObjectDetailsPanel.tsx} +9 -36
- package/src/components/ObjectDetailsPanel/ObjectForm.tsx +75 -0
- package/src/components/ObjectDetailsPanel/index.ts +7 -0
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +3 -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/index.ts +3 -1
- package/src/components/PersistenceStatus.tsx +2 -2
- package/src/components/PopoverRenameObject.tsx +3 -3
- package/src/components/PopoverRenameSpace.tsx +3 -3
- package/src/components/RecordMain.tsx +61 -9
- package/src/components/SchemaContainer.tsx +3 -3
- package/src/components/SpacePluginSettings.tsx +2 -2
- package/src/components/SpacePresence.stories.tsx +22 -24
- package/src/components/SpacePresence.tsx +3 -3
- package/src/components/SpaceSettings/SpaceSettingsContainer.stories.tsx +9 -4
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +13 -12
- package/src/components/SyncStatus/InlineSyncStatus.tsx +7 -7
- package/src/components/SyncStatus/SyncStatus.stories.tsx +4 -5
- package/src/components/SyncStatus/SyncStatus.tsx +92 -5
- package/src/components/ViewEditor.tsx +6 -7
- package/src/components/index.ts +1 -1
- package/src/events.ts +6 -6
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useInputSurfaceLookup.tsx +1 -1
- package/src/hooks/usePath.ts +1 -1
- package/src/hooks/useTypeOptions.ts +59 -0
- package/src/meta.ts +1 -3
- package/src/translations.ts +10 -1
- package/src/types/types.ts +11 -7
- package/src/util.tsx +46 -32
- package/dist/lib/browser/CollectionMain-D2B75XBS.mjs.map +0 -7
- package/dist/lib/browser/ObjectDetailsPanel-J7KGPJJK.mjs +0 -90
- package/dist/lib/browser/ObjectDetailsPanel-J7KGPJJK.mjs.map +0 -7
- package/dist/lib/browser/RecordMain-TEBGAVSL.mjs +0 -68
- package/dist/lib/browser/RecordMain-TEBGAVSL.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-AFC6PNAB.mjs.map +0 -7
- package/dist/lib/browser/app-graph-serializer-Q7QG4EKW.mjs.map +0 -7
- package/dist/lib/browser/chunk-6GRF7NEF.mjs.map +0 -7
- package/dist/lib/browser/chunk-CBYL62HG.mjs +0 -19
- package/dist/lib/browser/chunk-CBYL62HG.mjs.map +0 -7
- package/dist/lib/browser/chunk-ELJDGQTO.mjs +0 -94
- package/dist/lib/browser/chunk-ELJDGQTO.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-S33AYKSS.mjs.map +0 -7
- package/dist/lib/browser/chunk-TUQZO5P4.mjs +0 -20
- package/dist/lib/browser/chunk-TUQZO5P4.mjs.map +0 -7
- package/dist/lib/browser/chunk-URST7EEN.mjs.map +0 -7
- package/dist/lib/browser/chunk-WZYRDFW7.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-CO262Q44.mjs.map +0 -7
- package/dist/lib/browser/react-root-K4IVLFYZ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-TPUOK2LC.mjs.map +0 -7
- package/dist/lib/browser/spaces-ready-3I5LISH4.mjs.map +0 -7
- package/dist/lib/browser/state-2RGW7FQG.mjs.map +0 -7
- package/dist/lib/node-esm/CollectionMain-ZJIFCWKZ.mjs.map +0 -7
- package/dist/lib/node-esm/ObjectDetailsPanel-7ADOXZ5W.mjs +0 -91
- package/dist/lib/node-esm/ObjectDetailsPanel-7ADOXZ5W.mjs.map +0 -7
- package/dist/lib/node-esm/RecordMain-WLYJMYER.mjs +0 -70
- package/dist/lib/node-esm/RecordMain-WLYJMYER.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-OW2EBYRI.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-serializer-6PGC5WR5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FJZNSJC4.mjs +0 -20
- package/dist/lib/node-esm/chunk-FJZNSJC4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HC677WUJ.mjs +0 -21
- package/dist/lib/node-esm/chunk-HC677WUJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HWNG4MEU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LGNPMOXU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NMCD2PSG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Q6AAQLQG.mjs +0 -96
- package/dist/lib/node-esm/chunk-Q6AAQLQG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RXDT5LA5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TEUN2E4F.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-EXPK4B76.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-4OQ7MPGW.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-WXEXIDB7.mjs.map +0 -7
- package/dist/lib/node-esm/spaces-ready-JAP22P57.mjs.map +0 -7
- package/dist/lib/node-esm/state-7VBVBGNS.mjs.map +0 -7
- package/dist/types/src/components/ObjectDetailsPanel.d.ts +0 -9
- package/dist/types/src/components/ObjectDetailsPanel.d.ts.map +0 -1
|
@@ -2,23 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import React, { useCallback
|
|
5
|
+
import type * as Schema from 'effect/Schema';
|
|
6
|
+
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
Capabilities,
|
|
10
|
-
Surface,
|
|
11
|
-
contributes,
|
|
12
|
-
createSurface,
|
|
13
|
-
useCapabilities,
|
|
14
|
-
useCapability,
|
|
15
|
-
useLayout,
|
|
16
|
-
} from '@dxos/app-framework';
|
|
8
|
+
import { Capabilities, Surface, contributes, createSurface, useCapability, useLayout } from '@dxos/app-framework';
|
|
17
9
|
import { Obj, Type } from '@dxos/echo';
|
|
18
10
|
import { findAnnotation } from '@dxos/effect';
|
|
19
11
|
import { SettingsStore } from '@dxos/local-storage';
|
|
20
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
21
|
-
import { useClient } from '@dxos/react-client';
|
|
22
12
|
import {
|
|
23
13
|
type Space,
|
|
24
14
|
SpaceState,
|
|
@@ -29,7 +19,7 @@ import {
|
|
|
29
19
|
parseId,
|
|
30
20
|
useSpace,
|
|
31
21
|
} from '@dxos/react-client/echo';
|
|
32
|
-
import { Input
|
|
22
|
+
import { Input } from '@dxos/react-ui';
|
|
33
23
|
import { type InputProps, SelectInput } from '@dxos/react-ui-form';
|
|
34
24
|
import { HuePicker, IconPicker } from '@dxos/react-ui-pickers';
|
|
35
25
|
import { DataType, type TypenameAnnotation, TypenameAnnotationId } from '@dxos/schema';
|
|
@@ -63,7 +53,8 @@ import {
|
|
|
63
53
|
SyncStatus,
|
|
64
54
|
ViewEditor,
|
|
65
55
|
} from '../components';
|
|
66
|
-
import {
|
|
56
|
+
import { useTypeOptions } from '../hooks';
|
|
57
|
+
import { meta } from '../meta';
|
|
67
58
|
import { HueAnnotationId, IconAnnotationId, type SpaceSettingsProps } from '../types';
|
|
68
59
|
|
|
69
60
|
import { SpaceCapabilities } from './capabilities';
|
|
@@ -77,7 +68,7 @@ const OMIT = [DataType.Collection.typename, Type.getTypename(DataType.QueryColle
|
|
|
77
68
|
export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
78
69
|
contributes(Capabilities.ReactSurface, [
|
|
79
70
|
createSurface({
|
|
80
|
-
id: `${
|
|
71
|
+
id: `${meta.id}/article`,
|
|
81
72
|
role: 'article',
|
|
82
73
|
filter: (data): data is { subject: Space } =>
|
|
83
74
|
// TODO(wittjosiah): Need to avoid shotgun parsing space state everywhere.
|
|
@@ -94,36 +85,36 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
94
85
|
),
|
|
95
86
|
}),
|
|
96
87
|
createSurface({
|
|
97
|
-
id: `${
|
|
88
|
+
id: `${meta.id}/record-article`,
|
|
98
89
|
role: 'article',
|
|
99
90
|
position: 'fallback',
|
|
100
91
|
filter: (data): data is { subject: Obj.Any } => Obj.isObject(data.subject),
|
|
101
92
|
component: ({ data }) => <RecordMain record={data.subject} />,
|
|
102
93
|
}),
|
|
103
94
|
createSurface({
|
|
104
|
-
id: `${
|
|
95
|
+
id: `${meta.id}/collection-fallback`,
|
|
105
96
|
role: 'article',
|
|
106
97
|
position: 'fallback',
|
|
107
98
|
filter: (data): data is { subject: DataType.Collection } => Obj.instanceOf(DataType.Collection, data.subject),
|
|
108
99
|
component: ({ data }) => <CollectionMain collection={data.subject} />,
|
|
109
100
|
}),
|
|
110
101
|
createSurface({
|
|
111
|
-
id: `${
|
|
102
|
+
id: `${meta.id}/plugin-settings`,
|
|
112
103
|
role: 'article',
|
|
113
104
|
filter: (data): data is { subject: SettingsStore<SpaceSettingsProps> } =>
|
|
114
|
-
data.subject instanceof SettingsStore && data.subject.prefix ===
|
|
105
|
+
data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
115
106
|
component: ({ data: { subject } }) => <SpacePluginSettings settings={subject.value} />,
|
|
116
107
|
}),
|
|
117
108
|
createSurface({
|
|
118
|
-
id: `${
|
|
109
|
+
id: `${meta.id}/companion/object-settings`,
|
|
119
110
|
role: 'article',
|
|
120
111
|
filter: (data): data is { companionTo: Obj.Any } => Obj.isObject(data.companionTo) && data.subject === 'settings',
|
|
121
112
|
component: ({ data, role }) => <ObjectSettingsContainer object={data.companionTo} role={role} />,
|
|
122
113
|
}),
|
|
123
114
|
createSurface({
|
|
124
|
-
id: `${
|
|
115
|
+
id: `${meta.id}/space-settings-properties`,
|
|
125
116
|
role: 'article',
|
|
126
|
-
filter: (data): data is { subject: string } => data.subject === `${
|
|
117
|
+
filter: (data): data is { subject: string } => data.subject === `${meta.id}/properties`,
|
|
127
118
|
component: () => {
|
|
128
119
|
const layout = useLayout();
|
|
129
120
|
const { spaceId } = parseId(layout.workspace);
|
|
@@ -136,10 +127,10 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
136
127
|
},
|
|
137
128
|
}),
|
|
138
129
|
createSurface({
|
|
139
|
-
id: `${
|
|
130
|
+
id: `${meta.id}/space-settings-members`,
|
|
140
131
|
role: 'article',
|
|
141
132
|
position: 'hoist',
|
|
142
|
-
filter: (data): data is { subject: string } => data.subject === `${
|
|
133
|
+
filter: (data): data is { subject: string } => data.subject === `${meta.id}/members`,
|
|
143
134
|
component: () => {
|
|
144
135
|
const layout = useLayout();
|
|
145
136
|
const { spaceId } = parseId(layout.workspace);
|
|
@@ -152,9 +143,9 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
152
143
|
},
|
|
153
144
|
}),
|
|
154
145
|
createSurface({
|
|
155
|
-
id: `${
|
|
146
|
+
id: `${meta.id}/space-settings-schema`,
|
|
156
147
|
role: 'article',
|
|
157
|
-
filter: (data): data is { subject: string } => data.subject === `${
|
|
148
|
+
filter: (data): data is { subject: string } => data.subject === `${meta.id}/schema`,
|
|
158
149
|
component: () => {
|
|
159
150
|
const layout = useLayout();
|
|
160
151
|
const { spaceId } = parseId(layout.workspace);
|
|
@@ -167,7 +158,7 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
167
158
|
},
|
|
168
159
|
}),
|
|
169
160
|
createSurface({
|
|
170
|
-
id: `${
|
|
161
|
+
id: `${meta.id}/selected-objects`,
|
|
171
162
|
role: 'article',
|
|
172
163
|
filter: (data): data is { companionTo: DataType.View; subject: 'selected-objects' } =>
|
|
173
164
|
Obj.instanceOf(DataType.View, data.companionTo) && data.subject === 'selected-objects',
|
|
@@ -198,7 +189,7 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
198
189
|
component: ({ data }) => <CreateObjectDialog {...data.props} />,
|
|
199
190
|
}),
|
|
200
191
|
createSurface({
|
|
201
|
-
id: `${
|
|
192
|
+
id: `${meta.id}/create-initial-space-form-[hue]`,
|
|
202
193
|
role: 'form-input',
|
|
203
194
|
filter: (data): data is { prop: string; schema: Schema.Schema<any> } => {
|
|
204
195
|
const annotation = findAnnotation<boolean>((data.schema as Schema.Schema.All).ast, HueAnnotationId);
|
|
@@ -217,7 +208,7 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
217
208
|
},
|
|
218
209
|
}),
|
|
219
210
|
createSurface({
|
|
220
|
-
id: `${
|
|
211
|
+
id: `${meta.id}/create-initial-space-form-[icon]`,
|
|
221
212
|
role: 'form-input',
|
|
222
213
|
filter: (data): data is { prop: string; schema: Schema.Schema<any> } => {
|
|
223
214
|
const annotation = findAnnotation<boolean>((data.schema as Schema.Schema.All).ast, IconAnnotationId);
|
|
@@ -236,7 +227,7 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
236
227
|
},
|
|
237
228
|
}),
|
|
238
229
|
createSurface({
|
|
239
|
-
id: `${
|
|
230
|
+
id: `${meta.id}/typename-form-input`,
|
|
240
231
|
role: 'form-input',
|
|
241
232
|
filter: (
|
|
242
233
|
data,
|
|
@@ -249,78 +240,16 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
249
240
|
return !!annotation;
|
|
250
241
|
},
|
|
251
242
|
component: ({ data: { schema, target }, ...inputProps }) => {
|
|
252
|
-
const { t } = useTranslation();
|
|
253
|
-
const client = useClient();
|
|
254
243
|
const props = inputProps as any as InputProps;
|
|
255
244
|
const space = isSpace(target) ? target : getSpace(target);
|
|
256
|
-
if (!space) {
|
|
257
|
-
return null;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
245
|
const annotation = findAnnotation<TypenameAnnotation[]>(schema.ast, TypenameAnnotationId)!;
|
|
261
|
-
|
|
262
|
-
const schemaWhitelists = useCapabilities(ClientCapabilities.SchemaWhiteList);
|
|
263
|
-
const whitelistedTypenames = useMemo(
|
|
264
|
-
() => new Set(schemaWhitelists.flatMap((typeArray) => typeArray.map((type) => Type.getTypename(type)))),
|
|
265
|
-
[schemaWhitelists],
|
|
266
|
-
);
|
|
267
|
-
|
|
268
|
-
const objectForms = useCapabilities(SpaceCapabilities.ObjectForm);
|
|
269
|
-
const objectFormTypenames = useMemo(
|
|
270
|
-
() =>
|
|
271
|
-
new Set(
|
|
272
|
-
objectForms
|
|
273
|
-
.map((form) => Type.getTypename(form.objectSchema))
|
|
274
|
-
// TODO(wittjosiah): Remove.
|
|
275
|
-
.filter((typename) => !OMIT.includes(typename) && !typename.endsWith('View')),
|
|
276
|
-
),
|
|
277
|
-
[objectForms],
|
|
278
|
-
);
|
|
279
|
-
|
|
280
|
-
const fixed = client.graph.schemaRegistry.schemas.filter((schema) => {
|
|
281
|
-
const limitedStatic =
|
|
282
|
-
annotation.includes('limited-static') && whitelistedTypenames.has(Type.getTypename(schema));
|
|
283
|
-
const unusedStatic =
|
|
284
|
-
annotation.includes('unused-static') &&
|
|
285
|
-
whitelistedTypenames.has(Type.getTypename(schema)) &&
|
|
286
|
-
!space.properties.staticRecords?.includes(Type.getTypename(schema));
|
|
287
|
-
const usedStatic =
|
|
288
|
-
annotation.includes('used-static') &&
|
|
289
|
-
whitelistedTypenames.has(Type.getTypename(schema)) &&
|
|
290
|
-
space.properties.staticRecords?.includes(Type.getTypename(schema));
|
|
291
|
-
const objectForm = annotation.includes('object-form') && objectFormTypenames.has(Type.getTypename(schema));
|
|
292
|
-
return annotation.includes('static') || limitedStatic || unusedStatic || usedStatic || objectForm;
|
|
293
|
-
});
|
|
294
|
-
const dynamic = space?.db.schemaRegistry.query().runSync();
|
|
295
|
-
const typenames = Array.from(
|
|
296
|
-
new Set<string>([
|
|
297
|
-
...(annotation.includes('limited-static') ||
|
|
298
|
-
annotation.includes('unused-static') ||
|
|
299
|
-
annotation.includes('used-static') ||
|
|
300
|
-
annotation.includes('static') ||
|
|
301
|
-
annotation.includes('object-form')
|
|
302
|
-
? fixed.map((schema) => Type.getTypename(schema))
|
|
303
|
-
: []),
|
|
304
|
-
...(annotation.includes('dynamic') ? dynamic.map((schema) => schema.typename) : []),
|
|
305
|
-
]),
|
|
306
|
-
).sort();
|
|
307
|
-
|
|
308
|
-
const options = useMemo(
|
|
309
|
-
() =>
|
|
310
|
-
typenames
|
|
311
|
-
.map((typename) => ({
|
|
312
|
-
value: typename,
|
|
313
|
-
label: t('typename label', { ns: typename, defaultValue: typename }),
|
|
314
|
-
}))
|
|
315
|
-
.toSorted((a, b) => a.label.localeCompare(b.label)),
|
|
316
|
-
[t, typenames],
|
|
317
|
-
);
|
|
246
|
+
const options = useTypeOptions({ space, annotation });
|
|
318
247
|
|
|
319
248
|
return <SelectInput {...props} options={options} />;
|
|
320
249
|
},
|
|
321
250
|
}),
|
|
322
251
|
createSurface({
|
|
323
|
-
id: `${
|
|
252
|
+
id: `${meta.id}/object-settings`,
|
|
324
253
|
role: 'object-settings',
|
|
325
254
|
filter: (data): data is { subject: DataType.View } => Obj.instanceOf(DataType.View, data.subject),
|
|
326
255
|
component: ({ data }) => <ViewEditor view={data.subject} />,
|
|
@@ -339,13 +268,13 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
339
268
|
component: ({ data }) => <PopoverRenameObject object={data.props} />,
|
|
340
269
|
}),
|
|
341
270
|
createSurface({
|
|
342
|
-
id: `${
|
|
271
|
+
id: `${meta.id}/menu-footer`,
|
|
343
272
|
role: 'menu-footer',
|
|
344
273
|
filter: (data): data is { subject: Obj.Any } => Obj.isObject(data.subject),
|
|
345
274
|
component: ({ data }) => <MenuFooter object={data.subject} />,
|
|
346
275
|
}),
|
|
347
276
|
createSurface({
|
|
348
|
-
id: `${
|
|
277
|
+
id: `${meta.id}/navtree-presence`,
|
|
349
278
|
role: 'navtree-item-end',
|
|
350
279
|
filter: (data): data is { id: string; subject: Obj.Any; open?: boolean } =>
|
|
351
280
|
typeof data.id === 'string' && Obj.isObject(data.subject),
|
|
@@ -357,7 +286,7 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
357
286
|
}),
|
|
358
287
|
// TODO(wittjosiah): Attention glyph for non-echo items should be handled elsewhere.
|
|
359
288
|
createSurface({
|
|
360
|
-
id: `${
|
|
289
|
+
id: `${meta.id}/navtree-presence-fallback`,
|
|
361
290
|
role: 'navtree-item-end',
|
|
362
291
|
position: 'fallback',
|
|
363
292
|
filter: (data): data is { id: string; open?: boolean } => typeof data.id === 'string',
|
|
@@ -365,13 +294,13 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
365
294
|
}),
|
|
366
295
|
// TODO(wittjosiah): Broken?
|
|
367
296
|
createSurface({
|
|
368
|
-
id: `${
|
|
297
|
+
id: `${meta.id}/navtree-sync-status`,
|
|
369
298
|
role: 'navtree-item-end',
|
|
370
299
|
filter: (data): data is { subject: Space; open?: boolean } => isSpace(data.subject),
|
|
371
300
|
component: ({ data }) => <InlineSyncStatus space={data.subject} open={data.open} />,
|
|
372
301
|
}),
|
|
373
302
|
createSurface({
|
|
374
|
-
id: `${
|
|
303
|
+
id: `${meta.id}/navbar-presence`,
|
|
375
304
|
role: 'navbar-end',
|
|
376
305
|
position: 'hoist',
|
|
377
306
|
filter: (data): data is { subject: Space | Obj.Any } => isSpace(data.subject) || Obj.isObject(data.subject),
|
|
@@ -387,13 +316,13 @@ export default ({ createInvitationUrl }: ReactSurfaceOptions) =>
|
|
|
387
316
|
},
|
|
388
317
|
}),
|
|
389
318
|
createSurface({
|
|
390
|
-
id: `${
|
|
319
|
+
id: `${meta.id}/collection-section`,
|
|
391
320
|
role: 'section',
|
|
392
321
|
filter: (data): data is { subject: DataType.Collection } => Obj.instanceOf(DataType.Collection, data.subject),
|
|
393
322
|
component: ({ data }) => <CollectionSection collection={data.subject} />,
|
|
394
323
|
}),
|
|
395
324
|
createSurface({
|
|
396
|
-
id: `${
|
|
325
|
+
id: `${meta.id}/status`,
|
|
397
326
|
role: 'status',
|
|
398
327
|
component: () => <SyncStatus />,
|
|
399
328
|
}),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Option from 'effect/Option';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
8
8
|
import { SubscriptionList } from '@dxos/async';
|
|
@@ -9,13 +9,13 @@ import { PublicKey } from '@dxos/keys';
|
|
|
9
9
|
import { LocalStorageStore } from '@dxos/local-storage';
|
|
10
10
|
import { ComplexMap } from '@dxos/util';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { meta } from '../meta';
|
|
13
13
|
import { type PluginState } from '../types';
|
|
14
14
|
|
|
15
15
|
import { SpaceCapabilities } from './capabilities';
|
|
16
16
|
|
|
17
17
|
export default (context: PluginContext) => {
|
|
18
|
-
const state = new LocalStorageStore<PluginState>(
|
|
18
|
+
const state = new LocalStorageStore<PluginState>(meta.id, {
|
|
19
19
|
awaiting: undefined,
|
|
20
20
|
spaceNames: {},
|
|
21
21
|
viewersByObject: {},
|
|
@@ -9,7 +9,7 @@ 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,18 +2,18 @@
|
|
|
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
18
|
import { translations } from '../../translations';
|
|
19
19
|
|
|
@@ -35,9 +35,9 @@ const meta = {
|
|
|
35
35
|
component: CreateObjectDialog,
|
|
36
36
|
render: Story,
|
|
37
37
|
decorators: [
|
|
38
|
+
withTheme, // TODO(wittjosiah): Try to write story which does not depend on plugin manager.
|
|
39
|
+
withPluginManager({ plugins: [IntentPlugin()] }),
|
|
38
40
|
withClientProvider({ createIdentity: true, createSpace: true, types: [DataType.Collection] }),
|
|
39
|
-
withTheme,
|
|
40
|
-
withLayout(),
|
|
41
41
|
],
|
|
42
42
|
parameters: {
|
|
43
43
|
translations: [...translations, ...shellTranslations],
|
|
@@ -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 {
|
|
@@ -20,16 +21,16 @@ import { useClient } from '@dxos/react-client';
|
|
|
20
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,
|
|
24
|
+
import { DataType, getTypenameFromQuery } from '@dxos/schema';
|
|
24
25
|
import { isNonNullable } from '@dxos/util';
|
|
25
26
|
|
|
26
27
|
import { SpaceCapabilities } from '../../capabilities';
|
|
27
|
-
import {
|
|
28
|
+
import { meta } from '../../meta';
|
|
28
29
|
import { SpaceAction } from '../../types';
|
|
29
30
|
|
|
30
31
|
import { CreateObjectPanel, type CreateObjectPanelProps } from './CreateObjectPanel';
|
|
31
32
|
|
|
32
|
-
export const CREATE_OBJECT_DIALOG = `${
|
|
33
|
+
export const CREATE_OBJECT_DIALOG = `${meta.id}/CreateObjectDialog`;
|
|
33
34
|
|
|
34
35
|
export type CreateObjectDialogProps = Pick<
|
|
35
36
|
CreateObjectPanelProps,
|
|
@@ -49,7 +50,7 @@ export const CreateObjectDialog = ({
|
|
|
49
50
|
}: CreateObjectDialogProps) => {
|
|
50
51
|
const closeRef = useRef<HTMLButtonElement | null>(null);
|
|
51
52
|
const manager = usePluginManager();
|
|
52
|
-
const { t } = useTranslation(
|
|
53
|
+
const { t } = useTranslation(meta.id);
|
|
53
54
|
const client = useClient();
|
|
54
55
|
const spaces = useSpaces();
|
|
55
56
|
const { dispatch } = useIntentDispatcher();
|
|
@@ -59,7 +60,7 @@ export const CreateObjectDialog = ({
|
|
|
59
60
|
const space = isSpace(target) ? target : getSpace(target);
|
|
60
61
|
const queryCollections = useQuery(space, Query.type(DataType.QueryCollection));
|
|
61
62
|
const hiddenTypenames = queryCollections
|
|
62
|
-
.map((collection) =>
|
|
63
|
+
.map((collection) => getTypenameFromQuery(collection.query))
|
|
63
64
|
.filter(isNonNullable);
|
|
64
65
|
|
|
65
66
|
const resolve = useCallback<NonNullable<CreateObjectPanelProps['resolve']>>(
|
|
@@ -88,7 +89,7 @@ export const CreateObjectDialog = ({
|
|
|
88
89
|
const addObjectIntent = createIntent(SpaceAction.AddObject, { target, object, hidden });
|
|
89
90
|
const shouldNavigate = _shouldNavigate ?? (() => true);
|
|
90
91
|
if (shouldNavigate(object)) {
|
|
91
|
-
yield* dispatch(pipe(addObjectIntent, chain(LayoutAction.Open, { part: 'main' })));
|
|
92
|
+
yield* dispatch(Function.pipe(addObjectIntent, chain(LayoutAction.Open, { part: 'main' })));
|
|
92
93
|
} else {
|
|
93
94
|
yield* dispatch(addObjectIntent);
|
|
94
95
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Option from 'effect/Option';
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Type } from '@dxos/echo';
|
|
9
|
-
import { type BaseObject, type TypeAnnotation, ViewAnnotation, getTypeAnnotation } from '@dxos/echo
|
|
9
|
+
import { type BaseObject, type TypeAnnotation, ViewAnnotation, getTypeAnnotation } from '@dxos/echo/internal';
|
|
10
10
|
import { type Space, type SpaceId } from '@dxos/react-client/echo';
|
|
11
11
|
import { Icon, toLocalizedString, useDefaultValue, useTranslation } from '@dxos/react-ui';
|
|
12
12
|
import { Form } from '@dxos/react-ui-form';
|
|
@@ -16,7 +16,7 @@ import { type DataType } from '@dxos/schema';
|
|
|
16
16
|
import { type MaybePromise, isNonNullable } from '@dxos/util';
|
|
17
17
|
|
|
18
18
|
import { useInputSurfaceLookup } from '../../hooks';
|
|
19
|
-
import {
|
|
19
|
+
import { meta } from '../../meta';
|
|
20
20
|
import { type ObjectForm } from '../../types';
|
|
21
21
|
import { getSpaceDisplayName } from '../../util';
|
|
22
22
|
|
|
@@ -47,7 +47,7 @@ export const CreateObjectPanel = ({
|
|
|
47
47
|
onTypenameChange,
|
|
48
48
|
onCreateObject,
|
|
49
49
|
}: CreateObjectPanelProps) => {
|
|
50
|
-
const { t } = useTranslation(
|
|
50
|
+
const { t } = useTranslation(meta.id);
|
|
51
51
|
const initialFormValues = useDefaultValue(_initialFormValues, () => ({}));
|
|
52
52
|
const form = forms.find((form) => Type.getTypename(form.objectSchema) === typename);
|
|
53
53
|
const options: TypeAnnotation[] = forms
|
|
@@ -115,7 +115,7 @@ const SelectSpace = ({
|
|
|
115
115
|
defaultSpaceId,
|
|
116
116
|
onChange,
|
|
117
117
|
}: { onChange?: (space: Space) => void } & Pick<CreateObjectPanelProps, 'spaces' | 'defaultSpaceId'>) => {
|
|
118
|
-
const { t } = useTranslation(
|
|
118
|
+
const { t } = useTranslation(meta.id);
|
|
119
119
|
|
|
120
120
|
return (
|
|
121
121
|
<SearchList.Root label={t('space input label')} classNames={cardDialogSearchListRoot}>
|
|
@@ -156,7 +156,7 @@ const SelectSchema = ({
|
|
|
156
156
|
options: TypeAnnotation[];
|
|
157
157
|
onChange: (type: string) => void;
|
|
158
158
|
} & Pick<CreateObjectPanelProps, 'resolve'>) => {
|
|
159
|
-
const { t } = useTranslation(
|
|
159
|
+
const { t } = useTranslation(meta.id);
|
|
160
160
|
|
|
161
161
|
return (
|
|
162
162
|
<SearchList.Root label={t('schema input label')} classNames={cardDialogSearchListRoot}>
|
|
@@ -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 type * as Schema from 'effect/Schema';
|
|
6
7
|
import React, { useCallback, useRef } from 'react';
|
|
7
8
|
|
|
8
9
|
import { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
@@ -11,17 +12,17 @@ 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();
|
|
@@ -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,15 +2,16 @@
|
|
|
2
2
|
// Copyright 2023 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 from 'react';
|
|
9
7
|
|
|
8
|
+
import { IntentPlugin } from '@dxos/app-framework';
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { useSpace } from '@dxos/react-client/echo';
|
|
11
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
12
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
12
13
|
import { translations as shellTranslations } from '@dxos/shell/react';
|
|
13
|
-
import { render
|
|
14
|
+
import { render } from '@dxos/storybook-utils';
|
|
14
15
|
|
|
15
16
|
import { translations } from '../translations';
|
|
16
17
|
|
|
@@ -35,12 +36,12 @@ const meta = {
|
|
|
35
36
|
component: MembersContainer as any,
|
|
36
37
|
render: render(DefaultStory),
|
|
37
38
|
decorators: [
|
|
39
|
+
withTheme, // TODO(wittjosiah): Try to write story which does not depend on plugin manager.
|
|
40
|
+
withPluginManager({ plugins: [IntentPlugin()] }),
|
|
38
41
|
withClientProvider({
|
|
39
42
|
createIdentity: true,
|
|
40
43
|
createSpace: true,
|
|
41
44
|
}),
|
|
42
|
-
withTheme,
|
|
43
|
-
withLayout(),
|
|
44
45
|
],
|
|
45
46
|
parameters: {
|
|
46
47
|
layout: 'fullscreen',
|
|
@@ -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
|
|
|
@@ -47,7 +47,7 @@ export type MembersContainerProps = {
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
export const MembersContainer = ({ space, createInvitationUrl }: MembersContainerProps) => {
|
|
50
|
-
const { t } = useTranslation(
|
|
50
|
+
const { t } = useTranslation(meta.id);
|
|
51
51
|
const config = useConfig();
|
|
52
52
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
53
53
|
const invitations = useSpaceInvitations(space.key);
|
|
@@ -75,7 +75,7 @@ export const MembersContainer = ({ space, createInvitationUrl }: MembersContaine
|
|
|
75
75
|
inviteOne: {
|
|
76
76
|
label: t('invite one label', { ns: 'os' }),
|
|
77
77
|
description: t('invite one description', { ns: 'os' }),
|
|
78
|
-
icon:
|
|
78
|
+
icon: 'ph--user-plus--regular',
|
|
79
79
|
testId: 'membersContainer.inviteOne',
|
|
80
80
|
onClick: async () => {
|
|
81
81
|
const { data: invitation } = await dispatch(
|
|
@@ -97,7 +97,7 @@ export const MembersContainer = ({ space, createInvitationUrl }: MembersContaine
|
|
|
97
97
|
inviteMany: {
|
|
98
98
|
label: t('invite many label', { ns: 'os' }),
|
|
99
99
|
description: t('invite many description', { ns: 'os' }),
|
|
100
|
-
icon:
|
|
100
|
+
icon: 'ph--users-three--regular',
|
|
101
101
|
testId: 'membersContainer.inviteMany',
|
|
102
102
|
onClick: async () => {
|
|
103
103
|
const { data: invitation } = await dispatch(
|
|
@@ -130,7 +130,7 @@ export const MembersContainer = ({ space, createInvitationUrl }: MembersContaine
|
|
|
130
130
|
|
|
131
131
|
return (
|
|
132
132
|
<Clipboard.Provider>
|
|
133
|
-
<StackItem.Content
|
|
133
|
+
<StackItem.Content scrollable>
|
|
134
134
|
<ControlPage>
|
|
135
135
|
<ControlSection title={t('members verbose label')} description={t('members description')}>
|
|
136
136
|
<ControlFrame>
|
|
@@ -230,7 +230,7 @@ const InvitationQR = ({ id, url, onCancel }: { id: string; url: string; onCancel
|
|
|
230
230
|
const emoji = hexToEmoji(id);
|
|
231
231
|
return (
|
|
232
232
|
<>
|
|
233
|
-
<p className='text-description'>{t('qr code description', { ns:
|
|
233
|
+
<p className='text-description'>{t('qr code description', { ns: meta.id })}</p>
|
|
234
234
|
<div role='group' className='grid grid-cols-[1fr_min-content] mlb-2 gap-2'>
|
|
235
235
|
<div role='none' className='is-full aspect-square relative text-description'>
|
|
236
236
|
<QR
|