@dxos/plugin-space 0.7.2 → 0.7.3-main.2dd075e

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 (95) hide show
  1. package/dist/lib/browser/{chunk-DJE2HYFV.mjs → chunk-FTKV32QZ.mjs} +9 -2
  2. package/dist/lib/browser/chunk-FTKV32QZ.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-OWZKSWMX.mjs → chunk-MWKXNS5S.mjs} +13 -3
  4. package/dist/lib/browser/{chunk-OWZKSWMX.mjs.map → chunk-MWKXNS5S.mjs.map} +3 -3
  5. package/dist/lib/browser/index.mjs +1056 -674
  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 +3 -1
  9. package/dist/lib/browser/types/index.mjs +5 -3
  10. package/dist/lib/node/{chunk-FYWGZYJB.cjs → chunk-6SNOZF7Y.cjs} +18 -7
  11. package/dist/lib/node/chunk-6SNOZF7Y.cjs.map +7 -0
  12. package/dist/lib/node/{chunk-JFDDZI4Y.cjs → chunk-QNVEU2UD.cjs} +12 -4
  13. package/dist/lib/node/chunk-QNVEU2UD.cjs.map +7 -0
  14. package/dist/lib/node/index.cjs +1160 -789
  15. package/dist/lib/node/index.cjs.map +4 -4
  16. package/dist/lib/node/meta.cjs +7 -5
  17. package/dist/lib/node/meta.cjs.map +2 -2
  18. package/dist/lib/node/meta.json +1 -1
  19. package/dist/lib/node/types/index.cjs +14 -12
  20. package/dist/lib/node/types/index.cjs.map +2 -2
  21. package/dist/lib/node-esm/{chunk-MCEAI4CV.mjs → chunk-OHEAWSCA.mjs} +13 -3
  22. package/dist/lib/node-esm/{chunk-MCEAI4CV.mjs.map → chunk-OHEAWSCA.mjs.map} +3 -3
  23. package/dist/lib/node-esm/{chunk-DVUZ7A7G.mjs → chunk-UMV7XREB.mjs} +9 -2
  24. package/dist/lib/node-esm/chunk-UMV7XREB.mjs.map +7 -0
  25. package/dist/lib/node-esm/index.mjs +1056 -674
  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 +3 -1
  29. package/dist/lib/node-esm/types/index.mjs +5 -3
  30. package/dist/types/src/SpacePlugin.d.ts.map +1 -1
  31. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +9 -0
  32. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -0
  33. package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts +10 -0
  34. package/dist/types/src/components/CreateDialog/CreateObjectDialog.stories.d.ts.map +1 -0
  35. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +22 -0
  36. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -0
  37. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +3 -0
  38. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -0
  39. package/dist/types/src/components/CreateDialog/index.d.ts +3 -0
  40. package/dist/types/src/components/CreateDialog/index.d.ts.map +1 -0
  41. package/dist/types/src/components/PopoverRenameObject.d.ts +1 -1
  42. package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
  43. package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts.map +1 -1
  44. package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts +6 -0
  45. package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +1 -0
  46. package/dist/types/src/components/SyncStatus/Space.d.ts +8 -3
  47. package/dist/types/src/components/SyncStatus/Space.d.ts.map +1 -1
  48. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts +3 -2
  49. package/dist/types/src/components/SyncStatus/SyncStatus.d.ts.map +1 -1
  50. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts +1 -2
  51. package/dist/types/src/components/SyncStatus/SyncStatus.stories.d.ts.map +1 -1
  52. package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts +8 -0
  53. package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts.map +1 -0
  54. package/dist/types/src/components/SyncStatus/index.d.ts +1 -0
  55. package/dist/types/src/components/SyncStatus/index.d.ts.map +1 -1
  56. package/dist/types/src/components/SyncStatus/sync-state.d.ts +5 -1
  57. package/dist/types/src/components/SyncStatus/sync-state.d.ts.map +1 -1
  58. package/dist/types/src/components/index.d.ts +1 -0
  59. package/dist/types/src/components/index.d.ts.map +1 -1
  60. package/dist/types/src/meta.d.ts +5 -0
  61. package/dist/types/src/meta.d.ts.map +1 -1
  62. package/dist/types/src/translations.d.ts +224 -0
  63. package/dist/types/src/translations.d.ts.map +1 -1
  64. package/dist/types/src/types/types.d.ts +14 -14
  65. package/dist/types/src/types/types.d.ts.map +1 -1
  66. package/dist/types/src/util.d.ts +3 -13
  67. package/dist/types/src/util.d.ts.map +1 -1
  68. package/package.json +38 -35
  69. package/src/SpacePlugin.tsx +169 -75
  70. package/src/components/AwaitingObject.tsx +2 -2
  71. package/src/components/CreateDialog/CreateObjectDialog.stories.tsx +83 -0
  72. package/src/components/CreateDialog/CreateObjectDialog.tsx +97 -0
  73. package/src/components/CreateDialog/CreateObjectPanel.tsx +169 -0
  74. package/src/components/CreateDialog/CreateSpaceDialog.tsx +57 -0
  75. package/src/components/CreateDialog/index.ts +6 -0
  76. package/src/components/PopoverRenameObject.tsx +1 -1
  77. package/src/components/SpacePluginSettings.tsx +3 -32
  78. package/src/components/SpaceSettings/SpaceSettingsDialog.tsx +1 -1
  79. package/src/components/SpaceSettings/SpaceSettingsPanel.tsx +2 -6
  80. package/src/components/SyncStatus/InlineSyncStatus.tsx +45 -0
  81. package/src/components/SyncStatus/Space.tsx +30 -6
  82. package/src/components/SyncStatus/SyncStatus.stories.tsx +3 -32
  83. package/src/components/SyncStatus/SyncStatus.tsx +32 -14
  84. package/src/components/SyncStatus/SyncStatusDetail.stories.tsx +83 -0
  85. package/src/components/SyncStatus/index.ts +1 -0
  86. package/src/components/SyncStatus/sync-state.ts +24 -0
  87. package/src/components/index.ts +1 -0
  88. package/src/meta.ts +6 -0
  89. package/src/translations.ts +15 -0
  90. package/src/types/types.ts +20 -16
  91. package/src/util.tsx +51 -141
  92. package/dist/lib/browser/chunk-DJE2HYFV.mjs.map +0 -7
  93. package/dist/lib/node/chunk-FYWGZYJB.cjs.map +0 -7
  94. package/dist/lib/node/chunk-JFDDZI4Y.cjs.map +0 -7
  95. package/dist/lib/node-esm/chunk-DVUZ7A7G.mjs.map +0 -7
