@plasmicapp/react-web 0.2.378 → 0.2.379
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 +137 -72
- package/package.json +4 -4
package/dist/all.d.ts
CHANGED
|
@@ -11400,11 +11400,11 @@ type Action<P> = {
|
|
|
11400
11400
|
type: "button-action";
|
|
11401
11401
|
label: string;
|
|
11402
11402
|
onClick: (props: ActionProps<P>) => void;
|
|
11403
|
-
hidden?: ContextDependentConfig<P, boolean>;
|
|
11403
|
+
hidden?: ContextDependentConfig$1<P, boolean>;
|
|
11404
11404
|
} | {
|
|
11405
11405
|
type: "custom-action";
|
|
11406
11406
|
control: React.ComponentType<ActionProps<P>>;
|
|
11407
|
-
hidden?: ContextDependentConfig<P, boolean>;
|
|
11407
|
+
hidden?: ContextDependentConfig$1<P, boolean>;
|
|
11408
11408
|
};
|
|
11409
11409
|
type DistributedKeyOf$1<T> = T extends any ? keyof T : never;
|
|
11410
11410
|
interface ComponentTemplate<P> extends Omit<CodeComponentElement<P>, "type" | "name"> {
|
|
@@ -11421,12 +11421,12 @@ type StateSpec<P> = {
|
|
|
11421
11421
|
/**
|
|
11422
11422
|
* If true, will hide the state on studio.
|
|
11423
11423
|
*/
|
|
11424
|
-
hidden?: ContextDependentConfig<P, boolean>;
|
|
11424
|
+
hidden?: ContextDependentConfig$1<P, boolean>;
|
|
11425
11425
|
/**
|
|
11426
11426
|
* If true, will hide the state in a collapsed section; good for states that
|
|
11427
11427
|
* should not usually be used.
|
|
11428
11428
|
*/
|
|
11429
|
-
advanced?: ContextDependentConfig<P, boolean>;
|
|
11429
|
+
advanced?: ContextDependentConfig$1<P, boolean>;
|
|
11430
11430
|
} & ({
|
|
11431
11431
|
type: "readonly";
|
|
11432
11432
|
variableType: "text";
|
|
@@ -11616,7 +11616,7 @@ interface CodeComponentMeta<P> {
|
|
|
11616
11616
|
* on the left of the Studio. This makes it easy to identify an element when
|
|
11617
11617
|
* looking at the tree.
|
|
11618
11618
|
*/
|
|
11619
|
-
treeLabel?: ContextDependentConfig<P, string>;
|
|
11619
|
+
treeLabel?: ContextDependentConfig$1<P, string>;
|
|
11620
11620
|
/**
|
|
11621
11621
|
* The value of the CSS display property used by this component.
|
|
11622
11622
|
* Plasmic passes in a class name prop to components to let users style them,
|
|
@@ -11679,7 +11679,7 @@ type InferDataType<P> = P extends CanvasComponentProps<infer Data> ? Data : any;
|
|
|
11679
11679
|
/**
|
|
11680
11680
|
* Context that we pass back to control functions.
|
|
11681
11681
|
*/
|
|
11682
|
-
type ControlContext<P> = [
|
|
11682
|
+
type ControlContext$1<P> = [
|
|
11683
11683
|
/**
|
|
11684
11684
|
* props
|
|
11685
11685
|
*/
|
|
@@ -11699,7 +11699,7 @@ type ControlContext<P> = [
|
|
|
11699
11699
|
* Config option that takes the context (e.g., props) of the component instance
|
|
11700
11700
|
* to dynamically set its value.
|
|
11701
11701
|
*/
|
|
11702
|
-
type ContextDependentConfig<P, R> = (...args: ControlContext<P>) => R;
|
|
11702
|
+
type ContextDependentConfig$1<P, R> = (...args: ControlContext$1<P>) => R;
|
|
11703
11703
|
interface PropTypeBase<P> {
|
|
11704
11704
|
displayName?: string;
|
|
11705
11705
|
description?: string;
|
|
@@ -11716,8 +11716,8 @@ interface PropTypeBase<P> {
|
|
|
11716
11716
|
* Function for whether this prop should be hidden in the right panel,
|
|
11717
11717
|
* given the current props for this component
|
|
11718
11718
|
*/
|
|
11719
|
-
hidden?: ContextDependentConfig<P, boolean>;
|
|
11720
|
-
readOnly?: boolean | ContextDependentConfig<P, boolean>;
|
|
11719
|
+
hidden?: ContextDependentConfig$1<P, boolean>;
|
|
11720
|
+
readOnly?: boolean | ContextDependentConfig$1<P, boolean>;
|
|
11721
11721
|
/**
|
|
11722
11722
|
* If true, will hide the prop in a collapsed section; good for props that
|
|
11723
11723
|
* should not usually be used.
|
|
@@ -11746,7 +11746,7 @@ interface Defaultable<P, T> {
|
|
|
11746
11746
|
* If no prop is given, the component uses a default; specify what
|
|
11747
11747
|
* that default is so the Plasmic user can see it in the studio UI
|
|
11748
11748
|
*/
|
|
11749
|
-
defaultValueHint?: T | ContextDependentConfig<P, T | undefined>;
|
|
11749
|
+
defaultValueHint?: T | ContextDependentConfig$1<P, T | undefined>;
|
|
11750
11750
|
/**
|
|
11751
11751
|
* Use a dynamic value expression as the default instead
|
|
11752
11752
|
*/
|
|
@@ -11756,7 +11756,7 @@ interface Defaultable<P, T> {
|
|
|
11756
11756
|
* This function validates whether the prop value is valid.
|
|
11757
11757
|
* If the value is invalid, it returns an error message. Otherwise, it returns true.
|
|
11758
11758
|
*/
|
|
11759
|
-
validator?: (value: T, ...args: ControlContext<P>) => (string | true) | Promise<string | true>;
|
|
11759
|
+
validator?: (value: T, ...args: ControlContext$1<P>) => (string | true) | Promise<string | true>;
|
|
11760
11760
|
}
|
|
11761
11761
|
interface Controllable {
|
|
11762
11762
|
/**
|
|
@@ -11776,7 +11776,7 @@ interface Controllable {
|
|
|
11776
11776
|
}
|
|
11777
11777
|
interface PropTypeBaseDefault<P, T> extends PropTypeBase<P>, Defaultable<P, T>, Controllable {
|
|
11778
11778
|
}
|
|
11779
|
-
interface PlainStringType<P> extends PropTypeBaseDefault<P, string> {
|
|
11779
|
+
interface PlainStringType$1<P> extends PropTypeBaseDefault<P, string> {
|
|
11780
11780
|
type: "string";
|
|
11781
11781
|
control?: "default" | "large";
|
|
11782
11782
|
isLocalizable?: boolean;
|
|
@@ -11865,22 +11865,22 @@ interface ThemeResetClassType<P> extends PropTypeBase<P> {
|
|
|
11865
11865
|
}
|
|
11866
11866
|
interface CardPickerType<P> extends PropTypeBaseDefault<P, string> {
|
|
11867
11867
|
type: "cardPicker";
|
|
11868
|
-
modalTitle?: React.ReactNode | ContextDependentConfig<P, React.ReactNode>;
|
|
11868
|
+
modalTitle?: React.ReactNode | ContextDependentConfig$1<P, React.ReactNode>;
|
|
11869
11869
|
options: {
|
|
11870
11870
|
value: string;
|
|
11871
11871
|
label?: string;
|
|
11872
11872
|
imgUrl: string;
|
|
11873
11873
|
footer?: React.ReactNode;
|
|
11874
|
-
}[] | ContextDependentConfig<P, {
|
|
11874
|
+
}[] | ContextDependentConfig$1<P, {
|
|
11875
11875
|
value: string;
|
|
11876
11876
|
label?: string;
|
|
11877
11877
|
imgUrl: string;
|
|
11878
11878
|
footer?: React.ReactNode;
|
|
11879
11879
|
}[]>;
|
|
11880
|
-
showInput?: boolean | ContextDependentConfig<P, boolean>;
|
|
11881
|
-
onSearch?: ContextDependentConfig<P, ((value: string) => void) | undefined>;
|
|
11880
|
+
showInput?: boolean | ContextDependentConfig$1<P, boolean>;
|
|
11881
|
+
onSearch?: ContextDependentConfig$1<P, ((value: string) => void) | undefined>;
|
|
11882
11882
|
}
|
|
11883
|
-
type RichStringType<P> = PlainStringType<P> | CodeStringType<P> | RichTextType<P> | ColorType<P> | ClassType<P> | ThemeResetClassType<P> | CardPickerType<P> | HrefType<P>;
|
|
11883
|
+
type RichStringType<P> = PlainStringType$1<P> | CodeStringType<P> | RichTextType<P> | ColorType<P> | ClassType<P> | ThemeResetClassType<P> | CardPickerType<P> | HrefType<P>;
|
|
11884
11884
|
type StringType$1<P> = "string" | "href" | RichStringType<P>;
|
|
11885
11885
|
interface RichBooleanType<P> extends PropTypeBaseDefault<P, boolean> {
|
|
11886
11886
|
type: "boolean";
|
|
@@ -11893,28 +11893,28 @@ type GraphQLValue = {
|
|
|
11893
11893
|
interface GraphQLType<P> extends PropTypeBaseDefault<P, GraphQLValue> {
|
|
11894
11894
|
type: "code";
|
|
11895
11895
|
lang: "graphql";
|
|
11896
|
-
endpoint: string | ContextDependentConfig<P, string>;
|
|
11897
|
-
method?: string | ContextDependentConfig<P, string>;
|
|
11898
|
-
headers?: object | ContextDependentConfig<P, object>;
|
|
11896
|
+
endpoint: string | ContextDependentConfig$1<P, string>;
|
|
11897
|
+
method?: string | ContextDependentConfig$1<P, string>;
|
|
11898
|
+
headers?: object | ContextDependentConfig$1<P, object>;
|
|
11899
11899
|
}
|
|
11900
11900
|
interface NumberTypeBase<P> extends PropTypeBaseDefault<P, number> {
|
|
11901
11901
|
type: "number";
|
|
11902
|
-
min?: number | ContextDependentConfig<P, number>;
|
|
11903
|
-
max?: number | ContextDependentConfig<P, number>;
|
|
11902
|
+
min?: number | ContextDependentConfig$1<P, number>;
|
|
11903
|
+
max?: number | ContextDependentConfig$1<P, number>;
|
|
11904
11904
|
}
|
|
11905
|
-
interface PlainNumberType<P> extends NumberTypeBase<P> {
|
|
11905
|
+
interface PlainNumberType$1<P> extends NumberTypeBase<P> {
|
|
11906
11906
|
control?: "default";
|
|
11907
11907
|
}
|
|
11908
11908
|
interface SliderNumberType<P> extends NumberTypeBase<P> {
|
|
11909
11909
|
control: "slider";
|
|
11910
|
-
step?: number | ContextDependentConfig<P, number>;
|
|
11910
|
+
step?: number | ContextDependentConfig$1<P, number>;
|
|
11911
11911
|
}
|
|
11912
|
-
type RichNumberType<P> = PlainNumberType<P> | SliderNumberType<P>;
|
|
11912
|
+
type RichNumberType<P> = PlainNumberType$1<P> | SliderNumberType<P>;
|
|
11913
11913
|
type NumberType$1<P> = "number" | RichNumberType<P>;
|
|
11914
11914
|
interface ObjectType$1<P> extends PropTypeBaseDefault<P, Record<string, any>> {
|
|
11915
11915
|
type: "object";
|
|
11916
11916
|
fields?: Record<string, PropType$1<P>>;
|
|
11917
|
-
nameFunc?: (item: any, ...args: ControlContext<P>) => string | undefined;
|
|
11917
|
+
nameFunc?: (item: any, ...args: ControlContext$1<P>) => string | undefined;
|
|
11918
11918
|
}
|
|
11919
11919
|
interface ArrayType$1<P> extends PropTypeBaseDefault<P, any[]> {
|
|
11920
11920
|
type: "array";
|
|
@@ -11922,7 +11922,7 @@ interface ArrayType$1<P> extends PropTypeBaseDefault<P, any[]> {
|
|
|
11922
11922
|
/**
|
|
11923
11923
|
* Optional function that determines whether the user can delete a given item.
|
|
11924
11924
|
*/
|
|
11925
|
-
unstable__canDelete?: (item: any, ...args: ControlContext<P>) => boolean;
|
|
11925
|
+
unstable__canDelete?: (item: any, ...args: ControlContext$1<P>) => boolean;
|
|
11926
11926
|
/**
|
|
11927
11927
|
* Specify how to let Plasmic know how to update its own internal representation of the data when the value has
|
|
11928
11928
|
* changed, or when issuing a minimalValue or shownValue that is different.
|
|
@@ -11943,7 +11943,7 @@ interface ArrayType$1<P> extends PropTypeBaseDefault<P, any[]> {
|
|
|
11943
11943
|
* - Let's say there are 5 columns in the value. The data schema changes, removing a column and adding two new
|
|
11944
11944
|
* ones. Now we would want a different minimal value, containing 6 items.
|
|
11945
11945
|
*/
|
|
11946
|
-
unstable__minimalValue?: ContextDependentConfig<P, any>;
|
|
11946
|
+
unstable__minimalValue?: ContextDependentConfig$1<P, any>;
|
|
11947
11947
|
}
|
|
11948
11948
|
type JSONLikeType<P> = "object" | ObjectType$1<P> | ArrayType$1<P>;
|
|
11949
11949
|
interface DataSourceType<P> extends PropTypeBase<P> {
|
|
@@ -11953,14 +11953,14 @@ interface DataSourceType<P> extends PropTypeBase<P> {
|
|
|
11953
11953
|
type DataPickerValueType = string | number | (string | number)[];
|
|
11954
11954
|
interface RichDataPickerType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
11955
11955
|
type: "dataSelector";
|
|
11956
|
-
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
11956
|
+
data?: Record<string, any> | ContextDependentConfig$1<P, Record<string, any>>;
|
|
11957
11957
|
alwaysShowValuePathAsLabel?: boolean;
|
|
11958
11958
|
isolateEnv?: boolean;
|
|
11959
11959
|
}
|
|
11960
11960
|
type DataPickerType<P> = "dataPicker" | RichDataPickerType<P>;
|
|
11961
11961
|
interface RichExprEditorType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
11962
11962
|
type: "exprEditor";
|
|
11963
|
-
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
11963
|
+
data?: Record<string, any> | ContextDependentConfig$1<P, Record<string, any>>;
|
|
11964
11964
|
isolateEnv?: boolean;
|
|
11965
11965
|
}
|
|
11966
11966
|
type ExprEditorType<P> = "exprEditor" | RichExprEditorType<P>;
|
|
@@ -11974,29 +11974,29 @@ interface EventHandlerType<P> extends PropTypeBase<P> {
|
|
|
11974
11974
|
type: ArgType<any>;
|
|
11975
11975
|
}[];
|
|
11976
11976
|
}
|
|
11977
|
-
interface ChoiceTypeBase<P, T> extends PropTypeBaseDefault<P, T> {
|
|
11977
|
+
interface ChoiceTypeBase$1<P, T> extends PropTypeBaseDefault<P, T> {
|
|
11978
11978
|
type: "choice";
|
|
11979
11979
|
options: string[] | {
|
|
11980
11980
|
label: string;
|
|
11981
11981
|
value: string | number | boolean;
|
|
11982
|
-
}[] | ContextDependentConfig<P, string[] | {
|
|
11982
|
+
}[] | ContextDependentConfig$1<P, string[] | {
|
|
11983
11983
|
label: string;
|
|
11984
11984
|
value: string | number | boolean;
|
|
11985
11985
|
}[]>;
|
|
11986
11986
|
allowSearch?: boolean;
|
|
11987
11987
|
filterOption?: boolean;
|
|
11988
|
-
onSearch?: ContextDependentConfig<P, ((value: string) => void) | undefined>;
|
|
11988
|
+
onSearch?: ContextDependentConfig$1<P, ((value: string) => void) | undefined>;
|
|
11989
11989
|
}
|
|
11990
|
-
interface SingleChoiceType<P> extends ChoiceTypeBase<P, string | number | boolean> {
|
|
11990
|
+
interface SingleChoiceType$1<P> extends ChoiceTypeBase$1<P, string | number | boolean> {
|
|
11991
11991
|
multiSelect?: false;
|
|
11992
11992
|
}
|
|
11993
|
-
interface MultiChoiceType<P> extends ChoiceTypeBase<P, (string | number | boolean)[]> {
|
|
11993
|
+
interface MultiChoiceType$1<P> extends ChoiceTypeBase$1<P, (string | number | boolean)[]> {
|
|
11994
11994
|
multiSelect: true;
|
|
11995
11995
|
}
|
|
11996
|
-
interface CustomChoiceType<P> extends ChoiceTypeBase<P, string | number | boolean | (string | number | boolean)[]> {
|
|
11997
|
-
multiSelect: ContextDependentConfig<P, boolean>;
|
|
11996
|
+
interface CustomChoiceType$1<P> extends ChoiceTypeBase$1<P, string | number | boolean | (string | number | boolean)[]> {
|
|
11997
|
+
multiSelect: ContextDependentConfig$1<P, boolean>;
|
|
11998
11998
|
}
|
|
11999
|
-
type ChoiceType<P> = SingleChoiceType<P> | MultiChoiceType<P> | CustomChoiceType<P>;
|
|
11999
|
+
type ChoiceType$1<P> = SingleChoiceType$1<P> | MultiChoiceType$1<P> | CustomChoiceType$1<P>;
|
|
12000
12000
|
interface RichSlotType<P> {
|
|
12001
12001
|
type: "slot";
|
|
12002
12002
|
description?: string;
|
|
@@ -12027,7 +12027,7 @@ interface RichSlotType<P> {
|
|
|
12027
12027
|
* Function for whether this slot should be hidden from the left tree,
|
|
12028
12028
|
* given the current props for this component
|
|
12029
12029
|
*/
|
|
12030
|
-
hidden?: ContextDependentConfig<P, boolean>;
|
|
12030
|
+
hidden?: ContextDependentConfig$1<P, boolean>;
|
|
12031
12031
|
/**
|
|
12032
12032
|
* If slot is a render prop (accepts a function that takes in some
|
|
12033
12033
|
* arguments and returns some JSX), then specify the names of the
|
|
@@ -12048,11 +12048,11 @@ interface RichSlotType<P> {
|
|
|
12048
12048
|
* Furthermore, the component further shows the props of whatever is in the slot on
|
|
12049
12049
|
* the parent component for the user's convenience. Handy for various “wrapper" components, form fields, and so on.
|
|
12050
12050
|
*/
|
|
12051
|
-
mergeWithParent?: boolean | ContextDependentConfig<P, boolean>;
|
|
12051
|
+
mergeWithParent?: boolean | ContextDependentConfig$1<P, boolean>;
|
|
12052
12052
|
/**
|
|
12053
12053
|
* A function that returns true to hide the merged props conditionally.
|
|
12054
12054
|
*/
|
|
12055
|
-
hiddenMergedProps?: ContextDependentConfig<P, boolean>;
|
|
12055
|
+
hiddenMergedProps?: ContextDependentConfig$1<P, boolean>;
|
|
12056
12056
|
}
|
|
12057
12057
|
type SlotType<P> = "slot" | RichSlotType<P>;
|
|
12058
12058
|
interface RichImageUrlType<P> extends PropTypeBaseDefault<P, string> {
|
|
@@ -12130,9 +12130,9 @@ interface RichCustomType<P> extends PropTypeBaseDefault<P, any> {
|
|
|
12130
12130
|
}
|
|
12131
12131
|
type CustomType<P> = RichCustomType<P> | CustomControl<P>;
|
|
12132
12132
|
type PrimitiveType<P = any> = Extract<StringType$1<P> | BooleanType$1<P> | NumberType$1<P> | JSONLikeType<P>, string>;
|
|
12133
|
-
type PropType$1<P> = StringType$1<P> | BooleanType$1<P> | GraphQLType<P> | NumberType$1<P> | JSONLikeType<P> | DataSourceType<P> | DataPickerType<P> | ExprEditorType<P> | FormValidationRulesType<P> | EventHandlerType<P> | ChoiceType<P> | CustomType<P> | ImageUrlType<P> | SlotType<P> | DateStringType<P> | DateRangeStringsType<P>;
|
|
12133
|
+
type PropType$1<P> = StringType$1<P> | BooleanType$1<P> | GraphQLType<P> | NumberType$1<P> | JSONLikeType<P> | DataSourceType<P> | DataPickerType<P> | ExprEditorType<P> | FormValidationRulesType<P> | EventHandlerType<P> | ChoiceType$1<P> | CustomType<P> | ImageUrlType<P> | SlotType<P> | DateStringType<P> | DateRangeStringsType<P>;
|
|
12134
12134
|
type ArgType<P> = Exclude<PropType$1<P>, SlotType<P> | EventHandlerType<P>>;
|
|
12135
|
-
type StringCompatType<P> = DateStringType<P> | StringType$1<P> | ChoiceType<P> | JSONLikeType<P> | ImageUrlType<P> | CustomType<P> | DataPickerType<P>;
|
|
12135
|
+
type StringCompatType<P> = DateStringType<P> | StringType$1<P> | ChoiceType$1<P> | JSONLikeType<P> | ImageUrlType<P> | CustomType<P> | DataPickerType<P>;
|
|
12136
12136
|
type BoolCompatType<P> = BooleanType$1<P> | CustomType<P> | DataPickerType<P>;
|
|
12137
12137
|
type NumberCompatType<P> = NumberType$1<P> | CustomType<P> | DataPickerType<P>;
|
|
12138
12138
|
type RestrictPropType$1<T, P> = T extends string ? StringCompatType<P> : T extends boolean ? BoolCompatType<P> : T extends number ? NumberCompatType<P> : PropType$1<P>;
|
|
@@ -12176,48 +12176,113 @@ declare global {
|
|
|
12176
12176
|
}
|
|
12177
12177
|
}
|
|
12178
12178
|
|
|
12179
|
-
|
|
12180
|
-
|
|
12181
|
-
|
|
12182
|
-
type
|
|
12183
|
-
|
|
12184
|
-
|
|
12185
|
-
|
|
12186
|
-
|
|
12187
|
-
|
|
12188
|
-
|
|
12189
|
-
|
|
12190
|
-
|
|
12191
|
-
|
|
12179
|
+
/**
|
|
12180
|
+
* Context that we pass back to control functions.
|
|
12181
|
+
*/
|
|
12182
|
+
type ControlContext<P> = [
|
|
12183
|
+
/**
|
|
12184
|
+
* props
|
|
12185
|
+
*/
|
|
12186
|
+
P
|
|
12187
|
+
];
|
|
12188
|
+
/**
|
|
12189
|
+
* Config option that takes the context (e.g., props) of the function call
|
|
12190
|
+
* to dynamically set its value.
|
|
12191
|
+
*/
|
|
12192
|
+
type ContextDependentConfig<P, R> = (...args: ControlContext<P>) => R;
|
|
12193
|
+
interface BaseParam {
|
|
12192
12194
|
name: string;
|
|
12193
|
-
type?: ParamType<T>;
|
|
12194
12195
|
description?: string;
|
|
12195
12196
|
isOptional?: boolean;
|
|
12196
|
-
|
|
12197
|
+
isRestParameter?: boolean;
|
|
12198
|
+
}
|
|
12199
|
+
interface ChoiceTypeBase<P, T> extends BaseParam {
|
|
12200
|
+
type: "choice";
|
|
12201
|
+
options: T[] | {
|
|
12202
|
+
label: string;
|
|
12203
|
+
value: T;
|
|
12204
|
+
}[] | ContextDependentConfig<P, T[] | {
|
|
12205
|
+
label: string;
|
|
12206
|
+
value: T;
|
|
12207
|
+
}[]>;
|
|
12208
|
+
allowSearch?: boolean;
|
|
12209
|
+
filterOption?: boolean;
|
|
12210
|
+
onSearch?: ContextDependentConfig<P, ((value: string) => void) | undefined>;
|
|
12211
|
+
}
|
|
12212
|
+
interface SingleChoiceType<P, T> extends ChoiceTypeBase<P, T> {
|
|
12213
|
+
multiSelect?: false;
|
|
12214
|
+
}
|
|
12215
|
+
interface MultiChoiceType<P, T> extends ChoiceTypeBase<P, T[]> {
|
|
12216
|
+
multiSelect: true;
|
|
12217
|
+
}
|
|
12218
|
+
interface CustomChoiceType<P, T> extends ChoiceTypeBase<P, T | T[]> {
|
|
12219
|
+
multiSelect: ContextDependentConfig<P, boolean>;
|
|
12220
|
+
}
|
|
12221
|
+
type ChoiceType<P, T> = SingleChoiceType<P, T> | MultiChoiceType<P, T> | CustomChoiceType<P, T>;
|
|
12222
|
+
interface PlainStringType<T extends string = string> extends BaseParam {
|
|
12223
|
+
type: "string" | `'${T}'`;
|
|
12224
|
+
}
|
|
12225
|
+
type StringType<P, T extends string = string> = "string" | PlainStringType<T> | ChoiceType<P, T> | AnyType;
|
|
12226
|
+
interface PlainNumberType<T extends number = number> extends BaseParam {
|
|
12227
|
+
type: "number" | `${number extends T ? number : T}`;
|
|
12228
|
+
}
|
|
12229
|
+
type NumberType<P, T extends number = number> = PlainNumberType<T> | ChoiceType<P, T> | AnyType;
|
|
12230
|
+
interface PlainBooleanType<T extends boolean = boolean> extends BaseParam {
|
|
12231
|
+
type: "boolean" | `${boolean extends T ? boolean : T}`;
|
|
12232
|
+
}
|
|
12233
|
+
type BooleanType<P, T extends boolean = boolean> = PlainBooleanType<T> | ChoiceType<P, T> | AnyType;
|
|
12234
|
+
interface PlainNullType extends BaseParam {
|
|
12235
|
+
type: "null";
|
|
12236
|
+
}
|
|
12237
|
+
type NullType = PlainNullType | AnyType;
|
|
12238
|
+
interface PlainUndefinedType extends BaseParam {
|
|
12239
|
+
type: "undefined";
|
|
12197
12240
|
}
|
|
12198
|
-
|
|
12241
|
+
type UndefinedType = PlainUndefinedType | AnyType;
|
|
12242
|
+
interface PlainArrayType extends BaseParam {
|
|
12243
|
+
type: "array";
|
|
12244
|
+
}
|
|
12245
|
+
type ArrayType = PlainArrayType | AnyType;
|
|
12246
|
+
interface PlainObjectType extends BaseParam {
|
|
12247
|
+
type: "object";
|
|
12248
|
+
}
|
|
12249
|
+
type ObjectType = PlainObjectType | AnyType;
|
|
12250
|
+
interface PlainAnyType extends BaseParam {
|
|
12251
|
+
type: "any";
|
|
12252
|
+
}
|
|
12253
|
+
type AnyType = PlainAnyType;
|
|
12254
|
+
interface PlainVoidType extends BaseParam {
|
|
12255
|
+
type: "void";
|
|
12256
|
+
}
|
|
12257
|
+
type VoidType = PlainVoidType | AnyType;
|
|
12258
|
+
type RestrictedType<P, T> = T extends string ? StringType<P, T> : T extends number ? NumberType<P, T> : T extends boolean ? BooleanType<P, T> : T extends null ? NullType : T extends undefined ? UndefinedType : T extends Array<any> ? ArrayType : T extends object ? ObjectType : AnyType;
|
|
12259
|
+
type ParamType<P, T> = RestrictedType<P, T>;
|
|
12260
|
+
type RequiredParam<P, T> = ParamType<P, T> & {
|
|
12199
12261
|
isOptional?: false;
|
|
12200
12262
|
isRestParameter?: false;
|
|
12201
|
-
}
|
|
12202
|
-
|
|
12263
|
+
};
|
|
12264
|
+
type OptionalParam<P, T> = ParamType<P, T> & {
|
|
12203
12265
|
isRestParameter?: false;
|
|
12204
|
-
}
|
|
12205
|
-
|
|
12266
|
+
};
|
|
12267
|
+
type RestParam<P, T> = ParamType<P, T> & {
|
|
12206
12268
|
isOptional?: false;
|
|
12207
12269
|
isRestParameter: true;
|
|
12208
|
-
}
|
|
12270
|
+
};
|
|
12209
12271
|
type RequiredParams<T extends any[], U extends any[] = []> = Partial<T> extends T ? U : T extends [infer F, ...infer R] ? RequiredParams<R, [...U, F]> : U;
|
|
12210
12272
|
type OptionalParams<T extends any[]> = T extends [
|
|
12211
12273
|
...RequiredParams<T>,
|
|
12212
12274
|
...infer R
|
|
12213
12275
|
] ? [...R] : [];
|
|
12214
|
-
type HandleRequiredParams<P extends any[]> =
|
|
12215
|
-
type HandleOptionalParams<P extends any[]> =
|
|
12276
|
+
type HandleRequiredParams<P, R extends any[]> = R extends [infer H, ...infer T] ? [string | RequiredParam<P, H>, ...HandleRequiredParams<P, T>] : [];
|
|
12277
|
+
type HandleOptionalParams<P, R extends any[]> = R extends [infer H, ...infer T] ? [] | [
|
|
12278
|
+
string | OptionalParam<P, H | undefined>,
|
|
12279
|
+
...HandleOptionalParams<P, T>
|
|
12280
|
+
] : R extends [] ? [] : R extends Array<infer T> ? [] | [RestParam<P, T[]>] : [];
|
|
12216
12281
|
type HandleParams<P extends any[]> = [
|
|
12217
|
-
...HandleRequiredParams<RequiredParams<P>>,
|
|
12218
|
-
...HandleOptionalParams<Required<OptionalParams<P>>>
|
|
12282
|
+
...HandleRequiredParams<P, RequiredParams<P>>,
|
|
12283
|
+
...HandleOptionalParams<P, Required<OptionalParams<P>>>
|
|
12219
12284
|
];
|
|
12220
|
-
type HandleReturnType<T> = VoidType | ParamType<T>;
|
|
12285
|
+
type HandleReturnType<P, T> = VoidType | ParamType<P, T>;
|
|
12221
12286
|
interface CustomFunctionMeta<F extends (...args: any[]) => any> {
|
|
12222
12287
|
/**
|
|
12223
12288
|
* The javascript name of the function. Notice it must be unique across all
|
|
@@ -12247,7 +12312,7 @@ interface CustomFunctionMeta<F extends (...args: any[]) => any> {
|
|
|
12247
12312
|
/**
|
|
12248
12313
|
* The function return type.
|
|
12249
12314
|
*/
|
|
12250
|
-
type?: HandleReturnType<ReturnType<F>>;
|
|
12315
|
+
type?: HandleReturnType<Parameters<F>, ReturnType<F>>;
|
|
12251
12316
|
/**
|
|
12252
12317
|
* The function return value description.
|
|
12253
12318
|
*/
|
|
@@ -12284,8 +12349,8 @@ declare global {
|
|
|
12284
12349
|
}
|
|
12285
12350
|
}
|
|
12286
12351
|
|
|
12287
|
-
type PropType<P> = StringType$1<P> | BooleanType$1<P> | NumberType$1<P> | JSONLikeType<P> | ChoiceType<P> | DataSourceType<P> | CustomType<P>;
|
|
12288
|
-
type RestrictPropType<T, P> = T extends string ? StringType$1<P> | ChoiceType<P> | JSONLikeType<P> | CustomType<P> : T extends boolean ? BooleanType$1<P> | JSONLikeType<P> | CustomType<P> : T extends number ? NumberType$1<P> | JSONLikeType<P> | CustomType<P> : PropType<P>;
|
|
12352
|
+
type PropType<P> = StringType$1<P> | BooleanType$1<P> | NumberType$1<P> | JSONLikeType<P> | ChoiceType$1<P> | DataSourceType<P> | CustomType<P>;
|
|
12353
|
+
type RestrictPropType<T, P> = T extends string ? StringType$1<P> | ChoiceType$1<P> | JSONLikeType<P> | CustomType<P> : T extends boolean ? BooleanType$1<P> | JSONLikeType<P> | CustomType<P> : T extends number ? NumberType$1<P> | JSONLikeType<P> | CustomType<P> : PropType<P>;
|
|
12289
12354
|
type DistributedKeyOf<T> = T extends any ? keyof T : never;
|
|
12290
12355
|
interface GlobalContextMeta<P> {
|
|
12291
12356
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/react-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.379",
|
|
4
4
|
"description": "plasmic library for rendering in the presentational style",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"@plasmicapp/auth-react": "0.0.22",
|
|
100
|
-
"@plasmicapp/data-sources": "0.1.
|
|
100
|
+
"@plasmicapp/data-sources": "0.1.176",
|
|
101
101
|
"@plasmicapp/data-sources-context": "0.1.21",
|
|
102
|
-
"@plasmicapp/host": "1.0.
|
|
102
|
+
"@plasmicapp/host": "1.0.212",
|
|
103
103
|
"@plasmicapp/loader-splits": "1.0.64",
|
|
104
104
|
"@plasmicapp/nextjs-app-router": "1.0.16",
|
|
105
105
|
"@plasmicapp/prepass": "1.0.19",
|
|
@@ -156,5 +156,5 @@
|
|
|
156
156
|
"react": ">=16.8.0",
|
|
157
157
|
"react-dom": ">=16.8.0"
|
|
158
158
|
},
|
|
159
|
-
"gitHead": "
|
|
159
|
+
"gitHead": "e14716fd42ea79a35e4844d660f6d12aa97a9768"
|
|
160
160
|
}
|