@walkeros/explorer 1.0.2 → 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/LICENSE +2 -2
- package/STYLE.md +240 -136
- package/dist/{chunk-VWWAIDNX.mjs → chunk-YKT4D7MG.mjs} +201 -53
- package/dist/chunk-YKT4D7MG.mjs.map +1 -0
- package/dist/components/atoms/alert.d.ts +29 -0
- package/dist/components/atoms/alert.d.ts.map +1 -0
- package/dist/components/atoms/alert.js +19 -0
- package/dist/components/atoms/alert.js.map +1 -0
- package/dist/components/atoms/alert.stories.d.ts +7 -0
- package/dist/components/atoms/alert.stories.d.ts.map +1 -0
- package/dist/components/atoms/alert.stories.js +14 -0
- package/dist/components/atoms/alert.stories.js.map +1 -0
- package/dist/components/atoms/button.stories.d.ts +14 -0
- package/dist/components/atoms/button.stories.d.ts.map +1 -0
- package/dist/components/atoms/button.stories.js +25 -0
- package/dist/components/atoms/button.stories.js.map +1 -0
- 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 +45 -12
- package/dist/components/atoms/code.js.map +1 -1
- package/dist/components/atoms/footer.stories.d.ts +14 -0
- package/dist/components/atoms/footer.stories.d.ts.map +1 -0
- package/dist/components/atoms/footer.stories.js +29 -0
- package/dist/components/atoms/footer.stories.js.map +1 -0
- package/dist/components/atoms/form-field.d.ts +28 -0
- package/dist/components/atoms/form-field.d.ts.map +1 -0
- package/dist/components/atoms/form-field.js +16 -0
- package/dist/components/atoms/form-field.js.map +1 -0
- package/dist/components/atoms/form-field.stories.d.ts +7 -0
- package/dist/components/atoms/form-field.stories.d.ts.map +1 -0
- package/dist/components/atoms/form-field.stories.js +16 -0
- package/dist/components/atoms/form-field.stories.js.map +1 -0
- package/dist/components/atoms/form-input.d.ts +43 -0
- package/dist/components/atoms/form-input.d.ts.map +1 -0
- package/dist/components/atoms/form-input.js +26 -0
- package/dist/components/atoms/form-input.js.map +1 -0
- package/dist/components/atoms/form-input.stories.d.ts +7 -0
- package/dist/components/atoms/form-input.stories.d.ts.map +1 -0
- package/dist/components/atoms/form-input.stories.js +17 -0
- package/dist/components/atoms/form-input.stories.js.map +1 -0
- package/dist/components/atoms/form-textarea.d.ts +41 -0
- package/dist/components/atoms/form-textarea.d.ts.map +1 -0
- package/dist/components/atoms/form-textarea.js +26 -0
- package/dist/components/atoms/form-textarea.js.map +1 -0
- package/dist/components/atoms/form-textarea.stories.d.ts +7 -0
- package/dist/components/atoms/form-textarea.stories.d.ts.map +1 -0
- package/dist/components/atoms/form-textarea.stories.js +17 -0
- package/dist/components/atoms/form-textarea.stories.js.map +1 -0
- package/dist/components/atoms/grid.stories.d.ts +18 -0
- package/dist/components/atoms/grid.stories.d.ts.map +1 -0
- package/dist/components/atoms/grid.stories.js +60 -0
- package/dist/components/atoms/grid.stories.js.map +1 -0
- package/dist/components/atoms/header.stories.d.ts +15 -0
- package/dist/components/atoms/header.stories.d.ts.map +1 -0
- package/dist/components/atoms/header.stories.js +37 -0
- package/dist/components/atoms/header.stories.js.map +1 -0
- package/dist/components/atoms/icons/icon.stories.d.ts +18 -0
- package/dist/components/atoms/icons/icon.stories.d.ts.map +1 -0
- package/dist/components/atoms/icons/icon.stories.js +37 -0
- package/dist/components/atoms/icons/icon.stories.js.map +1 -0
- package/dist/components/atoms/panel-hints.stories.d.ts +14 -0
- package/dist/components/atoms/panel-hints.stories.d.ts.map +1 -0
- package/dist/components/atoms/panel-hints.stories.js +35 -0
- package/dist/components/atoms/panel-hints.stories.js.map +1 -0
- package/dist/components/atoms/spinner.d.ts +17 -0
- package/dist/components/atoms/spinner.d.ts.map +1 -0
- package/dist/components/atoms/spinner.js +14 -0
- package/dist/components/atoms/spinner.js.map +1 -0
- package/dist/components/atoms/spinner.stories.d.ts +7 -0
- package/dist/components/atoms/spinner.stories.d.ts.map +1 -0
- package/dist/components/atoms/spinner.stories.js +9 -0
- package/dist/components/atoms/spinner.stories.js.map +1 -0
- package/dist/components/atoms/submit-button.d.ts +34 -0
- package/dist/components/atoms/submit-button.d.ts.map +1 -0
- package/dist/components/atoms/submit-button.js +18 -0
- package/dist/components/atoms/submit-button.js.map +1 -0
- package/dist/components/atoms/submit-button.stories.d.ts +7 -0
- package/dist/components/atoms/submit-button.stories.d.ts.map +1 -0
- package/dist/components/atoms/submit-button.stories.js +13 -0
- package/dist/components/atoms/submit-button.stories.js.map +1 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.stories.js +1 -1
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.stories.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 +21 -0
- package/dist/components/molecules/code-box.stories.d.ts.map +1 -1
- package/dist/components/molecules/code-box.stories.js +112 -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/config-form-card.d.ts +50 -0
- package/dist/components/molecules/config-form-card.d.ts.map +1 -0
- package/dist/components/molecules/config-form-card.js +30 -0
- package/dist/components/molecules/config-form-card.js.map +1 -0
- package/dist/components/molecules/config-form-card.stories.d.ts +7 -0
- package/dist/components/molecules/config-form-card.stories.d.ts.map +1 -0
- package/dist/components/molecules/config-form-card.stories.js +21 -0
- package/dist/components/molecules/config-form-card.stories.js.map +1 -0
- package/dist/components/molecules/dropdown.d.ts +68 -0
- package/dist/components/molecules/dropdown.d.ts.map +1 -0
- package/dist/components/molecules/dropdown.js +47 -0
- package/dist/components/molecules/dropdown.js.map +1 -0
- package/dist/components/molecules/dropdown.stories.d.ts +7 -0
- package/dist/components/molecules/dropdown.stories.d.ts.map +1 -0
- package/dist/components/molecules/dropdown.stories.js +18 -0
- package/dist/components/molecules/dropdown.stories.js.map +1 -0
- package/dist/components/molecules/flow-map/FlowMap.stories.d.ts.map +1 -1
- package/dist/components/molecules/flow-map/FlowMap.stories.js +7 -1
- package/dist/components/molecules/flow-map/FlowMap.stories.js.map +1 -1
- package/dist/components/molecules/flow-selector.d.ts +19 -0
- package/dist/components/molecules/flow-selector.d.ts.map +1 -0
- package/dist/components/molecules/flow-selector.js +26 -0
- package/dist/components/molecules/flow-selector.js.map +1 -0
- package/dist/components/molecules/flow-selector.stories.d.ts +28 -0
- package/dist/components/molecules/flow-selector.stories.d.ts.map +1 -0
- package/dist/components/molecules/flow-selector.stories.js +66 -0
- package/dist/components/molecules/flow-selector.stories.js.map +1 -0
- package/dist/components/molecules/form-card.d.ts +28 -0
- package/dist/components/molecules/form-card.d.ts.map +1 -0
- package/dist/components/molecules/form-card.js +16 -0
- package/dist/components/molecules/form-card.js.map +1 -0
- package/dist/components/molecules/form-card.stories.d.ts +7 -0
- package/dist/components/molecules/form-card.stories.d.ts.map +1 -0
- package/dist/components/molecules/form-card.stories.js +16 -0
- package/dist/components/molecules/form-card.stories.js.map +1 -0
- package/dist/components/molecules/preview.d.ts.map +1 -1
- package/dist/components/molecules/preview.js +0 -1
- package/dist/components/molecules/preview.js.map +1 -1
- package/dist/components/molecules/split-button.d.ts +25 -0
- package/dist/components/molecules/split-button.d.ts.map +1 -0
- package/dist/components/molecules/split-button.js +37 -0
- package/dist/components/molecules/split-button.js.map +1 -0
- package/dist/components/molecules/split-button.stories.d.ts +32 -0
- package/dist/components/molecules/split-button.stories.d.ts.map +1 -0
- package/dist/components/molecules/split-button.stories.js +88 -0
- package/dist/components/molecules/split-button.stories.js.map +1 -0
- package/dist/hooks/useDropdown.d.ts +34 -0
- package/dist/hooks/useDropdown.d.ts.map +1 -0
- package/dist/hooks/useDropdown.js +66 -0
- package/dist/hooks/useDropdown.js.map +1 -0
- package/dist/index.d.cts +432 -4
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +861 -178
- package/dist/index.mjs.map +1 -1
- package/dist/{monaco-types-4FIH5OVX.mjs → monaco-types-OLSF6MIE.mjs} +2 -2
- package/dist/styles.css +534 -0
- 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 +5 -14
- package/dist/chunk-VWWAIDNX.mjs.map +0 -1
- /package/dist/{monaco-types-4FIH5OVX.mjs.map → monaco-types-OLSF6MIE.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
loadPackageTypes,
|
|
6
6
|
loadTypeLibraryFromURL,
|
|
7
7
|
registerWalkerOSTypes
|
|
8
|
-
} from "./chunk-
|
|
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,8 +885,10 @@ function Code({
|
|
|
849
885
|
fontSize = 13,
|
|
850
886
|
packages,
|
|
851
887
|
sticky = true,
|
|
852
|
-
ide = false
|
|
888
|
+
ide = false,
|
|
889
|
+
jsonSchema
|
|
853
890
|
}) {
|
|
891
|
+
const [isMounted, setIsMounted] = useState3(false);
|
|
854
892
|
const [monacoTheme, setMonacoTheme] = useState3("vs-light");
|
|
855
893
|
const decorationsCleanupRef = useRef3(null);
|
|
856
894
|
const monacoRef = useRef3(null);
|
|
@@ -888,6 +926,7 @@ function Code({
|
|
|
888
926
|
registerDataElbStyles();
|
|
889
927
|
}, []);
|
|
890
928
|
const getDataTheme = useCallback2(() => {
|
|
929
|
+
if (typeof document === "undefined") return null;
|
|
891
930
|
if (containerRef.current) {
|
|
892
931
|
const closest = containerRef.current.closest("[data-theme]");
|
|
893
932
|
if (closest) {
|
|
@@ -897,6 +936,10 @@ function Code({
|
|
|
897
936
|
return document.documentElement.getAttribute("data-theme");
|
|
898
937
|
}, []);
|
|
899
938
|
useEffect2(() => {
|
|
939
|
+
setIsMounted(true);
|
|
940
|
+
}, []);
|
|
941
|
+
useEffect2(() => {
|
|
942
|
+
if (!isMounted) return;
|
|
900
943
|
const checkTheme = () => {
|
|
901
944
|
const dataTheme = getDataTheme();
|
|
902
945
|
const isDark = dataTheme === "dark" || dataTheme === null && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
@@ -920,7 +963,7 @@ function Code({
|
|
|
920
963
|
observer.disconnect();
|
|
921
964
|
mediaQuery.removeEventListener("change", handleChange2);
|
|
922
965
|
};
|
|
923
|
-
}, [getDataTheme]);
|
|
966
|
+
}, [isMounted, getDataTheme]);
|
|
924
967
|
useEffect2(() => {
|
|
925
968
|
const editor = editorRef.current;
|
|
926
969
|
const container = containerRef.current;
|
|
@@ -935,6 +978,19 @@ function Code({
|
|
|
935
978
|
resizeObserver.disconnect();
|
|
936
979
|
};
|
|
937
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]);
|
|
938
994
|
const handleChange = (value) => {
|
|
939
995
|
if (onChange && value !== void 0) {
|
|
940
996
|
onChange(value);
|
|
@@ -942,15 +998,11 @@ function Code({
|
|
|
942
998
|
};
|
|
943
999
|
const handleBeforeMount = async (monaco) => {
|
|
944
1000
|
monacoRef.current = monaco;
|
|
945
|
-
if (beforeMount) {
|
|
946
|
-
beforeMount(monaco);
|
|
947
|
-
return;
|
|
948
|
-
}
|
|
949
1001
|
registerAllThemes(monaco);
|
|
950
1002
|
registerFormatters(monaco);
|
|
951
1003
|
if (packages && packages.length > 0) {
|
|
952
1004
|
registerWalkerOSTypes(monaco);
|
|
953
|
-
const { loadPackageTypes: loadPackageTypes2 } = await import("./monaco-types-
|
|
1005
|
+
const { loadPackageTypes: loadPackageTypes2 } = await import("./monaco-types-OLSF6MIE.mjs");
|
|
954
1006
|
for (const pkg of packages) {
|
|
955
1007
|
if (pkg !== "@walkeros/core") {
|
|
956
1008
|
await loadPackageTypes2(monaco, { package: pkg }).catch(() => {
|
|
@@ -962,6 +1014,9 @@ function Code({
|
|
|
962
1014
|
const isDark = dataTheme === "dark" || dataTheme === null && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
963
1015
|
const themeName = isDark ? "elbTheme-dark" : "elbTheme-light";
|
|
964
1016
|
monaco.editor.setTheme(themeName);
|
|
1017
|
+
if (beforeMount) {
|
|
1018
|
+
beforeMount(monaco);
|
|
1019
|
+
}
|
|
965
1020
|
};
|
|
966
1021
|
const MonacoEditor = Editor;
|
|
967
1022
|
const handleEditorMount = (monacoEditor) => {
|
|
@@ -1002,10 +1057,11 @@ function Code({
|
|
|
1002
1057
|
beforeMount: handleBeforeMount,
|
|
1003
1058
|
onMount: handleEditorMount,
|
|
1004
1059
|
theme: monacoTheme,
|
|
1060
|
+
path: modelPathRef.current || void 0,
|
|
1005
1061
|
options: {
|
|
1006
1062
|
readOnly: disabled || !onChange,
|
|
1007
1063
|
readOnlyMessage: { value: "" },
|
|
1008
|
-
minimap: { enabled:
|
|
1064
|
+
minimap: { enabled: minimap },
|
|
1009
1065
|
fontSize,
|
|
1010
1066
|
lineHeight: Math.round(fontSize * 1.5),
|
|
1011
1067
|
padding: 0,
|
|
@@ -1024,8 +1080,8 @@ function Code({
|
|
|
1024
1080
|
fixedOverflowWidgets: true,
|
|
1025
1081
|
overviewRulerLanes: 0,
|
|
1026
1082
|
renderLineHighlight: "none",
|
|
1027
|
-
renderValidationDecorations: ide ? "editable" : "off",
|
|
1028
|
-
hover: { enabled: ide },
|
|
1083
|
+
renderValidationDecorations: ide || jsonSchema ? "editable" : "off",
|
|
1084
|
+
hover: { enabled: ide || !!jsonSchema },
|
|
1029
1085
|
"semanticHighlighting.enabled": ide,
|
|
1030
1086
|
showDeprecated: ide,
|
|
1031
1087
|
showUnused: ide,
|
|
@@ -1059,8 +1115,7 @@ function Code({
|
|
|
1059
1115
|
// Don't select line when clicking line numbers
|
|
1060
1116
|
wordBasedSuggestions: "off",
|
|
1061
1117
|
// Reduce auto-completion interference
|
|
1062
|
-
quickSuggestions: false,
|
|
1063
|
-
// Disable quick suggestions popup
|
|
1118
|
+
quickSuggestions: jsonSchema ? { strings: true, other: true, comments: false } : false,
|
|
1064
1119
|
stickyScroll: { enabled: sticky }
|
|
1065
1120
|
}
|
|
1066
1121
|
}
|
|
@@ -1068,7 +1123,7 @@ function Code({
|
|
|
1068
1123
|
}
|
|
1069
1124
|
|
|
1070
1125
|
// src/components/molecules/code-box.tsx
|
|
1071
|
-
import {
|
|
1126
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1072
1127
|
function CodeBox({
|
|
1073
1128
|
// Code props (single code mode)
|
|
1074
1129
|
code,
|
|
@@ -1088,8 +1143,9 @@ function CodeBox({
|
|
|
1088
1143
|
// Visual
|
|
1089
1144
|
showTrafficLights = false,
|
|
1090
1145
|
// Actions
|
|
1091
|
-
showCopy =
|
|
1146
|
+
showCopy = true,
|
|
1092
1147
|
showFormat = false,
|
|
1148
|
+
showSettings = false,
|
|
1093
1149
|
// Layout
|
|
1094
1150
|
footer,
|
|
1095
1151
|
height,
|
|
@@ -1098,6 +1154,24 @@ function CodeBox({
|
|
|
1098
1154
|
...codeProps
|
|
1099
1155
|
}) {
|
|
1100
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]);
|
|
1101
1175
|
const [currentTabId, setCurrentTabId] = useState4(
|
|
1102
1176
|
controlledActiveTab ?? defaultTab ?? tabs?.[0]?.id ?? ""
|
|
1103
1177
|
);
|
|
@@ -1130,7 +1204,13 @@ function CodeBox({
|
|
|
1130
1204
|
} catch (e) {
|
|
1131
1205
|
}
|
|
1132
1206
|
};
|
|
1133
|
-
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: [
|
|
1134
1214
|
showFormat && !disabled && currentLanguage === "json" && /* @__PURE__ */ jsx4(
|
|
1135
1215
|
"button",
|
|
1136
1216
|
{
|
|
@@ -1149,8 +1229,10 @@ function CodeBox({
|
|
|
1149
1229
|
strokeLinecap: "round",
|
|
1150
1230
|
strokeLinejoin: "round",
|
|
1151
1231
|
children: [
|
|
1152
|
-
/* @__PURE__ */ jsx4("
|
|
1153
|
-
/* @__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" })
|
|
1154
1236
|
]
|
|
1155
1237
|
}
|
|
1156
1238
|
)
|
|
@@ -1193,7 +1275,80 @@ function CodeBox({
|
|
|
1193
1275
|
}
|
|
1194
1276
|
)
|
|
1195
1277
|
}
|
|
1196
|
-
)
|
|
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
|
+
] })
|
|
1197
1352
|
] });
|
|
1198
1353
|
const autoHeightClass = autoHeight ? "elb-box--auto-height" : "";
|
|
1199
1354
|
const boxClassName = `${autoHeightClass} ${className || ""}`.trim();
|
|
@@ -1208,7 +1363,8 @@ function CodeBox({
|
|
|
1208
1363
|
onChange,
|
|
1209
1364
|
disabled,
|
|
1210
1365
|
autoHeight,
|
|
1211
|
-
...codeProps
|
|
1366
|
+
...codeProps,
|
|
1367
|
+
...settingsProps
|
|
1212
1368
|
}
|
|
1213
1369
|
)
|
|
1214
1370
|
}));
|
|
@@ -1235,7 +1391,8 @@ function CodeBox({
|
|
|
1235
1391
|
onChange,
|
|
1236
1392
|
disabled,
|
|
1237
1393
|
autoHeight,
|
|
1238
|
-
...codeProps
|
|
1394
|
+
...codeProps,
|
|
1395
|
+
...settingsProps
|
|
1239
1396
|
}
|
|
1240
1397
|
)
|
|
1241
1398
|
}
|
|
@@ -1244,9 +1401,9 @@ function CodeBox({
|
|
|
1244
1401
|
|
|
1245
1402
|
// src/components/atoms/grid.tsx
|
|
1246
1403
|
import {
|
|
1247
|
-
useRef as
|
|
1404
|
+
useRef as useRef5,
|
|
1248
1405
|
useState as useState5,
|
|
1249
|
-
useEffect as
|
|
1406
|
+
useEffect as useEffect4,
|
|
1250
1407
|
useCallback as useCallback4,
|
|
1251
1408
|
useMemo
|
|
1252
1409
|
} from "react";
|
|
@@ -1261,11 +1418,11 @@ function Grid({
|
|
|
1261
1418
|
showScrollButtons = true,
|
|
1262
1419
|
className = ""
|
|
1263
1420
|
}) {
|
|
1264
|
-
const gridRef =
|
|
1421
|
+
const gridRef = useRef5(null);
|
|
1265
1422
|
const [canScrollLeft, setCanScrollLeft] = useState5(false);
|
|
1266
1423
|
const [canScrollRight, setCanScrollRight] = useState5(false);
|
|
1267
1424
|
const [boxHeights, setBoxHeights] = useState5(/* @__PURE__ */ new Map());
|
|
1268
|
-
const boxIdCounter =
|
|
1425
|
+
const boxIdCounter = useRef5(0);
|
|
1269
1426
|
const getBoxId = useCallback4(() => boxIdCounter.current++, []);
|
|
1270
1427
|
const registerBox = useCallback4((id, height) => {
|
|
1271
1428
|
setBoxHeights((prev) => {
|
|
@@ -1338,7 +1495,7 @@ function Grid({
|
|
|
1338
1495
|
const scrollAmount = gridRef.current.clientWidth * 0.8;
|
|
1339
1496
|
gridRef.current.scrollBy({ left: scrollAmount, behavior: "smooth" });
|
|
1340
1497
|
};
|
|
1341
|
-
|
|
1498
|
+
useEffect4(() => {
|
|
1342
1499
|
const el = gridRef.current;
|
|
1343
1500
|
if (!el || !showScrollButtons) return;
|
|
1344
1501
|
updateScrollState();
|
|
@@ -1401,7 +1558,7 @@ function MappingDemo({
|
|
|
1401
1558
|
);
|
|
1402
1559
|
}
|
|
1403
1560
|
}, [input, config, fn]);
|
|
1404
|
-
|
|
1561
|
+
useEffect5(() => {
|
|
1405
1562
|
const timeoutId = setTimeout(updateOutput, 500);
|
|
1406
1563
|
return () => clearTimeout(timeoutId);
|
|
1407
1564
|
}, [updateOutput]);
|
|
@@ -1442,7 +1599,7 @@ function MappingDemo({
|
|
|
1442
1599
|
}
|
|
1443
1600
|
|
|
1444
1601
|
// src/components/demos/MappingCode.tsx
|
|
1445
|
-
import { useState as useState7, useCallback as useCallback6, useEffect as
|
|
1602
|
+
import { useState as useState7, useCallback as useCallback6, useEffect as useEffect6 } from "react";
|
|
1446
1603
|
import { getMappingEvent, getMappingValue, createEvent } from "@walkeros/core";
|
|
1447
1604
|
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1448
1605
|
function MappingCode({
|
|
@@ -1475,7 +1632,7 @@ function MappingCode({
|
|
|
1475
1632
|
);
|
|
1476
1633
|
}
|
|
1477
1634
|
}, [input, config]);
|
|
1478
|
-
|
|
1635
|
+
useEffect6(() => {
|
|
1479
1636
|
const timeoutId = setTimeout(executeCode, 500);
|
|
1480
1637
|
return () => clearTimeout(timeoutId);
|
|
1481
1638
|
}, [executeCode]);
|
|
@@ -1494,7 +1651,7 @@ function MappingCode({
|
|
|
1494
1651
|
}
|
|
1495
1652
|
|
|
1496
1653
|
// src/components/demos/DestinationDemo.tsx
|
|
1497
|
-
import { useState as useState8, useCallback as useCallback7, useEffect as
|
|
1654
|
+
import { useState as useState8, useCallback as useCallback7, useEffect as useEffect7 } from "react";
|
|
1498
1655
|
import {
|
|
1499
1656
|
createEvent as createEvent2,
|
|
1500
1657
|
tryCatchAsync,
|
|
@@ -1623,7 +1780,7 @@ function DestinationDemo({
|
|
|
1623
1780
|
(error) => setOutput(`Error: ${error}`)
|
|
1624
1781
|
)();
|
|
1625
1782
|
}, [eventInput, mappingInput, destination, settings, generic, fn]);
|
|
1626
|
-
|
|
1783
|
+
useEffect7(() => {
|
|
1627
1784
|
const timeoutId = setTimeout(executeDestination, 500);
|
|
1628
1785
|
return () => clearTimeout(timeoutId);
|
|
1629
1786
|
}, [executeDestination]);
|
|
@@ -1664,7 +1821,7 @@ function DestinationDemo({
|
|
|
1664
1821
|
}
|
|
1665
1822
|
|
|
1666
1823
|
// src/components/demos/DestinationInitDemo.tsx
|
|
1667
|
-
import { useState as useState9, useCallback as useCallback8, useEffect as
|
|
1824
|
+
import { useState as useState9, useCallback as useCallback8, useEffect as useEffect8 } from "react";
|
|
1668
1825
|
import { tryCatchAsync as tryCatchAsync2 } from "@walkeros/core";
|
|
1669
1826
|
import { startFlow as startFlow2 } from "@walkeros/collector";
|
|
1670
1827
|
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
@@ -1705,7 +1862,7 @@ function DestinationInitDemo({
|
|
|
1705
1862
|
(error) => setOutput(`Error: ${error}`)
|
|
1706
1863
|
)();
|
|
1707
1864
|
}, [settingsInput, destination]);
|
|
1708
|
-
|
|
1865
|
+
useEffect8(() => {
|
|
1709
1866
|
const timeoutId = setTimeout(executeInit, 500);
|
|
1710
1867
|
return () => clearTimeout(timeoutId);
|
|
1711
1868
|
}, [executeInit]);
|
|
@@ -1737,15 +1894,15 @@ function DestinationInitDemo({
|
|
|
1737
1894
|
// src/components/demos/PromotionPlayground.tsx
|
|
1738
1895
|
import {
|
|
1739
1896
|
useState as useState12,
|
|
1740
|
-
useEffect as
|
|
1741
|
-
useRef as
|
|
1897
|
+
useEffect as useEffect10,
|
|
1898
|
+
useRef as useRef7,
|
|
1742
1899
|
useCallback as useCallback10,
|
|
1743
1900
|
useMemo as useMemo3
|
|
1744
1901
|
} from "react";
|
|
1745
1902
|
import { startFlow as startFlow3 } from "@walkeros/collector";
|
|
1746
1903
|
|
|
1747
1904
|
// src/components/molecules/preview.tsx
|
|
1748
|
-
import { useState as useState10, useEffect as
|
|
1905
|
+
import { useState as useState10, useEffect as useEffect9, useRef as useRef6, useCallback as useCallback9 } from "react";
|
|
1749
1906
|
import {
|
|
1750
1907
|
sourceBrowser
|
|
1751
1908
|
} from "@walkeros/web-source-browser";
|
|
@@ -1784,11 +1941,11 @@ function Preview({
|
|
|
1784
1941
|
label = "Preview"
|
|
1785
1942
|
}) {
|
|
1786
1943
|
const [highlights, setHighlights] = useState10(/* @__PURE__ */ new Set());
|
|
1787
|
-
const iframeRef =
|
|
1788
|
-
const updateTimeoutRef =
|
|
1789
|
-
const elbRef =
|
|
1790
|
-
const sourceRef =
|
|
1791
|
-
|
|
1944
|
+
const iframeRef = useRef6(null);
|
|
1945
|
+
const updateTimeoutRef = useRef6(void 0);
|
|
1946
|
+
const elbRef = useRef6(elb);
|
|
1947
|
+
const sourceRef = useRef6(null);
|
|
1948
|
+
useEffect9(() => {
|
|
1792
1949
|
elbRef.current = elb;
|
|
1793
1950
|
}, [elb]);
|
|
1794
1951
|
const toggleHighlight = (type) => {
|
|
@@ -1816,7 +1973,7 @@ function Preview({
|
|
|
1816
1973
|
},
|
|
1817
1974
|
[]
|
|
1818
1975
|
);
|
|
1819
|
-
|
|
1976
|
+
useEffect9(() => {
|
|
1820
1977
|
if (updateTimeoutRef.current) {
|
|
1821
1978
|
clearTimeout(updateTimeoutRef.current);
|
|
1822
1979
|
}
|
|
@@ -1936,7 +2093,6 @@ function Preview({
|
|
|
1936
2093
|
config: {
|
|
1937
2094
|
settings: {
|
|
1938
2095
|
pageview: false,
|
|
1939
|
-
session: false,
|
|
1940
2096
|
prefix: "data-elb",
|
|
1941
2097
|
elb: "elb",
|
|
1942
2098
|
elbLayer: "elbLayer",
|
|
@@ -2423,11 +2579,11 @@ function PromotionPlayground({
|
|
|
2423
2579
|
const [outputString, setOutputString] = useState12(
|
|
2424
2580
|
"// Click elements in the preview to see function call"
|
|
2425
2581
|
);
|
|
2426
|
-
const collectorRef =
|
|
2427
|
-
const elbRef =
|
|
2428
|
-
const lastEventRef =
|
|
2582
|
+
const collectorRef = useRef7(null);
|
|
2583
|
+
const elbRef = useRef7(null);
|
|
2584
|
+
const lastEventRef = useRef7(null);
|
|
2429
2585
|
const [isReady, setIsReady] = useState12(false);
|
|
2430
|
-
|
|
2586
|
+
useEffect10(() => {
|
|
2431
2587
|
let mounted = true;
|
|
2432
2588
|
const init = async () => {
|
|
2433
2589
|
try {
|
|
@@ -2553,7 +2709,7 @@ function PromotionPlayground({
|
|
|
2553
2709
|
}
|
|
2554
2710
|
|
|
2555
2711
|
// src/components/organisms/live-code.tsx
|
|
2556
|
-
import { useState as useState13, useEffect as
|
|
2712
|
+
import { useState as useState13, useEffect as useEffect11, useCallback as useCallback11 } from "react";
|
|
2557
2713
|
import { debounce, isString, tryCatchAsync as tryCatchAsync3 } from "@walkeros/core";
|
|
2558
2714
|
|
|
2559
2715
|
// src/utils/format-code.ts
|
|
@@ -2567,15 +2723,21 @@ async function formatCode(code, language) {
|
|
|
2567
2723
|
let formatted;
|
|
2568
2724
|
switch (language) {
|
|
2569
2725
|
case "javascript":
|
|
2570
|
-
case "js":
|
|
2571
|
-
|
|
2726
|
+
case "js": {
|
|
2727
|
+
const isBareObject = code.trimStart().startsWith("{") && code.includes("\n");
|
|
2728
|
+
const input = isBareObject ? `(${code})` : code;
|
|
2729
|
+
formatted = await prettier2.format(input, {
|
|
2572
2730
|
parser: "babel",
|
|
2573
2731
|
plugins: [prettierBabel2, prettierEstree2],
|
|
2574
2732
|
semi: true,
|
|
2575
2733
|
singleQuote: true,
|
|
2576
2734
|
trailingComma: "all"
|
|
2577
2735
|
});
|
|
2736
|
+
if (isBareObject) {
|
|
2737
|
+
formatted = formatted.replace(/^\(/, "").replace(/\);?\s*$/, "");
|
|
2738
|
+
}
|
|
2578
2739
|
break;
|
|
2740
|
+
}
|
|
2579
2741
|
case "typescript":
|
|
2580
2742
|
case "ts":
|
|
2581
2743
|
case "tsx":
|
|
@@ -2643,13 +2805,13 @@ function LiveCode({
|
|
|
2643
2805
|
const [input, setInput] = useState13(formatValue(initInput));
|
|
2644
2806
|
const [config, setConfig] = useState13(formatValue(initConfig));
|
|
2645
2807
|
const [output, setOutput] = useState13([formatValue(initOutput)]);
|
|
2646
|
-
|
|
2808
|
+
useEffect11(() => {
|
|
2647
2809
|
if (format3 && initInput) {
|
|
2648
2810
|
const rawInput = formatValue(initInput);
|
|
2649
2811
|
formatCode(rawInput, language).then(setInput);
|
|
2650
2812
|
}
|
|
2651
2813
|
}, [initInput, language, format3]);
|
|
2652
|
-
|
|
2814
|
+
useEffect11(() => {
|
|
2653
2815
|
if (format3 && initConfig) {
|
|
2654
2816
|
const rawConfig = formatValue(initConfig);
|
|
2655
2817
|
formatCode(rawConfig, language).then(setConfig);
|
|
@@ -2676,7 +2838,7 @@ function LiveCode({
|
|
|
2676
2838
|
),
|
|
2677
2839
|
[fn, log]
|
|
2678
2840
|
);
|
|
2679
|
-
|
|
2841
|
+
useEffect11(() => {
|
|
2680
2842
|
updateOutput(input, config, options || {});
|
|
2681
2843
|
}, [input, config, options, updateOutput]);
|
|
2682
2844
|
return /* @__PURE__ */ jsxs10(Grid, { columns: 3, className, rowHeight, children: [
|
|
@@ -2715,7 +2877,7 @@ function LiveCode({
|
|
|
2715
2877
|
}
|
|
2716
2878
|
|
|
2717
2879
|
// src/components/organisms/collector-box.tsx
|
|
2718
|
-
import { useState as useState14, useEffect as
|
|
2880
|
+
import { useState as useState14, useEffect as useEffect12 } from "react";
|
|
2719
2881
|
import { startFlow as startFlow4 } from "@walkeros/collector";
|
|
2720
2882
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2721
2883
|
function CollectorBox({
|
|
@@ -2728,7 +2890,7 @@ function CollectorBox({
|
|
|
2728
2890
|
const [output, setOutput] = useState14(
|
|
2729
2891
|
"// Click elements in the preview to see function call"
|
|
2730
2892
|
);
|
|
2731
|
-
|
|
2893
|
+
useEffect12(() => {
|
|
2732
2894
|
(async () => {
|
|
2733
2895
|
try {
|
|
2734
2896
|
const eventObj = JSON.parse(event);
|
|
@@ -2772,10 +2934,10 @@ function CollectorBox({
|
|
|
2772
2934
|
import { useState as useState36, useMemo as useMemo6, useCallback as useCallback18 } from "react";
|
|
2773
2935
|
|
|
2774
2936
|
// src/components/organisms/config-editor/config-editor-tabs.tsx
|
|
2775
|
-
import { useEffect as
|
|
2937
|
+
import { useEffect as useEffect25, useState as useState35, useMemo as useMemo5 } from "react";
|
|
2776
2938
|
|
|
2777
2939
|
// src/hooks/useMappingState.ts
|
|
2778
|
-
import { useState as useState15, useCallback as useCallback12, useRef as
|
|
2940
|
+
import { useState as useState15, useCallback as useCallback12, useRef as useRef8 } from "react";
|
|
2779
2941
|
|
|
2780
2942
|
// src/utils/mapping-path.ts
|
|
2781
2943
|
function getValueAtPath(obj, path) {
|
|
@@ -2860,7 +3022,7 @@ function getParentPath(path) {
|
|
|
2860
3022
|
// src/hooks/useMappingState.ts
|
|
2861
3023
|
function useMappingState(initialMapping, onChange) {
|
|
2862
3024
|
const [config, setConfig] = useState15(initialMapping);
|
|
2863
|
-
const isCallingOnChange =
|
|
3025
|
+
const isCallingOnChange = useRef8(false);
|
|
2864
3026
|
const updateConfig = useCallback12(
|
|
2865
3027
|
(newConfig) => {
|
|
2866
3028
|
setConfig(newConfig);
|
|
@@ -3643,7 +3805,7 @@ function useTreeState(initialExpanded = [[]]) {
|
|
|
3643
3805
|
}
|
|
3644
3806
|
|
|
3645
3807
|
// src/components/atoms/mapping-breadcrumb.tsx
|
|
3646
|
-
import { Fragment
|
|
3808
|
+
import { Fragment, jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3647
3809
|
function MappingBreadcrumb({
|
|
3648
3810
|
segments,
|
|
3649
3811
|
onNavigate,
|
|
@@ -3662,7 +3824,7 @@ function MappingBreadcrumb({
|
|
|
3662
3824
|
"li",
|
|
3663
3825
|
{
|
|
3664
3826
|
className: "elb-mapping-breadcrumb-item",
|
|
3665
|
-
children: isClickable ? /* @__PURE__ */ jsxs11(
|
|
3827
|
+
children: isClickable ? /* @__PURE__ */ jsxs11(Fragment, { children: [
|
|
3666
3828
|
/* @__PURE__ */ jsx18(
|
|
3667
3829
|
"button",
|
|
3668
3830
|
{
|
|
@@ -3691,7 +3853,7 @@ function MappingBreadcrumb({
|
|
|
3691
3853
|
}
|
|
3692
3854
|
|
|
3693
3855
|
// src/components/atoms/mapping-confirm-button.tsx
|
|
3694
|
-
import { useState as useState18, useEffect as
|
|
3856
|
+
import { useState as useState18, useEffect as useEffect13, useRef as useRef9 } from "react";
|
|
3695
3857
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
3696
3858
|
var TrashIcon = () => /* @__PURE__ */ jsx19(
|
|
3697
3859
|
"svg",
|
|
@@ -3718,8 +3880,8 @@ function MappingConfirmButton({
|
|
|
3718
3880
|
className = ""
|
|
3719
3881
|
}) {
|
|
3720
3882
|
const [isConfirming, setIsConfirming] = useState18(false);
|
|
3721
|
-
const buttonRef =
|
|
3722
|
-
|
|
3883
|
+
const buttonRef = useRef9(null);
|
|
3884
|
+
useEffect13(() => {
|
|
3723
3885
|
if (!isConfirming) return;
|
|
3724
3886
|
const handleClickOutside = (e) => {
|
|
3725
3887
|
if (buttonRef.current && !buttonRef.current.contains(e.target)) {
|
|
@@ -3864,7 +4026,7 @@ function MappingNavigationHeader({
|
|
|
3864
4026
|
}
|
|
3865
4027
|
|
|
3866
4028
|
// src/components/molecules/config-tree-sidebar.tsx
|
|
3867
|
-
import { useState as useState19, useRef as
|
|
4029
|
+
import { useState as useState19, useRef as useRef10, useEffect as useEffect14 } from "react";
|
|
3868
4030
|
|
|
3869
4031
|
// src/components/atoms/mapping-input.tsx
|
|
3870
4032
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
@@ -3987,14 +4149,14 @@ function ConfigTreeNodeComponent({
|
|
|
3987
4149
|
const [isAddingAction, setIsAddingAction] = useState19(false);
|
|
3988
4150
|
const [newActionName, setNewActionName] = useState19("");
|
|
3989
4151
|
const [actionExists, setActionExists] = useState19(false);
|
|
3990
|
-
const inputRef =
|
|
4152
|
+
const inputRef = useRef10(null);
|
|
3991
4153
|
const isEntityNode = node.type === "entity" && node.path.length === 2 && node.path[0] === "mapping";
|
|
3992
|
-
|
|
4154
|
+
useEffect14(() => {
|
|
3993
4155
|
if (isAddingAction && inputRef.current) {
|
|
3994
4156
|
inputRef.current.focus();
|
|
3995
4157
|
}
|
|
3996
4158
|
}, [isAddingAction]);
|
|
3997
|
-
|
|
4159
|
+
useEffect14(() => {
|
|
3998
4160
|
if (isEntityNode && newActionName) {
|
|
3999
4161
|
const exists = node.children?.some((child) => child.label === newActionName) ?? false;
|
|
4000
4162
|
setActionExists(exists);
|
|
@@ -4161,13 +4323,13 @@ function ConfigTreeSidebar({
|
|
|
4161
4323
|
const [isAddingEntity, setIsAddingEntity] = useState19(false);
|
|
4162
4324
|
const [newEntityName, setNewEntityName] = useState19("");
|
|
4163
4325
|
const [entityExists, setEntityExists] = useState19(false);
|
|
4164
|
-
const entityInputRef =
|
|
4165
|
-
|
|
4326
|
+
const entityInputRef = useRef10(null);
|
|
4327
|
+
useEffect14(() => {
|
|
4166
4328
|
if (isAddingEntity && entityInputRef.current) {
|
|
4167
4329
|
entityInputRef.current.focus();
|
|
4168
4330
|
}
|
|
4169
4331
|
}, [isAddingEntity]);
|
|
4170
|
-
|
|
4332
|
+
useEffect14(() => {
|
|
4171
4333
|
if (newEntityName) {
|
|
4172
4334
|
const mappingNode = tree.find((node) => node.key === "mapping");
|
|
4173
4335
|
const exists = mappingNode?.children?.some((child) => child.label === newEntityName) ?? false;
|
|
@@ -4308,7 +4470,7 @@ function ConfigTreeSidebar({
|
|
|
4308
4470
|
}
|
|
4309
4471
|
|
|
4310
4472
|
// src/components/molecules/mapping-entity-pane.tsx
|
|
4311
|
-
import { useState as useState20, useEffect as
|
|
4473
|
+
import { useState as useState20, useEffect as useEffect15 } from "react";
|
|
4312
4474
|
|
|
4313
4475
|
// src/components/atoms/pane-header.tsx
|
|
4314
4476
|
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
@@ -4414,7 +4576,7 @@ function MappingEntityPane({
|
|
|
4414
4576
|
const entity = path[0];
|
|
4415
4577
|
const entityConfig = mappingState.actions.getValue([entity]);
|
|
4416
4578
|
const actions = entityConfig && typeof entityConfig === "object" ? Object.keys(entityConfig).sort() : [];
|
|
4417
|
-
|
|
4579
|
+
useEffect15(() => {
|
|
4418
4580
|
if (newActionName) {
|
|
4419
4581
|
const exists = actions.includes(newActionName);
|
|
4420
4582
|
setActionExists(exists);
|
|
@@ -5406,7 +5568,7 @@ function MappingKeyPaneView({
|
|
|
5406
5568
|
}
|
|
5407
5569
|
|
|
5408
5570
|
// src/components/molecules/mapping-function-pane-base.tsx
|
|
5409
|
-
import { useState as useState22, useEffect as
|
|
5571
|
+
import { useState as useState22, useEffect as useEffect16 } from "react";
|
|
5410
5572
|
|
|
5411
5573
|
// src/utils/code-normalizer.ts
|
|
5412
5574
|
function normalizeCode(code) {
|
|
@@ -5429,7 +5591,7 @@ function MappingFunctionPaneBase({
|
|
|
5429
5591
|
const value = mappingState.actions.getValue(path);
|
|
5430
5592
|
const initialCode = typeof value === "string" ? value : defaultCode;
|
|
5431
5593
|
const [code, setCode] = useState22(initialCode);
|
|
5432
|
-
|
|
5594
|
+
useEffect16(() => {
|
|
5433
5595
|
const currentValue = mappingState.actions.getValue(path);
|
|
5434
5596
|
const newCode = typeof currentValue === "string" ? currentValue : defaultCode;
|
|
5435
5597
|
setCode(newCode);
|
|
@@ -5508,7 +5670,7 @@ function MappingFunctionPaneBase({
|
|
|
5508
5670
|
}
|
|
5509
5671
|
|
|
5510
5672
|
// src/components/molecules/mapping-condition-pane-view.tsx
|
|
5511
|
-
import { Fragment as
|
|
5673
|
+
import { Fragment as Fragment2, jsx as jsx35 } from "react/jsx-runtime";
|
|
5512
5674
|
var DEFAULT_CONDITION = `(
|
|
5513
5675
|
value: WalkerOS.DeepPartialEvent | unknown,
|
|
5514
5676
|
mapping: Mapping.Value,
|
|
@@ -5553,15 +5715,15 @@ var HELP_SECTIONS = [
|
|
|
5553
5715
|
examples: [
|
|
5554
5716
|
{
|
|
5555
5717
|
label: "Only for high-value orders:",
|
|
5556
|
-
code: /* @__PURE__ */ jsx35(
|
|
5718
|
+
code: /* @__PURE__ */ jsx35(Fragment2, { children: "(value) => value.data?.total > 100" })
|
|
5557
5719
|
},
|
|
5558
5720
|
{
|
|
5559
5721
|
label: "Only for specific user segment:",
|
|
5560
|
-
code: /* @__PURE__ */ jsx35(
|
|
5722
|
+
code: /* @__PURE__ */ jsx35(Fragment2, { children: "(value) => value.user?.segment === 'premium'" })
|
|
5561
5723
|
},
|
|
5562
5724
|
{
|
|
5563
5725
|
label: "Only during business hours:",
|
|
5564
|
-
code: /* @__PURE__ */ jsx35(
|
|
5726
|
+
code: /* @__PURE__ */ jsx35(Fragment2, { children: "() => new Date().getHours() >= 9 && new Date().getHours() < 17" })
|
|
5565
5727
|
}
|
|
5566
5728
|
]
|
|
5567
5729
|
}
|
|
@@ -5581,7 +5743,7 @@ function MappingConditionPaneView(props) {
|
|
|
5581
5743
|
}
|
|
5582
5744
|
|
|
5583
5745
|
// src/components/molecules/mapping-fn-pane-view.tsx
|
|
5584
|
-
import { Fragment as
|
|
5746
|
+
import { Fragment as Fragment3, jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5585
5747
|
var DEFAULT_FN = `(
|
|
5586
5748
|
value: WalkerOS.DeepPartialEvent | unknown,
|
|
5587
5749
|
mapping: Mapping.Value,
|
|
@@ -5632,11 +5794,11 @@ var HELP_SECTIONS2 = [
|
|
|
5632
5794
|
examples: [
|
|
5633
5795
|
{
|
|
5634
5796
|
label: "Extract nested property:",
|
|
5635
|
-
code: /* @__PURE__ */ jsx36(
|
|
5797
|
+
code: /* @__PURE__ */ jsx36(Fragment3, { children: "(value) => value.data?.product?.id" })
|
|
5636
5798
|
},
|
|
5637
5799
|
{
|
|
5638
5800
|
label: "Format currency:",
|
|
5639
|
-
code: /* @__PURE__ */ jsxs26(
|
|
5801
|
+
code: /* @__PURE__ */ jsxs26(Fragment3, { children: [
|
|
5640
5802
|
"(value) => {",
|
|
5641
5803
|
"\n",
|
|
5642
5804
|
" ",
|
|
@@ -5650,11 +5812,11 @@ var HELP_SECTIONS2 = [
|
|
|
5650
5812
|
},
|
|
5651
5813
|
{
|
|
5652
5814
|
label: "Combine multiple fields:",
|
|
5653
|
-
code: /* @__PURE__ */ jsx36(
|
|
5815
|
+
code: /* @__PURE__ */ jsx36(Fragment3, { children: "(value) => `${value.data?.firstName} ${value.data?.lastName}`" })
|
|
5654
5816
|
},
|
|
5655
5817
|
{
|
|
5656
5818
|
label: "Conditional transformation with consent:",
|
|
5657
|
-
code: /* @__PURE__ */ jsxs26(
|
|
5819
|
+
code: /* @__PURE__ */ jsxs26(Fragment3, { children: [
|
|
5658
5820
|
"(value, mapping, options) => {",
|
|
5659
5821
|
"\n",
|
|
5660
5822
|
" ",
|
|
@@ -5674,7 +5836,7 @@ var HELP_SECTIONS2 = [
|
|
|
5674
5836
|
},
|
|
5675
5837
|
{
|
|
5676
5838
|
label: "Use collector for context:",
|
|
5677
|
-
code: /* @__PURE__ */ jsxs26(
|
|
5839
|
+
code: /* @__PURE__ */ jsxs26(Fragment3, { children: [
|
|
5678
5840
|
"(value, mapping, options) => {",
|
|
5679
5841
|
"\n",
|
|
5680
5842
|
" ",
|
|
@@ -5713,7 +5875,7 @@ function MappingFnPaneView(props) {
|
|
|
5713
5875
|
}
|
|
5714
5876
|
|
|
5715
5877
|
// src/components/molecules/mapping-validate-pane-view.tsx
|
|
5716
|
-
import { Fragment as
|
|
5878
|
+
import { Fragment as Fragment4, jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5717
5879
|
var DEFAULT_VALIDATE = `(
|
|
5718
5880
|
value: unknown
|
|
5719
5881
|
): boolean | Promise<boolean> => {
|
|
@@ -5753,19 +5915,19 @@ var HELP_SECTIONS3 = [
|
|
|
5753
5915
|
examples: [
|
|
5754
5916
|
{
|
|
5755
5917
|
label: "Exclude empty values:",
|
|
5756
|
-
code: /* @__PURE__ */ jsx37(
|
|
5918
|
+
code: /* @__PURE__ */ jsx37(Fragment4, { children: "(value) => value !== undefined && value !== null && value !== ''" })
|
|
5757
5919
|
},
|
|
5758
5920
|
{
|
|
5759
5921
|
label: "Only include valid email addresses:",
|
|
5760
|
-
code: /* @__PURE__ */ jsx37(
|
|
5922
|
+
code: /* @__PURE__ */ jsx37(Fragment4, { children: "(value) => typeof value === 'string' && /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)" })
|
|
5761
5923
|
},
|
|
5762
5924
|
{
|
|
5763
5925
|
label: "Only include positive numbers:",
|
|
5764
|
-
code: /* @__PURE__ */ jsx37(
|
|
5926
|
+
code: /* @__PURE__ */ jsx37(Fragment4, { children: "(value) => typeof value === 'number' && value > 0" })
|
|
5765
5927
|
},
|
|
5766
5928
|
{
|
|
5767
5929
|
label: "Validate URL format:",
|
|
5768
|
-
code: /* @__PURE__ */ jsxs27(
|
|
5930
|
+
code: /* @__PURE__ */ jsxs27(Fragment4, { children: [
|
|
5769
5931
|
"(value) => {",
|
|
5770
5932
|
"\n",
|
|
5771
5933
|
" ",
|
|
@@ -5791,7 +5953,7 @@ var HELP_SECTIONS3 = [
|
|
|
5791
5953
|
},
|
|
5792
5954
|
{
|
|
5793
5955
|
label: "Exclude specific values:",
|
|
5794
|
-
code: /* @__PURE__ */ jsx37(
|
|
5956
|
+
code: /* @__PURE__ */ jsx37(Fragment4, { children: "(value) => !['test', 'localhost', 'example.com'].includes(value)" })
|
|
5795
5957
|
}
|
|
5796
5958
|
]
|
|
5797
5959
|
}
|
|
@@ -5904,7 +6066,7 @@ function validateValue(value, schema) {
|
|
|
5904
6066
|
}
|
|
5905
6067
|
|
|
5906
6068
|
// src/components/molecules/mapping-name-pane-view.tsx
|
|
5907
|
-
import { Fragment as
|
|
6069
|
+
import { Fragment as Fragment5, jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5908
6070
|
function MappingNamePaneView({
|
|
5909
6071
|
path,
|
|
5910
6072
|
mappingState,
|
|
@@ -5948,7 +6110,7 @@ function MappingNamePaneView({
|
|
|
5948
6110
|
),
|
|
5949
6111
|
/* @__PURE__ */ jsxs28("div", { className: "elb-mapping-pane-hint", children: [
|
|
5950
6112
|
uiSchema?.["ui:help"] || "This string will be sent to the destination instead of the default entity-action name. Leave empty to use default.",
|
|
5951
|
-
hasError && validationResult.error && /* @__PURE__ */ jsxs28(
|
|
6113
|
+
hasError && validationResult.error && /* @__PURE__ */ jsxs28(Fragment5, { children: [
|
|
5952
6114
|
/* @__PURE__ */ jsx38("br", {}),
|
|
5953
6115
|
/* @__PURE__ */ jsxs28("span", { style: { color: "var(--color-button-danger)" }, children: [
|
|
5954
6116
|
"\u26A0 ",
|
|
@@ -5984,7 +6146,7 @@ function MappingNamePaneView({
|
|
|
5984
6146
|
}
|
|
5985
6147
|
|
|
5986
6148
|
// src/components/molecules/mapping-batch-pane-view.tsx
|
|
5987
|
-
import { Fragment as
|
|
6149
|
+
import { Fragment as Fragment6, jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5988
6150
|
function MappingBatchPaneView({
|
|
5989
6151
|
path,
|
|
5990
6152
|
mappingState,
|
|
@@ -6033,7 +6195,7 @@ function MappingBatchPaneView({
|
|
|
6033
6195
|
),
|
|
6034
6196
|
/* @__PURE__ */ jsxs29("div", { className: "elb-mapping-pane-hint", children: [
|
|
6035
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.",
|
|
6036
|
-
hasError && validationResult.error && /* @__PURE__ */ jsxs29(
|
|
6198
|
+
hasError && validationResult.error && /* @__PURE__ */ jsxs29(Fragment6, { children: [
|
|
6037
6199
|
/* @__PURE__ */ jsx39("br", {}),
|
|
6038
6200
|
/* @__PURE__ */ jsxs29("span", { style: { color: "var(--color-button-danger)" }, children: [
|
|
6039
6201
|
"\u26A0 ",
|
|
@@ -6659,7 +6821,7 @@ function MappingBooleanWidget(props) {
|
|
|
6659
6821
|
}
|
|
6660
6822
|
|
|
6661
6823
|
// src/components/atoms/mapping-consent.tsx
|
|
6662
|
-
import { useState as useState26, useEffect as
|
|
6824
|
+
import { useState as useState26, useEffect as useEffect17 } from "react";
|
|
6663
6825
|
|
|
6664
6826
|
// src/components/atoms/mapping-collapsible.tsx
|
|
6665
6827
|
import { useState as useState25 } from "react";
|
|
@@ -6981,7 +7143,7 @@ function MappingConsentWidget(props) {
|
|
|
6981
7143
|
const title = schema?.title || "Consent";
|
|
6982
7144
|
const description = schema?.description;
|
|
6983
7145
|
const [isExpanded, setIsExpanded] = useState26(hasConsent);
|
|
6984
|
-
|
|
7146
|
+
useEffect17(() => {
|
|
6985
7147
|
setIsExpanded(hasConsent);
|
|
6986
7148
|
}, [hasConsent]);
|
|
6987
7149
|
const handleAddConsent = () => {
|
|
@@ -7063,10 +7225,10 @@ function MappingConsentWidget(props) {
|
|
|
7063
7225
|
}
|
|
7064
7226
|
|
|
7065
7227
|
// src/components/atoms/mapping-value.tsx
|
|
7066
|
-
import React15, { useState as useState27, useEffect as
|
|
7228
|
+
import React15, { useState as useState27, useEffect as useEffect18 } from "react";
|
|
7067
7229
|
|
|
7068
7230
|
// src/components/atoms/field-header.tsx
|
|
7069
|
-
import { Fragment as
|
|
7231
|
+
import { Fragment as Fragment7, jsx as jsx51, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
7070
7232
|
function FieldHeader({
|
|
7071
7233
|
title,
|
|
7072
7234
|
description,
|
|
@@ -7085,7 +7247,7 @@ function FieldHeader({
|
|
|
7085
7247
|
action
|
|
7086
7248
|
] });
|
|
7087
7249
|
}
|
|
7088
|
-
return /* @__PURE__ */ jsxs41(
|
|
7250
|
+
return /* @__PURE__ */ jsxs41(Fragment7, { children: [
|
|
7089
7251
|
/* @__PURE__ */ jsxs41("label", { className: "elb-rjsf-label", children: [
|
|
7090
7252
|
title,
|
|
7091
7253
|
required && /* @__PURE__ */ jsx51("span", { className: "elb-rjsf-required", children: " *" })
|
|
@@ -7143,7 +7305,7 @@ function MappingValueWidget(props) {
|
|
|
7143
7305
|
const [selectedType, setSelectedType] = useState27(getCurrentType);
|
|
7144
7306
|
const userSelectedTypeRef = React15.useRef(false);
|
|
7145
7307
|
const prevValueRef = React15.useRef(value);
|
|
7146
|
-
|
|
7308
|
+
useEffect18(() => {
|
|
7147
7309
|
const prevType = typeof prevValueRef.current;
|
|
7148
7310
|
const currentType = typeof value;
|
|
7149
7311
|
const isMajorTypeChange = prevType !== currentType || value === void 0 && prevValueRef.current !== void 0 || value !== void 0 && prevValueRef.current === void 0;
|
|
@@ -7990,7 +8152,7 @@ function MappingValidateField(props) {
|
|
|
7990
8152
|
}
|
|
7991
8153
|
|
|
7992
8154
|
// src/components/atoms/mapping-data.tsx
|
|
7993
|
-
import { useState as useState29, useEffect as
|
|
8155
|
+
import { useState as useState29, useEffect as useEffect19, useRef as useRef11, useCallback as useCallback15 } from "react";
|
|
7994
8156
|
|
|
7995
8157
|
// src/schemas/value-config-schema.ts
|
|
7996
8158
|
var valueConfigSchema = {
|
|
@@ -8232,8 +8394,8 @@ function MappingDataWidget(props) {
|
|
|
8232
8394
|
const description = schema?.description;
|
|
8233
8395
|
const [showForm, setShowForm] = useState29(hasData);
|
|
8234
8396
|
const [isExpanded, setIsExpanded] = useState29(hasData);
|
|
8235
|
-
const prevValueRef =
|
|
8236
|
-
|
|
8397
|
+
const prevValueRef = useRef11(value);
|
|
8398
|
+
useEffect19(() => {
|
|
8237
8399
|
const newHasData = value && typeof value === "object" && Object.keys(value).length > 0;
|
|
8238
8400
|
setShowForm(!!newHasData);
|
|
8239
8401
|
setIsExpanded(!!newHasData);
|
|
@@ -8316,7 +8478,7 @@ function MappingDataField(props) {
|
|
|
8316
8478
|
}
|
|
8317
8479
|
|
|
8318
8480
|
// src/components/atoms/mapping-settings.tsx
|
|
8319
|
-
import { useState as useState30, useEffect as
|
|
8481
|
+
import { useState as useState30, useEffect as useEffect20, useRef as useRef12, useCallback as useCallback16 } from "react";
|
|
8320
8482
|
import { jsx as jsx67, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
8321
8483
|
function MappingSettingsWidget(props) {
|
|
8322
8484
|
const {
|
|
@@ -8338,8 +8500,8 @@ function MappingSettingsWidget(props) {
|
|
|
8338
8500
|
const hasSchema = destinationSchema && destinationSchema.properties && Object.keys(destinationSchema.properties).length > 0;
|
|
8339
8501
|
const [showForm, setShowForm] = useState30(hasSettings);
|
|
8340
8502
|
const [isExpanded, setIsExpanded] = useState30(hasSettings);
|
|
8341
|
-
const prevValueRef =
|
|
8342
|
-
|
|
8503
|
+
const prevValueRef = useRef12(value);
|
|
8504
|
+
useEffect20(() => {
|
|
8343
8505
|
const newHasSettings = value && typeof value === "object" && Object.keys(value).length > 0;
|
|
8344
8506
|
setShowForm(!!newHasSettings);
|
|
8345
8507
|
setIsExpanded(!!newHasSettings);
|
|
@@ -8497,7 +8659,7 @@ function MappingObjectExplorerField(props) {
|
|
|
8497
8659
|
}
|
|
8498
8660
|
|
|
8499
8661
|
// src/components/molecules/mapping-map-field.tsx
|
|
8500
|
-
import { useState as useState31, useEffect as
|
|
8662
|
+
import { useState as useState31, useEffect as useEffect21, useRef as useRef13 } from "react";
|
|
8501
8663
|
|
|
8502
8664
|
// src/components/atoms/mapping-map-entry.tsx
|
|
8503
8665
|
import { jsx as jsx70, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
@@ -8627,15 +8789,15 @@ function MappingMapField(props) {
|
|
|
8627
8789
|
);
|
|
8628
8790
|
const hasEntries = entries.length > 0;
|
|
8629
8791
|
const [isExpanded, setIsExpanded] = useState31(hasEntries);
|
|
8630
|
-
const prevFormDataRef =
|
|
8631
|
-
|
|
8792
|
+
const prevFormDataRef = useRef13(formData);
|
|
8793
|
+
useEffect21(() => {
|
|
8632
8794
|
if (prevFormDataRef.current === formData) {
|
|
8633
8795
|
return;
|
|
8634
8796
|
}
|
|
8635
8797
|
prevFormDataRef.current = formData;
|
|
8636
8798
|
setEntries(objectToEntries(formData));
|
|
8637
8799
|
}, [formData]);
|
|
8638
|
-
|
|
8800
|
+
useEffect21(() => {
|
|
8639
8801
|
setIsExpanded(hasEntries);
|
|
8640
8802
|
}, [hasEntries]);
|
|
8641
8803
|
const duplicateKeys = /* @__PURE__ */ new Set();
|
|
@@ -8722,7 +8884,7 @@ function MappingMapField(props) {
|
|
|
8722
8884
|
}
|
|
8723
8885
|
|
|
8724
8886
|
// src/components/molecules/mapping-set-field.tsx
|
|
8725
|
-
import { useState as useState32, useEffect as
|
|
8887
|
+
import { useState as useState32, useEffect as useEffect22, useRef as useRef14 } from "react";
|
|
8726
8888
|
|
|
8727
8889
|
// src/components/atoms/mapping-set-entry.tsx
|
|
8728
8890
|
import { jsx as jsx72, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
@@ -8856,8 +9018,8 @@ function MappingSetField(props) {
|
|
|
8856
9018
|
);
|
|
8857
9019
|
const hasEntries = entries.length > 0;
|
|
8858
9020
|
const [isExpanded, setIsExpanded] = useState32(hasEntries);
|
|
8859
|
-
const prevFormDataRef =
|
|
8860
|
-
|
|
9021
|
+
const prevFormDataRef = useRef14(formData);
|
|
9022
|
+
useEffect22(() => {
|
|
8861
9023
|
if (prevFormDataRef.current === formData) {
|
|
8862
9024
|
return;
|
|
8863
9025
|
}
|
|
@@ -8880,7 +9042,7 @@ function MappingSetField(props) {
|
|
|
8880
9042
|
});
|
|
8881
9043
|
setEntries(newEntries);
|
|
8882
9044
|
}, [formData]);
|
|
8883
|
-
|
|
9045
|
+
useEffect22(() => {
|
|
8884
9046
|
setIsExpanded(hasEntries);
|
|
8885
9047
|
}, [hasEntries]);
|
|
8886
9048
|
const handleEntriesChange = (newEntries) => {
|
|
@@ -9003,7 +9165,7 @@ function MappingSetField(props) {
|
|
|
9003
9165
|
}
|
|
9004
9166
|
|
|
9005
9167
|
// src/components/molecules/mapping-loop-field.tsx
|
|
9006
|
-
import { useState as useState33, useEffect as
|
|
9168
|
+
import { useState as useState33, useEffect as useEffect23, useRef as useRef15 } from "react";
|
|
9007
9169
|
import { jsx as jsx74, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
9008
9170
|
function MappingLoopField(props) {
|
|
9009
9171
|
const { formData, onChange, schema, disabled, readonly } = props;
|
|
@@ -9028,8 +9190,8 @@ function MappingLoopField(props) {
|
|
|
9028
9190
|
);
|
|
9029
9191
|
const [transform, setTransform] = useState33(() => parseFormData(formData)[1]);
|
|
9030
9192
|
const [isExpanded, setIsExpanded] = useState33(false);
|
|
9031
|
-
const prevFormDataRef =
|
|
9032
|
-
|
|
9193
|
+
const prevFormDataRef = useRef15(formData);
|
|
9194
|
+
useEffect23(() => {
|
|
9033
9195
|
if (prevFormDataRef.current === formData) {
|
|
9034
9196
|
return;
|
|
9035
9197
|
}
|
|
@@ -9403,7 +9565,7 @@ function MappingMapPaneViewRJSF({
|
|
|
9403
9565
|
}
|
|
9404
9566
|
|
|
9405
9567
|
// src/components/atoms/mapping-enum-select.tsx
|
|
9406
|
-
import { useState as useState34, useRef as
|
|
9568
|
+
import { useState as useState34, useRef as useRef16, useEffect as useEffect24 } from "react";
|
|
9407
9569
|
import { jsx as jsx78, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
9408
9570
|
function MappingEnumSelect({
|
|
9409
9571
|
value,
|
|
@@ -9417,19 +9579,19 @@ function MappingEnumSelect({
|
|
|
9417
9579
|
const [highlightedIndex, setHighlightedIndex] = useState34(0);
|
|
9418
9580
|
const [inputValue, setInputValue] = useState34(String(value || ""));
|
|
9419
9581
|
const [hasTyped, setHasTyped] = useState34(false);
|
|
9420
|
-
const containerRef =
|
|
9421
|
-
const inputRef =
|
|
9422
|
-
const dropdownRef =
|
|
9423
|
-
|
|
9582
|
+
const containerRef = useRef16(null);
|
|
9583
|
+
const inputRef = useRef16(null);
|
|
9584
|
+
const dropdownRef = useRef16(null);
|
|
9585
|
+
useEffect24(() => {
|
|
9424
9586
|
setInputValue(String(value || ""));
|
|
9425
9587
|
setHasTyped(false);
|
|
9426
9588
|
}, [value]);
|
|
9427
|
-
|
|
9589
|
+
useEffect24(() => {
|
|
9428
9590
|
if (isOpen) {
|
|
9429
9591
|
setHighlightedIndex(0);
|
|
9430
9592
|
}
|
|
9431
9593
|
}, [isOpen]);
|
|
9432
|
-
|
|
9594
|
+
useEffect24(() => {
|
|
9433
9595
|
const handleClickOutside = (event) => {
|
|
9434
9596
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
9435
9597
|
setIsOpen(false);
|
|
@@ -9443,7 +9605,7 @@ function MappingEnumSelect({
|
|
|
9443
9605
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
9444
9606
|
}
|
|
9445
9607
|
}, [isOpen, hasTyped, inputValue, onChange, type]);
|
|
9446
|
-
|
|
9608
|
+
useEffect24(() => {
|
|
9447
9609
|
if (isOpen && dropdownRef.current && dropdownRef.current.children[highlightedIndex]) {
|
|
9448
9610
|
const highlighted = dropdownRef.current.children[highlightedIndex];
|
|
9449
9611
|
if (highlighted) {
|
|
@@ -9649,7 +9811,7 @@ function MappingBooleanPaneView({
|
|
|
9649
9811
|
}
|
|
9650
9812
|
|
|
9651
9813
|
// src/components/molecules/mapping-primitive-pane-view.tsx
|
|
9652
|
-
import { Fragment as
|
|
9814
|
+
import { Fragment as Fragment8, jsx as jsx81, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
9653
9815
|
function MappingPrimitivePaneView({
|
|
9654
9816
|
path,
|
|
9655
9817
|
mappingState,
|
|
@@ -9703,11 +9865,11 @@ function MappingPrimitivePaneView({
|
|
|
9703
9865
|
/* @__PURE__ */ jsxs61("div", { className: "elb-mapping-pane-hint", children: [
|
|
9704
9866
|
"Current type: ",
|
|
9705
9867
|
/* @__PURE__ */ jsx81("strong", { children: typeof value }),
|
|
9706
|
-
uiSchema?.["ui:help"] && /* @__PURE__ */ jsxs61(
|
|
9868
|
+
uiSchema?.["ui:help"] && /* @__PURE__ */ jsxs61(Fragment8, { children: [
|
|
9707
9869
|
/* @__PURE__ */ jsx81("br", {}),
|
|
9708
9870
|
uiSchema["ui:help"]
|
|
9709
9871
|
] }),
|
|
9710
|
-
hasError && validationResult.error && /* @__PURE__ */ jsxs61(
|
|
9872
|
+
hasError && validationResult.error && /* @__PURE__ */ jsxs61(Fragment8, { children: [
|
|
9711
9873
|
/* @__PURE__ */ jsx81("br", {}),
|
|
9712
9874
|
/* @__PURE__ */ jsxs61("span", { style: { color: "var(--color-button-danger)" }, children: [
|
|
9713
9875
|
"\u26A0 ",
|
|
@@ -10388,7 +10550,7 @@ function buildValueChildren(value, basePath, schemas, structure) {
|
|
|
10388
10550
|
}
|
|
10389
10551
|
|
|
10390
10552
|
// src/components/organisms/config-editor/config-editor-tabs.tsx
|
|
10391
|
-
import { Fragment as
|
|
10553
|
+
import { Fragment as Fragment9, jsx as jsx85, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
10392
10554
|
function ConfigEditorTabs({
|
|
10393
10555
|
config,
|
|
10394
10556
|
onChange,
|
|
@@ -10447,7 +10609,7 @@ function ConfigEditorTabs({
|
|
|
10447
10609
|
} catch (e) {
|
|
10448
10610
|
}
|
|
10449
10611
|
};
|
|
10450
|
-
|
|
10612
|
+
useEffect25(() => {
|
|
10451
10613
|
if (navigation.navigationHistory.length === 0) {
|
|
10452
10614
|
navigation.switchToTab("");
|
|
10453
10615
|
if (initialNavigationState && initialNavigationState.currentPath.length > 0) {
|
|
@@ -10458,7 +10620,7 @@ function ConfigEditorTabs({
|
|
|
10458
10620
|
}
|
|
10459
10621
|
}
|
|
10460
10622
|
}, []);
|
|
10461
|
-
|
|
10623
|
+
useEffect25(() => {
|
|
10462
10624
|
if (onNavigationStateChange && activeTab) {
|
|
10463
10625
|
onNavigationStateChange({
|
|
10464
10626
|
currentPath: activeTab.path,
|
|
@@ -10469,7 +10631,7 @@ function ConfigEditorTabs({
|
|
|
10469
10631
|
});
|
|
10470
10632
|
}
|
|
10471
10633
|
}, [activeTab, treeState.expandedPaths, onNavigationStateChange]);
|
|
10472
|
-
|
|
10634
|
+
useEffect25(() => {
|
|
10473
10635
|
if (activeTab && activeTab.path.length > 0) {
|
|
10474
10636
|
for (let i = 1; i <= activeTab.path.length; i++) {
|
|
10475
10637
|
const pathToExpand = activeTab.path.slice(0, i);
|
|
@@ -10487,7 +10649,7 @@ function ConfigEditorTabs({
|
|
|
10487
10649
|
className: `elb-mapping-editor-tabs elb-mapping-editor-tabs--responsive ${className}`,
|
|
10488
10650
|
"data-layout": "responsive",
|
|
10489
10651
|
children: [
|
|
10490
|
-
showTree && /* @__PURE__ */ jsxs65(
|
|
10652
|
+
showTree && /* @__PURE__ */ jsxs65(Fragment9, { children: [
|
|
10491
10653
|
/* @__PURE__ */ jsx85(
|
|
10492
10654
|
"div",
|
|
10493
10655
|
{
|
|
@@ -10689,7 +10851,7 @@ function ConfigEditor(props) {
|
|
|
10689
10851
|
}
|
|
10690
10852
|
|
|
10691
10853
|
// node_modules/@iconify/react/dist/iconify.js
|
|
10692
|
-
import { createElement, forwardRef, useState as useState37, useEffect as
|
|
10854
|
+
import { createElement, forwardRef, useState as useState37, useEffect as useEffect26 } from "react";
|
|
10693
10855
|
function getIconsTree(data, names) {
|
|
10694
10856
|
const icons = data.icons;
|
|
10695
10857
|
const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
|
|
@@ -11287,9 +11449,9 @@ function updateCallbacks(storage2) {
|
|
|
11287
11449
|
});
|
|
11288
11450
|
}
|
|
11289
11451
|
}
|
|
11290
|
-
var
|
|
11452
|
+
var idCounter2 = 0;
|
|
11291
11453
|
function storeCallback(callback, icons, pendingSources) {
|
|
11292
|
-
const id =
|
|
11454
|
+
const id = idCounter2++;
|
|
11293
11455
|
const abort = removeCallback.bind(null, pendingSources, id);
|
|
11294
11456
|
if (!icons.pending.length) return abort;
|
|
11295
11457
|
const item = {
|
|
@@ -12053,11 +12215,11 @@ function IconComponent(props) {
|
|
|
12053
12215
|
}
|
|
12054
12216
|
}
|
|
12055
12217
|
}
|
|
12056
|
-
|
|
12218
|
+
useEffect26(() => {
|
|
12057
12219
|
setMounted(true);
|
|
12058
12220
|
return cleanup;
|
|
12059
12221
|
}, []);
|
|
12060
|
-
|
|
12222
|
+
useEffect26(() => {
|
|
12061
12223
|
if (mounted) {
|
|
12062
12224
|
updateState();
|
|
12063
12225
|
}
|
|
@@ -12547,6 +12709,8 @@ var isArbitrarySize = (value) => getIsArbitraryValue(value, isLabelSize, isNever
|
|
|
12547
12709
|
var isArbitraryValue = (value) => arbitraryValueRegex.test(value);
|
|
12548
12710
|
var isArbitraryLength = (value) => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
|
|
12549
12711
|
var isArbitraryNumber = (value) => getIsArbitraryValue(value, isLabelNumber, isNumber);
|
|
12712
|
+
var isArbitraryWeight = (value) => getIsArbitraryValue(value, isLabelWeight, isAny);
|
|
12713
|
+
var isArbitraryFamilyName = (value) => getIsArbitraryValue(value, isLabelFamilyName, isNever);
|
|
12550
12714
|
var isArbitraryPosition = (value) => getIsArbitraryValue(value, isLabelPosition, isNever);
|
|
12551
12715
|
var isArbitraryImage = (value) => getIsArbitraryValue(value, isLabelImage, isImage);
|
|
12552
12716
|
var isArbitraryShadow = (value) => getIsArbitraryValue(value, isLabelShadow, isShadow);
|
|
@@ -12557,6 +12721,7 @@ var isArbitraryVariablePosition = (value) => getIsArbitraryVariable(value, isLab
|
|
|
12557
12721
|
var isArbitraryVariableSize = (value) => getIsArbitraryVariable(value, isLabelSize);
|
|
12558
12722
|
var isArbitraryVariableImage = (value) => getIsArbitraryVariable(value, isLabelImage);
|
|
12559
12723
|
var isArbitraryVariableShadow = (value) => getIsArbitraryVariable(value, isLabelShadow, true);
|
|
12724
|
+
var isArbitraryVariableWeight = (value) => getIsArbitraryVariable(value, isLabelWeight, true);
|
|
12560
12725
|
var getIsArbitraryValue = (value, testLabel, testValue) => {
|
|
12561
12726
|
const result = arbitraryValueRegex.exec(value);
|
|
12562
12727
|
if (result) {
|
|
@@ -12583,6 +12748,7 @@ var isLabelSize = (label) => label === "length" || label === "size" || label ===
|
|
|
12583
12748
|
var isLabelLength = (label) => label === "length";
|
|
12584
12749
|
var isLabelNumber = (label) => label === "number";
|
|
12585
12750
|
var isLabelFamilyName = (label) => label === "family-name";
|
|
12751
|
+
var isLabelWeight = (label) => label === "number" || label === "weight";
|
|
12586
12752
|
var isLabelShadow = (label) => label === "shadow";
|
|
12587
12753
|
var getDefaultConfig = () => {
|
|
12588
12754
|
const themeColor = fromTheme("color");
|
|
@@ -13384,7 +13550,7 @@ var getDefaultConfig = () => {
|
|
|
13384
13550
|
* @see https://tailwindcss.com/docs/font-weight
|
|
13385
13551
|
*/
|
|
13386
13552
|
"font-weight": [{
|
|
13387
|
-
font: [themeFontWeight,
|
|
13553
|
+
font: [themeFontWeight, isArbitraryVariableWeight, isArbitraryWeight]
|
|
13388
13554
|
}],
|
|
13389
13555
|
/**
|
|
13390
13556
|
* Font Stretch
|
|
@@ -13398,7 +13564,7 @@ var getDefaultConfig = () => {
|
|
|
13398
13564
|
* @see https://tailwindcss.com/docs/font-family
|
|
13399
13565
|
*/
|
|
13400
13566
|
"font-family": [{
|
|
13401
|
-
font: [isArbitraryVariableFamilyName,
|
|
13567
|
+
font: [isArbitraryVariableFamilyName, isArbitraryFamilyName, themeFont]
|
|
13402
13568
|
}],
|
|
13403
13569
|
/**
|
|
13404
13570
|
* Font Variant Numeric
|
|
@@ -15159,7 +15325,7 @@ function FlowSectionBox({ section }) {
|
|
|
15159
15325
|
}
|
|
15160
15326
|
|
|
15161
15327
|
// src/components/molecules/code-snippet.tsx
|
|
15162
|
-
import { useState as useState38, useEffect as
|
|
15328
|
+
import { useState as useState38, useEffect as useEffect27 } from "react";
|
|
15163
15329
|
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
15164
15330
|
function CodeSnippet(props) {
|
|
15165
15331
|
const {
|
|
@@ -15175,7 +15341,7 @@ function CodeSnippet(props) {
|
|
|
15175
15341
|
} = props;
|
|
15176
15342
|
const snippetClassName = `elb-code-snippet ${className || ""}`.trim();
|
|
15177
15343
|
const [formattedCode, setFormattedCode] = useState38(code);
|
|
15178
|
-
|
|
15344
|
+
useEffect27(() => {
|
|
15179
15345
|
if (format3 && code) {
|
|
15180
15346
|
formatCode(code, language).then(setFormattedCode);
|
|
15181
15347
|
} else {
|
|
@@ -15199,9 +15365,9 @@ function CodeSnippet(props) {
|
|
|
15199
15365
|
}
|
|
15200
15366
|
|
|
15201
15367
|
// src/components/molecules/flow-map/FlowMap.tsx
|
|
15202
|
-
import React23, { useEffect as
|
|
15368
|
+
import React23, { useEffect as useEffect28, useRef as useRef17 } from "react";
|
|
15203
15369
|
import rough from "roughjs";
|
|
15204
|
-
import { Fragment as
|
|
15370
|
+
import { Fragment as Fragment10, jsx as jsx90, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
15205
15371
|
function RoughRect({
|
|
15206
15372
|
x,
|
|
15207
15373
|
y,
|
|
@@ -15210,8 +15376,8 @@ function RoughRect({
|
|
|
15210
15376
|
fill,
|
|
15211
15377
|
stroke
|
|
15212
15378
|
}) {
|
|
15213
|
-
const ref =
|
|
15214
|
-
|
|
15379
|
+
const ref = useRef17(null);
|
|
15380
|
+
useEffect28(() => {
|
|
15215
15381
|
if (!ref.current) return;
|
|
15216
15382
|
const svg = ref.current.ownerSVGElement;
|
|
15217
15383
|
if (!svg) return;
|
|
@@ -15250,8 +15416,8 @@ function RoughCircle({
|
|
|
15250
15416
|
fill,
|
|
15251
15417
|
stroke
|
|
15252
15418
|
}) {
|
|
15253
|
-
const ref =
|
|
15254
|
-
|
|
15419
|
+
const ref = useRef17(null);
|
|
15420
|
+
useEffect28(() => {
|
|
15255
15421
|
if (!ref.current) return;
|
|
15256
15422
|
const svg = ref.current.ownerSVGElement;
|
|
15257
15423
|
if (!svg) return;
|
|
@@ -15308,8 +15474,8 @@ function RoughArrow({
|
|
|
15308
15474
|
arrowSize = 8,
|
|
15309
15475
|
centerY
|
|
15310
15476
|
}) {
|
|
15311
|
-
const ref =
|
|
15312
|
-
|
|
15477
|
+
const ref = useRef17(null);
|
|
15478
|
+
useEffect28(() => {
|
|
15313
15479
|
if (!ref.current) return;
|
|
15314
15480
|
const svg = ref.current.ownerSVGElement;
|
|
15315
15481
|
if (!svg) return;
|
|
@@ -15645,7 +15811,7 @@ function FlowMap({
|
|
|
15645
15811
|
return aIdx - bIdx;
|
|
15646
15812
|
}
|
|
15647
15813
|
);
|
|
15648
|
-
const containerRef =
|
|
15814
|
+
const containerRef = useRef17(null);
|
|
15649
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);
|
|
15650
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);
|
|
15651
15817
|
const stageMarkerPositions = [
|
|
@@ -15986,7 +16152,7 @@ function FlowMap({
|
|
|
15986
16152
|
}
|
|
15987
16153
|
return collectorPos;
|
|
15988
16154
|
};
|
|
15989
|
-
return /* @__PURE__ */ jsxs67(
|
|
16155
|
+
return /* @__PURE__ */ jsxs67(Fragment10, { children: [
|
|
15990
16156
|
!stageBefore && sourceEntries.length === 1 && /* @__PURE__ */ jsx90(
|
|
15991
16157
|
RoughArrow,
|
|
15992
16158
|
{
|
|
@@ -16165,7 +16331,7 @@ function FlowMap({
|
|
|
16165
16331
|
const fromY = collectorCenterY;
|
|
16166
16332
|
const toY = firstPostPos.y + boxHeight / 2;
|
|
16167
16333
|
const offset = withReturn ? ARROW_OFFSET : 0;
|
|
16168
|
-
return /* @__PURE__ */ jsxs67(
|
|
16334
|
+
return /* @__PURE__ */ jsxs67(Fragment10, { children: [
|
|
16169
16335
|
/* @__PURE__ */ jsx90(
|
|
16170
16336
|
RoughArrow,
|
|
16171
16337
|
{
|
|
@@ -16232,7 +16398,7 @@ function FlowMap({
|
|
|
16232
16398
|
const stageHighlight = config?.highlight !== false;
|
|
16233
16399
|
const labelY = text ? pos.y + pos.height * 0.28 : pos.y + pos.height / 2;
|
|
16234
16400
|
const linkUrl = link === false ? null : typeof link === "string" ? link : defaultLink;
|
|
16235
|
-
const stageContent = /* @__PURE__ */ jsxs67(
|
|
16401
|
+
const stageContent = /* @__PURE__ */ jsxs67(Fragment10, { children: [
|
|
16236
16402
|
/* @__PURE__ */ jsx90(
|
|
16237
16403
|
RoughRect,
|
|
16238
16404
|
{
|
|
@@ -16601,6 +16767,414 @@ function PropertyTable({ schema, className }) {
|
|
|
16601
16767
|
] });
|
|
16602
16768
|
}
|
|
16603
16769
|
|
|
16770
|
+
// src/components/molecules/form-card.tsx
|
|
16771
|
+
import { jsx as jsx92, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
16772
|
+
function FormCard({
|
|
16773
|
+
children,
|
|
16774
|
+
title,
|
|
16775
|
+
subtitle,
|
|
16776
|
+
footer,
|
|
16777
|
+
maxWidth = "md",
|
|
16778
|
+
className = ""
|
|
16779
|
+
}) {
|
|
16780
|
+
return /* @__PURE__ */ jsxs69(
|
|
16781
|
+
"div",
|
|
16782
|
+
{
|
|
16783
|
+
className: `elb-form-card elb-form-card--${maxWidth} ${className}`.trim(),
|
|
16784
|
+
children: [
|
|
16785
|
+
(title || subtitle) && /* @__PURE__ */ jsxs69("div", { className: "elb-form-card__header", children: [
|
|
16786
|
+
title && /* @__PURE__ */ jsx92("h1", { className: "elb-form-card__title", children: title }),
|
|
16787
|
+
subtitle && /* @__PURE__ */ jsx92("p", { className: "elb-form-card__subtitle", children: subtitle })
|
|
16788
|
+
] }),
|
|
16789
|
+
/* @__PURE__ */ jsx92("div", { className: "elb-form-card__content", children }),
|
|
16790
|
+
footer && /* @__PURE__ */ jsx92("div", { className: "elb-form-card__footer", children: footer })
|
|
16791
|
+
]
|
|
16792
|
+
}
|
|
16793
|
+
);
|
|
16794
|
+
}
|
|
16795
|
+
|
|
16796
|
+
// src/components/molecules/dropdown.tsx
|
|
16797
|
+
import { jsx as jsx93, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
16798
|
+
function Dropdown({
|
|
16799
|
+
trigger,
|
|
16800
|
+
isOpen,
|
|
16801
|
+
onToggle,
|
|
16802
|
+
children,
|
|
16803
|
+
align = "left",
|
|
16804
|
+
ariaLabel,
|
|
16805
|
+
className = ""
|
|
16806
|
+
}) {
|
|
16807
|
+
return /* @__PURE__ */ jsxs70("div", { className: `elb-dropdown ${className}`.trim(), children: [
|
|
16808
|
+
/* @__PURE__ */ jsx93(
|
|
16809
|
+
"div",
|
|
16810
|
+
{
|
|
16811
|
+
className: "elb-dropdown__trigger",
|
|
16812
|
+
onClick: onToggle,
|
|
16813
|
+
role: "button",
|
|
16814
|
+
tabIndex: 0,
|
|
16815
|
+
"aria-haspopup": "menu",
|
|
16816
|
+
"aria-expanded": isOpen,
|
|
16817
|
+
"aria-label": ariaLabel,
|
|
16818
|
+
onKeyDown: (e) => {
|
|
16819
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
16820
|
+
e.preventDefault();
|
|
16821
|
+
onToggle();
|
|
16822
|
+
}
|
|
16823
|
+
},
|
|
16824
|
+
children: trigger
|
|
16825
|
+
}
|
|
16826
|
+
),
|
|
16827
|
+
isOpen && /* @__PURE__ */ jsx93(
|
|
16828
|
+
"div",
|
|
16829
|
+
{
|
|
16830
|
+
className: `elb-dropdown__panel elb-dropdown__panel--${align}`,
|
|
16831
|
+
role: "menu",
|
|
16832
|
+
children
|
|
16833
|
+
}
|
|
16834
|
+
)
|
|
16835
|
+
] });
|
|
16836
|
+
}
|
|
16837
|
+
function DropdownItem({
|
|
16838
|
+
children,
|
|
16839
|
+
onClick,
|
|
16840
|
+
disabled = false,
|
|
16841
|
+
variant = "default",
|
|
16842
|
+
className = ""
|
|
16843
|
+
}) {
|
|
16844
|
+
return /* @__PURE__ */ jsx93(
|
|
16845
|
+
"button",
|
|
16846
|
+
{
|
|
16847
|
+
type: "button",
|
|
16848
|
+
role: "menuitem",
|
|
16849
|
+
className: `elb-dropdown__item elb-dropdown__item--${variant} ${disabled ? "elb-dropdown__item--disabled" : ""} ${className}`.trim(),
|
|
16850
|
+
onClick,
|
|
16851
|
+
disabled,
|
|
16852
|
+
children
|
|
16853
|
+
}
|
|
16854
|
+
);
|
|
16855
|
+
}
|
|
16856
|
+
function DropdownDivider({ className = "" }) {
|
|
16857
|
+
return /* @__PURE__ */ jsx93(
|
|
16858
|
+
"div",
|
|
16859
|
+
{
|
|
16860
|
+
className: `elb-dropdown__divider ${className}`.trim(),
|
|
16861
|
+
role: "separator"
|
|
16862
|
+
}
|
|
16863
|
+
);
|
|
16864
|
+
}
|
|
16865
|
+
|
|
16866
|
+
// src/components/atoms/form-textarea.tsx
|
|
16867
|
+
import { useId } from "react";
|
|
16868
|
+
|
|
16869
|
+
// src/components/atoms/form-field.tsx
|
|
16870
|
+
import { jsx as jsx94, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
16871
|
+
function FormField({
|
|
16872
|
+
children,
|
|
16873
|
+
label,
|
|
16874
|
+
htmlFor,
|
|
16875
|
+
error,
|
|
16876
|
+
required,
|
|
16877
|
+
className = ""
|
|
16878
|
+
}) {
|
|
16879
|
+
return /* @__PURE__ */ jsxs71(
|
|
16880
|
+
"div",
|
|
16881
|
+
{
|
|
16882
|
+
className: `elb-form-field ${error ? "elb-form-field--error" : ""} ${className}`.trim(),
|
|
16883
|
+
children: [
|
|
16884
|
+
label && /* @__PURE__ */ jsxs71("label", { htmlFor, className: "elb-form-field__label", children: [
|
|
16885
|
+
label,
|
|
16886
|
+
required && /* @__PURE__ */ jsx94("span", { className: "elb-form-field__required", "aria-hidden": "true", children: "*" })
|
|
16887
|
+
] }),
|
|
16888
|
+
/* @__PURE__ */ jsx94("div", { className: "elb-form-field__input", children }),
|
|
16889
|
+
error && /* @__PURE__ */ jsx94("div", { className: "elb-form-field__error", role: "alert", children: error })
|
|
16890
|
+
]
|
|
16891
|
+
}
|
|
16892
|
+
);
|
|
16893
|
+
}
|
|
16894
|
+
|
|
16895
|
+
// src/components/atoms/form-textarea.tsx
|
|
16896
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
16897
|
+
function FormTextarea({
|
|
16898
|
+
value,
|
|
16899
|
+
onChange,
|
|
16900
|
+
label,
|
|
16901
|
+
rows = 5,
|
|
16902
|
+
placeholder,
|
|
16903
|
+
disabled = false,
|
|
16904
|
+
spellCheck = true,
|
|
16905
|
+
required = false,
|
|
16906
|
+
error,
|
|
16907
|
+
id,
|
|
16908
|
+
className = ""
|
|
16909
|
+
}) {
|
|
16910
|
+
const generatedId = useId();
|
|
16911
|
+
const textareaId = id ?? generatedId;
|
|
16912
|
+
const hasError = Boolean(error);
|
|
16913
|
+
const errorMessage = typeof error === "string" ? error : void 0;
|
|
16914
|
+
return /* @__PURE__ */ jsx95(
|
|
16915
|
+
FormField,
|
|
16916
|
+
{
|
|
16917
|
+
label,
|
|
16918
|
+
htmlFor: textareaId,
|
|
16919
|
+
error: errorMessage,
|
|
16920
|
+
required,
|
|
16921
|
+
className,
|
|
16922
|
+
children: /* @__PURE__ */ jsx95(
|
|
16923
|
+
"textarea",
|
|
16924
|
+
{
|
|
16925
|
+
id: textareaId,
|
|
16926
|
+
value,
|
|
16927
|
+
onChange: (e) => onChange(e.target.value),
|
|
16928
|
+
rows,
|
|
16929
|
+
placeholder,
|
|
16930
|
+
disabled,
|
|
16931
|
+
spellCheck,
|
|
16932
|
+
required,
|
|
16933
|
+
className: `elb-form-textarea ${hasError ? "elb-form-textarea--error" : ""}`,
|
|
16934
|
+
"aria-invalid": hasError
|
|
16935
|
+
}
|
|
16936
|
+
)
|
|
16937
|
+
}
|
|
16938
|
+
);
|
|
16939
|
+
}
|
|
16940
|
+
|
|
16941
|
+
// src/components/atoms/spinner.tsx
|
|
16942
|
+
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
16943
|
+
function Spinner({ size = "md", className = "" }) {
|
|
16944
|
+
return /* @__PURE__ */ jsx96(
|
|
16945
|
+
"span",
|
|
16946
|
+
{
|
|
16947
|
+
className: `elb-spinner elb-spinner--${size} ${className}`.trim(),
|
|
16948
|
+
role: "status",
|
|
16949
|
+
"aria-label": "Loading"
|
|
16950
|
+
}
|
|
16951
|
+
);
|
|
16952
|
+
}
|
|
16953
|
+
|
|
16954
|
+
// src/components/atoms/submit-button.tsx
|
|
16955
|
+
import { Fragment as Fragment11, jsx as jsx97, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
16956
|
+
function SubmitButton({
|
|
16957
|
+
children,
|
|
16958
|
+
loadingText,
|
|
16959
|
+
loading = false,
|
|
16960
|
+
disabled = false,
|
|
16961
|
+
variant = "primary",
|
|
16962
|
+
fullWidth = false,
|
|
16963
|
+
type = "submit",
|
|
16964
|
+
onClick,
|
|
16965
|
+
className = ""
|
|
16966
|
+
}) {
|
|
16967
|
+
const isDisabled = disabled || loading;
|
|
16968
|
+
return /* @__PURE__ */ jsx97(
|
|
16969
|
+
"button",
|
|
16970
|
+
{
|
|
16971
|
+
type,
|
|
16972
|
+
disabled: isDisabled,
|
|
16973
|
+
onClick,
|
|
16974
|
+
className: `elb-submit-button elb-submit-button--${variant} ${fullWidth ? "elb-submit-button--full-width" : ""} ${loading ? "elb-submit-button--loading" : ""} ${className}`.trim(),
|
|
16975
|
+
children: loading ? /* @__PURE__ */ jsxs72(Fragment11, { children: [
|
|
16976
|
+
/* @__PURE__ */ jsx97(Spinner, { size: "sm", className: "elb-submit-button__spinner" }),
|
|
16977
|
+
/* @__PURE__ */ jsx97("span", { children: loadingText ?? children })
|
|
16978
|
+
] }) : children
|
|
16979
|
+
}
|
|
16980
|
+
);
|
|
16981
|
+
}
|
|
16982
|
+
|
|
16983
|
+
// src/components/atoms/alert.tsx
|
|
16984
|
+
import { jsx as jsx98, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
16985
|
+
function Alert({
|
|
16986
|
+
children,
|
|
16987
|
+
title,
|
|
16988
|
+
variant,
|
|
16989
|
+
role = variant === "error" ? "alert" : "status",
|
|
16990
|
+
className = ""
|
|
16991
|
+
}) {
|
|
16992
|
+
return /* @__PURE__ */ jsxs73(
|
|
16993
|
+
"div",
|
|
16994
|
+
{
|
|
16995
|
+
className: `elb-alert elb-alert--${variant} ${className}`.trim(),
|
|
16996
|
+
role,
|
|
16997
|
+
children: [
|
|
16998
|
+
title && /* @__PURE__ */ jsx98("div", { className: "elb-alert__title", children: title }),
|
|
16999
|
+
/* @__PURE__ */ jsx98("div", { className: "elb-alert__content", children })
|
|
17000
|
+
]
|
|
17001
|
+
}
|
|
17002
|
+
);
|
|
17003
|
+
}
|
|
17004
|
+
|
|
17005
|
+
// src/components/molecules/config-form-card.tsx
|
|
17006
|
+
import { jsx as jsx99, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
17007
|
+
function ConfigFormCard({
|
|
17008
|
+
config,
|
|
17009
|
+
onConfigChange,
|
|
17010
|
+
onSubmit,
|
|
17011
|
+
loading = false,
|
|
17012
|
+
error = null,
|
|
17013
|
+
title = "Configuration",
|
|
17014
|
+
label = "Configuration (JSON)",
|
|
17015
|
+
submitText = "Submit",
|
|
17016
|
+
loadingText = "Processing...",
|
|
17017
|
+
rows = 20,
|
|
17018
|
+
maxWidth = "lg",
|
|
17019
|
+
className = ""
|
|
17020
|
+
}) {
|
|
17021
|
+
return /* @__PURE__ */ jsx99(FormCard, { title, maxWidth, className, children: /* @__PURE__ */ jsxs74("form", { onSubmit, children: [
|
|
17022
|
+
/* @__PURE__ */ jsx99(
|
|
17023
|
+
FormTextarea,
|
|
17024
|
+
{
|
|
17025
|
+
label,
|
|
17026
|
+
value: config,
|
|
17027
|
+
onChange: onConfigChange,
|
|
17028
|
+
rows,
|
|
17029
|
+
disabled: loading,
|
|
17030
|
+
spellCheck: false,
|
|
17031
|
+
error: !!error
|
|
17032
|
+
}
|
|
17033
|
+
),
|
|
17034
|
+
error && /* @__PURE__ */ jsx99(Alert, { variant: "error", children: error }),
|
|
17035
|
+
/* @__PURE__ */ jsx99(SubmitButton, { loading, loadingText, fullWidth: true, children: submitText })
|
|
17036
|
+
] }) });
|
|
17037
|
+
}
|
|
17038
|
+
|
|
17039
|
+
// src/components/molecules/split-button.tsx
|
|
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";
|
|
17042
|
+
function SplitButton({
|
|
17043
|
+
children,
|
|
17044
|
+
onClick,
|
|
17045
|
+
actions = [],
|
|
17046
|
+
variant = "primary",
|
|
17047
|
+
loading = false,
|
|
17048
|
+
loadingText,
|
|
17049
|
+
disabled = false,
|
|
17050
|
+
className = ""
|
|
17051
|
+
}) {
|
|
17052
|
+
const [open, setOpen] = useState40(false);
|
|
17053
|
+
const ref = useRef18(null);
|
|
17054
|
+
const isDisabled = disabled || loading;
|
|
17055
|
+
const handleClickOutside = useCallback19((e) => {
|
|
17056
|
+
if (ref.current && !ref.current.contains(e.target)) {
|
|
17057
|
+
setOpen(false);
|
|
17058
|
+
}
|
|
17059
|
+
}, []);
|
|
17060
|
+
const handleKeyDown = useCallback19((e) => {
|
|
17061
|
+
if (e.key === "Escape") setOpen(false);
|
|
17062
|
+
}, []);
|
|
17063
|
+
useEffect29(() => {
|
|
17064
|
+
if (open) {
|
|
17065
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
17066
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
17067
|
+
return () => {
|
|
17068
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
17069
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
17070
|
+
};
|
|
17071
|
+
}
|
|
17072
|
+
}, [open, handleClickOutside, handleKeyDown]);
|
|
17073
|
+
return /* @__PURE__ */ jsxs75(
|
|
17074
|
+
"div",
|
|
17075
|
+
{
|
|
17076
|
+
ref,
|
|
17077
|
+
className: `elb-split-button elb-split-button--${variant} ${className}`,
|
|
17078
|
+
children: [
|
|
17079
|
+
/* @__PURE__ */ jsx100(
|
|
17080
|
+
"button",
|
|
17081
|
+
{
|
|
17082
|
+
type: "button",
|
|
17083
|
+
className: "elb-split-button__primary",
|
|
17084
|
+
onClick,
|
|
17085
|
+
disabled: isDisabled,
|
|
17086
|
+
children: loading ? loadingText ?? children : children
|
|
17087
|
+
}
|
|
17088
|
+
),
|
|
17089
|
+
actions.length > 0 && /* @__PURE__ */ jsxs75(Fragment12, { children: [
|
|
17090
|
+
/* @__PURE__ */ jsx100(
|
|
17091
|
+
"button",
|
|
17092
|
+
{
|
|
17093
|
+
type: "button",
|
|
17094
|
+
className: "elb-split-button__toggle",
|
|
17095
|
+
onClick: () => setOpen(!open),
|
|
17096
|
+
disabled: isDisabled,
|
|
17097
|
+
"aria-label": "More actions",
|
|
17098
|
+
"aria-expanded": open,
|
|
17099
|
+
children: /* @__PURE__ */ jsx100(
|
|
17100
|
+
"svg",
|
|
17101
|
+
{
|
|
17102
|
+
className: "elb-split-button__arrow",
|
|
17103
|
+
width: "10",
|
|
17104
|
+
height: "6",
|
|
17105
|
+
viewBox: "0 0 10 6",
|
|
17106
|
+
fill: "currentColor",
|
|
17107
|
+
children: /* @__PURE__ */ jsx100(
|
|
17108
|
+
"path",
|
|
17109
|
+
{
|
|
17110
|
+
d: "M1 1l4 4 4-4",
|
|
17111
|
+
stroke: "currentColor",
|
|
17112
|
+
strokeWidth: "1.5",
|
|
17113
|
+
fill: "none"
|
|
17114
|
+
}
|
|
17115
|
+
)
|
|
17116
|
+
}
|
|
17117
|
+
)
|
|
17118
|
+
}
|
|
17119
|
+
),
|
|
17120
|
+
open && /* @__PURE__ */ jsx100("div", { className: "elb-split-button__dropdown", children: actions.map((action) => /* @__PURE__ */ jsx100(
|
|
17121
|
+
"button",
|
|
17122
|
+
{
|
|
17123
|
+
type: "button",
|
|
17124
|
+
className: "elb-split-button__action",
|
|
17125
|
+
disabled: action.disabled,
|
|
17126
|
+
onClick: () => {
|
|
17127
|
+
setOpen(false);
|
|
17128
|
+
action.onClick();
|
|
17129
|
+
},
|
|
17130
|
+
children: action.label
|
|
17131
|
+
},
|
|
17132
|
+
action.key
|
|
17133
|
+
)) })
|
|
17134
|
+
] })
|
|
17135
|
+
]
|
|
17136
|
+
}
|
|
17137
|
+
);
|
|
17138
|
+
}
|
|
17139
|
+
|
|
17140
|
+
// src/components/molecules/flow-selector.tsx
|
|
17141
|
+
import { jsx as jsx101, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
17142
|
+
var STATUS_DOT = {
|
|
17143
|
+
active: "elb-flow-selector__dot--active",
|
|
17144
|
+
published: "elb-flow-selector__dot--active",
|
|
17145
|
+
deploying: "elb-flow-selector__dot--deploying",
|
|
17146
|
+
failed: "elb-flow-selector__dot--failed",
|
|
17147
|
+
stopped: "elb-flow-selector__dot--failed"
|
|
17148
|
+
};
|
|
17149
|
+
function FlowSelector({
|
|
17150
|
+
flows,
|
|
17151
|
+
selectedFlow,
|
|
17152
|
+
onSelectFlow,
|
|
17153
|
+
className = ""
|
|
17154
|
+
}) {
|
|
17155
|
+
if (flows.length <= 1) return null;
|
|
17156
|
+
return /* @__PURE__ */ jsx101("div", { className: `elb-flow-selector ${className}`, role: "tablist", children: flows.map((flow) => {
|
|
17157
|
+
const isSelected = flow.name === selectedFlow;
|
|
17158
|
+
const dotClass = flow.deploymentStatus ? STATUS_DOT[flow.deploymentStatus] ?? "" : "";
|
|
17159
|
+
return /* @__PURE__ */ jsxs76(
|
|
17160
|
+
"button",
|
|
17161
|
+
{
|
|
17162
|
+
type: "button",
|
|
17163
|
+
role: "tab",
|
|
17164
|
+
"aria-selected": isSelected,
|
|
17165
|
+
className: `elb-flow-selector__tab ${isSelected ? "elb-flow-selector__tab--selected" : ""}`,
|
|
17166
|
+
onClick: () => onSelectFlow(flow.name),
|
|
17167
|
+
children: [
|
|
17168
|
+
/* @__PURE__ */ jsx101("span", { className: `elb-flow-selector__dot ${dotClass}` }),
|
|
17169
|
+
/* @__PURE__ */ jsx101("span", { className: "elb-flow-selector__name", children: flow.name }),
|
|
17170
|
+
flow.platform && /* @__PURE__ */ jsx101("span", { className: "elb-flow-selector__platform", children: flow.platform })
|
|
17171
|
+
]
|
|
17172
|
+
},
|
|
17173
|
+
flow.name
|
|
17174
|
+
);
|
|
17175
|
+
}) });
|
|
17176
|
+
}
|
|
17177
|
+
|
|
16604
17178
|
// src/schemas/config-structures/destination-config.ts
|
|
16605
17179
|
var DESTINATION_CONFIG_STRUCTURE = {
|
|
16606
17180
|
type: "object",
|
|
@@ -16687,13 +17261,13 @@ var DESTINATION_CONFIG_STRUCTURE = {
|
|
|
16687
17261
|
};
|
|
16688
17262
|
|
|
16689
17263
|
// src/components/atoms/footer.tsx
|
|
16690
|
-
import { jsx as
|
|
17264
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
16691
17265
|
function Footer({ children, className = "" }) {
|
|
16692
|
-
return /* @__PURE__ */
|
|
17266
|
+
return /* @__PURE__ */ jsx102("div", { className: `elb-explorer-footer ${className}`, children });
|
|
16693
17267
|
}
|
|
16694
17268
|
|
|
16695
17269
|
// src/components/atoms/button-link.tsx
|
|
16696
|
-
import { jsx as
|
|
17270
|
+
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
16697
17271
|
function ButtonLink({
|
|
16698
17272
|
variant = "default",
|
|
16699
17273
|
size = "md",
|
|
@@ -16706,9 +17280,9 @@ function ButtonLink({
|
|
|
16706
17280
|
const baseClass = "elb-button-link";
|
|
16707
17281
|
const classes = `${baseClass} ${baseClass}-${variant} ${baseClass}-${size} ${className}`.trim();
|
|
16708
17282
|
if (href && !disabled) {
|
|
16709
|
-
return /* @__PURE__ */
|
|
17283
|
+
return /* @__PURE__ */ jsx103("a", { href, className: classes, children });
|
|
16710
17284
|
}
|
|
16711
|
-
return /* @__PURE__ */
|
|
17285
|
+
return /* @__PURE__ */ jsx103(
|
|
16712
17286
|
"button",
|
|
16713
17287
|
{
|
|
16714
17288
|
type: "button",
|
|
@@ -16721,21 +17295,70 @@ function ButtonLink({
|
|
|
16721
17295
|
}
|
|
16722
17296
|
|
|
16723
17297
|
// src/components/atoms/panel-hints.tsx
|
|
16724
|
-
import { jsx as
|
|
17298
|
+
import { jsx as jsx104, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
16725
17299
|
function PanelHints({
|
|
16726
17300
|
title = "Common patterns",
|
|
16727
17301
|
hints,
|
|
16728
17302
|
className = ""
|
|
16729
17303
|
}) {
|
|
16730
|
-
return /* @__PURE__ */
|
|
16731
|
-
title && /* @__PURE__ */
|
|
16732
|
-
/* @__PURE__ */
|
|
16733
|
-
/* @__PURE__ */
|
|
16734
|
-
/* @__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 })
|
|
16735
17309
|
] }, index)) })
|
|
16736
17310
|
] });
|
|
16737
17311
|
}
|
|
16738
17312
|
|
|
17313
|
+
// src/components/atoms/form-input.tsx
|
|
17314
|
+
import { useId as useId2 } from "react";
|
|
17315
|
+
import { jsx as jsx105 } from "react/jsx-runtime";
|
|
17316
|
+
function FormInput({
|
|
17317
|
+
value,
|
|
17318
|
+
onChange,
|
|
17319
|
+
label,
|
|
17320
|
+
type = "text",
|
|
17321
|
+
placeholder,
|
|
17322
|
+
disabled = false,
|
|
17323
|
+
autoFocus = false,
|
|
17324
|
+
autoComplete,
|
|
17325
|
+
required = false,
|
|
17326
|
+
error,
|
|
17327
|
+
id,
|
|
17328
|
+
className = ""
|
|
17329
|
+
}) {
|
|
17330
|
+
const generatedId = useId2();
|
|
17331
|
+
const inputId = id ?? generatedId;
|
|
17332
|
+
const hasError = Boolean(error);
|
|
17333
|
+
const errorMessage = typeof error === "string" ? error : void 0;
|
|
17334
|
+
return /* @__PURE__ */ jsx105(
|
|
17335
|
+
FormField,
|
|
17336
|
+
{
|
|
17337
|
+
label,
|
|
17338
|
+
htmlFor: inputId,
|
|
17339
|
+
error: errorMessage,
|
|
17340
|
+
required,
|
|
17341
|
+
className,
|
|
17342
|
+
children: /* @__PURE__ */ jsx105(
|
|
17343
|
+
"input",
|
|
17344
|
+
{
|
|
17345
|
+
id: inputId,
|
|
17346
|
+
type,
|
|
17347
|
+
value,
|
|
17348
|
+
onChange: (e) => onChange(e.target.value),
|
|
17349
|
+
placeholder,
|
|
17350
|
+
disabled,
|
|
17351
|
+
autoFocus,
|
|
17352
|
+
autoComplete,
|
|
17353
|
+
required,
|
|
17354
|
+
className: `elb-form-input ${hasError ? "elb-form-input--error" : ""}`,
|
|
17355
|
+
"aria-invalid": hasError
|
|
17356
|
+
}
|
|
17357
|
+
)
|
|
17358
|
+
}
|
|
17359
|
+
);
|
|
17360
|
+
}
|
|
17361
|
+
|
|
16739
17362
|
// src/components/atoms/icons/icons.tsx
|
|
16740
17363
|
addIcon("walkeros:piwik-pro", {
|
|
16741
17364
|
body: '<g fill="none" fill-rule="evenodd"><path fill="#231F20" d="M0 0h90v90H0z"/><path d="M50.792 57.21v.044H37.99v8.675c0 3.38-2.652 6.07-6.006 6.07a5.917 5.917 0 0 1-4.243-1.77 6.073 6.073 0 0 1-1.74-4.3v-38.88C26 23.67 28.65 21 31.983 21H50.79v.022c9.58.4 17.209 8.341 17.209 18.104 0 9.764-7.628 17.704-17.209 18.083h.001Zm-2.148-25.29H37.99v14.57h10.872c3.88-.112 6.993-3.337 6.993-7.274a7.347 7.347 0 0 0-2.114-5.16 7.16 7.16 0 0 0-5.098-2.134Z" fill="#FFF" fill-rule="nonzero"/></g>',
|
|
@@ -16744,12 +17367,12 @@ addIcon("walkeros:piwik-pro", {
|
|
|
16744
17367
|
});
|
|
16745
17368
|
|
|
16746
17369
|
// node_modules/@mdx-js/react/lib/index.js
|
|
16747
|
-
import
|
|
17370
|
+
import React28 from "react";
|
|
16748
17371
|
var emptyComponents = {};
|
|
16749
|
-
var MDXContext =
|
|
17372
|
+
var MDXContext = React28.createContext(emptyComponents);
|
|
16750
17373
|
function useMDXComponents(components) {
|
|
16751
|
-
const contextComponents =
|
|
16752
|
-
return
|
|
17374
|
+
const contextComponents = React28.useContext(MDXContext);
|
|
17375
|
+
return React28.useMemo(
|
|
16753
17376
|
function() {
|
|
16754
17377
|
if (typeof components === "function") {
|
|
16755
17378
|
return components(contextComponents);
|
|
@@ -16766,7 +17389,7 @@ function MDXProvider(properties) {
|
|
|
16766
17389
|
} else {
|
|
16767
17390
|
allComponents = useMDXComponents(properties.components);
|
|
16768
17391
|
}
|
|
16769
|
-
return
|
|
17392
|
+
return React28.createElement(
|
|
16770
17393
|
MDXContext.Provider,
|
|
16771
17394
|
{ value: allComponents },
|
|
16772
17395
|
properties.children
|
|
@@ -16775,7 +17398,7 @@ function MDXProvider(properties) {
|
|
|
16775
17398
|
|
|
16776
17399
|
// src/components/atoms/mdx-code.tsx
|
|
16777
17400
|
import { Children } from "react";
|
|
16778
|
-
import { jsx as
|
|
17401
|
+
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
16779
17402
|
var MDXCode = ({
|
|
16780
17403
|
className,
|
|
16781
17404
|
children
|
|
@@ -16789,7 +17412,7 @@ var MDXCode = ({
|
|
|
16789
17412
|
return false;
|
|
16790
17413
|
});
|
|
16791
17414
|
if (!hasClassName || !hasNewlines) {
|
|
16792
|
-
return /* @__PURE__ */
|
|
17415
|
+
return /* @__PURE__ */ jsx106("code", { className: "elb-code-inline", children });
|
|
16793
17416
|
}
|
|
16794
17417
|
const mdxLanguage = className.replace(/^language-/, "");
|
|
16795
17418
|
const languageMap = {
|
|
@@ -16804,7 +17427,7 @@ var MDXCode = ({
|
|
|
16804
17427
|
};
|
|
16805
17428
|
const monacoLanguage = languageMap[mdxLanguage] || mdxLanguage;
|
|
16806
17429
|
const code = childrenArray.map((child) => typeof child === "string" ? child : "").join("").trim();
|
|
16807
|
-
return /* @__PURE__ */
|
|
17430
|
+
return /* @__PURE__ */ jsx106(
|
|
16808
17431
|
CodeBox,
|
|
16809
17432
|
{
|
|
16810
17433
|
code,
|
|
@@ -16818,7 +17441,7 @@ var MDXCode = ({
|
|
|
16818
17441
|
};
|
|
16819
17442
|
|
|
16820
17443
|
// src/providers/MDXProvider.tsx
|
|
16821
|
-
import { jsx as
|
|
17444
|
+
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
16822
17445
|
var MDXProvider2 = ({ children }) => {
|
|
16823
17446
|
const components = {
|
|
16824
17447
|
// Markdown element mappings
|
|
@@ -16830,9 +17453,53 @@ var MDXProvider2 = ({ children }) => {
|
|
|
16830
17453
|
DestinationInitDemo,
|
|
16831
17454
|
DestinationDemo
|
|
16832
17455
|
};
|
|
16833
|
-
return /* @__PURE__ */
|
|
17456
|
+
return /* @__PURE__ */ jsx107(MDXProvider, { components, children });
|
|
16834
17457
|
};
|
|
17458
|
+
|
|
17459
|
+
// src/hooks/useDropdown.ts
|
|
17460
|
+
import { useState as useState41, useRef as useRef19, useEffect as useEffect30, useCallback as useCallback20 } from "react";
|
|
17461
|
+
function useDropdown() {
|
|
17462
|
+
const [isOpen, setIsOpen] = useState41(false);
|
|
17463
|
+
const containerRef = useRef19(null);
|
|
17464
|
+
const toggle = useCallback20(() => {
|
|
17465
|
+
setIsOpen((prev) => !prev);
|
|
17466
|
+
}, []);
|
|
17467
|
+
const open = useCallback20(() => {
|
|
17468
|
+
setIsOpen(true);
|
|
17469
|
+
}, []);
|
|
17470
|
+
const close = useCallback20(() => {
|
|
17471
|
+
setIsOpen(false);
|
|
17472
|
+
}, []);
|
|
17473
|
+
useEffect30(() => {
|
|
17474
|
+
if (!isOpen) return;
|
|
17475
|
+
function handleClickOutside(event) {
|
|
17476
|
+
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
17477
|
+
setIsOpen(false);
|
|
17478
|
+
}
|
|
17479
|
+
}
|
|
17480
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
17481
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
17482
|
+
}, [isOpen]);
|
|
17483
|
+
useEffect30(() => {
|
|
17484
|
+
if (!isOpen) return;
|
|
17485
|
+
function handleEscape(event) {
|
|
17486
|
+
if (event.key === "Escape") {
|
|
17487
|
+
setIsOpen(false);
|
|
17488
|
+
}
|
|
17489
|
+
}
|
|
17490
|
+
document.addEventListener("keydown", handleEscape);
|
|
17491
|
+
return () => document.removeEventListener("keydown", handleEscape);
|
|
17492
|
+
}, [isOpen]);
|
|
17493
|
+
return {
|
|
17494
|
+
isOpen,
|
|
17495
|
+
toggle,
|
|
17496
|
+
open,
|
|
17497
|
+
close,
|
|
17498
|
+
containerRef
|
|
17499
|
+
};
|
|
17500
|
+
}
|
|
16835
17501
|
export {
|
|
17502
|
+
Alert,
|
|
16836
17503
|
ArchitectureFlow,
|
|
16837
17504
|
Box,
|
|
16838
17505
|
BrowserBox,
|
|
@@ -16844,13 +17511,22 @@ export {
|
|
|
16844
17511
|
CodeSnippet,
|
|
16845
17512
|
CollectorBox,
|
|
16846
17513
|
ConfigEditor,
|
|
17514
|
+
ConfigFormCard,
|
|
16847
17515
|
DESTINATION_CONFIG_STRUCTURE,
|
|
16848
17516
|
DestinationDemo,
|
|
16849
17517
|
DestinationInitDemo as DestinationInit,
|
|
16850
17518
|
DestinationInitDemo,
|
|
16851
17519
|
DestinationDemo as DestinationPush,
|
|
17520
|
+
Dropdown,
|
|
17521
|
+
DropdownDivider,
|
|
17522
|
+
DropdownItem,
|
|
16852
17523
|
FlowMap,
|
|
17524
|
+
FlowSelector,
|
|
16853
17525
|
Footer,
|
|
17526
|
+
FormCard,
|
|
17527
|
+
FormField,
|
|
17528
|
+
FormInput,
|
|
17529
|
+
FormTextarea,
|
|
16854
17530
|
Grid,
|
|
16855
17531
|
Header,
|
|
16856
17532
|
Icon,
|
|
@@ -16866,6 +17542,9 @@ export {
|
|
|
16866
17542
|
Preview,
|
|
16867
17543
|
PromotionPlayground,
|
|
16868
17544
|
PropertyTable,
|
|
17545
|
+
Spinner,
|
|
17546
|
+
SplitButton,
|
|
17547
|
+
SubmitButton,
|
|
16869
17548
|
captureDestinationPush,
|
|
16870
17549
|
cn,
|
|
16871
17550
|
createCaptureFn,
|
|
@@ -16874,14 +17553,18 @@ export {
|
|
|
16874
17553
|
createPlausibleDestination,
|
|
16875
17554
|
createRawCapture,
|
|
16876
17555
|
formatCapturedCalls,
|
|
17556
|
+
generateModelPath,
|
|
16877
17557
|
initializeMonacoTypes,
|
|
16878
17558
|
lighthouseTheme,
|
|
16879
17559
|
loadPackageTypes,
|
|
16880
17560
|
loadTypeLibraryFromURL,
|
|
16881
17561
|
palenightTheme,
|
|
16882
17562
|
registerAllThemes,
|
|
17563
|
+
registerJsonSchema,
|
|
16883
17564
|
registerLighthouseTheme,
|
|
16884
17565
|
registerPalenightTheme,
|
|
16885
|
-
registerWalkerOSTypes
|
|
17566
|
+
registerWalkerOSTypes,
|
|
17567
|
+
unregisterJsonSchema,
|
|
17568
|
+
useDropdown
|
|
16886
17569
|
};
|
|
16887
17570
|
//# sourceMappingURL=index.mjs.map
|