pds-dev-kit-web 2.1.14 → 2.1.15

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 (199) hide show
  1. package/dist/src/common/styles/colorSet/index.d.ts +2 -2
  2. package/dist/src/common/styles/colorSet/index.js +2 -2
  3. package/dist/src/sub/DynamicLayout/DynamicLayout.js +1 -0
  4. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Image/Image.d.ts +8 -0
  5. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Image/Image.js +46 -0
  6. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Image/index.d.ts +2 -0
  7. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Image/index.js +8 -0
  8. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/RichText/RichText.d.ts +6 -0
  9. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/RichText/RichText.js +24 -0
  10. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/RichText/index.d.ts +2 -0
  11. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/RichText/index.js +8 -0
  12. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Text/Text.d.ts +13 -0
  13. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Text/Text.js +63 -0
  14. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Text/index.d.ts +2 -0
  15. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Text/index.js +8 -0
  16. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/TwitterTimeline/TwitterTimeline.d.ts +70 -0
  17. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/TwitterTimeline/TwitterTimeline.js +52 -0
  18. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/TwitterTimeline/TwitterTimelineRerender.d.ts +14 -0
  19. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/TwitterTimeline/TwitterTimelineRerender.js +41 -0
  20. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/TwitterTimeline/index.d.ts +2 -0
  21. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/TwitterTimeline/index.js +8 -0
  22. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Wrapper/Wrapper.d.ts +35 -0
  23. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Wrapper/Wrapper.js +141 -0
  24. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Wrapper/constants.d.ts +2 -0
  25. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Wrapper/constants.js +33 -0
  26. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Wrapper/index.d.ts +1 -0
  27. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/Wrapper/index.js +8 -0
  28. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/index.d.ts +4 -0
  29. package/dist/src/sub/DynamicLayout/components/ComponentBlocks/index.js +9 -0
  30. package/dist/src/sub/DynamicLayout/components/EditModeSectionMatcher/EditModeSectionMatcher.js +3 -0
  31. package/dist/src/sub/DynamicLayout/components/Section/CustomSection.d.ts +11 -0
  32. package/dist/src/sub/DynamicLayout/components/Section/CustomSection.js +46 -0
  33. package/dist/src/sub/DynamicLayout/components/Section/ErrorBoundary/ErrorBoundary.d.ts +15 -0
  34. package/dist/src/sub/DynamicLayout/components/Section/ErrorBoundary/ErrorBoundary.js +62 -0
  35. package/dist/src/sub/DynamicLayout/components/Section/ErrorBoundary/index.d.ts +1 -0
  36. package/dist/src/sub/DynamicLayout/components/Section/ErrorBoundary/index.js +8 -0
  37. package/dist/src/sub/DynamicLayout/components/Section/Section.d.ts +6 -3
  38. package/dist/src/sub/DynamicLayout/components/Section/Section.js +4 -2
  39. package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackground.d.ts +5 -0
  40. package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackground.js +72 -0
  41. package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackgroundMedia.d.ts +14 -0
  42. package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackgroundMedia.js +119 -0
  43. package/dist/src/sub/DynamicLayout/components/Section/index.d.ts +1 -0
  44. package/dist/src/sub/DynamicLayout/components/Section/index.js +3 -1
  45. package/dist/src/sub/DynamicLayout/components/Section/util/index.d.ts +1 -0
  46. package/dist/src/sub/DynamicLayout/components/Section/util/index.js +8 -0
  47. package/dist/src/sub/DynamicLayout/components/Section/util/parseSectionBackgroundMediaData.d.ts +6 -0
  48. package/dist/src/sub/DynamicLayout/components/Section/util/parseSectionBackgroundMediaData.js +38 -0
  49. package/dist/src/sub/DynamicLayout/components/SectionMatcher/SectionMatcher.js +4 -1
  50. package/dist/src/sub/DynamicLayout/components/YouTubeIframe/YouTubeIframe.d.ts +6 -1
  51. package/dist/src/sub/DynamicLayout/components/YouTubeIframe/YouTubeIframe.js +35 -7
  52. package/dist/src/sub/DynamicLayout/components/index.d.ts +1 -1
  53. package/dist/src/sub/DynamicLayout/components/index.js +2 -1
  54. package/dist/src/sub/DynamicLayout/mock_customSection.d.ts +2 -0
  55. package/dist/src/sub/DynamicLayout/mock_customSection.js +837 -0
  56. package/dist/src/sub/DynamicLayout/mock_samplePage.js +2082 -9
  57. package/dist/src/sub/DynamicLayout/nakedMocks.json +847 -0
  58. package/dist/src/sub/DynamicLayout/pagesPreviewMock.d.ts +379 -0
  59. package/dist/src/sub/DynamicLayout/pagesPreviewMock.js +386 -0
  60. package/dist/src/sub/DynamicLayout/sectionActionTypes.d.ts +29 -0
  61. package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.d.ts +5 -0
  62. package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +193 -0
  63. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlock.d.ts +7 -0
  64. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlock.js +55 -0
  65. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.d.ts +9 -0
  66. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.js +50 -0
  67. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.d.ts +5 -0
  68. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +80 -0
  69. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/btnTypes.d.ts +76 -0
  70. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/btnTypes.js +2 -0
  71. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Divider/Divider.d.ts +5 -0
  72. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Divider/Divider.js +71 -0
  73. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image/Image.d.ts +5 -0
  74. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image/Image.js +107 -0
  75. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image/types.d.ts +12 -0
  76. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image/types.js +2 -0
  77. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/RichText.d.ts +5 -0
  78. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/RichText.js +66 -0
  79. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/index.d.ts +1 -0
  80. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/index.js +8 -0
  81. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/types.d.ts +44 -0
  82. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/types.js +2 -0
  83. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.d.ts +5 -0
  84. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +65 -0
  85. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/types.d.ts +38 -0
  86. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/types.js +2 -0
  87. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Twitter/Twitter.d.ts +5 -0
  88. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Twitter/Twitter.js +50 -0
  89. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Twitter/types.d.ts +6 -0
  90. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Twitter/types.js +2 -0
  91. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/Youtube.d.ts +5 -0
  92. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/Youtube.js +73 -0
  93. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/index.d.ts +1 -0
  94. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/index.js +8 -0
  95. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/parseYoutubeContentProp.d.ts +7 -0
  96. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/parseYoutubeContentProp.js +33 -0
  97. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/types.d.ts +48 -0
  98. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/types.js +2 -0
  99. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_AnimationObserverBox.d.ts +6 -0
  100. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_AnimationObserverBox.js +27 -0
  101. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_Box.d.ts +2 -0
  102. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_Box.js +46 -0
  103. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_BoxWithShadow.d.ts +11 -0
  104. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_BoxWithShadow.js +102 -0
  105. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_HiddenCover.d.ts +1 -0
  106. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_HiddenCover.js +13 -0
  107. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/hooks/useCLINK.d.ts +12 -0
  108. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/hooks/useCLINK.js +35 -0
  109. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.d.ts +21 -0
  110. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.js +2 -0
  111. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/utils/CLINKhandler.d.ts +0 -0
  112. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/utils/CLINKhandler.js +18 -0
  113. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/index.d.ts +1 -0
  114. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/index.js +8 -0
  115. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/index.d.ts +1 -0
  116. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/index.js +5 -0
  117. package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/index.d.ts +1 -0
  118. package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/index.js +5 -0
  119. package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useIntersectionObserver.d.ts +6 -0
  120. package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useIntersectionObserver.js +26 -0
  121. package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useRefDimensions.d.ts +5 -0
  122. package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useRefDimensions.js +19 -0
  123. package/dist/src/sub/DynamicLayout/sections/CustomSection/index.d.ts +1 -0
  124. package/dist/src/sub/DynamicLayout/sections/CustomSection/index.js +8 -0
  125. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/colorUtil.d.ts +31 -0
  126. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/colorUtil.js +71 -0
  127. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/index.d.ts +2 -0
  128. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/index.js +10 -0
  129. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/replaceUndefinedValues.d.ts +2 -0
  130. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/replaceUndefinedValues.js +40 -0
  131. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.d.ts +18 -0
  132. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.js +200 -0
  133. package/dist/src/sub/DynamicLayout/sections/CustomSection/types.d.ts +50 -0
  134. package/dist/src/sub/DynamicLayout/sections/CustomSection/types.js +13 -0
  135. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/contentPropParsers/index.d.ts +3 -0
  136. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/contentPropParsers/index.js +16 -0
  137. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/contentPropParsers/parseContentVisibility.d.ts +12 -0
  138. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/contentPropParsers/parseContentVisibility.js +18 -0
  139. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/contentPropParsers/types.d.ts +5 -0
  140. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/contentPropParsers/types.js +7 -0
  141. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/constants.d.ts +4 -0
  142. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/constants.js +46 -0
  143. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/index.d.ts +3 -0
  144. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/index.js +16 -0
  145. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/parseEffectPropEntAnim.d.ts +19 -0
  146. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/parseEffectPropEntAnim.js +51 -0
  147. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/types.d.ts +5 -0
  148. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/types.js +7 -0
  149. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/index.d.ts +8 -0
  150. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/index.js +22 -0
  151. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/isNullOrUndefined.d.ts +2 -0
  152. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/isNullOrUndefined.js +9 -0
  153. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/index.d.ts +3 -0
  154. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/index.js +19 -0
  155. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/parseLayoutPropArrange.d.ts +24 -0
  156. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/parseLayoutPropArrange.js +80 -0
  157. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/parseLayoutPropPadding.d.ts +23 -0
  158. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/parseLayoutPropPadding.js +32 -0
  159. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/parseSectionPadding.d.ts +23 -0
  160. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/parseSectionPadding.js +26 -0
  161. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/types.d.ts +7 -0
  162. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/types.js +8 -0
  163. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseCustomSectionPlacement.d.ts +20 -0
  164. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseCustomSectionPlacement.js +24 -0
  165. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseJsonProperties.d.ts +3 -0
  166. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseJsonProperties.js +67 -0
  167. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.d.ts +20 -0
  168. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.js +46 -0
  169. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseProperties.d.ts +5 -0
  170. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseProperties.js +54 -0
  171. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/index.d.ts +3 -0
  172. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/index.js +41 -0
  173. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgColor.d.ts +43 -0
  174. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgColor.js +92 -0
  175. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgImage.d.ts +23 -0
  176. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgImage.js +94 -0
  177. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgOverlay.d.ts +43 -0
  178. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgOverlay.js +95 -0
  179. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBorder.d.ts +39 -0
  180. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBorder.js +85 -0
  181. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropDivider.d.ts +27 -0
  182. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropDivider.js +77 -0
  183. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropImage.d.ts +19 -0
  184. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropImage.js +94 -0
  185. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropOpacity.d.ts +15 -0
  186. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropOpacity.js +47 -0
  187. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropShadow.d.ts +39 -0
  188. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropShadow.js +58 -0
  189. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropTextSpec.d.ts +8 -0
  190. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropTextSpec.js +91 -0
  191. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/types.d.ts +22 -0
  192. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/types.js +16 -0
  193. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +134 -0
  194. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.js +2 -0
  195. package/dist/src/sub/DynamicLayout/sections/index.d.ts +1 -0
  196. package/dist/src/sub/DynamicLayout/sections/index.js +3 -1
  197. package/dist/src/sub/DynamicLayout/types.d.ts +77 -5
  198. package/package.json +2 -1
  199. package/release-note.md +3 -19
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WrapperDefaultOptions = void 0;
4
+ exports.WrapperDefaultOptions = {
5
+ width: 600,
6
+ height: 400,
7
+ alignHorizontal: 'center',
8
+ alignVertical: 'center',
9
+ paddingBottom: 20,
10
+ paddingLeft: 20,
11
+ paddingRight: 20,
12
+ paddingTop: 20,
13
+ zIndex: 0,
14
+ borderType: 'dotted',
15
+ borderSize: 5,
16
+ borderColor: 'dodgerblue',
17
+ borderRadius: 30,
18
+ backgroundType: 'gradient',
19
+ backgroundColor: 'gray',
20
+ backgroundGradientType: 'circular',
21
+ backgroundGradientStartColor: 'blue',
22
+ backgroundGradientStartPosition: 0,
23
+ backgroundGradientEndColor: 'lightblue',
24
+ backgroundGradientEndPosition: 100,
25
+ backgroundGradientDegree: 90,
26
+ shadowType: 'outside',
27
+ shadowColor: 'gray',
28
+ shadowHorizontalDistance: 15,
29
+ shadowVerticalDistance: 10,
30
+ shadowBlur: 3,
31
+ shadowSpread: 3,
32
+ opacity: 0.85
33
+ };
@@ -0,0 +1 @@
1
+ export { default as Wrapper } from './Wrapper';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Wrapper = void 0;
7
+ var Wrapper_1 = require("./Wrapper");
8
+ Object.defineProperty(exports, "Wrapper", { enumerable: true, get: function () { return __importDefault(Wrapper_1).default; } });
@@ -0,0 +1,4 @@
1
+ import { RichText, RichTextPropTypes } from './RichText';
2
+ import { Text, TextPropTypes } from './Text';
3
+ import { TwitterTimeline } from './TwitterTimeline';
4
+ export { RichText, RichTextPropTypes, Text, TextPropTypes, TwitterTimeline };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TwitterTimeline = exports.Text = exports.RichText = void 0;
4
+ var RichText_1 = require("./RichText");
5
+ Object.defineProperty(exports, "RichText", { enumerable: true, get: function () { return RichText_1.RichText; } });
6
+ var Text_1 = require("./Text");
7
+ Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return Text_1.Text; } });
8
+ var TwitterTimeline_1 = require("./TwitterTimeline");
9
+ Object.defineProperty(exports, "TwitterTimeline", { enumerable: true, get: function () { return TwitterTimeline_1.TwitterTimeline; } });
@@ -36,6 +36,9 @@ function EditModeSectionMatcher(_a) {
36
36
  exports.default = EditModeSectionMatcher;
37
37
  function Matcher(_a) {
38
38
  var props = __rest(_a, []);
39
+ if (props.type === 'CUSTOM') {
40
+ return (0, jsx_runtime_1.jsx)(sections_1.CustomSection, __assign({}, props), void 0);
41
+ }
39
42
  var schema = props.manifest.schema;
40
43
  switch (schema) {
41
44
  case 'BASE_INTRO':
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { CSSProperties } from 'styled-components';
3
+ import type { ISection } from '../../types';
4
+ declare type SectionPropTypes = ISection & {
5
+ children?: React.ReactNode;
6
+ } & {
7
+ overrideStyles?: CSSProperties;
8
+ isMobile?: boolean;
9
+ };
10
+ declare function CustomSection({ children, overrideStyles, isMobile, ...props }: SectionPropTypes): JSX.Element;
11
+ export default CustomSection;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __rest = (this && this.__rest) || function (s, e) {
18
+ var t = {};
19
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
20
+ t[p] = s[p];
21
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
22
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
23
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
24
+ t[p[i]] = s[p[i]];
25
+ }
26
+ return t;
27
+ };
28
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ var jsx_runtime_1 = require("react/jsx-runtime");
33
+ var styled_components_1 = __importDefault(require("styled-components"));
34
+ var CustomSectionBackground_1 = __importDefault(require("./components/CustomSectionBackground"));
35
+ var sectionContext_1 = require("./sectionContext");
36
+ function CustomSection(_a) {
37
+ var _b;
38
+ var children = _a.children, overrideStyles = _a.overrideStyles, _c = _a.isMobile, isMobile = _c === void 0 ? false : _c, props = __rest(_a, ["children", "overrideStyles", "isMobile"]);
39
+ return ((0, jsx_runtime_1.jsx)(sectionContext_1.sectionContext.Provider, __assign({ value: __assign({}, props) }, { children: (0, jsx_runtime_1.jsxs)(S_Section, __assign({ style: overrideStyles, isIframeSection: ((_b = props.manifest) === null || _b === void 0 ? void 0 : _b.schema) === 'EXP_IFRAME' }, { children: [(0, jsx_runtime_1.jsx)(CustomSectionBackground_1.default, { isMobile: isMobile }, void 0), children] }), void 0) }), void 0));
40
+ }
41
+ var S_Section = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n box-sizing: border-box;\n display: flex;\n height: ", ";\n justify-content: center;\n position: relative;\n width: 100%;\n z-index: 0;\n"], ["\n align-items: center;\n box-sizing: border-box;\n display: flex;\n height: ", ";\n justify-content: center;\n position: relative;\n width: 100%;\n z-index: 0;\n"])), function (_a) {
42
+ var isIframeSection = _a.isIframeSection;
43
+ return (isIframeSection ? '100%' : 'auto');
44
+ });
45
+ exports.default = CustomSection;
46
+ var templateObject_1;
@@ -0,0 +1,15 @@
1
+ import React, { Component, ErrorInfo, ReactNode } from 'react';
2
+ declare type Props = {
3
+ children: ReactNode;
4
+ };
5
+ declare type State = {
6
+ hasError: boolean;
7
+ };
8
+ declare class ErrorBoundary extends Component<Props, State> {
9
+ constructor(props: Props);
10
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
11
+ static getDerivedStateFromError(): State;
12
+ reset(): void;
13
+ render(): React.ReactNode;
14
+ }
15
+ export default ErrorBoundary;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
18
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
19
+ return cooked;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ var jsx_runtime_1 = require("react/jsx-runtime");
26
+ /* eslint-disable react/destructuring-assignment */
27
+ /* eslint-disable no-console */
28
+ var react_1 = require("react");
29
+ var styled_components_1 = __importDefault(require("styled-components"));
30
+ var ErrorBoundary = /** @class */ (function (_super) {
31
+ __extends(ErrorBoundary, _super);
32
+ function ErrorBoundary(props) {
33
+ var _this = _super.call(this, props) || this;
34
+ _this.state = {
35
+ hasError: false
36
+ };
37
+ return _this;
38
+ }
39
+ ErrorBoundary.prototype.componentDidCatch = function (error, errorInfo) {
40
+ console.error('Uncaught error:', error, errorInfo);
41
+ };
42
+ ErrorBoundary.getDerivedStateFromError = function () {
43
+ return { hasError: true };
44
+ };
45
+ ErrorBoundary.prototype.reset = function () {
46
+ this.setState({
47
+ hasError: false
48
+ });
49
+ };
50
+ ErrorBoundary.prototype.render = function () {
51
+ var hasError = this.state.hasError;
52
+ if (hasError) {
53
+ return (0, jsx_runtime_1.jsx)(ErrorWrapper, { children: "Error" }, void 0);
54
+ }
55
+ var children = this.props.children;
56
+ return children;
57
+ };
58
+ return ErrorBoundary;
59
+ }(react_1.Component));
60
+ var ErrorWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n flex-direction: row;\n height: 100%;\n justify-content: center;\n width: 100%;\n"], ["\n align-items: center;\n display: flex;\n flex-direction: row;\n height: 100%;\n justify-content: center;\n width: 100%;\n"])));
61
+ exports.default = ErrorBoundary;
62
+ var templateObject_1;
@@ -0,0 +1 @@
1
+ export { default as ErrorBoundary } from './ErrorBoundary';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ErrorBoundary = void 0;
7
+ var ErrorBoundary_1 = require("./ErrorBoundary");
8
+ Object.defineProperty(exports, "ErrorBoundary", { enumerable: true, get: function () { return __importDefault(ErrorBoundary_1).default; } });
@@ -1,6 +1,9 @@
1
- /// <reference types="react" />
1
+ import { CSSProperties } from 'react';
2
2
  import type { ISection } from '../../types';
