@plasmicapp/react-web 0.2.130 → 0.2.131
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 +3 -1
- package/package.json +4 -4
- package/skinny/dist/plume/button/index.d.ts +4 -4
- package/skinny/dist/plume/checkbox/index.d.ts +1 -1
- package/skinny/dist/plume/collection-utils.d.ts +2 -2
- package/skinny/dist/plume/menu/menu.d.ts +1 -1
- package/skinny/dist/plume/menu-button/menu-button.d.ts +1 -1
- package/skinny/dist/plume/plume-utils.d.ts +13 -13
- package/skinny/dist/plume/select/select-option.d.ts +1 -1
- package/skinny/dist/plume/select/select.d.ts +1 -1
- package/skinny/dist/plume/switch/index.d.ts +1 -1
- package/skinny/dist/plume/text-input/index.d.ts +1 -1
- package/skinny/dist/plume/triggered-overlay/triggered-overlay.d.ts +1 -1
- package/skinny/dist/react-utils.d.ts +2 -2
- package/skinny/dist/render/PlasmicHead/index.d.ts +1 -1
- package/skinny/dist/render/PlasmicImg/index.d.ts +1 -1
- package/skinny/dist/render/elements.d.ts +10 -10
- package/skinny/dist/render/screen-variants.d.ts +1 -1
- package/skinny/dist/render/translation.d.ts +1 -1
- package/skinny/dist/render/triggers.d.ts +1 -1
- package/skinny/dist/states/index.d.ts +1 -1
- package/skinny/dist/states/valtio.d.ts +1 -1
package/dist/all.d.ts
CHANGED
|
@@ -565,7 +565,9 @@ interface Node<T> {
|
|
|
565
565
|
// Event bubbling can be problematic in real-world applications, so the default for React Spectrum components
|
|
566
566
|
// is not to propagate. This can be overridden by calling continuePropagation() on the event.
|
|
567
567
|
type BaseEvent<T extends SyntheticEvent> = T & {
|
|
568
|
-
/**
|
|
568
|
+
/**
|
|
569
|
+
* Use continuePropagation.
|
|
570
|
+
* @deprecated */
|
|
569
571
|
stopPropagation(): void,
|
|
570
572
|
continuePropagation(): void
|
|
571
573
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/react-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.131",
|
|
4
4
|
"description": "plasmic library for rendering in the presentational style",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
},
|
|
41
41
|
"prettier": {},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@plasmicapp/data-sources": "0.1.
|
|
43
|
+
"@plasmicapp/data-sources": "0.1.19",
|
|
44
44
|
"@plasmicapp/data-sources-context": "0.1.2",
|
|
45
|
-
"@plasmicapp/host": "1.0.
|
|
45
|
+
"@plasmicapp/host": "1.0.89",
|
|
46
46
|
"@plasmicapp/query": "0.1.56",
|
|
47
47
|
"@react-aria/checkbox": "^3.5.0",
|
|
48
48
|
"@react-aria/focus": "^3.7.0",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"react": ">=16.8.0",
|
|
109
109
|
"react-dom": ">=16.8.0"
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "b98c225da7e2d5549337ef8cd260867dc00ee641"
|
|
112
112
|
}
|
|
@@ -13,10 +13,10 @@ interface HtmlButtonProps extends Omit<React.ComponentProps<"button">, "ref" | "
|
|
|
13
13
|
interface HtmlAnchorProps extends Omit<React.ComponentProps<"a">, "ref" | "href"> {
|
|
14
14
|
link?: string;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
16
|
+
export type BaseButtonProps = CommonProps & HtmlButtonProps & HtmlAnchorProps;
|
|
17
|
+
export type HtmlAnchorOnlyProps = Exclude<keyof HtmlAnchorProps, keyof HtmlButtonProps>;
|
|
18
|
+
export type HtmlButtonOnlyProps = Exclude<keyof HtmlButtonProps, keyof HtmlAnchorProps>;
|
|
19
|
+
export type ButtonRef = React.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
20
20
|
interface ButtonConfig<C extends AnyPlasmicClass> {
|
|
21
21
|
showStartIconVariant: VariantDef<PlasmicClassVariants<C>>;
|
|
22
22
|
showEndIconVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
@@ -2,7 +2,7 @@ import { AriaCheckboxProps } from "@react-types/checkbox";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { AnyPlasmicClass, PlasmicClassArgs, PlasmicClassOverrides, PlasmicClassVariants, VariantDef } from "../plume-utils";
|
|
4
4
|
import { StyleProps } from "../props-utils";
|
|
5
|
-
export
|
|
5
|
+
export type CheckboxRef = React.Ref<CheckboxRefValue>;
|
|
6
6
|
export interface CheckboxRefValue extends CheckboxState {
|
|
7
7
|
getRoot: () => HTMLElement | null;
|
|
8
8
|
focus: () => void;
|
|
@@ -88,7 +88,7 @@ export interface ItemLikeProps {
|
|
|
88
88
|
*/
|
|
89
89
|
isDisabled?: boolean;
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
type LoaderAwareItemLikeProps = ItemLikeProps | PlasmicLoaderProps<ItemLikeProps>;
|
|
92
92
|
/**
|
|
93
93
|
* Props for a Plume component that corresponds to a Section
|
|
94
94
|
*/
|
|
@@ -106,7 +106,7 @@ export interface SectionLikeProps {
|
|
|
106
106
|
*/
|
|
107
107
|
children?: React.ReactNode;
|
|
108
108
|
}
|
|
109
|
-
|
|
109
|
+
type LoaderAwareSectionLikeProps = SectionLikeProps | PlasmicLoaderProps<SectionLikeProps>;
|
|
110
110
|
/**
|
|
111
111
|
* Given children of a component like Select or Menu, derive the items
|
|
112
112
|
* that we will pass into the Collections API. These will be
|
|
@@ -12,7 +12,7 @@ export interface BaseMenuProps extends DOMProps, AriaLabelingProps, StyleProps {
|
|
|
12
12
|
*/
|
|
13
13
|
onAction?: (value: string) => void;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type MenuRef = React.Ref<MenuRefValue>;
|
|
16
16
|
export interface MenuRefValue extends MenuState {
|
|
17
17
|
getRoot: () => HTMLElement | null;
|
|
18
18
|
}
|
|
@@ -54,7 +54,7 @@ interface MenuButtonState {
|
|
|
54
54
|
close: () => void;
|
|
55
55
|
isOpen: () => boolean;
|
|
56
56
|
}
|
|
57
|
-
export
|
|
57
|
+
export type MenuButtonRef = React.Ref<MenuButtonRefValue>;
|
|
58
58
|
export interface MenuButtonRefValue extends MenuButtonState {
|
|
59
59
|
getRoot: () => HTMLElement | null;
|
|
60
60
|
getTrigger: () => HTMLElement | null;
|
|
@@ -2,21 +2,21 @@ import * as React from "react";
|
|
|
2
2
|
import { SingleChoiceArg } from "../render/elements";
|
|
3
3
|
export declare let PLUME_STRICT_MODE: boolean;
|
|
4
4
|
export declare function setPlumeStrictMode(mode: boolean): void;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type VariantArgChoices<T> = T extends (infer M)[] ? M : T extends SingleChoiceArg<infer M> ? M : never;
|
|
6
|
+
type VariantArgsChoices<V> = {
|
|
7
7
|
[k in keyof V]-?: VariantArgChoices<V[k]>;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
type DictValues<V extends Record<string, any>> = V[keyof V];
|
|
10
|
+
type DictTuples<V extends Record<string, any>> = DictValues<{
|
|
11
11
|
[K in keyof V]: [K, V[K]];
|
|
12
12
|
}>;
|
|
13
|
-
export
|
|
14
|
-
|
|
13
|
+
export type VariantDefTuple<V> = DictTuples<VariantArgsChoices<V>>;
|
|
14
|
+
type DistributeTuple<T> = T extends [infer T1, infer T2] ? {
|
|
15
15
|
group: T1;
|
|
16
16
|
variant: T2;
|
|
17
17
|
} : never;
|
|
18
|
-
export
|
|
19
|
-
export
|
|
18
|
+
export type VariantDef<V> = DistributeTuple<VariantDefTuple<V>>;
|
|
19
|
+
export type PlasmicClass<V extends Record<string, any>, A extends Record<string, any>, O extends Record<string, any>> = {
|
|
20
20
|
(props: {
|
|
21
21
|
variants?: V;
|
|
22
22
|
args?: A;
|
|
@@ -25,11 +25,11 @@ export declare type PlasmicClass<V extends Record<string, any>, A extends Record
|
|
|
25
25
|
internalVariantProps: (keyof V)[];
|
|
26
26
|
internalArgProps: (keyof A)[];
|
|
27
27
|
};
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
|
|
28
|
+
export type AnyPlasmicClass = PlasmicClass<any, any, any>;
|
|
29
|
+
export type PlasmicClassVariants<C extends AnyPlasmicClass> = C extends PlasmicClass<infer V, any, any> ? V : unknown;
|
|
30
|
+
export type PlasmicClassArgs<C extends AnyPlasmicClass> = C extends PlasmicClass<any, infer A, any> ? A : unknown;
|
|
31
|
+
export type PlasmicClassOverrides<C extends AnyPlasmicClass> = C extends PlasmicClass<any, any, infer O> ? O : unknown;
|
|
32
|
+
type BooleanLike = boolean | undefined | null;
|
|
33
33
|
export declare function mergeVariantToggles<V>(...toggles: {
|
|
34
34
|
def?: VariantDef<V>;
|
|
35
35
|
active: BooleanLike;
|
|
@@ -12,7 +12,7 @@ interface SelectOptionConfig<C extends AnyPlasmicClass> {
|
|
|
12
12
|
root: keyof PlasmicClassOverrides<C>;
|
|
13
13
|
labelContainer: keyof PlasmicClassOverrides<C>;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type SelectOptionRef = React.Ref<HTMLElement>;
|
|
16
16
|
export declare function useSelectOption<P extends BaseSelectOptionProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: SelectOptionConfig<C>, outerRef?: SelectOptionRef): {
|
|
17
17
|
plasmicProps: {
|
|
18
18
|
variants: PlasmicClassVariants<C>;
|
|
@@ -62,7 +62,7 @@ export interface BaseSelectProps extends DOMProps, AriaLabelingProps, FocusableD
|
|
|
62
62
|
*/
|
|
63
63
|
placeholder?: React.ReactNode;
|
|
64
64
|
}
|
|
65
|
-
export
|
|
65
|
+
export type SelectRef = React.Ref<SelectRefValue>;
|
|
66
66
|
export interface SelectRefValue extends SelectState {
|
|
67
67
|
getTrigger: () => HTMLElement | null;
|
|
68
68
|
getRoot: () => HTMLElement | null;
|
|
@@ -2,7 +2,7 @@ import { AriaSwitchProps } from "@react-types/switch";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { AnyPlasmicClass, PlasmicClassArgs, PlasmicClassOverrides, PlasmicClassVariants, VariantDef } from "../plume-utils";
|
|
4
4
|
import { StyleProps } from "../props-utils";
|
|
5
|
-
export
|
|
5
|
+
export type SwitchRef = React.Ref<SwitchRefValue>;
|
|
6
6
|
export interface SwitchRefValue extends SwitchState {
|
|
7
7
|
getRoot: () => HTMLElement | null;
|
|
8
8
|
focus: () => void;
|
|
@@ -16,7 +16,7 @@ export interface TextInputRefValue {
|
|
|
16
16
|
getRoot: () => HTMLElement | null;
|
|
17
17
|
getInput: () => HTMLInputElement | null;
|
|
18
18
|
}
|
|
19
|
-
export
|
|
19
|
+
export type TextInputRef = React.Ref<TextInputRefValue>;
|
|
20
20
|
interface TextInputConfig<C extends AnyPlasmicClass> {
|
|
21
21
|
showStartIconVariant: VariantDef<PlasmicClassVariants<C>>;
|
|
22
22
|
showEndIconVariant?: VariantDef<PlasmicClassVariants<C>>;
|
|
@@ -14,7 +14,7 @@ export interface TriggeredOverlayConfig<C extends AnyPlasmicClass> {
|
|
|
14
14
|
root: keyof PlasmicClassOverrides<C>;
|
|
15
15
|
contentContainer: keyof PlasmicClassOverrides<C>;
|
|
16
16
|
}
|
|
17
|
-
export
|
|
17
|
+
export type TriggeredOverlayRef = React.Ref<HTMLElement>;
|
|
18
18
|
export declare function useTriggeredOverlay<P extends BaseTriggeredOverlayProps, C extends AnyPlasmicClass>(plasmicClass: C, props: P, config: TriggeredOverlayConfig<C>, outerRef?: TriggeredOverlayRef, isDismissable?: boolean): {
|
|
19
19
|
plasmicProps: {
|
|
20
20
|
variants: PlasmicClassVariants<C>;
|
|
@@ -13,8 +13,8 @@ export declare function isReactText(child: React.ReactNode): child is React.Reac
|
|
|
13
13
|
export declare function isReactChild(child: React.ReactNode): child is React.ReactChild;
|
|
14
14
|
export declare function isReactFragment(child: React.ReactNode): child is React.ReactElement;
|
|
15
15
|
export declare function isReactNode(x: any): boolean;
|
|
16
|
-
export
|
|
17
|
-
export
|
|
16
|
+
export type StrictProps<T, TExpected> = Exclude<keyof T, keyof TExpected> extends never ? {} : Partial<"Unexpected extraneous props">;
|
|
17
|
+
export type HTMLElementRefOf<T extends keyof JSX.IntrinsicElements> = Exclude<React.ComponentProps<T>["ref"], string>;
|
|
18
18
|
export declare function mergeProps(props: Record<string, any>, ...restProps: Record<string, any>[]): Record<string, any>;
|
|
19
19
|
export declare function mergeRefs<T>(...refs: (React.Ref<T> | undefined)[]): (value: T) => void;
|
|
20
20
|
export declare function mergePropVals(name: string, val1: any, val2: any): any;
|
|
@@ -11,7 +11,7 @@ export interface ImageLoader {
|
|
|
11
11
|
format?: "webp";
|
|
12
12
|
}) => string;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
type ImgTagProps = Omit<React.ComponentProps<"img">, "src" | "srcSet" | "ref" | "style">;
|
|
15
15
|
export interface PlasmicImgProps extends ImgTagProps {
|
|
16
16
|
/**
|
|
17
17
|
* Either an object with the src string, and its full width and height,
|
|
@@ -3,33 +3,33 @@ import { $State } from "../states/valtio";
|
|
|
3
3
|
interface Variants {
|
|
4
4
|
[vg: string]: any;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
6
|
+
export type MultiChoiceArg<M extends string> = M | M[] | {
|
|
7
7
|
[v in M]?: boolean;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
10
|
-
export
|
|
9
|
+
export type SingleChoiceArg<M extends string> = M;
|
|
10
|
+
export type SingleBooleanChoiceArg<M extends string> = M | boolean;
|
|
11
11
|
interface OverrideTwiddle {
|
|
12
12
|
wrapChildren?: (children: React.ReactNode) => React.ReactNode;
|
|
13
13
|
wrap?: (node: React.ReactNode) => React.ReactNode;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type DefaultOverride<C extends React.ElementType> = {
|
|
16
16
|
type: "default";
|
|
17
17
|
props?: Partial<React.ComponentProps<C>>;
|
|
18
18
|
} & OverrideTwiddle;
|
|
19
|
-
export
|
|
19
|
+
export type AsOverride<C extends React.ElementType> = {
|
|
20
20
|
type: "as";
|
|
21
21
|
as: C;
|
|
22
22
|
props?: Partial<React.ComponentProps<C>>;
|
|
23
23
|
} & OverrideTwiddle;
|
|
24
|
-
export
|
|
24
|
+
export type RenderOverride<C extends React.ElementType> = {
|
|
25
25
|
type: "render";
|
|
26
26
|
render: (props: React.ComponentProps<C>, Comp: C) => React.ReactNode;
|
|
27
27
|
props?: Partial<React.ComponentProps<C>>;
|
|
28
28
|
} & OverrideTwiddle;
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
export
|
|
29
|
+
export type Override<DefaultElementType extends React.ElementType> = DefaultOverride<DefaultElementType> | AsOverride<any> | RenderOverride<DefaultElementType>;
|
|
30
|
+
export type Overrides = Record<string, Flex<any>>;
|
|
31
|
+
export type Args = Record<string, any>;
|
|
32
|
+
export type Flex<DefaultElementType extends React.ElementType> = (Omit<DefaultOverride<DefaultElementType>, "type"> & {
|
|
33
33
|
as?: never;
|
|
34
34
|
render?: never;
|
|
35
35
|
}) | Omit<AsOverride<any>, "type"> | (Omit<RenderOverride<DefaultElementType>, "type"> & {
|
|
@@ -27,7 +27,7 @@ declare const TRIGGER_TO_HOOK: {
|
|
|
27
27
|
readonly useFocusVisibleWithin: typeof useFocusVisibleWithin;
|
|
28
28
|
readonly usePressed: typeof usePressed;
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
type TriggerType = keyof typeof TRIGGER_TO_HOOK;
|
|
31
31
|
interface TriggerOpts {
|
|
32
32
|
isTextInput?: boolean;
|
|
33
33
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type InitFunc<T> = ($props: Record<string, any>, $state: $State, $ctx: Record<string, any>, indexes: number[]) => T;
|
|
2
2
|
export interface $State {
|
|
3
3
|
[key: string]: any;
|
|
4
4
|
registerInitFunc?: (path: string, f: InitFunc<any>) => any;
|