@unlayer/types 1.489.0 → 1.491.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.
@@ -1,11 +1,13 @@
1
1
  // Auto-generated by build-values-types.js. Do not edit manually.
2
2
 
3
- export type SpecialLink = {
3
+ export type SpecialLink =
4
+ | {
4
5
  name: string;
5
6
  href: string;
6
7
  target?: string;
7
8
  specialLinks?: undefined;
8
- } | {
9
+ }
10
+ | {
9
11
  name: string;
10
12
  href?: undefined;
11
13
  target?: undefined;
@@ -16,7 +18,8 @@ export interface SpecialLinks {
16
18
  [name: string]: SpecialLink;
17
19
  }
18
20
 
19
- export type LinkTypeFieldOption = {
21
+ export type LinkTypeFieldOption =
22
+ | {
20
23
  value: string;
21
24
  label: string;
22
25
  enabled?: boolean;
@@ -28,7 +31,8 @@ export type LinkTypeFieldOption = {
28
31
  label?: string;
29
32
  value: string;
30
33
  }) => void) => void;
31
- } | {
34
+ }
35
+ | {
32
36
  type: 'separator';
33
37
  };
34
38
 
@@ -29,9 +29,16 @@ export type AppearanceConfig = {
29
29
  theme?: ThemeNamePlusLightDark | ThemeExtension;
30
30
  };
31
31
 
32
- export type ThemeName = 'classic_light' | 'classic_dark' | 'modern_light' | 'modern_dark';
32
+ export type ThemeName =
33
+ | 'classic_light'
34
+ | 'classic_dark'
35
+ | 'modern_light'
36
+ | 'modern_dark';
33
37
 
34
- export type ThemeNamePlusLightDark = ThemeName | 'light' | 'dark';
38
+ export type ThemeNamePlusLightDark =
39
+ | ThemeName
40
+ | 'light'
41
+ | 'dark';
35
42
 
36
43
  export type Theme = {
37
44
  name: ThemeName;
@@ -739,20 +746,112 @@ export type Theme = {
739
746
  };
740
747
  };
741
748
 
742
- export type ThemeVariant = 'primary' | 'secondary' | 'tertiary'
749
+ export type ThemeVariant =
750
+ | 'primary'
751
+ | 'secondary'
752
+ | 'tertiary'
743
753
  /** Tertiary's inverse: where `tertiary` sits AT the page's tonal floor
744
754
  * (dark surface in dark mode, light surface in light mode), this one
745
755
  * sits AT the ceiling — a light surface with dark text in dark mode,
746
756
  * a dark surface with light text in light mode. Used for follow-up
747
757
  * chips (suggest_options pills) that need to read as distinct from
748
758
  * the surrounding chat bubble without shouting like `primary`. */
749
- | 'tertiary_inverse' | 'ai' | 'ai_outline' | 'danger' | 'synced_blocks';
759
+ | 'tertiary_inverse'
760
+ | 'ai'
761
+ | 'ai_outline'
762
+ | 'danger'
763
+ | 'synced_blocks';
750
764
 
751
- export type BannerMessageVariant = 'success' | 'warning' | 'default' | 'danger';
765
+ export type BannerMessageVariant =
766
+ | 'success'
767
+ | 'warning'
768
+ | 'default'
769
+ | 'danger';
752
770
 
753
- type ToastVariant = 'success' | 'warning' | 'default' | 'danger';
771
+ type ToastVariant =
772
+ | 'success'
773
+ | 'warning'
774
+ | 'default'
775
+ | 'danger';
754
776
 
755
- export type ThemeColor = 'accent_01' | 'accent_02' | 'accent_03' | 'accent_04' | 'accent_05' | 'ai_01' | 'ai_02' | 'ai_03' | 'ai_04' | 'ai_05' | 'amp_01' | 'black_00' | 'black_01' | 'black_02' | 'black_03' | 'black_04' | 'black_05' | 'black_06' | 'black_07' | 'black_08' | 'black_09' | 'black_10' | 'destructive_01' | 'destructive_02' | 'destructive_03' | 'destructive_04' | 'destructive_05' | 'destructive_06' | 'destructive_07' | 'destructive_08' | 'destructive_09' | 'primary_01' | 'primary_02' | 'primary_03' | 'primary_04' | 'primary_05' | 'primary_06' | 'primary_07' | 'primary_08' | 'primary_09' | 'primary_10' | 'primary_11' | 'red_01' | 'success_01' | 'success_02' | 'success_03' | 'success_04' | 'success_05' | 'success_06' | 'success_07' | 'success_08' | 'success_09' | 'sync_01' | 'sync_02' | 'sync_03' | 'sync_04' | 'sync_05' | 'transparent' | 'warning_01' | 'warning_02' | 'warning_03' | 'warning_04' | 'warning_05' | 'warning_06' | 'warning_07' | 'warning_08' | 'warning_09' | 'white_00' | 'white_01' | 'white_02' | 'white_03' | 'white_04' | 'white_05' | 'white_06' | 'white_07' | 'white_08' | 'white_09';
777
+ export type ThemeColor =
778
+ | 'accent_01'
779
+ | 'accent_02'
780
+ | 'accent_03'
781
+ | 'accent_04'
782
+ | 'accent_05'
783
+ | 'ai_01'
784
+ | 'ai_02'
785
+ | 'ai_03'
786
+ | 'ai_04'
787
+ | 'ai_05'
788
+ | 'amp_01'
789
+ | 'black_00'
790
+ | 'black_01'
791
+ | 'black_02'
792
+ | 'black_03'
793
+ | 'black_04'
794
+ | 'black_05'
795
+ | 'black_06'
796
+ | 'black_07'
797
+ | 'black_08'
798
+ | 'black_09'
799
+ | 'black_10'
800
+ | 'destructive_01'
801
+ | 'destructive_02'
802
+ | 'destructive_03'
803
+ | 'destructive_04'
804
+ | 'destructive_05'
805
+ | 'destructive_06'
806
+ | 'destructive_07'
807
+ | 'destructive_08'
808
+ | 'destructive_09'
809
+ | 'primary_01'
810
+ | 'primary_02'
811
+ | 'primary_03'
812
+ | 'primary_04'
813
+ | 'primary_05'
814
+ | 'primary_06'
815
+ | 'primary_07'
816
+ | 'primary_08'
817
+ | 'primary_09'
818
+ | 'primary_10'
819
+ | 'primary_11'
820
+ | 'red_01'
821
+ | 'success_01'
822
+ | 'success_02'
823
+ | 'success_03'
824
+ | 'success_04'
825
+ | 'success_05'
826
+ | 'success_06'
827
+ | 'success_07'
828
+ | 'success_08'
829
+ | 'success_09'
830
+ | 'sync_01'
831
+ | 'sync_02'
832
+ | 'sync_03'
833
+ | 'sync_04'
834
+ | 'sync_05'
835
+ | 'transparent'
836
+ | 'warning_01'
837
+ | 'warning_02'
838
+ | 'warning_03'
839
+ | 'warning_04'
840
+ | 'warning_05'
841
+ | 'warning_06'
842
+ | 'warning_07'
843
+ | 'warning_08'
844
+ | 'warning_09'
845
+ | 'white_00'
846
+ | 'white_01'
847
+ | 'white_02'
848
+ | 'white_03'
849
+ | 'white_04'
850
+ | 'white_05'
851
+ | 'white_06'
852
+ | 'white_07'
853
+ | 'white_08'
854
+ | 'white_09';
756
855
 
757
856
  export type ThemeExtension = {
758
857
  name: string;
@@ -763,7 +862,12 @@ export type ThemeExtension = {
763
862
  components?: DeepPartial<Theme['components']>;
764
863
  };
765
864
 
766
- export type BorderRadius = 'none' | 'min' | 'mid' | 'max' | 'full';
865
+ export type BorderRadius =
866
+ | 'none'
867
+ | 'min'
868
+ | 'mid'
869
+ | 'max'
870
+ | 'full';
767
871
 
768
872
  export type ButtonThemeObject = {
769
873
  backgroundColor: ColorValue;
@@ -775,7 +879,11 @@ export type ButtonThemeObject = {
775
879
 
776
880
  export type BorderRadiusValue = `{${BorderRadius}}`;
777
881
 
778
- export type ColorValue = `{${ThemeColor}}` | `darken(${number}%, {${ThemeColor}})` | `fade(${number}%, {${ThemeColor}})` | `lighten(${number}%, {${ThemeColor}})`;
882
+ export type ColorValue =
883
+ | `{${ThemeColor}}`
884
+ | `darken(${number}%, {${ThemeColor}})`
885
+ | `fade(${number}%, {${ThemeColor}})`
886
+ | `lighten(${number}%, {${ThemeColor}})`;
779
887
 
780
888
  // ───────────────────────────────────────────────────────────────────────────
781
889
  // Features
@@ -15,20 +15,39 @@ export interface ExporterConfig {
15
15
  cdnBaseUrl?: string;
16
16
  }
17
17
 
18
- export type Device = 'desktop' | 'mobile' | 'tablet';
18
+ export type Device =
19
+ | 'desktop'
20
+ | 'mobile'
21
+ | 'tablet';
19
22
 
20
23
  export type Resolution = {
21
24
  value: number;
22
25
  name: string;
23
26
  };
24
27
 
25
- export type DisplayMode = 'email' | 'web' | 'popup' | 'document';
28
+ export type DisplayMode =
29
+ | 'email'
30
+ | 'web'
31
+ | 'popup'
32
+ | 'document';
26
33
 
27
- export type Variant = 'amp' | null;
34
+ export type Variant =
35
+ | 'amp'
36
+ | null;
28
37
 
29
- export type UndoRedoBehavior = 'save' | 'replace' | 'skip';
38
+ export type UndoRedoBehavior =
39
+ | 'save'
40
+ | 'replace'
41
+ | 'skip';
30
42
 
31
- export type Collection = 'pages' | 'bodies' | 'rows' | 'headers' | 'footers' | 'columns' | 'contents';
43
+ export type Collection =
44
+ | 'pages'
45
+ | 'bodies'
46
+ | 'rows'
47
+ | 'headers'
48
+ | 'footers'
49
+ | 'columns'
50
+ | 'contents';
32
51
 
33
52
  export interface Location {
34
53
  collection: Collection;
@@ -111,30 +130,36 @@ export interface AIAssistantRequestParams extends AIAssistantEventContext {
111
130
  * only when the editor owns generation (not when the host registered
112
131
  * `ai:assistant:generate`, since the host has its own pipeline then). */
113
132
 
114
- export type AIAssistantStreamEvent = {
133
+ export type AIAssistantStreamEvent =
134
+ | {
115
135
  type: 'start';
116
136
  attempt: number;
117
137
  messageId?: string;
118
138
  provider?: string;
119
139
  modelId?: string;
120
140
  toolType?: string | null;
121
- } | {
141
+ }
142
+ | {
122
143
  type: 'status';
123
144
  text: string;
124
- } | {
145
+ }
146
+ | {
125
147
  type: 'text-delta';
126
148
  delta: string;
127
149
  blockId?: string;
128
- } | {
150
+ }
151
+ | {
129
152
  type: 'suggest-options';
130
153
  options: Array<{
131
154
  label: string;
132
155
  prompt: string;
133
156
  }>;
134
- } | {
157
+ }
158
+ | {
135
159
  type: 'design-partial';
136
160
  full: object;
137
- } | {
161
+ }
162
+ | {
138
163
  type: 'design-operation';
139
164
  op: Record<string, any>;
140
165
  };
@@ -158,7 +183,10 @@ export interface AIAssistantGenerateResult {
158
183
  usage?: AIAssistantUsage;
159
184
  }
160
185
 
161
- export type CreditPurchaseHandlerResult = CreditPurchaseResult | Promise<CreditPurchaseResult | void> | void;
186
+ export type CreditPurchaseHandlerResult =
187
+ | CreditPurchaseResult
188
+ | Promise<CreditPurchaseResult | void>
189
+ | void;
162
190
 
163
191
  export interface CallbackContext {
164
192
  item: {
@@ -173,7 +201,10 @@ export interface CallbackContext {
173
201
  };
174
202
  }
175
203
 
176
- export type InboxPreviewViewSource = 'automatic' | 'gallery_click' | 'navigation';
204
+ export type InboxPreviewViewSource =
205
+ | 'automatic'
206
+ | 'gallery_click'
207
+ | 'navigation';
177
208
  /** A completed Inbox Preview screenshot that became visible to the user. */
178
209
 
179
210
  export interface InboxPreviewViewedEvent {
@@ -197,6 +228,8 @@ export interface InboxPreviewViewedEvent {
197
228
 
198
229
  export interface CallbackTypeMap<TDisplayMode extends DisplayMode | undefined = undefined> {
199
230
  'editor:ready': () => void;
231
+ 'text-editor:ready': () => void;
232
+ /** @deprecated Use text-editor:ready instead */
200
233
  'textEditor:ready': () => void;
201
234
  'design:loaded': (data: {
202
235
  design: JSONTemplate<TDisplayMode>;
@@ -229,6 +262,8 @@ export interface CallbackTypeMap<TDisplayMode extends DisplayMode | undefined =
229
262
  item: Record<string, any>;
230
263
  active: boolean;
231
264
  }) => void;
265
+ 'inbox-previews:viewed': (data: InboxPreviewViewedEvent) => void;
266
+ /** @deprecated Use inbox-previews:viewed instead */
232
267
  'inboxPreview:viewed': (data: InboxPreviewViewedEvent) => void;
233
268
  'page:added': (data: {
234
269
  page: Record<string, any>;
@@ -423,4 +458,11 @@ export interface CallbackTypeMap<TDisplayMode extends DisplayMode | undefined =
423
458
  }) => void;
424
459
  }
425
460
 
426
- export type ExporterName = "email" | "web" | "popup" | "document" | "classic" | "ampWeb" | "ampEmail";
461
+ export type ExporterName =
462
+ | "email"
463
+ | "web"
464
+ | "popup"
465
+ | "document"
466
+ | "classic"
467
+ | "ampWeb"
468
+ | "ampEmail";
@@ -85,4 +85,6 @@ export interface OptionGroup<T> {
85
85
  options: OptionItem<T>[];
86
86
  }
87
87
 
88
- export type OptionItem<T> = T | OptionGroup<T>;
88
+ export type OptionItem<T> =
89
+ | T
90
+ | OptionGroup<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unlayer/types",
3
- "version": "1.489.0",
3
+ "version": "1.491.0",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "types": "./dist/index.d.ts",
@@ -39,7 +39,7 @@
39
39
  "build:legacy-unlayer-types": "cd ../../packages/editor/src/embed; pnpm exec tsc > /dev/null; cd ../../../../packages/unlayer-types; mkdir -p ../../packages/unlayer-types/__generated__/; cp -r ../../packages/editor/src/embed/__generated__/embed.d.ts ../../packages/unlayer-types/__generated__/legacy-unlayer-types.d.ts",
40
40
  "test": "pnpm run test:types && pnpm run test:unit",
41
41
  "test:types": "node scripts/test-types.js",
42
- "test:unit": "echo \"SKIP unit tests: no test files in this workspace\"",
42
+ "test:unit": "pnpm exec jest --runInBand",
43
43
  "typecheck": "pnpm run build && tsc --noEmit --project tests/tsconfig.json",
44
44
  "release": "node scripts/release.js"
45
45
  },