@buoy-gg/core 7.0.40 → 7.0.41

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 (140) hide show
  1. package/README.md +10 -0
  2. package/bin/buoy.js +25 -31
  3. package/lib/commonjs/browserRegister.js +48 -0
  4. package/lib/commonjs/browserRegister.server.js +10 -0
  5. package/lib/commonjs/floatingMenu/AppHost.web.js +71 -59
  6. package/lib/commonjs/floatingMenu/BrowserToolRuntime.js +150 -0
  7. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.js +10 -1111
  8. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.shared.js +1114 -0
  9. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.web.js +28 -1028
  10. package/lib/commonjs/floatingMenu/FloatingDevTools.js +7 -2
  11. package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +54 -40
  12. package/lib/commonjs/floatingMenu/MinimizedToolsStack.web.js +8 -2
  13. package/lib/commonjs/floatingMenu/autoDiscoverPresets.js +10 -0
  14. package/lib/commonjs/floatingMenu/autoExternalSync.js +9 -0
  15. package/lib/commonjs/floatingMenu/dial/DialDevTools.web.js +86 -12
  16. package/lib/commonjs/floatingMenu/dial/DialIcon.js +4 -2
  17. package/lib/commonjs/floatingMenu/settingsBus.js +6 -17
  18. package/lib/commonjs/floatingMenu/useDesktopSyncStatus.web.js +14 -0
  19. package/lib/commonjs/index.web.js +92 -1
  20. package/lib/commonjs/reactDevtoolsTypes.js +1 -0
  21. package/lib/commonjs/utils/autoDiscoverPresets.web.js +5 -178
  22. package/lib/commonjs/utils/createWebTool.js +20 -0
  23. package/lib/commonjs/utils/createWebTools.js +30 -0
  24. package/lib/commonjs/version.js +1 -1
  25. package/lib/module/browserRegister.js +44 -0
  26. package/lib/module/browserRegister.server.js +6 -0
  27. package/lib/module/floatingMenu/AppHost.web.js +71 -59
  28. package/lib/module/floatingMenu/BrowserToolRuntime.js +146 -0
  29. package/lib/module/floatingMenu/DevToolsSettingsModal.js +1 -1113
  30. package/lib/module/floatingMenu/DevToolsSettingsModal.shared.js +1110 -0
  31. package/lib/module/floatingMenu/DevToolsSettingsModal.web.js +32 -1043
  32. package/lib/module/floatingMenu/FloatingDevTools.js +7 -2
  33. package/lib/module/floatingMenu/FloatingDevTools.web.js +55 -42
  34. package/lib/module/floatingMenu/MinimizedToolsStack.web.js +8 -2
  35. package/lib/module/floatingMenu/autoDiscoverPresets.js +10 -0
  36. package/lib/module/floatingMenu/autoExternalSync.js +9 -0
  37. package/lib/module/floatingMenu/dial/DialDevTools.web.js +87 -14
  38. package/lib/module/floatingMenu/dial/DialIcon.js +4 -2
  39. package/lib/module/floatingMenu/settingsBus.js +1 -17
  40. package/lib/module/floatingMenu/useDesktopSyncStatus.web.js +10 -0
  41. package/lib/module/index.web.js +8 -1
  42. package/lib/module/reactDevtoolsTypes.js +1 -0
  43. package/lib/module/utils/autoDiscoverPresets.web.js +5 -180
  44. package/lib/module/utils/createWebTool.js +17 -0
  45. package/lib/module/utils/createWebTools.js +25 -0
  46. package/lib/module/version.js +1 -1
  47. package/lib/typescript/commonjs/browserRegister.d.ts +5 -0
  48. package/lib/typescript/commonjs/browserRegister.d.ts.map +1 -0
  49. package/lib/typescript/commonjs/browserRegister.server.d.ts +5 -0
  50. package/lib/typescript/commonjs/browserRegister.server.d.ts.map +1 -0
  51. package/lib/typescript/commonjs/floatingMenu/AppHost.web.d.ts +3 -3
  52. package/lib/typescript/commonjs/floatingMenu/AppHost.web.d.ts.map +1 -1
  53. package/lib/typescript/commonjs/floatingMenu/BrowserToolRuntime.d.ts +14 -0
  54. package/lib/typescript/commonjs/floatingMenu/BrowserToolRuntime.d.ts.map +1 -0
  55. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts +2 -67
  56. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts.map +1 -1
  57. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.shared.d.ts +71 -0
  58. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.shared.d.ts.map +1 -0
  59. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts +3 -16
  60. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts.map +1 -1
  61. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts.map +1 -1
  62. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts +12 -6
  63. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts.map +1 -1
  64. package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.web.d.ts.map +1 -1
  65. package/lib/typescript/commonjs/floatingMenu/autoDiscoverPresets.d.ts.map +1 -1
  66. package/lib/typescript/commonjs/floatingMenu/autoExternalSync.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts +1 -1
  68. package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.web.d.ts.map +1 -1
  70. package/lib/typescript/commonjs/floatingMenu/dial/DialIcon.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/floatingMenu/settingsBus.d.ts +1 -9
  72. package/lib/typescript/commonjs/floatingMenu/settingsBus.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/floatingMenu/useDesktopSyncStatus.web.d.ts +3 -0
  74. package/lib/typescript/commonjs/floatingMenu/useDesktopSyncStatus.web.d.ts.map +1 -0
  75. package/lib/typescript/commonjs/index.web.d.ts +6 -0
  76. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/reactDevtoolsTypes.d.ts +8 -0
  78. package/lib/typescript/commonjs/reactDevtoolsTypes.d.ts.map +1 -0
  79. package/lib/typescript/commonjs/utils/autoDiscoverPresets.web.d.ts +3 -40
  80. package/lib/typescript/commonjs/utils/autoDiscoverPresets.web.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/utils/createWebTool.d.ts +6 -0
  82. package/lib/typescript/commonjs/utils/createWebTool.d.ts.map +1 -0
  83. package/lib/typescript/commonjs/utils/createWebTools.d.ts +4 -0
  84. package/lib/typescript/commonjs/utils/createWebTools.d.ts.map +1 -0
  85. package/lib/typescript/commonjs/version.d.ts +1 -1
  86. package/lib/typescript/module/browserRegister.d.ts +5 -0
  87. package/lib/typescript/module/browserRegister.d.ts.map +1 -0
  88. package/lib/typescript/module/browserRegister.server.d.ts +5 -0
  89. package/lib/typescript/module/browserRegister.server.d.ts.map +1 -0
  90. package/lib/typescript/module/floatingMenu/AppHost.web.d.ts +3 -3
  91. package/lib/typescript/module/floatingMenu/AppHost.web.d.ts.map +1 -1
  92. package/lib/typescript/module/floatingMenu/BrowserToolRuntime.d.ts +14 -0
  93. package/lib/typescript/module/floatingMenu/BrowserToolRuntime.d.ts.map +1 -0
  94. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts +2 -67
  95. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts.map +1 -1
  96. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.shared.d.ts +71 -0
  97. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.shared.d.ts.map +1 -0
  98. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts +3 -16
  99. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts.map +1 -1
  100. package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts.map +1 -1
  101. package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts +12 -6
  102. package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts.map +1 -1
  103. package/lib/typescript/module/floatingMenu/MinimizedToolsStack.web.d.ts.map +1 -1
  104. package/lib/typescript/module/floatingMenu/autoDiscoverPresets.d.ts.map +1 -1
  105. package/lib/typescript/module/floatingMenu/autoExternalSync.d.ts.map +1 -1
  106. package/lib/typescript/module/floatingMenu/defaultConfig.d.ts +1 -1
  107. package/lib/typescript/module/floatingMenu/defaultConfig.d.ts.map +1 -1
  108. package/lib/typescript/module/floatingMenu/dial/DialDevTools.web.d.ts.map +1 -1
  109. package/lib/typescript/module/floatingMenu/dial/DialIcon.d.ts.map +1 -1
  110. package/lib/typescript/module/floatingMenu/settingsBus.d.ts +1 -9
  111. package/lib/typescript/module/floatingMenu/settingsBus.d.ts.map +1 -1
  112. package/lib/typescript/module/floatingMenu/useDesktopSyncStatus.web.d.ts +3 -0
  113. package/lib/typescript/module/floatingMenu/useDesktopSyncStatus.web.d.ts.map +1 -0
  114. package/lib/typescript/module/index.web.d.ts +6 -0
  115. package/lib/typescript/module/index.web.d.ts.map +1 -1
  116. package/lib/typescript/module/reactDevtoolsTypes.d.ts +8 -0
  117. package/lib/typescript/module/reactDevtoolsTypes.d.ts.map +1 -0
  118. package/lib/typescript/module/utils/autoDiscoverPresets.web.d.ts +3 -40
  119. package/lib/typescript/module/utils/autoDiscoverPresets.web.d.ts.map +1 -1
  120. package/lib/typescript/module/utils/createWebTool.d.ts +6 -0
  121. package/lib/typescript/module/utils/createWebTool.d.ts.map +1 -0
  122. package/lib/typescript/module/utils/createWebTools.d.ts +4 -0
  123. package/lib/typescript/module/utils/createWebTools.d.ts.map +1 -0
  124. package/lib/typescript/module/version.d.ts +1 -1
  125. package/lib/web/chunks/chunk-5NZOQR6Q.mjs +2 -0
  126. package/lib/web/chunks/chunk-CGDSLLZF.mjs +2 -0
  127. package/lib/web/chunks/chunk-DCJDUSNR.mjs +2 -0
  128. package/lib/web/chunks/chunk-IDSHFS6G.mjs +2 -0
  129. package/lib/web/chunks/chunk-JOAMJGCS.mjs +2 -0
  130. package/lib/web/chunks/chunk-KYKZ2N52.mjs +2 -0
  131. package/lib/web/chunks/chunk-NGM7JGGS.mjs +2 -0
  132. package/lib/web/chunks/chunk-QZDVCMCT.mjs +2 -0
  133. package/lib/web/chunks/chunk-R7RGRTY5.mjs +2 -0
  134. package/lib/web/chunks/chunk-Z3XWDDIO.mjs +2 -0
  135. package/lib/web/chunks/chunk-ZTGQ6TTY.mjs +2 -0
  136. package/lib/web/index.mjs +11 -0
  137. package/lib/web/register-server.mjs +2 -0
  138. package/lib/web/register.mjs +2 -0
  139. package/lib/web/toolkit.mjs +2 -0
  140. package/package.json +50 -12
