@total_onion/onion-library 2.0.145 → 2.0.147

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/assembleAssetList.js +10 -3
  2. package/build-library.js +4 -0
  3. package/components/block-back-to-top-button-v3/back-to-top-button-v3.scss +3 -3
  4. package/components/block-carousel-multi-layout-v3/carousel-multi-layout-v3.scss +1 -1
  5. package/components/block-cocktail-recipe-v3/cocktail-recipe-v3.scss +5 -5
  6. package/components/block-raw-html-v3/raw-html-v3.js +0 -0
  7. package/components/block-raw-html-v3/raw-html-v3.scss +0 -0
  8. package/components/block-raw-html-v3/raw-html-v3.twig +14 -0
  9. package/components/component-text-editor-settings-v3/group_687a4e2334e37.json +241 -196
  10. package/createDynamicBlockScss-v3.js +8 -13
  11. package/esbuild.mjs +15 -1
  12. package/package.json +1 -1
  13. package/public/assetList.mjs +2 -36
  14. package/public/block-accent-image-v3/accent-image-v3.js +7 -0
  15. package/public/block-accordion-v3/accordion-v3.js +117 -0
  16. package/public/block-back-to-top-button-v3/back-to-top-button-v3.css +62 -0
  17. package/public/block-back-to-top-button-v3/back-to-top-button-v3.js +12 -0
  18. package/public/block-betterreviews-display-v3/betterreviews-display-v3.js +7 -0
  19. package/public/block-block-interactions-v3/block-interactions-v3.js +44 -0
  20. package/public/block-carousel-multi-layout-v3/carousel-multi-layout-v3.js +169 -0
  21. package/public/block-cocktail-recipe-v3/cocktail-recipe-v3.css +317 -0
  22. package/public/block-cocktail-recipe-v3/cocktail-recipe-v3.js +93 -0
  23. package/public/block-cover-link-v3/cover-link-v3.js +7 -0
  24. package/public/block-divider-v3/divider-v3.js +7 -0
  25. package/public/block-featured-image-gallery-v3/featured-image-gallery-v3.js +44 -0
  26. package/public/block-form-selection-v3/form-selection-v3.js +61 -0
  27. package/public/block-gradient-layer-v3/gradient-layer-v3.js +7 -0
  28. package/public/block-group-container-v3/group-container-v3.js +7 -0
  29. package/public/block-lottie-content-v3/lottie-content-v3.js +25 -0
  30. package/public/block-market-selector-v3/market-selector-v3.js +7 -0
  31. package/public/block-modal-form-v3/modal-form-v3.js +44 -0
  32. package/public/block-nav-menu-container-v3/nav-menu-container-v3.js +7 -0
  33. package/public/block-post-info-v3/post-info-v3.js +7 -0
  34. package/public/block-post-type-filter-grid-v3/post-type-filter-grid-v3.css +1 -0
  35. package/public/block-post-type-filter-grid-v3/post-type-filter-grid-v3.js +13 -0
  36. package/public/block-product-info-v3/product-info-v3.js +7 -0
  37. package/public/block-responsive-table-v3/responsive-table-v3.js +7 -0
  38. package/public/block-scrolling-banner-v3/scrolling-banner-v3.js +106 -0
  39. package/public/block-section-separator-v3/section-separator-v3.js +7 -0
  40. package/public/block-single-column-container-v3/single-column-container-v3.js +7 -0
  41. package/public/block-single-responsive-image-v3/single-responsive-image-v3.js +7 -0
  42. package/public/block-site-copyright-notice-v3/site-copyright-notice-v3.js +7 -0
  43. package/public/block-site-logo-container-v3/site-logo-container-v3.js +7 -0
  44. package/public/block-site-title-and-tagline-v3/site-title-and-tagline-v3.js +7 -0
  45. package/public/block-smash-balloon-social-media-v3/smash-balloon-social-media-v3.js +8 -0
  46. package/public/block-social-networks-v3/social-networks-v3.js +7 -0
  47. package/public/block-spacer-v3/spacer-v3.js +2 -0
  48. package/public/block-spotify-embed-v3/spotify-embed-v3.js +7 -0
  49. package/public/block-standard-content-v3/standard-content-v3.js +7 -0
  50. package/public/block-sticky-buy-cta-v3/sticky-buy-cta-v3.js +7 -0
  51. package/public/block-sub-group-container-v3/sub-group-container-v3.js +2 -0
  52. package/public/block-video-content-v3/video-content-v3.js +11 -0
  53. package/public/components/block-accent-image-v3/accent-image-v3.css +0 -0
  54. package/public/components/block-accent-image-v3/accent-image-v3.js +7 -0
  55. package/public/components/block-accordion-v3/accordion-v3.css +474 -0
  56. package/public/components/block-accordion-v3/accordion-v3.js +117 -0
  57. package/public/components/block-back-to-top-button-v3/back-to-top-button-v3.css +62 -0
  58. package/public/components/block-back-to-top-button-v3/back-to-top-button-v3.js +12 -0
  59. package/public/components/block-betterreviews-display-v3/betterreviews-display-v3.css +96 -0
  60. package/public/components/block-betterreviews-display-v3/betterreviews-display-v3.js +7 -0
  61. package/public/components/block-block-interactions-v3/block-interactions-v3.css +34 -0
  62. package/public/components/block-block-interactions-v3/block-interactions-v3.js +44 -0
  63. package/public/components/block-carousel-multi-layout-v3/carousel-multi-layout-v3.css +928 -0
  64. package/public/components/block-carousel-multi-layout-v3/carousel-multi-layout-v3.js +169 -0
  65. package/public/components/block-cocktail-recipe-v3/cocktail-recipe-v3.css +317 -0
  66. package/public/components/block-cocktail-recipe-v3/cocktail-recipe-v3.js +93 -0
  67. package/public/components/block-cover-link-v3/cover-link-v3.css +0 -0
  68. package/public/components/block-cover-link-v3/cover-link-v3.js +7 -0
  69. package/public/components/block-divider-v3/divider-v3.css +74 -0
  70. package/public/components/block-divider-v3/divider-v3.js +7 -0
  71. package/public/components/block-featured-image-gallery-v3/featured-image-gallery-v3.css +102 -0
  72. package/public/components/block-featured-image-gallery-v3/featured-image-gallery-v3.js +44 -0
  73. package/public/components/block-form-selection-v3/form-selection-v3.css +32 -0
  74. package/public/components/block-form-selection-v3/form-selection-v3.js +61 -0
  75. package/public/components/block-gradient-layer-v3/gradient-layer-v3.css +52 -0
  76. package/public/components/block-gradient-layer-v3/gradient-layer-v3.js +7 -0
  77. package/public/components/block-group-container-v3/group-container-v3.css +323 -0
  78. package/public/components/block-group-container-v3/group-container-v3.js +7 -0
  79. package/public/components/block-lottie-content-v3/lottie-content-v3.css +0 -0
  80. package/public/components/block-lottie-content-v3/lottie-content-v3.js +25 -0
  81. package/public/components/block-market-selector-v3/market-selector-v3.css +139 -0
  82. package/public/components/block-market-selector-v3/market-selector-v3.js +7 -0
  83. package/public/components/block-modal-form-v3/modal-form-v3.css +0 -0
  84. package/public/components/block-modal-form-v3/modal-form-v3.js +44 -0
  85. package/public/components/block-modal-form-v3/modal-form-v3.scss.css +0 -0
  86. package/public/components/block-nav-menu-container-v3/nav-menu-container-v3.css +3 -0
  87. package/public/components/block-nav-menu-container-v3/nav-menu-container-v3.js +7 -0
  88. package/public/components/block-post-info-v3/post-info-v3.css +1310 -0
  89. package/public/components/block-post-info-v3/post-info-v3.js +7 -0
  90. package/public/components/block-post-info-v3/post-info-v3.scss.css +1310 -0
  91. package/public/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3.css +859 -0
  92. package/public/components/block-post-type-filter-grid-v3/post-type-filter-grid-v3.js +13 -0
  93. package/public/components/block-product-info-v3/product-info-v3.css +993 -0
  94. package/public/components/block-product-info-v3/product-info-v3.js +7 -0
  95. package/public/components/block-product-info-v3/product-info-v3.scss.css +993 -0
  96. package/public/components/block-responsive-table-v3/responsive-table-v3.css +48 -0
  97. package/public/components/block-responsive-table-v3/responsive-table-v3.js +7 -0
  98. package/public/components/block-scrolling-banner-v3/scrolling-banner-v3.css +85 -0
  99. package/public/components/block-scrolling-banner-v3/scrolling-banner-v3.js +106 -0
  100. package/public/components/block-section-separator-v3/section-separator-v3.css +43 -0
  101. package/public/components/block-section-separator-v3/section-separator-v3.js +7 -0
  102. package/public/components/block-single-column-container-v3/single-column-container-v3.css +14 -0
  103. package/public/components/block-single-column-container-v3/single-column-container-v3.js +7 -0
  104. package/public/components/block-single-responsive-image-v3/single-responsive-image-v3.css +60 -0
  105. package/public/components/block-single-responsive-image-v3/single-responsive-image-v3.js +7 -0
  106. package/public/components/block-site-copyright-notice-v3/site-copyright-notice-v3.css +0 -0
  107. package/public/components/block-site-copyright-notice-v3/site-copyright-notice-v3.js +7 -0
  108. package/public/components/block-site-logo-container-v3/site-logo-container-v3.css +18 -0
  109. package/public/components/block-site-logo-container-v3/site-logo-container-v3.js +7 -0
  110. package/public/components/block-site-title-and-tagline-v3/site-title-and-tagline-v3.css +14 -0
  111. package/public/components/block-site-title-and-tagline-v3/site-title-and-tagline-v3.js +7 -0
  112. package/public/components/block-smash-balloon-social-media-v3/smash-balloon-social-media-v3.css +25 -0
  113. package/public/components/block-smash-balloon-social-media-v3/smash-balloon-social-media-v3.js +8 -0
  114. package/public/components/block-social-networks-v3/social-networks-v3.css +74 -0
  115. package/public/components/block-social-networks-v3/social-networks-v3.js +7 -0
  116. package/public/components/block-spacer-v3/spacer-v3.css +16 -0
  117. package/public/components/block-spacer-v3/spacer-v3.js +2 -0
  118. package/public/components/block-spacer-v3/spacer-v3.scss.css +16 -0
  119. package/public/components/block-spotify-embed-v3/spotify-embed-v3.css +7 -0
  120. package/public/components/block-spotify-embed-v3/spotify-embed-v3.js +7 -0
  121. package/public/components/block-standard-content-v3/standard-content-v3.css +529 -0
  122. package/public/components/block-standard-content-v3/standard-content-v3.js +7 -0
  123. package/public/components/block-sticky-buy-cta-v3/sticky-buy-cta-v3.css +0 -0
  124. package/public/components/block-sticky-buy-cta-v3/sticky-buy-cta-v3.js +7 -0
  125. package/public/components/block-sub-group-container-v3/sub-group-container-v3.css +308 -0
  126. package/public/components/block-sub-group-container-v3/sub-group-container-v3.js +2 -0
  127. package/public/components/block-video-content-v3/video-content-v3.css +105 -0
  128. package/public/components/block-video-content-v3/video-content-v3.js +11 -0
  129. package/public/dynamicBlockScss-v3.css +7140 -0
  130. package/public/dynamicBlockScss-v3.scss +36 -28
  131. package/public/jsAssets.mjs +3 -36
  132. package/public/publicBundle.css +7140 -0
  133. package/public/publicBundle.scss +7 -0
  134. package/public/publicbundlecss.css +0 -3
  135. package/public/publicbundlecss.css.map +0 -1
