pds-dev-kit-web-test 2.2.96 → 2.2.98

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.
Files changed (58) hide show
  1. package/dist/src/common/assets/icons/fill/BellStyle.d.ts +4 -0
  2. package/dist/src/common/assets/icons/fill/BellStyle.js +30 -0
  3. package/dist/src/common/assets/icons/fill/Envelope.d.ts +4 -0
  4. package/dist/src/common/assets/icons/fill/Envelope.js +30 -0
  5. package/dist/src/common/assets/icons/fill/index.d.ts +2 -0
  6. package/dist/src/common/assets/icons/fill/index.js +4 -0
  7. package/dist/src/common/assets/icons/line/BellStyle.d.ts +4 -0
  8. package/dist/src/common/assets/icons/line/BellStyle.js +30 -0
  9. package/dist/src/common/assets/icons/line/Envelope.d.ts +4 -0
  10. package/dist/src/common/assets/icons/line/Envelope.js +30 -0
  11. package/dist/src/common/assets/icons/line/index.d.ts +2 -0
  12. package/dist/src/common/assets/icons/line/index.js +4 -0
  13. package/dist/src/common/styles/colorSet/UIColor.json +2 -1
  14. package/dist/src/common/styles/colorSet/index.d.ts +3 -2
  15. package/dist/src/common/styles/colorSet/index.js +2 -2
  16. package/dist/src/common/styles/colorSet/ui-type.d.ts +1 -0
  17. package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/ContentsContainer.d.ts +1 -1
  18. package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/ContentsContainer.js +2 -1
  19. package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/WSJ.d.ts +11 -0
  20. package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/WSJ.js +66 -0
  21. package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/index.d.ts +1 -0
  22. package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/index.js +3 -1
  23. package/dist/src/desktop/layout/LayoutWS/ContainersBox/ContainersBox.d.ts +1 -1
  24. package/dist/src/desktop/layout/LayoutWS/ContainersBox/ContainersBox.js +1 -1
  25. package/dist/src/sub/AdminList/ToolBar/SearchField.d.ts +2 -1
  26. package/dist/src/sub/AdminList/ToolBar/SearchField.js +4 -4
  27. package/dist/src/sub/AdminList/ToolBar/ToolBar.d.ts +9 -2
  28. package/dist/src/sub/AdminList/ToolBar/ToolBar.js +7 -6
  29. package/dist/src/sub/DynamicLayout/dynamicLayoutContext.d.ts +1 -3
  30. package/dist/src/sub/DynamicLayout/pagesPreviewMock.d.ts +373 -2149
  31. package/dist/src/sub/DynamicLayout/pagesPreviewMock.js +1671 -4326
  32. package/dist/src/sub/DynamicLayout/sectionActionTypes.d.ts +4 -0
  33. package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.d.ts +1 -0
  34. package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +68 -85
  35. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.d.ts +2 -2
  36. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.js +3 -3
  37. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +1 -6
  38. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.d.ts +1 -1
  39. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +42 -26
  40. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/index.d.ts +1 -0
  41. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/index.js +8 -0
  42. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_AnimationObserverBox.d.ts +0 -2
  43. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_AnimationObserverBox.js +5 -31
  44. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.d.ts +0 -3
  45. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/index.d.ts +1 -1
  46. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/index.js +3 -3
  47. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/index.d.ts +1 -1
  48. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/index.js +2 -2
  49. package/dist/src/sub/DynamicLayout/sections/CustomSection/customSectionContext.d.ts +10 -0
  50. package/dist/src/sub/DynamicLayout/sections/CustomSection/customSectionContext.js +21 -0
  51. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.js +7 -4
  52. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.d.ts +1 -3
  53. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.js +13 -25
  54. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +1 -2
  55. package/package.json +5 -2
  56. package/release-note.md +4 -3
  57. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/useMaxFontAdjustment.d.ts +0 -5
  58. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/useMaxFontAdjustment.js +0 -61
@@ -5,7 +5,7 @@ type Props = {
5
5
  cbProps: ComponentBlock;
6
6
  device: Device;
7
7
  index: number;
8
- rootBaseFontSize: number;
8
+ id: number;
9
9
  };
10
- export default function ComponentBlockMatcher({ cbProps, device, index, rootBaseFontSize }: Props): JSX.Element;
10
+ export default function ComponentBlockMatcher({ cbProps, device, index, id }: Props): JSX.Element;
11
11
  export {};
