@plasmicapp/react-web 0.2.220 → 0.2.222
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 +25 -10
- package/dist/index-common.d.ts +1 -1
- package/dist/index.cjs.js +17 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/plume/button/index.d.ts +13 -6
- package/dist/plume/text-input/index.d.ts +6 -2
- package/dist/react-web.esm.js +17 -9
- package/dist/react-web.esm.js.map +1 -1
- package/dist/render/ssr.d.ts +2 -0
- package/dist/render/translation.d.ts +3 -1
- package/package.json +5 -5
- package/skinny/dist/index-common.d.ts +1 -1
- package/skinny/dist/index.js +3 -2
- package/skinny/dist/index.js.map +1 -1
- package/skinny/dist/plume/button/index.d.ts +13 -6
- package/skinny/dist/plume/button/index.js.map +1 -1
- package/skinny/dist/plume/checkbox/index.js +2 -1
- package/skinny/dist/plume/checkbox/index.js.map +1 -1
- package/skinny/dist/plume/menu/index.js +2 -1
- package/skinny/dist/plume/menu/index.js.map +1 -1
- package/skinny/dist/plume/menu-button/index.js +2 -1
- package/skinny/dist/plume/menu-button/index.js.map +1 -1
- package/skinny/dist/plume/select/index.js +1 -1
- package/skinny/dist/plume/switch/index.js +2 -1
- package/skinny/dist/plume/switch/index.js.map +1 -1
- package/skinny/dist/plume/text-input/index.d.ts +6 -2
- package/skinny/dist/plume/text-input/index.js.map +1 -1
- package/skinny/dist/render/ssr.d.ts +2 -0
- package/skinny/dist/render/translation.d.ts +3 -1
- package/skinny/dist/{ssr-73c750f9.js → ssr-3b4954dc.js} +18 -9
- package/skinny/dist/ssr-3b4954dc.js.map +1 -0
- package/skinny/dist/ssr-73c750f9.js.map +0 -1
package/dist/all.d.ts
CHANGED
|
@@ -12023,7 +12023,9 @@ interface TransProps {
|
|
|
12023
12023
|
transKey?: string;
|
|
12024
12024
|
children?: React__default.ReactNode;
|
|
12025
12025
|
}
|
|
12026
|
-
declare function genTranslatableString(elt: React__default.ReactNode
|
|
12026
|
+
declare function genTranslatableString(elt: React__default.ReactNode, opts?: {
|
|
12027
|
+
tagPrefix?: string;
|
|
12028
|
+
}): {
|
|
12027
12029
|
str: string;
|
|
12028
12030
|
components: {
|
|
12029
12031
|
[key: string]: React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>>;
|
|
@@ -12037,6 +12039,8 @@ interface PlasmicRootProviderProps extends PlasmicDataSourceContextValue {
|
|
|
12037
12039
|
children?: React$1.ReactNode;
|
|
12038
12040
|
translator?: PlasmicTranslator;
|
|
12039
12041
|
Head?: React$1.ComponentType<any>;
|
|
12042
|
+
disableLoadingBoundary?: boolean;
|
|
12043
|
+
suspenseFallback?: React$1.ReactNode;
|
|
12040
12044
|
}
|
|
12041
12045
|
declare function PlasmicRootProvider(props: PlasmicRootProviderProps): JSX.Element;
|
|
12042
12046
|
declare const useIsSSR: typeof useIsSSR$1;
|
|
@@ -12433,7 +12437,7 @@ type PlasmicClassVariants<C extends AnyPlasmicClass> = C extends PlasmicClass<in
|
|
|
12433
12437
|
type PlasmicClassArgs<C extends AnyPlasmicClass> = C extends PlasmicClass<any, infer A, any> ? A : unknown;
|
|
12434
12438
|
type PlasmicClassOverrides<C extends AnyPlasmicClass> = C extends PlasmicClass<any, any, infer O> ? O : unknown;
|
|
12435
12439
|
|
|
12436
|
-
interface
|
|
12440
|
+
interface PlumeCommonProps {
|
|
12437
12441
|
showStartIcon?: boolean;
|
|
12438
12442
|
showEndIcon?: boolean;
|
|
12439
12443
|
startIcon?: React$1.ReactNode;
|
|
@@ -12442,15 +12446,22 @@ interface CommonProps {
|
|
|
12442
12446
|
isDisabled?: boolean;
|
|
12443
12447
|
}
|
|
12444
12448
|
interface HtmlButtonProps extends Omit<React$1.ComponentProps<"button">, "ref" | "disabled"> {
|
|
12445
|
-
submitsForm?: boolean;
|
|
12446
12449
|
}
|
|
12447
12450
|
interface HtmlAnchorProps extends Omit<React$1.ComponentProps<"a">, "ref" | "href" | "target"> {
|
|
12451
|
+
}
|
|
12452
|
+
interface PlumeActualButtonProps {
|
|
12453
|
+
submitsForm?: boolean;
|
|
12454
|
+
}
|
|
12455
|
+
interface PlumeAnchorProps {
|
|
12448
12456
|
link?: string;
|
|
12449
12457
|
target?: React$1.ComponentProps<"a">["target"] | boolean;
|
|
12450
12458
|
}
|
|
12451
|
-
type
|
|
12452
|
-
type
|
|
12453
|
-
type
|
|
12459
|
+
type PlumeButtonProps = PlumeCommonProps & PlumeActualButtonProps & PlumeAnchorProps;
|
|
12460
|
+
type BaseButtonProps = PlumeButtonProps & HtmlButtonProps & HtmlAnchorProps;
|
|
12461
|
+
type AllButtonProps = PlumeCommonProps & PlumeActualButtonProps & HtmlButtonProps;
|
|
12462
|
+
type AllAnchorProps = PlumeCommonProps & PlumeAnchorProps & HtmlAnchorProps;
|
|
12463
|
+
type HtmlAnchorOnlyProps = Exclude<keyof AllAnchorProps, keyof AllButtonProps>;
|
|
12464
|
+
type HtmlButtonOnlyProps = Exclude<keyof AllButtonProps, keyof AllAnchorProps>;
|
|
12454
12465
|
type ButtonRef = React$1.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
12455
12466
|
interface ButtonConfig<C extends AnyPlasmicClass> {
|
|
12456
12467
|
showStartIconVariant: VariantDef<PlasmicClassVariants<C>>;
|
|
@@ -12461,7 +12472,7 @@ interface ButtonConfig<C extends AnyPlasmicClass> {
|
|
|
12461
12472
|
contentSlot: keyof PlasmicClassArgs<C>;
|
|
12462
12473
|
root: keyof PlasmicClassOverrides<C>;
|
|
12463
12474
|
}
|
|
12464
|
-
declare function useButton<P extends
|
|
12475
|
+
declare function useButton<P extends PlumeButtonProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: ButtonConfig<C>, ref?: ButtonRef): {
|
|
12465
12476
|
plasmicProps: {
|
|
12466
12477
|
variants: PlasmicClassVariants<C>;
|
|
12467
12478
|
args: PlasmicClassArgs<C>;
|
|
@@ -13305,7 +13316,9 @@ declare function useSwitch<P extends SwitchProps, C extends AnyPlasmicClass>(pla
|
|
|
13305
13316
|
state: SwitchState;
|
|
13306
13317
|
};
|
|
13307
13318
|
|
|
13308
|
-
interface BaseTextInputProps extends Omit<React$1.ComponentProps<"input">, "type" | "disabled"
|
|
13319
|
+
interface BaseTextInputProps extends Omit<React$1.ComponentProps<"input">, "type" | "disabled">, PlumeTextInputProps {
|
|
13320
|
+
}
|
|
13321
|
+
interface PlumeTextInputProps {
|
|
13309
13322
|
showStartIcon?: boolean;
|
|
13310
13323
|
showEndIcon?: boolean;
|
|
13311
13324
|
startIcon?: React$1.ReactNode;
|
|
@@ -13314,6 +13327,8 @@ interface BaseTextInputProps extends Omit<React$1.ComponentProps<"input">, "type
|
|
|
13314
13327
|
type?: "text" | "password" | "email" | "url" | string;
|
|
13315
13328
|
inputClassName?: string;
|
|
13316
13329
|
inputStyle?: React$1.CSSProperties;
|
|
13330
|
+
className?: string;
|
|
13331
|
+
style?: React$1.CSSProperties;
|
|
13317
13332
|
}
|
|
13318
13333
|
interface TextInputRefValue {
|
|
13319
13334
|
focus: () => void;
|
|
@@ -13331,7 +13346,7 @@ interface TextInputConfig<C extends AnyPlasmicClass> {
|
|
|
13331
13346
|
root: keyof PlasmicClassOverrides<C>;
|
|
13332
13347
|
input: keyof PlasmicClassOverrides<C>;
|
|
13333
13348
|
}
|
|
13334
|
-
declare function useTextInput<P extends
|
|
13349
|
+
declare function useTextInput<P extends PlumeTextInputProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: TextInputConfig<C>, ref?: TextInputRef): {
|
|
13335
13350
|
plasmicProps: {
|
|
13336
13351
|
variants: PlasmicClassVariants<C>;
|
|
13337
13352
|
args: PlasmicClassArgs<C>;
|
|
@@ -13384,4 +13399,4 @@ interface TriggeredOverlayContextValue {
|
|
|
13384
13399
|
}
|
|
13385
13400
|
declare const TriggeredOverlayContext: React$1.Context<TriggeredOverlayContextValue | undefined>;
|
|
13386
13401
|
|
|
13387
|
-
export { $State, $StateSpec, BaseButtonProps, BaseMenuButtonProps, BaseMenuGroupProps, BaseMenuItemProps, BaseMenuProps, BaseSelectOptionGroupProps, BaseSelectOptionProps, BaseSelectProps, BaseTextInputProps, BaseTriggeredOverlayProps, ButtonRef, CheckboxProps, CheckboxRef, CheckboxRefValue, DropdownMenu, Flex, HTMLElementRefOf, HtmlAnchorOnlyProps, HtmlButtonOnlyProps, MenuButtonRef, MenuButtonRefValue, MenuRef, MenuRefValue, MultiChoiceArg, PlasmicDataSourceContextProvider, PlasmicHead, PlasmicIcon, PlasmicImg, PlasmicLink, PlasmicPageGuard, PlasmicRootProvider, PlasmicSlot, SelectContext, SelectOptionRef, SelectRef, SelectRefValue, SingleBooleanChoiceArg, SingleChoiceArg, Stack, StrictProps, SwitchProps, SwitchRef, SwitchRefValue, TextInputRef, TextInputRefValue, Trans, TriggeredOverlayConfig, TriggeredOverlayContext, TriggeredOverlayRef, classNames, createPlasmicElementProxy, createUseScreenVariants, deriveRenderOpts, ensureGlobalVariants, genTranslatableString, generateStateOnChangeProp, generateStateOnChangePropForCodeComponents, generateStateValueProp, dlv as get, getCurrentInitialValue, getDataProps, getStateCellsInPlasmicProxy, getStateSpecInPlasmicProxy, hasVariant, initializeCodeComponentStates, initializePlasmicStates, is$StateProxy, isPlasmicStateProxy, makeFragment, mergeVariantsWithStates, omit, pick, plasmicHeadMeta, renderPlasmicSlot, resetToInitialValue, set, setPlumeStrictMode, useButton, useCheckbox, useCurrentUser, useDollarState, useIsSSR, useMenu, useMenuButton, useMenuGroup, useMenuItem, useSelect, useSelectOption, useSelectOptionGroup, useSwitch, useTextInput, useTrigger, useTriggeredOverlay, withPlasmicPageGuard, wrapWithClassName };
|
|
13402
|
+
export { $State, $StateSpec, BaseButtonProps, BaseMenuButtonProps, BaseMenuGroupProps, BaseMenuItemProps, BaseMenuProps, BaseSelectOptionGroupProps, BaseSelectOptionProps, BaseSelectProps, BaseTextInputProps, BaseTriggeredOverlayProps, ButtonRef, CheckboxProps, CheckboxRef, CheckboxRefValue, DropdownMenu, Flex, HTMLElementRefOf, HtmlAnchorOnlyProps, HtmlButtonOnlyProps, MenuButtonRef, MenuButtonRefValue, MenuRef, MenuRefValue, MultiChoiceArg, PlasmicDataSourceContextProvider, PlasmicHead, PlasmicIcon, PlasmicImg, PlasmicLink, PlasmicPageGuard, PlasmicRootProvider, PlasmicSlot, PlasmicTranslator, PlumeButtonProps, PlumeTextInputProps, SelectContext, SelectOptionRef, SelectRef, SelectRefValue, SingleBooleanChoiceArg, SingleChoiceArg, Stack, StrictProps, SwitchProps, SwitchRef, SwitchRefValue, TextInputRef, TextInputRefValue, Trans, TriggeredOverlayConfig, TriggeredOverlayContext, TriggeredOverlayRef, classNames, createPlasmicElementProxy, createUseScreenVariants, deriveRenderOpts, ensureGlobalVariants, genTranslatableString, generateStateOnChangeProp, generateStateOnChangePropForCodeComponents, generateStateValueProp, dlv as get, getCurrentInitialValue, getDataProps, getStateCellsInPlasmicProxy, getStateSpecInPlasmicProxy, hasVariant, initializeCodeComponentStates, initializePlasmicStates, is$StateProxy, isPlasmicStateProxy, makeFragment, mergeVariantsWithStates, omit, pick, plasmicHeadMeta, renderPlasmicSlot, resetToInitialValue, set, setPlumeStrictMode, useButton, useCheckbox, useCurrentUser, useDollarState, useIsSSR, useMenu, useMenuButton, useMenuGroup, useMenuItem, useSelect, useSelectOption, useSelectOptionGroup, useSwitch, useTextInput, useTrigger, useTriggeredOverlay, withPlasmicPageGuard, wrapWithClassName };
|
package/dist/index-common.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export { PlasmicSlot, renderPlasmicSlot } from "./render/PlasmicSlot";
|
|
|
12
12
|
export { createUseScreenVariants } from "./render/screen-variants";
|
|
13
13
|
export { PlasmicDataSourceContextProvider, PlasmicRootProvider, useCurrentUser, useIsSSR, } from "./render/ssr";
|
|
14
14
|
export { Stack } from "./render/Stack";
|
|
15
|
-
export { genTranslatableString, Trans } from "./render/translation";
|
|
15
|
+
export { genTranslatableString, Trans, PlasmicTranslator, } from "./render/translation";
|
|
16
16
|
export { useTrigger } from "./render/triggers";
|
|
17
17
|
export * from "./states";
|
|
18
18
|
export declare const classNames: typeof _classNames;
|
package/dist/index.cjs.js
CHANGED
|
@@ -9,6 +9,7 @@ var React = require('react');
|
|
|
9
9
|
var get = require('dlv');
|
|
10
10
|
var ReactDOM = require('react-dom');
|
|
11
11
|
var ssr = require('@react-aria/ssr');
|
|
12
|
+
var host = require('@plasmicapp/host');
|
|
12
13
|
var focus = require('@react-aria/focus');
|
|
13
14
|
var valtio = require('valtio');
|
|
14
15
|
var clone = require('clone');
|
|
@@ -22,7 +23,6 @@ var collections = require('@react-stately/collections');
|
|
|
22
23
|
var separator = require('@react-aria/separator');
|
|
23
24
|
var menu$1 = require('@react-stately/menu');
|
|
24
25
|
var interactions = require('@react-aria/interactions');
|
|
25
|
-
var host = require('@plasmicapp/host');
|
|
26
26
|
var listbox = require('@react-aria/listbox');
|
|
27
27
|
var select$1 = require('@react-aria/select');
|
|
28
28
|
var select = require('@react-stately/select');
|
|
@@ -1426,10 +1426,11 @@ var PlasmicTranslatorContext = React__default['default'].createContext(undefined
|
|
|
1426
1426
|
function isIterable(val) {
|
|
1427
1427
|
return val != null && typeof val[Symbol.iterator] === "function";
|
|
1428
1428
|
}
|
|
1429
|
-
function genTranslatableString(elt) {
|
|
1429
|
+
function genTranslatableString(elt, opts) {
|
|
1430
1430
|
var components = {};
|
|
1431
1431
|
var componentsCount = 0;
|
|
1432
1432
|
var getText = function (node) {
|
|
1433
|
+
var _a;
|
|
1433
1434
|
if (!node) {
|
|
1434
1435
|
return "";
|
|
1435
1436
|
}
|
|
@@ -1459,7 +1460,8 @@ function genTranslatableString(elt) {
|
|
|
1459
1460
|
if (React__default['default'].isValidElement(node) && node.type === React__default['default'].Fragment) {
|
|
1460
1461
|
return contents;
|
|
1461
1462
|
}
|
|
1462
|
-
var
|
|
1463
|
+
var prefix = (_a = opts === null || opts === void 0 ? void 0 : opts.tagPrefix) !== null && _a !== void 0 ? _a : "";
|
|
1464
|
+
var componentId = "".concat(prefix).concat(componentsCount + 1);
|
|
1463
1465
|
componentsCount++;
|
|
1464
1466
|
components[componentId] = React__default['default'].isValidElement(node)
|
|
1465
1467
|
? React__default['default'].cloneElement(node, {
|
|
@@ -1634,7 +1636,7 @@ function createUseScreenVariants(isMulti, screenQueries) {
|
|
|
1634
1636
|
|
|
1635
1637
|
var PlasmicRootContext = React__namespace.createContext(undefined);
|
|
1636
1638
|
function PlasmicRootProvider(props) {
|
|
1637
|
-
var platform = props.platform, children = props.children, userAuthToken = props.userAuthToken, isUserLoading = props.isUserLoading, authRedirectUri = props.authRedirectUri, user = props.user;
|
|
1639
|
+
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;
|
|
1638
1640
|
var context = React__namespace.useMemo(function () { return ({
|
|
1639
1641
|
platform: platform,
|
|
1640
1642
|
}); }, [platform]);
|
|
@@ -1644,11 +1646,14 @@ function PlasmicRootProvider(props) {
|
|
|
1644
1646
|
isUserLoading: isUserLoading,
|
|
1645
1647
|
authRedirectUri: authRedirectUri,
|
|
1646
1648
|
}); }, [userAuthToken, isUserLoading, user, authRedirectUri]);
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
React__namespace.createElement(
|
|
1650
|
-
|
|
1651
|
-
|
|
1649
|
+
var reactMajorVersion = +React__namespace.version.split(".")[0];
|
|
1650
|
+
return (React__namespace.createElement(MaybeWrap, { cond: !disableLoadingBoundary && reactMajorVersion >= 18, wrapper: function (children) { return (React__namespace.createElement(host.DataProvider, { name: "plasmicInternalEnableLoadingBoundary", hidden: true, data: true },
|
|
1651
|
+
React__namespace.createElement(React__namespace.Suspense, { fallback: suspenseFallback !== null && suspenseFallback !== void 0 ? suspenseFallback : "Loading..." }, children))); } },
|
|
1652
|
+
React__namespace.createElement(PlasmicRootContext.Provider, { value: context },
|
|
1653
|
+
React__namespace.createElement(ssr.SSRProvider, null,
|
|
1654
|
+
React__namespace.createElement(dataSourcesContext.PlasmicDataSourceContextProvider, { value: dataSourceContextValue },
|
|
1655
|
+
React__namespace.createElement(PlasmicTranslatorContext.Provider, { value: props.translator },
|
|
1656
|
+
React__namespace.createElement(PlasmicHeadContext.Provider, { value: props.Head }, children)))))));
|
|
1652
1657
|
}
|
|
1653
1658
|
var useIsSSR = ssr.useIsSSR;
|
|
1654
1659
|
function useHasPlasmicRoot() {
|
|
@@ -1666,6 +1671,9 @@ function useEnsureSSRProvider() {
|
|
|
1666
1671
|
hasWarnedSSR = true;
|
|
1667
1672
|
console.warn("Plasmic: To ensure your components work correctly with server-side rendering, please use PlasmicRootProvider at the root of your application. See https://docs.plasmic.app/learn/ssr");
|
|
1668
1673
|
}
|
|
1674
|
+
function MaybeWrap(props) {
|
|
1675
|
+
return props.cond ? props.wrapper(props.children) : props.children;
|
|
1676
|
+
}
|
|
1669
1677
|
|
|
1670
1678
|
function useFocused(opts) {
|
|
1671
1679
|
var _a = focus.useFocusRing({
|