useblocks 1.1.46 → 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.
Files changed (80) hide show
  1. package/iframe/js/amp.BP7EklKo.js +1 -0
  2. package/iframe/js/iframe-eblock.js +1 -1
  3. package/iframe/js/iframe.js +1 -1
  4. package/iframe/js/rules.4N5s3OV-.js +1 -1
  5. package/monacoeditorwork/css.worker.bundle.js +40524 -40442
  6. package/monacoeditorwork/editor.worker.bundle.js +9740 -9697
  7. package/monacoeditorwork/html.worker.bundle.js +50513 -50431
  8. package/monacoeditorwork/json.worker.bundle.js +14570 -14527
  9. package/monacoeditorwork/ts.worker.bundle.js +119593 -119455
  10. package/npm-publish.manifest.json +7 -7
  11. package/package.json +1 -1
  12. package/runtime/@ant-design/cssinjs/index.js +1 -1
  13. package/runtime/@ant-design/icons/index.js +2 -2
  14. package/runtime/README.md +1 -1
  15. package/runtime/THIRD_PARTY_LICENSES.txt +70 -42
  16. package/runtime/antd/index.js +1 -1
  17. package/runtime/react/index.js +3 -3
  18. package/runtime/react/jsx-runtime/index.js +1 -1
  19. package/runtime/react-dom/client/index.js +4 -4
  20. package/runtime/react-dom/index.js +3 -3
  21. package/runtime/react-router-dom/index.js +2 -2
  22. package/singlepage_headless_plugin.html +1 -1
  23. package/static/core/{cc8f145d.js → 11296a18.js} +55 -55
  24. package/static/core/{a321a57d.js → 13d197af.js} +26 -26
  25. package/static/core/13f581cc.js +924 -0
  26. package/static/core/{90ec6d2b2.js → 1ca5f3772.js} +184 -155
  27. package/static/core/{b9529b8a.js → 339377b8.js} +16684 -16503
  28. package/static/core/{6e2d88d5.js → 386cf7b3.js} +3573 -3559
  29. package/static/core/{6df04323.js → 3b4845f7.js} +537 -518
  30. package/static/core/{526b23c2.js → 3dea3b87.js} +7 -7
  31. package/static/core/59023866.js +2090 -0
  32. package/static/core/{4a2af478.js → 7a229b90.js} +3 -3
  33. package/static/core/{6b8432a3.js → 8c81db36.js} +3 -3
  34. package/static/core/{b8b730b2.js → 8e110c69.js} +22 -22
  35. package/static/core/{35e13192.js → a11c28c2.js} +172 -168
  36. package/static/core/{9c1c1b89.js → aacf134d.js} +745 -664
  37. package/static/core/{350eac23.js → acb049cb.js} +1349 -1297
  38. package/static/core/{cefd6620.js → c59f9731.js} +7640 -6595
  39. package/static/core/{4eb628d3.js → de79e0c5.js} +3947 -3705
  40. package/static/core/e7c24fe9.js +649 -0
  41. package/static/esm/{dab4cdfd.js → 448d4bb0.js} +70 -70
  42. package/static/esm/{7c5227f0.js → d180c108.js} +50 -47
  43. package/static/runtime/{DownloadOutlined-CgJ8OpH_.js → DownloadOutlined-Dg_G2xO7.js} +4 -4
  44. package/static/runtime/client-CfXgU5Vo.js +7580 -0
  45. package/static/runtime/{defineProperty-B-FyVNQF.js → defineProperty-C_9hhJHt.js} +1 -1
  46. package/static/runtime/dom-export-CHgQ7Ws9.js +8069 -0
  47. package/static/runtime/{es-DnZp8dh1.js → es-BPfImJ0x.js} +5 -5
  48. package/static/runtime/{es-B2DS-PLP.js → es-DcH6fwd6.js} +2 -2
  49. package/static/runtime/{es-deqzngIL.js → es-_OY-D9g1.js} +2 -2
  50. package/static/runtime/{jsx-dev-runtime-Wj1_6O79.js → jsx-dev-runtime-DDukXY54.js} +2 -2
  51. package/static/runtime/jsx-runtime-BodCQYDg.js +22 -0
  52. package/static/runtime/react-BHNx_xzv.js +290 -0
  53. package/static/runtime/react-dom-CyByzibb.js +127 -0
  54. package/two_step_headless_plugin.html +1 -1
  55. package/{useblocks-core.2116f1b9.js → useblocks-core.15a9129c.js} +82 -76
  56. package/useblocks-esm.js +628 -3198
  57. package/useblocks.d.ts +184 -52
  58. package/useblocks.js +818 -12588
  59. package/vite/index.cjs +46 -21
  60. package/vite/index.d.ts +0 -1
  61. package/vite/index.js +46 -21
  62. package/vite/pluginDev/index.d.ts +0 -1
  63. package/webpack/index.cjs +46 -21
  64. package/webpack/index.d.ts +0 -1
  65. package/webpack/index.js +46 -21
  66. package/webpack/pluginDev/index.d.ts +0 -1
  67. package/iframe/js/amp.CVC2Iq48.js +0 -1
  68. package/static/core/9421a704.js +0 -869
  69. package/static/core/9c79239d.js +0 -2063
  70. package/static/core/df0652cc.js +0 -1119
  71. package/static/esm/2fb07398.js +0 -3480
  72. package/static/esm/352121c5.js +0 -55
  73. package/static/esm/64966e1c.js +0 -18
  74. package/static/runtime/client-CM3WFcip.js +0 -7
  75. package/static/runtime/dist-DUS42Hru.js +0 -3421
  76. package/static/runtime/jsx-runtime-DmPQfqtr.js +0 -28
  77. package/static/runtime/react-DIf5CLST.js +0 -258
  78. package/static/runtime/react-dom-Cc3IcUkg.js +0 -5604
  79. /package/iframe/{iframe-eblock.2116f1b9.html → iframe-eblock.15a9129c.html} +0 -0
  80. /package/iframe/{iframe.2116f1b9.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 = // --- Files ---
12
- 'FileNotFound' | 'FileAlreadyExists' | 'FileInvalidName' | 'FileAccessDenied' | 'FileReadError' | 'FileWriteError' | 'FileTooLarge' | 'FileTypeNotAllowed' | 'FileCorrupted' | 'FileChecksumMismatch' | 'FileStorageQuotaExceeded' | 'FileLocked' | 'FileVersionConflict' // --- Folders / directories ---
13
- | 'FolderNotFound' | 'FolderAlreadyExists' | 'FolderInvalidName' | 'FolderAccessDenied' | 'FolderReadError' | 'FolderWriteError' | 'FolderQuotaExceeded' | 'FolderNotEmpty' | 'FolderBackendError' | 'FolderTimeout' // --- Operational restrictions ---
14
- | 'RenameNotAllowed' | 'MoveNotAllowed' | 'CopyNotAllowed' | 'DeleteNotAllowed' | 'MoveIntoSelf' | 'MoveIntoDescendant' | 'CopyIntoSelf' | 'UnsupportedOperation' | 'ConfigError' // --- File upload ---
15
- | 'FileUploadQuotaExceeded' | 'FileUploadNetworkError' | 'FileUploadTimeout' | 'FileUploadBackendError' // --- URL upload ---
16
- | 'UploadUrlInvalid' | 'UploadUrlNotReachable' | 'UploadUrlContentTypeNotAllowed' | 'UploadUrlDownloadFailed' | 'FileLookupFailed' | 'FileProxyFailed' | 'FileProxyNotConfigured' // --- File download ---
17
- | 'FileDownloadNetworkError' | 'FileDownloadTimeout' | 'FileDownloadBackendError' // --- Batch operations ---
18
- | 'BatchPartialFailure' | 'BatchAllFailed' | 'BatchConflict' | 'BatchValidationFailed' | 'BatchItemLimitExceeded' // --- Validation / data ---
19
- | 'ValidationError' | 'PayloadTooLarge' | 'UnsupportedMediaType' // --- Network / server / infrastructure ---
20
- | 'NetworkError' | 'BackendError' | 'Timeout' | 'AuthenticationFailed' | 'AuthorizationFailed' | 'RateLimitExceeded' | 'ServiceUnavailable' // --- AI / integrations ---
21
- | 'AIResponseInvalid' | 'AIImageGenerationFailed' | 'AIImageGenerationLimitExceeded' | 'IntegrationError' | 'ThirdPartyError' // --- General / fallback ---
22
- | 'UnknownError';
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'; /** @deprecated Use `title` instead (antd v6+) */
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; /** @deprecated Use `actions` instead (antd v6+) */
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]> }[keyof ErrorMap];
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; // EDITOR_IMAGE_DOWNLOAD_SUCCESS: ImageFilePayload;
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]> }[keyof SuccessMap];
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]> }[keyof WarningMap];
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]> }[keyof InfoMap];
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 */source?: string; /** previous value */
543
- prev?: T; /** changed fields */
544
- patch: Partial<T>; /** next value */
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 */source?: string; /** next value */
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 */source?: string; /** removed value */
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]> }[keyof ErrorMap];
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]> }[keyof SuccessMap];
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]> }[keyof WarningMap];
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 { // Example for future extension:
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]> }[keyof InfoMap];
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. */raw?: string; /** The GUID for the record, converted for display. */
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; // email tag names
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 */
@@ -1739,7 +1763,8 @@ export declare namespace ExportedApi {
1739
1763
  };
