@plasmicapp/react-web 0.2.224 → 0.2.225
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 +8 -0
- package/dist/index.cjs.js +13 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/react-web.esm.js +13 -5
- package/dist/react-web.esm.js.map +1 -1
- package/dist/render/ssr.d.ts +5 -1
- package/dist/render/translation.d.ts +5 -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/render/ssr.d.ts +5 -1
- package/skinny/dist/render/translation.d.ts +5 -1
- package/skinny/dist/{ssr-3b4954dc.js → ssr-e2ce462a.js} +14 -6
- package/skinny/dist/ssr-e2ce462a.js.map +1 -0
- package/skinny/dist/ssr-3b4954dc.js.map +0 -1
package/dist/react-web.esm.js
CHANGED
|
@@ -1450,12 +1450,19 @@ function genTranslatableString(elt, opts) {
|
|
|
1450
1450
|
function Trans(_a) {
|
|
1451
1451
|
var transKey = _a.transKey, children = _a.children;
|
|
1452
1452
|
var _t = React__default.useContext(PlasmicTranslatorContext);
|
|
1453
|
-
|
|
1453
|
+
var translator = _t
|
|
1454
|
+
? typeof _t === "function"
|
|
1455
|
+
? _t
|
|
1456
|
+
: _t.translator
|
|
1457
|
+
: undefined;
|
|
1458
|
+
if (!translator) {
|
|
1454
1459
|
warnNoTranslationFunctionAtMostOnce();
|
|
1455
1460
|
return children;
|
|
1456
1461
|
}
|
|
1457
|
-
var _b = genTranslatableString(children
|
|
1458
|
-
|
|
1462
|
+
var _b = genTranslatableString(children, {
|
|
1463
|
+
tagPrefix: typeof _t === "object" ? _t.tagPrefix : undefined,
|
|
1464
|
+
}), str = _b.str, components = _b.components, componentsCount = _b.componentsCount;
|
|
1465
|
+
return translator(transKey !== null && transKey !== void 0 ? transKey : str, componentsCount > 0 ? { components: components } : undefined);
|
|
1459
1466
|
}
|
|
1460
1467
|
var hasWarned = false;
|
|
1461
1468
|
function warnNoTranslationFunctionAtMostOnce() {
|
|
@@ -1605,7 +1612,8 @@ function createUseScreenVariants(isMulti, screenQueries) {
|
|
|
1605
1612
|
|
|
1606
1613
|
var PlasmicRootContext = React.createContext(undefined);
|
|
1607
1614
|
function PlasmicRootProvider(props) {
|
|
1608
|
-
var
|
|
1615
|
+
var _a;
|
|
1616
|
+
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;
|
|
1609
1617
|
var context = React.useMemo(function () { return ({
|
|
1610
1618
|
platform: platform,
|
|
1611
1619
|
}); }, [platform]);
|
|
@@ -1621,7 +1629,7 @@ function PlasmicRootProvider(props) {
|
|
|
1621
1629
|
React.createElement(PlasmicRootContext.Provider, { value: context },
|
|
1622
1630
|
React.createElement(SSRProvider, null,
|
|
1623
1631
|
React.createElement(PlasmicDataSourceContextProvider, { value: dataSourceContextValue },
|
|
1624
|
-
React.createElement(PlasmicTranslatorContext.Provider, { value: props.translator },
|
|
1632
|
+
React.createElement(PlasmicTranslatorContext.Provider, { value: (_a = props.i18n) !== null && _a !== void 0 ? _a : props.translator },
|
|
1625
1633
|
React.createElement(PlasmicHeadContext.Provider, { value: props.Head }, children)))))));
|
|
1626
1634
|
}
|
|
1627
1635
|
var useIsSSR = useIsSSR$1;
|