@total_onion/onion-library 1.0.199 → 1.0.201
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/breakpoints.scss
ADDED
|
@@ -1,27 +1,35 @@
|
|
|
1
|
-
// LIBRARY FILE - Do not modify/override here as your changes will be lost when the package is updated.
|
|
2
1
|
import extraJs from 'Assets/js/blocks/standard-content-v3/standard-content-v3-extra.js';
|
|
3
2
|
export default function standardcontentv3Js(options = {}) {
|
|
4
3
|
try {
|
|
5
4
|
const {block} = options;
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
const formContainerElement = block.querySelector('.form-container');
|
|
6
|
+
const modalFormContainerElement = block.querySelector(
|
|
7
|
+
'.form-container__modal'
|
|
8
|
+
);
|
|
9
|
+
const countdownElement = block.querySelector('.countdowndate');
|
|
10
|
+
const socialMediaElement = block.querySelector(
|
|
11
|
+
'.social-media-share-popup'
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
if (formContainerElement || modalFormContainerElement) {
|
|
8
15
|
import(
|
|
9
|
-
'Assets/js/modules/library-modules/
|
|
16
|
+
'Assets/js/modules/library-modules/form-selection/form-selection.js'
|
|
10
17
|
).then((module) => {
|
|
11
18
|
module.default(block);
|
|
12
19
|
});
|
|
13
20
|
}
|
|
14
|
-
|
|
21
|
+
|
|
22
|
+
if (countdownElement) {
|
|
15
23
|
import(
|
|
16
|
-
'Assets/js/modules/library-modules/
|
|
24
|
+
'Assets/js/modules/library-modules/countdown/countdown.js'
|
|
17
25
|
).then((module) => {
|
|
18
26
|
module.default(block);
|
|
19
27
|
});
|
|
20
28
|
}
|
|
21
|
-
|
|
22
|
-
if (
|
|
29
|
+
|
|
30
|
+
if (socialMediaElement) {
|
|
23
31
|
import(
|
|
24
|
-
'Assets/js/modules/library-modules/
|
|
32
|
+
'Assets/js/modules/library-modules/social-media-share/social-media-share.js'
|
|
25
33
|
).then((module) => {
|
|
26
34
|
module.default(block);
|
|
27
35
|
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require('dotenv').config();
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const {globSync} = require('glob');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const themePath =
|
|
6
|
+
process.env.THEME_PATH || 'web/wp-content/themes/global-theme';
|
|
7
|
+
|
|
8
|
+
// Create the directory path for the target file
|
|
9
|
+
const scssModulePath = path.join(themePath, 'assets/scss/modules');
|
|
10
|
+
const scssFilePath = path.join(scssModulePath, 'dynamicBlocksPreview.scss');
|
|
11
|
+
|
|
12
|
+
// Create directories if they don't exist
|
|
13
|
+
fs.mkdirSync(scssModulePath, {recursive: true});
|
|
14
|
+
|
|
15
|
+
// Write the initial content to the target file
|
|
16
|
+
fs.writeFileSync(
|
|
17
|
+
scssFilePath,
|
|
18
|
+
'// This file is auto-generated. To include assets for the lazyloader, just add your .scss file to Assets/scss/blocks/ and it will be included here.\n'
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const dynamicEntryPoints = globSync(
|
|
22
|
+
`${themePath}/assets/scss/blocks/*.scss`
|
|
23
|
+
).map((path) => {
|
|
24
|
+
const assetPath = path.replace(
|
|
25
|
+
'assets/scss/blocks/',
|
|
26
|
+
'Assets/scss/blocks/'
|
|
27
|
+
);
|
|
28
|
+
return assetPath;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const stream = fs.createWriteStream(scssFilePath, {flags: 'a'});
|
|
32
|
+
dynamicEntryPoints.forEach((entry) => {
|
|
33
|
+
stream.write(`@use '${entry}';\n`);
|
|
34
|
+
});
|
|
35
|
+
stream.end();
|