@dxos/plugin-space 0.8.2-main.12df754 → 0.8.2-main.30e4dbb
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/{app-graph-builder-J4PN5HOM.mjs → app-graph-builder-6KVRD7OJ.mjs} +30 -13
- package/dist/lib/browser/app-graph-builder-6KVRD7OJ.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-6WIAFHYK.mjs → app-graph-serializer-N7KZGCST.mjs} +4 -4
- package/dist/lib/browser/chunk-CY35NLWL.mjs +296 -0
- package/dist/lib/browser/chunk-CY35NLWL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FSHDAPFY.mjs → chunk-F57CTUM6.mjs} +4 -4
- package/dist/lib/browser/chunk-F57CTUM6.mjs.map +7 -0
- package/dist/lib/browser/{chunk-MHTZAZT2.mjs → chunk-V4VNP2WY.mjs} +161 -213
- package/dist/lib/browser/chunk-V4VNP2WY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-MIJHUABE.mjs → chunk-XC4BXZVV.mjs} +2 -3
- package/dist/lib/browser/chunk-XC4BXZVV.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-DVHNLGYU.mjs → identity-created-74EHBH7M.mjs} +2 -2
- package/dist/lib/browser/index.mjs +13 -20
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-72IWBVYE.mjs → intent-resolver-FZ64VJKZ.mjs} +83 -88
- package/dist/lib/browser/intent-resolver-FZ64VJKZ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-DRVM5ACV.mjs → react-root-2EFJCOX7.mjs} +4 -4
- package/dist/lib/browser/{react-surface-KODNQYDN.mjs → react-surface-N5OGF7TQ.mjs} +5 -30
- package/dist/lib/browser/react-surface-N5OGF7TQ.mjs.map +7 -0
- package/dist/lib/browser/{schema-FHTA26SW.mjs → schema-defs-FLFEUSLB.mjs} +4 -4
- package/dist/lib/browser/{schema-FHTA26SW.mjs.map → schema-defs-FLFEUSLB.mjs.map} +2 -2
- package/dist/lib/browser/{schema-tools-YAXPRIXP.mjs → schema-tools-MYC4LTQD.mjs} +22 -22
- package/dist/lib/browser/schema-tools-MYC4LTQD.mjs.map +7 -0
- package/dist/lib/browser/{settings-2UIV5WX5.mjs → settings-G24447B7.mjs} +2 -2
- package/dist/lib/browser/{spaces-ready-3URIMLCR.mjs → spaces-ready-ZSUEPHJF.mjs} +3 -3
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{app-graph-builder-3BNPC5GB.cjs → app-graph-builder-6VR2TBBF.cjs} +56 -39
- package/dist/lib/node/app-graph-builder-6VR2TBBF.cjs.map +7 -0
- package/dist/lib/node/{app-graph-serializer-GOLCQHFQ.cjs → app-graph-serializer-IKQLWTCX.cjs} +20 -20
- package/dist/lib/node/{chunk-U63V2254.cjs → chunk-FILCZU6V.cjs} +29 -29
- package/dist/lib/node/chunk-FILCZU6V.cjs.map +7 -0
- package/dist/lib/node/chunk-K6ZO4WDJ.cjs +324 -0
- package/dist/lib/node/chunk-K6ZO4WDJ.cjs.map +7 -0
- package/dist/lib/node/{chunk-GPZPEQXP.cjs → chunk-P2ZIVXGY.cjs} +215 -267
- package/dist/lib/node/chunk-P2ZIVXGY.cjs.map +7 -0
- package/dist/lib/node/{chunk-EI3ZPOLJ.cjs → chunk-YAE6CCDB.cjs} +6 -7
- package/dist/lib/node/chunk-YAE6CCDB.cjs.map +7 -0
- package/dist/lib/node/{identity-created-YYTW4K3Z.cjs → identity-created-PCQPDULV.cjs} +6 -6
- package/dist/lib/node/index.cjs +66 -73
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-KA56XGUX.cjs → intent-resolver-BK6JDXY4.cjs} +126 -130
- package/dist/lib/node/intent-resolver-BK6JDXY4.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-root-6WGN5WRQ.cjs → react-root-DEQFKQVD.cjs} +8 -8
- package/dist/lib/node/{react-surface-37AVZFPL.cjs → react-surface-UQD7LR67.cjs} +41 -64
- package/dist/lib/node/react-surface-UQD7LR67.cjs.map +7 -0
- package/dist/lib/node/{schema-PPJ5BZ3A.cjs → schema-defs-PKZVL52M.cjs} +6 -6
- package/dist/lib/node/{schema-PPJ5BZ3A.cjs.map → schema-defs-PKZVL52M.cjs.map} +2 -2
- package/dist/lib/node/{schema-tools-BLIMOZYY.cjs → schema-tools-OE3MFYYH.cjs} +24 -24
- package/dist/lib/node/schema-tools-OE3MFYYH.cjs.map +7 -0
- package/dist/lib/node/{settings-HJROTHC4.cjs → settings-AFWO4AWK.cjs} +6 -6
- package/dist/lib/node/{spaces-ready-IWDDIAAD.cjs → spaces-ready-MHLUFLXN.cjs} +11 -11
- package/dist/lib/node/types/index.cjs +15 -15
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{app-graph-builder-OVMSUAX3.mjs → app-graph-builder-O7M6MVS5.mjs} +30 -13
- package/dist/lib/node-esm/app-graph-builder-O7M6MVS5.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-AZXSO7HK.mjs → app-graph-serializer-I6XBQJLA.mjs} +4 -4
- package/dist/lib/node-esm/chunk-CLRCW6PU.mjs +297 -0
- package/dist/lib/node-esm/chunk-CLRCW6PU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-TVN6VHTT.mjs → chunk-COHDPHM7.mjs} +4 -4
- package/dist/lib/node-esm/chunk-COHDPHM7.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-DUA32XUX.mjs → chunk-HEXOMJIR.mjs} +2 -3
- package/dist/lib/node-esm/chunk-HEXOMJIR.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ABKX22IP.mjs → chunk-TB557OBD.mjs} +161 -213
- package/dist/lib/node-esm/chunk-TB557OBD.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-MP4GLXHO.mjs → identity-created-GXS46A3C.mjs} +2 -2
- package/dist/lib/node-esm/index.mjs +13 -20
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-SG2ECM5R.mjs → intent-resolver-6VPP3ZDO.mjs} +83 -88
- package/dist/lib/node-esm/intent-resolver-6VPP3ZDO.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-MSUT6S2S.mjs → react-root-2RJ2S5E6.mjs} +4 -4
- package/dist/lib/node-esm/{react-surface-G73SO23W.mjs → react-surface-2RSRATVY.mjs} +5 -30
- package/dist/lib/node-esm/react-surface-2RSRATVY.mjs.map +7 -0
- package/dist/lib/node-esm/{schema-OUZKVYM5.mjs → schema-defs-IIEQR7B3.mjs} +4 -4
- package/dist/lib/node-esm/{schema-OUZKVYM5.mjs.map → schema-defs-IIEQR7B3.mjs.map} +2 -2
- package/dist/lib/node-esm/{schema-tools-IU7EX5A5.mjs → schema-tools-YTJLA3NQ.mjs} +22 -22
- package/dist/lib/node-esm/schema-tools-YTJLA3NQ.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-KCLKPJVY.mjs → settings-MJVSCOI4.mjs} +2 -2
- package/dist/lib/node-esm/{spaces-ready-Z3SXKWX2.mjs → spaces-ready-35U5BBTH.mjs} +3 -3
- package/dist/lib/node-esm/types/index.mjs +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/app-graph-serializer.d.ts.map +1 -1
- package/dist/types/src/capabilities/identity-created.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +3 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/{schema.d.ts → schema-defs.d.ts} +1 -1
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema-tools.d.ts +2 -2
- package/dist/types/src/capabilities/schema-tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/spaces-ready.d.ts.map +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.map +1 -1
- package/dist/types/src/components/CollectionSection.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/MenuFooter.d.ts +2 -2
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/AdvancedObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/BaseObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/ForeignKeys.d.ts.map +1 -1
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.d.ts +2 -2
- 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.map +1 -1
- package/dist/types/src/components/PopoverRenameSpace.d.ts.map +1 -1
- package/dist/types/src/components/SchemaContainer.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/components/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/save-tracker.d.ts.map +1 -1
- package/dist/types/src/components/SyncStatus/status.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts +2 -2
- package/dist/types/src/hooks/useInputSurfaceLookup.d.ts.map +1 -1
- package/dist/types/src/hooks/usePath.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -263
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/collection.d.ts +9 -8
- package/dist/types/src/types/collection.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +329 -110
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +154 -142
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +4 -4
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +46 -45
- package/src/SpacePlugin.tsx +9 -8
- package/src/capabilities/app-graph-builder.ts +26 -14
- package/src/capabilities/index.ts +2 -2
- package/src/capabilities/intent-resolver.ts +77 -87
- package/src/capabilities/react-surface.tsx +13 -34
- package/src/capabilities/schema-tool.test.ts +2 -3
- package/src/capabilities/schema-tools.ts +25 -25
- package/src/components/CollectionMain.tsx +2 -5
- package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +1 -1
- package/src/components/CreateDialog/CreateSpaceDialog.tsx +2 -3
- package/src/components/MembersContainer.stories.tsx +1 -5
- package/src/components/MembersContainer.tsx +23 -15
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/ObjectSettings/AdvancedObjectSettings.tsx +2 -2
- package/src/components/ObjectSettings/BaseObjectSettings.tsx +2 -2
- package/src/components/ObjectSettings/ObjectSettingsContainer.tsx +2 -2
- package/src/components/PersistenceStatus.tsx +11 -14
- package/src/components/PopoverRenameObject.tsx +12 -6
- package/src/components/PopoverRenameSpace.tsx +8 -0
- package/src/components/SpacePresence.stories.tsx +1 -1
- package/src/components/SpacePresence.tsx +32 -42
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +5 -3
- package/src/components/SyncStatus/InlineSyncStatus.tsx +8 -16
- package/src/components/index.ts +0 -2
- package/src/hooks/useInputSurfaceLookup.tsx +2 -2
- package/src/translations.ts +0 -1
- package/src/types/collection.ts +6 -4
- package/src/types/thread.ts +14 -8
- package/src/types/types.ts +109 -96
- package/src/util.tsx +13 -13
- package/dist/lib/browser/app-graph-builder-J4PN5HOM.mjs.map +0 -7
- package/dist/lib/browser/chunk-FSHDAPFY.mjs.map +0 -7
- package/dist/lib/browser/chunk-KDNV4YRD.mjs +0 -283
- package/dist/lib/browser/chunk-KDNV4YRD.mjs.map +0 -7
- package/dist/lib/browser/chunk-MHTZAZT2.mjs.map +0 -7
- package/dist/lib/browser/chunk-MIJHUABE.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-72IWBVYE.mjs.map +0 -7
- package/dist/lib/browser/react-surface-KODNQYDN.mjs.map +0 -7
- package/dist/lib/browser/schema-tools-YAXPRIXP.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-3BNPC5GB.cjs.map +0 -7
- package/dist/lib/node/chunk-3UKLWXNJ.cjs +0 -311
- package/dist/lib/node/chunk-3UKLWXNJ.cjs.map +0 -7
- package/dist/lib/node/chunk-EI3ZPOLJ.cjs.map +0 -7
- package/dist/lib/node/chunk-GPZPEQXP.cjs.map +0 -7
- package/dist/lib/node/chunk-U63V2254.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-KA56XGUX.cjs.map +0 -7
- package/dist/lib/node/react-surface-37AVZFPL.cjs.map +0 -7
- package/dist/lib/node/schema-tools-BLIMOZYY.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-OVMSUAX3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-35OHQARN.mjs +0 -284
- package/dist/lib/node-esm/chunk-35OHQARN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ABKX22IP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DUA32XUX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TVN6VHTT.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-SG2ECM5R.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-G73SO23W.mjs.map +0 -7
- package/dist/lib/node-esm/schema-tools-IU7EX5A5.mjs.map +0 -7
- package/dist/types/src/capabilities/schema.d.ts.map +0 -1
- package/dist/types/src/components/PopoverAddSpace.d.ts +0 -4
- package/dist/types/src/components/PopoverAddSpace.d.ts.map +0 -1
- package/dist/types/src/components/ShareSpaceButton.d.ts +0 -9
- package/dist/types/src/components/ShareSpaceButton.d.ts.map +0 -1
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts +0 -10
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +0 -1
- package/src/components/PopoverAddSpace.tsx +0 -52
- package/src/components/ShareSpaceButton.stories.tsx +0 -27
- package/src/components/ShareSpaceButton.tsx +0 -32
- /package/dist/lib/browser/{app-graph-serializer-6WIAFHYK.mjs.map → app-graph-serializer-N7KZGCST.mjs.map} +0 -0
- /package/dist/lib/browser/{identity-created-DVHNLGYU.mjs.map → identity-created-74EHBH7M.mjs.map} +0 -0
- /package/dist/lib/browser/{react-root-DRVM5ACV.mjs.map → react-root-2EFJCOX7.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-2UIV5WX5.mjs.map → settings-G24447B7.mjs.map} +0 -0
- /package/dist/lib/browser/{spaces-ready-3URIMLCR.mjs.map → spaces-ready-ZSUEPHJF.mjs.map} +0 -0
- /package/dist/lib/node/{app-graph-serializer-GOLCQHFQ.cjs.map → app-graph-serializer-IKQLWTCX.cjs.map} +0 -0
- /package/dist/lib/node/{identity-created-YYTW4K3Z.cjs.map → identity-created-PCQPDULV.cjs.map} +0 -0
- /package/dist/lib/node/{react-root-6WGN5WRQ.cjs.map → react-root-DEQFKQVD.cjs.map} +0 -0
- /package/dist/lib/node/{settings-HJROTHC4.cjs.map → settings-AFWO4AWK.cjs.map} +0 -0
- /package/dist/lib/node/{spaces-ready-IWDDIAAD.cjs.map → spaces-ready-MHLUFLXN.cjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-serializer-AZXSO7HK.mjs.map → app-graph-serializer-I6XBQJLA.mjs.map} +0 -0
- /package/dist/lib/node-esm/{identity-created-MP4GLXHO.mjs.map → identity-created-GXS46A3C.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-MSUT6S2S.mjs.map → react-root-2RJ2S5E6.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-KCLKPJVY.mjs.map → settings-MJVSCOI4.mjs.map} +0 -0
- /package/dist/lib/node-esm/{spaces-ready-Z3SXKWX2.mjs.map → spaces-ready-35U5BBTH.mjs.map} +0 -0
- /package/src/capabilities/{schema.ts → schema-defs.ts} +0 -0
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Effect } from 'effect';
|
|
5
|
+
import { Effect, type Schema } from 'effect';
|
|
6
6
|
import React, { useCallback, useRef } from 'react';
|
|
7
7
|
|
|
8
8
|
import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
|
-
import { type S } from '@dxos/echo-schema';
|
|
10
9
|
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
11
10
|
import { Form } from '@dxos/react-ui-form';
|
|
12
11
|
|
|
@@ -16,7 +15,7 @@ import { SpaceAction, SpaceForm } from '../../types';
|
|
|
16
15
|
|
|
17
16
|
export const CREATE_SPACE_DIALOG = `${SPACE_PLUGIN}/CreateSpaceDialog`;
|
|
18
17
|
|
|
19
|
-
type FormValues =
|
|
18
|
+
type FormValues = Schema.Schema.Type<typeof SpaceForm>;
|
|
20
19
|
const initialValues: FormValues = { edgeReplication: true };
|
|
21
20
|
|
|
22
21
|
export const CreateSpaceDialog = () => {
|
|
@@ -16,11 +16,7 @@ import translations from '../translations';
|
|
|
16
16
|
const meta: Meta = {
|
|
17
17
|
title: 'plugins/plugin-space/MembersContainer',
|
|
18
18
|
component: MembersContainer,
|
|
19
|
-
decorators: [
|
|
20
|
-
withClientProvider({ createIdentity: true, createSpace: true }),
|
|
21
|
-
withTheme,
|
|
22
|
-
withLayout({ tooltips: true }),
|
|
23
|
-
],
|
|
19
|
+
decorators: [withClientProvider({ createIdentity: true, createSpace: true }), withTheme, withLayout()],
|
|
24
20
|
parameters: {
|
|
25
21
|
layout: 'fullscreen',
|
|
26
22
|
translations: [...translations, osTranslations],
|
|
@@ -6,6 +6,7 @@ import { Check, X } from '@phosphor-icons/react';
|
|
|
6
6
|
import React, { type Dispatch, type SetStateAction, useCallback, useMemo, useState } from 'react';
|
|
7
7
|
import { QR } from 'react-qr-rounded';
|
|
8
8
|
|
|
9
|
+
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
10
|
import { log } from '@dxos/log';
|
|
10
11
|
import { useConfig } from '@dxos/react-client';
|
|
11
12
|
import { fullyQualifiedId, useSpaceInvitations, type Space } from '@dxos/react-client/echo';
|
|
@@ -27,7 +28,7 @@ import {
|
|
|
27
28
|
import { hexToEmoji } from '@dxos/util';
|
|
28
29
|
|
|
29
30
|
import { SPACE_PLUGIN } from '../meta';
|
|
30
|
-
import { CollectionType } from '../types';
|
|
31
|
+
import { CollectionType, SpaceAction } from '../types';
|
|
31
32
|
import { COMPOSER_SPACE_LOCK } from '../util';
|
|
32
33
|
|
|
33
34
|
// TODO(wittjosiah): Copied from Shell.
|
|
@@ -50,6 +51,7 @@ export const MembersContainer = ({
|
|
|
50
51
|
}) => {
|
|
51
52
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
52
53
|
const config = useConfig();
|
|
54
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
53
55
|
const invitations = useSpaceInvitations(space.key);
|
|
54
56
|
const visibleInvitations = invitations?.filter(
|
|
55
57
|
(invitation) => ![Invitation.State.CANCELLED].includes(invitation.get().state),
|
|
@@ -77,13 +79,16 @@ export const MembersContainer = ({
|
|
|
77
79
|
description: t('invite one description', { ns: 'os' }),
|
|
78
80
|
icon: () => <Icon icon='ph--user-plus--regular' size={5} />,
|
|
79
81
|
testId: 'membersContainer.inviteOne',
|
|
80
|
-
onClick: () => {
|
|
81
|
-
const invitation =
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
onClick: async () => {
|
|
83
|
+
const { data: invitation } = await dispatch(
|
|
84
|
+
createIntent(SpaceAction.Share, {
|
|
85
|
+
space,
|
|
86
|
+
type: Invitation.Type.INTERACTIVE,
|
|
87
|
+
authMethod: Invitation.AuthMethod.SHARED_SECRET,
|
|
88
|
+
multiUse: false,
|
|
89
|
+
target: target && fullyQualifiedId(target),
|
|
90
|
+
}),
|
|
91
|
+
);
|
|
87
92
|
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== 'production') {
|
|
88
93
|
const subscription: ZenObservable.Subscription = invitation.subscribe((invitation) =>
|
|
89
94
|
handleInvitationEvent(invitation, subscription),
|
|
@@ -96,13 +101,16 @@ export const MembersContainer = ({
|
|
|
96
101
|
description: t('invite many description', { ns: 'os' }),
|
|
97
102
|
icon: () => <Icon icon='ph--users-three--regular' size={5} />,
|
|
98
103
|
testId: 'membersContainer.inviteMany',
|
|
99
|
-
onClick: () => {
|
|
100
|
-
const invitation =
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
onClick: async () => {
|
|
105
|
+
const { data: invitation } = await dispatch(
|
|
106
|
+
createIntent(SpaceAction.Share, {
|
|
107
|
+
space,
|
|
108
|
+
type: Invitation.Type.DELEGATED,
|
|
109
|
+
authMethod: Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
|
|
110
|
+
multiUse: true,
|
|
111
|
+
target: target && fullyQualifiedId(target),
|
|
112
|
+
}),
|
|
113
|
+
);
|
|
106
114
|
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== 'production') {
|
|
107
115
|
const subscription: ZenObservable.Subscription = invitation.subscribe((invitation) =>
|
|
108
116
|
handleInvitationEvent(invitation, subscription),
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
import { Planet } from '@phosphor-icons/react';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import { type
|
|
8
|
+
import { type AnyLiveObject, getSpace } from '@dxos/client/echo';
|
|
9
9
|
import { useClient } from '@dxos/react-client';
|
|
10
10
|
import { DropdownMenu, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
11
11
|
|
|
12
12
|
import { SPACE_PLUGIN } from '../meta';
|
|
13
13
|
import { getSpaceDisplayName } from '../util';
|
|
14
14
|
|
|
15
|
-
export const MenuFooter = ({ object }: { object:
|
|
15
|
+
export const MenuFooter = ({ object }: { object: AnyLiveObject<any> }) => {
|
|
16
16
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
17
17
|
const client = useClient();
|
|
18
18
|
const space = getSpace(object);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React, { useCallback, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { type ForeignKey, ForeignKeySchema } from '@dxos/echo-schema';
|
|
8
|
-
import { getMeta, type
|
|
8
|
+
import { getMeta, type AnyLiveObject } from '@dxos/react-client/echo';
|
|
9
9
|
import { IconButton, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { Form } from '@dxos/react-ui-form';
|
|
11
11
|
|
|
@@ -18,7 +18,7 @@ const initialValues = {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export type AdvancedObjectSettingsProps = {
|
|
21
|
-
object:
|
|
21
|
+
object: AnyLiveObject<any>;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export const AdvancedObjectSettings = ({ object }: AdvancedObjectSettingsProps) => {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { type PropsWithChildren, useRef } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type AnyLiveObject } from '@dxos/react-client/echo';
|
|
8
8
|
import { Input, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { mx } from '@dxos/react-ui-theme';
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ import { meta } from '../../meta';
|
|
|
12
12
|
|
|
13
13
|
export type BaseObjectSettingsProps = ThemedClassName<
|
|
14
14
|
PropsWithChildren<{
|
|
15
|
-
object:
|
|
15
|
+
object: AnyLiveObject<any>;
|
|
16
16
|
}>
|
|
17
17
|
>;
|
|
18
18
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Surface } from '@dxos/app-framework';
|
|
8
|
-
import { type
|
|
8
|
+
import { type AnyLiveObject } from '@dxos/react-client/echo';
|
|
9
9
|
import { Clipboard } from '@dxos/react-ui';
|
|
10
10
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ import { AdvancedObjectSettings } from './AdvancedObjectSettings';
|
|
|
13
13
|
import { BaseObjectSettings } from './BaseObjectSettings';
|
|
14
14
|
|
|
15
15
|
export type ObjectSettingsContainerProps = {
|
|
16
|
-
object:
|
|
16
|
+
object: AnyLiveObject<any>;
|
|
17
17
|
role: string;
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -68,20 +68,17 @@ export const PersistenceStatus = ({ db }: { db: EchoDatabase }) => {
|
|
|
68
68
|
case Status.PERSISTED_LOCALLY:
|
|
69
69
|
default:
|
|
70
70
|
return (
|
|
71
|
-
<Tooltip.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
</Tooltip.Content>
|
|
83
|
-
</Tooltip.Portal>
|
|
84
|
-
</Tooltip.Root>
|
|
71
|
+
<Tooltip.Trigger
|
|
72
|
+
delayDuration={400}
|
|
73
|
+
role='status'
|
|
74
|
+
content={t('persisted locally message')}
|
|
75
|
+
className='flex items-center'
|
|
76
|
+
>
|
|
77
|
+
<CheckCircle className={mx(getSize(4), 'me-1')} />
|
|
78
|
+
{displayMessage && (
|
|
79
|
+
<span className={mx('text-sm', staticPlaceholderText)}>{t('persisted locally label')}</span>
|
|
80
|
+
)}
|
|
81
|
+
</Tooltip.Trigger>
|
|
85
82
|
);
|
|
86
83
|
}
|
|
87
84
|
};
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
+
import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
|
|
7
8
|
import { type Live } from '@dxos/live-object';
|
|
8
9
|
import { log } from '@dxos/log';
|
|
9
|
-
import { Button, Input,
|
|
10
|
+
import { Button, Input, useTranslation } from '@dxos/react-ui';
|
|
10
11
|
|
|
11
12
|
import { SPACE_PLUGIN } from '../meta';
|
|
12
13
|
|
|
@@ -19,6 +20,7 @@ export const PopoverRenameObject = ({ object: obj }: { object: Live<any> }) => {
|
|
|
19
20
|
const object = obj as any;
|
|
20
21
|
// TODO(burdon): Field should not be hardcoded field.
|
|
21
22
|
const [name, setName] = useState(object.name || object.title || '');
|
|
23
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
22
24
|
|
|
23
25
|
const handleDone = useCallback(() => {
|
|
24
26
|
try {
|
|
@@ -30,6 +32,12 @@ export const PopoverRenameObject = ({ object: obj }: { object: Live<any> }) => {
|
|
|
30
32
|
log.error('Failed to rename object', { err });
|
|
31
33
|
}
|
|
32
34
|
}
|
|
35
|
+
void dispatch(
|
|
36
|
+
createIntent(LayoutAction.UpdatePopover, {
|
|
37
|
+
part: 'popover',
|
|
38
|
+
options: { variant: 'react', anchorId: '', state: false },
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
33
41
|
}, [object, name]);
|
|
34
42
|
|
|
35
43
|
return (
|
|
@@ -46,11 +54,9 @@ export const PopoverRenameObject = ({ object: obj }: { object: Live<any> }) => {
|
|
|
46
54
|
/>
|
|
47
55
|
</Input.Root>
|
|
48
56
|
</div>
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
</Button>
|
|
53
|
-
</Popover.Close>
|
|
57
|
+
<Button ref={doneButton} classNames='self-stretch' onClick={handleDone}>
|
|
58
|
+
{t('done label', { ns: 'os' })}
|
|
59
|
+
</Button>
|
|
54
60
|
</div>
|
|
55
61
|
);
|
|
56
62
|
};
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
|
+
import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
|
|
7
8
|
import { type Space } from '@dxos/react-client/echo';
|
|
8
9
|
import { Button, Input, Popover, useTranslation } from '@dxos/react-ui';
|
|
9
10
|
|
|
@@ -15,9 +16,16 @@ export const PopoverRenameSpace = ({ space }: { space: Space }) => {
|
|
|
15
16
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
16
17
|
const doneButton = useRef<HTMLButtonElement>(null);
|
|
17
18
|
const [name, setName] = useState(space.properties.name ?? '');
|
|
19
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
18
20
|
|
|
19
21
|
const handleDone = useCallback(() => {
|
|
20
22
|
space.properties.name = name;
|
|
23
|
+
void dispatch(
|
|
24
|
+
createIntent(LayoutAction.UpdatePopover, {
|
|
25
|
+
part: 'popover',
|
|
26
|
+
options: { variant: 'react', anchorId: '', state: false },
|
|
27
|
+
}),
|
|
28
|
+
);
|
|
21
29
|
}, [space, name]);
|
|
22
30
|
|
|
23
31
|
// TODO(thure): Why does the input value need to be uncontrolled to work?
|
|
@@ -100,7 +100,7 @@ export const Small = () => {
|
|
|
100
100
|
|
|
101
101
|
const meta: Meta = {
|
|
102
102
|
title: 'plugins/plugin-space/SpacePresence',
|
|
103
|
-
decorators: [withTheme, withLayout(
|
|
103
|
+
decorators: [withTheme, withLayout()],
|
|
104
104
|
parameters: { translations },
|
|
105
105
|
};
|
|
106
106
|
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
type Size,
|
|
17
17
|
type ThemedClassName,
|
|
18
18
|
Tooltip,
|
|
19
|
+
Popover,
|
|
19
20
|
useTranslation,
|
|
20
21
|
List,
|
|
21
22
|
ListItem,
|
|
@@ -115,28 +116,25 @@ export const FullPresence = (props: MemberPresenceProps) => {
|
|
|
115
116
|
return (
|
|
116
117
|
<div className='dx-avatar-group' data-testid='spacePlugin.presence'>
|
|
117
118
|
{members.slice(0, 3).map((member, i) => (
|
|
118
|
-
<Tooltip.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
</Tooltip.Content>
|
|
133
|
-
</Tooltip.Portal>
|
|
134
|
-
</Tooltip.Root>
|
|
119
|
+
<Tooltip.Trigger
|
|
120
|
+
key={member.identity.identityKey.toHex()}
|
|
121
|
+
side='bottom'
|
|
122
|
+
content={getName(member.identity)}
|
|
123
|
+
className='grid focus:outline-none'
|
|
124
|
+
>
|
|
125
|
+
<PresenceAvatar
|
|
126
|
+
identity={member.identity}
|
|
127
|
+
match={member.currentlyAttended} // TODO(Zan): Match always true now we're showing 'members viewing current object'.
|
|
128
|
+
index={members.length - i}
|
|
129
|
+
onClick={() => onMemberClick?.(member)}
|
|
130
|
+
size={size}
|
|
131
|
+
/>
|
|
132
|
+
</Tooltip.Trigger>
|
|
135
133
|
))}
|
|
136
134
|
|
|
137
135
|
{members.length > 3 && (
|
|
138
|
-
<
|
|
139
|
-
<
|
|
136
|
+
<Popover.Root>
|
|
137
|
+
<Popover.Trigger className='grid focus:outline-none'>
|
|
140
138
|
<Avatar.Root>
|
|
141
139
|
{/* TODO(wittjosiah): Make text fit. */}
|
|
142
140
|
<Avatar.Content
|
|
@@ -146,10 +144,10 @@ export const FullPresence = (props: MemberPresenceProps) => {
|
|
|
146
144
|
size={size}
|
|
147
145
|
/>
|
|
148
146
|
</Avatar.Root>
|
|
149
|
-
</
|
|
150
|
-
<
|
|
151
|
-
<
|
|
152
|
-
<
|
|
147
|
+
</Popover.Trigger>
|
|
148
|
+
<Popover.Portal>
|
|
149
|
+
<Popover.Content side='bottom'>
|
|
150
|
+
<Popover.Arrow />
|
|
153
151
|
<List classNames='max-h-56 overflow-y-auto'>
|
|
154
152
|
{members.map((member) => (
|
|
155
153
|
<ListItem.Root
|
|
@@ -163,9 +161,9 @@ export const FullPresence = (props: MemberPresenceProps) => {
|
|
|
163
161
|
</ListItem.Root>
|
|
164
162
|
))}
|
|
165
163
|
</List>
|
|
166
|
-
</
|
|
167
|
-
</
|
|
168
|
-
</
|
|
164
|
+
</Popover.Content>
|
|
165
|
+
</Popover.Portal>
|
|
166
|
+
</Popover.Root>
|
|
169
167
|
)}
|
|
170
168
|
</div>
|
|
171
169
|
);
|
|
@@ -251,21 +249,13 @@ export const SmallPresence = ({ count = 0, attended, containsAttended }: SmallPr
|
|
|
251
249
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
252
250
|
|
|
253
251
|
return (
|
|
254
|
-
<Tooltip.
|
|
255
|
-
<
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
</Tooltip.Trigger>
|
|
263
|
-
<Tooltip.Portal>
|
|
264
|
-
<Tooltip.Content side='bottom'>
|
|
265
|
-
<span>{t('presence label', { count })}</span>
|
|
266
|
-
<Tooltip.Arrow />
|
|
267
|
-
</Tooltip.Content>
|
|
268
|
-
</Tooltip.Portal>
|
|
269
|
-
</Tooltip.Root>
|
|
252
|
+
<Tooltip.Trigger asChild content={t('presence label', { count })} side='bottom'>
|
|
253
|
+
<AttentionGlyph
|
|
254
|
+
attended={attended}
|
|
255
|
+
containsAttended={containsAttended}
|
|
256
|
+
presence={count > 1 ? 'many' : count === 1 ? 'one' : 'none'}
|
|
257
|
+
classNames='self-center mie-1'
|
|
258
|
+
/>
|
|
259
|
+
</Tooltip.Trigger>
|
|
270
260
|
);
|
|
271
261
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { pipe, Schema
|
|
5
|
+
import { pipe, Schema } from 'effect';
|
|
6
6
|
import React, { type ChangeEvent, useCallback, useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { chain, createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
|
|
@@ -25,7 +25,9 @@ import { StackItem } from '@dxos/react-ui-stack';
|
|
|
25
25
|
import { SPACE_PLUGIN } from '../../meta';
|
|
26
26
|
import { SpaceAction, SpaceForm } from '../../types';
|
|
27
27
|
|
|
28
|
-
const FormSchema = SpaceForm.pipe(
|
|
28
|
+
const FormSchema = SpaceForm.pipe(
|
|
29
|
+
Schema.extend(Schema.Struct({ archived: Schema.Boolean.annotations({ title: 'Archive space' }) })),
|
|
30
|
+
);
|
|
29
31
|
|
|
30
32
|
export type SpaceSettingsContainerProps = {
|
|
31
33
|
space: Space;
|
|
@@ -54,7 +56,7 @@ export const SpaceSettingsContainer = ({ space }: SpaceSettingsContainerProps) =
|
|
|
54
56
|
);
|
|
55
57
|
|
|
56
58
|
const handleSave = useCallback(
|
|
57
|
-
(properties:
|
|
59
|
+
(properties: Schema.Schema.Type<typeof FormSchema>) => {
|
|
58
60
|
void toggleEdgeReplication(properties.edgeReplication);
|
|
59
61
|
if (properties.name !== space.properties.name) {
|
|
60
62
|
space.properties.name = properties.name;
|
|
@@ -49,21 +49,13 @@ export const InlineSyncStatus = ({ space, open }: { space: Space; open?: boolean
|
|
|
49
49
|
const syncing = connectedToEdge && edgeSyncEnabled && syncState && syncState.missingOnLocal > 0;
|
|
50
50
|
|
|
51
51
|
return (
|
|
52
|
-
<Tooltip.
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
</Tooltip.Trigger>
|
|
61
|
-
<Tooltip.Portal>
|
|
62
|
-
<Tooltip.Content side='bottom' classNames='z-[70]'>
|
|
63
|
-
<span>{t('syncing label')}</span>
|
|
64
|
-
<Tooltip.Arrow />
|
|
65
|
-
</Tooltip.Content>
|
|
66
|
-
</Tooltip.Portal>
|
|
67
|
-
</Tooltip.Root>
|
|
52
|
+
<Tooltip.Trigger asChild content={t('syncing label')} side='bottom'>
|
|
53
|
+
<AttentionGlyph
|
|
54
|
+
syncing={syncing}
|
|
55
|
+
attended={isAttended}
|
|
56
|
+
containsAttended={containsAttended}
|
|
57
|
+
classNames='self-center mie-1'
|
|
58
|
+
/>
|
|
59
|
+
</Tooltip.Trigger>
|
|
68
60
|
);
|
|
69
61
|
};
|
package/src/components/index.ts
CHANGED
|
@@ -11,11 +11,9 @@ export * from './MembersContainer';
|
|
|
11
11
|
export * from './MenuFooter';
|
|
12
12
|
export * from './ObjectSettings';
|
|
13
13
|
export * from './PersistenceStatus';
|
|
14
|
-
export * from './PopoverAddSpace';
|
|
15
14
|
export * from './PopoverRenameObject';
|
|
16
15
|
export * from './PopoverRenameSpace';
|
|
17
16
|
export * from './SchemaContainer';
|
|
18
|
-
export * from './ShareSpaceButton';
|
|
19
17
|
export * from './SpacePresence';
|
|
20
18
|
export * from './SpacePluginSettings';
|
|
21
19
|
export * from './SpaceSettings';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type Schema
|
|
5
|
+
import { type Schema } from 'effect';
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
8
|
import { usePluginManager, isSurfaceAvailable, Surface } from '@dxos/app-framework';
|
|
@@ -18,7 +18,7 @@ export const useInputSurfaceLookup = (baseData?: Record<string, any>) => {
|
|
|
18
18
|
const pluginManager = usePluginManager();
|
|
19
19
|
|
|
20
20
|
return useCallback(
|
|
21
|
-
({ prop, schema, inputProps }: { prop: string; schema:
|
|
21
|
+
({ prop, schema, inputProps }: { prop: string; schema: Schema.Schema<any>; inputProps: InputProps }) => {
|
|
22
22
|
const composedData = { prop, schema, ...baseData };
|
|
23
23
|
if (!isSurfaceAvailable(pluginManager.context, { role: 'form-input', data: composedData })) {
|
|
24
24
|
return undefined;
|
package/src/translations.ts
CHANGED
|
@@ -15,7 +15,6 @@ export default [
|
|
|
15
15
|
[SPACE_PLUGIN]: {
|
|
16
16
|
'plugin name': 'Spaces',
|
|
17
17
|
'first run message': 'Nothing selected.',
|
|
18
|
-
'add space label': 'Create or join a space',
|
|
19
18
|
'create space label': 'Create space',
|
|
20
19
|
'join space label': 'Join space',
|
|
21
20
|
'empty space message': 'No documents',
|
package/src/types/collection.ts
CHANGED
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { Expando, Ref, TypedObject } from '@dxos/echo-schema';
|
|
6
8
|
|
|
7
9
|
export class CollectionType extends TypedObject({ typename: 'dxos.org/type/Collection', version: '0.1.0' })({
|
|
8
|
-
name:
|
|
9
|
-
objects:
|
|
10
|
+
name: Schema.optional(Schema.String),
|
|
11
|
+
objects: Schema.mutable(Schema.Array(Ref(Expando))),
|
|
10
12
|
// Key is schema typename and value is reference to a view object of the associated schema.
|
|
11
13
|
// Having collection reference the views rather than vice versa ensures that the state converges to a single view per key (i.e. type).
|
|
12
14
|
// This also leaves open a future where this key could be changed to allow for multiple stack views per section.
|
|
13
15
|
// TODO(wittjosiah): Any way to make this more type safe?
|
|
14
16
|
// TODO(wittjosiah): Should the views be separate objects or just be schemas for view data in this record?
|
|
15
|
-
views:
|
|
17
|
+
views: Schema.mutable(Schema.Record({ key: Schema.String, value: Ref(Expando) })),
|
|
16
18
|
}) {}
|
package/src/types/thread.ts
CHANGED
|
@@ -2,23 +2,29 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { Expando, Ref, TypedObject } from '@dxos/echo-schema';
|
|
8
|
+
import { DataType } from '@dxos/schema';
|
|
7
9
|
|
|
8
10
|
// TODO(wittjosiah): These types were placed here rather than in @dxos/plugin-thread
|
|
9
11
|
// in order to avoid a circular dependency between threads and other objects that use threads.
|
|
10
12
|
|
|
11
|
-
export const ThreadStatus =
|
|
13
|
+
export const ThreadStatus = Schema.Union(
|
|
14
|
+
Schema.Literal('staged'),
|
|
15
|
+
Schema.Literal('active'),
|
|
16
|
+
Schema.Literal('resolved'),
|
|
17
|
+
);
|
|
12
18
|
|
|
13
19
|
export class ThreadType extends TypedObject({ typename: 'dxos.org/type/Thread', version: '0.1.0' })({
|
|
14
|
-
name:
|
|
20
|
+
name: Schema.optional(Schema.String),
|
|
15
21
|
/** AM cursor-range: 'from:to'. */
|
|
16
|
-
anchor:
|
|
17
|
-
status:
|
|
18
|
-
messages:
|
|
22
|
+
anchor: Schema.optional(Schema.String),
|
|
23
|
+
status: Schema.optional(ThreadStatus),
|
|
24
|
+
messages: Schema.mutable(Schema.Array(Ref(DataType.Message))),
|
|
19
25
|
}) {}
|
|
20
26
|
|
|
21
27
|
export class ChannelType extends TypedObject({ typename: 'dxos.org/type/Channel', version: '0.1.0' })({
|
|
22
|
-
name:
|
|
28
|
+
name: Schema.optional(Schema.String),
|
|
23
29
|
queue: Ref(Expando),
|
|
24
30
|
}) {}
|