@superblocksteam/library 2.0.59-next.8 → 2.0.59-next.9

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 { D as api_hmr_tracker_default, _ as root_store_default, t as makeWrappedComponent } from "../jsx-wrapper-Ddb528TO.js";
1
+ import { D as api_hmr_tracker_default, _ as root_store_default, t as makeWrappedComponent } from "../jsx-wrapper-BaEUS0A1.js";
2
2
  import "../utils-AzBGeVXo.js";
3
3
  import * as ReactJsxDevRuntime from "react/jsx-dev-runtime";
4
4
  import { SOURCE_ID_ATTRIBUTE } from "@superblocksteam/library-shared";
@@ -933,6 +933,9 @@ var SuperblocksAppContext = class {
933
933
  ...context$2
934
934
  };
935
935
  }
936
+ getGlobal() {
937
+ return this.context;
938
+ }
936
939
  };
937
940
  const context$1 = new SuperblocksAppContext();
938
941
  const SuperblocksContext = createContext(context$1);
@@ -951,40 +954,25 @@ function useSuperblocksContext() {
951
954
  }
952
955
  function useSuperblocksUser() {
953
956
  const context$2 = useSuperblocksContext();
954
- return useSyncExternalStore((onStoreChange) => {
957
+ const user = useSyncExternalStore((onStoreChange) => {
955
958
  return reaction(() => context$2.user, onStoreChange);
956
- }, () => {
957
- if (!context$2.user) return;
958
- return toJS(context$2.user);
959
- }, () => {
960
- if (!context$2.user) return;
961
- return toJS(context$2.user);
962
- });
959
+ }, () => context$2.user, () => context$2.user);
960
+ return useMemo(() => toJS(user), [user]);
963
961
  }
964
962
  function useSuperblocksGroups() {
965
963
  const context$2 = useSuperblocksContext();
966
- return useSyncExternalStore((onStoreChange) => {
964
+ const groups = useSyncExternalStore((onStoreChange) => {
967
965
  return reaction(() => context$2.groups, onStoreChange);
968
- }, () => {
969
- if (!context$2.groups) return;
970
- return toJS(context$2.groups);
971
- }, () => {
972
- if (!context$2.groups) return;
973
- return toJS(context$2.groups);
974
- });
966
+ }, () => context$2.groups, () => context$2.groups);
967
+ return useMemo(() => toJS(groups), [groups]);
975
968
  }
976
969
  function useSuperblocksProfiles() {
977
970
  const context$2 = useSuperblocksContext();
971
+ const profiles = useSyncExternalStore((onStoreChange) => {
972
+ return reaction(() => context$2.profiles, onStoreChange);
973
+ }, () => context$2.profiles, () => context$2.profiles);
978
974
  return {
979
- profiles: useSyncExternalStore((onStoreChange) => {
980
- return reaction(() => context$2.profiles, onStoreChange);
981
- }, () => {
982
- if (!context$2.profiles) return;
983
- return toJS(context$2.profiles);
984
- }, () => {
985
- if (!context$2.profiles) return;
986
- return toJS(context$2.profiles);
987
- }),
975
+ profiles: useMemo(() => toJS(profiles), [profiles]),
988
976
  setProfile: useCallback((profileName) => {
989
977
  context$2.setProfile(profileName);
990
978
  }, [context$2])
@@ -3458,4 +3446,4 @@ const useJSXContext = () => {
3458
3446
 
3459
3447
  //#endregion
3460
3448
  export { SuperblocksContextProvider as A, iframeMessageHandler as B, startEditorSync as C, api_hmr_tracker_default as D, getContextFromTraceHeaders as E, useSuperblocksUser as F, isEditMode as H, sendNotification as I, colors as L, useSuperblocksContext as M, useSuperblocksGroups as N, rejectById as O, useSuperblocksProfiles as P, editorBridge as R, createPropertiesPanelDefinition as S, createIframeSpan as T, isEmbeddedBySuperblocksFirstParty as V, root_store_default as _, FixWithClarkButton as a, PropsCategory as b, ErrorContent as c, ErrorMessage as d, ErrorStack as f, StyledClarkIcon as g, SecondaryButton as h, getWidgetRectAnchorName as i, getAppMode as j, resolveById 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, createManagedPropsList as v, generateId as w, Section as x, Prop as y, getEditStore as z };
3461
- //# sourceMappingURL=jsx-wrapper-Ddb528TO.js.map
3449
+ //# sourceMappingURL=jsx-wrapper-BaEUS0A1.js.map