@plasmicapp/react-web 0.2.428 → 0.2.430

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 +51 -40
  2. package/package.json +8 -8
package/dist/all.d.ts CHANGED
@@ -12266,9 +12266,15 @@ interface SimplifiedField {
12266
12266
  fieldSettings?: {};
12267
12267
  }
12268
12268
 
12269
- type FunctionControlContext<P> = GenericContext<Partial<P>, // Partial function props
12269
+ /**
12270
+ * `[string, number]` -> `[string | undefined, number | undefined]`
12271
+ */
12272
+ type PartialParams<P extends any[]> = {
12273
+ [K in keyof P]: P[K] | undefined;
12274
+ };
12275
+ type FunctionControlContext<P extends any[]> = GenericContext<PartialParams<P>, // Function params, each may be undefined
12270
12276
  any>;
12271
- type FunctionContextConfig<Args extends any[], R> = ContextDependentConfig<FunctionControlContext<Args>, R>;
12277
+ type FunctionContextConfig<P extends any[], R> = ContextDependentConfig<FunctionControlContext<P>, R>;
12272
12278
  interface TypeBaseDefault<Ctx extends any[], T> extends CommonTypeBase, Defaultable<Ctx, T> {
12273
12279
  displayName?: string;
12274
12280
  /**
@@ -12277,77 +12283,76 @@ interface TypeBaseDefault<Ctx extends any[], T> extends CommonTypeBase, Defaulta
12277
12283
  */
12278
12284
  hidden?: ContextDependentConfig<Ctx, boolean>;
12279
12285
  }
