@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.mjs CHANGED
@@ -1155,16 +1155,38 @@ var PUBLIC_CONTENT_PAGES_QUERY = `
1155
1155
  }
1156
1156
  }
1157
1157
  `;
1158
+ function resolveContentPageGate(resolvedProductId, hasProvider, productLoading) {
1159
+ if (resolvedProductId) return "fetch";
1160
+ return hasProvider && productLoading ? "wait" : "unavailable";
1161
+ }
1158
1162
  function useContentPage(slug, options) {
1159
1163
  const client = useWebSDK();
1160
1164
  const config = useWebSDKConfig();
1161
- const { product } = useProduct();
1165
+ const {
1166
+ product,
1167
+ loading: productLoading,
1168
+ error: productError,
1169
+ hasProvider
1170
+ } = useProduct();
1162
1171
  const resolvedProductId = product?.id || config.productId;
1172
+ const gate = resolveContentPageGate(
1173
+ resolvedProductId,
1174
+ hasProvider,
1175
+ productLoading
1176
+ );
1163
1177
  const [data, setData] = useState(null);
1164
1178
  const [loading, setLoading] = useState(true);
1165
1179
  const [error, setError] = useState(null);
1166
1180
  const fetchPage = useCallback(async () => {
1167
- if (!resolvedProductId) return;
1181
+ if (gate === "wait") return;
1182
+ if (gate === "unavailable") {
1183
+ setData(null);
1184
+ setError(
1185
+ productError ?? "Product unavailable \u2014 cannot load content page"
1186
+ );
1187
+ setLoading(false);
1188
+ return;
1189
+ }
1168
1190
  setLoading(true);
1169
1191
  setError(null);
1170
1192
  try {
@@ -1189,7 +1211,7 @@ function useContentPage(slug, options) {
1189
1211
  } finally {
1190
1212
  setLoading(false);
1191
1213
  }
1192
- }, [client, resolvedProductId, slug, options?.resolve]);
1214
+ }, [client, gate, productError, resolvedProductId, slug, options?.resolve]);
1193
1215
  useEffect(() => {
1194
1216
  fetchPage();
1195
1217
  }, [fetchPage]);
@@ -2027,6 +2049,7 @@ var NO_APPLICATION_HINT = "Please use the same email address you applied with \u
2027
2049
  function isNoApplicationError(message) {
2028
2050
  return /no application|not found/i.test(message);
2029
2051
  }
2052
+ var OTHER_POSITION = "__other__";
2030
2053
  function CareersSubmissionForm({
2031
2054
  productName,
2032
2055
  recaptchaSiteKey,
@@ -2046,6 +2069,9 @@ function CareersSubmissionForm({
2046
2069
  const [isSubmitting, setIsSubmitting] = useState(false);
2047
2070
  const [submittedMessage, setSubmittedMessage] = useState(null);
2048
2071
  const [formError, setFormError] = useState(null);
2072
+ const [useFreeTextPosition, setUseFreeTextPosition] = useState(
2073
+ postings.length === 0
2074
+ );
2049
2075
  const handleSubmit = async (e) => {
2050
2076
  e.preventDefault();
2051
2077
  setFormError(null);
@@ -2062,7 +2088,7 @@ function CareersSubmissionForm({
2062
2088
  const repoUrl = (formData.get("repoUrl") ?? "").trim();
2063
2089
  const videoUrl = (formData.get("videoUrl") ?? "").trim();
2064
2090
  const notes = (formData.get("notes") ?? "").trim();
2065
- const selectedPosting = postings.length > 0 ? postings.find((p) => p.id === positionValue) : void 0;
2091
+ const selectedPosting = postings.length > 0 && !useFreeTextPosition ? postings.find((p) => p.id === positionValue) : void 0;
2066
2092
  const position = selectedPosting ? selectedPosting.title : positionValue;
2067
2093
  if (!email) {
2068
2094
  setFormError("Please enter the email address you applied with.");
@@ -2162,28 +2188,53 @@ function CareersSubmissionForm({
2162
2188
  ] }),
2163
2189
  /* @__PURE__ */ jsxs("div", { children: [
2164
2190
  /* @__PURE__ */ jsx(Label, { htmlFor: "position", children: "Position *" }),
2165
- postings.length > 0 ? /* @__PURE__ */ jsxs(
2166
- "select",
2167
- {
2168
- id: "position",
2169
- name: "position",
2170
- required: true,
2171
- defaultValue: "",
2172
- 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",
2173
- children: [
2174
- /* @__PURE__ */ jsx("option", { value: "", disabled: true, children: "Select a role" }),
2175
- postings.map((p) => /* @__PURE__ */ jsx("option", { value: p.id, children: p.title }, p.id))
2176
- ]
2177
- }
2178
- ) : /* @__PURE__ */ jsx(
2179
- Input,
2180
- {
2181
- id: "position",
2182
- name: "position",
2183
- required: true,
2184
- placeholder: "Role you applied for"
2185
- }
2186
- )
2191
+ postings.length > 0 && !useFreeTextPosition ? /* @__PURE__ */ jsxs(Fragment, { children: [
2192
+ /* @__PURE__ */ jsxs(
2193
+ "select",
2194
+ {
2195
+ id: "position",
2196
+ name: "position",
2197
+ required: true,
2198
+ defaultValue: "",
2199
+ onChange: (e) => {
2200
+ if (e.target.value === OTHER_POSITION) {
2201
+ setUseFreeTextPosition(true);
2202
+ }
2203
+ },
2204
+ 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",
2205
+ children: [
2206
+ /* @__PURE__ */ jsx("option", { value: "", disabled: true, children: "Select a role" }),
2207
+ postings.map((p) => /* @__PURE__ */ jsx("option", { value: p.id, children: p.title }, p.id)),
2208
+ /* @__PURE__ */ jsx("option", { value: OTHER_POSITION, children: "My role isn't listed" })
2209
+ ]
2210
+ }
2211
+ ),
2212
+ /* @__PURE__ */ jsxs("p", { className: "mt-1 text-xs text-muted-foreground", children: [
2213
+ "Applied to a role that's since closed? Choose",
2214
+ " ",
2215
+ /* @__PURE__ */ jsx("em", { children: "My role isn't listed" }),
2216
+ " and type it in \u2014 you can still submit."
2217
+ ] })
2218
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2219
+ /* @__PURE__ */ jsx(
2220
+ Input,
2221
+ {
2222
+ id: "position",
2223
+ name: "position",
2224
+ required: true,
2225
+ placeholder: "Role you applied for"
2226
+ }
2227
+ ),
2228
+ postings.length > 0 && /* @__PURE__ */ jsx(
2229
+ "button",
2230
+ {
2231
+ type: "button",
2232
+ onClick: () => setUseFreeTextPosition(false),
2233
+ className: "mt-1 text-xs text-accent hover:underline",
2234
+ children: "Choose from open roles instead"
2235
+ }
2236
+ )
2237
+ ] })
2187
2238
  ] }),
2188
2239
  /* @__PURE__ */ jsxs("div", { children: [
2189
2240
  /* @__PURE__ */ jsx(Label, { htmlFor: "repoUrl", children: "GitHub repository URL *" }),