@netlify/spark-ui 1.25.0 → 1.26.0-alpha.1
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/assets/DropZone.css +1 -0
- package/dist/chunks/{AskNetlify.jaxhKBOK.js → AskNetlify.B3RnU2w-.js} +124 -126
- package/dist/chunks/_commonjsHelpers.DaMA6jEr.js +8 -0
- package/dist/chunks/jszip.min.DGG1sjYa.js +2327 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/preact/AskNetlify/AskNetlify.js +1 -1
- package/dist/components/preact/DropZone/DropZone.d.ts +19 -0
- package/dist/components/preact/DropZone/DropZone.js +207 -0
- package/dist/components/preact/DropZone/drop-core/client.d.ts +19 -0
- package/dist/components/preact/DropZone/drop-core/client.js +41 -0
- package/dist/components/preact/DropZone/drop-core/deploy.d.ts +6 -0
- package/dist/components/preact/DropZone/drop-core/deploy.js +30 -0
- package/dist/components/preact/DropZone/drop-core/digest.d.ts +3 -0
- package/dist/components/preact/DropZone/drop-core/digest.js +12 -0
- package/dist/components/preact/DropZone/drop-core/index.d.ts +5 -0
- package/dist/components/preact/DropZone/drop-core/index.js +16 -0
- package/dist/components/preact/DropZone/drop-core/readFiles.d.ts +15 -0
- package/dist/components/preact/DropZone/drop-core/readFiles.js +615 -0
- package/dist/components/preact/DropZone/drop-core/types.d.ts +30 -0
- package/dist/components/preact/DropZone/drop-core/types.js +1 -0
- package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.js +1 -1
- package/dist/components/preact/index.js +1 -1
- package/package.json +4 -2
- package/packages/components/index.ts +16 -0
- package/packages/components/preact/DropZone/DropZone.css +340 -0
- package/packages/components/preact/DropZone/DropZone.tsx +295 -0
- package/packages/components/preact/DropZone/drop-core/client.ts +61 -0
- package/packages/components/preact/DropZone/drop-core/deploy.ts +55 -0
- package/packages/components/preact/DropZone/drop-core/digest.ts +11 -0
- package/packages/components/preact/DropZone/drop-core/index.ts +5 -0
- package/packages/components/preact/DropZone/drop-core/readFiles.ts +133 -0
- package/packages/components/preact/DropZone/drop-core/types.ts +35 -0
|
@@ -5,4 +5,7 @@ export { default as SearchLink } from './preact/SearchModal/components/SearchLin
|
|
|
5
5
|
export { default as SearchHeading } from './preact/SearchModal/components/SearchHeading/SearchHeading';
|
|
6
6
|
export { default as SearchToggle } from './preact/SearchModal/components/SearchToggle/SearchToggle';
|
|
7
7
|
export { default as SearchModal } from './preact/SearchModal/components/SearchModal/SearchModal';
|
|
8
|
+
export { default as DropZone } from './preact/DropZone/DropZone';
|
|
9
|
+
export { AnonymousDropClient, deployFiles, readDataTransfer, readFileList, } from './preact/DropZone/drop-core';
|
|
10
|
+
export type { DropClient, Deploy, Digest, DeployResult, DeployProgress, DeployPhase, ProcessedFile, } from './preact/DropZone/drop-core';
|
|
8
11
|
export { type IconName } from './preact/Icon';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
2
|
import "../../../chunks/hooks.module.DRcxknIz.js";
|
|
3
|
-
import { A as d } from "../../../chunks/AskNetlify.
|
|
3
|
+
import { A as d } from "../../../chunks/AskNetlify.B3RnU2w-.js";
|
|
4
4
|
import "./components/QuestionList/questions.js";
|
|
5
5
|
import "./components/QuestionList/QuestionList.js";
|
|
6
6
|
import "./components/BackButton.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DropClient } from './drop-core';
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Override the API base (e.g. for a staging environment). */
|
|
4
|
+
apiBase?: string;
|
|
5
|
+
/** Inject a custom client (e.g. for testing). Defaults to AnonymousDropClient. */
|
|
6
|
+
client?: DropClient;
|
|
7
|
+
/** Build the "claim this site" URL from the assigned site name (subdomain). */
|
|
8
|
+
claimUrl?: (siteName: string) => string;
|
|
9
|
+
/** Called once the deploy is live. */
|
|
10
|
+
onDeploy?: (result: {
|
|
11
|
+
url: string;
|
|
12
|
+
token: string;
|
|
13
|
+
siteName: string;
|
|
14
|
+
siteId: string;
|
|
15
|
+
}) => void;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export default function DropZone({ apiBase, client, claimUrl, onDeploy, className, }: Props): import("preact").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { u as e } from "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
+
import { d as k, A as I } from "../../../chunks/hooks.module.DRcxknIz.js";
|
|
3
|
+
import b from "../Icon/index.js";
|
|
4
|
+
import { getSingleNonIndexHtmlFileName as $, hasMultipleHtmlFilesWithoutIndex as D, readDataTransfer as F, readFileList as T } from "./drop-core/readFiles.js";
|
|
5
|
+
import { AnonymousDropClient as M } from "./drop-core/client.js";
|
|
6
|
+
import { deployFiles as P } from "./drop-core/deploy.js";
|
|
7
|
+
import { Fragment as p } from "preact";
|
|
8
|
+
import '../../../assets/DropZone.css';const U = (n) => `https://app.netlify.com/drop/${n}/claim`;
|
|
9
|
+
function A(n) {
|
|
10
|
+
switch (n.phase) {
|
|
11
|
+
case "creating":
|
|
12
|
+
return { kind: "creating" };
|
|
13
|
+
case "uploading":
|
|
14
|
+
return { kind: "uploading", uploaded: n.uploaded ?? 0, total: n.total ?? 0 };
|
|
15
|
+
case "processing":
|
|
16
|
+
case "ready":
|
|
17
|
+
return { kind: "processing" };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function Y({
|
|
21
|
+
apiBase: n,
|
|
22
|
+
client: h,
|
|
23
|
+
claimUrl: d = U,
|
|
24
|
+
onDeploy: s,
|
|
25
|
+
className: l
|
|
26
|
+
}) {
|
|
27
|
+
const [o, t] = k({ kind: "idle" }), [w, c] = k(null), [C, g] = k(!1), x = I(h ?? new M(n)).current, f = o.kind !== "idle" && o.kind !== "done" && o.kind !== "error";
|
|
28
|
+
async function z(i) {
|
|
29
|
+
c(null), t({ kind: "reading" });
|
|
30
|
+
try {
|
|
31
|
+
const r = await i();
|
|
32
|
+
if (!r.length) {
|
|
33
|
+
t({ kind: "error", message: "No files found to deploy." });
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const y = $(r);
|
|
37
|
+
y ? c(`No index.html found — "${y}" won’t be served at the site root.`) : D(r) && c("No index.html found — your site may not have a landing page.");
|
|
38
|
+
const { url: v, token: m, deploy: a } = await P(x, r, {
|
|
39
|
+
onProgress: (S) => t(A(S))
|
|
40
|
+
});
|
|
41
|
+
try {
|
|
42
|
+
localStorage.setItem("drop-token", m), localStorage.setItem("dropSiteName", a.subdomain);
|
|
43
|
+
} catch {
|
|
44
|
+
}
|
|
45
|
+
t({ kind: "done", url: v, token: m, siteName: a.subdomain, siteId: a.id }), s == null || s({ url: v, token: m, siteName: a.subdomain, siteId: a.id });
|
|
46
|
+
} catch (r) {
|
|
47
|
+
t({ kind: "error", message: r instanceof Error ? r.message : String(r) });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function N() {
|
|
51
|
+
c(null), t({ kind: "idle" });
|
|
52
|
+
}
|
|
53
|
+
return /* @__PURE__ */ e(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
class: `n-dropzone${C ? " is-active" : ""}${f ? " is-busy" : ""}${l ? ` ${l}` : ""}`,
|
|
57
|
+
"data-state": o.kind,
|
|
58
|
+
onDragOver: (i) => {
|
|
59
|
+
f || (i.preventDefault(), g(!0));
|
|
60
|
+
},
|
|
61
|
+
onDragLeave: (i) => {
|
|
62
|
+
i.currentTarget === i.target && g(!1);
|
|
63
|
+
},
|
|
64
|
+
onDrop: (i) => {
|
|
65
|
+
if (i.preventDefault(), g(!1), f) return;
|
|
66
|
+
const r = i.dataTransfer;
|
|
67
|
+
r && z(() => F(r));
|
|
68
|
+
},
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ e("div", { class: "n-dropzone-panel", children: /* @__PURE__ */ e(B, { status: o, claimUrl: d, onReset: N, onFiles: z }) }, o.kind),
|
|
71
|
+
w && o.kind !== "error" && /* @__PURE__ */ e("p", { class: "n-dropzone-warning n-fadeIn", role: "status", children: [
|
|
72
|
+
/* @__PURE__ */ e(b, { name: "lightbulb", className: "n-dropzone-warning-icon" }),
|
|
73
|
+
w
|
|
74
|
+
] })
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
function B({
|
|
80
|
+
status: n,
|
|
81
|
+
claimUrl: h,
|
|
82
|
+
onReset: d,
|
|
83
|
+
onFiles: s
|
|
84
|
+
}) {
|
|
85
|
+
switch (n.kind) {
|
|
86
|
+
case "idle":
|
|
87
|
+
return /* @__PURE__ */ e(p, { children: [
|
|
88
|
+
/* @__PURE__ */ e(L, {}),
|
|
89
|
+
/* @__PURE__ */ e("p", { class: "n-dropzone-title", children: "Drag & drop your site folder or zip" }),
|
|
90
|
+
/* @__PURE__ */ e("p", { class: "n-dropzone-subtitle", children: "Deploys instantly to a live URL — no account needed." }),
|
|
91
|
+
/* @__PURE__ */ e("label", { class: "n-dropzone-browse", children: [
|
|
92
|
+
"Browse files",
|
|
93
|
+
/* @__PURE__ */ e(
|
|
94
|
+
"input",
|
|
95
|
+
{
|
|
96
|
+
type: "file",
|
|
97
|
+
hidden: !0,
|
|
98
|
+
multiple: !0,
|
|
99
|
+
webkitdirectory: "",
|
|
100
|
+
directory: "",
|
|
101
|
+
onChange: (l) => {
|
|
102
|
+
var t;
|
|
103
|
+
const o = l.currentTarget;
|
|
104
|
+
(t = o.files) != null && t.length && s(() => T(o.files));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
] })
|
|
109
|
+
] });
|
|
110
|
+
case "reading":
|
|
111
|
+
return /* @__PURE__ */ e(u, { label: "Reading files…" });
|
|
112
|
+
case "creating":
|
|
113
|
+
return /* @__PURE__ */ e(u, { label: "Creating deploy…" });
|
|
114
|
+
case "processing":
|
|
115
|
+
return /* @__PURE__ */ e(u, { label: "Processing — almost live…" });
|
|
116
|
+
case "uploading": {
|
|
117
|
+
const l = n.total ? Math.round(n.uploaded / n.total * 100) : 0;
|
|
118
|
+
return /* @__PURE__ */ e(p, { children: [
|
|
119
|
+
/* @__PURE__ */ e(u, { label: `Uploading ${n.uploaded}/${n.total} files…` }),
|
|
120
|
+
/* @__PURE__ */ e("div", { class: "n-dropzone-progress", role: "progressbar", "aria-valuenow": l, children: /* @__PURE__ */ e("div", { class: "n-dropzone-progress-bar", style: { width: `${l}%` } }) })
|
|
121
|
+
] });
|
|
122
|
+
}
|
|
123
|
+
case "done":
|
|
124
|
+
return /* @__PURE__ */ e(p, { children: [
|
|
125
|
+
/* @__PURE__ */ e(j, {}),
|
|
126
|
+
/* @__PURE__ */ e("p", { class: "n-dropzone-title", children: "Your site is live!" }),
|
|
127
|
+
/* @__PURE__ */ e("a", { class: "n-dropzone-link", href: n.url, target: "_blank", rel: "noopener noreferrer", children: [
|
|
128
|
+
n.url.replace(/^https?:\/\//, ""),
|
|
129
|
+
/* @__PURE__ */ e(b, { name: "link", className: "n-dropzone-link-icon" })
|
|
130
|
+
] }),
|
|
131
|
+
/* @__PURE__ */ e("div", { class: "n-dropzone-actions", children: [
|
|
132
|
+
/* @__PURE__ */ e("a", { class: "n-dropzone-browse", href: h(n.siteName), children: "Claim this site" }),
|
|
133
|
+
/* @__PURE__ */ e("button", { type: "button", class: "n-dropzone-reset", onClick: d, children: "Deploy another" })
|
|
134
|
+
] })
|
|
135
|
+
] });
|
|
136
|
+
case "error":
|
|
137
|
+
return /* @__PURE__ */ e(p, { children: [
|
|
138
|
+
/* @__PURE__ */ e("p", { class: "n-dropzone-title n-dropzone-title--error", children: "Something went wrong" }),
|
|
139
|
+
/* @__PURE__ */ e("p", { class: "n-dropzone-subtitle", role: "alert", children: n.message }),
|
|
140
|
+
/* @__PURE__ */ e("button", { type: "button", class: "n-dropzone-browse", onClick: d, children: "Try again" })
|
|
141
|
+
] });
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function u({ label: n }) {
|
|
145
|
+
return /* @__PURE__ */ e("div", { class: "n-dropzone-loading", children: [
|
|
146
|
+
/* @__PURE__ */ e("span", { class: "n-dropzone-spinner", "aria-hidden": "true" }),
|
|
147
|
+
/* @__PURE__ */ e("p", { class: "n-dropzone-subtitle", "aria-live": "polite", children: [
|
|
148
|
+
n,
|
|
149
|
+
" ",
|
|
150
|
+
/* @__PURE__ */ e("span", { class: "n-dropzone-nudge", children: "Please don’t refresh." })
|
|
151
|
+
] })
|
|
152
|
+
] });
|
|
153
|
+
}
|
|
154
|
+
function L() {
|
|
155
|
+
return /* @__PURE__ */ e("span", { class: "n-dropzone-glyph", "aria-hidden": "true", children: /* @__PURE__ */ e("svg", { viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
156
|
+
/* @__PURE__ */ e(
|
|
157
|
+
"path",
|
|
158
|
+
{
|
|
159
|
+
class: "n-dropzone-glyph-tray",
|
|
160
|
+
d: "M8 30v6a4 4 0 0 0 4 4h24a4 4 0 0 0 4-4v-6",
|
|
161
|
+
stroke: "currentColor",
|
|
162
|
+
"stroke-width": "3",
|
|
163
|
+
"stroke-linecap": "round"
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
/* @__PURE__ */ e(
|
|
167
|
+
"path",
|
|
168
|
+
{
|
|
169
|
+
class: "n-dropzone-glyph-arrow",
|
|
170
|
+
d: "M24 32V10m0 0-8 8m8-8 8 8",
|
|
171
|
+
stroke: "currentColor",
|
|
172
|
+
"stroke-width": "3",
|
|
173
|
+
"stroke-linecap": "round",
|
|
174
|
+
"stroke-linejoin": "round"
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
] }) });
|
|
178
|
+
}
|
|
179
|
+
function j() {
|
|
180
|
+
return /* @__PURE__ */ e("span", { class: "n-dropzone-glyph n-dropzone-glyph--success", "aria-hidden": "true", children: /* @__PURE__ */ e("svg", { viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
181
|
+
/* @__PURE__ */ e(
|
|
182
|
+
"circle",
|
|
183
|
+
{
|
|
184
|
+
class: "n-dropzone-check-ring",
|
|
185
|
+
cx: "24",
|
|
186
|
+
cy: "24",
|
|
187
|
+
r: "20",
|
|
188
|
+
stroke: "currentColor",
|
|
189
|
+
"stroke-width": "3"
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
/* @__PURE__ */ e(
|
|
193
|
+
"path",
|
|
194
|
+
{
|
|
195
|
+
class: "n-dropzone-check-mark",
|
|
196
|
+
d: "M15 24.5 21 30.5 33 18",
|
|
197
|
+
stroke: "currentColor",
|
|
198
|
+
"stroke-width": "3",
|
|
199
|
+
"stroke-linecap": "round",
|
|
200
|
+
"stroke-linejoin": "round"
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
] }) });
|
|
204
|
+
}
|
|
205
|
+
export {
|
|
206
|
+
Y as default
|
|
207
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Deploy, Digest } from './types';
|
|
2
|
+
export interface DropClient {
|
|
3
|
+
getToken(): Promise<string>;
|
|
4
|
+
createDeploy(digest: Digest, token: string): Promise<Deploy>;
|
|
5
|
+
uploadFile(deployId: string, path: string, content: ArrayBuffer, token: string): Promise<void>;
|
|
6
|
+
waitUntilReady(deploy: Deploy, token: string): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Unauthenticated drop client. Authorized server-side by the Referer header,
|
|
10
|
+
* so it only works from an allowlisted origin (see backend checklist).
|
|
11
|
+
*/
|
|
12
|
+
export declare class AnonymousDropClient implements DropClient {
|
|
13
|
+
private apiBase;
|
|
14
|
+
constructor(apiBase?: string);
|
|
15
|
+
getToken(): Promise<string>;
|
|
16
|
+
createDeploy(files: Digest, token: string): Promise<Deploy>;
|
|
17
|
+
uploadFile(deployId: string, path: string, content: ArrayBuffer, token: string): Promise<void>;
|
|
18
|
+
waitUntilReady(deploy: Deploy, token: string): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const i = "https://api.netlify.com/api/v1";
|
|
2
|
+
class n {
|
|
3
|
+
constructor(e = i) {
|
|
4
|
+
this.apiBase = e;
|
|
5
|
+
}
|
|
6
|
+
async getToken() {
|
|
7
|
+
const e = await fetch(`${this.apiBase}/drop/token`, { method: "POST" });
|
|
8
|
+
if (!e.ok) throw new Error(`drop/token failed: ${e.status}`);
|
|
9
|
+
return (await e.json()).token;
|
|
10
|
+
}
|
|
11
|
+
async createDeploy(e, o) {
|
|
12
|
+
const t = await fetch(`${this.apiBase}/drop`, {
|
|
13
|
+
method: "POST",
|
|
14
|
+
headers: { "Content-Type": "application/json" },
|
|
15
|
+
body: JSON.stringify({ files: e, token: o })
|
|
16
|
+
});
|
|
17
|
+
if (!t.ok) throw new Error(`drop failed: ${t.status}`);
|
|
18
|
+
return t.json();
|
|
19
|
+
}
|
|
20
|
+
async uploadFile(e, o, t, a) {
|
|
21
|
+
const r = await fetch(`${this.apiBase}/deploys/${e}/files${o}`, {
|
|
22
|
+
method: "PUT",
|
|
23
|
+
headers: { "Content-Type": "application/octet-stream", Authorization: `Bearer ${a}` },
|
|
24
|
+
body: t
|
|
25
|
+
});
|
|
26
|
+
if (!r.ok) throw new Error(`upload ${o} failed: ${r.status}`);
|
|
27
|
+
}
|
|
28
|
+
async waitUntilReady(e, o) {
|
|
29
|
+
for (let t = 0; t < 600; t++) {
|
|
30
|
+
const a = await fetch(`${this.apiBase}/deploys/${e.id}`, {
|
|
31
|
+
headers: { Authorization: `Bearer ${o}` }
|
|
32
|
+
});
|
|
33
|
+
if (a.ok && (await a.json()).state === "ready") return;
|
|
34
|
+
await new Promise((r) => setTimeout(r, 1e3));
|
|
35
|
+
}
|
|
36
|
+
throw new Error("Deploy did not become ready in time");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
n as AnonymousDropClient
|
|
41
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DropClient } from './client';
|
|
2
|
+
import { DeployProgress, DeployResult, ProcessedFile } from './types';
|
|
3
|
+
export interface DeployOptions {
|
|
4
|
+
onProgress?: (e: DeployProgress) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function deployFiles(client: DropClient, files: ProcessedFile[], opts?: DeployOptions): Promise<DeployResult>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { getDigest as w, getShas as y } from "./digest.js";
|
|
2
|
+
const r = 5;
|
|
3
|
+
async function d(e, h, u, t, i, a) {
|
|
4
|
+
const n = u.filter((p) => t.has(p.sha));
|
|
5
|
+
let l = 0, c = 0;
|
|
6
|
+
const o = async () => {
|
|
7
|
+
for (; l < n.length; ) {
|
|
8
|
+
const p = n[l++];
|
|
9
|
+
await e.uploadFile(h, p.path, p.content, i), a == null || a(++c);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
await Promise.all(Array.from({ length: Math.min(r, n.length) }, o));
|
|
13
|
+
}
|
|
14
|
+
async function f(e, h, u = {}) {
|
|
15
|
+
if (!h.length) throw new Error("No files to deploy");
|
|
16
|
+
const { onProgress: t } = u;
|
|
17
|
+
t == null || t({ phase: "creating" });
|
|
18
|
+
const i = await e.getToken(), a = await e.createDeploy(w(h), i), n = a.required.length;
|
|
19
|
+
return t == null || t({ phase: "uploading", uploaded: 0, total: n }), await d(
|
|
20
|
+
e,
|
|
21
|
+
a.id,
|
|
22
|
+
h,
|
|
23
|
+
y(a.required),
|
|
24
|
+
i,
|
|
25
|
+
(l) => t == null ? void 0 : t({ phase: "uploading", uploaded: l, total: n })
|
|
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
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
f as deployFiles
|
|
30
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getDigest as o, getShas as r } from "./digest.js";
|
|
2
|
+
import { getSingleNonIndexHtmlFileName as l, hasMultipleHtmlFilesWithoutIndex as a, normalizeFiles as m, readDataTransfer as n, readFileList as s, readZip as p } from "./readFiles.js";
|
|
3
|
+
import { AnonymousDropClient as x } from "./client.js";
|
|
4
|
+
import { deployFiles as g } from "./deploy.js";
|
|
5
|
+
export {
|
|
6
|
+
x as AnonymousDropClient,
|
|
7
|
+
g as deployFiles,
|
|
8
|
+
o as getDigest,
|
|
9
|
+
r as getShas,
|
|
10
|
+
l as getSingleNonIndexHtmlFileName,
|
|
11
|
+
a as hasMultipleHtmlFilesWithoutIndex,
|
|
12
|
+
m as normalizeFiles,
|
|
13
|
+
n as readDataTransfer,
|
|
14
|
+
s as readFileList,
|
|
15
|
+
p as readZip
|
|
16
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ProcessedFile } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Read a DataTransfer from a drop event into ProcessedFiles.
|
|
4
|
+
*
|
|
5
|
+
* NOTE: `webkitGetAsEntry()` must be called synchronously inside the drop
|
|
6
|
+
* handler — the DataTransfer is detached once the event turn ends. The
|
|
7
|
+
* component captures entries first (see `readDroppedEntries`) then calls the
|
|
8
|
+
* async readers, so this function is safe to `await`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function readDataTransfer(dt: DataTransfer): Promise<ProcessedFile[]>;
|
|
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
|
+
export declare function getSingleNonIndexHtmlFileName(files: ProcessedFile[]): string | null;
|
|
15
|
+
export declare function hasMultipleHtmlFilesWithoutIndex(files: ProcessedFile[]): boolean;
|