@maas/payload-plugin-media-cloud 0.0.2 → 0.0.3
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/dist/components/upload-manager/upload-manager.d.ts +1 -0
- package/dist/components/upload-manager/upload-manager.js +1 -1
- package/package.json +1 -1
- package/dist/components/upload-manager/upload-manager-D9UZkMR8.css +0 -204
- package/dist/components/upload-manager/upload-manager-D9UZkMR8.css.map +0 -1
- package/dist/components/upload-manager/upload-manager2.js +0 -0
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
import { MediaCloudError } from "../../types/errors.js";
|
|
5
5
|
import { useErrorHandler } from "../../hooks/useErrorHandler.js";
|
|
6
6
|
import { useEmitter } from "../../hooks/useEmitter.js";
|
|
7
|
-
import "./upload-manager2.js";
|
|
8
7
|
import { createContext, use, useEffect, useRef, useState } from "react";
|
|
9
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
9
|
import { Button } from "@payloadcms/ui";
|
|
10
|
+
import "./upload-manager.css";
|
|
11
11
|
|
|
12
12
|
//#region src/components/upload-manager/upload-manager.tsx
|
|
13
13
|
const { logError } = useErrorHandler();
|
package/package.json
CHANGED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
@keyframes pulse {
|
|
2
|
-
0% {
|
|
3
|
-
opacity: 0.6;
|
|
4
|
-
}
|
|
5
|
-
50% {
|
|
6
|
-
opacity: 1;
|
|
7
|
-
}
|
|
8
|
-
100% {
|
|
9
|
-
opacity: 0.6;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@keyframes shimmer {
|
|
14
|
-
0% {
|
|
15
|
-
background-position: -200% 0;
|
|
16
|
-
}
|
|
17
|
-
100% {
|
|
18
|
-
background-position: 200% 0;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.upload-manager {
|
|
23
|
-
position: fixed;
|
|
24
|
-
overflow: hidden;
|
|
25
|
-
bottom: 0;
|
|
26
|
-
left: 50%;
|
|
27
|
-
transform: translateX(-50%);
|
|
28
|
-
width: 400px;
|
|
29
|
-
max-height: 500px;
|
|
30
|
-
margin: 2.25rem;
|
|
31
|
-
background: var(--theme-bg);
|
|
32
|
-
border: 1px solid var(--theme-elevation-100);
|
|
33
|
-
border-radius: var(--style-radius-m);
|
|
34
|
-
box-shadow: var(--box-shadow-lg);
|
|
35
|
-
z-index: 1024;
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-direction: column;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.upload-manager__header {
|
|
41
|
-
display: flex;
|
|
42
|
-
align-items: center;
|
|
43
|
-
justify-content: space-between;
|
|
44
|
-
padding: 0.75rem 1rem;
|
|
45
|
-
border-bottom: 1px solid var(--theme-elevation-100);
|
|
46
|
-
background: var(--theme-elevation-50);
|
|
47
|
-
|
|
48
|
-
& h4 {
|
|
49
|
-
margin: 0;
|
|
50
|
-
font-size: 0.875rem;
|
|
51
|
-
font-weight: 600;
|
|
52
|
-
color: var(--theme-text);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.upload-manager__tabs {
|
|
57
|
-
display: flex;
|
|
58
|
-
border-bottom: 1px solid var(--theme-elevation-100);
|
|
59
|
-
background: var(--theme-elevation-25);
|
|
60
|
-
|
|
61
|
-
& .upload-tab {
|
|
62
|
-
flex: 1;
|
|
63
|
-
padding: 0.5rem 0.75rem;
|
|
64
|
-
background: none;
|
|
65
|
-
border: none;
|
|
66
|
-
color: var(--theme-text-dim);
|
|
67
|
-
font-size: 0.75rem;
|
|
68
|
-
font-weight: 500;
|
|
69
|
-
cursor: pointer;
|
|
70
|
-
transition: all 0.15s ease;
|
|
71
|
-
border-bottom: 2px solid transparent;
|
|
72
|
-
|
|
73
|
-
&:hover {
|
|
74
|
-
background: var(--theme-elevation-50);
|
|
75
|
-
color: var(--theme-text);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
&[data-active='true'] {
|
|
79
|
-
color: var(--theme-success-500);
|
|
80
|
-
border-bottom-color: var(--theme-success-500);
|
|
81
|
-
background: var(--theme-bg);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.upload-manager__content {
|
|
87
|
-
flex: 1;
|
|
88
|
-
overflow-y: auto;
|
|
89
|
-
max-height: 300px;
|
|
90
|
-
padding: 0;
|
|
91
|
-
|
|
92
|
-
& ul {
|
|
93
|
-
list-style: none;
|
|
94
|
-
margin: 0;
|
|
95
|
-
padding: 0;
|
|
96
|
-
|
|
97
|
-
& li {
|
|
98
|
-
padding: 0.75rem 1rem;
|
|
99
|
-
border-bottom: 1px solid var(--theme-elevation-50);
|
|
100
|
-
|
|
101
|
-
&:last-child {
|
|
102
|
-
border-bottom: none;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
&[data-status='uploading'] {
|
|
106
|
-
background: var(--theme-bg);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
&[data-status='processing'] {
|
|
110
|
-
background: var(--theme-warning-50);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
&[data-status='completed'] {
|
|
114
|
-
background: var(--theme-success-50);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
& .upload-empty-state {
|
|
120
|
-
padding: 2rem 1rem;
|
|
121
|
-
text-align: center;
|
|
122
|
-
color: var(--theme-text-dim);
|
|
123
|
-
font-size: 0.875rem;
|
|
124
|
-
margin: 0;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.upload-progress-bar {
|
|
129
|
-
height: 3px;
|
|
130
|
-
background: var(--theme-elevation-100);
|
|
131
|
-
border-radius: 2px;
|
|
132
|
-
overflow: hidden;
|
|
133
|
-
position: relative;
|
|
134
|
-
|
|
135
|
-
& .upload-progress {
|
|
136
|
-
height: 100%;
|
|
137
|
-
background: var(--theme-success-500);
|
|
138
|
-
width: calc(var(--progress) * 100%);
|
|
139
|
-
transition: width 0.3s ease;
|
|
140
|
-
border-radius: inherit;
|
|
141
|
-
|
|
142
|
-
&[data-active='true'] {
|
|
143
|
-
background: var(--theme-warning-500);
|
|
144
|
-
animation: pulse 1.5s ease-in-out infinite;
|
|
145
|
-
width: 100%;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.upload-info {
|
|
151
|
-
display: flex;
|
|
152
|
-
align-items: center;
|
|
153
|
-
justify-content: space-between;
|
|
154
|
-
margin-bottom: 0.5rem;
|
|
155
|
-
|
|
156
|
-
& .upload-filename {
|
|
157
|
-
font-size: 0.875rem;
|
|
158
|
-
font-weight: 500;
|
|
159
|
-
color: var(--theme-text);
|
|
160
|
-
flex: 1;
|
|
161
|
-
margin-right: 0.5rem;
|
|
162
|
-
overflow: hidden;
|
|
163
|
-
text-overflow: ellipsis;
|
|
164
|
-
white-space: nowrap;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
& .upload-meta {
|
|
168
|
-
font-size: 0.75rem;
|
|
169
|
-
color: var(--theme-text-dim);
|
|
170
|
-
font-weight: 500;
|
|
171
|
-
flex-shrink: 0;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.upload-manager__file {
|
|
176
|
-
& .upload-manager__file--polling {
|
|
177
|
-
animation: pulse 2s ease-in-out infinite;
|
|
178
|
-
background: linear-gradient(90deg, #3b82f6, #8b5cf6, #3b82f6);
|
|
179
|
-
background-size: 200% 100%;
|
|
180
|
-
animation:
|
|
181
|
-
pulse 2s ease-in-out infinite,
|
|
182
|
-
shimmer 3s ease-in-out infinite;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.upload-manager__footer {
|
|
187
|
-
padding: 0.75rem 1rem;
|
|
188
|
-
border-top: 1px solid var(--theme-elevation-100);
|
|
189
|
-
background: var(--theme-elevation-50);
|
|
190
|
-
display: flex;
|
|
191
|
-
justify-content: center;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// Responsive adjustments
|
|
195
|
-
@media (max-width: 768px) {
|
|
196
|
-
.upload-manager {
|
|
197
|
-
width: calc(100vw - 2rem);
|
|
198
|
-
right: 1rem;
|
|
199
|
-
left: 1rem;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
/*# sourceMappingURL=upload-manager-D9UZkMR8.css.map*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload-manager-D9UZkMR8.css","names":[],"sources":["../../../src/components/upload-manager/upload-manager.css"],"sourcesContent":["@keyframes pulse {\n 0% {\n opacity: 0.6;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.6;\n }\n}\n\n@keyframes shimmer {\n 0% {\n background-position: -200% 0;\n }\n 100% {\n background-position: 200% 0;\n }\n}\n\n.upload-manager {\n position: fixed;\n overflow: hidden;\n bottom: 0;\n left: 50%;\n transform: translateX(-50%);\n width: 400px;\n max-height: 500px;\n margin: 2.25rem;\n background: var(--theme-bg);\n border: 1px solid var(--theme-elevation-100);\n border-radius: var(--style-radius-m);\n box-shadow: var(--box-shadow-lg);\n z-index: 1024;\n display: flex;\n flex-direction: column;\n}\n\n.upload-manager__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.75rem 1rem;\n border-bottom: 1px solid var(--theme-elevation-100);\n background: var(--theme-elevation-50);\n\n & h4 {\n margin: 0;\n font-size: 0.875rem;\n font-weight: 600;\n color: var(--theme-text);\n }\n}\n\n.upload-manager__tabs {\n display: flex;\n border-bottom: 1px solid var(--theme-elevation-100);\n background: var(--theme-elevation-25);\n\n & .upload-tab {\n flex: 1;\n padding: 0.5rem 0.75rem;\n background: none;\n border: none;\n color: var(--theme-text-dim);\n font-size: 0.75rem;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.15s ease;\n border-bottom: 2px solid transparent;\n\n &:hover {\n background: var(--theme-elevation-50);\n color: var(--theme-text);\n }\n\n &[data-active='true'] {\n color: var(--theme-success-500);\n border-bottom-color: var(--theme-success-500);\n background: var(--theme-bg);\n }\n }\n}\n\n.upload-manager__content {\n flex: 1;\n overflow-y: auto;\n max-height: 300px;\n padding: 0;\n\n & ul {\n list-style: none;\n margin: 0;\n padding: 0;\n\n & li {\n padding: 0.75rem 1rem;\n border-bottom: 1px solid var(--theme-elevation-50);\n\n &:last-child {\n border-bottom: none;\n }\n\n &[data-status='uploading'] {\n background: var(--theme-bg);\n }\n\n &[data-status='processing'] {\n background: var(--theme-warning-50);\n }\n\n &[data-status='completed'] {\n background: var(--theme-success-50);\n }\n }\n }\n\n & .upload-empty-state {\n padding: 2rem 1rem;\n text-align: center;\n color: var(--theme-text-dim);\n font-size: 0.875rem;\n margin: 0;\n }\n}\n\n.upload-progress-bar {\n height: 3px;\n background: var(--theme-elevation-100);\n border-radius: 2px;\n overflow: hidden;\n position: relative;\n\n & .upload-progress {\n height: 100%;\n background: var(--theme-success-500);\n width: calc(var(--progress) * 100%);\n transition: width 0.3s ease;\n border-radius: inherit;\n\n &[data-active='true'] {\n background: var(--theme-warning-500);\n animation: pulse 1.5s ease-in-out infinite;\n width: 100%;\n }\n }\n}\n\n.upload-info {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 0.5rem;\n\n & .upload-filename {\n font-size: 0.875rem;\n font-weight: 500;\n color: var(--theme-text);\n flex: 1;\n margin-right: 0.5rem;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n & .upload-meta {\n font-size: 0.75rem;\n color: var(--theme-text-dim);\n font-weight: 500;\n flex-shrink: 0;\n }\n}\n\n.upload-manager__file {\n & .upload-manager__file--polling {\n animation: pulse 2s ease-in-out infinite;\n background: linear-gradient(90deg, #3b82f6, #8b5cf6, #3b82f6);\n background-size: 200% 100%;\n animation:\n pulse 2s ease-in-out infinite,\n shimmer 3s ease-in-out infinite;\n }\n}\n\n.upload-manager__footer {\n padding: 0.75rem 1rem;\n border-top: 1px solid var(--theme-elevation-100);\n background: var(--theme-elevation-50);\n display: flex;\n justify-content: center;\n}\n\n// Responsive adjustments\n@media (max-width: 768px) {\n .upload-manager {\n width: calc(100vw - 2rem);\n right: 1rem;\n left: 1rem;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
File without changes
|