@burdenoff/website-sdk 2026.817.2 → 2026.824.1

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/index.js CHANGED
@@ -1185,16 +1185,38 @@ var PUBLIC_CONTENT_PAGES_QUERY = `
1185
1185
  }
1186
1186
  }
1187
1187
  `;
1188
+ function resolveContentPageGate(resolvedProductId, hasProvider, productLoading) {
1189
+ if (resolvedProductId) return "fetch";
1190
+ return hasProvider && productLoading ? "wait" : "unavailable";
1191
+ }
1188
1192
  function useContentPage(slug, options) {
1189
1193
  const client = useWebSDK();
1190
1194
  const config = useWebSDKConfig();
1191
- const { product } = useProduct();
1195
+ const {
1196
+ product,
1197
+ loading: productLoading,
1198
+ error: productError,
1199
+ hasProvider
1200
+ } = useProduct();
1192
1201
  const resolvedProductId = product?.id || config.productId;
1202
+ const gate = resolveContentPageGate(
1203
+ resolvedProductId,
1204
+ hasProvider,
1205
+ productLoading
1206
+ );
1193
1207
  const [data, setData] = React.useState(null);
1194
1208
  const [loading, setLoading] = React.useState(true);
1195
1209
  const [error, setError] = React.useState(null);
1196
1210
  const fetchPage = React.useCallback(async () => {
1197
- if (!resolvedProductId) return;
1211
+ if (gate === "wait") return;
1212
+ if (gate === "unavailable") {
1213
+ setData(null);
1214
+ setError(
1215
+ productError ?? "Product unavailable \u2014 cannot load content page"
1216
+ );
1217
+ setLoading(false);
1218
+ return;
1219
+ }
1198
1220
  setLoading(true);
1199
1221
  setError(null);
1200
1222
  try {
@@ -1219,7 +1241,7 @@ function useContentPage(slug, options) {
1219
1241
  } finally {
1220
1242
  setLoading(false);
1221
1243
  }
1222
- }, [client, resolvedProductId, slug, options?.resolve]);
1244
+ }, [client, gate, productError, resolvedProductId, slug, options?.resolve]);
1223
1245
  React.useEffect(() => {
1224
1246
  fetchPage();
1225
1247
  }, [fetchPage]);
@@ -2057,6 +2079,7 @@ var NO_APPLICATION_HINT = "Please use the same email address you applied with \u
2057
2079
  function isNoApplicationError(message) {
2058
2080
  return /no application|not found/i.test(message);
2059
2081
  }
2082
+ var OTHER_POSITION = "__other__";
2060
2083
  function CareersSubmissionForm({
2061
2084
  productName,
2062
2085
  recaptchaSiteKey,
@@ -2076,6 +2099,9 @@ function CareersSubmissionForm({
2076
2099
  const [isSubmitting, setIsSubmitting] = React.useState(false);
2077
2100
  const [submittedMessage, setSubmittedMessage] = React.useState(null);
2078
2101
  const [formError, setFormError] = React.useState(null);
2102
+ const [useFreeTextPosition, setUseFreeTextPosition] = React.useState(
2103
+ postings.length === 0
2104
+ );
2079
2105
  const handleSubmit = async (e) => {
2080
2106
  e.preventDefault();
2081
2107
  setFormError(null);
@@ -2092,7 +2118,7 @@ function CareersSubmissionForm({
2092
2118
  const repoUrl = (formData.get("repoUrl") ?? "").trim();
2093
2119
  const videoUrl = (formData.get("videoUrl") ?? "").trim();
2094
2120
  const notes = (formData.get("notes") ?? "").trim();
2095
- const selectedPosting = postings.length > 0 ? postings.find((p) => p.id === positionValue) : void 0;
2121
+ const selectedPosting = postings.length > 0 && !useFreeTextPosition ? postings.find((p) => p.id === positionValue) : void 0;
2096
2122
  const position = selectedPosting ? selectedPosting.title : positionValue;
2097
2123
  if (!email) {
2098
2124
  setFormError("Please enter the email address you applied with.");
@@ -2192,28 +2218,53 @@ function CareersSubmissionForm({
2192
2218
  ] }),
2193
2219
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2194
2220
  /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "position", children: "Position *" }),
2195
- postings.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
2196
- "select",
2197
- {
2198
- id: "position",
2199
- name: "position",
2200
- required: true,
2201
- defaultValue: "",
2202
- className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",
2203
- children: [
2204
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", disabled: true, children: "Select a role" }),
2205
- postings.map((p) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: p.id, children: p.title }, p.id))
2206
- ]
2207
- }
2208
- ) : /* @__PURE__ */ jsxRuntime.jsx(
2209
- Input,
2210
- {
2211
- id: "position",
2212
- name: "position",
2213
- required: true,
2214
- placeholder: "Role you applied for"
2215
- }
2216
- )
2221
+ postings.length > 0 && !useFreeTextPosition ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2222
+ /* @__PURE__ */ jsxRuntime.jsxs(
2223
+ "select",
2224
+ {
2225
+ id: "position",
2226
+ name: "position",
2227
+ required: true,
2228
+ defaultValue: "",
2229
+ onChange: (e) => {
2230
+ if (e.target.value === OTHER_POSITION) {
2231
+ setUseFreeTextPosition(true);
2232
+ }
2233
+ },
2234
+ className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",
2235
+ children: [
2236
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", disabled: true, children: "Select a role" }),
2237
+ postings.map((p) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: p.id, children: p.title }, p.id)),
2238
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: OTHER_POSITION, children: "My role isn't listed" })
2239
+ ]
2240
+ }
2241
+ ),
2242
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "mt-1 text-xs text-muted-foreground", children: [
2243
+ "Applied to a role that's since closed? Choose",
2244
+ " ",
2245
+ /* @__PURE__ */ jsxRuntime.jsx("em", { children: "My role isn't listed" }),
2246
+ " and type it in \u2014 you can still submit."
2247
+ ] })
2248
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2249
+ /* @__PURE__ */ jsxRuntime.jsx(
2250
+ Input,
2251
+ {
2252
+ id: "position",
2253
+ name: "position",
2254
+ required: true,
2255
+ placeholder: "Role you applied for"
2256
+ }
2257
+ ),
2258
+ postings.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
2259
+ "button",
2260
+ {
2261
+ type: "button",
2262
+ onClick: () => setUseFreeTextPosition(false),
2263
+ className: "mt-1 text-xs text-accent hover:underline",
2264
+ children: "Choose from open roles instead"
2265
+ }
2266
+ )
2267
+ ] })
2217
2268
  ] }),
2218
2269
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2219
2270
  /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "repoUrl", children: "GitHub repository URL *" }),