@superblocksteam/library 2.0.89-next.1 → 2.0.89

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 { S as api_hmr_tracker_default, _ as root_store_default, t as makeWrappedComponent } from "../jsx-wrapper-C8LEtdzp.js";
1
+ import { S as api_hmr_tracker_default, _ as root_store_default, t as makeWrappedComponent } from "../jsx-wrapper-DL2O6Y1G.js";
2
2
  import { SOURCE_ID_ATTRIBUTE } from "@superblocksteam/library-shared";
3
3
  import * as ReactJsxDevRuntime from "react/jsx-dev-runtime";
4
4
 
@@ -659,30 +659,7 @@ function parentMessageHandler(e) {
659
659
  iframeMessageHandler.dispatchEvent(event);
660
660
  }
661
661
  if (isEmbeddedBySuperblocksFirstParty() && PARENT_REF) typeof window !== "undefined" && window.addEventListener("message", parentMessageHandler);
662
- /**
663
- * @deprecated Use editorBridge instead
664
- *
665
- * IMPORTANT: For "resolve-promise" and "reject-promise" message types:
666
- * - callbackId MUST be at the top level of the message object
667
- * - payload contains the resolution value or error object
668
- * - Do NOT nest callbackId inside payload
669
- *
670
- * Example:
671
- * ```typescript
672
- * // ✅ Correct
673
- * sendMessageImmediately({
674
- * type: "resolve-promise",
675
- * callbackId: "abc123",
676
- * payload: { data: "result" }
677
- * });
678
- *
679
- * // ❌ Wrong
680
- * sendMessageImmediately({
681
- * type: "resolve-promise",
682
- * payload: { id: "abc123", data: "result" }
683
- * });
684
- * ```
685
- */
662
+ /** @deprecated Use editorBridge instead */
686
663
  function sendMessageImmediately(message, options) {
687
664
  if (!PARENT_REF) {
688
665
  console.warn("PARENT_REF is not set, message not delivered. Message: ", message);
@@ -1681,26 +1658,18 @@ function useSuperblocksGroups() {
1681
1658
  }, () => context$2.groups, () => context$2.groups);
1682
1659
  return useMemo(() => toJS(groups), [groups]);
1683
1660
  }
