@wix/editor-react-types 1.0.1 → 1.0.14
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/README.md +45 -2
- package/dist/a11y.d.ts +45 -0
- package/dist/a11y.d.ts.map +1 -1
- package/dist/audio.d.ts +34 -4
- package/dist/audio.d.ts.map +1 -1
- package/dist/base.d.ts +250 -0
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +4 -0
- package/dist/base.js.map +1 -1
- package/dist/builderAudio.d.ts +3 -14
- package/dist/builderAudio.d.ts.map +1 -1
- package/dist/image.d.ts +25 -0
- package/dist/image.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/links.d.ts +19 -0
- package/dist/links.d.ts.map +1 -1
- package/dist/menuItems.d.ts +20 -0
- package/dist/menuItems.d.ts.map +1 -1
- package/dist/statics/docs-ts-model.json +4864 -0
- package/dist/vectorArt.d.ts +25 -0
- package/dist/vectorArt.d.ts.map +1 -1
- package/dist/video.d.ts +31 -0
- package/dist/video.d.ts.map +1 -1
- package/dist/wix.d.ts +27 -0
- package/dist/wix.d.ts.map +1 -1
- package/package.json +8 -4
- package/src/a11y.ts +45 -0
- package/src/audio.ts +35 -9
- package/src/base.ts +289 -22
- package/src/builderAudio.ts +3 -24
- package/src/image.ts +25 -9
- package/src/index.ts +2 -2
- package/src/links.ts +20 -4
- package/src/menuItems.ts +20 -3
- package/src/vectorArt.ts +25 -6
- package/src/video.ts +32 -16
- package/src/wix.ts +28 -0
package/dist/vectorArt.d.ts
CHANGED
|
@@ -1,9 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A vector art (SVG) asset from Wix Media.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```tsx
|
|
6
|
+
* import type { VectorArt } from '@wix/editor-react-types';
|
|
7
|
+
*
|
|
8
|
+
* interface MyComponentProps {
|
|
9
|
+
* icon?: VectorArt;
|
|
10
|
+
* }
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
1
13
|
export type VectorArt = {
|
|
14
|
+
/** The SVG URI. */
|
|
2
15
|
uri: string;
|
|
16
|
+
/** The SVG `viewBox` attribute value. */
|
|
3
17
|
viewBox: string;
|
|
18
|
+
/** The SVG content box dimensions. */
|
|
4
19
|
contentBox: string;
|
|
20
|
+
/** A map of color IDs to their resolved color values, for themeable SVGs. */
|
|
5
21
|
colors: Record<string, string>;
|
|
22
|
+
/**
|
|
23
|
+
* The SVG content type, which determines how colors and theming are applied.
|
|
24
|
+
* - `'shape'` — a simple monochromatic shape.
|
|
25
|
+
* - `'color'` — a multi-color SVG.
|
|
26
|
+
* - `'tint'` — a single-color tintable SVG.
|
|
27
|
+
* - `'ugc'` — user-generated content.
|
|
28
|
+
* - `'textpath'` — text along a path.
|
|
29
|
+
*/
|
|
6
30
|
contentType: 'shape' | 'color' | 'tint' | 'ugc' | 'textpath';
|
|
31
|
+
/** The raw SVG markup. */
|
|
7
32
|
svgContent: string;
|
|
8
33
|
};
|
|
9
34
|
//# sourceMappingURL=vectorArt.d.ts.map
|
package/dist/vectorArt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectorArt.d.ts","sourceRoot":"","sources":["../src/vectorArt.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;
|
|
1
|
+
{"version":3,"file":"vectorArt.d.ts","sourceRoot":"","sources":["../src/vectorArt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,SAAS,GAAG;IACpB,mBAAmB;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAA;IACf,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B;;;;;;;OAOG;IACH,WAAW,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,UAAU,CAAA;IAC5D,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAA;CACrB,CAAA"}
|
package/dist/video.d.ts
CHANGED
|
@@ -1,26 +1,57 @@
|
|
|
1
1
|
import type { Image } from './image';
|
|
2
|
+
/** A single video file format for a given quality level. */
|
|
2
3
|
export type VideoSourceType = {
|
|
4
|
+
/** The video format. */
|
|
3
5
|
format: 'mp4' | 'mp4-luminance';
|
|
6
|
+
/** The video URI. */
|
|
4
7
|
uri: string;
|
|
8
|
+
/** The fully resolved video URL. */
|
|
5
9
|
url: string;
|
|
6
10
|
};
|
|
11
|
+
/** An adaptive streaming video source (HLS or DASH). */
|
|
7
12
|
export type AdaptiveVideoSource = {
|
|
13
|
+
/** The adaptive streaming format. */
|
|
8
14
|
format: 'hls' | 'dash';
|
|
15
|
+
/** The video URI. */
|
|
9
16
|
uri: string;
|
|
17
|
+
/** The fully resolved video URL. */
|
|
10
18
|
url: string;
|
|
11
19
|
};
|
|
20
|
+
/** A set of video files for a specific quality level. */
|
|
12
21
|
export type VideoSource = {
|
|
22
|
+
/** The video quality level. */
|
|
13
23
|
quality: '1080p' | '720p' | '480p' | '360p';
|
|
24
|
+
/** The video width in pixels at this quality level. */
|
|
14
25
|
width: number;
|
|
26
|
+
/** The video height in pixels at this quality level. */
|
|
15
27
|
height: number;
|
|
28
|
+
/** The available file types for this quality level. */
|
|
16
29
|
types: Array<VideoSourceType>;
|
|
17
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* A video from Wix Media, including all available sources and quality levels.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* import type { Video } from '@wix/editor-react-types';
|
|
37
|
+
*
|
|
38
|
+
* interface MyComponentProps {
|
|
39
|
+
* video?: Video;
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
18
43
|
export type Video = {
|
|
44
|
+
/** The original video URI. */
|
|
19
45
|
uri: string;
|
|
46
|
+
/** All available quality-level sources for progressive playback. */
|
|
20
47
|
sources: Array<VideoSource>;
|
|
48
|
+
/** Adaptive streaming sources (HLS/DASH) for streaming playback. */
|
|
21
49
|
adaptiveSources: Array<AdaptiveVideoSource>;
|
|
50
|
+
/** Whether the video contains an audio track. */
|
|
22
51
|
hasAudio: boolean;
|
|
52
|
+
/** The video frame rate in frames per second. */
|
|
23
53
|
fps: number;
|
|
54
|
+
/** A poster image to display before the video plays. */
|
|
24
55
|
poster?: Image;
|
|
25
56
|
};
|
|
26
57
|
//# sourceMappingURL=video.d.ts.map
|
package/dist/video.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../src/video.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,MAAM,MAAM,eAAe,GAAG;
|
|
1
|
+
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../src/video.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,4DAA4D;AAC5D,MAAM,MAAM,eAAe,GAAG;IAC1B,wBAAwB;IACxB,MAAM,EAAE,KAAK,GAAG,eAAe,CAAA;IAC/B,qBAAqB;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAA;CACd,CAAA;AAED,wDAAwD;AACxD,MAAM,MAAM,mBAAmB,GAAG;IAC9B,qCAAqC;IACrC,MAAM,EAAE,KAAK,GAAG,MAAM,CAAA;IACtB,qBAAqB;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAA;CACd,CAAA;AAED,yDAAyD;AACzD,MAAM,MAAM,WAAW,GAAG;IACtB,+BAA+B;IAC/B,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;IAC3C,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAA;IACb,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAA;IACd,uDAAuD;IACvD,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;CAChC,CAAA;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,KAAK,GAAG;IAChB,8BAA8B;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,oEAAoE;IACpE,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAA;IAC3B,oEAAoE;IACpE,eAAe,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAA;IAC3C,iDAAiD;IACjD,QAAQ,EAAE,OAAO,CAAA;IACjB,iDAAiD;IACjD,GAAG,EAAE,MAAM,CAAA;IACX,wDAAwD;IACxD,MAAM,CAAC,EAAE,KAAK,CAAA;CACjB,CAAA"}
|
package/dist/wix.d.ts
CHANGED
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
type REMOVED = 'REMOVED';
|
|
2
|
+
/**
|
|
3
|
+
* Wix framework props.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```tsx
|
|
7
|
+
* import type { Wix } from '@wix/editor-react-types';
|
|
8
|
+
*
|
|
9
|
+
* interface MyComponentProps {
|
|
10
|
+
* className: string;
|
|
11
|
+
* wix?: Wix;
|
|
12
|
+
* }
|
|
13
|
+
*
|
|
14
|
+
* const MyComponent = ({ className, wix }: MyComponentProps) => (
|
|
15
|
+
* <div {...wix?.presetsWrapperProps}>
|
|
16
|
+
* <div className={className}>...</div>
|
|
17
|
+
* </div>
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
2
21
|
export interface Wix {
|
|
22
|
+
/**
|
|
23
|
+
* Tracks which removable elements have been removed by the Wix user.
|
|
24
|
+
* Keys are element keys (as defined in the manifest), values are `'REMOVED'`.
|
|
25
|
+
*/
|
|
3
26
|
elementsRemovalState: Record<string, REMOVED>;
|
|
27
|
+
/**
|
|
28
|
+
* Props to spread onto the outermost wrapper element when using presets.
|
|
29
|
+
* Required for the preset picker to work correctly in the editor.
|
|
30
|
+
*/
|
|
4
31
|
presetsWrapperProps?: {
|
|
5
32
|
className: string;
|
|
6
33
|
};
|
package/dist/wix.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wix.d.ts","sourceRoot":"","sources":["../src/wix.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,GAAG,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"wix.d.ts","sourceRoot":"","sources":["../src/wix.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,GAAG,SAAS,CAAA;AAExB;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,GAAG;IAChB;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7C;;;OAGG;IACH,mBAAmB,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/editor-react-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "React types for Wix Editor components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
14
|
"scripts": {
|
|
15
|
-
"build": "tsc -b . --force",
|
|
15
|
+
"build": "tsc -b . --force && npm run docs",
|
|
16
|
+
"docs": "docs-ts-model --entryPoint src/index.ts",
|
|
16
17
|
"lint": "yarn run -T lint:package $npm_package_name",
|
|
17
18
|
"test": "yarn test-type-check && vitest --run",
|
|
18
19
|
"test-type-check": "tsc --project tsconfig.test.json",
|
|
@@ -22,6 +23,7 @@
|
|
|
22
23
|
"react": "^18.3.1"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
26
|
+
"@wix/docs-ts-model": "^1.0.0",
|
|
25
27
|
"typescript": "^5.3.3",
|
|
26
28
|
"vitest": "^4.0.10"
|
|
27
29
|
},
|
|
@@ -35,7 +37,9 @@
|
|
|
35
37
|
"groupId": "com.wixpress.npm",
|
|
36
38
|
"artifactId": "editor-react-types",
|
|
37
39
|
"targets": {
|
|
38
|
-
"docker": false
|
|
40
|
+
"docker": false,
|
|
41
|
+
"static": true,
|
|
42
|
+
"build-docs": true
|
|
39
43
|
}
|
|
40
44
|
},
|
|
41
45
|
"validations": {
|
|
@@ -46,5 +50,5 @@
|
|
|
46
50
|
}
|
|
47
51
|
},
|
|
48
52
|
"type": "module",
|
|
49
|
-
"falconPackageHash": "
|
|
53
|
+
"falconPackageHash": "309e0eb6391020770a9d76442b4ae2b980691d2a54bd694352c44602"
|
|
50
54
|
}
|
package/src/a11y.ts
CHANGED
|
@@ -1,27 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accessibility attributes.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```tsx
|
|
6
|
+
* import type { A11y } from '@wix/editor-react-types';
|
|
7
|
+
*
|
|
8
|
+
* interface MyComponentProps {
|
|
9
|
+
* a11y?: A11y;
|
|
10
|
+
* }
|
|
11
|
+
*
|
|
12
|
+
* const MyComponent = ({ a11y }: MyComponentProps) => (
|
|
13
|
+
* <div
|
|
14
|
+
* tabIndex={a11y?.tabIndex}
|
|
15
|
+
* role={a11y?.role}
|
|
16
|
+
* aria-label={a11y?.ariaLabel}
|
|
17
|
+
* />
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
1
21
|
export interface A11y {
|
|
22
|
+
/** The `tabindex` attribute. Controls the component's position in keyboard focus order. */
|
|
2
23
|
tabIndex?: number
|
|
24
|
+
/** The `aria-level` attribute. Defines the hierarchical level of a component within a structure. */
|
|
3
25
|
ariaLevel?: number
|
|
26
|
+
/** The `aria-expanded` attribute. Indicates whether a collapsible component is expanded or collapsed. */
|
|
4
27
|
ariaExpanded?: boolean | 'false' | 'true'
|
|
28
|
+
/** The `aria-disabled` attribute. Indicates that the component is perceivable but disabled. */
|
|
5
29
|
ariaDisabled?: boolean | 'false' | 'true'
|
|
30
|
+
/** The `aria-atomic` attribute. Indicates whether assistive technologies should present the entire region as a whole. */
|
|
6
31
|
ariaAtomic?: boolean | 'false' | 'true'
|
|
32
|
+
/** The `aria-hidden` attribute. Hides the component from assistive technologies. */
|
|
7
33
|
ariaHidden?: boolean | 'false' | 'true'
|
|
34
|
+
/** The `aria-busy` attribute. Indicates the component is being modified and assistive technologies should wait. */
|
|
8
35
|
ariaBusy?: boolean | 'false' | 'true'
|
|
36
|
+
/** Whether the component supports multiline input. */
|
|
9
37
|
multiline?: boolean
|
|
38
|
+
/** The `aria-autocomplete` attribute. Indicates the type of autocomplete behavior for an input. */
|
|
10
39
|
ariaAutocomplete?: 'none' | 'inline' | 'list' | 'both'
|
|
40
|
+
/** The `aria-pressed` attribute. Indicates the current "pressed" state of a toggle button. */
|
|
11
41
|
ariaPressed?: boolean | 'false' | 'mixed' | 'true'
|
|
42
|
+
/** The `aria-haspopup` attribute. Indicates the availability and type of an interactive popup component. */
|
|
12
43
|
ariaHaspopup?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'
|
|
44
|
+
/** The `aria-relevant` attribute. Indicates what notifications the user agent will trigger when the accessibility tree is modified. */
|
|
13
45
|
ariaRelevant?: 'additions' | 'additions text' | 'all' | 'removals' | 'text'
|
|
46
|
+
/** The `role` attribute. Defines the semantic role of the component. */
|
|
14
47
|
role?: string
|
|
48
|
+
/** The `aria-live` attribute. Indicates that the component will be updated and describes the types of updates. */
|
|
15
49
|
ariaLive?: 'off' | 'assertive' | 'polite'
|
|
50
|
+
/** The `aria-current` attribute. Indicates the component that represents the current item within a container or set. */
|
|
16
51
|
ariaCurrent?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time'
|
|
52
|
+
/** The `aria-label` attribute. Defines a string value that labels the component. */
|
|
17
53
|
ariaLabel?: string
|
|
54
|
+
/** The `aria-roledescription` attribute. Defines a human-readable description for the role of the component. */
|
|
18
55
|
ariaRoledescription?: string
|
|
56
|
+
/** The `aria-describedby` attribute. Identifies the element that describes this component. */
|
|
19
57
|
ariaDescribedby?: string
|
|
58
|
+
/** The `aria-labelledby` attribute. Identifies the element that labels this component. */
|
|
20
59
|
ariaLabelledby?: string
|
|
60
|
+
/** The `aria-errormessage` attribute. Identifies the element that provides an error message for this component. */
|
|
21
61
|
ariaErrormessage?: string
|
|
62
|
+
/** The `aria-owns` attribute. Identifies a component to define a visual, functional, or contextual parent/child relationship. */
|
|
22
63
|
ariaOwns?: string
|
|
64
|
+
/** The `aria-controls` attribute. Identifies the element whose contents or presence are controlled by this component. */
|
|
23
65
|
ariaControls?: string
|
|
66
|
+
/** The HTML tag to render the component as (e.g. `'h1'`, `'button'`). */
|
|
24
67
|
tag?: string
|
|
68
|
+
/** The `aria-multiline` attribute. Indicates whether a text box accepts multiple lines of input. */
|
|
25
69
|
ariaMultiline?: boolean | 'false' | 'true'
|
|
70
|
+
/** The `aria-invalid` attribute. Indicates the entered value does not conform to the expected format. */
|
|
26
71
|
ariaInvalid?: boolean | 'false' | 'true' | 'grammar' | 'spelling'
|
|
27
72
|
}
|
package/src/audio.ts
CHANGED
|
@@ -1,12 +1,38 @@
|
|
|
1
|
+
/** A single audio source file at a specific quality and format. */
|
|
2
|
+
export type AudioSource = {
|
|
3
|
+
/** The audio bitrate in kbps. */
|
|
4
|
+
audioBitrate: number
|
|
5
|
+
/** The audio format (e.g. `'mp3'`, `'ogg'`). */
|
|
6
|
+
format: string
|
|
7
|
+
/** The audio quality label. */
|
|
8
|
+
quality: string
|
|
9
|
+
/** The fully resolved audio URL. */
|
|
10
|
+
url: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* An audio track from Wix Media.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import type { Audio } from '@wix/editor-react-types';
|
|
19
|
+
*
|
|
20
|
+
* interface MyComponentProps {
|
|
21
|
+
* audio?: Audio;
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
1
25
|
export type Audio = {
|
|
2
|
-
|
|
3
|
-
id: string
|
|
4
|
-
// Audio URL.
|
|
26
|
+
/** The fully resolved audio URL. */
|
|
5
27
|
url: string
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
28
|
+
/** The audio artist name. */
|
|
29
|
+
artist?: string
|
|
30
|
+
/** The audio track title. */
|
|
31
|
+
title?: string
|
|
32
|
+
/** The audio duration in seconds. */
|
|
33
|
+
duration?: number
|
|
34
|
+
/** The audio file name. */
|
|
35
|
+
name?: string
|
|
36
|
+
/** All available audio sources at different quality levels and formats. */
|
|
37
|
+
audio?: Array<AudioSource>
|
|
12
38
|
}
|
package/src/base.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module
|
|
3
|
+
* Primitive and base data types for component props.
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
import type { ReactNode, FC } from 'react'
|
|
2
7
|
|
|
3
8
|
import type { Link } from './links'
|
|
@@ -7,32 +12,294 @@ import type { VectorArt } from './vectorArt'
|
|
|
7
12
|
import type { A11y } from './a11y'
|
|
8
13
|
import type { Audio } from './audio'
|
|
9
14
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export type
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
/**
|
|
16
|
+
* A plain text string.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* import type { Text } from '@wix/editor-react-types';
|
|
21
|
+
*
|
|
22
|
+
* interface MyComponentProps {
|
|
23
|
+
* label?: Text;
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export type Text = string
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The value selected by the Wix user from a predefined set of options.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* import type { TextEnum } from '@wix/editor-react-types';
|
|
35
|
+
*
|
|
36
|
+
* interface MyComponentProps {
|
|
37
|
+
* alignment?: TextEnum; // e.g. 'left' | 'center' | 'right'
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export type TextEnum = string
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Any numeric value.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* import type { NumberType } from '@wix/editor-react-types';
|
|
49
|
+
*
|
|
50
|
+
* interface MyComponentProps {
|
|
51
|
+
* rating?: NumberType;
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export type NumberType = number
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* A boolean `true` or `false` value.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* import type { BooleanValue } from '@wix/editor-react-types';
|
|
63
|
+
*
|
|
64
|
+
* interface MyComponentProps {
|
|
65
|
+
* showLabel?: BooleanValue;
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export type BooleanValue = boolean
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* A JSON Schema definition.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* import type { Schema } from '@wix/editor-react-types';
|
|
77
|
+
*
|
|
78
|
+
* interface MyComponentProps {
|
|
79
|
+
* schema?: Schema;
|
|
80
|
+
* }
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export type Schema = Record<string, unknown>
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* A local date string in ISO-8601 extended format (`YYYY-MM-DD`).
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```tsx
|
|
90
|
+
* import type { LocalDate } from '@wix/editor-react-types';
|
|
91
|
+
*
|
|
92
|
+
* interface MyComponentProps {
|
|
93
|
+
* startDate?: LocalDate; // e.g. '2024-03-15'
|
|
94
|
+
* }
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
export type LocalDate = string
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* A local time string in ISO-8601 extended format (`hh:mm[:ss][.sss]`).
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```tsx
|
|
104
|
+
* import type { LocalTime } from '@wix/editor-react-types';
|
|
105
|
+
*
|
|
106
|
+
* interface MyComponentProps {
|
|
107
|
+
* openingTime?: LocalTime; // e.g. '09:00'
|
|
108
|
+
* }
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export type LocalTime = string
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* A local date-time string in ISO-8601 extended format (`YYYY-MM-DDThh:mm[:ss][.sss]`).
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```tsx
|
|
118
|
+
* import type { LocalDateTime } from '@wix/editor-react-types';
|
|
119
|
+
*
|
|
120
|
+
* interface MyComponentProps {
|
|
121
|
+
* eventStart?: LocalDateTime; // e.g. '2024-03-15T09:00'
|
|
122
|
+
* }
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export type LocalDateTime = string
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* A URL with an `http` or `https` scheme.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```tsx
|
|
132
|
+
* import type { WebUrl } from '@wix/editor-react-types';
|
|
133
|
+
*
|
|
134
|
+
* interface MyComponentProps {
|
|
135
|
+
* website?: WebUrl;
|
|
136
|
+
* }
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
export type WebUrl = string
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* A standard email address according to RFC 5321, section 4.1.2.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```tsx
|
|
146
|
+
* import type { Email } from '@wix/editor-react-types';
|
|
147
|
+
*
|
|
148
|
+
* interface MyComponentProps {
|
|
149
|
+
* contactEmail?: Email;
|
|
150
|
+
* }
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
export type Email = string
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* A phone number string, accepting common phone number characters.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```tsx
|
|
160
|
+
* import type { Phone } from '@wix/editor-react-types';
|
|
161
|
+
*
|
|
162
|
+
* interface MyComponentProps {
|
|
163
|
+
* phoneNumber?: Phone;
|
|
164
|
+
* }
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
export type Phone = string
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* A hostname according to IANA standards.
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```tsx
|
|
174
|
+
* import type { Hostname } from '@wix/editor-react-types';
|
|
175
|
+
*
|
|
176
|
+
* interface MyComponentProps {
|
|
177
|
+
* host?: Hostname; // e.g. 'www.example.com'
|
|
178
|
+
* }
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
export type Hostname = string
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* A valid regular expression pattern provided by the Wix user.
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* ```tsx
|
|
188
|
+
* import type { Regex } from '@wix/editor-react-types';
|
|
189
|
+
*
|
|
190
|
+
* interface MyComponentProps {
|
|
191
|
+
* validationPattern?: Regex; // e.g. '^[a-z]+$'
|
|
192
|
+
* }
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
export type Regex = string
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* A unique identifier (UUID).
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```tsx
|
|
202
|
+
* import type { Guid } from '@wix/editor-react-types';
|
|
203
|
+
*
|
|
204
|
+
* interface MyComponentProps {
|
|
205
|
+
* itemId?: Guid;
|
|
206
|
+
* }
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
export type Guid = string
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Rich text content with resolved links.
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```tsx
|
|
216
|
+
* import type { RichText } from '@wix/editor-react-types';
|
|
217
|
+
*
|
|
218
|
+
* interface MyComponentProps {
|
|
219
|
+
* description?: RichText;
|
|
220
|
+
* }
|
|
221
|
+
*
|
|
222
|
+
* const MyComponent = ({ description }: MyComponentProps) => (
|
|
223
|
+
* <div>
|
|
224
|
+
* {description?.html}
|
|
225
|
+
* {description?.linkList.map((link) => (
|
|
226
|
+
* <a key={link.href} href={link.href}>{link.href}</a>
|
|
227
|
+
* ))}
|
|
228
|
+
* </div>
|
|
229
|
+
* );
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
26
232
|
export type RichText = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
233
|
+
/** The original rich text content. */
|
|
234
|
+
text: string
|
|
235
|
+
/** The HTML content with all links resolved. */
|
|
236
|
+
html: string
|
|
237
|
+
/** All links present in the rich text content. */
|
|
238
|
+
linkList: Array<Link>
|
|
30
239
|
}
|
|
31
|
-
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* A container slot in the component.
|
|
243
|
+
*
|
|
244
|
+
* Can be either a `ReactNode` passed as `children`, or a function component
|
|
245
|
+
* used as a render prop.
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* ```tsx
|
|
249
|
+
* import type { Container } from '@wix/editor-react-types';
|
|
250
|
+
*
|
|
251
|
+
* interface MyComponentProps {
|
|
252
|
+
* content?: Container;
|
|
253
|
+
* }
|
|
254
|
+
*
|
|
255
|
+
* const MyComponent = ({ content }: MyComponentProps) => (
|
|
256
|
+
* <div>
|
|
257
|
+
* {typeof content === 'function' ? content({}) : content}
|
|
258
|
+
* </div>
|
|
259
|
+
* );
|
|
260
|
+
* ```
|
|
261
|
+
*/
|
|
262
|
+
export type Container = ReactNode | FC<Record<string, unknown>>
|
|
263
|
+
|
|
32
264
|
export type Data = Record<string, DataType>
|
|
33
|
-
export type ArrayItems = Array<DataType | Data> // An array type of data
|
|
34
|
-
export type Direction = 'rtl' | 'ltr' | 'auto' // Selected direction for the component according to the HTML dir attribute
|
|
35
265
|
|
|
266
|
+
/**
|
|
267
|
+
* An array of data values or data records.
|
|
268
|
+
*
|
|
269
|
+
* @example
|
|
270
|
+
* ```tsx
|
|
271
|
+
* import type { ArrayItems } from '@wix/editor-react-types';
|
|
272
|
+
*
|
|
273
|
+
* interface MyComponentProps {
|
|
274
|
+
* items?: ArrayItems;
|
|
275
|
+
* }
|
|
276
|
+
* ```
|
|
277
|
+
*/
|
|
278
|
+
export type ArrayItems = Array<DataType | Data>
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* The text direction of the component.
|
|
282
|
+
* Maps to the HTML `dir` attribute.
|
|
283
|
+
* - `'ltr'` — left to right.
|
|
284
|
+
* - `'rtl'` — right to left.
|
|
285
|
+
* - `'auto'` — determined by content.
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
* ```tsx
|
|
289
|
+
* import type { Direction } from '@wix/editor-react-types';
|
|
290
|
+
*
|
|
291
|
+
* interface MyComponentProps {
|
|
292
|
+
* direction?: Direction;
|
|
293
|
+
* }
|
|
294
|
+
*
|
|
295
|
+
* const MyComponent = ({ direction = 'ltr' }: MyComponentProps) => (
|
|
296
|
+
* <div dir={direction}>...</div>
|
|
297
|
+
* );
|
|
298
|
+
* ```
|
|
299
|
+
*/
|
|
300
|
+
export type Direction = 'rtl' | 'ltr' | 'auto'
|
|
301
|
+
|
|
302
|
+
/** A union of all supported data types that can be used as component props. */
|
|
36
303
|
export type DataType =
|
|
37
304
|
| Text
|
|
38
305
|
| TextEnum
|
package/src/builderAudio.ts
CHANGED
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// The audio bitrate.
|
|
3
|
-
audioBitrate: number
|
|
4
|
-
// The audio format.
|
|
5
|
-
format: string
|
|
6
|
-
// The audio quality.
|
|
7
|
-
quality: string
|
|
8
|
-
// The audio resolved URL.
|
|
9
|
-
url: string
|
|
10
|
-
}
|
|
1
|
+
import type { Audio } from './audio'
|
|
11
2
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
url: string
|
|
15
|
-
// The audio artist.
|
|
16
|
-
artist?: string
|
|
17
|
-
// The audio title.
|
|
18
|
-
title?: string
|
|
19
|
-
// The audio duration in seconds.
|
|
20
|
-
duration?: number
|
|
21
|
-
// The audio file name.
|
|
22
|
-
name?: string
|
|
23
|
-
// The audio sources.
|
|
24
|
-
audio?: Array<AudioSource>
|
|
25
|
-
}
|
|
3
|
+
/** @deprecated Use Audio instead (should be deleted) */
|
|
4
|
+
export type BuilderAudio = Audio
|