@emailmaker/filemanager 0.0.1

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 (84) hide show
  1. package/app/themeProvider/ThemeProvider.d.ts +7 -0
  2. package/app/themeProvider/index.d.ts +1 -0
  3. package/components/CloseButton/CloseButton.d.ts +10 -0
  4. package/components/EmIcons/EmIcons.d.ts +14 -0
  5. package/components/FileContent/FileContent.d.ts +30 -0
  6. package/components/FileContent/GridView.d.ts +11 -0
  7. package/components/FileManagerApp/ActionsHeader.d.ts +14 -0
  8. package/components/FileManagerApp/FileManagerApp.d.ts +29 -0
  9. package/components/FileModals/FileModals.d.ts +37 -0
  10. package/components/FolderSidebar/FolderSidebar.d.ts +20 -0
  11. package/components/ImageAI/ImageAI.d.ts +4 -0
  12. package/components/ImageAI/SlideShowForImageAI/SlideShowForImageAI.d.ts +7 -0
  13. package/components/ImageAI/useImageAIGeneration/useImageAIGeneration.d.ts +2 -0
  14. package/components/ImageGif/ImageGif.d.ts +4 -0
  15. package/components/ImageStock/ImageStock.d.ts +4 -0
  16. package/components/LimitsCounter/LimitsCounter.d.ts +10 -0
  17. package/components/PixieEditor/PixieEditorIframe.d.ts +10 -0
  18. package/components/PixieEditor/index.d.ts +1 -0
  19. package/components/SearchInput/SearchInput.d.ts +8 -0
  20. package/components/SearchInput/index.d.ts +1 -0
  21. package/components/Tag/index.d.ts +11 -0
  22. package/components/UploadProgress/UploadProgress.d.ts +20 -0
  23. package/components/UploadProgress/index.d.ts +2 -0
  24. package/components/ViewModeToggle/ViewModeToggle.d.ts +9 -0
  25. package/components/index.d.ts +5 -0
  26. package/config/config.d.ts +5 -0
  27. package/config/usersConfigs/index.d.ts +26 -0
  28. package/constants/index.d.ts +11 -0
  29. package/debug-script.js +1 -0
  30. package/dev/index.d.ts +4 -0
  31. package/file-manager.css +1 -0
  32. package/file-manager.d.ts +46 -0
  33. package/file-manager.esm.js +2 -0
  34. package/file-manager.esm.js.map +1 -0
  35. package/file-manager.js +2 -0
  36. package/file-manager.js.LICENSE.txt +110 -0
  37. package/helpers/gtm.d.ts +16 -0
  38. package/hooks/core/context.d.ts +15 -0
  39. package/hooks/core/files/index.d.ts +4 -0
  40. package/hooks/core/files/useFilesAPI.d.ts +16 -0
  41. package/hooks/core/files/useFilesAPIHelpers.d.ts +18 -0
  42. package/hooks/core/files/useFilesModals.d.ts +20 -0
  43. package/hooks/core/files/useFilesSelection.d.ts +10 -0
  44. package/hooks/core/index.d.ts +11 -0
  45. package/hooks/core/temp/context.d.ts +0 -0
  46. package/hooks/core/types.d.ts +160 -0
  47. package/hooks/core/useFiles.d.ts +37 -0
  48. package/hooks/core/useFolderModals.d.ts +13 -0
  49. package/hooks/core/useFolders.d.ts +19 -0
  50. package/hooks/core/useModals.d.ts +17 -0
  51. package/hooks/core/useNavigation.d.ts +15 -0
  52. package/hooks/core/usePagination.d.ts +12 -0
  53. package/hooks/core/useSortAndFilter.d.ts +20 -0
  54. package/hooks/index.d.ts +5 -0
  55. package/hooks/useCustomIcons.d.ts +17 -0
  56. package/hooks/useFileActions.d.ts +21 -0
  57. package/hooks/useFileUpload.d.ts +16 -0
  58. package/hooks/useLastDirectory.d.ts +18 -0
  59. package/hooks/usePixieEditor.d.ts +15 -0
  60. package/hooks/useSidebarResize.d.ts +9 -0
  61. package/hooks/useViewMode.d.ts +7 -0
  62. package/i18n.d.ts +3 -0
  63. package/index.d.ts +13 -0
  64. package/index.html +141 -0
  65. package/loacal_module/pixie/dist/images/empty-canvas-bg.png +0 -0
  66. package/loacal_module/pixie/dist/pixie.es.js +2 -0
  67. package/loacal_module/pixie/dist/pixie.es.js.LICENSE.txt +86 -0
  68. package/loacal_module/pixie/dist/pixie.es.js.map +1 -0
  69. package/loacal_module/pixie/dist/pixie.umd.js +2 -0
  70. package/loacal_module/pixie/dist/pixie.umd.js.LICENSE.txt +116 -0
  71. package/loacal_module/pixie/dist/pixie.umd.js.map +1 -0
  72. package/mockServiceWorker.js +1 -0
  73. package/package.json +30 -0
  74. package/pixie-editor.html +187 -0
  75. package/shared/config.d.ts +13 -0
  76. package/shared/helpers/getParendFolderPath.d.ts +1 -0
  77. package/shared/helpers/index.d.ts +1 -0
  78. package/suppress-resize-observer-errors.js +1 -0
  79. package/test-pixie-loading.html +108 -0
  80. package/types.d.ts +379 -0
  81. package/utils/fileValidation.d.ts +34 -0
  82. package/utils/resizeObserverHandler.d.ts +6 -0
  83. package/utils/themeUtils.d.ts +17 -0
  84. package/widgets/layout/errorBoundary/errorBoundary.d.ts +19 -0
