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

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,41 @@ 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
+ var plainText = tempDivElement.textContent || tempDivElement.innerText;
211
+ // NOTE: 두개 이상의 공백을 ' '로 변경합니다.
212
+ var processedText = plainText.replace(/\s{2,}/gi, ' ');
213
+ if (ellipsis) {
214
+ return processedText.length > ellipsis
215
+ ? "".concat(processedText.slice(0, ellipsis), "...")
216
+ : processedText;
217
+ }
218
+ // NOTE: \n을 ' '으로 변경할지 여부를 확인합니다.
219
+ if (useEnter) {
220
+ processedText = tempDivElement.innerHTML
221
+ .replace(/<br\s*\/?>/gi, '\n') // <br> 태그를 \n으로 변환
222
+ .replace(/<\/p>/gi, '\n') // <p> 종료 태그를 \n으로 변환
223
+ .replace(/&gt;/gi, '>') // &gt;를 > 으로 변환
224
+ .replace(/&lt;/gi, '<') // &lt;를 <으로 변환
225
+ .replace(/&amp;/gi, '&') // &amp;를 &으로 변환
226
+ .replace(/<p[^>]*>/gi, ''); // <p> 태그 제거
227
+ }
228
+ else {
229
+ processedText = processedText.replace(/\n/gi, '<br>');
230
+ }
231
+ return processedText;
232
+ }
@@ -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.507",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",