pds-dev-kit-web-test 2.5.469 → 2.5.471
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/sub/DynamicLayout/CompositionEditor/CompositionEditor.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/CompositionEditor/CompositionEditor.js +49 -49
- package/dist/src/sub/DynamicLayout/DynamicLayout.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/DynamicLayout.js +3 -2
- package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackgroundMedia.js +24 -2
- package/dist/src/sub/DynamicLayout/components/Section/util/parseSectionBackgroundMediaData.js +3 -1
- package/dist/src/sub/DynamicLayout/mock_componentBlocks.d.ts +776 -0
- package/dist/src/sub/DynamicLayout/mock_componentBlocks.js +4236 -0
- package/dist/src/sub/DynamicLayout/mock_composition.js +6 -5
- package/dist/src/sub/DynamicLayout/mock_contentsCarousel.js +5 -17
- package/dist/src/sub/DynamicLayout/mock_contentsList.js +2 -2
- package/dist/src/sub/DynamicLayout/mock_slideBanner.d.ts +63 -63
- package/dist/src/sub/DynamicLayout/mock_slideBanner.js +65 -65
- package/dist/src/sub/DynamicLayout/mocks.js +13 -8477
- package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +3 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.d.ts +6 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.js +76 -192
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarouselCore.d.ts +2 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarouselCore.js +8 -6
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigationNextBtn.d.ts +15 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigationNextBtn.js +69 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigationPrevBtn.d.ts +15 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigationPrevBtn.js +69 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomProgressbar.d.ts +4 -18
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomProgressbar.js +19 -49
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/progressConfigs.js +16 -16
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/contentsCarouselUtils.d.ts +19 -20
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/contentsCarouselUtils.js +131 -696
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useFlexGridLayout.d.ts +18 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useFlexGridLayout.js +229 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useSwiper.d.ts +14 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useSwiper.js +46 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/types.d.ts +36 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.d.ts +6 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.js +54 -20
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/components/CustomPagination.d.ts +6 -25
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/components/CustomPagination.js +21 -51
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/contentsListUtils.d.ts +8 -9
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/contentsListUtils.js +42 -294
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/hooks/useFlexGridLayout.d.ts +18 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/hooks/useFlexGridLayout.js +229 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/types.d.ts +12 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBanner.d.ts +6 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBanner.js +82 -146
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBannerCore.d.ts +2 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBannerCore.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationNextBtn.d.ts +15 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationNextBtn.js +69 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationPrevBtn.d.ts +15 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigationPrevBtn.js +69 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomPagination.d.ts +9 -22
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomPagination.js +25 -35
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomProgressbar.d.ts +4 -18
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomProgressbar.js +19 -49
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/progressConfigs.js +8 -8
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useFlexGridLayout.d.ts +18 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useFlexGridLayout.js +229 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useSwiper.d.ts +16 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useSwiper.js +63 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/slideBannerUtils.d.ts +22 -24
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/slideBannerUtils.js +155 -925
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/types.d.ts +46 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.d.ts +6 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.js +10 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/types.d.ts +17 -3
- package/package.json +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigation.d.ts +0 -35
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigation.js +0 -118
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomPagination.d.ts +0 -32
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomPagination.js +0 -183
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigation.d.ts +0 -35
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigation.js +0 -118
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TypeOfCompositionAction } from '../compositionActionTypes';
|
|
3
|
-
import type { CustomSectionShortcutKeysType, IComposition } from '../types';
|
|
3
|
+
import type { CustomSectionShortcutKeysType, IComposition, PlaceRestrictionType } from '../types';
|
|
4
4
|
import type { Layout } from 'publ-echo-test/dist/lib/GridLayoutEditor/types';
|
|
5
5
|
export type LayoutsType = {
|
|
6
6
|
sm: Layout;
|
|
@@ -10,6 +10,7 @@ export type CompositionEditorCanvasProps = {
|
|
|
10
10
|
device: 'DESKTOP' | 'MOBILE';
|
|
11
11
|
zoomScale: number;
|
|
12
12
|
shortcutKeyMode: CustomSectionShortcutKeysType | '';
|
|
13
|
+
placementRestriction?: PlaceRestrictionType;
|
|
13
14
|
compositionActionHandler: (action: TypeOfCompositionAction) => void;
|
|
14
15
|
};
|
|
15
16
|
export type CompositionEditorProps = {
|
|
@@ -73,7 +73,7 @@ var parseCompositionPlacement_1 = __importDefault(require("../sections/CustomSec
|
|
|
73
73
|
var Responsive = (0, publ_echo_test_1.WidthProvider)(publ_echo_test_1.ResponsiveGridEditor);
|
|
74
74
|
var CompositionEditor = (0, react_1.forwardRef)(function CompositionEditorCanvas(props, ref) {
|
|
75
75
|
var _a, _b, _c, _d;
|
|
76
|
-
var _e = props.editorProps, device = _e.device, shortcutKeyMode = _e.shortcutKeyMode, compositionActionHandler = _e.compositionActionHandler;
|
|
76
|
+
var _e = props.editorProps, device = _e.device, shortcutKeyMode = _e.shortcutKeyMode, placementRestriction = _e.placementRestriction, compositionActionHandler = _e.compositionActionHandler;
|
|
77
77
|
// const GLE_MIN_WIDTH_DESKTOP_PX = `${GRID_CELL_MIN * cols}px`;
|
|
78
78
|
// const GLE_MIN_WIDTH_MOBILE_PX = `${GRID_CELL_MIN * rows}px`;
|
|
79
79
|
var editingSectionId = props.compositionData.id;
|
|
@@ -100,7 +100,7 @@ var CompositionEditor = (0, react_1.forwardRef)(function CompositionEditorCanvas
|
|
|
100
100
|
var cols = isMobile ? colsMobile : colsDesktop;
|
|
101
101
|
var canvasWidth = 50 * cols;
|
|
102
102
|
var _o = (0, react_1.useState)(function () {
|
|
103
|
-
var _a = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : [], zOrders), lg = _a.lg, sm = _a.sm;
|
|
103
|
+
var _a = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : [], zOrders, placementRestriction), lg = _a.lg, sm = _a.sm;
|
|
104
104
|
return {
|
|
105
105
|
lg: lg,
|
|
106
106
|
sm: sm
|
|
@@ -139,7 +139,7 @@ var CompositionEditor = (0, react_1.forwardRef)(function CompositionEditorCanvas
|
|
|
139
139
|
};
|
|
140
140
|
}, [componentBlocks]);
|
|
141
141
|
(0, react_1.useLayoutEffect)(function () {
|
|
142
|
-
var parsedLayouts = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : [], zOrders);
|
|
142
|
+
var parsedLayouts = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : [], zOrders, placementRestriction);
|
|
143
143
|
setLayouts(function (prev) {
|
|
144
144
|
var _a;
|
|
145
145
|
var _b;
|
|
@@ -1069,53 +1069,53 @@ var CompositionEditor = (0, react_1.forwardRef)(function CompositionEditorCanvas
|
|
|
1069
1069
|
e.stopPropagation();
|
|
1070
1070
|
e.preventDefault();
|
|
1071
1071
|
onContextSection(e);
|
|
1072
|
-
} }, { children: (0, jsx_runtime_1.jsx)(CompositionBackground_1.default, __assign({}, props.compositionData, { isMobile: isMobile, overrideStyles: {
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1072
|
+
} }, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(compositionQueryContext_1.CCBQueryPathContext.Provider, __assign({ value: { queryData: props.queryDataItem } }, { children: (0, jsx_runtime_1.jsx)(CompositionBackground_1.default, __assign({}, props.compositionData, { isMobile: isMobile, overrideStyles: {
|
|
1073
|
+
minHeight: customSectionStyles.minHeight,
|
|
1074
|
+
paddingTop: padding.top,
|
|
1075
|
+
paddingBottom: padding.bottom,
|
|
1076
|
+
paddingRight: padding.right,
|
|
1077
|
+
paddingLeft: padding.left
|
|
1078
|
+
} }, { children: (0, jsx_runtime_1.jsx)(Responsive, __assign({ sectionId: props.compositionData.id.toString(), innerRef: innerRef, className: (0, clsx_1.clsx)({
|
|
1079
|
+
'selected-grid-layout': editingSectionId === props.compositionData.id
|
|
1080
|
+
}), 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: {
|
|
1081
|
+
width: customSectionStyles.width,
|
|
1082
|
+
maxWidth: customSectionStyles.maxWidth,
|
|
1083
|
+
// minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
|
|
1084
|
+
fontSize: "".concat(baseFontSize, "px")
|
|
1085
|
+
}, onLayoutChange: onLayoutChange, onDragStart: onDragStart, onDragStop: onDragStop, onResizeStop: onResizeStop, onDragStopForGroup: onBulkDragStop, onFitToContent: onAutoFitContent, onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode, zoom: props.editorProps.zoomScale,
|
|
1086
|
+
// GROUP
|
|
1087
|
+
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) {
|
|
1088
|
+
var matchedCB = componentBlocks === null || componentBlocks === void 0 ? void 0 : componentBlocks.find(function (cb) { return cb.id.toString() === each.i; });
|
|
1089
|
+
var isInBulk = bulkBlockIds.includes((0, group_1.formatCbIdToBlockId)(Number(each.i)));
|
|
1090
|
+
if (!matchedCB) {
|
|
1091
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
1092
|
+
}
|
|
1093
|
+
return ((0, jsx_runtime_1.jsx)("div", __assign({ className: (0, clsx_1.clsx)({
|
|
1094
|
+
'react-grid-item-selected': selectedBlockId === (0, group_1.formatCbIdToBlockId)(matchedCB.id)
|
|
1095
|
+
}) }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ className: (0, clsx_1.clsx)({
|
|
1096
|
+
'grid-item-child': true
|
|
1097
|
+
}), style: {
|
|
1098
|
+
width: '100%',
|
|
1099
|
+
height: '100%'
|
|
1100
|
+
}, onClick: function (e) {
|
|
1101
|
+
e.stopPropagation();
|
|
1102
|
+
if (isInBulk) {
|
|
1103
|
+
clickOneCBInBulk(matchedCB.id);
|
|
1104
|
+
return;
|
|
1105
|
+
}
|
|
1106
|
+
if (editingGroupBlock !== 'ROOT') {
|
|
1107
|
+
if (!editableCBIDs.includes(matchedCB.id)) {
|
|
1108
|
+
e.preventDefault();
|
|
1109
|
+
return;
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
onClickCB(matchedCB.id);
|
|
1113
|
+
}, onContextMenu: function (e) {
|
|
1114
|
+
e.stopPropagation();
|
|
1108
1115
|
e.preventDefault();
|
|
1109
|
-
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
onClickCB(matchedCB.id);
|
|
1113
|
-
}, onContextMenu: function (e) {
|
|
1114
|
-
e.stopPropagation();
|
|
1115
|
-
e.preventDefault();
|
|
1116
|
-
onContextMenuCB(matchedCB.id, e);
|
|
1117
|
-
} }, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(compositionQueryContext_1.CCBQueryPathContext.Provider, __assign({ value: { queryData: props.queryDataItem } }, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcher_1.default, { cbProps: matchedCB, device: device, rowHeight: rowHeight, index: index }) })) }) })) }), each.i));
|
|
1118
|
-
}) })) })) })) })) })) }));
|
|
1116
|
+
onContextMenuCB(matchedCB.id, e);
|
|
1117
|
+
} }, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcher_1.default, { cbProps: matchedCB, device: device, rowHeight: rowHeight, index: index }) })) }), each.i));
|
|
1118
|
+
}) })) })) })) }) })) })) })) }));
|
|
1119
1119
|
});
|
|
1120
1120
|
function isLayoutPlacementSame(current, prev) {
|
|
1121
1121
|
if (!prev) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { DynamicLayoutProps } from './types';
|
|
3
|
-
declare function DynamicLayout({ device, mode, isPreview, sections, scrollDownTargetSectionId, editingSectionId, navigationHandler, sectionActionHandler, onClickEditSection, programmedSectionComponents, shortcutKeyMode, dynamicLayoutRef, zoomScale, queryData }: DynamicLayoutProps): JSX.Element;
|
|
3
|
+
declare function DynamicLayout({ device, mode, isPreview, sections, scrollDownTargetSectionId, editingSectionId, navigationHandler, sectionActionHandler, onClickEditSection, programmedSectionComponents, shortcutKeyMode, dynamicLayoutRef, zoomScale, queryData, placementRestriction }: DynamicLayoutProps): JSX.Element;
|
|
4
4
|
export default DynamicLayout;
|
|
@@ -25,7 +25,7 @@ var EditModeSectionMatcher_1 = require("./components/EditModeSectionMatcher");
|
|
|
25
25
|
var SectionMatcher_1 = require("./components/SectionMatcher");
|
|
26
26
|
var dynamicLayoutContext_1 = require("./dynamicLayoutContext");
|
|
27
27
|
function DynamicLayout(_a) {
|
|
28
|
-
var device = _a.device, _b = _a.mode, mode = _b === void 0 ? 'NORMAL' : _b, isPreview = _a.isPreview, sections = _a.sections, scrollDownTargetSectionId = _a.scrollDownTargetSectionId, editingSectionId = _a.editingSectionId, navigationHandler = _a.navigationHandler, sectionActionHandler = _a.sectionActionHandler, onClickEditSection = _a.onClickEditSection, programmedSectionComponents = _a.programmedSectionComponents, shortcutKeyMode = _a.shortcutKeyMode, dynamicLayoutRef = _a.dynamicLayoutRef, zoomScale = _a.zoomScale, queryData = _a.queryData;
|
|
28
|
+
var device = _a.device, _b = _a.mode, mode = _b === void 0 ? 'NORMAL' : _b, isPreview = _a.isPreview, sections = _a.sections, scrollDownTargetSectionId = _a.scrollDownTargetSectionId, editingSectionId = _a.editingSectionId, navigationHandler = _a.navigationHandler, sectionActionHandler = _a.sectionActionHandler, onClickEditSection = _a.onClickEditSection, programmedSectionComponents = _a.programmedSectionComponents, shortcutKeyMode = _a.shortcutKeyMode, dynamicLayoutRef = _a.dynamicLayoutRef, zoomScale = _a.zoomScale, queryData = _a.queryData, placementRestriction = _a.placementRestriction;
|
|
29
29
|
var filteredSortedSection = __spreadArray([], sections, true).filter(function (section) {
|
|
30
30
|
var _a;
|
|
31
31
|
if (!section.display) {
|
|
@@ -52,7 +52,8 @@ function DynamicLayout(_a) {
|
|
|
52
52
|
programmedSectionComponents: programmedSectionComponents,
|
|
53
53
|
shortcutKeyMode: shortcutKeyMode,
|
|
54
54
|
zoomScale: zoomScale,
|
|
55
|
-
queryData: queryData
|
|
55
|
+
queryData: queryData,
|
|
56
|
+
placementRestriction: placementRestriction
|
|
56
57
|
} }, { children: [mode === 'EDIT' && onClickEditSection && ((0, jsx_runtime_1.jsx)(EditModeSectionMatcher_1.EditModeSectionMatcher, { dynamicLayoutRef: dynamicLayoutRef, editingSectionId: editingSectionId, scrollDownTargetSectionId: scrollDownTargetSectionId, filteredSortedSection: filteredSortedSection, onClickEditSection: onClickEditSection })), mode !== 'EDIT' &&
|
|
57
58
|
(iframeSection ? ((0, jsx_runtime_1.jsx)(SectionMatcher_1.SectionMatcher, __assign({}, iframeSection), iframeSection.id)) : (filteredSortedSection.map(function (section) { return (0, jsx_runtime_1.jsx)(SectionMatcher_1.SectionMatcher, __assign({}, section), section.id); })))] })));
|
|
58
59
|
}
|
package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackgroundMedia.js
CHANGED
|
@@ -44,6 +44,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
44
44
|
exports.CustomSectionBackgroundMedia = void 0;
|
|
45
45
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
46
46
|
var react_1 = require("react");
|
|
47
|
+
var compositionQueryContext_1 = require("../../../../DynamicLayout/compositionQueryContext");
|
|
47
48
|
var utils_1 = require("../../../../DynamicLayout/utils");
|
|
48
49
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
49
50
|
var YouTubeIframe_1 = require("../../YouTubeIframe");
|
|
@@ -51,7 +52,8 @@ var util_1 = require("../util");
|
|
|
51
52
|
var VideoBGMedia_1 = __importDefault(require("./VideoBGMedia"));
|
|
52
53
|
function CustomSectionBackgroundMedia(_a) {
|
|
53
54
|
var specs = _a.specs, playerId = _a.playerId, mediaType = _a.mediaType, componentStyle = _a.componentStyle, device = _a.device, backgroundRef = _a.backgroundRef;
|
|
54
|
-
var
|
|
55
|
+
var queryContext = (0, compositionQueryContext_1.useCCBQueryPath)();
|
|
56
|
+
var _b = (0, util_1.parseSectionBackgroundMediaData)(specs, device), CB_STYLE_PROP_BGMEDIA_SPEC_YSRC = _b.CB_STYLE_PROP_BGMEDIA_SPEC_YSRC, CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY = _b.CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY, CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME = _b.CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME, CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME = _b.CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME, CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR = _b.CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR, CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR = _b.CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR, CB_STYLE_PROP_BGMEDIA_SPEC_VALUETYPE = _b.CB_STYLE_PROP_BGMEDIA_SPEC_VALUETYPE, CB_STYLE_PROP_BGMEDIA_SPEC_CONNECTDATA = _b.CB_STYLE_PROP_BGMEDIA_SPEC_CONNECTDATA;
|
|
55
57
|
var _c = (0, react_1.useState)({ width: 0, height: 0 }), youtubeSize = _c[0], setYoutubeSize = _c[1];
|
|
56
58
|
var youTubeIframeKey = (0, react_1.useMemo)(function () {
|
|
57
59
|
return "".concat(utils_1.YouTubeLinkParser.getId(String(CB_STYLE_PROP_BGMEDIA_SPEC_YSRC)), "-").concat(CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY, "-").concat(CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME, "-").concat(CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME);
|
|
@@ -100,12 +102,32 @@ function CustomSectionBackgroundMedia(_a) {
|
|
|
100
102
|
observer.disconnect();
|
|
101
103
|
};
|
|
102
104
|
}, [device, specs, playerId, mediaType]);
|
|
105
|
+
var imgSrc = function () {
|
|
106
|
+
var isDataConnected = CB_STYLE_PROP_BGMEDIA_SPEC_VALUETYPE === 'DATA' ||
|
|
107
|
+
CB_STYLE_PROP_BGMEDIA_SPEC_VALUETYPE === 'DELEGATEDDATA';
|
|
108
|
+
if (!isDataConnected) {
|
|
109
|
+
return CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR
|
|
110
|
+
? String(CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR)
|
|
111
|
+
: '';
|
|
112
|
+
}
|
|
113
|
+
if (!(queryContext === null || queryContext === void 0 ? void 0 : queryContext.queryData)) {
|
|
114
|
+
// eslint-disable-next-line
|
|
115
|
+
console.warn('ERROR: No query data found');
|
|
116
|
+
return 'ERROR';
|
|
117
|
+
}
|
|
118
|
+
if (!queryContext.queryData[String(CB_STYLE_PROP_BGMEDIA_SPEC_CONNECTDATA)]) {
|
|
119
|
+
// eslint-disable-next-line
|
|
120
|
+
console.warn("ERROR: ".concat(CB_STYLE_PROP_BGMEDIA_SPEC_CONNECTDATA, " NOT found in query data"));
|
|
121
|
+
return 'ERROR';
|
|
122
|
+
}
|
|
123
|
+
return queryContext.queryData[String(CB_STYLE_PROP_BGMEDIA_SPEC_CONNECTDATA)];
|
|
124
|
+
};
|
|
103
125
|
if ('background' in componentStyle) {
|
|
104
126
|
delete componentStyle.background;
|
|
105
127
|
}
|
|
106
128
|
switch (mediaType) {
|
|
107
129
|
case 'IMAGE':
|
|
108
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children:
|
|
130
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: imgSrc() && ((0, jsx_runtime_1.jsx)(S_Image, __assign({ src: imgSrc(), normalStyle: componentStyle }, { children: (0, jsx_runtime_1.jsx)("img", { src: imgSrc(), style: { visibility: 'hidden', width: '100%', height: '100%' } }) }))) }));
|
|
109
131
|
case 'YOUTUBE':
|
|
110
132
|
return ((0, jsx_runtime_1.jsx)(S_YoutubeContainer, __assign({}, youtubeSize, { children: youtubeSize.height > 0 && youtubeSize.width > 0 && ((0, jsx_runtime_1.jsx)(YouTubeIframe_1.YouTubeIframe, { src: String(CB_STYLE_PROP_BGMEDIA_SPEC_YSRC), id: playerId, loopMode: CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY ? 'use' : 'none', startSeconds: Number(CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME), endSeconds: Number(CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME), customHeight: youtubeSize.height, customWidth: youtubeSize.width }, youTubeIframeKey)) })));
|
|
111
133
|
case 'VIDEO':
|
package/dist/src/sub/DynamicLayout/components/Section/util/parseSectionBackgroundMediaData.js
CHANGED
|
@@ -26,7 +26,9 @@ var AVAILABLE_SPECS = [
|
|
|
26
26
|
'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR',
|
|
27
27
|
'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGEFIT',
|
|
28
28
|
'CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME',
|
|
29
|
-
'CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR'
|
|
29
|
+
'CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR',
|
|
30
|
+
'CB_STYLE_PROP_BGMEDIA_SPEC_VALUETYPE',
|
|
31
|
+
'CB_STYLE_PROP_BGMEDIA_SPEC_CONNECTDATA'
|
|
30
32
|
// 'CB_STYLE_PROP_BGMEDIA_SPEC_MPLAY'
|
|
31
33
|
];
|
|
32
34
|
function UseCustomSectionBackgroundMediaData(specs, device) {
|