@dxos/plugin-space 0.6.12-staging.e11e696 → 0.6.13-main.548ca8d

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.
Files changed (65) hide show
  1. package/dist/lib/browser/{chunk-LZEGRS7H.mjs → chunk-AVLRQF6L.mjs} +1 -1
  2. package/dist/lib/browser/chunk-AVLRQF6L.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-WBMH5WIP.mjs → chunk-QK5I2EPF.mjs} +10 -3
  4. package/dist/lib/browser/chunk-QK5I2EPF.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +278 -245
  6. package/dist/lib/browser/index.mjs.map +4 -4
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/meta.mjs +1 -1
  9. package/dist/lib/browser/types/index.mjs +1 -1
  10. package/dist/lib/node/{chunk-GF3SRAQM.cjs → chunk-HE2GHO6Z.cjs} +13 -6
  11. package/dist/lib/node/chunk-HE2GHO6Z.cjs.map +7 -0
  12. package/dist/lib/node/{chunk-6CNYF6YU.cjs → chunk-P4XUXM7Y.cjs} +4 -4
  13. package/dist/lib/node/chunk-P4XUXM7Y.cjs.map +7 -0
  14. package/dist/lib/node/index.cjs +467 -433
  15. package/dist/lib/node/index.cjs.map +4 -4
  16. package/dist/lib/node/meta.cjs +5 -5
  17. package/dist/lib/node/meta.cjs.map +1 -1
  18. package/dist/lib/node/meta.json +1 -1
  19. package/dist/lib/node/types/index.cjs +11 -11
  20. package/dist/lib/node/types/index.cjs.map +1 -1
  21. package/dist/lib/node-esm/{chunk-N5VC55UM.mjs → chunk-2TR4WD6U.mjs} +10 -3
  22. package/dist/lib/node-esm/chunk-2TR4WD6U.mjs.map +7 -0
  23. package/dist/lib/node-esm/{chunk-GM2YUC77.mjs → chunk-YPQGKWHJ.mjs} +1 -1
  24. package/dist/lib/node-esm/chunk-YPQGKWHJ.mjs.map +7 -0
  25. package/dist/lib/node-esm/index.mjs +278 -245
  26. package/dist/lib/node-esm/index.mjs.map +4 -4
  27. package/dist/lib/node-esm/meta.json +1 -1
  28. package/dist/lib/node-esm/meta.mjs +1 -1
  29. package/dist/lib/node-esm/types/index.mjs +1 -1
  30. package/dist/types/src/SpacePlugin.d.ts.map +1 -1
  31. package/dist/types/src/components/FallbackSettings.d.ts +8 -0
  32. package/dist/types/src/components/FallbackSettings.d.ts.map +1 -0
  33. package/dist/types/src/components/ShareSpaceButton.stories.d.ts +2 -0
  34. package/dist/types/src/components/ShareSpaceButton.stories.d.ts.map +1 -1
  35. package/dist/types/src/components/SpacePresence.stories.d.ts +2 -0
  36. package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
  37. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +2 -0
  38. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
  39. package/dist/types/src/components/index.d.ts +1 -2
  40. package/dist/types/src/components/index.d.ts.map +1 -1
  41. package/dist/types/src/meta.d.ts.map +1 -1
  42. package/dist/types/src/translations.d.ts +2 -0
  43. package/dist/types/src/translations.d.ts.map +1 -1
  44. package/dist/types/src/types/thread.d.ts +1 -0
  45. package/dist/types/src/types/thread.d.ts.map +1 -1
  46. package/package.json +34 -33
  47. package/src/SpacePlugin.tsx +103 -60
  48. package/src/components/FallbackSettings.tsx +35 -0
  49. package/src/components/index.ts +1 -2
  50. package/src/meta.ts +3 -1
  51. package/src/translations.ts +2 -0
  52. package/src/types/collection.ts +1 -1
  53. package/src/types/thread.ts +2 -1
  54. package/dist/lib/browser/chunk-LZEGRS7H.mjs.map +0 -7
  55. package/dist/lib/browser/chunk-WBMH5WIP.mjs.map +0 -7
  56. package/dist/lib/node/chunk-6CNYF6YU.cjs.map +0 -7
  57. package/dist/lib/node/chunk-GF3SRAQM.cjs.map +0 -7
  58. package/dist/lib/node-esm/chunk-GM2YUC77.mjs.map +0 -7
  59. package/dist/lib/node-esm/chunk-N5VC55UM.mjs.map +0 -7
  60. package/dist/types/src/components/EmptySpace.d.ts +0 -3
  61. package/dist/types/src/components/EmptySpace.d.ts.map +0 -1
  62. package/dist/types/src/components/EmptyTree.d.ts +0 -3
  63. package/dist/types/src/components/EmptyTree.d.ts.map +0 -1
  64. package/src/components/EmptySpace.tsx +0 -25
  65. package/src/components/EmptyTree.tsx +0 -25
