generator-white-label 3.2.0 → 5.0.1

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.
Files changed (253) hide show
  1. package/README.md +140 -81
  2. package/app/README.md +19 -0
  3. package/app/assets/font/opensans/stylesheet.css +20 -60
  4. package/app/assets/image/demo/fallback.avif +0 -0
  5. package/app/assets/image/demo/fallback.jpg +0 -0
  6. package/app/assets/image/demo/fallback.webp +0 -0
  7. package/app/assets/image/demo/large.avif +0 -0
  8. package/app/assets/image/demo/large.webp +0 -0
  9. package/app/assets/image/demo/small.avif +0 -0
  10. package/app/assets/image/demo/small.webp +0 -0
  11. package/app/assets/markup/element/iframe.hbs +4 -1
  12. package/app/assets/markup/element/img.hbs +16 -1
  13. package/app/assets/markup/element/picture.hbs +30 -0
  14. package/app/assets/markup/modal/modal-example-1.handlebars +1 -1
  15. package/app/assets/script/api/{facebook.js → facebook.ts} +17 -12
  16. package/app/assets/script/api/youtube.ts +22 -0
  17. package/app/assets/script/index.ts +2 -0
  18. package/app/assets/script/mediator/global.ts +4 -0
  19. package/app/assets/script/model/singletons/countries.ts +5 -0
  20. package/app/assets/script/model/singletons/global.ts +5 -0
  21. package/app/assets/script/model/singletons/states.ts +5 -0
  22. package/app/assets/script/model/user.ts +4 -0
  23. package/app/assets/script/toolkit.ts +11 -0
  24. package/app/assets/script/types.d.ts +6 -0
  25. package/app/assets/script/utility/ajax.ts +15 -0
  26. package/app/assets/script/utility/form.ts +119 -0
  27. package/app/assets/script/utility/{regex.js → regex.ts} +15 -6
  28. package/app/assets/script/utility/share.ts +77 -0
  29. package/app/assets/script/utility/string.ts +148 -0
  30. package/app/assets/script/view/default.tsx +14 -0
  31. package/app/assets/script/view/toolkit/youtube-player-1.ts +33 -0
  32. package/app/assets/style/base/_toolkit.scss +25 -25
  33. package/app/assets/style/base/components/_modal-1.scss +8 -3
  34. package/app/assets/style/base/components/_tabpanel-1.scss +21 -16
  35. package/app/assets/style/base/components/_tabpanel-2.scss +11 -6
  36. package/app/assets/style/base/components/_youtube-player-1.scss +3 -2
  37. package/app/assets/style/base/elements/_anchors.scss +2 -0
  38. package/app/assets/style/base/elements/_buttons.scss +7 -3
  39. package/app/assets/style/base/elements/_fieldsets.scss +2 -0
  40. package/app/assets/style/base/elements/_inputs.scss +6 -2
  41. package/app/assets/style/base/elements/_labels.scss +2 -0
  42. package/app/assets/style/base/elements/_legends.scss +2 -0
  43. package/app/assets/style/base/elements/_lists.scss +2 -0
  44. package/app/assets/style/base/elements/_tables.scss +10 -6
  45. package/app/assets/style/base/layouts/_staggered-1.scss +4 -1
  46. package/app/assets/style/base/type/_fonts.scss +4 -1
  47. package/app/assets/style/base/type/_headings.scss +3 -0
  48. package/app/assets/style/base/type/_text.scss +2 -0
  49. package/app/assets/style/base/utilities/_accessibility.scss +5 -2
  50. package/app/assets/style/base/utilities/_functions.scss +62 -9
  51. package/app/assets/style/global.scss +4 -11
  52. package/app/assets/style/print.scss +1 -4
  53. package/app/assets/style/toolkit.scss +37 -37
  54. package/app/package.json +1 -0
  55. package/app/toolkit/colors.hbs +11 -11
  56. package/app/toolkit/components.hbs +16 -16
  57. package/app/toolkit/elements.hbs +52 -43
  58. package/app/toolkit/grids.hbs +111 -111
  59. package/app/toolkit/icons.hbs +2 -2
  60. package/app/toolkit/index.hbs +6 -6
  61. package/app/toolkit/type.hbs +4 -4
  62. package/dist/app/assets/data/coutries.json +992 -0
  63. package/dist/app/assets/data/states.json +204 -0
  64. package/dist/app/assets/script/api/facebook.d.ts +8 -0
  65. package/dist/app/assets/script/api/facebook.js +42 -0
  66. package/dist/app/assets/script/api/facebook.js.map +1 -0
  67. package/dist/app/assets/script/api/youtube.d.ts +8 -0
  68. package/dist/app/assets/script/api/youtube.js +22 -0
  69. package/dist/app/assets/script/api/youtube.js.map +1 -0
  70. package/dist/app/assets/script/index.d.ts +2 -0
  71. package/dist/app/assets/script/index.js +2 -0
  72. package/dist/app/assets/script/index.js.map +1 -0
  73. package/dist/app/assets/script/mediator/global.d.ts +4 -0
  74. package/dist/app/assets/script/mediator/global.js +4 -0
  75. package/dist/app/assets/script/mediator/global.js.map +1 -0
  76. package/dist/app/assets/script/model/singletons/countries.d.ts +4 -0
  77. package/dist/app/assets/script/model/singletons/countries.js +5 -0
  78. package/dist/app/assets/script/model/singletons/countries.js.map +1 -0
  79. package/dist/app/assets/script/model/singletons/global.d.ts +4 -0
  80. package/dist/app/assets/script/model/singletons/global.js +5 -0
  81. package/dist/app/assets/script/model/singletons/global.js.map +1 -0
  82. package/dist/app/assets/script/model/singletons/states.d.ts +4 -0
  83. package/dist/app/assets/script/model/singletons/states.js +5 -0
  84. package/dist/app/assets/script/model/singletons/states.js.map +1 -0
  85. package/dist/app/assets/script/model/user.d.ts +4 -0
  86. package/dist/app/assets/script/model/user.js +6 -0
  87. package/dist/app/assets/script/model/user.js.map +1 -0
  88. package/dist/app/assets/script/toolkit.d.ts +1 -0
  89. package/dist/app/assets/script/toolkit.js +7 -0
  90. package/dist/app/assets/script/toolkit.js.map +1 -0
  91. package/dist/app/assets/script/utility/ajax.d.ts +8 -0
  92. package/dist/app/assets/script/utility/ajax.js +17 -0
  93. package/dist/app/assets/script/utility/ajax.js.map +1 -0
  94. package/dist/app/assets/script/utility/form.d.ts +64 -0
  95. package/dist/app/assets/script/utility/form.js +111 -0
  96. package/dist/app/assets/script/utility/form.js.map +1 -0
  97. package/dist/app/assets/script/utility/regex.d.ts +14 -0
  98. package/dist/app/assets/script/utility/regex.js +27 -0
  99. package/dist/app/assets/script/utility/regex.js.map +1 -0
  100. package/dist/app/assets/script/utility/share.d.ts +68 -0
  101. package/dist/app/assets/script/utility/share.js +81 -0
  102. package/dist/app/assets/script/utility/share.js.map +1 -0
  103. package/dist/app/assets/script/utility/string.d.ts +64 -0
  104. package/dist/app/assets/script/utility/string.js +135 -0
  105. package/dist/app/assets/script/utility/string.js.map +1 -0
  106. package/dist/app/assets/script/view/default.d.ts +11 -0
  107. package/dist/app/assets/script/view/default.js +15 -0
  108. package/dist/app/assets/script/view/default.js.map +1 -0
  109. package/dist/app/assets/script/view/toolkit/youtube-player-1.d.ts +23 -0
  110. package/dist/app/assets/script/view/toolkit/youtube-player-1.js +34 -0
  111. package/dist/app/assets/script/view/toolkit/youtube-player-1.js.map +1 -0
  112. package/dist/generators/app/index.d.ts +18 -0
  113. package/dist/generators/app/index.js +59 -0
  114. package/dist/generators/app/index.js.map +1 -0
  115. package/dist/scripts/build.d.ts +22 -0
  116. package/dist/scripts/build.js +158 -0
  117. package/dist/scripts/build.js.map +1 -0
  118. package/generators/app/index.js +2 -43
  119. package/generators/app/index.ts +61 -0
  120. package/package.json +79 -129
  121. package/scripts/build.ts +175 -0
  122. package/tsconfig.site.json +26 -0
  123. package/.babelrc +0 -14
  124. package/.editorconfig +0 -13
  125. package/.eslintrc +0 -64
  126. package/.htmllintrc +0 -6
  127. package/.sass-lint.yml +0 -16
  128. package/.travis.yml +0 -18
  129. package/app/assets/font/opensans/generator_config.txt +0 -5
  130. package/app/assets/font/opensans/opensans-bold-webfont.eot +0 -0
  131. package/app/assets/font/opensans/opensans-bold-webfont.svg +0 -1824
  132. package/app/assets/font/opensans/opensans-bold-webfont.ttf +0 -0
  133. package/app/assets/font/opensans/opensans-bold-webfont.woff +0 -0
  134. package/app/assets/font/opensans/opensans-bolditalic-webfont.eot +0 -0
  135. package/app/assets/font/opensans/opensans-bolditalic-webfont.svg +0 -1824
  136. package/app/assets/font/opensans/opensans-bolditalic-webfont.ttf +0 -0
  137. package/app/assets/font/opensans/opensans-bolditalic-webfont.woff +0 -0
  138. package/app/assets/font/opensans/opensans-extrabold-webfont.eot +0 -0
  139. package/app/assets/font/opensans/opensans-extrabold-webfont.svg +0 -1824
  140. package/app/assets/font/opensans/opensans-extrabold-webfont.ttf +0 -0
  141. package/app/assets/font/opensans/opensans-extrabold-webfont.woff +0 -0
  142. package/app/assets/font/opensans/opensans-extrabolditalic-webfont.eot +0 -0
  143. package/app/assets/font/opensans/opensans-extrabolditalic-webfont.svg +0 -1824
  144. package/app/assets/font/opensans/opensans-extrabolditalic-webfont.ttf +0 -0
  145. package/app/assets/font/opensans/opensans-extrabolditalic-webfont.woff +0 -0
  146. package/app/assets/font/opensans/opensans-italic-webfont.eot +0 -0
  147. package/app/assets/font/opensans/opensans-italic-webfont.svg +0 -1824
  148. package/app/assets/font/opensans/opensans-italic-webfont.ttf +0 -0
  149. package/app/assets/font/opensans/opensans-italic-webfont.woff +0 -0
  150. package/app/assets/font/opensans/opensans-light-webfont.eot +0 -0
  151. package/app/assets/font/opensans/opensans-light-webfont.svg +0 -1824
  152. package/app/assets/font/opensans/opensans-light-webfont.ttf +0 -0
  153. package/app/assets/font/opensans/opensans-light-webfont.woff +0 -0
  154. package/app/assets/font/opensans/opensans-lightitalic-webfont.eot +0 -0
  155. package/app/assets/font/opensans/opensans-lightitalic-webfont.svg +0 -1824
  156. package/app/assets/font/opensans/opensans-lightitalic-webfont.ttf +0 -0
  157. package/app/assets/font/opensans/opensans-lightitalic-webfont.woff +0 -0
  158. package/app/assets/font/opensans/opensans-regular-webfont.eot +0 -0
  159. package/app/assets/font/opensans/opensans-regular-webfont.svg +0 -1824
  160. package/app/assets/font/opensans/opensans-regular-webfont.ttf +0 -0
  161. package/app/assets/font/opensans/opensans-regular-webfont.woff +0 -0
  162. package/app/assets/font/opensans/opensans-semibold-webfont.eot +0 -0
  163. package/app/assets/font/opensans/opensans-semibold-webfont.svg +0 -1824
  164. package/app/assets/font/opensans/opensans-semibold-webfont.ttf +0 -0
  165. package/app/assets/font/opensans/opensans-semibold-webfont.woff +0 -0
  166. package/app/assets/font/opensans/opensans-semibolditalic-webfont.eot +0 -0
  167. package/app/assets/font/opensans/opensans-semibolditalic-webfont.svg +0 -1824
  168. package/app/assets/font/opensans/opensans-semibolditalic-webfont.ttf +0 -0
  169. package/app/assets/font/opensans/opensans-semibolditalic-webfont.woff +0 -0
  170. package/app/assets/font/opensans/specimen_files/grid_12-825-55-15.css +0 -129
  171. package/app/assets/font/opensans/specimen_files/specimen_stylesheet.css +0 -396
  172. package/app/assets/image/demo/large.jpg +0 -0
  173. package/app/assets/image/demo/medium.jpg +0 -0
  174. package/app/assets/image/demo/small.jpg +0 -0
  175. package/app/assets/image/demo/xlarge.jpg +0 -0
  176. package/app/assets/image/demo/xxlarge.jpg +0 -0
  177. package/app/assets/script/api/youtube.js +0 -18
  178. package/app/assets/script/index.js +0 -6
  179. package/app/assets/script/mediator/global.js +0 -5
  180. package/app/assets/script/model/singletons/countries.js +0 -6
  181. package/app/assets/script/model/singletons/global.js +0 -6
  182. package/app/assets/script/model/singletons/states.js +0 -6
  183. package/app/assets/script/model/user.js +0 -5
  184. package/app/assets/script/toolkit.js +0 -12
  185. package/app/assets/script/utility/ajax.js +0 -11
  186. package/app/assets/script/utility/form.js +0 -86
  187. package/app/assets/script/utility/share.js +0 -52
  188. package/app/assets/script/utility/string.js +0 -70
  189. package/app/assets/script/view/default.js +0 -11
  190. package/app/assets/script/view/toolkit/youtube-player-1.js +0 -17
  191. package/app/assets/style/base/vendor/_foundation.scss +0 -2
  192. package/app/assets/test/spec/shareSpec.js +0 -137
  193. package/app/index.html +0 -40
  194. package/app/report/istanbul/base.css +0 -213
  195. package/app/report/istanbul/prettify.css +0 -1
  196. package/app/report/istanbul/prettify.js +0 -1
  197. package/app/report/istanbul/sort-arrow-sprite.png +0 -0
  198. package/app/report/istanbul/sorter.js +0 -158
  199. package/app/report/jsdoc/fonts/glyphicons-halflings-regular.eot +0 -0
  200. package/app/report/jsdoc/fonts/glyphicons-halflings-regular.svg +0 -288
  201. package/app/report/jsdoc/fonts/glyphicons-halflings-regular.ttf +0 -0
  202. package/app/report/jsdoc/fonts/glyphicons-halflings-regular.woff +0 -0
  203. package/app/report/jsdoc/fonts/glyphicons-halflings-regular.woff2 +0 -0
  204. package/app/report/jsdoc/img/glyphicons-halflings-white.png +0 -0
  205. package/app/report/jsdoc/img/glyphicons-halflings.png +0 -0
  206. package/app/report/jsdoc/scripts/docstrap.lib.js +0 -11
  207. package/app/report/jsdoc/scripts/fulltext-search-ui.js +0 -89
  208. package/app/report/jsdoc/scripts/fulltext-search.js +0 -36
  209. package/app/report/jsdoc/scripts/lunr.min.js +0 -6
  210. package/app/report/jsdoc/scripts/prettify/Apache-License-2.0.txt +0 -202
  211. package/app/report/jsdoc/scripts/prettify/jquery.min.js +0 -6
  212. package/app/report/jsdoc/scripts/prettify/lang-css.js +0 -21
  213. package/app/report/jsdoc/scripts/prettify/prettify.js +0 -496
  214. package/app/report/jsdoc/scripts/sunlight.js +0 -1157
  215. package/app/report/jsdoc/scripts/toc.js +0 -203
  216. package/app/report/jsdoc/styles/darkstrap.css +0 -960
  217. package/app/report/jsdoc/styles/prettify-tomorrow.css +0 -132
  218. package/app/report/jsdoc/styles/site.cerulean.css +0 -7008
  219. package/app/report/jsdoc/styles/site.cosmo.css +0 -7061
  220. package/app/report/jsdoc/styles/site.cyborg.css +0 -7048
  221. package/app/report/jsdoc/styles/site.darkly.css +0 -7171
  222. package/app/report/jsdoc/styles/site.darkstrap.css +0 -5638
  223. package/app/report/jsdoc/styles/site.dibs-bootstrap.css +0 -5899
  224. package/app/report/jsdoc/styles/site.flatly.css +0 -7147
  225. package/app/report/jsdoc/styles/site.journal.css +0 -6973
  226. package/app/report/jsdoc/styles/site.lumen.css +0 -7298
  227. package/app/report/jsdoc/styles/site.paper.css +0 -7623
  228. package/app/report/jsdoc/styles/site.readable.css +0 -6997
  229. package/app/report/jsdoc/styles/site.sandstone.css +0 -7035
  230. package/app/report/jsdoc/styles/site.simplex.css +0 -7023
  231. package/app/report/jsdoc/styles/site.slate.css +0 -7343
  232. package/app/report/jsdoc/styles/site.spacelab.css +0 -7055
  233. package/app/report/jsdoc/styles/site.superhero.css +0 -7131
  234. package/app/report/jsdoc/styles/site.united.css +0 -6895
  235. package/app/report/jsdoc/styles/site.yeti.css +0 -7195
  236. package/app/report/jsdoc/styles/sunlight.dark.css +0 -345
  237. package/app/report/jsdoc/styles/sunlight.default.css +0 -344
  238. package/gulp/config.js +0 -224
  239. package/gulp/tasks/accessibility.js +0 -34
  240. package/gulp/tasks/build.js +0 -19
  241. package/gulp/tasks/clean.js +0 -34
  242. package/gulp/tasks/data.js +0 -22
  243. package/gulp/tasks/default.js +0 -9
  244. package/gulp/tasks/deploy.js +0 -225
  245. package/gulp/tasks/documentation.js +0 -25
  246. package/gulp/tasks/markup.js +0 -121
  247. package/gulp/tasks/script.js +0 -92
  248. package/gulp/tasks/style.js +0 -42
  249. package/gulp/tasks/unit.js +0 -38
  250. package/gulp/tasks/watch.js +0 -83
  251. package/gulpfile.js +0 -8
  252. package/jsdoc.json +0 -23
  253. package/karma.conf.js +0 -58
