@dxos/plugin-space 0.8.2-main.12df754 → 0.8.2-main.2f9c567
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-I2BU35J5.mjs} +6 -6
- package/dist/lib/browser/app-graph-builder-I2BU35J5.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-serializer-6WIAFHYK.mjs → app-graph-serializer-HPYDOKA5.mjs} +4 -4
- package/dist/lib/browser/{chunk-MIJHUABE.mjs → chunk-OS5QKO4Z.mjs} +2 -2
- package/dist/lib/browser/{chunk-FSHDAPFY.mjs → chunk-RERTVPBV.mjs} +2 -2
- package/dist/lib/browser/chunk-RERTVPBV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-MHTZAZT2.mjs → chunk-TSX67XGX.mjs} +136 -138
- package/dist/lib/browser/chunk-TSX67XGX.mjs.map +7 -0
- package/dist/lib/browser/chunk-YQNBTJI4.mjs +308 -0
- package/dist/lib/browser/chunk-YQNBTJI4.mjs.map +7 -0
- package/dist/lib/browser/{identity-created-DVHNLGYU.mjs → identity-created-DWFKBGOA.mjs} +2 -2
- package/dist/lib/browser/index.mjs +13 -16
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-72IWBVYE.mjs → intent-resolver-GKDCJ4H2.mjs} +83 -69
- package/dist/lib/browser/intent-resolver-GKDCJ4H2.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-DRVM5ACV.mjs → react-root-667IZ2Q4.mjs} +4 -4
- package/dist/lib/browser/{react-surface-KODNQYDN.mjs → react-surface-I4RNTGGN.mjs} +5 -22
- package/dist/lib/browser/react-surface-I4RNTGGN.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-ILGGNYJ7.mjs} +2 -2
- package/dist/lib/browser/{spaces-ready-3URIMLCR.mjs → spaces-ready-IXZF3RWW.mjs} +3 -3
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{app-graph-builder-3BNPC5GB.cjs → app-graph-builder-H7MDHM3X.cjs} +34 -34
- package/dist/lib/node/app-graph-builder-H7MDHM3X.cjs.map +7 -0
- package/dist/lib/node/{app-graph-serializer-GOLCQHFQ.cjs → app-graph-serializer-G7UYFWG6.cjs} +20 -20
- package/dist/lib/node/chunk-AR3JHVCY.cjs +336 -0
- package/dist/lib/node/chunk-AR3JHVCY.cjs.map +7 -0
- package/dist/lib/node/{chunk-U63V2254.cjs → chunk-EG3WAZLA.cjs} +27 -27
- package/dist/lib/node/chunk-EG3WAZLA.cjs.map +7 -0
- package/dist/lib/node/{chunk-GPZPEQXP.cjs → chunk-HD4C6KKO.cjs} +183 -185
- package/dist/lib/node/chunk-HD4C6KKO.cjs.map +7 -0
- package/dist/lib/node/{chunk-EI3ZPOLJ.cjs → chunk-NCSFM6RA.cjs} +6 -6
- package/dist/lib/node/{identity-created-YYTW4K3Z.cjs → identity-created-YLGVEWAJ.cjs} +6 -6
- package/dist/lib/node/index.cjs +68 -71
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-KA56XGUX.cjs → intent-resolver-V7UJKLE7.cjs} +129 -115
- package/dist/lib/node/intent-resolver-V7UJKLE7.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-root-6WGN5WRQ.cjs → react-root-I3SSFA5O.cjs} +8 -8
- package/dist/lib/node/{react-surface-37AVZFPL.cjs → react-surface-OLMQCCYD.cjs} +44 -61
- package/dist/lib/node/react-surface-OLMQCCYD.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-7TC55JP4.cjs} +6 -6
- package/dist/lib/node/{spaces-ready-IWDDIAAD.cjs → spaces-ready-4H3Q46GV.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-NI7X6W3Q.mjs} +6 -6
- package/dist/lib/node-esm/app-graph-builder-NI7X6W3Q.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-serializer-AZXSO7HK.mjs → app-graph-serializer-CVPYWWW3.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-TVN6VHTT.mjs → chunk-B2P24Q5R.mjs} +2 -2
- package/dist/lib/node-esm/chunk-B2P24Q5R.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ABKX22IP.mjs → chunk-BU6F7ZU4.mjs} +136 -138
- package/dist/lib/node-esm/chunk-BU6F7ZU4.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-DUA32XUX.mjs → chunk-FUH5OODY.mjs} +2 -2
- package/dist/lib/node-esm/chunk-RUWTHAV7.mjs +309 -0
- package/dist/lib/node-esm/chunk-RUWTHAV7.mjs.map +7 -0
- package/dist/lib/node-esm/{identity-created-MP4GLXHO.mjs → identity-created-7NHGER3Q.mjs} +2 -2
- package/dist/lib/node-esm/index.mjs +13 -16
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-SG2ECM5R.mjs → intent-resolver-IL63YTIT.mjs} +83 -69
- package/dist/lib/node-esm/intent-resolver-IL63YTIT.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-MSUT6S2S.mjs → react-root-JEGVIVVK.mjs} +4 -4
- package/dist/lib/node-esm/{react-surface-G73SO23W.mjs → react-surface-DRRXIJBE.mjs} +5 -22
- package/dist/lib/node-esm/react-surface-DRRXIJBE.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-CXMV2AFR.mjs} +2 -2
- package/dist/lib/node-esm/{spaces-ready-Z3SXKWX2.mjs → spaces-ready-QMXLQ4QV.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/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/components/CollectionMain.d.ts.map +1 -1
- package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
- package/dist/types/src/components/MembersContainer.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/ObjectSettingsContainer.d.ts +2 -2
- package/dist/types/src/components/ObjectSettings/ObjectSettingsContainer.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/SpaceSettings/SpaceSettingsContainer.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- 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/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 +164 -136
- 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/package.json +46 -45
- package/src/SpacePlugin.tsx +9 -8
- package/src/capabilities/app-graph-builder.ts +6 -6
- package/src/capabilities/index.ts +2 -2
- package/src/capabilities/intent-resolver.ts +77 -68
- package/src/capabilities/react-surface.tsx +13 -26
- 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/CreateSpaceDialog.tsx +2 -3
- 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/PopoverAddSpace.tsx +1 -1
- package/src/components/PopoverRenameObject.tsx +12 -6
- package/src/components/PopoverRenameSpace.tsx +8 -0
- package/src/components/SpaceSettings/SpaceSettingsContainer.tsx +5 -3
- package/src/components/index.ts +0 -1
- package/src/hooks/useInputSurfaceLookup.tsx +2 -2
- package/src/types/collection.ts +6 -4
- package/src/types/thread.ts +14 -8
- package/src/types/types.ts +122 -96
- package/src/util.tsx +9 -9
- 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/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-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-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/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/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-HPYDOKA5.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-MIJHUABE.mjs.map → chunk-OS5QKO4Z.mjs.map} +0 -0
- /package/dist/lib/browser/{identity-created-DVHNLGYU.mjs.map → identity-created-DWFKBGOA.mjs.map} +0 -0
- /package/dist/lib/browser/{react-root-DRVM5ACV.mjs.map → react-root-667IZ2Q4.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-2UIV5WX5.mjs.map → settings-ILGGNYJ7.mjs.map} +0 -0
- /package/dist/lib/browser/{spaces-ready-3URIMLCR.mjs.map → spaces-ready-IXZF3RWW.mjs.map} +0 -0
- /package/dist/lib/node/{app-graph-serializer-GOLCQHFQ.cjs.map → app-graph-serializer-G7UYFWG6.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-EI3ZPOLJ.cjs.map → chunk-NCSFM6RA.cjs.map} +0 -0
- /package/dist/lib/node/{identity-created-YYTW4K3Z.cjs.map → identity-created-YLGVEWAJ.cjs.map} +0 -0
- /package/dist/lib/node/{react-root-6WGN5WRQ.cjs.map → react-root-I3SSFA5O.cjs.map} +0 -0
- /package/dist/lib/node/{settings-HJROTHC4.cjs.map → settings-7TC55JP4.cjs.map} +0 -0
- /package/dist/lib/node/{spaces-ready-IWDDIAAD.cjs.map → spaces-ready-4H3Q46GV.cjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-serializer-AZXSO7HK.mjs.map → app-graph-serializer-CVPYWWW3.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-DUA32XUX.mjs.map → chunk-FUH5OODY.mjs.map} +0 -0
- /package/dist/lib/node-esm/{identity-created-MP4GLXHO.mjs.map → identity-created-7NHGER3Q.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-MSUT6S2S.mjs.map → react-root-JEGVIVVK.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-KCLKPJVY.mjs.map → settings-CXMV2AFR.mjs.map} +0 -0
- /package/dist/lib/node-esm/{spaces-ready-Z3SXKWX2.mjs.map → spaces-ready-QMXLQ4QV.mjs.map} +0 -0
- /package/src/capabilities/{schema.ts → schema-defs.ts} +0 -0
|
@@ -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
|
|
|
@@ -16,7 +16,7 @@ export const PopoverAddSpace = () => {
|
|
|
16
16
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
17
17
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
18
18
|
return (
|
|
19
|
-
<div role='none' className='grid grid-cols-1 gap-1 [&>button]:justify-start'>
|
|
19
|
+
<div role='none' className='p-1 grid grid-cols-1 gap-1 [&>button]:justify-start'>
|
|
20
20
|
<IconButton
|
|
21
21
|
variant='ghost'
|
|
22
22
|
label={t('create space label')}
|
|
@@ -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?
|
|
@@ -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;
|
package/src/components/index.ts
CHANGED
|
@@ -15,7 +15,6 @@ export * from './PopoverAddSpace';
|
|
|
15
15
|
export * from './PopoverRenameObject';
|
|
16
16
|
export * from './PopoverRenameSpace';
|
|
17
17
|
export * from './SchemaContainer';
|
|
18
|
-
export * from './ShareSpaceButton';
|
|
19
18
|
export * from './SpacePresence';
|
|
20
19
|
export * from './SpacePluginSettings';
|
|
21
20
|
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/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
|
}) {}
|