@@ -5,1044 +5,44 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.SettingsModal = SettingsModal;
7
7
  var _react = require("react");
8
- var _floatingToolsReact = require("@buoy-gg/floating-tools-react");
9
- var _floatingToolsCore = require("@buoy-gg/floating-tools-core");
10
8
  var _sharedUi = require("@buoy-gg/shared-ui");
9
+ var _DevToolsSettingsModalShared = require("./DevToolsSettingsModal.shared.js");
10
+ var _DefaultConfigContext = require("./DefaultConfigContext.js");
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
- /**
13
- * DevToolsSettingsModal - Web renderer for the dev tools settings modal.
14
- *
15
- * Uses shared configuration and logic from @buoy-gg/floating-tools-react.
16
- * Platform-specific: CSS, mouse events, web JSX.
17
- *
18
- * VISUAL PARITY: styled 1:1 against the native reference
19
- * (devtools-floating-menu/src/floatingMenu/DevToolsSettingsModal.tsx, which
20
- * renders in the "night" language — shared-ui's ui/night Everlights port —
21
- * inside JsModal variant="night"). shared-ui is RN-only, so the night tokens
22
- * and primitive styles are inlined below with provenance comments.
23
- *
24
- * @platform React DOM Web (Vite, CRA, Next.js, Electron)
25
- */
26
-
27
- // JsModal.web + storage keys via the consumer's shared-ui web shim — the
28
- // settings sheet is a real JsModal on web now, same as native. The
29
- // BackgroundSwitcher is the same RN component native mounts: it renders under
30
- // the consumer's RNW lane exactly like the ToolBackground JsModal.web draws.
31
-
32
- /** env(safe-area-inset-top) via a one-shot probe (native: useSafeAreaInsets). */function readTopSafeAreaInset() {
33
- if (typeof document === 'undefined') return 0;
34
- const probe = document.createElement('div');
35
- probe.style.cssText = 'position:fixed;top:env(safe-area-inset-top);visibility:hidden;pointer-events:none';
36
- document.body.appendChild(probe);
37
- const top = probe.getBoundingClientRect().top;
38
- document.body.removeChild(probe);
39
- return Math.max(0, top);
40
- }
41
-
42
- // =============================
43
- // Night tokens (provenance)
44
- // =============================
45
-
46
- /**
47
- * `night` from @buoy-gg/shared-ui (ui/night/nightTheme.ts) — the Everlights
48
- * palette the native settings modal is styled with. shared-ui cannot be
49
- * imported on web, so the values are inlined verbatim.
50
- */
51
- const night = {
52
- bg: '#050505',
53
- surface: '#0C0C0C',
54
- surfaceElevated: '#161618',
55
- border: '#1A1A1C',
56
- separator: 'rgba(255, 255, 255, 0.08)',
57
- glass: 'rgba(5, 5, 5, 0.50)',
58
- glassElevated: 'rgba(255, 255, 255, 0.06)',
59
- glassBorder: 'rgba(255, 255, 255, 0.07)',
60
- fillTertiary: 'rgba(255, 255, 255, 0.12)',
61
- buttonSurface: 'rgba(8, 10, 14, 0.85)',
62
- button: '#1C1C1C',
63
- buttonPressed: '#2C2C2E',
64
- text: '#ECEDEE',
65
- textSecondary: '#9BA1A6',
66
- textTertiary: '#636366',
67
- placeholder: 'rgba(255, 255, 255, 0.30)',
68
- accent: '#20C997',
69
- accentSoft: 'rgba(32, 201, 151, 0.12)',
70
- accentFill: 'rgba(32, 201, 151, 0.18)',
71
- accentBorderStrong: 'rgba(32, 201, 151, 0.35)',
72
- onAccent: '#000000',
73
- danger: '#FF3B30',
74
- dangerSoft: 'rgba(255, 59, 48, 0.10)',
75
- warning: '#FF8329',
76
- warningSoft: 'rgba(255, 131, 41, 0.12)',
77
- fillSecondary: 'rgba(255, 255, 255, 0.08)',
78
- knob: '#D4D8DC'
79
- };
80
-
81
- // =============================
82
- // Types
83
- // =============================
84
-
85
- // =============================
86
- // Web Storage Adapter
87
- // =============================
88
-
89
- const webStorageAdapter = {
90
- getItem: key => localStorage.getItem(key),
91
- setItem: (key, value) => localStorage.setItem(key, value)
92
- };
93
-
94
- // =============================
95
- // Icon Components (Web SVGs)
96
- // =============================
97
-
98
- /** Fallback for shared-ui Layers icon (native debug-borders row icon). */
99
- const Layers = ({
100
- size = 24,
101
- color = 'currentColor'
102
- }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
103
- width: size,
104
- height: size,
105
- viewBox: "0 0 24 24",
106
- fill: "none",
107
- stroke: color,
108
- strokeWidth: "2",
109
- strokeLinecap: "round",
110
- strokeLinejoin: "round",
111
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
112
- d: "M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"
113
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
114
- d: "m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"
115
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
116
- d: "m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"
117
- })]
118
- });
119
-
120
- /** Fallback for shared-ui RenderCountIcon (native highlight-updates row icon). */
121
- const Sparkles = ({
122
- size = 24,
123
- color = 'currentColor'
124
- }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
125
- width: size,
126
- height: size,
127
- viewBox: "0 0 24 24",
128
- fill: "none",
129
- stroke: color,
130
- strokeWidth: "2",
131
- strokeLinecap: "round",
132
- strokeLinejoin: "round",
133
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
134
- 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"
135
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
136
- d: "M20 3v4"
137
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
138
- d: "M22 5h-4"
139
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
140
- d: "M4 17v2"
141
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
142
- d: "M5 18H3"
143
- })]
144
- });
145
-
146
- /** shared-ui Info icon (native default tool icon). */
147
- const Info = ({
148
- size = 24,
149
- color = 'currentColor'
150
- }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
151
- width: size,
152
- height: size,
153
- viewBox: "0 0 24 24",
154
- fill: "none",
155
- stroke: color,
156
- strokeWidth: "2",
157
- strokeLinecap: "round",
158
- strokeLinejoin: "round",
159
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
160
- cx: "12",
161
- cy: "12",
162
- r: "10"
163
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
164
- d: "M12 16v-4"
165
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
166
- d: "M12 8h.01"
167
- })]
168
- });
169
-
170
- /** shared-ui CheckCircle2 icon (clear-success feedback). */
171
- const CheckCircle2 = ({
172
- size = 24,
173
- color = 'currentColor'
174
- }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
175
- width: size,
176
- height: size,
177
- viewBox: "0 0 24 24",
178
- fill: "none",
179
- stroke: color,
180
- strokeWidth: "2",
181
- strokeLinecap: "round",
182
- strokeLinejoin: "round",
183
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
184
- cx: "12",
185
- cy: "12",
186
- r: "10"
187
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
188
- d: "m9 12 2 2 4-4"
189
- })]
190
- });
191
-
192
- /** shared-ui Trash2 icon (native Clear All Settings button icon). */
193
- const Trash2 = ({
194
- size = 24,
195
- color = 'currentColor'
196
- }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
197
- width: size,
198
- height: size,
199
- viewBox: "0 0 24 24",
200
- fill: "none",
201
- stroke: color,
202
- strokeWidth: "2",
203
- strokeLinecap: "round",
204
- strokeLinejoin: "round",
205
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
206
- d: "M3 6h18"
207
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
208
- d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"
209
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
210
- d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"
211
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
212
- x1: "10",
213
- x2: "10",
214
- y1: "11",
215
- y2: "17"
216
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
217
- x1: "14",
218
- x2: "14",
219
- y1: "11",
220
- y2: "17"
221
- })]
222
- });
223
- function ChevronRightIcon({
224
- size = 16,
225
- color = 'currentColor'
226
- }) {
227
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
228
- width: size,
229
- height: size,
230
- viewBox: "0 0 24 24",
231
- fill: "none",
232
- stroke: color,
233
- strokeWidth: "2",
234
- strokeLinecap: "round",
235
- strokeLinejoin: "round",
236
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
237
- d: "M9 18l6-6-6-6"
238
- })
239
- });
240
- }
241
- function ChevronDownIcon({
242
- size = 16,
243
- color = 'currentColor'
244
- }) {
245
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
246
- width: size,
247
- height: size,
248
- viewBox: "0 0 24 24",
249
- fill: "none",
250
- stroke: color,
251
- strokeWidth: "2",
252
- strokeLinecap: "round",
253
- strokeLinejoin: "round",
254
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
255
- d: "m6 9 6 6 6-6"
256
- })
257
- });
258
- }
259
-
260
- /**
261
- * Tool icon mapping — mirrors the native getToolIcon() switch in
262
- * DevToolsSettingsModal.tsx (size 18 in the night rows). Real tool icons come
263
- * from floating-tools-core (web-compatible); shared-ui-only icons use the
264
- * closest web SVG fallback.
265
- */
266
- function ToolIcon({
267
- toolId,
268
- tool
269
- }) {
270
- const size = 18; // native: getToolIcon renders all icons at size 18
271
- switch (toolId) {
272
- case 'query':
273
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.QueryIcon, {
274
- size: size
275
- });
276
- case 'env':
277
- case 'environment':
278
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.EnvIcon, {
279
- size: size
280
- });
281
- case 'sentry':
282
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.SentryIcon, {
283
- size: size,
284
- color: "#9945FF"
285
- });
286
- case 'storage':
287
- // native passes bgColor=night surface for the BIF knock-out parts
288
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.StorageIcon, {
289
- size: size,
290
- bgColor: night.surface
291
- });
292
- case 'wifi':
293
- case 'query-wifi-toggle':
294
- // native: WifiCircuitIcon colorPreset="green" (shared-ui only)
295
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.WifiIcon, {
296
- size: size
297
- });
298
- case 'route-events':
299
- case 'routes':
300
- // web alias for the same tool
301
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.RoutesIcon, {
302
- size: size,
303
- bgColor: night.surface
304
- });
305
- case 'network':
306
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.NetworkIcon, {
307
- size: size
308
- });
309
- case 'debug-borders':
310
- // native: Layers size 18 color night accent
311
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Layers, {
312
- size: size,
313
- color: night.accent
314
- });
315
- case 'highlight-updates':
316
- // native: RenderCountIcon size 18 color night accent
317
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Sparkles, {
318
- size: size,
319
- color: night.accent
320
- });
321
- case 'highlight-updates-modal':
322
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.HighlighterIcon, {
323
- size: size
324
- });
325
- case 'redux':
326
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.ReduxIcon, {
327
- size: size
328
- });
329
- case 'image-overlay':
330
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.ImageOverlayIcon, {
331
- size: size
332
- });
333
- case 'events':
334
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.EventsIcon, {
335
- size: size
336
- });
337
- case 'zustand':
338
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.ZustandIcon, {
339
- size: size
340
- });
341
- case 'jotai':
342
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.JotaiIcon, {
343
- size: size
344
- });
345
- default:
346
- {
347
- // Tools without a hardcoded glyph (console, images, time machine,
348
- // perf monitor, custom toolkit tools, …) render their own icon —
349
- // mirrors the native getToolIcon() renderAppIcon fallback.
350
- if (typeof tool?.icon === 'function') {
351
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
352
- children: tool.icon(size)
353
- });
354
- }
355
- if (typeof tool?.icon === 'string') {
356
- // Web twin of native AppTextIcon: short labels/emoji auto-fit the slot.
357
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
358
- style: {
359
- maxWidth: size * 1.6,
360
- overflow: 'hidden',
361
- whiteSpace: 'nowrap',
362
- fontSize: tool.icon.length <= 2 ? size * 0.7 : 10,
363
- fontWeight: 800,
364
- letterSpacing: 0.5,
365
- textAlign: 'center',
366
- color: tool.color ?? night.textSecondary
367
- },
368
- children: tool.icon
369
- });
370
- }
371
- // native: Info size 18 color night textSecondary
372
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Info, {
373
- size: size,
374
- color: night.textSecondary
375
- });
376
- }
377
- }
378
- }
379
-
380
- // =============================
381
- // Night primitives (DOM twins of shared-ui ui/night/primitives.tsx)
382
- // =============================
383
-
384
- /** native NightSectionLabel: 12/600/ls0.8 uppercase, mb 8, ml 4 */
385
- function SectionLabel({
386
- children
387
- }) {
388
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
389
- style: {
390
- color: night.textSecondary,
391
- fontSize: 12,
392
- fontWeight: 600,
393
- letterSpacing: 0.8,
394
- textTransform: 'uppercase',
395
- marginBottom: 8,
396
- marginLeft: 4
397
- },
398
- children: children
399
- });
400
- }
401
-
402
- /** native NightFootnote: 13/500 textTertiary, mt 8, ml 4 */
403
- function Footnote({
404
- children,
405
- tone = 'tertiary'
406
- }) {
407
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
408
- style: {
409
- color: tone === 'warning' ? night.warning : tone === 'danger' ? night.danger : night.textTertiary,
410
- fontSize: 13,
411
- fontWeight: 500,
412
- lineHeight: '18px',
413
- marginTop: 8,
414
- marginLeft: 4
415
- },
416
- children: children
417
- });
418
- }
419
-
420
- /** native NightCard glass: 50% black, radius 14, 1px white-alpha hairline, clipped */
421
- const cardStyle = {
422
- backgroundColor: night.glass,
423
- borderRadius: 14,
424
- border: `1px solid ${night.glassBorder}`,
425
- overflow: 'hidden'
426
- };
427
-
428
- /** native NightSeparator: hairline inset 16 */
429
- function Separator({
430
- inset = 16
431
- }) {
432
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
433
- style: {
434
- height: 1,
435
- transform: 'scaleY(0.5)',
436
- // hairline
437
- marginLeft: inset,
438
- backgroundColor: night.separator
439
- }
440
- });
441
- }
442
-
443
- /** native NightSwitch: 56×32 track, 22px thumb, 24px travel, 200ms */
444
- function NightSwitch({
445
- value,
446
- onChange,
447
- disabled
448
- }) {
449
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
450
- role: "switch",
451
- "aria-checked": value,
452
- disabled: disabled,
453
- onClick: e => {
454
- e.stopPropagation();
455
- if (!disabled) onChange();
456
- },
457
- style: {
458
- width: 56,
459
- height: 32,
460
- borderRadius: 16,
461
- border: `1px solid ${value ? night.accentBorderStrong : night.fillTertiary}`,
462
- backgroundColor: value ? night.accentFill : night.surfaceElevated,
463
- padding: 0,
464
- position: 'relative',
465
- cursor: disabled ? 'not-allowed' : 'pointer',
466
- opacity: disabled ? 0.4 : 1,
467
- flexShrink: 0,
468
- boxSizing: 'border-box',
469
- transition: 'background-color 200ms ease, border-color 200ms ease'
470
- },
471
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
472
- style: {
473
- position: 'absolute',
474
- top: 4,
475
- left: 4,
476
- width: 22,
477
- height: 22,
478
- borderRadius: 11,
479
- backgroundColor: value ? night.accent : night.knob,
480
- transform: value ? 'translateX(24px)' : 'translateX(0)',
481
- transition: 'transform 200ms ease, background-color 200ms ease'
482
- }
483
- })
484
- });
485
- }
486
-
487
- /** native NightBadge: uppercase 11/600 cap on a soft tint */
488
- function Badge({
489
- label,
490
- tone = 'neutral'
491
- }) {
492
- const bg = tone === 'accent' ? night.accentSoft : tone === 'warning' ? night.warningSoft : tone === 'danger' ? night.dangerSoft : night.fillSecondary;
493
- const color = tone === 'accent' ? night.accent : tone === 'warning' ? night.warning : tone === 'danger' ? night.danger : night.textSecondary;
494
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
495
- style: {
496
- padding: '4px 8px',
497
- borderRadius: 6,
498
- backgroundColor: bg,
499
- color,
500
- fontSize: 11,
501
- fontWeight: 600,
502
- letterSpacing: 0.5,
503
- textTransform: 'uppercase',
504
- flexShrink: 0
505
- },
506
- children: label
507
- });
508
- }
509
-
510
- /** native NightButton size md: 34pt, radius 17, plate or accent fill */
511
- function NightButton({
512
- label,
513
- onClick,
514
- variant = 'secondary',
515
- icon,
516
- disabled
517
- }) {
518
- const color = variant === 'primary' ? night.onAccent : variant === 'destructive' ? night.danger : night.accent;
519
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
520
- onClick: onClick,
521
- disabled: disabled,
522
- style: {
523
- width: '100%',
524
- height: 34,
525
- borderRadius: 17,
526
- border: 'none',
527
- display: 'flex',
528
- alignItems: 'center',
529
- justifyContent: 'center',
530
- gap: 8,
531
- backgroundColor: variant === 'primary' ? night.accent : night.button,
532
- color,
533
- fontSize: 15,
534
- fontWeight: 600,
535
- fontFamily: 'inherit',
536
- cursor: disabled ? 'not-allowed' : 'pointer',
537
- opacity: disabled ? 0.4 : 1,
538
- transition: 'background-color 150ms ease, opacity 150ms ease'
539
- },
540
- children: [icon, label]
541
- });
542
- }
543
-
544
- // =============================
545
- // Row styles (native styles.settingRow / toolRow / rowLabel / rowCaption)
546
- // =============================
547
-
548
- const settingRowStyle = {
549
- display: 'flex',
550
- flexDirection: 'row',
551
- alignItems: 'center',
552
- gap: 10,
553
- padding: '14px 16px',
554
- minHeight: 52,
555
- boxSizing: 'border-box',
556
- cursor: 'pointer'
557
- };
558
- const rowLabelStyle = {
559
- color: night.text,
560
- fontSize: 15,
561
- fontWeight: 500
562
- };
563
- const rowCaptionStyle = {
564
- color: night.textTertiary,
565
- fontSize: 12,
566
- overflow: 'hidden',
567
- textOverflow: 'ellipsis',
568
- whiteSpace: 'nowrap'
569
- };
570
-
571
- // =============================
572
- // Tool Row (native renderToolRow)
573
- // =============================
574
-
575
- function ToolRow({
576
- toolId,
577
- enabled,
578
- disabled,
579
- availableTools,
580
- onToggle
581
- }) {
582
- const label = (0, _floatingToolsReact.getToolLabel)(toolId, availableTools);
583
- const description = (0, _floatingToolsReact.getToolDescription)(toolId, availableTools);
584
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
585
- onClick: disabled ? undefined : onToggle,
586
- style: {
587
- // native styles.toolRow: gap 12, px 16, py 12
588
- display: 'flex',
589
- flexDirection: 'row',
590
- alignItems: 'center',
591
- gap: 12,
592
- padding: '12px 16px',
593
- cursor: disabled ? 'not-allowed' : 'pointer',
594
- opacity: disabled ? 0.4 : 1
595
- },
596
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
597
- style: {
598
- width: 24,
599
- display: 'flex',
600
- alignItems: 'center',
601
- justifyContent: 'center',
602
- flexShrink: 0
603
- },
604
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolIcon, {
605
- toolId: toolId,
606
- tool: availableTools?.find(t => t.id === toolId)
607
- })
608
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
609
- style: {
610
- flex: 1,
611
- minWidth: 0,
612
- display: 'flex',
613
- flexDirection: 'column',
614
- gap: 2
615
- },
616
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
617
- style: rowLabelStyle,
618
- children: [label, disabled && ' · max 6']
619
- }), description ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
620
- style: rowCaptionStyle,
621
- children: description
622
- }) : null]
623
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(NightSwitch, {
624
- value: enabled,
625
- disabled: disabled,
626
- onChange: onToggle
627
- })]
628
- });
629
- }
630
-
631
- // =============================
632
- // Global Setting Row (native renderGlobalSettingRow)
633
- // =============================
634
-
635
- function GlobalSettingRow({
636
- label,
637
- shortDescription,
638
- fullDescription,
639
- recommendation,
640
- value,
641
- onToggle
642
- }) {
643
- const [isExpanded, setIsExpanded] = (0, _react.useState)(false);
644
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
645
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
646
- onClick: () => setIsExpanded(v => !v),
647
- style: settingRowStyle,
648
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
649
- style: {
650
- flex: 1,
651
- minWidth: 0,
652
- display: 'flex',
653
- flexDirection: 'column',
654
- gap: 2
655
- },
656
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
657
- style: rowLabelStyle,
658
- children: label
659
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
660
- style: isExpanded ? {
661
- ...rowCaptionStyle,
662
- whiteSpace: 'normal'
663
- } : rowCaptionStyle,
664
- children: shortDescription
665
- })]
666
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(NightSwitch, {
667
- value: value,
668
- onChange: onToggle
669
- })]
670
- }), isExpanded && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
671
- style: {
672
- // native settingRowBody: px 16, pb 14, gap 6
673
- padding: '0 16px 14px',
674
- display: 'flex',
675
- flexDirection: 'column',
676
- gap: 6
677
- },
678
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
679
- style: {
680
- color: night.textSecondary,
681
- fontSize: 13,
682
- lineHeight: '19px'
683
- },
684
- children: fullDescription
685
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
686
- style: {
687
- color: night.textTertiary,
688
- fontSize: 13,
689
- lineHeight: '19px'
690
- },
691
- children: recommendation
692
- })]
693
- })]
694
- });
695
- }
696
-
697
- // =============================
698
- // Main Component
699
- // =============================
12
+ const EMPTY_TOOLS = [];
700
13
 
