@blaze-cms/react-page-builder 0.140.3 → 0.141.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +23 -0
  3. package/lib/components/BlazeLink.js +6 -2
  4. package/lib/components/BlazeLink.js.map +1 -1
  5. package/lib/components/Card/Card.js.map +1 -1
  6. package/lib/components/ContentGroup/ContentGroupTabs.js +10 -8
  7. package/lib/components/ContentGroup/ContentGroupTabs.js.map +1 -1
  8. package/lib/components/Image/ImageRender.js +4 -2
  9. package/lib/components/Image/ImageRender.js.map +1 -1
  10. package/lib/components/List/ListRender.js +10 -1
  11. package/lib/components/List/ListRender.js.map +1 -1
  12. package/lib/components/List/components/Header/ListHeader.js +5 -2
  13. package/lib/components/List/components/Header/ListHeader.js.map +1 -1
  14. package/lib/components/List/components/Pagination/Classic.js +2 -2
  15. package/lib/components/List/components/Pagination/Classic.js.map +1 -1
  16. package/lib/components/List/components/Pagination/LoadMore.js +2 -1
  17. package/lib/components/List/components/Pagination/LoadMore.js.map +1 -1
  18. package/lib/components/List/helpers/build-pagination-items.js +2 -1
  19. package/lib/components/List/helpers/build-pagination-items.js.map +1 -1
  20. package/lib/components/List/helpers/build-query-booster.js +57 -0
  21. package/lib/components/List/helpers/build-query-booster.js.map +1 -0
  22. package/lib/components/List/helpers/index.js +7 -0
  23. package/lib/components/List/helpers/index.js.map +1 -1
  24. package/lib/components/Menu/Menu.js +6 -6
  25. package/lib/components/Menu/Menu.js.map +1 -1
  26. package/lib/components/MenuItem/MenuItem.js +2 -1
  27. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  28. package/lib/components/SearchFilter/components/Select.js +1 -0
  29. package/lib/components/SearchFilter/components/Select.js.map +1 -1
  30. package/lib/components/SearchFilterSort/SearchFilterSort.js +1 -0
  31. package/lib/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
  32. package/lib/components/SocialFollow/SFItem.js +4 -3
  33. package/lib/components/SocialFollow/SFItem.js.map +1 -1
  34. package/lib/components/Video/providers/Default.js +13 -7
  35. package/lib/components/Video/providers/Default.js.map +1 -1
  36. package/lib/components/Video/providers/get-provider.js +5 -0
  37. package/lib/components/Video/providers/get-provider.js.map +1 -1
  38. package/lib/hooks/helpers/getVariant.js.map +1 -1
  39. package/lib/hooks/index.js +7 -0
  40. package/lib/hooks/index.js.map +1 -1
  41. package/lib/hooks/use-app-sync-event-hook.js +31 -0
  42. package/lib/hooks/use-app-sync-event-hook.js.map +1 -0
  43. package/lib/utils/variant-handler.js +2 -1
  44. package/lib/utils/variant-handler.js.map +1 -1
  45. package/lib/variants/HeroImage/index.js +29 -0
  46. package/lib/variants/HeroImage/index.js.map +1 -0
  47. package/lib/variants/Infographic/Infographic.js +27 -0
  48. package/lib/variants/Infographic/Infographic.js.map +1 -0
  49. package/lib/variants/Infographic/index.js +41 -0
  50. package/lib/variants/Infographic/index.js.map +1 -0
  51. package/lib/variants/Infographic/useInfographic.js +43 -0
  52. package/lib/variants/Infographic/useInfographic.js.map +1 -0
  53. package/lib/variants/LongformGallery/LongformGallery.js +53 -0
  54. package/lib/variants/LongformGallery/LongformGallery.js.map +1 -0
  55. package/lib/variants/LongformGallery/LongformGalleryImage.js +71 -0
  56. package/lib/variants/LongformGallery/LongformGalleryImage.js.map +1 -0
  57. package/lib/variants/LongformGallery/constants.js +19 -0
  58. package/lib/variants/LongformGallery/constants.js.map +1 -0
  59. package/lib/variants/LongformGallery/helpers/index.js +29 -0
  60. package/lib/variants/LongformGallery/helpers/index.js.map +1 -0
  61. package/lib/variants/LongformGallery/helpers/parseImageData.js +42 -0
  62. package/lib/variants/LongformGallery/helpers/parseImageData.js.map +1 -0
  63. package/lib/variants/LongformGallery/helpers/separateImages.js +36 -0
  64. package/lib/variants/LongformGallery/helpers/separateImages.js.map +1 -0
  65. package/lib/variants/LongformGallery/helpers/shouldSkip.js +13 -0
  66. package/lib/variants/LongformGallery/helpers/shouldSkip.js.map +1 -0
  67. package/lib/variants/LongformGallery/index.js +43 -0
  68. package/lib/variants/LongformGallery/index.js.map +1 -0
  69. package/lib/variants/LongformGallery/useLongformGallery.js +58 -0
  70. package/lib/variants/LongformGallery/useLongformGallery.js.map +1 -0
  71. package/lib/variants/LongformRow/index.js +29 -0
  72. package/lib/variants/LongformRow/index.js.map +1 -0
  73. package/lib/variants/ParallaxImageTextRight/index.js +30 -0
  74. package/lib/variants/ParallaxImageTextRight/index.js.map +1 -0
  75. package/lib/variants/ThumbnailCarousel/ThumbnailCarousel.js +63 -0
  76. package/lib/variants/ThumbnailCarousel/ThumbnailCarousel.js.map +1 -0
  77. package/lib/variants/ThumbnailCarousel/ThumbnailImage/ThumbnailImage.js +37 -0
  78. package/lib/variants/ThumbnailCarousel/ThumbnailImage/ThumbnailImage.js.map +1 -0
  79. package/lib/variants/ThumbnailCarousel/ThumbnailImage/index.js +11 -0
  80. package/lib/variants/ThumbnailCarousel/ThumbnailImage/index.js.map +1 -0
  81. package/lib/variants/ThumbnailCarousel/ThumbnailImage/useThumbnailImage.js +69 -0
  82. package/lib/variants/ThumbnailCarousel/ThumbnailImage/useThumbnailImage.js.map +1 -0
  83. package/lib/variants/ThumbnailCarousel/index.js +41 -0
  84. package/lib/variants/ThumbnailCarousel/index.js.map +1 -0
  85. package/lib/variants/ThumbnailCarousel/useThumbnailCarousel.js +66 -0
  86. package/lib/variants/ThumbnailCarousel/useThumbnailCarousel.js.map +1 -0
  87. package/lib/variants/index.js +15 -1
  88. package/lib/variants/index.js.map +1 -1
  89. package/lib-es/components/BlazeLink.js +6 -2
  90. package/lib-es/components/BlazeLink.js.map +1 -1
  91. package/lib-es/components/Card/Card.js.map +1 -1
  92. package/lib-es/components/ContentGroup/ContentGroupTabs.js +10 -8
  93. package/lib-es/components/ContentGroup/ContentGroupTabs.js.map +1 -1
  94. package/lib-es/components/Image/ImageRender.js +4 -2
  95. package/lib-es/components/Image/ImageRender.js.map +1 -1
  96. package/lib-es/components/List/ListRender.js +11 -1
  97. package/lib-es/components/List/ListRender.js.map +1 -1
  98. package/lib-es/components/List/components/Header/ListHeader.js +5 -2
  99. package/lib-es/components/List/components/Header/ListHeader.js.map +1 -1
  100. package/lib-es/components/List/components/Pagination/Classic.js +2 -2
  101. package/lib-es/components/List/components/Pagination/Classic.js.map +1 -1
  102. package/lib-es/components/List/components/Pagination/LoadMore.js +2 -1
  103. package/lib-es/components/List/components/Pagination/LoadMore.js.map +1 -1
  104. package/lib-es/components/List/helpers/build-pagination-items.js +2 -1
  105. package/lib-es/components/List/helpers/build-pagination-items.js.map +1 -1
  106. package/lib-es/components/List/helpers/build-query-booster.js +41 -0
  107. package/lib-es/components/List/helpers/build-query-booster.js.map +1 -0
  108. package/lib-es/components/List/helpers/index.js +1 -0
  109. package/lib-es/components/List/helpers/index.js.map +1 -1
  110. package/lib-es/components/Menu/Menu.js +6 -6
  111. package/lib-es/components/Menu/Menu.js.map +1 -1
  112. package/lib-es/components/MenuItem/MenuItem.js +2 -1
  113. package/lib-es/components/MenuItem/MenuItem.js.map +1 -1
  114. package/lib-es/components/SearchFilter/components/Select.js +1 -0
  115. package/lib-es/components/SearchFilter/components/Select.js.map +1 -1
  116. package/lib-es/components/SearchFilterSort/SearchFilterSort.js +1 -0
  117. package/lib-es/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
  118. package/lib-es/components/SocialFollow/SFItem.js +4 -3
  119. package/lib-es/components/SocialFollow/SFItem.js.map +1 -1
  120. package/lib-es/components/Video/providers/Default.js +14 -7
  121. package/lib-es/components/Video/providers/Default.js.map +1 -1
  122. package/lib-es/components/Video/providers/get-provider.js +2 -1
  123. package/lib-es/components/Video/providers/get-provider.js.map +1 -1
  124. package/lib-es/hooks/helpers/getVariant.js.map +1 -1
  125. package/lib-es/hooks/index.js +1 -0
  126. package/lib-es/hooks/index.js.map +1 -1
  127. package/lib-es/hooks/use-app-sync-event-hook.js +25 -0
  128. package/lib-es/hooks/use-app-sync-event-hook.js.map +1 -0
  129. package/lib-es/utils/variant-handler.js +2 -1
  130. package/lib-es/utils/variant-handler.js.map +1 -1
  131. package/lib-es/variants/HeroImage/index.js +10 -0
  132. package/lib-es/variants/HeroImage/index.js.map +1 -0
  133. package/lib-es/variants/Infographic/Infographic.js +20 -0
  134. package/lib-es/variants/Infographic/Infographic.js.map +1 -0
  135. package/lib-es/variants/Infographic/index.js +10 -0
  136. package/lib-es/variants/Infographic/index.js.map +1 -0
  137. package/lib-es/variants/Infographic/useInfographic.js +23 -0
  138. package/lib-es/variants/Infographic/useInfographic.js.map +1 -0
  139. package/lib-es/variants/LongformGallery/LongformGallery.js +40 -0
  140. package/lib-es/variants/LongformGallery/LongformGallery.js.map +1 -0
  141. package/lib-es/variants/LongformGallery/LongformGalleryImage.js +59 -0
  142. package/lib-es/variants/LongformGallery/LongformGalleryImage.js.map +1 -0
  143. package/lib-es/variants/LongformGallery/constants.js +18 -0
  144. package/lib-es/variants/LongformGallery/constants.js.map +1 -0
  145. package/lib-es/variants/LongformGallery/helpers/index.js +5 -0
  146. package/lib-es/variants/LongformGallery/helpers/index.js.map +1 -0
  147. package/lib-es/variants/LongformGallery/helpers/parseImageData.js +26 -0
  148. package/lib-es/variants/LongformGallery/helpers/parseImageData.js.map +1 -0
  149. package/lib-es/variants/LongformGallery/helpers/separateImages.js +25 -0
  150. package/lib-es/variants/LongformGallery/helpers/separateImages.js.map +1 -0
  151. package/lib-es/variants/LongformGallery/helpers/shouldSkip.js +3 -0
  152. package/lib-es/variants/LongformGallery/helpers/shouldSkip.js.map +1 -0
  153. package/lib-es/variants/LongformGallery/index.js +12 -0
  154. package/lib-es/variants/LongformGallery/index.js.map +1 -0
  155. package/lib-es/variants/LongformGallery/useLongformGallery.js +47 -0
  156. package/lib-es/variants/LongformGallery/useLongformGallery.js.map +1 -0
  157. package/lib-es/variants/LongformRow/index.js +10 -0
  158. package/lib-es/variants/LongformRow/index.js.map +1 -0
  159. package/lib-es/variants/ParallaxImageTextRight/index.js +11 -0
  160. package/lib-es/variants/ParallaxImageTextRight/index.js.map +1 -0
  161. package/lib-es/variants/ThumbnailCarousel/ThumbnailCarousel.js +49 -0
  162. package/lib-es/variants/ThumbnailCarousel/ThumbnailCarousel.js.map +1 -0
  163. package/lib-es/variants/ThumbnailCarousel/ThumbnailImage/ThumbnailImage.js +30 -0
  164. package/lib-es/variants/ThumbnailCarousel/ThumbnailImage/ThumbnailImage.js.map +1 -0
  165. package/lib-es/variants/ThumbnailCarousel/ThumbnailImage/index.js +3 -0
  166. package/lib-es/variants/ThumbnailCarousel/ThumbnailImage/index.js.map +1 -0
  167. package/lib-es/variants/ThumbnailCarousel/ThumbnailImage/useThumbnailImage.js +62 -0
  168. package/lib-es/variants/ThumbnailCarousel/ThumbnailImage/useThumbnailImage.js.map +1 -0
  169. package/lib-es/variants/ThumbnailCarousel/index.js +10 -0
  170. package/lib-es/variants/ThumbnailCarousel/index.js.map +1 -0
  171. package/lib-es/variants/ThumbnailCarousel/useThumbnailCarousel.js +47 -0
  172. package/lib-es/variants/ThumbnailCarousel/useThumbnailCarousel.js.map +1 -0
  173. package/lib-es/variants/index.js +14 -1
  174. package/lib-es/variants/index.js.map +1 -1
  175. package/package.json +7 -7
  176. package/src/components/BlazeLink.js +23 -4
  177. package/src/components/Card/Card.js +0 -1
  178. package/src/components/ContentGroup/ContentGroupTabs.js +11 -8
  179. package/src/components/Image/ImageRender.js +4 -2
  180. package/src/components/List/ListRender.js +11 -1
  181. package/src/components/List/components/Header/ListHeader.js +7 -4
  182. package/src/components/List/components/Pagination/Classic.js +2 -2
  183. package/src/components/List/components/Pagination/LoadMore.js +7 -2
  184. package/src/components/List/helpers/build-pagination-items.js +2 -1
  185. package/src/components/List/helpers/build-query-booster.js +35 -0
  186. package/src/components/List/helpers/index.js +1 -0
  187. package/src/components/Menu/Menu.js +6 -7
  188. package/src/components/MenuItem/MenuItem.js +5 -2
  189. package/src/components/SearchFilter/components/Select.js +1 -0
  190. package/src/components/SearchFilterSort/SearchFilterSort.js +1 -0
  191. package/src/components/SocialFollow/SFItem.js +8 -2
  192. package/src/components/Video/providers/Default.js +12 -6
  193. package/src/components/Video/providers/get-provider.js +2 -1
  194. package/src/hooks/helpers/getVariant.js +1 -0
  195. package/src/hooks/index.js +1 -0
  196. package/src/hooks/use-app-sync-event-hook.js +19 -0
  197. package/src/utils/variant-handler.js +2 -1
  198. package/src/variants/HeroImage/index.js +8 -0
  199. package/src/variants/Infographic/Infographic.js +14 -0
  200. package/src/variants/Infographic/index.js +12 -0
  201. package/src/variants/Infographic/useInfographic.js +18 -0
  202. package/src/variants/LongformGallery/LongformGallery.js +47 -0
  203. package/src/variants/LongformGallery/LongformGalleryImage.js +65 -0
  204. package/src/variants/LongformGallery/constants.js +21 -0
  205. package/src/variants/LongformGallery/helpers/index.js +5 -0
  206. package/src/variants/LongformGallery/helpers/parseImageData.js +25 -0
  207. package/src/variants/LongformGallery/helpers/separateImages.js +38 -0
  208. package/src/variants/LongformGallery/helpers/shouldSkip.js +3 -0
  209. package/src/variants/LongformGallery/index.js +13 -0
  210. package/src/variants/LongformGallery/useLongformGallery.js +41 -0
  211. package/src/variants/LongformRow/index.js +8 -0
  212. package/src/variants/ParallaxImageTextRight/index.js +9 -0
  213. package/src/variants/ThumbnailCarousel/ThumbnailCarousel.js +51 -0
  214. package/src/variants/ThumbnailCarousel/ThumbnailImage/ThumbnailImage.js +26 -0
  215. package/src/variants/ThumbnailCarousel/ThumbnailImage/index.js +3 -0
  216. package/src/variants/ThumbnailCarousel/ThumbnailImage/useThumbnailImage.js +61 -0
  217. package/src/variants/ThumbnailCarousel/index.js +12 -0
  218. package/src/variants/ThumbnailCarousel/useThumbnailCarousel.js +42 -0
  219. package/src/variants/index.js +15 -1
  220. package/tests/unit/src/components/Breadcrumb/__snapshots__/Breadcrumb.test.js.snap +3 -0
  221. package/tests/unit/src/components/Button.test.js +2 -2
  222. package/tests/unit/src/components/Card/__snapshots__/Card.test.js.snap +13 -0
  223. package/tests/unit/src/components/Card/__snapshots__/CardContainer.test.js.snap +8 -0
  224. package/tests/unit/src/components/ContentGroup/__snapshots__/ContentGroupTabs.test.js.snap +2 -0
  225. package/tests/unit/src/components/Image/GlobalLightbox/__snapshots__/GlobalLightbox.test.js.snap +1 -0
  226. package/tests/unit/src/components/Image/__snapshots__/Image.test.js.snap +3 -0
  227. package/tests/unit/src/components/Image/__snapshots__/ImageFactory.test.js.snap +4 -0
  228. package/tests/unit/src/components/List/ListRender.test.js +9 -0
  229. package/tests/unit/src/components/List/components/Header/__snapshots__/ListHeader.test.js.snap +5 -0
  230. package/tests/unit/src/components/List/components/Pagination/__snapshots__/Classic.test.js.snap +8 -2
  231. package/tests/unit/src/components/List/components/Pagination/__snapshots__/ListPagination.test.js.snap +5 -1
  232. package/tests/unit/src/components/List/components/Pagination/__snapshots__/LoadMore.test.js.snap +1 -1
  233. package/tests/unit/src/components/List/helpers/__snapshots__/build-pagination-items.test.js.snap +21 -0
  234. package/tests/unit/src/components/List/helpers/build-query-booster.test.js +33 -0
  235. package/tests/unit/src/components/MenuItem/__snapshots__/MenuItem.test.js.snap +3 -0
  236. package/tests/unit/src/components/PlaceholderIcon/__snapshots__/index.test.js.snap +3 -1
  237. package/tests/unit/src/components/SearchFilter/components/__snapshots__/Select.test.js.snap +5 -3
  238. package/tests/unit/src/components/SearchFilterSort/__snapshots__/SearchFilterSort.test.js.snap +2 -1
  239. package/tests/unit/src/components/SocialFollow/__snapshots__/SFItem.test.js.snap +2 -2
  240. package/tests/unit/src/components/SocialFollow/__snapshots__/SocialFollow.test.js.snap +2 -6
  241. package/tests/unit/src/components/TextBlock/__snapshots__/TextBlock.test.js.snap +4 -0
  242. package/tests/unit/src/components/Video/providers/__snapshots__/Default.test.js.snap +111 -108
  243. package/tests/unit/src/components/__snapshots__/BlazeLink.test.js.snap +1 -1
  244. package/tests/unit/src/components/__snapshots__/Button.test.js.snap +1 -0
  245. package/tests/unit/src/helpers/__snapshots__/parse-textBlock.test.js.snap +1 -0
  246. package/tests/unit/src/helpers/parse-textBlock.test.js +3 -1
  247. package/tests/unit/src/hooks/use-app-sync-evet-hook.test.js +50 -0
  248. package/tests/unit/src/utils/variant-handler.test.js +9 -4
  249. package/tests/unit/src/variants/LongFormGallery/LongformGallery.test.js +42 -0
  250. package/tests/unit/src/variants/LongFormGallery/LongformGalleryImage.test.js +44 -0
  251. package/tests/unit/src/variants/LongFormGallery/__snapshots__/LongformGallery.test.js.snap +99 -0
  252. package/tests/unit/src/variants/LongFormGallery/__snapshots__/LongformGalleryImage.test.js.snap +51 -0
  253. package/tests/unit/src/variants/LongFormGallery/constants.js +37 -0
  254. package/tests/unit/src/variants/LongFormGallery/helpers/parseImageData.test.js +53 -0
  255. package/tests/unit/src/variants/LongFormGallery/helpers/separateImages.test.js +52 -0
  256. package/tests/unit/src/variants/LongFormGallery/helpers/shouldSkip.test.js +23 -0
  257. package/tests/unit/src/variants/LongFormGallery/useLongformGallery.test.js +36 -0
  258. package/tests/unit/src/variants/ThumbnailCarousel/ThumbnailCarousel.test.js +29 -0
  259. package/tests/unit/src/variants/ThumbnailCarousel/ThumbnailImage.test.js +45 -0
  260. package/tests/unit/src/variants/ThumbnailCarousel/__snapshots__/ThumbnailCarousel.test.js.snap +71 -0
  261. package/tests/unit/src/variants/ThumbnailCarousel/__snapshots__/ThumbnailImage.test.js.snap +19 -0
  262. package/tests/unit/src/variants/ThumbnailCarousel/mocks.js +64 -0
