@qhealth-design-system/core 1.0.38
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/.babelrc +15 -0
- package/.browserslistrc +5 -0
- package/.editorconfig +19 -0
- package/.eslintignore +1 -0
- package/.eslintrc +25 -0
- package/.gitattributes +2 -0
- package/.github/workflows/release_package.yml +103 -0
- package/CHANGELOG.md +14 -0
- package/README.md +534 -0
- package/dist/api/service_finder/schemas.json +1 -0
- package/dist/component-abstract.html +884 -0
- package/dist/component-accordion.html +1157 -0
- package/dist/component-banner.html +928 -0
- package/dist/component-banner_advanced.html +1524 -0
- package/dist/component-banner_basic.html +1189 -0
- package/dist/component-banner_intermediate.html +1288 -0
- package/dist/component-body.html +919 -0
- package/dist/component-breadcrumbs.html +881 -0
- package/dist/component-btn.html +829 -0
- package/dist/component-callout.html +964 -0
- package/dist/component-card_feature.html +1805 -0
- package/dist/component-card_multi_action.html +1965 -0
- package/dist/component-card_no_action.html +1632 -0
- package/dist/component-card_single_action.html +1772 -0
- package/dist/component-code.html +928 -0
- package/dist/component-footer.html +1131 -0
- package/dist/component-forms.html +1297 -0
- package/dist/component-global-elements.html +1243 -0
- package/dist/component-global_alert.html +891 -0
- package/dist/component-header.html +1155 -0
- package/dist/component-in_page_navigation.html +920 -0
- package/dist/component-internal_navigation.html +1097 -0
- package/dist/component-left_hand_navigation.html +995 -0
- package/dist/component-main_navigation.html +999 -0
- package/dist/component-mega_main_navigation.html +1145 -0
- package/dist/component-multi_column.html +1116 -0
- package/dist/component-page_alert.html +911 -0
- package/dist/component-pagination.html +971 -0
- package/dist/component-tag_list.html +979 -0
- package/dist/component-updated_date.html +778 -0
- package/dist/component-widgets.html +851 -0
- package/dist/components/_global/import.xml +95 -0
- package/dist/components/_global/manifest.json +11 -0
- package/dist/components/_global/presentation.js +50 -0
- package/dist/components/_global/static.html +30 -0
- package/dist/components/_template/import.xml +299 -0
- package/dist/components/_template/manifest.json +40 -0
- package/dist/components/_template/presentation.js +12 -0
- package/dist/components/_template/static.html +4 -0
- package/dist/components/abstract/import.xml +231 -0
- package/dist/components/abstract/manifest.json +29 -0
- package/dist/components/abstract/presentation.js +33 -0
- package/dist/components/abstract/static.html +9 -0
- package/dist/components/accordion/import.xml +1929 -0
- package/dist/components/accordion/manifest.json +427 -0
- package/dist/components/accordion/presentation.js +112 -0
- package/dist/components/accordion/static.html +56 -0
- package/dist/components/banner/import.xml +95 -0
- package/dist/components/banner/manifest.json +11 -0
- package/dist/components/banner/presentation.js +138 -0
- package/dist/components/banner/static.html +39 -0
- package/dist/components/banner_advanced/import.xml +1969 -0
- package/dist/components/banner_advanced/manifest.json +1450 -0
- package/dist/components/banner_advanced/presentation.js +564 -0
- package/dist/components/banner_advanced/static.html +159 -0
- package/dist/components/banner_basic/import.xml +907 -0
- package/dist/components/banner_basic/manifest.json +151 -0
- package/dist/components/banner_basic/presentation.js +325 -0
- package/dist/components/banner_basic/static.html +86 -0
- package/dist/components/banner_intermediate/import.xml +1473 -0
- package/dist/components/banner_intermediate/manifest.json +248 -0
- package/dist/components/banner_intermediate/presentation.js +410 -0
- package/dist/components/banner_intermediate/static.html +102 -0
- package/dist/components/body/import.xml +343 -0
- package/dist/components/body/manifest.json +46 -0
- package/dist/components/body/presentation.js +37 -0
- package/dist/components/body/static.html +5 -0
- package/dist/components/breadcrumbs/import.xml +95 -0
- package/dist/components/breadcrumbs/manifest.json +9 -0
- package/dist/components/breadcrumbs/presentation.js +99 -0
- package/dist/components/breadcrumbs/static.html +21 -0
- package/dist/components/callout/import.xml +953 -0
- package/dist/components/callout/manifest.json +121 -0
- package/dist/components/callout/presentation.js +103 -0
- package/dist/components/callout/static.html +10 -0
- package/dist/components/card_feature/import.xml +2355 -0
- package/dist/components/card_feature/manifest.json +1390 -0
- package/dist/components/card_feature/presentation.js +365 -0
- package/dist/components/card_feature/static.html +80 -0
- package/dist/components/card_multi_action/import.xml +1539 -0
- package/dist/components/card_multi_action/manifest.json +1314 -0
- package/dist/components/card_multi_action/presentation.js +638 -0
- package/dist/components/card_multi_action/static.html +120 -0
- package/dist/components/card_no_action/import.xml +1449 -0
- package/dist/components/card_no_action/manifest.json +1264 -0
- package/dist/components/card_no_action/presentation.js +454 -0
- package/dist/components/card_no_action/static.html +94 -0
- package/dist/components/card_single_action/import.xml +1539 -0
- package/dist/components/card_single_action/manifest.json +1273 -0
- package/dist/components/card_single_action/presentation.js +498 -0
- package/dist/components/card_single_action/static.html +103 -0
- package/dist/components/code/import.xml +569 -0
- package/dist/components/code/manifest.json +112 -0
- package/dist/components/code/presentation.js +124 -0
- package/dist/components/code/static.html +15 -0
- package/dist/components/footer/import.xml +95 -0
- package/dist/components/footer/manifest.json +9 -0
- package/dist/components/footer/presentation.js +409 -0
- package/dist/components/footer/static.html +146 -0
- package/dist/components/global_alert/import.xml +95 -0
- package/dist/components/global_alert/manifest.json +9 -0
- package/dist/components/global_alert/presentation.js +81 -0
- package/dist/components/global_alert/static.html +26 -0
- package/dist/components/header/import.xml +95 -0
- package/dist/components/header/manifest.json +11 -0
- package/dist/components/header/presentation.js +190 -0
- package/dist/components/header/static.html +158 -0
- package/dist/components/horizontal_rule/import.xml +547 -0
- package/dist/components/horizontal_rule/manifest.json +69 -0
- package/dist/components/horizontal_rule/presentation.js +50 -0
- package/dist/components/horizontal_rule/static.html +4 -0
- package/dist/components/in_page_navigation/import.xml +253 -0
- package/dist/components/in_page_navigation/manifest.json +35 -0
- package/dist/components/in_page_navigation/presentation.js +14 -0
- package/dist/components/in_page_navigation/static.html +13 -0
- package/dist/components/internal_navigation/import.xml +95 -0
- package/dist/components/internal_navigation/manifest.json +11 -0
- package/dist/components/internal_navigation/presentation.js +165 -0
- package/dist/components/internal_navigation/static.html +130 -0
- package/dist/components/left_hand_navigation/import.xml +299 -0
- package/dist/components/left_hand_navigation/manifest.json +40 -0
- package/dist/components/left_hand_navigation/presentation.js +178 -0
- package/dist/components/left_hand_navigation/static.html +64 -0
- package/dist/components/main_navigation/import.xml +95 -0
- package/dist/components/main_navigation/manifest.json +11 -0
- package/dist/components/main_navigation/presentation.js +150 -0
- package/dist/components/main_navigation/static.html +80 -0
- package/dist/components/mega_main_navigation/import.xml +95 -0
- package/dist/components/mega_main_navigation/manifest.json +9 -0
- package/dist/components/mega_main_navigation/presentation.js +380 -0
- package/dist/components/mega_main_navigation/static.html +153 -0
- package/dist/components/multi_column/import.xml +1631 -0
- package/dist/components/multi_column/manifest.json +233 -0
- package/dist/components/multi_column/presentation.js +249 -0
- package/dist/components/multi_column/static.html +36 -0
- package/dist/components/page_alert/import.xml +479 -0
- package/dist/components/page_alert/manifest.json +63 -0
- package/dist/components/page_alert/presentation.js +67 -0
- package/dist/components/page_alert/static.html +8 -0
- package/dist/components/pagination/import.xml +95 -0
- package/dist/components/pagination/manifest.json +42 -0
- package/dist/components/pagination/presentation.js +84 -0
- package/dist/components/pagination/static.html +5 -0
- package/dist/components/updated_date/import.xml +95 -0
- package/dist/components/updated_date/manifest.json +9 -0
- package/dist/components/updated_date/presentation.js +34 -0
- package/dist/components/updated_date/static.html +6 -0
- package/dist/components/widgets/import.xml +95 -0
- package/dist/components/widgets/manifest.json +9 -0
- package/dist/components/widgets/presentation.js +40 -0
- package/dist/components/widgets/static.html +0 -0
- package/dist/components.html +790 -0
- package/dist/externals/componentPreview.js +101 -0
- package/dist/externals/dsComponentLoader.js +410 -0
- package/dist/externals/esri-leaflet-vector.js +5 -0
- package/dist/externals/esri-leaflet.js +12 -0
- package/dist/externals/fb-handlebars.min.js +29 -0
- package/dist/externals/fb-typeahead.bundle.min.js +6 -0
- package/dist/externals/funnelback.autocompletion-2.6.0.js +678 -0
- package/dist/externals/getPagination.js +62 -0
- package/dist/externals/handlebars.min-v4.7.6.js +29 -0
- package/dist/externals/leaflet.js +6 -0
- package/dist/externals/populateDatastoreSim.js +381 -0
- package/dist/externals/tinymce_classes.css +62 -0
- package/dist/home.html +694 -0
- package/dist/index.html +710 -0
- package/dist/inner-with-nav.html +1853 -0
- package/dist/inner.html +671 -0
- package/dist/js/helpers.js +892 -0
- package/dist/js/main.js +55 -0
- package/dist/js/main.js.map +1 -0
- package/dist/js/runtime.js +2 -0
- package/dist/js/runtime.js.map +1 -0
- package/dist/main.css +918 -0
- package/dist/main.css.map +1 -0
- package/dist/mysource_files/ajax-loader.gif +0 -0
- package/dist/mysource_files/favicons/favicon.ico +0 -0
- package/dist/mysource_files/img/100x100.jpg +0 -0
- package/dist/mysource_files/img/600x260.jpg +0 -0
- package/dist/mysource_files/img/Heart-Pattern-Dark.png +0 -0
- package/dist/mysource_files/img/Heart-Pattern.png +0 -0
- package/dist/mysource_files/img/banner-background--desktop.png +0 -0
- package/dist/mysource_files/img/banner-background--mobile.png +0 -0
- package/dist/mysource_files/img/banner-bg.png +0 -0
- package/dist/mysource_files/img/banner.png +0 -0
- package/dist/mysource_files/img/card--brand.png +0 -0
- package/dist/mysource_files/img/card--components.png +0 -0
- package/dist/mysource_files/img/card--content.png +0 -0
- package/dist/mysource_files/img/header-logo-agov.png +0 -0
- package/dist/mysource_files/img/header-logo-qgov--dark.svg +63 -0
- package/dist/mysource_files/img/header-logo-qgov--light.svg +56 -0
- package/dist/mysource_files/img/header-logo-qgov--pre-dark.svg +56 -0
- package/dist/mysource_files/img/header-search.svg +3 -0
- package/dist/mysource_files/img/layers-2x.png +0 -0
- package/dist/mysource_files/img/layers.png +0 -0
- package/dist/mysource_files/img/marker-icon.png +0 -0
- package/dist/mysource_files/img/svg-icons.svg +155 -0
- package/dist/mysource_files/img/video-play.svg +3 -0
- package/dist/mysource_files/slick.eot +0 -0
- package/dist/mysource_files/slick.svg +14 -0
- package/dist/mysource_files/slick.ttf +0 -0
- package/dist/mysource_files/slick.woff +0 -0
- package/package-lock.json +14276 -0
- package/package.json +79 -0
- package/scripts/add_component.sh +109 -0
- package/src/assets/favicons/favicon.ico +0 -0
- package/src/assets/img/100x100.jpg +0 -0
- package/src/assets/img/600x260.jpg +0 -0
- package/src/assets/img/Heart-Pattern-Dark.png +0 -0
- package/src/assets/img/Heart-Pattern.png +0 -0
- package/src/assets/img/banner-background--desktop.png +0 -0
- package/src/assets/img/banner-background--mobile.png +0 -0
- package/src/assets/img/banner-bg.png +0 -0
- package/src/assets/img/banner.png +0 -0
- package/src/assets/img/card--brand.png +0 -0
- package/src/assets/img/card--components.png +0 -0
- package/src/assets/img/card--content.png +0 -0
- package/src/assets/img/header-logo-agov.png +0 -0
- package/src/assets/img/header-logo-qgov--dark.svg +63 -0
- package/src/assets/img/header-logo-qgov--light.svg +56 -0
- package/src/assets/img/header-logo-qgov--pre-dark.svg +56 -0
- package/src/assets/img/header-search.svg +3 -0
- package/src/assets/img/layers-2x.png +0 -0
- package/src/assets/img/layers.png +0 -0
- package/src/assets/img/marker-icon.png +0 -0
- package/src/assets/img/svg-icons.svg +155 -0
- package/src/assets/img/video-play.svg +3 -0
- package/src/components/_global/css/admin/component.scss +71 -0
- package/src/components/_global/css/body/component.scss +897 -0
- package/src/components/_global/css/btn/component.scss +564 -0
- package/src/components/_global/css/cta_links/component.scss +121 -0
- package/src/components/_global/css/direction_links/component.scss +196 -0
- package/src/components/_global/css/example/component.scss +54 -0
- package/src/components/_global/css/forms/control_inputs/component.scss +349 -0
- package/src/components/_global/css/forms/general/component.scss +298 -0
- package/src/components/_global/css/forms/select/component.scss +230 -0
- package/src/components/_global/css/forms/text/component.scss +402 -0
- package/src/components/_global/css/global.scss +42 -0
- package/src/components/_global/css/grid-12/component.scss +331 -0
- package/src/components/_global/css/headings/component.scss +172 -0
- package/src/components/_global/css/icons/component.scss +29 -0
- package/src/components/_global/css/link_columns/component.scss +194 -0
- package/src/components/_global/css/link_list/component.scss +37 -0
- package/src/components/_global/css/modal/component.scss +182 -0
- package/src/components/_global/css/slick/component.scss +25 -0
- package/src/components/_global/css/table/component.scss +211 -0
- package/src/components/_global/css/tabs/component.scss +43 -0
- package/src/components/_global/css/tags/component.scss +272 -0
- package/src/components/_global/css/user_location/component.scss +38 -0
- package/src/components/_global/css/version/component.scss +47 -0
- package/src/components/_global/html/component.hbs +108 -0
- package/src/components/_global/html/ds_component.hbs +30 -0
- package/src/components/_global/html/head.html +63 -0
- package/src/components/_global/html/scripts.html +58 -0
- package/src/components/_global/js/_polyfills/global.js +18 -0
- package/src/components/_global/js/animate/global.js +324 -0
- package/src/components/_global/js/forms/global.js +182 -0
- package/src/components/_global/js/global.js +302 -0
- package/src/components/_global/js/manifest.json +11 -0
- package/src/components/_global/js/modal/global.js +236 -0
- package/src/components/_global/js/slick/global.js +153 -0
- package/src/components/_global/js/tabs/global.js +305 -0
- package/src/components/_global/js/user_location/global.js +116 -0
- package/src/components/_template/css/component.scss +22 -0
- package/src/components/_template/html/component-page.html +85 -0
- package/src/components/_template/html/component.hbs +4 -0
- package/src/components/_template/js/global.js +6 -0
- package/src/components/_template/js/manifest.json +40 -0
- package/src/components/abstract/css/component.scss +91 -0
- package/src/components/abstract/html/component.hbs +9 -0
- package/src/components/abstract/js/manifest.json +29 -0
- package/src/components/accordion/css/component.scss +329 -0
- package/src/components/accordion/html/accordion-group.html +157 -0
- package/src/components/accordion/html/component.hbs +46 -0
- package/src/components/accordion/html/default.html +92 -0
- package/src/components/accordion/js/global.js +413 -0
- package/src/components/accordion/js/manifest.json +427 -0
- package/src/components/banner/css/component.scss +664 -0
- package/src/components/banner/html/component.hbs +52 -0
- package/src/components/banner/js/manifest.json +11 -0
- package/src/components/banner_advanced/css/component.scss +7 -0
- package/src/components/banner_advanced/html/component.hbs +213 -0
- package/src/components/banner_advanced/js/global.js +6 -0
- package/src/components/banner_advanced/js/manifest.json +1450 -0
- package/src/components/banner_basic/css/component.scss +52 -0
- package/src/components/banner_basic/html/component.hbs +130 -0
- package/src/components/banner_basic/js/global.js +6 -0
- package/src/components/banner_basic/js/manifest.json +151 -0
- package/src/components/banner_intermediate/css/component.scss +276 -0
- package/src/components/banner_intermediate/html/component.hbs +165 -0
- package/src/components/banner_intermediate/js/global.js +6 -0
- package/src/components/banner_intermediate/js/manifest.json +248 -0
- package/src/components/body/css/component.scss +16 -0
- package/src/components/body/html/component.hbs +5 -0
- package/src/components/body/js/manifest.json +46 -0
- package/src/components/breadcrumbs/css/component.scss +236 -0
- package/src/components/breadcrumbs/html/component.hbs +29 -0
- package/src/components/breadcrumbs/js/manifest.json +9 -0
- package/src/components/callout/css/component.scss +146 -0
- package/src/components/callout/html/component.hbs +28 -0
- package/src/components/callout/js/manifest.json +121 -0
- package/src/components/card_feature/css/component.scss +224 -0
- package/src/components/card_feature/html/component.hbs +129 -0
- package/src/components/card_feature/js/manifest.json +1390 -0
- package/src/components/card_multi_action/css/component.scss +229 -0
- package/src/components/card_multi_action/html/component.hbs +192 -0
- package/src/components/card_multi_action/js/manifest.json +1314 -0
- package/src/components/card_no_action/css/component.scss +551 -0
- package/src/components/card_no_action/html/component.hbs +127 -0
- package/src/components/card_no_action/js/global.js +6 -0
- package/src/components/card_no_action/js/manifest.json +1264 -0
- package/src/components/card_single_action/css/component.scss +164 -0
- package/src/components/card_single_action/html/component.hbs +161 -0
- package/src/components/card_single_action/js/manifest.json +1273 -0
- package/src/components/code/css/component.scss +355 -0
- package/src/components/code/html/component.hbs +84 -0
- package/src/components/code/js/global.js +160 -0
- package/src/components/code/js/manifest.json +112 -0
- package/src/components/footer/css/component.scss +437 -0
- package/src/components/footer/html/component.hbs +177 -0
- package/src/components/footer/js/manifest.json +9 -0
- package/src/components/global_alert/css/component.scss +169 -0
- package/src/components/global_alert/html/component.hbs +38 -0
- package/src/components/global_alert/js/global.js +39 -0
- package/src/components/global_alert/js/manifest.json +9 -0
- package/src/components/header/css/component.scss +697 -0
- package/src/components/header/html/component.hbs +186 -0
- package/src/components/header/js/global.js +188 -0
- package/src/components/header/js/manifest.json +11 -0
- package/src/components/horizontal_rule/css/component.scss +37 -0
- package/src/components/horizontal_rule/html/component.hbs +6 -0
- package/src/components/horizontal_rule/js/manifest.json +69 -0
- package/src/components/in_page_navigation/css/component.scss +54 -0
- package/src/components/in_page_navigation/html/component.hbs +17 -0
- package/src/components/in_page_navigation/js/global.js +51 -0
- package/src/components/in_page_navigation/js/manifest.json +35 -0
- package/src/components/internal_navigation/css/component.scss +437 -0
- package/src/components/internal_navigation/html/component.hbs +57 -0
- package/src/components/internal_navigation/js/manifest.json +11 -0
- package/src/components/left_hand_navigation/css/component.scss +280 -0
- package/src/components/left_hand_navigation/html/component.hbs +77 -0
- package/src/components/left_hand_navigation/js/global.js +36 -0
- package/src/components/left_hand_navigation/js/manifest.json +40 -0
- package/src/components/main_navigation/css/component.scss +706 -0
- package/src/components/main_navigation/html/component.hbs +87 -0
- package/src/components/main_navigation/js/global.js +373 -0
- package/src/components/main_navigation/js/manifest.json +11 -0
- package/src/components/mega_main_navigation/css/component.scss +535 -0
- package/src/components/mega_main_navigation/html/component.hbs +157 -0
- package/src/components/mega_main_navigation/js/global.js +170 -0
- package/src/components/mega_main_navigation/js/manifest.json +9 -0
- package/src/components/multi_column/css/component.scss +11 -0
- package/src/components/multi_column/html/component.hbs +98 -0
- package/src/components/multi_column/js/manifest.json +233 -0
- package/src/components/page_alert/css/component.scss +132 -0
- package/src/components/page_alert/html/component.hbs +26 -0
- package/src/components/page_alert/js/manifest.json +63 -0
- package/src/components/pagination/css/component.scss +196 -0
- package/src/components/pagination/html/component.hbs +41 -0
- package/src/components/pagination/html/default.html +30 -0
- package/src/components/pagination/js/manifest.json +42 -0
- package/src/components/search_box/css/component.scss +48 -0
- package/src/components/search_box/html/component.html +11 -0
- package/src/components/search_box/js/manifest.json +73 -0
- package/src/components/updated_date/css/component.scss +0 -0
- package/src/components/updated_date/html/component.hbs +31 -0
- package/src/components/updated_date/js/manifest.json +9 -0
- package/src/components/widgets/css/component.scss +82 -0
- package/src/components/widgets/html/component.hbs +19 -0
- package/src/components/widgets/html/default.html +4 -0
- package/src/components/widgets/js/current.json +483 -0
- package/src/components/widgets/js/manifest.json +9 -0
- package/src/components/widgets/js/site.json +358 -0
- package/src/data/current.json +522 -0
- package/src/data/current_admin.json +305 -0
- package/src/data/model_component.js +14 -0
- package/src/data/site.json +762 -0
- package/src/externals/componentPreview.js +101 -0
- package/src/externals/dsComponentLoader.js +410 -0
- package/src/externals/esri-leaflet-vector.js +5 -0
- package/src/externals/esri-leaflet.js +12 -0
- package/src/externals/fb-handlebars.min.js +29 -0
- package/src/externals/fb-typeahead.bundle.min.js +6 -0
- package/src/externals/funnelback.autocompletion-2.6.0.js +678 -0
- package/src/externals/getPagination.js +62 -0
- package/src/externals/handlebars.min-v4.7.6.js +29 -0
- package/src/externals/leaflet.js +6 -0
- package/src/externals/populateDatastoreSim.js +381 -0
- package/src/externals/tinymce_classes.css +62 -0
- package/src/helpers/Handlebars/appendIf.js +6 -0
- package/src/helpers/Handlebars/arrayLength.js +3 -0
- package/src/helpers/Handlebars/arrayWith.js +13 -0
- package/src/helpers/Handlebars/capitaliseFirst.js +8 -0
- package/src/helpers/Handlebars/charMax.js +8 -0
- package/src/helpers/Handlebars/checkIf.js +20 -0
- package/src/helpers/Handlebars/columnWidth.js +39 -0
- package/src/helpers/Handlebars/contains.js +7 -0
- package/src/helpers/Handlebars/createMap.js +19 -0
- package/src/helpers/Handlebars/dsMapFromID.js +8 -0
- package/src/helpers/Handlebars/dsMapFromProp.js +8 -0
- package/src/helpers/Handlebars/eachByName.js +18 -0
- package/src/helpers/Handlebars/eachDS.js +7 -0
- package/src/helpers/Handlebars/eachFrom.js +13 -0
- package/src/helpers/Handlebars/eachUpTo.js +8 -0
- package/src/helpers/Handlebars/eachWhen.js +33 -0
- package/src/helpers/Handlebars/formatDate.js +62 -0
- package/src/helpers/Handlebars/generateDates.js +74 -0
- package/src/helpers/Handlebars/getDistance.js +40 -0
- package/src/helpers/Handlebars/getObject.js +3 -0
- package/src/helpers/Handlebars/getParamaterByName.js +11 -0
- package/src/helpers/Handlebars/getPossibleValues.js +13 -0
- package/src/helpers/Handlebars/getProp.js +3 -0
- package/src/helpers/Handlebars/getTags.js +20 -0
- package/src/helpers/Handlebars/getTitle.js +4 -0
- package/src/helpers/Handlebars/ifAny.js +9 -0
- package/src/helpers/Handlebars/ifArray.js +3 -0
- package/src/helpers/Handlebars/ifCond.js +31 -0
- package/src/helpers/Handlebars/ifEqualsOrChained.js +12 -0
- package/src/helpers/Handlebars/ifProp.js +3 -0
- package/src/helpers/Handlebars/if_eq.js +9 -0
- package/src/helpers/Handlebars/inArray.js +8 -0
- package/src/helpers/Handlebars/isPage.js +7 -0
- package/src/helpers/Handlebars/itemAt.js +11 -0
- package/src/helpers/Handlebars/jsonParse.js +8 -0
- package/src/helpers/Handlebars/jsonStringify.js +3 -0
- package/src/helpers/Handlebars/listAZ.js +51 -0
- package/src/helpers/Handlebars/listAZOptions.js +34 -0
- package/src/helpers/Handlebars/listByClosest.js +60 -0
- package/src/helpers/Handlebars/listByClosestWithOffset.js +63 -0
- package/src/helpers/Handlebars/math.js +11 -0
- package/src/helpers/Handlebars/newLineToBreak.js +6 -0
- package/src/helpers/Handlebars/nonBreakingSpaces.js +6 -0
- package/src/helpers/Handlebars/objectFromSelect.js +21 -0
- package/src/helpers/Handlebars/partialReplace.js +9 -0
- package/src/helpers/Handlebars/printAccordion.js +24 -0
- package/src/helpers/Handlebars/replace.js +8 -0
- package/src/helpers/Handlebars/replaceMany.js +5 -0
- package/src/helpers/Handlebars/sizeFormat.js +11 -0
- package/src/helpers/Handlebars/split.js +6 -0
- package/src/helpers/Handlebars/toUpperCase.js +7 -0
- package/src/helpers/Handlebars/urldecode.js +3 -0
- package/src/helpers/Handlebars/urlencode.js +3 -0
- package/src/helpers/Handlebars/withinObject.js +13 -0
- package/src/html/component-abstract.html +86 -0
- package/src/html/component-accordion.html +87 -0
- package/src/html/component-banner.html +84 -0
- package/src/html/component-banner_advanced.html +97 -0
- package/src/html/component-banner_basic.html +163 -0
- package/src/html/component-banner_intermediate.html +91 -0
- package/src/html/component-body.html +116 -0
- package/src/html/component-breadcrumbs.html +88 -0
- package/src/html/component-btn.html +117 -0
- package/src/html/component-callout.html +86 -0
- package/src/html/component-card_feature.html +631 -0
- package/src/html/component-card_multi_action.html +793 -0
- package/src/html/component-card_no_action.html +521 -0
- package/src/html/component-card_single_action.html +631 -0
- package/src/html/component-code.html +84 -0
- package/src/html/component-footer.html +87 -0
- package/src/html/component-forms.html +585 -0
- package/src/html/component-global-elements.html +531 -0
- package/src/html/component-global_alert.html +87 -0
- package/src/html/component-header.html +88 -0
- package/src/html/component-in_page_navigation.html +109 -0
- package/src/html/component-internal_navigation.html +87 -0
- package/src/html/component-left_hand_navigation.html +85 -0
- package/src/html/component-main_navigation.html +87 -0
- package/src/html/component-mega_main_navigation.html +88 -0
- package/src/html/component-multi_column.html +86 -0
- package/src/html/component-page_alert.html +86 -0
- package/src/html/component-pagination.html +86 -0
- package/src/html/component-tag_list.html +340 -0
- package/src/html/component-updated_date.html +88 -0
- package/src/html/component-widgets.html +90 -0
- package/src/html/components.html +136 -0
- package/src/html/home.html +126 -0
- package/src/html/index.html +142 -0
- package/src/html/inner-with-nav.html +1126 -0
- package/src/html/inner.html +107 -0
- package/src/index.js +12 -0
- package/src/styles/global.scss +120 -0
- package/src/styles/imports/figma.scss +0 -0
- package/src/styles/imports/functions.scss +519 -0
- package/src/styles/imports/mixins.scss +658 -0
- package/src/styles/imports/placeholders.scss +68 -0
- package/src/styles/imports/utilities.scss +185 -0
- package/src/styles/imports/variables.scss +484 -0
- package/src/styles/postcss.config.js +4 -0
- package/webpack/JsonMergePlugin.js +35 -0
- package/webpack/PrecompilePlugin.js +369 -0
- package/webpack/webpack.common.js +151 -0
- package/webpack/webpack.dev.js +54 -0
- package/webpack/webpack.prod.js +70 -0
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
const glob = require('glob');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const Handlebars = require("handlebars");
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const { logger } = require('handlebars');
|
|
6
|
+
const jsDir = `./dist/js`;
|
|
7
|
+
|
|
8
|
+
// A JavaScript class.
|
|
9
|
+
class PrecompilePlugin {
|
|
10
|
+
constructor(options = {}) {
|
|
11
|
+
this.options = options;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
apply(compiler) {
|
|
15
|
+
const outputPath = this.options.output.endsWith('/') ? this.options.output.slice(0, -1) : this.options.output;
|
|
16
|
+
const hbsTemplates = glob.sync(this.options.input);
|
|
17
|
+
const hbsHelpers = glob.sync(this.options.helpersInput);
|
|
18
|
+
|
|
19
|
+
let hbsHelpersFile = '';
|
|
20
|
+
|
|
21
|
+
// For each of the handlebars helpers files
|
|
22
|
+
hbsHelpers.forEach((helperPath) => {
|
|
23
|
+
|
|
24
|
+
// Get the name of the helper from the file name
|
|
25
|
+
const helperName = helperPath.split('/')[4].split('.')[0];
|
|
26
|
+
|
|
27
|
+
// Import the function from the file, and get the correct reference for the JS file
|
|
28
|
+
let module = require(helperPath.replace('./src', '../src'));
|
|
29
|
+
|
|
30
|
+
// register the helper using the helper name and the imported function
|
|
31
|
+
Handlebars.registerHelper(helperName, module);
|
|
32
|
+
|
|
33
|
+
let registerFunction = `Handlebars.registerHelper('${helperName}', ${module.toString()}); \r\n`;
|
|
34
|
+
|
|
35
|
+
hbsHelpersFile += registerFunction;
|
|
36
|
+
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
//capitalises the first letter of each work in a given string
|
|
40
|
+
const capitalise = (words) => {
|
|
41
|
+
var separateWord = words.toLowerCase().split(' ');
|
|
42
|
+
for (var i = 0; i < separateWord.length; i++) {
|
|
43
|
+
separateWord[i] = separateWord[i].charAt(0).toUpperCase() +
|
|
44
|
+
separateWord[i].substring(1);
|
|
45
|
+
}
|
|
46
|
+
return separateWord.join(' ');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Write the helpers file to dist
|
|
50
|
+
if(!fs.existsSync(jsDir)) {
|
|
51
|
+
fs.mkdirSync(jsDir, {recursive: true});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
fs.writeFileSync(`./dist/js/helpers.js`, hbsHelpersFile);
|
|
55
|
+
|
|
56
|
+
compiler.plugin('done', (stats) => {
|
|
57
|
+
|
|
58
|
+
// For each HBS template compile a Presentation and a static Version of the template;
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
const siteData= fs.readFileSync('./src/data/site.json', 'utf8');
|
|
62
|
+
const currentData= fs.readFileSync('./src/data/current.json', 'utf8');
|
|
63
|
+
const siteDataParsed = JSON.parse(siteData);
|
|
64
|
+
const currentDataParsed = JSON.parse(currentData);
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
hbsTemplates.forEach(templatePath => {
|
|
68
|
+
|
|
69
|
+
// Read the templates from the file system
|
|
70
|
+
const templateDataPresentation = fs.readFileSync(templatePath, 'utf8');
|
|
71
|
+
|
|
72
|
+
// Get the template name from the path
|
|
73
|
+
const templateName = templatePath.split('/')[3];
|
|
74
|
+
|
|
75
|
+
// Make component directory
|
|
76
|
+
fs.mkdirSync(`${outputPath}/${templateName}`, {
|
|
77
|
+
recursive: true
|
|
78
|
+
}, (err) => {
|
|
79
|
+
if (err) throw err;
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
//get dataPath from manifest option
|
|
83
|
+
const dataPath = this.options.manifest.replace('**',templateName);
|
|
84
|
+
|
|
85
|
+
logger.log(templateName);
|
|
86
|
+
|
|
87
|
+
const manifestData= fs.readFileSync(dataPath, 'utf8');
|
|
88
|
+
|
|
89
|
+
//Write Manifest
|
|
90
|
+
fs.writeFileSync(`${outputPath}/${templateName}/manifest.json`,manifestData);
|
|
91
|
+
|
|
92
|
+
//Action Manifest if it exists
|
|
93
|
+
if(manifestData.length) {
|
|
94
|
+
//Parse manifest
|
|
95
|
+
const manifestDataParsed = JSON.parse(manifestData).component;
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
//Compile XML
|
|
99
|
+
|
|
100
|
+
if(manifestData.length) {
|
|
101
|
+
|
|
102
|
+
const manifestDataXML = JSON.parse(manifestData);
|
|
103
|
+
|
|
104
|
+
function rand() {
|
|
105
|
+
return Math.floor(Math.random() * 10000000000);
|
|
106
|
+
}
|
|
107
|
+
var idMap = {
|
|
108
|
+
'cct_id':rand(),
|
|
109
|
+
'schema_id':rand(),
|
|
110
|
+
'section_id':rand()
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
//test if we have the data and metadata objects as children
|
|
114
|
+
if(typeof(manifestDataXML.component.data) !== 'undefined' && typeof(manifestDataXML.component.data.metadata) !== 'undefined'){
|
|
115
|
+
//grab the metadata fields
|
|
116
|
+
for(const field in manifestDataXML.component.data.metadata) {
|
|
117
|
+
idMap[field] = rand();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
var XMLOutput = '';
|
|
122
|
+
|
|
123
|
+
//Header
|
|
124
|
+
XMLOutput+=`<?xml version="1.0" encoding="utf-8"?>
|
|
125
|
+
<actions>`
|
|
126
|
+
|
|
127
|
+
//CCT
|
|
128
|
+
|
|
129
|
+
XMLOutput+= `
|
|
130
|
+
<action>
|
|
131
|
+
<action_id>create_Content_Container_Template_${idMap.cct_id}</action_id>
|
|
132
|
+
<action_type>create_asset</action_type>
|
|
133
|
+
<type_code>Content_Container_Template</type_code>
|
|
134
|
+
<link_type>1</link_type>
|
|
135
|
+
<parentid>1</parentid>
|
|
136
|
+
<value></value>
|
|
137
|
+
<is_dependant>0</is_dependant>
|
|
138
|
+
<is_exclusive>0</is_exclusive>
|
|
139
|
+
</action>
|
|
140
|
+
<action>
|
|
141
|
+
<action_id>set_Content_Container_Template_${idMap.cct_id}_name</action_id>
|
|
142
|
+
<action_type>set_attribute_value</action_type>
|
|
143
|
+
<asset>[[output://create_Content_Container_Template_${idMap.cct_id}.assetid]]</asset>
|
|
144
|
+
<attribute>name</attribute>
|
|
145
|
+
<value><![CDATA[${capitalise(manifestDataXML.component.name)}]]></value>
|
|
146
|
+
</action>
|
|
147
|
+
|
|
148
|
+
<action>
|
|
149
|
+
<action_id>set_Content_Container_Template_${idMap.cct_id}_edit_interface_in_admin</action_id>
|
|
150
|
+
<action_type>set_attribute_value</action_type>
|
|
151
|
+
<asset>[[output://create_Content_Container_Template_${idMap.cct_id}.assetid]]</asset>
|
|
152
|
+
<attribute>edit_interface_in_admin</attribute>
|
|
153
|
+
<value><![CDATA[1]]></value>
|
|
154
|
+
</action>
|
|
155
|
+
|
|
156
|
+
<action>
|
|
157
|
+
<action_id>set_Content_Container_Template_${idMap.cct_id}_icon_color</action_id>
|
|
158
|
+
<action_type>set_attribute_value</action_type>
|
|
159
|
+
<asset>[[output://create_Content_Container_Template_${idMap.cct_id}.assetid]]</asset>
|
|
160
|
+
<attribute>icon_color</attribute>
|
|
161
|
+
<value><![CDATA[blue]]></value>
|
|
162
|
+
</action>
|
|
163
|
+
`
|
|
164
|
+
|
|
165
|
+
//Schema
|
|
166
|
+
XMLOutput+= `
|
|
167
|
+
<action>
|
|
168
|
+
<action_id>create_Metadata_Schema_${idMap.schema_id}</action_id>
|
|
169
|
+
<action_type>create_asset</action_type>
|
|
170
|
+
<type_code>Metadata_Schema</type_code>
|
|
171
|
+
<link_type>1</link_type>
|
|
172
|
+
<parentid>[[output://create_Content_Container_Template_${idMap.cct_id}.assetid]]</parentid>
|
|
173
|
+
<value></value>
|
|
174
|
+
<is_dependant>0</is_dependant>
|
|
175
|
+
<is_exclusive>0</is_exclusive>
|
|
176
|
+
</action>
|
|
177
|
+
<action>
|
|
178
|
+
<action_id>set_Metadata_Schema_${idMap.schema_id}_name</action_id>
|
|
179
|
+
<action_type>set_attribute_value</action_type>
|
|
180
|
+
<asset>[[output://create_Metadata_Schema_${idMap.schema_id}.assetid]]</asset>
|
|
181
|
+
<attribute>name</attribute>
|
|
182
|
+
<value><![CDATA[${capitalise(manifestDataXML.component.name)}]]></value>
|
|
183
|
+
</action>
|
|
184
|
+
<action>
|
|
185
|
+
<action_id>set_permission_${idMap.schema_id}_read_5</action_id>
|
|
186
|
+
<action_type>set_permission</action_type>
|
|
187
|
+
<asset>[[output://create_Metadata_Schema_${idMap.schema_id}.assetid]]</asset>
|
|
188
|
+
<permission>1</permission>
|
|
189
|
+
<granted>1</granted>
|
|
190
|
+
<userid>[[system://public_user]]</userid>
|
|
191
|
+
</action>
|
|
192
|
+
`
|
|
193
|
+
//Section
|
|
194
|
+
XMLOutput+= `
|
|
195
|
+
<action>
|
|
196
|
+
<action_id>create_Metadata_Section_${idMap.section_id}</action_id>
|
|
197
|
+
<action_type>create_asset</action_type>
|
|
198
|
+
<type_code>Metadata_Section</type_code>
|
|
199
|
+
<link_type>2</link_type>
|
|
200
|
+
<parentid>[[output://create_Metadata_Schema_${idMap.schema_id}.assetid]]</parentid>
|
|
201
|
+
<value></value>
|
|
202
|
+
<is_dependant>1</is_dependant>
|
|
203
|
+
<is_exclusive>0</is_exclusive>
|
|
204
|
+
</action>
|
|
205
|
+
<action>
|
|
206
|
+
<action_id>add_Metadata_Section_${idMap.section_id}_path</action_id>
|
|
207
|
+
<action_type>add_web_path</action_type>
|
|
208
|
+
<asset>[[output://create_Metadata_Section_${idMap.section_id}.assetid]]</asset>
|
|
209
|
+
<parent_asset>[[output://create_Metadata_Schema_${idMap.schema_id}.assetid]]</parent_asset>
|
|
210
|
+
<path>settings</path>
|
|
211
|
+
</action>
|
|
212
|
+
<action>
|
|
213
|
+
<action_id>set_Metadata_Section_${idMap.section_id}_name</action_id>
|
|
214
|
+
<action_type>set_attribute_value</action_type>
|
|
215
|
+
<asset>[[output://create_Metadata_Section_${idMap.section_id}.assetid]]</asset>
|
|
216
|
+
<attribute>name</attribute>
|
|
217
|
+
<value><![CDATA[Settings]]></value>
|
|
218
|
+
</action>
|
|
219
|
+
<action>
|
|
220
|
+
<action_id>set_permission_${idMap.section_id}_read_5</action_id>
|
|
221
|
+
<action_type>set_permission</action_type>
|
|
222
|
+
<asset>[[output://create_Metadata_Section_${idMap.section_id}.assetid]]</asset>
|
|
223
|
+
<permission>1</permission>
|
|
224
|
+
<granted>1</granted>
|
|
225
|
+
<userid>[[system://public_user]]</userid>
|
|
226
|
+
</action>
|
|
227
|
+
`
|
|
228
|
+
//Fields
|
|
229
|
+
//for(const field in manifestDataXML['data']) {
|
|
230
|
+
if(typeof(manifestDataXML.component.data) !== 'undefined' && typeof(manifestDataXML.component.data.metadata) !== 'undefined'){
|
|
231
|
+
for(const field in manifestDataXML['component']['data']['metadata']) {
|
|
232
|
+
|
|
233
|
+
var f = manifestDataXML['component']['data']['metadata'][field];
|
|
234
|
+
//Field
|
|
235
|
+
XMLOutput+= `
|
|
236
|
+
<action>
|
|
237
|
+
<action_id>create_${f.type}_${idMap[field]}</action_id>
|
|
238
|
+
<action_type>create_asset</action_type>
|
|
239
|
+
<type_code>${f.type}</type_code>
|
|
240
|
+
<link_type>2</link_type>
|
|
241
|
+
<parentid>[[output://create_Metadata_Section_${idMap.section_id}.assetid]]</parentid>
|
|
242
|
+
<value></value>
|
|
243
|
+
<is_dependant>1</is_dependant>
|
|
244
|
+
<is_exclusive>0</is_exclusive>
|
|
245
|
+
</action>
|
|
246
|
+
<action>
|
|
247
|
+
<action_id>set_${f.type}_${idMap[field]}_name</action_id>
|
|
248
|
+
<action_type>set_attribute_value</action_type>
|
|
249
|
+
<asset>[[output://create_${f.type}_${idMap[field]}.assetid]]</asset>
|
|
250
|
+
<attribute>name</attribute>
|
|
251
|
+
<value><![CDATA[${field}]]></value>
|
|
252
|
+
</action>
|
|
253
|
+
<action>
|
|
254
|
+
<action_id>set_${f.type}_${idMap[field]}_friendly_name</action_id>
|
|
255
|
+
<action_type>set_attribute_value</action_type>
|
|
256
|
+
<asset>[[output://create_${f.type}_${idMap[field]}.assetid]]</asset>
|
|
257
|
+
<attribute>friendly_name</attribute>
|
|
258
|
+
<value><![CDATA[${f.friendly_name}]]></value>
|
|
259
|
+
</action>
|
|
260
|
+
<action>
|
|
261
|
+
<action_id>set_${f.type}_${idMap[field]}_default</action_id>
|
|
262
|
+
<action_type>set_attribute_value</action_type>
|
|
263
|
+
<asset>[[output://create_${f.type}_${idMap[field]}.assetid]]</asset>
|
|
264
|
+
<attribute>default</attribute>
|
|
265
|
+
<value><![CDATA[${f.value}]]></value>
|
|
266
|
+
</action>
|
|
267
|
+
<action>
|
|
268
|
+
<action_id>set_${f.type}_${idMap[field]}_description</action_id>
|
|
269
|
+
<action_type>set_attribute_value</action_type>
|
|
270
|
+
<asset>[[output://create_${f.type}_${idMap[field]}.assetid]]</asset>
|
|
271
|
+
<attribute>description</attribute>
|
|
272
|
+
<value><![CDATA[${f.description}]]></value>
|
|
273
|
+
</action>
|
|
274
|
+
<action>
|
|
275
|
+
<action_id>set_${f.type}_${idMap[field]}_editable</action_id>
|
|
276
|
+
<action_type>set_attribute_value</action_type>
|
|
277
|
+
<asset>[[output://create_${f.type}_${idMap[field]}.assetid]]</asset>
|
|
278
|
+
<attribute>editable</attribute>
|
|
279
|
+
<value><![CDATA[${f.editable ? 1:0}]]></value>
|
|
280
|
+
</action>
|
|
281
|
+
<action>
|
|
282
|
+
<action_id>set_${f.type}_${idMap[field]}_editable</action_id>
|
|
283
|
+
<action_type>set_attribute_value</action_type>
|
|
284
|
+
<asset>[[output://create_${f.type}_${idMap[field]}.assetid]]</asset>
|
|
285
|
+
<attribute>editable</attribute>
|
|
286
|
+
<value><![CDATA[${f.editable ? 1:0}]]></value>
|
|
287
|
+
</action>
|
|
288
|
+
<action>
|
|
289
|
+
<action_id>set_${f.type}_${idMap[field]}_required</action_id>
|
|
290
|
+
<action_type>set_attribute_value</action_type>
|
|
291
|
+
<asset>[[output://create_${f.type}_${idMap[field]}.assetid]]</asset>
|
|
292
|
+
<attribute>required</attribute>
|
|
293
|
+
<value><![CDATA[${f.required ? 1:0}]]></value>
|
|
294
|
+
</action>
|
|
295
|
+
<action>
|
|
296
|
+
<action_id>set_permission_${idMap[field]}_read_5</action_id>
|
|
297
|
+
<action_type>set_permission</action_type>
|
|
298
|
+
<asset>[[output://create_${f.type}_${idMap[field]}.assetid]]</asset>
|
|
299
|
+
<permission>1</permission>
|
|
300
|
+
<granted>1</granted>
|
|
301
|
+
<userid>[[system://public_user]]</userid>
|
|
302
|
+
</action>
|
|
303
|
+
`
|
|
304
|
+
//Options if Select
|
|
305
|
+
if(f.type == 'metadata_field_select') {
|
|
306
|
+
var options = '';
|
|
307
|
+
for(var option in f.options) {
|
|
308
|
+
options+= `'${option}' => '${f.options[option]}',`
|
|
309
|
+
}
|
|
310
|
+
XMLOutput+= `
|
|
311
|
+
<action>
|
|
312
|
+
<action_id>set_${f.type}_${idMap[field]}_select_options</action_id>
|
|
313
|
+
<action_type>set_attribute_value</action_type>
|
|
314
|
+
<asset>[[output://create_${f.type}_${idMap[field]}.assetid]]</asset>
|
|
315
|
+
<attribute>select_options</attribute>
|
|
316
|
+
<value><![CDATA[array (${options});]]></value>
|
|
317
|
+
</action>
|
|
318
|
+
<action>
|
|
319
|
+
<action_id>set_{f.type}_${idMap[field]}_edit_params</action_id>
|
|
320
|
+
<action_type>set_attribute_value</action_type>
|
|
321
|
+
<asset>[[output://create_${f.type}_${idMap[field]}.assetid]]</asset>
|
|
322
|
+
<attribute>edit_params</attribute>
|
|
323
|
+
<value><![CDATA[array (
|
|
324
|
+
'style' => 'list',
|
|
325
|
+
'type' => 'table',
|
|
326
|
+
'height' => '',
|
|
327
|
+
'columns' => '1',
|
|
328
|
+
'empty_text' => '',
|
|
329
|
+
'extras' => '',
|
|
330
|
+
);]]></value>
|
|
331
|
+
</action>
|
|
332
|
+
`
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
XMLOutput+= `</actions>`;
|
|
337
|
+
|
|
338
|
+
//Write XML
|
|
339
|
+
fs.writeFileSync(`${outputPath}/${templateName}/import.xml`,XMLOutput);
|
|
340
|
+
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
//Compile static HTML version of the template
|
|
344
|
+
const compiledHTML = Handlebars.compile(templateDataPresentation);
|
|
345
|
+
//Write Static HTML File
|
|
346
|
+
|
|
347
|
+
fs.writeFileSync(`${outputPath}/${templateName}/static.html`, compiledHTML({
|
|
348
|
+
'component':manifestDataParsed,
|
|
349
|
+
'site':siteDataParsed,
|
|
350
|
+
'current':currentDataParsed,
|
|
351
|
+
'content':'Lorem Ipsum'
|
|
352
|
+
}));
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// Compile presentation version of the template
|
|
356
|
+
const compiledPresentation = Handlebars.precompile(templateDataPresentation);
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
// Write both versions of the template
|
|
360
|
+
fs.writeFileSync(`${outputPath}/${templateName}/presentation.js`, compiledPresentation);
|
|
361
|
+
|
|
362
|
+
}
|
|
363
|
+
)
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
module.exports = PrecompilePlugin;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
const HtmlWebPackPlugin = require("html-webpack-plugin");
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const glob = require('glob');
|
|
5
|
+
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
6
|
+
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
7
|
+
|
|
8
|
+
// Our function that generates our html plugins
|
|
9
|
+
function generateHtmlPlugins(templateDir) {
|
|
10
|
+
// Read files in /html directory
|
|
11
|
+
const templateFiles = fs
|
|
12
|
+
.readdirSync(path.resolve(__dirname, templateDir))
|
|
13
|
+
.filter(function(file) { //ignore folder
|
|
14
|
+
return file.indexOf('.html') > -1
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
return templateFiles.map(item => {
|
|
18
|
+
// Split names and extension
|
|
19
|
+
const parts = item.split('.')
|
|
20
|
+
const name = parts[0]
|
|
21
|
+
const extension = parts[1]
|
|
22
|
+
// Create new HTMLWebpackPlugin with options
|
|
23
|
+
return new HtmlWebPackPlugin({
|
|
24
|
+
'filename': `${name}.html`,
|
|
25
|
+
'template': path.resolve(__dirname, `${templateDir}/${name}.${extension}`)
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
const htmlPlugins = generateHtmlPlugins('../src/html');
|
|
30
|
+
|
|
31
|
+
// File arrays
|
|
32
|
+
let js_files = glob.sync('./src/**/**/global.js') // Module JS
|
|
33
|
+
|
|
34
|
+
function reloadHtml() {
|
|
35
|
+
const cache = {};
|
|
36
|
+
const plugin = {
|
|
37
|
+
name: 'CustomHtmlReloadPlugin'
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
this.hooks.compilation.tap(plugin, compilation => {
|
|
41
|
+
compilation.hooks.htmlWebpackPluginAfterEmit.tap(plugin, data => {
|
|
42
|
+
const orig = cache[data.outputName];
|
|
43
|
+
const html = data.html.source();
|
|
44
|
+
|
|
45
|
+
// plugin seems to emit on any unrelated change?
|
|
46
|
+
if (orig && orig !== html) {
|
|
47
|
+
devServer.sockWrite(devServer.sockets, 'content-changed')
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
cache[data.outputName] = html
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const copyWebPack = new CopyWebpackPlugin([
|
|
56
|
+
{
|
|
57
|
+
from: path.resolve(__dirname, '../src/externals'),
|
|
58
|
+
to: 'externals',
|
|
59
|
+
ignore: ['__What is this folder for']
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
from: path.resolve(__dirname, '../src/assets'),
|
|
63
|
+
to: 'mysource_files',
|
|
64
|
+
ignore: ['__What is this folder for']
|
|
65
|
+
}
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
module.exports = {
|
|
69
|
+
entry: {
|
|
70
|
+
main: ['./src/index.js'].concat(js_files)
|
|
71
|
+
},
|
|
72
|
+
output: {
|
|
73
|
+
path: path.resolve(__dirname, '../dist'), // Output folder
|
|
74
|
+
filename: 'js/[name].js' // JS output path
|
|
75
|
+
},
|
|
76
|
+
resolve: {
|
|
77
|
+
alias: {
|
|
78
|
+
NodeModules: path.resolve(__dirname, '../node_modules/'),
|
|
79
|
+
src: path.resolve(__dirname, '../src/')
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
module: {
|
|
83
|
+
rules: [{ // HTML
|
|
84
|
+
test: /\.html$/,
|
|
85
|
+
use: [{
|
|
86
|
+
loader: "html-loader",
|
|
87
|
+
options: {
|
|
88
|
+
minimize: false,
|
|
89
|
+
sources:false,
|
|
90
|
+
interpolate: true // allow HTML snippets with commonJs require tags
|
|
91
|
+
}
|
|
92
|
+
}]
|
|
93
|
+
},
|
|
94
|
+
{ // JavaScript and JSX only (no JSON)
|
|
95
|
+
test: /\.jsx?$/,
|
|
96
|
+
exclude: /node_modules/,
|
|
97
|
+
use: [
|
|
98
|
+
"babel-loader",
|
|
99
|
+
"eslint-loader"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{ // Images
|
|
103
|
+
test: /\.(png|svg|jpg|gif|ico)$/,
|
|
104
|
+
use: {
|
|
105
|
+
'loader': 'file-loader',
|
|
106
|
+
'options': {
|
|
107
|
+
'esModule': false,
|
|
108
|
+
'name': '[name].[ext]',
|
|
109
|
+
'outputPath': 'mysource_files/',
|
|
110
|
+
'publicPath': 'mysource_files/',
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{ // Font files
|
|
115
|
+
test: /\.(woff(2)?|ttf|eot|otf)(\?v=\d+\.\d+\.\d+)?$/,
|
|
116
|
+
use: [{
|
|
117
|
+
'loader': 'file-loader',
|
|
118
|
+
'options': {
|
|
119
|
+
'name': './mysource_files/[name].[ext]'
|
|
120
|
+
}
|
|
121
|
+
}]
|
|
122
|
+
} ,
|
|
123
|
+
// For TinyMCE
|
|
124
|
+
{
|
|
125
|
+
test: /skin\.css$/i,
|
|
126
|
+
use: [MiniCssExtractPlugin.loader, 'css-loader'],
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
test: /content\.css$/i,
|
|
130
|
+
use: ['css-loader'],
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
test: /tinymce_classes\.css$/i,
|
|
134
|
+
use: ['css-loader'],
|
|
135
|
+
},
|
|
136
|
+
// For Select2
|
|
137
|
+
{
|
|
138
|
+
test: /select2\.css$/i,
|
|
139
|
+
use:[
|
|
140
|
+
'style-loader',
|
|
141
|
+
'css-loader'
|
|
142
|
+
],
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
plugins: htmlPlugins.concat(reloadHtml).concat(copyWebPack).concat(new MiniCssExtractPlugin()),
|
|
147
|
+
optimization: {
|
|
148
|
+
minimize: false,
|
|
149
|
+
runtimeChunk: 'single'
|
|
150
|
+
}
|
|
151
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const webpack = require('webpack');
|
|
2
|
+
const merge = require('webpack-merge');
|
|
3
|
+
const common = require('./webpack.common.js');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
module.exports = merge(common, {
|
|
7
|
+
mode: 'development',
|
|
8
|
+
devtool: 'cheap-eval-source-map',
|
|
9
|
+
devServer: {
|
|
10
|
+
before(app, server) {
|
|
11
|
+
devServer = server;
|
|
12
|
+
},
|
|
13
|
+
contentBase: path.join(__dirname, '../dist'),
|
|
14
|
+
hot: true,
|
|
15
|
+
host: '0.0.0.0',
|
|
16
|
+
port: 8080
|
|
17
|
+
},
|
|
18
|
+
module: {
|
|
19
|
+
rules: [
|
|
20
|
+
{
|
|
21
|
+
test: /\.scss$/,
|
|
22
|
+
use: [
|
|
23
|
+
"style-loader",
|
|
24
|
+
"css-loader",
|
|
25
|
+
"postcss-loader",
|
|
26
|
+
"sass-loader",
|
|
27
|
+
"import-glob-loader"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
{ // Handlebars
|
|
31
|
+
test: /\.hbs$/,
|
|
32
|
+
use:[
|
|
33
|
+
{
|
|
34
|
+
'loader':'handlebars-loader',
|
|
35
|
+
'options':{
|
|
36
|
+
helperDirs: path.resolve(__dirname, "../src/helpers/Handlebars")
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
'loader':'string-replace-loader',
|
|
41
|
+
'options':{
|
|
42
|
+
'search':/\.\/\?a=/g,
|
|
43
|
+
'replace':''
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
enforce:"post"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
plugins: [
|
|
52
|
+
new webpack.HotModuleReplacementPlugin()
|
|
53
|
+
]
|
|
54
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const merge = require('webpack-merge');
|
|
2
|
+
const common = require('./webpack.common.js');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
|
5
|
+
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
6
|
+
const PrecompilePlugin = require('./PrecompilePlugin');
|
|
7
|
+
const JsonMergePlugin = require('./JsonMergePlugin');
|
|
8
|
+
|
|
9
|
+
module.exports = env => {
|
|
10
|
+
|
|
11
|
+
// Environment variables from script command
|
|
12
|
+
const env_minify = env.minify;
|
|
13
|
+
let minimize = false;
|
|
14
|
+
|
|
15
|
+
// Conditional minification
|
|
16
|
+
if (env_minify === 'true') {
|
|
17
|
+
minimize = true;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return merge(common, {
|
|
21
|
+
mode: 'production',
|
|
22
|
+
devtool: 'source-map',
|
|
23
|
+
module: {
|
|
24
|
+
rules: [{
|
|
25
|
+
test: /\.scss$/,
|
|
26
|
+
use: [
|
|
27
|
+
MiniCssExtractPlugin.loader,
|
|
28
|
+
"css-loader",
|
|
29
|
+
"postcss-loader",
|
|
30
|
+
"sass-loader",
|
|
31
|
+
"import-glob-loader"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{ // Handlebars
|
|
35
|
+
test: /\.hbs$/,
|
|
36
|
+
use:[
|
|
37
|
+
{
|
|
38
|
+
'loader':'handlebars-loader',
|
|
39
|
+
'options':{
|
|
40
|
+
helperDirs: path.resolve(__dirname, "../src/helpers/Handlebars")
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
enforce:"post",
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
plugins: [
|
|
49
|
+
new MiniCssExtractPlugin({
|
|
50
|
+
filename: "[name].css",
|
|
51
|
+
chunkFilename: "[name].css",
|
|
52
|
+
}),
|
|
53
|
+
new CleanWebpackPlugin(['dist'], {}),
|
|
54
|
+
new PrecompilePlugin({
|
|
55
|
+
'input': './src/components/**/**/*.hbs',
|
|
56
|
+
'manifest':'./src/components/**/js/manifest.json',
|
|
57
|
+
'output': './dist/components/',
|
|
58
|
+
'helpersInput': './src/helpers/Handlebars/*.js'
|
|
59
|
+
}),
|
|
60
|
+
new JsonMergePlugin({
|
|
61
|
+
'input': './src/api/service_finder/schemas/*.json',
|
|
62
|
+
'output': './dist/api/service_finder/schemas.json'
|
|
63
|
+
})
|
|
64
|
+
],
|
|
65
|
+
optimization: {
|
|
66
|
+
minimize: minimize,
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
}
|