unlayer-types 1.5.70 → 1.6.2

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 (2) hide show
  1. package/embed.d.ts +381 -45
  2. package/package.json +1 -1
package/embed.d.ts CHANGED
@@ -121,7 +121,13 @@ declare module "editor/components/editors/types" {
121
121
  stockImages?: boolean;
122
122
  uploadMaxSize?: number;
123
123
  };
124
- item: object;
124
+ item: {
125
+ id: string;
126
+ type?: string;
127
+ slug?: string;
128
+ location?: Location;
129
+ values?: Record<string, any>;
130
+ };
125
131
  project: object;
126
132
  onImageClick?: (url: string) => void;
127
133
  }
@@ -183,15 +189,15 @@ declare module "editor/components/editors/types" {
183
189
  } : T;
184
190
  }
185
191
  declare module "state/types/index" {
192
+ import * as Ariakit from '@ariakit/react';
186
193
  import { MutableRefObject, ReactInstance } from 'react';
187
- import { InputType } from 'reactstrap/lib/Input';
188
194
  import { State as Design } from '../../state/reducer/design';
189
195
  import { CollaborationThread } from "editor/components/editors/types";
196
+ import { Theme } from '../../editor/themes/types';
190
197
  export type DesignMode = 'live' | 'edit';
198
+ export type Device = 'desktop' | 'mobile' | 'tablet';
191
199
  export type DisplayMode = 'web' | 'email' | 'popup' | 'document';
192
200
  export type Variant = 'amp' | null;
193
- export type Device = 'desktop' | 'mobile' | 'tablet';
194
- export type Theme = 'light' | 'dark';
195
201
  export type Ui = 'none' | 'visual' | 'classic';
196
202
  export interface MergeTag {
197
203
  name: string;
@@ -249,7 +255,7 @@ declare module "state/types/index" {
249
255
  defaultValue?: string | LinkTypeFieldOption[] | undefined;
250
256
  enabled?: boolean;
251
257
  placeholderText?: string;
252
- inputType?: InputType;
258
+ inputType?: Ariakit.FormInputProps['type'];
253
259
  isClearable?: boolean;
254
260
  isCreatable?: boolean;
255
261
  isMulti?: boolean;
@@ -391,7 +397,7 @@ declare module "state/types/index" {
391
397
  };
392
398
  export type Rule = {
393
399
  id: string;
394
- icon: string | undefined;
400
+ icon: string | string[] | undefined;
395
401
  title: string;
396
402
  description: string;
397
403
  severity: 'ERROR' | 'WARNING';
@@ -443,21 +449,29 @@ declare module "state/types/index" {
443
449
  }[];
444
450
  };
445
451
  export type AppearanceConfig = {
446
- theme: Theme;
447
- panels: {
448
- tools: {
449
- dock: 'left' | 'right';
450
- collapsible: boolean;
451
- tabs: {
452
- body: {
453
- visible: boolean;
452
+ actionBar?: {
453
+ placement?: 'top' | 'bottom' | 'top_left' | 'top_right' | 'bottom_left' | 'bottom_right' | undefined;
454
+ };
455
+ features?: {
456
+ preview?: boolean;
457
+ };
458
+ loader?: {
459
+ url?: string | undefined;
460
+ html?: string | undefined;
461
+ css?: string | undefined;
462
+ };
463
+ panels?: {
464
+ tools?: {
465
+ dock?: 'left' | 'right';
466
+ collapsible?: boolean;
467
+ tabs?: {
468
+ body?: {
469
+ visible?: boolean;
454
470
  };
455
471
  };
456
472
  };
457
473
  };
458
- features: {
459
- preview: boolean;
460
- };
474
+ theme?: Theme['name'] | 'light' | 'dark';
461
475
  };
462
476
  export interface ToolConfig {
463
477
  enabled?: boolean | undefined;
@@ -481,6 +495,7 @@ declare module "embed/Config" {
481
495
  import { FontList } from "engine/config/fonts";
482
496
  import { TextDirection } from "engine/config/intl";
483
497
  import { AppearanceConfig, Audit, Device, DisplayConditions, DisplayMode, Fonts, JSONTemplate, LinkTypes, LinkTypesSharedConfig, MergeTags, MergeTagsConfig, MergeTagsValues, SpecialLinks, Tabs, ToolsConfig, User } from "state/types/index";
498
+ import { DeepPartial } from "editor/components/editors/types";
484
499
  export interface Config {
485
500
  id?: string;
486
501
  className?: string;
@@ -522,7 +537,7 @@ declare module "embed/Config" {
522
537
  locale?: string;
523
538
  textDirection?: TextDirection;
524
539
  translations?: object;
525
- appearance?: AppearanceConfig;
540
+ appearance?: DeepPartial<AppearanceConfig>;
526
541
  features?: object;
527
542
  designTagsConfig?: object;
528
543
  mergeTagsConfig?: MergeTagsConfig;
@@ -657,12 +672,15 @@ declare module "embed/Frame" {
657
672
  }
658
673
  declare module "editor/components/common/Modal" {
659
674
  import React from 'react';
660
- import _Modal from 'react-modal';
661
- type Props = _Modal['props'] & {
662
- className?: string;
675
+ import { Props as ReactModalProps } from 'react-modal';
676
+ export interface ModalProps extends Omit<ReactModalProps, 'style'> {
663
677
  children: React.ReactNode;
664
- };
665
- export function Modal(_props: Props): JSX.Element;
678
+ className?: string;
679
+ contentStyle?: React.CSSProperties;
680
+ innerContentStyle?: React.CSSProperties;
681
+ overlayStyle?: React.CSSProperties;
682
+ }
683
+ export function Modal(props: ModalProps): JSX.Element;
666
684
  }
667
685
  declare module "editor/components/common/ConditionalWrap" {
668
686
  import React from 'react';
@@ -759,6 +777,7 @@ declare module "engine/utils/position" {
759
777
  export function normalizePosition(position: 'top' | 'top-left' | 'top-center' | 'top-right' | 'center' | 'center-left' | 'center-center' | 'center-right' | 'center-top' | 'center-bottom' | 'bottom' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'left' | 'left-top' | 'left-center' | 'left-bottom' | 'right' | 'right-top' | 'right-center' | 'right-bottom' | 'custom' | undefined): Position | undefined;
760
778
  }
761
779
  declare module "editor/components/editors/PositionEditor" {
780
+ import React from 'react';
762
781
  import { EditorProps } from "editor/components/editors/types";
763
782
  import { Position } from "engine/utils/position";
764
783
  export type PositionEditorValue = Position | 'custom';
@@ -770,20 +789,143 @@ declare module "editor/components/editors/PositionEditor" {
770
789
  className?: string;
771
790
  itemSize?: number;
772
791
  spacing?: number;
792
+ style?: React.CSSProperties;
773
793
  valueLabelPosition?: 'left' | 'right' | 'none';
774
794
  }): JSX.Element;
775
795
  }
776
796
  declare module "editor/hooks/useDynamicRef" {
777
797
  export function useDynamicRef<T>(value: T): import("react").MutableRefObject<T>;
778
798
  }
779
- declare module "editor/components/editors/common/Counter" {
799
+ declare module "editor/design-system/components/Input" {
800
+ import React from 'react';
801
+ import * as Ariakit from '@ariakit/react';
802
+ export interface InputProps extends Omit<Ariakit.FormInputProps, 'as'> {
803
+ formStore?: Ariakit.FormStore<{
804
+ value: string;
805
+ }>;
806
+ label?: React.ReactNode;
807
+ labelPosition?: 'top' | 'left' | 'right';
808
+ name: string;
809
+ placeholder?: string;
810
+ required?: boolean;
811
+ type?: Ariakit.FormInputProps['type'] | 'textarea';
812
+ validationMessage?: string;
813
+ validationStatus?: 'error' | 'warn' | 'success';
814
+ value: Ariakit.FormInputProps['value'];
815
+ }
816
+ export const Input: React.ForwardRefExoticComponent<Pick<InputProps, keyof InputProps> & React.RefAttributes<HTMLInputElement>>;
817
+ export const S: {
818
+ Form: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
819
+ FormInputGroup: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
820
+ FormLabel: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
821
+ FormInput: import("styled-components").StyledComponent<any, any, object, string | number | symbol>;
822
+ Message: import("styled-components").StyledComponent<"div", any, {}, never>;
823
+ };
824
+ }
825
+ declare module "editor/design-system/components/Button" {
826
+ import React from 'react';
827
+ import * as Ariakit from '@ariakit/react';
828
+ import { Theme } from '../../themes/types';
829
+ export interface ButtonProps extends Ariakit.ButtonProps {
830
+ children: React.ReactNode;
831
+ circle?: boolean;
832
+ className?: string;
833
+ danger?: boolean;
834
+ disabled?: boolean;
835
+ loading?: boolean;
836
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
837
+ size?: number | 'auto';
838
+ style?: React.CSSProperties;
839
+ variant?: keyof Theme['components']['buttons'];
840
+ type?: Ariakit.ButtonProps['type'];
841
+ id?: string;
842
+ }
843
+ export const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<unknown>>;
844
+ }
845
+ declare module "editor/design-system/components/Tooltip" {
846
+ import React from 'react';
847
+ import * as Ariakit from '@ariakit/react';
848
+ export interface TooltipProps {
849
+ arrow?: boolean;
850
+ children: Ariakit.TooltipAnchorProps['children'];
851
+ className?: string;
852
+ disabled?: boolean;
853
+ placement: Ariakit.TooltipStoreProps['placement'];
854
+ style?: React.CSSProperties;
855
+ timeout?: number;
856
+ tooltip: Ariakit.TooltipProps['children'];
857
+ tooltipWrapper?: Ariakit.TooltipAnchorProps['render'];
858
+ }
859
+ export function Tooltip(props: TooltipProps): JSX.Element;
860
+ }
861
+ declare module "editor/design-system/components/Dropdown" {
780
862
  import React from 'react';
781
- export interface CounterProps {
863
+ import * as Ariakit from '@ariakit/react';
864
+ import { IconDefinition } from '@fortawesome/pro-regular-svg-icons';
865
+ export interface SelectOption {
866
+ icon?: IconDefinition;
867
+ label: string;
868
+ value: any;
869
+ tooltip?: string;
870
+ meta?: Record<string, unknown>;
871
+ onClick?: (e: React.MouseEvent, selected: boolean) => void;
872
+ selected: boolean;
873
+ disabled?: boolean;
874
+ toggle?: boolean;
875
+ attrs?: Record<string, string | number | boolean | undefined>;
876
+ }
877
+ export interface SelectOptionGroup {
878
+ name?: string;
879
+ label?: string;
880
+ icon?: IconDefinition;
881
+ options: SelectOption[];
882
+ meta?: object;
883
+ }
884
+ export type DropdownProps = {
885
+ ariaLabel?: string;
886
+ asLink?: boolean;
887
+ badge?: number;
888
+ className?: string;
889
+ caret?: boolean;
890
+ disabled?: boolean;
891
+ fallbackLabel?: string;
892
+ label?: React.ReactNode;
893
+ multi?: boolean;
894
+ triggerLabel?: string | React.ReactNode;
895
+ placement?: Ariakit.PopoverStoreState['placement'];
896
+ onChange?: (option: SelectOption) => void;
897
+ onClose?: () => void;
898
+ onOpen?: () => void;
899
+ renderButton?: Ariakit.SelectProps['render'];
900
+ renderFooter?: () => React.ReactNode;
901
+ renderHeader?: () => React.ReactNode;
902
+ style?: React.CSSProperties;
903
+ customPopoverStyles?: React.CSSProperties;
904
+ } & ({
905
+ renderOption?: (option: SelectOption) => React.ReactNode;
906
+ renderOptionLabel?: never;
907
+ } | {
908
+ renderOption?: never;
909
+ renderOptionLabel?: (option: SelectOption) => React.ReactNode;
910
+ }) & ({
911
+ options?: never;
912
+ groupedOptions?: SelectOptionGroup[];
913
+ renderOptionGroupHeader?: (optionGroup: SelectOptionGroup) => React.ReactNode;
914
+ } | {
915
+ options?: SelectOption[];
916
+ groupedOptions?: never;
917
+ renderOptionGroupHeader?: never;
918
+ });
919
+ export function Dropdown(props: DropdownProps): JSX.Element;
920
+ }
921
+ declare module "editor/design-system/components/CounterInput" {
922
+ import { DisplayMode } from '../../../state/types';
923
+ export interface CounterInputProps {
782
924
  absoluteBaseValue?: number;
783
925
  buttonSize?: 'lg' | 'md' | 'sm' | undefined;
784
- children?: React.ReactNode;
785
926
  defaultUnit?: string;
786
927
  disabled?: boolean;
928
+ displayMode: DisplayMode;
787
929
  maxValue?: number | null;
788
930
  minValue?: number | null;
789
931
  onChange: (value: number | string) => void;
@@ -793,6 +935,12 @@ declare module "editor/components/editors/common/Counter" {
793
935
  units?: string[];
794
936
  value: number | string;
795
937
  }
938
+ export default function CounterInput(props: CounterInputProps): JSX.Element;
939
+ }
940
+ declare module "editor/components/editors/common/Counter" {
941
+ import { CounterInputProps } from "editor/design-system/components/CounterInput";
942
+ export interface CounterProps extends Omit<CounterInputProps, 'displayMode'> {
943
+ }
796
944
  export default function Counter(props: CounterProps): JSX.Element;
797
945
  }
798
946
  declare module "engine/utils/sizeUtils" {
@@ -889,6 +1037,28 @@ declare module "engine/utils/applyMergeTagPreviewHtmlToText" {
889
1037
  }): string;
890
1038
  export const applyMergeTagPreviewHtmlToText: typeof _applyMergeTagPreviewHtmlToText & import("lodash").MemoizedFunction;
891
1039
  }
1040
+ declare module "editor/design-system/components/SegmentedControl" {
1041
+ import React from 'react';
1042
+ import { IconDefinition } from '@fortawesome/pro-regular-svg-icons';
1043
+ export interface SegmentedControlItem {
1044
+ key?: string;
1045
+ icon?: IconDefinition;
1046
+ label?: string;
1047
+ onClick?: (e: React.MouseEvent) => void;
1048
+ selected?: boolean;
1049
+ disabled?: boolean;
1050
+ tooltip?: string;
1051
+ meta?: object;
1052
+ }
1053
+ export interface SegmentedControlProps {
1054
+ autoFocus?: boolean;
1055
+ className?: string;
1056
+ disabled?: boolean;
1057
+ items: SegmentedControlItem[];
1058
+ renderLabel?: (item: SegmentedControlItem) => React.ReactNode;
1059
+ }
1060
+ export function SegmentedControl(props: SegmentedControlProps): JSX.Element;
1061
+ }
892
1062
  declare module "state/types/RootState" {
893
1063
  import { StateType } from 'typesafe-actions';
894
1064
  import reducer from '../reducer';
@@ -967,8 +1137,8 @@ declare module "editor/hooks/useImageUploader" {
967
1137
  }
968
1138
  declare module "editor/components/common/ImageUploadButton" {
969
1139
  import React from 'react';
970
- import { ButtonProps } from 'reactstrap';
971
1140
  import { ImageSource } from '../../../state/types';
1141
+ import { ButtonProps } from "editor/design-system/components/Button";
972
1142
  export interface ImageUploadButtonInstance {
973
1143
  clearError: () => void;
974
1144
  openPicker: () => void;
@@ -1000,6 +1170,17 @@ declare module "editor/components/common/ImageUploadButton" {
1000
1170
  declare module "engine/tools/content/image" {
1001
1171
  export const DEFAULT_IMAGE_PLACEHOLDER = "https://cdn.tools.unlayer.com/image/placeholder.png";
1002
1172
  }
1173
+ declare module "editor/design-system/components/Progress" {
1174
+ export interface ProgressBarProps {
1175
+ progress: number;
1176
+ className?: string;
1177
+ color?: string;
1178
+ backgroundColor?: string;
1179
+ height?: string;
1180
+ animationDuration?: number;
1181
+ }
1182
+ export function Progress(props: ProgressBarProps): JSX.Element;
1183
+ }
1003
1184
  declare module "editor/components/common/Dropzone" {
1004
1185
  import React from 'react';
1005
1186
  import { DropzoneOptions } from 'react-dropzone';
@@ -1014,7 +1195,7 @@ declare module "editor/components/common/Dropzone" {
1014
1195
  onEffectsClick?: () => void;
1015
1196
  isEffectsButtonDisabled?: boolean;
1016
1197
  showImageInfo?: boolean;
1017
- shouldRenderDropzone: boolean;
1198
+ shouldRenderDropzone?: boolean;
1018
1199
  isNotImageTool?: boolean;
1019
1200
  }
1020
1201
  export function Dropzone(props: DropzoneProps): JSX.Element;
@@ -1034,8 +1215,8 @@ declare module "editor/components/common/ImageUploadErrorMessage" {
1034
1215
  }
1035
1216
  declare module "editor/components/editors/ImageUploader" {
1036
1217
  import { RefObject } from 'react';
1037
- import { ImageUploadButtonInstance } from "editor/components/common/ImageUploadButton";
1038
1218
  import { DropEvent, FileRejection } from 'react-dropzone';
1219
+ import { ImageUploadButtonInstance } from "editor/components/common/ImageUploadButton";
1039
1220
  interface ImageUploaderProps {
1040
1221
  shouldRender: {
1041
1222
  uploadButton?: boolean;
@@ -1062,8 +1243,44 @@ declare module "editor/components/editors/ImageUploader" {
1062
1243
  onUploadStatusChange: (image: any) => void;
1063
1244
  onErrorChange: (error: Error | null) => void;
1064
1245
  imageUploadButtonRef: RefObject<ImageUploadButtonInstance>;
1246
+ showError?: boolean;
1065
1247
  }
1066
- export const ImageUploader: ({ shouldRender, label, maxSize, updateImage, showImagesDropdown, showUploadsDropdown, intl, onDropAccepted, onDropRejected, isUploading, uploadProgress, postprocessedImageUrl, togglePixieModal, imageExists, error, onImageSelect, onImageUpload, onUploadProgressChange, onUploadStatusChange, onErrorChange, imageUploadButtonRef, ...restProps }: ImageUploaderProps) => JSX.Element;
1248
+ export const ImageUploader: ({ shouldRender, label, maxSize, updateImage, showImagesDropdown, showUploadsDropdown, intl, onDropAccepted, onDropRejected, isUploading, uploadProgress, postprocessedImageUrl, togglePixieModal, imageExists, error, onImageSelect, onImageUpload, onUploadProgressChange, onUploadStatusChange, onErrorChange, imageUploadButtonRef, showError, ...restProps }: ImageUploaderProps) => JSX.Element;
1249
+ }
1250
+ declare module "editor/themes/helpers" {
1251
+ import { Theme } from './types';
1252
+ export function parseThemeValues<T extends Theme>(theme: T): T;
1253
+ }
1254
+ declare module "editor/themes/modern/light" {
1255
+ import { DeprecatedTheme, Theme } from '../types';
1256
+ export const unparsedTheme: Theme & DeprecatedTheme;
1257
+ export const parsedTheme: Theme & DeprecatedTheme;
1258
+ }
1259
+ declare module "editor/themes/classic/light" {
1260
+ export const unparsedTheme: any;
1261
+ export const parsedTheme: any;
1262
+ }
1263
+ declare module "editor/themes/modern/dark" {
1264
+ import { DeprecatedTheme, Theme } from '../types';
1265
+ export const unparsedTheme: Theme & DeprecatedTheme;
1266
+ export const parsedTheme: Theme & DeprecatedTheme;
1267
+ }
1268
+ declare module "editor/themes/classic/dark" {
1269
+ export const unparsedTheme: any;
1270
+ export const parsedTheme: any;
1271
+ }
1272
+ declare module "editor/themes/index" {
1273
+ const themes: {
1274
+ classic_light: any;
1275
+ classic_dark: any;
1276
+ modern_light: import("editor/themes/types").Theme & import("editor/themes/types").DeprecatedTheme;
1277
+ modern_dark: import("editor/themes/types").Theme & import("editor/themes/types").DeprecatedTheme;
1278
+ };
1279
+ export default themes;
1280
+ }
1281
+ declare module "editor/hooks/useTheme" {
1282
+ import { DeprecatedTheme, Theme } from '../themes/types';
1283
+ export function useTheme(): Theme & DeprecatedTheme;
1067
1284
  }
1068
1285
  declare module "editor/components/editors/pixie/pixie.umd" {
1069
1286
  const _exports: {
@@ -1094,21 +1311,136 @@ declare module "editor/components/editors/pixie/pixie.umd" {
1094
1311
  };
1095
1312
  export = _exports;
1096
1313
  }
1314
+ declare module "editor/design-system/components/ToggleSwitch" {
1315
+ import React from 'react';
1316
+ export interface ToggleSwitchProps {
1317
+ children?: React.ReactNode;
1318
+ className?: string;
1319
+ disabled?: boolean;
1320
+ isChecked: boolean;
1321
+ left?: React.ReactNode;
1322
+ onChange: (isChecked: boolean) => void;
1323
+ right?: React.ReactNode;
1324
+ size?: number;
1325
+ style?: React.CSSProperties;
1326
+ }
1327
+ export const ToggleSwitch: React.ForwardRefExoticComponent<ToggleSwitchProps & React.RefAttributes<HTMLLabelElement>>;
1328
+ }
1329
+ declare module "editor/design-system/components/Bar" {
1330
+ import React, { ReactNode } from 'react';
1331
+ import { IconDefinition } from '@fortawesome/pro-regular-svg-icons';
1332
+ import { TooltipProps } from "editor/design-system/components/Tooltip";
1333
+ export const BAR_HEIGHT = 40;
1334
+ export const BAR_ITEM_WIDTH = 50;
1335
+ export const BAR_ITEM_COMPACT_WIDTH = 30;
1336
+ export interface SelectOption {
1337
+ icon?: IconDefinition;
1338
+ label: string;
1339
+ value: any;
1340
+ tooltip?: string;
1341
+ meta?: object;
1342
+ onClick?: (e: React.MouseEvent, selected: boolean) => void;
1343
+ selected?: boolean;
1344
+ toggle?: boolean;
1345
+ }
1346
+ export interface SelectOptionGroup {
1347
+ name?: string;
1348
+ label?: string;
1349
+ icon?: IconDefinition;
1350
+ options: SelectOption[];
1351
+ meta?: object;
1352
+ }
1353
+ export interface BarTitleItem {
1354
+ key: string;
1355
+ type: 'title' | 'subtitle';
1356
+ icon?: IconDefinition;
1357
+ text: string;
1358
+ tooltip?: string;
1359
+ badge?: number;
1360
+ loading?: boolean;
1361
+ }
1362
+ export interface BarButtonItem {
1363
+ key: string;
1364
+ type: 'button';
1365
+ id?: string;
1366
+ icon: IconDefinition | undefined;
1367
+ label?: string;
1368
+ tooltip?: string;
1369
+ badge?: number;
1370
+ onClick?: (e: React.MouseEvent) => void;
1371
+ destructive?: boolean;
1372
+ disabled?: boolean;
1373
+ loading?: boolean;
1374
+ selected?: boolean;
1375
+ highlighted?: boolean;
1376
+ autoFocus?: boolean;
1377
+ }
1378
+ export interface BarToggleItem {
1379
+ key: string;
1380
+ type: 'toggle';
1381
+ icon: IconDefinition;
1382
+ tooltip?: string;
1383
+ label?: string;
1384
+ badge?: number;
1385
+ onClick?: (e: React.MouseEvent) => void;
1386
+ onChange: (enabled: boolean) => void;
1387
+ disabled?: boolean;
1388
+ checked?: boolean;
1389
+ selected?: boolean;
1390
+ highlighted?: boolean;
1391
+ autoFocus?: boolean;
1392
+ error: ReactNode;
1393
+ }
1394
+ type BarDropdownItem = {
1395
+ key: string;
1396
+ type: 'dropdown';
1397
+ ariaLabel?: string;
1398
+ multi?: boolean;
1399
+ renderOption?: (option: SelectOption) => React.ReactNode;
1400
+ renderOptionLabel?: (option: SelectOption) => React.ReactNode;
1401
+ onChange?: (option: SelectOption) => void;
1402
+ badge?: number;
1403
+ disabled?: boolean;
1404
+ tooltip?: string;
1405
+ triggerLabel?: string | React.ReactNode;
1406
+ caret?: boolean;
1407
+ renderHeader?: () => React.ReactNode;
1408
+ } & ({
1409
+ options?: never;
1410
+ groupedOptions?: SelectOptionGroup[];
1411
+ renderOptionGroupHeader?: (optionGroup: SelectOptionGroup) => React.ReactNode;
1412
+ } | {
1413
+ options?: SelectOption[];
1414
+ groupedOptions?: never;
1415
+ renderOptionGroupHeader?: never;
1416
+ });
1417
+ export interface BarSeparatorItem {
1418
+ type: 'separator';
1419
+ }
1420
+ export type BarItem = BarTitleItem | BarButtonItem | BarToggleItem | BarDropdownItem | BarSeparatorItem | false | undefined;
1421
+ export interface BarProps {
1422
+ as?: any;
1423
+ className?: string;
1424
+ compact?: boolean;
1425
+ leftItems?: BarItem[];
1426
+ items?: BarItem[];
1427
+ rightItems?: BarItem[];
1428
+ style?: React.CSSProperties;
1429
+ tooltipPlacement: TooltipProps['placement'];
1430
+ }
1431
+ export function Bar(props: BarProps): JSX.Element;
1432
+ }
1097
1433
  declare module "editor/components/editors/pixie/PixieImageEditor" {
1098
- import { Component } from 'react';
1099
- class PixieImageEditor extends Component {
1100
- state: {
1101
- loading: boolean;
1102
- saving: boolean;
1103
- errorMessage: string;
1104
- };
1105
- componentDidMount(): void;
1106
- componentDidUpdate(prevProps: any): void;
1107
- loadPixieEditor: () => Promise<void>;
1108
- updateImage: (data: any, filename: any, format: any) => Promise<void>;
1109
- componentWillUnmount(): Promise<void>;
1110
- render(): JSX.Element;
1434
+ type ImageBlob = {
1435
+ lastModifiedDate?: Date;
1436
+ name?: string;
1437
+ } & Blob;
1438
+ export interface PixieImageEditorProps {
1439
+ imageUrl: string;
1440
+ toggleModal: () => void;
1441
+ onComplete: (blob: ImageBlob) => void;
1111
1442
  }
1443
+ const PixieImageEditor: (props: PixieImageEditorProps) => JSX.Element;
1112
1444
  export default PixieImageEditor;
1113
1445
  }
1114
1446
  declare module "editor/components/editors/BackgroundImageEditor" {
@@ -1182,6 +1514,7 @@ declare module "embed/Editor" {
1182
1514
  import { AppearanceConfig, Audit, DesignTagsConfig, Device, DisplayConditions, DisplayMode, JSONTemplate, LinkTypes, LinkTypesSharedConfig, MergeTags, MergeTagsConfig, SpecialLink, Tabs, Translations, User, Validator } from "state/types/index";
1183
1515
  import { BodyValues } from "engine/options/bodies";
1184
1516
  import { Locale, TextDirection } from "engine/config/intl";
1517
+ import { DeepPartial } from "editor/components/editors/types";
1185
1518
  export const LATEST_VERSION: string;
1186
1519
  export const STABLE_VERSION: string;
1187
1520
  export class Editor {
@@ -1225,11 +1558,14 @@ declare module "embed/Editor" {
1225
1558
  exportImage(callback: (data: ExportFromApiResult) => void, options?: ExportImageFromApiOptions): void;
1226
1559
  exportPdf(callback: (data: ExportFromApiResult) => void, options?: ExportPdfFromApiOptions): void;
1227
1560
  exportZip(callback: (data: ExportFromApiResult) => void, options?: ExportZipFromApiOptions): void;
1228
- setAppearance(appearance: AppearanceConfig): void;
1561
+ setAppearance(appearance: DeepPartial<AppearanceConfig>): void;
1229
1562
  setBodyValues(bodyValues: Partial<BodyValues>, bodyId?: number): void;
1230
1563
  setDesignTagsConfig(designTagsConfig: DesignTagsConfig): void;
1231
1564
  setMergeTagsConfig(mergeTagsConfig: MergeTagsConfig): void;
1232
- showPreview(device?: Device): void;
1565
+ showPreview(payload: {
1566
+ device?: Device;
1567
+ resolution?: number;
1568
+ }): void;
1233
1569
  hidePreview(): void;
1234
1570
  canUndo(callback: (result: boolean) => void): void;
1235
1571
  canRedo(callback: (result: boolean) => void): void;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "unlayer-types",
3
- "version": "1.5.70",
3
+ "version": "1.6.2",
4
4
  "license": "MIT"
5
5
  }