@buoy-gg/core 1.7.5 → 1.7.8

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.
Files changed (75) hide show
  1. package/lib/commonjs/floatingMenu/AppHost.js +1 -1
  2. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.js +20 -8
  3. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.web.js +746 -0
  4. package/lib/commonjs/floatingMenu/FloatingDevTools.js +16 -4
  5. package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +154 -0
  6. package/lib/commonjs/floatingMenu/FloatingMenu.js +8 -8
  7. package/lib/commonjs/floatingMenu/autoDiscoverPresets.js +15 -0
  8. package/lib/commonjs/floatingMenu/defaultConfig.js +14 -7
  9. package/lib/commonjs/floatingMenu/dial/DialDevTools.js +8 -2
  10. package/lib/commonjs/floatingMenu/dial/DialDevTools.web.js +593 -0
  11. package/lib/commonjs/floatingMenu/dial/OnboardingTooltip.js +2 -2
  12. package/lib/commonjs/floatingMenu/floatingTools.web.js +357 -0
  13. package/lib/commonjs/index.js +2 -2
  14. package/lib/commonjs/index.web.js +131 -0
  15. package/lib/commonjs/utils/autoDiscoverPresets.web.js +181 -0
  16. package/lib/module/floatingMenu/AppHost.js +1 -1
  17. package/lib/module/floatingMenu/DevToolsSettingsModal.js +21 -9
  18. package/lib/module/floatingMenu/DevToolsSettingsModal.web.js +756 -0
  19. package/lib/module/floatingMenu/FloatingDevTools.js +17 -5
  20. package/lib/module/floatingMenu/FloatingDevTools.web.js +150 -0
  21. package/lib/module/floatingMenu/FloatingMenu.js +8 -8
  22. package/lib/module/floatingMenu/autoDiscoverPresets.js +15 -0
  23. package/lib/module/floatingMenu/defaultConfig.js +14 -7
  24. package/lib/module/floatingMenu/dial/DialDevTools.js +8 -2
  25. package/lib/module/floatingMenu/dial/DialDevTools.web.js +590 -0
  26. package/lib/module/floatingMenu/dial/OnboardingTooltip.js +2 -2
  27. package/lib/module/floatingMenu/floatingTools.web.js +357 -0
  28. package/lib/module/index.js +2 -2
  29. package/lib/module/index.web.js +24 -0
  30. package/lib/module/utils/autoDiscoverPresets.web.js +174 -0
  31. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts.map +1 -1
  32. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts +23 -0
  33. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts.map +1 -0
  34. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts +1 -1
  35. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts.map +1 -1
  36. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts +48 -0
  37. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts.map +1 -0
  38. package/lib/typescript/commonjs/floatingMenu/FloatingMenu.d.ts.map +1 -1
  39. package/lib/typescript/commonjs/floatingMenu/autoDiscoverPresets.d.ts.map +1 -1
  40. package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts +8 -7
  41. package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts.map +1 -1
  42. package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.d.ts.map +1 -1
  43. package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.web.d.ts +26 -0
  44. package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.web.d.ts.map +1 -0
  45. package/lib/typescript/commonjs/floatingMenu/dial/OnboardingTooltip.d.ts +1 -1
  46. package/lib/typescript/commonjs/floatingMenu/dial/OnboardingTooltip.d.ts.map +1 -1
  47. package/lib/typescript/commonjs/floatingMenu/floatingTools.web.d.ts +27 -0
  48. package/lib/typescript/commonjs/floatingMenu/floatingTools.web.d.ts.map +1 -0
  49. package/lib/typescript/commonjs/index.web.d.ts +20 -0
  50. package/lib/typescript/commonjs/index.web.d.ts.map +1 -0
  51. package/lib/typescript/commonjs/utils/autoDiscoverPresets.web.d.ts +58 -0
  52. package/lib/typescript/commonjs/utils/autoDiscoverPresets.web.d.ts.map +1 -0
  53. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts.map +1 -1
  54. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts +23 -0
  55. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts.map +1 -0
  56. package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts +1 -1
  57. package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts.map +1 -1
  58. package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts +48 -0
  59. package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts.map +1 -0
  60. package/lib/typescript/module/floatingMenu/FloatingMenu.d.ts.map +1 -1
  61. package/lib/typescript/module/floatingMenu/autoDiscoverPresets.d.ts.map +1 -1
  62. package/lib/typescript/module/floatingMenu/defaultConfig.d.ts +8 -7
  63. package/lib/typescript/module/floatingMenu/defaultConfig.d.ts.map +1 -1
  64. package/lib/typescript/module/floatingMenu/dial/DialDevTools.d.ts.map +1 -1
  65. package/lib/typescript/module/floatingMenu/dial/DialDevTools.web.d.ts +26 -0
  66. package/lib/typescript/module/floatingMenu/dial/DialDevTools.web.d.ts.map +1 -0
  67. package/lib/typescript/module/floatingMenu/dial/OnboardingTooltip.d.ts +1 -1
  68. package/lib/typescript/module/floatingMenu/dial/OnboardingTooltip.d.ts.map +1 -1
  69. package/lib/typescript/module/floatingMenu/floatingTools.web.d.ts +27 -0
  70. package/lib/typescript/module/floatingMenu/floatingTools.web.d.ts.map +1 -0
  71. package/lib/typescript/module/index.web.d.ts +20 -0
  72. package/lib/typescript/module/index.web.d.ts.map +1 -0
  73. package/lib/typescript/module/utils/autoDiscoverPresets.web.d.ts +58 -0
  74. package/lib/typescript/module/utils/autoDiscoverPresets.web.d.ts.map +1 -0
  75. package/package.json +5 -4
