pds-dev-kit-web-test 0.2.12 → 0.2.14

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 (39) hide show
  1. package/dist/src/sub/DynamicLayout/components/Section/CustomSection.d.ts +10 -0
  2. package/dist/src/sub/DynamicLayout/components/Section/CustomSection.js +48 -0
  3. package/dist/src/sub/DynamicLayout/components/Section/Section.d.ts +1 -2
  4. package/dist/src/sub/DynamicLayout/components/Section/Section.js +9 -83
  5. package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackground.d.ts +6 -0
  6. package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackground.js +108 -0
  7. package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackgroundMedia.d.ts +4 -1
  8. package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackgroundMedia.js +41 -19
  9. package/dist/src/sub/DynamicLayout/components/Section/index.d.ts +1 -0
  10. package/dist/src/sub/DynamicLayout/components/Section/index.js +3 -1
  11. package/dist/src/sub/DynamicLayout/components/Section/util/index.d.ts +1 -0
  12. package/dist/src/sub/DynamicLayout/components/Section/util/index.js +8 -0
  13. package/dist/src/sub/DynamicLayout/components/Section/util/parseSectionBackgroundMediaData.d.ts +9 -0
  14. package/dist/src/sub/DynamicLayout/components/Section/util/parseSectionBackgroundMediaData.js +47 -0
  15. package/dist/src/sub/DynamicLayout/components/index.d.ts +1 -1
  16. package/dist/src/sub/DynamicLayout/components/index.js +2 -1
  17. package/dist/src/sub/DynamicLayout/mock_samplePage.js +530 -55
  18. package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +8 -28
  19. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +3 -3
  20. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image/Image.js +9 -9
  21. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/RichText.js +3 -3
  22. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Twitter/Twitter.js +3 -3
  23. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/Youtube.js +4 -4
  24. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_Box.js +1 -31
  25. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_BoxWithShadow.d.ts +11 -0
  26. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_BoxWithShadow.js +101 -0
  27. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/colorUtil.js +4 -2
  28. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.js +35 -3
  29. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/index.d.ts +2 -0
  30. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/index.js +5 -1
  31. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseCustomSectionPlacement.d.ts +20 -0
  32. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseCustomSectionPlacement.js +37 -0
  33. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgColor.js +2 -2
  34. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropOpacity.js +2 -2
  35. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropShadow.js +2 -2
  36. package/dist/src/sub/DynamicLayout/types.d.ts +12 -10
  37. package/package.json +1 -1
  38. package/release-note.md +1 -1
  39. package/webhook/node_modules/esrecurse/.babelrc +3 -0
@@ -25,8 +25,7 @@ var dynamicLayoutContext_1 = require("../../../DynamicLayout/dynamicLayoutContex
25
25
  var styled_components_1 = __importDefault(require("styled-components"));
26
26
  var components_1 = require("../../components");
27
27
  var ComponentBlockMatcher_1 = __importDefault(require("./components/ComponentBlock/ComponentBlockMatcher"));
28
- var isNullOrUndefined_1 = __importDefault(require("./util/isNullOrUndefined"));
29
- var parsePlacement_1 = require("./util/parsePlacement");
28
+ var util_1 = require("./util");
30
29
  var Responsive = (0, publ_echo_1.WidthProvider)(publ_echo_1.ResponsiveGridEditor);
31
30
  function CustomSection(props) {
32
31
  var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, sectionActionHandler = _a.sectionActionHandler, editingSectionId = _a.editingSectionId;
@@ -36,14 +35,14 @@ function CustomSection(props) {
36
35
  var gleRef = (0, react_1.useRef)(null);
37
36
  var isMobile = device === 'MOBILE';
38
37
  var _c = (0, react_1.useState)(function () {
39
- var _a = (0, parsePlacement_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : []), lg = _a.lg, sm = _a.sm;
38
+ var _a = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : []), lg = _a.lg, sm = _a.sm;
40
39
  return {
41
40
  lg: lg,
42
41
  sm: sm
43
42
  };
44
43
  }), layouts = _c[0], setLayouts = _c[1];
45
44
  (0, react_1.useEffect)(function () {
46
- var _a = (0, parsePlacement_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : []), lg = _a.lg, sm = _a.sm;
45
+ var _a = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : []), lg = _a.lg, sm = _a.sm;
47
46
  setLayouts({ lg: lg, sm: sm });
48
47
  }, [componentBlocks]);
49
48
  (0, react_1.useEffect)(function () {
@@ -51,29 +50,10 @@ function CustomSection(props) {
51
50
  setSelectedCB(null);
52
51
  }
53
52
  }, [editingSectionId]);
54
- var customSectionProps = (0, react_1.useMemo)(function () {
55
- return CB_PLACEMENT_PROP_SECTION
56
- ? {
57
- minHeight: isMobile &&
58
- !(0, isNullOrUndefined_1.default)(CB_PLACEMENT_PROP_SECTION['CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT:MOBILE'])
59
- ? CB_PLACEMENT_PROP_SECTION['CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT:MOBILE']
60
- : CB_PLACEMENT_PROP_SECTION.CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT,
61
- width: isMobile &&
62
- !(0, isNullOrUndefined_1.default)(CB_PLACEMENT_PROP_SECTION['CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH:MOBILE'])
63
- ? CB_PLACEMENT_PROP_SECTION['CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH:MOBILE']
64
- : CB_PLACEMENT_PROP_SECTION.CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH,
65
- rows: isMobile &&
66
- !(0, isNullOrUndefined_1.default)(CB_PLACEMENT_PROP_SECTION['CB_PLACEMENT_PROP_SECTION_SPEC_ROWS:MOBILE'])
67
- ? CB_PLACEMENT_PROP_SECTION['CB_PLACEMENT_PROP_SECTION_SPEC_ROWS:MOBILE']
68
- : CB_PLACEMENT_PROP_SECTION.CB_PLACEMENT_PROP_SECTION_SPEC_ROWS,
69
- isFullWidth: isMobile &&
70
- !(0, isNullOrUndefined_1.default)(CB_PLACEMENT_PROP_SECTION['CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH:MOBILE'])
71
- ? CB_PLACEMENT_PROP_SECTION['CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH:MOBILE']
72
- : CB_PLACEMENT_PROP_SECTION.CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH
73
- }
74
- : {};
75
- }, [CB_PLACEMENT_PROP_SECTION, isMobile]);
76
- var rows = customSectionProps.rows, width = customSectionProps.width, minHeight = customSectionProps.minHeight, isFullWidth = customSectionProps.isFullWidth;
53
+ var _d = (0, util_1.parseCustomSectionPlacement)({
54
+ isMobile: isMobile,
55
+ customSectionProps: CB_PLACEMENT_PROP_SECTION
56
+ }), rows = _d.rows, width = _d.width, minHeight = _d.minHeight, isFullWidth = _d.isFullWidth;
77
57
  // eslint-disable-next-line react/destructuring-assignment
78
58
  var customSectionStyles = {
79
59
  minHeight: minHeight + "px",
@@ -141,7 +121,7 @@ function CustomSection(props) {
141
121
  }
142
122
  });