@@ -23,18 +23,18 @@ var Divider_1 = __importDefault(require("./componentBlocks/Divider/Divider"));
23
23
  var Embed_1 = __importDefault(require("./componentBlocks/Embed/Embed"));
24
24
  var Image_1 = __importDefault(require("./componentBlocks/Image/Image"));
25
25
  var RichText_1 = require("./componentBlocks/RichText");
26
- var Text_1 = __importDefault(require("./componentBlocks/Text/Text"));
26
+ var Text_1 = require("./componentBlocks/Text");
27
27
  var Twitter_1 = __importDefault(require("./componentBlocks/Twitter/Twitter"));
28
28
  var Youtube_1 = require("./componentBlocks/Youtube");
29
29
  function ComponentBlockMatcher(_a) {
30
- var cbProps = _a.cbProps, device = _a.device, index = _a.index, rootBaseFontSize = _a.rootBaseFontSize;
30
+ var cbProps = _a.cbProps, device = _a.device, index = _a.index, id = _a.id;
31
31
  var componentBlockCode = cbProps.componentBlockCode, data = cbProps.jsonProperties.data;
32
32
  var propsWithValue = device === 'MOBILE' ? (0, newUtils_1.replaceUndefinedValues)(data) : data;
33
33
  switch (componentBlockCode) {
34
34
  case types_1.CB_ALL_CODES.CB_BTN:
35
35
  return (0, jsx_runtime_1.jsx)(Button_1.default, __assign({}, propsWithValue, { index: index }));
36
36
  case types_1.CB_ALL_CODES.CB_TEXT:
37
- return ((0, jsx_runtime_1.jsx)(Text_1.default, __assign({}, propsWithValue, { index: index, rootBaseFontSize: rootBaseFontSize })));
37
+ return (0, jsx_runtime_1.jsx)(Text_1.Text, __assign({}, propsWithValue, { index: index, id: id }));
38
38
  case types_1.CB_ALL_CODES.CB_RICHTEXT:
39
39
  return (0, jsx_runtime_1.jsx)(RichText_1.RichText, __assign({}, propsWithValue, { index: index }));
40
40
  case types_1.CB_ALL_CODES.CB_DIVIDER:
@@ -85,12 +85,7 @@ function getBTNStyles(props, device) {
85
85
  'CB_STYLE_PROP_BTNTEXT_SPEC_HORIZONTAL',
86
86
  'CB_STYLE_PROP_BTNTEXT_SPEC_VERTICAL'
87
87
  ];
88
- return (0, newUtils_1.parseStyleTextToCSSProp)({
89
- availableSpecCodes: availableSpecCodes,
90
- props: props,
91
- device: device,
92
- propKey: 'BTNTEXT'
93
- });
88
+ return (0, newUtils_1.parseStyleTextToCSSProp)({ availableSpecCodes: availableSpecCodes, props: props, device: device, propKey: 'BTNTEXT' });
94
89
  }
95
90
  function getBTNColorStyles(props, device) {
96
91
  var availableSpecCodes = [
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { CB_TEXT_PROPERTIES_TYPE, IndexForIntersection } from '../../../../util/types';
3
3
  type Props = CB_TEXT_PROPERTIES_TYPE & IndexForIntersection & {
4
- rootBaseFontSize: number;
4
+ id: number;
5
5
  };
6
6
  declare function Text(props: Props): JSX.Element;
7
7
  export default Text;
@@ -1,8 +1,4 @@
1
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
2
  var __assign = (this && this.__assign) || function () {
7
3
  __assign = Object.assign || function(t) {
8
4
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -21,9 +17,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
21
17
  var jsx_runtime_1 = require("react/jsx-runtime");
22
18
  /* eslint-disable no-console */
23
19
  /* eslint-disable react/destructuring-assignment */
20
+ // eslint-disable-next-line import/no-extraneous-dependencies
21
+ var lodash_1 = require("lodash");
24
22
  var react_1 = require("react");
23
+ var react_measure_1 = __importDefault(require("react-measure"));
25
24
  var DynamicLayout_1 = require("../../../../../../../DynamicLayout");
26
- var styled_components_1 = __importDefault(require("styled-components"));
25
+ var customSectionContext_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/customSectionContext");
27
26
  var hooks_1 = require("../../../../hooks");
28
27
  var getGoogleFonts_1 = require("../../../../hooks/useGoogleFonts/getGoogleFonts");
29
28
  var useGoogleFonts_1 = __importDefault(require("../../../../hooks/useGoogleFonts/useGoogleFonts"));
@@ -33,10 +32,9 @@ var S_CB_AnimationObserverBox_1 = require("../components/S_CB_AnimationObserverB
33
32
  var S_CB_Box_1 = require("../components/S_CB_Box");
34
33
  var S_HiddenCover_1 = require("../components/S_HiddenCover");
35
34
  var useCLINK_1 = __importDefault(require("../hooks/useCLINK"));
36
- var useMaxFontAdjustment_1 = __importDefault(require("./useMaxFontAdjustment"));
37
35
  function Text(props) {
38
36
  var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
39
- var index = props.index, _b = props.CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_CLINK_SPEC_SRC = _b.CB_CONTENT_PROP_CLINK_SPEC_SRC, CB_CONTENT_PROP_CLINK_SPEC_TYPE = _b.CB_CONTENT_PROP_CLINK_SPEC_TYPE, CB_CONTENT_PROP_CLINK_SPEC_NEWTAB = _b.CB_CONTENT_PROP_CLINK_SPEC_NEWTAB, CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC = _b.CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM, rootBaseFontSize = props.rootBaseFontSize;
37
+ var index = props.index, _b = props.CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_CLINK_SPEC_SRC = _b.CB_CONTENT_PROP_CLINK_SPEC_SRC, CB_CONTENT_PROP_CLINK_SPEC_TYPE = _b.CB_CONTENT_PROP_CLINK_SPEC_TYPE, CB_CONTENT_PROP_CLINK_SPEC_NEWTAB = _b.CB_CONTENT_PROP_CLINK_SPEC_NEWTAB, CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC = _b.CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM;
40
38
  var _c = (0, useCLINK_1.default)({
41
39
  src: CB_CONTENT_PROP_CLINK_SPEC_SRC,
42
40
  type: CB_CONTENT_PROP_CLINK_SPEC_TYPE,
@@ -62,19 +60,43 @@ function Text(props) {
62
60
  : CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] === 'NONE';
63
61
  var hasEffect = !isNoneEffectType;
64
62
  var effectVisibleStyle = hasEffect ? { opacity: isVisible ? 1 : 0 } : {};
65
- var textBoxRef = (0, react_1.useRef)(null);
66
- var baseFontSize = (0, useMaxFontAdjustment_1.default)(textBoxRef, textStyle.fontSize, mode, device, rootBaseFontSize);
67
- 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: { fontSize: rootBaseFontSize < 16 ? "".concat(baseFontSize, "px") : "".concat(rootBaseFontSize, "px") } }, { children: (0, jsx_runtime_1.jsx)(S_CB_Box_1.S_CB_Box, __assign({ ref: textBoxRef, className: "cb-layout-box cb-text-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, textStyle), propsStyle), effectCssProperties), layoutStyle), { cursor: CLINKCursor, paddingTop: 0, paddingBottom: 0, paddingLeft: 0, paddingRight: 0 }), hoverStyle: __assign(__assign({}, textHoverStyle), propsHoverStyle), onClick: onClickCLINK }, { children: (0, jsx_runtime_1.jsx)(S_TextContent, __assign({ className: "cb-text-content", style: {
68
- whiteSpace: 'pre-wrap',
69
- wordBreak: 'break-word',
70
- height: 'fit-content',
71
- paddingTop: layoutStyle.paddingTop,
72
- paddingBottom: layoutStyle.paddingBottom,
73
- paddingLeft: layoutStyle.paddingLeft,
74
- paddingRight: layoutStyle.paddingRight
75
- } }, { children: props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT })) })) }))] }));
63
+ var _f = (0, customSectionContext_1.useCustomSectionContext)(), setLayouts = _f.setLayouts, rowHeight = _f.rowHeight, sectionActionHandler = _f.sectionActionHandler;
64
+ var debouncedSectionActionHandler = (0, react_1.useCallback)((0, lodash_1.debounce)(function (payload) {
65
+ console.log('called');
66
+ sectionActionHandler &&
67
+ sectionActionHandler({
68
+ type: '@CUSTOMSECTION/AUTO_RESIZED_TO_FIT_CONTENT',
69
+ payload: payload
70
+ });
71
+ }, 1000), [sectionActionHandler]);
72
+ var handleResize = function (contentRect) {
73
+ var breakpoint = device === 'DESKTOP' ? 'lg' : 'sm';
74
+ if (!contentRect.bounds) {
75
+ return;
76
+ }
77
+ var height = contentRect.bounds.height;
78
+ var id = props.id;
79
+ setLayouts(function (prev) {
80
+ var copy = JSON.parse(JSON.stringify(prev));
81
+ var targetIndex = copy[breakpoint].findIndex(function (each) { return each.i === id.toString(); });
82
+ var newH = Math.ceil((height + 10) / (10 + rowHeight));
83
+ copy[breakpoint][targetIndex].h = newH;
84
+ copy[breakpoint][targetIndex].minH = newH;
85
+ debouncedSectionActionHandler({
86
+ layout: copy[breakpoint],
87
+ cb: {
88
+ i: id,
89
+ h: newH
90
+ }
91
+ });
92
+ return copy;
93
+ });
94
+ };
95
+ 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.jsx)(react_measure_1.default, __assign({ bounds: true, onResize: handleResize }, { children: function (_a) {
96
+ var measureRef = _a.measureRef;
97
+ return ((0, jsx_runtime_1.jsx)("div", __assign({ ref: measureRef }, { children: (0, jsx_runtime_1.jsx)(S_CB_Box_1.S_CB_Box, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, textStyle), propsStyle), layoutStyle), effectCssProperties), { whiteSpace: 'pre-wrap', wordBreak: 'break-word', cursor: CLINKCursor }), hoverStyle: __assign(__assign(__assign({}, textHoverStyle), propsHoverStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word' }), onClick: onClickCLINK }, { children: props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT })) })));
98
+ } })) }))] }));
76
99
  }
