@dxos/plugin-space 0.6.12-main.78ddbdf → 0.6.12-main.7907542
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-WBMH5WIP.mjs → chunk-NMD7OZMX.mjs} +9 -3
- package/dist/lib/browser/chunk-NMD7OZMX.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +5 -4
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{chunk-GF3SRAQM.cjs → chunk-K7CSJ7HL.cjs} +12 -6
- package/dist/lib/node/chunk-K7CSJ7HL.cjs.map +7 -0
- package/dist/lib/node/index.cjs +50 -49
- package/dist/lib/node/index.cjs.map +2 -2
- 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-N5VC55UM.mjs → chunk-P73EVC4A.mjs} +9 -3
- package/dist/lib/node-esm/chunk-P73EVC4A.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +5 -4
- package/dist/lib/node-esm/index.mjs.map +2 -2
- 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/package.json +34 -34
- package/src/SpacePlugin.tsx +5 -1
- package/src/components/SpacePresence.tsx +1 -1
- package/src/types/collection.ts +1 -1
- package/src/types/thread.ts +1 -1
- package/dist/lib/browser/chunk-WBMH5WIP.mjs.map +0 -7
- package/dist/lib/node/chunk-GF3SRAQM.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-N5VC55UM.mjs.map +0 -7
|
@@ -11,7 +11,10 @@ var CollectionType = class extends TypedObject({
|
|
|
11
11
|
// This also leaves open a future where this key could be changed to allow for multiple stack views per section.
|
|
12
12
|
// TODO(wittjosiah): Any way to make this more type safe?
|
|
13
13
|
// TODO(wittjosiah): Should the views be separate objects or just be schemas for view data in this record?
|
|
14
|
-
views: S.mutable(S.Record(
|
|
14
|
+
views: S.mutable(S.Record({
|
|
15
|
+
key: S.String,
|
|
16
|
+
value: ref(Expando)
|
|
17
|
+
}))
|
|
15
18
|
}) {
|
|
16
19
|
};
|
|
17
20
|
|
|
@@ -59,7 +62,10 @@ var MessageType = class extends TypedObject2({
|
|
|
59
62
|
/** Non-text content sent with a message (e.g. files, polls, etc.) */
|
|
60
63
|
parts: S2.optional(S2.mutable(S2.Array(ref2(Expando2)))),
|
|
61
64
|
/** Custom properties for specific message types (e.g. email subject or cc fields). */
|
|
62
|
-
properties: S2.optional(S2.mutable(S2.Record(
|
|
65
|
+
properties: S2.optional(S2.mutable(S2.Record({
|
|
66
|
+
key: S2.String,
|
|
67
|
+
value: S2.Any
|
|
68
|
+
}))),
|
|
63
69
|
// TODO(wittjosiah): Add read status:
|
|
64
70
|
// - Read receipts need to be per space member.
|
|
65
71
|
// - Read receipts don't need to be added to schema until they being implemented.
|
|
@@ -104,4 +110,4 @@ export {
|
|
|
104
110
|
SPACE_DIRECTORY_HANDLE,
|
|
105
111
|
parseSpaceInitPlugin
|
|
106
112
|
};
|
|
107
|
-
//# sourceMappingURL=chunk-
|
|
113
|
+
//# sourceMappingURL=chunk-NMD7OZMX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 anchor: S.optional(S.String),\n status: S.optional(ThreadStatus),\n messages: S.mutable(S.Array(ref(MessageType))),\n}) {}\n\nexport class ChannelType extends TypedObject({ typename: 'dxos.org/type/Channel', version: '0.1.0' })({\n name: S.optional(S.String),\n threads: S.mutable(S.Array(ref(ThreadType))),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n GraphSerializerProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SettingsProvides,\n SurfaceProvides,\n TranslationsProvides,\n Plugin,\n} from '@dxos/app-framework';\nimport { type Expando } from '@dxos/echo-schema';\nimport { type SchemaProvides } from '@dxos/plugin-client';\nimport { type PublicKey } from '@dxos/react-client';\nimport { type Label } from '@dxos/react-ui';\nimport { type ComplexMap } from '@dxos/util';\n\nexport const SPACE_DIRECTORY_HANDLE = 'dxos.org/plugin/space/directory';\n\nexport type ObjectViewerProps = {\n lastSeen: number;\n currentlyAttended: boolean;\n};\n\nexport type ObjectId = string;\n\nexport type PluginState = {\n /**\n * Which objects are currently being viewed by which peers.\n */\n viewersByObject: Record<ObjectId, ComplexMap<PublicKey, ObjectViewerProps>>;\n\n /**\n * Which peers are currently viewing which objects.\n */\n viewersByIdentity: ComplexMap<PublicKey, Set<ObjectId>>;\n\n /**\n * Object that was linked to directly but not found and is being awaited.\n */\n awaiting: string | undefined;\n\n /**\n * Cached space names, used when spaces are closed or loading.\n */\n spaceNames: Record<string, string>;\n\n /**\n * Which spaces have an SDK migration running currently.\n */\n // TODO(wittjosiah): Factor out to sdk. Migration running should probably be a space state.\n sdkMigrationRunning: Record<string, boolean>;\n};\n\nexport type SpaceSettingsProps = {\n /**\n * Show closed spaces.\n */\n showHidden?: boolean;\n\n /**\n * Action to perform when a space is created.\n */\n onSpaceCreate?: string;\n};\n\nexport type SpaceInitProvides = {\n space: {\n onSpaceCreate: {\n label: Label;\n action: string;\n };\n };\n};\n\nexport const parseSpaceInitPlugin = (plugin: Plugin) =>\n typeof (plugin.provides as any).space?.onSpaceCreate === 'object' ? (plugin as Plugin<SpaceInitProvides>) : undefined;\n\nexport type SpacePluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n GraphSerializerProvides &\n MetadataRecordsProvides &\n SettingsProvides<SpaceSettingsProps> &\n TranslationsProvides &\n SchemaProvides & {\n space: Readonly<PluginState>;\n };\n\n// TODO(wittjosiah): Reconcile with graph export serializers.\n\nexport type SerializerMap = Record<string, TypedObjectSerializer>;\n\nexport interface TypedObjectSerializer<T extends Expando = Expando> {\n serialize(params: { object: T }): Promise<string>;\n\n /**\n * @param params.content\n * @param params.newId Generate new ID for deserialized object.\n */\n deserialize(params: { content: string; newId?: boolean }): Promise<T>;\n}\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,SAASC,KAAKC,GAAGC,mBAAmB;AAEtC,IAAMC,iBAAN,cAA6BC,YAAY;EAAEC,UAAU;EAA4BC,SAAS;AAAQ,CAAA,EAAG;EAC1GC,MAAMC,EAAEC,SAASD,EAAEE,MAAM;EACzBC,SAASH,EAAEI,QAAQJ,EAAEK,MAAMC,IAAIC,OAAAA,CAAAA,CAAAA;;;;;;EAM/BC,OAAOR,EAAEI,QAAQJ,EAAES,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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MC,GAAEC,SAASD,GAAEE,MAAM;EACzB8B,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;;;ACxDG,IAAMM,yBAAyB;AA0D/B,IAAMC,uBAAuB,CAACC,WACnC,OAAQA,OAAOC,SAAiBC,OAAOC,kBAAkB,WAAYH,SAAuCI;",
|
|
6
|
+
"names": ["Expando", "ref", "S", "TypedObject", "CollectionType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "objects", "mutable", "Array", "ref", "Expando", "views", "Record", "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
|
+
}
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
ThreadStatus,
|
|
16
16
|
ThreadType,
|
|
17
17
|
parseSpaceInitPlugin
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NMD7OZMX.mjs";
|
|
19
19
|
|
|
20
20
|
// packages/plugins/plugin-space/src/SpacePlugin.tsx
|
|
21
21
|
import { effect, signal } from "@preact/signals-core";
|
|
@@ -1272,7 +1272,7 @@ var SpacePresence = ({ object, spaceKey }) => {
|
|
|
1272
1272
|
};
|
|
1273
1273
|
var FullPresence = (props) => {
|
|
1274
1274
|
const { size = 9, onMemberClick } = props;
|
|
1275
|
-
const members = useDefaultValue(props.members, []);
|
|
1275
|
+
const members = useDefaultValue(props.members, () => []);
|
|
1276
1276
|
if (members.length === 0) {
|
|
1277
1277
|
return null;
|
|
1278
1278
|
}
|
|
@@ -2005,7 +2005,8 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2005
2005
|
case "main":
|
|
2006
2006
|
return isSpace2(primary) && primary.state.get() === SpaceState3.SPACE_READY ? /* @__PURE__ */ React18.createElement(Surface2, {
|
|
2007
2007
|
data: {
|
|
2008
|
-
active: primary.properties[CollectionType.typename]
|
|
2008
|
+
active: primary.properties[CollectionType.typename],
|
|
2009
|
+
id: primary.id
|
|
2009
2010
|
},
|
|
2010
2011
|
role,
|
|
2011
2012
|
...rest
|
|
@@ -2152,7 +2153,7 @@ var SpacePlugin = ({ firstRun, onFirstRun } = {}) => {
|
|
|
2152
2153
|
} else {
|
|
2153
2154
|
log2.warn("spaces order object not found", void 0, {
|
|
2154
2155
|
F: __dxlog_file5,
|
|
2155
|
-
L:
|
|
2156
|
+
L: 528,
|
|
2156
2157
|
S: void 0,
|
|
2157
2158
|
C: (f, a) => f(...a)
|
|
2158
2159
|
});
|