@walkeros/explorer 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/STYLE.md +240 -136
- package/dist/components/atoms/code.d.ts +4 -1
- package/dist/components/atoms/code.d.ts.map +1 -1
- package/dist/components/atoms/code.js +31 -10
- package/dist/components/atoms/code.js.map +1 -1
- package/dist/components/molecules/code-box.d.ts +2 -1
- package/dist/components/molecules/code-box.d.ts.map +1 -1
- package/dist/components/molecules/code-box.js +32 -6
- package/dist/components/molecules/code-box.js.map +1 -1
- package/dist/components/molecules/code-box.stories.d.ts +13 -0
- package/dist/components/molecules/code-box.stories.d.ts.map +1 -1
- package/dist/components/molecules/code-box.stories.js +76 -0
- package/dist/components/molecules/code-box.stories.js.map +1 -1
- package/dist/components/molecules/code-snippet.stories.d.ts +11 -0
- package/dist/components/molecules/code-snippet.stories.d.ts.map +1 -1
- package/dist/components/molecules/code-snippet.stories.js +38 -0
- package/dist/components/molecules/code-snippet.stories.js.map +1 -1
- package/dist/components/molecules/flow-selector.js +1 -1
- package/dist/components/molecules/flow-selector.js.map +1 -1
- package/dist/components/molecules/flow-selector.stories.js +4 -4
- package/dist/components/molecules/flow-selector.stories.js.map +1 -1
- package/dist/components/molecules/split-button.stories.js +6 -6
- package/dist/components/molecules/split-button.stories.js.map +1 -1
- package/dist/index.d.cts +23 -34
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +342 -294
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +46 -91
- package/dist/themes/lighthouse.d.ts.map +1 -1
- package/dist/themes/lighthouse.js +1 -0
- package/dist/themes/lighthouse.js.map +1 -1
- package/dist/themes/palenight.d.ts.map +1 -1
- package/dist/themes/palenight.js +1 -0
- package/dist/themes/palenight.js.map +1 -1
- package/dist/utils/format-code.d.ts.map +1 -1
- package/dist/utils/format-code.js +11 -2
- package/dist/utils/format-code.js.map +1 -1
- package/dist/utils/monaco-decorators.d.ts.map +1 -1
- package/dist/utils/monaco-decorators.js +2 -0
- package/dist/utils/monaco-decorators.js.map +1 -1
- package/dist/utils/monaco-json-schema.d.ts +24 -0
- package/dist/utils/monaco-json-schema.d.ts.map +1 -0
- package/dist/utils/monaco-json-schema.js +65 -0
- package/dist/utils/monaco-json-schema.js.map +1 -0
- package/package.json +1 -1
- package/dist/components/molecules/flow-deploy-panel.d.ts +0 -31
- package/dist/components/molecules/flow-deploy-panel.d.ts.map +0 -1
- package/dist/components/molecules/flow-deploy-panel.js +0 -72
- package/dist/components/molecules/flow-deploy-panel.js.map +0 -1
- package/dist/components/molecules/flow-deploy-panel.stories.d.ts +0 -40
- package/dist/components/molecules/flow-deploy-panel.stories.d.ts.map +0 -1
- package/dist/components/molecules/flow-deploy-panel.stories.js +0 -145
- package/dist/components/molecules/flow-deploy-panel.stories.js.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
} from "./chunk-YKT4D7MG.mjs";
|
|
9
9
|
|
|
10
10
|
// src/components/demos/MappingDemo.tsx
|
|
11
|
-
import { useState as useState6, useCallback as useCallback5, useEffect as
|
|
11
|
+
import { useState as useState6, useCallback as useCallback5, useEffect as useEffect5 } from "react";
|
|
12
12
|
|
|
13
13
|
// src/components/molecules/code-box.tsx
|
|
14
|
-
import { useState as useState4, useCallback as useCallback3 } from "react";
|
|
14
|
+
import { useState as useState4, useCallback as useCallback3, useRef as useRef4, useEffect as useEffect3 } from "react";
|
|
15
15
|
|
|
16
16
|
// src/components/atoms/box.tsx
|
|
17
17
|
import { useState } from "react";
|
|
@@ -302,6 +302,7 @@ var palenightTheme = {
|
|
|
302
302
|
"editorStickyScroll.border": "#676E9540",
|
|
303
303
|
"editorStickyScrollHover.background": "#292d3e",
|
|
304
304
|
"editorStickyScroll.shadow": "#00000000",
|
|
305
|
+
"editorStickyScrollGutter.background": "#292d3e",
|
|
305
306
|
// Hover Widgets - Tooltips and hover information
|
|
306
307
|
"editorHoverWidget.background": "#1e1e2e",
|
|
307
308
|
"editorHoverWidget.border": "#676E95",
|
|
@@ -515,6 +516,7 @@ var lighthouseTheme = {
|
|
|
515
516
|
"editorStickyScroll.border": "#E1E4E8",
|
|
516
517
|
"editorStickyScrollHover.background": "#ffffff",
|
|
517
518
|
"editorStickyScroll.shadow": "#00000000",
|
|
519
|
+
"editorStickyScrollGutter.background": "#ffffff",
|
|
518
520
|
// Hover Widgets - Tooltips and hover information
|
|
519
521
|
"editorHoverWidget.background": "#F6F8FA",
|
|
520
522
|
"editorHoverWidget.border": "#E1E4E8",
|
|
@@ -577,10 +579,14 @@ var DATA_ELB_PATTERNS = [
|
|
|
577
579
|
// data-elb (not followed by hyphen)
|
|
578
580
|
/\bdata-elbaction\b/g,
|
|
579
581
|
// data-elbaction
|
|
582
|
+
/\bdata-elbactions\b/g,
|
|
583
|
+
// data-elbactions
|
|
580
584
|
/\bdata-elbglobals\b/g,
|
|
581
585
|
// data-elbglobals
|
|
582
586
|
/\bdata-elbcontext\b/g,
|
|
583
587
|
// data-elbcontext
|
|
588
|
+
/\bdata-elblink\b/g,
|
|
589
|
+
// data-elblink
|
|
584
590
|
/\bdata-elb-[\w-]+\b/g
|
|
585
591
|
// data-elb-* (property attributes)
|
|
586
592
|
];
|
|
@@ -764,6 +770,35 @@ function registerFormatters(monacoInstance) {
|
|
|
764
770
|
});
|
|
765
771
|
}
|
|
766
772
|
|
|
773
|
+
// src/utils/monaco-json-schema.ts
|
|
774
|
+
import { json } from "monaco-editor";
|
|
775
|
+
var schemaRegistry = /* @__PURE__ */ new Map();
|
|
776
|
+
var idCounter = 0;
|
|
777
|
+
function generateModelPath() {
|
|
778
|
+
return `inmemory://walkeros/json-${++idCounter}.json`;
|
|
779
|
+
}
|
|
780
|
+
function registerJsonSchema(modelPath, schema) {
|
|
781
|
+
schemaRegistry.set(modelPath, {
|
|
782
|
+
uri: `schema://walkeros/${modelPath}`,
|
|
783
|
+
fileMatch: [modelPath],
|
|
784
|
+
schema
|
|
785
|
+
});
|
|
786
|
+
applySchemas();
|
|
787
|
+
}
|
|
788
|
+
function unregisterJsonSchema(modelPath) {
|
|
789
|
+
schemaRegistry.delete(modelPath);
|
|
790
|
+
applySchemas();
|
|
791
|
+
}
|
|
792
|
+
function applySchemas() {
|
|
793
|
+
json.jsonDefaults.setDiagnosticsOptions({
|
|
794
|
+
validate: true,
|
|
795
|
+
schemaValidation: "error",
|
|
796
|
+
schemaRequest: "ignore",
|
|
797
|
+
enableSchemaRequest: false,
|
|
798
|
+
schemas: Array.from(schemaRegistry.values())
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
|
|
767
802
|
// src/hooks/useMonacoHeight.ts
|
|
768
803
|
import { useState as useState2, useRef as useRef2, useCallback } from "react";
|
|
769
804
|
function useMonacoHeight({
|
|
@@ -840,6 +875,7 @@ function Code({
|
|
|
840
875
|
onChange,
|
|
841
876
|
disabled = false,
|
|
842
877
|
lineNumbers = false,
|
|
878
|
+
minimap = false,
|
|
843
879
|
folding = false,
|
|
844
880
|
wordWrap = false,
|
|
845
881
|
className,
|
|
@@ -849,7 +885,8 @@ function Code({
|
|
|
849
885
|
fontSize = 13,
|
|
850
886
|
packages,
|
|
851
887
|
sticky = true,
|
|
852
|
-
ide = false
|
|
888
|
+
ide = false,
|
|
889
|
+
jsonSchema
|
|
853
890
|
}) {
|
|
854
891
|
const [isMounted, setIsMounted] = useState3(false);
|
|
855
892
|
const [monacoTheme, setMonacoTheme] = useState3("vs-light");
|
|
@@ -941,6 +978,19 @@ function Code({
|
|
|
941
978
|
resizeObserver.disconnect();
|
|
942
979
|
};
|
|
943
980
|
}, []);
|
|
981
|
+
const modelPathRef = useRef3(null);
|
|
982
|
+
if (jsonSchema && !modelPathRef.current) {
|
|
983
|
+
modelPathRef.current = generateModelPath();
|
|
984
|
+
}
|
|
985
|
+
useEffect2(() => {
|
|
986
|
+
if (!jsonSchema || !modelPathRef.current) return;
|
|
987
|
+
registerJsonSchema(modelPathRef.current, jsonSchema);
|
|
988
|
+
return () => {
|
|
989
|
+
if (modelPathRef.current) {
|
|
990
|
+
unregisterJsonSchema(modelPathRef.current);
|
|
991
|
+
}
|
|
992
|
+
};
|
|
993
|
+
}, [jsonSchema]);
|
|
944
994
|
const handleChange = (value) => {
|
|
945
995
|
if (onChange && value !== void 0) {
|
|
946
996
|
onChange(value);
|
|
@@ -948,10 +998,6 @@ function Code({
|
|
|
948
998
|
};
|
|
949
999
|
const handleBeforeMount = async (monaco) => {
|
|
950
1000
|
monacoRef.current = monaco;
|
|
951
|
-
if (beforeMount) {
|
|
952
|
-
beforeMount(monaco);
|
|
953
|
-
return;
|
|
954
|
-
}
|
|
955
1001
|
registerAllThemes(monaco);
|
|
956
1002
|
registerFormatters(monaco);
|
|
957
1003
|
if (packages && packages.length > 0) {
|
|
@@ -968,6 +1014,9 @@ function Code({
|
|
|
968
1014
|
const isDark = dataTheme === "dark" || dataTheme === null && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
969
1015
|
const themeName = isDark ? "elbTheme-dark" : "elbTheme-light";
|
|
970
1016
|
monaco.editor.setTheme(themeName);
|
|
1017
|
+
if (beforeMount) {
|
|
1018
|
+
beforeMount(monaco);
|
|
1019
|
+
}
|
|
971
1020
|
};
|
|
972
1021
|
const MonacoEditor = Editor;
|
|
973
1022
|
const handleEditorMount = (monacoEditor) => {
|
|
@@ -1008,10 +1057,11 @@ function Code({
|
|
|
1008
1057
|
beforeMount: handleBeforeMount,
|
|
1009
1058
|
onMount: handleEditorMount,
|
|
1010
1059
|
theme: monacoTheme,
|
|
1060
|
+
path: modelPathRef.current || void 0,
|
|
1011
1061
|
options: {
|
|
1012
1062
|
readOnly: disabled || !onChange,
|
|
1013
1063
|
readOnlyMessage: { value: "" },
|
|
1014
|
-
minimap: { enabled:
|
|
1064
|
+
minimap: { enabled: minimap },
|
|
1015
1065
|
fontSize,
|
|
1016
1066
|
lineHeight: Math.round(fontSize * 1.5),
|
|
1017
1067
|
padding: 0,
|
|
@@ -1030,8 +1080,8 @@ function Code({
|
|
|
1030
1080
|
fixedOverflowWidgets: true,
|
|
1031
1081
|
overviewRulerLanes: 0,
|
|
1032
1082
|
renderLineHighlight: "none",
|
|
1033
|
-
renderValidationDecorations: ide ? "editable" : "off",
|
|
1034
|
-
hover: { enabled: ide },
|
|
1083
|
+
renderValidationDecorations: ide || jsonSchema ? "editable" : "off",
|
|
1084
|
+
hover: { enabled: ide || !!jsonSchema },
|
|
1035
1085
|
"semanticHighlighting.enabled": ide,
|
|
1036
1086
|
showDeprecated: ide,
|
|
1037
1087
|
showUnused: ide,
|
|
@@ -1065,8 +1115,7 @@ function Code({
|
|
|
1065
1115
|
// Don't select line when clicking line numbers
|
|
1066
1116
|
wordBasedSuggestions: "off",
|
|
1067
1117
|
// Reduce auto-completion interference
|
|
1068
|
-
quickSuggestions: false,
|
|
1069
|
-
// Disable quick suggestions popup
|
|
1118
|
+
quickSuggestions: jsonSchema ? { strings: true, other: true, comments: false } : false,
|
|
1070
1119
|
stickyScroll: { enabled: sticky }
|
|
1071
1120
|
}
|
|
1072
1121
|
}
|
|
@@ -1074,7 +1123,7 @@ function Code({
|
|
|
1074
1123
|
}
|
|
1075
1124
|
|
|
1076
1125
|
// src/components/molecules/code-box.tsx
|
|
1077
|
-
import {
|
|
1126
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1078
1127
|
function CodeBox({
|
|
1079
1128
|
// Code props (single code mode)
|
|
1080
1129
|
code,
|
|
@@ -1094,8 +1143,9 @@ function CodeBox({
|
|
|
1094
1143
|
// Visual
|
|
1095
1144
|
showTrafficLights = false,
|
|
1096
1145
|
// Actions
|
|
1097
|
-
showCopy =
|
|
1146
|
+
showCopy = true,
|
|
1098
1147
|
showFormat = false,
|
|
1148
|
+
showSettings = false,
|
|
1099
1149
|
// Layout
|
|
1100
1150
|
footer,
|
|
1101
1151
|
height,
|
|
@@ -1104,6 +1154,24 @@ function CodeBox({
|
|
|
1104
1154
|
...codeProps
|
|
1105
1155
|
}) {
|
|
1106
1156
|
const [copied, setCopied] = useState4(false);
|
|
1157
|
+
const [showSettingsPanel, setShowSettingsPanel] = useState4(false);
|
|
1158
|
+
const [settings, setSettings] = useState4({
|
|
1159
|
+
lineNumbers: false,
|
|
1160
|
+
minimap: false,
|
|
1161
|
+
wordWrap: false,
|
|
1162
|
+
sticky: true
|
|
1163
|
+
});
|
|
1164
|
+
const settingsRef = useRef4(null);
|
|
1165
|
+
useEffect3(() => {
|
|
1166
|
+
if (!showSettingsPanel) return;
|
|
1167
|
+
const handleClickOutside = (e) => {
|
|
1168
|
+
if (settingsRef.current && !settingsRef.current.contains(e.target)) {
|
|
1169
|
+
setShowSettingsPanel(false);
|
|
1170
|
+
}
|
|
1171
|
+
};
|
|
1172
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1173
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1174
|
+
}, [showSettingsPanel]);
|
|
1107
1175
|
const [currentTabId, setCurrentTabId] = useState4(
|
|
1108
1176
|
controlledActiveTab ?? defaultTab ?? tabs?.[0]?.id ?? ""
|
|
1109
1177
|
);
|
|
@@ -1136,7 +1204,13 @@ function CodeBox({
|
|
|
1136
1204
|
} catch (e) {
|
|
1137
1205
|
}
|
|
1138
1206
|
};
|
|
1139
|
-
const
|
|
1207
|
+
const settingsProps = {
|
|
1208
|
+
lineNumbers: settings.lineNumbers,
|
|
1209
|
+
minimap: settings.minimap,
|
|
1210
|
+
wordWrap: settings.wordWrap,
|
|
1211
|
+
sticky: settings.sticky
|
|
1212
|
+
};
|
|
1213
|
+
const actions = /* @__PURE__ */ jsxs3("div", { style: { display: "flex", gap: "4px", alignItems: "center" }, children: [
|
|
1140
1214
|
showFormat && !disabled && currentLanguage === "json" && /* @__PURE__ */ jsx4(
|
|
1141
1215
|
"button",
|
|
1142
1216
|
{
|
|
@@ -1155,8 +1229,10 @@ function CodeBox({
|
|
|
1155
1229
|
strokeLinecap: "round",
|
|
1156
1230
|
strokeLinejoin: "round",
|
|
1157
1231
|
children: [
|
|
1158
|
-
/* @__PURE__ */ jsx4("
|
|
1159
|
-
/* @__PURE__ */ jsx4("
|
|
1232
|
+
/* @__PURE__ */ jsx4("line", { x1: "3", y1: "5", x2: "16", y2: "5" }),
|
|
1233
|
+
/* @__PURE__ */ jsx4("line", { x1: "7", y1: "10", x2: "20", y2: "10" }),
|
|
1234
|
+
/* @__PURE__ */ jsx4("line", { x1: "7", y1: "15", x2: "18", y2: "15" }),
|
|
1235
|
+
/* @__PURE__ */ jsx4("line", { x1: "3", y1: "20", x2: "12", y2: "20" })
|
|
1160
1236
|
]
|
|
1161
1237
|
}
|
|
1162
1238
|
)
|
|
@@ -1199,7 +1275,80 @@ function CodeBox({
|
|
|
1199
1275
|
}
|
|
1200
1276
|
)
|
|
1201
1277
|
}
|
|
1202
|
-
)
|
|
1278
|
+
),
|
|
1279
|
+
showSettings && /* @__PURE__ */ jsxs3("div", { ref: settingsRef, style: { position: "relative" }, children: [
|
|
1280
|
+
/* @__PURE__ */ jsx4(
|
|
1281
|
+
"button",
|
|
1282
|
+
{
|
|
1283
|
+
className: `elb-explorer-btn${showSettingsPanel ? " active" : ""}`,
|
|
1284
|
+
onClick: () => setShowSettingsPanel(!showSettingsPanel),
|
|
1285
|
+
title: "Editor settings",
|
|
1286
|
+
children: /* @__PURE__ */ jsxs3(
|
|
1287
|
+
"svg",
|
|
1288
|
+
{
|
|
1289
|
+
width: "14",
|
|
1290
|
+
height: "14",
|
|
1291
|
+
viewBox: "0 0 24 24",
|
|
1292
|
+
fill: "none",
|
|
1293
|
+
stroke: "currentColor",
|
|
1294
|
+
strokeWidth: "2",
|
|
1295
|
+
strokeLinecap: "round",
|
|
1296
|
+
strokeLinejoin: "round",
|
|
1297
|
+
children: [
|
|
1298
|
+
/* @__PURE__ */ jsx4("circle", { cx: "12", cy: "12", r: "3" }),
|
|
1299
|
+
/* @__PURE__ */ jsx4("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" })
|
|
1300
|
+
]
|
|
1301
|
+
}
|
|
1302
|
+
)
|
|
1303
|
+
}
|
|
1304
|
+
),
|
|
1305
|
+
showSettingsPanel && /* @__PURE__ */ jsxs3("div", { className: "elb-codebox-settings", children: [
|
|
1306
|
+
/* @__PURE__ */ jsxs3("label", { className: "elb-codebox-settings-option", children: [
|
|
1307
|
+
/* @__PURE__ */ jsx4(
|
|
1308
|
+
"input",
|
|
1309
|
+
{
|
|
1310
|
+
type: "checkbox",
|
|
1311
|
+
checked: settings.lineNumbers,
|
|
1312
|
+
onChange: () => setSettings((s) => ({ ...s, lineNumbers: !s.lineNumbers }))
|
|
1313
|
+
}
|
|
1314
|
+
),
|
|
1315
|
+
"Line numbers"
|
|
1316
|
+
] }),
|
|
1317
|
+
/* @__PURE__ */ jsxs3("label", { className: "elb-codebox-settings-option", children: [
|
|
1318
|
+
/* @__PURE__ */ jsx4(
|
|
1319
|
+
"input",
|
|
1320
|
+
{
|
|
1321
|
+
type: "checkbox",
|
|
1322
|
+
checked: settings.minimap,
|
|
1323
|
+
onChange: () => setSettings((s) => ({ ...s, minimap: !s.minimap }))
|
|
1324
|
+
}
|
|
1325
|
+
),
|
|
1326
|
+
"Minimap"
|
|
1327
|
+
] }),
|
|
1328
|
+
/* @__PURE__ */ jsxs3("label", { className: "elb-codebox-settings-option", children: [
|
|
1329
|
+
/* @__PURE__ */ jsx4(
|
|
1330
|
+
"input",
|
|
1331
|
+
{
|
|
1332
|
+
type: "checkbox",
|
|
1333
|
+
checked: settings.wordWrap,
|
|
1334
|
+
onChange: () => setSettings((s) => ({ ...s, wordWrap: !s.wordWrap }))
|
|
1335
|
+
}
|
|
1336
|
+
),
|
|
1337
|
+
"Word wrap"
|
|
1338
|
+
] }),
|
|
1339
|
+
/* @__PURE__ */ jsxs3("label", { className: "elb-codebox-settings-option", children: [
|
|
1340
|
+
/* @__PURE__ */ jsx4(
|
|
1341
|
+
"input",
|
|
1342
|
+
{
|
|
1343
|
+
type: "checkbox",
|
|
1344
|
+
checked: settings.sticky,
|
|
1345
|
+
onChange: () => setSettings((s) => ({ ...s, sticky: !s.sticky }))
|
|
1346
|
+
}
|
|
1347
|
+
),
|
|
1348
|
+
"Sticky scroll"
|
|
1349
|
+
] })
|
|
1350
|
+
] })
|
|
1351
|
+
] })
|
|
1203
1352
|
] });
|
|
1204
1353
|
const autoHeightClass = autoHeight ? "elb-box--auto-height" : "";
|
|
1205
1354
|
const boxClassName = `${autoHeightClass} ${className || ""}`.trim();
|
|
@@ -1214,7 +1363,8 @@ function CodeBox({
|
|
|
1214
1363
|
onChange,
|
|
1215
1364
|
disabled,
|
|
1216
1365
|
autoHeight,
|
|
1217
|
-
...codeProps
|
|
1366
|
+
...codeProps,
|
|
1367
|
+
...settingsProps
|
|
1218
1368
|
}
|
|
1219
1369
|
)
|
|
1220
1370
|
}));
|
|
@@ -1241,7 +1391,8 @@ function CodeBox({
|
|
|
1241
1391
|
onChange,
|
|
1242
1392
|
disabled,
|
|
1243
1393
|
autoHeight,
|
|
1244
|
-
...codeProps
|
|
1394
|
+
...codeProps,
|
|
1395
|
+
...settingsProps
|
|
1245
1396
|
}
|
|
1246
1397
|
)
|
|
1247
1398
|
}
|
|
@@ -1250,9 +1401,9 @@ function CodeBox({
|
|
|
1250
1401
|
|
|
1251
1402
|
// src/components/atoms/grid.tsx
|
|
1252
1403
|
import {
|
|
1253
|
-
useRef as
|
|
1404
|
+
useRef as useRef5,
|
|
1254
1405
|
useState as useState5,
|
|
1255
|
-
useEffect as
|
|
1406
|
+
useEffect as useEffect4,
|
|
1256
1407
|
useCallback as useCallback4,
|
|
1257
1408
|
useMemo
|
|
1258
1409
|
} from "react";
|
|
@@ -1267,11 +1418,11 @@ function Grid({
|
|
|
1267
1418
|
showScrollButtons = true,
|
|
1268
1419
|
className = ""
|
|
1269
1420
|
}) {
|
|
1270
|
-
const gridRef =
|
|
1421
|
+
const gridRef = useRef5(null);
|
|
1271
1422
|
const [canScrollLeft, setCanScrollLeft] = useState5(false);
|
|
1272
1423
|
const [canScrollRight, setCanScrollRight] = useState5(false);
|
|
1273
1424
|
const [boxHeights, setBoxHeights] = useState5(/* @__PURE__ */ new Map());
|
|
1274
|
-
const boxIdCounter =
|
|
1425
|
+
const boxIdCounter = useRef5(0);
|
|
1275
1426
|
const getBoxId = useCallback4(() => boxIdCounter.current++, []);
|
|
1276
1427
|
const registerBox = useCallback4((id, height) => {
|
|
1277
1428
|
setBoxHeights((prev) => {
|
|
@@ -1344,7 +1495,7 @@ function Grid({
|
|
|
1344
1495
|
const scrollAmount = gridRef.current.clientWidth * 0.8;
|
|
1345
1496
|
gridRef.current.scrollBy({ left: scrollAmount, behavior: "smooth" });
|
|
1346
1497
|
};
|
|
1347
|
-
|
|
1498
|
+
useEffect4(() => {
|
|
1348
1499
|
const el = gridRef.current;
|
|
1349
1500
|
if (!el || !showScrollButtons) return;
|
|
1350
1501
|
updateScrollState();
|
|
@@ -1407,7 +1558,7 @@ function MappingDemo({
|
|
|
1407
1558
|
);
|
|
1408
1559
|
}
|
|
1409
1560
|
}, [input, config, fn]);
|
|
1410
|
-
|
|
1561
|
+
useEffect5(() => {
|
|
1411
1562
|
const timeoutId = setTimeout(updateOutput, 500);
|
|
1412
1563
|
return () => clearTimeout(timeoutId);
|
|
1413
1564
|
}, [updateOutput]);
|
|
@@ -1448,7 +1599,7 @@ function MappingDemo({
|
|
|
1448
1599
|
}
|
|
1449
1600
|
|
|
1450
1601
|
// src/components/demos/MappingCode.tsx
|
|
1451
|
-
import { useState as useState7, useCallback as useCallback6, useEffect as
|
|
1602
|
+
import { useState as useState7, useCallback as useCallback6, useEffect as useEffect6 } from "react";
|
|
1452
1603
|
import { getMappingEvent, getMappingValue, createEvent } from "@walkeros/core";
|
|
1453
1604
|
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1454
1605
|
function MappingCode({
|
|
@@ -1481,7 +1632,7 @@ function MappingCode({
|
|
|
1481
1632
|
);
|
|
1482
1633
|
}
|
|
1483
1634
|
}, [input, config]);
|
|
1484
|
-
|
|
1635
|
+
useEffect6(() => {
|
|
1485
1636
|
const timeoutId = setTimeout(executeCode, 500);
|
|
1486
1637
|
return () => clearTimeout(timeoutId);
|
|
1487
1638
|
}, [executeCode]);
|
|
@@ -1500,7 +1651,7 @@ function MappingCode({
|
|
|
1500
1651
|
}
|
|
1501
1652
|
|
|
1502
1653
|
// src/components/demos/DestinationDemo.tsx
|
|
1503
|
-
import { useState as useState8, useCallback as useCallback7, useEffect as
|
|
1654
|
+
import { useState as useState8, useCallback as useCallback7, useEffect as useEffect7 } from "react";
|
|
1504
1655
|
import {
|
|
1505
1656
|
createEvent as createEvent2,
|
|
1506
1657
|
tryCatchAsync,
|
|
@@ -1629,7 +1780,7 @@ function DestinationDemo({
|
|
|
1629
1780
|
(error) => setOutput(`Error: ${error}`)
|
|
1630
1781
|
)();
|
|
1631
1782
|
}, [eventInput, mappingInput, destination, settings, generic, fn]);
|
|
1632
|
-
|
|
1783
|
+
useEffect7(() => {
|
|
1633
1784
|
const timeoutId = setTimeout(executeDestination, 500);
|
|
1634
1785
|
return () => clearTimeout(timeoutId);
|
|
1635
1786
|
}, [executeDestination]);
|
|
@@ -1670,7 +1821,7 @@ function DestinationDemo({
|
|
|
1670
1821
|
}
|
|
1671
1822
|
|
|
1672
1823
|
// src/components/demos/DestinationInitDemo.tsx
|
|
1673
|
-
import { useState as useState9, useCallback as useCallback8, useEffect as
|
|
1824
|
+
import { useState as useState9, useCallback as useCallback8, useEffect as useEffect8 } from "react";
|
|
1674
1825
|
import { tryCatchAsync as tryCatchAsync2 } from "@walkeros/core";
|
|
1675
1826
|
import { startFlow as startFlow2 } from "@walkeros/collector";
|
|
1676
1827
|
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
@@ -1711,7 +1862,7 @@ function DestinationInitDemo({
|
|
|
1711
1862
|
(error) => setOutput(`Error: ${error}`)
|
|
1712
1863
|
)();
|
|
1713
1864
|
}, [settingsInput, destination]);
|
|
1714
|
-
|
|
1865
|
+
useEffect8(() => {
|
|
1715
1866
|
const timeoutId = setTimeout(executeInit, 500);
|
|
1716
1867
|
return () => clearTimeout(timeoutId);
|
|
1717
1868
|
}, [executeInit]);
|
|
@@ -1743,15 +1894,15 @@ function DestinationInitDemo({
|
|
|
1743
1894
|
// src/components/demos/PromotionPlayground.tsx
|
|
1744
1895
|
import {
|
|
1745
1896
|
useState as useState12,
|
|
1746
|
-
useEffect as
|
|
1747
|
-
useRef as
|
|
1897
|
+
useEffect as useEffect10,
|
|
1898
|
+
useRef as useRef7,
|
|
1748
1899
|
useCallback as useCallback10,
|
|
1749
1900
|
useMemo as useMemo3
|
|
1750
1901
|
} from "react";
|
|
1751
1902
|
import { startFlow as startFlow3 } from "@walkeros/collector";
|
|
1752
1903
|
|
|
1753
1904
|
// src/components/molecules/preview.tsx
|
|
1754
|
-
import { useState as useState10, useEffect as
|
|
1905
|
+
import { useState as useState10, useEffect as useEffect9, useRef as useRef6, useCallback as useCallback9 } from "react";
|
|
1755
1906
|
import {
|
|
1756
1907
|
sourceBrowser
|
|
1757
1908
|
} from "@walkeros/web-source-browser";
|
|
@@ -1790,11 +1941,11 @@ function Preview({
|
|
|
1790
1941
|
label = "Preview"
|
|
1791
1942
|
}) {
|
|
1792
1943
|
const [highlights, setHighlights] = useState10(/* @__PURE__ */ new Set());
|
|
1793
|
-
const iframeRef =
|
|
1794
|
-
const updateTimeoutRef =
|
|
1795
|
-
const elbRef =
|
|
1796
|
-
const sourceRef =
|
|
1797
|
-
|
|
1944
|
+
const iframeRef = useRef6(null);
|
|
1945
|
+
const updateTimeoutRef = useRef6(void 0);
|
|
1946
|
+
const elbRef = useRef6(elb);
|
|
1947
|
+
const sourceRef = useRef6(null);
|
|
1948
|
+
useEffect9(() => {
|
|
1798
1949
|
elbRef.current = elb;
|
|
1799
1950
|
}, [elb]);
|
|
1800
1951
|
const toggleHighlight = (type) => {
|
|
@@ -1822,7 +1973,7 @@ function Preview({
|
|
|
1822
1973
|
},
|
|
1823
1974
|
[]
|
|
1824
1975
|
);
|
|
1825
|
-
|
|
1976
|
+
useEffect9(() => {
|
|
1826
1977
|
if (updateTimeoutRef.current) {
|
|
1827
1978
|
clearTimeout(updateTimeoutRef.current);
|
|
1828
1979
|
}
|
|
@@ -2428,11 +2579,11 @@ function PromotionPlayground({
|
|
|
2428
2579
|
const [outputString, setOutputString] = useState12(
|
|
2429
2580
|
"// Click elements in the preview to see function call"
|
|
2430
2581
|
);
|
|
2431
|
-
const collectorRef =
|
|
2432
|
-
const elbRef =
|
|
2433
|
-
const lastEventRef =
|
|
2582
|
+
const collectorRef = useRef7(null);
|
|
2583
|
+
const elbRef = useRef7(null);
|
|
2584
|
+
const lastEventRef = useRef7(null);
|
|
2434
2585
|
const [isReady, setIsReady] = useState12(false);
|
|
2435
|
-
|
|
2586
|
+
useEffect10(() => {
|
|
2436
2587
|
let mounted = true;
|
|
2437
2588
|
const init = async () => {
|
|
2438
2589
|
try {
|
|
@@ -2558,7 +2709,7 @@ function PromotionPlayground({
|
|
|
2558
2709
|
}
|
|
2559
2710
|
|
|
2560
2711
|
// src/components/organisms/live-code.tsx
|
|
2561
|
-
import { useState as useState13, useEffect as
|
|
2712
|
+
import { useState as useState13, useEffect as useEffect11, useCallback as useCallback11 } from "react";
|
|
2562
2713
|
import { debounce, isString, tryCatchAsync as tryCatchAsync3 } from "@walkeros/core";
|
|
2563
2714
|
|
|
2564
2715
|
// src/utils/format-code.ts
|
|
@@ -2572,15 +2723,21 @@ async function formatCode(code, language) {
|
|
|
2572
2723
|
let formatted;
|
|
2573
2724
|
switch (language) {
|
|
2574
2725
|
case "javascript":
|
|
2575
|
-
case "js":
|
|
2576
|
-
|
|
2726
|
+
case "js": {
|
|
2727
|
+
const isBareObject = code.trimStart().startsWith("{") && code.includes("\n");
|
|
2728
|
+
const input = isBareObject ? `(${code})` : code;
|
|
2729
|
+
formatted = await prettier2.format(input, {
|
|
2577
2730
|
parser: "babel",
|
|
2578
2731
|
plugins: [prettierBabel2, prettierEstree2],
|
|
2579
2732
|
semi: true,
|
|
2580
2733
|
singleQuote: true,
|
|
2581
2734
|
trailingComma: "all"
|
|
2582
2735
|
});
|
|
2736
|
+
if (isBareObject) {
|
|
2737
|
+
formatted = formatted.replace(/^\(/, "").replace(/\);?\s*$/, "");
|
|
2738
|
+
}
|
|
2583
2739
|
break;
|
|
2740
|
+
}
|
|
2584
2741
|
case "typescript":
|
|
2585
2742
|
case "ts":
|
|
2586
2743
|
case "tsx":
|
|
@@ -2648,13 +2805,13 @@ function LiveCode({
|
|
|
2648
2805
|
const [input, setInput] = useState13(formatValue(initInput));
|
|
2649
2806
|
const [config, setConfig] = useState13(formatValue(initConfig));
|
|
2650
2807
|
const [output, setOutput] = useState13([formatValue(initOutput)]);
|
|
2651
|
-
|
|
2808
|
+
useEffect11(() => {
|
|
2652
2809
|
if (format3 && initInput) {
|
|
2653
2810
|
const rawInput = formatValue(initInput);
|
|
2654
2811
|
formatCode(rawInput, language).then(setInput);
|
|
2655
2812
|
}
|
|
2656
2813
|
}, [initInput, language, format3]);
|
|
2657
|
-
|
|
2814
|
+
useEffect11(() => {
|
|
2658
2815
|
if (format3 && initConfig) {
|
|
2659
2816
|
const rawConfig = formatValue(initConfig);
|
|
2660
2817
|
formatCode(rawConfig, language).then(setConfig);
|
|
@@ -2681,7 +2838,7 @@ function LiveCode({
|
|
|
2681
2838
|
),
|
|
2682
2839
|
[fn, log]
|
|
2683
2840
|
);
|
|
2684
|
-
|
|
2841
|
+
useEffect11(() => {
|
|
2685
2842
|
updateOutput(input, config, options || {});
|
|
2686
2843
|
}, [input, config, options, updateOutput]);
|
|
2687
2844
|
return /* @__PURE__ */ jsxs10(Grid, { columns: 3, className, rowHeight, children: [
|
|
@@ -2720,7 +2877,7 @@ function LiveCode({
|
|
|
2720
2877
|
}
|
|
2721
2878
|
|
|
2722
2879
|
// src/components/organisms/collector-box.tsx
|
|
2723
|
-
import { useState as useState14, useEffect as
|
|
2880
|
+
import { useState as useState14, useEffect as useEffect12 } from "react";
|
|
2724
2881
|
import { startFlow as startFlow4 } from "@walkeros/collector";
|
|
2725
2882
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2726
2883
|
function CollectorBox({
|
|
@@ -2733,7 +2890,7 @@ function CollectorBox({
|
|
|
2733
2890
|
const [output, setOutput] = useState14(
|
|
2734
2891
|
"// Click elements in the preview to see function call"
|
|
2735
2892
|
);
|
|
2736
|
-
|
|
2893
|
+
useEffect12(() => {
|
|
2737
2894
|
(async () => {
|
|
2738
2895
|
try {
|
|
2739
2896
|
const eventObj = JSON.parse(event);
|
|
@@ -2777,10 +2934,10 @@ function CollectorBox({
|
|
|
2777
2934
|
import { useState as useState36, useMemo as useMemo6, useCallback as useCallback18 } from "react";
|
|
2778
2935
|
|
|
2779
2936
|
// src/components/organisms/config-editor/config-editor-tabs.tsx
|
|
2780
|
-
import { useEffect as
|
|
2937
|
+
import { useEffect as useEffect25, useState as useState35, useMemo as useMemo5 } from "react";
|
|
2781
2938
|
|
|
2782
2939
|
// src/hooks/useMappingState.ts
|
|
2783
|
-
import { useState as useState15, useCallback as useCallback12, useRef as
|
|
2940
|
+
import { useState as useState15, useCallback as useCallback12, useRef as useRef8 } from "react";
|
|
2784
2941
|
|
|
2785
2942
|
// src/utils/mapping-path.ts
|
|
2786
2943
|
function getValueAtPath(obj, path) {
|
|
@@ -2865,7 +3022,7 @@ function getParentPath(path) {
|
|
|
2865
3022
|
// src/hooks/useMappingState.ts
|
|
2866
3023
|
function useMappingState(initialMapping, onChange) {
|
|
2867
3024
|
const [config, setConfig] = useState15(initialMapping);
|
|
2868
|
-
const isCallingOnChange =
|
|
3025
|
+
const isCallingOnChange = useRef8(false);
|
|
2869
3026
|
const updateConfig = useCallback12(
|
|
2870
3027
|
(newConfig) => {
|
|
2871
3028
|
setConfig(newConfig);
|
|
@@ -3648,7 +3805,7 @@ function useTreeState(initialExpanded = [[]]) {
|
|
|
3648
3805
|
}
|
|
3649
3806
|
|
|
3650
3807
|
// src/components/atoms/mapping-breadcrumb.tsx
|
|
3651
|
-
import { Fragment
|
|
3808
|
+
import { Fragment, jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3652
3809
|
function MappingBreadcrumb({
|
|
3653
3810
|
segments,
|
|
3654
3811
|
onNavigate,
|
|
@@ -3667,7 +3824,7 @@ function MappingBreadcrumb({
|
|
|
3667
3824
|
"li",
|
|
3668
3825
|
{
|
|
3669
3826
|
className: "elb-mapping-breadcrumb-item",
|
|
3670
|
-
children: isClickable ? /* @__PURE__ */ jsxs11(
|
|
3827
|
+
children: isClickable ? /* @__PURE__ */ jsxs11(Fragment, { children: [
|
|
3671
3828
|
/* @__PURE__ */ jsx18(
|
|
3672
3829
|
"button",
|
|
3673
3830
|
{
|
|
@@ -3696,7 +3853,7 @@ function MappingBreadcrumb({
|
|
|
3696
3853
|
}
|
|
3697
3854
|
|
|
3698
3855
|
// src/components/atoms/mapping-confirm-button.tsx
|
|
3699
|
-
import { useState as useState18, useEffect as
|
|
3856
|
+
import { useState as useState18, useEffect as useEffect13, useRef as useRef9 } from "react";
|
|
3700
3857
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
3701
3858
|
var TrashIcon = () => /* @__PURE__ */ jsx19(
|
|
3702
3859
|
"svg",
|
|
@@ -3723,8 +3880,8 @@ function MappingConfirmButton({
|
|
|
3723
3880
|
className = ""
|
|
3724
3881
|
}) {
|
|
3725
3882
|
const [isConfirming, setIsConfirming] = useState18(false);
|
|
3726
|
-
const buttonRef =
|
|
3727
|
-
|
|
3883
|
+
const buttonRef = useRef9(null);
|
|
3884
|
+
useEffect13(() => {
|
|
3728
3885
|
if (!isConfirming) return;
|
|
3729
3886
|
const handleClickOutside = (e) => {
|
|
3730
3887
|
if (buttonRef.current && !buttonRef.current.contains(e.target)) {
|
|
@@ -3869,7 +4026,7 @@ function MappingNavigationHeader({
|
|
|
3869
4026
|
}
|
|
3870
4027
|
|
|
3871
4028
|
// src/components/molecules/config-tree-sidebar.tsx
|
|
3872
|
-
import { useState as useState19, useRef as
|
|
4029
|
+
import { useState as useState19, useRef as useRef10, useEffect as useEffect14 } from "react";
|
|
3873
4030
|
|
|
3874
4031
|
// src/components/atoms/mapping-input.tsx
|
|
3875
4032
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
@@ -3992,14 +4149,14 @@ function ConfigTreeNodeComponent({
|
|
|
3992
4149
|
const [isAddingAction, setIsAddingAction] = useState19(false);
|
|
3993
4150
|
const [newActionName, setNewActionName] = useState19("");
|
|
3994
4151
|
const [actionExists, setActionExists] = useState19(false);
|
|
3995
|
-
const inputRef =
|
|
4152
|
+
const inputRef = useRef10(null);
|
|
3996
4153
|
const isEntityNode = node.type === "entity" && node.path.length === 2 && node.path[0] === "mapping";
|
|
3997
|
-
|
|
4154
|
+
useEffect14(() => {
|
|
3998
4155
|
if (isAddingAction && inputRef.current) {
|
|
3999
4156
|
inputRef.current.focus();
|
|
4000
4157
|
}
|
|
4001
4158
|
}, [isAddingAction]);
|
|
4002
|
-
|
|
4159
|
+
useEffect14(() => {
|
|
4003
4160
|
if (isEntityNode && newActionName) {
|
|
4004
4161
|
const exists = node.children?.some((child) => child.label === newActionName) ?? false;
|
|
4005
4162
|
setActionExists(exists);
|
|
@@ -4166,13 +4323,13 @@ function ConfigTreeSidebar({
|
|
|
4166
4323
|
const [isAddingEntity, setIsAddingEntity] = useState19(false);
|
|
4167
4324
|
const [newEntityName, setNewEntityName] = useState19("");
|
|
4168
4325
|
const [entityExists, setEntityExists] = useState19(false);
|
|
4169
|
-
const entityInputRef =
|
|
4170
|
-
|
|
4326
|
+
const entityInputRef = useRef10(null);
|
|
4327
|
+
useEffect14(() => {
|
|
4171
4328
|
if (isAddingEntity && entityInputRef.current) {
|
|
4172
4329
|
entityInputRef.current.focus();
|
|
4173
4330
|
}
|
|
4174
4331
|
}, [isAddingEntity]);
|
|
4175
|
-
|
|
4332
|
+
useEffect14(() => {
|
|
4176
4333
|
if (newEntityName) {
|
|
4177
4334
|
const mappingNode = tree.find((node) => node.key === "mapping");
|
|
4178
4335
|
const exists = mappingNode?.children?.some((child) => child.label === newEntityName) ?? false;
|
|
@@ -4313,7 +4470,7 @@ function ConfigTreeSidebar({
|
|
|
4313
4470
|
}
|
|
4314
4471
|
|
|
4315
4472
|
// src/components/molecules/mapping-entity-pane.tsx
|
|
4316
|
-
import { useState as useState20, useEffect as
|
|
4473
|
+
import { useState as useState20, useEffect as useEffect15 } from "react";
|
|
4317
4474
|
|
|
4318
4475
|
// src/components/atoms/pane-header.tsx
|
|
4319
4476
|
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
@@ -4419,7 +4576,7 @@ function MappingEntityPane({
|
|
|
4419
4576
|
const entity = path[0];
|
|
4420
4577
|
const entityConfig = mappingState.actions.getValue([entity]);
|
|
4421
4578
|
const actions = entityConfig && typeof entityConfig === "object" ? Object.keys(entityConfig).sort() : [];
|
|
4422
|
-
|
|
4579
|
+
useEffect15(() => {
|
|
4423
4580
|
if (newActionName) {
|
|
4424
4581
|
const exists = actions.includes(newActionName);
|
|
4425
4582
|
setActionExists(exists);
|
|
@@ -5411,7 +5568,7 @@ function MappingKeyPaneView({
|
|
|
5411
5568
|
}
|
|
5412
5569
|
|
|
5413
5570
|
// src/components/molecules/mapping-function-pane-base.tsx
|
|
5414
|
-
import { useState as useState22, useEffect as
|
|
5571
|
+
import { useState as useState22, useEffect as useEffect16 } from "react";
|
|
5415
5572
|
|
|
5416
5573
|
// src/utils/code-normalizer.ts
|
|
5417
5574
|
function normalizeCode(code) {
|
|
@@ -5434,7 +5591,7 @@ function MappingFunctionPaneBase({
|
|
|
5434
5591
|
const value = mappingState.actions.getValue(path);
|
|
5435
5592
|
const initialCode = typeof value === "string" ? value : defaultCode;
|
|
5436
5593
|
const [code, setCode] = useState22(initialCode);
|
|
5437
|
-
|
|
5594
|
+
useEffect16(() => {
|
|
5438
5595
|
const currentValue = mappingState.actions.getValue(path);
|
|
5439
5596
|
const newCode = typeof currentValue === "string" ? currentValue : defaultCode;
|
|
5440
5597
|
setCode(newCode);
|
|
@@ -5513,7 +5670,7 @@ function MappingFunctionPaneBase({
|
|
|
5513
5670
|
}
|
|
5514
5671
|
|
|
5515
5672
|
// src/components/molecules/mapping-condition-pane-view.tsx
|
|
5516
|
-
import { Fragment as
|
|
5673
|
+
import { Fragment as Fragment2, jsx as jsx35 } from "react/jsx-runtime";
|
|
5517
5674
|
var DEFAULT_CONDITION = `(
|
|
5518
5675
|
value: WalkerOS.DeepPartialEvent | unknown,
|
|
5519
5676
|
mapping: Mapping.Value,
|
|
@@ -5558,15 +5715,15 @@ var HELP_SECTIONS = [
|
|
|
5558
5715
|
examples: [
|
|
5559
5716
|
{
|
|
5560
5717
|
label: "Only for high-value orders:",
|
|
5561
|
-
code: /* @__PURE__ */ jsx35(
|
|
5718
|
+
code: /* @__PURE__ */ jsx35(Fragment2, { children: "(value) => value.data?.total > 100" })
|
|
5562
5719
|
},
|
|
5563
5720
|
{
|
|
5564
5721
|
label: "Only for specific user segment:",
|
|
5565
|
-
code: /* @__PURE__ */ jsx35(
|
|
5722
|
+
code: /* @__PURE__ */ jsx35(Fragment2, { children: "(value) => value.user?.segment === 'premium'" })
|
|
5566
5723
|
},
|
|
5567
5724
|
{
|
|
5568
5725
|
label: "Only during business hours:",
|
|
5569
|
-
code: /* @__PURE__ */ jsx35(
|
|
5726
|
+
code: /* @__PURE__ */ jsx35(Fragment2, { children: "() => new Date().getHours() >= 9 && new Date().getHours() < 17" })
|
|
5570
5727
|
}
|
|
5571
5728
|
]
|
|
5572
5729
|
}
|
|
@@ -5586,7 +5743,7 @@ function MappingConditionPaneView(props) {
|
|
|
5586
5743
|
}
|
|
5587
5744
|
|
|
5588
5745
|
// src/components/molecules/mapping-fn-pane-view.tsx
|
|
5589
|
-
import { Fragment as
|
|
5746
|
+
import { Fragment as Fragment3, jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5590
5747
|
var DEFAULT_FN = `(
|
|
5591
5748
|
value: WalkerOS.DeepPartialEvent | unknown,
|
|
5592
5749
|
mapping: Mapping.Value,
|
|
@@ -5637,11 +5794,11 @@ var HELP_SECTIONS2 = [
|
|
|
5637
5794
|
examples: [
|
|
5638
5795
|
{
|
|
5639
5796
|
label: "Extract nested property:",
|
|
5640
|
-
code: /* @__PURE__ */ jsx36(
|
|
5797
|
+
code: /* @__PURE__ */ jsx36(Fragment3, { children: "(value) => value.data?.product?.id" })
|
|
5641
5798
|
},
|
|
5642
5799
|
{
|
|
5643
5800
|
label: "Format currency:",
|
|
5644
|
-
code: /* @__PURE__ */ jsxs26(
|
|
5801
|
+
code: /* @__PURE__ */ jsxs26(Fragment3, { children: [
|
|
5645
5802
|
"(value) => {",
|
|
5646
5803
|
"\n",
|
|
5647
5804
|
" ",
|
|
@@ -5655,11 +5812,11 @@ var HELP_SECTIONS2 = [
|
|
|
5655
5812
|
},
|
|
5656
5813
|
{
|
|
5657
5814
|
label: "Combine multiple fields:",
|
|
5658
|
-
code: /* @__PURE__ */ jsx36(
|
|
5815
|
+
code: /* @__PURE__ */ jsx36(Fragment3, { children: "(value) => `${value.data?.firstName} ${value.data?.lastName}`" })
|
|
5659
5816
|
},
|
|
5660
5817
|
{
|
|
5661
5818
|
label: "Conditional transformation with consent:",
|
|
5662
|
-
code: /* @__PURE__ */ jsxs26(
|
|
5819
|
+
code: /* @__PURE__ */ jsxs26(Fragment3, { children: [
|
|
5663
5820
|
"(value, mapping, options) => {",
|
|
5664
5821
|
"\n",
|
|
5665
5822
|
" ",
|
|
@@ -5679,7 +5836,7 @@ var HELP_SECTIONS2 = [
|
|
|
5679
5836
|
},
|
|
5680
5837
|
{
|
|
5681
5838
|
label: "Use collector for context:",
|
|
5682
|
-
code: /* @__PURE__ */ jsxs26(
|
|
5839
|
+
code: /* @__PURE__ */ jsxs26(Fragment3, { children: [
|
|
5683
5840
|
"(value, mapping, options) => {",
|
|
5684
5841
|
"\n",
|
|
5685
5842
|
" ",
|
|
@@ -5718,7 +5875,7 @@ function MappingFnPaneView(props) {
|
|
|
5718
5875
|
}
|
|
5719
5876
|
|
|
5720
5877
|
// src/components/molecules/mapping-validate-pane-view.tsx
|
|
5721
|
-
import { Fragment as
|
|
5878
|
+
import { Fragment as Fragment4, jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5722
5879
|
var DEFAULT_VALIDATE = `(
|
|
5723
5880
|
value: unknown
|
|
5724
5881
|
): boolean | Promise<boolean> => {
|
|
@@ -5758,19 +5915,19 @@ var HELP_SECTIONS3 = [
|
|
|
5758
5915
|
examples: [
|
|
5759
5916
|
{
|
|
5760
5917
|
label: "Exclude empty values:",
|
|
5761
|
-
code: /* @__PURE__ */ jsx37(
|
|
5918
|
+
code: /* @__PURE__ */ jsx37(Fragment4, { children: "(value) => value !== undefined && value !== null && value !== ''" })
|
|
5762
5919
|
},
|
|
5763
5920
|
{
|
|
5764
5921
|
label: "Only include valid email addresses:",
|
|
5765
|
-
code: /* @__PURE__ */ jsx37(
|
|
5922
|
+
code: /* @__PURE__ */ jsx37(Fragment4, { children: "(value) => typeof value === 'string' && /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)" })
|
|
5766
5923
|
},
|
|
5767
5924
|
{
|
|
5768
5925
|
label: "Only include positive numbers:",
|
|
5769
|
-
code: /* @__PURE__ */ jsx37(
|
|
5926
|
+
code: /* @__PURE__ */ jsx37(Fragment4, { children: "(value) => typeof value === 'number' && value > 0" })
|
|
5770
5927
|
},
|
|
5771
5928
|
{
|
|
5772
5929
|
label: "Validate URL format:",
|
|
5773
|
-
code: /* @__PURE__ */ jsxs27(
|
|
5930
|
+
code: /* @__PURE__ */ jsxs27(Fragment4, { children: [
|
|
5774
5931
|
"(value) => {",
|
|
5775
5932
|
"\n",
|
|
5776
5933
|
" ",
|
|
@@ -5796,7 +5953,7 @@ var HELP_SECTIONS3 = [
|
|
|
5796
5953
|
},
|
|
5797
5954
|
{
|
|
5798
5955
|
label: "Exclude specific values:",
|
|
5799
|
-
code: /* @__PURE__ */ jsx37(
|
|
5956
|
+
code: /* @__PURE__ */ jsx37(Fragment4, { children: "(value) => !['test', 'localhost', 'example.com'].includes(value)" })
|
|
5800
5957
|
}
|
|
5801
5958
|
]
|
|
5802
5959
|
}
|
|
@@ -5909,7 +6066,7 @@ function validateValue(value, schema) {
|
|
|
5909
6066
|
}
|
|
5910
6067
|
|
|
5911
6068
|
// src/components/molecules/mapping-name-pane-view.tsx
|
|
5912
|
-
import { Fragment as
|
|
6069
|
+
import { Fragment as Fragment5, jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5913
6070
|
function MappingNamePaneView({
|
|
5914
6071
|
path,
|
|
5915
6072
|
mappingState,
|
|
@@ -5953,7 +6110,7 @@ function MappingNamePaneView({
|
|
|
5953
6110
|
),
|
|
5954
6111
|
/* @__PURE__ */ jsxs28("div", { className: "elb-mapping-pane-hint", children: [
|
|
5955
6112
|
uiSchema?.["ui:help"] || "This string will be sent to the destination instead of the default entity-action name. Leave empty to use default.",
|
|
5956
|
-
hasError && validationResult.error && /* @__PURE__ */ jsxs28(
|
|
6113
|
+
hasError && validationResult.error && /* @__PURE__ */ jsxs28(Fragment5, { children: [
|
|
5957
6114
|
/* @__PURE__ */ jsx38("br", {}),
|
|
5958
6115
|
/* @__PURE__ */ jsxs28("span", { style: { color: "var(--color-button-danger)" }, children: [
|
|
5959
6116
|
"\u26A0 ",
|
|
@@ -5989,7 +6146,7 @@ function MappingNamePaneView({
|
|
|
5989
6146
|
}
|
|
5990
6147
|
|
|
5991
6148
|
// src/components/molecules/mapping-batch-pane-view.tsx
|
|
5992
|
-
import { Fragment as
|
|
6149
|
+
import { Fragment as Fragment6, jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5993
6150
|
function MappingBatchPaneView({
|
|
5994
6151
|
path,
|
|
5995
6152
|
mappingState,
|
|
@@ -6038,7 +6195,7 @@ function MappingBatchPaneView({
|
|
|
6038
6195
|
),
|
|
6039
6196
|
/* @__PURE__ */ jsxs29("div", { className: "elb-mapping-pane-hint", children: [
|
|
6040
6197
|
uiSchema?.["ui:help"] || "Events will be collected and sent in batches. Use time (ms) for timed batches or count for event-based batches. Leave empty to disable batching.",
|
|
6041
|
-
hasError && validationResult.error && /* @__PURE__ */ jsxs29(
|
|
6198
|
+
hasError && validationResult.error && /* @__PURE__ */ jsxs29(Fragment6, { children: [
|
|
6042
6199
|
/* @__PURE__ */ jsx39("br", {}),
|
|
6043
6200
|
/* @__PURE__ */ jsxs29("span", { style: { color: "var(--color-button-danger)" }, children: [
|
|
6044
6201
|
"\u26A0 ",
|
|
@@ -6664,7 +6821,7 @@ function MappingBooleanWidget(props) {
|
|
|
6664
6821
|
}
|
|
6665
6822
|
|
|
6666
6823
|
// src/components/atoms/mapping-consent.tsx
|
|
6667
|
-
import { useState as useState26, useEffect as
|
|
6824
|
+
import { useState as useState26, useEffect as useEffect17 } from "react";
|
|
6668
6825
|
|
|
6669
6826
|
// src/components/atoms/mapping-collapsible.tsx
|
|
6670
6827
|
import { useState as useState25 } from "react";
|
|
@@ -6986,7 +7143,7 @@ function MappingConsentWidget(props) {
|
|
|
6986
7143
|
const title = schema?.title || "Consent";
|
|
6987
7144
|
const description = schema?.description;
|
|
6988
7145
|
const [isExpanded, setIsExpanded] = useState26(hasConsent);
|
|
6989
|
-
|
|
7146
|
+
useEffect17(() => {
|
|
6990
7147
|
setIsExpanded(hasConsent);
|
|
6991
7148
|
}, [hasConsent]);
|
|
6992
7149
|
const handleAddConsent = () => {
|
|
@@ -7068,10 +7225,10 @@ function MappingConsentWidget(props) {
|
|
|
7068
7225
|
}
|
|
7069
7226
|
|
|
7070
7227
|
// src/components/atoms/mapping-value.tsx
|
|
7071
|
-
import React15, { useState as useState27, useEffect as
|
|
7228
|
+
import React15, { useState as useState27, useEffect as useEffect18 } from "react";
|
|
7072
7229
|
|
|
7073
7230
|
// src/components/atoms/field-header.tsx
|
|
7074
|
-
import { Fragment as
|
|
7231
|
+
import { Fragment as Fragment7, jsx as jsx51, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
7075
7232
|
function FieldHeader({
|
|
7076
7233
|
title,
|
|
7077
7234
|
description,
|
|
@@ -7090,7 +7247,7 @@ function FieldHeader({
|
|
|
7090
7247
|
action
|
|
7091
7248
|
] });
|
|
7092
7249
|
}
|
|
7093
|
-
return /* @__PURE__ */ jsxs41(
|
|
7250
|
+
return /* @__PURE__ */ jsxs41(Fragment7, { children: [
|
|
7094
7251
|
/* @__PURE__ */ jsxs41("label", { className: "elb-rjsf-label", children: [
|
|
7095
7252
|
title,
|
|
7096
7253
|
required && /* @__PURE__ */ jsx51("span", { className: "elb-rjsf-required", children: " *" })
|
|
@@ -7148,7 +7305,7 @@ function MappingValueWidget(props) {
|
|
|
7148
7305
|
const [selectedType, setSelectedType] = useState27(getCurrentType);
|
|
7149
7306
|
const userSelectedTypeRef = React15.useRef(false);
|
|
7150
7307
|
const prevValueRef = React15.useRef(value);
|
|
7151
|
-
|
|
7308
|
+
useEffect18(() => {
|
|
7152
7309
|
const prevType = typeof prevValueRef.current;
|
|
7153
7310
|
const currentType = typeof value;
|
|
7154
7311
|
const isMajorTypeChange = prevType !== currentType || value === void 0 && prevValueRef.current !== void 0 || value !== void 0 && prevValueRef.current === void 0;
|
|
@@ -7995,7 +8152,7 @@ function MappingValidateField(props) {
|
|
|
7995
8152
|
}
|
|
7996
8153
|
|
|
7997
8154
|
// src/components/atoms/mapping-data.tsx
|
|
7998
|
-
import { useState as useState29, useEffect as
|
|
8155
|
+
import { useState as useState29, useEffect as useEffect19, useRef as useRef11, useCallback as useCallback15 } from "react";
|
|
7999
8156
|
|
|
8000
8157
|
// src/schemas/value-config-schema.ts
|
|
8001
8158
|
var valueConfigSchema = {
|
|
@@ -8237,8 +8394,8 @@ function MappingDataWidget(props) {
|
|
|
8237
8394
|
const description = schema?.description;
|
|
8238
8395
|
const [showForm, setShowForm] = useState29(hasData);
|
|
8239
8396
|
const [isExpanded, setIsExpanded] = useState29(hasData);
|
|
8240
|
-
const prevValueRef =
|
|
8241
|
-
|
|
8397
|
+
const prevValueRef = useRef11(value);
|
|
8398
|
+
useEffect19(() => {
|
|
8242
8399
|
const newHasData = value && typeof value === "object" && Object.keys(value).length > 0;
|
|
8243
8400
|
setShowForm(!!newHasData);
|
|
8244
8401
|
setIsExpanded(!!newHasData);
|
|
@@ -8321,7 +8478,7 @@ function MappingDataField(props) {
|
|
|
8321
8478
|
}
|
|
8322
8479
|
|
|
8323
8480
|
// src/components/atoms/mapping-settings.tsx
|
|
8324
|
-
import { useState as useState30, useEffect as
|
|
8481
|
+
import { useState as useState30, useEffect as useEffect20, useRef as useRef12, useCallback as useCallback16 } from "react";
|
|
8325
8482
|
import { jsx as jsx67, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
8326
8483
|
function MappingSettingsWidget(props) {
|
|
8327
8484
|
const {
|
|
@@ -8343,8 +8500,8 @@ function MappingSettingsWidget(props) {
|
|
|
8343
8500
|
const hasSchema = destinationSchema && destinationSchema.properties && Object.keys(destinationSchema.properties).length > 0;
|
|
8344
8501
|
const [showForm, setShowForm] = useState30(hasSettings);
|
|
8345
8502
|
const [isExpanded, setIsExpanded] = useState30(hasSettings);
|
|
8346
|
-
const prevValueRef =
|
|
8347
|
-
|
|
8503
|
+
const prevValueRef = useRef12(value);
|
|
8504
|
+
useEffect20(() => {
|
|
8348
8505
|
const newHasSettings = value && typeof value === "object" && Object.keys(value).length > 0;
|
|
8349
8506
|
setShowForm(!!newHasSettings);
|
|
8350
8507
|
setIsExpanded(!!newHasSettings);
|
|
@@ -8502,7 +8659,7 @@ function MappingObjectExplorerField(props) {
|
|
|
8502
8659
|
}
|
|
8503
8660
|
|
|
8504
8661
|
// src/components/molecules/mapping-map-field.tsx
|
|
8505
|
-
import { useState as useState31, useEffect as
|
|
8662
|
+
import { useState as useState31, useEffect as useEffect21, useRef as useRef13 } from "react";
|
|
8506
8663
|
|
|
8507
8664
|
// src/components/atoms/mapping-map-entry.tsx
|
|
8508
8665
|
import { jsx as jsx70, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
@@ -8632,15 +8789,15 @@ function MappingMapField(props) {
|
|
|
8632
8789
|
);
|
|
8633
8790
|
const hasEntries = entries.length > 0;
|
|
8634
8791
|
const [isExpanded, setIsExpanded] = useState31(hasEntries);
|
|
8635
|
-
const prevFormDataRef =
|
|
8636
|
-
|
|
8792
|
+
const prevFormDataRef = useRef13(formData);
|
|
8793
|
+
useEffect21(() => {
|
|
8637
8794
|
if (prevFormDataRef.current === formData) {
|
|
8638
8795
|
return;
|
|
8639
8796
|
}
|
|
8640
8797
|
prevFormDataRef.current = formData;
|
|
8641
8798
|
setEntries(objectToEntries(formData));
|
|
8642
8799
|
}, [formData]);
|
|
8643
|
-
|
|
8800
|
+
useEffect21(() => {
|
|
8644
8801
|
setIsExpanded(hasEntries);
|
|
8645
8802
|
}, [hasEntries]);
|
|
8646
8803
|
const duplicateKeys = /* @__PURE__ */ new Set();
|
|
@@ -8727,7 +8884,7 @@ function MappingMapField(props) {
|
|
|
8727
8884
|
}
|
|
8728
8885
|
|
|
8729
8886
|
// src/components/molecules/mapping-set-field.tsx
|
|
8730
|
-
import { useState as useState32, useEffect as
|
|
8887
|
+
import { useState as useState32, useEffect as useEffect22, useRef as useRef14 } from "react";
|
|
8731
8888
|
|
|
8732
8889
|
// src/components/atoms/mapping-set-entry.tsx
|
|
8733
8890
|
import { jsx as jsx72, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
@@ -8861,8 +9018,8 @@ function MappingSetField(props) {
|
|
|
8861
9018
|
);
|
|
8862
9019
|
const hasEntries = entries.length > 0;
|
|
8863
9020
|
const [isExpanded, setIsExpanded] = useState32(hasEntries);
|
|
8864
|
-
const prevFormDataRef =
|
|
8865
|
-
|
|
9021
|
+
const prevFormDataRef = useRef14(formData);
|
|
9022
|
+
useEffect22(() => {
|
|
8866
9023
|
if (prevFormDataRef.current === formData) {
|
|
8867
9024
|
return;
|
|
8868
9025
|
}
|
|
@@ -8885,7 +9042,7 @@ function MappingSetField(props) {
|
|
|
8885
9042
|
});
|
|
8886
9043
|
setEntries(newEntries);
|
|
8887
9044
|
}, [formData]);
|
|
8888
|
-
|
|
9045
|
+
useEffect22(() => {
|
|
8889
9046
|
setIsExpanded(hasEntries);
|
|
8890
9047
|
}, [hasEntries]);
|
|
8891
9048
|
const handleEntriesChange = (newEntries) => {
|
|
@@ -9008,7 +9165,7 @@ function MappingSetField(props) {
|
|
|
9008
9165
|
}
|
|
9009
9166
|
|
|
9010
9167
|
// src/components/molecules/mapping-loop-field.tsx
|
|
9011
|
-
import { useState as useState33, useEffect as
|
|
9168
|
+
import { useState as useState33, useEffect as useEffect23, useRef as useRef15 } from "react";
|
|
9012
9169
|
import { jsx as jsx74, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
9013
9170
|
function MappingLoopField(props) {
|
|
9014
9171
|
const { formData, onChange, schema, disabled, readonly } = props;
|
|
@@ -9033,8 +9190,8 @@ function MappingLoopField(props) {
|
|
|
9033
9190
|
);
|
|
9034
9191
|
const [transform, setTransform] = useState33(() => parseFormData(formData)[1]);
|
|
9035
9192
|
const [isExpanded, setIsExpanded] = useState33(false);
|
|
9036
|
-
const prevFormDataRef =
|
|
9037
|
-
|
|
9193
|
+
const prevFormDataRef = useRef15(formData);
|
|
9194
|
+
useEffect23(() => {
|
|
9038
9195
|
if (prevFormDataRef.current === formData) {
|
|
9039
9196
|
return;
|
|
9040
9197
|
}
|
|
@@ -9408,7 +9565,7 @@ function MappingMapPaneViewRJSF({
|
|
|
9408
9565
|
}
|
|
9409
9566
|
|
|
9410
9567
|
// src/components/atoms/mapping-enum-select.tsx
|
|
9411
|
-
import { useState as useState34, useRef as
|
|
9568
|
+
import { useState as useState34, useRef as useRef16, useEffect as useEffect24 } from "react";
|
|
9412
9569
|
import { jsx as jsx78, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
9413
9570
|
function MappingEnumSelect({
|
|
9414
9571
|
value,
|
|
@@ -9422,19 +9579,19 @@ function MappingEnumSelect({
|
|
|
9422
9579
|
const [highlightedIndex, setHighlightedIndex] = useState34(0);
|
|
9423
9580
|
const [inputValue, setInputValue] = useState34(String(value || ""));
|
|
9424
9581
|
const [hasTyped, setHasTyped] = useState34(false);
|
|
9425
|
-
const containerRef =
|
|
9426
|
-
const inputRef =
|
|
9427
|
-
const dropdownRef =
|
|
9428
|
-
|
|
9582
|
+
const containerRef = useRef16(null);
|
|
9583
|
+
const inputRef = useRef16(null);
|
|
9584
|
+
const dropdownRef = useRef16(null);
|
|
9585
|
+
useEffect24(() => {
|
|
9429
9586
|
setInputValue(String(value || ""));
|
|
9430
9587
|
setHasTyped(false);
|
|
9431
9588
|
}, [value]);
|
|
9432
|
-
|
|
9589
|
+
useEffect24(() => {
|
|
9433
9590
|
if (isOpen) {
|
|
9434
9591
|
setHighlightedIndex(0);
|
|
9435
9592
|
}
|
|
9436
9593
|
}, [isOpen]);
|
|
9437
|
-
|
|
9594
|
+
useEffect24(() => {
|
|
9438
9595
|
const handleClickOutside = (event) => {
|
|
9439
9596
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
9440
9597
|
setIsOpen(false);
|
|
@@ -9448,7 +9605,7 @@ function MappingEnumSelect({
|
|
|
9448
9605
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
9449
9606
|
}
|
|
9450
9607
|
}, [isOpen, hasTyped, inputValue, onChange, type]);
|
|
9451
|
-
|
|
9608
|
+
useEffect24(() => {
|
|
9452
9609
|
if (isOpen && dropdownRef.current && dropdownRef.current.children[highlightedIndex]) {
|
|
9453
9610
|
const highlighted = dropdownRef.current.children[highlightedIndex];
|
|
9454
9611
|
if (highlighted) {
|
|
@@ -9654,7 +9811,7 @@ function MappingBooleanPaneView({
|
|
|
9654
9811
|
}
|
|
9655
9812
|
|
|
9656
9813
|
// src/components/molecules/mapping-primitive-pane-view.tsx
|
|
9657
|
-
import { Fragment as
|
|
9814
|
+
import { Fragment as Fragment8, jsx as jsx81, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
9658
9815
|
function MappingPrimitivePaneView({
|
|
9659
9816
|
path,
|
|
9660
9817
|
mappingState,
|
|
@@ -9708,11 +9865,11 @@ function MappingPrimitivePaneView({
|
|
|
9708
9865
|
/* @__PURE__ */ jsxs61("div", { className: "elb-mapping-pane-hint", children: [
|
|
9709
9866
|
"Current type: ",
|
|
9710
9867
|
/* @__PURE__ */ jsx81("strong", { children: typeof value }),
|
|
9711
|
-
uiSchema?.["ui:help"] && /* @__PURE__ */ jsxs61(
|
|
9868
|
+
uiSchema?.["ui:help"] && /* @__PURE__ */ jsxs61(Fragment8, { children: [
|
|
9712
9869
|
/* @__PURE__ */ jsx81("br", {}),
|
|
9713
9870
|
uiSchema["ui:help"]
|
|
9714
9871
|
] }),
|
|
9715
|
-
hasError && validationResult.error && /* @__PURE__ */ jsxs61(
|
|
9872
|
+
hasError && validationResult.error && /* @__PURE__ */ jsxs61(Fragment8, { children: [
|
|
9716
9873
|
/* @__PURE__ */ jsx81("br", {}),
|
|
9717
9874
|
/* @__PURE__ */ jsxs61("span", { style: { color: "var(--color-button-danger)" }, children: [
|
|
9718
9875
|
"\u26A0 ",
|
|
@@ -10393,7 +10550,7 @@ function buildValueChildren(value, basePath, schemas, structure) {
|
|
|
10393
10550
|
}
|
|
10394
10551
|
|
|
10395
10552
|
// src/components/organisms/config-editor/config-editor-tabs.tsx
|
|
10396
|
-
import { Fragment as
|
|
10553
|
+
import { Fragment as Fragment9, jsx as jsx85, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
10397
10554
|
function ConfigEditorTabs({
|
|
10398
10555
|
config,
|
|
10399
10556
|
onChange,
|
|
@@ -10452,7 +10609,7 @@ function ConfigEditorTabs({
|
|
|
10452
10609
|
} catch (e) {
|
|
10453
10610
|
}
|
|
10454
10611
|
};
|
|
10455
|
-
|
|
10612
|
+
useEffect25(() => {
|
|
10456
10613
|
if (navigation.navigationHistory.length === 0) {
|
|
10457
10614
|
navigation.switchToTab("");
|
|
10458
10615
|
if (initialNavigationState && initialNavigationState.currentPath.length > 0) {
|
|
@@ -10463,7 +10620,7 @@ function ConfigEditorTabs({
|
|
|
10463
10620
|
}
|
|
10464
10621
|
}
|
|
10465
10622
|
}, []);
|
|
10466
|
-
|
|
10623
|
+
useEffect25(() => {
|
|
10467
10624
|
if (onNavigationStateChange && activeTab) {
|
|
10468
10625
|
onNavigationStateChange({
|
|
10469
10626
|
currentPath: activeTab.path,
|
|
@@ -10474,7 +10631,7 @@ function ConfigEditorTabs({
|
|
|
10474
10631
|
});
|
|
10475
10632
|
}
|
|
10476
10633
|
}, [activeTab, treeState.expandedPaths, onNavigationStateChange]);
|
|
10477
|
-
|
|
10634
|
+
useEffect25(() => {
|
|
10478
10635
|
if (activeTab && activeTab.path.length > 0) {
|
|
10479
10636
|
for (let i = 1; i <= activeTab.path.length; i++) {
|
|
10480
10637
|
const pathToExpand = activeTab.path.slice(0, i);
|
|
@@ -10492,7 +10649,7 @@ function ConfigEditorTabs({
|
|
|
10492
10649
|
className: `elb-mapping-editor-tabs elb-mapping-editor-tabs--responsive ${className}`,
|
|
10493
10650
|
"data-layout": "responsive",
|
|
10494
10651
|
children: [
|
|
10495
|
-
showTree && /* @__PURE__ */ jsxs65(
|
|
10652
|
+
showTree && /* @__PURE__ */ jsxs65(Fragment9, { children: [
|
|
10496
10653
|
/* @__PURE__ */ jsx85(
|
|
10497
10654
|
"div",
|
|
10498
10655
|
{
|
|
@@ -10694,7 +10851,7 @@ function ConfigEditor(props) {
|
|
|
10694
10851
|
}
|
|
10695
10852
|
|
|
10696
10853
|
// node_modules/@iconify/react/dist/iconify.js
|
|
10697
|
-
import { createElement, forwardRef, useState as useState37, useEffect as
|
|
10854
|
+
import { createElement, forwardRef, useState as useState37, useEffect as useEffect26 } from "react";
|
|
10698
10855
|
function getIconsTree(data, names) {
|
|
10699
10856
|
const icons = data.icons;
|
|
10700
10857
|
const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
|
|
@@ -11292,9 +11449,9 @@ function updateCallbacks(storage2) {
|
|
|
11292
11449
|
});
|
|
11293
11450
|
}
|
|
11294
11451
|
}
|
|
11295
|
-
var
|
|
11452
|
+
var idCounter2 = 0;
|
|
11296
11453
|
function storeCallback(callback, icons, pendingSources) {
|
|
11297
|
-
const id =
|
|
11454
|
+
const id = idCounter2++;
|
|
11298
11455
|
const abort = removeCallback.bind(null, pendingSources, id);
|
|
11299
11456
|
if (!icons.pending.length) return abort;
|
|
11300
11457
|
const item = {
|
|
@@ -12058,11 +12215,11 @@ function IconComponent(props) {
|
|
|
12058
12215
|
}
|
|
12059
12216
|
}
|
|
12060
12217
|
}
|
|
12061
|
-
|
|
12218
|
+
useEffect26(() => {
|
|
12062
12219
|
setMounted(true);
|
|
12063
12220
|
return cleanup;
|
|
12064
12221
|
}, []);
|
|
12065
|
-
|
|
12222
|
+
useEffect26(() => {
|
|
12066
12223
|
if (mounted) {
|
|
12067
12224
|
updateState();
|
|
12068
12225
|
}
|
|
@@ -15168,7 +15325,7 @@ function FlowSectionBox({ section }) {
|
|
|
15168
15325
|
}
|
|
15169
15326
|
|
|
15170
15327
|
// src/components/molecules/code-snippet.tsx
|
|
15171
|
-
import { useState as useState38, useEffect as
|
|
15328
|
+
import { useState as useState38, useEffect as useEffect27 } from "react";
|
|
15172
15329
|
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
15173
15330
|
function CodeSnippet(props) {
|
|
15174
15331
|
const {
|
|
@@ -15184,7 +15341,7 @@ function CodeSnippet(props) {
|
|
|
15184
15341
|
} = props;
|
|
15185
15342
|
const snippetClassName = `elb-code-snippet ${className || ""}`.trim();
|
|
15186
15343
|
const [formattedCode, setFormattedCode] = useState38(code);
|
|
15187
|
-
|
|
15344
|
+
useEffect27(() => {
|
|
15188
15345
|
if (format3 && code) {
|
|
15189
15346
|
formatCode(code, language).then(setFormattedCode);
|
|
15190
15347
|
} else {
|
|
@@ -15208,9 +15365,9 @@ function CodeSnippet(props) {
|
|
|
15208
15365
|
}
|
|
15209
15366
|
|
|
15210
15367
|
// src/components/molecules/flow-map/FlowMap.tsx
|
|
15211
|
-
import React23, { useEffect as
|
|
15368
|
+
import React23, { useEffect as useEffect28, useRef as useRef17 } from "react";
|
|
15212
15369
|
import rough from "roughjs";
|
|
15213
|
-
import { Fragment as
|
|
15370
|
+
import { Fragment as Fragment10, jsx as jsx90, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
15214
15371
|
function RoughRect({
|
|
15215
15372
|
x,
|
|
15216
15373
|
y,
|
|
@@ -15219,8 +15376,8 @@ function RoughRect({
|
|
|
15219
15376
|
fill,
|
|
15220
15377
|
stroke
|
|
15221
15378
|
}) {
|
|
15222
|
-
const ref =
|
|
15223
|
-
|
|
15379
|
+
const ref = useRef17(null);
|
|
15380
|
+
useEffect28(() => {
|
|
15224
15381
|
if (!ref.current) return;
|
|
15225
15382
|
const svg = ref.current.ownerSVGElement;
|
|
15226
15383
|
if (!svg) return;
|
|
@@ -15259,8 +15416,8 @@ function RoughCircle({
|
|
|
15259
15416
|
fill,
|
|
15260
15417
|
stroke
|
|
15261
15418
|
}) {
|
|
15262
|
-
const ref =
|
|
15263
|
-
|
|
15419
|
+
const ref = useRef17(null);
|
|
15420
|
+
useEffect28(() => {
|
|
15264
15421
|
if (!ref.current) return;
|
|
15265
15422
|
const svg = ref.current.ownerSVGElement;
|
|
15266
15423
|
if (!svg) return;
|
|
@@ -15317,8 +15474,8 @@ function RoughArrow({
|
|
|
15317
15474
|
arrowSize = 8,
|
|
15318
15475
|
centerY
|
|
15319
15476
|
}) {
|
|
15320
|
-
const ref =
|
|
15321
|
-
|
|
15477
|
+
const ref = useRef17(null);
|
|
15478
|
+
useEffect28(() => {
|
|
15322
15479
|
if (!ref.current) return;
|
|
15323
15480
|
const svg = ref.current.ownerSVGElement;
|
|
15324
15481
|
if (!svg) return;
|
|
@@ -15654,7 +15811,7 @@ function FlowMap({
|
|
|
15654
15811
|
return aIdx - bIdx;
|
|
15655
15812
|
}
|
|
15656
15813
|
);
|
|
15657
|
-
const containerRef =
|
|
15814
|
+
const containerRef = useRef17(null);
|
|
15658
15815
|
const hasDescription = stageBefore?.description || sourceEntries.some(([, s]) => s.description) || preTransformerList.some((p) => p.config.description) || collector?.description || postTransformerList.some((p) => p.config.description) || destinationEntries.some(([, d]) => d.description) || stageAfter?.description || destinationEntries.some(([, d]) => d.after?.description);
|
|
15659
15816
|
const hasLink = stageBefore?.link !== false || sourceEntries.some(([, s]) => s.link !== false) || preTransformerList.some((p) => p.config.link !== false) || collector?.link !== false || postTransformerList.some((p) => p.config.link !== false) || destinationEntries.some(([, d]) => d.link !== false) || stageAfter?.link !== false || destinationEntries.some(([, d]) => d.after?.link !== false);
|
|
15660
15817
|
const stageMarkerPositions = [
|
|
@@ -15995,7 +16152,7 @@ function FlowMap({
|
|
|
15995
16152
|
}
|
|
15996
16153
|
return collectorPos;
|
|
15997
16154
|
};
|
|
15998
|
-
return /* @__PURE__ */ jsxs67(
|
|
16155
|
+
return /* @__PURE__ */ jsxs67(Fragment10, { children: [
|
|
15999
16156
|
!stageBefore && sourceEntries.length === 1 && /* @__PURE__ */ jsx90(
|
|
16000
16157
|
RoughArrow,
|
|
16001
16158
|
{
|
|
@@ -16174,7 +16331,7 @@ function FlowMap({
|
|
|
16174
16331
|
const fromY = collectorCenterY;
|
|
16175
16332
|
const toY = firstPostPos.y + boxHeight / 2;
|
|
16176
16333
|
const offset = withReturn ? ARROW_OFFSET : 0;
|
|
16177
|
-
return /* @__PURE__ */ jsxs67(
|
|
16334
|
+
return /* @__PURE__ */ jsxs67(Fragment10, { children: [
|
|
16178
16335
|
/* @__PURE__ */ jsx90(
|
|
16179
16336
|
RoughArrow,
|
|
16180
16337
|
{
|
|
@@ -16241,7 +16398,7 @@ function FlowMap({
|
|
|
16241
16398
|
const stageHighlight = config?.highlight !== false;
|
|
16242
16399
|
const labelY = text ? pos.y + pos.height * 0.28 : pos.y + pos.height / 2;
|
|
16243
16400
|
const linkUrl = link === false ? null : typeof link === "string" ? link : defaultLink;
|
|
16244
|
-
const stageContent = /* @__PURE__ */ jsxs67(
|
|
16401
|
+
const stageContent = /* @__PURE__ */ jsxs67(Fragment10, { children: [
|
|
16245
16402
|
/* @__PURE__ */ jsx90(
|
|
16246
16403
|
RoughRect,
|
|
16247
16404
|
{
|
|
@@ -16795,7 +16952,7 @@ function Spinner({ size = "md", className = "" }) {
|
|
|
16795
16952
|
}
|
|
16796
16953
|
|
|
16797
16954
|
// src/components/atoms/submit-button.tsx
|
|
16798
|
-
import { Fragment as
|
|
16955
|
+
import { Fragment as Fragment11, jsx as jsx97, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
16799
16956
|
function SubmitButton({
|
|
16800
16957
|
children,
|
|
16801
16958
|
loadingText,
|
|
@@ -16815,7 +16972,7 @@ function SubmitButton({
|
|
|
16815
16972
|
disabled: isDisabled,
|
|
16816
16973
|
onClick,
|
|
16817
16974
|
className: `elb-submit-button elb-submit-button--${variant} ${fullWidth ? "elb-submit-button--full-width" : ""} ${loading ? "elb-submit-button--loading" : ""} ${className}`.trim(),
|
|
16818
|
-
children: loading ? /* @__PURE__ */ jsxs72(
|
|
16975
|
+
children: loading ? /* @__PURE__ */ jsxs72(Fragment11, { children: [
|
|
16819
16976
|
/* @__PURE__ */ jsx97(Spinner, { size: "sm", className: "elb-submit-button__spinner" }),
|
|
16820
16977
|
/* @__PURE__ */ jsx97("span", { children: loadingText ?? children })
|
|
16821
16978
|
] }) : children
|
|
@@ -16880,8 +17037,8 @@ function ConfigFormCard({
|
|
|
16880
17037
|
}
|
|
16881
17038
|
|
|
16882
17039
|
// src/components/molecules/split-button.tsx
|
|
16883
|
-
import { useState as useState40, useRef as
|
|
16884
|
-
import { Fragment as
|
|
17040
|
+
import { useState as useState40, useRef as useRef18, useEffect as useEffect29, useCallback as useCallback19 } from "react";
|
|
17041
|
+
import { Fragment as Fragment12, jsx as jsx100, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
16885
17042
|
function SplitButton({
|
|
16886
17043
|
children,
|
|
16887
17044
|
onClick,
|
|
@@ -16893,7 +17050,7 @@ function SplitButton({
|
|
|
16893
17050
|
className = ""
|
|
16894
17051
|
}) {
|
|
16895
17052
|
const [open, setOpen] = useState40(false);
|
|
16896
|
-
const ref =
|
|
17053
|
+
const ref = useRef18(null);
|
|
16897
17054
|
const isDisabled = disabled || loading;
|
|
16898
17055
|
const handleClickOutside = useCallback19((e) => {
|
|
16899
17056
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
@@ -16903,7 +17060,7 @@ function SplitButton({
|
|
|
16903
17060
|
const handleKeyDown = useCallback19((e) => {
|
|
16904
17061
|
if (e.key === "Escape") setOpen(false);
|
|
16905
17062
|
}, []);
|
|
16906
|
-
|
|
17063
|
+
useEffect29(() => {
|
|
16907
17064
|
if (open) {
|
|
16908
17065
|
document.addEventListener("mousedown", handleClickOutside);
|
|
16909
17066
|
document.addEventListener("keydown", handleKeyDown);
|
|
@@ -16929,7 +17086,7 @@ function SplitButton({
|
|
|
16929
17086
|
children: loading ? loadingText ?? children : children
|
|
16930
17087
|
}
|
|
16931
17088
|
),
|
|
16932
|
-
actions.length > 0 && /* @__PURE__ */ jsxs75(
|
|
17089
|
+
actions.length > 0 && /* @__PURE__ */ jsxs75(Fragment12, { children: [
|
|
16933
17090
|
/* @__PURE__ */ jsx100(
|
|
16934
17091
|
"button",
|
|
16935
17092
|
{
|
|
@@ -16985,9 +17142,9 @@ import { jsx as jsx101, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
|
16985
17142
|
var STATUS_DOT = {
|
|
16986
17143
|
active: "elb-flow-selector__dot--active",
|
|
16987
17144
|
published: "elb-flow-selector__dot--active",
|
|
16988
|
-
bundling: "elb-flow-selector__dot--deploying",
|
|
16989
17145
|
deploying: "elb-flow-selector__dot--deploying",
|
|
16990
|
-
failed: "elb-flow-selector__dot--failed"
|
|
17146
|
+
failed: "elb-flow-selector__dot--failed",
|
|
17147
|
+
stopped: "elb-flow-selector__dot--failed"
|
|
16991
17148
|
};
|
|
16992
17149
|
function FlowSelector({
|
|
16993
17150
|
flows,
|
|
@@ -17018,117 +17175,6 @@ function FlowSelector({
|
|
|
17018
17175
|
}) });
|
|
17019
17176
|
}
|
|
17020
17177
|
|
|
17021
|
-
// src/components/molecules/flow-deploy-panel.tsx
|
|
17022
|
-
import { Fragment as Fragment14, jsx as jsx102, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
17023
|
-
function statusLabel(status) {
|
|
17024
|
-
switch (status) {
|
|
17025
|
-
case "active":
|
|
17026
|
-
return "Active";
|
|
17027
|
-
case "published":
|
|
17028
|
-
return "Published";
|
|
17029
|
-
case "bundling":
|
|
17030
|
-
case "deploying":
|
|
17031
|
-
return "Deploying...";
|
|
17032
|
-
case "failed":
|
|
17033
|
-
return "Failed";
|
|
17034
|
-
default:
|
|
17035
|
-
return status;
|
|
17036
|
-
}
|
|
17037
|
-
}
|
|
17038
|
-
function statusDotClass(status) {
|
|
17039
|
-
switch (status) {
|
|
17040
|
-
case "active":
|
|
17041
|
-
case "published":
|
|
17042
|
-
return "elb-flow-deploy-panel__dot--active";
|
|
17043
|
-
case "bundling":
|
|
17044
|
-
case "deploying":
|
|
17045
|
-
return "elb-flow-deploy-panel__dot--deploying";
|
|
17046
|
-
case "failed":
|
|
17047
|
-
return "elb-flow-deploy-panel__dot--failed";
|
|
17048
|
-
default:
|
|
17049
|
-
return "";
|
|
17050
|
-
}
|
|
17051
|
-
}
|
|
17052
|
-
function primaryLabel(deployment, flowName, multipleFlows) {
|
|
17053
|
-
const name = multipleFlows ? ` "${flowName}"` : "";
|
|
17054
|
-
if (!deployment) return `Deploy${name}`;
|
|
17055
|
-
switch (deployment.status) {
|
|
17056
|
-
case "failed":
|
|
17057
|
-
return `Retry${name}`;
|
|
17058
|
-
case "active":
|
|
17059
|
-
case "published":
|
|
17060
|
-
return `Redeploy${name}`;
|
|
17061
|
-
default:
|
|
17062
|
-
return `Deploy${name}`;
|
|
17063
|
-
}
|
|
17064
|
-
}
|
|
17065
|
-
function FlowDeployPanel({
|
|
17066
|
-
flowName,
|
|
17067
|
-
platform,
|
|
17068
|
-
deployment,
|
|
17069
|
-
deploying = false,
|
|
17070
|
-
error,
|
|
17071
|
-
hasUnsavedChanges = false,
|
|
17072
|
-
multipleFlows = false,
|
|
17073
|
-
onDeploy,
|
|
17074
|
-
onDeleteDeployment,
|
|
17075
|
-
onDownloadFlow,
|
|
17076
|
-
onBundle,
|
|
17077
|
-
className = ""
|
|
17078
|
-
}) {
|
|
17079
|
-
const isDeploying = deploying || deployment?.status === "bundling" || deployment?.status === "deploying";
|
|
17080
|
-
const bundleExt = platform === "server" ? ".mjs" : ".js";
|
|
17081
|
-
const actions = [
|
|
17082
|
-
{
|
|
17083
|
-
key: "download",
|
|
17084
|
-
label: "Download Flow (.json)",
|
|
17085
|
-
onClick: onDownloadFlow
|
|
17086
|
-
},
|
|
17087
|
-
{ key: "bundle", label: `Bundle (${bundleExt})`, onClick: onBundle }
|
|
17088
|
-
];
|
|
17089
|
-
return /* @__PURE__ */ jsxs77("div", { className: `elb-flow-deploy-panel ${className}`, children: [
|
|
17090
|
-
/* @__PURE__ */ jsx102("div", { className: "elb-flow-deploy-panel__status", children: deployment ? /* @__PURE__ */ jsxs77(Fragment14, { children: [
|
|
17091
|
-
/* @__PURE__ */ jsx102(
|
|
17092
|
-
"span",
|
|
17093
|
-
{
|
|
17094
|
-
className: `elb-flow-deploy-panel__dot ${statusDotClass(deployment.status)}`
|
|
17095
|
-
}
|
|
17096
|
-
),
|
|
17097
|
-
/* @__PURE__ */ jsx102("span", { className: "elb-flow-deploy-panel__status-text", children: statusLabel(deployment.status) }),
|
|
17098
|
-
deployment.createdAt && /* @__PURE__ */ jsx102("span", { className: "elb-flow-deploy-panel__time", children: new Date(deployment.createdAt).toLocaleString() })
|
|
17099
|
-
] }) : /* @__PURE__ */ jsxs77(Fragment14, { children: [
|
|
17100
|
-
/* @__PURE__ */ jsx102("span", { className: "elb-flow-deploy-panel__dot" }),
|
|
17101
|
-
/* @__PURE__ */ jsx102("span", { className: "elb-flow-deploy-panel__status-text", children: "Not deployed" })
|
|
17102
|
-
] }) }),
|
|
17103
|
-
hasUnsavedChanges && deployment && (deployment.status === "active" || deployment.status === "published") && /* @__PURE__ */ jsx102("div", { className: "elb-flow-deploy-panel__warning", children: "Config changed since last deploy" }),
|
|
17104
|
-
deployment?.publicUrl && /* @__PURE__ */ jsx102("div", { className: "elb-flow-deploy-panel__endpoint", children: /* @__PURE__ */ jsx102("code", { className: "elb-flow-deploy-panel__url", children: deployment.publicUrl }) }),
|
|
17105
|
-
deployment?.containerUrl && /* @__PURE__ */ jsx102("div", { className: "elb-flow-deploy-panel__endpoint", children: /* @__PURE__ */ jsx102("code", { className: "elb-flow-deploy-panel__url", children: deployment.containerUrl }) }),
|
|
17106
|
-
(error || deployment?.errorMessage) && /* @__PURE__ */ jsx102("div", { className: "elb-flow-deploy-panel__error", children: error || deployment?.errorMessage }),
|
|
17107
|
-
/* @__PURE__ */ jsxs77("div", { className: "elb-flow-deploy-panel__actions", children: [
|
|
17108
|
-
/* @__PURE__ */ jsx102(
|
|
17109
|
-
SplitButton,
|
|
17110
|
-
{
|
|
17111
|
-
onClick: onDeploy,
|
|
17112
|
-
actions,
|
|
17113
|
-
loading: isDeploying,
|
|
17114
|
-
loadingText: "Deploying...",
|
|
17115
|
-
disabled: isDeploying,
|
|
17116
|
-
children: primaryLabel(deployment, flowName, multipleFlows)
|
|
17117
|
-
}
|
|
17118
|
-
),
|
|
17119
|
-
deployment && deployment.status !== "bundling" && deployment.status !== "deploying" && /* @__PURE__ */ jsx102(
|
|
17120
|
-
"button",
|
|
17121
|
-
{
|
|
17122
|
-
type: "button",
|
|
17123
|
-
className: "elb-flow-deploy-panel__delete",
|
|
17124
|
-
onClick: onDeleteDeployment,
|
|
17125
|
-
children: "Delete deployment"
|
|
17126
|
-
}
|
|
17127
|
-
)
|
|
17128
|
-
] })
|
|
17129
|
-
] });
|
|
17130
|
-
}
|
|
17131
|
-
|
|
17132
17178
|
// src/schemas/config-structures/destination-config.ts
|
|
17133
17179
|
var DESTINATION_CONFIG_STRUCTURE = {
|
|
17134
17180
|
type: "object",
|
|
@@ -17215,13 +17261,13 @@ var DESTINATION_CONFIG_STRUCTURE = {
|
|
|
17215
17261
|
};
|
|
17216
17262
|
|
|
17217
17263
|
// src/components/atoms/footer.tsx
|
|
17218
|
-
import { jsx as
|
|
17264
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
17219
17265
|
function Footer({ children, className = "" }) {
|
|
17220
|
-
return /* @__PURE__ */
|
|
17266
|
+
return /* @__PURE__ */ jsx102("div", { className: `elb-explorer-footer ${className}`, children });
|
|
17221
17267
|
}
|
|
17222
17268
|
|
|
17223
17269
|
// src/components/atoms/button-link.tsx
|
|
17224
|
-
import { jsx as
|
|
17270
|
+
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
17225
17271
|
function ButtonLink({
|
|
17226
17272
|
variant = "default",
|
|
17227
17273
|
size = "md",
|
|
@@ -17234,9 +17280,9 @@ function ButtonLink({
|
|
|
17234
17280
|
const baseClass = "elb-button-link";
|
|
17235
17281
|
const classes = `${baseClass} ${baseClass}-${variant} ${baseClass}-${size} ${className}`.trim();
|
|
17236
17282
|
if (href && !disabled) {
|
|
17237
|
-
return /* @__PURE__ */
|
|
17283
|
+
return /* @__PURE__ */ jsx103("a", { href, className: classes, children });
|
|
17238
17284
|
}
|
|
17239
|
-
return /* @__PURE__ */
|
|
17285
|
+
return /* @__PURE__ */ jsx103(
|
|
17240
17286
|
"button",
|
|
17241
17287
|
{
|
|
17242
17288
|
type: "button",
|
|
@@ -17249,24 +17295,24 @@ function ButtonLink({
|
|
|
17249
17295
|
}
|
|
17250
17296
|
|
|
17251
17297
|
// src/components/atoms/panel-hints.tsx
|
|
17252
|
-
import { jsx as
|
|
17298
|
+
import { jsx as jsx104, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
17253
17299
|
function PanelHints({
|
|
17254
17300
|
title = "Common patterns",
|
|
17255
17301
|
hints,
|
|
17256
17302
|
className = ""
|
|
17257
17303
|
}) {
|
|
17258
|
-
return /* @__PURE__ */
|
|
17259
|
-
title && /* @__PURE__ */
|
|
17260
|
-
/* @__PURE__ */
|
|
17261
|
-
/* @__PURE__ */
|
|
17262
|
-
/* @__PURE__ */
|
|
17304
|
+
return /* @__PURE__ */ jsxs77("div", { className: `elb-panel-hints ${className}`, children: [
|
|
17305
|
+
title && /* @__PURE__ */ jsx104("div", { className: "elb-panel-hints-title", children: title }),
|
|
17306
|
+
/* @__PURE__ */ jsx104("ul", { className: "elb-panel-hints-list", children: hints.map((hint, index) => /* @__PURE__ */ jsxs77("li", { className: "elb-panel-hints-item", children: [
|
|
17307
|
+
/* @__PURE__ */ jsx104("code", { className: "elb-panel-hints-code", children: hint.code }),
|
|
17308
|
+
/* @__PURE__ */ jsx104("span", { className: "elb-panel-hints-desc", children: hint.description })
|
|
17263
17309
|
] }, index)) })
|
|
17264
17310
|
] });
|
|
17265
17311
|
}
|
|
17266
17312
|
|
|
17267
17313
|
// src/components/atoms/form-input.tsx
|
|
17268
17314
|
import { useId as useId2 } from "react";
|
|
17269
|
-
import { jsx as
|
|
17315
|
+
import { jsx as jsx105 } from "react/jsx-runtime";
|
|
17270
17316
|
function FormInput({
|
|
17271
17317
|
value,
|
|
17272
17318
|
onChange,
|
|
@@ -17285,7 +17331,7 @@ function FormInput({
|
|
|
17285
17331
|
const inputId = id ?? generatedId;
|
|
17286
17332
|
const hasError = Boolean(error);
|
|
17287
17333
|
const errorMessage = typeof error === "string" ? error : void 0;
|
|
17288
|
-
return /* @__PURE__ */
|
|
17334
|
+
return /* @__PURE__ */ jsx105(
|
|
17289
17335
|
FormField,
|
|
17290
17336
|
{
|
|
17291
17337
|
label,
|
|
@@ -17293,7 +17339,7 @@ function FormInput({
|
|
|
17293
17339
|
error: errorMessage,
|
|
17294
17340
|
required,
|
|
17295
17341
|
className,
|
|
17296
|
-
children: /* @__PURE__ */
|
|
17342
|
+
children: /* @__PURE__ */ jsx105(
|
|
17297
17343
|
"input",
|
|
17298
17344
|
{
|
|
17299
17345
|
id: inputId,
|
|
@@ -17352,7 +17398,7 @@ function MDXProvider(properties) {
|
|
|
17352
17398
|
|
|
17353
17399
|
// src/components/atoms/mdx-code.tsx
|
|
17354
17400
|
import { Children } from "react";
|
|
17355
|
-
import { jsx as
|
|
17401
|
+
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
17356
17402
|
var MDXCode = ({
|
|
17357
17403
|
className,
|
|
17358
17404
|
children
|
|
@@ -17366,7 +17412,7 @@ var MDXCode = ({
|
|
|
17366
17412
|
return false;
|
|
17367
17413
|
});
|
|
17368
17414
|
if (!hasClassName || !hasNewlines) {
|
|
17369
|
-
return /* @__PURE__ */
|
|
17415
|
+
return /* @__PURE__ */ jsx106("code", { className: "elb-code-inline", children });
|
|
17370
17416
|
}
|
|
17371
17417
|
const mdxLanguage = className.replace(/^language-/, "");
|
|
17372
17418
|
const languageMap = {
|
|
@@ -17381,7 +17427,7 @@ var MDXCode = ({
|
|
|
17381
17427
|
};
|
|
17382
17428
|
const monacoLanguage = languageMap[mdxLanguage] || mdxLanguage;
|
|
17383
17429
|
const code = childrenArray.map((child) => typeof child === "string" ? child : "").join("").trim();
|
|
17384
|
-
return /* @__PURE__ */
|
|
17430
|
+
return /* @__PURE__ */ jsx106(
|
|
17385
17431
|
CodeBox,
|
|
17386
17432
|
{
|
|
17387
17433
|
code,
|
|
@@ -17395,7 +17441,7 @@ var MDXCode = ({
|
|
|
17395
17441
|
};
|
|
17396
17442
|
|
|
17397
17443
|
// src/providers/MDXProvider.tsx
|
|
17398
|
-
import { jsx as
|
|
17444
|
+
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
17399
17445
|
var MDXProvider2 = ({ children }) => {
|
|
17400
17446
|
const components = {
|
|
17401
17447
|
// Markdown element mappings
|
|
@@ -17407,14 +17453,14 @@ var MDXProvider2 = ({ children }) => {
|
|
|
17407
17453
|
DestinationInitDemo,
|
|
17408
17454
|
DestinationDemo
|
|
17409
17455
|
};
|
|
17410
|
-
return /* @__PURE__ */
|
|
17456
|
+
return /* @__PURE__ */ jsx107(MDXProvider, { components, children });
|
|
17411
17457
|
};
|
|
17412
17458
|
|
|
17413
17459
|
// src/hooks/useDropdown.ts
|
|
17414
|
-
import { useState as useState41, useRef as
|
|
17460
|
+
import { useState as useState41, useRef as useRef19, useEffect as useEffect30, useCallback as useCallback20 } from "react";
|
|
17415
17461
|
function useDropdown() {
|
|
17416
17462
|
const [isOpen, setIsOpen] = useState41(false);
|
|
17417
|
-
const containerRef =
|
|
17463
|
+
const containerRef = useRef19(null);
|
|
17418
17464
|
const toggle = useCallback20(() => {
|
|
17419
17465
|
setIsOpen((prev) => !prev);
|
|
17420
17466
|
}, []);
|
|
@@ -17424,7 +17470,7 @@ function useDropdown() {
|
|
|
17424
17470
|
const close = useCallback20(() => {
|
|
17425
17471
|
setIsOpen(false);
|
|
17426
17472
|
}, []);
|
|
17427
|
-
|
|
17473
|
+
useEffect30(() => {
|
|
17428
17474
|
if (!isOpen) return;
|
|
17429
17475
|
function handleClickOutside(event) {
|
|
17430
17476
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
@@ -17434,7 +17480,7 @@ function useDropdown() {
|
|
|
17434
17480
|
document.addEventListener("mousedown", handleClickOutside);
|
|
17435
17481
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
17436
17482
|
}, [isOpen]);
|
|
17437
|
-
|
|
17483
|
+
useEffect30(() => {
|
|
17438
17484
|
if (!isOpen) return;
|
|
17439
17485
|
function handleEscape(event) {
|
|
17440
17486
|
if (event.key === "Escape") {
|
|
@@ -17474,7 +17520,6 @@ export {
|
|
|
17474
17520
|
Dropdown,
|
|
17475
17521
|
DropdownDivider,
|
|
17476
17522
|
DropdownItem,
|
|
17477
|
-
FlowDeployPanel,
|
|
17478
17523
|
FlowMap,
|
|
17479
17524
|
FlowSelector,
|
|
17480
17525
|
Footer,
|
|
@@ -17508,15 +17553,18 @@ export {
|
|
|
17508
17553
|
createPlausibleDestination,
|
|
17509
17554
|
createRawCapture,
|
|
17510
17555
|
formatCapturedCalls,
|
|
17556
|
+
generateModelPath,
|
|
17511
17557
|
initializeMonacoTypes,
|
|
17512
17558
|
lighthouseTheme,
|
|
17513
17559
|
loadPackageTypes,
|
|
17514
17560
|
loadTypeLibraryFromURL,
|
|
17515
17561
|
palenightTheme,
|
|
17516
17562
|
registerAllThemes,
|
|
17563
|
+
registerJsonSchema,
|
|
17517
17564
|
registerLighthouseTheme,
|
|
17518
17565
|
registerPalenightTheme,
|
|
17519
17566
|
registerWalkerOSTypes,
|
|
17567
|
+
unregisterJsonSchema,
|
|
17520
17568
|
useDropdown
|
|
17521
17569
|
};
|
|
17522
17570
|
//# sourceMappingURL=index.mjs.map
|