77
- var S_TextContent = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n all: inherit;\n"], ["\n all: inherit;\n"])));
78
100
  function getTextStyles(props, device) {
79
101
  var availableSpecCodes = [
80
102
  'CB_STYLE_PROP_TEXT_SPEC_TYPEFACE',
@@ -86,12 +108,6 @@ function getTextStyles(props, device) {
86
108
  'CB_STYLE_PROP_TEXT_SPEC_HORIZONTAL',
87
109
  'CB_STYLE_PROP_TEXT_SPEC_VERTICAL'
88
110
  ];
89
- return (0, textUtil_1.parseStyleTextToCSSProp)({
90
- availableSpecCodes: availableSpecCodes,
91
- props: props,
92
- device: device,
93
- propKey: 'TEXT'
94
- });
111
+ return (0, textUtil_1.parseStyleTextToCSSProp)({ availableSpecCodes: availableSpecCodes, props: props, device: device, propKey: 'TEXT' });
95
112
  }
96
113
  exports.default = Text;
97
- var templateObject_1;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Text = void 0;
7
+ var Text_1 = require("./Text");
8
+ Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return __importDefault(Text_1).default; } });
@@ -1,8 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  type Props = {
3
3
  effectVisibleStyle: React.CSSProperties;
4
- normalStyle?: React.CSSProperties;
5
- hoverStyle?: React.CSSProperties;
6
4
  };
