@edv4h/usketch-plugin-whistle 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 +303 -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,mBAAmB,EAAE,aAAa,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,mBAAmB,EAAE,aAAa,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 createWhistlePlugin(wsProvider: WsProviderHandle): UsketchPlugin;
|
|
4
|
+
export declare const whistlePlugin: 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,EAIN,KAAK,aAAa,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAua5D,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,gBAAgB,GAAG,aAAa,CAE/E;AAED,eAAO,MAAM,aAAa,EAAE,aAA8B,CAAC"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { generateId, } from "@edv4h/usketch-shared";
|
|
3
|
+
import { useCallback, useMemo, useSyncExternalStore } from "react";
|
|
4
|
+
const WHISTLE_TTL = 3000;
|
|
5
|
+
const INDICATOR_TTL = 5000;
|
|
6
|
+
const COOLDOWN_MS = 5000;
|
|
7
|
+
const EDGE_PADDING = 40;
|
|
8
|
+
// ── Transient renderer: pulse ring effect ──
|
|
9
|
+
function WhistleEffect({ obj }) {
|
|
10
|
+
const name = obj.data.name || "";
|
|
11
|
+
return (_jsxs("div", { style: {
|
|
12
|
+
position: "absolute",
|
|
13
|
+
left: -60,
|
|
14
|
+
top: -60,
|
|
15
|
+
width: 120,
|
|
16
|
+
height: 120,
|
|
17
|
+
pointerEvents: "none",
|
|
18
|
+
userSelect: "none",
|
|
19
|
+
}, children: [[0, 1, 2].map((i) => (_jsx("div", { style: {
|
|
20
|
+
position: "absolute",
|
|
21
|
+
inset: 0,
|
|
22
|
+
borderRadius: "50%",
|
|
23
|
+
border: "2px solid #3b82f6",
|
|
24
|
+
animation: `usketch-whistle-pulse ${WHISTLE_TTL}ms ease-out forwards`,
|
|
25
|
+
animationDelay: `${i * 200}ms`,
|
|
26
|
+
opacity: 0,
|
|
27
|
+
} }, i))), name && (_jsx("div", { style: {
|
|
28
|
+
position: "absolute",
|
|
29
|
+
top: "100%",
|
|
30
|
+
left: "50%",
|
|
31
|
+
transform: "translateX(-50%)",
|
|
32
|
+
marginTop: 4,
|
|
33
|
+
whiteSpace: "nowrap",
|
|
34
|
+
fontSize: 12,
|
|
35
|
+
fontFamily: "system-ui, sans-serif",
|
|
36
|
+
color: "#3b82f6",
|
|
37
|
+
fontWeight: 600,
|
|
38
|
+
animation: `usketch-whistle-fade ${WHISTLE_TTL}ms ease-out forwards`,
|
|
39
|
+
}, children: name }))] }));
|
|
40
|
+
}
|
|
41
|
+
// ── CSS injection ──
|
|
42
|
+
let styleInjected = false;
|
|
43
|
+
function injectStyle() {
|
|
44
|
+
if (styleInjected)
|
|
45
|
+
return;
|
|
46
|
+
styleInjected = true;
|
|
47
|
+
const style = document.createElement("style");
|
|
48
|
+
style.textContent = `
|
|
49
|
+
@keyframes usketch-whistle-pulse {
|
|
50
|
+
0% { transform: scale(0); opacity: 0.8; }
|
|
51
|
+
100% { transform: scale(3); opacity: 0; }
|
|
52
|
+
}
|
|
53
|
+
@keyframes usketch-whistle-fade {
|
|
54
|
+
0% { opacity: 1; }
|
|
55
|
+
70% { opacity: 1; }
|
|
56
|
+
100% { opacity: 0; }
|
|
57
|
+
}
|
|
58
|
+
@keyframes usketch-whistle-indicator-in {
|
|
59
|
+
0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
|
|
60
|
+
100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
document.head.appendChild(style);
|
|
64
|
+
}
|
|
65
|
+
function computeIndicatorPosition(worldX, worldY, vp) {
|
|
66
|
+
const screenX = worldX * vp.zoom + vp.x;
|
|
67
|
+
const screenY = worldY * vp.zoom + vp.y;
|
|
68
|
+
const isOnScreen = screenX >= 0 && screenX <= window.innerWidth && screenY >= 0 && screenY <= window.innerHeight;
|
|
69
|
+
if (isOnScreen) {
|
|
70
|
+
return { screenX, screenY, isOnScreen, indicatorX: screenX, indicatorY: screenY };
|
|
71
|
+
}
|
|
72
|
+
const centerX = window.innerWidth / 2;
|
|
73
|
+
const centerY = window.innerHeight / 2;
|
|
74
|
+
const dx = screenX - centerX;
|
|
75
|
+
const dy = screenY - centerY;
|
|
76
|
+
if (dx === 0 && dy === 0) {
|
|
77
|
+
return { screenX, screenY, isOnScreen: true, indicatorX: centerX, indicatorY: centerY };
|
|
78
|
+
}
|
|
79
|
+
const scaleX = dx !== 0
|
|
80
|
+
? (dx > 0 ? window.innerWidth - EDGE_PADDING - centerX : EDGE_PADDING - centerX) / dx
|
|
81
|
+
: Number.POSITIVE_INFINITY;
|
|
82
|
+
const scaleY = dy !== 0
|
|
83
|
+
? (dy > 0 ? window.innerHeight - EDGE_PADDING - centerY : EDGE_PADDING - centerY) / dy
|
|
84
|
+
: Number.POSITIVE_INFINITY;
|
|
85
|
+
const scale = Math.min(Math.abs(scaleX), Math.abs(scaleY));
|
|
86
|
+
return {
|
|
87
|
+
screenX,
|
|
88
|
+
screenY,
|
|
89
|
+
isOnScreen,
|
|
90
|
+
indicatorX: centerX + dx * scale,
|
|
91
|
+
indicatorY: centerY + dy * scale,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function IndicatorItem({ data, onJump, }) {
|
|
95
|
+
const handleClick = useCallback(() => {
|
|
96
|
+
onJump(data.worldX, data.worldY);
|
|
97
|
+
}, [data.worldX, data.worldY, onJump]);
|
|
98
|
+
return (_jsxs("button", { type: "button", onClick: handleClick, style: {
|
|
99
|
+
position: "absolute",
|
|
100
|
+
background: "#3b82f6",
|
|
101
|
+
color: "#fff",
|
|
102
|
+
border: "none",
|
|
103
|
+
borderRadius: 20,
|
|
104
|
+
padding: "6px 12px",
|
|
105
|
+
fontSize: 13,
|
|
106
|
+
fontFamily: "system-ui, sans-serif",
|
|
107
|
+
fontWeight: 600,
|
|
108
|
+
cursor: "pointer",
|
|
109
|
+
whiteSpace: "nowrap",
|
|
110
|
+
display: "flex",
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
gap: 4,
|
|
113
|
+
animation: "usketch-whistle-indicator-in 200ms ease-out forwards",
|
|
114
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.15)",
|
|
115
|
+
zIndex: 200,
|
|
116
|
+
}, children: [_jsx("span", { style: { fontSize: 16 }, children: "\uD83D\uDCE2" }), data.name || "Someone"] }));
|
|
117
|
+
}
|
|
118
|
+
function WhistleIndicatorLayer({ subscribe, getSnapshot, store, }) {
|
|
119
|
+
const indicators = useSyncExternalStore(subscribe, getSnapshot);
|
|
120
|
+
const viewport = useSyncExternalStore((cb) => store.subscribe(cb), () => store.getViewport());
|
|
121
|
+
const handleJump = useCallback((worldX, worldY) => {
|
|
122
|
+
const vp = store.getViewport();
|
|
123
|
+
store.setViewport({
|
|
124
|
+
...vp,
|
|
125
|
+
x: window.innerWidth / 2 - worldX * vp.zoom,
|
|
126
|
+
y: window.innerHeight / 2 - worldY * vp.zoom,
|
|
127
|
+
});
|
|
128
|
+
}, [store]);
|
|
129
|
+
const positioned = useMemo(() => {
|
|
130
|
+
return indicators
|
|
131
|
+
.map((ind) => {
|
|
132
|
+
const pos = computeIndicatorPosition(ind.worldX, ind.worldY, viewport);
|
|
133
|
+
return { ...ind, ...pos };
|
|
134
|
+
})
|
|
135
|
+
.filter((p) => !p.isOnScreen);
|
|
136
|
+
}, [indicators, viewport]);
|
|
137
|
+
if (positioned.length === 0)
|
|
138
|
+
return null;
|
|
139
|
+
return (_jsx(_Fragment, { children: positioned.map((item) => (_jsx("div", { style: {
|
|
140
|
+
position: "fixed",
|
|
141
|
+
left: item.indicatorX,
|
|
142
|
+
top: item.indicatorY,
|
|
143
|
+
transform: "translate(-50%, -50%)",
|
|
144
|
+
pointerEvents: "auto",
|
|
145
|
+
}, children: _jsx(IndicatorItem, { data: item, onJump: handleJump }) }, item.id))) }));
|
|
146
|
+
}
|
|
147
|
+
// ── Plugin factory ──
|
|
148
|
+
function createPlugin(wsProvider) {
|
|
149
|
+
const cleanups = [];
|
|
150
|
+
let indicators = [];
|
|
151
|
+
const indicatorListeners = new Set();
|
|
152
|
+
const indicatorTimers = new Map();
|
|
153
|
+
function indicatorSubscribe(cb) {
|
|
154
|
+
indicatorListeners.add(cb);
|
|
155
|
+
return () => indicatorListeners.delete(cb);
|
|
156
|
+
}
|
|
157
|
+
function indicatorGetSnapshot() {
|
|
158
|
+
return indicators;
|
|
159
|
+
}
|
|
160
|
+
function addIndicator(data) {
|
|
161
|
+
indicators = [...indicators, data];
|
|
162
|
+
for (const cb of indicatorListeners)
|
|
163
|
+
cb();
|
|
164
|
+
const timer = setTimeout(() => {
|
|
165
|
+
removeIndicator(data.id);
|
|
166
|
+
}, INDICATOR_TTL);
|
|
167
|
+
indicatorTimers.set(data.id, timer);
|
|
168
|
+
}
|
|
169
|
+
function removeIndicator(id) {
|
|
170
|
+
const prevLen = indicators.length;
|
|
171
|
+
indicators = indicators.filter((i) => i.id !== id);
|
|
172
|
+
const timer = indicatorTimers.get(id);
|
|
173
|
+
if (timer !== undefined) {
|
|
174
|
+
clearTimeout(timer);
|
|
175
|
+
indicatorTimers.delete(id);
|
|
176
|
+
}
|
|
177
|
+
if (indicators.length < prevLen) {
|
|
178
|
+
for (const cb of indicatorListeners)
|
|
179
|
+
cb();
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
id: "usketch-plugin-whistle",
|
|
184
|
+
name: "ホイッスル",
|
|
185
|
+
setup(ctx) {
|
|
186
|
+
injectStyle();
|
|
187
|
+
ctx.transient.registerType("whistle", {
|
|
188
|
+
render: (obj) => _jsx(WhistleEffect, { obj: obj }),
|
|
189
|
+
});
|
|
190
|
+
// ── Shortcut: W key ──
|
|
191
|
+
let lastWhistleTime = 0;
|
|
192
|
+
function getLocalUserName() {
|
|
193
|
+
if (!wsProvider)
|
|
194
|
+
return "";
|
|
195
|
+
const states = wsProvider.awareness.getStates();
|
|
196
|
+
const localId = wsProvider.awareness.doc.clientID;
|
|
197
|
+
const localState = states.get(localId);
|
|
198
|
+
return localState?.avatar?.name ?? localState?.user?.name ?? "";
|
|
199
|
+
}
|
|
200
|
+
function handleWhistle() {
|
|
201
|
+
const now = Date.now();
|
|
202
|
+
if (now - lastWhistleTime < COOLDOWN_MS)
|
|
203
|
+
return;
|
|
204
|
+
lastWhistleTime = now;
|
|
205
|
+
const vp = ctx.store.getViewport();
|
|
206
|
+
const worldX = (window.innerWidth / 2 - vp.x) / vp.zoom;
|
|
207
|
+
const worldY = (window.innerHeight / 2 - vp.y) / vp.zoom;
|
|
208
|
+
const id = generateId();
|
|
209
|
+
const name = getLocalUserName();
|
|
210
|
+
ctx.transient.emit({
|
|
211
|
+
id,
|
|
212
|
+
type: "whistle",
|
|
213
|
+
sourceUserId: "local",
|
|
214
|
+
position: { x: worldX, y: worldY },
|
|
215
|
+
data: { name },
|
|
216
|
+
ttl: WHISTLE_TTL,
|
|
217
|
+
createdAt: Date.now(),
|
|
218
|
+
});
|
|
219
|
+
wsProvider?.broadcast({
|
|
220
|
+
kind: "whistle",
|
|
221
|
+
id,
|
|
222
|
+
sourceUserId: "local",
|
|
223
|
+
sourceName: name,
|
|
224
|
+
position: { x: worldX, y: worldY },
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
cleanups.push(ctx.shortcuts.register("Shift+W", handleWhistle));
|
|
228
|
+
// ── Broadcast receiver ──
|
|
229
|
+
if (wsProvider) {
|
|
230
|
+
const unsubBroadcast = wsProvider.onBroadcast((msg) => {
|
|
231
|
+
if (msg.kind !== "whistle")
|
|
232
|
+
return;
|
|
233
|
+
const id = msg.id;
|
|
234
|
+
const position = msg.position;
|
|
235
|
+
const sourceName = msg.sourceName;
|
|
236
|
+
if (typeof id !== "string" ||
|
|
237
|
+
!position ||
|
|
238
|
+
typeof position.x !== "number" ||
|
|
239
|
+
typeof position.y !== "number") {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const name = typeof sourceName === "string" ? sourceName : "";
|
|
243
|
+
const userId = typeof msg.sourceUserId === "string" ? msg.sourceUserId : "remote";
|
|
244
|
+
const vp = ctx.store.getViewport();
|
|
245
|
+
const pos = computeIndicatorPosition(position.x, position.y, vp);
|
|
246
|
+
if (pos.isOnScreen) {
|
|
247
|
+
ctx.transient.emit({
|
|
248
|
+
id,
|
|
249
|
+
type: "whistle",
|
|
250
|
+
sourceUserId: userId,
|
|
251
|
+
position: { x: position.x, y: position.y },
|
|
252
|
+
data: { name },
|
|
253
|
+
ttl: WHISTLE_TTL,
|
|
254
|
+
createdAt: Date.now(),
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
// Also emit transient at the world position (visible when user scrolls there)
|
|
259
|
+
ctx.transient.emit({
|
|
260
|
+
id,
|
|
261
|
+
type: "whistle",
|
|
262
|
+
sourceUserId: userId,
|
|
263
|
+
position: { x: position.x, y: position.y },
|
|
264
|
+
data: { name },
|
|
265
|
+
ttl: WHISTLE_TTL,
|
|
266
|
+
createdAt: Date.now(),
|
|
267
|
+
});
|
|
268
|
+
addIndicator({
|
|
269
|
+
id: `${id}-indicator`,
|
|
270
|
+
name,
|
|
271
|
+
worldX: position.x,
|
|
272
|
+
worldY: position.y,
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
cleanups.push(unsubBroadcast);
|
|
277
|
+
}
|
|
278
|
+
// ── Indicator layer ──
|
|
279
|
+
ctx.layers.register({
|
|
280
|
+
id: "whistle-indicator",
|
|
281
|
+
order: 98,
|
|
282
|
+
fixed: true,
|
|
283
|
+
render: () => (_jsx(WhistleIndicatorLayer, { subscribe: indicatorSubscribe, getSnapshot: indicatorGetSnapshot, store: ctx.store })),
|
|
284
|
+
});
|
|
285
|
+
cleanups.push(() => ctx.layers.unregister("whistle-indicator"));
|
|
286
|
+
},
|
|
287
|
+
teardown() {
|
|
288
|
+
for (const fn of cleanups)
|
|
289
|
+
fn();
|
|
290
|
+
cleanups.length = 0;
|
|
291
|
+
for (const timer of indicatorTimers.values())
|
|
292
|
+
clearTimeout(timer);
|
|
293
|
+
indicatorTimers.clear();
|
|
294
|
+
indicators = [];
|
|
295
|
+
indicatorListeners.clear();
|
|
296
|
+
},
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
export function createWhistlePlugin(wsProvider) {
|
|
300
|
+
return createPlugin(wsProvider);
|
|
301
|
+
}
|
|
302
|
+
export const whistlePlugin = createPlugin();
|
|
303
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.tsx"],"names":[],"mappings":";AAAA,OAAO,EACN,UAAU,GAIV,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAEnE,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,MAAM,aAAa,GAAG,IA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gBACT,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE,GAAG,EAAE,CAAC,CACb,KAAC,qBAAqB,IACrB,SAAS,EAAE,kBAAkB,EAC7B,WAAW,EAAE,oBAAoB,EACjC,KAAK,EAAE,GAAG,CAAC,KAAK,GACf,CACF;aACD,CAAC,CAAC;YACH,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,CAAC;QACjE,CAAC;QAED,QAAQ;YACP,KAAK,MAAM,EAAE,IAAI,QAAQ;gBAAE,EAAE,EAAE,CAAC;YAChC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;YACpB,KAAK,MAAM,KAAK,IAAI,eAAe,CAAC,MAAM,EAAE;gBAAE,YAAY,CAAC,KAAK,CAAC,CAAC;YAClE,eAAe,CAAC,KAAK,EAAE,CAAC;YACxB,UAAU,GAAG,EAAE,CAAC;YAChB,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAC5B,CAAC;KACD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,UAA4B;IAC/D,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAkB,YAAY,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@edv4h/usketch-plugin-whistle",
|
|
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-whistle"
|
|
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
|
+
}
|