@@ -3,159 +3,162 @@
3
3
  exports[`Default provider component should render without throwing error and match snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <div
6
- class="video-react-controls-enabled video-react-paused video-react-fluid video-react-user-active video-react-workinghover video-react mocked-modifier"
7
- role="region"
8
- style="padding-top: 56.25%;"
9
- tabindex="-1"
6
+ class="video__wrapper"
10
7
  >
11
- <video
12
- class="video-react-video"
13
- preload="none"
14
- tabindex="-1"
15
- >
16
- <source
17
- src="http://media.w3.org/2010/05/bunny/movie.mp4"
18
- type="video/mp4"
19
- />
20
- </video>
21
8
  <div
22
- class="video-react-loading-spinner"
23
- />
24
- <button
25
- aria-live="polite"
26
- class="video-react-big-play-button video-react-big-play-button-left big-play-button-hide"
27
- tabindex="0"
28
- type="button"
9
+ class="video-react-controls-enabled video-react-paused video-react-fluid video-react-user-active video-react-workinghover video-react mocked-modifier"
10
+ role="region"
11
+ style="padding-top: 56.25%;"
12
+ tabindex="-1"
29
13
  >
30
- <span
31
- class="video-react-control-text"
14
+ <video
15
+ class="video-react-video"
16
+ preload="none"
17
+ tabindex="-1"
32
18
  >
33
- Play Video
34
- </span>
35
- </button>
36
- <div
37
- class="video-react-control-bar video-react-control-bar-auto-hide"
38
- >
19
+ <source
20
+ src="http://media.w3.org/2010/05/bunny/movie.mp4"
21
+ />
22
+ </video>
23
+ <div
24
+ class="video-react-loading-spinner"
25
+ />
39
26
  <button
40
- class="video-react-play-control video-react-control video-react-button video-react-paused"
27
+ aria-live="polite"
28
+ class="video-react-big-play-button video-react-big-play-button-left big-play-button-hide"
41
29
  tabindex="0"
42
30
  type="button"
43
31
  >
44
32
  <span
45
33
  class="video-react-control-text"
46
34
  >
47
- Play
35
+ Play Video
48
36
  </span>
49
37
  </button>
50
38
  <div
51
- class="video-react-volume-menu-button-horizontal video-react-vol-3 video-react-volume-menu-button video-react-menu-button-inline video-react-control video-react-button video-react-menu-button"
52
- role="button"
53
- tabindex="0"
39
+ class="video-react-control-bar video-react-control-bar-auto-hide"
54
40
  >
41
+ <button
42
+ class="video-react-play-control video-react-control video-react-button video-react-paused"
43
+ tabindex="0"
44
+ type="button"
45
+ >
46
+ <span
47
+ class="video-react-control-text"
48
+ >
49
+ Play
50
+ </span>
51
+ </button>
55
52
  <div
56
- class="video-react-menu"
53
+ class="video-react-volume-menu-button-horizontal video-react-vol-3 video-react-volume-menu-button video-react-menu-button-inline video-react-control video-react-button video-react-menu-button"
54
+ role="button"
55
+ tabindex="0"
57
56
  >
58
57
  <div
59
- class="video-react-menu-content"
58
+ class="video-react-menu"
60
59
  >
61
60
  <div
62
- aria-label="volume level"
63
- aria-valuemax="100"
64
- aria-valuemin="0"
65
- aria-valuenow="100.00"
66
- aria-valuetext="100.00%"
67
- class="video-react-volume-bar video-react-slider-bar video-react-slider-horizontal video-react-slider"
68
- role="slider"
69
- tabindex="0"
61
+ class="video-react-menu-content"
70
62
  >
71
63
  <div
72
- class="video-react-volume-level"
73
- style="width: 100.00%;"
64
+ aria-label="volume level"
65
+ aria-valuemax="100"
66
+ aria-valuemin="0"
67
+ aria-valuenow="100.00"
68
+ aria-valuetext="100.00%"
69
+ class="video-react-volume-bar video-react-slider-bar video-react-slider-horizontal video-react-slider"
70
+ role="slider"
71
+ tabindex="0"
74
72
  >
75
- <span
76
- class="video-react-control-text"
77
- />
73
+ <div
74
+ class="video-react-volume-level"
75
+ style="width: 100.00%;"
76
+ >
77
+ <span
78
+ class="video-react-control-text"
79
+ />
80
+ </div>
78
81
  </div>
79
82
  </div>
80
83
  </div>
81
84
  </div>
82
- </div>
83
- <div
84
- class="video-react-current-time video-react-time-control video-react-control"
85
- >
86
85
  <div
87
- aria-live="off"
88
- class="video-react-current-time-display"
86
+ class="video-react-current-time video-react-time-control video-react-control"
89
87
  >
90
- <span
91
- class="video-react-control-text"
88
+ <div
89
+ aria-live="off"
90
+ class="video-react-current-time-display"
92
91
  >
93
- Current Time
94
- </span>
95
- 0:00
96
- </div>
97
- </div>
98
- <div
99
- class="video-react-time-control video-react-time-divider"
100
- dir="ltr"
101
- >
102
- <div>
103
- <span>
104
- /
105
- </span>
92
+ <span
93
+ class="video-react-control-text"
94
+ >
95
+ Current Time
96
+ </span>
97
+ 0:00
98
+ </div>
106
99
  </div>
107
- </div>
108
- <div
109
- class="video-react-duration video-react-time-control video-react-control"
110
- >
111
100
  <div
112
- aria-live="off"
113
- class="video-react-duration-display"
101
+ class="video-react-time-control video-react-time-divider"
102
+ dir="ltr"
114
103
  >
115
- <span
116
- class="video-react-control-text"
117
- >
118
- Duration Time
119
- </span>
120
- 0:00
104
+ <div>
105
+ <span>
106
+ /
107
+ </span>
108
+ </div>
121
109
  </div>
122
- </div>
123
- <div
124
- class="video-react-progress-control video-react-control"
125
- >
126
110
  <div
127
- aria-label="video progress bar"
128
- aria-valuemax="100"
129
- aria-valuemin="0"
130
- aria-valuenow="NaN"
131
- aria-valuetext="0:00"
132
- class="video-react-progress-holder video-react-slider-horizontal video-react-slider"
133
- role="slider"
134
- tabindex="0"
111
+ class="video-react-duration video-react-time-control video-react-control"
135
112
  >
136
113
  <div
137
- class="video-react-play-progress video-react-slider-bar"
138
- data-current-time="0:00"
114
+ aria-live="off"
115
+ class="video-react-duration-display"
139
116
  >
140
117
  <span
141
118
  class="video-react-control-text"
142
119
  >
143
- Progress: NaN%
120
+ Duration Time
144
121
  </span>
122
+ 0:00
145
123
  </div>
146
124
  </div>
147
- </div>
148
- <button
149
- class="video-react-icon-fullscreen video-react-fullscreen-control video-react-control video-react-button video-react-icon"
150
- tabindex="0"
151
- type="button"
152
- >
153
- <span
154
- class="video-react-control-text"
125
+ <div
126
+ class="video-react-progress-control video-react-control"
155
127
  >
156
- Non-Fullscreen
157
- </span>
158
- </button>
128
+ <div
129
+ aria-label="video progress bar"
130
+ aria-valuemax="100"
131
+ aria-valuemin="0"
132
+ aria-valuenow="NaN"
133
+ aria-valuetext="0:00"
134
+ class="video-react-progress-holder video-react-slider-horizontal video-react-slider"
135
+ role="slider"
136
+ tabindex="0"
137
+ >
138
+ <div
139
+ class="video-react-play-progress video-react-slider-bar"
140
+ data-current-time="0:00"
141
+ >
142
+ <span
143
+ class="video-react-control-text"
144
+ >
145
+ Progress: NaN%
146
+ </span>
147
+ </div>
148
+ </div>
149
+ </div>
150
+ <button
151
+ class="video-react-icon-fullscreen video-react-fullscreen-control video-react-control video-react-button video-react-icon"
152
+ tabindex="0"
153
+ type="button"
154
+ >
155
+ <span
156
+ class="video-react-control-text"
157
+ >
158
+ Non-Fullscreen
159
+ </span>
160
+ </button>
161
+ </div>
159
162
  </div>
160
163
  </div>
161
164
  </DocumentFragment>
@@ -3,9 +3,9 @@
3
3
  exports[`BlazeLink component should render without throwing an error and match snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <a
6
+ aria-label="test-name"
6
7
  class="test-class"
7
8
  href="/test-href"
8
- name="test-name"
9
9
  >
10
10
  <div>
11
11
  child div
@@ -3,6 +3,7 @@
3
3
  exports[`Button component should render without throwing an error and match snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <a
6
+ aria-label="test"
6
7
  class="icon-button"
7
8
  href="http://google.com"
8
9
  rel="noopener nofollow"
@@ -5,6 +5,7 @@ exports[`Parse textBlock it should match snapshot 1`] = `
5
5
  <p>
6
6
  lorem ipsum
7
7
  <a
8
+ aria-label="link"
8
9
  href="/"
9
10
  >
10
11
  link
@@ -24,6 +24,8 @@ describe('Parse textBlock', () => {
24
24
 
25
25
  test('it should include a link tag', () => {
26
26
  const { container } = render(expectedMarkup);
27
- expect(container).toContainHTML("<a href='/'>link</a>");
27
+ expect(container).toContainHTML(
28
+ '<div><p>lorem ipsum <a aria-label="link" href="/">link</a></p></div>'
29
+ );
28
30
  });
29
31
  });
@@ -0,0 +1,50 @@
1
+ import React from 'react';
2
+ import { renderHook } from '@testing-library/react-hooks';
3
+ import { AppContext } from '@blaze-cms/nextjs-components';
4
+ import { useAppSyncEventHook } from '../../../../src/hooks';
5
+
6
+ describe('useAppSyncEventHook', () => {
7
+ test('should emit event with correct event name and data', () => {
8
+ const blazeAppMock = {
9
+ events: {
10
+ emit: jest.fn()
11
+ }
12
+ };
13
+
14
+ const eventName = 'testEvent';
15
+ const data = { key: 'value' };
16
+ const props = { someProp: 'value' };
17
+
18
+ const wrapper = ({ children }) => (
19
+ <AppContext.Provider value={{ blazeApp: blazeAppMock }}>{children}</AppContext.Provider>
20
+ );
21
+
22
+ const { result } = renderHook(() => useAppSyncEventHook({ eventName, data, props }), {
23
+ wrapper
24
+ });
25
+
26
+ expect(blazeAppMock.events.emit).toHaveBeenCalledWith(`plugin:page-builder:${eventName}:sync`, {
27
+ data,
28
+ props
29
+ });
30
+
31
+ expect(result.current.data).toEqual(data);
32
+ });
33
+
34
+ test('should return correct data', () => {
35
+ const blazeAppMock = {
36
+ events: {
37
+ emit: jest.fn()
38
+ }
39
+ };
40
+
41
+ const data = { key: 'value' };
42
+
43
+ const wrapper = ({ children }) => (
44
+ <AppContext.Provider value={{ blazeApp: blazeAppMock }}>{children}</AppContext.Provider>
45
+ );
46
+ const { result } = renderHook(() => useAppSyncEventHook({ data }), { wrapper });
47
+
48
+ expect(result.current.data).toEqual(data);
49
+ });
50
+ });
@@ -33,9 +33,14 @@ describe('variantHandler function', () => {
33
33
  expect(entries.length).toEqual(2);
34
34
  });
35
35
 
36
- it('should throw error if we try to add an object that has already been added', () => {
37
- expect(() => variantHandler.add('RandomVariant', () => <div />)).toThrow(
38
- 'Variant already exist'
39
- );
36
+ it('should call console.warn error if we try to add an object that has already been added', () => {
37
+ const { warn } = console;
38
+ // eslint-disable-next-line no-console
39
+ console.warn = jest.fn();
40
+ variantHandler.add('RandomVariant', () => <div />);
41
+ // eslint-disable-next-line no-console
42
+ expect(console.warn).toHaveBeenCalledWith('Variant already exists: RandomVariant');
43
+ // eslint-disable-next-line no-console
44
+ console.warn = warn;
40
45
  });
41
46
  });
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ import React from 'react';
5
+ import '@testing-library/jest-dom/extend-expect';
6
+ import { render, screen, waitFor } from '@testing-library/react';
7
+ import { MockedProvider } from '@apollo/client/testing';
8
+ import LongformGallery from '../../../../../src/variants/LongformGallery/LongformGallery';
9
+ import { IMAGE_MOCKS } from './constants';
10
+
11
+ const mockedProps = {
12
+ imageIds: ['1', '2', '3'],
13
+ priorityLimit: [0]
14
+ };
15
+ const longFormTestId = 'longform-gallery';
16
+
17
+ describe('LongformGallery', () => {
18
+ it('renders LongformGallery without error', async () => {
19
+ const { asFragment } = render(
20
+ <MockedProvider mocks={IMAGE_MOCKS}>
21
+ <LongformGallery {...mockedProps} />
22
+ </MockedProvider>
23
+ );
24
+ await waitFor(() => {
25
+ expect(screen.getByTestId(longFormTestId)).toBeInTheDocument();
26
+ });
27
+ expect(asFragment()).toMatchSnapshot();
28
+ expect(screen.getByTestId(longFormTestId)).toBeInTheDocument();
29
+ });
30
+
31
+ it('renders LongformGallery with two-group modifier if images length is 4', async () => {
32
+ const { asFragment } = render(
33
+ <MockedProvider mocks={IMAGE_MOCKS}>
34
+ <LongformGallery {...mockedProps} imageIds={['1', '2', '3', '4']} />
35
+ </MockedProvider>
36
+ );
37
+ await waitFor(() => {
38
+ expect(screen.getByTestId(longFormTestId)).toBeInTheDocument();
39
+ });
40
+ expect(asFragment()).toMatchSnapshot();
41
+ });
42
+ });
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ import React from 'react';
5
+ import { render, screen, fireEvent } from '@testing-library/react';
6
+ import '@testing-library/jest-dom/extend-expect';
7
+ import LongformGalleryImage from '../../../../../src/variants/LongformGallery/LongformGalleryImage';
8
+
9
+ const mockedProps = {
10
+ url: 'https://mock-url/image-id-1.jpg',
11
+ id: 'image-id-1',
12
+ caption: '',
13
+ altText: '',
14
+ priority: true,
15
+ className: 'longform-gallery__images__image main-image',
16
+ handleImageOnClick: jest.fn()
17
+ };
18
+
19
+ describe('LongformGalleryImage component', () => {
20
+ it('should be a function', () => {
21
+ expect(typeof LongformGalleryImage).toEqual('function');
22
+ });
23
+
24
+ it('renders LongformGalleryImage component', () => {
25
+ const { asFragment } = render(<LongformGalleryImage {...mockedProps} />);
26
+ expect(asFragment()).toMatchSnapshot();
27
+ expect(screen.getByTestId('longform-gallery__images__image__container')).toBeInTheDocument();
28
+ });
29
+
30
+ it('renders LongformGalleryImage component', () => {
31
+ const { asFragment } = render(
32
+ <LongformGalleryImage {...mockedProps} caption="some image caption" />
33
+ );
34
+ expect(asFragment()).toMatchSnapshot();
35
+ expect(screen.getByTestId('longform-gallery__images__image__details')).toBeInTheDocument();
36
+ });
37
+
38
+ it('calls handleImageOnClick when image is clicked', () => {
39
+ render(<LongformGalleryImage {...mockedProps} />);
40
+ const image = screen.getByTestId('longform-gallery__images__image__container');
41
+ fireEvent.click(image);
42
+ expect(mockedProps.handleImageOnClick).toHaveBeenCalledWith(mockedProps.id);
43
+ });
44
+ });
@@ -0,0 +1,99 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`LongformGallery renders LongformGallery with two-group modifier if images length is 4 1`] = `
4
+ <DocumentFragment>
5
+ <div
6
+ class="longform-gallery"
7
+ data-testid="longform-gallery"
8
+ >
9
+ <div
10
+ class="longform-gallery__images"
11
+ data-testid="grouped-images"
12
+ >
13
+ <div
14
+ class="longform-gallery__images__image main-image"
15
+ >
16
+ <div
17
+ class="longform-gallery__images__image__container"
18
+ data-testid="longform-gallery__images__image__container"
19
+ role="button"
20
+ />
21
+ </div>
22
+ <div
23
+ class="longform-gallery__images__image main-image"
24
+ >
25
+ <div
26
+ class="longform-gallery__images__image__container"
27
+ data-testid="longform-gallery__images__image__container"
28
+ role="button"
29
+ />
30
+ </div>
31
+ </div>
32
+ <div
33
+ class="longform-gallery__images"
34
+ data-testid="grouped-images"
35
+ >
36
+ <div
37
+ class="longform-gallery__images__image main-image"
38
+ >
39
+ <div
40
+ class="longform-gallery__images__image__container"
41
+ data-testid="longform-gallery__images__image__container"
42
+ role="button"
43
+ />
44
+ </div>
45
+ <div
46
+ class="longform-gallery__images__image main-image"
47
+ >
48
+ <div
49
+ class="longform-gallery__images__image__container"
50
+ data-testid="longform-gallery__images__image__container"
51
+ role="button"
52
+ />
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </DocumentFragment>
57
+ `;
58
+
59
+ exports[`LongformGallery renders LongformGallery without error 1`] = `
60
+ <DocumentFragment>
61
+ <div
62
+ class="longform-gallery"
63
+ data-testid="longform-gallery"
64
+ >
65
+ <div
66
+ class="longform-gallery__images"
67
+ data-testid="grouped-images"
68
+ >
69
+ <div
70
+ class="longform-gallery__images__image secondary-image"
71
+ >
72
+ <div
73
+ class="longform-gallery__images__image__container"
74
+ data-testid="longform-gallery__images__image__container"
75
+ role="button"
76
+ />
77
+ </div>
78
+ <div
79
+ class="longform-gallery__images__image secondary-image"
80
+ >
81
+ <div
82
+ class="longform-gallery__images__image__container"
83
+ data-testid="longform-gallery__images__image__container"
84
+ role="button"
85
+ />
86
+ </div>
87
+ <div
88
+ class="longform-gallery__images__image secondary-image"
89
+ >
90
+ <div
91
+ class="longform-gallery__images__image__container"
92
+ data-testid="longform-gallery__images__image__container"
93
+ role="button"
94
+ />
95
+ </div>
96
+ </div>
97
+ </div>
98
+ </DocumentFragment>
99
+ `;
@@ -0,0 +1,51 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`LongformGalleryImage component renders LongformGalleryImage component 1`] = `
4
+ <DocumentFragment>
5
+ <div
6
+ class="longform-gallery__images__image main-image"
7
+ >
8
+ <div
9
+ class="longform-gallery__images__image__container"
10
+ data-testid="longform-gallery__images__image__container"
11
+ role="button"
12
+ >
13
+ <img
14
+ alt=""
15
+ role="button"
16
+ src="https://mock-url/image-id-1.jpg"
17
+ />
18
+ </div>
19
+ </div>
20
+ </DocumentFragment>
21
+ `;
22
+
23
+ exports[`LongformGalleryImage component renders LongformGalleryImage component 2`] = `
24
+ <DocumentFragment>
25
+ <div
26
+ class="longform-gallery__images__image main-image"
27
+ >
28
+ <div
29
+ class="longform-gallery__images__image__container"
30
+ data-testid="longform-gallery__images__image__container"
31
+ role="button"
32
+ >
33
+ <img
34
+ alt=""
35
+ role="button"
36
+ src="https://mock-url/image-id-1.jpg"
37
+ />
38
+ </div>
39
+ <div
40
+ class="longform-gallery__images__image__details"
41
+ data-testid="longform-gallery__images__image__details"
42
+ >
43
+ <div
44
+ class="longform-gallery__images__image__details__caption"
45
+ >
46
+ some image caption
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </DocumentFragment>
51
+ `;
@@ -0,0 +1,37 @@
1
+ import { GET_IMAGES_QUERY } from '../../../../../src/variants/LongformGallery/constants';
2
+
3
+ const IMAGE_MOCKS = [
4
+ {
5
+ request: {
6
+ query: GET_IMAGES_QUERY,
7
+ variables: { where: { id: { _in: ['1', '2', '3'] } } }
8
+ },
9
+ result: {
10
+ data: {
11
+ getImages: [
12
+ { id: '1', url: 'image1.jpg', caption: 'Caption 1', data: {} },
13
+ { id: '2', url: 'image2.jpg', caption: 'Caption 2', data: {} },
14
+ { id: '3', url: 'image3.jpg', caption: 'Caption 3', data: {} }
15
+ ]
16
+ }
17
+ }
18
+ },
19
+ {
20
+ request: {
21
+ query: GET_IMAGES_QUERY,
22
+ variables: { where: { id: { _in: ['1', '2', '3', '4'] } } }
23
+ },
24
+ result: {
25
+ data: {
26
+ getImages: [
27
+ { id: '1', url: 'image1.jpg', caption: 'Caption 1', data: {} },
28
+ { id: '2', url: 'image2.jpg', caption: 'Caption 2', data: {} },
29
+ { id: '3', url: 'image3.jpg', caption: 'Caption 3', data: {} },
30
+ { id: '4', url: 'image4.jpg', caption: 'Caption 4', data: {} }
31
+ ]
32
+ }
33
+ }
34
+ }
35
+ ];
36
+
37
+ export { IMAGE_MOCKS };