@netlify/spark-ui 1.27.4 → 1.27.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/preact/DropZone/drop-core/index.js +13 -12
- package/dist/components/preact/DropZone/drop-core/readFiles.d.ts +8 -0
- package/dist/components/preact/DropZone/drop-core/readFiles.js +188 -179
- package/dist/components/preact/DropZone/useDropDeploy.js +19 -19
- package/package.json +1 -1
- package/packages/components/preact/DropZone/drop-core/readFiles.ts +18 -0
- package/packages/components/preact/DropZone/useDropDeploy.ts +6 -1
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { getDigest as
|
|
2
|
-
import { getSingleNonIndexHtmlFileName as
|
|
3
|
-
import { AnonymousDropClient as
|
|
4
|
-
import { deployFiles as
|
|
5
|
-
import { humanizeDropError as
|
|
1
|
+
import { getDigest as r } from "./digest.js";
|
|
2
|
+
import { getSingleNonIndexHtmlFileName as n, hasMultipleHtmlFilesWithoutIndex as l, readDataTransfer as i, readFileList as m, renameSingleNonIndexHtmlToIndex as a } from "./readFiles.js";
|
|
3
|
+
import { AnonymousDropClient as x } from "./client.js";
|
|
4
|
+
import { deployFiles as s } from "./deploy.js";
|
|
5
|
+
import { humanizeDropError as g } from "./errors.js";
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
x as AnonymousDropClient,
|
|
8
|
+
s as deployFiles,
|
|
9
|
+
r as getDigest,
|
|
10
|
+
n as getSingleNonIndexHtmlFileName,
|
|
11
11
|
l as hasMultipleHtmlFilesWithoutIndex,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
g as humanizeDropError,
|
|
13
|
+
i as readDataTransfer,
|
|
14
|
+
m as readFileList,
|
|
15
|
+
a as renameSingleNonIndexHtmlToIndex
|
|
15
16
|
};
|
|
@@ -11,3 +11,11 @@ export declare function readDataTransfer(dt: DataTransfer): Promise<ProcessedFil
|
|
|
11
11
|
export declare function readFileList(files: FileList): Promise<ProcessedFile[]>;
|
|
12
12
|
export declare function getSingleNonIndexHtmlFileName(files: ProcessedFile[]): string | null;
|
|
13
13
|
export declare function hasMultipleHtmlFilesWithoutIndex(files: ProcessedFile[]): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* When the set has no index.html but exactly one HTML file (a lone page
|
|
16
|
+
* alongside its assets, or a single dropped file), rename that file to
|
|
17
|
+
* index.html — keeping its directory — so it is served at the site root
|
|
18
|
+
* instead of 404ing. Content and sha are untouched. Any other set (already has
|
|
19
|
+
* an index, multiple HTML files, or no HTML) is returned unchanged.
|
|
20
|
+
*/
|
|
21
|
+
export declare function renameSingleNonIndexHtmlToIndex(files: ProcessedFile[]): ProcessedFile[];
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
var L = { exports: {} },
|
|
1
|
+
import { g as I } from "../../../../chunks/_commonjsHelpers.C6fGbg64.js";
|
|
2
|
+
var L = { exports: {} }, F = L.exports, M;
|
|
3
3
|
function z() {
|
|
4
4
|
return M || (M = 1, function(g, _) {
|
|
5
|
-
(function(
|
|
6
|
-
g.exports =
|
|
7
|
-
})(typeof self < "u" ? self :
|
|
5
|
+
(function(m, h) {
|
|
6
|
+
g.exports = h();
|
|
7
|
+
})(typeof self < "u" ? self : F, function() {
|
|
8
8
|
return (
|
|
9
9
|
/******/
|
|
10
|
-
function(
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
if (
|
|
14
|
-
return
|
|
15
|
-
var s =
|
|
10
|
+
function(y) {
|
|
11
|
+
var m = {};
|
|
12
|
+
function h(v) {
|
|
13
|
+
if (m[v])
|
|
14
|
+
return m[v].exports;
|
|
15
|
+
var s = m[v] = {
|
|
16
16
|
/******/
|
|
17
17
|
i: v,
|
|
18
18
|
/******/
|
|
@@ -21,19 +21,19 @@ function z() {
|
|
|
21
21
|
exports: {}
|
|
22
22
|
/******/
|
|
23
23
|
};
|
|
24
|
-
return
|
|
24
|
+
return y[v].call(s.exports, s, s.exports, h), s.l = !0, s.exports;
|
|
25
25
|
}
|
|
26
|
-
return
|
|
27
|
-
|
|
26
|
+
return h.m = y, h.c = m, h.d = function(v, s, w) {
|
|
27
|
+
h.o(v, s) || Object.defineProperty(v, s, {
|
|
28
28
|
/******/
|
|
29
29
|
configurable: !1,
|
|
30
30
|
/******/
|
|
31
31
|
enumerable: !0,
|
|
32
32
|
/******/
|
|
33
|
-
get:
|
|
33
|
+
get: w
|
|
34
34
|
/******/
|
|
35
35
|
});
|
|
36
|
-
},
|
|
36
|
+
}, h.n = function(v) {
|
|
37
37
|
var s = v && v.__esModule ? (
|
|
38
38
|
/******/
|
|
39
39
|
function() {
|
|
@@ -45,25 +45,25 @@ function z() {
|
|
|
45
45
|
return v;
|
|
46
46
|
}
|
|
47
47
|
);
|
|
48
|
-
return
|
|
49
|
-
},
|
|
48
|
+
return h.d(s, "a", s), s;
|
|
49
|
+
}, h.o = function(v, s) {
|
|
50
50
|
return Object.prototype.hasOwnProperty.call(v, s);
|
|
51
|
-
},
|
|
51
|
+
}, h.p = "", h(h.s = 3);
|
|
52
52
|
}([
|
|
53
53
|
/* 0 */
|
|
54
54
|
/***/
|
|
55
|
-
function(
|
|
55
|
+
function(y, m, h) {
|
|
56
56
|
function v(e, o) {
|
|
57
57
|
if (!(e instanceof o))
|
|
58
58
|
throw new TypeError("Cannot call a class as a function");
|
|
59
59
|
}
|
|
60
|
-
var s =
|
|
60
|
+
var s = h(5), w = h(1), u = w.toHex, f = w.ceilHeapSize, l = h(6), d = function(e) {
|
|
61
61
|
for (e += 9; e % 64 > 0; e += 1)
|
|
62
62
|
;
|
|
63
63
|
return e;
|
|
64
64
|
}, i = function(e, o) {
|
|
65
|
-
var n = new Uint8Array(e.buffer),
|
|
66
|
-
switch (
|
|
65
|
+
var n = new Uint8Array(e.buffer), p = o % 4, a = o - p;
|
|
66
|
+
switch (p) {
|
|
67
67
|
case 0:
|
|
68
68
|
n[a + 3] = 0;
|
|
69
69
|
case 1:
|
|
@@ -73,38 +73,38 @@ function z() {
|
|
|
73
73
|
case 3:
|
|
74
74
|
n[a + 0] = 0;
|
|
75
75
|
}
|
|
76
|
-
for (var
|
|
77
|
-
e[
|
|
76
|
+
for (var x = (o >> 2) + 1; x < e.length; x++)
|
|
77
|
+
e[x] = 0;
|
|
78
78
|
}, r = function(e, o, n) {
|
|
79
79
|
e[o >> 2] |= 128 << 24 - (o % 4 << 3), e[((o >> 2) + 2 & -16) + 14] = n / (1 << 29) | 0, e[((o >> 2) + 2 & -16) + 15] = n << 3;
|
|
80
80
|
}, t = function(e, o) {
|
|
81
|
-
var n = new Int32Array(e, o + 320, 5),
|
|
82
|
-
return a.setInt32(0, n[0], !1), a.setInt32(4, n[1], !1), a.setInt32(8, n[2], !1), a.setInt32(12, n[3], !1), a.setInt32(16, n[4], !1),
|
|
81
|
+
var n = new Int32Array(e, o + 320, 5), p = new Int32Array(5), a = new DataView(p.buffer);
|
|
82
|
+
return a.setInt32(0, n[0], !1), a.setInt32(4, n[1], !1), a.setInt32(8, n[2], !1), a.setInt32(12, n[3], !1), a.setInt32(16, n[4], !1), p;
|
|
83
83
|
}, c = function() {
|
|
84
84
|
function e(o) {
|
|
85
85
|
if (v(this, e), o = o || 64 * 1024, o % 64 > 0)
|
|
86
86
|
throw new Error("Chunk size must be a multiple of 128 bit");
|
|
87
87
|
this._offset = 0, this._maxChunkLen = o, this._padMaxChunkLen = d(o), this._heap = new ArrayBuffer(f(this._padMaxChunkLen + 320 + 20)), this._h32 = new Int32Array(this._heap), this._h8 = new Int8Array(this._heap), this._core = new s({ Int32Array }, {}, this._heap);
|
|
88
88
|
}
|
|
89
|
-
return e.prototype._initState = function(n,
|
|
89
|
+
return e.prototype._initState = function(n, p) {
|
|
90
90
|
this._offset = 0;
|
|
91
|
-
var a = new Int32Array(n,
|
|
91
|
+
var a = new Int32Array(n, p + 320, 5);
|
|
92
92
|
a[0] = 1732584193, a[1] = -271733879, a[2] = -1732584194, a[3] = 271733878, a[4] = -1009589776;
|
|
93
|
-
}, e.prototype._padChunk = function(n,
|
|
94
|
-
var a = d(n),
|
|
95
|
-
return i(
|
|
96
|
-
}, e.prototype._write = function(n,
|
|
97
|
-
l(n, this._h8, this._h32,
|
|
98
|
-
}, e.prototype._coreCall = function(n,
|
|
93
|
+
}, e.prototype._padChunk = function(n, p) {
|
|
94
|
+
var a = d(n), x = new Int32Array(this._heap, 0, a >> 2);
|
|
95
|
+
return i(x, n), r(x, n, p), a;
|
|
96
|
+
}, e.prototype._write = function(n, p, a, x) {
|
|
97
|
+
l(n, this._h8, this._h32, p, a, x || 0);
|
|
98
|
+
}, e.prototype._coreCall = function(n, p, a, x, b) {
|
|
99
99
|
var C = a;
|
|
100
|
-
this._write(n,
|
|
100
|
+
this._write(n, p, a), b && (C = this._padChunk(a, x)), this._core.hash(C, this._padMaxChunkLen);
|
|
101
101
|
}, e.prototype.rawDigest = function(n) {
|
|
102
|
-
var
|
|
102
|
+
var p = n.byteLength || n.length || n.size || 0;
|
|
103
103
|
this._initState(this._heap, this._padMaxChunkLen);
|
|
104
|
-
var a = 0,
|
|
105
|
-
for (a = 0;
|
|
106
|
-
this._coreCall(n, a,
|
|
107
|
-
return this._coreCall(n, a,
|
|
104
|
+
var a = 0, x = this._maxChunkLen;
|
|
105
|
+
for (a = 0; p > a + x; a += x)
|
|
106
|
+
this._coreCall(n, a, x, p, !1);
|
|
107
|
+
return this._coreCall(n, a, p - a, p, !0), t(this._heap, this._padMaxChunkLen);
|
|
108
108
|
}, e.prototype.digest = function(n) {
|
|
109
109
|
return u(this.rawDigest(n).buffer);
|
|
110
110
|
}, e.prototype.digestFromString = function(n) {
|
|
@@ -116,75 +116,75 @@ function z() {
|
|
|
116
116
|
}, e.prototype.resetState = function() {
|
|
117
117
|
return this._initState(this._heap, this._padMaxChunkLen), this;
|
|
118
118
|
}, e.prototype.append = function(n) {
|
|
119
|
-
var
|
|
120
|
-
for (this._offset += a;
|
|
121
|
-
|
|
119
|
+
var p = 0, a = n.byteLength || n.length || n.size || 0, x = this._offset % this._maxChunkLen, b = void 0;
|
|
120
|
+
for (this._offset += a; p < a; )
|
|
121
|
+
b = Math.min(a - p, this._maxChunkLen - x), this._write(n, p, b, x), x += b, p += b, x === this._maxChunkLen && (this._core.hash(this._maxChunkLen, this._padMaxChunkLen), x = 0);
|
|
122
122
|
return this;
|
|
123
123
|
}, e.prototype.getState = function() {
|
|
124
|
-
var n = this._offset % this._maxChunkLen,
|
|
124
|
+
var n = this._offset % this._maxChunkLen, p = void 0;
|
|
125
125
|
if (n)
|
|
126
|
-
|
|
126
|
+
p = this._heap.slice(0);
|
|
127
127
|
else {
|
|
128
128
|
var a = new Int32Array(this._heap, this._padMaxChunkLen + 320, 5);
|
|
129
|
-
|
|
129
|
+
p = a.buffer.slice(a.byteOffset, a.byteOffset + a.byteLength);
|
|
130
130
|
}
|
|
131
131
|
return {
|
|
132
132
|
offset: this._offset,
|
|
133
|
-
heap:
|
|
133
|
+
heap: p
|
|
134
134
|
};
|
|
135
135
|
}, e.prototype.setState = function(n) {
|
|
136
136
|
if (this._offset = n.offset, n.heap.byteLength === 20) {
|
|
137
|
-
var
|
|
138
|
-
|
|
137
|
+
var p = new Int32Array(this._heap, this._padMaxChunkLen + 320, 5);
|
|
138
|
+
p.set(new Int32Array(n.heap));
|
|
139
139
|
} else
|
|
140
140
|
this._h32.set(new Int32Array(n.heap));
|
|
141
141
|
return this;
|
|
142
142
|
}, e.prototype.rawEnd = function() {
|
|
143
|
-
var n = this._offset,
|
|
143
|
+
var n = this._offset, p = n % this._maxChunkLen, a = this._padChunk(p, n);
|
|
144
144
|
this._core.hash(a, this._padMaxChunkLen);
|
|
145
|
-
var
|
|
146
|
-
return this._initState(this._heap, this._padMaxChunkLen),
|
|
145
|
+
var x = t(this._heap, this._padMaxChunkLen);
|
|
146
|
+
return this._initState(this._heap, this._padMaxChunkLen), x;
|
|
147
147
|
}, e.prototype.end = function() {
|
|
148
148
|
return u(this.rawEnd().buffer);
|
|
149
149
|
}, e;
|
|
150
150
|
}();
|
|
151
|
-
|
|
151
|
+
y.exports = c, y.exports._core = s;
|
|
152
152
|
},
|
|
153
153
|
/* 1 */
|
|
154
154
|
/***/
|
|
155
|
-
function(
|
|
156
|
-
for (var
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
for (var
|
|
160
|
-
u[f] =
|
|
155
|
+
function(y, m) {
|
|
156
|
+
for (var h = new Array(256), v = 0; v < 256; v++)
|
|
157
|
+
h[v] = (v < 16 ? "0" : "") + v.toString(16);
|
|
158
|
+
y.exports.toHex = function(s) {
|
|
159
|
+
for (var w = new Uint8Array(s), u = new Array(s.byteLength), f = 0; f < u.length; f++)
|
|
160
|
+
u[f] = h[w[f]];
|
|
161
161
|
return u.join("");
|
|
162
|
-
},
|
|
163
|
-
var
|
|
162
|
+
}, y.exports.ceilHeapSize = function(s) {
|
|
163
|
+
var w = 0;
|
|
164
164
|
if (s <= 65536) return 65536;
|
|
165
165
|
if (s < 16777216)
|
|
166
|
-
for (
|
|
166
|
+
for (w = 1; w < s; w = w << 1)
|
|
167
167
|
;
|
|
168
168
|
else
|
|
169
|
-
for (
|
|
169
|
+
for (w = 16777216; w < s; w += 16777216)
|
|
170
170
|
;
|
|
171
|
-
return
|
|
172
|
-
},
|
|
173
|
-
var
|
|
174
|
-
return
|
|
171
|
+
return w;
|
|
172
|
+
}, y.exports.isDedicatedWorkerScope = function(s) {
|
|
173
|
+
var w = "WorkerGlobalScope" in s && s instanceof s.WorkerGlobalScope, u = "SharedWorkerGlobalScope" in s && s instanceof s.SharedWorkerGlobalScope, f = "ServiceWorkerGlobalScope" in s && s instanceof s.ServiceWorkerGlobalScope;
|
|
174
|
+
return w && !u && !f;
|
|
175
175
|
};
|
|
176
176
|
},
|
|
177
177
|
/* 2 */
|
|
178
178
|
/***/
|
|
179
|
-
function(
|
|
180
|
-
|
|
181
|
-
var v =
|
|
179
|
+
function(y, m, h) {
|
|
180
|
+
y.exports = function() {
|
|
181
|
+
var v = h(0), s = function(f, l, d) {
|
|
182
182
|
try {
|
|
183
183
|
return d(null, f.digest(l));
|
|
184
184
|
} catch (i) {
|
|
185
185
|
return d(i);
|
|
186
186
|
}
|
|
187
|
-
},
|
|
187
|
+
}, w = function(f, l, d, i, r) {
|
|
188
188
|
var t = new self.FileReader();
|
|
189
189
|
t.onloadend = function() {
|
|
190
190
|
if (t.error)
|
|
@@ -197,7 +197,7 @@ function z() {
|
|
|
197
197
|
r(o);
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
200
|
-
l < i.size ?
|
|
200
|
+
l < i.size ? w(f, l, d, i, r) : r(null, f.end());
|
|
201
201
|
}, t.readAsArrayBuffer(i.slice(l, l + d));
|
|
202
202
|
}, u = !0;
|
|
203
203
|
return self.onmessage = function(f) {
|
|
@@ -209,7 +209,7 @@ function z() {
|
|
|
209
209
|
var c = function(e, o) {
|
|
210
210
|
e ? self.postMessage({ id: i, error: e.name }) : self.postMessage({ id: i, hash: o });
|
|
211
211
|
};
|
|
212
|
-
l && s(t, l, c), d &&
|
|
212
|
+
l && s(t, l, c), d && w(t, 0, r, d, c);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
}, function() {
|
|
@@ -219,8 +219,8 @@ function z() {
|
|
|
219
219
|
},
|
|
220
220
|
/* 3 */
|
|
221
221
|
/***/
|
|
222
|
-
function(
|
|
223
|
-
var v =
|
|
222
|
+
function(y, m, h) {
|
|
223
|
+
var v = h(4), s = h(0), w = h(7), u = h(2), f = h(1), l = f.isDedicatedWorkerScope, d = typeof self < "u" && l(self);
|
|
224
224
|
s.disableWorkerBehaviour = d ? u() : function() {
|
|
225
225
|
}, s.createWorker = function() {
|
|
226
226
|
var i = v(
|
|
@@ -230,11 +230,11 @@ function z() {
|
|
|
230
230
|
return i.terminate = function() {
|
|
231
231
|
URL.revokeObjectURL(i.objectURL), r.call(i);
|
|
232
232
|
}, i;
|
|
233
|
-
}, s.createHash =
|
|
233
|
+
}, s.createHash = w, y.exports = s;
|
|
234
234
|
},
|
|
235
235
|
/* 4 */
|
|
236
236
|
/***/
|
|
237
|
-
function(
|
|
237
|
+
function(y, m, h) {
|
|
238
238
|
function v(i) {
|
|
239
239
|
var r = {};
|
|
240
240
|
function t(e) {
|
|
@@ -286,7 +286,7 @@ function z() {
|
|
|
286
286
|
var c = t(t.s = ENTRY_MODULE);
|
|
287
287
|
return c.default || c;
|
|
288
288
|
}
|
|
289
|
-
var s = "[\\.|\\-|\\+|\\w|/|@]+",
|
|
289
|
+
var s = "[\\.|\\-|\\+|\\w|/|@]+", w = "\\((/\\*.*?\\*/)?s?.*?(" + s + ").*?\\)";
|
|
290
290
|
function u(i) {
|
|
291
291
|
return (i + "").replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
|
|
292
292
|
}
|
|
@@ -295,10 +295,10 @@ function z() {
|
|
|
295
295
|
c[t] = [];
|
|
296
296
|
var e = r.toString(), o = e.match(/^function\s?\(\w+,\s*\w+,\s*(\w+)\)/);
|
|
297
297
|
if (!o) return c;
|
|
298
|
-
for (var n = o[1],
|
|
298
|
+
for (var n = o[1], p = new RegExp("(\\\\n|\\W)" + u(n) + w, "g"), a; a = p.exec(e); )
|
|
299
299
|
a[3] !== "dll-reference" && c[t].push(a[3]);
|
|
300
|
-
for (
|
|
301
|
-
i[a[2]] || (c[t].push(a[1]), i[a[2]] =
|
|
300
|
+
for (p = new RegExp("\\(" + u(n) + '\\("(dll-reference\\s(' + s + '))"\\)\\)' + w, "g"); a = p.exec(e); )
|
|
301
|
+
i[a[2]] || (c[t].push(a[1]), i[a[2]] = h(a[1]).m), c[a[2]] = c[a[2]] || [], c[a[2]].push(a[4]);
|
|
302
302
|
return c;
|
|
303
303
|
}
|
|
304
304
|
function l(i) {
|
|
@@ -316,69 +316,69 @@ function z() {
|
|
|
316
316
|
main: {}
|
|
317
317
|
}; l(t); )
|
|
318
318
|
for (var o = Object.keys(t), n = 0; n < o.length; n++) {
|
|
319
|
-
var
|
|
320
|
-
if (e[
|
|
321
|
-
e[
|
|
322
|
-
for (var
|
|
323
|
-
t[C[S]] = t[C[S]] || [], t[C[S]] = t[C[S]].concat(
|
|
319
|
+
var p = o[n], a = t[p], x = a.pop();
|
|
320
|
+
if (e[p] = e[p] || {}, !(e[p][x] || !i[p][x])) {
|
|
321
|
+
e[p][x] = !0, c[p] = c[p] || [], c[p].push(x);
|
|
322
|
+
for (var b = f(i, i[p][x], p), C = Object.keys(b), S = 0; S < C.length; S++)
|
|
323
|
+
t[C[S]] = t[C[S]] || [], t[C[S]] = t[C[S]].concat(b[C[S]]);
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
return c;
|
|
327
327
|
}
|
|
328
|
-
|
|
328
|
+
y.exports = function(i, r) {
|
|
329
329
|
r = r || {};
|
|
330
330
|
var t = {
|
|
331
|
-
main:
|
|
331
|
+
main: h.m
|
|
332
332
|
}, c = r.all ? { main: Object.keys(t) } : d(t, i), e = "";
|
|
333
|
-
Object.keys(c).filter(function(
|
|
334
|
-
return
|
|
335
|
-
}).forEach(function(
|
|
336
|
-
for (var
|
|
337
|
-
|
|
338
|
-
c[
|
|
339
|
-
return "" + JSON.stringify(C) + ": " + t[
|
|
333
|
+
Object.keys(c).filter(function(x) {
|
|
334
|
+
return x !== "main";
|
|
335
|
+
}).forEach(function(x) {
|
|
336
|
+
for (var b = 0; c[x][b]; )
|
|
337
|
+
b++;
|
|
338
|
+
c[x].push(b), t[x][b] = "(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })", e = e + "var " + x + " = (" + v.toString().replace("ENTRY_MODULE", JSON.stringify(b)) + ")({" + c[x].map(function(C) {
|
|
339
|
+
return "" + JSON.stringify(C) + ": " + t[x][C].toString();
|
|
340
340
|
}).join(",") + `});
|
|
341
341
|
`;
|
|
342
|
-
}), e = e + "(" + v.toString().replace("ENTRY_MODULE", JSON.stringify(i)) + ")({" + c.main.map(function(
|
|
343
|
-
return "" + JSON.stringify(
|
|
342
|
+
}), e = e + "(" + v.toString().replace("ENTRY_MODULE", JSON.stringify(i)) + ")({" + c.main.map(function(x) {
|
|
343
|
+
return "" + JSON.stringify(x) + ": " + t.main[x].toString();
|
|
344
344
|
}).join(",") + "})(self);";
|
|
345
345
|
var o = new window.Blob([e], { type: "text/javascript" });
|
|
346
346
|
if (r.bare)
|
|
347
347
|
return o;
|
|
348
|
-
var n = window.URL || window.webkitURL || window.mozURL || window.msURL,
|
|
349
|
-
return a.objectURL =
|
|
348
|
+
var n = window.URL || window.webkitURL || window.mozURL || window.msURL, p = n.createObjectURL(o), a = new window.Worker(p);
|
|
349
|
+
return a.objectURL = p, a;
|
|
350
350
|
};
|
|
351
351
|
},
|
|
352
352
|
/* 5 */
|
|
353
353
|
/***/
|
|
354
|
-
function(
|
|
355
|
-
|
|
356
|
-
var u = new v.Int32Array(
|
|
354
|
+
function(y, m) {
|
|
355
|
+
y.exports = function(v, s, w) {
|
|
356
|
+
var u = new v.Int32Array(w);
|
|
357
357
|
function f(l, d) {
|
|
358
358
|
l = l | 0, d = d | 0;
|
|
359
|
-
var i = 0, r = 0, t = 0, c = 0, e = 0, o = 0, n = 0,
|
|
360
|
-
for (t = u[d + 320 >> 2] | 0, e = u[d + 324 >> 2] | 0, n = u[d + 328 >> 2] | 0, a = u[d + 332 >> 2] | 0,
|
|
361
|
-
for (c = t, o = e,
|
|
362
|
-
A = u[i + r >> 2] | 0, S = ((t << 5 | t >>> 27) + (e & n | ~e & a) | 0) + ((A +
|
|
359
|
+
var i = 0, r = 0, t = 0, c = 0, e = 0, o = 0, n = 0, p = 0, a = 0, x = 0, b = 0, C = 0, S = 0, A = 0;
|
|
360
|
+
for (t = u[d + 320 >> 2] | 0, e = u[d + 324 >> 2] | 0, n = u[d + 328 >> 2] | 0, a = u[d + 332 >> 2] | 0, b = u[d + 336 >> 2] | 0, i = 0; (i | 0) < (l | 0); i = i + 64 | 0) {
|
|
361
|
+
for (c = t, o = e, p = n, x = a, C = b, r = 0; (r | 0) < 64; r = r + 4 | 0)
|
|
362
|
+
A = u[i + r >> 2] | 0, S = ((t << 5 | t >>> 27) + (e & n | ~e & a) | 0) + ((A + b | 0) + 1518500249 | 0) | 0, b = a, a = n, n = e << 30 | e >>> 2, e = t, t = S, u[l + r >> 2] = A;
|
|
363
363
|
for (r = l + 64 | 0; (r | 0) < (l + 80 | 0); r = r + 4 | 0)
|
|
364
|
-
A = (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) << 1 | (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) >>> 31, S = ((t << 5 | t >>> 27) + (e & n | ~e & a) | 0) + ((A +
|
|
364
|
+
A = (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) << 1 | (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) >>> 31, S = ((t << 5 | t >>> 27) + (e & n | ~e & a) | 0) + ((A + b | 0) + 1518500249 | 0) | 0, b = a, a = n, n = e << 30 | e >>> 2, e = t, t = S, u[r >> 2] = A;
|
|
365
365
|
for (r = l + 80 | 0; (r | 0) < (l + 160 | 0); r = r + 4 | 0)
|
|
366
|
-
A = (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) << 1 | (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) >>> 31, S = ((t << 5 | t >>> 27) + (e ^ n ^ a) | 0) + ((A +
|
|
366
|
+
A = (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) << 1 | (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) >>> 31, S = ((t << 5 | t >>> 27) + (e ^ n ^ a) | 0) + ((A + b | 0) + 1859775393 | 0) | 0, b = a, a = n, n = e << 30 | e >>> 2, e = t, t = S, u[r >> 2] = A;
|
|
367
367
|
for (r = l + 160 | 0; (r | 0) < (l + 240 | 0); r = r + 4 | 0)
|
|
368
|
-
A = (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) << 1 | (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) >>> 31, S = ((t << 5 | t >>> 27) + (e & n | e & a | n & a) | 0) + ((A +
|
|
368
|
+
A = (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) << 1 | (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) >>> 31, S = ((t << 5 | t >>> 27) + (e & n | e & a | n & a) | 0) + ((A + b | 0) - 1894007588 | 0) | 0, b = a, a = n, n = e << 30 | e >>> 2, e = t, t = S, u[r >> 2] = A;
|
|
369
369
|
for (r = l + 240 | 0; (r | 0) < (l + 320 | 0); r = r + 4 | 0)
|
|
370
|
-
A = (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) << 1 | (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) >>> 31, S = ((t << 5 | t >>> 27) + (e ^ n ^ a) | 0) + ((A +
|
|
371
|
-
t = t + c | 0, e = e + o | 0, n = n +
|
|
370
|
+
A = (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) << 1 | (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) >>> 31, S = ((t << 5 | t >>> 27) + (e ^ n ^ a) | 0) + ((A + b | 0) - 899497514 | 0) | 0, b = a, a = n, n = e << 30 | e >>> 2, e = t, t = S, u[r >> 2] = A;
|
|
371
|
+
t = t + c | 0, e = e + o | 0, n = n + p | 0, a = a + x | 0, b = b + C | 0;
|
|
372
372
|
}
|
|
373
|
-
u[d + 320 >> 2] = t, u[d + 324 >> 2] = e, u[d + 328 >> 2] = n, u[d + 332 >> 2] = a, u[d + 336 >> 2] =
|
|
373
|
+
u[d + 320 >> 2] = t, u[d + 324 >> 2] = e, u[d + 328 >> 2] = n, u[d + 332 >> 2] = a, u[d + 336 >> 2] = b;
|
|
374
374
|
}
|
|
375
375
|
return { hash: f };
|
|
376
376
|
};
|
|
377
377
|
},
|
|
378
378
|
/* 6 */
|
|
379
379
|
/***/
|
|
380
|
-
function(
|
|
381
|
-
var
|
|
380
|
+
function(y, m) {
|
|
381
|
+
var h = this, v = void 0;
|
|
382
382
|
typeof self < "u" && typeof self.FileReaderSync < "u" && (v = new self.FileReaderSync());
|
|
383
383
|
var s = function(f, l, d, i, r, t) {
|
|
384
384
|
var c = void 0, e = t % 4, o = (r + e) % 4, n = r - o;
|
|
@@ -404,7 +404,7 @@ function z() {
|
|
|
404
404
|
l[t + n + 3 | 0] = f.charCodeAt(i + n);
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
|
-
},
|
|
407
|
+
}, w = function(f, l, d, i, r, t) {
|
|
408
408
|
var c = void 0, e = t % 4, o = (r + e) % 4, n = r - o;
|
|
409
409
|
switch (e) {
|
|
410
410
|
case 0:
|
|
@@ -429,39 +429,39 @@ function z() {
|
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
}, u = function(f, l, d, i, r, t) {
|
|
432
|
-
var c = void 0, e = t % 4, o = (r + e) % 4, n = r - o,
|
|
432
|
+
var c = void 0, e = t % 4, o = (r + e) % 4, n = r - o, p = new Uint8Array(v.readAsArrayBuffer(f.slice(i, i + r)));
|
|
433
433
|
switch (e) {
|
|
434
434
|
case 0:
|
|
435
|
-
l[t] =
|
|
435
|
+
l[t] = p[3];
|
|
436
436
|
case 1:
|
|
437
|
-
l[t + 1 - (e << 1) | 0] =
|
|
437
|
+
l[t + 1 - (e << 1) | 0] = p[2];
|
|
438
438
|
case 2:
|
|
439
|
-
l[t + 2 - (e << 1) | 0] =
|
|
439
|
+
l[t + 2 - (e << 1) | 0] = p[1];
|
|
440
440
|
case 3:
|
|
441
|
-
l[t + 3 - (e << 1) | 0] =
|
|
441
|
+
l[t + 3 - (e << 1) | 0] = p[0];
|
|
442
442
|
}
|
|
443
443
|
if (!(r < o + (4 - e))) {
|
|
444
444
|
for (c = 4 - e; c < n; c = c + 4 | 0)
|
|
445
|
-
d[t + c >> 2 | 0] =
|
|
445
|
+
d[t + c >> 2 | 0] = p[c] << 24 | p[c + 1] << 16 | p[c + 2] << 8 | p[c + 3];
|
|
446
446
|
switch (o) {
|
|
447
447
|
case 3:
|
|
448
|
-
l[t + n + 1 | 0] =
|
|
448
|
+
l[t + n + 1 | 0] = p[n + 2];
|
|
449
449
|
case 2:
|
|
450
|
-
l[t + n + 2 | 0] =
|
|
450
|
+
l[t + n + 2 | 0] = p[n + 1];
|
|
451
451
|
case 1:
|
|
452
|
-
l[t + n + 3 | 0] =
|
|
452
|
+
l[t + n + 3 | 0] = p[n];
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
455
|
};
|
|
456
|
-
|
|
456
|
+
y.exports = function(f, l, d, i, r, t) {
|
|
457
457
|
if (typeof f == "string")
|
|
458
458
|
return s(f, l, d, i, r, t);
|
|
459
|
-
if (f instanceof Array ||
|
|
460
|
-
return
|
|
459
|
+
if (f instanceof Array || h && h.Buffer && h.Buffer.isBuffer(f))
|
|
460
|
+
return w(f, l, d, i, r, t);
|
|
461
461
|
if (f instanceof ArrayBuffer)
|
|
462
|
-
return
|
|
462
|
+
return w(new Uint8Array(f), l, d, i, r, t);
|
|
463
463
|
if (f.buffer instanceof ArrayBuffer)
|
|
464
|
-
return
|
|
464
|
+
return w(new Uint8Array(f.buffer, f.byteOffset, f.byteLength), l, d, i, r, t);
|
|
465
465
|
if (f instanceof Blob)
|
|
466
466
|
return u(f, l, d, i, r, t);
|
|
467
467
|
throw new Error("Unsupported data type.");
|
|
@@ -469,7 +469,7 @@ function z() {
|
|
|
469
469
|
},
|
|
470
470
|
/* 7 */
|
|
471
471
|
/***/
|
|
472
|
-
function(
|
|
472
|
+
function(y, m, h) {
|
|
473
473
|
var v = /* @__PURE__ */ function() {
|
|
474
474
|
function d(i, r) {
|
|
475
475
|
for (var t = 0; t < r.length; t++) {
|
|
@@ -485,9 +485,9 @@ function z() {
|
|
|
485
485
|
if (!(d instanceof i))
|
|
486
486
|
throw new TypeError("Cannot call a class as a function");
|
|
487
487
|
}
|
|
488
|
-
var
|
|
488
|
+
var w = h(0), u = h(1), f = u.toHex, l = function() {
|
|
489
489
|
function d() {
|
|
490
|
-
s(this, d), this._rusha = new
|
|
490
|
+
s(this, d), this._rusha = new w(), this._rusha.resetState();
|
|
491
491
|
}
|
|
492
492
|
return d.prototype.update = function(r) {
|
|
493
493
|
return this._rusha.append(r), this;
|
|
@@ -508,7 +508,7 @@ function z() {
|
|
|
508
508
|
}
|
|
509
509
|
}]), d;
|
|
510
510
|
}();
|
|
511
|
-
|
|
511
|
+
y.exports = function() {
|
|
512
512
|
return new l();
|
|
513
513
|
};
|
|
514
514
|
}
|
|
@@ -519,43 +519,43 @@ function z() {
|
|
|
519
519
|
}(L)), L.exports;
|
|
520
520
|
}
|
|
521
521
|
var P = z();
|
|
522
|
-
const G = /* @__PURE__ */
|
|
523
|
-
function O(g, _,
|
|
522
|
+
const G = /* @__PURE__ */ I(P), J = new G(), R = (g) => g.startsWith(".") || g === "__MACOSX" || g === "node_modules", $ = (g) => g.split("/").some((_) => _ && R(_)), k = (g) => g.startsWith("/") ? g : `/${g}`;
|
|
523
|
+
function O(g, _, y) {
|
|
524
524
|
return {
|
|
525
525
|
path: k(g),
|
|
526
526
|
size: _.byteLength,
|
|
527
527
|
sha: J.digest(_),
|
|
528
528
|
content: _,
|
|
529
|
-
name:
|
|
529
|
+
name: y
|
|
530
530
|
};
|
|
531
531
|
}
|
|
532
532
|
async function D(g) {
|
|
533
|
-
const _ = await new Promise((
|
|
534
|
-
return O(g.fullPath,
|
|
533
|
+
const _ = await new Promise((m, h) => g.file(m, h)), y = await _.arrayBuffer();
|
|
534
|
+
return O(g.fullPath, y, _.name);
|
|
535
535
|
}
|
|
536
536
|
async function B(g) {
|
|
537
|
-
const _ = g.createReader(),
|
|
537
|
+
const _ = g.createReader(), y = [];
|
|
538
538
|
for (; ; ) {
|
|
539
|
-
const
|
|
540
|
-
if (!
|
|
541
|
-
for (const
|
|
542
|
-
R(
|
|
539
|
+
const m = await new Promise((h, v) => _.readEntries(h, v));
|
|
540
|
+
if (!m.length) break;
|
|
541
|
+
for (const h of m)
|
|
542
|
+
R(h.name) || y.push(...h.isDirectory ? await B(h) : [await D(h)]);
|
|
543
543
|
}
|
|
544
|
-
return
|
|
544
|
+
return y;
|
|
545
545
|
}
|
|
546
|
-
async function
|
|
547
|
-
var
|
|
548
|
-
const _ = (
|
|
546
|
+
async function Z(g) {
|
|
547
|
+
var h;
|
|
548
|
+
const _ = (h = g.files) == null ? void 0 : h[0];
|
|
549
549
|
if (g.files.length === 1 && _ && /\.zip$/i.test(_.name))
|
|
550
550
|
return U(_);
|
|
551
|
-
const
|
|
551
|
+
const m = Array.from(g.items ?? []).map((v) => {
|
|
552
552
|
var s;
|
|
553
553
|
return (s = v.webkitGetAsEntry) == null ? void 0 : s.call(v);
|
|
554
554
|
}).filter(Boolean);
|
|
555
|
-
if (
|
|
555
|
+
if (m.length) {
|
|
556
556
|
const v = await Promise.all(
|
|
557
|
-
|
|
558
|
-
(s) => R(s.name) ? [] : s.isDirectory ? B(s) : D(s).then((
|
|
557
|
+
m.map(
|
|
558
|
+
(s) => R(s.name) ? [] : s.isDirectory ? B(s) : D(s).then((w) => [w])
|
|
559
559
|
)
|
|
560
560
|
);
|
|
561
561
|
return E(v.flat());
|
|
@@ -566,53 +566,62 @@ async function Y(g) {
|
|
|
566
566
|
const _ = Array.from(g);
|
|
567
567
|
if (_.length === 1 && /\.zip$/i.test(_[0].name))
|
|
568
568
|
return U(_[0]);
|
|
569
|
-
const
|
|
570
|
-
for (const
|
|
571
|
-
const
|
|
572
|
-
|
|
569
|
+
const y = [];
|
|
570
|
+
for (const m of _) {
|
|
571
|
+
const h = m.webkitRelativePath || m.name;
|
|
572
|
+
y.push(O(h, await m.arrayBuffer(), m.name));
|
|
573
573
|
}
|
|
574
|
-
return E(
|
|
574
|
+
return E(y);
|
|
575
575
|
}
|
|
576
576
|
async function U(g) {
|
|
577
|
-
const { unzip: _ } = await import("../../../../chunks/browser.D58rdxmc.js"),
|
|
578
|
-
(v, s) => _(
|
|
579
|
-
),
|
|
580
|
-
for (const [v, s] of Object.entries(
|
|
577
|
+
const { unzip: _ } = await import("../../../../chunks/browser.D58rdxmc.js"), y = new Uint8Array(await g.arrayBuffer()), m = await new Promise(
|
|
578
|
+
(v, s) => _(y, (w, u) => w ? s(w) : v(u))
|
|
579
|
+
), h = [];
|
|
580
|
+
for (const [v, s] of Object.entries(m)) {
|
|
581
581
|
if (v.endsWith("/") || $(v)) continue;
|
|
582
|
-
const
|
|
582
|
+
const w = s.buffer.slice(
|
|
583
583
|
s.byteOffset,
|
|
584
584
|
s.byteOffset + s.byteLength
|
|
585
585
|
);
|
|
586
|
-
|
|
586
|
+
h.push(O(v, w, v.split("/").pop()));
|
|
587
587
|
}
|
|
588
|
-
return E(
|
|
588
|
+
return E(h);
|
|
589
589
|
}
|
|
590
590
|
function E(g) {
|
|
591
591
|
if (!g.length) return g;
|
|
592
|
-
const _ = (
|
|
593
|
-
let
|
|
594
|
-
for (const
|
|
595
|
-
const v = _(
|
|
592
|
+
const _ = (h) => k(h).split("/").slice(1);
|
|
593
|
+
let y = _(g[0].path).slice(0, -1);
|
|
594
|
+
for (const h of g) {
|
|
595
|
+
const v = _(h.path);
|
|
596
596
|
let s = 0;
|
|
597
|
-
for (; s <
|
|
598
|
-
|
|
597
|
+
for (; s < y.length && s < v.length - 1 && y[s] === v[s]; ) s++;
|
|
598
|
+
y = y.slice(0, s);
|
|
599
599
|
}
|
|
600
|
-
if (!
|
|
601
|
-
const
|
|
602
|
-
return g.map((
|
|
600
|
+
if (!y.length) return g;
|
|
601
|
+
const m = "/" + y.join("/");
|
|
602
|
+
return g.map((h) => ({ ...h, path: k(h.path.slice(m.length)) }));
|
|
603
603
|
}
|
|
604
604
|
const W = (g) => g.filter((_) => /\.html?$/i.test(_.name)), j = (g) => g.some((_) => /^index\.html?$/i.test(_.name));
|
|
605
|
-
function
|
|
605
|
+
function Q(g) {
|
|
606
606
|
const _ = W(g);
|
|
607
607
|
return j(_) ? null : _.length === 1 ? _[0].name : null;
|
|
608
608
|
}
|
|
609
|
-
function
|
|
609
|
+
function N(g) {
|
|
610
610
|
const _ = W(g);
|
|
611
611
|
return _.length > 1 && !j(_);
|
|
612
612
|
}
|
|
613
|
+
function X(g) {
|
|
614
|
+
const _ = Q(g);
|
|
615
|
+
return _ ? g.map((y) => {
|
|
616
|
+
if (y.name !== _) return y;
|
|
617
|
+
const m = y.path.lastIndexOf("/"), h = m === -1 ? "" : y.path.slice(0, m);
|
|
618
|
+
return { ...y, name: "index.html", path: k(`${h}/index.html`) };
|
|
619
|
+
}) : g;
|
|
620
|
+
}
|
|
613
621
|
export {
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
Y as readFileList
|
|
622
|
+
Q as getSingleNonIndexHtmlFileName,
|
|
623
|
+
N as hasMultipleHtmlFilesWithoutIndex,
|
|
624
|
+
Z as readDataTransfer,
|
|
625
|
+
Y as readFileList,
|
|
626
|
+
X as renameSingleNonIndexHtmlToIndex
|
|
618
627
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { d as p, A as
|
|
2
|
-
import { getSingleNonIndexHtmlFileName as b, hasMultipleHtmlFilesWithoutIndex as
|
|
3
|
-
import { AnonymousDropClient as
|
|
4
|
-
import { deployFiles as
|
|
1
|
+
import { d as p, A as I } from "../../../chunks/hooks.module.DRcxknIz.js";
|
|
2
|
+
import { renameSingleNonIndexHtmlToIndex as S, getSingleNonIndexHtmlFileName as b, hasMultipleHtmlFilesWithoutIndex as z } from "./drop-core/readFiles.js";
|
|
3
|
+
import { AnonymousDropClient as F } from "./drop-core/client.js";
|
|
4
|
+
import { deployFiles as H } from "./drop-core/deploy.js";
|
|
5
5
|
import { humanizeDropError as E } from "./drop-core/errors.js";
|
|
6
|
-
function
|
|
6
|
+
function W(e) {
|
|
7
7
|
switch (e.phase) {
|
|
8
8
|
case "creating":
|
|
9
9
|
return { kind: "creating" };
|
|
@@ -14,51 +14,51 @@ function H(e) {
|
|
|
14
14
|
return { kind: "processing" };
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function $(e) {
|
|
18
18
|
const d = b(e);
|
|
19
|
-
return d ? `No index.html found — "${d}" won’t be served at the site root.` :
|
|
19
|
+
return d ? `No index.html found — "${d}" won’t be served at the site root.` : z(e) ? "No index.html found — your site may not have a landing page." : null;
|
|
20
20
|
}
|
|
21
21
|
function P({
|
|
22
22
|
apiBase: e,
|
|
23
23
|
client: d,
|
|
24
24
|
claimUrl: f,
|
|
25
|
-
onDeploy:
|
|
26
|
-
track:
|
|
25
|
+
onDeploy: l,
|
|
26
|
+
track: a
|
|
27
27
|
}) {
|
|
28
|
-
const [u, t] = p({ kind: "idle" }), [g, c] = p(null), h =
|
|
28
|
+
const [u, t] = p({ kind: "idle" }), [g, c] = p(null), h = I(d ?? new F(e)).current, y = u.kind !== "idle" && u.kind !== "error";
|
|
29
29
|
async function k(N, s) {
|
|
30
30
|
c(null), t({ kind: "reading" });
|
|
31
31
|
const m = (n, i, o) => {
|
|
32
|
-
t({ kind: "error", message: n }),
|
|
33
|
-
},
|
|
32
|
+
t({ kind: "error", message: n }), a("dropzone_deploy_failed", { method: s, reason: i, ...o });
|
|
33
|
+
}, x = (n, i) => {
|
|
34
34
|
const o = n instanceof Error ? n.message : String(n);
|
|
35
35
|
m(E(n), o, i);
|
|
36
36
|
};
|
|
37
37
|
try {
|
|
38
|
-
const n = await N();
|
|
38
|
+
const n = S(await N());
|
|
39
39
|
if (!n.length) {
|
|
40
40
|
m("No files found to deploy.", "No files found to deploy.", { file_count: 0 });
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
|
-
s === "drag" &&
|
|
43
|
+
s === "drag" && a("dropzone_files_dropped", { method: s, file_count: n.length }), c($(n));
|
|
44
44
|
const {
|
|
45
45
|
url: i,
|
|
46
46
|
token: o,
|
|
47
47
|
deploy: r
|
|
48
|
-
} = await
|
|
49
|
-
onProgress: (
|
|
48
|
+
} = await H(h, n, {
|
|
49
|
+
onProgress: (w) => t(W(w))
|
|
50
50
|
});
|
|
51
51
|
try {
|
|
52
52
|
localStorage.setItem("drop-token", o), localStorage.setItem("dropSiteName", r.subdomain);
|
|
53
53
|
} catch {
|
|
54
54
|
}
|
|
55
|
-
t({ kind: "redirecting" }),
|
|
55
|
+
t({ kind: "redirecting" }), a("dropzone_deploy_succeeded", {
|
|
56
56
|
method: s,
|
|
57
57
|
site_name: r.subdomain,
|
|
58
58
|
file_count: n.length
|
|
59
|
-
}),
|
|
59
|
+
}), l == null || l({ url: i, token: o, siteName: r.subdomain, siteId: r.id }), window.location.assign(`${f(r.subdomain)}#drop_token=${o}`);
|
|
60
60
|
} catch (n) {
|
|
61
|
-
|
|
61
|
+
x(n);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
function _() {
|
package/package.json
CHANGED
|
@@ -146,3 +146,21 @@ export function hasMultipleHtmlFilesWithoutIndex(files: ProcessedFile[]): boolea
|
|
|
146
146
|
const html = htmlFiles(files);
|
|
147
147
|
return html.length > 1 && !hasIndex(html);
|
|
148
148
|
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* When the set has no index.html but exactly one HTML file (a lone page
|
|
152
|
+
* alongside its assets, or a single dropped file), rename that file to
|
|
153
|
+
* index.html — keeping its directory — so it is served at the site root
|
|
154
|
+
* instead of 404ing. Content and sha are untouched. Any other set (already has
|
|
155
|
+
* an index, multiple HTML files, or no HTML) is returned unchanged.
|
|
156
|
+
*/
|
|
157
|
+
export function renameSingleNonIndexHtmlToIndex(files: ProcessedFile[]): ProcessedFile[] {
|
|
158
|
+
const name = getSingleNonIndexHtmlFileName(files);
|
|
159
|
+
if (!name) return files;
|
|
160
|
+
return files.map(f => {
|
|
161
|
+
if (f.name !== name) return f;
|
|
162
|
+
const slash = f.path.lastIndexOf('/');
|
|
163
|
+
const dir = slash === -1 ? '' : f.path.slice(0, slash);
|
|
164
|
+
return { ...f, name: 'index.html', path: slashPrefix(`${dir}/index.html`) };
|
|
165
|
+
});
|
|
166
|
+
}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
getSingleNonIndexHtmlFileName,
|
|
6
6
|
hasMultipleHtmlFilesWithoutIndex,
|
|
7
7
|
humanizeDropError,
|
|
8
|
+
renameSingleNonIndexHtmlToIndex,
|
|
8
9
|
type DeployProgress,
|
|
9
10
|
type DropClient,
|
|
10
11
|
type ProcessedFile,
|
|
@@ -106,7 +107,11 @@ export function useDropDeploy({
|
|
|
106
107
|
};
|
|
107
108
|
|
|
108
109
|
try {
|
|
109
|
-
|
|
110
|
+
// Auto-rename a lone non-index HTML file to index.html so it is served at
|
|
111
|
+
// the site root. Detection (getSingleNonIndexHtmlFileName) sits on the
|
|
112
|
+
// read side; recompute the warning on the renamed set so the fixable
|
|
113
|
+
// single-file case no longer warns and only the multi-HTML case does.
|
|
114
|
+
const files = renameSingleNonIndexHtmlToIndex(await read());
|
|
110
115
|
if (!files.length) {
|
|
111
116
|
fail('No files found to deploy.', 'No files found to deploy.', { file_count: 0 });
|
|
112
117
|
return;
|