@dxos/plugin-space 0.6.13-main.ed424a1 → 0.6.13
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/{chunk-47SVNCZM.mjs → chunk-DTVUOG2C.mjs} +5 -24
- package/dist/lib/browser/chunk-DTVUOG2C.mjs.map +7 -0
- package/dist/lib/browser/{chunk-AVLRQF6L.mjs → chunk-LZEGRS7H.mjs} +1 -1
- package/dist/lib/browser/chunk-LZEGRS7H.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +249 -595
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/types/index.mjs +3 -7
- package/dist/lib/node/{chunk-P4XUXM7Y.cjs → chunk-6CNYF6YU.cjs} +4 -4
- package/dist/lib/node/chunk-6CNYF6YU.cjs.map +7 -0
- package/dist/lib/node/{chunk-CTYDNFGG.cjs → chunk-CVZPI2P3.cjs} +9 -30
- package/dist/lib/node/chunk-CVZPI2P3.cjs.map +7 -0
- package/dist/lib/node/index.cjs +470 -813
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.cjs +5 -5
- package/dist/lib/node/meta.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +10 -14
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/components/EmptySpace.d.ts +3 -0
- package/dist/types/src/components/EmptySpace.d.ts.map +1 -0
- package/dist/types/src/components/EmptyTree.d.ts +3 -0
- package/dist/types/src/components/EmptyTree.d.ts.map +1 -0
- package/dist/types/src/components/MenuFooter.d.ts +1 -1
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts +0 -4
- package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceMain/SpaceMain.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +0 -4
- package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceSettings.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +0 -4
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +1 -15
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -18
- 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/package.json +36 -44
- package/src/SpacePlugin.tsx +86 -149
- package/src/components/EmptySpace.tsx +25 -0
- package/src/components/EmptyTree.tsx +25 -0
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/SpaceMain/SpaceMain.tsx +22 -1
- package/src/components/SpacePresence.tsx +1 -1
- package/src/components/SpaceSettings.tsx +3 -32
- package/src/components/index.ts +2 -3
- package/src/meta.ts +1 -3
- package/src/translations.ts +0 -4
- package/src/types/collection.ts +1 -1
- package/src/types/thread.ts +2 -12
- package/src/types/types.ts +1 -25
- package/src/util.tsx +55 -20
- package/dist/lib/browser/chunk-47SVNCZM.mjs.map +0 -7
- package/dist/lib/browser/chunk-AVLRQF6L.mjs.map +0 -7
- package/dist/lib/node/chunk-CTYDNFGG.cjs.map +0 -7
- package/dist/lib/node/chunk-P4XUXM7Y.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-PLPMYTLC.mjs +0 -116
- package/dist/lib/node-esm/chunk-PLPMYTLC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YPQGKWHJ.mjs +0 -37
- package/dist/lib/node-esm/chunk-YPQGKWHJ.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -2987
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/meta.mjs +0 -14
- package/dist/lib/node-esm/meta.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -26
- package/dist/lib/node-esm/types/index.mjs.map +0 -7
- package/dist/types/src/components/FallbackSettings.d.ts +0 -8
- package/dist/types/src/components/FallbackSettings.d.ts.map +0 -1
- package/dist/types/src/components/SaveStatus.d.ts +0 -3
- package/dist/types/src/components/SaveStatus.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +0 -13
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +0 -117
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/index.d.ts +0 -2
- package/dist/types/src/components/SyncStatus/index.d.ts.map +0 -1
- package/dist/types/src/components/SyncStatus/types.d.ts +0 -14
- package/dist/types/src/components/SyncStatus/types.d.ts.map +0 -1
- package/src/components/FallbackSettings.tsx +0 -35
- package/src/components/SaveStatus.tsx +0 -95
- package/src/components/SyncStatus/SyncStatus.stories.tsx +0 -62
- package/src/components/SyncStatus/SyncStatus.tsx +0 -188
- package/src/components/SyncStatus/index.ts +0 -5
- package/src/components/SyncStatus/types.ts +0 -77
|
@@ -4,17 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { useIntentDispatcher
|
|
7
|
+
import { useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { SettingsValue } from '@dxos/plugin-settings';
|
|
9
|
-
import { Input,
|
|
9
|
+
import { Input, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
|
|
11
11
|
import { SpaceAction, SPACE_PLUGIN } from '../meta';
|
|
12
|
-
import {
|
|
12
|
+
import { type SpaceSettingsProps } from '../types';
|
|
13
13
|
|
|
14
14
|
export const SpaceSettings = ({ settings }: { settings: SpaceSettingsProps }) => {
|
|
15
15
|
const { t } = useTranslation(SPACE_PLUGIN);
|
|
16
16
|
const dispatch = useIntentDispatcher();
|
|
17
|
-
const plugins = useResolvePlugins(parseSpaceInitPlugin);
|
|
18
17
|
|
|
19
18
|
return (
|
|
20
19
|
<>
|
|
@@ -30,34 +29,6 @@ export const SpaceSettings = ({ settings }: { settings: SpaceSettingsProps }) =>
|
|
|
30
29
|
}
|
|
31
30
|
/>
|
|
32
31
|
</SettingsValue>
|
|
33
|
-
|
|
34
|
-
<SettingsValue label={t('default on space create label')}>
|
|
35
|
-
<Select.Root
|
|
36
|
-
value={settings.onSpaceCreate}
|
|
37
|
-
onValueChange={(value) => {
|
|
38
|
-
settings.onSpaceCreate = value;
|
|
39
|
-
}}
|
|
40
|
-
>
|
|
41
|
-
<Select.TriggerButton />
|
|
42
|
-
<Select.Portal>
|
|
43
|
-
<Select.Content>
|
|
44
|
-
<Select.Viewport>
|
|
45
|
-
{plugins.map(
|
|
46
|
-
({
|
|
47
|
-
provides: {
|
|
48
|
-
space: { onSpaceCreate },
|
|
49
|
-
},
|
|
50
|
-
}) => (
|
|
51
|
-
<Select.Option key={onSpaceCreate.action} value={onSpaceCreate.action}>
|
|
52
|
-
{toLocalizedString(onSpaceCreate.label, t)}
|
|
53
|
-
</Select.Option>
|
|
54
|
-
),
|
|
55
|
-
)}
|
|
56
|
-
</Select.Viewport>
|
|
57
|
-
</Select.Content>
|
|
58
|
-
</Select.Portal>
|
|
59
|
-
</Select.Root>
|
|
60
|
-
</SettingsValue>
|
|
61
32
|
</>
|
|
62
33
|
);
|
|
63
34
|
};
|
package/src/components/index.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
export * from './AwaitingObject';
|
|
6
6
|
export * from './CollectionMain';
|
|
7
7
|
export * from './CollectionSection';
|
|
8
|
-
export * from './
|
|
8
|
+
export * from './EmptySpace';
|
|
9
|
+
export * from './EmptyTree';
|
|
9
10
|
export * from './MenuFooter';
|
|
10
11
|
export * from './MissingObject';
|
|
11
12
|
export * from './PersistenceStatus';
|
|
@@ -15,5 +16,3 @@ export * from './ShareSpaceButton';
|
|
|
15
16
|
export * from './SpaceMain';
|
|
16
17
|
export * from './SpacePresence';
|
|
17
18
|
export * from './SpaceSettings';
|
|
18
|
-
export * from './SaveStatus';
|
|
19
|
-
export * from './SyncStatus';
|
package/src/meta.ts
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
5
|
export const SPACE_PLUGIN = 'dxos.org/plugin/space';
|
|
8
6
|
export const SPACE_PLUGIN_SHORT_ID = 'space';
|
|
9
7
|
|
|
@@ -11,7 +9,7 @@ export default {
|
|
|
11
9
|
id: SPACE_PLUGIN,
|
|
12
10
|
shortId: SPACE_PLUGIN_SHORT_ID,
|
|
13
11
|
name: 'Spaces',
|
|
14
|
-
}
|
|
12
|
+
};
|
|
15
13
|
|
|
16
14
|
const SPACE_ACTION = `${SPACE_PLUGIN}/action`;
|
|
17
15
|
export enum SpaceAction {
|
package/src/translations.ts
CHANGED
|
@@ -86,10 +86,6 @@ export default [
|
|
|
86
86
|
'remove deleted objects label': 'Cleanup',
|
|
87
87
|
'remove deleted objects alt': 'Permanently remove deleted objects to free up space.',
|
|
88
88
|
'copy link label': 'Copy link',
|
|
89
|
-
'default on space create label': 'On space create',
|
|
90
|
-
'sync status title': 'Sync status',
|
|
91
|
-
'name label': 'Name',
|
|
92
|
-
'name placeholder': 'Name',
|
|
93
89
|
},
|
|
94
90
|
},
|
|
95
91
|
},
|
package/src/types/collection.ts
CHANGED
|
@@ -12,5 +12,5 @@ export class CollectionType extends TypedObject({ typename: 'dxos.org/type/Colle
|
|
|
12
12
|
// This also leaves open a future where this key could be changed to allow for multiple stack views per section.
|
|
13
13
|
// TODO(wittjosiah): Any way to make this more type safe?
|
|
14
14
|
// TODO(wittjosiah): Should the views be separate objects or just be schemas for view data in this record?
|
|
15
|
-
views: S.mutable(S.Record(
|
|
15
|
+
views: S.mutable(S.Record(S.String, ref(Expando))),
|
|
16
16
|
}) {}
|
package/src/types/thread.ts
CHANGED
|
@@ -34,26 +34,17 @@ export const ActorSchema = S.mutable(
|
|
|
34
34
|
|
|
35
35
|
export type ActorType = S.Schema.Type<typeof ActorSchema>;
|
|
36
36
|
|
|
37
|
-
export enum MessageState {
|
|
38
|
-
NONE = 0,
|
|
39
|
-
ARCHIVED = 1,
|
|
40
|
-
DELETED = 2,
|
|
41
|
-
SPAM = 3,
|
|
42
|
-
}
|
|
43
|
-
|
|
44
37
|
export class MessageType extends TypedObject({ typename: 'dxos.org/type/Message', version: '0.1.0' })({
|
|
45
38
|
/** ISO date string when the message was sent. */
|
|
46
39
|
timestamp: S.String,
|
|
47
|
-
/** Message state. */
|
|
48
|
-
state: S.optional(S.Enums(MessageState)),
|
|
49
40
|
/** Identity of the message sender. */
|
|
50
41
|
sender: ActorSchema,
|
|
51
42
|
/** Text content of the message. */
|
|
52
43
|
text: S.String,
|
|
53
|
-
/** Non-text content sent with a message (e.g
|
|
44
|
+
/** Non-text content sent with a message (e.g. files, polls, etc.) */
|
|
54
45
|
parts: S.optional(S.mutable(S.Array(ref(Expando)))),
|
|
55
46
|
/** Custom properties for specific message types (e.g. email subject or cc fields). */
|
|
56
|
-
properties: S.optional(S.mutable(S.Record(
|
|
47
|
+
properties: S.optional(S.mutable(S.Record(S.String, S.Any))),
|
|
57
48
|
// TODO(wittjosiah): Add read status:
|
|
58
49
|
// - Read receipts need to be per space member.
|
|
59
50
|
// - Read receipts don't need to be added to schema until they being implemented.
|
|
@@ -66,7 +57,6 @@ export const ThreadStatus = S.Union(S.Literal('staged'), S.Literal('active'), S.
|
|
|
66
57
|
|
|
67
58
|
export class ThreadType extends TypedObject({ typename: 'dxos.org/type/Thread', version: '0.1.0' })({
|
|
68
59
|
name: S.optional(S.String),
|
|
69
|
-
/** AM cursor-range: 'from:to'. */
|
|
70
60
|
anchor: S.optional(S.String),
|
|
71
61
|
status: S.optional(ThreadStatus),
|
|
72
62
|
messages: S.mutable(S.Array(ref(MessageType))),
|
package/src/types/types.ts
CHANGED
|
@@ -10,12 +10,10 @@ import type {
|
|
|
10
10
|
SettingsProvides,
|
|
11
11
|
SurfaceProvides,
|
|
12
12
|
TranslationsProvides,
|
|
13
|
-
Plugin,
|
|
14
13
|
} from '@dxos/app-framework';
|
|
15
14
|
import { type Expando } from '@dxos/echo-schema';
|
|
16
15
|
import { type SchemaProvides } from '@dxos/plugin-client';
|
|
17
16
|
import { type PublicKey } from '@dxos/react-client';
|
|
18
|
-
import { type Label } from '@dxos/react-ui';
|
|
19
17
|
import { type ComplexMap } from '@dxos/util';
|
|
20
18
|
|
|
21
19
|
export const SPACE_DIRECTORY_HANDLE = 'dxos.org/plugin/space/directory';
|
|
@@ -55,29 +53,7 @@ export type PluginState = {
|
|
|
55
53
|
sdkMigrationRunning: Record<string, boolean>;
|
|
56
54
|
};
|
|
57
55
|
|
|
58
|
-
export type SpaceSettingsProps = {
|
|
59
|
-
/**
|
|
60
|
-
* Show closed spaces.
|
|
61
|
-
*/
|
|
62
|
-
showHidden?: boolean;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Action to perform when a space is created.
|
|
66
|
-
*/
|
|
67
|
-
onSpaceCreate?: string;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export type SpaceInitProvides = {
|
|
71
|
-
space: {
|
|
72
|
-
onSpaceCreate: {
|
|
73
|
-
label: Label;
|
|
74
|
-
action: string;
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export const parseSpaceInitPlugin = (plugin: Plugin) =>
|
|
80
|
-
typeof (plugin.provides as any).space?.onSpaceCreate === 'object' ? (plugin as Plugin<SpaceInitProvides>) : undefined;
|
|
56
|
+
export type SpaceSettingsProps = { showHidden?: boolean };
|
|
81
57
|
|
|
82
58
|
export type SpacePluginProvides = SurfaceProvides &
|
|
83
59
|
IntentResolverProvides &
|
package/src/util.tsx
CHANGED
|
@@ -2,14 +2,33 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import {
|
|
6
|
+
CardsThree,
|
|
7
|
+
Database,
|
|
8
|
+
PencilSimpleLine,
|
|
9
|
+
Planet,
|
|
10
|
+
Plus,
|
|
11
|
+
Trash,
|
|
12
|
+
Users,
|
|
13
|
+
X,
|
|
14
|
+
ClockCounterClockwise,
|
|
15
|
+
type IconProps,
|
|
16
|
+
LockSimpleOpen,
|
|
17
|
+
LockSimple,
|
|
18
|
+
Placeholder,
|
|
19
|
+
Link,
|
|
20
|
+
} from '@phosphor-icons/react';
|
|
21
|
+
import React from 'react';
|
|
22
|
+
|
|
5
23
|
import { type MetadataResolver, NavigationAction, type IntentDispatcher } from '@dxos/app-framework';
|
|
6
24
|
import {
|
|
25
|
+
type EchoReactiveObject,
|
|
7
26
|
create,
|
|
8
27
|
isReactiveObject,
|
|
9
28
|
getTypename,
|
|
10
|
-
getSchema,
|
|
11
|
-
getObjectAnnotation,
|
|
12
29
|
type Expando,
|
|
30
|
+
getSchema,
|
|
31
|
+
getEchoObjectAnnotation,
|
|
13
32
|
EXPANDO_TYPENAME,
|
|
14
33
|
} from '@dxos/echo-schema';
|
|
15
34
|
import { invariant } from '@dxos/invariant';
|
|
@@ -28,17 +47,16 @@ import {
|
|
|
28
47
|
memoize,
|
|
29
48
|
} from '@dxos/plugin-graph';
|
|
30
49
|
import {
|
|
50
|
+
SpaceState,
|
|
31
51
|
fullyQualifiedId,
|
|
32
52
|
getSpace,
|
|
33
53
|
isEchoObject,
|
|
34
54
|
isSpace,
|
|
35
55
|
type Echo,
|
|
36
|
-
type EchoReactiveObject,
|
|
37
56
|
type FilterSource,
|
|
38
57
|
type Query,
|
|
39
58
|
type QueryOptions,
|
|
40
59
|
type Space,
|
|
41
|
-
SpaceState,
|
|
42
60
|
} from '@dxos/react-client/echo';
|
|
43
61
|
|
|
44
62
|
import { SpaceAction, SPACE_PLUGIN } from './meta';
|
|
@@ -200,7 +218,8 @@ export const constructSpaceNode = ({
|
|
|
200
218
|
...partials,
|
|
201
219
|
label: getSpaceDisplayName(space, { personal, namesCache }),
|
|
202
220
|
description: space.state.get() === SpaceState.SPACE_READY && space.properties.description,
|
|
203
|
-
icon:
|
|
221
|
+
icon: (props: IconProps) => <Planet {...props} />,
|
|
222
|
+
iconSymbol: 'ph--planet--regular',
|
|
204
223
|
disabled: space.state.get() !== SpaceState.SPACE_READY || hasPendingMigration,
|
|
205
224
|
testId: 'spacePlugin.space',
|
|
206
225
|
},
|
|
@@ -224,7 +243,8 @@ export const constructSpaceActionGroups = ({ space, dispatch }: { space: Space;
|
|
|
224
243
|
data: actionGroupSymbol,
|
|
225
244
|
properties: {
|
|
226
245
|
label: ['create object in space label', { ns: SPACE_PLUGIN }],
|
|
227
|
-
icon:
|
|
246
|
+
icon: (props: IconProps) => <Plus {...props} />,
|
|
247
|
+
iconSymbol: 'ph--plus--regular',
|
|
228
248
|
disposition: 'toolbar',
|
|
229
249
|
// TODO(wittjosiah): This is currently a navtree feature. Address this with cmd+k integration.
|
|
230
250
|
// mainAreaDisposition: 'in-flow',
|
|
@@ -248,7 +268,8 @@ export const constructSpaceActionGroups = ({ space, dispatch }: { space: Space;
|
|
|
248
268
|
]),
|
|
249
269
|
properties: {
|
|
250
270
|
label: ['create collection label', { ns: SPACE_PLUGIN }],
|
|
251
|
-
icon:
|
|
271
|
+
icon: (props: IconProps) => <CardsThree {...props} />,
|
|
272
|
+
iconSymbol: 'ph--cards-three--regular',
|
|
252
273
|
testId: 'spacePlugin.createCollection',
|
|
253
274
|
},
|
|
254
275
|
},
|
|
@@ -284,7 +305,8 @@ export const constructSpaceActions = ({
|
|
|
284
305
|
},
|
|
285
306
|
properties: {
|
|
286
307
|
label: ['migrate space label', { ns: SPACE_PLUGIN }],
|
|
287
|
-
icon:
|
|
308
|
+
icon: (props: IconProps) => <Database {...props} />,
|
|
309
|
+
iconSymbol: 'ph--database--regular',
|
|
288
310
|
disposition: 'toolbar',
|
|
289
311
|
mainAreaDisposition: 'in-flow',
|
|
290
312
|
disabled: migrating || Migrations.running(space),
|
|
@@ -306,7 +328,8 @@ export const constructSpaceActions = ({
|
|
|
306
328
|
},
|
|
307
329
|
properties: {
|
|
308
330
|
label: ['share space label', { ns: SPACE_PLUGIN }],
|
|
309
|
-
icon:
|
|
331
|
+
icon: (props: IconProps) => <Users {...props} />,
|
|
332
|
+
iconSymbol: 'ph--users--regular',
|
|
310
333
|
disabled: locked,
|
|
311
334
|
keyBinding: {
|
|
312
335
|
macos: 'meta+.',
|
|
@@ -327,7 +350,10 @@ export const constructSpaceActions = ({
|
|
|
327
350
|
},
|
|
328
351
|
properties: {
|
|
329
352
|
label: [locked ? 'unlock space label' : 'lock space label', { ns: SPACE_PLUGIN }],
|
|
330
|
-
icon: locked
|
|
353
|
+
icon: locked
|
|
354
|
+
? (props: IconProps) => <LockSimpleOpen {...props} />
|
|
355
|
+
: (props: IconProps) => <LockSimple {...props} />,
|
|
356
|
+
iconSymbol: locked ? 'ph--lock-simple-open--regular' : 'ph--lock-simple--regular',
|
|
331
357
|
},
|
|
332
358
|
},
|
|
333
359
|
{
|
|
@@ -338,7 +364,8 @@ export const constructSpaceActions = ({
|
|
|
338
364
|
},
|
|
339
365
|
properties: {
|
|
340
366
|
label: ['rename space label', { ns: SPACE_PLUGIN }],
|
|
341
|
-
icon:
|
|
367
|
+
icon: (props: IconProps) => <PencilSimpleLine {...props} />,
|
|
368
|
+
iconSymbol: 'ph--pencil-simple-line--regular',
|
|
342
369
|
keyBinding: {
|
|
343
370
|
macos: 'shift+F6',
|
|
344
371
|
windows: 'shift+F6',
|
|
@@ -358,7 +385,8 @@ export const constructSpaceActions = ({
|
|
|
358
385
|
},
|
|
359
386
|
properties: {
|
|
360
387
|
label: ['close space label', { ns: SPACE_PLUGIN }],
|
|
361
|
-
icon:
|
|
388
|
+
icon: (props: IconProps) => <X {...props} />,
|
|
389
|
+
iconSymbol: 'ph--x--regular',
|
|
362
390
|
mainAreaDisposition: 'menu',
|
|
363
391
|
disabled: personal,
|
|
364
392
|
},
|
|
@@ -374,7 +402,8 @@ export const constructSpaceActions = ({
|
|
|
374
402
|
},
|
|
375
403
|
properties: {
|
|
376
404
|
label: ['open space label', { ns: SPACE_PLUGIN }],
|
|
377
|
-
icon:
|
|
405
|
+
icon: (props: IconProps) => <ClockCounterClockwise {...props} />,
|
|
406
|
+
iconSymbol: 'ph--clock-counter-clockwise--regular',
|
|
378
407
|
disposition: 'toolbar',
|
|
379
408
|
mainAreaDisposition: 'in-flow',
|
|
380
409
|
},
|
|
@@ -417,7 +446,8 @@ export const createObjectNode = ({
|
|
|
417
446
|
label: metadata.label?.(object) ||
|
|
418
447
|
object.name ||
|
|
419
448
|
metadata.placeholder || ['unnamed object label', { ns: SPACE_PLUGIN }],
|
|
420
|
-
icon: metadata.icon ??
|
|
449
|
+
icon: metadata.icon ?? (() => <Placeholder />),
|
|
450
|
+
iconSymbol: metadata.iconSymbol ?? 'ph--placeholder--regular',
|
|
421
451
|
testId: 'spacePlugin.object',
|
|
422
452
|
persistenceClass: 'echo',
|
|
423
453
|
persistenceKey: space?.id,
|
|
@@ -445,7 +475,8 @@ export const constructObjectActionGroups = ({
|
|
|
445
475
|
data: actionGroupSymbol,
|
|
446
476
|
properties: {
|
|
447
477
|
label: ['create object in collection label', { ns: SPACE_PLUGIN }],
|
|
448
|
-
icon:
|
|
478
|
+
icon: (props: IconProps) => <Plus {...props} />,
|
|
479
|
+
iconSymbol: 'ph--plus--regular',
|
|
449
480
|
disposition: 'toolbar',
|
|
450
481
|
// TODO(wittjosiah): This is currently a navtree feature. Address this with cmd+k integration.
|
|
451
482
|
// mainAreaDisposition: 'in-flow',
|
|
@@ -469,7 +500,8 @@ export const constructObjectActionGroups = ({
|
|
|
469
500
|
]),
|
|
470
501
|
properties: {
|
|
471
502
|
label: ['create collection label', { ns: SPACE_PLUGIN }],
|
|
472
|
-
icon:
|
|
503
|
+
icon: (props: IconProps) => <CardsThree {...props} />,
|
|
504
|
+
iconSymbol: 'ph--cards-three--regular',
|
|
473
505
|
testId: 'spacePlugin.createCollection',
|
|
474
506
|
},
|
|
475
507
|
},
|
|
@@ -504,7 +536,8 @@ export const constructObjectActions = ({
|
|
|
504
536
|
object instanceof CollectionType ? 'rename collection label' : 'rename object label',
|
|
505
537
|
{ ns: SPACE_PLUGIN },
|
|
506
538
|
],
|
|
507
|
-
icon:
|
|
539
|
+
icon: (props: IconProps) => <PencilSimpleLine {...props} />,
|
|
540
|
+
iconSymbol: 'ph--pencil-simple-line--regular',
|
|
508
541
|
// TODO(wittjosiah): Doesn't work.
|
|
509
542
|
// keyBinding: 'shift+F6',
|
|
510
543
|
testId: 'spacePlugin.renameObject',
|
|
@@ -530,7 +563,8 @@ export const constructObjectActions = ({
|
|
|
530
563
|
object instanceof CollectionType ? 'delete collection label' : 'delete object label',
|
|
531
564
|
{ ns: SPACE_PLUGIN },
|
|
532
565
|
],
|
|
533
|
-
icon:
|
|
566
|
+
icon: (props: IconProps) => <Trash {...props} />,
|
|
567
|
+
iconSymbol: 'ph--trash--regular',
|
|
534
568
|
keyBinding: object instanceof CollectionType ? undefined : 'shift+meta+Backspace',
|
|
535
569
|
testId: 'spacePlugin.deleteObject',
|
|
536
570
|
},
|
|
@@ -544,7 +578,8 @@ export const constructObjectActions = ({
|
|
|
544
578
|
},
|
|
545
579
|
properties: {
|
|
546
580
|
label: ['copy link label', { ns: SPACE_PLUGIN }],
|
|
547
|
-
icon:
|
|
581
|
+
icon: (props: IconProps) => <Link {...props} />,
|
|
582
|
+
iconSymbol: 'ph--link--regular',
|
|
548
583
|
testId: 'spacePlugin.copyLink',
|
|
549
584
|
},
|
|
550
585
|
},
|
|
@@ -598,7 +633,7 @@ export const getNestedObjects = async (
|
|
|
598
633
|
// TODO(burdon): Remove.
|
|
599
634
|
export const cloneObject = async (object: Expando, resolve: MetadataResolver): Promise<Expando> => {
|
|
600
635
|
const schema = getSchema(object);
|
|
601
|
-
const typename = schema ?
|
|
636
|
+
const typename = schema ? getEchoObjectAnnotation(schema)?.typename ?? EXPANDO_TYPENAME : EXPANDO_TYPENAME;
|
|
602
637
|
const metadata = resolve(typename);
|
|
603
638
|
const serializer = metadata.serializer;
|
|
604
639
|
invariant(serializer, `No serializer for type: ${typename}`);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/collection.ts", "../../../src/types/thread.ts", "../../../src/types/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\nexport class CollectionType extends TypedObject({ typename: 'dxos.org/type/Collection', version: '0.1.0' })({\n name: S.optional(S.String),\n objects: S.mutable(S.Array(ref(Expando))),\n // Key is schema typename and value is reference to a view object of the associated schema.\n // Having collection reference the views rather than vice versa ensures that the state converges to a single view per key (i.e. type).\n // This also leaves open a future where this key could be changed to allow for multiple stack views per section.\n // TODO(wittjosiah): Any way to make this more type safe?\n // TODO(wittjosiah): Should the views be separate objects or just be schemas for view data in this record?\n views: S.mutable(S.Record({ key: S.String, value: ref(Expando) })),\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(wittjosiah): These types were placed here rather than in @dxos/plugin-thread\n// in order to avoid a circular dependency between threads and other objects that use threads.\n\n// TODO(wittjosiah): Factor out to halo?\nexport class ContactType extends TypedObject({ typename: 'dxos.org/type/Contact', version: '0.1.0' })({\n name: S.optional(S.String),\n identifiers: S.mutable(\n S.Array(\n S.Struct({\n type: S.String,\n value: S.String,\n }),\n ),\n ),\n}) {}\n\nexport const ActorSchema = S.mutable(\n S.Struct({\n contact: S.optional(ref(ContactType)),\n // TODO(wittjosiah): Should the below fields just be the contact schema?\n // i.e. it should either be a reference to an existing contact or an inline contact schema.\n identityKey: S.optional(S.String),\n // TODO(burdon): Generalize to handle/identifier?\n email: S.optional(S.String),\n name: S.optional(S.String),\n }),\n);\n\nexport type ActorType = S.Schema.Type<typeof ActorSchema>;\n\nexport enum MessageState {\n NONE = 0,\n ARCHIVED = 1,\n DELETED = 2,\n SPAM = 3,\n}\n\nexport class MessageType extends TypedObject({ typename: 'dxos.org/type/Message', version: '0.1.0' })({\n /** ISO date string when the message was sent. */\n timestamp: S.String,\n /** Message state. */\n state: S.optional(S.Enums(MessageState)),\n /** Identity of the message sender. */\n sender: ActorSchema,\n /** Text content of the message. */\n text: S.String,\n /** Non-text content sent with a message (e.g., files, polls, etc.) */\n parts: S.optional(S.mutable(S.Array(ref(Expando)))),\n /** Custom properties for specific message types (e.g. email subject or cc fields). */\n properties: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),\n // TODO(wittjosiah): Add read status:\n // - Read receipts need to be per space member.\n // - Read receipts don't need to be added to schema until they being implemented.\n /** Context of the application when message was created. */\n // TODO(burdon): Evolve \"attention object\" to be current UX state? E.g., of Deck?\n context: S.optional(ref(Expando)),\n}) {}\n\nexport const ThreadStatus = S.Union(S.Literal('staged'), S.Literal('active'), S.Literal('resolved'));\n\nexport class ThreadType extends TypedObject({ typename: 'dxos.org/type/Thread', version: '0.1.0' })({\n name: S.optional(S.String),\n /** AM cursor-range: 'from:to'. */\n anchor: S.optional(S.String),\n status: S.optional(ThreadStatus),\n messages: S.mutable(S.Array(ref(MessageType))),\n}) {}\n\nexport class ChannelType extends TypedObject({ typename: 'dxos.org/type/Channel', version: '0.1.0' })({\n name: S.optional(S.String),\n threads: S.mutable(S.Array(ref(ThreadType))),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n GraphSerializerProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SettingsProvides,\n SurfaceProvides,\n TranslationsProvides,\n Plugin,\n} from '@dxos/app-framework';\nimport { type Expando } from '@dxos/echo-schema';\nimport { type SchemaProvides } from '@dxos/plugin-client';\nimport { type PublicKey } from '@dxos/react-client';\nimport { type Label } from '@dxos/react-ui';\nimport { type ComplexMap } from '@dxos/util';\n\nexport const SPACE_DIRECTORY_HANDLE = 'dxos.org/plugin/space/directory';\n\nexport type ObjectViewerProps = {\n lastSeen: number;\n currentlyAttended: boolean;\n};\n\nexport type ObjectId = string;\n\nexport type PluginState = {\n /**\n * Which objects are currently being viewed by which peers.\n */\n viewersByObject: Record<ObjectId, ComplexMap<PublicKey, ObjectViewerProps>>;\n\n /**\n * Which peers are currently viewing which objects.\n */\n viewersByIdentity: ComplexMap<PublicKey, Set<ObjectId>>;\n\n /**\n * Object that was linked to directly but not found and is being awaited.\n */\n awaiting: string | undefined;\n\n /**\n * Cached space names, used when spaces are closed or loading.\n */\n spaceNames: Record<string, string>;\n\n /**\n * Which spaces have an SDK migration running currently.\n */\n // TODO(wittjosiah): Factor out to sdk. Migration running should probably be a space state.\n sdkMigrationRunning: Record<string, boolean>;\n};\n\nexport type SpaceSettingsProps = {\n /**\n * Show closed spaces.\n */\n showHidden?: boolean;\n\n /**\n * Action to perform when a space is created.\n */\n onSpaceCreate?: string;\n};\n\nexport type SpaceInitProvides = {\n space: {\n onSpaceCreate: {\n label: Label;\n action: string;\n };\n };\n};\n\nexport const parseSpaceInitPlugin = (plugin: Plugin) =>\n typeof (plugin.provides as any).space?.onSpaceCreate === 'object' ? (plugin as Plugin<SpaceInitProvides>) : undefined;\n\nexport type SpacePluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n GraphSerializerProvides &\n MetadataRecordsProvides &\n SettingsProvides<SpaceSettingsProps> &\n TranslationsProvides &\n SchemaProvides & {\n space: Readonly<PluginState>;\n };\n\n// TODO(wittjosiah): Reconcile with graph export serializers.\n\nexport type SerializerMap = Record<string, TypedObjectSerializer>;\n\nexport interface TypedObjectSerializer<T extends Expando = Expando> {\n serialize(params: { object: T }): Promise<string>;\n\n /**\n * @param params.content\n * @param params.newId Generate new ID for deserialized object.\n */\n deserialize(params: { content: string; newId?: boolean }): Promise<T>;\n}\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,SAASC,KAAKC,GAAGC,mBAAmB;AAEtC,IAAMC,iBAAN,cAA6BC,YAAY;EAAEC,UAAU;EAA4BC,SAAS;AAAQ,CAAA,EAAG;EAC1GC,MAAMC,EAAEC,SAASD,EAAEE,MAAM;EACzBC,SAASH,EAAEI,QAAQJ,EAAEK,MAAMC,IAAIC,OAAAA,CAAAA,CAAAA;;;;;;EAM/BC,OAAOR,EAAEI,QAAQJ,EAAES,OAAO;IAAEC,KAAKV,EAAEE;IAAQS,OAAOL,IAAIC,OAAAA;EAAS,CAAA,CAAA;AACjE,CAAA,EAAA;AAAI;;;ACXJ,SAASK,WAAAA,UAASC,OAAAA,MAAKC,KAAAA,IAAGC,eAAAA,oBAAmB;AAMtC,IAAMC,cAAN,cAA0BC,aAAY;EAAEC,UAAU;EAAyBC,SAAS;AAAQ,CAAA,EAAG;EACpGC,MAAMC,GAAEC,SAASD,GAAEE,MAAM;EACzBC,aAAaH,GAAEI,QACbJ,GAAEK,MACAL,GAAEM,OAAO;IACPC,MAAMP,GAAEE;IACRM,OAAOR,GAAEE;EACX,CAAA,CAAA,CAAA;AAGN,CAAA,EAAA;AAAI;AAEG,IAAMO,cAAcT,GAAEI,QAC3BJ,GAAEM,OAAO;EACPI,SAASV,GAAEC,SAASU,KAAIhB,WAAAA,CAAAA;;;EAGxBiB,aAAaZ,GAAEC,SAASD,GAAEE,MAAM;;EAEhCW,OAAOb,GAAEC,SAASD,GAAEE,MAAM;EAC1BH,MAAMC,GAAEC,SAASD,GAAEE,MAAM;AAC3B,CAAA,CAAA;;UAKUY,eAAAA;;;;;GAAAA,iBAAAA,eAAAA,CAAAA,EAAAA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,WACnC,OAAQA,OAAOC,SAAiBC,OAAOC,kBAAkB,WAAYH,SAAuCI;",
|
|
6
|
-
"names": ["Expando", "ref", "S", "TypedObject", "CollectionType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "objects", "mutable", "Array", "ref", "Expando", "views", "Record", "key", "value", "Expando", "ref", "S", "TypedObject", "ContactType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "identifiers", "mutable", "Array", "Struct", "type", "value", "ActorSchema", "contact", "ref", "identityKey", "email", "MessageState", "MessageType", "timestamp", "state", "Enums", "sender", "text", "parts", "Expando", "properties", "Record", "key", "Any", "context", "ThreadStatus", "Union", "Literal", "ThreadType", "anchor", "status", "messages", "ChannelType", "threads", "SPACE_DIRECTORY_HANDLE", "parseSpaceInitPlugin", "plugin", "provides", "space", "onSpaceCreate", "undefined"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const SPACE_PLUGIN = 'dxos.org/plugin/space';\nexport const SPACE_PLUGIN_SHORT_ID = 'space';\n\nexport default {\n id: SPACE_PLUGIN,\n shortId: SPACE_PLUGIN_SHORT_ID,\n name: 'Spaces',\n} satisfies PluginMeta;\n\nconst SPACE_ACTION = `${SPACE_PLUGIN}/action`;\nexport enum SpaceAction {\n CREATE = `${SPACE_ACTION}/create`,\n JOIN = `${SPACE_ACTION}/join`,\n SHARE = `${SPACE_ACTION}/share`,\n LOCK = `${SPACE_ACTION}/lock`,\n UNLOCK = `${SPACE_ACTION}/unlock`,\n RENAME = `${SPACE_ACTION}/rename`,\n OPEN = `${SPACE_ACTION}/open`,\n CLOSE = `${SPACE_ACTION}/close`,\n MIGRATE = `${SPACE_ACTION}/migrate`,\n ADD_OBJECT = `${SPACE_ACTION}/add-object`,\n REMOVE_OBJECT = `${SPACE_ACTION}/remove-object`,\n RENAME_OBJECT = `${SPACE_ACTION}/rename-object`,\n DUPLICATE_OBJECT = `${SPACE_ACTION}/duplicate-object`,\n WAIT_FOR_OBJECT = `${SPACE_ACTION}/wait-for-object`,\n TOGGLE_HIDDEN = `${SPACE_ACTION}/toggle-hidden`,\n}\n"],
|
|
5
|
-
"mappings": ";AAMO,IAAMA,eAAe;AACrB,IAAMC,wBAAwB;AAErC,IAAA,eAAe;EACbC,IAAIF;EACJG,SAASF;EACTG,MAAM;AACR;AAEA,IAAMC,eAAe,GAAGL,YAAAA;;UACZM,cAAAA;wCACD,GAAGD,YAAAA,SAAqB,IAAA;sCAC1B,GAAGA,YAAAA,OAAmB,IAAA;uCACrB,GAAGA,YAAAA,QAAoB,IAAA;sCACxB,GAAGA,YAAAA,OAAmB,IAAA;wCACpB,GAAGA,YAAAA,SAAqB,IAAA;wCACxB,GAAGA,YAAAA,SAAqB,IAAA;sCAC1B,GAAGA,YAAAA,OAAmB,IAAA;uCACrB,GAAGA,YAAAA,QAAoB,IAAA;yCACrB,GAAGA,YAAAA,UAAsB,IAAA;4CACtB,GAAGA,YAAAA,aAAyB,IAAA;+CACzB,GAAGA,YAAAA,gBAA4B,IAAA;+CAC/B,GAAGA,YAAAA,gBAA4B,IAAA;kDAC5B,GAAGA,YAAAA,mBAA+B,IAAA;iDACnC,GAAGA,YAAAA,kBAA8B,IAAA;+CACnC,GAAGA,YAAAA,gBAA4B,IAAA;GAfrCC,gBAAAA,cAAAA,CAAAA,EAAAA;",
|
|
6
|
-
"names": ["SPACE_PLUGIN", "SPACE_PLUGIN_SHORT_ID", "id", "shortId", "name", "SPACE_ACTION", "SpaceAction"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/collection.ts", "../../../src/types/thread.ts", "../../../src/types/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\nexport class CollectionType extends TypedObject({ typename: 'dxos.org/type/Collection', version: '0.1.0' })({\n name: S.optional(S.String),\n objects: S.mutable(S.Array(ref(Expando))),\n // Key is schema typename and value is reference to a view object of the associated schema.\n // Having collection reference the views rather than vice versa ensures that the state converges to a single view per key (i.e. type).\n // This also leaves open a future where this key could be changed to allow for multiple stack views per section.\n // TODO(wittjosiah): Any way to make this more type safe?\n // TODO(wittjosiah): Should the views be separate objects or just be schemas for view data in this record?\n views: S.mutable(S.Record({ key: S.String, value: ref(Expando) })),\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(wittjosiah): These types were placed here rather than in @dxos/plugin-thread\n// in order to avoid a circular dependency between threads and other objects that use threads.\n\n// TODO(wittjosiah): Factor out to halo?\nexport class ContactType extends TypedObject({ typename: 'dxos.org/type/Contact', version: '0.1.0' })({\n name: S.optional(S.String),\n identifiers: S.mutable(\n S.Array(\n S.Struct({\n type: S.String,\n value: S.String,\n }),\n ),\n ),\n}) {}\n\nexport const ActorSchema = S.mutable(\n S.Struct({\n contact: S.optional(ref(ContactType)),\n // TODO(wittjosiah): Should the below fields just be the contact schema?\n // i.e. it should either be a reference to an existing contact or an inline contact schema.\n identityKey: S.optional(S.String),\n // TODO(burdon): Generalize to handle/identifier?\n email: S.optional(S.String),\n name: S.optional(S.String),\n }),\n);\n\nexport type ActorType = S.Schema.Type<typeof ActorSchema>;\n\nexport enum MessageState {\n NONE = 0,\n ARCHIVED = 1,\n DELETED = 2,\n SPAM = 3,\n}\n\nexport class MessageType extends TypedObject({ typename: 'dxos.org/type/Message', version: '0.1.0' })({\n /** ISO date string when the message was sent. */\n timestamp: S.String,\n /** Message state. */\n state: S.optional(S.Enums(MessageState)),\n /** Identity of the message sender. */\n sender: ActorSchema,\n /** Text content of the message. */\n text: S.String,\n /** Non-text content sent with a message (e.g., files, polls, etc.) */\n parts: S.optional(S.mutable(S.Array(ref(Expando)))),\n /** Custom properties for specific message types (e.g. email subject or cc fields). */\n properties: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),\n // TODO(wittjosiah): Add read status:\n // - Read receipts need to be per space member.\n // - Read receipts don't need to be added to schema until they being implemented.\n /** Context of the application when message was created. */\n // TODO(burdon): Evolve \"attention object\" to be current UX state? E.g., of Deck?\n context: S.optional(ref(Expando)),\n}) {}\n\nexport const ThreadStatus = S.Union(S.Literal('staged'), S.Literal('active'), S.Literal('resolved'));\n\nexport class ThreadType extends TypedObject({ typename: 'dxos.org/type/Thread', version: '0.1.0' })({\n name: S.optional(S.String),\n /** AM cursor-range: 'from:to'. */\n anchor: S.optional(S.String),\n status: S.optional(ThreadStatus),\n messages: S.mutable(S.Array(ref(MessageType))),\n}) {}\n\nexport class ChannelType extends TypedObject({ typename: 'dxos.org/type/Channel', version: '0.1.0' })({\n name: S.optional(S.String),\n threads: S.mutable(S.Array(ref(ThreadType))),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n GraphSerializerProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SettingsProvides,\n SurfaceProvides,\n TranslationsProvides,\n Plugin,\n} from '@dxos/app-framework';\nimport { type Expando } from '@dxos/echo-schema';\nimport { type SchemaProvides } from '@dxos/plugin-client';\nimport { type PublicKey } from '@dxos/react-client';\nimport { type Label } from '@dxos/react-ui';\nimport { type ComplexMap } from '@dxos/util';\n\nexport const SPACE_DIRECTORY_HANDLE = 'dxos.org/plugin/space/directory';\n\nexport type ObjectViewerProps = {\n lastSeen: number;\n currentlyAttended: boolean;\n};\n\nexport type ObjectId = string;\n\nexport type PluginState = {\n /**\n * Which objects are currently being viewed by which peers.\n */\n viewersByObject: Record<ObjectId, ComplexMap<PublicKey, ObjectViewerProps>>;\n\n /**\n * Which peers are currently viewing which objects.\n */\n viewersByIdentity: ComplexMap<PublicKey, Set<ObjectId>>;\n\n /**\n * Object that was linked to directly but not found and is being awaited.\n */\n awaiting: string | undefined;\n\n /**\n * Cached space names, used when spaces are closed or loading.\n */\n spaceNames: Record<string, string>;\n\n /**\n * Which spaces have an SDK migration running currently.\n */\n // TODO(wittjosiah): Factor out to sdk. Migration running should probably be a space state.\n sdkMigrationRunning: Record<string, boolean>;\n};\n\nexport type SpaceSettingsProps = {\n /**\n * Show closed spaces.\n */\n showHidden?: boolean;\n\n /**\n * Action to perform when a space is created.\n */\n onSpaceCreate?: string;\n};\n\nexport type SpaceInitProvides = {\n space: {\n onSpaceCreate: {\n label: Label;\n action: string;\n };\n };\n};\n\nexport const parseSpaceInitPlugin = (plugin: Plugin) =>\n typeof (plugin.provides as any).space?.onSpaceCreate === 'object' ? (plugin as Plugin<SpaceInitProvides>) : undefined;\n\nexport type SpacePluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n GraphSerializerProvides &\n MetadataRecordsProvides &\n SettingsProvides<SpaceSettingsProps> &\n TranslationsProvides &\n SchemaProvides & {\n space: Readonly<PluginState>;\n };\n\n// TODO(wittjosiah): Reconcile with graph export serializers.\n\nexport type SerializerMap = Record<string, TypedObjectSerializer>;\n\nexport interface TypedObjectSerializer<T extends Expando = Expando> {\n serialize(params: { object: T }): Promise<string>;\n\n /**\n * @param params.content\n * @param params.newId Generate new ID for deserialized object.\n */\n deserialize(params: { content: string; newId?: boolean }): Promise<T>;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAA6C;ACA7C,IAAAA,sBAA6C;ADEtC,IAAMC,iBAAN,kBAA6BC,gCAAY;EAAEC,UAAU;EAA4BC,SAAS;AAAQ,CAAA,EAAG;EAC1GC,MAAMC,qBAAEC,SAASD,qBAAEE,MAAM;EACzBC,SAASH,qBAAEI,QAAQJ,qBAAEK,UAAMC,wBAAIC,0BAAAA,CAAAA,CAAAA;;;;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AYH,SAAuCI;",
|
|
6
|
-
"names": ["import_echo_schema", "CollectionType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "objects", "mutable", "Array", "ref", "Expando", "views", "Record", "key", "value", "ContactType", "identifiers", "Struct", "type", "ActorSchema", "contact", "identityKey", "email", "MessageState", "MessageType", "timestamp", "state", "Enums", "sender", "text", "parts", "properties", "Any", "context", "ThreadStatus", "Union", "Literal", "ThreadType", "anchor", "status", "messages", "ChannelType", "threads", "SPACE_DIRECTORY_HANDLE", "parseSpaceInitPlugin", "plugin", "provides", "space", "onSpaceCreate", "undefined"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const SPACE_PLUGIN = 'dxos.org/plugin/space';\nexport const SPACE_PLUGIN_SHORT_ID = 'space';\n\nexport default {\n id: SPACE_PLUGIN,\n shortId: SPACE_PLUGIN_SHORT_ID,\n name: 'Spaces',\n} satisfies PluginMeta;\n\nconst SPACE_ACTION = `${SPACE_PLUGIN}/action`;\nexport enum SpaceAction {\n CREATE = `${SPACE_ACTION}/create`,\n JOIN = `${SPACE_ACTION}/join`,\n SHARE = `${SPACE_ACTION}/share`,\n LOCK = `${SPACE_ACTION}/lock`,\n UNLOCK = `${SPACE_ACTION}/unlock`,\n RENAME = `${SPACE_ACTION}/rename`,\n OPEN = `${SPACE_ACTION}/open`,\n CLOSE = `${SPACE_ACTION}/close`,\n MIGRATE = `${SPACE_ACTION}/migrate`,\n ADD_OBJECT = `${SPACE_ACTION}/add-object`,\n REMOVE_OBJECT = `${SPACE_ACTION}/remove-object`,\n RENAME_OBJECT = `${SPACE_ACTION}/rename-object`,\n DUPLICATE_OBJECT = `${SPACE_ACTION}/duplicate-object`,\n WAIT_FOR_OBJECT = `${SPACE_ACTION}/wait-for-object`,\n TOGGLE_HIDDEN = `${SPACE_ACTION}/toggle-hidden`,\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAMA,eAAe;AACrB,IAAMC,wBAAwB;AAErC,IAAA,eAAe;EACbC,IAAIF;EACJG,SAASF;EACTG,MAAM;AACR;AAEA,IAAMC,eAAe,GAAGL,YAAAA;;UACZM,cAAAA;wCACD,GAAGD,YAAAA,SAAqB,IAAA;sCAC1B,GAAGA,YAAAA,OAAmB,IAAA;uCACrB,GAAGA,YAAAA,QAAoB,IAAA;sCACxB,GAAGA,YAAAA,OAAmB,IAAA;wCACpB,GAAGA,YAAAA,SAAqB,IAAA;wCACxB,GAAGA,YAAAA,SAAqB,IAAA;sCAC1B,GAAGA,YAAAA,OAAmB,IAAA;uCACrB,GAAGA,YAAAA,QAAoB,IAAA;yCACrB,GAAGA,YAAAA,UAAsB,IAAA;4CACtB,GAAGA,YAAAA,aAAyB,IAAA;+CACzB,GAAGA,YAAAA,gBAA4B,IAAA;+CAC/B,GAAGA,YAAAA,gBAA4B,IAAA;kDAC5B,GAAGA,YAAAA,mBAA+B,IAAA;iDACnC,GAAGA,YAAAA,kBAA8B,IAAA;+CACnC,GAAGA,YAAAA,gBAA4B,IAAA;GAfrCC,gBAAAA,cAAAA,CAAAA,EAAAA;",
|
|
6
|
-
"names": ["SPACE_PLUGIN", "SPACE_PLUGIN_SHORT_ID", "id", "shortId", "name", "SPACE_ACTION", "SpaceAction"]
|
|
7
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// packages/plugins/plugin-space/src/types/collection.ts
|
|
4
|
-
import { Expando, ref, S, TypedObject } from "@dxos/echo-schema";
|
|
5
|
-
var CollectionType = class extends TypedObject({
|
|
6
|
-
typename: "dxos.org/type/Collection",
|
|
7
|
-
version: "0.1.0"
|
|
8
|
-
})({
|
|
9
|
-
name: S.optional(S.String),
|
|
10
|
-
objects: S.mutable(S.Array(ref(Expando))),
|
|
11
|
-
// Key is schema typename and value is reference to a view object of the associated schema.
|
|
12
|
-
// Having collection reference the views rather than vice versa ensures that the state converges to a single view per key (i.e. type).
|
|
13
|
-
// This also leaves open a future where this key could be changed to allow for multiple stack views per section.
|
|
14
|
-
// TODO(wittjosiah): Any way to make this more type safe?
|
|
15
|
-
// TODO(wittjosiah): Should the views be separate objects or just be schemas for view data in this record?
|
|
16
|
-
views: S.mutable(S.Record({
|
|
17
|
-
key: S.String,
|
|
18
|
-
value: ref(Expando)
|
|
19
|
-
}))
|
|
20
|
-
}) {
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// packages/plugins/plugin-space/src/types/thread.ts
|
|
24
|
-
import { Expando as Expando2, ref as ref2, S as S2, TypedObject as TypedObject2 } from "@dxos/echo-schema";
|
|
25
|
-
var ContactType = class extends TypedObject2({
|
|
26
|
-
typename: "dxos.org/type/Contact",
|
|
27
|
-
version: "0.1.0"
|
|
28
|
-
})({
|
|
29
|
-
name: S2.optional(S2.String),
|
|
30
|
-
identifiers: S2.mutable(S2.Array(S2.Struct({
|
|
31
|
-
type: S2.String,
|
|
32
|
-
value: S2.String
|
|
33
|
-
})))
|
|
34
|
-
}) {
|
|
35
|
-
};
|
|
36
|
-
var ActorSchema = S2.mutable(S2.Struct({
|
|
37
|
-
contact: S2.optional(ref2(ContactType)),
|
|
38
|
-
// TODO(wittjosiah): Should the below fields just be the contact schema?
|
|
39
|
-
// i.e. it should either be a reference to an existing contact or an inline contact schema.
|
|
40
|
-
identityKey: S2.optional(S2.String),
|
|
41
|
-
// TODO(burdon): Generalize to handle/identifier?
|
|
42
|
-
email: S2.optional(S2.String),
|
|
43
|
-
name: S2.optional(S2.String)
|
|
44
|
-
}));
|
|
45
|
-
var MessageState;
|
|
46
|
-
(function(MessageState2) {
|
|
47
|
-
MessageState2[MessageState2["NONE"] = 0] = "NONE";
|
|
48
|
-
MessageState2[MessageState2["ARCHIVED"] = 1] = "ARCHIVED";
|
|
49
|
-
MessageState2[MessageState2["DELETED"] = 2] = "DELETED";
|
|
50
|
-
MessageState2[MessageState2["SPAM"] = 3] = "SPAM";
|
|
51
|
-
})(MessageState || (MessageState = {}));
|
|
52
|
-
var MessageType = class extends TypedObject2({
|
|
53
|
-
typename: "dxos.org/type/Message",
|
|
54
|
-
version: "0.1.0"
|
|
55
|
-
})({
|
|
56
|
-
/** ISO date string when the message was sent. */
|
|
57
|
-
timestamp: S2.String,
|
|
58
|
-
/** Message state. */
|
|
59
|
-
state: S2.optional(S2.Enums(MessageState)),
|
|
60
|
-
/** Identity of the message sender. */
|
|
61
|
-
sender: ActorSchema,
|
|
62
|
-
/** Text content of the message. */
|
|
63
|
-
text: S2.String,
|
|
64
|
-
/** Non-text content sent with a message (e.g., files, polls, etc.) */
|
|
65
|
-
parts: S2.optional(S2.mutable(S2.Array(ref2(Expando2)))),
|
|
66
|
-
/** Custom properties for specific message types (e.g. email subject or cc fields). */
|
|
67
|
-
properties: S2.optional(S2.mutable(S2.Record({
|
|
68
|
-
key: S2.String,
|
|
69
|
-
value: S2.Any
|
|
70
|
-
}))),
|
|
71
|
-
// TODO(wittjosiah): Add read status:
|
|
72
|
-
// - Read receipts need to be per space member.
|
|
73
|
-
// - Read receipts don't need to be added to schema until they being implemented.
|
|
74
|
-
/** Context of the application when message was created. */
|
|
75
|
-
// TODO(burdon): Evolve "attention object" to be current UX state? E.g., of Deck?
|
|
76
|
-
context: S2.optional(ref2(Expando2))
|
|
77
|
-
}) {
|
|
78
|
-
};
|
|
79
|
-
var ThreadStatus = S2.Union(S2.Literal("staged"), S2.Literal("active"), S2.Literal("resolved"));
|
|
80
|
-
var ThreadType = class extends TypedObject2({
|
|
81
|
-
typename: "dxos.org/type/Thread",
|
|
82
|
-
version: "0.1.0"
|
|
83
|
-
})({
|
|
84
|
-
name: S2.optional(S2.String),
|
|
85
|
-
/** AM cursor-range: 'from:to'. */
|
|
86
|
-
anchor: S2.optional(S2.String),
|
|
87
|
-
status: S2.optional(ThreadStatus),
|
|
88
|
-
messages: S2.mutable(S2.Array(ref2(MessageType)))
|
|
89
|
-
}) {
|
|
90
|
-
};
|
|
91
|
-
var ChannelType = class extends TypedObject2({
|
|
92
|
-
typename: "dxos.org/type/Channel",
|
|
93
|
-
version: "0.1.0"
|
|
94
|
-
})({
|
|
95
|
-
name: S2.optional(S2.String),
|
|
96
|
-
threads: S2.mutable(S2.Array(ref2(ThreadType)))
|
|
97
|
-
}) {
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
// packages/plugins/plugin-space/src/types/types.ts
|
|
101
|
-
var SPACE_DIRECTORY_HANDLE = "dxos.org/plugin/space/directory";
|
|
102
|
-
var parseSpaceInitPlugin = (plugin) => typeof plugin.provides.space?.onSpaceCreate === "object" ? plugin : void 0;
|
|
103
|
-
|
|
104
|
-
export {
|
|
105
|
-
CollectionType,
|
|
106
|
-
ContactType,
|
|
107
|
-
ActorSchema,
|
|
108
|
-
MessageState,
|
|
109
|
-
MessageType,
|
|
110
|
-
ThreadStatus,
|
|
111
|
-
ThreadType,
|
|
112
|
-
ChannelType,
|
|
113
|
-
SPACE_DIRECTORY_HANDLE,
|
|
114
|
-
parseSpaceInitPlugin
|
|
115
|
-
};
|
|
116
|
-
//# sourceMappingURL=chunk-PLPMYTLC.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/collection.ts", "../../../src/types/thread.ts", "../../../src/types/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\nexport class CollectionType extends TypedObject({ typename: 'dxos.org/type/Collection', version: '0.1.0' })({\n name: S.optional(S.String),\n objects: S.mutable(S.Array(ref(Expando))),\n // Key is schema typename and value is reference to a view object of the associated schema.\n // Having collection reference the views rather than vice versa ensures that the state converges to a single view per key (i.e. type).\n // This also leaves open a future where this key could be changed to allow for multiple stack views per section.\n // TODO(wittjosiah): Any way to make this more type safe?\n // TODO(wittjosiah): Should the views be separate objects or just be schemas for view data in this record?\n views: S.mutable(S.Record({ key: S.String, value: ref(Expando) })),\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(wittjosiah): These types were placed here rather than in @dxos/plugin-thread\n// in order to avoid a circular dependency between threads and other objects that use threads.\n\n// TODO(wittjosiah): Factor out to halo?\nexport class ContactType extends TypedObject({ typename: 'dxos.org/type/Contact', version: '0.1.0' })({\n name: S.optional(S.String),\n identifiers: S.mutable(\n S.Array(\n S.Struct({\n type: S.String,\n value: S.String,\n }),\n ),\n ),\n}) {}\n\nexport const ActorSchema = S.mutable(\n S.Struct({\n contact: S.optional(ref(ContactType)),\n // TODO(wittjosiah): Should the below fields just be the contact schema?\n // i.e. it should either be a reference to an existing contact or an inline contact schema.\n identityKey: S.optional(S.String),\n // TODO(burdon): Generalize to handle/identifier?\n email: S.optional(S.String),\n name: S.optional(S.String),\n }),\n);\n\nexport type ActorType = S.Schema.Type<typeof ActorSchema>;\n\nexport enum MessageState {\n NONE = 0,\n ARCHIVED = 1,\n DELETED = 2,\n SPAM = 3,\n}\n\nexport class MessageType extends TypedObject({ typename: 'dxos.org/type/Message', version: '0.1.0' })({\n /** ISO date string when the message was sent. */\n timestamp: S.String,\n /** Message state. */\n state: S.optional(S.Enums(MessageState)),\n /** Identity of the message sender. */\n sender: ActorSchema,\n /** Text content of the message. */\n text: S.String,\n /** Non-text content sent with a message (e.g., files, polls, etc.) */\n parts: S.optional(S.mutable(S.Array(ref(Expando)))),\n /** Custom properties for specific message types (e.g. email subject or cc fields). */\n properties: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),\n // TODO(wittjosiah): Add read status:\n // - Read receipts need to be per space member.\n // - Read receipts don't need to be added to schema until they being implemented.\n /** Context of the application when message was created. */\n // TODO(burdon): Evolve \"attention object\" to be current UX state? E.g., of Deck?\n context: S.optional(ref(Expando)),\n}) {}\n\nexport const ThreadStatus = S.Union(S.Literal('staged'), S.Literal('active'), S.Literal('resolved'));\n\nexport class ThreadType extends TypedObject({ typename: 'dxos.org/type/Thread', version: '0.1.0' })({\n name: S.optional(S.String),\n /** AM cursor-range: 'from:to'. */\n anchor: S.optional(S.String),\n status: S.optional(ThreadStatus),\n messages: S.mutable(S.Array(ref(MessageType))),\n}) {}\n\nexport class ChannelType extends TypedObject({ typename: 'dxos.org/type/Channel', version: '0.1.0' })({\n name: S.optional(S.String),\n threads: S.mutable(S.Array(ref(ThreadType))),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n GraphSerializerProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SettingsProvides,\n SurfaceProvides,\n TranslationsProvides,\n Plugin,\n} from '@dxos/app-framework';\nimport { type Expando } from '@dxos/echo-schema';\nimport { type SchemaProvides } from '@dxos/plugin-client';\nimport { type PublicKey } from '@dxos/react-client';\nimport { type Label } from '@dxos/react-ui';\nimport { type ComplexMap } from '@dxos/util';\n\nexport const SPACE_DIRECTORY_HANDLE = 'dxos.org/plugin/space/directory';\n\nexport type ObjectViewerProps = {\n lastSeen: number;\n currentlyAttended: boolean;\n};\n\nexport type ObjectId = string;\n\nexport type PluginState = {\n /**\n * Which objects are currently being viewed by which peers.\n */\n viewersByObject: Record<ObjectId, ComplexMap<PublicKey, ObjectViewerProps>>;\n\n /**\n * Which peers are currently viewing which objects.\n */\n viewersByIdentity: ComplexMap<PublicKey, Set<ObjectId>>;\n\n /**\n * Object that was linked to directly but not found and is being awaited.\n */\n awaiting: string | undefined;\n\n /**\n * Cached space names, used when spaces are closed or loading.\n */\n spaceNames: Record<string, string>;\n\n /**\n * Which spaces have an SDK migration running currently.\n */\n // TODO(wittjosiah): Factor out to sdk. Migration running should probably be a space state.\n sdkMigrationRunning: Record<string, boolean>;\n};\n\nexport type SpaceSettingsProps = {\n /**\n * Show closed spaces.\n */\n showHidden?: boolean;\n\n /**\n * Action to perform when a space is created.\n */\n onSpaceCreate?: string;\n};\n\nexport type SpaceInitProvides = {\n space: {\n onSpaceCreate: {\n label: Label;\n action: string;\n };\n };\n};\n\nexport const parseSpaceInitPlugin = (plugin: Plugin) =>\n typeof (plugin.provides as any).space?.onSpaceCreate === 'object' ? (plugin as Plugin<SpaceInitProvides>) : undefined;\n\nexport type SpacePluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n GraphSerializerProvides &\n MetadataRecordsProvides &\n SettingsProvides<SpaceSettingsProps> &\n TranslationsProvides &\n SchemaProvides & {\n space: Readonly<PluginState>;\n };\n\n// TODO(wittjosiah): Reconcile with graph export serializers.\n\nexport type SerializerMap = Record<string, TypedObjectSerializer>;\n\nexport interface TypedObjectSerializer<T extends Expando = Expando> {\n serialize(params: { object: T }): Promise<string>;\n\n /**\n * @param params.content\n * @param params.newId Generate new ID for deserialized object.\n */\n deserialize(params: { content: string; newId?: boolean }): Promise<T>;\n}\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,SAASC,KAAKC,GAAGC,mBAAmB;AAEtC,IAAMC,iBAAN,cAA6BC,YAAY;EAAEC,UAAU;EAA4BC,SAAS;AAAQ,CAAA,EAAG;EAC1GC,MAAMC,EAAEC,SAASD,EAAEE,MAAM;EACzBC,SAASH,EAAEI,QAAQJ,EAAEK,MAAMC,IAAIC,OAAAA,CAAAA,CAAAA;;;;;;EAM/BC,OAAOR,EAAEI,QAAQJ,EAAES,OAAO;IAAEC,KAAKV,EAAEE;IAAQS,OAAOL,IAAIC,OAAAA;EAAS,CAAA,CAAA;AACjE,CAAA,EAAA;AAAI;;;ACXJ,SAASK,WAAAA,UAASC,OAAAA,MAAKC,KAAAA,IAAGC,eAAAA,oBAAmB;AAMtC,IAAMC,cAAN,cAA0BC,aAAY;EAAEC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BC,SAAS;AAAQ,CAAA,EAAG;EAClGC,MAAMC,GAAEC,SAASD,GAAEE,MAAM;;EAEzB8B,QAAQhC,GAAEC,SAASD,GAAEE,MAAM;EAC3B+B,QAAQjC,GAAEC,SAAS2B,YAAAA;EACnBM,UAAUlC,GAAEI,QAAQJ,GAAEK,MAAMM,KAAII,WAAAA,CAAAA,CAAAA;AAClC,CAAA,EAAA;AAAI;AAEG,IAAMoB,cAAN,cAA0BvC,aAAY;EAAEC,UAAU;EAAyBC,SAAS;AAAQ,CAAA,EAAG;EACpGC,MAAMC,GAAEC,SAASD,GAAEE,MAAM;EACzBkC,SAASpC,GAAEI,QAAQJ,GAAEK,MAAMM,KAAIoB,UAAAA,CAAAA,CAAAA;AACjC,CAAA,EAAA;AAAI;;;ACzDG,IAAMM,yBAAyB;AA0D/B,IAAMC,uBAAuB,CAACC,WACnC,OAAQA,OAAOC,SAAiBC,OAAOC,kBAAkB,WAAYH,SAAuCI;",
|
|
6
|
-
"names": ["Expando", "ref", "S", "TypedObject", "CollectionType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "objects", "mutable", "Array", "ref", "Expando", "views", "Record", "key", "value", "Expando", "ref", "S", "TypedObject", "ContactType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "identifiers", "mutable", "Array", "Struct", "type", "value", "ActorSchema", "contact", "ref", "identityKey", "email", "MessageState", "MessageType", "timestamp", "state", "Enums", "sender", "text", "parts", "Expando", "properties", "Record", "key", "Any", "context", "ThreadStatus", "Union", "Literal", "ThreadType", "anchor", "status", "messages", "ChannelType", "threads", "SPACE_DIRECTORY_HANDLE", "parseSpaceInitPlugin", "plugin", "provides", "space", "onSpaceCreate", "undefined"]
|
|
7
|
-
}
|