@superblocksteam/library 2.0.100 → 2.0.101-next.0

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.
@@ -1,4 +1,4 @@
1
- import { _ as root_store_default, t as makeWrappedComponent, x as api_hmr_tracker_default } from "../jsx-wrapper-aSZhsulk.js";
1
+ import { _ as root_store_default, t as makeWrappedComponent, x as api_hmr_tracker_default } from "../jsx-wrapper-zEtt7xG7.js";
2
2
  import { SOURCE_ID_ATTRIBUTE } from "@superblocksteam/library-shared";
3
3
  import * as ReactJsxDevRuntime from "react/jsx-dev-runtime";
4
4
 
@@ -2613,7 +2613,7 @@ var ApiManager = class {
2613
2613
  };
2614
2614
  await this.rootStore.editStore?.operationManager.ensureFilesSynced();
2615
2615
  const profile = this.rootStore.profile;
2616
- const branchName = this.rootStore.branchName;
2616
+ const editModeBranchName = this.rootStore.branchName ?? "main";
2617
2617
  const commitId = this.rootStore.commitId;
2618
2618
  const editMode$1 = isEditMode();
2619
2619
  const appMode$1 = getAppMode();
@@ -2644,13 +2644,13 @@ var ApiManager = class {
2644
2644
  if (files.length > 0) body.files = files;
2645
2645
  if (profile) body.profile = profile;
2646
2646
  if (editMode$1) {
2647
- if (branchName) body.branchName = branchName;
2647
+ body.branchName = editModeBranchName;
2648
2648
  body.includeDiagnostics = true;
2649
2649
  }
2650
2650
  if (!editMode$1 && commitId) body.commitId = commitId;
2651
2651
  const integrationIds = (this.rootStore.getApiIntegrations(apiName) ?? []).map((integration) => integration.id);
2652
2652
  if (integrationIds.length > 0) {
2653
- const authResult = await new Promise((resolve) => {
2653
+ const result$1 = await new Promise((resolve) => {
2654
2654
  const callbackId = addNewPromise(resolve);
2655
2655
  window.parent.postMessage({
2656
2656
  type: "authenticate-api-request",
@@ -2661,10 +2661,12 @@ var ApiManager = class {
2661
2661
  }
2662
2662
  }, "*");
2663
2663
  });
2664
- if (authResult?.errors?.length > 0) console.error("SDK API authentication returned with errors", authResult.errors);
2664
+ if (result$1?.tokens?.token && result$1?.tokens?.accessToken) this.setTokens(result$1.tokens.token, result$1.tokens.accessToken);
2665
+ if (result$1?.errors?.length) console.error("SDK API authentication returned with errors", result$1.errors);
2665
2666
  }
2666
2667
  const response = await fetch(`${agentBaseUrl}v3/execute`, {
2667
2668
  method: "POST",
2669
+ credentials: "include",
2668
2670
  headers: {
2669
2671
  "Content-Type": "application/json",
2670
2672
  [SUPERBLOCKS_AUTHORIZATION_HEADER]: `Bearer ${this.accessToken}`,
@@ -4072,4 +4074,4 @@ const useJSXContext = () => {
4072
4074
 
4073
4075
  //#endregion
4074
4076
  export { useSuperblocksProfiles as A, createManagedPropsList as B, rejectById as C, useSuperblocksContext as D, getAppMode as E, editorBridge as F, getEditStore as G, PropsCategory as H, iframeMessageHandler as I, isEmbeddedBySuperblocksFirstParty as L, generateId as M, sendNotification as N, useSuperblocksDataTags as O, colors as P, sendMessageImmediately as R, addNewPromise as S, SuperblocksContextProvider as T, Section as U, Prop as V, createPropertiesPanelDefinition as W, root_store_default as _, FixWithClarkButton as a, getContextFromTraceHeaders as b, ErrorContent as c, ErrorMessage as d, ErrorStack as f, StyledClarkIcon as g, SecondaryButton as h, getWidgetRectAnchorName as i, useSuperblocksUser as j, useSuperblocksGroups as k, ErrorDetails as l, ErrorTitle as m, useJSXContext as n, ActionsContainer as o, ErrorSummary as p, getWidgetAnchorName as r, ErrorContainer as s, makeWrappedComponent as t, ErrorIconContainer as u, startEditorSync as v, resolveById as w, api_hmr_tracker_default as x, createIframeSpan as y, isEditMode as z };
4075
- //# sourceMappingURL=jsx-wrapper-aSZhsulk.js.map
4077
+ //# sourceMappingURL=jsx-wrapper-zEtt7xG7.js.map