useblocks 1.1.45 → 1.1.49
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/iframe/js/amp.BP7EklKo.js +1 -0
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.4N5s3OV-.js +1 -1
- package/monacoeditorwork/css.worker.bundle.js +40524 -40442
- package/monacoeditorwork/editor.worker.bundle.js +9740 -9697
- package/monacoeditorwork/html.worker.bundle.js +50513 -50431
- package/monacoeditorwork/json.worker.bundle.js +14570 -14527
- package/monacoeditorwork/ts.worker.bundle.js +119593 -119455
- package/npm-publish.manifest.json +7 -7
- package/package.json +1 -1
- package/runtime/@ant-design/cssinjs/index.js +1 -1
- package/runtime/@ant-design/icons/index.js +2 -2
- package/runtime/README.md +1 -1
- package/runtime/THIRD_PARTY_LICENSES.txt +70 -42
- package/runtime/antd/index.js +1 -1
- package/runtime/react/index.js +3 -3
- package/runtime/react/jsx-runtime/index.js +1 -1
- package/runtime/react-dom/client/index.js +4 -4
- package/runtime/react-dom/index.js +3 -3
- package/runtime/react-router-dom/index.js +2 -2
- package/singlepage_headless_plugin.html +1 -1
- package/static/core/{cb72ea5e.js → 11296a18.js} +51 -51
- package/static/core/{7d884291.js → 13d197af.js} +20 -20
- package/static/core/13f581cc.js +924 -0
- package/static/core/{6450546e2.js → 1ca5f3772.js} +184 -155
- package/static/core/{af153381.js → 339377b8.js} +15657 -15202
- package/static/core/{94f2c0df.js → 386cf7b3.js} +9673 -9544
- package/static/core/{b7a9d262.js → 3b4845f7.js} +353 -334
- package/static/core/{d14cb6e2.js → 3dea3b87.js} +7 -7
- package/static/core/59023866.js +2090 -0
- package/static/core/{bc098620.js → 7a229b90.js} +3 -3
- package/static/core/{48b80eec.js → 8c81db36.js} +3 -3
- package/static/core/{8c84cc76.js → 8e110c69.js} +24 -24
- package/static/core/{2f2019c1.js → a11c28c2.js} +258 -240
- package/static/core/{fd4fa049.js → aacf134d.js} +745 -664
- package/static/core/{5e0828e3.js → acb049cb.js} +1349 -1297
- package/static/core/{bb774fb9.js → c59f9731.js} +7724 -6646
- package/static/core/{ed0ecf0a.js → de79e0c5.js} +3947 -3705
- package/static/core/e7c24fe9.js +649 -0
- package/static/esm/{dab4cdfd.js → 448d4bb0.js} +70 -70
- package/static/esm/{7c5227f0.js → d180c108.js} +50 -47
- package/static/runtime/{DownloadOutlined-CgJ8OpH_.js → DownloadOutlined-Dg_G2xO7.js} +4 -4
- package/static/runtime/client-CfXgU5Vo.js +7580 -0
- package/static/runtime/{defineProperty-B-FyVNQF.js → defineProperty-C_9hhJHt.js} +1 -1
- package/static/runtime/dom-export-CHgQ7Ws9.js +8069 -0
- package/static/runtime/{es-DnZp8dh1.js → es-BPfImJ0x.js} +5 -5
- package/static/runtime/{es-B2DS-PLP.js → es-DcH6fwd6.js} +2 -2
- package/static/runtime/{es-deqzngIL.js → es-_OY-D9g1.js} +2 -2
- package/static/runtime/{jsx-dev-runtime-Wj1_6O79.js → jsx-dev-runtime-DDukXY54.js} +2 -2
- package/static/runtime/jsx-runtime-BodCQYDg.js +22 -0
- package/static/runtime/react-BHNx_xzv.js +290 -0
- package/static/runtime/react-dom-CyByzibb.js +127 -0
- package/two_step_headless_plugin.html +1 -1
- package/{useblocks-core.ecd1a3b0.js → useblocks-core.15a9129c.js} +82 -76
- package/useblocks-esm.js +628 -3197
- package/useblocks.d.ts +190 -52
- package/useblocks.js +818 -12587
- package/vite/index.cjs +46 -21
- package/vite/index.d.ts +0 -1
- package/vite/index.js +46 -21
- package/vite/pluginDev/index.d.ts +0 -1
- package/webpack/index.cjs +46 -21
- package/webpack/index.d.ts +0 -1
- package/webpack/index.js +46 -21
- package/webpack/pluginDev/index.d.ts +0 -1
- package/iframe/js/amp.CVC2Iq48.js +0 -1
- package/static/core/632d894f.js +0 -869
- package/static/core/c28bc42e.js +0 -46
- package/static/core/ff830d19.js +0 -2046
- package/static/esm/2fb07398.js +0 -3480
- package/static/esm/352121c5.js +0 -55
- package/static/esm/64966e1c.js +0 -18
- package/static/runtime/client-CM3WFcip.js +0 -7
- package/static/runtime/dist-DUS42Hru.js +0 -3421
- package/static/runtime/jsx-runtime-DmPQfqtr.js +0 -28
- package/static/runtime/react-DIf5CLST.js +0 -258
- package/static/runtime/react-dom-Cc3IcUkg.js +0 -5604
- /package/iframe/{iframe-eblock.ecd1a3b0.html → iframe-eblock.15a9129c.html} +0 -0
- /package/iframe/{iframe.ecd1a3b0.html → iframe.15a9129c.html} +0 -0
package/useblocks.d.ts
CHANGED
|
@@ -8,18 +8,29 @@ interface FileManageErrorInfo$1 {
|
|
|
8
8
|
/**
|
|
9
9
|
* Error codes for FileManager API operations.
|
|
10
10
|
*/
|
|
11
|
-
type FileManagerErrorCode =
|
|
12
|
-
|
|
13
|
-
| '
|
|
14
|
-
|
|
15
|
-
| '
|
|
16
|
-
|
|
17
|
-
| '
|
|
18
|
-
|
|
19
|
-
| '
|
|
20
|
-
|
|
21
|
-
| '
|
|
22
|
-
|
|
11
|
+
type FileManagerErrorCode =
|
|
12
|
+
// --- Files ---
|
|
13
|
+
'FileNotFound' | 'FileAlreadyExists' | 'FileInvalidName' | 'FileAccessDenied' | 'FileReadError' | 'FileWriteError' | 'FileTooLarge' | 'FileTypeNotAllowed' | 'FileCorrupted' | 'FileChecksumMismatch' | 'FileStorageQuotaExceeded' | 'FileLocked' | 'FileVersionConflict' |
|
|
14
|
+
// --- Folders / directories ---
|
|
15
|
+
'FolderNotFound' | 'FolderAlreadyExists' | 'FolderInvalidName' | 'FolderAccessDenied' | 'FolderReadError' | 'FolderWriteError' | 'FolderQuotaExceeded' | 'FolderNotEmpty' | 'FolderBackendError' | 'FolderTimeout' |
|
|
16
|
+
// --- Operational restrictions ---
|
|
17
|
+
'RenameNotAllowed' | 'MoveNotAllowed' | 'CopyNotAllowed' | 'DeleteNotAllowed' | 'MoveIntoSelf' | 'MoveIntoDescendant' | 'CopyIntoSelf' | 'UnsupportedOperation' | 'ConfigError' |
|
|
18
|
+
// --- File upload ---
|
|
19
|
+
'FileUploadQuotaExceeded' | 'FileUploadNetworkError' | 'FileUploadTimeout' | 'FileUploadBackendError' |
|
|
20
|
+
// --- URL upload ---
|
|
21
|
+
'UploadUrlInvalid' | 'UploadUrlNotReachable' | 'UploadUrlContentTypeNotAllowed' | 'UploadUrlDownloadFailed' | 'FileLookupFailed' | 'FileProxyFailed' | 'FileProxyNotConfigured' |
|
|
22
|
+
// --- File download ---
|
|
23
|
+
'FileDownloadNetworkError' | 'FileDownloadTimeout' | 'FileDownloadBackendError' |
|
|
24
|
+
// --- Batch operations ---
|
|
25
|
+
'BatchPartialFailure' | 'BatchAllFailed' | 'BatchConflict' | 'BatchValidationFailed' | 'BatchItemLimitExceeded' |
|
|
26
|
+
// --- Validation / data ---
|
|
27
|
+
'ValidationError' | 'PayloadTooLarge' | 'UnsupportedMediaType' |
|
|
28
|
+
// --- Network / server / infrastructure ---
|
|
29
|
+
'NetworkError' | 'BackendError' | 'Timeout' | 'AuthenticationFailed' | 'AuthorizationFailed' | 'RateLimitExceeded' | 'ServiceUnavailable' |
|
|
30
|
+
// --- AI / integrations ---
|
|
31
|
+
'AIResponseInvalid' | 'AIImageGenerationFailed' | 'AIImageGenerationLimitExceeded' | 'IntegrationError' | 'ThirdPartyError' |
|
|
32
|
+
// --- General / fallback ---
|
|
33
|
+
'UnknownError';
|
|
23
34
|
/**
|
|
24
35
|
* Error interface for FileManager API.
|
|
25
36
|
* Implemented by FileManagerApiError class which is also exported.
|
|
@@ -80,10 +91,12 @@ interface ItemContextPayload$1 {
|
|
|
80
91
|
*/
|
|
81
92
|
type NotifyPlacement = 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight';
|
|
82
93
|
type Notify$1 = {
|
|
83
|
-
type: 'success' | 'info' | 'error' | 'warning';
|
|
94
|
+
type: 'success' | 'info' | 'error' | 'warning';
|
|
95
|
+
/** @deprecated Use `title` instead (antd v6+) */
|
|
84
96
|
message?: HTMLElement | string;
|
|
85
97
|
title?: HTMLElement | string;
|
|
86
|
-
description?: HTMLElement | string;
|
|
98
|
+
description?: HTMLElement | string;
|
|
99
|
+
/** @deprecated Use `actions` instead (antd v6+) */
|
|
87
100
|
btn?: HTMLElement | string;
|
|
88
101
|
actions?: HTMLElement | string;
|
|
89
102
|
onClose?: () => void;
|
|
@@ -429,7 +442,7 @@ declare namespace Notify$1 {
|
|
|
429
442
|
/**
|
|
430
443
|
* Union type of all error events.
|
|
431
444
|
*/
|
|
432
|
-
export type Error = { [K in keyof ErrorMap]: ErrorEventBase<K, ErrorMap[K]
|
|
445
|
+
export type Error = { [K in keyof ErrorMap]: ErrorEventBase<K, ErrorMap[K]>; }[keyof ErrorMap];
|
|
433
446
|
/**
|
|
434
447
|
* Error notification event type.
|
|
435
448
|
*/
|
|
@@ -442,7 +455,8 @@ declare namespace Notify$1 {
|
|
|
442
455
|
*/
|
|
443
456
|
export interface SuccessMap extends ItemSuccessMap, BatchSuccessMap {
|
|
444
457
|
AI_IMAGE_GENERATION_STARTED: AIImageGenerationStartedPayload;
|
|
445
|
-
AI_IMAGE_GENERERATION_SUCCESS: AIImageGenerationSuccessPayload;
|
|
458
|
+
AI_IMAGE_GENERERATION_SUCCESS: AIImageGenerationSuccessPayload;
|
|
459
|
+
// EDITOR_IMAGE_DOWNLOAD_SUCCESS: ImageFilePayload;
|
|
446
460
|
IMAGE_UPDATE_SUCCESS: ImageFilePayload;
|
|
447
461
|
IMAGE_SAVE_COPY_SUCCESS: ImageFilePayload;
|
|
448
462
|
FILE_RENAME_SUCCESS: SingleItemPayload;
|
|
@@ -455,7 +469,7 @@ declare namespace Notify$1 {
|
|
|
455
469
|
/**
|
|
456
470
|
* Union type of all success events.
|
|
457
471
|
*/
|
|
458
|
-
export type Success = { [K in keyof SuccessMap]: NotificationEventBase<K, SuccessMap[K]
|
|
472
|
+
export type Success = { [K in keyof SuccessMap]: NotificationEventBase<K, SuccessMap[K]>; }[keyof SuccessMap];
|
|
459
473
|
/**
|
|
460
474
|
* Success notification event type.
|
|
461
475
|
*/
|
|
@@ -473,7 +487,7 @@ declare namespace Notify$1 {
|
|
|
473
487
|
/**
|
|
474
488
|
* Union type of all warning events.
|
|
475
489
|
*/
|
|
476
|
-
export type Warning = { [K in keyof WarningMap]: NotificationEventBase<K, WarningMap[K]
|
|
490
|
+
export type Warning = { [K in keyof WarningMap]: NotificationEventBase<K, WarningMap[K]>; }[keyof WarningMap];
|
|
477
491
|
/**
|
|
478
492
|
* Warning notification event type.
|
|
479
493
|
*/
|
|
@@ -487,7 +501,7 @@ declare namespace Notify$1 {
|
|
|
487
501
|
/**
|
|
488
502
|
* Union type of all info events.
|
|
489
503
|
*/
|
|
490
|
-
export type Info = { [K in keyof InfoMap]: NotificationEventBase<K, InfoMap[K]
|
|
504
|
+
export type Info = { [K in keyof InfoMap]: NotificationEventBase<K, InfoMap[K]>; }[keyof InfoMap];
|
|
491
505
|
/**
|
|
492
506
|
* Info notification event type.
|
|
493
507
|
*/
|
|
@@ -534,22 +548,30 @@ interface IContainer extends IServiceContainer {
|
|
|
534
548
|
*/
|
|
535
549
|
type MayBePromise<T> = T | Promise<T>;
|
|
536
550
|
type PromiseWrap<T> = Promise<Awaited<T>>;
|
|
537
|
-
type RecursivePartial<T> = { [K in keyof T]?: T[K] extends number | string | boolean | bigint ? T[K] : RecursivePartial<T[K]
|
|
551
|
+
type RecursivePartial<T> = { [K in keyof T]?: T[K] extends number | string | boolean | bigint ? T[K] : RecursivePartial<T[K]>; };
|
|
538
552
|
type AppListener<Value, Result = void> = (value: Value) => MayBePromise<Result>;
|
|
539
553
|
/** Subscribe helper used for `handle*` APIs: call with a listener → returns unsubscribe `() => void`. */
|
|
540
554
|
type AppEvent<Listener extends AppListener<any, any>> = (listener: Listener, priority?: number, thisArg?: any) => () => void;
|
|
541
555
|
type SaveEventPayload<T> = {
|
|
542
|
-
/** source of the event */
|
|
543
|
-
|
|
544
|
-
|
|
556
|
+
/** source of the event */
|
|
557
|
+
source?: string;
|
|
558
|
+
/** previous value */
|
|
559
|
+
prev?: T;
|
|
560
|
+
/** changed fields */
|
|
561
|
+
patch: Partial<T>;
|
|
562
|
+
/** next value */
|
|
545
563
|
value: T;
|
|
546
564
|
};
|
|
547
565
|
type CreateEventPayload<T> = {
|
|
548
|
-
/** source of the event */
|
|
566
|
+
/** source of the event */
|
|
567
|
+
source?: string;
|
|
568
|
+
/** next value */
|
|
549
569
|
value: T;
|
|
550
570
|
};
|
|
551
571
|
type RemoveEventPayload<T> = {
|
|
552
|
-
/** source of the event */
|
|
572
|
+
/** source of the event */
|
|
573
|
+
source?: string;
|
|
574
|
+
/** removed value */
|
|
553
575
|
value: T;
|
|
554
576
|
};
|
|
555
577
|
type MergeTagGroup = {
|
|
@@ -736,7 +758,7 @@ interface IFrameErrorInfo {
|
|
|
736
758
|
sentryEventId: string;
|
|
737
759
|
}
|
|
738
760
|
export declare namespace Notify {
|
|
739
|
-
type FM_Notifications<Notifications extends Record<string, any>> = { [Key in keyof Notifications as `FM_${Key & string}`]: Notifications[Key] };
|
|
761
|
+
type FM_Notifications<Notifications extends Record<string, any>> = { [Key in keyof Notifications as `FM_${Key & string}`]: Notifications[Key]; };
|
|
740
762
|
/**
|
|
741
763
|
* Payload types for FM_* notification events.
|
|
742
764
|
* Mirror of FileManager.Notify payloads so types are meaningful without resolving @useblocks/filemanager.
|
|
@@ -839,7 +861,8 @@ export declare namespace Notify {
|
|
|
839
861
|
response?: unknown;
|
|
840
862
|
error?: FileManageErrorInfo;
|
|
841
863
|
}
|
|
842
|
-
}
|
|
864
|
+
}
|
|
865
|
+
//
|
|
843
866
|
// ─────────────────────────────────────────────────────────────
|
|
844
867
|
// Base event types
|
|
845
868
|
// ─────────────────────────────────────────────────────────────
|
|
@@ -957,7 +980,7 @@ export declare namespace Notify {
|
|
|
957
980
|
* Union of all possible error event types.
|
|
958
981
|
* Includes both the mapped error IDs and the empty message variant.
|
|
959
982
|
*/
|
|
960
|
-
type Error = EmptyMessage | { [K in keyof ErrorMap]: EventBase<K, ErrorMap[K]
|
|
983
|
+
type Error = EmptyMessage | { [K in keyof ErrorMap]: EventBase<K, ErrorMap[K]>; }[keyof ErrorMap];
|
|
961
984
|
/** Full error event with the discriminating `type` field. */
|
|
962
985
|
type ErrorEvent = {
|
|
963
986
|
type: 'error';
|
|
@@ -999,7 +1022,7 @@ export declare namespace Notify {
|
|
|
999
1022
|
FM_FOLDER_NOT_FOUND_NAVIGATE: undefined;
|
|
1000
1023
|
}
|
|
1001
1024
|
interface SuccessMap extends FMSuccessMapFallback {}
|
|
1002
|
-
type Success = EmptyMessage | { [K in keyof SuccessMap]: EventBase<K, SuccessMap[K]
|
|
1025
|
+
type Success = EmptyMessage | { [K in keyof SuccessMap]: EventBase<K, SuccessMap[K]>; }[keyof SuccessMap];
|
|
1003
1026
|
type SuccessEvent = {
|
|
1004
1027
|
type: 'success';
|
|
1005
1028
|
} & Success;
|
|
@@ -1017,7 +1040,7 @@ export declare namespace Notify {
|
|
|
1017
1040
|
FM_TRASH_CLEARED_PARTIAL: FM.OperationErrorPayload;
|
|
1018
1041
|
}
|
|
1019
1042
|
interface WarningMap extends FMWarningMapFallback {}
|
|
1020
|
-
type Warning = EmptyMessage | { [K in keyof WarningMap]: EventBase<K, WarningMap[K]
|
|
1043
|
+
type Warning = EmptyMessage | { [K in keyof WarningMap]: EventBase<K, WarningMap[K]>; }[keyof WarningMap];
|
|
1021
1044
|
type WarningEvent = {
|
|
1022
1045
|
type: 'warning';
|
|
1023
1046
|
} & Warning;
|
|
@@ -1025,12 +1048,10 @@ export declare namespace Notify {
|
|
|
1025
1048
|
* Info events map — currently empty.
|
|
1026
1049
|
* Can be freely extended from other modules.
|
|
1027
1050
|
*/
|
|
1028
|
-
interface InfoMap {
|
|
1029
|
-
// USER_LOGGED_IN: { userId: string; timestamp: number };
|
|
1030
|
-
}
|
|
1051
|
+
interface InfoMap {}
|
|
1031
1052
|
type FMInfoMap = FM_Notifications<Notify$1.InfoMap>;
|
|
1032
1053
|
interface InfoMap extends FMInfoMap {}
|
|
1033
|
-
type Info = EmptyMessage | { [K in keyof InfoMap]: EventBase<K, InfoMap[K]
|
|
1054
|
+
type Info = EmptyMessage | { [K in keyof InfoMap]: EventBase<K, InfoMap[K]>; }[keyof InfoMap];
|
|
1034
1055
|
type InfoEvent = {
|
|
1035
1056
|
type: 'info';
|
|
1036
1057
|
} & Info;
|
|
@@ -1093,7 +1114,9 @@ export declare namespace ExportedApi {
|
|
|
1093
1114
|
date_gmt?: string;
|
|
1094
1115
|
/** The global unique identifier of the record. */
|
|
1095
1116
|
guid?: {
|
|
1096
|
-
/** GUID to write in the form in which it exists in the database. */
|
|
1117
|
+
/** GUID to write in the form in which it exists in the database. */
|
|
1118
|
+
raw?: string;
|
|
1119
|
+
/** The GUID for the record, converted for display. */
|
|
1097
1120
|
rendered?: string;
|
|
1098
1121
|
};
|
|
1099
1122
|
/** Unique identifier of the editorial office. */
|
|
@@ -1250,7 +1273,8 @@ export declare namespace ExportedApi {
|
|
|
1250
1273
|
subject?: string;
|
|
1251
1274
|
description?: string;
|
|
1252
1275
|
code?: string;
|
|
1253
|
-
project?: string | number;
|
|
1276
|
+
project?: string | number;
|
|
1277
|
+
// email tag names
|
|
1254
1278
|
tags?: string[];
|
|
1255
1279
|
utm_parameters?: {
|
|
1256
1280
|
utm_source?: string;
|
|
@@ -1383,7 +1407,7 @@ export declare namespace ExportedApi {
|
|
|
1383
1407
|
/** Registered theme preset id consumed by **`themes`**. */
|
|
1384
1408
|
theme: string;
|
|
1385
1409
|
/** Registered theme presets (colors, densities) keyed by id; **`theme`** selects the active one. */
|
|
1386
|
-
themes: { [P in string]: ThemeConfig };
|
|
1410
|
+
themes: { [P in string]: ThemeConfig; };
|
|
1387
1411
|
/** showing the back arrow */
|
|
1388
1412
|
headerArrowBackVisible: boolean;
|
|
1389
1413
|
/** display of the Subject field */
|
|
@@ -1566,6 +1590,12 @@ export declare namespace ExportedApi {
|
|
|
1566
1590
|
elementAccordionEnabled: boolean;
|
|
1567
1591
|
/** If `true`, Image Center uses file-manager style UI; if `false`, simpler inline image flow. */
|
|
1568
1592
|
imageCenterFileManagerView: boolean;
|
|
1593
|
+
/**
|
|
1594
|
+
* File manager talks to the Go backend (`/api/v2/files*`) instead of the
|
|
1595
|
+
* legacy WP `em-files/v1` endpoints. Runtime flag: rollout is per-project
|
|
1596
|
+
* via server config, rollback is flipping the flag — no code revert.
|
|
1597
|
+
*/
|
|
1598
|
+
fileManagerV2Enabled: boolean;
|
|
1569
1599
|
/** Local “upload from computer” entry in Image Center. */
|
|
1570
1600
|
imageCenterLocalUploadEnabled: boolean;
|
|
1571
1601
|
/** Stock photo tab in Image Center / file manager. */
|
|
@@ -1733,7 +1763,8 @@ export declare namespace ExportedApi {
|
|
|
1733
1763
|
};
|
|
1734
1764
|
}
|
|
1735
1765
|
export type AppInitCallback = (params: {
|
|
1736
|
-
/** API origin from init options (without `/wp-json`); SDK normalizes before HTTP. */
|
|
1766
|
+
/** API origin from init options (without `/wp-json`); SDK normalizes before HTTP. */
|
|
1767
|
+
baseUrl?: string;
|
|
1737
1768
|
user?: User;
|
|
1738
1769
|
project?: string | number;
|
|
1739
1770
|
prevApp?: AppInitResult;
|
|
@@ -1757,7 +1788,8 @@ export declare namespace ExportedApi {
|
|
|
1757
1788
|
remember?: boolean;
|
|
1758
1789
|
};
|
|
1759
1790
|
type JWTOptions = {
|
|
1760
|
-
/** JWT authorization credentials */
|
|
1791
|
+
/** JWT authorization credentials */
|
|
1792
|
+
jwtAuth?: JWTAuthOptions;
|
|
1761
1793
|
};
|
|
1762
1794
|
namespace JWTMixin {
|
|
1763
1795
|
interface Options extends JWTOptions {}
|
|
@@ -1837,17 +1869,27 @@ export declare namespace ExportedApi {
|
|
|
1837
1869
|
export declare namespace ExportedApi {
|
|
1838
1870
|
namespace DataMixin {
|
|
1839
1871
|
type BlockShowOptions = {
|
|
1840
|
-
/** block content */
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1872
|
+
/** block content */
|
|
1873
|
+
block: Block | string;
|
|
1874
|
+
/** autosaves */
|
|
1875
|
+
revisions?: BlockRevision[];
|
|
1876
|
+
/** comments */
|
|
1877
|
+
comments?: Comment[];
|
|
1878
|
+
/** blocks */
|
|
1879
|
+
blocks?: Block[];
|
|
1880
|
+
/** template identifier for email */
|
|
1844
1881
|
templateId?: string | number;
|
|
1845
1882
|
};
|
|
1846
1883
|
type EmailShowOptions = {
|
|
1847
|
-
/** email content */
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1884
|
+
/** email content */
|
|
1885
|
+
email: Email | string;
|
|
1886
|
+
/** autosaves */
|
|
1887
|
+
autosaves?: EmailRevision[];
|
|
1888
|
+
/** comments */
|
|
1889
|
+
comments?: Comment[];
|
|
1890
|
+
/** blocks */
|
|
1891
|
+
blocks?: Block[];
|
|
1892
|
+
/** template identifier for block */
|
|
1851
1893
|
templateId?: number;
|
|
1852
1894
|
};
|
|
1853
1895
|
type Content = string | Email | EmailShowOptions;
|
|
@@ -1946,7 +1988,7 @@ export declare namespace ExportedApi {
|
|
|
1946
1988
|
/** fires when email validate */
|
|
1947
1989
|
handleValidate: AppEvent<ValidateEvent>;
|
|
1948
1990
|
}
|
|
1949
|
-
type Listeners = { [K in keyof Events]?: Events[K] extends AppEvent<infer Listener> ? Listener : never };
|
|
1991
|
+
type Listeners = { [K in keyof Events]?: Events[K] extends AppEvent<infer Listener> ? Listener : never; };
|
|
1950
1992
|
interface Options extends Listeners {
|
|
1951
1993
|
/** entity content */
|
|
1952
1994
|
content: Content;
|
|
@@ -2085,6 +2127,68 @@ export declare namespace ExportedApi {
|
|
|
2085
2127
|
interface Options extends ImageHandlerMixin.Options {}
|
|
2086
2128
|
interface Instance extends ImageHandlerMixin.Instance {}
|
|
2087
2129
|
}
|
|
2130
|
+
export declare namespace ExportedApi {
|
|
2131
|
+
namespace AIHandlerMixin {
|
|
2132
|
+
/** Payload for external text AI (chat, roles, email generator). */
|
|
2133
|
+
type AITextRequestPayload = {
|
|
2134
|
+
message?: string;
|
|
2135
|
+
locale?: string;
|
|
2136
|
+
entityId?: string;
|
|
2137
|
+
projectId?: string;
|
|
2138
|
+
subject?: string;
|
|
2139
|
+
preheader?: string;
|
|
2140
|
+
textContent?: string;
|
|
2141
|
+
/**
|
|
2142
|
+
* Role or flow when the caller sets one (chat, email-generator, …). Some entry points send
|
|
2143
|
+
* the prompt here instead of `message`; `message` is normalised, so read the prompt there.
|
|
2144
|
+
*/
|
|
2145
|
+
context?: string;
|
|
2146
|
+
connection?: string;
|
|
2147
|
+
/**
|
|
2148
|
+
* Call to stream partial HTML as it is produced; the editor applies each chunk.
|
|
2149
|
+
* Text generation is long-running, so streaming keeps the chat from sitting blank.
|
|
2150
|
+
*/
|
|
2151
|
+
onStreamChunk?: (partialHtml: string) => void;
|
|
2152
|
+
/** Call to report progress (0–100) and an optional human-readable status line. */
|
|
2153
|
+
onProgress?: (progress: number, status?: string) => void;
|
|
2154
|
+
/** Aborted when the user cancels or leaves the editor — stop the request. */
|
|
2155
|
+
signal?: AbortSignal;
|
|
2156
|
+
};
|
|
2157
|
+
type AITextResponse = {
|
|
2158
|
+
message: string;
|
|
2159
|
+
html?: string;
|
|
2160
|
+
};
|
|
2161
|
+
/** Payload for external image AI. */
|
|
2162
|
+
type AIImageRequestPayload = {
|
|
2163
|
+
prompt: string;
|
|
2164
|
+
size?: string;
|
|
2165
|
+
entityId?: string;
|
|
2166
|
+
projectId?: string;
|
|
2167
|
+
/**
|
|
2168
|
+
* Call to report progress (0–100) and an optional human-readable status line.
|
|
2169
|
+
* Mirrors the built-in SSE progress channel, which image generation relies on.
|
|
2170
|
+
*/
|
|
2171
|
+
onProgress?: (progress: number, status?: string) => void;
|
|
2172
|
+
/** Aborted when the user cancels or leaves the editor — stop the request. */
|
|
2173
|
+
signal?: AbortSignal;
|
|
2174
|
+
};
|
|
2175
|
+
type AIImageResponse = {
|
|
2176
|
+
images: string[];
|
|
2177
|
+
};
|
|
2178
|
+
type AITextListener = AppListener<AITextRequestPayload, AITextResponse | void>;
|
|
2179
|
+
type AIImageListener = AppListener<AIImageRequestPayload, AIImageResponse | void>;
|
|
2180
|
+
interface Options {
|
|
2181
|
+
handleAITextRequest?: AITextListener;
|
|
2182
|
+
handleAIImageRequest?: AIImageListener;
|
|
2183
|
+
}
|
|
2184
|
+
interface Instance {
|
|
2185
|
+
handleAITextRequest: AppEvent<AITextListener>;
|
|
2186
|
+
handleAIImageRequest: AppEvent<AIImageListener>;
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
interface Options extends AIHandlerMixin.Options {}
|
|
2190
|
+
interface Instance extends AIHandlerMixin.Instance {}
|
|
2191
|
+
}
|
|
2088
2192
|
export declare namespace ExportedApi {
|
|
2089
2193
|
namespace LoadHandlerMixin {
|
|
2090
2194
|
type LoadListener = AppListener<ExportedApi.Instance>;
|
|
@@ -2607,7 +2711,7 @@ interface StorageProvider {
|
|
|
2607
2711
|
*/
|
|
2608
2712
|
copyItems?: (items: FileSystemItem[], targetFolderId?: string) => MayBePromise<BatchResult<FileSystemItemUpdate>>;
|
|
2609
2713
|
/**
|
|
2610
|
-
* Find a file by its URL.
|
|
2714
|
+
* Find a file by its URL.
|
|
2611
2715
|
* @param url - File URL
|
|
2612
2716
|
* @param folderId - Target folder (or undefined for root). If not specified,
|
|
2613
2717
|
* uses the root folder.
|
|
@@ -2615,7 +2719,7 @@ interface StorageProvider {
|
|
|
2615
2719
|
* Find file by URL. Implementation should check if the file already belongs
|
|
2616
2720
|
* to the current server. If it does, return the existing file object
|
|
2617
2721
|
* instead of uploading it again.
|
|
2618
|
-
* @returns
|
|
2722
|
+
* @returns
|
|
2619
2723
|
*/
|
|
2620
2724
|
findFileByUrl?: (url: string, folderId?: string) => MayBePromise<FileSystemItem | undefined>;
|
|
2621
2725
|
/**
|
|
@@ -3054,7 +3158,7 @@ type IPluginConstructor<Plugin = IPlugin, Options = any> = PluginClassConstructo
|
|
|
3054
3158
|
* Extracts the plugin instance type from a constructor or factory.
|
|
3055
3159
|
* Context-independent — only infers the return/instance type.
|
|
3056
3160
|
*/
|
|
3057
|
-
type InstanceOfPluginType<T> = T extends (new (...args: any[]) => infer P) ? P : T extends ((...args: any[]) => infer P) ? Exclude<P, void | undefined> extends infer Q ? [Q] extends [never] ? IPlugin : Q : never : never;
|
|
3161
|
+
type InstanceOfPluginType<T> = T extends (new (...args: any[]) => infer P) ? P : T extends ((...args: any[]) => infer P) ? Exclude<P, void | undefined> extends (infer Q) ? [Q] extends [never] ? IPlugin : Q : never : never;
|
|
3058
3162
|
/**
|
|
3059
3163
|
* Extracts the options type from a plugin constructor.
|
|
3060
3164
|
*/
|
|
@@ -3160,6 +3264,40 @@ export declare namespace ExportedApi {
|
|
|
3160
3264
|
useAsync(entry: PluginEntryItem): Promise<IPlugin>;
|
|
3161
3265
|
}
|
|
3162
3266
|
}
|
|
3267
|
+
export declare namespace ExportedApi {
|
|
3268
|
+
/** Directive form: bare `{% … %}` or wrapped in an HTML comment. */
|
|
3269
|
+
type DirectiveForm = 'bare' | 'html-comment';
|
|
3270
|
+
/**
|
|
3271
|
+
* Block-level template syntaxes. Variables (`double-brace`, `dollar-brace`, `mindbox`) are not
|
|
3272
|
+
* configurable — they are never wrapped in comments.
|
|
3273
|
+
*/
|
|
3274
|
+
type TemplateSyntaxId = 'brace-percent' | 'brace-hash' | 'proscript' | 'getresponse' | 'expert-sender' | 'mailchimp' | 'velocity';
|
|
3275
|
+
/** Per-syntax forms; a bare `DirectiveForm` is shorthand for `{ output: <value> }`. */
|
|
3276
|
+
interface SyntaxDirectiveConfig {
|
|
3277
|
+
/** Form in `code` and `compiled.*` for this syntax. Defaults to the top-level `output`. */
|
|
3278
|
+
output?: DirectiveForm;
|
|
3279
|
+
/** Form in the code view for this syntax. Defaults to the top-level `editor`, then to `output`. */
|
|
3280
|
+
editor?: DirectiveForm;
|
|
3281
|
+
}
|
|
3282
|
+
interface TemplateDirectivesConfig {
|
|
3283
|
+
/** Default form in `code` and `compiled.*` — what the integrator receives. Defaults to `'bare'`. */
|
|
3284
|
+
output?: DirectiveForm;
|
|
3285
|
+
/** Default form in the code view. Defaults to mirroring `output`. */
|
|
3286
|
+
editor?: DirectiveForm;
|
|
3287
|
+
/**
|
|
3288
|
+
* Which syntaxes are managed, and their per-syntax forms. Omit to manage every known syntax
|
|
3289
|
+
* with the top-level forms; syntaxes left out of this map behave as if unconfigured.
|
|
3290
|
+
*/
|
|
3291
|
+
syntaxes?: Partial<Record<TemplateSyntaxId, DirectiveForm | SyntaxDirectiveConfig>>;
|
|
3292
|
+
}
|
|
3293
|
+
interface Config {
|
|
3294
|
+
/**
|
|
3295
|
+
* Preserve HTML-comment wrappers (`<!--{% … %}-->`) around block template directives instead
|
|
3296
|
+
* of stripping them on save/export. A string is shorthand for `{ output: <value> }`.
|
|
3297
|
+
*/
|
|
3298
|
+
templateDirectives?: DirectiveForm | TemplateDirectivesConfig;
|
|
3299
|
+
}
|
|
3300
|
+
}
|
|
3163
3301
|
/** Application instance after `init()`; merged from all `ExportedApi.Instance` declarations. */
|
|
3164
3302
|
interface Instance extends ExportedApi.Instance {}
|
|
3165
3303
|
/** Options for `init()`; merged from all `ExportedApi.Options` declarations (handlers, content, auth, config, …). */
|
|
@@ -3266,4 +3404,4 @@ export declare namespace helpers {
|
|
|
3266
3404
|
*/
|
|
3267
3405
|
export function mapHttpStatusToErrorCode(status: number, defaultCode?: FileManagerErrorCode): FileManagerErrorCode;
|
|
3268
3406
|
}
|
|
3269
|
-
export { ApiPaginationResponse, AppEvent, AppListener, BatchResult, BlockDesc, COMMON_STYLES, CommonStyles, CommonStylesBlock, CommonStylesBorder, CommonStylesBorderRadius, CommonStylesBorderSide, CommonStylesButton, CommonStylesCard, CommonStylesHeading, CommonStylesLink, CommonStylesPadding, CommonStylesText, Config, CreateEvent, CreateEventPayload, CreateListener, EditStackData, EditStackSnapshot, EmailDesc, ExtractPluginOptions, fileManager_d_exports as FileManager, FileManagerApiErrorInfo, FileSystemItem, FileSystemItemUpdate, GetFileDataOptions, IFrameErrorInfo, IPlugin, IPluginConstructor, ISelection, ISingleModelEditStackData, IUndoRedoService, Instance, InstanceOfPluginType, MayBePromise, MergeTag, MergeTagGroup, MergeTagItem, ModulePluginDescriptor,
|
|
3407
|
+
export { ApiPaginationResponse, AppEvent, AppListener, BatchResult, BlockDesc, COMMON_STYLES, CommonStyles, CommonStylesBlock, CommonStylesBorder, CommonStylesBorderRadius, CommonStylesBorderSide, CommonStylesButton, CommonStylesCard, CommonStylesHeading, CommonStylesLink, CommonStylesPadding, CommonStylesText, Config, CreateEvent, CreateEventPayload, CreateListener, EditStackData, EditStackSnapshot, EmailDesc, ExtractPluginOptions, fileManager_d_exports as FileManager, FileManagerApiErrorInfo, FileSystemItem, FileSystemItemUpdate, GetFileDataOptions, IFrameErrorInfo, IPlugin, IPluginConstructor, ISelection, ISingleModelEditStackData, IUndoRedoService, Instance, InstanceOfPluginType, MayBePromise, MergeTag, MergeTagGroup, MergeTagItem, ModulePluginDescriptor, NotifyEvent, OperationResult, Options, ParsedAMP, PluginClassConstructor, PluginDescriptor, PluginEntryItem, PluginFunctionConstructor, PluginLoader, PluginRegistry, PluginTypeMap, PreloadOptions, PromiseWrap, RecursivePartial, RegistryPluginDescriptor, RemoveEvent, RemoveEventPayload, RemoveListener, SaveEvent, SaveEventPayload, SaveListener, SortState, StorageProvider, StorageProviderController, UploadFileItemInput, UploadFilesRequest, WindowPluginDescriptor, init, parseAMP, pluginRegistry, preload, version };
|