@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/README.md
CHANGED
|
@@ -1,3 +1,46 @@
|
|
|
1
|
-
# editor-react-types
|
|
1
|
+
# @wix/editor-react-types
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
TypeScript types for [Editor React Component](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/site-extensions/editor-react-components/about-editor-react-components) props.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @wix/editor-react-types
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Import the types you need and use them to type your component's props:
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import type { Image, Link, Wix } from '@wix/editor-react-types';
|
|
17
|
+
|
|
18
|
+
interface MyComponentProps {
|
|
19
|
+
className: string;
|
|
20
|
+
image?: Image;
|
|
21
|
+
link?: Link;
|
|
22
|
+
wix?: Wix;
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Available types
|
|
27
|
+
|
|
28
|
+
| Type | Description |
|
|
29
|
+
|------|-------------|
|
|
30
|
+
| `Image` | An image from Wix Media. |
|
|
31
|
+
| `Video` | A video from Wix Media. |
|
|
32
|
+
| `Audio` | An audio track from Wix Media. |
|
|
33
|
+
| `BuilderAudio` | An audio track with metadata and multiple quality sources. |
|
|
34
|
+
| `Link` | A navigation link. |
|
|
35
|
+
| `VectorArt` | An SVG vector art asset from Wix Media. |
|
|
36
|
+
| `MenuItems` | A list of navigation menu items. |
|
|
37
|
+
| `A11y` | Accessibility attributes. |
|
|
38
|
+
| `Wix` | Wix framework props. |
|
|
39
|
+
| `RichText` | Rich text content. |
|
|
40
|
+
| `Direction` | Text direction. |
|
|
41
|
+
| `Text`, `NumberType`, `BooleanValue` | Primitive data types. |
|
|
42
|
+
| `WebUrl`, `Email`, `Phone`, `Hostname` | Validated string formats. |
|
|
43
|
+
| `LocalDate`, `LocalTime`, `LocalDateTime` | ISO-8601 date and time strings. |
|
|
44
|
+
| `Guid`, `Regex`, `Schema` | Additional primitive types. |
|
|
45
|
+
|
|
46
|
+
For full documentation on each type and how to use them in your component, see the [Props Reference](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/site-extensions/editor-react-components/props).
|
package/dist/a11y.d.ts
CHANGED
|
@@ -1,28 +1,73 @@
|
|
|
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
|
}
|
|
28
73
|
//# sourceMappingURL=a11y.d.ts.map
|
package/dist/a11y.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y.d.ts","sourceRoot":"","sources":["../src/a11y.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;IACzC,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;IACzC,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;IACvC,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;IACvC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;IACrC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAA;IACtD,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;IAClD,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;IAC3F,YAAY,CAAC,EAAE,WAAW,GAAG,gBAAgB,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,CAAA;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,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yG;IACzG,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAA;CACpE"}
|
package/dist/audio.d.ts
CHANGED
|
@@ -1,8 +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
|
+
* An audio track from Wix Media.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import type { Audio } from '@wix/editor-react-types';
|
|
18
|
+
*
|
|
19
|
+
* interface MyComponentProps {
|
|
20
|
+
* audio?: Audio;
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
1
24
|
export type Audio = {
|
|
2
|
-
|
|
25
|
+
/** The fully resolved audio URL. */
|
|
3
26
|
url: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
title
|
|
27
|
+
/** The audio artist name. */
|
|
28
|
+
artist?: string;
|
|
29
|
+
/** The audio track title. */
|
|
30
|
+
title?: string;
|
|
31
|
+
/** The audio duration in seconds. */
|
|
32
|
+
duration?: number;
|
|
33
|
+
/** The audio file name. */
|
|
34
|
+
name?: string;
|
|
35
|
+
/** All available audio sources at different quality levels and formats. */
|
|
36
|
+
audio?: Array<AudioSource>;
|
|
7
37
|
};
|
|
8
38
|
//# sourceMappingURL=audio.d.ts.map
|
package/dist/audio.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../src/audio.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../src/audio.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,MAAM,MAAM,WAAW,GAAG;IACtB,iCAAiC;IACjC,YAAY,EAAE,MAAM,CAAA;IACpB,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAA;IACd,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,KAAK,GAAG;IAChB,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAA;IACX,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2BAA2B;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,2EAA2E;IAC3E,KAAK,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,CAAA;CAC7B,CAAA"}
|
package/dist/base.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module
|
|
3
|
+
* Primitive and base data types for component props.
|
|
4
|
+
*/
|
|
1
5
|
import type { ReactNode, FC } from 'react';
|
|
2
6
|
import type { Link } from './links';
|
|
3
7
|
import type { Image } from './image';
|
|
@@ -5,28 +9,274 @@ import type { Video } from './video';
|
|
|
5
9
|
import type { VectorArt } from './vectorArt';
|
|
6
10
|
import type { A11y } from './a11y';
|
|
7
11
|
import type { Audio } from './audio';
|
|
12
|
+
/**
|
|
13
|
+
* A plain text string.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import type { Text } from '@wix/editor-react-types';
|
|
18
|
+
*
|
|
19
|
+
* interface MyComponentProps {
|
|
20
|
+
* label?: Text;
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
8
24
|
export type Text = string;
|
|
25
|
+
/**
|
|
26
|
+
* The value selected by the Wix user from a predefined set of options.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* import type { TextEnum } from '@wix/editor-react-types';
|
|
31
|
+
*
|
|
32
|
+
* interface MyComponentProps {
|
|
33
|
+
* alignment?: TextEnum; // e.g. 'left' | 'center' | 'right'
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
9
37
|
export type TextEnum = string;
|
|
38
|
+
/**
|
|
39
|
+
* Any numeric value.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* import type { NumberType } from '@wix/editor-react-types';
|
|
44
|
+
*
|
|
45
|
+
* interface MyComponentProps {
|
|
46
|
+
* rating?: NumberType;
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
10
50
|
export type NumberType = number;
|
|
51
|
+
/**
|
|
52
|
+
* A boolean `true` or `false` value.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* import type { BooleanValue } from '@wix/editor-react-types';
|
|
57
|
+
*
|
|
58
|
+
* interface MyComponentProps {
|
|
59
|
+
* showLabel?: BooleanValue;
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
11
63
|
export type BooleanValue = boolean;
|
|
64
|
+
/**
|
|
65
|
+
* A JSON Schema definition.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* import type { Schema } from '@wix/editor-react-types';
|
|
70
|
+
*
|
|
71
|
+
* interface MyComponentProps {
|
|
72
|
+
* schema?: Schema;
|
|
73
|
+
* }
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
12
76
|
export type Schema = Record<string, unknown>;
|
|
77
|
+
/**
|
|
78
|
+
* A local date string in ISO-8601 extended format (`YYYY-MM-DD`).
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```tsx
|
|
82
|
+
* import type { LocalDate } from '@wix/editor-react-types';
|
|
83
|
+
*
|
|
84
|
+
* interface MyComponentProps {
|
|
85
|
+
* startDate?: LocalDate; // e.g. '2024-03-15'
|
|
86
|
+
* }
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
13
89
|
export type LocalDate = string;
|
|
90
|
+
/**
|
|
91
|
+
* A local time string in ISO-8601 extended format (`hh:mm[:ss][.sss]`).
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```tsx
|
|
95
|
+
* import type { LocalTime } from '@wix/editor-react-types';
|
|
96
|
+
*
|
|
97
|
+
* interface MyComponentProps {
|
|
98
|
+
* openingTime?: LocalTime; // e.g. '09:00'
|
|
99
|
+
* }
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
14
102
|
export type LocalTime = string;
|
|
103
|
+
/**
|
|
104
|
+
* A local date-time string in ISO-8601 extended format (`YYYY-MM-DDThh:mm[:ss][.sss]`).
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```tsx
|
|
108
|
+
* import type { LocalDateTime } from '@wix/editor-react-types';
|
|
109
|
+
*
|
|
110
|
+
* interface MyComponentProps {
|
|
111
|
+
* eventStart?: LocalDateTime; // e.g. '2024-03-15T09:00'
|
|
112
|
+
* }
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
15
115
|
export type LocalDateTime = string;
|
|
116
|
+
/**
|
|
117
|
+
* A URL with an `http` or `https` scheme.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```tsx
|
|
121
|
+
* import type { WebUrl } from '@wix/editor-react-types';
|
|
122
|
+
*
|
|
123
|
+
* interface MyComponentProps {
|
|
124
|
+
* website?: WebUrl;
|
|
125
|
+
* }
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
16
128
|
export type WebUrl = string;
|
|
129
|
+
/**
|
|
130
|
+
* A standard email address according to RFC 5321, section 4.1.2.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```tsx
|
|
134
|
+
* import type { Email } from '@wix/editor-react-types';
|
|
135
|
+
*
|
|
136
|
+
* interface MyComponentProps {
|
|
137
|
+
* contactEmail?: Email;
|
|
138
|
+
* }
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
17
141
|
export type Email = string;
|
|
142
|
+
/**
|
|
143
|
+
* A phone number string, accepting common phone number characters.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```tsx
|
|
147
|
+
* import type { Phone } from '@wix/editor-react-types';
|
|
148
|
+
*
|
|
149
|
+
* interface MyComponentProps {
|
|
150
|
+
* phoneNumber?: Phone;
|
|
151
|
+
* }
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
18
154
|
export type Phone = string;
|
|
155
|
+
/**
|
|
156
|
+
* A hostname according to IANA standards.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```tsx
|
|
160
|
+
* import type { Hostname } from '@wix/editor-react-types';
|
|
161
|
+
*
|
|
162
|
+
* interface MyComponentProps {
|
|
163
|
+
* host?: Hostname; // e.g. 'www.example.com'
|
|
164
|
+
* }
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
19
167
|
export type Hostname = string;
|
|
168
|
+
/**
|
|
169
|
+
* A valid regular expression pattern provided by the Wix user.
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```tsx
|
|
173
|
+
* import type { Regex } from '@wix/editor-react-types';
|
|
174
|
+
*
|
|
175
|
+
* interface MyComponentProps {
|
|
176
|
+
* validationPattern?: Regex; // e.g. '^[a-z]+$'
|
|
177
|
+
* }
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
20
180
|
export type Regex = string;
|
|
181
|
+
/**
|
|
182
|
+
* A unique identifier (UUID).
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```tsx
|
|
186
|
+
* import type { Guid } from '@wix/editor-react-types';
|
|
187
|
+
*
|
|
188
|
+
* interface MyComponentProps {
|
|
189
|
+
* itemId?: Guid;
|
|
190
|
+
* }
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
21
193
|
export type Guid = string;
|
|
194
|
+
/**
|
|
195
|
+
* Rich text content with resolved links.
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```tsx
|
|
199
|
+
* import type { RichText } from '@wix/editor-react-types';
|
|
200
|
+
*
|
|
201
|
+
* interface MyComponentProps {
|
|
202
|
+
* description?: RichText;
|
|
203
|
+
* }
|
|
204
|
+
*
|
|
205
|
+
* const MyComponent = ({ description }: MyComponentProps) => (
|
|
206
|
+
* <div>
|
|
207
|
+
* {description?.html}
|
|
208
|
+
* {description?.linkList.map((link) => (
|
|
209
|
+
* <a key={link.href} href={link.href}>{link.href}</a>
|
|
210
|
+
* ))}
|
|
211
|
+
* </div>
|
|
212
|
+
* );
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
22
215
|
export type RichText = {
|
|
216
|
+
/** The original rich text content. */
|
|
23
217
|
text: string;
|
|
218
|
+
/** The HTML content with all links resolved. */
|
|
24
219
|
html: string;
|
|
220
|
+
/** All links present in the rich text content. */
|
|
25
221
|
linkList: Array<Link>;
|
|
26
222
|
};
|
|
223
|
+
/**
|
|
224
|
+
* A container slot in the component.
|
|
225
|
+
*
|
|
226
|
+
* Can be either a `ReactNode` passed as `children`, or a function component
|
|
227
|
+
* used as a render prop.
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* ```tsx
|
|
231
|
+
* import type { Container } from '@wix/editor-react-types';
|
|
232
|
+
*
|
|
233
|
+
* interface MyComponentProps {
|
|
234
|
+
* content?: Container;
|
|
235
|
+
* }
|
|
236
|
+
*
|
|
237
|
+
* const MyComponent = ({ content }: MyComponentProps) => (
|
|
238
|
+
* <div>
|
|
239
|
+
* {typeof content === 'function' ? content({}) : content}
|
|
240
|
+
* </div>
|
|
241
|
+
* );
|
|
242
|
+
* ```
|
|
243
|
+
*/
|
|
27
244
|
export type Container = ReactNode | FC<Record<string, unknown>>;
|
|
28
245
|
export type Data = Record<string, DataType>;
|
|
246
|
+
/**
|
|
247
|
+
* An array of data values or data records.
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* ```tsx
|
|
251
|
+
* import type { ArrayItems } from '@wix/editor-react-types';
|
|
252
|
+
*
|
|
253
|
+
* interface MyComponentProps {
|
|
254
|
+
* items?: ArrayItems;
|
|
255
|
+
* }
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
29
258
|
export type ArrayItems = Array<DataType | Data>;
|
|
259
|
+
/**
|
|
260
|
+
* The text direction of the component.
|
|
261
|
+
* Maps to the HTML `dir` attribute.
|
|
262
|
+
* - `'ltr'` — left to right.
|
|
263
|
+
* - `'rtl'` — right to left.
|
|
264
|
+
* - `'auto'` — determined by content.
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* ```tsx
|
|
268
|
+
* import type { Direction } from '@wix/editor-react-types';
|
|
269
|
+
*
|
|
270
|
+
* interface MyComponentProps {
|
|
271
|
+
* direction?: Direction;
|
|
272
|
+
* }
|
|
273
|
+
*
|
|
274
|
+
* const MyComponent = ({ direction = 'ltr' }: MyComponentProps) => (
|
|
275
|
+
* <div dir={direction}>...</div>
|
|
276
|
+
* );
|
|
277
|
+
* ```
|
|
278
|
+
*/
|
|
30
279
|
export type Direction = 'rtl' | 'ltr' | 'auto';
|
|
280
|
+
/** A union of all supported data types that can be used as component props. */
|
|
31
281
|
export type DataType = Text | TextEnum | NumberType | BooleanValue | Schema | LocalDate | LocalTime | LocalDateTime | WebUrl | Email | Phone | Hostname | Regex | Guid | RichText | Container | ArrayItems | Direction | A11y | Image | Video | VectorArt | Audio | Link;
|
|
32
282
|
//# sourceMappingURL=base.d.ts.map
|
package/dist/base.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AACnC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,MAAM,MAAM,IAAI,GAAG,MAAM,CAAA;AAEzB,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AACnC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,IAAI,GAAG,MAAM,CAAA;AAEzB;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAA;AAE7B;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,UAAU,GAAG,M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WG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAA;AAE9C,+EAA+E;AAC/E,MAAM,MAAM,QAAQ,GACd,IAAI,GACJ,QAAQ,GACR,UAAU,GACV,YAAY,GACZ,MAAM,GACN,SAAS,GACT,SAAS,GACT,aAAa,GACb,MAAM,GACN,KAAK,GACL,KAAK,GACL,QAAQ,GACR,KAAK,GACL,IAAI,GACJ,QAAQ,GACR,SAAS,GACT,UAAU,GACV,SAAS,GACT,IAAI,GACJ,KAAK,GACL,KAAK,GACL,SAAS,GACT,KAAK,GACL,IAAI,CAAA"}
|
package/dist/base.js
CHANGED
package/dist/base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
package/dist/builderAudio.d.ts
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
quality: string;
|
|
5
|
-
url: string;
|
|
6
|
-
};
|
|
7
|
-
export type BuilderAudio = {
|
|
8
|
-
url: string;
|
|
9
|
-
artist?: string;
|
|
10
|
-
title?: string;
|
|
11
|
-
duration?: number;
|
|
12
|
-
name?: string;
|
|
13
|
-
audio?: Array<AudioSource>;
|
|
14
|
-
};
|
|
1
|
+
import type { Audio } from './audio';
|
|
2
|
+
/** @deprecated Use Audio instead (should be deleted) */
|
|
3
|
+
export type BuilderAudio = Audio;
|
|
15
4
|
//# sourceMappingURL=builderAudio.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builderAudio.d.ts","sourceRoot":"","sources":["../src/builderAudio.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"builderAudio.d.ts","sourceRoot":"","sources":["../src/builderAudio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,wDAAwD;AACxD,MAAM,MAAM,YAAY,GAAG,KAAK,CAAA"}
|
package/dist/image.d.ts
CHANGED
|
@@ -6,15 +6,40 @@ type Crop = Point & {
|
|
|
6
6
|
width: number;
|
|
7
7
|
height: number;
|
|
8
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* An image from Wix Media.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* import type { Image } from '@wix/editor-react-types';
|
|
15
|
+
*
|
|
16
|
+
* interface MyComponentProps {
|
|
17
|
+
* image?: Image;
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* const MyComponent = ({ image }: MyComponentProps) => (
|
|
21
|
+
* <img src={image?.url} alt={image?.alt} />
|
|
22
|
+
* );
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
9
25
|
export type Image = {
|
|
26
|
+
/** The image URI. */
|
|
10
27
|
uri?: string;
|
|
28
|
+
/** The image URL. */
|
|
11
29
|
url: string;
|
|
30
|
+
/** The image file name. */
|
|
12
31
|
name?: string;
|
|
32
|
+
/** The image height in pixels. */
|
|
13
33
|
height?: number;
|
|
34
|
+
/** The image width in pixels. */
|
|
14
35
|
width?: number;
|
|
36
|
+
/** Whether the image is animated (e.g. GIF). */
|
|
15
37
|
animated?: boolean;
|
|
38
|
+
/** The crop region applied to the image. */
|
|
16
39
|
crop?: Crop;
|
|
40
|
+
/** The image quality, as a percentage from 0 to 100. */
|
|
17
41
|
quality?: number;
|
|
42
|
+
/** The image alt text for accessibility. */
|
|
18
43
|
alt?: string;
|
|
19
44
|
};
|
|
20
45
|
export {};
|
package/dist/image.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA,KAAK,KAAK,GAAG;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACZ,CAAA;AACD,KAAK,IAAI,GAAG,KAAK,GAAG;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,KAAK,GAAG;
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA,KAAK,KAAK,GAAG;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACZ,CAAA;AACD,KAAK,IAAI,GAAG,KAAK,GAAG;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,KAAK,GAAG;IAChB,qBAAqB;IACrB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,qBAAqB;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,2BAA2B;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export type { Image } from './image';
|
|
|
3
3
|
export type { Video, VideoSource, AdaptiveVideoSource, VideoSourceType } from './video';
|
|
4
4
|
export type { VectorArt } from './vectorArt';
|
|
5
5
|
export type { A11y } from './a11y';
|
|
6
|
-
export type { Audio } from './audio';
|
|
7
|
-
export type { BuilderAudio
|
|
6
|
+
export type { Audio, AudioSource } from './audio';
|
|
7
|
+
export type { BuilderAudio } from './builderAudio';
|
|
8
8
|
export type { MenuItems, MenuItem } from './menuItems';
|
|
9
9
|
export type { Wix } from './wix';
|
|
10
10
|
export type { Schema, Text, TextEnum, NumberType, BooleanValue, LocalDate, LocalTime, LocalDateTime, WebUrl, Email, Phone, Hostname, Regex, Guid, RichText, Container, ArrayItems, DataType, Direction, } from './base';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AACnC,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACpC,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACvF,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,YAAY,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAClC,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AACnC,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACpC,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACvF,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,YAAY,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAClC,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtD,YAAY,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAChC,YAAY,EACR,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,SAAS,EACT,SAAS,EACT,aAAa,EACb,MAAM,EACN,KAAK,EACL,KAAK,EACL,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,SAAS,GACZ,MAAM,QAAQ,CAAA"}
|
package/dist/links.d.ts
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
type LinkTarget = '_self' | '_blank';
|
|
2
|
+
/**
|
|
3
|
+
* A link to a URL, used for navigation within components.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```tsx
|
|
7
|
+
* import type { Link } from '@wix/editor-react-types';
|
|
8
|
+
*
|
|
9
|
+
* interface MyComponentProps {
|
|
10
|
+
* link?: Link;
|
|
11
|
+
* }
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
2
14
|
export type Link = {
|
|
15
|
+
/** The link URL. */
|
|
3
16
|
href?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Where this link should open.
|
|
19
|
+
* - `'_self'` — opens in the same page.
|
|
20
|
+
* - `'_blank'` — opens in a new tab.
|
|
21
|
+
*/
|
|
4
22
|
target?: LinkTarget;
|
|
23
|
+
/** The `rel` attribute of the link. Accepts LinkRel values separated by a space. */
|
|
5
24
|
rel?: string;
|
|
6
25
|
};
|
|
7
26
|
export {};
|
package/dist/links.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEpC,MAAM,MAAM,IAAI,GAAG;
|
|
1
|
+
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEpC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,IAAI,GAAG;IACf,oBAAoB;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,oFAAoF;IACpF,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,CAAA"}
|
package/dist/menuItems.d.ts
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { Link } from './links';
|
|
3
|
+
/**
|
|
4
|
+
* A single item in a menu, optionally containing nested sub-items.
|
|
5
|
+
*/
|
|
3
6
|
export type MenuItem = {
|
|
7
|
+
/** A unique identifier for the menu item. */
|
|
4
8
|
id: string;
|
|
9
|
+
/** The display label shown to the user. */
|
|
5
10
|
label: string;
|
|
11
|
+
/** The navigation link for this menu item. */
|
|
6
12
|
link?: Link;
|
|
13
|
+
/** An optional container element rendered alongside the menu item. */
|
|
7
14
|
container?: ReactElement;
|
|
15
|
+
/** Nested child menu items, for building multi-level menus. */
|
|
8
16
|
items?: Array<MenuItem>;
|
|
9
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* A list of menu items.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* import type { MenuItems } from '@wix/editor-react-types';
|
|
24
|
+
*
|
|
25
|
+
* interface MyComponentProps {
|
|
26
|
+
* items?: MenuItems;
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
10
30
|
export type MenuItems = Array<MenuItem>;
|
|
11
31
|
//# sourceMappingURL=menuItems.d.ts.map
|
package/dist/menuItems.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menuItems.d.ts","sourceRoot":"","sources":["../src/menuItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEnC,MAAM,MAAM,QAAQ,GAAG;
|
|
1
|
+
{"version":3,"file":"menuItems.d.ts","sourceRoot":"","sources":["../src/menuItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEnC;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACnB,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAA;IACV,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,sEAAsE;IACtE,SAAS,CAAC,EAAE,YAAY,CAAA;IACxB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;CAC1B,CAAA;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAA"}
|