@plasmicapp/react-web 0.2.394 → 0.2.395
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.
- package/dist/all.d.ts +15 -46
- package/dist/index.cjs.js +7 -31
- package/dist/index.cjs.js.map +1 -1
- package/dist/react-web.esm.js +7 -31
- package/dist/react-web.esm.js.map +1 -1
- package/dist/render/Stack.d.ts +15 -46
- package/dist/render/elements.d.ts +0 -3
- package/package.json +2 -2
- package/skinny/dist/index.js +7 -31
- package/skinny/dist/index.js.map +1 -1
- package/skinny/dist/render/Stack.d.ts +15 -46
- package/skinny/dist/render/elements.d.ts +0 -3
package/dist/react-web.esm.js
CHANGED
|
@@ -637,20 +637,18 @@ function getElementTypeName(element) {
|
|
|
637
637
|
}
|
|
638
638
|
}
|
|
639
639
|
|
|
640
|
-
function renderStack(as, props,
|
|
640
|
+
function renderStack(as, props, ref) {
|
|
641
641
|
var children = props.children, rest = __rest(props, ["children"]);
|
|
642
|
-
|
|
643
|
-
return createElementWithChildren(as, __assign({ ref: ref }, rest), wrappedChildren);
|
|
642
|
+
return createElementWithChildren(as, __assign({ ref: ref }, rest), children);
|
|
644
643
|
}
|
|
645
644
|
function FlexStack_(props, outerRef) {
|
|
646
|
-
var as = props.as,
|
|
647
|
-
return renderStack(as !== null && as !== void 0 ? as : "div", rest,
|
|
645
|
+
var as = props.as, rest = __rest(props, ["as"]);
|
|
646
|
+
return renderStack(as !== null && as !== void 0 ? as : "div", rest, outerRef);
|
|
648
647
|
}
|
|
649
648
|
var FlexStack = React.forwardRef(FlexStack_);
|
|
650
649
|
var makeStackImpl = function (as) {
|
|
651
650
|
return React.forwardRef(function (props, ref) {
|
|
652
|
-
|
|
653
|
-
return renderStack(as, rest, hasGap, ref);
|
|
651
|
+
return renderStack(as, props, ref);
|
|
654
652
|
});
|
|
655
653
|
};
|
|
656
654
|
var Stack = Object.assign(FlexStack, {
|
|
@@ -695,23 +693,7 @@ function hasVariant(variants, groupName, variant) {
|
|
|
695
693
|
return (groupVariants[variant] !== undefined && groupVariants[variant] !== false);
|
|
696
694
|
}
|
|
697
695
|
}
|
|
698
|
-
function
|
|
699
|
-
// We need to always wrap the children, even if there are no gaps, because
|
|
700
|
-
// otherwise if we toggle between with and without gap, React reconciliation
|
|
701
|
-
// will blow away the children tree and all state if we switch from having
|
|
702
|
-
// a wrapper and not.
|
|
703
|
-
var className = hasGap ? "__wab_flex-container ρfc" : "__wab_passthrough";
|
|
704
|
-
if (!children) {
|
|
705
|
-
return null;
|
|
706
|
-
}
|
|
707
|
-
else if (Array.isArray(children)) {
|
|
708
|
-
return React.createElement.apply(React, __spreadArray(["div", { className: className }], __read(children), false));
|
|
709
|
-
}
|
|
710
|
-
else {
|
|
711
|
-
return React.createElement("div", { className: className }, children);
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
function createPlasmicElement(override, defaultRoot, defaultProps, wrapChildrenInFlex) {
|
|
696
|
+
function createPlasmicElement(override, defaultRoot, defaultProps) {
|
|
715
697
|
if (!override ||
|
|
716
698
|
(typeof override === "object" && Object.keys(override).length === 0)) {
|
|
717
699
|
return createElementWithChildren(defaultRoot, defaultProps, defaultProps.children);
|
|
@@ -738,10 +720,6 @@ function createPlasmicElement(override, defaultRoot, defaultProps, wrapChildrenI
|
|
|
738
720
|
if (override2.wrapChildren) {
|
|
739
721
|
children = override2.wrapChildren(ensureNotArray(children));
|
|
740
722
|
}
|
|
741
|
-
if (wrapChildrenInFlex) {
|
|
742
|
-
// For legacy, we still support data-plasmic-wrap-flex-children
|
|
743
|
-
children = wrapFlexContainerChildren(children, true);
|
|
744
|
-
}
|
|
745
723
|
var result = createElementWithChildren(root, props, children);
|
|
746
724
|
if (override2.wrap) {
|
|
747
725
|
result = override2.wrap(result);
|
|
@@ -802,15 +780,13 @@ function createPlasmicElementFromJsx(defaultElement, props) {
|
|
|
802
780
|
children[_i - 2] = arguments[_i];
|
|
803
781
|
}
|
|
804
782
|
var override = props["data-plasmic-override"];
|
|
805
|
-
var wrapFlexChild = props["data-plasmic-wrap-flex-child"];
|
|
806
783
|
var triggerProps = ((_a = props["data-plasmic-trigger-props"]) !== null && _a !== void 0 ? _a : []);
|
|
807
784
|
delete props["data-plasmic-override"];
|
|
808
|
-
delete props["data-plasmic-wrap-flex-child"];
|
|
809
785
|
delete props["data-plasmic-trigger-props"];
|
|
810
786
|
return createPlasmicElement(override, defaultElement, mergeProps.apply(void 0, __spreadArray([props,
|
|
811
787
|
children.length === 0
|
|
812
788
|
? {}
|
|
813
|
-
: { children: children.length === 1 ? children[0] : children }], __read(triggerProps), false))
|
|
789
|
+
: { children: children.length === 1 ? children[0] : children }], __read(triggerProps), false)));
|
|
814
790
|
}
|
|
815
791
|
function makeFragment() {
|
|
816
792
|
var children = [];
|