call-control-sdk 1.0.0 → 2.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/dist/index.mjs ADDED
@@ -0,0 +1,634 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+
5
+ // src/lib/sdk-state.ts
6
+ var SDKStateManager = class {
7
+ constructor() {
8
+ __publicField(this, "state");
9
+ __publicField(this, "listeners", []);
10
+ __publicField(this, "STORAGE_KEY", "call-control-sdk-state");
11
+ this.state = this.getInitialState();
12
+ this.loadFromStorage();
13
+ }
14
+ getInitialState() {
15
+ return {
16
+ apiKey: null,
17
+ isInitialized: false,
18
+ isHolding: false,
19
+ isMuted: false,
20
+ status: "idle",
21
+ callStartTime: null,
22
+ position: { x: 50, y: 50 },
23
+ callData: {
24
+ mobileNumber: "",
25
+ callReferenceId: "",
26
+ agentLoginId: ""
27
+ }
28
+ };
29
+ }
30
+ loadFromStorage() {
31
+ try {
32
+ const stored = localStorage.getItem(this.STORAGE_KEY);
33
+ if (stored) {
34
+ const parsedState = JSON.parse(stored);
35
+ this.state = {
36
+ ...this.state,
37
+ isHolding: parsedState.isHolding || false,
38
+ isMuted: parsedState.isMuted || false,
39
+ status: parsedState.status || "idle",
40
+ position: parsedState.position || { x: 50, y: 50 },
41
+ callStartTime: parsedState.callStartTime || null
42
+ };
43
+ }
44
+ } catch (error) {
45
+ console.warn("Failed to load SDK state from localStorage:", error);
46
+ }
47
+ }
48
+ saveToStorage() {
49
+ try {
50
+ const persistentState = {
51
+ isHolding: this.state.isHolding,
52
+ isMuted: this.state.isMuted,
53
+ status: this.state.status,
54
+ position: this.state.position,
55
+ callStartTime: this.state.callStartTime
56
+ };
57
+ localStorage.setItem(this.STORAGE_KEY, JSON.stringify(persistentState));
58
+ } catch (error) {
59
+ console.warn("Failed to save SDK state to localStorage:", error);
60
+ }
61
+ }
62
+ notifyListeners() {
63
+ this.listeners.forEach((listener) => listener());
64
+ }
65
+ initialize(apiKey) {
66
+ if (!apiKey || typeof apiKey !== "string" || apiKey.trim().length === 0) {
67
+ throw new Error("API key not available");
68
+ }
69
+ this.state.apiKey = apiKey;
70
+ this.state.isInitialized = true;
71
+ this.notifyListeners();
72
+ }
73
+ getState() {
74
+ return { ...this.state };
75
+ }
76
+ subscribe(listener) {
77
+ this.listeners.push(listener);
78
+ return () => {
79
+ const index = this.listeners.indexOf(listener);
80
+ if (index > -1) {
81
+ this.listeners.splice(index, 1);
82
+ }
83
+ };
84
+ }
85
+ setHolding(isHolding) {
86
+ this.state.isHolding = isHolding;
87
+ this.saveToStorage();
88
+ this.notifyListeners();
89
+ }
90
+ setMuted(isMuted) {
91
+ this.state.isMuted = isMuted;
92
+ this.saveToStorage();
93
+ this.notifyListeners();
94
+ }
95
+ setStatus(status) {
96
+ this.state.status = status;
97
+ this.saveToStorage();
98
+ this.notifyListeners();
99
+ }
100
+ setPosition(position) {
101
+ this.state.position = position;
102
+ this.saveToStorage();
103
+ this.notifyListeners();
104
+ }
105
+ startCall() {
106
+ this.state.callStartTime = Date.now();
107
+ this.state.status = "ready";
108
+ this.saveToStorage();
109
+ this.notifyListeners();
110
+ }
111
+ endCall() {
112
+ this.state.callStartTime = null;
113
+ this.state.status = "idle";
114
+ this.state.isHolding = false;
115
+ this.state.isMuted = false;
116
+ this.saveToStorage();
117
+ this.notifyListeners();
118
+ }
119
+ updateCallData(data) {
120
+ this.state.callData = { ...this.state.callData, ...data };
121
+ this.notifyListeners();
122
+ }
123
+ };
124
+ var sdkStateManager = new SDKStateManager();
125
+
126
+ // src/lib/components/CallControlPanel.tsx
127
+ import { useEffect as useEffect2, useState as useState3, useCallback as useCallback2 } from "react";
128
+ import {
129
+ Paper,
130
+ IconButton,
131
+ Typography,
132
+ Menu,
133
+ MenuItem,
134
+ Box,
135
+ Tooltip,
136
+ Fade,
137
+ useTheme,
138
+ Button
139
+ } from "@mui/material";
140
+ import {
141
+ PauseCircle,
142
+ PlayCircle,
143
+ Mic,
144
+ MicOff,
145
+ MoreVert,
146
+ CallEnd,
147
+ KeyboardArrowDown,
148
+ Cached,
149
+ FreeBreakfast,
150
+ AirlineSeatIndividualSuite,
151
+ TransferWithinAStation,
152
+ Groups,
153
+ Phone,
154
+ DragIndicator,
155
+ SpatialAudioOff
156
+ } from "@mui/icons-material";
157
+
158
+ // src/lib/hooks/useSDKState.ts
159
+ import { useState, useEffect } from "react";
160
+ function useSDKState() {
161
+ const [state, setState] = useState(sdkStateManager.getState());
162
+ useEffect(() => {
163
+ const unsubscribe = sdkStateManager.subscribe(() => {
164
+ setState(sdkStateManager.getState());
165
+ });
166
+ return unsubscribe;
167
+ }, []);
168
+ return state;
169
+ }
170
+
171
+ // src/lib/hooks/useDraggable.ts
172
+ import {
173
+ useState as useState2,
174
+ useRef,
175
+ useCallback
176
+ } from "react";
177
+ function useDraggable(initialPosition, onPositionChange) {
178
+ const [position, setPosition] = useState2(initialPosition);
179
+ const [isDragging, setIsDragging] = useState2(false);
180
+ const dragRef = useRef(null);
181
+ const dragStart = useRef({ x: 0, y: 0 });
182
+ const elementStart = useRef({ x: 0, y: 0 });
183
+ const updatePosition = useCallback(
184
+ (newPosition) => {
185
+ const element = dragRef.current;
186
+ if (!element) return;
187
+ const rect = element.getBoundingClientRect();
188
+ const viewportWidth = window.innerWidth;
189
+ const viewportHeight = window.innerHeight;
190
+ const constrainedPosition = {
191
+ x: Math.max(0, Math.min(newPosition.x, viewportWidth - rect.width)),
192
+ y: Math.max(0, Math.min(newPosition.y, viewportHeight - rect.height))
193
+ };
194
+ setPosition(constrainedPosition);
195
+ onPositionChange?.(constrainedPosition);
196
+ },
197
+ [onPositionChange]
198
+ );
199
+ const handleStart = useCallback(
200
+ (clientX, clientY) => {
201
+ setIsDragging(true);
202
+ dragStart.current = { x: clientX, y: clientY };
203
+ elementStart.current = position;
204
+ const handleMove = (moveClientX, moveClientY) => {
205
+ const deltaX = moveClientX - dragStart.current.x;
206
+ const deltaY = moveClientY - dragStart.current.y;
207
+ const newPosition = {
208
+ x: elementStart.current.x + deltaX,
209
+ y: elementStart.current.y + deltaY
210
+ };
211
+ updatePosition(newPosition);
212
+ };
213
+ const handleMouseMove = (e) => {
214
+ e.preventDefault();
215
+ handleMove(e.clientX, e.clientY);
216
+ };
217
+ const handleTouchMove = (e) => {
218
+ e.preventDefault();
219
+ const touch = e.touches[0];
220
+ if (touch) {
221
+ handleMove(touch.clientX, touch.clientY);
222
+ }
223
+ };
224
+ const handleEnd = () => {
225
+ setIsDragging(false);
226
+ document.removeEventListener("mousemove", handleMouseMove);
227
+ document.removeEventListener("mouseup", handleEnd);
228
+ document.removeEventListener("touchmove", handleTouchMove);
229
+ document.removeEventListener("touchend", handleEnd);
230
+ };
231
+ document.addEventListener("mousemove", handleMouseMove);
232
+ document.addEventListener("mouseup", handleEnd);
233
+ document.addEventListener("touchmove", handleTouchMove, {
234
+ passive: false
235
+ });
236
+ document.addEventListener("touchend", handleEnd);
237
+ },
238
+ [position, updatePosition]
239
+ );
240
+ const handleMouseDown = useCallback(
241
+ (e) => {
242
+ e.preventDefault();
243
+ handleStart(e.clientX, e.clientY);
244
+ },
245
+ [handleStart]
246
+ );
247
+ const handleTouchStart = useCallback(
248
+ (e) => {
249
+ e.preventDefault();
250
+ const touch = e.touches[0];
251
+ if (touch) {
252
+ handleStart(touch.clientX, touch.clientY);
253
+ }
254
+ },
255
+ [handleStart]
256
+ );
257
+ return {
258
+ position,
259
+ isDragging,
260
+ dragRef,
261
+ handleMouseDown,
262
+ handleTouchStart
263
+ };
264
+ }
265
+
266
+ // src/lib/components/CallControlPanel.tsx
267
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
268
+ function CallControlPanel({ onDataChange }) {
269
+ const theme = useTheme();
270
+ const state = useSDKState();
271
+ const [anchorEl, setAnchorEl] = useState3(null);
272
+ const [moreOptionsAnchorEl, setMoreOptionsAnchorEl] = useState3(null);
273
+ const [callDuration, setCallDuration] = useState3(0);
274
+ const { position, isDragging, dragRef, handleMouseDown, handleTouchStart } = useDraggable(
275
+ state.position,
276
+ (newPosition) => sdkStateManager.setPosition(newPosition)
277
+ );
278
+ useEffect2(() => {
279
+ let interval;
280
+ if (state.callStartTime) {
281
+ interval = setInterval(() => {
282
+ const elapsed = Math.floor((Date.now() - state.callStartTime) / 1e3);
283
+ setCallDuration(elapsed);
284
+ }, 1e3);
285
+ } else {
286
+ setCallDuration(0);
287
+ }
288
+ return () => {
289
+ if (interval) clearInterval(interval);
290
+ };
291
+ }, [state.callStartTime]);
292
+ useEffect2(() => {
293
+ if (onDataChange) {
294
+ onDataChange(state.callData);
295
+ }
296
+ }, [state.callData, onDataChange]);
297
+ const formatDuration = useCallback2((seconds) => {
298
+ const mins = Math.floor(seconds / 60);
299
+ const secs = seconds % 60;
300
+ return `${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
301
+ }, []);
302
+ const getStatusColor = useCallback2((status) => {
303
+ switch (status) {
304
+ case "ready":
305
+ return "success";
306
+ case "break":
307
+ return "warning";
308
+ case "idle":
309
+ return "default";
310
+ default:
311
+ return "default";
312
+ }
313
+ }, []);
314
+ const handleHoldToggle = () => {
315
+ sdkStateManager.setHolding(!state.isHolding);
316
+ };
317
+ const handleMuteToggle = () => {
318
+ sdkStateManager.setMuted(!state.isMuted);
319
+ };
320
+ const handleStatusChange = (newStatus) => {
321
+ sdkStateManager.setStatus(newStatus);
322
+ setAnchorEl(null);
323
+ };
324
+ const handleEndCall = () => {
325
+ sdkStateManager.endCall();
326
+ };
327
+ const handleStartCall = () => {
328
+ sdkStateManager.startCall();
329
+ };
330
+ const handleMoreClick = (event) => {
331
+ setAnchorEl(event.currentTarget);
332
+ };
333
+ const handleMoreOptions = (event) => {
334
+ setMoreOptionsAnchorEl(event.currentTarget);
335
+ };
336
+ const handleMoreClose = () => {
337
+ setAnchorEl(null);
338
+ };
339
+ const handleMoreOptionsClose = () => {
340
+ setMoreOptionsAnchorEl(null);
341
+ };
342
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
343
+ /* @__PURE__ */ jsx(Fade, { in: true, timeout: 300, children: /* @__PURE__ */ jsx(
344
+ Paper,
345
+ {
346
+ ref: dragRef,
347
+ elevation: isDragging ? 2 : 1,
348
+ sx: {
349
+ position: "fixed",
350
+ left: position.x,
351
+ top: position.y,
352
+ p: 1,
353
+ borderRadius: 3,
354
+ bgcolor: "background.paper",
355
+ cursor: isDragging ? "grabbing" : "grab",
356
+ transition: theme.transitions.create(["box-shadow", "transform"], {
357
+ duration: theme.transitions.duration.short
358
+ }),
359
+ transform: isDragging ? "scale(1.01)" : "scale(1)",
360
+ minWidth: 320,
361
+ userSelect: "none"
362
+ },
363
+ onMouseDown: handleMouseDown,
364
+ onTouchStart: handleTouchStart,
365
+ children: /* @__PURE__ */ jsxs(
366
+ Box,
367
+ {
368
+ sx: {
369
+ display: "flex",
370
+ alignItems: "center"
371
+ },
372
+ children: [
373
+ /* @__PURE__ */ jsxs(
374
+ Box,
375
+ {
376
+ sx: {
377
+ display: "flex",
378
+ justifyContent: "space-between",
379
+ alignItems: "center"
380
+ },
381
+ children: [
382
+ /* @__PURE__ */ jsxs(
383
+ Typography,
384
+ {
385
+ variant: "h6",
386
+ sx: {
387
+ color: state.callStartTime ? "success.main" : "text.secondary",
388
+ marginRight: "8px",
389
+ display: "flex",
390
+ justifyContent: "space-between",
391
+ alignItems: "center"
392
+ },
393
+ children: [
394
+ /* @__PURE__ */ jsx(
395
+ DragIndicator,
396
+ {
397
+ sx: {
398
+ marginRight: "10px"
399
+ }
400
+ }
401
+ ),
402
+ " ",
403
+ formatDuration(callDuration)
404
+ ]
405
+ }
406
+ ),
407
+ /* @__PURE__ */ jsx(Tooltip, { title: "Status", children: /* @__PURE__ */ jsxs(
408
+ Button,
409
+ {
410
+ sx: {
411
+ backgroundColor: getStatusColor(state.status),
412
+ fontWeight: "bold",
413
+ borderRadius: "16px",
414
+ display: "flex",
415
+ alignItems: "center",
416
+ justifyContent: "space-between",
417
+ marginRight: "8px"
418
+ },
419
+ onClick: (e) => {
420
+ e.stopPropagation();
421
+ handleMoreClick(e);
422
+ },
423
+ variant: "outlined",
424
+ children: [
425
+ /* @__PURE__ */ jsx(
426
+ Typography,
427
+ {
428
+ width: 50,
429
+ variant: "body2",
430
+ sx: {
431
+ fontWeight: "bold"
432
+ },
433
+ children: state.status.toUpperCase()
434
+ }
435
+ ),
436
+ /* @__PURE__ */ jsx(KeyboardArrowDown, {})
437
+ ]
438
+ }
439
+ ) })
440
+ ]
441
+ }
442
+ ),
443
+ /* @__PURE__ */ jsxs(
444
+ Box,
445
+ {
446
+ sx: {
447
+ display: "flex",
448
+ gap: 1,
449
+ justifyContent: "center",
450
+ alignItems: "center"
451
+ },
452
+ children: [
453
+ /* @__PURE__ */ jsx(Tooltip, { title: "Redial", children: /* @__PURE__ */ jsx(
454
+ IconButton,
455
+ {
456
+ onClick: (e) => {
457
+ e.stopPropagation();
458
+ },
459
+ color: "default",
460
+ sx: {
461
+ bgcolor: "action.hover",
462
+ "&:hover": {
463
+ bgcolor: "warning"
464
+ }
465
+ },
466
+ children: /* @__PURE__ */ jsx(Cached, {})
467
+ }
468
+ ) }),
469
+ /* @__PURE__ */ jsx(Tooltip, { title: state.isHolding ? "Resume" : "Hold", children: /* @__PURE__ */ jsx(
470
+ IconButton,
471
+ {
472
+ onClick: (e) => {
473
+ e.stopPropagation();
474
+ handleHoldToggle();
475
+ },
476
+ color: state.isHolding ? "warning" : "default",
477
+ sx: {
478
+ bgcolor: state.isHolding ? "warning.info" : "action.hover"
479
+ },
480
+ children: state.isHolding ? /* @__PURE__ */ jsx(PlayCircle, {}) : /* @__PURE__ */ jsx(PauseCircle, {})
481
+ }
482
+ ) }),
483
+ /* @__PURE__ */ jsx(Tooltip, { title: state.isMuted ? "Unmute" : "Mute", children: /* @__PURE__ */ jsx(
484
+ IconButton,
485
+ {
486
+ onClick: (e) => {
487
+ e.stopPropagation();
488
+ handleMuteToggle();
489
+ },
490
+ color: state.isMuted ? "error" : "default",
491
+ sx: {
492
+ bgcolor: state.isMuted ? "error.info" : "action.hover"
493
+ },
494
+ children: state.isMuted ? /* @__PURE__ */ jsx(MicOff, {}) : /* @__PURE__ */ jsx(Mic, {})
495
+ }
496
+ ) }),
497
+ /* @__PURE__ */ jsx(Tooltip, { title: "More Options", children: /* @__PURE__ */ jsx(
498
+ IconButton,
499
+ {
500
+ onClick: (e) => {
501
+ e.stopPropagation();
502
+ handleMoreOptions(e);
503
+ },
504
+ sx: {
505
+ bgcolor: "action.hover",
506
+ "&:hover": { bgcolor: "action.selected" }
507
+ },
508
+ children: /* @__PURE__ */ jsx(MoreVert, {})
509
+ }
510
+ ) }),
511
+ /* @__PURE__ */ jsx(Tooltip, { title: state.callStartTime ? "End Call" : "Start Call", children: /* @__PURE__ */ jsx(
512
+ IconButton,
513
+ {
514
+ onClick: (e) => {
515
+ e.stopPropagation();
516
+ (state.callStartTime ? handleEndCall : handleStartCall)();
517
+ },
518
+ color: "error",
519
+ sx: {
520
+ bgcolor: state.callStartTime ? "error.main" : "success.light",
521
+ color: "white",
522
+ "&:hover": {
523
+ bgcolor: state.callStartTime ? "error.light" : "success.dark"
524
+ }
525
+ },
526
+ children: /* @__PURE__ */ jsx(CallEnd, {})
527
+ }
528
+ ) })
529
+ ]
530
+ }
531
+ )
532
+ ]
533
+ }
534
+ )
535
+ }
536
+ ) }),
537
+ /* @__PURE__ */ jsxs(
538
+ Menu,
539
+ {
540
+ anchorEl,
541
+ open: Boolean(anchorEl),
542
+ onClose: handleMoreClose,
543
+ onClick: (e) => e.stopPropagation(),
544
+ children: [
545
+ /* @__PURE__ */ jsx(
546
+ MenuItem,
547
+ {
548
+ onClick: () => handleStatusChange("ready"),
549
+ sx: {
550
+ backgroundColor: state.status === "ready" ? "#0038f01c" : "initial"
551
+ },
552
+ children: /* @__PURE__ */ jsxs(
553
+ Box,
554
+ {
555
+ sx: {
556
+ display: "flex",
557
+ alignItems: "center",
558
+ gap: 1
559
+ },
560
+ children: [
561
+ /* @__PURE__ */ jsx(Phone, { color: "success" }),
562
+ /* @__PURE__ */ jsx(Typography, { children: "Ready" })
563
+ ]
564
+ }
565
+ )
566
+ }
567
+ ),
568
+ /* @__PURE__ */ jsx(
569
+ MenuItem,
570
+ {
571
+ onClick: () => handleStatusChange("break"),
572
+ sx: {
573
+ backgroundColor: state.status === "break" ? "#0038f01c" : "initial"
574
+ },
575
+ children: /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
576
+ /* @__PURE__ */ jsx(FreeBreakfast, { color: "error" }),
577
+ /* @__PURE__ */ jsx(Typography, { children: "Break" })
578
+ ] })
579
+ }
580
+ ),
581
+ /* @__PURE__ */ jsx(
582
+ MenuItem,
583
+ {
584
+ onClick: () => handleStatusChange("idle"),
585
+ sx: {
586
+ backgroundColor: state.status === "idle" ? "#0038f01c" : "initial"
587
+ },
588
+ children: /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
589
+ /* @__PURE__ */ jsx(AirlineSeatIndividualSuite, { color: "warning" }),
590
+ /* @__PURE__ */ jsx(Typography, { children: "Idle" })
591
+ ] })
592
+ }
593
+ )
594
+ ]
595
+ }
596
+ ),
597
+ /* @__PURE__ */ jsxs(
598
+ Menu,
599
+ {
600
+ anchorEl: moreOptionsAnchorEl,
601
+ open: Boolean(moreOptionsAnchorEl),
602
+ onClose: handleMoreOptionsClose,
603
+ onClick: (e) => e.stopPropagation(),
604
+ children: [
605
+ /* @__PURE__ */ jsx(MenuItem, { onClick: () => setMoreOptionsAnchorEl(null), children: /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
606
+ /* @__PURE__ */ jsx(TransferWithinAStation, { color: "secondary" }),
607
+ /* @__PURE__ */ jsx(Typography, { children: "Call Transfer" })
608
+ ] }) }),
609
+ /* @__PURE__ */ jsx(MenuItem, { onClick: () => setMoreOptionsAnchorEl(null), children: /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
610
+ /* @__PURE__ */ jsx(Groups, { color: "secondary" }),
611
+ /* @__PURE__ */ jsx(Typography, { children: "Conference Call" })
612
+ ] }) }),
613
+ /* @__PURE__ */ jsx(MenuItem, { onClick: () => setMoreOptionsAnchorEl(null), children: /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
614
+ /* @__PURE__ */ jsx(SpatialAudioOff, { color: "secondary" }),
615
+ /* @__PURE__ */ jsx(Typography, { children: "Queue Waiting" })
616
+ ] }) })
617
+ ]
618
+ }
619
+ )
620
+ ] });
621
+ }
622
+
623
+ // src/index.ts
624
+ function initCallSDK(sdkApiKey) {
625
+ sdkStateManager.initialize(sdkApiKey);
626
+ }
627
+ function updateCallData(data) {
628
+ sdkStateManager.updateCallData(data);
629
+ }
630
+ export {
631
+ CallControlPanel,
632
+ initCallSDK,
633
+ updateCallData
634
+ };
package/package.json CHANGED
@@ -1,40 +1,29 @@
1
1
  {
2
2
  "name": "call-control-sdk",
3
3
  "description": "Call Control SDK",
4
- "version": "1.0.0",
5
- "type": "module",
4
+ "version": "2.0.0",
6
5
  "author": "Achala",
7
6
  "license": "MIT",
7
+ "main": "dist/index.cjs",
8
+ "module": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "files": [
11
+ "dist"
12
+ ],
8
13
  "scripts": {
9
14
  "dev": "vite",
10
15
  "start": "vite",
11
- "build": "tsc -b && vite build",
12
- "build:lib": "tsc --project tsconfig.lib.json && vite build --mode lib",
16
+ "build": "tsup src/index.ts --format esm,cjs --dts --clean",
13
17
  "lint": "eslint .",
14
18
  "format": "prettier --write .",
15
- "preview": "vite preview",
16
- "prepublishOnly": "npm run build:lib"
19
+ "prepublishOnly": "npm run build"
17
20
  },
18
- "dependencies": {
21
+ "peerDependencies": {
19
22
  "@emotion/react": "^11.14.0",
20
23
  "@emotion/styled": "^11.14.1",
21
24
  "@mui/icons-material": "^7.3.1",
22
25
  "@mui/material": "^7.3.1",
23
26
  "react": "^19.1.1",
24
27
  "react-dom": "^19.1.1"
25
- },
26
- "devDependencies": {
27
- "@eslint/js": "^9.33.0",
28
- "@types/node": "^24.2.1",
29
- "@types/react": "^19.1.10",
30
- "@types/react-dom": "^19.1.7",
31
- "@vitejs/plugin-react-swc": "^4.0.0",
32
- "eslint": "^9.33.0",
33
- "eslint-plugin-react-hooks": "^5.2.0",
34
- "eslint-plugin-react-refresh": "^0.4.20",
35
- "globals": "^16.3.0",
36
- "typescript": "~5.8.3",
37
- "typescript-eslint": "^8.39.1",
38
- "vite": "^7.1.2"
39
28
  }
40
29
  }
package/eslint.config.js DELETED
@@ -1,23 +0,0 @@
1
- import js from '@eslint/js'
2
- import globals from 'globals'
3
- import reactHooks from 'eslint-plugin-react-hooks'
4
- import reactRefresh from 'eslint-plugin-react-refresh'
5
- import tseslint from 'typescript-eslint'
6
- import { globalIgnores } from 'eslint/config'
7
-
8
- export default tseslint.config([
9
- globalIgnores(['dist']),
10
- {
11
- files: ['**/*.{ts,tsx}'],
12
- extends: [
13
- js.configs.recommended,
14
- tseslint.configs.recommended,
15
- reactHooks.configs['recommended-latest'],
16
- reactRefresh.configs.vite,
17
- ],
18
- languageOptions: {
19
- ecmaVersion: 2020,
20
- globals: globals.browser,
21
- },
22
- },
23
- ])