@total_onion/onion-library 3.2.0 → 3.2.2
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/.github/workflows/npm-publish.yml +38 -0
- package/.prettierrc +22 -0
- package/__spec__/copyBlockComponent.spec.js +94 -0
- package/__spec__/copyFile.spec.js +78 -0
- package/__spec__/copyFileKeeping.spec.js +74 -0
- package/__spec__/files/source.txt +1 -0
- package/__spec__/update-all-components.spec.js +99 -0
- package/__spec__/update-component.spec.js +165 -0
- package/assembleAssetList.js +69 -0
- package/breakpoints.scss +6 -0
- package/build-library.js +4 -0
- package/checkBuildAssets.js +17 -0
- package/components/block-accent-image-v3/accent-image-v3.js +7 -0
- package/components/block-accent-image-v3/accent-image-v3.scss +4 -0
- package/components/block-accent-image-v3/accent-image-v3.twig +137 -0
- package/components/block-accent-image-v3/group_6890e1233ff2d.json +81 -0
- package/components/block-accordion-v3/accordion-v3.js +119 -0
- package/components/block-accordion-v3/accordion-v3.scss +197 -0
- package/components/block-accordion-v3/accordion-v3.twig +51 -0
- package/components/block-accordion-v3/group_6888d2f0b230b.json +458 -0
- package/components/block-back-to-top-button-v3/back-to-top-button-v3.js +12 -0
- package/components/block-back-to-top-button-v3/back-to-top-button-v3.scss +68 -0
- package/components/block-back-to-top-button-v3/back-to-top-button-v3.twig +40 -0
- package/components/block-back-to-top-button-v3/group_63e24e04a1e61.json +323 -0
- package/components/block-betterreviews-display-v3/betterreviews-display-v3.js +10 -0
- package/components/block-betterreviews-display-v3/betterreviews-display-v3.scss +104 -0
- package/components/block-betterreviews-display-v3/betterreviews-display-v3.twig +24 -0
- package/components/block-betterreviews-display-v3/group_6892880fc1a00.json +182 -0
- package/components/block-block-interactions-v3/block-interactions-v3.js +53 -0
- package/components/block-block-interactions-v3/block-interactions-v3.scss +32 -0
- package/components/block-block-interactions-v3/block-interactions-v3.twig +55 -0
- package/components/block-block-interactions-v3/group_687e1575ba23d.json +700 -0
- package/components/block-carousel-multi-layout-v3/carousel-multi-layout-v3.js +243 -0
- package/components/block-carousel-multi-layout-v3/carousel-multi-layout-v3.scss +156 -0
- package/components/block-carousel-multi-layout-v3/carousel-multi-layout-v3.twig +146 -0
- package/components/block-carousel-multi-layout-v3/group_686bd42e551d6.json +578 -0
- package/components/block-cocktail-recipe-v3/cocktail-recipe-v3.js +127 -0
- package/components/block-cocktail-recipe-v3/cocktail-recipe-v3.scss +345 -0
- package/components/block-cocktail-recipe-v3/cocktail-recipe-v3.twig +93 -0
- package/components/block-cocktail-recipe-v3/group_68fff19fa4dd0.json +202 -0
- package/components/block-cover-link-v3/cover-link-v3.js +7 -0
- package/components/block-cover-link-v3/cover-link-v3.scss +10 -0
- package/components/block-cover-link-v3/cover-link-v3.twig +16 -0
- package/components/block-cover-link-v3/group_687192c28b7eb.json +96 -0
- package/components/block-divider-v3/divider-v3.js +8 -0
- package/components/block-divider-v3/divider-v3.scss +103 -0
- package/components/block-divider-v3/divider-v3.twig +45 -0
- package/components/block-divider-v3/group_686b919696bfe.json +891 -0
- package/components/block-featured-image-gallery-v3/featured-image-gallery-v3.js +44 -0
- package/components/block-featured-image-gallery-v3/featured-image-gallery-v3.scss +93 -0
- package/components/block-featured-image-gallery-v3/featured-image-gallery-v3.twig +43 -0
- package/components/block-featured-image-gallery-v3/group_5f91897095b42.json +88 -0
- package/components/block-form-selection-v3/form-selection-v3.js +78 -0
- package/components/block-form-selection-v3/form-selection-v3.scss +38 -0
- package/components/block-form-selection-v3/form-selection-v3.twig +84 -0
- package/components/block-form-selection-v3/group_68752e7949e53.json +351 -0
- package/components/block-gradient-layer-v3/gradient-layer-v3.js +7 -0
- package/components/block-gradient-layer-v3/gradient-layer-v3.scss +8 -0
- package/components/block-gradient-layer-v3/gradient-layer-v3.twig +78 -0
- package/components/block-gradient-layer-v3/group_686fdadc85df4.json +206 -0
- package/components/block-group-container-v3/group-container-v3.js +7 -0
- package/components/block-group-container-v3/group-container-v3.php +14 -0
- package/components/block-group-container-v3/group-container-v3.scss +45 -0
- package/components/block-group-container-v3/group-container-v3.twig +70 -0
- package/components/block-group-container-v3/group_6865578ada499.json +3660 -0
- package/components/block-lottie-content-v3/group_687197027216d.json +177 -0
- package/components/block-lottie-content-v3/lottie-content-v3.js +25 -0
- package/components/block-lottie-content-v3/lottie-content-v3.scss +2 -0
- package/components/block-lottie-content-v3/lottie-content-v3.twig +15 -0
- package/components/block-market-selector-v3/group_68752075dd831.json +129 -0
- package/components/block-market-selector-v3/market-selector-v3.js +7 -0
- package/components/block-market-selector-v3/market-selector-v3.scss +120 -0
- package/components/block-market-selector-v3/market-selector-v3.twig +40 -0
- package/components/block-modal-form-v3/modal-form-v3.js +59 -0
- package/components/block-modal-form-v3/modal-form-v3.scss +6 -0
- package/components/block-modal-form-v3/modal-form-v3.twig +30 -0
- package/components/block-nav-menu-container-v3/group_687e00b45e9a3.json +187 -0
- package/components/block-nav-menu-container-v3/nav-menu-container-v3.js +7 -0
- package/components/block-nav-menu-container-v3/nav-menu-container-v3.scss +3 -0
- package/components/block-nav-menu-container-v3/nav-menu-container-v3.twig +23 -0
- package/components/block-post-info-v3/group_6866429531436.json +3112 -0
- package/components/block-post-info-v3/post-info-v3/bazaarvoice-inline.twig +13 -0
- package/components/block-post-info-v3/post-info-v3/better-reviews.twig +15 -0
- package/components/block-post-info-v3/post-info-v3/divider.twig +8 -0
- package/components/block-post-info-v3/post-info-v3/drink-description.twig +10 -0
- package/components/block-post-info-v3/post-info-v3/global-image.twig +22 -0
- package/components/block-post-info-v3/post-info-v3/gradient-layer.twig +78 -0
- package/components/block-post-info-v3/post-info-v3/gradient-overlay.twig +10 -0
- package/components/block-post-info-v3/post-info-v3/post-author.twig +17 -0
- package/components/block-post-info-v3/post-info-v3/post-buy-now.twig +116 -0
- package/components/block-post-info-v3/post-info-v3/post-categories.twig +15 -0
- package/components/block-post-info-v3/post-info-v3/post-headline.twig +15 -0
- package/components/block-post-info-v3/post-info-v3/post-image.twig +47 -0
- package/components/block-post-info-v3/post-info-v3/post-info-description.twig +15 -0
- package/components/block-post-info-v3/post-info-v3/post-info-subtitle.twig +14 -0
- package/components/block-post-info-v3/post-info-v3/post-link.twig +42 -0
- package/components/block-post-info-v3/post-info-v3/post-name.twig +12 -0
- package/components/block-post-info-v3/post-info-v3/post-publish-date.twig +12 -0
- package/components/block-post-info-v3/post-info-v3/post-tags.twig +24 -0
- package/components/block-post-info-v3/post-info-v3/post-text-alternative-style.twig +16 -0
- package/components/block-post-info-v3/post-info-v3/post-title.twig +15 -0
- package/components/block-post-info-v3/post-info-v3/post-video.twig +27 -0
- package/components/block-post-info-v3/post-info-v3/reservebar-add-to-cart.twig +32 -0
- package/components/block-post-info-v3/post-info-v3/shopify-add-to-cart.twig +31 -0
- package/components/block-post-info-v3/post-info-v3/social-networks.twig +33 -0
- package/components/block-post-info-v3/post-info-v3/spacer-v3.twig +9 -0
- package/components/block-post-info-v3/post-info-v3.js +10 -0
- package/components/block-post-info-v3/post-info-v3.scss +210 -0
- package/components/block-post-info-v3/post-info-v3.twig +67 -0
- package/components/block-product-info-v3/group_68909995b6550.json +3544 -0
- package/components/block-product-info-v3/product-info-v3/product-abv.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-cask-type-label.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-cask-type.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-colour-label.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-colour.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-description.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-finish-label.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-finish.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-headline.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-image.twig +43 -0
- package/components/block-product-info-v3/product-info-v3/product-name.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-nose-label.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-nose.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-pair-with-label.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-pair-with.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-palate-label.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-palate.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-taste-label.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-taste.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/product-volume.twig +14 -0
- package/components/block-product-info-v3/product-info-v3/spacer-v3.twig +9 -0
- package/components/block-product-info-v3/product-info-v3.js +7 -0
- package/components/block-product-info-v3/product-info-v3.scss +171 -0
- package/components/block-product-info-v3/product-info-v3.twig +43 -0
- package/components/block-raw-html-v3/group_686ba68d603a2.json +212 -0
- package/components/block-raw-html-v3/raw-html-v3.js +7 -0
- package/components/block-raw-html-v3/raw-html-v3.scss +2 -0
- package/components/block-raw-html-v3/raw-html-v3.twig +17 -0
- package/components/block-responsive-table-v3/group_6617ecc987ddd.json +394 -0
- package/components/block-responsive-table-v3/responsive-table-v3.js +7 -0
- package/components/block-responsive-table-v3/responsive-table-v3.scss +49 -0
- package/components/block-responsive-table-v3/responsive-table-v3.twig +47 -0
- package/components/block-scrolling-banner-v3/group_68e67fca1ec80.json +664 -0
- package/components/block-scrolling-banner-v3/scrolling-banner-v3.js +144 -0
- package/components/block-scrolling-banner-v3/scrolling-banner-v3.scss +104 -0
- package/components/block-scrolling-banner-v3/scrolling-banner-v3.twig +72 -0
- package/components/block-section-separator-v3/group_6874c8d79b84b.json +576 -0
- package/components/block-section-separator-v3/section-separator-v3.js +7 -0
- package/components/block-section-separator-v3/section-separator-v3.scss +42 -0
- package/components/block-section-separator-v3/section-separator-v3.twig +46 -0
- package/components/block-single-column-container-v3/group_6887640458d61.json +481 -0
- package/components/block-single-column-container-v3/single-column-container-v3.js +7 -0
- package/components/block-single-column-container-v3/single-column-container-v3.scss +14 -0
- package/components/block-single-column-container-v3/single-column-container-v3.twig +30 -0
- package/components/block-single-responsive-image-v3/group_6867bcf24c2fc.json +128 -0
- package/components/block-single-responsive-image-v3/single-responsive-image-v3.js +7 -0
- package/components/block-single-responsive-image-v3/single-responsive-image-v3.scss +9 -0
- package/components/block-single-responsive-image-v3/single-responsive-image-v3.twig +24 -0
- package/components/block-site-copyright-notice-v3/group_66296c3716b4f.json +304 -0
- package/components/block-site-copyright-notice-v3/index.html +33 -0
- package/components/block-site-copyright-notice-v3/site-copyright-notice-v3.js +58 -0
- package/components/block-site-copyright-notice-v3/site-copyright-notice-v3.scss +21 -0
- package/components/block-site-copyright-notice-v3/site-copyright-notice-v3.twig +30 -0
- package/components/block-site-logo-container-v3/group_687e3b887b508.json +175 -0
- package/components/block-site-logo-container-v3/site-logo-container-v3.js +7 -0
- package/components/block-site-logo-container-v3/site-logo-container-v3.scss +29 -0
- package/components/block-site-logo-container-v3/site-logo-container-v3.twig +40 -0
- package/components/block-site-title-and-tagline-v3/site-title-and-tagline-v3.js +7 -0
- package/components/block-site-title-and-tagline-v3/site-title-and-tagline-v3.scss +16 -0
- package/components/block-site-title-and-tagline-v3/site-title-and-tagline-v3.twig +24 -0
- package/components/block-smash-balloon-social-media-v3/smash-balloon-social-media-v3.js +8 -0
- package/components/block-smash-balloon-social-media-v3/smash-balloon-social-media-v3.scss +31 -0
- package/components/block-smash-balloon-social-media-v3/smash-balloon-social-media-v3.twig +18 -0
- package/components/block-social-networks-v3/group_6891d4d7db414.json +146 -0
- package/components/block-social-networks-v3/social-networks-v3.js +7 -0
- package/components/block-social-networks-v3/social-networks-v3.scss +7 -0
- package/components/block-social-networks-v3/social-networks-v3.twig +24 -0
- package/components/block-spacer-v3/group_686b8cb48c708.json +131 -0
- package/components/block-spacer-v3/spacer-v3.js +8 -0
- package/components/block-spacer-v3/spacer-v3.scss +19 -0
- package/components/block-spacer-v3/spacer-v3.twig +13 -0
- package/components/block-spotify-embed-v3/group_67d04c4c4cf78.json +120 -0
- package/components/block-spotify-embed-v3/spotify-embed-v3.js +7 -0
- package/components/block-spotify-embed-v3/spotify-embed-v3.scss +11 -0
- package/components/block-spotify-embed-v3/spotify-embed-v3.twig +23 -0
- package/components/block-standard-content-v3/group_68655756737c9.json +344 -0
- package/components/block-standard-content-v3/standard-content-v3.js +39 -0
- package/components/block-standard-content-v3/standard-content-v3.scss +11 -0
- package/components/block-standard-content-v3/standard-content-v3.twig +46 -0
- package/components/block-sticky-buy-cta-v3/group_68b061bb56543.json +172 -0
- package/components/block-sticky-buy-cta-v3/sticky-buy-cta-v3.js +7 -0
- package/components/block-sticky-buy-cta-v3/sticky-buy-cta-v3.scss +2 -0
- package/components/block-sticky-buy-cta-v3/sticky-buy-cta-v3.twig +92 -0
- package/components/block-sub-group-container-v3/group_686ceba7d6066.json +2142 -0
- package/components/block-sub-group-container-v3/sub-group-container-v3.js +9 -0
- package/components/block-sub-group-container-v3/sub-group-container-v3.scss +27 -0
- package/components/block-sub-group-container-v3/sub-group-container-v3.twig +59 -0
- package/components/block-video-content-v3/group_687190b8d26df.json +169 -0
- package/components/block-video-content-v3/video-content-v3.js +12 -0
- package/components/block-video-content-v3/video-content-v3.scss +123 -0
- package/components/block-video-content-v3/video-content-v3.twig +26 -0
- package/components/component-accent-image-v3/accent-image-v3.twig +119 -0
- package/components/component-accent-image-v3/group_686cd5547efd2.json +975 -0
- package/components/component-accent-text-v3/accent-text-v3-extra.scss +2 -0
- package/components/component-accent-text-v3/accent-text-v3.scss +60 -0
- package/components/component-accent-text-v3/group_686b91fed8f5f.json +220 -0
- package/components/component-accordion-v3/accordion-v3.js +113 -0
- package/components/component-accordion-v3/accordion-v3.scss +189 -0
- package/components/component-accordion-v3/accordion-v3.twig +39 -0
- package/components/component-accordion-v3/group_66ab7edfc6d63.json +535 -0
- package/components/component-animations-style-v3/animations-style-v3.twig +5 -0
- package/components/component-animations-v3/animations-v3.scss +161 -0
- package/components/component-animations-v3/animations-v3.twig +19 -0
- package/components/component-animations-v3/group_689f39c37980a.json +499 -0
- package/components/component-better-reviews-v3/better-reviews-v3.scss +137 -0
- package/components/component-block-padding-v3/block-padding-v3.scss +64 -0
- package/components/component-block-padding-v3/block-padding-v3.twig +33 -0
- package/components/component-block-padding-v3/group_689f66f3e26df.json +535 -0
- package/components/component-block-settings-v3/block-settings-v3.scss +46 -0
- package/components/component-block-settings-v3/block-settings-v3.twig +34 -0
- package/components/component-block-settings-v3/group_689f649af2ac4.json +983 -0
- package/components/component-blockquote-v3/blockquote-v3.scss +54 -0
- package/components/component-box-shadow-v3/box-shadow-v3.scss +12 -0
- package/components/component-buy-now-button-v3/buy-now-buttons-v3.twig +69 -0
- package/components/component-carousel-fields-v3/group_686fd30f4d873.json +3025 -0
- package/components/component-child-block-video-fields/group_6852a4f384204.json +536 -0
- package/components/component-content-box-settings-v3/content-box-settings-v3.scss +205 -0
- package/components/component-content-box-settings-v3/content-box-settings-v3.twig +156 -0
- package/components/component-content-box-settings-v3/group_686e6ec702acc.json +1729 -0
- package/components/component-content-box-v3/content-box-v3.js +6 -0
- package/components/component-content-box-v3/content-box-v3.scss +28 -0
- package/components/component-content-box-v3/content-box-v3.twig +23 -0
- package/components/component-content-box-v3/group_686b8a4f1fe5d.json +568 -0
- package/components/component-content-image-v3/content-image-v3.scss +33 -0
- package/components/component-content-image-v3/content-image-v3.twig +77 -0
- package/components/component-content-image-v3/group_68722935c428f.json +647 -0
- package/components/component-core-body-close-v3/core-body-close-v3.twig +2 -0
- package/components/component-core-body-open-v3/core-body-open-v3.twig +32 -0
- package/components/component-core-group-container-styles-v3/core-group-container-styles-v3.scss +48 -0
- package/components/component-core-head-v3/core-head-v3.twig +62 -0
- package/components/component-cta-selection-v3/cta-selection-v3.twig +256 -0
- package/components/component-cta-selection-v3/group_686e93eb832a6.json +1117 -0
- package/components/component-e-shop-settings-v3/e-shop-settings-v3.twig +114 -0
- package/components/component-element-positioning-v3/element-positioning-v3.scss +41 -0
- package/components/component-element-positioning-v3/element-positioning-v3.twig +42 -0
- package/components/component-element-positioning-v3/group_6882281544263.json +635 -0
- package/components/component-endpoints/endpoints.php +32 -0
- package/components/component-flex-layout-container-v3/flex-layout-container-v3.scss +38 -0
- package/components/component-flex-layout-container-v3/flex-layout-container-v3.twig +28 -0
- package/components/component-flex-layout-container-v3/group_6887a026bbc33.json +773 -0
- package/components/component-global-content-max-width-v3/global-content-max-width-v3.twig +10 -0
- package/components/component-global-content-max-width-v3/group_63c83de4f0a99.json +58 -0
- package/components/component-gradient-overlay-v3/gradient-overlay-v3.scss +43 -0
- package/components/component-gradient-overlay-v3/gradient-overlay-v3.twig +58 -0
- package/components/component-gradient-overlay-v3/group_686fd9ca50b63.json +495 -0
- package/components/component-grid-gap-mults-v3/grid-gap-mults-v3.twig +10 -0
- package/components/component-grid-gap-mults-v3/group_689221b94ce69.json +220 -0
- package/components/component-grid-layout-container-v3/grid-layout-container-v3.scss +154 -0
- package/components/component-grid-layout-container-v3/grid-layout-container-v3.twig +88 -0
- package/components/component-grid-layout-container-v3/group_6882282e65bf2.json +1525 -0
- package/components/component-grid-layout-element-v3/grid-layout-element-v3.scss +47 -0
- package/components/component-grid-layout-element-v3/grid-layout-element-v3.twig +23 -0
- package/components/component-grid-layout-element-v3/group_68822860bda9f.json +728 -0
- package/components/component-nav-menu-v3/group_68da703f710ff.json +432 -0
- package/components/component-nav-menu-v3/nav-menu-v3.scss +43 -0
- package/components/component-nav-menu-v3/nav-menu-v3.twig +75 -0
- package/components/component-responsive-image-v3/group_6867bc53f1da8.json +1515 -0
- package/components/component-responsive-image-v3/responsive-image-v3.scss +63 -0
- package/components/component-responsive-image-v3/responsive-image-v3.twig +71 -0
- package/components/component-responsive-picture-element-v3/responsive-picture-element-v3.twig +35 -0
- package/components/component-responsive-show-hide/responsive-show-hide-v3.twig +9 -0
- package/components/component-social-media-share-v3/social-media-share-v3-extra.scss +6 -0
- package/components/component-social-media-share-v3/social-media-share-v3.scss +131 -0
- package/components/component-social-networks-v3/social-networks-v3.scss +73 -0
- package/components/component-social-networks-v3/social-networks-v3.twig +43 -0
- package/components/component-text-editor-settings-container-classes-v3/text-editor-settings-container-classes-v3.twig +9 -0
- package/components/component-text-editor-settings-element-classes-v3/text-editor-settings-element-classes-v3.twig +13 -0
- package/components/component-text-editor-settings-v3/group_687a4e2334e37.json +1377 -0
- package/components/component-text-editor-settings-variables-v3/text-editor-settings-variables-v3.twig +61 -0
- package/components/component-video-component-v3/video-component-v3.twig +90 -0
- package/components/component-video-fields-v3/group_6872282f44634.json +1013 -0
- package/components/component-video-trigger-button-v3/video-trigger-button-v3.twig +14 -0
- package/components/component-wysiwyg-editor-v3/group_6867e153af466.json +127 -0
- package/components/component-wysiwyg-editor-v3/wysiwyg-editor-v3.twig +18 -0
- package/components/core-block-editor-assets-v3/core-block-editor-assets-v3.php +14 -0
- package/components/core-core-block-render-function-v3/core-block-render-function-v3.php +39 -0
- package/components/core-core-design-settings-v3/core-design-settings-v3.php +43 -0
- package/components/core-core-post-overrides-v3/core-post-overrides-v3.php +21 -0
- package/components/core-core-themes/core-themes-v3.php +68 -0
- package/components/core-core-typography-v3/core-typography-v3.php +239 -0
- package/components/core-globals/globals.php +39 -0
- package/components/entrypoint-entry-point-classes-v3/entry-point-classes-v3.twig +12 -0
- package/components/entrypoint-entry-point-html-v3/entry-point-html-v3.twig +19 -0
- package/components/entrypoint-entry-point-style-v3/entry-point-style-v3.twig +11 -0
- package/components/fields-acf-wysiwyg-options-v3/acf-wysiwyg-options-v3.php +221 -0
- package/components/fields-animations-v3/animations-v3.scss +127 -0
- package/components/fields-archive-pages-v3/group_635e777ce46d4.json +150 -0
- package/components/fields-cocktail-info-v3/group_64c29b7f188ca.json +686 -0
- package/components/fields-content-container-settings-v3/content-container-settings-v3.scss +213 -0
- package/components/fields-content-container-v3/content-container-v3.js +96 -0
- package/components/fields-content-container-v3/content-container-v3.scss +31 -0
- package/components/fields-core-critical-v3/core-critical-v3.scss +13 -0
- package/components/fields-core-css-modules-v3/core-css-modules-v3.scss +13 -0
- package/components/fields-core-css-sizing-vars-v3/core-css-sizing-vars-v3.scss +125 -0
- package/components/fields-core-cta-v3/core-cta-v3.scss +276 -0
- package/components/fields-core-functions-v3/core-functions-v3.scss +30 -0
- package/components/fields-core-generic-v3/core-generic-v3.scss +299 -0
- package/components/fields-core-mixins-v3/core-mixins-v3.scss +744 -0
- package/components/fields-core-root-variables-v3/core-root-variables-v3.scss +47 -0
- package/components/fields-core-typography-mixins-v3/core-typography-mixins-v3.scss +1080 -0
- package/components/fields-core-typography-v3/core-typography-v3.scss +457 -0
- package/components/fields-core-wordpress-block-editor-preview-v3/core-wordpress-block-editor-preview-v3.js +270 -0
- package/components/fields-core-wordpress-block-editor-preview-v3/core-wordpress-block-editor-preview-v3.scss +106 -0
- package/components/fields-drink-responsibly-notice-v3/group_68751257883ad.json +266 -0
- package/components/fields-dynamic-critical-css-v3/group_65abcd463e8d0.json +126 -0
- package/components/fields-e-shop-settings-v3/e-shop-settings-v3.twig +87 -0
- package/components/fields-e-shop-settings-v3/group_650b24b4e623d.json +803 -0
- package/components/fields-global-preload-v3/group_65e0bd35e781b.json +289 -0
- package/components/fields-image-management-service-v3/group_677813165b633.json +149 -0
- package/components/fields-ingredients-list/group_6900f19dadebf.json +225 -0
- package/components/fields-modal-popup-content-v3/group_689876f1ee3fc.json +403 -0
- package/components/fields-modal-popup-content-v3/modal-popup-content-v3.twig +18 -0
- package/components/fields-post-info-v3/group_6867bbe167dd2.json +1089 -0
- package/components/fields-product-info-v3/group_689098dd3a131.json +721 -0
- package/components/fields-upload-filesize-limit-v3/group_659d259760a1d.json +56 -0
- package/components/fields-video-management-services-v3/group_67b4cac05cb30.json +146 -0
- package/components/webc-counter-display/counter-display.css +2 -0
- package/components/webc-counter-display/counter-display.html +5 -0
- package/components/webc-counter-display/counter-display.js +30 -0
- package/components/webc-counter-display/index.html +30 -0
- package/components/webc-layout-container/index.html +108 -0
- package/components/webc-layout-container/layout-container.css +9 -0
- package/components/webc-layout-container/layout-container.html +5 -0
- package/components/webc-layout-container/layout-container.js +22 -0
- package/components/webc-loadmore-trigger/index.html +30 -0
- package/components/webc-loadmore-trigger/loadmore-trigger.css +20 -0
- package/components/webc-loadmore-trigger/loadmore-trigger.html +6 -0
- package/components/webc-loadmore-trigger/loadmore-trigger.js +34 -0
- package/components/webc-post-carousel-display-module/index.html +30 -0
- package/components/webc-post-carousel-display-module/post-carousel-display-module.css +36 -0
- package/components/webc-post-carousel-display-module/post-carousel-display-module.html +5 -0
- package/components/webc-post-carousel-display-module/post-carousel-display-module.js +48 -0
- package/components/webc-post-filter-module/dev-content/amber.webp +0 -0
- package/components/webc-post-filter-module/dev-content/bluey.webp +0 -0
- package/components/webc-post-filter-module/dev-content/chucky-vanille.webp +0 -0
- package/components/webc-post-filter-module/dev-content/dev-content.js +347 -0
- package/components/webc-post-filter-module/dev-content/dev-contentlocal.js +362 -0
- package/components/webc-post-filter-module/dev-content/fat-gigio-basket-life.webp +0 -0
- package/components/webc-post-filter-module/dev-content/fat-gigio-kitten.webp +0 -0
- package/components/webc-post-filter-module/dev-content/fat-gigio-sleepy.webp +0 -0
- package/components/webc-post-filter-module/dev-content/kai-lounging.webp +0 -0
- package/components/webc-post-filter-module/dev-content/kai-selfie.webp +0 -0
- package/components/webc-post-filter-module/dev-content/kai.webp +0 -0
- package/components/webc-post-filter-module/dev-content/lulu-mad.webp +0 -0
- package/components/webc-post-filter-module/dev-content/lulu-serious.webp +0 -0
- package/components/webc-post-filter-module/dev-content/martha-on-the-mat.webp +0 -0
- package/components/webc-post-filter-module/dev-content/max-on-the-mat.webp +0 -0
- package/components/webc-post-filter-module/dev-content/mephy-dreams-of-mice.webp +0 -0
- package/components/webc-post-filter-module/dev-content/mr-business-doing-work.webp +0 -0
- package/components/webc-post-filter-module/dev-content/mr-business-on-top.webp +0 -0
- package/components/webc-post-filter-module/dev-content/peanut-keeping-an-eye.webp +0 -0
- package/components/webc-post-filter-module/dev-content/pete-at-work.webp +0 -0
- package/components/webc-post-filter-module/dev-content/pete-bath.webp +0 -0
- package/components/webc-post-filter-module/dev-content/pete-dinosaur.webp +0 -0
- package/components/webc-post-filter-module/dev-content/pete-lawn.webp +0 -0
- package/components/webc-post-filter-module/dev-content/pete-snacks.webp +0 -0
- package/components/webc-post-filter-module/dev-content/ramses-kitten.webp +0 -0
- package/components/webc-post-filter-module/dev-content/ramses-school-day.webp +0 -0
- package/components/webc-post-filter-module/dev-content/ramses-tired.webp +0 -0
- package/components/webc-post-filter-module/dev-content/remy-garden-contemplation.webp +0 -0
- package/components/webc-post-filter-module/dev-content/sky-field.webp +0 -0
- package/components/webc-post-filter-module/dev-content/sky-luxury-2.webp +0 -0
- package/components/webc-post-filter-module/dev-content/sky-luxury.webp +0 -0
- package/components/webc-post-filter-module/dev-content/sky-puppy-good-dog.webp +0 -0
- package/components/webc-post-filter-module/dev-content/sky-puppy-pose.webp +0 -0
- package/components/webc-post-filter-module/dev-content/sky-security.webp +0 -0
- package/components/webc-post-filter-module/dev-content/vanille-asleep.webp +0 -0
- package/components/webc-post-filter-module/dev-content/vanille-bass.webp +0 -0
- package/components/webc-post-filter-module/dev-content/vanille-party.webp +0 -0
- package/components/webc-post-filter-module/dev-content/vanille-puppy-eyes.webp +0 -0
- package/components/webc-post-filter-module/dev-content/vanille-puppy.webp +0 -0
- package/components/webc-post-filter-module/index.html +30 -0
- package/components/webc-post-filter-module/post-filter-module.css +59 -0
- package/components/webc-post-filter-module/post-filter-module.html +13 -0
- package/components/webc-post-filter-module/post-filter-module.js +359 -0
- package/components/webc-post-filter-module-no-group/index.html +30 -0
- package/components/webc-post-filter-module-no-group/post-filter-module-no-group.css +59 -0
- package/components/webc-post-filter-module-no-group/post-filter-module-no-group.html +13 -0
- package/components/webc-post-filter-module-no-group/post-filter-module-no-group.js +312 -0
- package/components/webc-post-grid-display-module/index.html +30 -0
- package/components/webc-post-grid-display-module/post-grid-display-module.css +42 -0
- package/components/webc-post-grid-display-module/post-grid-display-module.html +6 -0
- package/components/webc-post-grid-display-module/post-grid-display-module.js +48 -0
- package/components/webc-ptfg-9000/index.html +108 -0
- package/components/webc-ptfg-9000/ptfg-9000.css +14 -0
- package/components/webc-ptfg-9000/ptfg-9000.html +1 -0
- package/components/webc-ptfg-9000/ptfg-9000.js +42 -0
- package/components/webc-responsive-image/index.html +108 -0
- package/components/webc-responsive-image/layout-container.css +9 -0
- package/components/webc-responsive-image/layout-container.js +22 -0
- package/components/webc-responsive-image/responsive-image.html +15 -0
- package/components/webc-slot-test/slot-test.html +25 -0
- package/components/webc-text-input-trigger/index.html +30 -0
- package/components/webc-text-input-trigger/text-input-trigger.css +6 -0
- package/components/webc-text-input-trigger/text-input-trigger.html +4 -0
- package/components/webc-text-input-trigger/text-input-trigger.js +33 -0
- package/components/webc-toggle-trigger/index.html +30 -0
- package/components/webc-toggle-trigger/toggle-trigger.css +13 -0
- package/components/webc-toggle-trigger/toggle-trigger.html +8 -0
- package/components/webc-toggle-trigger/toggle-trigger.js +53 -0
- package/createDynamicBlockScss-v3.js +25 -0
- package/createJsAssets-v3.js +35 -0
- package/createJsAssets.js +31 -0
- package/createNewBlock.js +131 -0
- package/createNewChildBlock2.js +140 -0
- package/createPreviewScss.js +35 -0
- package/datalayer-tools.mjs +2 -0
- package/duplicateBlock.js +123 -0
- package/esbuild.mjs +87 -0
- package/exportAllBlocks.js +147 -0
- package/exportBlock.js +109 -0
- package/exportChildBlock.js +102 -0
- package/exportCustomCachesToLibrary.js +76 -0
- package/exportEntrypointToLibrary.js +79 -0
- package/exportImagesToLibrary.js +68 -0
- package/exportSEOExtrasToLibrary.js +76 -0
- package/exportToLibrary.js +551 -0
- package/importBlock.js +92 -0
- package/importChildBlock.js +76 -0
- package/install-component.js +204 -0
- package/list-components.js +9 -0
- package/new-block-templates/template-acf-pattern.js +30 -0
- package/new-block-templates/template-block-json.js +37 -0
- package/new-block-templates/template-default.js +24 -0
- package/new-block-templates/template-js-blank.js +12 -0
- package/new-block-templates/template-scss-blank.js +6 -0
- package/no-audio.vtt +4 -0
- package/onion-loader-dev.js +260 -0
- package/onion-loader-local.js +222 -0
- package/onion-loader-v2.js +285 -0
- package/onion-loader.js +14 -22
- package/package.json +1 -9
- package/public/.gitkeep +0 -0
- package/public/assetList.mjs +3 -0
- package/public/block-accent-image-v3/accent-image-v3.css +2 -0
- package/public/block-accent-image-v3/accent-image-v3.js +7 -0
- package/public/block-accordion-v3/accordion-v3.css +380 -0
- package/public/block-accordion-v3/accordion-v3.js +117 -0
- package/public/block-back-to-top-button-v3/back-to-top-button-v3.css +64 -0
- package/public/block-back-to-top-button-v3/back-to-top-button-v3.js +12 -0
- package/public/block-betterreviews-display-v3/betterreviews-display-v3.css +95 -0
- package/public/block-betterreviews-display-v3/betterreviews-display-v3.js +7 -0
- package/public/block-block-interactions-v3/block-interactions-v3.css +36 -0
- package/public/block-block-interactions-v3/block-interactions-v3.js +44 -0
- package/public/block-carousel-multi-layout-v3/carousel-multi-layout-v3.css +187 -0
- package/public/block-carousel-multi-layout-v3/carousel-multi-layout-v3.js +185 -0
- package/public/block-cocktail-recipe-v3/cocktail-recipe-v3.css +268 -0
- package/public/block-cocktail-recipe-v3/cocktail-recipe-v3.js +95 -0
- package/public/block-cover-link-v3/cover-link-v3.css +8 -0
- package/public/block-cover-link-v3/cover-link-v3.js +7 -0
- package/public/block-divider-v3/divider-v3.css +74 -0
- package/public/block-divider-v3/divider-v3.js +7 -0
- package/public/block-featured-image-gallery-v3/featured-image-gallery-v3.css +98 -0
- package/public/block-featured-image-gallery-v3/featured-image-gallery-v3.js +44 -0
- package/public/block-form-selection-v3/form-selection-v3.css +31 -0
- package/public/block-form-selection-v3/form-selection-v3.js +61 -0
- package/public/block-gradient-layer-v3/gradient-layer-v3.css +45 -0
- package/public/block-gradient-layer-v3/gradient-layer-v3.js +7 -0
- package/public/block-group-container-v3/group-container-v3.css +303 -0
- package/public/block-group-container-v3/group-container-v3.js +7 -0
- package/public/block-lottie-content-v3/lottie-content-v3.css +0 -0
- package/public/block-lottie-content-v3/lottie-content-v3.js +25 -0
- package/public/block-market-selector-v3/market-selector-v3.css +136 -0
- package/public/block-market-selector-v3/market-selector-v3.js +7 -0
- package/public/block-modal-form-v3/modal-form-v3.css +0 -0
- package/public/block-modal-form-v3/modal-form-v3.js +48 -0
- package/public/block-nav-menu-container-v3/nav-menu-container-v3.css +3 -0
- package/public/block-nav-menu-container-v3/nav-menu-container-v3.js +7 -0
- package/public/block-post-info-v3/post-info-v3.css +1148 -0
- package/public/block-post-info-v3/post-info-v3.js +7 -0
- package/public/block-post-type-filter-grid-v3/post-type-filter-grid-v3.css +873 -0
- package/public/block-post-type-filter-grid-v3/post-type-filter-grid-v3.js +13 -0
- package/public/block-product-info-v3/product-info-v3.css +846 -0
- package/public/block-product-info-v3/product-info-v3.js +7 -0
- package/public/block-raw-html-v3/raw-html-v3.css +0 -0
- package/public/block-raw-html-v3/raw-html-v3.js +7 -0
- package/public/block-responsive-table-v3/responsive-table-v3.css +50 -0
- package/public/block-responsive-table-v3/responsive-table-v3.js +7 -0
- package/public/block-scrolling-banner-v3/scrolling-banner-v3.css +93 -0
- package/public/block-scrolling-banner-v3/scrolling-banner-v3.js +118 -0
- package/public/block-section-separator-v3/section-separator-v3.css +43 -0
- package/public/block-section-separator-v3/section-separator-v3.js +7 -0
- package/public/block-single-column-container-v3/single-column-container-v3.css +14 -0
- package/public/block-single-column-container-v3/single-column-container-v3.js +7 -0
- package/public/block-single-responsive-image-v3/single-responsive-image-v3.css +61 -0
- package/public/block-single-responsive-image-v3/single-responsive-image-v3.js +7 -0
- package/public/block-site-copyright-notice-v3/site-copyright-notice-v3.css +20 -0
- package/public/block-site-copyright-notice-v3/site-copyright-notice-v3.js +44 -0
- package/public/block-site-logo-container-v3/site-logo-container-v3.css +18 -0
- package/public/block-site-logo-container-v3/site-logo-container-v3.js +7 -0
- package/public/block-site-title-and-tagline-v3/site-title-and-tagline-v3.css +12 -0
- package/public/block-site-title-and-tagline-v3/site-title-and-tagline-v3.js +7 -0
- package/public/block-smash-balloon-social-media-v3/smash-balloon-social-media-v3.css +25 -0
- package/public/block-smash-balloon-social-media-v3/smash-balloon-social-media-v3.js +8 -0
- package/public/block-social-networks-v3/social-networks-v3.css +74 -0
- package/public/block-social-networks-v3/social-networks-v3.js +7 -0
- package/public/block-spacer-v3/spacer-v3.css +16 -0
- package/public/block-spacer-v3/spacer-v3.js +2 -0
- package/public/block-spotify-embed-v3/spotify-embed-v3.css +7 -0
- package/public/block-spotify-embed-v3/spotify-embed-v3.js +7 -0
- package/public/block-standard-content-v3/standard-content-v3.css +423 -0
- package/public/block-standard-content-v3/standard-content-v3.js +7 -0
- package/public/block-sticky-buy-cta-v3/sticky-buy-cta-v3.css +0 -0
- package/public/block-sticky-buy-cta-v3/sticky-buy-cta-v3.js +7 -0
- package/public/block-sub-group-container-v3/sub-group-container-v3.css +288 -0
- package/public/block-sub-group-container-v3/sub-group-container-v3.js +2 -0
- package/public/block-video-content-v3/video-content-v3.css +102 -0
- package/public/block-video-content-v3/video-content-v3.js +11 -0
- package/public/dynamicBlockScss-v3.css +6392 -0
- package/public/dynamicBlockScss-v3.scss +37 -0
- package/public/jsAssets.mjs +4 -0
- package/public/publicBundleBase.css +4742 -0
- package/public/publicBundleBase.scss +11 -0
- package/removeBlock.js +124 -0
- package/update-all-components.js +96 -0
- package/update-component.js +538 -0
- package/update-template.js +538 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import * as glob from 'glob';
|
|
3
|
+
import yargs from 'yargs/yargs';
|
|
4
|
+
|
|
5
|
+
let projectName = 'Global Theme';
|
|
6
|
+
const libraryPath = './node_modules/@total_onion/onion-library';
|
|
7
|
+
const projectJson = JSON.parse(fs.readFileSync('./package.json'));
|
|
8
|
+
if (projectJson) {
|
|
9
|
+
projectName = projectJson.name;
|
|
10
|
+
if (projectName.slice(0, 3) === 'the') {
|
|
11
|
+
const prefix =
|
|
12
|
+
projectName.slice(0, 3).charAt(0).toUpperCase() +
|
|
13
|
+
projectName.slice(0, 3).slice(1);
|
|
14
|
+
projectName = `${prefix} ${
|
|
15
|
+
projectName.slice(3).charAt(0).toUpperCase() +
|
|
16
|
+
projectName.slice(3).slice(1)
|
|
17
|
+
}`;
|
|
18
|
+
} else {
|
|
19
|
+
projectName = `${
|
|
20
|
+
projectName.charAt(0).toUpperCase() + projectName.slice(1)
|
|
21
|
+
}`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const componentName = process.argv[2]?.toLocaleLowerCase();
|
|
26
|
+
|
|
27
|
+
if (!componentName) {
|
|
28
|
+
console.log(
|
|
29
|
+
'\x1b[35m',
|
|
30
|
+
'Hmmm that failed.. Did you forget to include the component name?'
|
|
31
|
+
);
|
|
32
|
+
process.exit();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let componentType = 'block';
|
|
36
|
+
let componentModuleName = componentName.substring(6);
|
|
37
|
+
if (componentName.split('-')[0] === 'fields') {
|
|
38
|
+
componentType = 'fields';
|
|
39
|
+
componentModuleName = componentName.substring(7);
|
|
40
|
+
}
|
|
41
|
+
if (componentName.split('-')[0] === 'admin') {
|
|
42
|
+
componentType = 'admin';
|
|
43
|
+
componentModuleName = componentName.substring(6);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function globGetFileNames(path, filetype, removeExt = false) {
|
|
47
|
+
const pathPlusExt = `${path}*.${filetype}`;
|
|
48
|
+
const points = glob.sync(pathPlusExt).map((fullPath) => {
|
|
49
|
+
let assetKey = fullPath.replace(path, '');
|
|
50
|
+
if (removeExt === true) {
|
|
51
|
+
assetKey = assetKey.replace(`.${filetype}`, '');
|
|
52
|
+
}
|
|
53
|
+
return assetKey;
|
|
54
|
+
});
|
|
55
|
+
return points;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const dynamicEntryPointsJs = globGetFileNames(
|
|
59
|
+
'./web/wp-content/themes/global-theme/assets/js/blocks/',
|
|
60
|
+
'js',
|
|
61
|
+
true
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const dynamicEntryPointsAcfJson = globGetFileNames(
|
|
65
|
+
'./web/wp-content/themes/global-theme/acf-json/',
|
|
66
|
+
'json'
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
let componentAcf = globGetFileNames(
|
|
70
|
+
`${libraryPath}/components/${componentName}/`,
|
|
71
|
+
'json'
|
|
72
|
+
)[0];
|
|
73
|
+
|
|
74
|
+
if (componentType === 'fields') {
|
|
75
|
+
if (dynamicEntryPointsAcfJson.indexOf(componentAcf) !== -1) {
|
|
76
|
+
console.log(
|
|
77
|
+
'\x1b[33m',
|
|
78
|
+
`Oh oh! It looks like you already have a field group called "${componentName}". If you want to overwrite it with the latest version then try "yarn update-component ${componentName}"`
|
|
79
|
+
);
|
|
80
|
+
process.exit();
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
if (dynamicEntryPointsJs.indexOf(componentName) !== -1) {
|
|
84
|
+
console.log(
|
|
85
|
+
'\x1b[33m',
|
|
86
|
+
`Oh oh! It looks like you already have a block called ${componentName}. If you want to overwrite it with the latest version then try "yarn update-component ${componentName}"`
|
|
87
|
+
);
|
|
88
|
+
process.exit();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (
|
|
93
|
+
fs.existsSync(
|
|
94
|
+
`${libraryPath}/components/${componentName}/${componentModuleName}.js`
|
|
95
|
+
)
|
|
96
|
+
) {
|
|
97
|
+
if (componentType === 'fields') {
|
|
98
|
+
if (
|
|
99
|
+
!fs.existsSync(
|
|
100
|
+
`./web/wp-content/themes/global-theme/assets/js/modules/library-modules/${componentModuleName}`
|
|
101
|
+
)
|
|
102
|
+
) {
|
|
103
|
+
console.log('making the folder');
|
|
104
|
+
fs.mkdirSync(
|
|
105
|
+
`./web/wp-content/themes/global-theme/assets/js/modules/library-modules/${componentModuleName}`
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
fs.copyFileSync(
|
|
109
|
+
`${libraryPath}/components/${componentName}/${componentModuleName}.js`,
|
|
110
|
+
`./web/wp-content/themes/global-theme/assets/js/modules/library-modules/${componentModuleName}/${componentModuleName}.js`
|
|
111
|
+
);
|
|
112
|
+
} else {
|
|
113
|
+
fs.copyFileSync(
|
|
114
|
+
`${libraryPath}/components/${componentName}/${componentModuleName}.js`,
|
|
115
|
+
`./web/wp-content/themes/global-theme/assets/js/blocks/${componentModuleName}.js`
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (
|
|
121
|
+
fs.existsSync(
|
|
122
|
+
`${libraryPath}/components/${componentName}/${componentModuleName}.scss`
|
|
123
|
+
)
|
|
124
|
+
) {
|
|
125
|
+
if (componentType === 'fields') {
|
|
126
|
+
if (
|
|
127
|
+
!fs.existsSync(
|
|
128
|
+
`./web/wp-content/themes/global-theme/assets/scss/modules/library-modules/${componentModuleName}`
|
|
129
|
+
)
|
|
130
|
+
) {
|
|
131
|
+
console.log('making the folder');
|
|
132
|
+
fs.mkdirSync(
|
|
133
|
+
`./web/wp-content/themes/global-theme/assets/scss/modules/library-modules/${componentModuleName}`
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
fs.copyFileSync(
|
|
137
|
+
`${libraryPath}/components/${componentName}/${componentModuleName}.scss`,
|
|
138
|
+
`./web/wp-content/themes/global-theme/assets/scss/modules/library-modules/${componentModuleName}/${componentModuleName}.scss`
|
|
139
|
+
);
|
|
140
|
+
} else {
|
|
141
|
+
fs.copyFileSync(
|
|
142
|
+
`${libraryPath}/components/${componentName}/${componentModuleName}.scss`,
|
|
143
|
+
`./web/wp-content/themes/global-theme/assets/scss/blocks/${componentModuleName}.scss`
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (
|
|
149
|
+
fs.existsSync(
|
|
150
|
+
`${libraryPath}/components/${componentName}/${componentModuleName}.php`
|
|
151
|
+
)
|
|
152
|
+
) {
|
|
153
|
+
if (
|
|
154
|
+
componentType === 'admin' ||
|
|
155
|
+
componentType === 'fields' ||
|
|
156
|
+
componentType === 'core'
|
|
157
|
+
) {
|
|
158
|
+
fs.copyFileSync(
|
|
159
|
+
`${libraryPath}/components/${componentName}/${componentModuleName}.php`,
|
|
160
|
+
`./web/wp-content/themes/global-theme/inc/custom-extras/${componentModuleName}.php`
|
|
161
|
+
);
|
|
162
|
+
} else if (componentType === 'core') {
|
|
163
|
+
fs.copyFileSync(
|
|
164
|
+
`${libraryPath}/components/${componentName}/${componentModuleName}.php`,
|
|
165
|
+
`./web/wp-content/themes/global-theme/inc/project-setup/core-functions/${componentModuleName}.php`
|
|
166
|
+
);
|
|
167
|
+
} else {
|
|
168
|
+
fs.copyFileSync(
|
|
169
|
+
`${libraryPath}/components/${componentName}/${componentModuleName}.php`,
|
|
170
|
+
`./web/wp-content/themes/global-theme/inc/acf-blocks/${componentModuleName}.php`
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (
|
|
176
|
+
fs.existsSync(
|
|
177
|
+
`${libraryPath}/components/${componentName}/${componentModuleName}.cy.js`
|
|
178
|
+
)
|
|
179
|
+
) {
|
|
180
|
+
fs.copyFileSync(
|
|
181
|
+
`${libraryPath}/components/${componentName}/${componentModuleName}.cy.js`,
|
|
182
|
+
`./cypress/e2e/components/${componentModuleName}.cy.js`
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
import('cpy').then((result) => {
|
|
187
|
+
const cpy = result.default;
|
|
188
|
+
|
|
189
|
+
cpy(
|
|
190
|
+
`${libraryPath}/components/${componentName}/*.json`,
|
|
191
|
+
`./web/wp-content/themes/global-theme/acf-json/`
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
let twigPath = `./web/wp-content/themes/global-theme/views/blocks/`;
|
|
195
|
+
if (componentName.substring(0, 6) === 'fields') {
|
|
196
|
+
twigPath = `./web/wp-content/themes/global-theme/views/components/`;
|
|
197
|
+
}
|
|
198
|
+
cpy(`${libraryPath}/components/${componentName}/*.twig`, twigPath);
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
console.log(
|
|
202
|
+
'\x1b[32m',
|
|
203
|
+
`👑 👑 👑 Hurrah! You installed a component called ${componentName} 👑 👑 👑`
|
|
204
|
+
);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as glob from 'glob';
|
|
2
|
+
const libraryPath =
|
|
3
|
+
'./node_modules/@total_onion/onion-library'
|
|
4
|
+
|
|
5
|
+
const componentsList = glob.sync(`${libraryPath}/components/*`).map((path) => {
|
|
6
|
+
const assetKey = path.replace(`${libraryPath}/components/`, '');
|
|
7
|
+
return assetKey;
|
|
8
|
+
});
|
|
9
|
+
console.log('The list of available components is', componentsList);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default function templateAcfPattern(newBlockName, projectName) {
|
|
2
|
+
const blockTitle =
|
|
3
|
+
newBlockName.charAt(0).toUpperCase() +
|
|
4
|
+
newBlockName.slice(1).replaceAll('-', ' ');
|
|
5
|
+
const namespace = projectName.toLowerCase().replaceAll(' ', '-');
|
|
6
|
+
|
|
7
|
+
return `<?php
|
|
8
|
+
/**
|
|
9
|
+
* ${blockTitle}
|
|
10
|
+
*/
|
|
11
|
+
add_action('acf/init', function () {
|
|
12
|
+
if (function_exists('acf_register_block_type')) {
|
|
13
|
+
acf_register_block_type([
|
|
14
|
+
'name' => '${newBlockName}',
|
|
15
|
+
'title' => '${blockTitle}',
|
|
16
|
+
'description' => '${blockTitle}',
|
|
17
|
+
'render_template' => get_template_directory() . '/views/blocks/${newBlockName}.twig',
|
|
18
|
+
'category' => 'project-blocks',
|
|
19
|
+
'icon' => 'editor-code',
|
|
20
|
+
'supports' => [
|
|
21
|
+
'align' => false,
|
|
22
|
+
'anchor' => true,
|
|
23
|
+
],
|
|
24
|
+
'enqueue_style' => get_template_directory_uri() . '/assets/scss/blocks/${newBlockName}.css',
|
|
25
|
+
'enqueue_script' => get_template_directory_uri() . '/assets/js/blocks/${newBlockName}.js',
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export default function (newBlockName, projectName) {
|
|
2
|
+
const blockTitle =
|
|
3
|
+
newBlockName.charAt(0).toUpperCase() +
|
|
4
|
+
newBlockName.slice(1).replaceAll('-', ' ');
|
|
5
|
+
const namespace = projectName.toLowerCase().replaceAll(' ', '-');
|
|
6
|
+
|
|
7
|
+
return `{
|
|
8
|
+
"$schema": "https://schemas.wp.org/trunk/block.json",
|
|
9
|
+
"apiVersion": 3,
|
|
10
|
+
"name": "acf/${newBlockName}",
|
|
11
|
+
"title": "${blockTitle}",
|
|
12
|
+
"category": "project-blocks",
|
|
13
|
+
"description": "${blockTitle} block",
|
|
14
|
+
"icon": "green-brick",
|
|
15
|
+
"keywords": ["content"],
|
|
16
|
+
"version": "1.0.0",
|
|
17
|
+
"textdomain": "${namespace}",
|
|
18
|
+
"acf": {
|
|
19
|
+
"mode": "preview",
|
|
20
|
+
"renderCallback": "core_block_render_post_object_v3",
|
|
21
|
+
"blockVersion": 3
|
|
22
|
+
},
|
|
23
|
+
"supports": {
|
|
24
|
+
"align": false,
|
|
25
|
+
"anchor": true,
|
|
26
|
+
"jsx": true
|
|
27
|
+
},
|
|
28
|
+
"example": {
|
|
29
|
+
"attributes": {
|
|
30
|
+
"mode": "preview",
|
|
31
|
+
"data": {
|
|
32
|
+
"is_example": true
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}`;
|
|
37
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const defaultjs = function (newBlockName) {
|
|
2
|
+
return `export default function ${newBlockName.replaceAll(
|
|
3
|
+
'-',
|
|
4
|
+
''
|
|
5
|
+
)}Js ( options = {} ) {
|
|
6
|
+
try {
|
|
7
|
+
const { block } = options;
|
|
8
|
+
} catch ( error ) {
|
|
9
|
+
console.error( error );
|
|
10
|
+
}
|
|
11
|
+
}`;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const defaultscss = function (newBlockName) {
|
|
15
|
+
return `// @use 'NodeModules/@total_onion/onion-library/components/fields-core-mixins-v3/core-mixins-v3';
|
|
16
|
+
// @use 'NodeModules/@total_onion/onion-library/components/fields-core-functions-v3/core-functions-v3';
|
|
17
|
+
// @use 'NodeModules/@total_onion/onion-library/breakpoints';
|
|
18
|
+
.${newBlockName} {
|
|
19
|
+
}`;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default { defaultjs, defaultscss };
|
|
23
|
+
export { defaultjs, defaultscss };
|
|
24
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export default function templateScssBlank(newBlockName) {
|
|
2
|
+
return `// @use 'NodeModules/@total_onion/onion-library/components/fields-core-mixins-v3/core-mixins-v3';
|
|
3
|
+
// @use 'NodeModules/@total_onion/onion-library/components/fields-core-functions-v3/core-functions-v3';
|
|
4
|
+
// @use 'NodeModules/@total_onion/onion-library/breakpoints';
|
|
5
|
+
.${newBlockName} {}`;
|
|
6
|
+
}
|
package/no-audio.vtt
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import jsAssetList from "./jsAssets.mjs";
|
|
2
|
+
const fallbackAssetArray = jsAssetList.dynamicAssets;
|
|
3
|
+
/* eslint-disable no-use-before-define */
|
|
4
|
+
/* eslint-disable no-console */
|
|
5
|
+
|
|
6
|
+
//*** Lazyloader ***//
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The options object for the lazyloader.
|
|
10
|
+
* @type {object}
|
|
11
|
+
* @property {string} rootMargin The root margin for the IntersectionObserver.
|
|
12
|
+
* @default '0% 0% 0%'
|
|
13
|
+
* @property {number} threshold The threshold for the IntersectionObserver.
|
|
14
|
+
* @property {boolean} debugLogMessages Whether to log debug messages.
|
|
15
|
+
* @property {array} lazyBlocksToSearchFor The array of lazy blocks to search for.
|
|
16
|
+
* @property {array} lazyBlocksFound The array of lazy blocks found.
|
|
17
|
+
* @property {array} assetArray The array of assets to load.
|
|
18
|
+
* @property {object} assetMap The asset map object.
|
|
19
|
+
* @property {boolean} ignoreCss Whether to ignore the css.
|
|
20
|
+
* @property {boolean} lazy Whether to lazy load the assets (after Assets alias).
|
|
21
|
+
* @property {string} filePath The file path for the js assets.
|
|
22
|
+
* @default 'js/blocks/'
|
|
23
|
+
* @property {string} filePathCss The file path for the css assets (after Assets alias).
|
|
24
|
+
* @default 'scss/blocks/'
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
const options = {
|
|
28
|
+
rootMargin: "100% 0px 300px 0px",
|
|
29
|
+
threshold: 0,
|
|
30
|
+
debugLogMessages: false,
|
|
31
|
+
lazyBlocksToSearchFor: [],
|
|
32
|
+
lazyBlocksFound: [],
|
|
33
|
+
assetArray: fallbackAssetArray, //latest assetArray can be found in /@total_onion/onion-library/public/jsAssets.mjs
|
|
34
|
+
assetMap: {},
|
|
35
|
+
css: true,
|
|
36
|
+
lazy: true,
|
|
37
|
+
cssLoadingStyle: "component", // 'component' or 'bundle'
|
|
38
|
+
filePrefix: "dev", //'nodemodules', 'assets' or 'dev'
|
|
39
|
+
fileSuffixJs: ".js",
|
|
40
|
+
fileSuffixCss: ".scss",
|
|
41
|
+
filePath: "js/blocks",
|
|
42
|
+
filePathCss: "scss/blocks",
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Initializes the lazyloader.
|
|
47
|
+
*/
|
|
48
|
+
function lazyloaderInit() {
|
|
49
|
+
options.debugLogMessages && console.log("Lazy Loader initialized!");
|
|
50
|
+
options.lazyBlocksToSearchFor = [];
|
|
51
|
+
options.assetArray.forEach((asset) => {
|
|
52
|
+
// if (options.filePrefix === "nodemodules") {
|
|
53
|
+
// options.assetMap[asset.assetKey] = {
|
|
54
|
+
// js: () =>
|
|
55
|
+
// import(
|
|
56
|
+
// `NodeModules/@total_onion/onion-library/components/block-${asset.assetKey}/${asset.assetKey}${options.fileSuffixJs}`
|
|
57
|
+
// ),
|
|
58
|
+
// css: options.ignoreCss === true,
|
|
59
|
+
// };
|
|
60
|
+
// }
|
|
61
|
+
// if (options.filePrefix === "assets") {
|
|
62
|
+
// options.assetMap[asset.assetKey] = {
|
|
63
|
+
// js: () => import(`Assets/${this.options.filePath}/${asset.assetKey}`),
|
|
64
|
+
// css: options.ignoreCss === false,
|
|
65
|
+
// };
|
|
66
|
+
// }
|
|
67
|
+
|
|
68
|
+
if (options.filePrefix === "dev") {
|
|
69
|
+
options.assetMap[asset.assetKey] = {
|
|
70
|
+
js: () =>
|
|
71
|
+
import(
|
|
72
|
+
`../../../../../../../../onion-library/components/block-${asset.assetKey}/${asset.assetKey}${options.fileSuffixJs}`
|
|
73
|
+
),
|
|
74
|
+
css: options.ignoreCss === true,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Add to lazy blocks to search for
|
|
79
|
+
options.lazyBlocksToSearchFor.push(`[data-assetkey="${asset.assetKey}"]`);
|
|
80
|
+
options.lazyBlocksFound = Array.from(
|
|
81
|
+
document.querySelectorAll(options.lazyBlocksToSearchFor)
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// If data eager loading attribute is true - load js straight away
|
|
86
|
+
options.lazyBlocksFound.forEach((block) => {
|
|
87
|
+
if (block.dataset.eager == "true") {
|
|
88
|
+
callBlockJs(block);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
options.debugLogMessages && console.log("Lazyloader Options", options);
|
|
93
|
+
|
|
94
|
+
// Check if the browser has intersection observer which is needed for the Lazyloader or if all assets should load immediately anyway.
|
|
95
|
+
if (options.lazy === false || !("IntersectionObserver" in window)) {
|
|
96
|
+
options.debugLogMessages && console.log("running eager loading");
|
|
97
|
+
try {
|
|
98
|
+
options.lazyBlocksFound.forEach((block) => {
|
|
99
|
+
callBlockJs(block);
|
|
100
|
+
});
|
|
101
|
+
} catch (error) {
|
|
102
|
+
console.log(error);
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
options.debugLogMessages && console.log("running normal process");
|
|
106
|
+
observerInit(options.lazyBlocksFound);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Initializes the IntersectionObserver for the lazy loading of blocks.
|
|
112
|
+
* @param {array} elementsToObserve The array of block elements to observe.
|
|
113
|
+
*/
|
|
114
|
+
function observerInit(elementsToObserve = []) {
|
|
115
|
+
const observer = new IntersectionObserver(intersectionCallback, options);
|
|
116
|
+
elementsToObserve.forEach((element) => {
|
|
117
|
+
if (element) {
|
|
118
|
+
observer.observe(element);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Callback function for the IntersectionObserver.
|
|
125
|
+
* @param {array} entries The entries array from the IntersectionObserver.
|
|
126
|
+
* @param {object} observer The IntersectionObserver object.
|
|
127
|
+
*/
|
|
128
|
+
const intersectionCallback = (entries, observer) => {
|
|
129
|
+
options.debugLogMessages && console.log("Observer entries", entries);
|
|
130
|
+
entries.forEach((entry) => {
|
|
131
|
+
if (entry.isIntersecting) {
|
|
132
|
+
const lazyTarget = entry.target;
|
|
133
|
+
try {
|
|
134
|
+
callBlockJs(lazyTarget);
|
|
135
|
+
} catch (error) {
|
|
136
|
+
console.log(
|
|
137
|
+
error,
|
|
138
|
+
"block data assetkey:",
|
|
139
|
+
lazyTarget.dataset.assetkey,
|
|
140
|
+
" - ",
|
|
141
|
+
"asset import function:",
|
|
142
|
+
options.assetMap[lazyTarget.dataset.assetkey],
|
|
143
|
+
"are you missing an asset key or import function?"
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
observer.unobserve(lazyTarget);
|
|
147
|
+
options.debugLogMessages &&
|
|
148
|
+
console.log("Unobserving lazyElement", lazyTarget);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Calls the block asset functions and adds the loaded class to the block.
|
|
155
|
+
* @param {object} block The block element.
|
|
156
|
+
*/
|
|
157
|
+
function callBlockJs(block) {
|
|
158
|
+
if (!block.classList.contains("loaded")) {
|
|
159
|
+
Promise.all([
|
|
160
|
+
options.assetMap[block.dataset.assetkey].js(),
|
|
161
|
+
loadCss(block.dataset.assetkey),
|
|
162
|
+
]).then((module) => {
|
|
163
|
+
try {
|
|
164
|
+
if (block.dataset.jsload !== "false") {
|
|
165
|
+
module[0].default({
|
|
166
|
+
block,
|
|
167
|
+
css: false,
|
|
168
|
+
});
|
|
169
|
+
} else {
|
|
170
|
+
options.debugLogMessages &&
|
|
171
|
+
console.log(
|
|
172
|
+
`Skipping JS load for block: ${block.dataset.assetkey}`
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
block.classList.add("loaded");
|
|
176
|
+
} catch (error) {
|
|
177
|
+
console.log("could not load block js", error);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Checks to see if the css for the block has already been included in the 'criticalconfig' window object.
|
|
185
|
+
* Will return true if it is.
|
|
186
|
+
* @param {string} assetKey The assetkey string of the block.
|
|
187
|
+
* @returns {boolean}
|
|
188
|
+
*/
|
|
189
|
+
export function inCriticalCssConfig(assetKey) {
|
|
190
|
+
if (!globalThis.criticalConfig) {
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
if (
|
|
194
|
+
globalThis.criticalConfig &&
|
|
195
|
+
globalThis.criticalConfig.indexOf(assetKey) === -1
|
|
196
|
+
) {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Dynamically loads the css for the block if it has not already been included in critical css or the css property is set to false.
|
|
204
|
+
* @param {string} assetKey The assetkey string of the block.
|
|
205
|
+
* @param {object} options The options object which will at the very least contain the css property set to true.
|
|
206
|
+
* @returns {promise}
|
|
207
|
+
*/
|
|
208
|
+
export function loadCss(assetKey) {
|
|
209
|
+
// if (options.css == true && options.cssLoadingStyle === "bundle") {
|
|
210
|
+
// options.debugLogMessages && console.log("using css bundle");
|
|
211
|
+
// const promise = new Promise((resolve) => {
|
|
212
|
+
// import(
|
|
213
|
+
// `NodeModules/@total_onion/onion-library/public/publicbundlecss.css`
|
|
214
|
+
// ).then(() => {
|
|
215
|
+
// console.log("resolved");
|
|
216
|
+
// resolve(true);
|
|
217
|
+
// });
|
|
218
|
+
// });
|
|
219
|
+
// return promise;
|
|
220
|
+
// }
|
|
221
|
+
// if (
|
|
222
|
+
// options.css == true &&
|
|
223
|
+
// options.cssLoadingStyle === "component" &&
|
|
224
|
+
// options.filePrefix === "nodemodules"
|
|
225
|
+
// ) {
|
|
226
|
+
// options.debugLogMessages && console.log("using individual css");
|
|
227
|
+
// const promise = new Promise((resolve) => {
|
|
228
|
+
// if (options.css === true && !inCriticalCssConfig(assetKey)) {
|
|
229
|
+
// import(
|
|
230
|
+
// /* webpackChunkName: "[request]" */ `NodeModules/@total_onion/onion-library/components/block-${assetKey}/${assetKey}${options.fileSuffixCss}`
|
|
231
|
+
// ).then(() => resolve(true));
|
|
232
|
+
// } else {
|
|
233
|
+
// return resolve(true);
|
|
234
|
+
// }
|
|
235
|
+
// });
|
|
236
|
+
// }
|
|
237
|
+
if (
|
|
238
|
+
options.css == true &&
|
|
239
|
+
options.cssLoadingStyle === "component" &&
|
|
240
|
+
options.filePrefix === "dev"
|
|
241
|
+
) {
|
|
242
|
+
options.debugLogMessages && console.log("using dev css");
|
|
243
|
+
const promise = new Promise((resolve) => {
|
|
244
|
+
if (options.css === true && !inCriticalCssConfig(assetKey)) {
|
|
245
|
+
import(
|
|
246
|
+
`../../../../../../../../onion-library/components/block-${assetKey}/${assetKey}${options.fileSuffixCss}`
|
|
247
|
+
).then(() => resolve(true));
|
|
248
|
+
} else {
|
|
249
|
+
return resolve(true);
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
const api = {
|
|
256
|
+
lazyloaderInit,
|
|
257
|
+
options,
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
export default api;
|