@dxos/plugin-space 0.7.4 → 0.7.5-main.937ce75

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 (120) hide show
  1. package/dist/lib/browser/chunk-54VE4GTA.mjs +315 -0
  2. package/dist/lib/browser/chunk-54VE4GTA.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-73BCBSLP.mjs +15 -0
  4. package/dist/lib/browser/chunk-73BCBSLP.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +928 -962
  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 -5
  9. package/dist/lib/browser/types/index.mjs +8 -1
  10. package/dist/lib/node/chunk-46S3JOES.cjs +39 -0
  11. package/dist/lib/node/chunk-46S3JOES.cjs.map +7 -0
  12. package/dist/lib/node/chunk-YF2AQ7KP.cjs +343 -0
  13. package/dist/lib/node/chunk-YF2AQ7KP.cjs.map +7 -0
  14. package/dist/lib/node/index.cjs +1053 -1086
  15. package/dist/lib/node/index.cjs.map +4 -4
  16. package/dist/lib/node/meta.cjs +5 -9
  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 +19 -12
  20. package/dist/lib/node/types/index.cjs.map +2 -2
  21. package/dist/lib/node-esm/chunk-2MNFEB23.mjs +17 -0
  22. package/dist/lib/node-esm/chunk-2MNFEB23.mjs.map +7 -0
  23. package/dist/lib/node-esm/chunk-CDZETPO7.mjs +316 -0
  24. package/dist/lib/node-esm/chunk-CDZETPO7.mjs.map +7 -0
  25. package/dist/lib/node-esm/index.mjs +928 -962
  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 -5
  29. package/dist/lib/node-esm/types/index.mjs +8 -1
  30. package/dist/types/src/SpacePlugin.d.ts +2 -2
  31. package/dist/types/src/SpacePlugin.d.ts.map +1 -1
  32. package/dist/types/src/components/AwaitingObject.d.ts.map +1 -1
  33. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts +4 -2
  34. package/dist/types/src/components/CreateDialog/CreateObjectDialog.d.ts.map +1 -1
  35. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts +3 -3
  36. package/dist/types/src/components/CreateDialog/CreateObjectPanel.d.ts.map +1 -1
  37. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts +1 -0
  38. package/dist/types/src/components/CreateDialog/CreateSpaceDialog.d.ts.map +1 -1
  39. package/dist/types/src/components/JoinDialog.d.ts +1 -0
  40. package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
  41. package/dist/types/src/components/PopoverRenameObject.d.ts +1 -0
  42. package/dist/types/src/components/PopoverRenameObject.d.ts.map +1 -1
  43. package/dist/types/src/components/PopoverRenameSpace.d.ts +1 -0
  44. package/dist/types/src/components/PopoverRenameSpace.d.ts.map +1 -1
  45. package/dist/types/src/components/ShareSpaceButton.d.ts.map +1 -1
  46. package/dist/types/src/components/SpacePluginSettings.d.ts.map +1 -1
  47. package/dist/types/src/components/SpacePresence.d.ts +9 -6
  48. package/dist/types/src/components/SpacePresence.d.ts.map +1 -1
  49. package/dist/types/src/components/SpacePresence.stories.d.ts +1 -1
  50. package/dist/types/src/components/SpacePresence.stories.d.ts.map +1 -1
  51. package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts +1 -0
  52. package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.d.ts.map +1 -1
  53. package/dist/types/src/components/SpaceSettings/SpaceSettingsDialog.stories.d.ts.map +1 -1
  54. package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts +4 -3
  55. package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.d.ts.map +1 -1
  56. package/dist/types/src/components/SpaceSettings/SpaceSettingsPanel.stories.d.ts.map +1 -1
  57. package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts +3 -3
  58. package/dist/types/src/components/SyncStatus/InlineSyncStatus.d.ts.map +1 -1
  59. package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts +2 -2
  60. package/dist/types/src/components/SyncStatus/SyncStatusDetail.stories.d.ts.map +1 -1
  61. package/dist/types/src/hooks/index.d.ts +2 -0
  62. package/dist/types/src/hooks/index.d.ts.map +1 -0
  63. package/dist/types/src/hooks/usePath.d.ts +11 -0
  64. package/dist/types/src/hooks/usePath.d.ts.map +1 -0
  65. package/dist/types/src/meta.d.ts +0 -23
  66. package/dist/types/src/meta.d.ts.map +1 -1
  67. package/dist/types/src/translations.d.ts +6 -3
  68. package/dist/types/src/translations.d.ts.map +1 -1
  69. package/dist/types/src/types/collection.d.ts +8 -12
  70. package/dist/types/src/types/collection.d.ts.map +1 -1
  71. package/dist/types/src/types/thread.d.ts +180 -186
  72. package/dist/types/src/types/thread.d.ts.map +1 -1
  73. package/dist/types/src/types/types.d.ts +234 -4
  74. package/dist/types/src/types/types.d.ts.map +1 -1
  75. package/dist/types/src/util.d.ts +3 -3
  76. package/dist/types/src/util.d.ts.map +1 -1
  77. package/dist/types/tsconfig.tsbuildinfo +1 -0
  78. package/package.json +39 -38
  79. package/src/SpacePlugin.tsx +477 -602
  80. package/src/components/AwaitingObject.tsx +19 -17
  81. package/src/components/CreateDialog/CreateObjectDialog.tsx +33 -22
  82. package/src/components/CreateDialog/CreateObjectPanel.tsx +7 -7
  83. package/src/components/CreateDialog/CreateSpaceDialog.tsx +10 -14
  84. package/src/components/JoinDialog.tsx +18 -34
  85. package/src/components/PersistenceStatus.tsx +1 -1
  86. package/src/components/PopoverRenameObject.tsx +2 -0
  87. package/src/components/PopoverRenameSpace.tsx +2 -0
  88. package/src/components/ShareSpaceButton.tsx +5 -4
  89. package/src/components/SpacePluginSettings.tsx +5 -11
  90. package/src/components/SpacePresence.stories.tsx +25 -17
  91. package/src/components/SpacePresence.tsx +36 -16
  92. package/src/components/SpaceSettings/SpaceSettingsDialog.stories.tsx +2 -3
  93. package/src/components/SpaceSettings/SpaceSettingsDialog.tsx +3 -1
  94. package/src/components/SpaceSettings/SpaceSettingsPanel.stories.tsx +7 -5
  95. package/src/components/SpaceSettings/SpaceSettingsPanel.tsx +6 -5
  96. package/src/components/SyncStatus/InlineSyncStatus.tsx +37 -27
  97. package/src/components/SyncStatus/SyncStatusDetail.stories.tsx +55 -51
  98. package/src/hooks/index.ts +5 -0
  99. package/src/hooks/usePath.ts +44 -0
  100. package/src/meta.ts +0 -26
  101. package/src/translations.ts +3 -2
  102. package/src/types/collection.ts +3 -3
  103. package/src/types/thread.ts +6 -6
  104. package/src/types/types.ts +182 -13
  105. package/src/util.tsx +59 -52
  106. package/dist/lib/browser/chunk-FTKV32QZ.mjs +0 -43
  107. package/dist/lib/browser/chunk-FTKV32QZ.mjs.map +0 -7
  108. package/dist/lib/browser/chunk-MWKXNS5S.mjs +0 -124
  109. package/dist/lib/browser/chunk-MWKXNS5S.mjs.map +0 -7
  110. package/dist/lib/node/chunk-6SNOZF7Y.cjs +0 -152
  111. package/dist/lib/node/chunk-6SNOZF7Y.cjs.map +0 -7
  112. package/dist/lib/node/chunk-QNVEU2UD.cjs +0 -69
  113. package/dist/lib/node/chunk-QNVEU2UD.cjs.map +0 -7
  114. package/dist/lib/node-esm/chunk-OHEAWSCA.mjs +0 -126
  115. package/dist/lib/node-esm/chunk-OHEAWSCA.mjs.map +0 -7
  116. package/dist/lib/node-esm/chunk-UMV7XREB.mjs +0 -45
  117. package/dist/lib/node-esm/chunk-UMV7XREB.mjs.map +0 -7
  118. package/dist/types/src/components/SyncStatus/InlineSyncStatus.stories.d.ts +0 -6
  119. package/dist/types/src/components/SyncStatus/InlineSyncStatus.stories.d.ts.map +0 -1
  120. package/src/components/SyncStatus/InlineSyncStatus.stories.tsx +0 -57
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/collection.ts", "../../../src/types/thread.ts", "../../../src/types/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\nexport class CollectionType extends TypedObject({ typename: 'dxos.org/type/Collection', version: '0.1.0' })({\n name: S.optional(S.String),\n objects: S.mutable(S.Array(ref(Expando))),\n // Key is schema typename and value is reference to a view object of the associated schema.\n // Having collection reference the views rather than vice versa ensures that the state converges to a single view per key (i.e. type).\n // This also leaves open a future where this key could be changed to allow for multiple stack views per section.\n // TODO(wittjosiah): Any way to make this more type safe?\n // TODO(wittjosiah): Should the views be separate objects or just be schemas for view data in this record?\n views: S.mutable(S.Record({ key: S.String, value: ref(Expando) })),\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(wittjosiah): These types were placed here rather than in @dxos/plugin-thread\n// in order to avoid a circular dependency between threads and other objects that use threads.\n\n// TODO(wittjosiah): Factor out to halo?\nexport class ContactType extends TypedObject({ typename: 'dxos.org/type/Contact', version: '0.1.0' })({\n name: S.optional(S.String),\n identifiers: S.mutable(\n S.Array(\n S.Struct({\n type: S.String,\n value: S.String,\n }),\n ),\n ),\n}) {}\n\nexport const ActorSchema = S.mutable(\n S.Struct({\n contact: S.optional(ref(ContactType)),\n // TODO(wittjosiah): Should the below fields just be the contact schema?\n // i.e. it should either be a reference to an existing contact or an inline contact schema.\n identityKey: S.optional(S.String),\n // TODO(burdon): Generalize to handle/identifier?\n email: S.optional(S.String),\n name: S.optional(S.String),\n }),\n);\n\nexport type ActorType = S.Schema.Type<typeof ActorSchema>;\n\nexport enum MessageState {\n NONE = 0,\n ARCHIVED = 1,\n DELETED = 2,\n SPAM = 3,\n}\n\nexport class MessageType extends TypedObject({ typename: 'dxos.org/type/Message', version: '0.1.0' })({\n /** ISO date string when the message was sent. */\n timestamp: S.String,\n /** Message state. */\n state: S.optional(S.Enums(MessageState)),\n /** Identity of the message sender. */\n sender: ActorSchema,\n /** Text content of the message. */\n text: S.String,\n /** Non-text content sent with a message (e.g., files, polls, etc.) */\n parts: S.optional(S.mutable(S.Array(ref(Expando)))),\n /** Custom properties for specific message types (e.g. email subject or cc fields). */\n properties: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),\n // TODO(wittjosiah): Add read status:\n // - Read receipts need to be per space member.\n // - Read receipts don't need to be added to schema until they being implemented.\n /** Context of the application when message was created. */\n // TODO(burdon): Evolve \"attention object\" to be current UX state? E.g., of Deck?\n context: S.optional(ref(Expando)),\n}) {}\n\nexport const ThreadStatus = S.Union(S.Literal('staged'), S.Literal('active'), S.Literal('resolved'));\n\nexport class ThreadType extends TypedObject({ typename: 'dxos.org/type/Thread', version: '0.1.0' })({\n name: S.optional(S.String),\n /** AM cursor-range: 'from:to'. */\n anchor: S.optional(S.String),\n status: S.optional(ThreadStatus),\n messages: S.mutable(S.Array(ref(MessageType))),\n}) {}\n\nexport class ChannelType extends TypedObject({ typename: 'dxos.org/type/Channel', version: '0.1.0' })({\n name: S.optional(S.String),\n threads: S.mutable(S.Array(ref(ThreadType))),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n GraphSerializerProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SettingsProvides,\n SurfaceProvides,\n TranslationsProvides,\n Plugin,\n} from '@dxos/app-framework';\nimport { 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": "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",
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
- }
@@ -1,152 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_6SNOZF7Y_exports = {};
20
- __export(chunk_6SNOZF7Y_exports, {
21
- ActorSchema: () => ActorSchema,
22
- ChannelType: () => ChannelType,
23
- CollectionType: () => CollectionType,
24
- ContactType: () => ContactType,
25
- MessageState: () => MessageState,
26
- MessageType: () => MessageType,
27
- SPACE_DIRECTORY_HANDLE: () => SPACE_DIRECTORY_HANDLE,
28
- SpaceForm: () => SpaceForm,
29
- ThreadStatus: () => ThreadStatus,
30
- ThreadType: () => ThreadType,
31
- parseSchemaPlugin: () => parseSchemaPlugin
32
- });
33
- module.exports = __toCommonJS(chunk_6SNOZF7Y_exports);
34
- var import_echo_schema = require("@dxos/echo-schema");
35
- var import_echo_schema2 = require("@dxos/echo-schema");
36
- var import_echo_schema3 = require("@dxos/echo-schema");
37
- var CollectionType = class extends (0, import_echo_schema.TypedObject)({
38
- typename: "dxos.org/type/Collection",
39
- version: "0.1.0"
40
- })({
41
- name: import_echo_schema.S.optional(import_echo_schema.S.String),
42
- objects: import_echo_schema.S.mutable(import_echo_schema.S.Array((0, import_echo_schema.ref)(import_echo_schema.Expando))),
43
- // Key is schema typename and value is reference to a view object of the associated schema.
44
- // Having collection reference the views rather than vice versa ensures that the state converges to a single view per key (i.e. type).
45
- // This also leaves open a future where this key could be changed to allow for multiple stack views per section.
46
- // TODO(wittjosiah): Any way to make this more type safe?
47
- // TODO(wittjosiah): Should the views be separate objects or just be schemas for view data in this record?
48
- views: import_echo_schema.S.mutable(import_echo_schema.S.Record({
49
- key: import_echo_schema.S.String,
50
- value: (0, import_echo_schema.ref)(import_echo_schema.Expando)
51
- }))
52
- }) {
53
- };
54
- var ContactType = class extends (0, import_echo_schema2.TypedObject)({
55
- typename: "dxos.org/type/Contact",
56
- version: "0.1.0"
57
- })({
58
- name: import_echo_schema2.S.optional(import_echo_schema2.S.String),
59
- identifiers: import_echo_schema2.S.mutable(import_echo_schema2.S.Array(import_echo_schema2.S.Struct({
60
- type: import_echo_schema2.S.String,
61
- value: import_echo_schema2.S.String
62
- })))
63
- }) {
64
- };
65
- var ActorSchema = import_echo_schema2.S.mutable(import_echo_schema2.S.Struct({
66
- contact: import_echo_schema2.S.optional((0, import_echo_schema2.ref)(ContactType)),
67
- // TODO(wittjosiah): Should the below fields just be the contact schema?
68
- // i.e. it should either be a reference to an existing contact or an inline contact schema.
69
- identityKey: import_echo_schema2.S.optional(import_echo_schema2.S.String),
70
- // TODO(burdon): Generalize to handle/identifier?
71
- email: import_echo_schema2.S.optional(import_echo_schema2.S.String),
72
- name: import_echo_schema2.S.optional(import_echo_schema2.S.String)
73
- }));
74
- var MessageState;
75
- (function(MessageState2) {
76
- MessageState2[MessageState2["NONE"] = 0] = "NONE";
77
- MessageState2[MessageState2["ARCHIVED"] = 1] = "ARCHIVED";
78
- MessageState2[MessageState2["DELETED"] = 2] = "DELETED";
79
- MessageState2[MessageState2["SPAM"] = 3] = "SPAM";
80
- })(MessageState || (MessageState = {}));
81
- var MessageType = class extends (0, import_echo_schema2.TypedObject)({
82
- typename: "dxos.org/type/Message",
83
- version: "0.1.0"
84
- })({
85
- /** ISO date string when the message was sent. */
86
- timestamp: import_echo_schema2.S.String,
87
- /** Message state. */
88
- state: import_echo_schema2.S.optional(import_echo_schema2.S.Enums(MessageState)),
89
- /** Identity of the message sender. */
90
- sender: ActorSchema,
91
- /** Text content of the message. */
92
- text: import_echo_schema2.S.String,
93
- /** Non-text content sent with a message (e.g., files, polls, etc.) */
94
- parts: import_echo_schema2.S.optional(import_echo_schema2.S.mutable(import_echo_schema2.S.Array((0, import_echo_schema2.ref)(import_echo_schema2.Expando)))),
95
- /** Custom properties for specific message types (e.g. email subject or cc fields). */
96
- properties: import_echo_schema2.S.optional(import_echo_schema2.S.mutable(import_echo_schema2.S.Record({
97
- key: import_echo_schema2.S.String,
98
- value: import_echo_schema2.S.Any
99
- }))),
100
- // TODO(wittjosiah): Add read status:
101
- // - Read receipts need to be per space member.
102
- // - Read receipts don't need to be added to schema until they being implemented.
103
- /** Context of the application when message was created. */
104
- // TODO(burdon): Evolve "attention object" to be current UX state? E.g., of Deck?
105
- context: import_echo_schema2.S.optional((0, import_echo_schema2.ref)(import_echo_schema2.Expando))
106
- }) {
107
- };
108
- var ThreadStatus = import_echo_schema2.S.Union(import_echo_schema2.S.Literal("staged"), import_echo_schema2.S.Literal("active"), import_echo_schema2.S.Literal("resolved"));
109
- var ThreadType = class extends (0, import_echo_schema2.TypedObject)({
110
- typename: "dxos.org/type/Thread",
111
- version: "0.1.0"
112
- })({
113
- name: import_echo_schema2.S.optional(import_echo_schema2.S.String),
114
- /** AM cursor-range: 'from:to'. */
115
- anchor: import_echo_schema2.S.optional(import_echo_schema2.S.String),
116
- status: import_echo_schema2.S.optional(ThreadStatus),
117
- messages: import_echo_schema2.S.mutable(import_echo_schema2.S.Array((0, import_echo_schema2.ref)(MessageType)))
118
- }) {
119
- };
120
- var ChannelType = class extends (0, import_echo_schema2.TypedObject)({
121
- typename: "dxos.org/type/Channel",
122
- version: "0.1.0"
123
- })({
124
- name: import_echo_schema2.S.optional(import_echo_schema2.S.String),
125
- threads: import_echo_schema2.S.mutable(import_echo_schema2.S.Array((0, import_echo_schema2.ref)(ThreadType)))
126
- }) {
127
- };
128
- var SPACE_DIRECTORY_HANDLE = "dxos.org/plugin/space/directory";
129
- var parseSchemaPlugin = (plugin) => Array.isArray(plugin?.provides.echo?.schema) || Array.isArray(plugin?.provides.echo?.system) ? plugin : void 0;
130
- var SpaceForm = import_echo_schema3.S.Struct({
131
- name: import_echo_schema3.S.optional(import_echo_schema3.S.String.annotations({
132
- [import_echo_schema3.AST.TitleAnnotationId]: "Name"
133
- })),
134
- edgeReplication: import_echo_schema3.S.Boolean.annotations({
135
- [import_echo_schema3.AST.TitleAnnotationId]: "Enable EDGE Replication"
136
- })
137
- });
138
- // Annotate the CommonJS export names for ESM import in node:
139
- 0 && (module.exports = {
140
- ActorSchema,
141
- ChannelType,
142
- CollectionType,
143
- ContactType,
144
- MessageState,
145
- MessageType,
146
- SPACE_DIRECTORY_HANDLE,
147
- SpaceForm,
148
- ThreadStatus,
149
- ThreadType,
150
- parseSchemaPlugin
151
- });
152
- //# sourceMappingURL=chunk-6SNOZF7Y.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/collection.ts", "../../../src/types/thread.ts", "../../../src/types/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\nexport class CollectionType extends TypedObject({ typename: 'dxos.org/type/Collection', version: '0.1.0' })({\n name: S.optional(S.String),\n objects: S.mutable(S.Array(ref(Expando))),\n // Key is schema typename and value is reference to a view object of the associated schema.\n // Having collection reference the views rather than vice versa ensures that the state converges to a single view per key (i.e. type).\n // This also leaves open a future where this key could be changed to allow for multiple stack views per section.\n // TODO(wittjosiah): Any way to make this more type safe?\n // TODO(wittjosiah): Should the views be separate objects or just be schemas for view data in this record?\n views: S.mutable(S.Record({ key: S.String, value: ref(Expando) })),\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(wittjosiah): These types were placed here rather than in @dxos/plugin-thread\n// in order to avoid a circular dependency between threads and other objects that use threads.\n\n// TODO(wittjosiah): Factor out to halo?\nexport class ContactType extends TypedObject({ typename: 'dxos.org/type/Contact', version: '0.1.0' })({\n name: S.optional(S.String),\n identifiers: S.mutable(\n S.Array(\n S.Struct({\n type: S.String,\n value: S.String,\n }),\n ),\n ),\n}) {}\n\nexport const ActorSchema = S.mutable(\n S.Struct({\n contact: S.optional(ref(ContactType)),\n // TODO(wittjosiah): Should the below fields just be the contact schema?\n // i.e. it should either be a reference to an existing contact or an inline contact schema.\n identityKey: S.optional(S.String),\n // TODO(burdon): Generalize to handle/identifier?\n email: S.optional(S.String),\n name: S.optional(S.String),\n }),\n);\n\nexport type ActorType = S.Schema.Type<typeof ActorSchema>;\n\nexport enum MessageState {\n NONE = 0,\n ARCHIVED = 1,\n DELETED = 2,\n SPAM = 3,\n}\n\nexport class MessageType extends TypedObject({ typename: 'dxos.org/type/Message', version: '0.1.0' })({\n /** ISO date string when the message was sent. */\n timestamp: S.String,\n /** Message state. */\n state: S.optional(S.Enums(MessageState)),\n /** Identity of the message sender. */\n sender: ActorSchema,\n /** Text content of the message. */\n text: S.String,\n /** Non-text content sent with a message (e.g., files, polls, etc.) */\n parts: S.optional(S.mutable(S.Array(ref(Expando)))),\n /** Custom properties for specific message types (e.g. email subject or cc fields). */\n properties: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),\n // TODO(wittjosiah): Add read status:\n // - Read receipts need to be per space member.\n // - Read receipts don't need to be added to schema until they being implemented.\n /** Context of the application when message was created. */\n // TODO(burdon): Evolve \"attention object\" to be current UX state? E.g., of Deck?\n context: S.optional(ref(Expando)),\n}) {}\n\nexport const ThreadStatus = S.Union(S.Literal('staged'), S.Literal('active'), S.Literal('resolved'));\n\nexport class ThreadType extends TypedObject({ typename: 'dxos.org/type/Thread', version: '0.1.0' })({\n name: S.optional(S.String),\n /** AM cursor-range: 'from:to'. */\n anchor: S.optional(S.String),\n status: S.optional(ThreadStatus),\n messages: S.mutable(S.Array(ref(MessageType))),\n}) {}\n\nexport class ChannelType extends TypedObject({ typename: 'dxos.org/type/Channel', version: '0.1.0' })({\n name: S.optional(S.String),\n threads: S.mutable(S.Array(ref(ThreadType))),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n GraphSerializerProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SettingsProvides,\n SurfaceProvides,\n TranslationsProvides,\n Plugin,\n} from '@dxos/app-framework';\nimport { 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": "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",
6
- "names": ["import_echo_schema", "CollectionType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "objects", "mutable", "Array", "ref", "Expando", "views", "Record", "key", "value", "ContactType", "identifiers", "Struct", "type", "ActorSchema", "contact", "identityKey", "email", "MessageState", "MessageType", "timestamp", "state", "Enums", "sender", "text", "parts", "properties", "Any", "context", "ThreadStatus", "Union", "Literal", "ThreadType", "anchor", "status", "messages", "ChannelType", "threads", "SPACE_DIRECTORY_HANDLE", "parseSchemaPlugin", "plugin", "isArray", "provides", "echo", "schema", "system", "undefined", "SpaceForm", "annotations", "AST", "TitleAnnotationId", "edgeReplication", "Boolean"]
7
- }
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_QNVEU2UD_exports = {};
20
- __export(chunk_QNVEU2UD_exports, {
21
- CollectionAction: () => CollectionAction,
22
- SPACE_PLUGIN: () => SPACE_PLUGIN,
23
- SPACE_PLUGIN_SHORT_ID: () => SPACE_PLUGIN_SHORT_ID,
24
- SpaceAction: () => SpaceAction,
25
- meta_default: () => meta_default
26
- });
27
- module.exports = __toCommonJS(chunk_QNVEU2UD_exports);
28
- var SPACE_PLUGIN = "dxos.org/plugin/space";
29
- var SPACE_PLUGIN_SHORT_ID = "space";
30
- var meta_default = {
31
- id: SPACE_PLUGIN,
32
- shortId: SPACE_PLUGIN_SHORT_ID,
33
- name: "Spaces"
34
- };
35
- var SPACE_ACTION = `${SPACE_PLUGIN}/action`;
36
- var SpaceAction;
37
- (function(SpaceAction2) {
38
- SpaceAction2[SpaceAction2["OPEN_CREATE_SPACE"] = `${SPACE_ACTION}/open-create-space`] = "OPEN_CREATE_SPACE";
39
- SpaceAction2[SpaceAction2["CREATE"] = `${SPACE_ACTION}/create`] = "CREATE";
40
- SpaceAction2[SpaceAction2["JOIN"] = `${SPACE_ACTION}/join`] = "JOIN";
41
- SpaceAction2[SpaceAction2["SHARE"] = `${SPACE_ACTION}/share`] = "SHARE";
42
- SpaceAction2[SpaceAction2["LOCK"] = `${SPACE_ACTION}/lock`] = "LOCK";
43
- SpaceAction2[SpaceAction2["UNLOCK"] = `${SPACE_ACTION}/unlock`] = "UNLOCK";
44
- SpaceAction2[SpaceAction2["RENAME"] = `${SPACE_ACTION}/rename`] = "RENAME";
45
- SpaceAction2[SpaceAction2["OPEN"] = `${SPACE_ACTION}/open`] = "OPEN";
46
- SpaceAction2[SpaceAction2["CLOSE"] = `${SPACE_ACTION}/close`] = "CLOSE";
47
- SpaceAction2[SpaceAction2["MIGRATE"] = `${SPACE_ACTION}/migrate`] = "MIGRATE";
48
- SpaceAction2[SpaceAction2["OPEN_CREATE_OBJECT"] = `${SPACE_ACTION}/open-create-object`] = "OPEN_CREATE_OBJECT";
49
- SpaceAction2[SpaceAction2["ADD_OBJECT"] = `${SPACE_ACTION}/add-object`] = "ADD_OBJECT";
50
- SpaceAction2[SpaceAction2["REMOVE_OBJECTS"] = `${SPACE_ACTION}/remove-objects`] = "REMOVE_OBJECTS";
51
- SpaceAction2[SpaceAction2["RENAME_OBJECT"] = `${SPACE_ACTION}/rename-object`] = "RENAME_OBJECT";
52
- SpaceAction2[SpaceAction2["DUPLICATE_OBJECT"] = `${SPACE_ACTION}/duplicate-object`] = "DUPLICATE_OBJECT";
53
- SpaceAction2[SpaceAction2["WAIT_FOR_OBJECT"] = `${SPACE_ACTION}/wait-for-object`] = "WAIT_FOR_OBJECT";
54
- SpaceAction2[SpaceAction2["TOGGLE_HIDDEN"] = `${SPACE_ACTION}/toggle-hidden`] = "TOGGLE_HIDDEN";
55
- SpaceAction2[SpaceAction2["OPEN_SETTINGS"] = `${SPACE_ACTION}/open-settings`] = "OPEN_SETTINGS";
56
- })(SpaceAction || (SpaceAction = {}));
57
- var CollectionAction;
58
- (function(CollectionAction2) {
59
- CollectionAction2["CREATE"] = "dxos.org/plugin/collection/action/create";
60
- })(CollectionAction || (CollectionAction = {}));
61
- // Annotate the CommonJS export names for ESM import in node:
62
- 0 && (module.exports = {
63
- CollectionAction,
64
- SPACE_PLUGIN,
65
- SPACE_PLUGIN_SHORT_ID,
66
- SpaceAction,
67
- meta_default
68
- });
69
- //# sourceMappingURL=chunk-QNVEU2UD.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const SPACE_PLUGIN = 'dxos.org/plugin/space';\nexport const SPACE_PLUGIN_SHORT_ID = 'space';\n\nexport default {\n id: SPACE_PLUGIN,\n shortId: SPACE_PLUGIN_SHORT_ID,\n name: 'Spaces',\n} satisfies PluginMeta;\n\nconst SPACE_ACTION = `${SPACE_PLUGIN}/action`;\nexport enum SpaceAction {\n 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
- }
@@ -1,126 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
-
3
- // packages/plugins/plugin-space/src/types/collection.ts
4
- import { Expando, ref, S, TypedObject } from "@dxos/echo-schema";
5
- var CollectionType = class extends TypedObject({
6
- typename: "dxos.org/type/Collection",
7
- version: "0.1.0"
8
- })({
9
- name: S.optional(S.String),
10
- objects: S.mutable(S.Array(ref(Expando))),
11
- // Key is schema typename and value is reference to a view object of the associated schema.
12
- // Having collection reference the views rather than vice versa ensures that the state converges to a single view per key (i.e. type).
13
- // This also leaves open a future where this key could be changed to allow for multiple stack views per section.
14
- // TODO(wittjosiah): Any way to make this more type safe?
15
- // TODO(wittjosiah): Should the views be separate objects or just be schemas for view data in this record?
16
- views: S.mutable(S.Record({
17
- key: S.String,
18
- value: ref(Expando)
19
- }))
20
- }) {
21
- };
22
-
23
- // packages/plugins/plugin-space/src/types/thread.ts
24
- import { Expando as Expando2, ref as ref2, S as S2, TypedObject as TypedObject2 } from "@dxos/echo-schema";
25
- var ContactType = class extends TypedObject2({
26
- typename: "dxos.org/type/Contact",
27
- version: "0.1.0"
28
- })({
29
- name: S2.optional(S2.String),
30
- identifiers: S2.mutable(S2.Array(S2.Struct({
31
- type: S2.String,
32
- value: S2.String
33
- })))
34
- }) {
35
- };
36
- var ActorSchema = S2.mutable(S2.Struct({
37
- contact: S2.optional(ref2(ContactType)),
38
- // TODO(wittjosiah): Should the below fields just be the contact schema?
39
- // i.e. it should either be a reference to an existing contact or an inline contact schema.
40
- identityKey: S2.optional(S2.String),
41
- // TODO(burdon): Generalize to handle/identifier?
42
- email: S2.optional(S2.String),
43
- name: S2.optional(S2.String)
44
- }));
45
- var MessageState;
46
- (function(MessageState2) {
47
- MessageState2[MessageState2["NONE"] = 0] = "NONE";
48
- MessageState2[MessageState2["ARCHIVED"] = 1] = "ARCHIVED";
49
- MessageState2[MessageState2["DELETED"] = 2] = "DELETED";
50
- MessageState2[MessageState2["SPAM"] = 3] = "SPAM";
51
- })(MessageState || (MessageState = {}));
52
- var MessageType = class extends TypedObject2({
53
- typename: "dxos.org/type/Message",
54
- version: "0.1.0"
55
- })({
56
- /** ISO date string when the message was sent. */
57
- timestamp: S2.String,
58
- /** Message state. */
59
- state: S2.optional(S2.Enums(MessageState)),
60
- /** Identity of the message sender. */
61
- sender: ActorSchema,
62
- /** Text content of the message. */
63
- text: S2.String,
64
- /** Non-text content sent with a message (e.g., files, polls, etc.) */
65
- parts: S2.optional(S2.mutable(S2.Array(ref2(Expando2)))),
66
- /** Custom properties for specific message types (e.g. email subject or cc fields). */
67
- properties: S2.optional(S2.mutable(S2.Record({
68
- key: S2.String,
69
- value: S2.Any
70
- }))),
71
- // TODO(wittjosiah): Add read status:
72
- // - Read receipts need to be per space member.
73
- // - Read receipts don't need to be added to schema until they being implemented.
74
- /** Context of the application when message was created. */
75
- // TODO(burdon): Evolve "attention object" to be current UX state? E.g., of Deck?
76
- context: S2.optional(ref2(Expando2))
77
- }) {
78
- };
79
- var ThreadStatus = S2.Union(S2.Literal("staged"), S2.Literal("active"), S2.Literal("resolved"));
80
- var ThreadType = class extends TypedObject2({
81
- typename: "dxos.org/type/Thread",
82
- version: "0.1.0"
83
- })({
84
- name: S2.optional(S2.String),
85
- /** AM cursor-range: 'from:to'. */
86
- anchor: S2.optional(S2.String),
87
- status: S2.optional(ThreadStatus),
88
- messages: S2.mutable(S2.Array(ref2(MessageType)))
89
- }) {
90
- };
91
- var ChannelType = class extends TypedObject2({
92
- typename: "dxos.org/type/Channel",
93
- version: "0.1.0"
94
- })({
95
- name: S2.optional(S2.String),
96
- threads: S2.mutable(S2.Array(ref2(ThreadType)))
97
- }) {
98
- };
99
-
100
- // packages/plugins/plugin-space/src/types/types.ts
101
- import { AST, S as S3 } from "@dxos/echo-schema";
102
- var SPACE_DIRECTORY_HANDLE = "dxos.org/plugin/space/directory";
103
- var parseSchemaPlugin = (plugin) => Array.isArray(plugin?.provides.echo?.schema) || Array.isArray(plugin?.provides.echo?.system) ? plugin : void 0;
104
- var SpaceForm = S3.Struct({
105
- name: S3.optional(S3.String.annotations({
106
- [AST.TitleAnnotationId]: "Name"
107
- })),
108
- edgeReplication: S3.Boolean.annotations({
109
- [AST.TitleAnnotationId]: "Enable EDGE Replication"
110
- })
111
- });
112
-
113
- export {
114
- CollectionType,
115
- ContactType,
116
- ActorSchema,
117
- MessageState,
118
- MessageType,
119
- ThreadStatus,
120
- ThreadType,
121
- ChannelType,
122
- SPACE_DIRECTORY_HANDLE,
123
- parseSchemaPlugin,
124
- SpaceForm
125
- };
126
- //# sourceMappingURL=chunk-OHEAWSCA.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/collection.ts", "../../../src/types/thread.ts", "../../../src/types/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\nexport class CollectionType extends TypedObject({ typename: 'dxos.org/type/Collection', version: '0.1.0' })({\n name: S.optional(S.String),\n objects: S.mutable(S.Array(ref(Expando))),\n // Key is schema typename and value is reference to a view object of the associated schema.\n // Having collection reference the views rather than vice versa ensures that the state converges to a single view per key (i.e. type).\n // This also leaves open a future where this key could be changed to allow for multiple stack views per section.\n // TODO(wittjosiah): Any way to make this more type safe?\n // TODO(wittjosiah): Should the views be separate objects or just be schemas for view data in this record?\n views: S.mutable(S.Record({ key: S.String, value: ref(Expando) })),\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(wittjosiah): These types were placed here rather than in @dxos/plugin-thread\n// in order to avoid a circular dependency between threads and other objects that use threads.\n\n// TODO(wittjosiah): Factor out to halo?\nexport class ContactType extends TypedObject({ typename: 'dxos.org/type/Contact', version: '0.1.0' })({\n name: S.optional(S.String),\n identifiers: S.mutable(\n S.Array(\n S.Struct({\n type: S.String,\n value: S.String,\n }),\n ),\n ),\n}) {}\n\nexport const ActorSchema = S.mutable(\n S.Struct({\n contact: S.optional(ref(ContactType)),\n // TODO(wittjosiah): Should the below fields just be the contact schema?\n // i.e. it should either be a reference to an existing contact or an inline contact schema.\n identityKey: S.optional(S.String),\n // TODO(burdon): Generalize to handle/identifier?\n email: S.optional(S.String),\n name: S.optional(S.String),\n }),\n);\n\nexport type ActorType = S.Schema.Type<typeof ActorSchema>;\n\nexport enum MessageState {\n NONE = 0,\n ARCHIVED = 1,\n DELETED = 2,\n SPAM = 3,\n}\n\nexport class MessageType extends TypedObject({ typename: 'dxos.org/type/Message', version: '0.1.0' })({\n /** ISO date string when the message was sent. */\n timestamp: S.String,\n /** Message state. */\n state: S.optional(S.Enums(MessageState)),\n /** Identity of the message sender. */\n sender: ActorSchema,\n /** Text content of the message. */\n text: S.String,\n /** Non-text content sent with a message (e.g., files, polls, etc.) */\n parts: S.optional(S.mutable(S.Array(ref(Expando)))),\n /** Custom properties for specific message types (e.g. email subject or cc fields). */\n properties: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),\n // TODO(wittjosiah): Add read status:\n // - Read receipts need to be per space member.\n // - Read receipts don't need to be added to schema until they being implemented.\n /** Context of the application when message was created. */\n // TODO(burdon): Evolve \"attention object\" to be current UX state? E.g., of Deck?\n context: S.optional(ref(Expando)),\n}) {}\n\nexport const ThreadStatus = S.Union(S.Literal('staged'), S.Literal('active'), S.Literal('resolved'));\n\nexport class ThreadType extends TypedObject({ typename: 'dxos.org/type/Thread', version: '0.1.0' })({\n name: S.optional(S.String),\n /** AM cursor-range: 'from:to'. */\n anchor: S.optional(S.String),\n status: S.optional(ThreadStatus),\n messages: S.mutable(S.Array(ref(MessageType))),\n}) {}\n\nexport class ChannelType extends TypedObject({ typename: 'dxos.org/type/Channel', version: '0.1.0' })({\n name: S.optional(S.String),\n threads: S.mutable(S.Array(ref(ThreadType))),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n GraphSerializerProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SettingsProvides,\n SurfaceProvides,\n TranslationsProvides,\n Plugin,\n} from '@dxos/app-framework';\nimport { 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": "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",
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
- }
@@ -1,45 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
-
3
- // packages/plugins/plugin-space/src/meta.ts
4
- var SPACE_PLUGIN = "dxos.org/plugin/space";
5
- var SPACE_PLUGIN_SHORT_ID = "space";
6
- var meta_default = {
7
- id: SPACE_PLUGIN,
8
- shortId: SPACE_PLUGIN_SHORT_ID,
9
- name: "Spaces"
10
- };
11
- var SPACE_ACTION = `${SPACE_PLUGIN}/action`;
12
- var SpaceAction;
13
- (function(SpaceAction2) {
14
- SpaceAction2[SpaceAction2["OPEN_CREATE_SPACE"] = `${SPACE_ACTION}/open-create-space`] = "OPEN_CREATE_SPACE";
15
- SpaceAction2[SpaceAction2["CREATE"] = `${SPACE_ACTION}/create`] = "CREATE";
16
- SpaceAction2[SpaceAction2["JOIN"] = `${SPACE_ACTION}/join`] = "JOIN";
17
- SpaceAction2[SpaceAction2["SHARE"] = `${SPACE_ACTION}/share`] = "SHARE";
18
- SpaceAction2[SpaceAction2["LOCK"] = `${SPACE_ACTION}/lock`] = "LOCK";
19
- SpaceAction2[SpaceAction2["UNLOCK"] = `${SPACE_ACTION}/unlock`] = "UNLOCK";
20
- SpaceAction2[SpaceAction2["RENAME"] = `${SPACE_ACTION}/rename`] = "RENAME";
21
- SpaceAction2[SpaceAction2["OPEN"] = `${SPACE_ACTION}/open`] = "OPEN";
22
- SpaceAction2[SpaceAction2["CLOSE"] = `${SPACE_ACTION}/close`] = "CLOSE";
23
- SpaceAction2[SpaceAction2["MIGRATE"] = `${SPACE_ACTION}/migrate`] = "MIGRATE";
24
- SpaceAction2[SpaceAction2["OPEN_CREATE_OBJECT"] = `${SPACE_ACTION}/open-create-object`] = "OPEN_CREATE_OBJECT";
25
- SpaceAction2[SpaceAction2["ADD_OBJECT"] = `${SPACE_ACTION}/add-object`] = "ADD_OBJECT";
26
- SpaceAction2[SpaceAction2["REMOVE_OBJECTS"] = `${SPACE_ACTION}/remove-objects`] = "REMOVE_OBJECTS";
27
- SpaceAction2[SpaceAction2["RENAME_OBJECT"] = `${SPACE_ACTION}/rename-object`] = "RENAME_OBJECT";
28
- SpaceAction2[SpaceAction2["DUPLICATE_OBJECT"] = `${SPACE_ACTION}/duplicate-object`] = "DUPLICATE_OBJECT";
29
- SpaceAction2[SpaceAction2["WAIT_FOR_OBJECT"] = `${SPACE_ACTION}/wait-for-object`] = "WAIT_FOR_OBJECT";
30
- SpaceAction2[SpaceAction2["TOGGLE_HIDDEN"] = `${SPACE_ACTION}/toggle-hidden`] = "TOGGLE_HIDDEN";
31
- SpaceAction2[SpaceAction2["OPEN_SETTINGS"] = `${SPACE_ACTION}/open-settings`] = "OPEN_SETTINGS";
32
- })(SpaceAction || (SpaceAction = {}));
33
- var CollectionAction;
34
- (function(CollectionAction2) {
35
- CollectionAction2["CREATE"] = "dxos.org/plugin/collection/action/create";
36
- })(CollectionAction || (CollectionAction = {}));
37
-
38
- export {
39
- SPACE_PLUGIN,
40
- SPACE_PLUGIN_SHORT_ID,
41
- meta_default,
42
- SpaceAction,
43
- CollectionAction
44
- };
45
- //# sourceMappingURL=chunk-UMV7XREB.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const SPACE_PLUGIN = 'dxos.org/plugin/space';\nexport const SPACE_PLUGIN_SHORT_ID = 'space';\n\nexport default {\n id: SPACE_PLUGIN,\n shortId: SPACE_PLUGIN_SHORT_ID,\n name: 'Spaces',\n} satisfies PluginMeta;\n\nconst SPACE_ACTION = `${SPACE_PLUGIN}/action`;\nexport enum SpaceAction {\n 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
- }
@@ -1,6 +0,0 @@
1
- import '@dxos-theme';
2
- import { type Meta } from '@storybook/react';
3
- declare const meta: Meta;
4
- export default meta;
5
- export declare const Default: {};
6
- //# sourceMappingURL=InlineSyncStatus.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InlineSyncStatus.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/SyncStatus/InlineSyncStatus.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAwC7C,QAAA,MAAM,IAAI,EAAE,IAMX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,IAAK,CAAC"}
@@ -1,57 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import '@dxos-theme';
6
-
7
- import { type Meta } from '@storybook/react';
8
- import React, { useEffect, useState } from 'react';
9
-
10
- import { withTheme, withLayout } from '@dxos/storybook-utils';
11
- import { range } from '@dxos/util';
12
-
13
- import { InlineSyncStatusIndicator } from './InlineSyncStatus';
14
- import translations from '../../translations';
15
-
16
- const DefaultStory = () => {
17
- const [spaces, setSpaces] = useState(
18
- new Map<string, boolean>(range(8).map((i) => [`space-${i + 1}`, Math.random() > 0.5])),
19
- );
20
-
21
- useEffect(() => {
22
- const t = setInterval(
23
- () => {
24
- setSpaces((spaces) => {
25
- const space = Array.from(spaces.keys())[Math.floor(Math.random() * spaces.size)];
26
- spaces.set(space, !spaces.get(space));
27
- return new Map(spaces);
28
- });
29
- },
30
- 2_000 + Math.random() * 3_000,
31
- );
32
- return () => clearInterval(t);
33
- });
34
-
35
- return (
36
- <div className='flex flex-col p-2 w-[200px]'>
37
- {Array.from(spaces.entries()).map(([space, sync]) => (
38
- <div key={space} className='flex items-center'>
39
- <div className='grow'>{space}</div>
40
- {sync && <InlineSyncStatusIndicator />}
41
- </div>
42
- ))}
43
- </div>
44
- );
45
- };
46
-
47
- const meta: Meta = {
48
- title: 'plugins/plugin-space/InlineSyncStatusIndicator',
49
- component: InlineSyncStatusIndicator,
50
- render: DefaultStory,
51
- decorators: [withTheme, withLayout({ fullscreen: true })],
52
- parameters: { translations },
53
- };
54
-
55
- export default meta;
56
-
57
- export const Default = {};