66
'React::DevTools::hideConsoleLogsInStrictMode';
67
68
export const PROFILER_EXPORT_VERSION = 5;
69
-
70
-export const CHANGE_LOG_URL =
71
- 'https://github.com/facebook/react/blob/main/packages/react-devtools/CHANGELOG.md';
72
-
73
-export const UNSUPPORTED_VERSION_URL =
74
- 'https://reactjs.org/blog/2019/08/15/new-react-devtools.html#how-do-i-get-the-old-version-back';
75
-
76
-export const REACT_DEVTOOLS_WORKPLACE_URL =
77
- 'https://fburl.com/react-devtools-workplace-group';
78
-
79
-import type {
80
- Theme,
81
- DisplayDensity,
82
-} from './devtools/views/Settings/SettingsContext';
83
-
84
-export const THEME_STYLES: {[style: Theme | DisplayDensity]: any, ...} = {
85
- light: {
86
- '--color-attribute-name': '#ef6632',
87
- '--color-attribute-name-not-editable': '#23272f',
88
- '--color-attribute-name-inverted': 'rgba(255, 255, 255, 0.7)',
89
- '--color-attribute-value': '#1a1aa6',
90
- '--color-attribute-value-inverted': '#ffffff',
91
- '--color-attribute-editable-value': '#1a1aa6',
92
- '--color-background': '#ffffff',
93
- '--color-background-hover': 'rgba(0, 136, 250, 0.1)',
94
- '--color-background-inactive': '#e5e5e5',
95
- '--color-background-invalid': '#fff0f0',
96
- '--color-background-selected': '#0088fa',
97
- '--color-button-background': '#ffffff',
98
- '--color-button-background-focus': '#ededed',
99
- '--color-button': '#5f6673',
100
- '--color-button-disabled': '#cfd1d5',
101
- '--color-button-active': '#0088fa',
102
- '--color-button-focus': '#23272f',
103
- '--color-button-hover': '#23272f',
104
- '--color-border': '#eeeeee',
105
- '--color-commit-did-not-render-fill': '#cfd1d5',
106
- '--color-commit-did-not-render-fill-text': '#000000',
107
- '--color-commit-did-not-render-pattern': '#cfd1d5',
108
- '--color-commit-did-not-render-pattern-text': '#333333',
109
- '--color-commit-gradient-0': '#37afa9',
110
- '--color-commit-gradient-1': '#63b19e',
111
- '--color-commit-gradient-2': '#80b393',
112
- '--color-commit-gradient-3': '#97b488',
113
- '--color-commit-gradient-4': '#abb67d',
114
- '--color-commit-gradient-5': '#beb771',
115
- '--color-commit-gradient-6': '#cfb965',
116
- '--color-commit-gradient-7': '#dfba57',
117
- '--color-commit-gradient-8': '#efbb49',
118
- '--color-commit-gradient-9': '#febc38',
119
- '--color-commit-gradient-text': '#000000',
120
- '--color-component-name': '#6a51b2',
121
- '--color-component-name-inverted': '#ffffff',
122
- '--color-component-badge-background': 'rgba(0, 0, 0, 0.1)',
123
- '--color-component-badge-background-inverted': 'rgba(255, 255, 255, 0.25)',
124
- '--color-component-badge-count': '#777d88',
125
- '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)',
126
- '--color-console-error-badge-text': '#ffffff',
127
- '--color-console-error-background': '#fff0f0',
128
- '--color-console-error-border': '#ffd6d6',
129
- '--color-console-error-icon': '#eb3941',
130
- '--color-console-error-text': '#fe2e31',
131
- '--color-console-warning-badge-text': '#000000',
132
- '--color-console-warning-background': '#fffbe5',
133
- '--color-console-warning-border': '#fff5c1',
134
- '--color-console-warning-icon': '#f4bd00',
135
- '--color-console-warning-text': '#64460c',
136
- '--color-context-background': 'rgba(0,0,0,.9)',
137
- '--color-context-background-hover': 'rgba(255, 255, 255, 0.1)',
138
- '--color-context-background-selected': '#178fb9',
139
- '--color-context-border': '#3d424a',
140
- '--color-context-text': '#ffffff',
141
- '--color-context-text-selected': '#ffffff',
142
- '--color-dim': '#777d88',
143
- '--color-dimmer': '#cfd1d5',
144
- '--color-dimmest': '#eff0f1',
145
- '--color-error-background': 'hsl(0, 100%, 97%)',
146
- '--color-error-border': 'hsl(0, 100%, 92%)',
147
- '--color-error-text': '#ff0000',
148
- '--color-expand-collapse-toggle': '#777d88',
149
- '--color-link': '#0000ff',
150
- '--color-modal-background': 'rgba(255, 255, 255, 0.75)',
151
- '--color-bridge-version-npm-background': '#eff0f1',
152
- '--color-bridge-version-npm-text': '#000000',
153
- '--color-bridge-version-number': '#0088fa',
154
- '--color-primitive-hook-badge-background': '#e5e5e5',
155
- '--color-primitive-hook-badge-text': '#5f6673',
156
- '--color-record-active': '#fc3a4b',
157
- '--color-record-hover': '#3578e5',
158
- '--color-record-inactive': '#0088fa',
159
- '--color-resize-bar': '#eeeeee',
160
- '--color-resize-bar-active': '#dcdcdc',
161
- '--color-resize-bar-border': '#d1d1d1',
162
- '--color-resize-bar-dot': '#333333',
163
- '--color-timeline-internal-module': '#d1d1d1',
164
- '--color-timeline-internal-module-hover': '#c9c9c9',
165
- '--color-timeline-internal-module-text': '#444',
166
- '--color-timeline-native-event': '#ccc',
167
- '--color-timeline-native-event-hover': '#aaa',
168
- '--color-timeline-network-primary': '#fcf3dc',
169
- '--color-timeline-network-primary-hover': '#f0e7d1',
170
- '--color-timeline-network-secondary': '#efc457',
171
- '--color-timeline-network-secondary-hover': '#e3ba52',
172
- '--color-timeline-priority-background': '#f6f6f6',
173
- '--color-timeline-priority-border': '#eeeeee',
174
- '--color-timeline-user-timing': '#c9cacd',
175
- '--color-timeline-user-timing-hover': '#93959a',
176
- '--color-timeline-react-idle': '#d3e5f6',
177
- '--color-timeline-react-idle-hover': '#c3d9ef',
178
- '--color-timeline-react-render': '#9fc3f3',
179
- '--color-timeline-react-render-hover': '#83afe9',
180
- '--color-timeline-react-render-text': '#11365e',
181
- '--color-timeline-react-commit': '#c88ff0',
182
- '--color-timeline-react-commit-hover': '#b281d6',
183
- '--color-timeline-react-commit-text': '#3e2c4a',
184
- '--color-timeline-react-layout-effects': '#b281d6',
185
- '--color-timeline-react-layout-effects-hover': '#9d71bd',
186
- '--color-timeline-react-layout-effects-text': '#3e2c4a',
187
- '--color-timeline-react-passive-effects': '#b281d6',
188
- '--color-timeline-react-passive-effects-hover': '#9d71bd',
189
- '--color-timeline-react-passive-effects-text': '#3e2c4a',
190
- '--color-timeline-react-schedule': '#9fc3f3',
191
- '--color-timeline-react-schedule-hover': '#2683E2',
192
- '--color-timeline-react-suspense-rejected': '#f1cc14',
193
- '--color-timeline-react-suspense-rejected-hover': '#ffdf37',
194
- '--color-timeline-react-suspense-resolved': '#a6e59f',
195
- '--color-timeline-react-suspense-resolved-hover': '#89d281',
196
- '--color-timeline-react-suspense-unresolved': '#c9cacd',
197
- '--color-timeline-react-suspense-unresolved-hover': '#93959a',
198
- '--color-timeline-thrown-error': '#ee1638',
199
- '--color-timeline-thrown-error-hover': '#da1030',
200
- '--color-timeline-text-color': '#000000',
201
- '--color-timeline-text-dim-color': '#ccc',
202
- '--color-timeline-react-work-border': '#eeeeee',
203
- '--color-search-match': 'yellow',
204
- '--color-search-match-current': '#f7923b',
205
- '--color-selected-tree-highlight-active': 'rgba(0, 136, 250, 0.1)',
206
- '--color-selected-tree-highlight-inactive': 'rgba(0, 0, 0, 0.05)',
207
- '--color-scroll-caret': 'rgba(150, 150, 150, 0.5)',
208
- '--color-tab-selected-border': '#0088fa',
209
- '--color-text': '#000000',
210
- '--color-text-invalid': '#ff0000',
211
- '--color-text-selected': '#ffffff',
212
- '--color-toggle-background-invalid': '#fc3a4b',
213
- '--color-toggle-background-on': '#0088fa',
214
- '--color-toggle-background-off': '#cfd1d5',
215
- '--color-toggle-text': '#ffffff',
216
- '--color-warning-background': '#fb3655',
217
- '--color-warning-background-hover': '#f82042',
218
- '--color-warning-text-color': '#ffffff',
219
- '--color-warning-text-color-inverted': '#fd4d69',
220
-
221
- // The styles below should be kept in sync with 'root.css'
222
- // They are repeated there because they're used by e.g. tooltips or context menus
223
- // which get rendered outside of the DOM subtree (where normal theme/styles are written).
224
- '--color-scroll-thumb': '#c2c2c2',
225
- '--color-scroll-track': '#fafafa',
226
- '--color-tooltip-background': 'rgba(0, 0, 0, 0.9)',
227
- '--color-tooltip-text': '#ffffff',
228
- },
229
- dark: {
230
- '--color-attribute-name': '#9d87d2',
231
- '--color-attribute-name-not-editable': '#ededed',
232
- '--color-attribute-name-inverted': '#282828',
233
- '--color-attribute-value': '#cedae0',
234
- '--color-attribute-value-inverted': '#ffffff',
235
- '--color-attribute-editable-value': 'yellow',
236
- '--color-background': '#282c34',
237
- '--color-background-hover': 'rgba(255, 255, 255, 0.1)',
238
- '--color-background-inactive': '#3d424a',
239
- '--color-background-invalid': '#5c0000',
240
- '--color-background-selected': '#178fb9',
241
- '--color-button-background': '#282c34',
242
- '--color-button-background-focus': '#3d424a',
243
- '--color-button': '#afb3b9',
244
- '--color-button-active': '#61dafb',
245
- '--color-button-disabled': '#4f5766',
246
- '--color-button-focus': '#a2e9fc',
247
- '--color-button-hover': '#ededed',
248
- '--color-border': '#3d424a',
249
- '--color-commit-did-not-render-fill': '#777d88',
250
- '--color-commit-did-not-render-fill-text': '#000000',
251
- '--color-commit-did-not-render-pattern': '#666c77',
252
- '--color-commit-did-not-render-pattern-text': '#ffffff',
253
- '--color-commit-gradient-0': '#37afa9',
254
- '--color-commit-gradient-1': '#63b19e',
255
- '--color-commit-gradient-2': '#80b393',
256
- '--color-commit-gradient-3': '#97b488',
257
- '--color-commit-gradient-4': '#abb67d',
258
- '--color-commit-gradient-5': '#beb771',
259
- '--color-commit-gradient-6': '#cfb965',
260
- '--color-commit-gradient-7': '#dfba57',
261
- '--color-commit-gradient-8': '#efbb49',
262
- '--color-commit-gradient-9': '#febc38',
263
- '--color-commit-gradient-text': '#000000',
264
- '--color-component-name': '#61dafb',
265
- '--color-component-name-inverted': '#282828',
266
- '--color-component-badge-background': 'rgba(255, 255, 255, 0.25)',
267
- '--color-component-badge-background-inverted': 'rgba(0, 0, 0, 0.25)',
268
- '--color-component-badge-count': '#8f949d',
269
- '--color-component-badge-count-inverted': 'rgba(255, 255, 255, 0.7)',
270
- '--color-console-error-badge-text': '#000000',
271
- '--color-console-error-background': '#290000',
272
- '--color-console-error-border': '#5c0000',
273
- '--color-console-error-icon': '#eb3941',
274
- '--color-console-error-text': '#fc7f7f',
275
- '--color-console-warning-badge-text': '#000000',
276
- '--color-console-warning-background': '#332b00',
277
- '--color-console-warning-border': '#665500',
278
- '--color-console-warning-icon': '#f4bd00',
279
- '--color-console-warning-text': '#f5f2ed',
280
- '--color-context-background': 'rgba(255,255,255,.95)',
281
- '--color-context-background-hover': 'rgba(0, 136, 250, 0.1)',
282
- '--color-context-background-selected': '#0088fa',
283
- '--color-context-border': '#eeeeee',
284
- '--color-context-text': '#000000',
285
- '--color-context-text-selected': '#ffffff',
286
- '--color-dim': '#8f949d',
287
- '--color-dimmer': '#777d88',
288
- '--color-dimmest': '#4f5766',
289
- '--color-error-background': '#200',
290
- '--color-error-border': '#900',
291
- '--color-error-text': '#f55',
292
- '--color-expand-collapse-toggle': '#8f949d',
293
- '--color-link': '#61dafb',
294
- '--color-modal-background': 'rgba(0, 0, 0, 0.75)',
295
- '--color-bridge-version-npm-background': 'rgba(0, 0, 0, 0.25)',
296
- '--color-bridge-version-npm-text': '#ffffff',
297
- '--color-bridge-version-number': 'yellow',
298
- '--color-primitive-hook-badge-background': 'rgba(0, 0, 0, 0.25)',
299
- '--color-primitive-hook-badge-text': 'rgba(255, 255, 255, 0.7)',
300
- '--color-record-active': '#fc3a4b',
301
- '--color-record-hover': '#a2e9fc',
302
- '--color-record-inactive': '#61dafb',
303
- '--color-resize-bar': '#282c34',
304
- '--color-resize-bar-active': '#31363f',
305
- '--color-resize-bar-border': '#3d424a',
306
- '--color-resize-bar-dot': '#cfd1d5',
307
- '--color-timeline-internal-module': '#303542',
308
- '--color-timeline-internal-module-hover': '#363b4a',
309
- '--color-timeline-internal-module-text': '#7f8899',
310
- '--color-timeline-native-event': '#b2b2b2',
311
- '--color-timeline-native-event-hover': '#949494',
312
- '--color-timeline-network-primary': '#fcf3dc',
313
- '--color-timeline-network-primary-hover': '#e3dbc5',
314
- '--color-timeline-network-secondary': '#efc457',
315
- '--color-timeline-network-secondary-hover': '#d6af4d',
316
- '--color-timeline-priority-background': '#1d2129',
317
- '--color-timeline-priority-border': '#282c34',
318
- '--color-timeline-user-timing': '#c9cacd',
319
- '--color-timeline-user-timing-hover': '#93959a',
320
- '--color-timeline-react-idle': '#3d485b',
321
- '--color-timeline-react-idle-hover': '#465269',
322
- '--color-timeline-react-render': '#2683E2',
323
- '--color-timeline-react-render-hover': '#1a76d4',
324
- '--color-timeline-react-render-text': '#11365e',
325
- '--color-timeline-react-commit': '#731fad',
326
- '--color-timeline-react-commit-hover': '#611b94',
327
- '--color-timeline-react-commit-text': '#e5c1ff',
328
- '--color-timeline-react-layout-effects': '#611b94',
329
- '--color-timeline-react-layout-effects-hover': '#51167a',
330
- '--color-timeline-react-layout-effects-text': '#e5c1ff',
331
- '--color-timeline-react-passive-effects': '#611b94',
332
- '--color-timeline-react-passive-effects-hover': '#51167a',
333
- '--color-timeline-react-passive-effects-text': '#e5c1ff',
334
- '--color-timeline-react-schedule': '#2683E2',
335
- '--color-timeline-react-schedule-hover': '#1a76d4',
336
- '--color-timeline-react-suspense-rejected': '#f1cc14',
337
- '--color-timeline-react-suspense-rejected-hover': '#e4c00f',
338
- '--color-timeline-react-suspense-resolved': '#a6e59f',
339
- '--color-timeline-react-suspense-resolved-hover': '#89d281',
340
- '--color-timeline-react-suspense-unresolved': '#c9cacd',
341
- '--color-timeline-react-suspense-unresolved-hover': '#93959a',
342
- '--color-timeline-thrown-error': '#fb3655',
343
- '--color-timeline-thrown-error-hover': '#f82042',
344
- '--color-timeline-text-color': '#282c34',
345
- '--color-timeline-text-dim-color': '#555b66',
346
- '--color-timeline-react-work-border': '#3d424a',
347
- '--color-search-match': 'yellow',
348
- '--color-search-match-current': '#f7923b',
349
- '--color-selected-tree-highlight-active': 'rgba(23, 143, 185, 0.15)',
350
- '--color-selected-tree-highlight-inactive': 'rgba(255, 255, 255, 0.05)',
351
- '--color-scroll-caret': '#4f5766',
352
- '--color-shadow': 'rgba(0, 0, 0, 0.5)',
353
- '--color-tab-selected-border': '#178fb9',
354
- '--color-text': '#ffffff',
355
- '--color-text-invalid': '#ff8080',
356
- '--color-text-selected': '#ffffff',
357
- '--color-toggle-background-invalid': '#fc3a4b',
358
- '--color-toggle-background-on': '#178fb9',
359
- '--color-toggle-background-off': '#777d88',
360
- '--color-toggle-text': '#ffffff',
361
- '--color-warning-background': '#ee1638',
362
- '--color-warning-background-hover': '#da1030',
363
- '--color-warning-text-color': '#ffffff',
364
- '--color-warning-text-color-inverted': '#ee1638',
365
-
366
- // The styles below should be kept in sync with 'root.css'
367
- // They are repeated there because they're used by e.g. tooltips or context menus
368
- // which get rendered outside of the DOM subtree (where normal theme/styles are written).
369
- '--color-scroll-thumb': '#afb3b9',
370
- '--color-scroll-track': '#313640',
371
- '--color-tooltip-background': 'rgba(255, 255, 255, 0.95)',
372
- '--color-tooltip-text': '#000000',
373
- },
374
- compact: {
375
- '--font-size-monospace-small': '9px',
376
- '--font-size-monospace-normal': '11px',
377
- '--font-size-monospace-large': '15px',
378
- '--font-size-sans-small': '10px',
379
- '--font-size-sans-normal': '12px',
380
- '--font-size-sans-large': '14px',
381
- '--line-height-data': '18px',
382
- },
383
- comfortable: {
384
- '--font-size-monospace-small': '10px',
385
- '--font-size-monospace-normal': '13px',
386
- '--font-size-monospace-large': '17px',
387
- '--font-size-sans-small': '12px',
388
- '--font-size-sans-normal': '14px',
389
- '--font-size-sans-large': '16px',
390
- '--line-height-data': '22px',
391
- },
392
-};
393
-
394
-// HACK
395
-//
396
-// Sometimes the inline target is rendered before root styles are applied,
397
-// which would result in e.g. NaN itemSize being passed to react-window list.
398
-const COMFORTABLE_LINE_HEIGHT: number = parseInt(
399
- THEME_STYLES.comfortable['--line-height-data'],
400
- 10,
401
-);
402
-const COMPACT_LINE_HEIGHT: number = parseInt(
403
- THEME_STYLES.compact['--line-height-data'],
404
- 10,
405
-);
406
-
407
-export {COMFORTABLE_LINE_HEIGHT, COMPACT_LINE_HEIGHT};