storybook 9.0.0-alpha.3 → 9.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/actions/decorator.d.ts +6 -0
- package/dist/actions/decorator.js +139 -0
- package/dist/actions/index.cjs +127 -0
- package/dist/actions/index.d.ts +105 -0
- package/dist/actions/index.js +112 -0
- package/dist/actions/manager.js +1196 -0
- package/dist/actions/preview.cjs +165 -0
- package/dist/actions/preview.d.ts +55 -0
- package/dist/actions/preview.js +156 -0
- package/dist/bin/index.cjs +63 -64
- package/dist/bin/index.js +63 -64
- package/dist/channels/index.cjs +207 -230
- package/dist/channels/index.js +302 -304
- package/dist/cli/bin/index.cjs +405 -405
- package/dist/cli/bin/index.js +410 -410
- package/dist/client-logger/index.cjs +56 -88
- package/dist/client-logger/index.js +41 -47
- package/dist/common/index.cjs +65 -67
- package/dist/common/index.d.ts +1 -4
- package/dist/common/index.js +65 -67
- package/dist/components/index.cjs +9413 -11578
- package/dist/components/index.d.ts +92 -92
- package/dist/components/index.js +6768 -7544
- package/dist/core-events/index.d.ts +138 -25
- package/dist/core-server/index.cjs +5241 -5265
- package/dist/core-server/index.js +5353 -5375
- package/dist/core-server/presets/common-manager.js +11 -19
- package/dist/core-server/presets/common-preset.cjs +243 -242
- package/dist/core-server/presets/common-preset.js +379 -378
- package/dist/csf/index.cjs +76 -120
- package/dist/csf/index.d.ts +2 -4
- package/dist/csf/index.js +69 -113
- package/dist/docs-tools/index.cjs +1 -1
- package/dist/docs-tools/index.d.ts +2 -2
- package/dist/docs-tools/index.js +1 -1
- package/dist/instrumenter/index.cjs +1260 -1289
- package/dist/instrumenter/index.js +1344 -1348
- package/dist/manager/globals-module-info.cjs +272 -135
- package/dist/manager/globals-module-info.d.ts +1 -1
- package/dist/manager/globals-module-info.js +257 -120
- package/dist/manager/globals-runtime.js +59553 -22371
- package/dist/manager/globals.cjs +23 -19
- package/dist/manager/globals.d.ts +8 -5
- package/dist/manager/globals.js +10 -6
- package/dist/manager/runtime.js +129 -129
- package/dist/manager-api/index.cjs +1182 -1205
- package/dist/manager-api/index.d.ts +2 -2
- package/dist/manager-api/index.js +1010 -1008
- package/dist/preview/globals.cjs +21 -17
- package/dist/preview/globals.d.ts +4 -1
- package/dist/preview/globals.js +6 -2
- package/dist/preview/runtime.js +43946 -6546
- package/dist/preview-api/index.cjs +1243 -1239
- package/dist/preview-api/index.d.ts +104 -60
- package/dist/preview-api/index.js +1310 -1270
- package/dist/router/index.cjs +847 -871
- package/dist/router/index.js +193 -199
- package/dist/test/index.cjs +10068 -10205
- package/dist/test/index.d.ts +4 -4
- package/dist/test/index.js +9741 -9623
- package/dist/test/preview.cjs +15870 -0
- package/dist/test/preview.d.ts +54 -0
- package/dist/test/preview.js +14441 -0
- package/dist/test/spy.cjs +258 -0
- package/dist/test/spy.d.ts +66 -0
- package/dist/test/spy.js +240 -0
- package/dist/theming/create.cjs +79 -2269
- package/dist/theming/create.js +67 -841
- package/dist/theming/index.cjs +1065 -3232
- package/dist/theming/index.js +951 -1719
- package/dist/types/index.d.ts +242 -242
- package/package.json +134 -3
|
@@ -0,0 +1,1196 @@
|
|
|
1
|
+
var He = Object.defineProperty;
|
|
2
|
+
var l = (e, t) => He(e, "name", { value: t, configurable: !0 });
|
|
3
|
+
|
|
4
|
+
// src/actions/manager.tsx
|
|
5
|
+
import U from "react";
|
|
6
|
+
import { Badge as Kt, Spaced as qt } from "storybook/internal/components";
|
|
7
|
+
import { STORY_CHANGED as Qt } from "storybook/internal/core-events";
|
|
8
|
+
import { addons as Me, types as er, useAddonState as tr, useChannel as rr } from "storybook/manager-api";
|
|
9
|
+
|
|
10
|
+
// src/actions/constants.ts
|
|
11
|
+
var ie = "actions", b = "storybook/actions", ce = `${b}/panel`, D = `${b}/action-event`, H = `${b}/action-clear`;
|
|
12
|
+
|
|
13
|
+
// src/actions/containers/ActionLogger/index.tsx
|
|
14
|
+
import $t, { Component as Zt } from "react";
|
|
15
|
+
import { STORY_CHANGED as xe } from "storybook/internal/core-events";
|
|
16
|
+
|
|
17
|
+
// ../node_modules/dequal/dist/index.mjs
|
|
18
|
+
var Ee = Object.prototype.hasOwnProperty;
|
|
19
|
+
function pe(e, t, r) {
|
|
20
|
+
for (r of e.keys())
|
|
21
|
+
if (L(r, t)) return r;
|
|
22
|
+
}
|
|
23
|
+
l(pe, "find");
|
|
24
|
+
function L(e, t) {
|
|
25
|
+
var r, n, o;
|
|
26
|
+
if (e === t) return !0;
|
|
27
|
+
if (e && t && (r = e.constructor) === t.constructor) {
|
|
28
|
+
if (r === Date) return e.getTime() === t.getTime();
|
|
29
|
+
if (r === RegExp) return e.toString() === t.toString();
|
|
30
|
+
if (r === Array) {
|
|
31
|
+
if ((n = e.length) === t.length)
|
|
32
|
+
for (; n-- && L(e[n], t[n]); ) ;
|
|
33
|
+
return n === -1;
|
|
34
|
+
}
|
|
35
|
+
if (r === Set) {
|
|
36
|
+
if (e.size !== t.size)
|
|
37
|
+
return !1;
|
|
38
|
+
for (n of e)
|
|
39
|
+
if (o = n, o && typeof o == "object" && (o = pe(t, o), !o) || !t.has(o)) return !1;
|
|
40
|
+
return !0;
|
|
41
|
+
}
|
|
42
|
+
if (r === Map) {
|
|
43
|
+
if (e.size !== t.size)
|
|
44
|
+
return !1;
|
|
45
|
+
for (n of e)
|
|
46
|
+
if (o = n[0], o && typeof o == "object" && (o = pe(t, o), !o) || !L(n[1], t.get(o)))
|
|
47
|
+
return !1;
|
|
48
|
+
return !0;
|
|
49
|
+
}
|
|
50
|
+
if (r === ArrayBuffer)
|
|
51
|
+
e = new Uint8Array(e), t = new Uint8Array(t);
|
|
52
|
+
else if (r === DataView) {
|
|
53
|
+
if ((n = e.byteLength) === t.byteLength)
|
|
54
|
+
for (; n-- && e.getInt8(n) === t.getInt8(n); ) ;
|
|
55
|
+
return n === -1;
|
|
56
|
+
}
|
|
57
|
+
if (ArrayBuffer.isView(e)) {
|
|
58
|
+
if ((n = e.byteLength) === t.byteLength)
|
|
59
|
+
for (; n-- && e[n] === t[n]; ) ;
|
|
60
|
+
return n === -1;
|
|
61
|
+
}
|
|
62
|
+
if (!r || typeof e == "object") {
|
|
63
|
+
n = 0;
|
|
64
|
+
for (r in e)
|
|
65
|
+
if (Ee.call(e, r) && ++n && !Ee.call(t, r) || !(r in t) || !L(e[r], t[r])) return !1;
|
|
66
|
+
return Object.keys(t).length === n;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return e !== e && t !== t;
|
|
70
|
+
}
|
|
71
|
+
l(L, "dequal");
|
|
72
|
+
|
|
73
|
+
// src/actions/components/ActionLogger/index.tsx
|
|
74
|
+
import y, { Fragment as Ht, forwardRef as Vt, useEffect as jt, useRef as kt } from "react";
|
|
75
|
+
import { ActionBar as Ft, ScrollArea as Gt } from "storybook/internal/components";
|
|
76
|
+
|
|
77
|
+
// ../node_modules/react-inspector/dist/index.mjs
|
|
78
|
+
import Y from "react";
|
|
79
|
+
import M, { useContext as Ke, useCallback as qe, useLayoutEffect as Qe, useState as et, memo as ge } from "react";
|
|
80
|
+
import { createContext as tt } from "react";
|
|
81
|
+
import R, { Children as rt, memo as nt } from "react";
|
|
82
|
+
import ue, { createContext as ot, useContext as lt, useMemo as at } from "react";
|
|
83
|
+
import B from "react";
|
|
84
|
+
import pt from "react";
|
|
85
|
+
import m from "react";
|
|
86
|
+
import _ from "react";
|
|
87
|
+
import x from "react";
|
|
88
|
+
import V, { useCallback as de, useState as At } from "react";
|
|
89
|
+
import C from "react";
|
|
90
|
+
import h from "react";
|
|
91
|
+
import I, { useCallback as me, useState as Ct } from "react";
|
|
92
|
+
import It from "react";
|
|
93
|
+
import u from "react";
|
|
94
|
+
import W from "react";
|
|
95
|
+
var Ve = Object.create, z = Object.defineProperty, je = Object.getOwnPropertyDescriptor, Ae = Object.getOwnPropertyNames, ke = Object.getPrototypeOf,
|
|
96
|
+
Fe = Object.prototype.hasOwnProperty, K = /* @__PURE__ */ l((e, t) => /* @__PURE__ */ l(function() {
|
|
97
|
+
return t || (0, e[Ae(e)[0]])((t = { exports: {} }).exports, t), t.exports;
|
|
98
|
+
}, "__require"), "__commonJS"), Ge = /* @__PURE__ */ l((e, t) => {
|
|
99
|
+
for (var r in t)
|
|
100
|
+
z(e, r, { get: t[r], enumerable: !0 });
|
|
101
|
+
}, "__export"), Je = /* @__PURE__ */ l((e, t, r, n) => {
|
|
102
|
+
if (t && typeof t == "object" || typeof t == "function")
|
|
103
|
+
for (let o of Ae(t))
|
|
104
|
+
!Fe.call(e, o) && o !== r && z(e, o, { get: /* @__PURE__ */ l(() => t[o], "get"), enumerable: !(n = je(t, o)) || n.enumerable });
|
|
105
|
+
return e;
|
|
106
|
+
}, "__copyProps"), We = /* @__PURE__ */ l((e, t, r) => (r = e != null ? Ve(ke(e)) : {}, Je(t || !e || !e.__esModule ? z(r, "default", { value: e,
|
|
107
|
+
enumerable: !0 }) : r, e)), "__toESM"), Ye = K({
|
|
108
|
+
"node_modules/is-object/index.js"(e, t) {
|
|
109
|
+
"use strict";
|
|
110
|
+
t.exports = /* @__PURE__ */ l(function(n) {
|
|
111
|
+
return typeof n == "object" && n !== null;
|
|
112
|
+
}, "isObject");
|
|
113
|
+
}
|
|
114
|
+
}), Xe = K({
|
|
115
|
+
"node_modules/is-window/index.js"(e, t) {
|
|
116
|
+
"use strict";
|
|
117
|
+
t.exports = function(r) {
|
|
118
|
+
if (r == null)
|
|
119
|
+
return !1;
|
|
120
|
+
var n = Object(r);
|
|
121
|
+
return n === n.window;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}), $e = K({
|
|
125
|
+
"node_modules/is-dom/index.js"(e, t) {
|
|
126
|
+
var r = Ye(), n = Xe();
|
|
127
|
+
function o(a) {
|
|
128
|
+
return !r(a) || !n(window) || typeof window.Node != "function" ? !1 : typeof a.nodeType == "number" && typeof a.nodeName == "string";
|
|
129
|
+
}
|
|
130
|
+
l(o, "isNode"), t.exports = o;
|
|
131
|
+
}
|
|
132
|
+
}), F = {};
|
|
133
|
+
Ge(F, {
|
|
134
|
+
chromeDark: /* @__PURE__ */ l(() => Ze, "chromeDark"),
|
|
135
|
+
chromeLight: /* @__PURE__ */ l(() => ze, "chromeLight")
|
|
136
|
+
});
|
|
137
|
+
var Ze = {
|
|
138
|
+
BASE_FONT_FAMILY: "Menlo, monospace",
|
|
139
|
+
BASE_FONT_SIZE: "11px",
|
|
140
|
+
BASE_LINE_HEIGHT: 1.2,
|
|
141
|
+
BASE_BACKGROUND_COLOR: "rgb(36, 36, 36)",
|
|
142
|
+
BASE_COLOR: "rgb(213, 213, 213)",
|
|
143
|
+
OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
|
|
144
|
+
OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
|
|
145
|
+
OBJECT_NAME_COLOR: "rgb(227, 110, 236)",
|
|
146
|
+
OBJECT_VALUE_NULL_COLOR: "rgb(127, 127, 127)",
|
|
147
|
+
OBJECT_VALUE_UNDEFINED_COLOR: "rgb(127, 127, 127)",
|
|
148
|
+
OBJECT_VALUE_REGEXP_COLOR: "rgb(233, 63, 59)",
|
|
149
|
+
OBJECT_VALUE_STRING_COLOR: "rgb(233, 63, 59)",
|
|
150
|
+
OBJECT_VALUE_SYMBOL_COLOR: "rgb(233, 63, 59)",
|
|
151
|
+
OBJECT_VALUE_NUMBER_COLOR: "hsl(252, 100%, 75%)",
|
|
152
|
+
OBJECT_VALUE_BOOLEAN_COLOR: "hsl(252, 100%, 75%)",
|
|
153
|
+
OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "rgb(85, 106, 242)",
|
|
154
|
+
HTML_TAG_COLOR: "rgb(93, 176, 215)",
|
|
155
|
+
HTML_TAGNAME_COLOR: "rgb(93, 176, 215)",
|
|
156
|
+
HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
|
|
157
|
+
HTML_ATTRIBUTE_NAME_COLOR: "rgb(155, 187, 220)",
|
|
158
|
+
HTML_ATTRIBUTE_VALUE_COLOR: "rgb(242, 151, 102)",
|
|
159
|
+
HTML_COMMENT_COLOR: "rgb(137, 137, 137)",
|
|
160
|
+
HTML_DOCTYPE_COLOR: "rgb(192, 192, 192)",
|
|
161
|
+
ARROW_COLOR: "rgb(145, 145, 145)",
|
|
162
|
+
ARROW_MARGIN_RIGHT: 3,
|
|
163
|
+
ARROW_FONT_SIZE: 12,
|
|
164
|
+
ARROW_ANIMATION_DURATION: "0",
|
|
165
|
+
TREENODE_FONT_FAMILY: "Menlo, monospace",
|
|
166
|
+
TREENODE_FONT_SIZE: "11px",
|
|
167
|
+
TREENODE_LINE_HEIGHT: 1.2,
|
|
168
|
+
TREENODE_PADDING_LEFT: 12,
|
|
169
|
+
TABLE_BORDER_COLOR: "rgb(85, 85, 85)",
|
|
170
|
+
TABLE_TH_BACKGROUND_COLOR: "rgb(44, 44, 44)",
|
|
171
|
+
TABLE_TH_HOVER_COLOR: "rgb(48, 48, 48)",
|
|
172
|
+
TABLE_SORT_ICON_COLOR: "black",
|
|
173
|
+
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(\
|
|
174
|
+
51, 139, 255, 0.0980392))",
|
|
175
|
+
TABLE_DATA_BACKGROUND_SIZE: "128px 32px"
|
|
176
|
+
}, ze = {
|
|
177
|
+
BASE_FONT_FAMILY: "Menlo, monospace",
|
|
178
|
+
BASE_FONT_SIZE: "11px",
|
|
179
|
+
BASE_LINE_HEIGHT: 1.2,
|
|
180
|
+
BASE_BACKGROUND_COLOR: "white",
|
|
181
|
+
BASE_COLOR: "black",
|
|
182
|
+
OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
|
|
183
|
+
OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
|
|
184
|
+
OBJECT_NAME_COLOR: "rgb(136, 19, 145)",
|
|
185
|
+
OBJECT_VALUE_NULL_COLOR: "rgb(128, 128, 128)",
|
|
186
|
+
OBJECT_VALUE_UNDEFINED_COLOR: "rgb(128, 128, 128)",
|
|
187
|
+
OBJECT_VALUE_REGEXP_COLOR: "rgb(196, 26, 22)",
|
|
188
|
+
OBJECT_VALUE_STRING_COLOR: "rgb(196, 26, 22)",
|
|
189
|
+
OBJECT_VALUE_SYMBOL_COLOR: "rgb(196, 26, 22)",
|
|
190
|
+
OBJECT_VALUE_NUMBER_COLOR: "rgb(28, 0, 207)",
|
|
191
|
+
OBJECT_VALUE_BOOLEAN_COLOR: "rgb(28, 0, 207)",
|
|
192
|
+
OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "rgb(13, 34, 170)",
|
|
193
|
+
HTML_TAG_COLOR: "rgb(168, 148, 166)",
|
|
194
|
+
HTML_TAGNAME_COLOR: "rgb(136, 18, 128)",
|
|
195
|
+
HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
|
|
196
|
+
HTML_ATTRIBUTE_NAME_COLOR: "rgb(153, 69, 0)",
|
|
197
|
+
HTML_ATTRIBUTE_VALUE_COLOR: "rgb(26, 26, 166)",
|
|
198
|
+
HTML_COMMENT_COLOR: "rgb(35, 110, 37)",
|
|
199
|
+
HTML_DOCTYPE_COLOR: "rgb(192, 192, 192)",
|
|
200
|
+
ARROW_COLOR: "#6e6e6e",
|
|
201
|
+
ARROW_MARGIN_RIGHT: 3,
|
|
202
|
+
ARROW_FONT_SIZE: 12,
|
|
203
|
+
ARROW_ANIMATION_DURATION: "0",
|
|
204
|
+
TREENODE_FONT_FAMILY: "Menlo, monospace",
|
|
205
|
+
TREENODE_FONT_SIZE: "11px",
|
|
206
|
+
TREENODE_LINE_HEIGHT: 1.2,
|
|
207
|
+
TREENODE_PADDING_LEFT: 12,
|
|
208
|
+
TABLE_BORDER_COLOR: "#aaa",
|
|
209
|
+
TABLE_TH_BACKGROUND_COLOR: "#eee",
|
|
210
|
+
TABLE_TH_HOVER_COLOR: "hsla(0, 0%, 90%, 1)",
|
|
211
|
+
TABLE_SORT_ICON_COLOR: "#6e6e6e",
|
|
212
|
+
TABLE_DATA_BACKGROUND_IMAGE: "linear-gradient(to bottom, white, white 50%, rgb(234, 243, 255) 50%, rgb(234, 243, 255))",
|
|
213
|
+
TABLE_DATA_BACKGROUND_SIZE: "128px 32px"
|
|
214
|
+
}, Ne = tt([{}, () => {
|
|
215
|
+
}]), J = {
|
|
216
|
+
WebkitTouchCallout: "none",
|
|
217
|
+
WebkitUserSelect: "none",
|
|
218
|
+
KhtmlUserSelect: "none",
|
|
219
|
+
MozUserSelect: "none",
|
|
220
|
+
msUserSelect: "none",
|
|
221
|
+
OUserSelect: "none",
|
|
222
|
+
userSelect: "none"
|
|
223
|
+
}, j = /* @__PURE__ */ l((e) => ({
|
|
224
|
+
DOMNodePreview: {
|
|
225
|
+
htmlOpenTag: {
|
|
226
|
+
base: {
|
|
227
|
+
color: e.HTML_TAG_COLOR
|
|
228
|
+
},
|
|
229
|
+
tagName: {
|
|
230
|
+
color: e.HTML_TAGNAME_COLOR,
|
|
231
|
+
textTransform: e.HTML_TAGNAME_TEXT_TRANSFORM
|
|
232
|
+
},
|
|
233
|
+
htmlAttributeName: {
|
|
234
|
+
color: e.HTML_ATTRIBUTE_NAME_COLOR
|
|
235
|
+
},
|
|
236
|
+
htmlAttributeValue: {
|
|
237
|
+
color: e.HTML_ATTRIBUTE_VALUE_COLOR
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
htmlCloseTag: {
|
|
241
|
+
base: {
|
|
242
|
+
color: e.HTML_TAG_COLOR
|
|
243
|
+
},
|
|
244
|
+
offsetLeft: {
|
|
245
|
+
marginLeft: -e.TREENODE_PADDING_LEFT
|
|
246
|
+
},
|
|
247
|
+
tagName: {
|
|
248
|
+
color: e.HTML_TAGNAME_COLOR,
|
|
249
|
+
textTransform: e.HTML_TAGNAME_TEXT_TRANSFORM
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
htmlComment: {
|
|
253
|
+
color: e.HTML_COMMENT_COLOR
|
|
254
|
+
},
|
|
255
|
+
htmlDoctype: {
|
|
256
|
+
color: e.HTML_DOCTYPE_COLOR
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
ObjectPreview: {
|
|
260
|
+
objectDescription: {
|
|
261
|
+
fontStyle: "italic"
|
|
262
|
+
},
|
|
263
|
+
preview: {
|
|
264
|
+
fontStyle: "italic"
|
|
265
|
+
},
|
|
266
|
+
arrayMaxProperties: e.OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES,
|
|
267
|
+
objectMaxProperties: e.OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES
|
|
268
|
+
},
|
|
269
|
+
ObjectName: {
|
|
270
|
+
base: {
|
|
271
|
+
color: e.OBJECT_NAME_COLOR
|
|
272
|
+
},
|
|
273
|
+
dimmed: {
|
|
274
|
+
opacity: 0.6
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
ObjectValue: {
|
|
278
|
+
objectValueNull: {
|
|
279
|
+
color: e.OBJECT_VALUE_NULL_COLOR
|
|
280
|
+
},
|
|
281
|
+
objectValueUndefined: {
|
|
282
|
+
color: e.OBJECT_VALUE_UNDEFINED_COLOR
|
|
283
|
+
},
|
|
284
|
+
objectValueRegExp: {
|
|
285
|
+
color: e.OBJECT_VALUE_REGEXP_COLOR
|
|
286
|
+
},
|
|
287
|
+
objectValueString: {
|
|
288
|
+
color: e.OBJECT_VALUE_STRING_COLOR
|
|
289
|
+
},
|
|
290
|
+
objectValueSymbol: {
|
|
291
|
+
color: e.OBJECT_VALUE_SYMBOL_COLOR
|
|
292
|
+
},
|
|
293
|
+
objectValueNumber: {
|
|
294
|
+
color: e.OBJECT_VALUE_NUMBER_COLOR
|
|
295
|
+
},
|
|
296
|
+
objectValueBoolean: {
|
|
297
|
+
color: e.OBJECT_VALUE_BOOLEAN_COLOR
|
|
298
|
+
},
|
|
299
|
+
objectValueFunctionPrefix: {
|
|
300
|
+
color: e.OBJECT_VALUE_FUNCTION_PREFIX_COLOR,
|
|
301
|
+
fontStyle: "italic"
|
|
302
|
+
},
|
|
303
|
+
objectValueFunctionName: {
|
|
304
|
+
fontStyle: "italic"
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
TreeView: {
|
|
308
|
+
treeViewOutline: {
|
|
309
|
+
padding: 0,
|
|
310
|
+
margin: 0,
|
|
311
|
+
listStyleType: "none"
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
TreeNode: {
|
|
315
|
+
treeNodeBase: {
|
|
316
|
+
color: e.BASE_COLOR,
|
|
317
|
+
backgroundColor: e.BASE_BACKGROUND_COLOR,
|
|
318
|
+
lineHeight: e.TREENODE_LINE_HEIGHT,
|
|
319
|
+
cursor: "default",
|
|
320
|
+
boxSizing: "border-box",
|
|
321
|
+
listStyle: "none",
|
|
322
|
+
fontFamily: e.TREENODE_FONT_FAMILY,
|
|
323
|
+
fontSize: e.TREENODE_FONT_SIZE
|
|
324
|
+
},
|
|
325
|
+
treeNodePreviewContainer: {},
|
|
326
|
+
treeNodePlaceholder: {
|
|
327
|
+
whiteSpace: "pre",
|
|
328
|
+
fontSize: e.ARROW_FONT_SIZE,
|
|
329
|
+
marginRight: e.ARROW_MARGIN_RIGHT,
|
|
330
|
+
...J
|
|
331
|
+
},
|
|
332
|
+
treeNodeArrow: {
|
|
333
|
+
base: {
|
|
334
|
+
color: e.ARROW_COLOR,
|
|
335
|
+
display: "inline-block",
|
|
336
|
+
fontSize: e.ARROW_FONT_SIZE,
|
|
337
|
+
marginRight: e.ARROW_MARGIN_RIGHT,
|
|
338
|
+
...parseFloat(e.ARROW_ANIMATION_DURATION) > 0 ? {
|
|
339
|
+
transition: `transform ${e.ARROW_ANIMATION_DURATION} ease 0s`
|
|
340
|
+
} : {},
|
|
341
|
+
...J
|
|
342
|
+
},
|
|
343
|
+
expanded: {
|
|
344
|
+
WebkitTransform: "rotateZ(90deg)",
|
|
345
|
+
MozTransform: "rotateZ(90deg)",
|
|
346
|
+
transform: "rotateZ(90deg)"
|
|
347
|
+
},
|
|
348
|
+
collapsed: {
|
|
349
|
+
WebkitTransform: "rotateZ(0deg)",
|
|
350
|
+
MozTransform: "rotateZ(0deg)",
|
|
351
|
+
transform: "rotateZ(0deg)"
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
treeNodeChildNodesContainer: {
|
|
355
|
+
margin: 0,
|
|
356
|
+
paddingLeft: e.TREENODE_PADDING_LEFT
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
TableInspector: {
|
|
360
|
+
base: {
|
|
361
|
+
color: e.BASE_COLOR,
|
|
362
|
+
position: "relative",
|
|
363
|
+
border: `1px solid ${e.TABLE_BORDER_COLOR}`,
|
|
364
|
+
fontFamily: e.BASE_FONT_FAMILY,
|
|
365
|
+
fontSize: e.BASE_FONT_SIZE,
|
|
366
|
+
lineHeight: "120%",
|
|
367
|
+
boxSizing: "border-box",
|
|
368
|
+
cursor: "default"
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
TableInspectorHeaderContainer: {
|
|
372
|
+
base: {
|
|
373
|
+
top: 0,
|
|
374
|
+
height: "17px",
|
|
375
|
+
left: 0,
|
|
376
|
+
right: 0,
|
|
377
|
+
overflowX: "hidden"
|
|
378
|
+
},
|
|
379
|
+
table: {
|
|
380
|
+
tableLayout: "fixed",
|
|
381
|
+
borderSpacing: 0,
|
|
382
|
+
borderCollapse: "separate",
|
|
383
|
+
height: "100%",
|
|
384
|
+
width: "100%",
|
|
385
|
+
margin: 0
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
TableInspectorDataContainer: {
|
|
389
|
+
tr: {
|
|
390
|
+
display: "table-row"
|
|
391
|
+
},
|
|
392
|
+
td: {
|
|
393
|
+
boxSizing: "border-box",
|
|
394
|
+
border: "none",
|
|
395
|
+
height: "16px",
|
|
396
|
+
verticalAlign: "top",
|
|
397
|
+
padding: "1px 4px",
|
|
398
|
+
WebkitUserSelect: "text",
|
|
399
|
+
whiteSpace: "nowrap",
|
|
400
|
+
textOverflow: "ellipsis",
|
|
401
|
+
overflow: "hidden",
|
|
402
|
+
lineHeight: "14px"
|
|
403
|
+
},
|
|
404
|
+
div: {
|
|
405
|
+
position: "static",
|
|
406
|
+
top: "17px",
|
|
407
|
+
bottom: 0,
|
|
408
|
+
overflowY: "overlay",
|
|
409
|
+
transform: "translateZ(0)",
|
|
410
|
+
left: 0,
|
|
411
|
+
right: 0,
|
|
412
|
+
overflowX: "hidden"
|
|
413
|
+
},
|
|
414
|
+
table: {
|
|
415
|
+
positon: "static",
|
|
416
|
+
left: 0,
|
|
417
|
+
top: 0,
|
|
418
|
+
right: 0,
|
|
419
|
+
bottom: 0,
|
|
420
|
+
borderTop: "0 none transparent",
|
|
421
|
+
margin: 0,
|
|
422
|
+
backgroundImage: e.TABLE_DATA_BACKGROUND_IMAGE,
|
|
423
|
+
backgroundSize: e.TABLE_DATA_BACKGROUND_SIZE,
|
|
424
|
+
tableLayout: "fixed",
|
|
425
|
+
borderSpacing: 0,
|
|
426
|
+
borderCollapse: "separate",
|
|
427
|
+
width: "100%",
|
|
428
|
+
fontSize: e.BASE_FONT_SIZE,
|
|
429
|
+
lineHeight: "120%"
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
TableInspectorTH: {
|
|
433
|
+
base: {
|
|
434
|
+
position: "relative",
|
|
435
|
+
height: "auto",
|
|
436
|
+
textAlign: "left",
|
|
437
|
+
backgroundColor: e.TABLE_TH_BACKGROUND_COLOR,
|
|
438
|
+
borderBottom: `1px solid ${e.TABLE_BORDER_COLOR}`,
|
|
439
|
+
fontWeight: "normal",
|
|
440
|
+
verticalAlign: "middle",
|
|
441
|
+
padding: "0 4px",
|
|
442
|
+
whiteSpace: "nowrap",
|
|
443
|
+
textOverflow: "ellipsis",
|
|
444
|
+
overflow: "hidden",
|
|
445
|
+
lineHeight: "14px",
|
|
446
|
+
":hover": {
|
|
447
|
+
backgroundColor: e.TABLE_TH_HOVER_COLOR
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
div: {
|
|
451
|
+
whiteSpace: "nowrap",
|
|
452
|
+
textOverflow: "ellipsis",
|
|
453
|
+
overflow: "hidden",
|
|
454
|
+
fontSize: e.BASE_FONT_SIZE,
|
|
455
|
+
lineHeight: "120%"
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
TableInspectorLeftBorder: {
|
|
459
|
+
none: {
|
|
460
|
+
borderLeft: "none"
|
|
461
|
+
},
|
|
462
|
+
solid: {
|
|
463
|
+
borderLeft: `1px solid ${e.TABLE_BORDER_COLOR}`
|
|
464
|
+
}
|
|
465
|
+
},
|
|
466
|
+
TableInspectorSortIcon: {
|
|
467
|
+
display: "block",
|
|
468
|
+
marginRight: 3,
|
|
469
|
+
width: 8,
|
|
470
|
+
height: 7,
|
|
471
|
+
marginTop: -7,
|
|
472
|
+
color: e.TABLE_SORT_ICON_COLOR,
|
|
473
|
+
fontSize: 12,
|
|
474
|
+
...J
|
|
475
|
+
}
|
|
476
|
+
}), "createTheme"), X = "chromeLight", Ce = ot(j(F[X])), g = /* @__PURE__ */ l((e) => lt(Ce)[e], "useStyles"), q = /* @__PURE__ */ l((e) => /* @__PURE__ */ l(
|
|
477
|
+
({ theme: r = X, ...n }) => {
|
|
478
|
+
let o = at(() => {
|
|
479
|
+
switch (Object.prototype.toString.call(r)) {
|
|
480
|
+
case "[object String]":
|
|
481
|
+
return j(F[r]);
|
|
482
|
+
case "[object Object]":
|
|
483
|
+
return j(r);
|
|
484
|
+
default:
|
|
485
|
+
return j(F[X]);
|
|
486
|
+
}
|
|
487
|
+
}, [r]);
|
|
488
|
+
return /* @__PURE__ */ ue.createElement(Ce.Provider, {
|
|
489
|
+
value: o
|
|
490
|
+
}, /* @__PURE__ */ ue.createElement(e, {
|
|
491
|
+
...n
|
|
492
|
+
}));
|
|
493
|
+
}, "ThemeAcceptor"), "themeAcceptor"), st = /* @__PURE__ */ l(({ expanded: e, styles: t }) => /* @__PURE__ */ R.createElement("span", {
|
|
494
|
+
style: {
|
|
495
|
+
...t.base,
|
|
496
|
+
...e ? t.expanded : t.collapsed
|
|
497
|
+
}
|
|
498
|
+
}, "\u25B6"), "Arrow"), it = nt((e) => {
|
|
499
|
+
e = {
|
|
500
|
+
expanded: !0,
|
|
501
|
+
nodeRenderer: /* @__PURE__ */ l(({ name: p }) => /* @__PURE__ */ R.createElement("span", null, p), "nodeRenderer"),
|
|
502
|
+
onClick: /* @__PURE__ */ l(() => {
|
|
503
|
+
}, "onClick"),
|
|
504
|
+
shouldShowArrow: !1,
|
|
505
|
+
shouldShowPlaceholder: !0,
|
|
506
|
+
...e
|
|
507
|
+
};
|
|
508
|
+
let { expanded: t, onClick: r, children: n, nodeRenderer: o, title: a, shouldShowArrow: c, shouldShowPlaceholder: s } = e, i = g("TreeNode"),
|
|
509
|
+
E = o;
|
|
510
|
+
return /* @__PURE__ */ R.createElement("li", {
|
|
511
|
+
"aria-expanded": t,
|
|
512
|
+
role: "treeitem",
|
|
513
|
+
style: i.treeNodeBase,
|
|
514
|
+
title: a
|
|
515
|
+
}, /* @__PURE__ */ R.createElement("div", {
|
|
516
|
+
style: i.treeNodePreviewContainer,
|
|
517
|
+
onClick: r
|
|
518
|
+
}, c || rt.count(n) > 0 ? /* @__PURE__ */ R.createElement(st, {
|
|
519
|
+
expanded: t,
|
|
520
|
+
styles: i.treeNodeArrow
|
|
521
|
+
}) : s && /* @__PURE__ */ R.createElement("span", {
|
|
522
|
+
style: i.treeNodePlaceholder
|
|
523
|
+
}, "\xA0"), /* @__PURE__ */ R.createElement(E, {
|
|
524
|
+
...e
|
|
525
|
+
})), /* @__PURE__ */ R.createElement("ol", {
|
|
526
|
+
role: "group",
|
|
527
|
+
style: i.treeNodeChildNodesContainer
|
|
528
|
+
}, t ? n : void 0));
|
|
529
|
+
}), G = "$", Oe = "*";
|
|
530
|
+
function k(e, t) {
|
|
531
|
+
return !t(e).next().done;
|
|
532
|
+
}
|
|
533
|
+
l(k, "hasChildNodes");
|
|
534
|
+
var ct = /* @__PURE__ */ l((e) => Array.from({ length: e }, (t, r) => [G].concat(Array.from({ length: r }, () => "*")).join(".")), "wildcard\
|
|
535
|
+
PathsFromLevel"), Et = /* @__PURE__ */ l((e, t, r, n, o) => {
|
|
536
|
+
let a = [].concat(ct(n)).concat(r).filter((s) => typeof s == "string"), c = [];
|
|
537
|
+
return a.forEach((s) => {
|
|
538
|
+
let i = s.split("."), E = /* @__PURE__ */ l((p, f, A) => {
|
|
539
|
+
if (A === i.length) {
|
|
540
|
+
c.push(f);
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
let N = i[A];
|
|
544
|
+
if (A === 0)
|
|
545
|
+
k(p, t) && (N === G || N === Oe) && E(p, G, A + 1);
|
|
546
|
+
else if (N === Oe)
|
|
547
|
+
for (let { name: O, data: d } of t(p))
|
|
548
|
+
k(d, t) && E(d, `${f}.${O}`, A + 1);
|
|
549
|
+
else {
|
|
550
|
+
let O = p[N];
|
|
551
|
+
k(O, t) && E(O, `${f}.${N}`, A + 1);
|
|
552
|
+
}
|
|
553
|
+
}, "populatePaths");
|
|
554
|
+
E(e, "", 0);
|
|
555
|
+
}), c.reduce((s, i) => (s[i] = !0, s), { ...o });
|
|
556
|
+
}, "getExpandedPaths"), ye = ge((e) => {
|
|
557
|
+
let { data: t, dataIterator: r, path: n, depth: o, nodeRenderer: a } = e, [c, s] = Ke(Ne), i = k(t, r), E = !!c[n], p = qe(() => i && s((f) => ({
|
|
558
|
+
...f,
|
|
559
|
+
[n]: !E
|
|
560
|
+
})), [i, s, n, E]);
|
|
561
|
+
return /* @__PURE__ */ M.createElement(it, {
|
|
562
|
+
expanded: E,
|
|
563
|
+
onClick: p,
|
|
564
|
+
shouldShowArrow: i,
|
|
565
|
+
shouldShowPlaceholder: o > 0,
|
|
566
|
+
nodeRenderer: a,
|
|
567
|
+
...e
|
|
568
|
+
}, E ? [...r(t)].map(({ name: f, data: A, ...N }) => /* @__PURE__ */ M.createElement(ye, {
|
|
569
|
+
name: f,
|
|
570
|
+
data: A,
|
|
571
|
+
depth: o + 1,
|
|
572
|
+
path: `${n}.${f}`,
|
|
573
|
+
key: f,
|
|
574
|
+
dataIterator: r,
|
|
575
|
+
nodeRenderer: a,
|
|
576
|
+
...N
|
|
577
|
+
})) : null);
|
|
578
|
+
}), Re = ge(({ name: e, data: t, dataIterator: r, nodeRenderer: n, expandPaths: o, expandLevel: a }) => {
|
|
579
|
+
let c = g("TreeView"), s = et({}), [, i] = s;
|
|
580
|
+
return Qe(() => i((E) => Et(t, r, o, a, E)), [t, r, o, a]), /* @__PURE__ */ M.createElement(Ne.Provider, {
|
|
581
|
+
value: s
|
|
582
|
+
}, /* @__PURE__ */ M.createElement("ol", {
|
|
583
|
+
role: "tree",
|
|
584
|
+
style: c.treeViewOutline
|
|
585
|
+
}, /* @__PURE__ */ M.createElement(ye, {
|
|
586
|
+
name: e,
|
|
587
|
+
data: t,
|
|
588
|
+
dataIterator: r,
|
|
589
|
+
depth: 0,
|
|
590
|
+
path: G,
|
|
591
|
+
nodeRenderer: n
|
|
592
|
+
})));
|
|
593
|
+
}), Q = /* @__PURE__ */ l(({ name: e, dimmed: t = !1, styles: r = {} }) => {
|
|
594
|
+
let n = g("ObjectName"), o = {
|
|
595
|
+
...n.base,
|
|
596
|
+
...t ? n.dimmed : {},
|
|
597
|
+
...r
|
|
598
|
+
};
|
|
599
|
+
return /* @__PURE__ */ pt.createElement("span", {
|
|
600
|
+
style: o
|
|
601
|
+
}, e);
|
|
602
|
+
}, "ObjectName"), w = /* @__PURE__ */ l(({ object: e, styles: t }) => {
|
|
603
|
+
let r = g("ObjectValue"), n = /* @__PURE__ */ l((o) => ({ ...r[o], ...t }), "mkStyle");
|
|
604
|
+
switch (typeof e) {
|
|
605
|
+
case "bigint":
|
|
606
|
+
return /* @__PURE__ */ _.createElement("span", {
|
|
607
|
+
style: n("objectValueNumber")
|
|
608
|
+
}, String(e), "n");
|
|
609
|
+
case "number":
|
|
610
|
+
return /* @__PURE__ */ _.createElement("span", {
|
|
611
|
+
style: n("objectValueNumber")
|
|
612
|
+
}, String(e));
|
|
613
|
+
case "string":
|
|
614
|
+
return /* @__PURE__ */ _.createElement("span", {
|
|
615
|
+
style: n("objectValueString")
|
|
616
|
+
}, '"', e, '"');
|
|
617
|
+
case "boolean":
|
|
618
|
+
return /* @__PURE__ */ _.createElement("span", {
|
|
619
|
+
style: n("objectValueBoolean")
|
|
620
|
+
}, String(e));
|
|
621
|
+
case "undefined":
|
|
622
|
+
return /* @__PURE__ */ _.createElement("span", {
|
|
623
|
+
style: n("objectValueUndefined")
|
|
624
|
+
}, "undefined");
|
|
625
|
+
case "object":
|
|
626
|
+
return e === null ? /* @__PURE__ */ _.createElement("span", {
|
|
627
|
+
style: n("objectValueNull")
|
|
628
|
+
}, "null") : e instanceof Date ? /* @__PURE__ */ _.createElement("span", null, e.toString()) : e instanceof RegExp ? /* @__PURE__ */ _.
|
|
629
|
+
createElement("span", {
|
|
630
|
+
style: n("objectValueRegExp")
|
|
631
|
+
}, e.toString()) : Array.isArray(e) ? /* @__PURE__ */ _.createElement("span", null, `Array(${e.length})`) : e.constructor ? typeof e.constructor.
|
|
632
|
+
isBuffer == "function" && e.constructor.isBuffer(e) ? /* @__PURE__ */ _.createElement("span", null, `Buffer[${e.length}]`) : /* @__PURE__ */ _.
|
|
633
|
+
createElement("span", null, e.constructor.name) : /* @__PURE__ */ _.createElement("span", null, "Object");
|
|
634
|
+
case "function":
|
|
635
|
+
return /* @__PURE__ */ _.createElement("span", null, /* @__PURE__ */ _.createElement("span", {
|
|
636
|
+
style: n("objectValueFunctionPrefix")
|
|
637
|
+
}, "\u0192\xA0"), /* @__PURE__ */ _.createElement("span", {
|
|
638
|
+
style: n("objectValueFunctionName")
|
|
639
|
+
}, e.name, "()"));
|
|
640
|
+
case "symbol":
|
|
641
|
+
return /* @__PURE__ */ _.createElement("span", {
|
|
642
|
+
style: n("objectValueSymbol")
|
|
643
|
+
}, e.toString());
|
|
644
|
+
default:
|
|
645
|
+
return /* @__PURE__ */ _.createElement("span", null);
|
|
646
|
+
}
|
|
647
|
+
}, "ObjectValue"), be = Object.prototype.hasOwnProperty, ut = Object.prototype.propertyIsEnumerable;
|
|
648
|
+
function $(e, t) {
|
|
649
|
+
let r = Object.getOwnPropertyDescriptor(e, t);
|
|
650
|
+
if (r.get)
|
|
651
|
+
try {
|
|
652
|
+
return r.get();
|
|
653
|
+
} catch {
|
|
654
|
+
return r.get;
|
|
655
|
+
}
|
|
656
|
+
return e[t];
|
|
657
|
+
}
|
|
658
|
+
l($, "getPropertyValue");
|
|
659
|
+
function _e(e, t) {
|
|
660
|
+
return e.length === 0 ? [] : e.slice(1).reduce((r, n) => r.concat([t, n]), [e[0]]);
|
|
661
|
+
}
|
|
662
|
+
l(_e, "intersperse");
|
|
663
|
+
var Z = /* @__PURE__ */ l(({ data: e }) => {
|
|
664
|
+
let t = g("ObjectPreview"), r = e;
|
|
665
|
+
if (typeof r != "object" || r === null || r instanceof Date || r instanceof RegExp)
|
|
666
|
+
return /* @__PURE__ */ m.createElement(w, {
|
|
667
|
+
object: r
|
|
668
|
+
});
|
|
669
|
+
if (Array.isArray(r)) {
|
|
670
|
+
let n = t.arrayMaxProperties, o = r.slice(0, n).map((c, s) => /* @__PURE__ */ m.createElement(w, {
|
|
671
|
+
key: s,
|
|
672
|
+
object: c
|
|
673
|
+
}));
|
|
674
|
+
r.length > n && o.push(/* @__PURE__ */ m.createElement("span", {
|
|
675
|
+
key: "ellipsis"
|
|
676
|
+
}, "\u2026"));
|
|
677
|
+
let a = r.length;
|
|
678
|
+
return /* @__PURE__ */ m.createElement(m.Fragment, null, /* @__PURE__ */ m.createElement("span", {
|
|
679
|
+
style: t.objectDescription
|
|
680
|
+
}, a === 0 ? "" : `(${a})\xA0`), /* @__PURE__ */ m.createElement("span", {
|
|
681
|
+
style: t.preview
|
|
682
|
+
}, "[", _e(o, ", "), "]"));
|
|
683
|
+
} else {
|
|
684
|
+
let n = t.objectMaxProperties, o = [];
|
|
685
|
+
for (let c in r)
|
|
686
|
+
if (be.call(r, c)) {
|
|
687
|
+
let s;
|
|
688
|
+
o.length === n - 1 && Object.keys(r).length > n && (s = /* @__PURE__ */ m.createElement("span", {
|
|
689
|
+
key: "ellipsis"
|
|
690
|
+
}, "\u2026"));
|
|
691
|
+
let i = $(r, c);
|
|
692
|
+
if (o.push(/* @__PURE__ */ m.createElement("span", {
|
|
693
|
+
key: c
|
|
694
|
+
}, /* @__PURE__ */ m.createElement(Q, {
|
|
695
|
+
name: c || '""'
|
|
696
|
+
}), ":\xA0", /* @__PURE__ */ m.createElement(w, {
|
|
697
|
+
object: i
|
|
698
|
+
}), s)), s)
|
|
699
|
+
break;
|
|
700
|
+
}
|
|
701
|
+
let a = r.constructor ? r.constructor.name : "Object";
|
|
702
|
+
return /* @__PURE__ */ m.createElement(m.Fragment, null, /* @__PURE__ */ m.createElement("span", {
|
|
703
|
+
style: t.objectDescription
|
|
704
|
+
}, a === "Object" ? "" : `${a} `), /* @__PURE__ */ m.createElement("span", {
|
|
705
|
+
style: t.preview
|
|
706
|
+
}, "{", _e(o, ", "), "}"));
|
|
707
|
+
}
|
|
708
|
+
}, "ObjectPreview"), Ot = /* @__PURE__ */ l(({ name: e, data: t }) => typeof e == "string" ? /* @__PURE__ */ B.createElement("span", null, /* @__PURE__ */ B.
|
|
709
|
+
createElement(Q, {
|
|
710
|
+
name: e
|
|
711
|
+
}), /* @__PURE__ */ B.createElement("span", null, ": "), /* @__PURE__ */ B.createElement(Z, {
|
|
712
|
+
data: t
|
|
713
|
+
})) : /* @__PURE__ */ B.createElement(Z, {
|
|
714
|
+
data: t
|
|
715
|
+
}), "ObjectRootLabel"), _t = /* @__PURE__ */ l(({ name: e, data: t, isNonenumerable: r = !1 }) => {
|
|
716
|
+
let n = t;
|
|
717
|
+
return /* @__PURE__ */ x.createElement("span", null, typeof e == "string" ? /* @__PURE__ */ x.createElement(Q, {
|
|
718
|
+
name: e,
|
|
719
|
+
dimmed: r
|
|
720
|
+
}) : /* @__PURE__ */ x.createElement(Z, {
|
|
721
|
+
data: e
|
|
722
|
+
}), /* @__PURE__ */ x.createElement("span", null, ": "), /* @__PURE__ */ x.createElement(w, {
|
|
723
|
+
object: n
|
|
724
|
+
}));
|
|
725
|
+
}, "ObjectLabel"), dt = /* @__PURE__ */ l((e, t) => /* @__PURE__ */ l(function* (n) {
|
|
726
|
+
if (!(typeof n == "object" && n !== null || typeof n == "function"))
|
|
727
|
+
return;
|
|
728
|
+
let a = Array.isArray(n);
|
|
729
|
+
if (!a && n[Symbol.iterator]) {
|
|
730
|
+
let c = 0;
|
|
731
|
+
for (let s of n) {
|
|
732
|
+
if (Array.isArray(s) && s.length === 2) {
|
|
733
|
+
let [i, E] = s;
|
|
734
|
+
yield {
|
|
735
|
+
name: i,
|
|
736
|
+
data: E
|
|
737
|
+
};
|
|
738
|
+
} else
|
|
739
|
+
yield {
|
|
740
|
+
name: c.toString(),
|
|
741
|
+
data: s
|
|
742
|
+
};
|
|
743
|
+
c++;
|
|
744
|
+
}
|
|
745
|
+
} else {
|
|
746
|
+
let c = Object.getOwnPropertyNames(n);
|
|
747
|
+
t === !0 && !a ? c.sort() : typeof t == "function" && c.sort(t);
|
|
748
|
+
for (let s of c)
|
|
749
|
+
if (ut.call(n, s)) {
|
|
750
|
+
let i = $(n, s);
|
|
751
|
+
yield {
|
|
752
|
+
name: s || '""',
|
|
753
|
+
data: i
|
|
754
|
+
};
|
|
755
|
+
} else if (e) {
|
|
756
|
+
let i;
|
|
757
|
+
try {
|
|
758
|
+
i = $(n, s);
|
|
759
|
+
} catch {
|
|
760
|
+
}
|
|
761
|
+
i !== void 0 && (yield {
|
|
762
|
+
name: s,
|
|
763
|
+
data: i,
|
|
764
|
+
isNonenumerable: !0
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
e && n !== Object.prototype && (yield {
|
|
768
|
+
name: "__proto__",
|
|
769
|
+
data: Object.getPrototypeOf(n),
|
|
770
|
+
isNonenumerable: !0
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
}, "objectIterator"), "createIterator"), mt = /* @__PURE__ */ l(({ depth: e, name: t, data: r, isNonenumerable: n }) => e === 0 ? /* @__PURE__ */ Y.
|
|
774
|
+
createElement(Ot, {
|
|
775
|
+
name: t,
|
|
776
|
+
data: r
|
|
777
|
+
}) : /* @__PURE__ */ Y.createElement(_t, {
|
|
778
|
+
name: t,
|
|
779
|
+
data: r,
|
|
780
|
+
isNonenumerable: n
|
|
781
|
+
}), "defaultNodeRenderer"), Tt = /* @__PURE__ */ l(({ showNonenumerable: e = !1, sortObjectKeys: t, nodeRenderer: r, ...n }) => {
|
|
782
|
+
let o = dt(e, t), a = r || mt;
|
|
783
|
+
return /* @__PURE__ */ Y.createElement(Re, {
|
|
784
|
+
nodeRenderer: a,
|
|
785
|
+
dataIterator: o,
|
|
786
|
+
...n
|
|
787
|
+
});
|
|
788
|
+
}, "ObjectInspector"), ft = q(Tt);
|
|
789
|
+
function gt(e) {
|
|
790
|
+
if (typeof e == "object") {
|
|
791
|
+
let t = [];
|
|
792
|
+
if (Array.isArray(e)) {
|
|
793
|
+
let n = e.length;
|
|
794
|
+
t = [...Array(n).keys()];
|
|
795
|
+
} else e !== null && (t = Object.keys(e));
|
|
796
|
+
let r = t.reduce((n, o) => {
|
|
797
|
+
let a = e[o];
|
|
798
|
+
return typeof a == "object" && a !== null && Object.keys(a).reduce((s, i) => (s.includes(i) || s.push(i), s), n), n;
|
|
799
|
+
}, []);
|
|
800
|
+
return {
|
|
801
|
+
rowHeaders: t,
|
|
802
|
+
colHeaders: r
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
l(gt, "getHeaders");
|
|
807
|
+
var Nt = /* @__PURE__ */ l(({ rows: e, columns: t, rowsData: r }) => {
|
|
808
|
+
let n = g("TableInspectorDataContainer"), o = g("TableInspectorLeftBorder");
|
|
809
|
+
return /* @__PURE__ */ C.createElement("div", {
|
|
810
|
+
style: n.div
|
|
811
|
+
}, /* @__PURE__ */ C.createElement("table", {
|
|
812
|
+
style: n.table
|
|
813
|
+
}, /* @__PURE__ */ C.createElement("colgroup", null), /* @__PURE__ */ C.createElement("tbody", null, e.map((a, c) => /* @__PURE__ */ C.createElement(
|
|
814
|
+
"tr", {
|
|
815
|
+
key: a,
|
|
816
|
+
style: n.tr
|
|
817
|
+
}, /* @__PURE__ */ C.createElement("td", {
|
|
818
|
+
style: { ...n.td, ...o.none }
|
|
819
|
+
}, a), t.map((s) => {
|
|
820
|
+
let i = r[c];
|
|
821
|
+
return typeof i == "object" && i !== null && be.call(i, s) ? /* @__PURE__ */ C.createElement("td", {
|
|
822
|
+
key: s,
|
|
823
|
+
style: { ...n.td, ...o.solid }
|
|
824
|
+
}, /* @__PURE__ */ C.createElement(w, {
|
|
825
|
+
object: i[s]
|
|
826
|
+
})) : /* @__PURE__ */ C.createElement("td", {
|
|
827
|
+
key: s,
|
|
828
|
+
style: { ...n.td, ...o.solid }
|
|
829
|
+
});
|
|
830
|
+
}))))));
|
|
831
|
+
}, "DataContainer"), yt = /* @__PURE__ */ l((e) => /* @__PURE__ */ I.createElement("div", {
|
|
832
|
+
style: {
|
|
833
|
+
position: "absolute",
|
|
834
|
+
top: 1,
|
|
835
|
+
right: 0,
|
|
836
|
+
bottom: 1,
|
|
837
|
+
display: "flex",
|
|
838
|
+
alignItems: "center"
|
|
839
|
+
}
|
|
840
|
+
}, e.children), "SortIconContainer"), Rt = /* @__PURE__ */ l(({ sortAscending: e }) => {
|
|
841
|
+
let t = g("TableInspectorSortIcon"), r = e ? "\u25B2" : "\u25BC";
|
|
842
|
+
return /* @__PURE__ */ I.createElement("div", {
|
|
843
|
+
style: t
|
|
844
|
+
}, r);
|
|
845
|
+
}, "SortIcon"), Te = /* @__PURE__ */ l(({
|
|
846
|
+
sortAscending: e = !1,
|
|
847
|
+
sorted: t = !1,
|
|
848
|
+
onClick: r = void 0,
|
|
849
|
+
borderStyle: n = {},
|
|
850
|
+
children: o,
|
|
851
|
+
...a
|
|
852
|
+
}) => {
|
|
853
|
+
let c = g("TableInspectorTH"), [s, i] = Ct(!1), E = me(() => i(!0), []), p = me(() => i(!1), []);
|
|
854
|
+
return /* @__PURE__ */ I.createElement("th", {
|
|
855
|
+
...a,
|
|
856
|
+
style: {
|
|
857
|
+
...c.base,
|
|
858
|
+
...n,
|
|
859
|
+
...s ? c.base[":hover"] : {}
|
|
860
|
+
},
|
|
861
|
+
onMouseEnter: E,
|
|
862
|
+
onMouseLeave: p,
|
|
863
|
+
onClick: r
|
|
864
|
+
}, /* @__PURE__ */ I.createElement("div", {
|
|
865
|
+
style: c.div
|
|
866
|
+
}, o), t && /* @__PURE__ */ I.createElement(yt, null, /* @__PURE__ */ I.createElement(Rt, {
|
|
867
|
+
sortAscending: e
|
|
868
|
+
})));
|
|
869
|
+
}, "TH"), bt = /* @__PURE__ */ l(({
|
|
870
|
+
indexColumnText: e = "(index)",
|
|
871
|
+
columns: t = [],
|
|
872
|
+
sorted: r,
|
|
873
|
+
sortIndexColumn: n,
|
|
874
|
+
sortColumn: o,
|
|
875
|
+
sortAscending: a,
|
|
876
|
+
onTHClick: c,
|
|
877
|
+
onIndexTHClick: s
|
|
878
|
+
}) => {
|
|
879
|
+
let i = g("TableInspectorHeaderContainer"), E = g("TableInspectorLeftBorder");
|
|
880
|
+
return /* @__PURE__ */ h.createElement("div", {
|
|
881
|
+
style: i.base
|
|
882
|
+
}, /* @__PURE__ */ h.createElement("table", {
|
|
883
|
+
style: i.table
|
|
884
|
+
}, /* @__PURE__ */ h.createElement("tbody", null, /* @__PURE__ */ h.createElement("tr", null, /* @__PURE__ */ h.createElement(Te, {
|
|
885
|
+
borderStyle: E.none,
|
|
886
|
+
sorted: r && n,
|
|
887
|
+
sortAscending: a,
|
|
888
|
+
onClick: s
|
|
889
|
+
}, e), t.map((p) => /* @__PURE__ */ h.createElement(Te, {
|
|
890
|
+
borderStyle: E.solid,
|
|
891
|
+
key: p,
|
|
892
|
+
sorted: r && o === p,
|
|
893
|
+
sortAscending: a,
|
|
894
|
+
onClick: c.bind(null, p)
|
|
895
|
+
}, p))))));
|
|
896
|
+
}, "HeaderContainer"), Lt = /* @__PURE__ */ l(({
|
|
897
|
+
data: e,
|
|
898
|
+
columns: t
|
|
899
|
+
}) => {
|
|
900
|
+
let r = g("TableInspector"), [{ sorted: n, sortIndexColumn: o, sortColumn: a, sortAscending: c }, s] = At({
|
|
901
|
+
sorted: !1,
|
|
902
|
+
sortIndexColumn: !1,
|
|
903
|
+
sortColumn: void 0,
|
|
904
|
+
sortAscending: !1
|
|
905
|
+
}), i = de(() => {
|
|
906
|
+
s(({ sortIndexColumn: O, sortAscending: d }) => ({
|
|
907
|
+
sorted: !0,
|
|
908
|
+
sortIndexColumn: !0,
|
|
909
|
+
sortColumn: void 0,
|
|
910
|
+
sortAscending: O ? !d : !0
|
|
911
|
+
}));
|
|
912
|
+
}, []), E = de((O) => {
|
|
913
|
+
s(({ sortColumn: d, sortAscending: T }) => ({
|
|
914
|
+
sorted: !0,
|
|
915
|
+
sortIndexColumn: !1,
|
|
916
|
+
sortColumn: O,
|
|
917
|
+
sortAscending: O === d ? !T : !0
|
|
918
|
+
}));
|
|
919
|
+
}, []);
|
|
920
|
+
if (typeof e != "object" || e === null)
|
|
921
|
+
return /* @__PURE__ */ V.createElement("div", null);
|
|
922
|
+
let { rowHeaders: p, colHeaders: f } = gt(e);
|
|
923
|
+
t !== void 0 && (f = t);
|
|
924
|
+
let A = p.map((O) => e[O]), N;
|
|
925
|
+
if (a !== void 0 ? N = A.map((O, d) => typeof O == "object" && O !== null ? [O[a], d] : [void 0, d]) : o && (N = p.map((O, d) => [p[d], d])),
|
|
926
|
+
N !== void 0) {
|
|
927
|
+
let O = /* @__PURE__ */ l((T, we) => (Pe, Ue) => {
|
|
928
|
+
let re = T(Pe), ne = T(Ue), oe = typeof re, le = typeof ne, ae = /* @__PURE__ */ l((v, se) => v < se ? -1 : v > se ? 1 : 0, "lt"), S;
|
|
929
|
+
if (oe === le)
|
|
930
|
+
S = ae(re, ne);
|
|
931
|
+
else {
|
|
932
|
+
let v = {
|
|
933
|
+
string: 0,
|
|
934
|
+
number: 1,
|
|
935
|
+
object: 2,
|
|
936
|
+
symbol: 3,
|
|
937
|
+
boolean: 4,
|
|
938
|
+
undefined: 5,
|
|
939
|
+
function: 6
|
|
940
|
+
};
|
|
941
|
+
S = ae(v[oe], v[le]);
|
|
942
|
+
}
|
|
943
|
+
return we || (S = -S), S;
|
|
944
|
+
}, "comparator"), d = N.sort(O((T) => T[0], c)).map((T) => T[1]);
|
|
945
|
+
p = d.map((T) => p[T]), A = d.map((T) => A[T]);
|
|
946
|
+
}
|
|
947
|
+
return /* @__PURE__ */ V.createElement("div", {
|
|
948
|
+
style: r.base
|
|
949
|
+
}, /* @__PURE__ */ V.createElement(bt, {
|
|
950
|
+
columns: f,
|
|
951
|
+
sorted: n,
|
|
952
|
+
sortIndexColumn: o,
|
|
953
|
+
sortColumn: a,
|
|
954
|
+
sortAscending: c,
|
|
955
|
+
onTHClick: E,
|
|
956
|
+
onIndexTHClick: i
|
|
957
|
+
}), /* @__PURE__ */ V.createElement(Nt, {
|
|
958
|
+
rows: p,
|
|
959
|
+
columns: f,
|
|
960
|
+
rowsData: A
|
|
961
|
+
}));
|
|
962
|
+
}, "TableInspector"), ht = q(Lt), St = 80, Le = /* @__PURE__ */ l((e) => e.childNodes.length === 0 || e.childNodes.length === 1 && e.childNodes[0].
|
|
963
|
+
nodeType === Node.TEXT_NODE && e.textContent.length < St, "shouldInline"), vt = /* @__PURE__ */ l(({ tagName: e, attributes: t, styles: r }) => /* @__PURE__ */ u.
|
|
964
|
+
createElement("span", {
|
|
965
|
+
style: r.base
|
|
966
|
+
}, "<", /* @__PURE__ */ u.createElement("span", {
|
|
967
|
+
style: r.tagName
|
|
968
|
+
}, e), (() => {
|
|
969
|
+
if (t) {
|
|
970
|
+
let n = [];
|
|
971
|
+
for (let o = 0; o < t.length; o++) {
|
|
972
|
+
let a = t[o];
|
|
973
|
+
n.push(/* @__PURE__ */ u.createElement("span", {
|
|
974
|
+
key: o
|
|
975
|
+
}, " ", /* @__PURE__ */ u.createElement("span", {
|
|
976
|
+
style: r.htmlAttributeName
|
|
977
|
+
}, a.name), '="', /* @__PURE__ */ u.createElement("span", {
|
|
978
|
+
style: r.htmlAttributeValue
|
|
979
|
+
}, a.value), '"'));
|
|
980
|
+
}
|
|
981
|
+
return n;
|
|
982
|
+
}
|
|
983
|
+
})(), ">"), "OpenTag"), fe = /* @__PURE__ */ l(({ tagName: e, isChildNode: t = !1, styles: r }) => /* @__PURE__ */ u.createElement("span", {
|
|
984
|
+
style: Object.assign({}, r.base, t && r.offsetLeft)
|
|
985
|
+
}, "</", /* @__PURE__ */ u.createElement("span", {
|
|
986
|
+
style: r.tagName
|
|
987
|
+
}, e), ">"), "CloseTag"), Dt = {
|
|
988
|
+
1: "ELEMENT_NODE",
|
|
989
|
+
3: "TEXT_NODE",
|
|
990
|
+
7: "PROCESSING_INSTRUCTION_NODE",
|
|
991
|
+
8: "COMMENT_NODE",
|
|
992
|
+
9: "DOCUMENT_NODE",
|
|
993
|
+
10: "DOCUMENT_TYPE_NODE",
|
|
994
|
+
11: "DOCUMENT_FRAGMENT_NODE"
|
|
995
|
+
}, Bt = /* @__PURE__ */ l(({ isCloseTag: e, data: t, expanded: r }) => {
|
|
996
|
+
let n = g("DOMNodePreview");
|
|
997
|
+
if (e)
|
|
998
|
+
return /* @__PURE__ */ u.createElement(fe, {
|
|
999
|
+
styles: n.htmlCloseTag,
|
|
1000
|
+
isChildNode: !0,
|
|
1001
|
+
tagName: t.tagName
|
|
1002
|
+
});
|
|
1003
|
+
switch (t.nodeType) {
|
|
1004
|
+
case Node.ELEMENT_NODE:
|
|
1005
|
+
return /* @__PURE__ */ u.createElement("span", null, /* @__PURE__ */ u.createElement(vt, {
|
|
1006
|
+
tagName: t.tagName,
|
|
1007
|
+
attributes: t.attributes,
|
|
1008
|
+
styles: n.htmlOpenTag
|
|
1009
|
+
}), Le(t) ? t.textContent : !r && "\u2026", !r && /* @__PURE__ */ u.createElement(fe, {
|
|
1010
|
+
tagName: t.tagName,
|
|
1011
|
+
styles: n.htmlCloseTag
|
|
1012
|
+
}));
|
|
1013
|
+
case Node.TEXT_NODE:
|
|
1014
|
+
return /* @__PURE__ */ u.createElement("span", null, t.textContent);
|
|
1015
|
+
case Node.CDATA_SECTION_NODE:
|
|
1016
|
+
return /* @__PURE__ */ u.createElement("span", null, "<![CDATA[" + t.textContent + "]]>");
|
|
1017
|
+
case Node.COMMENT_NODE:
|
|
1018
|
+
return /* @__PURE__ */ u.createElement("span", {
|
|
1019
|
+
style: n.htmlComment
|
|
1020
|
+
}, "<!--", t.textContent, "-->");
|
|
1021
|
+
case Node.PROCESSING_INSTRUCTION_NODE:
|
|
1022
|
+
return /* @__PURE__ */ u.createElement("span", null, t.nodeName);
|
|
1023
|
+
case Node.DOCUMENT_TYPE_NODE:
|
|
1024
|
+
return /* @__PURE__ */ u.createElement("span", {
|
|
1025
|
+
style: n.htmlDoctype
|
|
1026
|
+
}, "<!DOCTYPE ", t.name, t.publicId ? ` PUBLIC "${t.publicId}"` : "", !t.publicId && t.systemId ? " SYSTEM" : "", t.systemId ? ` "${t.
|
|
1027
|
+
systemId}"` : "", ">");
|
|
1028
|
+
case Node.DOCUMENT_NODE:
|
|
1029
|
+
return /* @__PURE__ */ u.createElement("span", null, t.nodeName);
|
|
1030
|
+
case Node.DOCUMENT_FRAGMENT_NODE:
|
|
1031
|
+
return /* @__PURE__ */ u.createElement("span", null, t.nodeName);
|
|
1032
|
+
default:
|
|
1033
|
+
return /* @__PURE__ */ u.createElement("span", null, Dt[t.nodeType]);
|
|
1034
|
+
}
|
|
1035
|
+
}, "DOMNodePreview"), xt = /* @__PURE__ */ l(function* (e) {
|
|
1036
|
+
if (e && e.childNodes) {
|
|
1037
|
+
if (Le(e))
|
|
1038
|
+
return;
|
|
1039
|
+
for (let r = 0; r < e.childNodes.length; r++) {
|
|
1040
|
+
let n = e.childNodes[r];
|
|
1041
|
+
n.nodeType === Node.TEXT_NODE && n.textContent.trim().length === 0 || (yield {
|
|
1042
|
+
name: `${n.tagName}[${r}]`,
|
|
1043
|
+
data: n
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
e.tagName && (yield {
|
|
1047
|
+
name: "CLOSE_TAG",
|
|
1048
|
+
data: {
|
|
1049
|
+
tagName: e.tagName
|
|
1050
|
+
},
|
|
1051
|
+
isCloseTag: !0
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
}, "domIterator"), Mt = /* @__PURE__ */ l((e) => /* @__PURE__ */ It.createElement(Re, {
|
|
1055
|
+
nodeRenderer: Bt,
|
|
1056
|
+
dataIterator: xt,
|
|
1057
|
+
...e
|
|
1058
|
+
}), "DOMInspector"), wt = q(Mt), Pt = We($e()), he = /* @__PURE__ */ l(({ table: e = !1, data: t, ...r }) => e ? /* @__PURE__ */ W.createElement(
|
|
1059
|
+
ht, {
|
|
1060
|
+
data: t,
|
|
1061
|
+
...r
|
|
1062
|
+
}) : (0, Pt.default)(t) ? /* @__PURE__ */ W.createElement(wt, {
|
|
1063
|
+
data: t,
|
|
1064
|
+
...r
|
|
1065
|
+
}) : /* @__PURE__ */ W.createElement(ft, {
|
|
1066
|
+
data: t,
|
|
1067
|
+
...r
|
|
1068
|
+
}), "Inspector");
|
|
1069
|
+
|
|
1070
|
+
// src/actions/components/ActionLogger/index.tsx
|
|
1071
|
+
import { styled as Jt, withTheme as Wt } from "storybook/theming";
|
|
1072
|
+
|
|
1073
|
+
// src/actions/components/ActionLogger/style.tsx
|
|
1074
|
+
import { opacify as Ut } from "polished";
|
|
1075
|
+
import { styled as ee } from "storybook/theming";
|
|
1076
|
+
var Ie = ee.div({
|
|
1077
|
+
display: "flex",
|
|
1078
|
+
padding: 0,
|
|
1079
|
+
borderLeft: "5px solid transparent",
|
|
1080
|
+
borderBottom: "1px solid transparent",
|
|
1081
|
+
transition: "all 0.1s",
|
|
1082
|
+
alignItems: "flex-start",
|
|
1083
|
+
whiteSpace: "pre"
|
|
1084
|
+
}), Se = ee.div(({ theme: e }) => ({
|
|
1085
|
+
backgroundColor: Ut(0.5, e.appBorderColor),
|
|
1086
|
+
color: e.color.inverseText,
|
|
1087
|
+
fontSize: e.typography.size.s1,
|
|
1088
|
+
fontWeight: e.typography.weight.bold,
|
|
1089
|
+
lineHeight: 1,
|
|
1090
|
+
padding: "1px 5px",
|
|
1091
|
+
borderRadius: 20,
|
|
1092
|
+
margin: "2px 0px"
|
|
1093
|
+
})), ve = ee.div({
|
|
1094
|
+
flex: 1,
|
|
1095
|
+
padding: "0 0 0 5px"
|
|
1096
|
+
});
|
|
1097
|
+
|
|
1098
|
+
// src/actions/components/ActionLogger/index.tsx
|
|
1099
|
+
var De = Vt(
|
|
1100
|
+
({ children: e, className: t }, r) => /* @__PURE__ */ y.createElement(Gt, { ref: r, horizontal: !0, vertical: !0, className: t }, e)
|
|
1101
|
+
);
|
|
1102
|
+
De.displayName = "UnstyledWrapped";
|
|
1103
|
+
var Yt = Jt(De)({
|
|
1104
|
+
margin: 0,
|
|
1105
|
+
padding: "10px 5px 20px"
|
|
1106
|
+
}), Xt = Wt(({ theme: e, ...t }) => /* @__PURE__ */ y.createElement(he, { theme: e.addonActionsTheme || "chromeLight", table: !1, ...t })), Be = /* @__PURE__ */ l(
|
|
1107
|
+
({ actions: e, onClear: t }) => {
|
|
1108
|
+
let r = kt(null), n = r.current, o = n && n.scrollHeight - n.scrollTop === n.clientHeight;
|
|
1109
|
+
return jt(() => {
|
|
1110
|
+
o && (r.current.scrollTop = r.current.scrollHeight);
|
|
1111
|
+
}, [o, e.length]), /* @__PURE__ */ y.createElement(Ht, null, /* @__PURE__ */ y.createElement(Yt, { ref: r }, e.map((a) => /* @__PURE__ */ y.
|
|
1112
|
+
createElement(Ie, { key: a.id }, a.count > 1 && /* @__PURE__ */ y.createElement(Se, null, a.count), /* @__PURE__ */ y.createElement(ve, null,
|
|
1113
|
+
/* @__PURE__ */ y.createElement(
|
|
1114
|
+
Xt,
|
|
1115
|
+
{
|
|
1116
|
+
sortObjectKeys: !0,
|
|
1117
|
+
showNonenumerable: !1,
|
|
1118
|
+
name: a.data.name,
|
|
1119
|
+
data: a.data.args ?? a.data
|
|
1120
|
+
}
|
|
1121
|
+
))))), /* @__PURE__ */ y.createElement(Ft, { actionItems: [{ title: "Clear", onClick: t }] }));
|
|
1122
|
+
}, "ActionLogger");
|
|
1123
|
+
|
|
1124
|
+
// src/actions/containers/ActionLogger/index.tsx
|
|
1125
|
+
var zt = /* @__PURE__ */ l((e, t) => {
|
|
1126
|
+
try {
|
|
1127
|
+
return L(e, t);
|
|
1128
|
+
} catch {
|
|
1129
|
+
return !1;
|
|
1130
|
+
}
|
|
1131
|
+
}, "safeDeepEqual"), te = class te extends Zt {
|
|
1132
|
+
constructor(r) {
|
|
1133
|
+
super(r);
|
|
1134
|
+
this.handleStoryChange = /* @__PURE__ */ l(() => {
|
|
1135
|
+
let { actions: r } = this.state;
|
|
1136
|
+
r.length > 0 && r[0].options.clearOnStoryChange && this.clearActions();
|
|
1137
|
+
}, "handleStoryChange");
|
|
1138
|
+
this.addAction = /* @__PURE__ */ l((r) => {
|
|
1139
|
+
this.setState((n) => {
|
|
1140
|
+
let o = [...n.actions], a = o.length && o[o.length - 1];
|
|
1141
|
+
return a && zt(a.data, r.data) ? a.count++ : (r.count = 1, o.push(r)), { actions: o.slice(0, r.options.limit) };
|
|
1142
|
+
});
|
|
1143
|
+
}, "addAction");
|
|
1144
|
+
this.clearActions = /* @__PURE__ */ l(() => {
|
|
1145
|
+
let { api: r } = this.props;
|
|
1146
|
+
r.emit(H), this.setState({ actions: [] });
|
|
1147
|
+
}, "clearActions");
|
|
1148
|
+
this.mounted = !1, this.state = { actions: [] };
|
|
1149
|
+
}
|
|
1150
|
+
componentDidMount() {
|
|
1151
|
+
this.mounted = !0;
|
|
1152
|
+
let { api: r } = this.props;
|
|
1153
|
+
r.on(D, this.addAction), r.on(xe, this.handleStoryChange);
|
|
1154
|
+
}
|
|
1155
|
+
componentWillUnmount() {
|
|
1156
|
+
this.mounted = !1;
|
|
1157
|
+
let { api: r } = this.props;
|
|
1158
|
+
r.off(xe, this.handleStoryChange), r.off(D, this.addAction);
|
|
1159
|
+
}
|
|
1160
|
+
render() {
|
|
1161
|
+
let { actions: r = [] } = this.state, { active: n } = this.props, o = {
|
|
1162
|
+
actions: r,
|
|
1163
|
+
onClear: this.clearActions
|
|
1164
|
+
};
|
|
1165
|
+
return n ? /* @__PURE__ */ $t.createElement(Be, { ...o }) : null;
|
|
1166
|
+
}
|
|
1167
|
+
};
|
|
1168
|
+
l(te, "ActionLogger");
|
|
1169
|
+
var P = te;
|
|
1170
|
+
|
|
1171
|
+
// src/actions/manager.tsx
|
|
1172
|
+
function nr() {
|
|
1173
|
+
let [{ count: e }, t] = tr(b, { count: 0 });
|
|
1174
|
+
return rr({
|
|
1175
|
+
[D]: () => {
|
|
1176
|
+
t((n) => ({ ...n, count: n.count + 1 }));
|
|
1177
|
+
},
|
|
1178
|
+
[Qt]: () => {
|
|
1179
|
+
t((n) => ({ ...n, count: 0 }));
|
|
1180
|
+
},
|
|
1181
|
+
[H]: () => {
|
|
1182
|
+
t((n) => ({ ...n, count: 0 }));
|
|
1183
|
+
}
|
|
1184
|
+
}), /* @__PURE__ */ U.createElement("div", null, /* @__PURE__ */ U.createElement(qt, { col: 1 }, /* @__PURE__ */ U.createElement("span", {
|
|
1185
|
+
style: { display: "inline-block", verticalAlign: "middle" } }, "Actions"), e === 0 ? "" : /* @__PURE__ */ U.createElement(Kt, { status: "n\
|
|
1186
|
+
eutral" }, e)));
|
|
1187
|
+
}
|
|
1188
|
+
l(nr, "Title");
|
|
1189
|
+
Me.register(b, (e) => {
|
|
1190
|
+
Me.add(ce, {
|
|
1191
|
+
title: nr,
|
|
1192
|
+
type: er.PANEL,
|
|
1193
|
+
render: /* @__PURE__ */ l(({ active: t }) => /* @__PURE__ */ U.createElement(P, { api: e, active: !!t }), "render"),
|
|
1194
|
+
paramKey: ie
|
|
1195
|
+
});
|
|
1196
|
+
});
|