@wix/editor 1.438.0 → 1.439.0
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/cjs/index.js +438 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +438 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/statics/docs-ts-model.json +6187 -0
- package/dist/statics/index.js +438 -6
- package/dist/statics/index.js.map +1 -1
- package/dist/types/index.d.ts +464 -5
- package/package.json +11 -5
package/dist/types/index.d.ts
CHANGED
|
@@ -133,31 +133,88 @@ declare class ModalsSDKShape extends BaseSDKShape {
|
|
|
133
133
|
}
|
|
134
134
|
declare const _default$6: ModalsSDKShape & _wix_sdk_types.HostModule<ModalsSDKShape, _wix_sdk_types.Host>;
|
|
135
135
|
|
|
136
|
+
/** Represents a font family and its weight. */
|
|
136
137
|
interface IFontFamily {
|
|
138
|
+
/** The font family name. For example, 'Arial' or 'Helvetica Neue'. */
|
|
137
139
|
family: string;
|
|
140
|
+
/** The font weight. For example, '400' or 'bold'. */
|
|
138
141
|
weight: string;
|
|
139
142
|
}
|
|
143
|
+
/** Represents a font weight value. */
|
|
140
144
|
interface IFontWeight {
|
|
145
|
+
/** The font weight. For example, '400' or 'bold'. */
|
|
141
146
|
weight: string;
|
|
142
147
|
}
|
|
148
|
+
/** Combination of font family and weight properties. */
|
|
143
149
|
type IFontFamilyAndWeight = IFontFamily & IFontWeight;
|
|
144
150
|
type ISelectLinkSharedOptions = {
|
|
151
|
+
/** Identifier for the origin of the link selection (used for BI tracking). */
|
|
145
152
|
origin?: string;
|
|
146
153
|
};
|
|
154
|
+
/** Options for positioning a picker panel relative to a target element. */
|
|
147
155
|
type IPanelOptions = {
|
|
156
|
+
/** Where to place the picker panel relative to the target element. */
|
|
148
157
|
placement?: 'top' | 'bottom' | 'top-start' | 'bottom-start' | 'top-end' | 'bottom-end';
|
|
158
|
+
/** Vertical offset in pixels to shift the panel from its computed position. */
|
|
149
159
|
YShift?: number;
|
|
150
160
|
};
|
|
161
|
+
/**
|
|
162
|
+
* Methods for interacting with a component from a custom panel.
|
|
163
|
+
*
|
|
164
|
+
* Import `element` from `@wix/editor` to read and update styles, data,
|
|
165
|
+
* presets, and states, and to open editor pickers.
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```tsx
|
|
169
|
+
* import { element } from '@wix/editor';
|
|
170
|
+
*
|
|
171
|
+
* export default function MyPanel() {
|
|
172
|
+
* const handleClick = async () => {
|
|
173
|
+
* const data = await element.getData();
|
|
174
|
+
* await element.setData({ title: 'Updated!' });
|
|
175
|
+
* };
|
|
176
|
+
* return <button onClick={handleClick}>Update Title</button>;
|
|
177
|
+
* }
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
151
180
|
declare class ElementSDKShape extends BaseSDKShape {
|
|
152
181
|
protected overriddenApplicationContext: Promise<ApplicationContext> | null;
|
|
153
182
|
private childPath;
|
|
154
183
|
constructor(overriddenApplicationContext?: Promise<ApplicationContext> | null, childPath?: number[]);
|
|
184
|
+
/**
|
|
185
|
+
* Retrieves the style definitions declared in the component's manifest,
|
|
186
|
+
* including `cssProperties` and `cssCustomProperties`.
|
|
187
|
+
*
|
|
188
|
+
* @returns Style definitions for the component.
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* ```ts
|
|
192
|
+
* import { element } from '@wix/editor';
|
|
193
|
+
*
|
|
194
|
+
* const defs = await element.getStyleDefinitions();
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
155
197
|
getStyleDefinitions(): Promise<ElementStyleDefinitions>;
|
|
198
|
+
/**
|
|
199
|
+
* Retrieves the current style values for the component.
|
|
200
|
+
*
|
|
201
|
+
* @returns Current `cssProperties` and `cssCustomProperties` values.
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```ts
|
|
205
|
+
* import { element } from '@wix/editor';
|
|
206
|
+
*
|
|
207
|
+
* const styles = await element.getStyles();
|
|
208
|
+
* const bgColor = styles.cssProperties.backgroundColor;
|
|
209
|
+
* ```
|
|
210
|
+
*/
|
|
156
211
|
getStyles(): Promise<ElementStyles>;
|
|
157
212
|
/**
|
|
158
|
-
* Sets style values for the
|
|
213
|
+
* Sets style values for the component.
|
|
159
214
|
*
|
|
160
215
|
* @example
|
|
216
|
+
* ```ts
|
|
217
|
+
* import { element } from '@wix/editor';
|
|
161
218
|
* import { CssPropertyType } from '@wix/public-editor-platform-sdk';
|
|
162
219
|
*
|
|
163
220
|
* // Using enum (recommended):
|
|
@@ -169,12 +226,15 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
169
226
|
* await element.setStyles({
|
|
170
227
|
* cssProperties: { 'color': '#fff' }
|
|
171
228
|
* });
|
|
229
|
+
* ```
|
|
172
230
|
*/
|
|
173
231
|
setStyles(values?: ElementStylesUpdate): Promise<void>;
|
|
174
232
|
/**
|
|
175
|
-
* Removes style values from the
|
|
233
|
+
* Removes style values from the component.
|
|
176
234
|
*
|
|
177
235
|
* @example
|
|
236
|
+
* ```ts
|
|
237
|
+
* import { element } from '@wix/editor';
|
|
178
238
|
* import { CssPropertyType } from '@wix/public-editor-platform-sdk';
|
|
179
239
|
*
|
|
180
240
|
* // Using enum (recommended):
|
|
@@ -186,36 +246,236 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
186
246
|
* await element.removeStyles({
|
|
187
247
|
* cssPropertiesKeys: ['color']
|
|
188
248
|
* });
|
|
249
|
+
* ```
|
|
189
250
|
*/
|
|
190
251
|
removeStyles(values?: ElementStylesRemoval): Promise<void>;
|
|
252
|
+
/**
|
|
253
|
+
* Retrieves the data item definitions declared in the component's manifest.
|
|
254
|
+
*
|
|
255
|
+
* @returns Data item definitions keyed by data item key.
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```ts
|
|
259
|
+
* import { element } from '@wix/editor';
|
|
260
|
+
*
|
|
261
|
+
* const defs = await element.getDataDefinitions();
|
|
262
|
+
* ```
|
|
263
|
+
*/
|
|
191
264
|
getDataDefinitions(): Promise<ElementDataDefinitions>;
|
|
265
|
+
/**
|
|
266
|
+
* Retrieves the current data values for the component.
|
|
267
|
+
*
|
|
268
|
+
* @typeParam T - Optional type parameter to define the expected structure of the returned data.
|
|
269
|
+
* @returns Current data values for the component.
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* ```ts
|
|
273
|
+
* import { element } from '@wix/editor';
|
|
274
|
+
*
|
|
275
|
+
* const data = await element.getData();
|
|
276
|
+
* ```
|
|
277
|
+
*/
|
|
192
278
|
getData<T extends ElementData = ElementData>(): Promise<T>;
|
|
279
|
+
/**
|
|
280
|
+
* Retrieves the resolved value of a specific data item.
|
|
281
|
+
*
|
|
282
|
+
* Unlike {@link getData}, this method returns the fully resolved value
|
|
283
|
+
* for a single data item.
|
|
284
|
+
*
|
|
285
|
+
* @param options - Object containing the `dataItemKey` to resolve.
|
|
286
|
+
* @returns Resolved value for the specified data item.
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* ```ts
|
|
290
|
+
* import { element } from '@wix/editor';
|
|
291
|
+
*
|
|
292
|
+
* const resolved = await element.getResolvedData({
|
|
293
|
+
* dataItemKey: 'heroImage',
|
|
294
|
+
* });
|
|
295
|
+
* ```
|
|
296
|
+
*/
|
|
193
297
|
getResolvedData({ dataItemKey }: {
|
|
194
298
|
dataItemKey: string;
|
|
195
299
|
}): Promise<any>;
|
|
300
|
+
/**
|
|
301
|
+
* Updates data values for the component. Only the specified data items
|
|
302
|
+
* are updated; other data items remain unchanged.
|
|
303
|
+
*
|
|
304
|
+
* @typeParam T - Optional type parameter to define the expected structure of the input data.
|
|
305
|
+
* @param values - Data item keys and their new values.
|
|
306
|
+
*
|
|
307
|
+
* @example
|
|
308
|
+
* ```ts
|
|
309
|
+
* import { element } from '@wix/editor';
|
|
310
|
+
*
|
|
311
|
+
* await element.setData({ title: 'New Title', showButton: false });
|
|
312
|
+
* ```
|
|
313
|
+
*/
|
|
196
314
|
setData<T extends ElementData = ElementData>(values: ElementDataInput<T>): Promise<void>;
|
|
315
|
+
/**
|
|
316
|
+
* Retrieves the preset definitions declared in the component's manifest.
|
|
317
|
+
*
|
|
318
|
+
* @returns Preset definitions keyed by preset key.
|
|
319
|
+
*
|
|
320
|
+
* @example
|
|
321
|
+
* ```ts
|
|
322
|
+
* import { element } from '@wix/editor';
|
|
323
|
+
*
|
|
324
|
+
* const presets = await element.getPresetDefinitions();
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
197
327
|
getPresetDefinitions(): Promise<ElementPresetDefinitions>;
|
|
328
|
+
/**
|
|
329
|
+
* Retrieves the currently applied preset for the component.
|
|
330
|
+
*
|
|
331
|
+
* @returns Key of the applied preset, or `null` if no preset is applied.
|
|
332
|
+
*
|
|
333
|
+
* @example
|
|
334
|
+
* ```ts
|
|
335
|
+
* import { element } from '@wix/editor';
|
|
336
|
+
*
|
|
337
|
+
* const preset = await element.getAppliedPreset();
|
|
338
|
+
* ```
|
|
339
|
+
*/
|
|
198
340
|
getAppliedPreset(): Promise<any>;
|
|
341
|
+
/**
|
|
342
|
+
* Applies a preset to the component. Applying a preset updates the component's
|
|
343
|
+
* styles and data to match the preset's defined defaults.
|
|
344
|
+
*
|
|
345
|
+
* @param options - Object containing the `key` of the preset to apply.
|
|
346
|
+
*
|
|
347
|
+
* @example
|
|
348
|
+
* ```ts
|
|
349
|
+
* import { element } from '@wix/editor';
|
|
350
|
+
*
|
|
351
|
+
* await element.applyPreset({ key: 'minimal' });
|
|
352
|
+
* ```
|
|
353
|
+
*/
|
|
199
354
|
applyPreset(options: {
|
|
200
355
|
key: string;
|
|
201
356
|
}): Promise<any>;
|
|
357
|
+
/**
|
|
358
|
+
* Retrieves the display group definitions declared in the component's manifest.
|
|
359
|
+
*
|
|
360
|
+
* @param options - Optional filter by `groupType`.
|
|
361
|
+
* @returns Display group definitions for the component.
|
|
362
|
+
*
|
|
363
|
+
* @example
|
|
364
|
+
* ```ts
|
|
365
|
+
* import { element } from '@wix/editor';
|
|
366
|
+
*
|
|
367
|
+
* const groups = await element.getDisplayGroupDefinitions();
|
|
368
|
+
*
|
|
369
|
+
* const cssGroups = await element.getDisplayGroupDefinitions({
|
|
370
|
+
* filter: { groupType: 'cssDataType' },
|
|
371
|
+
* });
|
|
372
|
+
* ```
|
|
373
|
+
*/
|
|
202
374
|
getDisplayGroupDefinitions(options?: {
|
|
203
375
|
filter?: {
|
|
204
376
|
groupType?: string;
|
|
205
377
|
};
|
|
206
378
|
}): Promise<any>;
|
|
379
|
+
/**
|
|
380
|
+
* Retrieves the display name of the component as defined in the manifest.
|
|
381
|
+
*
|
|
382
|
+
* @returns Component display name.
|
|
383
|
+
*
|
|
384
|
+
* @example
|
|
385
|
+
* ```ts
|
|
386
|
+
* import { element } from '@wix/editor';
|
|
387
|
+
*
|
|
388
|
+
* const name = await element.getDisplayName();
|
|
389
|
+
* ```
|
|
390
|
+
*/
|
|
207
391
|
getDisplayName(): Promise<any>;
|
|
392
|
+
/**
|
|
393
|
+
* Retrieves the currently active state for the component.
|
|
394
|
+
*
|
|
395
|
+
* @returns Key of the active state, or `null` if the default state is active.
|
|
396
|
+
*
|
|
397
|
+
* @example
|
|
398
|
+
* ```ts
|
|
399
|
+
* import { element } from '@wix/editor';
|
|
400
|
+
*
|
|
401
|
+
* const state = await element.getState();
|
|
402
|
+
* ```
|
|
403
|
+
*/
|
|
208
404
|
getState(): Promise<any>;
|
|
405
|
+
/**
|
|
406
|
+
* Sets the active state for the component. Pass `null` to return to the
|
|
407
|
+
* default state.
|
|
408
|
+
*
|
|
409
|
+
* @param stateKey - State key to activate, or `null` for the default state.
|
|
410
|
+
*
|
|
411
|
+
* @example
|
|
412
|
+
* ```ts
|
|
413
|
+
* import { element } from '@wix/editor';
|
|
414
|
+
*
|
|
415
|
+
* await element.setState('hover');
|
|
416
|
+
*
|
|
417
|
+
* await element.setState(null);
|
|
418
|
+
* ```
|
|
419
|
+
*/
|
|
209
420
|
setState(stateKey: string | null): Promise<any>;
|
|
421
|
+
/**
|
|
422
|
+
* Retrieves the state definitions declared in the component's manifest.
|
|
423
|
+
*
|
|
424
|
+
* @returns State definitions keyed by state key.
|
|
425
|
+
*
|
|
426
|
+
* @example
|
|
427
|
+
* ```ts
|
|
428
|
+
* import { element } from '@wix/editor';
|
|
429
|
+
*
|
|
430
|
+
* const states = await element.getStateDefinitions();
|
|
431
|
+
* ```
|
|
432
|
+
*/
|
|
210
433
|
getStateDefinitions(): Promise<ElementStateDefinitions>;
|
|
211
434
|
/**
|
|
212
|
-
*
|
|
213
|
-
*
|
|
435
|
+
* Subscribes to changes on the component. The callback is invoked whenever
|
|
436
|
+
* styles, data, state, preset, props, or manifest values change.
|
|
437
|
+
*
|
|
438
|
+
* @param callback - Callback that receives a patch with `type` and `value`.
|
|
439
|
+
* @returns Unsubscribe method.
|
|
440
|
+
*
|
|
441
|
+
* @example
|
|
442
|
+
* ```ts
|
|
443
|
+
* import { element } from '@wix/editor';
|
|
444
|
+
*
|
|
445
|
+
* const unsubscribe = await element.onChange((patch) => {
|
|
446
|
+
* if (patch.type === 'data') {
|
|
447
|
+
* console.log('Data changed:', patch.value);
|
|
448
|
+
* }
|
|
449
|
+
* });
|
|
450
|
+
*
|
|
451
|
+
* unsubscribe();
|
|
452
|
+
* ```
|
|
214
453
|
*/
|
|
215
|
-
onChange(
|
|
454
|
+
onChange(callback: (patch: {
|
|
216
455
|
type: 'styles' | 'data' | 'state' | 'preset' | 'props' | 'manifest';
|
|
217
456
|
value: unknown;
|
|
218
457
|
}) => void): Promise<() => {}>;
|
|
458
|
+
/**
|
|
459
|
+
* Opens the font picker for selecting a font family and weight.
|
|
460
|
+
*
|
|
461
|
+
* Pass `styleItemKey` to bind the picker to a manifest style item,
|
|
462
|
+
* or pass manual options to handle the selection via callbacks.
|
|
463
|
+
*
|
|
464
|
+
* @param params - `styleItemKey` for manifest binding, or manual picker options.
|
|
465
|
+
* @returns Selected font family and weight, or `undefined` if dismissed.
|
|
466
|
+
*
|
|
467
|
+
* @example
|
|
468
|
+
* ```ts
|
|
469
|
+
* import { element } from '@wix/editor';
|
|
470
|
+
*
|
|
471
|
+
* const font = await element.selectFont({ styleItemKey: 'headingFont' });
|
|
472
|
+
*
|
|
473
|
+
* const font = await element.selectFont({
|
|
474
|
+
* selectedFontFamily: { family: 'Arial', weight: '400' },
|
|
475
|
+
* onChange: (value) => console.log('Selected:', value),
|
|
476
|
+
* });
|
|
477
|
+
* ```
|
|
478
|
+
*/
|
|
219
479
|
selectFont(params: {
|
|
220
480
|
styleItemKey: string;
|
|
221
481
|
} | {
|
|
@@ -225,6 +485,26 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
225
485
|
onChange?: (value: IFontFamilyAndWeight) => void;
|
|
226
486
|
onPreview?: (value: IFontFamilyAndWeight) => void;
|
|
227
487
|
}): Promise<any>;
|
|
488
|
+
/**
|
|
489
|
+
* Opens the font family picker for selecting a font family without
|
|
490
|
+
* weight options. Works the same as {@link selectFont} but without
|
|
491
|
+
* the weight selector.
|
|
492
|
+
*
|
|
493
|
+
* @param params - `styleItemKey` for manifest binding, or manual picker options.
|
|
494
|
+
* @returns Selected font family, or `undefined` if dismissed.
|
|
495
|
+
*
|
|
496
|
+
* @example
|
|
497
|
+
* ```ts
|
|
498
|
+
* import { element } from '@wix/editor';
|
|
499
|
+
*
|
|
500
|
+
* const font = await element.selectFontFamily({ styleItemKey: 'bodyFont' });
|
|
501
|
+
*
|
|
502
|
+
* const font = await element.selectFontFamily({
|
|
503
|
+
* selectedFontFamily: { family: 'Helvetica', weight: '400' },
|
|
504
|
+
* onChange: (value) => console.log('Selected:', value.family),
|
|
505
|
+
* });
|
|
506
|
+
* ```
|
|
507
|
+
*/
|
|
228
508
|
selectFontFamily(params: {
|
|
229
509
|
styleItemKey: string;
|
|
230
510
|
} | {
|
|
@@ -234,12 +514,55 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
234
514
|
onChange?: (value: IFontFamily) => void;
|
|
235
515
|
onPreview?: (value: IFontFamily) => void;
|
|
236
516
|
}): Promise<any>;
|
|
517
|
+
/**
|
|
518
|
+
* Opens the media picker for selecting images, videos, or other media
|
|
519
|
+
* from the Wix Media Manager.
|
|
520
|
+
*
|
|
521
|
+
* Pass `dataItemKey` to bind the picker to a manifest data item,
|
|
522
|
+
* or pass manual options to configure the picker.
|
|
523
|
+
*
|
|
524
|
+
* @param params - `dataItemKey` for manifest binding, or manual picker options.
|
|
525
|
+
* @returns Selected media items.
|
|
526
|
+
*
|
|
527
|
+
* @example
|
|
528
|
+
* ```ts
|
|
529
|
+
* import { element } from '@wix/editor';
|
|
530
|
+
*
|
|
531
|
+
* const media = await element.selectMedia({ dataItemKey: 'heroImage' });
|
|
532
|
+
*
|
|
533
|
+
* const media = await element.selectMedia({
|
|
534
|
+
* isMultiSelect: true,
|
|
535
|
+
* category: 'image',
|
|
536
|
+
* });
|
|
537
|
+
* ```
|
|
538
|
+
*/
|
|
237
539
|
selectMedia(params: {
|
|
238
540
|
dataItemKey: string;
|
|
239
541
|
} | {
|
|
240
542
|
isMultiSelect?: boolean;
|
|
241
543
|
category?: string;
|
|
242
544
|
}): Promise<any>;
|
|
545
|
+
/**
|
|
546
|
+
* Opens the link picker for creating or editing a link.
|
|
547
|
+
*
|
|
548
|
+
* Pass `dataItemKey` to bind the picker to a manifest data item,
|
|
549
|
+
* or pass a `value` and optional `linkTypes` to configure manually.
|
|
550
|
+
*
|
|
551
|
+
* @param params - `dataItemKey` for manifest binding, or manual picker options.
|
|
552
|
+
* @returns Selected link, or `null`/`undefined` if dismissed.
|
|
553
|
+
*
|
|
554
|
+
* @example
|
|
555
|
+
* ```ts
|
|
556
|
+
* import { element } from '@wix/editor';
|
|
557
|
+
*
|
|
558
|
+
* const link = await element.selectLink({ dataItemKey: 'buttonLink' });
|
|
559
|
+
*
|
|
560
|
+
* const link = await element.selectLink({
|
|
561
|
+
* value: currentLink,
|
|
562
|
+
* options: { linkTypes: ['ExternalLink', 'PageLink'] },
|
|
563
|
+
* });
|
|
564
|
+
* ```
|
|
565
|
+
*/
|
|
243
566
|
selectLink(params: {
|
|
244
567
|
dataItemKey: string;
|
|
245
568
|
options?: ISelectLinkSharedOptions;
|
|
@@ -249,6 +572,30 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
249
572
|
linkTypes?: string[];
|
|
250
573
|
};
|
|
251
574
|
}): Promise<ElementLink | null | undefined>;
|
|
575
|
+
/**
|
|
576
|
+
* Opens the color picker for selecting a color.
|
|
577
|
+
*
|
|
578
|
+
* Pass `styleItemKey` to bind the picker to a manifest style item,
|
|
579
|
+
* or pass manual options to configure the picker.
|
|
580
|
+
*
|
|
581
|
+
* @param params - `styleItemKey` for manifest binding, or manual picker options.
|
|
582
|
+
* @returns Selected color value, or `undefined` if dismissed.
|
|
583
|
+
*
|
|
584
|
+
* @example
|
|
585
|
+
* ```ts
|
|
586
|
+
* import { element } from '@wix/editor';
|
|
587
|
+
*
|
|
588
|
+
* const color = await element.selectColor({ styleItemKey: 'backgroundColor' });
|
|
589
|
+
*
|
|
590
|
+
* const color = await element.selectColor({
|
|
591
|
+
* initialValue: '#ff0000',
|
|
592
|
+
* mode: ['solid', 'gradient'],
|
|
593
|
+
* showOpacity: true,
|
|
594
|
+
* onChange: (color) => console.log('Preview:', color),
|
|
595
|
+
* onApply: (color) => console.log('Applied:', color),
|
|
596
|
+
* });
|
|
597
|
+
* ```
|
|
598
|
+
*/
|
|
252
599
|
selectColor(params: {
|
|
253
600
|
styleItemKey: string;
|
|
254
601
|
} | {
|
|
@@ -270,7 +617,49 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
270
617
|
onClose?: () => void;
|
|
271
618
|
onCancel?: () => void;
|
|
272
619
|
}): Promise<any>;
|
|
620
|
+
/**
|
|
621
|
+
* Opens the background picker for selecting a background fill
|
|
622
|
+
* (color, gradient, or image).
|
|
623
|
+
*
|
|
624
|
+
* @param options - Background picker configuration.
|
|
625
|
+
* @returns Selected background fill value.
|
|
626
|
+
*
|
|
627
|
+
* @example
|
|
628
|
+
* ```ts
|
|
629
|
+
* import { element } from '@wix/editor';
|
|
630
|
+
*
|
|
631
|
+
* const bg = await element.selectBackground({
|
|
632
|
+
* initialValue: { backgroundColor: '#fff', backgroundImage: '' },
|
|
633
|
+
* onChange: (value) => console.log('Preview:', value),
|
|
634
|
+
* });
|
|
635
|
+
* ```
|
|
636
|
+
*/
|
|
273
637
|
selectBackground(options: BackgroundPickerOptions): Promise<any>;
|
|
638
|
+
/**
|
|
639
|
+
* Opens the font weight picker for selecting a font weight for a specified
|
|
640
|
+
* font family.
|
|
641
|
+
*
|
|
642
|
+
* Pass manifest style item keys to bind the picker, or pass manual
|
|
643
|
+
* options to handle the selection via callbacks.
|
|
644
|
+
*
|
|
645
|
+
* @param params - Manifest style item keys, or manual picker options.
|
|
646
|
+
* @returns Selected font weight.
|
|
647
|
+
*
|
|
648
|
+
* @example
|
|
649
|
+
* ```ts
|
|
650
|
+
* import { element } from '@wix/editor';
|
|
651
|
+
*
|
|
652
|
+
* const weight = await element.selectFontWeight({
|
|
653
|
+
* fontFamilyStyleItemKey: 'headingFontFamily',
|
|
654
|
+
* fontWeightStyleItemKey: 'headingFontWeight',
|
|
655
|
+
* });
|
|
656
|
+
*
|
|
657
|
+
* const weight = await element.selectFontWeight({
|
|
658
|
+
* fontFamily: { family: 'Arial', weight: '400' },
|
|
659
|
+
* onChange: (value) => console.log('Selected weight:', value.weight),
|
|
660
|
+
* });
|
|
661
|
+
* ```
|
|
662
|
+
*/
|
|
274
663
|
selectFontWeight(params: {
|
|
275
664
|
fontFamilyStyleItemKey: string;
|
|
276
665
|
fontWeightStyleItemKey: string;
|
|
@@ -281,6 +670,24 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
281
670
|
target?: HTMLElement;
|
|
282
671
|
onChange?: (value: IFontWeight) => void;
|
|
283
672
|
}): Promise<IFontWeight>;
|
|
673
|
+
/**
|
|
674
|
+
* Opens the text theme picker for selecting a predefined text theme
|
|
675
|
+
* (a combination of font and color from the site's theme).
|
|
676
|
+
*
|
|
677
|
+
* @param params - Text theme picker configuration.
|
|
678
|
+
* @param params.target - HTML element to anchor the picker to.
|
|
679
|
+
* @param params.initialValue - Initial font and color values.
|
|
680
|
+
* @returns Selected text theme.
|
|
681
|
+
*
|
|
682
|
+
* @example
|
|
683
|
+
* ```ts
|
|
684
|
+
* import { element } from '@wix/editor';
|
|
685
|
+
*
|
|
686
|
+
* const theme = await element.selectTextTheme({
|
|
687
|
+
* initialValue: { font: 'Heading 1', color: '#333' },
|
|
688
|
+
* });
|
|
689
|
+
* ```
|
|
690
|
+
*/
|
|
284
691
|
selectTextTheme(params: {
|
|
285
692
|
target?: HTMLElement;
|
|
286
693
|
initialValue?: {
|
|
@@ -288,16 +695,68 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
288
695
|
color?: string;
|
|
289
696
|
};
|
|
290
697
|
}): Promise<any>;
|
|
698
|
+
/**
|
|
699
|
+
* Retrieves the currently selected index in an array items data group.
|
|
700
|
+
*
|
|
701
|
+
* @param options - Specify `arrayItemsDisplayGroupKey` if the component
|
|
702
|
+
* has multiple array item groups.
|
|
703
|
+
* @returns Index of the currently selected array item.
|
|
704
|
+
*
|
|
705
|
+
* @example
|
|
706
|
+
* ```ts
|
|
707
|
+
* import { element } from '@wix/editor';
|
|
708
|
+
*
|
|
709
|
+
* const index = await element.getArrayItemsSelectedIndex();
|
|
710
|
+
* ```
|
|
711
|
+
*/
|
|
291
712
|
getArrayItemsSelectedIndex(options?: {
|
|
292
713
|
arrayItemsDisplayGroupKey?: string;
|
|
293
714
|
}): Promise<any>;
|
|
715
|
+
/**
|
|
716
|
+
* Sets the selected index in an array items data group.
|
|
717
|
+
*
|
|
718
|
+
* @param options - Object containing the `index` to select, and optionally
|
|
719
|
+
* `arrayItemsDisplayGroupKey` if there are multiple array item groups.
|
|
720
|
+
*
|
|
721
|
+
* @example
|
|
722
|
+
* ```ts
|
|
723
|
+
* import { element } from '@wix/editor';
|
|
724
|
+
*
|
|
725
|
+
* await element.setArrayItemsSelectedIndex({ index: 2 });
|
|
726
|
+
* ```
|
|
727
|
+
*/
|
|
294
728
|
setArrayItemsSelectedIndex(options: {
|
|
295
729
|
index: number;
|
|
296
730
|
arrayItemsDisplayGroupKey?: string;
|
|
297
731
|
}): Promise<any>;
|
|
732
|
+
/**
|
|
733
|
+
* Resets the selected index in an array items data group to the default.
|
|
734
|
+
*
|
|
735
|
+
* @param options - Specify `arrayItemsDisplayGroupKey` if the component
|
|
736
|
+
* has multiple array item groups.
|
|
737
|
+
*
|
|
738
|
+
* @example
|
|
739
|
+
* ```ts
|
|
740
|
+
* import { element } from '@wix/editor';
|
|
741
|
+
*
|
|
742
|
+
* await element.resetArrayItemsSelectedIndex();
|
|
743
|
+
* ```
|
|
744
|
+
*/
|
|
298
745
|
resetArrayItemsSelectedIndex(options?: {
|
|
299
746
|
arrayItemsDisplayGroupKey?: string;
|
|
300
747
|
}): Promise<any>;
|
|
748
|
+
/**
|
|
749
|
+
* Retrieves the BI (Business Intelligence) token for the component.
|
|
750
|
+
*
|
|
751
|
+
* @returns BI token string.
|
|
752
|
+
*
|
|
753
|
+
* @example
|
|
754
|
+
* ```ts
|
|
755
|
+
* import { element } from '@wix/editor';
|
|
756
|
+
*
|
|
757
|
+
* const token = await element.getBiToken();
|
|
758
|
+
* ```
|
|
759
|
+
*/
|
|
301
760
|
getBiToken(): Promise<string>;
|
|
302
761
|
}
|
|
303
762
|
declare const _default$5: ElementSDKShape & _wix_sdk_types.HostModule<ElementSDKShape, _wix_sdk_types.Host>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/editor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.439.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Editor Platform <editor-platform-dev@wix.com>",
|
|
@@ -20,11 +20,12 @@
|
|
|
20
20
|
"unpkg": true,
|
|
21
21
|
"scripts": {
|
|
22
22
|
"start": "exit 0",
|
|
23
|
-
"build": "yarn typecheck && rollup -c",
|
|
23
|
+
"build": "yarn typecheck && rollup -c && yarn docs",
|
|
24
24
|
"test": "jest test",
|
|
25
25
|
"lint": "prettier --check ./src",
|
|
26
26
|
"lint:fix": "prettier --write ./src",
|
|
27
|
-
"typecheck": "tsc --noEmit"
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"docs": "docs-ts-model --entryPoint src/element/index.ts"
|
|
28
29
|
},
|
|
29
30
|
"lint-staged": {
|
|
30
31
|
"*.{js,ts}": "yarn lint"
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@rollup/plugin-node-resolve": "^15.3.1",
|
|
45
|
+
"@wix/docs-ts-model": "^1.54.0",
|
|
44
46
|
"@wix/editor-platform-host-integration-apis": "^1.0.0",
|
|
45
47
|
"esbuild": "^0.25.5",
|
|
46
48
|
"eslint": "^8.57.1",
|
|
@@ -55,7 +57,11 @@
|
|
|
55
57
|
"wix": {
|
|
56
58
|
"artifact": {
|
|
57
59
|
"groupId": "com.wixpress",
|
|
58
|
-
"artifactId": "editor-platform-sdk"
|
|
60
|
+
"artifactId": "editor-platform-sdk",
|
|
61
|
+
"targets": {
|
|
62
|
+
"static": true,
|
|
63
|
+
"build-docs": true
|
|
64
|
+
}
|
|
59
65
|
},
|
|
60
66
|
"validations": {
|
|
61
67
|
"postDependenciesBuild": [
|
|
@@ -63,5 +69,5 @@
|
|
|
63
69
|
]
|
|
64
70
|
}
|
|
65
71
|
},
|
|
66
|
-
"falconPackageHash": "
|
|
72
|
+
"falconPackageHash": "c6d3df8731765afd56fc97de9f4b297519474d9ec572f91f230f50af"
|
|
67
73
|
}
|