pds-dev-kit-web-test 0.0.16 → 0.0.17
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/DynamicLayout.d.ts +1 -4
- package/dist/src/sub/DynamicLayout/DynamicLayout.js +2 -2
- package/dist/src/sub/DynamicLayout/desktop/components/common/YouTubeIframe.js +7 -74
- package/dist/src/sub/DynamicLayout/desktop/sections/ContentsCarouselSection/templates/TemplateB/TemplateB.js +2 -2
- package/dist/src/sub/DynamicLayout/dynamicLayoutContext.d.ts +1 -5
- package/dist/src/sub/DynamicLayout/mobile/components/common/YouTubeIframe.js +7 -74
- package/dist/src/sub/DynamicLayout/mobile/sections/ContentsCarouselSection/templates/TemplateA/TemplateA.js +3 -3
- package/dist/src/sub/DynamicLayout/mobile/sections/ContentsCarouselSection/templates/TemplateB/TemplateB.js +3 -3
- package/dist/src/sub/DynamicLayout/mobile/sections/FooterSection/templates/TemplateA/TemplateA.js +1 -1
- package/dist/src/sub/DynamicLayout/mobile/sections/InfoBoxSection/templates/TemplateA/TemplateA.js +2 -11
- package/dist/src/sub/DynamicLayout/types.d.ts +3 -8
- package/dist/src/sub/utils/YouTubeIframeHelper.d.ts +14 -0
- package/dist/src/sub/utils/YouTubeIframeHelper.js +109 -0
- package/package.json +1 -1
- package/release-note.md +7 -14
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
declare type DynamicLayoutProps = DynamicLayoutType & {
|
|
4
|
-
navigationHandler?: (linkType: 'WEB_LINK' | 'INTERNAL_LINK' | 'NONE', src: string) => void;
|
|
5
|
-
};
|
|
2
|
+
import { DynamicLayoutProps } from './types';
|
|
6
3
|
declare function DynamicLayout({ device, isPreview, sections, navigationHandler }: DynamicLayoutProps): JSX.Element;
|
|
7
4
|
export default DynamicLayout;
|
|
@@ -10,8 +10,8 @@ var mobile_1 = require("./mobile");
|
|
|
10
10
|
function DynamicLayout(_a) {
|
|
11
11
|
var device = _a.device, isPreview = _a.isPreview, sections = _a.sections, navigationHandler = _a.navigationHandler;
|
|
12
12
|
return (react_1.default.createElement(dynamicLayoutContext_1.dynamicLayoutContext.Provider, { value: { isPreview: isPreview, navigationHandler: navigationHandler } }, {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
MOBILE: react_1.default.createElement(mobile_1.MobileWeb, { sections: sections }),
|
|
14
|
+
DESKTOP: react_1.default.createElement(desktop_1.DesktopWeb, { sections: sections })
|
|
15
15
|
}[device]));
|
|
16
16
|
}
|
|
17
17
|
exports.default = DynamicLayout;
|
|
@@ -28,89 +28,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
var react_1 = __importStar(require("react"));
|
|
30
30
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
31
|
-
var
|
|
31
|
+
var YouTubeIframeHelper_1 = require("../../../../utils/YouTubeIframeHelper");
|
|
32
32
|
function YouTubeIframe(_a) {
|
|
33
33
|
var id = _a.id, src = _a.src;
|
|
34
|
-
var _b = (0, react_1.useState)(true), isYoutubeLoading = _b[0], setIsYoutubeLoading = _b[1];
|
|
35
34
|
var PLAYER_ID = "PLAYER_" + id;
|
|
36
|
-
var YOUTUBE_SCRIPT_ID = 'YOUTUBE_SCRIPT';
|
|
37
|
-
var YOUTUBE_SCRIPT_SRC = 'https://www.youtube.com/iframe_api';
|
|
38
35
|
(0, react_1.useLayoutEffect)(function () {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var firstScript = document.getElementsByTagName('script')[0];
|
|
44
|
-
(_a = firstScript.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(youtubeScript, firstScript);
|
|
45
|
-
youtubeScript.onload = function () {
|
|
46
|
-
var YT = window.YT;
|
|
47
|
-
YT.ready(function () {
|
|
48
|
-
onYouTubeIframeAPIReady();
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
return function () {
|
|
52
|
-
var youtubeScript = document.getElementById(YOUTUBE_SCRIPT_ID);
|
|
53
|
-
youtubeScript === null || youtubeScript === void 0 ? void 0 : youtubeScript.remove();
|
|
54
|
-
};
|
|
55
|
-
}, [src]);
|
|
56
|
-
function onYouTubeIframeAPIReady() {
|
|
57
|
-
try {
|
|
58
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
59
|
-
var player = new window.YT.Player(PLAYER_ID, {
|
|
60
|
-
videoId: youtubeLinkParser_1.default.getId(src),
|
|
61
|
-
playerVars: {
|
|
62
|
-
playsinline: 1,
|
|
63
|
-
autoplay: 1,
|
|
64
|
-
controls: 0
|
|
65
|
-
},
|
|
66
|
-
events: {
|
|
67
|
-
onReady: onPlayerReady,
|
|
68
|
-
onStateChange: onPlayerStateChange
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
// eslint-disable-next-line no-console
|
|
74
|
-
console.error(error);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function onPlayerReady(event) {
|
|
78
|
-
event.target.mute();
|
|
79
|
-
event.target.playVideo();
|
|
80
|
-
}
|
|
81
|
-
function onPlayerStateChange(event) {
|
|
82
|
-
try {
|
|
83
|
-
var ENDED = 0;
|
|
84
|
-
var PLAYING = 1;
|
|
85
|
-
var TEMP_STOP = 2;
|
|
86
|
-
var BUFFERING = 3;
|
|
87
|
-
var data = event.data;
|
|
88
|
-
if (data === PLAYING) {
|
|
89
|
-
setTimeout(function () {
|
|
90
|
-
setIsYoutubeLoading(false);
|
|
91
|
-
}, 100);
|
|
92
|
-
}
|
|
93
|
-
if (data === BUFFERING) {
|
|
94
|
-
setIsYoutubeLoading(true);
|
|
95
|
-
}
|
|
96
|
-
if (data === ENDED || data === TEMP_STOP) {
|
|
97
|
-
setIsYoutubeLoading(true);
|
|
98
|
-
event.target.playVideo();
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
catch (err) {
|
|
102
|
-
setIsYoutubeLoading(true);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
36
|
+
YouTubeIframeHelper_1.YouTubeIframeHelper.getReady();
|
|
37
|
+
YouTubeIframeHelper_1.YouTubeIframeHelper.registerPlayer(PLAYER_ID, src);
|
|
38
|
+
return function () { return YouTubeIframeHelper_1.YouTubeIframeHelper.cleanUp(); };
|
|
39
|
+
}, [id, src]);
|
|
105
40
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
106
|
-
isYoutubeLoading && react_1.default.createElement(BlackScreen, null),
|
|
107
41
|
react_1.default.createElement(S_IframeWrapper, null,
|
|
108
42
|
react_1.default.createElement("div", { id: PLAYER_ID }))));
|
|
109
43
|
}
|
|
110
|
-
var
|
|
44
|
+
var S_IframeWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n margin: auto;\n max-width: 100%;\n overflow: hidden;\n pointer-events: none;\n background-color: ", ";\n\n iframe {\n border: 0;\n height: 100%;\n margin-left: -100%;\n width: 300%;\n }\n"], ["\n height: 100%;\n margin: auto;\n max-width: 100%;\n overflow: hidden;\n pointer-events: none;\n background-color: ", ";\n\n iframe {\n border: 0;\n height: 100%;\n margin-left: -100%;\n width: 300%;\n }\n"])), function (_a) {
|
|
111
45
|
var theme = _a.theme;
|
|
112
46
|
return theme.ui_62;
|
|
113
47
|
});
|
|
114
|
-
var S_IframeWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 100%;\n margin: auto;\n max-width: 100%;\n overflow: hidden;\n pointer-events: none;\n\n iframe {\n border: 0;\n height: 100%;\n margin-left: -100%;\n width: 300%;\n }\n"], ["\n height: 100%;\n margin: auto;\n max-width: 100%;\n overflow: hidden;\n pointer-events: none;\n\n iframe {\n border: 0;\n height: 100%;\n margin-left: -100%;\n width: 300%;\n }\n"])));
|
|
115
48
|
exports.default = YouTubeIframe;
|
|
116
|
-
var templateObject_1
|
|
49
|
+
var templateObject_1;
|
|
@@ -77,12 +77,12 @@ function TemplateB() {
|
|
|
77
77
|
? 'autoplay'
|
|
78
78
|
: carouselInfiniteLoopMode === 'USE'
|
|
79
79
|
? 'loop'
|
|
80
|
-
: 'normal', autoplayDelay: carouselAutoplayTime, buttonSpacing: "-
|
|
80
|
+
: 'normal', autoplayDelay: carouselAutoplayTime, buttonSpacing: "-24px" }, filteredItems.map(function (item) {
|
|
81
81
|
var id = item.id;
|
|
82
82
|
var _a = item.properties, itemTitle = _a.title, itemDescription = _a.description, itemImageSrc = _a.imageSrc, itemLinkMethod = _a.linkMethod, itemLinkSrc = _a.linkSrc, itemLinkType = _a.linkType, itemButtonLabel = _a.buttonLabel;
|
|
83
83
|
return (react_1.default.createElement(components_1.Item, __assign({ key: id }, item),
|
|
84
84
|
itemImageSrc && (react_1.default.createElement(S_ItemImageBox, null,
|
|
85
|
-
react_1.default.createElement(components_1.Item.Image, { src: itemImageSrc, ratio: "3_2", width: "responsive", radius:
|
|
85
|
+
react_1.default.createElement(components_1.Item.Image, { src: itemImageSrc, ratio: "3_2", width: "responsive", radius: 16 }))),
|
|
86
86
|
itemTitle && (react_1.default.createElement(components_1.Item.Title, { text: itemTitle, color: itemTitleColorInHex, styleTheme: "subTitleBold" })),
|
|
87
87
|
itemDescription && (react_1.default.createElement(S_ItemDescriptionBox, { hasImage: !!itemImageSrc, hasTitle: !!itemTitle },
|
|
88
88
|
react_1.default.createElement(components_1.Item.Description, { text: itemDescription, color: itemDescriptionColorInHex, styleTheme: "body2Regular" }))),
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
3
|
-
declare type DynamicLayoutProps = DynamicLayoutType & {
|
|
4
|
-
navigationHandler?: (linkType: 'WEB_LINK' | 'INTERNAL_LINK' | 'NONE', src: string) => void;
|
|
5
|
-
};
|
|
2
|
+
import type { DynamicLayoutProps } from './types';
|
|
6
3
|
export declare const dynamicLayoutContext: import("react").Context<Pick<DynamicLayoutProps, "isPreview" | "navigationHandler">>;
|
|
7
|
-
export {};
|
|
@@ -28,89 +28,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
var react_1 = __importStar(require("react"));
|
|
30
30
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
31
|
-
var
|
|
31
|
+
var YouTubeIframeHelper_1 = require("../../../../utils/YouTubeIframeHelper");
|
|
32
32
|
function YouTubeIframe(_a) {
|
|
33
33
|
var id = _a.id, src = _a.src;
|
|
34
|
-
var _b = (0, react_1.useState)(true), isYoutubeLoading = _b[0], setIsYoutubeLoading = _b[1];
|
|
35
34
|
var PLAYER_ID = "PLAYER_" + id;
|
|
36
|
-
var YOUTUBE_SCRIPT_ID = 'YOUTUBE_SCRIPT';
|
|
37
|
-
var YOUTUBE_SCRIPT_SRC = 'https://www.youtube.com/iframe_api';
|
|
38
35
|
(0, react_1.useLayoutEffect)(function () {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var firstScript = document.getElementsByTagName('script')[0];
|
|
44
|
-
(_a = firstScript.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(youtubeScript, firstScript);
|
|
45
|
-
youtubeScript.onload = function () {
|
|
46
|
-
var YT = window.YT;
|
|
47
|
-
YT.ready(function () {
|
|
48
|
-
onYouTubeIframeAPIReady();
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
return function () {
|
|
52
|
-
var youtubeScript = document.getElementById(YOUTUBE_SCRIPT_ID);
|
|
53
|
-
youtubeScript === null || youtubeScript === void 0 ? void 0 : youtubeScript.remove();
|
|
54
|
-
};
|
|
55
|
-
}, [src]);
|
|
56
|
-
function onYouTubeIframeAPIReady() {
|
|
57
|
-
try {
|
|
58
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
59
|
-
var player = new window.YT.Player(PLAYER_ID, {
|
|
60
|
-
videoId: youtubeLinkParser_1.default.getId(src),
|
|
61
|
-
playerVars: {
|
|
62
|
-
playsinline: 1,
|
|
63
|
-
autoplay: 1,
|
|
64
|
-
controls: 0
|
|
65
|
-
},
|
|
66
|
-
events: {
|
|
67
|
-
onReady: onPlayerReady,
|
|
68
|
-
onStateChange: onPlayerStateChange
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
// eslint-disable-next-line no-console
|
|
74
|
-
console.error(error);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function onPlayerReady(event) {
|
|
78
|
-
event.target.mute();
|
|
79
|
-
event.target.playVideo();
|
|
80
|
-
}
|
|
81
|
-
function onPlayerStateChange(event) {
|
|
82
|
-
try {
|
|
83
|
-
var ENDED = 0;
|
|
84
|
-
var PLAYING = 1;
|
|
85
|
-
var TEMP_STOP = 2;
|
|
86
|
-
var BUFFERING = 3;
|
|
87
|
-
var data = event.data;
|
|
88
|
-
if (data === PLAYING) {
|
|
89
|
-
setTimeout(function () {
|
|
90
|
-
setIsYoutubeLoading(false);
|
|
91
|
-
}, 100);
|
|
92
|
-
}
|
|
93
|
-
if (data === BUFFERING) {
|
|
94
|
-
setIsYoutubeLoading(true);
|
|
95
|
-
}
|
|
96
|
-
if (data === ENDED || data === TEMP_STOP) {
|
|
97
|
-
setIsYoutubeLoading(true);
|
|
98
|
-
event.target.playVideo();
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
catch (err) {
|
|
102
|
-
setIsYoutubeLoading(true);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
36
|
+
YouTubeIframeHelper_1.YouTubeIframeHelper.getReady();
|
|
37
|
+
YouTubeIframeHelper_1.YouTubeIframeHelper.registerPlayer(PLAYER_ID, src);
|
|
38
|
+
return function () { return YouTubeIframeHelper_1.YouTubeIframeHelper.cleanUp(); };
|
|
39
|
+
}, [id, src]);
|
|
105
40
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
106
|
-
isYoutubeLoading && react_1.default.createElement(BlackScreen, null),
|
|
107
41
|
react_1.default.createElement(S_IframeWrapper, null,
|
|
108
42
|
react_1.default.createElement("div", { id: PLAYER_ID }))));
|
|
109
43
|
}
|
|
110
|
-
var
|
|
44
|
+
var S_IframeWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n margin: auto;\n max-width: 100%;\n overflow: hidden;\n pointer-events: none;\n background-color: ", ";\n\n /* NOTE \n iframe \uAD8C\uC7A5 \uB113\uC774(width)\n \uD654\uBA74 \uBE44\uC728 9:20 : 395% (Galaxy S20)\n \uD654\uBA74 \uBE44\uC728 9:21 : 415% (Galaxy Fold)\n */\n iframe {\n border: 0;\n height: 100%;\n width: 415%;\n margin-left: -157.5%;\n }\n"], ["\n height: 100%;\n margin: auto;\n max-width: 100%;\n overflow: hidden;\n pointer-events: none;\n background-color: ", ";\n\n /* NOTE \n iframe \uAD8C\uC7A5 \uB113\uC774(width)\n \uD654\uBA74 \uBE44\uC728 9:20 : 395% (Galaxy S20)\n \uD654\uBA74 \uBE44\uC728 9:21 : 415% (Galaxy Fold)\n */\n iframe {\n border: 0;\n height: 100%;\n width: 415%;\n margin-left: -157.5%;\n }\n"])), function (_a) {
|
|
111
45
|
var theme = _a.theme;
|
|
112
46
|
return theme.ui_62;
|
|
113
47
|
});
|
|
114
|
-
var S_IframeWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 100%;\n margin: auto;\n max-width: 100%;\n overflow: hidden;\n pointer-events: none;\n\n /* NOTE \n iframe \uAD8C\uC7A5 \uB113\uC774(width)\n \uD654\uBA74 \uBE44\uC728 9:20 : 395% (Galaxy S20)\n \uD654\uBA74 \uBE44\uC728 9:21 : 415% (Galaxy Fold)\n */\n iframe {\n border: 0;\n height: 100%;\n width: 415%;\n margin-left: -157.5%;\n }\n"], ["\n height: 100%;\n margin: auto;\n max-width: 100%;\n overflow: hidden;\n pointer-events: none;\n\n /* NOTE \n iframe \uAD8C\uC7A5 \uB113\uC774(width)\n \uD654\uBA74 \uBE44\uC728 9:20 : 395% (Galaxy S20)\n \uD654\uBA74 \uBE44\uC728 9:21 : 415% (Galaxy Fold)\n */\n iframe {\n border: 0;\n height: 100%;\n width: 415%;\n margin-left: -157.5%;\n }\n"])));
|
|
115
48
|
exports.default = YouTubeIframe;
|
|
116
|
-
var templateObject_1
|
|
49
|
+
var templateObject_1;
|
|
@@ -74,9 +74,9 @@ function TemplateA() {
|
|
|
74
74
|
var _a = item.properties, itemTitle = _a.title, itemDescription = _a.description, itemImageSrc = _a.imageSrc, itemLinkMethod = _a.linkMethod, itemLinkSrc = _a.linkSrc, itemLinkType = _a.linkType, itemButtonLabel = _a.buttonLabel;
|
|
75
75
|
return (react_1.default.createElement(components_1.Item, __assign({ key: id }, item),
|
|
76
76
|
itemImageSrc && (react_1.default.createElement(S_ItemImageBox, null,
|
|
77
|
-
react_1.default.createElement(components_1.Item.Image, { src: itemImageSrc, ratio: "1_1", width: "responsive" }))),
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
react_1.default.createElement(components_1.Item.Image, { src: itemImageSrc, ratio: "1_1", width: "responsive", shapeType: "rectangle" }))),
|
|
78
|
+
itemTitle && react_1.default.createElement(components_1.Item.Title, { text: itemTitle, color: itemTitleColorInHex }),
|
|
79
|
+
itemDescription && (react_1.default.createElement(S_ItemDescriptionBox, { hasImage: !!itemImageSrc, hasTitle: !!itemTitle },
|
|
80
80
|
react_1.default.createElement(components_1.Item.Description, { text: itemDescription, color: itemDescriptionColorInHex, customFontSize: "15px" }))),
|
|
81
81
|
itemLinkMethod === 'CLICK_BUTTON_IN_ITEM' && itemLinkSrc && (react_1.default.createElement(S_ItemButtonBox, { hasImage: !!itemImageSrc, hasTitle: !!itemTitle, hasDescription: !!itemDescription },
|
|
82
82
|
react_1.default.createElement(components_1.Item.Button, { text: itemButtonLabel, src: itemLinkSrc, linkType: itemLinkType, buttonType: itemButtonDesignType, backgroundColor: itemButtonBackgroundColorInHex, textColor: itemButtonLabelColorInHex, borderColor: itemButtonLabelColorInHex })))));
|
|
@@ -74,9 +74,9 @@ function TemplateB() {
|
|
|
74
74
|
var _a = item.properties, itemTitle = _a.title, itemDescription = _a.description, itemImageSrc = _a.imageSrc, itemLinkMethod = _a.linkMethod, itemLinkSrc = _a.linkSrc, itemLinkType = _a.linkType, itemButtonLabel = _a.buttonLabel;
|
|
75
75
|
return (react_1.default.createElement(components_1.Item, __assign({ key: id }, item),
|
|
76
76
|
itemImageSrc && (react_1.default.createElement(S_ItemImageBox, null,
|
|
77
|
-
react_1.default.createElement(components_1.Item.Image, { src: itemImageSrc, ratio: "3_2", width: "responsive" }))),
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
react_1.default.createElement(components_1.Item.Image, { src: itemImageSrc, ratio: "3_2", width: "responsive", radius: 16 }))),
|
|
78
|
+
itemTitle && react_1.default.createElement(components_1.Item.Title, { text: itemTitle, color: itemTitleColorInHex }),
|
|
79
|
+
itemDescription && (react_1.default.createElement(S_ItemDescriptionBox, { hasImage: !!itemImageSrc, hasTitle: !!itemTitle },
|
|
80
80
|
react_1.default.createElement(components_1.Item.Description, { text: itemDescription, color: itemDescriptionColorInHex, customFontSize: "15px" }))),
|
|
81
81
|
itemLinkMethod === 'CLICK_BUTTON_IN_ITEM' && itemLinkSrc && (react_1.default.createElement(S_ItemButtonBox, { hasImage: !!itemImageSrc, hasTitle: !!itemTitle, hasDescription: !!itemDescription },
|
|
82
82
|
react_1.default.createElement(components_1.Item.Button, { text: itemButtonLabel, src: itemLinkSrc, linkType: itemLinkType, buttonType: itemButtonDesignType, backgroundColor: itemButtonBackgroundColorInHex, textColor: itemButtonLabelColorInHex, borderColor: itemButtonLabelColorInHex })))));
|
package/dist/src/sub/DynamicLayout/mobile/sections/FooterSection/templates/TemplateA/TemplateA.js
CHANGED
|
@@ -64,7 +64,7 @@ var S_ContentsArea = styled_components_1.default.div(templateObject_1 || (templa
|
|
|
64
64
|
var theme = _a.theme;
|
|
65
65
|
return theme.spacing.spacingE;
|
|
66
66
|
});
|
|
67
|
-
var S_ImageBox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin: ", " 0;\n"], ["\n margin: ", " 0;\n"])), function (_a) {
|
|
67
|
+
var S_ImageBox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n text-align: left;\n margin: ", " 0;\n"], ["\n text-align: left;\n margin: ", " 0;\n"])), function (_a) {
|
|
68
68
|
var theme = _a.theme;
|
|
69
69
|
return theme.spacing.spacingE;
|
|
70
70
|
});
|
package/dist/src/sub/DynamicLayout/mobile/sections/InfoBoxSection/templates/TemplateA/TemplateA.js
CHANGED
|
@@ -86,23 +86,14 @@ var S_ItemsWrapper = styled_components_1.default.div(templateObject_3 || (templa
|
|
|
86
86
|
var theme = _a.theme;
|
|
87
87
|
return theme.spacing.spacingG;
|
|
88
88
|
});
|
|
89
|
-
var S_ItemWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin:
|
|
90
|
-
var theme = _a.theme;
|
|
91
|
-
return theme.spacing.spacingE;
|
|
92
|
-
}, function (_a) {
|
|
93
|
-
var isFirstItem = _a.isFirstItem, theme = _a.theme;
|
|
94
|
-
if (isFirstItem) {
|
|
95
|
-
return 0;
|
|
96
|
-
}
|
|
97
|
-
return theme.spacing.spacingE;
|
|
98
|
-
});
|
|
89
|
+
var S_ItemWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin: 40px 0;\n"], ["\n margin: 40px 0;\n"])));
|
|
99
90
|
var S_ItemImageBox = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n margin: ", " 0;\n"], ["\n display: flex;\n justify-content: center;\n margin: ", " 0;\n"])), function (_a) {
|
|
100
91
|
var theme = _a.theme;
|
|
101
92
|
return theme.spacing.spacingC;
|
|
102
93
|
});
|
|
103
94
|
var S_ItemDescriptionBox = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n margin: ", " 0;\n"], ["\n margin: ", " 0;\n"])), function (_a) {
|
|
104
95
|
var theme = _a.theme;
|
|
105
|
-
return theme.spacing.
|
|
96
|
+
return theme.spacing.spacingB;
|
|
106
97
|
});
|
|
107
98
|
var S_ButtonBox = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n margin: ", " 0;\n"], ["\n display: flex;\n justify-content: center;\n margin: ", " 0;\n"])), function (_a) {
|
|
108
99
|
var theme = _a.theme;
|
|
@@ -153,16 +153,11 @@ export interface IItemDescription extends IDescription {
|
|
|
153
153
|
text: string;
|
|
154
154
|
color?: string;
|
|
155
155
|
}
|
|
156
|
-
export declare type
|
|
157
|
-
|
|
158
|
-
type: 'BUTTON' | 'CONTENTS' | 'NONE';
|
|
159
|
-
conversionUrl: string;
|
|
160
|
-
buttonText: string;
|
|
161
|
-
};
|
|
162
|
-
export declare type DynamicLayoutType = {
|
|
163
|
-
device: 'UW' | 'UM';
|
|
156
|
+
export declare type DynamicLayoutProps = {
|
|
157
|
+
device: 'DESKTOP' | 'MOBILE';
|
|
164
158
|
isPreview: boolean;
|
|
165
159
|
sections: ISection[];
|
|
160
|
+
navigationHandler?: (linkType: 'WEB_LINK' | 'INTERNAL_LINK' | 'NONE', src: string) => void;
|
|
166
161
|
};
|
|
167
162
|
export declare const MOCK_DATA: ISection[];
|
|
168
163
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class YouTubeIframeHelper {
|
|
2
|
+
static players: {
|
|
3
|
+
id: string;
|
|
4
|
+
src: string;
|
|
5
|
+
}[];
|
|
6
|
+
static getReady(): void;
|
|
7
|
+
static cleanUp(): void;
|
|
8
|
+
static registerPlayer(playerId: string, src: string): void;
|
|
9
|
+
private static onYouTubeIframeAPIReady;
|
|
10
|
+
private static onPlayerReady;
|
|
11
|
+
private static onPlayerStateChange;
|
|
12
|
+
private static concealPlayer;
|
|
13
|
+
private static revealPlayer;
|
|
14
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.YouTubeIframeHelper = void 0;
|
|
7
|
+
var youtubeLinkParser_1 = __importDefault(require("./youtubeLinkParser"));
|
|
8
|
+
var YOUTUBE_SCRIPT_ID = 'YOUTUBE_SCRIPT';
|
|
9
|
+
var YOUTUBE_SCRIPT_SRC = 'https://www.youtube.com/iframe_api';
|
|
10
|
+
var YouTubeIframeHelper = /** @class */ (function () {
|
|
11
|
+
function YouTubeIframeHelper() {
|
|
12
|
+
}
|
|
13
|
+
YouTubeIframeHelper.getReady = function () {
|
|
14
|
+
var _this = this;
|
|
15
|
+
var _a;
|
|
16
|
+
var script = document.getElementById(YOUTUBE_SCRIPT_ID);
|
|
17
|
+
if (!script) {
|
|
18
|
+
var newScript = document.createElement('script');
|
|
19
|
+
newScript.id = YOUTUBE_SCRIPT_ID;
|
|
20
|
+
newScript.src = YOUTUBE_SCRIPT_SRC;
|
|
21
|
+
var firstScript = document.getElementsByTagName('script')[0];
|
|
22
|
+
(_a = firstScript.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(newScript, firstScript);
|
|
23
|
+
newScript.onload = function () {
|
|
24
|
+
var YT = window.YT;
|
|
25
|
+
YT.ready(function () {
|
|
26
|
+
_this.onYouTubeIframeAPIReady();
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
YouTubeIframeHelper.cleanUp = function () {
|
|
32
|
+
var script = document.getElementById(YOUTUBE_SCRIPT_ID);
|
|
33
|
+
script === null || script === void 0 ? void 0 : script.remove();
|
|
34
|
+
this.players = [];
|
|
35
|
+
};
|
|
36
|
+
YouTubeIframeHelper.registerPlayer = function (playerId, src) {
|
|
37
|
+
this.players.push({ id: playerId, src: src });
|
|
38
|
+
};
|
|
39
|
+
YouTubeIframeHelper.onYouTubeIframeAPIReady = function () {
|
|
40
|
+
var _this = this;
|
|
41
|
+
this.players.forEach(function (player) {
|
|
42
|
+
try {
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
44
|
+
var newPlayer = new window.YT.Player(player.id, {
|
|
45
|
+
videoId: youtubeLinkParser_1.default.getId(player.src),
|
|
46
|
+
playerVars: {
|
|
47
|
+
playsinline: 1,
|
|
48
|
+
autoplay: 1,
|
|
49
|
+
controls: 0
|
|
50
|
+
},
|
|
51
|
+
events: {
|
|
52
|
+
onReady: _this.onPlayerReady,
|
|
53
|
+
onStateChange: _this.onPlayerStateChange
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
// eslint-disable-next-line no-console
|
|
59
|
+
console.error(error);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
YouTubeIframeHelper.onPlayerReady = function (event) {
|
|
64
|
+
event.target.mute();
|
|
65
|
+
event.target.playVideo();
|
|
66
|
+
var player = event.target.h;
|
|
67
|
+
YouTubeIframeHelper.concealPlayer(player);
|
|
68
|
+
};
|
|
69
|
+
YouTubeIframeHelper.onPlayerStateChange = function (event) {
|
|
70
|
+
var UNSTARTED = -1;
|
|
71
|
+
var ENDED = 0;
|
|
72
|
+
var PLAYING = 1;
|
|
73
|
+
var PAUSED = 2;
|
|
74
|
+
var BUFFERING = 3;
|
|
75
|
+
// const CUED = 5; 동영상이 신호를 받고 재생할 준비가 되었을 때,
|
|
76
|
+
var stateCode = event.data;
|
|
77
|
+
var player = event.target.h;
|
|
78
|
+
try {
|
|
79
|
+
switch (stateCode) {
|
|
80
|
+
case PLAYING:
|
|
81
|
+
YouTubeIframeHelper.revealPlayer(player);
|
|
82
|
+
break;
|
|
83
|
+
case UNSTARTED:
|
|
84
|
+
case BUFFERING:
|
|
85
|
+
YouTubeIframeHelper.concealPlayer(player);
|
|
86
|
+
break;
|
|
87
|
+
case ENDED:
|
|
88
|
+
case PAUSED:
|
|
89
|
+
YouTubeIframeHelper.concealPlayer(player);
|
|
90
|
+
event.target.playVideo();
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
YouTubeIframeHelper.concealPlayer(player);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
YouTubeIframeHelper.concealPlayer = function (player) {
|
|
99
|
+
player.style.display = 'none';
|
|
100
|
+
return;
|
|
101
|
+
};
|
|
102
|
+
YouTubeIframeHelper.revealPlayer = function (player) {
|
|
103
|
+
player.style.display = 'initial';
|
|
104
|
+
return;
|
|
105
|
+
};
|
|
106
|
+
YouTubeIframeHelper.players = [];
|
|
107
|
+
return YouTubeIframeHelper;
|
|
108
|
+
}());
|
|
109
|
+
exports.YouTubeIframeHelper = YouTubeIframeHelper;
|
package/package.json
CHANGED
package/release-note.md
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
# PDS-DEV-KIT-WEB-TEST Release Notes
|
|
2
|
-
## [v0.0.
|
|
2
|
+
## [v0.0.17]
|
|
3
3
|
|
|
4
4
|
* sub
|
|
5
|
+
* DynamicLayout 유튜브쪽 문제 해결
|
|
5
6
|
* DynamicLayout 디자인 디테일 수정
|
|
6
|
-
* desktop
|
|
7
|
-
* ContentSheet 타이틀 사이즈 48px 수정
|
|
8
|
-
* Footer -> 위아래 마진값 원래 값으로 돌리기 (64px)
|
|
9
|
-
* 캐러셀 섹션
|
|
10
|
-
* 아이템 제목과 본문 사이 간격 24px -> 12px
|
|
11
|
-
* 아이템 제목 styleTheme : subTitleBold로 적용
|
|
12
|
-
* 인포박스 섹션
|
|
13
|
-
* 아이템 타이틀 customFontSize : 22px로 적용
|
|
14
|
-
* 아이템 본문 styleTheme : body2Regular 적용
|
|
15
7
|
* mobile
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
|
|
8
|
+
* 캐러셀 섹션 2번 타입 아이템 본문이 보이지 않던 부분 수정
|
|
9
|
+
* 푸터 정렬이 제대로 안되는 이슈 수정
|
|
10
|
+
* 인포박스 아이템
|
|
11
|
+
* 제목과 본문사이 spacing-a -> spacing-b
|
|
12
|
+
* 아이템 사이 간격 spacing-e -> 40px
|