useblocks 1.1.65 → 1.1.70

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 (195) hide show
  1. package/README.md +2 -0
  2. package/assets/images/project-settings-inbox-envelope.png +0 -0
  3. package/assets/images/project-settings-plugin-support-avatar.png +0 -0
  4. package/fileManager.d.ts +519 -0
  5. package/iframe/css/sandbox-dark.css +1 -1
  6. package/iframe/css/sandbox-darktheme.css +1 -1
  7. package/iframe/css/sandbox-light.css +1 -1
  8. package/iframe/css/sandbox.css +112 -89
  9. package/iframe/js/amp.DllX-Im0.js +1 -0
  10. package/iframe/js/iframe-eblock.js +1 -1
  11. package/iframe/js/iframe.js +1 -1
  12. package/iframe/js/rules.4N5s3OV-.js +1 -1
  13. package/npm-publish.manifest.json +7 -7
  14. package/package.json +4 -1
  15. package/runtime/THIRD_PARTY_LICENSES.txt +1 -1
  16. package/static/core/{d2f93451.js → 0e53b7b5.js} +3 -3
  17. package/static/core/0fe242f22.js +3251 -0
  18. package/static/core/{e9ff66762.js → 10f0dad9.js} +3 -3
  19. package/static/core/{a79573972.js → 115218a42.js} +3 -3
  20. package/static/core/{d6b377d3.js → 1202bfdd.js} +3 -3
  21. package/static/core/{8d4aa933.js → 16c2d0e42.js} +6 -6
  22. package/static/core/{8aa09f022.js → 1ae75b972.js} +3 -3
  23. package/static/core/{e7c982c02.js → 2011fc95.js} +3 -3
  24. package/static/core/{925a1cfd2.js → 211482892.js} +3 -3
  25. package/static/core/222d29d9.js +468 -0
  26. package/static/core/{f8c9371e.js → 23546a64.js} +238 -257
  27. package/static/core/{6e177eb6.js → 26a1af95.js} +3 -3
  28. package/static/core/{9d8297c7.js → 27f62a39.js} +3 -3
  29. package/static/core/{fb834fb22.js → 288ca9522.js} +6 -6
  30. package/static/core/{45da436c.js → 28e9d3ff.js} +3 -3
  31. package/static/core/{1c82c2d52.js → 2bd2da322.js} +3 -3
  32. package/static/core/{712b11ba.js → 2c65c059.js} +3 -3
  33. package/static/core/{1d2a32d02.js → 2f216fd4.js} +4 -4
  34. package/static/core/{45fcca4f2.js → 2fd502bd2.js} +3 -3
  35. package/static/core/{b303b2a4.js → 34e0b0dc.js} +3 -3
  36. package/static/core/{b22e5dd5.js → 35ad3ae5.js} +173 -173
  37. package/static/core/{8e6e6aaa2.js → 35e0d55e.js} +3 -3
  38. package/static/core/36bf6931.js +2119 -0
  39. package/static/core/{a953bf24.js → 375e98282.js} +3 -3
  40. package/static/core/{40d6d494.js → 38302247.js} +3 -3
  41. package/static/core/{99fd0b342.js → 38e879e9.js} +3 -3
  42. package/static/core/{b283b340.js → 39a68c91.js} +3 -3
  43. package/static/core/{68edd344.js → 3bbe4800.js} +3 -3
  44. package/static/core/{43108a122.js → 3bda5ccf2.js} +4 -4
  45. package/static/core/{220b2c2a.js → 3c1ef117.js} +7 -7
  46. package/static/core/{9982be76.js → 3f22a9d32.js} +2018 -1808
  47. package/static/core/{8b8811812.js → 412f0d1c.js} +3 -3
  48. package/static/core/{601b4e7b.js → 46959096.js} +3 -3
  49. package/static/core/{9d1a7a182.js → 46abec11.js} +3 -3
  50. package/static/core/{292fe55d2.js → 4740c91e2.js} +3 -3
  51. package/static/core/{c7588e5f.js → 48560c89.js} +387 -385
  52. package/static/core/{1d173e97.js → 48d0a8bd2.js} +3 -3
  53. package/static/core/{af691d1f.js → 490f59592.js} +21 -21
  54. package/static/core/{205266672.js → 4953bced.js} +3 -3
  55. package/static/core/{668ae858.js → 4b59ab9f.js} +3 -3
  56. package/static/core/{664c38f8.js → 4bc74a4f.js} +3 -3
  57. package/static/core/{8b28b024.js → 508bcaba.js} +5 -5
  58. package/static/core/513594a8.js +583 -0
  59. package/static/core/54eadcf42.js +39 -0
  60. package/static/core/{da4b0874.js → 578fcc88.js} +3 -3
  61. package/static/core/{43764f5b.js → 585259872.js} +189 -181
  62. package/static/core/{cee370ea.js → 5b64d3ce2.js} +8 -8
  63. package/static/core/{b450a16a.js → 5e082e16.js} +59 -59
  64. package/static/core/{bc1a9cb2.js → 5e7c6c9c.js} +4 -4
  65. package/static/core/{bc557d9c.js → 60dcae06.js} +6 -6
  66. package/static/core/{fa23ae7b.js → 616e99a4.js} +3 -3
  67. package/static/core/{66f4dea3.js → 62c13c96.js} +3 -3
  68. package/static/core/{d892d2c82.js → 62f33dda.js} +3 -3
  69. package/static/core/{9c236031.js → 62fd385b.js} +3 -3
  70. package/static/core/{958e85b5.js → 6313868b.js} +3 -3
  71. package/static/core/63206e112.js +8956 -0
  72. package/static/core/{67e3306c.js → 68ec11c8.js} +640 -638
  73. package/static/core/{951b9e3d.js → 6ca6133e.js} +9 -9
  74. package/static/core/6e2a0152.js +61 -0
  75. package/static/core/{656a0edc2.js → 6ee1838f2.js} +3 -3
  76. package/static/core/{b09300472.js → 7527fdc92.js} +3 -3
  77. package/static/core/{d8df6d5a.js → 75c2f232.js} +8 -8
  78. package/static/core/{49a037b02.js → 76c0586a2.js} +3 -3
  79. package/static/core/{2d8a7133.js → 76ea88d3.js} +5 -5
  80. package/static/core/{42e9eb802.js → 77c2efbb.js} +3 -3
  81. package/static/core/{5d0c727e.js → 7d07bfac.js} +3 -3
  82. package/static/core/{d46cb9672.js → 7d19dd28.js} +4 -4
  83. package/static/core/{2d13936a.js → 7ec8e1fc.js} +3 -3
  84. package/static/core/{9954153b2.js → 84326fa6.js} +3 -3
  85. package/static/core/{c52e08d6.js → 86515d932.js} +4 -4
  86. package/static/core/{a97bdbc8.js → 879bd3b1.js} +3 -3
  87. package/static/core/{e47711662.js → 8a061db42.js} +5 -5
  88. package/static/core/{4b0f73af.js → 8ed78147.js} +3 -3
  89. package/static/core/{1cbab2af2.js → 8ef06b232.js} +10 -10
  90. package/static/core/{75e8d4672.js → 8fafd12f2.js} +3 -3
  91. package/static/core/{a898230f.js → 8fbde229.js} +3 -3
  92. package/static/core/{f61e3e55.js → 92871f5a2.js} +7 -7
  93. package/static/core/{a83b01cb2.js → 92d1a0c9.js} +519 -523
  94. package/static/core/9355751a.js +126 -0
  95. package/static/core/{95d1d1aa2.js → 93b3c668.js} +3 -3
  96. package/static/core/{873142eb.js → 9933d0ff2.js} +3 -3
  97. package/static/core/{96417e98.js → 9a0c05f1.js} +4 -4
  98. package/static/core/9ab1c444.js +11452 -0
  99. package/static/core/{c8cb5d88.js → 9c09ec92.js} +7 -7
  100. package/static/core/{31ba662c2.js → 9df9c5262.js} +5 -5
  101. package/static/core/{85ea16112.js → a061a37c2.js} +3 -3
  102. package/static/core/{fff1a8622.js → a64e6cce2.js} +3 -3
  103. package/static/core/{f5d4906d2.js → a6d92d0b2.js} +5 -5
  104. package/static/core/{2e9906f7.js → a7518d2c.js} +3 -3
  105. package/static/core/{3c6f1d122.js → a8bed12d2.js} +3 -3
  106. package/static/core/{72e2612a2.js → a8f08cb22.js} +3 -3
  107. package/static/core/{6eb316fe2.js → ac70dfae2.js} +6 -6
  108. package/static/core/{c2a2dc79.js → b3ee36b6.js} +34654 -38525
  109. package/static/core/{89e7cc57.js → b8cecec8.js} +17 -17
  110. package/static/core/{a35fd8d22.js → b8ed4fd62.js} +13 -13
  111. package/static/core/{474c47d5.js → b9b92e01.js} +15 -15
  112. package/static/core/{b57c9e1f.js → bc703487.js} +3 -3
  113. package/static/core/{b165c6f6.js → bc9faec1.js} +134 -134
  114. package/static/core/{54e7728d.js → bf3a9be2.js} +5 -5
  115. package/static/core/c370a46c.js +683 -0
  116. package/static/core/{cf21862f.js → c3b45fb6.js} +1846 -1847
  117. package/static/core/{d54353e72.js → c56eaffd.js} +3 -3
  118. package/static/core/{f562fb51.js → c5cf470c.js} +3 -3
  119. package/static/core/{ceffb8322.js → c8a41267.js} +3 -3
  120. package/static/core/{19572306.js → cc251d11.js} +3 -3
  121. package/static/core/{84df1edd2.js → cce631ad.js} +3 -3
  122. package/static/core/{a88996b3.js → ce9be2ec2.js} +4965 -4753
  123. package/static/core/cf655a1a.js +33627 -0
  124. package/static/core/{ab86b06a.js → d3bbb05e.js} +3 -3
  125. package/static/core/{4a9bd173.js → d43babb9.js} +3 -3
  126. package/static/core/{1a415abd2.js → d46d10f12.js} +12 -12
  127. package/static/core/{7ad0031e2.js → d684b4ef2.js} +38 -38
  128. package/static/core/{affffdf2.js → d8835f5f.js} +7 -7
  129. package/static/core/{b04145ff2.js → db5fa769.js} +10 -10
  130. package/static/core/{d32841a32.js → dbc6f1e52.js} +3 -3
  131. package/static/core/{db4e60fa2.js → dc256ccd2.js} +3 -3
  132. package/static/core/{eaa635532.js → dc6fa7c1.js} +3 -3
  133. package/static/core/{4b9709dc.js → dcc518ef2.js} +3 -3
  134. package/static/core/df237243.js +56 -0
  135. package/static/core/{5ea0fc40.js → e02024fb2.js} +97 -97
  136. package/static/core/e199fd0a.js +49 -0
  137. package/static/core/{678594cd.js → e3a541ab.js} +3 -3
  138. package/static/core/{6f0d961a2.js → e4c6d91e2.js} +7 -7
  139. package/static/core/e57e8a80.js +22 -0
  140. package/static/core/{d7a9fd822.js → e6ac2e652.js} +3 -3
  141. package/static/core/{de2e2a02.js → e6c7e14f.js} +3 -3
  142. package/static/core/{81a5ffb92.js → e83c0b482.js} +3 -3
  143. package/static/core/{2515c6a52.js → e923d1aa2.js} +3 -3
  144. package/static/core/{b78a67b9.js → ea6c5c93.js} +3237 -3101
  145. package/static/core/{d85e34c42.js → ebd51d83.js} +3 -3
  146. package/static/core/{b54ad117.js → ec4f2d562.js} +3 -3
  147. package/static/core/{da25e8fc.js → f0364bbd2.js} +4 -4
  148. package/static/core/{b1b3186f.js → f51ccb57.js} +7 -7
  149. package/static/core/{7fd85aa0.js → f73bbe35.js} +5 -5
  150. package/static/core/{211ca90b.js → f85b09cb.js} +3 -3
  151. package/static/core/{3ab5d1a4.js → f9aaa4b7.js} +7 -7
  152. package/static/core/{4c5c889d.js → fc962c9a2.js} +5 -5
  153. package/static/core/{fd9034a2.js → fd7386aa2.js} +37 -37
  154. package/static/core/{62dd04ca2.js → fe4feb362.js} +3 -3
  155. package/static/core/{f3b4a3102.js → ffcf92522.js} +3 -3
  156. package/static/media/image-editor/fonts/Rubik-Black.woff2 +0 -0
  157. package/static/media/image-editor/fonts/Rubik-Bold.woff2 +0 -0
  158. package/static/media/image-editor/fonts/Rubik-Light.woff2 +0 -0
  159. package/static/media/image-editor/fonts/Rubik-Regular.woff2 +0 -0
  160. package/static/media/image-editor/fonts/caveat-v23-cyrillic_latin-regular.woff2 +0 -0
  161. package/static/media/image-editor/fonts/commissioner-v24-cyrillic_latin-regular.woff2 +0 -0
  162. package/static/media/image-editor/fonts/inter-v20-cyrillic_latin-regular.woff2 +0 -0
  163. package/static/media/image-editor/fonts/oswald-v57-cyrillic_latin-regular.woff2 +0 -0
  164. package/static/media/image-editor/fonts/pacifico-v23-cyrillic_latin-regular.woff2 +0 -0
  165. package/static/media/image-editor/fonts/playfair-display-v40-cyrillic_latin-regular.woff2 +0 -0
  166. package/static/umd-runtime/ui-kit.js +1638 -1416
  167. package/test-font.otf +0 -0
  168. package/test-font.ttf +0 -0
  169. package/test-font.woff2 +0 -0
  170. package/two_step_headless_plugin.html +1 -1
  171. package/ui-kit/index.js +1317 -1104
  172. package/{useblocks-core.bfe3fe29.js → useblocks-core.d9c7d790.js} +8 -8
  173. package/useblocks-esm.js +6 -3
  174. package/useblocks-po.d9c7d790.js +5945 -0
  175. package/useblocks.d.ts +36 -525
  176. package/useblocks.js +3 -3
  177. package/vite/index.cjs +4 -4
  178. package/vite/index.d.ts +4 -4
  179. package/vite/index.js +4 -4
  180. package/vite/pluginDev/index.cjs +2 -2
  181. package/vite/pluginDev/index.d.ts +12 -12
  182. package/vite/pluginDev/index.js +2 -2
  183. package/webpack/pluginDev/index.d.ts +12 -12
  184. package/iframe/js/amp.BP7EklKo.js +0 -1
  185. package/static/core/2047d7f8.js +0 -12294
  186. package/static/core/63b7b25e.js +0 -68
  187. package/static/core/6dbdca2f.js +0 -2089
  188. package/static/core/8460710a.js +0 -27
  189. package/static/core/86577bae.js +0 -666
  190. package/static/core/97aafd5d.js +0 -43109
  191. package/static/core/aa783b9b.js +0 -124
  192. package/static/core/db999761.js +0 -465
  193. package/static/core/dc19c4fa.js +0 -93052
  194. /package/iframe/{iframe-eblock.bfe3fe29.html → iframe-eblock.d9c7d790.html} +0 -0
  195. /package/iframe/{iframe.bfe3fe29.html → iframe.d9c7d790.html} +0 -0