3
- declare function Section({ children, ...props }: ISection & {
3
+ declare type SectionPropTypes = ISection & {
4
4
  children?: React.ReactNode;
5
- }): JSX.Element;
5
+ } & {
6
+ overrideStyles?: CSSProperties;
7
+ };
8
+ declare function Section({ children, overrideStyles, ...props }: SectionPropTypes): JSX.Element;
6
9
  export default Section;
@@ -36,8 +36,10 @@ var pdsOriginal_1 = require("../pdsOriginal");
36
36
  var YouTubeIframe_1 = require("../YouTubeIframe");
37
37
  var sectionContext_1 = require("./sectionContext");
38
38
  function Section(_a) {
39
- var children = _a.children, props = __rest(_a, ["children"]);
40
- return ((0, jsx_runtime_1.jsx)(sectionContext_1.sectionContext.Provider, __assign({ value: props }, { children: (0, jsx_runtime_1.jsxs)(S_Section, __assign({ isIframeSection: props.manifest.schema === 'EXP_IFRAME' }, { children: [(0, jsx_runtime_1.jsx)(Background, {}, void 0), children] }), void 0) }), void 0));
39
+ var _b;
40
+ var children = _a.children, overrideStyles = _a.overrideStyles, props = __rest(_a, ["children", "overrideStyles"]);
41
+ var _c = (0, react_1.useState)(false), isHover = _c[0], setIsHover = _c[1];
42
+ return ((0, jsx_runtime_1.jsx)(sectionContext_1.sectionContext.Provider, __assign({ value: __assign({}, props) }, { children: (0, jsx_runtime_1.jsxs)(S_Section, __assign({ style: overrideStyles, isIframeSection: ((_b = props.manifest) === null || _b === void 0 ? void 0 : _b.schema) === 'EXP_IFRAME', onMouseEnter: function () { return setIsHover(true); }, onMouseMove: function () { return !isHover && setIsHover(true); }, onMouseLeave: function () { return setIsHover(false); } }, { children: [(0, jsx_runtime_1.jsx)(Background, {}, void 0), children] }), void 0) }), void 0));
41
43
  }
