mod-build 4.0.11 → 4.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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/scripts/utils.js +11 -0
- package/tasks/grab-shared-scripts.js +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 4.0.13
|
|
2
|
+
|
|
3
|
+
- Making sure the abandonment.min.js gets copied to the right folder path (needs to copy to /abandonment/accessible/ if the site is indeed using the accessible version). This will ensure our shared-resource deployments trigger the files correctly.
|
|
4
|
+
|
|
5
|
+
## 4.0.12
|
|
6
|
+
|
|
7
|
+
- Adding a handlebars helper to see if the value is an array or not
|
|
8
|
+
|
|
1
9
|
## 4.0.11
|
|
2
10
|
|
|
3
11
|
- Adding the overflow on slide transition
|
package/package.json
CHANGED
package/src/scripts/utils.js
CHANGED
|
@@ -59,6 +59,17 @@ export const handlebarsHelpers = [
|
|
|
59
59
|
return handlebarsX(expression, this, options) ? options.fn(this) : options.inverse(this);
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
+
// Check if it is an array
|
|
63
|
+
{
|
|
64
|
+
name: 'isArray',
|
|
65
|
+
fn: function(expression, options) {
|
|
66
|
+
if (Array.isArray(expression)) {
|
|
67
|
+
return options.fn(expression);
|
|
68
|
+
} else {
|
|
69
|
+
return options.inverse(expression);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
62
73
|
// Reverse array
|
|
63
74
|
{
|
|
64
75
|
name: 'reverseArray',
|
|
@@ -16,6 +16,7 @@ let componentFolderPath = '';
|
|
|
16
16
|
let replacementFunctions = [];
|
|
17
17
|
|
|
18
18
|
let pathSubdirectory = '';
|
|
19
|
+
let useAccessibleComponents = false;
|
|
19
20
|
|
|
20
21
|
const axiosInstance = axios.create();
|
|
21
22
|
responseInterceptor(axiosInstance);
|
|
@@ -54,11 +55,12 @@ function replaceFootAssetScripts(gulp, defaultSettings) {
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
function replaceAbandonmentJsCssSrc(gulp, defaultSettings) {
|
|
58
|
+
const abandonmentJsRegex = useAccessibleComponents ? /"(?:(?!"|")[\s\S])+(abandonment\/accessible\/abandonment.*?)js"/ : /"(?:(?!"|")[\s\S])+(abandonment\/abandonment.*?)js"/;
|
|
57
59
|
const jsResourcePath = '/resources/scripts/abandonment/';
|
|
58
60
|
const cssResourcePath = '/resources/styles/components/abandonment/';
|
|
59
61
|
return new Promise((resolve) => {
|
|
60
62
|
gulp.src(defaultSettings.srcFolder + '/templates/abandonment/*.html')
|
|
61
|
-
.pipe(replace(
|
|
63
|
+
.pipe(replace(abandonmentJsRegex, `"${jsResourcePath}${fileNames.abandonmentJsFileName}"`))
|
|
62
64
|
.pipe(replace(/"(?:(?!"|")[\s\S])+(components\/abandonment\/abandonment.*?)css"/, `"${cssResourcePath}${fileNames.abandonmentStylesFileName}"`))
|
|
63
65
|
.pipe(gulp.dest(defaultSettings.srcFolder + '/templates/abandonment'))
|
|
64
66
|
.on('finish', resolve);
|
|
@@ -241,7 +243,7 @@ function getResource(task, fileNames, resourcePath = 'quote/resources') {
|
|
|
241
243
|
|
|
242
244
|
export default async function(config) {
|
|
243
245
|
const { isLocal } = defaultSettings;
|
|
244
|
-
|
|
246
|
+
useAccessibleComponents = config.useAccessibleConfig;
|
|
245
247
|
componentFolderPath = useAccessibleComponents === true ? 'accessible-components' : 'shared-components';
|
|
246
248
|
const tasks = Object.values(TASKS);
|
|
247
249
|
const isPathSubdirectory = config.siteData?.pathSubdirectory || config.pathSubdirectory;
|
|
@@ -251,6 +253,7 @@ export default async function(config) {
|
|
|
251
253
|
const getAllResources = tasks.map(async function(task) {
|
|
252
254
|
if (useAccessibleComponents && task.url.includes('abandonment.min.js')) {
|
|
253
255
|
task.url = 'shared-resources/scripts/abandonment/accessible/abandonment.min.js';
|
|
256
|
+
task.config.dest = 'scripts/abandonment/accessible';
|
|
254
257
|
}
|
|
255
258
|
Object.assign(task.config, { defaultSettings, config });
|
|
256
259
|
await getResource(task, fileNames);
|