@edv4h/usketch-plugin-voting 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 +159 -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,kBAAkB,EAAE,YAAY,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,kBAAkB,EAAE,YAAY,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 createVotingPlugin(wsProvider: WsProviderHandle): UsketchPlugin;
|
|
4
|
+
export declare const votingPlugin: 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,EAAkC,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAkQ5D,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,gBAAgB,GAAG,aAAa,CAE9E;AAED,eAAO,MAAM,YAAY,EAAE,aAA8B,CAAC"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
function VoteCard({ obj }) {
|
|
3
|
+
const question = obj.data.question || "";
|
|
4
|
+
const options = obj.data.options || [];
|
|
5
|
+
const totalVotes = options.reduce((sum, o) => sum + o.votes, 0);
|
|
6
|
+
return (_jsxs("div", { style: {
|
|
7
|
+
position: "absolute",
|
|
8
|
+
left: -100,
|
|
9
|
+
top: -20,
|
|
10
|
+
width: 200,
|
|
11
|
+
background: "#fff",
|
|
12
|
+
borderRadius: 12,
|
|
13
|
+
padding: 12,
|
|
14
|
+
boxShadow: "0 2px 12px rgba(0,0,0,0.12)",
|
|
15
|
+
border: "1px solid #e0e0e0",
|
|
16
|
+
fontFamily: "system-ui, sans-serif",
|
|
17
|
+
pointerEvents: "none",
|
|
18
|
+
}, children: [_jsx("div", { style: { fontSize: 13, fontWeight: 600, marginBottom: 8, color: "#333" }, children: question }), options.map((opt) => {
|
|
19
|
+
const pct = totalVotes > 0 ? Math.round((opt.votes / totalVotes) * 100) : 0;
|
|
20
|
+
return (_jsxs("div", { style: { marginBottom: 4 }, children: [_jsxs("div", { style: { fontSize: 12, color: "#555", marginBottom: 2 }, children: [opt.label, " (", opt.votes, ")"] }), _jsx("div", { style: {
|
|
21
|
+
height: 6,
|
|
22
|
+
borderRadius: 3,
|
|
23
|
+
background: "#eee",
|
|
24
|
+
overflow: "hidden",
|
|
25
|
+
}, children: _jsx("div", { style: {
|
|
26
|
+
height: "100%",
|
|
27
|
+
width: `${pct}%`,
|
|
28
|
+
background: "#0066ff",
|
|
29
|
+
borderRadius: 3,
|
|
30
|
+
transition: "width 0.3s",
|
|
31
|
+
} }) })] }, opt.label));
|
|
32
|
+
}), totalVotes > 0 && (_jsxs("div", { style: { fontSize: 10, color: "#999", marginTop: 6, textAlign: "right" }, children: [totalVotes, " votes"] }))] }));
|
|
33
|
+
}
|
|
34
|
+
function VotingIcon() {
|
|
35
|
+
return (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", children: [_jsx("title", { children: "Vote" }), _jsx("rect", { x: "3", y: "4", width: "4", height: "12", rx: "1", fill: "none", stroke: "currentColor", strokeWidth: "1.2" }), _jsx("rect", { x: "8", y: "8", width: "4", height: "8", rx: "1", fill: "none", stroke: "currentColor", strokeWidth: "1.2" }), _jsx("rect", { x: "13", y: "2", width: "4", height: "14", rx: "1", fill: "none", stroke: "currentColor", strokeWidth: "1.2" })] }));
|
|
36
|
+
}
|
|
37
|
+
function createPlugin(wsProvider) {
|
|
38
|
+
let cleanup;
|
|
39
|
+
return {
|
|
40
|
+
id: "usketch-plugin-voting",
|
|
41
|
+
name: "空間投票",
|
|
42
|
+
setup(ctx) {
|
|
43
|
+
ctx.transient.registerType("vote-card", {
|
|
44
|
+
render: (obj) => _jsx(VoteCard, { obj: obj }),
|
|
45
|
+
});
|
|
46
|
+
const polls = new Map();
|
|
47
|
+
let pollCounter = 0;
|
|
48
|
+
function renderPoll(poll) {
|
|
49
|
+
ctx.transient.dismiss(`vote-${poll.id}`);
|
|
50
|
+
ctx.transient.emit({
|
|
51
|
+
id: `vote-${poll.id}`,
|
|
52
|
+
type: "vote-card",
|
|
53
|
+
sourceUserId: poll.createdBy,
|
|
54
|
+
position: poll.position,
|
|
55
|
+
data: {
|
|
56
|
+
question: poll.question,
|
|
57
|
+
options: poll.options,
|
|
58
|
+
interactive: true,
|
|
59
|
+
},
|
|
60
|
+
createdAt: Date.now(),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
let unsubBroadcast;
|
|
64
|
+
if (wsProvider) {
|
|
65
|
+
unsubBroadcast = wsProvider.onBroadcast((msg) => {
|
|
66
|
+
if (msg.kind === "vote-create") {
|
|
67
|
+
const poll = {
|
|
68
|
+
id: msg.id,
|
|
69
|
+
question: msg.question,
|
|
70
|
+
options: msg.options,
|
|
71
|
+
position: msg.position,
|
|
72
|
+
createdBy: msg.createdBy,
|
|
73
|
+
};
|
|
74
|
+
polls.set(poll.id, poll);
|
|
75
|
+
renderPoll(poll);
|
|
76
|
+
}
|
|
77
|
+
else if (msg.kind === "vote-cast") {
|
|
78
|
+
const poll = polls.get(msg.pollId);
|
|
79
|
+
if (poll) {
|
|
80
|
+
const optIdx = msg.optionIndex;
|
|
81
|
+
if (poll.options[optIdx]) {
|
|
82
|
+
poll.options[optIdx].votes++;
|
|
83
|
+
renderPoll(poll);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function createPoll(question, optionLabels, position) {
|
|
90
|
+
const id = `poll-${Date.now()}-${pollCounter++}`;
|
|
91
|
+
const poll = {
|
|
92
|
+
id,
|
|
93
|
+
question,
|
|
94
|
+
options: optionLabels.map((label) => ({ label, votes: 0 })),
|
|
95
|
+
position,
|
|
96
|
+
createdBy: "local",
|
|
97
|
+
};
|
|
98
|
+
polls.set(id, poll);
|
|
99
|
+
renderPoll(poll);
|
|
100
|
+
wsProvider?.broadcast({
|
|
101
|
+
kind: "vote-create",
|
|
102
|
+
id,
|
|
103
|
+
question,
|
|
104
|
+
options: poll.options,
|
|
105
|
+
position,
|
|
106
|
+
createdBy: "local",
|
|
107
|
+
});
|
|
108
|
+
return id;
|
|
109
|
+
}
|
|
110
|
+
function castVote(pollId, optionIndex) {
|
|
111
|
+
const poll = polls.get(pollId);
|
|
112
|
+
if (!poll || !poll.options[optionIndex])
|
|
113
|
+
return;
|
|
114
|
+
poll.options[optionIndex].votes++;
|
|
115
|
+
renderPoll(poll);
|
|
116
|
+
wsProvider?.broadcast({
|
|
117
|
+
kind: "vote-cast",
|
|
118
|
+
pollId,
|
|
119
|
+
optionIndex,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
// EventBus経由で投票作成/投票
|
|
123
|
+
const unsubCreate = ctx.events.on("vote:create", ({ question, options, position }) => {
|
|
124
|
+
createPoll(question, options, position);
|
|
125
|
+
});
|
|
126
|
+
const unsubCast = ctx.events.on("vote:cast", ({ pollId, optionIndex }) => {
|
|
127
|
+
castVote(pollId, optionIndex);
|
|
128
|
+
});
|
|
129
|
+
// ツールとして登録(クリックでデフォルト投票を作成)
|
|
130
|
+
ctx.tools.register("voting", {
|
|
131
|
+
icon: VotingIcon,
|
|
132
|
+
cursor: "crosshair",
|
|
133
|
+
shortcut: "n",
|
|
134
|
+
order: 75,
|
|
135
|
+
onPointerDown: (_toolCtx, event) => {
|
|
136
|
+
createPoll("Vote", ["Yes", "No"], event.worldPoint);
|
|
137
|
+
ctx.store.setActiveToolId("select");
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
cleanup = () => {
|
|
141
|
+
unsubBroadcast?.();
|
|
142
|
+
unsubCreate();
|
|
143
|
+
unsubCast();
|
|
144
|
+
for (const poll of polls.values()) {
|
|
145
|
+
ctx.transient.dismiss(`vote-${poll.id}`);
|
|
146
|
+
}
|
|
147
|
+
polls.clear();
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
teardown() {
|
|
151
|
+
cleanup?.();
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
export function createVotingPlugin(wsProvider) {
|
|
156
|
+
return createPlugin(wsProvider);
|
|
157
|
+
}
|
|
158
|
+
export const votingPlugin = createPlugin();
|
|
159
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.tsx"],"names":[],"mappings":";AAgBA,SAAS,QAAQ,CAAC,EAAE,GAAG,EAA4B;IAClD,MAAM,QAAQ,GAAI,GAAG,CAAC,IAAI,CAAC,QAAmB,IAAI,EAAE,CAAC;IACrD,MAAM,OAAO,GAAI,GAAG,CAAC,IAAI,CAAC,OAAwB,IAAI,EAAE,CAAC;IACzD,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAEhE,OAAO,CACN,eACC,KAAK,EAAE;YACN,QAAQ,EAAE,UAAU;YACpB,IAAI,EAAE,CAAC,GAAG;YACV,GAAG,EAAE,CAAC,EAAE;YACR,KAAK,EAAE,GAAG;YACV,UAAU,EAAE,MAAM;YAClB,YAAY,EAAE,EAAE;YAChB,OAAO,E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AC1C,CAAC;gBACD,KAAK,CAAC,KAAK,EAAE,CAAC;YACf,CAAC,CAAC;QACH,CAAC;QAED,QAAQ;YACP,OAAO,EAAE,EAAE,CAAC;QACb,CAAC;KACD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,UAA4B;IAC9D,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAkB,YAAY,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@edv4h/usketch-plugin-voting",
|
|
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-voting"
|
|
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
|
+
}
|