42
44
  var S_Section = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n box-sizing: border-box;\n height: ", ";\n position: relative;\n width: 100%;\n z-index: 0;\n"], ["\n box-sizing: border-box;\n height: ", ";\n position: relative;\n width: 100%;\n z-index: 0;\n"])), function (_a) {
43
45
  var isIframeSection = _a.isIframeSection;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare function CustomSectionBackground({ isMobile }: {
3
+ isMobile?: boolean;
4
+ }): JSX.Element;
5
+ export default CustomSectionBackground;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ var jsx_runtime_1 = require("react/jsx-runtime");
22
+ var react_1 = require("react");
23
+ var util_1 = require("../../../../DynamicLayout/sections/CustomSection/util");
24
+ var isNullOrUndefined_1 = __importDefault(require("../../../../DynamicLayout/sections/CustomSection/util/isNullOrUndefined"));
25
+ var styled_components_1 = __importDefault(require("styled-components"));
26
+ var sectionContext_1 = require("../sectionContext");
27
+ var CustomSectionBackgroundMedia_1 = require("./CustomSectionBackgroundMedia");
28
+ function CustomSectionBackground(_a) {
29
+ var _b = _a.isMobile, isMobile = _b === void 0 ? false : _b;
30
+ var context = (0, react_1.useContext)(sectionContext_1.sectionContext);
31
+ var id = context.id, jsonProperties = context.jsonProperties;
32
+ var backgroundRef = (0, react_1.useRef)(null);
33
+ var _c = jsonProperties || {}, CB_STYLE_PROP_BGOVERLAY = _c.CB_STYLE_PROP_BGOVERLAY, CB_STYLE_PROP_BGMEDIA = _c.CB_STYLE_PROP_BGMEDIA;
34
+ var _d = (0, util_1.parseJsonProperties)(jsonProperties, isMobile ? 'MOBILE' : 'DESKTOP'), style = _d.style, overlayStyle = _d.overlayStyle, effect = _d.effect;
35
+ var isOverlay = getIsOverlay(isMobile, CB_STYLE_PROP_BGOVERLAY);
36
+ var isBgMedia = getIsBgMedia(isMobile, CB_STYLE_PROP_BGMEDIA);
37
+ var mediaType = getMediaType(isMobile, CB_STYLE_PROP_BGMEDIA);
38
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isOverlay && CB_STYLE_PROP_BGOVERLAY && ((0, jsx_runtime_1.jsx)(S_CustomBackgroundOverlay, { className: "Overlay", style: __assign({}, overlayStyle) }, void 0)), (0, jsx_runtime_1.jsx)(S_CustomBackgroundWrapper, __assign({ className: "CustomSection", ref: backgroundRef, style: __assign(__assign({}, effect), { background: style.background }) }, { children: isBgMedia && CB_STYLE_PROP_BGMEDIA && ((0, jsx_runtime_1.jsx)(CustomSectionBackgroundMedia_1.CustomSectionBackgroundMedia, { specs: CB_STYLE_PROP_BGMEDIA, componentStyle: style, playerId: id, mediaType: mediaType || 'NONE', device: isMobile ? 'MOBILE' : 'DESKTOP', backgroundRef: backgroundRef }, void 0)) }), void 0)] }, void 0));
39
+ }
40
+ function getIsOverlay(isMobile, specs) {
41
+ if (!specs) {
42
+ return false;
43
+ }
44
+ if (isMobile) {
45
+ return specs['CB_STYLE_PROP_BGOVERLAY_SPEC_TYPE:MOBILE'] !== 'NONE';
46
+ }
47
+ return specs.CB_STYLE_PROP_BGOVERLAY_SPEC_TYPE !== 'NONE';
48
+ }
49
+ function getIsBgMedia(isMobile, specs) {
50
+ if (!specs) {
51
+ return false;
52
+ }
53
+ if (isMobile) {
54
+ return specs['CB_STYLE_PROP_BGMEDIA_SPEC_TYPE:MOBILE'] !== 'NONE';
55
+ }
56
+ return specs.CB_STYLE_PROP_BGMEDIA_SPEC_TYPE !== 'NONE';
57
+ }
58
+ function getMediaType(isMobile, specs) {
59
+ if (!specs) {
60
+ return 'NONE';
61
+ }
62
+ if (isMobile) {
63
+ return (0, isNullOrUndefined_1.default)(specs['CB_STYLE_PROP_BGMEDIA_SPEC_TYPE:MOBILE'])
64
+ ? specs.CB_STYLE_PROP_BGMEDIA_SPEC_TYPE
65
+ : specs['CB_STYLE_PROP_BGMEDIA_SPEC_TYPE:MOBILE'];
66
+ }
67
+ return specs.CB_STYLE_PROP_BGMEDIA_SPEC_TYPE;
68
+ }
69
+ var S_CustomBackgroundWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n bottom: 0;\n display: flex;\n justify-content: center;\n left: 0;\n overflow: hidden;\n position: absolute;\n right: 0;\n top: 0;\n z-index: -2;\n"], ["\n align-items: center;\n bottom: 0;\n display: flex;\n justify-content: center;\n left: 0;\n overflow: hidden;\n position: absolute;\n right: 0;\n top: 0;\n z-index: -2;\n"])));
70
+ var S_CustomBackgroundOverlay = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n z-index: -1;\n"], ["\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n z-index: -1;\n"])));
71
+ exports.default = CustomSectionBackground;
72
+ var templateObject_1, templateObject_2;
@@ -0,0 +1,14 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { CSSProperties } from 'styled-components';
3
+ import type { Device } from '../../../../DynamicLayout/sections/CustomSection/util/types';
4
+ import type { CB_STYLE_PROP_BGMEDIA_SPECS } from '../../../../DynamicLayout/types';
5
+ declare type Props = {
6
+ specs: CB_STYLE_PROP_BGMEDIA_SPECS;
7
+ playerId: number;
8
+ mediaType: string;
9
+ componentStyle: CSSProperties;
10
+ device: Device;
11
+ backgroundRef: MutableRefObject<HTMLDivElement | null>;
12
+ };
13
+ export declare function CustomSectionBackgroundMedia({ specs, playerId, mediaType, componentStyle, device, backgroundRef }: Props): JSX.Element;
14
+ export {};
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.CustomSectionBackgroundMedia = void 0;
38
+ var jsx_runtime_1 = require("react/jsx-runtime");
39
+ var react_1 = require("react");
40
+ var styled_components_1 = __importStar(require("styled-components"));
41
+ var YouTubeIframe_1 = require("../../YouTubeIframe");
42
+ var util_1 = require("../util");
43
+ function CustomSectionBackgroundMedia(_a) {
44
+ var specs = _a.specs, playerId = _a.playerId, mediaType = _a.mediaType, componentStyle = _a.componentStyle, device = _a.device, backgroundRef = _a.backgroundRef;
45
+ var _b = (0, util_1.parseSectionBackgroundMediaData)(specs, device), CB_STYLE_PROP_BGMEDIA_SPEC_YSRC = _b.CB_STYLE_PROP_BGMEDIA_SPEC_YSRC, CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY = _b.CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY, CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME = _b.CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME, CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME = _b.CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME, CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR = _b.CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR;
46
+ var _c = (0, react_1.useState)({ width: 0, height: 0 }), youtubeSize = _c[0], setYoutubeSize = _c[1];
47
+ var getResponsiveYoutubeSize = (0, react_1.useCallback)(function () {
48
+ var backgroundWrapper = backgroundRef.current;
49
+ if (!backgroundWrapper)
50
+ return { width: 0, height: 0 };
51
+ var backgroundSize = {
52
+ width: backgroundWrapper.getBoundingClientRect().width,
53
+ height: backgroundWrapper.getBoundingClientRect().height
54
+ };
55
+ var isHorizontal = backgroundSize.width / backgroundSize.height > 1;
56
+ var isOverRatio = backgroundSize.width / backgroundSize.height > 16 / 9;
57
+ var youtubeSize = isHorizontal && isOverRatio
58
+ ? { width: backgroundSize.width, height: backgroundSize.width * (9 / 16) }
59
+ : { width: backgroundSize.height * (16 / 9), height: backgroundSize.height };
60
+ return youtubeSize;
61
+ }, [backgroundRef.current]);
62
+ (0, react_1.useEffect)(function () {
63
+ if (mediaType !== 'YOUTUBE')
64
+ return;
65
+ setYoutubeSize(getResponsiveYoutubeSize());
66
+ }, [getResponsiveYoutubeSize, CB_STYLE_PROP_BGMEDIA_SPEC_YSRC]);
67
+ (0, react_1.useEffect)(function () {
68
+ if (mediaType !== 'YOUTUBE')
69
+ return;
70
+ function onResize() {
71
+ setYoutubeSize(getResponsiveYoutubeSize());
72
+ }
73
+ var element = backgroundRef.current;
74
+ if (!element)
75
+ return;
76
+ var observer = new ResizeObserver(function (entries) {
77
+ entries.forEach(function () {
78
+ onResize();
79
+ });
80
+ });
81
+ observer.observe(element);
82
+ return function () {
83
+ observer.disconnect();
84
+ };
85
+ }, [device, specs, playerId, mediaType]);
86
+ if ('background' in componentStyle) {
87
+ delete componentStyle.background;
88
+ }
89
+ switch (mediaType) {
90
+ case 'IMAGE':
91
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR && ((0, jsx_runtime_1.jsx)(S_Image, __assign({ src: String(CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR), normalStyle: componentStyle }, { children: (0, jsx_runtime_1.jsx)("img", { src: String(CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR), style: { visibility: 'hidden', width: '100%', height: '100%' } }, void 0) }), void 0)) }, void 0));
92
+ case 'YOUTUBE':
93
+ return ((0, jsx_runtime_1.jsx)(S_YoutubeContainer, __assign({}, youtubeSize, { children: youtubeSize.height > 0 && youtubeSize.width > 0 && ((0, jsx_runtime_1.jsx)(YouTubeIframe_1.YouTubeIframe, { id: playerId, src: String(CB_STYLE_PROP_BGMEDIA_SPEC_YSRC), loopMode: CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY ? 'use' : 'none', startSeconds: Number(CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME), endSeconds: Number(CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME), customHeight: youtubeSize.height, customWidth: youtubeSize.width }, void 0)) }), void 0));
94
+ case 'NONE':
95
+ default:
96
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}, void 0);
97
+ }
98
+ }
99
+ exports.CustomSectionBackgroundMedia = CustomSectionBackgroundMedia;
100
+ var S_Image = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-image: ", ";\n background-repeat: no-repeat;\n height: 100%;\n width: 100%;\n\n ", ";\n\n & img {\n ", ";\n }\n"], ["\n background-image: ", ";\n background-repeat: no-repeat;\n height: 100%;\n width: 100%;\n\n ", ";\n\n & img {\n ", ";\n }\n"])), function (_a) {
101
+ var src = _a.src;
102
+ return "url(" + src + ")";
103
+ }, function (_a) {
104
+ var normalStyle = _a.normalStyle;
105
+ var isContain = normalStyle.backgroundSize === 'contain';
106
+ return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), __assign(__assign({}, normalStyle), { backgroundPosition: isContain ? 'center' : normalStyle.backgroundPosition }));
107
+ }, function (_a) {
108
+ var normalStyle = _a.normalStyle;
109
+ var isContain = normalStyle.backgroundSize === 'contain';
110
+ return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n object-fit: ", ";\n "], ["\n object-fit: ", ";\n "])), isContain ? 'contain' : 'cover');
111
+ });
112
+ var S_YoutubeContainer = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: ", ";\n width: ", ";\n"], ["\n height: ", ";\n width: ", ";\n"])), function (_a) {
113
+ var height = _a.height;
114
+ return height + "px";
115
+ }, function (_a) {
116
+ var width = _a.width;
117
+ return width + "px";
118
+ });
119
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -1,2 +1,3 @@
1
+ export { default as CustomSection } from './CustomSection';
1
2
  export { default as Section } from './Section';
