@edv4h/usketch-plugin-spatial-chat 1.0.0
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/LICENSE +21 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +5 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +262 -0
- package/dist/plugin.js.map +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 EdV4H
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { UsketchPlugin } from "@edv4h/usketch-shared";
|
|
2
|
+
import type { WsProviderHandle } from "@edv4h/usketch-sync";
|
|
3
|
+
export declare function createSpatialChatPlugin(wsProvider: WsProviderHandle): UsketchPlugin;
|
|
4
|
+
export declare const spatialChatPlugin: UsketchPlugin;
|
|
5
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAKX,aAAa,EACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AA4W5D,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,gBAAgB,GAAG,aAAa,CAEnF;AAED,eAAO,MAAM,iBAAiB,EAAE,aAA8B,CAAC"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
const BUBBLE_TTL = 10000;
|
|
4
|
+
const INPUT_ID = "chat-input-active";
|
|
5
|
+
function ChatBubble({ obj }) {
|
|
6
|
+
const text = obj.data.text || "";
|
|
7
|
+
const name = obj.data.name || "";
|
|
8
|
+
const color = obj.data.color || "var(--brand-violet)";
|
|
9
|
+
const initial = name ? name.charAt(0).toUpperCase() : "?";
|
|
10
|
+
return (_jsx("div", { style: {
|
|
11
|
+
position: "absolute",
|
|
12
|
+
left: -4,
|
|
13
|
+
top: -40,
|
|
14
|
+
transform: "translateX(-50%)",
|
|
15
|
+
pointerEvents: "none",
|
|
16
|
+
}, children: _jsxs("div", { className: "u-surface u-anim-in", style: {
|
|
17
|
+
padding: "8px 12px",
|
|
18
|
+
borderRadius: 14,
|
|
19
|
+
width: "max-content",
|
|
20
|
+
maxWidth: 240,
|
|
21
|
+
background: "var(--bg-surface-raised)",
|
|
22
|
+
borderLeft: `3px solid ${color}`,
|
|
23
|
+
color: "var(--fg-primary)",
|
|
24
|
+
fontFamily: "var(--font-sans, system-ui, sans-serif)",
|
|
25
|
+
}, children: [name && (_jsxs("div", { style: {
|
|
26
|
+
display: "flex",
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
gap: 6,
|
|
29
|
+
marginBottom: 3,
|
|
30
|
+
}, children: [_jsx("div", { style: {
|
|
31
|
+
width: 14,
|
|
32
|
+
height: 14,
|
|
33
|
+
borderRadius: 99,
|
|
34
|
+
background: color,
|
|
35
|
+
color: "white",
|
|
36
|
+
display: "flex",
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
justifyContent: "center",
|
|
39
|
+
fontSize: 8,
|
|
40
|
+
fontWeight: 700,
|
|
41
|
+
}, children: initial }), _jsx("div", { style: {
|
|
42
|
+
fontSize: 10.5,
|
|
43
|
+
fontWeight: 500,
|
|
44
|
+
color: "var(--fg-secondary)",
|
|
45
|
+
}, children: name })] })), _jsx("div", { style: {
|
|
46
|
+
fontSize: 12.5,
|
|
47
|
+
lineHeight: 1.4,
|
|
48
|
+
overflowWrap: "break-word",
|
|
49
|
+
wordBreak: "break-word",
|
|
50
|
+
whiteSpace: "pre-wrap",
|
|
51
|
+
}, children: text })] }) }));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* チャットInput: transientとして1回だけemitされる。
|
|
55
|
+
* EventBus経由でマウス位置を受け取り、DOM直接操作で追従。
|
|
56
|
+
* Reactの再マウントを避けてフォーカスを維持する。
|
|
57
|
+
*/
|
|
58
|
+
function ChatInput({ obj, onPlace, events, }) {
|
|
59
|
+
const containerRef = useRef(null);
|
|
60
|
+
const inputRef = useRef(null);
|
|
61
|
+
const worldPointRef = useRef(obj.position);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
const unsub = events.on("chat:cursormove", ({ screenX, screenY, worldX, worldY }) => {
|
|
64
|
+
worldPointRef.current = { x: worldX, y: worldY };
|
|
65
|
+
if (containerRef.current) {
|
|
66
|
+
containerRef.current.style.left = `${screenX + 16}px`;
|
|
67
|
+
containerRef.current.style.top = `${screenY - 16}px`;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
return unsub;
|
|
71
|
+
}, [events]);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
setTimeout(() => inputRef.current?.focus(), 50);
|
|
74
|
+
}, []);
|
|
75
|
+
// クリック配置イベントを受信
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
const unsub = events.on("chat:place", ({ worldX, worldY }) => {
|
|
78
|
+
const val = inputRef.current?.value.trim();
|
|
79
|
+
if (val) {
|
|
80
|
+
onPlace(val, { x: worldX, y: worldY });
|
|
81
|
+
if (inputRef.current)
|
|
82
|
+
inputRef.current.value = "";
|
|
83
|
+
setTimeout(() => inputRef.current?.focus(), 0);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
events.emit("chat:empty-click", {});
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return unsub;
|
|
90
|
+
}, [events, onPlace]);
|
|
91
|
+
return (_jsx("div", { ref: containerRef, style: {
|
|
92
|
+
position: "fixed",
|
|
93
|
+
zIndex: 150,
|
|
94
|
+
left: 0,
|
|
95
|
+
top: 0,
|
|
96
|
+
}, children: _jsx("div", { className: "u-surface", style: {
|
|
97
|
+
background: "var(--bg-surface-raised)",
|
|
98
|
+
borderRadius: 10,
|
|
99
|
+
padding: "6px 10px",
|
|
100
|
+
minWidth: 200,
|
|
101
|
+
}, children: _jsx("input", { ref: inputRef, type: "text", placeholder: "\u5165\u529B\u3057\u3066 Enter\u2026", maxLength: 200, style: {
|
|
102
|
+
width: "100%",
|
|
103
|
+
padding: "4px 6px",
|
|
104
|
+
fontSize: 13,
|
|
105
|
+
border: "none",
|
|
106
|
+
outline: "none",
|
|
107
|
+
fontFamily: "var(--font-sans, system-ui, sans-serif)",
|
|
108
|
+
color: "var(--fg-primary)",
|
|
109
|
+
boxSizing: "border-box",
|
|
110
|
+
background: "transparent",
|
|
111
|
+
}, onKeyDown: (e) => {
|
|
112
|
+
e.stopPropagation();
|
|
113
|
+
if (e.key === "Enter" && !e.nativeEvent.isComposing) {
|
|
114
|
+
e.preventDefault();
|
|
115
|
+
const val = e.currentTarget.value.trim();
|
|
116
|
+
if (val) {
|
|
117
|
+
onPlace(val, worldPointRef.current);
|
|
118
|
+
e.currentTarget.value = "";
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}, onPointerDown: (e) => e.stopPropagation() }) }) }));
|
|
122
|
+
}
|
|
123
|
+
function ChatIcon() {
|
|
124
|
+
return (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", children: [_jsx("title", { children: "Chat" }), _jsx("path", { d: "M4 4h12a2 2 0 012 2v6a2 2 0 01-2 2H8l-4 3v-3a2 2 0 01-2-2V6a2 2 0 012-2z", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }), _jsx("line", { x1: "7", y1: "8", x2: "13", y2: "8", stroke: "currentColor", strokeWidth: "1", opacity: "0.5" }), _jsx("line", { x1: "7", y1: "11", x2: "11", y2: "11", stroke: "currentColor", strokeWidth: "1", opacity: "0.5" })] }));
|
|
125
|
+
}
|
|
126
|
+
function createPlugin(wsProvider) {
|
|
127
|
+
let cleanup;
|
|
128
|
+
return {
|
|
129
|
+
id: "usketch-plugin-spatial-chat",
|
|
130
|
+
name: "空間チャット",
|
|
131
|
+
setup(ctx) {
|
|
132
|
+
let bubbleCounter = 0;
|
|
133
|
+
function getUserInfo() {
|
|
134
|
+
if (!wsProvider)
|
|
135
|
+
return { name: "", color: "#333" };
|
|
136
|
+
const local = wsProvider.awareness.getLocalState();
|
|
137
|
+
const user = local?.user;
|
|
138
|
+
return { name: user?.name ?? "", color: user?.color ?? "#333" };
|
|
139
|
+
}
|
|
140
|
+
function emitBubble(text, point) {
|
|
141
|
+
const id = `chat-${Date.now()}-${bubbleCounter++}`;
|
|
142
|
+
const { name, color } = getUserInfo();
|
|
143
|
+
ctx.transient.emit({
|
|
144
|
+
id,
|
|
145
|
+
type: "chat-bubble",
|
|
146
|
+
sourceUserId: "local",
|
|
147
|
+
position: point,
|
|
148
|
+
data: { text, name, color },
|
|
149
|
+
ttl: BUBBLE_TTL,
|
|
150
|
+
createdAt: Date.now(),
|
|
151
|
+
});
|
|
152
|
+
wsProvider?.broadcast({
|
|
153
|
+
kind: "chat-bubble",
|
|
154
|
+
id,
|
|
155
|
+
sourceUserId: "local",
|
|
156
|
+
position: point,
|
|
157
|
+
text,
|
|
158
|
+
name,
|
|
159
|
+
color,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
ctx.transient.registerType("chat-bubble", {
|
|
163
|
+
render: (obj) => _jsx(ChatBubble, { obj: obj }),
|
|
164
|
+
});
|
|
165
|
+
ctx.transient.registerType("chat-input", {
|
|
166
|
+
render: (obj) => _jsx(ChatInput, { obj: obj, onPlace: emitBubble, events: ctx.events }),
|
|
167
|
+
});
|
|
168
|
+
let unsubBroadcast;
|
|
169
|
+
if (wsProvider) {
|
|
170
|
+
unsubBroadcast = wsProvider.onBroadcast((msg) => {
|
|
171
|
+
if (msg.kind !== "chat-bubble")
|
|
172
|
+
return;
|
|
173
|
+
const position = msg.position;
|
|
174
|
+
if (typeof msg.id !== "string" ||
|
|
175
|
+
!position ||
|
|
176
|
+
typeof position.x !== "number" ||
|
|
177
|
+
typeof position.y !== "number" ||
|
|
178
|
+
typeof msg.text !== "string") {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
ctx.transient.emit({
|
|
182
|
+
id: msg.id,
|
|
183
|
+
type: "chat-bubble",
|
|
184
|
+
sourceUserId: typeof msg.sourceUserId === "string" ? msg.sourceUserId : "remote",
|
|
185
|
+
position: { x: position.x, y: position.y },
|
|
186
|
+
data: {
|
|
187
|
+
text: msg.text,
|
|
188
|
+
name: typeof msg.name === "string" ? msg.name : "",
|
|
189
|
+
color: typeof msg.color === "string" ? msg.color : "#333",
|
|
190
|
+
},
|
|
191
|
+
ttl: BUBBLE_TTL,
|
|
192
|
+
createdAt: Date.now(),
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
function showInput() {
|
|
197
|
+
ctx.transient.emit({
|
|
198
|
+
id: INPUT_ID,
|
|
199
|
+
type: "chat-input",
|
|
200
|
+
sourceUserId: "local",
|
|
201
|
+
position: { x: 0, y: 0 },
|
|
202
|
+
data: { interactive: true },
|
|
203
|
+
createdAt: Date.now(),
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
function hideInput() {
|
|
207
|
+
ctx.transient.dismiss(INPUT_ID);
|
|
208
|
+
}
|
|
209
|
+
const TOOL_ID = "spatial-chat";
|
|
210
|
+
ctx.tools.register(TOOL_ID, {
|
|
211
|
+
icon: ChatIcon,
|
|
212
|
+
cursor: "default",
|
|
213
|
+
shortcut: "c",
|
|
214
|
+
order: 65,
|
|
215
|
+
onPointerMove: (_toolCtx, event) => {
|
|
216
|
+
ctx.events.emit("chat:cursormove", {
|
|
217
|
+
screenX: event.screenPoint.x,
|
|
218
|
+
screenY: event.screenPoint.y,
|
|
219
|
+
worldX: event.worldPoint.x,
|
|
220
|
+
worldY: event.worldPoint.y,
|
|
221
|
+
});
|
|
222
|
+
},
|
|
223
|
+
onPointerDown: (_toolCtx, event) => {
|
|
224
|
+
ctx.events.emit("chat:place", {
|
|
225
|
+
worldX: event.worldPoint.x,
|
|
226
|
+
worldY: event.worldPoint.y,
|
|
227
|
+
});
|
|
228
|
+
},
|
|
229
|
+
});
|
|
230
|
+
const unsubEmptyClick = ctx.events.on("chat:empty-click", () => {
|
|
231
|
+
ctx.store.setActiveToolId("select");
|
|
232
|
+
});
|
|
233
|
+
let wasActive = ctx.store.getActiveToolId() === TOOL_ID;
|
|
234
|
+
if (wasActive)
|
|
235
|
+
showInput();
|
|
236
|
+
const unsubToolChange = ctx.store.subscribe(() => {
|
|
237
|
+
const isActive = ctx.store.getActiveToolId() === TOOL_ID;
|
|
238
|
+
if (isActive && !wasActive) {
|
|
239
|
+
showInput();
|
|
240
|
+
}
|
|
241
|
+
else if (!isActive && wasActive) {
|
|
242
|
+
hideInput();
|
|
243
|
+
}
|
|
244
|
+
wasActive = isActive;
|
|
245
|
+
});
|
|
246
|
+
cleanup = () => {
|
|
247
|
+
unsubBroadcast?.();
|
|
248
|
+
unsubToolChange();
|
|
249
|
+
unsubEmptyClick();
|
|
250
|
+
hideInput();
|
|
251
|
+
};
|
|
252
|
+
},
|
|
253
|
+
teardown() {
|
|
254
|
+
cleanup?.();
|
|
255
|
+
},
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
export function createSpatialChatPlugin(wsProvider) {
|
|
259
|
+
return createPlugin(wsProvider);
|
|
260
|
+
}
|
|
261
|
+
export const spatialChatPlugin = createPlugin();
|
|
262
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,UAAU,GAAG,KAAK,CAAC;AACzB,MAAM,QAAQ,GAAG,mBAAmB,CAAC;AAErC,SAAS,UAAU,CAAC,EAAE,GAAG,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AC;oBACnC,SAAS,EAAE,CAAC;gBACb,CAAC;gBACD,SAAS,GAAG,QAAQ,CAAC;YACtB,CAAC,CAAC,CAAC;YAEH,OAAO,GAAG,GAAG,EAAE;gBACd,cAAc,EAAE,EAAE,CAAC;gBACnB,eAAe,EAAE,CAAC;gBAClB,eAAe,EAAE,CAAC;gBAClB,SAAS,EAAE,CAAC;YACb,CAAC,CAAC;QACH,CAAC;QAED,QAAQ;YACP,OAAO,EAAE,EAAE,CAAC;QACb,CAAC;KACD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,UAA4B;IACnE,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAkB,YAAY,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@edv4h/usketch-plugin-spatial-chat",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"source": "./src/index.ts",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@edv4h/usketch-sync": "1.0.0",
|
|
16
|
+
"@edv4h/usketch-shared": "1.0.0"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"react": ">=19"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/react": "19.2.14",
|
|
23
|
+
"typescript": "5.9.3",
|
|
24
|
+
"vitest": "3.2.4"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"README.md"
|
|
32
|
+
],
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/EdV4H/usketch.git",
|
|
37
|
+
"directory": "plugins/usketch-plugin-spatial-chat"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/EdV4H/usketch#readme",
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/EdV4H/usketch/issues"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc -p tsconfig.json",
|
|
45
|
+
"typecheck": "tsc --noEmit",
|
|
46
|
+
"test": "vitest run --passWithNoTests",
|
|
47
|
+
"clean": "rm -rf dist"
|
|
48
|
+
}
|
|
49
|
+
}
|