@compill/admin 1.0.89 → 1.0.91
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 +71 -107
- package/index.esm.js +9 -45
- package/package.json +1 -1
- package/src/lib/json/types/DetailsView.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var tslib = require('tslib');
|
|
5
6
|
var jsxRuntime = require('@soperio/jsx-runtime');
|
|
6
7
|
var api = require('@compill/api');
|
|
7
8
|
var components = require('@compill/components');
|
|
@@ -33,53 +34,11 @@ var Link__default = /*#__PURE__*/_interopDefaultLegacy(Link);
|
|
|
33
34
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
34
35
|
var Image__default = /*#__PURE__*/_interopDefaultLegacy(Image);
|
|
35
36
|
|
|
36
|
-
/******************************************************************************
|
|
37
|
-
Copyright (c) Microsoft Corporation.
|
|
38
|
-
|
|
39
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
40
|
-
purpose with or without fee is hereby granted.
|
|
41
|
-
|
|
42
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
43
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
44
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
45
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
46
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
47
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
48
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
49
|
-
***************************************************************************** */
|
|
50
|
-
|
|
51
|
-
function __rest(s, e) {
|
|
52
|
-
var t = {};
|
|
53
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
54
|
-
t[p] = s[p];
|
|
55
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
56
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
57
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
58
|
-
t[p[i]] = s[p[i]];
|
|
59
|
-
}
|
|
60
|
-
return t;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
64
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
65
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
66
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
67
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
68
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
69
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
74
|
-
var e = new Error(message);
|
|
75
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
37
|
function SectionTitle(_a) {
|
|
79
38
|
var {
|
|
80
39
|
children
|
|
81
40
|
} = _a,
|
|
82
|
-
props = __rest(_a, ["children"]);
|
|
41
|
+
props = tslib.__rest(_a, ["children"]);
|
|
83
42
|
return jsxRuntime.jsx("h2", Object.assign({
|
|
84
43
|
textSize: "xl",
|
|
85
44
|
fontWeight: "600",
|
|
@@ -363,7 +322,7 @@ function Breadcrumbs(_a) {
|
|
|
363
322
|
var {
|
|
364
323
|
breadcrumbs
|
|
365
324
|
} = _a,
|
|
366
|
-
props = __rest(_a, ["breadcrumbs"]);
|
|
325
|
+
props = tslib.__rest(_a, ["breadcrumbs"]);
|
|
367
326
|
if (isArray(breadcrumbs)) {
|
|
368
327
|
return jsxRuntime.jsx("div", Object.assign({
|
|
369
328
|
dflex: true,
|
|
@@ -388,7 +347,7 @@ function QueryBreadcrumbs(_a) {
|
|
|
388
347
|
queryField,
|
|
389
348
|
generate
|
|
390
349
|
} = _a,
|
|
391
|
-
props = __rest(_a, ["queryFn", "queryField", "generate"]);
|
|
350
|
+
props = tslib.__rest(_a, ["queryFn", "queryField", "generate"]);
|
|
392
351
|
const params = reactRouterDom.useParams();
|
|
393
352
|
const id = queryField ? params[queryField] : undefined;
|
|
394
353
|
const {
|
|
@@ -448,7 +407,7 @@ function DialogButton(_a) {
|
|
|
448
407
|
var {
|
|
449
408
|
buildDialog
|
|
450
409
|
} = _a,
|
|
451
|
-
props = __rest(_a, ["buildDialog"]);
|
|
410
|
+
props = tslib.__rest(_a, ["buildDialog"]);
|
|
452
411
|
const [showDialog, setShowDialog] = React__default["default"].useState(false);
|
|
453
412
|
const onShowDialog = React__default["default"].useCallback(event => {
|
|
454
413
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
@@ -469,7 +428,7 @@ function ButtonBar(_a) {
|
|
|
469
428
|
var {
|
|
470
429
|
children
|
|
471
430
|
} = _a,
|
|
472
|
-
props = __rest(_a, ["children"]);
|
|
431
|
+
props = tslib.__rest(_a, ["children"]);
|
|
473
432
|
return jsxRuntime.jsx("div", Object.assign({
|
|
474
433
|
dflex: true,
|
|
475
434
|
border: "1px",
|
|
@@ -487,7 +446,7 @@ const ButtonBarButton = /*#__PURE__*/React__default["default"].forwardRef(functi
|
|
|
487
446
|
icon,
|
|
488
447
|
children
|
|
489
448
|
} = _a,
|
|
490
|
-
props = __rest(_a, ["icon", "children"]);
|
|
449
|
+
props = tslib.__rest(_a, ["icon", "children"]);
|
|
491
450
|
return jsxRuntime.jsxs(ui.Button, Object.assign({
|
|
492
451
|
scheme: "dark",
|
|
493
452
|
size: "sm",
|
|
@@ -513,7 +472,7 @@ const ButtonBarSubmitButton = /*#__PURE__*/React__default["default"].forwardRef(
|
|
|
513
472
|
icon,
|
|
514
473
|
children
|
|
515
474
|
} = _a,
|
|
516
|
-
props = __rest(_a, ["useDirty", "disabled", "icon", "children"]);
|
|
475
|
+
props = tslib.__rest(_a, ["useDirty", "disabled", "icon", "children"]);
|
|
517
476
|
const {
|
|
518
477
|
dirty,
|
|
519
478
|
handleSubmit
|
|
@@ -547,7 +506,7 @@ function ButtonBarDialogButton(_a) {
|
|
|
547
506
|
icon,
|
|
548
507
|
children
|
|
549
508
|
} = _a,
|
|
550
|
-
props = __rest(_a, ["icon", "children"]);
|
|
509
|
+
props = tslib.__rest(_a, ["icon", "children"]);
|
|
551
510
|
return jsxRuntime.jsxs(DialogButton, Object.assign({
|
|
552
511
|
scheme: "dark",
|
|
553
512
|
size: "sm",
|
|
@@ -569,7 +528,7 @@ function InvalidateButton(_a) {
|
|
|
569
528
|
var {
|
|
570
529
|
pathOrPermalink
|
|
571
530
|
} = _a,
|
|
572
|
-
props = __rest(_a, ["pathOrPermalink"]);
|
|
531
|
+
props = tslib.__rest(_a, ["pathOrPermalink"]);
|
|
573
532
|
const api$1 = adminApi.INVALIDATE_API.new(pathOrPermalink);
|
|
574
533
|
const mutation = api.useApiMutation(api$1.invalidate, api$1.queryKey);
|
|
575
534
|
const invalidate = api.useMutate(mutation, {
|
|
@@ -587,7 +546,7 @@ function NavigateButton(_a) {
|
|
|
587
546
|
var {
|
|
588
547
|
path
|
|
589
548
|
} = _a,
|
|
590
|
-
props = __rest(_a, ["path"]);
|
|
549
|
+
props = tslib.__rest(_a, ["path"]);
|
|
591
550
|
const navigate = reactRouterDom.useNavigate();
|
|
592
551
|
const handleClick = React__default["default"].useCallback(() => {
|
|
593
552
|
navigate(path);
|
|
@@ -613,7 +572,7 @@ function PublishButton(_a) {
|
|
|
613
572
|
queryId,
|
|
614
573
|
api: api$1
|
|
615
574
|
} = _a,
|
|
616
|
-
props = __rest(_a, ["status", "queryId", "api"]);
|
|
575
|
+
props = tslib.__rest(_a, ["status", "queryId", "api"]);
|
|
617
576
|
const isDraft = status == "draft";
|
|
618
577
|
const mutation = api.useInvalidateMutation(isDraft ? api$1.publish : api$1.unpublish, api$1.queryKey, queryId, {
|
|
619
578
|
networkMode: "always"
|
|
@@ -1020,7 +979,7 @@ function useHotkeys(keys, callback, options, dependencies) {
|
|
|
1020
979
|
|
|
1021
980
|
function UpdateButton(_a) {
|
|
1022
981
|
var _b;
|
|
1023
|
-
var props = __rest(_a, []);
|
|
982
|
+
var props = tslib.__rest(_a, []);
|
|
1024
983
|
const {
|
|
1025
984
|
dirty,
|
|
1026
985
|
handleSubmit
|
|
@@ -1046,7 +1005,7 @@ function ViewButton(_a) {
|
|
|
1046
1005
|
path,
|
|
1047
1006
|
icon
|
|
1048
1007
|
} = _a,
|
|
1049
|
-
props = __rest(_a, ["path", "icon"]);
|
|
1008
|
+
props = tslib.__rest(_a, ["path", "icon"]);
|
|
1050
1009
|
const openPage = React__default["default"].useCallback(() => {
|
|
1051
1010
|
window.open(path, '_blank');
|
|
1052
1011
|
}, [path]);
|
|
@@ -1105,7 +1064,7 @@ function PageContainer(_a) {
|
|
|
1105
1064
|
var {
|
|
1106
1065
|
children
|
|
1107
1066
|
} = _a,
|
|
1108
|
-
props = __rest(_a, ["children"]);
|
|
1067
|
+
props = tslib.__rest(_a, ["children"]);
|
|
1109
1068
|
return jsxRuntime.jsx(ui.Container, Object.assign({
|
|
1110
1069
|
center: true,
|
|
1111
1070
|
dflex: true,
|
|
@@ -1120,7 +1079,7 @@ function PageMain(_a) {
|
|
|
1120
1079
|
var {
|
|
1121
1080
|
children
|
|
1122
1081
|
} = _a,
|
|
1123
|
-
props = __rest(_a, ["children"]);
|
|
1082
|
+
props = tslib.__rest(_a, ["children"]);
|
|
1124
1083
|
return jsxRuntime.jsx(ui.Tile, Object.assign({
|
|
1125
1084
|
scheme: "light",
|
|
1126
1085
|
p: "5"
|
|
@@ -1133,7 +1092,7 @@ function PageContentEditor(_a) {
|
|
|
1133
1092
|
var {
|
|
1134
1093
|
name
|
|
1135
1094
|
} = _a,
|
|
1136
|
-
props = __rest(_a, ["name"]);
|
|
1095
|
+
props = tslib.__rest(_a, ["name"]);
|
|
1137
1096
|
const extensions = [editor.ImageExtension];
|
|
1138
1097
|
return jsxRuntime.jsx(PageMain, Object.assign({
|
|
1139
1098
|
h: "min"
|
|
@@ -1159,7 +1118,7 @@ function PageQueryStateContainerInner(_a) {
|
|
|
1159
1118
|
errorStyles,
|
|
1160
1119
|
children
|
|
1161
1120
|
} = _a,
|
|
1162
|
-
props = __rest(_a, ["queryId", "api", "apiFn", "loadingStyles", "errorStyles", "children"]);
|
|
1121
|
+
props = tslib.__rest(_a, ["queryId", "api", "apiFn", "loadingStyles", "errorStyles", "children"]);
|
|
1163
1122
|
// @ts-ignore
|
|
1164
1123
|
const {
|
|
1165
1124
|
data,
|
|
@@ -1185,7 +1144,7 @@ function PageSidebar(_a) {
|
|
|
1185
1144
|
var {
|
|
1186
1145
|
children
|
|
1187
1146
|
} = _a,
|
|
1188
|
-
props = __rest(_a, ["children"]);
|
|
1147
|
+
props = tslib.__rest(_a, ["children"]);
|
|
1189
1148
|
return jsxRuntime.jsx("div", Object.assign({
|
|
1190
1149
|
w: "112",
|
|
1191
1150
|
minW: "112",
|
|
@@ -1203,7 +1162,7 @@ function PageSidebarSection(_a) {
|
|
|
1203
1162
|
title,
|
|
1204
1163
|
children
|
|
1205
1164
|
} = _a,
|
|
1206
|
-
props = __rest(_a, ["title", "children"]);
|
|
1165
|
+
props = tslib.__rest(_a, ["title", "children"]);
|
|
1207
1166
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
1208
1167
|
w: "full"
|
|
1209
1168
|
}, props, {
|
|
@@ -1217,7 +1176,7 @@ function PageTitle(_a) {
|
|
|
1217
1176
|
var {
|
|
1218
1177
|
children
|
|
1219
1178
|
} = _a,
|
|
1220
|
-
props = __rest(_a, ["children"]);
|
|
1179
|
+
props = tslib.__rest(_a, ["children"]);
|
|
1221
1180
|
return jsxRuntime.jsx("div", Object.assign({
|
|
1222
1181
|
trait: "typo.h5"
|
|
1223
1182
|
}, props, {
|
|
@@ -1231,7 +1190,7 @@ function PageTopBar(_a) {
|
|
|
1231
1190
|
breadcrumbs,
|
|
1232
1191
|
children
|
|
1233
1192
|
} = _a,
|
|
1234
|
-
props = __rest(_a, ["title", "breadcrumbs", "children"]);
|
|
1193
|
+
props = tslib.__rest(_a, ["title", "breadcrumbs", "children"]);
|
|
1235
1194
|
return jsxRuntime.jsxs(components.FlexCenter, Object.assign({
|
|
1236
1195
|
gap: "3",
|
|
1237
1196
|
minH: "9"
|
|
@@ -1264,7 +1223,7 @@ function PageTabbedTopBar(_a) {
|
|
|
1264
1223
|
breadcrumbs,
|
|
1265
1224
|
children
|
|
1266
1225
|
} = _a,
|
|
1267
|
-
props = __rest(_a, ["title", "breadcrumbs", "children"]);
|
|
1226
|
+
props = tslib.__rest(_a, ["title", "breadcrumbs", "children"]);
|
|
1268
1227
|
const ref = /*#__PURE__*/React__default["default"].createRef();
|
|
1269
1228
|
const {
|
|
1270
1229
|
setContainerEl
|
|
@@ -1418,7 +1377,7 @@ function DetailsView(_a) {
|
|
|
1418
1377
|
screen,
|
|
1419
1378
|
tabbed
|
|
1420
1379
|
} = _a,
|
|
1421
|
-
props = __rest(_a, ["queryField", "api", "useNextRouter", "processInput", "screen", "tabbed"]);
|
|
1380
|
+
props = tslib.__rest(_a, ["queryField", "api", "useNextRouter", "processInput", "screen", "tabbed"]);
|
|
1422
1381
|
const id = useQueryField(queryField, useNextRouter);
|
|
1423
1382
|
const ref = React__default["default"].useRef(null);
|
|
1424
1383
|
return jsxRuntime.jsx(PageQueryStateContainer, Object.assign({
|
|
@@ -1456,15 +1415,20 @@ function Internal({
|
|
|
1456
1415
|
sections,
|
|
1457
1416
|
buttonBar,
|
|
1458
1417
|
type,
|
|
1459
|
-
invalidateParentQueryKey
|
|
1418
|
+
invalidateParentQueryKey,
|
|
1419
|
+
invalidatePage
|
|
1460
1420
|
} = pScreen;
|
|
1461
1421
|
const mutation = api.useInvalidateParentMutation(api$1.update, invalidateParentQueryKey !== null && invalidateParentQueryKey !== void 0 ? invalidateParentQueryKey : api$1.queryKey, {
|
|
1462
1422
|
networkMode: "always"
|
|
1463
1423
|
});
|
|
1424
|
+
const invalidatePageFn = adminApi.useInvalidatePage(invalidatePage || "");
|
|
1464
1425
|
const save = api.useMutate(mutation, {
|
|
1465
1426
|
processInput,
|
|
1466
1427
|
successMsg: (item, values) => `${item.title || item.name} updated.`,
|
|
1467
|
-
errorMsg: (error, item) => `Error updating ${item.title || item.name}: ${error}
|
|
1428
|
+
errorMsg: (error, item) => `Error updating ${item.title || item.name}: ${error}`,
|
|
1429
|
+
onSuccess: () => {
|
|
1430
|
+
if (invalidatePage) invalidatePageFn();
|
|
1431
|
+
}
|
|
1468
1432
|
});
|
|
1469
1433
|
let editorMaxW = undefined;
|
|
1470
1434
|
if (!type || type == "post") editorMaxW = "calc(1280px - 28rem)";else if (type == "section") editorMaxW = "calc(1280px - 22rem)";
|
|
@@ -1581,7 +1545,7 @@ function QueryWrapper(_a) {
|
|
|
1581
1545
|
config,
|
|
1582
1546
|
tabbed
|
|
1583
1547
|
} = _a,
|
|
1584
|
-
props = __rest(_a, ["api", "queryField", "fn", "transformFn", "config", "tabbed"]);
|
|
1548
|
+
props = tslib.__rest(_a, ["api", "queryField", "fn", "transformFn", "config", "tabbed"]);
|
|
1585
1549
|
const {
|
|
1586
1550
|
id,
|
|
1587
1551
|
api: mApi
|
|
@@ -1610,7 +1574,7 @@ function TabbedView(_a) {
|
|
|
1610
1574
|
api,
|
|
1611
1575
|
screen
|
|
1612
1576
|
} = _a;
|
|
1613
|
-
__rest(_a, ["queryField", "api", "screen"]);
|
|
1577
|
+
tslib.__rest(_a, ["queryField", "api", "screen"]);
|
|
1614
1578
|
const {
|
|
1615
1579
|
[queryField]: id
|
|
1616
1580
|
} = reactRouterDom.useParams();
|
|
@@ -1707,7 +1671,7 @@ function TableContainer(_a) {
|
|
|
1707
1671
|
filtersMethod = "reactRouter",
|
|
1708
1672
|
children
|
|
1709
1673
|
} = _a,
|
|
1710
|
-
props = __rest(_a, ["initialPageSize", "initialVisibleColumns", "columns", "filtersMethod", "children"]);
|
|
1674
|
+
props = tslib.__rest(_a, ["initialPageSize", "initialVisibleColumns", "columns", "filtersMethod", "children"]);
|
|
1711
1675
|
return jsxRuntime.jsx("div", Object.assign({
|
|
1712
1676
|
w: "full",
|
|
1713
1677
|
dflex: true,
|
|
@@ -1730,7 +1694,7 @@ function TableCreateButton(_a) {
|
|
|
1730
1694
|
icon,
|
|
1731
1695
|
children
|
|
1732
1696
|
} = _a,
|
|
1733
|
-
props = __rest(_a, ["icon", "children"]);
|
|
1697
|
+
props = tslib.__rest(_a, ["icon", "children"]);
|
|
1734
1698
|
return jsxRuntime.jsxs(admin.ButtonBarDialogButton, Object.assign({}, props, {
|
|
1735
1699
|
children: [jsxRuntime.jsx(ui.Icon, {
|
|
1736
1700
|
path: icon !== null && icon !== void 0 ? icon : mdiPlusThick
|
|
@@ -1739,7 +1703,7 @@ function TableCreateButton(_a) {
|
|
|
1739
1703
|
}
|
|
1740
1704
|
|
|
1741
1705
|
function TableFilterButton(_a) {
|
|
1742
|
-
var props = __rest(_a, []);
|
|
1706
|
+
var props = tslib.__rest(_a, []);
|
|
1743
1707
|
// return <Button scheme="secondary" {...props}><Icon path={mdiFilter} /></Button>
|
|
1744
1708
|
return jsxRuntime.jsxs(ui.Popover, {
|
|
1745
1709
|
side: "bottom-end",
|
|
@@ -1787,7 +1751,7 @@ function TableTopBar(_a) {
|
|
|
1787
1751
|
breadcrumbs,
|
|
1788
1752
|
children
|
|
1789
1753
|
} = _a,
|
|
1790
|
-
props = __rest(_a, ["title", "breadcrumbs", "children"]);
|
|
1754
|
+
props = tslib.__rest(_a, ["title", "breadcrumbs", "children"]);
|
|
1791
1755
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
1792
1756
|
dflex: true,
|
|
1793
1757
|
flexRow: true,
|
|
@@ -2027,7 +1991,7 @@ function ItemEditDialog(_a) {
|
|
|
2027
1991
|
onClose,
|
|
2028
1992
|
formikProps
|
|
2029
1993
|
} = _a,
|
|
2030
|
-
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"]);
|
|
1994
|
+
props = tslib.__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"]);
|
|
2031
1995
|
const {
|
|
2032
1996
|
isInitialLoading,
|
|
2033
1997
|
isFetching,
|
|
@@ -2043,7 +2007,7 @@ function ItemEditDialog(_a) {
|
|
|
2043
2007
|
// const [showTab, setShowTab] = React.useState(true);
|
|
2044
2008
|
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);
|
|
2045
2009
|
const retry = React__default["default"].useCallback(() => refetch(), [refetch]);
|
|
2046
|
-
const saveItem = React__default["default"].useCallback((item, actions) => __awaiter(this, void 0, void 0, function* () {
|
|
2010
|
+
const saveItem = React__default["default"].useCallback((item, actions) => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
2047
2011
|
// Clear mutation error if any
|
|
2048
2012
|
mutation.reset();
|
|
2049
2013
|
const formItem = formToQueryData ? formToQueryData(item) : Object.assign({}, item);
|
|
@@ -2223,7 +2187,7 @@ function DialogRenderer({
|
|
|
2223
2187
|
invalidateQueryKey,
|
|
2224
2188
|
queryId
|
|
2225
2189
|
}) {
|
|
2226
|
-
const props = __rest(config, ["type"]);
|
|
2190
|
+
const props = tslib.__rest(config, ["type"]);
|
|
2227
2191
|
if (config.type === "dialog") return jsxRuntime.jsx(ItemEditDialog, Object.assign({}, props, {
|
|
2228
2192
|
queryId: queryId,
|
|
2229
2193
|
invalidateQueryKey: invalidateQueryKey,
|
|
@@ -2278,7 +2242,7 @@ function ItemDeleteDialog(_a) {
|
|
|
2278
2242
|
show,
|
|
2279
2243
|
onClose
|
|
2280
2244
|
} = _a,
|
|
2281
|
-
props = __rest(_a, ["title", "actionButtonLabel", "itemLabel", "queryId", "api", "apiFn", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
|
|
2245
|
+
props = tslib.__rest(_a, ["title", "actionButtonLabel", "itemLabel", "queryId", "api", "apiFn", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
|
|
2282
2246
|
const fn = apiFn ? api$1[apiFn] : api$1.delete;
|
|
2283
2247
|
const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(fn, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey) : api.useApiMutation(fn, api$1.queryKey);
|
|
2284
2248
|
const mutate = api.useMutate(mutation, {
|
|
@@ -2466,7 +2430,7 @@ function TableRowPublishPostButton$1(_a) {
|
|
|
2466
2430
|
status,
|
|
2467
2431
|
invalidateQueryKey
|
|
2468
2432
|
} = _a,
|
|
2469
|
-
props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
|
|
2433
|
+
props = tslib.__rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
|
|
2470
2434
|
const isDraft = status == "draft";
|
|
2471
2435
|
const mutation = api.useInvalidateParentMutation(isDraft ? api$1.publish : api$1.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey, {
|
|
2472
2436
|
networkMode: "always"
|
|
@@ -2528,7 +2492,7 @@ function ActionButton(_a) {
|
|
|
2528
2492
|
var {
|
|
2529
2493
|
onClick
|
|
2530
2494
|
} = _a,
|
|
2531
|
-
props = __rest(_a, ["onClick"]);
|
|
2495
|
+
props = tslib.__rest(_a, ["onClick"]);
|
|
2532
2496
|
const handleClick = React__default["default"].useCallback(event => {
|
|
2533
2497
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
2534
2498
|
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
|
@@ -2566,7 +2530,7 @@ function useTableProps(api, table, rowActions, queryParams) {
|
|
|
2566
2530
|
onRowClick,
|
|
2567
2531
|
columns: c
|
|
2568
2532
|
} = table,
|
|
2569
|
-
props = __rest(table, ["onRowClick", "columns"]);
|
|
2533
|
+
props = tslib.__rest(table, ["onRowClick", "columns"]);
|
|
2570
2534
|
const onRowClickHandler = React__default["default"].useCallback(item => {
|
|
2571
2535
|
var _a;
|
|
2572
2536
|
const config = react.runIfFn(onRowClick, item);
|
|
@@ -2631,7 +2595,7 @@ function TableView(_a) {
|
|
|
2631
2595
|
subtitle,
|
|
2632
2596
|
screen
|
|
2633
2597
|
} = _a,
|
|
2634
|
-
props = __rest(_a, ["queryField", "title", "subtitle", "screen"]);
|
|
2598
|
+
props = tslib.__rest(_a, ["queryField", "title", "subtitle", "screen"]);
|
|
2635
2599
|
const id = useId(queryField);
|
|
2636
2600
|
const _screen = react.runIfFn(screen, id);
|
|
2637
2601
|
return jsxRuntime.jsx(PageContainer, Object.assign({
|
|
@@ -2836,7 +2800,7 @@ function MultiQueryWrapper(_a) {
|
|
|
2836
2800
|
config,
|
|
2837
2801
|
tabbed
|
|
2838
2802
|
} = _a,
|
|
2839
|
-
props = __rest(_a, ["queries", "config", "tabbed"]);
|
|
2803
|
+
props = tslib.__rest(_a, ["queries", "config", "tabbed"]);
|
|
2840
2804
|
const {
|
|
2841
2805
|
data,
|
|
2842
2806
|
isFetching,
|
|
@@ -2864,7 +2828,7 @@ function ScreenRenderer(_a) {
|
|
|
2864
2828
|
config,
|
|
2865
2829
|
tabbed
|
|
2866
2830
|
} = _a,
|
|
2867
|
-
props = __rest(_a, ["config", "tabbed"]);
|
|
2831
|
+
props = tslib.__rest(_a, ["config", "tabbed"]);
|
|
2868
2832
|
if (config.type === "table") return jsxRuntime.jsx(TableView, Object.assign({}, config, props));
|
|
2869
2833
|
if (config.type === "tabbed") return jsxRuntime.jsx(TabbedView, Object.assign({}, config, props));
|
|
2870
2834
|
if (config.type === "details") return jsxRuntime.jsx(DetailsView, Object.assign({}, config, {
|
|
@@ -2884,7 +2848,7 @@ function ScreenRenderer(_a) {
|
|
|
2884
2848
|
*
|
|
2885
2849
|
*/
|
|
2886
2850
|
function Content(_a) {
|
|
2887
|
-
var props = __rest(_a, []);
|
|
2851
|
+
var props = tslib.__rest(_a, []);
|
|
2888
2852
|
return jsxRuntime.jsx("div", Object.assign({
|
|
2889
2853
|
w: "100%",
|
|
2890
2854
|
h: "100%",
|
|
@@ -2916,7 +2880,7 @@ function MenuButton(_a) {
|
|
|
2916
2880
|
selected,
|
|
2917
2881
|
children
|
|
2918
2882
|
} = _a,
|
|
2919
|
-
props = __rest(_a, ["depth", "darkMode", "icon", "selected", "children"]);
|
|
2883
|
+
props = tslib.__rest(_a, ["depth", "darkMode", "icon", "selected", "children"]);
|
|
2920
2884
|
return jsxRuntime.jsxs(ui.Button, Object.assign({
|
|
2921
2885
|
as: "li",
|
|
2922
2886
|
minH: "8",
|
|
@@ -2951,7 +2915,7 @@ function MenuItem$1(_a) {
|
|
|
2951
2915
|
darkMode,
|
|
2952
2916
|
subMenu
|
|
2953
2917
|
} = _a,
|
|
2954
|
-
props = __rest(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
|
|
2918
|
+
props = tslib.__rest(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
|
|
2955
2919
|
const location = reactRouterDom.useLocation();
|
|
2956
2920
|
const selected = path == "/" ? location.pathname == "/" : location.pathname.startsWith(path.startsWith("/") ? path : `/${path}`);
|
|
2957
2921
|
const match = reactRouterDom.useMatch("/" + path) != null;
|
|
@@ -2989,7 +2953,7 @@ function NextMenuItem(_a) {
|
|
|
2989
2953
|
darkMode,
|
|
2990
2954
|
subMenu
|
|
2991
2955
|
} = _a,
|
|
2992
|
-
props = __rest(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
|
|
2956
|
+
props = tslib.__rest(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
|
|
2993
2957
|
const {
|
|
2994
2958
|
pathname
|
|
2995
2959
|
} = router.useRouter();
|
|
@@ -3030,7 +2994,7 @@ function Menu(_a) {
|
|
|
3030
2994
|
config,
|
|
3031
2995
|
useNextRouter
|
|
3032
2996
|
} = _a,
|
|
3033
|
-
props = __rest(_a, ["darkMode", "config", "useNextRouter"]);
|
|
2997
|
+
props = tslib.__rest(_a, ["darkMode", "config", "useNextRouter"]);
|
|
3034
2998
|
const Comp = useNextRouter ? NextMenuItem : MenuItem$1;
|
|
3035
2999
|
return jsxRuntime.jsx("ul", Object.assign({}, props, {
|
|
3036
3000
|
children: config.map((item, index) => {
|
|
@@ -3179,7 +3143,7 @@ function MenuItem(_a) {
|
|
|
3179
3143
|
onClick,
|
|
3180
3144
|
children
|
|
3181
3145
|
} = _a,
|
|
3182
|
-
props = __rest(_a, ["icon", "onClick", "children"]);
|
|
3146
|
+
props = tslib.__rest(_a, ["icon", "onClick", "children"]);
|
|
3183
3147
|
const handleClick = React__default["default"].useCallback(e => {
|
|
3184
3148
|
e.preventDefault();
|
|
3185
3149
|
e.stopPropagation();
|
|
@@ -3216,7 +3180,7 @@ function Sidebar(_a) {
|
|
|
3216
3180
|
color,
|
|
3217
3181
|
darkMode
|
|
3218
3182
|
} = _a,
|
|
3219
|
-
props = __rest(_a, ["show", "logo", "title", "menuConfig", "userMenuConfig", "userSettingsPath", "color", "darkMode"]);
|
|
3183
|
+
props = tslib.__rest(_a, ["show", "logo", "title", "menuConfig", "userMenuConfig", "userSettingsPath", "color", "darkMode"]);
|
|
3220
3184
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
3221
3185
|
dflex: true,
|
|
3222
3186
|
flexCol: true,
|
|
@@ -3265,7 +3229,7 @@ function Logo(_a) {
|
|
|
3265
3229
|
height,
|
|
3266
3230
|
darkMode
|
|
3267
3231
|
} = _a,
|
|
3268
|
-
props = __rest(_a, ["width", "height", "darkMode"]);
|
|
3232
|
+
props = tslib.__rest(_a, ["width", "height", "darkMode"]);
|
|
3269
3233
|
return jsxRuntime.jsx("div", Object.assign({}, props, {
|
|
3270
3234
|
children: jsxRuntime.jsx(Image__default["default"], {
|
|
3271
3235
|
src: `/logo_${darkMode ? "light" : "dark"}.png`,
|
|
@@ -3288,7 +3252,7 @@ function AdminLayout(_a) {
|
|
|
3288
3252
|
userMenuConfig,
|
|
3289
3253
|
userSettingsPath
|
|
3290
3254
|
} = _a,
|
|
3291
|
-
props = __rest(_a, ["color", "darkMode", "logo", "title", "menuConfig", "userMenuConfig", "userSettingsPath"]);
|
|
3255
|
+
props = tslib.__rest(_a, ["color", "darkMode", "logo", "title", "menuConfig", "userMenuConfig", "userSettingsPath"]);
|
|
3292
3256
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
3293
3257
|
w: "full",
|
|
3294
3258
|
h: "screen",
|
|
@@ -3384,7 +3348,7 @@ function AttachDialog(_a) {
|
|
|
3384
3348
|
formikProps,
|
|
3385
3349
|
getItemName
|
|
3386
3350
|
} = _a,
|
|
3387
|
-
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"]);
|
|
3351
|
+
props = tslib.__rest(_a, ["queryId", "queryKey", "queryFetchFn", "queryFetchAllKey", "queryFetchAllFn", "querySaveFn", "matchKey", "size", "show", "onClose", "itemLabel", "onSuccess", "onFetchError", "fetchErrorMsg", "onSaveError", "saveErrorMsg", "invalidateQueriesOnSuccess", "retryText", "cancelLabel", "saveLabel", "formikProps", "getItemName"]);
|
|
3388
3352
|
const queryClient = reactQuery.useQueryClient();
|
|
3389
3353
|
const {
|
|
3390
3354
|
data: attached,
|
|
@@ -3510,7 +3474,7 @@ function ListItem(_a) {
|
|
|
3510
3474
|
value,
|
|
3511
3475
|
checked
|
|
3512
3476
|
} = _a,
|
|
3513
|
-
props = __rest(_a, ["label", "value", "checked"]);
|
|
3477
|
+
props = tslib.__rest(_a, ["label", "value", "checked"]);
|
|
3514
3478
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
3515
3479
|
dflex: true,
|
|
3516
3480
|
alignItems: "center",
|
|
@@ -3555,7 +3519,7 @@ function FormActionDialog(_a) {
|
|
|
3555
3519
|
onClose,
|
|
3556
3520
|
formikProps
|
|
3557
3521
|
} = _a,
|
|
3558
|
-
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"]);
|
|
3522
|
+
props = tslib.__rest(_a, ["initialValues", "itemLabel", "queryId", "queryKey", "queryFn", "queryOptions", "onSuccess", "successMsg", "showSuccessMsg", "onError", "errorMsg", "showErrorMsg", "processInput", "invalidateQueriesOnSuccess", "cancelLabel", "saveLabel", "size", "title", "form", "show", "onClose", "formikProps"]);
|
|
3559
3523
|
const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(queryFn, queryKey, queryOptions) : api.useApiMutation(queryFn, queryKey, queryId, queryOptions);
|
|
3560
3524
|
const mutate = api.useMutate(mutation, {
|
|
3561
3525
|
onSuccess,
|
|
@@ -3607,7 +3571,7 @@ function PageSectionTitle(_a) {
|
|
|
3607
3571
|
var {
|
|
3608
3572
|
children
|
|
3609
3573
|
} = _a,
|
|
3610
|
-
props = __rest(_a, ["children"]);
|
|
3574
|
+
props = tslib.__rest(_a, ["children"]);
|
|
3611
3575
|
return jsxRuntime.jsx("div", Object.assign({
|
|
3612
3576
|
trait: "typo.h6",
|
|
3613
3577
|
mb: "5"
|
|
@@ -3621,7 +3585,7 @@ const PageStateContainer = /*#__PURE__*/React__default["default"].forwardRef((_a
|
|
|
3621
3585
|
loading = false,
|
|
3622
3586
|
children
|
|
3623
3587
|
} = _a,
|
|
3624
|
-
props = __rest(_a, ["loading", "children"]);
|
|
3588
|
+
props = tslib.__rest(_a, ["loading", "children"]);
|
|
3625
3589
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
3626
3590
|
children: [loading && jsxRuntime.jsx(components.QueryLoadingState, {
|
|
3627
3591
|
w: "full",
|
|
@@ -3643,7 +3607,7 @@ function PageSubSectionTitle(_a) {
|
|
|
3643
3607
|
var {
|
|
3644
3608
|
children
|
|
3645
3609
|
} = _a,
|
|
3646
|
-
props = __rest(_a, ["children"]);
|
|
3610
|
+
props = tslib.__rest(_a, ["children"]);
|
|
3647
3611
|
return jsxRuntime.jsx("div", Object.assign({
|
|
3648
3612
|
trait: "typo.h6",
|
|
3649
3613
|
mb: "3"
|
|
@@ -3672,7 +3636,7 @@ function StatusBadge(_a) {
|
|
|
3672
3636
|
var {
|
|
3673
3637
|
status
|
|
3674
3638
|
} = _a,
|
|
3675
|
-
props = __rest(_a, ["status"]);
|
|
3639
|
+
props = tslib.__rest(_a, ["status"]);
|
|
3676
3640
|
return jsxRuntime.jsx(ui.Badge, Object.assign({
|
|
3677
3641
|
size: "sm",
|
|
3678
3642
|
variant: "glass",
|
|
@@ -3690,7 +3654,7 @@ function TableRowActionButton(_a) {
|
|
|
3690
3654
|
icon,
|
|
3691
3655
|
children
|
|
3692
3656
|
} = _a,
|
|
3693
|
-
props = __rest(_a, ["icon", "children"]);
|
|
3657
|
+
props = tslib.__rest(_a, ["icon", "children"]);
|
|
3694
3658
|
return jsxRuntime.jsxs(ui.Button, Object.assign({
|
|
3695
3659
|
dflex: true,
|
|
3696
3660
|
alignContent: "center",
|
|
@@ -3714,7 +3678,7 @@ function TableRowViewButton(_a) {
|
|
|
3714
3678
|
var {
|
|
3715
3679
|
path
|
|
3716
3680
|
} = _a,
|
|
3717
|
-
props = __rest(_a, ["path"]);
|
|
3681
|
+
props = tslib.__rest(_a, ["path"]);
|
|
3718
3682
|
const openPage = React__default["default"].useCallback(event => {
|
|
3719
3683
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
3720
3684
|
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
|
@@ -3730,7 +3694,7 @@ function TableRowNavigateButton(_a) {
|
|
|
3730
3694
|
var {
|
|
3731
3695
|
path
|
|
3732
3696
|
} = _a,
|
|
3733
|
-
props = __rest(_a, ["path"]);
|
|
3697
|
+
props = tslib.__rest(_a, ["path"]);
|
|
3734
3698
|
const navigate = reactRouterDom.useNavigate();
|
|
3735
3699
|
const handleClick = React__default["default"].useCallback(event => {
|
|
3736
3700
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
@@ -3748,7 +3712,7 @@ function TableRowActionDialogButton(_a) {
|
|
|
3748
3712
|
icon,
|
|
3749
3713
|
children
|
|
3750
3714
|
} = _a,
|
|
3751
|
-
props = __rest(_a, ["icon", "children"]);
|
|
3715
|
+
props = tslib.__rest(_a, ["icon", "children"]);
|
|
3752
3716
|
return jsxRuntime.jsxs(admin.DialogButton, Object.assign({
|
|
3753
3717
|
dflex: true,
|
|
3754
3718
|
alignContent: "center",
|
|
@@ -3772,7 +3736,7 @@ function TableRowEditButton(_a) {
|
|
|
3772
3736
|
var {
|
|
3773
3737
|
children
|
|
3774
3738
|
} = _a,
|
|
3775
|
-
props = __rest(_a, ["children"]);
|
|
3739
|
+
props = tslib.__rest(_a, ["children"]);
|
|
3776
3740
|
return jsxRuntime.jsx(TableRowActionDialogButton, Object.assign({
|
|
3777
3741
|
icon: mdiPencil
|
|
3778
3742
|
}, props, {
|
|
@@ -3784,7 +3748,7 @@ function TableRowDeleteButton(_a) {
|
|
|
3784
3748
|
var {
|
|
3785
3749
|
children
|
|
3786
3750
|
} = _a,
|
|
3787
|
-
props = __rest(_a, ["children"]);
|
|
3751
|
+
props = tslib.__rest(_a, ["children"]);
|
|
3788
3752
|
return jsxRuntime.jsx(TableRowActionDialogButton, Object.assign({
|
|
3789
3753
|
icon: mdiDelete
|
|
3790
3754
|
}, props, {
|
|
@@ -3801,7 +3765,7 @@ function TableRowActionBar(_a) {
|
|
|
3801
3765
|
deleteDialog,
|
|
3802
3766
|
children
|
|
3803
3767
|
} = _a,
|
|
3804
|
-
props = __rest(_a, ["publishId", "viewPath", "navigatePath", "editDialog", "deleteDialog", "children"]);
|
|
3768
|
+
props = tslib.__rest(_a, ["publishId", "viewPath", "navigatePath", "editDialog", "deleteDialog", "children"]);
|
|
3805
3769
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
3806
3770
|
dflex: true,
|
|
3807
3771
|
spaceX: "1",
|
|
@@ -3826,7 +3790,7 @@ function TableRowPublishPostButton(_a) {
|
|
|
3826
3790
|
status,
|
|
3827
3791
|
invalidateQueryKey
|
|
3828
3792
|
} = _a,
|
|
3829
|
-
props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
|
|
3793
|
+
props = tslib.__rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
|
|
3830
3794
|
const isDraft = status == "draft";
|
|
3831
3795
|
const mutation = api.useInvalidateParentMutation(isDraft ? api$1.publish : api$1.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey, {
|
|
3832
3796
|
networkMode: "always"
|
package/index.esm.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __rest, __awaiter } from 'tslib';
|
|
1
2
|
import { jsx, jsxs, Fragment } from '@soperio/jsx-runtime';
|
|
2
3
|
import { useApiQuery, useApiMutation, useMutate, useInvalidateMutation, useInvalidateQuery, useInvalidateParentMutation, useApiQueries } from '@compill/api';
|
|
3
4
|
import { Shimmer, FlexCenter, QueryLoadingState, RetryOnError, TabContainer, ModalLoadingOverlay } from '@compill/components';
|
|
@@ -5,7 +6,7 @@ import { Icon, Button, IconButton, Container, Tile, Popover, Collapse, Modal, Av
|
|
|
5
6
|
import Link from 'next/link';
|
|
6
7
|
import { useParams, useNavigate, Outlet, useLocation, useMatch, Link as Link$1 } from 'react-router-dom';
|
|
7
8
|
import React, { useRef, useCallback, useContext as useContext$2, useLayoutEffect, useEffect, createContext } from 'react';
|
|
8
|
-
import { INVALIDATE_API, API } from '@compill/admin-api';
|
|
9
|
+
import { INVALIDATE_API, API, useInvalidatePage } from '@compill/admin-api';
|
|
9
10
|
import { useFormikContext, Formik, Form } from 'formik';
|
|
10
11
|
import { ButtonBarButton as ButtonBarButton$1, ButtonBarSubmitButton as ButtonBarSubmitButton$1, PageSectionTitle as PageSectionTitle$1, ButtonBar as ButtonBar$1, ButtonBarDialogButton as ButtonBarDialogButton$1, Breadcrumbs as Breadcrumbs$1, TableRowActionButton as TableRowActionButton$1, DialogButton as DialogButton$1 } from '@compill/admin';
|
|
11
12
|
import { toast } from 'react-toastify';
|
|
@@ -23,48 +24,6 @@ import { useQueryClient } from '@tanstack/react-query';
|
|
|
23
24
|
import Image from 'next/image';
|
|
24
25
|
import { useSessionUser, useSessionLogout } from '@compill/auth';
|
|
25
26
|
|
|
26
|
-
/******************************************************************************
|
|
27
|
-
Copyright (c) Microsoft Corporation.
|
|
28
|
-
|
|
29
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
30
|
-
purpose with or without fee is hereby granted.
|
|
31
|
-
|
|
32
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
33
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
34
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
35
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
36
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
37
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
38
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
39
|
-
***************************************************************************** */
|
|
40
|
-
|
|
41
|
-
function __rest(s, e) {
|
|
42
|
-
var t = {};
|
|
43
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
44
|
-
t[p] = s[p];
|
|
45
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
46
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
47
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
48
|
-
t[p[i]] = s[p[i]];
|
|
49
|
-
}
|
|
50
|
-
return t;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
54
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
55
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
56
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
57
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
58
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
59
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
64
|
-
var e = new Error(message);
|
|
65
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
27
|
function SectionTitle(_a) {
|
|
69
28
|
var {
|
|
70
29
|
children
|
|
@@ -1446,15 +1405,20 @@ function Internal({
|
|
|
1446
1405
|
sections,
|
|
1447
1406
|
buttonBar,
|
|
1448
1407
|
type,
|
|
1449
|
-
invalidateParentQueryKey
|
|
1408
|
+
invalidateParentQueryKey,
|
|
1409
|
+
invalidatePage
|
|
1450
1410
|
} = pScreen;
|
|
1451
1411
|
const mutation = useInvalidateParentMutation(api.update, invalidateParentQueryKey !== null && invalidateParentQueryKey !== void 0 ? invalidateParentQueryKey : api.queryKey, {
|
|
1452
1412
|
networkMode: "always"
|
|
1453
1413
|
});
|
|
1414
|
+
const invalidatePageFn = useInvalidatePage(invalidatePage || "");
|
|
1454
1415
|
const save = useMutate(mutation, {
|
|
1455
1416
|
processInput,
|
|
1456
1417
|
successMsg: (item, values) => `${item.title || item.name} updated.`,
|
|
1457
|
-
errorMsg: (error, item) => `Error updating ${item.title || item.name}: ${error}
|
|
1418
|
+
errorMsg: (error, item) => `Error updating ${item.title || item.name}: ${error}`,
|
|
1419
|
+
onSuccess: () => {
|
|
1420
|
+
if (invalidatePage) invalidatePageFn();
|
|
1421
|
+
}
|
|
1458
1422
|
});
|
|
1459
1423
|
let editorMaxW = undefined;
|
|
1460
1424
|
if (!type || type == "post") editorMaxW = "calc(1280px - 28rem)";else if (type == "section") editorMaxW = "calc(1280px - 22rem)";
|
package/package.json
CHANGED