@dxos/plugin-thread 0.8.4-main.2c6827d → 0.8.4-main.3c1ae3b
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/{ChannelContainer-JI3ZRZ5S.mjs → ChannelContainer-3BKLNZ4D.mjs} +4 -4
- package/dist/lib/browser/{ChatContainer-6FVFME3R.mjs → ChatContainer-KPY4BAUE.mjs} +2 -2
- package/dist/lib/browser/{app-graph-builder-URVQHGMR.mjs → app-graph-builder-TWJ2UCOZ.mjs} +2 -2
- package/dist/lib/browser/{blueprint-definition-TQ4JFMZZ.mjs → blueprint-definition-UO43FHAE.mjs} +6 -5
- package/dist/lib/browser/blueprint-definition-UO43FHAE.mjs.map +7 -0
- package/dist/lib/browser/chunk-6E6VNV6V.mjs +25 -0
- package/dist/lib/browser/{chunk-CBUNHCOE.mjs.map → chunk-6E6VNV6V.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-F36NHPJG.mjs → chunk-ALZKJOZK.mjs} +2 -2
- package/dist/lib/browser/{chunk-R5UOPOO7.mjs → chunk-JDJPMI7V.mjs} +10 -9
- package/dist/lib/browser/chunk-JDJPMI7V.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VIRD2QSK.mjs → chunk-SS3O5SOQ.mjs} +7 -7
- package/dist/lib/browser/{chunk-VIRD2QSK.mjs.map → chunk-SS3O5SOQ.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-6LWKNZUV.mjs → chunk-TLOOZTRD.mjs} +1 -1
- package/dist/lib/browser/chunk-TLOOZTRD.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +19 -21
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-YR6W4CRP.mjs → intent-resolver-G33FT3NO.mjs} +15 -11
- package/dist/lib/browser/intent-resolver-G33FT3NO.mjs.map +7 -0
- package/dist/lib/browser/{markdown-GSOBOXA7.mjs → markdown-GSTZY2JL.mjs} +9 -8
- package/dist/lib/browser/markdown-GSTZY2JL.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-RAWRPF7Z.mjs → react-root-GRZVEGGE.mjs} +6 -6
- package/dist/lib/browser/{react-surface-GOEFSXQ6.mjs → react-surface-C2OIZGFN.mjs} +6 -6
- package/dist/lib/browser/repair-JFJLEM2O.mjs +35 -0
- package/dist/lib/browser/repair-JFJLEM2O.mjs.map +7 -0
- package/dist/lib/browser/{settings-JN2HHORY.mjs → settings-E6IOLK46.mjs} +2 -2
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/{ChannelContainer-RQY4PR4F.mjs → ChannelContainer-I4U4TEEY.mjs} +4 -4
- package/dist/lib/node-esm/{ChatContainer-KWNON7EN.mjs → ChatContainer-TLQG23K7.mjs} +2 -2
- package/dist/lib/node-esm/{app-graph-builder-2IH5RPR7.mjs → app-graph-builder-VD6I2V5H.mjs} +2 -2
- package/dist/lib/node-esm/{blueprint-definition-TSX5HHW7.mjs → blueprint-definition-WANHWSF5.mjs} +6 -5
- package/dist/lib/node-esm/blueprint-definition-WANHWSF5.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-Y3F2SGNH.mjs → chunk-AB42KYF3.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-Z4GUSLWL.mjs → chunk-E5HNHFYH.mjs} +1 -1
- package/dist/lib/{browser/chunk-6LWKNZUV.mjs.map → node-esm/chunk-E5HNHFYH.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-MEIWWPR2.mjs → chunk-P2M364TO.mjs} +10 -9
- package/dist/lib/node-esm/chunk-P2M364TO.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-QFCIKJOD.mjs → chunk-RDD44HYY.mjs} +7 -7
- package/dist/lib/node-esm/{chunk-QFCIKJOD.mjs.map → chunk-RDD44HYY.mjs.map} +3 -3
- package/dist/lib/node-esm/chunk-UPA2Q5YI.mjs +27 -0
- package/dist/lib/node-esm/{chunk-I3O6NXMN.mjs.map → chunk-UPA2Q5YI.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +19 -21
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-SJFABEE7.mjs → intent-resolver-4PX3WXQG.mjs} +15 -11
- package/dist/lib/node-esm/intent-resolver-4PX3WXQG.mjs.map +7 -0
- package/dist/lib/node-esm/{markdown-GG5566TL.mjs → markdown-MC5OP2UR.mjs} +9 -8
- package/dist/lib/node-esm/markdown-MC5OP2UR.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-K5OGECUS.mjs → react-root-5IYK7CTL.mjs} +6 -6
- package/dist/lib/node-esm/{react-surface-5QDQD7MN.mjs → react-surface-GWBXMENS.mjs} +6 -6
- package/dist/lib/node-esm/repair-RMLR24YR.mjs +36 -0
- package/dist/lib/node-esm/repair-RMLR24YR.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-VSPM3BIM.mjs → settings-RGZHWDSO.mjs} +2 -2
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/repair.d.ts +4 -0
- package/dist/types/src/capabilities/repair.d.ts.map +1 -0
- package/dist/types/src/components/ChannelContainer.stories.d.ts +4 -0
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chat.stories.d.ts +4 -0
- package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/components/Comments.stories.d.ts +4 -0
- package/dist/types/src/components/Comments.stories.d.ts.map +1 -1
- package/dist/types/src/components/MessageContainer.d.ts +3 -1
- package/dist/types/src/components/MessageContainer.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +4 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +4 -0
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts.map +1 -1
- package/dist/types/src/functions/create-proposals.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +4 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Channel.d.ts +3 -3
- package/dist/types/src/types/Channel.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +114 -141
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +47 -47
- package/src/ThreadPlugin.tsx +14 -20
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +9 -6
- package/src/capabilities/repair.ts +40 -0
- package/src/components/MessageContainer.tsx +6 -4
- package/src/components/ThreadCompanion.tsx +1 -1
- package/src/extensions/threads.ts +7 -6
- package/src/functions/create-proposals.ts +5 -4
- package/src/translations.ts +2 -0
- package/src/types/Channel.ts +3 -3
- package/src/types/types.ts +4 -3
- package/dist/lib/browser/blueprint-definition-TQ4JFMZZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-CBUNHCOE.mjs +0 -23
- package/dist/lib/browser/chunk-R5UOPOO7.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-YR6W4CRP.mjs.map +0 -7
- package/dist/lib/browser/markdown-GSOBOXA7.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-TSX5HHW7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-I3O6NXMN.mjs +0 -25
- package/dist/lib/node-esm/chunk-MEIWWPR2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Z4GUSLWL.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-SJFABEE7.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-GG5566TL.mjs.map +0 -7
- /package/dist/lib/browser/{ChannelContainer-JI3ZRZ5S.mjs.map → ChannelContainer-3BKLNZ4D.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-6FVFME3R.mjs.map → ChatContainer-KPY4BAUE.mjs.map} +0 -0
- /package/dist/lib/browser/{app-graph-builder-URVQHGMR.mjs.map → app-graph-builder-TWJ2UCOZ.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-F36NHPJG.mjs.map → chunk-ALZKJOZK.mjs.map} +0 -0
- /package/dist/lib/browser/{react-root-RAWRPF7Z.mjs.map → react-root-GRZVEGGE.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-GOEFSXQ6.mjs.map → react-surface-C2OIZGFN.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-JN2HHORY.mjs.map → settings-E6IOLK46.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChannelContainer-RQY4PR4F.mjs.map → ChannelContainer-I4U4TEEY.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-KWNON7EN.mjs.map → ChatContainer-TLQG23K7.mjs.map} +0 -0
- /package/dist/lib/node-esm/{app-graph-builder-2IH5RPR7.mjs.map → app-graph-builder-VD6I2V5H.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-Y3F2SGNH.mjs.map → chunk-AB42KYF3.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-K5OGECUS.mjs.map → react-root-5IYK7CTL.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-5QDQD7MN.mjs.map → react-surface-GWBXMENS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-VSPM3BIM.mjs.map → settings-RGZHWDSO.mjs.map} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-SS3O5SOQ.mjs";
|
|
2
2
|
import {
|
|
3
3
|
Call
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ALZKJOZK.mjs";
|
|
5
|
+
import "./chunk-6E6VNV6V.mjs";
|
|
6
|
+
import "./chunk-JDJPMI7V.mjs";
|
|
7
7
|
import "./chunk-CFC7LEPD.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-TLOOZTRD.mjs";
|
|
9
9
|
import "./chunk-KOBXMDCI.mjs";
|
|
10
10
|
import "./chunk-CP7E2HRE.mjs";
|
|
11
11
|
import "./chunk-ISCHODBV.mjs";
|
|
@@ -26,4 +26,4 @@ var react_root_default = (() => {
|
|
|
26
26
|
export {
|
|
27
27
|
react_root_default as default
|
|
28
28
|
};
|
|
29
|
-
//# sourceMappingURL=react-root-
|
|
29
|
+
//# sourceMappingURL=react-root-GRZVEGGE.mjs.map
|
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
ChatContainer,
|
|
6
6
|
ThreadCompanion,
|
|
7
7
|
ThreadSettings
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-SS3O5SOQ.mjs";
|
|
9
|
+
import "./chunk-ALZKJOZK.mjs";
|
|
10
|
+
import "./chunk-6E6VNV6V.mjs";
|
|
11
11
|
import {
|
|
12
12
|
Channel_exports
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JDJPMI7V.mjs";
|
|
14
14
|
import {
|
|
15
15
|
ThreadCapabilities
|
|
16
16
|
} from "./chunk-CFC7LEPD.mjs";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-TLOOZTRD.mjs";
|
|
18
18
|
import "./chunk-KOBXMDCI.mjs";
|
|
19
19
|
import "./chunk-CP7E2HRE.mjs";
|
|
20
20
|
import "./chunk-ISCHODBV.mjs";
|
|
@@ -108,4 +108,4 @@ var react_surface_default = (() => contributes(Capabilities.ReactSurface, [
|
|
|
108
108
|
export {
|
|
109
109
|
react_surface_default as default
|
|
110
110
|
};
|
|
111
|
-
//# sourceMappingURL=react-surface-
|
|
111
|
+
//# sourceMappingURL=react-surface-C2OIZGFN.mjs.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Channel_exports
|
|
3
|
+
} from "./chunk-JDJPMI7V.mjs";
|
|
4
|
+
import "./chunk-QM34EZQK.mjs";
|
|
5
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
6
|
+
|
|
7
|
+
// src/capabilities/repair.ts
|
|
8
|
+
import { contributes } from "@dxos/app-framework";
|
|
9
|
+
import { Obj, Ref, Type } from "@dxos/echo";
|
|
10
|
+
import { SpaceCapabilities } from "@dxos/plugin-space";
|
|
11
|
+
import { Collection } from "@dxos/schema";
|
|
12
|
+
var repair_default = (() => contributes(SpaceCapabilities.Repair, async ({ space, isDefault }) => {
|
|
13
|
+
if (isDefault) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
await ensureSystemCollection(space);
|
|
17
|
+
}));
|
|
18
|
+
var ensureSystemCollection = async (space) => {
|
|
19
|
+
const rootCollection = await space.properties[Collection.Collection.typename]?.load();
|
|
20
|
+
if (!rootCollection) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const objects = await Promise.all(rootCollection.objects.map((ref) => ref.load()));
|
|
24
|
+
const channels = objects.find((object) => Obj.instanceOf(Collection.Managed, object) && object.key === Type.getTypename(Channel_exports.Channel));
|
|
25
|
+
if (channels) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
rootCollection.objects.push(Ref.make(Collection.makeManaged({
|
|
29
|
+
key: Type.getTypename(Channel_exports.Channel)
|
|
30
|
+
})));
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
repair_default as default
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=repair-JFJLEM2O.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/repair.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes } from '@dxos/app-framework';\nimport { Obj, Ref, Type } from '@dxos/echo';\nimport { SpaceCapabilities } from '@dxos/plugin-space';\nimport { type Space } from '@dxos/react-client/echo';\nimport { Collection } from '@dxos/schema';\n\nimport { Channel } from '../types';\n\nexport default () =>\n contributes(SpaceCapabilities.Repair, async ({ space, isDefault }) => {\n if (isDefault) {\n return;\n }\n\n await ensureSystemCollection(space);\n });\n\n/**\n * Ensure the root collection has a system collection for Channels.\n */\nconst ensureSystemCollection = async (space: Space) => {\n const rootCollection: Collection.Collection = await space.properties[Collection.Collection.typename]?.load();\n if (!rootCollection) {\n return;\n }\n\n const objects = await Promise.all(rootCollection.objects.map((ref) => ref.load()));\n const channels = objects.find(\n (object) => Obj.instanceOf(Collection.Managed, object) && object.key === Type.getTypename(Channel.Channel),\n );\n if (channels) {\n return;\n }\n\n rootCollection.objects.push(Ref.make(Collection.makeManaged({ key: Type.getTypename(Channel.Channel) })));\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,SAASA,mBAAmB;AAC5B,SAASC,KAAKC,KAAKC,YAAY;AAC/B,SAASC,yBAAyB;AAElC,SAASC,kBAAkB;AAI3B,IAAA,kBAAe,MACbC,YAAYC,kBAAkBC,QAAQ,OAAO,EAAEC,OAAOC,UAAS,MAAE;AAC/D,MAAIA,WAAW;AACb;EACF;AAEA,QAAMC,uBAAuBF,KAAAA;AAC/B,CAAA;AAKF,IAAME,yBAAyB,OAAOF,UAAAA;AACpC,QAAMG,iBAAwC,MAAMH,MAAMI,WAAWC,WAAWA,WAAWC,QAAQ,GAAGC,KAAAA;AACtG,MAAI,CAACJ,gBAAgB;AACnB;EACF;AAEA,QAAMK,UAAU,MAAMC,QAAQC,IAAIP,eAAeK,QAAQG,IAAI,CAACC,QAAQA,IAAIL,KAAI,CAAA,CAAA;AAC9E,QAAMM,WAAWL,QAAQM,KACvB,CAACC,WAAWC,IAAIC,WAAWZ,WAAWa,SAASH,MAAAA,KAAWA,OAAOI,QAAQC,KAAKC,YAAYC,gBAAQA,OAAO,CAAA;AAE3G,MAAIT,UAAU;AACZ;EACF;AAEAV,iBAAeK,QAAQe,KAAKC,IAAIC,KAAKpB,WAAWqB,YAAY;IAAEP,KAAKC,KAAKC,YAAYC,gBAAQA,OAAO;EAAE,CAAA,CAAA,CAAA;AACvG;",
|
|
6
|
+
"names": ["contributes", "Obj", "Ref", "Type", "SpaceCapabilities", "Collection", "contributes", "SpaceCapabilities", "Repair", "space", "isDefault", "ensureSystemCollection", "rootCollection", "properties", "Collection", "typename", "load", "objects", "Promise", "all", "map", "ref", "channels", "find", "object", "Obj", "instanceOf", "Managed", "key", "Type", "getTypename", "Channel", "push", "Ref", "make", "makeManaged"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ThreadSettingsSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JDJPMI7V.mjs";
|
|
4
4
|
import {
|
|
5
5
|
meta
|
|
6
6
|
} from "./chunk-QM34EZQK.mjs";
|
|
@@ -20,4 +20,4 @@ var settings_default = (() => {
|
|
|
20
20
|
export {
|
|
21
21
|
settings_default as default
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=settings-
|
|
23
|
+
//# sourceMappingURL=settings-E6IOLK46.mjs.map
|
|
@@ -2,10 +2,10 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
ChannelContainer,
|
|
4
4
|
ChannelContainer_default
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-AB42KYF3.mjs";
|
|
6
|
+
import "./chunk-UPA2Q5YI.mjs";
|
|
7
7
|
import "./chunk-RT6NRL2I.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-E5HNHFYH.mjs";
|
|
9
9
|
import "./chunk-PZH2EDU5.mjs";
|
|
10
10
|
import "./chunk-ABUFOZVX.mjs";
|
|
11
11
|
import "./chunk-VBI32FGI.mjs";
|
|
@@ -15,4 +15,4 @@ export {
|
|
|
15
15
|
ChannelContainer,
|
|
16
16
|
ChannelContainer_default as default
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=ChannelContainer-
|
|
18
|
+
//# sourceMappingURL=ChannelContainer-I4U4TEEY.mjs.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ChatContainer,
|
|
4
4
|
ChatContainer_default,
|
|
5
5
|
ChatHeading
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-E5HNHFYH.mjs";
|
|
7
7
|
import "./chunk-PZH2EDU5.mjs";
|
|
8
8
|
import "./chunk-ABUFOZVX.mjs";
|
|
9
9
|
import "./chunk-VBI32FGI.mjs";
|
|
@@ -14,4 +14,4 @@ export {
|
|
|
14
14
|
ChatHeading,
|
|
15
15
|
ChatContainer_default as default
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=ChatContainer-
|
|
17
|
+
//# sourceMappingURL=ChatContainer-TLQG23K7.mjs.map
|
|
@@ -2,7 +2,7 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
Channel_exports,
|
|
4
4
|
ThreadAction
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-P2M364TO.mjs";
|
|
6
6
|
import {
|
|
7
7
|
ThreadCapabilities
|
|
8
8
|
} from "./chunk-RT6NRL2I.mjs";
|
|
@@ -169,4 +169,4 @@ var app_graph_builder_default = ((context) => {
|
|
|
169
169
|
export {
|
|
170
170
|
app_graph_builder_default as default
|
|
171
171
|
};
|
|
172
|
-
//# sourceMappingURL=app-graph-builder-
|
|
172
|
+
//# sourceMappingURL=app-graph-builder-VD6I2V5H.mjs.map
|
package/dist/lib/node-esm/{blueprint-definition-TSX5HHW7.mjs → blueprint-definition-WANHWSF5.mjs}
RENAMED
|
@@ -13,8 +13,9 @@ import * as Function from "effect/Function";
|
|
|
13
13
|
import * as Schema from "effect/Schema";
|
|
14
14
|
import { ArtifactId, computeDiffsWithCursors } from "@dxos/assistant";
|
|
15
15
|
import { Obj, Ref, Relation } from "@dxos/echo";
|
|
16
|
+
import { Database } from "@dxos/echo";
|
|
16
17
|
import { createDocAccessor } from "@dxos/echo-db";
|
|
17
|
-
import {
|
|
18
|
+
import { defineFunction } from "@dxos/functions";
|
|
18
19
|
import { DXN } from "@dxos/keys";
|
|
19
20
|
import { Markdown } from "@dxos/plugin-markdown/types";
|
|
20
21
|
import { AnchoredTo, Message, Thread } from "@dxos/types";
|
|
@@ -30,7 +31,7 @@ var create_proposals_default = defineFunction({
|
|
|
30
31
|
}),
|
|
31
32
|
outputSchema: Schema.Void,
|
|
32
33
|
handler: Effect.fn(function* ({ data: { id, diffs: _diffs } }) {
|
|
33
|
-
const object = yield*
|
|
34
|
+
const object = yield* Database.Service.resolve(DXN.parse(id), Markdown.Document);
|
|
34
35
|
const content = yield* Effect.promise(() => object.content.load());
|
|
35
36
|
const accessor = createDocAccessor(content, [
|
|
36
37
|
"content"
|
|
@@ -60,8 +61,8 @@ var create_proposals_default = defineFunction({
|
|
|
60
61
|
[Relation.Target]: object,
|
|
61
62
|
anchor: cursor
|
|
62
63
|
});
|
|
63
|
-
yield*
|
|
64
|
-
yield*
|
|
64
|
+
yield* Database.Service.add(thread);
|
|
65
|
+
yield* Database.Service.add(relation);
|
|
65
66
|
})), Effect.allWith({
|
|
66
67
|
concurrency: "unbounded"
|
|
67
68
|
}));
|
|
@@ -99,4 +100,4 @@ export {
|
|
|
99
100
|
ASSISTANT_BLUEPRINT_KEY,
|
|
100
101
|
blueprint_definition_default as default
|
|
101
102
|
};
|
|
102
|
-
//# sourceMappingURL=blueprint-definition-
|
|
103
|
+
//# sourceMappingURL=blueprint-definition-WANHWSF5.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/blueprint-definition.ts", "../../../src/functions/create-proposals.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, type Capability, contributes } from '@dxos/app-framework';\nimport { Blueprint, Template } from '@dxos/blueprints';\nimport { type FunctionDefinition } from '@dxos/functions';\nimport { trim } from '@dxos/util';\n\nimport { createProposals } from '../functions';\n\nconst functions: FunctionDefinition[] = [createProposals];\n\nexport const ASSISTANT_BLUEPRINT_KEY = 'dxos.org/blueprint/thread';\n\nexport default (): Capability<any>[] => [\n contributes(Capabilities.Functions, functions),\n contributes(\n Capabilities.BlueprintDefinition,\n Blueprint.make({\n key: ASSISTANT_BLUEPRINT_KEY,\n name: 'Thread',\n tools: Blueprint.toolDefinitions({ functions }),\n instructions: Template.make({\n // TODO(wittjosiah): Move example to function input schema annotation.\n source: trim`\n You can update markdown documents via proposals.\n For each diff, respond with the smallest possible matching span.\n For example:\n - \"There is a tyop in this sentence.\"\n + \"There is a typo in this sentence.\"\n - \"This id goof.\"\n + \"This is good.\"\n `,\n }),\n }),\n ),\n];\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Array from 'effect/Array';\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\nimport * as Schema from 'effect/Schema';\n\nimport { ArtifactId, computeDiffsWithCursors } from '@dxos/assistant';\nimport { Obj, Ref, Relation } from '@dxos/echo';\nimport { Database } from '@dxos/echo';\nimport { createDocAccessor } from '@dxos/echo-db';\nimport { defineFunction } from '@dxos/functions';\nimport { DXN } from '@dxos/keys';\nimport { Markdown } from '@dxos/plugin-markdown/types';\nimport { AnchoredTo, Message, Thread } from '@dxos/types';\n\nexport default defineFunction({\n key: 'dxos.org/function/thread/create-proposals',\n name: 'Create Proposals',\n description: 'Proposes a set of changes to a document.',\n inputSchema: Schema.Struct({\n id: ArtifactId,\n diffs: Schema.Array(Schema.String).annotations({\n description: 'The diffs to propose for the document.',\n }),\n }),\n outputSchema: Schema.Void,\n handler: Effect.fn(function* ({ data: { id, diffs: _diffs } }) {\n const object = yield* Database.Service.resolve(DXN.parse(id), Markdown.Document);\n const content = yield* Effect.promise(() => object.content.load());\n const accessor = createDocAccessor(content, ['content']);\n\n yield* Function.pipe(\n computeDiffsWithCursors(accessor, _diffs),\n Array.map(\n Effect.fnUntraced(function* ({ cursor, text }) {\n const proposal = Obj.make(Message.Message, {\n created: new Date().toISOString(),\n sender: { role: 'assistant' },\n blocks: [{ _tag: 'proposal', text }],\n });\n const thread = Thread.make({ name: 'Proposal', messages: [Ref.make(proposal)], status: 'active' });\n const relation = Relation.make(AnchoredTo.AnchoredTo, {\n [Relation.Source]: thread,\n [Relation.Target]: object,\n anchor: cursor,\n });\n yield* Database.Service.add(thread);\n yield* Database.Service.add(relation);\n }),\n ),\n Effect.allWith({ concurrency: 'unbounded' }),\n );\n }),\n});\n"],
|
|
5
|
+
"mappings": ";;;;AAIA,SAASA,cAA+BC,mBAAmB;AAC3D,SAASC,WAAWC,gBAAgB;AAEpC,SAASC,YAAY;;;ACHrB,YAAYC,WAAW;AACvB,YAAYC,YAAY;AACxB,YAAYC,cAAc;AAC1B,YAAYC,YAAY;AAExB,SAASC,YAAYC,+BAA+B;AACpD,SAASC,KAAKC,KAAKC,gBAAgB;AACnC,SAASC,gBAAgB;AACzB,SAASC,yBAAyB;AAClC,SAASC,sBAAsB;AAC/B,SAASC,WAAW;AACpB,SAASC,gBAAgB;AACzB,SAASC,YAAYC,SAASC,cAAc;AAE5C,IAAA,2BAAeC,eAAe;EAC5BC,KAAK;EACLC,MAAM;EACNC,aAAa;EACbC,aAAoBC,cAAO;IACzBC,IAAIC;IACJC,OAAcC,aAAaC,aAAM,EAAEC,YAAY;MAC7CR,aAAa;IACf,CAAA;EACF,CAAA;EACAS,cAAqBC;EACrBC,SAAgBC,UAAG,WAAW,EAAEC,M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ASN,KAAK;;MAE1BO,QAAQC;;;;;;;;;IASV,CAAA;EACF,CAAA,CAAA;;",
|
|
6
|
+
"names": ["Capabilities", "contributes", "Blueprint", "Template", "trim", "Array", "Effect", "Function", "Schema", "ArtifactId", "computeDiffsWithCursors", "Obj", "Ref", "Relation", "Database", "createDocAccessor", "defineFunction", "DXN", "Markdown", "AnchoredTo", "Message", "Thread", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "id", "ArtifactId", "diffs", "Array", "String", "annotations", "outputSchema", "Void", "handler", "fn", "data", "_diffs", "object", "Database", "Service", "resolve", "DXN", "parse", "Markdown", "Document", "content", "promise", "load", "accessor", "createDocAccessor", "pipe", "computeDiffsWithCursors", "map", "fnUntraced", "cursor", "text", "proposal", "Obj", "make", "Message", "created", "Date", "toISOString", "sender", "role", "blocks", "_tag", "thread", "Thread", "messages", "Ref", "status", "relation", "Relation", "AnchoredTo", "Source", "Target", "anchor", "add", "allWith", "concurrency", "functions", "createProposals", "ASSISTANT_BLUEPRINT_KEY", "contributes", "Capabilities", "Functions", "BlueprintDefinition", "Blueprint", "make", "key", "name", "tools", "toolDefinitions", "instructions", "Template", "source", "trim"]
|
|
7
|
+
}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-RT6NRL2I.mjs";
|
|
5
5
|
import {
|
|
6
6
|
ChatContainer_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-E5HNHFYH.mjs";
|
|
8
8
|
import {
|
|
9
9
|
useDebugMode
|
|
10
10
|
} from "./chunk-PZH2EDU5.mjs";
|
|
@@ -987,4 +987,4 @@ export {
|
|
|
987
987
|
ChannelContainer,
|
|
988
988
|
ChannelContainer_default
|
|
989
989
|
};
|
|
990
|
-
//# sourceMappingURL=chunk-
|
|
990
|
+
//# sourceMappingURL=chunk-AB42KYF3.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/ChatContainer.tsx", "../../../src/components/command-extension.ts", "../../../src/components/MessageContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport { Obj, Ref } from '@dxos/echo';\nimport { type Space, useMembers } from '@dxos/react-client/echo';\nimport { useIdentity } from '@dxos/react-client/halo';\nimport { Icon, ScrollArea, type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';\nimport { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { mx } from '@dxos/react-ui-theme';\nimport {\n MessageTextbox,\n type MessageTextboxProps,\n Thread as ThreadComponent,\n type ThreadRootProps,\n threadLayout,\n} from '@dxos/react-ui-thread';\nimport { Message, type Thread } from '@dxos/types';\nimport { isNonNullable } from '@dxos/util';\n\nimport { useStatus } from '../hooks';\nimport { meta } from '../meta';\nimport { getMessageMetadata } from '../util';\n\nimport { command } from './command-extension';\nimport { MessageContainer } from './MessageContainer';\n\nexport const ChatHeading = ({ attendableId }: { attendableId?: string }) => {\n const { t } = useTranslation(meta.id);\n return (\n <div role='none' className='flex items-center'>\n <StackItem.SigilButton attendableId={attendableId}>\n <Icon icon='ph--chat--regular' size={5} />\n </StackItem.SigilButton>\n <StackItem.HeadingLabel attendableId={attendableId}>{t('chat heading')}</StackItem.HeadingLabel>\n </div>\n );\n};\n\nexport type ChatContainerProps = ThemedClassName<\n {\n space: Space;\n thread: Thread.Thread;\n context?: Obj.Any;\n autoFocusTextbox?: boolean;\n } & Pick<ThreadRootProps, 'current'>\n>;\n\nexport const ChatContainer = ({\n classNames,\n space,\n thread,\n context,\n current,\n autoFocusTextbox,\n}: ChatContainerProps) => {\n const { t } = useTranslation(meta.id);\n const id = Obj.getDXN(thread).toString();\n const identity = useIdentity()!;\n const members = useMembers(space?.key);\n const activity = useStatus(space, id);\n // TODO(wittjosiah): This is a hack to reset the editor after a message is sent.\n const [_count, _setCount] = useState(0);\n const rerenderEditor = () => _setCount((count) => count + 1);\n const [autoFocus, setAutoFocus] = useState(autoFocusTextbox);\n const threadScrollRef = useRef<HTMLDivElement | null>(null);\n const { themeMode } = useThemeContext();\n\n const textboxMetadata = getMessageMetadata(id, identity);\n const messageRef = useRef('');\n const extensions = useMemo(\n () => [\n createBasicExtensions({ placeholder: t('message placeholder') }),\n createThemeExtensions({ themeMode }),\n listener({ onChange: ({ text }) => (messageRef.current = text) }),\n command,\n ],\n [themeMode, _count],\n );\n\n // TODO(thure): Factor out.\n // TODO(thure): `flex-col-reverse` does not work to start the container scrolled to the end while also using\n // `ScrollArea`. This is the least-bad way I found to scroll to the end on mount. Note that 0ms was insufficient\n // for the desired effect; this is likely hardware-dependent and should be reevaluated.\n const scrollToEnd = (behavior: ScrollBehavior) =>\n setTimeout(() => threadScrollRef.current?.scrollIntoView({ behavior, block: 'end' }), 10);\n\n useLayoutEffect(() => {\n scrollToEnd('instant');\n }, []);\n\n // TODO(burdon): Change to model.\n const handleCreate: MessageTextboxProps['onSend'] = () => {\n if (!messageRef.current?.length) {\n return false;\n }\n\n thread.messages.push(\n Ref.make(\n Obj.make(Message.Message, {\n created: new Date().toISOString(),\n sender: { identityDid: identity.did },\n blocks: [{ _tag: 'text', text: messageRef.current }],\n properties: context ? { context: Ref.make(context) } : undefined,\n }),\n ),\n );\n\n messageRef.current = '';\n setAutoFocus(true);\n scrollToEnd('smooth');\n rerenderEditor();\n return true;\n };\n\n return (\n <ThreadComponent.Root\n current={current}\n id={id}\n classNames={[\n 'bs-full grid-rows-[1fr_min-content_min-content] overflow-hidden',\n 'transition-[padding-block-end] [[data-sidebar-inline-start-state=open]_&]:lg:pbe-0',\n classNames,\n ]}\n >\n <ScrollArea.Root classNames='col-span-2'>\n <ScrollArea.Viewport classNames='overflow-anchored after:overflow-anchor after:block after:bs-px after:-mbs-px [&>div]:min-bs-full [&>div]:!grid [&>div]:grid-rows-[1fr_0]'>\n <div role='none' className={mx(threadLayout, 'place-self-end')}>\n {thread.messages\n .map((message) => message.target)\n .filter(isNonNullable)\n .map((message) => (\n <MessageContainer key={message.id} message={message} members={members} />\n ))}\n </div>\n {/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}\n <div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n\n <MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />\n <ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>\n </ThreadComponent.Root>\n );\n};\n\nexport default ChatContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { HighlightStyle, StreamLanguage, syntaxHighlighting } from '@codemirror/language';\nimport { type Extension } from '@codemirror/state';\n\nimport { tags } from '@dxos/react-ui-editor';\nimport { mx } from '@dxos/react-ui-theme';\n\n/**\n * https://github.com/codemirror/stream-parser/blob/main/test/test-stream-parser.ts\n */\nconst parser = StreamLanguage.define<{ count: number }>({\n startState: () => ({ count: 0 }),\n token: (stream, state) => {\n state.count++;\n if (stream.eatSpace()) {\n return null;\n }\n if (state.count === 1 && stream.match(/^(\\/\\w+)/)) {\n return 'tagName';\n }\n stream.next();\n return null;\n },\n});\n\nconst styles = HighlightStyle.define([\n {\n tag: tags.tagName,\n class: mx('dx-tag dx-tag--indigo text-baseText font-medium'),\n },\n]);\n\nexport const command: Extension = [parser, syntaxHighlighting(styles)];\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { EditorView } from '@codemirror/view';\nimport React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework/react';\nimport { type Obj, Ref, type Type } from '@dxos/echo';\nimport { PublicKey } from '@dxos/react-client';\nimport { type SpaceMember } from '@dxos/react-client/echo';\nimport { type Identity, useIdentity } from '@dxos/react-client/halo';\nimport { IconButton, useOnTransition, useThemeContext, useTranslation } from '@dxos/react-ui';\nimport { createBasicExtensions, createThemeExtensions, useTextEditor } from '@dxos/react-ui-editor';\nimport { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/react-ui-theme';\nimport { MessageHeading, MessageRoot } from '@dxos/react-ui-thread';\nimport { type ContentBlock, type Message } from '@dxos/types';\n\nimport { useOnEditAnalytics } from '../hooks';\nimport { meta } from '../meta';\nimport { getMessageMetadata } from '../util';\n\nimport { command } from './command-extension';\n\nexport const buttonGroupClassNames = 'flex flex-row items-center gap-0.5 pie-2';\nexport const buttonClassNames = '!p-1 transition-opacity';\n\nexport type MessageContainerProps = {\n message: Message.Message;\n members: SpaceMember[];\n editable?: boolean;\n onDelete?: (id: string) => void;\n onAcceptProposal?: (id: string) => void;\n};\n\nexport const MessageContainer = ({\n message,\n members,\n editable = false,\n onDelete,\n onAcceptProposal,\n}: MessageContainerProps) => {\n const { t } = useTranslation(meta.id);\n const senderIdentity = members.find(\n (member) =>\n (message.sender.identityDid && member.identity.did === message.sender.identityDid) ||\n (message.sender.identityKey && PublicKey.equals(member.identity.identityKey, message.sender.identityKey)),\n )?.identity;\n const messageMetadata = getMessageMetadata(message.id, senderIdentity);\n const userIsAuthor = useIdentity()?.did === messageMetadata.authorId;\n const [editing, setEditing] = useState(false);\n const handleEdit = useCallback(() => setEditing((editing) => !editing), []);\n const handleDelete = useCallback(() => onDelete?.(message.id), [message, onDelete]);\n const handleAcceptProposal = useCallback(() => onAcceptProposal?.(message.id), [message, onAcceptProposal]);\n const textBlock = message.blocks.find((block) => block._tag === 'text');\n const proposalBlock = message.blocks.find((block) => block._tag === 'proposal');\n const references = message.blocks.filter((block) => block._tag === 'reference').map((block) => block.reference);\n\n useOnEditAnalytics(message, textBlock, !!editing);\n\n return (\n <MessageRoot {...messageMetadata} classNames={[hoverableControls, hoverableFocusedWithinControls]}>\n <MessageHeading authorName={messageMetadata.authorName} timestamp={messageMetadata.timestamp}>\n <div role='none' className={buttonGroupClassNames}>\n {userIsAuthor && editable && (\n <IconButton\n data-testid={editing ? 'thread.message.save' : 'thread.message.edit'}\n variant='ghost'\n icon={editing ? 'ph--check--regular' : 'ph--pencil-simple--regular'}\n iconOnly\n label={t(editing ? 'save message label' : 'edit message label')}\n classNames={[buttonClassNames, hoverableControlItem]}\n onClick={handleEdit}\n />\n )}\n {/* TODO(wittjosiah): Proposal controls should probably be hoisted to thread level. */}\n {proposalBlock && onAcceptProposal && (\n <IconButton\n data-testid='thread.message.accept'\n variant='ghost'\n icon='ph--check--regular'\n iconOnly\n label={t('accept proposal label')}\n classNames={[buttonClassNames, hoverableControlItem]}\n onClick={handleAcceptProposal}\n />\n )}\n {onDelete && (\n <IconButton\n data-testid='thread.message.delete'\n variant='ghost'\n icon='ph--x--regular'\n iconOnly\n label={t('delete message label')}\n classNames={[buttonClassNames, hoverableControlItem]}\n onClick={handleDelete}\n />\n )}\n </div>\n </MessageHeading>\n {textBlock && <TextboxBlock block={textBlock} isAuthor={userIsAuthor} editing={editing} />}\n {proposalBlock && <ProposalBlock block={proposalBlock} />}\n {Ref.Array.targets(references).map((reference, index) => (\n <MessagePart key={index} part={reference} />\n ))}\n </MessageRoot>\n );\n};\n\nconst MessagePart = ({ part }: { part: Type.Expando }) => {\n return <MessageBlockObjectTile subject={part} />;\n};\n\nconst TextboxBlock = ({\n block,\n isAuthor,\n editing,\n}: {\n block: ContentBlock.Text;\n editing?: boolean;\n isAuthor?: boolean;\n identity?: Identity;\n}) => {\n const { themeMode } = useThemeContext();\n const inMemoryContentRef = useRef(block.text);\n\n const handleDocumentChange = useCallback((newState: string) => {\n inMemoryContentRef.current = newState;\n }, []);\n\n const saveDocumentChange = useCallback(() => {\n block.text = inMemoryContentRef.current;\n }, [block]);\n\n useOnTransition(editing, true, false, saveDocumentChange);\n\n const { parentRef, focusAttributes, view } = useTextEditor(\n () => ({\n initialValue: block.text,\n extensions: [\n createBasicExtensions({ readOnly: !isAuthor || !editing }),\n createThemeExtensions({ themeMode }),\n command,\n EditorView.updateListener.of((update) => {\n if (update.docChanged) {\n handleDocumentChange(update.state.doc.toString());\n }\n }),\n ],\n }),\n [block.text, editing, isAuthor, themeMode, handleDocumentChange],\n );\n\n useEffect(() => {\n editing && view?.focus();\n }, [editing, view]);\n\n return <div role='none' ref={parentRef} className='mie-4' {...focusAttributes} />;\n};\n\nconst ProposalBlock = ({ block }: { block: ContentBlock.Proposal }) => {\n return (\n <div role='none' className='mie-4 italic'>\n {block.text}\n </div>\n );\n};\n\nconst MessageBlockObjectTile = forwardRef<HTMLDivElement, { subject: Obj.Any }>(({ subject }, forwardedRef) => {\n // TODO(burdon): Use annotation to get title.\n let title = (subject as any).name ?? (subject as any).title ?? (subject as any).type ?? 'Object';\n if (typeof title !== 'string') {\n title = title?.content ?? '';\n }\n\n return (\n <div\n role='group'\n className={mx('grid col-span-3 plb-1 pr-4', hoverableControls, hoverableFocusedWithinControls)}\n ref={forwardedRef}\n >\n <Surface role='card' limit={1} data={{ subject }} fallback={title} />\n </div>\n );\n});\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport { Obj, Ref } from '@dxos/echo';\nimport { type Space, useMembers } from '@dxos/react-client/echo';\nimport { useIdentity } from '@dxos/react-client/halo';\nimport { Icon, ScrollArea, type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';\nimport { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { mx } from '@dxos/react-ui-theme';\nimport {\n MessageTextbox,\n type MessageTextboxProps,\n Thread as ThreadComponent,\n type ThreadRootProps,\n threadLayout,\n} from '@dxos/react-ui-thread';\nimport { Message, type Thread } from '@dxos/types';\nimport { isNonNullable } from '@dxos/util';\n\nimport { useStatus } from '../hooks';\nimport { meta } from '../meta';\nimport { getMessageMetadata } from '../util';\n\nimport { command } from './command-extension';\nimport { MessageContainer } from './MessageContainer';\n\nexport const ChatHeading = ({ attendableId }: { attendableId?: string }) => {\n const { t } = useTranslation(meta.id);\n return (\n <div role='none' className='flex items-center'>\n <StackItem.SigilButton attendableId={attendableId}>\n <Icon icon='ph--chat--regular' size={5} />\n </StackItem.SigilButton>\n <StackItem.HeadingLabel attendableId={attendableId}>{t('chat heading')}</StackItem.HeadingLabel>\n </div>\n );\n};\n\nexport type ChatContainerProps = ThemedClassName<\n {\n space: Space;\n thread: Thread.Thread;\n context?: Obj.Any;\n autoFocusTextbox?: boolean;\n } & Pick<ThreadRootProps, 'current'>\n>;\n\nexport const ChatContainer = ({\n classNames,\n space,\n thread,\n context,\n current,\n autoFocusTextbox,\n}: ChatContainerProps) => {\n const { t } = useTranslation(meta.id);\n const id = Obj.getDXN(thread).toString();\n const identity = useIdentity()!;\n const members = useMembers(space?.key);\n const activity = useStatus(space, id);\n // TODO(wittjosiah): This is a hack to reset the editor after a message is sent.\n const [_count, _setCount] = useState(0);\n const rerenderEditor = () => _setCount((count) => count + 1);\n const [autoFocus, setAutoFocus] = useState(autoFocusTextbox);\n const threadScrollRef = useRef<HTMLDivElement | null>(null);\n const { themeMode } = useThemeContext();\n\n const textboxMetadata = getMessageMetadata(id, identity);\n const messageRef = useRef('');\n const extensions = useMemo(\n () => [\n createBasicExtensions({ placeholder: t('message placeholder') }),\n createThemeExtensions({ themeMode }),\n listener({ onChange: ({ text }) => (messageRef.current = text) }),\n command,\n ],\n [themeMode, _count],\n );\n\n // TODO(thure): Factor out.\n // TODO(thure): `flex-col-reverse` does not work to start the container scrolled to the end while also using\n // `ScrollArea`. This is the least-bad way I found to scroll to the end on mount. Note that 0ms was insufficient\n // for the desired effect; this is likely hardware-dependent and should be reevaluated.\n const scrollToEnd = (behavior: ScrollBehavior) =>\n setTimeout(() => threadScrollRef.current?.scrollIntoView({ behavior, block: 'end' }), 10);\n\n useLayoutEffect(() => {\n scrollToEnd('instant');\n }, []);\n\n // TODO(burdon): Change to model.\n const handleCreate: MessageTextboxProps['onSend'] = () => {\n if (!messageRef.current?.length) {\n return false;\n }\n\n thread.messages.push(\n Ref.make(\n Obj.make(Message.Message, {\n created: new Date().toISOString(),\n sender: { identityDid: identity.did },\n blocks: [{ _tag: 'text', text: messageRef.current }],\n properties: context ? { context: Ref.make(context) } : undefined,\n }),\n ),\n );\n\n messageRef.current = '';\n setAutoFocus(true);\n scrollToEnd('smooth');\n rerenderEditor();\n return true;\n };\n\n return (\n <ThreadComponent.Root\n current={current}\n id={id}\n classNames={[\n 'bs-full grid-rows-[1fr_min-content_min-content] overflow-hidden',\n 'transition-[padding-block-end] [[data-sidebar-inline-start-state=open]_&]:lg:pbe-0',\n classNames,\n ]}\n >\n <ScrollArea.Root classNames='col-span-2'>\n <ScrollArea.Viewport classNames='overflow-anchored after:overflow-anchor after:block after:bs-px after:-mbs-px [&>div]:min-bs-full [&>div]:!grid [&>div]:grid-rows-[1fr_0]'>\n <div role='none' className={mx(threadLayout, 'place-self-end')}>\n {thread.messages\n .map((message) => message.target)\n .filter(isNonNullable)\n .map((message) => (\n <MessageContainer key={message.id} message={message} members={members} />\n ))}\n </div>\n {/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}\n <div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n\n <MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />\n <ThreadComponent.Status activity={activity}>{t('activity message')}</ThreadComponent.Status>\n </ThreadComponent.Root>\n );\n};\n\nexport default ChatContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { HighlightStyle, StreamLanguage, syntaxHighlighting } from '@codemirror/language';\nimport { type Extension } from '@codemirror/state';\n\nimport { tags } from '@dxos/react-ui-editor';\nimport { mx } from '@dxos/react-ui-theme';\n\n/**\n * https://github.com/codemirror/stream-parser/blob/main/test/test-stream-parser.ts\n */\nconst parser = StreamLanguage.define<{ count: number }>({\n startState: () => ({ count: 0 }),\n token: (stream, state) => {\n state.count++;\n if (stream.eatSpace()) {\n return null;\n }\n if (state.count === 1 && stream.match(/^(\\/\\w+)/)) {\n return 'tagName';\n }\n stream.next();\n return null;\n },\n});\n\nconst styles = HighlightStyle.define([\n {\n tag: tags.tagName,\n class: mx('dx-tag dx-tag--indigo text-baseText font-medium'),\n },\n]);\n\nexport const command: Extension = [parser, syntaxHighlighting(styles)];\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { EditorView } from '@codemirror/view';\nimport type * as Schema from 'effect/Schema';\nimport React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework/react';\nimport { type Obj, Ref } from '@dxos/echo';\nimport { PublicKey } from '@dxos/react-client';\nimport { type SpaceMember } from '@dxos/react-client/echo';\nimport { type Identity, useIdentity } from '@dxos/react-client/halo';\nimport { IconButton, useOnTransition, useThemeContext, useTranslation } from '@dxos/react-ui';\nimport { createBasicExtensions, createThemeExtensions, useTextEditor } from '@dxos/react-ui-editor';\nimport { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/react-ui-theme';\nimport { MessageHeading, MessageRoot } from '@dxos/react-ui-thread';\nimport { type ContentBlock, type Message } from '@dxos/types';\n\nimport { useOnEditAnalytics } from '../hooks';\nimport { meta } from '../meta';\nimport { getMessageMetadata } from '../util';\n\nimport { command } from './command-extension';\n\nexport const buttonGroupClassNames = 'flex flex-row items-center gap-0.5 pie-2';\nexport const buttonClassNames = '!p-1 transition-opacity';\n\nexport type MessageContainerProps = {\n // TODO(wittjosiah): Find a simpler way to define this type.\n message: Obj.Obj<Schema.Schema.Type<typeof Message.Message>>;\n members: SpaceMember[];\n editable?: boolean;\n onDelete?: (id: string) => void;\n onAcceptProposal?: (id: string) => void;\n};\n\nexport const MessageContainer = ({\n message,\n members,\n editable = false,\n onDelete,\n onAcceptProposal,\n}: MessageContainerProps) => {\n const { t } = useTranslation(meta.id);\n const senderIdentity = members.find(\n (member) =>\n (message.sender.identityDid && member.identity.did === message.sender.identityDid) ||\n (message.sender.identityKey && PublicKey.equals(member.identity.identityKey, message.sender.identityKey)),\n )?.identity;\n const messageMetadata = getMessageMetadata(message.id, senderIdentity);\n const userIsAuthor = useIdentity()?.did === messageMetadata.authorId;\n const [editing, setEditing] = useState(false);\n const handleEdit = useCallback(() => setEditing((editing) => !editing), []);\n const handleDelete = useCallback(() => onDelete?.(message.id), [message, onDelete]);\n const handleAcceptProposal = useCallback(() => onAcceptProposal?.(message.id), [message, onAcceptProposal]);\n const textBlock = message.blocks.find((block) => block._tag === 'text');\n const proposalBlock = message.blocks.find((block) => block._tag === 'proposal');\n const references = message.blocks.filter((block) => block._tag === 'reference').map((block) => block.reference);\n\n useOnEditAnalytics(message, textBlock, !!editing);\n\n return (\n <MessageRoot {...messageMetadata} classNames={[hoverableControls, hoverableFocusedWithinControls]}>\n <MessageHeading authorName={messageMetadata.authorName} timestamp={messageMetadata.timestamp}>\n <div role='none' className={buttonGroupClassNames}>\n {userIsAuthor && editable && (\n <IconButton\n data-testid={editing ? 'thread.message.save' : 'thread.message.edit'}\n variant='ghost'\n icon={editing ? 'ph--check--regular' : 'ph--pencil-simple--regular'}\n iconOnly\n label={t(editing ? 'save message label' : 'edit message label')}\n classNames={[buttonClassNames, hoverableControlItem]}\n onClick={handleEdit}\n />\n )}\n {/* TODO(wittjosiah): Proposal controls should probably be hoisted to thread level. */}\n {proposalBlock && onAcceptProposal && (\n <IconButton\n data-testid='thread.message.accept'\n variant='ghost'\n icon='ph--check--regular'\n iconOnly\n label={t('accept proposal label')}\n classNames={[buttonClassNames, hoverableControlItem]}\n onClick={handleAcceptProposal}\n />\n )}\n {onDelete && (\n <IconButton\n data-testid='thread.message.delete'\n variant='ghost'\n icon='ph--x--regular'\n iconOnly\n label={t('delete message label')}\n classNames={[buttonClassNames, hoverableControlItem]}\n onClick={handleDelete}\n />\n )}\n </div>\n </MessageHeading>\n {textBlock && <TextboxBlock block={textBlock} isAuthor={userIsAuthor} editing={editing} />}\n {proposalBlock && <ProposalBlock block={proposalBlock} />}\n {Ref.Array.targets(references).map((reference, index) => (\n <MessagePart key={index} part={reference as Obj.Any} />\n ))}\n </MessageRoot>\n );\n};\n\nconst MessagePart = ({ part }: { part: Obj.Any }) => {\n return <MessageBlockObjectTile subject={part} />;\n};\n\nconst TextboxBlock = ({\n block,\n isAuthor,\n editing,\n}: {\n block: ContentBlock.Text;\n editing?: boolean;\n isAuthor?: boolean;\n identity?: Identity;\n}) => {\n const { themeMode } = useThemeContext();\n const inMemoryContentRef = useRef(block.text);\n\n const handleDocumentChange = useCallback((newState: string) => {\n inMemoryContentRef.current = newState;\n }, []);\n\n const saveDocumentChange = useCallback(() => {\n block.text = inMemoryContentRef.current;\n }, [block]);\n\n useOnTransition(editing, true, false, saveDocumentChange);\n\n const { parentRef, focusAttributes, view } = useTextEditor(\n () => ({\n initialValue: block.text,\n extensions: [\n createBasicExtensions({ readOnly: !isAuthor || !editing }),\n createThemeExtensions({ themeMode }),\n command,\n EditorView.updateListener.of((update) => {\n if (update.docChanged) {\n handleDocumentChange(update.state.doc.toString());\n }\n }),\n ],\n }),\n [block.text, editing, isAuthor, themeMode, handleDocumentChange],\n );\n\n useEffect(() => {\n editing && view?.focus();\n }, [editing, view]);\n\n return <div role='none' ref={parentRef} className='mie-4' {...focusAttributes} />;\n};\n\nconst ProposalBlock = ({ block }: { block: ContentBlock.Proposal }) => {\n return (\n <div role='none' className='mie-4 italic'>\n {block.text}\n </div>\n );\n};\n\nconst MessageBlockObjectTile = forwardRef<HTMLDivElement, { subject: Obj.Any }>(({ subject }, forwardedRef) => {\n // TODO(burdon): Use annotation to get title.\n let title = (subject as any).name ?? (subject as any).title ?? (subject as any).type ?? 'Object';\n if (typeof title !== 'string') {\n title = title?.content ?? '';\n }\n\n return (\n <div\n role='group'\n className={mx('grid col-span-3 plb-1 pr-4', hoverableControls, hoverableFocusedWithinControls)}\n ref={forwardedRef}\n >\n <Surface role='card' limit={1} data={{ subject }} fallback={title} />\n </div>\n );\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAIA,OAAOA,UAASC,iBAAiBC,SAASC,UAAAA,SAAQC,YAAAA,iBAAgB;AAElE,SAASC,KAAKC,OAAAA,YAAW;AACzB,SAAqBC,kBAAkB;AACvC,SAASC,eAAAA,oBAAmB;AAC5B,SAASC,MAAMC,YAAkCC,mBAAAA,kBAAiBC,kBAAAA,uBAAsB;AACxF,SAASC,yBAAAA,wBAAuBC,yBAAAA,wBAAuBC,gBAAgB;AACvE,SAASC,iBAAiB;AAC1B,SAASC,MAAAA,WAAU;AACnB,SACEC,gBAEAC,UAAUC,iBAEVC,oBACK;AACP,SAASC,eAA4B;AACrC,SAASC,qBAAqB;;;ACjB9B,SAASC,gBAAgBC,gBAAgBC,0BAA0B;AAGnE,SAASC,YAAY;AACrB,SAASC,UAAU;AAKnB,IAAMC,SAASC,eAAeC,OAA0B;EACtDC,YAAY,OAAO;IAAEC,OAAO;EAAE;EAC9BC,OAAO,CAACC,QAAQC,UAAAA;AACdA,UAAMH;AACN,QAAIE,OAAOE,SAAQ,GAAI;AACrB,aAAO;IACT;AACA,QAAID,MAAMH,UAAU,KAAKE,OAAOG,MAAM,UAAA,GAAa;AACjD,aAAO;IACT;AACAH,WAAOI,KAAI;AACX,WAAO;EACT;AACF,CAAA;AAEA,IAAMC,SAASC,eAAeV,OAAO;EACnC;IACEW,KAAKC,KAAKC;IACVC,OAAOC,GAAG,iDAAA;EACZ;CACD;AAEM,IAAMC,UAAqB;EAAClB;EAAQmB,mBAAmBR,MAAAA;;;;;AC/B9D,SAASS,kBAAkB;AAE3B,OAAOC,SAASC,YAAYC,aAAaC,WAAWC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ACAY,YAAY;QACV;QACA;QACAA;;OAGF,gBAAAX,OAAA,cAAC2E,WAAWD,MAAI;MAAC/D,YAAW;OAC1B,gBAAAX,OAAA,cAAC2E,WAAWC,UAAQ;MAACjE,YAAW;OAC9B,gBAAAX,OAAA,cAACC,OAAAA;MAAIC,MAAK;MAAOC,WAAW0E,IAAGC,cAAc,gBAAA;OAC1CjE,OAAO6C,SACLqB,IAAI,CAACC,YAAYA,QAAQC,MAAM,EAC/BC,OAAOC,aAAAA,EACPJ,IAAI,CAACC,YACJ,gBAAAhF,OAAA,cAACoF,kBAAAA;MAAiB5D,KAAKwD,QAAQjF;MAAIiF;MAAkB1D;UAI3D,gBAAAtB,OAAA,cAACC,OAAAA;MAAIC,MAAK;MAAOC,WAAU;MAAgBkF,KAAKnD;QAChD,gBAAAlC,OAAA,cAAC2E,WAAWW,WAAS,MACnB,gBAAAtF,OAAA,cAAC2E,WAAWY,OAAK,IAAA,CAAA,CAAA,CAAA,GAKvB,gBAAAvF,OAAA,cAACwF,gBAAAA;MAAe/C;MAAwBT;MAAsByD,QAAQjC;MAAe,GAAGlB;QACxF,gBAAAtC,OAAA,cAACyE,gBAAgBiB,QAAM;MAACjE;OAAqB7B,EAAE,kBAAA,CAAA,CAAA;;;;AAGrD;AAEA,IAAA,wBAAec;",
|
|
6
6
|
"names": ["React", "useLayoutEffect", "useMemo", "useRef", "useState", "Obj", "Ref", "useMembers", "useIdentity", "Icon", "ScrollArea", "useThemeContext", "useTranslation", "createBasicExtensions", "createThemeExtensions", "listener", "StackItem", "mx", "MessageTextbox", "Thread", "ThreadComponent", "threadLayout", "Message", "isNonNullable", "HighlightStyle", "StreamLanguage", "syntaxHighlighting", "tags", "mx", "parser", "StreamLanguage", "define", "startState", "count", "token", "stream", "state", "eatSpace", "match", "next", "styles", "HighlightStyle", "tag", "tags", "tagName", "class", "mx", "command", "syntaxHighlighting", "EditorView", "React", "forwardRef", "useCallback", "useEffect", "useRef", "useState", "Surface", "Ref", "PublicKey", "useIdentity", "IconButton", "useOnTransition", "useThemeContext", "useTranslation", "createBasicExtensions", "createThemeExtensions", "useTextEditor", "hoverableControlItem", "hoverableControls", "hoverableFocusedWithinControls", "mx", "MessageHeading", "MessageRoot", "buttonGroupClassNames", "buttonClassNames", "MessageContainer", "message", "members", "editable", "onDelete", "onAcceptProposal", "t", "useTranslation", "meta", "id", "senderIdentity", "find", "member", "sender", "identityDid", "identity", "did", "identityKey", "PublicKey", "equals", "messageMetadata", "getMessageMetadata", "userIsAuthor", "useIdentity", "authorId", "editing", "setEditing", "useState", "handleEdit", "useCallback", "handleDelete", "handleAcceptProposal", "textBlock", "blocks", "block", "_tag", "proposalBlock", "references", "filter", "map", "reference", "useOnEditAnalytics", "MessageRoot", "classNames", "hoverableControls", "hoverableFocusedWithinControls", "MessageHeading", "authorName", "timestamp", "div", "role", "className", "IconButton", "data-testid", "variant", "icon", "iconOnly", "label", "hoverableControlItem", "onClick", "TextboxBlock", "isAuthor", "ProposalBlock", "Ref", "Array", "targets", "index", "MessagePart", "key", "part", "MessageBlockObjectTile", "subject", "themeMode", "useThemeContext", "inMemoryContentRef", "useRef", "text", "handleDocumentChange", "newState", "current", "saveDocumentChange", "useOnTransition", "parentRef", "focusAttributes", "view", "useTextEditor", "initialValue", "extensions", "createBasicExtensions", "readOnly", "createThemeExtensions", "command", "EditorView", "updateListener", "of", "update", "docChanged", "state", "doc", "toString", "useEffect", "focus", "ref", "forwardRef", "forwardedRef", "title", "name", "type", "content", "mx", "Surface", "limit", "data", "fallback", "ChatHeading", "attendableId", "t", "useTranslation", "meta", "id", "React", "div", "role", "className", "StackItem", "SigilButton", "Icon", "icon", "size", "HeadingLabel", "ChatContainer", "classNames", "space", "thread", "context", "current", "autoFocusTextbox", "Obj", "getDXN", "toString", "identity", "useIdentity", "members", "useMembers", "key", "activity", "useStatus", "_count", "_setCount", "useState", "rerenderEditor", "count", "autoFocus", "setAutoFocus", "threadScrollRef", "useRef", "themeMode", "useThemeContext", "textboxMetadata", "getMessageMetadata", "messageRef", "extensions", "useMemo", "createBasicExtensions", "placeholder", "createThemeExtensions", "listener", "onChange", "text", "command", "scrollToEnd", "behavior", "setTimeout", "scrollIntoView", "block", "useLayoutEffect", "handleCreate", "length", "messages", "push", "Ref", "make", "Message", "created", "Date", "toISOString", "sender", "identityDid", "did", "blocks", "_tag", "properties", "undefined", "ThreadComponent", "Root", "ScrollArea", "Viewport", "mx", "threadLayout", "map", "message", "target", "filter", "isNonNullable", "MessageContainer", "ref", "Scrollbar", "Thumb", "MessageTextbox", "onSend", "Status"]
|
|
7
7
|
}
|
|
@@ -14,13 +14,13 @@ __export(Channel_exports, {
|
|
|
14
14
|
});
|
|
15
15
|
import * as Schema from "effect/Schema";
|
|
16
16
|
import { Obj, Ref, Type } from "@dxos/echo";
|
|
17
|
-
import {
|
|
17
|
+
import { FormInputAnnotation } from "@dxos/echo/internal";
|
|
18
18
|
import { Thread } from "@dxos/types";
|
|
19
19
|
var _Channel = Schema.Struct({
|
|
20
20
|
name: Schema.optional(Schema.String),
|
|
21
|
-
defaultThread: Type.Ref(Thread.Thread).pipe(
|
|
21
|
+
defaultThread: Type.Ref(Thread.Thread).pipe(FormInputAnnotation.set(false)),
|
|
22
22
|
// TODO(wittjosiah): Should be an "ordered collection".
|
|
23
|
-
threads: Type.Ref(Thread.Thread).pipe(Schema.Array, Schema.mutable,
|
|
23
|
+
threads: Type.Ref(Thread.Thread).pipe(Schema.Array, Schema.mutable, FormInputAnnotation.set(false))
|
|
24
24
|
}).pipe(Type.Obj({
|
|
25
25
|
typename: "dxos.org/type/Channel",
|
|
26
26
|
version: "0.1.0"
|
|
@@ -37,23 +37,24 @@ var make = (props = {}) => Obj.make(Channel, {
|
|
|
37
37
|
|
|
38
38
|
// src/types/types.ts
|
|
39
39
|
import * as Schema2 from "effect/Schema";
|
|
40
|
-
import {
|
|
40
|
+
import { Key } from "@dxos/echo";
|
|
41
41
|
import { EchoObjectSchema, SpaceSchema } from "@dxos/react-client/echo";
|
|
42
42
|
import { Collection } from "@dxos/schema";
|
|
43
43
|
import { Actor, AnchoredTo, Message, Thread as Thread2 } from "@dxos/types";
|
|
44
44
|
(function(ThreadAction2) {
|
|
45
|
-
class
|
|
45
|
+
class OnCreateSpace extends Schema2.TaggedClass()(`${meta.id}/action/on-space-created`, {
|
|
46
46
|
input: Schema2.Struct({
|
|
47
47
|
space: SpaceSchema,
|
|
48
|
-
rootCollection: Collection.Collection
|
|
48
|
+
rootCollection: Collection.Collection,
|
|
49
|
+
isDefault: Schema2.Boolean.pipe(Schema2.optional)
|
|
49
50
|
}),
|
|
50
51
|
output: Schema2.Void
|
|
51
52
|
}) {
|
|
52
53
|
}
|
|
53
|
-
ThreadAction2.
|
|
54
|
+
ThreadAction2.OnCreateSpace = OnCreateSpace;
|
|
54
55
|
class CreateChannel extends Schema2.TaggedClass()(`${meta.id}/action/create-channel`, {
|
|
55
56
|
input: Schema2.Struct({
|
|
56
|
-
spaceId:
|
|
57
|
+
spaceId: Key.SpaceId,
|
|
57
58
|
name: Schema2.optional(Schema2.String)
|
|
58
59
|
}),
|
|
59
60
|
output: Schema2.Struct({
|
|
@@ -140,4 +141,4 @@ export {
|
|
|
140
141
|
ThreadSettingsSchema,
|
|
141
142
|
ThreadAction
|
|
142
143
|
};
|
|
143
|
-
//# sourceMappingURL=chunk-
|
|
144
|
+
//# sourceMappingURL=chunk-P2M364TO.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/Channel.ts", "../../../src/types/types.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Obj, Ref, Type } from '@dxos/echo';\nimport { FormInputAnnotation } from '@dxos/echo/internal';\nimport { Thread } from '@dxos/types';\n\nconst _Channel = Schema.Struct({\n name: Schema.optional(Schema.String),\n defaultThread: Type.Ref(Thread.Thread).pipe(FormInputAnnotation.set(false)),\n // TODO(wittjosiah): Should be an \"ordered collection\".\n threads: Type.Ref(Thread.Thread).pipe(Schema.Array, Schema.mutable, FormInputAnnotation.set(false)),\n}).pipe(Type.Obj({ typename: 'dxos.org/type/Channel', version: '0.1.0' }));\nexport interface Channel extends Schema.Schema.Type<typeof _Channel> {}\nexport interface ChannelEncoded extends Schema.Schema.Encoded<typeof _Channel> {}\nexport const Channel: Schema.Schema<Channel, ChannelEncoded> = _Channel;\n\nexport const make = (props: Pick<Obj.MakeProps<typeof Channel>, 'name'> = {}) =>\n Obj.make(Channel, {\n ...props,\n defaultThread: Ref.make(Obj.make(Thread.Thread, { messages: [], status: 'active' })),\n threads: [],\n });\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Key } from '@dxos/echo';\nimport { EchoObjectSchema, SpaceSchema } from '@dxos/react-client/echo';\nimport { Collection } from '@dxos/schema';\nimport { Actor, AnchoredTo, Message, Thread } from '@dxos/types';\n\nimport { meta } from '../meta';\n\nimport * as Channel from './Channel';\n\nexport namespace ThreadAction {\n export class OnCreateSpace extends Schema.TaggedClass<OnCreateSpace>()(`${meta.id}/action/on-space-created`, {\n input: Schema.Struct({\n space: SpaceSchema,\n rootCollection: Collection.Collection,\n isDefault: Schema.Boolean.pipe(Schema.optional),\n }),\n output: Schema.Void,\n }) {}\n\n export class CreateChannel extends Schema.TaggedClass<CreateChannel>()(`${meta.id}/action/create-channel`, {\n input: Schema.Struct({\n spaceId: Key.SpaceId,\n name: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: Channel.Channel,\n }),\n }) {}\n\n export class CreateChannelThread extends Schema.TaggedClass<CreateChannelThread>()(\n `${meta.id}/action/create-channel-thread`,\n {\n input: Schema.Struct({\n channel: Channel.Channel,\n }),\n output: Schema.Struct({\n object: Thread.Thread,\n }),\n },\n ) {}\n\n export class Create extends Schema.TaggedClass<Create>()(`${meta.id}/action/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n anchor: Schema.optional(Schema.String),\n subject: EchoObjectSchema,\n }),\n output: Schema.Void,\n }) {}\n\n export class Delete extends Schema.TaggedClass<Delete>()(`${meta.id}/action/delete`, {\n input: Schema.Struct({\n anchor: AnchoredTo.AnchoredTo,\n subject: EchoObjectSchema,\n thread: Schema.optional(Thread.Thread),\n }),\n output: Schema.Void,\n }) {}\n\n export class Select extends Schema.TaggedClass<Select>()(`${meta.id}/action/select`, {\n input: Schema.Struct({\n current: Schema.String,\n }),\n output: Schema.Void,\n }) {}\n\n export class ToggleResolved extends Schema.TaggedClass<ToggleResolved>()(`${meta.id}/action/toggle-resolved`, {\n input: Schema.Struct({\n thread: Thread.Thread,\n }),\n output: Schema.Void,\n }) {}\n\n export class AddMessage extends Schema.TaggedClass<AddMessage>()(`${meta.id}/action/add-message`, {\n input: Schema.Struct({\n subject: EchoObjectSchema,\n anchor: AnchoredTo.AnchoredTo,\n sender: Actor.Actor,\n text: Schema.String,\n }),\n output: Schema.Void,\n }) {}\n\n export class DeleteMessage extends Schema.TaggedClass<DeleteMessage>()(`${meta.id}/action/delete-message`, {\n input: Schema.Struct({\n anchor: AnchoredTo.AnchoredTo,\n subject: EchoObjectSchema,\n messageId: Schema.String,\n message: Schema.optional(Message.Message),\n messageIndex: Schema.optional(Schema.Number),\n }),\n output: Schema.Void,\n }) {}\n}\n\nexport const ThreadSettingsSchema = Schema.mutable(Schema.Struct({}));\nexport type ThreadSettingsProps = Schema.Schema.Type<typeof ThreadSettingsSchema>;\n\nexport interface ThreadModel {\n root: Thread.Thread;\n}\n\ntype SubjectId = string;\nexport type ViewState = { showResolvedThreads: boolean };\nexport type ViewStore = Record<SubjectId, ViewState>;\n\nexport type ThreadState = {\n /** Object toolbar state. */\n toolbar: Record<string, boolean>;\n /** In-memory draft threads. */\n drafts: Record<string, AnchoredTo.AnchoredTo[]>;\n current?: string | undefined;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAAA;;;;;AAIA,YAAY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A,EAAA;EAAI;gBARSsB,aAAAA;EAUN,MAAMI,sBAA6BxC,oBAAW,EAAkB,GAAGC,KAAKC,EAAE,0BAA0B;IACzGC,OAAcC,eAAO;MACnBuB,QAAQI,WAAWA;MACnBH,SAASC;MACTY,WAAkBrB;MAClBsB,SAAgB9B,iBAAS+B,QAAQA,OAAO;MACxCC,cAAqBhC,iBAAgBiC,cAAM;IAC7C,CAAA;IACAhC,QAAeC;EACjB,CAAA,EAAA;EAAI;gBATS0B,gBAAAA;AAUf,GApFiB1C,iBAAAA,eAAAA,CAAAA,EAAAA;AAsFV,IAAMgD,uBAA8BC,gBAAe3C,eAAO,CAAC,CAAA,CAAA;;",
|
|
6
|
+
"names": ["Schema", "Obj", "Ref", "Type", "FormInputAnnotation", "Thread", "_Channel", "Struct", "name", "optional", "String", "defaultThread", "Type", "Ref", "Thread", "pipe", "FormInputAnnotation", "set", "threads", "Array", "mutable", "Obj", "typename", "version", "Channel", "make", "props", "messages", "status", "Schema", "Key", "EchoObjectSchema", "SpaceSchema", "Collection", "Actor", "AnchoredTo", "Message", "Thread", "ThreadAction", "OnCreateSpace", "TaggedClass", "meta", "id", "input", "Struct", "space", "SpaceSchema", "rootCollection", "Collection", "isDefault", "Boolean", "pipe", "optional", "output", "Void", "CreateChannel", "spaceId", "Key", "SpaceId", "name", "String", "object", "Channel", "CreateChannelThread", "channel", "Thread", "Create", "anchor", "subject", "EchoObjectSchema", "Delete", "AnchoredTo", "thread", "Select", "current", "ToggleResolved", "AddMessage", "sender", "Actor", "text", "DeleteMessage", "messageId", "message", "Message", "messageIndex", "Number", "ThreadSettingsSchema", "mutable"]
|
|
7
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
ChannelContainer
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AB42KYF3.mjs";
|
|
5
5
|
import {
|
|
6
6
|
ThreadAction
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-P2M364TO.mjs";
|
|
8
8
|
import {
|
|
9
9
|
ThreadCapabilities
|
|
10
10
|
} from "./chunk-RT6NRL2I.mjs";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
buttonClassNames,
|
|
14
14
|
buttonGroupClassNames,
|
|
15
15
|
command
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-E5HNHFYH.mjs";
|
|
17
17
|
import {
|
|
18
18
|
useStatus
|
|
19
19
|
} from "./chunk-PZH2EDU5.mjs";
|
|
@@ -454,8 +454,8 @@ var ThreadSettings = ({ settings: _settings }) => {
|
|
|
454
454
|
};
|
|
455
455
|
|
|
456
456
|
// src/components/index.ts
|
|
457
|
-
var ChannelContainer2 = lazy(() => import("./ChannelContainer-
|
|
458
|
-
var ChatContainer = lazy(() => import("./ChatContainer-
|
|
457
|
+
var ChannelContainer2 = lazy(() => import("./ChannelContainer-I4U4TEEY.mjs"));
|
|
458
|
+
var ChatContainer = lazy(() => import("./ChatContainer-TLQG23K7.mjs"));
|
|
459
459
|
|
|
460
460
|
// src/components/ThreadCompanion.tsx
|
|
461
461
|
var ThreadCompanion = ({ subject }) => {
|
|
@@ -483,7 +483,7 @@ var ThreadCompanion = ({ subject }) => {
|
|
|
483
483
|
subject
|
|
484
484
|
]);
|
|
485
485
|
const space = getSpace2(subject);
|
|
486
|
-
const objectsAnchoredTo = useQuery(space, Query.select(Filter.
|
|
486
|
+
const objectsAnchoredTo = useQuery(space, Query.select(Filter.id(subject.id)).targetOf(AnchoredTo.AnchoredTo));
|
|
487
487
|
const anchors = objectsAnchoredTo.toSorted((a, b) => sort?.(a, b) ?? 0).filter((anchor) => Obj3.instanceOf(Thread.Thread, Relation3.getSource(anchor))).concat(drafts ?? []);
|
|
488
488
|
const attended = useAttended();
|
|
489
489
|
const handleAttend = useCallback2((anchor) => {
|
|
@@ -609,4 +609,4 @@ export {
|
|
|
609
609
|
ChannelContainer2 as ChannelContainer,
|
|
610
610
|
ChatContainer
|
|
611
611
|
};
|
|
612
|
-
//# sourceMappingURL=chunk-
|
|
612
|
+
//# sourceMappingURL=chunk-RDD44HYY.mjs.map
|