@kbach/react 0.6.29 → 0.6.30
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.
|
@@ -111,10 +111,16 @@ function mergeStyle(computed, userStyle) {
|
|
|
111
111
|
return { ...computed, ...userStyle };
|
|
112
112
|
}
|
|
113
113
|
function withImpliedFlexIfNeeded(webTag, resolvedBase, userStyle) {
|
|
114
|
-
if (!webTag || !resolvedBase
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
if (!webTag || !resolvedBase) return userStyle;
|
|
115
|
+
const explicitDisplay = resolvedBase.display;
|
|
116
|
+
const hasFlexItemProps = "flexGrow" in resolvedBase || "flexShrink" in resolvedBase || "flex" in resolvedBase;
|
|
117
|
+
const willBeFlex = explicitDisplay === "flex" || explicitDisplay === void 0 && hasFlexItemProps;
|
|
118
|
+
if (!willBeFlex) return userStyle;
|
|
119
|
+
const compensation = {};
|
|
120
|
+
if (explicitDisplay === void 0) compensation.display = "flex";
|
|
121
|
+
if (resolvedBase.flexDirection === void 0) compensation.flexDirection = "column";
|
|
122
|
+
if (Object.keys(compensation).length === 0) return userStyle;
|
|
123
|
+
return Array.isArray(userStyle) ? [compensation, ...userStyle] : { ...compensation, ...userStyle };
|
|
118
124
|
}
|
|
119
125
|
function makeElement(isStaticChildren, type, props, key) {
|
|
120
126
|
return (isStaticChildren ? _jsxs : _jsx)(type, props, key);
|
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -623,10 +623,16 @@ function mergeStyle(computed, userStyle) {
|
|
|
623
623
|
return { ...computed, ...userStyle };
|
|
624
624
|
}
|
|
625
625
|
function withImpliedFlexIfNeeded(webTag, resolvedBase, userStyle) {
|
|
626
|
-
if (!webTag || !resolvedBase
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
626
|
+
if (!webTag || !resolvedBase) return userStyle;
|
|
627
|
+
const explicitDisplay = resolvedBase.display;
|
|
628
|
+
const hasFlexItemProps = "flexGrow" in resolvedBase || "flexShrink" in resolvedBase || "flex" in resolvedBase;
|
|
629
|
+
const willBeFlex = explicitDisplay === "flex" || explicitDisplay === void 0 && hasFlexItemProps;
|
|
630
|
+
if (!willBeFlex) return userStyle;
|
|
631
|
+
const compensation = {};
|
|
632
|
+
if (explicitDisplay === void 0) compensation.display = "flex";
|
|
633
|
+
if (resolvedBase.flexDirection === void 0) compensation.flexDirection = "column";
|
|
634
|
+
if (Object.keys(compensation).length === 0) return userStyle;
|
|
635
|
+
return Array.isArray(userStyle) ? [compensation, ...userStyle] : { ...compensation, ...userStyle };
|
|
630
636
|
}
|
|
631
637
|
function makeElement(isStaticChildren, type, props, key) {
|
|
632
638
|
return (isStaticChildren ? import_jsx_runtime.jsxs : import_jsx_runtime.jsx)(type, props, key);
|
package/dist/jsx-dev-runtime.mjs
CHANGED
package/dist/jsx-runtime.js
CHANGED
|
@@ -629,10 +629,16 @@ function mergeStyle(computed, userStyle) {
|
|
|
629
629
|
return { ...computed, ...userStyle };
|
|
630
630
|
}
|
|
631
631
|
function withImpliedFlexIfNeeded(webTag, resolvedBase, userStyle) {
|
|
632
|
-
if (!webTag || !resolvedBase
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
632
|
+
if (!webTag || !resolvedBase) return userStyle;
|
|
633
|
+
const explicitDisplay = resolvedBase.display;
|
|
634
|
+
const hasFlexItemProps = "flexGrow" in resolvedBase || "flexShrink" in resolvedBase || "flex" in resolvedBase;
|
|
635
|
+
const willBeFlex = explicitDisplay === "flex" || explicitDisplay === void 0 && hasFlexItemProps;
|
|
636
|
+
if (!willBeFlex) return userStyle;
|
|
637
|
+
const compensation = {};
|
|
638
|
+
if (explicitDisplay === void 0) compensation.display = "flex";
|
|
639
|
+
if (resolvedBase.flexDirection === void 0) compensation.flexDirection = "column";
|
|
640
|
+
if (Object.keys(compensation).length === 0) return userStyle;
|
|
641
|
+
return Array.isArray(userStyle) ? [compensation, ...userStyle] : { ...compensation, ...userStyle };
|
|
636
642
|
}
|
|
637
643
|
function makeElement(isStaticChildren, type, props, key) {
|
|
638
644
|
return (isStaticChildren ? import_jsx_runtime.jsxs : import_jsx_runtime.jsx)(type, props, key);
|
package/dist/jsx-runtime.mjs
CHANGED