@swift-food-services/catering-widget 0.1.0-beta.1 → 0.1.0-beta.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.
package/dist/index.cjs CHANGED
@@ -3821,8 +3821,12 @@ function DateSessionNav({
3821
3821
  }
3822
3822
 
3823
3823
  // src/shims/fetchWithAuth.ts
3824
+ var runtimeBaseUrl;
3825
+ function setWidgetBaseUrl(url) {
3826
+ runtimeBaseUrl = url;
3827
+ }
3824
3828
  async function fetchWithAuth(input, init) {
3825
- const url = input.startsWith("http://") || input.startsWith("https://") ? input : `${resolveBaseUrl()}${input}`;
3829
+ const url = input.startsWith("http://") || input.startsWith("https://") ? input : `${resolveBaseUrl(runtimeBaseUrl)}${input}`;
3826
3830
  const headers = {
3827
3831
  ...{}
3828
3832
  };
@@ -12648,6 +12652,7 @@ var STUB_PARTNER_ID = "stub";
12648
12652
  function CateringWidget(props) {
12649
12653
  const {
12650
12654
  publishableKey,
12655
+ baseUrl,
12651
12656
  theme,
12652
12657
  initialData,
12653
12658
  stickyTopOffset,
@@ -12657,7 +12662,8 @@ function CateringWidget(props) {
12657
12662
  } = props;
12658
12663
  const partnerId = STUB_PARTNER_ID;
12659
12664
  const [baseConfig] = react.useState(() => {
12660
- const apiClient = createApiClient({ publishableKey });
12665
+ setWidgetBaseUrl(baseUrl);
12666
+ const apiClient = createApiClient({ publishableKey, baseUrl });
12661
12667
  const api = createApiEndpoints(apiClient);
12662
12668
  setCateringServiceEndpoints(api);
12663
12669
  return {