@@ -2,27 +2,22 @@ require('dotenv').config();
2
2
  const fs = require('fs');
3
3
  const {globSync} = require('glob');
4
4
  const path = require('path');
5
- const themePath =
6
- process.env.THEME_PATH || 'web/wp-content/themes/global-theme';
7
5
 
8
- // Create the directory path for the target file
9
- const scssModulePath = path.join(
10
- './node_modules/@total_onion/onion-library/public'
11
- );
6
+ const scssModulePath = path.join('./public');
12
7
  const scssFilePath = path.join(scssModulePath, 'dynamicBlockScss-v3.scss');
13
8
 
14
- // Create directories if they don't exist
15
9
  fs.mkdirSync(scssModulePath, {recursive: true});
16
10
 
17
11
  // Write the initial content to the target file
18
12
  fs.writeFileSync(scssFilePath, '// This file is auto-generated.\n');
19
13
 
20
- const dynamicEntryPoints = globSync(
21
- `${themePath}/node_modules/@total_onion/onion-library/components/block-*/*-v3.scss`
22
- ).map((path) => {
23
- const assetPath = path.replace('node_modules', 'NodeModules');
24
- return assetPath;
25
- });
14
+ const dynamicEntryPoints = globSync(`./components/block-*/*-v3.scss`).map(
15
+ (path) => {
16
+ console.log('🚀 ~ path:', path);
17
+ const assetPath = path.replace('components/', '../components/');
18
+ return assetPath;
19
+ }
20
+ );
26
21
 
