@emailmaker/filemanager 0.0.9 → 0.10.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.
- package/components/FolderSidebar/FolderSidebar.d.ts +1 -1
- package/components/PixieEditor/PixieController.d.ts +40 -0
- package/file-manager.css +187 -153
- package/file-manager.esm.js +10 -10
- package/file-manager.esm.js.map +1 -1
- package/file-manager.js +1 -1
- package/mockServiceWorker.js +1 -1
- package/package.json +30 -30
- package/sample-files.json +104 -104
- package/test-pixie-loading.html +108 -108
- package/types.d.ts +8 -0
package/mockServiceWorker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const PACKAGE_VERSION="2.
|
|
1
|
+
const PACKAGE_VERSION="2.11.0",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.11.0",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
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@emailmaker/filemanager",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"main": "./file-manager.js",
|
|
5
|
-
"module": "./file-manager.esm.js",
|
|
6
|
-
"types": "./index.d.ts",
|
|
7
|
-
"style": "./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
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@emailmaker/filemanager",
|
|
3
|
+
"version": "0.10.1",
|
|
4
|
+
"main": "./file-manager.js",
|
|
5
|
+
"module": "./file-manager.esm.js",
|
|
6
|
+
"types": "./index.d.ts",
|
|
7
|
+
"style": "./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
|
+
}
|
package/sample-files.json
CHANGED
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
{
|
|
2
|
-
"files": [
|
|
3
|
-
{
|
|
4
|
-
"id": "sample-1",
|
|
5
|
-
"name": "Красивый закат.jpg",
|
|
6
|
-
"size": "2845",
|
|
7
|
-
"date": "2024-01-15T10:30:00Z",
|
|
8
|
-
"folderId": "",
|
|
9
|
-
"type": "image",
|
|
10
|
-
"url": "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400&h=300&fit=crop",
|
|
11
|
-
"thumbnailUrl": "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=150&h=100&fit=crop",
|
|
12
|
-
"extension": "jpg",
|
|
13
|
-
"isFolder": false,
|
|
14
|
-
"selected": false,
|
|
15
|
-
"dimensions": "1920x1080",
|
|
16
|
-
"aspectRatio": "16:9"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"id": "sample-2",
|
|
20
|
-
"name": "Горы и озеро.jpg",
|
|
21
|
-
"size": "3200",
|
|
22
|
-
"date": "2024-01-10T14:20:00Z",
|
|
23
|
-
"folderId": "nature-folder",
|
|
24
|
-
"type": "image",
|
|
25
|
-
"url": "https://images.unsplash.com/photo-1464822759380-8ed769e99d5c?w=400&h=300&fit=crop",
|
|
26
|
-
"thumbnailUrl": "https://images.unsplash.com/photo-1464822759380-8ed769e99d5c?w=150&h=100&fit=crop",
|
|
27
|
-
"extension": "jpg",
|
|
28
|
-
"isFolder": false,
|
|
29
|
-
"selected": false,
|
|
30
|
-
"dimensions": "1920x1280",
|
|
31
|
-
"aspectRatio": "3:2"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"id": "sample-3",
|
|
35
|
-
"name": "Отчет_2024.pdf",
|
|
36
|
-
"size": "1250",
|
|
37
|
-
"date": "2024-01-12T09:15:00Z",
|
|
38
|
-
"folderId": "documents-folder",
|
|
39
|
-
"type": "document",
|
|
40
|
-
"url": "https://via.placeholder.com/400x300/2196F3/white?text=PDF+Document",
|
|
41
|
-
"thumbnailUrl": "https://via.placeholder.com/150x100/2196F3/white?text=PDF",
|
|
42
|
-
"extension": "pdf",
|
|
43
|
-
"isFolder": false,
|
|
44
|
-
"selected": false
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"id": "sample-4",
|
|
48
|
-
"name": "Презентация.pptx",
|
|
49
|
-
"size": "4500",
|
|
50
|
-
"date": "2024-01-08T16:45:00Z",
|
|
51
|
-
"folderId": "documents-folder",
|
|
52
|
-
"type": "document",
|
|
53
|
-
"url": "https://via.placeholder.com/400x300/FF9800/white?text=PowerPoint",
|
|
54
|
-
"thumbnailUrl": "https://via.placeholder.com/150x100/FF9800/white?text=PPT",
|
|
55
|
-
"extension": "pptx",
|
|
56
|
-
"isFolder": false,
|
|
57
|
-
"selected": false
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"id": "sample-5",
|
|
61
|
-
"name": "Лес в тумане.jpg",
|
|
62
|
-
"size": "2100",
|
|
63
|
-
"date": "2024-01-05T11:30:00Z",
|
|
64
|
-
"folderId": "nature-folder",
|
|
65
|
-
"type": "image",
|
|
66
|
-
"url": "https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=400&h=300&fit=crop",
|
|
67
|
-
"thumbnailUrl": "https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=150&h=100&fit=crop",
|
|
68
|
-
"extension": "jpg",
|
|
69
|
-
"isFolder": false,
|
|
70
|
-
"selected": false,
|
|
71
|
-
"dimensions": "1920x1280",
|
|
72
|
-
"aspectRatio": "3:2"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"id": "sample-6",
|
|
76
|
-
"name": "Архивные_данные.zip",
|
|
77
|
-
"size": "15600",
|
|
78
|
-
"date": "2024-01-01T08:00:00Z",
|
|
79
|
-
"folderId": "",
|
|
80
|
-
"type": "archive",
|
|
81
|
-
"url": "https://via.placeholder.com/400x300/795548/white?text=ZIP+Archive",
|
|
82
|
-
"thumbnailUrl": "https://via.placeholder.com/150x100/795548/white?text=ZIP",
|
|
83
|
-
"extension": "zip",
|
|
84
|
-
"isFolder": false,
|
|
85
|
-
"selected": false
|
|
86
|
-
}
|
|
87
|
-
],
|
|
88
|
-
"folders": [
|
|
89
|
-
{
|
|
90
|
-
"id": "nature-folder",
|
|
91
|
-
"name": "🌲 Природа",
|
|
92
|
-
"parentId": null
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"id": "documents-folder",
|
|
96
|
-
"name": "📄 Документы",
|
|
97
|
-
"parentId": null
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
"id": "photos-subfolder",
|
|
101
|
-
"name": "📷 Фотографии",
|
|
102
|
-
"parentId": "nature-folder"
|
|
103
|
-
}
|
|
104
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"files": [
|
|
3
|
+
{
|
|
4
|
+
"id": "sample-1",
|
|
5
|
+
"name": "Красивый закат.jpg",
|
|
6
|
+
"size": "2845",
|
|
7
|
+
"date": "2024-01-15T10:30:00Z",
|
|
8
|
+
"folderId": "",
|
|
9
|
+
"type": "image",
|
|
10
|
+
"url": "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400&h=300&fit=crop",
|
|
11
|
+
"thumbnailUrl": "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=150&h=100&fit=crop",
|
|
12
|
+
"extension": "jpg",
|
|
13
|
+
"isFolder": false,
|
|
14
|
+
"selected": false,
|
|
15
|
+
"dimensions": "1920x1080",
|
|
16
|
+
"aspectRatio": "16:9"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "sample-2",
|
|
20
|
+
"name": "Горы и озеро.jpg",
|
|
21
|
+
"size": "3200",
|
|
22
|
+
"date": "2024-01-10T14:20:00Z",
|
|
23
|
+
"folderId": "nature-folder",
|
|
24
|
+
"type": "image",
|
|
25
|
+
"url": "https://images.unsplash.com/photo-1464822759380-8ed769e99d5c?w=400&h=300&fit=crop",
|
|
26
|
+
"thumbnailUrl": "https://images.unsplash.com/photo-1464822759380-8ed769e99d5c?w=150&h=100&fit=crop",
|
|
27
|
+
"extension": "jpg",
|
|
28
|
+
"isFolder": false,
|
|
29
|
+
"selected": false,
|
|
30
|
+
"dimensions": "1920x1280",
|
|
31
|
+
"aspectRatio": "3:2"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "sample-3",
|
|
35
|
+
"name": "Отчет_2024.pdf",
|
|
36
|
+
"size": "1250",
|
|
37
|
+
"date": "2024-01-12T09:15:00Z",
|
|
38
|
+
"folderId": "documents-folder",
|
|
39
|
+
"type": "document",
|
|
40
|
+
"url": "https://via.placeholder.com/400x300/2196F3/white?text=PDF+Document",
|
|
41
|
+
"thumbnailUrl": "https://via.placeholder.com/150x100/2196F3/white?text=PDF",
|
|
42
|
+
"extension": "pdf",
|
|
43
|
+
"isFolder": false,
|
|
44
|
+
"selected": false
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "sample-4",
|
|
48
|
+
"name": "Презентация.pptx",
|
|
49
|
+
"size": "4500",
|
|
50
|
+
"date": "2024-01-08T16:45:00Z",
|
|
51
|
+
"folderId": "documents-folder",
|
|
52
|
+
"type": "document",
|
|
53
|
+
"url": "https://via.placeholder.com/400x300/FF9800/white?text=PowerPoint",
|
|
54
|
+
"thumbnailUrl": "https://via.placeholder.com/150x100/FF9800/white?text=PPT",
|
|
55
|
+
"extension": "pptx",
|
|
56
|
+
"isFolder": false,
|
|
57
|
+
"selected": false
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "sample-5",
|
|
61
|
+
"name": "Лес в тумане.jpg",
|
|
62
|
+
"size": "2100",
|
|
63
|
+
"date": "2024-01-05T11:30:00Z",
|
|
64
|
+
"folderId": "nature-folder",
|
|
65
|
+
"type": "image",
|
|
66
|
+
"url": "https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=400&h=300&fit=crop",
|
|
67
|
+
"thumbnailUrl": "https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=150&h=100&fit=crop",
|
|
68
|
+
"extension": "jpg",
|
|
69
|
+
"isFolder": false,
|
|
70
|
+
"selected": false,
|
|
71
|
+
"dimensions": "1920x1280",
|
|
72
|
+
"aspectRatio": "3:2"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id": "sample-6",
|
|
76
|
+
"name": "Архивные_данные.zip",
|
|
77
|
+
"size": "15600",
|
|
78
|
+
"date": "2024-01-01T08:00:00Z",
|
|
79
|
+
"folderId": "",
|
|
80
|
+
"type": "archive",
|
|
81
|
+
"url": "https://via.placeholder.com/400x300/795548/white?text=ZIP+Archive",
|
|
82
|
+
"thumbnailUrl": "https://via.placeholder.com/150x100/795548/white?text=ZIP",
|
|
83
|
+
"extension": "zip",
|
|
84
|
+
"isFolder": false,
|
|
85
|
+
"selected": false
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"folders": [
|
|
89
|
+
{
|
|
90
|
+
"id": "nature-folder",
|
|
91
|
+
"name": "🌲 Природа",
|
|
92
|
+
"parentId": null
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"id": "documents-folder",
|
|
96
|
+
"name": "📄 Документы",
|
|
97
|
+
"parentId": null
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "photos-subfolder",
|
|
101
|
+
"name": "📷 Фотографии",
|
|
102
|
+
"parentId": "nature-folder"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
105
|
}
|
package/test-pixie-loading.html
CHANGED
|
@@ -1,108 +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="/
|
|
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
|
-
|
|
86
|
-
ui: {
|
|
87
|
-
visible: true,
|
|
88
|
-
mode: 'inline'
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
|
|
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>
|
|
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="/local_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: "/local_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>
|
package/types.d.ts
CHANGED
|
@@ -166,6 +166,14 @@ export interface FileManagerDataProviders {
|
|
|
166
166
|
targetFolderId: string;
|
|
167
167
|
isFolder: boolean;
|
|
168
168
|
}) => Promise<boolean>;
|
|
169
|
+
copyItem?: (options: {
|
|
170
|
+
itemId: string;
|
|
171
|
+
targetFolderId: string;
|
|
172
|
+
isFolder: boolean;
|
|
173
|
+
}) => Promise<{
|
|
174
|
+
id: string;
|
|
175
|
+
url?: string;
|
|
176
|
+
}>;
|
|
169
177
|
updateFile?: (fileId: string, updates: {
|
|
170
178
|
name?: string;
|
|
171
179
|
type?: string;
|