bippy 0.3.13 → 0.3.15

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 (50) hide show
  1. package/LICENSE +1 -1
  2. package/dist/chunk-DWy1uDak.cjs +47 -0
  3. package/dist/core-BHLOH6E0.js +744 -0
  4. package/dist/core-BOYfIZ0s.d.cts +293 -0
  5. package/dist/core-C9jPbnEc.cjs +1164 -0
  6. package/dist/core-CmL25iLV.d.ts +293 -0
  7. package/dist/core.cjs +79 -286
  8. package/dist/core.d.cts +2 -221
  9. package/dist/core.d.ts +2 -221
  10. package/dist/core.js +11 -2
  11. package/dist/experiments/inspect.cjs +1109 -1400
  12. package/dist/experiments/inspect.d.cts +12 -10
  13. package/dist/experiments/inspect.d.ts +12 -10
  14. package/dist/experiments/inspect.js +1101 -1385
  15. package/dist/index-BtBZHVmz.d.cts +1 -0
  16. package/dist/index-D0E78WnU.d.ts +1 -0
  17. package/dist/index.cjs +80 -287
  18. package/dist/index.d.cts +3 -5
  19. package/dist/index.d.ts +3 -5
  20. package/dist/index.iife.js +9 -0
  21. package/dist/index.js +12 -3
  22. package/dist/jsx-dev-runtime.cjs +18 -33
  23. package/dist/jsx-dev-runtime.d.cts +7 -6
  24. package/dist/jsx-dev-runtime.d.ts +7 -6
  25. package/dist/jsx-dev-runtime.js +17 -28
  26. package/dist/jsx-runtime.cjs +16 -12
  27. package/dist/jsx-runtime.d.cts +3 -3
  28. package/dist/jsx-runtime.d.ts +3 -3
  29. package/dist/jsx-runtime.js +12 -4
  30. package/dist/source-C6Kcs2bv.cjs +2438 -0
  31. package/dist/source-CAKKlkON.js +2446 -0
  32. package/dist/source.cjs +84 -300
  33. package/dist/source.d.cts +8 -10
  34. package/dist/source.d.ts +8 -10
  35. package/dist/source.iife.js +14 -0
  36. package/dist/source.js +13 -4
  37. package/dist/src-BMy3jWE4.cjs +14 -0
  38. package/dist/{chunk-H6ZLR634.js → src-CAEV45VU.js} +5 -4
  39. package/package.json +6 -7
  40. package/dist/chunk-3DXHQSXK.js +0 -788
  41. package/dist/chunk-4N6XEHJD.cjs +0 -859
  42. package/dist/chunk-AQ674A4M.cjs +0 -38
  43. package/dist/chunk-EPG3GO3H.js +0 -35
  44. package/dist/chunk-FUZZZTS6.js +0 -2255
  45. package/dist/chunk-NKMRHYKS.cjs +0 -2259
  46. package/dist/chunk-TGUPYBYL.cjs +0 -15
  47. package/dist/index.global.js +0 -9
  48. package/dist/jsx-runtime-KafG0Y8O.d.cts +0 -72
  49. package/dist/jsx-runtime-KafG0Y8O.d.ts +0 -72
  50. package/dist/source.global.js +0 -9
@@ -1,18 +1,19 @@
1
- import { getFiberSource } from '../chunk-FUZZZTS6.js';
2
- import '../chunk-H6ZLR634.js';
3
- import { getFiberFromHostInstance, getLatestFiber, getDisplayName, isInstrumentationActive, hasRDTHook, getRDTHook, detectReactBuildType } from '../chunk-3DXHQSXK.js';
4
- import '../chunk-EPG3GO3H.js';
5
- import React14, { createContext, memo, Children, useContext, useCallback, useState, useLayoutEffect, forwardRef, useMemo, useEffect, useImperativeHandle as useImperativeHandle$1 } from 'react';
6
- import ReactDOM from 'react-dom';
7
-
8
1
  /**
9
2
  * @license bippy
10
3
  *
11
- * Copyright (c) Aiden Bai, Million Software, Inc.
4
+ * Copyright (c) Aiden Bai
12
5
  *
13
6
  * This source code is licensed under the MIT license found in the
14
7
  * LICENSE file in the root directory of this source tree.
15
8
  */
9
+ import { getFiberSource } from "../source-CAKKlkON.js";
10
+ import { detectReactBuildType, getDisplayName, getFiberFromHostInstance, getLatestFiber, getRDTHook, hasRDTHook, isInstrumentationActive } from "../core-BHLOH6E0.js";
11
+ import "../src-CAEV45VU.js";
12
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
+ import React, { Children, createContext, forwardRef, memo, useCallback, useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useState } from "react";
14
+ import ReactDOM from "react-dom";
15
+
16
+ //#region ../../node_modules/.pnpm/react-inspector@6.0.2_react@19.0.0/node_modules/react-inspector/dist/index.mjs
16
17
  var __create = Object.create;
17
18
  var __defProp = Object.defineProperty;
18
19
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -20,1430 +21,1147 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
20
21
  var __getProtoOf = Object.getPrototypeOf;
21
22
  var __hasOwnProp = Object.prototype.hasOwnProperty;
22
23
  var __commonJS = (cb, mod) => function __require() {
23
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
25
  };
25
26
  var __export = (target, all) => {
26
- for (var name in all)
27
- __defProp(target, name, { get: all[name], enumerable: true });
27
+ for (var name in all) __defProp(target, name, {
28
+ get: all[name],
29
+ enumerable: true
30
+ });
28
31
  };
29
32
  var __copyProps = (to, from, except, desc) => {
30
- if (from && typeof from === "object" || typeof from === "function") {
31
- for (let key of __getOwnPropNames(from))
32
- if (!__hasOwnProp.call(to, key) && key !== except)
33
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
34
- }
35
- return to;
33
+ if (from && typeof from === "object" || typeof from === "function") {
34
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
35
+ get: () => from[key],
36
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
37
+ });
38
+ }
39
+ return to;
36
40
  };
37
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
38
- var require_is_object = __commonJS({
39
- "node_modules/is-object/index.js"(exports, module) {
40
- module.exports = function isObject(x) {
41
- return typeof x === "object" && x !== null;
42
- };
43
- }
44
- });
45
- var require_is_window = __commonJS({
46
- "node_modules/is-window/index.js"(exports, module) {
47
- module.exports = function(obj) {
48
- if (obj == null) {
49
- return false;
50
- }
51
- var o = Object(obj);
52
- return o === o.window;
53
- };
54
- }
55
- });
56
- var require_is_dom = __commonJS({
57
- "node_modules/is-dom/index.js"(exports, module) {
58
- var isObject = require_is_object();
59
- var isWindow = require_is_window();
60
- function isNode(val) {
61
- if (!isObject(val) || !isWindow(window) || typeof window.Node !== "function") {
62
- return false;
63
- }
64
- return typeof val.nodeType === "number" && typeof val.nodeName === "string";
65
- }
66
- module.exports = isNode;
67
- }
68
- });
41
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
42
+ value: mod,
43
+ enumerable: true
44
+ }) : target, mod));
45
+ var require_is_object = __commonJS({ "node_modules/is-object/index.js"(exports, module) {
46
+ "use strict";
47
+ module.exports = function isObject(x) {
48
+ return typeof x === "object" && x !== null;
49
+ };
50
+ } });
51
+ var require_is_window = __commonJS({ "node_modules/is-window/index.js"(exports, module) {
52
+ "use strict";
53
+ module.exports = function(obj) {
54
+ if (obj == null) return false;
55
+ var o = Object(obj);
56
+ return o === o.window;
57
+ };
58
+ } });
59
+ var require_is_dom = __commonJS({ "node_modules/is-dom/index.js"(exports, module) {
60
+ var isObject = require_is_object();
61
+ var isWindow = require_is_window();
62
+ function isNode(val) {
63
+ if (!isObject(val) || !isWindow(window) || typeof window.Node !== "function") return false;
64
+ return typeof val.nodeType === "number" && typeof val.nodeName === "string";
65
+ }
66
+ module.exports = isNode;
67
+ } });
69
68
  var themes_exports = {};
70
69
  __export(themes_exports, {
71
- chromeDark: () => theme,
72
- chromeLight: () => theme2
70
+ chromeDark: () => theme$1,
71
+ chromeLight: () => theme2
73
72
  });
