pds-dev-kit-web-test 2.7.506 → 2.7.508

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.
@@ -69,7 +69,6 @@ var createComponent = function (type, getDesignType, getLocation, designType) {
69
69
  function ContentsCarousel(props) {
70
70
  var _a, _b;
71
71
  var _c = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _c.device, mode = _c.mode, queryData = _c.queryData;
72
- console.log(queryData);
73
72
  var compositions = props.compositions, index = props.index, _d = props.CB_CONTENT_PROP_CONTENTSCAROUSEL, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DISPLAYCOUNTS = _d.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DISPLAYCOUNTS, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_ITEMCOUNTS = _d.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_ITEMCOUNTS, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MDISPLAYCOUNTS = _d.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MDISPLAYCOUNTS, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_VALUETYPE = _d.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_VALUETYPE, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_CONNECTDATA = _d.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_CONNECTDATA, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DATASORTING = _d.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DATASORTING, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DATAOFFSET = _d.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_DATAOFFSET, CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MANUALITEMS = _d.CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_MANUALITEMS, CB_STYLE_PROP_CONTENTSCAROUSELDESIGN = props.CB_STYLE_PROP_CONTENTSCAROUSELDESIGN, CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD = props.CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD, CB_STYLE_PROP_CONTENTSCAROUSELBUTTON = props.CB_STYLE_PROP_CONTENTSCAROUSELBUTTON, CB_STYLE_PROP_CONTENTSCAROUSELPROGRESSBAR = props.CB_STYLE_PROP_CONTENTSCAROUSELPROGRESSBAR, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM, CB_STYLE_PROP_BGMEDIA = props.CB_STYLE_PROP_BGMEDIA, CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE = props.CB_EFFECT_PROP_CONTENTSCAROUSEL.CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE;
74
73
  var CB_STYLE_PROP_CONTENTSCAROUSEL = __assign(__assign(__assign(__assign({}, CB_STYLE_PROP_CONTENTSCAROUSELDESIGN), CB_STYLE_PROP_CONTENTSCAROUSELPLAYBACKMETHOD), CB_STYLE_PROP_CONTENTSCAROUSELBUTTON), CB_STYLE_PROP_CONTENTSCAROUSELPROGRESSBAR);
75
74
  var autoPlayEnabled = device === 'DESKTOP'
@@ -131,6 +131,9 @@ function Text(props) {
131
131
  };
132
132
  var getTruncatedText = function (text) {
133
133
  var maxLength = props.CB_STYLE_PROP_TEXT.CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS;
134
+ if (isRichText(text)) {
135
+ return domstringToPlain(text, maxLength, true);
136
+ }
134
137
  if (!maxLength) {
135
138
  return text;
136
139
  }
@@ -189,3 +192,51 @@ function getTextOptionStyles(props, device) {
189
192
  });
190
193
  }
191
194
  exports.getTextOptionStyles = getTextOptionStyles;
195
+ /**
196
+ * 텍스트가 Rich Text(HTML)인지 Plain Text인지 판별합니다.
197
+ * @param {string} text - 확인할 문자열
198
+ * @returns {boolean} - HTML 태그가 포함되어 있으면 true
199
+ */
200
+ var isRichText = function (text) {
201
+ if (typeof text !== 'string')
202
+ return false;
203
+ // HTML 태그를 찾는 정규 표현식
204
+ var htmlRegex = /<[a-z][\s\S]*>/i;
205
+ return htmlRegex.test(text);
206
+ };
207
+ function domstringToPlain(domstring, ellipsis, useEnter) {
208
+ var tempDivElement = document.createElement('div');
209
+ tempDivElement.innerHTML = domstring;
210
+ // 1. 제거하고 싶은 '비-텍스트' 태그들을 정의하고 모두 삭제합니다.
211
+ var tagsToRemove = ['iframe', 'img', 'video', 'audio', 'script', 'style', 'canvas', 'svg'];
212
+ tagsToRemove.forEach(function (tagName) {
213
+ var elements = tempDivElement.querySelectorAll(tagName);
214
+ elements.forEach(function (el) { return el.remove(); });
215
+ });
216
+ // 2. 텍스트 추출 (위에서 태그를 지웠으므로 순수 텍스트만 남음)
217
+ var plainText = tempDivElement.textContent || tempDivElement.innerText || '';
218
+ // 3. 공백 처리
219
+ var processedText = plainText.replace(/\s{2,}/gi, ' ');
220
+ // 4. 말줄임표 처리
221
+ if (ellipsis && processedText.length > ellipsis) {
222
+ return "".concat(processedText.slice(0, ellipsis), "...");
223
+ }
224
+ // 5. 줄바꿈 처리 로직
225
+ if (useEnter) {
226
+ // innerHTML에서 br과 p 태그를 변환하기 전에,
227
+ // 이미 1번 단계에서 이미지/이프레임 등이 제거된 상태의 innerHTML을 사용합니다.
228
+ processedText = tempDivElement.innerHTML
229
+ .replace(/<br\s*\/?>/gi, '\n')
230
+ .replace(/<\/p>/gi, '\n')
231
+ .replace(/&gt;/gi, '>')
232
+ .replace(/&lt;/gi, '<')
233
+ .replace(/&amp;/gi, '&')
234
+ .replace(/<p[^>]*>/gi, '')
235
+ .replace(/<\/?[^>]+(>|$)/g, ''); // 남은 모든 HTML 태그 제거 (정규식 추가)
236
+ }
237
+ else {
238
+ // 줄바꿈을 공백으로 치환하거나 <br>로 치환 (상황에 따라 선택)
239
+ processedText = processedText.replace(/\n/gi, ' ').trim();
240
+ }
241
+ return processedText;
242
+ }
@@ -208,7 +208,6 @@ var FlexGridCustomSection = (0, react_1.forwardRef)(function CustomSection(props
208
208
  });
209
209
  };
210
210
  var i18n = (0, react_i18next_1.useTranslation)('translation').i18n;
211
- console.log('FLEX GRID CUSTION SECTION..');
212
211
  return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(gleStyles_1.S_gleStyles, __assign({ strKeys: { str_grid_height_variable: i18n.t('str_grid_height_variable') } }, { children: (0, jsx_runtime_1.jsx)(S_SectionWrapper, __assign({ ref: gleRef, "x-dlayout-section-type": "NO_NAME", onClick: onClickSection }, { children: (0, jsx_runtime_1.jsx)(components_1.CustomSection, __assign({}, props, { isMobile: isMobile, overrideStyles: {
213
212
  minHeight: customSectionStyles.minHeight,
214
213
  paddingTop: padding.top,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.7.506",
3
+ "version": "2.7.508",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",