pds-dev-kit-web-test 2.5.323 → 2.5.325

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 (68) hide show
  1. package/dist/src/common/hooks/useTooltip.js +1 -1
  2. package/dist/src/common/utils/SystemUIPositionGenerator/hoverTypeSystemUICssGenerator.js +1 -1
  3. package/dist/src/desktop/components/BasicButtonGroup/BasicButtonGroup.js +1 -1
  4. package/dist/src/sub/DynamicLayout/CompositionEditor/CompositionEditor.d.ts +20 -0
  5. package/dist/src/sub/DynamicLayout/CompositionEditor/CompositionEditor.js +1116 -0
  6. package/dist/src/sub/DynamicLayout/CompositionRenderer/ComponentBlockMatcher.js +1 -1
  7. package/dist/src/sub/DynamicLayout/CompositionRenderer/Composition.d.ts +4 -2
  8. package/dist/src/sub/DynamicLayout/CompositionRenderer/Composition.js +32 -36
  9. package/dist/src/sub/DynamicLayout/components/EditModeSectionMatcher/SectionBox.js +1 -4
  10. package/dist/src/sub/DynamicLayout/components/Section/CustomSection.d.ts +2 -2
  11. package/dist/src/sub/DynamicLayout/components/Section/sectionContext.d.ts +2 -2
  12. package/dist/src/sub/DynamicLayout/compositionActionTypes.d.ts +139 -0
  13. package/dist/src/sub/DynamicLayout/compositionActionTypes.js +2 -0
  14. package/dist/src/sub/DynamicLayout/mock_composition.d.ts +3 -0
  15. package/dist/src/sub/DynamicLayout/mock_composition.js +755 -0
  16. package/dist/src/sub/DynamicLayout/mock_contentsCarousel.d.ts +2 -0
  17. package/dist/src/sub/DynamicLayout/mock_contentsCarousel.js +326 -0
  18. package/dist/src/sub/DynamicLayout/mock_slideBanner.d.ts +2 -0
  19. package/dist/src/sub/DynamicLayout/mock_slideBanner.js +318 -0
  20. package/dist/src/sub/DynamicLayout/mocks.d.ts +5 -1
  21. package/dist/src/sub/DynamicLayout/mocks.js +34 -10
  22. package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +3 -2
  23. package/dist/src/sub/DynamicLayout/sections/CustomSection/FlexGridItem.js +8 -2
  24. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.js +8 -3
  25. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +1 -21
  26. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.d.ts +4 -4
  27. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.js +144 -2
  28. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarouselCore.d.ts +17 -0
  29. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarouselCore.js +39 -0
  30. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigation.d.ts +31 -0
  31. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomNavigation.js +168 -0
  32. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomPagination.d.ts +26 -0
  33. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomPagination.js +185 -0
  34. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomProgressbar.d.ts +19 -0
  35. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/components/CustomProgressbar.js +73 -0
  36. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/contentsCarouselUtils.d.ts +50 -0
  37. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/contentsCarouselUtils.js +919 -0
  38. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/index.d.ts +1 -0
  39. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/index.js +8 -0
  40. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/types.d.ts +90 -0
  41. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/types.js +2 -0
  42. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBanner.d.ts +8 -0
  43. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBanner.js +143 -0
  44. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBannerCore.d.ts +15 -0
  45. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/SlideBannerCore.js +39 -0
  46. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigation.d.ts +31 -0
  47. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomNavigation.js +168 -0
  48. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomPagination.d.ts +26 -0
  49. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomPagination.js +185 -0
  50. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomProgressbar.d.ts +19 -0
  51. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomProgressbar.js +73 -0
  52. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/index.d.ts +1 -0
  53. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/index.js +8 -0
  54. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/slideBannerUtils.d.ts +48 -0
  55. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/slideBannerUtils.js +855 -0
  56. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/types.d.ts +80 -0
  57. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/types.js +2 -0
  58. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.d.ts +27 -0
  59. package/dist/src/sub/DynamicLayout/sections/CustomSection/types.d.ts +16 -7
  60. package/dist/src/sub/DynamicLayout/sections/CustomSection/types.js +2 -1
  61. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseCompositionPlacement.d.ts +20 -0
  62. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseCompositionPlacement.js +22 -0
  63. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseJsonProperties.d.ts +2 -2
  64. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseProperties.d.ts +2 -2
  65. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +33 -1
  66. package/dist/src/sub/DynamicLayout/types.d.ts +29 -2
  67. package/package.json +3 -3
  68. package/release-note.md +3 -3
