@wix/editor 1.505.0 → 1.506.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 +68 -68
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +68 -68
- package/dist/esm/index.js.map +1 -1
- package/dist/statics/docs-ts-model.json +211 -211
- package/dist/statics/index.js +68 -68
- package/dist/statics/index.js.map +1 -1
- package/dist/types/index.d.ts +72 -72
- package/package.json +2 -2
package/dist/types/index.d.ts
CHANGED
|
@@ -163,17 +163,17 @@ type IPanelOptions = {
|
|
|
163
163
|
/**
|
|
164
164
|
* Methods for interacting with a component from a custom panel.
|
|
165
165
|
*
|
|
166
|
-
* Import `
|
|
166
|
+
* Import `reactElements` from `@wix/editor` to read and update styles, data,
|
|
167
167
|
* presets, and states, and to open editor pickers.
|
|
168
168
|
*
|
|
169
169
|
* @example
|
|
170
170
|
* ```tsx
|
|
171
|
-
* import {
|
|
171
|
+
* import { reactElements } from '@wix/editor';
|
|
172
172
|
*
|
|
173
173
|
* export default function MyPanel() {
|
|
174
174
|
* const handleClick = async () => {
|
|
175
|
-
* const data = await
|
|
176
|
-
* await
|
|
175
|
+
* const data = await reactElements.getData();
|
|
176
|
+
* await reactElements.setData({ title: 'Updated!' });
|
|
177
177
|
* };
|
|
178
178
|
* return <button onClick={handleClick}>Update Title</button>;
|
|
179
179
|
* }
|
|
@@ -191,9 +191,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
191
191
|
*
|
|
192
192
|
* @example
|
|
193
193
|
* ```ts
|
|
194
|
-
* import {
|
|
194
|
+
* import { reactElements } from '@wix/editor';
|
|
195
195
|
*
|
|
196
|
-
* const defs = await
|
|
196
|
+
* const defs = await reactElements.getStyleDefinitions();
|
|
197
197
|
* ```
|
|
198
198
|
*/
|
|
199
199
|
getStyleDefinitions(): Promise<ElementStyleDefinitions>;
|
|
@@ -204,9 +204,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
204
204
|
*
|
|
205
205
|
* @example
|
|
206
206
|
* ```ts
|
|
207
|
-
* import {
|
|
207
|
+
* import { reactElements } from '@wix/editor';
|
|
208
208
|
*
|
|
209
|
-
* const styles = await
|
|
209
|
+
* const styles = await reactElements.getStyles();
|
|
210
210
|
* const bgColor = styles.cssProperties.backgroundColor;
|
|
211
211
|
* ```
|
|
212
212
|
*/
|
|
@@ -216,16 +216,16 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
216
216
|
*
|
|
217
217
|
* @example
|
|
218
218
|
* ```ts
|
|
219
|
-
* import {
|
|
219
|
+
* import { reactElements } from '@wix/editor';
|
|
220
220
|
* import { CssPropertyType } from '@wix/public-editor-platform-sdk';
|
|
221
221
|
*
|
|
222
222
|
* // Using enum (recommended):
|
|
223
|
-
* await
|
|
223
|
+
* await reactElements.setStyles({
|
|
224
224
|
* cssProperties: { [CssPropertyType.color]: '#fff' }
|
|
225
225
|
* });
|
|
226
226
|
*
|
|
227
227
|
* // Using string literal (also works):
|
|
228
|
-
* await
|
|
228
|
+
* await reactElements.setStyles({
|
|
229
229
|
* cssProperties: { 'color': '#fff' }
|
|
230
230
|
* });
|
|
231
231
|
* ```
|
|
@@ -236,16 +236,16 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
236
236
|
*
|
|
237
237
|
* @example
|
|
238
238
|
* ```ts
|
|
239
|
-
* import {
|
|
239
|
+
* import { reactElements } from '@wix/editor';
|
|
240
240
|
* import { CssPropertyType } from '@wix/public-editor-platform-sdk';
|
|
241
241
|
*
|
|
242
242
|
* // Using enum (recommended):
|
|
243
|
-
* await
|
|
243
|
+
* await reactElements.removeStyles({
|
|
244
244
|
* cssPropertiesKeys: [CssPropertyType.color]
|
|
245
245
|
* });
|
|
246
246
|
*
|
|
247
247
|
* // Using string literal (also works):
|
|
248
|
-
* await
|
|
248
|
+
* await reactElements.removeStyles({
|
|
249
249
|
* cssPropertiesKeys: ['color']
|
|
250
250
|
* });
|
|
251
251
|
* ```
|
|
@@ -258,9 +258,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
258
258
|
*
|
|
259
259
|
* @example
|
|
260
260
|
* ```ts
|
|
261
|
-
* import {
|
|
261
|
+
* import { reactElements } from '@wix/editor';
|
|
262
262
|
*
|
|
263
|
-
* const defs = await
|
|
263
|
+
* const defs = await reactElements.getDataDefinitions();
|
|
264
264
|
* ```
|
|
265
265
|
*/
|
|
266
266
|
getDataDefinitions(): Promise<ElementDataDefinitions>;
|
|
@@ -272,9 +272,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
272
272
|
*
|
|
273
273
|
* @example
|
|
274
274
|
* ```ts
|
|
275
|
-
* import {
|
|
275
|
+
* import { reactElements } from '@wix/editor';
|
|
276
276
|
*
|
|
277
|
-
* const data = await
|
|
277
|
+
* const data = await reactElements.getData();
|
|
278
278
|
* ```
|
|
279
279
|
*/
|
|
280
280
|
getData<T extends ElementData = ElementData>(): Promise<T>;
|
|
@@ -289,9 +289,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
289
289
|
*
|
|
290
290
|
* @example
|
|
291
291
|
* ```ts
|
|
292
|
-
* import {
|
|
292
|
+
* import { reactElements } from '@wix/editor';
|
|
293
293
|
*
|
|
294
|
-
* const resolved = await
|
|
294
|
+
* const resolved = await reactElements.getResolvedData({
|
|
295
295
|
* dataItemKey: 'heroImage',
|
|
296
296
|
* });
|
|
297
297
|
* ```
|
|
@@ -308,9 +308,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
308
308
|
*
|
|
309
309
|
* @example
|
|
310
310
|
* ```ts
|
|
311
|
-
* import {
|
|
311
|
+
* import { reactElements } from '@wix/editor';
|
|
312
312
|
*
|
|
313
|
-
* await
|
|
313
|
+
* await reactElements.setData({ title: 'New Title', showButton: false });
|
|
314
314
|
* ```
|
|
315
315
|
*/
|
|
316
316
|
setData<T extends ElementData = ElementData>(values: ElementDataInput<T>): Promise<void>;
|
|
@@ -321,9 +321,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
321
321
|
*
|
|
322
322
|
* @example
|
|
323
323
|
* ```ts
|
|
324
|
-
* import {
|
|
324
|
+
* import { reactElements } from '@wix/editor';
|
|
325
325
|
*
|
|
326
|
-
* const presets = await
|
|
326
|
+
* const presets = await reactElements.getPresetDefinitions();
|
|
327
327
|
* ```
|
|
328
328
|
*/
|
|
329
329
|
getPresetDefinitions(): Promise<ElementPresetDefinitions>;
|
|
@@ -334,9 +334,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
334
334
|
*
|
|
335
335
|
* @example
|
|
336
336
|
* ```ts
|
|
337
|
-
* import {
|
|
337
|
+
* import { reactElements } from '@wix/editor';
|
|
338
338
|
*
|
|
339
|
-
* const preset = await
|
|
339
|
+
* const preset = await reactElements.getAppliedPreset();
|
|
340
340
|
* ```
|
|
341
341
|
*/
|
|
342
342
|
getAppliedPreset(): Promise<any>;
|
|
@@ -348,9 +348,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
348
348
|
*
|
|
349
349
|
* @example
|
|
350
350
|
* ```ts
|
|
351
|
-
* import {
|
|
351
|
+
* import { reactElements } from '@wix/editor';
|
|
352
352
|
*
|
|
353
|
-
* await
|
|
353
|
+
* await reactElements.applyPreset({ key: 'minimal' });
|
|
354
354
|
* ```
|
|
355
355
|
*/
|
|
356
356
|
applyPreset(options: {
|
|
@@ -364,11 +364,11 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
364
364
|
*
|
|
365
365
|
* @example
|
|
366
366
|
* ```ts
|
|
367
|
-
* import {
|
|
367
|
+
* import { reactElements } from '@wix/editor';
|
|
368
368
|
*
|
|
369
|
-
* const groups = await
|
|
369
|
+
* const groups = await reactElements.getDisplayGroupDefinitions();
|
|
370
370
|
*
|
|
371
|
-
* const cssGroups = await
|
|
371
|
+
* const cssGroups = await reactElements.getDisplayGroupDefinitions({
|
|
372
372
|
* filter: { groupType: 'cssDataType' },
|
|
373
373
|
* });
|
|
374
374
|
* ```
|
|
@@ -385,9 +385,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
385
385
|
*
|
|
386
386
|
* @example
|
|
387
387
|
* ```ts
|
|
388
|
-
* import {
|
|
388
|
+
* import { reactElements } from '@wix/editor';
|
|
389
389
|
*
|
|
390
|
-
* const name = await
|
|
390
|
+
* const name = await reactElements.getDisplayName();
|
|
391
391
|
* ```
|
|
392
392
|
*/
|
|
393
393
|
getDisplayName(): Promise<any>;
|
|
@@ -398,9 +398,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
398
398
|
*
|
|
399
399
|
* @example
|
|
400
400
|
* ```ts
|
|
401
|
-
* import {
|
|
401
|
+
* import { reactElements } from '@wix/editor';
|
|
402
402
|
*
|
|
403
|
-
* const state = await
|
|
403
|
+
* const state = await reactElements.getState();
|
|
404
404
|
* ```
|
|
405
405
|
*/
|
|
406
406
|
getState(): Promise<any>;
|
|
@@ -412,11 +412,11 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
412
412
|
*
|
|
413
413
|
* @example
|
|
414
414
|
* ```ts
|
|
415
|
-
* import {
|
|
415
|
+
* import { reactElements } from '@wix/editor';
|
|
416
416
|
*
|
|
417
|
-
* await
|
|
417
|
+
* await reactElements.setState('hover');
|
|
418
418
|
*
|
|
419
|
-
* await
|
|
419
|
+
* await reactElements.setState(null);
|
|
420
420
|
* ```
|
|
421
421
|
*/
|
|
422
422
|
setState(stateKey: string | null): Promise<any>;
|
|
@@ -427,9 +427,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
427
427
|
*
|
|
428
428
|
* @example
|
|
429
429
|
* ```ts
|
|
430
|
-
* import {
|
|
430
|
+
* import { reactElements } from '@wix/editor';
|
|
431
431
|
*
|
|
432
|
-
* const states = await
|
|
432
|
+
* const states = await reactElements.getStateDefinitions();
|
|
433
433
|
* ```
|
|
434
434
|
*/
|
|
435
435
|
getStateDefinitions(): Promise<ElementStateDefinitions>;
|
|
@@ -442,9 +442,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
442
442
|
*
|
|
443
443
|
* @example
|
|
444
444
|
* ```ts
|
|
445
|
-
* import {
|
|
445
|
+
* import { reactElements } from '@wix/editor';
|
|
446
446
|
*
|
|
447
|
-
* const unsubscribe = await
|
|
447
|
+
* const unsubscribe = await reactElements.onChange((patch) => {
|
|
448
448
|
* if (patch.type === 'data') {
|
|
449
449
|
* console.log('Data changed:', patch.value);
|
|
450
450
|
* }
|
|
@@ -468,11 +468,11 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
468
468
|
*
|
|
469
469
|
* @example
|
|
470
470
|
* ```ts
|
|
471
|
-
* import {
|
|
471
|
+
* import { reactElements } from '@wix/editor';
|
|
472
472
|
*
|
|
473
|
-
* const font = await
|
|
473
|
+
* const font = await reactElements.selectFont({ styleItemKey: 'headingFont' });
|
|
474
474
|
*
|
|
475
|
-
* const font = await
|
|
475
|
+
* const font = await reactElements.selectFont({
|
|
476
476
|
* selectedFontFamily: { family: 'Arial', weight: '400' },
|
|
477
477
|
* onChange: (value) => console.log('Selected:', value),
|
|
478
478
|
* });
|
|
@@ -497,11 +497,11 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
497
497
|
*
|
|
498
498
|
* @example
|
|
499
499
|
* ```ts
|
|
500
|
-
* import {
|
|
500
|
+
* import { reactElements } from '@wix/editor';
|
|
501
501
|
*
|
|
502
|
-
* const font = await
|
|
502
|
+
* const font = await reactElements.selectFontFamily({ styleItemKey: 'bodyFont' });
|
|
503
503
|
*
|
|
504
|
-
* const font = await
|
|
504
|
+
* const font = await reactElements.selectFontFamily({
|
|
505
505
|
* selectedFontFamily: { family: 'Helvetica', weight: '400' },
|
|
506
506
|
* onChange: (value) => console.log('Selected:', value.family),
|
|
507
507
|
* });
|
|
@@ -528,11 +528,11 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
528
528
|
*
|
|
529
529
|
* @example
|
|
530
530
|
* ```ts
|
|
531
|
-
* import {
|
|
531
|
+
* import { reactElements } from '@wix/editor';
|
|
532
532
|
*
|
|
533
|
-
* const media = await
|
|
533
|
+
* const media = await reactElements.selectMedia({ dataItemKey: 'heroImage' });
|
|
534
534
|
*
|
|
535
|
-
* const media = await
|
|
535
|
+
* const media = await reactElements.selectMedia({
|
|
536
536
|
* isMultiSelect: true,
|
|
537
537
|
* category: 'image',
|
|
538
538
|
* });
|
|
@@ -555,11 +555,11 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
555
555
|
*
|
|
556
556
|
* @example
|
|
557
557
|
* ```ts
|
|
558
|
-
* import {
|
|
558
|
+
* import { reactElements } from '@wix/editor';
|
|
559
559
|
*
|
|
560
|
-
* const link = await
|
|
560
|
+
* const link = await reactElements.selectLink({ dataItemKey: 'buttonLink' });
|
|
561
561
|
*
|
|
562
|
-
* const link = await
|
|
562
|
+
* const link = await reactElements.selectLink({
|
|
563
563
|
* value: currentLink,
|
|
564
564
|
* options: { linkTypes: ['ExternalLink', 'PageLink'] },
|
|
565
565
|
* });
|
|
@@ -585,11 +585,11 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
585
585
|
*
|
|
586
586
|
* @example
|
|
587
587
|
* ```ts
|
|
588
|
-
* import {
|
|
588
|
+
* import { reactElements } from '@wix/editor';
|
|
589
589
|
*
|
|
590
|
-
* const color = await
|
|
590
|
+
* const color = await reactElements.selectColor({ styleItemKey: 'backgroundColor' });
|
|
591
591
|
*
|
|
592
|
-
* const color = await
|
|
592
|
+
* const color = await reactElements.selectColor({
|
|
593
593
|
* initialValue: '#ff0000',
|
|
594
594
|
* mode: ['solid', 'gradient'],
|
|
595
595
|
* showOpacity: true,
|
|
@@ -628,9 +628,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
628
628
|
*
|
|
629
629
|
* @example
|
|
630
630
|
* ```ts
|
|
631
|
-
* import {
|
|
631
|
+
* import { reactElements } from '@wix/editor';
|
|
632
632
|
*
|
|
633
|
-
* const bg = await
|
|
633
|
+
* const bg = await reactElements.selectBackground({
|
|
634
634
|
* initialValue: { backgroundColor: '#fff', backgroundImage: '' },
|
|
635
635
|
* onChange: (value) => console.log('Preview:', value),
|
|
636
636
|
* });
|
|
@@ -649,14 +649,14 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
649
649
|
*
|
|
650
650
|
* @example
|
|
651
651
|
* ```ts
|
|
652
|
-
* import {
|
|
652
|
+
* import { reactElements } from '@wix/editor';
|
|
653
653
|
*
|
|
654
|
-
* const weight = await
|
|
654
|
+
* const weight = await reactElements.selectFontWeight({
|
|
655
655
|
* fontFamilyStyleItemKey: 'headingFontFamily',
|
|
656
656
|
* fontWeightStyleItemKey: 'headingFontWeight',
|
|
657
657
|
* });
|
|
658
658
|
*
|
|
659
|
-
* const weight = await
|
|
659
|
+
* const weight = await reactElements.selectFontWeight({
|
|
660
660
|
* fontFamily: { family: 'Arial', weight: '400' },
|
|
661
661
|
* onChange: (value) => console.log('Selected weight:', value.weight),
|
|
662
662
|
* });
|
|
@@ -683,9 +683,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
683
683
|
*
|
|
684
684
|
* @example
|
|
685
685
|
* ```ts
|
|
686
|
-
* import {
|
|
686
|
+
* import { reactElements } from '@wix/editor';
|
|
687
687
|
*
|
|
688
|
-
* const theme = await
|
|
688
|
+
* const theme = await reactElements.selectTextTheme({
|
|
689
689
|
* initialValue: { font: 'Heading 1', color: '#333' },
|
|
690
690
|
* });
|
|
691
691
|
* ```
|
|
@@ -706,9 +706,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
706
706
|
*
|
|
707
707
|
* @example
|
|
708
708
|
* ```ts
|
|
709
|
-
* import {
|
|
709
|
+
* import { reactElements } from '@wix/editor';
|
|
710
710
|
*
|
|
711
|
-
* const index = await
|
|
711
|
+
* const index = await reactElements.getArrayItemsSelectedIndex();
|
|
712
712
|
* ```
|
|
713
713
|
*/
|
|
714
714
|
getArrayItemsSelectedIndex(options?: {
|
|
@@ -722,9 +722,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
722
722
|
*
|
|
723
723
|
* @example
|
|
724
724
|
* ```ts
|
|
725
|
-
* import {
|
|
725
|
+
* import { reactElements } from '@wix/editor';
|
|
726
726
|
*
|
|
727
|
-
* await
|
|
727
|
+
* await reactElements.setArrayItemsSelectedIndex({ index: 2 });
|
|
728
728
|
* ```
|
|
729
729
|
*/
|
|
730
730
|
setArrayItemsSelectedIndex(options: {
|
|
@@ -739,9 +739,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
739
739
|
*
|
|
740
740
|
* @example
|
|
741
741
|
* ```ts
|
|
742
|
-
* import {
|
|
742
|
+
* import { reactElements } from '@wix/editor';
|
|
743
743
|
*
|
|
744
|
-
* await
|
|
744
|
+
* await reactElements.resetArrayItemsSelectedIndex();
|
|
745
745
|
* ```
|
|
746
746
|
*/
|
|
747
747
|
resetArrayItemsSelectedIndex(options?: {
|
|
@@ -754,9 +754,9 @@ declare class ElementSDKShape extends BaseSDKShape {
|
|
|
754
754
|
*
|
|
755
755
|
* @example
|
|
756
756
|
* ```ts
|
|
757
|
-
* import {
|
|
757
|
+
* import { reactElements } from '@wix/editor';
|
|
758
758
|
*
|
|
759
|
-
* const token = await
|
|
759
|
+
* const token = await reactElements.getBiToken();
|
|
760
760
|
* ```
|
|
761
761
|
*/
|
|
762
762
|
getBiToken(): Promise<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/editor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.506.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Editor Platform <editor-platform-dev@wix.com>",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
]
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
-
"falconPackageHash": "
|
|
72
|
+
"falconPackageHash": "fd98ff7e35a5ba2c1f8e8c2908513bb37f9b054c41b16114a6d6e68c"
|
|
73
73
|
}
|