@onivoro/app-server-bucketvore 24.33.21 → 24.34.7
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/assets/ui/assets/index-CqxLoWwu.js +55 -0
- package/assets/ui/assets/index-DYhFphcs.css +1 -0
- package/assets/ui/index.html +13 -0
- package/main.js +210 -2204
- package/package.json +4 -4
- package/assets/.gitkeep +0 -1
- package/assets/scripts/s3-explorer.bundle.js +0 -96
- package/main.js.map +0 -1
- package/src/index.d.ts +0 -7
- package/src/index.js +0 -23
package/main.js
CHANGED
|
@@ -12,16 +12,12 @@ exports.bootstrap = bootstrap;
|
|
|
12
12
|
const core_1 = __webpack_require__(2);
|
|
13
13
|
const path_1 = __webpack_require__(3);
|
|
14
14
|
const app_server_bucketvore_module_1 = __webpack_require__(4);
|
|
15
|
-
const app_server_bucketvore_config_class_1 = __webpack_require__(44);
|
|
16
15
|
async function bootstrap() {
|
|
17
16
|
const app = await core_1.NestFactory.create(app_server_bucketvore_module_1.AppServerBucketvoreModule, { logger: console });
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
prefix: '/assets/',
|
|
21
|
-
});
|
|
22
|
-
const port = Number(new app_server_bucketvore_config_class_1.AppServerBucketvoreConfig().HTTP_PORT);
|
|
17
|
+
app.useStaticAssets((0, path_1.join)(__dirname, 'assets', 'ui'));
|
|
18
|
+
const port = Number(process.env.PORT || 3007);
|
|
23
19
|
await app.listen(port);
|
|
24
|
-
console.log(`BucketVore available at: http://localhost:${port}`);
|
|
20
|
+
console.log(`BucketVore API available at: http://localhost:${port}`);
|
|
25
21
|
}
|
|
26
22
|
|
|
27
23
|
|
|
@@ -47,1767 +43,112 @@ exports.AppServerBucketvoreModule = void 0;
|
|
|
47
43
|
const tslib_1 = __webpack_require__(5);
|
|
48
44
|
const common_1 = __webpack_require__(6);
|
|
49
45
|
const app_controller_1 = __webpack_require__(7);
|
|
50
|
-
const buckets_controller_1 = __webpack_require__(
|
|
51
|
-
const files_controller_1 = __webpack_require__(
|
|
52
|
-
const upload_controller_1 = __webpack_require__(
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
const file_preview_service_1 = __webpack_require__(52);
|
|
59
|
-
const bucketvoreConfig = new app_server_bucketvore_config_class_1.AppServerBucketvoreConfig();
|
|
46
|
+
const buckets_controller_1 = __webpack_require__(8);
|
|
47
|
+
const files_controller_1 = __webpack_require__(14);
|
|
48
|
+
const upload_controller_1 = __webpack_require__(16);
|
|
49
|
+
const s3_service_1 = __webpack_require__(9);
|
|
50
|
+
const file_preview_service_1 = __webpack_require__(15);
|
|
51
|
+
const app_server_bucketvore_config_class_1 = __webpack_require__(12);
|
|
52
|
+
const client_s3_1 = __webpack_require__(10);
|
|
53
|
+
const credential_providers_1 = __webpack_require__(13);
|
|
60
54
|
let AppServerBucketvoreModule = class AppServerBucketvoreModule {
|
|
61
55
|
};
|
|
62
56
|
exports.AppServerBucketvoreModule = AppServerBucketvoreModule;
|
|
63
57
|
exports.AppServerBucketvoreModule = AppServerBucketvoreModule = tslib_1.__decorate([
|
|
64
58
|
(0, common_1.Module)({
|
|
65
59
|
imports: [],
|
|
66
|
-
controllers: [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
]
|
|
90
|
-
})
|
|
91
|
-
], AppServerBucketvoreModule);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
/***/ }),
|
|
95
|
-
/* 5 */
|
|
96
|
-
/***/ ((module) => {
|
|
97
|
-
|
|
98
|
-
module.exports = require("tslib");
|
|
99
|
-
|
|
100
|
-
/***/ }),
|
|
101
|
-
/* 6 */
|
|
102
|
-
/***/ ((module) => {
|
|
103
|
-
|
|
104
|
-
module.exports = require("@nestjs/common");
|
|
105
|
-
|
|
106
|
-
/***/ }),
|
|
107
|
-
/* 7 */
|
|
108
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
var _a;
|
|
112
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
113
|
-
exports.AppController = void 0;
|
|
114
|
-
const tslib_1 = __webpack_require__(5);
|
|
115
|
-
const common_1 = __webpack_require__(6);
|
|
116
|
-
const server_html_1 = __webpack_require__(8);
|
|
117
|
-
const app_server_bucketvore_config_class_1 = __webpack_require__(44);
|
|
118
|
-
const design_system_1 = __webpack_require__(45);
|
|
119
|
-
let AppController = class AppController {
|
|
120
|
-
constructor(config) {
|
|
121
|
-
this.config = config;
|
|
122
|
-
}
|
|
123
|
-
get() {
|
|
124
|
-
return (0, server_html_1.$html)({
|
|
125
|
-
lang: 'en',
|
|
126
|
-
children: [
|
|
127
|
-
(0, server_html_1.$head)({
|
|
128
|
-
children: [
|
|
129
|
-
(0, server_html_1.$meta)({ charset: 'UTF-8' }),
|
|
130
|
-
(0, server_html_1.$meta)({ name: 'viewport', content: 'width=device-width, initial-scale=1.0' }),
|
|
131
|
-
(0, server_html_1.$title)({ textContent: 'BucketVore - S3 File Explorer' }),
|
|
132
|
-
(0, server_html_1.$link)({ rel: 'icon', type: 'image/x-icon', href: '/assets/images/bear.ico' }),
|
|
133
|
-
(0, server_html_1.$style)({ textContent: design_system_1.DESIGN_SYSTEM_STYLES }),
|
|
134
|
-
// Load our Alpine component first
|
|
135
|
-
(0, server_html_1.$script)({ src: '/assets/scripts/s3-explorer.bundle.js' }),
|
|
136
|
-
// Then load Alpine.js (will auto-start after DOM ready)
|
|
137
|
-
(0, server_html_1.$script)({ src: 'https://unpkg.com/alpinejs@3.13.5/dist/cdn.min.js', defer: true })
|
|
138
|
-
]
|
|
139
|
-
}),
|
|
140
|
-
(0, server_html_1.$body)({
|
|
141
|
-
'x-data': 's3Explorer()',
|
|
142
|
-
'x-init': 'init()',
|
|
143
|
-
children: [
|
|
144
|
-
// Header
|
|
145
|
-
(0, server_html_1.$header)({
|
|
146
|
-
children: [
|
|
147
|
-
(0, server_html_1.$div)({
|
|
148
|
-
className: 'header-left',
|
|
149
|
-
children: [
|
|
150
|
-
(0, server_html_1.$div)({
|
|
151
|
-
className: 'header-info',
|
|
152
|
-
children: [
|
|
153
|
-
(0, server_html_1.$h1)({ textContent: '🪣 BucketVore' }),
|
|
154
|
-
(0, server_html_1.$p)({
|
|
155
|
-
'x-show': 'selectedBucket',
|
|
156
|
-
'x-text': 'selectedBucket',
|
|
157
|
-
textContent: 'Select a bucket'
|
|
158
|
-
})
|
|
159
|
-
]
|
|
160
|
-
})
|
|
161
|
-
]
|
|
162
|
-
}),
|
|
163
|
-
(0, server_html_1.$div)({
|
|
164
|
-
className: 'header-actions',
|
|
165
|
-
'x-show': 'selectedBucket',
|
|
166
|
-
children: [
|
|
167
|
-
(0, server_html_1.$button)({
|
|
168
|
-
className: 'btn',
|
|
169
|
-
'@click': 'showUpload = true',
|
|
170
|
-
textContent: '⬆️ Upload'
|
|
171
|
-
}),
|
|
172
|
-
(0, server_html_1.$button)({
|
|
173
|
-
className: 'btn secondary',
|
|
174
|
-
'@click': 'refresh()',
|
|
175
|
-
textContent: '🔄 Refresh'
|
|
176
|
-
})
|
|
177
|
-
]
|
|
178
|
-
})
|
|
179
|
-
]
|
|
180
|
-
}),
|
|
181
|
-
(0, server_html_1.$div)({
|
|
182
|
-
className: 'container',
|
|
183
|
-
children: [
|
|
184
|
-
// Sidebar - Bucket List
|
|
185
|
-
(0, server_html_1.$aside)({
|
|
186
|
-
children: [
|
|
187
|
-
(0, server_html_1.$div)({
|
|
188
|
-
className: 'sidebar-header',
|
|
189
|
-
children: [
|
|
190
|
-
(0, server_html_1.$h1)({ textContent: '📋 Buckets', style: { fontSize: 'var(--size-sm)', marginBottom: 'var(--space-3)' } }),
|
|
191
|
-
(0, server_html_1.$input)({
|
|
192
|
-
type: 'text',
|
|
193
|
-
placeholder: 'Filter buckets...',
|
|
194
|
-
'x-model': 'bucketFilter',
|
|
195
|
-
'@input': 'filterBuckets()',
|
|
196
|
-
className: 'filter-input',
|
|
197
|
-
style: { width: '100%', padding: 'var(--space-2)', borderRadius: 'var(--radius-sm)', border: '1px solid var(--color-border)', backgroundColor: 'var(--color-bg-tertiary)', color: 'var(--color-text-primary)', fontSize: 'var(--size-sm)' }
|
|
198
|
-
})
|
|
199
|
-
]
|
|
200
|
-
}),
|
|
201
|
-
(0, server_html_1.$div)({
|
|
202
|
-
className: 'bucket-list',
|
|
203
|
-
'x-html': 'filteredBucketsHtml'
|
|
204
|
-
})
|
|
205
|
-
]
|
|
206
|
-
}),
|
|
207
|
-
// Main Content - File Explorer
|
|
208
|
-
(0, server_html_1.$main)({
|
|
209
|
-
children: [
|
|
210
|
-
// Toolbar with breadcrumbs
|
|
211
|
-
(0, server_html_1.$div)({
|
|
212
|
-
className: 'toolbar',
|
|
213
|
-
'x-show': 'selectedBucket',
|
|
214
|
-
children: [
|
|
215
|
-
(0, server_html_1.$div)({
|
|
216
|
-
style: { flex: '1', display: 'flex', flexDirection: 'column', gap: 'var(--space-2)' },
|
|
217
|
-
children: [
|
|
218
|
-
(0, server_html_1.$div)({
|
|
219
|
-
'x-html': 'breadcrumbsHtml'
|
|
220
|
-
}),
|
|
221
|
-
(0, server_html_1.$input)({
|
|
222
|
-
type: 'text',
|
|
223
|
-
placeholder: 'Filter files and folders...',
|
|
224
|
-
'x-model': 'fileFilter',
|
|
225
|
-
'@input': 'filterFiles()',
|
|
226
|
-
className: 'filter-input',
|
|
227
|
-
style: { width: '100%', maxWidth: '400px', padding: 'var(--space-2)', borderRadius: 'var(--radius-sm)', border: '1px solid var(--color-border)', backgroundColor: 'var(--color-bg-tertiary)', color: 'var(--color-text-primary)', fontSize: 'var(--size-sm)' }
|
|
228
|
-
})
|
|
229
|
-
]
|
|
230
|
-
}),
|
|
231
|
-
(0, server_html_1.$div)({
|
|
232
|
-
className: 'toolbar-actions',
|
|
233
|
-
children: [
|
|
234
|
-
(0, server_html_1.$button)({
|
|
235
|
-
className: 'btn-icon',
|
|
236
|
-
'@click': "viewMode = viewMode === 'list' ? 'grid' : 'list'",
|
|
237
|
-
'x-text': "viewMode === 'list' ? '⊞' : '☰'",
|
|
238
|
-
title: 'Toggle view'
|
|
239
|
-
})
|
|
240
|
-
]
|
|
241
|
-
})
|
|
242
|
-
]
|
|
243
|
-
}),
|
|
244
|
-
// File Explorer
|
|
245
|
-
(0, server_html_1.$div)({
|
|
246
|
-
className: 'file-explorer',
|
|
247
|
-
children: [
|
|
248
|
-
(0, server_html_1.$div)({
|
|
249
|
-
className: 'file-list',
|
|
250
|
-
'x-html': 'filteredFilesHtml'
|
|
251
|
-
})
|
|
252
|
-
]
|
|
253
|
-
})
|
|
254
|
-
]
|
|
255
|
-
})
|
|
256
|
-
]
|
|
257
|
-
}),
|
|
258
|
-
// Upload Modal
|
|
259
|
-
(0, server_html_1.$div)({
|
|
260
|
-
className: 'modal-overlay',
|
|
261
|
-
'x-show': 'showUpload',
|
|
262
|
-
'@click.self': 'showUpload = false',
|
|
263
|
-
style: { display: 'none' },
|
|
264
|
-
children: [
|
|
265
|
-
(0, server_html_1.$div)({
|
|
266
|
-
className: 'modal',
|
|
267
|
-
style: { width: '500px' },
|
|
268
|
-
children: [
|
|
269
|
-
(0, server_html_1.$div)({
|
|
270
|
-
className: 'preview-header',
|
|
271
|
-
children: [
|
|
272
|
-
(0, server_html_1.$h1)({ textContent: 'Upload Files', style: { fontSize: 'var(--size-lg)', margin: 0 } }),
|
|
273
|
-
(0, server_html_1.$button)({
|
|
274
|
-
className: 'btn-close',
|
|
275
|
-
'@click': 'showUpload = false',
|
|
276
|
-
textContent: '✕'
|
|
277
|
-
})
|
|
278
|
-
]
|
|
279
|
-
}),
|
|
280
|
-
(0, server_html_1.$div)({
|
|
281
|
-
className: 'preview-content',
|
|
282
|
-
children: [
|
|
283
|
-
(0, server_html_1.$div)({
|
|
284
|
-
className: 'upload-zone',
|
|
285
|
-
'@click': '$refs.fileInput.click()',
|
|
286
|
-
'@drop.prevent': 'handleDrop($event)',
|
|
287
|
-
'@dragover.prevent': "$el.classList.add('drag-over')",
|
|
288
|
-
'@dragleave.prevent': "$el.classList.remove('drag-over')",
|
|
289
|
-
children: [
|
|
290
|
-
(0, server_html_1.$div)({ className: 'upload-zone-icon', textContent: '📁' }),
|
|
291
|
-
(0, server_html_1.$p)({ textContent: 'Click to select files or drag and drop' }),
|
|
292
|
-
(0, server_html_1.$input)({
|
|
293
|
-
type: 'file',
|
|
294
|
-
multiple: true,
|
|
295
|
-
'x-ref': 'fileInput',
|
|
296
|
-
'@change': 'handleFileSelect($event)'
|
|
297
|
-
})
|
|
298
|
-
]
|
|
299
|
-
}),
|
|
300
|
-
(0, server_html_1.$div)({
|
|
301
|
-
'x-show': 'uploadProgress.length > 0',
|
|
302
|
-
style: { marginTop: 'var(--space-4)' },
|
|
303
|
-
children: [
|
|
304
|
-
(0, server_html_1.$h1)({ textContent: 'Uploading...', style: { fontSize: 'var(--size-sm)', marginBottom: 'var(--space-2)' } }),
|
|
305
|
-
(0, server_html_1.$div)({
|
|
306
|
-
'x-html': 'uploadProgressHtml'
|
|
307
|
-
})
|
|
308
|
-
]
|
|
309
|
-
})
|
|
310
|
-
]
|
|
311
|
-
})
|
|
312
|
-
]
|
|
313
|
-
})
|
|
314
|
-
]
|
|
315
|
-
}),
|
|
316
|
-
// Preview Modal
|
|
317
|
-
(0, server_html_1.$div)({
|
|
318
|
-
className: 'modal-overlay',
|
|
319
|
-
'x-show': 'showPreview',
|
|
320
|
-
'@click.self': 'closePreview()',
|
|
321
|
-
style: { display: 'none' },
|
|
322
|
-
children: [
|
|
323
|
-
(0, server_html_1.$div)({
|
|
324
|
-
className: 'modal',
|
|
325
|
-
style: { maxWidth: '95vw', maxHeight: '95vh', width: '95vw' },
|
|
326
|
-
'x-html': 'previewHtml'
|
|
327
|
-
})
|
|
328
|
-
]
|
|
329
|
-
}),
|
|
330
|
-
// Load client bundle at end of body
|
|
331
|
-
(0, server_html_1.$script)({ src: '/assets/scripts/s3-explorer.bundle.js' })
|
|
332
|
-
]
|
|
333
|
-
})
|
|
334
|
-
]
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
exports.AppController = AppController;
|
|
339
|
-
tslib_1.__decorate([
|
|
340
|
-
(0, common_1.Get)(),
|
|
341
|
-
tslib_1.__metadata("design:type", Function),
|
|
342
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
343
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
344
|
-
], AppController.prototype, "get", null);
|
|
345
|
-
exports.AppController = AppController = tslib_1.__decorate([
|
|
346
|
-
(0, common_1.Controller)(),
|
|
347
|
-
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof app_server_bucketvore_config_class_1.AppServerBucketvoreConfig !== "undefined" && app_server_bucketvore_config_class_1.AppServerBucketvoreConfig) === "function" ? _a : Object])
|
|
348
|
-
], AppController);
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
/***/ }),
|
|
352
|
-
/* 8 */
|
|
353
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
357
|
-
const tslib_1 = __webpack_require__(5);
|
|
358
|
-
tslib_1.__exportStar(__webpack_require__(9), exports);
|
|
359
|
-
tslib_1.__exportStar(__webpack_require__(10), exports);
|
|
360
|
-
tslib_1.__exportStar(__webpack_require__(11), exports);
|
|
361
|
-
tslib_1.__exportStar(__webpack_require__(18), exports);
|
|
362
|
-
tslib_1.__exportStar(__webpack_require__(23), exports);
|
|
363
|
-
tslib_1.__exportStar(__webpack_require__(13), exports);
|
|
364
|
-
tslib_1.__exportStar(__webpack_require__(14), exports);
|
|
365
|
-
tslib_1.__exportStar(__webpack_require__(12), exports);
|
|
366
|
-
tslib_1.__exportStar(__webpack_require__(20), exports);
|
|
367
|
-
tslib_1.__exportStar(__webpack_require__(19), exports);
|
|
368
|
-
tslib_1.__exportStar(__webpack_require__(15), exports);
|
|
369
|
-
tslib_1.__exportStar(__webpack_require__(17), exports);
|
|
370
|
-
tslib_1.__exportStar(__webpack_require__(21), exports);
|
|
371
|
-
tslib_1.__exportStar(__webpack_require__(22), exports);
|
|
372
|
-
tslib_1.__exportStar(__webpack_require__(24), exports);
|
|
373
|
-
tslib_1.__exportStar(__webpack_require__(25), exports);
|
|
374
|
-
tslib_1.__exportStar(__webpack_require__(27), exports);
|
|
375
|
-
tslib_1.__exportStar(__webpack_require__(28), exports);
|
|
376
|
-
tslib_1.__exportStar(__webpack_require__(29), exports);
|
|
377
|
-
tslib_1.__exportStar(__webpack_require__(30), exports);
|
|
378
|
-
tslib_1.__exportStar(__webpack_require__(31), exports);
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
/***/ }),
|
|
382
|
-
/* 9 */
|
|
383
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
387
|
-
exports.a = a;
|
|
388
|
-
function a(text, href, cssClass) {
|
|
389
|
-
const classExp = cssClass ? `class="${cssClass}"` : '';
|
|
390
|
-
return `<a target="_blank" href="${href}" ${classExp}>${text}</a>`;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
/***/ }),
|
|
395
|
-
/* 10 */
|
|
396
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
/***/ }),
|
|
403
|
-
/* 11 */
|
|
404
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
408
|
-
exports.html = html;
|
|
409
|
-
const tags_1 = __webpack_require__(12);
|
|
410
|
-
function html(title, subtitle, markup, logoUrl) {
|
|
411
|
-
return (0, tags_1._htm)([
|
|
412
|
-
(0, tags_1._head)([
|
|
413
|
-
(0, tags_1._style)([
|
|
414
|
-
'body {',
|
|
415
|
-
'padding: 64px;',
|
|
416
|
-
`font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";`,
|
|
417
|
-
`font-size: 1rem;`,
|
|
418
|
-
`-webkit-font-smoothing: antialiased;`,
|
|
419
|
-
`-moz-osx-font-smoothing: grayscale;`,
|
|
420
|
-
'color: rgb(34, 30, 31);',
|
|
421
|
-
'}',
|
|
422
|
-
'h1, h2, h3, h4, pre { color: rgb(34, 30, 31) !important; }',
|
|
423
|
-
'td, th { text-align: left; padding: 8px;}',
|
|
424
|
-
'table { border-collapse: collapse; width: 100%;}',
|
|
425
|
-
'tbody { border-width: 1px; border-style: solid; border-left-style: none; border-right-style: none; }',
|
|
426
|
-
'.focal, a { padding: 12px 24px; font-weight: bold; display: block; text-align: center; border-radius: 4px; }',
|
|
427
|
-
'.mw-880 { max-width: 880px !important; margin: auto; }',
|
|
428
|
-
'.mw-440 { max-width: 440px !important; margin: auto; }',
|
|
429
|
-
'pre { padding: 12px 24px; font-weight: bold; display: block; text-align: center; border-radius: 4px; border: solid 1px; }',
|
|
430
|
-
'a { max-width: 240px; }',
|
|
431
|
-
'.bg-gray { background-color: #efefef; }',
|
|
432
|
-
'.drop-shadow, .button { filter: drop-shadow(2px 2px 1px rgba(0, 0, 0, 0.3)); }',
|
|
433
|
-
'.button { text-decoration: none; margin: 32px 0; background-color: rgb(205, 62, 71); color: white !important; }',
|
|
434
|
-
]),
|
|
435
|
-
]),
|
|
436
|
-
(0, tags_1._body)([
|
|
437
|
-
(0, tags_1._header)([
|
|
438
|
-
logoUrl
|
|
439
|
-
? `<img height="64" width="auto" src="${logoUrl}" />`
|
|
440
|
-
: undefined,
|
|
441
|
-
(0, tags_1._h1)([title]),
|
|
442
|
-
(0, tags_1._h2)([subtitle]),
|
|
443
|
-
].filter(Boolean)),
|
|
444
|
-
(0, tags_1._main)(markup),
|
|
445
|
-
]),
|
|
446
|
-
]);
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
/***/ }),
|
|
451
|
-
/* 12 */
|
|
452
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
456
|
-
exports._style = exports._tr = exports._thead = exports._th = exports._td = exports._tbody = exports._tab = exports._pre = exports._p = exports._main = exports._img = exports._htm = exports._header = exports._head = exports._h6 = exports._h5 = exports._h4 = exports._h3 = exports._h2 = exports._h1 = exports._div = exports._body = void 0;
|
|
457
|
-
const self_closing_tag_function_1 = __webpack_require__(13);
|
|
458
|
-
const tag_function_1 = __webpack_require__(14);
|
|
459
|
-
exports._body = tag_function_1.tag.bind(null, 'body');
|
|
460
|
-
exports._div = tag_function_1.tag.bind(null, 'div');
|
|
461
|
-
exports._h1 = tag_function_1.tag.bind(null, 'h1');
|
|
462
|
-
exports._h2 = tag_function_1.tag.bind(null, 'h2');
|
|
463
|
-
exports._h3 = tag_function_1.tag.bind(null, 'h3');
|
|
464
|
-
exports._h4 = tag_function_1.tag.bind(null, 'h4');
|
|
465
|
-
exports._h5 = tag_function_1.tag.bind(null, 'h5');
|
|
466
|
-
exports._h6 = tag_function_1.tag.bind(null, 'h6');
|
|
467
|
-
exports._head = tag_function_1.tag.bind(null, 'head');
|
|
468
|
-
exports._header = tag_function_1.tag.bind(null, 'header');
|
|
469
|
-
exports._htm = tag_function_1.tag.bind(null, 'html');
|
|
470
|
-
exports._img = self_closing_tag_function_1.selfClosingTag.bind(null, 'img');
|
|
471
|
-
exports._main = tag_function_1.tag.bind(null, 'main');
|
|
472
|
-
exports._p = tag_function_1.tag.bind(null, 'p');
|
|
473
|
-
exports._pre = tag_function_1.tag.bind(null, 'pre');
|
|
474
|
-
exports._tab = tag_function_1.tag.bind(null, 'table');
|
|
475
|
-
exports._tbody = tag_function_1.tag.bind(null, 'tbody');
|
|
476
|
-
exports._td = tag_function_1.tag.bind(null, 'td');
|
|
477
|
-
exports._th = tag_function_1.tag.bind(null, 'th');
|
|
478
|
-
exports._thead = tag_function_1.tag.bind(null, 'thead');
|
|
479
|
-
exports._tr = tag_function_1.tag.bind(null, 'tr');
|
|
480
|
-
exports._style = tag_function_1.tag.bind(null, 'style');
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
/***/ }),
|
|
484
|
-
/* 13 */
|
|
485
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
489
|
-
exports.selfClosingTag = selfClosingTag;
|
|
490
|
-
const tag_function_1 = __webpack_require__(14);
|
|
491
|
-
function selfClosingTag(tag, cssClass, attributes, styles) {
|
|
492
|
-
return (0, tag_function_1.tag)(tag, [], cssClass, attributes, styles).replace(`></${tag}>`, '/>');
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
/***/ }),
|
|
497
|
-
/* 14 */
|
|
498
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
502
|
-
exports.tag = tag;
|
|
503
|
-
const format_attributes_function_1 = __webpack_require__(15);
|
|
504
|
-
const inline_style_function_1 = __webpack_require__(17);
|
|
505
|
-
function tag(tag, content, cssClass, attributes, styles) {
|
|
506
|
-
const classExp = cssClass ? ` class="${cssClass}"` : '';
|
|
507
|
-
const attributesExp = attributes ? ` ${(0, format_attributes_function_1.formatAttributes)(attributes)}` : '';
|
|
508
|
-
const styleExp = styles ? ` ${(0, inline_style_function_1.inlineStyle)(styles)}` : '';
|
|
509
|
-
return `<${tag}${classExp}${attributesExp}${styleExp}>${content.join?.('')}</${tag}>`;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
/***/ }),
|
|
514
|
-
/* 15 */
|
|
515
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
519
|
-
exports.formatAttributes = formatAttributes;
|
|
520
|
-
const escape_html_attr_function_1 = __webpack_require__(16);
|
|
521
|
-
function formatAttributes(attributes) {
|
|
522
|
-
if (!attributes) {
|
|
523
|
-
return '';
|
|
524
|
-
}
|
|
525
|
-
return Object.entries(attributes)
|
|
526
|
-
.map(([k, v]) => `${k}="${(0, escape_html_attr_function_1.escapeHtmlAttr)(v)}"`)
|
|
527
|
-
.join(' ');
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
/***/ }),
|
|
532
|
-
/* 16 */
|
|
533
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
537
|
-
exports.escapeHtmlAttr = escapeHtmlAttr;
|
|
538
|
-
function escapeHtmlAttr(str) {
|
|
539
|
-
return String(str)
|
|
540
|
-
.replace(/&/g, '&')
|
|
541
|
-
.replace(/"/g, '"')
|
|
542
|
-
.replace(/'/g, ''')
|
|
543
|
-
.replace(/</g, '<')
|
|
544
|
-
.replace(/>/g, '>');
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
/***/ }),
|
|
549
|
-
/* 17 */
|
|
550
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
554
|
-
exports.inlineStyle = inlineStyle;
|
|
555
|
-
function inlineStyle(styles) {
|
|
556
|
-
const rules = Object.entries(styles)
|
|
557
|
-
.filter(([, v]) => (v != null) && (v != undefined))
|
|
558
|
-
.map(([k, v]) => {
|
|
559
|
-
// convert camelCase property names to kebab-case
|
|
560
|
-
const prop = k.replace(/([A-Z])/g, '-$1').toLowerCase();
|
|
561
|
-
return `${prop}: ${v};`;
|
|
562
|
-
})
|
|
563
|
-
.join(' ');
|
|
564
|
-
return `style="${rules}"`;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
/***/ }),
|
|
569
|
-
/* 18 */
|
|
570
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
574
|
-
exports.loginButton = loginButton;
|
|
575
|
-
const elements_1 = __webpack_require__(19);
|
|
576
|
-
const button_styles_constant_1 = __webpack_require__(22);
|
|
577
|
-
function loginButton(text, href, extraStyles) {
|
|
578
|
-
return (0, elements_1.anchor)([text], {
|
|
579
|
-
href,
|
|
580
|
-
style: {
|
|
581
|
-
...button_styles_constant_1.buttonStyles,
|
|
582
|
-
...(extraStyles || {})
|
|
583
|
-
}
|
|
584
|
-
});
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
/***/ }),
|
|
589
|
-
/* 19 */
|
|
590
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
594
|
-
exports.style = exports.tr = exports.thead = exports.th = exports.td = exports.tbody = exports.tab = exports.pre = exports.p = exports.main = exports.img = exports.htm = exports.header = exports.head = exports.h6 = exports.h5 = exports.h4 = exports.h3 = exports.h2 = exports.h1 = exports.div = exports.button = exports.body = exports.anchor = void 0;
|
|
595
|
-
const element_function_1 = __webpack_require__(20);
|
|
596
|
-
const self_closing_element_function_1 = __webpack_require__(21);
|
|
597
|
-
const button_styles_constant_1 = __webpack_require__(22);
|
|
598
|
-
const anchor = (content, attributes) => (0, element_function_1.element)('a', content, { ...attributes, style: { ...button_styles_constant_1.buttonStyles, ...attributes?.style } });
|
|
599
|
-
exports.anchor = anchor;
|
|
600
|
-
exports.body = element_function_1.element.bind(null, 'body');
|
|
601
|
-
const button = (content, attributes) => (0, element_function_1.element)('button', content, { ...attributes, style: { ...button_styles_constant_1.buttonStyles, ...attributes?.style } });
|
|
602
|
-
exports.button = button;
|
|
603
|
-
exports.div = element_function_1.element.bind(null, 'div');
|
|
604
|
-
exports.h1 = element_function_1.element.bind(null, 'h1');
|
|
605
|
-
exports.h2 = element_function_1.element.bind(null, 'h2');
|
|
606
|
-
exports.h3 = element_function_1.element.bind(null, 'h3');
|
|
607
|
-
exports.h4 = element_function_1.element.bind(null, 'h4');
|
|
608
|
-
exports.h5 = element_function_1.element.bind(null, 'h5');
|
|
609
|
-
exports.h6 = element_function_1.element.bind(null, 'h6');
|
|
610
|
-
exports.head = element_function_1.element.bind(null, 'head');
|
|
611
|
-
exports.header = element_function_1.element.bind(null, 'header');
|
|
612
|
-
exports.htm = element_function_1.element.bind(null, 'html');
|
|
613
|
-
exports.img = self_closing_element_function_1.selfClosingElement.bind(null, 'img');
|
|
614
|
-
exports.main = element_function_1.element.bind(null, 'main');
|
|
615
|
-
exports.p = element_function_1.element.bind(null, 'p');
|
|
616
|
-
exports.pre = element_function_1.element.bind(null, 'pre');
|
|
617
|
-
exports.tab = element_function_1.element.bind(null, 'table');
|
|
618
|
-
exports.tbody = element_function_1.element.bind(null, 'tbody');
|
|
619
|
-
exports.td = element_function_1.element.bind(null, 'td');
|
|
620
|
-
exports.th = element_function_1.element.bind(null, 'th');
|
|
621
|
-
exports.thead = element_function_1.element.bind(null, 'thead');
|
|
622
|
-
exports.tr = element_function_1.element.bind(null, 'tr');
|
|
623
|
-
// todo: make this take a Record<string, Record<string, string>> instead of the terrible raw string formatting used now
|
|
624
|
-
// todo: apply kebab-casing to camelCased keys so that consumers can write { fontWeight: 600 } instead of {'font-weight': 600 } (do this for all style properties of primitives' attributes)
|
|
625
|
-
exports.style = element_function_1.element.bind(null, 'style');
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
/***/ }),
|
|
629
|
-
/* 20 */
|
|
630
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
634
|
-
exports.element = element;
|
|
635
|
-
const format_attributes_function_1 = __webpack_require__(15);
|
|
636
|
-
const inline_style_function_1 = __webpack_require__(17);
|
|
637
|
-
function element(tag, content, attributes) {
|
|
638
|
-
const { cssClass = '', style = undefined, ...attrs } = attributes || {};
|
|
639
|
-
const classExp = cssClass ? ` class="${cssClass}"` : '';
|
|
640
|
-
const attributesExp = attrs ? ` ${(0, format_attributes_function_1.formatAttributes)(attrs)}` : '';
|
|
641
|
-
const styleExp = style ? ` ${(0, inline_style_function_1.inlineStyle)(style)}` : '';
|
|
642
|
-
return `<${tag}${classExp}${attributesExp}${styleExp}>${content.join?.('')}</${tag}>`;
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
/***/ }),
|
|
647
|
-
/* 21 */
|
|
648
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
652
|
-
exports.selfClosingElement = selfClosingElement;
|
|
653
|
-
const element_function_1 = __webpack_require__(20);
|
|
654
|
-
function selfClosingElement(tag, attributes) {
|
|
655
|
-
return (0, element_function_1.element)(tag, [], attributes).replace(`></${tag}>`, '/>');
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
/***/ }),
|
|
660
|
-
/* 22 */
|
|
661
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
665
|
-
exports.buttonStyles = void 0;
|
|
666
|
-
exports.buttonStyles = {
|
|
667
|
-
padding: '1rem 1.5rem',
|
|
668
|
-
border: 'solid 1px',
|
|
669
|
-
'border-radius': '4px',
|
|
670
|
-
display: 'inline-block',
|
|
671
|
-
'font-weight': '600',
|
|
672
|
-
'text-align': 'center',
|
|
673
|
-
'text-decoration': 'none',
|
|
674
|
-
'box-sizing': 'border-box',
|
|
675
|
-
color: 'inherit'
|
|
676
|
-
};
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
/***/ }),
|
|
680
|
-
/* 23 */
|
|
681
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
/***/ }),
|
|
688
|
-
/* 24 */
|
|
689
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
693
|
-
exports.fontStyles = void 0;
|
|
694
|
-
exports.fontStyles = {
|
|
695
|
-
'font-family': `-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol' !important`,
|
|
696
|
-
'font-size': `1rem;`,
|
|
697
|
-
'-webkit-font-smoothing': `antialiased`,
|
|
698
|
-
'-moz-osx-font-smoothing': `grayscale`,
|
|
699
|
-
color: 'rgba(0, 0, 0, 0.5) !important',
|
|
700
|
-
};
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
/***/ }),
|
|
704
|
-
/* 25 */
|
|
705
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
709
|
-
exports.CSSProperties = void 0;
|
|
710
|
-
const css_properties_type_1 = __webpack_require__(26);
|
|
711
|
-
Object.defineProperty(exports, "CSSProperties", ({ enumerable: true, get: function () { return css_properties_type_1.CSSProperties; } }));
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
/***/ }),
|
|
715
|
-
/* 26 */
|
|
716
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
/***/ }),
|
|
723
|
-
/* 27 */
|
|
724
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
/***/ }),
|
|
731
|
-
/* 28 */
|
|
732
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
/***/ }),
|
|
739
|
-
/* 29 */
|
|
740
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
744
|
-
exports.emailBody = emailBody;
|
|
745
|
-
const elements_1 = __webpack_require__(19);
|
|
746
|
-
const font_styles_constant_1 = __webpack_require__(24);
|
|
747
|
-
function emailBody(title, subtitle, markup, logoUrl, extraStyles = {}) {
|
|
748
|
-
return (0, elements_1.div)([
|
|
749
|
-
(0, elements_1.div)([
|
|
750
|
-
(0, elements_1.div)([
|
|
751
|
-
logoUrl
|
|
752
|
-
? `<img height="64" width="auto" src="${logoUrl}" />`
|
|
753
|
-
: undefined,
|
|
754
|
-
title ? (0, elements_1.h1)([title]) : undefined,
|
|
755
|
-
subtitle ? (0, elements_1.h2)([subtitle]) : undefined,
|
|
756
|
-
].filter(Boolean)),
|
|
757
|
-
(0, elements_1.div)(markup),
|
|
758
|
-
], {
|
|
759
|
-
style: {
|
|
760
|
-
...font_styles_constant_1.fontStyles,
|
|
761
|
-
...(extraStyles || {})
|
|
762
|
-
}
|
|
763
|
-
}),
|
|
764
|
-
]);
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
/***/ }),
|
|
769
|
-
/* 30 */
|
|
770
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
774
|
-
exports.table = table;
|
|
775
|
-
const elements_1 = __webpack_require__(19);
|
|
776
|
-
const padding = '0.5rem';
|
|
777
|
-
const color = 'inherit';
|
|
778
|
-
function table(columns, rows) {
|
|
779
|
-
return (0, elements_1.tab)([
|
|
780
|
-
(0, elements_1.thead)([(0, elements_1.tr)(columns.map((c) => (0, elements_1.th)([c], { style: { 'text-align': 'left', padding, color } })), { style: { 'border-bottom-color': color, 'border-bottom-style': 'solid', 'border-top-style': 'none', 'border-left-style': 'none', 'border-right-style': 'none' } })]),
|
|
781
|
-
(0, elements_1.tbody)(rows.map((row, i) => (0, elements_1.tr)(row.map((cell) => (0, elements_1.td)([cell], { style: { padding, color } })), { style: { 'background-color': i % 2 ? '' : 'rgba(0, 0, 0, 0.2)', padding, color } }))),
|
|
782
|
-
], { style: { 'border-collapse': 'collapse', width: '100%', color } });
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
/***/ }),
|
|
787
|
-
/* 31 */
|
|
788
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
792
|
-
exports.$footer = exports.$figure = exports.$figcaption = exports.$fieldset = exports.$embed = exports.$em = exports.$dt = exports.$dl = exports.$div = exports.$dialog = exports.$dfn = exports.$details = exports.$del = exports.$dd = exports.$datalist = exports.$data = exports.$colgroup = exports.$col = exports.$code = exports.$cite = exports.$caption = exports.$canvas = exports.$button = exports.$br = exports.$body = exports.$blockquote = exports.$bdo = exports.$bdi = exports.$base = exports.$b = exports.$audio = exports.$aside = exports.$article = exports.$area = exports.$address = exports.$abbr = exports.$a = exports.styled = exports.styleOnPointerEnter = exports.styleOnFocus = exports.styleOn = exports.setElementStyles = exports.setElementStyle = exports.setAttrs = exports.extractStyle = exports.asElementFactory = exports.asId = exports.styleManager = exports.TElementProps = exports.CSSProperties = void 0;
|
|
793
|
-
exports.$slot = exports.$select = exports.$section = exports.$script = exports.$samp = exports.$s = exports.$ruby = exports.$rt = exports.$rp = exports.$q = exports.$progress = exports.$pre = exports.$picture = exports.$p = exports.$output = exports.$option = exports.$optgroup = exports.$ol = exports.$object = exports.$noscript = exports.$nav = exports.$meter = exports.$meta = exports.$menu = exports.$math = exports.$mark = exports.$map = exports.$main = exports.$link = exports.$li = exports.$legend = exports.$label = exports.$kbd = exports.$ins = exports.$input = exports.$img = exports.$iframe = exports.$i = exports.$html = exports.$hr = exports.$hgroup = exports.$header = exports.$head = exports.$h6 = exports.$h5 = exports.$h4 = exports.$h3 = exports.$h2 = exports.$h1 = exports.$form = void 0;
|
|
794
|
-
exports.$wbr = exports.$video = exports.$var = exports.$ul = exports.$u = exports.$track = exports.$tr = exports.$title = exports.$time = exports.$thead = exports.$th = exports.$tfoot = exports.$textarea = exports.$template = exports.$td = exports.$tbody = exports.$table = exports.$sup = exports.$summary = exports.$sub = exports.$style = exports.$strong = exports.$span = exports.$source = exports.$small = void 0;
|
|
795
|
-
const element_function_1 = __webpack_require__(20);
|
|
796
|
-
const self_closing_element_function_1 = __webpack_require__(21);
|
|
797
|
-
const css_properties_type_1 = __webpack_require__(26);
|
|
798
|
-
Object.defineProperty(exports, "CSSProperties", ({ enumerable: true, get: function () { return css_properties_type_1.CSSProperties; } }));
|
|
799
|
-
const element_props_type_1 = __webpack_require__(32);
|
|
800
|
-
Object.defineProperty(exports, "TElementProps", ({ enumerable: true, get: function () { return element_props_type_1.TElementProps; } }));
|
|
801
|
-
const style_manager_constant_1 = __webpack_require__(33);
|
|
802
|
-
Object.defineProperty(exports, "styleManager", ({ enumerable: true, get: function () { return style_manager_constant_1.styleManager; } }));
|
|
803
|
-
const as_id_function_1 = __webpack_require__(34);
|
|
804
|
-
Object.defineProperty(exports, "asId", ({ enumerable: true, get: function () { return as_id_function_1.asId; } }));
|
|
805
|
-
const as_element_factory_function_1 = __webpack_require__(35);
|
|
806
|
-
Object.defineProperty(exports, "asElementFactory", ({ enumerable: true, get: function () { return as_element_factory_function_1.asElementFactory; } }));
|
|
807
|
-
const extract_style_function_1 = __webpack_require__(36);
|
|
808
|
-
Object.defineProperty(exports, "extractStyle", ({ enumerable: true, get: function () { return extract_style_function_1.extractStyle; } }));
|
|
809
|
-
const set_element_attributes_function_1 = __webpack_require__(37);
|
|
810
|
-
Object.defineProperty(exports, "setAttrs", ({ enumerable: true, get: function () { return set_element_attributes_function_1.setAttrs; } }));
|
|
811
|
-
const set_element_style_function_1 = __webpack_require__(38);
|
|
812
|
-
Object.defineProperty(exports, "setElementStyle", ({ enumerable: true, get: function () { return set_element_style_function_1.setElementStyle; } }));
|
|
813
|
-
const set_element_styles_function_1 = __webpack_require__(39);
|
|
814
|
-
Object.defineProperty(exports, "setElementStyles", ({ enumerable: true, get: function () { return set_element_styles_function_1.setElementStyles; } }));
|
|
815
|
-
const style_on_function_1 = __webpack_require__(40);
|
|
816
|
-
Object.defineProperty(exports, "styleOn", ({ enumerable: true, get: function () { return style_on_function_1.styleOn; } }));
|
|
817
|
-
const style_on_focus_function_1 = __webpack_require__(41);
|
|
818
|
-
Object.defineProperty(exports, "styleOnFocus", ({ enumerable: true, get: function () { return style_on_focus_function_1.styleOnFocus; } }));
|
|
819
|
-
const style_on_pointer_enter_function_1 = __webpack_require__(42);
|
|
820
|
-
Object.defineProperty(exports, "styleOnPointerEnter", ({ enumerable: true, get: function () { return style_on_pointer_enter_function_1.styleOnPointerEnter; } }));
|
|
821
|
-
const styled_function_1 = __webpack_require__(43);
|
|
822
|
-
Object.defineProperty(exports, "styled", ({ enumerable: true, get: function () { return styled_function_1.styled; } }));
|
|
823
|
-
// Element factories
|
|
824
|
-
exports.$a = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'a'));
|
|
825
|
-
exports.$abbr = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'abbr'));
|
|
826
|
-
exports.$address = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'address'));
|
|
827
|
-
exports.$area = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('area', attrs));
|
|
828
|
-
exports.$article = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'article'));
|
|
829
|
-
exports.$aside = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'aside'));
|
|
830
|
-
exports.$audio = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'audio'));
|
|
831
|
-
exports.$b = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'b'));
|
|
832
|
-
exports.$base = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('base', attrs));
|
|
833
|
-
exports.$bdi = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'bdi'));
|
|
834
|
-
exports.$bdo = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'bdo'));
|
|
835
|
-
exports.$blockquote = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'blockquote'));
|
|
836
|
-
exports.$body = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'body'));
|
|
837
|
-
exports.$br = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('br', attrs));
|
|
838
|
-
exports.$button = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'button'));
|
|
839
|
-
exports.$canvas = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'canvas'));
|
|
840
|
-
exports.$caption = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'caption'));
|
|
841
|
-
exports.$cite = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'cite'));
|
|
842
|
-
exports.$code = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'code'));
|
|
843
|
-
exports.$col = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('col', attrs));
|
|
844
|
-
exports.$colgroup = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'colgroup'));
|
|
845
|
-
exports.$data = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'data'));
|
|
846
|
-
exports.$datalist = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'datalist'));
|
|
847
|
-
exports.$dd = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'dd'));
|
|
848
|
-
exports.$del = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'del'));
|
|
849
|
-
exports.$details = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'details'));
|
|
850
|
-
exports.$dfn = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'dfn'));
|
|
851
|
-
exports.$dialog = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'dialog'));
|
|
852
|
-
exports.$div = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'div'));
|
|
853
|
-
exports.$dl = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'dl'));
|
|
854
|
-
exports.$dt = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'dt'));
|
|
855
|
-
exports.$em = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'em'));
|
|
856
|
-
exports.$embed = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('embed', attrs));
|
|
857
|
-
exports.$fieldset = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'fieldset'));
|
|
858
|
-
exports.$figcaption = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'figcaption'));
|
|
859
|
-
exports.$figure = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'figure'));
|
|
860
|
-
exports.$footer = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'footer'));
|
|
861
|
-
exports.$form = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'form'));
|
|
862
|
-
exports.$h1 = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'h1'));
|
|
863
|
-
exports.$h2 = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'h2'));
|
|
864
|
-
exports.$h3 = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'h3'));
|
|
865
|
-
exports.$h4 = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'h4'));
|
|
866
|
-
exports.$h5 = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'h5'));
|
|
867
|
-
exports.$h6 = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'h6'));
|
|
868
|
-
exports.$head = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'head'));
|
|
869
|
-
exports.$header = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'header'));
|
|
870
|
-
exports.$hgroup = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'hgroup'));
|
|
871
|
-
exports.$hr = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('hr', attrs));
|
|
872
|
-
exports.$html = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'html'));
|
|
873
|
-
exports.$i = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'i'));
|
|
874
|
-
exports.$iframe = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'iframe'));
|
|
875
|
-
exports.$img = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('img', attrs));
|
|
876
|
-
exports.$input = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('input', attrs));
|
|
877
|
-
exports.$ins = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'ins'));
|
|
878
|
-
exports.$kbd = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'kbd'));
|
|
879
|
-
exports.$label = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'label'));
|
|
880
|
-
exports.$legend = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'legend'));
|
|
881
|
-
exports.$li = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'li'));
|
|
882
|
-
exports.$link = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('link', attrs));
|
|
883
|
-
exports.$main = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'main'));
|
|
884
|
-
exports.$map = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'map'));
|
|
885
|
-
exports.$mark = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'mark'));
|
|
886
|
-
exports.$math = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'math'));
|
|
887
|
-
exports.$menu = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'menu'));
|
|
888
|
-
exports.$meta = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('meta', attrs));
|
|
889
|
-
exports.$meter = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'meter'));
|
|
890
|
-
exports.$nav = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'nav'));
|
|
891
|
-
exports.$noscript = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'noscript'));
|
|
892
|
-
exports.$object = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'object'));
|
|
893
|
-
exports.$ol = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'ol'));
|
|
894
|
-
exports.$optgroup = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'optgroup'));
|
|
895
|
-
exports.$option = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'option'));
|
|
896
|
-
exports.$output = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'output'));
|
|
897
|
-
exports.$p = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'p'));
|
|
898
|
-
exports.$picture = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'picture'));
|
|
899
|
-
exports.$pre = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'pre'));
|
|
900
|
-
exports.$progress = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'progress'));
|
|
901
|
-
exports.$q = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'q'));
|
|
902
|
-
exports.$rp = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'rp'));
|
|
903
|
-
exports.$rt = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'rt'));
|
|
904
|
-
exports.$ruby = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'ruby'));
|
|
905
|
-
exports.$s = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 's'));
|
|
906
|
-
exports.$samp = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'samp'));
|
|
907
|
-
exports.$script = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'script'));
|
|
908
|
-
exports.$section = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'section'));
|
|
909
|
-
exports.$select = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'select'));
|
|
910
|
-
exports.$slot = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'slot'));
|
|
911
|
-
exports.$small = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'small'));
|
|
912
|
-
exports.$source = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('source', attrs));
|
|
913
|
-
exports.$span = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'span'));
|
|
914
|
-
exports.$strong = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'strong'));
|
|
915
|
-
exports.$style = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'style'));
|
|
916
|
-
exports.$sub = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'sub'));
|
|
917
|
-
exports.$summary = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'summary'));
|
|
918
|
-
exports.$sup = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'sup'));
|
|
919
|
-
exports.$table = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'table'));
|
|
920
|
-
exports.$tbody = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'tbody'));
|
|
921
|
-
exports.$td = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'td'));
|
|
922
|
-
exports.$template = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'template'));
|
|
923
|
-
exports.$textarea = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'textarea'));
|
|
924
|
-
exports.$tfoot = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'tfoot'));
|
|
925
|
-
exports.$th = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'th'));
|
|
926
|
-
exports.$thead = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'thead'));
|
|
927
|
-
exports.$time = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'time'));
|
|
928
|
-
exports.$title = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'title'));
|
|
929
|
-
exports.$tr = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'tr'));
|
|
930
|
-
exports.$track = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('track', attrs));
|
|
931
|
-
exports.$u = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'u'));
|
|
932
|
-
exports.$ul = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'ul'));
|
|
933
|
-
exports.$var = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'var'));
|
|
934
|
-
exports.$video = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'video'));
|
|
935
|
-
exports.$wbr = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('wbr', attrs));
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
/***/ }),
|
|
939
|
-
/* 32 */
|
|
940
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
/***/ }),
|
|
947
|
-
/* 33 */
|
|
948
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
952
|
-
exports.styleManager = exports.StyleManager = void 0;
|
|
953
|
-
class StyleManager {
|
|
954
|
-
static applyStyle(css) {
|
|
955
|
-
if (!css)
|
|
956
|
-
return null;
|
|
957
|
-
const normalized = css.replace(/\s+/g, ' ').trim();
|
|
958
|
-
if (StyleManager.styleCache.has(normalized)) {
|
|
959
|
-
return StyleManager.styleCache.get(normalized);
|
|
960
|
-
}
|
|
961
|
-
const className = 'sc-' +
|
|
962
|
-
Buffer.from(normalized).toString('base64').slice(0, 8).replace(/[^a-zA-Z0-9]/g, '') +
|
|
963
|
-
'-' +
|
|
964
|
-
Math.random().toString(36).slice(2, 6);
|
|
965
|
-
StyleManager.styleCache.set(normalized, className);
|
|
966
|
-
StyleManager.styles.push(`.${className} { ${normalized} }`);
|
|
967
|
-
return className;
|
|
968
|
-
}
|
|
969
|
-
static getStyles() {
|
|
970
|
-
return StyleManager.styles.join('\n');
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
exports.StyleManager = StyleManager;
|
|
974
|
-
StyleManager.styleCache = new Map();
|
|
975
|
-
StyleManager.styles = [];
|
|
976
|
-
exports.styleManager = StyleManager;
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
/***/ }),
|
|
980
|
-
/* 34 */
|
|
981
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
985
|
-
exports.asId = asId;
|
|
986
|
-
let idCounter = 0;
|
|
987
|
-
function asId(prefix = 'id') {
|
|
988
|
-
idCounter += 1;
|
|
989
|
-
return `${prefix}_${idCounter}`;
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
/***/ }),
|
|
994
|
-
/* 35 */
|
|
995
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
999
|
-
exports.asElementFactory = asElementFactory;
|
|
1000
|
-
function asElementFactory(renderer) {
|
|
1001
|
-
return (props = {}) => {
|
|
1002
|
-
const { style, className, children, textContent, innerHTML, $$, ...attrs } = props;
|
|
1003
|
-
const attributes = {
|
|
1004
|
-
cssClass: className,
|
|
1005
|
-
style,
|
|
1006
|
-
...attrs,
|
|
1007
|
-
};
|
|
1008
|
-
let content = [];
|
|
1009
|
-
if (children && children.length)
|
|
1010
|
-
content = children;
|
|
1011
|
-
if ($$ && $$.length)
|
|
1012
|
-
content = $$;
|
|
1013
|
-
if (textContent != null)
|
|
1014
|
-
content = [textContent];
|
|
1015
|
-
if (innerHTML != null)
|
|
1016
|
-
content = [innerHTML];
|
|
1017
|
-
return renderer(content, attributes);
|
|
1018
|
-
};
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
/***/ }),
|
|
1023
|
-
/* 36 */
|
|
1024
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1028
|
-
exports.extractStyle = extractStyle;
|
|
1029
|
-
function extractStyle(element, style) {
|
|
1030
|
-
return undefined;
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
/***/ }),
|
|
1035
|
-
/* 37 */
|
|
1036
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1040
|
-
exports.setAttrs = setAttrs;
|
|
1041
|
-
function setAttrs(target, attrs) {
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
/***/ }),
|
|
1046
|
-
/* 38 */
|
|
1047
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1051
|
-
exports.setElementStyle = setElementStyle;
|
|
1052
|
-
function setElementStyle(target, key, value) {
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
/***/ }),
|
|
1057
|
-
/* 39 */
|
|
1058
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1062
|
-
exports.setElementStyles = setElementStyles;
|
|
1063
|
-
function setElementStyles(target, styles) {
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
/***/ }),
|
|
1068
|
-
/* 40 */
|
|
1069
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1073
|
-
exports.styleOn = styleOn;
|
|
1074
|
-
function styleOn(element, event, style, elementToStyle, onlyIf) {
|
|
1075
|
-
// no-op
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
/***/ }),
|
|
1080
|
-
/* 41 */
|
|
1081
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1085
|
-
exports.styleOnFocus = styleOnFocus;
|
|
1086
|
-
const style_on_function_1 = __webpack_require__(40);
|
|
1087
|
-
function styleOnFocus(element, style, elementToStyle, onlyIf) {
|
|
1088
|
-
(0, style_on_function_1.styleOn)(element, 'focus', style, elementToStyle, onlyIf);
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
/***/ }),
|
|
1093
|
-
/* 42 */
|
|
1094
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1098
|
-
exports.styleOnPointerEnter = styleOnPointerEnter;
|
|
1099
|
-
const style_on_function_1 = __webpack_require__(40);
|
|
1100
|
-
function styleOnPointerEnter(element, style, elementToStyle, onlyIf) {
|
|
1101
|
-
(0, style_on_function_1.styleOn)(element, 'mouseenter', style, elementToStyle, onlyIf);
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
/***/ }),
|
|
1106
|
-
/* 43 */
|
|
1107
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1111
|
-
exports.styled = styled;
|
|
1112
|
-
const style_manager_constant_1 = __webpack_require__(33);
|
|
1113
|
-
function styled(creator) {
|
|
1114
|
-
return (css, ...values) => (props = {}) => {
|
|
1115
|
-
const raw = css.reduce((acc, part, i) => acc + part + (values[i] || ''), '').trim();
|
|
1116
|
-
const className = style_manager_constant_1.styleManager.applyStyle(raw) || '';
|
|
1117
|
-
const propsWithClass = {
|
|
1118
|
-
...props,
|
|
1119
|
-
className: [className, props.className].filter(Boolean).join(' '),
|
|
1120
|
-
};
|
|
1121
|
-
return creator(propsWithClass);
|
|
1122
|
-
};
|
|
1123
|
-
}
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
/***/ }),
|
|
1127
|
-
/* 44 */
|
|
1128
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1132
|
-
exports.AppServerBucketvoreConfig = void 0;
|
|
1133
|
-
class AppServerBucketvoreConfig {
|
|
1134
|
-
constructor() {
|
|
1135
|
-
this.AWS_PROFILE = process.env['AWS_PROFILE'] || 'default';
|
|
1136
|
-
this.HTTP_PORT = process.env['HTTP_PORT'] || '3007';
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
exports.AppServerBucketvoreConfig = AppServerBucketvoreConfig;
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
/***/ }),
|
|
1143
|
-
/* 45 */
|
|
1144
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
/**
|
|
1148
|
-
* Design System for BucketVore UI
|
|
1149
|
-
* Modern dark theme file explorer
|
|
1150
|
-
*/
|
|
1151
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1152
|
-
exports.DESIGN_SYSTEM_STYLES = void 0;
|
|
1153
|
-
exports.DESIGN_SYSTEM_STYLES = `
|
|
1154
|
-
/* ====================================================================
|
|
1155
|
-
Design System Variables
|
|
1156
|
-
==================================================================== */
|
|
1157
|
-
|
|
1158
|
-
:root {
|
|
1159
|
-
/* Colors - Dark Theme */
|
|
1160
|
-
--color-bg-primary: #1a1a1a;
|
|
1161
|
-
--color-bg-secondary: #242424;
|
|
1162
|
-
--color-bg-tertiary: #2d2d2d;
|
|
1163
|
-
--color-border: #3a3a3a;
|
|
1164
|
-
--color-border-light: #4a4a4a;
|
|
1165
|
-
--color-text-primary: #e8e8e8;
|
|
1166
|
-
--color-text-secondary: #a0a0a0;
|
|
1167
|
-
--color-text-tertiary: #707070;
|
|
1168
|
-
|
|
1169
|
-
/* Accents */
|
|
1170
|
-
--color-accent-primary: #0ea5e9;
|
|
1171
|
-
--color-accent-secondary: #8b5cf6;
|
|
1172
|
-
--color-accent-tertiary: #06b6d4;
|
|
1173
|
-
|
|
1174
|
-
/* Status Colors */
|
|
1175
|
-
--color-status-success: #10b981;
|
|
1176
|
-
--color-status-warning: #f59e0b;
|
|
1177
|
-
--color-status-error: #ef4444;
|
|
1178
|
-
--color-status-info: #06b6d4;
|
|
1179
|
-
|
|
1180
|
-
/* Typography */
|
|
1181
|
-
--font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
|
1182
|
-
--font-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
1183
|
-
--weight-normal: 400;
|
|
1184
|
-
--weight-medium: 500;
|
|
1185
|
-
--weight-semibold: 600;
|
|
1186
|
-
--weight-bold: 700;
|
|
1187
|
-
|
|
1188
|
-
/* Font Sizes */
|
|
1189
|
-
--size-xs: 0.75rem;
|
|
1190
|
-
--size-sm: 0.875rem;
|
|
1191
|
-
--size-base: 1rem;
|
|
1192
|
-
--size-lg: 1.125rem;
|
|
1193
|
-
--size-xl: 1.25rem;
|
|
1194
|
-
--size-2xl: 1.5rem;
|
|
1195
|
-
|
|
1196
|
-
/* Spacing */
|
|
1197
|
-
--space-1: 0.25rem;
|
|
1198
|
-
--space-2: 0.5rem;
|
|
1199
|
-
--space-3: 0.75rem;
|
|
1200
|
-
--space-4: 1rem;
|
|
1201
|
-
--space-6: 1.5rem;
|
|
1202
|
-
--space-8: 2rem;
|
|
1203
|
-
|
|
1204
|
-
/* Border Radius */
|
|
1205
|
-
--radius-sm: 4px;
|
|
1206
|
-
--radius-md: 8px;
|
|
1207
|
-
--radius-lg: 12px;
|
|
1208
|
-
|
|
1209
|
-
/* Transitions */
|
|
1210
|
-
--transition-fast: all 150ms ease-out;
|
|
1211
|
-
--transition-base: all 300ms ease-out;
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
|
-
/* ====================================================================
|
|
1215
|
-
Global Reset & Base Styles
|
|
1216
|
-
==================================================================== */
|
|
1217
|
-
|
|
1218
|
-
* {
|
|
1219
|
-
margin: 0;
|
|
1220
|
-
padding: 0;
|
|
1221
|
-
box-sizing: border-box;
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
html, body {
|
|
1225
|
-
height: 100%;
|
|
1226
|
-
overflow: hidden;
|
|
1227
|
-
}
|
|
1228
|
-
|
|
1229
|
-
body {
|
|
1230
|
-
font-family: var(--font-primary);
|
|
1231
|
-
background-color: var(--color-bg-primary);
|
|
1232
|
-
color: var(--color-text-primary);
|
|
1233
|
-
font-size: var(--size-base);
|
|
1234
|
-
font-weight: var(--weight-normal);
|
|
1235
|
-
line-height: 1.5;
|
|
1236
|
-
display: flex;
|
|
1237
|
-
flex-direction: column;
|
|
1238
|
-
}
|
|
1239
|
-
|
|
1240
|
-
/* ====================================================================
|
|
1241
|
-
Layout
|
|
1242
|
-
==================================================================== */
|
|
1243
|
-
|
|
1244
|
-
header {
|
|
1245
|
-
display: flex;
|
|
1246
|
-
align-items: center;
|
|
1247
|
-
justify-content: space-between;
|
|
1248
|
-
height: 64px;
|
|
1249
|
-
padding: 0 var(--space-8);
|
|
1250
|
-
background-color: var(--color-bg-secondary);
|
|
1251
|
-
border-bottom: 1px solid var(--color-border);
|
|
1252
|
-
flex-shrink: 0;
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
.header-left {
|
|
1256
|
-
display: flex;
|
|
1257
|
-
align-items: center;
|
|
1258
|
-
gap: var(--space-4);
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
.header-info h1 {
|
|
1262
|
-
font-size: var(--size-xl);
|
|
1263
|
-
font-weight: var(--weight-semibold);
|
|
1264
|
-
color: var(--color-text-primary);
|
|
1265
|
-
}
|
|
1266
|
-
|
|
1267
|
-
.header-info p {
|
|
1268
|
-
font-size: var(--size-sm);
|
|
1269
|
-
color: var(--color-text-secondary);
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
.header-actions {
|
|
1273
|
-
display: flex;
|
|
1274
|
-
gap: var(--space-3);
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
|
-
.container {
|
|
1278
|
-
flex: 1;
|
|
1279
|
-
display: flex;
|
|
1280
|
-
overflow: hidden;
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
|
-
aside {
|
|
1284
|
-
width: 280px;
|
|
1285
|
-
background-color: var(--color-bg-secondary);
|
|
1286
|
-
border-right: 1px solid var(--color-border);
|
|
1287
|
-
display: flex;
|
|
1288
|
-
flex-direction: column;
|
|
1289
|
-
flex-shrink: 0;
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
.sidebar-header {
|
|
1293
|
-
padding: var(--space-4);
|
|
1294
|
-
border-bottom: 1px solid var(--color-border);
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
|
-
.sidebar-header h2 {
|
|
1298
|
-
font-size: var(--size-sm);
|
|
1299
|
-
font-weight: var(--weight-semibold);
|
|
1300
|
-
text-transform: uppercase;
|
|
1301
|
-
letter-spacing: 0.5px;
|
|
1302
|
-
color: var(--color-text-secondary);
|
|
1303
|
-
margin-bottom: var(--space-3);
|
|
1304
|
-
}
|
|
1305
|
-
|
|
1306
|
-
.bucket-list {
|
|
1307
|
-
flex: 1;
|
|
1308
|
-
overflow-y: auto;
|
|
1309
|
-
padding: var(--space-2);
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
.bucket-item {
|
|
1313
|
-
display: flex;
|
|
1314
|
-
align-items: center;
|
|
1315
|
-
gap: var(--space-3);
|
|
1316
|
-
padding: var(--space-3);
|
|
1317
|
-
cursor: pointer;
|
|
1318
|
-
border-radius: var(--radius-md);
|
|
1319
|
-
transition: var(--transition-fast);
|
|
1320
|
-
}
|
|
1321
|
-
|
|
1322
|
-
.bucket-item:hover {
|
|
1323
|
-
background-color: var(--color-bg-tertiary);
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1326
|
-
.bucket-item.active {
|
|
1327
|
-
background-color: var(--color-bg-tertiary);
|
|
1328
|
-
color: var(--color-accent-primary);
|
|
1329
|
-
}
|
|
1330
|
-
|
|
1331
|
-
.bucket-icon {
|
|
1332
|
-
font-size: var(--size-xl);
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
.bucket-info {
|
|
1336
|
-
flex: 1;
|
|
1337
|
-
min-width: 0;
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
.bucket-name {
|
|
1341
|
-
font-weight: var(--weight-medium);
|
|
1342
|
-
white-space: nowrap;
|
|
1343
|
-
overflow: hidden;
|
|
1344
|
-
text-overflow: ellipsis;
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
.bucket-date {
|
|
1348
|
-
font-size: var(--size-xs);
|
|
1349
|
-
color: var(--color-text-secondary);
|
|
1350
|
-
}
|
|
1351
|
-
|
|
1352
|
-
main {
|
|
1353
|
-
flex: 1;
|
|
1354
|
-
display: flex;
|
|
1355
|
-
flex-direction: column;
|
|
1356
|
-
overflow: hidden;
|
|
1357
|
-
}
|
|
1358
|
-
|
|
1359
|
-
.toolbar {
|
|
1360
|
-
display: flex;
|
|
1361
|
-
align-items: center;
|
|
1362
|
-
justify-content: space-between;
|
|
1363
|
-
padding: var(--space-4) var(--space-6);
|
|
1364
|
-
background-color: var(--color-bg-secondary);
|
|
1365
|
-
border-bottom: 1px solid var(--color-border);
|
|
1366
|
-
}
|
|
1367
|
-
|
|
1368
|
-
.breadcrumbs {
|
|
1369
|
-
display: flex;
|
|
1370
|
-
align-items: center;
|
|
1371
|
-
gap: var(--space-2);
|
|
1372
|
-
flex: 1;
|
|
1373
|
-
min-width: 0;
|
|
1374
|
-
overflow-x: auto;
|
|
1375
|
-
}
|
|
1376
|
-
|
|
1377
|
-
.breadcrumb-item {
|
|
1378
|
-
background: none;
|
|
1379
|
-
border: none;
|
|
1380
|
-
color: var(--color-text-secondary);
|
|
1381
|
-
font-size: var(--size-sm);
|
|
1382
|
-
cursor: pointer;
|
|
1383
|
-
padding: var(--space-1) var(--space-2);
|
|
1384
|
-
border-radius: var(--radius-sm);
|
|
1385
|
-
transition: var(--transition-fast);
|
|
1386
|
-
white-space: nowrap;
|
|
1387
|
-
font-family: var(--font-primary);
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1390
|
-
.breadcrumb-item:hover {
|
|
1391
|
-
background-color: var(--color-bg-tertiary);
|
|
1392
|
-
color: var(--color-text-primary);
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1395
|
-
.breadcrumb-separator {
|
|
1396
|
-
color: var(--color-text-tertiary);
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
.toolbar-actions {
|
|
1400
|
-
display: flex;
|
|
1401
|
-
gap: var(--space-2);
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1404
|
-
.file-explorer {
|
|
1405
|
-
flex: 1;
|
|
1406
|
-
overflow-y: auto;
|
|
1407
|
-
padding: var(--space-4);
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1410
|
-
.file-list {
|
|
1411
|
-
display: flex;
|
|
1412
|
-
flex-direction: column;
|
|
1413
|
-
gap: var(--space-1);
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
|
-
.file-item {
|
|
1417
|
-
display: flex;
|
|
1418
|
-
align-items: center;
|
|
1419
|
-
gap: var(--space-3);
|
|
1420
|
-
padding: var(--space-3) var(--space-4);
|
|
1421
|
-
background-color: var(--color-bg-secondary);
|
|
1422
|
-
border: 1px solid var(--color-border);
|
|
1423
|
-
border-radius: var(--radius-md);
|
|
1424
|
-
transition: var(--transition-fast);
|
|
1425
|
-
}
|
|
1426
|
-
|
|
1427
|
-
.file-item:hover {
|
|
1428
|
-
background-color: var(--color-bg-tertiary);
|
|
1429
|
-
border-color: var(--color-border-light);
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
.file-item.folder {
|
|
1433
|
-
font-weight: var(--weight-medium);
|
|
1434
|
-
cursor: pointer;
|
|
1435
|
-
}
|
|
1436
|
-
|
|
1437
|
-
.file-icon {
|
|
1438
|
-
font-size: var(--size-xl);
|
|
1439
|
-
flex-shrink: 0;
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
.file-info {
|
|
1443
|
-
flex: 1;
|
|
1444
|
-
min-width: 0;
|
|
1445
|
-
}
|
|
1446
|
-
|
|
1447
|
-
.file-name {
|
|
1448
|
-
font-size: var(--size-sm);
|
|
1449
|
-
white-space: nowrap;
|
|
1450
|
-
overflow: hidden;
|
|
1451
|
-
text-overflow: ellipsis;
|
|
1452
|
-
}
|
|
1453
|
-
|
|
1454
|
-
.file-meta {
|
|
1455
|
-
font-size: var(--size-xs);
|
|
1456
|
-
color: var(--color-text-secondary);
|
|
1457
|
-
margin-top: var(--space-1);
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
.file-actions {
|
|
1461
|
-
display: flex;
|
|
1462
|
-
gap: var(--space-2);
|
|
1463
|
-
opacity: 0;
|
|
1464
|
-
transition: var(--transition-fast);
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
.file-item:hover .file-actions {
|
|
1468
|
-
opacity: 1;
|
|
1469
|
-
}
|
|
1470
|
-
|
|
1471
|
-
/* ====================================================================
|
|
1472
|
-
Buttons
|
|
1473
|
-
==================================================================== */
|
|
1474
|
-
|
|
1475
|
-
.btn {
|
|
1476
|
-
display: inline-flex;
|
|
1477
|
-
align-items: center;
|
|
1478
|
-
justify-content: center;
|
|
1479
|
-
gap: var(--space-2);
|
|
1480
|
-
padding: var(--space-2) var(--space-4);
|
|
1481
|
-
background-color: var(--color-accent-primary);
|
|
1482
|
-
color: #ffffff;
|
|
1483
|
-
border: none;
|
|
1484
|
-
border-radius: var(--radius-sm);
|
|
1485
|
-
font-size: var(--size-sm);
|
|
1486
|
-
font-weight: var(--weight-medium);
|
|
1487
|
-
cursor: pointer;
|
|
1488
|
-
transition: var(--transition-fast);
|
|
1489
|
-
font-family: var(--font-primary);
|
|
1490
|
-
}
|
|
1491
|
-
|
|
1492
|
-
.btn:hover:not(:disabled) {
|
|
1493
|
-
background-color: #0d9ecf;
|
|
1494
|
-
transform: scale(1.02);
|
|
1495
|
-
}
|
|
1496
|
-
|
|
1497
|
-
.btn:active:not(:disabled) {
|
|
1498
|
-
transform: scale(0.98);
|
|
1499
|
-
}
|
|
1500
|
-
|
|
1501
|
-
.btn:disabled {
|
|
1502
|
-
opacity: 0.5;
|
|
1503
|
-
cursor: not-allowed;
|
|
1504
|
-
}
|
|
1505
|
-
|
|
1506
|
-
.btn.secondary {
|
|
1507
|
-
background-color: var(--color-bg-tertiary);
|
|
1508
|
-
border: 1px solid var(--color-border);
|
|
1509
|
-
color: var(--color-text-primary);
|
|
1510
|
-
}
|
|
1511
|
-
|
|
1512
|
-
.btn.secondary:hover:not(:disabled) {
|
|
1513
|
-
background-color: var(--color-border);
|
|
1514
|
-
}
|
|
1515
|
-
|
|
1516
|
-
.btn-icon {
|
|
1517
|
-
background: none;
|
|
1518
|
-
border: none;
|
|
1519
|
-
color: var(--color-text-secondary);
|
|
1520
|
-
font-size: var(--size-lg);
|
|
1521
|
-
cursor: pointer;
|
|
1522
|
-
padding: var(--space-1);
|
|
1523
|
-
border-radius: var(--radius-sm);
|
|
1524
|
-
transition: var(--transition-fast);
|
|
1525
|
-
display: flex;
|
|
1526
|
-
align-items: center;
|
|
1527
|
-
justify-content: center;
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1530
|
-
.btn-icon:hover {
|
|
1531
|
-
background-color: var(--color-bg-tertiary);
|
|
1532
|
-
color: var(--color-text-primary);
|
|
1533
|
-
}
|
|
1534
|
-
|
|
1535
|
-
.btn-close {
|
|
1536
|
-
background: none;
|
|
1537
|
-
border: none;
|
|
1538
|
-
color: var(--color-text-secondary);
|
|
1539
|
-
font-size: var(--size-xl);
|
|
1540
|
-
cursor: pointer;
|
|
1541
|
-
padding: var(--space-2);
|
|
1542
|
-
line-height: 1;
|
|
1543
|
-
transition: var(--transition-fast);
|
|
1544
|
-
}
|
|
1545
|
-
|
|
1546
|
-
.btn-close:hover {
|
|
1547
|
-
color: var(--color-text-primary);
|
|
1548
|
-
}
|
|
1549
|
-
|
|
1550
|
-
/* ====================================================================
|
|
1551
|
-
Modal & Preview
|
|
1552
|
-
==================================================================== */
|
|
1553
|
-
|
|
1554
|
-
.modal-overlay {
|
|
1555
|
-
position: fixed;
|
|
1556
|
-
top: 0;
|
|
1557
|
-
left: 0;
|
|
1558
|
-
right: 0;
|
|
1559
|
-
bottom: 0;
|
|
1560
|
-
background-color: rgba(0, 0, 0, 0.8);
|
|
1561
|
-
display: flex;
|
|
1562
|
-
align-items: center;
|
|
1563
|
-
justify-content: center;
|
|
1564
|
-
z-index: 1000;
|
|
1565
|
-
padding: var(--space-8);
|
|
1566
|
-
}
|
|
1567
|
-
|
|
1568
|
-
.modal {
|
|
1569
|
-
background-color: var(--color-bg-secondary);
|
|
1570
|
-
border: 1px solid var(--color-border);
|
|
1571
|
-
border-radius: var(--radius-lg);
|
|
1572
|
-
max-width: 90vw;
|
|
1573
|
-
max-height: 90vh;
|
|
1574
|
-
display: flex;
|
|
1575
|
-
flex-direction: column;
|
|
1576
|
-
overflow: hidden;
|
|
1577
|
-
}
|
|
1578
|
-
|
|
1579
|
-
.file-preview {
|
|
1580
|
-
display: flex;
|
|
1581
|
-
flex-direction: column;
|
|
1582
|
-
width: 100%;
|
|
1583
|
-
height: 100%;
|
|
1584
|
-
}
|
|
1585
|
-
|
|
1586
|
-
.preview-header {
|
|
1587
|
-
display: flex;
|
|
1588
|
-
align-items: center;
|
|
1589
|
-
justify-content: space-between;
|
|
1590
|
-
padding: var(--space-4) var(--space-6);
|
|
1591
|
-
border-bottom: 1px solid var(--color-border);
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
.preview-header h3 {
|
|
1595
|
-
font-size: var(--size-lg);
|
|
1596
|
-
font-weight: var(--weight-semibold);
|
|
1597
|
-
margin: 0;
|
|
1598
|
-
}
|
|
1599
|
-
|
|
1600
|
-
.preview-meta {
|
|
1601
|
-
padding: var(--space-3) var(--space-6);
|
|
1602
|
-
background-color: var(--color-bg-tertiary);
|
|
1603
|
-
font-size: var(--size-xs);
|
|
1604
|
-
color: var(--color-text-secondary);
|
|
1605
|
-
border-bottom: 1px solid var(--color-border);
|
|
1606
|
-
}
|
|
1607
|
-
|
|
1608
|
-
.preview-content {
|
|
1609
|
-
flex: 1;
|
|
1610
|
-
overflow: auto;
|
|
1611
|
-
padding: var(--space-6);
|
|
1612
|
-
}
|
|
1613
|
-
|
|
1614
|
-
.preview-image-container,
|
|
1615
|
-
.preview-video-container,
|
|
1616
|
-
.preview-audio-container,
|
|
1617
|
-
.preview-pdf-container {
|
|
1618
|
-
display: flex;
|
|
1619
|
-
align-items: center;
|
|
1620
|
-
justify-content: center;
|
|
1621
|
-
}
|
|
1622
|
-
|
|
1623
|
-
.preview-text-container pre {
|
|
1624
|
-
background-color: var(--color-bg-tertiary);
|
|
1625
|
-
border: 1px solid var(--color-border);
|
|
1626
|
-
border-radius: var(--radius-md);
|
|
1627
|
-
padding: var(--space-4);
|
|
1628
|
-
overflow: auto;
|
|
1629
|
-
font-family: var(--font-mono);
|
|
1630
|
-
font-size: var(--size-sm);
|
|
1631
|
-
line-height: 1.6;
|
|
1632
|
-
}
|
|
1633
|
-
|
|
1634
|
-
.preview-unavailable {
|
|
1635
|
-
display: flex;
|
|
1636
|
-
flex-direction: column;
|
|
1637
|
-
align-items: center;
|
|
1638
|
-
justify-content: center;
|
|
1639
|
-
gap: var(--space-4);
|
|
1640
|
-
padding: var(--space-8);
|
|
1641
|
-
text-align: center;
|
|
1642
|
-
}
|
|
1643
|
-
|
|
1644
|
-
.preview-actions {
|
|
1645
|
-
display: flex;
|
|
1646
|
-
gap: var(--space-3);
|
|
1647
|
-
padding: var(--space-4) var(--space-6);
|
|
1648
|
-
border-top: 1px solid var(--color-border);
|
|
1649
|
-
background-color: var(--color-bg-secondary);
|
|
1650
|
-
}
|
|
1651
|
-
|
|
1652
|
-
/* ====================================================================
|
|
1653
|
-
Upload Zone
|
|
1654
|
-
==================================================================== */
|
|
1655
|
-
|
|
1656
|
-
.upload-zone {
|
|
1657
|
-
border: 2px dashed var(--color-border);
|
|
1658
|
-
border-radius: var(--radius-lg);
|
|
1659
|
-
padding: var(--space-8);
|
|
1660
|
-
text-align: center;
|
|
1661
|
-
transition: var(--transition-fast);
|
|
1662
|
-
cursor: pointer;
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
.upload-zone:hover,
|
|
1666
|
-
.upload-zone.drag-over {
|
|
1667
|
-
border-color: var(--color-accent-primary);
|
|
1668
|
-
background-color: var(--color-bg-tertiary);
|
|
1669
|
-
}
|
|
1670
|
-
|
|
1671
|
-
.upload-zone-icon {
|
|
1672
|
-
font-size: 3rem;
|
|
1673
|
-
margin-bottom: var(--space-4);
|
|
1674
|
-
}
|
|
1675
|
-
|
|
1676
|
-
.upload-zone input[type="file"] {
|
|
1677
|
-
display: none;
|
|
1678
|
-
}
|
|
1679
|
-
|
|
1680
|
-
/* ====================================================================
|
|
1681
|
-
States
|
|
1682
|
-
==================================================================== */
|
|
1683
|
-
|
|
1684
|
-
.loading {
|
|
1685
|
-
display: flex;
|
|
1686
|
-
flex-direction: column;
|
|
1687
|
-
align-items: center;
|
|
1688
|
-
justify-content: center;
|
|
1689
|
-
gap: var(--space-4);
|
|
1690
|
-
padding: var(--space-8);
|
|
1691
|
-
color: var(--color-text-secondary);
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
.spinner {
|
|
1695
|
-
width: 40px;
|
|
1696
|
-
height: 40px;
|
|
1697
|
-
border: 3px solid var(--color-border);
|
|
1698
|
-
border-top-color: var(--color-accent-primary);
|
|
1699
|
-
border-radius: 50%;
|
|
1700
|
-
animation: spin 1s linear infinite;
|
|
1701
|
-
}
|
|
1702
|
-
|
|
1703
|
-
@keyframes spin {
|
|
1704
|
-
to { transform: rotate(360deg); }
|
|
1705
|
-
}
|
|
1706
|
-
|
|
1707
|
-
.empty-state {
|
|
1708
|
-
display: flex;
|
|
1709
|
-
flex-direction: column;
|
|
1710
|
-
align-items: center;
|
|
1711
|
-
justify-content: center;
|
|
1712
|
-
gap: var(--space-4);
|
|
1713
|
-
padding: var(--space-8);
|
|
1714
|
-
color: var(--color-text-secondary);
|
|
1715
|
-
text-align: center;
|
|
1716
|
-
}
|
|
60
|
+
controllers: [app_controller_1.AppController, buckets_controller_1.BucketsController, files_controller_1.FilesController, upload_controller_1.UploadController],
|
|
61
|
+
providers: [
|
|
62
|
+
s3_service_1.S3Service,
|
|
63
|
+
file_preview_service_1.FilePreviewService,
|
|
64
|
+
{
|
|
65
|
+
provide: app_server_bucketvore_config_class_1.AppServerBucketvoreConfig,
|
|
66
|
+
useValue: new app_server_bucketvore_config_class_1.AppServerBucketvoreConfig(),
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
provide: client_s3_1.S3Client,
|
|
70
|
+
useFactory: () => {
|
|
71
|
+
const config = new app_server_bucketvore_config_class_1.AppServerBucketvoreConfig();
|
|
72
|
+
const clientConfig = { region: 'us-east-1' };
|
|
73
|
+
if (config.AWS_PROFILE) {
|
|
74
|
+
clientConfig.credentials = (0, credential_providers_1.fromIni)({ profile: config.AWS_PROFILE });
|
|
75
|
+
}
|
|
76
|
+
return new client_s3_1.S3Client(clientConfig);
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
})
|
|
81
|
+
], AppServerBucketvoreModule);
|
|
1717
82
|
|
|
1718
|
-
.empty-state-icon {
|
|
1719
|
-
font-size: 4rem;
|
|
1720
|
-
opacity: 0.5;
|
|
1721
|
-
}
|
|
1722
83
|
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
gap: var(--space-3);
|
|
1727
|
-
padding: var(--space-4);
|
|
1728
|
-
background-color: rgba(239, 68, 68, 0.1);
|
|
1729
|
-
border: 1px solid var(--color-status-error);
|
|
1730
|
-
border-radius: var(--radius-md);
|
|
1731
|
-
color: var(--color-status-error);
|
|
1732
|
-
}
|
|
84
|
+
/***/ }),
|
|
85
|
+
/* 5 */
|
|
86
|
+
/***/ ((module) => {
|
|
1733
87
|
|
|
1734
|
-
|
|
1735
|
-
font-size: var(--size-xl);
|
|
1736
|
-
}
|
|
88
|
+
module.exports = require("tslib");
|
|
1737
89
|
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
90
|
+
/***/ }),
|
|
91
|
+
/* 6 */
|
|
92
|
+
/***/ ((module) => {
|
|
1741
93
|
|
|
1742
|
-
|
|
1743
|
-
width: 12px;
|
|
1744
|
-
height: 12px;
|
|
1745
|
-
}
|
|
94
|
+
module.exports = require("@nestjs/common");
|
|
1746
95
|
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
96
|
+
/***/ }),
|
|
97
|
+
/* 7 */
|
|
98
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1750
99
|
|
|
1751
|
-
::-webkit-scrollbar-thumb {
|
|
1752
|
-
background-color: var(--color-border);
|
|
1753
|
-
border-radius: var(--radius-sm);
|
|
1754
|
-
border: 2px solid var(--color-bg-primary);
|
|
1755
|
-
}
|
|
1756
100
|
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
101
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
102
|
+
exports.AppController = void 0;
|
|
103
|
+
const tslib_1 = __webpack_require__(5);
|
|
104
|
+
const common_1 = __webpack_require__(6);
|
|
105
|
+
let AppController = class AppController {
|
|
106
|
+
getHealth() {
|
|
107
|
+
return { ok: true, service: 'bucketvore' };
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
exports.AppController = AppController;
|
|
111
|
+
tslib_1.__decorate([
|
|
112
|
+
(0, common_1.Get)('/api/health'),
|
|
113
|
+
tslib_1.__metadata("design:type", Function),
|
|
114
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
115
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
116
|
+
], AppController.prototype, "getHealth", null);
|
|
117
|
+
exports.AppController = AppController = tslib_1.__decorate([
|
|
118
|
+
(0, common_1.Controller)()
|
|
119
|
+
], AppController);
|
|
1761
120
|
|
|
1762
121
|
|
|
1763
122
|
/***/ }),
|
|
1764
|
-
/*
|
|
123
|
+
/* 8 */
|
|
1765
124
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1766
125
|
|
|
1767
126
|
|
|
1768
|
-
var _a
|
|
127
|
+
var _a;
|
|
1769
128
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1770
129
|
exports.BucketsController = void 0;
|
|
1771
130
|
const tslib_1 = __webpack_require__(5);
|
|
1772
131
|
const common_1 = __webpack_require__(6);
|
|
1773
|
-
const s3_service_1 = __webpack_require__(
|
|
1774
|
-
const html_generator_service_1 = __webpack_require__(51);
|
|
132
|
+
const s3_service_1 = __webpack_require__(9);
|
|
1775
133
|
let BucketsController = class BucketsController {
|
|
1776
|
-
constructor(s3Service
|
|
134
|
+
constructor(s3Service) {
|
|
1777
135
|
this.s3Service = s3Service;
|
|
1778
|
-
this.htmlGenerator = htmlGenerator;
|
|
1779
136
|
}
|
|
1780
|
-
async
|
|
1781
|
-
|
|
1782
|
-
const buckets = await this.s3Service.listBuckets();
|
|
1783
|
-
return this.htmlGenerator.generateBucketsListHtml(buckets);
|
|
1784
|
-
}
|
|
1785
|
-
catch (error) {
|
|
1786
|
-
console.error('Error listing buckets:', error);
|
|
1787
|
-
return this.htmlGenerator.generateErrorHtml('Failed to load buckets');
|
|
1788
|
-
}
|
|
137
|
+
async listBuckets() {
|
|
138
|
+
return this.s3Service.listBuckets();
|
|
1789
139
|
}
|
|
1790
140
|
async getBucketRegion(bucket) {
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
return { error: 'Bucket parameter is required' };
|
|
1794
|
-
}
|
|
1795
|
-
const region = await this.s3Service.getBucketRegion(bucket);
|
|
1796
|
-
return { region };
|
|
1797
|
-
}
|
|
1798
|
-
catch (error) {
|
|
1799
|
-
console.error('Error getting bucket region:', error);
|
|
1800
|
-
return { region: 'us-east-1' }; // fallback to us-east-1
|
|
1801
|
-
}
|
|
141
|
+
const region = await this.s3Service.getBucketRegion(bucket);
|
|
142
|
+
return { region };
|
|
1802
143
|
}
|
|
1803
144
|
};
|
|
1804
145
|
exports.BucketsController = BucketsController;
|
|
1805
146
|
tslib_1.__decorate([
|
|
1806
|
-
(0, common_1.Get)(
|
|
147
|
+
(0, common_1.Get)(),
|
|
1807
148
|
tslib_1.__metadata("design:type", Function),
|
|
1808
149
|
tslib_1.__metadata("design:paramtypes", []),
|
|
1809
150
|
tslib_1.__metadata("design:returntype", Promise)
|
|
1810
|
-
], BucketsController.prototype, "
|
|
151
|
+
], BucketsController.prototype, "listBuckets", null);
|
|
1811
152
|
tslib_1.__decorate([
|
|
1812
153
|
(0, common_1.Get)(':bucket/region'),
|
|
1813
154
|
tslib_1.__param(0, (0, common_1.Param)('bucket')),
|
|
@@ -1817,12 +158,12 @@ tslib_1.__decorate([
|
|
|
1817
158
|
], BucketsController.prototype, "getBucketRegion", null);
|
|
1818
159
|
exports.BucketsController = BucketsController = tslib_1.__decorate([
|
|
1819
160
|
(0, common_1.Controller)('api/buckets'),
|
|
1820
|
-
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof s3_service_1.S3Service !== "undefined" && s3_service_1.S3Service) === "function" ? _a : Object
|
|
161
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof s3_service_1.S3Service !== "undefined" && s3_service_1.S3Service) === "function" ? _a : Object])
|
|
1821
162
|
], BucketsController);
|
|
1822
163
|
|
|
1823
164
|
|
|
1824
165
|
/***/ }),
|
|
1825
|
-
/*
|
|
166
|
+
/* 9 */
|
|
1826
167
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1827
168
|
|
|
1828
169
|
|
|
@@ -1831,10 +172,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1831
172
|
exports.S3Service = void 0;
|
|
1832
173
|
const tslib_1 = __webpack_require__(5);
|
|
1833
174
|
const common_1 = __webpack_require__(6);
|
|
1834
|
-
const client_s3_1 = __webpack_require__(
|
|
1835
|
-
const s3_request_presigner_1 = __webpack_require__(
|
|
1836
|
-
const app_server_bucketvore_config_class_1 = __webpack_require__(
|
|
1837
|
-
const credential_providers_1 = __webpack_require__(
|
|
175
|
+
const client_s3_1 = __webpack_require__(10);
|
|
176
|
+
const s3_request_presigner_1 = __webpack_require__(11);
|
|
177
|
+
const app_server_bucketvore_config_class_1 = __webpack_require__(12);
|
|
178
|
+
const credential_providers_1 = __webpack_require__(13);
|
|
1838
179
|
let S3Service = class S3Service {
|
|
1839
180
|
constructor(s3Client, config) {
|
|
1840
181
|
this.s3Client = s3Client;
|
|
@@ -2005,16 +346,12 @@ let S3Service = class S3Service {
|
|
|
2005
346
|
const parts = prefix.replace(/\/$/, '').split('/');
|
|
2006
347
|
return parts[parts.length - 1] || prefix;
|
|
2007
348
|
}
|
|
2008
|
-
/**
|
|
2009
|
-
* Get the AWS region for a specific bucket
|
|
2010
|
-
*/
|
|
2011
349
|
async getBucketRegion(bucket) {
|
|
2012
350
|
let region = this.bucketRegionCache.get(bucket);
|
|
2013
351
|
if (!region) {
|
|
2014
352
|
try {
|
|
2015
353
|
const command = new client_s3_1.GetBucketLocationCommand({ Bucket: bucket });
|
|
2016
354
|
const response = await this.s3Client.send(command);
|
|
2017
|
-
// LocationConstraint is null for us-east-1
|
|
2018
355
|
region = response.LocationConstraint || 'us-east-1';
|
|
2019
356
|
this.bucketRegionCache.set(bucket, region);
|
|
2020
357
|
}
|
|
@@ -2034,355 +371,154 @@ exports.S3Service = S3Service = tslib_1.__decorate([
|
|
|
2034
371
|
|
|
2035
372
|
|
|
2036
373
|
/***/ }),
|
|
2037
|
-
/*
|
|
374
|
+
/* 10 */
|
|
2038
375
|
/***/ ((module) => {
|
|
2039
376
|
|
|
2040
377
|
module.exports = require("@aws-sdk/client-s3");
|
|
2041
378
|
|
|
2042
379
|
/***/ }),
|
|
2043
|
-
/*
|
|
380
|
+
/* 11 */
|
|
2044
381
|
/***/ ((module) => {
|
|
2045
382
|
|
|
2046
383
|
module.exports = require("@aws-sdk/s3-request-presigner");
|
|
2047
384
|
|
|
2048
385
|
/***/ }),
|
|
2049
|
-
/*
|
|
386
|
+
/* 12 */
|
|
387
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
391
|
+
exports.AppServerBucketvoreConfig = void 0;
|
|
392
|
+
class AppServerBucketvoreConfig {
|
|
393
|
+
constructor() {
|
|
394
|
+
this.AWS_PROFILE = process.env['AWS_PROFILE'];
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
exports.AppServerBucketvoreConfig = AppServerBucketvoreConfig;
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
/***/ }),
|
|
401
|
+
/* 13 */
|
|
2050
402
|
/***/ ((module) => {
|
|
2051
403
|
|
|
2052
404
|
module.exports = require("@aws-sdk/credential-providers");
|
|
2053
405
|
|
|
2054
406
|
/***/ }),
|
|
2055
|
-
/*
|
|
407
|
+
/* 14 */
|
|
2056
408
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2057
409
|
|
|
2058
410
|
|
|
2059
|
-
var _a;
|
|
411
|
+
var _a, _b;
|
|
2060
412
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2061
|
-
exports.
|
|
413
|
+
exports.FilesController = void 0;
|
|
2062
414
|
const tslib_1 = __webpack_require__(5);
|
|
2063
415
|
const common_1 = __webpack_require__(6);
|
|
2064
|
-
const
|
|
2065
|
-
const file_preview_service_1 = __webpack_require__(
|
|
2066
|
-
let
|
|
2067
|
-
constructor(filePreviewService) {
|
|
416
|
+
const s3_service_1 = __webpack_require__(9);
|
|
417
|
+
const file_preview_service_1 = __webpack_require__(15);
|
|
418
|
+
let FilesController = class FilesController {
|
|
419
|
+
constructor(s3Service, filePreviewService) {
|
|
420
|
+
this.s3Service = s3Service;
|
|
2068
421
|
this.filePreviewService = filePreviewService;
|
|
2069
422
|
}
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
className: 'bucket-item',
|
|
2082
|
-
'data-bucket-name': bucket.name,
|
|
2083
|
-
'@click': 'selectBucket($el.dataset.bucketName)',
|
|
2084
|
-
children: [
|
|
2085
|
-
(0, server_html_1.$div)({ className: 'bucket-icon', textContent: '🪣' }),
|
|
2086
|
-
(0, server_html_1.$div)({
|
|
2087
|
-
className: 'bucket-info',
|
|
2088
|
-
children: [
|
|
2089
|
-
(0, server_html_1.$div)({ className: 'bucket-name', textContent: bucket.name }),
|
|
2090
|
-
bucket.creationDate ? (0, server_html_1.$div)({
|
|
2091
|
-
className: 'bucket-date',
|
|
2092
|
-
textContent: new Date(bucket.creationDate).toLocaleDateString()
|
|
2093
|
-
}) : ''
|
|
2094
|
-
].filter(Boolean)
|
|
2095
|
-
})
|
|
2096
|
-
]
|
|
2097
|
-
}));
|
|
2098
|
-
return bucketElements.join('');
|
|
2099
|
-
}
|
|
2100
|
-
generateBreadcrumbs(prefix, bucket) {
|
|
2101
|
-
const parts = prefix ? prefix.split('/').filter(Boolean) : [];
|
|
2102
|
-
const breadcrumbs = [
|
|
2103
|
-
(0, server_html_1.$button)({
|
|
2104
|
-
className: 'breadcrumb-item',
|
|
2105
|
-
'@click': 'navigateToFolder(\'\')',
|
|
2106
|
-
textContent: '🪣 ' + bucket
|
|
2107
|
-
})
|
|
2108
|
-
];
|
|
2109
|
-
let currentPath = '';
|
|
2110
|
-
parts.forEach((part, index) => {
|
|
2111
|
-
currentPath += part + '/';
|
|
2112
|
-
breadcrumbs.push((0, server_html_1.$span)({ className: 'breadcrumb-separator', textContent: '/' }));
|
|
2113
|
-
breadcrumbs.push((0, server_html_1.$button)({
|
|
2114
|
-
className: 'breadcrumb-item',
|
|
2115
|
-
'data-path': currentPath,
|
|
2116
|
-
'@click': 'navigateToFolder($el.dataset.path)',
|
|
2117
|
-
textContent: part
|
|
2118
|
-
}));
|
|
2119
|
-
});
|
|
2120
|
-
return (0, server_html_1.$div)({
|
|
2121
|
-
className: 'breadcrumbs',
|
|
2122
|
-
children: breadcrumbs
|
|
2123
|
-
});
|
|
423
|
+
async listFiles(bucket, prefix) {
|
|
424
|
+
const { objects, commonPrefixes } = await this.s3Service.listObjects(bucket, prefix);
|
|
425
|
+
return {
|
|
426
|
+
objects: objects.map(obj => ({
|
|
427
|
+
key: obj.Key,
|
|
428
|
+
size: obj.Size,
|
|
429
|
+
lastModified: obj.LastModified?.toISOString(),
|
|
430
|
+
})),
|
|
431
|
+
folders: commonPrefixes,
|
|
432
|
+
prefix: prefix || '',
|
|
433
|
+
};
|
|
2124
434
|
}
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
435
|
+
async previewFile(bucket, key) {
|
|
436
|
+
const extension = this.s3Service.getFileExtension(key);
|
|
437
|
+
const previewType = this.filePreviewService.getPreviewType(extension);
|
|
438
|
+
const metadata = await this.s3Service.getObjectMetadata(bucket, key);
|
|
439
|
+
let content;
|
|
440
|
+
let presignedUrl;
|
|
441
|
+
if (previewType === 'text') {
|
|
442
|
+
const { body } = await this.s3Service.getObject(bucket, key);
|
|
443
|
+
const text = await this.filePreviewService.generateTextPreview(body);
|
|
444
|
+
content = extension === 'json' ? this.filePreviewService.formatJson(text) : text;
|
|
2134
445
|
}
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
return (0, server_html_1.$div)({
|
|
2138
|
-
className: 'file-item folder',
|
|
2139
|
-
'data-folder-path': folderPrefix,
|
|
2140
|
-
'@click': 'navigateToFolder($el.dataset.folderPath)',
|
|
2141
|
-
children: [
|
|
2142
|
-
(0, server_html_1.$div)({ className: 'file-icon', textContent: '📁' }),
|
|
2143
|
-
(0, server_html_1.$div)({
|
|
2144
|
-
className: 'file-info',
|
|
2145
|
-
children: [
|
|
2146
|
-
(0, server_html_1.$div)({ className: 'file-name', textContent: folderName }),
|
|
2147
|
-
(0, server_html_1.$div)({ className: 'file-meta', textContent: 'Folder' })
|
|
2148
|
-
]
|
|
2149
|
-
}),
|
|
2150
|
-
(0, server_html_1.$div)({
|
|
2151
|
-
className: 'file-actions',
|
|
2152
|
-
children: [
|
|
2153
|
-
(0, server_html_1.$button)({
|
|
2154
|
-
className: 'btn-icon',
|
|
2155
|
-
'data-folder-path': folderPrefix,
|
|
2156
|
-
'@click.stop': 'deleteFolder($el.dataset.folderPath)',
|
|
2157
|
-
title: 'Delete folder',
|
|
2158
|
-
textContent: '🗑️'
|
|
2159
|
-
})
|
|
2160
|
-
]
|
|
2161
|
-
})
|
|
2162
|
-
]
|
|
2163
|
-
});
|
|
2164
|
-
});
|
|
2165
|
-
const fileElements = objects.map(obj => {
|
|
2166
|
-
const fileName = s3Service.getFileName(obj.Key);
|
|
2167
|
-
const extension = s3Service.getFileExtension(obj.Key);
|
|
2168
|
-
const icon = this.filePreviewService.getFileIcon(extension);
|
|
2169
|
-
const canPreview = this.filePreviewService.canPreview(extension);
|
|
2170
|
-
return (0, server_html_1.$div)({
|
|
2171
|
-
className: 'file-item',
|
|
2172
|
-
'data-file-key': obj.Key,
|
|
2173
|
-
'@click': canPreview ? 'previewFile($el.dataset.fileKey)' : '',
|
|
2174
|
-
style: { cursor: canPreview ? 'pointer' : 'default' },
|
|
2175
|
-
children: [
|
|
2176
|
-
(0, server_html_1.$div)({ className: 'file-icon', textContent: icon }),
|
|
2177
|
-
(0, server_html_1.$div)({
|
|
2178
|
-
className: 'file-info',
|
|
2179
|
-
children: [
|
|
2180
|
-
(0, server_html_1.$div)({ className: 'file-name', textContent: fileName }),
|
|
2181
|
-
(0, server_html_1.$div)({
|
|
2182
|
-
className: 'file-meta',
|
|
2183
|
-
textContent: `${s3Service.formatFileSize(obj.Size)} · ${obj.LastModified ? new Date(obj.LastModified).toLocaleString() : ''}`
|
|
2184
|
-
})
|
|
2185
|
-
]
|
|
2186
|
-
}),
|
|
2187
|
-
(0, server_html_1.$div)({
|
|
2188
|
-
className: 'file-actions',
|
|
2189
|
-
children: [
|
|
2190
|
-
canPreview ? (0, server_html_1.$button)({
|
|
2191
|
-
className: 'btn-icon',
|
|
2192
|
-
'data-file-key': obj.Key,
|
|
2193
|
-
'@click.stop': 'previewFile($el.dataset.fileKey)',
|
|
2194
|
-
title: 'Preview',
|
|
2195
|
-
textContent: '👁️'
|
|
2196
|
-
}) : '',
|
|
2197
|
-
(0, server_html_1.$button)({
|
|
2198
|
-
className: 'btn-icon',
|
|
2199
|
-
'data-file-key': obj.Key,
|
|
2200
|
-
'@click.stop': 'copyS3Path($el.dataset.fileKey, $el)',
|
|
2201
|
-
title: 'Copy S3 path (s3://bucket/key)',
|
|
2202
|
-
textContent: '📋'
|
|
2203
|
-
}),
|
|
2204
|
-
(0, server_html_1.$button)({
|
|
2205
|
-
className: 'btn-icon',
|
|
2206
|
-
'data-file-key': obj.Key,
|
|
2207
|
-
'@click.stop': 'downloadFile($el.dataset.fileKey)',
|
|
2208
|
-
title: 'Download',
|
|
2209
|
-
textContent: '⬇️'
|
|
2210
|
-
}),
|
|
2211
|
-
(0, server_html_1.$button)({
|
|
2212
|
-
className: 'btn-icon',
|
|
2213
|
-
'data-file-key': obj.Key,
|
|
2214
|
-
'@click.stop': 'deleteFile($el.dataset.fileKey)',
|
|
2215
|
-
title: 'Delete',
|
|
2216
|
-
textContent: '🗑️'
|
|
2217
|
-
})
|
|
2218
|
-
].filter(Boolean)
|
|
2219
|
-
})
|
|
2220
|
-
]
|
|
2221
|
-
});
|
|
2222
|
-
});
|
|
2223
|
-
return [...folderElements, ...fileElements].join('');
|
|
2224
|
-
}
|
|
2225
|
-
generateFilePreviewHtml(key, previewType, content, metadata, s3Service, presignedUrl) {
|
|
2226
|
-
const fileName = s3Service.getFileName(key);
|
|
2227
|
-
const extension = s3Service.getFileExtension(key);
|
|
2228
|
-
let previewContent = '';
|
|
2229
|
-
switch (previewType) {
|
|
2230
|
-
case 'image':
|
|
2231
|
-
previewContent = (0, server_html_1.$div)({
|
|
2232
|
-
className: 'preview-image-container',
|
|
2233
|
-
children: [
|
|
2234
|
-
(0, server_html_1.$img)({
|
|
2235
|
-
src: presignedUrl,
|
|
2236
|
-
alt: fileName,
|
|
2237
|
-
style: { maxWidth: '100%', maxHeight: '70vh', objectFit: 'contain' }
|
|
2238
|
-
})
|
|
2239
|
-
]
|
|
2240
|
-
});
|
|
2241
|
-
break;
|
|
2242
|
-
case 'text':
|
|
2243
|
-
const textContent = content.toString('utf-8');
|
|
2244
|
-
const formatted = extension === 'json' ? this.filePreviewService.formatJson(textContent) : textContent;
|
|
2245
|
-
previewContent = (0, server_html_1.$div)({
|
|
2246
|
-
className: 'preview-text-container',
|
|
2247
|
-
children: [
|
|
2248
|
-
(0, server_html_1.$pre)({
|
|
2249
|
-
children: [
|
|
2250
|
-
(0, server_html_1.$code)({
|
|
2251
|
-
textContent: formatted.substring(0, 50000) // Limit to 50KB for display
|
|
2252
|
-
})
|
|
2253
|
-
]
|
|
2254
|
-
})
|
|
2255
|
-
]
|
|
2256
|
-
});
|
|
2257
|
-
break;
|
|
2258
|
-
case 'video':
|
|
2259
|
-
previewContent = (0, server_html_1.$div)({
|
|
2260
|
-
className: 'preview-video-container',
|
|
2261
|
-
children: [
|
|
2262
|
-
(0, server_html_1.$video)({
|
|
2263
|
-
src: presignedUrl,
|
|
2264
|
-
controls: true,
|
|
2265
|
-
style: { maxWidth: '100%', maxHeight: '70vh' }
|
|
2266
|
-
})
|
|
2267
|
-
]
|
|
2268
|
-
});
|
|
2269
|
-
break;
|
|
2270
|
-
case 'audio':
|
|
2271
|
-
previewContent = (0, server_html_1.$div)({
|
|
2272
|
-
className: 'preview-audio-container',
|
|
2273
|
-
children: [
|
|
2274
|
-
(0, server_html_1.$audio)({
|
|
2275
|
-
src: presignedUrl,
|
|
2276
|
-
controls: true,
|
|
2277
|
-
style: { width: '100%' }
|
|
2278
|
-
})
|
|
2279
|
-
]
|
|
2280
|
-
});
|
|
2281
|
-
break;
|
|
2282
|
-
case 'pdf':
|
|
2283
|
-
previewContent = (0, server_html_1.$div)({
|
|
2284
|
-
className: 'preview-pdf-container',
|
|
2285
|
-
children: [
|
|
2286
|
-
(0, server_html_1.$iframe)({
|
|
2287
|
-
src: presignedUrl,
|
|
2288
|
-
style: { width: '100%', height: '85vh', border: 'none' }
|
|
2289
|
-
})
|
|
2290
|
-
]
|
|
2291
|
-
});
|
|
2292
|
-
break;
|
|
2293
|
-
default:
|
|
2294
|
-
previewContent = (0, server_html_1.$div)({
|
|
2295
|
-
className: 'preview-unavailable',
|
|
2296
|
-
children: [
|
|
2297
|
-
(0, server_html_1.$p)({ textContent: 'Preview not available for this file type' }),
|
|
2298
|
-
(0, server_html_1.$button)({
|
|
2299
|
-
className: 'btn',
|
|
2300
|
-
'data-file-key': key,
|
|
2301
|
-
'@click': 'downloadFile($el.dataset.fileKey)',
|
|
2302
|
-
textContent: '⬇️ Download File'
|
|
2303
|
-
})
|
|
2304
|
-
]
|
|
2305
|
-
});
|
|
446
|
+
else if (previewType !== 'none') {
|
|
447
|
+
presignedUrl = await this.s3Service.getPresignedViewUrl(bucket, key);
|
|
2306
448
|
}
|
|
2307
|
-
return
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
]
|
|
2320
|
-
}),
|
|
2321
|
-
(0, server_html_1.$div)({
|
|
2322
|
-
className: 'preview-meta',
|
|
2323
|
-
children: [
|
|
2324
|
-
(0, server_html_1.$span)({ textContent: `Size: ${s3Service.formatFileSize(metadata.ContentLength)}` }),
|
|
2325
|
-
(0, server_html_1.$span)({ textContent: ` · Type: ${metadata.ContentType || 'unknown'}` }),
|
|
2326
|
-
metadata.LastModified ? (0, server_html_1.$span)({ textContent: ` · Modified: ${new Date(metadata.LastModified).toLocaleString()}` }) : ''
|
|
2327
|
-
].filter(Boolean)
|
|
2328
|
-
}),
|
|
2329
|
-
(0, server_html_1.$div)({
|
|
2330
|
-
className: 'preview-content',
|
|
2331
|
-
children: [previewContent]
|
|
2332
|
-
}),
|
|
2333
|
-
(0, server_html_1.$div)({
|
|
2334
|
-
className: 'preview-actions',
|
|
2335
|
-
children: [
|
|
2336
|
-
(0, server_html_1.$button)({
|
|
2337
|
-
className: 'btn',
|
|
2338
|
-
'data-file-key': key,
|
|
2339
|
-
'@click': 'copyS3Path($el.dataset.fileKey, $el)',
|
|
2340
|
-
textContent: '📋 Copy S3 Path'
|
|
2341
|
-
}),
|
|
2342
|
-
(0, server_html_1.$button)({
|
|
2343
|
-
className: 'btn',
|
|
2344
|
-
'data-file-key': key,
|
|
2345
|
-
'@click': 'downloadFile($el.dataset.fileKey)',
|
|
2346
|
-
textContent: '⬇️ Download'
|
|
2347
|
-
}),
|
|
2348
|
-
(0, server_html_1.$button)({
|
|
2349
|
-
className: 'btn secondary',
|
|
2350
|
-
'@click': 'closePreview()',
|
|
2351
|
-
textContent: 'Close'
|
|
2352
|
-
})
|
|
2353
|
-
]
|
|
2354
|
-
})
|
|
2355
|
-
]
|
|
2356
|
-
});
|
|
449
|
+
return {
|
|
450
|
+
key,
|
|
451
|
+
fileName: this.s3Service.getFileName(key),
|
|
452
|
+
previewType,
|
|
453
|
+
content,
|
|
454
|
+
presignedUrl,
|
|
455
|
+
metadata: {
|
|
456
|
+
contentLength: metadata.ContentLength,
|
|
457
|
+
contentType: metadata.ContentType,
|
|
458
|
+
lastModified: metadata.LastModified?.toISOString(),
|
|
459
|
+
},
|
|
460
|
+
};
|
|
2357
461
|
}
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
children: [
|
|
2362
|
-
(0, server_html_1.$div)({ className: 'error-icon', textContent: '⚠️' }),
|
|
2363
|
-
(0, server_html_1.$p)({ textContent: message })
|
|
2364
|
-
]
|
|
2365
|
-
});
|
|
462
|
+
async downloadFile(bucket, key) {
|
|
463
|
+
const url = await this.s3Service.getPresignedDownloadUrl(bucket, key);
|
|
464
|
+
return { url };
|
|
2366
465
|
}
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
});
|
|
466
|
+
async deleteFile(body) {
|
|
467
|
+
await this.s3Service.deleteObject(body.bucket, body.key);
|
|
468
|
+
return { success: true };
|
|
469
|
+
}
|
|
470
|
+
async deleteFolder(body) {
|
|
471
|
+
await this.s3Service.deleteFolder(body.bucket, body.prefix);
|
|
472
|
+
return { success: true };
|
|
2375
473
|
}
|
|
2376
474
|
};
|
|
2377
|
-
exports.
|
|
2378
|
-
|
|
2379
|
-
(0, common_1.
|
|
2380
|
-
tslib_1.
|
|
2381
|
-
|
|
475
|
+
exports.FilesController = FilesController;
|
|
476
|
+
tslib_1.__decorate([
|
|
477
|
+
(0, common_1.Get)(),
|
|
478
|
+
tslib_1.__param(0, (0, common_1.Query)('bucket')),
|
|
479
|
+
tslib_1.__param(1, (0, common_1.Query)('prefix')),
|
|
480
|
+
tslib_1.__metadata("design:type", Function),
|
|
481
|
+
tslib_1.__metadata("design:paramtypes", [String, String]),
|
|
482
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
483
|
+
], FilesController.prototype, "listFiles", null);
|
|
484
|
+
tslib_1.__decorate([
|
|
485
|
+
(0, common_1.Get)('preview'),
|
|
486
|
+
tslib_1.__param(0, (0, common_1.Query)('bucket')),
|
|
487
|
+
tslib_1.__param(1, (0, common_1.Query)('key')),
|
|
488
|
+
tslib_1.__metadata("design:type", Function),
|
|
489
|
+
tslib_1.__metadata("design:paramtypes", [String, String]),
|
|
490
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
491
|
+
], FilesController.prototype, "previewFile", null);
|
|
492
|
+
tslib_1.__decorate([
|
|
493
|
+
(0, common_1.Get)('download'),
|
|
494
|
+
tslib_1.__param(0, (0, common_1.Query)('bucket')),
|
|
495
|
+
tslib_1.__param(1, (0, common_1.Query)('key')),
|
|
496
|
+
tslib_1.__metadata("design:type", Function),
|
|
497
|
+
tslib_1.__metadata("design:paramtypes", [String, String]),
|
|
498
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
499
|
+
], FilesController.prototype, "downloadFile", null);
|
|
500
|
+
tslib_1.__decorate([
|
|
501
|
+
(0, common_1.Post)('delete'),
|
|
502
|
+
tslib_1.__param(0, (0, common_1.Body)()),
|
|
503
|
+
tslib_1.__metadata("design:type", Function),
|
|
504
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
505
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
506
|
+
], FilesController.prototype, "deleteFile", null);
|
|
507
|
+
tslib_1.__decorate([
|
|
508
|
+
(0, common_1.Post)('delete-folder'),
|
|
509
|
+
tslib_1.__param(0, (0, common_1.Body)()),
|
|
510
|
+
tslib_1.__metadata("design:type", Function),
|
|
511
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
512
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
513
|
+
], FilesController.prototype, "deleteFolder", null);
|
|
514
|
+
exports.FilesController = FilesController = tslib_1.__decorate([
|
|
515
|
+
(0, common_1.Controller)('api/files'),
|
|
516
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof s3_service_1.S3Service !== "undefined" && s3_service_1.S3Service) === "function" ? _a : Object, typeof (_b = typeof file_preview_service_1.FilePreviewService !== "undefined" && file_preview_service_1.FilePreviewService) === "function" ? _b : Object])
|
|
517
|
+
], FilesController);
|
|
2382
518
|
|
|
2383
519
|
|
|
2384
520
|
/***/ }),
|
|
2385
|
-
/*
|
|
521
|
+
/* 15 */
|
|
2386
522
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2387
523
|
|
|
2388
524
|
|
|
@@ -2397,6 +533,13 @@ let FilePreviewService = class FilePreviewService {
|
|
|
2397
533
|
this.videoExtensions = ['mp4', 'webm', 'ogg', 'mov'];
|
|
2398
534
|
this.audioExtensions = ['mp3', 'wav', 'ogg', 'flac'];
|
|
2399
535
|
this.pdfExtensions = ['pdf'];
|
|
536
|
+
this.binaryExtensions = [
|
|
537
|
+
'zip', 'tar', 'gz', 'rar', '7z', 'bz2', 'xz',
|
|
538
|
+
'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx',
|
|
539
|
+
'exe', 'dll', 'so', 'dylib', 'bin',
|
|
540
|
+
'dmg', 'iso', 'img',
|
|
541
|
+
'class', 'pyc', 'o', 'a', 'lib', 'wasm',
|
|
542
|
+
];
|
|
2400
543
|
}
|
|
2401
544
|
canPreview(extension) {
|
|
2402
545
|
const ext = extension.toLowerCase();
|
|
@@ -2433,7 +576,9 @@ let FilePreviewService = class FilePreviewService {
|
|
|
2433
576
|
return 'audio';
|
|
2434
577
|
if (this.isPdf(ext))
|
|
2435
578
|
return 'pdf';
|
|
2436
|
-
|
|
579
|
+
if (this.binaryExtensions.includes(ext))
|
|
580
|
+
return 'none';
|
|
581
|
+
return 'text';
|
|
2437
582
|
}
|
|
2438
583
|
getFileIcon(extension) {
|
|
2439
584
|
const ext = extension.toLowerCase();
|
|
@@ -2457,7 +602,7 @@ let FilePreviewService = class FilePreviewService {
|
|
|
2457
602
|
return '📽️';
|
|
2458
603
|
return '📎';
|
|
2459
604
|
}
|
|
2460
|
-
async generateTextPreview(content, maxLength =
|
|
605
|
+
async generateTextPreview(content, maxLength = 1_000_000) {
|
|
2461
606
|
const decoder = new TextDecoder('utf-8');
|
|
2462
607
|
const text = decoder.decode(content);
|
|
2463
608
|
if (text.length <= maxLength) {
|
|
@@ -2482,145 +627,7 @@ exports.FilePreviewService = FilePreviewService = tslib_1.__decorate([
|
|
|
2482
627
|
|
|
2483
628
|
|
|
2484
629
|
/***/ }),
|
|
2485
|
-
/*
|
|
2486
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
var _a, _b, _c;
|
|
2490
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2491
|
-
exports.FilesController = void 0;
|
|
2492
|
-
const tslib_1 = __webpack_require__(5);
|
|
2493
|
-
const common_1 = __webpack_require__(6);
|
|
2494
|
-
const s3_service_1 = __webpack_require__(47);
|
|
2495
|
-
const html_generator_service_1 = __webpack_require__(51);
|
|
2496
|
-
const file_preview_service_1 = __webpack_require__(52);
|
|
2497
|
-
let FilesController = class FilesController {
|
|
2498
|
-
constructor(s3Service, htmlGenerator, filePreviewService) {
|
|
2499
|
-
this.s3Service = s3Service;
|
|
2500
|
-
this.htmlGenerator = htmlGenerator;
|
|
2501
|
-
this.filePreviewService = filePreviewService;
|
|
2502
|
-
}
|
|
2503
|
-
async listFiles(bucket, prefix) {
|
|
2504
|
-
try {
|
|
2505
|
-
const { objects, commonPrefixes } = await this.s3Service.listObjects(bucket, prefix);
|
|
2506
|
-
const filesHtml = this.htmlGenerator.generateFileListHtml(objects, commonPrefixes, this.s3Service, prefix);
|
|
2507
|
-
const breadcrumbsHtml = this.htmlGenerator.generateBreadcrumbs(prefix || '', bucket);
|
|
2508
|
-
return {
|
|
2509
|
-
filesHtml,
|
|
2510
|
-
breadcrumbsHtml,
|
|
2511
|
-
objects: objects.length,
|
|
2512
|
-
folders: commonPrefixes.length
|
|
2513
|
-
};
|
|
2514
|
-
}
|
|
2515
|
-
catch (error) {
|
|
2516
|
-
console.error('Error listing files:', error);
|
|
2517
|
-
return {
|
|
2518
|
-
filesHtml: this.htmlGenerator.generateErrorHtml('Failed to load files'),
|
|
2519
|
-
breadcrumbsHtml: '',
|
|
2520
|
-
objects: 0,
|
|
2521
|
-
folders: 0
|
|
2522
|
-
};
|
|
2523
|
-
}
|
|
2524
|
-
}
|
|
2525
|
-
async previewFile(bucket, key) {
|
|
2526
|
-
try {
|
|
2527
|
-
const extension = this.s3Service.getFileExtension(key);
|
|
2528
|
-
const previewType = this.filePreviewService.getPreviewType(extension);
|
|
2529
|
-
const metadata = await this.s3Service.getObjectMetadata(bucket, key);
|
|
2530
|
-
let content = null;
|
|
2531
|
-
let presignedUrl;
|
|
2532
|
-
if (previewType === 'text') {
|
|
2533
|
-
const { body } = await this.s3Service.getObject(bucket, key);
|
|
2534
|
-
content = Buffer.from(body);
|
|
2535
|
-
}
|
|
2536
|
-
else if (previewType !== 'none') {
|
|
2537
|
-
presignedUrl = await this.s3Service.getPresignedViewUrl(bucket, key);
|
|
2538
|
-
}
|
|
2539
|
-
return this.htmlGenerator.generateFilePreviewHtml(key, previewType, content, metadata, this.s3Service, presignedUrl);
|
|
2540
|
-
}
|
|
2541
|
-
catch (error) {
|
|
2542
|
-
console.error('Error previewing file:', error);
|
|
2543
|
-
return this.htmlGenerator.generateErrorHtml('Failed to load preview');
|
|
2544
|
-
}
|
|
2545
|
-
}
|
|
2546
|
-
async downloadFile(bucket, key) {
|
|
2547
|
-
try {
|
|
2548
|
-
const url = await this.s3Service.getPresignedDownloadUrl(bucket, key);
|
|
2549
|
-
return { url };
|
|
2550
|
-
}
|
|
2551
|
-
catch (error) {
|
|
2552
|
-
console.error('Error generating download URL:', error);
|
|
2553
|
-
throw error;
|
|
2554
|
-
}
|
|
2555
|
-
}
|
|
2556
|
-
async deleteFile(body) {
|
|
2557
|
-
try {
|
|
2558
|
-
await this.s3Service.deleteObject(body.bucket, body.key);
|
|
2559
|
-
return { success: true };
|
|
2560
|
-
}
|
|
2561
|
-
catch (error) {
|
|
2562
|
-
console.error('Error deleting file:', error);
|
|
2563
|
-
throw error;
|
|
2564
|
-
}
|
|
2565
|
-
}
|
|
2566
|
-
async deleteFolder(body) {
|
|
2567
|
-
try {
|
|
2568
|
-
await this.s3Service.deleteFolder(body.bucket, body.prefix);
|
|
2569
|
-
return { success: true };
|
|
2570
|
-
}
|
|
2571
|
-
catch (error) {
|
|
2572
|
-
console.error('Error deleting folder:', error);
|
|
2573
|
-
throw error;
|
|
2574
|
-
}
|
|
2575
|
-
}
|
|
2576
|
-
};
|
|
2577
|
-
exports.FilesController = FilesController;
|
|
2578
|
-
tslib_1.__decorate([
|
|
2579
|
-
(0, common_1.Get)(),
|
|
2580
|
-
tslib_1.__param(0, (0, common_1.Query)('bucket')),
|
|
2581
|
-
tslib_1.__param(1, (0, common_1.Query)('prefix')),
|
|
2582
|
-
tslib_1.__metadata("design:type", Function),
|
|
2583
|
-
tslib_1.__metadata("design:paramtypes", [String, String]),
|
|
2584
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
2585
|
-
], FilesController.prototype, "listFiles", null);
|
|
2586
|
-
tslib_1.__decorate([
|
|
2587
|
-
(0, common_1.Get)('preview'),
|
|
2588
|
-
tslib_1.__param(0, (0, common_1.Query)('bucket')),
|
|
2589
|
-
tslib_1.__param(1, (0, common_1.Query)('key')),
|
|
2590
|
-
tslib_1.__metadata("design:type", Function),
|
|
2591
|
-
tslib_1.__metadata("design:paramtypes", [String, String]),
|
|
2592
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
2593
|
-
], FilesController.prototype, "previewFile", null);
|
|
2594
|
-
tslib_1.__decorate([
|
|
2595
|
-
(0, common_1.Get)('download'),
|
|
2596
|
-
tslib_1.__param(0, (0, common_1.Query)('bucket')),
|
|
2597
|
-
tslib_1.__param(1, (0, common_1.Query)('key')),
|
|
2598
|
-
tslib_1.__metadata("design:type", Function),
|
|
2599
|
-
tslib_1.__metadata("design:paramtypes", [String, String]),
|
|
2600
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
2601
|
-
], FilesController.prototype, "downloadFile", null);
|
|
2602
|
-
tslib_1.__decorate([
|
|
2603
|
-
(0, common_1.Post)('delete'),
|
|
2604
|
-
tslib_1.__param(0, (0, common_1.Body)()),
|
|
2605
|
-
tslib_1.__metadata("design:type", Function),
|
|
2606
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
2607
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
2608
|
-
], FilesController.prototype, "deleteFile", null);
|
|
2609
|
-
tslib_1.__decorate([
|
|
2610
|
-
(0, common_1.Post)('delete-folder'),
|
|
2611
|
-
tslib_1.__param(0, (0, common_1.Body)()),
|
|
2612
|
-
tslib_1.__metadata("design:type", Function),
|
|
2613
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
2614
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
2615
|
-
], FilesController.prototype, "deleteFolder", null);
|
|
2616
|
-
exports.FilesController = FilesController = tslib_1.__decorate([
|
|
2617
|
-
(0, common_1.Controller)('api/files'),
|
|
2618
|
-
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof s3_service_1.S3Service !== "undefined" && s3_service_1.S3Service) === "function" ? _a : Object, typeof (_b = typeof html_generator_service_1.HtmlGeneratorService !== "undefined" && html_generator_service_1.HtmlGeneratorService) === "function" ? _b : Object, typeof (_c = typeof file_preview_service_1.FilePreviewService !== "undefined" && file_preview_service_1.FilePreviewService) === "function" ? _c : Object])
|
|
2619
|
-
], FilesController);
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
/***/ }),
|
|
2623
|
-
/* 54 */
|
|
630
|
+
/* 16 */
|
|
2624
631
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2625
632
|
|
|
2626
633
|
|
|
@@ -2629,8 +636,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
2629
636
|
exports.UploadController = void 0;
|
|
2630
637
|
const tslib_1 = __webpack_require__(5);
|
|
2631
638
|
const common_1 = __webpack_require__(6);
|
|
2632
|
-
const platform_express_1 = __webpack_require__(
|
|
2633
|
-
const s3_service_1 = __webpack_require__(
|
|
639
|
+
const platform_express_1 = __webpack_require__(17);
|
|
640
|
+
const s3_service_1 = __webpack_require__(9);
|
|
2634
641
|
let UploadController = class UploadController {
|
|
2635
642
|
constructor(s3Service) {
|
|
2636
643
|
this.s3Service = s3Service;
|
|
@@ -2669,7 +676,7 @@ exports.UploadController = UploadController = tslib_1.__decorate([
|
|
|
2669
676
|
|
|
2670
677
|
|
|
2671
678
|
/***/ }),
|
|
2672
|
-
/*
|
|
679
|
+
/* 17 */
|
|
2673
680
|
/***/ ((module) => {
|
|
2674
681
|
|
|
2675
682
|
module.exports = require("@nestjs/platform-express");
|
|
@@ -2715,5 +722,4 @@ const index_1 = __webpack_require__(1);
|
|
|
2715
722
|
})();
|
|
2716
723
|
|
|
2717
724
|
/******/ })()
|
|
2718
|
-
;
|
|
2719
|
-
//# sourceMappingURL=main.js.map
|
|
725
|
+
;
|