pds-dev-kit-web-test 0.3.38 → 0.3.40

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.
@@ -30,7 +30,7 @@ function CustomSectionBackground(_a) {
30
30
  var context = (0, react_1.useContext)(sectionContext_1.sectionContext);
31
31
  var id = context.id, jsonProperties = context.jsonProperties;
32
32
  var backgroundRef = (0, react_1.useRef)(null);
33
- var _c = jsonProperties || {}, CB_STYLE_PROP_BGOVERLAY = _c.CB_STYLE_PROP_BGOVERLAY, CB_STYLE_PROP_BGMEDIA = _c.CB_STYLE_PROP_BGMEDIA;
33
+ var _c = jsonProperties.data, CB_STYLE_PROP_BGOVERLAY = _c.CB_STYLE_PROP_BGOVERLAY, CB_STYLE_PROP_BGMEDIA = _c.CB_STYLE_PROP_BGMEDIA;
34
34
  var _d = (0, util_1.parseJsonProperties)(jsonProperties, isMobile ? 'MOBILE' : 'DESKTOP'), style = _d.style, overlayStyle = _d.overlayStyle, effect = _d.effect;
35
35
  var isOverlay = getIsOverlay(isMobile, CB_STYLE_PROP_BGOVERLAY);
36
36
  var isBgMedia = getIsBgMedia(isMobile, CB_STYLE_PROP_BGMEDIA);
@@ -75,7 +75,7 @@ var GLE_MIN_WIDTH_MOBILE_PX = "".concat(GRID_CELL_MIN * MOBILE_GRID_COLS, "px");
75
75
  function CustomSection(props) {
76
76
  var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, editingSectionId = _a.editingSectionId, mode = _a.mode, sectionActionHandler = _a.sectionActionHandler, shortcutKeyMode = _a.shortcutKeyMode;
77
77
  var componentBlocks = props.componentBlocks, jsonProperties = props.jsonProperties;
78
- var _b = jsonProperties, CB_PLACEMENT_PROP_SECTION = _b.CB_PLACEMENT_PROP_SECTION, CB_LAYOUT_PROP_PADDING = _b.CB_LAYOUT_PROP_PADDING, CB_CONTENT_PROP_SECTION = _b.CB_CONTENT_PROP_SECTION;
78
+ var _b = jsonProperties.data, CB_PLACEMENT_PROP_SECTION = _b.CB_PLACEMENT_PROP_SECTION, CB_LAYOUT_PROP_PADDING = _b.CB_LAYOUT_PROP_PADDING, CB_CONTENT_PROP_SECTION = _b.CB_CONTENT_PROP_SECTION;
79
79
  var _c = (0, react_1.useState)(null), selectedCB = _c[0], setSelectedCB = _c[1];
80
80
  var gleRef = (0, react_1.useRef)(null);
81
81
  var _d = (0, react_1.useState)(50), rowHeight = _d[0], setRowHeight = _d[1];
@@ -128,11 +128,19 @@ function CustomSection(props) {
128
128
  if (props.id !== editingSectionId) {
129
129
  return;
130
130
  }
131
+ if (!shortcutKeyMode) {
132
+ return;
133
+ }
131
134
  if (shortcutKeyMode === 'SELECT_ALL') {
132
135
  makeAllInOneGroup();
133
136
  return;
134
137
  }
135
- }, [shortcutKeyMode]);
138
+ if (shortcutKeyMode === 'MANUAL_BULK_BREAK') {
139
+ breakGroupCB();
140
+ setSelectedCB(null);
141
+ return;
142
+ }
143
+ }, [shortcutKeyMode, setSelectedCB, breakGroupCB]);
136
144
  (0, react_1.useLayoutEffect)(function () {
137
145
  if (props.id !== editingSectionId) {
138
146
  return;
@@ -253,6 +261,10 @@ function CustomSection(props) {
253
261
  var numberId = Number((_a = props.item) === null || _a === void 0 ? void 0 : _a.i);
254
262
  var isIdNumber = !Number.isNaN(numberId);
255
263
  if (hasLayoutPlacementChanged(item, prev)) {
264
+ setTimeout(function () {
265
+ // NOTE: to fix.
266
+ breakGroupCB();
267
+ }, 100);
256
268
  return;
257
269
  }
258
270
  if (isIdNumber) {
@@ -360,9 +372,9 @@ function CustomSection(props) {
360
372
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
361
373
  }
362
374
  var cbCopy = (0, deepCopy_1.default)(matchedCB);
363
- cbCopy.properties.CB_EFFECT_PROP_ENTANIM.CB_EFFECT_PROP_ENTANIM_SPEC_TYPE =
375
+ cbCopy.jsonProperties.data.CB_EFFECT_PROP_ENTANIM.CB_EFFECT_PROP_ENTANIM_SPEC_TYPE =
364
376
  'NONE';
365
- cbCopy.properties.CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] = 'NONE';
377
+ cbCopy.jsonProperties.data.CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] = 'NONE';
366
378
  return ((0, jsx_runtime_1.jsx)("div", __assign({ className: "cb-box-in-group", onClick: function (e) {
367
379
  e.stopPropagation();
368
380
  clickGroupedOne(matchedCB.id, array);
@@ -27,8 +27,8 @@ var Twitter_1 = __importDefault(require("./componentBlocks/Twitter/Twitter"));
27
27
  var Youtube_1 = require("./componentBlocks/Youtube");
28
28
  function ComponentBlockMatcher(_a) {
29
29
  var cbProps = _a.cbProps, device = _a.device, index = _a.index;
30
- var componentBlockCode = cbProps.componentBlockCode, properties = cbProps.properties;
31
- var propsWithValue = device === 'MOBILE' ? (0, newUtils_1.replaceUndefinedValues)(properties) : properties;
30
+ var componentBlockCode = cbProps.componentBlockCode, data = cbProps.jsonProperties.data;
31
+ var propsWithValue = device === 'MOBILE' ? (0, newUtils_1.replaceUndefinedValues)(data) : data;
32
32
  switch (componentBlockCode) {
33
33
  case types_1.CB_ALL_CODES.CB_BTN:
34
34
  return (0, jsx_runtime_1.jsx)(Button_1.default, __assign({}, propsWithValue, { index: index }));
@@ -20,31 +20,45 @@ export type GroupCustomSectionType = {
20
20
  export type AllCBProperties = CB_TEXT_PROPERTIES_TYPE | CB_BTN_PROPERTIES_TYPE | CB_RICHTEXT_PROPERTIES_TYPE | CB_RICHTEXT_PROPERTIES_TYPE | CB_DIVIDER_PROPERTIES_TYPE | CB_YOUTUBE_PROPERTIES_TYPE | CB_IMG_PROPERTIES_TYPE | CB_TWITTER_PROPERTIES_TYPE;
21
21
  export type CB_TEXT_TYPE = GeneralCustomSectionType & {
22
22
  componentBlockCode: CB_ALL_CODES.CB_TEXT;
23
- properties: CB_TEXT_PROPERTIES_TYPE;
23
+ jsonProperties: {
24
+ data: CB_TEXT_PROPERTIES_TYPE;
25
+ };
24
26
  };
25
27
  export type CB_BTN_TYPE = GeneralCustomSectionType & {
26
28
  componentBlockCode: CB_ALL_CODES.CB_BTN;
27
- properties: CB_BTN_PROPERTIES_TYPE;
29
+ jsonProperties: {
30
+ data: CB_BTN_PROPERTIES_TYPE;
31
+ };
28
32
  };
29
33
  export type CB_RICHTEXT = GeneralCustomSectionType & {
30
34
  componentBlockCode: CB_ALL_CODES.CB_RICHTEXT;
31
- properties: CB_RICHTEXT_PROPERTIES_TYPE;
35
+ jsonProperties: {
36
+ data: CB_RICHTEXT_PROPERTIES_TYPE;
37
+ };
32
38
  };
33
39
  export type CB_DIVIDER = GeneralCustomSectionType & {
34
40
  componentBlockCode: CB_ALL_CODES.CB_DIVIDER;
35
- properties: CB_DIVIDER_PROPERTIES_TYPE;
41
+ jsonProperties: {
42
+ data: CB_DIVIDER_PROPERTIES_TYPE;
43
+ };
36
44
  };
37
45
  export type CB_IMG = GeneralCustomSectionType & {
38
46
  componentBlockCode: CB_ALL_CODES.CB_IMG;
39
- properties: CB_IMG_PROPERTIES_TYPE;
47
+ jsonProperties: {
48
+ data: CB_IMG_PROPERTIES_TYPE;
49
+ };
40
50
  };
41
51
  export type CB_YOUTUBE = GeneralCustomSectionType & {
42
52
  componentBlockCode: CB_ALL_CODES.CB_YOUTUBE;
43
- properties: CB_YOUTUBE_PROPERTIES_TYPE;
53
+ jsonProperties: {
54
+ data: CB_YOUTUBE_PROPERTIES_TYPE;
55
+ };
44
56
  };
45
57
  export type CB_TWITTER = GeneralCustomSectionType & {
46
58
  componentBlockCode: CB_ALL_CODES.CB_TWITTER;
47
- properties: CB_TWITTER_PROPERTIES_TYPE;
59
+ jsonProperties: {
60
+ data: CB_TWITTER_PROPERTIES_TYPE;
61
+ };
48
62
  };
49
63
  export declare enum CB_ALL_CODES {
50
64
  CB_TEXT = "CB_TEXT",
@@ -12,8 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.parsePlacement = void 0;
13
13
  function parsePlacement(components) {
14
14
  return components.reduce(function (acc, cur) {
15
- var id = cur.id, properties = cur.properties;
16
- var _a = parsePropPlacement(properties.CB_PLACEMENT_PROP_PLACEMENT, id), mobileLayout = _a.mobileLayout, desktopLayout = _a.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;
17
17
  return {
18
18
  sm: __spreadArray(__spreadArray([], acc.sm, true), [mobileLayout], false),
19
19
  lg: __spreadArray(__spreadArray([], acc.lg, true), [desktopLayout], false)
@@ -210,6 +210,7 @@ export interface IItemDescription extends IDescription {
210
210
  text: string;
211
211
  color?: string;
212
212
  }
213
+ export type CustomSectionShortcutKeysType = 'BULK_SELECT' | 'COLLISION_SELECT' | 'SELECT_ALL' | 'MANUAL_COLLISION_SELECT' | 'MANUAL_BULK_BREAK' | null;
213
214
  export type DynamicLayoutProps = {
214
215
  device: 'DESKTOP' | 'MOBILE';
215
216
  /** @default 'NORMAL */
@@ -224,7 +225,7 @@ export type DynamicLayoutProps = {
224
225
  sectionActionHandler?: (action: TypeOfSectionAction) => void;
225
226
  programmedSectionComponents?: IProgrammedSectionComponents;
226
227
  width?: number;
227
- shortcutKeyMode?: 'BULK_SELECT' | 'COLLISION_SELECT' | 'SELECT_ALL' | 'MANUAL_COLLISION_SELECT' | null;
228
+ shortcutKeyMode?: CustomSectionShortcutKeysType;
228
229
  };
229
230
  export type NavHandlerAction = {
230
231
  openNewTab: boolean;
@@ -296,25 +297,27 @@ export type IMembershipDisplay = {
296
297
  connectedMemberships: IConnectedMembership[];
297
298
  };
298
299
  export type ISectionJsonProperties = {
299
- CB_CONTENT_PROP_SECTION: {
300
- CB_CONTENT_PROP_SECTION_SPEC_VARIABLEROOTFONTSIZE: boolean;
301
- };
302
- CB_CONTENT_PROP_VISIBILITY: CB_CONTENT_PROP_VISIBILITY_SPECS;
303
- CB_EFFECT_PROP_ENTANIM: CB_EFFECT_PROP_ENTANIM_SPECS;
304
- CB_LAYOUT_PROP_PADDING?: CB_LAYOUT_PROP_PADDING_SPECS;
305
- CB_PLACEMENT_PROP_SECTION: {
306
- CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH: boolean;
307
- 'CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH:MOBILE': boolean | null | undefined;
308
- CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT: number;
309
- 'CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT:MOBILE': number | null | undefined;
310
- CB_PLACEMENT_PROP_SECTION_SPEC_ROWS: number;
311
- 'CB_PLACEMENT_PROP_SECTION_SPEC_ROWS:MOBILE': number | null | undefined;
312
- CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH: number;
313
- 'CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH:MOBILE': number | null | undefined;
300
+ data: {
301
+ CB_CONTENT_PROP_SECTION: {
302
+ CB_CONTENT_PROP_SECTION_SPEC_VARIABLEROOTFONTSIZE: boolean;
303
+ };
304
+ CB_CONTENT_PROP_VISIBILITY: CB_CONTENT_PROP_VISIBILITY_SPECS;
305
+ CB_EFFECT_PROP_ENTANIM: CB_EFFECT_PROP_ENTANIM_SPECS;
306
+ CB_LAYOUT_PROP_PADDING?: CB_LAYOUT_PROP_PADDING_SPECS;
307
+ CB_PLACEMENT_PROP_SECTION: {
308
+ CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH: boolean;
309
+ 'CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH:MOBILE': boolean | null | undefined;
310
+ CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT: number;
311
+ 'CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT:MOBILE': number | null | undefined;
312
+ CB_PLACEMENT_PROP_SECTION_SPEC_ROWS: number;
313
+ 'CB_PLACEMENT_PROP_SECTION_SPEC_ROWS:MOBILE': number | null | undefined;
314
+ CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH: number;
315
+ 'CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH:MOBILE': number | null | undefined;
316
+ };
317
+ CB_STYLE_PROP_BGCOLOR?: CB_STYLE_PROP_BGCOLOR_SPECS;
318
+ CB_STYLE_PROP_BGMEDIA?: CB_STYLE_PROP_BGMEDIA_SPECS;
319
+ CB_STYLE_PROP_BGOVERLAY?: CB_STYLE_PROP_BGOVERLAY_SPECS;
314
320
  };
315
- CB_STYLE_PROP_BGCOLOR?: CB_STYLE_PROP_BGCOLOR_SPECS;
316
- CB_STYLE_PROP_BGMEDIA?: CB_STYLE_PROP_BGMEDIA_SPECS;
317
- CB_STYLE_PROP_BGOVERLAY?: CB_STYLE_PROP_BGOVERLAY_SPECS;
318
321
  };
319
322
  export type CB_STYLE_PROP_BGMEDIA_SPECS_BASE = {
320
323
  CB_STYLE_PROP_BGMEDIA_SPEC_YSRC: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "0.3.38",
3
+ "version": "0.3.40",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
package/release-note.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # pds-dev-kit-web-test Release Notes
2
- ## [v0.3.38]
2
+ ## [v0.3.40]
3
3
  ## 기준 pds-dev-kit-web 버전 @2.2.41
4
4
  ### sub
5
- * pds- json parse → object deep copy로 변경
6
- * 겹선택 없을때 모달이나 disabled → Error 액션추가
7
- * 충돌감지로 그룹화 시 group_created action발행
5
+ * DynamicLayout
6
+ * 커스텀섹션의 데이터 구조 변경 입니다.
@@ -1,2 +0,0 @@
1
- import type { ISection } from './types';
2
- export declare const customSectionMock1: ISection;