143
123
  };
144
- return ((0, jsx_runtime_1.jsx)(S_gleStyles, __assign({ customHeight: customMinHeight }, { 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.Section, __assign({}, props, { overrideStyles: customSectionStyles, isMobile: isMobile }, { children: (0, jsx_runtime_1.jsx)(Responsive, __assign({ allowOverlap: true, layouts: { lg: layouts.lg, sm: layouts.sm }, resizeHandles: ['nw', 'e', 'n', 'ne', 's', 'se', 'sw', 'w'], breakpoints: { lg: 800, sm: 480 }, breakpoint: breakpoint, cols: { lg: 24, sm: 8 }, rowHeight: 50, margin: [10, 10], style: {
124
+ return ((0, jsx_runtime_1.jsx)(S_gleStyles, __assign({ customHeight: customMinHeight }, { 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, { overrideStyles: customSectionStyles, isMobile: isMobile }, { children: (0, jsx_runtime_1.jsx)(Responsive, __assign({ allowOverlap: true, layouts: { lg: layouts.lg, sm: layouts.sm }, resizeHandles: ['nw', 'e', 'n', 'ne', 's', 'se', 'sw', 'w'], breakpoints: { lg: 800, sm: 480 }, breakpoint: breakpoint, cols: { lg: 24, sm: 8 }, rowHeight: 50, margin: [10, 10], style: {
145
125
  width: customSectionStyles.width,
146
126
  minHeight: customMinHeight
147
127
  }, onLayoutChange: onLayoutChange, onDragStop: onDragStop, onResizeStop: onResizeStop }, { children: componentBlocks ? (componentBlocks.map(function (each) { return ((0, jsx_runtime_1.jsx)("div", __assign({ className: selectedCB === each.id ? 'react-grid-item-selected' : '' }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ style: {
@@ -22,12 +22,12 @@ var hooks_1 = require("../../../../../../../DynamicLayout/sections/CustomSection
22
22
  var newUtils_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/newUtils");
23
23
  var colorUtil_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/newUtils/colorUtil");
24
24
  var util_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/util");
25
- var S_CB_Box_1 = require("../components/S_CB_Box");
25
+ var S_CB_BoxWithShadow_1 = require("../components/S_CB_BoxWithShadow");
26
26
  var S_HiddenCover_1 = require("../components/S_HiddenCover");
27
27
  var useCLINK_1 = __importDefault(require("../hooks/useCLINK"));
28
28
  function Button(props) {
29
29
  var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
30
- var CB_STYLE_PROP_BTNCOLOR = props.CB_STYLE_PROP_BTNCOLOR, _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;
30
+ var CB_STYLE_PROP_BTNCOLOR = props.CB_STYLE_PROP_BTNCOLOR, _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_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW;
31
31
  var onClickBox = (0, useCLINK_1.default)({
32
32
  src: CB_CONTENT_PROP_CLINK_SPEC_SRC,
33
33
  type: CB_CONTENT_PROP_CLINK_SPEC_TYPE,
@@ -50,7 +50,7 @@ function Button(props) {
50
50
  var entry = (0, hooks_1.useIntersectionObserver)(cbRef, { threshold: 1, freezeOnceVisible: true });
51
51
  var isVisible = !!(entry === null || entry === void 0 ? void 0 : entry.isIntersecting);
52
52
  var effectCssProperties = isVisible ? effect : {};
53
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}, void 0), (0, jsx_runtime_1.jsx)(S_CB_Box_1.S_CB_Box, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, btnTextStyle), propsStyle), layoutStyle), effectCssProperties), btnColorStyle), hoverStyle: __assign(__assign(__assign({}, btnTextHoverStyle), propsHoverStyle), btnColorHoverStyle), onClick: handleOnClick, ref: cbRef }, { children: props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT }), void 0)] }, void 0));
53
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}, void 0), (0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, btnTextStyle), propsStyle), layoutStyle), effectCssProperties), btnColorStyle), hoverStyle: __assign(__assign(__assign({}, btnTextHoverStyle), propsHoverStyle), btnColorHoverStyle), cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, onClick: handleOnClick, ref: cbRef }, { children: props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT }), void 0)] }, void 0));
54
54
  }
55
55
  function getBTNStyles(props, device) {
56
56
  var availableSpecCodes = [
@@ -43,11 +43,11 @@ var DynamicLayout_1 = require("../../../../../../../DynamicLayout");
43
43
  var styled_components_1 = __importStar(require("styled-components"));
44
44
  var hooks_1 = require("../../../../hooks");
45
45
  var util_1 = require("../../../../util");
46
- var S_CB_Box_1 = require("../components/S_CB_Box");
46
+ var S_CB_BoxWithShadow_1 = require("../components/S_CB_BoxWithShadow");
47
47
  var useCLINK_1 = __importDefault(require("../hooks/useCLINK"));
48
48
  function Image(props) {
49
49
  var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
50
- var CB_CONTENT_PROP_IMAGE = props.CB_CONTENT_PROP_IMAGE, _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;
50
+ var CB_CONTENT_PROP_IMAGE = props.CB_CONTENT_PROP_IMAGE, _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_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW;
51
51
  var onClickBox = (0, useCLINK_1.default)({
52
52
  src: CB_CONTENT_PROP_CLINK_SPEC_SRC,
53
53
  type: CB_CONTENT_PROP_CLINK_SPEC_TYPE,
@@ -65,7 +65,7 @@ function Image(props) {
65
65
  return;
66
66
  onClickBox();
67
67
  };
68
- return ((0, jsx_runtime_1.jsx)(S_CB_Box_1.S_CB_Box, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign({}, layout), effectCssProperties), wrapperStyle), hoverStyle: hoverWrapperStyle, ref: cbRef, onClick: handleOnClick }, { children: (0, jsx_runtime_1.jsx)(S_ImageWrapper, __assign({ normalStyle: componentStyle, hoverStyle: hoverComponentStyle }, { children: (0, jsx_runtime_1.jsx)(S_Image, { src: CB_CONTENT_PROP_IMAGE.CB_CONTENT_PROP_IMAGE_SPEC_SELECTOR, normalStyle: { objectFit: hoverComponentStyle.objectFit } }, void 0) }), void 0) }), void 0));
68
+ return ((0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign({}, layout), effectCssProperties), wrapperStyle), hoverStyle: hoverWrapperStyle, cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, ref: cbRef, onClick: handleOnClick }, { children: (0, jsx_runtime_1.jsx)(S_ImageWrapper, __assign({ normalStyle: componentStyle, hoverStyle: hoverComponentStyle }, { children: (0, jsx_runtime_1.jsx)(S_Image, { src: CB_CONTENT_PROP_IMAGE.CB_CONTENT_PROP_IMAGE_SPEC_SELECTOR, normalStyle: { objectFit: hoverComponentStyle.objectFit } }, void 0) }), void 0) }), void 0));
69
69
  }
