pds-dev-kit-web-test 0.3.47 → 0.3.49

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.
@@ -57,9 +57,6 @@ type ActionHandlerPayload = {
57
57
  '@CUSTOMSECTION/COLLISION_NOT_FOUND': {
58
58
  message: string;
59
59
  };
60
- '@CUSTOMSECTION/DEFAULT_STATUS_APPLIED': {
61
- message: string;
62
- };
63
60
  };
64
61
  type ActionMap<M extends {
65
62
  [index: string]: any;
@@ -106,6 +106,7 @@ var CommentList = (0, react_1.forwardRef)(function CustomSection(props, ref) {
106
106
  var _a;
107
107
  var filteredLayout = (0, useGroupDrag_2.filterItemsById)(parsedLayouts[layoutByDevice], cbIds);
108
108
  var newGroupLayout = (0, utils_1.getGroupForMultiple)(parsedLayouts[layoutByDevice].filter(function (each) { return cbIds.includes(each.i); }));
109
+ newGroupLayout.keepInLastIndex = true;
109
110
  filteredLayout.push(newGroupLayout);
110
111
  return __assign(__assign({}, prev), (_a = {}, _a[layoutByDevice] = filteredLayout, _a));
111
112
  });
@@ -121,8 +122,13 @@ var CommentList = (0, react_1.forwardRef)(function CustomSection(props, ref) {
121
122
  var groupedCBIds = (_b = group === null || group === void 0 ? void 0 : group.childrenIds) !== null && _b !== void 0 ? _b : [];
122
123
  var filteredLayout = (0, useGroupDrag_2.filterItemsById)(parsedLayouts[layoutByDevice], groupedCBIds);
123
124
  if (group === null || group === void 0 ? void 0 : group.groupLayouts) {
124
- var newGroupLayout = (0, utils_1.getGroupForMultiple)(parsedLayouts[layoutByDevice].filter(function (each) { return groupedCBIds.includes(each.i); }));
125
- filteredLayout.push(newGroupLayout);
125
+ var groupCbs = parsedLayouts[layoutByDevice].filter(function (each) {
126
+ return groupedCBIds.includes(each.i);
127
+ });
128
+ if (groupCbs.length > 0) {
129
+ var newGroupLayout = (0, utils_1.getGroupForMultiple)(groupCbs);
130
+ filteredLayout.push(newGroupLayout);
131
+ }
126
132
  }
127
133
  return __assign(__assign({}, prev), (_a = {}, _a[layoutByDevice] = filteredLayout, _a));
128
134
  });
@@ -410,14 +416,17 @@ var CommentList = (0, react_1.forwardRef)(function CustomSection(props, ref) {
410
416
  });
411
417
  function keepSimilarOrderToPreventRerender(arr) {
412
418
  var _a;
413
- var arrCopy = __spreadArray([], arr, true);
419
+ var arrCopy = __spreadArray([], arr, true).sort(function (a, b) { return Number(a.i) - Number(b.i); });
414
420
  var groupIdx = arrCopy.findIndex(function (each) { return each.i === 'group'; });
415
421
  if (groupIdx >= 0) {
416
422
  var group = arrCopy.splice(groupIdx, 1)[0];
417
423
  (_a = group.groupLayouts) === null || _a === void 0 ? void 0 : _a.sort(function (a, b) { return Number(a.i) - Number(b.i); });
418
- return __spreadArray(__spreadArray([], arrCopy.sort(function (a, b) { return Number(a.i) - Number(b.i); }), true), [group], false);
424
+ if (group.keepInLastIndex) {
425
+ return __spreadArray(__spreadArray([null], arrCopy, true), [group], false);
426
+ }
427
+ return __spreadArray([group], arrCopy, true);
419
428
  }
420
- return __spreadArray([], arrCopy.sort(function (a, b) { return Number(a.i) - Number(b.i); }), true);
429
+ return __spreadArray([null], arrCopy, true);
421
430
  }
422
431
  function isLayoutPlacementSame(current, prev) {
423
432
  if (!prev) {
@@ -45,6 +45,14 @@ function useGroupDrag(_a) {
45
45
  // NOTE: 그룹이 없는 경우
46
46
  if (groupIdx < 0) {
47
47
  var group_1 = (0, utils_1.getGroupForMultiple)(currentLayoutCopy);
48
+ sectionActionHandler &&
49
+ sectionActionHandler({
50
+ type: '@CUSTOMSECTION/GROUP_CREATED',
51
+ payload: {
52
+ message: 'group generated',
53
+ data: group_1
54
+ }
55
+ });
48
56
  return __assign(__assign({}, prev), (_a = {}, _a[layoutByDevice] = [group_1], _a));
49
57
  }
50
58
  // NOTE: 그룹이 이미 있는경우
@@ -2,6 +2,7 @@ import type { ComponentBlock } from '../../types';
2
2
  import type { LayoutItem } from 'publ-echo/dist/lib';
3
3
  export interface LayoutItemWithGroupType extends LayoutItem {
4
4
  childrenIds: string[];
5
+ keepInLastIndex?: boolean;
5
6
  }
6
7
  export declare function getGroupData(elem1: LayoutItemWithGroupType, elem2: LayoutItemWithGroupType): LayoutItemWithGroupType;
7
8
  export declare function recalculatedGroup(group: LayoutItemWithGroupType): LayoutItemWithGroupType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "0.3.47",
3
+ "version": "0.3.49",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
package/release-note.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # pds-dev-kit-web-test Release Notes
2
- ## [v0.3.47]
2
+ ## [v0.3.49]
3
3
  ## 기준 pds-dev-kit-web 버전 @2.2.41
4
4
  ### sub
5
5
  * DynamicLayout
6
- * bulk의 index 가장 높게 수정
6
+ * bulk의 index 벌크 복사 시 맨뒤, 그외의 경우 맨앞