27
22
  const stream = fs.createWriteStream(scssFilePath, {flags: 'a'});
28
23
  dynamicEntryPoints.forEach((entry) => {
package/esbuild.mjs CHANGED
@@ -5,6 +5,20 @@ import postcss from "postcss";
5
5
  import autoprefixer from "autoprefixer";
6
6
  import postcssPresetEnv from "postcss-preset-env";
7
7
 
8
+ // Normalize entry points so anything under a leading "public/" doesn't
9
+ // get mirrored as a nested "public/public" in the output. We do this by
10
+ // using esbuild's object form of entryPoints to control the output paths.
11
+ const entries = assets.reduce((acc, src) => {
12
+ // Remove a leading ./public/ (or public\\) from the output key only
13
+ // and trim any leading ./ so keys are clean relative paths.
14
+ let key = src.replace(/^[.\/\\]*public[\/\\]/, "").replace(/^[.\/\\]+/, "");
15
+ // If the source is an SCSS file, strip the .scss so esbuild doesn't output
16
+ // files like name.scss.css — it will append .css automatically for CSS entries.
17
+ key = key.replace(/\.scss$/i, "");
18
+ acc[key] = src;
19
+ return acc;
20
+ }, {});
21
+
8
22
  await esbuild.build({
9
23
  plugins: [
10
24
  sassPlugin({
@@ -17,7 +31,7 @@ await esbuild.build({
17
31
  },
18
32
  }),
19
33
  ],
20
- entryPoints: assets,
34
+ entryPoints: entries,
21
35
  bundle: false,
22
36
  outdir: "./public/",
23
37
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@total_onion/onion-library",
3
- "version": "2.0.145",
3
+ "version": "2.0.147",
4
4
  "description": "Component library",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,37 +1,3 @@
1
- const dynamicAssets = [
2
- "./components/block-video-content-v3/video-content-v3.scss",
3
- "./components/block-sub-group-container-v3/sub-group-container-v3.scss",
4
- "./components/block-sticky-buy-cta-v3/sticky-buy-cta-v3.scss",
5
- "./components/block-standard-content-v3/standard-content-v3.scss",
6
- "./components/block-spotify-embed-v3/spotify-embed-v3.scss",
7
- "./components/block-spacer-v3/spacer-v3.scss",
8
- "./components/block-social-networks-v3/social-networks-v3.scss",
9
- "./components/block-smash-balloon-social-media-v3/smash-balloon-social-media-v3.scss",
10
- "./components/block-site-title-and-tagline-v3/site-title-and-tagline-v3.scss",
11
- "./components/block-site-logo-container-v3/site-logo-container-v3.scss",
12
- "./components/block-site-copyright-notice-v3/site-copyright-notice-v3.scss",
13
- "./components/block-single-responsive-image-v3/single-responsive-image-v3.scss",
14
- "./components/block-single-column-container-v3/single-column-container-v3.scss",
15
- "./components/block-section-separator-v3/section-separator-v3.scss",
16
- "./components/block-scrolling-banner-v3/scrolling-banner-v3.scss",
17
- "./components/block-responsive-table-v3/responsive-table-v3.scss",
18
- "./components/block-product-info-v3/product-info-v3.scss",
19
- "./components/block-post-type-filter-grid-v3/post-type-filter-grid-v3.scss",
20
- "./components/block-post-info-v3/post-info-v3.scss",
21
- "./components/block-nav-menu-container-v3/nav-menu-container-v3.scss",
22
- "./components/block-modal-form-v3/modal-form-v3.scss",
23
- "./components/block-market-selector-v3/market-selector-v3.scss",
24
- "./components/block-lottie-content-v3/lottie-content-v3.scss",
25
- "./components/block-group-container-v3/group-container-v3.scss",
26
- "./components/block-gradient-layer-v3/gradient-layer-v3.scss",
27
- "./components/block-form-selection-v3/form-selection-v3.scss",
28
- "./components/block-featured-image-gallery-v3/featured-image-gallery-v3.scss",
29
- "./components/block-divider-v3/divider-v3.scss",
30
- "./components/block-cover-link-v3/cover-link-v3.scss",
31
- "./components/block-carousel-multi-layout-v3/carousel-multi-layout-v3.scss",
32
- "./components/block-block-interactions-v3/block-interactions-v3.scss",
33
- "./components/block-betterreviews-display-v3/betterreviews-display-v3.scss",
34
- "./components/block-accordion-v3/accordion-v3.scss",
35
- "./components/block-accent-image-v3/accent-image-v3.scss",
36
- ];
1
+
2
+ const dynamicAssets = ["./components/block-video-content-v3/video-content-v3.scss","./components/block-sub-group-container-v3/sub-group-container-v3.scss","./components/block-sticky-buy-cta-v3/sticky-buy-cta-v3.scss","./components/block-standard-content-v3/standard-content-v3.scss","./components/block-spotify-embed-v3/spotify-embed-v3.scss","./components/block-spacer-v3/spacer-v3.scss","./components/block-social-networks-v3/social-networks-v3.scss","./components/block-smash-balloon-social-media-v3/smash-balloon-social-media-v3.scss","./components/block-site-title-and-tagline-v3/site-title-and-tagline-v3.scss","./components/block-site-logo-container-v3/site-logo-container-v3.scss","./components/block-site-copyright-notice-v3/site-copyright-notice-v3.scss","./components/block-single-responsive-image-v3/single-responsive-image-v3.scss","./components/block-single-column-container-v3/single-column-container-v3.scss","./components/block-section-separator-v3/section-separator-v3.scss","./components/block-scrolling-banner-v3/scrolling-banner-v3.scss","./components/block-responsive-table-v3/responsive-table-v3.scss","./components/block-product-info-v3/product-info-v3.scss","./components/block-post-type-filter-grid-v3/post-type-filter-grid-v3.scss","./components/block-post-info-v3/post-info-v3.scss","./components/block-nav-menu-container-v3/nav-menu-container-v3.scss","./components/block-modal-form-v3/modal-form-v3.scss","./components/block-market-selector-v3/market-selector-v3.scss","./components/block-lottie-content-v3/lottie-content-v3.scss","./components/block-group-container-v3/group-container-v3.scss","./components/block-gradient-layer-v3/gradient-layer-v3.scss","./components/block-form-selection-v3/form-selection-v3.scss","./components/block-featured-image-gallery-v3/featured-image-gallery-v3.scss","./components/block-divider-v3/divider-v3.scss","./components/block-cover-link-v3/cover-link-v3.scss","./components/block-cocktail-recipe-v3/cocktail-recipe-v3.scss","./components/block-carousel-multi-layout-v3/carousel-multi-layout-v3.scss","./components/block-block-interactions-v3/block-interactions-v3.scss","./components/block-betterreviews-display-v3/betterreviews-display-v3.scss","./components/block-back-to-top-button-v3/back-to-top-button-v3.scss","./components/block-accordion-v3/accordion-v3.scss","./components/block-accent-image-v3/accent-image-v3.scss","./components/block-video-content-v3/video-content-v3.js","./components/block-sub-group-container-v3/sub-group-container-v3.js","./components/block-sticky-buy-cta-v3/sticky-buy-cta-v3.js","./components/block-standard-content-v3/standard-content-v3.js","./components/block-spotify-embed-v3/spotify-embed-v3.js","./components/block-spacer-v3/spacer-v3.js","./components/block-social-networks-v3/social-networks-v3.js","./components/block-smash-balloon-social-media-v3/smash-balloon-social-media-v3.js","./components/block-site-title-and-tagline-v3/site-title-and-tagline-v3.js","./components/block-site-logo-container-v3/site-logo-container-v3.js","./components/block-site-copyright-notice-v3/site-copyright-notice-v3.js","./components/block-single-responsive-image-v3/single-responsive-image-v3.js","./components/block-single-column-container-v3/single-column-container-v3.js","./components/block-section-separator-v3/section-separator-v3.js","./components/block-scrolling-banner-v3/scrolling-banner-v3.js","./components/block-responsive-table-v3/responsive-table-v3.js","./components/block-product-info-v3/product-info-v3.js","./components/block-post-type-filter-grid-v3/post-type-filter-grid-v3.js","./components/block-post-info-v3/post-info-v3.js","./components/block-nav-menu-container-v3/nav-menu-container-v3.js","./components/block-modal-form-v3/modal-form-v3.js","./components/block-market-selector-v3/market-selector-v3.js","./components/block-lottie-content-v3/lottie-content-v3.js","./components/block-group-container-v3/group-container-v3.js","./components/block-gradient-layer-v3/gradient-layer-v3.js","./components/block-form-selection-v3/form-selection-v3.js","./components/block-featured-image-gallery-v3/featured-image-gallery-v3.js","./components/block-divider-v3/divider-v3.js","./components/block-cover-link-v3/cover-link-v3.js","./components/block-cocktail-recipe-v3/cocktail-recipe-v3.js","./components/block-carousel-multi-layout-v3/carousel-multi-layout-v3.js","./components/block-block-interactions-v3/block-interactions-v3.js","./components/block-betterreviews-display-v3/betterreviews-display-v3.js","./components/block-back-to-top-button-v3/back-to-top-button-v3.js","./components/block-accordion-v3/accordion-v3.js","./components/block-accent-image-v3/accent-image-v3.js","./public/dynamicBlockScss-v3.scss","./public/publicBundle.scss"];
37
3
  export default dynamicAssets;
@@ -0,0 +1,7 @@
1
+ export default function accentimagev3Js(options = {}) {
2
+ try {
3
+ const { block } = options;
4
+ } catch (error) {
5
+ console.error(error);
6
+ }
7
+ }
@@ -0,0 +1,117 @@
1
+ export default function accordionv3Js(options = {}) {
2
+ try {
3
+ const { block } = options;
4
+ const blockClassName = block.dataset.assetkey;
5
+ const sections = block.querySelectorAll(
6
+ `.${blockClassName}-content`
7
+ );
8
+ const closeAccordionSections = () => {
9
+ sections.forEach((section) => {
10
+ if (section.classList.contains("active")) {
11
+ const question = section.querySelector(
12
+ `.${blockClassName}-question-wrapper`
13
+ );
14
+ const answer = section.querySelector(
15
+ `.${blockClassName}-answer-wrapper`
16
+ );
17
+ const svg = section.querySelector(
18
+ `.${blockClassName}-icon`
19
+ );
20
+ const iconImage = section.querySelector(
21
+ `.${blockClassName}-image-wrapper`
22
+ );
23
+ const sectionHeight = answer.scrollHeight;
24
+ answer.animate(
25
+ [
26
+ {
27
+ height: sectionHeight + "px"
28
+ },
29
+ { height: "0px" }
30
+ ],
31
+ {
32
+ fill: "forwards",
33
+ duration: 200,
34
+ easing: "ease-out"
35
+ }
36
+ );
37
+ answer.setAttribute("aria-hidden", "true");
38
+ question.classList.remove("active");
39
+ section.classList.remove("active");
40
+ if (svg) {
41
+ svg.classList.remove("active");
42
+ }
43
+ if (iconImage) {
44
+ iconImage.classList.remove("image-icon-active");
45
+ }
46
+ }
47
+ });
48
+ };
49
+ sections.forEach((section) => {
50
+ const question = section.querySelector(
51
+ `.${blockClassName}-question-wrapper`
52
+ );
53
+ const answer = section.querySelector(
54
+ `.${blockClassName}-answer-wrapper`
55
+ );
56
+ const svg = section.querySelector(`.${blockClassName}-icon`);
57
+ const iconImage = section.querySelector(
58
+ `.${blockClassName}-image-wrapper`
59
+ );
60
+ question.addEventListener("click", () => {
61
+ const isCollapsed = answer.getAttribute("aria-hidden") === "true";
62
+ closeAccordionSections();
63
+ if (isCollapsed) {
64
+ const sectionHeight = answer.scrollHeight;
65
+ answer.animate(
66
+ [
67
+ { height: "0px" },
68
+ {
69
+ height: sectionHeight + "px"
70
+ }
71
+ ],
72
+ {
73
+ fill: "forwards",
74
+ duration: 200,
75
+ easing: "ease-out"
76
+ }
77
+ );
78
+ section.classList.add("active");
79
+ answer.classList.add("active");
80
+ answer.setAttribute("aria-hidden", "false");
81
+ if (svg) {
82
+ svg.classList.add("active");
83
+ }
84
+ if (iconImage) {
85
+ iconImage.classList.add("image-icon-active");
86
+ }
87
+ } else {
88
+ const sectionHeight = answer.scrollHeight;
89
+ section.classList.remove("active");
90
+ answer.animate(
91
+ [
92
+ {
93
+ height: sectionHeight + "px"
94
+ },
95
+ { height: "0px" }
96
+ ],
97
+ {
98
+ fill: "forwards",
99
+ duration: 200,
100
+ easing: "ease-out"
101
+ }
102
+ );
103
+ answer.classList.remove("active");
104
+ answer.setAttribute("aria-hidden", "true");
105
+ if (svg) {
106
+ svg.classList.remove("active");
107
+ }
108
+ if (iconImage) {
109
+ iconImage.classList.remove("image-icon-active");
110
+ }
111
+ }
112
+ });
113
+ });
114
+ } catch (error) {
115
+ console.error(error);
116
+ }
117
+ }
@@ -0,0 +1,62 @@
1
+ .back-to-top-button {
2
+ position: relative;
3
+ width: 100%;
4
+ z-index: 50;
5
+ overflow: visible;
6
+ overflow: initial;
7
+ }
8
+ .back-to-top-button__arrow {
9
+ --arrow-colour: black;
10
+ position: absolute;
11
+ border-style: solid;
12
+ border-color: black;
13
+ border-color: var(--arrow-colour);
14
+ border-width: 0 2px 2px 0;
15
+ display: inline-block;
16
+ transform: rotate(-135deg);
17
+ height: 20%;
18
+ width: 20%;
19
+ }
20
+ .back-to-top-button__button {
21
+ --bg-colour: white;
22
+ display: flex;
23
+ justify-content: center;
24
+ align-items: center;
25
+ position: fixed;
26
+ cursor: pointer;
27
+ height: calc(50 / var(--desktop-design-reference) * var(--screen-width-static));
28
+ width: calc(50 / var(--desktop-design-reference) * var(--screen-width-static));
29
+ border: none;
30
+ border-radius: 50px;
31
+ padding: calc(18 / var(--desktop-design-reference) * var(--screen-width-static));
32
+ background-color: white;
33
+ background-color: var(--bg-colour);
34
+ right: calc(10 / var(--design-reference) * var(--screen-width));
35
+ border-radius: var(--button-border-radius);
36
+ }
37
+ @media screen and (min-width: 768px) {
38
+ .back-to-top-button__button {
39
+ right: calc(30 / var(--design-reference) * var(--screen-width));
40
+ }
41
+ }
42
+ @media screen and (min-width: 1024px) {
43
+ .back-to-top-button__button {
44
+ right: calc(60 / var(--design-reference) * var(--screen-width));
45
+ }
46
+ }
47
+ .back-to-top-button__button--fixed {
48
+ position: fixed;
49
+ bottom: calc(60 / var(--desktop-design-reference) * var(--screen-width-static));
50
+ }
51
+ .back-to-top-button__button--absolute {
52
+ position: absolute;
53
+ translate: 0 -50%;
54
+ }
55
+ .wp-admin .back-to-top-button__button {
56
+ position: absolute;
57
+ translate: 0 0;
58
+ bottom: 0;
59
+ }
60
+ .back-to-top-button__image {
61
+ width: calc(var(--image-size) / var(--desktop-design-reference) * var(--screen-width-static));
62
+ }
@@ -0,0 +1,12 @@
1
+ export default function backtotopbuttonJs(options = {}) {
2
+ try {
3
+ const { block } = options;
4
+ const button = block.querySelector(".back-to-top-button__button");
5
+ button.addEventListener(
6
+ "click",
7
+ () => window.scrollTo({ top: 0, behavior: "smooth" })
8
+ );
9
+ } catch (error) {
10
+ console.error(error);
11
+ }
12
+ }
@@ -0,0 +1,7 @@
1
+ export default function betterreviewsdisplay3Js(options = {}) {
2
+ try {
3
+ const { block } = options;
4
+ } catch (error) {
5
+ console.error(error);
6
+ }
7
+ }
@@ -0,0 +1,44 @@
1
+ export default function blockinteractionsv3Js(options = {}) {
2
+ try {
3
+ let setCookie = function(name, value, days) {
4
+ const expires = new Date(Date.now() + days * 864e5).toUTCString();
5
+ document.cookie = `${name}=${encodeURIComponent(value)}; expires=${expires}; path=/`;
6
+ }, getCookie = function(name) {
7
+ return document.cookie.split("; ").reduce((result, cookieString) => {
8
+ const [key, val] = cookieString.split("=");
9
+ return key === name ? decodeURIComponent(val) : result;
10
+ }, "");
11
+ };
12
+ const { block } = options;
13
+ const blockId = block.dataset.blockid;
14
+ const parentBlockId = block.dataset.parentblockid;
15
+ const blockCloseButtons = block.querySelectorAll(".block-interactions-v3__block-close-button");
16
+ if (!blockCloseButtons.length) {
17
+ return;
18
+ }
19
+ blockCloseButtons.forEach((button) => {
20
+ const shouldStoreCookie = button?.dataset?.storeCookie === "true";
21
+ const cookieKey = `blockClosed_${parentBlockId}`;
22
+ const wrappingSection = document.querySelector(`[data-blockid="${parentBlockId}"]`);
23
+ if (getCookie(cookieKey) === "true") {
24
+ wrappingSection.style.animation = "none";
25
+ wrappingSection.style.display = "none";
26
+ return;
27
+ }
28
+ button.addEventListener("click", (e) => {
29
+ console.log(e.currentTarget.dataset);
30
+ wrappingSection.style.animation = "none";
31
+ wrappingSection.offsetHeight;
32
+ wrappingSection.style.animation = `${e.currentTarget.dataset.animationname} ${e.currentTarget.dataset.animationduration}s forwards reverse`;
33
+ setTimeout(() => {
34
+ wrappingSection.style.display = "none";
35
+ }, e.currentTarget.dataset.animationduration * 1e3);
36
+ if (shouldStoreCookie) {
37
+ setCookie(cookieKey, "true", 7);
38
+ }
39
+ });
40
+ });
41
+ } catch (error) {
42
+ console.error("Error in blockinteractionsv3Js:", error);
43
+ }
44
+ }
@@ -0,0 +1,169 @@
1
+ import { getSwiperAssetsV2 } from "@total_onion/onion-utils/onion-utils.mjs";
2
+ import { Navigation, Pagination, Autoplay, EffectFade } from "swiper/modules";
3
+ export default function carouselmultilayoutv3Js(options = {}) {
4
+ try {
5
+ const { block } = options;
6
+ const totalSlides = block.querySelectorAll(".swiper-slide").length || 1;
7
+ Promise.all([getSwiperAssetsV2()]).then((values) => {
8
+ const { Swiper } = values[0][0];
9
+ const dataAttributes = block.dataset;
10
+ const slidesDesktop = Number(dataAttributes.desktopslides);
11
+ const slidesDesktopFull = Number(dataAttributes.desktopslidesfull) || slidesDesktop;
12
+ const slidesTablet = Number(dataAttributes.tabletslides);
13
+ const slidesMobile = Number(dataAttributes.mobileslides);
14
+ const slidesOffsetDesktopBefore = Number(
15
+ dataAttributes.desktopslidesoffsetbefore
16
+ );
17
+ const slidesOffsetTabletBefore = Number(
18
+ dataAttributes.tabletslidesoffsetbefore
19
+ );
20
+ const slidesOffsetMobileBefore = Number(
21
+ dataAttributes.mobileslidesoffsetbefore
22
+ );
23
+ const slidesOffsetDesktopAfter = Number(
24
+ dataAttributes.desktopslidesoffsetafter
25
+ );
26
+ const slidesOffsetTabletAfter = Number(
27
+ dataAttributes.tabletslidesoffsetafter
28
+ );
29
+ const slidesOffsetMobileAfter = Number(
30
+ dataAttributes.mobileslidesoffsetafter
31
+ );
32
+ const loopSlides = Number(dataAttributes.loopslides) === 1;
33
+ const loopSlidesPortrait = Number(dataAttributes.loopslidesportrait) === 1;
34
+ const loopSlidesMobile = Number(dataAttributes.loopslidesmobile) === 1;
35
+ console.log(totalSlides > 1 ? loopSlides : false);
36
+ const spaceBetweenSlidesDesktop = Number(
37
+ dataAttributes.desktopspacebetweenslides
38
+ );
39
+ const spaceBetweenSlidesDesktopFull = Number(dataAttributes.desktopfullspacebetweenslides) || spaceBetweenSlidesDesktop;
40
+ const spaceBetweenSlidesMobile = Number(
41
+ dataAttributes.mobilespacebetweenslides
42
+ );
43
+ const spaceBetweenSlidesTablet = Number(
44
+ dataAttributes.tabletspacebetweenslides
45
+ );
46
+ const autoplayCarousel = Number(dataAttributes.autoplay) === 1;
47
+ const centerActiveSlide = Number(dataAttributes.centeractiveslide) === 1;
48
+ const centerActiveSlidePortrait = Number(dataAttributes.centeractiveslideportrait) === 1;
49
+ const centerActiveSlideMobile = Number(dataAttributes.centeractiveslidemobile) === 1;
50
+ const centerInsufficientSlidesDesktop = Number(dataAttributes.centerinsufficientslidesdesktop) === 1;
51
+ const centerInsufficientSlidesPortrait = Number(dataAttributes.centerinsufficientslidesportrait) === 1;
52
+ const centerInsufficientSlidesMobile = Number(dataAttributes.centerinsufficientslidesmobile) === 1;
53
+ const carouselEnableFreeMode = Number(dataAttributes.enablefreemode) === 1;
54
+ const carouselEnableMousewheel = Number(dataAttributes.enablemousewheel) === 1;
55
+ const delay = Number(dataAttributes.transitiondelay);
56
+ const speed = Number(dataAttributes.transitionspeed);
57
+ const transitionStyle = dataAttributes.transitionstyle === "default" ? "" : dataAttributes.transitionstyle;
58
+ const paginationStyle = dataAttributes.paginationstyle === "customnumber" ? "bullets" : dataAttributes.paginationstyle;
59
+ const fractionStyle = dataAttributes.fractionstyle;
60
+ const fractionString = dataAttributes.fractionstring;
61
+ const fractionSetting = fractionStyle === "text" ? function(currentClass, totalClass) {
62
+ return '<span class="' + currentClass + '"></span> ' + fractionString + ' <span class="' + totalClass + '"></span>';
63
+ } : false;
64
+ const customNumber = dataAttributes.paginationstyle === "customnumber" ? function(index, className) {
65
+ return '<div class="' + className + '"><span class="pagination-number">0' + (index + 1) + "</span></div>";
66
+ } : false;
67
+ const carouselmultilayoutv3Swiper = new Swiper(
68
+ block.querySelector(".swiper"),
69
+ {
70
+ modules: [
71
+ Navigation,
72
+ Pagination,
73
+ Autoplay,
74
+ EffectFade
75
+ // EffectCoverflow,
76
+ // EffectCreative,
77
+ // FreeMode,
78
+ // Mousewheel
79
+ ],
80
+ slidesPerView: slidesMobile,
81
+ spaceBetween: spaceBetweenSlidesMobile,
82
+ loop: totalSlides > 1 ? loopSlidesMobile : false,
83
+ preloadImages: true,
84
+ watchSlidesVisibility: true,
85
+ effect: transitionStyle,
86
+ creativeEffect: {
87
+ prev: {
88
+ shadow: true,
89
+ translate: [0, 0, -400]
90
+ },
91
+ next: {
92
+ translate: ["100%", 0, 0]
93
+ }
94
+ },
95
+ coverflowEffect: {
96
+ rotate: 20,
97
+ depth: 50,
98
+ scale: 0.9,
99
+ modifier: 1,
100
+ slideShadows: true
101
+ },
102
+ fadeEffect: {
103
+ crossFade: true
104
+ },
105
+ lazy: {
106
+ loadPrevNext: true
107
+ },
108
+ speed,
109
+ autoplay: autoplayCarousel ? {
110
+ delay
111
+ } : "",
112
+ watchOverflow: true,
113
+ centeredSlides: centerActiveSlideMobile,
114
+ centerInsufficientSlides: centerInsufficientSlidesMobile,
115
+ freeMode: {
116
+ enabled: carouselEnableFreeMode,
117
+ sticky: carouselEnableFreeMode
118
+ },
119
+ mousewheel: carouselEnableMousewheel,
120
+ slidesOffsetBefore: slidesOffsetMobileBefore,
121
+ slidesOffsetAfter: slidesOffsetMobileAfter,
122
+ breakpoints: {
123
+ 744: {
124
+ spaceBetween: spaceBetweenSlidesTablet,
125
+ slidesPerView: slidesTablet,
126
+ centeredSlides: centerActiveSlidePortrait,
127
+ centerInsufficientSlides: centerInsufficientSlidesPortrait,
128
+ slidesOffsetBefore: slidesOffsetTabletBefore,
129
+ slidesOffsetAfter: slidesOffsetTabletAfter,
130
+ loop: totalSlides > 1 ? loopSlidesPortrait : false
131
+ },
132
+ 1024: {
133
+ slidesPerView: slidesDesktop,
134
+ spaceBetween: spaceBetweenSlidesDesktop,
135
+ centeredSlides: centerActiveSlide,
136
+ centerInsufficientSlides: centerInsufficientSlidesDesktop,
137
+ slidesOffsetBefore: slidesOffsetDesktopBefore,
138
+ slidesOffsetAfter: slidesOffsetDesktopAfter,
139
+ loop: totalSlides > 1 ? loopSlides : false
140
+ },
141
+ 1440: {
142
+ slidesPerView: slidesDesktopFull,
143
+ spaceBetween: spaceBetweenSlidesDesktopFull,
144
+ loop: totalSlides > 1 ? loopSlides : false
145
+ }
146
+ },
147
+ navigation: {
148
+ nextEl: block.querySelector(".swiper-button-next"),
149
+ prevEl: block.querySelector(".swiper-button-prev")
150
+ },
151
+ pagination: {
152
+ el: block.querySelector(".swiper-pagination"),
153
+ type: paginationStyle,
154
+ renderFraction: fractionSetting,
155
+ clickable: true,
156
+ renderBullet: customNumber
157
+ }
158
+ }
159
+ );
160
+ if (false) {
161
+ null.then((result) => {
162
+ result.default();
163
+ });
164
+ }
165
+ });
166
+ } catch (error) {
167
+ console.error(error);
168
+ }
169
+ }