12280
- interface PlainStringType<T extends Nullish<string> = string> extends TypeBaseDefault<any[], T> {
12286
+ interface PlainStringType<P extends any[], T extends Nullish<string> = string> extends TypeBaseDefault<FunctionControlContext<P>, T> {
12281
12287
  type: "string" | `'${T}'`;
12282
12288
  }
12283
- type StringType<P, T extends string = string> = "string" | PlainStringType<T> | ChoiceType<P, T> | DateStringType | DateRangeStringsType | AnyType;
12284
- interface PlainNumberType<T extends Nullish<number> = number> extends TypeBaseDefault<any[], T> {
12289
+ type StringType<P extends any[], T extends string = string> = "string" | PlainStringType<P, T> | ChoiceType<P, T> | DateStringType<P> | DateRangeStringsType<P> | AnyType<P>;
12290
+ interface PlainNumberType<P extends any[], T extends Nullish<number> = number> extends TypeBaseDefault<FunctionControlContext<P>, T> {
12285
12291
  type: "number" | `${number extends T ? number : T}`;
12286
12292
  }
12287
- type NumberType<P, T extends number = number> = PlainNumberType<T> | (TypeBaseDefault<FunctionControlContext<P>, T> & NumberTypeBaseCore<FunctionControlContext<P>>) | ChoiceType<P, T> | AnyType;
12288
- interface PlainBooleanType<T extends Nullish<boolean> = boolean> extends TypeBaseDefault<any[], T> {
12293
+ type NumberType<P extends any[], T extends number = number> = PlainNumberType<P, T> | (TypeBaseDefault<FunctionControlContext<P>, T> & NumberTypeBaseCore<FunctionControlContext<P>>) | ChoiceType<P, T> | AnyType<P>;
12294
+ interface PlainBooleanType<P extends any[], T extends Nullish<boolean> = boolean> extends TypeBaseDefault<FunctionControlContext<P>, T> {
12289
12295
  type: "boolean" | `${boolean extends T ? boolean : T}`;
12290
12296
  }
12291
- type BooleanType<P, T extends boolean = boolean> = PlainBooleanType<T> | (TypeBaseDefault<FunctionControlContext<P>, T> & RichBooleanCore) | ChoiceType<P, T> | AnyType;
12292
- type GraphQLType<P> = TypeBaseDefault<FunctionControlContext<P>, any> & GraphQLCore<FunctionControlContext<P>>;
12293
- interface PlainNullType extends TypeBaseDefault<any[], null> {
12297
+ type BooleanType<P extends any[], T extends boolean = boolean> = PlainBooleanType<P, T> | (TypeBaseDefault<FunctionControlContext<P>, T> & RichBooleanCore) | ChoiceType<P, T> | AnyType<P>;
12298
+ type GraphQLType<P extends any[]> = TypeBaseDefault<FunctionControlContext<P>, any> & GraphQLCore<FunctionControlContext<P>>;
12299
+ interface PlainNullType<P extends any[]> extends TypeBaseDefault<FunctionControlContext<P>, null> {
12294
12300
  type: "null";
12295
12301
  }
12296
- type NullType = PlainNullType | AnyType;
12297
- interface PlainUndefinedType extends TypeBaseDefault<any[], undefined> {
12302
+ type NullType<P extends any[]> = PlainNullType<P> | AnyType<P>;
12303
+ interface PlainUndefinedType<P extends any[]> extends TypeBaseDefault<FunctionControlContext<P>, undefined> {
12298
12304
  type: "undefined";
12299
12305
  }
12300
- type UndefinedType = PlainUndefinedType | AnyType;
12306
+ type UndefinedType<P extends any[]> = PlainUndefinedType<P> | AnyType<P>;
12301
12307
  type ExtractObjectKeys<T extends object> = keyof T & string;
12302
- type ObjectType<P, T extends object> = TypeBaseDefault<FunctionControlContext<P>, T> & ObjectTypeBaseCore<FunctionControlContext<P>, GenericType<P, any>, ExtractObjectKeys<T>>;
12303
- type ArrayType<P> = TypeBaseDefault<FunctionControlContext<P>, any[]> & ArrayTypeBaseCore<FunctionControlContext<P>, GenericType<P, any>>;
12304
- type QueryBuilderType<P> = TypeBaseDefault<FunctionControlContext<P>, any> & QueryBuilderCore<FunctionControlContext<P>>;
12305
- interface PlainAnyType extends TypeBaseDefault<FunctionControlContext<any>, any> {
12308
+ type ObjectType<P extends any[], T extends Record<string, any> = Record<string, any>> = TypeBaseDefault<FunctionControlContext<P>, T> & ObjectTypeBaseCore<FunctionControlContext<P>, GenericType<P, any>, ExtractObjectKeys<T>>;
12309
+ type ArrayType<P extends any[], T extends any[] = any[]> = TypeBaseDefault<FunctionControlContext<P>, T> & ArrayTypeBaseCore<FunctionControlContext<P>, GenericType<P, any>>;
12310
+ type QueryBuilderType<P extends any[]> = TypeBaseDefault<FunctionControlContext<P>, any> & QueryBuilderCore<FunctionControlContext<P>>;
12311
+ interface PlainAnyType<P extends any[]> extends TypeBaseDefault<FunctionControlContext<P>, any> {
12306
12312
  type: "any";
12307
12313
  }
12308
- type AnyType = PlainAnyType;
12314
+ type AnyType<P extends any[]> = PlainAnyType<P>;
12309
12315
  interface PlainVoidType extends CommonTypeBase {
12310
12316
  type: "void";
12311
12317
  }
12312
- type VoidType = PlainVoidType | AnyType;
12318
+ type VoidType<P extends any[]> = PlainVoidType | AnyType<P>;
12313
12319
  type IsAny<T> = 0 extends 1 & T ? true : false;
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, T> : AnyType;
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>;
12316
- type ToTuple<T> = T extends any[] ? T : never;
12317
- type ChoiceTypeBase<Args, Opt extends ChoiceValue = ChoiceValue> = TypeBaseDefault<FunctionControlContext<ToTuple<Args>>, Opt | Opt[]> & ChoiceCore<FunctionControlContext<ToTuple<Args>>, Opt>;
12318
- interface SingleChoiceType<P, Opt extends ChoiceValue = ChoiceValue> extends ChoiceTypeBase<P, Opt> {
12320
+ type CommonType<P extends any[], T> = T extends GraphQLValue ? GraphQLType<P> : T extends null ? NullType<P> : T extends undefined ? UndefinedType<P> : T extends Array<any> ? ArrayType<P> : T extends object ? ObjectType<P, T> : AnyType<P>;
12321
+ type AnyTyping<P extends any[], T> = T extends string ? StringType<P, T> : T extends number ? NumberType<P, T> : T extends boolean ? BooleanType<P, T> : CommonType<P, T>;
12322
+ type ChoiceTypeBase<P extends any[], Opt extends ChoiceValue = ChoiceValue> = TypeBaseDefault<FunctionControlContext<P>, Opt | Opt[]> & ChoiceCore<FunctionControlContext<P>, Opt>;
12323
+ interface SingleChoiceType<P extends any[], Opt extends ChoiceValue = ChoiceValue> extends ChoiceTypeBase<P, Opt> {
12319
12324
  multiSelect?: false;
12320
12325
  }
12321
- interface MultiChoiceType<P, Opt extends ChoiceValue = ChoiceValue> extends ChoiceTypeBase<P, Opt> {
12326
+ interface MultiChoiceType<P extends any[], Opt extends ChoiceValue = ChoiceValue> extends ChoiceTypeBase<P, Opt> {
12322
12327
  multiSelect: true;
12323
12328
  }
12324
- interface CustomChoiceType<P, Opt extends ChoiceValue = ChoiceValue> extends ChoiceTypeBase<P, Opt> {
12325
- multiSelect: FunctionContextConfig<ToTuple<P>, boolean>;
12329
+ interface CustomChoiceType<P extends any[], Opt extends ChoiceValue = ChoiceValue> extends ChoiceTypeBase<P, Opt> {
12330
+ multiSelect: FunctionContextConfig<P, boolean>;
12326
12331
  }
12327
- type ChoiceType<P, T extends ChoiceValue = ChoiceValue> = SingleChoiceType<P, T> | MultiChoiceType<P, T> | CustomChoiceType<P, T>;
12328
- type DateStringType = TypeBaseDefault<FunctionControlContext<string>, string> & DateStringCore;
12329
- type DateRangeStringsType = TypeBaseDefault<FunctionControlContext<[string, string]>, [
12332
+ type ChoiceType<P extends any[], T extends ChoiceValue = ChoiceValue> = SingleChoiceType<P, T> | MultiChoiceType<P, T> | CustomChoiceType<P, T>;
12333
+ type DateStringType<P extends any[]> = TypeBaseDefault<FunctionControlContext<P>, string> & DateStringCore;
12334
+ type DateRangeStringsType<P extends any[]> = TypeBaseDefault<FunctionControlContext<P>, [
12330
12335
  string,
12331
12336
  string
12332
12337
  ]> & DateRangeStringsCore;
12333
- interface DynamicType<P> extends CommonTypeBase, DynamicCore<FunctionControlContext<ToTuple<P>>, GenericType<P, any>> {
12338
+ interface DynamicType<P extends any[]> extends CommonTypeBase, DynamicCore<FunctionControlContext<P>, GenericType<P, any>> {
12334
12339
  }
12335
- type RestrictedType<P, T> = IsAny<T> extends true ? AnyTyping<P, T> : [
12340
+ type RestrictedType<P extends any[], T> = IsAny<T> extends true ? AnyTyping<P, T> : [
12336
12341
  T
12337
12342
  ] extends [string] ? StringType<P, T> : [T] extends [number] ? NumberType<P, T> : [T] extends [boolean] ? BooleanType<P, T> : T extends string | null | undefined ? Exclude<T, null | undefined> extends string ? StringType<P, T extends string ? T : string> : CommonType<P, T> : T extends number | null | undefined ? Exclude<T, null | undefined> extends number ? NumberType<P, T extends number ? T : number> : CommonType<P, T> : T extends boolean | null | undefined ? Exclude<T, null | undefined> extends boolean ? BooleanType<P, T extends boolean ? T : boolean> : CommonType<P, T> : CommonType<P, T>;
12338
- type GenericType<P, T> = RestrictedType<P, T> | DynamicType<P> | QueryBuilderType<P>;
12343
+ type GenericType<P extends any[], T> = RestrictedType<P, T> | DynamicType<P> | QueryBuilderType<P>;
12339
12344
  interface ParamTypeBase {
12340
12345
  name: string;
12341
12346
  }
12342
- type ParamType<P, T> = ParamTypeBase & GenericType<P, T>;
12343
- type RequiredParam<P, T> = ParamTypeBase & ParamType<P, T> & {
12347
+ type ParamType<P extends any[], T> = ParamTypeBase & GenericType<P, T>;
12348
+ type RequiredParam<P extends any[], T> = ParamTypeBase & ParamType<P, T> & {
12344
12349
  isOptional?: false;
12345
12350
  isRestParameter?: false;
12346
12351
  };
12347
- type OptionalParam<P, T> = ParamTypeBase & ParamType<P, T> & {
12352
+ type OptionalParam<P extends any[], T> = ParamTypeBase & ParamType<P, T> & {
12348
12353
  isRestParameter?: false;
12349
12354
  };
12350
- type RestParam<P, T> = ParamTypeBase & ParamType<P, T> & {
12355
+ type RestParam<P extends any[], T> = ParamTypeBase & ParamType<P, T> & {
12351
12356
  isOptional?: false;
12352
12357
  isRestParameter: true;
12353
12358
  };
@@ -12356,8 +12361,14 @@ type OptionalParams<T extends any[]> = T extends [
12356
12361
  ...RequiredParams<T>,
12357
12362
  ...infer R
12358
12363
  ] ? [...R] : [];
12359
- type HandleRequiredParams<P, R extends any[]> = R extends [infer H, ...infer T] ? [string | RequiredParam<P, H>, ...HandleRequiredParams<P, T>] : [];
12360
- type HandleOptionalParams<P, R extends any[]> = R extends [infer H, ...infer T] ? [] | [
12364
+ type HandleRequiredParams<P extends any[], R extends any[]> = R extends [
12365
+ infer H,
12366
+ ...infer T
12367
+ ] ? [string | RequiredParam<P, H>, ...HandleRequiredParams<P, T>] : [];
12368
+ type HandleOptionalParams<P extends any[], R extends any[]> = R extends [
12369
+ infer H,
12370
+ ...infer T
12371
+ ] ? [] | [
12361
12372
  string | OptionalParam<P, H | undefined>,
12362
12373
  ...HandleOptionalParams<P, T>
12363
12374
  ] : R extends [] ? [] : R extends Array<infer T> ? [] | [RestParam<P, T[]>] : [];
@@ -12365,7 +12376,7 @@ type HandleParams<P extends any[]> = [
12365
12376
  ...HandleRequiredParams<P, RequiredParams<P>>,
12366
12377
  ...HandleOptionalParams<P, Required<OptionalParams<P>>>
12367
12378
  ];
12368
- type HandleReturnType<P, T> = VoidType | ParamType<P, T>;
12379
+ type HandleReturnType<P extends any[], T> = VoidType<P> | ParamType<P, T>;
12369
12380
 
12370
12381
  interface CustomFunctionMeta<F extends (...args: any[]) => any> {
12371
12382
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicapp/react-web",
3
- "version": "0.2.428",
3
+ "version": "0.2.430",
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",
@@ -95,14 +95,14 @@
95
95
  "test-storybook": "test-storybook"
96
96
  },
97
97
  "dependencies": {
98
- "@plasmicapp/auth-react": "0.0.26",
99
- "@plasmicapp/data-sources": "0.1.207",
98
+ "@plasmicapp/auth-react": "0.0.27",
99
+ "@plasmicapp/data-sources": "0.1.209",
100
100
  "@plasmicapp/data-sources-context": "0.1.23",
101
- "@plasmicapp/host": "1.0.238",
101
+ "@plasmicapp/host": "1.0.240",
102
102
  "@plasmicapp/loader-splits": "1.0.69",
103
- "@plasmicapp/nextjs-app-router": "1.0.21",
104
- "@plasmicapp/prepass": "1.0.23",
105
- "@plasmicapp/query": "0.1.83",
103
+ "@plasmicapp/nextjs-app-router": "1.0.22",
104
+ "@plasmicapp/prepass": "1.0.24",
105
+ "@plasmicapp/query": "0.1.84",
106
106
  "@react-aria/checkbox": "^3.15.5",
107
107
  "@react-aria/focus": "^3.20.3",
108
108
  "@react-aria/interactions": "^3.25.1",
@@ -153,5 +153,5 @@
153
153
  "react": ">=16.8.0",
154
154
  "react-dom": ">=16.8.0"
155
155
  },
156
- "gitHead": "7a1fdd1cd5163fed32cfe3cb80b8bbcbce0505ce"
156
+ "gitHead": "e1ca5cfd7107719663e14b557a79161e7e657a1a"
157
157
  }