strapi-layout-plugin 1.0.12 → 1.0.13
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 +1 -1
- package/server/components/{velox → core}/footer-column.json +2 -2
- package/server/components/{velox → core}/footer.json +4 -4
- package/server/components/{velox → core}/header.json +2 -2
- package/server/components/{velox → core}/link.json +1 -1
- package/server/components/{velox → core}/social-link.json +1 -1
- package/server/components/index.js +5 -5
- package/server/content-types/layout/schema.json +2 -2
- package/server/controllers/layout.js +2 -2
- package/server/register.js +12 -12
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"collectionName": "
|
|
2
|
+
"collectionName": "components_core_footer_columns",
|
|
3
3
|
"info": {
|
|
4
4
|
"displayName": "Footer Column",
|
|
5
5
|
"icon": "list",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"links": {
|
|
15
15
|
"type": "component",
|
|
16
16
|
"repeatable": true,
|
|
17
|
-
"component": "
|
|
17
|
+
"component": "core.link"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"collectionName": "
|
|
2
|
+
"collectionName": "components_core_footers",
|
|
3
3
|
"info": {
|
|
4
4
|
"displayName": "Footer",
|
|
5
5
|
"icon": "bold",
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
"socialLinks": {
|
|
26
26
|
"type": "component",
|
|
27
27
|
"repeatable": true,
|
|
28
|
-
"component": "
|
|
28
|
+
"component": "core.social-link"
|
|
29
29
|
},
|
|
30
30
|
"bottomLinks": {
|
|
31
31
|
"type": "component",
|
|
32
32
|
"repeatable": true,
|
|
33
|
-
"component": "
|
|
33
|
+
"component": "core.link"
|
|
34
34
|
},
|
|
35
35
|
"columns": {
|
|
36
36
|
"type": "component",
|
|
37
37
|
"repeatable": true,
|
|
38
|
-
"component": "
|
|
38
|
+
"component": "core.footer-column"
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"collectionName": "
|
|
2
|
+
"collectionName": "components_core_headers",
|
|
3
3
|
"info": {
|
|
4
4
|
"displayName": "Header",
|
|
5
5
|
"icon": "bold",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"links": {
|
|
17
17
|
"type": "component",
|
|
18
18
|
"repeatable": true,
|
|
19
|
-
"component": "
|
|
19
|
+
"component": "core.link"
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"collectionName": "
|
|
2
|
+
"collectionName": "components_core_links",
|
|
3
3
|
"info": {
|
|
4
4
|
"displayName": "Link",
|
|
5
5
|
"description": "This component is used to create reusable links across the website. It supports link text, URL (href), internal/external identification, and target options such as opening in the same or new tab."
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'
|
|
4
|
+
'core.header': require('./core/header.json'),
|
|
5
|
+
'core.footer': require('./core/footer.json'),
|
|
6
|
+
'core.link': require('./core/link.json'),
|
|
7
|
+
'core.social-link': require('./core/social-link.json'),
|
|
8
|
+
'core.footer-column': require('./core/footer-column.json'),
|
|
9
9
|
'shared.seo': require('./shared/seo.json'),
|
|
10
10
|
};
|
|
@@ -29,7 +29,7 @@ const getDynamicSectionsPopulate = (strapi) => {
|
|
|
29
29
|
const components = strapi.components;
|
|
30
30
|
|
|
31
31
|
for (const [uid, schema] of Object.entries(components)) {
|
|
32
|
-
if (uid.startsWith('
|
|
32
|
+
if (uid.startsWith('core.')) {
|
|
33
33
|
const attributes = schema.attributes || {};
|
|
34
34
|
const populateMap = {};
|
|
35
35
|
|
|
@@ -236,7 +236,7 @@ module.exports = ({ strapi }) => ({
|
|
|
236
236
|
pageSections = entity.blocks;
|
|
237
237
|
} else {
|
|
238
238
|
pageSections = [{
|
|
239
|
-
__component: `
|
|
239
|
+
__component: `core.${typeName}-detail`,
|
|
240
240
|
id: 0,
|
|
241
241
|
...entity
|
|
242
242
|
}];
|
package/server/register.js
CHANGED
|
@@ -11,11 +11,11 @@ module.exports = ({ strapi }) => {
|
|
|
11
11
|
|
|
12
12
|
// 1. Inject directly into memory to prevent database.init crash
|
|
13
13
|
const componentsToInject = {
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
14
|
+
'core.header': require('./components/core/header.json'),
|
|
15
|
+
'core.footer': require('./components/core/footer.json'),
|
|
16
|
+
'core.link': require('./components/core/link.json'),
|
|
17
|
+
'core.social-link': require('./components/core/social-link.json'),
|
|
18
|
+
'core.footer-column': require('./components/core/footer-column.json'),
|
|
19
19
|
'shared.seo': require('./components/shared/seo.json')
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -40,19 +40,19 @@ module.exports = ({ strapi }) => {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// 2. Also copy to physical files so user can see them in UI
|
|
43
|
-
const
|
|
43
|
+
const coreDir = path.join(appComponentsDir, 'core');
|
|
44
44
|
const sharedDir = path.join(appComponentsDir, 'shared');
|
|
45
45
|
|
|
46
46
|
if (!fs.existsSync(appComponentsDir)) fs.mkdirSync(appComponentsDir, { recursive: true });
|
|
47
|
-
if (!fs.existsSync(
|
|
47
|
+
if (!fs.existsSync(coreDir)) fs.mkdirSync(coreDir, { recursive: true });
|
|
48
48
|
if (!fs.existsSync(sharedDir)) fs.mkdirSync(sharedDir, { recursive: true });
|
|
49
49
|
|
|
50
50
|
const filesToCopy = [
|
|
51
|
-
{ src: path.join(pluginComponentsDir, '
|
|
52
|
-
{ src: path.join(pluginComponentsDir, '
|
|
53
|
-
{ src: path.join(pluginComponentsDir, '
|
|
54
|
-
{ src: path.join(pluginComponentsDir, '
|
|
55
|
-
{ src: path.join(pluginComponentsDir, '
|
|
51
|
+
{ src: path.join(pluginComponentsDir, 'core', 'header.json'), dest: path.join(coreDir, 'header.json') },
|
|
52
|
+
{ src: path.join(pluginComponentsDir, 'core', 'footer.json'), dest: path.join(coreDir, 'footer.json') },
|
|
53
|
+
{ src: path.join(pluginComponentsDir, 'core', 'link.json'), dest: path.join(coreDir, 'link.json') },
|
|
54
|
+
{ src: path.join(pluginComponentsDir, 'core', 'social-link.json'), dest: path.join(coreDir, 'social-link.json') },
|
|
55
|
+
{ src: path.join(pluginComponentsDir, 'core', 'footer-column.json'), dest: path.join(coreDir, 'footer-column.json') },
|
|
56
56
|
{ src: path.join(pluginComponentsDir, 'shared', 'seo.json'), dest: path.join(sharedDir, 'seo.json') }
|
|
57
57
|
];
|
|
58
58
|
|