70
70
  function imageStyleDivideProvider(style) {
71
71
  return {
@@ -84,16 +84,13 @@ function imageStyleDivideProvider(style) {
84
84
  borderTopRightRadius: style.borderTopRightRadius,
85
85
  borderWidth: style.borderWidth,
86
86
  boxShadow: style.boxShadow,
87
- opacity: style.opacity,
87
+ opacity: Number(style.opacity) / 100,
88
88
  visibility: style.visibility
89
89
  }
90
90
  };
91
91
  }
92
- var S_Image = styled_components_1.default.img(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 100%;\n width: 100%;\n\n ", ";\n"], ["\n height: 100%;\n width: 100%;\n\n ", ";\n"])), function (_a) {
93
- var normalStyle = _a.normalStyle;
94
- return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n object-fit: ", ";\n "], ["\n object-fit: ", ";\n "])), normalStyle.objectFit);
95
- });
96
- var S_ImageWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", ";\n\n &:hover {\n ", ";\n }\n\n &:hover img {\n ", ";\n }\n"], ["\n ", ";\n\n &:hover {\n ", ";\n }\n\n &:hover img {\n ", ";\n }\n"])), function (_a) {
92
+ var S_Image = styled_components_1.default.img(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n width: 100%;\n"], ["\n height: 100%;\n width: 100%;\n"])));
93
+ var S_ImageWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", ";\n\n &:hover {\n ", ";\n }\n\n & img {\n ", ";\n }\n\n &:hover img {\n ", ";\n }\n"], ["\n ", ";\n\n &:hover {\n ", ";\n }\n\n & img {\n ", ";\n }\n\n &:hover img {\n ", ";\n }\n"])), function (_a) {
97
94
  var normalStyle = _a.normalStyle;
98
95
  switch (normalStyle.objectFit) {
99
96
  case 'cover':
@@ -109,6 +106,9 @@ var S_ImageWrapper = styled_components_1.default.div(templateObject_4 || (templa
109
106
  default:
110
107
  return "height: auto;\n width: auto";
111
108
  }
109
+ }, function (_a) {
110
+ var normalStyle = _a.normalStyle;
111
+ return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n object-fit: ", ";\n "], ["\n object-fit: ", ";\n "])), normalStyle.objectFit);
112
112
  }, function (_a) {
113
113
  var hoverStyle = _a.hoverStyle;
114
114
  return (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n object-fit: ", ";\n "], ["\n object-fit: ", ";\n "])), hoverStyle.objectFit);
@@ -27,11 +27,11 @@ var hooks_1 = require("../../../../../../../DynamicLayout/sections/CustomSection
27
27
  var colorUtil_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/newUtils/colorUtil");
28
28
  var util_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/util");
29
29
  var styled_components_1 = __importDefault(require("styled-components"));
30
- var S_CB_Box_1 = require("../components/S_CB_Box");
30
+ var S_CB_BoxWithShadow_1 = require("../components/S_CB_BoxWithShadow");
31
31
  var S_HiddenCover_1 = require("../components/S_HiddenCover");
32
32
  function RichText(props) {
33
33
  var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
34
- var CB_STYLE_PROP_BGCOLOR = props.CB_STYLE_PROP_BGCOLOR;
34
+ var CB_STYLE_PROP_BGCOLOR = props.CB_STYLE_PROP_BGCOLOR, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW;
35
35
  var _b = (0, util_1.parseProperties)(props, device), propsStyle = _b.style, propsHoverStyle = _b.hoverStyle, layoutStyle = _b.layout, effect = _b.effect;
36
36
  var _c = getBGColorStyles(CB_STYLE_PROP_BGCOLOR, device), bgColorStyle = _c.style, bgColorHoverStyle = _c.hoverStyle;
37
37
  var isEditModeAndHidden = propsStyle.visibility === 'hidden' && mode === 'EDIT';
@@ -42,7 +42,7 @@ function RichText(props) {
42
42
  var entry = (0, hooks_1.useIntersectionObserver)(cbRef, { threshold: 1, freezeOnceVisible: true });
43
43
  var isVisible = !!(entry === null || entry === void 0 ? void 0 : entry.isIntersecting);
44
44
  var effectCssProperties = isVisible ? effect : {};
45
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}, void 0), (0, jsx_runtime_1.jsx)(S_CB_Box_1.S_CB_Box, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign({}, propsStyle), layoutStyle), effectCssProperties), bgColorStyle), hoverStyle: __assign(__assign({}, propsHoverStyle), bgColorHoverStyle), ref: cbRef }, { children: (0, jsx_runtime_1.jsx)(S_RichTextWrapper, { children: (0, jsx_runtime_1.jsx)(RichText_1.RichText, { text: props.CB_CONTENT_PROP_TEXTEDIT.CB_CONTENT_PROP_TEXTEDIT_SPEC_EDITOR }, void 0) }, void 0) }), void 0)] }, void 0));
45
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}, void 0), (0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign({}, propsStyle), layoutStyle), effectCssProperties), bgColorStyle), hoverStyle: __assign(__assign({}, propsHoverStyle), bgColorHoverStyle), cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, ref: cbRef }, { children: (0, jsx_runtime_1.jsx)(S_RichTextWrapper, { children: (0, jsx_runtime_1.jsx)(RichText_1.RichText, { text: props.CB_CONTENT_PROP_TEXTEDIT.CB_CONTENT_PROP_TEXTEDIT_SPEC_EDITOR }, void 0) }, void 0) }), void 0)] }, void 0));
46
46
  }
