@mattisvensson/strapi-plugin-webatlas 0.2.3 → 0.2.5

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 (41) hide show
  1. package/dist/_chunks/EmptyBox-7D4LrvdH.mjs.map +1 -0
  2. package/dist/_chunks/EmptyBox-DT6D5gcf.js.map +1 -0
  3. package/dist/_chunks/_baseConvert-CDjccxdO.mjs +859 -0
  4. package/dist/_chunks/_baseConvert-CDjccxdO.mjs.map +1 -0
  5. package/dist/_chunks/_baseConvert-DVIhGQH6.js +858 -0
  6. package/dist/_chunks/_baseConvert-DVIhGQH6.js.map +1 -0
  7. package/dist/_chunks/en-B4KWt_jN.js.map +1 -0
  8. package/dist/_chunks/en-Byx4XI2L.mjs.map +1 -0
  9. package/dist/_chunks/index-1VNPebOd.mjs +45 -0
  10. package/dist/_chunks/index-1VNPebOd.mjs.map +1 -0
  11. package/dist/_chunks/{index-BLQ7k9G6.js → index-B-ABW-o6.js} +1 -1
  12. package/dist/_chunks/{index-rvOUYDZ4.mjs → index-B5ilx6DT.mjs} +1 -1
  13. package/dist/_chunks/{index-C9tlbXg0.js → index-B7vKSyAn.js} +15 -51
  14. package/dist/_chunks/index-B7vKSyAn.js.map +1 -0
  15. package/dist/_chunks/{index-C4EZHacG.mjs → index-BjbgWZrg.mjs} +4 -4
  16. package/dist/_chunks/{index-C3a42qmP.mjs → index-BxuR805w.mjs} +2 -32
  17. package/dist/_chunks/{index-CnY7liYv.js → index-CAjBRbaH.js} +4 -4
  18. package/dist/_chunks/index-CPE1Ne_e.js +4102 -0
  19. package/dist/_chunks/index-CPE1Ne_e.js.map +1 -0
  20. package/dist/_chunks/index-ChOgKZGK.mjs +9924 -0
  21. package/dist/_chunks/index-ChOgKZGK.mjs.map +1 -0
  22. package/dist/_chunks/index-Cs_oxZfX.js +17134 -0
  23. package/dist/_chunks/index-CuMn96qA.js +9924 -0
  24. package/dist/_chunks/index-CuMn96qA.js.map +1 -0
  25. package/dist/_chunks/{index-BDCJSjey.mjs → index-D_OdzeaU.mjs} +1 -1
  26. package/dist/_chunks/index-Djk_-mU6.js +45 -0
  27. package/dist/_chunks/index-Djk_-mU6.js.map +1 -0
  28. package/dist/_chunks/index-HHBjOGX5.mjs +17130 -0
  29. package/dist/_chunks/index-HHBjOGX5.mjs.map +1 -0
  30. package/dist/_chunks/{index-B_a-qtdq.js → index-kz3NL7uv.js} +1 -1
  31. package/dist/_chunks/index-yLrZAFVv.mjs +4086 -0
  32. package/dist/_chunks/index-yLrZAFVv.mjs.map +1 -0
  33. package/dist/admin/index.js +1 -1
  34. package/dist/admin/index.js.map +1 -0
  35. package/dist/admin/index.mjs +1 -1
  36. package/dist/admin/index.mjs.map +1 -0
  37. package/dist/server/index.js +14 -6
  38. package/dist/server/index.js.map +1 -0
  39. package/dist/server/index.mjs +14 -6
  40. package/dist/server/index.mjs.map +1 -0
  41. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-CnY7liYv.js");
2
+ const index = require("../_chunks/index-CAjBRbaH.js");
3
3
  require("react/jsx-runtime");
4
4
  module.exports = index.index;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,4 +1,4 @@
1
- import { i } from "../_chunks/index-C4EZHacG.mjs";
1
+ import { i } from "../_chunks/index-BjbgWZrg.mjs";
2
2
  import "react/jsx-runtime";
3
3
  export {
4
4
  i as default
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -20,7 +20,7 @@ function transformToUrl(input) {
20
20
  input = input.replace(/-+/g, "-");
21
21
  return input;
22
22
  }
23
- const version = "0.2.3";
23
+ const version = "0.2.5";
24
24
  const keywords = [];
25
25
  const type = "commonjs";
26
26
  const exports$1 = {
@@ -206,6 +206,7 @@ const bootstrap = async ({ strapi: strapi2 }) => {
206
206
  if (!config2?.selectedContentTypes) return;
207
207
  strapi2.db?.lifecycles.subscribe({
208
208
  models: [waNavItem],
209
+ // TODO: is beforeDelete needed?
209
210
  async beforeDelete(event) {
210
211
  const id = event.params.where["id"];
211
212
  if (!id) return;
@@ -216,6 +217,7 @@ const bootstrap = async ({ strapi: strapi2 }) => {
216
217
  },
217
218
  populate: ["route"]
218
219
  });
220
+ if (!navItem || !navItem.route) return;
219
221
  event.state = navItem.route.id && !navItem.route.internal ? { id: navItem.route.id } : null;
220
222
  } catch (err) {
221
223
  console.log(err);
@@ -248,6 +250,12 @@ const bootstrap = async ({ strapi: strapi2 }) => {
248
250
  webatlas_override
249
251
  } = event.params.data;
250
252
  if (!webatlas_path) return;
253
+ const relatedRoute = await strapi2.db?.query(waRoute).findOne({
254
+ where: {
255
+ relatedDocumentId: event.result.documentId
256
+ }
257
+ });
258
+ if (relatedRoute) return;
251
259
  const title = ctSettings?.default ? event.params.data[ctSettings.default] : "";
252
260
  const path = await duplicateCheck(transformToUrl(webatlas_path));
253
261
  await strapi2.documents(waRoute).create({
@@ -297,8 +305,6 @@ const bootstrap = async ({ strapi: strapi2 }) => {
297
305
  }
298
306
  });
299
307
  } else {
300
- console.log("updating route", relatedRoute.documentId);
301
- console.log("with data", routeData);
302
308
  await strapi2.documents(waRoute).update({
303
309
  documentId: relatedRoute.documentId,
304
310
  data: {
@@ -871,7 +877,6 @@ const register = ({ strapi: strapi2 }) => {
871
877
  const { attributes } = contentType;
872
878
  const fieldSettings = {
873
879
  writable: true,
874
- private: true,
875
880
  configurable: false,
876
881
  editable: false,
877
882
  visible: true,
@@ -879,11 +884,13 @@ const register = ({ strapi: strapi2 }) => {
879
884
  };
880
885
  set$1(attributes, "webatlas_path", {
881
886
  ...fieldSettings,
882
- type: "string"
887
+ type: "string",
888
+ private: false
883
889
  });
884
890
  set$1(attributes, "webatlas_override", {
885
891
  ...fieldSettings,
886
- type: "boolean"
892
+ type: "boolean",
893
+ private: true
887
894
  });
888
895
  });
889
896
  };
@@ -5835,3 +5842,4 @@ const index = {
5835
5842
  middlewares
5836
5843
  };
5837
5844
  module.exports = index;
5845
+ //# sourceMappingURL=index.js.map