@superblocksteam/library 2.0.118-next.1 → 2.0.119-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/{build-manifest-BOqMhObV.js → build-manifest-Xi8oZhWX.js} +2 -2
- package/dist/{build-manifest-BOqMhObV.js.map → build-manifest-Xi8oZhWX.js.map} +1 -1
- package/dist/{devtools-consolidated-CwxpaGqQ.js → devtools-consolidated--QF_TVsD.js} +3 -5
- package/dist/{devtools-consolidated-CwxpaGqQ.js.map → devtools-consolidated--QF_TVsD.js.map} +1 -1
- package/dist/{early-console-buffer-D4wVuyBf.js → early-console-buffer-BJWsc4E3.js} +3 -6
- package/dist/{early-console-buffer-D4wVuyBf.js.map → early-console-buffer-BJWsc4E3.js.map} +1 -1
- package/dist/jsx-dev-runtime/index.d.ts.map +1 -1
- package/dist/jsx-dev-runtime/index.js +3 -5
- package/dist/jsx-dev-runtime/index.js.map +1 -1
- package/dist/jsx-runtime/index.d.ts.map +1 -1
- package/dist/jsx-runtime/index.js +1 -2
- package/dist/jsx-runtime/index.js.map +1 -1
- package/dist/{jsx-wrapper-BLrvyiEf.js → jsx-wrapper-BaTggkUU.js} +90 -169
- package/dist/jsx-wrapper-BaTggkUU.js.map +1 -0
- package/dist/lib/index.d.ts +27 -41
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +199 -334
- package/dist/lib/index.js.map +1 -1
- package/dist/{logs-hyzhDMp7.js → logs-HOxOH_w6.js} +4 -5
- package/dist/{logs-hyzhDMp7.js.map → logs-HOxOH_w6.js.map} +1 -1
- package/dist/{lib/index.css → style.css} +96 -126
- package/dist/{utils-BGEEeYie.js → utils-BfE8-Afc.js} +19 -4
- package/dist/{utils-BGEEeYie.js.map → utils-BfE8-Afc.js.map} +1 -1
- package/package.json +8 -7
- package/dist/jsx-wrapper-BLrvyiEf.js.map +0 -1
- package/dist/lib/index.css.map +0 -1
- package/dist/utils-Co8Wr1hk.js +0 -3
package/dist/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
1
|
+
import { n as initTracerProviderWithOrigin } from "../utils-BfE8-Afc.js";
|
|
2
|
+
import { n as consoleLogAttributes, t as LibraryEarlyConsoleBuffer } from "../early-console-buffer-BJWsc4E3.js";
|
|
3
|
+
import { A as useSuperblocksProfiles, B as isEditMode, C as rejectById, D as useSuperblocksContext, E as getAppMode, F as colors$1, G as createPropertiesPanelDefinition, H as Prop, I as editorBridge, K as getEditStore, L as iframeMessageHandler, M as embedStore, N as generateId, O as useSuperblocksDataTags, P as sendNotification, R as isEmbeddedBySuperblocksFirstParty, S as addNewPromise, T as SuperblocksContextProvider, U as PropsCategory, V as createManagedPropsList, W as Section, _ as root_store_default, a as FixWithClarkButton, b as getContextFromTraceHeaders, c as ErrorContent, d as ErrorMessage$1, f as ErrorStack, g as StyledClarkIcon, h as SecondaryButton, i as getWidgetRectAnchorName, j as useSuperblocksUser, k as useSuperblocksGroups, l as ErrorDetails, m as ErrorTitle, n as useJSXContext, o as ActionsContainer, p as ErrorSummary, r as getWidgetAnchorName, s as ErrorContainer, u as ErrorIconContainer, v as startEditorSync, w as resolveById, x as tracker, y as createIframeSpan, z as sendMessageImmediately } from "../jsx-wrapper-BaTggkUU.js";
|
|
4
4
|
import { action, autorun, computed, makeAutoObservable, makeObservable, observable, reaction, when } from "mobx";
|
|
5
5
|
import { UNSAFE_DataRouterContext, generatePath, useLocation, useNavigate, useParams, useRouteError } from "react-router";
|
|
6
6
|
import { Dim, NATIVE_COMPONENT_TYPES, NO_SELECT_ATTRIBUTE, Property, Property as Property$1, SELECTOR_ID_ATTRIBUTE, SOURCE_ID_ATTRIBUTE, URL_PARAMS, generateSourceId, getBindingIdentifier } from "@superblocksteam/library-shared";
|
|
@@ -24,9 +24,8 @@ import posthog from "posthog-js";
|
|
|
24
24
|
import { Graph } from "@dagrejs/graphlib";
|
|
25
25
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
26
26
|
import ReactDOM from "react-dom";
|
|
27
|
-
import equal from "@superblocksteam/fast-deep-equal/es6";
|
|
27
|
+
import equal from "@superblocksteam/fast-deep-equal/es6/index.js";
|
|
28
28
|
import { compile, middleware, prefixer, serialize, stringify } from "stylis";
|
|
29
|
-
|
|
30
29
|
//#region src/lib/internal-details/sb-wrapper.tsx
|
|
31
30
|
/**
|
|
32
31
|
* Register a component to be used with the framework.
|
|
@@ -36,15 +35,15 @@ import { compile, middleware, prefixer, serialize, stringify } from "stylis";
|
|
|
36
35
|
*
|
|
37
36
|
* @returns A chainable object that provides methods for editor integration (addEditorTemplate and editorConfig).
|
|
38
37
|
*/
|
|
39
|
-
const registerComponentInternal = (Component
|
|
40
|
-
const type = typeof Component
|
|
41
|
-
if (!type) throw new Error(`Component must have a name or displayName property, or be a string. Received: ${Component
|
|
42
|
-
const managedProps = createManagedPropsList(propertiesDefinition
|
|
38
|
+
const registerComponentInternal = (Component, propertiesDefinition) => {
|
|
39
|
+
const type = typeof Component === "string" ? Component : Component.displayName || Component.name;
|
|
40
|
+
if (!type) throw new Error(`Component must have a name or displayName property, or be a string. Received: ${Component}`);
|
|
41
|
+
const managedProps = createManagedPropsList(propertiesDefinition);
|
|
43
42
|
const isDroppable = !!managedProps.find((p) => p.path === "children" && p.dataType === "jsx");
|
|
44
43
|
root_store_default.onEditorRegistered(() => {
|
|
45
|
-
getEditStore().propertiesPanelManager.setPropertiesDefinition(type, propertiesDefinition
|
|
44
|
+
getEditStore().propertiesPanelManager.setPropertiesDefinition(type, propertiesDefinition);
|
|
46
45
|
});
|
|
47
|
-
root_store_default.componentRegistry.addComponent(type, Component
|
|
46
|
+
root_store_default.componentRegistry.addComponent(type, Component, propertiesDefinition);
|
|
48
47
|
root_store_default.componentRegistry.addManagedProps(type, managedProps ?? []);
|
|
49
48
|
const defaultEditorConfig = {};
|
|
50
49
|
if (isDroppable) {
|
|
@@ -73,7 +72,6 @@ const registerComponentInternal = (Component$1, propertiesDefinition$1) => {
|
|
|
73
72
|
};
|
|
74
73
|
return chainableComponent;
|
|
75
74
|
};
|
|
76
|
-
|
|
77
75
|
//#endregion
|
|
78
76
|
//#region src/lib/user-facing/properties-panel/mixins/inline-styles-category.ts
|
|
79
77
|
/**
|
|
@@ -101,7 +99,6 @@ const inlineStylesCategory = (options = {}) => {
|
|
|
101
99
|
};
|
|
102
100
|
return Section.category(PropsCategory.Styles).children({ style: styleProp }).propertiesPanel({ showHeader: false });
|
|
103
101
|
};
|
|
104
|
-
|
|
105
102
|
//#endregion
|
|
106
103
|
//#region src/lib/user-facing/properties-panel/mixins/convert-rem-to-pixels.ts
|
|
107
104
|
let cachedRootFontSize = void 0;
|
|
@@ -138,7 +135,6 @@ function convertRemToPixels(value) {
|
|
|
138
135
|
const pixelValue = parseFloat(remMatch[1]) * getRootFontSize();
|
|
139
136
|
return `${Math.abs(pixelValue - Math.round(pixelValue)) < 1e-4 ? Math.round(pixelValue) : pixelValue}px`;
|
|
140
137
|
}
|
|
141
|
-
|
|
142
138
|
//#endregion
|
|
143
139
|
//#region src/lib/user-facing/properties-panel/mixins/extract-variables.ts
|
|
144
140
|
async function extractCSSVariablesFromContent(cssContent) {
|
|
@@ -210,7 +206,6 @@ async function initializeCSSVariables() {
|
|
|
210
206
|
});
|
|
211
207
|
return globalThis.__CSS_VARIABLES_PROMISE__;
|
|
212
208
|
}
|
|
213
|
-
|
|
214
209
|
//#endregion
|
|
215
210
|
//#region src/lib/user-facing/properties-panel/mixins/style-tokens-size.ts
|
|
216
211
|
let cachedSizePresets = null;
|
|
@@ -358,7 +353,6 @@ function getSizePresets() {
|
|
|
358
353
|
};
|
|
359
354
|
return cachedSizePresets;
|
|
360
355
|
}
|
|
361
|
-
|
|
362
356
|
//#endregion
|
|
363
357
|
//#region src/lib/user-facing/properties-panel/mixins/style-tokens-border.ts
|
|
364
358
|
let cachedBorderPresets = null;
|
|
@@ -446,7 +440,6 @@ function getBorderPresets() {
|
|
|
446
440
|
};
|
|
447
441
|
return cachedBorderPresets;
|
|
448
442
|
}
|
|
449
|
-
|
|
450
443
|
//#endregion
|
|
451
444
|
//#region src/lib/user-facing/properties-panel/mixins/style-tokens-color.ts
|
|
452
445
|
let cachedColorPresets = null;
|
|
@@ -512,7 +505,6 @@ function getColorPresets() {
|
|
|
512
505
|
cachedColorPresets = uniquePresets;
|
|
513
506
|
return uniquePresets;
|
|
514
507
|
}
|
|
515
|
-
|
|
516
508
|
//#endregion
|
|
517
509
|
//#region src/lib/user-facing/properties-panel/mixins/styles-category.ts
|
|
518
510
|
/**
|
|
@@ -543,17 +535,16 @@ const tailwindStylesCategory = (props) => {
|
|
|
543
535
|
prioritizedTailwindProperties
|
|
544
536
|
}) });
|
|
545
537
|
};
|
|
546
|
-
|
|
547
538
|
//#endregion
|
|
548
539
|
//#region src/lib/user-facing/components/custom/register-custom-component.tsx
|
|
549
540
|
const defaultSectionsTemplate = () => ({
|
|
550
541
|
appearance: tailwindStylesCategory(),
|
|
551
542
|
styles: inlineStylesCategory()
|
|
552
543
|
});
|
|
553
|
-
function convertToSections(propertiesDefinition
|
|
544
|
+
function convertToSections(propertiesDefinition) {
|
|
554
545
|
return {
|
|
555
|
-
content: Section.category(PropsCategory.Content).children(Object.fromEntries(Object.entries(propertiesDefinition
|
|
556
|
-
events: Section.category(PropsCategory.EventHandlers).children(Object.fromEntries(Object.entries(propertiesDefinition
|
|
546
|
+
content: Section.category(PropsCategory.Content).children(Object.fromEntries(Object.entries(propertiesDefinition).filter(([, prop]) => prop.type !== "eventHandler"))),
|
|
547
|
+
events: Section.category(PropsCategory.EventHandlers).children(Object.fromEntries(Object.entries(propertiesDefinition).filter(([, prop]) => prop.type === "eventHandler")))
|
|
557
548
|
};
|
|
558
549
|
}
|
|
559
550
|
function mergeSections(sections, defaultSections) {
|
|
@@ -603,12 +594,11 @@ function mergeSections(sections, defaultSections) {
|
|
|
603
594
|
* });
|
|
604
595
|
* ```
|
|
605
596
|
*/
|
|
606
|
-
function registerComponent(component, propertiesDefinition
|
|
597
|
+
function registerComponent(component, propertiesDefinition) {
|
|
607
598
|
const defaultSections = defaultSectionsTemplate();
|
|
608
|
-
if (!propertiesDefinition
|
|
609
|
-
return registerComponentInternal(component, Object.values(propertiesDefinition
|
|
599
|
+
if (!propertiesDefinition) return registerComponentInternal(component, defaultSections);
|
|
600
|
+
return registerComponentInternal(component, Object.values(propertiesDefinition).every((prop) => prop instanceof Section) ? mergeSections(propertiesDefinition, defaultSections) : mergeSections(convertToSections(propertiesDefinition), defaultSections));
|
|
610
601
|
}
|
|
611
|
-
|
|
612
602
|
//#endregion
|
|
613
603
|
//#region src/lib/user-facing/components/html/html-property-panels.ts
|
|
614
604
|
const TYPOGRAPHY_PRIORITIZED_PROPERTIES = [
|
|
@@ -656,7 +646,6 @@ const htmlTagSectionsTemplateForContainers = () => {
|
|
|
656
646
|
prioritizedTailwindProperties: CONTAINER_PRIORITIZED_PROPERTIES
|
|
657
647
|
});
|
|
658
648
|
};
|
|
659
|
-
|
|
660
649
|
//#endregion
|
|
661
650
|
//#region src/lib/user-facing/components/html/register-html-elements.ts
|
|
662
651
|
/**
|
|
@@ -778,7 +767,6 @@ function registerHtmlElements() {
|
|
|
778
767
|
registerComponent("link", htmlTagSectionsTemplate({ hasChildren: false }));
|
|
779
768
|
registerComponent("meta", htmlTagSectionsTemplate({ hasChildren: false }));
|
|
780
769
|
}
|
|
781
|
-
|
|
782
770
|
//#endregion
|
|
783
771
|
//#region src/lib/internal-details/lib/jwt-utils.ts
|
|
784
772
|
/**
|
|
@@ -874,7 +862,6 @@ function extractSdkUserFromJwt(token) {
|
|
|
874
862
|
if (!claims) return null;
|
|
875
863
|
return extractSdkUserFromClaims(claims);
|
|
876
864
|
}
|
|
877
|
-
|
|
878
865
|
//#endregion
|
|
879
866
|
//#region src/lib/internal-details/handle-bootstrap-response.ts
|
|
880
867
|
const handleBootstrapResponse = (event) => {
|
|
@@ -904,9 +891,9 @@ const handleBootstrapResponse = (event) => {
|
|
|
904
891
|
if (featureFlags["ui.disable-design-mode"]) root_store_default.editStore.setDesignModeDisabled(true);
|
|
905
892
|
}
|
|
906
893
|
root_store_default.windowOriginUrl = event.data.payload.logContext?.superblocks_window_origin_url;
|
|
907
|
-
if (root_store_default.windowOriginUrl) import("../utils-
|
|
908
|
-
initTracerProviderWithOrigin
|
|
909
|
-
import("../logs-
|
|
894
|
+
if (root_store_default.windowOriginUrl) import("../utils-BfE8-Afc.js").then((n) => n.r).then(({ initTracerProviderWithOrigin }) => {
|
|
895
|
+
initTracerProviderWithOrigin(root_store_default.windowOriginUrl);
|
|
896
|
+
import("../logs-HOxOH_w6.js").then(({ initLibraryLoggerProvider }) => {
|
|
910
897
|
initLibraryLoggerProvider({
|
|
911
898
|
windowOriginUrl: root_store_default.windowOriginUrl,
|
|
912
899
|
appId: event.data.payload.appId,
|
|
@@ -919,7 +906,6 @@ const handleBootstrapResponse = (event) => {
|
|
|
919
906
|
});
|
|
920
907
|
});
|
|
921
908
|
};
|
|
922
|
-
|
|
923
909
|
//#endregion
|
|
924
910
|
//#region src/lib/internal-details/internal-components/spinner.tsx
|
|
925
911
|
const Spinner = styled.span`
|
|
@@ -954,7 +940,6 @@ const FullPageSpinner = () => {
|
|
|
954
940
|
children: /* @__PURE__ */ jsx(Spinner, {})
|
|
955
941
|
});
|
|
956
942
|
};
|
|
957
|
-
|
|
958
943
|
//#endregion
|
|
959
944
|
//#region src/lib/internal-details/lib/features/injected-features.ts
|
|
960
945
|
function useGetCurrentUserQuery() {
|
|
@@ -965,7 +950,6 @@ function useGetCurrentUserQuery() {
|
|
|
965
950
|
};
|
|
966
951
|
}, []);
|
|
967
952
|
}
|
|
968
|
-
|
|
969
953
|
//#endregion
|
|
970
954
|
//#region src/lib/internal-details/lib/registry-loader.ts
|
|
971
955
|
/**
|
|
@@ -983,7 +967,6 @@ async function loadRegistryModule() {
|
|
|
983
967
|
registryUrl.href
|
|
984
968
|
)).default;
|
|
985
969
|
}
|
|
986
|
-
|
|
987
970
|
//#endregion
|
|
988
971
|
//#region src/lib/internal-details/lib/utils/zod-to-typescript.ts
|
|
989
972
|
/**
|
|
@@ -1066,7 +1049,6 @@ function convertZodSchema(schema) {
|
|
|
1066
1049
|
jsonSchema
|
|
1067
1050
|
};
|
|
1068
1051
|
}
|
|
1069
|
-
|
|
1070
1052
|
//#endregion
|
|
1071
1053
|
//#region src/lib/internal-details/lib/sdk-api-registry.ts
|
|
1072
1054
|
/**
|
|
@@ -1151,7 +1133,6 @@ function updateSdkApiSourceCode(name, sourceCode) {
|
|
|
1151
1133
|
function clearSdkApiRegistry() {
|
|
1152
1134
|
registeredApis.clear();
|
|
1153
1135
|
}
|
|
1154
|
-
|
|
1155
1136
|
//#endregion
|
|
1156
1137
|
//#region src/lib/internal-details/lib/sdk-api-discovery.ts
|
|
1157
1138
|
/**
|
|
@@ -1282,7 +1263,6 @@ if (import.meta.hot) import.meta.hot.accept("/server/apis/index.ts", () => {
|
|
|
1282
1263
|
root_store_default.clearApiIntegrations();
|
|
1283
1264
|
discoverAndRegisterSdkApis();
|
|
1284
1265
|
});
|
|
1285
|
-
|
|
1286
1266
|
//#endregion
|
|
1287
1267
|
//#region src/lib/internal-details/query-cache.ts
|
|
1288
1268
|
/**
|
|
@@ -1339,7 +1319,6 @@ var QueryClient = class {
|
|
|
1339
1319
|
} };
|
|
1340
1320
|
};
|
|
1341
1321
|
const queryClient = new QueryClient();
|
|
1342
|
-
|
|
1343
1322
|
//#endregion
|
|
1344
1323
|
//#region src/lib/internal-details/execute-api.ts
|
|
1345
1324
|
/**
|
|
@@ -1401,9 +1380,9 @@ async function executeApi(apiName, inputs, options) {
|
|
|
1401
1380
|
}
|
|
1402
1381
|
});
|
|
1403
1382
|
try {
|
|
1404
|
-
const result
|
|
1405
|
-
const durationMs = result
|
|
1406
|
-
if (result
|
|
1383
|
+
const result = await root_store_default.apis.executeSdkApiV3(apiName, inputRecord, { signal: options?.signal });
|
|
1384
|
+
const durationMs = result?.fetchStartMs ? Date.now() - result.fetchStartMs : Date.now() - startTime;
|
|
1385
|
+
if (result == null) {
|
|
1407
1386
|
const nullError = {
|
|
1408
1387
|
code: "NO_RESPONSE",
|
|
1409
1388
|
message: `API "${apiName}" returned no response`
|
|
@@ -1419,41 +1398,41 @@ async function executeApi(apiName, inputs, options) {
|
|
|
1419
1398
|
});
|
|
1420
1399
|
throw new Error(nullError.message);
|
|
1421
1400
|
}
|
|
1422
|
-
if (result
|
|
1401
|
+
if (result.error?.code === "ABORTED") {
|
|
1423
1402
|
if (editMode) sendMessageImmediately({
|
|
1424
1403
|
type: "sdk-api-execution-failed",
|
|
1425
1404
|
payload: {
|
|
1426
1405
|
executionId,
|
|
1427
1406
|
apiName,
|
|
1428
|
-
error: result
|
|
1407
|
+
error: result.error,
|
|
1429
1408
|
durationMs,
|
|
1430
|
-
diagnostics: result
|
|
1431
|
-
orchestratorStartMs: result
|
|
1432
|
-
orchestratorDurationMs: result
|
|
1433
|
-
fetchStartMs: result
|
|
1434
|
-
timingBreakdown: result
|
|
1409
|
+
diagnostics: result.diagnostics,
|
|
1410
|
+
orchestratorStartMs: result.executionStartMs,
|
|
1411
|
+
orchestratorDurationMs: result.executionDurationMs,
|
|
1412
|
+
fetchStartMs: result.fetchStartMs,
|
|
1413
|
+
timingBreakdown: result.timingBreakdown
|
|
1435
1414
|
}
|
|
1436
1415
|
});
|
|
1437
1416
|
throw new DOMException(`API "${apiName}" execution was aborted`, "AbortError");
|
|
1438
1417
|
}
|
|
1439
|
-
if (result
|
|
1418
|
+
if (result.success) {
|
|
1440
1419
|
if (editMode) sendMessageImmediately({
|
|
1441
1420
|
type: "sdk-api-execution-completed",
|
|
1442
1421
|
payload: {
|
|
1443
1422
|
executionId,
|
|
1444
1423
|
apiName,
|
|
1445
|
-
output: result
|
|
1424
|
+
output: result.output,
|
|
1446
1425
|
durationMs,
|
|
1447
|
-
diagnostics: result
|
|
1448
|
-
orchestratorStartMs: result
|
|
1449
|
-
orchestratorDurationMs: result
|
|
1450
|
-
fetchStartMs: result
|
|
1451
|
-
timingBreakdown: result
|
|
1426
|
+
diagnostics: result.diagnostics,
|
|
1427
|
+
orchestratorStartMs: result.executionStartMs,
|
|
1428
|
+
orchestratorDurationMs: result.executionDurationMs,
|
|
1429
|
+
fetchStartMs: result.fetchStartMs,
|
|
1430
|
+
timingBreakdown: result.timingBreakdown
|
|
1452
1431
|
}
|
|
1453
1432
|
});
|
|
1454
|
-
return result
|
|
1433
|
+
return result.output;
|
|
1455
1434
|
}
|
|
1456
|
-
const error = result
|
|
1435
|
+
const error = result.error ?? {
|
|
1457
1436
|
code: "UNKNOWN",
|
|
1458
1437
|
message: "API execution failed"
|
|
1459
1438
|
};
|
|
@@ -1464,11 +1443,11 @@ async function executeApi(apiName, inputs, options) {
|
|
|
1464
1443
|
apiName,
|
|
1465
1444
|
error,
|
|
1466
1445
|
durationMs,
|
|
1467
|
-
diagnostics: result
|
|
1468
|
-
orchestratorStartMs: result
|
|
1469
|
-
orchestratorDurationMs: result
|
|
1470
|
-
fetchStartMs: result
|
|
1471
|
-
timingBreakdown: result
|
|
1446
|
+
diagnostics: result.diagnostics,
|
|
1447
|
+
orchestratorStartMs: result.executionStartMs,
|
|
1448
|
+
orchestratorDurationMs: result.executionDurationMs,
|
|
1449
|
+
fetchStartMs: result.fetchStartMs,
|
|
1450
|
+
timingBreakdown: result.timingBreakdown
|
|
1472
1451
|
}
|
|
1473
1452
|
});
|
|
1474
1453
|
throw error;
|
|
@@ -1513,7 +1492,6 @@ async function executeApi(apiName, inputs, options) {
|
|
|
1513
1492
|
function createTypedExecuteApi() {
|
|
1514
1493
|
return executeApi;
|
|
1515
1494
|
}
|
|
1516
|
-
|
|
1517
1495
|
//#endregion
|
|
1518
1496
|
//#region src/lib/internal-details/use-api-data.ts
|
|
1519
1497
|
/**
|
|
@@ -1537,8 +1515,8 @@ const EXEC_ID_PREFIX = "sb-exec-id:";
|
|
|
1537
1515
|
function getOrCreateExecId(cacheKey) {
|
|
1538
1516
|
const key = EXEC_ID_PREFIX + cacheKey;
|
|
1539
1517
|
try {
|
|
1540
|
-
const id
|
|
1541
|
-
if (id
|
|
1518
|
+
const id = sessionStorage.getItem(key);
|
|
1519
|
+
if (id) return id;
|
|
1542
1520
|
} catch {}
|
|
1543
1521
|
const id = generateId();
|
|
1544
1522
|
try {
|
|
@@ -1598,7 +1576,7 @@ function useApiData(apiName, inputs, options = {}) {
|
|
|
1598
1576
|
keepPreviousData: true,
|
|
1599
1577
|
fallbackData: options.placeholderData
|
|
1600
1578
|
};
|
|
1601
|
-
const { data, error, isValidating, isLoading, mutate
|
|
1579
|
+
const { data, error, isValidating, isLoading, mutate } = useSWR(enabled ? cacheKey : null, fetcher, swrConfig);
|
|
1602
1580
|
const effectiveError = error instanceof DOMException && error.name === "AbortError" ? void 0 : error;
|
|
1603
1581
|
const hasData = data !== void 0;
|
|
1604
1582
|
const hasError = effectiveError !== void 0;
|
|
@@ -1610,8 +1588,8 @@ function useApiData(apiName, inputs, options = {}) {
|
|
|
1610
1588
|
controllerRef.current?.abort();
|
|
1611
1589
|
controllerRef.current = null;
|
|
1612
1590
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1613
|
-
return await mutate
|
|
1614
|
-
}, [mutate
|
|
1591
|
+
return await mutate();
|
|
1592
|
+
}, [mutate]);
|
|
1615
1593
|
const cancel = useCallback(() => {
|
|
1616
1594
|
controllerRef.current?.abort();
|
|
1617
1595
|
controllerRef.current = null;
|
|
@@ -1643,7 +1621,6 @@ function useApiData(apiName, inputs, options = {}) {
|
|
|
1643
1621
|
function useTypedApiData() {
|
|
1644
1622
|
return useApiData;
|
|
1645
1623
|
}
|
|
1646
|
-
|
|
1647
1624
|
//#endregion
|
|
1648
1625
|
//#region src/lib/internal-details/use-api.ts
|
|
1649
1626
|
/**
|
|
@@ -1671,9 +1648,9 @@ function useTypedApiData() {
|
|
|
1671
1648
|
const getApiPath = (name) => {
|
|
1672
1649
|
if (root_store_default.sdkApiEnabled) {
|
|
1673
1650
|
if (name.startsWith("/")) return name;
|
|
1674
|
-
const registered
|
|
1675
|
-
if (!registered
|
|
1676
|
-
return `/${registered
|
|
1651
|
+
const registered = root_store_default.getApiEntryPoint(name);
|
|
1652
|
+
if (!registered) throw new Error(`No entryPoint registered for API "${name}". Was it discovered?`);
|
|
1653
|
+
return `/${registered}`;
|
|
1677
1654
|
}
|
|
1678
1655
|
let apiPath = name;
|
|
1679
1656
|
if (!apiPath.startsWith("/apis")) apiPath = `/apis/${name}/api.yaml`;
|
|
@@ -1922,7 +1899,6 @@ function useApi(apiName, inputs) {
|
|
|
1922
1899
|
function useTypedApi() {
|
|
1923
1900
|
return useApi;
|
|
1924
1901
|
}
|
|
1925
|
-
|
|
1926
1902
|
//#endregion
|
|
1927
1903
|
//#region src/lib/internal-details/use-embed-message-listeners.ts
|
|
1928
1904
|
/**
|
|
@@ -1965,7 +1941,6 @@ function useEmbedMessageListeners(navigate, superblocksContext) {
|
|
|
1965
1941
|
};
|
|
1966
1942
|
}, [navigate, superblocksContext]);
|
|
1967
1943
|
}
|
|
1968
|
-
|
|
1969
1944
|
//#endregion
|
|
1970
1945
|
//#region src/lib/internal-details/utils/link-modifiers-interceptor.ts
|
|
1971
1946
|
/**
|
|
@@ -2151,7 +2126,6 @@ function linkModifierInterceptor({ isEmbedMode = false, appMode } = {}) {
|
|
|
2151
2126
|
hoverCleanup?.();
|
|
2152
2127
|
};
|
|
2153
2128
|
}
|
|
2154
|
-
|
|
2155
2129
|
//#endregion
|
|
2156
2130
|
//#region src/edit-mode/build-error-notification.tsx
|
|
2157
2131
|
const ModalOverlay = styled(Dialog.Overlay)`
|
|
@@ -2280,7 +2254,7 @@ const ErrorText = styled.span`
|
|
|
2280
2254
|
const ErrorIcon = styled.svg`
|
|
2281
2255
|
flex-shrink: 0;
|
|
2282
2256
|
`;
|
|
2283
|
-
const BuildErrorNotification = observer(function BuildErrorNotification
|
|
2257
|
+
const BuildErrorNotification = observer(function BuildErrorNotification() {
|
|
2284
2258
|
const [currentError, setCurrentError] = useState(null);
|
|
2285
2259
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
2286
2260
|
const lastBuildError = useRef(null);
|
|
@@ -2394,7 +2368,6 @@ function BuildErrorModal({ isOpen, error, onClose }) {
|
|
|
2394
2368
|
})] })
|
|
2395
2369
|
});
|
|
2396
2370
|
}
|
|
2397
|
-
|
|
2398
2371
|
//#endregion
|
|
2399
2372
|
//#region src/edit-mode/create-component.ts
|
|
2400
2373
|
function getParentInfo(parent) {
|
|
@@ -2429,26 +2402,26 @@ async function createComponent({ componentType, parent, scopeName, basePropertie
|
|
|
2429
2402
|
const parentInfo = getParentInfo(parent);
|
|
2430
2403
|
const editorTemplates = root_store_default.componentRegistry.getEditorTemplates(componentType);
|
|
2431
2404
|
if (editorTemplates && editorTemplates.length > 1) throw new Error(`Multiple editor templates are not supported yet. Found ${editorTemplates.length} for component type: ${componentType}.`);
|
|
2432
|
-
const context
|
|
2405
|
+
const context = {
|
|
2433
2406
|
parentInfo,
|
|
2434
2407
|
defaultTagNames: root_store_default.componentRegistry.defaultTagNames,
|
|
2435
2408
|
selfTagName: componentType,
|
|
2436
2409
|
generateUniqueName: (prefix) => `${prefix}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`
|
|
2437
2410
|
};
|
|
2438
|
-
const editorTemplateCreateRequest = editorTemplates?.[0]?.create?.(context
|
|
2411
|
+
const editorTemplateCreateRequest = editorTemplates?.[0]?.create?.(context);
|
|
2439
2412
|
const primaryEditorTemplateCreateRequest = Array.isArray(editorTemplateCreateRequest) ? editorTemplateCreateRequest[0] : editorTemplateCreateRequest;
|
|
2440
2413
|
if (editorTemplateCreateRequest && primaryEditorTemplateCreateRequest?.type !== componentType) throw new Error(`When defining a ${Array.isArray(editorTemplateCreateRequest) ? "multiple" : "single"} component to be created on an EditorTemplate, the type must match with the component being created. got: ${primaryEditorTemplateCreateRequest?.type} when it should have been ${componentType}`);
|
|
2441
2414
|
const editorTemplateCreateRequests = Array.isArray(editorTemplateCreateRequest) ? editorTemplateCreateRequest : [editorTemplateCreateRequest];
|
|
2442
2415
|
const editStore = getEditStore();
|
|
2443
|
-
function editorTemplateCreateRequestToInternalCreateRequest({ editorTemplateCreateRequest
|
|
2444
|
-
const type = editorTemplateCreateRequest
|
|
2445
|
-
const { properties: propertiesFromType, children } = getComponentBaseProperties(type, parentInfo, editorTemplateCreateRequest
|
|
2416
|
+
function editorTemplateCreateRequestToInternalCreateRequest({ editorTemplateCreateRequest, baseProperties }) {
|
|
2417
|
+
const type = editorTemplateCreateRequest?.type ?? componentType;
|
|
2418
|
+
const { properties: propertiesFromType, children } = getComponentBaseProperties(type, parentInfo, editorTemplateCreateRequest);
|
|
2446
2419
|
const properties = {
|
|
2447
2420
|
...propertiesFromType,
|
|
2448
|
-
...baseProperties
|
|
2421
|
+
...baseProperties
|
|
2449
2422
|
};
|
|
2450
2423
|
return {
|
|
2451
|
-
parentElement: getCreateAtParentElement(parent, editorTemplateCreateRequest
|
|
2424
|
+
parentElement: getCreateAtParentElement(parent, editorTemplateCreateRequest?.createAt),
|
|
2452
2425
|
tagName: type,
|
|
2453
2426
|
properties,
|
|
2454
2427
|
children,
|
|
@@ -2456,15 +2429,15 @@ async function createComponent({ componentType, parent, scopeName, basePropertie
|
|
|
2456
2429
|
id: editStore.operationManager.generateSourceId()
|
|
2457
2430
|
};
|
|
2458
2431
|
}
|
|
2459
|
-
const createRequests = editorTemplateCreateRequests.map((editorTemplateCreateRequest
|
|
2460
|
-
editorTemplateCreateRequest
|
|
2432
|
+
const createRequests = editorTemplateCreateRequests.map((editorTemplateCreateRequest, index) => editorTemplateCreateRequestToInternalCreateRequest({
|
|
2433
|
+
editorTemplateCreateRequest,
|
|
2461
2434
|
baseProperties: index === 0 ? baseProperties : {}
|
|
2462
2435
|
}));
|
|
2463
2436
|
const hasOtherComponentsUpdates = otherComponentsUpdates && Object.keys(otherComponentsUpdates).length > 0;
|
|
2464
2437
|
const hasMultipleCreateComponents = editorTemplateCreateRequests.length > 1 && !skipSecondaryComponentsCreation;
|
|
2465
2438
|
if (hasOtherComponentsUpdates || hasMultipleCreateComponents) {
|
|
2466
|
-
const performOtherComponentsUpdates = (otherComponentsUpdates
|
|
2467
|
-
Object.entries(otherComponentsUpdates
|
|
2439
|
+
const performOtherComponentsUpdates = (otherComponentsUpdates) => {
|
|
2440
|
+
Object.entries(otherComponentsUpdates).forEach(([sourceId, updates]) => {
|
|
2468
2441
|
editStore.operationManager.setWidgetProperties({
|
|
2469
2442
|
sourceId,
|
|
2470
2443
|
properties: updates
|
|
@@ -2485,7 +2458,6 @@ async function createComponent({ componentType, parent, scopeName, basePropertie
|
|
|
2485
2458
|
*/
|
|
2486
2459
|
return createRequests.at(-1).id;
|
|
2487
2460
|
}
|
|
2488
|
-
|
|
2489
2461
|
//#endregion
|
|
2490
2462
|
//#region src/edit-mode/features/ai-store.ts
|
|
2491
2463
|
var AiManager = class {
|
|
@@ -2556,10 +2528,13 @@ var AiManager = class {
|
|
|
2556
2528
|
setAiContextMode(mode, components) {
|
|
2557
2529
|
this._contextMode = mode;
|
|
2558
2530
|
this._targetedComponents = components?.map((component) => component.id) ?? [];
|
|
2559
|
-
if (this._targetedComponents.length > 0)
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2531
|
+
if (this._targetedComponents.length > 0) {
|
|
2532
|
+
const selectorIds = components?.flatMap((component) => {
|
|
2533
|
+
if (component.selectorId) return [component.selectorId];
|
|
2534
|
+
return Array.from(this.runtimeTrackingStore.getSelectorIdsForSourceId(component.id));
|
|
2535
|
+
}) ?? [];
|
|
2536
|
+
this._targetedSelectors = selectorIds;
|
|
2537
|
+
}
|
|
2563
2538
|
}
|
|
2564
2539
|
addTargetedSelector(selectorId) {
|
|
2565
2540
|
this.removeAllSharedSelectors(selectorId);
|
|
@@ -2612,7 +2587,6 @@ var AiManager = class {
|
|
|
2612
2587
|
this._targetedSelectors = this._targetedSelectors.filter((selectorId) => !allSelectorIds.has(selectorId));
|
|
2613
2588
|
}
|
|
2614
2589
|
};
|
|
2615
|
-
|
|
2616
2590
|
//#endregion
|
|
2617
2591
|
//#region src/edit-mode/features/connection-manager.ts
|
|
2618
2592
|
var ConnectionManager = class {
|
|
@@ -2630,8 +2604,6 @@ var ConnectionManager = class {
|
|
|
2630
2604
|
this.connectionStatus = "disconnected";
|
|
2631
2605
|
}
|
|
2632
2606
|
};
|
|
2633
|
-
var connection_manager_default = ConnectionManager;
|
|
2634
|
-
|
|
2635
2607
|
//#endregion
|
|
2636
2608
|
//#region src/edit-mode/async-socket.ts
|
|
2637
2609
|
var AsyncSocket = class {
|
|
@@ -2654,7 +2626,6 @@ var AsyncSocket = class {
|
|
|
2654
2626
|
return !!this.socket;
|
|
2655
2627
|
}
|
|
2656
2628
|
};
|
|
2657
|
-
|
|
2658
2629
|
//#endregion
|
|
2659
2630
|
//#region src/edit-mode/source-update-api.ts
|
|
2660
2631
|
const PING_INTERVAL_MS = 15e3;
|
|
@@ -2922,7 +2893,6 @@ async function connectSocket(serverUrl, { peerId, userId, applicationId, authori
|
|
|
2922
2893
|
throw error;
|
|
2923
2894
|
}
|
|
2924
2895
|
}
|
|
2925
|
-
|
|
2926
2896
|
//#endregion
|
|
2927
2897
|
//#region src/edit-mode/features/operation-store.ts
|
|
2928
2898
|
var OperationManager = class {
|
|
@@ -3014,8 +2984,8 @@ var OperationManager = class {
|
|
|
3014
2984
|
payload
|
|
3015
2985
|
});
|
|
3016
2986
|
}
|
|
3017
|
-
@action dropComponent(action
|
|
3018
|
-
const { from, to, propsToChange } = action
|
|
2987
|
+
@action dropComponent(action) {
|
|
2988
|
+
const { from, to, propsToChange } = action;
|
|
3019
2989
|
const payload = {
|
|
3020
2990
|
from,
|
|
3021
2991
|
to,
|
|
@@ -3038,10 +3008,10 @@ var OperationManager = class {
|
|
|
3038
3008
|
console.error("No transaction id in edit operation", operation);
|
|
3039
3009
|
return;
|
|
3040
3010
|
}
|
|
3041
|
-
const addOperation = (operation
|
|
3042
|
-
switch (operation
|
|
3011
|
+
const addOperation = (operation, batchTransactionId) => {
|
|
3012
|
+
switch (operation.type) {
|
|
3043
3013
|
case "editor:createComponent": {
|
|
3044
|
-
const { type, payload } = operation
|
|
3014
|
+
const { type, payload } = operation;
|
|
3045
3015
|
this.addPendingTransaction({
|
|
3046
3016
|
type,
|
|
3047
3017
|
id: batchTransactionId ?? payload.transaction.id,
|
|
@@ -3050,7 +3020,7 @@ var OperationManager = class {
|
|
|
3050
3020
|
break;
|
|
3051
3021
|
}
|
|
3052
3022
|
case "editor:deleteComponents": {
|
|
3053
|
-
const { type, payload } = operation
|
|
3023
|
+
const { type, payload } = operation;
|
|
3054
3024
|
this.addPendingTransaction({
|
|
3055
3025
|
type,
|
|
3056
3026
|
id: batchTransactionId ?? payload.transaction.id,
|
|
@@ -3059,7 +3029,7 @@ var OperationManager = class {
|
|
|
3059
3029
|
break;
|
|
3060
3030
|
}
|
|
3061
3031
|
case "editor:moveComponent": {
|
|
3062
|
-
const { type, payload } = operation
|
|
3032
|
+
const { type, payload } = operation;
|
|
3063
3033
|
this.addPendingTransaction({
|
|
3064
3034
|
type,
|
|
3065
3035
|
id: batchTransactionId ?? payload.transaction.id,
|
|
@@ -3068,7 +3038,7 @@ var OperationManager = class {
|
|
|
3068
3038
|
break;
|
|
3069
3039
|
}
|
|
3070
3040
|
case "editor:setProperties": {
|
|
3071
|
-
const { type, payload } = operation
|
|
3041
|
+
const { type, payload } = operation;
|
|
3072
3042
|
this.addPendingTransaction({
|
|
3073
3043
|
type,
|
|
3074
3044
|
id: payload.transaction.id,
|
|
@@ -3077,7 +3047,7 @@ var OperationManager = class {
|
|
|
3077
3047
|
break;
|
|
3078
3048
|
}
|
|
3079
3049
|
case "editor:deleteProperties": {
|
|
3080
|
-
const { payload } = operation
|
|
3050
|
+
const { payload } = operation;
|
|
3081
3051
|
const asSetProperties = {
|
|
3082
3052
|
element: { source: { id: payload.element.source.id } },
|
|
3083
3053
|
properties: Object.fromEntries(payload.properties.map((p) => [p, {
|
|
@@ -3093,7 +3063,7 @@ var OperationManager = class {
|
|
|
3093
3063
|
});
|
|
3094
3064
|
break;
|
|
3095
3065
|
}
|
|
3096
|
-
default: console.error("Unknown edit operation", operation
|
|
3066
|
+
default: console.error("Unknown edit operation", operation);
|
|
3097
3067
|
}
|
|
3098
3068
|
};
|
|
3099
3069
|
if (operation.type === "editor:batchUpdate") {
|
|
@@ -3140,8 +3110,6 @@ var OperationManager = class {
|
|
|
3140
3110
|
return generateSourceId();
|
|
3141
3111
|
}
|
|
3142
3112
|
};
|
|
3143
|
-
var operation_store_default = OperationManager;
|
|
3144
|
-
|
|
3145
3113
|
//#endregion
|
|
3146
3114
|
//#region src/edit-mode/features/properties-panel-manager.ts
|
|
3147
3115
|
var PropertiesPanelManager = class {
|
|
@@ -3161,9 +3129,9 @@ var PropertiesPanelManager = class {
|
|
|
3161
3129
|
if (!component?.type) return { sections: [] };
|
|
3162
3130
|
const componentType = component.displayName || component.type;
|
|
3163
3131
|
if (!componentType) return { sections: [] };
|
|
3164
|
-
const propertiesDefinition
|
|
3165
|
-
if (!propertiesDefinition
|
|
3166
|
-
return createPropertiesPanelDefinition(propertiesDefinition
|
|
3132
|
+
const propertiesDefinition = this.propertiesDefinitions.get(componentType);
|
|
3133
|
+
if (!propertiesDefinition) return { sections: [] };
|
|
3134
|
+
return createPropertiesPanelDefinition(propertiesDefinition, props ?? {});
|
|
3167
3135
|
}
|
|
3168
3136
|
trackPropertiesPanel(selectorId) {
|
|
3169
3137
|
if (this.propertiesPanelTrackerDisposer) this.propertiesPanelTrackerDisposer();
|
|
@@ -3181,8 +3149,8 @@ var PropertiesPanelManager = class {
|
|
|
3181
3149
|
getPropertiesDefinition(type) {
|
|
3182
3150
|
return this.propertiesDefinitions.get(type);
|
|
3183
3151
|
}
|
|
3184
|
-
setPropertiesDefinition(widgetType, propertiesDefinition
|
|
3185
|
-
this.propertiesDefinitions.set(widgetType, propertiesDefinition
|
|
3152
|
+
setPropertiesDefinition(widgetType, propertiesDefinition) {
|
|
3153
|
+
this.propertiesDefinitions.set(widgetType, propertiesDefinition);
|
|
3186
3154
|
}
|
|
3187
3155
|
updatePropertiesDefinitionForType(type) {
|
|
3188
3156
|
console.log("[internal] [NOOP] updatePropertiesDefinitionForType: ", type);
|
|
@@ -3204,8 +3172,6 @@ var PropertiesPanelManager = class {
|
|
|
3204
3172
|
});
|
|
3205
3173
|
}
|
|
3206
3174
|
};
|
|
3207
|
-
var properties_panel_manager_default = PropertiesPanelManager;
|
|
3208
|
-
|
|
3209
3175
|
//#endregion
|
|
3210
3176
|
//#region src/edit-mode/runtime-graph/observable-graph.ts
|
|
3211
3177
|
var ObservableGraph = class extends Graph {
|
|
@@ -3241,7 +3207,6 @@ var ObservableGraph = class extends Graph {
|
|
|
3241
3207
|
});
|
|
3242
3208
|
}
|
|
3243
3209
|
};
|
|
3244
|
-
|
|
3245
3210
|
//#endregion
|
|
3246
3211
|
//#region src/edit-mode/runtime-graph/runtime-component-node.ts
|
|
3247
3212
|
var RuntimeComponentNode = class {
|
|
@@ -3289,7 +3254,6 @@ function getTypeString(type) {
|
|
|
3289
3254
|
if (typeof type === "string") return type;
|
|
3290
3255
|
return type.displayName || type.name || "Component";
|
|
3291
3256
|
}
|
|
3292
|
-
|
|
3293
3257
|
//#endregion
|
|
3294
3258
|
//#region src/edit-mode/features/runtime-tracking-store.ts
|
|
3295
3259
|
var RuntimeTrackingStore = class {
|
|
@@ -3424,8 +3388,6 @@ var RuntimeTrackingStore = class {
|
|
|
3424
3388
|
return registeredMatches.length > 0 ? registeredMatches[registeredMatches.length - 1] : void 0;
|
|
3425
3389
|
}
|
|
3426
3390
|
};
|
|
3427
|
-
var runtime_tracking_store_default = RuntimeTrackingStore;
|
|
3428
|
-
|
|
3429
3391
|
//#endregion
|
|
3430
3392
|
//#region src/edit-mode/features/resizing-store.ts
|
|
3431
3393
|
var ResizingManager = class {
|
|
@@ -3559,7 +3521,6 @@ var ResizingManager = class {
|
|
|
3559
3521
|
});
|
|
3560
3522
|
}
|
|
3561
3523
|
};
|
|
3562
|
-
|
|
3563
3524
|
//#endregion
|
|
3564
3525
|
//#region src/edit-mode/features/ui-store.ts
|
|
3565
3526
|
const MULTI_SELECT_ENABLED = false;
|
|
@@ -3680,14 +3641,12 @@ var UIStore = class {
|
|
|
3680
3641
|
*/
|
|
3681
3642
|
async selectNewComponentBySourceId(sourceId, selectorIdsToIgnore = /* @__PURE__ */ new Set()) {
|
|
3682
3643
|
this.newComponentSelectPromise?.cancel();
|
|
3683
|
-
this.newComponentSelectPromise = when(() => Array.from(this.editStore.runtimeTrackingStore.getSelectorIdsForSourceId(sourceId)).some((selectorId
|
|
3644
|
+
this.newComponentSelectPromise = when(() => Array.from(this.editStore.runtimeTrackingStore.getSelectorIdsForSourceId(sourceId)).some((selectorId) => !selectorIdsToIgnore.has(selectorId)));
|
|
3684
3645
|
await this.newComponentSelectPromise;
|
|
3685
3646
|
const selectorId = Array.from(this.editStore.runtimeTrackingStore.getSelectorIdsForSourceId(sourceId))[0];
|
|
3686
3647
|
if (selectorId) this.selectWidget(selectorId);
|
|
3687
3648
|
}
|
|
3688
3649
|
};
|
|
3689
|
-
var ui_store_default = UIStore;
|
|
3690
|
-
|
|
3691
3650
|
//#endregion
|
|
3692
3651
|
//#region src/edit-mode/runtime-sync/builders.ts
|
|
3693
3652
|
const MAX_SUBTREE_DEPTH = 30;
|
|
@@ -3775,7 +3734,6 @@ function getComponentType(component) {
|
|
|
3775
3734
|
if (typeof component.type === "string") return component.type;
|
|
3776
3735
|
return "Component";
|
|
3777
3736
|
}
|
|
3778
|
-
|
|
3779
3737
|
//#endregion
|
|
3780
3738
|
//#region src/edit-mode/runtime-sync/runtime-subscriptions-store.ts
|
|
3781
3739
|
/**
|
|
@@ -3812,7 +3770,6 @@ var RuntimeSubscriptionsStore = class {
|
|
|
3812
3770
|
return out;
|
|
3813
3771
|
}
|
|
3814
3772
|
};
|
|
3815
|
-
|
|
3816
3773
|
//#endregion
|
|
3817
3774
|
//#region src/edit-mode/edit-store.ts
|
|
3818
3775
|
const isSessionRecordingEnabled = () => {
|
|
@@ -3834,12 +3791,12 @@ var EditStore = class {
|
|
|
3834
3791
|
designModeDisabled = false;
|
|
3835
3792
|
viteMessageListeners = /* @__PURE__ */ new Map();
|
|
3836
3793
|
constructor(rootStore) {
|
|
3837
|
-
this.ui = new
|
|
3838
|
-
this.operationManager = new
|
|
3839
|
-
this.propertiesPanelManager = new
|
|
3840
|
-
this.runtimeTrackingStore = new
|
|
3794
|
+
this.ui = new UIStore(rootStore, this);
|
|
3795
|
+
this.operationManager = new OperationManager();
|
|
3796
|
+
this.propertiesPanelManager = new PropertiesPanelManager(this, rootStore.componentRegistry);
|
|
3797
|
+
this.runtimeTrackingStore = new RuntimeTrackingStore(this);
|
|
3841
3798
|
this.runtimeSubscriptionsStore = new RuntimeSubscriptionsStore(this);
|
|
3842
|
-
this.connectionManager = new
|
|
3799
|
+
this.connectionManager = new ConnectionManager();
|
|
3843
3800
|
this.ai = new AiManager(this.runtimeTrackingStore);
|
|
3844
3801
|
makeObservable(this, {
|
|
3845
3802
|
isInitialized: observable,
|
|
@@ -3907,7 +3864,6 @@ function initializeEditStore() {
|
|
|
3907
3864
|
if (!window.__SUPERBLOCKS_EDITOR_HOOK__) return;
|
|
3908
3865
|
window.__SUPERBLOCKS_EDITOR_HOOK__.setIsInitialized(true);
|
|
3909
3866
|
}
|
|
3910
|
-
|
|
3911
3867
|
//#endregion
|
|
3912
3868
|
//#region src/lib/hooks/use-editor-hotkeys.ts
|
|
3913
3869
|
function useEditorHotkeys(keys, callback, options, deps) {
|
|
@@ -3917,7 +3873,6 @@ function useEditorHotkeys(keys, callback, options, deps) {
|
|
|
3917
3873
|
}
|
|
3918
3874
|
return useHotkeys(keys, callback, options, [...deps ?? [], false]);
|
|
3919
3875
|
}
|
|
3920
|
-
|
|
3921
3876
|
//#endregion
|
|
3922
3877
|
//#region src/lib/hooks/use-key-pressed.ts
|
|
3923
3878
|
function useKeyPressed(key, callback, options) {
|
|
@@ -3989,7 +3944,6 @@ function useKeyPressed(key, callback, options) {
|
|
|
3989
3944
|
options?.allowMultipleKeys
|
|
3990
3945
|
]);
|
|
3991
3946
|
}
|
|
3992
|
-
|
|
3993
3947
|
//#endregion
|
|
3994
3948
|
//#region src/lib/hooks/use-observer-memo.ts
|
|
3995
3949
|
/**
|
|
@@ -4019,51 +3973,30 @@ const useStandaloneObserverMemo = (fn, deps) => {
|
|
|
4019
3973
|
}), deps);
|
|
4020
3974
|
return result;
|
|
4021
3975
|
};
|
|
4022
|
-
|
|
4023
3976
|
//#endregion
|
|
4024
3977
|
//#region src/lib/user-facing/layers.ts
|
|
4025
|
-
var Indices = /* @__PURE__ */ function(Indices$1) {
|
|
4026
|
-
Indices$1[Indices$1["Layer0"] = 60] = "Layer0";
|
|
4027
|
-
Indices$1[Indices$1["Layer1"] = 61] = "Layer1";
|
|
4028
|
-
Indices$1[Indices$1["Layer2"] = 62] = "Layer2";
|
|
4029
|
-
Indices$1[Indices$1["Layer3"] = 63] = "Layer3";
|
|
4030
|
-
Indices$1[Indices$1["Layer4"] = 64] = "Layer4";
|
|
4031
|
-
Indices$1[Indices$1["Layer5"] = 65] = "Layer5";
|
|
4032
|
-
Indices$1[Indices$1["Layer6"] = 66] = "Layer6";
|
|
4033
|
-
Indices$1[Indices$1["Layer7"] = 67] = "Layer7";
|
|
4034
|
-
Indices$1[Indices$1["Layer8"] = 68] = "Layer8";
|
|
4035
|
-
Indices$1[Indices$1["Layer9"] = 69] = "Layer9";
|
|
4036
|
-
Indices$1[Indices$1["Layer10"] = 70] = "Layer10";
|
|
4037
|
-
Indices$1[Indices$1["Layer11"] = 71] = "Layer11";
|
|
4038
|
-
Indices$1[Indices$1["Layer12"] = 72] = "Layer12";
|
|
4039
|
-
Indices$1[Indices$1["Layer13"] = 73] = "Layer13";
|
|
4040
|
-
Indices$1[Indices$1["Layer14"] = 74] = "Layer14";
|
|
4041
|
-
Indices$1[Indices$1["LayerMax"] = 99999] = "LayerMax";
|
|
4042
|
-
return Indices$1;
|
|
4043
|
-
}(Indices || {});
|
|
4044
3978
|
const Layers = {
|
|
4045
|
-
dragPreview:
|
|
4046
|
-
visibilityOverlay:
|
|
4047
|
-
selectedRect:
|
|
4048
|
-
focusedRect:
|
|
4049
|
-
namePill:
|
|
4050
|
-
closeButton:
|
|
4051
|
-
stickySections:
|
|
4052
|
-
scrollbars:
|
|
4053
|
-
componentBorder:
|
|
4054
|
-
resizeWrapper:
|
|
4055
|
-
parentSelectedWrapper:
|
|
4056
|
-
widgetResizer:
|
|
4057
|
-
resizer:
|
|
4058
|
-
dialog:
|
|
4059
|
-
widgetName:
|
|
4060
|
-
selectionConstraintResize:
|
|
4061
|
-
canvasBreadCrumbPopover:
|
|
4062
|
-
vstackDropPlaceholder:
|
|
4063
|
-
focusedInput:
|
|
4064
|
-
max:
|
|
3979
|
+
dragPreview: 61,
|
|
3980
|
+
visibilityOverlay: 64,
|
|
3981
|
+
selectedRect: 64,
|
|
3982
|
+
focusedRect: 65,
|
|
3983
|
+
namePill: 66,
|
|
3984
|
+
closeButton: 64,
|
|
3985
|
+
stickySections: 63,
|
|
3986
|
+
scrollbars: 65,
|
|
3987
|
+
componentBorder: 63,
|
|
3988
|
+
resizeWrapper: 64,
|
|
3989
|
+
parentSelectedWrapper: 63,
|
|
3990
|
+
widgetResizer: 64,
|
|
3991
|
+
resizer: 66,
|
|
3992
|
+
dialog: 67,
|
|
3993
|
+
widgetName: 64,
|
|
3994
|
+
selectionConstraintResize: 64,
|
|
3995
|
+
canvasBreadCrumbPopover: 65,
|
|
3996
|
+
vstackDropPlaceholder: 62,
|
|
3997
|
+
focusedInput: 74,
|
|
3998
|
+
max: 99999
|
|
4065
3999
|
};
|
|
4066
|
-
|
|
4067
4000
|
//#endregion
|
|
4068
4001
|
//#region src/edit-mode/interaction-utils.ts
|
|
4069
4002
|
/**
|
|
@@ -4082,7 +4015,6 @@ const getWidgetNode = (idOrSourceId) => {
|
|
|
4082
4015
|
else if (isSourceId) return document?.querySelector(`[${SOURCE_ID_ATTRIBUTE}="${idOrSourceId}"]`);
|
|
4083
4016
|
throw new Error(`Unknown ID format: ${idOrSourceId} (expected S-* or SB-*)`);
|
|
4084
4017
|
};
|
|
4085
|
-
|
|
4086
4018
|
//#endregion
|
|
4087
4019
|
//#region src/edit-mode/interaction-layer/interaction-rect-name-pill.tsx
|
|
4088
4020
|
const NamePillDiv = (params) => {
|
|
@@ -4115,8 +4047,6 @@ const NamePill = observer((props) => {
|
|
|
4115
4047
|
type
|
|
4116
4048
|
});
|
|
4117
4049
|
});
|
|
4118
|
-
var interaction_rect_name_pill_default = NamePill;
|
|
4119
|
-
|
|
4120
4050
|
//#endregion
|
|
4121
4051
|
//#region src/edit-mode/interaction-layer/interaction-rect-actions.tsx
|
|
4122
4052
|
const guessOverlapAmountForNamePills = (selector1, selector2) => {
|
|
@@ -4171,14 +4101,13 @@ function InteractionRectActions(props) {
|
|
|
4171
4101
|
opacity: opacityValue,
|
|
4172
4102
|
transform
|
|
4173
4103
|
},
|
|
4174
|
-
children: /* @__PURE__ */ jsx(
|
|
4104
|
+
children: /* @__PURE__ */ jsx(NamePill, {
|
|
4175
4105
|
selectorId,
|
|
4176
4106
|
displayName,
|
|
4177
4107
|
type
|
|
4178
4108
|
})
|
|
4179
4109
|
});
|
|
4180
4110
|
}
|
|
4181
|
-
|
|
4182
4111
|
//#endregion
|
|
4183
4112
|
//#region src/edit-mode/interaction-layer/transform-utils.ts
|
|
4184
4113
|
const transformCache = /* @__PURE__ */ new Map();
|
|
@@ -4213,9 +4142,9 @@ function useAnchorTransform(selectorId) {
|
|
|
4213
4142
|
current = current.parentElement;
|
|
4214
4143
|
}
|
|
4215
4144
|
if (transforms.length === 0) {
|
|
4216
|
-
const data
|
|
4217
|
-
transformCache.set(selectorId, data
|
|
4218
|
-
setTransformData(data
|
|
4145
|
+
const data = { transform: "none" };
|
|
4146
|
+
transformCache.set(selectorId, data);
|
|
4147
|
+
setTransformData(data);
|
|
4219
4148
|
return;
|
|
4220
4149
|
}
|
|
4221
4150
|
const rect = transforms[0].element.getBoundingClientRect();
|
|
@@ -4240,26 +4169,22 @@ function useAnchorTransform(selectorId) {
|
|
|
4240
4169
|
}, [selectorId]);
|
|
4241
4170
|
return transformData.transform;
|
|
4242
4171
|
}
|
|
4243
|
-
function convertPercentageInTransform(transformValue, width
|
|
4172
|
+
function convertPercentageInTransform(transformValue, width, height) {
|
|
4244
4173
|
if (transformValue.startsWith("matrix")) return transformValue;
|
|
4245
4174
|
const translateMatch = transformValue.match(/translate3?d?\(([^)]+)\)/);
|
|
4246
4175
|
if (!translateMatch) return transformValue;
|
|
4247
4176
|
const valueString = translateMatch[1].trim();
|
|
4248
|
-
const values
|
|
4177
|
+
const values = valueString.includes(",") ? valueString.split(",").map((v) => v.trim()) : valueString.split(/\s+/).filter((v) => v);
|
|
4249
4178
|
const convertValue = (value, dimension) => {
|
|
4250
|
-
if (value.includes("%")) {
|
|
4251
|
-
const percentage = parseFloat(value);
|
|
4252
|
-
return `${Math.round(percentage / 100 * dimension)}px`;
|
|
4253
|
-
}
|
|
4179
|
+
if (value.includes("%")) return `${Math.round(parseFloat(value) / 100 * dimension)}px`;
|
|
4254
4180
|
return value;
|
|
4255
4181
|
};
|
|
4256
|
-
const x = convertValue(values
|
|
4257
|
-
const y = values
|
|
4258
|
-
const z = values
|
|
4259
|
-
if (values
|
|
4182
|
+
const x = convertValue(values[0] || "0", width);
|
|
4183
|
+
const y = values[1] ? convertValue(values[1], height) : "0px";
|
|
4184
|
+
const z = values[2] || "0px";
|
|
4185
|
+
if (values.length > 2) return transformValue.replace(translateMatch[0], `translate3d(${x}, ${y}, ${z})`);
|
|
4260
4186
|
return transformValue.replace(translateMatch[0], `translate(${x}, ${y})`);
|
|
4261
4187
|
}
|
|
4262
|
-
|
|
4263
4188
|
//#endregion
|
|
4264
4189
|
//#region src/edit-mode/interaction-layer/interaction-rect.tsx
|
|
4265
4190
|
const useSelectionElements = (params) => {
|
|
@@ -4401,7 +4326,6 @@ const selectDisplayNameAndVisibility = (selectorId) => {
|
|
|
4401
4326
|
sourceId
|
|
4402
4327
|
};
|
|
4403
4328
|
};
|
|
4404
|
-
|
|
4405
4329
|
//#endregion
|
|
4406
4330
|
//#region src/edit-mode/editor-hotkeys.tsx
|
|
4407
4331
|
function EditorHotkeys({ children }) {
|
|
@@ -4526,7 +4450,6 @@ function EditorHotkeys({ children }) {
|
|
|
4526
4450
|
});
|
|
4527
4451
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
4528
4452
|
}
|
|
4529
|
-
|
|
4530
4453
|
//#endregion
|
|
4531
4454
|
//#region src/edit-mode/screenshot-handler.ts
|
|
4532
4455
|
let cleanupCallback$1 = void 0;
|
|
@@ -4546,15 +4469,15 @@ function calculateScreenshotScale(elementWidth, elementHeight) {
|
|
|
4546
4469
|
* reflect the viewport while a child container holds the real content extent.
|
|
4547
4470
|
*/
|
|
4548
4471
|
function measureContentDimensions(targetElement, rootElement) {
|
|
4549
|
-
let width
|
|
4550
|
-
let height
|
|
4472
|
+
let width = Math.max(targetElement.scrollWidth, targetElement.offsetWidth);
|
|
4473
|
+
let height = Math.max(targetElement.scrollHeight, targetElement.offsetHeight);
|
|
4551
4474
|
if (targetElement === rootElement) {
|
|
4552
|
-
width
|
|
4553
|
-
height
|
|
4475
|
+
width = Math.max(width, document.documentElement.scrollWidth, document.body.scrollWidth);
|
|
4476
|
+
height = Math.max(height, document.documentElement.scrollHeight, document.body.scrollHeight);
|
|
4554
4477
|
}
|
|
4555
4478
|
return {
|
|
4556
|
-
width
|
|
4557
|
-
height
|
|
4479
|
+
width,
|
|
4480
|
+
height
|
|
4558
4481
|
};
|
|
4559
4482
|
}
|
|
4560
4483
|
/**
|
|
@@ -4574,13 +4497,13 @@ function loadImage(dataUrl) {
|
|
|
4574
4497
|
*/
|
|
4575
4498
|
async function ensureWithinDimensionLimit(dataUrl) {
|
|
4576
4499
|
const img = await loadImage(dataUrl);
|
|
4577
|
-
const { naturalWidth: width
|
|
4578
|
-
const maxDim = Math.max(width
|
|
4500
|
+
const { naturalWidth: width, naturalHeight: height } = img;
|
|
4501
|
+
const maxDim = Math.max(width, height);
|
|
4579
4502
|
if (maxDim <= MAX_SCREENSHOT_DIMENSION) return dataUrl;
|
|
4580
|
-
console.warn(`[Library Screenshot Handler] Output image ${width
|
|
4503
|
+
console.warn(`[Library Screenshot Handler] Output image ${width}x${height} exceeds ${MAX_SCREENSHOT_DIMENSION}px limit, resizing…`);
|
|
4581
4504
|
const scale = MAX_SCREENSHOT_DIMENSION / maxDim;
|
|
4582
|
-
const targetWidth = Math.round(width
|
|
4583
|
-
const targetHeight = Math.round(height
|
|
4505
|
+
const targetWidth = Math.round(width * scale);
|
|
4506
|
+
const targetHeight = Math.round(height * scale);
|
|
4584
4507
|
const canvas = document.createElement("canvas");
|
|
4585
4508
|
canvas.width = targetWidth;
|
|
4586
4509
|
canvas.height = targetHeight;
|
|
@@ -4665,10 +4588,10 @@ function initializeScreenshotHandler() {
|
|
|
4665
4588
|
scale,
|
|
4666
4589
|
...selector && { onCloneNode: (cloned) => {
|
|
4667
4590
|
if (cloned instanceof HTMLElement) {
|
|
4668
|
-
const computed
|
|
4669
|
-
for (let i = 0; i < computed
|
|
4670
|
-
const prop = computed
|
|
4671
|
-
cloned.style.setProperty(prop, computed
|
|
4591
|
+
const computed = getComputedStyle(targetElement);
|
|
4592
|
+
for (let i = 0; i < computed.length; i++) {
|
|
4593
|
+
const prop = computed[i];
|
|
4594
|
+
cloned.style.setProperty(prop, computed.getPropertyValue(prop));
|
|
4672
4595
|
}
|
|
4673
4596
|
}
|
|
4674
4597
|
} }
|
|
@@ -4702,7 +4625,6 @@ function initializeScreenshotHandler() {
|
|
|
4702
4625
|
iframeMessageHandler.removeEventListener("ping-app-ready-for-screenshot", handlePingAppReadyForScreenshot);
|
|
4703
4626
|
};
|
|
4704
4627
|
}
|
|
4705
|
-
|
|
4706
4628
|
//#endregion
|
|
4707
4629
|
//#region src/edit-mode/tagged-element-metadata-handler.ts
|
|
4708
4630
|
const MAX_ELEMENTS_PER_SOURCE = 5;
|
|
@@ -4786,14 +4708,13 @@ function initializeTaggedElementMetadataHandler() {
|
|
|
4786
4708
|
iframeMessageHandler.removeEventListener("get-tagged-element-metadata", handleGetTaggedElementMetadata);
|
|
4787
4709
|
};
|
|
4788
4710
|
}
|
|
4789
|
-
|
|
4790
4711
|
//#endregion
|
|
4791
4712
|
//#region src/edit-mode/iframe-wrappers.tsx
|
|
4792
4713
|
let _setReloadKey;
|
|
4793
4714
|
if (import.meta.hot) {
|
|
4794
4715
|
console.debug("[internal] [iframe-wrappers] registering reload listeners");
|
|
4795
4716
|
import.meta.hot.on("sb:force-remount-after-reload", () => {
|
|
4796
|
-
|
|
4717
|
+
tracker.dontSkipUntilNextReload();
|
|
4797
4718
|
_setReloadKey?.((currentKey) => currentKey + 1);
|
|
4798
4719
|
});
|
|
4799
4720
|
import.meta.hot.on("vite:beforeFullReload", () => {
|
|
@@ -4865,7 +4786,7 @@ if (isEditMode()) {
|
|
|
4865
4786
|
};
|
|
4866
4787
|
setupInitializer();
|
|
4867
4788
|
}
|
|
4868
|
-
const IframeConnected = observer(function IframeConnected
|
|
4789
|
+
const IframeConnected = observer(function IframeConnected(props) {
|
|
4869
4790
|
const [reloadKey, setReloadKey] = useState(0);
|
|
4870
4791
|
_setReloadKey = setReloadKey;
|
|
4871
4792
|
useEffect(() => {
|
|
@@ -5152,8 +5073,8 @@ const EmbedWrapper$2 = (props) => {
|
|
|
5152
5073
|
skipSecondaryComponentsCreation,
|
|
5153
5074
|
otherComponentsUpdates
|
|
5154
5075
|
});
|
|
5155
|
-
} catch (error
|
|
5156
|
-
console.error("Failed to create component:", error
|
|
5076
|
+
} catch (error) {
|
|
5077
|
+
console.error("Failed to create component:", error);
|
|
5157
5078
|
}
|
|
5158
5079
|
};
|
|
5159
5080
|
iframeMessageHandler.addEventListener("sb-create-component", createComponentListener);
|
|
@@ -5204,11 +5125,11 @@ const EmbedWrapper$2 = (props) => {
|
|
|
5204
5125
|
useEmbedMessageListeners(navigate, superblocksContext);
|
|
5205
5126
|
useEffect(() => {
|
|
5206
5127
|
const messageListener = (event) => {
|
|
5207
|
-
if (event.data?.type === "parent-action-batch" && event.data.payload) event.data.payload.forEach((action
|
|
5208
|
-
switch (action
|
|
5128
|
+
if (event.data?.type === "parent-action-batch" && event.data.payload) event.data.payload.forEach((action) => {
|
|
5129
|
+
switch (action.type) {
|
|
5209
5130
|
case "operations/editor:selectWidgets": {
|
|
5210
|
-
const sourceIds = action
|
|
5211
|
-
const selectorIdHint = action
|
|
5131
|
+
const sourceIds = action.payload.sourceIds;
|
|
5132
|
+
const selectorIdHint = action.payload.selectorIdHint;
|
|
5212
5133
|
getEditStore().ui.setSelectedSourceIds(sourceIds);
|
|
5213
5134
|
const selectorIds = sourceIds.flatMap((sourceId) => {
|
|
5214
5135
|
if (selectorIdHint) {
|
|
@@ -5220,12 +5141,12 @@ const EmbedWrapper$2 = (props) => {
|
|
|
5220
5141
|
break;
|
|
5221
5142
|
}
|
|
5222
5143
|
case "codeMode/cancelApiExecution": {
|
|
5223
|
-
const { apiId } = action
|
|
5144
|
+
const { apiId } = action.payload;
|
|
5224
5145
|
root_store_default.apis.cancelApi(apiId);
|
|
5225
5146
|
break;
|
|
5226
5147
|
}
|
|
5227
5148
|
case "RUN_API": {
|
|
5228
|
-
const { apiName, traceHeaders, callId, isTestRun, inputs } = action
|
|
5149
|
+
const { apiName, traceHeaders, callId, isTestRun, inputs } = action.payload;
|
|
5229
5150
|
console.debug("[internal] [iframe-wrappers] Received RUN_API:", {
|
|
5230
5151
|
apiName,
|
|
5231
5152
|
callId
|
|
@@ -5281,7 +5202,7 @@ const EmbedWrapper$2 = (props) => {
|
|
|
5281
5202
|
timingBreakdown: result.timingBreakdown
|
|
5282
5203
|
}
|
|
5283
5204
|
});
|
|
5284
|
-
}).catch((error
|
|
5205
|
+
}).catch((error) => {
|
|
5285
5206
|
sendMessageImmediately({
|
|
5286
5207
|
type: "sdk-api-execution-failed",
|
|
5287
5208
|
payload: {
|
|
@@ -5289,7 +5210,7 @@ const EmbedWrapper$2 = (props) => {
|
|
|
5289
5210
|
apiName,
|
|
5290
5211
|
error: {
|
|
5291
5212
|
code: "UNKNOWN",
|
|
5292
|
-
message: error
|
|
5213
|
+
message: error instanceof Error ? error.message : "Unknown error"
|
|
5293
5214
|
},
|
|
5294
5215
|
durationMs: Date.now() - startTime
|
|
5295
5216
|
}
|
|
@@ -5304,13 +5225,13 @@ const EmbedWrapper$2 = (props) => {
|
|
|
5304
5225
|
...inputs
|
|
5305
5226
|
},
|
|
5306
5227
|
isTestRun: true
|
|
5307
|
-
}).catch((error
|
|
5308
|
-
console.error(`Failed to test API ${apiName}:`, error
|
|
5228
|
+
}).catch((error) => {
|
|
5229
|
+
console.error(`Failed to test API ${apiName}:`, error);
|
|
5309
5230
|
});
|
|
5310
5231
|
} else if (callId) {
|
|
5311
5232
|
console.log("[iframe-wrappers] Re-running with callId:", callId);
|
|
5312
|
-
root_store_default.apis.rerunApiByCallId(callId).catch((error
|
|
5313
|
-
console.error(`Failed to re-run API with callId ${callId}:`, error
|
|
5233
|
+
root_store_default.apis.rerunApiByCallId(callId).catch((error) => {
|
|
5234
|
+
console.error(`Failed to re-run API with callId ${callId}:`, error);
|
|
5314
5235
|
});
|
|
5315
5236
|
} else {
|
|
5316
5237
|
console.log("[iframe-wrappers] This might be a Clark request - executing API normally");
|
|
@@ -5322,8 +5243,8 @@ const EmbedWrapper$2 = (props) => {
|
|
|
5322
5243
|
},
|
|
5323
5244
|
callId,
|
|
5324
5245
|
isTestRun: false
|
|
5325
|
-
}).catch((error
|
|
5326
|
-
console.error(`Failed to run API ${apiName}:`, error
|
|
5246
|
+
}).catch((error) => {
|
|
5247
|
+
console.error(`Failed to run API ${apiName}:`, error);
|
|
5327
5248
|
});
|
|
5328
5249
|
}
|
|
5329
5250
|
break;
|
|
@@ -5350,8 +5271,8 @@ const EmbedWrapper$2 = (props) => {
|
|
|
5350
5271
|
pathname: generatePath(route, routeTestParams),
|
|
5351
5272
|
search: location.search
|
|
5352
5273
|
});
|
|
5353
|
-
} catch (error
|
|
5354
|
-
throw new Error(`Failed to navigate to route: ${error
|
|
5274
|
+
} catch (error) {
|
|
5275
|
+
throw new Error(`Failed to navigate to route: ${error}`);
|
|
5355
5276
|
}
|
|
5356
5277
|
});
|
|
5357
5278
|
} catch {
|
|
@@ -5372,7 +5293,6 @@ const EmbedWrapper$2 = (props) => {
|
|
|
5372
5293
|
}
|
|
5373
5294
|
return /* @__PURE__ */ jsx(WithUserWrapper$1, { children: /* @__PURE__ */ jsxs(IframeConnected, { children: [/* @__PURE__ */ jsx(BuildErrorNotification, {}), /* @__PURE__ */ jsx(EditorHotkeys, { children: props.children })] }) });
|
|
5374
5295
|
};
|
|
5375
|
-
|
|
5376
5296
|
//#endregion
|
|
5377
5297
|
//#region src/lib/internal-details/lib/throttle.ts
|
|
5378
5298
|
function throttle$1(func, delay) {
|
|
@@ -5396,11 +5316,6 @@ function throttle$1(func, delay) {
|
|
|
5396
5316
|
};
|
|
5397
5317
|
return throttled;
|
|
5398
5318
|
}
|
|
5399
|
-
|
|
5400
|
-
//#endregion
|
|
5401
|
-
//#region src/edit-mode/extended-clickable-area.ts
|
|
5402
|
-
const EXTENDED_CLICKABLE_AREA_DELTA = 6;
|
|
5403
|
-
|
|
5404
5319
|
//#endregion
|
|
5405
5320
|
//#region src/edit-mode/interaction-layer/get-widgets-from-point.ts
|
|
5406
5321
|
const enablePointerEventsOnDisabledElements = (rootElement) => {
|
|
@@ -5481,8 +5396,8 @@ const getWidgetFromPointHelper = (params) => {
|
|
|
5481
5396
|
y,
|
|
5482
5397
|
rootElement,
|
|
5483
5398
|
delta: {
|
|
5484
|
-
x:
|
|
5485
|
-
y:
|
|
5399
|
+
x: 6,
|
|
5400
|
+
y: 6
|
|
5486
5401
|
}
|
|
5487
5402
|
});
|
|
5488
5403
|
if (widgetsWithBuffer.hoveredPills.length > 0) return getFirstItemWithFocusedSelectorPrioritized(widgetsWithBuffer.hoveredPills);
|
|
@@ -5552,7 +5467,6 @@ function getMostRelevantWidgetAtPoint(params) {
|
|
|
5552
5467
|
}
|
|
5553
5468
|
return widget.selectorId;
|
|
5554
5469
|
}
|
|
5555
|
-
|
|
5556
5470
|
//#endregion
|
|
5557
5471
|
//#region src/edit-mode/interaction-layer/interaction-layer.tsx
|
|
5558
5472
|
const INTERACTION_LAYER_ATTRIBUTE = "data-interaction-layer";
|
|
@@ -5745,7 +5659,7 @@ const InteractionLayerManager = observer(() => {
|
|
|
5745
5659
|
setBodyChildren(getBodyChildren());
|
|
5746
5660
|
};
|
|
5747
5661
|
updateBodyChildren();
|
|
5748
|
-
const observer
|
|
5662
|
+
const observer = new MutationObserver((mutations) => {
|
|
5749
5663
|
for (const mutation of mutations) if (mutation.type === "childList") {
|
|
5750
5664
|
const addedNodes = Array.from(mutation.addedNodes);
|
|
5751
5665
|
const removedNodes = Array.from(mutation.removedNodes);
|
|
@@ -5755,9 +5669,9 @@ const InteractionLayerManager = observer(() => {
|
|
|
5755
5669
|
}
|
|
5756
5670
|
}
|
|
5757
5671
|
});
|
|
5758
|
-
observer
|
|
5672
|
+
observer.observe(document.body, { childList: true });
|
|
5759
5673
|
return () => {
|
|
5760
|
-
observer
|
|
5674
|
+
observer.disconnect();
|
|
5761
5675
|
};
|
|
5762
5676
|
}, []);
|
|
5763
5677
|
if (editStore.ai.getIsEditing()) return null;
|
|
@@ -5813,8 +5727,6 @@ const ExternalInteractionLayer = observer(() => {
|
|
|
5813
5727
|
else if (isDesignMode) cursorStyle = `* { cursor: ${pencilCursor} !important; }`;
|
|
5814
5728
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(InteractionLayerManager, {}), cursorStyle && /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: cursorStyle } })] });
|
|
5815
5729
|
});
|
|
5816
|
-
var interaction_layer_default = ExternalInteractionLayer;
|
|
5817
|
-
|
|
5818
5730
|
//#endregion
|
|
5819
5731
|
//#region src/lib/internal-details/app-wrappers.tsx
|
|
5820
5732
|
const WithUserWrapper = (props) => {
|
|
@@ -5872,8 +5784,8 @@ const EmbedWrapper$1 = (props) => {
|
|
|
5872
5784
|
useEmbedMessageListeners(navigate, superblocksContext);
|
|
5873
5785
|
useEffect(() => {
|
|
5874
5786
|
const messageListener = (event) => {
|
|
5875
|
-
if (event.data?.type === "parent-action-batch" && event.data.payload) event.data.payload.forEach((action
|
|
5876
|
-
switch (action
|
|
5787
|
+
if (event.data?.type === "parent-action-batch" && event.data.payload) event.data.payload.forEach((action) => {
|
|
5788
|
+
switch (action.type) {
|
|
5877
5789
|
case "RUN_API":
|
|
5878
5790
|
console.warn("RUN_API action is not supported without entityManager");
|
|
5879
5791
|
break;
|
|
@@ -5901,7 +5813,6 @@ const EmbedWrapper$1 = (props) => {
|
|
|
5901
5813
|
}
|
|
5902
5814
|
return /* @__PURE__ */ jsx(WithUserWrapper, { children: props.children });
|
|
5903
5815
|
};
|
|
5904
|
-
|
|
5905
5816
|
//#endregion
|
|
5906
5817
|
//#region src/lib/internal-details/internal-components/error-boundary/index.tsx
|
|
5907
5818
|
var InternalErrorBoundary = class extends React.Component {
|
|
@@ -5942,7 +5853,6 @@ var InternalErrorBoundary = class extends React.Component {
|
|
|
5942
5853
|
return this.props.children;
|
|
5943
5854
|
}
|
|
5944
5855
|
};
|
|
5945
|
-
|
|
5946
5856
|
//#endregion
|
|
5947
5857
|
//#region src/lib/internal-details/lib/apply-sdk-context-payload.ts
|
|
5948
5858
|
/**
|
|
@@ -5955,12 +5865,11 @@ function applySdkContextPayload(payload) {
|
|
|
5955
5865
|
if ("branchName" in payload) root_store_default.setBranchName(payload.branchName);
|
|
5956
5866
|
if ("commitId" in payload) root_store_default.setCommitId(payload.commitId);
|
|
5957
5867
|
}
|
|
5958
|
-
|
|
5959
5868
|
//#endregion
|
|
5960
5869
|
//#region src/lib/internal-details/lib/devtools/index.tsx
|
|
5961
5870
|
const SUPPORTED_MODES = ["local-dev"];
|
|
5962
5871
|
const DevToolsInternal = React.lazy(() => {
|
|
5963
|
-
return import("../devtools-consolidated
|
|
5872
|
+
return import("../devtools-consolidated--QF_TVsD.js").then((module) => ({ default: module.CustomDevTools }));
|
|
5964
5873
|
});
|
|
5965
5874
|
const DevTools = () => {
|
|
5966
5875
|
if (!SUPPORTED_MODES.includes("production")) return null;
|
|
@@ -5969,7 +5878,6 @@ const DevTools = () => {
|
|
|
5969
5878
|
children: /* @__PURE__ */ jsx(DevToolsInternal, {})
|
|
5970
5879
|
});
|
|
5971
5880
|
};
|
|
5972
|
-
|
|
5973
5881
|
//#endregion
|
|
5974
5882
|
//#region src/lib/internal-details/routing.ts
|
|
5975
5883
|
function useTrackRouteChange() {
|
|
@@ -5993,7 +5901,6 @@ function useTrackRouteChange() {
|
|
|
5993
5901
|
params
|
|
5994
5902
|
]);
|
|
5995
5903
|
}
|
|
5996
|
-
|
|
5997
5904
|
//#endregion
|
|
5998
5905
|
//#region src/lib/user-facing/load-build-manifest.ts
|
|
5999
5906
|
/**
|
|
@@ -6006,7 +5913,7 @@ function useTrackRouteChange() {
|
|
|
6006
5913
|
async function loadBuildManifest() {
|
|
6007
5914
|
if (isEditMode()) return;
|
|
6008
5915
|
try {
|
|
6009
|
-
const mod = await import("../build-manifest-
|
|
5916
|
+
const mod = await import("../build-manifest-Xi8oZhWX.js");
|
|
6010
5917
|
const sdkApis = mod.default.sdkApis ?? {};
|
|
6011
5918
|
if (Object.keys(sdkApis).length > 0) {
|
|
6012
5919
|
root_store_default.clearApiEntryPoints();
|
|
@@ -6021,7 +5928,6 @@ async function loadBuildManifest() {
|
|
|
6021
5928
|
console.error("Error loading build manifest", error);
|
|
6022
5929
|
}
|
|
6023
5930
|
}
|
|
6024
|
-
|
|
6025
5931
|
//#endregion
|
|
6026
5932
|
//#region src/lib/user-facing/sb-provider-tracker.ts
|
|
6027
5933
|
const hasSbProviderRenderedEditMode = () => globalThis.__SB_PROVIDER_RENDERED_EDIT_MODE__ === true;
|
|
@@ -6062,28 +5968,27 @@ API executions and editor features will be unavailable.
|
|
|
6062
5968
|
if (hasRendered()) editorBridge.sendClearRuntimeError(ERROR_ID, true);
|
|
6063
5969
|
else {
|
|
6064
5970
|
let started = false;
|
|
6065
|
-
let observer
|
|
5971
|
+
let observer = null;
|
|
6066
5972
|
const startOnce = () => {
|
|
6067
5973
|
if (started) return;
|
|
6068
5974
|
started = true;
|
|
6069
|
-
observer
|
|
6070
|
-
observer
|
|
5975
|
+
observer?.disconnect();
|
|
5976
|
+
observer = null;
|
|
6071
5977
|
startTracking();
|
|
6072
5978
|
};
|
|
6073
5979
|
const rootEl = typeof document !== "undefined" ? document.getElementById("root") : null;
|
|
6074
5980
|
if (rootEl) if (rootEl.childNodes.length > 0) startOnce();
|
|
6075
5981
|
else {
|
|
6076
|
-
observer
|
|
5982
|
+
observer = new MutationObserver(() => {
|
|
6077
5983
|
if (hasRendered() || rootEl.childNodes.length > 0) startOnce();
|
|
6078
5984
|
});
|
|
6079
|
-
observer
|
|
5985
|
+
observer.observe(rootEl, {
|
|
6080
5986
|
childList: true,
|
|
6081
5987
|
subtree: true
|
|
6082
5988
|
});
|
|
6083
5989
|
}
|
|
6084
5990
|
}
|
|
6085
5991
|
}
|
|
6086
|
-
|
|
6087
5992
|
//#endregion
|
|
6088
5993
|
//#region src/lib/user-facing/styling/styles.ts
|
|
6089
5994
|
const VARIABLES = { primaryColor: "--primary-color" };
|
|
@@ -6112,7 +6017,6 @@ const initializeStyles = (appName) => {
|
|
|
6112
6017
|
};
|
|
6113
6018
|
createStyleSheetFromString(appName, `:${appName} {${Object.keys(allVariables).map((variable) => `${allVariables[variable]}: ${allVariableValues[variable]};`).join("\n")}}\n${stylesheet}`);
|
|
6114
6019
|
};
|
|
6115
|
-
|
|
6116
6020
|
//#endregion
|
|
6117
6021
|
//#region src/lib/user-facing/sb-provider.tsx
|
|
6118
6022
|
const originalLog = console.log;
|
|
@@ -6126,7 +6030,7 @@ console.log = (...args) => {
|
|
|
6126
6030
|
};
|
|
6127
6031
|
const Auth0Wrapper = isEditMode() ? Auth0Wrapper$2 : Auth0Wrapper$1;
|
|
6128
6032
|
const EmbedWrapper = isEditMode() ? EmbedWrapper$2 : EmbedWrapper$1;
|
|
6129
|
-
const SbProvider = function SbProvider
|
|
6033
|
+
const SbProvider = function SbProvider({ name = "codemode", children, className, context }) {
|
|
6130
6034
|
const isEmbedded = typeof window !== "undefined" && window.parent !== window.self;
|
|
6131
6035
|
useTrackRouteChange();
|
|
6132
6036
|
const [isApisInitialized, setIsApisInitialized] = useState(false);
|
|
@@ -6171,55 +6075,36 @@ const SbProvider = function SbProvider$1({ name = "codemode", children, classNam
|
|
|
6171
6075
|
children: [/* @__PURE__ */ jsx(InternalErrorBoundary, { children: /* @__PURE__ */ jsxs("div", {
|
|
6172
6076
|
className: "h-full w-full relative",
|
|
6173
6077
|
children: [/* @__PURE__ */ jsx(SuperblocksContextProvider, {
|
|
6174
|
-
value: context
|
|
6078
|
+
value: context ?? void 0,
|
|
6175
6079
|
children: isEmbedded ? /* @__PURE__ */ jsx(EmbedWrapper, { children }) : /* @__PURE__ */ jsx(Auth0Wrapper, { children })
|
|
6176
6080
|
}), /* @__PURE__ */ jsx(DevTools, {})]
|
|
6177
|
-
}) }), isEditMode() && /* @__PURE__ */ jsx(
|
|
6081
|
+
}) }), isEditMode() && /* @__PURE__ */ jsx(ExternalInteractionLayer, {})]
|
|
6178
6082
|
});
|
|
6179
6083
|
};
|
|
6180
|
-
var sb_provider_default = SbProvider;
|
|
6181
|
-
|
|
6182
6084
|
//#endregion
|
|
6183
6085
|
//#region src/lib/user-facing/components/app/editor.ts
|
|
6184
6086
|
const editorConfig = {
|
|
6185
6087
|
icon: "app",
|
|
6186
6088
|
isDraggable: false
|
|
6187
6089
|
};
|
|
6188
|
-
|
|
6189
6090
|
//#endregion
|
|
6190
6091
|
//#region src/lib/user-facing/components/app/props.ts
|
|
6191
6092
|
const propertiesDefinition = {
|
|
6192
6093
|
contents: Section.category(PropsCategory.Content).children({ children: Prop.jsx() }),
|
|
6193
6094
|
appearance: tailwindStylesCategory()
|
|
6194
6095
|
};
|
|
6195
|
-
|
|
6196
6096
|
//#endregion
|
|
6197
6097
|
//#region src/lib/user-facing/components/app/index.tsx
|
|
6198
|
-
const App = observer(({ children, className, context
|
|
6199
|
-
return /* @__PURE__ */ jsx(
|
|
6098
|
+
const App = observer(({ children, className, context }) => {
|
|
6099
|
+
return /* @__PURE__ */ jsx(SbProvider, {
|
|
6200
6100
|
name: "App",
|
|
6201
6101
|
className,
|
|
6202
|
-
context
|
|
6102
|
+
context,
|
|
6203
6103
|
children
|
|
6204
6104
|
});
|
|
6205
6105
|
});
|
|
6206
6106
|
App.displayName = NATIVE_COMPONENT_TYPES.App;
|
|
6207
6107
|
registerComponentInternal(App, propertiesDefinition).editorConfig(editorConfig);
|
|
6208
|
-
|
|
6209
|
-
//#endregion
|
|
6210
|
-
//#region src/lib/user-facing/error-pages/constants.ts
|
|
6211
|
-
let API_STATUS_CODES = /* @__PURE__ */ function(API_STATUS_CODES$1) {
|
|
6212
|
-
API_STATUS_CODES$1[API_STATUS_CODES$1["REQUEST_UNAUTHORIZED"] = 401] = "REQUEST_UNAUTHORIZED";
|
|
6213
|
-
API_STATUS_CODES$1[API_STATUS_CODES$1["RESOURCE_FORBIDDEN"] = 403] = "RESOURCE_FORBIDDEN";
|
|
6214
|
-
API_STATUS_CODES$1[API_STATUS_CODES$1["RESOURCE_NOT_FOUND"] = 404] = "RESOURCE_NOT_FOUND";
|
|
6215
|
-
API_STATUS_CODES$1[API_STATUS_CODES$1["TIMEOUT"] = 408] = "TIMEOUT";
|
|
6216
|
-
API_STATUS_CODES$1[API_STATUS_CODES$1["RESOURCE_CONFLICT"] = 409] = "RESOURCE_CONFLICT";
|
|
6217
|
-
API_STATUS_CODES$1[API_STATUS_CODES$1["SERVER_ERROR"] = 502] = "SERVER_ERROR";
|
|
6218
|
-
API_STATUS_CODES$1[API_STATUS_CODES$1["SERVER_UNAVAILABLE"] = 503] = "SERVER_UNAVAILABLE";
|
|
6219
|
-
API_STATUS_CODES$1[API_STATUS_CODES$1["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
6220
|
-
return API_STATUS_CODES$1;
|
|
6221
|
-
}({});
|
|
6222
|
-
|
|
6223
6108
|
//#endregion
|
|
6224
6109
|
//#region src/lib/user-facing/assets/images/errors/403-image.svg
|
|
6225
6110
|
var _g$4, _g2, _defs$4;
|
|
@@ -6232,7 +6117,7 @@ function _extends$4() {
|
|
|
6232
6117
|
return n;
|
|
6233
6118
|
}, _extends$4.apply(null, arguments);
|
|
6234
6119
|
}
|
|
6235
|
-
var Svg403Image = function Svg403Image
|
|
6120
|
+
var Svg403Image = function Svg403Image(props) {
|
|
6236
6121
|
return /* @__PURE__ */ React$1.createElement("svg", _extends$4({
|
|
6237
6122
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6238
6123
|
width: 167,
|
|
@@ -6431,8 +6316,6 @@ var Svg403Image = function Svg403Image$1(props) {
|
|
|
6431
6316
|
rx: 6
|
|
6432
6317
|
})))));
|
|
6433
6318
|
};
|
|
6434
|
-
var _403_image_default = Svg403Image;
|
|
6435
|
-
|
|
6436
6319
|
//#endregion
|
|
6437
6320
|
//#region src/lib/user-facing/assets/images/errors/404-image.svg
|
|
6438
6321
|
var _g$3, _defs$3;
|
|
@@ -6445,7 +6328,7 @@ function _extends$3() {
|
|
|
6445
6328
|
return n;
|
|
6446
6329
|
}, _extends$3.apply(null, arguments);
|
|
6447
6330
|
}
|
|
6448
|
-
var Svg404Image = function Svg404Image
|
|
6331
|
+
var Svg404Image = function Svg404Image(props) {
|
|
6449
6332
|
return /* @__PURE__ */ React$1.createElement("svg", _extends$3({
|
|
6450
6333
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6451
6334
|
width: 164,
|
|
@@ -6589,8 +6472,6 @@ var Svg404Image = function Svg404Image$1(props) {
|
|
|
6589
6472
|
result: "shape"
|
|
6590
6473
|
})))));
|
|
6591
6474
|
};
|
|
6592
|
-
var _404_image_default = Svg404Image;
|
|
6593
|
-
|
|
6594
6475
|
//#endregion
|
|
6595
6476
|
//#region src/lib/user-facing/assets/images/errors/500-image.svg
|
|
6596
6477
|
var _g$2, _defs$2;
|
|
@@ -6603,7 +6484,7 @@ function _extends$2() {
|
|
|
6603
6484
|
return n;
|
|
6604
6485
|
}, _extends$2.apply(null, arguments);
|
|
6605
6486
|
}
|
|
6606
|
-
var Svg500Image = function Svg500Image
|
|
6487
|
+
var Svg500Image = function Svg500Image(props) {
|
|
6607
6488
|
return /* @__PURE__ */ React$1.createElement("svg", _extends$2({
|
|
6608
6489
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6609
6490
|
width: 164,
|
|
@@ -6747,8 +6628,6 @@ var Svg500Image = function Svg500Image$1(props) {
|
|
|
6747
6628
|
result: "shape"
|
|
6748
6629
|
})))));
|
|
6749
6630
|
};
|
|
6750
|
-
var _500_image_default = Svg500Image;
|
|
6751
|
-
|
|
6752
6631
|
//#endregion
|
|
6753
6632
|
//#region src/lib/user-facing/assets/images/errors/general-error.svg
|
|
6754
6633
|
var _g$1, _defs$1;
|
|
@@ -6761,7 +6640,7 @@ function _extends$1() {
|
|
|
6761
6640
|
return n;
|
|
6762
6641
|
}, _extends$1.apply(null, arguments);
|
|
6763
6642
|
}
|
|
6764
|
-
var SvgGeneralError = function SvgGeneralError
|
|
6643
|
+
var SvgGeneralError = function SvgGeneralError(props) {
|
|
6765
6644
|
return /* @__PURE__ */ React$1.createElement("svg", _extends$1({
|
|
6766
6645
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6767
6646
|
width: 164,
|
|
@@ -6909,8 +6788,6 @@ var SvgGeneralError = function SvgGeneralError$1(props) {
|
|
|
6909
6788
|
rx: 82
|
|
6910
6789
|
})))));
|
|
6911
6790
|
};
|
|
6912
|
-
var general_error_default = SvgGeneralError;
|
|
6913
|
-
|
|
6914
6791
|
//#endregion
|
|
6915
6792
|
//#region src/lib/user-facing/assets/images/errors/login-error.svg
|
|
6916
6793
|
var _g, _defs;
|
|
@@ -6923,7 +6800,7 @@ function _extends() {
|
|
|
6923
6800
|
return n;
|
|
6924
6801
|
}, _extends.apply(null, arguments);
|
|
6925
6802
|
}
|
|
6926
|
-
var SvgLoginError = function SvgLoginError
|
|
6803
|
+
var SvgLoginError = function SvgLoginError(props) {
|
|
6927
6804
|
return /* @__PURE__ */ React$1.createElement("svg", _extends({
|
|
6928
6805
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6929
6806
|
width: 164,
|
|
@@ -7036,8 +6913,6 @@ var SvgLoginError = function SvgLoginError$1(props) {
|
|
|
7036
6913
|
rx: 82
|
|
7037
6914
|
})))));
|
|
7038
6915
|
};
|
|
7039
|
-
var login_error_default = SvgLoginError;
|
|
7040
|
-
|
|
7041
6916
|
//#endregion
|
|
7042
6917
|
//#region src/lib/user-facing/error-pages/error-component.tsx
|
|
7043
6918
|
const HOME_URL = "/home";
|
|
@@ -7093,26 +6968,25 @@ const Button = styled.button`
|
|
|
7093
6968
|
}
|
|
7094
6969
|
`;
|
|
7095
6970
|
const ErrorComponent = ({ title, errorMessage, buttonText, handleButtonClick, errorCode, buttonPath, image: overrideImage, secondaryButtonAction, secondaryButtonText, hideActions }) => {
|
|
7096
|
-
let ImageComponent = overrideImage ??
|
|
6971
|
+
let ImageComponent = overrideImage ?? SvgGeneralError;
|
|
7097
6972
|
if (!overrideImage) switch (errorCode) {
|
|
7098
|
-
case
|
|
7099
|
-
ImageComponent =
|
|
6973
|
+
case 404:
|
|
6974
|
+
ImageComponent = Svg404Image;
|
|
7100
6975
|
break;
|
|
7101
|
-
case
|
|
7102
|
-
ImageComponent =
|
|
6976
|
+
case 502:
|
|
6977
|
+
ImageComponent = Svg500Image;
|
|
7103
6978
|
break;
|
|
7104
|
-
case
|
|
7105
|
-
ImageComponent =
|
|
6979
|
+
case 403:
|
|
6980
|
+
ImageComponent = Svg403Image;
|
|
7106
6981
|
break;
|
|
7107
|
-
case
|
|
7108
|
-
ImageComponent =
|
|
6982
|
+
case 408:
|
|
6983
|
+
ImageComponent = SvgGeneralError;
|
|
7109
6984
|
break;
|
|
7110
6985
|
case "LOGIN_FAILURE":
|
|
7111
|
-
ImageComponent =
|
|
6986
|
+
ImageComponent = SvgLoginError;
|
|
7112
6987
|
break;
|
|
7113
|
-
default: ImageComponent =
|
|
6988
|
+
default: ImageComponent = SvgGeneralError;
|
|
7114
6989
|
}
|
|
7115
|
-
const showActions = !hideActions;
|
|
7116
6990
|
return /* @__PURE__ */ jsx(ErrorWrapper, {
|
|
7117
6991
|
"data-test": "app-error-container",
|
|
7118
6992
|
className: "error-wrapper",
|
|
@@ -7122,7 +6996,7 @@ const ErrorComponent = ({ title, errorMessage, buttonText, handleButtonClick, er
|
|
|
7122
6996
|
"data-test": "error-page-subtext",
|
|
7123
6997
|
children: errorMessage
|
|
7124
6998
|
})] }),
|
|
7125
|
-
|
|
6999
|
+
!hideActions && /* @__PURE__ */ jsxs("div", {
|
|
7126
7000
|
style: {
|
|
7127
7001
|
display: "flex",
|
|
7128
7002
|
alignItems: "center",
|
|
@@ -7142,8 +7016,6 @@ const ErrorComponent = ({ title, errorMessage, buttonText, handleButtonClick, er
|
|
|
7142
7016
|
] })
|
|
7143
7017
|
});
|
|
7144
7018
|
};
|
|
7145
|
-
var error_component_default = ErrorComponent;
|
|
7146
|
-
|
|
7147
7019
|
//#endregion
|
|
7148
7020
|
//#region src/lib/user-facing/error-pages/page-not-found.tsx
|
|
7149
7021
|
const Wrapper = styled.div`
|
|
@@ -7161,8 +7033,8 @@ const Wrapper = styled.div`
|
|
|
7161
7033
|
height: 100%;
|
|
7162
7034
|
`;
|
|
7163
7035
|
const PageNotFound = ({ title = "Content not found", errorMessage = "We couldn’t find the page you were looking for. Make sure that you have the right URL. ", buttonPath, buttonText, onButtonClick, hideActions }) => {
|
|
7164
|
-
return /* @__PURE__ */ jsx(Wrapper, { children: /* @__PURE__ */ jsx(
|
|
7165
|
-
errorCode:
|
|
7036
|
+
return /* @__PURE__ */ jsx(Wrapper, { children: /* @__PURE__ */ jsx(ErrorComponent, {
|
|
7037
|
+
errorCode: 404,
|
|
7166
7038
|
title,
|
|
7167
7039
|
errorMessage,
|
|
7168
7040
|
hideActions,
|
|
@@ -7172,7 +7044,6 @@ const PageNotFound = ({ title = "Content not found", errorMessage = "We couldn
|
|
|
7172
7044
|
handleButtonClick: onButtonClick
|
|
7173
7045
|
}) });
|
|
7174
7046
|
};
|
|
7175
|
-
|
|
7176
7047
|
//#endregion
|
|
7177
7048
|
//#region src/lib/internal-details/internal-components/route-load-error.tsx
|
|
7178
7049
|
function RouteLoadError() {
|
|
@@ -7202,7 +7073,6 @@ function RouteLoadError() {
|
|
|
7202
7073
|
error && /* @__PURE__ */ jsxs(ErrorDetails, { children: [/* @__PURE__ */ jsx(ErrorSummary, { children: "Full details" }), /* @__PURE__ */ jsx(ErrorStack, { children: error.stack })] })
|
|
7203
7074
|
] }) });
|
|
7204
7075
|
}
|
|
7205
|
-
|
|
7206
7076
|
//#endregion
|
|
7207
7077
|
//#region src/lib/user-facing/global-functions.ts
|
|
7208
7078
|
/**
|
|
@@ -7244,7 +7114,6 @@ async function logoutIntegrations() {
|
|
|
7244
7114
|
...logoutResult?.errors ? { errors: logoutResult.errors } : {}
|
|
7245
7115
|
};
|
|
7246
7116
|
}
|
|
7247
|
-
|
|
7248
7117
|
//#endregion
|
|
7249
7118
|
//#region src/lib/user-facing/embed.ts
|
|
7250
7119
|
/**
|
|
@@ -7293,7 +7162,6 @@ const Superblocks = {
|
|
|
7293
7162
|
emitEvent,
|
|
7294
7163
|
getEmbedProperties
|
|
7295
7164
|
};
|
|
7296
|
-
|
|
7297
7165
|
//#endregion
|
|
7298
7166
|
//#region src/lib/hooks/use-embed-properties.ts
|
|
7299
7167
|
/**
|
|
@@ -7320,7 +7188,6 @@ const Superblocks = {
|
|
|
7320
7188
|
function useEmbedProperties() {
|
|
7321
7189
|
return useStandaloneObserverMemo(() => embedStore.properties, []);
|
|
7322
7190
|
}
|
|
7323
|
-
|
|
7324
7191
|
//#endregion
|
|
7325
7192
|
//#region src/lib/hooks/use-embed-event.ts
|
|
7326
7193
|
/**
|
|
@@ -7363,7 +7230,6 @@ function useEmbedEvent(eventName, handler) {
|
|
|
7363
7230
|
};
|
|
7364
7231
|
}, [eventName]);
|
|
7365
7232
|
}
|
|
7366
|
-
|
|
7367
7233
|
//#endregion
|
|
7368
7234
|
//#region src/lib/hooks/use-emit-embed-event.ts
|
|
7369
7235
|
/**
|
|
@@ -7404,12 +7270,11 @@ function useEmitEmbedEvent() {
|
|
|
7404
7270
|
embedStore.emitEvent(eventName, payload);
|
|
7405
7271
|
}, []);
|
|
7406
7272
|
}
|
|
7407
|
-
|
|
7408
7273
|
//#endregion
|
|
7409
7274
|
//#region src/lib/index.ts
|
|
7410
|
-
|
|
7275
|
+
LibraryEarlyConsoleBuffer.getInstance().patchEarly();
|
|
7411
7276
|
registerHtmlElements();
|
|
7412
|
-
|
|
7413
7277
|
//#endregion
|
|
7414
|
-
export { App, PageNotFound, Prop, Property, PropsCategory, RouteLoadError, Section, Superblocks,
|
|
7278
|
+
export { App, PageNotFound, Prop, Property, PropsCategory, RouteLoadError, Section, Superblocks, SbProvider as SuperblocksProvider, createElement, createTypedExecuteApi, embedStore, executeApi, getAppMode, logoutIntegrations, queryClient, registerComponent, tailwindStylesCategory, useApi, useApiData, useApiStateful, useEmbedEvent, useEmbedProperties, useEmitEmbedEvent, useSuperblocksDataTags, useSuperblocksGroups, useSuperblocksProfiles, useSuperblocksUser, useTypedApi, useTypedApiData };
|
|
7279
|
+
|
|
7415
7280
|
//# sourceMappingURL=index.js.map
|