1684
- function useSuperblocksDataTags() {
1661
+ function useSuperblocksProfiles() {
1685
1662
  const context$2 = useSuperblocksContext();
1686
- const dataTags = useSyncExternalStore((onStoreChange) => {
1663
+ const profiles = useSyncExternalStore((onStoreChange) => {
1687
1664
  return reaction(() => context$2.profiles, onStoreChange);
1688
1665
  }, () => context$2.profiles, () => context$2.profiles);
1689
1666
  return {
1690
- dataTags: useMemo(() => toJS(dataTags), [dataTags]),
1691
- setDataTag: useCallback((dataTagKey) => {
1692
- context$2.setProfile(dataTagKey);
1667
+ profiles: useMemo(() => toJS(profiles), [profiles]),
1668
+ setProfile: useCallback((profileKey) => {
1669
+ context$2.setProfile(profileKey);
1693
1670
  }, [context$2])
1694
1671
  };
1695
1672
  }
1696
- /** @deprecated Use useSuperblocksDataTags instead */
1697
- function useSuperblocksProfiles() {
1698
- const { dataTags, setDataTag } = useSuperblocksDataTags();
1699
- return {
1700
- profiles: dataTags,
1701
- setProfile: setDataTag
1702
- };
1703
- }
1704
1673
  let appMode;
1705
1674
  function getAppMode() {
1706
1675
  if (!appMode) {
@@ -2288,7 +2257,7 @@ var ApiManager = class {
2288
2257
  });
2289
2258
  await this.awaitInitApiIfNeeded();
2290
2259
  await this.awaitBootstrapIfNeeded();
2291
- const apiName = path.match(/^\/(?:server\/)?apis\/([^/]+)\/api\.(yaml|ts)$/)?.[1];
2260
+ const apiName = path.match(/^\/apis\/([^/]+)\/api\.yaml$/)?.[1];
2292
2261
  if (!apiName) {
2293
2262
  console.error("[api-store] Invalid path:", path);
2294
2263
  throw new Error(`Invalid path: ${path}`);
@@ -3058,14 +3027,6 @@ var ComponentRegistry = class {
3058
3027
 
3059
3028
  //#endregion
3060
3029
  //#region src/lib/internal-details/lib/root-store.ts
3061
- /**
3062
- * Default user object for when no user info is available.
3063
- */
3064
- const DEFAULT_SDK_USER = {
3065
- userId: "anonymous",
3066
- groups: [],
3067
- customClaims: {}
3068
- };
3069
3030
  var RootStore = class {
3070
3031
  apis;
3071
3032
  componentRegistry;
@@ -3075,18 +3036,6 @@ var RootStore = class {
3075
3036
  applicationId;
3076
3037
  userId;
3077
3038
  windowOriginUrl;
3078
- /**
3079
- * Current user info for SDK API execution.
3080
- * Populated from JWT claims when available.
3081
- */
3082
- sdkUser = DEFAULT_SDK_USER;
3083
- /**
3084
- * Whether the SDK API feature is enabled.
3085
- * Derived from the application's templateName (see `isSdkApiTemplate()`).
3086
- * Passed to the library via the `clark.sdk-api.enabled` bootstrap flag.
3087
- * When false, the YAML-based API system is used instead.
3088
- */
3089
- sdkApiEnabled = false;
3090
3039
  editorRegisteredCallbacks = [];
3091
3040
  constructor() {
3092
3041
  this.apis = new api_store_default(this);
@@ -3096,32 +3045,9 @@ var RootStore = class {
3096
3045
  editStore: observable.shallow,
3097
3046
  setEditStore: action,
3098
3047
  applicationId: observable,
3099
- userId: observable,
3100
- sdkUser: observable.ref,
3101
- setSdkUser: action,
3102
- sdkApiEnabled: observable,
3103
- setSdkApiEnabled: action
3048
+ userId: observable
3104
3049
  });
3105
3050
  }
3106
- /**
3107
- * Updates the SDK user info from JWT claims or bootstrap data.
3108
- */
3109
- setSdkUser(user) {
3110
- this.sdkUser = {
3111
- userId: user.userId ?? this.sdkUser.userId,
3112
- email: user.email ?? this.sdkUser.email,
3113
- name: user.name ?? this.sdkUser.name,
3114
- groups: user.groups ?? this.sdkUser.groups,
3115
- customClaims: user.customClaims ?? this.sdkUser.customClaims
3116
- };
3117
- }
3118
- /**
3119
- * Sets the SDK API feature flag state.
3120
- * Called during bootstrap with the value from feature flags.
3121
- */
3122
- setSdkApiEnabled(enabled) {
3123
- this.sdkApiEnabled = enabled;
3124
- }
3125
3051
  setEditStore(editStore) {
3126
3052
  if (this.editStore) return;
3127
3053
  this.editStore = editStore;
@@ -3777,5 +3703,5 @@ const useJSXContext = () => {
3777
3703
  };
3778
3704
 
3779
3705
  //#endregion
3780
- export { useSuperblocksGroups as A, createManagedPropsList as B, addNewPromise as C, getAppMode as D, SuperblocksContextProvider as E, editorBridge as F, getEditStore as G, PropsCategory as H, iframeMessageHandler as I, isEmbeddedBySuperblocksFirstParty as L, useSuperblocksUser as M, sendNotification as N, useSuperblocksContext as O, colors as P, sendMessageImmediately as R, api_hmr_tracker_default as S, resolveById as T, Section as U, Prop as V, createPropertiesPanelDefinition as W, root_store_default as _, FixWithClarkButton as a, createIframeSpan as b, ErrorContent as c, ErrorMessage as d, ErrorStack as f, StyledClarkIcon as g, SecondaryButton as h, getWidgetRectAnchorName as i, useSuperblocksProfiles as j, useSuperblocksDataTags 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, rejectById as w, getContextFromTraceHeaders as x, generateId as y, isEditMode as z };
3781
- //# sourceMappingURL=jsx-wrapper-C8LEtdzp.js.map
3706
+ export { useSuperblocksProfiles as A, PropsCategory as B, addNewPromise as C, getAppMode as D, SuperblocksContextProvider as E, iframeMessageHandler as F, createPropertiesPanelDefinition as H, isEmbeddedBySuperblocksFirstParty as I, isEditMode as L, sendNotification as M, colors as N, useSuperblocksContext as O, editorBridge as P, createManagedPropsList as R, api_hmr_tracker_default as S, resolveById as T, getEditStore as U, Section as V, root_store_default as _, FixWithClarkButton as a, createIframeSpan 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, rejectById as w, getContextFromTraceHeaders as x, generateId as y, Prop as z };
3707
+ //# sourceMappingURL=jsx-wrapper-DL2O6Y1G.js.map