@edv4h/usketch-plugin-spotlight 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 +192 -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,qBAAqB,EAAE,eAAe,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,qBAAqB,EAAE,eAAe,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 createSpotlightPlugin(wsProvider: WsProviderHandle): UsketchPlugin;
|
|
4
|
+
export declare const spotlightPlugin: 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;AAqP5D,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,gBAAgB,GAAG,aAAa,CAEjF;AAED,eAAO,MAAM,eAAe,EAAE,aAA8B,CAAC"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
const SPOTLIGHT_RADIUS = 150;
|
|
4
|
+
/** スポットライトの状態(モジュールレベルシングルトン) */
|
|
5
|
+
const spotlightState = {
|
|
6
|
+
active: false,
|
|
7
|
+
worldX: 0,
|
|
8
|
+
worldY: 0,
|
|
9
|
+
onUpdate: null,
|
|
10
|
+
};
|
|
11
|
+
function SpotlightCanvas({ ctx: renderCtx }) {
|
|
12
|
+
const canvasRef = useRef(null);
|
|
13
|
+
const rafRef = useRef(0);
|
|
14
|
+
const viewportRef = useRef(renderCtx.viewport);
|
|
15
|
+
viewportRef.current = renderCtx.viewport;
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (!canvasRef.current)
|
|
18
|
+
return;
|
|
19
|
+
const canvas = canvasRef.current;
|
|
20
|
+
const c2d = canvas.getContext("2d");
|
|
21
|
+
if (!c2d)
|
|
22
|
+
return;
|
|
23
|
+
let running = true;
|
|
24
|
+
function draw() {
|
|
25
|
+
if (!running)
|
|
26
|
+
return;
|
|
27
|
+
const dpr = window.devicePixelRatio || 1;
|
|
28
|
+
const w = window.innerWidth;
|
|
29
|
+
const h = window.innerHeight;
|
|
30
|
+
if (canvas.width !== w * dpr || canvas.height !== h * dpr) {
|
|
31
|
+
canvas.width = w * dpr;
|
|
32
|
+
canvas.height = h * dpr;
|
|
33
|
+
canvas.style.width = `${w}px`;
|
|
34
|
+
canvas.style.height = `${h}px`;
|
|
35
|
+
}
|
|
36
|
+
c2d.setTransform(dpr, 0, 0, dpr, 0, 0);
|
|
37
|
+
c2d.clearRect(0, 0, w, h);
|
|
38
|
+
if (spotlightState.active) {
|
|
39
|
+
const { x: vx, y: vy, zoom } = viewportRef.current;
|
|
40
|
+
// ワールド座標→スクリーン座標
|
|
41
|
+
const screenX = spotlightState.worldX * zoom + vx;
|
|
42
|
+
const screenY = spotlightState.worldY * zoom + vy;
|
|
43
|
+
const screenRadius = SPOTLIGHT_RADIUS * zoom;
|
|
44
|
+
// 全画面を暗くする
|
|
45
|
+
c2d.fillStyle = "rgba(0, 0, 0, 0.6)";
|
|
46
|
+
c2d.fillRect(0, 0, w, h);
|
|
47
|
+
// 穴を開ける(destination-outで円形を切り抜き)
|
|
48
|
+
c2d.globalCompositeOperation = "destination-out";
|
|
49
|
+
c2d.beginPath();
|
|
50
|
+
c2d.arc(screenX, screenY, screenRadius, 0, Math.PI * 2);
|
|
51
|
+
c2d.fill();
|
|
52
|
+
// ソフトエッジ(グラデーション)
|
|
53
|
+
const gradient = c2d.createRadialGradient(screenX, screenY, screenRadius * 0.8, screenX, screenY, screenRadius);
|
|
54
|
+
gradient.addColorStop(0, "rgba(0,0,0,1)");
|
|
55
|
+
gradient.addColorStop(1, "rgba(0,0,0,0)");
|
|
56
|
+
c2d.fillStyle = gradient;
|
|
57
|
+
c2d.beginPath();
|
|
58
|
+
c2d.arc(screenX, screenY, screenRadius, 0, Math.PI * 2);
|
|
59
|
+
c2d.fill();
|
|
60
|
+
c2d.globalCompositeOperation = "source-over";
|
|
61
|
+
rafRef.current = requestAnimationFrame(draw);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
rafRef.current = 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// 状態変更通知用コールバック
|
|
68
|
+
spotlightState.onUpdate = () => {
|
|
69
|
+
if (rafRef.current === 0 && running) {
|
|
70
|
+
rafRef.current = requestAnimationFrame(draw);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
if (spotlightState.active) {
|
|
74
|
+
rafRef.current = requestAnimationFrame(draw);
|
|
75
|
+
}
|
|
76
|
+
return () => {
|
|
77
|
+
running = false;
|
|
78
|
+
spotlightState.onUpdate = null;
|
|
79
|
+
if (rafRef.current)
|
|
80
|
+
cancelAnimationFrame(rafRef.current);
|
|
81
|
+
};
|
|
82
|
+
}, []);
|
|
83
|
+
return (_jsx("canvas", { ref: canvasRef, style: {
|
|
84
|
+
position: "absolute",
|
|
85
|
+
inset: 0,
|
|
86
|
+
pointerEvents: "none",
|
|
87
|
+
} }));
|
|
88
|
+
}
|
|
89
|
+
function notifyUpdate() {
|
|
90
|
+
spotlightState.onUpdate?.();
|
|
91
|
+
}
|
|
92
|
+
function SpotlightIcon() {
|
|
93
|
+
return (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", children: [_jsx("title", { children: "Spotlight" }), _jsx("circle", { cx: "10", cy: "10", r: "5", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }), _jsx("circle", { cx: "10", cy: "10", r: "8", fill: "none", stroke: "currentColor", strokeWidth: "0.5", opacity: "0.4" }), _jsx("circle", { cx: "10", cy: "10", r: "2", fill: "currentColor", opacity: "0.6" })] }));
|
|
94
|
+
}
|
|
95
|
+
function createPlugin(wsProvider) {
|
|
96
|
+
let cleanup;
|
|
97
|
+
return {
|
|
98
|
+
id: "usketch-plugin-spotlight",
|
|
99
|
+
name: "スポットライト",
|
|
100
|
+
setup(ctx) {
|
|
101
|
+
// fixedレイヤーとしてCanvas2Dを登録
|
|
102
|
+
ctx.layers.register({
|
|
103
|
+
id: "spotlight",
|
|
104
|
+
order: 95,
|
|
105
|
+
fixed: true,
|
|
106
|
+
render: (renderCtx) => _jsx(SpotlightCanvas, { ctx: renderCtx }),
|
|
107
|
+
});
|
|
108
|
+
let isActive = false;
|
|
109
|
+
let unsubBroadcast;
|
|
110
|
+
if (wsProvider) {
|
|
111
|
+
unsubBroadcast = wsProvider.onBroadcast((msg) => {
|
|
112
|
+
if (msg.kind === "spotlight-update") {
|
|
113
|
+
const position = msg.position;
|
|
114
|
+
if (!position || typeof position.x !== "number" || typeof position.y !== "number") {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
spotlightState.active = true;
|
|
118
|
+
spotlightState.worldX = position.x;
|
|
119
|
+
spotlightState.worldY = position.y;
|
|
120
|
+
notifyUpdate();
|
|
121
|
+
}
|
|
122
|
+
else if (msg.kind === "spotlight-dismiss") {
|
|
123
|
+
spotlightState.active = false;
|
|
124
|
+
notifyUpdate();
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function updateSpotlight(point) {
|
|
129
|
+
spotlightState.active = true;
|
|
130
|
+
spotlightState.worldX = point.x;
|
|
131
|
+
spotlightState.worldY = point.y;
|
|
132
|
+
notifyUpdate();
|
|
133
|
+
wsProvider?.broadcast({
|
|
134
|
+
kind: "spotlight-update",
|
|
135
|
+
sourceUserId: "local",
|
|
136
|
+
position: point,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function dismissSpotlight() {
|
|
140
|
+
spotlightState.active = false;
|
|
141
|
+
notifyUpdate();
|
|
142
|
+
wsProvider?.broadcast({ kind: "spotlight-dismiss" });
|
|
143
|
+
}
|
|
144
|
+
const TOOL_ID = "spotlight";
|
|
145
|
+
ctx.tools.register(TOOL_ID, {
|
|
146
|
+
icon: SpotlightIcon,
|
|
147
|
+
cursor: "crosshair",
|
|
148
|
+
shortcut: "o",
|
|
149
|
+
order: 70,
|
|
150
|
+
onPointerDown: (_toolCtx, event) => {
|
|
151
|
+
if (isActive) {
|
|
152
|
+
dismissSpotlight();
|
|
153
|
+
isActive = false;
|
|
154
|
+
ctx.store.setActiveToolId("select");
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
updateSpotlight(event.worldPoint);
|
|
158
|
+
isActive = true;
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
onPointerMove: (_toolCtx, event) => {
|
|
162
|
+
if (!isActive)
|
|
163
|
+
return;
|
|
164
|
+
updateSpotlight(event.worldPoint);
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
let wasToolActive = ctx.store.getActiveToolId() === TOOL_ID;
|
|
168
|
+
const unsubToolChange = ctx.store.subscribe(() => {
|
|
169
|
+
const isToolActive = ctx.store.getActiveToolId() === TOOL_ID;
|
|
170
|
+
if (!isToolActive && wasToolActive && isActive) {
|
|
171
|
+
dismissSpotlight();
|
|
172
|
+
isActive = false;
|
|
173
|
+
}
|
|
174
|
+
wasToolActive = isToolActive;
|
|
175
|
+
});
|
|
176
|
+
cleanup = () => {
|
|
177
|
+
unsubBroadcast?.();
|
|
178
|
+
unsubToolChange();
|
|
179
|
+
ctx.layers.unregister("spotlight");
|
|
180
|
+
spotlightState.active = false;
|
|
181
|
+
};
|
|
182
|
+
},
|
|
183
|
+
teardown() {
|
|
184
|
+
cleanup?.();
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
export function createSpotlightPlugin(wsProvider) {
|
|
189
|
+
return createPlugin(wsProvider);
|
|
190
|
+
}
|
|
191
|
+
export const spotlightPlugin = createPlugin();
|
|
192
|
+
//# 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,gBAAgB,GAAG,GAAG,CAAC;AAE7B,iCAAiC;AACjC,MAAM,cAAc,GAKhB;IACH,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE,IAAI;CACd,CAAC;AAEF,SAAS,eAAe,CAAC,EAAE,GAAG,EAAE,SAAS,EAA+B;IACvE,MAAM,SAAS,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,MAAM,CAAS,CAAC,CAAC,CAAC;IACjC,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC/C,WAAW,CAAC,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC;IAEzC,SAAS,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,OAAO;YAAE,OAAO;QAC/B,MAAM,MAAM,GAAsB,SAAS,CAAC,OAAO,CAAC;QACpD,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAA6B,CAAC;QAChE,IAAI,CAAC,GAAG;YAAE,OAAO;QACjB,IAAI,OAAO,GAAG,IAAI,CAAC;QAEnB,SAAS,IAAI;YACZ,IAAI,CAAC,OAAO;gBAAE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D,MAAM,eAAe,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;gBAChD,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,OAAO,CAAC;gBAC7D,IAAI,CAAC,YAAY,IAAI,aAAa,IAAI,QAAQ,EAAE,CAAC;oBAChD,gBAAgB,EAAE,CAAC;oBACnB,QAAQ,GAAG,KAAK,CAAC;gBAClB,CAAC;gBACD,aAAa,GAAG,YAAY,CAAC;YAC9B,CAAC,CAAC,CAAC;YAEH,OAAO,GAAG,GAAG,EAAE;gBACd,cAAc,EAAE,EAAE,CAAC;gBACnB,eAAe,EAAE,CAAC;gBAClB,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;gBACnC,cAAc,CAAC,MAAM,GAAG,KAAK,CAAC;YAC/B,CAAC,CAAC;QACH,CAAC;QAED,QAAQ;YACP,OAAO,EAAE,EAAE,CAAC;QACb,CAAC;KACD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,UAA4B;IACjE,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAkB,YAAY,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@edv4h/usketch-plugin-spotlight",
|
|
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-spotlight"
|
|
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
|
+
}
|