74
- var theme = {
75
- BASE_FONT_FAMILY: "Menlo, monospace",
76
- BASE_FONT_SIZE: "11px",
77
- BASE_LINE_HEIGHT: 1.2,
78
- BASE_BACKGROUND_COLOR: "rgb(36, 36, 36)",
79
- BASE_COLOR: "rgb(213, 213, 213)",
80
- OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
81
- OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
82
- OBJECT_NAME_COLOR: "rgb(227, 110, 236)",
83
- OBJECT_VALUE_NULL_COLOR: "rgb(127, 127, 127)",
84
- OBJECT_VALUE_UNDEFINED_COLOR: "rgb(127, 127, 127)",
85
- OBJECT_VALUE_REGEXP_COLOR: "rgb(233, 63, 59)",
86
- OBJECT_VALUE_STRING_COLOR: "rgb(233, 63, 59)",
87
- OBJECT_VALUE_SYMBOL_COLOR: "rgb(233, 63, 59)",
88
- OBJECT_VALUE_NUMBER_COLOR: "hsl(252, 100%, 75%)",
89
- OBJECT_VALUE_BOOLEAN_COLOR: "hsl(252, 100%, 75%)",
90
- OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "rgb(85, 106, 242)",
91
- HTML_TAG_COLOR: "rgb(93, 176, 215)",
92
- HTML_TAGNAME_COLOR: "rgb(93, 176, 215)",
93
- HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
94
- HTML_ATTRIBUTE_NAME_COLOR: "rgb(155, 187, 220)",
95
- HTML_ATTRIBUTE_VALUE_COLOR: "rgb(242, 151, 102)",
96
- HTML_COMMENT_COLOR: "rgb(137, 137, 137)",
97
- HTML_DOCTYPE_COLOR: "rgb(192, 192, 192)",
98
- ARROW_COLOR: "rgb(145, 145, 145)",
99
- ARROW_MARGIN_RIGHT: 3,
100
- ARROW_FONT_SIZE: 12,
101
- ARROW_ANIMATION_DURATION: "0",
102
- TREENODE_FONT_FAMILY: "Menlo, monospace",
103
- TREENODE_FONT_SIZE: "11px",
104
- TREENODE_LINE_HEIGHT: 1.2,
105
- TREENODE_PADDING_LEFT: 12,
106
- TABLE_BORDER_COLOR: "rgb(85, 85, 85)",
107
- TABLE_TH_BACKGROUND_COLOR: "rgb(44, 44, 44)",
108
- TABLE_TH_HOVER_COLOR: "rgb(48, 48, 48)",
109
- TABLE_SORT_ICON_COLOR: "black",
110
- TABLE_DATA_BACKGROUND_IMAGE: "linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 50%, rgba(51, 139, 255, 0.0980392) 50%, rgba(51, 139, 255, 0.0980392))",
111
- TABLE_DATA_BACKGROUND_SIZE: "128px 32px"
73
+ var theme$1 = {
74
+ BASE_FONT_FAMILY: "Menlo, monospace",
75
+ BASE_FONT_SIZE: "11px",
76
+ BASE_LINE_HEIGHT: 1.2,
77
+ BASE_BACKGROUND_COLOR: "rgb(36, 36, 36)",
78
+ BASE_COLOR: "rgb(213, 213, 213)",
79
+ OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
80
+ OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
81
+ OBJECT_NAME_COLOR: "rgb(227, 110, 236)",
82
+ OBJECT_VALUE_NULL_COLOR: "rgb(127, 127, 127)",
83
+ OBJECT_VALUE_UNDEFINED_COLOR: "rgb(127, 127, 127)",
84
+ OBJECT_VALUE_REGEXP_COLOR: "rgb(233, 63, 59)",
85
+ OBJECT_VALUE_STRING_COLOR: "rgb(233, 63, 59)",
86
+ OBJECT_VALUE_SYMBOL_COLOR: "rgb(233, 63, 59)",
87
+ OBJECT_VALUE_NUMBER_COLOR: "hsl(252, 100%, 75%)",
88
+ OBJECT_VALUE_BOOLEAN_COLOR: "hsl(252, 100%, 75%)",
89
+ OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "rgb(85, 106, 242)",
90
+ HTML_TAG_COLOR: "rgb(93, 176, 215)",
91
+ HTML_TAGNAME_COLOR: "rgb(93, 176, 215)",
92
+ HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
93
+ HTML_ATTRIBUTE_NAME_COLOR: "rgb(155, 187, 220)",
94
+ HTML_ATTRIBUTE_VALUE_COLOR: "rgb(242, 151, 102)",
95
+ HTML_COMMENT_COLOR: "rgb(137, 137, 137)",
96
+ HTML_DOCTYPE_COLOR: "rgb(192, 192, 192)",
97
+ ARROW_COLOR: "rgb(145, 145, 145)",
98
+ ARROW_MARGIN_RIGHT: 3,
99
+ ARROW_FONT_SIZE: 12,
100
+ ARROW_ANIMATION_DURATION: "0",
101
+ TREENODE_FONT_FAMILY: "Menlo, monospace",
102
+ TREENODE_FONT_SIZE: "11px",
103
+ TREENODE_LINE_HEIGHT: 1.2,
104
+ TREENODE_PADDING_LEFT: 12,
105
+ TABLE_BORDER_COLOR: "rgb(85, 85, 85)",
106
+ TABLE_TH_BACKGROUND_COLOR: "rgb(44, 44, 44)",
107
+ TABLE_TH_HOVER_COLOR: "rgb(48, 48, 48)",
108
+ TABLE_SORT_ICON_COLOR: "black",
109
+ TABLE_DATA_BACKGROUND_IMAGE: "linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 50%, rgba(51, 139, 255, 0.0980392) 50%, rgba(51, 139, 255, 0.0980392))",
110
+ TABLE_DATA_BACKGROUND_SIZE: "128px 32px"
112
111
  };
113
112
  var theme2 = {
114
- BASE_FONT_FAMILY: "Menlo, monospace",
115
- BASE_FONT_SIZE: "11px",
116
- BASE_LINE_HEIGHT: 1.2,
117
- BASE_BACKGROUND_COLOR: "white",
118
- BASE_COLOR: "black",
119
- OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
120
- OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
121
- OBJECT_NAME_COLOR: "rgb(136, 19, 145)",
122
- OBJECT_VALUE_NULL_COLOR: "rgb(128, 128, 128)",
123
- OBJECT_VALUE_UNDEFINED_COLOR: "rgb(128, 128, 128)",
124
- OBJECT_VALUE_REGEXP_COLOR: "rgb(196, 26, 22)",
125
- OBJECT_VALUE_STRING_COLOR: "rgb(196, 26, 22)",
126
- OBJECT_VALUE_SYMBOL_COLOR: "rgb(196, 26, 22)",
127
- OBJECT_VALUE_NUMBER_COLOR: "rgb(28, 0, 207)",
128
- OBJECT_VALUE_BOOLEAN_COLOR: "rgb(28, 0, 207)",
129
- OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "rgb(13, 34, 170)",
130
- HTML_TAG_COLOR: "rgb(168, 148, 166)",
131
- HTML_TAGNAME_COLOR: "rgb(136, 18, 128)",
132
- HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
133
- HTML_ATTRIBUTE_NAME_COLOR: "rgb(153, 69, 0)",
134
- HTML_ATTRIBUTE_VALUE_COLOR: "rgb(26, 26, 166)",
135
- HTML_COMMENT_COLOR: "rgb(35, 110, 37)",
136
- HTML_DOCTYPE_COLOR: "rgb(192, 192, 192)",
137
- ARROW_COLOR: "#6e6e6e",
138
- ARROW_MARGIN_RIGHT: 3,
139
- ARROW_FONT_SIZE: 12,
140
- ARROW_ANIMATION_DURATION: "0",
141
- TREENODE_FONT_FAMILY: "Menlo, monospace",
142
- TREENODE_FONT_SIZE: "11px",
143
- TREENODE_LINE_HEIGHT: 1.2,
144
- TREENODE_PADDING_LEFT: 12,
145
- TABLE_BORDER_COLOR: "#aaa",
146
- TABLE_TH_BACKGROUND_COLOR: "#eee",
147
- TABLE_TH_HOVER_COLOR: "hsla(0, 0%, 90%, 1)",
148
- TABLE_SORT_ICON_COLOR: "#6e6e6e",
149
- TABLE_DATA_BACKGROUND_IMAGE: "linear-gradient(to bottom, white, white 50%, rgb(234, 243, 255) 50%, rgb(234, 243, 255))",
150
- TABLE_DATA_BACKGROUND_SIZE: "128px 32px"
113
+ BASE_FONT_FAMILY: "Menlo, monospace",
114
+ BASE_FONT_SIZE: "11px",
115
+ BASE_LINE_HEIGHT: 1.2,
116
+ BASE_BACKGROUND_COLOR: "white",
117
+ BASE_COLOR: "black",
118
+ OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
119
+ OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
120
+ OBJECT_NAME_COLOR: "rgb(136, 19, 145)",
121
+ OBJECT_VALUE_NULL_COLOR: "rgb(128, 128, 128)",
122
+ OBJECT_VALUE_UNDEFINED_COLOR: "rgb(128, 128, 128)",
123
+ OBJECT_VALUE_REGEXP_COLOR: "rgb(196, 26, 22)",
124
+ OBJECT_VALUE_STRING_COLOR: "rgb(196, 26, 22)",
125
+ OBJECT_VALUE_SYMBOL_COLOR: "rgb(196, 26, 22)",
126
+ OBJECT_VALUE_NUMBER_COLOR: "rgb(28, 0, 207)",
127
+ OBJECT_VALUE_BOOLEAN_COLOR: "rgb(28, 0, 207)",
128
+ OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "rgb(13, 34, 170)",
129
+ HTML_TAG_COLOR: "rgb(168, 148, 166)",
130
+ HTML_TAGNAME_COLOR: "rgb(136, 18, 128)",
131
+ HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
132
+ HTML_ATTRIBUTE_NAME_COLOR: "rgb(153, 69, 0)",
133
+ HTML_ATTRIBUTE_VALUE_COLOR: "rgb(26, 26, 166)",
134
+ HTML_COMMENT_COLOR: "rgb(35, 110, 37)",
135
+ HTML_DOCTYPE_COLOR: "rgb(192, 192, 192)",
136
+ ARROW_COLOR: "#6e6e6e",
137
+ ARROW_MARGIN_RIGHT: 3,
138
+ ARROW_FONT_SIZE: 12,
139
+ ARROW_ANIMATION_DURATION: "0",
140
+ TREENODE_FONT_FAMILY: "Menlo, monospace",
141
+ TREENODE_FONT_SIZE: "11px",
142
+ TREENODE_LINE_HEIGHT: 1.2,
143
+ TREENODE_PADDING_LEFT: 12,
144
+ TABLE_BORDER_COLOR: "#aaa",
145
+ TABLE_TH_BACKGROUND_COLOR: "#eee",
146
+ TABLE_TH_HOVER_COLOR: "hsla(0, 0%, 90%, 1)",
147
+ TABLE_SORT_ICON_COLOR: "#6e6e6e",
148
+ TABLE_DATA_BACKGROUND_IMAGE: "linear-gradient(to bottom, white, white 50%, rgb(234, 243, 255) 50%, rgb(234, 243, 255))",
149
+ TABLE_DATA_BACKGROUND_SIZE: "128px 32px"
151
150
  };
152
- var ExpandedPathsContext = createContext([{}, () => {
153
- }]);
151
+ var ExpandedPathsContext = createContext([{}, () => {}]);
154
152
  var unselectable = {
155
- WebkitTouchCallout: "none",
156
- WebkitUserSelect: "none",
157
- KhtmlUserSelect: "none",
158
- MozUserSelect: "none",
159
- msUserSelect: "none",
160
- OUserSelect: "none",
161
- userSelect: "none"
153
+ WebkitTouchCallout: "none",
154
+ WebkitUserSelect: "none",
155
+ KhtmlUserSelect: "none",
156
+ MozUserSelect: "none",
157
+ msUserSelect: "none",
158
+ OUserSelect: "none",
159
+ userSelect: "none"
162
160
  };
163
- var createTheme = (theme32) => ({
164
- DOMNodePreview: {
165
- htmlOpenTag: {
166
- base: {
167
- color: theme32.HTML_TAG_COLOR
168
- },
169
- tagName: {
170
- color: theme32.HTML_TAGNAME_COLOR,
171
- textTransform: theme32.HTML_TAGNAME_TEXT_TRANSFORM
172
- },
173
- htmlAttributeName: {
174
- color: theme32.HTML_ATTRIBUTE_NAME_COLOR
175
- },
176
- htmlAttributeValue: {
177
- color: theme32.HTML_ATTRIBUTE_VALUE_COLOR
178
- }
179
- },
180
- htmlCloseTag: {
181
- base: {
182
- color: theme32.HTML_TAG_COLOR
183
- },
184
- offsetLeft: {
185
- marginLeft: -theme32.TREENODE_PADDING_LEFT
186
- },
187
- tagName: {
188
- color: theme32.HTML_TAGNAME_COLOR,
189
- textTransform: theme32.HTML_TAGNAME_TEXT_TRANSFORM
190
- }
191
- },
192
- htmlComment: {
193
- color: theme32.HTML_COMMENT_COLOR
194
- },
195
- htmlDoctype: {
196
- color: theme32.HTML_DOCTYPE_COLOR
197
- }
198
- },
199
- ObjectPreview: {
200
- objectDescription: {
201
- fontStyle: "italic"
202
- },
203
- preview: {
204
- fontStyle: "italic"
205
- },
206
- arrayMaxProperties: theme32.OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES,
207
- objectMaxProperties: theme32.OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES
208
- },
209
- ObjectName: {
210
- base: {
211
- color: theme32.OBJECT_NAME_COLOR
212
- },
213
- dimmed: {
214
- opacity: 0.6
215
- }
216
- },
217
- ObjectValue: {
218
- objectValueNull: {
219
- color: theme32.OBJECT_VALUE_NULL_COLOR
220
- },
221
- objectValueUndefined: {
222
- color: theme32.OBJECT_VALUE_UNDEFINED_COLOR
223
- },
224
- objectValueRegExp: {
225
- color: theme32.OBJECT_VALUE_REGEXP_COLOR
226
- },
227
- objectValueString: {
228
- color: theme32.OBJECT_VALUE_STRING_COLOR
229
- },
230
- objectValueSymbol: {
231
- color: theme32.OBJECT_VALUE_SYMBOL_COLOR
232
- },
233
- objectValueNumber: {
234
- color: theme32.OBJECT_VALUE_NUMBER_COLOR
235
- },
236
- objectValueBoolean: {
237
- color: theme32.OBJECT_VALUE_BOOLEAN_COLOR
238
- },
239
- objectValueFunctionPrefix: {
240
- color: theme32.OBJECT_VALUE_FUNCTION_PREFIX_COLOR,
241
- fontStyle: "italic"
242
- },
243
- objectValueFunctionName: {
244
- fontStyle: "italic"
245
- }
246
- },
247
- TreeView: {
248
- treeViewOutline: {
249
- padding: 0,
250
- margin: 0,
251
- listStyleType: "none"
252
- }
253
- },
254
- TreeNode: {
255
- treeNodeBase: {
256
- color: theme32.BASE_COLOR,
257
- backgroundColor: theme32.BASE_BACKGROUND_COLOR,
258
- lineHeight: theme32.TREENODE_LINE_HEIGHT,
259
- cursor: "default",
260
- boxSizing: "border-box",
261
- listStyle: "none",
262
- fontFamily: theme32.TREENODE_FONT_FAMILY,
263
- fontSize: theme32.TREENODE_FONT_SIZE
264
- },
265
- treeNodePreviewContainer: {},
266
- treeNodePlaceholder: {
267
- whiteSpace: "pre",
268
- fontSize: theme32.ARROW_FONT_SIZE,
269
- marginRight: theme32.ARROW_MARGIN_RIGHT,
270
- ...unselectable
271
- },
272
- treeNodeArrow: {
273
- base: {
274
- color: theme32.ARROW_COLOR,
275
- display: "inline-block",
276
- fontSize: theme32.ARROW_FONT_SIZE,
277
- marginRight: theme32.ARROW_MARGIN_RIGHT,
278
- ...parseFloat(theme32.ARROW_ANIMATION_DURATION) > 0 ? {
279
- transition: `transform ${theme32.ARROW_ANIMATION_DURATION} ease 0s`
280
- } : {},
281
- ...unselectable
282
- },
283
- expanded: {
284
- WebkitTransform: "rotateZ(90deg)",
285
- MozTransform: "rotateZ(90deg)",
286
- transform: "rotateZ(90deg)"
287
- },
288
- collapsed: {
289
- WebkitTransform: "rotateZ(0deg)",
290
- MozTransform: "rotateZ(0deg)",
291
- transform: "rotateZ(0deg)"
292
- }
293
- },
294
- treeNodeChildNodesContainer: {
295
- margin: 0,
296
- paddingLeft: theme32.TREENODE_PADDING_LEFT
297
- }
298
- },
299
- TableInspector: {
300
- base: {
301
- color: theme32.BASE_COLOR,
302
- position: "relative",
303
- border: `1px solid ${theme32.TABLE_BORDER_COLOR}`,
304
- fontFamily: theme32.BASE_FONT_FAMILY,
305
- fontSize: theme32.BASE_FONT_SIZE,
306
- lineHeight: "120%",
307
- boxSizing: "border-box",
308
- cursor: "default"
309
- }
310
- },
311
- TableInspectorHeaderContainer: {
312
- base: {
313
- top: 0,
314
- height: "17px",
315
- left: 0,
316
- right: 0,
317
- overflowX: "hidden"
318
- },
319
- table: {
320
- tableLayout: "fixed",
321
- borderSpacing: 0,
322
- borderCollapse: "separate",
323
- height: "100%",
324
- width: "100%",
325
- margin: 0
326
- }
327
- },
328
- TableInspectorDataContainer: {
329
- tr: {
330
- display: "table-row"
331
- },
332
- td: {
333
- boxSizing: "border-box",
334
- border: "none",
335
- height: "16px",
336
- verticalAlign: "top",
337
- padding: "1px 4px",
338
- WebkitUserSelect: "text",
339
- whiteSpace: "nowrap",
340
- textOverflow: "ellipsis",
341
- overflow: "hidden",
342
- lineHeight: "14px"
343
- },
344
- div: {
345
- position: "static",
346
- top: "17px",
347
- bottom: 0,
348
- overflowY: "overlay",
349
- transform: "translateZ(0)",
350
- left: 0,
351
- right: 0,
352
- overflowX: "hidden"
353
- },
354
- table: {
355
- positon: "static",
356
- left: 0,
357
- top: 0,
358
- right: 0,
359
- bottom: 0,
360
- borderTop: "0 none transparent",
361
- margin: 0,
362
- backgroundImage: theme32.TABLE_DATA_BACKGROUND_IMAGE,
363
- backgroundSize: theme32.TABLE_DATA_BACKGROUND_SIZE,
364
- tableLayout: "fixed",
365
- borderSpacing: 0,
366
- borderCollapse: "separate",
367
- width: "100%",
368
- fontSize: theme32.BASE_FONT_SIZE,
369
- lineHeight: "120%"
370
- }
371
- },
372
- TableInspectorTH: {
373
- base: {
374
- position: "relative",
375
- height: "auto",
376
- textAlign: "left",
377
- backgroundColor: theme32.TABLE_TH_BACKGROUND_COLOR,
378
- borderBottom: `1px solid ${theme32.TABLE_BORDER_COLOR}`,
379
- fontWeight: "normal",
380
- verticalAlign: "middle",
381
- padding: "0 4px",
382
- whiteSpace: "nowrap",
383
- textOverflow: "ellipsis",
384
- overflow: "hidden",
385
- lineHeight: "14px",
386
- ":hover": {
387
- backgroundColor: theme32.TABLE_TH_HOVER_COLOR
388
- }
389
- },
390
- div: {
391
- whiteSpace: "nowrap",
392
- textOverflow: "ellipsis",
393
- overflow: "hidden",
394
- fontSize: theme32.BASE_FONT_SIZE,
395
- lineHeight: "120%"
396
- }
397
- },
398
- TableInspectorLeftBorder: {
399
- none: {
400
- borderLeft: "none"
401
- },
402
- solid: {
403
- borderLeft: `1px solid ${theme32.TABLE_BORDER_COLOR}`
404
- }
405
- },
406
- TableInspectorSortIcon: {
407
- display: "block",
408
- marginRight: 3,
409
- width: 8,
410
- height: 7,
411
- marginTop: -7,
412
- color: theme32.TABLE_SORT_ICON_COLOR,
413
- fontSize: 12,
414
- ...unselectable
415
- }
161
+ var createTheme = (theme3) => ({
162
+ DOMNodePreview: {
163
+ htmlOpenTag: {
164
+ base: { color: theme3.HTML_TAG_COLOR },
165
+ tagName: {
166
+ color: theme3.HTML_TAGNAME_COLOR,
167
+ textTransform: theme3.HTML_TAGNAME_TEXT_TRANSFORM
168
+ },
169
+ htmlAttributeName: { color: theme3.HTML_ATTRIBUTE_NAME_COLOR },
170
+ htmlAttributeValue: { color: theme3.HTML_ATTRIBUTE_VALUE_COLOR }
171
+ },
172
+ htmlCloseTag: {
173
+ base: { color: theme3.HTML_TAG_COLOR },
174
+ offsetLeft: { marginLeft: -theme3.TREENODE_PADDING_LEFT },
175
+ tagName: {
176
+ color: theme3.HTML_TAGNAME_COLOR,
177
+ textTransform: theme3.HTML_TAGNAME_TEXT_TRANSFORM
178
+ }
179
+ },
180
+ htmlComment: { color: theme3.HTML_COMMENT_COLOR },
181
+ htmlDoctype: { color: theme3.HTML_DOCTYPE_COLOR }
182
+ },
183
+ ObjectPreview: {
184
+ objectDescription: { fontStyle: "italic" },
185
+ preview: { fontStyle: "italic" },
186
+ arrayMaxProperties: theme3.OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES,
187
+ objectMaxProperties: theme3.OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES
188
+ },
189
+ ObjectName: {
190
+ base: { color: theme3.OBJECT_NAME_COLOR },
191
+ dimmed: { opacity: .6 }
192
+ },
193
+ ObjectValue: {
194
+ objectValueNull: { color: theme3.OBJECT_VALUE_NULL_COLOR },
195
+ objectValueUndefined: { color: theme3.OBJECT_VALUE_UNDEFINED_COLOR },
196
+ objectValueRegExp: { color: theme3.OBJECT_VALUE_REGEXP_COLOR },
197
+ objectValueString: { color: theme3.OBJECT_VALUE_STRING_COLOR },
198
+ objectValueSymbol: { color: theme3.OBJECT_VALUE_SYMBOL_COLOR },
199
+ objectValueNumber: { color: theme3.OBJECT_VALUE_NUMBER_COLOR },
200
+ objectValueBoolean: { color: theme3.OBJECT_VALUE_BOOLEAN_COLOR },
201
+ objectValueFunctionPrefix: {
202
+ color: theme3.OBJECT_VALUE_FUNCTION_PREFIX_COLOR,
203
+ fontStyle: "italic"
204
+ },
205
+ objectValueFunctionName: { fontStyle: "italic" }
206
+ },
207
+ TreeView: { treeViewOutline: {
208
+ padding: 0,
209
+ margin: 0,
210
+ listStyleType: "none"
211
+ } },
212
+ TreeNode: {
213
+ treeNodeBase: {
214
+ color: theme3.BASE_COLOR,
215
+ backgroundColor: theme3.BASE_BACKGROUND_COLOR,
216
+ lineHeight: theme3.TREENODE_LINE_HEIGHT,
217
+ cursor: "default",
218
+ boxSizing: "border-box",
219
+ listStyle: "none",
220
+ fontFamily: theme3.TREENODE_FONT_FAMILY,
221
+ fontSize: theme3.TREENODE_FONT_SIZE
222
+ },
223
+ treeNodePreviewContainer: {},
224
+ treeNodePlaceholder: {
225
+ whiteSpace: "pre",
226
+ fontSize: theme3.ARROW_FONT_SIZE,
227
+ marginRight: theme3.ARROW_MARGIN_RIGHT,
228
+ ...unselectable
229
+ },
230
+ treeNodeArrow: {
231
+ base: {
232
+ color: theme3.ARROW_COLOR,
233
+ display: "inline-block",
234
+ fontSize: theme3.ARROW_FONT_SIZE,
235
+ marginRight: theme3.ARROW_MARGIN_RIGHT,
236
+ ...parseFloat(theme3.ARROW_ANIMATION_DURATION) > 0 ? { transition: `transform ${theme3.ARROW_ANIMATION_DURATION} ease 0s` } : {},
237
+ ...unselectable
238
+ },
239
+ expanded: {
240
+ WebkitTransform: "rotateZ(90deg)",
241
+ MozTransform: "rotateZ(90deg)",
242
+ transform: "rotateZ(90deg)"
243
+ },
244
+ collapsed: {
245
+ WebkitTransform: "rotateZ(0deg)",
246
+ MozTransform: "rotateZ(0deg)",
247
+ transform: "rotateZ(0deg)"
248
+ }
249
+ },
250
+ treeNodeChildNodesContainer: {
251
+ margin: 0,
252
+ paddingLeft: theme3.TREENODE_PADDING_LEFT
253
+ }
254
+ },
255
+ TableInspector: { base: {
256
+ color: theme3.BASE_COLOR,
257
+ position: "relative",
258
+ border: `1px solid ${theme3.TABLE_BORDER_COLOR}`,
259
+ fontFamily: theme3.BASE_FONT_FAMILY,
260
+ fontSize: theme3.BASE_FONT_SIZE,
261
+ lineHeight: "120%",
262
+ boxSizing: "border-box",
263
+ cursor: "default"
264
+ } },
265
+ TableInspectorHeaderContainer: {
266
+ base: {
267
+ top: 0,
268
+ height: "17px",
269
+ left: 0,
270
+ right: 0,
271
+ overflowX: "hidden"
272
+ },
273
+ table: {
274
+ tableLayout: "fixed",
275
+ borderSpacing: 0,
276
+ borderCollapse: "separate",
277
+ height: "100%",
278
+ width: "100%",
279
+ margin: 0
280
+ }
281
+ },
282
+ TableInspectorDataContainer: {
283
+ tr: { display: "table-row" },
284
+ td: {
285
+ boxSizing: "border-box",
286
+ border: "none",
287
+ height: "16px",
288
+ verticalAlign: "top",
289
+ padding: "1px 4px",
290
+ WebkitUserSelect: "text",
291
+ whiteSpace: "nowrap",
292
+ textOverflow: "ellipsis",
293
+ overflow: "hidden",
294
+ lineHeight: "14px"
295
+ },
296
+ div: {
297
+ position: "static",
298
+ top: "17px",
299
+ bottom: 0,
300
+ overflowY: "overlay",
301
+ transform: "translateZ(0)",
302
+ left: 0,
303
+ right: 0,
304
+ overflowX: "hidden"
305
+ },
306
+ table: {
307
+ positon: "static",
308
+ left: 0,
309
+ top: 0,
310
+ right: 0,
311
+ bottom: 0,
312
+ borderTop: "0 none transparent",
313
+ margin: 0,
314
+ backgroundImage: theme3.TABLE_DATA_BACKGROUND_IMAGE,
315
+ backgroundSize: theme3.TABLE_DATA_BACKGROUND_SIZE,
316
+ tableLayout: "fixed",
317
+ borderSpacing: 0,
318
+ borderCollapse: "separate",
319
+ width: "100%",
320
+ fontSize: theme3.BASE_FONT_SIZE,
321
+ lineHeight: "120%"
322
+ }
323
+ },
324
+ TableInspectorTH: {
325
+ base: {
326
+ position: "relative",
327
+ height: "auto",
328
+ textAlign: "left",
329
+ backgroundColor: theme3.TABLE_TH_BACKGROUND_COLOR,
330
+ borderBottom: `1px solid ${theme3.TABLE_BORDER_COLOR}`,
331
+ fontWeight: "normal",
332
+ verticalAlign: "middle",
333
+ padding: "0 4px",
334
+ whiteSpace: "nowrap",
335
+ textOverflow: "ellipsis",
336
+ overflow: "hidden",
337
+ lineHeight: "14px",
338
+ ":hover": { backgroundColor: theme3.TABLE_TH_HOVER_COLOR }
339
+ },
340
+ div: {
341
+ whiteSpace: "nowrap",
342
+ textOverflow: "ellipsis",
343
+ overflow: "hidden",
344
+ fontSize: theme3.BASE_FONT_SIZE,
345
+ lineHeight: "120%"
346
+ }
347
+ },
348
+ TableInspectorLeftBorder: {
349
+ none: { borderLeft: "none" },
350
+ solid: { borderLeft: `1px solid ${theme3.TABLE_BORDER_COLOR}` }
351
+ },
352
+ TableInspectorSortIcon: {
353
+ display: "block",
354
+ marginRight: 3,
355
+ width: 8,
356
+ height: 7,
357
+ marginTop: -7,
358
+ color: theme3.TABLE_SORT_ICON_COLOR,
359
+ fontSize: 12,
360
+ ...unselectable
361
+ }
416
362
  });
417
363
  var DEFAULT_THEME_NAME = "chromeLight";
418
364
  var ThemeContext = createContext(createTheme(themes_exports[DEFAULT_THEME_NAME]));
419
365
  var useStyles = (baseStylesKey) => {
420
- const themeStyles = useContext(ThemeContext);
421
- return themeStyles[baseStylesKey];
366
+ const themeStyles = useContext(ThemeContext);
367
+ return themeStyles[baseStylesKey];
422
368
  };
423
369
  var themeAcceptor = (WrappedComponent) => {
424
- const ThemeAcceptor = ({ theme: theme32 = DEFAULT_THEME_NAME, ...restProps }) => {
425
- const themeStyles = useMemo(() => {
426
- switch (Object.prototype.toString.call(theme32)) {
427
- case "[object String]":
428
- return createTheme(themes_exports[theme32]);
429
- case "[object Object]":
430
- return createTheme(theme32);
431
- default:
432
- return createTheme(themes_exports[DEFAULT_THEME_NAME]);
433
- }
434
- }, [theme32]);
435
- return /* @__PURE__ */ React14.createElement(ThemeContext.Provider, {
436
- value: themeStyles
437
- }, /* @__PURE__ */ React14.createElement(WrappedComponent, {
438
- ...restProps
439
- }));
440
- };
441
- return ThemeAcceptor;
370
+ const ThemeAcceptor = ({ theme: theme3 = DEFAULT_THEME_NAME,...restProps }) => {
371
+ const themeStyles = useMemo(() => {
372
+ switch (Object.prototype.toString.call(theme3)) {
373
+ case "[object String]": return createTheme(themes_exports[theme3]);
374
+ case "[object Object]": return createTheme(theme3);
375
+ default: return createTheme(themes_exports[DEFAULT_THEME_NAME]);
376
+ }
377
+ }, [theme3]);
378
+ return /* @__PURE__ */ React.createElement(ThemeContext.Provider, { value: themeStyles }, /* @__PURE__ */ React.createElement(WrappedComponent, { ...restProps }));
379
+ };
380
+ return ThemeAcceptor;
442
381
  };
443
- var Arrow = ({ expanded, styles }) => /* @__PURE__ */ React14.createElement("span", {
444
- style: {
445
- ...styles.base,
446
- ...expanded ? styles.expanded : styles.collapsed
447
- }
448
- }, "\u25B6");
382
+ var Arrow = ({ expanded, styles }) => /* @__PURE__ */ React.createElement("span", { style: {
383
+ ...styles.base,
384
+ ...expanded ? styles.expanded : styles.collapsed
385
+ } }, "▶");
449
386
  var TreeNode = memo((props) => {
450
- props = {
451
- expanded: true,
452
- nodeRenderer: ({ name }) => /* @__PURE__ */ React14.createElement("span", null, name),
453
- onClick: () => {
454
- },
455
- shouldShowArrow: false,
456
- shouldShowPlaceholder: true,
457
- ...props
458
- };
459
- const { expanded, onClick, children, nodeRenderer, title, shouldShowArrow, shouldShowPlaceholder } = props;
460
- const styles = useStyles("TreeNode");
461
- const NodeRenderer = nodeRenderer;
462
- return /* @__PURE__ */ React14.createElement("li", {
463
- "aria-expanded": expanded,
464
- role: "treeitem",
465
- style: styles.treeNodeBase,
466
- title
467
- }, /* @__PURE__ */ React14.createElement("div", {
468
- style: styles.treeNodePreviewContainer,
469
- onClick
470
- }, shouldShowArrow || Children.count(children) > 0 ? /* @__PURE__ */ React14.createElement(Arrow, {
471
- expanded,
472
- styles: styles.treeNodeArrow
473
- }) : shouldShowPlaceholder && /* @__PURE__ */ React14.createElement("span", {
474
- style: styles.treeNodePlaceholder
475
- }, "\xA0"), /* @__PURE__ */ React14.createElement(NodeRenderer, {
476
- ...props
477
- })), /* @__PURE__ */ React14.createElement("ol", {
478
- role: "group",
479
- style: styles.treeNodeChildNodesContainer
480
- }, expanded ? children : void 0));
387
+ props = {
388
+ expanded: true,
389
+ nodeRenderer: ({ name }) => /* @__PURE__ */ React.createElement("span", null, name),
390
+ onClick: () => {},
391
+ shouldShowArrow: false,
392
+ shouldShowPlaceholder: true,
393
+ ...props
394
+ };
395
+ const { expanded, onClick, children, nodeRenderer, title, shouldShowArrow, shouldShowPlaceholder } = props;
396
+ const styles = useStyles("TreeNode");
397
+ const NodeRenderer = nodeRenderer;
398
+ return /* @__PURE__ */ React.createElement("li", {
399
+ "aria-expanded": expanded,
400
+ role: "treeitem",
401
+ style: styles.treeNodeBase,
402
+ title
403
+ }, /* @__PURE__ */ React.createElement("div", {
404
+ style: styles.treeNodePreviewContainer,
405
+ onClick
406
+ }, shouldShowArrow || Children.count(children) > 0 ? /* @__PURE__ */ React.createElement(Arrow, {
407
+ expanded,
408
+ styles: styles.treeNodeArrow
409
+ }) : shouldShowPlaceholder && /* @__PURE__ */ React.createElement("span", { style: styles.treeNodePlaceholder }, "\xA0"), /* @__PURE__ */ React.createElement(NodeRenderer, { ...props })), /* @__PURE__ */ React.createElement("ol", {
410
+ role: "group",
411
+ style: styles.treeNodeChildNodesContainer
412
+ }, expanded ? children : void 0));
481
413
  });
482
414
  var DEFAULT_ROOT_PATH = "$";
483
415
  var WILDCARD = "*";
484
416
  function hasChildNodes(data, dataIterator) {
485
- return !dataIterator(data).next().done;
417
+ return !dataIterator(data).next().done;
486
418
  }
487
419
  var wildcardPathsFromLevel = (level) => {
488
- return Array.from({ length: level }, (_, i) => [DEFAULT_ROOT_PATH].concat(Array.from({ length: i }, () => "*")).join("."));
420
+ return Array.from({ length: level }, (_, i) => [DEFAULT_ROOT_PATH].concat(Array.from({ length: i }, () => "*")).join("."));
489
421
  };
490
422
  var getExpandedPaths = (data, dataIterator, expandPaths, expandLevel, prevExpandedPaths) => {
491
- const wildcardPaths = [].concat(wildcardPathsFromLevel(expandLevel)).concat(expandPaths).filter((path) => typeof path === "string");
492
- const expandedPaths = [];
493
- wildcardPaths.forEach((wildcardPath) => {
494
- const keyPaths = wildcardPath.split(".");
495
- const populatePaths = (curData, curPath, depth) => {
496
- if (depth === keyPaths.length) {
497
- expandedPaths.push(curPath);
498
- return;
499
- }
500
- const key = keyPaths[depth];
501
- if (depth === 0) {
502
- if (hasChildNodes(curData, dataIterator) && (key === DEFAULT_ROOT_PATH || key === WILDCARD)) {
503
- populatePaths(curData, DEFAULT_ROOT_PATH, depth + 1);
504
- }
505
- } else {
506
- if (key === WILDCARD) {
507
- for (const { name, data: data2 } of dataIterator(curData)) {
508
- if (hasChildNodes(data2, dataIterator)) {
509
- populatePaths(data2, `${curPath}.${name}`, depth + 1);
510
- }
511
- }
512
- } else {
513
- const value = curData[key];
514
- if (hasChildNodes(value, dataIterator)) {
515
- populatePaths(value, `${curPath}.${key}`, depth + 1);
516
- }
517
- }
518
- }
519
- };
520
- populatePaths(data, "", 0);
521
- });
522
- return expandedPaths.reduce((obj, path) => {
523
- obj[path] = true;
524
- return obj;
525
- }, { ...prevExpandedPaths });
423
+ const wildcardPaths = [].concat(wildcardPathsFromLevel(expandLevel)).concat(expandPaths).filter((path) => typeof path === "string");
424
+ const expandedPaths = [];
425
+ wildcardPaths.forEach((wildcardPath) => {
426
+ const keyPaths = wildcardPath.split(".");
427
+ const populatePaths = (curData, curPath, depth) => {
428
+ if (depth === keyPaths.length) {
429
+ expandedPaths.push(curPath);
430
+ return;
431
+ }
432
+ const key = keyPaths[depth];
433
+ if (depth === 0) {
434
+ if (hasChildNodes(curData, dataIterator) && (key === DEFAULT_ROOT_PATH || key === WILDCARD)) populatePaths(curData, DEFAULT_ROOT_PATH, depth + 1);
435
+ } else if (key === WILDCARD) {
436
+ for (const { name, data: data2 } of dataIterator(curData)) if (hasChildNodes(data2, dataIterator)) populatePaths(data2, `${curPath}.${name}`, depth + 1);
437
+ } else {
438
+ const value = curData[key];
439
+ if (hasChildNodes(value, dataIterator)) populatePaths(value, `${curPath}.${key}`, depth + 1);
440
+ }
441
+ };
442
+ populatePaths(data, "", 0);
443
+ });
444
+ return expandedPaths.reduce((obj, path) => {
445
+ obj[path] = true;
446
+ return obj;
447
+ }, { ...prevExpandedPaths });
526
448
  };
527
449
  var ConnectedTreeNode = memo((props) => {
528
- const { data, dataIterator, path, depth, nodeRenderer } = props;
529
- const [expandedPaths, setExpandedPaths] = useContext(ExpandedPathsContext);
530
- const nodeHasChildNodes = hasChildNodes(data, dataIterator);
531
- const expanded = !!expandedPaths[path];
532
- const handleClick = useCallback(() => nodeHasChildNodes && setExpandedPaths((prevExpandedPaths) => ({
533
- ...prevExpandedPaths,
534
- [path]: !expanded
535
- })), [nodeHasChildNodes, setExpandedPaths, path, expanded]);
536
- return /* @__PURE__ */ React14.createElement(TreeNode, {
537
- expanded,
538
- onClick: handleClick,
539
- shouldShowArrow: nodeHasChildNodes,
540
- shouldShowPlaceholder: depth > 0,
541
- nodeRenderer,
542
- ...props
543
- }, expanded ? [...dataIterator(data)].map(({ name, data: data2, ...renderNodeProps }) => {
544
- return /* @__PURE__ */ React14.createElement(ConnectedTreeNode, {
545
- name,
546
- data: data2,
547
- depth: depth + 1,
548
- path: `${path}.${name}`,
549
- key: name,
550
- dataIterator,
551
- nodeRenderer,
552
- ...renderNodeProps
553
- });
554
- }) : null);
450
+ const { data, dataIterator, path, depth, nodeRenderer } = props;
451
+ const [expandedPaths, setExpandedPaths] = useContext(ExpandedPathsContext);
452
+ const nodeHasChildNodes = hasChildNodes(data, dataIterator);
453
+ const expanded = !!expandedPaths[path];
454
+ const handleClick = useCallback(() => nodeHasChildNodes && setExpandedPaths((prevExpandedPaths) => ({
455
+ ...prevExpandedPaths,
456
+ [path]: !expanded
457
+ })), [
458
+ nodeHasChildNodes,
459
+ setExpandedPaths,
460
+ path,
461
+ expanded
462
+ ]);
463
+ return /* @__PURE__ */ React.createElement(TreeNode, {
464
+ expanded,
465
+ onClick: handleClick,
466
+ shouldShowArrow: nodeHasChildNodes,
467
+ shouldShowPlaceholder: depth > 0,
468
+ nodeRenderer,
469
+ ...props
470
+ }, expanded ? [...dataIterator(data)].map(({ name, data: data2,...renderNodeProps }) => {
471
+ return /* @__PURE__ */ React.createElement(ConnectedTreeNode, {
472
+ name,
473
+ data: data2,
474
+ depth: depth + 1,
475
+ path: `${path}.${name}`,
476
+ key: name,
477
+ dataIterator,
478
+ nodeRenderer,
479
+ ...renderNodeProps
480
+ });
481
+ }) : null);
555
482
  });
556
483
  var TreeView = memo(({ name, data, dataIterator, nodeRenderer, expandPaths, expandLevel }) => {
557
- const styles = useStyles("TreeView");
558
- const stateAndSetter = useState({});
559
- const [, setExpandedPaths] = stateAndSetter;
560
- useLayoutEffect(() => setExpandedPaths((prevExpandedPaths) => getExpandedPaths(data, dataIterator, expandPaths, expandLevel, prevExpandedPaths)), [data, dataIterator, expandPaths, expandLevel]);
561
- return /* @__PURE__ */ React14.createElement(ExpandedPathsContext.Provider, {
562
- value: stateAndSetter
563
- }, /* @__PURE__ */ React14.createElement("ol", {
564
- role: "tree",
565
- style: styles.treeViewOutline
566
- }, /* @__PURE__ */ React14.createElement(ConnectedTreeNode, {
567
- name,
568
- data,
569
- dataIterator,
570
- depth: 0,
571
- path: DEFAULT_ROOT_PATH,
572
- nodeRenderer
573
- })));
484
+ const styles = useStyles("TreeView");
485
+ const stateAndSetter = useState({});
486
+ const [, setExpandedPaths] = stateAndSetter;
487
+ useLayoutEffect(() => setExpandedPaths((prevExpandedPaths) => getExpandedPaths(data, dataIterator, expandPaths, expandLevel, prevExpandedPaths)), [
488
+ data,
489
+ dataIterator,
490
+ expandPaths,
491
+ expandLevel
492
+ ]);
493
+ return /* @__PURE__ */ React.createElement(ExpandedPathsContext.Provider, { value: stateAndSetter }, /* @__PURE__ */ React.createElement("ol", {
494
+ role: "tree",
495
+ style: styles.treeViewOutline
496
+ }, /* @__PURE__ */ React.createElement(ConnectedTreeNode, {
497
+ name,
498
+ data,
499
+ dataIterator,
500
+ depth: 0,
501
+ path: DEFAULT_ROOT_PATH,
502
+ nodeRenderer
503
+ })));
574
504
  });
575
505
  var ObjectName = ({ name, dimmed = false, styles = {} }) => {
576
- const themeStyles = useStyles("ObjectName");
577
- const appliedStyles = {
578
- ...themeStyles.base,
579
- ...dimmed ? themeStyles["dimmed"] : {},
580
- ...styles
581
- };
582
- return /* @__PURE__ */ React14.createElement("span", {
583
- style: appliedStyles
584
- }, name);
506
+ const themeStyles = useStyles("ObjectName");
507
+ const appliedStyles = {
508
+ ...themeStyles.base,
509
+ ...dimmed ? themeStyles["dimmed"] : {},
510
+ ...styles
511
+ };
512
+ return /* @__PURE__ */ React.createElement("span", { style: appliedStyles }, name);
585
513
  };
586
514
  var ObjectValue = ({ object, styles }) => {
587
- const themeStyles = useStyles("ObjectValue");
588
- const mkStyle = (key) => ({ ...themeStyles[key], ...styles });
589
- switch (typeof object) {
590
- case "bigint":
591
- return /* @__PURE__ */ React14.createElement("span", {
592
- style: mkStyle("objectValueNumber")
593
- }, String(object), "n");
594
- case "number":
595
- return /* @__PURE__ */ React14.createElement("span", {
596
- style: mkStyle("objectValueNumber")
597
- }, String(object));
598
- case "string":
599
- return /* @__PURE__ */ React14.createElement("span", {
600
- style: mkStyle("objectValueString")
601
- }, '"', object, '"');
602
- case "boolean":
603
- return /* @__PURE__ */ React14.createElement("span", {
604
- style: mkStyle("objectValueBoolean")
605
- }, String(object));
606
- case "undefined":
607
- return /* @__PURE__ */ React14.createElement("span", {
608
- style: mkStyle("objectValueUndefined")
609
- }, "undefined");
610
- case "object":
611
- if (object === null) {
612
- return /* @__PURE__ */ React14.createElement("span", {
613
- style: mkStyle("objectValueNull")
614
- }, "null");
615
- }
616
- if (object instanceof Date) {
617
- return /* @__PURE__ */ React14.createElement("span", null, object.toString());
618
- }
619
- if (object instanceof RegExp) {
620
- return /* @__PURE__ */ React14.createElement("span", {
621
- style: mkStyle("objectValueRegExp")
622
- }, object.toString());
623
- }
624
- if (Array.isArray(object)) {
625
- return /* @__PURE__ */ React14.createElement("span", null, `Array(${object.length})`);
626
- }
627
- if (!object.constructor) {
628
- return /* @__PURE__ */ React14.createElement("span", null, "Object");
629
- }
630
- if (typeof object.constructor.isBuffer === "function" && object.constructor.isBuffer(object)) {
631
- return /* @__PURE__ */ React14.createElement("span", null, `Buffer[${object.length}]`);
632
- }
633
- return /* @__PURE__ */ React14.createElement("span", null, object.constructor.name);
634
- case "function":
635
- return /* @__PURE__ */ React14.createElement("span", null, /* @__PURE__ */ React14.createElement("span", {
636
- style: mkStyle("objectValueFunctionPrefix")
637
- }, "\u0192\xA0"), /* @__PURE__ */ React14.createElement("span", {
638
- style: mkStyle("objectValueFunctionName")
639
- }, object.name, "()"));
640
- case "symbol":
641
- return /* @__PURE__ */ React14.createElement("span", {
642
- style: mkStyle("objectValueSymbol")
643
- }, object.toString());
644
- default:
645
- return /* @__PURE__ */ React14.createElement("span", null);
646
- }
515
+ const themeStyles = useStyles("ObjectValue");
516
+ const mkStyle = (key) => ({
517
+ ...themeStyles[key],
518
+ ...styles
519
+ });
520
+ switch (typeof object) {
521
+ case "bigint": return /* @__PURE__ */ React.createElement("span", { style: mkStyle("objectValueNumber") }, String(object), "n");
522
+ case "number": return /* @__PURE__ */ React.createElement("span", { style: mkStyle("objectValueNumber") }, String(object));
523
+ case "string": return /* @__PURE__ */ React.createElement("span", { style: mkStyle("objectValueString") }, "\"", object, "\"");
524
+ case "boolean": return /* @__PURE__ */ React.createElement("span", { style: mkStyle("objectValueBoolean") }, String(object));
525
+ case "undefined": return /* @__PURE__ */ React.createElement("span", { style: mkStyle("objectValueUndefined") }, "undefined");
526
+ case "object":
527
+ if (object === null) return /* @__PURE__ */ React.createElement("span", { style: mkStyle("objectValueNull") }, "null");
528
+ if (object instanceof Date) return /* @__PURE__ */ React.createElement("span", null, object.toString());
529
+ if (object instanceof RegExp) return /* @__PURE__ */ React.createElement("span", { style: mkStyle("objectValueRegExp") }, object.toString());
530
+ if (Array.isArray(object)) return /* @__PURE__ */ React.createElement("span", null, `Array(${object.length})`);
531
+ if (!object.constructor) return /* @__PURE__ */ React.createElement("span", null, "Object");
532
+ if (typeof object.constructor.isBuffer === "function" && object.constructor.isBuffer(object)) return /* @__PURE__ */ React.createElement("span", null, `Buffer[${object.length}]`);
533
+ return /* @__PURE__ */ React.createElement("span", null, object.constructor.name);
534
+ case "function": return /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement("span", { style: mkStyle("objectValueFunctionPrefix") }, "ƒ\xA0"), /* @__PURE__ */ React.createElement("span", { style: mkStyle("objectValueFunctionName") }, object.name, "()"));
535
+ case "symbol": return /* @__PURE__ */ React.createElement("span", { style: mkStyle("objectValueSymbol") }, object.toString());
536
+ default: return /* @__PURE__ */ React.createElement("span", null);
537
+ }
647
538
  };
648
539
  var hasOwnProperty = Object.prototype.hasOwnProperty;
649
540
  var propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
650
541
  function getPropertyValue(object, propertyName) {
651
- const propertyDescriptor = Object.getOwnPropertyDescriptor(object, propertyName);
652
- if (propertyDescriptor.get) {
653
- try {
654
- return propertyDescriptor.get();
655
- } catch {
656
- return propertyDescriptor.get;
657
- }
658
- }
659
- return object[propertyName];
542
+ const propertyDescriptor = Object.getOwnPropertyDescriptor(object, propertyName);
543
+ if (propertyDescriptor.get) try {
544
+ return propertyDescriptor.get();
545
+ } catch {
546
+ return propertyDescriptor.get;
547
+ }
548
+ return object[propertyName];
660
549
  }
661
550
  function intersperse(arr, sep) {
662
- if (arr.length === 0) {
663
- return [];
664
- }
665
- return arr.slice(1).reduce((xs, x) => xs.concat([sep, x]), [arr[0]]);
551
+ if (arr.length === 0) return [];
552
+ return arr.slice(1).reduce((xs, x) => xs.concat([sep, x]), [arr[0]]);
666
553
  }
667
554
  var ObjectPreview = ({ data }) => {
668
- const styles = useStyles("ObjectPreview");
669
- const object = data;
670
- if (typeof object !== "object" || object === null || object instanceof Date || object instanceof RegExp) {
671
- return /* @__PURE__ */ React14.createElement(ObjectValue, {
672
- object
673
- });
674
- }
675
- if (Array.isArray(object)) {
676
- const maxProperties = styles.arrayMaxProperties;
677
- const previewArray = object.slice(0, maxProperties).map((element, index) => /* @__PURE__ */ React14.createElement(ObjectValue, {
678
- key: index,
679
- object: element
680
- }));
681
- if (object.length > maxProperties) {
682
- previewArray.push(/* @__PURE__ */ React14.createElement("span", {
683
- key: "ellipsis"
684
- }, "\u2026"));
685
- }
686
- const arrayLength = object.length;
687
- return /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement("span", {
688
- style: styles.objectDescription
689
- }, arrayLength === 0 ? `` : `(${arrayLength})\xA0`), /* @__PURE__ */ React14.createElement("span", {
690
- style: styles.preview
691
- }, "[", intersperse(previewArray, ", "), "]"));
692
- } else {
693
- const maxProperties = styles.objectMaxProperties;
694
- const propertyNodes = [];
695
- for (const propertyName in object) {
696
- if (hasOwnProperty.call(object, propertyName)) {
697
- let ellipsis;
698
- if (propertyNodes.length === maxProperties - 1 && Object.keys(object).length > maxProperties) {
699
- ellipsis = /* @__PURE__ */ React14.createElement("span", {
700
- key: "ellipsis"
701
- }, "\u2026");
702
- }
703
- const propertyValue = getPropertyValue(object, propertyName);
704
- propertyNodes.push(/* @__PURE__ */ React14.createElement("span", {
705
- key: propertyName
706
- }, /* @__PURE__ */ React14.createElement(ObjectName, {
707
- name: propertyName || `""`
708
- }), ":\xA0", /* @__PURE__ */ React14.createElement(ObjectValue, {
709
- object: propertyValue
710
- }), ellipsis));
711
- if (ellipsis)
712
- break;
713
- }
714
- }
715
- const objectConstructorName = object.constructor ? object.constructor.name : "Object";
716
- return /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement("span", {
717
- style: styles.objectDescription
718
- }, objectConstructorName === "Object" ? "" : `${objectConstructorName} `), /* @__PURE__ */ React14.createElement("span", {
719
- style: styles.preview
720
- }, "{", intersperse(propertyNodes, ", "), "}"));
721
- }
555
+ const styles = useStyles("ObjectPreview");
556
+ const object = data;
557
+ if (typeof object !== "object" || object === null || object instanceof Date || object instanceof RegExp) return /* @__PURE__ */ React.createElement(ObjectValue, { object });
558
+ if (Array.isArray(object)) {
559
+ const maxProperties = styles.arrayMaxProperties;
560
+ const previewArray = object.slice(0, maxProperties).map((element, index) => /* @__PURE__ */ React.createElement(ObjectValue, {
561
+ key: index,
562
+ object: element
563
+ }));
564
+ if (object.length > maxProperties) previewArray.push(/* @__PURE__ */ React.createElement("span", { key: "ellipsis" }, "…"));
565
+ const arrayLength = object.length;
566
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("span", { style: styles.objectDescription }, arrayLength === 0 ? `` : `(${arrayLength})\xA0`), /* @__PURE__ */ React.createElement("span", { style: styles.preview }, "[", intersperse(previewArray, ", "), "]"));
567
+ } else {
568
+ const maxProperties = styles.objectMaxProperties;
569
+ const propertyNodes = [];
570
+ for (const propertyName in object) if (hasOwnProperty.call(object, propertyName)) {
571
+ let ellipsis;
572
+ if (propertyNodes.length === maxProperties - 1 && Object.keys(object).length > maxProperties) ellipsis = /* @__PURE__ */ React.createElement("span", { key: "ellipsis" }, "…");
573
+ const propertyValue = getPropertyValue(object, propertyName);
574
+ propertyNodes.push(/* @__PURE__ */ React.createElement("span", { key: propertyName }, /* @__PURE__ */ React.createElement(ObjectName, { name: propertyName || `""` }), ":\xA0", /* @__PURE__ */ React.createElement(ObjectValue, { object: propertyValue }), ellipsis));
575
+ if (ellipsis) break;
576
+ }
577
+ const objectConstructorName = object.constructor ? object.constructor.name : "Object";
578
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("span", { style: styles.objectDescription }, objectConstructorName === "Object" ? "" : `${objectConstructorName} `), /* @__PURE__ */ React.createElement("span", { style: styles.preview }, "{", intersperse(propertyNodes, ", "), "}"));
579
+ }
722
580
  };
