pds-dev-kit-web-test 2.7.528 → 2.7.529
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/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +5 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image/Image.js +19 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +5 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/VideoPlayer/VideoPlayer.js +21 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/fallbacks/DataNotFound.d.ts +4 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/fallbacks/DataNotFound.js +32 -0
- package/package.json +1 -1
|
@@ -44,6 +44,7 @@ var types_1 = require("../../../../../../../DynamicLayout/sections/CustomSection
|
|
|
44
44
|
var util_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/util");
|
|
45
45
|
var parseStylePropShadow_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropShadow");
|
|
46
46
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
47
|
+
var DataNotFound_1 = __importDefault(require("../../../fallbacks/DataNotFound"));
|
|
47
48
|
var S_CB_AnimationObserverBox_1 = require("../components/S_CB_AnimationObserverBox");
|
|
48
49
|
var S_CB_Box_1 = require("../components/S_CB_Box");
|
|
49
50
|
var S_HiddenCover_1 = require("../components/S_HiddenCover");
|
|
@@ -111,7 +112,10 @@ function Button(props) {
|
|
|
111
112
|
}
|
|
112
113
|
return value;
|
|
113
114
|
}
|
|
114
|
-
|
|
115
|
+
if (mode === 'EDIT') {
|
|
116
|
+
return (0, jsx_runtime_1.jsx)(DataNotFound_1.default, { stringKey: "str_10478" });
|
|
117
|
+
}
|
|
118
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
115
119
|
}
|
|
116
120
|
if (device === 'MOBILE' &&
|
|
117
121
|
mode !== 'EDIT' &&
|
|
@@ -48,6 +48,7 @@ var compositionQueryContext_1 = require("../../../../../../../DynamicLayout/comp
|
|
|
48
48
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
49
49
|
var hooks_1 = require("../../../../hooks");
|
|
50
50
|
var util_1 = require("../../../../util");
|
|
51
|
+
var DataNotFound_1 = __importDefault(require("../../../fallbacks/DataNotFound"));
|
|
51
52
|
var S_CB_AnimationObserverBox_1 = require("../components/S_CB_AnimationObserverBox");
|
|
52
53
|
var S_CB_BoxWithShadow_1 = require("../components/S_CB_BoxWithShadow");
|
|
53
54
|
var S_HiddenCover_1 = require("../components/S_HiddenCover");
|
|
@@ -108,9 +109,24 @@ function Image(props) {
|
|
|
108
109
|
}
|
|
109
110
|
return queryContext.queryData[CB_CONTENT_PROP_IMAGE.CB_CONTENT_PROP_IMAGE_SPEC_CONNECTDATA];
|
|
110
111
|
};
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
var showDataNotFound = function () {
|
|
113
|
+
if (mode !== 'EDIT') {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
if (CB_CONTENT_PROP_IMAGE.CB_CONTENT_PROP_IMAGE_SPEC_VALUETYPE === 'DATA' ||
|
|
117
|
+
CB_CONTENT_PROP_IMAGE.CB_CONTENT_PROP_IMAGE_SPEC_VALUETYPE === 'DELEGATEDDATA') {
|
|
118
|
+
if (!(queryContext === null || queryContext === void 0 ? void 0 : queryContext.queryData)) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
if (!queryContext.queryData[CB_CONTENT_PROP_IMAGE.CB_CONTENT_PROP_IMAGE_SPEC_CONNECTDATA]) {
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return false;
|
|
126
|
+
};
|
|
127
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), (0, jsx_runtime_1.jsx)(S_CB_AnimationObserverBox_1.S_CB_AnimationObserverBox, __assign({ ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle }, { children: (0, jsx_runtime_1.jsx)(S_ImageWrapper, __assign({ style: __assign({}, effectCssProperties) }, { children: (0, jsx_runtime_1.jsxs)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign({}, layout), { overflow: 'hidden' }), boxStyle.normal), { cursor: CLINKCursor }), hoverStyle: __assign({}, boxStyle.hover), cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, onClick: onClickCLINK }, { children: [(0, jsx_runtime_1.jsx)(S_Image, { src: imgSrc() === 'ERROR'
|
|
128
|
+
? 'https://static.publ.site/pages-sample/img_cb_style_prop_bgmedia_spec_imageselector_01.png'
|
|
129
|
+
: imgSrc(), normalStyle: __assign({}, imgStyle.normal), hoverStyle: __assign({}, imgStyle.hover) }), showDataNotFound() && (0, jsx_runtime_1.jsx)(DataNotFound_1.default, { stringKey: "str_10478" })] })) })) }))] }));
|
|
114
130
|
}
|
|
115
131
|
function parseImageCBStyle(style, hoverStyle, mode) {
|
|
116
132
|
var boxStyle = {
|
|
@@ -27,6 +27,7 @@ var getGoogleFonts_1 = require("../../../../hooks/useGoogleFonts/getGoogleFonts"
|
|
|
27
27
|
var useGoogleFonts_1 = __importDefault(require("../../../../hooks/useGoogleFonts/useGoogleFonts"));
|
|
28
28
|
var textUtil_1 = require("../../../../newUtils/textUtil");
|
|
29
29
|
var util_1 = require("../../../../util");
|
|
30
|
+
var DataNotFound_1 = __importDefault(require("../../../fallbacks/DataNotFound"));
|
|
30
31
|
var S_CB_AnimationObserverBox_1 = require("../components/S_CB_AnimationObserverBox");
|
|
31
32
|
var S_CB_Box_1 = require("../components/S_CB_Box");
|
|
32
33
|
var S_HeightFitContentCover_1 = require("../components/S_HeightFitContentCover");
|
|
@@ -122,8 +123,10 @@ function Text(props) {
|
|
|
122
123
|
}
|
|
123
124
|
return value;
|
|
124
125
|
}
|
|
125
|
-
|
|
126
|
-
|
|
126
|
+
if (mode === 'EDIT') {
|
|
127
|
+
return (0, jsx_runtime_1.jsx)(DataNotFound_1.default, { stringKey: "str_10478" });
|
|
128
|
+
}
|
|
129
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
127
130
|
}
|
|
128
131
|
if (device === 'MOBILE' &&
|
|
129
132
|
mode !== 'EDIT' &&
|
|
@@ -21,17 +21,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
22
22
|
var react_1 = require("react");
|
|
23
23
|
var Icon_1 = require("../../../../../../../DynamicLayout/components/pdsOriginal/hybrid/Icon");
|
|
24
|
+
var compositionQueryContext_1 = require("../../../../../../../DynamicLayout/compositionQueryContext");
|
|
24
25
|
var dynamicLayoutContext_1 = require("../../../../../../../DynamicLayout/dynamicLayoutContext");
|
|
25
26
|
var hooks_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/hooks");
|
|
26
27
|
var colorUtil_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/newUtils/colorUtil");
|
|
27
28
|
var util_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/util");
|
|
28
29
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
30
|
+
var DataNotFound_1 = __importDefault(require("../../../fallbacks/DataNotFound"));
|
|
29
31
|
var S_CB_AnimationObserverBox_1 = require("../components/S_CB_AnimationObserverBox");
|
|
30
32
|
var S_CB_BoxWithShadow_1 = require("../components/S_CB_BoxWithShadow");
|
|
31
33
|
var S_HiddenCover_1 = require("../components/S_HiddenCover");
|
|
32
34
|
var helper_1 = require("./helper");
|
|
33
35
|
function VideoPlayer(props) {
|
|
34
|
-
var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
|
|
36
|
+
var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, mode = _a.mode, queryData = _a.queryData;
|
|
37
|
+
var queryContext = (0, compositionQueryContext_1.useCCBQueryPath)();
|
|
35
38
|
var CB_CONTENT_PROP_VIDEO = props.CB_CONTENT_PROP_VIDEO;
|
|
36
39
|
var index = props.index, CB_STYLE_PROP_BGCOLOR = props.CB_STYLE_PROP_BGCOLOR, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM;
|
|
37
40
|
var isEditMode = mode === 'EDIT';
|
|
@@ -53,7 +56,7 @@ function VideoPlayer(props) {
|
|
|
53
56
|
: CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] === 'NONE';
|
|
54
57
|
var hasEffect = !isNoneEffectType;
|
|
55
58
|
var effectVisibleStyle = hasEffect ? { opacity: isVisible ? 1 : 0 } : {};
|
|
56
|
-
var CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR, CB_CONTENT_PROP_VIDEO_SPEC_STARTTIME = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_STARTTIME, CB_CONTENT_PROP_VIDEO_SPEC_THUMB = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_THUMB, CB_CONTENT_PROP_VIDEO_SPEC_MAUTOPLAY = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_MAUTOPLAY, CB_CONTENT_PROP_VIDEO_SPEC_AUTOPLAY = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_AUTOPLAY, CB_CONTENT_PROP_VIDEO_SPEC_REPLAY = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_REPLAY, CB_CONTENT_PROP_VIDEO_SPEC_ENDTIME = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_ENDTIME;
|
|
59
|
+
var CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR, CB_CONTENT_PROP_VIDEO_SPEC_STARTTIME = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_STARTTIME, CB_CONTENT_PROP_VIDEO_SPEC_THUMB = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_THUMB, CB_CONTENT_PROP_VIDEO_SPEC_MAUTOPLAY = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_MAUTOPLAY, CB_CONTENT_PROP_VIDEO_SPEC_AUTOPLAY = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_AUTOPLAY, CB_CONTENT_PROP_VIDEO_SPEC_REPLAY = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_REPLAY, CB_CONTENT_PROP_VIDEO_SPEC_ENDTIME = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_ENDTIME, CB_CONTENT_PROP_VIDEO_SPEC_VALUETYPE = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_VALUETYPE;
|
|
57
60
|
var shouldAutoplay = (CB_CONTENT_PROP_VIDEO_SPEC_AUTOPLAY && device === 'DESKTOP') ||
|
|
58
61
|
(CB_CONTENT_PROP_VIDEO_SPEC_MAUTOPLAY && device === 'MOBILE');
|
|
59
62
|
var videoRef = (0, react_1.useRef)(null);
|
|
@@ -140,6 +143,21 @@ function VideoPlayer(props) {
|
|
|
140
143
|
video.play();
|
|
141
144
|
return;
|
|
142
145
|
};
|
|
146
|
+
var showDataNotFound = function () {
|
|
147
|
+
if (mode !== 'EDIT') {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
if (CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_VALUETYPE === 'DATA' ||
|
|
151
|
+
CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_VALUETYPE === 'DELEGATEDDATA') {
|
|
152
|
+
if (!(queryContext === null || queryContext === void 0 ? void 0 : queryContext.queryData)) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
if (!queryContext.queryData[CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_CONNECTDATA]) {
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return false;
|
|
160
|
+
};
|
|
143
161
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), (0, jsx_runtime_1.jsx)(S_CB_AnimationObserverBox_1.S_CB_AnimationObserverBox, __assign({ ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle }, { children: (0, jsx_runtime_1.jsxs)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign({}, propsStyle), layoutStyle), effectCssProperties), bgColorStyle), hoverStyle: __assign(__assign({}, propsHoverStyle), bgColorHoverStyle), cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device }, { children: [isEditMode && ((0, jsx_runtime_1.jsx)("div", __assign({ style: {
|
|
144
162
|
position: 'absolute',
|
|
145
163
|
top: '50%',
|
|
@@ -150,7 +168,7 @@ function VideoPlayer(props) {
|
|
|
150
168
|
alignItems: 'center',
|
|
151
169
|
justifyContent: 'center',
|
|
152
170
|
transform: 'translate(-50%, -50%)'
|
|
153
|
-
} }, { children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { iconName: "ic_video_play_circle", fillType: "fill", colorKey: "ui_cpnt_icon_sys_white", size: 48 }) }))), (0, jsx_runtime_1.jsxs)(S_Video, __assign({ muted: true, playsInline: true, controls: !isEditMode, isEditMode: isEditMode, ref: videoRef, "data-src": CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR, poster: CB_CONTENT_PROP_VIDEO_SPEC_THUMB, onPlay: onPlay, onEnded: onEnded, onError: onVideoError, onTimeUpdate: onTimeUpdate, onLoadedMetadata: onLoadedMetadata }, { children: [(0, jsx_runtime_1.jsx)("source", { src: videoURL }), "Your browser does not support the video tag."] }), videoURL + CB_CONTENT_PROP_VIDEO_SPEC_THUMB)] })) }))] }));
|
|
171
|
+
} }, { children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { iconName: "ic_video_play_circle", fillType: "fill", colorKey: "ui_cpnt_icon_sys_white", size: 48 }) }))), (0, jsx_runtime_1.jsxs)(S_Video, __assign({ muted: true, playsInline: true, controls: !isEditMode, isEditMode: isEditMode, ref: videoRef, "data-src": CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR, poster: CB_CONTENT_PROP_VIDEO_SPEC_THUMB, onPlay: onPlay, onEnded: onEnded, onError: onVideoError, onTimeUpdate: onTimeUpdate, onLoadedMetadata: onLoadedMetadata }, { children: [(0, jsx_runtime_1.jsx)("source", { src: videoURL }), "Your browser does not support the video tag."] }), videoURL + CB_CONTENT_PROP_VIDEO_SPEC_THUMB), showDataNotFound() && (0, jsx_runtime_1.jsx)(DataNotFound_1.default, { stringKey: "str_10478" })] })) }))] }));
|
|
154
172
|
}
|
|
155
173
|
function getBGColorStyles(props, device) {
|
|
156
174
|
var availableSpecCodes = [
|
|
@@ -171,6 +171,7 @@ export type CB_STYLE_PROP_COLOR_SPECS = CB_STYLE_PROP_COLOR_SPECS_BASE & {
|
|
|
171
171
|
};
|
|
172
172
|
export type CB_CONTENT_PROP_VIDEO = {
|
|
173
173
|
CB_CONTENT_PROP_VIDEO_SPEC_CONNECTDATA: STRING_PLAIN;
|
|
174
|
+
CB_CONTENT_PROP_VIDEO_SPEC_VALUETYPE: 'VALUE' | 'DELEGATEDDATA' | 'DATA';
|
|
174
175
|
CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR: string;
|
|
175
176
|
CB_CONTENT_PROP_VIDEO_SPEC_AUTOPLAY: string;
|
|
176
177
|
CB_CONTENT_PROP_VIDEO_SPEC_MAUTOPLAY: string;
|
package/dist/src/sub/DynamicLayout/sections/CustomSection/components/fallbacks/DataNotFound.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
11
|
+
var react_i18next_1 = require("react-i18next");
|
|
12
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
|
+
function DataNotFound(_a) {
|
|
14
|
+
var stringKey = _a.stringKey;
|
|
15
|
+
var t = (0, react_i18next_1.useTranslation)('translation').t;
|
|
16
|
+
return (0, jsx_runtime_1.jsx)(S_DataNotFound, { children: t(stringKey) });
|
|
17
|
+
}
|
|
18
|
+
exports.default = DataNotFound;
|
|
19
|
+
var S_DataNotFound = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: rgba(0, 0, 0, 0.5);\n color: white;\n display: flex;\n font-size: ", ";\n font-weight: ", ";\n justify-content: center;\n line-height: ", ";\n margin: auto;\n padding: ", ";\n text-align: center;\n width: 100%;\n word-break: keep-all;\n"], ["\n background-color: rgba(0, 0, 0, 0.5);\n color: white;\n display: flex;\n font-size: ", ";\n font-weight: ", ";\n justify-content: center;\n line-height: ", ";\n margin: auto;\n padding: ", ";\n text-align: center;\n width: 100%;\n word-break: keep-all;\n"])), function (_a) {
|
|
20
|
+
var theme = _a.theme;
|
|
21
|
+
return theme.desktopFontSize.caption1;
|
|
22
|
+
}, function (_a) {
|
|
23
|
+
var theme = _a.theme;
|
|
24
|
+
return theme.fontWeight.bold;
|
|
25
|
+
}, function (_a) {
|
|
26
|
+
var theme = _a.theme;
|
|
27
|
+
return theme.desktopLineHeight.caption1;
|
|
28
|
+
}, function (_a) {
|
|
29
|
+
var theme = _a.theme;
|
|
30
|
+
return theme.spacing.spacingD;
|
|
31
|
+
});
|
|
32
|
+
var templateObject_1;
|