7
5
  export declare const S_CB_AnimationObserverBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Props, never>;
8
6
  export {};
@@ -14,40 +14,14 @@ var __assign = (this && this.__assign) || function () {
14
14
  };
15
15
  return __assign.apply(this, arguments);
16
16
  };
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- var desc = Object.getOwnPropertyDescriptor(m, k);
20
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
- desc = { enumerable: true, get: function() { return m[k]; } };
22
- }
23
- Object.defineProperty(o, k2, desc);
24
- }) : (function(o, m, k, k2) {
25
- if (k2 === undefined) k2 = k;
26
- o[k2] = m[k];
27
- }));
28
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
- Object.defineProperty(o, "default", { enumerable: true, value: v });
30
- }) : function(o, v) {
31
- o["default"] = v;
32
- });
33
- var __importStar = (this && this.__importStar) || function (mod) {
34
- if (mod && mod.__esModule) return mod;
35
- var result = {};
36
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
37
- __setModuleDefault(result, mod);
38
- return result;
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
39
19
  };
40
20
  Object.defineProperty(exports, "__esModule", { value: true });
41
21
  exports.S_CB_AnimationObserverBox = void 0;
42
- var styled_components_1 = __importStar(require("styled-components"));
43
- exports.S_CB_AnimationObserverBox = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 100%;\n width: 100%;\n\n ", ";\n\n ", ";\n\n &:hover {\n ", ";\n }\n"], ["\n height: 100%;\n width: 100%;\n\n ", ";\n\n ", ";\n\n &:hover {\n ", ";\n }\n"])), function (_a) {
22
+ var styled_components_1 = __importDefault(require("styled-components"));
23
+ exports.S_CB_AnimationObserverBox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n width: 100%;\n\n ", ";\n"], ["\n height: 100%;\n width: 100%;\n\n ", ";\n"])), function (_a) {
44
24
  var effectVisibleStyle = _a.effectVisibleStyle;