@@ -2,7 +2,7 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { effect, signal } from '@preact/signals-core';
5
+ import { signal } from '@preact/signals-core';
6
6
  import React from 'react';
7
7
 
8
8
  import {
@@ -24,12 +24,13 @@ import {
24
24
  } from '@dxos/app-framework';
25
25
  import { EventSubscriptions, type Trigger, type UnsubscribeCallback } from '@dxos/async';
26
26
  import { type EchoReactiveObject, type Identifiable, isReactiveObject } from '@dxos/echo-schema';
27
+ import { scheduledEffect } from '@dxos/echo-signals/core';
27
28
  import { LocalStorageStore } from '@dxos/local-storage';
28
29
  import { log } from '@dxos/log';
29
30
  import { Migrations } from '@dxos/migrations';
30
31
  import { type AttentionPluginProvides, parseAttentionPlugin } from '@dxos/plugin-attention';
31
32
  import { type ClientPluginProvides, parseClientPlugin } from '@dxos/plugin-client';
32
- import { type Node, createExtension, isGraphNode, memoize, toSignal } from '@dxos/plugin-graph';
33
+ import { type Node, createExtension, memoize, toSignal } from '@dxos/plugin-graph';
33
34
  import { ObservabilityAction } from '@dxos/plugin-observability/meta';
34
35
  import { type Client, PublicKey } from '@dxos/react-client';
35
36
  import {
@@ -45,6 +46,7 @@ import {
45
46
  isEchoObject,
46
47
  isSpace,
47
48
  loadObjectReferences,
49
+ parseFullyQualifiedId,
48
50
  } from '@dxos/react-client/echo';
49
51
  import { Dialog } from '@dxos/react-ui';
50
52
  import { ClipboardProvider, InvitationManager, type InvitationManagerProps, osTranslations } from '@dxos/shell/react';
@@ -54,8 +56,7 @@ import {
54
56
  AwaitingObject,
55
57
  CollectionMain,
56
58
  CollectionSection,
57
- EmptySpace,
58
- EmptyTree,
59
+ FallbackSettings,
59
60
  MenuFooter,
60
61
  MissingObject,
61
62
  PopoverRenameObject,
@@ -174,9 +175,10 @@ export const SpacePlugin = ({
174
175
  .filter((space) => space.state.get() === SpaceState.SPACE_READY)
175
176
  .forEach((space) => {
176
177
  subscriptions.add(
177
- effect(() => {
178
- state.values.spaceNames[space.id] = space.properties.name;
179
- }),
178
+ scheduledEffect(
179
+ () => ({ name: space.properties.name }),
180
+ ({ name }) => (state.values.spaceNames[space.id] = name),
181
+ ),
180
182
  );
181
183
  });
182
184
  }).unsubscribe,
@@ -184,54 +186,56 @@ export const SpacePlugin = ({
184
186
 
185
187
  // Broadcast active node to other peers in the space.
186
188
  subscriptions.add(
187
- effect(() => {
188
- const send = () => {
189
- const spaces = client.spaces.get();
190
- const identity = client.halo.identity.get();
191
- if (identity && location.active) {
192
- const ids = openIds(location.active);
193
-
194
- // Group parts by space for efficient messaging.
195
- const idsBySpace = reduceGroupBy(ids, (id) => {
196
- const [spaceId] = id.split(':'); // TODO(burdon): Factor out.
197
- return spaceId;
198
- });
199
-
200
- // NOTE: Ensure all spaces are included so that we send the correct `removed` object arrays.
201
- for (const space of spaces) {
202
- if (!idsBySpace.has(space.id)) {
203
- idsBySpace.set(space.id, []);
189
+ scheduledEffect(
190
+ () => ({
191
+ ids: openIds(location.active),
192
+ removed: location.closed ? [location.closed].flat() : [],
193
+ }),
194
+ ({ ids, removed }) => {
195
+ const send = () => {
196
+ const spaces = client.spaces.get();
197
+ const identity = client.halo.identity.get();
198
+ if (identity && location.active) {
199
+ // Group parts by space for efficient messaging.
200
+ const idsBySpace = reduceGroupBy(ids, (id) => {
201
+ const [spaceId] = id.split(':'); // TODO(burdon): Factor out.
202
+ return spaceId;
203
+ });
204
+
205
+ // NOTE: Ensure all spaces are included so that we send the correct `removed` object arrays.
206
+ for (const space of spaces) {
207
+ if (!idsBySpace.has(space.id)) {
208
+ idsBySpace.set(space.id, []);
209
+ }
204
210
  }
205
- }
206
211
 
207
- for (const [spaceId, ids] of idsBySpace) {
208
- const space = spaces.find((space) => space.id === spaceId);
209
- if (!space) {
210
- continue;
211
- }
212
+ for (const [spaceId, ids] of idsBySpace) {
213
+ const space = spaces.find((space) => space.id === spaceId);
214
+ if (!space) {
215
+ continue;
216
+ }
212
217
 
213
- const removed = location.closed ? [location.closed].flat() : [];
214
-
215
- void space
216
- .postMessage('viewing', {
217
- identityKey: identity.identityKey.toHex(),
218
- attended: attention.attended ? [...attention.attended] : [],
219
- added: ids,
220
- // TODO(Zan): When we re-open a part, we should remove it from the removed list in the navigation plugin.
221
- removed: removed.filter((id) => !ids.includes(id)),
222
- })
223
- // TODO(burdon): This seems defensive; why would this fail? Backoff interval.
224
- .catch((err) => {
225
- log.warn('Failed to broadcast active node for presence.', { err: err.message });
226
- });
218
+ void space
219
+ .postMessage('viewing', {
220
+ identityKey: identity.identityKey.toHex(),
221
+ attended: attention.attended ? [...attention.attended] : [],
222
+ added: ids,
223
+ // TODO(Zan): When we re-open a part, we should remove it from the removed list in the navigation plugin.
224
+ removed: removed.filter((id) => !ids.includes(id)),
225
+ })
226
+ // TODO(burdon): This seems defensive; why would this fail? Backoff interval.
227
+ .catch((err) => {
228
+ log.warn('Failed to broadcast active node for presence.', { err: err.message });
229
+ });
230
+ }
227
231
  }
228
- }
229
- };
232
+ };
230
233
 
231
- send();
232
- const interval = setInterval(() => send(), ACTIVE_NODE_BROADCAST_INTERVAL);
233
- return () => clearInterval(interval);
234
- }),
234
+ send();
235
+ const interval = setInterval(() => send(), ACTIVE_NODE_BROADCAST_INTERVAL);
236
+ return () => clearInterval(interval);
237
+ },
238
+ ),
235
239
  );
236
240
 
237
241
  // Listen for active nodes from other peers in the space.
@@ -374,16 +378,8 @@ export const SpacePlugin = ({
374
378
  ) : typeof primary === 'string' && primary.length === OBJECT_ID_LENGTH ? (
375
379
  <MissingObject id={primary} />
376
380
  ) : null;
377
- // TODO(burdon): Add role name syntax to minimal plugin docs.
378
- case 'tree--empty':
379
- switch (true) {
380
- case data.plugin === SPACE_PLUGIN:
381
- return <EmptyTree />;
382
- case isGraphNode(data.activeNode) && isSpace(data.activeNode.data):
383
- return <EmptySpace />;
384
- default:
385
- return null;
386
- }
381
+ case 'complementary--settings':
382
+ return isEchoObject(data.subject) ? <FallbackSettings object={data.subject} /> : null;
387
383
  case 'dialog':
388
384
  if (data.component === 'dxos.org/plugin/space/InvitationManagerDialog') {
389
385
  return (
@@ -404,6 +400,7 @@ export const SpacePlugin = ({
404
400
  return <PopoverRenameObject object={data.subject} />;
405
401
  }
406
402
  return null;
403
+ // TODO(burdon): Add role name syntax to minimal plugin docs.
407
404
  case 'presence--glyph': {
408
405
  return isReactiveObject(data.object) ? (
409
406
  <SmallPresenceLive viewers={state.values.viewersByObject[fullyQualifiedId(data.object)]} />
@@ -719,6 +716,52 @@ export const SpacePlugin = ({
719
716
  .filter(nonNullable);
720
717
  },
721
718
  }),
719
+
720
+ // Create nodes for object settings.
721
+ createExtension({
722
+ id: `${SPACE_PLUGIN}/settings-for-subject`,
723
+ resolver: ({ id }) => {
724
+ // TODO(Zan): Find util (or make one).
725
+ if (!id.endsWith('~settings')) {
726
+ return;
727
+ }
728
+
729
+ const [subjectId] = id.split('~');
730
+ const [spaceId, objectId] = parseFullyQualifiedId(subjectId);
731
+ const space = client.spaces.get().find((space) => space.id === spaceId);
732
+ const object = toSignal(
733
+ (onChange) => {
734
+ const timeout = setTimeout(async () => {
735
+ await space?.db.loadObjectById(objectId);
736
+ onChange();
737
+ });
738
+
739
+ return () => clearTimeout(timeout);
740
+ },
741
+ () => space?.db.getObjectById(objectId),
742
+ subjectId,
743
+ );
744
+ if (!object || !subjectId) {
745
+ return;
746
+ }
747
+
748
+ const meta = resolve(getTypename(object) ?? '');
749
+ const label = meta.label?.(object) ||
750
+ object.name ||
751
+ meta.placeholder || ['unnamed object settings label', { ns: SPACE_PLUGIN }];
752
+
753
+ return {
754
+ id,
755
+ type: 'orphan-settings-for-subject',
756
+ data: null,
757
+ properties: {
758
+ icon: 'ph--gear--regular',
759
+ label,
760
+ object,
761
+ },
762
+ };
763
+ },
764
+ }),
722
765
  ];
723
766
  },
724
767
  serializer: (plugins) => {
@@ -0,0 +1,35 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { type EchoReactiveObject } from '@dxos/echo-schema';
8
+ import { Input, useTranslation } from '@dxos/react-ui';
9
+
10
+ import { SPACE_PLUGIN } from '../meta';
11
+
12
+ type FallbackSettingsProps = {
13
+ object: EchoReactiveObject<any>;
14
+ };
15
+
16
+ export const FallbackSettings = ({ object }: FallbackSettingsProps) => {
17
+ const { t } = useTranslation(SPACE_PLUGIN);
18
+
19
+ return (
20
+ <div role='form' className='p-3 flex flex-col gap-2'>
21
+ <div role='none' className='space-b-1'>
22
+ <Input.Root>
23
+ <Input.Label>{t('name label')}</Input.Label>
24
+ <Input.TextInput
25
+ placeholder={t('name placeholder')}
26
+ value={object.name}
27
+ onChange={(event) => {
28
+ object.name = event.target.value;
29
+ }}
30
+ />
31
+ </Input.Root>
32
+ </div>
33
+ </div>
34
+ );
35
+ };
@@ -5,8 +5,7 @@
5
5
  export * from './AwaitingObject';
6
6
  export * from './CollectionMain';
7
7
  export * from './CollectionSection';
8
- export * from './EmptySpace';
9
- export * from './EmptyTree';
8
+ export * from './FallbackSettings';
10
9
  export * from './MenuFooter';
11
10
  export * from './MissingObject';
12
11
  export * from './PersistenceStatus';
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 {
@@ -88,6 +88,8 @@ export default [
88
88
  'copy link label': 'Copy link',
89
89
  'default on space create label': 'On space create',
90
90
  'sync status title': 'Sync status',
91
+ 'name label': 'Name',
92
+ 'name placeholder': 'Name',
91
93
  },
92
94
  },
93
95
  },
@@ -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
  }) {}
@@ -53,7 +53,7 @@ export class MessageType extends TypedObject({ typename: 'dxos.org/type/Message'
53
53
  /** Non-text content sent with a message (e.g. files, polls, etc.) */
54
54
  parts: S.optional(S.mutable(S.Array(ref(Expando)))),
55
55
  /** Custom properties for specific message types (e.g. email subject or cc fields). */
56
- 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 }))),
57
57
  // TODO(wittjosiah): Add read status:
58
58
  // - Read receipts need to be per space member.
59
59
  // - Read receipts don't need to be added to schema until they being implemented.
@@ -66,6 +66,7 @@ export const ThreadStatus = S.Union(S.Literal('staged'), S.Literal('active'), S.
66
66
 
67
67
  export class ThreadType extends TypedObject({ typename: 'dxos.org/type/Thread', version: '0.1.0' })({
68
68
  name: S.optional(S.String),
69
+ /** AM cursor-range: 'from:to'. */
69
70
  anchor: S.optional(S.String),
70
71
  status: S.optional(ThreadStatus),
71
72
  messages: S.mutable(S.Array(ref(MessageType))),
@@ -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/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 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(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 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,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;;UAKUY,eAAAA;;;;;GAAAA,iBAAAA,eAAAA,CAAAA,EAAAA;AAOL,IAAMC,cAAN,cAA0BnB,aAAY;EAAEC,UAAU;EAAyBC,SAAS;AAAQ,CAAA,EAAG;;EAEpGkB,WAAWhB,GAAEE;;EAEbe,OAAOjB,GAAEC,SAASD,GAAEkB,MAAMJ,YAAAA,CAAAA;;EAE1BK,QAAQV;;EAERW,MAAMpB,GAAEE;;EAERmB,OAAOrB,GAAEC,SAASD,GAAEI,QAAQJ,GAAEK,MAAMM,KAAIW,QAAAA,CAAAA,CAAAA,CAAAA;;EAExCC,YAAYvB,GAAEC,SAASD,GAAEI,QAAQJ,GAAEwB,OAAOxB,GAAEE,QAAQF,GAAEyB,GAAG,CAAA,CAAA;;;;;;EAMzDC,SAAS1B,GAAEC,SAASU,KAAIW,QAAAA,CAAAA;AAC1B,CAAA,EAAA;AAAI;AAEG,IAAMK,eAAe3B,GAAE4B,MAAM5B,GAAE6B,QAAQ,QAAA,GAAW7B,GAAE6B,QAAQ,QAAA,GAAW7B,GAAE6B,QAAQ,UAAA,CAAA;AAEjF,IAAMC,aAAN,cAAyBlC,aAAY;EAAEC,UAAU;EAAwBC,SAAS;AAAQ,CAAA,EAAG;EAClGC,MAAMC,GAAEC,SAASD,GAAEE,MAAM;EACzB6B,QAAQ/B,GAAEC,SAASD,GAAEE,MAAM;EAC3B8B,QAAQhC,GAAEC,SAAS0B,YAAAA;EACnBM,UAAUjC,GAAEI,QAAQJ,GAAEK,MAAMM,KAAII,WAAAA,CAAAA,CAAAA;AAClC,CAAA,EAAA;AAAI;AAEG,IAAMmB,cAAN,cAA0BtC,aAAY;EAAEC,UAAU;EAAyBC,SAAS;AAAQ,CAAA,EAAG;EACpGC,MAAMC,GAAEC,SAASD,GAAEE,MAAM;EACzBiC,SAASnC,GAAEI,QAAQJ,GAAEK,MAAMM,KAAImB,UAAAA,CAAAA,CAAAA;AACjC,CAAA,EAAA;AAAI;;;ACxDG,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", "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", "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\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/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 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(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 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": "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",
6
- "names": ["import_echo_schema", "CollectionType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "objects", "mutable", "Array", "ref", "Expando", "views", "Record", "ContactType", "identifiers", "Struct", "type", "value", "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\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/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 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(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 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,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;;UAKUY,eAAAA;;;;;GAAAA,iBAAAA,eAAAA,CAAAA,EAAAA;AAOL,IAAMC,cAAN,cAA0BnB,aAAY;EAAEC,UAAU;EAAyBC,SAAS;AAAQ,CAAA,EAAG;;EAEpGkB,WAAWhB,GAAEE;;EAEbe,OAAOjB,GAAEC,SAASD,GAAEkB,MAAMJ,YAAAA,CAAAA;;EAE1BK,QAAQV;;EAERW,MAAMpB,GAAEE;;EAERmB,OAAOrB,GAAEC,SAASD,GAAEI,QAAQJ,GAAEK,MAAMM,KAAIW,QAAAA,CAAAA,CAAAA,CAAAA;;EAExCC,YAAYvB,GAAEC,SAASD,GAAEI,QAAQJ,GAAEwB,OAAOxB,GAAEE,QAAQF,GAAEyB,GAAG,CAAA,CAAA;;;;;;EAMzDC,SAAS1B,GAAEC,SAASU,KAAIW,QAAAA,CAAAA;AAC1B,CAAA,EAAA;AAAI;AAEG,IAAMK,eAAe3B,GAAE4B,MAAM5B,GAAE6B,QAAQ,QAAA,GAAW7B,GAAE6B,QAAQ,QAAA,GAAW7B,GAAE6B,QAAQ,UAAA,CAAA;AAEjF,IAAMC,aAAN,cAAyBlC,aAAY;EAAEC,UAAU;EAAwBC,SAAS;AAAQ,CAAA,EAAG;EAClGC,MAAMC,GAAEC,SAASD,GAAEE,MAAM;EACzB6B,QAAQ/B,GAAEC,SAASD,GAAEE,MAAM;EAC3B8B,QAAQhC,GAAEC,SAAS0B,YAAAA;EACnBM,UAAUjC,GAAEI,QAAQJ,GAAEK,MAAMM,KAAII,WAAAA,CAAAA,CAAAA;AAClC,CAAA,EAAA;AAAI;AAEG,IAAMmB,cAAN,cAA0BtC,aAAY;EAAEC,UAAU;EAAyBC,SAAS;AAAQ,CAAA,EAAG;EACpGC,MAAMC,GAAEC,SAASD,GAAEE,MAAM;EACzBiC,SAASnC,GAAEI,QAAQJ,GAAEK,MAAMM,KAAImB,UAAAA,CAAAA,CAAAA;AACjC,CAAA,EAAA;AAAI;;;ACxDG,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", "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", "Any", "context", "ThreadStatus", "Union", "Literal", "ThreadType", "anchor", "status", "messages", "ChannelType", "threads", "SPACE_DIRECTORY_HANDLE", "parseSpaceInitPlugin", "plugin", "provides", "space", "onSpaceCreate", "undefined"]
7
- }
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const EmptySpace: () => React.JSX.Element;
3
- //# sourceMappingURL=EmptySpace.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EmptySpace.d.ts","sourceRoot":"","sources":["../../../../src/components/EmptySpace.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,eAAO,MAAM,UAAU,yBAatB,CAAC"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const EmptyTree: () => React.JSX.Element;
3
- //# sourceMappingURL=EmptyTree.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EmptyTree.d.ts","sourceRoot":"","sources":["../../../../src/components/EmptyTree.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,eAAO,MAAM,SAAS,yBAarB,CAAC"}
@@ -1,25 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { useTranslation } from '@dxos/react-ui';
8
- import { descriptionText, mx } from '@dxos/react-ui-theme';
9
-
10
- import { SPACE_PLUGIN } from '../meta';
11
-
12
- export const EmptySpace = () => {
13
- const { t } = useTranslation(SPACE_PLUGIN);
14
- return (
15
- <div
16
- role='none'
17
- className={mx(
18
- 'p-2 mli-2 mbe-2 text-center border border-dashed border-neutral-400/50 rounded-lg',
19
- descriptionText,
20
- )}
21
- >
22
- {t('empty space message')}
23
- </div>
24
- );
25
- };
@@ -1,25 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { useTranslation } from '@dxos/react-ui';
8
- import { descriptionText, mx } from '@dxos/react-ui-theme';
9
-
10
- import { SPACE_PLUGIN } from '../meta';
11
-
12
- export const EmptyTree = () => {
13
- const { t } = useTranslation(SPACE_PLUGIN);
14
- return (
15
- <div
16
- role='none'
17
- className={mx(
18
- 'p-2 mli-2 mbe-2 text-center border border-dashed border-neutral-400/50 rounded-lg',
19
- descriptionText,
20
- )}
21
- >
22
- {t('empty tree message')}
23
- </div>
24
- );
25
- };