@dxos/plugin-space 0.6.13 → 0.6.14-main.1366248
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-LZEGRS7H.mjs → chunk-AVLRQF6L.mjs} +1 -1
- package/dist/lib/browser/chunk-AVLRQF6L.mjs.map +7 -0
- package/dist/lib/browser/{chunk-DTVUOG2C.mjs → chunk-WZAM3FNP.mjs} +24 -5
- package/dist/lib/browser/chunk-WZAM3FNP.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +852 -348
- 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 +7 -3
- package/dist/lib/node/{chunk-CVZPI2P3.cjs → chunk-HTAM5LQD.cjs} +30 -9
- package/dist/lib/node/chunk-HTAM5LQD.cjs.map +7 -0
- package/dist/lib/node/{chunk-6CNYF6YU.cjs → chunk-P4XUXM7Y.cjs} +4 -4
- package/dist/lib/node/chunk-P4XUXM7Y.cjs.map +7 -0
- package/dist/lib/node/index.cjs +1046 -550
- 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 +14 -10
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/chunk-TRJKV4PK.mjs +116 -0
- package/dist/lib/node-esm/chunk-TRJKV4PK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YPQGKWHJ.mjs +37 -0
- package/dist/lib/node-esm/chunk-YPQGKWHJ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +3145 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/meta.mjs +14 -0
- package/dist/lib/node-esm/meta.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +26 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/components/DefaultObjectSettings.d.ts +7 -0
- package/dist/types/src/components/DefaultObjectSettings.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 +3 -91
- 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.d.ts +4 -2
- package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
- package/dist/types/src/components/SpacePresence.stories.d.ts +4 -92
- 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/SpaceSettingsPanel.d.ts +7 -0
- package/dist/types/src/components/SpaceSettingsPanel.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/Space.d.ts +8 -0
- package/dist/types/src/components/SyncStatus/Space.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +14 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +9 -0
- package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/index.d.ts +2 -0
- package/dist/types/src/components/SyncStatus/index.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/save-tracker.d.ts +3 -0
- package/dist/types/src/components/SyncStatus/save-tracker.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/status.d.ts +9 -0
- package/dist/types/src/components/SyncStatus/status.d.ts.map +1 -0
- package/dist/types/src/components/SyncStatus/sync-state.d.ts +14 -0
- package/dist/types/src/components/SyncStatus/sync-state.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +3 -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 +14 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +15 -1
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +23 -2
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +4 -7
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +46 -45
- package/src/SpacePlugin.tsx +275 -137
- package/src/components/DefaultObjectSettings.tsx +33 -0
- package/src/components/MenuFooter.tsx +2 -2
- package/src/components/ShareSpaceButton.stories.tsx +11 -7
- package/src/components/SpaceMain/SpaceMain.tsx +1 -22
- package/src/components/SpacePresence.stories.tsx +11 -9
- package/src/components/SpacePresence.tsx +34 -23
- package/src/components/SpaceSettings.tsx +35 -6
- package/src/components/SpaceSettingsPanel.tsx +69 -0
- package/src/components/SyncStatus/Space.tsx +109 -0
- package/src/components/SyncStatus/SyncStatus.stories.tsx +74 -0
- package/src/components/SyncStatus/SyncStatus.tsx +102 -0
- package/src/components/SyncStatus/index.ts +5 -0
- package/src/components/SyncStatus/save-tracker.ts +71 -0
- package/src/components/SyncStatus/status.ts +44 -0
- package/src/components/SyncStatus/sync-state.ts +77 -0
- package/src/components/index.ts +3 -3
- package/src/meta.ts +3 -1
- package/src/translations.ts +16 -2
- package/src/types/collection.ts +1 -1
- package/src/types/thread.ts +12 -2
- package/src/types/types.ts +31 -3
- package/src/util.tsx +23 -58
- package/dist/lib/browser/chunk-DTVUOG2C.mjs.map +0 -7
- package/dist/lib/browser/chunk-LZEGRS7H.mjs.map +0 -7
- package/dist/lib/node/chunk-6CNYF6YU.cjs.map +0 -7
- package/dist/lib/node/chunk-CVZPI2P3.cjs.map +0 -7
- package/dist/types/src/components/EmptySpace.d.ts +0 -3
- package/dist/types/src/components/EmptySpace.d.ts.map +0 -1
- package/dist/types/src/components/EmptyTree.d.ts +0 -3
- package/dist/types/src/components/EmptyTree.d.ts.map +0 -1
- package/dist/types/src/components/MissingObject.d.ts +0 -5
- package/dist/types/src/components/MissingObject.d.ts.map +0 -1
- package/src/components/EmptySpace.tsx +0 -25
- package/src/components/EmptyTree.tsx +0 -25
- package/src/components/MissingObject.tsx +0 -54
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type UnsubscribeCallback } from '@dxos/async';
|
|
6
|
+
import { type Client } from '@dxos/client';
|
|
7
|
+
import { type Space, type SpaceId } from '@dxos/client/echo';
|
|
8
|
+
import { Context } from '@dxos/context';
|
|
9
|
+
|
|
10
|
+
export const createClientSaveTracker = (client: Client, cb: (state: 'saved' | 'saving') => void) => {
|
|
11
|
+
const unsubscribeCallbacks: Record<SpaceId, UnsubscribeCallback> = {};
|
|
12
|
+
const state: Record<SpaceId, 'saved' | 'saving'> = {};
|
|
13
|
+
|
|
14
|
+
const install = (spaces: Space[]) => {
|
|
15
|
+
for (const space of spaces) {
|
|
16
|
+
if (state[space.id]) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
state[space.id] = 'saved';
|
|
21
|
+
unsubscribeCallbacks[space.id] = createSpaceSaveTracker(space, (s) => {
|
|
22
|
+
state[space.id] = s;
|
|
23
|
+
cb(Object.values(state).some((s) => s === 'saving') ? 'saving' : 'saved');
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
client.spaces.subscribe((spaces) => {
|
|
28
|
+
install(spaces);
|
|
29
|
+
});
|
|
30
|
+
install(client.spaces.get());
|
|
31
|
+
|
|
32
|
+
return () => {
|
|
33
|
+
for (const unsubscribe of Object.values(unsubscribeCallbacks)) {
|
|
34
|
+
unsubscribe();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const createSpaceSaveTracker = (space: Space, cb: (state: 'saved' | 'saving') => void): UnsubscribeCallback => {
|
|
40
|
+
const ctx = new Context();
|
|
41
|
+
|
|
42
|
+
void space.waitUntilReady().then(() => {
|
|
43
|
+
if (ctx.disposed) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
let hasUnsavedChanges = false;
|
|
48
|
+
let lastFlushPromise: Promise<void> | undefined;
|
|
49
|
+
space.crud.saveStateChanged.on(ctx, ({ unsavedDocuments }) => {
|
|
50
|
+
hasUnsavedChanges = unsavedDocuments.length > 0;
|
|
51
|
+
});
|
|
52
|
+
space.crud.saveStateChanged.debounce(500).on(ctx, () => {
|
|
53
|
+
if (hasUnsavedChanges) {
|
|
54
|
+
lastFlushPromise = undefined;
|
|
55
|
+
cb('saving');
|
|
56
|
+
} else {
|
|
57
|
+
const flushPromise = space.crud.flush();
|
|
58
|
+
lastFlushPromise = flushPromise;
|
|
59
|
+
void flushPromise.then(() => {
|
|
60
|
+
if (lastFlushPromise === flushPromise) {
|
|
61
|
+
cb('saved');
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
return () => {
|
|
69
|
+
void ctx.dispose();
|
|
70
|
+
};
|
|
71
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
export type Status = 'saving locally' | 'downloading' | 'uploading' | 'offline persisted' | 'remote synced';
|
|
6
|
+
|
|
7
|
+
export const getStatus = ({
|
|
8
|
+
offline,
|
|
9
|
+
saved,
|
|
10
|
+
needsToUpload,
|
|
11
|
+
needsToDownload,
|
|
12
|
+
}: {
|
|
13
|
+
offline: Boolean;
|
|
14
|
+
saved: Boolean;
|
|
15
|
+
needsToUpload: Boolean;
|
|
16
|
+
needsToDownload: Boolean;
|
|
17
|
+
}): Status => {
|
|
18
|
+
if (!saved) {
|
|
19
|
+
return 'saving locally';
|
|
20
|
+
} else if (!offline && needsToDownload) {
|
|
21
|
+
return 'downloading';
|
|
22
|
+
} else if (!offline && needsToUpload) {
|
|
23
|
+
return 'uploading';
|
|
24
|
+
} else if (offline && !needsToUpload && !needsToDownload) {
|
|
25
|
+
return 'offline persisted';
|
|
26
|
+
} else {
|
|
27
|
+
return 'remote synced';
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const getIcon = (status: Status) => {
|
|
32
|
+
switch (status) {
|
|
33
|
+
case 'saving locally':
|
|
34
|
+
return 'ph--download--regular';
|
|
35
|
+
case 'downloading':
|
|
36
|
+
return 'ph--cloud-arrow-down--regular';
|
|
37
|
+
case 'uploading':
|
|
38
|
+
return 'ph--cloud-arrow-up--regular';
|
|
39
|
+
case 'offline persisted':
|
|
40
|
+
return 'ph--check-circle--regular';
|
|
41
|
+
case 'remote synced':
|
|
42
|
+
return 'ph--cloud-check--regular';
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useEffect, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type Space, type SpaceId, type SpaceSyncState } from '@dxos/client/echo';
|
|
8
|
+
import { Context } from '@dxos/context';
|
|
9
|
+
import { EdgeService } from '@dxos/protocols';
|
|
10
|
+
import { useClient } from '@dxos/react-client';
|
|
11
|
+
|
|
12
|
+
export type Progress = { count: number; total: number };
|
|
13
|
+
|
|
14
|
+
export type PeerSyncState = Omit<SpaceSyncState.PeerState, 'peerId'>;
|
|
15
|
+
|
|
16
|
+
export type SpaceSyncStateMap = Record<SpaceId, PeerSyncState>;
|
|
17
|
+
|
|
18
|
+
export const createEmptyEdgeSyncState = (): PeerSyncState => ({
|
|
19
|
+
missingOnLocal: 0,
|
|
20
|
+
missingOnRemote: 0,
|
|
21
|
+
localDocumentCount: 0,
|
|
22
|
+
remoteDocumentCount: 0,
|
|
23
|
+
differentDocuments: 0,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const getSyncSummary = (syncMap: SpaceSyncStateMap): PeerSyncState => {
|
|
27
|
+
return Object.entries(syncMap).reduce<PeerSyncState>((summary, [_spaceId, peerState]) => {
|
|
28
|
+
summary.missingOnLocal += peerState.missingOnLocal;
|
|
29
|
+
summary.missingOnRemote += peerState.missingOnRemote;
|
|
30
|
+
summary.localDocumentCount += peerState.localDocumentCount;
|
|
31
|
+
summary.remoteDocumentCount += peerState.remoteDocumentCount;
|
|
32
|
+
summary.differentDocuments += peerState.differentDocuments;
|
|
33
|
+
return summary;
|
|
34
|
+
}, createEmptyEdgeSyncState());
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const isEdgePeerId = (peerId: string, spaceId: SpaceId) =>
|
|
38
|
+
peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Hook Subscribes to sync state for each space.
|
|
42
|
+
*/
|
|
43
|
+
export const useSyncState = (): SpaceSyncStateMap => {
|
|
44
|
+
const client = useClient();
|
|
45
|
+
const [spaceState, setSpaceState] = useState<SpaceSyncStateMap>({});
|
|
46
|
+
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
const ctx = new Context();
|
|
49
|
+
const createSubscriptions = (spaces: Space[]) => {
|
|
50
|
+
for (const space of spaces) {
|
|
51
|
+
if (spaceState[space.id]) {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
ctx.onDispose(
|
|
56
|
+
space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
57
|
+
const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
|
|
58
|
+
if (syncState) {
|
|
59
|
+
setSpaceState((spaceState) => ({ ...spaceState, [space.id]: syncState }));
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
createSubscriptions(client.spaces.get());
|
|
67
|
+
client.spaces.subscribe((spaces) => {
|
|
68
|
+
createSubscriptions(spaces);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return () => {
|
|
72
|
+
void ctx.dispose();
|
|
73
|
+
};
|
|
74
|
+
}, [client]);
|
|
75
|
+
|
|
76
|
+
return spaceState;
|
|
77
|
+
};
|
package/src/components/index.ts
CHANGED
|
@@ -5,10 +5,8 @@
|
|
|
5
5
|
export * from './AwaitingObject';
|
|
6
6
|
export * from './CollectionMain';
|
|
7
7
|
export * from './CollectionSection';
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './EmptyTree';
|
|
8
|
+
export * from './DefaultObjectSettings';
|
|
10
9
|
export * from './MenuFooter';
|
|
11
|
-
export * from './MissingObject';
|
|
12
10
|
export * from './PersistenceStatus';
|
|
13
11
|
export * from './PopoverRenameObject';
|
|
14
12
|
export * from './PopoverRenameSpace';
|
|
@@ -16,3 +14,5 @@ export * from './ShareSpaceButton';
|
|
|
16
14
|
export * from './SpaceMain';
|
|
17
15
|
export * from './SpacePresence';
|
|
18
16
|
export * from './SpaceSettings';
|
|
17
|
+
export * from './SpaceSettingsPanel';
|
|
18
|
+
export * from './SyncStatus';
|
package/src/meta.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
|
+
|
|
5
7
|
export const SPACE_PLUGIN = 'dxos.org/plugin/space';
|
|
6
8
|
export const SPACE_PLUGIN_SHORT_ID = 'space';
|
|
7
9
|
|
|
@@ -9,7 +11,7 @@ export default {
|
|
|
9
11
|
id: SPACE_PLUGIN,
|
|
10
12
|
shortId: SPACE_PLUGIN_SHORT_ID,
|
|
11
13
|
name: 'Spaces',
|
|
12
|
-
};
|
|
14
|
+
} satisfies PluginMeta;
|
|
13
15
|
|
|
14
16
|
const SPACE_ACTION = `${SPACE_PLUGIN}/action`;
|
|
15
17
|
export enum SpaceAction {
|
package/src/translations.ts
CHANGED
|
@@ -10,8 +10,8 @@ export default [
|
|
|
10
10
|
[SPACE_PLUGIN]: {
|
|
11
11
|
'plugin name': 'Spaces',
|
|
12
12
|
'first run message': 'Nothing selected.',
|
|
13
|
-
'create space label': 'Create
|
|
14
|
-
'join space label': 'Join
|
|
13
|
+
'create space label': 'Create space',
|
|
14
|
+
'join space label': 'Join space',
|
|
15
15
|
'empty space message': 'No documents',
|
|
16
16
|
'empty tree message': 'No spaces',
|
|
17
17
|
'unnamed space label': 'New space',
|
|
@@ -86,6 +86,20 @@ 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
|
+
'dismiss label': 'Dismiss',
|
|
92
|
+
'join success label': 'Successfully joined space',
|
|
93
|
+
'name label': 'Name',
|
|
94
|
+
'name placeholder': 'Name',
|
|
95
|
+
'unnamed object settings label': 'Settings',
|
|
96
|
+
'edge replication label': 'Enable EDGE Replication',
|
|
97
|
+
'saving locally label': 'Writing to disk',
|
|
98
|
+
'downloading label': 'Replicating from peers',
|
|
99
|
+
'uploading label': 'Replicating to peers',
|
|
100
|
+
'offline persisted label': 'Saved to disk (offline)',
|
|
101
|
+
'remote synced label': 'Synced with peers',
|
|
102
|
+
'open settings panel label': 'Show Settings',
|
|
89
103
|
},
|
|
90
104
|
},
|
|
91
105
|
},
|
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(S.String, ref(Expando))),
|
|
15
|
+
views: S.mutable(S.Record({ key: S.String, value: ref(Expando) })),
|
|
16
16
|
}) {}
|
package/src/types/thread.ts
CHANGED
|
@@ -34,17 +34,26 @@ 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
|
+
|
|
37
44
|
export class MessageType extends TypedObject({ typename: 'dxos.org/type/Message', version: '0.1.0' })({
|
|
38
45
|
/** ISO date string when the message was sent. */
|
|
39
46
|
timestamp: S.String,
|
|
47
|
+
/** Message state. */
|
|
48
|
+
state: S.optional(S.Enums(MessageState)),
|
|
40
49
|
/** Identity of the message sender. */
|
|
41
50
|
sender: ActorSchema,
|
|
42
51
|
/** Text content of the message. */
|
|
43
52
|
text: S.String,
|
|
44
|
-
/** Non-text content sent with a message (e.g
|
|
53
|
+
/** Non-text content sent with a message (e.g., files, polls, etc.) */
|
|
45
54
|
parts: S.optional(S.mutable(S.Array(ref(Expando)))),
|
|
46
55
|
/** Custom properties for specific message types (e.g. email subject or cc fields). */
|
|
47
|
-
properties: S.optional(S.mutable(S.Record(S.String, S.Any))),
|
|
56
|
+
properties: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),
|
|
48
57
|
// TODO(wittjosiah): Add read status:
|
|
49
58
|
// - Read receipts need to be per space member.
|
|
50
59
|
// - Read receipts don't need to be added to schema until they being implemented.
|
|
@@ -57,6 +66,7 @@ export const ThreadStatus = S.Union(S.Literal('staged'), S.Literal('active'), S.
|
|
|
57
66
|
|
|
58
67
|
export class ThreadType extends TypedObject({ typename: 'dxos.org/type/Thread', version: '0.1.0' })({
|
|
59
68
|
name: S.optional(S.String),
|
|
69
|
+
/** AM cursor-range: 'from:to'. */
|
|
60
70
|
anchor: S.optional(S.String),
|
|
61
71
|
status: S.optional(ThreadStatus),
|
|
62
72
|
messages: S.mutable(S.Array(ref(MessageType))),
|
package/src/types/types.ts
CHANGED
|
@@ -10,10 +10,14 @@ import type {
|
|
|
10
10
|
SettingsProvides,
|
|
11
11
|
SurfaceProvides,
|
|
12
12
|
TranslationsProvides,
|
|
13
|
+
Plugin,
|
|
13
14
|
} from '@dxos/app-framework';
|
|
14
15
|
import { type Expando } from '@dxos/echo-schema';
|
|
15
16
|
import { type SchemaProvides } from '@dxos/plugin-client';
|
|
17
|
+
import { type PanelProvides } from '@dxos/plugin-deck/types';
|
|
16
18
|
import { type PublicKey } from '@dxos/react-client';
|
|
19
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
20
|
+
import { type Label } from '@dxos/react-ui';
|
|
17
21
|
import { type ComplexMap } from '@dxos/util';
|
|
18
22
|
|
|
19
23
|
export const SPACE_DIRECTORY_HANDLE = 'dxos.org/plugin/space/directory';
|
|
@@ -53,7 +57,29 @@ export type PluginState = {
|
|
|
53
57
|
sdkMigrationRunning: Record<string, boolean>;
|
|
54
58
|
};
|
|
55
59
|
|
|
56
|
-
export type SpaceSettingsProps = {
|
|
60
|
+
export type SpaceSettingsProps = {
|
|
61
|
+
/**
|
|
62
|
+
* Show closed spaces.
|
|
63
|
+
*/
|
|
64
|
+
showHidden?: boolean;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Action to perform when a space is created.
|
|
68
|
+
*/
|
|
69
|
+
onSpaceCreate?: string;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export type SpaceInitProvides = {
|
|
73
|
+
space: {
|
|
74
|
+
onSpaceCreate: {
|
|
75
|
+
label: Label;
|
|
76
|
+
action: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const parseSpaceInitPlugin = (plugin: Plugin) =>
|
|
82
|
+
typeof (plugin.provides as any).space?.onSpaceCreate === 'object' ? (plugin as Plugin<SpaceInitProvides>) : undefined;
|
|
57
83
|
|
|
58
84
|
export type SpacePluginProvides = SurfaceProvides &
|
|
59
85
|
IntentResolverProvides &
|
|
@@ -62,7 +88,8 @@ export type SpacePluginProvides = SurfaceProvides &
|
|
|
62
88
|
MetadataRecordsProvides &
|
|
63
89
|
SettingsProvides<SpaceSettingsProps> &
|
|
64
90
|
TranslationsProvides &
|
|
65
|
-
SchemaProvides &
|
|
91
|
+
SchemaProvides &
|
|
92
|
+
PanelProvides & {
|
|
66
93
|
space: Readonly<PluginState>;
|
|
67
94
|
};
|
|
68
95
|
|
|
@@ -75,7 +102,8 @@ export interface TypedObjectSerializer<T extends Expando = Expando> {
|
|
|
75
102
|
|
|
76
103
|
/**
|
|
77
104
|
* @param params.content
|
|
105
|
+
* @param params.space Space to use for deserializing schema references.
|
|
78
106
|
* @param params.newId Generate new ID for deserialized object.
|
|
79
107
|
*/
|
|
80
|
-
deserialize(params: { content: string; newId?: boolean }): Promise<T>;
|
|
108
|
+
deserialize(params: { content: string; space: Space; newId?: boolean }): Promise<T>;
|
|
81
109
|
}
|
package/src/util.tsx
CHANGED
|
@@ -2,33 +2,14 @@
|
|
|
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
|
-
|
|
23
5
|
import { type MetadataResolver, NavigationAction, type IntentDispatcher } from '@dxos/app-framework';
|
|
24
6
|
import {
|
|
25
|
-
type EchoReactiveObject,
|
|
26
7
|
create,
|
|
27
8
|
isReactiveObject,
|
|
28
9
|
getTypename,
|
|
29
|
-
type Expando,
|
|
30
10
|
getSchema,
|
|
31
|
-
|
|
11
|
+
getObjectAnnotation,
|
|
12
|
+
type Expando,
|
|
32
13
|
EXPANDO_TYPENAME,
|
|
33
14
|
} from '@dxos/echo-schema';
|
|
34
15
|
import { invariant } from '@dxos/invariant';
|
|
@@ -47,16 +28,17 @@ import {
|
|
|
47
28
|
memoize,
|
|
48
29
|
} from '@dxos/plugin-graph';
|
|
49
30
|
import {
|
|
50
|
-
SpaceState,
|
|
51
31
|
fullyQualifiedId,
|
|
52
32
|
getSpace,
|
|
53
33
|
isEchoObject,
|
|
54
34
|
isSpace,
|
|
55
35
|
type Echo,
|
|
36
|
+
type EchoReactiveObject,
|
|
56
37
|
type FilterSource,
|
|
57
38
|
type Query,
|
|
58
39
|
type QueryOptions,
|
|
59
40
|
type Space,
|
|
41
|
+
SpaceState,
|
|
60
42
|
} from '@dxos/react-client/echo';
|
|
61
43
|
|
|
62
44
|
import { SpaceAction, SPACE_PLUGIN } from './meta';
|
|
@@ -172,7 +154,7 @@ const getCollectionGraphNodePartials = ({
|
|
|
172
154
|
},
|
|
173
155
|
onCopy: async (child: Node<EchoReactiveObject<any>>, index?: number) => {
|
|
174
156
|
// Create clone of child and add to destination space.
|
|
175
|
-
const newObject = await cloneObject(child.data, resolve);
|
|
157
|
+
const newObject = await cloneObject(child.data, resolve, space);
|
|
176
158
|
space.db.add(newObject);
|
|
177
159
|
if (typeof index !== 'undefined') {
|
|
178
160
|
collection.objects.splice(index, 0, newObject);
|
|
@@ -218,8 +200,7 @@ export const constructSpaceNode = ({
|
|
|
218
200
|
...partials,
|
|
219
201
|
label: getSpaceDisplayName(space, { personal, namesCache }),
|
|
220
202
|
description: space.state.get() === SpaceState.SPACE_READY && space.properties.description,
|
|
221
|
-
icon:
|
|
222
|
-
iconSymbol: 'ph--planet--regular',
|
|
203
|
+
icon: 'ph--planet--regular',
|
|
223
204
|
disabled: space.state.get() !== SpaceState.SPACE_READY || hasPendingMigration,
|
|
224
205
|
testId: 'spacePlugin.space',
|
|
225
206
|
},
|
|
@@ -243,8 +224,7 @@ export const constructSpaceActionGroups = ({ space, dispatch }: { space: Space;
|
|
|
243
224
|
data: actionGroupSymbol,
|
|
244
225
|
properties: {
|
|
245
226
|
label: ['create object in space label', { ns: SPACE_PLUGIN }],
|
|
246
|
-
icon:
|
|
247
|
-
iconSymbol: 'ph--plus--regular',
|
|
227
|
+
icon: 'ph--plus--regular',
|
|
248
228
|
disposition: 'toolbar',
|
|
249
229
|
// TODO(wittjosiah): This is currently a navtree feature. Address this with cmd+k integration.
|
|
250
230
|
// mainAreaDisposition: 'in-flow',
|
|
@@ -268,8 +248,7 @@ export const constructSpaceActionGroups = ({ space, dispatch }: { space: Space;
|
|
|
268
248
|
]),
|
|
269
249
|
properties: {
|
|
270
250
|
label: ['create collection label', { ns: SPACE_PLUGIN }],
|
|
271
|
-
icon:
|
|
272
|
-
iconSymbol: 'ph--cards-three--regular',
|
|
251
|
+
icon: 'ph--cards-three--regular',
|
|
273
252
|
testId: 'spacePlugin.createCollection',
|
|
274
253
|
},
|
|
275
254
|
},
|
|
@@ -305,8 +284,7 @@ export const constructSpaceActions = ({
|
|
|
305
284
|
},
|
|
306
285
|
properties: {
|
|
307
286
|
label: ['migrate space label', { ns: SPACE_PLUGIN }],
|
|
308
|
-
icon:
|
|
309
|
-
iconSymbol: 'ph--database--regular',
|
|
287
|
+
icon: 'ph--database--regular',
|
|
310
288
|
disposition: 'toolbar',
|
|
311
289
|
mainAreaDisposition: 'in-flow',
|
|
312
290
|
disabled: migrating || Migrations.running(space),
|
|
@@ -328,8 +306,7 @@ export const constructSpaceActions = ({
|
|
|
328
306
|
},
|
|
329
307
|
properties: {
|
|
330
308
|
label: ['share space label', { ns: SPACE_PLUGIN }],
|
|
331
|
-
icon:
|
|
332
|
-
iconSymbol: 'ph--users--regular',
|
|
309
|
+
icon: 'ph--users--regular',
|
|
333
310
|
disabled: locked,
|
|
334
311
|
keyBinding: {
|
|
335
312
|
macos: 'meta+.',
|
|
@@ -350,10 +327,7 @@ export const constructSpaceActions = ({
|
|
|
350
327
|
},
|
|
351
328
|
properties: {
|
|
352
329
|
label: [locked ? 'unlock space label' : 'lock space label', { ns: SPACE_PLUGIN }],
|
|
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',
|
|
330
|
+
icon: locked ? 'ph--lock-simple-open--regular' : 'ph--lock-simple--regular',
|
|
357
331
|
},
|
|
358
332
|
},
|
|
359
333
|
{
|
|
@@ -364,8 +338,7 @@ export const constructSpaceActions = ({
|
|
|
364
338
|
},
|
|
365
339
|
properties: {
|
|
366
340
|
label: ['rename space label', { ns: SPACE_PLUGIN }],
|
|
367
|
-
icon:
|
|
368
|
-
iconSymbol: 'ph--pencil-simple-line--regular',
|
|
341
|
+
icon: 'ph--pencil-simple-line--regular',
|
|
369
342
|
keyBinding: {
|
|
370
343
|
macos: 'shift+F6',
|
|
371
344
|
windows: 'shift+F6',
|
|
@@ -385,8 +358,7 @@ export const constructSpaceActions = ({
|
|
|
385
358
|
},
|
|
386
359
|
properties: {
|
|
387
360
|
label: ['close space label', { ns: SPACE_PLUGIN }],
|
|
388
|
-
icon:
|
|
389
|
-
iconSymbol: 'ph--x--regular',
|
|
361
|
+
icon: 'ph--x--regular',
|
|
390
362
|
mainAreaDisposition: 'menu',
|
|
391
363
|
disabled: personal,
|
|
392
364
|
},
|
|
@@ -402,8 +374,7 @@ export const constructSpaceActions = ({
|
|
|
402
374
|
},
|
|
403
375
|
properties: {
|
|
404
376
|
label: ['open space label', { ns: SPACE_PLUGIN }],
|
|
405
|
-
icon:
|
|
406
|
-
iconSymbol: 'ph--clock-counter-clockwise--regular',
|
|
377
|
+
icon: 'ph--clock-counter-clockwise--regular',
|
|
407
378
|
disposition: 'toolbar',
|
|
408
379
|
mainAreaDisposition: 'in-flow',
|
|
409
380
|
},
|
|
@@ -446,8 +417,7 @@ export const createObjectNode = ({
|
|
|
446
417
|
label: metadata.label?.(object) ||
|
|
447
418
|
object.name ||
|
|
448
419
|
metadata.placeholder || ['unnamed object label', { ns: SPACE_PLUGIN }],
|
|
449
|
-
icon: metadata.icon ??
|
|
450
|
-
iconSymbol: metadata.iconSymbol ?? 'ph--placeholder--regular',
|
|
420
|
+
icon: metadata.icon ?? 'ph--placeholder--regular',
|
|
451
421
|
testId: 'spacePlugin.object',
|
|
452
422
|
persistenceClass: 'echo',
|
|
453
423
|
persistenceKey: space?.id,
|
|
@@ -475,8 +445,7 @@ export const constructObjectActionGroups = ({
|
|
|
475
445
|
data: actionGroupSymbol,
|
|
476
446
|
properties: {
|
|
477
447
|
label: ['create object in collection label', { ns: SPACE_PLUGIN }],
|
|
478
|
-
icon:
|
|
479
|
-
iconSymbol: 'ph--plus--regular',
|
|
448
|
+
icon: 'ph--plus--regular',
|
|
480
449
|
disposition: 'toolbar',
|
|
481
450
|
// TODO(wittjosiah): This is currently a navtree feature. Address this with cmd+k integration.
|
|
482
451
|
// mainAreaDisposition: 'in-flow',
|
|
@@ -500,8 +469,7 @@ export const constructObjectActionGroups = ({
|
|
|
500
469
|
]),
|
|
501
470
|
properties: {
|
|
502
471
|
label: ['create collection label', { ns: SPACE_PLUGIN }],
|
|
503
|
-
icon:
|
|
504
|
-
iconSymbol: 'ph--cards-three--regular',
|
|
472
|
+
icon: 'ph--cards-three--regular',
|
|
505
473
|
testId: 'spacePlugin.createCollection',
|
|
506
474
|
},
|
|
507
475
|
},
|
|
@@ -536,8 +504,7 @@ export const constructObjectActions = ({
|
|
|
536
504
|
object instanceof CollectionType ? 'rename collection label' : 'rename object label',
|
|
537
505
|
{ ns: SPACE_PLUGIN },
|
|
538
506
|
],
|
|
539
|
-
icon:
|
|
540
|
-
iconSymbol: 'ph--pencil-simple-line--regular',
|
|
507
|
+
icon: 'ph--pencil-simple-line--regular',
|
|
541
508
|
// TODO(wittjosiah): Doesn't work.
|
|
542
509
|
// keyBinding: 'shift+F6',
|
|
543
510
|
testId: 'spacePlugin.renameObject',
|
|
@@ -563,8 +530,7 @@ export const constructObjectActions = ({
|
|
|
563
530
|
object instanceof CollectionType ? 'delete collection label' : 'delete object label',
|
|
564
531
|
{ ns: SPACE_PLUGIN },
|
|
565
532
|
],
|
|
566
|
-
icon:
|
|
567
|
-
iconSymbol: 'ph--trash--regular',
|
|
533
|
+
icon: 'ph--trash--regular',
|
|
568
534
|
keyBinding: object instanceof CollectionType ? undefined : 'shift+meta+Backspace',
|
|
569
535
|
testId: 'spacePlugin.deleteObject',
|
|
570
536
|
},
|
|
@@ -578,8 +544,7 @@ export const constructObjectActions = ({
|
|
|
578
544
|
},
|
|
579
545
|
properties: {
|
|
580
546
|
label: ['copy link label', { ns: SPACE_PLUGIN }],
|
|
581
|
-
icon:
|
|
582
|
-
iconSymbol: 'ph--link--regular',
|
|
547
|
+
icon: 'ph--link--regular',
|
|
583
548
|
testId: 'spacePlugin.copyLink',
|
|
584
549
|
},
|
|
585
550
|
},
|
|
@@ -631,12 +596,12 @@ export const getNestedObjects = async (
|
|
|
631
596
|
* @deprecated Workaround for ECHO not supporting clone.
|
|
632
597
|
*/
|
|
633
598
|
// TODO(burdon): Remove.
|
|
634
|
-
export const cloneObject = async (object: Expando, resolve: MetadataResolver): Promise<Expando> => {
|
|
599
|
+
export const cloneObject = async (object: Expando, resolve: MetadataResolver, newSpace: Space): Promise<Expando> => {
|
|
635
600
|
const schema = getSchema(object);
|
|
636
|
-
const typename = schema ?
|
|
601
|
+
const typename = schema ? getObjectAnnotation(schema)?.typename ?? EXPANDO_TYPENAME : EXPANDO_TYPENAME;
|
|
637
602
|
const metadata = resolve(typename);
|
|
638
603
|
const serializer = metadata.serializer;
|
|
639
604
|
invariant(serializer, `No serializer for type: ${typename}`);
|
|
640
605
|
const content = await serializer.serialize({ object });
|
|
641
|
-
return serializer.deserialize({ content, newId: true });
|
|
606
|
+
return serializer.deserialize({ content, space: newSpace, newId: true });
|
|
642
607
|
};
|
|
@@ -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(S.String, 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 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 /** 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(S.String, 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 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} 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 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 = { showHidden?: boolean };\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,OAAOT,EAAEE,QAAQI,IAAIC,OAAAA,CAAAA,CAAAA;AAC1C,CAAA,EAAA;AAAI;;;ACXJ,SAASG,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;AAKK,IAAMY,cAAN,cAA0BlB,aAAY;EAAEC,UAAU;EAAyBC,SAAS;AAAQ,CAAA,EAAG;;EAEpGiB,WAAWf,GAAEE;;EAEbc,QAAQP;;EAERQ,MAAMjB,GAAEE;;EAERgB,OAAOlB,GAAEC,SAASD,GAAEI,QAAQJ,GAAEK,MAAMM,KAAIQ,QAAAA,CAAAA,CAAAA,CAAAA;;EAExCC,YAAYpB,GAAEC,SAASD,GAAEI,QAAQJ,GAAEqB,OAAOrB,GAAEE,QAAQF,GAAEsB,GAAG,CAAA,CAAA;;;;;;EAMzDC,SAASvB,GAAEC,SAASU,KAAIQ,QAAAA,CAAAA;AAC1B,CAAA,EAAA;AAAI;AAEG,IAAMK,eAAexB,GAAEyB,MAAMzB,GAAE0B,QAAQ,QAAA,GAAW1B,GAAE0B,QAAQ,QAAA,GAAW1B,GAAE0B,QAAQ,UAAA,CAAA;AAEjF,IAAMC,aAAN,cAAyB/B,aAAY;EAAEC,UAAU;EAAwBC,SAAS;AAAQ,CAAA,EAAG;EAClGC,MAAMC,GAAEC,SAASD,GAAEE,MAAM;EACzB0B,QAAQ5B,GAAEC,SAASD,GAAEE,MAAM;EAC3B2B,QAAQ7B,GAAEC,SAASuB,YAAAA;EACnBM,UAAU9B,GAAEI,QAAQJ,GAAEK,MAAMM,KAAIG,WAAAA,CAAAA,CAAAA;AAClC,CAAA,EAAA;AAAI;AAEG,IAAMiB,cAAN,cAA0BnC,aAAY;EAAEC,UAAU;EAAyBC,SAAS;AAAQ,CAAA,EAAG;EACpGC,MAAMC,GAAEC,SAASD,GAAEE,MAAM;EACzB8B,SAAShC,GAAEI,QAAQJ,GAAEK,MAAMM,KAAIgB,UAAAA,CAAAA,CAAAA;AACjC,CAAA,EAAA;AAAI;;;ACjDG,IAAMM,yBAAyB;",
|
|
6
|
-
"names": ["Expando", "ref", "S", "TypedObject", "CollectionType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "objects", "mutable", "Array", "ref", "Expando", "views", "Record", "Expando", "ref", "S", "TypedObject", "ContactType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "identifiers", "mutable", "Array", "Struct", "type", "value", "ActorSchema", "contact", "ref", "identityKey", "email", "MessageType", "timestamp", "sender", "text", "parts", "Expando", "properties", "Record", "Any", "context", "ThreadStatus", "Union", "Literal", "ThreadType", "anchor", "status", "messages", "ChannelType", "threads", "SPACE_DIRECTORY_HANDLE"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\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};\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": ";AAIO,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/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\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};\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,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
|
-
}
|