2
3
  export { sectionContext } from './sectionContext';
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.sectionContext = exports.Section = void 0;
6
+ exports.sectionContext = exports.Section = exports.CustomSection = void 0;
7
+ var CustomSection_1 = require("./CustomSection");
8
+ Object.defineProperty(exports, "CustomSection", { enumerable: true, get: function () { return __importDefault(CustomSection_1).default; } });
7
9
  var Section_1 = require("./Section");
8
10
  Object.defineProperty(exports, "Section", { enumerable: true, get: function () { return __importDefault(Section_1).default; } });
9
11
  var sectionContext_1 = require("./sectionContext");
@@ -0,0 +1 @@
1
+ export { default as parseSectionBackgroundMediaData } from './parseSectionBackgroundMediaData';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.parseSectionBackgroundMediaData = void 0;
7
+ var parseSectionBackgroundMediaData_1 = require("./parseSectionBackgroundMediaData");
8
+ Object.defineProperty(exports, "parseSectionBackgroundMediaData", { enumerable: true, get: function () { return __importDefault(parseSectionBackgroundMediaData_1).default; } });
@@ -0,0 +1,6 @@
1
+ import type { Device } from '../../../../DynamicLayout/sections/CustomSection/util/types';
2
+ import type { CB_STYLE_PROP_BGMEDIA_SPECS } from '../../../../DynamicLayout/types';
3
+ declare type SpecKeys = keyof Omit<CB_STYLE_PROP_BGMEDIA_SPECS, 'CB_STYLE_PROP_BGMEDIA_SPEC_MPLAY'>;
4
+ declare type ValueSetType = Partial<Record<SpecKeys, string | number | boolean | undefined>>;
5
+ export default function UseCustomSectionBackgroundMediaData(specs: CB_STYLE_PROP_BGMEDIA_SPECS, device: Device): ValueSetType;
6
+ export {};
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ var isNullOrUndefined_1 = __importDefault(require("../../../../DynamicLayout/sections/CustomSection/util/isNullOrUndefined"));
18
+ var AVAILABLE_SPECS = [
19
+ 'CB_STYLE_PROP_BGMEDIA_SPEC_YSRC',
20
+ 'CB_STYLE_PROP_BGMEDIA_SPEC_TYPE',
21
+ 'CB_STYLE_PROP_BGMEDIA_SPEC_SCROLL',
22
+ 'CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME',
23
+ 'CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY',
24
+ 'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGEFIT',
25
+ 'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGEPOSITION',
26
+ 'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR',
27
+ 'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGEFIT',
28
+ 'CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME'
29
+ ];
30
+ function UseCustomSectionBackgroundMediaData(specs, device) {
31
+ return AVAILABLE_SPECS.reduce(function (acc, cur) {
32
+ var _a;
33
+ var baseKey = device === 'DESKTOP' ? cur : cur + ":MOBILE";
34
+ var value = (0, isNullOrUndefined_1.default)(specs[baseKey]) ? specs[cur] : specs[baseKey];
35
+ return __assign(__assign({}, acc), (_a = {}, _a[cur] = value, _a));
36
+ }, {});
37
+ }
38
+ exports.default = UseCustomSectionBackgroundMediaData;
@@ -26,6 +26,9 @@ var jsx_runtime_1 = require("react/jsx-runtime");
26
26
  var sections_1 = require("../../sections");
