@netlify/spark-ui 1.31.0-alpha.3 → 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.
Files changed (92) hide show
  1. package/dist/components/index.d.ts +2 -2
  2. package/dist/components/preact/DropZone/DropZone.d.ts +21 -2
  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 +25 -23
  7. package/dist/components/preact/DropZone/useDropDeploy.d.ts +10 -6
  8. package/dist/components/preact/DropZone/useDropDeploy.js +184 -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 +25 -19
  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 +55 -0
  16. package/dist/drop-core/authedApi.js +35 -0
  17. package/dist/drop-core/authedApi.test.d.ts +1 -0
  18. package/dist/drop-core/authedDropClient.js +109 -0
  19. package/dist/drop-core/authedDropClient.test.d.ts +1 -0
  20. package/dist/{components/preact/DropZone/drop-core → drop-core}/buildClient.d.ts +5 -13
  21. package/dist/drop-core/buildClient.js +84 -0
  22. package/dist/drop-core/buildClient.test.d.ts +1 -0
  23. package/dist/drop-core/buildStash.d.ts +37 -0
  24. package/dist/drop-core/buildStash.js +84 -0
  25. package/dist/drop-core/buildStash.test.d.ts +0 -0
  26. package/dist/{components/preact/DropZone/drop-core → drop-core}/deploy.d.ts +7 -0
  27. package/dist/drop-core/deploy.js +53 -0
  28. package/dist/drop-core/deploy.test.d.ts +1 -0
  29. package/dist/drop-core/detectBuild.test.d.ts +1 -0
  30. package/dist/drop-core/digest.test.d.ts +1 -0
  31. package/dist/{components/preact/DropZone/drop-core → drop-core}/errors.js +1 -1
  32. package/dist/drop-core/errors.test.d.ts +1 -0
  33. package/dist/drop-core/fileTypes.test.d.ts +1 -0
  34. package/dist/{components/preact/DropZone/drop-core → drop-core}/index.d.ts +3 -0
  35. package/dist/drop-core/index.js +51 -0
  36. package/dist/{components/preact/DropZone/drop-core → drop-core}/readFiles.js +2 -2
  37. package/dist/drop-core/readFiles.test.d.ts +1 -0
  38. package/dist/{components/preact/DropZone/drop-core → drop-core}/types.d.ts +10 -0
  39. package/dist/{components/preact/DropZone/drop-core → drop-core}/zip.js +1 -1
  40. package/dist/drop-core/zip.test.d.ts +1 -0
  41. package/package.json +4 -1
  42. package/packages/components/index.ts +19 -0
  43. package/packages/components/preact/DropZone/DropZone.test.ts +71 -0
  44. package/packages/components/preact/DropZone/DropZone.tsx +23 -2
  45. package/packages/components/preact/DropZone/index.tsx +14 -3
  46. package/packages/components/preact/DropZone/useDropDeploy.test.ts +376 -0
  47. package/packages/components/preact/DropZone/useDropDeploy.ts +297 -132
  48. package/packages/components/preact/index.ts +19 -2
  49. package/packages/drop-core/analytics.test.ts +17 -0
  50. package/packages/drop-core/analytics.ts +122 -0
  51. package/packages/drop-core/authedApi.test.ts +100 -0
  52. package/packages/drop-core/authedApi.ts +94 -0
  53. package/packages/drop-core/authedDropClient.test.ts +196 -0
  54. package/packages/{components/preact/DropZone/drop-core → drop-core}/authedDropClient.ts +30 -51
  55. package/packages/drop-core/buildClient.test.ts +112 -0
  56. package/packages/{components/preact/DropZone/drop-core → drop-core}/buildClient.ts +28 -57
  57. package/packages/drop-core/buildStash.test.ts +85 -0
  58. package/packages/drop-core/buildStash.ts +185 -0
  59. package/packages/drop-core/deploy.test.ts +135 -0
  60. package/packages/{components/preact/DropZone/drop-core → drop-core}/deploy.ts +18 -4
  61. package/packages/drop-core/detectBuild.test.ts +139 -0
  62. package/packages/drop-core/digest.test.ts +24 -0
  63. package/packages/drop-core/errors.test.ts +69 -0
  64. package/packages/{components/preact/DropZone/drop-core → drop-core}/errors.ts +1 -1
  65. package/packages/drop-core/fileTypes.test.ts +37 -0
  66. package/packages/{components/preact/DropZone/drop-core → drop-core}/index.ts +3 -0
  67. package/packages/drop-core/readFiles.test.ts +125 -0
  68. package/packages/{components/preact/DropZone/drop-core → drop-core}/types.ts +12 -6
  69. package/packages/drop-core/zip.test.ts +92 -0
  70. package/dist/components/preact/DropZone/drop-core/authedDropClient.js +0 -123
  71. package/dist/components/preact/DropZone/drop-core/buildClient.js +0 -99
  72. package/dist/components/preact/DropZone/drop-core/deploy.js +0 -48
  73. package/dist/components/preact/DropZone/drop-core/index.js +0 -36
  74. /package/dist/{components/preact/DropZone/drop-core → drop-core}/authedDropClient.d.ts +0 -0
  75. /package/dist/{components/preact/DropZone/drop-core → drop-core}/client.d.ts +0 -0
  76. /package/dist/{components/preact/DropZone/drop-core → drop-core}/client.js +0 -0
  77. /package/dist/{components/preact/DropZone/drop-core → drop-core}/detectBuild.d.ts +0 -0
  78. /package/dist/{components/preact/DropZone/drop-core → drop-core}/detectBuild.js +0 -0
  79. /package/dist/{components/preact/DropZone/drop-core → drop-core}/digest.d.ts +0 -0
  80. /package/dist/{components/preact/DropZone/drop-core → drop-core}/digest.js +0 -0
  81. /package/dist/{components/preact/DropZone/drop-core → drop-core}/errors.d.ts +0 -0
  82. /package/dist/{components/preact/DropZone/drop-core → drop-core}/fileTypes.d.ts +0 -0
  83. /package/dist/{components/preact/DropZone/drop-core → drop-core}/fileTypes.js +0 -0
  84. /package/dist/{components/preact/DropZone/drop-core → drop-core}/readFiles.d.ts +0 -0
  85. /package/dist/{components/preact/DropZone/drop-core → drop-core}/types.js +0 -0
  86. /package/dist/{components/preact/DropZone/drop-core → drop-core}/zip.d.ts +0 -0
  87. /package/packages/{components/preact/DropZone/drop-core → drop-core}/client.ts +0 -0
  88. /package/packages/{components/preact/DropZone/drop-core → drop-core}/detectBuild.ts +0 -0
  89. /package/packages/{components/preact/DropZone/drop-core → drop-core}/digest.ts +0 -0
  90. /package/packages/{components/preact/DropZone/drop-core → drop-core}/fileTypes.ts +0 -0
  91. /package/packages/{components/preact/DropZone/drop-core → drop-core}/readFiles.ts +0 -0
  92. /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. */
