@plasmicapp/react-web 0.2.417 → 0.2.418
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/index.cjs.js +17 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/react-web.esm.js +17 -6
- package/dist/react-web.esm.js.map +1 -1
- package/package.json +2 -2
- package/skinny/dist/index.js +2 -2
- package/skinny/dist/plume/checkbox/index.js +1 -1
- package/skinny/dist/plume/menu/index.js +1 -1
- package/skinny/dist/plume/menu-button/index.js +1 -1
- package/skinny/dist/plume/select/index.js +1 -1
- package/skinny/dist/plume/switch/index.js +1 -1
- package/skinny/dist/{ssr-649d12f8.js → ssr-6f8097cb.js} +19 -8
- package/skinny/dist/ssr-6f8097cb.js.map +1 -0
- package/skinny/dist/ssr-649d12f8.js.map +0 -1
package/dist/react-web.esm.js
CHANGED
|
@@ -1034,6 +1034,8 @@ var PLASMIC_IMAGE_LOADER = {
|
|
|
1034
1034
|
},
|
|
1035
1035
|
};
|
|
1036
1036
|
|
|
1037
|
+
// These props are used internally by PlasmicLink to determine how to render the link
|
|
1038
|
+
var INTERNAL_PROPS = ["component", "platform", "legacyBehavior"];
|
|
1037
1039
|
var PlasmicLink = React__default.forwardRef(function PlasmicLink(props, ref) {
|
|
1038
1040
|
var _a;
|
|
1039
1041
|
// The usePlasmicLinkMaybe function may be undefined, if host is not up-to-date
|
|
@@ -1043,8 +1045,9 @@ var PlasmicLink = React__default.forwardRef(function PlasmicLink(props, ref) {
|
|
|
1043
1045
|
return React__default.createElement(PlasmicLinkInternal, __assign({}, props, { ref: ref }));
|
|
1044
1046
|
}
|
|
1045
1047
|
else {
|
|
1046
|
-
// Don't pass component/platform
|
|
1047
|
-
|
|
1048
|
+
// Don't pass internal props (component/platform/legacyBehavior) to non-PlasmicLinkInternal
|
|
1049
|
+
// eslint-disable-next-line react/forbid-elements
|
|
1050
|
+
return React__default.createElement(Link, __assign({}, omit.apply(void 0, __spreadArray([props], __read(INTERNAL_PROPS), false)), { ref: ref }));
|
|
1048
1051
|
}
|
|
1049
1052
|
});
|
|
1050
1053
|
var PlasmicLinkInternal = React__default.forwardRef(function PlasmicLinkInternal(props, ref) {
|
|
@@ -1064,15 +1067,23 @@ var PlasmicLinkInternal = React__default.forwardRef(function PlasmicLinkInternal
|
|
|
1064
1067
|
// If this is a fragment identifier link, then we set
|
|
1065
1068
|
// scroll={false} so that smooth scrolling works
|
|
1066
1069
|
var isFragment = (_a = props.href) === null || _a === void 0 ? void 0 : _a.startsWith("#");
|
|
1067
|
-
|
|
1070
|
+
// Default to legacy behavior (nested <a> tag) unless legacyBehavior
|
|
1071
|
+
// is explicitly set to false. Older codegen may not set this prop at
|
|
1072
|
+
// all, so we treat undefined as legacy for backwards compatibility.
|
|
1073
|
+
// https://github.com/plasmicapp/plasmic-internal/pull/2203#issuecomment-3877931788
|
|
1074
|
+
if (props.legacyBehavior !== false) {
|
|
1075
|
+
return React__default.createElement(props.component, __assign({ scroll: !isFragment }, pick.apply(void 0, __spreadArray([props], __read(nextjsProps), false))), React__default.createElement("a", __assign({}, omit.apply(void 0, __spreadArray(__spreadArray([props], __read(INTERNAL_PROPS), false), __read(nextjsProps), false)), { ref: ref })));
|
|
1076
|
+
}
|
|
1077
|
+
// pass props directly to Link (no nested <a>)
|
|
1078
|
+
return React__default.createElement(props.component, __assign(__assign({ scroll: !isFragment }, omit.apply(void 0, __spreadArray([props], __read(INTERNAL_PROPS), false))), { ref: ref }));
|
|
1068
1079
|
}
|
|
1069
1080
|
if (props.platform === "gatsby" && isInternalHref(props.href)) {
|
|
1070
|
-
return React__default.createElement(props.component, __assign(__assign({}, omit(props,
|
|
1081
|
+
return React__default.createElement(props.component, __assign(__assign({}, omit.apply(void 0, __spreadArray(__spreadArray([props], __read(INTERNAL_PROPS), false), ["href"], false))), { to: props.href, ref: ref }));
|
|
1071
1082
|
}
|
|
1072
1083
|
if (props.platform === "tanstack" && isInternalHref(props.href)) {
|
|
1073
|
-
return React__default.createElement(props.component, __assign(__assign({}, omit(props,
|
|
1084
|
+
return React__default.createElement(props.component, __assign(__assign({}, omit.apply(void 0, __spreadArray(__spreadArray([props], __read(INTERNAL_PROPS), false), ["href"], false))), { to: props.href, ref: ref }));
|
|
1074
1085
|
}
|
|
1075
|
-
return React__default.createElement("a", __assign({}, omit(props,
|
|
1086
|
+
return React__default.createElement("a", __assign({}, omit.apply(void 0, __spreadArray([props], __read(INTERNAL_PROPS), false)), { ref: ref }));
|
|
1076
1087
|
});
|
|
1077
1088
|
function isInternalHref(href) {
|
|
1078
1089
|
return /^\/(?!\/)/.test(href);
|