@superblocksteam/library 2.0.118-next.0 → 2.0.118
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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as getTracer } from "./utils-
|
|
1
|
+
import { t as getTracer } from "./utils-BGEEeYie.js";
|
|
2
2
|
import { InputType, PropsCategory } from "@superblocksteam/library-shared/props";
|
|
3
3
|
import { action, entries, isComputedProp, isObservableArray, isObservableMap, isObservableObject, makeAutoObservable, makeObservable, observable, observe, reaction, toJS, values } from "mobx";
|
|
4
4
|
import { matchRoutes } from "react-router";
|
|
@@ -7,7 +7,7 @@ import * as React$1 from "react";
|
|
|
7
7
|
import React, { Component, createContext, isValidElement, useCallback, useContext, useEffect, useMemo, useRef, useSyncExternalStore } from "react";
|
|
8
8
|
import { pick, throttle } from "lodash";
|
|
9
9
|
import { ApiResponseType, OrchestratorViewMode, SUPERBLOCKS_AUTHORIZATION_HEADER, SUPERBLOCKS_REQUEST_ID_HEADER, ViewMode, decodeBytestrings } from "@superblocksteam/shared";
|
|
10
|
-
import isString from "lodash/isString
|
|
10
|
+
import isString from "lodash/isString";
|
|
11
11
|
import { toast } from "sonner";
|
|
12
12
|
import styled, { keyframes } from "styled-components";
|
|
13
13
|
import { NotificationPosition } from "@superblocksteam/library-shared/types";
|
|
@@ -16,6 +16,7 @@ import { ROOT_CONTEXT, context, propagation, trace } from "@opentelemetry/api";
|
|
|
16
16
|
import diff from "microdiff";
|
|
17
17
|
import { Observer } from "mobx-react-lite";
|
|
18
18
|
import polyfill from "@oddbird/css-anchor-positioning/fn";
|
|
19
|
+
|
|
19
20
|
//#region src/edit-mode/get-edit-store.ts
|
|
20
21
|
/**
|
|
21
22
|
* Get the global EditStore instance
|
|
@@ -25,6 +26,7 @@ function getEditStore() {
|
|
|
25
26
|
if (!window.__SUPERBLOCKS_EDITOR_HOOK__ || !window.__SUPERBLOCKS_EDITOR_HOOK__.isInitialized) throw new Error("EditStore not initialized");
|
|
26
27
|
return window.__SUPERBLOCKS_EDITOR_HOOK__;
|
|
27
28
|
}
|
|
29
|
+
|
|
28
30
|
//#endregion
|
|
29
31
|
//#region src/lib/user-facing/properties-panel/properties-panel-definition.ts
|
|
30
32
|
function createPropertiesPanelDefinition(sections, componentProps) {
|
|
@@ -73,6 +75,7 @@ function createPropertiesPanelDefinition(sections, componentProps) {
|
|
|
73
75
|
}
|
|
74
76
|
return { sections: sectionDefs };
|
|
75
77
|
}
|
|
78
|
+
|
|
76
79
|
//#endregion
|
|
77
80
|
//#region src/lib/user-facing/properties-panel/props-builder.ts
|
|
78
81
|
function mergeRelations(existingRelations, relations) {
|
|
@@ -192,7 +195,10 @@ var Prop = class Prop {
|
|
|
192
195
|
case "string": return Prop.string().default(value);
|
|
193
196
|
case "number": return Prop.number().default(value);
|
|
194
197
|
case "boolean": return Prop.boolean().default(value);
|
|
195
|
-
default:
|
|
198
|
+
default: {
|
|
199
|
+
const exhaustiveCheck = value;
|
|
200
|
+
throw new Error(`Invalid literal value: ${exhaustiveCheck}`);
|
|
201
|
+
}
|
|
196
202
|
}
|
|
197
203
|
}
|
|
198
204
|
static eventHandler() {
|
|
@@ -291,6 +297,7 @@ var Prop = class Prop {
|
|
|
291
297
|
case "jsx":
|
|
292
298
|
baseControlType = "JSX";
|
|
293
299
|
break;
|
|
300
|
+
case "any":
|
|
294
301
|
default:
|
|
295
302
|
baseControlType = "INPUT_JS_EXPR";
|
|
296
303
|
break;
|
|
@@ -505,6 +512,10 @@ var UnionProp = class extends Prop {
|
|
|
505
512
|
};
|
|
506
513
|
}
|
|
507
514
|
};
|
|
515
|
+
|
|
516
|
+
//#endregion
|
|
517
|
+
//#region src/lib/user-facing/properties-panel/create-managed-props-list.ts
|
|
518
|
+
const RECORD_PATH_IDENTIFIER = "*";
|
|
508
519
|
function buildCompositeDefault(prop, name, parentDefault) {
|
|
509
520
|
const defaultThroughParent = parentDefault?.[name];
|
|
510
521
|
const selfDefault = prop.build().default;
|
|
@@ -527,10 +538,10 @@ function buildPropLeafDefault(prop, name, parentDefault) {
|
|
|
527
538
|
* and calls the provided callback for each leaf property.
|
|
528
539
|
*/
|
|
529
540
|
function traverseProps(sections, onProp, parentPath = "") {
|
|
530
|
-
const processProps = ({ props, parentPath, parentDefault }) => {
|
|
541
|
+
const processProps = ({ props, parentPath: parentPath$1, parentDefault }) => {
|
|
531
542
|
for (const [name, prop] of Object.entries(props)) {
|
|
532
543
|
if (!prop) continue;
|
|
533
|
-
const fullPath = parentPath ? `${parentPath}.${name}` : name;
|
|
544
|
+
const fullPath = parentPath$1 ? `${parentPath$1}.${name}` : name;
|
|
534
545
|
if (prop instanceof CompositeProp) {
|
|
535
546
|
const compositeDefault = buildCompositeDefault(prop, name, parentDefault);
|
|
536
547
|
processProps({
|
|
@@ -539,7 +550,7 @@ function traverseProps(sections, onProp, parentPath = "") {
|
|
|
539
550
|
parentDefault: compositeDefault
|
|
540
551
|
});
|
|
541
552
|
} else if (prop instanceof RecordProp) {
|
|
542
|
-
const recordPath = `${fullPath}
|
|
553
|
+
const recordPath = `${fullPath}.${RECORD_PATH_IDENTIFIER}`;
|
|
543
554
|
processProps({
|
|
544
555
|
props: prop.nestedProps,
|
|
545
556
|
parentPath: recordPath,
|
|
@@ -547,7 +558,7 @@ function traverseProps(sections, onProp, parentPath = "") {
|
|
|
547
558
|
});
|
|
548
559
|
} else if (prop instanceof Section) processProps({
|
|
549
560
|
props: prop.props,
|
|
550
|
-
parentPath
|
|
561
|
+
parentPath: parentPath$1
|
|
551
562
|
});
|
|
552
563
|
else if (prop instanceof UnionProp) {
|
|
553
564
|
const sharedKeys = Object.keys(prop.shared);
|
|
@@ -584,6 +595,7 @@ function createManagedPropsList(sections, parentPath = "") {
|
|
|
584
595
|
}, parentPath);
|
|
585
596
|
return managedPropsList;
|
|
586
597
|
}
|
|
598
|
+
|
|
587
599
|
//#endregion
|
|
588
600
|
//#region src/lib/internal-details/is-edit-mode.ts
|
|
589
601
|
const getIsEditMode = () => {
|
|
@@ -594,6 +606,7 @@ const isEditMode = () => {
|
|
|
594
606
|
if (editMode === void 0) editMode = getIsEditMode();
|
|
595
607
|
return editMode;
|
|
596
608
|
};
|
|
609
|
+
|
|
597
610
|
//#endregion
|
|
598
611
|
//#region src/lib/utils/clean-object.ts
|
|
599
612
|
const isReactElement = (obj) => {
|
|
@@ -632,6 +645,7 @@ function cleanObject(obj) {
|
|
|
632
645
|
return acc;
|
|
633
646
|
}, {});
|
|
634
647
|
}
|
|
648
|
+
|
|
635
649
|
//#endregion
|
|
636
650
|
//#region src/lib/internal-details/lib/iframe.ts
|
|
637
651
|
function isEmbeddedBySuperblocksFirstParty() {
|
|
@@ -696,6 +710,7 @@ var SbIframeEventInternal = class extends Event {
|
|
|
696
710
|
};
|
|
697
711
|
var SbMessageHandler = class extends EventTarget {};
|
|
698
712
|
const iframeMessageHandler = new SbMessageHandler();
|
|
713
|
+
|
|
699
714
|
//#endregion
|
|
700
715
|
//#region src/edit-mode/base-editor-bridge.ts
|
|
701
716
|
var DeployedParentBridge = class {
|
|
@@ -761,6 +776,7 @@ var DeployedParentBridge = class {
|
|
|
761
776
|
});
|
|
762
777
|
}
|
|
763
778
|
};
|
|
779
|
+
|
|
764
780
|
//#endregion
|
|
765
781
|
//#region src/edit-mode/message-queue.ts
|
|
766
782
|
const MESSAGE_BATCH_TIME = 50;
|
|
@@ -791,6 +807,7 @@ var MessageQueue = class {
|
|
|
791
807
|
}
|
|
792
808
|
};
|
|
793
809
|
var message_queue_default = new MessageQueue();
|
|
810
|
+
|
|
794
811
|
//#endregion
|
|
795
812
|
//#region src/edit-mode/superblocks-editor-bridge.ts
|
|
796
813
|
var SuperblocksEditorBridge = class SuperblocksEditorBridge {
|
|
@@ -798,8 +815,8 @@ var SuperblocksEditorBridge = class SuperblocksEditorBridge {
|
|
|
798
815
|
messagesToSend = [];
|
|
799
816
|
connectedToParent = false;
|
|
800
817
|
static getInstance() {
|
|
801
|
-
const editMode = isEditMode();
|
|
802
|
-
if (!SuperblocksEditorBridge.instance) SuperblocksEditorBridge.instance = editMode ? new SuperblocksEditorBridge() : new DeployedParentBridge();
|
|
818
|
+
const editMode$1 = isEditMode();
|
|
819
|
+
if (!SuperblocksEditorBridge.instance) SuperblocksEditorBridge.instance = editMode$1 ? new SuperblocksEditorBridge() : new DeployedParentBridge();
|
|
803
820
|
return SuperblocksEditorBridge.instance;
|
|
804
821
|
}
|
|
805
822
|
connected() {
|
|
@@ -1165,6 +1182,7 @@ function clampPromptLength(prompt) {
|
|
|
1165
1182
|
return `${prompt.slice(0, available)}${TRUNCATION_SUFFIX}`;
|
|
1166
1183
|
}
|
|
1167
1184
|
const editorBridge = SuperblocksEditorBridge.getInstance();
|
|
1185
|
+
|
|
1168
1186
|
//#endregion
|
|
1169
1187
|
//#region src/lib/internal-details/location-store.ts
|
|
1170
1188
|
var LocationStore = class {
|
|
@@ -1211,6 +1229,7 @@ var LocationStore = class {
|
|
|
1211
1229
|
};
|
|
1212
1230
|
}
|
|
1213
1231
|
};
|
|
1232
|
+
|
|
1214
1233
|
//#endregion
|
|
1215
1234
|
//#region src/lib/user-facing/assets/icons/system-danger.svg
|
|
1216
1235
|
var _path$5;
|
|
@@ -1223,7 +1242,7 @@ function _extends$5() {
|
|
|
1223
1242
|
return n;
|
|
1224
1243
|
}, _extends$5.apply(null, arguments);
|
|
1225
1244
|
}
|
|
1226
|
-
var SvgSystemDanger = function SvgSystemDanger(props) {
|
|
1245
|
+
var SvgSystemDanger = function SvgSystemDanger$1(props) {
|
|
1227
1246
|
return /* @__PURE__ */ React$1.createElement("svg", _extends$5({
|
|
1228
1247
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1229
1248
|
width: 16,
|
|
@@ -1236,6 +1255,8 @@ var SvgSystemDanger = function SvgSystemDanger(props) {
|
|
|
1236
1255
|
clipRule: "evenodd"
|
|
1237
1256
|
})));
|
|
1238
1257
|
};
|
|
1258
|
+
var system_danger_default = SvgSystemDanger;
|
|
1259
|
+
|
|
1239
1260
|
//#endregion
|
|
1240
1261
|
//#region src/lib/user-facing/assets/icons/system-error.svg
|
|
1241
1262
|
var _path$4;
|
|
@@ -1248,7 +1269,7 @@ function _extends$4() {
|
|
|
1248
1269
|
return n;
|
|
1249
1270
|
}, _extends$4.apply(null, arguments);
|
|
1250
1271
|
}
|
|
1251
|
-
var SvgSystemError = function SvgSystemError(props) {
|
|
1272
|
+
var SvgSystemError = function SvgSystemError$1(props) {
|
|
1252
1273
|
return /* @__PURE__ */ React$1.createElement("svg", _extends$4({
|
|
1253
1274
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1254
1275
|
width: 16,
|
|
@@ -1261,6 +1282,8 @@ var SvgSystemError = function SvgSystemError(props) {
|
|
|
1261
1282
|
clipRule: "evenodd"
|
|
1262
1283
|
})));
|
|
1263
1284
|
};
|
|
1285
|
+
var system_error_default = SvgSystemError;
|
|
1286
|
+
|
|
1264
1287
|
//#endregion
|
|
1265
1288
|
//#region src/lib/user-facing/assets/icons/system-info.svg
|
|
1266
1289
|
var _path$3;
|
|
@@ -1273,7 +1296,7 @@ function _extends$3() {
|
|
|
1273
1296
|
return n;
|
|
1274
1297
|
}, _extends$3.apply(null, arguments);
|
|
1275
1298
|
}
|
|
1276
|
-
var SvgSystemInfo = function SvgSystemInfo(props) {
|
|
1299
|
+
var SvgSystemInfo = function SvgSystemInfo$1(props) {
|
|
1277
1300
|
return /* @__PURE__ */ React$1.createElement("svg", _extends$3({
|
|
1278
1301
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1279
1302
|
width: 16,
|
|
@@ -1284,6 +1307,8 @@ var SvgSystemInfo = function SvgSystemInfo(props) {
|
|
|
1284
1307
|
d: "M8 1a7 7 0 1 0 7 7 7.014 7.014 0 0 0-7-7m-.135 3.23a.808.808 0 1 1 0 1.616.808.808 0 0 1 0-1.615m.673 7.54H8a.54.54 0 0 1-.538-.54V8a.538.538 0 1 1 0-1.077H8a.54.54 0 0 1 .538.539v3.23a.538.538 0 1 1 0 1.077"
|
|
1285
1308
|
})));
|
|
1286
1309
|
};
|
|
1310
|
+
var system_info_default = SvgSystemInfo;
|
|
1311
|
+
|
|
1287
1312
|
//#endregion
|
|
1288
1313
|
//#region src/lib/user-facing/assets/icons/system-success.svg
|
|
1289
1314
|
var _path$2;
|
|
@@ -1296,7 +1321,7 @@ function _extends$2() {
|
|
|
1296
1321
|
return n;
|
|
1297
1322
|
}, _extends$2.apply(null, arguments);
|
|
1298
1323
|
}
|
|
1299
|
-
var SvgSystemSuccess = function SvgSystemSuccess(props) {
|
|
1324
|
+
var SvgSystemSuccess = function SvgSystemSuccess$1(props) {
|
|
1300
1325
|
return /* @__PURE__ */ React$1.createElement("svg", _extends$2({
|
|
1301
1326
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1302
1327
|
width: 16,
|
|
@@ -1309,6 +1334,8 @@ var SvgSystemSuccess = function SvgSystemSuccess(props) {
|
|
|
1309
1334
|
clipRule: "evenodd"
|
|
1310
1335
|
})));
|
|
1311
1336
|
};
|
|
1337
|
+
var system_success_default = SvgSystemSuccess;
|
|
1338
|
+
|
|
1312
1339
|
//#endregion
|
|
1313
1340
|
//#region src/lib/user-facing/styling/colors.ts
|
|
1314
1341
|
const colors = {
|
|
@@ -1377,10 +1404,16 @@ const colors = {
|
|
|
1377
1404
|
SUCCESS: "#0CC26D",
|
|
1378
1405
|
NONE: "transparent"
|
|
1379
1406
|
};
|
|
1380
|
-
|
|
1407
|
+
|
|
1408
|
+
//#endregion
|
|
1409
|
+
//#region src/lib/user-facing/themes/classnames.ts
|
|
1410
|
+
const MODIFIER_CLASSNAMES = {
|
|
1381
1411
|
DISABLED_MODIFIER: "sb-disabled",
|
|
1382
1412
|
ERROR_MODIFIER: "sb-error",
|
|
1383
|
-
ACTIVE_MODIFIER: "sb-active"
|
|
1413
|
+
ACTIVE_MODIFIER: "sb-active"
|
|
1414
|
+
};
|
|
1415
|
+
const CLASS_NAMES = {
|
|
1416
|
+
...MODIFIER_CLASSNAMES,
|
|
1384
1417
|
HEADING1: "sb-heading-1",
|
|
1385
1418
|
HEADING2: "sb-heading-2",
|
|
1386
1419
|
HEADING3: "sb-heading-3",
|
|
@@ -1440,6 +1473,7 @@ const CLASS_NAMES = {
|
|
|
1440
1473
|
CODE_EDITOR: "sb-code-editor",
|
|
1441
1474
|
ERROR_INLINE_MESSAGE: "sb-error-inline-message"
|
|
1442
1475
|
};
|
|
1476
|
+
|
|
1443
1477
|
//#endregion
|
|
1444
1478
|
//#region src/lib/user-facing/utils/notification.tsx
|
|
1445
1479
|
const activeNotifications = /* @__PURE__ */ new Map();
|
|
@@ -1509,19 +1543,19 @@ const getIcon = (type) => {
|
|
|
1509
1543
|
let color;
|
|
1510
1544
|
switch (type) {
|
|
1511
1545
|
case "success":
|
|
1512
|
-
icon = /* @__PURE__ */ jsx(
|
|
1546
|
+
icon = /* @__PURE__ */ jsx(system_success_default, {});
|
|
1513
1547
|
color = colors.SUCCESS;
|
|
1514
1548
|
break;
|
|
1515
1549
|
case "error":
|
|
1516
|
-
icon = /* @__PURE__ */ jsx(
|
|
1550
|
+
icon = /* @__PURE__ */ jsx(system_error_default, {});
|
|
1517
1551
|
color = colors.DANGER;
|
|
1518
1552
|
break;
|
|
1519
1553
|
case "info":
|
|
1520
|
-
icon = /* @__PURE__ */ jsx(
|
|
1554
|
+
icon = /* @__PURE__ */ jsx(system_info_default, {});
|
|
1521
1555
|
color = colors.INFO;
|
|
1522
1556
|
break;
|
|
1523
1557
|
case "warning":
|
|
1524
|
-
icon = /* @__PURE__ */ jsx(
|
|
1558
|
+
icon = /* @__PURE__ */ jsx(system_danger_default, {});
|
|
1525
1559
|
color = colors.WARNING;
|
|
1526
1560
|
break;
|
|
1527
1561
|
}
|
|
@@ -1564,11 +1598,13 @@ function sendNotification({ message, description, duration, key = getKey("succes
|
|
|
1564
1598
|
onAutoClose: handleClose
|
|
1565
1599
|
});
|
|
1566
1600
|
}
|
|
1601
|
+
|
|
1567
1602
|
//#endregion
|
|
1568
1603
|
//#region src/lib/utils/generate-id.ts
|
|
1569
1604
|
const generateId = () => {
|
|
1570
1605
|
return Math.random().toString(36).substring(2, 15);
|
|
1571
1606
|
};
|
|
1607
|
+
|
|
1572
1608
|
//#endregion
|
|
1573
1609
|
//#region src/lib/internal-details/embed-store.ts
|
|
1574
1610
|
/**
|
|
@@ -1621,6 +1657,7 @@ var EmbedStore = class {
|
|
|
1621
1657
|
}
|
|
1622
1658
|
};
|
|
1623
1659
|
const embedStore = new EmbedStore();
|
|
1660
|
+
|
|
1624
1661
|
//#endregion
|
|
1625
1662
|
//#region src/lib/internal-details/scope/types.ts
|
|
1626
1663
|
const AppMode = {
|
|
@@ -1628,6 +1665,7 @@ const AppMode = {
|
|
|
1628
1665
|
PUBLISHED: "PUBLISHED",
|
|
1629
1666
|
PREVIEW: "PREVIEW"
|
|
1630
1667
|
};
|
|
1668
|
+
|
|
1631
1669
|
//#endregion
|
|
1632
1670
|
//#region src/lib/internal-details/superblocks-context.tsx
|
|
1633
1671
|
var SuperblocksAppContext = class {
|
|
@@ -1648,7 +1686,7 @@ var SuperblocksAppContext = class {
|
|
|
1648
1686
|
return this.context?.profiles;
|
|
1649
1687
|
}
|
|
1650
1688
|
setProfile(profileKey) {
|
|
1651
|
-
const profile = this.context?.profiles?.available.find((profile) => profile.key === profileKey);
|
|
1689
|
+
const profile = this.context?.profiles?.available.find((profile$1) => profile$1.key === profileKey);
|
|
1652
1690
|
if (profile && this.context?.profiles) {
|
|
1653
1691
|
this.context.profiles.selected = profile;
|
|
1654
1692
|
if (typeof window !== "undefined" && window.parent !== window) try {
|
|
@@ -1663,10 +1701,10 @@ var SuperblocksAppContext = class {
|
|
|
1663
1701
|
}
|
|
1664
1702
|
} else if (!profile || !this.context?.profiles) throw new Error(`Profile ${profileKey} not found`);
|
|
1665
1703
|
}
|
|
1666
|
-
updateContext(context) {
|
|
1704
|
+
updateContext(context$2) {
|
|
1667
1705
|
this.context = {
|
|
1668
1706
|
...this.context,
|
|
1669
|
-
...context
|
|
1707
|
+
...context$2
|
|
1670
1708
|
};
|
|
1671
1709
|
}
|
|
1672
1710
|
getGlobal() {
|
|
@@ -1689,29 +1727,29 @@ function useSuperblocksContext() {
|
|
|
1689
1727
|
return useContext(SuperblocksContext);
|
|
1690
1728
|
}
|
|
1691
1729
|
function useSuperblocksUser() {
|
|
1692
|
-
const context = useSuperblocksContext();
|
|
1730
|
+
const context$2 = useSuperblocksContext();
|
|
1693
1731
|
const user = useSyncExternalStore((onStoreChange) => {
|
|
1694
|
-
return reaction(() => context.user, onStoreChange);
|
|
1695
|
-
}, () => context.user, () => context.user);
|
|
1732
|
+
return reaction(() => context$2.user, onStoreChange);
|
|
1733
|
+
}, () => context$2.user, () => context$2.user);
|
|
1696
1734
|
return useMemo(() => toJS(user), [user]);
|
|
1697
1735
|
}
|
|
1698
1736
|
function useSuperblocksGroups() {
|
|
1699
|
-
const context = useSuperblocksContext();
|
|
1737
|
+
const context$2 = useSuperblocksContext();
|
|
1700
1738
|
const groups = useSyncExternalStore((onStoreChange) => {
|
|
1701
|
-
return reaction(() => context.groups, onStoreChange);
|
|
1702
|
-
}, () => context.groups, () => context.groups);
|
|
1739
|
+
return reaction(() => context$2.groups, onStoreChange);
|
|
1740
|
+
}, () => context$2.groups, () => context$2.groups);
|
|
1703
1741
|
return useMemo(() => toJS(groups), [groups]);
|
|
1704
1742
|
}
|
|
1705
1743
|
function useSuperblocksDataTags() {
|
|
1706
|
-
const context = useSuperblocksContext();
|
|
1744
|
+
const context$2 = useSuperblocksContext();
|
|
1707
1745
|
const dataTags = useSyncExternalStore((onStoreChange) => {
|
|
1708
|
-
return reaction(() => context.profiles, onStoreChange);
|
|
1709
|
-
}, () => context.profiles, () => context.profiles);
|
|
1746
|
+
return reaction(() => context$2.profiles, onStoreChange);
|
|
1747
|
+
}, () => context$2.profiles, () => context$2.profiles);
|
|
1710
1748
|
return {
|
|
1711
1749
|
dataTags: useMemo(() => toJS(dataTags), [dataTags]),
|
|
1712
1750
|
setDataTag: useCallback((dataTagKey) => {
|
|
1713
|
-
context.setProfile(dataTagKey);
|
|
1714
|
-
}, [context])
|
|
1751
|
+
context$2.setProfile(dataTagKey);
|
|
1752
|
+
}, [context$2])
|
|
1715
1753
|
};
|
|
1716
1754
|
}
|
|
1717
1755
|
/** @deprecated Use useSuperblocksDataTags instead */
|
|
@@ -1730,6 +1768,7 @@ function getAppMode() {
|
|
|
1730
1768
|
}
|
|
1731
1769
|
return appMode;
|
|
1732
1770
|
}
|
|
1771
|
+
|
|
1733
1772
|
//#endregion
|
|
1734
1773
|
//#region src/lib/internal-details/lib/resolve-id-singleton.ts
|
|
1735
1774
|
const EMBED_STRING = `embedded-`;
|
|
@@ -1774,7 +1813,10 @@ function rejectById(id, payload) {
|
|
|
1774
1813
|
console.log("[internal] [rejectById] Error rejecting promise", e);
|
|
1775
1814
|
}
|
|
1776
1815
|
}
|
|
1777
|
-
|
|
1816
|
+
|
|
1817
|
+
//#endregion
|
|
1818
|
+
//#region src/lib/internal-details/lib/features/api-hmr-tracker.ts
|
|
1819
|
+
var ApiHmrTracker = class ApiHmrTracker {
|
|
1778
1820
|
static CLEAR_REF_DELAY = 18e4;
|
|
1779
1821
|
reloadCount = 0;
|
|
1780
1822
|
propagatedReloadCount = 0;
|
|
@@ -1831,10 +1873,13 @@ const tracker = new class ApiHmrTracker {
|
|
|
1831
1873
|
}, { timeout: 50 });
|
|
1832
1874
|
}, 0);
|
|
1833
1875
|
}
|
|
1834
|
-
}
|
|
1876
|
+
};
|
|
1877
|
+
const tracker = new ApiHmrTracker();
|
|
1835
1878
|
if (import.meta.hot) import.meta.hot.on("vite:beforeUpdate", () => {
|
|
1836
1879
|
tracker.incReloadCount();
|
|
1837
1880
|
});
|
|
1881
|
+
var api_hmr_tracker_default = tracker;
|
|
1882
|
+
|
|
1838
1883
|
//#endregion
|
|
1839
1884
|
//#region src/lib/tracing/context-utils.ts
|
|
1840
1885
|
function getContextFromTraceHeaders(traceHeaders) {
|
|
@@ -1855,6 +1900,16 @@ function getTraceContextHeadersFromSpan(span) {
|
|
|
1855
1900
|
propagation.inject(contextWithSpan, traceContextHeaders);
|
|
1856
1901
|
return traceContextHeaders;
|
|
1857
1902
|
}
|
|
1903
|
+
|
|
1904
|
+
//#endregion
|
|
1905
|
+
//#region src/lib/internal-details/lib/types.ts
|
|
1906
|
+
let SystemErrorType = /* @__PURE__ */ function(SystemErrorType$1) {
|
|
1907
|
+
SystemErrorType$1["NETWORK"] = "NETWORK";
|
|
1908
|
+
SystemErrorType$1["HTTP"] = "HTTP";
|
|
1909
|
+
SystemErrorType$1["GENERAL"] = "GENERAL";
|
|
1910
|
+
return SystemErrorType$1;
|
|
1911
|
+
}({});
|
|
1912
|
+
|
|
1858
1913
|
//#endregion
|
|
1859
1914
|
//#region src/lib/internal-details/lib/features/api-utils.ts
|
|
1860
1915
|
async function executeV2Api(params) {
|
|
@@ -1910,13 +1965,13 @@ async function executeV2Api(params) {
|
|
|
1910
1965
|
const suppressError = viewMode !== ViewMode.EDITOR && err?.code === 20;
|
|
1911
1966
|
if (notifyOnSystemError && !suppressError) console.log(`[internal] [executeV2Api] ${message}`);
|
|
1912
1967
|
const statusCode = err instanceof HttpError ? err.code : void 0;
|
|
1913
|
-
let errorType =
|
|
1968
|
+
let errorType = SystemErrorType.GENERAL;
|
|
1914
1969
|
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
1915
1970
|
const errorConstructorName = err?.constructor?.name;
|
|
1916
1971
|
const isTypeError = err instanceof TypeError || errorConstructorName === "TypeError";
|
|
1917
1972
|
const hasNetworkErrorMessage = errorMessage.includes("Failed to fetch") || errorMessage.includes("network error") || errorMessage.includes("NetworkError") || errorMessage.includes("TypeError") && errorMessage.includes("fetch") || errorMessage.includes("ERR_NETWORK") || errorMessage.includes("ERR_INTERNET_DISCONNECTED") || errorMessage.includes("ERR_CONNECTION_REFUSED") || errorMessage.includes("ERR_CONNECTION_RESET") || errorMessage.includes("ERR_CONNECTION_TIMED_OUT") || errorMessage.includes("Failed to connect") || errorMessage.includes("network issue") || errorMessage.includes("timed out");
|
|
1918
|
-
if (isTypeError || hasNetworkErrorMessage) errorType =
|
|
1919
|
-
else if (err instanceof HttpError) errorType =
|
|
1973
|
+
if (isTypeError || hasNetworkErrorMessage) errorType = SystemErrorType.NETWORK;
|
|
1974
|
+
else if (err instanceof HttpError) errorType = SystemErrorType.HTTP;
|
|
1920
1975
|
return {
|
|
1921
1976
|
systemError: message,
|
|
1922
1977
|
statusCode,
|
|
@@ -2076,6 +2131,7 @@ const decodeBytestringsInV2ExecutionResponse = (response) => {
|
|
|
2076
2131
|
if (typedEvent?.end?.output?.result != null) typedEvent.end.output.result = decodeBytestrings(typedEvent.end.output.result, false);
|
|
2077
2132
|
});
|
|
2078
2133
|
};
|
|
2134
|
+
|
|
2079
2135
|
//#endregion
|
|
2080
2136
|
//#region src/lib/internal-details/lib/features/file-utils.ts
|
|
2081
2137
|
function isNativeFile(value) {
|
|
@@ -2151,6 +2207,7 @@ async function getInputsWithFileMetadata(inputs) {
|
|
|
2151
2207
|
files: Object.values(filesForRequest)
|
|
2152
2208
|
};
|
|
2153
2209
|
}
|
|
2210
|
+
|
|
2154
2211
|
//#endregion
|
|
2155
2212
|
//#region src/lib/internal-details/lib/features/url-utils.ts
|
|
2156
2213
|
/**
|
|
@@ -2168,6 +2225,7 @@ async function getInputsWithFileMetadata(inputs) {
|
|
|
2168
2225
|
function withTrailingSlash(baseUrl) {
|
|
2169
2226
|
return baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`;
|
|
2170
2227
|
}
|
|
2228
|
+
|
|
2171
2229
|
//#endregion
|
|
2172
2230
|
//#region src/lib/internal-details/lib/features/api-store.ts
|
|
2173
2231
|
const ENVIRONMENT_ALL = "*";
|
|
@@ -2290,7 +2348,7 @@ var ApiManager = class {
|
|
|
2290
2348
|
scopeId
|
|
2291
2349
|
};
|
|
2292
2350
|
});
|
|
2293
|
-
|
|
2351
|
+
this.waitForInitApiPromise = new Promise((resolve) => {
|
|
2294
2352
|
const callbackId = addNewPromise(resolve);
|
|
2295
2353
|
window.parent.postMessage({
|
|
2296
2354
|
type: "set-apis-deployed-mode",
|
|
@@ -2300,27 +2358,26 @@ var ApiManager = class {
|
|
|
2300
2358
|
}
|
|
2301
2359
|
}, "*");
|
|
2302
2360
|
});
|
|
2303
|
-
this.waitForInitApiPromise = waitForInitApiPromise;
|
|
2304
2361
|
}
|
|
2305
2362
|
@action async rerunApiByCallId(callId) {
|
|
2306
|
-
const context = this.callContexts[callId];
|
|
2307
|
-
if (!context) {
|
|
2363
|
+
const context$2 = this.callContexts[callId];
|
|
2364
|
+
if (!context$2) {
|
|
2308
2365
|
console.error(`No call context found for callId: ${callId}`);
|
|
2309
2366
|
throw new Error(`No call context found for callId: ${callId}`);
|
|
2310
2367
|
}
|
|
2311
|
-
if (context.callback) {
|
|
2312
|
-
await context.callback();
|
|
2368
|
+
if (context$2.callback) {
|
|
2369
|
+
await context$2.callback();
|
|
2313
2370
|
return {
|
|
2314
2371
|
data: void 0,
|
|
2315
2372
|
error: void 0
|
|
2316
2373
|
};
|
|
2317
2374
|
}
|
|
2318
2375
|
const result = await this.executeApi({
|
|
2319
|
-
apiId: context.apiId,
|
|
2320
|
-
apiName: context.apiName,
|
|
2321
|
-
path: context.path,
|
|
2322
|
-
inputs: context.inputs,
|
|
2323
|
-
options: context.options,
|
|
2376
|
+
apiId: context$2.apiId,
|
|
2377
|
+
apiName: context$2.apiName,
|
|
2378
|
+
path: context$2.path,
|
|
2379
|
+
inputs: context$2.inputs,
|
|
2380
|
+
options: context$2.options,
|
|
2324
2381
|
callId,
|
|
2325
2382
|
callback: void 0
|
|
2326
2383
|
});
|
|
@@ -2371,8 +2428,8 @@ var ApiManager = class {
|
|
|
2371
2428
|
getCachedHMRExecution(params) {
|
|
2372
2429
|
if (params.callId) return null;
|
|
2373
2430
|
const hmrCallHash = this.getHMRCallHash(params);
|
|
2374
|
-
if (
|
|
2375
|
-
const result =
|
|
2431
|
+
if (api_hmr_tracker_default.shouldSkipRun(hmrCallHash)) {
|
|
2432
|
+
const result = api_hmr_tracker_default.getCachedResult(hmrCallHash);
|
|
2376
2433
|
if (result) return result;
|
|
2377
2434
|
}
|
|
2378
2435
|
return null;
|
|
@@ -2385,7 +2442,7 @@ var ApiManager = class {
|
|
|
2385
2442
|
return cachedResult;
|
|
2386
2443
|
}
|
|
2387
2444
|
const result = await this.executeApiInternal(params);
|
|
2388
|
-
|
|
2445
|
+
api_hmr_tracker_default.setResult(this.getHMRCallHash(params), result);
|
|
2389
2446
|
return result;
|
|
2390
2447
|
}
|
|
2391
2448
|
return this.executeApiInternal(params);
|
|
@@ -2440,10 +2497,10 @@ var ApiManager = class {
|
|
|
2440
2497
|
await this.timedEnsureFilesSynced("executeApi");
|
|
2441
2498
|
const abortController = new AbortController();
|
|
2442
2499
|
(this.runningApiControllers[apiName] ??= /* @__PURE__ */ new Set()).add(abortController);
|
|
2443
|
-
const editMode = isEditMode();
|
|
2444
|
-
const appMode = getAppMode();
|
|
2445
|
-
const orchestratorViewMode = appMode === AppMode.PREVIEW ? OrchestratorViewMode.PREVIEW : appMode === AppMode.PUBLISHED ? OrchestratorViewMode.DEPLOYED : OrchestratorViewMode.EDIT;
|
|
2446
|
-
const isStream = editMode ? true : false;
|
|
2500
|
+
const editMode$1 = isEditMode();
|
|
2501
|
+
const appMode$1 = getAppMode();
|
|
2502
|
+
const orchestratorViewMode = appMode$1 === AppMode.PREVIEW ? OrchestratorViewMode.PREVIEW : appMode$1 === AppMode.PUBLISHED ? OrchestratorViewMode.DEPLOYED : OrchestratorViewMode.EDIT;
|
|
2503
|
+
const isStream = editMode$1 ? true : false;
|
|
2447
2504
|
const authResult = await new Promise((resolve) => {
|
|
2448
2505
|
const callbackId = addNewPromise(resolve);
|
|
2449
2506
|
window.parent.postMessage({
|
|
@@ -2498,9 +2555,9 @@ var ApiManager = class {
|
|
|
2498
2555
|
inputs: finalInputs,
|
|
2499
2556
|
fetchByPath: fetchByPathParams,
|
|
2500
2557
|
options: {
|
|
2501
|
-
includeEventOutputs: editMode,
|
|
2502
|
-
includeEvents: isStream || editMode,
|
|
2503
|
-
includeResolved: editMode
|
|
2558
|
+
includeEventOutputs: editMode$1,
|
|
2559
|
+
includeEvents: isStream || editMode$1,
|
|
2560
|
+
includeResolved: editMode$1
|
|
2504
2561
|
}
|
|
2505
2562
|
},
|
|
2506
2563
|
apiName,
|
|
@@ -2511,7 +2568,7 @@ var ApiManager = class {
|
|
|
2511
2568
|
responseType: isStream ? ApiResponseType.STREAM : ApiResponseType.SYNC,
|
|
2512
2569
|
baseUrl: isStream ? orchestratorUrl + "/stream" : orchestratorUrl,
|
|
2513
2570
|
agents: [],
|
|
2514
|
-
viewMode: editMode ? ViewMode.EDITOR : ViewMode.DEPLOYED,
|
|
2571
|
+
viewMode: editMode$1 ? ViewMode.EDITOR : ViewMode.DEPLOYED,
|
|
2515
2572
|
accessToken: this.accessToken ?? "",
|
|
2516
2573
|
token: this.token ?? "",
|
|
2517
2574
|
traceHeaders,
|
|
@@ -2676,9 +2733,9 @@ var ApiManager = class {
|
|
|
2676
2733
|
} : this.rootStore.profile;
|
|
2677
2734
|
const editModeBranchName = this.rootStore.branchName ?? "main";
|
|
2678
2735
|
const commitId = this.rootStore.commitId;
|
|
2679
|
-
const editMode = isEditMode();
|
|
2680
|
-
const appMode = getAppMode();
|
|
2681
|
-
const viewMode = editMode ? OrchestratorViewMode.EDIT : appMode === AppMode.PREVIEW ? OrchestratorViewMode.PREVIEW : OrchestratorViewMode.DEPLOYED;
|
|
2736
|
+
const editMode$1 = isEditMode();
|
|
2737
|
+
const appMode$1 = getAppMode();
|
|
2738
|
+
const viewMode = editMode$1 ? OrchestratorViewMode.EDIT : appMode$1 === AppMode.PREVIEW ? OrchestratorViewMode.PREVIEW : OrchestratorViewMode.DEPLOYED;
|
|
2682
2739
|
const profileKey = requestProfile?.key ?? "default";
|
|
2683
2740
|
const agentBaseUrl = (() => {
|
|
2684
2741
|
if (this.rootStore.dataPlaneGatewayEnabled) {
|
|
@@ -2707,11 +2764,11 @@ var ApiManager = class {
|
|
|
2707
2764
|
if (exportName) body.exportName = exportName;
|
|
2708
2765
|
if (files.length > 0) body.files = files;
|
|
2709
2766
|
if (requestProfile) body.profile = requestProfile;
|
|
2710
|
-
if (editMode) {
|
|
2767
|
+
if (editMode$1) {
|
|
2711
2768
|
body.branchName = editModeBranchName;
|
|
2712
2769
|
body.includeDiagnostics = true;
|
|
2713
2770
|
}
|
|
2714
|
-
if (!editMode && commitId) body.commitId = commitId;
|
|
2771
|
+
if (!editMode$1 && commitId) body.commitId = commitId;
|
|
2715
2772
|
const integrationIds = (this.rootStore.getApiIntegrations(apiName) ?? []).map((integration) => integration.id);
|
|
2716
2773
|
const authCheckT0 = performance.now();
|
|
2717
2774
|
const authResult = await new Promise((resolve) => {
|
|
@@ -2847,6 +2904,8 @@ var ApiManager = class {
|
|
|
2847
2904
|
});
|
|
2848
2905
|
}
|
|
2849
2906
|
};
|
|
2907
|
+
var api_store_default = ApiManager;
|
|
2908
|
+
|
|
2850
2909
|
//#endregion
|
|
2851
2910
|
//#region src/lib/internal-details/lib/evaluator/sanitize-object.ts
|
|
2852
2911
|
const objectFallbackCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -2868,6 +2927,7 @@ function sanitizedToJS(value) {
|
|
|
2868
2927
|
if (value === null || value === void 0 || typeof value !== "object") return toJS(value);
|
|
2869
2928
|
return toJS(sanitizeObject(value));
|
|
2870
2929
|
}
|
|
2930
|
+
|
|
2871
2931
|
//#endregion
|
|
2872
2932
|
//#region src/edit-mode/mobx-sync/create-patch.ts
|
|
2873
2933
|
const microPatches = (oldValue, newValue, baseStr) => {
|
|
@@ -2888,24 +2948,24 @@ const microPatches = (oldValue, newValue, baseStr) => {
|
|
|
2888
2948
|
}
|
|
2889
2949
|
const diffs = diff(cleanedOldValue, cleanedNewValue);
|
|
2890
2950
|
const basePath = pathStringToArray(baseStr);
|
|
2891
|
-
return diffs.map((diff) => toMobXPatchFromMicroDiff(diff, basePath));
|
|
2951
|
+
return diffs.map((diff$1) => toMobXPatchFromMicroDiff(diff$1, basePath));
|
|
2892
2952
|
};
|
|
2893
2953
|
function isPrimitive(value) {
|
|
2894
2954
|
return value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined";
|
|
2895
2955
|
}
|
|
2896
|
-
function toMobXPatchFromMicroDiff(diff, basePath) {
|
|
2897
|
-
const type = diff.type;
|
|
2898
|
-
const fullPath = [...basePath, ...diff.path];
|
|
2956
|
+
function toMobXPatchFromMicroDiff(diff$1, basePath) {
|
|
2957
|
+
const type = diff$1.type;
|
|
2958
|
+
const fullPath = [...basePath, ...diff$1.path];
|
|
2899
2959
|
switch (type) {
|
|
2900
2960
|
case "CREATE": return {
|
|
2901
2961
|
op: "add",
|
|
2902
2962
|
path: fullPath,
|
|
2903
|
-
value: diff.value
|
|
2963
|
+
value: diff$1.value
|
|
2904
2964
|
};
|
|
2905
2965
|
case "CHANGE": return {
|
|
2906
2966
|
op: "update",
|
|
2907
2967
|
path: fullPath,
|
|
2908
|
-
value: diff.value
|
|
2968
|
+
value: diff$1.value
|
|
2909
2969
|
};
|
|
2910
2970
|
case "REMOVE": return {
|
|
2911
2971
|
op: "remove",
|
|
@@ -2918,11 +2978,12 @@ const removeBindAndReactElements = (value) => {
|
|
|
2918
2978
|
if (!value || typeof value !== "object") return value;
|
|
2919
2979
|
if (isReactElement(value)) return;
|
|
2920
2980
|
if (Array.isArray(value)) return value.map(removeBindAndReactElements);
|
|
2921
|
-
return Object.fromEntries(Object.entries(value).map(([key, value]) => {
|
|
2981
|
+
return Object.fromEntries(Object.entries(value).map(([key, value$1]) => {
|
|
2922
2982
|
if (key === "bind") return [key, void 0];
|
|
2923
|
-
return [key, removeBindAndReactElements(value)];
|
|
2983
|
+
return [key, removeBindAndReactElements(value$1)];
|
|
2924
2984
|
}));
|
|
2925
2985
|
};
|
|
2986
|
+
|
|
2926
2987
|
//#endregion
|
|
2927
2988
|
//#region src/edit-mode/mobx-sync/deep-observe.ts
|
|
2928
2989
|
function buildPath(entry) {
|
|
@@ -2991,13 +3052,13 @@ function deepObserve(target, listener) {
|
|
|
2991
3052
|
if (entry) {
|
|
2992
3053
|
if (entry.parent !== parent || entry.path !== path) throw new Error(`The same observable object cannot appear twice in the same tree, trying to assign it to '${buildPath(parent)}/${path}', but it already exists at '${buildPath(entry.parent)}/${entry.path}'`);
|
|
2993
3054
|
} else {
|
|
2994
|
-
const entry = {
|
|
3055
|
+
const entry$1 = {
|
|
2995
3056
|
parent,
|
|
2996
3057
|
path,
|
|
2997
3058
|
dispose: observe(thing, genericListener)
|
|
2998
3059
|
};
|
|
2999
|
-
entrySet.set(thing, entry);
|
|
3000
|
-
entries(thing).forEach(([key, value]) => observeRecursively(value, entry, "" + key));
|
|
3060
|
+
entrySet.set(thing, entry$1);
|
|
3061
|
+
entries(thing).forEach(([key, value]) => observeRecursively(value, entry$1, "" + key));
|
|
3001
3062
|
}
|
|
3002
3063
|
}
|
|
3003
3064
|
}
|
|
@@ -3015,6 +3076,7 @@ function deepObserve(target, listener) {
|
|
|
3015
3076
|
unobserveRecursively(target);
|
|
3016
3077
|
};
|
|
3017
3078
|
}
|
|
3079
|
+
|
|
3018
3080
|
//#endregion
|
|
3019
3081
|
//#region src/edit-mode/mobx-sync/mobx-editor-sync.ts
|
|
3020
3082
|
/**
|
|
@@ -3120,6 +3182,7 @@ function startEditorSync(options) {
|
|
|
3120
3182
|
disposers.forEach((disposer) => disposer());
|
|
3121
3183
|
};
|
|
3122
3184
|
}
|
|
3185
|
+
|
|
3123
3186
|
//#endregion
|
|
3124
3187
|
//#region src/lib/internal-details/lib/features/type-defs-utils.ts
|
|
3125
3188
|
const analyzePropertyType = (propData, prop) => {
|
|
@@ -3140,6 +3203,7 @@ const analyzePropertyType = (propData, prop) => {
|
|
|
3140
3203
|
else dataType = "unknown";
|
|
3141
3204
|
return dataType;
|
|
3142
3205
|
};
|
|
3206
|
+
|
|
3143
3207
|
//#endregion
|
|
3144
3208
|
//#region src/lib/internal-details/lib/features/component-registry.ts
|
|
3145
3209
|
/**
|
|
@@ -3330,14 +3394,15 @@ var ComponentRegistry = class {
|
|
|
3330
3394
|
const splitPath = path.split(".");
|
|
3331
3395
|
if (splitPath.length === 1) return path;
|
|
3332
3396
|
const [parentKey, _maybeTheRecordKey, ...rest] = splitPath;
|
|
3333
|
-
for (const prop of managedProps) if (prop.path.startsWith(parentKey) && prop.path.includes(
|
|
3397
|
+
for (const prop of managedProps) if (prop.path.startsWith(parentKey) && prop.path.includes(RECORD_PATH_IDENTIFIER) && rest.length > 0 && prop.path.endsWith(rest.join("."))) return [
|
|
3334
3398
|
parentKey,
|
|
3335
|
-
|
|
3399
|
+
RECORD_PATH_IDENTIFIER,
|
|
3336
3400
|
rest.join(".")
|
|
3337
3401
|
].join(".");
|
|
3338
3402
|
return path;
|
|
3339
3403
|
}
|
|
3340
3404
|
};
|
|
3405
|
+
|
|
3341
3406
|
//#endregion
|
|
3342
3407
|
//#region src/lib/internal-details/lib/root-store.ts
|
|
3343
3408
|
/**
|
|
@@ -3407,7 +3472,7 @@ var RootStore = class {
|
|
|
3407
3472
|
_resolveDiscovery;
|
|
3408
3473
|
editorRegisteredCallbacks = [];
|
|
3409
3474
|
constructor() {
|
|
3410
|
-
this.apis = new
|
|
3475
|
+
this.apis = new api_store_default(this);
|
|
3411
3476
|
this.componentRegistry = new ComponentRegistry(this);
|
|
3412
3477
|
this.locationStore = new LocationStore(this);
|
|
3413
3478
|
makeObservable(this, {
|
|
@@ -3539,6 +3604,7 @@ var RootStore = class {
|
|
|
3539
3604
|
}
|
|
3540
3605
|
};
|
|
3541
3606
|
var root_store_default = new RootStore();
|
|
3607
|
+
|
|
3542
3608
|
//#endregion
|
|
3543
3609
|
//#region src/lib/user-facing/assets/images/clark.svg
|
|
3544
3610
|
var _path$1, _path2, _path3, _path4, _path5, _path6, _path7, _defs;
|
|
@@ -3551,7 +3617,7 @@ function _extends$1() {
|
|
|
3551
3617
|
return n;
|
|
3552
3618
|
}, _extends$1.apply(null, arguments);
|
|
3553
3619
|
}
|
|
3554
|
-
var SvgClark = function SvgClark(props) {
|
|
3620
|
+
var SvgClark = function SvgClark$1(props) {
|
|
3555
3621
|
return /* @__PURE__ */ React$1.createElement("svg", _extends$1({
|
|
3556
3622
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3557
3623
|
width: 28,
|
|
@@ -3634,6 +3700,8 @@ var SvgClark = function SvgClark(props) {
|
|
|
3634
3700
|
stopColor: "currentColor"
|
|
3635
3701
|
})))));
|
|
3636
3702
|
};
|
|
3703
|
+
var clark_default = SvgClark;
|
|
3704
|
+
|
|
3637
3705
|
//#endregion
|
|
3638
3706
|
//#region src/lib/internal-details/internal-components/common.ts
|
|
3639
3707
|
const ErrorIconContainer = styled.div`
|
|
@@ -3666,7 +3734,7 @@ const ErrorIconContainer = styled.div`
|
|
|
3666
3734
|
}
|
|
3667
3735
|
}
|
|
3668
3736
|
`;
|
|
3669
|
-
const StyledClarkIcon = styled(
|
|
3737
|
+
const StyledClarkIcon = styled(clark_default)`
|
|
3670
3738
|
width: 54px;
|
|
3671
3739
|
height: 54px;
|
|
3672
3740
|
color: white;
|
|
@@ -3795,6 +3863,7 @@ const ActionsContainer = styled.div`
|
|
|
3795
3863
|
align-items: center;
|
|
3796
3864
|
justify-content: center;
|
|
3797
3865
|
`;
|
|
3866
|
+
|
|
3798
3867
|
//#endregion
|
|
3799
3868
|
//#region src/edit-mode/assets/ai-stars.svg
|
|
3800
3869
|
var _path;
|
|
@@ -3807,7 +3876,7 @@ function _extends() {
|
|
|
3807
3876
|
return n;
|
|
3808
3877
|
}, _extends.apply(null, arguments);
|
|
3809
3878
|
}
|
|
3810
|
-
var SvgAiStars = function SvgAiStars(props) {
|
|
3879
|
+
var SvgAiStars = function SvgAiStars$1(props) {
|
|
3811
3880
|
return /* @__PURE__ */ React$1.createElement("svg", _extends({
|
|
3812
3881
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3813
3882
|
width: 13,
|
|
@@ -3820,6 +3889,8 @@ var SvgAiStars = function SvgAiStars(props) {
|
|
|
3820
3889
|
clipRule: "evenodd"
|
|
3821
3890
|
})));
|
|
3822
3891
|
};
|
|
3892
|
+
var ai_stars_default = SvgAiStars;
|
|
3893
|
+
|
|
3823
3894
|
//#endregion
|
|
3824
3895
|
//#region src/lib/internal-details/internal-components/fix-with-clark-button.tsx
|
|
3825
3896
|
const MAX_STACK_FRAMES = 10;
|
|
@@ -3873,15 +3944,17 @@ function FixWithClarkButton({ identifier, error, onClick }) {
|
|
|
3873
3944
|
return /* @__PURE__ */ jsxs(FixWithClarkButtonContainer, {
|
|
3874
3945
|
onClick: handleFixWithAi,
|
|
3875
3946
|
disabled: isAiEditing,
|
|
3876
|
-
children: [/* @__PURE__ */ jsx(
|
|
3947
|
+
children: [/* @__PURE__ */ jsx(ai_stars_default, {}), " Fix with Clark"]
|
|
3877
3948
|
});
|
|
3878
3949
|
}
|
|
3950
|
+
|
|
3879
3951
|
//#endregion
|
|
3880
3952
|
//#region src/lib/internal-details/css-constants.ts
|
|
3881
3953
|
const CSS_CLASSES = {
|
|
3882
3954
|
SUSPENSE_FALLBACK: "sb-suspense-fallback",
|
|
3883
3955
|
ANCHOR_NAME: "sb-anchor-name"
|
|
3884
3956
|
};
|
|
3957
|
+
|
|
3885
3958
|
//#endregion
|
|
3886
3959
|
//#region src/lib/internal-details/lib/suspense/suspense-fallback.tsx
|
|
3887
3960
|
const shimmerAnimation = keyframes`
|
|
@@ -3925,6 +3998,7 @@ function SuspenseFallback({ style, className, noBorderRadius }) {
|
|
|
3925
3998
|
"data-test": "suspense-fallback"
|
|
3926
3999
|
});
|
|
3927
4000
|
}
|
|
4001
|
+
|
|
3928
4002
|
//#endregion
|
|
3929
4003
|
//#region src/lib/user-facing/component-base/error-boundary.tsx
|
|
3930
4004
|
const ErrorBoundaryContainer = styled.div`
|
|
@@ -4048,6 +4122,8 @@ var ErrorBoundary = class extends Component {
|
|
|
4048
4122
|
return this.props.children;
|
|
4049
4123
|
}
|
|
4050
4124
|
};
|
|
4125
|
+
var error_boundary_default = ErrorBoundary;
|
|
4126
|
+
|
|
4051
4127
|
//#endregion
|
|
4052
4128
|
//#region src/lib/utils/widget-wrapper-naming.ts
|
|
4053
4129
|
const getWidgetAnchorName = (selectorId) => {
|
|
@@ -4056,12 +4132,14 @@ const getWidgetAnchorName = (selectorId) => {
|
|
|
4056
4132
|
const getWidgetRectAnchorName = (selectorId) => {
|
|
4057
4133
|
return `--widget-rect-${selectorId}`;
|
|
4058
4134
|
};
|
|
4135
|
+
|
|
4059
4136
|
//#endregion
|
|
4060
4137
|
//#region src/edit-mode/edit-wrapper.tsx
|
|
4061
4138
|
if (typeof window !== "undefined" && typeof document.documentElement !== "undefined" && !("anchorName" in document.documentElement.style)) polyfill();
|
|
4062
4139
|
const createAnchorNameStyle = (props) => {
|
|
4063
4140
|
return { "--anchor-name": getWidgetAnchorName(props.selectorId) };
|
|
4064
4141
|
};
|
|
4142
|
+
|
|
4065
4143
|
//#endregion
|
|
4066
4144
|
//#region src/edit-mode/instance-tracker.ts
|
|
4067
4145
|
/**
|
|
@@ -4087,6 +4165,7 @@ var InstanceTracker = class {
|
|
|
4087
4165
|
}
|
|
4088
4166
|
};
|
|
4089
4167
|
const instanceTracker = new InstanceTracker();
|
|
4168
|
+
|
|
4090
4169
|
//#endregion
|
|
4091
4170
|
//#region src/edit-mode/jsx-wrapper.tsx
|
|
4092
4171
|
const JSXContext = React.createContext({
|
|
@@ -4096,7 +4175,7 @@ const JSXContext = React.createContext({
|
|
|
4096
4175
|
const makeWrappedComponent = (type) => {
|
|
4097
4176
|
const isTag = typeof type === "string";
|
|
4098
4177
|
const isRegisteredSbComponent = root_store_default.componentRegistry.hasComponent(type);
|
|
4099
|
-
const Component = React.forwardRef((props, ref) => {
|
|
4178
|
+
const Component$1 = React.forwardRef((props, ref) => {
|
|
4100
4179
|
const { selectorId: parentSelectorId } = useJSXContext();
|
|
4101
4180
|
const sourceId = props[SOURCE_ID_ATTRIBUTE];
|
|
4102
4181
|
const noSelect = props[NO_SELECT_ATTRIBUTE];
|
|
@@ -4152,20 +4231,20 @@ const makeWrappedComponent = (type) => {
|
|
|
4152
4231
|
});
|
|
4153
4232
|
return /* @__PURE__ */ jsx(JSXContext.Provider, {
|
|
4154
4233
|
value: jsxContext,
|
|
4155
|
-
children: /* @__PURE__ */ jsx(
|
|
4234
|
+
children: /* @__PURE__ */ jsx(error_boundary_default, { children: element })
|
|
4156
4235
|
});
|
|
4157
4236
|
});
|
|
4158
4237
|
try {
|
|
4159
|
-
Component.displayName = typeof type === "string" ? type : type.displayName || type.name || "Component";
|
|
4238
|
+
Component$1.displayName = typeof type === "string" ? type : type.displayName || type.name || "Component";
|
|
4160
4239
|
} catch (e) {
|
|
4161
4240
|
console.error("Error setting displayName", e);
|
|
4162
4241
|
}
|
|
4163
|
-
return Component;
|
|
4242
|
+
return Component$1;
|
|
4164
4243
|
};
|
|
4165
4244
|
const useJSXContext = () => {
|
|
4166
4245
|
return React.useContext(JSXContext);
|
|
4167
4246
|
};
|
|
4168
|
-
//#endregion
|
|
4169
|
-
export { useSuperblocksProfiles as A, isEditMode as B, rejectById as C, useSuperblocksContext as D, getAppMode as E, colors as F, createPropertiesPanelDefinition as G, Prop as H, editorBridge as I, getEditStore as K, iframeMessageHandler as L, embedStore as M, generateId as N, useSuperblocksDataTags as O, sendNotification as P, isEmbeddedBySuperblocksFirstParty as R, addNewPromise as S, SuperblocksContextProvider as T, PropsCategory as U, createManagedPropsList as V, Section as W, root_store_default as _, FixWithClarkButton as a, getContextFromTraceHeaders as b, ErrorContent as c, ErrorMessage as d, ErrorStack as f, StyledClarkIcon as g, SecondaryButton as h, getWidgetRectAnchorName as i, useSuperblocksUser as j, useSuperblocksGroups as k, ErrorDetails as l, ErrorTitle as m, useJSXContext as n, ActionsContainer as o, ErrorSummary as p, getWidgetAnchorName as r, ErrorContainer as s, makeWrappedComponent as t, ErrorIconContainer as u, startEditorSync as v, resolveById as w, tracker as x, createIframeSpan as y, sendMessageImmediately as z };
|
|
4170
4247
|
|
|
4171
|
-
//#
|
|
4248
|
+
//#endregion
|
|
4249
|
+
export { useSuperblocksProfiles as A, isEditMode as B, rejectById as C, useSuperblocksContext as D, getAppMode as E, colors as F, createPropertiesPanelDefinition as G, Prop as H, editorBridge as I, getEditStore as K, iframeMessageHandler as L, embedStore as M, generateId as N, useSuperblocksDataTags as O, sendNotification as P, isEmbeddedBySuperblocksFirstParty as R, addNewPromise as S, SuperblocksContextProvider as T, PropsCategory as U, createManagedPropsList as V, Section as W, root_store_default as _, FixWithClarkButton as a, getContextFromTraceHeaders as b, ErrorContent as c, ErrorMessage as d, ErrorStack as f, StyledClarkIcon as g, SecondaryButton as h, getWidgetRectAnchorName as i, useSuperblocksUser as j, useSuperblocksGroups as k, ErrorDetails as l, ErrorTitle as m, useJSXContext as n, ActionsContainer as o, ErrorSummary as p, getWidgetAnchorName as r, ErrorContainer as s, makeWrappedComponent as t, ErrorIconContainer as u, startEditorSync as v, resolveById as w, api_hmr_tracker_default as x, createIframeSpan as y, sendMessageImmediately as z };
|
|
4250
|
+
//# sourceMappingURL=jsx-wrapper-BLrvyiEf.js.map
|