@compill/admin 1.0.80 → 1.0.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.cjs.js +66 -120
  2. package/index.esm.js +67 -121
  3. package/package.json +1 -1
package/index.cjs.js CHANGED
@@ -16,6 +16,7 @@ require('react/jsx-runtime');
16
16
  var components = require('@compill/components');
17
17
  var form = require('@compill/form');
18
18
  var react = require('@soperio/react');
19
+ var formEditor = require('@compill/form-editor');
19
20
  var editor = require('@compill/editor');
20
21
  var reactDom = require('react-dom');
21
22
  var router = require('next/router');
@@ -46,7 +47,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
46
47
  PERFORMANCE OF THIS SOFTWARE.
47
48
  ***************************************************************************** */
48
49
 
49
- function __rest$1(s, e) {
50
+ function __rest(s, e) {
50
51
  var t = {};
51
52
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
52
53
  t[p] = s[p];
@@ -77,7 +78,7 @@ function SectionTitle(_a) {
77
78
  var {
78
79
  children
79
80
  } = _a,
80
- props = __rest$1(_a, ["children"]);
81
+ props = __rest(_a, ["children"]);
81
82
  return jsxRuntime.jsx("h2", Object.assign({
82
83
  textSize: "xl",
83
84
  fontWeight: "600",
@@ -110,7 +111,7 @@ function Breadcrumbs(_a) {
110
111
  var {
111
112
  breadcrumbs
112
113
  } = _a,
113
- props = __rest$1(_a, ["breadcrumbs"]);
114
+ props = __rest(_a, ["breadcrumbs"]);
114
115
  return jsxRuntime.jsx("div", Object.assign({
115
116
  dflex: true,
116
117
  alignItems: "center",
@@ -147,7 +148,7 @@ function DialogButton(_a) {
147
148
  var {
148
149
  buildDialog
149
150
  } = _a,
150
- props = __rest$1(_a, ["buildDialog"]);
151
+ props = __rest(_a, ["buildDialog"]);
151
152
  const [showDialog, setShowDialog] = React__default["default"].useState(false);
152
153
  const onShowDialog = React__default["default"].useCallback(event => {
153
154
  event === null || event === void 0 ? void 0 : event.preventDefault();
@@ -168,7 +169,7 @@ function ButtonBar(_a) {
168
169
  var {
169
170
  children
170
171
  } = _a,
171
- props = __rest$1(_a, ["children"]);
172
+ props = __rest(_a, ["children"]);
172
173
  return jsxRuntime.jsx("div", Object.assign({
173
174
  dflex: true,
174
175
  border: "1px",
@@ -186,7 +187,7 @@ const ButtonBarButton = /*#__PURE__*/React__default["default"].forwardRef(functi
186
187
  icon,
187
188
  children
188
189
  } = _a,
189
- props = __rest$1(_a, ["icon", "children"]);
190
+ props = __rest(_a, ["icon", "children"]);
190
191
  return jsxRuntime.jsxs(ui.Button, Object.assign({
191
192
  scheme: "dark",
192
193
  size: "sm",
@@ -212,7 +213,7 @@ const ButtonBarSubmitButton = /*#__PURE__*/React__default["default"].forwardRef(
212
213
  icon,
213
214
  children
214
215
  } = _a,
215
- props = __rest$1(_a, ["useDirty", "disabled", "icon", "children"]);
216
+ props = __rest(_a, ["useDirty", "disabled", "icon", "children"]);
216
217
  const {
217
218
  dirty,
218
219
  handleSubmit
@@ -246,7 +247,7 @@ function ButtonBarDialogButton(_a) {
246
247
  icon,
247
248
  children
248
249
  } = _a,
249
- props = __rest$1(_a, ["icon", "children"]);
250
+ props = __rest(_a, ["icon", "children"]);
250
251
  return jsxRuntime.jsxs(DialogButton, Object.assign({
251
252
  scheme: "dark",
252
253
  size: "sm",
@@ -268,7 +269,7 @@ function InvalidateButton(_a) {
268
269
  var {
269
270
  pathOrPermalink
270
271
  } = _a,
271
- props = __rest$1(_a, ["pathOrPermalink"]);
272
+ props = __rest(_a, ["pathOrPermalink"]);
272
273
  const api$1 = adminApi.INVALIDATE_API.new(pathOrPermalink);
273
274
  const mutation = api.useApiMutation(api$1.invalidate, api$1.queryKey);
274
275
  const invalidate = api.useMutate(mutation, {
@@ -286,7 +287,7 @@ function NavigateButton(_a) {
286
287
  var {
287
288
  path
288
289
  } = _a,
289
- props = __rest$1(_a, ["path"]);
290
+ props = __rest(_a, ["path"]);
290
291
  const navigate = reactRouterDom.useNavigate();
291
292
  const handleClick = React__default["default"].useCallback(() => {
292
293
  navigate(path);
@@ -312,7 +313,7 @@ function PublishButton(_a) {
312
313
  queryId,
313
314
  api: api$1
314
315
  } = _a,
315
- props = __rest$1(_a, ["status", "queryId", "api"]);
316
+ props = __rest(_a, ["status", "queryId", "api"]);
316
317
  const isDraft = status == "draft";
317
318
  const mutation = api.useInvalidateMutation(isDraft ? api$1.publish : api$1.unpublish, api$1.queryKey, queryId, {
318
319
  networkMode: "always"
@@ -719,7 +720,7 @@ function useHotkeys(keys, callback, options, dependencies) {
719
720
 
720
721
  function UpdateButton(_a) {
721
722
  var _b;
722
- var props = __rest$1(_a, []);
723
+ var props = __rest(_a, []);
723
724
  const {
724
725
  dirty,
725
726
  handleSubmit
@@ -745,7 +746,7 @@ function ViewButton(_a) {
745
746
  path,
746
747
  icon
747
748
  } = _a,
748
- props = __rest$1(_a, ["path", "icon"]);
749
+ props = __rest(_a, ["path", "icon"]);
749
750
  const openPage = React__default["default"].useCallback(() => {
750
751
  window.open(path, '_blank');
751
752
  }, [path]);
@@ -804,7 +805,7 @@ function PageContainer(_a) {
804
805
  var {
805
806
  children
806
807
  } = _a,
807
- props = __rest$1(_a, ["children"]);
808
+ props = __rest(_a, ["children"]);
808
809
  return jsxRuntime.jsx(ui.Container, Object.assign({
809
810
  center: true,
810
811
  dflex: true,
@@ -815,68 +816,11 @@ function PageContainer(_a) {
815
816
  }));
816
817
  }
817
818
 
818
- /******************************************************************************
819
- Copyright (c) Microsoft Corporation.
820
-
821
- Permission to use, copy, modify, and/or distribute this software for any
822
- purpose with or without fee is hereby granted.
823
-
824
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
825
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
826
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
827
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
828
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
829
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
830
- PERFORMANCE OF THIS SOFTWARE.
831
- ***************************************************************************** */
832
-
833
- function __rest(s, e) {
834
- var t = {};
835
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
836
- t[p] = s[p];
837
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
838
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
839
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
840
- t[p[i]] = s[p[i]];
841
- }
842
- return t;
843
- }
844
-
845
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
846
- var e = new Error(message);
847
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
848
- };
849
-
850
- function FormEditor(_a) {
851
- // const { initialValues } = useFormikContext();
852
- var {
853
- name,
854
- placeholder
855
- } = _a,
856
- props = __rest(_a, ["name", "placeholder"]);
857
- return jsxRuntime.jsx(formik.Field, {
858
- name: name,
859
- children: ({
860
- field,
861
- meta
862
- }) => jsxRuntime.jsx(editor.Editor, Object.assign({}, props, {
863
- // placeholder={placeholder}
864
- defaultValue: meta.initialValue,
865
- onChange: e => field.onChange({
866
- target: {
867
- name: name,
868
- value: e
869
- }
870
- })
871
- }))
872
- });
873
- }
874
-
875
819
  function PageMain(_a) {
876
820
  var {
877
821
  children
878
822
  } = _a,
879
- props = __rest$1(_a, ["children"]);
823
+ props = __rest(_a, ["children"]);
880
824
  return jsxRuntime.jsx(ui.Tile, Object.assign({
881
825
  scheme: "light",
882
826
  p: "5"
@@ -889,17 +833,19 @@ function PageContentEditor(_a) {
889
833
  var {
890
834
  name
891
835
  } = _a,
892
- props = __rest$1(_a, ["name"]);
836
+ props = __rest(_a, ["name"]);
837
+ const extensions = [editor.ImageExtension];
893
838
  return jsxRuntime.jsx(PageMain, Object.assign({
894
839
  h: "min"
895
840
  }, props, {
896
- children: jsxRuntime.jsx(FormEditor, {
841
+ children: jsxRuntime.jsx(formEditor.FormEditor, {
897
842
  minH: "128",
898
843
  minW: "144",
899
844
  maxW: props.maxW,
900
845
  // w={props.w}
901
846
  name: name,
902
- placeHolder: "Write here..."
847
+ placeHolder: "Write here...",
848
+ extensions: extensions
903
849
  })
904
850
  }));
905
851
  }
@@ -913,7 +859,7 @@ function PageQueryStateContainerInner(_a) {
913
859
  errorStyles,
914
860
  children
915
861
  } = _a,
916
- props = __rest$1(_a, ["queryId", "api", "apiFn", "loadingStyles", "errorStyles", "children"]);
862
+ props = __rest(_a, ["queryId", "api", "apiFn", "loadingStyles", "errorStyles", "children"]);
917
863
  // @ts-ignore
918
864
  const {
919
865
  data,
@@ -939,7 +885,7 @@ function PageSidebar(_a) {
939
885
  var {
940
886
  children
941
887
  } = _a,
942
- props = __rest$1(_a, ["children"]);
888
+ props = __rest(_a, ["children"]);
943
889
  return jsxRuntime.jsx("div", Object.assign({
944
890
  w: "112",
945
891
  minW: "112",
@@ -957,7 +903,7 @@ function PageSidebarSection(_a) {
957
903
  title,
958
904
  children
959
905
  } = _a,
960
- props = __rest$1(_a, ["title", "children"]);
906
+ props = __rest(_a, ["title", "children"]);
961
907
  return jsxRuntime.jsxs("div", Object.assign({
962
908
  w: "full"
963
909
  }, props, {
@@ -971,7 +917,7 @@ function PageTitle(_a) {
971
917
  var {
972
918
  children
973
919
  } = _a,
974
- props = __rest$1(_a, ["children"]);
920
+ props = __rest(_a, ["children"]);
975
921
  return jsxRuntime.jsx("div", Object.assign({
976
922
  trait: "typo.h5"
977
923
  }, props, {
@@ -985,7 +931,7 @@ function PageTopBar(_a) {
985
931
  breadcrumbs,
986
932
  children
987
933
  } = _a,
988
- props = __rest$1(_a, ["title", "breadcrumbs", "children"]);
934
+ props = __rest(_a, ["title", "breadcrumbs", "children"]);
989
935
  return jsxRuntime.jsxs(components.FlexCenter, Object.assign({
990
936
  gap: "3",
991
937
  minH: "9"
@@ -1018,7 +964,7 @@ function PageTabbedTopBar(_a) {
1018
964
  breadcrumbs,
1019
965
  children
1020
966
  } = _a,
1021
- props = __rest$1(_a, ["title", "breadcrumbs", "children"]);
967
+ props = __rest(_a, ["title", "breadcrumbs", "children"]);
1022
968
  const ref = /*#__PURE__*/React__default["default"].createRef();
1023
969
  const {
1024
970
  setContainerEl
@@ -1172,7 +1118,7 @@ function DetailsView(_a) {
1172
1118
  screen,
1173
1119
  tabbed
1174
1120
  } = _a,
1175
- props = __rest$1(_a, ["queryField", "api", "useNextRouter", "processInput", "screen", "tabbed"]);
1121
+ props = __rest(_a, ["queryField", "api", "useNextRouter", "processInput", "screen", "tabbed"]);
1176
1122
  const id = useQueryField(queryField, useNextRouter);
1177
1123
  const ref = React__default["default"].useRef(null);
1178
1124
  return jsxRuntime.jsx(PageQueryStateContainer, Object.assign({
@@ -1335,7 +1281,7 @@ function QueryWrapper(_a) {
1335
1281
  config,
1336
1282
  tabbed
1337
1283
  } = _a,
1338
- props = __rest$1(_a, ["api", "queryField", "fn", "transformFn", "config", "tabbed"]);
1284
+ props = __rest(_a, ["api", "queryField", "fn", "transformFn", "config", "tabbed"]);
1339
1285
  const {
1340
1286
  id,
1341
1287
  api: mApi
@@ -1364,7 +1310,7 @@ function TabbedView(_a) {
1364
1310
  api,
1365
1311
  screen
1366
1312
  } = _a;
1367
- __rest$1(_a, ["queryField", "api", "screen"]);
1313
+ __rest(_a, ["queryField", "api", "screen"]);
1368
1314
  const {
1369
1315
  [queryField]: id
1370
1316
  } = reactRouterDom.useParams();
@@ -1460,7 +1406,7 @@ function TableContainer(_a) {
1460
1406
  columns,
1461
1407
  children
1462
1408
  } = _a,
1463
- props = __rest$1(_a, ["initialPageSize", "initialVisibleColumns", "columns", "children"]);
1409
+ props = __rest(_a, ["initialPageSize", "initialVisibleColumns", "columns", "children"]);
1464
1410
  return jsxRuntime.jsx("div", Object.assign({
1465
1411
  w: "full",
1466
1412
  dflex: true,
@@ -1482,7 +1428,7 @@ function TableCreateButton(_a) {
1482
1428
  icon,
1483
1429
  children
1484
1430
  } = _a,
1485
- props = __rest$1(_a, ["icon", "children"]);
1431
+ props = __rest(_a, ["icon", "children"]);
1486
1432
  return jsxRuntime.jsxs(admin.ButtonBarDialogButton, Object.assign({}, props, {
1487
1433
  children: [jsxRuntime.jsx(ui.Icon, {
1488
1434
  path: icon !== null && icon !== void 0 ? icon : mdiPlusThick
@@ -1491,7 +1437,7 @@ function TableCreateButton(_a) {
1491
1437
  }
1492
1438
 
1493
1439
  function TableFilterButton(_a) {
1494
- var props = __rest$1(_a, []);
1440
+ var props = __rest(_a, []);
1495
1441
  // return <Button scheme="secondary" {...props}><Icon path={mdiFilter} /></Button>
1496
1442
  return jsxRuntime.jsxs(ui.Popover, {
1497
1443
  side: "bottom-end",
@@ -1538,7 +1484,7 @@ function TableTopBar(_a) {
1538
1484
  title,
1539
1485
  children
1540
1486
  } = _a,
1541
- props = __rest$1(_a, ["title", "children"]);
1487
+ props = __rest(_a, ["title", "children"]);
1542
1488
  return jsxRuntime.jsxs("div", Object.assign({
1543
1489
  dflex: true,
1544
1490
  flexRow: true,
@@ -2014,7 +1960,7 @@ function ItemEditDialog(_a) {
2014
1960
  onClose,
2015
1961
  formikProps
2016
1962
  } = _a,
2017
- 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"]);
1963
+ 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"]);
2018
1964
  const {
2019
1965
  isInitialLoading,
2020
1966
  isFetching,
@@ -2210,7 +2156,7 @@ function DialogRenderer({
2210
2156
  invalidateQueryKey,
2211
2157
  queryId
2212
2158
  }) {
2213
- const props = __rest$1(config, ["type"]);
2159
+ const props = __rest(config, ["type"]);
2214
2160
  if (config.type === "dialog") return jsxRuntime.jsx(ItemEditDialog, Object.assign({}, props, {
2215
2161
  queryId: queryId,
2216
2162
  invalidateQueryKey: invalidateQueryKey,
@@ -2265,7 +2211,7 @@ function ItemDeleteDialog(_a) {
2265
2211
  show,
2266
2212
  onClose
2267
2213
  } = _a,
2268
- props = __rest$1(_a, ["title", "actionButtonLabel", "itemLabel", "queryId", "api", "apiFn", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
2214
+ props = __rest(_a, ["title", "actionButtonLabel", "itemLabel", "queryId", "api", "apiFn", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
2269
2215
  const fn = apiFn ? api$1[apiFn] : api$1.delete;
2270
2216
  const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(fn, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey) : api.useApiMutation(fn, api$1.queryKey);
2271
2217
  const mutate = api.useMutate(mutation, {
@@ -2453,7 +2399,7 @@ function TableRowPublishPostButton$1(_a) {
2453
2399
  status,
2454
2400
  invalidateQueryKey
2455
2401
  } = _a,
2456
- props = __rest$1(_a, ["id", "api", "status", "invalidateQueryKey"]);
2402
+ props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
2457
2403
  const isDraft = status == "draft";
2458
2404
  const mutation = api.useInvalidateParentMutation(isDraft ? api$1.publish : api$1.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey, {
2459
2405
  networkMode: "always"
@@ -2515,7 +2461,7 @@ function ActionButton(_a) {
2515
2461
  var {
2516
2462
  onClick
2517
2463
  } = _a,
2518
- props = __rest$1(_a, ["onClick"]);
2464
+ props = __rest(_a, ["onClick"]);
2519
2465
  const handleClick = React__default["default"].useCallback(event => {
2520
2466
  event === null || event === void 0 ? void 0 : event.preventDefault();
2521
2467
  event === null || event === void 0 ? void 0 : event.stopPropagation();
@@ -2553,7 +2499,7 @@ function useTableProps(api, table, rowActions) {
2553
2499
  onRowClick,
2554
2500
  columns: c
2555
2501
  } = table,
2556
- props = __rest$1(table, ["onRowClick", "columns"]);
2502
+ props = __rest(table, ["onRowClick", "columns"]);
2557
2503
  const onRowClickHandler = React__default["default"].useCallback(item => {
2558
2504
  var _a;
2559
2505
  const config = react.runIfFn(onRowClick, item);
@@ -2617,7 +2563,7 @@ function TableView(_a) {
2617
2563
  subtitle,
2618
2564
  screen
2619
2565
  } = _a,
2620
- props = __rest$1(_a, ["queryField", "title", "subtitle", "screen"]);
2566
+ props = __rest(_a, ["queryField", "title", "subtitle", "screen"]);
2621
2567
  const id = useId(queryField);
2622
2568
  const _screen = react.runIfFn(screen, id);
2623
2569
  return jsxRuntime.jsx(PageContainer, Object.assign({
@@ -2820,7 +2766,7 @@ function MultiQueryWrapper(_a) {
2820
2766
  config,
2821
2767
  tabbed
2822
2768
  } = _a,
2823
- props = __rest$1(_a, ["queries", "config", "tabbed"]);
2769
+ props = __rest(_a, ["queries", "config", "tabbed"]);
2824
2770
  const {
2825
2771
  data,
2826
2772
  isFetching,
@@ -2848,7 +2794,7 @@ function ScreenRenderer(_a) {
2848
2794
  config,
2849
2795
  tabbed
2850
2796
  } = _a,
2851
- props = __rest$1(_a, ["config", "tabbed"]);
2797
+ props = __rest(_a, ["config", "tabbed"]);
2852
2798
  if (config.type === "table") return jsxRuntime.jsx(TableView, Object.assign({}, config, props));
2853
2799
  if (config.type === "tabbed") return jsxRuntime.jsx(TabbedView, Object.assign({}, config, props));
2854
2800
  if (config.type === "details") return jsxRuntime.jsx(DetailsView, Object.assign({}, config, {
@@ -2868,7 +2814,7 @@ function ScreenRenderer(_a) {
2868
2814
  *
2869
2815
  */
2870
2816
  function Content(_a) {
2871
- var props = __rest$1(_a, []);
2817
+ var props = __rest(_a, []);
2872
2818
  return jsxRuntime.jsx("div", Object.assign({
2873
2819
  w: "100%",
2874
2820
  h: "100%",
@@ -2900,7 +2846,7 @@ function MenuButton(_a) {
2900
2846
  selected,
2901
2847
  children
2902
2848
  } = _a,
2903
- props = __rest$1(_a, ["depth", "darkMode", "icon", "selected", "children"]);
2849
+ props = __rest(_a, ["depth", "darkMode", "icon", "selected", "children"]);
2904
2850
  return jsxRuntime.jsxs(ui.Button, Object.assign({
2905
2851
  as: "li",
2906
2852
  minH: "8",
@@ -2935,7 +2881,7 @@ function MenuItem(_a) {
2935
2881
  darkMode,
2936
2882
  subMenu
2937
2883
  } = _a,
2938
- props = __rest$1(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
2884
+ props = __rest(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
2939
2885
  const location = reactRouterDom.useLocation();
2940
2886
  const selected = path == "/" ? location.pathname == "/" : location.pathname.startsWith(path.startsWith("/") ? path : `/${path}`);
2941
2887
  const match = reactRouterDom.useMatch("/" + path) != null;
@@ -2973,7 +2919,7 @@ function NextMenuItem(_a) {
2973
2919
  darkMode,
2974
2920
  subMenu
2975
2921
  } = _a,
2976
- props = __rest$1(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
2922
+ props = __rest(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
2977
2923
  const {
2978
2924
  pathname
2979
2925
  } = router.useRouter();
@@ -3014,7 +2960,7 @@ function Menu(_a) {
3014
2960
  config,
3015
2961
  useNextRouter
3016
2962
  } = _a,
3017
- props = __rest$1(_a, ["darkMode", "config", "useNextRouter"]);
2963
+ props = __rest(_a, ["darkMode", "config", "useNextRouter"]);
3018
2964
  const Comp = useNextRouter ? NextMenuItem : MenuItem;
3019
2965
  return jsxRuntime.jsx("ul", Object.assign({}, props, {
3020
2966
  children: config.map((item, index) => {
@@ -3059,7 +3005,7 @@ function Sidebar(_a) {
3059
3005
  color,
3060
3006
  darkMode
3061
3007
  } = _a,
3062
- props = __rest$1(_a, ["show", "logo", "title", "menuConfig", "color", "darkMode"]);
3008
+ props = __rest(_a, ["show", "logo", "title", "menuConfig", "color", "darkMode"]);
3063
3009
  return jsxRuntime.jsxs("div", Object.assign({
3064
3010
  w: "64",
3065
3011
  minH: "screen",
@@ -3097,7 +3043,7 @@ function Logo(_a) {
3097
3043
  height,
3098
3044
  darkMode
3099
3045
  } = _a,
3100
- props = __rest$1(_a, ["width", "height", "darkMode"]);
3046
+ props = __rest(_a, ["width", "height", "darkMode"]);
3101
3047
  return jsxRuntime.jsx("div", Object.assign({}, props, {
3102
3048
  children: jsxRuntime.jsx(Image__default["default"], {
3103
3049
  src: `/logo_${darkMode ? "light" : "dark"}.png`,
@@ -3118,7 +3064,7 @@ function AdminLayout(_a) {
3118
3064
  title,
3119
3065
  menuConfig
3120
3066
  } = _a,
3121
- props = __rest$1(_a, ["color", "darkMode", "logo", "title", "menuConfig"]);
3067
+ props = __rest(_a, ["color", "darkMode", "logo", "title", "menuConfig"]);
3122
3068
  return jsxRuntime.jsxs("div", Object.assign({
3123
3069
  w: "full",
3124
3070
  h: "screen",
@@ -3208,7 +3154,7 @@ function AttachDialog(_a) {
3208
3154
  formikProps,
3209
3155
  getItemName
3210
3156
  } = _a,
3211
- 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"]);
3157
+ 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"]);
3212
3158
  const queryClient = reactQuery.useQueryClient();
3213
3159
  const {
3214
3160
  data: attached,
@@ -3334,7 +3280,7 @@ function ListItem(_a) {
3334
3280
  value,
3335
3281
  checked
3336
3282
  } = _a,
3337
- props = __rest$1(_a, ["label", "value", "checked"]);
3283
+ props = __rest(_a, ["label", "value", "checked"]);
3338
3284
  return jsxRuntime.jsxs("div", Object.assign({
3339
3285
  dflex: true,
3340
3286
  alignItems: "center",
@@ -3379,7 +3325,7 @@ function FormActionDialog(_a) {
3379
3325
  onClose,
3380
3326
  formikProps
3381
3327
  } = _a,
3382
- 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"]);
3328
+ 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"]);
3383
3329
  const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(queryFn, queryKey, queryOptions) : api.useApiMutation(queryFn, queryKey, queryId, queryOptions);
3384
3330
  const mutate = api.useMutate(mutation, {
3385
3331
  onSuccess,
@@ -3431,7 +3377,7 @@ function PageSectionTitle(_a) {
3431
3377
  var {
3432
3378
  children
3433
3379
  } = _a,
3434
- props = __rest$1(_a, ["children"]);
3380
+ props = __rest(_a, ["children"]);
3435
3381
  return jsxRuntime.jsx("div", Object.assign({
3436
3382
  trait: "typo.h6",
3437
3383
  mb: "5"
@@ -3445,7 +3391,7 @@ const PageStateContainer = /*#__PURE__*/React__default["default"].forwardRef((_a
3445
3391
  loading = false,
3446
3392
  children
3447
3393
  } = _a,
3448
- props = __rest$1(_a, ["loading", "children"]);
3394
+ props = __rest(_a, ["loading", "children"]);
3449
3395
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
3450
3396
  children: [loading && jsxRuntime.jsx(components.QueryLoadingState, {
3451
3397
  w: "full",
@@ -3467,7 +3413,7 @@ function PageSubSectionTitle(_a) {
3467
3413
  var {
3468
3414
  children
3469
3415
  } = _a,
3470
- props = __rest$1(_a, ["children"]);
3416
+ props = __rest(_a, ["children"]);
3471
3417
  return jsxRuntime.jsx("div", Object.assign({
3472
3418
  trait: "typo.h6",
3473
3419
  mb: "3"
@@ -3496,7 +3442,7 @@ function StatusBadge(_a) {
3496
3442
  var {
3497
3443
  status
3498
3444
  } = _a,
3499
- props = __rest$1(_a, ["status"]);
3445
+ props = __rest(_a, ["status"]);
3500
3446
  return jsxRuntime.jsx(ui.Badge, Object.assign({
3501
3447
  size: "sm",
3502
3448
  variant: "glass",
@@ -3514,7 +3460,7 @@ function TableRowActionButton(_a) {
3514
3460
  icon,
3515
3461
  children
3516
3462
  } = _a,
3517
- props = __rest$1(_a, ["icon", "children"]);
3463
+ props = __rest(_a, ["icon", "children"]);
3518
3464
  return jsxRuntime.jsxs(ui.Button, Object.assign({
3519
3465
  dflex: true,
3520
3466
  alignContent: "center",
@@ -3538,7 +3484,7 @@ function TableRowViewButton(_a) {
3538
3484
  var {
3539
3485
  path
3540
3486
  } = _a,
3541
- props = __rest$1(_a, ["path"]);
3487
+ props = __rest(_a, ["path"]);
3542
3488
  const openPage = React__default["default"].useCallback(event => {
3543
3489
  event === null || event === void 0 ? void 0 : event.preventDefault();
3544
3490
  event === null || event === void 0 ? void 0 : event.stopPropagation();
@@ -3554,7 +3500,7 @@ function TableRowNavigateButton(_a) {
3554
3500
  var {
3555
3501
  path
3556
3502
  } = _a,
3557
- props = __rest$1(_a, ["path"]);
3503
+ props = __rest(_a, ["path"]);
3558
3504
  const navigate = reactRouterDom.useNavigate();
3559
3505
  const handleClick = React__default["default"].useCallback(event => {
3560
3506
  event === null || event === void 0 ? void 0 : event.preventDefault();
@@ -3572,7 +3518,7 @@ function TableRowActionDialogButton(_a) {
3572
3518
  icon,
3573
3519
  children
3574
3520
  } = _a,
3575
- props = __rest$1(_a, ["icon", "children"]);
3521
+ props = __rest(_a, ["icon", "children"]);
3576
3522
  return jsxRuntime.jsxs(admin.DialogButton, Object.assign({
3577
3523
  dflex: true,
3578
3524
  alignContent: "center",
@@ -3596,7 +3542,7 @@ function TableRowEditButton(_a) {
3596
3542
  var {
3597
3543
  children
3598
3544
  } = _a,
3599
- props = __rest$1(_a, ["children"]);
3545
+ props = __rest(_a, ["children"]);
3600
3546
  return jsxRuntime.jsx(TableRowActionDialogButton, Object.assign({
3601
3547
  icon: mdiPencil
3602
3548
  }, props, {
@@ -3608,7 +3554,7 @@ function TableRowDeleteButton(_a) {
3608
3554
  var {
3609
3555
  children
3610
3556
  } = _a,
3611
- props = __rest$1(_a, ["children"]);
3557
+ props = __rest(_a, ["children"]);
3612
3558
  return jsxRuntime.jsx(TableRowActionDialogButton, Object.assign({
3613
3559
  icon: mdiDelete
3614
3560
  }, props, {
@@ -3625,7 +3571,7 @@ function TableRowActionBar(_a) {
3625
3571
  deleteDialog,
3626
3572
  children
3627
3573
  } = _a,
3628
- props = __rest$1(_a, ["publishId", "viewPath", "navigatePath", "editDialog", "deleteDialog", "children"]);
3574
+ props = __rest(_a, ["publishId", "viewPath", "navigatePath", "editDialog", "deleteDialog", "children"]);
3629
3575
  return jsxRuntime.jsxs("div", Object.assign({
3630
3576
  dflex: true,
3631
3577
  spaceX: "1",
@@ -3650,7 +3596,7 @@ function TableRowPublishPostButton(_a) {
3650
3596
  status,
3651
3597
  invalidateQueryKey
3652
3598
  } = _a,
3653
- props = __rest$1(_a, ["id", "api", "status", "invalidateQueryKey"]);
3599
+ props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
3654
3600
  const isDraft = status == "draft";
3655
3601
  const mutation = api.useInvalidateParentMutation(isDraft ? api$1.publish : api$1.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey, {
3656
3602
  networkMode: "always"
package/index.esm.js CHANGED
@@ -4,7 +4,7 @@ import Link from 'next/link';
4
4
  import React, { useRef, useCallback, useContext as useContext$2, useLayoutEffect, useEffect, createContext } from 'react';
5
5
  import { INVALIDATE_API, API } from '@compill/admin-api';
6
6
  import { useApiMutation, useMutate, useInvalidateMutation, useApiQuery, useInvalidateQuery, useInvalidateParentMutation, useApiQueries } from '@compill/api';
7
- import { useFormikContext, Field, Formik, Form } from 'formik';
7
+ import { useFormikContext, Formik, Form } from 'formik';
8
8
  import { useNavigate, useParams, Outlet, useLocation, useMatch, Link as Link$1 } from 'react-router-dom';
9
9
  import { ButtonBarButton as ButtonBarButton$1, ButtonBarSubmitButton as ButtonBarSubmitButton$1, PageSectionTitle as PageSectionTitle$1, ButtonBar as ButtonBar$1, ButtonBarDialogButton as ButtonBarDialogButton$1, TableRowActionButton as TableRowActionButton$1, DialogButton as DialogButton$1 } from '@compill/admin';
10
10
  import { toast } from 'react-toastify';
@@ -12,7 +12,8 @@ import 'react/jsx-runtime';
12
12
  import { FlexCenter, QueryLoadingState, RetryOnError, TabContainer, ModalLoadingOverlay } from '@compill/components';
13
13
  import { FormProvider, TextArea, FormRenderer, mergeInitialFormValues, FieldLabel, SubmitButton } from '@compill/form';
14
14
  import { createContext as createContext$1, runIfFn, isFunction } from '@soperio/react';
15
- import { Editor } from '@compill/editor';
15
+ import { FormEditor } from '@compill/form-editor';
16
+ import { ImageExtension } from '@compill/editor';
16
17
  import { createPortal } from 'react-dom';
17
18
  import { useRouter } from 'next/router';
18
19
  import { TableContextProvider, useTableContext, Table } from '@compill/table';
@@ -36,7 +37,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
36
37
  PERFORMANCE OF THIS SOFTWARE.
37
38
  ***************************************************************************** */
38
39
 
39
- function __rest$1(s, e) {
40
+ function __rest(s, e) {
40
41
  var t = {};
41
42
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
42
43
  t[p] = s[p];
@@ -67,7 +68,7 @@ function SectionTitle(_a) {
67
68
  var {
68
69
  children
69
70
  } = _a,
70
- props = __rest$1(_a, ["children"]);
71
+ props = __rest(_a, ["children"]);
71
72
  return jsx("h2", Object.assign({
72
73
  textSize: "xl",
73
74
  fontWeight: "600",
@@ -100,7 +101,7 @@ function Breadcrumbs(_a) {
100
101
  var {
101
102
  breadcrumbs
102
103
  } = _a,
103
- props = __rest$1(_a, ["breadcrumbs"]);
104
+ props = __rest(_a, ["breadcrumbs"]);
104
105
  return jsx("div", Object.assign({
105
106
  dflex: true,
106
107
  alignItems: "center",
@@ -137,7 +138,7 @@ function DialogButton(_a) {
137
138
  var {
138
139
  buildDialog
139
140
  } = _a,
140
- props = __rest$1(_a, ["buildDialog"]);
141
+ props = __rest(_a, ["buildDialog"]);
141
142
  const [showDialog, setShowDialog] = React.useState(false);
142
143
  const onShowDialog = React.useCallback(event => {
143
144
  event === null || event === void 0 ? void 0 : event.preventDefault();
@@ -158,7 +159,7 @@ function ButtonBar(_a) {
158
159
  var {
159
160
  children
160
161
  } = _a,
161
- props = __rest$1(_a, ["children"]);
162
+ props = __rest(_a, ["children"]);
162
163
  return jsx("div", Object.assign({
163
164
  dflex: true,
164
165
  border: "1px",
@@ -176,7 +177,7 @@ const ButtonBarButton = /*#__PURE__*/React.forwardRef(function (_a, ref) {
176
177
  icon,
177
178
  children
178
179
  } = _a,
179
- props = __rest$1(_a, ["icon", "children"]);
180
+ props = __rest(_a, ["icon", "children"]);
180
181
  return jsxs(Button, Object.assign({
181
182
  scheme: "dark",
182
183
  size: "sm",
@@ -202,7 +203,7 @@ const ButtonBarSubmitButton = /*#__PURE__*/React.forwardRef(function (_a, ref) {
202
203
  icon,
203
204
  children
204
205
  } = _a,
205
- props = __rest$1(_a, ["useDirty", "disabled", "icon", "children"]);
206
+ props = __rest(_a, ["useDirty", "disabled", "icon", "children"]);
206
207
  const {
207
208
  dirty,
208
209
  handleSubmit
@@ -236,7 +237,7 @@ function ButtonBarDialogButton(_a) {
236
237
  icon,
237
238
  children
238
239
  } = _a,
239
- props = __rest$1(_a, ["icon", "children"]);
240
+ props = __rest(_a, ["icon", "children"]);
240
241
  return jsxs(DialogButton, Object.assign({
241
242
  scheme: "dark",
242
243
  size: "sm",
@@ -258,7 +259,7 @@ function InvalidateButton(_a) {
258
259
  var {
259
260
  pathOrPermalink
260
261
  } = _a,
261
- props = __rest$1(_a, ["pathOrPermalink"]);
262
+ props = __rest(_a, ["pathOrPermalink"]);
262
263
  const api = INVALIDATE_API.new(pathOrPermalink);
263
264
  const mutation = useApiMutation(api.invalidate, api.queryKey);
264
265
  const invalidate = useMutate(mutation, {
@@ -276,7 +277,7 @@ function NavigateButton(_a) {
276
277
  var {
277
278
  path
278
279
  } = _a,
279
- props = __rest$1(_a, ["path"]);
280
+ props = __rest(_a, ["path"]);
280
281
  const navigate = useNavigate();
281
282
  const handleClick = React.useCallback(() => {
282
283
  navigate(path);
@@ -302,7 +303,7 @@ function PublishButton(_a) {
302
303
  queryId,
303
304
  api
304
305
  } = _a,
305
- props = __rest$1(_a, ["status", "queryId", "api"]);
306
+ props = __rest(_a, ["status", "queryId", "api"]);
306
307
  const isDraft = status == "draft";
307
308
  const mutation = useInvalidateMutation(isDraft ? api.publish : api.unpublish, api.queryKey, queryId, {
308
309
  networkMode: "always"
@@ -709,7 +710,7 @@ function useHotkeys(keys, callback, options, dependencies) {
709
710
 
710
711
  function UpdateButton(_a) {
711
712
  var _b;
712
- var props = __rest$1(_a, []);
713
+ var props = __rest(_a, []);
713
714
  const {
714
715
  dirty,
715
716
  handleSubmit
@@ -735,7 +736,7 @@ function ViewButton(_a) {
735
736
  path,
736
737
  icon
737
738
  } = _a,
738
- props = __rest$1(_a, ["path", "icon"]);
739
+ props = __rest(_a, ["path", "icon"]);
739
740
  const openPage = React.useCallback(() => {
740
741
  window.open(path, '_blank');
741
742
  }, [path]);
@@ -794,7 +795,7 @@ function PageContainer(_a) {
794
795
  var {
795
796
  children
796
797
  } = _a,
797
- props = __rest$1(_a, ["children"]);
798
+ props = __rest(_a, ["children"]);
798
799
  return jsx(Container, Object.assign({
799
800
  center: true,
800
801
  dflex: true,
@@ -805,68 +806,11 @@ function PageContainer(_a) {
805
806
  }));
806
807
  }
807
808
 
808
- /******************************************************************************
809
- Copyright (c) Microsoft Corporation.
810
-
811
- Permission to use, copy, modify, and/or distribute this software for any
812
- purpose with or without fee is hereby granted.
813
-
814
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
815
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
816
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
817
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
818
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
819
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
820
- PERFORMANCE OF THIS SOFTWARE.
821
- ***************************************************************************** */
822
-
823
- function __rest(s, e) {
824
- var t = {};
825
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
826
- t[p] = s[p];
827
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
828
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
829
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
830
- t[p[i]] = s[p[i]];
831
- }
832
- return t;
833
- }
834
-
835
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
836
- var e = new Error(message);
837
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
838
- };
839
-
840
- function FormEditor(_a) {
841
- // const { initialValues } = useFormikContext();
842
- var {
843
- name,
844
- placeholder
845
- } = _a,
846
- props = __rest(_a, ["name", "placeholder"]);
847
- return jsx(Field, {
848
- name: name,
849
- children: ({
850
- field,
851
- meta
852
- }) => jsx(Editor, Object.assign({}, props, {
853
- // placeholder={placeholder}
854
- defaultValue: meta.initialValue,
855
- onChange: e => field.onChange({
856
- target: {
857
- name: name,
858
- value: e
859
- }
860
- })
861
- }))
862
- });
863
- }
864
-
865
809
  function PageMain(_a) {
866
810
  var {
867
811
  children
868
812
  } = _a,
869
- props = __rest$1(_a, ["children"]);
813
+ props = __rest(_a, ["children"]);
870
814
  return jsx(Tile, Object.assign({
871
815
  scheme: "light",
872
816
  p: "5"
@@ -879,7 +823,8 @@ function PageContentEditor(_a) {
879
823
  var {
880
824
  name
881
825
  } = _a,
882
- props = __rest$1(_a, ["name"]);
826
+ props = __rest(_a, ["name"]);
827
+ const extensions = [ImageExtension];
883
828
  return jsx(PageMain, Object.assign({
884
829
  h: "min"
885
830
  }, props, {
@@ -889,7 +834,8 @@ function PageContentEditor(_a) {
889
834
  maxW: props.maxW,
890
835
  // w={props.w}
891
836
  name: name,
892
- placeHolder: "Write here..."
837
+ placeHolder: "Write here...",
838
+ extensions: extensions
893
839
  })
894
840
  }));
895
841
  }
@@ -903,7 +849,7 @@ function PageQueryStateContainerInner(_a) {
903
849
  errorStyles,
904
850
  children
905
851
  } = _a,
906
- props = __rest$1(_a, ["queryId", "api", "apiFn", "loadingStyles", "errorStyles", "children"]);
852
+ props = __rest(_a, ["queryId", "api", "apiFn", "loadingStyles", "errorStyles", "children"]);
907
853
  // @ts-ignore
908
854
  const {
909
855
  data,
@@ -929,7 +875,7 @@ function PageSidebar(_a) {
929
875
  var {
930
876
  children
931
877
  } = _a,
932
- props = __rest$1(_a, ["children"]);
878
+ props = __rest(_a, ["children"]);
933
879
  return jsx("div", Object.assign({
934
880
  w: "112",
935
881
  minW: "112",
@@ -947,7 +893,7 @@ function PageSidebarSection(_a) {
947
893
  title,
948
894
  children
949
895
  } = _a,
950
- props = __rest$1(_a, ["title", "children"]);
896
+ props = __rest(_a, ["title", "children"]);
951
897
  return jsxs("div", Object.assign({
952
898
  w: "full"
953
899
  }, props, {
@@ -961,7 +907,7 @@ function PageTitle(_a) {
961
907
  var {
962
908
  children
963
909
  } = _a,
964
- props = __rest$1(_a, ["children"]);
910
+ props = __rest(_a, ["children"]);
965
911
  return jsx("div", Object.assign({
966
912
  trait: "typo.h5"
967
913
  }, props, {
@@ -975,7 +921,7 @@ function PageTopBar(_a) {
975
921
  breadcrumbs,
976
922
  children
977
923
  } = _a,
978
- props = __rest$1(_a, ["title", "breadcrumbs", "children"]);
924
+ props = __rest(_a, ["title", "breadcrumbs", "children"]);
979
925
  return jsxs(FlexCenter, Object.assign({
980
926
  gap: "3",
981
927
  minH: "9"
@@ -1008,7 +954,7 @@ function PageTabbedTopBar(_a) {
1008
954
  breadcrumbs,
1009
955
  children
1010
956
  } = _a,
1011
- props = __rest$1(_a, ["title", "breadcrumbs", "children"]);
957
+ props = __rest(_a, ["title", "breadcrumbs", "children"]);
1012
958
  const ref = /*#__PURE__*/React.createRef();
1013
959
  const {
1014
960
  setContainerEl
@@ -1162,7 +1108,7 @@ function DetailsView(_a) {
1162
1108
  screen,
1163
1109
  tabbed
1164
1110
  } = _a,
1165
- props = __rest$1(_a, ["queryField", "api", "useNextRouter", "processInput", "screen", "tabbed"]);
1111
+ props = __rest(_a, ["queryField", "api", "useNextRouter", "processInput", "screen", "tabbed"]);
1166
1112
  const id = useQueryField(queryField, useNextRouter);
1167
1113
  const ref = React.useRef(null);
1168
1114
  return jsx(PageQueryStateContainer, Object.assign({
@@ -1325,7 +1271,7 @@ function QueryWrapper(_a) {
1325
1271
  config,
1326
1272
  tabbed
1327
1273
  } = _a,
1328
- props = __rest$1(_a, ["api", "queryField", "fn", "transformFn", "config", "tabbed"]);
1274
+ props = __rest(_a, ["api", "queryField", "fn", "transformFn", "config", "tabbed"]);
1329
1275
  const {
1330
1276
  id,
1331
1277
  api: mApi
@@ -1354,7 +1300,7 @@ function TabbedView(_a) {
1354
1300
  api,
1355
1301
  screen
1356
1302
  } = _a;
1357
- __rest$1(_a, ["queryField", "api", "screen"]);
1303
+ __rest(_a, ["queryField", "api", "screen"]);
1358
1304
  const {
1359
1305
  [queryField]: id
1360
1306
  } = useParams();
@@ -1450,7 +1396,7 @@ function TableContainer(_a) {
1450
1396
  columns,
1451
1397
  children
1452
1398
  } = _a,
1453
- props = __rest$1(_a, ["initialPageSize", "initialVisibleColumns", "columns", "children"]);
1399
+ props = __rest(_a, ["initialPageSize", "initialVisibleColumns", "columns", "children"]);
1454
1400
  return jsx("div", Object.assign({
1455
1401
  w: "full",
1456
1402
  dflex: true,
@@ -1472,7 +1418,7 @@ function TableCreateButton(_a) {
1472
1418
  icon,
1473
1419
  children
1474
1420
  } = _a,
1475
- props = __rest$1(_a, ["icon", "children"]);
1421
+ props = __rest(_a, ["icon", "children"]);
1476
1422
  return jsxs(ButtonBarDialogButton$1, Object.assign({}, props, {
1477
1423
  children: [jsx(Icon, {
1478
1424
  path: icon !== null && icon !== void 0 ? icon : mdiPlusThick
@@ -1481,7 +1427,7 @@ function TableCreateButton(_a) {
1481
1427
  }
1482
1428
 
1483
1429
  function TableFilterButton(_a) {
1484
- var props = __rest$1(_a, []);
1430
+ var props = __rest(_a, []);
1485
1431
  // return <Button scheme="secondary" {...props}><Icon path={mdiFilter} /></Button>
1486
1432
  return jsxs(Popover, {
1487
1433
  side: "bottom-end",
@@ -1528,7 +1474,7 @@ function TableTopBar(_a) {
1528
1474
  title,
1529
1475
  children
1530
1476
  } = _a,
1531
- props = __rest$1(_a, ["title", "children"]);
1477
+ props = __rest(_a, ["title", "children"]);
1532
1478
  return jsxs("div", Object.assign({
1533
1479
  dflex: true,
1534
1480
  flexRow: true,
@@ -2004,7 +1950,7 @@ function ItemEditDialog(_a) {
2004
1950
  onClose,
2005
1951
  formikProps
2006
1952
  } = _a,
2007
- 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"]);
1953
+ 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"]);
2008
1954
  const {
2009
1955
  isInitialLoading,
2010
1956
  isFetching,
@@ -2200,7 +2146,7 @@ function DialogRenderer({
2200
2146
  invalidateQueryKey,
2201
2147
  queryId
2202
2148
  }) {
2203
- const props = __rest$1(config, ["type"]);
2149
+ const props = __rest(config, ["type"]);
2204
2150
  if (config.type === "dialog") return jsx(ItemEditDialog, Object.assign({}, props, {
2205
2151
  queryId: queryId,
2206
2152
  invalidateQueryKey: invalidateQueryKey,
@@ -2255,7 +2201,7 @@ function ItemDeleteDialog(_a) {
2255
2201
  show,
2256
2202
  onClose
2257
2203
  } = _a,
2258
- props = __rest$1(_a, ["title", "actionButtonLabel", "itemLabel", "queryId", "api", "apiFn", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
2204
+ props = __rest(_a, ["title", "actionButtonLabel", "itemLabel", "queryId", "api", "apiFn", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
2259
2205
  const fn = apiFn ? api[apiFn] : api.delete;
2260
2206
  const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(fn, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey) : useApiMutation(fn, api.queryKey);
2261
2207
  const mutate = useMutate(mutation, {
@@ -2443,7 +2389,7 @@ function TableRowPublishPostButton$1(_a) {
2443
2389
  status,
2444
2390
  invalidateQueryKey
2445
2391
  } = _a,
2446
- props = __rest$1(_a, ["id", "api", "status", "invalidateQueryKey"]);
2392
+ props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
2447
2393
  const isDraft = status == "draft";
2448
2394
  const mutation = useInvalidateParentMutation(isDraft ? api.publish : api.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey, {
2449
2395
  networkMode: "always"
@@ -2505,7 +2451,7 @@ function ActionButton(_a) {
2505
2451
  var {
2506
2452
  onClick
2507
2453
  } = _a,
2508
- props = __rest$1(_a, ["onClick"]);
2454
+ props = __rest(_a, ["onClick"]);
2509
2455
  const handleClick = React.useCallback(event => {
2510
2456
  event === null || event === void 0 ? void 0 : event.preventDefault();
2511
2457
  event === null || event === void 0 ? void 0 : event.stopPropagation();
@@ -2543,7 +2489,7 @@ function useTableProps(api, table, rowActions) {
2543
2489
  onRowClick,
2544
2490
  columns: c
2545
2491
  } = table,
2546
- props = __rest$1(table, ["onRowClick", "columns"]);
2492
+ props = __rest(table, ["onRowClick", "columns"]);
2547
2493
  const onRowClickHandler = React.useCallback(item => {
2548
2494
  var _a;
2549
2495
  const config = runIfFn(onRowClick, item);
@@ -2607,7 +2553,7 @@ function TableView(_a) {
2607
2553
  subtitle,
2608
2554
  screen
2609
2555
  } = _a,
2610
- props = __rest$1(_a, ["queryField", "title", "subtitle", "screen"]);
2556
+ props = __rest(_a, ["queryField", "title", "subtitle", "screen"]);
2611
2557
  const id = useId(queryField);
2612
2558
  const _screen = runIfFn(screen, id);
2613
2559
  return jsx(PageContainer, Object.assign({
@@ -2810,7 +2756,7 @@ function MultiQueryWrapper(_a) {
2810
2756
  config,
2811
2757
  tabbed
2812
2758
  } = _a,
2813
- props = __rest$1(_a, ["queries", "config", "tabbed"]);
2759
+ props = __rest(_a, ["queries", "config", "tabbed"]);
2814
2760
  const {
2815
2761
  data,
2816
2762
  isFetching,
@@ -2838,7 +2784,7 @@ function ScreenRenderer(_a) {
2838
2784
  config,
2839
2785
  tabbed
2840
2786
  } = _a,
2841
- props = __rest$1(_a, ["config", "tabbed"]);
2787
+ props = __rest(_a, ["config", "tabbed"]);
2842
2788
  if (config.type === "table") return jsx(TableView, Object.assign({}, config, props));
2843
2789
  if (config.type === "tabbed") return jsx(TabbedView, Object.assign({}, config, props));
2844
2790
  if (config.type === "details") return jsx(DetailsView, Object.assign({}, config, {
@@ -2858,7 +2804,7 @@ function ScreenRenderer(_a) {
2858
2804
  *
2859
2805
  */
2860
2806
  function Content(_a) {
2861
- var props = __rest$1(_a, []);
2807
+ var props = __rest(_a, []);
2862
2808
  return jsx("div", Object.assign({
2863
2809
  w: "100%",
2864
2810
  h: "100%",
@@ -2890,7 +2836,7 @@ function MenuButton(_a) {
2890
2836
  selected,
2891
2837
  children
2892
2838
  } = _a,
2893
- props = __rest$1(_a, ["depth", "darkMode", "icon", "selected", "children"]);
2839
+ props = __rest(_a, ["depth", "darkMode", "icon", "selected", "children"]);
2894
2840
  return jsxs(Button, Object.assign({
2895
2841
  as: "li",
2896
2842
  minH: "8",
@@ -2925,7 +2871,7 @@ function MenuItem(_a) {
2925
2871
  darkMode,
2926
2872
  subMenu
2927
2873
  } = _a,
2928
- props = __rest$1(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
2874
+ props = __rest(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
2929
2875
  const location = useLocation();
2930
2876
  const selected = path == "/" ? location.pathname == "/" : location.pathname.startsWith(path.startsWith("/") ? path : `/${path}`);
2931
2877
  const match = useMatch("/" + path) != null;
@@ -2963,7 +2909,7 @@ function NextMenuItem(_a) {
2963
2909
  darkMode,
2964
2910
  subMenu
2965
2911
  } = _a,
2966
- props = __rest$1(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
2912
+ props = __rest(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
2967
2913
  const {
2968
2914
  pathname
2969
2915
  } = useRouter();
@@ -3004,7 +2950,7 @@ function Menu(_a) {
3004
2950
  config,
3005
2951
  useNextRouter
3006
2952
  } = _a,
3007
- props = __rest$1(_a, ["darkMode", "config", "useNextRouter"]);
2953
+ props = __rest(_a, ["darkMode", "config", "useNextRouter"]);
3008
2954
  const Comp = useNextRouter ? NextMenuItem : MenuItem;
3009
2955
  return jsx("ul", Object.assign({}, props, {
3010
2956
  children: config.map((item, index) => {
@@ -3049,7 +2995,7 @@ function Sidebar(_a) {
3049
2995
  color,
3050
2996
  darkMode
3051
2997
  } = _a,
3052
- props = __rest$1(_a, ["show", "logo", "title", "menuConfig", "color", "darkMode"]);
2998
+ props = __rest(_a, ["show", "logo", "title", "menuConfig", "color", "darkMode"]);
3053
2999
  return jsxs("div", Object.assign({
3054
3000
  w: "64",
3055
3001
  minH: "screen",
@@ -3087,7 +3033,7 @@ function Logo(_a) {
3087
3033
  height,
3088
3034
  darkMode
3089
3035
  } = _a,
3090
- props = __rest$1(_a, ["width", "height", "darkMode"]);
3036
+ props = __rest(_a, ["width", "height", "darkMode"]);
3091
3037
  return jsx("div", Object.assign({}, props, {
3092
3038
  children: jsx(Image, {
3093
3039
  src: `/logo_${darkMode ? "light" : "dark"}.png`,
@@ -3108,7 +3054,7 @@ function AdminLayout(_a) {
3108
3054
  title,
3109
3055
  menuConfig
3110
3056
  } = _a,
3111
- props = __rest$1(_a, ["color", "darkMode", "logo", "title", "menuConfig"]);
3057
+ props = __rest(_a, ["color", "darkMode", "logo", "title", "menuConfig"]);
3112
3058
  return jsxs("div", Object.assign({
3113
3059
  w: "full",
3114
3060
  h: "screen",
@@ -3198,7 +3144,7 @@ function AttachDialog(_a) {
3198
3144
  formikProps,
3199
3145
  getItemName
3200
3146
  } = _a,
3201
- 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"]);
3147
+ 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"]);
3202
3148
  const queryClient = useQueryClient();
3203
3149
  const {
3204
3150
  data: attached,
@@ -3324,7 +3270,7 @@ function ListItem(_a) {
3324
3270
  value,
3325
3271
  checked
3326
3272
  } = _a,
3327
- props = __rest$1(_a, ["label", "value", "checked"]);
3273
+ props = __rest(_a, ["label", "value", "checked"]);
3328
3274
  return jsxs("div", Object.assign({
3329
3275
  dflex: true,
3330
3276
  alignItems: "center",
@@ -3369,7 +3315,7 @@ function FormActionDialog(_a) {
3369
3315
  onClose,
3370
3316
  formikProps
3371
3317
  } = _a,
3372
- 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"]);
3318
+ 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"]);
3373
3319
  const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(queryFn, queryKey, queryOptions) : useApiMutation(queryFn, queryKey, queryId, queryOptions);
3374
3320
  const mutate = useMutate(mutation, {
3375
3321
  onSuccess,
@@ -3421,7 +3367,7 @@ function PageSectionTitle(_a) {
3421
3367
  var {
3422
3368
  children
3423
3369
  } = _a,
3424
- props = __rest$1(_a, ["children"]);
3370
+ props = __rest(_a, ["children"]);
3425
3371
  return jsx("div", Object.assign({
3426
3372
  trait: "typo.h6",
3427
3373
  mb: "5"
@@ -3435,7 +3381,7 @@ const PageStateContainer = /*#__PURE__*/React.forwardRef((_a, ref) => {
3435
3381
  loading = false,
3436
3382
  children
3437
3383
  } = _a,
3438
- props = __rest$1(_a, ["loading", "children"]);
3384
+ props = __rest(_a, ["loading", "children"]);
3439
3385
  return jsxs(Fragment, {
3440
3386
  children: [loading && jsx(QueryLoadingState, {
3441
3387
  w: "full",
@@ -3457,7 +3403,7 @@ function PageSubSectionTitle(_a) {
3457
3403
  var {
3458
3404
  children
3459
3405
  } = _a,
3460
- props = __rest$1(_a, ["children"]);
3406
+ props = __rest(_a, ["children"]);
3461
3407
  return jsx("div", Object.assign({
3462
3408
  trait: "typo.h6",
3463
3409
  mb: "3"
@@ -3486,7 +3432,7 @@ function StatusBadge(_a) {
3486
3432
  var {
3487
3433
  status
3488
3434
  } = _a,
3489
- props = __rest$1(_a, ["status"]);
3435
+ props = __rest(_a, ["status"]);
3490
3436
  return jsx(Badge, Object.assign({
3491
3437
  size: "sm",
3492
3438
  variant: "glass",
@@ -3504,7 +3450,7 @@ function TableRowActionButton(_a) {
3504
3450
  icon,
3505
3451
  children
3506
3452
  } = _a,
3507
- props = __rest$1(_a, ["icon", "children"]);
3453
+ props = __rest(_a, ["icon", "children"]);
3508
3454
  return jsxs(Button, Object.assign({
3509
3455
  dflex: true,
3510
3456
  alignContent: "center",
@@ -3528,7 +3474,7 @@ function TableRowViewButton(_a) {
3528
3474
  var {
3529
3475
  path
3530
3476
  } = _a,
3531
- props = __rest$1(_a, ["path"]);
3477
+ props = __rest(_a, ["path"]);
3532
3478
  const openPage = React.useCallback(event => {
3533
3479
  event === null || event === void 0 ? void 0 : event.preventDefault();
3534
3480
  event === null || event === void 0 ? void 0 : event.stopPropagation();
@@ -3544,7 +3490,7 @@ function TableRowNavigateButton(_a) {
3544
3490
  var {
3545
3491
  path
3546
3492
  } = _a,
3547
- props = __rest$1(_a, ["path"]);
3493
+ props = __rest(_a, ["path"]);
3548
3494
  const navigate = useNavigate();
3549
3495
  const handleClick = React.useCallback(event => {
3550
3496
  event === null || event === void 0 ? void 0 : event.preventDefault();
@@ -3562,7 +3508,7 @@ function TableRowActionDialogButton(_a) {
3562
3508
  icon,
3563
3509
  children
3564
3510
  } = _a,
3565
- props = __rest$1(_a, ["icon", "children"]);
3511
+ props = __rest(_a, ["icon", "children"]);
3566
3512
  return jsxs(DialogButton$1, Object.assign({
3567
3513
  dflex: true,
3568
3514
  alignContent: "center",
@@ -3586,7 +3532,7 @@ function TableRowEditButton(_a) {
3586
3532
  var {
3587
3533
  children
3588
3534
  } = _a,
3589
- props = __rest$1(_a, ["children"]);
3535
+ props = __rest(_a, ["children"]);
3590
3536
  return jsx(TableRowActionDialogButton, Object.assign({
3591
3537
  icon: mdiPencil
3592
3538
  }, props, {
@@ -3598,7 +3544,7 @@ function TableRowDeleteButton(_a) {
3598
3544
  var {
3599
3545
  children
3600
3546
  } = _a,
3601
- props = __rest$1(_a, ["children"]);
3547
+ props = __rest(_a, ["children"]);
3602
3548
  return jsx(TableRowActionDialogButton, Object.assign({
3603
3549
  icon: mdiDelete
3604
3550
  }, props, {
@@ -3615,7 +3561,7 @@ function TableRowActionBar(_a) {
3615
3561
  deleteDialog,
3616
3562
  children
3617
3563
  } = _a,
3618
- props = __rest$1(_a, ["publishId", "viewPath", "navigatePath", "editDialog", "deleteDialog", "children"]);
3564
+ props = __rest(_a, ["publishId", "viewPath", "navigatePath", "editDialog", "deleteDialog", "children"]);
3619
3565
  return jsxs("div", Object.assign({
3620
3566
  dflex: true,
3621
3567
  spaceX: "1",
@@ -3640,7 +3586,7 @@ function TableRowPublishPostButton(_a) {
3640
3586
  status,
3641
3587
  invalidateQueryKey
3642
3588
  } = _a,
3643
- props = __rest$1(_a, ["id", "api", "status", "invalidateQueryKey"]);
3589
+ props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
3644
3590
  const isDraft = status == "draft";
3645
3591
  const mutation = useInvalidateParentMutation(isDraft ? api.publish : api.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey, {
3646
3592
  networkMode: "always"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compill/admin",
3
- "version": "1.0.80",
3
+ "version": "1.0.81",
4
4
  "module": "./index.esm.js",
5
5
  "main": "./index.cjs.js"
6
6
  }