@@ -9,6 +9,7 @@ var meta_default = {
9
9
  var SPACE_ACTION = `${SPACE_PLUGIN}/action`;
10
10
  var SpaceAction;
11
11
  (function(SpaceAction2) {
12
+ SpaceAction2[SpaceAction2["OPEN_CREATE_SPACE"] = `${SPACE_ACTION}/open-create-space`] = "OPEN_CREATE_SPACE";
12
13
  SpaceAction2[SpaceAction2["CREATE"] = `${SPACE_ACTION}/create`] = "CREATE";
13
14
  SpaceAction2[SpaceAction2["JOIN"] = `${SPACE_ACTION}/join`] = "JOIN";
14
15
  SpaceAction2[SpaceAction2["SHARE"] = `${SPACE_ACTION}/share`] = "SHARE";
@@ -18,6 +19,7 @@ var SpaceAction;
18
19
  SpaceAction2[SpaceAction2["OPEN"] = `${SPACE_ACTION}/open`] = "OPEN";
19
20
  SpaceAction2[SpaceAction2["CLOSE"] = `${SPACE_ACTION}/close`] = "CLOSE";
20
21
  SpaceAction2[SpaceAction2["MIGRATE"] = `${SPACE_ACTION}/migrate`] = "MIGRATE";
22
+ SpaceAction2[SpaceAction2["OPEN_CREATE_OBJECT"] = `${SPACE_ACTION}/open-create-object`] = "OPEN_CREATE_OBJECT";
21
23
  SpaceAction2[SpaceAction2["ADD_OBJECT"] = `${SPACE_ACTION}/add-object`] = "ADD_OBJECT";
22
24
  SpaceAction2[SpaceAction2["REMOVE_OBJECTS"] = `${SPACE_ACTION}/remove-objects`] = "REMOVE_OBJECTS";
23
25
  SpaceAction2[SpaceAction2["RENAME_OBJECT"] = `${SPACE_ACTION}/rename-object`] = "RENAME_OBJECT";
@@ -26,11 +28,16 @@ var SpaceAction;
26
28
  SpaceAction2[SpaceAction2["TOGGLE_HIDDEN"] = `${SPACE_ACTION}/toggle-hidden`] = "TOGGLE_HIDDEN";
27
29
  SpaceAction2[SpaceAction2["OPEN_SETTINGS"] = `${SPACE_ACTION}/open-settings`] = "OPEN_SETTINGS";
28
30
  })(SpaceAction || (SpaceAction = {}));
31
+ var CollectionAction;
32
+ (function(CollectionAction2) {
33
+ CollectionAction2["CREATE"] = "dxos.org/plugin/collection/action/create";
34
+ })(CollectionAction || (CollectionAction = {}));
29
35
 
30
36
  export {
31
37
  SPACE_PLUGIN,
32
38
  SPACE_PLUGIN_SHORT_ID,
33
39
  meta_default,
34
- SpaceAction
40
+ SpaceAction,
41
+ CollectionAction
35
42
  };
36
- //# sourceMappingURL=chunk-DJE2HYFV.mjs.map
43
+ //# sourceMappingURL=chunk-FTKV32QZ.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/meta.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const SPACE_PLUGIN = 'dxos.org/plugin/space';\nexport const SPACE_PLUGIN_SHORT_ID = 'space';\n\nexport default {\n id: SPACE_PLUGIN,\n shortId: SPACE_PLUGIN_SHORT_ID,\n name: 'Spaces',\n} satisfies PluginMeta;\n\nconst SPACE_ACTION = `${SPACE_PLUGIN}/action`;\nexport enum SpaceAction {\n OPEN_CREATE_SPACE = `${SPACE_ACTION}/open-create-space`,\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 OPEN_CREATE_OBJECT = `${SPACE_ACTION}/open-create-object`,\n ADD_OBJECT = `${SPACE_ACTION}/add-object`,\n REMOVE_OBJECTS = `${SPACE_ACTION}/remove-objects`,\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 OPEN_SETTINGS = `${SPACE_ACTION}/open-settings`,\n}\n\nexport enum CollectionAction {\n CREATE = 'dxos.org/plugin/collection/action/create',\n}\n"],
5
+ "mappings": ";AAMO,IAAMA,eAAe;AACrB,IAAMC,wBAAwB;AAErC,IAAA,eAAe;EACbC,IAAIF;EACJG,SAASF;EACTG,MAAM;AACR;AAEA,IAAMC,eAAe,GAAGL,YAAAA;;UACZM,cAAAA;mDACU,GAAGD,YAAAA,oBAAgC,IAAA;wCAC9C,GAAGA,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;oDACd,GAAGA,YAAAA,qBAAiC,IAAA;4CAC5C,GAAGA,YAAAA,aAAyB,IAAA;gDACxB,GAAGA,YAAAA,iBAA6B,IAAA;+CACjC,GAAGA,YAAAA,gBAA4B,IAAA;kDAC5B,GAAGA,YAAAA,mBAA+B,IAAA;iDACnC,GAAGA,YAAAA,kBAA8B,IAAA;+CACnC,GAAGA,YAAAA,gBAA4B,IAAA;+CAC/B,GAAGA,YAAAA,gBAA4B,IAAA;GAlBrCC,gBAAAA,cAAAA,CAAAA,EAAAA;;UAqBAC,mBAAAA;;GAAAA,qBAAAA,mBAAAA,CAAAA,EAAAA;",
6
+ "names": ["SPACE_PLUGIN", "SPACE_PLUGIN_SHORT_ID", "id", "shortId", "name", "SPACE_ACTION", "SpaceAction", "CollectionAction"]
7
+ }
@@ -96,8 +96,17 @@ var ChannelType = class extends TypedObject2({
96
96
  };
97
97
 
98
98
  // packages/plugins/plugin-space/src/types/types.ts
99
+ import { AST, S as S3 } from "@dxos/echo-schema";
99
100
  var SPACE_DIRECTORY_HANDLE = "dxos.org/plugin/space/directory";
100
- var parseSpaceInitPlugin = (plugin) => typeof plugin.provides.space?.onSpaceCreate === "object" ? plugin : void 0;
101
+ var parseSchemaPlugin = (plugin) => Array.isArray(plugin?.provides.echo?.schema) || Array.isArray(plugin?.provides.echo?.system) ? plugin : void 0;
102
+ var SpaceForm = S3.Struct({
103
+ name: S3.optional(S3.String.annotations({
104
+ [AST.TitleAnnotationId]: "Name"
105
+ })),
106
+ edgeReplication: S3.Boolean.annotations({
107
+ [AST.TitleAnnotationId]: "Enable EDGE Replication"
108
+ })
109
+ });
101
110
 
102
111
  export {
103
112
  CollectionType,
@@ -109,6 +118,7 @@ export {
109
118
  ThreadType,
110
119
  ChannelType,
111
120
  SPACE_DIRECTORY_HANDLE,
112
- parseSpaceInitPlugin
121
+ parseSchemaPlugin,
122
+ SpaceForm
113
123
  };
114
- //# sourceMappingURL=chunk-OWZKSWMX.mjs.map
124
+ //# sourceMappingURL=chunk-MWKXNS5S.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/types/collection.ts", "../../../src/types/thread.ts", "../../../src/types/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\nexport class CollectionType extends TypedObject({ typename: 'dxos.org/type/Collection', version: '0.1.0' })({\n name: S.optional(S.String),\n objects: S.mutable(S.Array(ref(Expando))),\n // Key is schema typename and value is reference to a view object of the associated schema.\n // Having collection reference the views rather than vice versa ensures that the state converges to a single view per key (i.e. type).\n // This also leaves open a future where this key could be changed to allow for multiple stack views per section.\n // TODO(wittjosiah): Any way to make this more type safe?\n // TODO(wittjosiah): Should the views be separate objects or just be schemas for view data in this record?\n views: S.mutable(S.Record({ key: S.String, value: ref(Expando) })),\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(wittjosiah): These types were placed here rather than in @dxos/plugin-thread\n// in order to avoid a circular dependency between threads and other objects that use threads.\n\n// TODO(wittjosiah): Factor out to halo?\nexport class ContactType extends TypedObject({ typename: 'dxos.org/type/Contact', version: '0.1.0' })({\n name: S.optional(S.String),\n identifiers: S.mutable(\n S.Array(\n S.Struct({\n type: S.String,\n value: S.String,\n }),\n ),\n ),\n}) {}\n\nexport const ActorSchema = S.mutable(\n S.Struct({\n contact: S.optional(ref(ContactType)),\n // TODO(wittjosiah): Should the below fields just be the contact schema?\n // i.e. it should either be a reference to an existing contact or an inline contact schema.\n identityKey: S.optional(S.String),\n // TODO(burdon): Generalize to handle/identifier?\n email: S.optional(S.String),\n name: S.optional(S.String),\n }),\n);\n\nexport type ActorType = S.Schema.Type<typeof ActorSchema>;\n\nexport enum MessageState {\n NONE = 0,\n ARCHIVED = 1,\n DELETED = 2,\n SPAM = 3,\n}\n\nexport class MessageType extends TypedObject({ typename: 'dxos.org/type/Message', version: '0.1.0' })({\n /** ISO date string when the message was sent. */\n timestamp: S.String,\n /** Message state. */\n state: S.optional(S.Enums(MessageState)),\n /** Identity of the message sender. */\n sender: ActorSchema,\n /** Text content of the message. */\n text: S.String,\n /** Non-text content sent with a message (e.g., files, polls, etc.) */\n parts: S.optional(S.mutable(S.Array(ref(Expando)))),\n /** Custom properties for specific message types (e.g. email subject or cc fields). */\n properties: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),\n // TODO(wittjosiah): Add read status:\n // - Read receipts need to be per space member.\n // - Read receipts don't need to be added to schema until they being implemented.\n /** Context of the application when message was created. */\n // TODO(burdon): Evolve \"attention object\" to be current UX state? E.g., of Deck?\n context: S.optional(ref(Expando)),\n}) {}\n\nexport const ThreadStatus = S.Union(S.Literal('staged'), S.Literal('active'), S.Literal('resolved'));\n\nexport class ThreadType extends TypedObject({ typename: 'dxos.org/type/Thread', version: '0.1.0' })({\n name: S.optional(S.String),\n /** AM cursor-range: 'from:to'. */\n anchor: S.optional(S.String),\n status: S.optional(ThreadStatus),\n messages: S.mutable(S.Array(ref(MessageType))),\n}) {}\n\nexport class ChannelType extends TypedObject({ typename: 'dxos.org/type/Channel', version: '0.1.0' })({\n name: S.optional(S.String),\n threads: S.mutable(S.Array(ref(ThreadType))),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n GraphSerializerProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SettingsProvides,\n SurfaceProvides,\n TranslationsProvides,\n Plugin,\n} from '@dxos/app-framework';\nimport { type Expando } from '@dxos/echo-schema';\nimport { type SchemaProvides } from '@dxos/plugin-client';\nimport { type PanelProvides } from '@dxos/plugin-deck/types';\nimport { type PublicKey } from '@dxos/react-client';\nimport { type Space } from '@dxos/react-client/echo';\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 /**\n * Whether or not the user can navigate to collections in the graph.\n * Determined by whether or not there is an available plugin that can render a collection.\n */\n navigableCollections: 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 PanelProvides & {\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.space Space to use for deserializing schema references.\n * @param params.newId Generate new ID for deserialized object.\n */\n deserialize(params: { content: string; space: Space; 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,QAAQ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OAAOR,GAAE0B;EAAI,CAAA,CAAA,CAAA;;;;;;EAMxEC,SAAS3B,GAAEC,SAASU,KAAIW,QAAAA,CAAAA;AAC1B,CAAA,EAAA;AAAI;AAEG,IAAMM,eAAe5B,GAAE6B,MAAM7B,GAAE8B,QAAQ,QAAA,GAAW9B,GAAE8B,QAAQ,QAAA,GAAW9B,GAAE8B,QAAQ,UAAA,CAAA;AAEjF,IAAMC,aAAN,cAAyBnC,aAAY;EAAEC,UAAU;EAAwBC,SAAS;AAAQ,CAAA,EAAG;EAClGC,MAAMC,GAAEC,SAASD,GAAEE,MAAM;;EAEzB8B,QAAQhC,GAAEC,SAASD,GAAEE,MAAM;EAC3B+B,QAAQjC,GAAEC,SAAS2B,YAAAA;EACnBM,UAAUlC,GAAEI,QAAQJ,GAAEK,MAAMM,KAAII,WAAAA,CAAAA,CAAAA;AAClC,CAAA,EAAA;AAAI;AAEG,IAAMoB,cAAN,cAA0BvC,aAAY;EAAEC,UAAU;EAAyBC,SAAS;AAAQ,CAAA,EAAG;EACpGC,MAAMC,GAAEC,SAASD,GAAEE,MAAM;EACzBkC,SAASpC,GAAEI,QAAQJ,GAAEK,MAAMM,KAAIoB,UAAAA,CAAAA,CAAAA;AACjC,CAAA,EAAA;AAAI;;;ACvDG,IAAMM,yBAAyB;AAgE/B,IAAMC,uBAAuB,CAACC,WACnC,OAAQA,OAAOC,SAAiBC,OAAOC,kBAAkB,WAAYH,SAAuCI;",
6
- "names": ["Expando", "ref", "S", "TypedObject", "CollectionType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "objects", "mutable", "Array", "ref", "Expando", "views", "Record", "key", "value", "Expando", "ref", "S", "TypedObject", "ContactType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "identifiers", "mutable", "Array", "Struct", "type", "value", "ActorSchema", "contact", "ref", "identityKey", "email", "MessageState", "MessageType", "timestamp", "state", "Enums", "sender", "text", "parts", "Expando", "properties", "Record", "key", "Any", "context", "ThreadStatus", "Union", "Literal", "ThreadType", "anchor", "status", "messages", "ChannelType", "threads", "SPACE_DIRECTORY_HANDLE", "parseSpaceInitPlugin", "plugin", "provides", "space", "onSpaceCreate", "undefined"]
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\nexport class CollectionType extends TypedObject({ typename: 'dxos.org/type/Collection', version: '0.1.0' })({\n name: S.optional(S.String),\n objects: S.mutable(S.Array(ref(Expando))),\n // Key is schema typename and value is reference to a view object of the associated schema.\n // Having collection reference the views rather than vice versa ensures that the state converges to a single view per key (i.e. type).\n // This also leaves open a future where this key could be changed to allow for multiple stack views per section.\n // TODO(wittjosiah): Any way to make this more type safe?\n // TODO(wittjosiah): Should the views be separate objects or just be schemas for view data in this record?\n views: S.mutable(S.Record({ key: S.String, value: ref(Expando) })),\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(wittjosiah): These types were placed here rather than in @dxos/plugin-thread\n// in order to avoid a circular dependency between threads and other objects that use threads.\n\n// TODO(wittjosiah): Factor out to halo?\nexport class ContactType extends TypedObject({ typename: 'dxos.org/type/Contact', version: '0.1.0' })({\n name: S.optional(S.String),\n identifiers: S.mutable(\n S.Array(\n S.Struct({\n type: S.String,\n value: S.String,\n }),\n ),\n ),\n}) {}\n\nexport const ActorSchema = S.mutable(\n S.Struct({\n contact: S.optional(ref(ContactType)),\n // TODO(wittjosiah): Should the below fields just be the contact schema?\n // i.e. it should either be a reference to an existing contact or an inline contact schema.\n identityKey: S.optional(S.String),\n // TODO(burdon): Generalize to handle/identifier?\n email: S.optional(S.String),\n name: S.optional(S.String),\n }),\n);\n\nexport type ActorType = S.Schema.Type<typeof ActorSchema>;\n\nexport enum MessageState {\n NONE = 0,\n ARCHIVED = 1,\n DELETED = 2,\n SPAM = 3,\n}\n\nexport class MessageType extends TypedObject({ typename: 'dxos.org/type/Message', version: '0.1.0' })({\n /** ISO date string when the message was sent. */\n timestamp: S.String,\n /** Message state. */\n state: S.optional(S.Enums(MessageState)),\n /** Identity of the message sender. */\n sender: ActorSchema,\n /** Text content of the message. */\n text: S.String,\n /** Non-text content sent with a message (e.g., files, polls, etc.) */\n parts: S.optional(S.mutable(S.Array(ref(Expando)))),\n /** Custom properties for specific message types (e.g. email subject or cc fields). */\n properties: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),\n // TODO(wittjosiah): Add read status:\n // - Read receipts need to be per space member.\n // - Read receipts don't need to be added to schema until they being implemented.\n /** Context of the application when message was created. */\n // TODO(burdon): Evolve \"attention object\" to be current UX state? E.g., of Deck?\n context: S.optional(ref(Expando)),\n}) {}\n\nexport const ThreadStatus = S.Union(S.Literal('staged'), S.Literal('active'), S.Literal('resolved'));\n\nexport class ThreadType extends TypedObject({ typename: 'dxos.org/type/Thread', version: '0.1.0' })({\n name: S.optional(S.String),\n /** AM cursor-range: 'from:to'. */\n anchor: S.optional(S.String),\n status: S.optional(ThreadStatus),\n messages: S.mutable(S.Array(ref(MessageType))),\n}) {}\n\nexport class ChannelType extends TypedObject({ typename: 'dxos.org/type/Channel', version: '0.1.0' })({\n name: S.optional(S.String),\n threads: S.mutable(S.Array(ref(ThreadType))),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n GraphSerializerProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SettingsProvides,\n SurfaceProvides,\n TranslationsProvides,\n Plugin,\n} from '@dxos/app-framework';\nimport { AST, S, type AbstractTypedObject, type Expando } from '@dxos/echo-schema';\nimport { type PanelProvides } from '@dxos/plugin-deck/types';\nimport { type PublicKey } from '@dxos/react-client';\nimport { type Space } from '@dxos/react-client/echo';\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 /**\n * Whether or not the user can navigate to collections in the graph.\n * Determined by whether or not there is an available plugin that can render a collection.\n */\n navigableCollections: boolean;\n\n /**\n * Tracks whether setting edge replication as default has been run on spaces.\n */\n // TODO(wittjosiah): Systematic way to handle migrations of state outside of spaces.\n enabledEdgeReplication: boolean;\n};\n\nexport type SpaceSettingsProps = {\n /**\n * Show closed spaces.\n */\n showHidden?: boolean;\n};\n\nexport type SchemaProvides = {\n echo: {\n schema?: AbstractTypedObject[];\n system?: AbstractTypedObject[];\n };\n};\n\nexport const parseSchemaPlugin = (plugin?: Plugin) =>\n Array.isArray((plugin?.provides as any).echo?.schema) || Array.isArray((plugin?.provides as any).echo?.system)\n ? (plugin as Plugin<SchemaProvides>)\n : undefined;\n\nexport type SpacePluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n GraphSerializerProvides &\n MetadataRecordsProvides &\n SettingsProvides<SpaceSettingsProps> &\n TranslationsProvides &\n SchemaProvides &\n PanelProvides & {\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.space Space to use for deserializing schema references.\n * @param params.newId Generate new ID for deserialized object.\n */\n deserialize(params: { content: string; space: Space; newId?: boolean }): Promise<T>;\n}\n\nexport const SpaceForm = S.Struct({\n name: S.optional(S.String.annotations({ [AST.TitleAnnotationId]: 'Name' })),\n edgeReplication: S.Boolean.annotations({ [AST.TitleAnnotationId]: 'Enable EDGE Replication' }),\n});\n"],
5
+ "mappings": ";AAIA,SAASA,SAASC,KAAKC,GAAGC,mBAAmB;AAEtC,IAAMC,iBAAN,cAA6BC,YAAY;EAAEC,UAAU;EAA4BC,SAAS;AAAQ,CAAA,EAAG;EAC1GC,MAAMC,EAAEC,SAASD,EAAEE,MAAM;EACzBC,SAASH,EAAEI,QAAQJ,EAAEK,MAAMC,IAAIC,OAAAA,CAAAA,CAAAA;;;;;;EAM/BC,OAAOR,EAAEI,QAAQJ,EAAES,OAAO;IAAEC,KAAKV,EAAEE;IAAQS,OAAOL,IAAIC,OAAAA;EAAS,CAAA,CAAA;AACjE,CAAA,EAAA;AAAI;;;ACXJ,SAASK,WAAAA,UAASC,OAAAA,MAAKC,KAAAA,IAAGC,eAAAA,oBAAmB;AAMtC,IAAMC,cAAN,cAA0BC,aAAY;EAAEC,UAAU;EAAyBC,SAAS;AAAQ,CAAA,EAAG;EACpGC,MAAMC,GAAEC,SAASD,GAAEE,MAAM;EACzBC,aAAaH,GAAEI,QACbJ,GAAEK,MACAL,GAAEM,OAAO;IACPC,MAAMP,GAAEE;IACRM,OAAOR,GAAEE;EACX,CAAA,CAAA,CAAA;AAGN,CAAA,EAAA;AAAI;AAEG,IAAMO,cAAcT,GAAEI,QAC3BJ,GAAEM,OAAO;EACPI,SAASV,GAAEC,SAASU,KAAIhB,WAAAA,CAAAA;;;EAGxBiB,aAAaZ,GAAEC,SAASD,GAAEE,MAAM;;EAEhCW,OAAOb,GAAEC,SAASD,GAAEE,MAAM;EAC1BH,MAAMC,GAAEC,SAASD,GAAEE,MAAM;AAC3B,CAAA,CAAA;;UAKUY,eAAAA;;;;;GAAAA,iBAAAA,eAAAA,CAAAA,E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MC,yBAAyB;AA+D/B,IAAMC,oBAAoB,CAACC,WAChCC,MAAMC,QAASF,QAAQG,SAAiBC,MAAMC,MAAAA,KAAWJ,MAAMC,QAASF,QAAQG,SAAiBC,MAAME,MAAAA,IAClGN,SACDO;AA6BC,IAAMC,YAAYC,GAAEC,OAAO;EAChCC,MAAMF,GAAEG,SAASH,GAAEI,OAAOC,YAAY;IAAE,CAACC,IAAIC,iBAAiB,GAAG;EAAO,CAAA,CAAA;EACxEC,iBAAiBR,GAAES,QAAQJ,YAAY;IAAE,CAACC,IAAIC,iBAAiB,GAAG;EAA0B,CAAA;AAC9F,CAAA;",
6
+ "names": ["Expando", "ref", "S", "TypedObject", "CollectionType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "objects", "mutable", "Array", "ref", "Expando", "views", "Record", "key", "value", "Expando", "ref", "S", "TypedObject", "ContactType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "identifiers", "mutable", "Array", "Struct", "type", "value", "ActorSchema", "contact", "ref", "identityKey", "email", "MessageState", "MessageType", "timestamp", "state", "Enums", "sender", "text", "parts", "Expando", "properties", "Record", "key", "Any", "context", "ThreadStatus", "Union", "Literal", "ThreadType", "anchor", "status", "messages", "ChannelType", "threads", "AST", "S", "SPACE_DIRECTORY_HANDLE", "parseSchemaPlugin", "plugin", "Array", "isArray", "provides", "echo", "schema", "system", "undefined", "SpaceForm", "S", "Struct", "name", "optional", "String", "annotations", "AST", "TitleAnnotationId", "edgeReplication", "Boolean"]
7
7
  }