@wix/react-component-schema 1.5.0 → 1.7.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/index.d.ts +240 -0
- package/dist/index.js +8 -0
- package/package.json +3 -2
- package/src/__snapshots__/index.test.ts.snap +248 -0
- package/src/index.ts +13 -0
- package/vite.config.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -259,6 +259,35 @@ declare interface BreakpointPresetStyleOverrides {
|
|
|
259
259
|
small?: PresetStyleOverrides;
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
+
declare interface ClientResources {
|
|
263
|
+
/**
|
|
264
|
+
* A URL to an ESM javascript bundle. It's default export should be the component
|
|
265
|
+
* @format WEB_URL
|
|
266
|
+
*/
|
|
267
|
+
componentUrl?: string;
|
|
268
|
+
/**
|
|
269
|
+
* A URL to the CSS file that is the default layout and style for the component
|
|
270
|
+
* @format WEB_URL
|
|
271
|
+
*/
|
|
272
|
+
cssUrl?: string | null;
|
|
273
|
+
/**
|
|
274
|
+
* A list of service dependencies required by the component, example: ['@wix/environment']
|
|
275
|
+
* @maxLength 80
|
|
276
|
+
* @maxSize 20
|
|
277
|
+
* @deprecated A list of service dependencies required by the component, example: ['@wix/environment']
|
|
278
|
+
* @replacedBy dependencies
|
|
279
|
+
* @targetRemovalDate 2025-12-30
|
|
280
|
+
*/
|
|
281
|
+
serviceDependencies?: string[];
|
|
282
|
+
/**
|
|
283
|
+
* A module specifier for the component’s react code.
|
|
284
|
+
* @maxLength 100
|
|
285
|
+
*/
|
|
286
|
+
moduleSpecifier?: string | null;
|
|
287
|
+
/** Dependencies on services and contexts */
|
|
288
|
+
dependencies?: EditorDependencies;
|
|
289
|
+
}
|
|
290
|
+
|
|
262
291
|
/** Represents the information needed for code panels */
|
|
263
292
|
declare interface CodePanel {
|
|
264
293
|
/**
|
|
@@ -1298,6 +1327,30 @@ declare enum DataType {
|
|
|
1298
1327
|
onSubmit = "onSubmit"
|
|
1299
1328
|
}
|
|
1300
1329
|
|
|
1330
|
+
declare interface DefaultPresets {
|
|
1331
|
+
/**
|
|
1332
|
+
* Default preset ID in small (mobile) breakpoint
|
|
1333
|
+
* @minLength 1
|
|
1334
|
+
* @maxLength 50
|
|
1335
|
+
*/
|
|
1336
|
+
small?: string | null;
|
|
1337
|
+
/**
|
|
1338
|
+
* Deprecated, use default - Default preset ID in large (desktop) breakpoint
|
|
1339
|
+
* @minLength 1
|
|
1340
|
+
* @maxLength 50
|
|
1341
|
+
* @deprecated Deprecated, use default - Default preset ID in large (desktop) breakpoint
|
|
1342
|
+
* @replacedBy default
|
|
1343
|
+
* @targetRemovalDate 2025-12-02
|
|
1344
|
+
*/
|
|
1345
|
+
large?: string | null;
|
|
1346
|
+
/**
|
|
1347
|
+
* Default preset ID
|
|
1348
|
+
* @minLength 1
|
|
1349
|
+
* @maxLength 50
|
|
1350
|
+
*/
|
|
1351
|
+
default?: string | null;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1301
1354
|
export declare interface Display {
|
|
1302
1355
|
/**
|
|
1303
1356
|
* list of display values in case we want to reduce the abilities exposed to the User
|
|
@@ -1516,6 +1569,37 @@ declare enum DisplayValueEnumDisplayValue {
|
|
|
1516
1569
|
listItem = "listItem"
|
|
1517
1570
|
}
|
|
1518
1571
|
|
|
1572
|
+
export declare const DOM_EVENT: {
|
|
1573
|
+
readonly POINTER: "POINTER";
|
|
1574
|
+
readonly CHANGE: "CHANGE";
|
|
1575
|
+
readonly FOCUS: "FOCUS";
|
|
1576
|
+
readonly SUBMIT: "SUBMIT";
|
|
1577
|
+
readonly KEYBOARD: "KEYBOARD";
|
|
1578
|
+
};
|
|
1579
|
+
|
|
1580
|
+
export declare type DomEvent = (typeof DOM_EVENT)[keyof typeof DOM_EVENT];
|
|
1581
|
+
|
|
1582
|
+
declare interface EditorDependencies {
|
|
1583
|
+
/**
|
|
1584
|
+
* A list of service dependencies required by the component, example: ['@wix/environment']
|
|
1585
|
+
* @maxLength 80
|
|
1586
|
+
* @maxSize 20
|
|
1587
|
+
*/
|
|
1588
|
+
serviceDependencies?: string[];
|
|
1589
|
+
/**
|
|
1590
|
+
* Dependencies on context providers in order to work
|
|
1591
|
+
* @maxLength 80
|
|
1592
|
+
* @maxSize 20
|
|
1593
|
+
*/
|
|
1594
|
+
contextDependencies?: string[];
|
|
1595
|
+
/**
|
|
1596
|
+
* Dependencies on components that we want as externals in our bundle, example: wixEditorElements.AppWidget
|
|
1597
|
+
* @maxLength 80
|
|
1598
|
+
* @maxSize 20
|
|
1599
|
+
*/
|
|
1600
|
+
componentDependencies?: string[];
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1519
1603
|
export declare type EditorElement = EditorElement_2 & RequiredFields<EditorElement_2, 'selector' | 'displayName'> & {
|
|
1520
1604
|
presets?: Record<string, PresetItem>;
|
|
1521
1605
|
};
|
|
@@ -1606,6 +1690,41 @@ declare interface EditorFunction {
|
|
|
1606
1690
|
/* Excluded from this release type: deprecated */
|
|
1607
1691
|
}
|
|
1608
1692
|
|
|
1693
|
+
/** The full model for an imported component set in DEV Center */
|
|
1694
|
+
export declare interface EditorReactComponent {
|
|
1695
|
+
/**
|
|
1696
|
+
* The type of component to present in the Page tree, will be prefixed with AppSlug
|
|
1697
|
+
* @maxLength 100
|
|
1698
|
+
* @minLength 1
|
|
1699
|
+
*/
|
|
1700
|
+
type?: string;
|
|
1701
|
+
/**
|
|
1702
|
+
* The public description of the component do display
|
|
1703
|
+
* @maxLength 300
|
|
1704
|
+
* @minLength 3
|
|
1705
|
+
*/
|
|
1706
|
+
description?: string;
|
|
1707
|
+
/** List of component resources. This comprises any runtime code we need to load and execute for the component. */
|
|
1708
|
+
resources?: Resources;
|
|
1709
|
+
/** The configuration describing the component abilities and behaviors on the Editor stage */
|
|
1710
|
+
editorElement?: EditorElement_2;
|
|
1711
|
+
/** The installation settings of the component */
|
|
1712
|
+
installation?: InstallationInfo;
|
|
1713
|
+
/** Module configuration for NPM-based component */
|
|
1714
|
+
moduleConfiguration?: EditorReactComponentModuleConfiguration;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
declare interface EditorReactComponentModuleConfiguration {
|
|
1718
|
+
/** Public NPM package details */
|
|
1719
|
+
package?: NPMPackage;
|
|
1720
|
+
/** The component export details */
|
|
1721
|
+
component?: NPMPackageEntry;
|
|
1722
|
+
/** The component CSS File location */
|
|
1723
|
+
cssFile?: NPMPackageEntry;
|
|
1724
|
+
/** The component SSR version export details */
|
|
1725
|
+
server?: NPMPackageEntry;
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1609
1728
|
declare enum EffectGroup {
|
|
1610
1729
|
UNKNOWN_EFFECT_GROUP = "UNKNOWN_EFFECT_GROUP",
|
|
1611
1730
|
/** Effects that are applied to the background layer of the component */
|
|
@@ -1796,6 +1915,14 @@ declare enum FilterFunction {
|
|
|
1796
1915
|
hueRotate = "hueRotate"
|
|
1797
1916
|
}
|
|
1798
1917
|
|
|
1918
|
+
/** Fixed position builder for component installation */
|
|
1919
|
+
declare interface FixedPositionBuilder {
|
|
1920
|
+
/** Vertical position in the browser window */
|
|
1921
|
+
vertical?: Vertical;
|
|
1922
|
+
/** Horizontal position in the browser window */
|
|
1923
|
+
horizontal?: Horizontal;
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1799
1926
|
export declare interface Font {
|
|
1800
1927
|
/**
|
|
1801
1928
|
* Stores the font-style property of the font shorthand
|
|
@@ -2028,6 +2155,13 @@ declare interface HelpArticleArticleTypeOneOf {
|
|
|
2028
2155
|
url?: string | null;
|
|
2029
2156
|
}
|
|
2030
2157
|
|
|
2158
|
+
declare enum Horizontal {
|
|
2159
|
+
NONE = "NONE",
|
|
2160
|
+
LEFT = "LEFT",
|
|
2161
|
+
CENTER = "CENTER",
|
|
2162
|
+
RIGHT = "RIGHT"
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2031
2165
|
export declare interface Image {
|
|
2032
2166
|
/** media manager categories to open media manager filtered by the component needs */
|
|
2033
2167
|
category?: ImageCategoryTypes;
|
|
@@ -2124,6 +2258,23 @@ export declare interface InlineElement {
|
|
|
2124
2258
|
helpArticle?: HelpArticle;
|
|
2125
2259
|
}
|
|
2126
2260
|
|
|
2261
|
+
declare interface InstallationInfo extends InstallationInfoTargetContainerOneOf {
|
|
2262
|
+
/** Which static container should the component be installed at */
|
|
2263
|
+
staticContainer?: StaticContainer;
|
|
2264
|
+
/** Default presets per breakpoint with which the component should be installed */
|
|
2265
|
+
presets?: DefaultPresets;
|
|
2266
|
+
/** Initial size with which the component should be added to the stage */
|
|
2267
|
+
initialSize?: ComponentInitialSize;
|
|
2268
|
+
/** Fixed position options for the component. If set, the component will be pinned to the specified position, and can't be unpinned */
|
|
2269
|
+
fixedPosition?: FixedPositionBuilder;
|
|
2270
|
+
}
|
|
2271
|
+
|
|
2272
|
+
/** @oneof */
|
|
2273
|
+
declare interface InstallationInfoTargetContainerOneOf {
|
|
2274
|
+
/** Which static container should the component be installed at */
|
|
2275
|
+
staticContainer?: StaticContainer;
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2127
2278
|
export declare const INTERACTIONS: {
|
|
2128
2279
|
TRIGGER_TYPE: typeof InteractionsTrigger;
|
|
2129
2280
|
EFFECT_GROUP: typeof EffectGroup;
|
|
@@ -2270,6 +2421,34 @@ export declare enum NATIVE_STATE_TYPE {
|
|
|
2270
2421
|
invalid = "invalid"
|
|
2271
2422
|
}
|
|
2272
2423
|
|
|
2424
|
+
declare interface NPMPackage {
|
|
2425
|
+
/**
|
|
2426
|
+
* The npm package name
|
|
2427
|
+
* @minLength 1
|
|
2428
|
+
* @maxLength 214
|
|
2429
|
+
*/
|
|
2430
|
+
name?: string;
|
|
2431
|
+
/**
|
|
2432
|
+
* the SEMVER package version
|
|
2433
|
+
* @minLength 1
|
|
2434
|
+
* @maxLength 214
|
|
2435
|
+
*/
|
|
2436
|
+
version?: string;
|
|
2437
|
+
}
|
|
2438
|
+
|
|
2439
|
+
declare interface NPMPackageEntry {
|
|
2440
|
+
/**
|
|
2441
|
+
* optional path to file in package
|
|
2442
|
+
* @maxLength 200
|
|
2443
|
+
*/
|
|
2444
|
+
path?: string | null;
|
|
2445
|
+
/**
|
|
2446
|
+
* The named export key to import. If empty, the default export is used.
|
|
2447
|
+
* @maxLength 200
|
|
2448
|
+
*/
|
|
2449
|
+
exportKey?: string | null;
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2273
2452
|
export declare enum OverrideType {
|
|
2274
2453
|
UNKNOWN = "UNKNOWN",
|
|
2275
2454
|
DEV = "DEV",
|
|
@@ -2621,6 +2800,38 @@ declare enum ResizeDirection {
|
|
|
2621
2800
|
none = "none"
|
|
2622
2801
|
}
|
|
2623
2802
|
|
|
2803
|
+
declare interface Resource {
|
|
2804
|
+
/**
|
|
2805
|
+
* A URL to an ESM javascript bundle
|
|
2806
|
+
* @format WEB_URL
|
|
2807
|
+
*/
|
|
2808
|
+
url?: string;
|
|
2809
|
+
}
|
|
2810
|
+
|
|
2811
|
+
declare interface Resources {
|
|
2812
|
+
/** The bundle we will load and render in the browser in the site */
|
|
2813
|
+
client?: ClientResources;
|
|
2814
|
+
/**
|
|
2815
|
+
* An optional client definition of the component we will load and render in the editor, *it replaces the client bundle.*
|
|
2816
|
+
* The main use case is to control the live site component and enable different experiences in the editor.
|
|
2817
|
+
* For example, supporting `states` manipulation:
|
|
2818
|
+
* Show calendar in the editor
|
|
2819
|
+
* Open drop down in the editor
|
|
2820
|
+
*/
|
|
2821
|
+
editor?: ClientResources;
|
|
2822
|
+
/** The bundle for SSR, should not include any DOM API references */
|
|
2823
|
+
server?: Resource;
|
|
2824
|
+
/** The optional component SDK to expose to Velo Users to interact with the component */
|
|
2825
|
+
sdk?: Resource;
|
|
2826
|
+
/** Details for how to load translations for the component */
|
|
2827
|
+
translations?: TranslationResources;
|
|
2828
|
+
/** The optional interactions configuration JSON file */
|
|
2829
|
+
interactions?: Resource;
|
|
2830
|
+
/* Excluded from this release type: viewerReducedModel */
|
|
2831
|
+
/* Excluded from this release type: schemaRefsUrl */
|
|
2832
|
+
/* Excluded from this release type: viewerRuntimeCss */
|
|
2833
|
+
}
|
|
2834
|
+
|
|
2624
2835
|
/** rich text data type allow manipulation of text with html & inline styles */
|
|
2625
2836
|
declare interface RichText {
|
|
2626
2837
|
/**
|
|
@@ -2758,6 +2969,14 @@ declare enum SizingType {
|
|
|
2758
2969
|
|
|
2759
2970
|
export declare type States = NonNullable<EditorElement_2['states']>;
|
|
2760
2971
|
|
|
2972
|
+
declare enum StaticContainer {
|
|
2973
|
+
UNKNOWN_CONTAINER = "UNKNOWN_CONTAINER",
|
|
2974
|
+
/** Widget should be installed in the homepage */
|
|
2975
|
+
HOMEPAGE = "HOMEPAGE",
|
|
2976
|
+
/** Show widget on all pages */
|
|
2977
|
+
GLOBAL_PAGE = "GLOBAL_PAGE"
|
|
2978
|
+
}
|
|
2979
|
+
|
|
2761
2980
|
/** DEPRECATED - use CssPropertyAction or CssCustomPropertyAction */
|
|
2762
2981
|
declare interface StyleAction {
|
|
2763
2982
|
/**
|
|
@@ -3185,6 +3404,20 @@ export declare interface TextGroup {
|
|
|
3185
3404
|
a11y?: string | null;
|
|
3186
3405
|
}
|
|
3187
3406
|
|
|
3407
|
+
declare interface TranslationResources {
|
|
3408
|
+
/**
|
|
3409
|
+
* The URL that we will add the language to for fetching translations, example: `https://somecdn.com/translations/`
|
|
3410
|
+
* @format WEB_URL
|
|
3411
|
+
*/
|
|
3412
|
+
basePath?: string;
|
|
3413
|
+
/**
|
|
3414
|
+
* The list of supported languages according to the [ISO-639-1 specification](https://en.wikipedia.org/wiki/ISO_639-1)
|
|
3415
|
+
* @format LANGUAGE
|
|
3416
|
+
* @maxSize 37
|
|
3417
|
+
*/
|
|
3418
|
+
languages?: string[];
|
|
3419
|
+
}
|
|
3420
|
+
|
|
3188
3421
|
export declare interface VectorArt {
|
|
3189
3422
|
/** media manager categories to open media manager filtered by the component needs */
|
|
3190
3423
|
category?: VectorArtCategoryTypes;
|
|
@@ -3218,6 +3451,13 @@ declare interface VectorArtOverrides {
|
|
|
3218
3451
|
category?: VectorArtCategoryTypes;
|
|
3219
3452
|
}
|
|
3220
3453
|
|
|
3454
|
+
declare enum Vertical {
|
|
3455
|
+
NONE = "NONE",
|
|
3456
|
+
TOP = "TOP",
|
|
3457
|
+
CENTER = "CENTER",
|
|
3458
|
+
BOTTOM = "BOTTOM"
|
|
3459
|
+
}
|
|
3460
|
+
|
|
3221
3461
|
export declare interface Video {
|
|
3222
3462
|
/** media manager categories to open media manager filtered by the component needs */
|
|
3223
3463
|
category?: VideoCategoryTypes;
|
package/dist/index.js
CHANGED
|
@@ -539,6 +539,13 @@ var MEDIA = {
|
|
|
539
539
|
VECTOR_ART_CATEGORY: VectorArtCategoryTypes,
|
|
540
540
|
IMAGE_CATEGORY: ImageCategoryTypes
|
|
541
541
|
};
|
|
542
|
+
const DOM_EVENT = {
|
|
543
|
+
POINTER: "POINTER",
|
|
544
|
+
CHANGE: "CHANGE",
|
|
545
|
+
FOCUS: "FOCUS",
|
|
546
|
+
SUBMIT: "SUBMIT",
|
|
547
|
+
KEYBOARD: "KEYBOARD"
|
|
548
|
+
};
|
|
542
549
|
export {
|
|
543
550
|
ACTIONS,
|
|
544
551
|
ActionName as ACTION_NAME,
|
|
@@ -547,6 +554,7 @@ export {
|
|
|
547
554
|
CSS_PROPERTIES,
|
|
548
555
|
DATA,
|
|
549
556
|
DISPLAY_GROUPS,
|
|
557
|
+
DOM_EVENT,
|
|
550
558
|
ELEMENTS,
|
|
551
559
|
INTERACTIONS,
|
|
552
560
|
LAYOUT,
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"registry": "https://registry.npmjs.org/",
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.
|
|
7
|
+
"version": "1.7.0",
|
|
8
8
|
"description": "Schema constants and types for EditorReactComponent extension",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"main": "dist/index.js",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"build": "vite build",
|
|
23
23
|
"pretest": "vite build",
|
|
24
24
|
"test": "vitest run --passWithNoTests",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
25
26
|
"lint": "biome check src/"
|
|
26
27
|
},
|
|
27
28
|
"keywords": [],
|
|
@@ -52,5 +53,5 @@
|
|
|
52
53
|
]
|
|
53
54
|
}
|
|
54
55
|
},
|
|
55
|
-
"falconPackageHash": "
|
|
56
|
+
"falconPackageHash": "ec12e42e643d5bb6ebf0efb0e259c690f18dacdcfa23a136a873c967"
|
|
56
57
|
}
|
|
@@ -674,6 +674,35 @@ declare interface BreakpointPresetStyleOverrides {
|
|
|
674
674
|
small?: PresetStyleOverrides;
|
|
675
675
|
}
|
|
676
676
|
|
|
677
|
+
declare interface ClientResources {
|
|
678
|
+
/**
|
|
679
|
+
* A URL to an ESM javascript bundle. It's default export should be the component
|
|
680
|
+
* @format WEB_URL
|
|
681
|
+
*/
|
|
682
|
+
componentUrl?: string;
|
|
683
|
+
/**
|
|
684
|
+
* A URL to the CSS file that is the default layout and style for the component
|
|
685
|
+
* @format WEB_URL
|
|
686
|
+
*/
|
|
687
|
+
cssUrl?: string | null;
|
|
688
|
+
/**
|
|
689
|
+
* A list of service dependencies required by the component, example: ['@wix/environment']
|
|
690
|
+
* @maxLength 80
|
|
691
|
+
* @maxSize 20
|
|
692
|
+
* @deprecated A list of service dependencies required by the component, example: ['@wix/environment']
|
|
693
|
+
* @replacedBy dependencies
|
|
694
|
+
* @targetRemovalDate 2025-12-30
|
|
695
|
+
*/
|
|
696
|
+
serviceDependencies?: string[];
|
|
697
|
+
/**
|
|
698
|
+
* A module specifier for the component’s react code.
|
|
699
|
+
* @maxLength 100
|
|
700
|
+
*/
|
|
701
|
+
moduleSpecifier?: string | null;
|
|
702
|
+
/** Dependencies on services and contexts */
|
|
703
|
+
dependencies?: EditorDependencies;
|
|
704
|
+
}
|
|
705
|
+
|
|
677
706
|
/** Represents the information needed for code panels */
|
|
678
707
|
declare interface CodePanel {
|
|
679
708
|
/**
|
|
@@ -1713,6 +1742,30 @@ declare enum DataType {
|
|
|
1713
1742
|
onSubmit = "onSubmit"
|
|
1714
1743
|
}
|
|
1715
1744
|
|
|
1745
|
+
declare interface DefaultPresets {
|
|
1746
|
+
/**
|
|
1747
|
+
* Default preset ID in small (mobile) breakpoint
|
|
1748
|
+
* @minLength 1
|
|
1749
|
+
* @maxLength 50
|
|
1750
|
+
*/
|
|
1751
|
+
small?: string | null;
|
|
1752
|
+
/**
|
|
1753
|
+
* Deprecated, use default - Default preset ID in large (desktop) breakpoint
|
|
1754
|
+
* @minLength 1
|
|
1755
|
+
* @maxLength 50
|
|
1756
|
+
* @deprecated Deprecated, use default - Default preset ID in large (desktop) breakpoint
|
|
1757
|
+
* @replacedBy default
|
|
1758
|
+
* @targetRemovalDate 2025-12-02
|
|
1759
|
+
*/
|
|
1760
|
+
large?: string | null;
|
|
1761
|
+
/**
|
|
1762
|
+
* Default preset ID
|
|
1763
|
+
* @minLength 1
|
|
1764
|
+
* @maxLength 50
|
|
1765
|
+
*/
|
|
1766
|
+
default?: string | null;
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1716
1769
|
export declare interface Display {
|
|
1717
1770
|
/**
|
|
1718
1771
|
* list of display values in case we want to reduce the abilities exposed to the User
|
|
@@ -1931,6 +1984,37 @@ declare enum DisplayValueEnumDisplayValue {
|
|
|
1931
1984
|
listItem = "listItem"
|
|
1932
1985
|
}
|
|
1933
1986
|
|
|
1987
|
+
export declare const DOM_EVENT: {
|
|
1988
|
+
readonly POINTER: "POINTER";
|
|
1989
|
+
readonly CHANGE: "CHANGE";
|
|
1990
|
+
readonly FOCUS: "FOCUS";
|
|
1991
|
+
readonly SUBMIT: "SUBMIT";
|
|
1992
|
+
readonly KEYBOARD: "KEYBOARD";
|
|
1993
|
+
};
|
|
1994
|
+
|
|
1995
|
+
export declare type DomEvent = (typeof DOM_EVENT)[keyof typeof DOM_EVENT];
|
|
1996
|
+
|
|
1997
|
+
declare interface EditorDependencies {
|
|
1998
|
+
/**
|
|
1999
|
+
* A list of service dependencies required by the component, example: ['@wix/environment']
|
|
2000
|
+
* @maxLength 80
|
|
2001
|
+
* @maxSize 20
|
|
2002
|
+
*/
|
|
2003
|
+
serviceDependencies?: string[];
|
|
2004
|
+
/**
|
|
2005
|
+
* Dependencies on context providers in order to work
|
|
2006
|
+
* @maxLength 80
|
|
2007
|
+
* @maxSize 20
|
|
2008
|
+
*/
|
|
2009
|
+
contextDependencies?: string[];
|
|
2010
|
+
/**
|
|
2011
|
+
* Dependencies on components that we want as externals in our bundle, example: wixEditorElements.AppWidget
|
|
2012
|
+
* @maxLength 80
|
|
2013
|
+
* @maxSize 20
|
|
2014
|
+
*/
|
|
2015
|
+
componentDependencies?: string[];
|
|
2016
|
+
}
|
|
2017
|
+
|
|
1934
2018
|
export declare type EditorElement = EditorElement_2 & RequiredFields<EditorElement_2, 'selector' | 'displayName'> & {
|
|
1935
2019
|
presets?: Record<string, PresetItem>;
|
|
1936
2020
|
};
|
|
@@ -2021,6 +2105,41 @@ declare interface EditorFunction {
|
|
|
2021
2105
|
/* Excluded from this release type: deprecated */
|
|
2022
2106
|
}
|
|
2023
2107
|
|
|
2108
|
+
/** The full model for an imported component set in DEV Center */
|
|
2109
|
+
export declare interface EditorReactComponent {
|
|
2110
|
+
/**
|
|
2111
|
+
* The type of component to present in the Page tree, will be prefixed with AppSlug
|
|
2112
|
+
* @maxLength 100
|
|
2113
|
+
* @minLength 1
|
|
2114
|
+
*/
|
|
2115
|
+
type?: string;
|
|
2116
|
+
/**
|
|
2117
|
+
* The public description of the component do display
|
|
2118
|
+
* @maxLength 300
|
|
2119
|
+
* @minLength 3
|
|
2120
|
+
*/
|
|
2121
|
+
description?: string;
|
|
2122
|
+
/** List of component resources. This comprises any runtime code we need to load and execute for the component. */
|
|
2123
|
+
resources?: Resources;
|
|
2124
|
+
/** The configuration describing the component abilities and behaviors on the Editor stage */
|
|
2125
|
+
editorElement?: EditorElement_2;
|
|
2126
|
+
/** The installation settings of the component */
|
|
2127
|
+
installation?: InstallationInfo;
|
|
2128
|
+
/** Module configuration for NPM-based component */
|
|
2129
|
+
moduleConfiguration?: EditorReactComponentModuleConfiguration;
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
declare interface EditorReactComponentModuleConfiguration {
|
|
2133
|
+
/** Public NPM package details */
|
|
2134
|
+
package?: NPMPackage;
|
|
2135
|
+
/** The component export details */
|
|
2136
|
+
component?: NPMPackageEntry;
|
|
2137
|
+
/** The component CSS File location */
|
|
2138
|
+
cssFile?: NPMPackageEntry;
|
|
2139
|
+
/** The component SSR version export details */
|
|
2140
|
+
server?: NPMPackageEntry;
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2024
2143
|
declare enum EffectGroup {
|
|
2025
2144
|
UNKNOWN_EFFECT_GROUP = "UNKNOWN_EFFECT_GROUP",
|
|
2026
2145
|
/** Effects that are applied to the background layer of the component */
|
|
@@ -2211,6 +2330,14 @@ declare enum FilterFunction {
|
|
|
2211
2330
|
hueRotate = "hueRotate"
|
|
2212
2331
|
}
|
|
2213
2332
|
|
|
2333
|
+
/** Fixed position builder for component installation */
|
|
2334
|
+
declare interface FixedPositionBuilder {
|
|
2335
|
+
/** Vertical position in the browser window */
|
|
2336
|
+
vertical?: Vertical;
|
|
2337
|
+
/** Horizontal position in the browser window */
|
|
2338
|
+
horizontal?: Horizontal;
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2214
2341
|
export declare interface Font {
|
|
2215
2342
|
/**
|
|
2216
2343
|
* Stores the font-style property of the font shorthand
|
|
@@ -2443,6 +2570,13 @@ declare interface HelpArticleArticleTypeOneOf {
|
|
|
2443
2570
|
url?: string | null;
|
|
2444
2571
|
}
|
|
2445
2572
|
|
|
2573
|
+
declare enum Horizontal {
|
|
2574
|
+
NONE = "NONE",
|
|
2575
|
+
LEFT = "LEFT",
|
|
2576
|
+
CENTER = "CENTER",
|
|
2577
|
+
RIGHT = "RIGHT"
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2446
2580
|
export declare interface Image {
|
|
2447
2581
|
/** media manager categories to open media manager filtered by the component needs */
|
|
2448
2582
|
category?: ImageCategoryTypes;
|
|
@@ -2539,6 +2673,23 @@ export declare interface InlineElement {
|
|
|
2539
2673
|
helpArticle?: HelpArticle;
|
|
2540
2674
|
}
|
|
2541
2675
|
|
|
2676
|
+
declare interface InstallationInfo extends InstallationInfoTargetContainerOneOf {
|
|
2677
|
+
/** Which static container should the component be installed at */
|
|
2678
|
+
staticContainer?: StaticContainer;
|
|
2679
|
+
/** Default presets per breakpoint with which the component should be installed */
|
|
2680
|
+
presets?: DefaultPresets;
|
|
2681
|
+
/** Initial size with which the component should be added to the stage */
|
|
2682
|
+
initialSize?: ComponentInitialSize;
|
|
2683
|
+
/** Fixed position options for the component. If set, the component will be pinned to the specified position, and can't be unpinned */
|
|
2684
|
+
fixedPosition?: FixedPositionBuilder;
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2687
|
+
/** @oneof */
|
|
2688
|
+
declare interface InstallationInfoTargetContainerOneOf {
|
|
2689
|
+
/** Which static container should the component be installed at */
|
|
2690
|
+
staticContainer?: StaticContainer;
|
|
2691
|
+
}
|
|
2692
|
+
|
|
2542
2693
|
export declare const INTERACTIONS: {
|
|
2543
2694
|
TRIGGER_TYPE: typeof InteractionsTrigger;
|
|
2544
2695
|
EFFECT_GROUP: typeof EffectGroup;
|
|
@@ -2685,6 +2836,34 @@ export declare enum NATIVE_STATE_TYPE {
|
|
|
2685
2836
|
invalid = "invalid"
|
|
2686
2837
|
}
|
|
2687
2838
|
|
|
2839
|
+
declare interface NPMPackage {
|
|
2840
|
+
/**
|
|
2841
|
+
* The npm package name
|
|
2842
|
+
* @minLength 1
|
|
2843
|
+
* @maxLength 214
|
|
2844
|
+
*/
|
|
2845
|
+
name?: string;
|
|
2846
|
+
/**
|
|
2847
|
+
* the SEMVER package version
|
|
2848
|
+
* @minLength 1
|
|
2849
|
+
* @maxLength 214
|
|
2850
|
+
*/
|
|
2851
|
+
version?: string;
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2854
|
+
declare interface NPMPackageEntry {
|
|
2855
|
+
/**
|
|
2856
|
+
* optional path to file in package
|
|
2857
|
+
* @maxLength 200
|
|
2858
|
+
*/
|
|
2859
|
+
path?: string | null;
|
|
2860
|
+
/**
|
|
2861
|
+
* The named export key to import. If empty, the default export is used.
|
|
2862
|
+
* @maxLength 200
|
|
2863
|
+
*/
|
|
2864
|
+
exportKey?: string | null;
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2688
2867
|
export declare enum OverrideType {
|
|
2689
2868
|
UNKNOWN = "UNKNOWN",
|
|
2690
2869
|
DEV = "DEV",
|
|
@@ -3036,6 +3215,38 @@ declare enum ResizeDirection {
|
|
|
3036
3215
|
none = "none"
|
|
3037
3216
|
}
|
|
3038
3217
|
|
|
3218
|
+
declare interface Resource {
|
|
3219
|
+
/**
|
|
3220
|
+
* A URL to an ESM javascript bundle
|
|
3221
|
+
* @format WEB_URL
|
|
3222
|
+
*/
|
|
3223
|
+
url?: string;
|
|
3224
|
+
}
|
|
3225
|
+
|
|
3226
|
+
declare interface Resources {
|
|
3227
|
+
/** The bundle we will load and render in the browser in the site */
|
|
3228
|
+
client?: ClientResources;
|
|
3229
|
+
/**
|
|
3230
|
+
* An optional client definition of the component we will load and render in the editor, *it replaces the client bundle.*
|
|
3231
|
+
* The main use case is to control the live site component and enable different experiences in the editor.
|
|
3232
|
+
* For example, supporting \`states\` manipulation:
|
|
3233
|
+
* Show calendar in the editor
|
|
3234
|
+
* Open drop down in the editor
|
|
3235
|
+
*/
|
|
3236
|
+
editor?: ClientResources;
|
|
3237
|
+
/** The bundle for SSR, should not include any DOM API references */
|
|
3238
|
+
server?: Resource;
|
|
3239
|
+
/** The optional component SDK to expose to Velo Users to interact with the component */
|
|
3240
|
+
sdk?: Resource;
|
|
3241
|
+
/** Details for how to load translations for the component */
|
|
3242
|
+
translations?: TranslationResources;
|
|
3243
|
+
/** The optional interactions configuration JSON file */
|
|
3244
|
+
interactions?: Resource;
|
|
3245
|
+
/* Excluded from this release type: viewerReducedModel */
|
|
3246
|
+
/* Excluded from this release type: schemaRefsUrl */
|
|
3247
|
+
/* Excluded from this release type: viewerRuntimeCss */
|
|
3248
|
+
}
|
|
3249
|
+
|
|
3039
3250
|
/** rich text data type allow manipulation of text with html & inline styles */
|
|
3040
3251
|
declare interface RichText {
|
|
3041
3252
|
/**
|
|
@@ -3173,6 +3384,14 @@ declare enum SizingType {
|
|
|
3173
3384
|
|
|
3174
3385
|
export declare type States = NonNullable<EditorElement_2['states']>;
|
|
3175
3386
|
|
|
3387
|
+
declare enum StaticContainer {
|
|
3388
|
+
UNKNOWN_CONTAINER = "UNKNOWN_CONTAINER",
|
|
3389
|
+
/** Widget should be installed in the homepage */
|
|
3390
|
+
HOMEPAGE = "HOMEPAGE",
|
|
3391
|
+
/** Show widget on all pages */
|
|
3392
|
+
GLOBAL_PAGE = "GLOBAL_PAGE"
|
|
3393
|
+
}
|
|
3394
|
+
|
|
3176
3395
|
/** DEPRECATED - use CssPropertyAction or CssCustomPropertyAction */
|
|
3177
3396
|
declare interface StyleAction {
|
|
3178
3397
|
/**
|
|
@@ -3600,6 +3819,20 @@ export declare interface TextGroup {
|
|
|
3600
3819
|
a11y?: string | null;
|
|
3601
3820
|
}
|
|
3602
3821
|
|
|
3822
|
+
declare interface TranslationResources {
|
|
3823
|
+
/**
|
|
3824
|
+
* The URL that we will add the language to for fetching translations, example: \`https://somecdn.com/translations/\`
|
|
3825
|
+
* @format WEB_URL
|
|
3826
|
+
*/
|
|
3827
|
+
basePath?: string;
|
|
3828
|
+
/**
|
|
3829
|
+
* The list of supported languages according to the [ISO-639-1 specification](https://en.wikipedia.org/wiki/ISO_639-1)
|
|
3830
|
+
* @format LANGUAGE
|
|
3831
|
+
* @maxSize 37
|
|
3832
|
+
*/
|
|
3833
|
+
languages?: string[];
|
|
3834
|
+
}
|
|
3835
|
+
|
|
3603
3836
|
export declare interface VectorArt {
|
|
3604
3837
|
/** media manager categories to open media manager filtered by the component needs */
|
|
3605
3838
|
category?: VectorArtCategoryTypes;
|
|
@@ -3633,6 +3866,13 @@ declare interface VectorArtOverrides {
|
|
|
3633
3866
|
category?: VectorArtCategoryTypes;
|
|
3634
3867
|
}
|
|
3635
3868
|
|
|
3869
|
+
declare enum Vertical {
|
|
3870
|
+
NONE = "NONE",
|
|
3871
|
+
TOP = "TOP",
|
|
3872
|
+
CENTER = "CENTER",
|
|
3873
|
+
BOTTOM = "BOTTOM"
|
|
3874
|
+
}
|
|
3875
|
+
|
|
3636
3876
|
export declare interface Video {
|
|
3637
3877
|
/** media manager categories to open media manager filtered by the component needs */
|
|
3638
3878
|
category?: VideoCategoryTypes;
|
|
@@ -4232,6 +4472,13 @@ var MEDIA = {
|
|
|
4232
4472
|
VECTOR_ART_CATEGORY: VectorArtCategoryTypes,
|
|
4233
4473
|
IMAGE_CATEGORY: ImageCategoryTypes
|
|
4234
4474
|
};
|
|
4475
|
+
const DOM_EVENT = {
|
|
4476
|
+
POINTER: "POINTER",
|
|
4477
|
+
CHANGE: "CHANGE",
|
|
4478
|
+
FOCUS: "FOCUS",
|
|
4479
|
+
SUBMIT: "SUBMIT",
|
|
4480
|
+
KEYBOARD: "KEYBOARD"
|
|
4481
|
+
};
|
|
4235
4482
|
export {
|
|
4236
4483
|
ACTIONS,
|
|
4237
4484
|
ActionName as ACTION_NAME,
|
|
@@ -4240,6 +4487,7 @@ export {
|
|
|
4240
4487
|
CSS_PROPERTIES,
|
|
4241
4488
|
DATA,
|
|
4242
4489
|
DISPLAY_GROUPS,
|
|
4490
|
+
DOM_EVENT,
|
|
4243
4491
|
ELEMENTS,
|
|
4244
4492
|
INTERACTIONS,
|
|
4245
4493
|
LAYOUT,
|
package/src/index.ts
CHANGED
|
@@ -14,6 +14,18 @@ export {
|
|
|
14
14
|
OverrideType,
|
|
15
15
|
} from '@wix/component-protocol/schema'
|
|
16
16
|
|
|
17
|
+
// TODO: replace with re-export from @wix/component-protocol/schema once
|
|
18
|
+
// https://github.com/wix-private/component-protocol exports DomEventType.
|
|
19
|
+
export const DOM_EVENT = {
|
|
20
|
+
POINTER: 'POINTER',
|
|
21
|
+
CHANGE: 'CHANGE',
|
|
22
|
+
FOCUS: 'FOCUS',
|
|
23
|
+
SUBMIT: 'SUBMIT',
|
|
24
|
+
KEYBOARD: 'KEYBOARD',
|
|
25
|
+
} as const
|
|
26
|
+
|
|
27
|
+
export type DomEvent = (typeof DOM_EVENT)[keyof typeof DOM_EVENT]
|
|
28
|
+
|
|
17
29
|
export type {
|
|
18
30
|
Behaviors,
|
|
19
31
|
StyleItem,
|
|
@@ -28,6 +40,7 @@ export type {
|
|
|
28
40
|
DataItem,
|
|
29
41
|
DataItemsMap,
|
|
30
42
|
Presets,
|
|
43
|
+
EditorReactComponent,
|
|
31
44
|
Elements,
|
|
32
45
|
ElementsDefaults,
|
|
33
46
|
ElementItem,
|
package/vite.config.ts
CHANGED
|
@@ -46,6 +46,7 @@ function wrapEditorReactTypesDeclarationPlugin(): Plugin {
|
|
|
46
46
|
return {
|
|
47
47
|
name: 'wrap-editor-react-types-declaration',
|
|
48
48
|
generateBundle(_options, bundle) {
|
|
49
|
+
// biome-ignore lint: ignore prohibition of delete
|
|
49
50
|
delete bundle['editor-react-types.js']
|
|
50
51
|
},
|
|
51
52
|
closeBundle() {
|