@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.
Files changed (94) hide show
  1. package/dist/components/index.d.ts +2 -2
  2. package/dist/components/preact/DropZone/DropZone.d.ts +28 -2
  3. package/dist/components/preact/DropZone/DropZone.js +58 -51
  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 +11 -6
  8. package/dist/components/preact/DropZone/useDropDeploy.js +183 -129
  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.d.ts +100 -0
  19. package/dist/drop-core/authedDropClient.js +109 -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 +32 -26
  22. package/dist/drop-core/buildClient.js +84 -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}/deploy.d.ts +7 -0
  28. package/dist/drop-core/deploy.js +53 -0
  29. package/dist/drop-core/deploy.test.d.ts +1 -0
  30. package/dist/drop-core/detectBuild.test.d.ts +1 -0
  31. package/dist/drop-core/digest.test.d.ts +1 -0
  32. package/dist/{components/preact/DropZone/drop-core → drop-core}/errors.js +1 -1
  33. package/dist/drop-core/errors.test.d.ts +1 -0
  34. package/dist/drop-core/fileTypes.test.d.ts +1 -0
  35. package/dist/{components/preact/DropZone/drop-core → drop-core}/index.d.ts +3 -0
  36. package/dist/drop-core/index.js +51 -0
  37. package/dist/{components/preact/DropZone/drop-core → drop-core}/readFiles.js +2 -2
  38. package/dist/drop-core/readFiles.test.d.ts +1 -0
  39. package/dist/{components/preact/DropZone/drop-core → drop-core}/types.d.ts +10 -0
  40. package/dist/{components/preact/DropZone/drop-core → drop-core}/zip.js +1 -1
  41. package/dist/drop-core/zip.test.d.ts +1 -0
  42. package/package.json +4 -1
  43. package/packages/components/index.ts +19 -0
  44. package/packages/components/preact/DropZone/DropZone.test.ts +71 -0
  45. package/packages/components/preact/DropZone/DropZone.tsx +32 -2
  46. package/packages/components/preact/DropZone/index.tsx +14 -3
  47. package/packages/components/preact/DropZone/useDropDeploy.test.ts +376 -0
  48. package/packages/components/preact/DropZone/useDropDeploy.ts +305 -134
  49. package/packages/components/preact/index.ts +19 -2
  50. package/packages/drop-core/analytics.test.ts +17 -0
  51. package/packages/drop-core/analytics.ts +122 -0
  52. package/packages/drop-core/authedApi.test.ts +100 -0
  53. package/packages/drop-core/authedApi.ts +94 -0
  54. package/packages/drop-core/authedDropClient.test.ts +196 -0
  55. package/packages/drop-core/authedDropClient.ts +210 -0
  56. package/packages/drop-core/buildClient.test.ts +112 -0
  57. package/packages/{components/preact/DropZone/drop-core → drop-core}/buildClient.ts +55 -70
  58. package/packages/drop-core/buildStash.test.ts +85 -0
  59. package/packages/drop-core/buildStash.ts +185 -0
  60. package/packages/drop-core/deploy.test.ts +135 -0
  61. package/packages/{components/preact/DropZone/drop-core → drop-core}/deploy.ts +18 -4
  62. package/packages/drop-core/detectBuild.test.ts +139 -0
  63. package/packages/drop-core/digest.test.ts +24 -0
  64. package/packages/drop-core/errors.test.ts +69 -0
  65. package/packages/{components/preact/DropZone/drop-core → drop-core}/errors.ts +1 -1
  66. package/packages/drop-core/fileTypes.test.ts +37 -0
  67. package/packages/{components/preact/DropZone/drop-core → drop-core}/index.ts +3 -0
  68. package/packages/drop-core/readFiles.test.ts +125 -0
  69. package/packages/{components/preact/DropZone/drop-core → drop-core}/types.ts +12 -6
  70. package/packages/drop-core/zip.test.ts +92 -0
  71. package/dist/components/preact/DropZone/drop-core/authedDropClient.d.ts +0 -77
  72. package/dist/components/preact/DropZone/drop-core/authedDropClient.js +0 -97
  73. package/dist/components/preact/DropZone/drop-core/buildClient.js +0 -92
  74. package/dist/components/preact/DropZone/drop-core/deploy.js +0 -48
  75. package/dist/components/preact/DropZone/drop-core/index.js +0 -36
  76. package/packages/components/preact/DropZone/drop-core/authedDropClient.ts +0 -185
  77. /package/dist/{components/preact/DropZone/drop-core → drop-core}/client.d.ts +0 -0
  78. /package/dist/{components/preact/DropZone/drop-core → drop-core}/client.js +0 -0
  79. /package/dist/{components/preact/DropZone/drop-core → drop-core}/detectBuild.d.ts +0 -0
  80. /package/dist/{components/preact/DropZone/drop-core → drop-core}/detectBuild.js +0 -0
  81. /package/dist/{components/preact/DropZone/drop-core → drop-core}/digest.d.ts +0 -0
  82. /package/dist/{components/preact/DropZone/drop-core → drop-core}/digest.js +0 -0
  83. /package/dist/{components/preact/DropZone/drop-core → drop-core}/errors.d.ts +0 -0
  84. /package/dist/{components/preact/DropZone/drop-core → drop-core}/fileTypes.d.ts +0 -0
  85. /package/dist/{components/preact/DropZone/drop-core → drop-core}/fileTypes.js +0 -0
  86. /package/dist/{components/preact/DropZone/drop-core → drop-core}/readFiles.d.ts +0 -0
  87. /package/dist/{components/preact/DropZone/drop-core → drop-core}/types.js +0 -0
  88. /package/dist/{components/preact/DropZone/drop-core → drop-core}/zip.d.ts +0 -0
  89. /package/packages/{components/preact/DropZone/drop-core → drop-core}/client.ts +0 -0
  90. /package/packages/{components/preact/DropZone/drop-core → drop-core}/detectBuild.ts +0 -0
  91. /package/packages/{components/preact/DropZone/drop-core → drop-core}/digest.ts +0 -0
  92. /package/packages/{components/preact/DropZone/drop-core → drop-core}/fileTypes.ts +0 -0
  93. /package/packages/{components/preact/DropZone/drop-core → drop-core}/readFiles.ts +0 -0
  94. /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. */