package/README.md CHANGED
@@ -343,6 +343,8 @@ useblocks.init({
343
343
 
344
344
  See typings (**`ExportedApi.DataMixin.Events`**) — includes for example **`handleRemoveEmail`**, **`handleRemoveEmailAutoSave`**, **`handleReadCommonBlocks`**, **`handleReadTemplateBlocks`**, **`handleCloneEmail`**, **`handleShareEmail`**, **`handleLivePreviewEmail`**, **`handlePreviewEmail`**, **`handleValidate`**, **`handleSubjectChanged`**, **`handlePreheaderChanged`**, **`handleReadLocale`**, **`handleTranslate`**, **`handleLimitUsage`**, plus the rows below.
345
345
 
346
+ **`handleReadLocale`** accepts three catalog shapes: gettext **`.po`** text (as before), a JSON string, and an already parsed **`LocaleData`** object (the Jed shape served by **`/translations/{locale}.json`**). Returning **`.po`** keeps working; JSON simply skips the parsing step.
347
+
346
348
  | Name | Summary |
347
349
  | ------------------------- | ------------------------------------ |
348
350
  | handleReadEmail | Load email by id (**string**) |
@@ -0,0 +1,519 @@
1
+ declare namespace notification_d_exports {
2
+ export { FileManageErrorInfo, FileManagerErrorCode, FilesQueryParams, IFileManagerApiError, ItemContextPayload, Notify, NotifyEvent, NotifyPlacement };
3
+ }
4
+ interface FileManageErrorInfo {
5
+ message?: string;
6
+ code?: FileManagerErrorCode;
7
+ status?: number;
8
+ raw?: any;
9
+ stack?: string;
10
+ }
11
+ /**
12
+ * Error codes for FileManager API operations.
13
+ */
14
+ type FileManagerErrorCode =
15
+ // --- Files ---
16
+ 'FileNotFound' | 'FileAlreadyExists' | 'FileInvalidName' | 'FileAccessDenied' | 'FileReadError' | 'FileWriteError' | 'FileTooLarge' | 'FileTypeNotAllowed' | 'FileCorrupted' | 'FileChecksumMismatch' | 'FileStorageQuotaExceeded' | 'FileLocked' | 'FileVersionConflict' |
17
+ // --- Folders / directories ---
18
+ 'FolderNotFound' | 'FolderAlreadyExists' | 'FolderInvalidName' | 'FolderAccessDenied' | 'FolderReadError' | 'FolderWriteError' | 'FolderQuotaExceeded' | 'FolderNotEmpty' | 'FolderBackendError' | 'FolderTimeout' |
19
+ // --- Operational restrictions ---
20
+ 'RenameNotAllowed' | 'MoveNotAllowed' | 'CopyNotAllowed' | 'DeleteNotAllowed' | 'MoveIntoSelf' | 'MoveIntoDescendant' | 'CopyIntoSelf' | 'UnsupportedOperation' | 'ConfigError' |
21
+ // --- File upload ---
22
+ 'FileUploadQuotaExceeded' | 'FileUploadNetworkError' | 'FileUploadTimeout' | 'FileUploadBackendError' |
23
+ // --- URL upload ---
24
+ 'UploadUrlInvalid' | 'UploadUrlNotReachable' | 'UploadUrlContentTypeNotAllowed' | 'UploadUrlDownloadFailed' | 'FileLookupFailed' | 'FileProxyFailed' | 'FileProxyNotConfigured' |
25
+ // --- File download ---
26
+ 'FileDownloadNetworkError' | 'FileDownloadTimeout' | 'FileDownloadBackendError' |
27
+ // --- Batch operations ---
28
+ 'BatchPartialFailure' | 'BatchAllFailed' | 'BatchConflict' | 'BatchValidationFailed' | 'BatchItemLimitExceeded' |
29
+ // --- Validation / data ---
30
+ 'ValidationError' | 'PayloadTooLarge' | 'UnsupportedMediaType' |
31
+ // --- Network / server / infrastructure ---
32
+ 'NetworkError' | 'BackendError' | 'Timeout' | 'AuthenticationFailed' | 'AuthorizationFailed' | 'RateLimitExceeded' | 'ServiceUnavailable' |
33
+ // --- AI / integrations ---
34
+ 'AIResponseInvalid' | 'AIImageGenerationFailed' | 'AIImageGenerationLimitExceeded' | 'IntegrationError' | 'ThirdPartyError' |
35
+ // --- General / fallback ---
36
+ 'UnknownError';
37
+ /**
38
+ * Error interface for FileManager API.
39
+ * Implemented by FileManagerApiError class which is also exported.
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * // Using the class
44
+ * throw new FileManagerApiError(
45
+ * 'File not found',
46
+ * 'FileNotFound',
47
+ * 404
48
+ * );
49
+ *
50
+ * // Or creating a custom class
51
+ * class MyFileManagerError extends Error implements IFileManagerApiError {
52
+ * constructor(
53
+ * message: string,
54
+ * public code: FileManagerErrorCode,
55
+ * public status?: number,
56
+ * public details?: unknown
57
+ * ) {
58
+ * super(message);
59
+ * this.name = 'MyFileManagerError';
60
+ * }
61
+ * }
62
+ * ```
63
+ */
64
+ interface IFileManagerApiError extends Error {
65
+ code: FileManagerErrorCode;
66
+ status?: number;
67
+ details?: unknown;
68
+ }
69
+ /**
70
+ * Parameters for file query operations.
71
+ */
72
+ interface FilesQueryParams {
73
+ folderId?: string;
74
+ search?: string;
75
+ page?: number;
76
+ limit?: number;
77
+ sortBy?: 'name' | 'size' | 'date' | 'type';
78
+ sortOrder?: 'asc' | 'desc';
79
+ itemType?: 'file' | 'folder' | 'all';
80
+ /** Human-readable folder name for the UI (never sent to the API). */
81
+ folderName?: string;
82
+ }
83
+ /**
84
+ * Context payload for operations involving items (files/folders).
85
+ */
86
+ interface ItemContextPayload {
87
+ itemIds?: string[];
88
+ itemNames?: string[];
89
+ folderId?: string | null;
90
+ folderName?: string | null;
91
+ }
92
+ /**
93
+ * Placement options for notification display.
94
+ */
95
+ type NotifyPlacement = 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight';
96
+ type Notify = {
97
+ type: 'success' | 'info' | 'error' | 'warning';
98
+ /** @deprecated Use `title` instead (antd v6+) */
99
+ message?: HTMLElement | string;
100
+ title?: HTMLElement | string;
101
+ description?: HTMLElement | string;
102
+ /** @deprecated Use `actions` instead (antd v6+) */
103
+ btn?: HTMLElement | string;
104
+ actions?: HTMLElement | string;
105
+ onClose?: () => void;
106
+ duration?: number | null;
107
+ icon?: HTMLElement | string;
108
+ placement?: NotifyPlacement;
109
+ style?: any;
110
+ className?: string;
111
+ onClick?: () => void;
112
+ closeIcon?: HTMLElement | string;
113
+ props?: any;
114
+ role?: 'alert' | 'status';
115
+ };
116
+ export declare namespace Notify {
117
+ /**
118
+ * Payload for successful batch operations.
119
+ */
120
+ export interface OperationSuccessPayload extends ItemContextPayload {
121
+ successCount: number;
122
+ totalCount: number;
123
+ eventSource?: UploadEventSource;
124
+ }
125
+ /**
126
+ * Details of an error for a single item in a batch operation.
127
+ */
128
+ export interface OperationErrorDetail {
129
+ itemId?: string;
130
+ itemName?: string;
131
+ error: FileManageErrorInfo;
132
+ }
133
+ /**
134
+ * Payload for batch operation errors.
135
+ * Extends ItemContextPayload with error-specific fields.
136
+ */
137
+ export interface OperationErrorPayload extends ItemContextPayload {
138
+ failCount: number;
139
+ totalCount: number;
140
+ errors?: OperationErrorDetail[];
141
+ /**
142
+ * Flag indicating if this is a move-to-trash operation (true) or permanent delete (false).
143
+ * Used to differentiate between soft delete (trash) and hard delete operations.
144
+ */
145
+ isTrashMove?: boolean;
146
+ eventSource?: UploadEventSource;
147
+ }
148
+ /**
149
+ * Details of a single item in batch operation results.
150
+ * Used in the `detailed` array for batch operations (deleteItems, moveItems, copyItems, uploadFiles).
151
+ *
152
+ * @template T - Type of successful operation result data
153
+ */
154
+ export interface BatchOperationDetail<T = unknown> {
155
+ /** Correlation identifier for the request item (preferred) */
156
+ requestId?: string;
157
+ /** Item identifier (for backward compatibility) */
158
+ id?: string;
159
+ /** Success flag for the operation */
160
+ success: boolean;
161
+ /** Successful operation result data */
162
+ data?: T;
163
+ /** Error for failed operation */
164
+ error?: FileManageErrorInfo;
165
+ }
166
+ /**
167
+ * Result of a batch operation with support for detailed results.
168
+ * Unified type for all batch operations in the file manager.
169
+ *
170
+ * @template T - Type of successful operation result data
171
+ */
172
+ export interface BatchOperationResult<T = unknown> {
173
+ /** Overall success flag (true if all items succeeded) */
174
+ success: boolean;
175
+ /** Overall operation error (if the entire operation failed) */
176
+ error?: string | unknown;
177
+ /** Detailed results for each item */
178
+ detailed?: BatchOperationDetail<T>[];
179
+ }
180
+ /**
181
+ * Summary of batch operation results for notifications.
182
+ * Used for aggregated error and success notifications.
183
+ */
184
+ export interface BatchOperationSummary {
185
+ /** Number of successfully processed items */
186
+ successCount: number;
187
+ /** Number of items with errors */
188
+ failCount: number;
189
+ /** Total number of items */
190
+ totalCount: number;
191
+ /** Error details for each item */
192
+ errors: OperationErrorDetail[];
193
+ }
194
+ /**
195
+ * Payload for operations involving a single item (file or folder).
196
+ */
197
+ export interface SingleItemPayload {
198
+ itemId?: string;
199
+ itemName?: string;
200
+ folderId?: string | null;
201
+ folderName?: string | null;
202
+ }
203
+ /**
204
+ * Payload for rename operation errors.
205
+ */
206
+ export interface RenameErrorPayload extends SingleItemPayload {
207
+ error: FileManageErrorInfo;
208
+ }
209
+ /**
210
+ * Source of the upload event: 'upload' for file picker/drag-drop, 'uploadByUrl' for URL upload.
211
+ */
212
+ export type UploadEventSource = 'upload' | 'uploadByUrl' | 'pixie' | 'iconStock' | 'imageStock' | 'gif';
213
+ /**
214
+ * Payload for file upload operations.
215
+ */
216
+ export interface FileUploadPayload extends SingleItemPayload {
217
+ uploadId?: string;
218
+ eventSource?: UploadEventSource;
219
+ }
220
+ /**
221
+ * Payload for file upload errors.
222
+ */
223
+ export interface FileUploadErrorPayload extends FileUploadPayload {
224
+ error?: FileManageErrorInfo;
225
+ }
226
+ /**
227
+ * Payload for unsupported file type errors.
228
+ */
229
+ export interface UnsupportedFileTypePayload extends FileUploadErrorPayload {
230
+ fileType: string;
231
+ }
232
+ /**
233
+ * Payload for folder operation errors and successes.
234
+ */
235
+ export interface FolderOperationPayload extends ItemContextPayload {
236
+ folderId?: string | null;
237
+ folderName?: string;
238
+ reason?: string;
239
+ is_force_create?: boolean;
240
+ }
241
+ /**
242
+ * Payload for file URL validation errors.
243
+ */
244
+ export interface FileUrlValidationErrorPayload {
245
+ url?: string | null;
246
+ error: FileManageErrorInfo;
247
+ }
248
+ /**
249
+ * Payload for image file operations.
250
+ */
251
+ export interface ImageFilePayload extends SingleItemPayload {
252
+ thumbnail?: string | null;
253
+ }
254
+ /**
255
+ * Payload for URL upload operations.
256
+ */
257
+ export interface UrlUploadPayload {
258
+ url?: string | null;
259
+ folderId?: string | null;
260
+ folderName?: string | null;
261
+ eventSource?: UploadEventSource;
262
+ }
263
+ /**
264
+ * Payload for URL upload errors.
265
+ */
266
+ export interface UrlUploadErrorPayload extends UrlUploadPayload {
267
+ error: FileManageErrorInfo;
268
+ }
269
+ /**
270
+ * Payload for file fetch errors.
271
+ */
272
+ export interface FetchFilesErrorPayload {
273
+ params?: FilesQueryParams;
274
+ /** Display name of the listed folder (after resolving getItem / path / cache). */
275
+ folderName?: string | null;
276
+ }
277
+ /**
278
+ * Base payload for AI image generation operations.
279
+ */
280
+ interface AIImageGenerationBasePayload {
281
+ request: string;
282
+ taskId?: string | null;
283
+ }
284
+ /**
285
+ * Payload for AI image generation started event.
286
+ */
287
+ export interface AIImageGenerationStartedPayload extends AIImageGenerationBasePayload {
288
+ response?: unknown;
289
+ }
290
+ /**
291
+ * Payload for successful AI image generation.
292
+ */
293
+ export interface AIImageGenerationSuccessPayload extends AIImageGenerationBasePayload {
294
+ images: string[];
295
+ }
296
+ /**
297
+ * Payload for failed AI image generation.
298
+ */
299
+ export interface AIImageGenerationFailedPayload extends AIImageGenerationBasePayload {
300
+ response?: unknown;
301
+ error?: FileManageErrorInfo;
302
+ }
303
+ /**
304
+ * Base type for error notification events.
305
+ * Includes innerException field for error details.
306
+ *
307
+ * @template TId - Notification event ID type
308
+ * @template TData - Payload data type
309
+ */
310
+ export type ErrorEventBase<TId extends string, TData> = {
311
+ id: TId;
312
+ data?: TData;
313
+ innerException?: unknown;
314
+ message: string;
315
+ title?: string;
316
+ placement?: NotifyPlacement;
317
+ description?: string;
318
+ /**
319
+ * Visibility flag for the notification.
320
+ * If true, notification will be shown; if false, it will be silent.
321
+ * Derived from the `silent` parameter (visibility = !silent).
322
+ * Can be modified by event interceptors.
323
+ */
324
+ visibility?: boolean;
325
+ /**
326
+ * Level of the operation: 'item' for single item operations, 'batch' for batch operations.
327
+ */
328
+ level?: 'item' | 'batch';
329
+ /**
330
+ * When true, identical notifications are deduplicated by TTL (after interceptors).
331
+ * For uploads and mutations it is usually omitted or set to false.
332
+ */
333
+ notificationDedupe?: boolean;
334
+ };
335
+ /**
336
+ * Base type for success, warning, and info notification events.
337
+ * Does not include innerException field.
338
+ *
339
+ * @template TId - Notification event ID type
340
+ * @template TData - Payload data type
341
+ */
342
+ export type NotificationEventBase<TId extends string, TData> = {
343
+ id: TId;
344
+ data?: TData;
345
+ message: string;
346
+ title?: string;
347
+ placement?: NotifyPlacement;
348
+ description?: string;
349
+ /**
350
+ * Visibility flag for the notification.
351
+ * If true, notification will be shown; if false, it will be silent.
352
+ * Derived from the `silent` parameter (visibility = !silent).
353
+ * Can be modified by event interceptors.
354
+ */
355
+ visibility?: boolean;
356
+ /**
357
+ * Level of the operation: 'item' for single item operations, 'batch' for batch operations.
358
+ */
359
+ level?: 'item' | 'batch';
360
+ };
361
+ /**
362
+ * Map of error notification IDs to their payload types for single item operations.
363
+ * All item operation errors extend OperationErrorPayload with failCount: 1 and totalCount: 1.
364
+ */
365
+ export interface ItemErrorMap {
366
+ FILE_DELETE_ERROR: OperationErrorPayload;
367
+ FILE_MOVE_ERROR: OperationErrorPayload;
368
+ FILE_COPY_ERROR: OperationErrorPayload;
369
+ }
370
+ /**
371
+ * Map of error notification IDs to their payload types for batch operations.
372
+ * All batch operation errors extend OperationErrorPayload.
373
+ */
374
+ export interface BatchErrorMap {
375
+ FILES_DELETE_ERROR: OperationErrorPayload;
376
+ FOLDER_DELETE_ERROR: OperationErrorPayload;
377
+ FILES_UPLOAD_BATCH_FAILED: OperationErrorPayload;
378
+ FILES_MOVE_ERROR: OperationErrorPayload;
379
+ FILES_COPY_ERROR: OperationErrorPayload;
380
+ }
381
+ /**
382
+ * Map of success notification IDs to their payload types for single item operations.
383
+ * All item operation successes extend OperationSuccessPayload with successCount: 1 and totalCount: 1.
384
+ */
385
+ export interface ItemSuccessMap {
386
+ FILE_DELETE_SUCCESS: OperationSuccessPayload;
387
+ FILE_MOVE_SUCCESS: OperationSuccessPayload;
388
+ FILE_COPY_SUCCESS: OperationSuccessPayload;
389
+ }
390
+ /**
391
+ * Map of success notification IDs to their payload types for batch operations.
392
+ * All batch operation successes extend OperationSuccessPayload.
393
+ */
394
+ export interface BatchSuccessMap {
395
+ FILES_DELETE_SUCCESS: OperationSuccessPayload;
396
+ FILES_MOVE_SUCCESS: OperationSuccessPayload;
397
+ FILES_COPY_SUCCESS: OperationSuccessPayload;
398
+ FOLDER_DELETE_SUCCESS: OperationSuccessPayload;
399
+ FILES_UPLOAD_BATCH_SUCCESS: OperationSuccessPayload;
400
+ }
401
+ /**
402
+ * Map of all error notification IDs to their payload types.
403
+ * Extends ItemErrorMap for single item operations and BatchErrorMap for batch operations.
404
+ */
405
+ export interface ErrorMap extends ItemErrorMap, BatchErrorMap {
406
+ FILE_DOWNLOAD_FAILED: ImageFilePayload;
407
+ IMAGE_DOWNLOAD_FAILED: ImageFilePayload;
408
+ IMAGE_SAVE_FAILED: ImageFilePayload;
409
+ IMAGE_SAVE_COPY_FAILED: ImageFilePayload;
410
+ EDITOR_INIT_FAILED: never;
411
+ EDITOR_FIND_FILE_BY_URL_FAILED: UrlUploadErrorPayload;
412
+ EDITOR_PROXY_FILE_FAILED: UrlUploadErrorPayload;
413
+ AI_RESPONSE_INVALID: unknown;
414
+ AI_IMAGE_GENERATION_FAILED: AIImageGenerationFailedPayload;
415
+ AI_IMAGE_GENERATION_LIMIT_EXCEEDED: never;
416
+ FILES_FETCH_FAILED: FetchFilesErrorPayload;
417
+ FILE_RENAME_DISABLED_BY_CONFIG: SingleItemPayload;
418
+ FILE_RENAME_FAILED: RenameErrorPayload;
419
+ FOLDER_RENAME_DISABLED_BY_CONFIG: SingleItemPayload;
420
+ FOLDER_RENAME_FAILED: RenameErrorPayload;
421
+ ITEM_RENAME_FAILED: RenameErrorPayload;
422
+ FILE_UPLOAD_ITEM_FAILED: FileUploadErrorPayload;
423
+ FILES_UPLOAD_URL_VALIDATION_FAILED: UrlUploadPayload;
424
+ FILES_UPLOAD_URL_NOT_SUPPORTED: UrlUploadPayload;
425
+ FILES_UPLOAD_BY_URL_FAILED: UrlUploadErrorPayload;
426
+ FILES_UPLOAD_PROVIDER_NOT_CONFIGURED: never;
427
+ FILES_MOVE_DIRECTORY_NOT_SELECTED: never;
428
+ FILES_COPY_DIRECTORY_NOT_SELECTED: never;
429
+ FOLDERS_FETCH_FAILED: FolderOperationPayload;
430
+ FOLDER_ALREADY_EXISTS: FolderOperationPayload;
431
+ FOLDER_ALREADY_EXISTS_COPY: FolderOperationPayload & {
432
+ targetFolderId?: string;
433
+ };
434
+ FOLDER_ALREADY_EXISTS_MOVE: FolderOperationPayload & {
435
+ targetFolderId?: string;
436
+ };
437
+ FOLDER_CREATE_PROVIDER_NOT_CONFIGURED: FolderOperationPayload;
438
+ FOLDER_CREATE_FAILED: FolderOperationPayload;
439
+ FOLDER_CHILDREN_COUNT_FAILED: FolderOperationPayload;
440
+ FOLDER_CHILDREN_FETCH_FAILED: FolderOperationPayload;
441
+ FILE_URL_VALIDATION_FAILED: FileUrlValidationErrorPayload;
442
+ TRASH_CLEAR_FAILED: OperationErrorPayload;
443
+ TRASH_CLEAR_ERROR: never;
444
+ }
445
+ /**
446
+ * Union type of all error events.
447
+ */
448
+ export type Error = { [K in keyof ErrorMap]: ErrorEventBase<K, ErrorMap[K]>; }[keyof ErrorMap];
449
+ /**
450
+ * Error notification event type.
451
+ */
452
+ export type ErrorEvent = {
453
+ type: 'error';
454
+ } & Error;
455
+ /**
456
+ * Map of all success notification IDs to their payload types.
457
+ * Extends ItemSuccessMap for single item operations and BatchSuccessMap for batch operations.
458
+ */
459
+ export interface SuccessMap extends ItemSuccessMap, BatchSuccessMap {
460
+ AI_IMAGE_GENERATION_STARTED: AIImageGenerationStartedPayload;
461
+ AI_IMAGE_GENERERATION_SUCCESS: AIImageGenerationSuccessPayload;
462
+ // EDITOR_IMAGE_DOWNLOAD_SUCCESS: ImageFilePayload;
463
+ IMAGE_UPDATE_SUCCESS: ImageFilePayload;
464
+ IMAGE_SAVE_COPY_SUCCESS: ImageFilePayload;
465
+ FILE_RENAME_SUCCESS: SingleItemPayload;
466
+ FOLDER_RENAME_SUCCESS: SingleItemPayload;
467
+ FOLDER_CREATE_SUCCESS: FolderOperationPayload;
468
+ FILE_UPLOAD_ITEM_SUCCESS: FileUploadPayload;
469
+ TRASH_CLEARED_SUCCESS: never;
470
+ FOLDER_NOT_FOUND_NAVIGATE: never;
471
+ }
472
+ /**
473
+ * Union type of all success events.
474
+ */
475
+ export type Success = { [K in keyof SuccessMap]: NotificationEventBase<K, SuccessMap[K]>; }[keyof SuccessMap];
476
+ /**
477
+ * Success notification event type.
478
+ */
479
+ export type SuccessEvent = {
480
+ type: 'success';
481
+ } & Success;
482
+ /**
483
+ * Map of warning notification IDs to their payload types.
484
+ */
485
+ export interface WarningMap {
486
+ FILES_UPLOAD_UNSUPPORTED_TYPE: UnsupportedFileTypePayload;
487
+ FOLDER_OPERATION_VALIDATION_FAILED: FolderOperationPayload;
488
+ TRASH_CLEARED_PARTIAL: OperationErrorPayload;
489
+ }
490
+ /**
491
+ * Union type of all warning events.
492
+ */
493
+ export type Warning = { [K in keyof WarningMap]: NotificationEventBase<K, WarningMap[K]>; }[keyof WarningMap];
494
+ /**
495
+ * Warning notification event type.
496
+ */
497
+ export type WarningEvent = {
498
+ type: 'warning';
499
+ } & Warning;
500
+ /**
501
+ * Map of info notification IDs to their payload types.
502
+ */
503
+ export interface InfoMap {}
504
+ /**
505
+ * Union type of all info events.
506
+ */
507
+ export type Info = { [K in keyof InfoMap]: NotificationEventBase<K, InfoMap[K]>; }[keyof InfoMap];
508
+ /**
509
+ * Info notification event type.
510
+ */
511
+ export type InfoEvent = {
512
+ type: 'info';
513
+ } & Info;
514
+ }
515
+ /**
516
+ * Union type of all notification events (error, success, warning, info).
517
+ */
518
+ type NotifyEvent = Notify.SuccessEvent | Notify.ErrorEvent | Notify.WarningEvent | Notify.InfoEvent;
519
+ export { FileManageErrorInfo, notification_d_exports as FileManager, FileManagerErrorCode, FilesQueryParams, IFileManagerApiError, ItemContextPayload, NotifyEvent, NotifyPlacement };
@@ -303,7 +303,7 @@ img[src*='<!--']::after {
303
303
  }
304
304
 
305
305
  em-replace::after {
306
- background-color: var(--colorBgBase);
306
+ background-color: var(--ub-colorBgBase);
307
307
  }
308
308
 
309
309
  /* Маркер глобального блока в превью (псевдоэлемент, см. sandbox.css) */
@@ -122,7 +122,7 @@
122
122
  [em-state='active']:not(.em-element-resize-height, .em-element-resize-img),
123
123
  [em-state='active-inside']:not(.em-element-resize-height, .em-element-resize-img),
124
124
  .sortable-ghost {
125
- outline: 1px solid var(--colorPrimary);
125
+ outline: 1px solid var(--ub-colorPrimary);
126
126
  }
127
127
 
128
128
  /* Tiny CSS */
@@ -199,7 +199,7 @@ img[src*='<!--']::after {
199
199
  }
200
200
 
201
201
  em-replace::after {
202
- background-color: var(--colorLink);
202
+ background-color: var(--ub-colorLink);
203
203
  }
204
204
 
205
205
  /* Маркер глобального блока в превью (псевдоэлемент, см. sandbox.css) */