@total_onion/onion-library 3.0.34 → 3.0.36
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/components/component-core-group-container-styles-v3/core-group-container-styles-v3.scss
CHANGED
|
@@ -6,39 +6,43 @@
|
|
|
6
6
|
@use '../../breakpoints';
|
|
7
7
|
|
|
8
8
|
@mixin coreGroupContainerStylesV3() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
@layer base-styles {
|
|
10
|
+
.cmpl-core-group-container-styles {
|
|
11
|
+
display: grid;
|
|
12
|
+
grid-template: 'main' / 1fr;
|
|
13
|
+
place-items: center;
|
|
14
|
+
&__grid-container {
|
|
15
|
+
grid-area: main;
|
|
16
|
+
place-self: stretch;
|
|
17
|
+
&.flex-layout-container {
|
|
18
|
+
@include flex-layout-container-v3.flexLayoutContainer();
|
|
19
|
+
}
|
|
20
|
+
&.grid-layout-container {
|
|
21
|
+
@include grid-layout-container-v3.gridLayoutContainer();
|
|
22
|
+
}
|
|
18
23
|
}
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
&__block-container {
|
|
25
|
+
pointer-events: none;
|
|
26
|
+
position: relative;
|
|
27
|
+
&.grid-layout-container {
|
|
28
|
+
@include grid-layout-element-v3.gridLayoutElement();
|
|
29
|
+
}
|
|
30
|
+
&:has(
|
|
31
|
+
.video-content-v3__video-container.video-playing.video-playing--high-z-index
|
|
32
|
+
) {
|
|
33
|
+
z-index: 50;
|
|
34
|
+
}
|
|
21
35
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
&__block-number {
|
|
37
|
+
z-index: 99;
|
|
38
|
+
position: absolute;
|
|
39
|
+
font-size: 40px;
|
|
40
|
+
left: 50%;
|
|
41
|
+
top: 50%;
|
|
42
|
+
transform: translate(-50%, -50%);
|
|
43
|
+
color: white;
|
|
44
|
+
text-shadow: 1px 1px 1px blue;
|
|
31
45
|
}
|
|
32
46
|
}
|
|
33
|
-
&__block-number {
|
|
34
|
-
z-index: 99;
|
|
35
|
-
position: absolute;
|
|
36
|
-
font-size: 40px;
|
|
37
|
-
left: 50%;
|
|
38
|
-
top: 50%;
|
|
39
|
-
transform: translate(-50%, -50%);
|
|
40
|
-
color: white;
|
|
41
|
-
text-shadow: 1px 1px 1px blue;
|
|
42
|
-
}
|
|
43
47
|
}
|
|
44
48
|
}
|
package/duplicateBlock.js
CHANGED
|
@@ -3,7 +3,6 @@ const fs = require('fs');
|
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const {globSync} = require('glob');
|
|
5
5
|
const yargs = require('yargs');
|
|
6
|
-
const compressing = require('compressing');
|
|
7
6
|
const templateOptions = yargs.argv._;
|
|
8
7
|
const themePath =
|
|
9
8
|
process.env.THEME_PATH || 'web/wp-content/themes/global-theme';
|
|
@@ -11,10 +10,6 @@ const srcPathJs = `${themePath}/assets/js/blocks`;
|
|
|
11
10
|
const srcPathScss = `${themePath}/assets/scss/blocks`;
|
|
12
11
|
const srcPathTwig = `${themePath}/views/blocks`;
|
|
13
12
|
const srcPathBlockJson = `${themePath}/inc/acf-blocks`;
|
|
14
|
-
// exported-blocks lives at the project root, relative to cwd (the theme dir)
|
|
15
|
-
const destPath =
|
|
16
|
-
process.env.EXPORTED_BLOCKS_PATH ||
|
|
17
|
-
path.resolve(process.cwd(), '../../../../exported-blocks');
|
|
18
13
|
const newName = templateOptions[1];
|
|
19
14
|
|
|
20
15
|
const exisitingBlockNames = [
|
|
@@ -49,13 +44,6 @@ if (blockName === newName) {
|
|
|
49
44
|
}
|
|
50
45
|
|
|
51
46
|
if (exisitingBlockNames.includes(blockName)) {
|
|
52
|
-
const dir = `${destPath}/${newName}`;
|
|
53
|
-
if (fs.existsSync(dir)) {
|
|
54
|
-
console.log('Removing previous duplication...');
|
|
55
|
-
fs.rmSync(dir, {recursive: true, force: true});
|
|
56
|
-
console.log('removed');
|
|
57
|
-
}
|
|
58
|
-
fs.mkdirSync(dir);
|
|
59
47
|
if (fs.existsSync(`${srcPathJs}/${blockName}.js`)) {
|
|
60
48
|
const contents = fs.readFileSync(
|
|
61
49
|
`${srcPathJs}/${blockName}.js`,
|
|
@@ -71,7 +59,7 @@ if (exisitingBlockNames.includes(blockName)) {
|
|
|
71
59
|
`${newName.toLowerCase().replaceAll(/( |-)/g, '')}`
|
|
72
60
|
)
|
|
73
61
|
.replaceAll(`blocks/${blockName}`, `blocks/${newName}`);
|
|
74
|
-
fs.writeFileSync(`${
|
|
62
|
+
fs.writeFileSync(`${srcPathJs}/${newName}.js`, replaced, 'utf-8');
|
|
75
63
|
console.log(`👑👑\x1b[32m Successfully duplicated the js file! 👑👑`);
|
|
76
64
|
}
|
|
77
65
|
if (fs.existsSync(`${srcPathScss}/${blockName}.scss`)) {
|
|
@@ -80,19 +68,31 @@ if (exisitingBlockNames.includes(blockName)) {
|
|
|
80
68
|
'utf-8'
|
|
81
69
|
);
|
|
82
70
|
const replaced = contents.replaceAll(`${blockName}`, `${newName}`);
|
|
83
|
-
fs.writeFileSync(`${
|
|
71
|
+
fs.writeFileSync(`${srcPathScss}/${newName}.scss`, replaced, 'utf-8');
|
|
84
72
|
console.log(`👑👑\x1b[32m Successfully duplicated the scss file! 👑👑`);
|
|
85
73
|
}
|
|
74
|
+
if (fs.existsSync(`${srcPathScss}/${blockName}-inline.scss`)) {
|
|
75
|
+
const contents = fs.readFileSync(
|
|
76
|
+
`${srcPathScss}/${blockName}-inline.scss`,
|
|
77
|
+
'utf-8'
|
|
78
|
+
);
|
|
79
|
+
const replaced = contents.replaceAll(`${blockName}`, `${newName}`);
|
|
80
|
+
fs.writeFileSync(
|
|
81
|
+
`${srcPathScss}/${newName}-inline.scss`,
|
|
82
|
+
replaced,
|
|
83
|
+
'utf-8'
|
|
84
|
+
);
|
|
85
|
+
console.log(
|
|
86
|
+
`👑👑\x1b[32m Successfully duplicated the inline scss file! 👑👑`
|
|
87
|
+
);
|
|
88
|
+
}
|
|
86
89
|
if (fs.existsSync(`${srcPathTwig}/${blockName}.twig`)) {
|
|
87
90
|
const contents = fs.readFileSync(
|
|
88
91
|
`${srcPathTwig}/${blockName}.twig`,
|
|
89
92
|
'utf-8'
|
|
90
93
|
);
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
const regEx2 = RegExp(String.raw`([\"|\']${blockName}[\"|\'])`, 'gi');
|
|
94
|
-
const replaced2 = replaced.replaceAll(regEx2, `"${newName}"`);
|
|
95
|
-
fs.writeFileSync(`${dir}/${newName}.twig`, replaced2, 'utf-8');
|
|
94
|
+
const replaced = contents.replaceAll(blockName, newName);
|
|
95
|
+
fs.writeFileSync(`${srcPathTwig}/${newName}.twig`, replaced, 'utf-8');
|
|
96
96
|
console.log(`👑👑\x1b[32m Successfully duplicated the twig file! 👑👑`);
|
|
97
97
|
}
|
|
98
98
|
if (fs.existsSync(`${srcPathBlockJson}/${blockName}/block.json`)) {
|
|
@@ -109,8 +109,9 @@ if (exisitingBlockNames.includes(blockName)) {
|
|
|
109
109
|
if (data.description) {
|
|
110
110
|
data.description = data.description.replaceAll(blockName, newName);
|
|
111
111
|
}
|
|
112
|
+
fs.mkdirSync(`${srcPathBlockJson}/${newName}`, {recursive: true});
|
|
112
113
|
fs.writeFileSync(
|
|
113
|
-
`${
|
|
114
|
+
`${srcPathBlockJson}/${newName}/block.json`,
|
|
114
115
|
JSON.stringify(data, null, '\t'),
|
|
115
116
|
'utf-8'
|
|
116
117
|
);
|
|
@@ -118,11 +119,5 @@ if (exisitingBlockNames.includes(blockName)) {
|
|
|
118
119
|
`👑👑\x1b[32m Successfully duplicated the block.json file! 👑👑`
|
|
119
120
|
);
|
|
120
121
|
}
|
|
121
|
-
|
|
122
|
-
.compressDir(`${dir}`, `${dir}.zip`)
|
|
123
|
-
.then(() => {
|
|
124
|
-
fs.rmSync(`${destPath}/${newName}`, {recursive: true});
|
|
125
|
-
console.log(`\x1b[32m 🎉 Zip created at ${dir}.zip \x1b[0m`);
|
|
126
|
-
})
|
|
127
|
-
.catch((err) => console.error(err));
|
|
122
|
+
console.log(`\x1b[32m 🎉 Block '${newName}' created successfully! \x1b[0m`);
|
|
128
123
|
}
|