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

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.
@@ -101,10 +101,12 @@ type ActionHandlerPayload = {
101
101
  };
102
102
  '@CUSTOMSECTION/GROUP_RIGHT_CLICKED': {
103
103
  e: React.MouseEvent;
104
- blockId: string;
104
+ block: PayloadGBType;
105
105
  isEditingGroup: boolean;
106
- childrenCBIds: number[];
107
- workdir: string;
106
+ };
107
+ '@CUSTOMSECTION/BULK_RIGHT_CLICKED': {
108
+ e: React.MouseEvent;
109
+ block: PayloadBulkType;
108
110
  };
109
111
  '@CUSTOMSECTION/BULK_CREATED': {
110
112
  message: string;
@@ -58,6 +58,7 @@ var renderHelpers_1 = require("publ-echo-test/dist/lib/GridLayoutEditor/utils/re
58
58
  var react_1 = __importStar(require("react"));
59
59
  var ErrorBoundary_1 = require("../../../DynamicLayout/components/Section/ErrorBoundary");
60
60
  var dynamicLayoutContext_1 = require("../../../DynamicLayout/dynamicLayoutContext");
61
+ require("../../../DynamicLayout/sectionActionTypes");
61
62
  var styled_components_1 = __importDefault(require("styled-components"));
62
63
  var components_1 = require("../../components");
63
64
  var ComponentBlockMatcher_1 = __importDefault(require("./components/ComponentBlock/ComponentBlockMatcher"));
@@ -238,7 +239,9 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
238
239
  });
239
240
  setSelectedBlockId(null);
240
241
  var newBulkBlockIds = Array.from(new Set(__spreadArray(__spreadArray([], bulkBlockIds, true), blockIds_1, true)));
241
- var newBulkCBIds = newBulkBlockIds.map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); });
242
+ var newBulkCBIds = newBulkBlockIds
243
+ .map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); })
244
+ .filter(function (each) { return each !== null; });
242
245
  sectionActionHandler &&
243
246
  sectionActionHandler({
244
247
  type: '@CUSTOMSECTION/BLOCK_CLICKED',
@@ -271,7 +274,9 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
271
274
  blockId: 'BULK',
272
275
  childrenBlockIds: bulks,
273
276
  workDir: (_b = (0, group_1.getBlockWorkDirPath)(newblock, blockId)) !== null && _b !== void 0 ? _b : 'NOT-FOUND',
274
- childrenCBIds: bulks.map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); })
277
+ childrenCBIds: bulks
278
+ .map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); })
279
+ .filter(function (each) { return each !== null; })
275
280
  }
276
281
  }
277
282
  });
@@ -454,17 +459,25 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
454
459
  });
455
460
  };
456
461
  var onContextGroup = function (e, blockId, isEditingGroup) {
457
- var _a;
462
+ var _a, _b, _c;
458
463
  setSelectedBlockId(blockId);
464
+ var block = (0, group_1.findBlockByBlockId)(newblock, blockId);
465
+ if ((block === null || block === void 0 ? void 0 : block.type) === 'COMPONENT_BLOCK') {
466
+ return;
467
+ }
459
468
  sectionActionHandler &&
460
469
  sectionActionHandler({
461
470
  type: '@CUSTOMSECTION/GROUP_RIGHT_CLICKED',
462
471
  payload: {
463
- blockId: blockId,
472
+ block: {
473
+ blockId: blockId,
474
+ type: 'GROUP_BLOCK',
475
+ workDir: (_a = (0, group_1.getBlockWorkDirPath)(newblock, blockId)) !== null && _a !== void 0 ? _a : 'NOT-FOUND',
476
+ childrenBlockIds: (_b = (0, group_1.findDirectChildrenBlockIds)(newblock, blockId)) !== null && _b !== void 0 ? _b : [],
477
+ childrenCBIds: (_c = (0, group_1.findDirectChildrenCbIds)(newblock, blockId)) !== null && _c !== void 0 ? _c : []
478
+ },
464
479
  e: e,
465
- isEditingGroup: isEditingGroup,
466
- workdir: (_a = (0, group_1.getBlockWorkDirPath)(newblock, blockId)) !== null && _a !== void 0 ? _a : 'NOT-FOUND',
467
- childrenCBIds: (0, group_1.findDirectChildrenCbIds)(newblock, blockId)
480
+ isEditingGroup: isEditingGroup
468
481
  }
469
482
  });
470
483
  };
@@ -601,7 +614,9 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
601
614
  return;
602
615
  }
603
616
  var newBulkBlockIds_1 = bulkBlockIds.filter(function (each) { return each !== id; });
604
- var newBulkCBIds_1 = newBulkBlockIds_1.map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); });
617
+ var newBulkCBIds_1 = newBulkBlockIds_1
618
+ .map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); })
619
+ .filter(function (each) { return each !== null; });
605
620
  setBulkBlockIds(newBulkBlockIds_1);
606
621
  sectionActionHandler &&
607
622
  sectionActionHandler({
@@ -621,7 +636,9 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
621
636
  if (shortcutKeyMode === 'BULK_SELECT') {
622
637
  var added = selectedBlockId ? [selectedBlockId.toString(), id] : [id];
623
638
  var newBulkBlockIds_2 = Array.from(new Set(__spreadArray(__spreadArray([], bulkBlockIds, true), added, true)));
624
- var newBulkCBIds_2 = newBulkBlockIds_2.map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); });
639
+ var newBulkCBIds_2 = newBulkBlockIds_2
640
+ .map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); })
641
+ .filter(function (each) { return each !== null; });
625
642
  setBulkBlockIds(newBulkBlockIds_2);
626
643
  setSelectedBlockId(null);
627
644
  sectionActionHandler &&
@@ -642,7 +659,9 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
642
659
  setBulkBlockIds([]);
643
660
  setSelectedBlockId(id);
644
661
  var newBulkBlockIds = (0, group_1.findDirectChildrenBlockIds)(newblock, id);
645
- var newBulkCBIds = newBulkBlockIds.map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); });
662
+ var newBulkCBIds = newBulkBlockIds
663
+ .map(function (id) { return (0, group_1.formatBlockIdToCbId)(id); })
664
+ .filter(function (each) { return each !== null; });
646
665
  sectionActionHandler &&
647
666
  sectionActionHandler({
648
667
  type: '@CUSTOMSECTION/BLOCK_CLICKED',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.5.98",
3
+ "version": "2.5.99",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",