@@ -0,0 +1,746 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SettingsModal = SettingsModal;
7
+ var _react = require("react");
8
+ var _floatingToolsReact = require("@buoy-gg/floating-tools-react");
9
+ var _floatingToolsCore = require("@buoy-gg/floating-tools-core");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ /**
12
+ * DevToolsSettingsModal - Web renderer for the dev tools settings modal.
13
+ *
14
+ * Uses shared configuration and logic from @buoy-gg/floating-tools-react.
15
+ * Platform-specific: CSS, mouse events, web JSX.
16
+ *
17
+ * This follows the same pattern as DialDevTools - all colors, labels, descriptions,
18
+ * and styling constants come from the shared core package.
19
+ *
20
+ * @platform React DOM Web (Vite, CRA, Next.js, Electron)
21
+ */
22
+
23
+ // =============================
24
+ // Types
25
+ // =============================
26
+
27
+ // =============================
28
+ // Web Storage Adapter
29
+ // =============================
30
+
31
+ const webStorageAdapter = {
32
+ getItem: key => localStorage.getItem(key),
33
+ setItem: (key, value) => localStorage.setItem(key, value)
34
+ };
35
+
36
+ // =============================
37
+ // Icon Components (Web SVGs)
38
+ // =============================
39
+
40
+ const Laptop = ({
41
+ size = 24,
42
+ color = 'currentColor'
43
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
44
+ width: size,
45
+ height: size,
46
+ viewBox: "0 0 24 24",
47
+ fill: "none",
48
+ stroke: color,
49
+ strokeWidth: "2",
50
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
51
+ d: "M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16"
52
+ })
53
+ });
54
+ const Database = ({
55
+ size = 24,
56
+ color = 'currentColor'
57
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
58
+ width: size,
59
+ height: size,
60
+ viewBox: "0 0 24 24",
61
+ fill: "none",
62
+ stroke: color,
63
+ strokeWidth: "2",
64
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("ellipse", {
65
+ cx: "12",
66
+ cy: "5",
67
+ rx: "9",
68
+ ry: "3"
69
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
70
+ d: "M3 5V19A9 3 0 0 0 21 19V5"
71
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
72
+ d: "M3 12A9 3 0 0 0 21 12"
73
+ })]
74
+ });
75
+ const Wifi = ({
76
+ size = 24,
77
+ color = 'currentColor'
78
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
79
+ width: size,
80
+ height: size,
81
+ viewBox: "0 0 24 24",
82
+ fill: "none",
83
+ stroke: color,
84
+ strokeWidth: "2",
85
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
86
+ d: "M5 13a10 10 0 0 1 14 0"
87
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
88
+ d: "M8.5 16.5a5 5 0 0 1 7 0"
89
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
90
+ d: "M2 8.82a15 15 0 0 1 20 0"
91
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
92
+ x1: "12",
93
+ y1: "20",
94
+ x2: "12.01",
95
+ y2: "20"
96
+ })]
97
+ });
98
+ const Search = ({
99
+ size = 24,
100
+ color = 'currentColor'
101
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
102
+ width: size,
103
+ height: size,
104
+ viewBox: "0 0 24 24",
105
+ fill: "none",
106
+ stroke: color,
107
+ strokeWidth: "2",
108
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
109
+ cx: "11",
110
+ cy: "11",
111
+ r: "8"
112
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
113
+ d: "m21 21-4.3-4.3"
114
+ })]
115
+ });
116
+ const Map = ({
117
+ size = 24,
118
+ color = 'currentColor'
119
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
120
+ width: size,
121
+ height: size,
122
+ viewBox: "0 0 24 24",
123
+ fill: "none",
124
+ stroke: color,
125
+ strokeWidth: "2",
126
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
127
+ d: "M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"
128
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
129
+ d: "M15 5.764v15"
130
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
131
+ d: "M9 3.236v15"
132
+ })]
133
+ });
134
+ const Zap = ({
135
+ size = 24,
136
+ color = 'currentColor'
137
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
138
+ width: size,
139
+ height: size,
140
+ viewBox: "0 0 24 24",
141
+ fill: "none",
142
+ stroke: color,
143
+ strokeWidth: "2",
144
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
145
+ d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"
146
+ })
147
+ });
148
+ const Sparkles = ({
149
+ size = 24,
150
+ color = 'currentColor'
151
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
152
+ width: size,
153
+ height: size,
154
+ viewBox: "0 0 24 24",
155
+ fill: "none",
156
+ stroke: color,
157
+ strokeWidth: "2",
158
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
159
+ d: "M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"
160
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
161
+ d: "M20 3v4"
162
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
163
+ d: "M22 5h-4"
164
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
165
+ d: "M4 17v2"
166
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
167
+ d: "M5 18H3"
168
+ })]
169
+ });
170
+ const Square = ({
171
+ size = 24,
172
+ color = 'currentColor'
173
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
174
+ width: size,
175
+ height: size,
176
+ viewBox: "0 0 24 24",
177
+ fill: "none",
178
+ stroke: color,
179
+ strokeWidth: "2",
180
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("rect", {
181
+ width: "18",
182
+ height: "18",
183
+ x: "3",
184
+ y: "3",
185
+ rx: "2"
186
+ })
187
+ });
188
+ const AlertTriangle = ({
189
+ size = 24,
190
+ color = 'currentColor'
191
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
192
+ width: size,
193
+ height: size,
194
+ viewBox: "0 0 24 24",
195
+ fill: "none",
196
+ stroke: color,
197
+ strokeWidth: "2",
198
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
199
+ d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"
200
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
201
+ d: "M12 9v4"
202
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
203
+ d: "M12 17h.01"
204
+ })]
205
+ });
206
+ const SettingsIcon = ({
207
+ size = 24,
208
+ color = 'currentColor'
209
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
210
+ width: size,
211
+ height: size,
212
+ viewBox: "0 0 24 24",
213
+ fill: "none",
214
+ stroke: color,
215
+ strokeWidth: "2",
216
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
217
+ d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"
218
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
219
+ cx: "12",
220
+ cy: "12",
221
+ r: "3"
222
+ })]
223
+ });
224
+ function ChevronRightIcon() {
225
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
226
+ width: "18",
227
+ height: "18",
228
+ viewBox: "0 0 24 24",
229
+ fill: "none",
230
+ stroke: "currentColor",
231
+ strokeWidth: "2",
232
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
233
+ d: "M9 18l6-6-6-6"
234
+ })
235
+ });
236
+ }
237
+ function CloseIcon() {
238
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
239
+ width: "20",
240
+ height: "20",
241
+ viewBox: "0 0 24 24",
242
+ fill: "none",
243
+ stroke: "currentColor",
244
+ strokeWidth: "2",
245
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
246
+ d: "M18 6L6 18M6 6l12 12"
247
+ })
248
+ });
249
+ }
250
+
251
+ // Tool icon mapping using SVG components
252
+ function ToolIcon({
253
+ toolId,
254
+ color
255
+ }) {
256
+ const size = 16;
257
+ const iconMap = {
258
+ env: /*#__PURE__*/(0, _jsxRuntime.jsx)(Laptop, {
259
+ size: size,
260
+ color: color
261
+ }),
262
+ storage: /*#__PURE__*/(0, _jsxRuntime.jsx)(Database, {
263
+ size: size,
264
+ color: color
265
+ }),
266
+ network: /*#__PURE__*/(0, _jsxRuntime.jsx)(Wifi, {
267
+ size: size,
268
+ color: color
269
+ }),
270
+ query: /*#__PURE__*/(0, _jsxRuntime.jsx)(Search, {
271
+ size: size,
272
+ color: color
273
+ }),
274
+ 'route-events': /*#__PURE__*/(0, _jsxRuntime.jsx)(Map, {
275
+ size: size,
276
+ color: color
277
+ }),
278
+ routes: /*#__PURE__*/(0, _jsxRuntime.jsx)(Map, {
279
+ size: size,
280
+ color: color
281
+ }),
282
+ benchmark: /*#__PURE__*/(0, _jsxRuntime.jsx)(Zap, {
283
+ size: size,
284
+ color: color
285
+ }),
286
+ 'highlight-updates': /*#__PURE__*/(0, _jsxRuntime.jsx)(Sparkles, {
287
+ size: size,
288
+ color: color
289
+ }),
290
+ renders: /*#__PURE__*/(0, _jsxRuntime.jsx)(Sparkles, {
291
+ size: size,
292
+ color: color
293
+ }),
294
+ 'debug-borders': /*#__PURE__*/(0, _jsxRuntime.jsx)(Square, {
295
+ size: size,
296
+ color: color
297
+ }),
298
+ sentry: /*#__PURE__*/(0, _jsxRuntime.jsx)(AlertTriangle, {
299
+ size: size,
300
+ color: color
301
+ }),
302
+ environment: /*#__PURE__*/(0, _jsxRuntime.jsx)(SettingsIcon, {
303
+ size: size,
304
+ color: color
305
+ }),
306
+ redux: /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.ReduxIcon, {
307
+ size: size
308
+ })
309
+ };
310
+ return iconMap[toolId] || /*#__PURE__*/(0, _jsxRuntime.jsx)(SettingsIcon, {
311
+ size: size,
312
+ color: color
313
+ });
314
+ }
315
+
316
+ // =============================
317
+ // Tool Card Component
318
+ // =============================
319
+
320
+ function ToolCard({
321
+ toolId,
322
+ enabled,
323
+ disabled,
324
+ availableTools,
325
+ onToggle
326
+ }) {
327
+ const [isHovered, setIsHovered] = (0, _react.useState)(false);
328
+ const color = (0, _floatingToolsReact.getToolColor)(toolId);
329
+ const label = (0, _floatingToolsReact.getToolLabel)(toolId, availableTools);
330
+ const description = (0, _floatingToolsReact.getToolDescription)(toolId, availableTools);
331
+ const cardStyle = {
332
+ display: 'flex',
333
+ flexDirection: 'row',
334
+ alignItems: 'center',
335
+ gap: _floatingToolsReact.settingsStyles.cardInner.gap,
336
+ paddingTop: _floatingToolsReact.settingsStyles.card.paddingVertical,
337
+ paddingBottom: _floatingToolsReact.settingsStyles.card.paddingVertical,
338
+ paddingLeft: _floatingToolsReact.settingsStyles.card.paddingHorizontal,
339
+ paddingRight: _floatingToolsReact.settingsStyles.card.paddingHorizontal,
340
+ backgroundColor: _floatingToolsReact.settingsColors.cardBackground,
341
+ borderRadius: _floatingToolsReact.settingsStyles.card.borderRadius,
342
+ borderWidth: _floatingToolsReact.settingsStyles.card.borderWidth,
343
+ borderStyle: 'solid',
344
+ borderColor: isHovered && !disabled ? _floatingToolsReact.settingsColors.cardBorderHover : _floatingToolsReact.settingsColors.cardBorder,
345
+ marginBottom: _floatingToolsReact.settingsStyles.card.marginBottom,
346
+ cursor: disabled ? 'not-allowed' : 'pointer',
347
+ opacity: disabled ? 0.6 : 1,
348
+ transition: 'all 150ms ease',
349
+ boxShadow: enabled ? `0 0 6px ${color}33, 0 0 12px ${color}20` : 'none'
350
+ };
351
+ const toggleStyle = {
352
+ paddingLeft: _floatingToolsReact.settingsStyles.toggle.paddingHorizontal,
353
+ paddingRight: _floatingToolsReact.settingsStyles.toggle.paddingHorizontal,
354
+ paddingTop: _floatingToolsReact.settingsStyles.toggle.paddingVertical,
355
+ paddingBottom: _floatingToolsReact.settingsStyles.toggle.paddingVertical,
356
+ borderRadius: _floatingToolsReact.settingsStyles.toggle.borderRadius,
357
+ borderWidth: _floatingToolsReact.settingsStyles.toggle.borderWidth,
358
+ borderStyle: 'solid',
359
+ backgroundColor: enabled ? _floatingToolsReact.settingsColors.toggleOnBg(color) : _floatingToolsReact.settingsColors.toggleOffBg,
360
+ borderColor: enabled ? _floatingToolsReact.settingsColors.toggleOnBorder(color) : _floatingToolsReact.settingsColors.toggleOffBorder,
361
+ color: enabled ? color : _floatingToolsReact.settingsColors.toggleOffText,
362
+ fontSize: _floatingToolsReact.settingsStyles.toggle.fontSize,
363
+ fontWeight: _floatingToolsReact.settingsStyles.toggle.fontWeight,
364
+ cursor: disabled ? 'not-allowed' : 'pointer',
365
+ transition: 'all 150ms ease',
366
+ boxShadow: enabled ? `0 0 8px ${color}66` : 'none'
367
+ };
368
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
369
+ onClick: disabled ? undefined : onToggle,
370
+ onMouseEnter: () => setIsHovered(true),
371
+ onMouseLeave: () => setIsHovered(false),
372
+ style: cardStyle,
373
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
374
+ style: {
375
+ width: _floatingToolsReact.settingsStyles.iconContainer.width,
376
+ height: _floatingToolsReact.settingsStyles.iconContainer.height,
377
+ display: 'flex',
378
+ alignItems: 'center',
379
+ justifyContent: 'center'
380
+ },
381
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolIcon, {
382
+ toolId: toolId,
383
+ color: color
384
+ })
385
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
386
+ style: {
387
+ flex: 1,
388
+ minWidth: 0
389
+ },
390
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
391
+ style: {
392
+ color: _floatingToolsReact.settingsColors.text,
393
+ fontWeight: _floatingToolsReact.settingsStyles.toolName.fontWeight,
394
+ fontSize: _floatingToolsReact.settingsStyles.toolName.fontSize
395
+ },
396
+ children: [label, disabled && ' (MAX 6)']
397
+ }), description && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
398
+ style: {
399
+ color: _floatingToolsReact.settingsColors.textMuted,
400
+ fontSize: _floatingToolsReact.settingsStyles.toolDescription.fontSize,
401
+ overflow: 'hidden',
402
+ textOverflow: 'ellipsis',
403
+ whiteSpace: 'nowrap'
404
+ },
405
+ children: description
406
+ })]
407
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
408
+ onClick: e => {
409
+ e.stopPropagation();
410
+ if (!disabled) onToggle();
411
+ },
412
+ disabled: disabled,
413
+ style: toggleStyle,
414
+ children: enabled ? 'ON' : 'OFF'
415
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
416
+ style: {
417
+ color: _floatingToolsReact.settingsColors.textMuted
418
+ },
419
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronRightIcon, {})
420
+ })]
421
+ });
422
+ }
423
+
424
+ // =============================
425
+ // Main Component
426
+ // =============================
427
+
428
+ function SettingsModal({
429
+ visible,
430
+ onClose,
431
+ availableTools = [],
432
+ defaultFloatingTools,
433
+ defaultDialTools,
434
+ storage = webStorageAdapter,
435
+ onSettingsChange
436
+ }) {
437
+ const [activeTab, setActiveTab] = (0, _react.useState)('dial');
438
+ const [isExiting, setIsExiting] = (0, _react.useState)(false);
439
+
440
+ // Use the shared settings hook
441
+ const {
442
+ settings,
443
+ isLoading,
444
+ actions,
445
+ helpers
446
+ } = (0, _floatingToolsReact.useSettings)({
447
+ availableTools,
448
+ defaultFloatingTools,
449
+ defaultDialTools,
450
+ storage,
451
+ onSettingsChange
452
+ });
453
+
454
+ // Handle close with animation
455
+ const handleClose = (0, _react.useCallback)(() => {
456
+ setIsExiting(true);
457
+ setTimeout(() => {
458
+ setIsExiting(false);
459
+ onClose();
460
+ }, 200);
461
+ }, [onClose]);
462
+
463
+ // Escape key handler
464
+ (0, _react.useEffect)(() => {
465
+ if (!visible) return;
466
+ const handleKeyDown = e => {
467
+ if (e.key === 'Escape') {
468
+ handleClose();
469
+ }
470
+ };
471
+ document.addEventListener('keydown', handleKeyDown);
472
+ return () => document.removeEventListener('keydown', handleKeyDown);
473
+ }, [visible, handleClose]);
474
+ if (!visible) return null;
475
+
476
+ // Filter tabs - exclude 'pro' for now on web
477
+ const displayTabs = _floatingToolsReact.settingsTabs.filter(tab => tab.key !== 'pro');
478
+ const containerStyle = {
479
+ position: 'fixed',
480
+ inset: 0,
481
+ zIndex: 10000,
482
+ display: 'flex',
483
+ alignItems: 'center',
484
+ justifyContent: 'center'
485
+ };
486
+ const backdropStyle = {
487
+ position: 'absolute',
488
+ inset: 0,
489
+ backgroundColor: _floatingToolsReact.settingsColors.backdrop,
490
+ opacity: isExiting ? 0 : 1,
491
+ transition: 'opacity 200ms ease'
492
+ };
493
+ const modalStyle = {
494
+ position: 'relative',
495
+ width: '90%',
496
+ maxWidth: 450,
497
+ maxHeight: '80vh',
498
+ backgroundColor: _floatingToolsReact.settingsColors.panel,
499
+ borderRadius: 12,
500
+ border: `1px solid ${_floatingToolsReact.settingsColors.cardBorder}`,
501
+ boxShadow: `0 24px 48px rgba(0, 0, 0, 0.5), 0 0 24px ${_floatingToolsReact.settingsColors.info}20`,
502
+ display: 'flex',
503
+ flexDirection: 'column',
504
+ overflow: 'hidden',
505
+ transform: isExiting ? 'scale(0.95)' : 'scale(1)',
506
+ opacity: isExiting ? 0 : 1,
507
+ transition: 'transform 200ms ease, opacity 200ms ease'
508
+ };
509
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
510
+ role: "dialog",
511
+ "aria-label": "Settings",
512
+ "aria-modal": "true",
513
+ style: containerStyle,
514
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
515
+ role: "button",
516
+ "aria-label": "Close settings",
517
+ tabIndex: 0,
518
+ onClick: handleClose,
519
+ style: backdropStyle
520
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
521
+ style: modalStyle,
522
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
523
+ style: {
524
+ display: 'flex',
525
+ alignItems: 'center',
526
+ padding: '12px 16px',
527
+ borderBottom: `1px solid ${_floatingToolsReact.settingsColors.cardBorder}`
528
+ },
529
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
530
+ style: {
531
+ flex: 1,
532
+ display: 'flex',
533
+ backgroundColor: _floatingToolsReact.settingsColors.panel,
534
+ borderRadius: 6,
535
+ padding: 2,
536
+ border: `1px solid ${_floatingToolsReact.settingsColors.cardBorder}`
537
+ },
538
+ children: displayTabs.map(tab => {
539
+ const isActive = activeTab === tab.key;
540
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
541
+ onClick: () => setActiveTab(tab.key),
542
+ style: {
543
+ flex: 1,
544
+ paddingLeft: _floatingToolsReact.settingsStyles.tab.paddingHorizontal,
545
+ paddingRight: _floatingToolsReact.settingsStyles.tab.paddingHorizontal,
546
+ paddingTop: _floatingToolsReact.settingsStyles.tab.paddingVertical,
547
+ paddingBottom: _floatingToolsReact.settingsStyles.tab.paddingVertical,
548
+ borderRadius: _floatingToolsReact.settingsStyles.tab.borderRadius,
549
+ backgroundColor: isActive ? _floatingToolsReact.settingsColors.tabActiveBg : _floatingToolsReact.settingsColors.tabInactiveBg,
550
+ border: isActive ? `1px solid ${_floatingToolsReact.settingsColors.tabActiveBorder}40` : '1px solid transparent',
551
+ color: isActive ? _floatingToolsReact.settingsColors.info : _floatingToolsReact.settingsColors.tabInactiveText,
552
+ fontSize: _floatingToolsReact.settingsStyles.tab.fontSize,
553
+ fontWeight: _floatingToolsReact.settingsStyles.tab.fontWeight,
554
+ letterSpacing: _floatingToolsReact.settingsStyles.tab.letterSpacing,
555
+ cursor: 'pointer',
556
+ transition: 'all 150ms ease',
557
+ textTransform: 'uppercase',
558
+ fontFamily: 'monospace'
559
+ },
560
+ children: tab.label
561
+ }, tab.key);
562
+ })
563
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
564
+ "aria-label": "Close",
565
+ onClick: handleClose,
566
+ style: {
567
+ marginLeft: 12,
568
+ background: 'none',
569
+ border: 'none',
570
+ padding: 4,
571
+ cursor: 'pointer',
572
+ color: _floatingToolsReact.settingsColors.textMuted,
573
+ display: 'flex',
574
+ alignItems: 'center',
575
+ justifyContent: 'center'
576
+ },
577
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseIcon, {})
578
+ })]
579
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
580
+ style: {
581
+ flex: 1,
582
+ overflow: 'auto',
583
+ paddingTop: _floatingToolsReact.settingsStyles.scrollContent.paddingTop,
584
+ paddingBottom: _floatingToolsReact.settingsStyles.scrollContent.paddingBottom,
585
+ paddingLeft: _floatingToolsReact.settingsStyles.section.marginHorizontal,
586
+ paddingRight: _floatingToolsReact.settingsStyles.section.marginHorizontal
587
+ },
588
+ children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
589
+ style: {
590
+ display: 'flex',
591
+ alignItems: 'center',
592
+ justifyContent: 'center',
593
+ padding: 40,
594
+ color: _floatingToolsReact.settingsColors.textMuted
595
+ },
596
+ children: "Loading settings..."
597
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
598
+ children: [activeTab === 'dial' && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
599
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
600
+ style: {
601
+ fontSize: _floatingToolsReact.settingsStyles.sectionTitle.fontSize,
602
+ fontWeight: _floatingToolsReact.settingsStyles.sectionTitle.fontWeight,
603
+ letterSpacing: _floatingToolsReact.settingsStyles.sectionTitle.letterSpacing,
604
+ textTransform: _floatingToolsReact.settingsStyles.sectionTitle.textTransform,
605
+ color: _floatingToolsReact.settingsColors.textMuted,
606
+ marginBottom: _floatingToolsReact.settingsStyles.sectionHeader.marginBottom
607
+ },
608
+ children: ["SELECT UP TO ", _floatingToolsReact.MAX_SETTINGS_DIAL_SLOTS, " TOOLS (", helpers.dialToolCount, "/", _floatingToolsReact.MAX_SETTINGS_DIAL_SLOTS, ")"]
609
+ }), Object.entries(settings.dialTools).map(([id, enabled]) => {
610
+ const isDisabled = !enabled && helpers.isDialFull;
611
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolCard, {
612
+ toolId: id,
613
+ enabled: enabled,
614
+ disabled: isDisabled,
615
+ availableTools: availableTools,
616
+ onToggle: () => actions.toggleDialTool(id)
617
+ }, id);
618
+ })]
619
+ }), activeTab === 'floating' && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
620
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
621
+ style: {
622
+ fontSize: _floatingToolsReact.settingsStyles.sectionTitle.fontSize,
623
+ fontWeight: _floatingToolsReact.settingsStyles.sectionTitle.fontWeight,
624
+ letterSpacing: _floatingToolsReact.settingsStyles.sectionTitle.letterSpacing,
625
+ textTransform: _floatingToolsReact.settingsStyles.sectionTitle.textTransform,
626
+ color: _floatingToolsReact.settingsColors.textMuted,
627
+ marginBottom: _floatingToolsReact.settingsStyles.sectionHeader.marginBottom
628
+ },
629
+ children: "CONFIGURE FLOATING TOOLBAR ITEMS"
630
+ }), Object.entries(settings.floatingTools).map(([id, enabled]) => /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolCard, {
631
+ toolId: id,
632
+ enabled: enabled,
633
+ availableTools: availableTools,
634
+ onToggle: () => id === 'environment' ? actions.toggleEnvironment() : actions.toggleFloatingTool(id)
635
+ }, id))]
636
+ }), activeTab === 'settings' && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
637
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
638
+ style: {
639
+ fontSize: _floatingToolsReact.settingsStyles.sectionTitle.fontSize,
640
+ fontWeight: _floatingToolsReact.settingsStyles.sectionTitle.fontWeight,
641
+ letterSpacing: _floatingToolsReact.settingsStyles.sectionTitle.letterSpacing,
642
+ textTransform: _floatingToolsReact.settingsStyles.sectionTitle.textTransform,
643
+ color: _floatingToolsReact.settingsColors.textMuted,
644
+ marginBottom: _floatingToolsReact.settingsStyles.sectionHeader.marginBottom
645
+ },
646
+ children: "GLOBAL SETTINGS"
647
+ }), _floatingToolsReact.globalSettingsConfig.map(config => {
648
+ const value = settings.globalSettings?.[config.key] ?? false;
649
+ const color = _floatingToolsReact.settingsColors.success;
650
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
651
+ style: {
652
+ padding: 12,
653
+ backgroundColor: _floatingToolsReact.settingsColors.cardBackground,
654
+ borderRadius: 8,
655
+ border: `1px solid ${_floatingToolsReact.settingsColors.cardBorder}`,
656
+ marginBottom: 10
657
+ },
658
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
659
+ style: {
660
+ display: 'flex',
661
+ alignItems: 'center',
662
+ gap: 12
663
+ },
664
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
665
+ style: {
666
+ backgroundColor: `${_floatingToolsReact.settingsColors.info}20`,
667
+ border: `1px solid ${_floatingToolsReact.settingsColors.info}40`,
668
+ borderRadius: 4,
669
+ padding: '4px 8px'
670
+ },
671
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
672
+ style: {
673
+ fontSize: 10,
674
+ fontWeight: 700,
675
+ color: _floatingToolsReact.settingsColors.info,
676
+ letterSpacing: 0.5
677
+ },
678
+ children: config.category
679
+ })
680
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
681
+ style: {
682
+ flex: 1
683
+ },
684
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
685
+ style: {
686
+ fontFamily: 'monospace',
687
+ fontSize: 12,
688
+ fontWeight: 700,
689
+ color: _floatingToolsReact.settingsColors.text
690
+ },
691
+ children: config.label
692
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
693
+ style: {
694
+ fontSize: 10,
695
+ color: _floatingToolsReact.settingsColors.textMuted,
696
+ marginTop: 2
697
+ },
698
+ children: config.shortDescription
699
+ })]
700
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
701
+ onClick: () => actions.toggleGlobalSetting(config.key),
702
+ style: {
703
+ paddingLeft: _floatingToolsReact.settingsStyles.toggle.paddingHorizontal,
704
+ paddingRight: _floatingToolsReact.settingsStyles.toggle.paddingHorizontal,
705
+ paddingTop: _floatingToolsReact.settingsStyles.toggle.paddingVertical,
706
+ paddingBottom: _floatingToolsReact.settingsStyles.toggle.paddingVertical,
707
+ borderRadius: _floatingToolsReact.settingsStyles.toggle.borderRadius,
708
+ borderWidth: _floatingToolsReact.settingsStyles.toggle.borderWidth,
709
+ borderStyle: 'solid',
710
+ backgroundColor: value ? _floatingToolsReact.settingsColors.toggleOnBg(color) : _floatingToolsReact.settingsColors.toggleOffBg,
711
+ borderColor: value ? _floatingToolsReact.settingsColors.toggleOnBorder(color) : _floatingToolsReact.settingsColors.toggleOffBorder,
712
+ color: value ? color : _floatingToolsReact.settingsColors.toggleOffText,
713
+ fontSize: _floatingToolsReact.settingsStyles.toggle.fontSize,
714
+ fontWeight: _floatingToolsReact.settingsStyles.toggle.fontWeight,
715
+ cursor: 'pointer',
716
+ transition: 'all 150ms ease',
717
+ boxShadow: value ? `0 0 8px ${color}66` : 'none'
718
+ },
719
+ children: value ? 'ON' : 'OFF'
720
+ })]
721
+ })
722
+ }, config.key);
723
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
724
+ onClick: () => actions.resetToDefaults(),
725
+ style: {
726
+ width: '100%',
727
+ padding: '12px 16px',
728
+ marginTop: 8,
729
+ borderRadius: 6,
730
+ border: `1px solid ${_floatingToolsReact.settingsColors.error}40`,
731
+ backgroundColor: `${_floatingToolsReact.settingsColors.error}15`,
732
+ color: _floatingToolsReact.settingsColors.error,
733
+ fontSize: 12,
734
+ fontWeight: 700,
735
+ letterSpacing: 0.5,
736
+ cursor: 'pointer',
737
+ transition: 'all 150ms ease'
738
+ },
739
+ children: "CLEAR ALL SETTINGS"
740
+ })]
741
+ })]
742
+ })
743
+ })]
744
+ })]
745
+ });
746
+ }