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