unlayer-types 1.207.0 → 1.209.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 +126 -189
- package/package.json +1 -1
package/embed.d.ts
CHANGED
@@ -28,7 +28,8 @@ declare module "editor/components/editors/types" {
|
|
28
28
|
skipFromUndoRedo?: boolean;
|
29
29
|
}) => void;
|
30
30
|
name: string;
|
31
|
-
|
31
|
+
/** @deprecated Use widgetParams instead */
|
32
|
+
data?: WidgetParams;
|
32
33
|
disabled?: boolean;
|
33
34
|
isLockedByStyleGuide?: boolean;
|
34
35
|
widgetParams?: WidgetParams;
|
@@ -59,6 +60,7 @@ declare module "editor/components/editors/types" {
|
|
59
60
|
customJS?: boolean;
|
60
61
|
customTools?: number;
|
61
62
|
customTabs?: number;
|
63
|
+
customThemes?: boolean;
|
62
64
|
imageEditor?: boolean;
|
63
65
|
selectImage?: boolean;
|
64
66
|
stockImages?: boolean;
|
@@ -142,8 +144,12 @@ declare module "editor/components/editors/types" {
|
|
142
144
|
}
|
143
145
|
declare module "editor/themes/types" {
|
144
146
|
import { AppearanceConfig } from "state/types/types";
|
147
|
+
import { DeepPartial } from "editor/components/editors/types";
|
148
|
+
export type ThemeName = 'classic_light' | 'classic_dark' | 'modern_light' | 'modern_dark';
|
149
|
+
export type ThemeNamePlusLightDark = ThemeName | 'light' | 'dark';
|
145
150
|
export type Theme = {
|
146
|
-
name:
|
151
|
+
name: ThemeName;
|
152
|
+
isCustom?: boolean;
|
147
153
|
isDark: boolean;
|
148
154
|
isClassic?: boolean;
|
149
155
|
mapping: {
|
@@ -631,6 +637,14 @@ declare module "editor/themes/types" {
|
|
631
637
|
export type BannerMessageVariant = 'success' | 'warning' | 'default' | 'danger';
|
632
638
|
export type ToastVariant = 'success' | 'warning' | 'default' | 'danger';
|
633
639
|
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' | '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';
|
640
|
+
export type ThemeExtension = {
|
641
|
+
name: string;
|
642
|
+
extends: ThemeName;
|
643
|
+
isDark: boolean;
|
644
|
+
isClassic?: boolean;
|
645
|
+
mapping?: DeepPartial<Theme['mapping']>;
|
646
|
+
components?: DeepPartial<Theme['components']>;
|
647
|
+
};
|
634
648
|
export type BorderRadius = 'none' | 'min' | 'mid' | 'max' | 'full';
|
635
649
|
export type ButtonThemeObject = {
|
636
650
|
backgroundColor: ColorValue;
|
@@ -1099,33 +1113,12 @@ declare module "editor/themes/types" {
|
|
1099
1113
|
boxShadowColor: string;
|
1100
1114
|
};
|
1101
1115
|
};
|
1102
|
-
imageCard: {
|
1103
|
-
backgroundColor: string;
|
1104
|
-
textColor: string;
|
1105
|
-
boxShadowColor: string;
|
1106
|
-
hover: {
|
1107
|
-
backgroundColor: string;
|
1108
|
-
textColor: string;
|
1109
|
-
boxShadowColor: string;
|
1110
|
-
};
|
1111
|
-
};
|
1112
1116
|
closeButton: {
|
1113
1117
|
iconColor: string;
|
1114
1118
|
hover: {
|
1115
1119
|
iconColor: string;
|
1116
1120
|
};
|
1117
1121
|
};
|
1118
|
-
error: {
|
1119
|
-
icon: {
|
1120
|
-
textColor: string;
|
1121
|
-
};
|
1122
|
-
};
|
1123
|
-
footer: {
|
1124
|
-
backgroundColor: string;
|
1125
|
-
textColor: string;
|
1126
|
-
borderColor: string;
|
1127
|
-
boxShadowColor: string;
|
1128
|
-
};
|
1129
1122
|
loader: {
|
1130
1123
|
backgroundColor: string;
|
1131
1124
|
content: {
|
@@ -1137,55 +1130,34 @@ declare module "editor/themes/types" {
|
|
1137
1130
|
backgroundColor: string;
|
1138
1131
|
};
|
1139
1132
|
};
|
1140
|
-
overlay: {
|
1141
|
-
backgroundColor: string;
|
1142
|
-
};
|
1143
|
-
recents: {
|
1144
|
-
backgroundColor: string;
|
1145
|
-
textColor: string;
|
1146
|
-
borderColor: string;
|
1147
|
-
boxShadowColor: string;
|
1148
|
-
hover: {
|
1149
|
-
backgroundColor: string;
|
1150
|
-
textColor: string;
|
1151
|
-
borderColor: string;
|
1152
|
-
};
|
1153
|
-
};
|
1154
|
-
score: {
|
1155
|
-
default: {
|
1156
|
-
backgroundColor: string;
|
1157
|
-
textColor: string;
|
1158
|
-
};
|
1159
|
-
good: {
|
1160
|
-
backgroundColor: string;
|
1161
|
-
textColor: string;
|
1162
|
-
};
|
1163
|
-
bad: {
|
1164
|
-
backgroundColor: string;
|
1165
|
-
textColor: string;
|
1166
|
-
};
|
1167
|
-
};
|
1168
|
-
/** @deprecated */
|
1169
|
-
warning: {
|
1170
|
-
backgroundColor: string;
|
1171
|
-
color: string;
|
1172
|
-
};
|
1173
|
-
};
|
1174
|
-
/** @deprecated */
|
1175
|
-
ai: {
|
1176
|
-
color: string;
|
1177
|
-
focus: {
|
1178
|
-
color: string;
|
1179
|
-
};
|
1180
1133
|
};
|
1181
1134
|
};
|
1182
1135
|
}
|
1136
|
+
declare module "engine/constants" {
|
1137
|
+
export const collections: readonly ["bodies", "columns", "contents", "footers", "headers", "pages", "rows"];
|
1138
|
+
export const HTMLInputTypeAttributes: readonly ["button", "checkbox", "color", "date", "datetime-local", "email", "file", "hidden", "image", "month", "number", "password", "radio", "range", "reset", "search", "submit", "tel", "text", "time", "url", "week"];
|
1139
|
+
}
|
1140
|
+
declare module "engine/utils/zod/schemas" {
|
1141
|
+
export const DisplayConditionZodSchema: any;
|
1142
|
+
export const FontWeightZodSchema: any;
|
1143
|
+
export const FontZodSchema: any;
|
1144
|
+
export const HintZodSchema: any;
|
1145
|
+
export const PercentageZodSchema: any;
|
1146
|
+
export const SinglePxZodSchema: any;
|
1147
|
+
export const DoublePxZodSchema: any;
|
1148
|
+
export const TriplePxZodSchema: any;
|
1149
|
+
export const QuadruplePxZodSchema: any;
|
1150
|
+
export const MultiplePxZodSchema: any;
|
1151
|
+
}
|
1183
1152
|
declare module "state/types/types" {
|
1184
1153
|
import * as Ariakit from '@ariakit/react';
|
1185
1154
|
import { MutableRefObject, ReactInstance } from 'react';
|
1155
|
+
import { z } from 'zod';
|
1186
1156
|
import { State as Design } from '../reducer/design';
|
1187
1157
|
import { CollaborationThread } from "editor/components/editors/types";
|
1188
|
-
import {
|
1158
|
+
import { ThemeExtension, ThemeNamePlusLightDark } from "editor/themes/types";
|
1159
|
+
import { collections } from "engine/constants";
|
1160
|
+
import { DisplayConditionZodSchema } from "engine/utils/zod/schemas";
|
1189
1161
|
export type DesignMode = 'live' | 'edit';
|
1190
1162
|
export type Device = 'desktop' | 'mobile' | 'tablet';
|
1191
1163
|
export type DisplayMode = 'web' | 'email' | 'popup' | 'document';
|
@@ -1214,13 +1186,7 @@ declare module "state/types/types" {
|
|
1214
1186
|
autocompleteTriggerChar?: string;
|
1215
1187
|
sort?: boolean;
|
1216
1188
|
}
|
1217
|
-
export
|
1218
|
-
type: string;
|
1219
|
-
label: string;
|
1220
|
-
description: string;
|
1221
|
-
before?: string;
|
1222
|
-
after?: string;
|
1223
|
-
}
|
1189
|
+
export type DisplayCondition = z.infer<typeof DisplayConditionZodSchema>;
|
1224
1190
|
export type DisplayConditions = DisplayCondition[];
|
1225
1191
|
export type SpecialLink = {
|
1226
1192
|
name: string;
|
@@ -1307,7 +1273,7 @@ declare module "state/types/types" {
|
|
1307
1273
|
export interface Translations {
|
1308
1274
|
[name: string]: object;
|
1309
1275
|
}
|
1310
|
-
export type Collection =
|
1276
|
+
export type Collection = ArrayItem<typeof collections>;
|
1311
1277
|
export type Container = 'body' | 'row' | 'column' | 'content';
|
1312
1278
|
export interface Location {
|
1313
1279
|
collection: Collection;
|
@@ -1336,11 +1302,10 @@ declare module "state/types/types" {
|
|
1336
1302
|
export interface Tool {
|
1337
1303
|
active: boolean;
|
1338
1304
|
type: string | null;
|
1339
|
-
slug
|
1305
|
+
slug?: string | null;
|
1340
1306
|
}
|
1341
1307
|
export interface Usage {
|
1342
1308
|
brandStyleGuide?: boolean;
|
1343
|
-
builtInThemes?: string;
|
1344
1309
|
collaboration?: boolean;
|
1345
1310
|
countdownTimer?: boolean;
|
1346
1311
|
customBlocks?: number;
|
@@ -1366,6 +1331,7 @@ declare module "state/types/types" {
|
|
1366
1331
|
premiumTools?: boolean;
|
1367
1332
|
sendTestEmail?: boolean;
|
1368
1333
|
specialLinks?: number;
|
1334
|
+
theme?: string;
|
1369
1335
|
}
|
1370
1336
|
export type ImageSource = 'unsplash' | 'pixabay' | 'pexel' | 'user';
|
1371
1337
|
export interface Image {
|
@@ -1446,18 +1412,6 @@ declare module "state/types/types" {
|
|
1446
1412
|
active?: boolean;
|
1447
1413
|
};
|
1448
1414
|
};
|
1449
|
-
export type SocialIcon = {
|
1450
|
-
name: string;
|
1451
|
-
url: string;
|
1452
|
-
imgUrl?: string;
|
1453
|
-
};
|
1454
|
-
export type SocialCustomIcon = {
|
1455
|
-
name: string;
|
1456
|
-
url: string;
|
1457
|
-
icons: {
|
1458
|
-
[key: string]: string;
|
1459
|
-
}[];
|
1460
|
-
};
|
1461
1415
|
export type AppearanceConfig = {
|
1462
1416
|
actionBar?: {
|
1463
1417
|
placement?: 'top' | 'bottom' | 'top_left' | 'top_right' | 'bottom_left' | 'bottom_right' | undefined;
|
@@ -1480,7 +1434,7 @@ declare module "state/types/types" {
|
|
1480
1434
|
};
|
1481
1435
|
};
|
1482
1436
|
};
|
1483
|
-
theme?:
|
1437
|
+
theme?: ThemeNamePlusLightDark | ThemeExtension;
|
1484
1438
|
};
|
1485
1439
|
export interface ToolConfig {
|
1486
1440
|
enabled?: boolean | undefined;
|
@@ -1520,6 +1474,8 @@ declare module "state/types/types" {
|
|
1520
1474
|
[toolId: string]: StyleGuideToolConfig | undefined;
|
1521
1475
|
};
|
1522
1476
|
}
|
1477
|
+
export interface JSONSchema {
|
1478
|
+
}
|
1523
1479
|
}
|
1524
1480
|
declare module "engine/utils/pruneObj" {
|
1525
1481
|
export function pruneObj<T extends Record<string, any>>(obj: T, options?: {
|
@@ -1656,17 +1612,9 @@ declare module "engine/config/callbacks" {
|
|
1656
1612
|
};
|
1657
1613
|
}
|
1658
1614
|
declare module "engine/config/fonts" {
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
label: string;
|
1663
|
-
value: string;
|
1664
|
-
url?: string;
|
1665
|
-
weights?: number[] | Array<{
|
1666
|
-
label: string;
|
1667
|
-
value: number;
|
1668
|
-
} | number>;
|
1669
|
-
}
|
1615
|
+
import { z } from 'zod';
|
1616
|
+
import { FontZodSchema } from "engine/utils/zod/schemas";
|
1617
|
+
export type Font = z.infer<typeof FontZodSchema>;
|
1670
1618
|
export type FontList = Font[];
|
1671
1619
|
export interface FontConfig {
|
1672
1620
|
showDefaultFonts?: boolean;
|
@@ -1961,9 +1909,10 @@ declare module "editor/hooks/useConfig" {
|
|
1961
1909
|
export function withConfig<C extends React.ComponentType>(Component: C): React.MemoExoticComponent<React.ForwardRefExoticComponent<React.RefAttributes<unknown>>>;
|
1962
1910
|
}
|
1963
1911
|
declare module "engine/utils/position" {
|
1964
|
-
import { DisplayMode } from "state/types/types";
|
1912
|
+
import { ArrayItem, DisplayMode } from "state/types/types";
|
1965
1913
|
export const ENABLE_BACKGROUND_POSITION_FOR_EMAILS = true;
|
1966
|
-
export
|
1914
|
+
export const positions: readonly ["top-left", "top-center", "top-right", "center-left", "center", "center-right", "bottom-left", "bottom-center", "bottom-right"];
|
1915
|
+
export type Position = ArrayItem<typeof positions>;
|
1967
1916
|
export function positionToMarginArray(position: Position | undefined): string[] | readonly [0, "auto", "auto", 0] | readonly [0, "auto", "auto", "auto"] | readonly [0, 0, "auto", "auto"] | readonly ["auto", "auto", "auto", 0] | readonly ["auto"] | readonly ["auto", 0, "auto", "auto"] | readonly ["auto", "auto", 0, 0] | readonly ["auto", "auto", 0, "auto"] | readonly ["auto", 0, 0, "auto"];
|
1968
1917
|
export function positionToBackgroundPosition(position: Position | undefined): 'top left' | 'top center' | 'top right' | 'center left' | 'center center' | 'center right' | 'bottom left' | 'bottom center' | 'bottom right' | 'auto auto';
|
1969
1918
|
export function valuesToBackgroundPositionCSS(values: {
|
@@ -1975,14 +1924,32 @@ declare module "engine/utils/position" {
|
|
1975
1924
|
export function positionToPercentages(position: Position | 'custom' | undefined): [x: string, y: string] | undefined;
|
1976
1925
|
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;
|
1977
1926
|
}
|
1927
|
+
declare module "engine/utils/zod/zodSchemasToJsonSchemas" {
|
1928
|
+
import { ZodSchema } from 'zod';
|
1929
|
+
import { JSONSchema } from "state/types/types";
|
1930
|
+
export function zodSchemasToJsonSchemas<K extends string>(zodSchemas: Record<K, ZodSchema>): Record<K, JSONSchema>;
|
1931
|
+
}
|
1932
|
+
declare module "engine/utils/zod/propertyEditorSchemas" {
|
1933
|
+
import { PropertyEditorZodSchemas } from '../../config';
|
1934
|
+
export function propertyEditorZodSchemas<T extends PropertyEditorZodSchemas>(zodSchemas: T): {
|
1935
|
+
zodSchemas: T;
|
1936
|
+
schemas: Record<string, import("state/types/types").JSONSchema>;
|
1937
|
+
};
|
1938
|
+
}
|
1939
|
+
declare module "engine/utils/zod/types" {
|
1940
|
+
import { z } from 'zod';
|
1941
|
+
import { EditorProps } from "editor/components/editors/types";
|
1942
|
+
import { PropertyEditorZodSchemas } from '../../config';
|
1943
|
+
export type EditorPropsFromZodSchemas<T extends PropertyEditorZodSchemas> = EditorProps<z.infer<T['value']>, z.infer<T['widgetParams']>>;
|
1944
|
+
}
|
1978
1945
|
declare module "editor/components/editors/PositionEditor" {
|
1979
1946
|
import React from 'react';
|
1980
|
-
import {
|
1981
|
-
|
1982
|
-
|
1983
|
-
|
1984
|
-
|
1985
|
-
|
1947
|
+
import { EditorPropsFromZodSchemas } from "engine/utils/zod/types";
|
1948
|
+
export const schemas: Record<string, import("state/types/types").JSONSchema>, zodSchemas: {
|
1949
|
+
value: any;
|
1950
|
+
widgetParams: any;
|
1951
|
+
};
|
1952
|
+
export type PositionEditorProps = EditorPropsFromZodSchemas<typeof zodSchemas>;
|
1986
1953
|
export function PositionEditor(props: PositionEditorProps): React.JSX.Element;
|
1987
1954
|
export function PositionEditorBase(props: Pick<PositionEditorProps, 'updateValue' | 'value' | 'widgetParams'> & {
|
1988
1955
|
className?: string;
|
@@ -1995,16 +1962,33 @@ declare module "editor/components/editors/PositionEditor" {
|
|
1995
1962
|
declare module "editor/hooks/useDynamicRef" {
|
1996
1963
|
export function useDynamicRef<T>(value: T): import("react").MutableRefObject<T>;
|
1997
1964
|
}
|
1965
|
+
declare module "engine/utils/renderIcon" {
|
1966
|
+
import React from 'react';
|
1967
|
+
import * as config from '../../engine/config';
|
1968
|
+
import { Icon } from "state/types/types";
|
1969
|
+
import { IconDefinition } from '@fortawesome/pro-regular-svg-icons';
|
1970
|
+
import { FontAwesomeIconProps } from '@fortawesome/react-fontawesome';
|
1971
|
+
export function renderIcon(icon: Icon | Parameters<typeof config.normalizeIcon>[0] | undefined, { fallbackIcon, shouldShowFallbackIcon, size, divProps, }?: {
|
1972
|
+
shouldShowFallbackIcon?: boolean;
|
1973
|
+
fallbackIcon?: IconDefinition;
|
1974
|
+
size?: FontAwesomeIconProps['size'];
|
1975
|
+
divProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
1976
|
+
}): React.JSX.Element;
|
1977
|
+
}
|
1998
1978
|
declare module "editor/design-system/components/Input" {
|
1999
1979
|
import React from 'react';
|
2000
1980
|
import * as Ariakit from '@ariakit/react';
|
1981
|
+
import { IconDefinition } from '@fortawesome/pro-regular-svg-icons';
|
1982
|
+
import { Icon } from "state/types/types";
|
2001
1983
|
export interface InputProps extends Omit<Ariakit.FormInputProps, 'as' | 'onSubmit' | 'onSubmitCapture'> {
|
2002
1984
|
formStore?: Ariakit.FormStore<{
|
2003
1985
|
value: string;
|
2004
1986
|
}>;
|
1987
|
+
icon?: Icon | IconDefinition;
|
2005
1988
|
label?: React.ReactNode;
|
2006
1989
|
labelPosition?: 'top' | 'left' | 'right';
|
2007
1990
|
name: string;
|
1991
|
+
onClear?: () => void;
|
2008
1992
|
onSubmit?: (value: string | number) => void;
|
2009
1993
|
placeholder?: string;
|
2010
1994
|
required?: boolean;
|
@@ -2021,6 +2005,7 @@ declare module "editor/design-system/components/Input" {
|
|
2021
2005
|
FormLabel: import("styled-components").StyledComponent<any, any, any, any>;
|
2022
2006
|
FormInput: import("styled-components").StyledComponent<any, any, any, any>;
|
2023
2007
|
Message: import("styled-components").StyledComponent<"div", any, {}, never>;
|
2008
|
+
ClearButton: import("styled-components").StyledComponent<any, any, any, any>;
|
2024
2009
|
};
|
2025
2010
|
}
|
2026
2011
|
declare module "editor/design-system/components/Button" {
|
@@ -2130,31 +2115,29 @@ declare module "editor/design-system/components/Dropdown" {
|
|
2130
2115
|
export function Dropdown(props: DropdownProps): React.JSX.Element;
|
2131
2116
|
}
|
2132
2117
|
declare module "editor/themes/helpers" {
|
2133
|
-
import { Theme } from "editor/themes/types";
|
2118
|
+
import { Theme, ThemeExtension } from "editor/themes/types";
|
2119
|
+
export function extendTheme<TE extends ThemeExtension, BT extends Theme>(themeExtension: TE, baseTheme: BT): BT;
|
2120
|
+
export function postprocessTheme<T extends Theme>(theme: T): T;
|
2134
2121
|
export function parseThemeValues<T extends Theme>(theme: T): T;
|
2135
2122
|
}
|
2136
2123
|
declare module "editor/themes/modern/light" {
|
2137
2124
|
import { DeprecatedTheme, Theme } from "editor/themes/types";
|
2138
2125
|
export const unparsedTheme: Theme & DeprecatedTheme;
|
2139
|
-
export const parsedTheme: Theme & DeprecatedTheme;
|
2140
2126
|
}
|
2141
2127
|
declare module "editor/themes/classic/light" {
|
2142
|
-
export const unparsedTheme:
|
2143
|
-
export const parsedTheme: any;
|
2128
|
+
export const unparsedTheme: import("editor/themes/types").Theme & import("editor/themes/types").DeprecatedTheme;
|
2144
2129
|
}
|
2145
2130
|
declare module "editor/themes/modern/dark" {
|
2146
2131
|
import { DeprecatedTheme, Theme } from "editor/themes/types";
|
2147
2132
|
export const unparsedTheme: Theme & DeprecatedTheme;
|
2148
|
-
export const parsedTheme: Theme & DeprecatedTheme;
|
2149
2133
|
}
|
2150
2134
|
declare module "editor/themes/classic/dark" {
|
2151
|
-
export const unparsedTheme:
|
2152
|
-
export const parsedTheme: any;
|
2135
|
+
export const unparsedTheme: import("editor/themes/types").Theme & import("editor/themes/types").DeprecatedTheme;
|
2153
2136
|
}
|
2154
2137
|
declare module "editor/themes/index" {
|
2155
2138
|
const themes: {
|
2156
|
-
classic_light:
|
2157
|
-
classic_dark:
|
2139
|
+
classic_light: import("editor/themes/types").Theme & import("editor/themes/types").DeprecatedTheme;
|
2140
|
+
classic_dark: import("editor/themes/types").Theme & import("editor/themes/types").DeprecatedTheme;
|
2158
2141
|
modern_light: import("editor/themes/types").Theme & import("editor/themes/types").DeprecatedTheme;
|
2159
2142
|
modern_dark: import("editor/themes/types").Theme & import("editor/themes/types").DeprecatedTheme;
|
2160
2143
|
};
|
@@ -2166,7 +2149,16 @@ declare module "state/types/RootState" {
|
|
2166
2149
|
export type RootState = StateType<typeof reducer>;
|
2167
2150
|
}
|
2168
2151
|
declare module "editor/hooks/useTheme" {
|
2152
|
+
import React from 'react';
|
2169
2153
|
import { DeprecatedTheme, Theme } from "editor/themes/types";
|
2154
|
+
export function getCurrentTheme(): Theme & DeprecatedTheme;
|
2155
|
+
export function ThemeProvider(props: React.PropsWithChildren): React.JSX.Element;
|
2156
|
+
export function ThemeConsumer(props: {
|
2157
|
+
children: React.ReactNode | ((params: {
|
2158
|
+
theme: any;
|
2159
|
+
}) => React.ReactNode);
|
2160
|
+
}): React.ReactNode;
|
2161
|
+
export function useThemeInternal(): Theme & DeprecatedTheme;
|
2170
2162
|
export function useTheme(): Theme & DeprecatedTheme;
|
2171
2163
|
}
|
2172
2164
|
declare module "editor/design-system/components/CounterInput" {
|
@@ -2550,27 +2542,20 @@ declare module "editor/design-system/components/ToggleSwitch" {
|
|
2550
2542
|
}
|
2551
2543
|
declare module "editor/components/editors/AutoWidthEditor" {
|
2552
2544
|
import * as React from 'react';
|
2553
|
-
import { EditorProps } from "editor/components/editors/types";
|
2554
2545
|
import { WidgetLabelProps } from "editor/components/editors/common/WidgetLabel";
|
2555
2546
|
import { Device } from "state/types/types";
|
2556
|
-
|
2557
|
-
|
2558
|
-
|
2559
|
-
|
2560
|
-
export type AutoWidthEditorProps = EditorProps<AutoWidthEditorValue> & {
|
2561
|
-
widgetParams?: {
|
2562
|
-
hint?: string | {
|
2563
|
-
id: string;
|
2564
|
-
defaultValue: string;
|
2565
|
-
};
|
2566
|
-
};
|
2547
|
+
import { EditorPropsFromZodSchemas } from "engine/utils/zod/types";
|
2548
|
+
export const schemas: Record<string, import("state/types/types").JSONSchema>, zodSchemas: {
|
2549
|
+
value: any;
|
2550
|
+
widgetParams: any;
|
2567
2551
|
};
|
2552
|
+
export type AutoWidthEditorProps = EditorPropsFromZodSchemas<typeof zodSchemas>;
|
2568
2553
|
export interface AutoWidthEditorBaseProps extends Pick<AutoWidthEditorProps, 'value' | 'defaultValue' | 'disabled' | 'isLockedByStyleGuide'> {
|
2569
2554
|
defaultWidthIsCalculated?: boolean;
|
2570
2555
|
deviceName?: Device;
|
2571
2556
|
widgetLabelProps: Omit<WidgetLabelProps, 'defaultValue' | 'onReset'>;
|
2572
2557
|
handlers: {
|
2573
|
-
onToggleAutoWidth: (autoWidth:
|
2558
|
+
onToggleAutoWidth: (autoWidth: NonNullable<AutoWidthEditorProps['value']>['autoWidth']) => void;
|
2574
2559
|
onChangeWidth: (width: number) => void;
|
2575
2560
|
onReset: NonNullable<WidgetLabelProps['onReset']>;
|
2576
2561
|
};
|
@@ -2768,35 +2753,12 @@ declare module "editor/components/editors/pixie/PixieImageEditor" {
|
|
2768
2753
|
export default PixieImageEditor;
|
2769
2754
|
}
|
2770
2755
|
declare module "editor/components/editors/ImageEditor" {
|
2771
|
-
import {
|
2772
|
-
export
|
2773
|
-
|
2774
|
-
|
2775
|
-
height?: number;
|
2776
|
-
autoWidth?: boolean;
|
2777
|
-
maxWidth?: string;
|
2778
|
-
optimistic?: boolean;
|
2779
|
-
};
|
2780
|
-
export type ImageEditorProps = EditorProps<ImageEditorValue> & {
|
2781
|
-
widgetParams?: {
|
2782
|
-
shouldRender?: {
|
2783
|
-
dropzone?: boolean;
|
2784
|
-
editImageButton?: boolean;
|
2785
|
-
/** @deprecated Use editImageButton instead */
|
2786
|
-
effects?: boolean;
|
2787
|
-
moreImages?: boolean;
|
2788
|
-
stockImages?: boolean;
|
2789
|
-
uploadButton?: boolean;
|
2790
|
-
url?: boolean;
|
2791
|
-
userUploads?: boolean;
|
2792
|
-
width?: boolean;
|
2793
|
-
} | false;
|
2794
|
-
hint?: string | {
|
2795
|
-
id: string;
|
2796
|
-
defaultValue: string;
|
2797
|
-
};
|
2798
|
-
};
|
2756
|
+
import { EditorPropsFromZodSchemas } from "engine/utils/zod/types";
|
2757
|
+
export const schemas: Record<string, import("state/types/types").JSONSchema>, zodSchemas: {
|
2758
|
+
value: any;
|
2759
|
+
widgetParams: any;
|
2799
2760
|
};
|
2761
|
+
export type ImageEditorProps = EditorPropsFromZodSchemas<typeof zodSchemas>;
|
2800
2762
|
export function isDefaultImage(imageUrl: string | undefined): boolean;
|
2801
2763
|
}
|
2802
2764
|
declare module "editor/components/common/Dropzone" {
|
@@ -2883,44 +2845,18 @@ declare module "editor/components/editors/ImageUploader" {
|
|
2883
2845
|
export const ImageUploader: ({ disabled, shouldRender: _shouldRender, label, optionName, location, maxSize, intl, onDropAccepted, onDropRejected, isUploading, uploadProgress, imageUrl, imageWidth, imageHeight, imageSize, togglePixieModal, imageExists, error, onImageSelect, onImageUpload, onUploadProgressChange, onUploadStatusChange, onErrorChange, imageUploadButtonRef, showError, ...restProps }: ImageUploaderProps) => React.JSX.Element;
|
2884
2846
|
}
|
2885
2847
|
declare module "editor/components/editors/BackgroundImageEditor" {
|
2886
|
-
import {
|
2887
|
-
|
2888
|
-
|
2889
|
-
|
2890
|
-
width: number | undefined;
|
2891
|
-
height: number | undefined;
|
2892
|
-
fullWidth: boolean | undefined;
|
2893
|
-
size: 'contain' | 'cover' | 'custom' | undefined;
|
2894
|
-
customSize: [string, string];
|
2895
|
-
repeat: 'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat' | undefined;
|
2896
|
-
position: Position | 'custom' | undefined;
|
2897
|
-
customPosition: [string, string];
|
2848
|
+
import { EditorPropsFromZodSchemas } from "engine/utils/zod/types";
|
2849
|
+
export const schemas: Record<string, import("state/types/types").JSONSchema>, zodSchemas: {
|
2850
|
+
value: any;
|
2851
|
+
widgetParams: any;
|
2898
2852
|
};
|
2899
|
-
export type BackgroundImageEditorProps =
|
2900
|
-
shouldRender?: false | {
|
2901
|
-
dropzone?: boolean;
|
2902
|
-
editImageButton?: boolean;
|
2903
|
-
/** @deprecated Use editImageButton instead */
|
2904
|
-
effects?: boolean;
|
2905
|
-
moreImages?: boolean;
|
2906
|
-
stockImages?: boolean;
|
2907
|
-
uploadButton?: boolean;
|
2908
|
-
url?: boolean;
|
2909
|
-
userUploads?: boolean;
|
2910
|
-
options?: false | {
|
2911
|
-
containerWidth?: boolean;
|
2912
|
-
size?: boolean;
|
2913
|
-
repeat?: boolean;
|
2914
|
-
position?: boolean;
|
2915
|
-
};
|
2916
|
-
};
|
2917
|
-
}>;
|
2853
|
+
export type BackgroundImageEditorProps = EditorPropsFromZodSchemas<typeof zodSchemas>;
|
2918
2854
|
}
|
2919
2855
|
declare module "engine/options/bodies" {
|
2920
|
-
import {
|
2856
|
+
import { BackgroundImageEditorProps } from "editor/components/editors/BackgroundImageEditor";
|
2921
2857
|
export type BodyValues = {
|
2922
2858
|
backgroundColor: string;
|
2923
|
-
backgroundImage:
|
2859
|
+
backgroundImage: BackgroundImageEditorProps['value'];
|
2924
2860
|
contentWidth: string;
|
2925
2861
|
fontFamily: {
|
2926
2862
|
label: string;
|
@@ -3017,6 +2953,7 @@ declare module "embed/Editor" {
|
|
3017
2953
|
exportPdf(callback: (data: ExportFromApiResult) => void, options?: ExportPdfFromApiOptions): void;
|
3018
2954
|
exportZip(callback: (data: ExportFromApiResult) => void, options?: ExportZipFromApiOptions): void;
|
3019
2955
|
setAppearance(appearance: DeepPartial<AppearanceConfig>): void;
|
2956
|
+
setTheme(theme: AppearanceConfig['theme']): void;
|
3020
2957
|
setBodyValues(bodyValues: Partial<BodyValues>, bodyId?: number): void;
|
3021
2958
|
setStyleGuide(styleGuide: StyleGuideConfig): void;
|
3022
2959
|
setDesignTagsConfig(designTagsConfig: DesignTagsConfig): void;
|
package/package.json
CHANGED