@netlify/spark-ui 1.31.0-alpha.2 → 1.31.0-alpha.4
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/index.d.ts +2 -2
- package/dist/components/preact/DropZone/DropZone.d.ts +28 -2
- package/dist/components/preact/DropZone/DropZone.js +58 -51
- package/dist/components/preact/DropZone/DropZone.test.d.ts +1 -0
- package/dist/components/preact/DropZone/index.d.ts +3 -3
- package/dist/components/preact/DropZone/index.js +25 -23
- package/dist/components/preact/DropZone/useDropDeploy.d.ts +11 -6
- package/dist/components/preact/DropZone/useDropDeploy.js +183 -129
- package/dist/components/preact/DropZone/useDropDeploy.test.d.ts +1 -0
- package/dist/components/preact/index.d.ts +2 -2
- package/dist/components/preact/index.js +25 -19
- package/dist/drop-core/analytics.d.ts +107 -0
- package/dist/drop-core/analytics.js +21 -0
- package/dist/drop-core/analytics.test.d.ts +1 -0
- package/dist/drop-core/authedApi.d.ts +55 -0
- package/dist/drop-core/authedApi.js +35 -0
- package/dist/drop-core/authedApi.test.d.ts +1 -0
- package/dist/drop-core/authedDropClient.d.ts +100 -0
- package/dist/drop-core/authedDropClient.js +109 -0
- package/dist/drop-core/authedDropClient.test.d.ts +1 -0
- package/dist/{components/preact/DropZone/drop-core → drop-core}/buildClient.d.ts +32 -26
- package/dist/drop-core/buildClient.js +84 -0
- package/dist/drop-core/buildClient.test.d.ts +1 -0
- package/dist/drop-core/buildStash.d.ts +37 -0
- package/dist/drop-core/buildStash.js +84 -0
- package/dist/drop-core/buildStash.test.d.ts +0 -0
- package/dist/{components/preact/DropZone/drop-core → drop-core}/deploy.d.ts +7 -0
- package/dist/drop-core/deploy.js +53 -0
- package/dist/drop-core/deploy.test.d.ts +1 -0
- package/dist/drop-core/detectBuild.test.d.ts +1 -0
- package/dist/drop-core/digest.test.d.ts +1 -0
- package/dist/{components/preact/DropZone/drop-core → drop-core}/errors.js +1 -1
- package/dist/drop-core/errors.test.d.ts +1 -0
- package/dist/drop-core/fileTypes.test.d.ts +1 -0
- package/dist/{components/preact/DropZone/drop-core → drop-core}/index.d.ts +3 -0
- package/dist/drop-core/index.js +51 -0
- package/dist/{components/preact/DropZone/drop-core → drop-core}/readFiles.js +2 -2
- package/dist/drop-core/readFiles.test.d.ts +1 -0
- package/dist/{components/preact/DropZone/drop-core → drop-core}/types.d.ts +10 -0
- package/dist/{components/preact/DropZone/drop-core → drop-core}/zip.js +1 -1
- package/dist/drop-core/zip.test.d.ts +1 -0
- package/package.json +4 -1
- package/packages/components/index.ts +19 -0
- package/packages/components/preact/DropZone/DropZone.test.ts +71 -0
- package/packages/components/preact/DropZone/DropZone.tsx +32 -2
- package/packages/components/preact/DropZone/index.tsx +14 -3
- package/packages/components/preact/DropZone/useDropDeploy.test.ts +376 -0
- package/packages/components/preact/DropZone/useDropDeploy.ts +305 -134
- package/packages/components/preact/index.ts +19 -2
- package/packages/drop-core/analytics.test.ts +17 -0
- package/packages/drop-core/analytics.ts +122 -0
- package/packages/drop-core/authedApi.test.ts +100 -0
- package/packages/drop-core/authedApi.ts +94 -0
- package/packages/drop-core/authedDropClient.test.ts +196 -0
- package/packages/drop-core/authedDropClient.ts +210 -0
- package/packages/drop-core/buildClient.test.ts +112 -0
- package/packages/{components/preact/DropZone/drop-core → drop-core}/buildClient.ts +55 -70
- package/packages/drop-core/buildStash.test.ts +85 -0
- package/packages/drop-core/buildStash.ts +185 -0
- package/packages/drop-core/deploy.test.ts +135 -0
- package/packages/{components/preact/DropZone/drop-core → drop-core}/deploy.ts +18 -4
- package/packages/drop-core/detectBuild.test.ts +139 -0
- package/packages/drop-core/digest.test.ts +24 -0
- package/packages/drop-core/errors.test.ts +69 -0
- package/packages/{components/preact/DropZone/drop-core → drop-core}/errors.ts +1 -1
- package/packages/drop-core/fileTypes.test.ts +37 -0
- package/packages/{components/preact/DropZone/drop-core → drop-core}/index.ts +3 -0
- package/packages/drop-core/readFiles.test.ts +125 -0
- package/packages/{components/preact/DropZone/drop-core → drop-core}/types.ts +12 -6
- package/packages/drop-core/zip.test.ts +92 -0
- package/dist/components/preact/DropZone/drop-core/authedDropClient.d.ts +0 -77
- package/dist/components/preact/DropZone/drop-core/authedDropClient.js +0 -97
- package/dist/components/preact/DropZone/drop-core/buildClient.js +0 -92
- package/dist/components/preact/DropZone/drop-core/deploy.js +0 -48
- package/dist/components/preact/DropZone/drop-core/index.js +0 -36
- package/packages/components/preact/DropZone/drop-core/authedDropClient.ts +0 -185
- /package/dist/{components/preact/DropZone/drop-core → drop-core}/client.d.ts +0 -0
- /package/dist/{components/preact/DropZone/drop-core → drop-core}/client.js +0 -0
- /package/dist/{components/preact/DropZone/drop-core → drop-core}/detectBuild.d.ts +0 -0
- /package/dist/{components/preact/DropZone/drop-core → drop-core}/detectBuild.js +0 -0
- /package/dist/{components/preact/DropZone/drop-core → drop-core}/digest.d.ts +0 -0
- /package/dist/{components/preact/DropZone/drop-core → drop-core}/digest.js +0 -0
- /package/dist/{components/preact/DropZone/drop-core → drop-core}/errors.d.ts +0 -0
- /package/dist/{components/preact/DropZone/drop-core → drop-core}/fileTypes.d.ts +0 -0
- /package/dist/{components/preact/DropZone/drop-core → drop-core}/fileTypes.js +0 -0
- /package/dist/{components/preact/DropZone/drop-core → drop-core}/readFiles.d.ts +0 -0
- /package/dist/{components/preact/DropZone/drop-core → drop-core}/types.js +0 -0
- /package/dist/{components/preact/DropZone/drop-core → drop-core}/zip.d.ts +0 -0
- /package/packages/{components/preact/DropZone/drop-core → drop-core}/client.ts +0 -0
- /package/packages/{components/preact/DropZone/drop-core → drop-core}/detectBuild.ts +0 -0
- /package/packages/{components/preact/DropZone/drop-core → drop-core}/digest.ts +0 -0
- /package/packages/{components/preact/DropZone/drop-core → drop-core}/fileTypes.ts +0 -0
- /package/packages/{components/preact/DropZone/drop-core → drop-core}/readFiles.ts +0 -0
- /package/packages/{components/preact/DropZone/drop-core → drop-core}/zip.ts +0 -0
|
@@ -5,6 +5,6 @@ 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 { DropZone, AnonymousDropClient, AuthenticatedBuildClient, AuthenticatedDropClient, deployBuild, deployFiles, detectBuild, inferBuildSettings, readDataTransfer, readFileList, zipFiles, } from './preact/DropZone';
|
|
9
|
-
export type { AuthenticatedBuildClientConfig, AuthenticatedDropClientConfig, BuildClient, BuildDeployResult, BuildDetection, BuildSite, DeployedBuild, DeployedSite, DropClient, DropResponse, Digest, DeployResult, DeployProgress, DeployPhase, InferredBuildSettings, ProcessedFile, } from './preact/DropZone';
|
|
8
|
+
export { DropZone, AnonymousDropClient, AuthenticatedBuildClient, AuthenticatedDropClient, BuildCreateError, BuildFailedError, BuildTimeoutError, DROPZONE_EVENTS, getFileTypes, humanizeDropError, NotAuthenticatedError, SiteCreateError, UnsupportedDropError, deployBuild, deployFiles, detectBuild, inferBuildSettings, readDataTransfer, readFileList, zipFiles, } from './preact/DropZone';
|
|
9
|
+
export type { AuthenticatedBuildClientConfig, AuthenticatedDropClientConfig, BuildClient, BuildDeployOptions, BuildReason, BuildResponse, DeployError, DeployStatus, DropZoneEventName, DropZoneEventProperties, TrackFn, ZipOptions, ZipResult, BuildDeployResult, BuildDetection, BuildSite, DeployedBuild, DeployedSite, DropClient, DropResponse, Digest, DeployResult, DeployProgress, DeployPhase, InferredBuildSettings, ProcessedFile, } from './preact/DropZone';
|
|
10
10
|
export { type IconName } from './preact/Icon';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentChildren } from 'preact';
|
|
2
|
-
import { BuildClient, BuildDetection, DropClient } from '
|
|
2
|
+
import { BuildClient, BuildDetection, DropClient } from '../../../drop-core';
|
|
3
3
|
import { DeployedBuild, DeployedSite, DeployError, TrackFn } from './useDropDeploy';
|
|
4
4
|
interface Props {
|
|
5
5
|
/** Content the drop layer sits on top of. The zone is invisible until you drag over it. */
|
|
@@ -47,6 +47,13 @@ interface Props {
|
|
|
47
47
|
* static path. Distinct from `client`, which is the anonymous fallback.
|
|
48
48
|
*/
|
|
49
49
|
authenticatedDropClient?: DropClient;
|
|
50
|
+
/**
|
|
51
|
+
* API root for the authenticated paths' JSON calls, which go through your
|
|
52
|
+
* access-control rewrite so the session cookie authorizes them. Defaults to
|
|
53
|
+
* `/access-control/bb-api/api/v1`. (Uploads always go direct to
|
|
54
|
+
* `api.netlify.com` — the proxy can't carry bodies that large.)
|
|
55
|
+
*/
|
|
56
|
+
proxyBase?: string;
|
|
50
57
|
/** Create the visitor's new project in this account. Omit for their default account. */
|
|
51
58
|
accountSlug?: string;
|
|
52
59
|
/**
|
|
@@ -70,6 +77,25 @@ interface Props {
|
|
|
70
77
|
* redirects. The static drop path is unaffected either way.
|
|
71
78
|
*/
|
|
72
79
|
onBuildRequired?: (info: BuildDetection) => void;
|
|
80
|
+
/**
|
|
81
|
+
* Called instead of the `buildSignupUrl` redirect when a build-required drop
|
|
82
|
+
* can't be built here (no session). By this point the drop has been stashed
|
|
83
|
+
* on this origin (`stashed` says whether that succeeded) — own the hand-off
|
|
84
|
+
* however fits your auth flow, e.g. open a signup popup that keeps the
|
|
85
|
+
* visitor on the page. Once they're back authenticated, a remount of the
|
|
86
|
+
* zone deploys the stash automatically.
|
|
87
|
+
*/
|
|
88
|
+
onBuildSignupHandoff?: (info: {
|
|
89
|
+
stashed: boolean;
|
|
90
|
+
detection: BuildDetection;
|
|
91
|
+
}) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Deploy a previously stashed build drop automatically when the zone mounts
|
|
94
|
+
* with an authenticated visitor (default `true`). The stash is written when a
|
|
95
|
+
* logged-out build drop is handed to signup; see
|
|
96
|
+
* [Signup hand-off and auto-resume](#signup-hand-off-and-auto-resume).
|
|
97
|
+
*/
|
|
98
|
+
resumeStashedBuilds?: boolean;
|
|
73
99
|
/** Called once the deploy is live. */
|
|
74
100
|
onDeploy?: (result: DeployedSite) => void;
|
|
75
101
|
/**
|
|
@@ -123,5 +149,5 @@ interface Props {
|
|
|
123
149
|
analyticsId?: string;
|
|
124
150
|
className?: string;
|
|
125
151
|
}
|
|
126
|
-
export default function DropZone({ children, apiBase, client, claimUrl, siteDashboardUrl, buildSignupUrl, getUploadToken, buildClient, authenticatedDropClient, accountSlug, buildDeployUrl, waitForBuild, onBuildRequired, onDeploy, onBuildDeploy, onError, showStatus, onTrack, analyticsId, className, }: Props): import("preact").JSX.Element;
|
|
152
|
+
export default function DropZone({ children, apiBase, client, claimUrl, siteDashboardUrl, buildSignupUrl, getUploadToken, buildClient, authenticatedDropClient, proxyBase, accountSlug, buildDeployUrl, waitForBuild, onBuildRequired, onBuildSignupHandoff, resumeStashedBuilds, onDeploy, onBuildDeploy, onError, showStatus, onTrack, analyticsId, className, }: Props): import("preact").JSX.Element;
|
|
127
153
|
export {};
|
|
@@ -1,77 +1,84 @@
|
|
|
1
1
|
import { u as e } from "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
-
import { A as
|
|
3
|
-
import { readFileList as
|
|
4
|
-
import { getFileTypes as
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
import {
|
|
2
|
+
import { A as E, d as K, y as L } from "../../../chunks/hooks.module.DRcxknIz.js";
|
|
3
|
+
import { readFileList as W, readDataTransfer as q } from "../../../drop-core/readFiles.js";
|
|
4
|
+
import { getFileTypes as z } from "../../../drop-core/fileTypes.js";
|
|
5
|
+
import "../../../drop-core/detectBuild.js";
|
|
6
|
+
import "../../../drop-core/zip.js";
|
|
7
|
+
import { DROPZONE_EVENTS as H } from "../../../drop-core/analytics.js";
|
|
8
|
+
import { useDropDeploy as J } from "./useDropDeploy.js";
|
|
8
9
|
import { Fragment as w } from "preact";
|
|
9
|
-
import '../../../assets/DropZone.css';const
|
|
10
|
-
function
|
|
10
|
+
import '../../../assets/DropZone.css';const Q = 120, X = (r) => `https://app.netlify.com/drop/${r}`, Y = (r) => `https://app.netlify.com/projects/${r}`, ee = "https://app.netlify.com/signup?next=/drop&utm_campaign=drop", re = ({ siteName: r }) => `https://app.netlify.com/projects/${r}`;
|
|
11
|
+
function fe({
|
|
11
12
|
children: r,
|
|
12
13
|
apiBase: a,
|
|
13
14
|
client: l,
|
|
14
|
-
claimUrl: c =
|
|
15
|
-
siteDashboardUrl: u =
|
|
16
|
-
buildSignupUrl:
|
|
15
|
+
claimUrl: c = X,
|
|
16
|
+
siteDashboardUrl: u = Y,
|
|
17
|
+
buildSignupUrl: S = ee,
|
|
17
18
|
getUploadToken: T,
|
|
18
|
-
buildClient:
|
|
19
|
-
authenticatedDropClient:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
buildClient: j,
|
|
20
|
+
authenticatedDropClient: A,
|
|
21
|
+
proxyBase: C,
|
|
22
|
+
accountSlug: B,
|
|
23
|
+
buildDeployUrl: O = re,
|
|
24
|
+
waitForBuild: P,
|
|
25
|
+
onBuildRequired: R,
|
|
26
|
+
onBuildSignupHandoff: _,
|
|
27
|
+
resumeStashedBuilds: $,
|
|
28
|
+
onDeploy: N,
|
|
29
|
+
onBuildDeploy: U,
|
|
26
30
|
onError: x,
|
|
27
31
|
showStatus: f = !0,
|
|
28
32
|
onTrack: d,
|
|
29
33
|
analyticsId: g,
|
|
30
|
-
className:
|
|
34
|
+
className: F
|
|
31
35
|
}) {
|
|
32
|
-
const
|
|
36
|
+
const m = (t, n = {}) => d == null ? void 0 : d(t, g ? { dropzone_id: g, ...n } : n), { status: s, warning: y, busy: i, deploy: b, reset: I } = J({
|
|
33
37
|
apiBase: a,
|
|
34
38
|
client: l,
|
|
35
39
|
claimUrl: c,
|
|
36
40
|
siteDashboardUrl: u,
|
|
37
|
-
buildSignupUrl:
|
|
41
|
+
buildSignupUrl: S,
|
|
38
42
|
getUploadToken: T,
|
|
39
|
-
buildClient:
|
|
40
|
-
authenticatedDropClient:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
buildClient: j,
|
|
44
|
+
authenticatedDropClient: A,
|
|
45
|
+
proxyBase: C,
|
|
46
|
+
accountSlug: B,
|
|
47
|
+
buildDeployUrl: O,
|
|
48
|
+
waitForBuild: P,
|
|
49
|
+
onBuildRequired: R,
|
|
50
|
+
onBuildSignupHandoff: _,
|
|
51
|
+
resumeStashedBuilds: $,
|
|
52
|
+
onDeploy: N,
|
|
53
|
+
onBuildDeploy: U,
|
|
47
54
|
onError: x,
|
|
48
|
-
track:
|
|
49
|
-
}), { active: p, keepActive:
|
|
55
|
+
track: m
|
|
56
|
+
}), { active: p, keepActive: V, endDrag: M } = te(), h = E(null), v = (t) => {
|
|
50
57
|
var n;
|
|
51
|
-
|
|
52
|
-
},
|
|
58
|
+
m(H.BROWSE_OPENED, { method: t }), (n = h.current) == null || n.click();
|
|
59
|
+
}, Z = f && (p || i || s.kind === "error"), G = [
|
|
53
60
|
"n-dropzone",
|
|
54
61
|
p && "is-active",
|
|
55
62
|
i && "is-busy",
|
|
56
63
|
!f && "is-bare",
|
|
57
|
-
|
|
64
|
+
F
|
|
58
65
|
].filter(Boolean).join(" ");
|
|
59
66
|
return /* @__PURE__ */ e(
|
|
60
67
|
"div",
|
|
61
68
|
{
|
|
62
|
-
class:
|
|
69
|
+
class: G,
|
|
63
70
|
"data-state": s.kind,
|
|
64
71
|
role: "button",
|
|
65
72
|
tabIndex: i ? -1 : 0,
|
|
66
73
|
"aria-label": "Drop a site folder or zip here to deploy it, or press Enter to browse for files",
|
|
67
74
|
"aria-busy": i,
|
|
68
75
|
onDragOver: (t) => {
|
|
69
|
-
i || (t.preventDefault(),
|
|
76
|
+
i || (t.preventDefault(), V());
|
|
70
77
|
},
|
|
71
78
|
onDrop: (t) => {
|
|
72
79
|
if (t.preventDefault(), M(), i) return;
|
|
73
80
|
const n = t.dataTransfer;
|
|
74
|
-
n &&
|
|
81
|
+
n && b(() => q(n), "drag", z(n.files));
|
|
75
82
|
},
|
|
76
83
|
onClick: (t) => {
|
|
77
84
|
!i && t.target === t.currentTarget && v("click");
|
|
@@ -91,23 +98,23 @@ function se({
|
|
|
91
98
|
webkitdirectory: "",
|
|
92
99
|
directory: "",
|
|
93
100
|
onChange: (t) => {
|
|
94
|
-
var
|
|
101
|
+
var D;
|
|
95
102
|
const n = t.currentTarget;
|
|
96
|
-
if ((
|
|
97
|
-
const
|
|
98
|
-
|
|
103
|
+
if ((D = n.files) != null && D.length) {
|
|
104
|
+
const k = n.files;
|
|
105
|
+
b(() => W(k), "browse", z(k));
|
|
99
106
|
}
|
|
100
107
|
n.value = "";
|
|
101
108
|
}
|
|
102
109
|
}
|
|
103
110
|
),
|
|
104
|
-
|
|
111
|
+
Z && /* @__PURE__ */ e(
|
|
105
112
|
"div",
|
|
106
113
|
{
|
|
107
114
|
class: "n-dropzone-overlay n-fadeIn",
|
|
108
115
|
children: [
|
|
109
|
-
/* @__PURE__ */ e(
|
|
110
|
-
|
|
116
|
+
/* @__PURE__ */ e(ne, { status: s, active: p, onReset: I }),
|
|
117
|
+
y && s.kind !== "error" && i && /* @__PURE__ */ e("p", { class: "n-dropzone-warning", role: "status", children: y })
|
|
111
118
|
]
|
|
112
119
|
},
|
|
113
120
|
s.kind === "idle" ? "active" : s.kind
|
|
@@ -116,15 +123,15 @@ function se({
|
|
|
116
123
|
}
|
|
117
124
|
);
|
|
118
125
|
}
|
|
119
|
-
function
|
|
120
|
-
const [r, a] =
|
|
121
|
-
return
|
|
122
|
-
a(!0), clearTimeout(l.current), l.current = setTimeout(() => a(!1),
|
|
126
|
+
function te() {
|
|
127
|
+
const [r, a] = K(!1), l = E();
|
|
128
|
+
return L(() => () => clearTimeout(l.current), []), { active: r, keepActive: () => {
|
|
129
|
+
a(!0), clearTimeout(l.current), l.current = setTimeout(() => a(!1), Q);
|
|
123
130
|
}, endDrag: () => {
|
|
124
131
|
clearTimeout(l.current), a(!1);
|
|
125
132
|
} };
|
|
126
133
|
}
|
|
127
|
-
function
|
|
134
|
+
function ne({
|
|
128
135
|
status: r,
|
|
129
136
|
active: a,
|
|
130
137
|
onReset: l
|
|
@@ -180,5 +187,5 @@ function o({ label: r }) {
|
|
|
180
187
|
] });
|
|
181
188
|
}
|
|
182
189
|
export {
|
|
183
|
-
|
|
190
|
+
fe as default
|
|
184
191
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as DropZone } from './DropZone';
|
|
2
|
-
export { AnonymousDropClient, AuthenticatedBuildClient, AuthenticatedDropClient, BuildCreateError, BuildFailedError, BuildTimeoutError, deployBuild, deployFiles, detectBuild, getFileTypes, humanizeDropError, inferBuildSettings, NotAuthenticatedError, readDataTransfer, readFileList, SiteCreateError, UnsupportedDropError, zipFiles, } from '
|
|
3
|
-
export type { AuthenticatedBuildClientConfig, AuthenticatedDropClientConfig, BuildClient, BuildDeployOptions, BuildDeployResult, BuildDetection, BuildReason, BuildResponse, BuildSite, DropClient, DropResponse, Digest, DeployResult, DeployProgress, DeployPhase, InferredBuildSettings, ProcessedFile, ZipOptions, ZipResult, } from '
|
|
4
|
-
export type { DeployedBuild, DeployedSite, DeployError, DeployStatus } from './useDropDeploy';
|
|
2
|
+
export { AnonymousDropClient, DROPZONE_EVENTS, AuthenticatedBuildClient, AuthenticatedDropClient, BuildCreateError, BuildFailedError, BuildTimeoutError, deployBuild, deployFiles, detectBuild, getFileTypes, humanizeDropError, inferBuildSettings, NotAuthenticatedError, readDataTransfer, readFileList, SiteCreateError, UnsupportedDropError, zipFiles, } from '../../../drop-core';
|
|
3
|
+
export type { AuthenticatedBuildClientConfig, DropMethod, DropZoneEventName, DropZoneEventProperties, TrackFn, AuthenticatedDropClientConfig, BuildClient, BuildDeployOptions, BuildDeployResult, BuildDetection, BuildReason, BuildResponse, BuildSite, DropClient, DropResponse, Digest, DeployResult, DeployProgress, DeployPhase, InferredBuildSettings, ProcessedFile, ZipOptions, ZipResult, } from '../../../drop-core';
|
|
4
|
+
export type { DeployedBuild, DeployedSite, DeployError, DeploySource, DeployStatus, } from './useDropDeploy';
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
import { default as o } from "./DropZone.js";
|
|
2
|
-
import { readDataTransfer as i, readFileList as p } from "
|
|
3
|
-
import { getFileTypes as l } from "
|
|
4
|
-
import { detectBuild as a, inferBuildSettings as
|
|
5
|
-
import { AnonymousDropClient as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
2
|
+
import { readDataTransfer as i, readFileList as p } from "../../../drop-core/readFiles.js";
|
|
3
|
+
import { getFileTypes as l } from "../../../drop-core/fileTypes.js";
|
|
4
|
+
import { detectBuild as a, inferBuildSettings as f } from "../../../drop-core/detectBuild.js";
|
|
5
|
+
import { AnonymousDropClient as n } from "../../../drop-core/client.js";
|
|
6
|
+
import { BuildCreateError as E, BuildFailedError as s, BuildTimeoutError as B, NotAuthenticatedError as D, SiteCreateError as C, UnsupportedDropError as F, humanizeDropError as c } from "../../../drop-core/errors.js";
|
|
7
|
+
import { AuthenticatedDropClient as y } from "../../../drop-core/authedDropClient.js";
|
|
8
|
+
import { AuthenticatedBuildClient as T } from "../../../drop-core/buildClient.js";
|
|
9
|
+
import { zipFiles as S } from "../../../drop-core/zip.js";
|
|
10
|
+
import { deployBuild as z, deployFiles as O } from "../../../drop-core/deploy.js";
|
|
11
|
+
import { DROPZONE_EVENTS as L } from "../../../drop-core/analytics.js";
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
n as AnonymousDropClient,
|
|
14
|
+
T as AuthenticatedBuildClient,
|
|
15
|
+
y as AuthenticatedDropClient,
|
|
16
|
+
E as BuildCreateError,
|
|
17
|
+
s as BuildFailedError,
|
|
18
|
+
B as BuildTimeoutError,
|
|
19
|
+
L as DROPZONE_EVENTS,
|
|
18
20
|
o as DropZone,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
D as NotAuthenticatedError,
|
|
22
|
+
C as SiteCreateError,
|
|
23
|
+
F as UnsupportedDropError,
|
|
24
|
+
z as deployBuild,
|
|
25
|
+
O as deployFiles,
|
|
24
26
|
a as detectBuild,
|
|
25
27
|
l as getFileTypes,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
c as humanizeDropError,
|
|
29
|
+
f as inferBuildSettings,
|
|
28
30
|
i as readDataTransfer,
|
|
29
31
|
p as readFileList,
|
|
30
|
-
|
|
32
|
+
S as zipFiles
|
|
31
33
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BuildClient, BuildDetection, DropClient, InferredBuildSettings, ProcessedFile } from '
|
|
1
|
+
import { BuildClient, BuildDetection, DropClient, DropMethod, TrackFn, InferredBuildSettings, ProcessedFile } from '../../../drop-core';
|
|
2
2
|
/** How the files reached the zone — carried through to analytics. */
|
|
3
|
-
export type DeploySource =
|
|
3
|
+
export type DeploySource = DropMethod;
|
|
4
4
|
/** The live site handed back once a deploy succeeds. */
|
|
5
5
|
export interface DeployedSite {
|
|
6
6
|
url: string;
|
|
@@ -57,8 +57,8 @@ export type DeployStatus = {
|
|
|
57
57
|
kind: 'error';
|
|
58
58
|
message: string;
|
|
59
59
|
};
|
|
60
|
-
/**
|
|
61
|
-
export type TrackFn
|
|
60
|
+
/** Re-exported from the drop-core analytics contract, where the shape now lives. */
|
|
61
|
+
export type { TrackFn };
|
|
62
62
|
interface UseDropDeployOptions {
|
|
63
63
|
apiBase?: string;
|
|
64
64
|
client?: DropClient;
|
|
@@ -68,10 +68,16 @@ interface UseDropDeployOptions {
|
|
|
68
68
|
buildClient?: BuildClient;
|
|
69
69
|
authenticatedDropClient?: DropClient;
|
|
70
70
|
getUploadToken?: () => Promise<string | null>;
|
|
71
|
+
proxyBase?: string;
|
|
71
72
|
accountSlug?: string;
|
|
72
73
|
buildDeployUrl: (build: DeployedBuild) => string;
|
|
73
74
|
waitForBuild?: boolean;
|
|
74
75
|
onBuildRequired?: (info: BuildDetection) => void;
|
|
76
|
+
onBuildSignupHandoff?: (info: {
|
|
77
|
+
stashed: boolean;
|
|
78
|
+
detection: BuildDetection;
|
|
79
|
+
}) => void;
|
|
80
|
+
resumeStashedBuilds?: boolean;
|
|
75
81
|
onDeploy?: (site: DeployedSite) => void;
|
|
76
82
|
onBuildDeploy?: (build: DeployedBuild) => void;
|
|
77
83
|
onError?: (error: DeployError) => void;
|
|
@@ -81,11 +87,10 @@ interface UseDropDeployOptions {
|
|
|
81
87
|
* Owns the deploy state machine and its side effects (upload, local persistence,
|
|
82
88
|
* analytics, redirect), keeping DropZone a thin view over the returned `status`.
|
|
83
89
|
*/
|
|
84
|
-
export declare function useDropDeploy({ apiBase, client, claimUrl, siteDashboardUrl, buildSignupUrl, buildClient, authenticatedDropClient, getUploadToken, accountSlug, buildDeployUrl, waitForBuild, onBuildRequired, onDeploy, onBuildDeploy, onError, track, }: UseDropDeployOptions): {
|
|
90
|
+
export declare function useDropDeploy({ apiBase, client, claimUrl, siteDashboardUrl, buildSignupUrl, buildClient, authenticatedDropClient, getUploadToken, proxyBase, accountSlug, buildDeployUrl, waitForBuild, onBuildRequired, onBuildSignupHandoff, resumeStashedBuilds, onDeploy, onBuildDeploy, onError, track, }: UseDropDeployOptions): {
|
|
85
91
|
status: DeployStatus;
|
|
86
92
|
warning: string | null;
|
|
87
93
|
busy: boolean;
|
|
88
94
|
deploy: (read: () => Promise<ProcessedFile[]>, source: DeploySource, fileTypes: string[]) => Promise<void>;
|
|
89
95
|
reset: () => void;
|
|
90
96
|
};
|
|
91
|
-
export {};
|