14
+ /** Adapts the browser host to the shared settings and account panel. */
701
15
  function SettingsModal({
702
16
  visible,
703
17
  onClose,
704
- availableTools = [],
18
+ availableTools = EMPTY_TOOLS,
705
19
  defaultFloatingTools,
706
20
  defaultDialTools,
707
- storage = webStorageAdapter,
21
+ storage = _sharedUi.persistentStorage,
708
22
  onSettingsChange
709
23
  }) {
710
- const [activeTab, setActiveTab] = (0, _react.useState)('floating');
711
- const [isStorageExpanded, setIsStorageExpanded] = (0, _react.useState)(false);
712
- const [savedKeys, setSavedKeys] = (0, _react.useState)([]);
713
- const [clearSuccess, setClearSuccess] = (0, _react.useState)(false);
714
-
715
- // Use the shared settings hook
716
- const {
717
- settings,
718
- isLoading,
719
- actions
720
- } = (0, _floatingToolsReact.useSettings)({
721
- availableTools,
722
- defaultFloatingTools,
723
- defaultDialTools,
724
- storage,
725
- onSettingsChange
726
- });
727
-
728
- // JsModal owns the close animation now — this is just the Escape path.
729
- const handleClose = (0, _react.useCallback)(() => {
730
- onClose();
731
- }, [onClose]);
732
-
733
- // Escape key handler
734
- (0, _react.useEffect)(() => {
735
- if (!visible) return;
736
- const handleKeyDown = e => {
737
- if (e.key === 'Escape') {
738
- handleClose();
739
- }
740
- };
741
- document.addEventListener('keydown', handleKeyDown);
742
- return () => document.removeEventListener('keydown', handleKeyDown);
743
- }, [visible, handleClose]);
744
-
745
- // Saved-settings key list for the storage card (mirrors the native
746
- // persistentStorage.getAllKeys() list; on web, Buoy keys in localStorage).
747
- (0, _react.useEffect)(() => {
748
- if (!visible || !isStorageExpanded) return;
749
- try {
750
- const keys = Object.keys(localStorage).filter(key => key.startsWith('@react_buoy')).sort();
751
- setSavedKeys(keys);
752
- } catch {
753
- setSavedKeys([]);
754
- }
755
- }, [visible, isStorageExpanded, clearSuccess, settings]);
756
- const handleClearAll = (0, _react.useCallback)(() => {
757
- // Same behavior as before (reset via the shared hook); the 2s "Cleared"
758
- // flash mirrors the native clear button feedback.
759
- actions.resetToDefaults();
760
- setClearSuccess(true);
761
- setTimeout(() => setClearSuccess(false), 2000);
762
- }, [actions]);
763
- if (!visible) return null;
764
-
765
- // Filter tabs - exclude 'pro' for now on web
766
- const displayTabs = _floatingToolsReact.settingsTabs.filter(tab => tab.key !== 'pro');
767
-
768
- // Segmented control rendered inside the JsModal header — native passes a
769
- // NightSegmented glass as header.customContent the same way. Track = glass
770
- // at radius 10 / padding 3; active thumb = glassElevated at radius 8 with
771
- // the accent underline glow (the Everlights All/Day tabs).
772
- const tabHeader = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
773
- style: {
774
- display: 'flex',
775
- alignItems: 'center',
776
- paddingLeft: 16,
777
- paddingRight: 16,
778
- // window controls are cleared vertically, not sideways
779
- paddingBottom: 8
780
- },
781
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
782
- style: {
783
- flex: 1,
784
- display: 'flex',
785
- backgroundColor: night.glass,
786
- borderRadius: 10,
787
- border: `1px solid ${night.glassBorder}`,
788
- padding: 3,
789
- boxSizing: 'border-box'
790
- },
791
- children: displayTabs.map(tab => {
792
- const isActive = activeTab === tab.key;
793
- // native settingsTabs labels are uppercase ids; night shows title case
794
- const label = tab.label.charAt(0).toUpperCase() + tab.label.slice(1).toLowerCase();
795
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
796
- onClick: () => setActiveTab(tab.key),
797
- role: "tab",
798
- "aria-selected": isActive,
799
- style: {
800
- flex: 1,
801
- position: 'relative',
802
- padding: '8px 0',
803
- borderRadius: 8,
804
- border: 'none',
805
- backgroundColor: isActive ? night.glassElevated : 'transparent',
806
- color: isActive ? night.text : night.textSecondary,
807
- fontSize: 13,
808
- fontWeight: isActive ? 600 : 500,
809
- fontFamily: 'inherit',
810
- cursor: 'pointer',
811
- transition: 'all 150ms ease',
812
- display: 'flex',
813
- alignItems: 'center',
814
- justifyContent: 'center'
815
- },
816
- children: [label, isActive && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
817
- style: {
818
- position: 'absolute',
819
- bottom: 2,
820
- left: '50%',
821
- transform: 'translateX(-50%)',
822
- width: 24,
823
- height: 2.5,
824
- borderRadius: 1.25,
825
- backgroundColor: night.accent,
826
- boxShadow: `0 0 6px ${night.accent}99`
827
- }
828
- })]
829
- }, tab.key);
830
- })
831
- })
832
- });
833
-
834
- // native: initialHeight = screenHeight / 3, floating starts centered at
835
- // width min(screenWidth - 32, 400), y = insets.top + 20.
836
- const modalWidth = Math.min(window.innerWidth - 32, 400);
837
- const topInset = readTopSafeAreaInset();
838
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.JsModal, {
839
- visible: visible,
840
- onClose: handleClose,
841
- variant: "night",
842
- header: {
843
- showToggleButton: false,
844
- customContent: tabHeader
845
- },
846
- initialMode: "bottomSheet",
847
- persistenceKey: _sharedUi.devToolsStorageKeys.settings.root(),
848
- enablePersistence: true,
849
- initialHeight: Math.floor(window.innerHeight * 0.33),
850
- initialFloatingPosition: {
851
- x: (window.innerWidth - modalWidth) / 2,
852
- y: topInset + 20 // native: insets.top + 20
853
- },
854
- zIndex: 10001 // above the dial (10000) — settings opens over it
855
- ,
856
- disableScrollWrapper: true,
857
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
858
- style: {
859
- flex: 1,
860
- minHeight: 0,
861
- overflow: 'auto',
862
- backgroundColor: 'transparent',
863
- padding: '8px 16px 24px',
864
- display: 'flex',
865
- flexDirection: 'column',
866
- gap: 24
867
- },
868
- children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
869
- style: {
870
- display: 'flex',
871
- alignItems: 'center',
872
- justifyContent: 'center',
873
- padding: 40,
874
- color: night.textTertiary,
875
- fontSize: 13
876
- },
877
- children: "Loading settings\u2026"
878
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
879
- children: [activeTab === 'floating' && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
880
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SectionLabel, {
881
- children: "Floating Tools"
882
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
883
- style: cardStyle,
884
- children: Object.entries(settings.floatingTools).map(([id, enabled], index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
885
- children: [index > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(Separator, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolRow, {
886
- toolId: id,
887
- enabled: enabled,
888
- availableTools: availableTools,
889
- onToggle: () => id === 'environment' ? actions.toggleEnvironment() : actions.toggleFloatingTool(id)
890
- })]
891
- }, id))
892
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Footnote, {
893
- children: "Tools switched on here appear in the floating bubble row."
894
- })]
895
- }), activeTab === 'settings' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
896
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
897
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SectionLabel, {
898
- children: "Background"
899
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
900
- style: {
901
- ...cardStyle,
902
- padding: 14
903
- },
904
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.BackgroundSwitcher, {
905
- embedded: true
906
- })
907
- })]
908
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
909
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SectionLabel, {
910
- children: "Storage"
911
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
912
- style: cardStyle,
913
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
914
- onClick: () => setIsStorageExpanded(v => !v),
915
- style: settingRowStyle,
916
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
917
- style: {
918
- flex: 1,
919
- minWidth: 0
920
- },
921
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
922
- style: rowLabelStyle,
923
- children: "Storage Type"
924
- })
925
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Badge, {
926
- label: "Local Storage",
927
- tone: "accent"
928
- }), isStorageExpanded ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronDownIcon, {
929
- size: 16,
930
- color: night.textTertiary
931
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronRightIcon, {
932
- size: 16,
933
- color: night.textTertiary
934
- })]
935
- }), isStorageExpanded && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
936
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
937
- style: {
938
- padding: '0 16px 14px'
939
- },
940
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
941
- style: {
942
- color: night.textSecondary,
943
- fontSize: 13,
944
- lineHeight: '19px'
945
- },
946
- children: "Settings persist in the browser's localStorage and survive page reloads."
947
- })
948
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Separator, {}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
949
- style: {
950
- padding: '12px 16px',
951
- display: 'flex',
952
- flexDirection: 'column',
953
- gap: 8
954
- },
955
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
956
- style: {
957
- display: 'flex',
958
- alignItems: 'center'
959
- },
960
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
961
- style: {
962
- flex: 1,
963
- color: night.textSecondary,
964
- fontSize: 11,
965
- fontWeight: 600,
966
- letterSpacing: 0.5
967
- },
968
- children: "SAVED SETTINGS"
969
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
970
- style: {
971
- color: night.textTertiary,
972
- fontSize: 11
973
- },
974
- children: [savedKeys.length, " keys"]
975
- })]
976
- }), savedKeys.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
977
- style: {
978
- color: night.textTertiary,
979
- fontSize: 13,
980
- fontStyle: 'italic'
981
- },
982
- children: "No settings saved yet"
983
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
984
- style: {
985
- maxHeight: 150,
986
- overflow: 'auto'
987
- },
988
- children: savedKeys.map(key => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
989
- style: {
990
- backgroundColor: night.glassElevated,
991
- borderRadius: 8,
992
- padding: '7px 10px',
993
- marginBottom: 4
994
- },
995
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
996
- style: {
997
- color: night.textSecondary,
998
- fontSize: 11,
999
- fontFamily: _sharedUi.monoFont,
1000
- overflow: 'hidden',
1001
- textOverflow: 'ellipsis',
1002
- whiteSpace: 'nowrap'
1003
- },
1004
- children: key.replace('@react_buoy_', '')
1005
- })
1006
- }, key))
1007
- })]
1008
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1009
- style: {
1010
- padding: '10px 14px 14px'
1011
- },
1012
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(NightButton, {
1013
- label: clearSuccess ? 'Cleared' : 'Clear All Settings',
1014
- variant: clearSuccess ? 'secondary' : 'destructive',
1015
- onClick: handleClearAll,
1016
- icon: clearSuccess ? /*#__PURE__*/(0, _jsxRuntime.jsx)(CheckCircle2, {
1017
- size: 15,
1018
- color: night.accent
1019
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(Trash2, {
1020
- size: 15,
1021
- color: night.danger
1022
- })
1023
- })
1024
- })]
1025
- })]
1026
- })]
1027
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1028
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SectionLabel, {
1029
- children: "Modal Behavior"
1030
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1031
- style: cardStyle,
1032
- children: _floatingToolsReact.globalSettingsConfig.map((config, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1033
- children: [index > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(Separator, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(GlobalSettingRow, {
1034
- label: config.label,
1035
- shortDescription: config.shortDescription,
1036
- fullDescription: config.fullDescription,
1037
- recommendation: config.recommendation,
1038
- value: settings.globalSettings?.[config.key] ?? false,
1039
- onToggle: () => actions.toggleGlobalSetting(config.key)
1040
- })]
1041
- }, config.key))
1042
- })]
1043
- })]
1044
- })]
1045
- })
24
+ const adapter = (0, _react.useMemo)(() => ({
25
+ getItem: async key => storage.getItem(key),
26
+ setItem: async (key, value) => storage.setItem(key, value)
27
+ }), [storage]);
28
+ const availableApps = (0, _react.useMemo)(() => availableTools.map(tool => ({
29
+ ...tool,
30
+ name: tool.name ?? tool.id,
31
+ icon: typeof tool.icon === "function" ? context => tool.icon(context.size) : tool.icon
32
+ })), [availableTools]);
33
+ const handleChange = (0, _react.useCallback)(settings => {
34
+ onSettingsChange?.(settings);
35
+ }, [onSettingsChange]);
36
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DefaultConfigContext.DefaultConfigProvider, {
37
+ defaultFloatingTools: defaultFloatingTools,
38
+ defaultDialTools: defaultDialTools,
39
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DevToolsSettingsModalShared.DevToolsSettingsModal, {
40
+ visible: visible,
41
+ onClose: onClose,
42
+ zIndex: 11000,
43
+ availableApps: availableApps,
44
+ storage: adapter,
45
+ onSettingsChange: handleChange
1046
46
  })
1047
47
  });
1048
48
  }