@axium/storage 0.20.2 → 0.20.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/lib/Preview.css +110 -0
- package/lib/Preview.svelte +1 -113
- package/package.json +1 -1
package/lib/Preview.css
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
anchor-scope: --preview-openers;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.preview-action {
|
|
6
|
+
--size: 18px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.preview-action:hover {
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.preview-top-bar {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
gap: 1em;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
padding: 0;
|
|
19
|
+
position: absolute;
|
|
20
|
+
inset: 0.5em 1em 0;
|
|
21
|
+
height: fit-content;
|
|
22
|
+
|
|
23
|
+
> div {
|
|
24
|
+
display: flex;
|
|
25
|
+
gap: 1em;
|
|
26
|
+
align-items: center;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.openers {
|
|
31
|
+
padding: 1em;
|
|
32
|
+
border: var(--border-accent);
|
|
33
|
+
border-radius: 1em;
|
|
34
|
+
height: 2em;
|
|
35
|
+
anchor-name: --preview-openers;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.openers :global([popover]) {
|
|
39
|
+
inset: anchor(bottom) anchor(right) auto anchor(left);
|
|
40
|
+
position-anchor: --preview-openers;
|
|
41
|
+
width: anchor-size(width);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.actions {
|
|
45
|
+
right: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.preview-content {
|
|
49
|
+
position: absolute;
|
|
50
|
+
inset: 3em 10em 1em;
|
|
51
|
+
display: flex;
|
|
52
|
+
text-align: center;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
|
|
57
|
+
.full-fill {
|
|
58
|
+
position: absolute;
|
|
59
|
+
inset: 0;
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 100%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.preview-text {
|
|
65
|
+
white-space: pre-wrap;
|
|
66
|
+
overflow-y: scroll;
|
|
67
|
+
line-height: 1.6;
|
|
68
|
+
background-color: var(--bg-menu);
|
|
69
|
+
font-family: monospace;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
img,
|
|
73
|
+
video {
|
|
74
|
+
max-width: 100%;
|
|
75
|
+
max-height: 100%;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.no-preview {
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
gap: 1em;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@media (width < 700px) {
|
|
88
|
+
.preview-top-bar {
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
|
|
91
|
+
.actions {
|
|
92
|
+
justify-content: space-around;
|
|
93
|
+
width: 100%;
|
|
94
|
+
|
|
95
|
+
.preview-action {
|
|
96
|
+
padding: 1em;
|
|
97
|
+
flex: 1 1 0;
|
|
98
|
+
border-radius: 1em;
|
|
99
|
+
border: var(--border-accent);
|
|
100
|
+
padding: 1em;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
display: flex;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.preview-content {
|
|
108
|
+
inset: 10em 1em 0;
|
|
109
|
+
}
|
|
110
|
+
}
|
package/lib/Preview.svelte
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { copyShortURL } from '@axium/storage/client/frontend';
|
|
8
8
|
import type { StorageItemMetadata } from '@axium/storage/common';
|
|
9
9
|
import '@axium/storage/polyfills';
|
|
10
|
+
import './Preview.css';
|
|
10
11
|
|
|
11
12
|
const {
|
|
12
13
|
item,
|
|
@@ -144,116 +145,3 @@
|
|
|
144
145
|
>
|
|
145
146
|
<p>{text('storage.Preview.download_confirm')}</p>
|
|
146
147
|
</FormDialog>
|
|
147
|
-
|
|
148
|
-
<style>
|
|
149
|
-
:host {
|
|
150
|
-
anchor-scope: --preview-openers;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.preview-action {
|
|
154
|
-
--size: 18px;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.preview-action:hover {
|
|
158
|
-
cursor: pointer;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.preview-top-bar {
|
|
162
|
-
display: flex;
|
|
163
|
-
align-items: center;
|
|
164
|
-
gap: 1em;
|
|
165
|
-
justify-content: space-between;
|
|
166
|
-
padding: 0;
|
|
167
|
-
position: absolute;
|
|
168
|
-
inset: 0.5em 1em 0;
|
|
169
|
-
height: fit-content;
|
|
170
|
-
|
|
171
|
-
> div {
|
|
172
|
-
display: flex;
|
|
173
|
-
gap: 1em;
|
|
174
|
-
align-items: center;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.openers {
|
|
179
|
-
padding: 1em;
|
|
180
|
-
border: var(--border-accent);
|
|
181
|
-
border-radius: 1em;
|
|
182
|
-
height: 2em;
|
|
183
|
-
anchor-name: --preview-openers;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.openers :global([popover]) {
|
|
187
|
-
inset: anchor(bottom) anchor(right) auto anchor(left);
|
|
188
|
-
position-anchor: --preview-openers;
|
|
189
|
-
width: anchor-size(width);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.actions {
|
|
193
|
-
right: 0;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.preview-content {
|
|
197
|
-
position: absolute;
|
|
198
|
-
inset: 3em 10em 1em;
|
|
199
|
-
display: flex;
|
|
200
|
-
text-align: center;
|
|
201
|
-
align-items: center;
|
|
202
|
-
justify-content: center;
|
|
203
|
-
flex-direction: column;
|
|
204
|
-
|
|
205
|
-
.full-fill {
|
|
206
|
-
position: absolute;
|
|
207
|
-
inset: 0;
|
|
208
|
-
width: 100%;
|
|
209
|
-
height: 100%;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
.preview-text {
|
|
213
|
-
white-space: pre-wrap;
|
|
214
|
-
overflow-y: scroll;
|
|
215
|
-
line-height: 1.6;
|
|
216
|
-
background-color: var(--bg-menu);
|
|
217
|
-
font-family: monospace;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
img,
|
|
221
|
-
video {
|
|
222
|
-
max-width: 100%;
|
|
223
|
-
max-height: 100%;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.no-preview {
|
|
228
|
-
display: flex;
|
|
229
|
-
flex-direction: column;
|
|
230
|
-
gap: 1em;
|
|
231
|
-
align-items: center;
|
|
232
|
-
justify-content: center;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
@media (width < 700px) {
|
|
236
|
-
.preview-top-bar {
|
|
237
|
-
flex-direction: column;
|
|
238
|
-
|
|
239
|
-
.actions {
|
|
240
|
-
justify-content: space-around;
|
|
241
|
-
width: 100%;
|
|
242
|
-
|
|
243
|
-
.preview-action {
|
|
244
|
-
padding: 1em;
|
|
245
|
-
flex: 1 1 0;
|
|
246
|
-
border-radius: 1em;
|
|
247
|
-
border: var(--border-accent);
|
|
248
|
-
padding: 1em;
|
|
249
|
-
justify-content: center;
|
|
250
|
-
display: flex;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
.preview-content {
|
|
256
|
-
inset: 10em 1em 0;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
</style>
|