@plasmicapp/react-web 0.2.407 → 0.2.409

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 +55 -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> = {
@@ -11433,6 +11443,13 @@ interface ObjectTypeBaseCore<Ctx extends any[], Fields> {
11433
11443
  type: "object";
11434
11444
  fields?: Record<string, Fields>;
11435
11445
  nameFunc?: (item: any, ...args: Ctx) => string | undefined;
11446
+ /**
11447
+ * Controls how the object editor is displayed in the UI.
11448
+ * - "popup": Opens a modal/popover to edit the object (default)
11449
+ * - "inline": Renders the object fields directly inline in the property panel
11450
+ * @default "popup"
11451
+ */
11452
+ display?: "inline" | "popup";
11436
11453
  }
11437
11454
  interface ArrayTypeBaseCore<Ctx extends any[], Fields> {
11438
11455
  type: "array";
@@ -11920,14 +11937,10 @@ type ComponentControlContext<P> = GenericContext<P, // Full component props
11920
11937
  InferDataType<P> | null, // Canvas data
11921
11938
  ControlExtras>;
11922
11939
  type ComponentContextConfig<Props, R> = ContextDependentConfig<ComponentControlContext<Props>, R>;
11923
- interface PropTypeBase<Ctx extends any[]> extends CommonTypeBase<Ctx> {
11940
+ interface PropTypeBase<Ctx extends any[]> extends CommonTypeBase {
11924
11941
  displayName?: string;
11942
+ required?: boolean;
11925
11943
  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
11944
  /**
11932
11945
  * If set to true, the component will be remounted when the prop value is updated.
11933
11946
  * (This behavior only applies to canvas)
@@ -11937,17 +11950,13 @@ interface PropTypeBase<Ctx extends any[]> extends CommonTypeBase<Ctx> {
11937
11950
  * If true, the prop can't be overriden in different variants.
11938
11951
  */
11939
11952
  invariantable?: boolean;
11940
- }
11941
- interface Defaultable<Ctx extends any[], T> {
11942
11953
  /**
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
11954
+ * Function for whether this prop should be hidden in the right panel,
11955
+ * given the current props for this component
11949
11956
  */
11950
- defaultValueHint?: T | ContextDependentConfig<Ctx, T | undefined>;
11957
+ hidden?: ContextDependentConfig<Ctx, boolean>;
11958
+ }
11959
+ interface ExtendedDefaultable<Ctx extends any[], T> extends Defaultable<Ctx, T> {
11951
11960
  /**
11952
11961
  * Use a dynamic value expression as the default instead
11953
11962
  */
@@ -11975,7 +11984,7 @@ interface Controllable {
11975
11984
  */
11976
11985
  uncontrolledProp?: string;
11977
11986
  }
11978
- type PropTypeBaseDefault<P, T> = PropTypeBase<ComponentControlContext<P>> & Defaultable<ComponentControlContext<P>, T> & Controllable;
11987
+ type PropTypeBaseDefault<P, T> = PropTypeBase<ComponentControlContext<P>> & ExtendedDefaultable<ComponentControlContext<P>, T> & Controllable;
11979
11988
  type PlainStringType$1<P> = PropTypeBaseDefault<P, string> & PlainStringCore;
11980
11989
  type CodeStringType<P> = PropTypeBaseDefault<P, string> & CodeStringCore;
11981
11990
  type RichTextType<P> = PropTypeBaseDefault<P, string> & RichTextCore;
@@ -12259,45 +12268,45 @@ interface SimplifiedField {
12259
12268
  type FunctionControlContext<P> = GenericContext<Partial<P>, // Partial function props
12260
12269
  any>;
12261
12270
  type FunctionContextConfig<Args extends any[], R> = ContextDependentConfig<FunctionControlContext<Args>, R>;
12262
- interface BaseParam {
12271
+ interface ParamTypeBase extends CommonTypeBase {
12263
12272
  name: string;
12264
- description?: string;
12265
12273
  isOptional?: boolean;
12266
12274
  isRestParameter?: boolean;
12267
12275
  }
12268
- interface FunctionMeta<Args extends any[] = any> extends CommonTypeBase<FunctionControlContext<Args>> {
12276
+ type ParamTypeBaseDefault<Ctx extends any[], T> = ParamTypeBase & Defaultable<Ctx, T>;
12277
+ interface FunctionMeta extends CommonTypeBase {
12269
12278
  name: string;
12270
12279
  rest?: boolean;
12271
12280
  }
12272
- interface PlainStringType<T extends Nullish<string> = string> extends BaseParam {
12281
+ interface PlainStringType<T extends Nullish<string> = string> extends ParamTypeBaseDefault<any[], T> {
12273
12282
  type: "string" | `'${T}'`;
12274
12283
  }
12275
12284
  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 {
12285
+ interface PlainNumberType<T extends Nullish<number> = number> extends ParamTypeBaseDefault<any[], T> {
12277
12286
  type: "number" | `${number extends T ? number : T}`;
12278
12287
  }
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 {
12288
+ type NumberType<P, T extends number = number> = PlainNumberType<T> | (ParamTypeBaseDefault<FunctionControlContext<P>, T> & NumberTypeBaseCore<FunctionControlContext<P>>) | ChoiceType<P, T> | AnyType;
12289
+ interface PlainBooleanType<T extends Nullish<boolean> = boolean> extends ParamTypeBaseDefault<any[], T> {
12281
12290
  type: "boolean" | `${boolean extends T ? boolean : T}`;
12282
12291
  }
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 {
12292
+ type BooleanType<P, T extends boolean = boolean> = PlainBooleanType<T> | (ParamTypeBaseDefault<FunctionControlContext<P>, T> & RichBooleanCore) | ChoiceType<P, T> | AnyType;
12293
+ type GraphQLType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, any> & GraphQLCore<FunctionControlContext<P>>;
12294
+ interface PlainNullType extends ParamTypeBaseDefault<any[], null> {
12286
12295
  type: "null";
12287
12296
  }
12288
12297
  type NullType = PlainNullType | AnyType;
12289
- interface PlainUndefinedType extends BaseParam {
12298
+ interface PlainUndefinedType extends ParamTypeBaseDefault<any[], undefined> {
12290
12299
  type: "undefined";
12291
12300
  }
12292
12301
  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 {
12302
+ type ObjectType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, Record<string, any>> & ObjectTypeBaseCore<FunctionControlContext<P>, AnyTyping<P, any>>;
12303
+ type ArrayType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, any[]> & ArrayTypeBaseCore<FunctionControlContext<P>, AnyTyping<P, any>>;
12304
+ type QueryBuilderType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, any> & QueryBuilderCore<FunctionControlContext<P>>;
12305
+ interface PlainAnyType extends ParamTypeBaseDefault<FunctionControlContext<any>, any> {
12297
12306
  type: "any";
12298
12307
  }
12299
12308
  type AnyType = PlainAnyType;
12300
- interface PlainVoidType extends BaseParam {
12309
+ interface PlainVoidType extends ParamTypeBase {
12301
12310
  type: "void";
12302
12311
  }
12303
12312
  type VoidType = PlainVoidType | AnyType;
@@ -12305,7 +12314,7 @@ type IsAny<T> = 0 extends 1 & T ? true : false;
12305
12314
  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
12315
  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
12316
  type ToTuple<T> = T extends any[] ? T : never;
12308
- type FunctionChoiceType<Args, Opt extends ChoiceValue = ChoiceValue> = FunctionMeta<ToTuple<Args>> & ChoiceCore<FunctionControlContext<ToTuple<Args>>, Opt>;
12317
+ type FunctionChoiceType<Args, Opt extends ChoiceValue = ChoiceValue> = FunctionMeta & Defaultable<FunctionControlContext<ToTuple<Args>>, Opt | Opt[]> & ChoiceCore<FunctionControlContext<ToTuple<Args>>, Opt>;
12309
12318
  interface SingleChoiceType<P, Opt extends ChoiceValue = ChoiceValue> extends FunctionChoiceType<P, Opt> {
12310
12319
  multiSelect?: false;
12311
12320
  }
@@ -12316,9 +12325,12 @@ interface CustomChoiceType<P, Opt extends ChoiceValue = ChoiceValue> extends Fun
12316
12325
  multiSelect: FunctionContextConfig<ToTuple<P>, boolean>;
12317
12326
  }
12318
12327
  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>> {
12328
+ type DateStringType = ParamTypeBaseDefault<FunctionControlContext<string>, string> & DateStringCore;
12329
+ type DateRangeStringsType = ParamTypeBaseDefault<FunctionControlContext<[string, string]>, [
12330
+ string,
12331
+ string
12332
+ ]> & DateRangeStringsCore;
12333
+ interface DynamicType<P> extends ParamTypeBase, DynamicCore<FunctionControlContext<ToTuple<P>>, ParamType<P, any>> {
12322
12334
  }
12323
12335
  type RestrictedType<P, T> = IsAny<T> extends true ? AnyTyping<P, T> : [
12324
12336
  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.409",
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.194",
100
100
  "@plasmicapp/data-sources-context": "0.1.22",
101
- "@plasmicapp/host": "1.0.228",
101
+ "@plasmicapp/host": "1.0.230",
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": "38173d19290002d5a09d67da44e4c9f1c1682d37"
157
157
  }