pds-dev-kit-web-test 2.5.99 → 2.5.101

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.
@@ -170,6 +170,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
170
170
  }
171
171
  }, [shortcutKeyMode, setSelectedBlockId]);
172
172
  (0, react_1.useLayoutEffect)(function () {
173
+ var _a;
173
174
  if (props.id !== editingSectionId) {
174
175
  return;
175
176
  }
@@ -181,19 +182,28 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
181
182
  if (!selectedCBId) {
182
183
  return;
183
184
  }
184
- // const bulks = getCollisionGroupIds(selectedCBId).map(
185
- // (cbid) => formatCbIdToBlockId[Number(cbid)]
186
- // );
187
- // const bulkIds = findAccessibleChildrenBlocks(pedigreeState, editingGroupBlock, bulks);
188
- // setBulkBlockIds(bulkIds);
189
- // sectionActionHandler &&
190
- // sectionActionHandler({
191
- // type: '@CUSTOMSECTION/BLOCK_CLICKED',
192
- // payload: {
193
- // block: { type: 'BULK', blockId: 'BULK', childrenBlockIds: bulks }
194
- // }
195
- // });
196
- setSelectedBlockId('BULK');
185
+ var bulks = getCollisionGroupIds(selectedCBId);
186
+ if (selectedBlockId) {
187
+ bulks.push(selectedBlockId);
188
+ }
189
+ setBulkBlockIds(bulks);
190
+ setSelectedBlockId(null);
191
+ sectionActionHandler &&
192
+ sectionActionHandler({
193
+ type: '@CUSTOMSECTION/BLOCK_CLICKED',
194
+ payload: {
195
+ block: {
196
+ type: 'BULK',
197
+ blockId: 'BULK',
198
+ childrenBlockIds: bulks,
199
+ workDir: (_a = (0, group_1.getBlockWorkDirPath)(newblock, selectedBlockId)) !== null && _a !== void 0 ? _a : 'NOT-FOUND',
200
+ childrenCBIds: bulks
201
+ .map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); })
202
+ .filter(function (each) { return each !== null; })
203
+ }
204
+ }
205
+ });
206
+ return;
197
207
  }
198
208
  }, [selectedBlockId, shortcutKeyMode, sectionActionHandler, setSelectedBlockId]);
199
209
  var makeAllInOneGroup = function () {
@@ -202,12 +212,26 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
202
212
  };
203
213
  var getCollisionGroupIds = function (cdId1) {
204
214
  var layoutItem = (0, renderHelpers_1.getLayoutItem)(layouts[layoutByDevice], cdId1.toString());
205
- if (!layoutItem) {
215
+ if (!layoutItem || !selectedBlockId) {
206
216
  return [];
207
217
  }
208
218
  var allCollisions = (0, renderHelpers_1.getAllCollisions)(layouts[layoutByDevice], layoutItem);
209
- var blockIds = allCollisions.map(function (each) { return (0, group_1.formatCbIdToBlockId)(Number(each.i)); });
210
- return __spreadArray(__spreadArray([], blockIds, true), [(0, group_1.formatCbIdToBlockId)(cdId1)], false);
219
+ var allCollisionsCbIds = allCollisions.map(function (each) { return Number(each.i); });
220
+ var workdir = (0, group_1.getBlockWorkDirPath)(newblock, selectedBlockId);
221
+ if (!workdir) {
222
+ return [];
223
+ }
224
+ var workDirChildrenBlockIds = (0, group_1.findDirectChildrenBlockIds)(newblock, workdir);
225
+ var collisions = workDirChildrenBlockIds.filter(function (each) {
226
+ var cbId = (0, group_1.formatBlockIdToCbId)(each);
227
+ var allCollisions = (0, group_1.findAllChildrenCbIds)(newblock, each);
228
+ if (cbId !== null && allCollisionsCbIds.includes(cbId)) {
229
+ return true;
230
+ }
231
+ var hasCollision = allCollisions.some(function (each) { return allCollisionsCbIds.includes(each); });
232
+ return hasCollision;
233
+ });
234
+ return __spreadArray(__spreadArray([], collisions, true), [(0, group_1.formatCbIdToBlockId)(cdId1)], false);
211
235
  };
212
236
  var _m = (0, util_1.parseCustomSectionPlacement)({
213
237
  isMobile: isMobile,
@@ -258,7 +282,6 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
258
282
  return;
259
283
  }
260
284
  if (shortcutKeyMode === 'COLLISION_SELECT') {
261
- // const selectedCBId = selectedBlockId ? formatBlockIdToCbId(selectedBlockId) : undefined;
262
285
  var bulks = getCollisionGroupIds(id);
263
286
  if (selectedBlockId) {
264
287
  bulks.push(selectedBlockId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.5.99",
3
+ "version": "2.5.101",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",