47
47
  function getBGColorStyles(props, device) {
48
48
  var availableSpecCodes = [
@@ -17,11 +17,11 @@ var DynamicLayout_1 = require("../../../../../../../DynamicLayout");
17
17
  var ComponentBlocks_1 = require("../../../../../../../DynamicLayout/components/ComponentBlocks");
18
18
  var hooks_1 = require("../../../../hooks");
19
19
  var util_1 = require("../../../../util");
20
- var S_CB_Box_1 = require("../components/S_CB_Box");
20
+ var S_CB_BoxWithShadow_1 = require("../components/S_CB_BoxWithShadow");
21
21
  function Twitter(props) {
22
22
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
23
23
  var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
24
- var CB_CONTENT_PROP_TWITTER_SPEC_SRC = props.CB_CONTENT_PROP_TWITTER.CB_CONTENT_PROP_TWITTER_SPEC_SRC, CB_STYLE_PROP_TWITTER_SPEC_THEME = props.CB_STYLE_PROP_TWITTER.CB_STYLE_PROP_TWITTER_SPEC_THEME;
24
+ var CB_CONTENT_PROP_TWITTER_SPEC_SRC = props.CB_CONTENT_PROP_TWITTER.CB_CONTENT_PROP_TWITTER_SPEC_SRC, CB_STYLE_PROP_TWITTER_SPEC_THEME = props.CB_STYLE_PROP_TWITTER.CB_STYLE_PROP_TWITTER_SPEC_THEME, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW;
25
25
  var _b = (0, util_1.parseProperties)(props, device), style = _b.style, hoverStyle = _b.hoverStyle, layout = _b.layout, effect = _b.effect;
26
26
  var userId = CB_CONTENT_PROP_TWITTER_SPEC_SRC.replace('https://twitter.com/', '');
27
27
  var theme = CB_STYLE_PROP_TWITTER_SPEC_THEME.toLowerCase();
@@ -39,6 +39,6 @@ function Twitter(props) {
39
39
  var isVisible = !!(entry === null || entry === void 0 ? void 0 : entry.isIntersecting);
40
40
  var effectCssProperties = isVisible ? effect : {};
41
41
  var editModeStyle = mode === 'EDIT' ? { pointerEvents: 'none' } : {};
42
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(S_CB_Box_1.S_CB_Box, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, style), layout), effectCssProperties), { overflowY: 'auto' }), editModeStyle), hoverStyle: hoverStyle, ref: cbRef }, { children: (0, jsx_runtime_1.jsx)(ComponentBlocks_1.TwitterTimeline, { userId: userId, theme: theme }, void 0) }), void 0) }, void 0));
42
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, style), layout), effectCssProperties), { overflowY: 'auto' }), editModeStyle), hoverStyle: hoverStyle, cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, ref: cbRef }, { children: (0, jsx_runtime_1.jsx)(ComponentBlocks_1.TwitterTimeline, { userId: userId, theme: theme }, void 0) }), void 0) }, void 0));
43
43
  }
44
44
  exports.default = Twitter;
@@ -25,12 +25,12 @@ var hooks_1 = require("../../../../../../../DynamicLayout/sections/CustomSection
25
25
  var colorUtil_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/newUtils/colorUtil");
26
26
  var util_1 = require("../../../../../../../DynamicLayout/sections/CustomSection/util");
27
27
  var styled_components_1 = __importDefault(require("styled-components"));
28
- var S_CB_Box_1 = require("../components/S_CB_Box");
28
+ var S_CB_BoxWithShadow_1 = require("../components/S_CB_BoxWithShadow");
29
29
  var S_HiddenCover_1 = require("../components/S_HiddenCover");
30
30
  var parseYoutubeContentProp_1 = __importDefault(require("./parseYoutubeContentProp"));
31
31
  function Youtube(props) {
32
32
  var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
33
- var CB_CONTENT_PROP_YOUTUBE = props.CB_CONTENT_PROP_YOUTUBE, CB_STYLE_PROP_BGCOLOR = props.CB_STYLE_PROP_BGCOLOR;
33
+ var CB_CONTENT_PROP_YOUTUBE = props.CB_CONTENT_PROP_YOUTUBE, CB_STYLE_PROP_BGCOLOR = props.CB_STYLE_PROP_BGCOLOR, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW;
34
34
  var _b = (0, parseYoutubeContentProp_1.default)(CB_CONTENT_PROP_YOUTUBE), youtubeSrc = _b.youtubeSrc, thumbnailSrc = _b.thumbnailSrc, id = _b.id;
35
35
  var isEditMode = mode === 'EDIT';
36
36
  var _c = getBGColorStyles(CB_STYLE_PROP_BGCOLOR, device), bgColorStyle = _c.style, bgColorHoverStyle = _c.hoverStyle;
@@ -43,7 +43,7 @@ function Youtube(props) {
43
43
  var entry = (0, hooks_1.useIntersectionObserver)(cbRef, { threshold: 1, freezeOnceVisible: true });
44
44
  var isVisible = !!(entry === null || entry === void 0 ? void 0 : entry.isIntersecting);
45
45
  var effectCssProperties = isVisible ? effect : {};
46
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}, void 0), (0, jsx_runtime_1.jsx)(S_CB_Box_1.S_CB_Box, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign({}, propsStyle), layoutStyle), effectCssProperties), bgColorStyle), hoverStyle: __assign(__assign({}, propsHoverStyle), bgColorHoverStyle), ref: cbRef }, { children: isEditMode ? ((0, jsx_runtime_1.jsxs)(S_ThumbnailBox, { children: [(0, jsx_runtime_1.jsx)(YoutubeButton, {}, void 0), (0, jsx_runtime_1.jsx)(S_Thumbnail, { src: thumbnailSrc }, void 0)] }, void 0)) : ((0, jsx_runtime_1.jsx)(S_Iframe, { title: id, src: youtubeSrc, allow: "accelerometer; encrypted-media; gyroscope; picture-in-picture" }, void 0)) }), void 0)] }, void 0));
46
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}, void 0), (0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign({}, propsStyle), layoutStyle), effectCssProperties), bgColorStyle), hoverStyle: __assign(__assign({}, propsHoverStyle), bgColorHoverStyle), cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, ref: cbRef }, { children: isEditMode ? ((0, jsx_runtime_1.jsxs)(S_ThumbnailBox, { children: [(0, jsx_runtime_1.jsx)(YoutubeButton, {}, void 0), (0, jsx_runtime_1.jsx)(S_Thumbnail, { src: thumbnailSrc }, void 0)] }, void 0)) : ((0, jsx_runtime_1.jsx)(S_Iframe, { title: id, src: youtubeSrc, allow: "accelerometer; encrypted-media; gyroscope; picture-in-picture" }, void 0)) }), void 0)] }, void 0));
47
47
  }