27
27
  function SectionMatcher(_a) {
28
28
  var props = __rest(_a, []);
29
+ if (props.type === 'CUSTOM') {
30
+ return (0, jsx_runtime_1.jsx)(sections_1.CustomSection, __assign({}, props), void 0);
31
+ }
29
32
  var schema = props.manifest.schema;
30
33
  switch (schema) {
31
34
  case 'BASE_INTRO':
@@ -43,7 +46,7 @@ function SectionMatcher(_a) {
43
46
  case 'PRG_MEMBERSHIP_DISPLAY':
44
47
  return (0, jsx_runtime_1.jsx)(sections_1.NormalTypeMembershipSection, __assign({}, props), void 0);
45
48
  default:
46
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}, void 0);
49
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "ERROR: Schema NOT FOUND" }, void 0);
47
50
  }
48
51
  }
49
52
  exports.default = SectionMatcher;
@@ -2,6 +2,11 @@
2
2
  declare type Props = {
3
3
  id: number;
4
4
  src: string;
5
+ loopMode?: 'use' | 'none';
6
+ startSeconds?: number;
7
+ endSeconds?: number;
8
+ customHeight?: number;
9
+ customWidth?: number;
5
10
  };
6
- declare function YouTubeIframe({ id, src }: Props): JSX.Element;
11
+ declare function YouTubeIframe({ id, src, loopMode, startSeconds, endSeconds, customHeight, customWidth }: Props): JSX.Element;
7
12
  export default YouTubeIframe;