@carbonorm/carbonreact 4.0.24 → 5.0.4
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 +45 -12
- package/dist/components/OutsideClickHandler/OutsideClickHandler.d.ts +9 -0
- package/dist/{index.cjs.js → index.cjs} +147 -522
- package/dist/index.cjs.map +1 -0
- package/dist/{index.cjs.css → index.css} +1 -1
- package/dist/{index.cjs.css.map → index.css.map} +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +136 -512
- package/dist/index.esm.js.map +1 -1
- package/package.json +17 -7
- package/src/api/hoc/useEffectOnce.tsx +2 -2
- package/src/components/Errors/BackendThrowable.tsx +1 -1
- package/src/components/OutsideClickHandler/OutsideClickHandler.tsx +33 -0
- package/src/components/Popup/Popup.tsx +1 -1
- package/src/components/WebSocket/CarbonWebSocket.tsx +75 -69
- package/src/hoc/setupTests.tsx +14 -13
- package/src/index.ts +2 -0
- package/dist/index.cjs.js.map +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,441 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useNavigate, HashRouter, MemoryRouter, BrowserRouter } from 'react-router-dom';
|
|
3
|
+
import React, { useRef, useEffect, useState, Component, createContext, lazy } from 'react';
|
|
3
4
|
import { toast, ToastContainer } from 'react-toastify';
|
|
4
|
-
import
|
|
5
|
-
import { toastOptions, timeout, axiosInstance, isVerbose, checkAllRequestsComplete } from '@carbonorm/carbonnode';
|
|
5
|
+
import { toastOptions, isVerbose, timeout, axiosInstance, checkAllRequestsComplete } from '@carbonorm/carbonnode';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import { faClose } from '@fortawesome/free-solid-svg-icons';
|
|
8
8
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
9
9
|
import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
|
|
10
10
|
import { waitFor } from '@testing-library/react';
|
|
11
11
|
|
|
12
|
-
var jsxRuntime = {exports: {}};
|
|
13
|
-
|
|
14
|
-
var reactJsxRuntime_production = {};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @license React
|
|
18
|
-
* react-jsx-runtime.production.js
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the MIT license found in the
|
|
23
|
-
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
var hasRequiredReactJsxRuntime_production;
|
|
27
|
-
|
|
28
|
-
function requireReactJsxRuntime_production () {
|
|
29
|
-
if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
|
|
30
|
-
hasRequiredReactJsxRuntime_production = 1;
|
|
31
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
32
|
-
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
33
|
-
function jsxProd(type, config, maybeKey) {
|
|
34
|
-
var key = null;
|
|
35
|
-
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
36
|
-
void 0 !== config.key && (key = "" + config.key);
|
|
37
|
-
if ("key" in config) {
|
|
38
|
-
maybeKey = {};
|
|
39
|
-
for (var propName in config)
|
|
40
|
-
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
41
|
-
} else maybeKey = config;
|
|
42
|
-
config = maybeKey.ref;
|
|
43
|
-
return {
|
|
44
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
45
|
-
type: type,
|
|
46
|
-
key: key,
|
|
47
|
-
ref: void 0 !== config ? config : null,
|
|
48
|
-
props: maybeKey
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
|
|
52
|
-
reactJsxRuntime_production.jsx = jsxProd;
|
|
53
|
-
reactJsxRuntime_production.jsxs = jsxProd;
|
|
54
|
-
return reactJsxRuntime_production;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
var reactJsxRuntime_development = {};
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* @license React
|
|
61
|
-
* react-jsx-runtime.development.js
|
|
62
|
-
*
|
|
63
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
64
|
-
*
|
|
65
|
-
* This source code is licensed under the MIT license found in the
|
|
66
|
-
* LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
var hasRequiredReactJsxRuntime_development;
|
|
70
|
-
|
|
71
|
-
function requireReactJsxRuntime_development () {
|
|
72
|
-
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
73
|
-
hasRequiredReactJsxRuntime_development = 1;
|
|
74
|
-
"production" !== process.env.NODE_ENV &&
|
|
75
|
-
(function () {
|
|
76
|
-
function getComponentNameFromType(type) {
|
|
77
|
-
if (null == type) return null;
|
|
78
|
-
if ("function" === typeof type)
|
|
79
|
-
return type.$$typeof === REACT_CLIENT_REFERENCE
|
|
80
|
-
? null
|
|
81
|
-
: type.displayName || type.name || null;
|
|
82
|
-
if ("string" === typeof type) return type;
|
|
83
|
-
switch (type) {
|
|
84
|
-
case REACT_FRAGMENT_TYPE:
|
|
85
|
-
return "Fragment";
|
|
86
|
-
case REACT_PROFILER_TYPE:
|
|
87
|
-
return "Profiler";
|
|
88
|
-
case REACT_STRICT_MODE_TYPE:
|
|
89
|
-
return "StrictMode";
|
|
90
|
-
case REACT_SUSPENSE_TYPE:
|
|
91
|
-
return "Suspense";
|
|
92
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
93
|
-
return "SuspenseList";
|
|
94
|
-
case REACT_ACTIVITY_TYPE:
|
|
95
|
-
return "Activity";
|
|
96
|
-
}
|
|
97
|
-
if ("object" === typeof type)
|
|
98
|
-
switch (
|
|
99
|
-
("number" === typeof type.tag &&
|
|
100
|
-
console.error(
|
|
101
|
-
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
102
|
-
),
|
|
103
|
-
type.$$typeof)
|
|
104
|
-
) {
|
|
105
|
-
case REACT_PORTAL_TYPE:
|
|
106
|
-
return "Portal";
|
|
107
|
-
case REACT_CONTEXT_TYPE:
|
|
108
|
-
return (type.displayName || "Context") + ".Provider";
|
|
109
|
-
case REACT_CONSUMER_TYPE:
|
|
110
|
-
return (type._context.displayName || "Context") + ".Consumer";
|
|
111
|
-
case REACT_FORWARD_REF_TYPE:
|
|
112
|
-
var innerType = type.render;
|
|
113
|
-
type = type.displayName;
|
|
114
|
-
type ||
|
|
115
|
-
((type = innerType.displayName || innerType.name || ""),
|
|
116
|
-
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
|
|
117
|
-
return type;
|
|
118
|
-
case REACT_MEMO_TYPE:
|
|
119
|
-
return (
|
|
120
|
-
(innerType = type.displayName || null),
|
|
121
|
-
null !== innerType
|
|
122
|
-
? innerType
|
|
123
|
-
: getComponentNameFromType(type.type) || "Memo"
|
|
124
|
-
);
|
|
125
|
-
case REACT_LAZY_TYPE:
|
|
126
|
-
innerType = type._payload;
|
|
127
|
-
type = type._init;
|
|
128
|
-
try {
|
|
129
|
-
return getComponentNameFromType(type(innerType));
|
|
130
|
-
} catch (x) {}
|
|
131
|
-
}
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
function testStringCoercion(value) {
|
|
135
|
-
return "" + value;
|
|
136
|
-
}
|
|
137
|
-
function checkKeyStringCoercion(value) {
|
|
138
|
-
try {
|
|
139
|
-
testStringCoercion(value);
|
|
140
|
-
var JSCompiler_inline_result = !1;
|
|
141
|
-
} catch (e) {
|
|
142
|
-
JSCompiler_inline_result = true;
|
|
143
|
-
}
|
|
144
|
-
if (JSCompiler_inline_result) {
|
|
145
|
-
JSCompiler_inline_result = console;
|
|
146
|
-
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
147
|
-
var JSCompiler_inline_result$jscomp$0 =
|
|
148
|
-
("function" === typeof Symbol &&
|
|
149
|
-
Symbol.toStringTag &&
|
|
150
|
-
value[Symbol.toStringTag]) ||
|
|
151
|
-
value.constructor.name ||
|
|
152
|
-
"Object";
|
|
153
|
-
JSCompiler_temp_const.call(
|
|
154
|
-
JSCompiler_inline_result,
|
|
155
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
156
|
-
JSCompiler_inline_result$jscomp$0
|
|
157
|
-
);
|
|
158
|
-
return testStringCoercion(value);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
function getTaskName(type) {
|
|
162
|
-
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
163
|
-
if (
|
|
164
|
-
"object" === typeof type &&
|
|
165
|
-
null !== type &&
|
|
166
|
-
type.$$typeof === REACT_LAZY_TYPE
|
|
167
|
-
)
|
|
168
|
-
return "<...>";
|
|
169
|
-
try {
|
|
170
|
-
var name = getComponentNameFromType(type);
|
|
171
|
-
return name ? "<" + name + ">" : "<...>";
|
|
172
|
-
} catch (x) {
|
|
173
|
-
return "<...>";
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
function getOwner() {
|
|
177
|
-
var dispatcher = ReactSharedInternals.A;
|
|
178
|
-
return null === dispatcher ? null : dispatcher.getOwner();
|
|
179
|
-
}
|
|
180
|
-
function UnknownOwner() {
|
|
181
|
-
return Error("react-stack-top-frame");
|
|
182
|
-
}
|
|
183
|
-
function hasValidKey(config) {
|
|
184
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
185
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
186
|
-
if (getter && getter.isReactWarning) return false;
|
|
187
|
-
}
|
|
188
|
-
return void 0 !== config.key;
|
|
189
|
-
}
|
|
190
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
191
|
-
function warnAboutAccessingKey() {
|
|
192
|
-
specialPropKeyWarningShown ||
|
|
193
|
-
((specialPropKeyWarningShown = true),
|
|
194
|
-
console.error(
|
|
195
|
-
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
196
|
-
displayName
|
|
197
|
-
));
|
|
198
|
-
}
|
|
199
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
200
|
-
Object.defineProperty(props, "key", {
|
|
201
|
-
get: warnAboutAccessingKey,
|
|
202
|
-
configurable: true
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
function elementRefGetterWithDeprecationWarning() {
|
|
206
|
-
var componentName = getComponentNameFromType(this.type);
|
|
207
|
-
didWarnAboutElementRef[componentName] ||
|
|
208
|
-
((didWarnAboutElementRef[componentName] = true),
|
|
209
|
-
console.error(
|
|
210
|
-
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
211
|
-
));
|
|
212
|
-
componentName = this.props.ref;
|
|
213
|
-
return void 0 !== componentName ? componentName : null;
|
|
214
|
-
}
|
|
215
|
-
function ReactElement(
|
|
216
|
-
type,
|
|
217
|
-
key,
|
|
218
|
-
self,
|
|
219
|
-
source,
|
|
220
|
-
owner,
|
|
221
|
-
props,
|
|
222
|
-
debugStack,
|
|
223
|
-
debugTask
|
|
224
|
-
) {
|
|
225
|
-
self = props.ref;
|
|
226
|
-
type = {
|
|
227
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
228
|
-
type: type,
|
|
229
|
-
key: key,
|
|
230
|
-
props: props,
|
|
231
|
-
_owner: owner
|
|
232
|
-
};
|
|
233
|
-
null !== (void 0 !== self ? self : null)
|
|
234
|
-
? Object.defineProperty(type, "ref", {
|
|
235
|
-
enumerable: false,
|
|
236
|
-
get: elementRefGetterWithDeprecationWarning
|
|
237
|
-
})
|
|
238
|
-
: Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
239
|
-
type._store = {};
|
|
240
|
-
Object.defineProperty(type._store, "validated", {
|
|
241
|
-
configurable: false,
|
|
242
|
-
enumerable: false,
|
|
243
|
-
writable: true,
|
|
244
|
-
value: 0
|
|
245
|
-
});
|
|
246
|
-
Object.defineProperty(type, "_debugInfo", {
|
|
247
|
-
configurable: false,
|
|
248
|
-
enumerable: false,
|
|
249
|
-
writable: true,
|
|
250
|
-
value: null
|
|
251
|
-
});
|
|
252
|
-
Object.defineProperty(type, "_debugStack", {
|
|
253
|
-
configurable: false,
|
|
254
|
-
enumerable: false,
|
|
255
|
-
writable: true,
|
|
256
|
-
value: debugStack
|
|
257
|
-
});
|
|
258
|
-
Object.defineProperty(type, "_debugTask", {
|
|
259
|
-
configurable: false,
|
|
260
|
-
enumerable: false,
|
|
261
|
-
writable: true,
|
|
262
|
-
value: debugTask
|
|
263
|
-
});
|
|
264
|
-
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
265
|
-
return type;
|
|
266
|
-
}
|
|
267
|
-
function jsxDEVImpl(
|
|
268
|
-
type,
|
|
269
|
-
config,
|
|
270
|
-
maybeKey,
|
|
271
|
-
isStaticChildren,
|
|
272
|
-
source,
|
|
273
|
-
self,
|
|
274
|
-
debugStack,
|
|
275
|
-
debugTask
|
|
276
|
-
) {
|
|
277
|
-
var children = config.children;
|
|
278
|
-
if (void 0 !== children)
|
|
279
|
-
if (isStaticChildren)
|
|
280
|
-
if (isArrayImpl(children)) {
|
|
281
|
-
for (
|
|
282
|
-
isStaticChildren = 0;
|
|
283
|
-
isStaticChildren < children.length;
|
|
284
|
-
isStaticChildren++
|
|
285
|
-
)
|
|
286
|
-
validateChildKeys(children[isStaticChildren]);
|
|
287
|
-
Object.freeze && Object.freeze(children);
|
|
288
|
-
} else
|
|
289
|
-
console.error(
|
|
290
|
-
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
291
|
-
);
|
|
292
|
-
else validateChildKeys(children);
|
|
293
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
294
|
-
children = getComponentNameFromType(type);
|
|
295
|
-
var keys = Object.keys(config).filter(function (k) {
|
|
296
|
-
return "key" !== k;
|
|
297
|
-
});
|
|
298
|
-
isStaticChildren =
|
|
299
|
-
0 < keys.length
|
|
300
|
-
? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
|
|
301
|
-
: "{key: someKey}";
|
|
302
|
-
didWarnAboutKeySpread[children + isStaticChildren] ||
|
|
303
|
-
((keys =
|
|
304
|
-
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
|
|
305
|
-
console.error(
|
|
306
|
-
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
307
|
-
isStaticChildren,
|
|
308
|
-
children,
|
|
309
|
-
keys,
|
|
310
|
-
children
|
|
311
|
-
),
|
|
312
|
-
(didWarnAboutKeySpread[children + isStaticChildren] = true));
|
|
313
|
-
}
|
|
314
|
-
children = null;
|
|
315
|
-
void 0 !== maybeKey &&
|
|
316
|
-
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
|
|
317
|
-
hasValidKey(config) &&
|
|
318
|
-
(checkKeyStringCoercion(config.key), (children = "" + config.key));
|
|
319
|
-
if ("key" in config) {
|
|
320
|
-
maybeKey = {};
|
|
321
|
-
for (var propName in config)
|
|
322
|
-
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
323
|
-
} else maybeKey = config;
|
|
324
|
-
children &&
|
|
325
|
-
defineKeyPropWarningGetter(
|
|
326
|
-
maybeKey,
|
|
327
|
-
"function" === typeof type
|
|
328
|
-
? type.displayName || type.name || "Unknown"
|
|
329
|
-
: type
|
|
330
|
-
);
|
|
331
|
-
return ReactElement(
|
|
332
|
-
type,
|
|
333
|
-
children,
|
|
334
|
-
self,
|
|
335
|
-
source,
|
|
336
|
-
getOwner(),
|
|
337
|
-
maybeKey,
|
|
338
|
-
debugStack,
|
|
339
|
-
debugTask
|
|
340
|
-
);
|
|
341
|
-
}
|
|
342
|
-
function validateChildKeys(node) {
|
|
343
|
-
"object" === typeof node &&
|
|
344
|
-
null !== node &&
|
|
345
|
-
node.$$typeof === REACT_ELEMENT_TYPE &&
|
|
346
|
-
node._store &&
|
|
347
|
-
(node._store.validated = 1);
|
|
348
|
-
}
|
|
349
|
-
var React = require$$0,
|
|
350
|
-
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
351
|
-
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|
352
|
-
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
353
|
-
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
|
354
|
-
REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
355
|
-
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
|
356
|
-
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|
357
|
-
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
358
|
-
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
359
|
-
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
360
|
-
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
361
|
-
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
362
|
-
REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
|
|
363
|
-
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
|
364
|
-
ReactSharedInternals =
|
|
365
|
-
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
366
|
-
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
367
|
-
isArrayImpl = Array.isArray,
|
|
368
|
-
createTask = console.createTask
|
|
369
|
-
? console.createTask
|
|
370
|
-
: function () {
|
|
371
|
-
return null;
|
|
372
|
-
};
|
|
373
|
-
React = {
|
|
374
|
-
"react-stack-bottom-frame": function (callStackForError) {
|
|
375
|
-
return callStackForError();
|
|
376
|
-
}
|
|
377
|
-
};
|
|
378
|
-
var specialPropKeyWarningShown;
|
|
379
|
-
var didWarnAboutElementRef = {};
|
|
380
|
-
var unknownOwnerDebugStack = React["react-stack-bottom-frame"].bind(
|
|
381
|
-
React,
|
|
382
|
-
UnknownOwner
|
|
383
|
-
)();
|
|
384
|
-
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
385
|
-
var didWarnAboutKeySpread = {};
|
|
386
|
-
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
387
|
-
reactJsxRuntime_development.jsx = function (type, config, maybeKey, source, self) {
|
|
388
|
-
var trackActualOwner =
|
|
389
|
-
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
390
|
-
return jsxDEVImpl(
|
|
391
|
-
type,
|
|
392
|
-
config,
|
|
393
|
-
maybeKey,
|
|
394
|
-
false,
|
|
395
|
-
source,
|
|
396
|
-
self,
|
|
397
|
-
trackActualOwner
|
|
398
|
-
? Error("react-stack-top-frame")
|
|
399
|
-
: unknownOwnerDebugStack,
|
|
400
|
-
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
401
|
-
);
|
|
402
|
-
};
|
|
403
|
-
reactJsxRuntime_development.jsxs = function (type, config, maybeKey, source, self) {
|
|
404
|
-
var trackActualOwner =
|
|
405
|
-
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
406
|
-
return jsxDEVImpl(
|
|
407
|
-
type,
|
|
408
|
-
config,
|
|
409
|
-
maybeKey,
|
|
410
|
-
true,
|
|
411
|
-
source,
|
|
412
|
-
self,
|
|
413
|
-
trackActualOwner
|
|
414
|
-
? Error("react-stack-top-frame")
|
|
415
|
-
: unknownOwnerDebugStack,
|
|
416
|
-
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
417
|
-
);
|
|
418
|
-
};
|
|
419
|
-
})();
|
|
420
|
-
return reactJsxRuntime_development;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
var hasRequiredJsxRuntime;
|
|
424
|
-
|
|
425
|
-
function requireJsxRuntime () {
|
|
426
|
-
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
427
|
-
hasRequiredJsxRuntime = 1;
|
|
428
|
-
|
|
429
|
-
if (process.env.NODE_ENV === 'production') {
|
|
430
|
-
jsxRuntime.exports = requireReactJsxRuntime_production();
|
|
431
|
-
} else {
|
|
432
|
-
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
433
|
-
}
|
|
434
|
-
return jsxRuntime.exports;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
var jsxRuntimeExports = requireJsxRuntime();
|
|
438
|
-
|
|
439
12
|
const clone = (obj) => {
|
|
440
13
|
try {
|
|
441
14
|
return structuredClone(obj);
|
|
@@ -484,25 +57,48 @@ function hexToRgb (hex) {
|
|
|
484
57
|
|
|
485
58
|
var styles$1 = {"maintenanceHero":"C5KSPNF","httpStatusCode":"NhyRQts","centeredContainer":"nA4Uno6","errorTextGeneral":"yJAgaUs","errorKeys":"SRIoY4m","errorValues":"xQIsoNw","errorPre":"C6eWpJ3"};
|
|
486
59
|
|
|
60
|
+
function OutsideClickHandler({ onOutsideClick, children, disabled, useCapture }) {
|
|
61
|
+
const containerRef = useRef(null);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (disabled) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
function handle(event) {
|
|
67
|
+
const element = containerRef.current;
|
|
68
|
+
if (!element || element.contains(event.target)) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
onOutsideClick();
|
|
72
|
+
}
|
|
73
|
+
document.addEventListener('mousedown', handle, useCapture);
|
|
74
|
+
document.addEventListener('touchstart', handle, useCapture);
|
|
75
|
+
return () => {
|
|
76
|
+
document.removeEventListener('mousedown', handle, useCapture);
|
|
77
|
+
document.removeEventListener('touchstart', handle, useCapture);
|
|
78
|
+
};
|
|
79
|
+
}, [onOutsideClick, disabled, useCapture]);
|
|
80
|
+
return jsx("div", { ref: containerRef, children: children });
|
|
81
|
+
}
|
|
82
|
+
|
|
487
83
|
var BackendThrowable = (props) => {
|
|
488
84
|
const { instance } = props;
|
|
489
85
|
const currentThrowable = instance.state.backendThrowable[0];
|
|
490
86
|
console.log([instance.state.backendThrowable, currentThrowable]);
|
|
491
|
-
return
|
|
87
|
+
return jsxs("div", { className: styles$1.maintenanceHero, children: [jsx("h1", { className: styles$1.httpStatusCode, children: currentThrowable?.status || 500 }), jsx(OutsideClickHandler, { onOutsideClick: () => instance.setState(currentState => ({ backendThrowable: currentState.backendThrowable.slice(1) })), children: jsx("div", { className: styles$1.centeredContainer, children: Object.keys(currentThrowable).map((key, index) => {
|
|
492
88
|
const valueIsString = typeof currentThrowable[key] === 'string';
|
|
493
89
|
const valueIsCode = 'THROWN NEAR' === key;
|
|
494
|
-
return
|
|
495
|
-
? (valueIsCode ?
|
|
496
|
-
|
|
90
|
+
return jsxs("div", { children: [jsxs("div", { className: styles$1.errorTextGeneral, children: [" > ", jsx("span", { className: styles$1.errorKeys, children: key }), ":", valueIsString
|
|
91
|
+
? (valueIsCode ? jsx("div", { style: { backgroundColor: 'black', fontSize: 'xx-small' }, dangerouslySetInnerHTML: { __html: currentThrowable[key] } }) :
|
|
92
|
+
jsxs("i", { className: styles$1.errorValues, children: ["\"", currentThrowable[key], "\""] }))
|
|
497
93
|
: ''] }), valueIsString
|
|
498
94
|
? ''
|
|
499
|
-
:
|
|
95
|
+
: jsx("pre", { className: styles$1.errorPre, children: JSON.stringify(currentThrowable[key], undefined, 4) })] }, index);
|
|
500
96
|
}) }) })] });
|
|
501
97
|
};
|
|
502
98
|
|
|
503
99
|
const range = n => new Array(n).fill(0).map((_, idx) => idx);
|
|
504
100
|
// @link https://sites.google.com/site/webglbook/home/chapter-3
|
|
505
|
-
class Nest extends
|
|
101
|
+
class Nest extends React.Component {
|
|
506
102
|
static defaultProps = {
|
|
507
103
|
backgroundColor: "white",
|
|
508
104
|
display: "block",
|
|
@@ -618,7 +214,7 @@ class Nest extends require$$0.Component {
|
|
|
618
214
|
cancelAnimationFrame(this.tid);
|
|
619
215
|
}
|
|
620
216
|
render() {
|
|
621
|
-
return (
|
|
217
|
+
return (jsxs("div", { children: [this.props.children, jsx("canvas", { id: "2d", width: window.innerWidth, height: window.innerHeight, style: {
|
|
622
218
|
backgroundColor: this.props.backgroundColor,
|
|
623
219
|
display: this.props.display,
|
|
624
220
|
position: this.props.position,
|
|
@@ -2991,7 +2587,7 @@ function getStyles(overrides = {}) {
|
|
|
2991
2587
|
// @link https://stackoverflow.com/questions/58399637/include-modal-functionality-in-react-higher-order-component
|
|
2992
2588
|
function Popup({ open = true, handleClose, children, maxWidth, }) {
|
|
2993
2589
|
const dig = getStyles();
|
|
2994
|
-
return
|
|
2590
|
+
return jsx("div", { className: classNames(dig.modal, dig.fade, { [dig.show]: open }, dig.dBlock), style: { backgroundColor: "rgba(0,0,0,0.8)" }, id: "exampleModalCenter", tabIndex: -1, "aria-labelledby": "exampleModalCenterTitle", "aria-modal": "true", role: "dialog", children: jsx("div", { style: { maxWidth: maxWidth }, className: classNames(dig.modalDialog, dig.modalDialogCentered), children: jsx(OutsideClickHandler, { onOutsideClick: () => handleClose(), children: jsx("div", { className: classNames(dig.modalContent, dig.bgTransparent, dig.modalDialogScrollable), children: children }) }) }) });
|
|
2995
2591
|
}
|
|
2996
2592
|
|
|
2997
2593
|
const isProduction = window.location.host.split(".")[0] === "www";
|
|
@@ -3081,20 +2677,20 @@ function Alert({ instance }) {
|
|
|
3081
2677
|
handleClose();
|
|
3082
2678
|
}, timeout);
|
|
3083
2679
|
}
|
|
3084
|
-
return
|
|
2680
|
+
return jsx(Popup, { handleClose: handleClose, children: jsxs("div", { className: classNames("model-content", styles.rounded0, styles.border0), style: {
|
|
3085
2681
|
maxWidth: '75vw',
|
|
3086
2682
|
maxHeight: '75vh',
|
|
3087
|
-
}, children: [
|
|
2683
|
+
}, children: [jsxs("div", { className: classNames(styles.modalHeader, styles.rounded0, styles.border0, {
|
|
3088
2684
|
// icon?: "warning" | "error" | "success" | "info" | "question"
|
|
3089
2685
|
[styles.bg_primary]: "info" === alert.icon || alert.icon === undefined || alert.icon === null,
|
|
3090
2686
|
[styles.bg_success]: "success" === alert.icon,
|
|
3091
2687
|
[styles.bg_warning]: "warning" === alert.icon,
|
|
3092
2688
|
[styles.bg_danger]: "error" === alert.icon, // TODO - change to red
|
|
3093
2689
|
[styles.bgPrimary]: "question" === alert.icon,
|
|
3094
|
-
}), children: [
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
return
|
|
2690
|
+
}), children: [jsxs("h3", { className: classNames(styles.modalTitle, styles.textDark), id: "staticBackdropLabel", children: ["#", alertWaiting, " ", alert.title] }), jsx("div", { onClick: handleClose, children: jsx(FontAwesomeIcon, { icon: faClose, size: 'xl' }) })] }), jsx("div", { className: classNames(styles.modalBody, styles.border0, styles.textWhite), children: jsxs("div", { className: styles.textCenter, children: [alert.text, alert.component] }) }), undefined !== alert.buttons &&
|
|
2691
|
+
jsxs("div", { className: classNames(styles.modalFooter, styles.border0, styles.rounded0), children: [alert.footerText &&
|
|
2692
|
+
jsx("div", { className: classNames(styles.textCenter, styles.textWhite), children: alert.footerText }), alert.buttons?.map((button, index) => {
|
|
2693
|
+
return jsx("button", { className: classNames(styles.btn, styles.btnLg, {
|
|
3098
2694
|
// todo - color: "default" | "primary" | "secondary" | "inherit" | "danger" | "info" | "success" | "warning" | undefined,
|
|
3099
2695
|
[styles.bg_success]: "success" === button.color,
|
|
3100
2696
|
[styles.bg_danger]: "danger" === button.color,
|
|
@@ -3110,7 +2706,7 @@ function Alert({ instance }) {
|
|
|
3110
2706
|
// @link https://dev.to/ag-grid/react-18-avoiding-use-effect-getting-called-twice-4i9e
|
|
3111
2707
|
const useEffectOnce = (effect) => {
|
|
3112
2708
|
const effectFn = useRef(effect);
|
|
3113
|
-
const destroyFn = useRef();
|
|
2709
|
+
const destroyFn = useRef(undefined);
|
|
3114
2710
|
const effectCalled = useRef(false);
|
|
3115
2711
|
const rendered = useRef(false);
|
|
3116
2712
|
const [, setVal] = useState(0);
|
|
@@ -3140,7 +2736,8 @@ const useEffectOnce = (effect) => {
|
|
|
3140
2736
|
**/
|
|
3141
2737
|
function initiateWebsocket(props) {
|
|
3142
2738
|
let { instance, url = 'ws' + (window.location.protocol === 'https:' ? 's' : '') + '://' + window.location.host + '/carbonorm/websocket', timeoutSeconds = 250, heartbeatSeconds = 60, C6 } = props;
|
|
3143
|
-
const { TABLES = undefined,
|
|
2739
|
+
const { TABLES = undefined, } = C6 ?? {};
|
|
2740
|
+
const verbose = isVerbose();
|
|
3144
2741
|
const { websocket } = instance.state;
|
|
3145
2742
|
if (!("WebSocket" in window)) {
|
|
3146
2743
|
// todo - store that this has been shown in the state
|
|
@@ -3184,70 +2781,96 @@ function initiateWebsocket(props) {
|
|
|
3184
2781
|
websocketData: prevState.websocketData.concat(parsedData), // JSON.parse no good - base64?
|
|
3185
2782
|
}), () => {
|
|
3186
2783
|
if (undefined === TABLES) {
|
|
3187
|
-
|
|
2784
|
+
if (verbose) {
|
|
2785
|
+
console.log('WebSocket updates without the TABLES property passed will not automatically update the state.');
|
|
2786
|
+
}
|
|
3188
2787
|
return;
|
|
3189
2788
|
}
|
|
3190
2789
|
if (parsedData?.REST) {
|
|
3191
2790
|
const TABLE_NAME = parsedData?.REST?.TABLE_NAME;
|
|
3192
|
-
const TABLE_PREFIX = parsedData?.REST?.TABLE_PREFIX;
|
|
2791
|
+
const TABLE_PREFIX = parsedData?.REST?.TABLE_PREFIX ?? '';
|
|
3193
2792
|
const METHOD = parsedData?.REST?.METHOD;
|
|
3194
2793
|
const REQUEST = parsedData?.REST?.REQUEST;
|
|
3195
2794
|
const REQUEST_PRIMARY_KEY = parsedData?.REST?.REQUEST_PRIMARY_KEY ?? null;
|
|
3196
2795
|
if (null === REQUEST_PRIMARY_KEY) {
|
|
3197
|
-
|
|
2796
|
+
if (verbose) {
|
|
2797
|
+
console.log('WebSocket updates without a primary key are not yet supported.');
|
|
2798
|
+
}
|
|
3198
2799
|
return;
|
|
3199
2800
|
}
|
|
3200
|
-
|
|
3201
|
-
|
|
2801
|
+
if (verbose) {
|
|
2802
|
+
console.log('todo - going to impl REST', TABLE_NAME, METHOD, REQUEST_PRIMARY_KEY, parsedData?.REST);
|
|
2803
|
+
}
|
|
2804
|
+
const TABLE_NAME_SHORT = TABLE_NAME.startsWith(TABLE_PREFIX)
|
|
2805
|
+
? TABLE_NAME.substring(TABLE_PREFIX.length)
|
|
2806
|
+
: TABLE_NAME;
|
|
3202
2807
|
const currentCache = instance.state[TABLE_NAME_SHORT];
|
|
3203
2808
|
// just because we have a websocket update, doesn't mean we need the update
|
|
3204
2809
|
// check to see if the primary key is in the current cache
|
|
3205
2810
|
const c6Table = TABLES[TABLE_NAME_SHORT] ?? null;
|
|
3206
2811
|
if (null === c6Table) {
|
|
3207
|
-
|
|
2812
|
+
if (verbose) {
|
|
2813
|
+
console.error('WebSocket update could not find (' + TABLE_NAME_SHORT + ') in the TABLES property passed.', TABLES);
|
|
2814
|
+
}
|
|
3208
2815
|
return;
|
|
3209
2816
|
}
|
|
3210
|
-
const
|
|
3211
|
-
|
|
3212
|
-
const
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
const
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
return false;
|
|
2817
|
+
const columns = c6Table.COLUMNS;
|
|
2818
|
+
const validColumns = new Set(Object.values(columns));
|
|
2819
|
+
const normalizeRecord = (record) => {
|
|
2820
|
+
const normalized = {};
|
|
2821
|
+
for (const [key, value] of Object.entries(record ?? {})) {
|
|
2822
|
+
const shortKey = columns[key] ?? (key.includes('.') ? key.split('.').pop() : key);
|
|
2823
|
+
if (validColumns.has(shortKey)) {
|
|
2824
|
+
normalized[shortKey] = value;
|
|
3219
2825
|
}
|
|
3220
2826
|
}
|
|
3221
|
-
return
|
|
3222
|
-
}
|
|
3223
|
-
|
|
2827
|
+
return normalized;
|
|
2828
|
+
};
|
|
2829
|
+
const normalizedPrimaryKey = normalizeRecord(REQUEST_PRIMARY_KEY);
|
|
2830
|
+
const primaryKeyKeys = Object.keys(normalizedPrimaryKey);
|
|
2831
|
+
if (primaryKeyKeys.length === 0) {
|
|
2832
|
+
if (verbose) {
|
|
2833
|
+
console.error('WebSocket update could not map primary keys for', TABLE_NAME_SHORT, REQUEST_PRIMARY_KEY);
|
|
2834
|
+
}
|
|
2835
|
+
return;
|
|
2836
|
+
}
|
|
2837
|
+
// todo - which direction should we filter
|
|
2838
|
+
const elementsToUpdate = currentCache?.filter((row) => primaryKeyKeys.every((key) => normalizedPrimaryKey[key] === row[key])) ?? [];
|
|
2839
|
+
if (verbose) {
|
|
2840
|
+
console.log('elementsToUpdate', elementsToUpdate);
|
|
2841
|
+
}
|
|
3224
2842
|
if (elementsToUpdate.length === 0) {
|
|
3225
|
-
|
|
2843
|
+
if (verbose) {
|
|
2844
|
+
console.error('Could not find any elements to update in the cache.', elementsToUpdate, primaryKeyKeys, REQUEST_PRIMARY_KEY, currentCache);
|
|
2845
|
+
}
|
|
3226
2846
|
return;
|
|
3227
2847
|
}
|
|
3228
|
-
const
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
2848
|
+
const normalizedRequest = normalizeRecord(REQUEST);
|
|
2849
|
+
const updatedElements = elementsToUpdate.map((row) => ({
|
|
2850
|
+
...row,
|
|
2851
|
+
...normalizedRequest,
|
|
2852
|
+
}));
|
|
2853
|
+
switch (METHOD) {
|
|
2854
|
+
case 'POST':
|
|
2855
|
+
case 'PUT':
|
|
2856
|
+
instance.updateRestfulObjectArrays({
|
|
2857
|
+
dataOrCallback: updatedElements,
|
|
2858
|
+
stateKey: TABLE_NAME_SHORT,
|
|
2859
|
+
uniqueObjectId: c6Table.PRIMARY_SHORT,
|
|
2860
|
+
});
|
|
2861
|
+
break;
|
|
2862
|
+
case 'DELETE':
|
|
2863
|
+
instance.deleteRestfulObjectArrays({
|
|
2864
|
+
dataOrCallback: elementsToUpdate,
|
|
2865
|
+
stateKey: TABLE_NAME_SHORT,
|
|
2866
|
+
uniqueObjectId: c6Table.PRIMARY_SHORT,
|
|
2867
|
+
});
|
|
2868
|
+
break;
|
|
2869
|
+
default:
|
|
2870
|
+
if (verbose) {
|
|
3248
2871
|
console.error('Method not supported', METHOD);
|
|
3249
|
-
|
|
3250
|
-
}
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
3251
2874
|
}
|
|
3252
2875
|
});
|
|
3253
2876
|
};
|
|
@@ -3527,11 +3150,11 @@ class CarbonReact extends Component {
|
|
|
3527
3150
|
reactRouterContext(children) {
|
|
3528
3151
|
switch (this.props.routerType ?? eRouterType.BrowserRouter) {
|
|
3529
3152
|
case eRouterType.BrowserRouter:
|
|
3530
|
-
return
|
|
3153
|
+
return jsx(BrowserRouter, { children: children });
|
|
3531
3154
|
case eRouterType.MemoryRouter:
|
|
3532
|
-
return
|
|
3155
|
+
return jsx(MemoryRouter, { initialEntries: ['/'], children: children });
|
|
3533
3156
|
case eRouterType.HashRouter:
|
|
3534
|
-
return
|
|
3157
|
+
return jsx(HashRouter, { children: children });
|
|
3535
3158
|
default:
|
|
3536
3159
|
throw new Error('Invalid routerType');
|
|
3537
3160
|
}
|
|
@@ -3540,14 +3163,14 @@ class CarbonReact extends Component {
|
|
|
3540
3163
|
console.log('CarbonORM TSX RENDER');
|
|
3541
3164
|
const colorHex = '#' + Math.random().toString(16).slice(-6);
|
|
3542
3165
|
console.log('%c color (' + colorHex + ')', 'color: ' + colorHex);
|
|
3543
|
-
const nest =
|
|
3166
|
+
const nest = jsx(Nest, { position: 'fixed', backgroundColor: '', color: hexToRgb(colorHex), count: 100 });
|
|
3544
3167
|
if (this.state.backendThrowable.length > 0) {
|
|
3545
|
-
return
|
|
3168
|
+
return jsxs(Fragment, { children: [nest, jsx(BackendThrowable, { instance: this })] });
|
|
3546
3169
|
}
|
|
3547
3170
|
this.context = createContext(this.state);
|
|
3548
3171
|
const Context = this.context.Provider;
|
|
3549
|
-
return this.reactRouterContext(
|
|
3550
|
-
|
|
3172
|
+
return this.reactRouterContext(jsxs(Fragment, { children: [jsx(GlobalHistory, {}), this.props.websocket &&
|
|
3173
|
+
jsx(CarbonWebSocket, { ...(false !== this.props.websocket ? this.props.websocket : {}), instance: this }), jsx(Context, { value: this.state, children: this.props.children }), jsx(ToastContainer, {})] }));
|
|
3551
3174
|
}
|
|
3552
3175
|
}
|
|
3553
3176
|
|
|
@@ -3569,7 +3192,7 @@ function watchInputElementChangeEvent(event, cb, timeoutMs = 3000) {
|
|
|
3569
3192
|
var styles = {"notfound":"_4yBvJ55","notfound_404":"WQ39uQo"};
|
|
3570
3193
|
|
|
3571
3194
|
function AccessDenied({ children }) {
|
|
3572
|
-
return (
|
|
3195
|
+
return (jsx("div", { children: jsx("div", { className: styles.notfound, children: jsxs("div", { className: styles.notfound_404, children: [jsx("h3", { children: "Oops! Access not granted" }), children, jsxs("h1", { style: {
|
|
3573
3196
|
position: "absolute",
|
|
3574
3197
|
left: "50%",
|
|
3575
3198
|
top: "50%",
|
|
@@ -3580,21 +3203,21 @@ function AccessDenied({ children }) {
|
|
|
3580
3203
|
letterSpacing: "-40px",
|
|
3581
3204
|
marginLeft: "-20px",
|
|
3582
3205
|
marginTop: "20px"
|
|
3583
|
-
}, children: [
|
|
3206
|
+
}, children: [jsx("span", { children: "4" }), jsx("span", { children: "0" }), jsx("span", { children: "3" })] })] }) }) }));
|
|
3584
3207
|
}
|
|
3585
3208
|
|
|
3586
3209
|
function ErrorHttpCode({ code, title = 'Hey Gamer, we\'ve encountered an unexpected issue!', message = 'Our team has been alerted and is actively investigating the issue. Please continue playing or ask support for any questions.' }) {
|
|
3587
|
-
return
|
|
3210
|
+
return jsx("main", { role: "main", children: jsx("div", { className: classes.maintenance, children: jsx("div", { className: classes.problemBox, children: jsxs("div", { className: classes.notfound, children: [jsxs("div", { className: classes.notfound_404, children: [jsx("h3", { children: title }), jsx("h1", { children: code })] }), jsx("h2", { children: message })] }) }) }) });
|
|
3588
3211
|
}
|
|
3589
3212
|
|
|
3590
3213
|
function PageNotFound() {
|
|
3591
|
-
return
|
|
3214
|
+
return jsx("div", { children: jsxs("div", { className: classes.notfound, children: [jsxs("div", { className: classes.notfound_404, children: [jsx("h3", { children: "Oops! Page not found" }), jsxs("h1", { children: [jsx("span", { children: "4" }), jsx("span", { children: "0" }), jsx("span", { children: "4" })] })] }), jsx("h2", { children: "we are sorry, but the page you requested was not found" })] }) });
|
|
3592
3215
|
}
|
|
3593
3216
|
|
|
3594
3217
|
function Loading(props) {
|
|
3595
3218
|
const dig = getStyles();
|
|
3596
3219
|
const primaryColor = getRootStyleValue();
|
|
3597
|
-
return
|
|
3220
|
+
return jsx("div", { className: classNames(dig.my5, dig.px3, dig.pb5, dig.container), style: { lineHeight: props.lineHeight || 4 }, children: jsxs(SkeletonTheme, { baseColor: primaryColor, highlightColor: "#444", children: [jsx(Skeleton, { className: classNames(dig.row, dig.my3, dig.justifyContentCenter, dig.mAuto), count: props.count || 1, height: 60, inline: true }), props.children, undefined !== props?.message && jsx("h2", { style: {
|
|
3598
3221
|
display: 'flex',
|
|
3599
3222
|
alignItems: 'center',
|
|
3600
3223
|
justifyContent: 'center',
|
|
@@ -3703,8 +3326,9 @@ function ValidSQL (sql) {
|
|
|
3703
3326
|
function setupTests ({ sqlDirectory = './logs/rest/', logsDirectory = './logs/tests/' } = {}) {
|
|
3704
3327
|
const fs = require("fs");
|
|
3705
3328
|
const { inspect } = require("util");
|
|
3706
|
-
const originalWindowLocation = window.location;
|
|
3329
|
+
const originalWindowLocation = window.location.href;
|
|
3707
3330
|
const consoleOriginal = console;
|
|
3331
|
+
const isVerboseEnabled = isVerbose();
|
|
3708
3332
|
const testName = () => expect.getState().currentTestName?.replaceAll(" ", "_").toLowerCase();
|
|
3709
3333
|
const validSqlFile = () => sqlDirectory + testName() + '.json';
|
|
3710
3334
|
const logsFile = () => logsDirectory + testName() + '.log';
|
|
@@ -3720,19 +3344,19 @@ function setupTests ({ sqlDirectory = './logs/rest/', logsDirectory = './logs/te
|
|
|
3720
3344
|
global.console = {
|
|
3721
3345
|
...console,
|
|
3722
3346
|
// use jest.fn() to silence, comment out to leave as it is
|
|
3723
|
-
debug: (...args) => (
|
|
3724
|
-
error: (...args) => (
|
|
3725
|
-
group: (...args) => (
|
|
3726
|
-
groupCollapsed: (...args) => (
|
|
3727
|
-
groupEnd: () => (
|
|
3728
|
-
info: (...args) => (
|
|
3729
|
-
log: (...args) => (
|
|
3730
|
-
table: (...args) => (
|
|
3731
|
-
trace: (...args) => (
|
|
3347
|
+
debug: (...args) => (isVerboseEnabled && consoleOriginal.debug(...args), asyncFileLogging('debug', ...args)),
|
|
3348
|
+
error: (...args) => (isVerboseEnabled && consoleOriginal.error(...args), asyncFileLogging('error', ...args)),
|
|
3349
|
+
group: (...args) => (isVerboseEnabled && consoleOriginal.group(...args), asyncFileLogging('group', ...args)),
|
|
3350
|
+
groupCollapsed: (...args) => (isVerboseEnabled && consoleOriginal.groupCollapsed(...args), asyncFileLogging('groupCollapsed', ...args)),
|
|
3351
|
+
groupEnd: () => (isVerboseEnabled && consoleOriginal.groupEnd(), asyncFileLogging('groupEnd')),
|
|
3352
|
+
info: (...args) => (isVerboseEnabled && consoleOriginal.info(...args), asyncFileLogging('info', ...args)),
|
|
3353
|
+
log: (...args) => (isVerboseEnabled && consoleOriginal.log(...args), asyncFileLogging('log', ...args)),
|
|
3354
|
+
table: (...args) => (isVerboseEnabled && consoleOriginal.table(...args), asyncFileLogging('table', ...args)),
|
|
3355
|
+
trace: (...args) => (isVerboseEnabled && consoleOriginal.trace(...args), asyncFileLogging((() => {
|
|
3732
3356
|
const err = new Error();
|
|
3733
3357
|
return err.stack;
|
|
3734
3358
|
})())),
|
|
3735
|
-
warn: (...args) => (
|
|
3359
|
+
warn: (...args) => (isVerboseEnabled && consoleOriginal.warn(...args), asyncFileLogging('warn', ...args)),
|
|
3736
3360
|
};
|
|
3737
3361
|
afterEach(async () => {
|
|
3738
3362
|
await waitFor(async () => {
|
|
@@ -3742,7 +3366,7 @@ function setupTests ({ sqlDirectory = './logs/rest/', logsDirectory = './logs/te
|
|
|
3742
3366
|
console.log('After each Test (' + expect.getState().currentTestName + ')', validSQL, expect.getState());
|
|
3743
3367
|
// restore `window.location` to the original `jsdom`
|
|
3744
3368
|
// `Location` object
|
|
3745
|
-
window.location = originalWindowLocation;
|
|
3369
|
+
window.location.href = originalWindowLocation;
|
|
3746
3370
|
fs.writeFileSync(validSqlFile(), jsonSQL);
|
|
3747
3371
|
}, 65000);
|
|
3748
3372
|
}
|
|
@@ -3845,5 +3469,5 @@ function useWindowDimensions() {
|
|
|
3845
3469
|
return windowDimensions;
|
|
3846
3470
|
}
|
|
3847
3471
|
|
|
3848
|
-
export { AccessDenied, Alert, BackendThrowable, C6, COLUMNS, CarbonReact, CarbonWebSocket, ErrorHttpCode, GlobalHistory, Loading, Nest, PageNotFound, Popup, TABLES, addAlert, addValidSQL$1 as addValidSQL, carbons, changed, comments, deleteRestfulObjectArrays, documentation, eRouterType, eUpdateInsertMethod, feature_group_references, features, getRootStyleValue, getStatefulObjectWithWhere, getStyles, globalNavigate, group_references, groups, hexToRgb, history_logs, initialCarbonReactState, initialRequiredCarbonORMState, initialRestfulObjectsState, initiateWebsocket, isEdgeBrowser, isJsonString, isProduction, location_references, locations, parseMultipleJson, photos, range, reports, ScrollIntoViewDirective as scrollIntoView, setCookies, setUrl, setupTests, toDataURL, updateRestfulObjectArrays, uploadImage, uploadImageChange, useEffectOnce, user_followers, user_groups, user_messages, user_sessions, user_tasks, users, ValidSQL as validSQL, watchInputElementChangeEvent, useWindowDimensions as windowDimensions, wp_commentmeta, wp_comments, wp_links, wp_options, wp_postmeta, wp_posts, wp_term_relationships, wp_term_taxonomy, wp_termmeta, wp_terms, wp_usermeta, wp_users };
|
|
3472
|
+
export { AccessDenied, Alert, BackendThrowable, C6, COLUMNS, CarbonReact, CarbonWebSocket, ErrorHttpCode, GlobalHistory, Loading, Nest, OutsideClickHandler, PageNotFound, Popup, TABLES, addAlert, addValidSQL$1 as addValidSQL, carbons, changed, comments, deleteRestfulObjectArrays, documentation, eRouterType, eUpdateInsertMethod, feature_group_references, features, getRootStyleValue, getStatefulObjectWithWhere, getStyles, globalNavigate, group_references, groups, hexToRgb, history_logs, initialCarbonReactState, initialRequiredCarbonORMState, initialRestfulObjectsState, initiateWebsocket, isEdgeBrowser, isJsonString, isProduction, location_references, locations, parseMultipleJson, photos, range, reports, ScrollIntoViewDirective as scrollIntoView, setCookies, setUrl, setupTests, toDataURL, updateRestfulObjectArrays, uploadImage, uploadImageChange, useEffectOnce, user_followers, user_groups, user_messages, user_sessions, user_tasks, users, ValidSQL as validSQL, watchInputElementChangeEvent, useWindowDimensions as windowDimensions, wp_commentmeta, wp_comments, wp_links, wp_options, wp_postmeta, wp_posts, wp_term_relationships, wp_term_taxonomy, wp_termmeta, wp_terms, wp_usermeta, wp_users };
|
|
3849
3473
|
//# sourceMappingURL=index.esm.js.map
|