@mattisvensson/strapi-plugin-webatlas 0.8.0 → 0.8.1

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 (76) hide show
  1. package/dist/_chunks/FullLoader-Cmsf8xS6.js +12 -0
  2. package/dist/_chunks/FullLoader-Cmsf8xS6.js.map +1 -0
  3. package/dist/_chunks/FullLoader-CrPED_dY.mjs +1 -0
  4. package/dist/_chunks/FullLoader-CrPED_dY.mjs.map +1 -0
  5. package/dist/_chunks/PageWrapper-Bp9vGwpG.js +54 -0
  6. package/dist/_chunks/PageWrapper-BvOY7VCN.mjs +55 -0
  7. package/dist/_chunks/PageWrapper-BzDrMm2d.js +55 -0
  8. package/dist/_chunks/PageWrapper-BzDrMm2d.js.map +1 -0
  9. package/dist/_chunks/{PageWrapper-B6nLPFak.mjs → PageWrapper-oLhcg9BA.mjs} +2 -1
  10. package/dist/_chunks/PageWrapper-oLhcg9BA.mjs.map +1 -0
  11. package/dist/_chunks/de-CDBoUBzw.js +124 -0
  12. package/dist/_chunks/de-CDBoUBzw.js.map +1 -0
  13. package/dist/_chunks/{de-C1QgkRoj.mjs → de-Dt80IqMG.mjs} +2 -0
  14. package/dist/_chunks/de-Dt80IqMG.mjs.map +1 -0
  15. package/dist/_chunks/{en--8p5hbLP.mjs → en-BHxDiueo.mjs} +2 -0
  16. package/dist/_chunks/en-BHxDiueo.mjs.map +1 -0
  17. package/dist/_chunks/en-DfvURaup.js +124 -0
  18. package/dist/_chunks/en-DfvURaup.js.map +1 -0
  19. package/dist/_chunks/index--oj1eNcM.js +247 -0
  20. package/dist/_chunks/index--oj1eNcM.js.map +1 -0
  21. package/dist/_chunks/{index-VcxUbdMO.mjs → index-BBn1ZvsE.mjs} +2 -2
  22. package/dist/_chunks/index-BCPgfhBx.js +124 -0
  23. package/dist/_chunks/index-BCPgfhBx.js.map +1 -0
  24. package/dist/_chunks/index-BKdvSgDB.js +246 -0
  25. package/dist/_chunks/index-CAged_xE.mjs +247 -0
  26. package/dist/_chunks/index-CAged_xE.mjs.map +1 -0
  27. package/dist/_chunks/index-CHRBu9Xy.mjs +124 -0
  28. package/dist/_chunks/index-CHRBu9Xy.mjs.map +1 -0
  29. package/dist/_chunks/{index-DSPh-fHL.mjs → index-CTA8agp7.mjs} +7 -7
  30. package/dist/_chunks/{index-Z3qq1ab8.mjs → index-CUlRMqGG.mjs} +26 -29
  31. package/dist/_chunks/index-CbW6k4FH.js +4205 -0
  32. package/dist/_chunks/index-CbW6k4FH.js.map +1 -0
  33. package/dist/_chunks/index-CtFERXkl.js +253 -0
  34. package/dist/_chunks/index-CtFERXkl.js.map +1 -0
  35. package/dist/_chunks/index-D29zBs5w.mjs +12228 -0
  36. package/dist/_chunks/index-D29zBs5w.mjs.map +1 -0
  37. package/dist/_chunks/index-D72CZ5b7.js +123 -0
  38. package/dist/_chunks/{index-7rox7tGX.mjs → index-DJBXRNlE.mjs} +3 -2
  39. package/dist/_chunks/index-DJBXRNlE.mjs.map +1 -0
  40. package/dist/_chunks/index-DMpiX4hP.mjs +4189 -0
  41. package/dist/_chunks/index-DMpiX4hP.mjs.map +1 -0
  42. package/dist/_chunks/index-DTPDMxs_.js +12227 -0
  43. package/dist/_chunks/index-DUgh4AJb.js +252 -0
  44. package/dist/_chunks/index-Dxn0NT06.js +4204 -0
  45. package/dist/_chunks/index-Nx4IRYIK.mjs +252 -0
  46. package/dist/_chunks/{index-DGSjLYNl.mjs → index-Rfm9O167.mjs} +1 -1
  47. package/dist/_chunks/index-YzPuPn68.js +12228 -0
  48. package/dist/_chunks/index-YzPuPn68.js.map +1 -0
  49. package/dist/admin/index.js +5 -0
  50. package/dist/admin/index.js.map +1 -0
  51. package/dist/admin/index.mjs +2 -1
  52. package/dist/admin/index.mjs.map +1 -0
  53. package/dist/admin/src/components/modals/NavEdit.d.ts +1 -1
  54. package/dist/admin/src/components/modals/fields/Visibility.d.ts +5 -0
  55. package/dist/admin/src/components/modals/fields/index.d.ts +2 -0
  56. package/dist/server/index.js +12 -3
  57. package/dist/server/index.js.map +1 -0
  58. package/dist/server/index.mjs +12 -3
  59. package/dist/server/index.mjs.map +1 -0
  60. package/package.json +1 -1
  61. package/dist/_chunks/PageWrapper-BMzPDWn4.js +0 -0
  62. package/dist/_chunks/PageWrapper-BMzPDWn4.js.map +0 -0
  63. package/dist/_chunks/de-DYxCPOdb.js +0 -0
  64. package/dist/_chunks/de-DYxCPOdb.js.map +0 -0
  65. package/dist/_chunks/en-Be-athEA.js +0 -0
  66. package/dist/_chunks/en-Be-athEA.js.map +0 -0
  67. package/dist/_chunks/index-Bu-uQ9jA.js +0 -0
  68. package/dist/_chunks/index-Bu-uQ9jA.js.map +0 -0
  69. package/dist/_chunks/index-C53yDU_z.js +0 -0
  70. package/dist/_chunks/index-C53yDU_z.js.map +0 -0
  71. package/dist/_chunks/index-CAz59RSr.js +0 -0
  72. package/dist/_chunks/index-CAz59RSr.js.map +0 -0
  73. package/dist/_chunks/index-DKfUSLPc.js +0 -0
  74. package/dist/_chunks/index-DKfUSLPc.js.map +0 -0
  75. package/dist/_chunks/index-DPMhcaxW.js +0 -0
  76. package/dist/_chunks/index-DPMhcaxW.js.map +0 -0
