@dxos/plugin-space 0.6.13-main.548ca8d → 0.6.13-main.ed424a1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-QK5I2EPF.mjs → chunk-47SVNCZM.mjs} +2 -2
- package/dist/lib/browser/{chunk-QK5I2EPF.mjs.map → chunk-47SVNCZM.mjs.map} +1 -1
- package/dist/lib/browser/index.mjs +6 -6
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{chunk-HE2GHO6Z.cjs → chunk-CTYDNFGG.cjs} +5 -5
- package/dist/lib/node/{chunk-HE2GHO6Z.cjs.map → chunk-CTYDNFGG.cjs.map} +1 -1
- package/dist/lib/node/index.cjs +50 -50
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +11 -11
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{chunk-2TR4WD6U.mjs → chunk-PLPMYTLC.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-2TR4WD6U.mjs.map → chunk-PLPMYTLC.mjs.map} +1 -1
- package/dist/lib/node-esm/index.mjs +6 -6
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/SpacePlugin.d.ts.map +1 -1
- package/dist/types/src/components/FallbackSettings.d.ts +1 -1
- package/dist/types/src/components/MenuFooter.d.ts +1 -1
- package/dist/types/src/components/MenuFooter.d.ts.map +1 -1
- package/dist/types/src/types/thread.d.ts +1 -1
- package/dist/types/src/types/thread.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +2 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +33 -33
- package/src/SpacePlugin.tsx +5 -4
- package/src/components/FallbackSettings.tsx +1 -1
- package/src/components/MenuFooter.tsx +1 -2
- package/src/types/thread.ts +1 -1
- package/src/util.tsx +5 -5
|
@@ -59,7 +59,7 @@ var MessageType = class extends TypedObject2({
|
|
|
59
59
|
sender: ActorSchema,
|
|
60
60
|
/** Text content of the message. */
|
|
61
61
|
text: S2.String,
|
|
62
|
-
/** Non-text content sent with a message (e.g
|
|
62
|
+
/** Non-text content sent with a message (e.g., files, polls, etc.) */
|
|
63
63
|
parts: S2.optional(S2.mutable(S2.Array(ref2(Expando2)))),
|
|
64
64
|
/** Custom properties for specific message types (e.g. email subject or cc fields). */
|
|
65
65
|
properties: S2.optional(S2.mutable(S2.Record({
|
|
@@ -111,4 +111,4 @@ export {
|
|
|
111
111
|
SPACE_DIRECTORY_HANDLE,
|
|
112
112
|
parseSpaceInitPlugin
|
|
113
113
|
};
|
|
114
|
-
//# sourceMappingURL=chunk-
|
|
114
|
+
//# sourceMappingURL=chunk-47SVNCZM.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
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\nexport class CollectionType extends TypedObject({ typename: 'dxos.org/type/Collection', version: '0.1.0' })({\n name: S.optional(S.String),\n objects: S.mutable(S.Array(ref(Expando))),\n // Key is schema typename and value is reference to a view object of the associated schema.\n // Having collection reference the views rather than vice versa ensures that the state converges to a single view per key (i.e. type).\n // This also leaves open a future where this key could be changed to allow for multiple stack views per section.\n // TODO(wittjosiah): Any way to make this more type safe?\n // TODO(wittjosiah): Should the views be separate objects or just be schemas for view data in this record?\n views: S.mutable(S.Record({ key: S.String, value: ref(Expando) })),\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(wittjosiah): These types were placed here rather than in @dxos/plugin-thread\n// in order to avoid a circular dependency between threads and other objects that use threads.\n\n// TODO(wittjosiah): Factor out to halo?\nexport class ContactType extends TypedObject({ typename: 'dxos.org/type/Contact', version: '0.1.0' })({\n name: S.optional(S.String),\n identifiers: S.mutable(\n S.Array(\n S.Struct({\n type: S.String,\n value: S.String,\n }),\n ),\n ),\n}) {}\n\nexport const ActorSchema = S.mutable(\n S.Struct({\n contact: S.optional(ref(ContactType)),\n // TODO(wittjosiah): Should the below fields just be the contact schema?\n // i.e. it should either be a reference to an existing contact or an inline contact schema.\n identityKey: S.optional(S.String),\n // TODO(burdon): Generalize to handle/identifier?\n email: S.optional(S.String),\n name: S.optional(S.String),\n }),\n);\n\nexport type ActorType = S.Schema.Type<typeof ActorSchema>;\n\nexport enum MessageState {\n NONE = 0,\n ARCHIVED = 1,\n DELETED = 2,\n SPAM = 3,\n}\n\nexport class MessageType extends TypedObject({ typename: 'dxos.org/type/Message', version: '0.1.0' })({\n /** ISO date string when the message was sent. */\n timestamp: S.String,\n /** Message state. */\n state: S.optional(S.Enums(MessageState)),\n /** Identity of the message sender. */\n sender: ActorSchema,\n /** Text content of the message. */\n text: S.String,\n /** Non-text content sent with a message (e.g., files, polls, etc.) */\n parts: S.optional(S.mutable(S.Array(ref(Expando)))),\n /** Custom properties for specific message types (e.g. email subject or cc fields). */\n properties: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),\n // TODO(wittjosiah): Add read status:\n // - Read receipts need to be per space member.\n // - Read receipts don't need to be added to schema until they being implemented.\n /** Context of the application when message was created. */\n // TODO(burdon): Evolve \"attention object\" to be current UX state? E.g., of Deck?\n context: S.optional(ref(Expando)),\n}) {}\n\nexport const ThreadStatus = S.Union(S.Literal('staged'), S.Literal('active'), S.Literal('resolved'));\n\nexport class ThreadType extends TypedObject({ typename: 'dxos.org/type/Thread', version: '0.1.0' })({\n name: S.optional(S.String),\n /** AM cursor-range: 'from:to'. */\n anchor: S.optional(S.String),\n status: S.optional(ThreadStatus),\n messages: S.mutable(S.Array(ref(MessageType))),\n}) {}\n\nexport class ChannelType extends TypedObject({ typename: 'dxos.org/type/Channel', version: '0.1.0' })({\n name: S.optional(S.String),\n threads: S.mutable(S.Array(ref(ThreadType))),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n GraphSerializerProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SettingsProvides,\n SurfaceProvides,\n TranslationsProvides,\n Plugin,\n} from '@dxos/app-framework';\nimport { type Expando } from '@dxos/echo-schema';\nimport { type SchemaProvides } from '@dxos/plugin-client';\nimport { type PublicKey } from '@dxos/react-client';\nimport { type Label } from '@dxos/react-ui';\nimport { type ComplexMap } from '@dxos/util';\n\nexport const SPACE_DIRECTORY_HANDLE = 'dxos.org/plugin/space/directory';\n\nexport type ObjectViewerProps = {\n lastSeen: number;\n currentlyAttended: boolean;\n};\n\nexport type ObjectId = string;\n\nexport type PluginState = {\n /**\n * Which objects are currently being viewed by which peers.\n */\n viewersByObject: Record<ObjectId, ComplexMap<PublicKey, ObjectViewerProps>>;\n\n /**\n * Which peers are currently viewing which objects.\n */\n viewersByIdentity: ComplexMap<PublicKey, Set<ObjectId>>;\n\n /**\n * Object that was linked to directly but not found and is being awaited.\n */\n awaiting: string | undefined;\n\n /**\n * Cached space names, used when spaces are closed or loading.\n */\n spaceNames: Record<string, string>;\n\n /**\n * Which spaces have an SDK migration running currently.\n */\n // TODO(wittjosiah): Factor out to sdk. Migration running should probably be a space state.\n sdkMigrationRunning: Record<string, boolean>;\n};\n\nexport type SpaceSettingsProps = {\n /**\n * Show closed spaces.\n */\n showHidden?: boolean;\n\n /**\n * Action to perform when a space is created.\n */\n onSpaceCreate?: string;\n};\n\nexport type SpaceInitProvides = {\n space: {\n onSpaceCreate: {\n label: Label;\n action: string;\n };\n };\n};\n\nexport const parseSpaceInitPlugin = (plugin: Plugin) =>\n typeof (plugin.provides as any).space?.onSpaceCreate === 'object' ? (plugin as Plugin<SpaceInitProvides>) : undefined;\n\nexport type SpacePluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n GraphSerializerProvides &\n MetadataRecordsProvides &\n SettingsProvides<SpaceSettingsProps> &\n TranslationsProvides &\n SchemaProvides & {\n space: Readonly<PluginState>;\n };\n\n// TODO(wittjosiah): Reconcile with graph export serializers.\n\nexport type SerializerMap = Record<string, TypedObjectSerializer>;\n\nexport interface TypedObjectSerializer<T extends Expando = Expando> {\n serialize(params: { object: T }): Promise<string>;\n\n /**\n * @param params.content\n * @param params.newId Generate new ID for deserialized object.\n */\n deserialize(params: { content: string; newId?: boolean }): Promise<T>;\n}\n"],
|
|
5
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;A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A,CAAAA;AAClC,CAAA,EAAA;AAAI;AAEG,IAAMoB,cAAN,cAA0BvC,aAAY;EAAEC,UAAU;EAAyBC,SAAS;AAAQ,CAAA,EAAG;EACpGC,MAAMC,GAAEC,SAASD,GAAEE,MAAM;EACzBkC,SAASpC,GAAEI,QAAQJ,GAAEK,MAAMM,KAAIoB,UAAAA,CAAAA,CAAAA;AACjC,CAAA,EAAA;AAAI;;;ACzDG,IAAMM,yBAAyB;AA0D/B,IAAMC,uBAAuB,CAACC,WACnC,OAAQA,OAAOC,SAAiBC,OAAOC,kBAAkB,WAAYH,SAAuCI;",
|
|
6
6
|
"names": ["Expando", "ref", "S", "TypedObject", "CollectionType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "objects", "mutable", "Array", "ref", "Expando", "views", "Record", "key", "value", "Expando", "ref", "S", "TypedObject", "ContactType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "identifiers", "mutable", "Array", "Struct", "type", "value", "ActorSchema", "contact", "ref", "identityKey", "email", "MessageState", "MessageType", "timestamp", "state", "Enums", "sender", "text", "parts", "Expando", "properties", "Record", "key", "Any", "context", "ThreadStatus", "Union", "Literal", "ThreadType", "anchor", "status", "messages", "ChannelType", "threads", "SPACE_DIRECTORY_HANDLE", "parseSpaceInitPlugin", "plugin", "provides", "space", "onSpaceCreate", "undefined"]
|
|
7
7
|
}
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
ThreadStatus,
|
|
16
16
|
ThreadType,
|
|
17
17
|
parseSpaceInitPlugin
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-47SVNCZM.mjs";
|
|
19
19
|
|
|
20
20
|
// packages/plugins/plugin-space/src/SpacePlugin.tsx
|
|
21
21
|
import { signal } from "@preact/signals-core";
|
|
@@ -189,11 +189,11 @@ import { DropdownMenu, toLocalizedString, useTranslation as useTranslation5 } fr
|
|
|
189
189
|
|
|
190
190
|
// packages/plugins/plugin-space/src/util.tsx
|
|
191
191
|
import { NavigationAction as NavigationAction2 } from "@dxos/app-framework";
|
|
192
|
-
import { create, isReactiveObject, getTypename, getSchema,
|
|
192
|
+
import { create, isReactiveObject, getTypename, getSchema, getObjectAnnotation, EXPANDO_TYPENAME } from "@dxos/echo-schema";
|
|
193
193
|
import { invariant } from "@dxos/invariant";
|
|
194
194
|
import { Migrations } from "@dxos/migrations";
|
|
195
195
|
import { ACTION_TYPE, ACTION_GROUP_TYPE, actionGroupSymbol, getGraph, cleanup, memoize } from "@dxos/plugin-graph";
|
|
196
|
-
import {
|
|
196
|
+
import { fullyQualifiedId as fullyQualifiedId2, getSpace, isEchoObject, isSpace, SpaceState } from "@dxos/react-client/echo";
|
|
197
197
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-space/src/util.tsx";
|
|
198
198
|
var SPACES = `${SPACE_PLUGIN}-spaces`;
|
|
199
199
|
var SPACE_TYPE = "dxos.org/type/Space";
|
|
@@ -720,7 +720,7 @@ var getNestedObjects = async (object, resolve) => {
|
|
|
720
720
|
};
|
|
721
721
|
var cloneObject = async (object, resolve) => {
|
|
722
722
|
const schema = getSchema(object);
|
|
723
|
-
const typename = schema ?
|
|
723
|
+
const typename = schema ? getObjectAnnotation(schema)?.typename ?? EXPANDO_TYPENAME : EXPANDO_TYPENAME;
|
|
724
724
|
const metadata = resolve(typename);
|
|
725
725
|
const serializer = metadata.serializer;
|
|
726
726
|
invariant(serializer, `No serializer for type: ${typename}`, {
|
|
@@ -1862,7 +1862,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
1862
1862
|
err: err.message
|
|
1863
1863
|
}, {
|
|
1864
1864
|
F: __dxlog_file5,
|
|
1865
|
-
L:
|
|
1865
|
+
L: 229,
|
|
1866
1866
|
S: void 0,
|
|
1867
1867
|
C: (f, a) => f(...a)
|
|
1868
1868
|
});
|
|
@@ -2148,7 +2148,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2148
2148
|
} else {
|
|
2149
2149
|
log2.warn("spaces order object not found", void 0, {
|
|
2150
2150
|
F: __dxlog_file5,
|
|
2151
|
-
L:
|
|
2151
|
+
L: 526,
|
|
2152
2152
|
S: void 0,
|
|
2153
2153
|
C: (f, a) => f(...a)
|
|
2154
2154
|
});
|