pds-dev-kit-web 2.2.310 → 2.2.312

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.
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import type IconType from '../IconType';
3
+ declare const SocialLine: ({ color, size, ...rest }: IconType) => JSX.Element;
4
+ export default SocialLine;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ var jsx_runtime_1 = require("react/jsx-runtime");
26
+ var SocialLine = function (_a) {
27
+ var color = _a.color, size = _a.size, rest = __rest(_a, ["color", "size"]);
28
+ return ((0, jsx_runtime_1.jsx)("svg", __assign({ width: size, height: size, viewBox: "0 0 24 24", fill: "none" }, rest, { children: (0, jsx_runtime_1.jsx)("path", { fill: color, d: "M19.914 9.003a6.741 6.741 0 0 1-.764 2.2c-.179.324-1.056 1.558-1.325 1.884-1.478 1.788-3.953 3.851-8.092 5.857a.545.545 0 0 1-.78-.552l.21-1.885a.545.545 0 0 0-.483-.604C3.781 15.388 0 12.04 0 7.986 0 3.576 4.476 0 9.997 0c5.366 0 9.744 3.377 9.987 7.615.007.123.026.516.01.78-.011.16-.034.365-.08.608zm-15.414.6V6.24a.512.512 0 1 0-1.023 0v3.877c0 .284.23.514.512.514h2.045a.512.512 0 0 0 0-1.027H4.5zm3.154 1.028a.4.4 0 0 0 .4-.401V6.128a.4.4 0 0 0-.4-.402h-.223a.4.4 0 0 0-.4.402v4.102a.4.4 0 0 0 .4.4h.223zm4.133-4.391v2.369s-2.042-2.676-2.074-2.71a.508.508 0 0 0-.4-.172.527.527 0 0 0-.492.534v3.856a.512.512 0 1 0 1.023 0V7.763s2.073 2.698 2.104 2.727c.09.086.211.14.346.14.284.003.516-.249.516-.534V6.24a.512.512 0 1 0-1.023 0zm4.858 0a.512.512 0 0 0-.512-.514h-2.045a.512.512 0 0 0-.511.514v3.877c0 .284.229.514.511.514h2.045a.512.512 0 0 0 0-1.027H14.6v-.912h1.534a.512.512 0 0 0 0-1.027H14.6v-.912h1.534c.283 0 .512-.23.512-.513z" }) })));
29
+ };
30
+ exports.default = SocialLine;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import type IconType from '../IconType';
3
+ declare const SocialMeta: ({ color, size, ...rest }: IconType) => JSX.Element;
4
+ export default SocialMeta;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ var jsx_runtime_1 = require("react/jsx-runtime");
26
+ var SocialMeta = function (_a) {
27
+ var color = _a.color, size = _a.size, rest = __rest(_a, ["color", "size"]);
28
+ return ((0, jsx_runtime_1.jsx)("svg", __assign({ width: size, height: size, viewBox: "0 0 24 24", fill: "none" }, rest, { children: (0, jsx_runtime_1.jsx)("path", { fill: color, d: "M14 13.5h2.5l1-4H14v-2c0-1.03 0-2 2-2h1.5V1.14c-.328-.047-1.46-.14-2.774-.14-2.766 0-4.726 1.677-4.726 4.86v3.14H8v4h2.274V22h3.726v-8.5z" }) })));
29
+ };
30
+ exports.default = SocialMeta;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import type IconType from '../IconType';
3
+ declare const SocialX: ({ color, size, ...rest }: IconType) => JSX.Element;
4
+ export default SocialX;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ var jsx_runtime_1 = require("react/jsx-runtime");
26
+ var SocialX = function (_a) {
27
+ var color = _a.color, size = _a.size, rest = __rest(_a, ["color", "size"]);
28
+ return ((0, jsx_runtime_1.jsx)("svg", __assign({ width: size, height: size, viewBox: "0 0 24 24", fill: "none" }, rest, { children: (0, jsx_runtime_1.jsx)("path", { fill: color, d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" }) })));
29
+ };
30
+ exports.default = SocialX;
@@ -234,6 +234,9 @@ declare const lineIcons: {
234
234
  readonly ic_site: ({ color, size, ...rest }: import("../IconType").default) => JSX.Element;
235
235
  readonly ic_slideBanner: ({ color, ...rest }: import("../IconType").default) => JSX.Element;
236
236
  readonly ic_slider: ({ color, size, ...rest }: import("../IconType").default) => JSX.Element;
237
+ readonly ic_social_line: ({ color, size, ...rest }: import("../IconType").default) => JSX.Element;
238
+ readonly ic_social_meta: ({ color, size, ...rest }: import("../IconType").default) => JSX.Element;
239
+ readonly ic_social_x: ({ color, size, ...rest }: import("../IconType").default) => JSX.Element;
237
240
  readonly ic_sort: ({ color, size, ...rest }: import("../IconType").default) => JSX.Element;
238
241
  readonly ic_speaker_off: ({ color, size, ...rest }: import("../IconType").default) => JSX.Element;
239
242
  readonly ic_speaker_wave_1: ({ color, size, ...rest }: import("../IconType").default) => JSX.Element;
@@ -271,6 +271,9 @@ var Shoppingbag_1 = __importDefault(require("./Shoppingbag"));
271
271
  var Site_1 = __importDefault(require("./Site"));
272
272
  var SlideBanner_1 = __importDefault(require("./SlideBanner"));
273
273
  var Slider_1 = __importDefault(require("./Slider"));
274
+ var SocialLine_1 = __importDefault(require("./SocialLine"));
275
+ var SocialMeta_1 = __importDefault(require("./SocialMeta"));
276
+ var SocialX_1 = __importDefault(require("./SocialX"));
274
277
  var Sort_1 = __importDefault(require("./Sort"));
275
278
  var SpeakerOff_1 = __importDefault(require("./SpeakerOff"));
276
279
  var SpeakerWave1_1 = __importDefault(require("./SpeakerWave1"));
@@ -577,6 +580,9 @@ var lineIcons = {
577
580
  ic_site: Site_1.default,
578
581
  ic_slideBanner: SlideBanner_1.default,
579
582
  ic_slider: Slider_1.default,
583
+ ic_social_line: SocialLine_1.default,
584
+ ic_social_meta: SocialMeta_1.default,
585
+ ic_social_x: SocialX_1.default,
580
586
  ic_sort: Sort_1.default,
581
587
  ic_speaker_off: SpeakerOff_1.default,
582
588
  ic_speaker_wave_1: SpeakerWave1_1.default,
@@ -173,9 +173,77 @@ function Button(props) {
173
173
  var _o = extractBorderStyles(propsStyle), borderNormalStyle = _o.borderStyleProps, cleanedNormalStyle = _o.remainingStyle;
174
174
  // hover 스타일 분리
175
175
  var _p = extractBorderStyles(propsHoverStyle), borderHoverStyle = _p.borderStyleProps, cleanedHoverStyle = _p.remainingStyle;
176
+ /**
177
+ * 텍스트가 Rich Text(HTML)인지 Plain Text인지 판별합니다.
178
+ * @param {string} text - 확인할 문자열
179
+ * @returns {boolean} - HTML 태그가 포함되어 있으면 true
180
+ */
181
+ var isRichText = function (text) {
182
+ if (typeof text !== 'string')
183
+ return false;
184
+ // HTML 태그를 찾는 정규 표현식
185
+ var htmlRegex = /<[a-z][\s\S]*>/i;
186
+ return htmlRegex.test(text);
187
+ };
188
+ function domstringToPlain(domstring, ellipsis, useEnter) {
189
+ var tempDivElement = document.createElement('div');
190
+ tempDivElement.innerHTML = domstring;
191
+ // 1. 제거하고 싶은 '비-텍스트' 태그들을 정의하고 모두 삭제합니다.
192
+ var tagsToRemove = ['iframe', 'img', 'video', 'audio', 'script', 'style', 'canvas', 'svg'];
193
+ tagsToRemove.forEach(function (tagName) {
194
+ var elements = tempDivElement.querySelectorAll(tagName);
195
+ elements.forEach(function (el) { return el.remove(); });
196
+ });
197
+ // 2. 텍스트 추출 (위에서 태그를 지웠으므로 순수 텍스트만 남음)
198
+ var plainText = tempDivElement.textContent || tempDivElement.innerText || '';
199
+ // 3. 공백 처리
200
+ var processedText = plainText.replace(/\s{2,}/gi, ' ');
201
+ // 4. 말줄임표 처리
202
+ if (ellipsis && processedText.length > ellipsis) {
203
+ return "".concat(processedText.slice(0, ellipsis), "...");
204
+ }
205
+ // 5. 줄바꿈 처리 로직
206
+ if (useEnter) {
207
+ // innerHTML에서 br과 p 태그를 변환하기 전에,
208
+ // 이미 1번 단계에서 이미지/이프레임 등이 제거된 상태의 innerHTML을 사용합니다.
209
+ processedText = tempDivElement.innerHTML
210
+ .replace(/<br\s*\/?>/gi, '\n')
211
+ .replace(/<\/p>/gi, '\n')
212
+ .replace(/&gt;/gi, '>')
213
+ .replace(/&lt;/gi, '<')
214
+ .replace(/&amp;/gi, '&')
215
+ .replace(/<p[^>]*>/gi, '')
216
+ .replace(/<\/?[^>]+(>|$)/g, ''); // 남은 모든 HTML 태그 제거 (정규식 추가)
217
+ }
218
+ else {
219
+ // 줄바꿈을 공백으로 치환하거나 <br>로 치환 (상황에 따라 선택)
220
+ processedText = processedText.replace(/\n/gi, ' ').trim();
221
+ }
222
+ return processedText;
223
+ }
224
+ var getTruncatedText = function (text) {
225
+ var _a;
226
+ if (!text || typeof text !== 'string') {
227
+ return text;
228
+ }
229
+ // const maxLength = props.CB_STYLE_PROP_TEXT.CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS;
230
+ var maxLength = device === 'MOBILE'
231
+ ? (_a = props.CB_STYLE_PROP_TEXT['CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS:MOBILE']) !== null && _a !== void 0 ? _a : props.CB_STYLE_PROP_TEXT.CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS
232
+ : props.CB_STYLE_PROP_TEXT.CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS;
233
+ if (isRichText(text)) {
234
+ return domstringToPlain(text, maxLength, true);
235
+ }
236
+ if (!maxLength) {
237
+ return text;
238
+ }
239
+ if (text.length > maxLength) {
240
+ return "".concat(text.slice(0, maxLength), "...");
241
+ }
242
+ return text;
243
+ };
176
244
  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, style: { paddingLeft: paddingLeft, paddingRight: paddingRight, paddingBottom: paddingBottom, paddingTop: paddingTop } }, { children: (0, jsx_runtime_1.jsx)(S_ShadowBox, __assign({ "$normalStyle": __assign(__assign(__assign({ height: '100%', display: 'flex', alignItems: "".concat(btnTextStyle.alignItems), overflowY: 'hidden', scrollbarWidth: btnTextStyle.scrollbarWidth }, effectCssProperties), normalShadowStyle), borderNormalStyle), "$hoverStyle": __assign(__assign({}, hoverShadowStyle), borderHoverStyle) }, { children: (0, jsx_runtime_1.jsxs)(S_CB_Box_1.S_CB_Box, __assign({ onMouseLeave: function (e) {
177
245
  e.currentTarget.classList.remove('hovered');
178
- }, className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, btnTextStyle), cleanedNormalStyle), layoutStyle), btnColorStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word', cursor: CLINKCursor, overflowY: 'unset', scrollbarWidth: 'unset' }), hoverStyle: __assign(__assign(__assign(__assign({}, btnTextHoverStyle), cleanedHoverStyle), btnColorHoverStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word' }), onClick: onClickCLINK }, { children: [textPrefix, textValue(), textSuffix] })) })) }))] }));
246
+ }, className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, btnTextStyle), cleanedNormalStyle), layoutStyle), btnColorStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word', cursor: CLINKCursor, overflowY: 'unset', scrollbarWidth: 'unset' }), hoverStyle: __assign(__assign(__assign(__assign({}, btnTextHoverStyle), cleanedHoverStyle), btnColorHoverStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word' }), onClick: onClickCLINK }, { children: [textPrefix, textValue() === 'ERROR' ? 'EDITOR:FALLBACK_TEXT' : getTruncatedText(textValue()), textSuffix] })) })) }))] }));
179
247
  }