@@ -23,7 +23,7 @@ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
23
23
  );
24
24
  });
25
25
  };
26
- const version = "0.7.1";
26
+ const version = "0.8.0";
27
27
  const keywords = [];
28
28
  const type = "commonjs";
29
29
  const exports = {
@@ -3622,7 +3622,7 @@ const $a093c7e1ec25a057$export$7c6e2c02157bb7d2 = $a093c7e1ec25a057$export$e9003
3622
3622
  function Tooltip({ description: description2 }) {
3623
3623
  return /* @__PURE__ */ jsx($a093c7e1ec25a057$export$2881499e37b75b9a, { children: /* @__PURE__ */ jsxs($a093c7e1ec25a057$export$be92b6f5f03c0fe9, { children: [
3624
3624
  /* @__PURE__ */ jsx($a093c7e1ec25a057$export$41fb9f06171c75f4, { asChild: true, children: /* @__PURE__ */ jsx(Information, { "aria-hidden": "true" }) }),
3625
- /* @__PURE__ */ jsx($a093c7e1ec25a057$export$602eac185826482c, { children: /* @__PURE__ */ jsx($a093c7e1ec25a057$export$7c6e2c02157bb7d2, { sideOffset: 5, children: /* @__PURE__ */ jsx(
3625
+ /* @__PURE__ */ jsx($a093c7e1ec25a057$export$602eac185826482c, { children: /* @__PURE__ */ jsx($a093c7e1ec25a057$export$7c6e2c02157bb7d2, { sideOffset: 5, style: { zIndex: 9999 }, children: /* @__PURE__ */ jsx(
3626
3626
  Box,
3627
3627
  {
3628
3628
  padding: 2,
@@ -4063,7 +4063,7 @@ const index = {
4063
4063
  defaultMessage: "Routes"
4064
4064
  },
4065
4065
  Component: async () => {
4066
- const component = await import("./index-DGSjLYNl.mjs");
4066
+ const component = await import("./index-Rfm9O167.mjs");
4067
4067
  return { default: component.default };
4068
4068
  },
4069
4069
  permissions: [
@@ -4082,7 +4082,7 @@ const index = {
4082
4082
  defaultMessage: "Navigation"
4083
4083
  },
4084
4084
  Component: async () => {
4085
- const component = await import("./index-Z3qq1ab8.mjs");
4085
+ const component = await import("./index-CUlRMqGG.mjs");
4086
4086
  return { default: component.default };
4087
4087
  },
4088
4088
  permissions: [
@@ -4111,7 +4111,7 @@ const index = {
4111
4111
  Component: async () => {
4112
4112
  return await import(
4113
4113
  /* webpackChunkName: "webatlas-settings-general-page" */
4114
- "./index-7rox7tGX.mjs"
4114
+ "./index-Nx4IRYIK.mjs"
4115
4115
  );
4116
4116
  },
4117
4117
  permissions: [
@@ -4135,7 +4135,7 @@ const index = {
4135
4135
  Component: async () => {
4136
4136
  return await import(
4137
4137
  /* webpackChunkName: "webatlas-settings-navigation-page" */
4138
- "./index-VcxUbdMO.mjs"
4138
+ "./index-BBn1ZvsE.mjs"
4139
4139
  );
4140
4140
  },
4141
4141
  permissions: [
@@ -4164,7 +4164,7 @@ const index = {
4164
4164
  return Promise.all(
4165
4165
  locales.map(async (locale) => {
4166
4166
  try {
4167
- const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => import("./de-C1QgkRoj.mjs"), "./translations/en.json": () => import("./en--8p5hbLP.mjs") }), `./translations/${locale}.json`, 3);
4167
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => import("./de-Dt80IqMG.mjs"), "./translations/en.json": () => import("./en-BHxDiueo.mjs") }), `./translations/${locale}.json`, 3);
4168
4168
  return { data, locale };
4169
4169
  } catch {
4170
4170
  return { data: {}, locale };
@@ -5,7 +5,7 @@ import { Box, Typography, Dialog, Button, Modal, Flex, SingleSelect, SingleSelec
5
5
  import { useState, useEffect, createContext, useRef, useContext, useReducer, useCallback, useMemo, forwardRef } from "react";
6
6
  import { createPortal } from "react-dom";
7
7
  import { useIntl } from "react-intl";
8
- import { u as useApi, g as getTranslation, d as debounce, a as duplicateCheck, t as transformToUrl, U as URLInfo, b as usePluginConfig } from "./index-DSPh-fHL.mjs";
8
+ import { u as useApi, g as getTranslation, d as debounce, a as duplicateCheck, t as transformToUrl, U as URLInfo, b as usePluginConfig } from "./index-CTA8agp7.mjs";
9
9
  import { useFetchClient, useNotification, Page, Layouts } from "@strapi/strapi/admin";
10
10
  import { C as Center, F as FullLoader } from "./FullLoader-CrPED_dY.mjs";
11
11
  import { EmptyDocuments } from "@strapi/icons/symbols";
@@ -231,23 +231,21 @@ function NavCreate() {
231
231
  setLoading(true);
232
232
  try {
233
233
  const { data } = await post("/webatlas/navigation", { name, isActive });
234
- if (data.documentId) {
235
- navigate(`/plugins/webatlas/navigation/${data.documentId}`);
236
- setModalType("");
237
- } else {
238
- toggleNotification({
239
- type: "danger",
240
- message: formatMessage({
241
- id: getTranslation("notification.navigation.creationFailed"),
242
- defaultMessage: "Creation of navigation failed"
243
- })
244
- });
245
- }
234
+ if (!data.documentId) throw new Error("No documentId returned");
235
+ navigate(`/plugins/webatlas/navigation/${data.documentId}`);
236
+ setModalType("");
246
237
  } catch (err) {
247
238
  console.log(err);
239
+ toggleNotification({
240
+ type: "danger",
241
+ message: formatMessage({
242
+ id: getTranslation("notification.navigation.creationFailed"),
243
+ defaultMessage: "Creation of navigation failed"
244
+ })
245
+ });
248
246
  } finally {
247
+ setLoading(false);
249
248
  }
250
- setLoading(false);
251
249
  };
252
250
  return /* @__PURE__ */ jsx(
253
251
  NavModal,
@@ -282,14 +280,22 @@ function NavEdit({ item, onEdit }) {
282
280
  const [loading, setLoading] = useState(false);
283
281
  const { updateNavigation } = useApi();
284
282
  const { formatMessage } = useIntl();
283
+ const { toggleNotification } = useNotification();
285
284
  const updateNav = async () => {
286
285
  setLoading(true);
287
286
  try {
288
287
  await updateNavigation(item.documentId, { name, visible });
289
288
  setModalType("NavOverview");
290
- onEdit();
289
+ onEdit({ ...item, name, visible });
291
290
  } catch (err) {
292
291
  console.log(err);
292
+ toggleNotification({
293
+ type: "danger",
294
+ message: formatMessage({
295
+ id: getTranslation("notification.navigation.updateFailed"),
296
+ defaultMessage: "Updating navigation failed"
297
+ })
298
+ });
293
299
  } finally {
294
300
  setLoading(false);
295
301
  }
@@ -303,17 +309,6 @@ function NavEdit({ item, onEdit }) {
303
309
  loadingText: formatMessage({ id: getTranslation("modal.navEdit.loadingText"), defaultMessage: "Updating" }),
304
310
  onConfirm: updateNav,
305
311
  loading,
306
- modalToOpen: "NavOverview",
307
- footer: /* @__PURE__ */ jsxs(Fragment, { children: [
308
- /* @__PURE__ */ jsx(Button, { onClick: () => setModalType("NavOverview"), variant: "tertiary", children: formatMessage({
309
- id: getTranslation("modal.navEdit.closeText"),
310
- defaultMessage: "Cancel"
311
- }) }),
312
- /* @__PURE__ */ jsx(Button, { children: formatMessage({
313
- id: getTranslation("modal.navEdit.confirmText"),
314
- defaultMessage: "Update"
315
- }) })
316
- ] }),
317
312
  children: /* @__PURE__ */ jsxs(Grid.Root, { gap: 4, children: [
318
313
  /* @__PURE__ */ jsx(Grid.Item, { s: 12, m: 6, children: /* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsxs(Field.Root, { children: [
319
314
  /* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
@@ -12125,7 +12120,7 @@ const Navigation = () => {
12125
12120
  {
12126
12121
  variant: "NavDelete",
12127
12122
  item: actionItem,
12128
- onDelete: async (deletedItem) => {
12123
+ onDelete: (deletedItem) => {
12129
12124
  cachedNavigations.current = null;
12130
12125
  setNavigations((navs) => navs.filter((nav) => nav.id !== deletedItem.id));
12131
12126
  navigate("/plugins/webatlas/navigation");
@@ -12136,7 +12131,10 @@ const Navigation = () => {
12136
12131
  NavEdit,
12137
12132
  {
12138
12133
  item: actionItem,
12139
- onEdit: () => {
12134
+ onEdit: (editedNavigation) => {
12135
+ setNavigations(
12136
+ (navs) => navs?.map((nav) => nav.id === editedNavigation.id ? editedNavigation : nav)
12137
+ );
12140
12138
  }
12141
12139
  }
12142
12140
  ),
@@ -12166,7 +12164,6 @@ const Navigation = () => {
12166
12164
  {
12167
12165
  item: actionItem,
12168
12166
  onEdit: (editedItem) => {
12169
- console.log(editedItem);
12170
12167
  setNavigationItems(
12171
12168
  (items) => items?.map((item) => item.id === editedItem.id ? editedItem : item)
12172
12169
  );