pds-dev-kit-web-test 2.4.15 → 2.4.17

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.
@@ -28,17 +28,17 @@ function DynamicLayout(_a) {
28
28
  var device = _a.device, _b = _a.mode, mode = _b === void 0 ? 'NORMAL' : _b, isPreview = _a.isPreview, sections = _a.sections, scrollDownTargetSectionId = _a.scrollDownTargetSectionId, editingSectionId = _a.editingSectionId, navigationHandler = _a.navigationHandler, sectionActionHandler = _a.sectionActionHandler, onClickEditSection = _a.onClickEditSection, programmedSectionComponents = _a.programmedSectionComponents, shortcutKeyMode = _a.shortcutKeyMode, dynamicLayoutRef = _a.dynamicLayoutRef;
29
29
  var filteredSortedSection = __spreadArray([], sections, true).filter(function (section) {
30
30
  var _a;
31
- if (section.display) {
32
- return true;
31
+ if (!section.display) {
32
+ return false;
33
33
  }
34
- if (section.type === 'CUSTOM') {
34
+ if (section.type === 'CUSTOM' && mode !== 'EDIT') {
35
35
  var deviceKey = device === 'DESKTOP'
36
36
  ? 'CB_CONTENT_PROP_VISIBILITY_SPEC_DESKTOP'
37
37
  : 'CB_CONTENT_PROP_VISIBILITY_SPEC_MOBILEWEB';
38
38
  var isVisible = (_a = section.jsonProperties) === null || _a === void 0 ? void 0 : _a.data.CB_CONTENT_PROP_VISIBILITY[deviceKey];
39
39
  return isVisible;
40
40
  }
41
- return false;
41
+ return true;
42
42
  })
43
43
  .sort(function (a, b) { return a.order - b.order; });
44
44
  var iframeSection = filteredSortedSection.find(function (section) { return section.manifest.schema === 'EXP_IFRAME' && section.display; });
@@ -60,6 +60,7 @@ var deepCopy_1 = __importDefault(require("../../../DynamicLayout/utils/deepCopy"
60
60
  var styled_components_1 = __importDefault(require("styled-components"));
61
61
  var components_1 = require("../../components");
62
62
  var ComponentBlockMatcher_1 = __importDefault(require("./components/ComponentBlock/ComponentBlockMatcher"));
63
+ var S_HiddenCover_1 = require("./components/ComponentBlock/componentBlocks/components/S_HiddenCover");
63
64
  var useGroupDrag_1 = require("./hooks/useGroupDrag");
64
65
  var useGroupDrag_2 = require("./hooks/useGroupDrag/useGroupDrag");
65
66
  var utils_1 = require("./hooks/useGroupDrag/utils");
@@ -403,63 +404,73 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
403
404
  }
404
405
  makeCollisionOfBulk();
405
406
  };
406
- return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(S_gleStyles, { children: (0, jsx_runtime_1.jsx)(S_SectionWrapper, __assign({ ref: gleRef, "x-dlayout-section-type": "NO_NAME", onClick: onClickSection }, { children: (0, jsx_runtime_1.jsx)(components_1.CustomSection, __assign({}, props, { isMobile: isMobile, overrideStyles: {
407
- minHeight: customSectionStyles.minHeight,
408
- paddingTop: padding.top,
409
- paddingBottom: padding.bottom,
410
- paddingRight: padding.right,
411
- paddingLeft: padding.left
412
- } }, { children: (0, jsx_runtime_1.jsx)(Responsive, __assign({ innerRef: innerRef, allowOverlap: true, layouts: layouts, resizeHandles: ['nw', 'e', 'n', 'ne', 's', 'se', 'sw', 'w'], breakpoints: breakpoints, breakpoint: breakpoint, cols: { lg: 24, sm: 8 }, rowHeight: rowHeight, margin: [10, 10], style: {
413
- width: customSectionStyles.width,
414
- maxWidth: customSectionStyles.maxWidth,
415
- minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
416
- fontSize: "".concat(baseFontSize, "px")
417
- }, onLayoutChange: onLayoutChange, onDragStop: onDragStop, onResizeStop: onResizeStop, onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode }, { children: keepSimilarOrderToPreventRerender(layouts[layoutByDevice]).map(function (each, index) {
418
- var _a;
419
- if (each === null) {
420
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
421
- }
422
- var matchedCB = componentBlocks === null || componentBlocks === void 0 ? void 0 : componentBlocks.find(function (cb) { return cb.id.toString() === each.i; });
423
- if (each.i === 'group' && each.groupLayouts) {
424
- return ((0, jsx_runtime_1.jsx)("div", __assign({ className: "iamgroup", onClick: function (e) {
425
- e.stopPropagation();
426
- onClickBulk();
427
- }, onContextMenu: function (e) {
428
- e.stopPropagation();
429
- e.preventDefault();
430
- onContextMenuCB('group', e);
431
- } }, { children: (0, jsx_runtime_1.jsx)(WidthProvidedRGL, __assign({ cols: each.w, allowOverlap: true, layout: each.groupLayouts, rowHeight: rowHeight, containerPadding: [0, 0], margin: [10, 10], isDraggable: false, isResizable: false, style: {
432
- width: '100%'
433
- } }, { children: (_a = each.groupLayouts) === null || _a === void 0 ? void 0 : _a.map(function (layoutItem, index, array) {
434
- var matchedCB = componentBlocks === null || componentBlocks === void 0 ? void 0 : componentBlocks.find(function (cb) { return cb.id.toString() === layoutItem.i; });
435
- if (!matchedCB) {
436
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
437
- }
438
- var cbCopy = (0, deepCopy_1.default)(matchedCB);
439
- cbCopy.jsonProperties.data.CB_EFFECT_PROP_ENTANIM.CB_EFFECT_PROP_ENTANIM_SPEC_TYPE =
440
- 'NONE';
441
- cbCopy.jsonProperties.data.CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] = 'NONE';
442
- return ((0, jsx_runtime_1.jsx)("div", __assign({ className: "cb-box-in-group", onClick: function (e) {
443
- e.stopPropagation();
444
- clickOneCBInBulk(matchedCB.id, array);
445
- } }, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcher_1.default, { cbProps: cbCopy, device: device, index: index }) }) }), matchedCB.id));
446
- }) })) }), each.i));
447
- }
448
- if (!matchedCB) {
449
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
450
- }
451
- return ((0, jsx_runtime_1.jsx)("div", __assign({ className: selectedCB === matchedCB.id ? 'react-grid-item-selected' : '' }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ style: {
452
- width: '100%',
453
- height: '100%'
454
- }, onClick: function (e) {
455
- e.stopPropagation();
456
- onClickCB(matchedCB.id);
457
- }, onContextMenu: function (e) {
458
- e.stopPropagation();
459
- e.preventDefault();
460
- onContextMenuCB(matchedCB.id, e);
461
- } }, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcher_1.default, { cbProps: matchedCB, device: device, index: index }) }) })) }), each.i));
462
- }) })) })) })) }) }));
407
+ var isHiddenOnCurrentDevice = (function () {
408
+ if (mode === 'EDIT') {
409
+ var deviceKey = device === 'DESKTOP'
410
+ ? 'CB_CONTENT_PROP_VISIBILITY_SPEC_DESKTOP'
411
+ : 'CB_CONTENT_PROP_VISIBILITY_SPEC_MOBILEWEB';
412
+ var isVisible = jsonProperties === null || jsonProperties === void 0 ? void 0 : jsonProperties.data.CB_CONTENT_PROP_VISIBILITY[deviceKey];
413
+ return isVisible;
414
+ }
415
+ return false;
416
+ })();
417
+ return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsxs)(S_gleStyles, { children: [isHiddenOnCurrentDevice && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), (0, jsx_runtime_1.jsx)(S_SectionWrapper, __assign({ ref: gleRef, "x-dlayout-section-type": "NO_NAME", onClick: onClickSection }, { children: (0, jsx_runtime_1.jsx)(components_1.CustomSection, __assign({}, props, { isMobile: isMobile, overrideStyles: {
418
+ minHeight: customSectionStyles.minHeight,
419
+ paddingTop: padding.top,
420
+ paddingBottom: padding.bottom,
421
+ paddingRight: padding.right,
422
+ paddingLeft: padding.left
423
+ } }, { children: (0, jsx_runtime_1.jsx)(Responsive, __assign({ innerRef: innerRef, allowOverlap: true, layouts: layouts, resizeHandles: ['nw', 'e', 'n', 'ne', 's', 'se', 'sw', 'w'], breakpoints: breakpoints, breakpoint: breakpoint, cols: { lg: 24, sm: 8 }, rowHeight: rowHeight, margin: [10, 10], style: {
424
+ width: customSectionStyles.width,
425
+ maxWidth: customSectionStyles.maxWidth,
426
+ minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
427
+ fontSize: "".concat(baseFontSize, "px")
428
+ }, onLayoutChange: onLayoutChange, onDragStop: onDragStop, onResizeStop: onResizeStop, onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode }, { children: keepSimilarOrderToPreventRerender(layouts[layoutByDevice]).map(function (each, index) {
429
+ var _a;
430
+ if (each === null) {
431
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
432
+ }
433
+ var matchedCB = componentBlocks === null || componentBlocks === void 0 ? void 0 : componentBlocks.find(function (cb) { return cb.id.toString() === each.i; });
434
+ if (each.i === 'group' && each.groupLayouts) {
435
+ return ((0, jsx_runtime_1.jsx)("div", __assign({ className: "iamgroup", onClick: function (e) {
436
+ e.stopPropagation();
437
+ onClickBulk();
438
+ }, onContextMenu: function (e) {
439
+ e.stopPropagation();
440
+ e.preventDefault();
441
+ onContextMenuCB('group', e);
442
+ } }, { children: (0, jsx_runtime_1.jsx)(WidthProvidedRGL, __assign({ cols: each.w, allowOverlap: true, layout: each.groupLayouts, rowHeight: rowHeight, containerPadding: [0, 0], margin: [10, 10], isDraggable: false, isResizable: false, style: {
443
+ width: '100%'
444
+ } }, { children: (_a = each.groupLayouts) === null || _a === void 0 ? void 0 : _a.map(function (layoutItem, index, array) {
445
+ var matchedCB = componentBlocks === null || componentBlocks === void 0 ? void 0 : componentBlocks.find(function (cb) { return cb.id.toString() === layoutItem.i; });
446
+ if (!matchedCB) {
447
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
448
+ }
449
+ var cbCopy = (0, deepCopy_1.default)(matchedCB);
450
+ cbCopy.jsonProperties.data.CB_EFFECT_PROP_ENTANIM.CB_EFFECT_PROP_ENTANIM_SPEC_TYPE =
451
+ 'NONE';
452
+ cbCopy.jsonProperties.data.CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] = 'NONE';
453
+ return ((0, jsx_runtime_1.jsx)("div", __assign({ className: "cb-box-in-group", onClick: function (e) {
454
+ e.stopPropagation();
455
+ clickOneCBInBulk(matchedCB.id, array);
456
+ } }, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcher_1.default, { cbProps: cbCopy, device: device, index: index }) }) }), matchedCB.id));
457
+ }) })) }), each.i));
458
+ }
459
+ if (!matchedCB) {
460
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
461
+ }
462
+ return ((0, jsx_runtime_1.jsx)("div", __assign({ className: selectedCB === matchedCB.id ? 'react-grid-item-selected' : '' }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ style: {
463
+ width: '100%',
464
+ height: '100%'
465
+ }, onClick: function (e) {
466
+ e.stopPropagation();
467
+ onClickCB(matchedCB.id);
468
+ }, onContextMenu: function (e) {
469
+ e.stopPropagation();
470
+ e.preventDefault();
471
+ onContextMenuCB(matchedCB.id, e);
472
+ } }, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcher_1.default, { cbProps: matchedCB, device: device, index: index }) }) })) }), each.i));
473
+ }) })) })) }))] }) }));
463
474
  });
464
475
  function keepSimilarOrderToPreventRerender(arr) {
465
476
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.4.15",
3
+ "version": "2.4.17",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",