@wix/editor-react-types 1.0.1

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.
Files changed (57) hide show
  1. package/README.md +3 -0
  2. package/dist/a11y.d.ts +28 -0
  3. package/dist/a11y.d.ts.map +1 -0
  4. package/dist/a11y.js +2 -0
  5. package/dist/a11y.js.map +1 -0
  6. package/dist/audio.d.ts +8 -0
  7. package/dist/audio.d.ts.map +1 -0
  8. package/dist/audio.js +2 -0
  9. package/dist/audio.js.map +1 -0
  10. package/dist/base.d.ts +32 -0
  11. package/dist/base.d.ts.map +1 -0
  12. package/dist/base.js +2 -0
  13. package/dist/base.js.map +1 -0
  14. package/dist/builderAudio.d.ts +15 -0
  15. package/dist/builderAudio.d.ts.map +1 -0
  16. package/dist/builderAudio.js +2 -0
  17. package/dist/builderAudio.js.map +1 -0
  18. package/dist/image.d.ts +21 -0
  19. package/dist/image.d.ts.map +1 -0
  20. package/dist/image.js +2 -0
  21. package/dist/image.js.map +1 -0
  22. package/dist/index.d.ts +11 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +2 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/links.d.ts +8 -0
  27. package/dist/links.d.ts.map +1 -0
  28. package/dist/links.js +2 -0
  29. package/dist/links.js.map +1 -0
  30. package/dist/menuItems.d.ts +11 -0
  31. package/dist/menuItems.d.ts.map +1 -0
  32. package/dist/menuItems.js +2 -0
  33. package/dist/menuItems.js.map +1 -0
  34. package/dist/vectorArt.d.ts +9 -0
  35. package/dist/vectorArt.d.ts.map +1 -0
  36. package/dist/vectorArt.js +2 -0
  37. package/dist/vectorArt.js.map +1 -0
  38. package/dist/video.d.ts +26 -0
  39. package/dist/video.d.ts.map +1 -0
  40. package/dist/video.js +2 -0
  41. package/dist/video.js.map +1 -0
  42. package/dist/wix.d.ts +9 -0
  43. package/dist/wix.d.ts.map +1 -0
  44. package/dist/wix.js +2 -0
  45. package/dist/wix.js.map +1 -0
  46. package/package.json +50 -0
  47. package/src/a11y.ts +27 -0
  48. package/src/audio.ts +12 -0
  49. package/src/base.ts +60 -0
  50. package/src/builderAudio.ts +25 -0
  51. package/src/image.ts +29 -0
  52. package/src/index.ts +30 -0
  53. package/src/links.ts +10 -0
  54. package/src/menuItems.ts +15 -0
  55. package/src/vectorArt.ts +14 -0
  56. package/src/video.ts +44 -0
  57. package/src/wix.ts +5 -0
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # editor-react-types
2
+
3
+ React types for Wix Editor components and context
package/dist/a11y.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ export interface A11y {
2
+ tabIndex?: number;
3
+ ariaLevel?: number;
4
+ ariaExpanded?: boolean | 'false' | 'true';
5
+ ariaDisabled?: boolean | 'false' | 'true';
6
+ ariaAtomic?: boolean | 'false' | 'true';
7
+ ariaHidden?: boolean | 'false' | 'true';
8
+ ariaBusy?: boolean | 'false' | 'true';
9
+ multiline?: boolean;
10
+ ariaAutocomplete?: 'none' | 'inline' | 'list' | 'both';
11
+ ariaPressed?: boolean | 'false' | 'mixed' | 'true';
12
+ ariaHaspopup?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
13
+ ariaRelevant?: 'additions' | 'additions text' | 'all' | 'removals' | 'text';
14
+ role?: string;
15
+ ariaLive?: 'off' | 'assertive' | 'polite';
16
+ ariaCurrent?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time';
17
+ ariaLabel?: string;
18
+ ariaRoledescription?: string;
19
+ ariaDescribedby?: string;
20
+ ariaLabelledby?: string;
21
+ ariaErrormessage?: string;
22
+ ariaOwns?: string;
23
+ ariaControls?: string;
24
+ tag?: string;
25
+ ariaMultiline?: boolean | 'false' | 'true';
26
+ ariaInvalid?: boolean | 'false' | 'true' | 'grammar' | 'spelling';
27
+ }
28
+ //# sourceMappingURL=a11y.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a11y.d.ts","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M,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,aAAa,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;IAC1C,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAA;CACpE"}
package/dist/a11y.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=a11y.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a11y.js","sourceRoot":"","sources":["../src/a11y.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export type Audio = {
2
+ id: string;
3
+ url: string;
4
+ filename: string;
5
+ duration: number;
6
+ title: string;
7
+ };
8
+ //# sourceMappingURL=audio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../src/audio.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IAEhB,EAAE,EAAE,MAAM,CAAA;IAEV,GAAG,EAAE,MAAM,CAAA;IAEX,QAAQ,EAAE,MAAM,CAAA;IAEhB,QAAQ,EAAE,MAAM,CAAA;IAEhB,KAAK,EAAE,MAAM,CAAA;CAChB,CAAA"}
package/dist/audio.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=audio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio.js","sourceRoot":"","sources":["../src/audio.ts"],"names":[],"mappings":""}
package/dist/base.d.ts ADDED
@@ -0,0 +1,32 @@
1
+ import type { ReactNode, FC } from 'react';
2
+ import type { Link } from './links';
3
+ import type { Image } from './image';
4
+ import type { Video } from './video';
5
+ import type { VectorArt } from './vectorArt';
6
+ import type { A11y } from './a11y';
7
+ import type { Audio } from './audio';
8
+ export type Text = string;
9
+ export type TextEnum = string;
10
+ export type NumberType = number;
11
+ export type BooleanValue = boolean;
12
+ export type Schema = Record<string, unknown>;
13
+ export type LocalDate = string;
14
+ export type LocalTime = string;
15
+ export type LocalDateTime = string;
16
+ export type WebUrl = string;
17
+ export type Email = string;
18
+ export type Phone = string;
19
+ export type Hostname = string;
20
+ export type Regex = string;
21
+ export type Guid = string;
22
+ export type RichText = {
23
+ text: string;
24
+ html: string;
25
+ linkList: Array<Link>;
26
+ };
27
+ export type Container = ReactNode | FC<Record<string, unknown>>;
28
+ export type Data = Record<string, DataType>;
29
+ export type ArrayItems = Array<DataType | Data>;
30
+ export type Direction = 'rtl' | 'ltr' | 'auto';
31
+ 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
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +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;AAC7B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAC/B,MAAM,MAAM,YAAY,GAAG,OAAO,CAAA;AAElC,MAAM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.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ export type AudioSource = {
2
+ audioBitrate: number;
3
+ format: string;
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
+ };
15
+ //# sourceMappingURL=builderAudio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builderAudio.d.ts","sourceRoot":"","sources":["../src/builderAudio.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IAEtB,YAAY,EAAE,MAAM,CAAA;IAEpB,MAAM,EAAE,MAAM,CAAA;IAEd,OAAO,EAAE,MAAM,CAAA;IAEf,GAAG,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IAEvB,GAAG,EAAE,MAAM,CAAA;IAEX,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,KAAK,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,CAAA;CAC7B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=builderAudio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builderAudio.js","sourceRoot":"","sources":["../src/builderAudio.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ type Point = {
2
+ x: number;
3
+ y: number;
4
+ };
5
+ type Crop = Point & {
6
+ width: number;
7
+ height: number;
8
+ };
9
+ export type Image = {
10
+ uri?: string;
11
+ url: string;
12
+ name?: string;
13
+ height?: number;
14
+ width?: number;
15
+ animated?: boolean;
16
+ crop?: Crop;
17
+ quality?: number;
18
+ alt?: string;
19
+ };
20
+ export {};
21
+ //# sourceMappingURL=image.d.ts.map
@@ -0,0 +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;IAEhB,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,GAAG,EAAE,MAAM,CAAA;IAEX,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB,IAAI,CAAC,EAAE,IAAI,CAAA;IAEX,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,CAAA"}
package/dist/image.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.js","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ export type { Link } from './links';
2
+ export type { Image } from './image';
3
+ export type { Video, VideoSource, AdaptiveVideoSource, VideoSourceType } from './video';
4
+ export type { VectorArt } from './vectorArt';
5
+ export type { A11y } from './a11y';
6
+ export type { Audio } from './audio';
7
+ export type { BuilderAudio, AudioSource } from './builderAudio';
8
+ export type { MenuItems, MenuItem } from './menuItems';
9
+ export type { Wix } from './wix';
10
+ export type { Schema, Text, TextEnum, NumberType, BooleanValue, LocalDate, LocalTime, LocalDateTime, WebUrl, Email, Phone, Hostname, Regex, Guid, RichText, Container, ArrayItems, DataType, Direction, } from './base';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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;AACpC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC/D,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/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ type LinkTarget = '_self' | '_blank';
2
+ export type Link = {
3
+ href?: string;
4
+ target?: LinkTarget;
5
+ rel?: string;
6
+ };
7
+ export {};
8
+ //# sourceMappingURL=links.d.ts.map
@@ -0,0 +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;IAEf,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,MAAM,CAAC,EAAE,UAAU,CAAA;IAEnB,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,CAAA"}
package/dist/links.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=links.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"links.js","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { Link } from './links';
3
+ export type MenuItem = {
4
+ id: string;
5
+ label: string;
6
+ link?: Link;
7
+ container?: ReactElement;
8
+ items?: Array<MenuItem>;
9
+ };
10
+ export type MenuItems = Array<MenuItem>;
11
+ //# sourceMappingURL=menuItems.d.ts.map
@@ -0,0 +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;IAEnB,EAAE,EAAE,MAAM,CAAA;IAEV,KAAK,EAAE,MAAM,CAAA;IAEb,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,SAAS,CAAC,EAAE,YAAY,CAAA;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=menuItems.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menuItems.js","sourceRoot":"","sources":["../src/menuItems.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ export type VectorArt = {
2
+ uri: string;
3
+ viewBox: string;
4
+ contentBox: string;
5
+ colors: Record<string, string>;
6
+ contentType: 'shape' | 'color' | 'tint' | 'ugc' | 'textpath';
7
+ svgContent: string;
8
+ };
9
+ //# sourceMappingURL=vectorArt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vectorArt.d.ts","sourceRoot":"","sources":["../src/vectorArt.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IAEpB,GAAG,EAAE,MAAM,CAAA;IAEX,OAAO,EAAE,MAAM,CAAA;IAEf,UAAU,EAAE,MAAM,CAAA;IAElB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAE9B,WAAW,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,UAAU,CAAA;IAE5D,UAAU,EAAE,MAAM,CAAA;CACrB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=vectorArt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vectorArt.js","sourceRoot":"","sources":["../src/vectorArt.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import type { Image } from './image';
2
+ export type VideoSourceType = {
3
+ format: 'mp4' | 'mp4-luminance';
4
+ uri: string;
5
+ url: string;
6
+ };
7
+ export type AdaptiveVideoSource = {
8
+ format: 'hls' | 'dash';
9
+ uri: string;
10
+ url: string;
11
+ };
12
+ export type VideoSource = {
13
+ quality: '1080p' | '720p' | '480p' | '360p';
14
+ width: number;
15
+ height: number;
16
+ types: Array<VideoSourceType>;
17
+ };
18
+ export type Video = {
19
+ uri: string;
20
+ sources: Array<VideoSource>;
21
+ adaptiveSources: Array<AdaptiveVideoSource>;
22
+ hasAudio: boolean;
23
+ fps: number;
24
+ poster?: Image;
25
+ };
26
+ //# sourceMappingURL=video.d.ts.map
@@ -0,0 +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;IAE1B,MAAM,EAAE,KAAK,GAAG,eAAe,CAAA;IAE/B,GAAG,EAAE,MAAM,CAAA;IAEX,GAAG,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAE9B,MAAM,EAAE,KAAK,GAAG,MAAM,CAAA;IAEtB,GAAG,EAAE,MAAM,CAAA;IAEX,GAAG,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IAEtB,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;IAE3C,KAAK,EAAE,MAAM,CAAA;IAEb,MAAM,EAAE,MAAM,CAAA;IAEd,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,KAAK,GAAG;IAChB,GAAG,EAAE,MAAM,CAAA;IAEX,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAA;IAE3B,eAAe,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAA;IAE3C,QAAQ,EAAE,OAAO,CAAA;IAEjB,GAAG,EAAE,MAAM,CAAA;IAEX,MAAM,CAAC,EAAE,KAAK,CAAA;CACjB,CAAA"}
package/dist/video.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=video.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video.js","sourceRoot":"","sources":["../src/video.ts"],"names":[],"mappings":""}
package/dist/wix.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ type REMOVED = 'REMOVED';
2
+ export interface Wix {
3
+ elementsRemovalState: Record<string, REMOVED>;
4
+ presetsWrapperProps?: {
5
+ className: string;
6
+ };
7
+ }
8
+ export {};
9
+ //# sourceMappingURL=wix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wix.d.ts","sourceRoot":"","sources":["../src/wix.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,GAAG,SAAS,CAAA;AACxB,MAAM,WAAW,GAAG;IAChB,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7C,mBAAmB,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9C"}
package/dist/wix.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=wix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wix.js","sourceRoot":"","sources":["../src/wix.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@wix/editor-react-types",
3
+ "version": "1.0.1",
4
+ "description": "React types for Wix Editor components",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "sideEffects": false,
8
+ "license": "MIT",
9
+ "author": "wix",
10
+ "files": [
11
+ "src",
12
+ "dist"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsc -b . --force",
16
+ "lint": "yarn run -T lint:package $npm_package_name",
17
+ "test": "yarn test-type-check && vitest --run",
18
+ "test-type-check": "tsc --project tsconfig.test.json",
19
+ "clean": "rm -rf coverage dist target tsconfig.tsbuildinfo"
20
+ },
21
+ "dependencies": {
22
+ "react": "^18.3.1"
23
+ },
24
+ "devDependencies": {
25
+ "typescript": "^5.3.3",
26
+ "vitest": "^4.0.10"
27
+ },
28
+ "publishUnscoped": false,
29
+ "publishConfig": {
30
+ "registry": "https://registry.npmjs.org/",
31
+ "access": "public"
32
+ },
33
+ "wix": {
34
+ "artifact": {
35
+ "groupId": "com.wixpress.npm",
36
+ "artifactId": "editor-react-types",
37
+ "targets": {
38
+ "docker": false
39
+ }
40
+ },
41
+ "validations": {
42
+ "postBuild": [
43
+ "test",
44
+ "lint"
45
+ ]
46
+ }
47
+ },
48
+ "type": "module",
49
+ "falconPackageHash": "3aafd078bebde894e3b9becff2fb8ce5d77451c4f6ddab6789ab41f5"
50
+ }
package/src/a11y.ts ADDED
@@ -0,0 +1,27 @@
1
+ export interface A11y {
2
+ tabIndex?: number
3
+ ariaLevel?: number
4
+ ariaExpanded?: boolean | 'false' | 'true'
5
+ ariaDisabled?: boolean | 'false' | 'true'
6
+ ariaAtomic?: boolean | 'false' | 'true'
7
+ ariaHidden?: boolean | 'false' | 'true'
8
+ ariaBusy?: boolean | 'false' | 'true'
9
+ multiline?: boolean
10
+ ariaAutocomplete?: 'none' | 'inline' | 'list' | 'both'
11
+ ariaPressed?: boolean | 'false' | 'mixed' | 'true'
12
+ ariaHaspopup?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'
13
+ ariaRelevant?: 'additions' | 'additions text' | 'all' | 'removals' | 'text'
14
+ role?: string
15
+ ariaLive?: 'off' | 'assertive' | 'polite'
16
+ ariaCurrent?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time'
17
+ ariaLabel?: string
18
+ ariaRoledescription?: string
19
+ ariaDescribedby?: string
20
+ ariaLabelledby?: string
21
+ ariaErrormessage?: string
22
+ ariaOwns?: string
23
+ ariaControls?: string
24
+ tag?: string
25
+ ariaMultiline?: boolean | 'false' | 'true'
26
+ ariaInvalid?: boolean | 'false' | 'true' | 'grammar' | 'spelling'
27
+ }
package/src/audio.ts ADDED
@@ -0,0 +1,12 @@
1
+ export type Audio = {
2
+ // WixMedia ID.
3
+ id: string
4
+ // Audio URL.
5
+ url: string
6
+ // Audio filename.
7
+ filename: string
8
+ // Audio length in seconds.
9
+ duration: number
10
+ // Audio title
11
+ title: string
12
+ }
package/src/base.ts ADDED
@@ -0,0 +1,60 @@
1
+ import type { ReactNode, FC } from 'react'
2
+
3
+ import type { Link } from './links'
4
+ import type { Image } from './image'
5
+ import type { Video } from './video'
6
+ import type { VectorArt } from './vectorArt'
7
+ import type { A11y } from './a11y'
8
+ import type { Audio } from './audio'
9
+
10
+ export type Text = string // A simple text value
11
+
12
+ export type TextEnum = string // The selected value by the user in the editor from the defined option
13
+ export type NumberType = number // Any number
14
+ export type BooleanValue = boolean // true / false value
15
+
16
+ export type Schema = Record<string, unknown> // A JSON Schema definition
17
+ export type LocalDate = string // Local date output ISO-8601 extended local date format (YYYY-MM-DD)
18
+ export type LocalTime = string // Local time output ISO-8601 extended local time format (hh:mm[:ss][.sss])
19
+ export type LocalDateTime = string // Local Date Time output ISO-8601 extended local date-time format (YYYY-MM-DDThh:mm[:ss][.sss])
20
+ export type WebUrl = string // A URL with scheme http or https
21
+ export type Email = string // Standard email address according to RFC 5321, section 4.1.2
22
+ export type Phone = string // A validation format designed to match phone numbers with common characters
23
+ export type Hostname = string // Hostname according to IANA
24
+ export type Regex = string // A valid regex pattern supplied by the User
25
+ export type Guid = string // A unique identifier
26
+ export type RichText = {
27
+ text: string // The original content of the rich text
28
+ html: string // The content of the rich text with resolved links
29
+ linkList: Array<Link> // The list of links in the rich text
30
+ }
31
+ export type Container = ReactNode | FC<Record<string, unknown>> // A container place in the component that will be passed in as {children} or a function prop
32
+ 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
+
36
+ export type DataType =
37
+ | Text
38
+ | TextEnum
39
+ | NumberType
40
+ | BooleanValue
41
+ | Schema
42
+ | LocalDate
43
+ | LocalTime
44
+ | LocalDateTime
45
+ | WebUrl
46
+ | Email
47
+ | Phone
48
+ | Hostname
49
+ | Regex
50
+ | Guid
51
+ | RichText
52
+ | Container
53
+ | ArrayItems
54
+ | Direction
55
+ | A11y
56
+ | Image
57
+ | Video
58
+ | VectorArt
59
+ | Audio
60
+ | Link
@@ -0,0 +1,25 @@
1
+ export type AudioSource = {
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
+ }
11
+
12
+ export type BuilderAudio = {
13
+ // The audio URL.
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
+ }
package/src/image.ts ADDED
@@ -0,0 +1,29 @@
1
+ type Point = {
2
+ x: number
3
+ y: number
4
+ }
5
+ type Crop = Point & {
6
+ width: number
7
+ height: number
8
+ }
9
+
10
+ export type Image = {
11
+ // The image URI.
12
+ uri?: string
13
+ // The image resolved URL.
14
+ url: string
15
+ // The image name.
16
+ name?: string
17
+ // The image height.
18
+ height?: number
19
+ // The image width.
20
+ width?: number
21
+ // Whether the image is animated.
22
+ animated?: boolean
23
+ // The image crop.
24
+ crop?: Crop
25
+ // The image quality.
26
+ quality?: number
27
+ // The image alt text.
28
+ alt?: string
29
+ }
package/src/index.ts ADDED
@@ -0,0 +1,30 @@
1
+ export type { Link } from './links'
2
+ export type { Image } from './image'
3
+ export type { Video, VideoSource, AdaptiveVideoSource, VideoSourceType } from './video'
4
+ export type { VectorArt } from './vectorArt'
5
+ export type { A11y } from './a11y'
6
+ export type { Audio } from './audio'
7
+ export type { BuilderAudio, AudioSource } from './builderAudio'
8
+ export type { MenuItems, MenuItem } from './menuItems'
9
+ export type { Wix } from './wix'
10
+ export type {
11
+ Schema,
12
+ Text,
13
+ TextEnum,
14
+ NumberType,
15
+ BooleanValue,
16
+ LocalDate,
17
+ LocalTime,
18
+ LocalDateTime,
19
+ WebUrl,
20
+ Email,
21
+ Phone,
22
+ Hostname,
23
+ Regex,
24
+ Guid,
25
+ RichText,
26
+ Container,
27
+ ArrayItems,
28
+ DataType,
29
+ Direction,
30
+ } from './base'
package/src/links.ts ADDED
@@ -0,0 +1,10 @@
1
+ type LinkTarget = '_self' | '_blank'
2
+
3
+ export type Link = {
4
+ // The link URL.
5
+ href?: string
6
+ // Where this link should open, supports _self and _blank. _self means same page, _blank means new page.
7
+ target?: LinkTarget
8
+ // The rel of link
9
+ rel?: string // LinkRel values separated by space
10
+ }
@@ -0,0 +1,15 @@
1
+ import type { ReactElement } from 'react'
2
+ import type { Link } from './links'
3
+
4
+ export type MenuItem = {
5
+ // Menu item ID.
6
+ id: string
7
+ // Menu item label.
8
+ label: string
9
+ // Menu item link.
10
+ link?: Link
11
+ container?: ReactElement
12
+ items?: Array<MenuItem>
13
+ }
14
+
15
+ export type MenuItems = Array<MenuItem>
@@ -0,0 +1,14 @@
1
+ export type VectorArt = {
2
+ // The SVG URI.
3
+ uri: string
4
+ // The SVG viewbox.
5
+ viewBox: string
6
+ // The SVG content box.
7
+ contentBox: string
8
+ // The SVG colors.
9
+ colors: Record<string, string>
10
+ // The SVG content type.
11
+ contentType: 'shape' | 'color' | 'tint' | 'ugc' | 'textpath'
12
+ // The SVG content.
13
+ svgContent: string
14
+ }
package/src/video.ts ADDED
@@ -0,0 +1,44 @@
1
+ import type { Image } from './image'
2
+
3
+ export type VideoSourceType = {
4
+ // The video format.
5
+ format: 'mp4' | 'mp4-luminance'
6
+ // The video URI.
7
+ uri: string
8
+ // The video resolved URL.
9
+ url: string
10
+ }
11
+
12
+ export type AdaptiveVideoSource = {
13
+ // The video format.
14
+ format: 'hls' | 'dash'
15
+ // The video URI.
16
+ uri: string
17
+ // The video resolved URL.
18
+ url: string
19
+ }
20
+
21
+ export type VideoSource = {
22
+ // The video quality.
23
+ quality: '1080p' | '720p' | '480p' | '360p'
24
+ // The video width.
25
+ width: number
26
+ // The video height.
27
+ height: number
28
+ // The video types.
29
+ types: Array<VideoSourceType>
30
+ }
31
+
32
+ export type Video = {
33
+ uri: string // original uri
34
+ // The video sources.
35
+ sources: Array<VideoSource>
36
+ // The video adaptive sources.
37
+ adaptiveSources: Array<AdaptiveVideoSource>
38
+ // Whether the video has audio.
39
+ hasAudio: boolean
40
+ // The video frames per second.
41
+ fps: number
42
+ // The video poster image.
43
+ poster?: Image
44
+ }
package/src/wix.ts ADDED
@@ -0,0 +1,5 @@
1
+ type REMOVED = 'REMOVED'
2
+ export interface Wix {
3
+ elementsRemovalState: Record<string, REMOVED>
4
+ presetsWrapperProps?: { className: string }
5
+ }