@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.
Files changed (100) hide show
  1. package/dist/components/index.d.ts +2 -2
  2. package/dist/components/preact/DropZone/DropZone.d.ts +27 -9
  3. package/dist/components/preact/DropZone/DropZone.js +59 -54
  4. package/dist/components/preact/DropZone/DropZone.test.d.ts +1 -0
  5. package/dist/components/preact/DropZone/index.d.ts +3 -3
  6. package/dist/components/preact/DropZone/index.js +29 -27
  7. package/dist/components/preact/DropZone/useDropDeploy.d.ts +9 -6
  8. package/dist/components/preact/DropZone/useDropDeploy.js +182 -131
  9. package/dist/components/preact/DropZone/useDropDeploy.test.d.ts +1 -0
  10. package/dist/components/preact/index.d.ts +2 -2
  11. package/dist/components/preact/index.js +24 -18
  12. package/dist/drop-core/analytics.d.ts +107 -0
  13. package/dist/drop-core/analytics.js +21 -0
  14. package/dist/drop-core/analytics.test.d.ts +1 -0
  15. package/dist/drop-core/authedApi.d.ts +45 -0
  16. package/dist/drop-core/authedApi.js +30 -0
  17. package/dist/drop-core/authedApi.test.d.ts +1 -0
  18. package/dist/{components/preact/DropZone/drop-core → drop-core}/authedDropClient.d.ts +4 -11
  19. package/dist/drop-core/authedDropClient.js +100 -0
  20. package/dist/drop-core/authedDropClient.test.d.ts +1 -0
  21. package/dist/{components/preact/DropZone/drop-core → drop-core}/buildClient.d.ts +5 -13
  22. package/dist/drop-core/buildClient.js +85 -0
  23. package/dist/drop-core/buildClient.test.d.ts +1 -0
  24. package/dist/drop-core/buildStash.d.ts +37 -0
  25. package/dist/drop-core/buildStash.js +84 -0
  26. package/dist/drop-core/buildStash.test.d.ts +0 -0
  27. package/dist/{components/preact/DropZone/drop-core → drop-core}/client.d.ts +3 -1
  28. package/dist/drop-core/client.js +47 -0
  29. package/dist/drop-core/constants.d.ts +29 -0
  30. package/dist/drop-core/constants.js +10 -0
  31. package/dist/{components/preact/DropZone/drop-core → drop-core}/deploy.d.ts +9 -0
  32. package/dist/drop-core/deploy.js +66 -0
  33. package/dist/drop-core/deploy.test.d.ts +1 -0
  34. package/dist/drop-core/detectBuild.test.d.ts +1 -0
  35. package/dist/drop-core/digest.test.d.ts +1 -0
  36. package/dist/{components/preact/DropZone/drop-core → drop-core}/errors.d.ts +29 -0
  37. package/dist/drop-core/errors.js +119 -0
  38. package/dist/drop-core/errors.test.d.ts +1 -0
  39. package/dist/drop-core/fileTypes.test.d.ts +1 -0
  40. package/dist/drop-core/index.d.ts +25 -0
  41. package/dist/drop-core/index.js +47 -0
  42. package/dist/{components/preact/DropZone/drop-core → drop-core}/readFiles.js +2 -2
  43. package/dist/drop-core/readFiles.test.d.ts +1 -0
  44. package/dist/{components/preact/DropZone/drop-core → drop-core}/types.d.ts +10 -0
  45. package/dist/{components/preact/DropZone/drop-core → drop-core}/zip.js +1 -1
  46. package/dist/drop-core/zip.test.d.ts +1 -0
  47. package/package.json +4 -1
  48. package/packages/components/index.ts +19 -0
  49. package/packages/components/preact/DropZone/DropZone.test.ts +71 -0
  50. package/packages/components/preact/DropZone/DropZone.tsx +29 -9
  51. package/packages/components/preact/DropZone/index.tsx +14 -3
  52. package/packages/components/preact/DropZone/useDropDeploy.test.ts +376 -0
  53. package/packages/components/preact/DropZone/useDropDeploy.ts +301 -145
  54. package/packages/components/preact/index.ts +19 -2
  55. package/packages/drop-core/README.md +91 -0
  56. package/packages/drop-core/analytics.test.ts +17 -0
  57. package/packages/drop-core/analytics.ts +122 -0
  58. package/packages/drop-core/authedApi.test.ts +100 -0
  59. package/packages/drop-core/authedApi.ts +81 -0
  60. package/packages/drop-core/authedDropClient.test.ts +196 -0
  61. package/packages/{components/preact/DropZone/drop-core → drop-core}/authedDropClient.ts +30 -72
  62. package/packages/drop-core/buildClient.test.ts +112 -0
  63. package/packages/{components/preact/DropZone/drop-core → drop-core}/buildClient.ts +27 -57
  64. package/packages/drop-core/buildStash.test.ts +85 -0
  65. package/packages/drop-core/buildStash.ts +185 -0
  66. package/packages/{components/preact/DropZone/drop-core → drop-core}/client.ts +18 -6
  67. package/packages/drop-core/constants.ts +39 -0
  68. package/packages/drop-core/deploy.test.ts +177 -0
  69. package/packages/{components/preact/DropZone/drop-core → drop-core}/deploy.ts +59 -9
  70. package/packages/drop-core/detectBuild.test.ts +139 -0
  71. package/packages/drop-core/digest.test.ts +24 -0
  72. package/packages/drop-core/errors.test.ts +98 -0
  73. package/packages/{components/preact/DropZone/drop-core → drop-core}/errors.ts +68 -11
  74. package/packages/drop-core/fileTypes.test.ts +37 -0
  75. package/packages/drop-core/index.ts +44 -0
  76. package/packages/drop-core/readFiles.test.ts +124 -0
  77. package/packages/{components/preact/DropZone/drop-core → drop-core}/types.ts +12 -6
  78. package/packages/drop-core/zip.test.ts +92 -0
  79. package/dist/components/preact/DropZone/drop-core/authedDropClient.js +0 -123
  80. package/dist/components/preact/DropZone/drop-core/buildClient.js +0 -99
  81. package/dist/components/preact/DropZone/drop-core/client.js +0 -45
  82. package/dist/components/preact/DropZone/drop-core/deploy.js +0 -48
  83. package/dist/components/preact/DropZone/drop-core/errors.js +0 -82
  84. package/dist/components/preact/DropZone/drop-core/index.d.ts +0 -11
  85. package/dist/components/preact/DropZone/drop-core/index.js +0 -36
  86. package/packages/components/preact/DropZone/drop-core/index.ts +0 -11
  87. /package/dist/{components/preact/DropZone/drop-core → drop-core}/detectBuild.d.ts +0 -0
  88. /package/dist/{components/preact/DropZone/drop-core → drop-core}/detectBuild.js +0 -0
  89. /package/dist/{components/preact/DropZone/drop-core → drop-core}/digest.d.ts +0 -0
  90. /package/dist/{components/preact/DropZone/drop-core → drop-core}/digest.js +0 -0
  91. /package/dist/{components/preact/DropZone/drop-core → drop-core}/fileTypes.d.ts +0 -0
  92. /package/dist/{components/preact/DropZone/drop-core → drop-core}/fileTypes.js +0 -0
  93. /package/dist/{components/preact/DropZone/drop-core → drop-core}/readFiles.d.ts +0 -0
  94. /package/dist/{components/preact/DropZone/drop-core → drop-core}/types.js +0 -0
  95. /package/dist/{components/preact/DropZone/drop-core → drop-core}/zip.d.ts +0 -0
  96. /package/packages/{components/preact/DropZone/drop-core → drop-core}/detectBuild.ts +0 -0
  97. /package/packages/{components/preact/DropZone/drop-core → drop-core}/digest.ts +0 -0
  98. /package/packages/{components/preact/DropZone/drop-core → drop-core}/fileTypes.ts +0 -0
  99. /package/packages/{components/preact/DropZone/drop-core → drop-core}/readFiles.ts +0 -0
  100. /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 './drop-core';
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
- * Where to send a build-required drop (framework source, build command,
21
- * functions) that can't be built here — no `getUploadToken`/`buildClient`, or a
22
- * visitor who isn't logged in. Such projects can't deploy through the anonymous
23
- * static drop API, so by default the user is redirected here — the app signup
24
- * page with `next=/drop` — to build on the authenticated Drop page. Override to
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, build drops to `buildSignupUrl`.
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 j, d as G, y as K } from "../../../chunks/hooks.module.DRcxknIz.js";
3
- import { readFileList as L, readDataTransfer as Z } from "./drop-core/readFiles.js";
4
- import { getFileTypes as D } from "./drop-core/fileTypes.js";
5
- import "./drop-core/detectBuild.js";
6
- import "./drop-core/zip.js";
7
- import { useDropDeploy as q } from "./useDropDeploy.js";
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 H = 120, J = (r) => `https://app.netlify.com/drop/${r}`, Q = (r) => `https://app.netlify.com/projects/${r}`, W = "https://app.netlify.com/signup?next=/drop&utm_campaign=drop", X = ({ siteName: r }) => `https://app.netlify.com/projects/${r}`;
10
- function ce({
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 = J,
15
- siteDashboardUrl: u = Q,
16
- buildSignupUrl: A = W,
15
+ claimUrl: c = X,
16
+ siteDashboardUrl: u = Y,
17
+ buildSignupUrl: S = ee,
17
18
  getUploadToken: T,
18
- buildClient: C,
19
- authenticatedDropClient: S,
20
- proxyBase: _,
21
- accountSlug: $,
22
- buildDeployUrl: B = X,
23
- waitForBuild: U,
24
- onBuildRequired: P,
25
- onDeploy: R,
26
- onBuildDeploy: x,
27
- onError: E,
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 y = (t, n = {}) => d == null ? void 0 : d(t, g ? { dropzone_id: g, ...n } : n), { status: s, warning: b, busy: i, deploy: m, reset: I } = q({
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: A,
41
+ buildSignupUrl: S,
39
42
  getUploadToken: T,
40
- buildClient: C,
41
- authenticatedDropClient: S,
42
- proxyBase: _,
43
- accountSlug: $,
44
- buildDeployUrl: B,
45
- waitForBuild: U,
46
- onBuildRequired: P,
47
- onDeploy: R,
48
- onBuildDeploy: x,
49
- onError: E,
50
- track: y
51
- }), { active: p, keepActive: M, endDrag: N } = Y(), h = j(null), v = (t) => {
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
- y("dropzone_browse_opened", { method: t }), (n = h.current) == null || n.click();
54
- }, O = f && (p || i || s.kind === "error"), V = [
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: V,
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(), M());
76
+ i || (t.preventDefault(), V());
72
77
  },
73
78
  onDrop: (t) => {
74
- if (t.preventDefault(), N(), i) return;
79
+ if (t.preventDefault(), M(), i) return;
75
80
  const n = t.dataTransfer;
76
- n && m(() => Z(n), "drag", D(n.files));
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 k;
101
+ var D;
97
102
  const n = t.currentTarget;
98
- if ((k = n.files) != null && k.length) {
99
- const z = n.files;
100
- m(() => L(z), "browse", D(z));
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
- O && /* @__PURE__ */ e(
111
+ Z && /* @__PURE__ */ e(
107
112
  "div",
108
113
  {
109
114
  class: "n-dropzone-overlay n-fadeIn",
110
115
  children: [
111
- /* @__PURE__ */ e(ee, { status: s, active: p, onReset: I }),
112
- b && s.kind !== "error" && i && /* @__PURE__ */ e("p", { class: "n-dropzone-warning", role: "status", children: b })
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 Y() {
122
- const [r, a] = G(!1), l = j();
123
- return K(() => () => clearTimeout(l.current), []), { active: r, keepActive: () => {
124
- a(!0), clearTimeout(l.current), l.current = setTimeout(() => a(!1), H);
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 ee({
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
- ce as default
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 './drop-core';
3
- export type { AuthenticatedBuildClientConfig, 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, 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 "./drop-core/readFiles.js";
3
- import { getFileTypes as l } from "./drop-core/fileTypes.js";
4
- import { detectBuild as a, inferBuildSettings as n } from "./drop-core/detectBuild.js";
5
- import { AnonymousDropClient as m } from "./drop-core/client.js";
6
- import { AuthenticatedDropClient as s } from "./drop-core/authedDropClient.js";
7
- import { AuthenticatedBuildClient as E } from "./drop-core/buildClient.js";
8
- import { zipFiles as C } from "./drop-core/zip.js";
9
- import { deployBuild as c, deployFiles as h } from "./drop-core/deploy.js";
10
- import { BuildCreateError as A, BuildFailedError as T, BuildTimeoutError as g, NotAuthenticatedError as z, SiteCreateError as S, UnsupportedDropError as L, humanizeDropError as N } from "./drop-core/errors.js";
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
- m as AnonymousDropClient,
13
- E as AuthenticatedBuildClient,
14
- s as AuthenticatedDropClient,
15
- A as BuildCreateError,
16
- T as BuildFailedError,
17
- g as BuildTimeoutError,
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
- z as NotAuthenticatedError,
20
- S as SiteCreateError,
21
- L as UnsupportedDropError,
22
- c as deployBuild,
23
- h as deployFiles,
24
- a as detectBuild,
25
- l as getFileTypes,
26
- N as humanizeDropError,
27
- n as inferBuildSettings,
28
- i as readDataTransfer,
29
- p as readFileList,
30
- C as zipFiles
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 './drop-core';
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 = 'drag' | 'browse';
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
- /** Provider-agnostic analytics sink. */
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 {};