@@ -0,0 +1 @@
1
+ const PACKAGE_VERSION="2.10.3",INTEGRITY_CHECKSUM="f5825c521429caf22a4dd13b66e243af",IS_MOCKED_RESPONSE=Symbol("isMockedResponse"),activeClientIds=new Set;async function handleRequest(e,t){const n=await resolveMainClient(e),s=e.request.clone(),i=await getResponse(e,n,t);if(n&&activeClientIds.has(n.id)){const e=await serializeRequest(s),a=i.clone();sendToClient(n,{type:"RESPONSE",payload:{isMockedResponse:IS_MOCKED_RESPONSE in i,request:{id:t,...e},response:{type:a.type,status:a.status,statusText:a.statusText,headers:Object.fromEntries(a.headers.entries()),body:a.body}}},a.body?[e.body,a.body]:[])}return i}async function resolveMainClient(e){const t=await self.clients.get(e.clientId);return activeClientIds.has(e.clientId)||"top-level"===t?.frameType?t:(await self.clients.matchAll({type:"window"})).filter((e=>"visible"===e.visibilityState)).find((e=>activeClientIds.has(e.id)))}async function getResponse(e,t,n){const s=e.request.clone();function i(){const e=new Headers(s.headers),t=e.get("accept");if(t){const n=t.split(",").map((e=>e.trim())).filter((e=>"msw/passthrough"!==e));n.length>0?e.set("accept",n.join(", ")):e.delete("accept")}return fetch(s,{headers:e})}if(!t)return i();if(!activeClientIds.has(t.id))return i();const a=await serializeRequest(e.request),r=await sendToClient(t,{type:"REQUEST",payload:{id:n,...a}},[a.body]);switch(r.type){case"MOCK_RESPONSE":return respondWithMock(r.data);case"PASSTHROUGH":return i()}return i()}function sendToClient(e,t,n=[]){return new Promise(((s,i)=>{const a=new MessageChannel;a.port1.onmessage=e=>{if(e.data&&e.data.error)return i(e.data.error);s(e.data)},e.postMessage(t,[a.port2,...n.filter(Boolean)])}))}function respondWithMock(e){if(0===e.status)return Response.error();const t=new Response(e.body,e);return Reflect.defineProperty(t,IS_MOCKED_RESPONSE,{value:!0,enumerable:!0}),t}async function serializeRequest(e){return{url:e.url,mode:e.mode,method:e.method,headers:Object.fromEntries(e.headers.entries()),cache:e.cache,credentials:e.credentials,destination:e.destination,integrity:e.integrity,redirect:e.redirect,referrer:e.referrer,referrerPolicy:e.referrerPolicy,body:await e.arrayBuffer(),keepalive:e.keepalive}}addEventListener("install",(function(){self.skipWaiting()})),addEventListener("activate",(function(e){e.waitUntil(self.clients.claim())})),addEventListener("message",(async function(e){const t=Reflect.get(e.source||{},"id");if(!t||!self.clients)return;const n=await self.clients.get(t);if(!n)return;const s=await self.clients.matchAll({type:"window"});switch(e.data){case"KEEPALIVE_REQUEST":sendToClient(n,{type:"KEEPALIVE_RESPONSE"});break;case"INTEGRITY_CHECK_REQUEST":sendToClient(n,{type:"INTEGRITY_CHECK_RESPONSE",payload:{packageVersion:"2.10.3",checksum:INTEGRITY_CHECKSUM}});break;case"MOCK_ACTIVATE":activeClientIds.add(t),sendToClient(n,{type:"MOCKING_ENABLED",payload:{client:{id:n.id,frameType:n.frameType}}});break;case"MOCK_DEACTIVATE":activeClientIds.delete(t);break;case"CLIENT_CLOSED":{activeClientIds.delete(t);const e=s.filter((e=>e.id!==t));0===e.length&&self.registration.unregister();break}}})),addEventListener("fetch",(function(e){if("navigate"===e.request.mode)return;if("only-if-cached"===e.request.cache&&"same-origin"!==e.request.mode)return;if(0===activeClientIds.size)return;const t=crypto.randomUUID();e.respondWith(handleRequest(e,t))}));
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@emailmaker/filemanager",
3
+ "version": "0.0.1",
4
+ "main": "./dist/file-manager.js",
5
+ "module": "./dist/file-manager.esm.js",
6
+ "types": "./dist/index.d.ts",
7
+ "style": "./dist/file-manager.css",
8
+ "license": "MIT",
9
+ "peerDependencies": {
10
+ "react": "^18.2.0 || ^19.0.0",
11
+ "react-dom": "^18.2.0 || ^19.0.0"
12
+ },
13
+ "browserslist": {
14
+ "production": [
15
+ "last 2 chrome version",
16
+ "last 2 firefox version",
17
+ "last 2 safari version"
18
+ ],
19
+ "development": [
20
+ "last 1 chrome version",
21
+ "last 1 firefox version",
22
+ "last 1 safari version"
23
+ ]
24
+ },
25
+ "msw": {
26
+ "workerDirectory": [
27
+ "public"
28
+ ]
29
+ }
30
+ }
@@ -0,0 +1,187 @@
1
+ <!DOCTYPE html>
2
+ <html lang="ru">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Pixie Editor</title>
7
+ <style>
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ body {
15
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
16
+ background: #f5f5f5;
17
+ overflow: hidden;
18
+ }
19
+
20
+ #pixie-editor {
21
+ width: 100vw;
22
+ height: 100vh;
23
+ }
24
+
25
+ .loading {
26
+ position: fixed;
27
+ top: 50%;
28
+ left: 50%;
29
+ transform: translate(-50%, -50%);
30
+ background: white;
31
+ padding: 20px;
32
+ border-radius: 8px;
33
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
34
+ z-index: 1000;
35
+ }
36
+
37
+ .toolbar {
38
+ position: fixed;
39
+ bottom: 10px;
40
+ right: 10px;
41
+ z-index: 1001;
42
+ display: flex;
43
+ gap: 10px;
44
+ }
45
+
46
+ .toolbar button {
47
+ padding: 8px 16px;
48
+ border: none;
49
+ border-radius: 4px;
50
+ cursor: pointer;
51
+ font-size: 14px;
52
+ font-weight: 500;
53
+ }
54
+
55
+ .btn-save {
56
+ background: #1890ff;
57
+ color: white;
58
+ }
59
+
60
+ .btn-save:hover {
61
+ background: #40a9ff;
62
+ }
63
+
64
+ .btn-cancel {
65
+ background: #f5f5f5;
66
+ color: #595959;
67
+ }
68
+
69
+ .btn-cancel:hover {
70
+ background: #e6f7ff;
71
+ }
72
+
73
+ .btn-save:disabled {
74
+ background: #d9d9d9;
75
+ cursor: not-allowed;
76
+ }
77
+ </style>
78
+ </head>
79
+ <body>
80
+ <div id="loading" class="loading">
81
+ <div>Загрузка редактора...</div>
82
+ </div>
83
+
84
+ <div class="toolbar">
85
+ <button id="saveBtn" class="btn-save" disabled>Сохранить</button>
86
+ <button id="cancelBtn" class="btn-cancel">Отмена</button>
87
+ </div>
88
+
89
+ <div id="pixie-editor"></div>
90
+
91
+ <script src="loacal_module/pixie/dist/pixie.umd.js"></script>
92
+ <script>
93
+ let pixieInstance = null;
94
+ let currentFile = null;
95
+
96
+ function initPixie(imageData, fileName) {
97
+ try {
98
+ console.log('Инициализация Pixie для файла:', fileName);
99
+
100
+ const config = {
101
+ selector: '#pixie-editor',
102
+ image: imageData,
103
+ baseUrl: "/loacal_module/pixie/assets",
104
+ ui: {
105
+ visible: true,
106
+ mode: 'inline',
107
+ toolbar: {
108
+ items: ['crop', 'resize', 'filter', 'draw', 'text', 'shapes', 'frame']
109
+ }
110
+ },
111
+ crossOrigin: true
112
+ };
113
+
114
+ if (window.Pixie) {
115
+ pixieInstance = new window.Pixie(config);
116
+
117
+ setTimeout(() => {
118
+ document.getElementById('loading').style.display = 'none';
119
+ document.getElementById('saveBtn').disabled = false;
120
+ console.log('Pixie успешно инициализирован');
121
+ }, 1000);
122
+ } else {
123
+ throw new Error('Pixie не загружен');
124
+ }
125
+ } catch (error) {
126
+ console.error('Ошибка инициализации Pixie:', error);
127
+ document.getElementById('loading').innerHTML = '<div>Ошибка загрузки: ' + error.message + '</div>';
128
+ }
129
+ }
130
+ document.getElementById('saveBtn').addEventListener('click', async () => {
131
+ if (!pixieInstance || !currentFile) return;
132
+
133
+ try {
134
+ document.getElementById('saveBtn').disabled = true;
135
+ document.getElementById('saveBtn').textContent = 'Сохранение...';
136
+
137
+
138
+ const dataUrl = await pixieInstance.tools.export.getDataUrl("png", 0.9);
139
+ window.parent.postMessage({
140
+ type: 'PIXIE_SAVE',
141
+ data: {
142
+ file: currentFile,
143
+ imageData: dataUrl
144
+ }
145
+ }, '*');
146
+
147
+ } catch (error) {
148
+ console.error('Ошибка сохранения:', error);
149
+ alert('Ошибка при сохранении изображения');
150
+ document.getElementById('saveBtn').disabled = false;
151
+ document.getElementById('saveBtn').textContent = 'Сохранить';
152
+ }
153
+ });
154
+
155
+ document.getElementById('cancelBtn').addEventListener('click', () => {
156
+ window.parent.postMessage({
157
+ type: 'PIXIE_CANCEL'
158
+ }, '*');
159
+ });
160
+
161
+ window.addEventListener('message', (event) => {
162
+ if (event.data.type === 'INIT_PIXIE') {
163
+ currentFile = event.data.file;
164
+ const imageData = event.data.imageData;
165
+ initPixie(imageData, currentFile.name);
166
+ }
167
+ });
168
+
169
+ window.addEventListener('load', () => {
170
+ window.parent.postMessage({
171
+ type: 'PIXIE_READY'
172
+ }, '*');
173
+ });
174
+
175
+ window.addEventListener('beforeunload', () => {
176
+ if (pixieInstance) {
177
+ try {
178
+ pixieInstance.close?.();
179
+ pixieInstance.destroy?.();
180
+ } catch (error) {
181
+ console.warn('Ошибка при закрытии Pixie:', error);
182
+ }
183
+ }
184
+ });
185
+ </script>
186
+ </body>
187
+ </html>
@@ -0,0 +1,13 @@
1
+ export interface Config {
2
+ theme?: 'light' | 'dark';
3
+ activeTab?: string;
4
+ showDefaultNotification?: boolean;
5
+ disableMockServer?: boolean;
6
+ apiEndpoints?: {
7
+ getFolders?: string;
8
+ getFiles?: string;
9
+ createFolder?: string;
10
+ createFile?: string;
11
+ deleteFile?: string;
12
+ };
13
+ }
@@ -0,0 +1 @@
1
+ export declare const getParentFolderPath: (path: string) => string | undefined;
@@ -0,0 +1 @@
1
+ export { getParentFolderPath } from './getParendFolderPath';
@@ -0,0 +1 @@
1
+ !function(){"use strict";console.log("🔧 Инициализация подавления ошибок ResizeObserver...");const e=console.error,o=window.onerror,n=e=>e&&"string"==typeof e&&e.includes("ResizeObserver loop completed with undelivered notifications");console.error=function(...o){const r=o[0]&&o[0].toString?o[0].toString():"";if(!n(r))return e.apply(console,o)},window.onerror=function(e,r,t,i,s){return!!(n(e)||s&&n(s.message))||!!o&&o.call(this,e,r,t,i,s)},window.addEventListener("error",(function(e){n(e.message)&&(e.stopImmediatePropagation(),e.preventDefault())}),!0),console.log("✅ Подавление ошибок ResizeObserver активировано")}();
@@ -0,0 +1,108 @@
1
+ <!DOCTYPE html>
2
+ <html lang="ru">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Тест загрузки Pixie</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ margin: 20px;
11
+ background: #f5f5f5;
12
+ }
13
+ .status {
14
+ padding: 10px;
15
+ margin: 10px 0;
16
+ border-radius: 4px;
17
+ }
18
+ .success {
19
+ background: #d4edda;
20
+ color: #155724;
21
+ border: 1px solid #c3e6cb;
22
+ }
23
+ .error {
24
+ background: #f8d7da;
25
+ color: #721c24;
26
+ border: 1px solid #f5c6cb;
27
+ }
28
+ .loading {
29
+ background: #fff3cd;
30
+ color: #856404;
31
+ border: 1px solid #ffeaa7;
32
+ }
33
+ #pixie-container {
34
+ width: 800px;
35
+ height: 600px;
36
+ border: 1px solid #ccc;
37
+ margin: 20px 0;
38
+ background: white;
39
+ }
40
+ </style>
41
+ </head>
42
+ <body>
43
+ <h1>Тест загрузки Pixie Editor</h1>
44
+
45
+ <div id="status" class="status loading">Проверка загрузки...</div>
46
+
47
+ <div id="details">
48
+ <h3>Проверки:</h3>
49
+ <ul id="checks">
50
+ <li id="script-check">Загрузка скрипта Pixie...</li>
51
+ <li id="pixie-check">Проверка объекта Pixie...</li>
52
+ <li id="assets-check">Проверка ассетов...</li>
53
+ </ul>
54
+ </div>
55
+
56
+ <div id="pixie-container"></div>
57
+
58
+ <script src="/loacal_module/pixie/dist/pixie.umd.js"></script>
59
+ <script>
60
+ function updateCheck(id, text, success = true) {
61
+ const element = document.getElementById(id);
62
+ element.textContent = text;
63
+ element.style.color = success ? 'green' : 'red';
64
+ element.style.fontWeight = success ? 'bold' : 'normal';
65
+ }
66
+
67
+ function updateStatus(text, type = 'loading') {
68
+ const status = document.getElementById('status');
69
+ status.textContent = text;
70
+ status.className = `status ${type}`;
71
+ }
72
+
73
+ // Проверка загрузки скрипта
74
+ updateCheck('script-check', '✓ Скрипт Pixie успешно загружен', true);
75
+
76
+ // Проверка объекта Pixie
77
+ setTimeout(() => {
78
+ if (typeof window.Pixie !== 'undefined') {
79
+ updateCheck('pixie-check', '✓ Объект Pixie доступен', true);
80
+
81
+ // Попытка инициализации
82
+ try {
83
+ const pixie = new window.Pixie({
84
+ selector: '#pixie-container',
85
+ baseUrl: '/loacal_module/pixie/assets',
86
+ ui: {
87
+ visible: true,
88
+ mode: 'inline'
89
+ }
90
+ });
91
+
92
+ updateCheck('assets-check', '✓ Ассеты успешно загружены', true);
93
+ updateStatus('✓ Pixie Editor успешно инициализирован!', 'success');
94
+
95
+ } catch (error) {
96
+ updateCheck('assets-check', `✗ Ошибка инициализации: ${error.message}`, false);
97
+ updateStatus('✗ Ошибка инициализации Pixie', 'error');
98
+ console.error('Ошибка Pixie:', error);
99
+ }
100
+ } else {
101
+ updateCheck('pixie-check', '✗ Объект Pixie не найден', false);
102
+ updateStatus('✗ Pixie не загружен', 'error');
103
+ }
104
+ }, 1000);
105
+
106
+ </script>
107
+ </body>
108
+ </html>