@@ -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 j, d as V, y as G } from "../../../chunks/hooks.module.DRcxknIz.js";
3
- import { readFileList as K, readDataTransfer as L } 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 Z } 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 q = 120, H = (r) => `https://app.netlify.com/drop/${r}`, J = (r) => `https://app.netlify.com/projects/${r}`, Q = "https://app.netlify.com/signup?next=/drop&utm_campaign=drop", W = ({ siteName: r }) => `https://app.netlify.com/projects/${r}`;
10
- function se({
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 = H,
15
- siteDashboardUrl: u = J,
16
- buildSignupUrl: A = Q,
15
+ claimUrl: c = X,
16
+ siteDashboardUrl: u = Y,
17
+ buildSignupUrl: S = ee,
17
18
  getUploadToken: T,
18
- buildClient: C,
19
- authenticatedDropClient: S,
20
- accountSlug: _,
21
- buildDeployUrl: $ = W,
22
- waitForBuild: B,
23
- onBuildRequired: U,
24
- onDeploy: P,
25
- onBuildDeploy: R,
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: E
34
+ className: F
31
35
  }) {
32
- 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: F } = Z({
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: A,
41
+ buildSignupUrl: S,
38
42
  getUploadToken: T,
39
- buildClient: C,
40
- authenticatedDropClient: S,
41
- accountSlug: _,
42
- buildDeployUrl: $,
43
- waitForBuild: B,
44
- onBuildRequired: U,
45
- onDeploy: P,
46
- onBuildDeploy: R,
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: y
49
- }), { active: p, keepActive: I, endDrag: M } = X(), h = j(null), v = (t) => {
55
+ track: m
56
+ }), { active: p, keepActive: V, endDrag: M } = te(), h = E(null), v = (t) => {
50
57
  var n;
51
- y("dropzone_browse_opened", { method: t }), (n = h.current) == null || n.click();
52
- }, N = f && (p || i || s.kind === "error"), O = [
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
- E
64
+ F
58
65
  ].filter(Boolean).join(" ");
59
66
  return /* @__PURE__ */ e(
60
67
  "div",
61
68
  {
62
- class: O,
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(), I());
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 && m(() => L(n), "drag", D(n.files));
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 k;
101
+ var D;
95
102
  const n = t.currentTarget;
96
- if ((k = n.files) != null && k.length) {
97
- const z = n.files;
98
- m(() => K(z), "browse", D(z));
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
- N && /* @__PURE__ */ e(
111
+ Z && /* @__PURE__ */ e(
105
112
  "div",
106
113
  {
107
114
  class: "n-dropzone-overlay n-fadeIn",
108
115
  children: [
109
- /* @__PURE__ */ e(Y, { status: s, active: p, onReset: F }),
110
- 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 })
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 X() {
120
- const [r, a] = V(!1), l = j();
121
- return G(() => () => clearTimeout(l.current), []), { active: r, keepActive: () => {
122
- a(!0), clearTimeout(l.current), l.current = setTimeout(() => a(!1), q);
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 Y({
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
- se as default
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 './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;
@@ -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 {};