48
48
  function getBGColorStyles(props, device) {
49
49
  var availableSpecCodes = [
@@ -59,7 +59,7 @@ function getBGColorStyles(props, device) {
59
59
  return (0, colorUtil_1.parseStyleColorToCSSProp)({ availableSpecCodes: availableSpecCodes, props: props, propKey: 'BGCOLOR', device: device });
60
60
  }
61
61
  var S_ThumbnailBox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: 100%;\n justify-content: center;\n position: relative;\n width: 100%;\n"], ["\n align-items: center;\n display: flex;\n height: 100%;\n justify-content: center;\n position: relative;\n width: 100%;\n"])));
62
- var S_Thumbnail = styled_components_1.default.img(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 100%;\n width: 100%;\n"], ["\n height: 100%;\n width: 100%;\n"])));
62
+ var S_Thumbnail = styled_components_1.default.img(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 100%;\n object-fit: cover;\n width: 100%;\n"], ["\n height: 100%;\n object-fit: cover;\n width: 100%;\n"])));
63
63
  var S_Iframe = styled_components_1.default.iframe(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border: none;\n height: 100%;\n width: 100%;\n"], ["\n border: none;\n height: 100%;\n width: 100%;\n"])));
64
64
  var S_YoutubeButton = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 48px;\n margin: auto;\n position: absolute;\n width: 68px;\n"], ["\n height: 48px;\n margin: auto;\n position: absolute;\n width: 68px;\n"])));
65
65
  function YoutubeButton() {
@@ -36,41 +36,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.S_CB_Box = void 0;
38
38
  var styled_components_1 = __importStar(require("styled-components"));
39
- exports.S_CB_Box = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n /*\n Introduced in IE 10.\n See http://ie.microsoft.com/testdrive/HTML5/msUserSelect/\n */\n\n height: 100%;\n overflow: hidden;\n width: 100%;\n\n ", ";\n\n &:before {\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n border-top-left-radius: ", "px;\n border-top-right-radius: ", "px;\n box-shadow: ", ";\n content: '';\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n &:hover {\n ", ";\n\n &:before {\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n border-top-left-radius: ", "px;\n border-top-right-radius: ", "px;\n box-shadow: ", ";\n content: '';\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n }\n }\n"], ["\n /*\n Introduced in IE 10.\n See http://ie.microsoft.com/testdrive/HTML5/msUserSelect/\n */\n\n height: 100%;\n overflow: hidden;\n width: 100%;\n\n ", ";\n\n &:before {\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n border-top-left-radius: ", "px;\n border-top-right-radius: ", "px;\n box-shadow: ", ";\n content: '';\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n &:hover {\n ", ";\n\n &:before {\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n border-top-left-radius: ", "px;\n border-top-right-radius: ", "px;\n box-shadow: ", ";\n content: '';\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n }\n }\n"])), function (_a) {
39
+ exports.S_CB_Box = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n /*\n Introduced in IE 10.\n See http://ie.microsoft.com/testdrive/HTML5/msUserSelect/\n */\n\n height: 100%;\n overflow: hidden;\n width: 100%;\n\n ", ";\n\n &:hover {\n ", ";\n }\n"], ["\n /*\n Introduced in IE 10.\n See http://ie.microsoft.com/testdrive/HTML5/msUserSelect/\n */\n\n height: 100%;\n overflow: hidden;\n width: 100%;\n\n ", ";\n\n &:hover {\n ", ";\n }\n"])), function (_a) {
40
40
  var normalStyle = _a.normalStyle;
41
41
  return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), __assign(__assign({}, normalStyle), { boxShadow: '' }));
42
- }, function (_a) {
43
- var normalStyle = _a.normalStyle;
44
- return normalStyle.borderBottomLeftRadius;
45
- }, function (_a) {
46
- var normalStyle = _a.normalStyle;
47
- return normalStyle.borderBottomRightRadius;
48
- }, function (_a) {
49
- var normalStyle = _a.normalStyle;
50
- return normalStyle.borderTopLeftRadius;
51
- }, function (_a) {
52
- var normalStyle = _a.normalStyle;
53
- return normalStyle.borderTopRightRadius;
54
- }, function (_a) {
55
- var normalStyle = _a.normalStyle;
56
- return normalStyle.boxShadow;
57
42
  }, function (_a) {
58
43
  var hoverStyle = _a.hoverStyle;
59
44
  return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), __assign(__assign({}, hoverStyle), { boxShadow: '' }));
60
- }, function (_a) {
61
- var hoverStyle = _a.hoverStyle;
62
- return hoverStyle.borderBottomLeftRadius;
63
- }, function (_a) {
64
- var hoverStyle = _a.hoverStyle;
65
- return hoverStyle.borderBottomRightRadius;
66
- }, function (_a) {
67
- var hoverStyle = _a.hoverStyle;
68
- return hoverStyle.borderTopLeftRadius;
69
- }, function (_a) {
70
- var hoverStyle = _a.hoverStyle;
71
- return hoverStyle.borderTopRightRadius;
72
- }, function (_a) {
73
- var hoverStyle = _a.hoverStyle;
74
- return hoverStyle.boxShadow;
75
45
  });
76
46
  var templateObject_1, templateObject_2, templateObject_3;
@@ -0,0 +1,11 @@
1
+ import type { StylesProps } from '../types';
2
+ import type { Device, NUMBER_INTEGER } from '../../../../../../../DynamicLayout/sections/CustomSection/util/types';
3
+ export declare const S_CB_BoxWithShadow: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StylesProps & {
4
+ cbStylePropsShadowSpecs: {
5
+ CB_STYLE_PROP_SHADOW_SPEC_OPACITY: NUMBER_INTEGER;
6
+ 'CB_STYLE_PROP_SHADOW_SPEC_OPACITY:HOVER': NUMBER_INTEGER;
7
+ 'CB_STYLE_PROP_SHADOW_SPEC_OPACITY:MOBILE': NUMBER_INTEGER | null | undefined;
8
+ 'CB_STYLE_PROP_SHADOW_SPEC_OPACITY:MOBILE:HOVER': NUMBER_INTEGER | null | undefined;
9
+ };
10
+ device: Device;
11
+ }, never>;
@@ -0,0 +1,101 @@
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
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ var __importDefault = (this && this.__importDefault) || function (mod) {
37
+ return (mod && mod.__esModule) ? mod : { "default": mod };
38
+ };
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ exports.S_CB_BoxWithShadow = void 0;
41
+ var isNullOrUndefined_1 = __importDefault(require("../../../../../../../DynamicLayout/sections/CustomSection/util/isNullOrUndefined"));
42
+ var styled_components_1 = __importStar(require("styled-components"));
43
+ exports.S_CB_BoxWithShadow = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n /*\n Introduced in IE 10.\n See http://ie.microsoft.com/testdrive/HTML5/msUserSelect/\n */\n\n height: 100%;\n overflow: hidden;\n width: 100%;\n\n ", ";\n\n &:before {\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n border-top-left-radius: ", "px;\n border-top-right-radius: ", "px;\n box-shadow: ", ";\n content: '';\n height: 100%;\n left: 0;\n opacity: ", ";\n pointer-events: none;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n &:hover {\n ", ";\n\n &:before {\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n border-top-left-radius: ", "px;\n border-top-right-radius: ", "px;\n box-shadow: ", ";\n content: '';\n height: 100%;\n left: 0;\n opacity: ", ";\n pointer-events: none;\n position: absolute;\n top: 0;\n width: 100%;\n }\n }\n"], ["\n /*\n Introduced in IE 10.\n See http://ie.microsoft.com/testdrive/HTML5/msUserSelect/\n */\n\n height: 100%;\n overflow: hidden;\n width: 100%;\n\n ", ";\n\n &:before {\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n border-top-left-radius: ", "px;\n border-top-right-radius: ", "px;\n box-shadow: ", ";\n content: '';\n height: 100%;\n left: 0;\n opacity: ", ";\n pointer-events: none;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n &:hover {\n ", ";\n\n &:before {\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n border-top-left-radius: ", "px;\n border-top-right-radius: ", "px;\n box-shadow: ", ";\n content: '';\n height: 100%;\n left: 0;\n opacity: ", ";\n pointer-events: none;\n position: absolute;\n top: 0;\n width: 100%;\n }\n }\n"])), function (_a) {
44
+ var normalStyle = _a.normalStyle;
45
+ return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), __assign(__assign({}, normalStyle), { boxShadow: '' }));
46
+ }, function (_a) {
47
+ var normalStyle = _a.normalStyle;
48
+ return normalStyle.borderBottomLeftRadius;
49
+ }, function (_a) {
50
+ var normalStyle = _a.normalStyle;
51
+ return normalStyle.borderBottomRightRadius;
52
+ }, function (_a) {
53
+ var normalStyle = _a.normalStyle;
54
+ return normalStyle.borderTopLeftRadius;
55
+ }, function (_a) {
56
+ var normalStyle = _a.normalStyle;
57
+ return normalStyle.borderTopRightRadius;
58
+ }, function (_a) {
59
+ var normalStyle = _a.normalStyle;
60
+ return normalStyle.boxShadow;
61
+ }, function (_a) {
62
+ var cbStylePropsShadowSpecs = _a.cbStylePropsShadowSpecs, device = _a.device;
63
+ switch (device) {
64
+ case 'DESKTOP':
65
+ return cbStylePropsShadowSpecs.CB_STYLE_PROP_SHADOW_SPEC_OPACITY / 100;
66
+ case 'MOBILE':
67
+ return (0, isNullOrUndefined_1.default)(cbStylePropsShadowSpecs['CB_STYLE_PROP_SHADOW_SPEC_OPACITY:MOBILE'])
68
+ ? cbStylePropsShadowSpecs.CB_STYLE_PROP_SHADOW_SPEC_OPACITY / 100
69
+ : Number(cbStylePropsShadowSpecs['CB_STYLE_PROP_SHADOW_SPEC_OPACITY:MOBILE']) / 100;
70
+ }
71
+ }, function (_a) {
72
+ var hoverStyle = _a.hoverStyle;
73
+ return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), __assign(__assign({}, hoverStyle), { boxShadow: '' }));
74
+ }, function (_a) {
75
+ var hoverStyle = _a.hoverStyle;
76
+ return hoverStyle.borderBottomLeftRadius;
77
+ }, function (_a) {
78
+ var hoverStyle = _a.hoverStyle;
79
+ return hoverStyle.borderBottomRightRadius;
80
+ }, function (_a) {
81
+ var hoverStyle = _a.hoverStyle;
82
+ return hoverStyle.borderTopLeftRadius;
83
+ }, function (_a) {
84
+ var hoverStyle = _a.hoverStyle;
85
+ return hoverStyle.borderTopRightRadius;
86
+ }, function (_a) {
87
+ var hoverStyle = _a.hoverStyle;
88
+ return hoverStyle.boxShadow;
89
+ }, function (_a) {
90
+ var cbStylePropsShadowSpecs = _a.cbStylePropsShadowSpecs, device = _a.device;
91
+ switch (device) {
92
+ case 'DESKTOP':
93
+ return cbStylePropsShadowSpecs['CB_STYLE_PROP_SHADOW_SPEC_OPACITY:HOVER'] / 100;
94
+ case 'MOBILE':
95
+ return (0, isNullOrUndefined_1.default)(cbStylePropsShadowSpecs['CB_STYLE_PROP_SHADOW_SPEC_OPACITY:MOBILE:HOVER'])
96
+ ? cbStylePropsShadowSpecs['CB_STYLE_PROP_SHADOW_SPEC_OPACITY:HOVER'] / 100
97
+ : Number(cbStylePropsShadowSpecs['CB_STYLE_PROP_SHADOW_SPEC_OPACITY:MOBILE:HOVER']) /
98
+ 100;
99
+ }
100
+ });
101
+ var templateObject_1, templateObject_2, templateObject_3;
@@ -35,8 +35,10 @@ function parseStyleColorToCSSProp(_a) {
35
35
  }