723
581
  var ObjectRootLabel = ({ name, data }) => {
724
- if (typeof name === "string") {
725
- return /* @__PURE__ */ React14.createElement("span", null, /* @__PURE__ */ React14.createElement(ObjectName, {
726
- name
727
- }), /* @__PURE__ */ React14.createElement("span", null, ": "), /* @__PURE__ */ React14.createElement(ObjectPreview, {
728
- data
729
- }));
730
- } else {
731
- return /* @__PURE__ */ React14.createElement(ObjectPreview, {
732
- data
733
- });
734
- }
582
+ if (typeof name === "string") return /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(ObjectName, { name }), /* @__PURE__ */ React.createElement("span", null, ": "), /* @__PURE__ */ React.createElement(ObjectPreview, { data }));
583
+ else return /* @__PURE__ */ React.createElement(ObjectPreview, { data });
735
584
  };
736
585
  var ObjectLabel = ({ name, data, isNonenumerable = false }) => {
737
- const object = data;
738
- return /* @__PURE__ */ React14.createElement("span", null, typeof name === "string" ? /* @__PURE__ */ React14.createElement(ObjectName, {
739
- name,
740
- dimmed: isNonenumerable
741
- }) : /* @__PURE__ */ React14.createElement(ObjectPreview, {
742
- data: name
743
- }), /* @__PURE__ */ React14.createElement("span", null, ": "), /* @__PURE__ */ React14.createElement(ObjectValue, {
744
- object
745
- }));
586
+ const object = data;
587
+ return /* @__PURE__ */ React.createElement("span", null, typeof name === "string" ? /* @__PURE__ */ React.createElement(ObjectName, {
588
+ name,
589
+ dimmed: isNonenumerable
590
+ }) : /* @__PURE__ */ React.createElement(ObjectPreview, { data: name }), /* @__PURE__ */ React.createElement("span", null, ": "), /* @__PURE__ */ React.createElement(ObjectValue, { object }));
746
591
  };
747
592
  var createIterator = (showNonenumerable, sortObjectKeys) => {
748
- const objectIterator = function* (data) {
749
- const shouldIterate = typeof data === "object" && data !== null || typeof data === "function";
750
- if (!shouldIterate)
751
- return;
752
- const dataIsArray = Array.isArray(data);
753
- if (!dataIsArray && data[Symbol.iterator]) {
754
- let i = 0;
755
- for (const entry of data) {
756
- if (Array.isArray(entry) && entry.length === 2) {
757
- const [k, v] = entry;
758
- yield {
759
- name: k,
760
- data: v
761
- };
762
- } else {
763
- yield {
764
- name: i.toString(),
765
- data: entry
766
- };
767
- }
768
- i++;
769
- }
770
- } else {
771
- const keys = Object.getOwnPropertyNames(data);
772
- if (sortObjectKeys === true && !dataIsArray) {
773
- keys.sort();
774
- } else if (typeof sortObjectKeys === "function") {
775
- keys.sort(sortObjectKeys);
776
- }
777
- for (const propertyName of keys) {
778
- if (propertyIsEnumerable.call(data, propertyName)) {
779
- const propertyValue = getPropertyValue(data, propertyName);
780
- yield {
781
- name: propertyName || `""`,
782
- data: propertyValue
783
- };
784
- } else if (showNonenumerable) {
785
- let propertyValue;
786
- try {
787
- propertyValue = getPropertyValue(data, propertyName);
788
- } catch (e) {
789
- }
790
- if (propertyValue !== void 0) {
791
- yield {
792
- name: propertyName,
793
- data: propertyValue,
794
- isNonenumerable: true
795
- };
796
- }
797
- }
798
- }
799
- if (showNonenumerable && data !== Object.prototype) {
800
- yield {
801
- name: "__proto__",
802
- data: Object.getPrototypeOf(data),
803
- isNonenumerable: true
804
- };
805
- }
806
- }
807
- };
808
- return objectIterator;
593
+ const objectIterator = function* (data) {
594
+ const shouldIterate = typeof data === "object" && data !== null || typeof data === "function";
595
+ if (!shouldIterate) return;
596
+ const dataIsArray = Array.isArray(data);
597
+ if (!dataIsArray && data[Symbol.iterator]) {
598
+ let i = 0;
599
+ for (const entry of data) {
600
+ if (Array.isArray(entry) && entry.length === 2) {
601
+ const [k, v] = entry;
602
+ yield {
603
+ name: k,
604
+ data: v
605
+ };
606
+ } else yield {
607
+ name: i.toString(),
608
+ data: entry
609
+ };
610
+ i++;
611
+ }
612
+ } else {
613
+ const keys = Object.getOwnPropertyNames(data);
614
+ if (sortObjectKeys === true && !dataIsArray) keys.sort();
615
+ else if (typeof sortObjectKeys === "function") keys.sort(sortObjectKeys);
616
+ for (const propertyName of keys) if (propertyIsEnumerable.call(data, propertyName)) {
617
+ const propertyValue = getPropertyValue(data, propertyName);
618
+ yield {
619
+ name: propertyName || `""`,
620
+ data: propertyValue
621
+ };
622
+ } else if (showNonenumerable) {
623
+ let propertyValue;
624
+ try {
625
+ propertyValue = getPropertyValue(data, propertyName);
626
+ } catch (e) {}
627
+ if (propertyValue !== void 0) yield {
628
+ name: propertyName,
629
+ data: propertyValue,
630
+ isNonenumerable: true
631
+ };
632
+ }
633
+ if (showNonenumerable && data !== Object.prototype) yield {
634
+ name: "__proto__",
635
+ data: Object.getPrototypeOf(data),
636
+ isNonenumerable: true
637
+ };
638
+ }
639
+ };
640
+ return objectIterator;
809
641
  };