180
248
  function extractBorderStyles(style) {
181
249
  var
@@ -158,10 +158,13 @@ function Text(props) {
158
158
  return props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT;
159
159
  };
160
160
  var getTruncatedText = function (text) {
161
+ var _a;
161
162
  if (!text || typeof text !== 'string') {
162
163
  return text;
163
164
  }
164
- var maxLength = props.CB_STYLE_PROP_TEXT.CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS;
165
+ var maxLength = device === 'MOBILE'
166
+ ? (_a = props.CB_STYLE_PROP_TEXT['CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS:MOBILE']) !== null && _a !== void 0 ? _a : props.CB_STYLE_PROP_TEXT.CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS
167
+ : props.CB_STYLE_PROP_TEXT.CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS;
165
168
  if (isRichText(text)) {
166
169
  return domstringToPlain(text, maxLength, true);
167
170
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web",
3
- "version": "2.2.310",
3
+ "version": "2.2.312",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
package/release-note.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # PDS-DEV-KIT-WEB Release Notes
2
- ## [v2.2.310]
2
+ ## [v2.2.312]
3
3
  ## daily|https://design.storybook.publ.biz/
4
4
 
5
5
  ### 업데이트 사항
6
- * [PDS-1422] ChatBubbleListItem UI 개선
6
+ * [PDS-1424] 텍스트CB에서 모바일 ellipsis가 동작하지 않는 현상