@plasmicapp/react-web
Advanced tools
Comparing version 0.2.15 to 0.2.16
@@ -83,3 +83,8 @@ "use strict"; | ||
exports.hasVariant = hasVariant; | ||
function wrapFlexContainerChildren(children) { | ||
function wrapFlexContainerChildren(children, hasGap) { | ||
// We need to always wrap the children, even if there are no gaps, because | ||
// otherwise if we toggle between with and without gap, React reconciliation | ||
// will blow away the children tree and all state if we switch from having | ||
// a wrapper and not. | ||
var className = hasGap ? "__wab_flex-container" : "__wab_passthrough"; | ||
if (!children) { | ||
@@ -89,7 +94,6 @@ return null; | ||
else if (Array.isArray(children)) { | ||
return React.createElement.apply(React, __spreadArrays(["div", | ||
{ className: "__wab_flex-container" }], children)); | ||
return React.createElement.apply(React, __spreadArrays(["div", { className: className }], children)); | ||
} | ||
else { | ||
return React.createElement("div", { className: "__wab_flex-container" }, children); | ||
return React.createElement("div", { className: className }, children); | ||
} | ||
@@ -122,3 +126,3 @@ } | ||
// For legacy, we still support data-plasmic-wrap-flex-children | ||
children = wrapFlexContainerChildren(children); | ||
children = wrapFlexContainerChildren(children, true); | ||
} | ||
@@ -397,5 +401,3 @@ var result = createElementWithChildren(root, props, children); | ||
var children = props.children, rest = __rest(props, ["children"]); | ||
var wrappedChildren = hasGap | ||
? wrapFlexContainerChildren(children) | ||
: children; | ||
var wrappedChildren = wrapFlexContainerChildren(children, hasGap !== null && hasGap !== void 0 ? hasGap : false); | ||
return createElementWithChildren(as, __assign({ ref: ref }, rest), wrappedChildren); | ||
@@ -402,0 +404,0 @@ } |
{ | ||
"name": "@plasmicapp/react-web", | ||
"version": "0.2.15", | ||
"version": "0.2.16", | ||
"description": "plasmic library for rendering in the presentational style", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
43230
966