@compill/admin 1.0.39 → 1.0.41
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/index.cjs.js +152 -1214
- package/index.esm.js +133 -1195
- package/package.json +1 -1
package/index.cjs.js
CHANGED
@@ -7,8 +7,7 @@ var ui = require('@valerya/ui');
|
|
7
7
|
var Link = require('next/link');
|
8
8
|
var React = require('react');
|
9
9
|
var adminApi = require('@compill/admin-api');
|
10
|
-
require('
|
11
|
-
var reactQuery = require('@tanstack/react-query');
|
10
|
+
var api = require('@compill/api');
|
12
11
|
var reactRouterDom = require('react-router-dom');
|
13
12
|
var reactToastify = require('react-toastify');
|
14
13
|
var form = require('@compill/form');
|
@@ -16,11 +15,12 @@ var formik = require('formik');
|
|
16
15
|
require('react/jsx-runtime');
|
17
16
|
var components = require('@compill/components');
|
18
17
|
var react = require('@soperio/react');
|
19
|
-
var
|
18
|
+
var editor = require('@compill/editor');
|
20
19
|
var admin = require('@compill/admin');
|
21
20
|
var reactDom = require('react-dom');
|
22
21
|
var table = require('@compill/table');
|
23
22
|
var hooks = require('@compill/hooks');
|
23
|
+
var reactQuery = require('@tanstack/react-query');
|
24
24
|
|
25
25
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
26
26
|
|
@@ -42,7 +42,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
42
42
|
PERFORMANCE OF THIS SOFTWARE.
|
43
43
|
***************************************************************************** */
|
44
44
|
|
45
|
-
function __rest(s, e) {
|
45
|
+
function __rest$1(s, e) {
|
46
46
|
var t = {};
|
47
47
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
48
48
|
t[p] = s[p];
|
@@ -73,7 +73,7 @@ function SectionTitle(_a) {
|
|
73
73
|
var {
|
74
74
|
children
|
75
75
|
} = _a,
|
76
|
-
props = __rest(_a, ["children"]);
|
76
|
+
props = __rest$1(_a, ["children"]);
|
77
77
|
return jsxRuntime.jsx("h2", Object.assign({
|
78
78
|
textSize: "xl",
|
79
79
|
fontWeight: "600",
|
@@ -105,7 +105,7 @@ function Breadcrumbs(_a) {
|
|
105
105
|
var {
|
106
106
|
breadcrumbs
|
107
107
|
} = _a,
|
108
|
-
props = __rest(_a, ["breadcrumbs"]);
|
108
|
+
props = __rest$1(_a, ["breadcrumbs"]);
|
109
109
|
return jsxRuntime.jsx("div", Object.assign({
|
110
110
|
dflex: true,
|
111
111
|
alignItems: "center",
|
@@ -143,7 +143,7 @@ function DialogButton(_a) {
|
|
143
143
|
var {
|
144
144
|
buildDialog
|
145
145
|
} = _a,
|
146
|
-
props = __rest(_a, ["buildDialog"]);
|
146
|
+
props = __rest$1(_a, ["buildDialog"]);
|
147
147
|
const [showDialog, setShowDialog] = React__default["default"].useState(false);
|
148
148
|
const onShowDialog = React__default["default"].useCallback(event => {
|
149
149
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
@@ -160,1133 +160,14 @@ function DialogButton(_a) {
|
|
160
160
|
});
|
161
161
|
}
|
162
162
|
|
163
|
-
/*! js-cookie v3.0.5 | MIT */ /* eslint-disable no-var */ function assign(target) {
|
164
|
-
for(var i = 1; i < arguments.length; i++){
|
165
|
-
var source = arguments[i];
|
166
|
-
for(var key in source){
|
167
|
-
target[key] = source[key];
|
168
|
-
}
|
169
|
-
}
|
170
|
-
return target;
|
171
|
-
}
|
172
|
-
/* eslint-enable no-var */ /* eslint-disable no-var */ var defaultConverter = {
|
173
|
-
read: function read(value) {
|
174
|
-
if (value[0] === '"') {
|
175
|
-
value = value.slice(1, -1);
|
176
|
-
}
|
177
|
-
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
178
|
-
},
|
179
|
-
write: function write(value) {
|
180
|
-
return encodeURIComponent(value).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);
|
181
|
-
}
|
182
|
-
};
|
183
|
-
/* eslint-enable no-var */ /* eslint-disable no-var */ function init(converter, defaultAttributes) {
|
184
|
-
function set(name, value, attributes) {
|
185
|
-
if (typeof document === "undefined") {
|
186
|
-
return;
|
187
|
-
}
|
188
|
-
attributes = assign({}, defaultAttributes, attributes);
|
189
|
-
if (typeof attributes.expires === "number") {
|
190
|
-
attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
|
191
|
-
}
|
192
|
-
if (attributes.expires) {
|
193
|
-
attributes.expires = attributes.expires.toUTCString();
|
194
|
-
}
|
195
|
-
name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
196
|
-
var stringifiedAttributes = "";
|
197
|
-
for(var attributeName in attributes){
|
198
|
-
if (!attributes[attributeName]) {
|
199
|
-
continue;
|
200
|
-
}
|
201
|
-
stringifiedAttributes += "; " + attributeName;
|
202
|
-
if (attributes[attributeName] === true) {
|
203
|
-
continue;
|
204
|
-
}
|
205
|
-
// Considers RFC 6265 section 5.2:
|
206
|
-
// ...
|
207
|
-
// 3. If the remaining unparsed-attributes contains a %x3B (";")
|
208
|
-
// character:
|
209
|
-
// Consume the characters of the unparsed-attributes up to,
|
210
|
-
// not including, the first %x3B (";") character.
|
211
|
-
// ...
|
212
|
-
stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
|
213
|
-
}
|
214
|
-
return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes;
|
215
|
-
}
|
216
|
-
function get(name) {
|
217
|
-
if (typeof document === "undefined" || arguments.length && !name) {
|
218
|
-
return;
|
219
|
-
}
|
220
|
-
// To prevent the for loop in the first place assign an empty array
|
221
|
-
// in case there are no cookies at all.
|
222
|
-
var cookies = document.cookie ? document.cookie.split("; ") : [];
|
223
|
-
var jar = {};
|
224
|
-
for(var i = 0; i < cookies.length; i++){
|
225
|
-
var parts = cookies[i].split("=");
|
226
|
-
var value = parts.slice(1).join("=");
|
227
|
-
try {
|
228
|
-
var found = decodeURIComponent(parts[0]);
|
229
|
-
jar[found] = converter.read(value, found);
|
230
|
-
if (name === found) {
|
231
|
-
break;
|
232
|
-
}
|
233
|
-
} catch (e) {}
|
234
|
-
}
|
235
|
-
return name ? jar[name] : jar;
|
236
|
-
}
|
237
|
-
return Object.create({
|
238
|
-
set: set,
|
239
|
-
get: get,
|
240
|
-
remove: function remove(name, attributes) {
|
241
|
-
set(name, "", assign({}, attributes, {
|
242
|
-
expires: -1
|
243
|
-
}));
|
244
|
-
},
|
245
|
-
withAttributes: function withAttributes(attributes) {
|
246
|
-
return init(this.converter, assign({}, this.attributes, attributes));
|
247
|
-
},
|
248
|
-
withConverter: function withConverter(converter) {
|
249
|
-
return init(assign({}, this.converter, converter), this.attributes);
|
250
|
-
}
|
251
|
-
}, {
|
252
|
-
attributes: {
|
253
|
-
value: Object.freeze(defaultAttributes)
|
254
|
-
},
|
255
|
-
converter: {
|
256
|
-
value: Object.freeze(converter)
|
257
|
-
}
|
258
|
-
});
|
259
|
-
}
|
260
|
-
init(defaultConverter, {
|
261
|
-
path: "/"
|
262
|
-
});
|
263
|
-
|
264
|
-
function useInvalidateQuery(queryKey, queryId) {
|
265
|
-
var queryClient = reactQuery.useQueryClient();
|
266
|
-
var key = queryId ? queryKey.concat([
|
267
|
-
"".concat(queryId)
|
268
|
-
]) : queryKey;
|
269
|
-
var invalidate = React__default["default"].useCallback(function() {
|
270
|
-
return key ? queryClient.invalidateQueries(key) : null;
|
271
|
-
}, [
|
272
|
-
key,
|
273
|
-
queryClient
|
274
|
-
]);
|
275
|
-
return invalidate;
|
276
|
-
}
|
277
|
-
|
278
|
-
function _define_property$3(obj, key, value) {
|
279
|
-
if (key in obj) {
|
280
|
-
Object.defineProperty(obj, key, {
|
281
|
-
value: value,
|
282
|
-
enumerable: true,
|
283
|
-
configurable: true,
|
284
|
-
writable: true
|
285
|
-
});
|
286
|
-
} else {
|
287
|
-
obj[key] = value;
|
288
|
-
}
|
289
|
-
return obj;
|
290
|
-
}
|
291
|
-
function _object_spread$3(target) {
|
292
|
-
for(var i = 1; i < arguments.length; i++){
|
293
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
294
|
-
var ownKeys = Object.keys(source);
|
295
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
296
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
297
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
298
|
-
}));
|
299
|
-
}
|
300
|
-
ownKeys.forEach(function(key) {
|
301
|
-
_define_property$3(target, key, source[key]);
|
302
|
-
});
|
303
|
-
}
|
304
|
-
return target;
|
305
|
-
}
|
306
|
-
function useApiMutation(queryFn, queryKey, queryParam, queryOptions) {
|
307
|
-
var key = (queryKey !== null && queryKey !== void 0 ? queryKey : []).concat([
|
308
|
-
queryParam ? typeof queryParam == "number" ? "".concat(queryParam) : queryParam : undefined
|
309
|
-
]);
|
310
|
-
return reactQuery.useMutation(key, queryFn, queryOptions);
|
311
|
-
}
|
312
|
-
function useInvalidateMutation(queryFn, queryKey, queryId, queryOptions) {
|
313
|
-
var invalidateQuery = useInvalidateQuery(queryKey, queryId);
|
314
|
-
var key = queryId ? queryKey.concat("".concat(queryId)) : queryKey;
|
315
|
-
return reactQuery.useMutation(key, queryFn, _object_spread$3({
|
316
|
-
onSuccess: function() {
|
317
|
-
return invalidateQuery();
|
318
|
-
}
|
319
|
-
}, queryOptions));
|
320
|
-
}
|
321
|
-
function useInvalidateParentMutation(queryFn, queryKey, queryOptions) {
|
322
|
-
var invalidateQuery = useInvalidateQuery(queryKey);
|
323
|
-
return reactQuery.useMutation(queryKey, queryFn, _object_spread$3({
|
324
|
-
onSuccess: function() {
|
325
|
-
return invalidateQuery();
|
326
|
-
}
|
327
|
-
}, queryOptions));
|
328
|
-
}
|
329
|
-
// useInvalidateMutation : invalidate the object e.g /xxx/id
|
330
|
-
// useInvalidateParentMutation : invalidate the parent object e.g /xxx
|
331
|
-
// useUpdateMutation : replace the data in cache to avoid refetching the server
|
332
|
-
|
333
|
-
function _define_property$2(obj, key, value) {
|
334
|
-
if (key in obj) {
|
335
|
-
Object.defineProperty(obj, key, {
|
336
|
-
value: value,
|
337
|
-
enumerable: true,
|
338
|
-
configurable: true,
|
339
|
-
writable: true
|
340
|
-
});
|
341
|
-
} else {
|
342
|
-
obj[key] = value;
|
343
|
-
}
|
344
|
-
return obj;
|
345
|
-
}
|
346
|
-
function _object_spread$2(target) {
|
347
|
-
for(var i = 1; i < arguments.length; i++){
|
348
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
349
|
-
var ownKeys = Object.keys(source);
|
350
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
351
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
352
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
353
|
-
}));
|
354
|
-
}
|
355
|
-
ownKeys.forEach(function(key) {
|
356
|
-
_define_property$2(target, key, source[key]);
|
357
|
-
});
|
358
|
-
}
|
359
|
-
return target;
|
360
|
-
}
|
361
|
-
function queryFnWrapper(queryFn, queryParam) {
|
362
|
-
return function(context) {
|
363
|
-
if (queryParam) return queryFn(queryParam);
|
364
|
-
return queryFn();
|
365
|
-
};
|
366
|
-
}
|
367
|
-
function useApiQuery(queryKey, queryFn, queryParam, queryOptions) {
|
368
|
-
var key = queryParam ? queryKey.concat([
|
369
|
-
typeof queryParam == "number" ? "".concat(queryParam) : queryParam
|
370
|
-
]) : queryKey;
|
371
|
-
return reactQuery.useQuery(key, queryFnWrapper(queryFn, queryParam), _object_spread$2({
|
372
|
-
retry: 0,
|
373
|
-
networkMode: "always",
|
374
|
-
retryOnMount: false,
|
375
|
-
refetchOnMount: false,
|
376
|
-
refetchOnWindowFocus: false
|
377
|
-
}, queryOptions));
|
378
|
-
}
|
379
|
-
function useApiQueries(queries) {
|
380
|
-
var results = reactQuery.useQueries({
|
381
|
-
queries: queries.map(function(q) {
|
382
|
-
var key = q.queryParam ? q.queryKey.concat([
|
383
|
-
typeof q.queryParam == "number" ? "".concat(q.queryParam) : q.queryParam
|
384
|
-
]) : q.queryKey;
|
385
|
-
return _object_spread$2({
|
386
|
-
queryKey: key,
|
387
|
-
queryFn: queryFnWrapper(q.queryFn, q.queryParam),
|
388
|
-
retry: 0,
|
389
|
-
// networkMode: "always",
|
390
|
-
retryOnMount: false,
|
391
|
-
refetchOnMount: false,
|
392
|
-
refetchOnWindowFocus: false
|
393
|
-
}, q.queryOptions);
|
394
|
-
})
|
395
|
-
});
|
396
|
-
var isFetching = results.findIndex(function(r) {
|
397
|
-
return r.isFetching === true;
|
398
|
-
}) != -1;
|
399
|
-
var isError = results.findIndex(function(r) {
|
400
|
-
return r.isError === true;
|
401
|
-
}) != -1;
|
402
|
-
var data = results.map(function(r) {
|
403
|
-
return r.data;
|
404
|
-
});
|
405
|
-
return {
|
406
|
-
data: data,
|
407
|
-
isFetching: isFetching,
|
408
|
-
isError: isError
|
409
|
-
};
|
410
|
-
}
|
411
|
-
|
412
|
-
function r(e) {
|
413
|
-
var t, f, n = "";
|
414
|
-
if ("string" == typeof e || "number" == typeof e) n += e;
|
415
|
-
else if ("object" == typeof e) if (Array.isArray(e)) for(t = 0; t < e.length; t++)e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
416
|
-
else for(t in e)e[t] && (n && (n += " "), n += t);
|
417
|
-
return n;
|
418
|
-
}
|
419
|
-
function clsx() {
|
420
|
-
for(var e, t, f = 0, n = ""; f < arguments.length;)(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
421
|
-
return n;
|
422
|
-
}
|
423
|
-
|
424
|
-
function _array_like_to_array$1(arr, len) {
|
425
|
-
if (len == null || len > arr.length) len = arr.length;
|
426
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
427
|
-
return arr2;
|
428
|
-
}
|
429
|
-
function _array_with_holes(arr) {
|
430
|
-
if (Array.isArray(arr)) return arr;
|
431
|
-
}
|
432
|
-
function _array_without_holes$1(arr) {
|
433
|
-
if (Array.isArray(arr)) return _array_like_to_array$1(arr);
|
434
|
-
}
|
435
|
-
function _define_property$1(obj, key, value) {
|
436
|
-
if (key in obj) {
|
437
|
-
Object.defineProperty(obj, key, {
|
438
|
-
value: value,
|
439
|
-
enumerable: true,
|
440
|
-
configurable: true,
|
441
|
-
writable: true
|
442
|
-
});
|
443
|
-
} else {
|
444
|
-
obj[key] = value;
|
445
|
-
}
|
446
|
-
return obj;
|
447
|
-
}
|
448
|
-
function _iterable_to_array$1(iter) {
|
449
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
450
|
-
}
|
451
|
-
function _iterable_to_array_limit(arr, i) {
|
452
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
453
|
-
if (_i == null) return;
|
454
|
-
var _arr = [];
|
455
|
-
var _n = true;
|
456
|
-
var _d = false;
|
457
|
-
var _s, _e;
|
458
|
-
try {
|
459
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
460
|
-
_arr.push(_s.value);
|
461
|
-
if (i && _arr.length === i) break;
|
462
|
-
}
|
463
|
-
} catch (err) {
|
464
|
-
_d = true;
|
465
|
-
_e = err;
|
466
|
-
} finally{
|
467
|
-
try {
|
468
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
469
|
-
} finally{
|
470
|
-
if (_d) throw _e;
|
471
|
-
}
|
472
|
-
}
|
473
|
-
return _arr;
|
474
|
-
}
|
475
|
-
function _non_iterable_rest() {
|
476
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
477
|
-
}
|
478
|
-
function _non_iterable_spread$1() {
|
479
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
480
|
-
}
|
481
|
-
function _object_spread$1(target) {
|
482
|
-
for(var i = 1; i < arguments.length; i++){
|
483
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
484
|
-
var ownKeys = Object.keys(source);
|
485
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
486
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
487
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
488
|
-
}));
|
489
|
-
}
|
490
|
-
ownKeys.forEach(function(key) {
|
491
|
-
_define_property$1(target, key, source[key]);
|
492
|
-
});
|
493
|
-
}
|
494
|
-
return target;
|
495
|
-
}
|
496
|
-
function ownKeys(object, enumerableOnly) {
|
497
|
-
var keys = Object.keys(object);
|
498
|
-
if (Object.getOwnPropertySymbols) {
|
499
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
500
|
-
if (enumerableOnly) {
|
501
|
-
symbols = symbols.filter(function(sym) {
|
502
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
503
|
-
});
|
504
|
-
}
|
505
|
-
keys.push.apply(keys, symbols);
|
506
|
-
}
|
507
|
-
return keys;
|
508
|
-
}
|
509
|
-
function _object_spread_props(target, source) {
|
510
|
-
source = source != null ? source : {};
|
511
|
-
if (Object.getOwnPropertyDescriptors) {
|
512
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
513
|
-
} else {
|
514
|
-
ownKeys(Object(source)).forEach(function(key) {
|
515
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
516
|
-
});
|
517
|
-
}
|
518
|
-
return target;
|
519
|
-
}
|
520
|
-
function _object_without_properties(source, excluded) {
|
521
|
-
if (source == null) return {};
|
522
|
-
var target = _object_without_properties_loose(source, excluded);
|
523
|
-
var key, i;
|
524
|
-
if (Object.getOwnPropertySymbols) {
|
525
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
526
|
-
for(i = 0; i < sourceSymbolKeys.length; i++){
|
527
|
-
key = sourceSymbolKeys[i];
|
528
|
-
if (excluded.indexOf(key) >= 0) continue;
|
529
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
530
|
-
target[key] = source[key];
|
531
|
-
}
|
532
|
-
}
|
533
|
-
return target;
|
534
|
-
}
|
535
|
-
function _object_without_properties_loose(source, excluded) {
|
536
|
-
if (source == null) return {};
|
537
|
-
var target = {};
|
538
|
-
var sourceKeys = Object.keys(source);
|
539
|
-
var key, i;
|
540
|
-
for(i = 0; i < sourceKeys.length; i++){
|
541
|
-
key = sourceKeys[i];
|
542
|
-
if (excluded.indexOf(key) >= 0) continue;
|
543
|
-
target[key] = source[key];
|
544
|
-
}
|
545
|
-
return target;
|
546
|
-
}
|
547
|
-
function _sliced_to_array(arr, i) {
|
548
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest();
|
549
|
-
}
|
550
|
-
function _to_consumable_array$1(arr) {
|
551
|
-
return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$1(arr) || _non_iterable_spread$1();
|
552
|
-
}
|
553
|
-
function _unsupported_iterable_to_array$1(o, minLen) {
|
554
|
-
if (!o) return;
|
555
|
-
if (typeof o === "string") return _array_like_to_array$1(o, minLen);
|
556
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
557
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
558
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
559
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
|
560
|
-
}
|
561
|
-
var u = function(t) {
|
562
|
-
return "number" == typeof t && !isNaN(t);
|
563
|
-
}, d = function(t) {
|
564
|
-
return "string" == typeof t;
|
565
|
-
}, p = function(t) {
|
566
|
-
return "function" == typeof t;
|
567
|
-
}, m = function(t) {
|
568
|
-
return d(t) || p(t) ? t : null;
|
569
|
-
}, f = function(t) {
|
570
|
-
return React.isValidElement(t) || d(t) || p(t) || u(t);
|
571
|
-
};
|
572
|
-
function g(t, e, n) {
|
573
|
-
void 0 === n && (n = 300);
|
574
|
-
var o = t.scrollHeight, s = t.style;
|
575
|
-
requestAnimationFrame(function() {
|
576
|
-
s.minHeight = "initial", s.height = o + "px", s.transition = "all ".concat(n, "ms"), requestAnimationFrame(function() {
|
577
|
-
s.height = "0", s.padding = "0", s.margin = "0", setTimeout(e, n);
|
578
|
-
});
|
579
|
-
});
|
580
|
-
}
|
581
|
-
function h(e) {
|
582
|
-
var a = e.enter, r = e.exit, tmp = e.appendPosition, i = tmp === void 0 ? !1 : tmp, tmp1 = e.collapse, _$l = tmp1 === void 0 ? !0 : tmp1, tmp2 = e.collapseDuration, c = tmp2 === void 0 ? 300 : tmp2;
|
583
|
-
return function(e) {
|
584
|
-
var u = e.children, d = e.position, p = e.preventExitTransition, m = e.done, f = e.nodeRef, _$h = e.isIn;
|
585
|
-
var y = i ? "".concat(a, "--").concat(d) : a, v = i ? "".concat(r, "--").concat(d) : r, T = React.useRef(0);
|
586
|
-
return React.useLayoutEffect(function() {
|
587
|
-
var _t_classList;
|
588
|
-
var _$t = f.current, _$e = y.split(" "), _$n = function(o) {
|
589
|
-
var _t_classList;
|
590
|
-
o.target === f.current && (_$t.dispatchEvent(new Event("d")), _$t.removeEventListener("animationend", _$n), _$t.removeEventListener("animationcancel", _$n), 0 === T.current && "animationcancel" !== o.type && (_t_classList = _$t.classList).remove.apply(_t_classList, _to_consumable_array$1(_$e)));
|
591
|
-
};
|
592
|
-
(_t_classList = _$t.classList).add.apply(_t_classList, _to_consumable_array$1(_$e)), _$t.addEventListener("animationend", _$n), _$t.addEventListener("animationcancel", _$n);
|
593
|
-
}, []), React.useEffect(function() {
|
594
|
-
var _$t = f.current, _$e = function() {
|
595
|
-
_$t.removeEventListener("animationend", _$e), _$l ? g(_$t, m, c) : m();
|
596
|
-
};
|
597
|
-
_$h || (p ? _$e() : (T.current = 1, _$t.className += " ".concat(v), _$t.addEventListener("animationend", _$e)));
|
598
|
-
}, [
|
599
|
-
_$h
|
600
|
-
]), React__default["default"].createElement(React__default["default"].Fragment, null, u);
|
601
|
-
};
|
602
|
-
}
|
603
|
-
function y(t, e) {
|
604
|
-
return null != t ? {
|
605
|
-
content: t.content,
|
606
|
-
containerId: t.props.containerId,
|
607
|
-
id: t.props.toastId,
|
608
|
-
theme: t.props.theme,
|
609
|
-
type: t.props.type,
|
610
|
-
data: t.props.data || {},
|
611
|
-
isLoading: t.props.isLoading,
|
612
|
-
icon: t.props.icon,
|
613
|
-
status: e
|
614
|
-
} : {};
|
615
|
-
}
|
616
|
-
var v = {
|
617
|
-
list: new Map,
|
618
|
-
emitQueue: new Map,
|
619
|
-
on: function on(t, e) {
|
620
|
-
return this.list.has(t) || this.list.set(t, []), this.list.get(t).push(e), this;
|
621
|
-
},
|
622
|
-
off: function off(t, e) {
|
623
|
-
if (e) {
|
624
|
-
var n = this.list.get(t).filter(function(t) {
|
625
|
-
return t !== e;
|
626
|
-
});
|
627
|
-
return this.list.set(t, n), this;
|
628
|
-
}
|
629
|
-
return this.list.delete(t), this;
|
630
|
-
},
|
631
|
-
cancelEmit: function cancelEmit(t) {
|
632
|
-
var e = this.emitQueue.get(t);
|
633
|
-
return e && (e.forEach(clearTimeout), this.emitQueue.delete(t)), this;
|
634
|
-
},
|
635
|
-
emit: function emit(t) {
|
636
|
-
var _this = this, _arguments = arguments;
|
637
|
-
this.list.has(t) && this.list.get(t).forEach(function(e) {
|
638
|
-
var n = setTimeout(function() {
|
639
|
-
e.apply(void 0, _to_consumable_array$1([].slice.call(_arguments, 1)));
|
640
|
-
}, 0);
|
641
|
-
_this.emitQueue.has(t) || _this.emitQueue.set(t, []), _this.emitQueue.get(t).push(n);
|
642
|
-
});
|
643
|
-
}
|
644
|
-
}, T = function(e) {
|
645
|
-
var n = e.theme, o = e.type, s = _object_without_properties(e, [
|
646
|
-
"theme",
|
647
|
-
"type"
|
648
|
-
]);
|
649
|
-
return React__default["default"].createElement("svg", _object_spread$1({
|
650
|
-
viewBox: "0 0 24 24",
|
651
|
-
width: "100%",
|
652
|
-
height: "100%",
|
653
|
-
fill: "colored" === n ? "currentColor" : "var(--toastify-icon-color-".concat(o, ")")
|
654
|
-
}, s));
|
655
|
-
}, E = {
|
656
|
-
info: function info(e) {
|
657
|
-
return React__default["default"].createElement(T, _object_spread$1({}, e), React__default["default"].createElement("path", {
|
658
|
-
d: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"
|
659
|
-
}));
|
660
|
-
},
|
661
|
-
warning: function warning(e) {
|
662
|
-
return React__default["default"].createElement(T, _object_spread$1({}, e), React__default["default"].createElement("path", {
|
663
|
-
d: "M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"
|
664
|
-
}));
|
665
|
-
},
|
666
|
-
success: function success(e) {
|
667
|
-
return React__default["default"].createElement(T, _object_spread$1({}, e), React__default["default"].createElement("path", {
|
668
|
-
d: "M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"
|
669
|
-
}));
|
670
|
-
},
|
671
|
-
error: function error(e) {
|
672
|
-
return React__default["default"].createElement(T, _object_spread$1({}, e), React__default["default"].createElement("path", {
|
673
|
-
d: "M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"
|
674
|
-
}));
|
675
|
-
},
|
676
|
-
spinner: function spinner() {
|
677
|
-
return React__default["default"].createElement("div", {
|
678
|
-
className: "Toastify__spinner"
|
679
|
-
});
|
680
|
-
}
|
681
|
-
};
|
682
|
-
function C(t) {
|
683
|
-
var _r = _sliced_to_array(React.useReducer(function(t) {
|
684
|
-
return t + 1;
|
685
|
-
}, 0), 2), o = _r[1], _i = _sliced_to_array(React.useState([]), 2), _$l = _i[0], c = _i[1], g = React.useRef(null), _$h = React.useRef(new Map).current, T = function(t) {
|
686
|
-
return -1 !== _$l.indexOf(t);
|
687
|
-
}, C = React.useRef({
|
688
|
-
toastKey: 1,
|
689
|
-
displayedToast: 0,
|
690
|
-
count: 0,
|
691
|
-
queue: [],
|
692
|
-
props: t,
|
693
|
-
containerId: null,
|
694
|
-
isToastActive: T,
|
695
|
-
getToast: function(t) {
|
696
|
-
return _$h.get(t);
|
697
|
-
}
|
698
|
-
}).current;
|
699
|
-
function b(t) {
|
700
|
-
var e = t.containerId;
|
701
|
-
var _C_props = C.props, _$n = _C_props.limit;
|
702
|
-
!_$n || e && C.containerId !== e || (C.count -= C.queue.length, C.queue = []);
|
703
|
-
}
|
704
|
-
function I(t) {
|
705
|
-
c(function(e) {
|
706
|
-
return null == t ? [] : e.filter(function(e) {
|
707
|
-
return e !== t;
|
708
|
-
});
|
709
|
-
});
|
710
|
-
}
|
711
|
-
function _() {
|
712
|
-
var _C_queue_shift = C.queue.shift(), _$t = _C_queue_shift.toastContent, e = _C_queue_shift.toastProps, _$n = _C_queue_shift.staleId;
|
713
|
-
O(_$t, e, _$n);
|
714
|
-
}
|
715
|
-
function L(t, n) {
|
716
|
-
var _$s = n.delay, _$r = n.staleId, _$i = _object_without_properties(n, [
|
717
|
-
"delay",
|
718
|
-
"staleId"
|
719
|
-
]);
|
720
|
-
if (!f(t) || function(t) {
|
721
|
-
return !g.current || C.props.enableMultiContainer && t.containerId !== C.props.containerId || _$h.has(t.toastId) && null == t.updateId;
|
722
|
-
}(_$i)) return;
|
723
|
-
var _$l = _$i.toastId, c = _$i.updateId, T = _$i.data, b = C.props, _$L = function() {
|
724
|
-
return I(_$l);
|
725
|
-
}, N = null == c;
|
726
|
-
N && C.count++;
|
727
|
-
var M = _object_spread_props(_object_spread$1(_object_spread_props(_object_spread$1({}, b), {
|
728
|
-
style: b.toastStyle,
|
729
|
-
key: C.toastKey++
|
730
|
-
}), Object.fromEntries(Object.entries(_$i).filter(function(t) {
|
731
|
-
var _t = _sliced_to_array(t, 2); _t[0]; var _$n = _t[1];
|
732
|
-
return null != _$n;
|
733
|
-
}))), {
|
734
|
-
toastId: _$l,
|
735
|
-
updateId: c,
|
736
|
-
data: T,
|
737
|
-
closeToast: _$L,
|
738
|
-
isIn: !1,
|
739
|
-
className: m(_$i.className || b.toastClassName),
|
740
|
-
bodyClassName: m(_$i.bodyClassName || b.bodyClassName),
|
741
|
-
progressClassName: m(_$i.progressClassName || b.progressClassName),
|
742
|
-
autoClose: !_$i.isLoading && (R = _$i.autoClose, w = b.autoClose, !1 === R || u(R) && R > 0 ? R : w),
|
743
|
-
deleteToast: function deleteToast() {
|
744
|
-
var _$t = y(_$h.get(_$l), "removed");
|
745
|
-
_$h.delete(_$l), v.emit(4, _$t);
|
746
|
-
var _$e = C.queue.length;
|
747
|
-
if (C.count = null == _$l ? C.count - C.displayedToast : C.count - 1, C.count < 0 && (C.count = 0), _$e > 0) {
|
748
|
-
var _$t1 = null == _$l ? C.props.limit : 1;
|
749
|
-
if (1 === _$e || 1 === _$t1) C.displayedToast++, _();
|
750
|
-
else {
|
751
|
-
var _$n = _$t1 > _$e ? _$e : _$t1;
|
752
|
-
C.displayedToast = _$n;
|
753
|
-
for(var _$t2 = 0; _$t2 < _$n; _$t2++)_();
|
754
|
-
}
|
755
|
-
} else o();
|
756
|
-
}
|
757
|
-
});
|
758
|
-
var R, w;
|
759
|
-
M.iconOut = function(t) {
|
760
|
-
var _$n = t.theme, o = t.type, _$s = t.isLoading, _$r = t.icon, _$i = null;
|
761
|
-
var _$l = {
|
762
|
-
theme: _$n,
|
763
|
-
type: o
|
764
|
-
};
|
765
|
-
return !1 === _$r || (p(_$r) ? _$i = _$r(_$l) : React.isValidElement(_$r) ? _$i = React.cloneElement(_$r, _$l) : d(_$r) || u(_$r) ? _$i = _$r : _$s ? _$i = E.spinner() : function(t) {
|
766
|
-
return t in E;
|
767
|
-
}(o) && (_$i = E[o](_$l))), _$i;
|
768
|
-
}(M), p(_$i.onOpen) && (M.onOpen = _$i.onOpen), p(_$i.onClose) && (M.onClose = _$i.onClose), M.closeButton = b.closeButton, !1 === _$i.closeButton || f(_$i.closeButton) ? M.closeButton = _$i.closeButton : !0 === _$i.closeButton && (M.closeButton = !f(b.closeButton) || b.closeButton);
|
769
|
-
var x = t;
|
770
|
-
React.isValidElement(t) && !d(t.type) ? x = React.cloneElement(t, {
|
771
|
-
closeToast: _$L,
|
772
|
-
toastProps: M,
|
773
|
-
data: T
|
774
|
-
}) : p(t) && (x = t({
|
775
|
-
closeToast: _$L,
|
776
|
-
toastProps: M,
|
777
|
-
data: T
|
778
|
-
})), b.limit && b.limit > 0 && C.count > b.limit && N ? C.queue.push({
|
779
|
-
toastContent: x,
|
780
|
-
toastProps: M,
|
781
|
-
staleId: _$r
|
782
|
-
}) : u(_$s) ? setTimeout(function() {
|
783
|
-
O(x, M, _$r);
|
784
|
-
}, _$s) : O(x, M, _$r);
|
785
|
-
}
|
786
|
-
function O(t, e, n) {
|
787
|
-
var o = e.toastId;
|
788
|
-
n && _$h.delete(n);
|
789
|
-
var _$s = {
|
790
|
-
content: t,
|
791
|
-
props: e
|
792
|
-
};
|
793
|
-
_$h.set(o, _$s), c(function(t) {
|
794
|
-
return _to_consumable_array$1(t).concat([
|
795
|
-
o
|
796
|
-
]).filter(function(t) {
|
797
|
-
return t !== n;
|
798
|
-
});
|
799
|
-
}), v.emit(4, y(_$s, null == _$s.props.updateId ? "added" : "updated"));
|
800
|
-
}
|
801
|
-
return React.useEffect(function() {
|
802
|
-
return C.containerId = t.containerId, v.cancelEmit(3).on(0, L).on(1, function(t) {
|
803
|
-
return g.current && I(t);
|
804
|
-
}).on(5, b).emit(2, C), function() {
|
805
|
-
_$h.clear(), v.emit(3, C);
|
806
|
-
};
|
807
|
-
}, []), React.useEffect(function() {
|
808
|
-
C.props = t, C.isToastActive = T, C.displayedToast = _$l.length;
|
809
|
-
}), {
|
810
|
-
getToastToRender: function getToastToRender(e) {
|
811
|
-
var _$n = new Map, o = Array.from(_$h.values());
|
812
|
-
return t.newestOnTop && o.reverse(), o.forEach(function(t) {
|
813
|
-
var _t_props = t.props, e = _t_props.position;
|
814
|
-
_$n.has(e) || _$n.set(e, []), _$n.get(e).push(t);
|
815
|
-
}), Array.from(_$n, function(t) {
|
816
|
-
return e(t[0], t[1]);
|
817
|
-
});
|
818
|
-
},
|
819
|
-
containerRef: g,
|
820
|
-
isToastActive: T
|
821
|
-
};
|
822
|
-
}
|
823
|
-
function b(t) {
|
824
|
-
return t.targetTouches && t.targetTouches.length >= 1 ? t.targetTouches[0].clientX : t.clientX;
|
825
|
-
}
|
826
|
-
function I(t) {
|
827
|
-
return t.targetTouches && t.targetTouches.length >= 1 ? t.targetTouches[0].clientY : t.clientY;
|
828
|
-
}
|
829
|
-
function _(t) {
|
830
|
-
var _i = _sliced_to_array(React.useState(!1), 2), o = _i[0], a = _i[1], _i1 = _sliced_to_array(React.useState(!1), 2), r = _i1[0], _$l = _i1[1], c = React.useRef(null), u = React.useRef({
|
831
|
-
start: 0,
|
832
|
-
x: 0,
|
833
|
-
y: 0,
|
834
|
-
delta: 0,
|
835
|
-
removalDistance: 0,
|
836
|
-
canCloseOnClick: !0,
|
837
|
-
canDrag: !1,
|
838
|
-
boundingRect: null,
|
839
|
-
didMove: !1
|
840
|
-
}).current, d = React.useRef(t), m = t.autoClose, f = t.pauseOnHover, g = t.closeToast, _$h = t.onClick, y = t.closeOnClick;
|
841
|
-
function v(e) {
|
842
|
-
if (t.draggable) {
|
843
|
-
"touchstart" === e.nativeEvent.type && e.nativeEvent.preventDefault(), u.didMove = !1, document.addEventListener("mousemove", _), document.addEventListener("mouseup", L), document.addEventListener("touchmove", _), document.addEventListener("touchend", L);
|
844
|
-
var _$n = c.current;
|
845
|
-
u.canCloseOnClick = !0, u.canDrag = !0, u.boundingRect = _$n.getBoundingClientRect(), _$n.style.transition = "", u.x = b(e.nativeEvent), u.y = I(e.nativeEvent), "x" === t.draggableDirection ? (u.start = u.x, u.removalDistance = _$n.offsetWidth * (t.draggablePercent / 100)) : (u.start = u.y, u.removalDistance = _$n.offsetHeight * (80 === t.draggablePercent ? 1.5 * t.draggablePercent : t.draggablePercent / 100));
|
846
|
-
}
|
847
|
-
}
|
848
|
-
function T(e) {
|
849
|
-
if (u.boundingRect) {
|
850
|
-
var _u_boundingRect = u.boundingRect, _$n = _u_boundingRect.top, o = _u_boundingRect.bottom, _$s = _u_boundingRect.left, a = _u_boundingRect.right;
|
851
|
-
"touchend" !== e.nativeEvent.type && t.pauseOnHover && u.x >= _$s && u.x <= a && u.y >= _$n && u.y <= o ? C() : E();
|
852
|
-
}
|
853
|
-
}
|
854
|
-
function E() {
|
855
|
-
a(!0);
|
856
|
-
}
|
857
|
-
function C() {
|
858
|
-
a(!1);
|
859
|
-
}
|
860
|
-
function _(e) {
|
861
|
-
var _$n = c.current;
|
862
|
-
u.canDrag && _$n && (u.didMove = !0, o && C(), u.x = b(e), u.y = I(e), u.delta = "x" === t.draggableDirection ? u.x - u.start : u.y - u.start, u.start !== u.x && (u.canCloseOnClick = !1), _$n.style.transform = "translate".concat(t.draggableDirection, "(").concat(u.delta, "px)"), _$n.style.opacity = "" + (1 - Math.abs(u.delta / u.removalDistance)));
|
863
|
-
}
|
864
|
-
function L() {
|
865
|
-
document.removeEventListener("mousemove", _), document.removeEventListener("mouseup", L), document.removeEventListener("touchmove", _), document.removeEventListener("touchend", L);
|
866
|
-
var e = c.current;
|
867
|
-
if (u.canDrag && u.didMove && e) {
|
868
|
-
if (u.canDrag = !1, Math.abs(u.delta) > u.removalDistance) return _$l(!0), void t.closeToast();
|
869
|
-
e.style.transition = "transform 0.2s, opacity 0.2s", e.style.transform = "translate".concat(t.draggableDirection, "(0)"), e.style.opacity = "1";
|
870
|
-
}
|
871
|
-
}
|
872
|
-
React.useEffect(function() {
|
873
|
-
d.current = t;
|
874
|
-
}), React.useEffect(function() {
|
875
|
-
return c.current && c.current.addEventListener("d", E, {
|
876
|
-
once: !0
|
877
|
-
}), p(t.onOpen) && t.onOpen(React.isValidElement(t.children) && t.children.props), function() {
|
878
|
-
var _$t = d.current;
|
879
|
-
p(_$t.onClose) && _$t.onClose(React.isValidElement(_$t.children) && _$t.children.props);
|
880
|
-
};
|
881
|
-
}, []), React.useEffect(function() {
|
882
|
-
return t.pauseOnFocusLoss && (document.hasFocus() || C(), window.addEventListener("focus", E), window.addEventListener("blur", C)), function() {
|
883
|
-
t.pauseOnFocusLoss && (window.removeEventListener("focus", E), window.removeEventListener("blur", C));
|
884
|
-
};
|
885
|
-
}, [
|
886
|
-
t.pauseOnFocusLoss
|
887
|
-
]);
|
888
|
-
var O = {
|
889
|
-
onMouseDown: v,
|
890
|
-
onTouchStart: v,
|
891
|
-
onMouseUp: T,
|
892
|
-
onTouchEnd: T
|
893
|
-
};
|
894
|
-
return m && f && (O.onMouseEnter = C, O.onMouseLeave = E), y && (O.onClick = function(t) {
|
895
|
-
_$h && _$h(t), u.canCloseOnClick && g();
|
896
|
-
}), {
|
897
|
-
playToast: E,
|
898
|
-
pauseToast: C,
|
899
|
-
isRunning: o,
|
900
|
-
preventExitTransition: r,
|
901
|
-
toastRef: c,
|
902
|
-
eventHandlers: O
|
903
|
-
};
|
904
|
-
}
|
905
|
-
function L(e) {
|
906
|
-
var n = e.closeToast, o = e.theme, tmp = e.ariaLabel, s = tmp === void 0 ? "close" : tmp;
|
907
|
-
return React__default["default"].createElement("button", {
|
908
|
-
className: "Toastify__close-button Toastify__close-button--".concat(o),
|
909
|
-
type: "button",
|
910
|
-
onClick: function(t) {
|
911
|
-
t.stopPropagation(), n(t);
|
912
|
-
},
|
913
|
-
"aria-label": s
|
914
|
-
}, React__default["default"].createElement("svg", {
|
915
|
-
"aria-hidden": "true",
|
916
|
-
viewBox: "0 0 14 16"
|
917
|
-
}, React__default["default"].createElement("path", {
|
918
|
-
fillRule: "evenodd",
|
919
|
-
d: "M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"
|
920
|
-
})));
|
921
|
-
}
|
922
|
-
function O(e) {
|
923
|
-
var n = e.delay, o = e.isRunning, s = e.closeToast, tmp = e.type, a = tmp === void 0 ? "default" : tmp, r = e.hide, i = e.className, _$l = e.style, u = e.controlledProgress, d = e.progress, m = e.rtl, f = e.isIn, g = e.theme;
|
924
|
-
var _$h = r || u && 0 === d, y = _object_spread_props(_object_spread$1({}, _$l), {
|
925
|
-
animationDuration: "".concat(n, "ms"),
|
926
|
-
animationPlayState: o ? "running" : "paused",
|
927
|
-
opacity: _$h ? 0 : 1
|
928
|
-
});
|
929
|
-
u && (y.transform = "scaleX(".concat(d, ")"));
|
930
|
-
var v = clsx("Toastify__progress-bar", u ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", "Toastify__progress-bar-theme--".concat(g), "Toastify__progress-bar--".concat(a), {
|
931
|
-
"Toastify__progress-bar--rtl": m
|
932
|
-
}), T = p(i) ? i({
|
933
|
-
rtl: m,
|
934
|
-
type: a,
|
935
|
-
defaultClassName: v
|
936
|
-
}) : clsx(v, i);
|
937
|
-
return React__default["default"].createElement("div", _define_property$1({
|
938
|
-
role: "progressbar",
|
939
|
-
"aria-hidden": _$h ? "true" : "false",
|
940
|
-
"aria-label": "notification timer",
|
941
|
-
className: T,
|
942
|
-
style: y
|
943
|
-
}, u && d >= 1 ? "onTransitionEnd" : "onAnimationEnd", u && d < 1 ? null : function() {
|
944
|
-
f && s();
|
945
|
-
}));
|
946
|
-
}
|
947
|
-
var N = function(n) {
|
948
|
-
var _$_ = _(n), o = _$_.isRunning, s = _$_.preventExitTransition, r = _$_.toastRef, i = _$_.eventHandlers, _$l = n.closeButton, u = n.children, d = n.autoClose, m = n.onClick, f = n.type, g = n.hideProgressBar, _$h = n.closeToast, y = n.transition, v = n.position, T = n.className, E = n.style, C = n.bodyClassName, b = n.bodyStyle, I = n.progressClassName, N = n.progressStyle, M = n.updateId, R = n.role, w = n.progress, x = n.rtl, $ = n.toastId, k = n.deleteToast, P = n.isIn, B = n.isLoading, D = n.iconOut, A = n.closeOnClick, z = n.theme, F = clsx("Toastify__toast", "Toastify__toast-theme--".concat(z), "Toastify__toast--".concat(f), {
|
949
|
-
"Toastify__toast--rtl": x
|
950
|
-
}, {
|
951
|
-
"Toastify__toast--close-on-click": A
|
952
|
-
}), H = p(T) ? T({
|
953
|
-
rtl: x,
|
954
|
-
position: v,
|
955
|
-
type: f,
|
956
|
-
defaultClassName: F
|
957
|
-
}) : clsx(F, T), S = !!w || !d, _$q = {
|
958
|
-
closeToast: _$h,
|
959
|
-
type: f,
|
960
|
-
theme: z
|
961
|
-
};
|
962
|
-
var _$Q = null;
|
963
|
-
return !1 === _$l || (_$Q = p(_$l) ? _$l(_$q) : React.isValidElement(_$l) ? React.cloneElement(_$l, _$q) : L(_$q)), React__default["default"].createElement(y, {
|
964
|
-
isIn: P,
|
965
|
-
done: k,
|
966
|
-
position: v,
|
967
|
-
preventExitTransition: s,
|
968
|
-
nodeRef: r
|
969
|
-
}, React__default["default"].createElement("div", _object_spread_props(_object_spread$1({
|
970
|
-
id: $,
|
971
|
-
onClick: m,
|
972
|
-
className: H
|
973
|
-
}, i), {
|
974
|
-
style: E,
|
975
|
-
ref: r
|
976
|
-
}), React__default["default"].createElement("div", _object_spread_props(_object_spread$1({}, P && {
|
977
|
-
role: R
|
978
|
-
}), {
|
979
|
-
className: p(C) ? C({
|
980
|
-
type: f
|
981
|
-
}) : clsx("Toastify__toast-body", C),
|
982
|
-
style: b
|
983
|
-
}), null != D && React__default["default"].createElement("div", {
|
984
|
-
className: clsx("Toastify__toast-icon", {
|
985
|
-
"Toastify--animate-icon Toastify__zoom-enter": !B
|
986
|
-
})
|
987
|
-
}, D), React__default["default"].createElement("div", null, u)), _$Q, React__default["default"].createElement(O, _object_spread_props(_object_spread$1({}, M && !S ? {
|
988
|
-
key: "pb-".concat(M)
|
989
|
-
} : {}), {
|
990
|
-
rtl: x,
|
991
|
-
theme: z,
|
992
|
-
delay: d,
|
993
|
-
isRunning: o,
|
994
|
-
isIn: P,
|
995
|
-
closeToast: _$h,
|
996
|
-
hide: g,
|
997
|
-
type: f,
|
998
|
-
style: N,
|
999
|
-
className: I,
|
1000
|
-
controlledProgress: S,
|
1001
|
-
progress: w || 0
|
1002
|
-
}))));
|
1003
|
-
}, M = function M(t, e) {
|
1004
|
-
return void 0 === e && (e = !1), {
|
1005
|
-
enter: "Toastify--animate Toastify__".concat(t, "-enter"),
|
1006
|
-
exit: "Toastify--animate Toastify__".concat(t, "-exit"),
|
1007
|
-
appendPosition: e
|
1008
|
-
};
|
1009
|
-
}, R = h(M("bounce", !0)); h(M("slide", !0)); h(M("zoom")); h(M("flip")); var k = React.forwardRef(function(e, n) {
|
1010
|
-
var f = function f(t) {
|
1011
|
-
var _$e = clsx("Toastify__toast-container", "Toastify__toast-container--".concat(t), {
|
1012
|
-
"Toastify__toast-container--rtl": u
|
1013
|
-
});
|
1014
|
-
return p(i) ? i({
|
1015
|
-
position: t,
|
1016
|
-
rtl: u,
|
1017
|
-
defaultClassName: _$e
|
1018
|
-
}) : clsx(_$e, m(i));
|
1019
|
-
};
|
1020
|
-
var _C = C(e), o = _C.getToastToRender, a = _C.containerRef, r = _C.isToastActive, i = e.className, _$l = e.style, u = e.rtl, d = e.containerId;
|
1021
|
-
return React.useEffect(function() {
|
1022
|
-
n && (n.current = a.current);
|
1023
|
-
}, []), React__default["default"].createElement("div", {
|
1024
|
-
ref: a,
|
1025
|
-
className: "Toastify",
|
1026
|
-
id: d
|
1027
|
-
}, o(function(e, n) {
|
1028
|
-
var o = n.length ? _object_spread$1({}, _$l) : _object_spread_props(_object_spread$1({}, _$l), {
|
1029
|
-
pointerEvents: "none"
|
1030
|
-
});
|
1031
|
-
return React__default["default"].createElement("div", {
|
1032
|
-
className: f(e),
|
1033
|
-
style: o,
|
1034
|
-
key: "container-".concat(e)
|
1035
|
-
}, n.map(function(e, o) {
|
1036
|
-
var _$s = e.content, a = e.props;
|
1037
|
-
return React__default["default"].createElement(N, _object_spread_props(_object_spread$1({}, a), {
|
1038
|
-
isIn: r(a.toastId),
|
1039
|
-
style: _object_spread_props(_object_spread$1({}, a.style), {
|
1040
|
-
"--nth": o + 1,
|
1041
|
-
"--len": n.length
|
1042
|
-
}),
|
1043
|
-
key: "toast-".concat(a.key)
|
1044
|
-
}), _$s);
|
1045
|
-
}));
|
1046
|
-
}));
|
1047
|
-
});
|
1048
|
-
k.displayName = "ToastContainer", k.defaultProps = {
|
1049
|
-
position: "top-right",
|
1050
|
-
transition: R,
|
1051
|
-
autoClose: 5e3,
|
1052
|
-
closeButton: L,
|
1053
|
-
pauseOnHover: !0,
|
1054
|
-
pauseOnFocusLoss: !0,
|
1055
|
-
closeOnClick: !0,
|
1056
|
-
draggable: !0,
|
1057
|
-
draggablePercent: 80,
|
1058
|
-
draggableDirection: "x",
|
1059
|
-
role: "alert",
|
1060
|
-
theme: "light"
|
1061
|
-
};
|
1062
|
-
var P, B = new Map, D = [], A = 1;
|
1063
|
-
function z() {
|
1064
|
-
return "" + A++;
|
1065
|
-
}
|
1066
|
-
function F(t) {
|
1067
|
-
return t && (d(t.toastId) || u(t.toastId)) ? t.toastId : z();
|
1068
|
-
}
|
1069
|
-
function H(t, e) {
|
1070
|
-
return B.size > 0 ? v.emit(0, t, e) : D.push({
|
1071
|
-
content: t,
|
1072
|
-
options: e
|
1073
|
-
}), e.toastId;
|
1074
|
-
}
|
1075
|
-
function S(t, e) {
|
1076
|
-
return _object_spread_props(_object_spread$1({}, e), {
|
1077
|
-
type: e && e.type || t,
|
1078
|
-
toastId: F(e)
|
1079
|
-
});
|
1080
|
-
}
|
1081
|
-
function q(t) {
|
1082
|
-
return function(e, n) {
|
1083
|
-
return H(e, S(t, n));
|
1084
|
-
};
|
1085
|
-
}
|
1086
|
-
function Q(t, e) {
|
1087
|
-
return H(t, S("default", e));
|
1088
|
-
}
|
1089
|
-
Q.loading = function(t, e) {
|
1090
|
-
return H(t, S("default", _object_spread$1({
|
1091
|
-
isLoading: !0,
|
1092
|
-
autoClose: !1,
|
1093
|
-
closeOnClick: !1,
|
1094
|
-
closeButton: !1,
|
1095
|
-
draggable: !1
|
1096
|
-
}, e)));
|
1097
|
-
}, Q.promise = function(t, e, n) {
|
1098
|
-
var o, s = e.pending, a = e.error, r = e.success;
|
1099
|
-
s && (o = d(s) ? Q.loading(s, n) : Q.loading(s.render, _object_spread$1({}, n, s)));
|
1100
|
-
var i = {
|
1101
|
-
isLoading: null,
|
1102
|
-
autoClose: null,
|
1103
|
-
closeOnClick: null,
|
1104
|
-
closeButton: null,
|
1105
|
-
draggable: null
|
1106
|
-
}, _$l = function(t, e, s) {
|
1107
|
-
if (null == e) return void Q.dismiss(o);
|
1108
|
-
var a = _object_spread_props(_object_spread$1({
|
1109
|
-
type: t
|
1110
|
-
}, i, n), {
|
1111
|
-
data: s
|
1112
|
-
}), r = d(e) ? {
|
1113
|
-
render: e
|
1114
|
-
} : e;
|
1115
|
-
return o ? Q.update(o, _object_spread$1({}, a, r)) : Q(r.render, _object_spread$1({}, a, r)), s;
|
1116
|
-
}, c = p(t) ? t() : t;
|
1117
|
-
return c.then(function(t) {
|
1118
|
-
return _$l("success", r, t);
|
1119
|
-
}).catch(function(t) {
|
1120
|
-
return _$l("error", a, t);
|
1121
|
-
}), c;
|
1122
|
-
}, Q.success = q("success"), Q.info = q("info"), Q.error = q("error"), Q.warning = q("warning"), Q.warn = Q.warning, Q.dark = function(t, e) {
|
1123
|
-
return H(t, S("default", _object_spread$1({
|
1124
|
-
theme: "dark"
|
1125
|
-
}, e)));
|
1126
|
-
}, Q.dismiss = function(t) {
|
1127
|
-
B.size > 0 ? v.emit(1, t) : D = D.filter(function(e) {
|
1128
|
-
return null != t && e.options.toastId !== t;
|
1129
|
-
});
|
1130
|
-
}, Q.clearWaitingQueue = function(t) {
|
1131
|
-
return void 0 === t && (t = {}), v.emit(5, t);
|
1132
|
-
}, Q.isActive = function(t) {
|
1133
|
-
var e = !1;
|
1134
|
-
return B.forEach(function(n) {
|
1135
|
-
n.isToastActive && n.isToastActive(t) && (e = !0);
|
1136
|
-
}), e;
|
1137
|
-
}, Q.update = function(t, e) {
|
1138
|
-
void 0 === e && (e = {}), setTimeout(function() {
|
1139
|
-
var n = function(t, e) {
|
1140
|
-
var n = e.containerId;
|
1141
|
-
var o = B.get(n || P);
|
1142
|
-
return o && o.getToast(t);
|
1143
|
-
}(t, e);
|
1144
|
-
if (n) {
|
1145
|
-
var o = n.props, s = n.content, a = _object_spread_props(_object_spread$1({
|
1146
|
-
delay: 100
|
1147
|
-
}, o, e), {
|
1148
|
-
toastId: e.toastId || t,
|
1149
|
-
updateId: z()
|
1150
|
-
});
|
1151
|
-
a.toastId !== t && (a.staleId = t);
|
1152
|
-
var r = a.render || s;
|
1153
|
-
delete a.render, H(r, a);
|
1154
|
-
}
|
1155
|
-
}, 0);
|
1156
|
-
}, Q.done = function(t) {
|
1157
|
-
Q.update(t, {
|
1158
|
-
progress: 1
|
1159
|
-
});
|
1160
|
-
}, Q.onChange = function(t) {
|
1161
|
-
return v.on(4, t), function() {
|
1162
|
-
v.off(4, t);
|
1163
|
-
};
|
1164
|
-
}, Q.POSITION = {
|
1165
|
-
TOP_LEFT: "top-left",
|
1166
|
-
TOP_RIGHT: "top-right",
|
1167
|
-
TOP_CENTER: "top-center",
|
1168
|
-
BOTTOM_LEFT: "bottom-left",
|
1169
|
-
BOTTOM_RIGHT: "bottom-right",
|
1170
|
-
BOTTOM_CENTER: "bottom-center"
|
1171
|
-
}, Q.TYPE = {
|
1172
|
-
INFO: "info",
|
1173
|
-
SUCCESS: "success",
|
1174
|
-
WARNING: "warning",
|
1175
|
-
ERROR: "error",
|
1176
|
-
DEFAULT: "default"
|
1177
|
-
}, v.on(2, function(t) {
|
1178
|
-
P = t.containerId || t, B.set(P, t), D.forEach(function(t) {
|
1179
|
-
v.emit(0, t.content, t.options);
|
1180
|
-
}), D = [];
|
1181
|
-
}).on(3, function(t) {
|
1182
|
-
B.delete(t.containerId || t), 0 === B.size && v.off(0).off(1).off(5);
|
1183
|
-
});
|
1184
|
-
|
1185
|
-
function _array_like_to_array(arr, len) {
|
1186
|
-
if (len == null || len > arr.length) len = arr.length;
|
1187
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
1188
|
-
return arr2;
|
1189
|
-
}
|
1190
|
-
function _array_without_holes(arr) {
|
1191
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
1192
|
-
}
|
1193
|
-
function _define_property(obj, key, value) {
|
1194
|
-
if (key in obj) {
|
1195
|
-
Object.defineProperty(obj, key, {
|
1196
|
-
value: value,
|
1197
|
-
enumerable: true,
|
1198
|
-
configurable: true,
|
1199
|
-
writable: true
|
1200
|
-
});
|
1201
|
-
} else {
|
1202
|
-
obj[key] = value;
|
1203
|
-
}
|
1204
|
-
return obj;
|
1205
|
-
}
|
1206
|
-
function _iterable_to_array(iter) {
|
1207
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
1208
|
-
}
|
1209
|
-
function _non_iterable_spread() {
|
1210
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
1211
|
-
}
|
1212
|
-
function _object_spread(target) {
|
1213
|
-
for(var i = 1; i < arguments.length; i++){
|
1214
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
1215
|
-
var ownKeys = Object.keys(source);
|
1216
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
1217
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
1218
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
1219
|
-
}));
|
1220
|
-
}
|
1221
|
-
ownKeys.forEach(function(key) {
|
1222
|
-
_define_property(target, key, source[key]);
|
1223
|
-
});
|
1224
|
-
}
|
1225
|
-
return target;
|
1226
|
-
}
|
1227
|
-
function _to_consumable_array(arr) {
|
1228
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
1229
|
-
}
|
1230
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
1231
|
-
if (!o) return;
|
1232
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
1233
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
1234
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
1235
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
1236
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
1237
|
-
}
|
1238
|
-
var defaultOptions = {
|
1239
|
-
showSuccessMsg: true,
|
1240
|
-
showErrorMsg: true,
|
1241
|
-
successMsg: undefined,
|
1242
|
-
errorMsg: undefined,
|
1243
|
-
onSuccess: undefined,
|
1244
|
-
onError: undefined,
|
1245
|
-
processInput: undefined
|
1246
|
-
};
|
1247
|
-
function useMutate(mutation, options) {
|
1248
|
-
var mergedOptions = _object_spread({}, defaultOptions, options !== null && options !== void 0 ? options : {});
|
1249
|
-
var mutate = React__default["default"].useCallback(function(values) {
|
1250
|
-
mutation.reset();
|
1251
|
-
var _runIfFn;
|
1252
|
-
// Return the mutation so that Formik can update submitting state
|
1253
|
-
return mutation.mutateAsync((_runIfFn = runIfFn(mergedOptions.processInput, values)) !== null && _runIfFn !== void 0 ? _runIfFn : values).then(function(result) {
|
1254
|
-
var _mergedOptions_onSuccess;
|
1255
|
-
if (mergedOptions.showSuccessMsg && mergedOptions.successMsg) Q.success(runIfFn(mergedOptions.successMsg, result, values));
|
1256
|
-
(_mergedOptions_onSuccess = mergedOptions.onSuccess) === null || _mergedOptions_onSuccess === void 0 ? void 0 : _mergedOptions_onSuccess.call(mergedOptions, result);
|
1257
|
-
return result;
|
1258
|
-
}).catch(function(error) {
|
1259
|
-
var _mergedOptions_onError;
|
1260
|
-
if (mergedOptions.showErrorMsg) {
|
1261
|
-
var _runIfFn;
|
1262
|
-
Q.error((_runIfFn = runIfFn(mergedOptions.errorMsg, error, values)) !== null && _runIfFn !== void 0 ? _runIfFn : "Oops, something went wrong :(");
|
1263
|
-
}
|
1264
|
-
(_mergedOptions_onError = mergedOptions.onError) === null || _mergedOptions_onError === void 0 ? void 0 : _mergedOptions_onError.call(mergedOptions, error);
|
1265
|
-
});
|
1266
|
-
}, [
|
1267
|
-
mutation,
|
1268
|
-
options
|
1269
|
-
]);
|
1270
|
-
return mutate;
|
1271
|
-
}
|
1272
|
-
function isFunction(value) {
|
1273
|
-
return typeof value === "function";
|
1274
|
-
}
|
1275
|
-
function runIfFn(valueOrFn) {
|
1276
|
-
for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
1277
|
-
args[_key - 1] = arguments[_key];
|
1278
|
-
}
|
1279
|
-
return isFunction(valueOrFn) ? valueOrFn.apply(void 0, _to_consumable_array(args)) : valueOrFn;
|
1280
|
-
}
|
1281
|
-
|
1282
163
|
function InvalidateButton(_a) {
|
1283
164
|
var {
|
1284
165
|
pathOrPermalink
|
1285
166
|
} = _a,
|
1286
|
-
props = __rest(_a, ["pathOrPermalink"]);
|
1287
|
-
const api = adminApi.INVALIDATE_API.new(pathOrPermalink);
|
1288
|
-
const mutation = useApiMutation(api.invalidate, api.queryKey);
|
1289
|
-
const invalidate = useMutate(mutation, {
|
167
|
+
props = __rest$1(_a, ["pathOrPermalink"]);
|
168
|
+
const api$1 = adminApi.INVALIDATE_API.new(pathOrPermalink);
|
169
|
+
const mutation = api.useApiMutation(api$1.invalidate, api$1.queryKey);
|
170
|
+
const invalidate = api.useMutate(mutation, {
|
1290
171
|
successMsg: "Page successfully invalidated"
|
1291
172
|
});
|
1292
173
|
return jsxRuntime.jsx(ui.Button, Object.assign({
|
@@ -1309,7 +190,7 @@ function NavigateButton(_a) {
|
|
1309
190
|
var {
|
1310
191
|
path
|
1311
192
|
} = _a,
|
1312
|
-
props = __rest(_a, ["path"]);
|
193
|
+
props = __rest$1(_a, ["path"]);
|
1313
194
|
const navigate = reactRouterDom.useNavigate();
|
1314
195
|
const handleClick = React__default["default"].useCallback(() => {
|
1315
196
|
navigate(path);
|
@@ -1333,11 +214,11 @@ function PublishButton(_a) {
|
|
1333
214
|
var {
|
1334
215
|
status,
|
1335
216
|
queryId,
|
1336
|
-
api
|
217
|
+
api: api$1
|
1337
218
|
} = _a,
|
1338
|
-
props = __rest(_a, ["status", "queryId", "api"]);
|
219
|
+
props = __rest$1(_a, ["status", "queryId", "api"]);
|
1339
220
|
const isDraft = status == "draft";
|
1340
|
-
const mutation = useInvalidateMutation(isDraft ? api.publish : api.unpublish, api.queryKey, queryId, {
|
221
|
+
const mutation = api.useInvalidateMutation(isDraft ? api$1.publish : api$1.unpublish, api$1.queryKey, queryId, {
|
1341
222
|
networkMode: "always"
|
1342
223
|
});
|
1343
224
|
const publish = React__default["default"].useCallback(() => {
|
@@ -1750,7 +631,7 @@ function useHotkeys(keys, callback, options, dependencies) {
|
|
1750
631
|
|
1751
632
|
function UpdateButton(_a) {
|
1752
633
|
var _b;
|
1753
|
-
var props = __rest(_a, []);
|
634
|
+
var props = __rest$1(_a, []);
|
1754
635
|
const {
|
1755
636
|
dirty,
|
1756
637
|
handleSubmit
|
@@ -1783,7 +664,7 @@ function ViewButton(_a) {
|
|
1783
664
|
path,
|
1784
665
|
icon
|
1785
666
|
} = _a,
|
1786
|
-
props = __rest(_a, ["path", "icon"]);
|
667
|
+
props = __rest$1(_a, ["path", "icon"]);
|
1787
668
|
const openPage = React__default["default"].useCallback(() => {
|
1788
669
|
window.open(path, '_blank');
|
1789
670
|
}, [path]);
|
@@ -1803,12 +684,12 @@ function ViewButton(_a) {
|
|
1803
684
|
}
|
1804
685
|
|
1805
686
|
function OrderCell({
|
1806
|
-
api,
|
687
|
+
api: api$1,
|
1807
688
|
postId,
|
1808
689
|
order
|
1809
690
|
}) {
|
1810
|
-
const mutationDown = useInvalidateMutation(api.moveDown, api.queryKey);
|
1811
|
-
const mutationUp = useInvalidateMutation(api.moveUp, api.queryKey);
|
691
|
+
const mutationDown = api.useInvalidateMutation(api$1.moveDown, api$1.queryKey);
|
692
|
+
const mutationUp = api.useInvalidateMutation(api$1.moveUp, api$1.queryKey);
|
1812
693
|
const moveDown = React__default["default"].useCallback(e => {
|
1813
694
|
e.stopPropagation();
|
1814
695
|
mutationDown.mutateAsync(postId).catch(error => {
|
@@ -1847,7 +728,7 @@ function PageContainer(_a) {
|
|
1847
728
|
var {
|
1848
729
|
children
|
1849
730
|
} = _a,
|
1850
|
-
props = __rest(_a, ["children"]);
|
731
|
+
props = __rest$1(_a, ["children"]);
|
1851
732
|
return jsxRuntime.jsx(ui.Container, Object.assign({
|
1852
733
|
center: true,
|
1853
734
|
dflex: true,
|
@@ -1858,11 +739,68 @@ function PageContainer(_a) {
|
|
1858
739
|
}));
|
1859
740
|
}
|
1860
741
|
|
742
|
+
/******************************************************************************
|
743
|
+
Copyright (c) Microsoft Corporation.
|
744
|
+
|
745
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
746
|
+
purpose with or without fee is hereby granted.
|
747
|
+
|
748
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
749
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
750
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
751
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
752
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
753
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
754
|
+
PERFORMANCE OF THIS SOFTWARE.
|
755
|
+
***************************************************************************** */
|
756
|
+
|
757
|
+
function __rest(s, e) {
|
758
|
+
var t = {};
|
759
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
760
|
+
t[p] = s[p];
|
761
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
762
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
763
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
764
|
+
t[p[i]] = s[p[i]];
|
765
|
+
}
|
766
|
+
return t;
|
767
|
+
}
|
768
|
+
|
769
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
770
|
+
var e = new Error(message);
|
771
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
772
|
+
};
|
773
|
+
|
774
|
+
function FormEditor(_a) {
|
775
|
+
// const { initialValues } = useFormikContext();
|
776
|
+
var {
|
777
|
+
name,
|
778
|
+
placeholder
|
779
|
+
} = _a,
|
780
|
+
props = __rest(_a, ["name", "placeholder"]);
|
781
|
+
return jsxRuntime.jsx(formik.Field, {
|
782
|
+
name: name,
|
783
|
+
children: ({
|
784
|
+
field,
|
785
|
+
meta
|
786
|
+
}) => jsxRuntime.jsx(editor.Editor, Object.assign({}, props, {
|
787
|
+
// placeholder={placeholder}
|
788
|
+
defaultValue: meta.initialValue,
|
789
|
+
onChange: e => field.onChange({
|
790
|
+
target: {
|
791
|
+
name: name,
|
792
|
+
value: e
|
793
|
+
}
|
794
|
+
})
|
795
|
+
}))
|
796
|
+
});
|
797
|
+
}
|
798
|
+
|
1861
799
|
function PageMain(_a) {
|
1862
800
|
var {
|
1863
801
|
children
|
1864
802
|
} = _a,
|
1865
|
-
props = __rest(_a, ["children"]);
|
803
|
+
props = __rest$1(_a, ["children"]);
|
1866
804
|
return jsxRuntime.jsx(ui.Tile, Object.assign({
|
1867
805
|
scheme: "light",
|
1868
806
|
p: "5"
|
@@ -1875,11 +813,11 @@ function PageContentEditor(_a) {
|
|
1875
813
|
var {
|
1876
814
|
name
|
1877
815
|
} = _a,
|
1878
|
-
props = __rest(_a, ["name"]);
|
816
|
+
props = __rest$1(_a, ["name"]);
|
1879
817
|
return jsxRuntime.jsx(PageMain, Object.assign({
|
1880
818
|
h: "min"
|
1881
819
|
}, props, {
|
1882
|
-
children: jsxRuntime.jsx(
|
820
|
+
children: jsxRuntime.jsx(FormEditor, {
|
1883
821
|
minH: "128",
|
1884
822
|
minW: "144",
|
1885
823
|
name: name,
|
@@ -1891,19 +829,19 @@ function PageContentEditor(_a) {
|
|
1891
829
|
function PageQueryStateContainerInner(_a) {
|
1892
830
|
var {
|
1893
831
|
queryId,
|
1894
|
-
api,
|
832
|
+
api: api$1,
|
1895
833
|
apiFn,
|
1896
834
|
loadingStyles,
|
1897
835
|
errorStyles,
|
1898
836
|
children
|
1899
837
|
} = _a,
|
1900
|
-
props = __rest(_a, ["queryId", "api", "apiFn", "loadingStyles", "errorStyles", "children"]);
|
838
|
+
props = __rest$1(_a, ["queryId", "api", "apiFn", "loadingStyles", "errorStyles", "children"]);
|
1901
839
|
const {
|
1902
840
|
data,
|
1903
841
|
isLoading,
|
1904
842
|
isError
|
1905
|
-
} = apiFn == "get" ? useApiQuery(api.queryKey, api.get, queryId) : useApiQuery(api.queryKey, api.getAll);
|
1906
|
-
const invalidate = useInvalidateQuery(api.queryKey, queryId);
|
843
|
+
} = apiFn == "get" ? api.useApiQuery(api$1.queryKey, api$1.get, queryId) : api.useApiQuery(api$1.queryKey, api$1.getAll);
|
844
|
+
const invalidate = api.useInvalidateQuery(api$1.queryKey, queryId);
|
1907
845
|
if (isLoading) return jsxRuntime.jsx(components.QueryLoadingState, Object.assign({
|
1908
846
|
w: "full",
|
1909
847
|
h: "100%"
|
@@ -1922,7 +860,7 @@ function PageSidebar(_a) {
|
|
1922
860
|
var {
|
1923
861
|
children
|
1924
862
|
} = _a,
|
1925
|
-
props = __rest(_a, ["children"]);
|
863
|
+
props = __rest$1(_a, ["children"]);
|
1926
864
|
return jsxRuntime.jsx("div", Object.assign({
|
1927
865
|
w: "112",
|
1928
866
|
minW: "112",
|
@@ -1940,7 +878,7 @@ function PageSidebarSection(_a) {
|
|
1940
878
|
title,
|
1941
879
|
children
|
1942
880
|
} = _a,
|
1943
|
-
props = __rest(_a, ["title", "children"]);
|
881
|
+
props = __rest$1(_a, ["title", "children"]);
|
1944
882
|
return jsxRuntime.jsxs("div", Object.assign({
|
1945
883
|
w: "full",
|
1946
884
|
bgColor: "white",
|
@@ -1958,7 +896,7 @@ function PageTitle(_a) {
|
|
1958
896
|
var {
|
1959
897
|
children
|
1960
898
|
} = _a;
|
1961
|
-
__rest(_a, ["children"]);
|
899
|
+
__rest$1(_a, ["children"]);
|
1962
900
|
return jsxRuntime.jsx("div", {
|
1963
901
|
trait: "typo.h5",
|
1964
902
|
children: children
|
@@ -1971,7 +909,7 @@ function PageTopBar(_a) {
|
|
1971
909
|
breadcrumbs,
|
1972
910
|
children
|
1973
911
|
} = _a,
|
1974
|
-
props = __rest(_a, ["title", "breadcrumbs", "children"]);
|
912
|
+
props = __rest$1(_a, ["title", "breadcrumbs", "children"]);
|
1975
913
|
return jsxRuntime.jsxs(components.FlexCenter, Object.assign({
|
1976
914
|
gap: "3",
|
1977
915
|
minH: "9"
|
@@ -2004,7 +942,7 @@ function PageTabbedTopBar(_a) {
|
|
2004
942
|
breadcrumbs,
|
2005
943
|
children
|
2006
944
|
} = _a,
|
2007
|
-
props = __rest(_a, ["title", "breadcrumbs", "children"]);
|
945
|
+
props = __rest$1(_a, ["title", "breadcrumbs", "children"]);
|
2008
946
|
const ref = /*#__PURE__*/React__default["default"].createRef();
|
2009
947
|
const {
|
2010
948
|
setContainerEl
|
@@ -2147,7 +1085,7 @@ function DetailsView(_a) {
|
|
2147
1085
|
screen,
|
2148
1086
|
tabbed
|
2149
1087
|
} = _a,
|
2150
|
-
props = __rest(_a, ["queryField", "api", "processInput", "screen", "tabbed"]);
|
1088
|
+
props = __rest$1(_a, ["queryField", "api", "processInput", "screen", "tabbed"]);
|
2151
1089
|
const {
|
2152
1090
|
[queryField]: id
|
2153
1091
|
} = reactRouterDom.useParams();
|
@@ -2172,7 +1110,7 @@ function DetailsView(_a) {
|
|
2172
1110
|
function Internal({
|
2173
1111
|
item,
|
2174
1112
|
screen,
|
2175
|
-
api,
|
1113
|
+
api: api$1,
|
2176
1114
|
processInput,
|
2177
1115
|
tabbed,
|
2178
1116
|
containerRef
|
@@ -2189,16 +1127,16 @@ function Internal({
|
|
2189
1127
|
type,
|
2190
1128
|
invalidateParentQueryKey
|
2191
1129
|
} = react.runIfFn(screen, item);
|
2192
|
-
const mutation = useInvalidateParentMutation(api.update, invalidateParentQueryKey !== null && invalidateParentQueryKey !== void 0 ? invalidateParentQueryKey : api.queryKey, {
|
1130
|
+
const mutation = api.useInvalidateParentMutation(api$1.update, invalidateParentQueryKey !== null && invalidateParentQueryKey !== void 0 ? invalidateParentQueryKey : api$1.queryKey, {
|
2193
1131
|
networkMode: "always"
|
2194
1132
|
});
|
2195
|
-
const save = useMutate(mutation, {
|
1133
|
+
const save = api.useMutate(mutation, {
|
2196
1134
|
processInput,
|
2197
1135
|
successMsg: (item, values) => `${item.title} updated.`,
|
2198
1136
|
errorMsg: (error, item) => `Error updating ${item.title}: ${error}`
|
2199
1137
|
});
|
2200
1138
|
let editorMaxW = undefined;
|
2201
|
-
if (type == "post") editorMaxW = "calc(1280px -
|
1139
|
+
if (!type || type == "post") editorMaxW = "calc(1280px - 28rem)";else if (type == "section") editorMaxW = "calc(1280px - 22rem)";
|
2202
1140
|
return jsxRuntime.jsxs(form.FormProvider, {
|
2203
1141
|
initialValues: react.runIfFn(initialValues, item),
|
2204
1142
|
validationSchema: schema,
|
@@ -2206,7 +1144,7 @@ function Internal({
|
|
2206
1144
|
enableReinitialize: true,
|
2207
1145
|
children: [jsxRuntime.jsx(ScreenTopBar, {
|
2208
1146
|
tabbed: tabbed,
|
2209
|
-
api: api,
|
1147
|
+
api: api$1,
|
2210
1148
|
breadcrumbs: breadcrumbs,
|
2211
1149
|
buttonBar: buttonBar,
|
2212
1150
|
item: item,
|
@@ -2281,21 +1219,21 @@ function useApi(api, queryField) {
|
|
2281
1219
|
}
|
2282
1220
|
function QueryWrapper(_a) {
|
2283
1221
|
var {
|
2284
|
-
api,
|
1222
|
+
api: api$1,
|
2285
1223
|
queryField,
|
2286
1224
|
fn,
|
2287
1225
|
transformFn,
|
2288
1226
|
config,
|
2289
1227
|
tabbed
|
2290
1228
|
} = _a,
|
2291
|
-
props = __rest(_a, ["api", "queryField", "fn", "transformFn", "config", "tabbed"]);
|
1229
|
+
props = __rest$1(_a, ["api", "queryField", "fn", "transformFn", "config", "tabbed"]);
|
2292
1230
|
const {
|
2293
1231
|
id,
|
2294
1232
|
api: mApi
|
2295
|
-
} = useApi(api, queryField);
|
1233
|
+
} = useApi(api$1, queryField);
|
2296
1234
|
const {
|
2297
1235
|
data
|
2298
|
-
} = useApiQuery(mApi.queryKey, fn === "get" || fn === "getTransformed" ? mApi.get : mApi.getAll, react.isFunction(api) ? undefined : id);
|
1236
|
+
} = api.useApiQuery(mApi.queryKey, fn === "get" || fn === "getTransformed" ? mApi.get : mApi.getAll, react.isFunction(api$1) ? undefined : id);
|
2299
1237
|
const transformedData = React__default["default"].useMemo(() => {
|
2300
1238
|
if (data && (fn === "getTransformed" || fn === "getAllTransformed")) {
|
2301
1239
|
if (!transformFn) console.warn(`QueryWrapperDialog: you forgot to pass transformFn as parameter for fn ${fn}`);
|
@@ -2317,7 +1255,7 @@ function TabbedView(_a) {
|
|
2317
1255
|
api,
|
2318
1256
|
screen
|
2319
1257
|
} = _a;
|
2320
|
-
__rest(_a, ["queryField", "api", "screen"]);
|
1258
|
+
__rest$1(_a, ["queryField", "api", "screen"]);
|
2321
1259
|
const {
|
2322
1260
|
[queryField]: id
|
2323
1261
|
} = reactRouterDom.useParams();
|
@@ -2413,7 +1351,7 @@ function TableContainer(_a) {
|
|
2413
1351
|
columns,
|
2414
1352
|
children
|
2415
1353
|
} = _a,
|
2416
|
-
props = __rest(_a, ["initialPageSize", "initialVisibleColumns", "columns", "children"]);
|
1354
|
+
props = __rest$1(_a, ["initialPageSize", "initialVisibleColumns", "columns", "children"]);
|
2417
1355
|
return jsxRuntime.jsx(ui.Tile, Object.assign({
|
2418
1356
|
scheme: "light",
|
2419
1357
|
shadow: true,
|
@@ -2439,7 +1377,7 @@ function TableCreateButton(_a) {
|
|
2439
1377
|
var {
|
2440
1378
|
children
|
2441
1379
|
} = _a,
|
2442
|
-
props = __rest(_a, ["children"]);
|
1380
|
+
props = __rest$1(_a, ["children"]);
|
2443
1381
|
return jsxRuntime.jsx(DialogButton, Object.assign({
|
2444
1382
|
scheme: "default",
|
2445
1383
|
corners: "pill",
|
@@ -2453,7 +1391,7 @@ function TableCreateButton(_a) {
|
|
2453
1391
|
}
|
2454
1392
|
|
2455
1393
|
function TableFilterButton(_a) {
|
2456
|
-
var props = __rest(_a, []);
|
1394
|
+
var props = __rest$1(_a, []);
|
2457
1395
|
// return <Button scheme="secondary" {...props}><Icon path={mdiFilter} /></Button>
|
2458
1396
|
return jsxRuntime.jsxs(ui.Popover, {
|
2459
1397
|
side: "bottom-end",
|
@@ -2501,8 +1439,8 @@ function TableTopBar(_a) {
|
|
2501
1439
|
queryKey,
|
2502
1440
|
children
|
2503
1441
|
} = _a,
|
2504
|
-
props = __rest(_a, ["title", "queryKey", "children"]);
|
2505
|
-
const invalidate = useInvalidateQuery(queryKey);
|
1442
|
+
props = __rest$1(_a, ["title", "queryKey", "children"]);
|
1443
|
+
const invalidate = api.useInvalidateQuery(queryKey);
|
2506
1444
|
useHotkeys('ctrl+r', () => invalidate(), {
|
2507
1445
|
preventDefault: true
|
2508
1446
|
}, [invalidate]);
|
@@ -2560,7 +1498,7 @@ function ItemEditDialog$1(_a) {
|
|
2560
1498
|
initialValues,
|
2561
1499
|
itemLabel,
|
2562
1500
|
queryId = "",
|
2563
|
-
api,
|
1501
|
+
api: api$1,
|
2564
1502
|
queryFetchOptions,
|
2565
1503
|
querySaveOptions,
|
2566
1504
|
onSuccess,
|
@@ -2582,7 +1520,7 @@ function ItemEditDialog$1(_a) {
|
|
2582
1520
|
onClose,
|
2583
1521
|
formikProps
|
2584
1522
|
} = _a,
|
2585
|
-
props = __rest(_a, ["initialValues", "itemLabel", "queryId", "api", "queryFetchOptions", "querySaveOptions", "onSuccess", "onFetchError", "fetchErrorMsg", "onSaveError", "saveErrorMsg", "fetchToFormData", "formToQueryData", "invalidateQueriesOnSuccess", "invalidateQueryKey", "retryText", "cancelLabel", "saveLabel", "size", "title", "form", "show", "onClose", "formikProps"]);
|
1523
|
+
props = __rest$1(_a, ["initialValues", "itemLabel", "queryId", "api", "queryFetchOptions", "querySaveOptions", "onSuccess", "onFetchError", "fetchErrorMsg", "onSaveError", "saveErrorMsg", "fetchToFormData", "formToQueryData", "invalidateQueriesOnSuccess", "invalidateQueryKey", "retryText", "cancelLabel", "saveLabel", "size", "title", "form", "show", "onClose", "formikProps"]);
|
2586
1524
|
const {
|
2587
1525
|
isInitialLoading,
|
2588
1526
|
isFetching,
|
@@ -2590,13 +1528,13 @@ function ItemEditDialog$1(_a) {
|
|
2590
1528
|
isError,
|
2591
1529
|
error /*, error*/,
|
2592
1530
|
refetch
|
2593
|
-
} = useApiQuery(api.queryKey, api.get, queryId, Object.assign({
|
1531
|
+
} = api.useApiQuery(api$1.queryKey, api$1.get, queryId, Object.assign({
|
2594
1532
|
enabled: !( /*queryId == 0 || */queryId == "" || queryId == null || queryId == undefined),
|
2595
1533
|
onError: onFetchError
|
2596
1534
|
}, queryFetchOptions));
|
2597
1535
|
// const [activeTab, setActiveTab] = React.useState(form && Array.isArray(form) ? form[0].key : "");
|
2598
1536
|
// const [showTab, setShowTab] = React.useState(true);
|
2599
|
-
const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(api.upsert, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey, querySaveOptions) : useApiMutation(api.upsert, api.queryKey, queryId, querySaveOptions);
|
1537
|
+
const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(api$1.upsert, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey, querySaveOptions) : api.useApiMutation(api$1.upsert, api$1.queryKey, queryId, querySaveOptions);
|
2600
1538
|
const retry = React__default["default"].useCallback(() => refetch(), [refetch]);
|
2601
1539
|
const saveItem = React__default["default"].useCallback((item, actions) => __awaiter(this, void 0, void 0, function* () {
|
2602
1540
|
// Clear mutation error if any
|
@@ -2698,7 +1636,7 @@ function ItemEditDialog$1(_a) {
|
|
2698
1636
|
}
|
2699
1637
|
|
2700
1638
|
function QueryWrapperDialog({
|
2701
|
-
api,
|
1639
|
+
api: api$1,
|
2702
1640
|
fn,
|
2703
1641
|
transformFn,
|
2704
1642
|
config,
|
@@ -2709,7 +1647,7 @@ function QueryWrapperDialog({
|
|
2709
1647
|
const {
|
2710
1648
|
data,
|
2711
1649
|
isFetching
|
2712
|
-
} = useApiQuery(api.queryKey, fn === "get" || fn === "getTransformed" ? api.get : api.getAll, undefined, {
|
1650
|
+
} = api.useApiQuery(api$1.queryKey, fn === "get" || fn === "getTransformed" ? api$1.get : api$1.getAll, undefined, {
|
2713
1651
|
retryOnMount: false,
|
2714
1652
|
refetchOnMount: false,
|
2715
1653
|
refetchOnWindowFocus: false
|
@@ -2743,7 +1681,7 @@ function MultiQueryWrapperDialog({
|
|
2743
1681
|
data,
|
2744
1682
|
isFetching,
|
2745
1683
|
isError
|
2746
|
-
} = useApiQueries(queries.map(q => ({
|
1684
|
+
} = api.useApiQueries(queries.map(q => ({
|
2747
1685
|
queryKey: q.api.queryKey,
|
2748
1686
|
queryFn: q.fn == "get" ? q.api.get : q.api.getAll,
|
2749
1687
|
queryOptions: {
|
@@ -2778,7 +1716,7 @@ function DialogRenderer({
|
|
2778
1716
|
invalidateQueryKey,
|
2779
1717
|
queryId
|
2780
1718
|
}) {
|
2781
|
-
const props = __rest(config, ["type"]);
|
1719
|
+
const props = __rest$1(config, ["type"]);
|
2782
1720
|
if (config.type === "dialog") return jsxRuntime.jsx(ItemEditDialog$1, Object.assign({}, props, {
|
2783
1721
|
queryId: queryId,
|
2784
1722
|
invalidateQueryKey: invalidateQueryKey,
|
@@ -2802,16 +1740,16 @@ function ItemDeleteDialog(_a) {
|
|
2802
1740
|
var {
|
2803
1741
|
itemLabel,
|
2804
1742
|
queryId = "",
|
2805
|
-
api,
|
1743
|
+
api: api$1,
|
2806
1744
|
invalidateQueriesOnSuccess = true,
|
2807
1745
|
invalidateQueryKey,
|
2808
1746
|
size = "lg",
|
2809
1747
|
show,
|
2810
1748
|
onClose
|
2811
1749
|
} = _a,
|
2812
|
-
props = __rest(_a, ["itemLabel", "queryId", "api", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "show", "onClose"]);
|
2813
|
-
const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(api.delete, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey) : useApiMutation(api.upsert, api.queryKey);
|
2814
|
-
const mutate = useMutate(mutation, {
|
1750
|
+
props = __rest$1(_a, ["itemLabel", "queryId", "api", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "show", "onClose"]);
|
1751
|
+
const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(api$1.delete, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey) : api.useApiMutation(api$1.upsert, api$1.queryKey);
|
1752
|
+
const mutate = api.useMutate(mutation, {
|
2815
1753
|
onSuccess: () => onClose === null || onClose === void 0 ? void 0 : onClose()
|
2816
1754
|
});
|
2817
1755
|
const handleDelete = React__default["default"].useCallback(() => mutate(queryId), [mutate, queryId]);
|
@@ -2987,13 +1925,13 @@ function createColumnHelper() {
|
|
2987
1925
|
function TableRowPublishPostButton$1(_a) {
|
2988
1926
|
var {
|
2989
1927
|
id,
|
2990
|
-
api,
|
1928
|
+
api: api$1,
|
2991
1929
|
status,
|
2992
1930
|
invalidateQueryKey
|
2993
1931
|
} = _a,
|
2994
|
-
props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
|
1932
|
+
props = __rest$1(_a, ["id", "api", "status", "invalidateQueryKey"]);
|
2995
1933
|
const isDraft = status == "draft";
|
2996
|
-
const mutation = useInvalidateParentMutation(isDraft ? api.publish : api.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey, {
|
1934
|
+
const mutation = api.useInvalidateParentMutation(isDraft ? api$1.publish : api$1.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey, {
|
2997
1935
|
networkMode: "always"
|
2998
1936
|
});
|
2999
1937
|
const publish = React__default["default"].useCallback(event => {
|
@@ -3050,7 +1988,7 @@ function ActionButton$1(_a) {
|
|
3050
1988
|
var {
|
3051
1989
|
onClick
|
3052
1990
|
} = _a,
|
3053
|
-
props = __rest(_a, ["onClick"]);
|
1991
|
+
props = __rest$1(_a, ["onClick"]);
|
3054
1992
|
const handleClick = React__default["default"].useCallback(event => {
|
3055
1993
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
3056
1994
|
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
@@ -3091,7 +2029,7 @@ function useTableProps(api, table, rowActions) {
|
|
3091
2029
|
onRowClick,
|
3092
2030
|
columns: c
|
3093
2031
|
} = table,
|
3094
|
-
props = __rest(table, ["onRowClick", "columns"]);
|
2032
|
+
props = __rest$1(table, ["onRowClick", "columns"]);
|
3095
2033
|
const onRowClickHandler = React__default["default"].useCallback(item => {
|
3096
2034
|
if ((onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick.type) === "navigate") navigate(react.runIfFn(onRowClick.path, item));else if ((onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick.type) == "link") openLink(`${process.env["NEXT_PUBLIC_WEBSITE_URL"]}/${react.runIfFn(onRowClick.path, item)}`);
|
3097
2035
|
}, [navigate, onRowClick]);
|
@@ -3488,8 +2426,8 @@ function ActionButton({
|
|
3488
2426
|
errorMsg,
|
3489
2427
|
invalidateParent
|
3490
2428
|
}) {
|
3491
|
-
const mutation = invalidateParent ? useInvalidateParentMutation(queryFn, queryKey) : useApiMutation(queryFn, queryKey);
|
3492
|
-
const mutate = useMutate(mutation, {
|
2429
|
+
const mutation = invalidateParent ? api.useInvalidateParentMutation(queryFn, queryKey) : api.useApiMutation(queryFn, queryKey);
|
2430
|
+
const mutate = api.useMutate(mutation, {
|
3493
2431
|
successMsg,
|
3494
2432
|
errorMsg
|
3495
2433
|
});
|
@@ -3552,7 +2490,7 @@ function TableView(_a) {
|
|
3552
2490
|
subtitle,
|
3553
2491
|
screen
|
3554
2492
|
} = _a,
|
3555
|
-
props = __rest(_a, ["queryField", "title", "subtitle", "screen"]);
|
2493
|
+
props = __rest$1(_a, ["queryField", "title", "subtitle", "screen"]);
|
3556
2494
|
const id = useId(queryField);
|
3557
2495
|
const _screen = react.runIfFn(screen, id);
|
3558
2496
|
return jsxRuntime.jsx(PageContainer, Object.assign({
|
@@ -3688,7 +2626,7 @@ function useQueries(queries) {
|
|
3688
2626
|
data,
|
3689
2627
|
isFetching,
|
3690
2628
|
isError
|
3691
|
-
} = useApiQueries(queries.map(q => {
|
2629
|
+
} = api.useApiQueries(queries.map(q => {
|
3692
2630
|
if (!q.queryField || !react.isFunction(q.api)) {
|
3693
2631
|
const _api = q.api;
|
3694
2632
|
return {
|
@@ -3744,7 +2682,7 @@ function MultiQueryWrapper(_a) {
|
|
3744
2682
|
config,
|
3745
2683
|
tabbed
|
3746
2684
|
} = _a,
|
3747
|
-
props = __rest(_a, ["queries", "config", "tabbed"]);
|
2685
|
+
props = __rest$1(_a, ["queries", "config", "tabbed"]);
|
3748
2686
|
const {
|
3749
2687
|
data,
|
3750
2688
|
isFetching,
|
@@ -3772,7 +2710,7 @@ function ScreenRenderer(_a) {
|
|
3772
2710
|
config,
|
3773
2711
|
tabbed
|
3774
2712
|
} = _a,
|
3775
|
-
props = __rest(_a, ["config", "tabbed"]);
|
2713
|
+
props = __rest$1(_a, ["config", "tabbed"]);
|
3776
2714
|
if (config.type === "table") return jsxRuntime.jsx(TableView, Object.assign({}, config, props));
|
3777
2715
|
if (config.type === "tabbed") return jsxRuntime.jsx(TabbedView, Object.assign({}, config, props));
|
3778
2716
|
if (config.type === "details") return jsxRuntime.jsx(DetailsView, Object.assign({}, config, {
|
@@ -3813,7 +2751,7 @@ function AttachDialog(_a) {
|
|
3813
2751
|
formikProps,
|
3814
2752
|
getItemName
|
3815
2753
|
} = _a,
|
3816
|
-
props = __rest(_a, ["queryId", "queryKey", "queryFetchFn", "queryFetchAllKey", "queryFetchAllFn", "querySaveFn", "matchKey", "size", "show", "onClose", "itemLabel", "onSuccess", "onFetchError", "fetchErrorMsg", "onSaveError", "saveErrorMsg", "invalidateQueriesOnSuccess", "retryText", "cancelLabel", "saveLabel", "formikProps", "getItemName"]);
|
2754
|
+
props = __rest$1(_a, ["queryId", "queryKey", "queryFetchFn", "queryFetchAllKey", "queryFetchAllFn", "querySaveFn", "matchKey", "size", "show", "onClose", "itemLabel", "onSuccess", "onFetchError", "fetchErrorMsg", "onSaveError", "saveErrorMsg", "invalidateQueriesOnSuccess", "retryText", "cancelLabel", "saveLabel", "formikProps", "getItemName"]);
|
3817
2755
|
const queryClient = reactQuery.useQueryClient();
|
3818
2756
|
const {
|
3819
2757
|
data: attached,
|
@@ -3821,18 +2759,18 @@ function AttachDialog(_a) {
|
|
3821
2759
|
isError: fetchError,
|
3822
2760
|
refetch,
|
3823
2761
|
error
|
3824
|
-
} = useApiQuery(queryKey, queryFetchFn);
|
2762
|
+
} = api.useApiQuery(queryKey, queryFetchFn);
|
3825
2763
|
const {
|
3826
2764
|
data,
|
3827
2765
|
isInitialLoading: fetchAllLoading,
|
3828
2766
|
isError: fetchAllError,
|
3829
2767
|
refetch: refetchAll,
|
3830
2768
|
error: errorAll
|
3831
|
-
} = useApiQuery(queryFetchAllKey, queryFetchAllFn);
|
2769
|
+
} = api.useApiQuery(queryFetchAllKey, queryFetchAllFn);
|
3832
2770
|
const [selectedResources, setSelectedResources] = React__default["default"].useState([]);
|
3833
2771
|
const isLoading = fetchLoading || fetchAllLoading;
|
3834
2772
|
const isError = fetchError || fetchAllError;
|
3835
|
-
const mutation = useApiMutation(querySaveFn, queryKey, queryId);
|
2773
|
+
const mutation = api.useApiMutation(querySaveFn, queryKey, queryId);
|
3836
2774
|
const handleClick = React__default["default"].useCallback(event => {
|
3837
2775
|
var _a;
|
3838
2776
|
const id = (_a = event === null || event === void 0 ? void 0 : event.currentTarget.dataset.id) !== null && _a !== void 0 ? _a : "";
|
@@ -3939,7 +2877,7 @@ function ListItem(_a) {
|
|
3939
2877
|
value,
|
3940
2878
|
checked
|
3941
2879
|
} = _a,
|
3942
|
-
props = __rest(_a, ["label", "value", "checked"]);
|
2880
|
+
props = __rest$1(_a, ["label", "value", "checked"]);
|
3943
2881
|
return jsxRuntime.jsxs("div", Object.assign({
|
3944
2882
|
dflex: true,
|
3945
2883
|
alignItems: "center",
|
@@ -3984,9 +2922,9 @@ function FormActionDialog(_a) {
|
|
3984
2922
|
onClose,
|
3985
2923
|
formikProps
|
3986
2924
|
} = _a,
|
3987
|
-
props = __rest(_a, ["initialValues", "itemLabel", "queryId", "queryKey", "queryFn", "queryOptions", "onSuccess", "successMsg", "showSuccessMsg", "onError", "errorMsg", "showErrorMsg", "processInput", "invalidateQueriesOnSuccess", "cancelLabel", "saveLabel", "size", "title", "form", "show", "onClose", "formikProps"]);
|
3988
|
-
const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(queryFn, queryKey, queryOptions) : useApiMutation(queryFn, queryKey, queryId, queryOptions);
|
3989
|
-
const mutate = useMutate(mutation, {
|
2925
|
+
props = __rest$1(_a, ["initialValues", "itemLabel", "queryId", "queryKey", "queryFn", "queryOptions", "onSuccess", "successMsg", "showSuccessMsg", "onError", "errorMsg", "showErrorMsg", "processInput", "invalidateQueriesOnSuccess", "cancelLabel", "saveLabel", "size", "title", "form", "show", "onClose", "formikProps"]);
|
2926
|
+
const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(queryFn, queryKey, queryOptions) : api.useApiMutation(queryFn, queryKey, queryId, queryOptions);
|
2927
|
+
const mutate = api.useMutate(mutation, {
|
3990
2928
|
onSuccess,
|
3991
2929
|
successMsg,
|
3992
2930
|
showSuccessMsg,
|
@@ -4072,7 +3010,7 @@ function ItemEditDialog(_a) {
|
|
4072
3010
|
onClose,
|
4073
3011
|
formikProps
|
4074
3012
|
} = _a,
|
4075
|
-
props = __rest(_a, ["initialValues", "itemLabel", "queryId", "queryKey", "queryFetchFn", "queryFetchOptions", "querySaveFn", "querySaveOptions", "onSuccess", "onFetchError", "fetchErrorMsg", "onSaveError", "saveErrorMsg", "fetchToFormData", "formToQueryData", "invalidateQueriesOnSuccess", "invalidateQueryKey", "retryText", "cancelLabel", "saveLabel", "size", "title", "form", "show", "onClose", "formikProps"]);
|
3013
|
+
props = __rest$1(_a, ["initialValues", "itemLabel", "queryId", "queryKey", "queryFetchFn", "queryFetchOptions", "querySaveFn", "querySaveOptions", "onSuccess", "onFetchError", "fetchErrorMsg", "onSaveError", "saveErrorMsg", "fetchToFormData", "formToQueryData", "invalidateQueriesOnSuccess", "invalidateQueryKey", "retryText", "cancelLabel", "saveLabel", "size", "title", "form", "show", "onClose", "formikProps"]);
|
4076
3014
|
const {
|
4077
3015
|
isInitialLoading,
|
4078
3016
|
isFetching,
|
@@ -4080,13 +3018,13 @@ function ItemEditDialog(_a) {
|
|
4080
3018
|
isError,
|
4081
3019
|
error /*, error*/,
|
4082
3020
|
refetch
|
4083
|
-
} = useApiQuery(queryKey, queryFetchFn, queryId, Object.assign({
|
3021
|
+
} = api.useApiQuery(queryKey, queryFetchFn, queryId, Object.assign({
|
4084
3022
|
enabled: !( /*queryId == 0 || */queryId == "" || queryId == null || queryId == undefined),
|
4085
3023
|
onError: onFetchError
|
4086
3024
|
}, queryFetchOptions));
|
4087
3025
|
// const [activeTab, setActiveTab] = React.useState(form && Array.isArray(form) ? form[0].key : "");
|
4088
3026
|
// const [showTab, setShowTab] = React.useState(true);
|
4089
|
-
const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(querySaveFn, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : queryKey, querySaveOptions) : useApiMutation(querySaveFn, queryKey, queryId, querySaveOptions);
|
3027
|
+
const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(querySaveFn, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : queryKey, querySaveOptions) : api.useApiMutation(querySaveFn, queryKey, queryId, querySaveOptions);
|
4090
3028
|
const retry = React__default["default"].useCallback(() => refetch(), [refetch]);
|
4091
3029
|
const saveItem = React__default["default"].useCallback((item, actions) => {
|
4092
3030
|
// Clear mutation error if any
|
@@ -4188,7 +3126,7 @@ function PageSectionTitle(_a) {
|
|
4188
3126
|
var {
|
4189
3127
|
children
|
4190
3128
|
} = _a,
|
4191
|
-
props = __rest(_a, ["children"]);
|
3129
|
+
props = __rest$1(_a, ["children"]);
|
4192
3130
|
return jsxRuntime.jsx("div", Object.assign({
|
4193
3131
|
trait: "typo.h6",
|
4194
3132
|
mb: "5"
|
@@ -4202,7 +3140,7 @@ const PageStateContainer = /*#__PURE__*/React__default["default"].forwardRef((_a
|
|
4202
3140
|
loading = false,
|
4203
3141
|
children
|
4204
3142
|
} = _a,
|
4205
|
-
props = __rest(_a, ["loading", "children"]);
|
3143
|
+
props = __rest$1(_a, ["loading", "children"]);
|
4206
3144
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
4207
3145
|
children: [loading && jsxRuntime.jsx(components.QueryLoadingState, {
|
4208
3146
|
w: "full",
|
@@ -4224,7 +3162,7 @@ function PageSubSectionTitle(_a) {
|
|
4224
3162
|
var {
|
4225
3163
|
children
|
4226
3164
|
} = _a,
|
4227
|
-
props = __rest(_a, ["children"]);
|
3165
|
+
props = __rest$1(_a, ["children"]);
|
4228
3166
|
return jsxRuntime.jsx("div", Object.assign({
|
4229
3167
|
trait: "typo.h6",
|
4230
3168
|
mb: "3"
|
@@ -4253,7 +3191,7 @@ function StatusBadge(_a) {
|
|
4253
3191
|
var {
|
4254
3192
|
status
|
4255
3193
|
} = _a,
|
4256
|
-
props = __rest(_a, ["status"]);
|
3194
|
+
props = __rest$1(_a, ["status"]);
|
4257
3195
|
return jsxRuntime.jsx(ui.Badge, Object.assign({
|
4258
3196
|
size: "sm",
|
4259
3197
|
variant: "glass",
|
@@ -4270,7 +3208,7 @@ function TableRowViewButton(_a) {
|
|
4270
3208
|
var {
|
4271
3209
|
path
|
4272
3210
|
} = _a,
|
4273
|
-
props = __rest(_a, ["path"]);
|
3211
|
+
props = __rest$1(_a, ["path"]);
|
4274
3212
|
const openPage = React__default["default"].useCallback(event => {
|
4275
3213
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
4276
3214
|
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
@@ -4294,7 +3232,7 @@ function TableRowNavigateButton(_a) {
|
|
4294
3232
|
var {
|
4295
3233
|
path
|
4296
3234
|
} = _a,
|
4297
|
-
props = __rest(_a, ["path"]);
|
3235
|
+
props = __rest$1(_a, ["path"]);
|
4298
3236
|
const navigate = reactRouterDom.useNavigate();
|
4299
3237
|
const handleClick = React__default["default"].useCallback(event => {
|
4300
3238
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
@@ -4319,7 +3257,7 @@ function TableRowEditButton(_a) {
|
|
4319
3257
|
var {
|
4320
3258
|
children
|
4321
3259
|
} = _a,
|
4322
|
-
props = __rest(_a, ["children"]);
|
3260
|
+
props = __rest$1(_a, ["children"]);
|
4323
3261
|
return jsxRuntime.jsx(DialogButton, Object.assign({
|
4324
3262
|
w: "10",
|
4325
3263
|
h: "10",
|
@@ -4337,7 +3275,7 @@ function TableRowDeleteButton(_a) {
|
|
4337
3275
|
var {
|
4338
3276
|
children
|
4339
3277
|
} = _a,
|
4340
|
-
props = __rest(_a, ["children"]);
|
3278
|
+
props = __rest$1(_a, ["children"]);
|
4341
3279
|
return jsxRuntime.jsx(DialogButton, Object.assign({
|
4342
3280
|
w: "10",
|
4343
3281
|
h: "10",
|
@@ -4360,7 +3298,7 @@ function TableRowActionBar(_a) {
|
|
4360
3298
|
deleteDialog,
|
4361
3299
|
children
|
4362
3300
|
} = _a,
|
4363
|
-
props = __rest(_a, ["publishId", "viewPath", "navigatePath", "editDialog", "deleteDialog", "children"]);
|
3301
|
+
props = __rest$1(_a, ["publishId", "viewPath", "navigatePath", "editDialog", "deleteDialog", "children"]);
|
4364
3302
|
return jsxRuntime.jsxs("div", Object.assign({
|
4365
3303
|
dflex: true,
|
4366
3304
|
spaceX: "1",
|
@@ -4381,13 +3319,13 @@ function TableRowActionBar(_a) {
|
|
4381
3319
|
function TableRowPublishPostButton(_a) {
|
4382
3320
|
var {
|
4383
3321
|
id,
|
4384
|
-
api,
|
3322
|
+
api: api$1,
|
4385
3323
|
status,
|
4386
3324
|
invalidateQueryKey
|
4387
3325
|
} = _a,
|
4388
|
-
props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
|
3326
|
+
props = __rest$1(_a, ["id", "api", "status", "invalidateQueryKey"]);
|
4389
3327
|
const isDraft = status == "draft";
|
4390
|
-
const mutation = useInvalidateParentMutation(isDraft ? api.publish : api.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey, {
|
3328
|
+
const mutation = api.useInvalidateParentMutation(isDraft ? api$1.publish : api$1.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey, {
|
4391
3329
|
networkMode: "always"
|
4392
3330
|
});
|
4393
3331
|
const publish = React__default["default"].useCallback(event => {
|