@plasmicapp/react-web 0.2.226 → 0.2.228
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 +1 -0
- package/dist/index.cjs.js +18 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/react-web.esm.js +18 -4
- package/dist/react-web.esm.js.map +1 -1
- package/dist/render/PlasmicLink.d.ts +1 -0
- package/dist/render/ssr.d.ts +1 -0
- package/package.json +4 -4
- package/skinny/dist/index.js +3 -27
- package/skinny/dist/index.js.map +1 -1
- 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/render/PlasmicLink.d.ts +1 -0
- package/skinny/dist/render/ssr.d.ts +1 -0
- package/skinny/dist/{ssr-e2ce462a.js → ssr-04cb202c.js} +45 -6
- package/skinny/dist/ssr-04cb202c.js.map +1 -0
- package/skinny/dist/ssr-e2ce462a.js.map +0 -1
package/dist/all.d.ts
CHANGED
|
@@ -12051,6 +12051,7 @@ interface PlasmicRootProviderProps extends PlasmicDataSourceContextValue {
|
|
|
12051
12051
|
*/
|
|
12052
12052
|
translator?: PlasmicTranslator;
|
|
12053
12053
|
Head?: React$1.ComponentType<any>;
|
|
12054
|
+
Link?: React$1.ComponentType<any>;
|
|
12054
12055
|
disableLoadingBoundary?: boolean;
|
|
12055
12056
|
suspenseFallback?: React$1.ReactNode;
|
|
12056
12057
|
}
|
package/dist/index.cjs.js
CHANGED
|
@@ -7,9 +7,9 @@ var classNames$1 = require('classnames');
|
|
|
7
7
|
var dataSourcesContext = require('@plasmicapp/data-sources-context');
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var get = require('dlv');
|
|
10
|
+
var host = require('@plasmicapp/host');
|
|
10
11
|
var ReactDOM = require('react-dom');
|
|
11
12
|
var ssr = require('@react-aria/ssr');
|
|
12
|
-
var host = require('@plasmicapp/host');
|
|
13
13
|
var focus = require('@react-aria/focus');
|
|
14
14
|
var valtio = require('valtio');
|
|
15
15
|
var clone = require('clone');
|
|
@@ -1399,6 +1399,19 @@ var PLASMIC_IMAGE_LOADER = {
|
|
|
1399
1399
|
};
|
|
1400
1400
|
|
|
1401
1401
|
var PlasmicLink = React__default['default'].forwardRef(function PlasmicLink(props, ref) {
|
|
1402
|
+
var _a;
|
|
1403
|
+
// The usePlasmicLinkMaybe function may be undefined, if host is not up-to-date
|
|
1404
|
+
var Link = (_a = host.usePlasmicLinkMaybe === null || host.usePlasmicLinkMaybe === void 0 ? void 0 : host.usePlasmicLinkMaybe()) !== null && _a !== void 0 ? _a : PlasmicLinkInternal;
|
|
1405
|
+
if (Link === PlasmicLink || Link === PlasmicLinkInternal) {
|
|
1406
|
+
// Just in case, break the cycle
|
|
1407
|
+
return React__default['default'].createElement(PlasmicLinkInternal, __assign({}, props, { ref: ref }));
|
|
1408
|
+
}
|
|
1409
|
+
else {
|
|
1410
|
+
// Don't pass component/platform props to non-PlasmicLinkInternal
|
|
1411
|
+
return React__default['default'].createElement(Link, __assign({}, omit(props, "component", "platform"), { ref: ref }));
|
|
1412
|
+
}
|
|
1413
|
+
});
|
|
1414
|
+
var PlasmicLinkInternal = React__default['default'].forwardRef(function PlasmicLinkInternal(props, ref) {
|
|
1402
1415
|
// props.href is required for nextjs; if no props.href,
|
|
1403
1416
|
// then we just render the default anchor element
|
|
1404
1417
|
if (props.platform === "nextjs" && props.href) {
|
|
@@ -1643,8 +1656,8 @@ function createUseScreenVariants(isMulti, screenQueries) {
|
|
|
1643
1656
|
|
|
1644
1657
|
var PlasmicRootContext = React__namespace.createContext(undefined);
|
|
1645
1658
|
function PlasmicRootProvider(props) {
|
|
1646
|
-
var _a;
|
|
1647
|
-
var platform = props.platform, children = props.children, userAuthToken = props.userAuthToken, isUserLoading = props.isUserLoading, authRedirectUri = props.authRedirectUri, user = props.user, disableLoadingBoundary = props.disableLoadingBoundary, suspenseFallback = props.suspenseFallback;
|
|
1659
|
+
var _a, _b;
|
|
1660
|
+
var platform = props.platform, children = props.children, userAuthToken = props.userAuthToken, isUserLoading = props.isUserLoading, authRedirectUri = props.authRedirectUri, user = props.user, disableLoadingBoundary = props.disableLoadingBoundary, suspenseFallback = props.suspenseFallback;
|
|
1648
1661
|
var context = React__namespace.useMemo(function () { return ({
|
|
1649
1662
|
platform: platform,
|
|
1650
1663
|
}); }, [platform]);
|
|
@@ -1661,7 +1674,8 @@ function PlasmicRootProvider(props) {
|
|
|
1661
1674
|
React__namespace.createElement(ssr.SSRProvider, null,
|
|
1662
1675
|
React__namespace.createElement(dataSourcesContext.PlasmicDataSourceContextProvider, { value: dataSourceContextValue },
|
|
1663
1676
|
React__namespace.createElement(PlasmicTranslatorContext.Provider, { value: (_a = props.i18n) !== null && _a !== void 0 ? _a : props.translator },
|
|
1664
|
-
React__namespace.createElement(PlasmicHeadContext.Provider, { value: props.Head },
|
|
1677
|
+
React__namespace.createElement(PlasmicHeadContext.Provider, { value: props.Head },
|
|
1678
|
+
React__namespace.createElement(host.PlasmicLinkProvider, { Link: (_b = props.Link) !== null && _b !== void 0 ? _b : PlasmicLinkInternal }, children))))))));
|
|
1665
1679
|
}
|
|
1666
1680
|
var useIsSSR = ssr.useIsSSR;
|
|
1667
1681
|
function useHasPlasmicRoot() {
|