pds-dev-kit-web-test 2.5.377 → 2.5.379

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 (233) hide show
  1. package/dist/index.d.ts +2 -2
  2. package/dist/index.js +3 -2
  3. package/dist/src/common/assets/icons/fill/VideoStop.d.ts +4 -0
  4. package/dist/src/common/assets/icons/fill/VideoStop.js +30 -0
  5. package/dist/src/common/assets/icons/fill/index.d.ts +1 -0
  6. package/dist/src/common/assets/icons/fill/index.js +3 -1
  7. package/dist/src/common/assets/icons/line/CheckBox.d.ts +4 -0
  8. package/dist/src/common/assets/icons/line/CheckBox.js +30 -0
  9. package/dist/src/common/assets/icons/line/Dropdown.d.ts +4 -0
  10. package/dist/src/common/assets/icons/line/Dropdown.js +30 -0
  11. package/dist/src/common/assets/icons/line/Radio.d.ts +4 -0
  12. package/dist/src/common/assets/icons/line/Radio.js +30 -0
  13. package/dist/src/common/assets/icons/line/SectionQuestion32.d.ts +4 -0
  14. package/dist/src/common/assets/icons/line/SectionQuestion32.js +30 -0
  15. package/dist/src/common/assets/icons/line/SectionQuestion40.d.ts +4 -0
  16. package/dist/src/common/assets/icons/line/SectionQuestion40.js +30 -0
  17. package/dist/src/common/assets/icons/line/SectionQuestionnaire32.d.ts +4 -0
  18. package/dist/src/common/assets/icons/line/SectionQuestionnaire32.js +30 -0
  19. package/dist/src/common/assets/icons/line/SectionQuestionnaire40.d.ts +4 -0
  20. package/dist/src/common/assets/icons/line/SectionQuestionnaire40.js +30 -0
  21. package/dist/src/common/assets/icons/line/TextLong.d.ts +4 -0
  22. package/dist/src/common/assets/icons/line/TextLong.js +30 -0
  23. package/dist/src/common/assets/icons/line/TextShort.d.ts +4 -0
  24. package/dist/src/common/assets/icons/line/TextShort.js +30 -0
  25. package/dist/src/common/assets/icons/line/VideoStop.d.ts +4 -0
  26. package/dist/src/common/assets/icons/line/VideoStop.js +30 -0
  27. package/dist/src/common/assets/icons/line/index.d.ts +10 -0
  28. package/dist/src/common/assets/icons/line/index.js +21 -1
  29. package/dist/src/common/components/ThreeBarProgress/ThreeBarProgress.d.ts +2 -1
  30. package/dist/src/common/components/ThreeBarProgress/ThreeBarProgress.js +48 -4
  31. package/dist/src/common/hooks/useTooltip.js +1 -1
  32. package/dist/src/common/services/i18n/resources/en.json +9 -1
  33. package/dist/src/common/services/i18n/resources/es.json +9 -1
  34. package/dist/src/common/services/i18n/resources/fil.json +9 -1
  35. package/dist/src/common/services/i18n/resources/index.d.ts +56 -0
  36. package/dist/src/common/services/i18n/resources/ja.json +9 -1
  37. package/dist/src/common/services/i18n/resources/ko.json +9 -1
  38. package/dist/src/common/services/i18n/resources/zh-cn.json +9 -1
  39. package/dist/src/common/services/i18n/resources/zh-tw.json +9 -1
  40. package/dist/src/common/styles/colorSet/index.d.ts +124 -124
  41. package/dist/src/common/styles/colorSet/index.js +2 -2
  42. package/dist/src/common/utils/SystemUIPositionGenerator/hoverTypeSystemUICssGenerator.js +1 -1
  43. package/dist/src/common/utils/dateHelper.d.ts +13 -0
  44. package/dist/src/common/utils/dateHelper.js +87 -0
  45. package/dist/src/desktop/components/AdminListItem/AdminListItem.d.ts +1 -0
  46. package/dist/src/desktop/components/AdminListItem/AdminListItem.js +27 -13
  47. package/dist/src/desktop/components/BasicButtonGroup/BasicButtonGroup.js +1 -1
  48. package/dist/src/desktop/components/BasicListItem/BasicListItem.d.ts +4 -1
  49. package/dist/src/desktop/components/BasicListItem/BasicListItem.js +26 -4
  50. package/dist/src/desktop/components/BasicListItem/Contents.d.ts +3 -1
  51. package/dist/src/desktop/components/BasicListItem/Contents.js +2 -2
  52. package/dist/src/desktop/components/BasicListItem/RightBox/IconButton.d.ts +1 -0
  53. package/dist/src/desktop/components/BasicListItem/RightBox/IconButton.js +2 -2
  54. package/dist/src/desktop/components/Checkbox/Checkbox.d.ts +3 -1
  55. package/dist/src/desktop/components/Checkbox/Checkbox.js +17 -3
  56. package/dist/src/desktop/components/Radio/Radio.js +2 -2
  57. package/dist/src/desktop/components/TextField/TextField.js +41 -15
  58. package/dist/src/desktop/layout/LayoutWT/Containers/ContentsContainer/variation/WTU.js +2 -2
  59. package/dist/src/mobile/components/BasicListItem/BasicListItem.d.ts +4 -1
  60. package/dist/src/mobile/components/BasicListItem/BasicListItem.js +26 -4
  61. package/dist/src/mobile/components/BasicListItem/Contents.d.ts +3 -1
  62. package/dist/src/mobile/components/BasicListItem/Contents.js +2 -2
  63. package/dist/src/mobile/components/BasicListItem/RightBox/IconButton.d.ts +1 -0
  64. package/dist/src/mobile/components/BasicListItem/RightBox/IconButton.js +2 -2
  65. package/dist/src/mobile/components/Checkbox/Checkbox.d.ts +3 -1
  66. package/dist/src/mobile/components/Checkbox/Checkbox.js +17 -3
  67. package/dist/src/mobile/components/DatePicker/DatePicker.d.ts +16 -0
  68. package/dist/src/mobile/components/DatePicker/DatePicker.js +156 -0
  69. package/dist/src/mobile/components/DatePicker/DatePickerHeader.d.ts +14 -0
  70. package/dist/src/mobile/components/DatePicker/DatePickerHeader.js +27 -0
  71. package/dist/src/mobile/components/DatePicker/Day.d.ts +13 -0
  72. package/dist/src/mobile/components/DatePicker/Day.js +94 -0
  73. package/dist/src/mobile/components/DatePicker/index.d.ts +1 -0
  74. package/dist/src/{sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner → mobile/components/DatePicker}/index.js +3 -3
  75. package/dist/src/mobile/components/DatePicker/utils.d.ts +16 -0
  76. package/dist/src/mobile/components/DatePicker/utils.js +68 -0
  77. package/dist/src/mobile/components/Radio/Radio.js +2 -2
  78. package/dist/src/mobile/components/TextField/TextField.js +41 -15
  79. package/dist/src/mobile/components/TextLabel/TextLabel.d.ts +6 -1
  80. package/dist/src/mobile/components/TextLabel/TextLabel.js +83 -3
  81. package/dist/src/mobile/components/index.d.ts +2 -1
  82. package/dist/src/mobile/components/index.js +3 -1
  83. package/dist/src/mobile/index.d.ts +1 -1
  84. package/dist/src/mobile/index.js +3 -2
  85. package/dist/src/mobile/layout/LayoutMF/Containers/ContentsContainer/variation/MFA.js +1 -1
  86. package/dist/src/mobile/layout/LayoutMF/Containers/ContentsContainer/variation/MFB.js +1 -1
  87. package/dist/src/mobile/layout/LayoutMF/Containers/ContentsContainer/variation/MFC.js +1 -1
  88. package/dist/src/mobile/layout/LayoutMF/Containers/ContentsContainer/variation/MFD.js +1 -1
  89. package/dist/src/mobile/layout/LayoutMF/Containers/ContentsContainer/variation/MFE.js +1 -1
  90. package/dist/src/mobile/layout/LayoutMM/Containers/ContentsContainer/variation/MMA.js +1 -1
  91. package/dist/src/mobile/layout/LayoutMM/Containers/ContentsContainer/variation/MMB.js +1 -1
  92. package/dist/src/mobile/layout/LayoutMP/Containers/ContentsContainer/variation/MPA.js +1 -1
  93. package/dist/src/mobile/layout/LayoutMP/Containers/ContentsContainer/variation/MPB.js +1 -1
  94. package/dist/src/mobile/layout/LayoutMP/Containers/ContentsContainer/variation/MPC.js +1 -1
  95. package/dist/src/mobile/layout/LayoutMP/Containers/ContentsContainer/variation/MPD.js +1 -1
  96. package/dist/src/mobile/layout/LayoutMP/Containers/ContentsContainer/variation/MPE.js +1 -1
  97. package/dist/src/mobile/layout/LayoutMP/Containers/ContentsContainer/variation/MPF.js +1 -1
  98. package/dist/src/mobile/layout/LayoutMS/Containers/ContentsContainer/variation/MSA.js +1 -1
  99. package/dist/src/mobile/layout/LayoutMS/Containers/ContentsContainer/variation/MSB.js +1 -1
  100. package/dist/src/mobile/layout/LayoutMS/Containers/ContentsContainer/variation/MSC.js +1 -1
  101. package/dist/src/mobile/layout/LayoutMS/Containers/ContentsContainer/variation/MSD.js +1 -1
  102. package/dist/src/mobile/layout/LayoutMS/Containers/ContentsContainer/variation/MSE.js +1 -1
  103. package/dist/src/mobile/layout/LayoutMS/Containers/ContentsContainer/variation/MSF.js +1 -1
  104. package/dist/src/mobile/layout/LayoutMS/Containers/ContentsContainer/variation/MSG.js +1 -1
  105. package/dist/src/mobile/layout/LayoutMS/Containers/ContentsContainer/variation/MSH.js +1 -1
  106. package/dist/src/sub/AdminList/AdminListItem/AdminListItem.js +3 -3
  107. package/dist/src/sub/DynamicLayout/CompositionRenderer/ComponentBlockMatcher.js +1 -4
  108. package/dist/src/sub/DynamicLayout/CompositionRenderer/Composition.d.ts +2 -4
  109. package/dist/src/sub/DynamicLayout/CompositionRenderer/Composition.js +54 -54
  110. package/dist/src/sub/DynamicLayout/CompositionRenderer/CompositionRenderer.d.ts +6 -0
  111. package/dist/src/sub/DynamicLayout/CompositionRenderer/CompositionRenderer.js +27 -0
  112. package/dist/src/sub/DynamicLayout/DynamicLayout.d.ts +1 -1
  113. package/dist/src/sub/DynamicLayout/DynamicLayout.js +2 -3
  114. package/dist/src/sub/DynamicLayout/components/EditModeSectionMatcher/SectionBox.js +4 -1
  115. package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackgroundMedia.js +5 -1
  116. package/dist/src/sub/DynamicLayout/components/Section/components/VideoBGMedia.js +26 -25
  117. package/dist/src/sub/DynamicLayout/components/Section/sectionContext.d.ts +2 -2
  118. package/dist/src/sub/DynamicLayout/components/Section/util/parseSectionBackgroundMediaData.js +1 -0
  119. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/line/index.d.ts +0 -40
  120. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/line/index.js +177 -36
  121. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/styles/colorSet/PaletteColor_Dark.json +4 -152
  122. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/styles/colorSet/PaletteColor_light.json +2 -150
  123. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/styles/colorSet/SemanticColor.json +1 -45
  124. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/styles/colorSet/UIColor.json +9 -262
  125. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/styles/colorSet/index.d.ts +0 -593
  126. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/styles/colorSet/ui-type.d.ts +0 -253
  127. package/dist/src/sub/DynamicLayout/{mock_video.js → mock_video_cb.js} +2 -2
  128. package/dist/src/sub/DynamicLayout/mocks.d.ts +960 -8
  129. package/dist/src/sub/DynamicLayout/mocks.js +4239 -4296
  130. package/dist/src/sub/DynamicLayout/sections/CustomSection/FlexGridItem.js +11 -15
  131. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.js +3 -13
  132. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +23 -19
  133. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.d.ts +4 -4
  134. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.js +2 -230
  135. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image/Image.js +3 -33
  136. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +6 -28
  137. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/VideoPlayer/VideoPlayer.js +46 -43
  138. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/VideoPlayer/index.js +0 -1
  139. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.d.ts +10 -56
  140. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/replaceUndefinedValues.js +1 -1
  141. package/dist/src/sub/DynamicLayout/sections/CustomSection/types.d.ts +10 -27
  142. package/dist/src/sub/DynamicLayout/sections/CustomSection/types.js +1 -3
  143. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/parseEffectPropEntAnim.d.ts +4 -4
  144. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/parseLayoutPropPadding.d.ts +2 -2
  145. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseJsonProperties.d.ts +2 -2
  146. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseProperties.d.ts +2 -2
  147. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +3 -52
  148. package/dist/src/sub/DynamicLayout/sections/FlexGridCustomSection.js +1 -2
  149. package/dist/src/sub/DynamicLayout/types.d.ts +15 -48
  150. package/package.json +3 -3
  151. package/release-note.md +3 -3
  152. package/dist/src/sub/DynamicLayout/CompositionEditor/CompositionEditor.d.ts +0 -20
  153. package/dist/src/sub/DynamicLayout/CompositionEditor/CompositionEditor.js +0 -1132
  154. package/dist/src/sub/DynamicLayout/CompositionRenderer/CompositionBackground.d.ts +0 -11
  155. package/dist/src/sub/DynamicLayout/CompositionRenderer/CompositionBackground.js +0 -45
  156. package/dist/src/sub/DynamicLayout/CompositionRenderer/createCompositions.d.ts +0 -9
  157. package/dist/src/sub/DynamicLayout/CompositionRenderer/createCompositions.js +0 -53
  158. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/line/paginationIcons/downIcons.d.ts +0 -12
  159. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/line/paginationIcons/downIcons.js +0 -76
  160. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/line/paginationIcons/index.d.ts +0 -4
  161. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/line/paginationIcons/index.js +0 -47
  162. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/line/paginationIcons/leftIcons.d.ts +0 -12
  163. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/line/paginationIcons/leftIcons.js +0 -76
  164. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/line/paginationIcons/rightIcons.d.ts +0 -12
  165. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/line/paginationIcons/rightIcons.js +0 -76
  166. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/line/paginationIcons/upIcons.d.ts +0 -12
  167. package/dist/src/sub/DynamicLayout/components/pdsOriginal/common/assets/icons/line/paginationIcons/upIcons.js +0 -76
  168. package/dist/src/sub/DynamicLayout/compositionActionTypes.d.ts +0 -139
  169. package/dist/src/sub/DynamicLayout/compositionActionTypes.js +0 -2
  170. package/dist/src/sub/DynamicLayout/compositionQueryContext.d.ts +0 -8
  171. package/dist/src/sub/DynamicLayout/compositionQueryContext.js +0 -14
  172. package/dist/src/sub/DynamicLayout/mock_composition.d.ts +0 -3
  173. package/dist/src/sub/DynamicLayout/mock_composition.js +0 -801
  174. package/dist/src/sub/DynamicLayout/mock_contentsCarousel.d.ts +0 -1
  175. package/dist/src/sub/DynamicLayout/mock_contentsCarousel.js +0 -1099
  176. package/dist/src/sub/DynamicLayout/mock_contentsList.d.ts +0 -1
  177. package/dist/src/sub/DynamicLayout/mock_contentsList.js +0 -1082
  178. package/dist/src/sub/DynamicLayout/mock_slideBanner.d.ts +0 -810
  179. package/dist/src/sub/DynamicLayout/mock_slideBanner.js +0 -822
  180. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarouselCore.d.ts +0 -17
  181. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarouselCore.js +0 -59
  182. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigation.d.ts +0 -31
  183. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigation.js +0 -118
  184. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomPagination.d.ts +0 -31
  185. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomPagination.js +0 -191
  186. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomProgressbar.d.ts +0 -21
  187. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomProgressbar.js +0 -117
  188. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/navigationConfigs.d.ts +0 -4
  189. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/navigationConfigs.js +0 -889
  190. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/progressConfigs.d.ts +0 -27
  191. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/progressConfigs.js +0 -96
  192. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/contentsCarouselUtils.d.ts +0 -50
  193. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/contentsCarouselUtils.js +0 -905
  194. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/index.d.ts +0 -1
  195. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/index.js +0 -8
  196. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/types.d.ts +0 -90
  197. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/types.js +0 -2
  198. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.d.ts +0 -8
  199. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.js +0 -112
  200. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsListCore.d.ts +0 -17
  201. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsListCore.js +0 -39
  202. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/components/CustomPagination.d.ts +0 -27
  203. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/components/CustomPagination.js +0 -115
  204. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/components/paginationConfigs.d.ts +0 -23
  205. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/components/paginationConfigs.js +0 -176
  206. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/contentsListUtils.d.ts +0 -30
  207. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/contentsListUtils.js +0 -351
  208. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/index.d.ts +0 -1
  209. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/index.js +0 -8
  210. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/types.d.ts +0 -46
  211. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/types.js +0 -2
  212. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBanner.d.ts +0 -8
  213. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBanner.js +0 -225
  214. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBannerCore.d.ts +0 -15
  215. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBannerCore.js +0 -39
  216. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigation.d.ts +0 -31
  217. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigation.js +0 -118
  218. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomPagination.d.ts +0 -31
  219. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomPagination.js +0 -191
  220. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomProgressbar.d.ts +0 -21
  221. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomProgressbar.js +0 -94
  222. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/navigationConfigs.d.ts +0 -4
  223. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/navigationConfigs.js +0 -889
  224. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/progressConfigs.d.ts +0 -27
  225. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/progressConfigs.js +0 -96
  226. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/index.d.ts +0 -1
  227. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/slideBannerUtils.d.ts +0 -48
  228. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/slideBannerUtils.js +0 -852
  229. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/types.d.ts +0 -80
  230. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/types.js +0 -2
  231. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseCompositionPlacement.d.ts +0 -14
  232. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseCompositionPlacement.js +0 -26
  233. /package/dist/src/sub/DynamicLayout/{mock_video.d.ts → mock_video_cb.d.ts} +0 -0
