unlayer-types 1.5.67 → 1.6.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.
- package/embed.d.ts +380 -45
- 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:
|
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?:
|
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
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
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
|
-
|
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
|
661
|
-
|
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
|
-
|
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,142 @@ 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/
|
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
|
+
/** TODO: Remove all "!important" after removing bootstrap */
|
827
|
+
import React from 'react';
|
828
|
+
import * as Ariakit from '@ariakit/react';
|
829
|
+
import { Theme } from '../../themes/types';
|
830
|
+
export interface ButtonProps extends Ariakit.ButtonProps {
|
831
|
+
children: React.ReactNode;
|
832
|
+
className?: string;
|
833
|
+
danger?: boolean;
|
834
|
+
disabled?: boolean;
|
835
|
+
loading?: boolean;
|
836
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
837
|
+
style?: React.CSSProperties;
|
838
|
+
variant?: keyof Theme['components']['buttons'];
|
839
|
+
type?: Ariakit.ButtonProps['type'];
|
840
|
+
id?: string;
|
841
|
+
}
|
842
|
+
export const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<unknown>>;
|
843
|
+
}
|
844
|
+
declare module "editor/design-system/components/Tooltip" {
|
845
|
+
import React from 'react';
|
846
|
+
import * as Ariakit from '@ariakit/react';
|
847
|
+
export interface TooltipProps {
|
848
|
+
arrow?: boolean;
|
849
|
+
children: Ariakit.TooltipAnchorProps['children'];
|
850
|
+
className?: string;
|
851
|
+
disabled?: boolean;
|
852
|
+
placement: Ariakit.TooltipStoreProps['placement'];
|
853
|
+
style?: React.CSSProperties;
|
854
|
+
timeout?: number;
|
855
|
+
tooltip: Ariakit.TooltipProps['children'];
|
856
|
+
tooltipWrapper?: Ariakit.TooltipAnchorProps['render'];
|
857
|
+
}
|
858
|
+
export function Tooltip(props: TooltipProps): JSX.Element;
|
859
|
+
}
|
860
|
+
declare module "editor/design-system/components/Dropdown" {
|
780
861
|
import React from 'react';
|
781
|
-
|
862
|
+
import * as Ariakit from '@ariakit/react';
|
863
|
+
import { IconDefinition } from '@fortawesome/pro-regular-svg-icons';
|
864
|
+
export interface SelectOption {
|
865
|
+
icon?: IconDefinition;
|
866
|
+
label: string;
|
867
|
+
value: any;
|
868
|
+
tooltip?: string;
|
869
|
+
meta?: Record<string, unknown>;
|
870
|
+
onClick?: (e: React.MouseEvent, selected: boolean) => void;
|
871
|
+
selected: boolean;
|
872
|
+
disabled?: boolean;
|
873
|
+
toggle?: boolean;
|
874
|
+
attrs?: Record<string, string | number | boolean | undefined>;
|
875
|
+
}
|
876
|
+
export interface SelectOptionGroup {
|
877
|
+
name?: string;
|
878
|
+
label?: string;
|
879
|
+
icon?: IconDefinition;
|
880
|
+
options: SelectOption[];
|
881
|
+
meta?: object;
|
882
|
+
}
|
883
|
+
export type DropdownProps = {
|
884
|
+
ariaLabel?: string;
|
885
|
+
asLink?: boolean;
|
886
|
+
badge?: number;
|
887
|
+
className?: string;
|
888
|
+
caret?: boolean;
|
889
|
+
disabled?: boolean;
|
890
|
+
fallbackLabel?: string;
|
891
|
+
label?: React.ReactNode;
|
892
|
+
multi?: boolean;
|
893
|
+
triggerLabel?: string | React.ReactNode;
|
894
|
+
placement?: Ariakit.PopoverStoreState['placement'];
|
895
|
+
onChange?: (option: SelectOption) => void;
|
896
|
+
onClose?: () => void;
|
897
|
+
onOpen?: () => void;
|
898
|
+
renderButton?: Ariakit.SelectProps['render'];
|
899
|
+
renderFooter?: () => React.ReactNode;
|
900
|
+
renderHeader?: () => React.ReactNode;
|
901
|
+
style?: React.CSSProperties;
|
902
|
+
customPopoverStyles?: React.CSSProperties;
|
903
|
+
} & ({
|
904
|
+
renderOption?: (option: SelectOption) => React.ReactNode;
|
905
|
+
renderOptionLabel?: never;
|
906
|
+
} | {
|
907
|
+
renderOption?: never;
|
908
|
+
renderOptionLabel?: (option: SelectOption) => React.ReactNode;
|
909
|
+
}) & ({
|
910
|
+
options?: never;
|
911
|
+
groupedOptions?: SelectOptionGroup[];
|
912
|
+
renderOptionGroupHeader?: (optionGroup: SelectOptionGroup) => React.ReactNode;
|
913
|
+
} | {
|
914
|
+
options?: SelectOption[];
|
915
|
+
groupedOptions?: never;
|
916
|
+
renderOptionGroupHeader?: never;
|
917
|
+
});
|
918
|
+
export function Dropdown(props: DropdownProps): JSX.Element;
|
919
|
+
}
|
920
|
+
declare module "editor/design-system/components/CounterInput" {
|
921
|
+
import { DisplayMode } from '../../../state/types';
|
922
|
+
export interface CounterInputProps {
|
782
923
|
absoluteBaseValue?: number;
|
783
924
|
buttonSize?: 'lg' | 'md' | 'sm' | undefined;
|
784
|
-
children?: React.ReactNode;
|
785
925
|
defaultUnit?: string;
|
786
926
|
disabled?: boolean;
|
927
|
+
displayMode: DisplayMode;
|
787
928
|
maxValue?: number | null;
|
788
929
|
minValue?: number | null;
|
789
930
|
onChange: (value: number | string) => void;
|
@@ -793,6 +934,12 @@ declare module "editor/components/editors/common/Counter" {
|
|
793
934
|
units?: string[];
|
794
935
|
value: number | string;
|
795
936
|
}
|
937
|
+
export default function CounterInput(props: CounterInputProps): JSX.Element;
|
938
|
+
}
|
939
|
+
declare module "editor/components/editors/common/Counter" {
|
940
|
+
import { CounterInputProps } from "editor/design-system/components/CounterInput";
|
941
|
+
export interface CounterProps extends Omit<CounterInputProps, 'displayMode'> {
|
942
|
+
}
|
796
943
|
export default function Counter(props: CounterProps): JSX.Element;
|
797
944
|
}
|
798
945
|
declare module "engine/utils/sizeUtils" {
|
@@ -889,6 +1036,28 @@ declare module "engine/utils/applyMergeTagPreviewHtmlToText" {
|
|
889
1036
|
}): string;
|
890
1037
|
export const applyMergeTagPreviewHtmlToText: typeof _applyMergeTagPreviewHtmlToText & import("lodash").MemoizedFunction;
|
891
1038
|
}
|
1039
|
+
declare module "editor/design-system/components/SegmentedControl" {
|
1040
|
+
import React from 'react';
|
1041
|
+
import { IconDefinition } from '@fortawesome/pro-regular-svg-icons';
|
1042
|
+
export interface SegmentedControlItem {
|
1043
|
+
key?: string;
|
1044
|
+
icon?: IconDefinition;
|
1045
|
+
label?: string;
|
1046
|
+
onClick?: (e: React.MouseEvent) => void;
|
1047
|
+
selected?: boolean;
|
1048
|
+
disabled?: boolean;
|
1049
|
+
tooltip?: string;
|
1050
|
+
meta?: object;
|
1051
|
+
}
|
1052
|
+
export interface SegmentedControlProps {
|
1053
|
+
autoFocus?: boolean;
|
1054
|
+
className?: string;
|
1055
|
+
disabled?: boolean;
|
1056
|
+
items: SegmentedControlItem[];
|
1057
|
+
renderLabel?: (item: SegmentedControlItem) => React.ReactNode;
|
1058
|
+
}
|
1059
|
+
export function SegmentedControl(props: SegmentedControlProps): JSX.Element;
|
1060
|
+
}
|
892
1061
|
declare module "state/types/RootState" {
|
893
1062
|
import { StateType } from 'typesafe-actions';
|
894
1063
|
import reducer from '../reducer';
|
@@ -967,8 +1136,8 @@ declare module "editor/hooks/useImageUploader" {
|
|
967
1136
|
}
|
968
1137
|
declare module "editor/components/common/ImageUploadButton" {
|
969
1138
|
import React from 'react';
|
970
|
-
import { ButtonProps } from 'reactstrap';
|
971
1139
|
import { ImageSource } from '../../../state/types';
|
1140
|
+
import { ButtonProps } from "editor/design-system/components/Button";
|
972
1141
|
export interface ImageUploadButtonInstance {
|
973
1142
|
clearError: () => void;
|
974
1143
|
openPicker: () => void;
|
@@ -1000,6 +1169,17 @@ declare module "editor/components/common/ImageUploadButton" {
|
|
1000
1169
|
declare module "engine/tools/content/image" {
|
1001
1170
|
export const DEFAULT_IMAGE_PLACEHOLDER = "https://cdn.tools.unlayer.com/image/placeholder.png";
|
1002
1171
|
}
|
1172
|
+
declare module "editor/design-system/components/Progress" {
|
1173
|
+
export interface ProgressBarProps {
|
1174
|
+
progress: number;
|
1175
|
+
className?: string;
|
1176
|
+
color?: string;
|
1177
|
+
backgroundColor?: string;
|
1178
|
+
height?: string;
|
1179
|
+
animationDuration?: number;
|
1180
|
+
}
|
1181
|
+
export function Progress(props: ProgressBarProps): JSX.Element;
|
1182
|
+
}
|
1003
1183
|
declare module "editor/components/common/Dropzone" {
|
1004
1184
|
import React from 'react';
|
1005
1185
|
import { DropzoneOptions } from 'react-dropzone';
|
@@ -1014,7 +1194,7 @@ declare module "editor/components/common/Dropzone" {
|
|
1014
1194
|
onEffectsClick?: () => void;
|
1015
1195
|
isEffectsButtonDisabled?: boolean;
|
1016
1196
|
showImageInfo?: boolean;
|
1017
|
-
shouldRenderDropzone
|
1197
|
+
shouldRenderDropzone?: boolean;
|
1018
1198
|
isNotImageTool?: boolean;
|
1019
1199
|
}
|
1020
1200
|
export function Dropzone(props: DropzoneProps): JSX.Element;
|
@@ -1034,8 +1214,8 @@ declare module "editor/components/common/ImageUploadErrorMessage" {
|
|
1034
1214
|
}
|
1035
1215
|
declare module "editor/components/editors/ImageUploader" {
|
1036
1216
|
import { RefObject } from 'react';
|
1037
|
-
import { ImageUploadButtonInstance } from "editor/components/common/ImageUploadButton";
|
1038
1217
|
import { DropEvent, FileRejection } from 'react-dropzone';
|
1218
|
+
import { ImageUploadButtonInstance } from "editor/components/common/ImageUploadButton";
|
1039
1219
|
interface ImageUploaderProps {
|
1040
1220
|
shouldRender: {
|
1041
1221
|
uploadButton?: boolean;
|
@@ -1062,8 +1242,44 @@ declare module "editor/components/editors/ImageUploader" {
|
|
1062
1242
|
onUploadStatusChange: (image: any) => void;
|
1063
1243
|
onErrorChange: (error: Error | null) => void;
|
1064
1244
|
imageUploadButtonRef: RefObject<ImageUploadButtonInstance>;
|
1245
|
+
showError?: boolean;
|
1065
1246
|
}
|
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;
|
1247
|
+
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;
|
1248
|
+
}
|
1249
|
+
declare module "editor/themes/helpers" {
|
1250
|
+
import { Theme } from './types';
|
1251
|
+
export function parseThemeValues<T extends Theme>(theme: T): T;
|
1252
|
+
}
|
1253
|
+
declare module "editor/themes/modern/light" {
|
1254
|
+
import { DeprecatedTheme, Theme } from '../types';
|
1255
|
+
export const unparsedTheme: Theme & DeprecatedTheme;
|
1256
|
+
export const parsedTheme: Theme & DeprecatedTheme;
|
1257
|
+
}
|
1258
|
+
declare module "editor/themes/classic/light" {
|
1259
|
+
export const unparsedTheme: any;
|
1260
|
+
export const parsedTheme: any;
|
1261
|
+
}
|
1262
|
+
declare module "editor/themes/modern/dark" {
|
1263
|
+
import { DeprecatedTheme, Theme } from '../types';
|
1264
|
+
export const unparsedTheme: Theme & DeprecatedTheme;
|
1265
|
+
export const parsedTheme: Theme & DeprecatedTheme;
|
1266
|
+
}
|
1267
|
+
declare module "editor/themes/classic/dark" {
|
1268
|
+
export const unparsedTheme: any;
|
1269
|
+
export const parsedTheme: any;
|
1270
|
+
}
|
1271
|
+
declare module "editor/themes/index" {
|
1272
|
+
const themes: {
|
1273
|
+
classic_light: any;
|
1274
|
+
classic_dark: any;
|
1275
|
+
modern_light: import("editor/themes/types").Theme & import("editor/themes/types").DeprecatedTheme;
|
1276
|
+
modern_dark: import("editor/themes/types").Theme & import("editor/themes/types").DeprecatedTheme;
|
1277
|
+
};
|
1278
|
+
export default themes;
|
1279
|
+
}
|
1280
|
+
declare module "editor/hooks/useTheme" {
|
1281
|
+
import { DeprecatedTheme, Theme } from '../themes/types';
|
1282
|
+
export function useTheme(): Theme & DeprecatedTheme;
|
1067
1283
|
}
|
1068
1284
|
declare module "editor/components/editors/pixie/pixie.umd" {
|
1069
1285
|
const _exports: {
|
@@ -1094,21 +1310,136 @@ declare module "editor/components/editors/pixie/pixie.umd" {
|
|
1094
1310
|
};
|
1095
1311
|
export = _exports;
|
1096
1312
|
}
|
1313
|
+
declare module "editor/design-system/components/ToggleSwitch" {
|
1314
|
+
import React from 'react';
|
1315
|
+
export interface ToggleSwitchProps {
|
1316
|
+
children?: React.ReactNode;
|
1317
|
+
className?: string;
|
1318
|
+
disabled?: boolean;
|
1319
|
+
isChecked: boolean;
|
1320
|
+
left?: React.ReactNode;
|
1321
|
+
onChange: (isChecked: boolean) => void;
|
1322
|
+
right?: React.ReactNode;
|
1323
|
+
size?: number;
|
1324
|
+
style?: React.CSSProperties;
|
1325
|
+
}
|
1326
|
+
export const ToggleSwitch: React.ForwardRefExoticComponent<ToggleSwitchProps & React.RefAttributes<HTMLLabelElement>>;
|
1327
|
+
}
|
1328
|
+
declare module "editor/design-system/components/Bar" {
|
1329
|
+
import React, { ReactNode } from 'react';
|
1330
|
+
import { IconDefinition } from '@fortawesome/pro-regular-svg-icons';
|
1331
|
+
import { TooltipProps } from "editor/design-system/components/Tooltip";
|
1332
|
+
export const BAR_HEIGHT = 40;
|
1333
|
+
export const BAR_ITEM_WIDTH = 50;
|
1334
|
+
export const BAR_ITEM_COMPACT_WIDTH = 30;
|
1335
|
+
export interface SelectOption {
|
1336
|
+
icon?: IconDefinition;
|
1337
|
+
label: string;
|
1338
|
+
value: any;
|
1339
|
+
tooltip?: string;
|
1340
|
+
meta?: object;
|
1341
|
+
onClick?: (e: React.MouseEvent, selected: boolean) => void;
|
1342
|
+
selected?: boolean;
|
1343
|
+
toggle?: boolean;
|
1344
|
+
}
|
1345
|
+
export interface SelectOptionGroup {
|
1346
|
+
name?: string;
|
1347
|
+
label?: string;
|
1348
|
+
icon?: IconDefinition;
|
1349
|
+
options: SelectOption[];
|
1350
|
+
meta?: object;
|
1351
|
+
}
|
1352
|
+
export interface BarTitleItem {
|
1353
|
+
key: string;
|
1354
|
+
type: 'title' | 'subtitle';
|
1355
|
+
icon?: IconDefinition;
|
1356
|
+
text: string;
|
1357
|
+
tooltip?: string;
|
1358
|
+
badge?: number;
|
1359
|
+
loading?: boolean;
|
1360
|
+
}
|
1361
|
+
export interface BarButtonItem {
|
1362
|
+
key: string;
|
1363
|
+
type: 'button';
|
1364
|
+
id?: string;
|
1365
|
+
icon: IconDefinition | undefined;
|
1366
|
+
label?: string;
|
1367
|
+
tooltip?: string;
|
1368
|
+
badge?: number;
|
1369
|
+
onClick?: (e: React.MouseEvent) => void;
|
1370
|
+
destructive?: boolean;
|
1371
|
+
disabled?: boolean;
|
1372
|
+
loading?: boolean;
|
1373
|
+
selected?: boolean;
|
1374
|
+
highlighted?: boolean;
|
1375
|
+
autoFocus?: boolean;
|
1376
|
+
}
|
1377
|
+
export interface BarToggleItem {
|
1378
|
+
key: string;
|
1379
|
+
type: 'toggle';
|
1380
|
+
icon: IconDefinition;
|
1381
|
+
tooltip?: string;
|
1382
|
+
label?: string;
|
1383
|
+
badge?: number;
|
1384
|
+
onClick?: (e: React.MouseEvent) => void;
|
1385
|
+
onChange: (enabled: boolean) => void;
|
1386
|
+
disabled?: boolean;
|
1387
|
+
checked?: boolean;
|
1388
|
+
selected?: boolean;
|
1389
|
+
highlighted?: boolean;
|
1390
|
+
autoFocus?: boolean;
|
1391
|
+
error: ReactNode;
|
1392
|
+
}
|
1393
|
+
type BarDropdownItem = {
|
1394
|
+
key: string;
|
1395
|
+
type: 'dropdown';
|
1396
|
+
ariaLabel?: string;
|
1397
|
+
multi?: boolean;
|
1398
|
+
renderOption?: (option: SelectOption) => React.ReactNode;
|
1399
|
+
renderOptionLabel?: (option: SelectOption) => React.ReactNode;
|
1400
|
+
onChange?: (option: SelectOption) => void;
|
1401
|
+
badge?: number;
|
1402
|
+
disabled?: boolean;
|
1403
|
+
tooltip?: string;
|
1404
|
+
triggerLabel?: string | React.ReactNode;
|
1405
|
+
caret?: boolean;
|
1406
|
+
renderHeader?: () => React.ReactNode;
|
1407
|
+
} & ({
|
1408
|
+
options?: never;
|
1409
|
+
groupedOptions?: SelectOptionGroup[];
|
1410
|
+
renderOptionGroupHeader?: (optionGroup: SelectOptionGroup) => React.ReactNode;
|
1411
|
+
} | {
|
1412
|
+
options?: SelectOption[];
|
1413
|
+
groupedOptions?: never;
|
1414
|
+
renderOptionGroupHeader?: never;
|
1415
|
+
});
|
1416
|
+
export interface BarSeparatorItem {
|
1417
|
+
type: 'separator';
|
1418
|
+
}
|
1419
|
+
export type BarItem = BarTitleItem | BarButtonItem | BarToggleItem | BarDropdownItem | BarSeparatorItem | false | undefined;
|
1420
|
+
export interface BarProps {
|
1421
|
+
as?: any;
|
1422
|
+
className?: string;
|
1423
|
+
compact?: boolean;
|
1424
|
+
leftItems?: BarItem[];
|
1425
|
+
items?: BarItem[];
|
1426
|
+
rightItems?: BarItem[];
|
1427
|
+
style?: React.CSSProperties;
|
1428
|
+
tooltipPlacement: TooltipProps['placement'];
|
1429
|
+
}
|
1430
|
+
export function Bar(props: BarProps): JSX.Element;
|
1431
|
+
}
|
1097
1432
|
declare module "editor/components/editors/pixie/PixieImageEditor" {
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
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;
|
1433
|
+
type ImageBlob = {
|
1434
|
+
lastModifiedDate?: Date;
|
1435
|
+
name?: string;
|
1436
|
+
} & Blob;
|
1437
|
+
export interface PixieImageEditorProps {
|
1438
|
+
imageUrl: string;
|
1439
|
+
toggleModal: () => void;
|
1440
|
+
onComplete: (blob: ImageBlob) => void;
|
1111
1441
|
}
|
1442
|
+
const PixieImageEditor: (props: PixieImageEditorProps) => JSX.Element;
|
1112
1443
|
export default PixieImageEditor;
|
1113
1444
|
}
|
1114
1445
|
declare module "editor/components/editors/BackgroundImageEditor" {
|
@@ -1182,6 +1513,7 @@ declare module "embed/Editor" {
|
|
1182
1513
|
import { AppearanceConfig, Audit, DesignTagsConfig, Device, DisplayConditions, DisplayMode, JSONTemplate, LinkTypes, LinkTypesSharedConfig, MergeTags, MergeTagsConfig, SpecialLink, Tabs, Translations, User, Validator } from "state/types/index";
|
1183
1514
|
import { BodyValues } from "engine/options/bodies";
|
1184
1515
|
import { Locale, TextDirection } from "engine/config/intl";
|
1516
|
+
import { DeepPartial } from "editor/components/editors/types";
|
1185
1517
|
export const LATEST_VERSION: string;
|
1186
1518
|
export const STABLE_VERSION: string;
|
1187
1519
|
export class Editor {
|
@@ -1225,11 +1557,14 @@ declare module "embed/Editor" {
|
|
1225
1557
|
exportImage(callback: (data: ExportFromApiResult) => void, options?: ExportImageFromApiOptions): void;
|
1226
1558
|
exportPdf(callback: (data: ExportFromApiResult) => void, options?: ExportPdfFromApiOptions): void;
|
1227
1559
|
exportZip(callback: (data: ExportFromApiResult) => void, options?: ExportZipFromApiOptions): void;
|
1228
|
-
setAppearance(appearance: AppearanceConfig): void;
|
1560
|
+
setAppearance(appearance: DeepPartial<AppearanceConfig>): void;
|
1229
1561
|
setBodyValues(bodyValues: Partial<BodyValues>, bodyId?: number): void;
|
1230
1562
|
setDesignTagsConfig(designTagsConfig: DesignTagsConfig): void;
|
1231
1563
|
setMergeTagsConfig(mergeTagsConfig: MergeTagsConfig): void;
|
1232
|
-
showPreview(
|
1564
|
+
showPreview(payload: {
|
1565
|
+
device?: Device;
|
1566
|
+
resolution?: number;
|
1567
|
+
}): void;
|
1233
1568
|
hidePreview(): void;
|
1234
1569
|
canUndo(callback: (result: boolean) => void): void;
|
1235
1570
|
canRedo(callback: (result: boolean) => void): void;
|
package/package.json
CHANGED