@@ -77,6 +77,25 @@ interface Props {
77
77
  * redirects. The static drop path is unaffected either way.
78
78
  */
79
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;
80
99
  /** Called once the deploy is live. */
81
100
  onDeploy?: (result: DeployedSite) => void;
82
101
  /**
@@ -130,5 +149,5 @@ interface Props {
130
149
  analyticsId?: string;
131
150
  className?: string;
132
151
  }
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;
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;
134
153
  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 { 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 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(H.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(() => q(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(() => W(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 { 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
- m as AnonymousDropClient,
13
- E as AuthenticatedBuildClient,
14
- s as AuthenticatedDropClient,
15
- A as BuildCreateError,
16
- T as BuildFailedError,
17
- g as BuildTimeoutError,
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
- z as NotAuthenticatedError,
20
- S as SiteCreateError,
21
- L as UnsupportedDropError,
22
- c as deployBuild,
23
- h as deployFiles,
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
- N as humanizeDropError,
27
- n as inferBuildSettings,
28
+ c as humanizeDropError,
29
+ f as inferBuildSettings,
28
30
  i as readDataTransfer,
29
31
  p as readFileList,
30
- C as zipFiles
32
+ S 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,8 @@ 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
+ /** 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;
@@ -73,6 +73,11 @@ interface UseDropDeployOptions {
73
73
  buildDeployUrl: (build: DeployedBuild) => string;
74
74
  waitForBuild?: boolean;
75
75
  onBuildRequired?: (info: BuildDetection) => void;
76
+ onBuildSignupHandoff?: (info: {
77
+ stashed: boolean;
78
+ detection: BuildDetection;
79
+ }) => void;
80
+ resumeStashedBuilds?: boolean;
76
81
  onDeploy?: (site: DeployedSite) => void;
77
82
  onBuildDeploy?: (build: DeployedBuild) => void;
78
83
  onError?: (error: DeployError) => void;
@@ -82,11 +87,10 @@ interface UseDropDeployOptions {
82
87
  * Owns the deploy state machine and its side effects (upload, local persistence,
83
88
  * analytics, redirect), keeping DropZone a thin view over the returned `status`.
84
89
  */
85
- export declare function useDropDeploy({ apiBase, client, claimUrl, siteDashboardUrl, buildSignupUrl, buildClient, authenticatedDropClient, getUploadToken, proxyBase, 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): {
86
91
  status: DeployStatus;
87
92
  warning: string | null;
88
93
  busy: boolean;
89
94
  deploy: (read: () => Promise<ProcessedFile[]>, source: DeploySource, fileTypes: string[]) => Promise<void>;
90
95
  reset: () => void;
91
96
  };
92
- export {};