pds-dev-kit-web 2.2.296 → 2.2.298
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/assets/icons/fill/Plugin.js +1 -1
- package/dist/src/common/assets/icons/line/Plugin.js +1 -1
- package/dist/src/common/services/i18n/resources/en.json +6 -1
- package/dist/src/common/services/i18n/resources/es.json +6 -1
- package/dist/src/common/services/i18n/resources/fil.json +6 -1
- package/dist/src/common/services/i18n/resources/index.d.ts +35 -0
- package/dist/src/common/services/i18n/resources/ja.json +6 -1
- package/dist/src/common/services/i18n/resources/ko.json +6 -1
- package/dist/src/common/services/i18n/resources/zh-cn.json +6 -1
- package/dist/src/common/services/i18n/resources/zh-tw.json +6 -1
- package/dist/src/sub/DynamicLayout/CompositionEditor/CompositionEditor.js +0 -2
- package/dist/src/sub/DynamicLayout/CompositionRenderer/Composition.js +9 -10
- package/dist/src/sub/DynamicLayout/CompositionRenderer/createCompositions.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/CompositionRenderer/createCompositions.js +15 -55
- package/dist/src/sub/DynamicLayout/gleStyles.js +1 -1
- package/dist/src/sub/DynamicLayout/mock_composition.d.ts +1 -2
- package/dist/src/sub/DynamicLayout/mock_queryData.d.ts +216 -74
- package/dist/src/sub/DynamicLayout/mock_queryData.js +1018 -2510
- package/dist/src/sub/DynamicLayout/mock_section.json +10777 -23774
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +38 -8
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.js +95 -56
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarouselCore.js +48 -22
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useSwiper.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useSwiper.js +10 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.js +75 -59
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image/Image.js +33 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBanner.js +67 -38
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useSwiper.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/hooks/useSwiper.js +11 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.d.ts +5 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +109 -9
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/textSpecFormatOptions.d.ts +1 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/textSpecFormatOptions.js +4 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/VideoPlayer/VideoPlayer.js +25 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.d.ts +4 -3
- 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 +33 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseJsonProperties.js +0 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseQueryData.d.ts +18 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseQueryData.js +92 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBorder.js +19 -5
- package/dist/src/sub/DynamicLayout/types.d.ts +1 -0
- package/package.json +1 -1
- package/release-note.md +2 -2
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.getTextOptionStyles = exports.getTextStyles = void 0;
|
|
17
|
+
exports.isValidDate = exports.getTextOptionStyles = exports.getTextStyles = void 0;
|
|
18
18
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
/* eslint-disable react/destructuring-assignment */
|
|
20
20
|
var react_1 = require("react");
|
|
@@ -22,11 +22,13 @@ var react_i18next_1 = require("react-i18next");
|
|
|
22
22
|
var DynamicLayout_1 = require("../../../../../../../DynamicLayout");
|
|
23
23
|
var compositionQueryContext_1 = require("../../../../../../../DynamicLayout/compositionQueryContext");
|
|
24
24
|
var types_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/types");
|
|
25
|
+
var parseQueryData_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/util/parseQueryData");
|
|
25
26
|
var hooks_1 = require("../../../../hooks");
|
|
26
27
|
var getGoogleFonts_1 = require("../../../../hooks/useGoogleFonts/getGoogleFonts");
|
|
27
28
|
var useGoogleFonts_1 = __importDefault(require("../../../../hooks/useGoogleFonts/useGoogleFonts"));
|
|
28
29
|
var textUtil_1 = require("../../../../newUtils/textUtil");
|
|
29
30
|
var util_1 = require("../../../../util");
|
|
31
|
+
var DataNotFound_1 = __importDefault(require("../../../fallbacks/DataNotFound"));
|
|
30
32
|
var S_CB_AnimationObserverBox_1 = require("../components/S_CB_AnimationObserverBox");
|
|
31
33
|
var S_CB_Box_1 = require("../components/S_CB_Box");
|
|
32
34
|
var S_HeightFitContentCover_1 = require("../components/S_HeightFitContentCover");
|
|
@@ -44,7 +46,7 @@ function Text(props) {
|
|
|
44
46
|
var desktopHeightFitContent = (_d = CB_STYLE_PROP_TEXTOPTION === null || CB_STYLE_PROP_TEXTOPTION === void 0 ? void 0 : CB_STYLE_PROP_TEXTOPTION.CB_STYLE_PROP_TEXTOPTION_SPEC_FITCONTENT) !== null && _d !== void 0 ? _d : false;
|
|
45
47
|
var mobileHeightFitContent = (_e = CB_STYLE_PROP_TEXTOPTION === null || CB_STYLE_PROP_TEXTOPTION === void 0 ? void 0 : CB_STYLE_PROP_TEXTOPTION['CB_STYLE_PROP_TEXTOPTION_SPEC_FITCONTENT:MOBILE']) !== null && _e !== void 0 ? _e : desktopHeightFitContent;
|
|
46
48
|
var heightFitContent = device === 'MOBILE' ? mobileHeightFitContent : desktopHeightFitContent;
|
|
47
|
-
var cLinkValue = function () {
|
|
49
|
+
var cLinkValue = function (defaultValue) {
|
|
48
50
|
if (CB_CONTENT_PROP_CLINK_SPEC_VALUETYPE === 'DATA' ||
|
|
49
51
|
CB_CONTENT_PROP_CLINK_SPEC_VALUETYPE === 'DELEGATEDDATA') {
|
|
50
52
|
if (!(queryContext === null || queryContext === void 0 ? void 0 : queryContext.queryData)) {
|
|
@@ -56,13 +58,13 @@ function Text(props) {
|
|
|
56
58
|
}
|
|
57
59
|
return link;
|
|
58
60
|
}
|
|
59
|
-
return
|
|
61
|
+
return defaultValue;
|
|
60
62
|
};
|
|
61
63
|
var _j = (0, useCLINK_1.default)({
|
|
62
|
-
src: cLinkValue(),
|
|
64
|
+
src: cLinkValue(CB_CONTENT_PROP_CLINK_SPEC_SRC),
|
|
63
65
|
type: CB_CONTENT_PROP_CLINK_SPEC_TYPE,
|
|
64
66
|
openNewTab: CB_CONTENT_PROP_CLINK_SPEC_NEWTAB,
|
|
65
|
-
internalSrc:
|
|
67
|
+
internalSrc: cLinkValue(CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC)
|
|
66
68
|
}), CLINKCursor = _j.CLINKCursor, onClickCLINK = _j.onClickCLINK;
|
|
67
69
|
var _k = getTextStyles(props.CB_STYLE_PROP_TEXT, device), textStyle = _k.style, textHoverStyle = _k.hoverStyle;
|
|
68
70
|
var textOptionStyle = getTextOptionStyles(props === null || props === void 0 ? void 0 : props.CB_STYLE_PROP_TEXTOPTION, device).style;
|
|
@@ -93,13 +95,39 @@ function Text(props) {
|
|
|
93
95
|
CB_CONTENT_PROP_TEXT_SPEC_VALUETYPE === 'DELEGATEDDATA';
|
|
94
96
|
if (isDataConnected) {
|
|
95
97
|
if (queryContext === null || queryContext === void 0 ? void 0 : queryContext.queryData) {
|
|
98
|
+
if (CB_CONTENT_PROP_TEXT_SPEC_CONNECTDATA === 'NONE') {
|
|
99
|
+
if (mode === 'EDIT') {
|
|
100
|
+
return (0, jsx_runtime_1.jsx)(DataNotFound_1.default, { stringKey: "str_10477" });
|
|
101
|
+
}
|
|
102
|
+
return '';
|
|
103
|
+
}
|
|
104
|
+
if (!Object.prototype.hasOwnProperty.call(queryContext.queryData, CB_CONTENT_PROP_TEXT_SPEC_CONNECTDATA)) {
|
|
105
|
+
if (mode === 'EDIT') {
|
|
106
|
+
return (0, jsx_runtime_1.jsx)(DataNotFound_1.default, { stringKey: "str_10478" });
|
|
107
|
+
}
|
|
108
|
+
return '';
|
|
109
|
+
}
|
|
96
110
|
var value = queryContext.queryData[CB_CONTENT_PROP_TEXT_SPEC_CONNECTDATA];
|
|
97
|
-
if (
|
|
98
|
-
|
|
111
|
+
if (value === null || value === undefined) {
|
|
112
|
+
if (mode === 'EDIT') {
|
|
113
|
+
return (0, jsx_runtime_1.jsx)(DataNotFound_1.default, { stringKey: "str_10478" });
|
|
114
|
+
}
|
|
115
|
+
return '';
|
|
116
|
+
}
|
|
117
|
+
if (!value && mode === 'EDIT') {
|
|
118
|
+
return (0, jsx_runtime_1.jsx)(DataNotFound_1.default, { stringKey: "str_10597" });
|
|
99
119
|
}
|
|
100
|
-
return
|
|
120
|
+
return (0, parseQueryData_1.parseQueryValue)({
|
|
121
|
+
value: value,
|
|
122
|
+
queryKey: CB_CONTENT_PROP_TEXT_SPEC_CONNECTDATA,
|
|
123
|
+
formatOption: formatOption,
|
|
124
|
+
t: t
|
|
125
|
+
});
|
|
101
126
|
}
|
|
102
|
-
|
|
127
|
+
if (mode === 'EDIT') {
|
|
128
|
+
return (0, jsx_runtime_1.jsx)(DataNotFound_1.default, { stringKey: "str_10478" });
|
|
129
|
+
}
|
|
130
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
103
131
|
}
|
|
104
132
|
if (device === 'MOBILE' &&
|
|
105
133
|
mode !== 'EDIT' &&
|
|
@@ -130,7 +158,13 @@ function Text(props) {
|
|
|
130
158
|
return props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT;
|
|
131
159
|
};
|
|
132
160
|
var getTruncatedText = function (text) {
|
|
161
|
+
if (!text || typeof text !== 'string') {
|
|
162
|
+
return text;
|
|
163
|
+
}
|
|
133
164
|
var maxLength = props.CB_STYLE_PROP_TEXT.CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS;
|
|
165
|
+
if (isRichText(text)) {
|
|
166
|
+
return domstringToPlain(text, maxLength, true);
|
|
167
|
+
}
|
|
134
168
|
if (!maxLength) {
|
|
135
169
|
return text;
|
|
136
170
|
}
|
|
@@ -189,3 +223,69 @@ function getTextOptionStyles(props, device) {
|
|
|
189
223
|
});
|
|
190
224
|
}
|
|
191
225
|
exports.getTextOptionStyles = getTextOptionStyles;
|
|
226
|
+
/**
|
|
227
|
+
* 텍스트가 Rich Text(HTML)인지 Plain Text인지 판별합니다.
|
|
228
|
+
* @param {string} text - 확인할 문자열
|
|
229
|
+
* @returns {boolean} - HTML 태그가 포함되어 있으면 true
|
|
230
|
+
*/
|
|
231
|
+
var isRichText = function (text) {
|
|
232
|
+
if (typeof text !== 'string')
|
|
233
|
+
return false;
|
|
234
|
+
// HTML 태그를 찾는 정규 표현식
|
|
235
|
+
var htmlRegex = /<[a-z][\s\S]*>/i;
|
|
236
|
+
return htmlRegex.test(text);
|
|
237
|
+
};
|
|
238
|
+
function domstringToPlain(domstring, ellipsis, useEnter) {
|
|
239
|
+
var tempDivElement = document.createElement('div');
|
|
240
|
+
tempDivElement.innerHTML = domstring;
|
|
241
|
+
// 1. 제거하고 싶은 '비-텍스트' 태그들을 정의하고 모두 삭제합니다.
|
|
242
|
+
var tagsToRemove = ['iframe', 'img', 'video', 'audio', 'script', 'style', 'canvas', 'svg'];
|
|
243
|
+
tagsToRemove.forEach(function (tagName) {
|
|
244
|
+
var elements = tempDivElement.querySelectorAll(tagName);
|
|
245
|
+
elements.forEach(function (el) { return el.remove(); });
|
|
246
|
+
});
|
|
247
|
+
// 2. 텍스트 추출 (위에서 태그를 지웠으므로 순수 텍스트만 남음)
|
|
248
|
+
var plainText = tempDivElement.textContent || tempDivElement.innerText || '';
|
|
249
|
+
// 3. 공백 처리
|
|
250
|
+
var processedText = plainText.replace(/\s{2,}/gi, ' ');
|
|
251
|
+
// 4. 말줄임표 처리
|
|
252
|
+
if (ellipsis && processedText.length > ellipsis) {
|
|
253
|
+
return "".concat(processedText.slice(0, ellipsis), "...");
|
|
254
|
+
}
|
|
255
|
+
// 5. 줄바꿈 처리 로직
|
|
256
|
+
if (useEnter) {
|
|
257
|
+
// innerHTML에서 br과 p 태그를 변환하기 전에,
|
|
258
|
+
// 이미 1번 단계에서 이미지/이프레임 등이 제거된 상태의 innerHTML을 사용합니다.
|
|
259
|
+
processedText = tempDivElement.innerHTML
|
|
260
|
+
.replace(/<br\s*\/?>/gi, '\n')
|
|
261
|
+
.replace(/<\/p>/gi, '\n')
|
|
262
|
+
.replace(/>/gi, '>')
|
|
263
|
+
.replace(/</gi, '<')
|
|
264
|
+
.replace(/&/gi, '&')
|
|
265
|
+
.replace(/<p[^>]*>/gi, '')
|
|
266
|
+
.replace(/<\/?[^>]+(>|$)/g, ''); // 남은 모든 HTML 태그 제거 (정규식 추가)
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
// 줄바꿈을 공백으로 치환하거나 <br>로 치환 (상황에 따라 선택)
|
|
270
|
+
processedText = processedText.replace(/\n/gi, ' ').trim();
|
|
271
|
+
}
|
|
272
|
+
return processedText;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* 문자열이 유효한 날짜 형태인지 판별합니다.
|
|
276
|
+
* (YYYY-MM-DD, ISO 8601, UTC 형태 등을 지원)
|
|
277
|
+
*/
|
|
278
|
+
var isValidDate = function (value) {
|
|
279
|
+
if (!value || typeof value !== 'string')
|
|
280
|
+
return false;
|
|
281
|
+
// 1. 기본적인 날짜 구조인지 정규식으로 확인 (숫자와 특수기호 조합)
|
|
282
|
+
// 최소한 "0000-00-00" 또는 "00/00/00" 형태는 갖춰야 함
|
|
283
|
+
var datePattern = /^\d{4}[./-]\d{1,2}[./-]\d{1,2}/;
|
|
284
|
+
if (!datePattern.test(value))
|
|
285
|
+
return false;
|
|
286
|
+
// 2. Date 객체 생성을 시도 (UTC 처리를 위해 공백을 T로 치환 고려)
|
|
287
|
+
var d = new Date(value.replace(' ', 'T'));
|
|
288
|
+
// 3. 존재하지 않는 날짜(예: 13월, 32일)라면 getTime()이 NaN을 반환함
|
|
289
|
+
return !isNaN(d.getTime());
|
|
290
|
+
};
|
|
291
|
+
exports.isValidDate = isValidDate;
|
|
@@ -9,7 +9,7 @@ exports.TEXT_SPEC_FORMAT_OPRIONS = {
|
|
|
9
9
|
var num = Number(value);
|
|
10
10
|
if (isNaN(num))
|
|
11
11
|
return value; // Return original if not a number
|
|
12
|
-
return new Intl.NumberFormat(
|
|
12
|
+
return new Intl.NumberFormat(undefined, {
|
|
13
13
|
maximumFractionDigits: 0
|
|
14
14
|
}).format(num);
|
|
15
15
|
}
|
|
@@ -21,7 +21,7 @@ exports.TEXT_SPEC_FORMAT_OPRIONS = {
|
|
|
21
21
|
var num = Number(value);
|
|
22
22
|
if (isNaN(num))
|
|
23
23
|
return value; // Return original if not a number
|
|
24
|
-
return new Intl.NumberFormat(
|
|
24
|
+
return new Intl.NumberFormat(undefined, {
|
|
25
25
|
minimumFractionDigits: 1,
|
|
26
26
|
maximumFractionDigits: 1
|
|
27
27
|
}).format(num);
|
|
@@ -34,7 +34,7 @@ exports.TEXT_SPEC_FORMAT_OPRIONS = {
|
|
|
34
34
|
var num = Number(value);
|
|
35
35
|
if (isNaN(num))
|
|
36
36
|
return value; // Return original if not a number
|
|
37
|
-
return new Intl.NumberFormat(
|
|
37
|
+
return new Intl.NumberFormat(undefined, {
|
|
38
38
|
minimumFractionDigits: 2,
|
|
39
39
|
maximumFractionDigits: 2
|
|
40
40
|
}).format(num);
|
|
@@ -139,7 +139,7 @@ exports.TEXT_SPEC_FORMAT_OPRIONS = {
|
|
|
139
139
|
if (isNaN(d.getTime()))
|
|
140
140
|
return value;
|
|
141
141
|
var dd = String(d.getDate()).padStart(2, '0');
|
|
142
|
-
var mmm = d.toLocaleString(
|
|
142
|
+
var mmm = d.toLocaleString(undefined, { month: 'short' });
|
|
143
143
|
return "".concat(dd, " ").concat(mmm);
|
|
144
144
|
}
|
|
145
145
|
},
|
|
@@ -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
36
|
var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
|
|
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';
|
|
@@ -140,6 +143,27 @@ 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 (!Object.prototype.hasOwnProperty.call(queryContext.queryData, CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_CONNECTDATA)) {
|
|
156
|
+
if (mode === 'EDIT') {
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
if (!queryContext.queryData[CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_CONNECTDATA]) {
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return false;
|
|
166
|
+
};
|
|
143
167
|
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
168
|
position: 'absolute',
|
|
145
169
|
top: '50%',
|
|
@@ -150,7 +174,7 @@ function VideoPlayer(props) {
|
|
|
150
174
|
alignItems: 'center',
|
|
151
175
|
justifyContent: 'center',
|
|
152
176
|
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)] })) }))] }));
|
|
177
|
+
} }, { 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
178
|
}
|
|
155
179
|
function getBGColorStyles(props, device) {
|
|
156
180
|
var availableSpecCodes = [
|
|
@@ -46,7 +46,7 @@ export type CB_CONTENT_PROP_CONTENTSCAROUSEL = {
|
|
|
46
46
|
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_VALUETYPE: CCB_VALUE_TYPE;
|
|
47
47
|
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_CONNECTDATA: STRING_PLAIN;
|
|
48
48
|
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DATASORTING: STRING_PLAIN;
|
|
49
|
-
|
|
49
|
+
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DATAOFFSET: NUMBER_INTEGER;
|
|
50
50
|
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MANUALITEMS: ManualItem[];
|
|
51
51
|
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_ITEMCOUNTS: NUMBER_INTEGER;
|
|
52
52
|
CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DISPLAYCOUNTS: NUMBER_INTEGER;
|
|
@@ -56,7 +56,7 @@ export type CB_CONTENT_PROP_SLIDEBANNER = {
|
|
|
56
56
|
CB_CONTENT_PROP_SLIDEBANNER_SPEC_VALUETYPE: CCB_VALUE_TYPE;
|
|
57
57
|
CB_CONTENT_PROP_SLIDEBANNER_SPEC_CONNECTDATA: STRING_PLAIN;
|
|
58
58
|
CB_CONTENT_PROP_SLIDEBANNER_SPEC_DATASORTING: STRING_PLAIN;
|
|
59
|
-
|
|
59
|
+
CB_CONTENT_PROP_SLIDEBANNER_SPEC_DATAOFFSET: NUMBER_INTEGER;
|
|
60
60
|
CB_CONTENT_PROP_SLIDEBANNER_SPEC_MANUALITEMS: ManualItem[];
|
|
61
61
|
CB_CONTENT_PROP_SLIDEBANNER_SPEC_ITEMCOUNTS: NUMBER_INTEGER;
|
|
62
62
|
};
|
|
@@ -65,7 +65,7 @@ export type CB_CONTENT_PROP_CONTENTSLIST = {
|
|
|
65
65
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_CONNECTDATA: STRING_PLAIN;
|
|
66
66
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_DATASORTING: STRING_PLAIN;
|
|
67
67
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_DATAFILTER: STRING_PLAIN;
|
|
68
|
-
|
|
68
|
+
CB_CONTENT_PROP_CONTENTSLIST_SPEC_DATAOFFSET: NUMBER_INTEGER;
|
|
69
69
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_MANUALITEMS: ManualItem[];
|
|
70
70
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_ITEMCOUNTS: NUMBER_INTEGER;
|
|
71
71
|
CB_CONTENT_PROP_CONTENTSLIST_SPEC_DISPLAYCOUNTS: NUMBER_INTEGER;
|
|
@@ -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,33 @@
|
|
|
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_Wrapper, { children: (0, jsx_runtime_1.jsx)(S_DataNotFound, { children: t(stringKey) }) }));
|
|
17
|
+
}
|
|
18
|
+
exports.default = DataNotFound;
|
|
19
|
+
var S_Wrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n bottom: 0;\n display: flex;\n height: 100%;\n justify-content: center;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n width: 100%;\n"], ["\n align-items: center;\n bottom: 0;\n display: flex;\n height: 100%;\n justify-content: center;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n width: 100%;\n"])));
|
|
20
|
+
var S_DataNotFound = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __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) {
|
|
21
|
+
var theme = _a.theme;
|
|
22
|
+
return theme.desktopFontSize.caption2;
|
|
23
|
+
}, function (_a) {
|
|
24
|
+
var theme = _a.theme;
|
|
25
|
+
return theme.fontWeight.bold;
|
|
26
|
+
}, function (_a) {
|
|
27
|
+
var theme = _a.theme;
|
|
28
|
+
return theme.desktopLineHeight.caption1;
|
|
29
|
+
}, function (_a) {
|
|
30
|
+
var theme = _a.theme;
|
|
31
|
+
return theme.spacing.spacingA;
|
|
32
|
+
});
|
|
33
|
+
var templateObject_1, templateObject_2;
|
|
@@ -37,7 +37,6 @@ function parseJsonProperties(properties, device) {
|
|
|
37
37
|
};
|
|
38
38
|
if (normalizedProperty.name in types_4.CB_STYLE_PROP_KEYS) {
|
|
39
39
|
var _a = (0, stylePropParsers_1.parseStyleProperties)(normalizedProperty, device), style = _a.style, overlayStyle = _a.overlayStyle;
|
|
40
|
-
// console.log(normalizedProperty.name, ' >>>', overlayStyle, overlayHoverStyle);
|
|
41
40
|
return __assign(__assign({}, acc), { style: __assign(__assign({}, acc.style), style), overlayStyle: __assign(__assign({}, acc.overlayStyle), overlayStyle) });
|
|
42
41
|
}
|
|
43
42
|
if (normalizedProperty.name in types_3.CB_LAYOUT_PROP_KEYS) {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Formatter } from '../components/ComponentBlock/componentBlocks/Text/textSpecFormatOptions';
|
|
2
|
+
import type { TFunction } from 'i18next';
|
|
3
|
+
export declare function parseQueryValue({ value, queryKey, formatOption, t }: {
|
|
4
|
+
value: any;
|
|
5
|
+
queryKey: string;
|
|
6
|
+
formatOption?: {
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
formatter: Formatter;
|
|
10
|
+
};
|
|
11
|
+
t: TFunction;
|
|
12
|
+
}): any;
|
|
13
|
+
/**
|
|
14
|
+
* 문자열이 유효한 날짜 형태인지 판별합니다.
|
|
15
|
+
* (YYYY-MM-DD, ISO 8601, UTC 형태 등을 지원)
|
|
16
|
+
*/
|
|
17
|
+
export declare const isValidDate: (value: string) => boolean;
|
|
18
|
+
export declare function formatReleasedDateToYear(dateStr: string | null | undefined): string | null | undefined;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatReleasedDateToYear = exports.isValidDate = exports.parseQueryValue = void 0;
|
|
4
|
+
function parseQueryValue(_a) {
|
|
5
|
+
var value = _a.value, queryKey = _a.queryKey, formatOption = _a.formatOption, t = _a.t;
|
|
6
|
+
if (Array.isArray(value)) {
|
|
7
|
+
return value.map(function (item) { return item.name; }).join(', ');
|
|
8
|
+
}
|
|
9
|
+
if (queryKey === 'saleStatus') {
|
|
10
|
+
if (value === 'ACTIVE') {
|
|
11
|
+
return t('str_commerce_products_status_sale_active');
|
|
12
|
+
}
|
|
13
|
+
if (value === 'DISCONTINUED') {
|
|
14
|
+
return t('str_commerce_products_status_sale_stopped');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
if (queryKey === 'paid') {
|
|
18
|
+
if (value === 'PAID') {
|
|
19
|
+
return t('str_paid');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (queryKey === 'pinned') {
|
|
23
|
+
if (value === 'true') {
|
|
24
|
+
return t('str_pinned');
|
|
25
|
+
}
|
|
26
|
+
return '';
|
|
27
|
+
}
|
|
28
|
+
if (queryKey === 'releasedDate') {
|
|
29
|
+
return formatReleasedDateToYear(value);
|
|
30
|
+
}
|
|
31
|
+
if (queryKey.endsWith('Date') || queryKey.endsWith('At')) {
|
|
32
|
+
if (formatOption) {
|
|
33
|
+
return formatOption.formatter(convertToUTC(value));
|
|
34
|
+
}
|
|
35
|
+
return convertToLocalTime(value);
|
|
36
|
+
}
|
|
37
|
+
if (formatOption) {
|
|
38
|
+
return formatOption.formatter(convertToUTC(value));
|
|
39
|
+
}
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
exports.parseQueryValue = parseQueryValue;
|
|
43
|
+
/**
|
|
44
|
+
* UTC 날짜 문자열을 로컬 타임 문자열로 변환합니다.
|
|
45
|
+
* @param utcString - '2022-07-29 00:55:03' 형태의 문자열
|
|
46
|
+
* @returns 로컬 시간으로 변환된 문자열
|
|
47
|
+
*/
|
|
48
|
+
var convertToLocalTime = function (utcString) {
|
|
49
|
+
if ((0, exports.isValidDate)(utcString) === false) {
|
|
50
|
+
return utcString;
|
|
51
|
+
}
|
|
52
|
+
var date = new Date("".concat(utcString.replace(' ', 'T'), "Z"));
|
|
53
|
+
return date.toLocaleString();
|
|
54
|
+
};
|
|
55
|
+
var convertToUTC = function (string) {
|
|
56
|
+
if ((0, exports.isValidDate)(string) === false) {
|
|
57
|
+
return string;
|
|
58
|
+
}
|
|
59
|
+
var date = new Date("".concat(string.replace(' ', 'T'), "Z"));
|
|
60
|
+
return date.toISOString();
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* 문자열이 유효한 날짜 형태인지 판별합니다.
|
|
64
|
+
* (YYYY-MM-DD, ISO 8601, UTC 형태 등을 지원)
|
|
65
|
+
*/
|
|
66
|
+
var isValidDate = function (value) {
|
|
67
|
+
if (!value || typeof value !== 'string')
|
|
68
|
+
return false;
|
|
69
|
+
// 1. 기본적인 날짜 구조인지 정규식으로 확인 (숫자와 특수기호 조합)
|
|
70
|
+
// 최소한 "0000-00-00" 또는 "00/00/00" 형태는 갖춰야 함
|
|
71
|
+
var datePattern = /^\d{4}[./-]\d{1,2}[./-]\d{1,2}/;
|
|
72
|
+
if (!datePattern.test(value))
|
|
73
|
+
return false;
|
|
74
|
+
// 2. Date 객체 생성을 시도 (UTC 처리를 위해 공백을 T로 치환 고려)
|
|
75
|
+
var d = new Date(value.replace(' ', 'T'));
|
|
76
|
+
// 3. 존재하지 않는 날짜(예: 13월, 32일)라면 getTime()이 NaN을 반환함
|
|
77
|
+
return !isNaN(d.getTime());
|
|
78
|
+
};
|
|
79
|
+
exports.isValidDate = isValidDate;
|
|
80
|
+
// NOTE: 서버에서 'releasedDate' 필드가 'YYYY-00-00' 형식으로 옴, 연도만 추출하는 함수 추가
|
|
81
|
+
function formatReleasedDateToYear(dateStr) {
|
|
82
|
+
if (!dateStr) {
|
|
83
|
+
return dateStr;
|
|
84
|
+
}
|
|
85
|
+
var yearRegex = /^(\d{4})-\d{2}-\d{2}$/;
|
|
86
|
+
var match = yearRegex.exec(dateStr);
|
|
87
|
+
if (match) {
|
|
88
|
+
return match[1];
|
|
89
|
+
}
|
|
90
|
+
return dateStr;
|
|
91
|
+
}
|
|
92
|
+
exports.formatReleasedDateToYear = formatReleasedDateToYear;
|
|
@@ -21,17 +21,31 @@ var AVAILABLE_SPECS = [
|
|
|
21
21
|
function parseStylePropBorder(namedProps, device) {
|
|
22
22
|
var specs = namedProps.specs;
|
|
23
23
|
return AVAILABLE_SPECS.reduce(function (acc, cur) {
|
|
24
|
-
var _a, _b, _c;
|
|
24
|
+
var _a, _b, _c, _d;
|
|
25
25
|
var baseKey = device === 'DESKTOP' ? cur : "".concat(cur, ":MOBILE");
|
|
26
26
|
var cssPropertyKey = getParsedKey(baseKey);
|
|
27
27
|
var value = specs[baseKey];
|
|
28
28
|
var hoverValue = specs["".concat(baseKey, ":HOVER")];
|
|
29
29
|
var isRadius = cssPropertyKey === 'borderRadius';
|
|
30
30
|
if (value === null || value === undefined) {
|
|
31
|
+
if (device === 'MOBILE') {
|
|
32
|
+
var desktopValue = specs[cur];
|
|
33
|
+
if (isRadius) {
|
|
34
|
+
var _e = desktopValue, tl = _e.tl, tr = _e.tr, bl = _e.bl, br = _e.br;
|
|
35
|
+
return {
|
|
36
|
+
style: __assign(__assign({}, acc.style), { borderTopLeftRadius: tl, borderTopRightRadius: tr, borderBottomLeftRadius: bl, borderBottomRightRadius: br }),
|
|
37
|
+
hoverStyle: __assign({}, acc.hoverStyle)
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
style: __assign(__assign({}, acc.style), (_a = {}, _a[cssPropertyKey] = desktopValue, _a)),
|
|
42
|
+
hoverStyle: __assign({}, acc.hoverStyle)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
31
45
|
return acc;
|
|
32
46
|
}
|
|
33
47
|
if (isRadius) {
|
|
34
|
-
var
|
|
48
|
+
var _f = value, tl = _f.tl, tr = _f.tr, bl = _f.bl, br = _f.br;
|
|
35
49
|
var hoverValueTypeExpanded = hoverValue;
|
|
36
50
|
if (hoverValueTypeExpanded === null || hoverValueTypeExpanded === undefined) {
|
|
37
51
|
return {
|
|
@@ -46,13 +60,13 @@ function parseStylePropBorder(namedProps, device) {
|
|
|
46
60
|
}
|
|
47
61
|
if (hoverValue === null || hoverValue === undefined) {
|
|
48
62
|
return {
|
|
49
|
-
style: __assign(__assign({}, acc.style), (
|
|
63
|
+
style: __assign(__assign({}, acc.style), (_b = {}, _b[cssPropertyKey] = value, _b)),
|
|
50
64
|
hoverStyle: __assign({}, acc.hoverStyle)
|
|
51
65
|
};
|
|
52
66
|
}
|
|
53
67
|
return {
|
|
54
|
-
style: __assign(__assign({}, acc.style), (
|
|
55
|
-
hoverStyle: __assign(__assign({}, acc.hoverStyle), (
|
|
68
|
+
style: __assign(__assign({}, acc.style), (_c = {}, _c[cssPropertyKey] = value, _c)),
|
|
69
|
+
hoverStyle: __assign(__assign({}, acc.hoverStyle), (_d = {}, _d[cssPropertyKey] = hoverValue, _d))
|
|
56
70
|
};
|
|
57
71
|
}, {
|
|
58
72
|
style: {},
|
package/package.json
CHANGED