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