@@ -1,1132 +0,0 @@
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
- var desc = Object.getOwnPropertyDescriptor(m, k);
20
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
- desc = { enumerable: true, get: function() { return m[k]; } };
22
- }
23
- Object.defineProperty(o, k2, desc);
24
- }) : (function(o, m, k, k2) {
25
- if (k2 === undefined) k2 = k;
26
- o[k2] = m[k];
27
- }));
28
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
- Object.defineProperty(o, "default", { enumerable: true, value: v });
30
- }) : function(o, v) {
31
- o["default"] = v;
32
- });
33
- var __importStar = (this && this.__importStar) || function (mod) {
34
- if (mod && mod.__esModule) return mod;
35
- var result = {};
36
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
37
- __setModuleDefault(result, mod);
38
- return result;
39
- };
40
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
41
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
42
- if (ar || !(i in from)) {
43
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
44
- ar[i] = from[i];
45
- }
46
- }
47
- return to.concat(ar || Array.prototype.slice.call(from));
48
- };
49
- var __importDefault = (this && this.__importDefault) || function (mod) {
50
- return (mod && mod.__esModule) ? mod : { "default": mod };
51
- };
52
- Object.defineProperty(exports, "__esModule", { value: true });
53
- var jsx_runtime_1 = require("react/jsx-runtime");
54
- /* eslint-disable @typescript-eslint/no-unused-vars */
55
- var publ_echo_1 = require("publ-echo");
56
- var group_1 = require("publ-echo/dist/lib/GridLayoutEditor/group");
57
- var renderHelpers_1 = require("publ-echo/dist/lib/GridLayoutEditor/utils/renderHelpers");
58
- var react_1 = __importStar(require("react"));
59
- var ErrorBoundary_1 = require("../../DynamicLayout/components/Section/ErrorBoundary");
60
- var gleStyles_1 = require("../../DynamicLayout/gleStyles");
61
- var styled_components_1 = __importDefault(require("styled-components"));
62
- require("../components/Section");
63
- var ComponentBlockMatcher_1 = __importDefault(require("../CompositionRenderer/ComponentBlockMatcher"));
64
- var CompositionBackground_1 = __importDefault(require("../CompositionRenderer/CompositionBackground"));
65
- var dynamicLayoutContext_1 = require("../dynamicLayoutContext");
66
- require("../sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_HiddenCover");
67
- var clsx_1 = require("../sections/CustomSection/newUtils/clsx");
68
- var group_2 = require("../sections/CustomSection/newUtils/group");
69
- var util_1 = require("../sections/CustomSection/util");
70
- var parseSectionPadding_1 = __importDefault(require("../sections/CustomSection/util/layoutPropParsers/parseSectionPadding"));
71
- var parseCompositionPlacement_1 = __importDefault(require("../sections/CustomSection/util/parseCompositionPlacement"));
72
- var Responsive = (0, publ_echo_1.WidthProvider)(publ_echo_1.ResponsiveGridEditor);
73
- var CompositionEditor = (0, react_1.forwardRef)(function CompositionEditorCanvas(props, ref) {
74
- var _a, _b, _c, _d;
75
- var _e = props.editorProps, device = _e.device, shortcutKeyMode = _e.shortcutKeyMode, compositionActionHandler = _e.compositionActionHandler;
76
- // const GLE_MIN_WIDTH_DESKTOP_PX = `${GRID_CELL_MIN * cols}px`;
77
- // const GLE_MIN_WIDTH_MOBILE_PX = `${GRID_CELL_MIN * rows}px`;
78
- var editingSectionId = props.compositionData.id;
79
- var mode = 'EDIT';
80
- var _f = props.compositionData, componentBlocks = _f.componentBlocks, jsonProperties = _f.jsonProperties;
81
- var sectionPedigree = jsonProperties === null || jsonProperties === void 0 ? void 0 : jsonProperties.pedigree;
82
- var _g = (0, react_1.useState)(sectionPedigree), pedigreeState = _g[0], setPedigreeState = _g[1];
83
- (0, react_1.useEffect)(function () {
84
- setPedigreeState(sectionPedigree);
85
- }, [sectionPedigree]);
86
- var _h = jsonProperties, _j = _h.data, CB_PLACEMENT_PROP_COMPOSITION = _j.CB_PLACEMENT_PROP_COMPOSITION, CB_LAYOUT_PROP_PADDING = _j.CB_LAYOUT_PROP_PADDING, zOrders = _h.zOrders;
87
- var _k = (0, react_1.useState)(null), selectedBlockId = _k[0], setSelectedBlockId = _k[1];
88
- var gleRef = (0, react_1.useRef)(null);
89
- var _l = (0, react_1.useState)(50), rowHeight = _l[0], setRowHeight = _l[1];
90
- var _m = (0, react_1.useState)(16), baseFontSize = _m[0], setBaseFontSize = _m[1];
91
- var isMobile = device === 'MOBILE';
92
- var isEditMode = mode === 'EDIT';
93
- var layoutByDevice = device === 'DESKTOP' ? 'lg' : 'sm';
94
- var colsDesktop = CB_PLACEMENT_PROP_COMPOSITION.CB_PLACEMENT_PROP_COMPOSITION_SPEC_COLUMNS;
95
- var colsMobile = (_a = CB_PLACEMENT_PROP_COMPOSITION['CB_PLACEMENT_PROP_COMPOSITION_SPEC_COLUMNS:MOBILE']) !== null && _a !== void 0 ? _a : colsDesktop;
96
- var rowsDesktop = CB_PLACEMENT_PROP_COMPOSITION.CB_PLACEMENT_PROP_COMPOSITION_SPEC_ROWS;
97
- var rowsMobile = (_b = CB_PLACEMENT_PROP_COMPOSITION['CB_PLACEMENT_PROP_COMPOSITION_SPEC_ROWS:MOBILE']) !== null && _b !== void 0 ? _b : rowsDesktop;
98
- var rows = isMobile ? rowsMobile : rowsDesktop;
99
- var cols = isMobile ? colsMobile : colsDesktop;
100
- var canvasWidth = 50 * cols;
101
- var _o = (0, react_1.useState)(function () {
102
- var _a = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : [], zOrders), lg = _a.lg, sm = _a.sm;
103
- return {
104
- lg: lg,
105
- sm: sm
106
- };
107
- }), layouts = _o[0], setLayouts = _o[1];
108
- var _p = (0, react_1.useState)('ROOT'), editingGroupBlock = _p[0], setEditingGroupBlock = _p[1];
109
- var _q = (0, react_1.useState)([]), bulkBlockIds = _q[0], setBulkBlockIds = _q[1];
110
- (0, react_1.useEffect)(function () {
111
- if (editingGroupBlock) {
112
- var found = (0, group_1.findBlockByBlockId)(sectionPedigree, editingGroupBlock);
113
- if (!found) {
114
- setEditingGroupBlock('ROOT');
115
- return;
116
- }
117
- if (found.type === 'GROUP_BLOCK' && found.children.length === 0) {
118
- setEditingGroupBlock('ROOT');
119
- return;
120
- }
121
- }
122
- }, [editingGroupBlock, sectionPedigree]);
123
- var newblock = bulkBlockIds.length > 0
124
- ? (0, group_1.addBulkToTarget)(pedigreeState, editingGroupBlock, bulkBlockIds)
125
- : pedigreeState;
126
- (0, react_1.useImperativeHandle)(ref, function () {
127
- return {
128
- selectCB: function (blockId) {
129
- setSelectedBlockId(blockId);
130
- },
131
- selectCBInBulk: function (blockIds) {
132
- setBulkBlockIds(blockIds);
133
- },
134
- selectGroup: function (groupBlockId) {
135
- setBulkBlockIds([]);
136
- setSelectedBlockId(groupBlockId);
137
- }
138
- };
139
- }, [componentBlocks]);
140
- (0, react_1.useLayoutEffect)(function () {
141
- var parsedLayouts = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : [], zOrders);
142
- setLayouts(function (prev) {
143
- var _a;
144
- var _b;
145
- var group = (0, group_2.getGroupCB)(prev[layoutByDevice]);
146
- var groupedCBIds = (_b = group === null || group === void 0 ? void 0 : group.childrenIds) !== null && _b !== void 0 ? _b : [];
147
- var filteredLayout = (0, group_2.filterItemsById)(parsedLayouts[layoutByDevice], groupedCBIds);
148
- if (group === null || group === void 0 ? void 0 : group.groupLayouts) {
149
- var groupCbs = parsedLayouts[layoutByDevice].filter(function (each) {
150
- return groupedCBIds.includes(each.i);
151
- });
152
- if (groupCbs.length > 0) {
153
- var newGroupLayout = (0, group_2.getGroupForMultiple)(groupCbs);
154
- filteredLayout.push(newGroupLayout);
155
- }
156
- }
157
- return __assign(__assign({}, prev), (_a = {}, _a[layoutByDevice] = filteredLayout, _a));
158
- });
159
- }, [componentBlocks, group_2.getGroupCB, layoutByDevice, zOrders]);
160
- (0, react_1.useEffect)(function () {
161
- if (editingSectionId !== props.compositionData.id) {
162
- setSelectedBlockId(null);
163
- setBulkBlockIds([]);
164
- setEditingGroupBlock('ROOT');
165
- }
166
- }, [editingSectionId]);
167
- var workDir = (_c = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _c !== void 0 ? _c : '/ROOT';
168
- (0, react_1.useEffect)(function () {
169
- compositionActionHandler &&
170
- compositionActionHandler({
171
- type: '@COMPOSITION/WORKDIR_CHANGED',
172
- payload: {
173
- workDir: workDir
174
- }
175
- });
176
- }, [workDir]);
177
- // NOTE: 추후에 event를 외부에서 전달받게하거나, 아예 상태를 끌어올리거나 해야합니다.
178
- (0, react_1.useLayoutEffect)(function () {
179
- var _a, _b, _c, _d, _e, _f;
180
- if (props.compositionData.id !== editingSectionId) {
181
- return;
182
- }
183
- if (!shortcutKeyMode) {
184
- return;
185
- }
186
- if (shortcutKeyMode === 'SELECT_ALL') {
187
- makeAllInOneGroup();
188
- return;
189
- }
190
- // esc
191
- if (shortcutKeyMode === 'MANUAL_BULK_BREAK') {
192
- if (selectedBlockId &&
193
- editingGroupBlock !== selectedBlockId &&
194
- editingGroupBlock !== 'ROOT') {
195
- setSelectedBlockId(null);
196
- compositionActionHandler &&
197
- compositionActionHandler({
198
- type: '@COMPOSITION/BLOCK_CLICKED',
199
- payload: {
200
- block: {
201
- blockId: editingGroupBlock,
202
- type: 'GROUP_BLOCK',
203
- workDir: (_a = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _a !== void 0 ? _a : 'NOT-FOUND',
204
- childrenBlockIds: (_b = (0, group_1.findDirectChildrenBlockIds)(newblock, editingGroupBlock)) !== null && _b !== void 0 ? _b : [],
205
- childrenCBIds: (_c = (0, group_1.findDirectChildrenCbIds)(newblock, editingGroupBlock)) !== null && _c !== void 0 ? _c : []
206
- }
207
- }
208
- });
209
- return;
210
- }
211
- if (bulkBlockIds.length > 0) {
212
- setBulkBlockIds([]);
213
- setSelectedBlockId(null);
214
- compositionActionHandler &&
215
- compositionActionHandler({
216
- type: '@COMPOSITION/BLOCK_CLICKED',
217
- payload: {
218
- block: {
219
- blockId: editingGroupBlock,
220
- type: 'GROUP_BLOCK',
221
- workDir: (_d = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _d !== void 0 ? _d : 'NOT-FOUND',
222
- childrenBlockIds: (_e = (0, group_1.findDirectChildrenBlockIds)(newblock, editingGroupBlock)) !== null && _e !== void 0 ? _e : [],
223
- childrenCBIds: (_f = (0, group_1.findDirectChildrenCbIds)(newblock, editingGroupBlock)) !== null && _f !== void 0 ? _f : []
224
- }
225
- }
226
- });
227
- return;
228
- }
229
- if (editingGroupBlock !== 'ROOT') {
230
- setEditingGroupBlock('ROOT');
231
- setSelectedBlockId(null);
232
- compositionActionHandler &&
233
- compositionActionHandler({
234
- type: '@COMPOSITION/BULK_DISMISSED',
235
- payload: {
236
- message: 'MANUAL_BULK_BREAK_OR_ESC',
237
- editingGroupBlock: 'ROOT'
238
- }
239
- });
240
- return;
241
- }
242
- if (editingGroupBlock === 'ROOT') {
243
- setSelectedBlockId(null);
244
- compositionActionHandler &&
245
- compositionActionHandler({
246
- type: '@COMPOSITION/BULK_DISMISSED',
247
- payload: {
248
- message: 'MANUAL_BULK_BREAK_OR_ESC',
249
- editingGroupBlock: 'ROOT'
250
- }
251
- });
252
- }
253
- }
254
- }, [shortcutKeyMode, setSelectedBlockId]);
255
- (0, react_1.useLayoutEffect)(function () {
256
- var _a;
257
- if (props.compositionData.id !== editingSectionId) {
258
- return;
259
- }
260
- if (shortcutKeyMode === 'MANUAL_COLLISION_SELECT') {
261
- if (!selectedBlockId || selectedBlockId === 'BULK') {
262
- return;
263
- }
264
- var selectedCBId = selectedBlockId ? (0, group_1.formatBlockIdToCbId)(selectedBlockId) : undefined;
265
- if (!selectedCBId) {
266
- return;
267
- }
268
- var bulks_1 = getCollisionGroupIds(selectedCBId);
269
- if (selectedBlockId) {
270
- bulks_1.push(selectedBlockId);
271
- }
272
- setBulkBlockIds(function (prev) {
273
- var set = new Set(__spreadArray(__spreadArray([], prev, true), bulks_1, true));
274
- return Array.from(set);
275
- });
276
- setSelectedBlockId(null);
277
- var newBulkCBIds = bulks_1
278
- .map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); })
279
- .filter(function (each) { return each !== null; });
280
- var childrenCBIds = [];
281
- if (newBulkCBIds.length === 0) {
282
- var oneCB = (0, group_1.findOneComponentBlock)(newblock, bulks_1[0]);
283
- childrenCBIds = oneCB ? [oneCB] : [];
284
- }
285
- else {
286
- childrenCBIds = newBulkCBIds;
287
- }
288
- var groupDisabled = getWorkDirDirectChildrenLength() === __spreadArray(__spreadArray([], bulkBlockIds, true), bulks_1, true).length;
289
- compositionActionHandler &&
290
- compositionActionHandler({
291
- type: '@COMPOSITION/BLOCK_CLICKED',
292
- payload: {
293
- block: {
294
- type: 'BULK',
295
- blockId: 'BULK',
296
- childrenBlockIds: bulks_1,
297
- workDir: (_a = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _a !== void 0 ? _a : 'NOT-FOUND',
298
- childrenCBIds: childrenCBIds,
299
- groupDisabled: groupDisabled && editingGroupBlock !== 'ROOT'
300
- }
301
- }
302
- });
303
- return;
304
- }
305
- }, [
306
- selectedBlockId,
307
- shortcutKeyMode,
308
- compositionActionHandler,
309
- bulkBlockIds,
310
- setSelectedBlockId
311
- ]);
312
- var makeAllInOneGroup = function () {
313
- var _a, _b, _c, _d, _e;
314
- var allRootChildIds = (0, group_1.findDirectChildrenBlockIds)(pedigreeState, editingGroupBlock);
315
- if (allRootChildIds.length === 1) {
316
- var block = (0, group_1.findBlockByBlockId)(newblock, allRootChildIds[0]);
317
- if (!block) {
318
- return;
319
- }
320
- setSelectedBlockId(block.blockId);
321
- setBulkBlockIds([]);
322
- if (block.type === 'COMPONENT_BLOCK') {
323
- compositionActionHandler &&
324
- compositionActionHandler({
325
- type: '@COMPOSITION/BLOCK_CLICKED',
326
- payload: {
327
- block: {
328
- blockId: block.blockId,
329
- type: block.type,
330
- cbId: block.componentBlockId,
331
- workDir: (_a = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _a !== void 0 ? _a : 'NOT-FOUND'
332
- }
333
- }
334
- });
335
- return;
336
- }
337
- if (block.type === 'GROUP_BLOCK') {
338
- compositionActionHandler &&
339
- compositionActionHandler({
340
- type: '@COMPOSITION/BLOCK_CLICKED',
341
- payload: {
342
- block: {
343
- blockId: block.blockId,
344
- type: 'GROUP_BLOCK',
345
- workDir: (_b = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _b !== void 0 ? _b : 'NOT-FOUND',
346
- childrenBlockIds: (_c = (0, group_1.findDirectChildrenBlockIds)(newblock, block.blockId)) !== null && _c !== void 0 ? _c : [],
347
- childrenCBIds: (_d = (0, group_1.findDirectChildrenCbIds)(newblock, block.blockId)) !== null && _d !== void 0 ? _d : []
348
- }
349
- }
350
- });
351
- }
352
- return;
353
- }
354
- setBulkBlockIds(allRootChildIds);
355
- var newBulkCBIds = allRootChildIds
356
- .map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); })
357
- .filter(function (each) { return each !== null; });
358
- var childrenCBIds = [];
359
- if (newBulkCBIds.length === 0) {
360
- var oneCB = (0, group_1.findOneComponentBlock)(newblock, allRootChildIds[0]);
361
- childrenCBIds = oneCB ? [oneCB] : [];
362
- }
363
- else {
364
- childrenCBIds = newBulkCBIds;
365
- }
366
- var groupDisabled = getWorkDirDirectChildrenLength() === allRootChildIds.length;
367
- compositionActionHandler &&
368
- compositionActionHandler({
369
- type: '@COMPOSITION/BLOCK_CLICKED',
370
- payload: {
371
- block: {
372
- type: 'BULK',
373
- blockId: 'BULK',
374
- childrenBlockIds: allRootChildIds,
375
- workDir: (_e = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _e !== void 0 ? _e : 'NOT-FOUND',
376
- childrenCBIds: childrenCBIds,
377
- groupDisabled: groupDisabled && editingGroupBlock !== 'ROOT'
378
- }
379
- }
380
- });
381
- };
382
- var getCollisionGroupIds = function (cdId1) {
383
- var layoutItem = (0, renderHelpers_1.getLayoutItem)(layouts[layoutByDevice], cdId1.toString());
384
- if (!layoutItem) {
385
- return [];
386
- }
387
- var allCollisions = (0, renderHelpers_1.getAllCollisions)(layouts[layoutByDevice], layoutItem);
388
- var allCollisionsCbIds = allCollisions.map(function (each) { return Number(each.i); });
389
- var workDirChildrenBlockIds = (0, group_1.findDirectChildrenBlockIds)(newblock, editingGroupBlock);
390
- var collisions = workDirChildrenBlockIds.filter(function (each) {
391
- var cbId = (0, group_1.formatBlockIdToCbId)(each);
392
- var allCollisions = (0, group_1.findAllChildrenCbIds)(newblock, each);
393
- if (cbId !== null && allCollisionsCbIds.includes(cbId)) {
394
- return true;
395
- }
396
- var hasCollision = allCollisions.some(function (each) { return allCollisionsCbIds.includes(each); });
397
- return hasCollision;
398
- });
399
- return __spreadArray(__spreadArray([], collisions, true), [(0, group_1.formatCbIdToBlockId)(cdId1)], false);
400
- };
401
- var _r = (0, parseCompositionPlacement_1.default)({
402
- isMobile: isMobile,
403
- compositionProps: CB_PLACEMENT_PROP_COMPOSITION
404
- }), minHeight = _r.minHeight, maxWidth = _r.maxWidth, maxHeight = _r.maxHeight, minWidth = _r.minWidth;
405
- var customSectionStyles = {
406
- minHeight: "".concat(minHeight, "px"),
407
- maxHeight: "".concat(maxHeight, "px"),
408
- width: "".concat(canvasWidth, "px"),
409
- maxWidth: maxWidth ? "".concat(maxWidth, "px") : '100%',
410
- minWidth: "".concat(Math.max(canvasWidth, minWidth !== null && minWidth !== void 0 ? minWidth : 0), "px")
411
- };
412
- var breakpoint = device === 'MOBILE' ? 'sm' : 'lg';
413
- var onClickCB = function (id) {
414
- var _a, _b, _c, _d, _e, _f, _g;
415
- var blockId = (0, group_1.formatCbIdToBlockId)(id);
416
- if (!isEditMode) {
417
- return;
418
- }
419
- var added = (function () {
420
- if (selectedBlockId === editingGroupBlock) {
421
- return [blockId];
422
- }
423
- if (selectedBlockId === 'BULK') {
424
- return [blockId];
425
- }
426
- return selectedBlockId ? [selectedBlockId, blockId] : [blockId];
427
- })();
428
- if (shortcutKeyMode === 'BULK_SELECT') {
429
- setBulkBlockIds(function (prev) {
430
- var set = new Set(__spreadArray(__spreadArray([], prev, true), added, true));
431
- return Array.from(set);
432
- });
433
- setSelectedBlockId(null);
434
- var newBulkBlockIds = Array.from(new Set(__spreadArray(__spreadArray([], bulkBlockIds, true), added, true)));
435
- var newBulkCBIds = newBulkBlockIds
436
- .map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); })
437
- .filter(function (each) { return each !== null; });
438
- var childrenCBIds = [];
439
- if (newBulkCBIds.length === 0) {
440
- var oneCB = (0, group_1.findOneComponentBlock)(newblock, newBulkBlockIds[0]);
441
- childrenCBIds = oneCB ? [oneCB] : [];
442
- }
443
- else {
444
- childrenCBIds = newBulkCBIds;
445
- }
446
- var groupDisabled = getWorkDirDirectChildrenLength() === __spreadArray(__spreadArray([], bulkBlockIds, true), added, true).length;
447
- compositionActionHandler &&
448
- compositionActionHandler({
449
- type: '@COMPOSITION/BLOCK_CLICKED',
450
- payload: {
451
- block: {
452
- type: 'BULK',
453
- blockId: 'BULK',
454
- childrenBlockIds: newBulkBlockIds,
455
- childrenCBIds: childrenCBIds,
456
- workDir: (_a = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _a !== void 0 ? _a : 'NOT-FOUND',
457
- groupDisabled: groupDisabled && editingGroupBlock !== 'ROOT'
458
- }
459
- }
460
- });
461
- return;
462
- }
463
- if (shortcutKeyMode === 'COLLISION_SELECT') {
464
- var bulks = getCollisionGroupIds(id);
465
- var newBulksSet = new Set(__spreadArray(__spreadArray(__spreadArray([], bulkBlockIds, true), added, true), bulks, true));
466
- var newBulks = Array.from(newBulksSet);
467
- if (newBulks.length === 1) {
468
- var blockId_1 = newBulks[0];
469
- setSelectedBlockId(blockId_1);
470
- setBulkBlockIds([]);
471
- compositionActionHandler &&
472
- compositionActionHandler({
473
- type: '@COMPOSITION/BLOCK_CLICKED',
474
- payload: {
475
- block: {
476
- type: 'COMPONENT_BLOCK',
477
- blockId: blockId_1,
478
- cbId: id,
479
- workDir: (_b = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _b !== void 0 ? _b : 'NOT-FOUND'
480
- }
481
- }
482
- });
483
- return;
484
- }
485
- setBulkBlockIds(newBulks);
486
- setSelectedBlockId(null);
487
- var newBulkCBIds = newBulks
488
- .map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); })
489
- .filter(function (each) { return each !== null; });
490
- var childrenCBIds = [];
491
- if (newBulkCBIds.length === 0) {
492
- var oneCB = (0, group_1.findOneComponentBlock)(newblock, bulks[0]);
493
- childrenCBIds = oneCB ? [oneCB] : [];
494
- }
495
- else {
496
- childrenCBIds = newBulkCBIds;
497
- }
498
- var groupDisabled = getWorkDirDirectChildrenLength() === newBulks.length;
499
- compositionActionHandler &&
500
- compositionActionHandler({
501
- type: '@COMPOSITION/BLOCK_CLICKED',
502
- payload: {
503
- block: {
504
- type: 'BULK',
505
- blockId: 'BULK',
506
- childrenBlockIds: newBulks,
507
- workDir: (_c = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _c !== void 0 ? _c : 'NOT-FOUND',
508
- childrenCBIds: childrenCBIds,
509
- groupDisabled: groupDisabled && editingGroupBlock !== 'ROOT'
510
- }
511
- }
512
- });
513
- return;
514
- }
515
- var blockType = blockId.startsWith('GB_') ? 'GROUP_BLOCK' : 'COMPONENT_BLOCK';
516
- setSelectedBlockId(blockId);
517
- setBulkBlockIds([]);
518
- if (blockType === 'COMPONENT_BLOCK') {
519
- compositionActionHandler &&
520
- compositionActionHandler({
521
- type: '@COMPOSITION/BLOCK_CLICKED',
522
- payload: {
523
- block: {
524
- blockId: blockId,
525
- type: blockType,
526
- cbId: id,
527
- workDir: (_d = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _d !== void 0 ? _d : 'NOT-FOUND'
528
- }
529
- }
530
- });
531
- return;
532
- }
533
- if (blockType === 'GROUP_BLOCK') {
534
- compositionActionHandler &&
535
- compositionActionHandler({
536
- type: '@COMPOSITION/BLOCK_CLICKED',
537
- payload: {
538
- block: {
539
- blockId: blockId,
540
- type: 'GROUP_BLOCK',
541
- workDir: (_e = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _e !== void 0 ? _e : 'NOT-FOUND',
542
- childrenBlockIds: (_f = (0, group_1.findDirectChildrenBlockIds)(newblock, blockId)) !== null && _f !== void 0 ? _f : [],
543
- childrenCBIds: (_g = (0, group_1.findDirectChildrenCbIds)(newblock, blockId)) !== null && _g !== void 0 ? _g : []
544
- }
545
- }
546
- });
547
- }
548
- };
549
- var onContextMenuCB = function (id, e) {
550
- var _a;
551
- var blockId = (0, group_1.formatCbIdToBlockId)(id);
552
- if (!isEditMode) {
553
- return;
554
- }
555
- if (selectedBlockId === 'BULK' && blockId !== selectedBlockId) {
556
- setBulkBlockIds([]);
557
- }
558
- // if (!['COLLISION_SELECT', 'BULK_SELECT'].includes(shortcutKeyMode ?? '')) {
559
- // if (blockId !== selectedBlockId) {
560
- // setBulkBlockIds([]);
561
- // }
562
- // }
563
- setSelectedBlockId(blockId);
564
- if (compositionActionHandler) {
565
- compositionActionHandler({
566
- type: '@COMPOSITION/CB_RIGHT_CLICKED',
567
- payload: {
568
- e: e,
569
- block: {
570
- blockId: blockId,
571
- cbId: id,
572
- type: 'COMPONENT_BLOCK',
573
- workDir: (_a = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _a !== void 0 ? _a : 'NOT-FOUND'
574
- }
575
- }
576
- });
577
- }
578
- };
579
- var onLayoutChange = function (props) {
580
- if (!isEditMode) {
581
- return;
582
- }
583
- if (compositionActionHandler) {
584
- compositionActionHandler({
585
- type: '@COMPOSITION/PLACEMENT_CHANGED',
586
- payload: props
587
- });
588
- }
589
- setLayouts(props.layouts);
590
- };
591
- var onDragStart = function (props) {
592
- compositionActionHandler &&
593
- compositionActionHandler({
594
- type: '@COMPOSITION/CB_DRAG_START',
595
- payload: __assign({}, props)
596
- });
597
- };
598
- var onDragStop = function (props) {
599
- var _a, _b, _c;
600
- if (!isEditMode || !props.item) {
601
- return;
602
- }
603
- var item = props.item, prev = props.prev;
604
- var isShiftOn = shortcutKeyMode === 'BULK_SELECT' || shortcutKeyMode === 'COLLISION_SELECT';
605
- if (isLayoutPlacementSame(item, prev) && isShiftOn) {
606
- setTimeout(function () {
607
- onClickCB(Number(item.i));
608
- }, 0);
609
- return;
610
- }
611
- // NOTE 미사용시 삭제
612
- // if (item.i === 'BULK' && props.compositionData.item.groupLayouts) {
613
- // setSelectedBlockId('BULK');
614
- // const outerBasedChildrenPositions = props.compositionData.item.groupLayouts.map((cb) => ({
615
- // ...cb,
616
- // x: item.x + cb.x,
617
- // y: item.y + cb.y
618
- // }));
619
- // compositionActionHandler &&
620
- // compositionActionHandler({
621
- // type: '@COMPOSITION/BULK_DRAG_STOP',
622
- // payload: {
623
- // updatedBlocks: props.compositionData.
624
- // ...props,
625
- // outerBasedChildrenPositions,
626
- // workDir: getBlockWorkDirPath(newblock, editingGroupBlock) ?? 'NOT-FOUND'
627
- // }
628
- // });
629
- // return;
630
- // }
631
- var numberId = Number((_a = props.item) === null || _a === void 0 ? void 0 : _a.i);
632
- var blockId = (0, group_1.formatCbIdToBlockId)(numberId);
633
- var isIdNumber = !Number.isNaN(numberId);
634
- if (blockId) {
635
- if ((0, group_2.getGroupCB)(layouts[layoutByDevice])) {
636
- setTimeout(function () {
637
- setBulkBlockIds([]);
638
- }, 100);
639
- }
640
- setSelectedBlockId(blockId);
641
- }
642
- if (isLayoutPlacementSame(item, prev)) {
643
- // 확인 필요.. 그룹과 벌크
644
- compositionActionHandler &&
645
- compositionActionHandler({
646
- type: '@COMPOSITION/BLOCK_CLICKED',
647
- payload: {
648
- block: {
649
- blockId: blockId,
650
- cbId: numberId,
651
- type: 'COMPONENT_BLOCK',
652
- workDir: (_b = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _b !== void 0 ? _b : 'NOT-FOUND'
653
- }
654
- }
655
- });
656
- return;
657
- }
658
- if (compositionActionHandler && isIdNumber) {
659
- compositionActionHandler({
660
- type: '@COMPOSITION/CB_DRAG_STOP',
661
- payload: __assign(__assign({}, props), { blockId: blockId, workDir: (_c = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _c !== void 0 ? _c : 'NOT-FOUND' })
662
- });
663
- }
664
- };
665
- var onResizeStop = function (props) {
666
- var _a;
667
- var prev = props.prev, item = props.item;
668
- if (!isEditMode || !item) {
669
- return;
670
- }
671
- var numberId = Number(item.i);
672
- var isIdNumber = !Number.isNaN(numberId);
673
- if (isLayoutPlacementSame(item, prev)) {
674
- return;
675
- }
676
- if (isIdNumber) {
677
- var blockId = (0, group_1.formatCbIdToBlockId)(numberId);
678
- setSelectedBlockId(blockId);
679
- }
680
- if (compositionActionHandler && isIdNumber) {
681
- compositionActionHandler({
682
- type: '@COMPOSITION/CB_RESIZE_STOP',
683
- payload: __assign(__assign({}, props), { blockId: (0, group_1.formatCbIdToBlockId)(numberId), workDir: (_a = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _a !== void 0 ? _a : 'NOT-FOUND' })
684
- });
685
- }
686
- };
687
- var onAutoFitContent = function (props) {
688
- var _a;
689
- var prev = props.prev, item = props.item;
690
- if (!isEditMode || !item) {
691
- return;
692
- }
693
- var numberId = Number(item.i);
694
- var isIdNumber = !Number.isNaN(numberId);
695
- if (isLayoutPlacementSame(item, prev)) {
696
- return;
697
- }
698
- if (isIdNumber) {
699
- var blockId = (0, group_1.formatCbIdToBlockId)(numberId);
700
- setSelectedBlockId(blockId);
701
- }
702
- if (compositionActionHandler && isIdNumber) {
703
- compositionActionHandler({
704
- type: '@COMPOSITION/CB_AUTO_FIT_CONTENT',
705
- payload: __assign(__assign({}, props), { details: { hadPaddingChanged: props.hasPaddingChanged }, blockId: (0, group_1.formatCbIdToBlockId)(numberId), workDir: (_a = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _a !== void 0 ? _a : 'NOT-FOUND' })
706
- });
707
- }
708
- };
709
- var onClickSection = function (e) {
710
- if (!isEditMode) {
711
- return;
712
- }
713
- if (editingGroupBlock !== 'ROOT') {
714
- onClickGroup(e, editingGroupBlock);
715
- return;
716
- }
717
- setBulkBlockIds([]);
718
- setSelectedBlockId(null);
719
- compositionActionHandler &&
720
- compositionActionHandler({
721
- type: '@COMPOSITION/COMPOSITION_CLICKED',
722
- payload: {
723
- compositionId: props.compositionData.id
724
- }
725
- });
726
- };
727
- var onContextGroup = function (e, blockId, isEditingGroup) {
728
- var _a, _b, _c;
729
- setSelectedBlockId(blockId);
730
- var block = (0, group_1.findBlockByBlockId)(newblock, blockId);
731
- if ((block === null || block === void 0 ? void 0 : block.type) === 'COMPONENT_BLOCK') {
732
- return;
733
- }
734
- compositionActionHandler &&
735
- compositionActionHandler({
736
- type: '@COMPOSITION/GROUP_RIGHT_CLICKED',
737
- payload: {
738
- block: {
739
- blockId: blockId,
740
- type: 'GROUP_BLOCK',
741
- workDir: (_a = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _a !== void 0 ? _a : 'NOT-FOUND',
742
- childrenBlockIds: (_b = (0, group_1.findDirectChildrenBlockIds)(newblock, blockId)) !== null && _b !== void 0 ? _b : [],
743
- childrenCBIds: (_c = (0, group_1.findDirectChildrenCbIds)(newblock, blockId)) !== null && _c !== void 0 ? _c : []
744
- },
745
- e: e,
746
- isEditingGroup: isEditingGroup
747
- }
748
- });
749
- };
750
- var onContextSection = function (e) {
751
- if (editingGroupBlock !== 'ROOT') {
752
- e.preventDefault();
753
- return;
754
- }
755
- if (!isEditMode) {
756
- return;
757
- }
758
- if ((0, group_2.getGroupCB)(layouts[layoutByDevice])) {
759
- setBulkBlockIds([]);
760
- }
761
- setSelectedBlockId(null);
762
- compositionActionHandler &&
763
- compositionActionHandler({
764
- type: '@COMPOSITION/COMPOSITION_RIGHT_CLICKED',
765
- payload: {
766
- compositionId: props.compositionData.id,
767
- e: e
768
- }
769
- });
770
- };
771
- var onWidthChange = function (width) {
772
- // const responsiveFontMode =
773
- // // NOTE: local환경에서 CB_CONTENT_PROP_COMPOSITION이 없는 경우가 있음.
774
- // !!CB_CONTENT_PROP_COMPOSITION?.CB_CONTENT_PROP_COMPOSITION_SPEC_VARIABLEROOTFONTSIZE;
775
- var responsiveFontMode = true;
776
- if (device === 'MOBILE') {
777
- // const cellWidth = width / rows;
778
- var cellWidth_1 = 50;
779
- setRowHeight(cellWidth_1 * 0.56);
780
- baseFontSize !== 16 && setBaseFontSize(width * 0.0133);
781
- responsiveFontMode ? setBaseFontSize(width * 0.0421) : setBaseFontSize(16);
782
- return;
783
- }
784
- // const cellWidth = width / cols;
785
- var cellWidth = 50;
786
- setRowHeight(cellWidth * 0.56);
787
- responsiveFontMode ? setBaseFontSize(width * 0.0133) : setBaseFontSize(16);
788
- };
789
- var padding = (0, parseSectionPadding_1.default)(CB_LAYOUT_PROP_PADDING, device);
790
- var breakpoints = device === 'DESKTOP' ? { lg: 100, sm: 0 } : { lg: 1200, sm: 480 };
791
- var innerRef = (0, react_1.useRef)(null);
792
- var clickOneCBInBulk = function (id) {
793
- var _a, _b;
794
- var blockId = (0, group_1.formatCbIdToBlockId)(id);
795
- if (shortcutKeyMode === 'COLLISION_SELECT') {
796
- return;
797
- }
798
- if (shortcutKeyMode === 'BULK_SELECT') {
799
- if (bulkBlockIds.length <= 2) {
800
- var oneLastBlockId = bulkBlockIds.filter(function (each) { return each !== blockId; })[0];
801
- setBulkBlockIds([]);
802
- if (!oneLastBlockId) {
803
- return;
804
- }
805
- var cbId = (0, group_1.formatBlockIdToCbId)(oneLastBlockId);
806
- if (!cbId) {
807
- return;
808
- }
809
- setSelectedBlockId(oneLastBlockId);
810
- compositionActionHandler &&
811
- compositionActionHandler({
812
- type: '@COMPOSITION/BLOCK_CLICKED',
813
- payload: {
814
- block: {
815
- blockId: oneLastBlockId,
816
- cbId: cbId,
817
- type: 'COMPONENT_BLOCK',
818
- workDir: (_a = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _a !== void 0 ? _a : 'NOT-FOUND'
819
- }
820
- }
821
- });
822
- return;
823
- }
824
- var filtered = bulkBlockIds.filter(function (each) { return each !== blockId; });
825
- setBulkBlockIds(filtered);
826
- var groupDisabled = getWorkDirDirectChildrenLength() === filtered.length;
827
- var newBulkCBIds = filtered
828
- .map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); })
829
- .filter(function (each) { return each !== null; });
830
- compositionActionHandler &&
831
- compositionActionHandler({
832
- type: '@COMPOSITION/BLOCK_CLICKED',
833
- payload: {
834
- block: {
835
- type: 'BULK',
836
- blockId: 'BULK',
837
- childrenBlockIds: filtered,
838
- workDir: (_b = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _b !== void 0 ? _b : 'NOT-FOUND',
839
- childrenCBIds: newBulkCBIds,
840
- groupDisabled: groupDisabled && editingGroupBlock !== 'ROOT'
841
- }
842
- }
843
- });
844
- }
845
- };
846
- var showSectionHiddenCover = (function () {
847
- if (mode === 'EDIT') {
848
- var visibilityKey = device === 'DESKTOP'
849
- ? 'CB_CONTENT_PROP_VISIBILITY_SPEC_DESKTOP'
850
- : 'CB_CONTENT_PROP_VISIBILITY_SPEC_MOBILEWEB';
851
- // const isSectionVisible = jsonProperties?.CB_CONTENT_PROP_VISIBILITY[visibilityKey];
852
- // 가시성 상태를 반전하여 숨겨진 커버를 표시할지 결정
853
- // const shouldShowHiddenCover = !isSectionVisible;
854
- // return shouldShowHiddenCover;
855
- }
856
- return false;
857
- })();
858
- var onDoubleClickGroup = function (e, id) {
859
- e.stopPropagation();
860
- if (id === 'BULK') {
861
- return;
862
- }
863
- setEditingGroupBlock(id);
864
- };
865
- var onDoubleClickOutsideGroup = function () {
866
- setEditingGroupBlock('ROOT');
867
- setSelectedBlockId(null);
868
- };
869
- var onClickGroup = function (e, id) {
870
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
871
- e.stopPropagation();
872
- if (id === 'BULK') {
873
- return;
874
- }
875
- if (editingGroupBlock === id && shortcutKeyMode === 'BULK_SELECT') {
876
- return;
877
- }
878
- if (bulkBlockIds.includes(id) && shortcutKeyMode === 'BULK_SELECT') {
879
- if (bulkBlockIds.length <= 2) {
880
- var oneLastBlockId = bulkBlockIds.filter(function (each) { return each !== id; })[0];
881
- setBulkBlockIds([]);
882
- setSelectedBlockId(oneLastBlockId);
883
- compositionActionHandler &&
884
- compositionActionHandler({
885
- type: '@COMPOSITION/BLOCK_CLICKED',
886
- payload: {
887
- block: {
888
- blockId: oneLastBlockId,
889
- type: 'GROUP_BLOCK',
890
- workDir: (_a = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _a !== void 0 ? _a : 'NOT-FOUND',
891
- childrenBlockIds: (_b = (0, group_1.findDirectChildrenBlockIds)(newblock, oneLastBlockId)) !== null && _b !== void 0 ? _b : [],
892
- childrenCBIds: (_c = (0, group_1.findDirectChildrenCbIds)(newblock, oneLastBlockId)) !== null && _c !== void 0 ? _c : []
893
- }
894
- }
895
- });
896
- return;
897
- }
898
- var newBulkBlockIds_1 = bulkBlockIds.filter(function (each) { return each !== id; });
899
- var newBulkCBIds_1 = newBulkBlockIds_1
900
- .map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); })
901
- .filter(function (each) { return each !== null; });
902
- var childrenCBIds_1 = [];
903
- if (newBulkCBIds_1.length === 0) {
904
- var oneCB = (0, group_1.findOneComponentBlock)(newblock, newBulkBlockIds_1[0]);
905
- childrenCBIds_1 = oneCB ? [oneCB] : [];
906
- }
907
- else {
908
- childrenCBIds_1 = newBulkCBIds_1;
909
- }
910
- setBulkBlockIds(newBulkBlockIds_1);
911
- var groupDisabled = getWorkDirDirectChildrenLength() === newBulkBlockIds_1.length;
912
- compositionActionHandler &&
913
- compositionActionHandler({
914
- type: '@COMPOSITION/BLOCK_CLICKED',
915
- payload: {
916
- block: {
917
- blockId: 'BULK',
918
- type: 'BULK',
919
- childrenBlockIds: newBulkBlockIds_1,
920
- childrenCBIds: childrenCBIds_1,
921
- workDir: (_d = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _d !== void 0 ? _d : 'NOT-FOUND',
922
- groupDisabled: groupDisabled && editingGroupBlock !== 'ROOT'
923
- }
924
- }
925
- });
926
- return;
927
- }
928
- if (shortcutKeyMode === 'BULK_SELECT') {
929
- var added = (function () {
930
- if (selectedBlockId === editingGroupBlock) {
931
- return [id];
932
- }
933
- return selectedBlockId ? [selectedBlockId, id] : [id];
934
- })();
935
- if (bulkBlockIds.length === 0 && added.length === 1) {
936
- setSelectedBlockId(id);
937
- setBulkBlockIds([]);
938
- compositionActionHandler &&
939
- compositionActionHandler({
940
- type: '@COMPOSITION/BLOCK_CLICKED',
941
- payload: {
942
- block: {
943
- blockId: id,
944
- type: 'GROUP_BLOCK',
945
- workDir: (_e = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _e !== void 0 ? _e : 'NOT-FOUND',
946
- childrenBlockIds: (_f = (0, group_1.findDirectChildrenBlockIds)(newblock, id)) !== null && _f !== void 0 ? _f : [],
947
- childrenCBIds: (_g = (0, group_1.findDirectChildrenCbIds)(newblock, id)) !== null && _g !== void 0 ? _g : []
948
- }
949
- }
950
- });
951
- return;
952
- }
953
- var newBulkBlockIds_2 = Array.from(new Set(__spreadArray(__spreadArray([], bulkBlockIds, true), added, true)));
954
- var newBulkCBIds_2 = newBulkBlockIds_2
955
- .map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); })
956
- .filter(function (each) { return each !== null; });
957
- setBulkBlockIds(newBulkBlockIds_2);
958
- setSelectedBlockId(null);
959
- var childrenCBIds_2 = [];
960
- if (newBulkCBIds_2.length === 0) {
961
- var oneCB = (0, group_1.findOneComponentBlock)(newblock, newBulkBlockIds_2[0]);
962
- childrenCBIds_2 = oneCB ? [oneCB] : [];
963
- }
964
- else {
965
- childrenCBIds_2 = newBulkCBIds_2;
966
- }
967
- var groupDisabled = getWorkDirDirectChildrenLength() === newBulkBlockIds_2.length;
968
- compositionActionHandler &&
969
- compositionActionHandler({
970
- type: '@COMPOSITION/BLOCK_CLICKED',
971
- payload: {
972
- block: {
973
- blockId: 'BULK',
974
- type: 'BULK',
975
- childrenBlockIds: newBulkBlockIds_2,
976
- childrenCBIds: childrenCBIds_2,
977
- workDir: (_h = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _h !== void 0 ? _h : 'NOT-FOUND',
978
- groupDisabled: groupDisabled && editingGroupBlock !== 'ROOT'
979
- }
980
- }
981
- });
982
- return;
983
- }
984
- setBulkBlockIds([]);
985
- setSelectedBlockId(id);
986
- var newBulkBlockIds = (0, group_1.findDirectChildrenBlockIds)(newblock, id);
987
- var newBulkCBIds = newBulkBlockIds
988
- .map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); })
989
- .filter(function (each) { return each !== null; });
990
- var childrenCBIds = [];
991
- if (newBulkCBIds.length === 0) {
992
- var oneCB = (0, group_1.findOneComponentBlock)(newblock, newBulkBlockIds[0]);
993
- childrenCBIds = oneCB ? [oneCB] : [];
994
- }
995
- else {
996
- childrenCBIds = newBulkCBIds;
997
- }
998
- compositionActionHandler &&
999
- compositionActionHandler({
1000
- type: '@COMPOSITION/BLOCK_CLICKED',
1001
- payload: {
1002
- block: {
1003
- blockId: id,
1004
- type: 'GROUP_BLOCK',
1005
- workDir: (_j = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _j !== void 0 ? _j : 'NOT-FOUND',
1006
- childrenBlockIds: newBulkBlockIds,
1007
- childrenCBIds: childrenCBIds
1008
- }
1009
- }
1010
- });
1011
- };
1012
- var onBulkDragStop = function (_a) {
1013
- var _b;
1014
- var updatedItems = _a.updatedItems, item = _a.item;
1015
- if ((item === null || item === void 0 ? void 0 : item.i) === 'BULK') {
1016
- compositionActionHandler &&
1017
- compositionActionHandler({
1018
- type: '@COMPOSITION/BULK_DRAG_STOP',
1019
- payload: {
1020
- updatedBlocks: updatedItems.map(function (i) { return ({
1021
- cbId: Number(i.id),
1022
- blockId: (0, group_1.formatCbIdToBlockId)(Number(i.id)),
1023
- x: i.x,
1024
- y: i.y
1025
- }); })
1026
- }
1027
- });
1028
- return;
1029
- }
1030
- if (item) {
1031
- compositionActionHandler &&
1032
- compositionActionHandler({
1033
- type: '@COMPOSITION/GROUP_DRAG_STOP',
1034
- payload: {
1035
- workDir: (_b = (0, group_1.getBlockWorkDirPath)(newblock, item.i)) !== null && _b !== void 0 ? _b : 'NOT-FOUND',
1036
- updatedBlocks: updatedItems.map(function (i) { return ({
1037
- cbId: Number(i.id),
1038
- blockId: (0, group_1.formatCbIdToBlockId)(Number(i.id)),
1039
- x: i.x,
1040
- y: i.y
1041
- }); })
1042
- }
1043
- });
1044
- }
1045
- };
1046
- (0, react_1.useLayoutEffect)(function () {
1047
- if (innerRef.current) {
1048
- innerRef.current.setAttribute('data-section-id', props.compositionData.id.toString());
1049
- }
1050
- }, []);
1051
- function getWorkDirDirectChildrenLength() {
1052
- var ids = (0, group_1.findDirectChildrenBlockIds)(newblock, editingGroupBlock).filter(function (each) { return each !== 'BULK'; });
1053
- return ids.length + bulkBlockIds.length;
1054
- }
1055
- var editableCBIDs = (0, group_1.findDirectChildrenCbIds)(newblock, editingGroupBlock);
1056
- return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(dynamicLayoutContext_1.dynamicLayoutContext.Provider, __assign({ value: {
1057
- device: device
1058
- // mode,
1059
- // isPreview,
1060
- // navigationHandler,
1061
- // sectionActionHandler,
1062
- // editingSectionId,
1063
- // programmedSectionComponents,
1064
- // shortcutKeyMode,
1065
- // zoomScale,
1066
- // queryData
1067
- } }, { children: (0, jsx_runtime_1.jsx)(gleStyles_1.S_gleStyles, __assign({ isBulkMode: shortcutKeyMode === 'BULK_SELECT' }, { children: (0, jsx_runtime_1.jsx)(S_COMPOSITIONWrapper, __assign({ ref: gleRef, "x-dlayout-section-type": "NO_NAME", onClick: onClickSection, onContextMenu: function (e) {
1068
- e.stopPropagation();
1069
- e.preventDefault();
1070
- onContextSection(e);
1071
- } }, { children: (0, jsx_runtime_1.jsx)(CompositionBackground_1.default, __assign({}, props.compositionData, { isMobile: isMobile, overrideStyles: {
1072
- minHeight: customSectionStyles.minHeight,
1073
- paddingTop: padding.top,
1074
- paddingBottom: padding.bottom,
1075
- paddingRight: padding.right,
1076
- paddingLeft: padding.left
1077
- } }, { children: (0, jsx_runtime_1.jsx)(Responsive, __assign({ sectionId: props.compositionData.id.toString(), innerRef: innerRef, className: (0, clsx_1.clsx)({
1078
- 'selected-grid-layout': editingSectionId === props.compositionData.id
1079
- }), allowOverlap: true, layouts: layouts, resizeHandles: ['nw', 'e', 'n', 'ne', 's', 'se', 'sw', 'w'], breakpoints: breakpoints, breakpoint: breakpoint, cols: { lg: colsDesktop, sm: colsMobile }, rowHeight: rowHeight, margin: [10, 10], style: {
1080
- width: customSectionStyles.width,
1081
- maxWidth: customSectionStyles.maxWidth,
1082
- // minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
1083
- fontSize: "".concat(baseFontSize, "px")
1084
- }, onLayoutChange: onLayoutChange, onDragStart: onDragStart, onDragStop: onDragStop, onResizeStop: onResizeStop, onDragStopForGroup: onBulkDragStop, onFitToContent: onAutoFitContent, onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode, zoom: props.editorProps.zoomScale,
1085
- // GROUP
1086
- selectedGroupBlock: (_d = selectedBlockId === null || selectedBlockId === void 0 ? void 0 : selectedBlockId.toString()) !== null && _d !== void 0 ? _d : 'ROOT', editingGroupBlock: editingGroupBlock, blockStructure: newblock, bulkIds: bulkBlockIds, onDoubleClickGroup: onDoubleClickGroup, onClickGroup: onClickGroup, onDoubleClickOutsideGroup: onDoubleClickOutsideGroup, onContextGroup: onContextGroup }, { children: layouts[layoutByDevice].map(function (each, index) {
1087
- var matchedCB = componentBlocks === null || componentBlocks === void 0 ? void 0 : componentBlocks.find(function (cb) { return cb.id.toString() === each.i; });
1088
- var isInBulk = bulkBlockIds.includes((0, group_1.formatCbIdToBlockId)(Number(each.i)));
1089
- if (!matchedCB) {
1090
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
1091
- }
1092
- return ((0, jsx_runtime_1.jsx)("div", __assign({ className: (0, clsx_1.clsx)({
1093
- 'react-grid-item-selected': selectedBlockId === (0, group_1.formatCbIdToBlockId)(matchedCB.id)
1094
- }) }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ className: (0, clsx_1.clsx)({
1095
- 'grid-item-child': true
1096
- }), style: {
1097
- width: '100%',
1098
- height: '100%'
1099
- }, onClick: function (e) {
1100
- e.stopPropagation();
1101
- if (isInBulk) {
1102
- clickOneCBInBulk(matchedCB.id);
1103
- return;
1104
- }
1105
- if (editingGroupBlock !== 'ROOT') {
1106
- if (!editableCBIDs.includes(matchedCB.id)) {
1107
- e.preventDefault();
1108
- return;
1109
- }
1110
- }
1111
- onClickCB(matchedCB.id);
1112
- }, onContextMenu: function (e) {
1113
- e.stopPropagation();
1114
- e.preventDefault();
1115
- onContextMenuCB(matchedCB.id, e);
1116
- } }, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcher_1.default, { cbProps: matchedCB, device: device, rowHeight: rowHeight, index: index }) }) })) }), each.i));
1117
- }) })) })) })) })) })) }));
1118
- });
1119
- function isLayoutPlacementSame(current, prev) {
1120
- if (!prev) {
1121
- return false;
1122
- }
1123
- return (prev.w === current.w &&
1124
- prev.h === current.h &&
1125
- prev.x === current.x &&
1126
- prev.y === current.y &&
1127
- prev.z === current.z &&
1128
- prev.i === current.i);
1129
- }
1130
- var S_COMPOSITIONWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
1131
- exports.default = react_1.default.memo(CompositionEditor);
1132
- var templateObject_1;