@plasmicapp/react-web 0.2.226 → 0.2.227

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 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,18 @@ 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) {
1406
+ // Just in case, break the cycle
1407
+ return React__default['default'].createElement(PlasmicLinkInternal, __assign({}, props, { ref: ref }));
1408
+ }
1409
+ else {
1410
+ return React__default['default'].createElement(Link, __assign({}, props, { ref: ref }));
1411
+ }
1412
+ });
1413
+ var PlasmicLinkInternal = React__default['default'].forwardRef(function PlasmicLinkInternal(props, ref) {
1402
1414
  // props.href is required for nextjs; if no props.href,
1403
1415
  // then we just render the default anchor element
1404
1416
  if (props.platform === "nextjs" && props.href) {
@@ -1643,8 +1655,8 @@ function createUseScreenVariants(isMulti, screenQueries) {
1643
1655
 
1644
1656
  var PlasmicRootContext = React__namespace.createContext(undefined);
1645
1657
  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; props.i18n;
1658
+ var _a, _b;
1659
+ 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
1660
  var context = React__namespace.useMemo(function () { return ({
1649
1661
  platform: platform,
1650
1662
  }); }, [platform]);
@@ -1661,7 +1673,8 @@ function PlasmicRootProvider(props) {
1661
1673
  React__namespace.createElement(ssr.SSRProvider, null,
1662
1674
  React__namespace.createElement(dataSourcesContext.PlasmicDataSourceContextProvider, { value: dataSourceContextValue },
1663
1675
  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 }, children)))))));
1676
+ React__namespace.createElement(PlasmicHeadContext.Provider, { value: props.Head },
1677
+ React__namespace.createElement(host.PlasmicLinkProvider, { Link: (_b = props.Link) !== null && _b !== void 0 ? _b : PlasmicLinkInternal }, children))))))));
1665
1678
  }
1666
1679
  var useIsSSR = ssr.useIsSSR;
1667
1680
  function useHasPlasmicRoot() {