@buoy-gg/highlight-updates 3.0.0 → 3.0.2
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/lib/commonjs/highlight-updates/HighlightUpdatesOverlay.js +285 -1
- package/lib/commonjs/highlight-updates/components/HighlightFilterView.js +1371 -1
- package/lib/commonjs/highlight-updates/components/HighlightUpdatesModal.js +564 -1
- package/lib/commonjs/highlight-updates/components/IdentifierBadge.js +267 -1
- package/lib/commonjs/highlight-updates/components/IsolatedRenderList.js +178 -1
- package/lib/commonjs/highlight-updates/components/ModalHeaderContent.js +309 -1
- package/lib/commonjs/highlight-updates/components/RenderCauseBadge.js +500 -1
- package/lib/commonjs/highlight-updates/components/RenderDetailView.js +803 -1
- package/lib/commonjs/highlight-updates/components/RenderHistoryViewer.js +894 -1
- package/lib/commonjs/highlight-updates/components/RenderListItem.js +220 -1
- package/lib/commonjs/highlight-updates/components/RendersCopySettingsView.js +562 -1
- package/lib/commonjs/highlight-updates/components/StatsDisplay.js +70 -1
- package/lib/commonjs/highlight-updates/components/index.js +97 -1
- package/lib/commonjs/highlight-updates/types/copySettings.js +107 -1
- package/lib/commonjs/highlight-updates/utils/HighlightUpdatesController.js +1819 -1
- package/lib/commonjs/highlight-updates/utils/PerformanceLogger.js +359 -1
- package/lib/commonjs/highlight-updates/utils/ProfilerInterceptor.js +371 -1
- package/lib/commonjs/highlight-updates/utils/RenderCauseDetector.js +1828 -1
- package/lib/commonjs/highlight-updates/utils/RenderTracker.js +919 -1
- package/lib/commonjs/highlight-updates/utils/ViewTypeMapper.js +264 -1
- package/lib/commonjs/highlight-updates/utils/copySettingsStorage.js +49 -1
- package/lib/commonjs/highlight-updates/utils/renderExportFormatter.js +58 -1
- package/lib/commonjs/highlight-updates/utils/rendersExportFormatter.js +485 -1
- package/lib/commonjs/index.js +320 -1
- package/lib/commonjs/preset.js +278 -1
- package/lib/commonjs/sync/highlightUpdatesSyncAdapter.js +83 -0
- package/lib/module/highlight-updates/HighlightUpdatesOverlay.js +278 -1
- package/lib/module/highlight-updates/components/HighlightFilterView.js +1365 -1
- package/lib/module/highlight-updates/components/HighlightUpdatesModal.js +558 -1
- package/lib/module/highlight-updates/components/IdentifierBadge.js +259 -1
- package/lib/module/highlight-updates/components/IsolatedRenderList.js +174 -1
- package/lib/module/highlight-updates/components/ModalHeaderContent.js +304 -1
- package/lib/module/highlight-updates/components/RenderCauseBadge.js +491 -1
- package/lib/module/highlight-updates/components/RenderDetailView.js +797 -1
- package/lib/module/highlight-updates/components/RenderHistoryViewer.js +888 -1
- package/lib/module/highlight-updates/components/RenderListItem.js +215 -1
- package/lib/module/highlight-updates/components/RendersCopySettingsView.js +558 -1
- package/lib/module/highlight-updates/components/StatsDisplay.js +67 -1
- package/lib/module/highlight-updates/components/index.js +16 -1
- package/lib/module/highlight-updates/types/copySettings.js +102 -1
- package/lib/module/highlight-updates/utils/HighlightUpdatesController.js +1815 -1
- package/lib/module/highlight-updates/utils/PerformanceLogger.js +353 -1
- package/lib/module/highlight-updates/utils/ProfilerInterceptor.js +358 -1
- package/lib/module/highlight-updates/utils/RenderCauseDetector.js +1818 -1
- package/lib/module/highlight-updates/utils/RenderTracker.js +916 -1
- package/lib/module/highlight-updates/utils/ViewTypeMapper.js +255 -1
- package/lib/module/highlight-updates/utils/copySettingsStorage.js +43 -1
- package/lib/module/highlight-updates/utils/renderExportFormatter.js +54 -1
- package/lib/module/highlight-updates/utils/rendersExportFormatter.js +478 -1
- package/lib/module/index.js +74 -1
- package/lib/module/preset.js +272 -1
- package/lib/module/sync/highlightUpdatesSyncAdapter.js +78 -0
- package/lib/typescript/highlight-updates/HighlightUpdatesOverlay.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/HighlightFilterView.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/HighlightUpdatesModal.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/IdentifierBadge.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/IsolatedRenderList.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/ModalHeaderContent.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RenderCauseBadge.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RenderDetailView.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RenderHistoryViewer.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RenderListItem.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RendersCopySettingsView.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/StatsDisplay.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/index.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/types/copySettings.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts +90 -0
- package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/PerformanceLogger.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/ProfilerInterceptor.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/RenderCauseDetector.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/RenderTracker.d.ts +10 -0
- package/lib/typescript/highlight-updates/utils/RenderTracker.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/ViewTypeMapper.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/copySettingsStorage.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/renderExportFormatter.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/rendersExportFormatter.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/preset.d.ts.map +1 -0
- package/lib/typescript/sync/highlightUpdatesSyncAdapter.d.ts +36 -0
- package/lib/typescript/sync/highlightUpdatesSyncAdapter.d.ts.map +1 -0
- package/package.json +7 -7
package/lib/commonjs/index.js
CHANGED
|
@@ -1 +1,320 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "CAUSE_CONFIG", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _RenderCauseBadge.CAUSE_CONFIG;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "COMPONENT_CAUSE_CONFIG", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _RenderCauseBadge.COMPONENT_CAUSE_CONFIG;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "HighlightFilterView", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _HighlightFilterView.HighlightFilterView;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "HighlightUpdatesController", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _HighlightUpdatesController.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "HighlightUpdatesModal", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _HighlightUpdatesModal.HighlightUpdatesModal;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "HighlightUpdatesOverlay", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _HighlightUpdatesOverlay.HighlightUpdatesOverlay;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "PerformanceLogger", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _PerformanceLogger.PerformanceLogger;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "RenderCauseBadge", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _RenderCauseBadge.RenderCauseBadge;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "RenderDetailView", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _RenderDetailView.RenderDetailView;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "RenderHistoryFooter", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _RenderHistoryViewer.RenderHistoryFooter;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "RenderHistoryViewer", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _RenderHistoryViewer.RenderHistoryViewer;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "RenderListItem", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _RenderListItem.RenderListItem;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "RenderTracker", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _RenderTracker.RenderTracker;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "TwoLevelCauseBadge", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _RenderCauseBadge.TwoLevelCauseBadge;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "VIEW_TYPE_MAP", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _ViewTypeMapper.VIEW_TYPE_MAP;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "capturePropsSnapshot", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _RenderCauseDetector.capturePropsSnapshot;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "captureStateSnapshot", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _RenderCauseDetector.captureStateSnapshot;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "clearRenderCauseState", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _RenderCauseDetector.clearRenderCauseState;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "createHighlightUpdatesModalTool", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _preset.createHighlightUpdatesModalTool;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "createHighlightUpdatesTool", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _preset.createHighlightUpdatesTool;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "detectRenderCause", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _RenderCauseDetector.detectRenderCause;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "disableProfilerLogging", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () {
|
|
135
|
+
return _ProfilerInterceptor.disableProfilerLogging;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "enableProfilerLogging", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () {
|
|
141
|
+
return _ProfilerInterceptor.enableProfilerLogging;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "generateRendersJson", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function () {
|
|
147
|
+
return _renderExportFormatter.generateRendersJson;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "getAllComponentNames", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () {
|
|
153
|
+
return _ViewTypeMapper.getAllComponentNames;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "getAllNativeViewTypes", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function () {
|
|
159
|
+
return _ViewTypeMapper.getAllNativeViewTypes;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "getComponentDisplayName", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () {
|
|
165
|
+
return _ViewTypeMapper.getComponentDisplayName;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(exports, "getNativeViewType", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () {
|
|
171
|
+
return _ViewTypeMapper.getNativeViewType;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
Object.defineProperty(exports, "getRenderCauseStats", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function () {
|
|
177
|
+
return _RenderCauseDetector.getRenderCauseStats;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(exports, "highlightUpdatesModalPreset", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function () {
|
|
183
|
+
return _preset.highlightUpdatesModalPreset;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
Object.defineProperty(exports, "highlightUpdatesPreset", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function () {
|
|
189
|
+
return _preset.highlightUpdatesPreset;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(exports, "highlightUpdatesSyncAdapter", {
|
|
193
|
+
enumerable: true,
|
|
194
|
+
get: function () {
|
|
195
|
+
return _highlightUpdatesSyncAdapter.highlightUpdatesSyncAdapter;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
Object.defineProperty(exports, "installProfilerInterceptor", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function () {
|
|
201
|
+
return _ProfilerInterceptor.installProfilerInterceptor;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
Object.defineProperty(exports, "isInterceptorInstalled", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
get: function () {
|
|
207
|
+
return _ProfilerInterceptor.isInterceptorInstalled;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
Object.defineProperty(exports, "isKnownViewType", {
|
|
211
|
+
enumerable: true,
|
|
212
|
+
get: function () {
|
|
213
|
+
return _ViewTypeMapper.isKnownViewType;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
Object.defineProperty(exports, "isLoggingEnabled", {
|
|
217
|
+
enumerable: true,
|
|
218
|
+
get: function () {
|
|
219
|
+
return _ProfilerInterceptor.isLoggingEnabled;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
exports.onRenderEvent = void 0;
|
|
223
|
+
Object.defineProperty(exports, "removeRenderCauseState", {
|
|
224
|
+
enumerable: true,
|
|
225
|
+
get: function () {
|
|
226
|
+
return _RenderCauseDetector.removeRenderCauseState;
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
Object.defineProperty(exports, "safeCloneForHistory", {
|
|
230
|
+
enumerable: true,
|
|
231
|
+
get: function () {
|
|
232
|
+
return _RenderCauseDetector.safeCloneForHistory;
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
Object.defineProperty(exports, "setComparisonCallback", {
|
|
236
|
+
enumerable: true,
|
|
237
|
+
get: function () {
|
|
238
|
+
return _ProfilerInterceptor.setComparisonCallback;
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
Object.defineProperty(exports, "uninstallProfilerInterceptor", {
|
|
242
|
+
enumerable: true,
|
|
243
|
+
get: function () {
|
|
244
|
+
return _ProfilerInterceptor.uninstallProfilerInterceptor;
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
var _preset = require("./preset");
|
|
248
|
+
var _HighlightUpdatesController = _interopRequireDefault(require("./highlight-updates/utils/HighlightUpdatesController"));
|
|
249
|
+
var _highlightUpdatesSyncAdapter = require("./sync/highlightUpdatesSyncAdapter");
|
|
250
|
+
var _HighlightUpdatesOverlay = require("./highlight-updates/HighlightUpdatesOverlay");
|
|
251
|
+
var _ProfilerInterceptor = require("./highlight-updates/utils/ProfilerInterceptor");
|
|
252
|
+
var _RenderTracker = require("./highlight-updates/utils/RenderTracker");
|
|
253
|
+
var _RenderCauseDetector = require("./highlight-updates/utils/RenderCauseDetector");
|
|
254
|
+
var _PerformanceLogger = require("./highlight-updates/utils/PerformanceLogger");
|
|
255
|
+
var _ViewTypeMapper = require("./highlight-updates/utils/ViewTypeMapper");
|
|
256
|
+
var _HighlightUpdatesModal = require("./highlight-updates/components/HighlightUpdatesModal");
|
|
257
|
+
var _RenderListItem = require("./highlight-updates/components/RenderListItem");
|
|
258
|
+
var _RenderDetailView = require("./highlight-updates/components/RenderDetailView");
|
|
259
|
+
var _HighlightFilterView = require("./highlight-updates/components/HighlightFilterView");
|
|
260
|
+
var _RenderCauseBadge = require("./highlight-updates/components/RenderCauseBadge");
|
|
261
|
+
var _RenderHistoryViewer = require("./highlight-updates/components/RenderHistoryViewer");
|
|
262
|
+
var _renderExportFormatter = require("./highlight-updates/utils/renderExportFormatter");
|
|
263
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
264
|
+
/**
|
|
265
|
+
* @buoy-gg/highlight-updates
|
|
266
|
+
*
|
|
267
|
+
* Standalone implementation of React DevTools' "Highlight updates when components
|
|
268
|
+
* render" feature. Works without requiring DevTools to be connected.
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* ```tsx
|
|
272
|
+
* // Toggle-only preset - tap to enable/disable highlights
|
|
273
|
+
* import { highlightUpdatesPreset } from '@buoy-gg/highlight-updates';
|
|
274
|
+
*
|
|
275
|
+
* <FloatingDevTools apps={[highlightUpdatesPreset]} />
|
|
276
|
+
*
|
|
277
|
+
* // Modal preset - full interface with filters and render list
|
|
278
|
+
* import { highlightUpdatesModalPreset } from '@buoy-gg/highlight-updates';
|
|
279
|
+
*
|
|
280
|
+
* <FloatingDevTools apps={[highlightUpdatesModalPreset]} />
|
|
281
|
+
*
|
|
282
|
+
* // Or use the standalone controller programmatically
|
|
283
|
+
* import { HighlightUpdatesController } from '@buoy-gg/highlight-updates';
|
|
284
|
+
*
|
|
285
|
+
* HighlightUpdatesController.toggle();
|
|
286
|
+
* HighlightUpdatesController.enable();
|
|
287
|
+
* HighlightUpdatesController.disable();
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
290
|
+
|
|
291
|
+
// Preset exports for FloatingDevTools integration
|
|
292
|
+
|
|
293
|
+
// Controller export for standalone usage
|
|
294
|
+
|
|
295
|
+
// External sync (adapter for @buoy-gg/external-sync's useExternalSync)
|
|
296
|
+
|
|
297
|
+
// Overlay component - auto-rendered by FloatingDevTools, but exported for manual usage
|
|
298
|
+
|
|
299
|
+
// Profiler interceptor for debugging - captures what DevTools detects
|
|
300
|
+
|
|
301
|
+
// RenderTracker singleton for tracking render history
|
|
302
|
+
|
|
303
|
+
// Convenience export for unified events integration
|
|
304
|
+
const onRenderEvent = callback => {
|
|
305
|
+
const {
|
|
306
|
+
RenderTracker
|
|
307
|
+
} = require("./highlight-updates/utils/RenderTracker");
|
|
308
|
+
return RenderTracker.onRenderEvent(callback);
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
// RenderCauseDetector for detecting why components rendered
|
|
312
|
+
|
|
313
|
+
// PerformanceLogger for performance measurement and debugging
|
|
314
|
+
|
|
315
|
+
// ViewTypeMapper for translating native view names to component names
|
|
316
|
+
|
|
317
|
+
// Modal components for custom integrations
|
|
318
|
+
|
|
319
|
+
// Simple JSON export for renders
|
|
320
|
+
exports.onRenderEvent = onRenderEvent;
|
package/lib/commonjs/preset.js
CHANGED
|
@@ -1 +1,278 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createHighlightUpdatesModalTool = createHighlightUpdatesModalTool;
|
|
7
|
+
exports.createHighlightUpdatesTool = createHighlightUpdatesTool;
|
|
8
|
+
exports.highlightUpdatesPreset = exports.highlightUpdatesModalPreset = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _floatingToolsCore = require("@buoy-gg/floating-tools-core");
|
|
11
|
+
var _HighlightUpdatesController = _interopRequireDefault(require("./highlight-updates/utils/HighlightUpdatesController"));
|
|
12
|
+
var _HighlightUpdatesModal = require("./highlight-updates/components/HighlightUpdatesModal");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
|
+
/**
|
|
17
|
+
* Pre-configured highlight updates tool for FloatingDevTools
|
|
18
|
+
*
|
|
19
|
+
* This preset provides standalone "Highlight updates when components render"
|
|
20
|
+
* functionality. Tap the icon to toggle highlights on/off.
|
|
21
|
+
*
|
|
22
|
+
* The overlay is automatically rendered by FloatingDevTools when the
|
|
23
|
+
* @buoy-gg/highlight-updates package is installed.
|
|
24
|
+
*
|
|
25
|
+
* Two presets available:
|
|
26
|
+
* - highlightUpdatesPreset: Quick toggle (no modal)
|
|
27
|
+
* - highlightUpdatesModalPreset: Full modal with filters and render list
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* import { highlightUpdatesPreset, highlightUpdatesModalPreset } from '@buoy-gg/highlight-updates';
|
|
32
|
+
*
|
|
33
|
+
* // Toggle-only: Just tap to enable/disable highlighting
|
|
34
|
+
* <FloatingDevTools apps={[highlightUpdatesPreset]} />
|
|
35
|
+
*
|
|
36
|
+
* // Modal: Opens interface with filters, render list, and controls
|
|
37
|
+
* <FloatingDevTools apps={[highlightUpdatesModalPreset]} />
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Icon component that changes color based on enabled state.
|
|
43
|
+
*
|
|
44
|
+
* ⚠️ IMPORTANT - DO NOT MODIFY THIS COMPONENT ⚠️
|
|
45
|
+
* This component MUST use useState and useEffect hooks to subscribe to the controller.
|
|
46
|
+
* It is rendered as a JSX component (<IconComponent />) in FloatingMenu and DialIcon,
|
|
47
|
+
* which allows hooks to work properly.
|
|
48
|
+
*
|
|
49
|
+
* If you remove the hooks or change this to read isEnabled() directly,
|
|
50
|
+
* the icon color will NOT update when the toggle is pressed.
|
|
51
|
+
*/function HighlightIcon({
|
|
52
|
+
size
|
|
53
|
+
}) {
|
|
54
|
+
const [enabled, setEnabled] = (0, _react.useState)(() => _HighlightUpdatesController.default.isEnabled());
|
|
55
|
+
(0, _react.useEffect)(() => {
|
|
56
|
+
const unsubscribe = _HighlightUpdatesController.default.subscribe(isEnabled => {
|
|
57
|
+
setEnabled(isEnabled);
|
|
58
|
+
});
|
|
59
|
+
return unsubscribe;
|
|
60
|
+
}, []);
|
|
61
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.HighlightIcon, {
|
|
62
|
+
size: size,
|
|
63
|
+
color: enabled ? "#10b981" : "#6b7280"
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Empty component for toggle-only tools (no modal needed)
|
|
69
|
+
* The actual overlay is rendered by FloatingDevTools automatically
|
|
70
|
+
*/
|
|
71
|
+
function EmptyComponent() {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Wrapper component for the modal that handles badge press navigation.
|
|
77
|
+
* Registers a callback with the controller to receive badge press events
|
|
78
|
+
* and passes the target nativeTag to the modal for deep linking.
|
|
79
|
+
*/
|
|
80
|
+
function HighlightUpdatesModalWithBadgeNavigation(props) {
|
|
81
|
+
const [targetNativeTag, setTargetNativeTag] = (0, _react.useState)(null);
|
|
82
|
+
|
|
83
|
+
// Register badge press callback when modal is visible
|
|
84
|
+
(0, _react.useEffect)(() => {
|
|
85
|
+
if (props.visible) {
|
|
86
|
+
// Register callback to handle badge presses
|
|
87
|
+
_HighlightUpdatesController.default.setBadgePressCallback(nativeTag => {
|
|
88
|
+
setTargetNativeTag(nativeTag);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return () => {
|
|
92
|
+
// Clear callback when modal is closed or unmounted
|
|
93
|
+
if (!props.visible) {
|
|
94
|
+
_HighlightUpdatesController.default.setBadgePressCallback(null);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}, [props.visible]);
|
|
98
|
+
|
|
99
|
+
// Clear the target after it's been handled
|
|
100
|
+
const handleInitialNativeTagHandled = (0, _react.useCallback)(() => {
|
|
101
|
+
setTargetNativeTag(null);
|
|
102
|
+
}, []);
|
|
103
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_HighlightUpdatesModal.HighlightUpdatesModal, {
|
|
104
|
+
...props,
|
|
105
|
+
initialNativeTag: targetNativeTag,
|
|
106
|
+
onInitialNativeTagHandled: handleInitialNativeTagHandled
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Pre-configured highlight updates tool for FloatingDevTools.
|
|
112
|
+
* Tap the icon to toggle component render highlighting on/off.
|
|
113
|
+
*
|
|
114
|
+
* Features:
|
|
115
|
+
* - Standalone implementation - no DevTools connection required
|
|
116
|
+
* - Simple direct toggle (no modal)
|
|
117
|
+
* - Icon changes color: gray when off, green when on
|
|
118
|
+
* - Overlay auto-rendered by FloatingDevTools
|
|
119
|
+
*/
|
|
120
|
+
const highlightUpdatesPreset = exports.highlightUpdatesPreset = {
|
|
121
|
+
id: "highlight-updates",
|
|
122
|
+
name: "TOGGLE HIGHLIGHT",
|
|
123
|
+
description: "Toggle component render highlights",
|
|
124
|
+
slot: "row",
|
|
125
|
+
icon: HighlightIcon,
|
|
126
|
+
component: EmptyComponent,
|
|
127
|
+
props: {},
|
|
128
|
+
launchMode: "toggle-only",
|
|
129
|
+
onPress: () => {
|
|
130
|
+
// Initialize on first press if not already initialized
|
|
131
|
+
if (!_HighlightUpdatesController.default.isInitialized()) {
|
|
132
|
+
_HighlightUpdatesController.default.initialize();
|
|
133
|
+
}
|
|
134
|
+
_HighlightUpdatesController.default.toggle();
|
|
135
|
+
// Icon updates automatically via subscription in HighlightIcon component
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Create a custom highlight updates tool configuration.
|
|
141
|
+
* Use this if you want to override default settings.
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```tsx
|
|
145
|
+
* import { createHighlightUpdatesTool } from '@buoy-gg/highlight-updates';
|
|
146
|
+
*
|
|
147
|
+
* const myHighlightTool = createHighlightUpdatesTool({
|
|
148
|
+
* name: "RENDERS",
|
|
149
|
+
* enabledColor: "#ec4899",
|
|
150
|
+
* disabledColor: "#9ca3af",
|
|
151
|
+
* autoInitialize: true,
|
|
152
|
+
* });
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
function createHighlightUpdatesTool(options) {
|
|
156
|
+
const enabledColor = options?.enabledColor || "#10b981";
|
|
157
|
+
const disabledColor = options?.disabledColor || "#6b7280";
|
|
158
|
+
|
|
159
|
+
// Auto-initialize if requested
|
|
160
|
+
if (options?.autoInitialize) {
|
|
161
|
+
// Delay to allow DevTools to connect
|
|
162
|
+
setTimeout(() => {
|
|
163
|
+
_HighlightUpdatesController.default.initialize();
|
|
164
|
+
}, 1000);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Custom icon component with hooks - rendered as JSX component.
|
|
169
|
+
*
|
|
170
|
+
* ⚠️ IMPORTANT - DO NOT MODIFY THIS COMPONENT ⚠️
|
|
171
|
+
* This component MUST use useState and useEffect hooks to subscribe to the controller.
|
|
172
|
+
* See the comment on HighlightIcon above for full explanation.
|
|
173
|
+
*/
|
|
174
|
+
const CustomHighlightIcon = ({
|
|
175
|
+
size
|
|
176
|
+
}) => {
|
|
177
|
+
const [enabled, setEnabled] = (0, _react.useState)(() => _HighlightUpdatesController.default.isEnabled());
|
|
178
|
+
(0, _react.useEffect)(() => {
|
|
179
|
+
const unsubscribe = _HighlightUpdatesController.default.subscribe(isEnabled => {
|
|
180
|
+
setEnabled(isEnabled);
|
|
181
|
+
});
|
|
182
|
+
return unsubscribe;
|
|
183
|
+
}, []);
|
|
184
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.HighlightIcon, {
|
|
185
|
+
size: size,
|
|
186
|
+
color: enabled ? enabledColor : disabledColor
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
return {
|
|
190
|
+
id: options?.id || "highlight-updates",
|
|
191
|
+
name: options?.name || "TOGGLE HIGHLIGHT",
|
|
192
|
+
description: options?.description || "Toggle component render highlights",
|
|
193
|
+
slot: "row",
|
|
194
|
+
icon: CustomHighlightIcon,
|
|
195
|
+
component: EmptyComponent,
|
|
196
|
+
props: {},
|
|
197
|
+
launchMode: "toggle-only",
|
|
198
|
+
onPress: () => {
|
|
199
|
+
// Initialize on first press if not already initialized
|
|
200
|
+
if (!_HighlightUpdatesController.default.isInitialized()) {
|
|
201
|
+
_HighlightUpdatesController.default.initialize();
|
|
202
|
+
}
|
|
203
|
+
_HighlightUpdatesController.default.toggle();
|
|
204
|
+
// Icon updates automatically via subscription
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Modal preset for highlight updates tool.
|
|
211
|
+
* Opens a full modal interface with:
|
|
212
|
+
* - List of tracked component renders
|
|
213
|
+
* - Start/Stop and Pause/Resume controls
|
|
214
|
+
* - Clear button to reset render counts
|
|
215
|
+
* - Search bar in navbar (expandable)
|
|
216
|
+
* - Filter by viewType, testID, nativeID, componentName
|
|
217
|
+
* - Tap overlay badge to jump to component detail view
|
|
218
|
+
*
|
|
219
|
+
* Use this preset when you want detailed render tracking and filtering.
|
|
220
|
+
*/
|
|
221
|
+
const highlightUpdatesModalPreset = exports.highlightUpdatesModalPreset = {
|
|
222
|
+
id: "highlight-updates-modal",
|
|
223
|
+
name: "HIGHLIGHT",
|
|
224
|
+
description: "View component render tracking modal",
|
|
225
|
+
slot: "both",
|
|
226
|
+
icon: ({
|
|
227
|
+
size
|
|
228
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.HighlighterIcon, {
|
|
229
|
+
size: size
|
|
230
|
+
}),
|
|
231
|
+
component: HighlightUpdatesModalWithBadgeNavigation,
|
|
232
|
+
props: {
|
|
233
|
+
enableSharedModalDimensions: false
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Create a custom highlight updates modal tool configuration.
|
|
239
|
+
* Use this if you want to override default settings for the modal version.
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```tsx
|
|
243
|
+
* import { createHighlightUpdatesModalTool } from '@buoy-gg/highlight-updates';
|
|
244
|
+
*
|
|
245
|
+
* const myRendersTool = createHighlightUpdatesModalTool({
|
|
246
|
+
* name: "PROFILER",
|
|
247
|
+
* enabledColor: "#8b5cf6",
|
|
248
|
+
* disabledColor: "#9ca3af",
|
|
249
|
+
* });
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
252
|
+
function createHighlightUpdatesModalTool(options) {
|
|
253
|
+
const enabledColor = options?.enabledColor || "#10b981";
|
|
254
|
+
const disabledColor = options?.disabledColor || "#6b7280";
|
|
255
|
+
|
|
256
|
+
// Auto-initialize if requested
|
|
257
|
+
if (options?.autoInitialize) {
|
|
258
|
+
setTimeout(() => {
|
|
259
|
+
_HighlightUpdatesController.default.initialize();
|
|
260
|
+
}, 1000);
|
|
261
|
+
}
|
|
262
|
+
return {
|
|
263
|
+
id: options?.id || "highlight-updates-modal",
|
|
264
|
+
name: options?.name || "HIGHLIGHT",
|
|
265
|
+
description: options?.description || "View component render tracking modal",
|
|
266
|
+
slot: "both",
|
|
267
|
+
icon: ({
|
|
268
|
+
size
|
|
269
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.HighlighterIcon, {
|
|
270
|
+
size: size,
|
|
271
|
+
color: enabledColor
|
|
272
|
+
}),
|
|
273
|
+
component: HighlightUpdatesModalWithBadgeNavigation,
|
|
274
|
+
props: {
|
|
275
|
+
enableSharedModalDimensions: false
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
}
|