unlayer-types 1.208.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.
Files changed (2) hide show
  1. package/embed.d.ts +52 -74
  2. package/package.json +1 -1
package/embed.d.ts CHANGED
@@ -60,6 +60,7 @@ declare module "editor/components/editors/types" {
60
60
  customJS?: boolean;
61
61
  customTools?: number;
62
62
  customTabs?: number;
63
+ customThemes?: boolean;
63
64
  imageEditor?: boolean;
64
65
  selectImage?: boolean;
65
66
  stockImages?: boolean;
@@ -143,8 +144,12 @@ declare module "editor/components/editors/types" {
143
144
  }
144
145
  declare module "editor/themes/types" {
145
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';
146
150
  export type Theme = {
147
- name: 'classic_light' | 'classic_dark' | 'modern_light' | 'modern_dark';
151
+ name: ThemeName;
152
+ isCustom?: boolean;
148
153
  isDark: boolean;
149
154
  isClassic?: boolean;
150
155
  mapping: {
@@ -632,6 +637,14 @@ declare module "editor/themes/types" {
632
637
  export type BannerMessageVariant = 'success' | 'warning' | 'default' | 'danger';
633
638
  export type ToastVariant = 'success' | 'warning' | 'default' | 'danger';
634
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
+ };
635
648
  export type BorderRadius = 'none' | 'min' | 'mid' | 'max' | 'full';
636
649
  export type ButtonThemeObject = {
637
650
  backgroundColor: ColorValue;
@@ -1100,33 +1113,12 @@ declare module "editor/themes/types" {
1100
1113
  boxShadowColor: string;
1101
1114
  };
1102
1115
  };
1103
- imageCard: {
1104
- backgroundColor: string;
1105
- textColor: string;
1106
- boxShadowColor: string;
1107
- hover: {
1108
- backgroundColor: string;
1109
- textColor: string;
1110
- boxShadowColor: string;
1111
- };
1112
- };
1113
1116
  closeButton: {
1114
1117
  iconColor: string;
1115
1118
  hover: {
1116
1119
  iconColor: string;
1117
1120
  };
1118
1121
  };
1119
- error: {
1120
- icon: {
1121
- textColor: string;
1122
- };
1123
- };
1124
- footer: {
1125
- backgroundColor: string;
1126
- textColor: string;
1127
- borderColor: string;
1128
- boxShadowColor: string;
1129
- };
1130
1122
  loader: {
1131
1123
  backgroundColor: string;
1132
1124
  content: {
@@ -1138,46 +1130,6 @@ declare module "editor/themes/types" {
1138
1130
  backgroundColor: string;
1139
1131
  };
1140
1132
  };
1141
- overlay: {
1142
- backgroundColor: string;
1143
- };
1144
- recents: {
1145
- backgroundColor: string;
1146
- textColor: string;
1147
- borderColor: string;
1148
- boxShadowColor: string;
1149
- hover: {
1150
- backgroundColor: string;
1151
- textColor: string;
1152
- borderColor: string;
1153
- };
1154
- };
1155
- score: {
1156
- default: {
1157
- backgroundColor: string;
1158
- textColor: string;
1159
- };
1160
- good: {
1161
- backgroundColor: string;
1162
- textColor: string;
1163
- };
1164
- bad: {
1165
- backgroundColor: string;
1166
- textColor: string;
1167
- };
1168
- };
1169
- /** @deprecated */
1170
- warning: {
1171
- backgroundColor: string;
1172
- color: string;
1173
- };
1174
- };
1175
- /** @deprecated */
1176
- ai: {
1177
- color: string;
1178
- focus: {
1179
- color: string;
1180
- };
1181
1133
  };
1182
1134
  };
1183
1135
  }
@@ -1203,7 +1155,7 @@ declare module "state/types/types" {
1203
1155
  import { z } from 'zod';
1204
1156
  import { State as Design } from '../reducer/design';
1205
1157
  import { CollaborationThread } from "editor/components/editors/types";
1206
- import { Theme } from "editor/themes/types";
1158
+ import { ThemeExtension, ThemeNamePlusLightDark } from "editor/themes/types";
1207
1159
  import { collections } from "engine/constants";
1208
1160
  import { DisplayConditionZodSchema } from "engine/utils/zod/schemas";
1209
1161
  export type DesignMode = 'live' | 'edit';
@@ -1354,7 +1306,6 @@ declare module "state/types/types" {
1354
1306
  }
1355
1307
  export interface Usage {
1356
1308
  brandStyleGuide?: boolean;
1357
- builtInThemes?: string;
1358
1309
  collaboration?: boolean;
1359
1310
  countdownTimer?: boolean;
1360
1311
  customBlocks?: number;
@@ -1380,6 +1331,7 @@ declare module "state/types/types" {
1380
1331
  premiumTools?: boolean;
1381
1332
  sendTestEmail?: boolean;
1382
1333
  specialLinks?: number;
1334
+ theme?: string;
1383
1335
  }
1384
1336
  export type ImageSource = 'unsplash' | 'pixabay' | 'pexel' | 'user';
1385
1337
  export interface Image {
@@ -1482,7 +1434,7 @@ declare module "state/types/types" {
1482
1434
  };
1483
1435
  };
1484
1436
  };
1485
- theme?: Theme['name'] | 'light' | 'dark';
1437
+ theme?: ThemeNamePlusLightDark | ThemeExtension;
1486
1438
  };
1487
1439
  export interface ToolConfig {
1488
1440
  enabled?: boolean | undefined;
@@ -2010,16 +1962,33 @@ declare module "editor/components/editors/PositionEditor" {
2010
1962
  declare module "editor/hooks/useDynamicRef" {
2011
1963
  export function useDynamicRef<T>(value: T): import("react").MutableRefObject<T>;
2012
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
+ }
2013
1978
  declare module "editor/design-system/components/Input" {
2014
1979
  import React from 'react';
2015
1980
  import * as Ariakit from '@ariakit/react';
1981
+ import { IconDefinition } from '@fortawesome/pro-regular-svg-icons';
1982
+ import { Icon } from "state/types/types";
2016
1983
  export interface InputProps extends Omit<Ariakit.FormInputProps, 'as' | 'onSubmit' | 'onSubmitCapture'> {
2017
1984
  formStore?: Ariakit.FormStore<{
2018
1985
  value: string;
2019
1986
  }>;
1987
+ icon?: Icon | IconDefinition;
2020
1988
  label?: React.ReactNode;
2021
1989
  labelPosition?: 'top' | 'left' | 'right';
2022
1990
  name: string;
1991
+ onClear?: () => void;
2023
1992
  onSubmit?: (value: string | number) => void;
2024
1993
  placeholder?: string;
2025
1994
  required?: boolean;
@@ -2036,6 +2005,7 @@ declare module "editor/design-system/components/Input" {
2036
2005
  FormLabel: import("styled-components").StyledComponent<any, any, any, any>;
2037
2006
  FormInput: import("styled-components").StyledComponent<any, any, any, any>;
2038
2007
  Message: import("styled-components").StyledComponent<"div", any, {}, never>;
2008
+ ClearButton: import("styled-components").StyledComponent<any, any, any, any>;
2039
2009
  };
2040
2010
  }
2041
2011
  declare module "editor/design-system/components/Button" {
@@ -2145,31 +2115,29 @@ declare module "editor/design-system/components/Dropdown" {
2145
2115
  export function Dropdown(props: DropdownProps): React.JSX.Element;
2146
2116
  }
2147
2117
  declare module "editor/themes/helpers" {
2148
- 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;
2149
2121
  export function parseThemeValues<T extends Theme>(theme: T): T;
2150
2122
  }
2151
2123
  declare module "editor/themes/modern/light" {
2152
2124
  import { DeprecatedTheme, Theme } from "editor/themes/types";
2153
2125
  export const unparsedTheme: Theme & DeprecatedTheme;
2154
- export const parsedTheme: Theme & DeprecatedTheme;
2155
2126
  }
2156
2127
  declare module "editor/themes/classic/light" {
2157
- export const unparsedTheme: any;
2158
- export const parsedTheme: any;
2128
+ export const unparsedTheme: import("editor/themes/types").Theme & import("editor/themes/types").DeprecatedTheme;
2159
2129
  }
2160
2130
  declare module "editor/themes/modern/dark" {
2161
2131
  import { DeprecatedTheme, Theme } from "editor/themes/types";
2162
2132
  export const unparsedTheme: Theme & DeprecatedTheme;
2163
- export const parsedTheme: Theme & DeprecatedTheme;
2164
2133
  }
2165
2134
  declare module "editor/themes/classic/dark" {
2166
- export const unparsedTheme: any;
2167
- export const parsedTheme: any;
2135
+ export const unparsedTheme: import("editor/themes/types").Theme & import("editor/themes/types").DeprecatedTheme;
2168
2136
  }
2169
2137
  declare module "editor/themes/index" {
2170
2138
  const themes: {
2171
- classic_light: any;
2172
- classic_dark: any;
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;
2173
2141
  modern_light: import("editor/themes/types").Theme & import("editor/themes/types").DeprecatedTheme;
2174
2142
  modern_dark: import("editor/themes/types").Theme & import("editor/themes/types").DeprecatedTheme;
2175
2143
  };
@@ -2181,7 +2149,16 @@ declare module "state/types/RootState" {
2181
2149
  export type RootState = StateType<typeof reducer>;
2182
2150
  }
2183
2151
  declare module "editor/hooks/useTheme" {
2152
+ import React from 'react';
2184
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;
2185
2162
  export function useTheme(): Theme & DeprecatedTheme;
2186
2163
  }
2187
2164
  declare module "editor/design-system/components/CounterInput" {
@@ -2976,6 +2953,7 @@ declare module "embed/Editor" {
2976
2953
  exportPdf(callback: (data: ExportFromApiResult) => void, options?: ExportPdfFromApiOptions): void;
2977
2954
  exportZip(callback: (data: ExportFromApiResult) => void, options?: ExportZipFromApiOptions): void;
2978
2955
  setAppearance(appearance: DeepPartial<AppearanceConfig>): void;
2956
+ setTheme(theme: AppearanceConfig['theme']): void;
2979
2957
  setBodyValues(bodyValues: Partial<BodyValues>, bodyId?: number): void;
2980
2958
  setStyleGuide(styleGuide: StyleGuideConfig): void;
2981
2959
  setDesignTagsConfig(designTagsConfig: DesignTagsConfig): void;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "unlayer-types",
3
- "version": "1.208.0",
3
+ "version": "1.209.0",
4
4
  "license": "MIT"
5
5
  }