@plasmicapp/react-web 0.2.407 → 0.2.408

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.
Files changed (2) hide show
  1. package/dist/all.d.ts +48 -43
  2. package/package.json +4 -4
package/dist/all.d.ts CHANGED
@@ -11392,10 +11392,14 @@ type ControlExtras = {
11392
11392
  item?: any;
11393
11393
  };
11394
11394
  type InferDataType<P> = P extends CanvasComponentProps<infer Data> ? Data : any;
11395
- interface CommonTypeBase<Ctx extends any[]> {
11395
+ interface CommonTypeBase {
11396
11396
  description?: string;
11397
11397
  helpText?: string;
11398
- required?: boolean;
11398
+ /**
11399
+ * If true, will hide the prop in a collapsed section; good for props that
11400
+ * should not usually be used.
11401
+ */
11402
+ advanced?: boolean;
11399
11403
  /**
11400
11404
  * If the user has chosen to use a dynamic expression for this prop, provide
11401
11405
  * a hint as to the expected values that the expression should evaluate to.
@@ -11403,16 +11407,22 @@ interface CommonTypeBase<Ctx extends any[]> {
11403
11407
  * markdown in the text here.
11404
11408
  */
11405
11409
  exprHint?: string;
11406
- /**
11407
- * Function for whether this prop should be hidden in the right panel,
11408
- * given the current props for this component
11409
- */
11410
- hidden?: ContextDependentConfig<Ctx, boolean>;
11411
11410
  /**
11412
11411
  * If true, does not allow the user to use a dynamic expression for this prop
11413
11412
  */
11414
11413
  disableDynamicValue?: boolean;
11415
11414
  }
11415
+ interface Defaultable<Ctx extends any[], T> {
11416
+ /**
11417
+ * Default value to set for this prop when the component is instantiated
11418
+ */
11419
+ defaultValue?: T;
11420
+ /**
11421
+ * Specify that default when no prop/param is provided,
11422
+ * so the Plasmic user can see it in the studio UI
11423
+ */
11424
+ defaultValueHint?: T | ContextDependentConfig<Ctx, T | undefined>;
11425
+ }
11416
11426
 
11417
11427
  type ChoiceValue = string | number | boolean;
11418
11428
  type ChoiceObject<T = ChoiceValue> = {
@@ -11920,14 +11930,10 @@ type ComponentControlContext<P> = GenericContext<P, // Full component props
11920
11930
  InferDataType<P> | null, // Canvas data
11921
11931
  ControlExtras>;
11922
11932
  type ComponentContextConfig<Props, R> = ContextDependentConfig<ComponentControlContext<Props>, R>;
11923
- interface PropTypeBase<Ctx extends any[]> extends CommonTypeBase<Ctx> {
11933
+ interface PropTypeBase<Ctx extends any[]> extends CommonTypeBase {
11924
11934
  displayName?: string;
11935
+ required?: boolean;
11925
11936
  readOnly?: boolean | ContextDependentConfig<Ctx, boolean>;
11926
- /**
11927
- * If true, will hide the prop in a collapsed section; good for props that
11928
- * should not usually be used.
11929
- */
11930
- advanced?: boolean;
11931
11937
  /**
11932
11938
  * If set to true, the component will be remounted when the prop value is updated.
11933
11939
  * (This behavior only applies to canvas)
@@ -11937,17 +11943,13 @@ interface PropTypeBase<Ctx extends any[]> extends CommonTypeBase<Ctx> {
11937
11943
  * If true, the prop can't be overriden in different variants.
11938
11944
  */
11939
11945
  invariantable?: boolean;
11940
- }
11941
- interface Defaultable<Ctx extends any[], T> {
11942
11946
  /**
11943
- * Default value to set for this prop when the component is instantiated
11944
- */
11945
- defaultValue?: T;
11946
- /**
11947
- * If no prop is given, the component uses a default; specify what
11948
- * that default is so the Plasmic user can see it in the studio UI
11947
+ * Function for whether this prop should be hidden in the right panel,
11948
+ * given the current props for this component
11949
11949
  */
11950
- defaultValueHint?: T | ContextDependentConfig<Ctx, T | undefined>;
11950
+ hidden?: ContextDependentConfig<Ctx, boolean>;
11951
+ }
11952
+ interface ExtendedDefaultable<Ctx extends any[], T> extends Defaultable<Ctx, T> {
11951
11953
  /**
11952
11954
  * Use a dynamic value expression as the default instead
11953
11955
  */
@@ -11975,7 +11977,7 @@ interface Controllable {
11975
11977
  */
11976
11978
  uncontrolledProp?: string;
11977
11979
  }
11978
- type PropTypeBaseDefault<P, T> = PropTypeBase<ComponentControlContext<P>> & Defaultable<ComponentControlContext<P>, T> & Controllable;
11980
+ type PropTypeBaseDefault<P, T> = PropTypeBase<ComponentControlContext<P>> & ExtendedDefaultable<ComponentControlContext<P>, T> & Controllable;
11979
11981
  type PlainStringType$1<P> = PropTypeBaseDefault<P, string> & PlainStringCore;
11980
11982
  type CodeStringType<P> = PropTypeBaseDefault<P, string> & CodeStringCore;
11981
11983
  type RichTextType<P> = PropTypeBaseDefault<P, string> & RichTextCore;
@@ -12259,45 +12261,45 @@ interface SimplifiedField {
12259
12261
  type FunctionControlContext<P> = GenericContext<Partial<P>, // Partial function props
12260
12262
  any>;
12261
12263
  type FunctionContextConfig<Args extends any[], R> = ContextDependentConfig<FunctionControlContext<Args>, R>;
12262
- interface BaseParam {
12264
+ interface ParamTypeBase extends CommonTypeBase {
12263
12265
  name: string;
12264
- description?: string;
12265
12266
  isOptional?: boolean;
12266
12267
  isRestParameter?: boolean;
12267
12268
  }
12268
- interface FunctionMeta<Args extends any[] = any> extends CommonTypeBase<FunctionControlContext<Args>> {
12269
+ type ParamTypeBaseDefault<Ctx extends any[], T> = ParamTypeBase & Defaultable<Ctx, T>;
12270
+ interface FunctionMeta extends CommonTypeBase {
12269
12271
  name: string;
12270
12272
  rest?: boolean;
12271
12273
  }
12272
- interface PlainStringType<T extends Nullish<string> = string> extends BaseParam {
12274
+ interface PlainStringType<T extends Nullish<string> = string> extends ParamTypeBaseDefault<any[], T> {
12273
12275
  type: "string" | `'${T}'`;
12274
12276
  }
12275
12277
  type StringType<P, T extends string = string> = "string" | PlainStringType<T> | ChoiceType<P, T> | DateStringType | DateRangeStringsType | AnyType;
12276
- interface PlainNumberType<T extends Nullish<number> = number> extends BaseParam {
12278
+ interface PlainNumberType<T extends Nullish<number> = number> extends ParamTypeBaseDefault<any[], T> {
12277
12279
  type: "number" | `${number extends T ? number : T}`;
12278
12280
  }
12279
- type NumberType<P, T extends number = number> = PlainNumberType<T> | (BaseParam & NumberTypeBaseCore<FunctionControlContext<P>>) | ChoiceType<P, T> | AnyType;
12280
- interface PlainBooleanType<T extends Nullish<boolean> = boolean> extends BaseParam {
12281
+ type NumberType<P, T extends number = number> = PlainNumberType<T> | (ParamTypeBaseDefault<FunctionControlContext<P>, T> & NumberTypeBaseCore<FunctionControlContext<P>>) | ChoiceType<P, T> | AnyType;
12282
+ interface PlainBooleanType<T extends Nullish<boolean> = boolean> extends ParamTypeBaseDefault<any[], T> {
12281
12283
  type: "boolean" | `${boolean extends T ? boolean : T}`;
12282
12284
  }
12283
- type BooleanType<P, T extends boolean = boolean> = PlainBooleanType<T> | (BaseParam & RichBooleanCore) | ChoiceType<P, T> | AnyType;
12284
- type GraphQLType<P> = BaseParam & GraphQLCore<FunctionControlContext<P>>;
12285
- interface PlainNullType extends BaseParam {
12285
+ type BooleanType<P, T extends boolean = boolean> = PlainBooleanType<T> | (ParamTypeBaseDefault<FunctionControlContext<P>, T> & RichBooleanCore) | ChoiceType<P, T> | AnyType;
12286
+ type GraphQLType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, any> & GraphQLCore<FunctionControlContext<P>>;
12287
+ interface PlainNullType extends ParamTypeBaseDefault<any[], null> {
12286
12288
  type: "null";
12287
12289
  }
12288
12290
  type NullType = PlainNullType | AnyType;
12289
- interface PlainUndefinedType extends BaseParam {
12291
+ interface PlainUndefinedType extends ParamTypeBaseDefault<any[], undefined> {
12290
12292
  type: "undefined";
12291
12293
  }
12292
12294
  type UndefinedType = PlainUndefinedType | AnyType;
12293
- type ObjectType<P> = BaseParam & ObjectTypeBaseCore<FunctionControlContext<P>, AnyTyping<P, any>>;
12294
- type ArrayType<P> = BaseParam & ArrayTypeBaseCore<FunctionControlContext<P>, AnyTyping<P, any>>;
12295
- type QueryBuilderType<P> = BaseParam & QueryBuilderCore<FunctionControlContext<P>>;
12296
- interface PlainAnyType extends BaseParam {
12295
+ type ObjectType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, Record<string, any>> & ObjectTypeBaseCore<FunctionControlContext<P>, AnyTyping<P, any>>;
12296
+ type ArrayType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, any[]> & ArrayTypeBaseCore<FunctionControlContext<P>, AnyTyping<P, any>>;
12297
+ type QueryBuilderType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, any> & QueryBuilderCore<FunctionControlContext<P>>;
12298
+ interface PlainAnyType extends ParamTypeBaseDefault<FunctionControlContext<any>, any> {
12297
12299
  type: "any";
12298
12300
  }
12299
12301
  type AnyType = PlainAnyType;
12300
- interface PlainVoidType extends BaseParam {
12302
+ interface PlainVoidType extends ParamTypeBase {
12301
12303
  type: "void";
12302
12304
  }
12303
12305
  type VoidType = PlainVoidType | AnyType;
@@ -12305,7 +12307,7 @@ type IsAny<T> = 0 extends 1 & T ? true : false;
12305
12307
  type CommonType<P, T> = T extends GraphQLValue ? GraphQLType<P> : T extends null ? NullType : T extends undefined ? UndefinedType : T extends Array<any> ? ArrayType<P> : T extends object ? ObjectType<P> : AnyType;
12306
12308
  type AnyTyping<P, T> = T extends string ? StringType<P, T> : T extends number ? NumberType<P, T> : T extends boolean ? BooleanType<P, T> : CommonType<P, T>;
12307
12309
  type ToTuple<T> = T extends any[] ? T : never;
12308
- type FunctionChoiceType<Args, Opt extends ChoiceValue = ChoiceValue> = FunctionMeta<ToTuple<Args>> & ChoiceCore<FunctionControlContext<ToTuple<Args>>, Opt>;
12310
+ type FunctionChoiceType<Args, Opt extends ChoiceValue = ChoiceValue> = FunctionMeta & Defaultable<FunctionControlContext<ToTuple<Args>>, Opt | Opt[]> & ChoiceCore<FunctionControlContext<ToTuple<Args>>, Opt>;
12309
12311
  interface SingleChoiceType<P, Opt extends ChoiceValue = ChoiceValue> extends FunctionChoiceType<P, Opt> {
12310
12312
  multiSelect?: false;
12311
12313
  }
@@ -12316,9 +12318,12 @@ interface CustomChoiceType<P, Opt extends ChoiceValue = ChoiceValue> extends Fun
12316
12318
  multiSelect: FunctionContextConfig<ToTuple<P>, boolean>;
12317
12319
  }
12318
12320
  type ChoiceType<P, T extends ChoiceValue = ChoiceValue> = SingleChoiceType<P, T> | MultiChoiceType<P, T> | CustomChoiceType<P, T>;
12319
- type DateStringType = BaseParam & DateStringCore;
12320
- type DateRangeStringsType = BaseParam & DateRangeStringsCore;
12321
- interface DynamicType<P> extends BaseParam, DynamicCore<FunctionControlContext<ToTuple<P>>, ParamType<P, any>> {
12321
+ type DateStringType = ParamTypeBaseDefault<FunctionControlContext<string>, string> & DateStringCore;
12322
+ type DateRangeStringsType = ParamTypeBaseDefault<FunctionControlContext<[string, string]>, [
12323
+ string,
12324
+ string
12325
+ ]> & DateRangeStringsCore;
12326
+ interface DynamicType<P> extends ParamTypeBase, DynamicCore<FunctionControlContext<ToTuple<P>>, ParamType<P, any>> {
12322
12327
  }
12323
12328
  type RestrictedType<P, T> = IsAny<T> extends true ? AnyTyping<P, T> : [
12324
12329
  T
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicapp/react-web",
3
- "version": "0.2.407",
3
+ "version": "0.2.408",
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",
@@ -96,9 +96,9 @@
96
96
  },
97
97
  "dependencies": {
98
98
  "@plasmicapp/auth-react": "0.0.24",
99
- "@plasmicapp/data-sources": "0.1.192",
99
+ "@plasmicapp/data-sources": "0.1.193",
100
100
  "@plasmicapp/data-sources-context": "0.1.22",
101
- "@plasmicapp/host": "1.0.228",
101
+ "@plasmicapp/host": "1.0.229",
102
102
  "@plasmicapp/loader-splits": "1.0.66",
103
103
  "@plasmicapp/nextjs-app-router": "1.0.19",
104
104
  "@plasmicapp/prepass": "1.0.21",
@@ -153,5 +153,5 @@
153
153
  "react": ">=16.8.0",
154
154
  "react-dom": ">=16.8.0"
155
155
  },
156
- "gitHead": "8df40eebbc118bfe5537f29e66eb0f6a2e6b2f90"
156
+ "gitHead": "bf8e3de2d53a1280fa9bc20fffbe6641eb73ab02"
157
157
  }