pds-dev-kit-web-test 2.7.608 → 2.7.609

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.
@@ -27,6 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
28
  var jsx_runtime_1 = require("react/jsx-runtime");
29
29
  var react_1 = require("react");
30
+ var dynamicLayoutContext_1 = require("../../../DynamicLayout/dynamicLayoutContext");
30
31
  var sections_1 = require("../../../DynamicLayout/sections");
31
32
  var SectionBox_1 = __importDefault(require("./SectionBox"));
32
33
  function EditModeSectionMatcher(_a) {
@@ -52,9 +53,17 @@ function EditModeSectionMatcher(_a) {
52
53
  }
53
54
  };
54
55
  }, [selectedSectionRef]);
55
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: iframeSection ? ((0, jsx_runtime_1.jsx)(SectionBox_1.default, __assign({ isIframeSection: true, isEditing: editingSectionId === iframeSection.id, scrollIntoThisSection: iframeSection.id === scrollDownTargetSectionId, onClick: function () { return onClickEditSection(iframeSection); } }, { children: (0, jsx_runtime_1.jsx)(DesignedSectionsMatcher, __assign({}, iframeSection)) }), iframeSection.id)) : (filteredSortedSection.map(function (section) { return ((0, jsx_runtime_1.jsx)(SectionBox_1.default, __assign({ isEditing: editingSectionId === section.id, scrollIntoThisSection: section.id === scrollDownTargetSectionId, onClick: function () { return onClickEditSection(section); } }, { children: section.type === 'CUSTOM' ? ((0, jsx_runtime_1.jsx)(sections_1.CustomSection, __assign({}, section, { ref: editingSectionId === section.id ? refCallback : null }))) : ((0, jsx_runtime_1.jsx)(DesignedSectionsMatcher, __assign({}, section))) }), section.id)); })) }));
56
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: iframeSection ? ((0, jsx_runtime_1.jsx)(SectionBox_1.default, __assign({ isIframeSection: true, isEditing: editingSectionId === iframeSection.id, scrollIntoThisSection: iframeSection.id === scrollDownTargetSectionId, onClick: function () { return onClickEditSection(iframeSection); } }, { children: (0, jsx_runtime_1.jsx)(ContextWrapper, __assign({ isEditing: editingSectionId === iframeSection.id }, { children: (0, jsx_runtime_1.jsx)(DesignedSectionsMatcher, __assign({}, iframeSection)) })) }), iframeSection.id)) : (filteredSortedSection.map(function (section) { return ((0, jsx_runtime_1.jsx)(SectionBox_1.default, __assign({ isEditing: editingSectionId === section.id, scrollIntoThisSection: section.id === scrollDownTargetSectionId, onClick: function () { return onClickEditSection(section); } }, { children: (0, jsx_runtime_1.jsx)(ContextWrapper, __assign({ isEditing: editingSectionId === section.id }, { children: section.type === 'CUSTOM' ? ((0, jsx_runtime_1.jsx)(sections_1.CustomSection, __assign({}, section, { ref: editingSectionId === section.id ? refCallback : null }))) : ((0, jsx_runtime_1.jsx)(DesignedSectionsMatcher, __assign({}, section))) })) }), section.id)); })) }));
56
57
  }
57
58
  exports.default = EditModeSectionMatcher;
59
+ function ContextWrapper(_a) {
60
+ var children = _a.children, isEditing = _a.isEditing;
61
+ var contextValue = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext);
62
+ if (isEditing) {
63
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
64
+ }
65
+ return ((0, jsx_runtime_1.jsx)(dynamicLayoutContext_1.dynamicLayoutContext.Provider, __assign({ value: __assign(__assign({}, contextValue), { mode: 'PREVIEW' }) }, { children: children })));
66
+ }
58
67
  function DesignedSectionsMatcher(_a) {
59
68
  var props = __rest(_a, []);
60
69
  var schema = props.manifest.schema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.7.608",
3
+ "version": "2.7.609",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",