@netlify/spark-ui 1.31.0-alpha.3 → 1.31.0-alpha.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/index.d.ts +2 -2
- package/dist/components/preact/DropZone/DropZone.d.ts +27 -9
- package/dist/components/preact/DropZone/DropZone.js +59 -54
- 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 +29 -27
- package/dist/components/preact/DropZone/useDropDeploy.d.ts +9 -6
- package/dist/components/preact/DropZone/useDropDeploy.js +182 -131
- 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 +24 -18
- 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 +45 -0
- package/dist/drop-core/authedApi.js +30 -0
- package/dist/drop-core/authedApi.test.d.ts +1 -0
- package/dist/{components/preact/DropZone/drop-core → drop-core}/authedDropClient.d.ts +4 -11
- package/dist/drop-core/authedDropClient.js +100 -0
- package/dist/drop-core/authedDropClient.test.d.ts +1 -0
- package/dist/{components/preact/DropZone/drop-core → drop-core}/buildClient.d.ts +5 -13
- package/dist/drop-core/buildClient.js +85 -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}/client.d.ts +3 -1
- package/dist/drop-core/client.js +47 -0
- package/dist/drop-core/constants.d.ts +29 -0
- package/dist/drop-core/constants.js +10 -0
- package/dist/{components/preact/DropZone/drop-core → drop-core}/deploy.d.ts +9 -0
- package/dist/drop-core/deploy.js +66 -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.d.ts +29 -0
- package/dist/drop-core/errors.js +119 -0
- package/dist/drop-core/errors.test.d.ts +1 -0
- package/dist/drop-core/fileTypes.test.d.ts +1 -0
- package/dist/drop-core/index.d.ts +25 -0
- package/dist/drop-core/index.js +47 -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 +29 -9
- 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 +301 -145
- package/packages/components/preact/index.ts +19 -2
- package/packages/drop-core/README.md +91 -0
- 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 +81 -0
- package/packages/drop-core/authedDropClient.test.ts +196 -0
- package/packages/{components/preact/DropZone/drop-core → drop-core}/authedDropClient.ts +30 -72
- package/packages/drop-core/buildClient.test.ts +112 -0
- package/packages/{components/preact/DropZone/drop-core → drop-core}/buildClient.ts +27 -57
- package/packages/drop-core/buildStash.test.ts +85 -0
- package/packages/drop-core/buildStash.ts +185 -0
- package/packages/{components/preact/DropZone/drop-core → drop-core}/client.ts +18 -6
- package/packages/drop-core/constants.ts +39 -0
- package/packages/drop-core/deploy.test.ts +177 -0
- package/packages/{components/preact/DropZone/drop-core → drop-core}/deploy.ts +59 -9
- 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 +98 -0
- package/packages/{components/preact/DropZone/drop-core → drop-core}/errors.ts +68 -11
- package/packages/drop-core/fileTypes.test.ts +37 -0
- package/packages/drop-core/index.ts +44 -0
- package/packages/drop-core/readFiles.test.ts +124 -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.js +0 -123
- package/dist/components/preact/DropZone/drop-core/buildClient.js +0 -99
- package/dist/components/preact/DropZone/drop-core/client.js +0 -45
- package/dist/components/preact/DropZone/drop-core/deploy.js +0 -48
- package/dist/components/preact/DropZone/drop-core/errors.js +0 -82
- package/dist/components/preact/DropZone/drop-core/index.d.ts +0 -11
- package/dist/components/preact/DropZone/drop-core/index.js +0 -36
- package/packages/components/preact/DropZone/drop-core/index.ts +0 -11
- /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}/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}/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. */
|
|
@@ -17,12 +17,11 @@ interface Props {
|
|
|
17
17
|
*/
|
|
18
18
|
siteDashboardUrl?: (siteName: string) => string;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* point at your own destination.
|
|
20
|
+
* The signup hand-off for a build-required drop that can't be built here (no
|
|
21
|
+
* session, or no build wiring). The drop is stashed on this origin first, so
|
|
22
|
+
* a flow that returns the visitor to this page deploys it automatically —
|
|
23
|
+
* see `resumeStashedBuilds`. Defaults to the app signup page with
|
|
24
|
+
* `next=/drop`.
|
|
26
25
|
*/
|
|
27
26
|
buildSignupUrl?: string;
|
|
28
27
|
/**
|
|
@@ -32,7 +31,7 @@ interface Props {
|
|
|
32
31
|
* build-required drops build in place instead of being handed off to the app.
|
|
33
32
|
* On netlify.com this reads `GET /access-control/generate-access-control-token`.
|
|
34
33
|
* Resolving `null` means "no session": static drops fall back to the anonymous
|
|
35
|
-
* claim flow
|
|
34
|
+
* claim flow; build drops are stashed and handed to `buildSignupUrl`.
|
|
36
35
|
* See [Logged-in visitors](#logged-in-visitors).
|
|
37
36
|
*/
|
|
38
37
|
getUploadToken?: () => Promise<string | null>;
|
|
@@ -77,6 +76,25 @@ interface Props {
|
|
|
77
76
|
* redirects. The static drop path is unaffected either way.
|
|
78
77
|
*/
|
|
79
78
|
onBuildRequired?: (info: BuildDetection) => void;
|
|
79
|
+
/**
|
|
80
|
+
* Called instead of the `buildSignupUrl` redirect when a build-required drop
|
|
81
|
+
* can't be built here (no session). By this point the drop has been stashed
|
|
82
|
+
* on this origin (`stashed` says whether that succeeded) — own the hand-off
|
|
83
|
+
* however fits your auth flow, e.g. open a signup popup that keeps the
|
|
84
|
+
* visitor on the page. Once they're back authenticated, a remount of the
|
|
85
|
+
* zone deploys the stash automatically.
|
|
86
|
+
*/
|
|
87
|
+
onBuildSignupHandoff?: (info: {
|
|
88
|
+
stashed: boolean;
|
|
89
|
+
detection: BuildDetection;
|
|
90
|
+
}) => void;
|
|
91
|
+
/**
|
|
92
|
+
* Deploy a previously stashed build drop automatically when the zone mounts
|
|
93
|
+
* with an authenticated visitor (default `true`). The stash is written when a
|
|
94
|
+
* logged-out build drop is handed to signup; see
|
|
95
|
+
* [Signup hand-off and auto-resume](#signup-hand-off-and-auto-resume).
|
|
96
|
+
*/
|
|
97
|
+
resumeStashedBuilds?: boolean;
|
|
80
98
|
/** Called once the deploy is live. */
|
|
81
99
|
onDeploy?: (result: DeployedSite) => void;
|
|
82
100
|
/**
|
|
@@ -130,5 +148,5 @@ interface Props {
|
|
|
130
148
|
analyticsId?: string;
|
|
131
149
|
className?: string;
|
|
132
150
|
}
|
|
133
|
-
export default function DropZone({ children, apiBase, client, claimUrl, siteDashboardUrl, buildSignupUrl, getUploadToken, buildClient, authenticatedDropClient, proxyBase, accountSlug, buildDeployUrl, waitForBuild, onBuildRequired, onDeploy, onBuildDeploy, onError, showStatus, onTrack, analyticsId, className, }: Props): import("preact").JSX.Element;
|
|
151
|
+
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;
|
|
134
152
|
export {};
|
|
@@ -1,57 +1,62 @@
|
|
|
1
1
|
import { u as e } from "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
-
import { A as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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 { DROPZONE_EVENTS as W } from "../../../drop-core/analytics.js";
|
|
4
|
+
import { readFileList as q, readDataTransfer as H } from "../../../drop-core/readFiles.js";
|
|
5
|
+
import { getFileTypes as z } from "../../../drop-core/fileTypes.js";
|
|
6
|
+
import "../../../drop-core/detectBuild.js";
|
|
7
|
+
import "../../../drop-core/zip.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
|
-
proxyBase:
|
|
21
|
-
accountSlug:
|
|
22
|
-
buildDeployUrl:
|
|
23
|
-
waitForBuild:
|
|
24
|
-
onBuildRequired:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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,
|
|
30
|
+
onError: x,
|
|
28
31
|
showStatus: f = !0,
|
|
29
32
|
onTrack: d,
|
|
30
33
|
analyticsId: g,
|
|
31
34
|
className: F
|
|
32
35
|
}) {
|
|
33
|
-
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({
|
|
34
37
|
apiBase: a,
|
|
35
38
|
client: l,
|
|
36
39
|
claimUrl: c,
|
|
37
40
|
siteDashboardUrl: u,
|
|
38
|
-
buildSignupUrl:
|
|
41
|
+
buildSignupUrl: S,
|
|
39
42
|
getUploadToken: T,
|
|
40
|
-
buildClient:
|
|
41
|
-
authenticatedDropClient:
|
|
42
|
-
proxyBase:
|
|
43
|
-
accountSlug:
|
|
44
|
-
buildDeployUrl:
|
|
45
|
-
waitForBuild:
|
|
46
|
-
onBuildRequired:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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,
|
|
54
|
+
onError: x,
|
|
55
|
+
track: m
|
|
56
|
+
}), { active: p, keepActive: V, endDrag: M } = te(), h = E(null), v = (t) => {
|
|
52
57
|
var n;
|
|
53
|
-
|
|
54
|
-
},
|
|
58
|
+
m(W.BROWSE_OPENED, { method: t }), (n = h.current) == null || n.click();
|
|
59
|
+
}, Z = f && (p || i || s.kind === "error"), G = [
|
|
55
60
|
"n-dropzone",
|
|
56
61
|
p && "is-active",
|
|
57
62
|
i && "is-busy",
|
|
@@ -61,19 +66,19 @@ function ce({
|
|
|
61
66
|
return /* @__PURE__ */ e(
|
|
62
67
|
"div",
|
|
63
68
|
{
|
|
64
|
-
class:
|
|
69
|
+
class: G,
|
|
65
70
|
"data-state": s.kind,
|
|
66
71
|
role: "button",
|
|
67
72
|
tabIndex: i ? -1 : 0,
|
|
68
73
|
"aria-label": "Drop a site folder or zip here to deploy it, or press Enter to browse for files",
|
|
69
74
|
"aria-busy": i,
|
|
70
75
|
onDragOver: (t) => {
|
|
71
|
-
i || (t.preventDefault(),
|
|
76
|
+
i || (t.preventDefault(), V());
|
|
72
77
|
},
|
|
73
78
|
onDrop: (t) => {
|
|
74
|
-
if (t.preventDefault(),
|
|
79
|
+
if (t.preventDefault(), M(), i) return;
|
|
75
80
|
const n = t.dataTransfer;
|
|
76
|
-
n &&
|
|
81
|
+
n && b(() => H(n), "drag", z(n.files));
|
|
77
82
|
},
|
|
78
83
|
onClick: (t) => {
|
|
79
84
|
!i && t.target === t.currentTarget && v("click");
|
|
@@ -93,23 +98,23 @@ function ce({
|
|
|
93
98
|
webkitdirectory: "",
|
|
94
99
|
directory: "",
|
|
95
100
|
onChange: (t) => {
|
|
96
|
-
var
|
|
101
|
+
var D;
|
|
97
102
|
const n = t.currentTarget;
|
|
98
|
-
if ((
|
|
99
|
-
const
|
|
100
|
-
|
|
103
|
+
if ((D = n.files) != null && D.length) {
|
|
104
|
+
const k = n.files;
|
|
105
|
+
b(() => q(k), "browse", z(k));
|
|
101
106
|
}
|
|
102
107
|
n.value = "";
|
|
103
108
|
}
|
|
104
109
|
}
|
|
105
110
|
),
|
|
106
|
-
|
|
111
|
+
Z && /* @__PURE__ */ e(
|
|
107
112
|
"div",
|
|
108
113
|
{
|
|
109
114
|
class: "n-dropzone-overlay n-fadeIn",
|
|
110
115
|
children: [
|
|
111
|
-
/* @__PURE__ */ e(
|
|
112
|
-
|
|
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 })
|
|
113
118
|
]
|
|
114
119
|
},
|
|
115
120
|
s.kind === "idle" ? "active" : s.kind
|
|
@@ -118,15 +123,15 @@ function ce({
|
|
|
118
123
|
}
|
|
119
124
|
);
|
|
120
125
|
}
|
|
121
|
-
function
|
|
122
|
-
const [r, a] =
|
|
123
|
-
return
|
|
124
|
-
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);
|
|
125
130
|
}, endDrag: () => {
|
|
126
131
|
clearTimeout(l.current), a(!1);
|
|
127
132
|
} };
|
|
128
133
|
}
|
|
129
|
-
function
|
|
134
|
+
function ne({
|
|
130
135
|
status: r,
|
|
131
136
|
active: a,
|
|
132
137
|
onReset: l
|
|
@@ -182,5 +187,5 @@ function o({ label: r }) {
|
|
|
182
187
|
] });
|
|
183
188
|
}
|
|
184
189
|
export {
|
|
185
|
-
|
|
190
|
+
fe as default
|
|
186
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 {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
2
|
+
import { BuildCreateError as i, BuildFailedError as p, BuildTimeoutError as d, NotAuthenticatedError as l, SiteCreateError as u, UnsupportedDropError as a, humanizeDropError as f } from "../../../drop-core/errors.js";
|
|
3
|
+
import { DROPZONE_EVENTS as n } from "../../../drop-core/analytics.js";
|
|
4
|
+
import { readDataTransfer as E, readFileList as s } from "../../../drop-core/readFiles.js";
|
|
5
|
+
import { getFileTypes as D } from "../../../drop-core/fileTypes.js";
|
|
6
|
+
import { detectBuild as F, inferBuildSettings as c } from "../../../drop-core/detectBuild.js";
|
|
7
|
+
import { zipFiles as y } from "../../../drop-core/zip.js";
|
|
8
|
+
import { AnonymousDropClient as T } from "../../../drop-core/client.js";
|
|
9
|
+
import { AuthenticatedDropClient as S } from "../../../drop-core/authedDropClient.js";
|
|
10
|
+
import { AuthenticatedBuildClient as z } from "../../../drop-core/buildClient.js";
|
|
11
|
+
import { deployBuild as Z, deployFiles as L } from "../../../drop-core/deploy.js";
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
T as AnonymousDropClient,
|
|
14
|
+
z as AuthenticatedBuildClient,
|
|
15
|
+
S as AuthenticatedDropClient,
|
|
16
|
+
i as BuildCreateError,
|
|
17
|
+
p as BuildFailedError,
|
|
18
|
+
d as BuildTimeoutError,
|
|
19
|
+
n as DROPZONE_EVENTS,
|
|
18
20
|
o as DropZone,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
l as NotAuthenticatedError,
|
|
22
|
+
u as SiteCreateError,
|
|
23
|
+
a as UnsupportedDropError,
|
|
24
|
+
Z as deployBuild,
|
|
25
|
+
L as deployFiles,
|
|
26
|
+
F as detectBuild,
|
|
27
|
+
D as getFileTypes,
|
|
28
|
+
f as humanizeDropError,
|
|
29
|
+
c as inferBuildSettings,
|
|
30
|
+
E as readDataTransfer,
|
|
31
|
+
s as readFileList,
|
|
32
|
+
y 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,7 @@ export type DeployStatus = {
|
|
|
57
57
|
kind: 'error';
|
|
58
58
|
message: string;
|
|
59
59
|
};
|
|
60
|
-
|
|
61
|
-
export type TrackFn = (event: string, properties?: Record<string, unknown>) => void;
|
|
60
|
+
export type { TrackFn };
|
|
62
61
|
interface UseDropDeployOptions {
|
|
63
62
|
apiBase?: string;
|
|
64
63
|
client?: DropClient;
|
|
@@ -73,6 +72,11 @@ interface UseDropDeployOptions {
|
|
|
73
72
|
buildDeployUrl: (build: DeployedBuild) => string;
|
|
74
73
|
waitForBuild?: boolean;
|
|
75
74
|
onBuildRequired?: (info: BuildDetection) => void;
|
|
75
|
+
onBuildSignupHandoff?: (info: {
|
|
76
|
+
stashed: boolean;
|
|
77
|
+
detection: BuildDetection;
|
|
78
|
+
}) => void;
|
|
79
|
+
resumeStashedBuilds?: boolean;
|
|
76
80
|
onDeploy?: (site: DeployedSite) => void;
|
|
77
81
|
onBuildDeploy?: (build: DeployedBuild) => void;
|
|
78
82
|
onError?: (error: DeployError) => void;
|
|
@@ -82,11 +86,10 @@ interface UseDropDeployOptions {
|
|
|
82
86
|
* Owns the deploy state machine and its side effects (upload, local persistence,
|
|
83
87
|
* analytics, redirect), keeping DropZone a thin view over the returned `status`.
|
|
84
88
|
*/
|
|
85
|
-
export declare function useDropDeploy({ apiBase, client, claimUrl, siteDashboardUrl, buildSignupUrl, buildClient, authenticatedDropClient, getUploadToken, proxyBase, accountSlug, buildDeployUrl, waitForBuild, onBuildRequired, onDeploy, onBuildDeploy, onError, track, }: UseDropDeployOptions): {
|
|
89
|
+
export declare function useDropDeploy({ apiBase, client, claimUrl, siteDashboardUrl, buildSignupUrl, buildClient, authenticatedDropClient, getUploadToken, proxyBase, accountSlug, buildDeployUrl, waitForBuild, onBuildRequired, onBuildSignupHandoff, resumeStashedBuilds, onDeploy, onBuildDeploy, onError, track, }: UseDropDeployOptions): {
|
|
86
90
|
status: DeployStatus;
|
|
87
91
|
warning: string | null;
|
|
88
92
|
busy: boolean;
|
|
89
93
|
deploy: (read: () => Promise<ProcessedFile[]>, source: DeploySource, fileTypes: string[]) => Promise<void>;
|
|
90
94
|
reset: () => void;
|
|
91
95
|
};
|
|
92
|
-
export {};
|