@webflow/designer-extension-typings 2.0.19 → 2.0.23

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.
@@ -1,9 +1,6 @@
1
1
  // This file was automatically generated. See designer-extensions docs.
2
2
 
3
3
  type ElementPresets = {
4
- Animation: ElementPreset<AnyElement>;
5
- Spline: ElementPreset<AnyElement>;
6
- Rive: ElementPreset<AnyElement>;
7
4
  SearchForm: ElementPreset<AnyElement>;
8
5
  DOM: ElementPreset<DOMElement>;
9
6
  DivBlock: ElementPreset<BlockElement>;
@@ -19,6 +16,9 @@ type ElementPresets = {
19
16
  RichText: ElementPreset<RichTextElement>;
20
17
  CodeBlock: ElementPreset<CodeBlockElement>;
21
18
  Image: ElementPreset<AnyElement>;
19
+ Animation: ElementPreset<AnyElement>;
20
+ Spline: ElementPreset<AnyElement>;
21
+ Rive: ElementPreset<AnyElement>;
22
22
  BackgroundVideoWrapper: ElementPreset<BackgroundVideoWrapperElement>;
23
23
  CommercePaypalCheckoutFormContainer: ElementPreset<AnyElement>;
24
24
  CommerceCheckoutFormContainer: ElementPreset<AnyElement>;
@@ -130,7 +130,7 @@ interface DOMElement
130
130
  Styles,
131
131
  Children,
132
132
  TextContent,
133
- NoAppConnections {
133
+ AppConnections {
134
134
  readonly id: FullElementId;
135
135
  readonly type: 'DOM';
136
136
  readonly plugin: 'Builtin';
@@ -142,32 +142,6 @@ interface DOMElement
142
142
  removeAttribute(name: string): Promise<null>;
143
143
  }
144
144
 
145
- interface AnimationElement
146
- extends WebflowElement,
147
- CustomAttributes,
148
- DomId,
149
- Styles,
150
- NoChildren,
151
- NoTextContent,
152
- NoAppConnections {
153
- readonly id: FullElementId;
154
- readonly type: 'Animation';
155
- readonly plugin: 'Animation';
156
- }
157
-
158
- interface SplineElement
159
- extends WebflowElement,
160
- CustomAttributes,
161
- DomId,
162
- Styles,
163
- NoChildren,
164
- NoTextContent,
165
- NoAppConnections {
166
- readonly id: FullElementId;
167
- readonly type: 'Spline';
168
- readonly plugin: 'Animation';
169
- }
170
-
171
145
  interface SearchFormElement
172
146
  extends WebflowElement,
173
147
  CustomAttributes,
@@ -287,9 +261,9 @@ interface BlockquoteElement
287
261
 
288
262
  interface CodeBlockElement
289
263
  extends WebflowElement,
290
- NoCustomAttributes,
291
- NoDomId,
292
- NoStyles,
264
+ CustomAttributes,
265
+ DomId,
266
+ Styles,
293
267
  NoChildren,
294
268
  NoTextContent,
295
269
  NoAppConnections {
@@ -533,6 +507,45 @@ interface InlineCodeElement
533
507
  readonly plugin: 'Basic';
534
508
  }
535
509
 
510
+ interface AnimationElement
511
+ extends WebflowElement,
512
+ CustomAttributes,
513
+ DomId,
514
+ Styles,
515
+ NoChildren,
516
+ NoTextContent,
517
+ NoAppConnections {
518
+ readonly id: FullElementId;
519
+ readonly type: 'Animation';
520
+ readonly plugin: 'Animation';
521
+ }
522
+
523
+ interface SplineElement
524
+ extends WebflowElement,
525
+ CustomAttributes,
526
+ DomId,
527
+ Styles,
528
+ NoChildren,
529
+ NoTextContent,
530
+ NoAppConnections {
531
+ readonly id: FullElementId;
532
+ readonly type: 'Spline';
533
+ readonly plugin: 'Animation';
534
+ }
535
+
536
+ interface RiveElement
537
+ extends WebflowElement,
538
+ CustomAttributes,
539
+ DomId,
540
+ Styles,
541
+ NoChildren,
542
+ NoTextContent,
543
+ NoAppConnections {
544
+ readonly id: FullElementId;
545
+ readonly type: 'Rive';
546
+ readonly plugin: 'Animation';
547
+ }
548
+
536
549
  interface BackgroundVideoWrapperElement
537
550
  extends WebflowElement,
538
551
  CustomAttributes,
@@ -4341,25 +4354,23 @@ interface UserErrorMsgElement
4341
4354
  readonly plugin: 'Users';
4342
4355
  }
4343
4356
 
4344
- interface CodeIslandElement
4357
+ interface FrameElement
4345
4358
  extends WebflowElement,
4346
4359
  CustomAttributes,
4347
4360
  DomId,
4348
4361
  Styles,
4349
- NoChildren,
4362
+ Children,
4350
4363
  NoTextContent,
4351
4364
  NoAppConnections {
4352
4365
  readonly id: FullElementId;
4353
- readonly type: 'CodeIsland';
4354
- readonly plugin: 'Code';
4366
+ readonly type: 'Frame';
4367
+ readonly plugin: 'Frame';
4355
4368
  }
4356
4369
 
4357
4370
  type AnyElement =
4358
4371
  | ComponentElement
4359
4372
  | UnknownElement
4360
4373
  | DOMElement
4361
- | AnimationElement
4362
- | SplineElement
4363
4374
  | SearchFormElement
4364
4375
  | SearchInputElement
4365
4376
  | SearchButtonElement
@@ -4387,6 +4398,9 @@ type AnyElement =
4387
4398
  | SuperscriptElement
4388
4399
  | SubscriptElement
4389
4400
  | InlineCodeElement
4401
+ | AnimationElement
4402
+ | SplineElement
4403
+ | RiveElement
4390
4404
  | BackgroundVideoWrapperElement
4391
4405
  | BackgroundVideoPlayPauseButtonElement
4392
4406
  | BackgroundVideoPlayPauseButtonPlayingElement
@@ -4677,4 +4691,4 @@ type AnyElement =
4677
4691
  | UserResetPasswordErrorMsgElement
4678
4692
  | UserUpdatePasswordErrorMsgElement
4679
4693
  | UserErrorMsgElement
4680
- | CodeIslandElement;
4694
+ | FrameElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webflow/designer-extension-typings",
3
- "version": "2.0.19",
3
+ "version": "2.0.23",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "Typings for the Webflow Designer Extension API",
6
6
  "main": "",
package/styles.d.ts CHANGED
@@ -170,10 +170,10 @@ interface Style {
170
170
  * @param options - Options to remove variable modes based on breakpoints and pseudo classes / states.
171
171
  * @example
172
172
  * ```ts
173
- * await myStyle.removeVariableModes({
174
- * 'collection-id-1': 'mode-id-1',
175
- * 'collection-id-2': 'mode-id-2',
176
- * });
173
+ * const collection = await webflow.getVariableCollectionById('collection-id');
174
+ * const mode = await collection.getVariableModeByName('Dark');
175
+ * const modeTwo = await collection.getVariableModeByName('Light');
176
+ * await myStyle.removeVariableModes([mode, modeTwo]);
177
177
  * ```
178
178
  */
179
179
  removeVariableModes(
package/variables.d.ts CHANGED
@@ -38,8 +38,8 @@ interface ColorVariable {
38
38
  * ```
39
39
  */
40
40
  set(
41
- value: ColorValue | ColorVariable | CustomValue,
42
- options?: VariableOptions
41
+ value: ColorValue | ColorVariable | CustomValue | null,
42
+ options?: VariableSetOptions
43
43
  ): Promise<null>;
44
44
  /**
45
45
  * Get the variable’s value.
@@ -53,8 +53,8 @@ interface ColorVariable {
53
53
  * ```
54
54
  */
55
55
  get(
56
- options?: VariableOptions
57
- ): Promise<ColorValue | ColorVariable | CustomValue>;
56
+ options?: VariableGetOptions
57
+ ): Promise<ColorValue | ColorVariable | CustomValue | null>;
58
58
  /**
59
59
  * Removes a variable from the default collection.
60
60
  * @returns A Promise that resolves into a boolean indicating whether deleting the variable was successful or not.
@@ -137,8 +137,8 @@ interface SizeVariable {
137
137
  * ```
138
138
  */
139
139
  set(
140
- value: SizeValue | SizeVariable | CustomValue,
141
- options?: VariableOptions
140
+ value: SizeValue | SizeVariable | CustomValue | null,
141
+ options?: VariableSetOptions
142
142
  ): Promise<null>;
143
143
  /**
144
144
  * Get the variable’s value.
@@ -152,8 +152,8 @@ interface SizeVariable {
152
152
  * ```
153
153
  */
154
154
  get(
155
- options?: VariableOptions
156
- ): Promise<SizeValue | SizeVariable | CustomValue>;
155
+ options?: VariableGetOptions
156
+ ): Promise<SizeValue | SizeVariable | CustomValue | null>;
157
157
  /**
158
158
  * Removes a variable from the default collection.
159
159
  * @returns A Promise that resolves into a boolean indicating whether deleting the variable was successful or not.
@@ -237,8 +237,8 @@ interface NumberVariable {
237
237
  * ```
238
238
  */
239
239
  set(
240
- value: NumberValue | NumberVariable | CustomValue,
241
- options?: VariableOptions
240
+ value: NumberValue | NumberVariable | CustomValue | null,
241
+ options?: VariableSetOptions
242
242
  ): Promise<null>;
243
243
 
244
244
  /**
@@ -253,8 +253,8 @@ interface NumberVariable {
253
253
  * ```
254
254
  */
255
255
  get(
256
- options?: VariableOptions
257
- ): Promise<NumberValue | NumberVariable | CustomValue>;
256
+ options?: VariableGetOptions
257
+ ): Promise<NumberValue | NumberVariable | CustomValue | null>;
258
258
 
259
259
  /**
260
260
  * Removes the variable from the default collection.
@@ -338,8 +338,8 @@ interface PercentageVariable {
338
338
  * ```
339
339
  */
340
340
  set(
341
- value: PercentageValue | PercentageVariable | CustomValue,
342
- options?: VariableOptions
341
+ value: PercentageValue | PercentageVariable | CustomValue | null,
342
+ options?: VariableSetOptions
343
343
  ): Promise<null>;
344
344
 
345
345
  /**
@@ -354,8 +354,8 @@ interface PercentageVariable {
354
354
  * ```
355
355
  */
356
356
  get(
357
- options?: VariableOptions
358
- ): Promise<PercentageValue | PercentageVariable | CustomValue>;
357
+ options?: VariableGetOptions
358
+ ): Promise<PercentageValue | PercentageVariable | CustomValue | null>;
359
359
 
360
360
  /**
361
361
  * Removes the variable from the default collection.
@@ -437,8 +437,8 @@ interface FontFamilyVariable {
437
437
  * ```
438
438
  */
439
439
  set(
440
- value: FontFamilyValue | FontFamilyVariable | CustomValue,
441
- options?: VariableOptions
440
+ value: FontFamilyValue | FontFamilyVariable | CustomValue | null,
441
+ options?: VariableSetOptions
442
442
  ): Promise<null>;
443
443
  /**
444
444
  * Get the variable’s value.
@@ -452,8 +452,8 @@ interface FontFamilyVariable {
452
452
  * ```
453
453
  */
454
454
  get(
455
- options?: VariableOptions
456
- ): Promise<FontFamilyValue | FontFamilyVariable | CustomValue>;
455
+ options?: VariableGetOptions
456
+ ): Promise<FontFamilyValue | FontFamilyVariable | CustomValue | null>;
457
457
  /**
458
458
  * Removes a variable from the default collection.
459
459
  * @returns A Promise that resolves into a boolean indicating whether deleting the variable was successful or not.
@@ -510,23 +510,28 @@ interface VariableCollection {
510
510
  getAllVariables(): Promise<Array<Variable>>;
511
511
  createColorVariable(
512
512
  name: string,
513
- value: string | ColorVariable | CustomValue
513
+ value: string | ColorVariable | CustomValue,
514
+ modes?: {[key: VariableModeId]: string | ColorVariable | CustomValue}
514
515
  ): Promise<ColorVariable>;
515
516
  createSizeVariable(
516
517
  name: string,
517
- value: SizeValue | SizeVariable | CustomValue
518
+ value: SizeValue | SizeVariable | CustomValue,
519
+ modes?: {[key: VariableModeId]: SizeValue | SizeVariable | CustomValue}
518
520
  ): Promise<SizeVariable>;
519
521
  createNumberVariable(
520
522
  name: string,
521
- value: number | NumberVariable | CustomValue
523
+ value: number | NumberVariable | CustomValue,
524
+ modes?: {[key: VariableModeId]: number | NumberVariable | CustomValue}
522
525
  ): Promise<NumberVariable>;
523
526
  createPercentageVariable(
524
527
  name: string,
525
- value: number | PercentageVariable | CustomValue
528
+ value: number | PercentageVariable | CustomValue,
529
+ modes?: {[key: VariableModeId]: number | PercentageVariable | CustomValue}
526
530
  ): Promise<PercentageVariable>;
527
531
  createFontFamilyVariable(
528
532
  name: string,
529
- value: string | FontFamilyVariable | CustomValue
533
+ value: string | FontFamilyVariable | CustomValue,
534
+ modes?: {[key: VariableModeId]: string | FontFamilyVariable | CustomValue}
530
535
  ): Promise<FontFamilyVariable>;
531
536
  /**
532
537
  * Sets the name of the variable collection.
@@ -643,11 +648,19 @@ type SizeUnit =
643
648
  | 'vmax'
644
649
  | 'vmin'
645
650
  | 'ch';
646
- type VariableOptions = {
651
+ type VariableSetOptions = {
652
+ /** The mode to get/set the variable value for. */
653
+ mode?: VariableMode;
654
+ /** Whether to return custom values. */
655
+ customValues?: boolean;
656
+ };
657
+ type VariableGetOptions = {
647
658
  /** The mode to get/set the variable value for. */
648
659
  mode?: VariableMode;
649
660
  /** Whether to return custom values. */
650
661
  customValues?: boolean;
662
+ /** Whether to not return the base value and instead return null. */
663
+ doNotInheritFromBase?: boolean;
651
664
  };
652
665
  type CustomValue = {
653
666
  type: 'custom';