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

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.
@@ -109,6 +109,7 @@
109
109
  "str_grid_height_variable": "Variable",
110
110
  "str_10476": "Loading data information.",
111
111
  "str_10477": "Data value not linked",
112
- "str_10478": "No data values to link."
112
+ "str_10478": "No data values to link.",
113
+ "str_paid": "Paid"
113
114
  }
114
115
  }
@@ -109,6 +109,7 @@
109
109
  "str_grid_height_variable": "Variable",
110
110
  "str_10476": "Loading data information.",
111
111
  "str_10477": "Data value not linked",
112
- "str_10478": "No data values to link."
112
+ "str_10478": "No data values to link.",
113
+ "str_paid": "Paid"
113
114
  }
114
115
  }
@@ -102,6 +102,7 @@
102
102
  "str_grid_height_variable": "Variable",
103
103
  "str_10476": "Loading data information.",
104
104
  "str_10477": "Data value not linked",
105
- "str_10478": "No data values to link."
105
+ "str_10478": "No data values to link.",
106
+ "str_paid": "Paid"
106
107
  }
107
108
  }
@@ -112,6 +112,7 @@ declare const locale: {
112
112
  str_10476: string;
113
113
  str_10477: string;
114
114
  str_10478: string;
115
+ str_paid: string;
115
116
  };
116
117
  };
117
118
  readonly en: {
@@ -226,6 +227,7 @@ declare const locale: {
226
227
  str_10476: string;
227
228
  str_10477: string;
228
229
  str_10478: string;
230
+ str_paid: string;
229
231
  };
230
232
  };
231
233
  readonly ja: {
@@ -340,6 +342,7 @@ declare const locale: {
340
342
  str_10476: string;
341
343
  str_10477: string;
342
344
  str_10478: string;
345
+ str_paid: string;
343
346
  };
344
347
  };
345
348
  readonly es: {
@@ -454,6 +457,7 @@ declare const locale: {
454
457
  str_10476: string;
455
458
  str_10477: string;
456
459
  str_10478: string;
460
+ str_paid: string;
457
461
  };
458
462
  };
459
463
  readonly 'zh-cn': {
@@ -568,6 +572,7 @@ declare const locale: {
568
572
  str_10476: string;
569
573
  str_10477: string;
570
574
  str_10478: string;
575
+ str_paid: string;
571
576
  };
572
577
  };
573
578
  readonly 'zh-tw': {
@@ -682,6 +687,7 @@ declare const locale: {
682
687
  str_10476: string;
683
688
  str_10477: string;
684
689
  str_10478: string;
690
+ str_paid: string;
685
691
  };
686
692
  };
687
693
  readonly fil: {
@@ -789,6 +795,7 @@ declare const locale: {
789
795
  str_10476: string;
790
796
  str_10477: string;
791
797
  str_10478: string;
798
+ str_paid: string;
792
799
  };
793
800
  };
794
801
  };
@@ -109,6 +109,7 @@
109
109
  "str_grid_height_variable": "Variable",
110
110
  "str_10476": "Loading data information.",
111
111
  "str_10477": "Data value not linked",
112
- "str_10478": "No data values to link."
112
+ "str_10478": "No data values to link.",
113
+ "str_paid": "Paid"
113
114
  }
114
115
  }
@@ -110,6 +110,7 @@
110
110
  "str_grid_height_variable": "가변",
111
111
  "str_10476": "데이터 정보를 불러오는 중입니다.",
112
112
  "str_10477": "데이터 값 연결되지 않음",
113
- "str_10478": "연결할 데이터 값이 없습니다."
113
+ "str_10478": "연결할 데이터 값이 없습니다.",
114
+ "str_paid": "유료"
114
115
  }
115
116
  }
@@ -109,6 +109,7 @@
109
109
  "str_grid_height_variable": "Variable",
110
110
  "str_10476": "Loading data information.",
111
111
  "str_10477": "Data value not linked",
112
- "str_10478": "No data values to link."
112
+ "str_10478": "No data values to link.",
113
+ "str_paid": "Paid"
113
114
  }