810
- var defaultNodeRenderer = ({ depth, name, data, isNonenumerable }) => depth === 0 ? /* @__PURE__ */ React14.createElement(ObjectRootLabel, {
811
- name,
812
- data
813
- }) : /* @__PURE__ */ React14.createElement(ObjectLabel, {
814
- name,
815
- data,
816
- isNonenumerable
642
+ var defaultNodeRenderer = ({ depth, name, data, isNonenumerable }) => depth === 0 ? /* @__PURE__ */ React.createElement(ObjectRootLabel, {
643
+ name,
644
+ data
645
+ }) : /* @__PURE__ */ React.createElement(ObjectLabel, {
646
+ name,
647
+ data,
648
+ isNonenumerable
817
649
  });
818
- var ObjectInspector = ({ showNonenumerable = false, sortObjectKeys, nodeRenderer, ...treeViewProps }) => {
819
- const dataIterator = createIterator(showNonenumerable, sortObjectKeys);
820
- const renderer = nodeRenderer ? nodeRenderer : defaultNodeRenderer;
821
- return /* @__PURE__ */ React14.createElement(TreeView, {
822
- nodeRenderer: renderer,
823
- dataIterator,
824
- ...treeViewProps
825
- });
650
+ var ObjectInspector = ({ showNonenumerable = false, sortObjectKeys, nodeRenderer,...treeViewProps }) => {
651
+ const dataIterator = createIterator(showNonenumerable, sortObjectKeys);
652
+ const renderer = nodeRenderer ? nodeRenderer : defaultNodeRenderer;
653
+ return /* @__PURE__ */ React.createElement(TreeView, {
654
+ nodeRenderer: renderer,
655
+ dataIterator,
656
+ ...treeViewProps
657
+ });
826
658
  };
827
659
  var themedObjectInspector = themeAcceptor(ObjectInspector);
828
660
  function getHeaders(data) {
829
- if (typeof data === "object") {
830
- let rowHeaders = [];
831
- if (Array.isArray(data)) {
832
- const nRows = data.length;
833
- rowHeaders = [...Array(nRows).keys()];
834
- } else if (data !== null) {
835
- rowHeaders = Object.keys(data);
836
- }
837
- const colHeaders = rowHeaders.reduce((colHeaders2, rowHeader) => {
838
- const row = data[rowHeader];
839
- if (typeof row === "object" && row !== null) {
840
- const cols = Object.keys(row);
841
- cols.reduce((xs, x) => {
842
- if (!xs.includes(x)) {
843
- xs.push(x);
844
- }
845
- return xs;
846
- }, colHeaders2);
847
- }
848
- return colHeaders2;
849
- }, []);
850
- return {
851
- rowHeaders,
852
- colHeaders
853
- };
854
- }
855
- return void 0;
661
+ if (typeof data === "object") {
662
+ let rowHeaders = [];
663
+ if (Array.isArray(data)) {
664
+ const nRows = data.length;
665
+ rowHeaders = [...Array(nRows).keys()];
666
+ } else if (data !== null) rowHeaders = Object.keys(data);
667
+ const colHeaders = rowHeaders.reduce((colHeaders2, rowHeader) => {
668
+ const row = data[rowHeader];
669
+ if (typeof row === "object" && row !== null) {
670
+ const cols = Object.keys(row);
671
+ cols.reduce((xs, x) => {
672
+ if (!xs.includes(x)) xs.push(x);
673
+ return xs;
674
+ }, colHeaders2);
675
+ }
676
+ return colHeaders2;
677
+ }, []);
678
+ return {
679
+ rowHeaders,
680
+ colHeaders
681
+ };
682
+ }
683
+ return void 0;
856
684
  }
857
685
  var DataContainer = ({ rows, columns, rowsData }) => {
858
- const styles = useStyles("TableInspectorDataContainer");
859
- const borderStyles = useStyles("TableInspectorLeftBorder");
860
- return /* @__PURE__ */ React14.createElement("div", {
861
- style: styles.div
862
- }, /* @__PURE__ */ React14.createElement("table", {
863
- style: styles.table
864
- }, /* @__PURE__ */ React14.createElement("colgroup", null), /* @__PURE__ */ React14.createElement("tbody", null, rows.map((row, i) => /* @__PURE__ */ React14.createElement("tr", {
865
- key: row,
866
- style: styles.tr
867
- }, /* @__PURE__ */ React14.createElement("td", {
868
- style: { ...styles.td, ...borderStyles.none }
869
- }, row), columns.map((column) => {
870
- const rowData = rowsData[i];
871
- if (typeof rowData === "object" && rowData !== null && hasOwnProperty.call(rowData, column)) {
872
- return /* @__PURE__ */ React14.createElement("td", {
873
- key: column,
874
- style: { ...styles.td, ...borderStyles.solid }
875
- }, /* @__PURE__ */ React14.createElement(ObjectValue, {
876
- object: rowData[column]
877
- }));
878
- } else {
879
- return /* @__PURE__ */ React14.createElement("td", {
880
- key: column,
881
- style: { ...styles.td, ...borderStyles.solid }
882
- });
883
- }
884
- }))))));
686
+ const styles = useStyles("TableInspectorDataContainer");
687
+ const borderStyles = useStyles("TableInspectorLeftBorder");
688
+ return /* @__PURE__ */ React.createElement("div", { style: styles.div }, /* @__PURE__ */ React.createElement("table", { style: styles.table }, /* @__PURE__ */ React.createElement("colgroup", null), /* @__PURE__ */ React.createElement("tbody", null, rows.map((row, i) => /* @__PURE__ */ React.createElement("tr", {
689
+ key: row,
690
+ style: styles.tr
691
+ }, /* @__PURE__ */ React.createElement("td", { style: {
692
+ ...styles.td,
693
+ ...borderStyles.none
694
+ } }, row), columns.map((column) => {
695
+ const rowData = rowsData[i];
696
+ if (typeof rowData === "object" && rowData !== null && hasOwnProperty.call(rowData, column)) return /* @__PURE__ */ React.createElement("td", {
697
+ key: column,
698
+ style: {
699
+ ...styles.td,
700
+ ...borderStyles.solid
701
+ }
702
+ }, /* @__PURE__ */ React.createElement(ObjectValue, { object: rowData[column] }));
703
+ else return /* @__PURE__ */ React.createElement("td", {
704
+ key: column,
705
+ style: {
706
+ ...styles.td,
707
+ ...borderStyles.solid
708
+ }
709
+ });
710
+ }))))));
885
711
  };
886
- var SortIconContainer = (props) => /* @__PURE__ */ React14.createElement("div", {
887
- style: {
888
- position: "absolute",
889
- top: 1,
890
- right: 0,
891
- bottom: 1,
892
- display: "flex",
893
- alignItems: "center"
894
- }
895
- }, props.children);
712
+ var SortIconContainer = (props) => /* @__PURE__ */ React.createElement("div", { style: {
713
+ position: "absolute",
714
+ top: 1,
715
+ right: 0,
716
+ bottom: 1,
717
+ display: "flex",
718
+ alignItems: "center"
719
+ } }, props.children);
896
720
  var SortIcon = ({ sortAscending }) => {
897
- const styles = useStyles("TableInspectorSortIcon");
898
- const glyph = sortAscending ? "\u25B2" : "\u25BC";
899
- return /* @__PURE__ */ React14.createElement("div", {
900
- style: styles
901
- }, glyph);
721
+ const styles = useStyles("TableInspectorSortIcon");
722
+ const glyph = sortAscending ? "" : "";
723
+ return /* @__PURE__ */ React.createElement("div", { style: styles }, glyph);
902
724
  };
903
- var TH = ({
904
- sortAscending = false,
905
- sorted = false,
906
- onClick = void 0,
907
- borderStyle = {},
908
- children,
909
- ...thProps
910
- }) => {
911
- const styles = useStyles("TableInspectorTH");
912
- const [hovered, setHovered] = useState(false);
913
- const handleMouseEnter = useCallback(() => setHovered(true), []);
914
- const handleMouseLeave = useCallback(() => setHovered(false), []);
915
- return /* @__PURE__ */ React14.createElement("th", {
916
- ...thProps,
917
- style: {
918
- ...styles.base,
919
- ...borderStyle,
920
- ...hovered ? styles.base[":hover"] : {}
921
- },
922
- onMouseEnter: handleMouseEnter,
923
- onMouseLeave: handleMouseLeave,
924
- onClick
925
- }, /* @__PURE__ */ React14.createElement("div", {
926
- style: styles.div
927
- }, children), sorted && /* @__PURE__ */ React14.createElement(SortIconContainer, null, /* @__PURE__ */ React14.createElement(SortIcon, {
928
- sortAscending
929
- })));
725
+ var TH = ({ sortAscending = false, sorted = false, onClick = void 0, borderStyle = {}, children,...thProps }) => {
726
+ const styles = useStyles("TableInspectorTH");
727
+ const [hovered, setHovered] = useState(false);
728
+ const handleMouseEnter = useCallback(() => setHovered(true), []);
729
+ const handleMouseLeave = useCallback(() => setHovered(false), []);
730
+ return /* @__PURE__ */ React.createElement("th", {
731
+ ...thProps,
732
+ style: {
733
+ ...styles.base,
734
+ ...borderStyle,
735
+ ...hovered ? styles.base[":hover"] : {}
736
+ },
737
+ onMouseEnter: handleMouseEnter,
738
+ onMouseLeave: handleMouseLeave,
739
+ onClick
740
+ }, /* @__PURE__ */ React.createElement("div", { style: styles.div }, children), sorted && /* @__PURE__ */ React.createElement(SortIconContainer, null, /* @__PURE__ */ React.createElement(SortIcon, { sortAscending })));
930
741
  };
931
- var HeaderContainer = ({
932
- indexColumnText = "(index)",
933
- columns = [],
934
- sorted,
935
- sortIndexColumn,
936
- sortColumn,
937
- sortAscending,
938
- onTHClick,
939
- onIndexTHClick
940
- }) => {
941
- const styles = useStyles("TableInspectorHeaderContainer");
942
- const borderStyles = useStyles("TableInspectorLeftBorder");
943
- return /* @__PURE__ */ React14.createElement("div", {
944
- style: styles.base
945
- }, /* @__PURE__ */ React14.createElement("table", {
946
- style: styles.table
947
- }, /* @__PURE__ */ React14.createElement("tbody", null, /* @__PURE__ */ React14.createElement("tr", null, /* @__PURE__ */ React14.createElement(TH, {
948
- borderStyle: borderStyles.none,
949
- sorted: sorted && sortIndexColumn,
950
- sortAscending,
951
- onClick: onIndexTHClick
952
- }, indexColumnText), columns.map((column) => /* @__PURE__ */ React14.createElement(TH, {
953
- borderStyle: borderStyles.solid,
954
- key: column,
955
- sorted: sorted && sortColumn === column,
956
- sortAscending,
957
- onClick: onTHClick.bind(null, column)
958
- }, column))))));
742
+ var HeaderContainer = ({ indexColumnText = "(index)", columns = [], sorted, sortIndexColumn, sortColumn, sortAscending, onTHClick, onIndexTHClick }) => {
743
+ const styles = useStyles("TableInspectorHeaderContainer");
744
+ const borderStyles = useStyles("TableInspectorLeftBorder");
745
+ return /* @__PURE__ */ React.createElement("div", { style: styles.base }, /* @__PURE__ */ React.createElement("table", { style: styles.table }, /* @__PURE__ */ React.createElement("tbody", null, /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement(TH, {
746
+ borderStyle: borderStyles.none,
747
+ sorted: sorted && sortIndexColumn,
748
+ sortAscending,
749
+ onClick: onIndexTHClick
750
+ }, indexColumnText), columns.map((column) => /* @__PURE__ */ React.createElement(TH, {
751
+ borderStyle: borderStyles.solid,
752
+ key: column,
753
+ sorted: sorted && sortColumn === column,
754
+ sortAscending,
755
+ onClick: onTHClick.bind(null, column)
756
+ }, column))))));
959
757
  };
960
- var TableInspector = ({
961
- data,
962
- columns
963
- }) => {
964
- const styles = useStyles("TableInspector");
965
- const [{ sorted, sortIndexColumn, sortColumn, sortAscending }, setState] = useState({
966
- sorted: false,
967
- sortIndexColumn: false,
968
- sortColumn: void 0,
969
- sortAscending: false
970
- });
971
- const handleIndexTHClick = useCallback(() => {
972
- setState(({ sortIndexColumn: sortIndexColumn2, sortAscending: sortAscending2 }) => ({
973
- sorted: true,
974
- sortIndexColumn: true,
975
- sortColumn: void 0,
976
- sortAscending: sortIndexColumn2 ? !sortAscending2 : true
977
- }));
978
- }, []);
979
- const handleTHClick = useCallback((col) => {
980
- setState(({ sortColumn: sortColumn2, sortAscending: sortAscending2 }) => ({
981
- sorted: true,
982
- sortIndexColumn: false,
983
- sortColumn: col,
984
- sortAscending: col === sortColumn2 ? !sortAscending2 : true
985
- }));
986
- }, []);
987
- if (typeof data !== "object" || data === null) {
988
- return /* @__PURE__ */ React14.createElement("div", null);
989
- }
990
- let { rowHeaders, colHeaders } = getHeaders(data);
991
- if (columns !== void 0) {
992
- colHeaders = columns;
993
- }
994
- let rowsData = rowHeaders.map((rowHeader) => data[rowHeader]);
995
- let columnDataWithRowIndexes;
996
- if (sortColumn !== void 0) {
997
- columnDataWithRowIndexes = rowsData.map((rowData, index) => {
998
- if (typeof rowData === "object" && rowData !== null) {
999
- const columnData = rowData[sortColumn];
1000
- return [columnData, index];
1001
- }
1002
- return [void 0, index];
1003
- });
1004
- } else {
1005
- if (sortIndexColumn) {
1006
- columnDataWithRowIndexes = rowHeaders.map((rowData, index) => {
1007
- const columnData = rowHeaders[index];
1008
- return [columnData, index];
1009
- });
1010
- }
1011
- }
1012
- if (columnDataWithRowIndexes !== void 0) {
1013
- const comparator = (mapper, ascending) => {
1014
- return (a, b) => {
1015
- const v1 = mapper(a);
1016
- const v2 = mapper(b);
1017
- const type1 = typeof v1;
1018
- const type2 = typeof v2;
1019
- const lt = (v12, v22) => {
1020
- if (v12 < v22) {
1021
- return -1;
1022
- } else if (v12 > v22) {
1023
- return 1;
1024
- } else {
1025
- return 0;
1026
- }
1027
- };
1028
- let result;
1029
- if (type1 === type2) {
1030
- result = lt(v1, v2);
1031
- } else {
1032
- const order = {
1033
- string: 0,
1034
- number: 1,
1035
- object: 2,
1036
- symbol: 3,
1037
- boolean: 4,
1038
- undefined: 5,
1039
- function: 6
1040
- };
1041
- result = lt(order[type1], order[type2]);
1042
- }
1043
- if (!ascending)
1044
- result = -result;
1045
- return result;
1046
- };
1047
- };
1048
- const sortedRowIndexes = columnDataWithRowIndexes.sort(comparator((item) => item[0], sortAscending)).map((item) => item[1]);
1049
- rowHeaders = sortedRowIndexes.map((i) => rowHeaders[i]);
1050
- rowsData = sortedRowIndexes.map((i) => rowsData[i]);
1051
- }
1052
- return /* @__PURE__ */ React14.createElement("div", {
1053
- style: styles.base
1054
- }, /* @__PURE__ */ React14.createElement(HeaderContainer, {
1055
- columns: colHeaders,
1056
- sorted,
1057
- sortIndexColumn,
1058
- sortColumn,
1059
- sortAscending,
1060
- onTHClick: handleTHClick,
1061
- onIndexTHClick: handleIndexTHClick
1062
- }), /* @__PURE__ */ React14.createElement(DataContainer, {
1063
- rows: rowHeaders,
1064
- columns: colHeaders,
1065
- rowsData
1066
- }));
758
+ var TableInspector = ({ data, columns }) => {
759
+ const styles = useStyles("TableInspector");
760
+ const [{ sorted, sortIndexColumn, sortColumn, sortAscending }, setState] = useState({
761
+ sorted: false,
762
+ sortIndexColumn: false,
763
+ sortColumn: void 0,
764
+ sortAscending: false
765
+ });
766
+ const handleIndexTHClick = useCallback(() => {
767
+ setState(({ sortIndexColumn: sortIndexColumn2, sortAscending: sortAscending2 }) => ({
768
+ sorted: true,
769
+ sortIndexColumn: true,
770
+ sortColumn: void 0,
771
+ sortAscending: sortIndexColumn2 ? !sortAscending2 : true
772
+ }));
773
+ }, []);
774
+ const handleTHClick = useCallback((col) => {
775
+ setState(({ sortColumn: sortColumn2, sortAscending: sortAscending2 }) => ({
776
+ sorted: true,
777
+ sortIndexColumn: false,
778
+ sortColumn: col,
779
+ sortAscending: col === sortColumn2 ? !sortAscending2 : true
780
+ }));
781
+ }, []);
782
+ if (typeof data !== "object" || data === null) return /* @__PURE__ */ React.createElement("div", null);
783
+ let { rowHeaders, colHeaders } = getHeaders(data);
784
+ if (columns !== void 0) colHeaders = columns;
785
+ let rowsData = rowHeaders.map((rowHeader) => data[rowHeader]);
786
+ let columnDataWithRowIndexes;
787
+ if (sortColumn !== void 0) columnDataWithRowIndexes = rowsData.map((rowData, index) => {
788
+ if (typeof rowData === "object" && rowData !== null) {
789
+ const columnData = rowData[sortColumn];
790
+ return [columnData, index];
791
+ }
792
+ return [void 0, index];
793
+ });
794
+ else if (sortIndexColumn) columnDataWithRowIndexes = rowHeaders.map((rowData, index) => {
795
+ const columnData = rowHeaders[index];
796
+ return [columnData, index];
797
+ });
798
+ if (columnDataWithRowIndexes !== void 0) {
799
+ const comparator = (mapper, ascending) => {
800
+ return (a, b) => {
801
+ const v1 = mapper(a);
802
+ const v2 = mapper(b);
803
+ const type1 = typeof v1;
804
+ const type2 = typeof v2;
805
+ const lt = (v12, v22) => {
806
+ if (v12 < v22) return -1;
807
+ else if (v12 > v22) return 1;
808
+ else return 0;
809
+ };
810
+ let result;
811
+ if (type1 === type2) result = lt(v1, v2);
812
+ else {
813
+ const order = {
814
+ string: 0,
815
+ number: 1,
816
+ object: 2,
817
+ symbol: 3,
818
+ boolean: 4,
819
+ undefined: 5,
820
+ function: 6
821
+ };
822
+ result = lt(order[type1], order[type2]);
823
+ }
824
+ if (!ascending) result = -result;
825
+ return result;
826
+ };
827
+ };
828
+ const sortedRowIndexes = columnDataWithRowIndexes.sort(comparator((item) => item[0], sortAscending)).map((item) => item[1]);
829
+ rowHeaders = sortedRowIndexes.map((i) => rowHeaders[i]);
830
+ rowsData = sortedRowIndexes.map((i) => rowsData[i]);
831
+ }
832
+ return /* @__PURE__ */ React.createElement("div", { style: styles.base }, /* @__PURE__ */ React.createElement(HeaderContainer, {
833
+ columns: colHeaders,
834
+ sorted,
835
+ sortIndexColumn,
836
+ sortColumn,
837
+ sortAscending,
838
+ onTHClick: handleTHClick,
839
+ onIndexTHClick: handleIndexTHClick
840
+ }), /* @__PURE__ */ React.createElement(DataContainer, {
841
+ rows: rowHeaders,
842
+ columns: colHeaders,
843
+ rowsData
844
+ }));
1067
845
  };
1068
846
  var themedTableInspector = themeAcceptor(TableInspector);
1069
847
  var TEXT_NODE_MAX_INLINE_CHARS = 80;
1070
848
  var shouldInline = (data) => data.childNodes.length === 0 || data.childNodes.length === 1 && data.childNodes[0].nodeType === Node.TEXT_NODE && data.textContent.length < TEXT_NODE_MAX_INLINE_CHARS;
1071
849
  var OpenTag = ({ tagName, attributes, styles }) => {
1072
- return /* @__PURE__ */ React14.createElement("span", {
1073
- style: styles.base
1074
- }, "<", /* @__PURE__ */ React14.createElement("span", {
1075
- style: styles.tagName
1076
- }, tagName), (() => {
1077
- if (attributes) {
1078
- const attributeNodes = [];
1079
- for (let i = 0; i < attributes.length; i++) {
1080
- const attribute = attributes[i];
1081
- attributeNodes.push(/* @__PURE__ */ React14.createElement("span", {
1082
- key: i
1083
- }, " ", /* @__PURE__ */ React14.createElement("span", {
1084
- style: styles.htmlAttributeName
1085
- }, attribute.name), '="', /* @__PURE__ */ React14.createElement("span", {
1086
- style: styles.htmlAttributeValue
1087
- }, attribute.value), '"'));
1088
- }
1089
- return attributeNodes;
1090
- }
1091
- })(), ">");
850
+ return /* @__PURE__ */ React.createElement("span", { style: styles.base }, "<", /* @__PURE__ */ React.createElement("span", { style: styles.tagName }, tagName), (() => {
851
+ if (attributes) {
852
+ const attributeNodes = [];
853
+ for (let i = 0; i < attributes.length; i++) {
854
+ const attribute = attributes[i];
855
+ attributeNodes.push(/* @__PURE__ */ React.createElement("span", { key: i }, " ", /* @__PURE__ */ React.createElement("span", { style: styles.htmlAttributeName }, attribute.name), "=\"", /* @__PURE__ */ React.createElement("span", { style: styles.htmlAttributeValue }, attribute.value), "\""));
856
+ }
857
+ return attributeNodes;
858
+ }
859
+ })(), ">");
1092
860
  };
1093
- var CloseTag = ({ tagName, isChildNode = false, styles }) => /* @__PURE__ */ React14.createElement("span", {
1094
- style: Object.assign({}, styles.base, isChildNode && styles.offsetLeft)
1095
- }, "</", /* @__PURE__ */ React14.createElement("span", {
1096
- style: styles.tagName
1097
- }, tagName), ">");
861
+ var CloseTag = ({ tagName, isChildNode = false, styles }) => /* @__PURE__ */ React.createElement("span", { style: Object.assign({}, styles.base, isChildNode && styles.offsetLeft) }, "</", /* @__PURE__ */ React.createElement("span", { style: styles.tagName }, tagName), ">");
1098
862
  var nameByNodeType = {
1099
- 1: "ELEMENT_NODE",
1100
- 3: "TEXT_NODE",
1101
- 7: "PROCESSING_INSTRUCTION_NODE",
1102
- 8: "COMMENT_NODE",
1103
- 9: "DOCUMENT_NODE",
1104
- 10: "DOCUMENT_TYPE_NODE",
1105
- 11: "DOCUMENT_FRAGMENT_NODE"
863
+ 1: "ELEMENT_NODE",
864
+ 3: "TEXT_NODE",
865
+ 7: "PROCESSING_INSTRUCTION_NODE",
866
+ 8: "COMMENT_NODE",
867
+ 9: "DOCUMENT_NODE",
868
+ 10: "DOCUMENT_TYPE_NODE",
869
+ 11: "DOCUMENT_FRAGMENT_NODE"
1106
870
  };
1107
871
  var DOMNodePreview = ({ isCloseTag, data, expanded }) => {
1108
- const styles = useStyles("DOMNodePreview");
1109
- if (isCloseTag) {
1110
- return /* @__PURE__ */ React14.createElement(CloseTag, {
1111
- styles: styles.htmlCloseTag,
1112
- isChildNode: true,
1113
- tagName: data.tagName
1114
- });
1115
- }
1116
- switch (data.nodeType) {
1117
- case Node.ELEMENT_NODE:
1118
- return /* @__PURE__ */ React14.createElement("span", null, /* @__PURE__ */ React14.createElement(OpenTag, {
1119
- tagName: data.tagName,
1120
- attributes: data.attributes,
1121
- styles: styles.htmlOpenTag
1122
- }), shouldInline(data) ? data.textContent : !expanded && "\u2026", !expanded && /* @__PURE__ */ React14.createElement(CloseTag, {
1123
- tagName: data.tagName,
1124
- styles: styles.htmlCloseTag
1125
- }));
1126
- case Node.TEXT_NODE:
1127
- return /* @__PURE__ */ React14.createElement("span", null, data.textContent);
1128
- case Node.CDATA_SECTION_NODE:
1129
- return /* @__PURE__ */ React14.createElement("span", null, "<![CDATA[" + data.textContent + "]]>");
1130
- case Node.COMMENT_NODE:
1131
- return /* @__PURE__ */ React14.createElement("span", {
1132
- style: styles.htmlComment
1133
- }, "<!--", data.textContent, "-->");
1134
- case Node.PROCESSING_INSTRUCTION_NODE:
1135
- return /* @__PURE__ */ React14.createElement("span", null, data.nodeName);
1136
- case Node.DOCUMENT_TYPE_NODE:
1137
- return /* @__PURE__ */ React14.createElement("span", {
1138
- style: styles.htmlDoctype
1139
- }, "<!DOCTYPE ", data.name, data.publicId ? ` PUBLIC "${data.publicId}"` : "", !data.publicId && data.systemId ? " SYSTEM" : "", data.systemId ? ` "${data.systemId}"` : "", ">");
1140
- case Node.DOCUMENT_NODE:
1141
- return /* @__PURE__ */ React14.createElement("span", null, data.nodeName);
1142
- case Node.DOCUMENT_FRAGMENT_NODE:
1143
- return /* @__PURE__ */ React14.createElement("span", null, data.nodeName);
1144
- default:
1145
- return /* @__PURE__ */ React14.createElement("span", null, nameByNodeType[data.nodeType]);
1146
- }
872
+ const styles = useStyles("DOMNodePreview");
873
+ if (isCloseTag) return /* @__PURE__ */ React.createElement(CloseTag, {
874
+ styles: styles.htmlCloseTag,
875
+ isChildNode: true,
876
+ tagName: data.tagName
877
+ });
878
+ switch (data.nodeType) {
879
+ case Node.ELEMENT_NODE: return /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(OpenTag, {
880
+ tagName: data.tagName,
881
+ attributes: data.attributes,
882
+ styles: styles.htmlOpenTag
883
+ }), shouldInline(data) ? data.textContent : !expanded && "…", !expanded && /* @__PURE__ */ React.createElement(CloseTag, {
884
+ tagName: data.tagName,
885
+ styles: styles.htmlCloseTag
886
+ }));
887
+ case Node.TEXT_NODE: return /* @__PURE__ */ React.createElement("span", null, data.textContent);
888
+ case Node.CDATA_SECTION_NODE: return /* @__PURE__ */ React.createElement("span", null, "<![CDATA[" + data.textContent + "]]>");
889
+ case Node.COMMENT_NODE: return /* @__PURE__ */ React.createElement("span", { style: styles.htmlComment }, "<!--", data.textContent, "-->");
890
+ case Node.PROCESSING_INSTRUCTION_NODE: return /* @__PURE__ */ React.createElement("span", null, data.nodeName);
891
+ case Node.DOCUMENT_TYPE_NODE: return /* @__PURE__ */ React.createElement("span", { style: styles.htmlDoctype }, "<!DOCTYPE ", data.name, data.publicId ? ` PUBLIC "${data.publicId}"` : "", !data.publicId && data.systemId ? " SYSTEM" : "", data.systemId ? ` "${data.systemId}"` : "", ">");
892
+ case Node.DOCUMENT_NODE: return /* @__PURE__ */ React.createElement("span", null, data.nodeName);
893
+ case Node.DOCUMENT_FRAGMENT_NODE: return /* @__PURE__ */ React.createElement("span", null, data.nodeName);
894
+ default: return /* @__PURE__ */ React.createElement("span", null, nameByNodeType[data.nodeType]);
895
+ }
1147
896
  };
1148
897
  var domIterator = function* (data) {
1149
- if (data && data.childNodes) {
1150
- const textInlined = shouldInline(data);
1151
- if (textInlined) {
1152
- return;
1153
- }
1154
- for (let i = 0; i < data.childNodes.length; i++) {
1155
- const node = data.childNodes[i];
1156
- if (node.nodeType === Node.TEXT_NODE && node.textContent.trim().length === 0)
1157
- continue;
1158
- yield {
1159
- name: `${node.tagName}[${i}]`,
1160
- data: node
1161
- };
1162
- }
1163
- if (data.tagName) {
1164
- yield {
1165
- name: "CLOSE_TAG",
1166
- data: {
1167
- tagName: data.tagName
1168
- },
1169
- isCloseTag: true
1170
- };
1171
- }
1172
- }
898
+ if (data && data.childNodes) {
899
+ const textInlined = shouldInline(data);
900
+ if (textInlined) return;
901
+ for (let i = 0; i < data.childNodes.length; i++) {
902
+ const node = data.childNodes[i];
903
+ if (node.nodeType === Node.TEXT_NODE && node.textContent.trim().length === 0) continue;
904
+ yield {
905
+ name: `${node.tagName}[${i}]`,
906
+ data: node
907
+ };
908
+ }
909
+ if (data.tagName) yield {
910
+ name: "CLOSE_TAG",
911
+ data: { tagName: data.tagName },
912
+ isCloseTag: true
913
+ };
914
+ }
1173
915
  };
1174
916
  var DOMInspector = (props) => {
1175
- return /* @__PURE__ */ React14.createElement(TreeView, {
1176
- nodeRenderer: DOMNodePreview,
1177
- dataIterator: domIterator,
1178
- ...props
1179
- });
917
+ return /* @__PURE__ */ React.createElement(TreeView, {
918
+ nodeRenderer: DOMNodePreview,
919
+ dataIterator: domIterator,
920
+ ...props
921
+ });
1180
922
  };
1181
923
  var themedDOMInspector = themeAcceptor(DOMInspector);
1182
924
  var import_is_dom = __toESM(require_is_dom());
1183
- var Inspector = ({ table = false, data, ...rest }) => {
1184
- if (table) {
1185
- return /* @__PURE__ */ React14.createElement(themedTableInspector, {
1186
- data,
1187
- ...rest
1188
- });
1189
- }
1190
- if ((0, import_is_dom.default)(data))
1191
- return /* @__PURE__ */ React14.createElement(themedDOMInspector, {
1192
- data,
1193
- ...rest
1194
- });
1195
- return /* @__PURE__ */ React14.createElement(themedObjectInspector, {
1196
- data,
1197
- ...rest
1198
- });
925
+ var Inspector$1 = ({ table = false, data,...rest }) => {
926
+ if (table) return /* @__PURE__ */ React.createElement(themedTableInspector, {
927
+ data,
928
+ ...rest
929
+ });
930
+ if ((0, import_is_dom.default)(data)) return /* @__PURE__ */ React.createElement(themedDOMInspector, {
931
+ data,
932
+ ...rest
933
+ });
934
+ return /* @__PURE__ */ React.createElement(themedObjectInspector, {
935
+ data,
936
+ ...rest
937
+ });
1199
938
  };
1200
939
 
1201
- // src/experiments/inspect.tsx
1202
- var useImperativeHandlePolyfill = (ref, init, deps) => {
1203
- useEffect(() => {
1204
- if (ref) {
1205
- if (typeof ref === "function") {
1206
- ref(init());
1207
- } else if (typeof ref === "object" && "current" in ref) {
1208
- ref.current = init();
1209
- }
1210
- }
1211
- }, deps);
940
+ //#endregion
941
+ //#region src/experiments/inspect.tsx
942
+ const useImperativeHandlePolyfill = (ref, init, deps) => {
943
+ useEffect(() => {
944
+ if (ref) {
945
+ if (typeof ref === "function") ref(init());
946
+ else if (typeof ref === "object" && "current" in ref) ref.current = init();
947
+ }
948
+ }, deps);
1212
949
  };
1213
- var useImperativeHandle = useImperativeHandle$1 || useImperativeHandlePolyfill;
1214
- var throttle = (fn, wait) => {
1215
- let timeout = null;
1216
- return function() {
1217
- if (!timeout) {
1218
- timeout = setTimeout(() => {
1219
- fn.apply(this, arguments);
1220
- timeout = null;
1221
- }, wait);
1222
- }
1223
- };
950
+ const useImperativeHandle$1 = useImperativeHandle || useImperativeHandlePolyfill;
951
+ const throttle = (fn, wait) => {
952
+ let timeout = null;
953
+ return function() {
954
+ if (!timeout) timeout = setTimeout(() => {
955
+ fn.apply(this, arguments);
956
+ timeout = null;
957
+ }, wait);
958
+ };
1224
959
  };
1225
- var theme3 = {
1226
- BASE_FONT_FAMILY: "Menlo, monospace",
1227
- BASE_FONT_SIZE: "12px",
1228
- BASE_LINE_HEIGHT: 1.2,
1229
- BASE_BACKGROUND_COLOR: "none",
1230
- BASE_COLOR: "#FFF",
1231
- OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
1232
- OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
1233
- OBJECT_NAME_COLOR: "#FFC799",
1234
- OBJECT_VALUE_NULL_COLOR: "#A0A0A0",
1235
- OBJECT_VALUE_UNDEFINED_COLOR: "#A0A0A0",
1236
- OBJECT_VALUE_REGEXP_COLOR: "#FF8080",
1237
- OBJECT_VALUE_STRING_COLOR: "#99FFE4",
1238
- OBJECT_VALUE_SYMBOL_COLOR: "#FFC799",
1239
- OBJECT_VALUE_NUMBER_COLOR: "#FFC799",
1240
- OBJECT_VALUE_BOOLEAN_COLOR: "#FFC799",
1241
- OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "#FFC799",
1242
- HTML_TAG_COLOR: "#FFC799",
1243
- HTML_TAGNAME_COLOR: "#FFC799",
1244
- HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
1245
- HTML_ATTRIBUTE_NAME_COLOR: "#A0A0A0",
1246
- HTML_ATTRIBUTE_VALUE_COLOR: "#99FFE4",
1247
- HTML_COMMENT_COLOR: "#8b8b8b94",
1248
- HTML_DOCTYPE_COLOR: "#A0A0A0",
1249
- ARROW_COLOR: "#A0A0A0",
1250
- ARROW_MARGIN_RIGHT: 3,
1251
- ARROW_FONT_SIZE: 12,
1252
- ARROW_ANIMATION_DURATION: "0",
1253
- TREENODE_FONT_FAMILY: "Menlo, monospace",
1254
- TREENODE_FONT_SIZE: "11px",
1255
- TREENODE_LINE_HEIGHT: 1.2,
1256
- TREENODE_PADDING_LEFT: 12,
1257
- TABLE_BORDER_COLOR: "#282828",
1258
- TABLE_TH_BACKGROUND_COLOR: "#161616",
1259
- TABLE_TH_HOVER_COLOR: "#232323",
1260
- TABLE_SORT_ICON_COLOR: "#A0A0A0",
1261
- TABLE_DATA_BACKGROUND_IMAGE: "none",
1262
- TABLE_DATA_BACKGROUND_SIZE: "0"
960
+ const theme = {
961
+ BASE_FONT_FAMILY: "Menlo, monospace",
962
+ BASE_FONT_SIZE: "12px",
963
+ BASE_LINE_HEIGHT: 1.2,
964
+ BASE_BACKGROUND_COLOR: "none",
965
+ BASE_COLOR: "#FFF",
966
+ OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
967
+ OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
968
+ OBJECT_NAME_COLOR: "#FFC799",
969
+ OBJECT_VALUE_NULL_COLOR: "#A0A0A0",
970
+ OBJECT_VALUE_UNDEFINED_COLOR: "#A0A0A0",
971
+ OBJECT_VALUE_REGEXP_COLOR: "#FF8080",
972
+ OBJECT_VALUE_STRING_COLOR: "#99FFE4",
973
+ OBJECT_VALUE_SYMBOL_COLOR: "#FFC799",
974
+ OBJECT_VALUE_NUMBER_COLOR: "#FFC799",
975
+ OBJECT_VALUE_BOOLEAN_COLOR: "#FFC799",
976
+ OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "#FFC799",
977
+ HTML_TAG_COLOR: "#FFC799",
978
+ HTML_TAGNAME_COLOR: "#FFC799",
979
+ HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
980
+ HTML_ATTRIBUTE_NAME_COLOR: "#A0A0A0",
981
+ HTML_ATTRIBUTE_VALUE_COLOR: "#99FFE4",
982
+ HTML_COMMENT_COLOR: "#8b8b8b94",
983
+ HTML_DOCTYPE_COLOR: "#A0A0A0",
984
+ ARROW_COLOR: "#A0A0A0",
985
+ ARROW_MARGIN_RIGHT: 3,
986
+ ARROW_FONT_SIZE: 12,
987
+ ARROW_ANIMATION_DURATION: "0",
988
+ TREENODE_FONT_FAMILY: "Menlo, monospace",
989
+ TREENODE_FONT_SIZE: "11px",
990
+ TREENODE_LINE_HEIGHT: 1.2,
991
+ TREENODE_PADDING_LEFT: 12,
992
+ TABLE_BORDER_COLOR: "#282828",
993
+ TABLE_TH_BACKGROUND_COLOR: "#161616",
994
+ TABLE_TH_HOVER_COLOR: "#232323",
995
+ TABLE_SORT_ICON_COLOR: "#A0A0A0",
996
+ TABLE_DATA_BACKGROUND_IMAGE: "none",
997
+ TABLE_DATA_BACKGROUND_SIZE: "0"
1263
998
  };
1264
- var RawInspector = forwardRef(
1265
- ({ enabled = true, dangerouslyRunInProduction = false }, ref) => {
1266
- const [element, setElement] = useState(null);
1267
- const [currentFiber, setCurrentFiber] = useState(null);
1268
- const [currentFiberSource, setCurrentFiberSource] = useState(null);
1269
- const [rect, setRect] = useState(null);
1270
- const [isActive, setIsActive] = useState(true);
1271
- const [isEnabled, setIsEnabled] = useState(enabled);
1272
- const [position, setPosition] = useState({ top: 0, left: 0 });
1273
- const currentCleanedFiber = useMemo(() => {
1274
- if (!currentFiber) return null;
1275
- const clonedFiber = { ...currentFiber };
1276
- for (const key in clonedFiber) {
1277
- const value = clonedFiber[key];
1278
- if (!value) delete clonedFiber[key];
1279
- }
1280
- return clonedFiber;
1281
- }, [currentFiber]);
1282
- useImperativeHandle(ref, () => ({
1283
- enable: () => setIsEnabled(true),
1284
- disable: () => {
1285
- setIsEnabled(false);
1286
- setElement(null);
1287
- setRect(null);
1288
- },
1289
- inspectElement: (element2) => {
1290
- if (!isEnabled) return;
1291
- setElement(element2);
1292
- setRect(element2.getBoundingClientRect());
1293
- }
1294
- }));
1295
- useEffect(() => {
1296
- (async () => {
1297
- if (!element) return;
1298
- const fiber = getFiberFromHostInstance(element);
1299
- if (!fiber) return;
1300
- const latestFiber = getLatestFiber(fiber);
1301
- const source = await getFiberSource(latestFiber);
1302
- setCurrentFiber(latestFiber);
1303
- if (source) {
1304
- setCurrentFiberSource(source);
1305
- }
1306
- })();
1307
- }, [element]);
1308
- useEffect(() => {
1309
- const handleMouseMove = (event) => {
1310
- const isActive2 = isInstrumentationActive() || hasRDTHook();
1311
- if (!isActive2) {
1312
- setIsActive(false);
1313
- return;
1314
- }
1315
- if (!dangerouslyRunInProduction) {
1316
- const rdtHook = getRDTHook();
1317
- for (const renderer of rdtHook.renderers.values()) {
1318
- const buildType = detectReactBuildType(renderer);
1319
- if (buildType === "production") {
1320
- setIsActive(false);
1321
- return;
1322
- }
1323
- }
1324
- }
1325
- if (!isEnabled) {
1326
- setElement(null);
1327
- setRect(null);
1328
- return;
1329
- }
1330
- const element2 = document.elementFromPoint(event.clientX, event.clientY);
1331
- if (!element2) return;
1332
- setElement(element2);
1333
- setRect(element2.getBoundingClientRect());
1334
- };
1335
- const throttledMouseMove = throttle(handleMouseMove, 16);
1336
- document.addEventListener("mousemove", throttledMouseMove);
1337
- return () => document.removeEventListener("mousemove", throttledMouseMove);
1338
- }, [isEnabled, dangerouslyRunInProduction]);
1339
- useEffect(() => {
1340
- if (!rect) return;
1341
- const padding = 10;
1342
- const inspectorWidth = 400;
1343
- const inspectorHeight = 320;
1344
- let left = rect.left + rect.width + padding;
1345
- let top = rect.top;
1346
- if (left + inspectorWidth > window.innerWidth) {
1347
- left = Math.max(padding, rect.left - inspectorWidth - padding);
1348
- }
1349
- if (top >= rect.top && top <= rect.bottom) {
1350
- if (rect.bottom + inspectorHeight + padding <= window.innerHeight) {
1351
- top = rect.bottom + padding;
1352
- } else if (rect.top - inspectorHeight - padding >= 0) {
1353
- top = rect.top - inspectorHeight - padding;
1354
- } else {
1355
- top = window.innerHeight - inspectorHeight - padding;
1356
- }
1357
- }
1358
- top = Math.max(
1359
- padding,
1360
- Math.min(top, window.innerHeight - inspectorHeight - padding)
1361
- );
1362
- left = Math.max(
1363
- padding,
1364
- Math.min(left, window.innerWidth - inspectorWidth - padding)
1365
- );
1366
- setPosition({ top, left });
1367
- }, [rect]);
1368
- if (!rect || !isActive || !isEnabled) return null;
1369
- if (!currentFiber) return null;
1370
- return /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(
1371
- "div",
1372
- {
1373
- className: "inspector-container",
1374
- style: {
1375
- position: "fixed",
1376
- backgroundColor: "#101010",
1377
- color: "#FFF",
1378
- zIndex: 50,
1379
- padding: "1rem",
1380
- width: "30ch",
1381
- height: "25ch",
1382
- transition: "all 150ms ease-in-out",
1383
- overflow: "auto",
1384
- boxShadow: "0 4px 8px rgba(0, 0, 0, 0.5)",
1385
- border: "1px solid #444",
1386
- borderRadius: "8px",
1387
- opacity: rect ? 1 : 0,
1388
- transform: rect ? "translateY(0)" : "translateY(10px)",
1389
- pointerEvents: rect ? "auto" : "none",
1390
- top: position.top,
1391
- left: position.left
1392
- }
1393
- },
1394
- currentFiber && /* @__PURE__ */ React14.createElement(
1395
- Inspector,
1396
- {
1397
- theme: theme3,
1398
- data: currentCleanedFiber,
1399
- expandLevel: 1,
1400
- table: false
1401
- }
1402
- ),
1403
- /* @__PURE__ */ React14.createElement(
1404
- "div",
1405
- {
1406
- style: {
1407
- position: "absolute",
1408
- bottom: "0",
1409
- left: "0",
1410
- right: "0",
1411
- display: "flex",
1412
- alignItems: "center",
1413
- gap: "1rem",
1414
- backgroundColor: "#101010",
1415
- padding: "0.75rem 1rem",
1416
- borderTop: "1px solid #555",
1417
- borderBottomLeftRadius: "8px",
1418
- borderBottomRightRadius: "8px",
1419
- zIndex: 1e3
1420
- }
1421
- },
1422
- /* @__PURE__ */ React14.createElement(
1423
- "div",
1424
- {
1425
- style: {
1426
- fontSize: "0.875rem",
1427
- color: "#FFF",
1428
- padding: "0.25rem 0.5rem",
1429
- borderRadius: "4px",
1430
- backgroundColor: "#3a3a3a"
1431
- }
1432
- },
1433
- `<${getDisplayName(currentFiber.type) || "unknown"}>`
1434
- ),
1435
- /* @__PURE__ */ React14.createElement(
1436
- "div",
1437
- {
1438
- style: {
1439
- fontSize: "0.75rem",
1440
- color: "#CCC"
1441
- }
1442
- },
1443
- currentFiberSource ? /* @__PURE__ */ React14.createElement(React14.Fragment, null, currentFiberSource.fileName.split("/").slice(-2).join("/"), " ", /* @__PURE__ */ React14.createElement("br", null), "@ line ", currentFiberSource.lineNumber, ", column", " ", currentFiberSource.columnNumber) : null
1444
- )
1445
- )
1446
- ), /* @__PURE__ */ React14.createElement("style", null, `
999
+ const RawInspector = forwardRef(({ enabled = true, dangerouslyRunInProduction = false }, ref) => {
1000
+ const [element, setElement] = useState(null);
1001
+ const [currentFiber, setCurrentFiber] = useState(null);
1002
+ const [currentFiberSource, setCurrentFiberSource] = useState(null);
1003
+ const [rect, setRect] = useState(null);
1004
+ const [isActive, setIsActive] = useState(true);
1005
+ const [isEnabled, setIsEnabled] = useState(enabled);
1006
+ const [position, setPosition] = useState({
1007
+ top: 0,
1008
+ left: 0
1009
+ });
1010
+ const currentCleanedFiber = useMemo(() => {
1011
+ if (!currentFiber) return null;
1012
+ const clonedFiber = { ...currentFiber };
1013
+ for (const key in clonedFiber) {
1014
+ const value = clonedFiber[key];
1015
+ if (!value) delete clonedFiber[key];
1016
+ }
1017
+ return clonedFiber;
1018
+ }, [currentFiber]);
1019
+ useImperativeHandle$1(ref, () => ({
1020
+ enable: () => setIsEnabled(true),
1021
+ disable: () => {
1022
+ setIsEnabled(false);
1023
+ setElement(null);
1024
+ setRect(null);
1025
+ },
1026
+ inspectElement: (element$1) => {
1027
+ if (!isEnabled) return;
1028
+ setElement(element$1);
1029
+ setRect(element$1.getBoundingClientRect());
1030
+ }
1031
+ }));
1032
+ useEffect(() => {
1033
+ (async () => {
1034
+ if (!element) return;
1035
+ const fiber = getFiberFromHostInstance(element);
1036
+ if (!fiber) return;
1037
+ const latestFiber = getLatestFiber(fiber);
1038
+ const source = await getFiberSource(latestFiber);
1039
+ setCurrentFiber(latestFiber);
1040
+ if (source) setCurrentFiberSource(source);
1041
+ })();
1042
+ }, [element]);
1043
+ useEffect(() => {
1044
+ const handleMouseMove = (event) => {
1045
+ const isActive$1 = isInstrumentationActive() || hasRDTHook();
1046
+ if (!isActive$1) {
1047
+ setIsActive(false);
1048
+ return;
1049
+ }
1050
+ if (!dangerouslyRunInProduction) {
1051
+ const rdtHook = getRDTHook();
1052
+ for (const renderer of rdtHook.renderers.values()) {
1053
+ const buildType = detectReactBuildType(renderer);
1054
+ if (buildType === "production") {
1055
+ setIsActive(false);
1056
+ return;
1057
+ }
1058
+ }
1059
+ }
1060
+ if (!isEnabled) {
1061
+ setElement(null);
1062
+ setRect(null);
1063
+ return;
1064
+ }
1065
+ const element$1 = document.elementFromPoint(event.clientX, event.clientY);
1066
+ if (!element$1) return;
1067
+ setElement(element$1);
1068
+ setRect(element$1.getBoundingClientRect());
1069
+ };
1070
+ const throttledMouseMove = throttle(handleMouseMove, 16);
1071
+ document.addEventListener("mousemove", throttledMouseMove);
1072
+ return () => document.removeEventListener("mousemove", throttledMouseMove);
1073
+ }, [isEnabled, dangerouslyRunInProduction]);
1074
+ useEffect(() => {
1075
+ if (!rect) return;
1076
+ const padding = 10;
1077
+ const inspectorWidth = 400;
1078
+ const inspectorHeight = 320;
1079
+ let left = rect.left + rect.width + padding;
1080
+ let top = rect.top;
1081
+ if (left + inspectorWidth > window.innerWidth) left = Math.max(padding, rect.left - inspectorWidth - padding);
1082
+ if (top >= rect.top && top <= rect.bottom) if (rect.bottom + inspectorHeight + padding <= window.innerHeight) top = rect.bottom + padding;
1083
+ else if (rect.top - inspectorHeight - padding >= 0) top = rect.top - inspectorHeight - padding;
1084
+ else top = window.innerHeight - inspectorHeight - padding;
1085
+ top = Math.max(padding, Math.min(top, window.innerHeight - inspectorHeight - padding));
1086
+ left = Math.max(padding, Math.min(left, window.innerWidth - inspectorWidth - padding));
1087
+ setPosition({
1088
+ top,
1089
+ left
1090
+ });
1091
+ }, [rect]);
1092
+ if (!rect || !isActive || !isEnabled) return null;
1093
+ if (!currentFiber) return null;
1094
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1095
+ /* @__PURE__ */ jsxs("div", {
1096
+ className: "inspector-container",
1097
+ style: {
1098
+ position: "fixed",
1099
+ backgroundColor: "#101010",
1100
+ color: "#FFF",
1101
+ zIndex: 50,
1102
+ padding: "1rem",
1103
+ width: "30ch",
1104
+ height: "25ch",
1105
+ transition: "all 150ms ease-in-out",
1106
+ overflow: "auto",
1107
+ boxShadow: "0 4px 8px rgba(0, 0, 0, 0.5)",
1108
+ border: "1px solid #444",
1109
+ borderRadius: "8px",
1110
+ opacity: rect ? 1 : 0,
1111
+ transform: rect ? "translateY(0)" : "translateY(10px)",
1112
+ pointerEvents: rect ? "auto" : "none",
1113
+ top: position.top,
1114
+ left: position.left
1115
+ },
1116
+ children: [currentFiber && /* @__PURE__ */ jsx(Inspector$1, {
1117
+ theme,
1118
+ data: currentCleanedFiber,
1119
+ expandLevel: 1,
1120
+ table: false
1121
+ }), /* @__PURE__ */ jsxs("div", {
1122
+ style: {
1123
+ position: "absolute",
1124
+ bottom: "0",
1125
+ left: "0",
1126
+ right: "0",
1127
+ display: "flex",
1128
+ alignItems: "center",
1129
+ gap: "1rem",
1130
+ backgroundColor: "#101010",
1131
+ padding: "0.75rem 1rem",
1132
+ borderTop: "1px solid #555",
1133
+ borderBottomLeftRadius: "8px",
1134
+ borderBottomRightRadius: "8px",
1135
+ zIndex: 1e3
1136
+ },
1137
+ children: [/* @__PURE__ */ jsx("div", {
1138
+ style: {
1139
+ fontSize: "0.875rem",
1140
+ color: "#FFF",
1141
+ padding: "0.25rem 0.5rem",
1142
+ borderRadius: "4px",
1143
+ backgroundColor: "#3a3a3a"
1144
+ },
1145
+ children: `<${getDisplayName(currentFiber.type) || "unknown"}>`
1146
+ }), /* @__PURE__ */ jsx("div", {
1147
+ style: {
1148
+ fontSize: "0.75rem",
1149
+ color: "#CCC"
1150
+ },
1151
+ children: currentFiberSource ? /* @__PURE__ */ jsxs(Fragment, { children: [
1152
+ currentFiberSource.fileName.split("/").slice(-2).join("/"),
1153
+ " ",
1154
+ /* @__PURE__ */ jsx("br", {}),
1155
+ "@ line ",
1156
+ currentFiberSource.lineNumber,
1157
+ ", column",
1158
+ " ",
1159
+ currentFiberSource.columnNumber
1160
+ ] }) : null
1161
+ })]
1162
+ })]
1163
+ }),
1164
+ /* @__PURE__ */ jsx("style", { children: `
1447
1165
  .inspector-container::-webkit-scrollbar {
1448
1166
  width: 8px;
1449
1167
  }
@@ -1458,41 +1176,39 @@ var RawInspector = forwardRef(
1458
1176
  .inspector-container::-webkit-scrollbar-thumb:hover {
1459
1177
  background: #555;
1460
1178
  }
1461
- `), /* @__PURE__ */ React14.createElement(
1462
- "div",
1463
- {
1464
- style: {
1465
- position: "fixed",
1466
- zIndex: 40,
1467
- pointerEvents: "none",
1468
- transition: "all 150ms",
1469
- border: "1px dashed #505050",
1470
- left: rect.left,
1471
- top: rect.top,
1472
- width: rect.width,
1473
- height: rect.height,
1474
- opacity: rect ? 1 : 0
1475
- }
1476
- }
1477
- ));
1478
- }
1479
- );
1480
- var Inspector2 = forwardRef(
1481
- (props, ref) => {
1482
- const [root, setRoot] = useState(null);
1483
- useEffect(() => {
1484
- const div = document.createElement("div");
1485
- document.documentElement.appendChild(div);
1486
- const shadowRoot = div.attachShadow({ mode: "open" });
1487
- setRoot(shadowRoot);
1488
- return () => {
1489
- document.documentElement.removeChild(div);
1490
- };
1491
- }, []);
1492
- if (!root) return null;
1493
- return ReactDOM.createPortal(/* @__PURE__ */ React14.createElement(RawInspector, { ref, ...props }), root);
1494
- }
1495
- );
1496
- var inspect_default = Inspector2;
1179
+ ` }),
1180
+ /* @__PURE__ */ jsx("div", { style: {
1181
+ position: "fixed",
1182
+ zIndex: 40,
1183
+ pointerEvents: "none",
1184
+ transition: "all 150ms",
1185
+ border: "1px dashed #505050",
1186
+ left: rect.left,
1187
+ top: rect.top,
1188
+ width: rect.width,
1189
+ height: rect.height,
1190
+ opacity: rect ? 1 : 0
1191
+ } })
1192
+ ] });
1193
+ });
1194
+ const Inspector = forwardRef((props, ref) => {
1195
+ const [root, setRoot] = useState(null);
1196
+ useEffect(() => {
1197
+ const div = document.createElement("div");
1198
+ document.documentElement.appendChild(div);
1199
+ const shadowRoot = div.attachShadow({ mode: "open" });
1200
+ setRoot(shadowRoot);
1201
+ return () => {
1202
+ document.documentElement.removeChild(div);
1203
+ };
1204
+ }, []);
1205
+ if (!root) return null;
1206
+ return ReactDOM.createPortal(/* @__PURE__ */ jsx(RawInspector, {
1207
+ ref,
1208
+ ...props
1209
+ }), root);
1210
+ });
1211
+ var inspect_default = Inspector;
1497
1212
 
1498
- export { Inspector2 as Inspector, RawInspector, inspect_default as default };
1213
+ //#endregion
1214
+ export { Inspector, RawInspector, inspect_default as default };