@griddo/ax 1.75.170 → 1.75.172
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/ax",
|
|
3
3
|
"description": "Griddo Author Experience",
|
|
4
|
-
"version": "1.75.
|
|
4
|
+
"version": "1.75.172",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
@@ -234,5 +234,5 @@
|
|
|
234
234
|
"publishConfig": {
|
|
235
235
|
"access": "public"
|
|
236
236
|
},
|
|
237
|
-
"gitHead": "
|
|
237
|
+
"gitHead": "71a14caa18903f906afbfa3aa3b9de4a37a0b42b"
|
|
238
238
|
}
|
|
@@ -4,13 +4,15 @@ import { IPage, ISelectOption } from "@ax/types";
|
|
|
4
4
|
const findSchemaComponentArrays = (component: string) => {
|
|
5
5
|
const keys: string[] = [];
|
|
6
6
|
const schemaTabs = getSchema(component).configTabs;
|
|
7
|
-
schemaTabs.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
if (schemaTabs.length) {
|
|
8
|
+
schemaTabs.forEach((tab: any) => {
|
|
9
|
+
tab.fields.forEach((field: any) => {
|
|
10
|
+
if (field.type === "ComponentArray") {
|
|
11
|
+
keys.push(field.key);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
12
14
|
});
|
|
13
|
-
}
|
|
15
|
+
}
|
|
14
16
|
return keys;
|
|
15
17
|
};
|
|
16
18
|
|
|
@@ -26,10 +28,12 @@ const findAnchorsFromModule = (module: any) => {
|
|
|
26
28
|
const arrayKeys = findSchemaComponentArrays(module.component);
|
|
27
29
|
if (arrayKeys.length) {
|
|
28
30
|
arrayKeys.forEach((key: string) => {
|
|
29
|
-
module[key].
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
if (module[key] && module[key].length) {
|
|
32
|
+
module[key].forEach((element: any) => {
|
|
33
|
+
const subOptions = findAnchorsFromModule(element);
|
|
34
|
+
options = [...options, ...subOptions];
|
|
35
|
+
});
|
|
36
|
+
}
|
|
33
37
|
});
|
|
34
38
|
}
|
|
35
39
|
|
|
@@ -43,12 +47,14 @@ const findAnchorsFromPage = (page: IPage): ISelectOption[] => {
|
|
|
43
47
|
.map((key: string) => template[key])
|
|
44
48
|
.filter((value: any) => typeof value === "object" && value !== null && value.component === "Section");
|
|
45
49
|
|
|
46
|
-
sections.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
if (sections.length) {
|
|
51
|
+
sections.forEach((section: any) => {
|
|
52
|
+
section.modules.forEach((module: any) => {
|
|
53
|
+
const sectionOptions = findAnchorsFromModule(module);
|
|
54
|
+
options = [...options, ...sectionOptions];
|
|
55
|
+
});
|
|
50
56
|
});
|
|
51
|
-
}
|
|
57
|
+
}
|
|
52
58
|
return options;
|
|
53
59
|
};
|
|
54
60
|
|
|
@@ -59,16 +65,18 @@ const findTabsFromPage = (page: IPage): ISelectOption[] => {
|
|
|
59
65
|
.map((key: string) => template[key])
|
|
60
66
|
.filter((value: any) => typeof value === "object" && value !== null && value.component === "Section");
|
|
61
67
|
|
|
62
|
-
sections.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
module.elements
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
if (sections.length) {
|
|
69
|
+
sections.forEach((section: any) => {
|
|
70
|
+
section.modules.forEach((module: any) => {
|
|
71
|
+
if (module.hasGriddoMultiPage && module.elements) {
|
|
72
|
+
module.elements.forEach((element: any) => {
|
|
73
|
+
const option = { value: element.sectionSlug, label: element.title };
|
|
74
|
+
options.push(option);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
});
|
|
70
78
|
});
|
|
71
|
-
}
|
|
79
|
+
}
|
|
72
80
|
return options;
|
|
73
81
|
};
|
|
74
82
|
|
|
@@ -79,14 +87,16 @@ const findAnchorsFromTab = (page: IPage, tabSlug: string): ISelectOption[] => {
|
|
|
79
87
|
.map((key: string) => template[key])
|
|
80
88
|
.filter((value: any) => typeof value === "object" && value !== null && value.component === "Section");
|
|
81
89
|
|
|
82
|
-
sections.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
if (sections.length) {
|
|
91
|
+
sections.forEach((section: any) => {
|
|
92
|
+
section.modules.forEach((module: any) => {
|
|
93
|
+
if (module.hasGriddoMultiPage) {
|
|
94
|
+
const tab = module.elements.find((elem: any) => elem.sectionSlug === tabSlug);
|
|
95
|
+
options = findAnchorsFromModule(tab);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
88
98
|
});
|
|
89
|
-
}
|
|
99
|
+
}
|
|
90
100
|
return options;
|
|
91
101
|
};
|
|
92
102
|
|