36
36
  exports.parseStyleColorToCSSProp = parseStyleColorToCSSProp;
37
37
  function getBtnColorStyles(value, cbName) {
38
- if ("" + value["CB_STYLE_PROP_" + cbName + "_SPEC_TYPE"] === 'NONE' ||
39
- value["CB_STYLE_PROP_" + cbName + "_SPEC_TYPE"] === 'SOLID') {
38
+ if (value["CB_STYLE_PROP_" + cbName + "_SPEC_TYPE"] === 'NONE') {
39
+ return { backgroundColor: 'none' };
40
+ }
41
+ if (value["CB_STYLE_PROP_" + cbName + "_SPEC_TYPE"] === 'SOLID') {
40
42
  var style = {
41
43
  backgroundColor: value["CB_STYLE_PROP_" + cbName + "_SPEC_COLOR"]
42
44
  };
@@ -15,7 +15,7 @@ exports.getTextCSSPropKey = exports.parseStyleTextToCSSProp = void 0;
15
15
  function parseStyleTextToCSSProp(_a) {
16
16
  var availableSpecCodes = _a.availableSpecCodes, props = _a.props, propKey = _a.propKey, device = _a.device;
17
17
  return availableSpecCodes.reduce(function (acc, currentKey) {
18
- var _a, _b, _c, _d;
18
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
19
19
  var stringifiedKey = currentKey.toString();
20
20
  var keyWithDevice = device === 'DESKTOP' ? currentKey : stringifiedKey + ":MOBILE" || currentKey;
21
21
  var keyWithHover = keyWithDevice.toString() + ":HOVER";
@@ -30,9 +30,29 @@ function parseStyleTextToCSSProp(_a) {
30
30
  hoverStyle: __assign(__assign({}, acc.hoverStyle), (_b = {}, _b[cssPropertyKey] = numHoverValue, _b))
31
31
  };
32
32
  }
33
+ if (cssPropertyKey === 'fontFamily') {
34
+ return {
35
+ style: __assign(__assign({}, acc.style), (_c = {}, _c[cssPropertyKey] = getFontName(String(value)), _c)),
36
+ hoverStyle: __assign(__assign({}, acc.hoverStyle), (_d = {}, _d[cssPropertyKey] = getFontName(String(hoverValue)), _d))
37
+ };
38
+ }
39
+ if (cssPropertyKey === 'letterSpacing') {
40
+ var numValue = (Math.abs(+value) - 100) * (+value > 0 ? 0.01 : -0.01) + "em";
41
+ var numHoverValue = (Math.abs(+hoverValue) - 100) * (+hoverValue > 0 ? 0.01 : -0.01) + "em";
42
+ return {
43
+ style: __assign(__assign({}, acc.style), (_e = {}, _e[cssPropertyKey] = numValue, _e)),
44
+ hoverStyle: __assign(__assign({}, acc.hoverStyle), (_f = {}, _f[cssPropertyKey] = numHoverValue, _f))
45
+ };
46
+ }
47
+ if (cssPropertyKey === 'fontSize') {
48
+ return {
49
+ style: __assign(__assign({}, acc.style), (_g = {}, _g[cssPropertyKey] = value + "px", _g)),
50
+ hoverStyle: __assign(__assign({}, acc.hoverStyle), (_h = {}, _h[cssPropertyKey] = hoverValue + "px", _h))
51
+ };
52
+ }
33
53
  return {
34
- style: __assign(__assign({}, acc.style), (_c = {}, _c[cssPropertyKey] = value, _c)),
35
- hoverStyle: __assign(__assign({}, acc.hoverStyle), (_d = {}, _d[cssPropertyKey] = hoverValue, _d))
54
+ style: __assign(__assign({}, acc.style), (_j = {}, _j[cssPropertyKey] = value, _j)),
55
+ hoverStyle: __assign(__assign({}, acc.hoverStyle), (_k = {}, _k[cssPropertyKey] = hoverValue, _k))
36
56
  };
37
57
  }, {
38
58
  style: {},
@@ -77,3 +97,15 @@ function getTextCSSPropKey(key, cbName) {
77
97
  }
78
98
  }
79
99
  exports.getTextCSSPropKey = getTextCSSPropKey;
100
+ function getFontName(value) {
101
+ switch (value) {
102
+ case 'SYSSANS':
103
+ return 'sans-serif';
104
+ case 'SYSSERIF':
105
+ return 'serif';
106
+ case 'PRETENDARD':
107
+ return 'Pretendard-Regular';
108
+ default:
109
+ return '';
110
+ }
111
+ }
@@ -1,3 +1,5 @@
1
+ export { parseCustomSectionPlacement } from './parseCustomSectionPlacement';
2
+ export { parsePlacement } from './parsePlacement';
1
3
  export { default as parseProperties } from './parseProperties';
2
4
  export { default as parseJsonProperties } from './parseJsonProperties';
3
5
  export { parseContentProperties } from './contentPropParsers';
@@ -3,7 +3,11 @@ 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.parseStyleProperties = exports.parseLayoutProperties = exports.parseEffectProperties = exports.parseContentProperties = exports.parseJsonProperties = exports.parseProperties = void 0;
6
+ exports.parseStyleProperties = exports.parseLayoutProperties = exports.parseEffectProperties = exports.parseContentProperties = exports.parseJsonProperties = exports.parseProperties = exports.parsePlacement = exports.parseCustomSectionPlacement = void 0;
7
+ var parseCustomSectionPlacement_1 = require("./parseCustomSectionPlacement");
8
+ Object.defineProperty(exports, "parseCustomSectionPlacement", { enumerable: true, get: function () { return parseCustomSectionPlacement_1.parseCustomSectionPlacement; } });
9
+ var parsePlacement_1 = require("./parsePlacement");
10
+ Object.defineProperty(exports, "parsePlacement", { enumerable: true, get: function () { return parsePlacement_1.parsePlacement; } });
7
11
  var parseProperties_1 = require("./parseProperties");
8
12
  Object.defineProperty(exports, "parseProperties", { enumerable: true, get: function () { return __importDefault(parseProperties_1).default; } });
9
13
  var parseJsonProperties_1 = require("./parseJsonProperties");
@@ -0,0 +1,20 @@
1
+ declare type Props = {
2
+ isMobile: boolean;
3
+ customSectionProps?: {
4
+ CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH: boolean;
5
+ 'CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH:MOBILE': boolean | undefined;
6
+ CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT: number;
7
+ 'CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT:MOBILE': number | undefined;
8
+ CB_PLACEMENT_PROP_SECTION_SPEC_ROWS: number;
9
+ 'CB_PLACEMENT_PROP_SECTION_SPEC_ROWS:MOBILE': number | undefined;
10
+ CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH: number;
11
+ 'CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH:MOBILE': number | undefined;
12
+ };
13
+ };
14
+ export declare function parseCustomSectionPlacement({ isMobile, customSectionProps }: Props): {
15
+ minHeight: number | undefined;
16
+ width: number | undefined;
17
+ rows: number | undefined;
18
+ isFullWidth: boolean | undefined;
19
+ };
20
+ export default parseCustomSectionPlacement;
@@ -0,0 +1,37 @@
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.parseCustomSectionPlacement = void 0;
7
+ var isNullOrUndefined_1 = __importDefault(require("./isNullOrUndefined"));
8
+ function parseCustomSectionPlacement(_a) {
9
+ var isMobile = _a.isMobile, customSectionProps = _a.customSectionProps;
10
+ return customSectionProps
11
+ ? {
12
+ minHeight: isMobile &&
13
+ !(0, isNullOrUndefined_1.default)(customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT:MOBILE'])
14
+ ? customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT:MOBILE']
15
+ : customSectionProps.CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT,
16
+ width: isMobile &&
17
+ !(0, isNullOrUndefined_1.default)(customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH:MOBILE'])
18
+ ? customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH:MOBILE']
19
+ : customSectionProps.CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH,
20
+ rows: isMobile &&
21
+ !(0, isNullOrUndefined_1.default)(customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_ROWS:MOBILE'])
22
+ ? customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_ROWS:MOBILE']
23
+ : customSectionProps.CB_PLACEMENT_PROP_SECTION_SPEC_ROWS,
24
+ isFullWidth: isMobile &&
25
+ !(0, isNullOrUndefined_1.default)(customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH:MOBILE'])
26
+ ? customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH:MOBILE']
27
+ : customSectionProps.CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH
28
+ }
29
+ : {
30
+ minHeight: 0,
31
+ width: 0,
32
+ rows: 0,
33
+ isFullWidth: true
34
+ };
35
+ }
36
+ exports.parseCustomSectionPlacement = parseCustomSectionPlacement;
37
+ exports.default = parseCustomSectionPlacement;
@@ -62,7 +62,7 @@ function valueGenerator(valueSet, device) {
62
62
  case 'SOLID':
63
63
  return "" + valueSet.CB_STYLE_PROP_BGCOLOR_SPEC_COLOR;
64
64
  case 'NONE':
65
- return 'transparent';
65
+ return 'NONE';
66
66
  default:
67
67
  return '';
68
68
  }
@@ -84,7 +84,7 @@ function valueGenerator(valueSet, device) {
84
84
  case 'SOLID':
85
85
  return "" + valueSet['CB_STYLE_PROP_BGCOLOR_SPEC_COLOR:MOBILE'];
86
86
  case 'NONE':
87
- return 'transparent';
87
+ return 'NONE';
88
88
  default:
89
89
  return '';
90
90
  }
@@ -20,8 +20,8 @@ function parseStylePropOpacity(namedProps, device) {
20
20
  var value = specs[baseKey];
21
21
  var hoverValue = specs[baseKey + ":HOVER"];
22
22
  return {
23
- style: __assign(__assign({}, acc.style), (_a = {}, _a[cssPropertyKey] = value, _a)),
24
- hoverStyle: __assign(__assign({}, acc.hoverStyle), (_b = {}, _b[cssPropertyKey] = hoverValue, _b))
23
+ style: __assign(__assign({}, acc.style), (_a = {}, _a[cssPropertyKey] = (value || 0) / 100, _a)),
24
+ hoverStyle: __assign(__assign({}, acc.hoverStyle), (_b = {}, _b[cssPropertyKey] = (hoverValue || 0) / 100, _b))
25
25
  };
26
26
  }, {
27
27
  style: {},
@@ -44,9 +44,9 @@ exports.default = parseStylePropShadow;
44
44
  function valueGenerator(valueSet) {
45
45
  switch (valueSet.CB_STYLE_PROP_SHADOW_SPEC_TYPE) {
46
46
  case 'INSET':
47
- return "inset " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_Y + "px " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_X + "px " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_BLUR + "px " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_SPREAD + "px " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_COLOR;
47
+ return "inset " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_X + "px " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_Y + "px " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_BLUR + "px " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_SPREAD + "px " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_COLOR;
48
48
  case 'OUTSET':
49
- return valueSet.CB_STYLE_PROP_SHADOW_SPEC_Y + "px " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_X + "px " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_BLUR + "px " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_SPREAD + "px " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_COLOR;
49
+ return valueSet.CB_STYLE_PROP_SHADOW_SPEC_X + "px " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_Y + "px " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_BLUR + "px " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_SPREAD + "px " + valueSet.CB_STYLE_PROP_SHADOW_SPEC_COLOR;
50
50
  case 'NONE':
51
51
  return '';
52
52
  default: