@netlify/spark-ui 1.26.1-alpha.1 → 1.27.0
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/README.md +3 -4
- package/dist/components/preact/DropZone/DropZone.d.ts +1 -0
- package/dist/components/preact/DropZone/drop-core/deploy.js +16 -16
- package/dist/components/preact/DropZone/drop-core/digest.d.ts +0 -1
- package/dist/components/preact/DropZone/drop-core/digest.js +5 -9
- package/dist/components/preact/DropZone/drop-core/index.js +9 -12
- package/dist/components/preact/DropZone/drop-core/readFiles.d.ts +0 -2
- package/dist/components/preact/DropZone/drop-core/readFiles.js +194 -195
- package/dist/components/preact/DropZone/drop-core/types.d.ts +0 -1
- package/dist/components/preact/DropZone/useDropDeploy.js +31 -28
- package/package.json +1 -1
- package/packages/components/preact/DropZone/DropZone.tsx +1 -0
- package/packages/components/preact/DropZone/drop-core/deploy.ts +4 -2
- package/packages/components/preact/DropZone/drop-core/digest.ts +0 -4
- package/packages/components/preact/DropZone/drop-core/readFiles.ts +18 -11
- package/packages/components/preact/DropZone/drop-core/types.ts +0 -1
- package/packages/components/preact/DropZone/useDropDeploy.ts +13 -2
- package/packages/assets/fonts/martian-mono/MartianMono-Regular.ttf +0 -0
package/README.md
CHANGED
|
@@ -147,13 +147,13 @@ This repo includes a [Claude Code](https://claude.ai/code) skill for generating
|
|
|
147
147
|
|
|
148
148
|
The skill is available automatically. Run:
|
|
149
149
|
|
|
150
|
-
```
|
|
150
|
+
```
|
|
151
151
|
/project:landing-page <describe the page you want>
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
For example:
|
|
155
155
|
|
|
156
|
-
```
|
|
156
|
+
```
|
|
157
157
|
/project:landing-page A landing page for a new enterprise hosting product with a hero, feature cards, and a pricing comparison
|
|
158
158
|
```
|
|
159
159
|
|
|
@@ -185,7 +185,7 @@ When you’re ready to validate your component changes in a deploy preview, you
|
|
|
185
185
|
>
|
|
186
186
|
> Reach out to #internal-permissions in Slack
|
|
187
187
|
|
|
188
|
-
### Steps to Publish an Alpha Release
|
|
188
|
+
### Steps to Publish an Alpha Release:
|
|
189
189
|
|
|
190
190
|
1. **Make sure you're logged into npm locally**
|
|
191
191
|
|
|
@@ -206,7 +206,6 @@ When you’re ready to validate your component changes in a deploy preview, you
|
|
|
206
206
|
```
|
|
207
207
|
|
|
208
208
|
1. **Install the updated package:**
|
|
209
|
-
|
|
210
209
|
```bash
|
|
211
210
|
npm install
|
|
212
211
|
```
|
|
@@ -27,6 +27,7 @@ interface Props {
|
|
|
27
27
|
* - `dropzone_files_dropped` — files dropped via drag ({ method: 'drag', file_count })
|
|
28
28
|
* - `dropzone_browse_opened` — file picker opened ({ method: 'keyboard' | 'click' })
|
|
29
29
|
* - `dropzone_deploy_succeeded` — deploy went live ({ method, site_name, file_count })
|
|
30
|
+
* - `dropzone_deploy_failed` — deploy errored out ({ method, reason, file_count? })
|
|
30
31
|
*/
|
|
31
32
|
onTrack?: TrackFn;
|
|
32
33
|
/**
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { getDigest as w
|
|
2
|
-
const
|
|
3
|
-
async function d(e,
|
|
4
|
-
const n = u.filter((
|
|
5
|
-
let
|
|
1
|
+
import { getDigest as w } from "./digest.js";
|
|
2
|
+
const y = 5;
|
|
3
|
+
async function d(e, l, u, t, i, a) {
|
|
4
|
+
const n = u.filter((h) => t.has(h.sha));
|
|
5
|
+
let p = 0, c = 0;
|
|
6
6
|
const o = async () => {
|
|
7
|
-
for (;
|
|
8
|
-
const
|
|
9
|
-
await e.uploadFile(
|
|
7
|
+
for (; p < n.length; ) {
|
|
8
|
+
const h = n[p++];
|
|
9
|
+
await e.uploadFile(l, h.path, h.content, i), a == null || a(++c);
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
await Promise.all(Array.from({ length: Math.min(
|
|
12
|
+
await Promise.all(Array.from({ length: Math.min(y, n.length) }, o));
|
|
13
13
|
}
|
|
14
|
-
async function f(e,
|
|
15
|
-
if (!
|
|
14
|
+
async function f(e, l, u = {}) {
|
|
15
|
+
if (!l.length) throw new Error("No files to deploy");
|
|
16
16
|
const { onProgress: t } = u;
|
|
17
17
|
t == null || t({ phase: "creating" });
|
|
18
|
-
const i = await e.getToken(), a = await e.createDeploy(w(
|
|
18
|
+
const i = await e.getToken(), a = await e.createDeploy(w(l), i), n = a.required.length;
|
|
19
19
|
return t == null || t({ phase: "uploading", uploaded: 0, total: n }), await d(
|
|
20
20
|
e,
|
|
21
|
-
a.
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
a.deploy_id,
|
|
22
|
+
l,
|
|
23
|
+
new Set(a.required),
|
|
24
24
|
i,
|
|
25
|
-
(
|
|
25
|
+
(p) => t == null ? void 0 : t({ phase: "uploading", uploaded: p, total: n })
|
|
26
26
|
), t == null || t({ phase: "processing" }), await e.waitUntilReady(a, i), t == null || t({ phase: "ready" }), { deploy: a, token: i, url: `https://${a.subdomain}.netlify.app` };
|
|
27
27
|
}
|
|
28
28
|
export {
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
function
|
|
2
|
-
const
|
|
3
|
-
for (const
|
|
4
|
-
return
|
|
5
|
-
}
|
|
6
|
-
function r(t) {
|
|
7
|
-
return new Set(t);
|
|
1
|
+
function n(e) {
|
|
2
|
+
const t = {};
|
|
3
|
+
for (const o of e) t[o.path] = o.sha;
|
|
4
|
+
return t;
|
|
8
5
|
}
|
|
9
6
|
export {
|
|
10
|
-
|
|
11
|
-
r as getShas
|
|
7
|
+
n as getDigest
|
|
12
8
|
};
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { getDigest as o
|
|
2
|
-
import { getSingleNonIndexHtmlFileName as l, hasMultipleHtmlFilesWithoutIndex as
|
|
3
|
-
import { AnonymousDropClient as
|
|
4
|
-
import { deployFiles as
|
|
1
|
+
import { getDigest as o } from "./digest.js";
|
|
2
|
+
import { getSingleNonIndexHtmlFileName as l, hasMultipleHtmlFilesWithoutIndex as i, readDataTransfer as m, readFileList as n } from "./readFiles.js";
|
|
3
|
+
import { AnonymousDropClient as p } from "./client.js";
|
|
4
|
+
import { deployFiles as x } from "./deploy.js";
|
|
5
5
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
p as AnonymousDropClient,
|
|
7
|
+
x as deployFiles,
|
|
8
8
|
o as getDigest,
|
|
9
|
-
r as getShas,
|
|
10
9
|
l as getSingleNonIndexHtmlFileName,
|
|
11
|
-
|
|
12
|
-
m as
|
|
13
|
-
n as
|
|
14
|
-
s as readFileList,
|
|
15
|
-
p as readZip
|
|
10
|
+
i as hasMultipleHtmlFilesWithoutIndex,
|
|
11
|
+
m as readDataTransfer,
|
|
12
|
+
n as readFileList
|
|
16
13
|
};
|
|
@@ -9,7 +9,5 @@ import { ProcessedFile } from './types';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function readDataTransfer(dt: DataTransfer): Promise<ProcessedFile[]>;
|
|
11
11
|
export declare function readFileList(files: FileList): Promise<ProcessedFile[]>;
|
|
12
|
-
export declare function readZip(zip: File): Promise<ProcessedFile[]>;
|
|
13
|
-
export declare function normalizeFiles(files: ProcessedFile[]): ProcessedFile[];
|
|
14
12
|
export declare function getSingleNonIndexHtmlFileName(files: ProcessedFile[]): string | null;
|
|
15
13
|
export declare function hasMultipleHtmlFilesWithoutIndex(files: ProcessedFile[]): boolean;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
var L = { exports: {} },
|
|
3
|
-
function
|
|
4
|
-
return
|
|
1
|
+
import { g as F } from "../../../../chunks/_commonjsHelpers.C6fGbg64.js";
|
|
2
|
+
var L = { exports: {} }, I = L.exports, M;
|
|
3
|
+
function z() {
|
|
4
|
+
return M || (M = 1, function(g, _) {
|
|
5
5
|
(function(b, p) {
|
|
6
|
-
|
|
7
|
-
})(typeof self < "u" ? self :
|
|
6
|
+
g.exports = p();
|
|
7
|
+
})(typeof self < "u" ? self : I, function() {
|
|
8
8
|
return (
|
|
9
9
|
/******/
|
|
10
|
-
function(
|
|
10
|
+
function(x) {
|
|
11
11
|
var b = {};
|
|
12
12
|
function p(v) {
|
|
13
13
|
if (b[v])
|
|
@@ -21,16 +21,16 @@ function F() {
|
|
|
21
21
|
exports: {}
|
|
22
22
|
/******/
|
|
23
23
|
};
|
|
24
|
-
return
|
|
24
|
+
return x[v].call(s.exports, s, s.exports, p), s.l = !0, s.exports;
|
|
25
25
|
}
|
|
26
|
-
return p.m =
|
|
26
|
+
return p.m = x, p.c = b, p.d = function(v, s, y) {
|
|
27
27
|
p.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: y
|
|
34
34
|
/******/
|
|
35
35
|
});
|
|
36
36
|
}, p.n = function(v) {
|
|
@@ -52,12 +52,12 @@ function F() {
|
|
|
52
52
|
}([
|
|
53
53
|
/* 0 */
|
|
54
54
|
/***/
|
|
55
|
-
function(
|
|
55
|
+
function(x, b, p) {
|
|
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 = p(5),
|
|
60
|
+
var s = p(5), y = p(1), u = y.toHex, f = y.ceilHeapSize, l = p(6), d = function(e) {
|
|
61
61
|
for (e += 9; e % 64 > 0; e += 1)
|
|
62
62
|
;
|
|
63
63
|
return e;
|
|
@@ -80,11 +80,11 @@ function F() {
|
|
|
80
80
|
}, t = function(e, o) {
|
|
81
81
|
var n = new Int32Array(e, o + 320, 5), h = new Int32Array(5), a = new DataView(h.buffer);
|
|
82
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), h;
|
|
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
|
-
this._offset = 0, this._maxChunkLen = o, this._padMaxChunkLen = d(o), this._heap = new ArrayBuffer(
|
|
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
89
|
return e.prototype._initState = function(n, h) {
|
|
90
90
|
this._offset = 0;
|
|
@@ -95,9 +95,9 @@ function F() {
|
|
|
95
95
|
return i(w, n), r(w, n, h), a;
|
|
96
96
|
}, e.prototype._write = function(n, h, a, w) {
|
|
97
97
|
l(n, this._h8, this._h32, h, a, w || 0);
|
|
98
|
-
}, e.prototype._coreCall = function(n, h, a, w,
|
|
98
|
+
}, e.prototype._coreCall = function(n, h, a, w, m) {
|
|
99
99
|
var C = a;
|
|
100
|
-
this._write(n, h, a),
|
|
100
|
+
this._write(n, h, a), m && (C = this._padChunk(a, w)), this._core.hash(C, this._padMaxChunkLen);
|
|
101
101
|
}, e.prototype.rawDigest = function(n) {
|
|
102
102
|
var h = n.byteLength || n.length || n.size || 0;
|
|
103
103
|
this._initState(this._heap, this._padMaxChunkLen);
|
|
@@ -116,9 +116,9 @@ function F() {
|
|
|
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 h = 0, a = n.byteLength || n.length || n.size || 0, w = this._offset % this._maxChunkLen,
|
|
119
|
+
var h = 0, a = n.byteLength || n.length || n.size || 0, w = this._offset % this._maxChunkLen, m = void 0;
|
|
120
120
|
for (this._offset += a; h < a; )
|
|
121
|
-
|
|
121
|
+
m = Math.min(a - h, this._maxChunkLen - w), this._write(n, h, m, w), w += m, h += m, w === this._maxChunkLen && (this._core.hash(this._maxChunkLen, this._padMaxChunkLen), w = 0);
|
|
122
122
|
return this;
|
|
123
123
|
}, e.prototype.getState = function() {
|
|
124
124
|
var n = this._offset % this._maxChunkLen, h = void 0;
|
|
@@ -148,43 +148,43 @@ function F() {
|
|
|
148
148
|
return u(this.rawEnd().buffer);
|
|
149
149
|
}, e;
|
|
150
150
|
}();
|
|
151
|
-
|
|
151
|
+
x.exports = c, x.exports._core = s;
|
|
152
152
|
},
|
|
153
153
|
/* 1 */
|
|
154
154
|
/***/
|
|
155
|
-
function(
|
|
155
|
+
function(x, b) {
|
|
156
156
|
for (var p = new Array(256), v = 0; v < 256; v++)
|
|
157
157
|
p[v] = (v < 16 ? "0" : "") + v.toString(16);
|
|
158
|
-
|
|
159
|
-
for (var
|
|
160
|
-
u[
|
|
158
|
+
x.exports.toHex = function(s) {
|
|
159
|
+
for (var y = new Uint8Array(s), u = new Array(s.byteLength), f = 0; f < u.length; f++)
|
|
160
|
+
u[f] = p[y[f]];
|
|
161
161
|
return u.join("");
|
|
162
|
-
},
|
|
163
|
-
var
|
|
162
|
+
}, x.exports.ceilHeapSize = function(s) {
|
|
163
|
+
var y = 0;
|
|
164
164
|
if (s <= 65536) return 65536;
|
|
165
165
|
if (s < 16777216)
|
|
166
|
-
for (
|
|
166
|
+
for (y = 1; y < s; y = y << 1)
|
|
167
167
|
;
|
|
168
168
|
else
|
|
169
|
-
for (
|
|
169
|
+
for (y = 16777216; y < s; y += 16777216)
|
|
170
170
|
;
|
|
171
|
-
return
|
|
172
|
-
},
|
|
173
|
-
var
|
|
174
|
-
return
|
|
171
|
+
return y;
|
|
172
|
+
}, x.exports.isDedicatedWorkerScope = function(s) {
|
|
173
|
+
var y = "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 y && !u && !f;
|
|
175
175
|
};
|
|
176
176
|
},
|
|
177
177
|
/* 2 */
|
|
178
178
|
/***/
|
|
179
|
-
function(
|
|
180
|
-
|
|
181
|
-
var v = p(0), s = function(
|
|
179
|
+
function(x, b, p) {
|
|
180
|
+
x.exports = function() {
|
|
181
|
+
var v = p(0), s = function(f, l, d) {
|
|
182
182
|
try {
|
|
183
|
-
return d(null,
|
|
183
|
+
return d(null, f.digest(l));
|
|
184
184
|
} catch (i) {
|
|
185
185
|
return d(i);
|
|
186
186
|
}
|
|
187
|
-
},
|
|
187
|
+
}, y = function(f, l, d, i, r) {
|
|
188
188
|
var t = new self.FileReader();
|
|
189
189
|
t.onloadend = function() {
|
|
190
190
|
if (t.error)
|
|
@@ -192,24 +192,24 @@ function F() {
|
|
|
192
192
|
var e = t.result;
|
|
193
193
|
l += t.result.byteLength;
|
|
194
194
|
try {
|
|
195
|
-
|
|
195
|
+
f.append(e);
|
|
196
196
|
} catch (o) {
|
|
197
197
|
r(o);
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
200
|
-
l < i.size ?
|
|
200
|
+
l < i.size ? y(f, l, d, i, r) : r(null, f.end());
|
|
201
201
|
}, t.readAsArrayBuffer(i.slice(l, l + d));
|
|
202
202
|
}, u = !0;
|
|
203
|
-
return self.onmessage = function(
|
|
203
|
+
return self.onmessage = function(f) {
|
|
204
204
|
if (u) {
|
|
205
|
-
var l =
|
|
205
|
+
var l = f.data.data, d = f.data.file, i = f.data.id;
|
|
206
206
|
if (!(typeof i > "u") && !(!d && !l)) {
|
|
207
|
-
var r =
|
|
207
|
+
var r = f.data.blockSize || 4 * 1024 * 1024, t = new v(r);
|
|
208
208
|
t.resetState();
|
|
209
|
-
var
|
|
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,
|
|
212
|
+
l && s(t, l, c), d && y(t, 0, r, d, c);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
}, function() {
|
|
@@ -219,8 +219,8 @@ function F() {
|
|
|
219
219
|
},
|
|
220
220
|
/* 3 */
|
|
221
221
|
/***/
|
|
222
|
-
function(
|
|
223
|
-
var v = p(4), s = p(0),
|
|
222
|
+
function(x, b, p) {
|
|
223
|
+
var v = p(4), s = p(0), y = p(7), u = p(2), f = p(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 F() {
|
|
|
230
230
|
return i.terminate = function() {
|
|
231
231
|
URL.revokeObjectURL(i.objectURL), r.call(i);
|
|
232
232
|
}, i;
|
|
233
|
-
}, s.createHash =
|
|
233
|
+
}, s.createHash = y, x.exports = s;
|
|
234
234
|
},
|
|
235
235
|
/* 4 */
|
|
236
236
|
/***/
|
|
237
|
-
function(
|
|
237
|
+
function(x, b, p) {
|
|
238
238
|
function v(i) {
|
|
239
239
|
var r = {};
|
|
240
240
|
function t(e) {
|
|
@@ -283,34 +283,34 @@ function F() {
|
|
|
283
283
|
}, t.p = "/", t.oe = function(e) {
|
|
284
284
|
throw console.error(e), e;
|
|
285
285
|
};
|
|
286
|
-
var
|
|
287
|
-
return
|
|
286
|
+
var c = t(t.s = ENTRY_MODULE);
|
|
287
|
+
return c.default || c;
|
|
288
288
|
}
|
|
289
|
-
var s = "[\\.|\\-|\\+|\\w|/|@]+",
|
|
289
|
+
var s = "[\\.|\\-|\\+|\\w|/|@]+", y = "\\((/\\*.*?\\*/)?s?.*?(" + s + ").*?\\)";
|
|
290
290
|
function u(i) {
|
|
291
291
|
return (i + "").replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
var
|
|
295
|
-
|
|
293
|
+
function f(i, r, t) {
|
|
294
|
+
var c = {};
|
|
295
|
+
c[t] = [];
|
|
296
296
|
var e = r.toString(), o = e.match(/^function\s?\(\w+,\s*\w+,\s*(\w+)\)/);
|
|
297
|
-
if (!o) return
|
|
298
|
-
for (var n = o[1], h = new RegExp("(\\\\n|\\W)" + u(n) +
|
|
299
|
-
a[3] !== "dll-reference" &&
|
|
300
|
-
for (h = new RegExp("\\(" + u(n) + '\\("(dll-reference\\s(' + s + '))"\\)\\)' +
|
|
301
|
-
i[a[2]] || (
|
|
302
|
-
return
|
|
297
|
+
if (!o) return c;
|
|
298
|
+
for (var n = o[1], h = new RegExp("(\\\\n|\\W)" + u(n) + y, "g"), a; a = h.exec(e); )
|
|
299
|
+
a[3] !== "dll-reference" && c[t].push(a[3]);
|
|
300
|
+
for (h = new RegExp("\\(" + u(n) + '\\("(dll-reference\\s(' + s + '))"\\)\\)' + y, "g"); a = h.exec(e); )
|
|
301
|
+
i[a[2]] || (c[t].push(a[1]), i[a[2]] = p(a[1]).m), c[a[2]] = c[a[2]] || [], c[a[2]].push(a[4]);
|
|
302
|
+
return c;
|
|
303
303
|
}
|
|
304
304
|
function l(i) {
|
|
305
305
|
var r = Object.keys(i);
|
|
306
|
-
return r.reduce(function(t,
|
|
307
|
-
return t || i[
|
|
306
|
+
return r.reduce(function(t, c) {
|
|
307
|
+
return t || i[c].length > 0;
|
|
308
308
|
}, !1);
|
|
309
309
|
}
|
|
310
310
|
function d(i, r) {
|
|
311
311
|
for (var t = {
|
|
312
312
|
main: [r]
|
|
313
|
-
},
|
|
313
|
+
}, c = {
|
|
314
314
|
main: []
|
|
315
315
|
}, e = {
|
|
316
316
|
main: {}
|
|
@@ -318,28 +318,28 @@ function F() {
|
|
|
318
318
|
for (var o = Object.keys(t), n = 0; n < o.length; n++) {
|
|
319
319
|
var h = o[n], a = t[h], w = a.pop();
|
|
320
320
|
if (e[h] = e[h] || {}, !(e[h][w] || !i[h][w])) {
|
|
321
|
-
e[h][w] = !0,
|
|
322
|
-
for (var
|
|
323
|
-
t[C[S]] = t[C[S]] || [], t[C[S]] = t[C[S]].concat(
|
|
321
|
+
e[h][w] = !0, c[h] = c[h] || [], c[h].push(w);
|
|
322
|
+
for (var m = f(i, i[h][w], h), C = Object.keys(m), S = 0; S < C.length; S++)
|
|
323
|
+
t[C[S]] = t[C[S]] || [], t[C[S]] = t[C[S]].concat(m[C[S]]);
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
-
return
|
|
326
|
+
return c;
|
|
327
327
|
}
|
|
328
|
-
|
|
328
|
+
x.exports = function(i, r) {
|
|
329
329
|
r = r || {};
|
|
330
330
|
var t = {
|
|
331
331
|
main: p.m
|
|
332
|
-
},
|
|
333
|
-
Object.keys(
|
|
332
|
+
}, c = r.all ? { main: Object.keys(t) } : d(t, i), e = "";
|
|
333
|
+
Object.keys(c).filter(function(w) {
|
|
334
334
|
return w !== "main";
|
|
335
335
|
}).forEach(function(w) {
|
|
336
|
-
for (var
|
|
337
|
-
|
|
338
|
-
|
|
336
|
+
for (var m = 0; c[w][m]; )
|
|
337
|
+
m++;
|
|
338
|
+
c[w].push(m), t[w][m] = "(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })", e = e + "var " + w + " = (" + v.toString().replace("ENTRY_MODULE", JSON.stringify(m)) + ")({" + c[w].map(function(C) {
|
|
339
339
|
return "" + JSON.stringify(C) + ": " + t[w][C].toString();
|
|
340
340
|
}).join(",") + `});
|
|
341
341
|
`;
|
|
342
|
-
}), e = e + "(" + v.toString().replace("ENTRY_MODULE", JSON.stringify(i)) + ")({" +
|
|
342
|
+
}), e = e + "(" + v.toString().replace("ENTRY_MODULE", JSON.stringify(i)) + ")({" + c.main.map(function(w) {
|
|
343
343
|
return "" + JSON.stringify(w) + ": " + t.main[w].toString();
|
|
344
344
|
}).join(",") + "})(self);";
|
|
345
345
|
var o = new window.Blob([e], { type: "text/javascript" });
|
|
@@ -351,85 +351,85 @@ function F() {
|
|
|
351
351
|
},
|
|
352
352
|
/* 5 */
|
|
353
353
|
/***/
|
|
354
|
-
function(
|
|
355
|
-
|
|
356
|
-
var u = new v.Int32Array(
|
|
357
|
-
function
|
|
354
|
+
function(x, b) {
|
|
355
|
+
x.exports = function(v, s, y) {
|
|
356
|
+
var u = new v.Int32Array(y);
|
|
357
|
+
function f(l, d) {
|
|
358
358
|
l = l | 0, d = d | 0;
|
|
359
|
-
var i = 0, r = 0, t = 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 (
|
|
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, h = 0, a = 0, w = 0, m = 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, m = u[d + 336 >> 2] | 0, i = 0; (i | 0) < (l | 0); i = i + 64 | 0) {
|
|
361
|
+
for (c = t, o = e, h = n, w = a, C = m, 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 + m | 0) + 1518500249 | 0) | 0, m = 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 + m | 0) + 1518500249 | 0) | 0, m = 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 + m | 0) + 1859775393 | 0) | 0, m = 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 + m | 0) - 1894007588 | 0) | 0, m = 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 +
|
|
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 + m | 0) - 899497514 | 0) | 0, m = 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 + h | 0, a = a + w | 0, m = m + 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] = m;
|
|
374
374
|
}
|
|
375
|
-
return { hash:
|
|
375
|
+
return { hash: f };
|
|
376
376
|
};
|
|
377
377
|
},
|
|
378
378
|
/* 6 */
|
|
379
379
|
/***/
|
|
380
|
-
function(
|
|
380
|
+
function(x, b) {
|
|
381
381
|
var p = this, v = void 0;
|
|
382
382
|
typeof self < "u" && typeof self.FileReaderSync < "u" && (v = new self.FileReaderSync());
|
|
383
|
-
var s = function(
|
|
384
|
-
var
|
|
383
|
+
var s = function(f, l, d, i, r, t) {
|
|
384
|
+
var c = void 0, e = t % 4, o = (r + e) % 4, n = r - o;
|
|
385
385
|
switch (e) {
|
|
386
386
|
case 0:
|
|
387
|
-
l[t] =
|
|
387
|
+
l[t] = f.charCodeAt(i + 3);
|
|
388
388
|
case 1:
|
|
389
|
-
l[t + 1 - (e << 1) | 0] =
|
|
389
|
+
l[t + 1 - (e << 1) | 0] = f.charCodeAt(i + 2);
|
|
390
390
|
case 2:
|
|
391
|
-
l[t + 2 - (e << 1) | 0] =
|
|
391
|
+
l[t + 2 - (e << 1) | 0] = f.charCodeAt(i + 1);
|
|
392
392
|
case 3:
|
|
393
|
-
l[t + 3 - (e << 1) | 0] =
|
|
393
|
+
l[t + 3 - (e << 1) | 0] = f.charCodeAt(i);
|
|
394
394
|
}
|
|
395
395
|
if (!(r < o + (4 - e))) {
|
|
396
|
-
for (
|
|
397
|
-
d[t +
|
|
396
|
+
for (c = 4 - e; c < n; c = c + 4 | 0)
|
|
397
|
+
d[t + c >> 2] = f.charCodeAt(i + c) << 24 | f.charCodeAt(i + c + 1) << 16 | f.charCodeAt(i + c + 2) << 8 | f.charCodeAt(i + c + 3);
|
|
398
398
|
switch (o) {
|
|
399
399
|
case 3:
|
|
400
|
-
l[t + n + 1 | 0] =
|
|
400
|
+
l[t + n + 1 | 0] = f.charCodeAt(i + n + 2);
|
|
401
401
|
case 2:
|
|
402
|
-
l[t + n + 2 | 0] =
|
|
402
|
+
l[t + n + 2 | 0] = f.charCodeAt(i + n + 1);
|
|
403
403
|
case 1:
|
|
404
|
-
l[t + n + 3 | 0] =
|
|
404
|
+
l[t + n + 3 | 0] = f.charCodeAt(i + n);
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
|
-
},
|
|
408
|
-
var
|
|
407
|
+
}, y = function(f, l, d, i, r, t) {
|
|
408
|
+
var c = void 0, e = t % 4, o = (r + e) % 4, n = r - o;
|
|
409
409
|
switch (e) {
|
|
410
410
|
case 0:
|
|
411
|
-
l[t] =
|
|
411
|
+
l[t] = f[i + 3];
|
|
412
412
|
case 1:
|
|
413
|
-
l[t + 1 - (e << 1) | 0] =
|
|
413
|
+
l[t + 1 - (e << 1) | 0] = f[i + 2];
|
|
414
414
|
case 2:
|
|
415
|
-
l[t + 2 - (e << 1) | 0] =
|
|
415
|
+
l[t + 2 - (e << 1) | 0] = f[i + 1];
|
|
416
416
|
case 3:
|
|
417
|
-
l[t + 3 - (e << 1) | 0] =
|
|
417
|
+
l[t + 3 - (e << 1) | 0] = f[i];
|
|
418
418
|
}
|
|
419
419
|
if (!(r < o + (4 - e))) {
|
|
420
|
-
for (
|
|
421
|
-
d[t +
|
|
420
|
+
for (c = 4 - e; c < n; c = c + 4 | 0)
|
|
421
|
+
d[t + c >> 2 | 0] = f[i + c] << 24 | f[i + c + 1] << 16 | f[i + c + 2] << 8 | f[i + c + 3];
|
|
422
422
|
switch (o) {
|
|
423
423
|
case 3:
|
|
424
|
-
l[t + n + 1 | 0] =
|
|
424
|
+
l[t + n + 1 | 0] = f[i + n + 2];
|
|
425
425
|
case 2:
|
|
426
|
-
l[t + n + 2 | 0] =
|
|
426
|
+
l[t + n + 2 | 0] = f[i + n + 1];
|
|
427
427
|
case 1:
|
|
428
|
-
l[t + n + 3 | 0] =
|
|
428
|
+
l[t + n + 3 | 0] = f[i + n];
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
|
-
}, u = function(
|
|
432
|
-
var
|
|
431
|
+
}, u = function(f, l, d, i, r, t) {
|
|
432
|
+
var c = void 0, e = t % 4, o = (r + e) % 4, n = r - o, h = new Uint8Array(v.readAsArrayBuffer(f.slice(i, i + r)));
|
|
433
433
|
switch (e) {
|
|
434
434
|
case 0:
|
|
435
435
|
l[t] = h[3];
|
|
@@ -441,8 +441,8 @@ function F() {
|
|
|
441
441
|
l[t + 3 - (e << 1) | 0] = h[0];
|
|
442
442
|
}
|
|
443
443
|
if (!(r < o + (4 - e))) {
|
|
444
|
-
for (
|
|
445
|
-
d[t +
|
|
444
|
+
for (c = 4 - e; c < n; c = c + 4 | 0)
|
|
445
|
+
d[t + c >> 2 | 0] = h[c] << 24 | h[c + 1] << 16 | h[c + 2] << 8 | h[c + 3];
|
|
446
446
|
switch (o) {
|
|
447
447
|
case 3:
|
|
448
448
|
l[t + n + 1 | 0] = h[n + 2];
|
|
@@ -453,28 +453,28 @@ function F() {
|
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
455
|
};
|
|
456
|
-
|
|
457
|
-
if (typeof
|
|
458
|
-
return s(
|
|
459
|
-
if (
|
|
460
|
-
return
|
|
461
|
-
if (
|
|
462
|
-
return
|
|
463
|
-
if (
|
|
464
|
-
return
|
|
465
|
-
if (
|
|
466
|
-
return u(
|
|
456
|
+
x.exports = function(f, l, d, i, r, t) {
|
|
457
|
+
if (typeof f == "string")
|
|
458
|
+
return s(f, l, d, i, r, t);
|
|
459
|
+
if (f instanceof Array || p && p.Buffer && p.Buffer.isBuffer(f))
|
|
460
|
+
return y(f, l, d, i, r, t);
|
|
461
|
+
if (f instanceof ArrayBuffer)
|
|
462
|
+
return y(new Uint8Array(f), l, d, i, r, t);
|
|
463
|
+
if (f.buffer instanceof ArrayBuffer)
|
|
464
|
+
return y(new Uint8Array(f.buffer, f.byteOffset, f.byteLength), l, d, i, r, t);
|
|
465
|
+
if (f instanceof Blob)
|
|
466
|
+
return u(f, l, d, i, r, t);
|
|
467
467
|
throw new Error("Unsupported data type.");
|
|
468
468
|
};
|
|
469
469
|
},
|
|
470
470
|
/* 7 */
|
|
471
471
|
/***/
|
|
472
|
-
function(
|
|
472
|
+
function(x, b, p) {
|
|
473
473
|
var v = /* @__PURE__ */ function() {
|
|
474
474
|
function d(i, r) {
|
|
475
475
|
for (var t = 0; t < r.length; t++) {
|
|
476
|
-
var
|
|
477
|
-
|
|
476
|
+
var c = r[t];
|
|
477
|
+
c.enumerable = c.enumerable || !1, c.configurable = !0, "value" in c && (c.writable = !0), Object.defineProperty(i, c.key, c);
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
return function(i, r, t) {
|
|
@@ -485,9 +485,9 @@ function F() {
|
|
|
485
485
|
if (!(d instanceof i))
|
|
486
486
|
throw new TypeError("Cannot call a class as a function");
|
|
487
487
|
}
|
|
488
|
-
var
|
|
488
|
+
var y = p(0), u = p(1), f = u.toHex, l = function() {
|
|
489
489
|
function d() {
|
|
490
|
-
s(this, d), this._rusha = new
|
|
490
|
+
s(this, d), this._rusha = new y(), this._rusha.resetState();
|
|
491
491
|
}
|
|
492
492
|
return d.prototype.update = function(r) {
|
|
493
493
|
return this._rusha.append(r), this;
|
|
@@ -496,7 +496,7 @@ function F() {
|
|
|
496
496
|
if (!r)
|
|
497
497
|
return t;
|
|
498
498
|
if (r === "hex")
|
|
499
|
-
return
|
|
499
|
+
return f(t);
|
|
500
500
|
throw new Error("unsupported digest encoding");
|
|
501
501
|
}, v(d, [{
|
|
502
502
|
key: "state",
|
|
@@ -508,7 +508,7 @@ function F() {
|
|
|
508
508
|
}
|
|
509
509
|
}]), d;
|
|
510
510
|
}();
|
|
511
|
-
|
|
511
|
+
x.exports = function() {
|
|
512
512
|
return new l();
|
|
513
513
|
};
|
|
514
514
|
}
|
|
@@ -518,102 +518,101 @@ function F() {
|
|
|
518
518
|
});
|
|
519
519
|
}(L)), L.exports;
|
|
520
520
|
}
|
|
521
|
-
var
|
|
522
|
-
const
|
|
523
|
-
function
|
|
521
|
+
var P = z();
|
|
522
|
+
const G = /* @__PURE__ */ F(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, _, x) {
|
|
524
524
|
return {
|
|
525
|
-
path:
|
|
526
|
-
size:
|
|
527
|
-
sha:
|
|
528
|
-
content:
|
|
529
|
-
name:
|
|
525
|
+
path: k(g),
|
|
526
|
+
size: _.byteLength,
|
|
527
|
+
sha: J.digest(_),
|
|
528
|
+
content: _,
|
|
529
|
+
name: x
|
|
530
530
|
};
|
|
531
531
|
}
|
|
532
|
-
async function D(
|
|
533
|
-
const
|
|
534
|
-
return
|
|
532
|
+
async function D(g) {
|
|
533
|
+
const _ = await new Promise((b, p) => g.file(b, p)), x = await _.arrayBuffer();
|
|
534
|
+
return O(g.fullPath, x, _.name);
|
|
535
535
|
}
|
|
536
|
-
async function B(
|
|
537
|
-
const
|
|
536
|
+
async function B(g) {
|
|
537
|
+
const _ = g.createReader(), x = [];
|
|
538
538
|
for (; ; ) {
|
|
539
|
-
const b = await new Promise((p, v) =>
|
|
539
|
+
const b = await new Promise((p, v) => _.readEntries(p, v));
|
|
540
540
|
if (!b.length) break;
|
|
541
541
|
for (const p of b)
|
|
542
|
-
|
|
542
|
+
R(p.name) || x.push(...p.isDirectory ? await B(p) : [await D(p)]);
|
|
543
543
|
}
|
|
544
|
-
return
|
|
544
|
+
return x;
|
|
545
545
|
}
|
|
546
|
-
async function
|
|
546
|
+
async function V(g) {
|
|
547
547
|
var p;
|
|
548
|
-
const
|
|
549
|
-
if (
|
|
550
|
-
return U(
|
|
551
|
-
const b = Array.from(
|
|
548
|
+
const _ = (p = g.files) == null ? void 0 : p[0];
|
|
549
|
+
if (g.files.length === 1 && _ && /\.zip$/i.test(_.name))
|
|
550
|
+
return U(_);
|
|
551
|
+
const b = 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
555
|
if (b.length) {
|
|
556
556
|
const v = await Promise.all(
|
|
557
557
|
b.map(
|
|
558
|
-
(s) =>
|
|
558
|
+
(s) => R(s.name) ? [] : s.isDirectory ? B(s) : D(s).then((y) => [y])
|
|
559
559
|
)
|
|
560
560
|
);
|
|
561
|
-
return
|
|
561
|
+
return E(v.flat());
|
|
562
562
|
}
|
|
563
|
-
return
|
|
563
|
+
return Y(g.files);
|
|
564
564
|
}
|
|
565
|
-
async function
|
|
566
|
-
const
|
|
567
|
-
if (
|
|
568
|
-
return U(
|
|
569
|
-
const
|
|
570
|
-
for (const b of
|
|
565
|
+
async function Y(g) {
|
|
566
|
+
const _ = Array.from(g);
|
|
567
|
+
if (_.length === 1 && /\.zip$/i.test(_[0].name))
|
|
568
|
+
return U(_[0]);
|
|
569
|
+
const x = [];
|
|
570
|
+
for (const b of _) {
|
|
571
571
|
const p = b.webkitRelativePath || b.name;
|
|
572
|
-
|
|
572
|
+
x.push(O(p, await b.arrayBuffer(), b.name));
|
|
573
573
|
}
|
|
574
|
-
return
|
|
574
|
+
return E(x);
|
|
575
575
|
}
|
|
576
|
-
async function U(
|
|
577
|
-
const { unzip:
|
|
578
|
-
(v, s) =>
|
|
576
|
+
async function U(g) {
|
|
577
|
+
const { unzip: _ } = await import("../../../../chunks/browser.D58rdxmc.js"), x = new Uint8Array(await g.arrayBuffer()), b = await new Promise(
|
|
578
|
+
(v, s) => _(x, (y, u) => y ? s(y) : v(u))
|
|
579
579
|
), p = [];
|
|
580
580
|
for (const [v, s] of Object.entries(b)) {
|
|
581
|
-
if (v.endsWith("/") ||
|
|
582
|
-
const
|
|
581
|
+
if (v.endsWith("/") || $(v)) continue;
|
|
582
|
+
const y = s.buffer.slice(
|
|
583
583
|
s.byteOffset,
|
|
584
584
|
s.byteOffset + s.byteLength
|
|
585
585
|
);
|
|
586
|
-
p.push(
|
|
586
|
+
p.push(O(v, y, v.split("/").pop()));
|
|
587
587
|
}
|
|
588
|
-
return
|
|
588
|
+
return E(p);
|
|
589
589
|
}
|
|
590
|
-
function
|
|
591
|
-
if (!
|
|
592
|
-
const
|
|
593
|
-
let
|
|
594
|
-
for (const p of
|
|
595
|
-
const v =
|
|
590
|
+
function E(g) {
|
|
591
|
+
if (!g.length) return g;
|
|
592
|
+
const _ = (p) => k(p).split("/").slice(1);
|
|
593
|
+
let x = _(g[0].path).slice(0, -1);
|
|
594
|
+
for (const p of g) {
|
|
595
|
+
const v = _(p.path);
|
|
596
596
|
let s = 0;
|
|
597
|
-
for (; s <
|
|
598
|
-
|
|
597
|
+
for (; s < x.length && s < v.length - 1 && x[s] === v[s]; ) s++;
|
|
598
|
+
x = x.slice(0, s);
|
|
599
599
|
}
|
|
600
|
-
if (!
|
|
601
|
-
const b = "/" +
|
|
602
|
-
return
|
|
600
|
+
if (!x.length) return g;
|
|
601
|
+
const b = "/" + x.join("/");
|
|
602
|
+
return g.map((p) => ({ ...p, path: k(p.path.slice(b.length)) }));
|
|
603
603
|
}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
604
|
+
const W = (g) => g.filter((_) => /\.html?$/i.test(_.name)), j = (g) => g.some((_) => /^index\.html?$/i.test(_.name));
|
|
605
|
+
function Z(g) {
|
|
606
|
+
const _ = W(g);
|
|
607
|
+
return j(_) ? null : _.length === 1 ? _[0].name : null;
|
|
607
608
|
}
|
|
608
|
-
function
|
|
609
|
-
const
|
|
610
|
-
return
|
|
609
|
+
function X(g) {
|
|
610
|
+
const _ = W(g);
|
|
611
|
+
return _.length > 1 && !j(_);
|
|
611
612
|
}
|
|
612
613
|
export {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
G as readFileList,
|
|
618
|
-
U as readZip
|
|
614
|
+
Z as getSingleNonIndexHtmlFileName,
|
|
615
|
+
X as hasMultipleHtmlFilesWithoutIndex,
|
|
616
|
+
V as readDataTransfer,
|
|
617
|
+
Y as readFileList
|
|
619
618
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
import { getSingleNonIndexHtmlFileName as
|
|
3
|
-
import { AnonymousDropClient as
|
|
4
|
-
import { deployFiles as
|
|
1
|
+
import { d as m, A as x } from "../../../chunks/hooks.module.DRcxknIz.js";
|
|
2
|
+
import { getSingleNonIndexHtmlFileName as S, hasMultipleHtmlFilesWithoutIndex as b } from "./drop-core/readFiles.js";
|
|
3
|
+
import { AnonymousDropClient as I } from "./drop-core/client.js";
|
|
4
|
+
import { deployFiles as z } from "./drop-core/deploy.js";
|
|
5
5
|
function F(n) {
|
|
6
6
|
switch (n.phase) {
|
|
7
7
|
case "creating":
|
|
@@ -14,51 +14,54 @@ function F(n) {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
function H(n) {
|
|
17
|
-
const i =
|
|
18
|
-
return i ? `No index.html found — "${i}" won’t be served at the site root.` :
|
|
17
|
+
const i = S(n);
|
|
18
|
+
return i ? `No index.html found — "${i}" won’t be served at the site root.` : b(n) ? "No index.html found — your site may not have a landing page." : null;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function C({
|
|
21
21
|
apiBase: n,
|
|
22
22
|
client: i,
|
|
23
|
-
claimUrl:
|
|
24
|
-
onDeploy:
|
|
25
|
-
track:
|
|
23
|
+
claimUrl: g,
|
|
24
|
+
onDeploy: d,
|
|
25
|
+
track: s
|
|
26
26
|
}) {
|
|
27
|
-
const [
|
|
28
|
-
async function
|
|
29
|
-
|
|
27
|
+
const [a, t] = m({ kind: "idle" }), [f, l] = m(null), h = x(i ?? new I(n)).current, k = a.kind !== "idle" && a.kind !== "error";
|
|
28
|
+
async function y(w, r) {
|
|
29
|
+
l(null), t({ kind: "reading" });
|
|
30
|
+
const p = (e, u) => {
|
|
31
|
+
t({ kind: "error", message: e }), s("dropzone_deploy_failed", { method: r, reason: e, ...u });
|
|
32
|
+
};
|
|
30
33
|
try {
|
|
31
|
-
const e = await
|
|
34
|
+
const e = await w();
|
|
32
35
|
if (!e.length) {
|
|
33
|
-
|
|
36
|
+
p("No files found to deploy.", { file_count: 0 });
|
|
34
37
|
return;
|
|
35
38
|
}
|
|
36
|
-
|
|
39
|
+
r === "drag" && s("dropzone_files_dropped", { method: r, file_count: e.length }), l(H(e));
|
|
37
40
|
const {
|
|
38
|
-
url:
|
|
39
|
-
token:
|
|
41
|
+
url: u,
|
|
42
|
+
token: c,
|
|
40
43
|
deploy: o
|
|
41
|
-
} = await
|
|
44
|
+
} = await z(h, e, {
|
|
42
45
|
onProgress: (N) => t(F(N))
|
|
43
46
|
});
|
|
44
47
|
try {
|
|
45
|
-
localStorage.setItem("drop-token",
|
|
48
|
+
localStorage.setItem("drop-token", c), localStorage.setItem("dropSiteName", o.subdomain);
|
|
46
49
|
} catch {
|
|
47
50
|
}
|
|
48
|
-
t({ kind: "redirecting" }),
|
|
49
|
-
method:
|
|
51
|
+
t({ kind: "redirecting" }), s("dropzone_deploy_succeeded", {
|
|
52
|
+
method: r,
|
|
50
53
|
site_name: o.subdomain,
|
|
51
54
|
file_count: e.length
|
|
52
|
-
}),
|
|
55
|
+
}), d == null || d({ url: u, token: c, siteName: o.subdomain, siteId: o.id }), window.location.assign(`${g(o.subdomain)}#drop_token=${c}`);
|
|
53
56
|
} catch (e) {
|
|
54
|
-
|
|
57
|
+
p(e instanceof Error ? e.message : String(e));
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
|
-
function
|
|
58
|
-
|
|
60
|
+
function _() {
|
|
61
|
+
l(null), t({ kind: "idle" });
|
|
59
62
|
}
|
|
60
|
-
return { status:
|
|
63
|
+
return { status: a, warning: f, busy: k, deploy: y, reset: _ };
|
|
61
64
|
}
|
|
62
65
|
export {
|
|
63
|
-
|
|
66
|
+
C as useDropDeploy
|
|
64
67
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/spark-ui",
|
|
3
3
|
"description": "Assets, design tokens, components, and utilities",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.27.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/components/preact/index.js",
|
|
7
7
|
"types": "dist/components/preact/index.d.ts",
|
|
@@ -36,6 +36,7 @@ interface Props {
|
|
|
36
36
|
* - `dropzone_files_dropped` — files dropped via drag ({ method: 'drag', file_count })
|
|
37
37
|
* - `dropzone_browse_opened` — file picker opened ({ method: 'keyboard' | 'click' })
|
|
38
38
|
* - `dropzone_deploy_succeeded` — deploy went live ({ method, site_name, file_count })
|
|
39
|
+
* - `dropzone_deploy_failed` — deploy errored out ({ method, reason, file_count? })
|
|
39
40
|
*/
|
|
40
41
|
onTrack?: TrackFn;
|
|
41
42
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getDigest
|
|
1
|
+
import { getDigest } from './digest';
|
|
2
2
|
import type { DropClient } from './client';
|
|
3
3
|
import type { DeployProgress, DeployResult, ProcessedFile } from './types';
|
|
4
4
|
|
|
@@ -43,7 +43,9 @@ export async function deployFiles(
|
|
|
43
43
|
|
|
44
44
|
const total = deploy.required.length;
|
|
45
45
|
onProgress?.({ phase: 'uploading', uploaded: 0, total });
|
|
46
|
-
|
|
46
|
+
// File PUTs and readiness polling both key off `deploy_id` (BSON), NOT
|
|
47
|
+
// `deploy.id` (the site UUID) — see the note in client.waitUntilReady.
|
|
48
|
+
await uploadRequired(client, deploy.deploy_id, files, new Set(deploy.required), token, uploaded =>
|
|
47
49
|
onProgress?.({ phase: 'uploading', uploaded, total })
|
|
48
50
|
);
|
|
49
51
|
|
|
@@ -5,9 +5,13 @@ import type { ProcessedFile } from './types';
|
|
|
5
5
|
|
|
6
6
|
const rusha = new Rusha();
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** A single path segment we never deploy: dotfiles, macOS metadata, deps. */
|
|
9
|
+
const isJunkName = (name: string) =>
|
|
9
10
|
name.startsWith('.') || name === '__MACOSX' || name === 'node_modules';
|
|
10
11
|
|
|
12
|
+
/** True if any segment of the path is junk (e.g. "foo/__MACOSX/bar", ".git/x"). */
|
|
13
|
+
const isJunkPath = (path: string) => path.split('/').some(seg => seg && isJunkName(seg));
|
|
14
|
+
|
|
11
15
|
const slashPrefix = (p: string) => (p.startsWith('/') ? p : `/${p}`);
|
|
12
16
|
|
|
13
17
|
function toProcessedFile(path: string, content: ArrayBuffer, name: string): ProcessedFile {
|
|
@@ -36,7 +40,7 @@ async function readDirEntry(entry: any): Promise<ProcessedFile[]> {
|
|
|
36
40
|
const batch: any[] = await new Promise((res, rej) => reader.readEntries(res, rej));
|
|
37
41
|
if (!batch.length) break;
|
|
38
42
|
for (const child of batch) {
|
|
39
|
-
if (
|
|
43
|
+
if (isJunkName(child.name)) continue;
|
|
40
44
|
out.push(...(child.isDirectory ? await readDirEntry(child) : [await readFileEntry(child)]));
|
|
41
45
|
}
|
|
42
46
|
}
|
|
@@ -62,7 +66,7 @@ export async function readDataTransfer(dt: DataTransfer): Promise<ProcessedFile[
|
|
|
62
66
|
if (entries.length) {
|
|
63
67
|
const nested = await Promise.all(
|
|
64
68
|
entries.map(e =>
|
|
65
|
-
|
|
69
|
+
isJunkName(e.name) ? [] : e.isDirectory ? readDirEntry(e) : readFileEntry(e).then(f => [f])
|
|
66
70
|
)
|
|
67
71
|
);
|
|
68
72
|
return normalizeFiles(nested.flat());
|
|
@@ -88,7 +92,7 @@ export async function readFileList(files: FileList): Promise<ProcessedFile[]> {
|
|
|
88
92
|
|
|
89
93
|
// --- zip --------------------------------------------------------------------
|
|
90
94
|
|
|
91
|
-
|
|
95
|
+
async function readZip(zip: File): Promise<ProcessedFile[]> {
|
|
92
96
|
const { unzip } = await import('fflate');
|
|
93
97
|
const buf = new Uint8Array(await zip.arrayBuffer());
|
|
94
98
|
const entries = await new Promise<Record<string, Uint8Array>>((resolve, reject) =>
|
|
@@ -97,8 +101,8 @@ export async function readZip(zip: File): Promise<ProcessedFile[]> {
|
|
|
97
101
|
const out: ProcessedFile[] = [];
|
|
98
102
|
for (const [path, bytes] of Object.entries(entries)) {
|
|
99
103
|
// fflate uses a trailing slash to signal directory entries; also skip the
|
|
100
|
-
// usual junk (macOS metadata, dotfiles at any depth).
|
|
101
|
-
if (path.endsWith('/') ||
|
|
104
|
+
// usual junk (macOS metadata, dotfiles/deps at any depth).
|
|
105
|
+
if (path.endsWith('/') || isJunkPath(path)) continue;
|
|
102
106
|
// `bytes.buffer` is ArrayBufferLike; fflate always backs entries with a plain
|
|
103
107
|
// ArrayBuffer, so narrow it for toProcessedFile's ArrayBuffer parameter.
|
|
104
108
|
const content = bytes.buffer.slice(
|
|
@@ -112,7 +116,7 @@ export async function readZip(zip: File): Promise<ProcessedFile[]> {
|
|
|
112
116
|
|
|
113
117
|
// --- path normalization (strip the common root folder) ----------------------
|
|
114
118
|
|
|
115
|
-
|
|
119
|
+
function normalizeFiles(files: ProcessedFile[]): ProcessedFile[] {
|
|
116
120
|
if (!files.length) return files;
|
|
117
121
|
const split = (p: string) => slashPrefix(p).split('/').slice(1); // drop leading ''
|
|
118
122
|
let common = split(files[0].path).slice(0, -1);
|
|
@@ -129,13 +133,16 @@ export function normalizeFiles(files: ProcessedFile[]): ProcessedFile[] {
|
|
|
129
133
|
|
|
130
134
|
// --- index.html validation (UI can surface these as warnings) ---------------
|
|
131
135
|
|
|
136
|
+
const htmlFiles = (files: ProcessedFile[]) => files.filter(f => /\.html?$/i.test(f.name));
|
|
137
|
+
const hasIndex = (html: ProcessedFile[]) => html.some(f => /^index\.html?$/i.test(f.name));
|
|
138
|
+
|
|
132
139
|
export function getSingleNonIndexHtmlFileName(files: ProcessedFile[]): string | null {
|
|
133
|
-
const html = files
|
|
134
|
-
if (
|
|
140
|
+
const html = htmlFiles(files);
|
|
141
|
+
if (hasIndex(html)) return null;
|
|
135
142
|
return html.length === 1 ? html[0].name : null;
|
|
136
143
|
}
|
|
137
144
|
|
|
138
145
|
export function hasMultipleHtmlFilesWithoutIndex(files: ProcessedFile[]): boolean {
|
|
139
|
-
const html = files
|
|
140
|
-
return html.length > 1 && !
|
|
146
|
+
const html = htmlFiles(files);
|
|
147
|
+
return html.length > 1 && !hasIndex(html);
|
|
141
148
|
}
|
|
@@ -86,10 +86,21 @@ export function useDropDeploy({
|
|
|
86
86
|
async function deploy(read: () => Promise<ProcessedFile[]>, source: DeploySource) {
|
|
87
87
|
setWarning(null);
|
|
88
88
|
setStatus({ kind: 'reading' });
|
|
89
|
+
|
|
90
|
+
// Surface a failure: move to the error state and emit the matching
|
|
91
|
+
// analytics event. Centralised so every failure path (empty selection, a
|
|
92
|
+
// read/deploy throw) reports uniformly — the mirror of the
|
|
93
|
+
// `dropzone_deploy_succeeded` event on the happy path. `file_count` is only
|
|
94
|
+
// included where the file set is known (it isn't if `read()` itself threw).
|
|
95
|
+
const fail = (message: string, extra?: Record<string, unknown>) => {
|
|
96
|
+
setStatus({ kind: 'error', message });
|
|
97
|
+
track('dropzone_deploy_failed', { method: source, reason: message, ...extra });
|
|
98
|
+
};
|
|
99
|
+
|
|
89
100
|
try {
|
|
90
101
|
const files = await read();
|
|
91
102
|
if (!files.length) {
|
|
92
|
-
|
|
103
|
+
fail('No files found to deploy.', { file_count: 0 });
|
|
93
104
|
return;
|
|
94
105
|
}
|
|
95
106
|
|
|
@@ -136,7 +147,7 @@ export function useDropDeploy({
|
|
|
136
147
|
// `#drop_token=` and persists it for the claim + post-signup steps.
|
|
137
148
|
window.location.assign(`${claimUrl(result.subdomain)}#drop_token=${token}`);
|
|
138
149
|
} catch (err) {
|
|
139
|
-
|
|
150
|
+
fail(err instanceof Error ? err.message : String(err));
|
|
140
151
|
}
|
|
141
152
|
}
|
|
142
153
|
|
|
Binary file
|