114
115
  }
@@ -109,6 +109,7 @@
109
109
  "str_grid_height_variable": "Variable",
110
110
  "str_10476": "Loading data information.",
111
111
  "str_10477": "Data value not linked",
112
- "str_10478": "No data values to link."
112
+ "str_10478": "No data values to link.",
113
+ "str_paid": "Paid"
113
114
  }
114
115
  }
@@ -92,6 +92,9 @@ function Text(props) {
92
92
  var isDataConnected = CB_CONTENT_PROP_TEXT_SPEC_VALUETYPE === 'DATA' ||
93
93
  CB_CONTENT_PROP_TEXT_SPEC_VALUETYPE === 'DELEGATEDDATA';
94
94
  if (isDataConnected) {
95
+ if (CB_CONTENT_PROP_TEXT_SPEC_CONNECTDATA === 'paid') {
96
+ return t('str_paid');
97
+ }
95
98
  if (queryContext === null || queryContext === void 0 ? void 0 : queryContext.queryData) {
96
99
  var value = queryContext.queryData[CB_CONTENT_PROP_TEXT_SPEC_CONNECTDATA];
97
100
  if (formatOption) {
@@ -207,26 +210,36 @@ var isRichText = function (text) {
207
210
  function domstringToPlain(domstring, ellipsis, useEnter) {
208
211
  var tempDivElement = document.createElement('div');
209
212
  tempDivElement.innerHTML = domstring;
210
- var plainText = tempDivElement.textContent || tempDivElement.innerText;
211
- // NOTE: 두개 이상의 공백을 ' ' 변경합니다.
213
+ // 1. 제거하고 싶은 '비-텍스트' 태그들을 정의하고 모두 삭제합니다.
214
+ var tagsToRemove = ['iframe', 'img', 'video', 'audio', 'script', 'style', 'canvas', 'svg'];
215
+ tagsToRemove.forEach(function (tagName) {
216
+ var elements = tempDivElement.querySelectorAll(tagName);
217
+ elements.forEach(function (el) { return el.remove(); });
218
+ });
219
+ // 2. 텍스트 추출 (위에서 태그를 지웠으므로 순수 텍스트만 남음)
220
+ var plainText = tempDivElement.textContent || tempDivElement.innerText || '';
221
+ // 3. 공백 처리
212
222
  var processedText = plainText.replace(/\s{2,}/gi, ' ');
213
- if (ellipsis) {
214
- return processedText.length > ellipsis
215
- ? "".concat(processedText.slice(0, ellipsis), "...")
216
- : processedText;
223
+ // 4. 말줄임표 처리
224
+ if (ellipsis && processedText.length > ellipsis) {
225
+ return "".concat(processedText.slice(0, ellipsis), "...");
217
226
  }
218
- // NOTE: \n을 ' '으로 변경할지 여부를 확인합니다.
227
+ // 5. 줄바꿈 처리 로직
219
228
  if (useEnter) {
229
+ // innerHTML에서 br과 p 태그를 변환하기 전에,
230
+ // 이미 1번 단계에서 이미지/이프레임 등이 제거된 상태의 innerHTML을 사용합니다.
220
231
  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> 태그 제거
232
+ .replace(/<br\s*\/?>/gi, '\n')
233
+ .replace(/<\/p>/gi, '\n')
234
+ .replace(/&gt;/gi, '>')
235
+ .replace(/&lt;/gi, '<')
236
+ .replace(/&amp;/gi, '&')
237
+ .replace(/<p[^>]*>/gi, '')
238
+ .replace(/<\/?[^>]+(>|$)/g, ''); // 남은 모든 HTML 태그 제거 (정규식 추가)
227
239
  }
228
240
  else {
229
- processedText = processedText.replace(/\n/gi, '<br>');
241
+ // 줄바꿈을 공백으로 치환하거나 <br>로 치환 (상황에 따라 선택)
242
+ processedText = processedText.replace(/\n/gi, ' ').trim();
230
243
  }
231
244
  return processedText;
232
245
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.7.507",
3
+ "version": "2.7.509",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",