1740
1764
  }
1741
1765
  export type AppInitCallback = (params: {
1742
- /** API origin from init options (without `/wp-json`); SDK normalizes before HTTP. */baseUrl?: string;
1766
+ /** API origin from init options (without `/wp-json`); SDK normalizes before HTTP. */
1767
+ baseUrl?: string;
1743
1768
  user?: User;
1744
1769
  project?: string | number;
1745
1770
  prevApp?: AppInitResult;
@@ -1763,7 +1788,8 @@ export declare namespace ExportedApi {
1763
1788
  remember?: boolean;
1764
1789
  };
1765
1790
  type JWTOptions = {
1766
- /** JWT authorization credentials */jwtAuth?: JWTAuthOptions;
1791
+ /** JWT authorization credentials */
1792
+ jwtAuth?: JWTAuthOptions;
1767
1793
  };
1768
1794
  namespace JWTMixin {
1769
1795
  interface Options extends JWTOptions {}
@@ -1843,17 +1869,27 @@ export declare namespace ExportedApi {
1843
1869
  export declare namespace ExportedApi {
1844
1870
  namespace DataMixin {
1845
1871
  type BlockShowOptions = {
1846
- /** block content */block: Block | string; /** autosaves */
1847
- revisions?: BlockRevision[]; /** comments */
1848
- comments?: Comment[]; /** blocks */
1849
- blocks?: Block[]; /** template identifier for email */
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 */
1850
1881
  templateId?: string | number;
1851
1882
  };
1852
1883
  type EmailShowOptions = {
1853
- /** email content */email: Email | string; /** autosaves */
1854
- autosaves?: EmailRevision[]; /** comments */
1855
- comments?: Comment[]; /** blocks */
1856
- blocks?: Block[]; /** template identifier for block */
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 */
1857
1893
  templateId?: number;
1858
1894
  };
1859
1895
  type Content = string | Email | EmailShowOptions;
@@ -1952,7 +1988,7 @@ export declare namespace ExportedApi {
1952
1988
  /** fires when email validate */
1953
1989
  handleValidate: AppEvent<ValidateEvent>;
1954
1990
  }
1955
- 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; };
1956
1992
  interface Options extends Listeners {
1957
1993
  /** entity content */
1958
1994
  content: Content;
@@ -2091,6 +2127,68 @@ export declare namespace ExportedApi {
2091
2127
  interface Options extends ImageHandlerMixin.Options {}
2092
2128
  interface Instance extends ImageHandlerMixin.Instance {}
2093
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
+ }
2094
2192
  export declare namespace ExportedApi {
2095
2193
  namespace LoadHandlerMixin {
2096
2194
  type LoadListener = AppListener<ExportedApi.Instance>;
@@ -2613,7 +2711,7 @@ interface StorageProvider {
2613
2711
  */
2614
2712
  copyItems?: (items: FileSystemItem[], targetFolderId?: string) => MayBePromise<BatchResult<FileSystemItemUpdate>>;
2615
2713
  /**
2616
- * Find a file by its URL.
2714
+ * Find a file by its URL.
2617
2715
  * @param url - File URL
2618
2716
  * @param folderId - Target folder (or undefined for root). If not specified,
2619
2717
  * uses the root folder.
@@ -2621,7 +2719,7 @@ interface StorageProvider {
2621
2719
  * Find file by URL. Implementation should check if the file already belongs
2622
2720
  * to the current server. If it does, return the existing file object
2623
2721
  * instead of uploading it again.
2624
- * @returns
2722
+ * @returns
2625
2723
  */
2626
2724
  findFileByUrl?: (url: string, folderId?: string) => MayBePromise<FileSystemItem | undefined>;
2627
2725
  /**
@@ -3060,7 +3158,7 @@ type IPluginConstructor<Plugin = IPlugin, Options = any> = PluginClassConstructo
3060
3158
  * Extracts the plugin instance type from a constructor or factory.
3061
3159
  * Context-independent — only infers the return/instance type.
3062
3160
  */
3063
- 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;
3064
3162
  /**
3065
3163
  * Extracts the options type from a plugin constructor.
3066
3164
  */
@@ -3166,6 +3264,40 @@ export declare namespace ExportedApi {
3166
3264
  useAsync(entry: PluginEntryItem): Promise<IPlugin>;
3167
3265
  }
3168
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
+ }
3169
3301
  /** Application instance after `init()`; merged from all `ExportedApi.Instance` declarations. */
3170
3302
  interface Instance extends ExportedApi.Instance {}
3171
3303
  /** Options for `init()`; merged from all `ExportedApi.Options` declarations (handlers, content, auth, config, …). */
@@ -3272,4 +3404,4 @@ export declare namespace helpers {
3272
3404
  */
3273
3405
  export function mapHttpStatusToErrorCode(status: number, defaultCode?: FileManagerErrorCode): FileManagerErrorCode;
3274
3406
  }
3275
- 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, type 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 };
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 };