@@ -46,7 +46,7 @@ function ComponentBlockMatcher(_a) {
46
46
  return (0, jsx_runtime_1.jsx)(Youtube_1.Youtube, __assign({}, propsWithValue, { index: index }));
47
47
  case types_1.CB_ALL_CODES.CB_EMBED:
48
48
  return (0, jsx_runtime_1.jsx)(Embed_1.default, __assign({}, propsWithValue, { index: index }));
49
- case types_1.CB_ALL_CODES.CB_CONTENTS_CAROUSEL: {
49
+ case types_1.CB_ALL_CODES.CB_CONTENTSCAROUSEL: {
50
50
  return (0, jsx_runtime_1.jsx)("div", { children: "NOT SUPPORTED NESTED CAROUSEL" });
51
51
  }
52
52
  default:
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
- import type { ISection } from '../types';
2
+ import type { IComposition } from '../types';
3
3
  import type { Layout } from 'publ-echo/dist/lib/GridLayoutEditor/types';
4
4
  export type LayoutsType = {
5
5
  sm: Layout;
6
6
  lg: Layout;
7
7
  };
8
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<ISection & React.RefAttributes<unknown>>>;
8
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<IComposition & {
9
+ device?: "DESKTOP" | "MOBILE" | undefined;
10
+ } & React.RefAttributes<unknown>>>;
9
11
  export default _default;
@@ -50,33 +50,31 @@ var styled_components_1 = __importDefault(require("styled-components"));
50
50
  var components_1 = require("../components");
51
51
  var gleStyles_1 = require("../gleStyles");
52
52
  var useResizableObserver_1 = require("../sections/CustomSection/hooks/useResizableObserver");
53
- var util_1 = require("../sections/CustomSection/util");
53
+ require("../sections/CustomSection/util");
54
54
  var parseSectionPadding_1 = __importDefault(require("../sections/CustomSection/util/layoutPropParsers/parseSectionPadding"));
55
+ var parseCompositionPlacement_1 = __importDefault(require("../sections/CustomSection/util/parseCompositionPlacement"));
55
56
  var FlexGridItem_1 = __importDefault(require("./FlexGridItem"));
56
- var GRID_CELL_MIN = 24;
57
- var DESKTOP_GRID_COLS = 24;
58
- var MOBILE_GRID_COLS = 8;
59
- var GLE_MIN_WIDTH_DESKTOP_PX = "".concat(GRID_CELL_MIN * DESKTOP_GRID_COLS, "px");
60
- var GLE_MIN_WIDTH_MOBILE_PX = "".concat(GRID_CELL_MIN * MOBILE_GRID_COLS, "px");
61
57
  var Composition = (0, react_1.forwardRef)(function CustomSection(props, ref) {
62
- var _a;
63
- var _b = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _b.device, editingSectionId = _b.editingSectionId, mode = _b.mode, shortcutKeyMode = _b.shortcutKeyMode, sectionActionHandler = _b.sectionActionHandler;
58
+ var _a, _b, _c, _d, _e, _f, _g;
59
+ var _h = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext),
60
+ // NOTE: 이것을 사용해야함
61
+ contextDevice = _h.device, editingSectionId = _h.editingSectionId, mode = _h.mode, shortcutKeyMode = _h.shortcutKeyMode, sectionActionHandler = _h.sectionActionHandler;
64
62
  var componentBlocks = props.componentBlocks, jsonProperties = props.jsonProperties;
65
- var _c = jsonProperties, _d = _c.data, CB_PLACEMENT_PROP_SECTION = _d.CB_PLACEMENT_PROP_SECTION, CB_LAYOUT_PROP_PADDING = _d.CB_LAYOUT_PROP_PADDING, zOrders = _c.zOrders;
63
+ // NOTE: 임시. 테스트용.
64
+ var device = (_b = (_a = props.device) !== null && _a !== void 0 ? _a : contextDevice) !== null && _b !== void 0 ? _b : 'DESKTOP';
65
+ var isMobile = device === 'MOBILE';
66
+ var isEditMode = mode === 'EDIT';
67
+ var _j = jsonProperties, _k = _j.data, CB_PLACEMENT_PROP_COMPOSITION = _k.CB_PLACEMENT_PROP_COMPOSITION, CB_LAYOUT_PROP_PADDING = _k.CB_LAYOUT_PROP_PADDING, zOrders = _j.zOrders;
68
+ var colsDesktop = (_c = CB_PLACEMENT_PROP_COMPOSITION.CB_PLACEMENT_PROP_COMPOSITION_SPEC_COLS) !== null && _c !== void 0 ? _c : 24;
69
+ var colsMobile = (_d = CB_PLACEMENT_PROP_COMPOSITION['CB_PLACEMENT_PROP_COMPOSITION_SPEC_COLS:MOBILE']) !== null && _d !== void 0 ? _d : 8;
70
+ var rowsDesktop = (_e = CB_PLACEMENT_PROP_COMPOSITION.CB_PLACEMENT_PROP_COMPOSITION_SPEC_ROWS) !== null && _e !== void 0 ? _e : 26;
71
+ var rowsMobile = (_f = CB_PLACEMENT_PROP_COMPOSITION['CB_PLACEMENT_PROP_COMPOSITION_SPEC_ROWS:MOBILE']) !== null && _f !== void 0 ? _f : 26;
72
+ var rows = isMobile ? rowsMobile : rowsDesktop;
73
+ var cols = isMobile ? colsMobile : colsDesktop;
66
74
  var containerRef = (0, react_1.useRef)(null);
67
75
  var size = (0, useResizableObserver_1.useResizeObserver)({ ref: containerRef, box: 'border-box' });
68
- var _e = (0, react_1.useState)(null), selectedCB = _e[0], setSelectedCB = _e[1];
76
+ var _l = (0, react_1.useState)(null), selectedCB = _l[0], setSelectedCB = _l[1];
69
77
  var gleRef = (0, react_1.useRef)(null);
70
- var isMobile = device === 'MOBILE';
71
- var isEditMode = mode === 'EDIT';
72
- // const layoutByDevice = device === 'DESKTOP' ? 'lg' : 'sm';
73
- // const [layouts] = useState<LayoutsType>(() => {
74
- // const { lg, sm } = parsePlacement(componentBlocks ?? []);
75
- // return {
76
- // lg,
77
- // sm
78
- // };
79
- // });
80
78
  (0, react_1.useEffect)(function () {
81
79
  if (editingSectionId !== props.id) {
82
80
  setSelectedCB(null);
@@ -124,14 +122,15 @@ var Composition = (0, react_1.forwardRef)(function CustomSection(props, ref) {
124
122
  setSelectedCB('BULK');
125
123
  }
126
124
  }, [selectedCB, shortcutKeyMode, sectionActionHandler, setSelectedCB]);
127
- var _f = (0, util_1.parseCustomSectionPlacement)({
125
+ var _m = (0, parseCompositionPlacement_1.default)({
128
126
  isMobile: isMobile,
129
- customSectionProps: CB_PLACEMENT_PROP_SECTION
130
- }), width = _f.width, minHeight = _f.minHeight, isFullWidth = _f.isFullWidth;
127
+ compositionProps: CB_PLACEMENT_PROP_COMPOSITION
128
+ }), minHeight = _m.minHeight, isFullWidth = _m.isFullWidth;
129
+ var canvasWidth = 50 * cols;
131
130
  var customSectionStyles = {
132
131
  minHeight: "".concat(minHeight, "vh"),
133
- width: '100%',
134
- maxWidth: isFullWidth ? '' : "".concat(width, "px")
132
+ width: "100%",
133
+ maxWidth: isFullWidth ? undefined : "".concat(canvasWidth, "px")
135
134
  };
136
135
  var onClickSection = function () {
137
136
  if (!isEditMode) {
@@ -147,18 +146,15 @@ var Composition = (0, react_1.forwardRef)(function CustomSection(props, ref) {
147
146
  });
148
147
  };
149
148
  var padding = (0, parseSectionPadding_1.default)(CB_LAYOUT_PROP_PADDING, device);
150
- var sectionRow = CB_PLACEMENT_PROP_SECTION[device === 'DESKTOP'
151
- ? 'CB_PLACEMENT_PROP_SECTION_SPEC_ROWS'
152
- : 'CB_PLACEMENT_PROP_SECTION_SPEC_ROWS:MOBILE'];
153
149
  var rowHeight = (function () {
154
150
  if (!size.width) {
155
151
  return 50;
156
152
  }
157
153
  if (device === 'MOBILE') {
158
- var cellWidth_1 = size.width / MOBILE_GRID_COLS;
154
+ var cellWidth_1 = size.width / cols;
159
155
  return cellWidth_1 * 0.56;
160
156
  }
161
- var cellWidth = size.width / DESKTOP_GRID_COLS;
157
+ var cellWidth = size.width / cols;
162
158
  return cellWidth * 0.56;
163
159
  })();
164
160
  var baseFontSize = (function () {
@@ -166,7 +162,7 @@ var Composition = (0, react_1.forwardRef)(function CustomSection(props, ref) {
166
162
  if (!size.width) {
167
163
  return 16;
168
164
  }
169
- var responsiveFontMode = !!((_b = (_a = props.jsonProperties) === null || _a === void 0 ? void 0 : _a.data.CB_CONTENT_PROP_SECTION) === null || _b === void 0 ? void 0 : _b.CB_CONTENT_PROP_SECTION_SPEC_VARIABLEROOTFONTSIZE);
165
+ var responsiveFontMode = !!((_b = (_a = props.jsonProperties) === null || _a === void 0 ? void 0 : _a.data.CB_CONTENT_PROP_COMPOSITION) === null || _b === void 0 ? void 0 : _b.CB_CONTENT_PROP_COMPOSITION_SPEC_VARIABLEROOTFONTSIZE);
170
166
  if (device === 'MOBILE') {
171
167
  if (responsiveFontMode) {
172
168
  return size.width * 0.0421;
@@ -184,7 +180,7 @@ var Composition = (0, react_1.forwardRef)(function CustomSection(props, ref) {
184
180
  }
185
181
  return 16;
186
182
  })();
187
- return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(gleStyles_1.S_gleStyles, __assign({ style: { width: '100%', height: '100%' } }, { children: (0, jsx_runtime_1.jsx)(S_SectionWrapper, __assign({ ref: gleRef, "x-dlayout-section-type": "NO_NAME", onClick: onClickSection, style: {
183
+ return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(gleStyles_1.S_gleStyles, __assign({ style: { width: '100%', height: '100%' } }, { children: (0, jsx_runtime_1.jsx)(S_COMPOSITIONWrapper, __assign({ ref: gleRef, "x-dlayout-section-type": "NO_NAME", onClick: onClickSection, style: {
188
184
  width: '100%',
189
185
  height: '100%'
190
186
  } }, { children: (0, jsx_runtime_1.jsx)(components_1.CustomSection, __assign({}, props, { isMobile: isMobile, overrideStyles: {
@@ -195,18 +191,18 @@ var Composition = (0, react_1.forwardRef)(function CustomSection(props, ref) {
195
191
  paddingLeft: padding.left,
196
192
  width: '100%',
197
193
  height: '100%'
198
- } }, { children: (0, jsx_runtime_1.jsx)(GridContainer, __assign({ ref: containerRef, cols: isMobile ? 8 : 24, rowHeight: rowHeight, sectionRow: sectionRow !== null && sectionRow !== void 0 ? sectionRow : 0, style: {
194
+ } }, { children: (0, jsx_runtime_1.jsx)(GridContainer, __assign({ ref: containerRef, cols: cols, rowHeight: rowHeight, sectionRow: rows, style: {
199
195
  width: customSectionStyles.width,
200
196
  maxWidth: customSectionStyles.maxWidth,
201
- minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
197
+ // minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
202
198
  fontSize: "".concat(baseFontSize, "px")
203
- } }, { children: (_a = props.componentBlocks) === null || _a === void 0 ? void 0 : _a.map(function (cb, index) {
199
+ } }, { children: (_g = props.componentBlocks) === null || _g === void 0 ? void 0 : _g.map(function (cb, index) {
204
200
  var _a;
205
201
  return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(FlexGridItem_1.default, { cb: cb, index: index, device: device, rowHeight: rowHeight, zIndex: (_a = zOrders === null || zOrders === void 0 ? void 0 : zOrders[device === 'DESKTOP' ? 'desktop' : 'mobile'][cb.id]) !== null && _a !== void 0 ? _a : 0 }) }, cb.id));
206
202
  }) })) })) })) })) }));
207
203
  });
208
204
  var GridContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: grid; /* Space between grid items */\n gap: 10px;\n grid-auto-rows: minmax(", ", auto);\n grid-template-columns: repeat(", ", 1fr);\n grid-template-rows: repeat(", ", minmax(", ", 1fr));\n height: 100%;\n padding: 10px 10px;\n width: 100%;\n\n * {\n box-sizing: border-box;\n }\n"], ["\n display: grid; /* Space between grid items */\n gap: 10px;\n grid-auto-rows: minmax(", ", auto);\n grid-template-columns: repeat(", ", 1fr);\n grid-template-rows: repeat(", ", minmax(", ", 1fr));\n height: 100%;\n padding: 10px 10px;\n width: 100%;\n\n * {\n box-sizing: border-box;\n }\n"])), function (props) { return "".concat(props.rowHeight, "px"); }, function (props) { return props.cols; }, function (props) { return props.sectionRow; }, function (props) { return "".concat(0, "px"); });
209
- var S_SectionWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
205
+ var S_COMPOSITIONWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
210
206
  exports.default = react_1.default.memo(Composition);
211
207
  function getDefensiveFontSize(device, width) {
212
208
  if (device === 'MOBILE') {
@@ -81,12 +81,9 @@ var TopRightAbsoluteBox = styled_components_1.default.div(templateObject_1 || (t
81
81
  var theme = _a.theme;
82
82
  return theme.ui_editor_preview_editing;
83
83
  });
84
- var S_SectionBox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: ", ";\n position: relative;\n z-index: ", ";\n"], ["\n height: ", ";\n position: relative;\n z-index: ", ";\n"])), function (_a) {
84
+ var S_SectionBox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: ", ";\n position: relative;\n"], ["\n height: ", ";\n position: relative;\n"])), function (_a) {
85
85
  var isIframeSection = _a.isIframeSection;
86
86
  return (isIframeSection ? '100%' : 'auto');
87
- }, function (_a) {
88
- var isEditing = _a.isEditing;
89
- return (isEditing ? 3 : 1);
90
87
  });
91
88
  var DimmedEditOverlay = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n animation: ", ";\n background-color: ", ";\n bottom: 0;\n cursor: pointer;\n display: flex;\n justify-content: center;\n left: 0;\n\n opacity: ", ";\n\n position: absolute;\n right: 0;\n top: 0;\n transition: opacity 0.2s ease-out;\n z-index: 10;\n\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n\n 50% {\n opacity: 0.6;\n }\n\n 100% {\n opacity: 0;\n }\n }\n"], ["\n align-items: center;\n animation: ", ";\n background-color: ", ";\n bottom: 0;\n cursor: pointer;\n display: flex;\n justify-content: center;\n left: 0;\n\n opacity: ", ";\n\n position: absolute;\n right: 0;\n top: 0;\n transition: opacity 0.2s ease-out;\n z-index: 10;\n\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n\n 50% {\n opacity: 0.6;\n }\n\n 100% {\n opacity: 0;\n }\n }\n"])), function (_a) {
92
89
  var fadeOut = _a.fadeOut;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { CSSProperties } from 'styled-components';
3
- import type { ISection } from '../../types';
4
- type SectionPropTypes = ISection & {
3
+ import type { ISection, IComposition } from '../../types';
4
+ type SectionPropTypes = (ISection | IComposition) & {
5
5
  children?: React.ReactNode;
6
6
  } & {
7
7
  overrideStyles?: CSSProperties;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import type { ISection } from '../../types';
3
- export declare const sectionContext: import("react").Context<ISection | null>;
2
+ import type { IComposition, ISection } from '../../types';
3
+ export declare const sectionContext: import("react").Context<ISection | IComposition | null>;
@@ -0,0 +1,139 @@
1
+ /// <reference types="react" />
2
+ import type { Layout } from 'publ-echo/dist/lib';
3
+ import type { ResizeEventType } from 'publ-echo/dist/lib/GridItem/types';
4
+ import type { ComponentBlock, GroupBlock } from 'publ-echo/dist/lib/GridLayoutEditor/group';
5
+ import type { LayoutItem, Layouts } from 'publ-echo/dist/lib/GridLayoutEditor/types';
6
+ export type TypeOfCompositionAction = ActionMap<ActionHandlerPayload>[keyof ActionMap<ActionHandlerPayload>];
7
+ export type PayloadCBType = {
8
+ type: ComponentBlock['type'];
9
+ blockId: string;
10
+ cbId: number;
11
+ workDir: string;
12
+ };
13
+ export type PayloadGBType = {
14
+ type: GroupBlock['type'];
15
+ blockId: string;
16
+ childrenBlockIds: string[];
17
+ childrenCBIds: number[];
18
+ workDir: string;
19
+ };
20
+ export type PayloadBulkType = {
21
+ type: 'BULK';
22
+ blockId: 'BULK';
23
+ childrenBlockIds: string[];
24
+ childrenCBIds: number[];
25
+ workDir: string;
26
+ groupDisabled: boolean;
27
+ };
28
+ export type BlockPayloadType = PayloadCBType | PayloadGBType | PayloadBulkType;
29
+ type ActionHandlerPayload = {
30
+ '@COMPOSITION/CB_DRAG_START': {
31
+ layout: Layout;
32
+ prev?: LayoutItem;
33
+ item?: LayoutItem;
34
+ placeholder?: LayoutItem;
35
+ e?: ResizeEventType;
36
+ node?: HTMLElement;
37
+ };
38
+ '@COMPOSITION/CB_DRAG_STOP': {
39
+ layout: Layout;
40
+ prev?: LayoutItem;
41
+ item?: LayoutItem;
42
+ placeholder?: LayoutItem;
43
+ e?: ResizeEventType;
44
+ node?: HTMLElement;
45
+ blockId: string;
46
+ workDir: string;
47
+ };
48
+ '@COMPOSITION/CB_RESIZE_STOP': {
49
+ layout: Layout;
50
+ prev?: LayoutItem;
51
+ item?: LayoutItem;
52
+ placeholder?: LayoutItem;
53
+ e?: ResizeEventType;
54
+ node?: HTMLElement;
55
+ blockId: string;
56
+ workDir: string;
57
+ };
58
+ '@COMPOSITION/CB_AUTO_FIT_CONTENT': {
59
+ layout: Layout;
60
+ prev?: LayoutItem;
61
+ item?: LayoutItem;
62
+ placeholder?: LayoutItem;
63
+ e?: ResizeEventType;
64
+ node?: HTMLElement;
65
+ details: {
66
+ hadPaddingChanged: boolean;
67
+ };
68
+ blockId: string;
69
+ workDir: string;
70
+ };
71
+ '@COMPOSITION/PLACEMENT_CHANGED': {
72
+ layout: Layout;
73
+ layouts: Layouts;
74
+ };
75
+ '@COMPOSITION/BLOCK_CLICKED': {
76
+ block: BlockPayloadType;
77
+ };
78
+ '@COMPOSITION/CB_RIGHT_CLICKED': {
79
+ e: React.MouseEvent;
80
+ block: BlockPayloadType;
81
+ };
82
+ '@COMPOSITION/SECTION_CLICKED': {
83
+ sectionId: number;
84
+ };
85
+ '@COMPOSITION/SECTION_RIGHT_CLICKED': {
86
+ sectionId: number;
87
+ e: React.MouseEvent;
88
+ };
89
+ '@COMPOSITION/GROUP_RIGHT_CLICKED': {
90
+ e: React.MouseEvent;
91
+ block: PayloadGBType;
92
+ isEditingGroup: boolean;
93
+ };
94
+ '@COMPOSITION/BULK_RIGHT_CLICKED': {
95
+ e: React.MouseEvent;
96
+ block: PayloadBulkType;
97
+ };
98
+ '@COMPOSITION/BULK_CREATED': {
99
+ message: string;
100
+ data: LayoutItem;
101
+ };
102
+ '@COMPOSITION/BULK_DISMISSED': {
103
+ message: string;
104
+ editingGroupBlock: string;
105
+ };
106
+ '@COMPOSITION/COLLISION_NOT_FOUND': {
107
+ message: string;
108
+ };
109
+ '@COMPOSITION/ESCAPE_ONE_FROM_BULK': {
110
+ id: string;
111
+ };
112
+ '@COMPOSITION/BULK_DRAG_STOP': {
113
+ updatedBlocks: UpdatedBlock[];
114
+ };
115
+ '@COMPOSITION/GROUP_DRAG_STOP': {
116
+ updatedBlocks: UpdatedBlock[];
117
+ workDir: string;
118
+ };
119
+ '@COMPOSITION/WORKDIR_CHANGED': {
120
+ workDir: string;
121
+ };
122
+ };
123
+ export type UpdatedBlock = {
124
+ blockId: string;
125
+ cbId: number;
126
+ x: number;
127
+ y: number;
128
+ };
129
+ type ActionMap<M extends {
130
+ [index: string]: any;
131
+ }> = {
132
+ [Key in keyof M]: M[Key] extends undefined ? {
133
+ type: Key;
134
+ } : {
135
+ type: Key;
136
+ payload: M[Key];
137
+ };
138
+ };
139
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import type { IComposition } from './types';
2
+ export declare const sampleMockComposition1: IComposition;
3
+ export declare const sampleMockComposition2: IComposition;