@burdenoff/website-sdk 2026.817.2 → 2026.824.2

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.
@@ -327,16 +327,38 @@ var PUBLIC_CONTENT_PAGES_QUERY = `
327
327
  }
328
328
  }
329
329
  `;
330
+ function resolveContentPageGate(resolvedProductId, hasProvider, productLoading) {
331
+ if (resolvedProductId) return "fetch";
332
+ return hasProvider && productLoading ? "wait" : "unavailable";
333
+ }
330
334
  function useContentPage(slug, options) {
331
335
  const client = useWebSDK();
332
336
  const config = useWebSDKConfig();
333
- const { product } = useProduct();
337
+ const {
338
+ product,
339
+ loading: productLoading,
340
+ error: productError,
341
+ hasProvider
342
+ } = useProduct();
334
343
  const resolvedProductId = product?.id || config.productId;
344
+ const gate = resolveContentPageGate(
345
+ resolvedProductId,
346
+ hasProvider,
347
+ productLoading
348
+ );
335
349
  const [data, setData] = useState(null);
336
350
  const [loading, setLoading] = useState(true);
337
351
  const [error, setError] = useState(null);
338
352
  const fetchPage = useCallback(async () => {
339
- if (!resolvedProductId) return;
353
+ if (gate === "wait") return;
354
+ if (gate === "unavailable") {
355
+ setData(null);
356
+ setError(
357
+ productError ?? "Product unavailable \u2014 cannot load content page"
358
+ );
359
+ setLoading(false);
360
+ return;
361
+ }
340
362
  setLoading(true);
341
363
  setError(null);
342
364
  try {
@@ -361,7 +383,7 @@ function useContentPage(slug, options) {
361
383
  } finally {
362
384
  setLoading(false);
363
385
  }
364
- }, [client, resolvedProductId, slug, options?.resolve]);
386
+ }, [client, gate, productError, resolvedProductId, slug, options?.resolve]);
365
387
  useEffect(() => {
366
388
  fetchPage();
367
389
  }, [fetchPage]);
@@ -466,6 +488,25 @@ var PUBLIC_JOB_POSTING_QUERY = (
466
488
  }
467
489
  `
468
490
  );
491
+ var PUBLIC_JOB_POSTINGS_FOR_SUBMISSION_QUERY = (
492
+ /* GraphQL */
493
+ `
494
+ query PublicJobPostingsForSubmission(
495
+ $productId: ID
496
+ $limit: Int
497
+ $offset: Int
498
+ ) {
499
+ publicJobPostingsForSubmission(
500
+ productId: $productId
501
+ limit: $limit
502
+ offset: $offset
503
+ ) {
504
+ id
505
+ title
506
+ }
507
+ }
508
+ `
509
+ );
469
510
  async function fetchPublicJobPostings(client, options) {
470
511
  const result = await client.query(PUBLIC_JOB_POSTINGS_QUERY, {
471
512
  productId: options?.productId,
@@ -487,6 +528,17 @@ async function fetchPublicJobPosting(client, slug, options) {
487
528
  }
488
529
  return result.data?.publicJobPosting ?? null;
489
530
  }
531
+ async function fetchPublicJobPostingsForSubmission(client, options) {
532
+ const result = await client.query(PUBLIC_JOB_POSTINGS_FOR_SUBMISSION_QUERY, {
533
+ productId: options?.productId,
534
+ limit: options?.limit ?? 50,
535
+ offset: options?.offset ?? 0
536
+ });
537
+ if (result.errors?.length) {
538
+ throw new Error(result.errors[0]?.message ?? "Unknown error");
539
+ }
540
+ return result.data?.publicJobPostingsForSubmission ?? [];
541
+ }
490
542
  function usePublicJobPostings(options) {
491
543
  const client = useWebSDK();
492
544
  const config = useWebSDKConfig();
@@ -519,6 +571,38 @@ function usePublicJobPostings(options) {
519
571
  }, [fetchPostings]);
520
572
  return { postings, loading, error, refetch: fetchPostings };
521
573
  }
574
+ function usePublicJobPostingsForSubmission(options) {
575
+ const client = useWebSDK();
576
+ const config = useWebSDKConfig();
577
+ const { product } = useProduct();
578
+ const resolvedProductId = options?.productId ?? product?.id ?? config.productId;
579
+ const [postings, setPostings] = useState([]);
580
+ const [loading, setLoading] = useState(true);
581
+ const [error, setError] = useState(null);
582
+ const fetchPostings = useCallback(async () => {
583
+ setLoading(true);
584
+ setError(null);
585
+ try {
586
+ const items = await fetchPublicJobPostingsForSubmission(client, {
587
+ productId: resolvedProductId,
588
+ limit: options?.limit,
589
+ offset: options?.offset
590
+ });
591
+ setPostings(items);
592
+ } catch (err) {
593
+ setError(
594
+ err instanceof Error ? err.message : "Failed to fetch job postings"
595
+ );
596
+ setPostings([]);
597
+ } finally {
598
+ setLoading(false);
599
+ }
600
+ }, [client, resolvedProductId, options?.limit, options?.offset]);
601
+ useEffect(() => {
602
+ fetchPostings();
603
+ }, [fetchPostings]);
604
+ return { postings, loading, error, refetch: fetchPostings };
605
+ }
522
606
  function usePublicJobPosting(slug, options) {
523
607
  const client = useWebSDK();
524
608
  const config = useWebSDKConfig();
@@ -3191,6 +3275,6 @@ function ContractsPage(props) {
3191
3275
  ] });
3192
3276
  }
3193
3277
 
3194
- export { BlogListPage, BlogPostPage, CaseStudiesListPage, CaseStudyPage, ChangelogPage, ContentRenderer, ContractsPage, Markdown, PressKitPage, fetchPublicJobPosting, fetchPublicJobPostings, useContentPage, useContentPages, usePublicJobPosting, usePublicJobPostings };
3278
+ export { BlogListPage, BlogPostPage, CaseStudiesListPage, CaseStudyPage, ChangelogPage, ContentRenderer, ContractsPage, Markdown, PressKitPage, fetchPublicJobPosting, fetchPublicJobPostings, fetchPublicJobPostingsForSubmission, useContentPage, useContentPages, usePublicJobPosting, usePublicJobPostings, usePublicJobPostingsForSubmission };
3195
3279
  //# sourceMappingURL=index.mjs.map
3196
3280
  //# sourceMappingURL=index.mjs.map