@geekron/strapi 0.2.5 → 0.2.6

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.
@@ -46829,29 +46829,32 @@ function findItemDeep(items, itemId) {
46829
46829
  return;
46830
46830
  }
46831
46831
  function removeItem(items, id) {
46832
- const newItems = [];
46833
- for (const item of items) {
46834
- if (item.id === id) {
46835
- continue;
46836
- }
46832
+ return items.filter((item) => item.id !== id).map((item) => {
46837
46833
  if (item.children.length) {
46838
- item.children = removeItem(item.children, id);
46834
+ return {
46835
+ ...item,
46836
+ children: removeItem(item.children, id)
46837
+ };
46839
46838
  }
46840
- newItems.push(item);
46841
- }
46842
- return newItems;
46839
+ return item;
46840
+ });
46843
46841
  }
46844
46842
  function setProperty(items, id, property, setter) {
46845
- for (const item of items) {
46843
+ return items.map((item) => {
46846
46844
  if (item.id === id) {
46847
- item[property] = setter(item[property]);
46848
- continue;
46845
+ return {
46846
+ ...item,
46847
+ [property]: setter(item[property])
46848
+ };
46849
46849
  }
46850
46850
  if (item.children.length) {
46851
- item.children = setProperty(item.children, id, property, setter);
46851
+ return {
46852
+ ...item,
46853
+ children: setProperty(item.children, id, property, setter)
46854
+ };
46852
46855
  }
46853
- }
46854
- return [...items];
46856
+ return item;
46857
+ });
46855
46858
  }
46856
46859
  function countChildren(items, count = 0) {
46857
46860
  return items.reduce((acc, { children }) => {
@@ -46874,29 +46874,32 @@ function findItemDeep(items, itemId) {
46874
46874
  return;
46875
46875
  }
46876
46876
  function removeItem(items, id) {
46877
- const newItems = [];
46878
- for (const item of items) {
46879
- if (item.id === id) {
46880
- continue;
46881
- }
46877
+ return items.filter((item) => item.id !== id).map((item) => {
46882
46878
  if (item.children.length) {
46883
- item.children = removeItem(item.children, id);
46879
+ return {
46880
+ ...item,
46881
+ children: removeItem(item.children, id)
46882
+ };
46884
46883
  }
46885
- newItems.push(item);
46886
- }
46887
- return newItems;
46884
+ return item;
46885
+ });
46888
46886
  }
46889
46887
  function setProperty(items, id, property, setter) {
46890
- for (const item of items) {
46888
+ return items.map((item) => {
46891
46889
  if (item.id === id) {
46892
- item[property] = setter(item[property]);
46893
- continue;
46890
+ return {
46891
+ ...item,
46892
+ [property]: setter(item[property])
46893
+ };
46894
46894
  }
46895
46895
  if (item.children.length) {
46896
- item.children = setProperty(item.children, id, property, setter);
46896
+ return {
46897
+ ...item,
46898
+ children: setProperty(item.children, id, property, setter)
46899
+ };
46897
46900
  }
46898
- }
46899
- return [...items];
46901
+ return item;
46902
+ });
46900
46903
  }
46901
46904
  function countChildren(items, count = 0) {
46902
46905
  return items.reduce((acc, { children }) => {
@@ -96,6 +96,19 @@ var schema_default = {
96
96
  },
97
97
  component: "site.social",
98
98
  repeatable: true
99
+ },
100
+ footLinks: {
101
+ type: "customField",
102
+ pluginOptions: {
103
+ i18n: {
104
+ localized: true
105
+ }
106
+ },
107
+ customField: "plugin::website.dataNested",
108
+ required: false,
109
+ options: {
110
+ depth: 2
111
+ }
99
112
  }
100
113
  }
101
114
  };
@@ -61,6 +61,19 @@ var schema_default = {
61
61
  },
62
62
  component: "site.social",
63
63
  repeatable: true
64
+ },
65
+ footLinks: {
66
+ type: "customField",
67
+ pluginOptions: {
68
+ i18n: {
69
+ localized: true
70
+ }
71
+ },
72
+ customField: "plugin::website.dataNested",
73
+ required: false,
74
+ options: {
75
+ depth: 2
76
+ }
64
77
  }
65
78
  }
66
79
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekron/strapi",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "极客领航网站管理插件",
5
5
  "type": "commonjs",
6
6
  "author": "Geekron",