unlayer-types 1.52.0 → 1.63.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 +262 -193
- package/package.json +1 -1
package/embed.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
/// <reference types="dompurify" />
|
2
3
|
/// <reference types="lodash" />
|
3
|
-
/// <reference types="react" />
|
4
4
|
/// <reference types="react-modal" />
|
5
5
|
declare module "engine/config/editorSettings" {
|
6
6
|
export interface EditorSettings {
|
@@ -18,170 +18,6 @@ declare module "engine/config/editorSettings" {
|
|
18
18
|
export function overrideEditorSettings(editorSettingsOverrides: EditorSettings): void;
|
19
19
|
export function getEditorSettings(): EditorSettings;
|
20
20
|
}
|
21
|
-
declare module "engine/config/features" {
|
22
|
-
export interface TextEditorCustomButton {
|
23
|
-
name: string;
|
24
|
-
icon: string;
|
25
|
-
text: string;
|
26
|
-
onSetup?: () => void;
|
27
|
-
onAction: (data: {
|
28
|
-
text: string;
|
29
|
-
}, callback: (text: string) => void) => void;
|
30
|
-
}
|
31
|
-
export interface Features {
|
32
|
-
audit?: boolean;
|
33
|
-
blocks?: boolean;
|
34
|
-
collaboration?: boolean;
|
35
|
-
preview?: boolean;
|
36
|
-
imageEditor?: {
|
37
|
-
enabled: boolean;
|
38
|
-
tools?: {
|
39
|
-
resize?: boolean;
|
40
|
-
};
|
41
|
-
} | boolean;
|
42
|
-
preheaderText?: boolean;
|
43
|
-
stockImages?: {
|
44
|
-
enabled: true;
|
45
|
-
safeSearch: true;
|
46
|
-
defaultSearchTerm: string;
|
47
|
-
} | boolean;
|
48
|
-
userUploads?: boolean | {
|
49
|
-
enabled: boolean;
|
50
|
-
search?: boolean;
|
51
|
-
};
|
52
|
-
undoRedo?: boolean;
|
53
|
-
textEditor?: {
|
54
|
-
spellChecker?: boolean;
|
55
|
-
tables?: boolean;
|
56
|
-
cleanPaste?: boolean | 'basic' | 'confirm';
|
57
|
-
emojis?: boolean;
|
58
|
-
textDirection?: boolean | null;
|
59
|
-
inlineFontControls?: boolean;
|
60
|
-
defaultFontSize?: string;
|
61
|
-
customButtons?: TextEditorCustomButton[];
|
62
|
-
};
|
63
|
-
colorPicker?: {
|
64
|
-
presets?: string[];
|
65
|
-
};
|
66
|
-
legacy?: {
|
67
|
-
disableHoverButtonColors?: boolean;
|
68
|
-
};
|
69
|
-
inboxPreviews?: boolean;
|
70
|
-
pageAnchors?: boolean;
|
71
|
-
svgImageUpload?: boolean;
|
72
|
-
smartMergeTags?: boolean;
|
73
|
-
ai?: boolean | {
|
74
|
-
smartHeadings?: boolean;
|
75
|
-
smartButtons?: boolean;
|
76
|
-
magicImage?: boolean;
|
77
|
-
smartText?: boolean;
|
78
|
-
};
|
79
|
-
sendTestEmail?: boolean;
|
80
|
-
}
|
81
|
-
export function setFeatures(newFeatures: Features): void;
|
82
|
-
export function setOverrideFeatures(overrideFeatures: Features): void;
|
83
|
-
export function overrideFeatures(newOverrideFeatures: Features): void;
|
84
|
-
export function getFeatures(): Features;
|
85
|
-
export function getFeature(path: string | string[]): any;
|
86
|
-
export function hasFeature(path: string | string[]): boolean;
|
87
|
-
}
|
88
|
-
declare module "engine/config/offline" {
|
89
|
-
export function enableOffline(): void;
|
90
|
-
export function isOffline(): boolean;
|
91
|
-
}
|
92
|
-
declare module "engine/config/callbacks" {
|
93
|
-
import { Handler } from 'mitt';
|
94
|
-
export type CallbackDoneFn = (result: any) => Promise<void> | void;
|
95
|
-
export type CallbackFn = (data?: any, done?: CallbackDoneFn) => Promise<void> | void;
|
96
|
-
export type CallbackMap = {
|
97
|
-
[name: string]: CallbackFn | undefined;
|
98
|
-
};
|
99
|
-
export function getCallback(type: string): CallbackFn;
|
100
|
-
export function hasCallback(type: string): boolean;
|
101
|
-
export function registerCallback(type: string, callback: CallbackFn | null | undefined): void;
|
102
|
-
export function unregisterCallback(type: string): void;
|
103
|
-
export function triggerCallback(type: string, ...args: [...any[], CallbackDoneFn]): void;
|
104
|
-
export function onRegisterCallback(handler: Handler<{
|
105
|
-
type: string;
|
106
|
-
callback: CallbackFn;
|
107
|
-
}>): {
|
108
|
-
remove: () => void;
|
109
|
-
};
|
110
|
-
export function onTriggerCallback(handler: Handler<{
|
111
|
-
type: string;
|
112
|
-
callback: CallbackFn;
|
113
|
-
}>): {
|
114
|
-
remove: () => void;
|
115
|
-
};
|
116
|
-
export function onUnregisterCallback(handler: Handler<{
|
117
|
-
type: string;
|
118
|
-
}>): {
|
119
|
-
remove: () => void;
|
120
|
-
};
|
121
|
-
}
|
122
|
-
declare module "engine/config/fonts" {
|
123
|
-
export interface Font {
|
124
|
-
defaultFont?: boolean;
|
125
|
-
type?: 'google' | string;
|
126
|
-
label: string;
|
127
|
-
value: string;
|
128
|
-
url?: string;
|
129
|
-
weights?: number[];
|
130
|
-
}
|
131
|
-
export type FontList = Font[];
|
132
|
-
export interface FontConfig {
|
133
|
-
showDefaultFonts?: boolean;
|
134
|
-
customFonts?: FontList;
|
135
|
-
}
|
136
|
-
export interface FontOptions {
|
137
|
-
showCustomFonts?: boolean;
|
138
|
-
showGlobalFont?: boolean;
|
139
|
-
}
|
140
|
-
export function loadFontConfig(newFontConfig?: FontConfig): void;
|
141
|
-
export function disableBuiltinFonts(): void;
|
142
|
-
export function setFonts(newFonts?: FontList): void;
|
143
|
-
export function getFonts(options?: FontOptions): FontList;
|
144
|
-
export function getFontsVersion(): number;
|
145
|
-
export function getCustomFontsCount(): number;
|
146
|
-
export const defaultFontWeights: number[];
|
147
|
-
}
|
148
|
-
declare module "engine/config/safeHtml" {
|
149
|
-
import { Config } from 'dompurify';
|
150
|
-
export interface SafeHtmlOptions {
|
151
|
-
domPurifyOptions?: Config;
|
152
|
-
}
|
153
|
-
export function isSafeHtmlEnabled(): boolean;
|
154
|
-
export function enableSafeHtml(): void;
|
155
|
-
export function setSafeHtmlOptions(options?: SafeHtmlOptions): void;
|
156
|
-
function _toSafeHtmlInternal(html: string, { allowOnClick, force }?: {
|
157
|
-
allowOnClick?: boolean;
|
158
|
-
force?: boolean;
|
159
|
-
}): string;
|
160
|
-
export const toSafeHtmlInternal: typeof _toSafeHtmlInternal & import("lodash").MemoizedFunction;
|
161
|
-
function _toSafeHtml(html: string, { allowOnClick, force, domPurifyOptions, }?: {
|
162
|
-
allowOnClick?: boolean;
|
163
|
-
force?: boolean;
|
164
|
-
domPurifyOptions?: SafeHtmlOptions['domPurifyOptions'];
|
165
|
-
}): any;
|
166
|
-
export const toSafeHtml: typeof _toSafeHtml & import("lodash").MemoizedFunction;
|
167
|
-
}
|
168
|
-
declare module "engine/translations/types" {
|
169
|
-
import stockTranslations from '.';
|
170
|
-
export type StockLocale = keyof typeof stockTranslations;
|
171
|
-
}
|
172
|
-
declare module "engine/config/intl" {
|
173
|
-
import { StockLocale } from "engine/translations/types";
|
174
|
-
export type Locale = StockLocale | 'en-US';
|
175
|
-
export type TextDirection = 'ltr' | 'rtl';
|
176
|
-
export const DEFAULT_LOCALE = "en-US";
|
177
|
-
export const RTL_COUNTRIES: string[];
|
178
|
-
export function getLocale(): Locale;
|
179
|
-
export function setLocale(locale: Locale | null): void;
|
180
|
-
export function getTextDirection(): TextDirection | undefined;
|
181
|
-
export function getTextDirectionForLocale(locale: Locale): TextDirection | undefined;
|
182
|
-
export function setTextDirection(textDirection: TextDirection | null): void;
|
183
|
-
export function isRTL(locale: Locale): boolean;
|
184
|
-
}
|
185
21
|
declare module "editor/components/editors/types" {
|
186
22
|
import { IconDefinition } from '@fortawesome/pro-regular-svg-icons';
|
187
23
|
import { AppearanceConfig, Device, DisplayMode, Location, Variant } from "state/types/types";
|
@@ -198,6 +34,7 @@ declare module "editor/components/editors/types" {
|
|
198
34
|
name: string;
|
199
35
|
data?: object;
|
200
36
|
widgetParams?: WidgetParams;
|
37
|
+
deviceName: Device;
|
201
38
|
displayMode: DisplayMode;
|
202
39
|
label?: string;
|
203
40
|
location: Location;
|
@@ -295,6 +132,14 @@ declare module "editor/components/editors/types" {
|
|
295
132
|
export type DeepPartial<T> = T extends object ? {
|
296
133
|
[P in keyof T]?: DeepPartial<T[P]>;
|
297
134
|
} : T;
|
135
|
+
export type LanguageOverride = {
|
136
|
+
[language: string]: {
|
137
|
+
[propertyName: string]: string;
|
138
|
+
};
|
139
|
+
};
|
140
|
+
export type LanguagesValue = {
|
141
|
+
_languages?: LanguageOverride;
|
142
|
+
};
|
298
143
|
}
|
299
144
|
declare module "editor/themes/types" {
|
300
145
|
import { AppearanceConfig } from "state/types/types";
|
@@ -1457,6 +1302,7 @@ declare module "state/types/types" {
|
|
1457
1302
|
title: string;
|
1458
1303
|
description: string;
|
1459
1304
|
severity: 'ERROR' | 'WARNING';
|
1305
|
+
dismissable?: boolean;
|
1460
1306
|
labelPath?: string | string[] | null;
|
1461
1307
|
};
|
1462
1308
|
export type Audit = {
|
@@ -1468,18 +1314,6 @@ declare module "state/types/types" {
|
|
1468
1314
|
html?: string;
|
1469
1315
|
defaultErrors?: Audit[];
|
1470
1316
|
}) => Promise<Audit[]>;
|
1471
|
-
type GroupedAuditError = {
|
1472
|
-
location: Location;
|
1473
|
-
tool?: AuditTool;
|
1474
|
-
};
|
1475
|
-
export type GroupedAudit = {
|
1476
|
-
[id: string]: {
|
1477
|
-
icon: string;
|
1478
|
-
title: string;
|
1479
|
-
description: string;
|
1480
|
-
errors: GroupedAuditError[];
|
1481
|
-
};
|
1482
|
-
};
|
1483
1317
|
export type AuditApiResult = {
|
1484
1318
|
status: 'FAIL' | 'PASS';
|
1485
1319
|
errors: Audit[];
|
@@ -1545,6 +1379,181 @@ declare module "state/types/types" {
|
|
1545
1379
|
email?: string;
|
1546
1380
|
signature?: string;
|
1547
1381
|
};
|
1382
|
+
export type Language = {
|
1383
|
+
label: string;
|
1384
|
+
value: string;
|
1385
|
+
rtl?: boolean;
|
1386
|
+
default?: boolean;
|
1387
|
+
};
|
1388
|
+
}
|
1389
|
+
declare module "engine/config/features" {
|
1390
|
+
import { Language } from "state/types/types";
|
1391
|
+
export interface TextEditorCustomButton {
|
1392
|
+
name: string;
|
1393
|
+
icon: string;
|
1394
|
+
text: string;
|
1395
|
+
onSetup?: () => void;
|
1396
|
+
onAction: (data: {
|
1397
|
+
text: string;
|
1398
|
+
}, callback: (text: string) => void) => void;
|
1399
|
+
}
|
1400
|
+
export interface Features {
|
1401
|
+
audit?: boolean;
|
1402
|
+
blocks?: boolean;
|
1403
|
+
collaboration?: boolean;
|
1404
|
+
preview?: boolean;
|
1405
|
+
imageEditor?: {
|
1406
|
+
enabled: boolean;
|
1407
|
+
tools?: {
|
1408
|
+
resize?: boolean;
|
1409
|
+
};
|
1410
|
+
} | boolean;
|
1411
|
+
preheaderText?: boolean;
|
1412
|
+
stockImages?: {
|
1413
|
+
enabled: true;
|
1414
|
+
safeSearch: true;
|
1415
|
+
defaultSearchTerm: string;
|
1416
|
+
} | boolean;
|
1417
|
+
userUploads?: boolean | {
|
1418
|
+
enabled: boolean;
|
1419
|
+
search?: boolean;
|
1420
|
+
};
|
1421
|
+
undoRedo?: boolean;
|
1422
|
+
textEditor?: {
|
1423
|
+
spellChecker?: boolean;
|
1424
|
+
tables?: boolean;
|
1425
|
+
cleanPaste?: boolean | 'basic' | 'confirm';
|
1426
|
+
emojis?: boolean;
|
1427
|
+
textDirection?: boolean | null;
|
1428
|
+
inlineFontControls?: boolean;
|
1429
|
+
defaultFontSize?: string;
|
1430
|
+
customButtons?: TextEditorCustomButton[];
|
1431
|
+
};
|
1432
|
+
colorPicker?: {
|
1433
|
+
presets?: string[];
|
1434
|
+
};
|
1435
|
+
legacy?: {
|
1436
|
+
disableHoverButtonColors?: boolean;
|
1437
|
+
};
|
1438
|
+
inboxPreviews?: boolean;
|
1439
|
+
pageAnchors?: boolean;
|
1440
|
+
svgImageUpload?: boolean;
|
1441
|
+
smartMergeTags?: boolean;
|
1442
|
+
multiLanguage?: boolean | {
|
1443
|
+
enabled: boolean;
|
1444
|
+
languages?: Language[];
|
1445
|
+
};
|
1446
|
+
ai?: boolean | {
|
1447
|
+
smartHeadings?: boolean;
|
1448
|
+
smartButtons?: boolean;
|
1449
|
+
magicImage?: boolean;
|
1450
|
+
smartText?: boolean;
|
1451
|
+
};
|
1452
|
+
sendTestEmail?: boolean;
|
1453
|
+
}
|
1454
|
+
export function setFeatures(newFeatures: Features): void;
|
1455
|
+
export function setOverrideFeatures(overrideFeatures: Features): void;
|
1456
|
+
export function overrideFeatures(newOverrideFeatures: Features): void;
|
1457
|
+
export function getFeatures(): Features;
|
1458
|
+
export function getFeature(path: string | string[]): any;
|
1459
|
+
export function hasFeature(path: string | string[]): boolean;
|
1460
|
+
}
|
1461
|
+
declare module "engine/config/offline" {
|
1462
|
+
export function enableOffline(): void;
|
1463
|
+
export function isOffline(): boolean;
|
1464
|
+
}
|
1465
|
+
declare module "engine/config/callbacks" {
|
1466
|
+
import { Handler } from 'mitt';
|
1467
|
+
export type CallbackDoneFn = (result: any) => Promise<void> | void;
|
1468
|
+
export type CallbackFn = (data?: any, done?: CallbackDoneFn) => Promise<void> | void;
|
1469
|
+
export type CallbackMap = {
|
1470
|
+
[name: string]: CallbackFn | undefined;
|
1471
|
+
};
|
1472
|
+
export function getCallback(type: string): CallbackFn;
|
1473
|
+
export function hasCallback(type: string): boolean;
|
1474
|
+
export function registerCallback(type: string, callback: CallbackFn | null | undefined): void;
|
1475
|
+
export function unregisterCallback(type: string): void;
|
1476
|
+
export function triggerCallback(type: string, ...args: [...any[], CallbackDoneFn | undefined]): void;
|
1477
|
+
export function onRegisterCallback(handler: Handler<{
|
1478
|
+
type: string;
|
1479
|
+
callback: CallbackFn;
|
1480
|
+
}>): {
|
1481
|
+
remove: () => void;
|
1482
|
+
};
|
1483
|
+
export function onTriggerCallback(handler: Handler<{
|
1484
|
+
type: string;
|
1485
|
+
callback: CallbackFn;
|
1486
|
+
}>): {
|
1487
|
+
remove: () => void;
|
1488
|
+
};
|
1489
|
+
export function onUnregisterCallback(handler: Handler<{
|
1490
|
+
type: string;
|
1491
|
+
}>): {
|
1492
|
+
remove: () => void;
|
1493
|
+
};
|
1494
|
+
}
|
1495
|
+
declare module "engine/config/fonts" {
|
1496
|
+
export interface Font {
|
1497
|
+
defaultFont?: boolean;
|
1498
|
+
type?: 'google' | string;
|
1499
|
+
label: string;
|
1500
|
+
value: string;
|
1501
|
+
url?: string;
|
1502
|
+
weights?: number[];
|
1503
|
+
}
|
1504
|
+
export type FontList = Font[];
|
1505
|
+
export interface FontConfig {
|
1506
|
+
showDefaultFonts?: boolean;
|
1507
|
+
customFonts?: FontList;
|
1508
|
+
}
|
1509
|
+
export interface FontOptions {
|
1510
|
+
showCustomFonts?: boolean;
|
1511
|
+
showGlobalFont?: boolean;
|
1512
|
+
}
|
1513
|
+
export function loadFontConfig(newFontConfig?: FontConfig): void;
|
1514
|
+
export function disableBuiltinFonts(): void;
|
1515
|
+
export function setFonts(newFonts?: FontList): void;
|
1516
|
+
export function getFonts(options?: FontOptions): FontList;
|
1517
|
+
export function getFontsVersion(): number;
|
1518
|
+
export function getCustomFontsCount(): number;
|
1519
|
+
export const defaultFontWeights: number[];
|
1520
|
+
}
|
1521
|
+
declare module "engine/config/safeHtml" {
|
1522
|
+
import { Config } from 'dompurify';
|
1523
|
+
export interface SafeHtmlOptions {
|
1524
|
+
domPurifyOptions?: Config;
|
1525
|
+
}
|
1526
|
+
export function isSafeHtmlEnabled(): boolean;
|
1527
|
+
export function enableSafeHtml(): void;
|
1528
|
+
export function setSafeHtmlOptions(options?: SafeHtmlOptions): void;
|
1529
|
+
function _toSafeHtmlInternal(html: string, { allowOnClick, force }?: {
|
1530
|
+
allowOnClick?: boolean;
|
1531
|
+
force?: boolean;
|
1532
|
+
}): string;
|
1533
|
+
export const toSafeHtmlInternal: typeof _toSafeHtmlInternal & import("lodash").MemoizedFunction;
|
1534
|
+
function _toSafeHtml(html: string, { allowOnClick, force, domPurifyOptions, }?: {
|
1535
|
+
allowOnClick?: boolean;
|
1536
|
+
force?: boolean;
|
1537
|
+
domPurifyOptions?: SafeHtmlOptions['domPurifyOptions'];
|
1538
|
+
}): any;
|
1539
|
+
export const toSafeHtml: typeof _toSafeHtml & import("lodash").MemoizedFunction;
|
1540
|
+
}
|
1541
|
+
declare module "engine/translations/types" {
|
1542
|
+
import stockTranslations from '.';
|
1543
|
+
export type StockLocale = keyof typeof stockTranslations;
|
1544
|
+
}
|
1545
|
+
declare module "engine/config/intl" {
|
1546
|
+
import { StockLocale } from "engine/translations/types";
|
1547
|
+
export type Locale = StockLocale | 'en-US';
|
1548
|
+
export type TextDirection = 'ltr' | 'rtl';
|
1549
|
+
export const DEFAULT_LOCALE = "en-US";
|
1550
|
+
export const RTL_COUNTRIES: string[];
|
1551
|
+
export function getLocale(): Locale;
|
1552
|
+
export function setLocale(locale: Locale | null): void;
|
1553
|
+
export function getTextDirection(): TextDirection | undefined;
|
1554
|
+
export function getTextDirectionForLocale(locale: Locale): TextDirection | undefined;
|
1555
|
+
export function setTextDirection(textDirection: TextDirection | null): void;
|
1556
|
+
export function isRTL(locale: Locale): boolean;
|
1548
1557
|
}
|
1549
1558
|
declare module "embed/Config" {
|
1550
1559
|
import { ValidationResult } from 'amphtml-validator';
|
@@ -1615,6 +1624,7 @@ declare module "embed/Config" {
|
|
1615
1624
|
cleanup?: boolean;
|
1616
1625
|
textDirection?: TextDirection;
|
1617
1626
|
isPreview?: boolean;
|
1627
|
+
language?: string;
|
1618
1628
|
live?: boolean;
|
1619
1629
|
mergeTags?: MergeTagsValues;
|
1620
1630
|
minify?: boolean;
|
@@ -1670,6 +1680,7 @@ declare module "embed/Config" {
|
|
1670
1680
|
}
|
1671
1681
|
interface BaseExportFromApiOptions {
|
1672
1682
|
mergeTags?: Record<string, string>;
|
1683
|
+
language?: string;
|
1673
1684
|
}
|
1674
1685
|
export interface ExportImageFromApiOptions extends BaseExportFromApiOptions {
|
1675
1686
|
width?: number;
|
@@ -1884,11 +1895,13 @@ declare module "editor/design-system/components/Dropdown" {
|
|
1884
1895
|
import React from 'react';
|
1885
1896
|
import * as Ariakit from '@ariakit/react';
|
1886
1897
|
import { IconDefinition } from '@fortawesome/pro-regular-svg-icons';
|
1898
|
+
import { TooltipProps } from "editor/design-system/components/Tooltip";
|
1887
1899
|
export interface SelectOption {
|
1888
1900
|
icon?: IconDefinition;
|
1889
1901
|
label: string;
|
1890
1902
|
value: any;
|
1891
1903
|
tooltip?: string;
|
1904
|
+
tooltipPlacement?: TooltipProps['placement'];
|
1892
1905
|
meta?: Record<string, unknown>;
|
1893
1906
|
onClick?: (e: React.MouseEvent, selected: boolean) => void;
|
1894
1907
|
selected: boolean;
|
@@ -1908,6 +1921,7 @@ declare module "editor/design-system/components/Dropdown" {
|
|
1908
1921
|
asLink?: boolean;
|
1909
1922
|
badge?: number;
|
1910
1923
|
className?: string;
|
1924
|
+
icon?: IconDefinition;
|
1911
1925
|
caret?: boolean;
|
1912
1926
|
disabled?: boolean;
|
1913
1927
|
fallbackLabel?: string;
|
@@ -1923,6 +1937,8 @@ declare module "editor/design-system/components/Dropdown" {
|
|
1923
1937
|
renderHeader?: () => React.ReactNode;
|
1924
1938
|
style?: React.CSSProperties;
|
1925
1939
|
customPopoverStyles?: React.CSSProperties;
|
1940
|
+
tooltip?: string;
|
1941
|
+
tooltipPlacement?: TooltipProps['placement'];
|
1926
1942
|
} & ({
|
1927
1943
|
renderOption?: (option: SelectOption) => React.ReactNode;
|
1928
1944
|
renderOptionLabel?: never;
|
@@ -2113,14 +2129,23 @@ declare module "editor/helpers/image" {
|
|
2113
2129
|
export function fetchImage(imageURL: string, { proxyURL, retryWithoutProxy, }?: {
|
2114
2130
|
proxyURL?: string;
|
2115
2131
|
retryWithoutProxy?: boolean;
|
2116
|
-
}): Promise<
|
2132
|
+
}): Promise<{
|
2133
|
+
blob: Blob;
|
2134
|
+
url: string;
|
2135
|
+
}>;
|
2117
2136
|
export function tryFetchImageBlob(imageURL: string, requestOptions?: RequestInit, { cache }?: {
|
2118
2137
|
cache?: boolean;
|
2119
2138
|
}): Promise<Blob>;
|
2139
|
+
export function getImageUrlWithProxy(imageURL: string, { proxyURL }?: {
|
2140
|
+
proxyURL?: string;
|
2141
|
+
}): string;
|
2120
2142
|
export function fetchImageViaProxy(imageURL: string, { proxyURL, retryWithoutProxy, }?: {
|
2121
2143
|
proxyURL?: string;
|
2122
2144
|
retryWithoutProxy?: boolean;
|
2123
|
-
}): Promise<
|
2145
|
+
}): Promise<{
|
2146
|
+
blob: Blob;
|
2147
|
+
url: string;
|
2148
|
+
}>;
|
2124
2149
|
export const tryLoadImageFromStringOrBlob: ((imageSrcOrBlob: string | Blob) => Promise<{
|
2125
2150
|
image: {
|
2126
2151
|
width: number;
|
@@ -2275,12 +2300,13 @@ declare module "editor/components/common/Dropzone" {
|
|
2275
2300
|
imageHeight?: number;
|
2276
2301
|
imageSize?: number;
|
2277
2302
|
imageName?: string;
|
2278
|
-
shouldRenderEditImageButton?: boolean;
|
2279
|
-
onEditImageClick?: () => void;
|
2280
2303
|
isEditImageButtonDisabled?: boolean;
|
2281
|
-
|
2282
|
-
|
2283
|
-
|
2304
|
+
onEditImageClick?: () => void;
|
2305
|
+
shouldRender?: {
|
2306
|
+
dropzone?: boolean;
|
2307
|
+
editImageButton?: boolean;
|
2308
|
+
imageInfo?: boolean;
|
2309
|
+
};
|
2284
2310
|
}
|
2285
2311
|
export function Dropzone(props: DropzoneProps): JSX.Element;
|
2286
2312
|
}
|
@@ -2304,18 +2330,20 @@ declare module "editor/components/editors/ImageUploader" {
|
|
2304
2330
|
import { Location } from "state/types/types";
|
2305
2331
|
export interface ImageUploaderProps {
|
2306
2332
|
shouldRender: {
|
2307
|
-
uploadButton?: boolean;
|
2308
2333
|
dropzone?: boolean;
|
2334
|
+
editImageButton?: boolean;
|
2309
2335
|
/** @deprecated Use editImageButton instead */
|
2310
2336
|
effects?: boolean;
|
2311
|
-
|
2337
|
+
imageInfo?: boolean;
|
2338
|
+
moreImages?: boolean;
|
2339
|
+
stockImages?: boolean;
|
2340
|
+
uploadButton?: boolean;
|
2341
|
+
userUploads?: boolean;
|
2312
2342
|
};
|
2313
2343
|
label: string;
|
2314
2344
|
optionName: string;
|
2315
2345
|
location: Location;
|
2316
2346
|
maxSize: number;
|
2317
|
-
showImagesDropdown?: boolean;
|
2318
|
-
showUploadsDropdown?: boolean;
|
2319
2347
|
intl: any;
|
2320
2348
|
onDropAccepted: (files: File[]) => void;
|
2321
2349
|
onDropRejected: (fileRejections: FileRejection[], event: DropEvent) => void;
|
@@ -2336,7 +2364,7 @@ declare module "editor/components/editors/ImageUploader" {
|
|
2336
2364
|
imageUploadButtonRef: RefObject<ImageUploadButtonInstance>;
|
2337
2365
|
showError?: boolean;
|
2338
2366
|
}
|
2339
|
-
export const ImageUploader: ({ shouldRender: _shouldRender, label, optionName, location, maxSize,
|
2367
|
+
export const ImageUploader: ({ 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) => JSX.Element;
|
2340
2368
|
}
|
2341
2369
|
declare module "editor/themes/helpers" {
|
2342
2370
|
import { Theme } from "editor/themes/types";
|
@@ -2418,10 +2446,37 @@ declare module "editor/design-system/components/ToggleSwitch" {
|
|
2418
2446
|
}
|
2419
2447
|
export const ToggleSwitch: React.ForwardRefExoticComponent<ToggleSwitchProps & React.RefAttributes<HTMLLabelElement>>;
|
2420
2448
|
}
|
2449
|
+
declare module "editor/design-system/components/Popover" {
|
2450
|
+
import React from 'react';
|
2451
|
+
import * as Ariakit from '@ariakit/react';
|
2452
|
+
export interface PopoverProps {
|
2453
|
+
arrow?: boolean;
|
2454
|
+
autoFocusOnShow?: boolean;
|
2455
|
+
autoFocusOnHide?: boolean;
|
2456
|
+
children: Ariakit.PopoverAnchorProps['children'];
|
2457
|
+
className?: string;
|
2458
|
+
content: Ariakit.PopoverProps['children'];
|
2459
|
+
destroyPopupOnHide?: boolean;
|
2460
|
+
disabled?: boolean;
|
2461
|
+
onHide?: () => void;
|
2462
|
+
onShow?: () => void;
|
2463
|
+
placement: Ariakit.PopoverStoreProps['placement'];
|
2464
|
+
popoverWrapper?: Ariakit.PopoverAnchorProps['render'];
|
2465
|
+
style?: React.CSSProperties;
|
2466
|
+
}
|
2467
|
+
export interface PopoverInstance {
|
2468
|
+
isOpen: boolean;
|
2469
|
+
show: () => void;
|
2470
|
+
hide: () => void;
|
2471
|
+
}
|
2472
|
+
export const Popover: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<PopoverInstance>>;
|
2473
|
+
}
|
2421
2474
|
declare module "editor/design-system/components/Bar" {
|
2422
2475
|
import React, { ReactNode } from 'react';
|
2423
2476
|
import { IconDefinition } from '@fortawesome/pro-regular-svg-icons';
|
2424
2477
|
import { TooltipProps } from "editor/design-system/components/Tooltip";
|
2478
|
+
import { DropdownProps } from "editor/design-system/components/Dropdown";
|
2479
|
+
import { PopoverProps } from "editor/design-system/components/Popover";
|
2425
2480
|
export const BAR_HEIGHT = 40;
|
2426
2481
|
export const BAR_ITEM_WIDTH = 50;
|
2427
2482
|
export const BAR_ITEM_COMPACT_WIDTH = 30;
|
@@ -2430,6 +2485,7 @@ declare module "editor/design-system/components/Bar" {
|
|
2430
2485
|
label: string;
|
2431
2486
|
value: any;
|
2432
2487
|
tooltip?: string;
|
2488
|
+
tooltipPlacement?: TooltipProps['placement'];
|
2433
2489
|
meta?: object;
|
2434
2490
|
onClick?: (e: React.MouseEvent, selected: boolean) => void;
|
2435
2491
|
selected?: boolean;
|
@@ -2448,6 +2504,7 @@ declare module "editor/design-system/components/Bar" {
|
|
2448
2504
|
icon?: IconDefinition;
|
2449
2505
|
text: string;
|
2450
2506
|
tooltip?: string;
|
2507
|
+
tooltipPlacement?: TooltipProps['placement'];
|
2451
2508
|
badge?: number;
|
2452
2509
|
loading?: boolean;
|
2453
2510
|
}
|
@@ -2458,6 +2515,7 @@ declare module "editor/design-system/components/Bar" {
|
|
2458
2515
|
icon: IconDefinition | undefined;
|
2459
2516
|
label?: string;
|
2460
2517
|
tooltip?: string;
|
2518
|
+
tooltipPlacement?: TooltipProps['placement'];
|
2461
2519
|
badge?: number;
|
2462
2520
|
onClick?: (e: React.MouseEvent) => void;
|
2463
2521
|
destructive?: boolean;
|
@@ -2472,6 +2530,7 @@ declare module "editor/design-system/components/Bar" {
|
|
2472
2530
|
type: 'toggle';
|
2473
2531
|
icon: IconDefinition;
|
2474
2532
|
tooltip?: string;
|
2533
|
+
tooltipPlacement?: TooltipProps['placement'];
|
2475
2534
|
label?: string;
|
2476
2535
|
badge?: number;
|
2477
2536
|
onClick?: (e: React.MouseEvent) => void;
|
@@ -2485,8 +2544,10 @@ declare module "editor/design-system/components/Bar" {
|
|
2485
2544
|
}
|
2486
2545
|
type BarDropdownItem = {
|
2487
2546
|
key: string;
|
2547
|
+
className?: string;
|
2488
2548
|
type: 'dropdown';
|
2489
2549
|
ariaLabel?: string;
|
2550
|
+
icon?: IconDefinition;
|
2490
2551
|
multi?: boolean;
|
2491
2552
|
renderOption?: (option: SelectOption) => React.ReactNode;
|
2492
2553
|
renderOptionLabel?: (option: SelectOption) => React.ReactNode;
|
@@ -2494,6 +2555,8 @@ declare module "editor/design-system/components/Bar" {
|
|
2494
2555
|
badge?: number;
|
2495
2556
|
disabled?: boolean;
|
2496
2557
|
tooltip?: string;
|
2558
|
+
tooltipPlacement?: TooltipProps['placement'];
|
2559
|
+
dropdownProps?: DropdownProps;
|
2497
2560
|
triggerLabel?: string | React.ReactNode;
|
2498
2561
|
caret?: boolean;
|
2499
2562
|
renderHeader?: () => React.ReactNode;
|
@@ -2518,7 +2581,8 @@ declare module "editor/design-system/components/Bar" {
|
|
2518
2581
|
items?: BarItem[];
|
2519
2582
|
rightItems?: BarItem[];
|
2520
2583
|
style?: React.CSSProperties;
|
2521
|
-
tooltipPlacement
|
2584
|
+
tooltipPlacement?: TooltipProps['placement'];
|
2585
|
+
popoverPlacement?: PopoverProps['placement'];
|
2522
2586
|
}
|
2523
2587
|
export function Bar(props: BarProps): JSX.Element;
|
2524
2588
|
}
|
@@ -2549,14 +2613,17 @@ declare module "editor/components/editors/BackgroundImageEditor" {
|
|
2549
2613
|
position: Position | 'custom' | undefined;
|
2550
2614
|
customPosition: [string, string];
|
2551
2615
|
};
|
2552
|
-
export type
|
2616
|
+
export type BackgroundImageEditorProps = EditorProps<BackgroundImageEditorValue, {
|
2553
2617
|
shouldRender?: false | {
|
2554
2618
|
dropzone?: boolean;
|
2619
|
+
editImageButton?: boolean;
|
2555
2620
|
/** @deprecated Use editImageButton instead */
|
2556
2621
|
effects?: boolean;
|
2557
|
-
|
2622
|
+
moreImages?: boolean;
|
2623
|
+
stockImages?: boolean;
|
2558
2624
|
uploadButton?: boolean;
|
2559
2625
|
url?: boolean;
|
2626
|
+
userUploads?: boolean;
|
2560
2627
|
options?: false | {
|
2561
2628
|
containerWidth?: boolean;
|
2562
2629
|
size?: boolean;
|
@@ -2611,7 +2678,7 @@ declare module "embed/helpers" {
|
|
2611
2678
|
declare module "embed/Editor" {
|
2612
2679
|
import { Frame } from "embed/Frame";
|
2613
2680
|
import { Config, ExportFromApiResult, ExportHtmlOptions, ExportHtmlResult, ExportPlainTextResult, ExportImageFromApiOptions, ExportLiveHtmlOptions, ExportPdfFromApiOptions, ExportPlainTextOptions, ExportZipFromApiOptions, SaveDesignOptions, ExportLiveHtmlResult } from "embed/Config";
|
2614
|
-
import { AppearanceConfig, Audit, DesignTagsConfig, Device, DisplayConditions, DisplayMode, JSONTemplate, LinkTypes, LinkTypesSharedConfig, MergeTags, MergeTagsConfig, SpecialLink, Tabs, Translations, User, Validator } from "state/types/types";
|
2681
|
+
import { AppearanceConfig, Audit, DesignTagsConfig, Device, DisplayConditions, DisplayMode, JSONTemplate, Language, LinkTypes, LinkTypesSharedConfig, MergeTags, MergeTagsConfig, SpecialLink, Tabs, Translations, User, Validator } from "state/types/types";
|
2615
2682
|
import { BodyValues } from "engine/options/bodies";
|
2616
2683
|
import { Locale, TextDirection } from "engine/config/intl";
|
2617
2684
|
import { DeepPartial } from "editor/components/editors/types";
|
@@ -2681,6 +2748,8 @@ declare module "embed/Editor" {
|
|
2681
2748
|
setToolValidator(tool: string, validator: Validator | null): void;
|
2682
2749
|
updateTabs(tabs: Tabs): void;
|
2683
2750
|
clearValidators(): void;
|
2751
|
+
setCurrentLanguage(language: string): void;
|
2752
|
+
setLanguages(languages: Language[]): void;
|
2684
2753
|
registerContainerExporter(): void;
|
2685
2754
|
registerItemExporter(): void;
|
2686
2755
|
registerTool(): void;
|
package/package.json
CHANGED