mod-build 4.0.0-alpha.4 → 4.0.0-alpha.6

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,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.0-alpha.4",
3
+ "version": "4.0.0-alpha.6",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
package/siteconfig.js CHANGED
@@ -1,19 +1,3 @@
1
- export let siteData = {
2
- primary_trade: 'Home Warranty',
3
- service: 'home_warranty',
4
- gtm_container_ID: 'GTM-PZGPJR6',
5
- qs_gtm_container_ID: 'GTM-PZGPJR6',
6
- email: 'support@bestcompany.com',
7
- email_unsub: 'unsubscribe@bestcompany.com',
8
- domain: 'bestcompany.com',
9
- company_name: 'BestCompany',
10
- website_name: 'BestCompany.com',
11
- isWhiteLabel: true,
12
- isQSPage: true,
13
- useAccessibleConfig: true,
14
- pathSubdirectory: ''
15
- };
16
-
17
- export function setSiteData(newSiteData) {
18
- siteData = newSiteData;
19
- }
1
+ export const siteData = () => {
2
+ return {};
3
+ };
package/template.js CHANGED
@@ -3,471 +3,5 @@
3
3
  * inside HTML templates using Handlebars
4
4
  */
5
5
  export const templateData = () => {
6
- return {
7
- page: {
8
- headConfig: {
9
- hideTitleCompanyName: true,
10
- title: 'Test',
11
- description: '',
12
- keywords: '',
13
- faviconPath: '/favicon.ico',
14
- inverseTitle: true,
15
- useDynamicGtm: true,
16
- useModAnalytics: true,
17
- disableOgTags: true,
18
- noBsBaseStyles: true,
19
- vwoSetup: {
20
- vwoPathArray: ['none']
21
- }
22
- },
23
- footAssetsConfig: {
24
- disableJquery: true,
25
- disableFormJs: true,
26
- disableExpandCollapse: true,
27
- disableFooter: true
28
- }
29
- },
30
- header: {
31
- attributes: {
32
- class: 'header--transparent',
33
- id: 'test',
34
- 'data-test': 'test'
35
- },
36
- logo: {
37
- picture: {
38
- img: {
39
- attributes: {
40
- src: 'images/logo.svg',
41
- alt: 'Company Name'
42
- }
43
- }
44
- }
45
- },
46
- callRail: {
47
- mobileText: '<span class="hidden visible-sm-up">Call&nbsp;</span>(555) 555-5555',
48
- phoneNumber: '5555555555'
49
- }
50
- },
51
- hero: {
52
- formTemplateInclude: 'src/templates/_partials/form.html',
53
- title: {
54
- text: 'Lorem ipsum dolor sit amet.'
55
- },
56
- callRail: {
57
- text: 'or call (555) 555-5555'
58
- },
59
- background: {},
60
- picture: {
61
- img: {
62
- attributes: {
63
- src: '/images/hero.png',
64
- alt: ''
65
- }
66
- }
67
- }
68
- },
69
- progressbar: {
70
- attributes: {
71
- class: 'text-align-center'
72
- },
73
- includeStepCount: true
74
- },
75
- steps: {
76
- template: 'src/accessible-components/steps/steps.html',
77
- carouselOptions: {
78
- attributes: {
79
- id: 'swiperForm',
80
- class: 'swiper--form swiper--dynamic-step-height',
81
- role: 'group',
82
- tabindex: '0',
83
- aria: {
84
- label: 'Multi-Step Form',
85
- describedby: 'steps-description'
86
- }
87
- },
88
- description: 'Use the buttons on each slide (Go, Next, or Back) or click Enter to move throughout the form steps. Use tab to navigate between input fields. On the final step, the form information will be submitted. When your results load, you will be redirected to a new web page.'
89
- },
90
- items: [
91
- {
92
- attributes: {
93
- data: {
94
- 'step-name': 'zip'
95
- }
96
- },
97
- stepContent: {
98
- title: {
99
- text: 'What is your zip code?'
100
- },
101
- fields: [
102
- {
103
- attributes: {
104
- name: 'zip',
105
- class: 'form-input--border-bottom-only'
106
- }
107
- }
108
- ],
109
- button: {
110
- attributes: {
111
- class: 'btn--primary'
112
- },
113
- text: 'Next Step'
114
- }
115
- }
116
- },
117
- {
118
- attributes: {
119
- data: {
120
- 'step-name': 'OwnHome'
121
- }
122
- },
123
- stepContent: {
124
- fields: [
125
- {
126
- fieldType: 'radio',
127
- radioOptionType: 'group',
128
- attributes: {
129
- id: 'OwnHome'
130
- },
131
- legend: {
132
- text: 'Do you own or rent your home?'
133
- },
134
- options: [
135
- {
136
- attributes: {
137
- name: 'OwnHome',
138
- id: 'YesOwnHome',
139
- value: 'Yes',
140
- data: {
141
- required: 'nonempty'
142
- }
143
- },
144
- text: 'Own'
145
- },
146
- {
147
- attributes: {
148
- name: 'OwnHome',
149
- id: 'NoRentHome',
150
- value: 'No',
151
- data: {
152
- required: 'nonempty'
153
- }
154
- },
155
- text: 'Rent'
156
- }
157
- ]
158
- }
159
- ],
160
- button: {
161
- attributes: {
162
- class: 'btn--primary'
163
- },
164
- text: 'Next Step'
165
- }
166
- }
167
- },
168
- {
169
- attributes: {
170
- data: {
171
- 'step-name': 'ElectricBill'
172
- }
173
- },
174
- stepContent: {
175
- title: {
176
- text: 'What‘s your monthly electric bill?'
177
- },
178
- fields: [
179
- {
180
- fieldType: 'select',
181
- attributes: {
182
- class: 'select--border-bottom-only',
183
- name: 'ElectricBill',
184
- id: 'ElectricBill'
185
- },
186
- options: [
187
- {
188
- attributes: {
189
- value: '',
190
- disabled: ''
191
- },
192
- text: 'Please Select'
193
- },
194
- {
195
- attributes: {
196
- value: '$300+'
197
- },
198
- text: '$300+'
199
- },
200
- {
201
- attributes: {
202
- value: '$200 - $300'
203
- },
204
- text: '$200 - $300'
205
- },
206
- {
207
- attributes: {
208
- value: '$100 - $200',
209
- selected: ''
210
- },
211
- text: '$100 - $200'
212
- },
213
- {
214
- attributes: {
215
- value: 'Under $100'
216
- },
217
- text: 'Under $100'
218
- }
219
- ]
220
- }
221
- ],
222
- button: {
223
- attributes: {
224
- class: 'btn--primary'
225
- },
226
- text: 'Next Step'
227
- }
228
- }
229
- },
230
- {
231
- attributes: {
232
- data: {
233
- 'step-name': 'UtilityProvider'
234
- }
235
- },
236
- stepContent: {
237
- title: {
238
- text: 'Who is your current utility provider?'
239
- },
240
- fields: [
241
- {
242
- fieldType: 'select',
243
- attributes: {
244
- class: 'select--border-bottom-only',
245
- name: 'UtilityProvider',
246
- id: 'UtilityProvider'
247
- },
248
- options: [
249
- {
250
- text: 'Other',
251
- value: 'Other'
252
- }
253
- ]
254
- }
255
- ],
256
- button: {
257
- attributes: {
258
- class: 'btn--primary'
259
- },
260
- text: 'Next Step'
261
- }
262
- }
263
- },
264
- {
265
- attributes: {
266
- class: 'step--last',
267
- data: {
268
- 'step-name': 'personalInfo'
269
- }
270
- },
271
- stepContent: {
272
- fields: [
273
- {
274
- formGroup: {
275
- attributes: {
276
- class: 'form-group--flex-50'
277
- }
278
- },
279
- attributes: {
280
- name: 'firstName',
281
- class: 'form-input--border-bottom-only'
282
- }
283
- },
284
- {
285
- formGroup: {
286
- attributes: {
287
- class: 'form-group--flex-50'
288
- }
289
- },
290
- attributes: {
291
- name: 'lastName',
292
- class: 'form-input--border-bottom-only'
293
- }
294
- },
295
- {
296
- attributes: {
297
- name: 'email',
298
- class: 'form-input--border-bottom-only'
299
- }
300
- },
301
- {
302
- attributes: {
303
- name: 'homePhone',
304
- class: 'form-input--border-bottom-only'
305
- }
306
- },
307
- {
308
- attributes: {
309
- name: 'address',
310
- class: 'form-input--border-bottom-only'
311
- },
312
- labelInInput: 'Street Address'
313
- },
314
- {
315
- formGroup: {
316
- attributes: {
317
- class: 'form-group--flex-33'
318
- }
319
- },
320
- fieldType: 'input',
321
- attributes: {
322
- class: 'form-input--border-bottom-only',
323
- name: 'visualCity',
324
- value: ''
325
- },
326
- labelInInput: 'City'
327
- },
328
- {
329
- formGroup: {
330
- attributes: {
331
- class: 'form-group--flex-33'
332
- }
333
- },
334
- fieldType: 'input',
335
- attributes: {
336
- class: 'form-input--border-bottom-only',
337
- name: 'state',
338
- disabled: '',
339
- value: ''
340
- },
341
- labelInInput: 'State'
342
- },
343
- {
344
- formGroup: {
345
- attributes: {
346
- class: 'form-group--flex-33'
347
- }
348
- },
349
- attributes: {
350
- name: 'zip',
351
- class: 'form-input--border-bottom-only'
352
- }
353
- },
354
- {
355
- fieldType: 'input',
356
- attributes: {
357
- name: 'city',
358
- type: 'hidden',
359
- value: ''
360
- }
361
- }
362
- ],
363
- tcpa: {
364
- placement: 'below-cta'
365
- },
366
- button: {
367
- attributes: {
368
- class: 'btn--primary'
369
- },
370
- text: 'Get Quote'
371
- }
372
- }
373
- }
374
- ]
375
- },
376
- featuredBlock: {
377
- title: {
378
- attributes: {
379
- class: 'text-align-center'
380
- },
381
- text: 'About [ Company Name ]'
382
- },
383
- columns: [
384
- {
385
- attributes: {
386
- class: 'hidden visible-lg-up'
387
- },
388
- picture: {
389
- img: {
390
- attributes: {
391
- src: '/images/logo.svg',
392
- alt: '',
393
- loading: 'lazy'
394
- }
395
- }
396
- },
397
- button: {
398
- tag: 'a',
399
- attributes: {
400
- class: 'btn--secondary',
401
- href: 'tel:5555555555'
402
- },
403
- text: 'Call (555) 555-5555'
404
- }
405
- },
406
- {
407
- description: {
408
- text: 'Vivamus gravida facilisis arcu, eu vestibulum massa molestie eget. Curabitur sollicitudin justo quis dignissim iaculis. Donec venenatis ullamcorper odio, vel placerat sem porttitor at. Maecenas in enim suscipit, elementum est eget, dignissim ipsum. Nam nec orci id enim congue viverra quis eget dui.'
409
- }
410
- },
411
- {
412
- attributes: {
413
- class: 'visible-sm-down hidden visible-md'
414
- },
415
- picture: {
416
- img: {
417
- attributes: {
418
- src: '/images/logo.svg',
419
- alt: '',
420
- loading: 'lazy'
421
- }
422
- }
423
- },
424
- button: {
425
- tag: 'a',
426
- attributes: {
427
- class: 'btn--secondary',
428
- href: 'tel:5555555555'
429
- },
430
- text: 'Call (555) 555-5555'
431
- }
432
- }
433
- ]
434
- },
435
- reviews: {
436
- title: {
437
- text: 'What People Are Saying'
438
- },
439
- items: [
440
- {
441
- starRating: '50',
442
- showRatingNextToAuthor: true,
443
- reviewText: 'Duis dui odio, eleifend ac mauris cursus, feugiat mollis felis. Praesent sit amet justo pharetra, tristique purus nec, accumsan leo. Donec viverra, nunc in efficitur sagittis, tortor magna venenatis ante, vel vestibulum sem ex sit amet est. Quisque efficitur, purus eget congue porttitor, dui metus egestas erat, eu auctor quam mi ac metus.',
444
- excludeQuotes: true,
445
- authorName: 'Lorem Ipsum',
446
- date: 'Month Day, Year',
447
- location: 'City, State'
448
- },
449
- {
450
- starRating: '50',
451
- showRatingNextToAuthor: true,
452
- reviewText: 'Donec imperdiet vitae arcu vel dictum. Mauris tempus elit nec orci tempus, non egestas odio semper. Duis laoreet venenatis neque eget euismod. Duis dapibus et orci ac facilisis.',
453
- excludeQuotes: true,
454
- authorName: 'Lorem Ipsum',
455
- date: 'Month Day, Year',
456
- location: 'City, State'
457
- },
458
- {
459
- starRating: '50',
460
- showRatingNextToAuthor: true,
461
- reviewText: 'Suspendisse dapibus felis ut diam egestas, ac tristique sapien laoreet. Maecenas pellentesque vel odio vitae egestas. Vestibulum posuere viverra luctus. Ut ornare ut ligula non accumsan. Etiam hendrerit ex sit amet turpis pretium rhoncus sit amet non est.',
462
- excludeQuotes: true,
463
- authorName: 'Lorem Ipsum',
464
- date: 'Month Day, Year',
465
- location: 'City, State'
466
- }
467
- ]
468
- },
469
- siteData: {
470
- useAccessibleConfig: true
471
- }
472
- };
6
+ return {};
473
7
  };
package/vite.config.js CHANGED
@@ -9,7 +9,9 @@ import { handlebarsHelpers } from './src/scripts/utils.js'
9
9
  import gulpHandlebarsFileInclude from 'gulp-handlebars-file-include'
10
10
  import eslint from 'vite-plugin-eslint'
11
11
 
12
- export default defineConfig(() => ({
12
+ const themeSettings = { ...siteData(), ...templateData() }
13
+
14
+ export default defineConfig((config = themeSettings) => ({
13
15
  build: {
14
16
  outDir: `${defaultSettings.distFolder}`,
15
17
  emptyOutDir: false
@@ -19,14 +21,14 @@ export default defineConfig(() => ({
19
21
  handlebars({
20
22
  data: ['src/**/*.json'],
21
23
  formats: ['json', 'html', 'hbs'],
22
- globals: templateData(),
24
+ globals: config,
23
25
  partials: {
24
26
  directory: 'src/templates/',
25
27
  }
26
28
  }),
27
29
  gulpHandlebarsFileInclude({}, { handlebarsHelpers }),
28
30
  {
29
- ...gulpServe(siteData),
31
+ ...gulpServe(config),
30
32
  apply: 'serve'
31
33
  },
32
34
  {