45
25
  return effectVisibleStyle && __assign({}, effectVisibleStyle);
46
- }, function (_a) {
47
- var normalStyle = _a.normalStyle;
48
- return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), __assign(__assign({}, normalStyle), { boxShadow: '' }));
49
- }, function (_a) {
50
- var hoverStyle = _a.hoverStyle;
51
- return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), __assign(__assign({}, hoverStyle), { boxShadow: '' }));
52
26
  });
53
- var templateObject_1, templateObject_2, templateObject_3;
27
+ var templateObject_1;
@@ -7,9 +7,6 @@ export type StylesProps = {
7
7
  export type CB_CONTENT_PROP_TEXT = {
8
8
  CB_CONTENT_PROP_TEXT_SPEC_TEXT: STRING_PLAIN;
9
9
  };
10
- export type CB_CONTENT_PROP_TEXTOPTION = {
11
- CB_CONTENT_PROP_TEXTOPTION_SPEC_FITCONTENT: boolean;
12
- };
13
10
  export type CB_CONTENT_PROP_CLINK = {
14
11
  CB_CONTENT_PROP_CLINK_SPEC_TYPE: 'INTERNAL' | 'EXTERNAL' | 'DISABLED';
15
12
  CB_CONTENT_PROP_CLINK_SPEC_SRC: STRING_PLAIN;
@@ -1 +1 @@
1
- export { default as ComponentBlock } from './ComponentBlock';
1
+ export { default as ComponentBlockMatcher } from './ComponentBlockMatcher';
@@ -3,6 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ComponentBlock = void 0;
7
- var ComponentBlock_1 = require("./ComponentBlock");
8
- Object.defineProperty(exports, "ComponentBlock", { enumerable: true, get: function () { return __importDefault(ComponentBlock_1).default; } });
6
+ exports.ComponentBlockMatcher = void 0;
7
+ var ComponentBlockMatcher_1 = require("./ComponentBlockMatcher");
8
+ Object.defineProperty(exports, "ComponentBlockMatcher", { enumerable: true, get: function () { return __importDefault(ComponentBlockMatcher_1).default; } });
@@ -1 +1 @@
1
- export { ComponentBlock } from './ComponentBlock';
1
+ export { ComponentBlockMatcher } from './ComponentBlock';
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ComponentBlock = void 0;
3
+ exports.ComponentBlockMatcher = void 0;
4
4
  var ComponentBlock_1 = require("./ComponentBlock");
5
- Object.defineProperty(exports, "ComponentBlock", { enumerable: true, get: function () { return ComponentBlock_1.ComponentBlock; } });
5
+ Object.defineProperty(exports, "ComponentBlockMatcher", { enumerable: true, get: function () { return ComponentBlock_1.ComponentBlockMatcher; } });
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { LayoutsType } from './CustomSection';
3
+ import type { TypeOfSectionAction } from '../../../DynamicLayout/sectionActionTypes';
4
+ export interface CustomSectionContext {
5
+ rowHeight: number;
6
+ setLayouts: React.Dispatch<React.SetStateAction<LayoutsType>>;
7
+ sectionActionHandler?: (action: TypeOfSectionAction) => void;
8
+ }
9
+ export declare const CustomSectionContext: React.Context<CustomSectionContext | undefined>;
10
+ export declare function useCustomSectionContext(): CustomSectionContext;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.useCustomSectionContext = exports.CustomSectionContext = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ exports.CustomSectionContext = react_1.default.createContext(undefined);
9
+ // export const CustomSectionContextProvider: React.FC = ({ children }) => {
10
+ // const [user, setUser] = React.useState<string>('');
11
+ // const value = { user, setUser };
12
+ // return <CustomSectionContext.Provider value={value}>{children}</CustomSectionContext.Provider>;
13
+ // };
14
+ function useCustomSectionContext() {
15
+ var context = react_1.default.useContext(exports.CustomSectionContext);
16
+ if (context === undefined) {
17
+ throw new Error('useCustomSectionContext must be used within an AppProvider');
18
+ }
19
+ return context;
20
+ }
21
+ exports.useCustomSectionContext = useCustomSectionContext;
@@ -66,14 +66,14 @@ function parseStyleTextToCSSProp(_a) {
66
66
  }
67
67
  if (cssPropertyKey === 'fontSize') {
68
68
  if (hoverValue === null || hoverValue === undefined) {
69
- var emValue_1 = getFontSize(device, value);
69
+ var emValue_1 = getEmFontSize(device, value);
70
70
  return {
71
71
  style: __assign(__assign({}, acc.style), (_k = {}, _k[cssPropertyKey] = emValue_1, _k)),
72
72
  hoverStyle: __assign({}, acc.hoverStyle)
73
73
  };
74
74
  }
75
- var emValue = getFontSize(device, value);
76
- var hoverEmValue = getFontSize(device, hoverValue);
75
+ var emValue = getEmFontSize(device, value);
76
+ var hoverEmValue = getEmFontSize(device, hoverValue);
77
77
  return {
78
78
  style: __assign(__assign({}, acc.style), (_l = {}, _l[cssPropertyKey] = emValue, _l)),
79
79
  hoverStyle: __assign(__assign({}, acc.hoverStyle), (_m = {}, _m[cssPropertyKey] = hoverEmValue, _m))
@@ -204,6 +204,9 @@ function getVerticalPositionValue(value) {
204
204
  return '';
205
205
  }
206
206
  }
207
- function getFontSize(device, size) {
207
+ function getEmFontSize(device, size) {
208
+ if (device === 'DESKTOP') {
209
+ return "".concat((size / 16).toFixed(3), "em");
210
+ }
208
211
  return "".concat((size / 16).toFixed(3), "em");
209
212
  }
@@ -1,4 +1,4 @@
1
- import { type ComponentBlock } from '../types';
1
+ import type { ComponentBlock } from '../types';
2
2
  export declare function parsePlacement(components: ComponentBlock[]): {
3
3
  sm: {
4
4
  i: string;
@@ -7,7 +7,6 @@ export declare function parsePlacement(components: ComponentBlock[]): {
7
7
  w: number;
8
8
  h: number;
9
9
  z: number;
10
- activeAutoResize: boolean;
11
10
  }[];
12
11
  lg: {
13
12
  i: string;
@@ -16,7 +15,6 @@ export declare function parsePlacement(components: ComponentBlock[]): {
16
15
  w: number;
17
16
  h: number;
18
17
  z: number;
19
- activeAutoResize: boolean;
20
18
  }[];
21
19
  };
22
20
  export default parsePlacement;
@@ -10,20 +10,10 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.parsePlacement = void 0;
13
- var types_1 = require("../types");
14
13
  function parsePlacement(components) {
15
14
  return components.reduce(function (acc, cur) {
16
- var _a;
17
- var id = cur.id, jsonProperties = cur.jsonProperties, componentBlockCode = cur.componentBlockCode;
18
- var activeAutoResize = false;
19
- // NOTE: 임시
20
- if (componentBlockCode === types_1.CB_ALL_CODES.CB_TEXT) {
21
- activeAutoResize = true;
22
- }
23
- if (componentBlockCode === types_1.CB_ALL_CODES.CB_TEXT && ((_a = jsonProperties.data.CB_CONTENT_PROP_TEXTOPTION) === null || _a === void 0 ? void 0 : _a.CB_CONTENT_PROP_TEXTOPTION_SPEC_FITCONTENT)) {
24
- activeAutoResize = true;
25
- }
26
- var _b = parsePropPlacement(id, jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, activeAutoResize), mobileLayout = _b.mobileLayout, desktopLayout = _b.desktopLayout;
15
+ var id = cur.id, jsonProperties = cur.jsonProperties;
16
+ var _a = parsePropPlacement(jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, id), mobileLayout = _a.mobileLayout, desktopLayout = _a.desktopLayout;
27
17
  return {
28
18
  sm: __spreadArray(__spreadArray([], acc.sm, true), [mobileLayout], false),
29
19
  lg: __spreadArray(__spreadArray([], acc.lg, true), [desktopLayout], false)
@@ -31,24 +21,22 @@ function parsePlacement(components) {
31
21
  }, { sm: [], lg: [] });
32
22
  }
33
23
  exports.parsePlacement = parsePlacement;
34
- function parsePropPlacement(id, placementProps, activeAutoResize) {
24
+ function parsePropPlacement(props, id) {
35
25
  var desktopLayout = {
36
26
  i: id.toString(),
37
- x: placementProps.CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX,
38
- y: placementProps.CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY,
39
- w: placementProps.CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS,
40
- h: placementProps.CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS,
41
- z: placementProps.CB_PLACEMENT_PROP_PLACEMENT_SPEC_ZINDEX + 500,
42
- activeAutoResize: activeAutoResize
27
+ x: props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX,
28
+ y: props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY,
29
+ w: props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS,
30
+ h: props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS,
31
+ z: props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_ZINDEX + 500
43
32
  };
44
33
  var mobileLayout = {
45
34
  i: id.toString(),
46
- x: placementProps['CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX:MOBILE'],
47
- y: placementProps['CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY:MOBILE'],
48
- w: placementProps['CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS:MOBILE'],
49
- h: placementProps['CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS:MOBILE'],
50
- z: placementProps['CB_PLACEMENT_PROP_PLACEMENT_SPEC_ZINDEX:MOBILE'] + 500,
51
- activeAutoResize: activeAutoResize
35
+ x: props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX:MOBILE'],
36
+ y: props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY:MOBILE'],
37
+ w: props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS:MOBILE'],
38
+ h: props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS:MOBILE'],
39
+ z: props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_ZINDEX:MOBILE'] + 500
52
40
  };
53
41
  return {
54
42
  mobileLayout: mobileLayout,
@@ -1,7 +1,7 @@
1
1
  import type { CB_BTNTEXT_STYLE_PROPS, CB_STYLE_PROP_BTNCOLOR_SPECS } from '../components/ComponentBlock/componentBlocks/Button/btnTypes';
2
2
  import type { CB_STYLE_PROP_TEXT_SPECS } from '../components/ComponentBlock/componentBlocks/Text/types';
3
3
  import type { CB_TWITTER_STYLE_PROPS } from '../components/ComponentBlock/componentBlocks/Twitter/types';
4
- import type { CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_CODEBLOCK, CB_CONTENT_PROP_IMAGE, CB_CONTENT_PROP_TEXT, CB_CONTENT_PROP_TEXTOPTION, CB_CONTENT_PROP_TWITTER } from '../components/ComponentBlock/componentBlocks/types';
4
+ import type { CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_CODEBLOCK, CB_CONTENT_PROP_IMAGE, CB_CONTENT_PROP_TEXT, CB_CONTENT_PROP_TWITTER } from '../components/ComponentBlock/componentBlocks/types';
5
5
  import type { CB_CONTENT_PROP_YOUTUBE_TYPE, CB_STYLE_PROP_BGCOLOR_SPECS } from '../components/ComponentBlock/componentBlocks/Youtube/types';
6
6
  import type { CB_CONTENT_PROP_VISIBILITY_SPECS } from './contentPropParsers/parseContentVisibility';
7
7
  import type { CB_EFFECT_PROP_ENTANIM_SPECS } from './effectPropParsers/parseEffectPropEntAnim';
@@ -41,7 +41,6 @@ export type CB_TEXT_PROPERTIES_TYPE = CB_GENERAL_PROPERTIES_TYPE & {
41
41
  CB_CONTENT_PROP_TEXT: CB_CONTENT_PROP_TEXT;
42
42
  CB_CONTENT_PROP_CLINK: CB_CONTENT_PROP_CLINK;
43
43
  CB_CONTENT_PROP_VISIBILITY: CB_CONTENT_PROP_VISIBILITY_SPECS;
44
- CB_CONTENT_PROP_TEXTOPTION: CB_CONTENT_PROP_TEXTOPTION;
45
44
  CB_STYLE_PROP_TEXT: CB_STYLE_PROP_TEXT_SPECS;
46
45
  CB_STYLE_PROP_OPACITY: CB_STYLE_PROP_TEXT_OPACITY_SPECS;
47
46
  CB_LAYOUT_PROP_PADDING: CB_LAYOUT_PROP_PADDING_SPECS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.2.96",
3
+ "version": "2.2.98",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -22,9 +22,10 @@
22
22
  "i18next-intervalplural-postprocessor": "^3.0.0",
23
23
  "lottie-react": "^2.3.1",
24
24
  "nuka-carousel": "^4.8.4",
25
- "publ-echo": "^0.0.83",
25
+ "publ-echo": "^0.0.45",
26
26
  "react-hook-form": "^7.28.1",
27
27
  "react-i18next": "^11.12.0",
28
+ "react-measure": "^2.5.2",
28
29
  "react-router-dom": "^5.2.0",
29
30
  "react-scripts": "4.0.3",
30
31
  "smoothscroll-polyfill": "^0.4.4",
@@ -85,6 +86,8 @@
85
86
  "@storybook/react": "^6.3.12",
86
87
  "@types/lodash": "^4.14.175",
87
88
  "@types/node": "^16.10.2",
89
+ "@types/react-grid-layout": "^1.3.5",
90
+ "@types/react-measure": "^2.0.12",
88
91
  "@types/react-router-dom": "^5.3.3",
89
92
  "@types/smoothscroll-polyfill": "^0.3.1",
90
93
  "@types/styled-components": "^5.1.9",
package/release-note.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # PDS-DEV-KIT-WEB Release Notes
2
- ## [v2.2.60]
2
+ ## [v2.2.66]
3
3
  ## daily|https://design.storybook.publ.biz/
4
4
 
5
- ### DynamicLayout
6
- * CustomSection - Fix cb_embed 사용할 수 없는 호스트 추가
5
+ ### sub
6
+ * LayoutWS > Containers
7
+ * WSJ_1 추가
@@ -1,5 +0,0 @@
1
- import { RefObject } from 'react';
2
- import type { Device } from '../../../../../../../DynamicLayout/sections/CustomSection/util/types';
3
- import type { DynamicLayoutProps } from '../../../../../../../DynamicLayout/types';
4
- declare const useMaxFontAdjustment: (ref: RefObject<HTMLDivElement>, cbFontSize: string, mode: DynamicLayoutProps['mode'], device: Device, rootBaseFontSize: number) => number;
5
- export default useMaxFontAdjustment;
@@ -1,61 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var react_1 = require("react");
4
- var DEFAULT_BASE_FONT = 16;
5
- var useMaxFontAdjustment = function (ref, cbFontSize, mode, device, rootBaseFontSize) {
6
- var _a = (0, react_1.useState)(DEFAULT_BASE_FONT), fontSize = _a[0], setFontSize = _a[1];
7
- var ogRef = (0, react_1.useRef)(0);
8
- (0, react_1.useEffect)(function () {
9
- if (device === 'DESKTOP') {
10
- return;
11
- }
12
- if (mode !== 'PREVIEW') {
13
- return;
14
- }
15
- if (!ref.current) {
16
- return;
17
- }
18
- if (rootBaseFontSize >= 16) {
19
- return;
20
- }
21
- var resizeObserver = new ResizeObserver(function (callback) {
22
- var object = callback[0];
23
- var height = object.target.clientHeight;
24
- var contentHeight = object.target.children[0].clientHeight;
25
- var minFontSize = parseEmToNumber(cbFontSize) * 0.6;
26
- if (fontSize === 16) {
27
- var percent = (contentHeight / contentHeight) * 100;
28
- ogRef.current = percent;
29
- }
30
- var p = (contentHeight / height) * 100;
31
- var isOverflow = contentHeight > height;
32
- var hasContentGap = p > ogRef.current;
33
- var isNextMin = fontSize <= minFontSize;
34
- if (isNextMin) {
35
- return;
36
- }
37
- if (isOverflow || hasContentGap) {
38
- setFontSize(function (prev) { return Number((prev - 0.3).toFixed(3)); });
39
- }
40
- });
41
- resizeObserver.observe(ref.current);
42
- return function () {
43
- resizeObserver.disconnect();
44
- };
45
- }, [fontSize, mode, device, rootBaseFontSize]);
46
- (0, react_1.useEffect)(function () {
47
- return function () {
48
- ogRef.current = 0;
49
- };
50
- }, []);
51
- return fontSize;
52
- };
53
- exports.default = useMaxFontAdjustment;
54
- function parseEmToNumber(value) {
55
- var numericPart = value.replace('em', '').trim();
56
- var result = parseFloat(numericPart);
57
- if (isNaN(result)) {
58
- return 0;
59
- }
60
- return result;
61
- }