package/README.md CHANGED
@@ -1,136 +1,195 @@
1
- # white label
1
+ # white-label
2
2
 
3
- [![Build Status](https://travis-ci.org/bshack/white-label.svg?branch=master)](https://travis-ci.org/bshack/white-label)
3
+ `white-label` is a Yeoman generator and build system for creating static websites. It provides a working project structure with Handlebars templates, Sass styles, Bootstrap, responsive images, and TypeScript sources compiled to bundled JavaScript.
4
4
 
5
- Scaffolding for developing and deploying sites.
5
+ Use it when you want a small, understandable static-site foundation that you can brand and extend without adopting a full application framework.
6
6
 
7
- ## Key Libraries
7
+ ## What it builds
8
8
 
9
- - Babel
10
- - Foundation
11
- - Browserify
12
- - Browsersync
13
- - Gulp
14
- - Handlebars
15
- - Jasmine
16
- - Modernizr
17
- - Node Events
18
- - Karma
19
- - ReactJS
20
- - SCSS
21
- - [White Label Model](https://github.com/bshack/white-label-model)
9
+ The project separates source files by responsibility:
22
10
 
23
- ## Install Dependancies
11
+ - `app/*.hbs` contains pages.
12
+ - `app/assets/markup` contains reusable Handlebars partials.
13
+ - `app/assets/data/view` contains global and page-specific JSON data.
14
+ - `app/assets/style` contains Sass entry points and partials.
15
+ - `app/assets/script` contains TypeScript and TSX entry points.
16
+ - `app/assets/image` and `app/assets/font` contain static assets.
17
+ - `scripts/build.ts` turns those sources into a deployable `_deploy` directory.
24
18
 
25
- IMPORTANT: Verify you have the latest versions of each of these if you have previously installed them.
19
+ The build renders Handlebars pages, compiles Sass, bundles JavaScript with esbuild, copies static assets, and writes the deployment configuration to `assets/data/config.json`. `global.css` includes the complete compiled Bootstrap CSS followed by the project's styles.
26
20
 
27
- ### Nodejs
21
+ Generated formatting utilities use native `Intl` and `Date` APIs, so new projects do not need Lodash, Moment, or Numeral for the included examples.
28
22
 
29
- http://nodejs.org
23
+ ## Requirements
30
24
 
31
- _This project works with 'LTS' or 'Current'_
25
+ - Node.js 20 or newer
26
+ - npm 10 or newer
32
27
 
33
- ### Gulp
28
+ ## Generate a new site
34
29
 
35
- http://gulpjs.com
30
+ Install Yeoman and the generator, then run it in an empty project directory:
36
31
 
37
- ### Other
38
-
39
- Debian/Ubuntu Users:
40
- build-essential package
32
+ ```sh
33
+ npm install --global yo generator-white-label
34
+ mkdir my-site
35
+ cd my-site
36
+ yo white-label
37
+ ```
41
38
 
42
- ### Node Modules
39
+ The generator copies the `app` and `scripts` directories and creates a project `package.json`. It intentionally does not install dependencies automatically, so you can review that manifest first:
43
40
 
44
- ```
45
- npm install;
41
+ ```sh
42
+ npm install
43
+ npm test
46
44
  ```
47
45
 
48
- ### Text Editor Config
46
+ ## Build the site
49
47
 
50
- Install the correct plugin for your text editor here:
48
+ A build with defaults is enough for local inspection:
51
49
 
52
- http://editorconfig.org/#download
53
-
54
- This will normalize settings like what tab character(s) to use and will avoid linting errors.
50
+ ```sh
51
+ npm run build
52
+ ```
55
53
 
56
- ## Gulp Tasks
54
+ The generated site is written to `_deploy`. Each asset build is placed under `_deploy/release/<version>/assets`; when no version is supplied, the build uses the current Unix timestamp.
57
55
 
58
- ### Watch
56
+ For a deployment build, pass explicit values after `--`:
59
57
 
60
- ```
61
- gulp watch;
58
+ ```sh
59
+ npm run build -- \
60
+ --www=https://www.example.com \
61
+ --cdn=https://cdn.example.com \
62
+ --service=https://api.example.com \
63
+ --version=2026.09.06 \
64
+ --production=true
62
65
  ```
63
66
 
64
- This will create a Browsersync server and reload your browser window(s) as you make code changes.
67
+ | Option | Default | Purpose |
68
+ | --- | --- | --- |
69
+ | `--www` | `/` | Public website base URL exposed to templates and configuration. |
70
+ | `--cdn` | `/` | Asset base URL exposed to templates and configuration. |
71
+ | `--service` | `/service-endpoint` | Backend service URL exposed to the site. |
72
+ | `--version` | Current Unix timestamp | Directory name used for versioned assets. |
73
+ | `--production` | `false` | Minifies CSS and JavaScript when set to `true`. |
65
74
 
66
- Learn more about Browsersync here: https://www.browsersync.io
75
+ The version may contain only letters, numbers, dots, underscores, and hyphens. This prevents it from escaping the deployment directory.
67
76
 
68
- ### Deploy
77
+ ## Add a page
69
78
 
70
- This compiles and bundles everything into a deploy ready package outputted in the '\_deploy' directory.
79
+ Create `app/about.hbs`:
71
80
 
81
+ ```handlebars
82
+ {{> element/head}}
83
+ <main>
84
+ <h1>{{title}}</h1>
85
+ <p>{{introduction}}</p>
86
+ </main>
72
87
  ```
73
- gulp deploy --www=(www domain - required) --cdn=(cdn domain - required) --service=(service domain - required) --production=(true|false - optional) --version=(unique deploy version - optional);
88
+
89
+ Then create matching data at `app/assets/data/view/about.json`:
90
+
91
+ ```json
92
+ {
93
+ "title": "About us",
94
+ "introduction": "A short description of the organization."
95
+ }
74
96
  ```
75
97
 
76
- _The 'version' argument defaults to an epoch timestamp and the 'production' argument defaults to 'false'._
98
+ Global data from `app/assets/data/view/global.json`, page data, and build options are merged before the template is rendered. Page-specific values take precedence over global values, and build options take precedence over both.
77
99
 
78
- #### Example
100
+ ## Responsive images
79
101
 
80
- ```
81
- gulp deploy --www=//www.example.com --cdn=//cdn.example.com --service=//service.example.com --version=123456789 --production=true;
102
+ The included `picture` partial supports AVIF and WebP sources at each responsive breakpoint, with an ordinary image as the final fallback:
103
+
104
+ ```handlebars
105
+ {{> element/picture
106
+ imageFallback='assets/image/hero/fallback.jpg'
107
+ imageSmallAvif='assets/image/hero/small.avif'
108
+ imageSmallWebp='assets/image/hero/small.webp'
109
+ imageLargeAvif='assets/image/hero/large.avif'
110
+ imageLargeWebp='assets/image/hero/large.webp'
111
+ width='2048'
112
+ height='1600'
113
+ loading='lazy'
114
+ decoding='async'
115
+ alt='A human-readable description of the image'
116
+ }}
82
117
  ```
83
118
 
84
- ### Unit Tests
119
+ Browsers choose the first supported source whose media query matches. Browsers without AVIF or WebP support use `imageFallback`. Supplying width and height also reserves layout space and helps avoid content movement while the image loads.
85
120
 
86
- watch:
121
+ ## Development checks
87
122
 
88
- ```
89
- gulp unitWatch;
123
+ Run the same basic checks before proposing a change:
124
+
125
+ ```sh
126
+ npm run build
127
+ npm run typecheck
128
+ npm test
129
+ npm run coverage
130
+ npm run audit
90
131
  ```
91
132
 
92
- single run:
133
+ ## Version 4 migration notes
93
134
 
94
- ```
95
- gulp unit;
96
- ```
135
+ Version 4 intentionally replaced the unsupported Gulp 3, Babel 6, PhantomJS, Karma, Bower, and legacy plugin pipeline. It also replaced Foundation with Bootstrap 5.3.8 and migrated the grid markup to Bootstrap `row` and responsive `col-*` classes. Projects upgrading from an older major version should treat the build tooling, supported Node.js versions, CSS framework, and generated markup as breaking changes.
97
136
 
98
- ### More
137
+ Version 4.1 removes Lodash, Moment, and Numeral from generated projects. If application code added its own imports from those packages, either retain the dependency in that application or migrate those calls before upgrading.
99
138
 
100
- These in additional to other tasks run as dependencies of the 'watch' and 'deploy' tasks.
139
+ ## Related packages
101
140
 
102
- ```
103
- gulp markup;
104
- gulp style;
105
- gulp script;
106
- gulp accessibility;
107
- gulp documentation;
108
- ```
141
+ - [`white-label-model`](https://github.com/bshack/white-label-model) provides event-emitting models and collections.
142
+ - [`white-label-view`](https://github.com/bshack/white-label-view) renders templates and manages delegated DOM events.
143
+ - [`white-label-router`](https://github.com/bshack/white-label-router) provides History API navigation.
144
+ - [`white-label-mediator`](https://github.com/bshack/white-label-mediator) provides shared application messaging.
145
+ - [`white-label-service`](https://github.com/bshack/white-label-service) provides an authenticated JSON service backed by MySQL.
109
146
 
110
- ## Test If Your Project Will Build
147
+ ## TypeScript development and version 5.0.0 migration
111
148
 
112
- Run this when you want to verify your changes will build properly on the CI server before pushing:
149
+ Implementation code now uses strict TypeScript. Builds emit JavaScript, source maps with embedded source, and `.d.ts` declarations into `dist`. JavaScript callers can still use the package without compiling TypeScript themselves. JSDoc comments describe parameters, return values, lifecycle behavior, and validation at the implementation, and are retained in declarations.
113
150
 
114
- ```
115
- npm test;
151
+ ```ts
152
+ // app/assets/script/profile.ts
153
+ import User from './model/user.js';
154
+
155
+ const profile = new User({name: 'Ada'});
156
+ console.log(profile.get().name);
116
157
  ```
117
158
 
118
- ## NPM Shrinkwrap
159
+ Write implementation files as `.ts`, or `.tsx` for React markup. Keep `.js` extensions on relative imports: TypeScript resolves them to source files and emits imports usable by Node. Every top-level script entry is bundled, except declaration-only `.d.ts` files. The build checks all sample modules, including modules not imported by an entry point.
119
160
 
120
- This project uses npm shrinkwrap to freeze npm module versions for improved project stability. More information here: https://docs.npmjs.com/cli/shrinkwrap.
161
+ The generated project uses the current typed releases of `white-label-model` and `white-label-view`. The `types.d.ts` file declares only the optional SDK callbacks placed on `window`; package API types come directly from those dependencies.
121
162
 
122
- ## Using it with Yeoman
163
+ Version 5 is a major release because generated projects now contain TypeScript and use a two-stage TypeScript/esbuild pipeline. Use Node.js 24 for development and CI. Existing generated sites are not changed automatically: migrate their script files, copy the new build configuration, and resolve strict type errors before deploying. The small `generators/app/index.js` file is only Yeoman's discovery bridge to compiled TypeScript.
123
164
 
124
- Install as a node module:
165
+ The generated project includes its own README. Full Bootstrap CSS remains included. Old inactive Gulp and Karma configuration has been removed; all historical share-URL assertions now run in the active Node test suite.
125
166
 
126
- ```
127
- npm install generator-white-label -g;
128
- ```
167
+ ### Sample utility reference
129
168
 
130
- Then in an empty directory:
169
+ | Module | Functionality and example |
170
+ | --- | --- |
171
+ | `utility/ajax.ts` | `getScript('/sdk.js')` appends an asynchronous script; call it only when needed. |
172
+ | `utility/form.ts` | Read multiselect values, select or find an option, decorate/split metadata, and build named options: `buildOptions([{id: 1, name: 'Ada'}], 1)`. Metadata helpers mutate their supplied arrays. |
173
+ | `utility/string.ts` | Parse trusted HTML, read query values, format local dates, numbers and USD currency, and create phone/email links: `formatCurrency(12.5)` returns `$12.50`. `getQueryStringParamater` retains its historical spelling. |
174
+ | `utility/share.ts` | Construct encoded Facebook, Twitter, LinkedIn and email URLs. Missing required values return `false`. Twitter retains its legacy 140-character rule; Google Plus support is a deprecated URL formatter for a discontinued service. |
175
+ | `utility/regex.ts` | Legacy presentation-validation expressions for dates, passwords, phone numbers, ZIP codes, length and currency. These are not substitutes for server validation or a modern password policy. |
176
+ | `model/user.ts` | An extendable observable object model. Country/state singletons contain the bundled JSON data. The global model starts with local URL defaults; the build separately writes deployment settings to `assets/data/config.json`. |
177
+ | `api/facebook.ts`, `api/youtube.ts` | Optional SDK adapters that emit readiness events through the shared mediator. They are tested with local browser doubles, not live provider accounts. Review provider configuration before enabling them in a real site. |
178
+ | `view/default.tsx` | A React greeting component: `<HelloMessage name="Ada" />`. |
179
+ | `view/toolkit/youtube-player-1.ts` | An extension skeleton for a concrete player, with the legacy `removeListners` hook retained. |
131
180
 
181
+ ### Verification and coverage
182
+
183
+ ```sh
184
+ npm ci --ignore-scripts
185
+ npm run typecheck
186
+ npm test
187
+ npm run coverage
188
+ npm pack --dry-run
132
189
  ```
133
- yo white-label;
134
- ```
135
190
 
136
- Learn more about Yeoman here: https://yeoman.io
191
+ `npm test` builds the code, checks TypeScript consumer examples against the emitted declarations, and runs the tests. `npm run coverage` additionally enforces **100% statements, branches, functions, and lines for each implementation file**. Unexecuted implementation files count toward the result; declaration-only files contain no executable code and are excluded. Reports are written to `coverage`, including `lcov.info` for coverage viewers. CI runs the same gate and checks committed build output for drift.
192
+
193
+ Tests exercise the compiled JavaScript interface used by downstream callers. Coverage is an execution metric, not proof that all possible inputs or external integrations are correct. Tests for third-party SDKs use local doubles. No live provider requests are needed.
194
+
195
+ To undo this migration, revert its commit and run `npm ci` from the restored lockfile. No npm release, database migration, or production deployment is performed by these development changes.
package/app/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # Your white-label site
2
+
3
+ This site uses TypeScript for application code, Handlebars for pages, and Sass plus full Bootstrap CSS for styling.
4
+
5
+ ## Start developing
6
+
7
+ Use Node.js 24. Run `npm install`, then `npm run typecheck` and `npm run build`. The build output is `_deploy`; serve that directory with your preferred static server. `npm test` runs the generated site's build check. The generator repository has the broader unit and coverage suites; add application-specific tests as your site grows.
8
+
9
+ Edit `.ts` files under `app/assets/script`, and use `.tsx` for React components. Keep `.js` extensions in relative imports, for example `import User from './model/user.js'`. TypeScript resolves the source and emits valid JavaScript imports. Do not edit `dist`, which is generated by the compiler.
10
+
11
+ Pages live in `app/*.hbs`, partials in `app/assets/markup`, and page data in `app/assets/data/view`. Add shared styles in `app/assets/style`. The full Bootstrap stylesheet is included before the project styles.
12
+
13
+ ```sh
14
+ npm run build -- --version=release-1 --production=true
15
+ ```
16
+
17
+ Optional flags are `--www`, `--cdn`, and `--service`. Their defaults are `/`, `/`, and `/service-endpoint`. The version selects `_deploy/release/<version>/assets`; without a version, the current timestamp is used. Each build replaces `_deploy`.
18
+
19
+ Document new functions with JSDoc comments explaining behavior, parameters, return values, and meaningful errors. Keep strict type checking enabled. Templates accept trusted HTML, so validate or escape external content before rendering it. Optional SDK adapters need real provider configuration before use.
@@ -4,12 +4,8 @@
4
4
 
5
5
  @font-face {
6
6
  font-family: 'open_sansbold';
7
- src: url('../font/opensans/opensans-bold-webfont.eot');
8
- src: url('../font/opensans/opensans-bold-webfont.eot?#iefix') format('embedded-opentype'),
9
- url('../font/opensans/opensans-bold-webfont.woff2') format('woff2'),
10
- url('../font/opensans/opensans-bold-webfont.woff') format('woff'),
11
- url('../font/opensans/opensans-bold-webfont.ttf') format('truetype'),
12
- url('../font/opensans/opensans-bold-webfont.svg#open_sansbold') format('svg');
7
+ src: url('../font/opensans/opensans-bold-webfont.woff2') format('woff2');
8
+ font-display: swap;
13
9
  font-weight: normal;
14
10
  font-style: normal;
15
11
 
@@ -20,12 +16,8 @@
20
16
 
21
17
  @font-face {
22
18
  font-family: 'open_sansbold_italic';
23
- src: url('../font/opensans/opensans-bolditalic-webfont.eot');
24
- src: url('../font/opensans/opensans-bolditalic-webfont.eot?#iefix') format('embedded-opentype'),
25
- url('../font/opensans/opensans-bolditalic-webfont.woff2') format('woff2'),
26
- url('../font/opensans/opensans-bolditalic-webfont.woff') format('woff'),
27
- url('../font/opensans/opensans-bolditalic-webfont.ttf') format('truetype'),
28
- url('../font/opensans/opensans-bolditalic-webfont.svg#open_sansbold_italic') format('svg');
19
+ src: url('../font/opensans/opensans-bolditalic-webfont.woff2') format('woff2');
20
+ font-display: swap;
29
21
  font-weight: normal;
30
22
  font-style: normal;
31
23
 
@@ -36,12 +28,8 @@
36
28
 
37
29
  @font-face {
38
30
  font-family: 'open_sansextrabold';
39
- src: url('../font/opensans/opensans-extrabold-webfont.eot');
40
- src: url('../font/opensans/opensans-extrabold-webfont.eot?#iefix') format('embedded-opentype'),
41
- url('../font/opensans/opensans-extrabold-webfont.woff2') format('woff2'),
42
- url('../font/opensans/opensans-extrabold-webfont.woff') format('woff'),
43
- url('../font/opensans/opensans-extrabold-webfont.ttf') format('truetype'),
44
- url('../font/opensans/opensans-extrabold-webfont.svg#open_sansextrabold') format('svg');
31
+ src: url('../font/opensans/opensans-extrabold-webfont.woff2') format('woff2');
32
+ font-display: swap;
45
33
  font-weight: normal;
46
34
  font-style: normal;
47
35
 
@@ -52,12 +40,8 @@
52
40
 
53
41
  @font-face {
54
42
  font-family: 'open_sansextrabold_italic';
55
- src: url('../font/opensans/opensans-extrabolditalic-webfont.eot');
56
- src: url('../font/opensans/opensans-extrabolditalic-webfont.eot?#iefix') format('embedded-opentype'),
57
- url('../font/opensans/opensans-extrabolditalic-webfont.woff2') format('woff2'),
58
- url('../font/opensans/opensans-extrabolditalic-webfont.woff') format('woff'),
59
- url('../font/opensans/opensans-extrabolditalic-webfont.ttf') format('truetype'),
60
- url('../font/opensans/opensans-extrabolditalic-webfont.svg#open_sansextrabold_italic') format('svg');
43
+ src: url('../font/opensans/opensans-extrabolditalic-webfont.woff2') format('woff2');
44
+ font-display: swap;
61
45
  font-weight: normal;
62
46
  font-style: normal;
63
47
 
@@ -68,12 +52,8 @@
68
52
 
69
53
  @font-face {
70
54
  font-family: 'open_sansitalic';
71
- src: url('../font/opensans/opensans-italic-webfont.eot');
72
- src: url('../font/opensans/opensans-italic-webfont.eot?#iefix') format('embedded-opentype'),
73
- url('../font/opensans/opensans-italic-webfont.woff2') format('woff2'),
74
- url('../font/opensans/opensans-italic-webfont.woff') format('woff'),
75
- url('../font/opensans/opensans-italic-webfont.ttf') format('truetype'),
76
- url('../font/opensans/opensans-italic-webfont.svg#open_sansitalic') format('svg');
55
+ src: url('../font/opensans/opensans-italic-webfont.woff2') format('woff2');
56
+ font-display: swap;
77
57
  font-weight: normal;
78
58
  font-style: normal;
79
59
 
@@ -84,12 +64,8 @@
84
64
 
85
65
  @font-face {
86
66
  font-family: 'open_sanslight';
87
- src: url('../font/opensans/opensans-light-webfont.eot');
88
- src: url('../font/opensans/opensans-light-webfont.eot?#iefix') format('embedded-opentype'),
89
- url('../font/opensans/opensans-light-webfont.woff2') format('woff2'),
90
- url('../font/opensans/opensans-light-webfont.woff') format('woff'),
91
- url('../font/opensans/opensans-light-webfont.ttf') format('truetype'),
92
- url('../font/opensans/opensans-light-webfont.svg#open_sanslight') format('svg');
67
+ src: url('../font/opensans/opensans-light-webfont.woff2') format('woff2');
68
+ font-display: swap;
93
69
  font-weight: normal;
94
70
  font-style: normal;
95
71
 
@@ -100,12 +76,8 @@
100
76
 
101
77
  @font-face {
102
78
  font-family: 'open_sanslight_italic';
103
- src: url('../font/opensans/opensans-lightitalic-webfont.eot');
104
- src: url('../font/opensans/opensans-lightitalic-webfont.eot?#iefix') format('embedded-opentype'),
105
- url('../font/opensans/opensans-lightitalic-webfont.woff2') format('woff2'),
106
- url('../font/opensans/opensans-lightitalic-webfont.woff') format('woff'),
107
- url('../font/opensans/opensans-lightitalic-webfont.ttf') format('truetype'),
108
- url('../font/opensans/opensans-lightitalic-webfont.svg#open_sanslight_italic') format('svg');
79
+ src: url('../font/opensans/opensans-lightitalic-webfont.woff2') format('woff2');
80
+ font-display: swap;
109
81
  font-weight: normal;
110
82
  font-style: normal;
111
83
 
@@ -116,12 +88,8 @@
116
88
 
117
89
  @font-face {
118
90
  font-family: 'open_sansregular';
119
- src: url('../font/opensans/opensans-regular-webfont.eot');
120
- src: url('../font/opensans/opensans-regular-webfont.eot?#iefix') format('embedded-opentype'),
121
- url('../font/opensans/opensans-regular-webfont.woff2') format('woff2'),
122
- url('../font/opensans/opensans-regular-webfont.woff') format('woff'),
123
- url('../font/opensans/opensans-regular-webfont.ttf') format('truetype'),
124
- url('../font/opensans/opensans-regular-webfont.svg#open_sansregular') format('svg');
91
+ src: url('../font/opensans/opensans-regular-webfont.woff2') format('woff2');
92
+ font-display: swap;
125
93
  font-weight: normal;
126
94
  font-style: normal;
127
95
 
@@ -132,12 +100,8 @@
132
100
 
133
101
  @font-face {
134
102
  font-family: 'open_sanssemibold';
135
- src: url('../font/opensans/opensans-semibold-webfont.eot');
136
- src: url('../font/opensans/opensans-semibold-webfont.eot?#iefix') format('embedded-opentype'),
137
- url('../font/opensans/opensans-semibold-webfont.woff2') format('woff2'),
138
- url('../font/opensans/opensans-semibold-webfont.woff') format('woff'),
139
- url('../font/opensans/opensans-semibold-webfont.ttf') format('truetype'),
140
- url('../font/opensans/opensans-semibold-webfont.svg#open_sanssemibold') format('svg');
103
+ src: url('../font/opensans/opensans-semibold-webfont.woff2') format('woff2');
104
+ font-display: swap;
141
105
  font-weight: normal;
142
106
  font-style: normal;
143
107
 
@@ -148,12 +112,8 @@
148
112
 
149
113
  @font-face {
150
114
  font-family: 'open_sanssemibold_italic';
151
- src: url('../font/opensans/opensans-semibolditalic-webfont.eot');
152
- src: url('../font/opensans/opensans-semibolditalic-webfont.eot?#iefix') format('embedded-opentype'),
153
- url('../font/opensans/opensans-semibolditalic-webfont.woff2') format('woff2'),
154
- url('../font/opensans/opensans-semibolditalic-webfont.woff') format('woff'),
155
- url('../font/opensans/opensans-semibolditalic-webfont.ttf') format('truetype'),
156
- url('../font/opensans/opensans-semibolditalic-webfont.svg#open_sanssemibold_italic') format('svg');
115
+ src: url('../font/opensans/opensans-semibolditalic-webfont.woff2') format('woff2');
116
+ font-display: swap;
157
117
  font-weight: normal;
158
118
  font-style: normal;
159
119
 
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -14,4 +14,7 @@
14
14
  {{#if this.url}}
15
15
  src="{{this.url}}"
16
16
  {{/if}}
17
- ></iframe>
17
+ {{#if this.loading}}
18
+ loading="{{this.loading}}"
19
+ {{/if}}
20
+ ></iframe>
@@ -11,5 +11,20 @@
11
11
  {{#if this.image}}
12
12
  src="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.image}}"
13
13
  {{/if}}
14
+ {{#if this.width}}
15
+ width="{{this.width}}"
16
+ {{/if}}
17
+ {{#if this.height}}
18
+ height="{{this.height}}"
19
+ {{/if}}
20
+ {{#if this.loading}}
21
+ loading="{{this.loading}}"
22
+ {{/if}}
23
+ {{#if this.decoding}}
24
+ decoding="{{this.decoding}}"
25
+ {{/if}}
26
+ {{#if this.fetchpriority}}
27
+ fetchpriority="{{this.fetchpriority}}"
28
+ {{/if}}
14
29
  alt="{{#if this.alt}}{{this.alt}}{{/if}}"
15
- >
30
+ >
@@ -9,18 +9,48 @@
9
9
  {{/if}}
10
10
  alt="{{#if this.alt}}{{this.alt}}{{/if}}"
11
11
  >
12
+ {{#if this.imageSmallAvif}}
13
+ <source type="image/avif" media="(max-width: 40rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageSmallAvif}}">
14
+ {{/if}}
15
+ {{#if this.imageSmallWebp}}
16
+ <source type="image/webp" media="(max-width: 40rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageSmallWebp}}">
17
+ {{/if}}
12
18
  {{#if this.imageSmall}}
13
19
  <source media="(max-width: 40rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageSmall}}">
14
20
  {{/if}}
21
+ {{#if this.imageMediumAvif}}
22
+ <source type="image/avif" media="(max-width: 64rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageMediumAvif}}">
23
+ {{/if}}
24
+ {{#if this.imageMediumWebp}}
25
+ <source type="image/webp" media="(max-width: 64rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageMediumWebp}}">
26
+ {{/if}}
15
27
  {{#if this.imageMedium}}
16
28
  <source media="(max-width: 64rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageMedium}}">
17
29
  {{/if}}
30
+ {{#if this.imageLargeAvif}}
31
+ <source type="image/avif" media="(max-width: 75rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageLargeAvif}}">
32
+ {{/if}}
33
+ {{#if this.imageLargeWebp}}
34
+ <source type="image/webp" media="(max-width: 75rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageLargeWebp}}">
35
+ {{/if}}
18
36
  {{#if this.imageLarge}}
19
37
  <source media="(max-width: 75rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageLarge}}">
20
38
  {{/if}}
39
+ {{#if this.imageXLargeAvif}}
40
+ <source type="image/avif" media="(max-width: 90rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageXLargeAvif}}">
41
+ {{/if}}
42
+ {{#if this.imageXLargeWebp}}
43
+ <source type="image/webp" media="(max-width: 90rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageXLargeWebp}}">
44
+ {{/if}}
21
45
  {{#if this.imageXLarge}}
22
46
  <source media="(max-width: 90rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageXLarge}}">
23
47
  {{/if}}
48
+ {{#if this.imageXXLargeAvif}}
49
+ <source type="image/avif" media="(min-width: 90.001rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageXXLargeAvif}}">
50
+ {{/if}}
51
+ {{#if this.imageXXLargeWebp}}
52
+ <source type="image/webp" media="(min-width: 90.001rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageXXLargeWebp}}">
53
+ {{/if}}
24
54
  {{#if this.imageXXLarge}}
25
55
  <source media="(min-width: 90.001rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageXXLarge}}">
26
56
  {{/if}}
@@ -1,5 +1,5 @@
1
1
  <div class="row">
2
- <div class="small-12 columns">
2
+ <div class="col-12">
3
3
  <h1 id="modal-title">disclosures</h1>
4
4
  <h2 id="modal-description">Legal disclosures you accept to continue</h2>
5
5
  <p>disclosures content</p>
@@ -1,14 +1,16 @@
1
+ /** @module app/assets/script/api/facebook */
1
2
  import mediator from '../mediator/global.js';
2
- import modelGlobal from '../model/singletons/global';
3
- import UtilityAjax from '../utility/ajax';
3
+ import modelGlobal from '../model/singletons/global.js';
4
4
 
5
- const utilityAjax = new UtilityAjax();
6
-
7
- (() => {
8
- 'use strict';
9
- module.exports = class {
10
- initialize(url) {
11
- window.fbAsyncInit = function(e) {
5
+ 'use strict';
6
+ export default class {
7
+ /**
8
+ * Load the optional SDK and emit a mediator notification from its readiness callback.
9
+ * @param url - URL or optional adapter argument.
10
+ * @returns No value.
11
+ */
12
+ initialize(url?: string) {
13
+ window.fbAsyncInit = function(e?: Event) {
12
14
  window.FB.init({
13
15
  appId: modelGlobal.get().appId || null,
14
16
  autoLogAppEvents: true,
@@ -26,11 +28,14 @@ const utilityAjax = new UtilityAjax();
26
28
  if (d.getElementById(id)) {
27
29
  return;
28
30
  }
29
- js = d.createElement(s);
31
+ js = d.createElement('script');
30
32
  js.id = id;
31
33
  js.src = '//connect.facebook.net/en_US/sdk.js';
32
- fjs.parentNode.insertBefore(js, fjs);
34
+ if (fjs?.parentNode) {
35
+ fjs.parentNode.insertBefore(js, fjs);
36
+ } else {
37
+ d.head.appendChild(js);
38
+ }
33
39
  }(document, 'script', 'facebook-jssdk'));
34
40
  }
35
41
  };
36
- })();
@@ -0,0 +1,22 @@
1
+ /** @module app/assets/script/api/youtube */
2
+ import mediator from '../mediator/global.js';
3
+ import UtilityAjax from '../utility/ajax.js';
4
+
5
+ const utilityAjax = new UtilityAjax();
6
+
7
+ 'use strict';
8
+ export default class {
9
+ /**
10
+ * Load the optional SDK and emit a mediator notification from its readiness callback.
11
+ * @param url - URL or optional adapter argument.
12
+ * @returns No value.
13
+ */
14
+ initialize(url?: string) {
15
+ utilityAjax.getScript('//www.youtube.com/iframe_api');
16
+ window.onYouTubeIframeAPIReady = (e?: Event) => {
17
+ mediator.emit('youtube-api-1:state:ready', {
18
+ event: e
19
+ });
20
+ }
21
+ }
22
+ };
@@ -0,0 +1,2 @@
1
+ /** @module app/assets/script/index */
2
+ export {};
@@ -0,0 +1,4 @@
1
+ /** @module app/assets/script/mediator/global */
2
+ import Events from 'events';
3
+
4
+ export default new Events();
@@ -0,0 +1,5 @@
1
+ /** @module app/assets/script/model/singletons/countries */
2
+ import WLModel from 'white-label-model';
3
+ import data from '../../../data/coutries.json' with {type: 'json'};
4
+
5
+ export default new WLModel.Collection(data);