@superblocksteam/library 2.0.80 → 2.0.81-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.
- package/dist/{devtools-consolidated-zKLoNTKB.js → devtools-consolidated-CwxpaGqQ.js} +3 -57
- package/dist/devtools-consolidated-CwxpaGqQ.js.map +1 -0
- package/dist/jsx-dev-runtime/index.js +1 -1
- package/dist/{jsx-wrapper-QXikqPef.js → jsx-wrapper-DbFLItO2.js} +7 -8
- package/dist/jsx-wrapper-DbFLItO2.js.map +1 -0
- package/dist/lib/index.d.ts +8 -3
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +100 -40
- package/dist/lib/index.js.map +1 -1
- package/dist/{utils-Clb3lSiX.js → utils-BGEEeYie.js} +1 -2
- package/dist/{utils-Clb3lSiX.js.map → utils-BGEEeYie.js.map} +1 -1
- package/dist/{utils-BmTdixWt.js → utils-Co8Wr1hk.js} +1 -1
- package/package.json +4 -37
- package/dist/devtools-consolidated-zKLoNTKB.js.map +0 -1
- package/dist/jsx-wrapper-QXikqPef.js.map +0 -1
|
@@ -58,57 +58,7 @@ var DevToolsState = class {
|
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
const devToolsState = new DevToolsState();
|
|
61
|
-
|
|
62
|
-
isListening = false;
|
|
63
|
-
shortcutKeys = {
|
|
64
|
-
key: "KeyD",
|
|
65
|
-
ctrlKey: true,
|
|
66
|
-
shiftKey: true,
|
|
67
|
-
altKey: false
|
|
68
|
-
};
|
|
69
|
-
constructor() {
|
|
70
|
-
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
71
|
-
}
|
|
72
|
-
handleKeyDown(event) {
|
|
73
|
-
const { ctrlKey, shiftKey, altKey, metaKey } = event;
|
|
74
|
-
const isModifierMatch = (ctrlKey || metaKey) && shiftKey && !altKey;
|
|
75
|
-
const isKeyMatch = event.code === this.shortcutKeys.key;
|
|
76
|
-
if (isModifierMatch && isKeyMatch) {
|
|
77
|
-
event.preventDefault();
|
|
78
|
-
event.stopPropagation();
|
|
79
|
-
devToolsState.toggle();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
handleEscapeKey = (event) => {
|
|
83
|
-
if (event.key === "Escape" && devToolsState.isVisible) {
|
|
84
|
-
event.preventDefault();
|
|
85
|
-
devToolsState.hide();
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
startListening() {
|
|
89
|
-
if (this.isListening) return;
|
|
90
|
-
this.isListening = true;
|
|
91
|
-
document.addEventListener("keydown", this.handleKeyDown, true);
|
|
92
|
-
document.addEventListener("keydown", this.handleEscapeKey, true);
|
|
93
|
-
}
|
|
94
|
-
stopListening() {
|
|
95
|
-
if (!this.isListening) return;
|
|
96
|
-
this.isListening = false;
|
|
97
|
-
document.removeEventListener("keydown", this.handleKeyDown, true);
|
|
98
|
-
document.removeEventListener("keydown", this.handleEscapeKey, true);
|
|
99
|
-
}
|
|
100
|
-
updateShortcut(options) {
|
|
101
|
-
this.shortcutKeys = {
|
|
102
|
-
...this.shortcutKeys,
|
|
103
|
-
...options
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
const keyboardShortcutManager = new KeyboardShortcutManager();
|
|
108
|
-
let registeredStores = {};
|
|
109
|
-
function setRegisteredStores(stores) {
|
|
110
|
-
registeredStores = stores;
|
|
111
|
-
}
|
|
61
|
+
const registeredStores = {};
|
|
112
62
|
function getRegisteredStores() {
|
|
113
63
|
return registeredStores;
|
|
114
64
|
}
|
|
@@ -202,11 +152,7 @@ const CustomDevTools = observer(() => {
|
|
|
202
152
|
if (!devToolsState.isVisible) return null;
|
|
203
153
|
return /* @__PURE__ */ jsx(DevToolsPanelContent, {});
|
|
204
154
|
});
|
|
205
|
-
function initializeCustomDevTools() {
|
|
206
|
-
keyboardShortcutManager.startListening();
|
|
207
|
-
console.log("[internal] [CustomDevTools] Initialized - Press Ctrl+Shift+D (or Cmd+Shift+D) to open");
|
|
208
|
-
}
|
|
209
155
|
|
|
210
156
|
//#endregion
|
|
211
|
-
export { CustomDevTools
|
|
212
|
-
//# sourceMappingURL=devtools-consolidated-
|
|
157
|
+
export { CustomDevTools };
|
|
158
|
+
//# sourceMappingURL=devtools-consolidated-CwxpaGqQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devtools-consolidated-CwxpaGqQ.js","names":[],"sources":["../src/lib/internal-details/lib/devtools/serialize-store-data.tsx","../src/lib/internal-details/lib/devtools/devtools-consolidated.tsx"],"sourcesContent":["import { toJS } from \"mobx\";\n\nexport function serializeStoreData(\n stores_: Record<string, any>,\n): Record<string, any> {\n try {\n const stores = toJS(stores_);\n const seen = new Set();\n function serialize(obj: any): any {\n if (obj === null || typeof obj !== \"object\") {\n return obj;\n }\n\n if (seen.has(obj)) {\n return \"[Already Seen]\";\n }\n\n // Create new path for this branch of recursion\n seen.add(obj);\n\n if (Array.isArray(obj)) {\n return obj.map(serialize);\n }\n\n const result: any = {};\n\n for (const key of Object.keys(obj)) {\n if (typeof obj[key] === \"function\") {\n result[key] = \"[Function]\";\n }\n\n try {\n const descriptor = Object.getOwnPropertyDescriptor(obj, key);\n if (descriptor && descriptor.get) {\n try {\n result[key] = serialize(obj[key]);\n } catch {\n result[key] = \"[Getter Error]\";\n }\n } else {\n result[key] = serialize(obj[key]);\n }\n } catch {\n result[key] = \"[Access Error]\";\n }\n }\n\n // Add type information\n if (obj.constructor && obj.constructor.name !== \"Object\") {\n result.__type__ = obj.constructor.name;\n }\n\n return result;\n }\n\n return serialize(stores);\n } catch (error) {\n return {\n error: `Error serializing data: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n };\n }\n}\n","import { makeAutoObservable } from \"mobx\";\nimport { observer } from \"mobx-react-lite\";\nimport React, { useCallback, useEffect } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { JsonView } from \"react-json-view-lite\";\nimport \"react-json-view-lite/dist/index.css\";\nimport { serializeStoreData } from \"./serialize-store-data.js\";\n\n// ============================================================================\n// STATE MANAGEMENT\n// ============================================================================\n\nclass DevToolsState {\n isVisible = false;\n\n constructor() {\n makeAutoObservable(this);\n }\n\n show() {\n this.isVisible = true;\n }\n\n hide() {\n this.isVisible = false;\n }\n\n toggle() {\n this.isVisible = !this.isVisible;\n }\n}\n\nconst devToolsState = new DevToolsState();\n\n// ============================================================================\n// STORE ACCESS\n// ============================================================================\n\n// This will be populated by the registerStores function\nconst registeredStores: Record<string, any> = {};\n\nfunction getRegisteredStores() {\n return registeredStores;\n}\n\n// ============================================================================\n// DEVTOOLS PANEL COMPONENT\n// ============================================================================\n\nconst overlayStyles: React.CSSProperties = {\n position: \"fixed\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: \"rgba(0, 0, 0, 0.5)\",\n zIndex: 9999,\n};\n\nconst panelStyles: React.CSSProperties = {\n position: \"fixed\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n width: \"90vw\",\n height: \"90vh\",\n backgroundColor: \"#fff\",\n zIndex: 10000,\n display: \"flex\",\n flexDirection: \"column\",\n borderRadius: 12,\n};\n\nconst headerStyles: React.CSSProperties = {\n padding: 12,\n borderBottom: \"1px solid #ccc\",\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n};\n\nconst closeButtonStyles: React.CSSProperties = {\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n};\n\nconst contentStyles: React.CSSProperties = {\n padding: 8,\n display: \"flex\",\n flex: 1,\n overflow: \"auto\",\n flexDirection: \"column\",\n};\n\nconst DevToolsPanelContent: React.FC = observer(() => {\n const stores = getRegisteredStores();\n const storeNames = Object.keys(stores);\n\n const serializedData = serializeStoreData(stores);\n const onClose = useCallback(() => {\n devToolsState.hide();\n }, []);\n\n return createPortal(\n <>\n <div style={overlayStyles} onClick={onClose} />\n <div style={panelStyles}>\n <div style={headerStyles}>\n <h3>\n MobX DevTools ({storeNames.length} store\n {storeNames.length !== 1 ? \"s\" : \"\"})\n </h3>\n <button\n style={closeButtonStyles}\n onClick={onClose}\n title=\"Close (ESC)\"\n >\n ×\n </button>\n </div>\n {storeNames.length === 0 ? (\n <div>No stores registered yet.</div>\n ) : (\n <div style={contentStyles}>\n <JsonView\n data={serializedData}\n clickToExpandNode={true}\n shouldExpandNode={(level) => level < 2}\n />\n </div>\n )}\n </div>\n </>,\n document.body,\n );\n});\n\n// ============================================================================\n// PROVIDER COMPONENT\n// ============================================================================\n\nexport const CustomDevTools: React.FC = observer(() => {\n useEffect(() => {\n if (devToolsState.isVisible) {\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n devToolsState.hide();\n }\n };\n document.addEventListener(\"keydown\", handleEscape);\n return () => document.removeEventListener(\"keydown\", handleEscape);\n }\n }, []);\n\n if (!devToolsState.isVisible) {\n return null;\n }\n\n return <DevToolsPanelContent />;\n});\n"],"mappings":";;;;;;;;;AAEA,SAAgB,mBACd,SACqB;AACrB,KAAI;EACF,MAAM,SAAS,KAAK,QAAQ;EAC5B,MAAM,uBAAO,IAAI,KAAK;EACtB,SAAS,UAAU,KAAe;AAChC,OAAI,QAAQ,QAAQ,OAAO,QAAQ,SACjC,QAAO;AAGT,OAAI,KAAK,IAAI,IAAI,CACf,QAAO;AAIT,QAAK,IAAI,IAAI;AAEb,OAAI,MAAM,QAAQ,IAAI,CACpB,QAAO,IAAI,IAAI,UAAU;GAG3B,MAAM,SAAc,EAAE;AAEtB,QAAK,MAAM,OAAO,OAAO,KAAK,IAAI,EAAE;AAClC,QAAI,OAAO,IAAI,SAAS,WACtB,QAAO,OAAO;AAGhB,QAAI;KACF,MAAM,aAAa,OAAO,yBAAyB,KAAK,IAAI;AAC5D,SAAI,cAAc,WAAW,IAC3B,KAAI;AACF,aAAO,OAAO,UAAU,IAAI,KAAK;aAC3B;AACN,aAAO,OAAO;;SAGhB,QAAO,OAAO,UAAU,IAAI,KAAK;YAE7B;AACN,YAAO,OAAO;;;AAKl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,qBAAC;GAAI,OAAO;cACV,qBAAC;IAAG;IACc,WAAW;IAAO;IACjC,WAAW,WAAW,IAAI,MAAM;IAAG;OACjC,EACL,oBAAC;IACC,OAAO;IACP,SAAS;IACT,OAAM;cACP;KAEQ;IACL,EACL,WAAW,WAAW,IACrB,oBAAC,mBAAI,8BAA+B,GAEpC,oBAAC;GAAI,OAAO;aACV,oBAAC;IACC,MAAM;IACN,mBAAmB;IACnB,mBAAmB,UAAU,QAAQ;KACrC;IACE;GAEJ,IACL,EACH,SAAS,KACV;EACD;AAMF,MAAa,iBAA2B,eAAe;AACrD,iBAAgB;AACd,MAAI,cAAc,WAAW;GAC3B,MAAM,gBAAgB,UAAyB;AAC7C,QAAI,MAAM,QAAQ,SAChB,eAAc,MAAM;;AAGxB,YAAS,iBAAiB,WAAW,aAAa;AAClD,gBAAa,SAAS,oBAAoB,WAAW,aAAa;;IAEnE,EAAE,CAAC;AAEN,KAAI,CAAC,cAAc,UACjB,QAAO;AAGT,QAAO,oBAAC,yBAAuB;EAC/B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as api_hmr_tracker_default, _ as root_store_default, t as makeWrappedComponent } from "../jsx-wrapper-
|
|
1
|
+
import { S as api_hmr_tracker_default, _ as root_store_default, t as makeWrappedComponent } from "../jsx-wrapper-DbFLItO2.js";
|
|
2
2
|
import { SOURCE_ID_ATTRIBUTE } from "@superblocksteam/library-shared";
|
|
3
3
|
import * as ReactJsxDevRuntime from "react/jsx-dev-runtime";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as getTracer } from "./utils-
|
|
1
|
+
import { t as getTracer } from "./utils-BGEEeYie.js";
|
|
2
2
|
import { InputType, PropsCategory } from "@superblocksteam/library-shared/props";
|
|
3
3
|
import { action, entries, isComputedProp, isObservableArray, isObservableMap, isObservableObject, makeAutoObservable, makeObservable, observable, observe, reaction, toJS, values } from "mobx";
|
|
4
4
|
import { NO_SELECT_ATTRIBUTE, SELECTOR_ID_ATTRIBUTE, SOURCE_ID_ATTRIBUTE, URL_PARAMS, getQueryParams, pathStringToArray, toMobXPatch } from "@superblocksteam/library-shared";
|
|
@@ -1431,7 +1431,6 @@ const CLASS_NAMES = {
|
|
|
1431
1431
|
POPOVER_WRAPPER: "sb-popover-wrapper",
|
|
1432
1432
|
TAB: "sb-tab",
|
|
1433
1433
|
MODAL: "sb-modal",
|
|
1434
|
-
SLIDEOUT: "sb-slideout",
|
|
1435
1434
|
BORDER_BOTTOM: "sb-util-border-bottom",
|
|
1436
1435
|
BORDER_TOP: "sb-util-border-top",
|
|
1437
1436
|
NOTIFICATION: "sb-notification",
|
|
@@ -1604,8 +1603,8 @@ var SuperblocksAppContext = class {
|
|
|
1604
1603
|
get profiles() {
|
|
1605
1604
|
return this.context?.profiles;
|
|
1606
1605
|
}
|
|
1607
|
-
setProfile(
|
|
1608
|
-
const profile = this.context?.profiles?.available.find((profile$1) => profile$1.
|
|
1606
|
+
setProfile(profileKey) {
|
|
1607
|
+
const profile = this.context?.profiles?.available.find((profile$1) => profile$1.key === profileKey);
|
|
1609
1608
|
if (profile && this.context?.profiles) {
|
|
1610
1609
|
this.context.profiles.selected = profile;
|
|
1611
1610
|
if (typeof window !== "undefined" && window.parent !== window) try {
|
|
@@ -1618,7 +1617,7 @@ var SuperblocksAppContext = class {
|
|
|
1618
1617
|
} catch (error) {
|
|
1619
1618
|
console.error("[SuperblocksAppContext] Failed to sync profile change to parent window:", error);
|
|
1620
1619
|
}
|
|
1621
|
-
} else if (!profile || !this.context?.profiles) throw new Error(`Profile ${
|
|
1620
|
+
} else if (!profile || !this.context?.profiles) throw new Error(`Profile ${profileKey} not found`);
|
|
1622
1621
|
}
|
|
1623
1622
|
updateContext(context$2) {
|
|
1624
1623
|
this.context = {
|
|
@@ -1666,8 +1665,8 @@ function useSuperblocksProfiles() {
|
|
|
1666
1665
|
}, () => context$2.profiles, () => context$2.profiles);
|
|
1667
1666
|
return {
|
|
1668
1667
|
profiles: useMemo(() => toJS(profiles), [profiles]),
|
|
1669
|
-
setProfile: useCallback((
|
|
1670
|
-
context$2.setProfile(
|
|
1668
|
+
setProfile: useCallback((profileKey) => {
|
|
1669
|
+
context$2.setProfile(profileKey);
|
|
1671
1670
|
}, [context$2])
|
|
1672
1671
|
};
|
|
1673
1672
|
}
|
|
@@ -3645,4 +3644,4 @@ const useJSXContext = () => {
|
|
|
3645
3644
|
|
|
3646
3645
|
//#endregion
|
|
3647
3646
|
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 };
|
|
3648
|
-
//# sourceMappingURL=jsx-wrapper-
|
|
3647
|
+
//# sourceMappingURL=jsx-wrapper-DbFLItO2.js.map
|