@plasmicapp/react-web 0.2.224 → 0.2.226
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 +12 -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 +4 -4
- 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/all.d.ts
CHANGED
|
@@ -11192,6 +11192,10 @@ interface CodeComponentMeta<P> {
|
|
|
11192
11192
|
* will always be named by the name of this component.
|
|
11193
11193
|
*/
|
|
11194
11194
|
alwaysAutoName?: boolean;
|
|
11195
|
+
/**
|
|
11196
|
+
* If true, then won't be listed in the insert menu for content creators.
|
|
11197
|
+
*/
|
|
11198
|
+
hideFromContentCreators?: boolean;
|
|
11195
11199
|
refActions?: Record<string, RefActionRegistration<P>>;
|
|
11196
11200
|
}
|
|
11197
11201
|
interface FunctionParam<P> {
|
|
@@ -12019,6 +12023,10 @@ type PlasmicTranslator = (str: string, opts?: {
|
|
|
12019
12023
|
[key: string]: React__default.ReactElement;
|
|
12020
12024
|
};
|
|
12021
12025
|
}) => React__default.ReactNode;
|
|
12026
|
+
interface PlasmicI18NContextValue {
|
|
12027
|
+
translator?: PlasmicTranslator;
|
|
12028
|
+
tagPrefix?: string;
|
|
12029
|
+
}
|
|
12022
12030
|
interface TransProps {
|
|
12023
12031
|
transKey?: string;
|
|
12024
12032
|
children?: React__default.ReactNode;
|
|
@@ -12037,6 +12045,10 @@ declare function Trans({ transKey, children }: TransProps): React__default.React
|
|
|
12037
12045
|
interface PlasmicRootProviderProps extends PlasmicDataSourceContextValue {
|
|
12038
12046
|
platform?: "nextjs" | "gatsby";
|
|
12039
12047
|
children?: React$1.ReactNode;
|
|
12048
|
+
i18n?: PlasmicI18NContextValue;
|
|
12049
|
+
/**
|
|
12050
|
+
* @deprecated use i18n.translator instead
|
|
12051
|
+
*/
|
|
12040
12052
|
translator?: PlasmicTranslator;
|
|
12041
12053
|
Head?: React$1.ComponentType<any>;
|
|
12042
12054
|
disableLoadingBoundary?: boolean;
|
package/dist/index.cjs.js
CHANGED
|
@@ -1481,12 +1481,19 @@ function genTranslatableString(elt, opts) {
|
|
|
1481
1481
|
function Trans(_a) {
|
|
1482
1482
|
var transKey = _a.transKey, children = _a.children;
|
|
1483
1483
|
var _t = React__default['default'].useContext(PlasmicTranslatorContext);
|
|
1484
|
-
|
|
1484
|
+
var translator = _t
|
|
1485
|
+
? typeof _t === "function"
|
|
1486
|
+
? _t
|
|
1487
|
+
: _t.translator
|
|
1488
|
+
: undefined;
|
|
1489
|
+
if (!translator) {
|
|
1485
1490
|
warnNoTranslationFunctionAtMostOnce();
|
|
1486
1491
|
return children;
|
|
1487
1492
|
}
|
|
1488
|
-
var _b = genTranslatableString(children
|
|
1489
|
-
|
|
1493
|
+
var _b = genTranslatableString(children, {
|
|
1494
|
+
tagPrefix: typeof _t === "object" ? _t.tagPrefix : undefined,
|
|
1495
|
+
}), str = _b.str, components = _b.components, componentsCount = _b.componentsCount;
|
|
1496
|
+
return translator(transKey !== null && transKey !== void 0 ? transKey : str, componentsCount > 0 ? { components: components } : undefined);
|
|
1490
1497
|
}
|
|
1491
1498
|
var hasWarned = false;
|
|
1492
1499
|
function warnNoTranslationFunctionAtMostOnce() {
|
|
@@ -1636,7 +1643,8 @@ function createUseScreenVariants(isMulti, screenQueries) {
|
|
|
1636
1643
|
|
|
1637
1644
|
var PlasmicRootContext = React__namespace.createContext(undefined);
|
|
1638
1645
|
function PlasmicRootProvider(props) {
|
|
1639
|
-
var
|
|
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;
|
|
1640
1648
|
var context = React__namespace.useMemo(function () { return ({
|
|
1641
1649
|
platform: platform,
|
|
1642
1650
|
}); }, [platform]);
|
|
@@ -1652,7 +1660,7 @@ function PlasmicRootProvider(props) {
|
|
|
1652
1660
|
React__namespace.createElement(PlasmicRootContext.Provider, { value: context },
|
|
1653
1661
|
React__namespace.createElement(ssr.SSRProvider, null,
|
|
1654
1662
|
React__namespace.createElement(dataSourcesContext.PlasmicDataSourceContextProvider, { value: dataSourceContextValue },
|
|
1655
|
-
React__namespace.createElement(PlasmicTranslatorContext.Provider, { value: props.translator },
|
|
1663
|
+
React__namespace.createElement(PlasmicTranslatorContext.Provider, { value: (_a = props.i18n) !== null && _a !== void 0 ? _a : props.translator },
|
|
1656
1664
|
React__namespace.createElement(PlasmicHeadContext.Provider, { value: props.Head }, children)))))));
|
|
1657
1665
|
}
|
|
1658
1666
|
var useIsSSR = ssr.useIsSSR;
|