treege 3.0.0-beta.29 → 3.0.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ThemeContext-D49eu_oE.js +1472 -0
- package/dist/editor/constants/nodeTypes.d.ts +4 -4
- package/dist/editor/context/TreegeEditorContext.d.ts +9 -1
- package/dist/editor/features/TreegeEditor/inputs/OptionImageField.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/GroupNode.d.ts +1 -1
- package/dist/editor/features/TreegeEditor/nodes/TreegeNode.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/components/BottomHandleDropdown.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeLabelInput.d.ts +9 -0
- package/dist/editor/features/TreegeEditor/nodes/components/NodeTypeBadge.d.ts +8 -0
- package/dist/editor/features/TreegeEditor/nodes/components/OpenSheetButton.d.ts +6 -0
- package/dist/editor/features/TreegeEditor/nodes/components/SubTypeBadge.d.ts +8 -0
- package/dist/editor/hooks/useFlowActions.d.ts +1 -0
- package/dist/editor/hooks/useFlowConnections.d.ts +4 -1
- package/dist/editor/utils/image.d.ts +7 -0
- package/dist/{editor-iWcSAxOr.js → editor-DnrJgSrC.js} +1246 -1035
- package/dist/editor.js +2 -2
- package/dist/main.js +4 -4
- package/dist/{renderer-DZD267lH.js → renderer-MCPhNlp1.js} +20 -12
- package/dist/renderer-native.js +644 -631
- package/dist/renderer.js +3 -3
- package/dist/{separator-DzU4sadU.js → separator-gO82kpxa.js} +1 -1
- package/dist/shared/locales/ar.json.d.ts +12 -0
- package/dist/shared/locales/de.json.d.ts +12 -0
- package/dist/shared/locales/en.json.d.ts +12 -0
- package/dist/shared/locales/es.json.d.ts +12 -0
- package/dist/shared/locales/fr.json.d.ts +12 -0
- package/dist/shared/locales/it.json.d.ts +12 -0
- package/dist/shared/locales/pt.json.d.ts +12 -0
- package/dist/shared/types/node.d.ts +5 -0
- package/dist/{useRenderNode-Huckx5bu.js → useRenderNode-B_GPMTPf.js} +1 -1
- package/package.json +1 -1
- package/dist/ThemeContext-cNnjiSPY.js +0 -2152
- package/dist/editor/features/TreegeEditor/nodes/FlowNode.d.ts +0 -6
- package/dist/editor/features/TreegeEditor/nodes/InputNode.d.ts +0 -6
- package/dist/editor/features/TreegeEditor/nodes/UINode.d.ts +0 -6
- package/dist/editor/features/TreegeEditor/nodes/hooks/useBottomHandleClick.d.ts +0 -8
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, f as r, i, l as a, r as o, t as s, u as c } from "./ThemeContext-
|
|
2
|
-
import { C as l, D as u, E as d, F as f, M as p, N as m, O as h, P as g, S as _, T as v, _ as y, a as b, b as x, c as S, d as C, f as ee, g as te, h as w, i as ne, j as T, k as E, l as D, m as O, n as k, o as re, p as ie, r as A, s as ae, t as oe, u as se, v as j, w as ce, x as le, y as M } from "./separator-
|
|
3
|
-
import { Background as ue, BackgroundVariant as de, BaseEdge as fe, Controls as pe, EdgeLabelRenderer as me, Handle as
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { useForm as
|
|
6
|
-
import { ArrowRightFromLine as
|
|
7
|
-
import { Slot as
|
|
8
|
-
import { cva as
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import * as
|
|
13
|
-
import * as
|
|
14
|
-
import * as
|
|
15
|
-
import { useTheme as
|
|
1
|
+
import { a as e, c as t, d as n, f as r, i, l as a, r as o, t as s, u as c } from "./ThemeContext-D49eu_oE.js";
|
|
2
|
+
import { C as l, D as u, E as d, F as f, M as p, N as m, O as h, P as g, S as _, T as v, _ as y, a as b, b as x, c as S, d as C, f as ee, g as te, h as w, i as ne, j as T, k as E, l as D, m as O, n as k, o as re, p as ie, r as A, s as ae, t as oe, u as se, v as j, w as ce, x as le, y as M } from "./separator-gO82kpxa.js";
|
|
3
|
+
import { Background as ue, BackgroundVariant as de, BaseEdge as fe, Controls as pe, EdgeLabelRenderer as me, Handle as he, MiniMap as ge, NodeResizer as _e, Panel as ve, Position as ye, ReactFlow as be, ReactFlowProvider as xe, addEdge as Se, getBezierPath as Ce, useEdges as we, useNodes as Te, useReactFlow as Ee } from "@xyflow/react";
|
|
4
|
+
import { createContext as De, memo as Oe, useCallback as N, useContext as ke, useEffect as Ae, useId as je, useMemo as P, useRef as Me, useState as F } from "react";
|
|
5
|
+
import { useForm as I } from "@tanstack/react-form";
|
|
6
|
+
import { ArrowRightFromLine as Ne, Boxes as Pe, Check as Fe, ChevronsUpDown as L, Cog as Ie, Copy as Le, Download as Re, EllipsisVertical as ze, ImagePlus as Be, Link2 as Ve, Loader2 as He, LucidePencilRuler as Ue, MessageCircleQuestion as We, Network as Ge, Plus as R, PlusCircle as Ke, RectangleEllipsis as qe, Save as Je, Trash2 as Ye, Upload as Xe, Variable as Ze, WandSparkles as Qe, Waypoints as $e, X as z, XIcon as et } from "lucide-react";
|
|
7
|
+
import { Slot as tt } from "@radix-ui/react-slot";
|
|
8
|
+
import { cva as nt } from "class-variance-authority";
|
|
9
|
+
import * as rt from "@radix-ui/react-scroll-area";
|
|
10
|
+
import * as B from "@radix-ui/react-dropdown-menu";
|
|
11
|
+
import { Toaster as it, toast as V } from "sonner";
|
|
12
|
+
import * as H from "@radix-ui/react-dialog";
|
|
13
|
+
import * as at from "@radix-ui/react-collapsible";
|
|
14
|
+
import * as U from "@radix-ui/react-alert-dialog";
|
|
15
|
+
import { useTheme as ot } from "next-themes";
|
|
16
16
|
//#region src/editor/assets/img/treege-black.svg
|
|
17
|
-
var $e = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%200%20462%20144'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1809_3434)'%3e%3cpath%20d='M137%2041.34L116.57%206C116.22%205.39399%20115.717%204.89037%20115.112%204.53942C114.507%204.18847%20113.82%204.00247%20113.12%204H38.83C38.1303%204.00247%2037.4434%204.18847%2036.838%204.53942C36.2326%204.89037%2035.7299%205.39399%2035.38%206L15%2041.34C14.6495%2041.947%2014.4647%2042.6355%2014.4641%2043.3365C14.4635%2044.0374%2014.6471%2044.7262%2014.9965%2045.3339C15.3459%2045.9416%2015.8488%2046.4467%2016.455%2046.7988C17.0611%2047.1509%2017.7491%2047.3375%2018.45%2047.34H133.53C134.233%2047.341%20134.923%2047.157%20135.532%2046.8063C136.141%2046.4557%20136.647%2045.9508%20136.999%2045.3426C137.35%2044.7343%20137.536%2044.0441%20137.536%2043.3415C137.536%2042.6388%20137.351%2041.9485%20137%2041.34V41.34Z'%20fill='%2311D3B4'/%3e%3cpath%20d='M92.48%20140.64H113.1C113.805%20140.643%20114.498%20140.459%20115.109%20140.108C115.72%20139.757%20116.228%20139.251%20116.58%20138.64L151.39%2078.3401C151.741%2077.7316%20151.926%2077.0413%20151.926%2076.3386C151.926%2075.636%20151.74%2074.9458%20151.389%2074.3375C151.037%2073.7293%20150.531%2073.2244%20149.922%2072.8738C149.313%2072.5231%20148.623%2072.3391%20147.92%2072.3401H92.48C91.4191%2072.3401%2090.4017%2072.7615%2089.6516%2073.5117C88.9014%2074.2618%2088.48%2075.2792%2088.48%2076.3401V136.64C88.48%20137.701%2088.9014%20138.718%2089.6516%20139.469C90.4017%20140.219%2091.4191%20140.64%2092.48%20140.64Z'%20fill='%23007EF6'/%3e%3cpath%20d='M59.48%2072.3201H3.99999C3.29819%2072.3208%202.60893%2072.5061%202.00143%2072.8575C1.39392%2073.2089%200.88955%2073.7139%200.538962%2074.3218C0.188375%2074.9298%200.00390931%2075.6193%200.00408949%2076.3211C0.00426966%2077.0229%200.189089%2077.7123%200.539989%2078.3201L35.38%20138.66C35.7299%20139.266%2036.2326%20139.77%2036.838%20140.121C37.4434%20140.472%2038.1302%20140.658%2038.83%20140.66H59.48C60.5409%20140.66%2061.5583%20140.239%2062.3084%20139.489C63.0586%20138.738%2063.48%20137.721%2063.48%20136.66V76.3101C63.4773%2075.2509%2063.0547%2074.2361%2062.3049%2073.4881C61.555%2072.7401%2060.5391%2072.3201%2059.48%2072.3201V72.3201Z'%20fill='%230164A8'/%3e%3c/g%3e%3cpath%20d='M207.52%20106.96C202.272%20106.96%20198.368%20105.584%20195.808%20102.832C193.312%20100.08%20192.064%2096.336%20192.064%2091.6V70.48H185.632V60.496H192.064V50.704L205.024%2046.864V60.496H216.544L215.776%2070.48H205.024V90.736C205.024%2093.232%20205.6%2094.96%20206.752%2095.92C207.904%2096.816%20209.696%2097.264%20212.128%2097.264C213.92%2097.264%20215.776%2096.944%20217.696%2096.304V105.232C216.288%20105.808%20214.752%20106.224%20213.088%20106.48C211.424%20106.8%20209.568%20106.96%20207.52%20106.96ZM224.347%20106V60.496H236.347L236.923%2065.2C238.971%2063.92%20241.499%2062.768%20244.507%2061.744C247.579%2060.656%20250.587%2059.92%20253.531%2059.536V69.328C251.803%2069.584%20249.915%2069.968%20247.867%2070.48C245.819%2070.992%20243.867%2071.568%20242.011%2072.208C240.155%2072.848%20238.587%2073.52%20237.307%2074.224V106H224.347ZM281.997%20106.96C274.125%20106.96%20267.885%20105.008%20263.277%20101.104C258.669%2097.136%20256.365%2091.152%20256.365%2083.152C256.365%2075.92%20258.285%2070.192%20262.125%2065.968C266.029%2061.68%20271.821%2059.536%20279.501%2059.536C286.541%2059.536%20291.917%2061.392%20295.629%2065.104C299.405%2068.752%20301.292%2073.552%20301.292%2079.504V87.76H268.365C269.069%2091.408%20270.733%2093.904%20273.357%2095.248C276.045%2096.592%20279.821%2097.264%20284.685%2097.264C287.117%2097.264%20289.581%2097.04%20292.077%2096.592C294.637%2096.144%20296.813%2095.568%20298.605%2094.864V104.08C296.493%20105.04%20294.029%20105.744%20291.213%20106.192C288.397%20106.704%20285.325%20106.96%20281.997%20106.96ZM268.365%2079.792H289.965V77.296C289.965%2074.672%20289.197%2072.624%20287.661%2071.152C286.125%2069.616%20283.533%2068.848%20279.885%2068.848C275.597%2068.848%20272.589%2069.712%20270.861%2071.44C269.197%2073.168%20268.365%2075.952%20268.365%2079.792ZM334.028%20106.96C326.156%20106.96%20319.916%20105.008%20315.308%20101.104C310.7%2097.136%20308.396%2091.152%20308.396%2083.152C308.396%2075.92%20310.316%2070.192%20314.156%2065.968C318.06%2061.68%20323.852%2059.536%20331.532%2059.536C338.572%2059.536%20343.948%2061.392%20347.66%2065.104C351.436%2068.752%20353.324%2073.552%20353.324%2079.504V87.76H320.396C321.1%2091.408%20322.764%2093.904%20325.388%2095.248C328.076%2096.592%20331.852%2097.264%20336.716%2097.264C339.148%2097.264%20341.612%2097.04%20344.108%2096.592C346.668%2096.144%20348.844%2095.568%20350.636%2094.864V104.08C348.524%20105.04%20346.06%20105.744%20343.244%20106.192C340.428%20106.704%20337.356%20106.96%20334.028%20106.96ZM320.396%2079.792H341.996V77.296C341.996%2074.672%20341.228%2072.624%20339.692%2071.152C338.156%2069.616%20335.564%2068.848%20331.916%2068.848C327.628%2068.848%20324.62%2069.712%20322.892%2071.44C321.228%2073.168%20320.396%2075.952%20320.396%2079.792ZM381.547%20122.896C378.155%20122.896%20374.667%20122.672%20371.083%20122.224C367.563%20121.776%20364.587%20121.136%20362.155%20120.304V110.608C364.715%20111.44%20367.723%20112.08%20371.179%20112.528C374.635%20113.04%20377.867%20113.296%20380.875%20113.296C385.291%20113.296%20388.491%20113.04%20390.475%20112.528C392.459%20112.08%20393.451%20111.248%20393.451%20110.032C393.451%20109.008%20393.003%20108.304%20392.107%20107.92C391.275%20107.536%20389.483%20107.344%20386.731%20107.344H374.347C366.219%20107.344%20362.155%20104.336%20362.155%2098.32C362.155%2096.464%20362.667%2094.768%20363.691%2093.232C364.715%2091.696%20366.347%2090.48%20368.587%2089.584C363.403%2086.96%20360.811%2082.544%20360.811%2076.336C360.811%2070.448%20362.635%2066.192%20366.283%2063.568C369.931%2060.88%20375.339%2059.536%20382.507%2059.536C383.979%2059.536%20385.579%2059.664%20387.307%2059.92C389.099%2060.112%20390.443%2060.304%20391.339%2060.496H408.427L408.139%2068.656H400.939C402.923%2070.512%20403.915%2073.104%20403.915%2076.432C403.915%2081.104%20402.443%2084.848%20399.499%2087.664C396.555%2090.416%20392.203%2091.792%20386.443%2091.792C385.419%2091.792%20384.427%2091.76%20383.467%2091.696C382.571%2091.568%20381.643%2091.44%20380.683%2091.312C378.763%2091.568%20377.131%2092.016%20375.787%2092.656C374.507%2093.296%20373.867%2094.16%20373.867%2095.248C373.867%2096.72%20375.179%2097.456%20377.803%2097.456H390.667C395.275%2097.456%20398.827%2098.512%20401.323%20100.624C403.819%20102.672%20405.067%20105.68%20405.067%20109.648C405.067%20114.128%20403.051%20117.456%20399.019%20119.632C394.987%20121.808%20389.163%20122.896%20381.547%20122.896ZM382.603%2084.496C386.443%2084.496%20389.099%2083.856%20390.571%2082.576C392.107%2081.232%20392.875%2078.992%20392.875%2075.856C392.875%2072.72%20392.107%2070.448%20390.571%2069.04C389.099%2067.632%20386.443%2066.928%20382.603%2066.928C378.955%2066.928%20376.331%2067.632%20374.731%2069.04C373.131%2070.384%20372.331%2072.656%20372.331%2075.856C372.331%2078.8%20373.067%2080.976%20374.539%2082.384C376.075%2083.792%20378.763%2084.496%20382.603%2084.496ZM439.028%20106.96C431.156%20106.96%20424.916%20105.008%20420.308%20101.104C415.7%2097.136%20413.396%2091.152%20413.396%2083.152C413.396%2075.92%20415.316%2070.192%20419.156%2065.968C423.06%2061.68%20428.852%2059.536%20436.532%2059.536C443.572%2059.536%20448.948%2061.392%20452.66%2065.104C456.436%2068.752%20458.324%2073.552%20458.324%2079.504V87.76H425.396C426.1%2091.408%20427.764%2093.904%20430.388%2095.248C433.076%2096.592%20436.852%2097.264%20441.716%2097.264C444.148%2097.264%20446.612%2097.04%20449.108%2096.592C451.668%2096.144%20453.844%2095.568%20455.636%2094.864V104.08C453.524%20105.04%20451.06%20105.744%20448.244%20106.192C445.428%20106.704%20442.356%20106.96%20439.028%20106.96ZM425.396%2079.792H446.996V77.296C446.996%2074.672%20446.228%2072.624%20444.692%2071.152C443.156%2069.616%20440.564%2068.848%20436.916%2068.848C432.628%2068.848%20429.62%2069.712%20427.892%2071.44C426.228%2073.168%20425.396%2075.952%20425.396%2079.792Z'%20fill='black'/%3e%3cdefs%3e%3cclipPath%20id='clip0_1809_3434'%3e%3crect%20width='151.93'%20height='136.64'%20fill='white'%20transform='translate(0%204)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", et = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%200%20462%20144'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2_65)'%3e%3cpath%20d='M137%2041.34L116.57%206C116.22%205.39399%20115.717%204.89037%20115.112%204.53942C114.507%204.18847%20113.82%204.00247%20113.12%204H38.83C38.1302%204.00247%2037.4434%204.18847%2036.838%204.53942C36.2326%204.89037%2035.7299%205.39399%2035.38%206L15%2041.34C14.6495%2041.947%2014.4647%2042.6355%2014.4641%2043.3365C14.4635%2044.0374%2014.6471%2044.7262%2014.9965%2045.3339C15.3459%2045.9416%2015.8488%2046.4467%2016.4549%2046.7988C17.061%2047.1509%2017.749%2047.3375%2018.45%2047.34H133.53C134.233%2047.341%20134.923%2047.157%20135.532%2046.8063C136.141%2046.4557%20136.647%2045.9508%20136.999%2045.3426C137.35%2044.7343%20137.536%2044.0441%20137.536%2043.3415C137.536%2042.6388%20137.351%2041.9485%20137%2041.34Z'%20fill='%2311D3B4'/%3e%3cpath%20d='M92.48%20140.64H113.1C113.805%20140.643%20114.498%20140.459%20115.109%20140.108C115.72%20139.757%20116.228%20139.25%20116.58%20138.64L151.39%2078.34C151.741%2077.7315%20151.926%2077.0412%20151.926%2076.3385C151.926%2075.6359%20151.74%2074.9457%20151.389%2074.3374C151.037%2073.7292%20150.531%2073.2243%20149.922%2072.8737C149.313%2072.523%20148.623%2072.339%20147.92%2072.34H92.48C91.4191%2072.34%2090.4017%2072.7614%2089.6516%2073.5116C88.9014%2074.2617%2088.48%2075.2791%2088.48%2076.34V136.64C88.48%20137.701%2088.9014%20138.718%2089.6516%20139.468C90.4017%20140.219%2091.4191%20140.64%2092.48%20140.64Z'%20fill='%23007EF6'/%3e%3cpath%20d='M59.48%2072.32H4C3.2982%2072.3207%202.60894%2072.5061%202.00143%2072.8574C1.39393%2073.2088%200.889558%2073.7138%200.53897%2074.3218C0.188382%2074.9297%200.00391694%2075.6192%200.00409712%2076.321C0.00427729%2077.0228%200.189097%2077.7122%200.539997%2078.32L35.38%20138.66C35.7299%20139.266%2036.2326%20139.77%2036.838%20140.121C37.4434%20140.472%2038.1302%20140.658%2038.83%20140.66H59.48C60.5409%20140.66%2061.5583%20140.239%2062.3084%20139.488C63.0586%20138.738%2063.48%20137.721%2063.48%20136.66V76.31C63.4773%2075.2509%2063.0548%2074.236%2062.3049%2073.488C61.555%2072.7401%2060.5391%2072.32%2059.48%2072.32Z'%20fill='%230164A8'/%3e%3c/g%3e%3cpath%20d='M207.52%20106.96C202.272%20106.96%20198.368%20105.584%20195.808%20102.832C193.312%20100.08%20192.064%2096.336%20192.064%2091.6V70.48H185.632V60.496H192.064V50.704L205.024%2046.864V60.496H216.544L215.776%2070.48H205.024V90.736C205.024%2093.232%20205.6%2094.96%20206.752%2095.92C207.904%2096.816%20209.696%2097.264%20212.128%2097.264C213.92%2097.264%20215.776%2096.944%20217.696%2096.304V105.232C216.288%20105.808%20214.752%20106.224%20213.088%20106.48C211.424%20106.8%20209.568%20106.96%20207.52%20106.96ZM224.347%20106V60.496H236.347L236.923%2065.2C238.971%2063.92%20241.499%2062.768%20244.507%2061.744C247.579%2060.656%20250.587%2059.92%20253.531%2059.536V69.328C251.803%2069.584%20249.915%2069.968%20247.867%2070.48C245.819%2070.992%20243.867%2071.568%20242.011%2072.208C240.155%2072.848%20238.587%2073.52%20237.307%2074.224V106H224.347ZM281.997%20106.96C274.125%20106.96%20267.885%20105.008%20263.277%20101.104C258.669%2097.136%20256.365%2091.152%20256.365%2083.152C256.365%2075.92%20258.285%2070.192%20262.125%2065.968C266.029%2061.68%20271.821%2059.536%20279.501%2059.536C286.541%2059.536%20291.917%2061.392%20295.629%2065.104C299.405%2068.752%20301.292%2073.552%20301.292%2079.504V87.76H268.365C269.069%2091.408%20270.733%2093.904%20273.357%2095.248C276.045%2096.592%20279.821%2097.264%20284.685%2097.264C287.117%2097.264%20289.581%2097.04%20292.077%2096.592C294.637%2096.144%20296.813%2095.568%20298.605%2094.864V104.08C296.493%20105.04%20294.029%20105.744%20291.213%20106.192C288.397%20106.704%20285.325%20106.96%20281.997%20106.96ZM268.365%2079.792H289.965V77.296C289.965%2074.672%20289.197%2072.624%20287.661%2071.152C286.125%2069.616%20283.533%2068.848%20279.885%2068.848C275.597%2068.848%20272.589%2069.712%20270.861%2071.44C269.197%2073.168%20268.365%2075.952%20268.365%2079.792ZM334.028%20106.96C326.156%20106.96%20319.916%20105.008%20315.308%20101.104C310.7%2097.136%20308.396%2091.152%20308.396%2083.152C308.396%2075.92%20310.316%2070.192%20314.156%2065.968C318.06%2061.68%20323.852%2059.536%20331.532%2059.536C338.572%2059.536%20343.948%2061.392%20347.66%2065.104C351.436%2068.752%20353.324%2073.552%20353.324%2079.504V87.76H320.396C321.1%2091.408%20322.764%2093.904%20325.388%2095.248C328.076%2096.592%20331.852%2097.264%20336.716%2097.264C339.148%2097.264%20341.612%2097.04%20344.108%2096.592C346.668%2096.144%20348.844%2095.568%20350.636%2094.864V104.08C348.524%20105.04%20346.06%20105.744%20343.244%20106.192C340.428%20106.704%20337.356%20106.96%20334.028%20106.96ZM320.396%2079.792H341.996V77.296C341.996%2074.672%20341.228%2072.624%20339.692%2071.152C338.156%2069.616%20335.564%2068.848%20331.916%2068.848C327.628%2068.848%20324.62%2069.712%20322.892%2071.44C321.228%2073.168%20320.396%2075.952%20320.396%2079.792ZM381.547%20122.896C378.155%20122.896%20374.667%20122.672%20371.083%20122.224C367.563%20121.776%20364.587%20121.136%20362.155%20120.304V110.608C364.715%20111.44%20367.723%20112.08%20371.179%20112.528C374.635%20113.04%20377.867%20113.296%20380.875%20113.296C385.291%20113.296%20388.491%20113.04%20390.475%20112.528C392.459%20112.08%20393.451%20111.248%20393.451%20110.032C393.451%20109.008%20393.003%20108.304%20392.107%20107.92C391.275%20107.536%20389.483%20107.344%20386.731%20107.344H374.347C366.219%20107.344%20362.155%20104.336%20362.155%2098.32C362.155%2096.464%20362.667%2094.768%20363.691%2093.232C364.715%2091.696%20366.347%2090.48%20368.587%2089.584C363.403%2086.96%20360.811%2082.544%20360.811%2076.336C360.811%2070.448%20362.635%2066.192%20366.283%2063.568C369.931%2060.88%20375.339%2059.536%20382.507%2059.536C383.979%2059.536%20385.579%2059.664%20387.307%2059.92C389.099%2060.112%20390.443%2060.304%20391.339%2060.496H408.427L408.139%2068.656H400.939C402.923%2070.512%20403.915%2073.104%20403.915%2076.432C403.915%2081.104%20402.443%2084.848%20399.499%2087.664C396.555%2090.416%20392.203%2091.792%20386.443%2091.792C385.419%2091.792%20384.427%2091.76%20383.467%2091.696C382.571%2091.568%20381.643%2091.44%20380.683%2091.312C378.763%2091.568%20377.131%2092.016%20375.787%2092.656C374.507%2093.296%20373.867%2094.16%20373.867%2095.248C373.867%2096.72%20375.179%2097.456%20377.803%2097.456H390.667C395.275%2097.456%20398.827%2098.512%20401.323%20100.624C403.819%20102.672%20405.067%20105.68%20405.067%20109.648C405.067%20114.128%20403.051%20117.456%20399.019%20119.632C394.987%20121.808%20389.163%20122.896%20381.547%20122.896ZM382.603%2084.496C386.443%2084.496%20389.099%2083.856%20390.571%2082.576C392.107%2081.232%20392.875%2078.992%20392.875%2075.856C392.875%2072.72%20392.107%2070.448%20390.571%2069.04C389.099%2067.632%20386.443%2066.928%20382.603%2066.928C378.955%2066.928%20376.331%2067.632%20374.731%2069.04C373.131%2070.384%20372.331%2072.656%20372.331%2075.856C372.331%2078.8%20373.067%2080.976%20374.539%2082.384C376.075%2083.792%20378.763%2084.496%20382.603%2084.496ZM439.028%20106.96C431.156%20106.96%20424.916%20105.008%20420.308%20101.104C415.7%2097.136%20413.396%2091.152%20413.396%2083.152C413.396%2075.92%20415.316%2070.192%20419.156%2065.968C423.06%2061.68%20428.852%2059.536%20436.532%2059.536C443.572%2059.536%20448.948%2061.392%20452.66%2065.104C456.436%2068.752%20458.324%2073.552%20458.324%2079.504V87.76H425.396C426.1%2091.408%20427.764%2093.904%20430.388%2095.248C433.076%2096.592%20436.852%2097.264%20441.716%2097.264C444.148%2097.264%20446.612%2097.04%20449.108%2096.592C451.668%2096.144%20453.844%2095.568%20455.636%2094.864V104.08C453.524%20105.04%20451.06%20105.744%20448.244%20106.192C445.428%20106.704%20442.356%20106.96%20439.028%20106.96ZM425.396%2079.792H446.996V77.296C446.996%2074.672%20446.228%2072.624%20444.692%2071.152C443.156%2069.616%20440.564%2068.848%20436.916%2068.848C432.628%2068.848%20429.62%2069.712%20427.892%2071.44C426.228%2073.168%20425.396%2075.952%20425.396%2079.792Z'%20fill='white'/%3e%3cdefs%3e%3cclipPath%20id='clip0_2_65'%3e%3crect%20width='151.93'%20height='136.64'%20fill='white'%20transform='translate(0%204)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", q = r(), tt = ({ theme: e = "dark" }) => /* @__PURE__ */ (0, q.jsx)("div", {
|
|
17
|
+
var st = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%200%20462%20144'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1809_3434)'%3e%3cpath%20d='M137%2041.34L116.57%206C116.22%205.39399%20115.717%204.89037%20115.112%204.53942C114.507%204.18847%20113.82%204.00247%20113.12%204H38.83C38.1303%204.00247%2037.4434%204.18847%2036.838%204.53942C36.2326%204.89037%2035.7299%205.39399%2035.38%206L15%2041.34C14.6495%2041.947%2014.4647%2042.6355%2014.4641%2043.3365C14.4635%2044.0374%2014.6471%2044.7262%2014.9965%2045.3339C15.3459%2045.9416%2015.8488%2046.4467%2016.455%2046.7988C17.0611%2047.1509%2017.7491%2047.3375%2018.45%2047.34H133.53C134.233%2047.341%20134.923%2047.157%20135.532%2046.8063C136.141%2046.4557%20136.647%2045.9508%20136.999%2045.3426C137.35%2044.7343%20137.536%2044.0441%20137.536%2043.3415C137.536%2042.6388%20137.351%2041.9485%20137%2041.34V41.34Z'%20fill='%2311D3B4'/%3e%3cpath%20d='M92.48%20140.64H113.1C113.805%20140.643%20114.498%20140.459%20115.109%20140.108C115.72%20139.757%20116.228%20139.251%20116.58%20138.64L151.39%2078.3401C151.741%2077.7316%20151.926%2077.0413%20151.926%2076.3386C151.926%2075.636%20151.74%2074.9458%20151.389%2074.3375C151.037%2073.7293%20150.531%2073.2244%20149.922%2072.8738C149.313%2072.5231%20148.623%2072.3391%20147.92%2072.3401H92.48C91.4191%2072.3401%2090.4017%2072.7615%2089.6516%2073.5117C88.9014%2074.2618%2088.48%2075.2792%2088.48%2076.3401V136.64C88.48%20137.701%2088.9014%20138.718%2089.6516%20139.469C90.4017%20140.219%2091.4191%20140.64%2092.48%20140.64Z'%20fill='%23007EF6'/%3e%3cpath%20d='M59.48%2072.3201H3.99999C3.29819%2072.3208%202.60893%2072.5061%202.00143%2072.8575C1.39392%2073.2089%200.88955%2073.7139%200.538962%2074.3218C0.188375%2074.9298%200.00390931%2075.6193%200.00408949%2076.3211C0.00426966%2077.0229%200.189089%2077.7123%200.539989%2078.3201L35.38%20138.66C35.7299%20139.266%2036.2326%20139.77%2036.838%20140.121C37.4434%20140.472%2038.1302%20140.658%2038.83%20140.66H59.48C60.5409%20140.66%2061.5583%20140.239%2062.3084%20139.489C63.0586%20138.738%2063.48%20137.721%2063.48%20136.66V76.3101C63.4773%2075.2509%2063.0547%2074.2361%2062.3049%2073.4881C61.555%2072.7401%2060.5391%2072.3201%2059.48%2072.3201V72.3201Z'%20fill='%230164A8'/%3e%3c/g%3e%3cpath%20d='M207.52%20106.96C202.272%20106.96%20198.368%20105.584%20195.808%20102.832C193.312%20100.08%20192.064%2096.336%20192.064%2091.6V70.48H185.632V60.496H192.064V50.704L205.024%2046.864V60.496H216.544L215.776%2070.48H205.024V90.736C205.024%2093.232%20205.6%2094.96%20206.752%2095.92C207.904%2096.816%20209.696%2097.264%20212.128%2097.264C213.92%2097.264%20215.776%2096.944%20217.696%2096.304V105.232C216.288%20105.808%20214.752%20106.224%20213.088%20106.48C211.424%20106.8%20209.568%20106.96%20207.52%20106.96ZM224.347%20106V60.496H236.347L236.923%2065.2C238.971%2063.92%20241.499%2062.768%20244.507%2061.744C247.579%2060.656%20250.587%2059.92%20253.531%2059.536V69.328C251.803%2069.584%20249.915%2069.968%20247.867%2070.48C245.819%2070.992%20243.867%2071.568%20242.011%2072.208C240.155%2072.848%20238.587%2073.52%20237.307%2074.224V106H224.347ZM281.997%20106.96C274.125%20106.96%20267.885%20105.008%20263.277%20101.104C258.669%2097.136%20256.365%2091.152%20256.365%2083.152C256.365%2075.92%20258.285%2070.192%20262.125%2065.968C266.029%2061.68%20271.821%2059.536%20279.501%2059.536C286.541%2059.536%20291.917%2061.392%20295.629%2065.104C299.405%2068.752%20301.292%2073.552%20301.292%2079.504V87.76H268.365C269.069%2091.408%20270.733%2093.904%20273.357%2095.248C276.045%2096.592%20279.821%2097.264%20284.685%2097.264C287.117%2097.264%20289.581%2097.04%20292.077%2096.592C294.637%2096.144%20296.813%2095.568%20298.605%2094.864V104.08C296.493%20105.04%20294.029%20105.744%20291.213%20106.192C288.397%20106.704%20285.325%20106.96%20281.997%20106.96ZM268.365%2079.792H289.965V77.296C289.965%2074.672%20289.197%2072.624%20287.661%2071.152C286.125%2069.616%20283.533%2068.848%20279.885%2068.848C275.597%2068.848%20272.589%2069.712%20270.861%2071.44C269.197%2073.168%20268.365%2075.952%20268.365%2079.792ZM334.028%20106.96C326.156%20106.96%20319.916%20105.008%20315.308%20101.104C310.7%2097.136%20308.396%2091.152%20308.396%2083.152C308.396%2075.92%20310.316%2070.192%20314.156%2065.968C318.06%2061.68%20323.852%2059.536%20331.532%2059.536C338.572%2059.536%20343.948%2061.392%20347.66%2065.104C351.436%2068.752%20353.324%2073.552%20353.324%2079.504V87.76H320.396C321.1%2091.408%20322.764%2093.904%20325.388%2095.248C328.076%2096.592%20331.852%2097.264%20336.716%2097.264C339.148%2097.264%20341.612%2097.04%20344.108%2096.592C346.668%2096.144%20348.844%2095.568%20350.636%2094.864V104.08C348.524%20105.04%20346.06%20105.744%20343.244%20106.192C340.428%20106.704%20337.356%20106.96%20334.028%20106.96ZM320.396%2079.792H341.996V77.296C341.996%2074.672%20341.228%2072.624%20339.692%2071.152C338.156%2069.616%20335.564%2068.848%20331.916%2068.848C327.628%2068.848%20324.62%2069.712%20322.892%2071.44C321.228%2073.168%20320.396%2075.952%20320.396%2079.792ZM381.547%20122.896C378.155%20122.896%20374.667%20122.672%20371.083%20122.224C367.563%20121.776%20364.587%20121.136%20362.155%20120.304V110.608C364.715%20111.44%20367.723%20112.08%20371.179%20112.528C374.635%20113.04%20377.867%20113.296%20380.875%20113.296C385.291%20113.296%20388.491%20113.04%20390.475%20112.528C392.459%20112.08%20393.451%20111.248%20393.451%20110.032C393.451%20109.008%20393.003%20108.304%20392.107%20107.92C391.275%20107.536%20389.483%20107.344%20386.731%20107.344H374.347C366.219%20107.344%20362.155%20104.336%20362.155%2098.32C362.155%2096.464%20362.667%2094.768%20363.691%2093.232C364.715%2091.696%20366.347%2090.48%20368.587%2089.584C363.403%2086.96%20360.811%2082.544%20360.811%2076.336C360.811%2070.448%20362.635%2066.192%20366.283%2063.568C369.931%2060.88%20375.339%2059.536%20382.507%2059.536C383.979%2059.536%20385.579%2059.664%20387.307%2059.92C389.099%2060.112%20390.443%2060.304%20391.339%2060.496H408.427L408.139%2068.656H400.939C402.923%2070.512%20403.915%2073.104%20403.915%2076.432C403.915%2081.104%20402.443%2084.848%20399.499%2087.664C396.555%2090.416%20392.203%2091.792%20386.443%2091.792C385.419%2091.792%20384.427%2091.76%20383.467%2091.696C382.571%2091.568%20381.643%2091.44%20380.683%2091.312C378.763%2091.568%20377.131%2092.016%20375.787%2092.656C374.507%2093.296%20373.867%2094.16%20373.867%2095.248C373.867%2096.72%20375.179%2097.456%20377.803%2097.456H390.667C395.275%2097.456%20398.827%2098.512%20401.323%20100.624C403.819%20102.672%20405.067%20105.68%20405.067%20109.648C405.067%20114.128%20403.051%20117.456%20399.019%20119.632C394.987%20121.808%20389.163%20122.896%20381.547%20122.896ZM382.603%2084.496C386.443%2084.496%20389.099%2083.856%20390.571%2082.576C392.107%2081.232%20392.875%2078.992%20392.875%2075.856C392.875%2072.72%20392.107%2070.448%20390.571%2069.04C389.099%2067.632%20386.443%2066.928%20382.603%2066.928C378.955%2066.928%20376.331%2067.632%20374.731%2069.04C373.131%2070.384%20372.331%2072.656%20372.331%2075.856C372.331%2078.8%20373.067%2080.976%20374.539%2082.384C376.075%2083.792%20378.763%2084.496%20382.603%2084.496ZM439.028%20106.96C431.156%20106.96%20424.916%20105.008%20420.308%20101.104C415.7%2097.136%20413.396%2091.152%20413.396%2083.152C413.396%2075.92%20415.316%2070.192%20419.156%2065.968C423.06%2061.68%20428.852%2059.536%20436.532%2059.536C443.572%2059.536%20448.948%2061.392%20452.66%2065.104C456.436%2068.752%20458.324%2073.552%20458.324%2079.504V87.76H425.396C426.1%2091.408%20427.764%2093.904%20430.388%2095.248C433.076%2096.592%20436.852%2097.264%20441.716%2097.264C444.148%2097.264%20446.612%2097.04%20449.108%2096.592C451.668%2096.144%20453.844%2095.568%20455.636%2094.864V104.08C453.524%20105.04%20451.06%20105.744%20448.244%20106.192C445.428%20106.704%20442.356%20106.96%20439.028%20106.96ZM425.396%2079.792H446.996V77.296C446.996%2074.672%20446.228%2072.624%20444.692%2071.152C443.156%2069.616%20440.564%2068.848%20436.916%2068.848C432.628%2068.848%20429.62%2069.712%20427.892%2071.44C426.228%2073.168%20425.396%2075.952%20425.396%2079.792Z'%20fill='black'/%3e%3cdefs%3e%3cclipPath%20id='clip0_1809_3434'%3e%3crect%20width='151.93'%20height='136.64'%20fill='white'%20transform='translate(0%204)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", ct = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%200%20462%20144'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2_65)'%3e%3cpath%20d='M137%2041.34L116.57%206C116.22%205.39399%20115.717%204.89037%20115.112%204.53942C114.507%204.18847%20113.82%204.00247%20113.12%204H38.83C38.1302%204.00247%2037.4434%204.18847%2036.838%204.53942C36.2326%204.89037%2035.7299%205.39399%2035.38%206L15%2041.34C14.6495%2041.947%2014.4647%2042.6355%2014.4641%2043.3365C14.4635%2044.0374%2014.6471%2044.7262%2014.9965%2045.3339C15.3459%2045.9416%2015.8488%2046.4467%2016.4549%2046.7988C17.061%2047.1509%2017.749%2047.3375%2018.45%2047.34H133.53C134.233%2047.341%20134.923%2047.157%20135.532%2046.8063C136.141%2046.4557%20136.647%2045.9508%20136.999%2045.3426C137.35%2044.7343%20137.536%2044.0441%20137.536%2043.3415C137.536%2042.6388%20137.351%2041.9485%20137%2041.34Z'%20fill='%2311D3B4'/%3e%3cpath%20d='M92.48%20140.64H113.1C113.805%20140.643%20114.498%20140.459%20115.109%20140.108C115.72%20139.757%20116.228%20139.25%20116.58%20138.64L151.39%2078.34C151.741%2077.7315%20151.926%2077.0412%20151.926%2076.3385C151.926%2075.6359%20151.74%2074.9457%20151.389%2074.3374C151.037%2073.7292%20150.531%2073.2243%20149.922%2072.8737C149.313%2072.523%20148.623%2072.339%20147.92%2072.34H92.48C91.4191%2072.34%2090.4017%2072.7614%2089.6516%2073.5116C88.9014%2074.2617%2088.48%2075.2791%2088.48%2076.34V136.64C88.48%20137.701%2088.9014%20138.718%2089.6516%20139.468C90.4017%20140.219%2091.4191%20140.64%2092.48%20140.64Z'%20fill='%23007EF6'/%3e%3cpath%20d='M59.48%2072.32H4C3.2982%2072.3207%202.60894%2072.5061%202.00143%2072.8574C1.39393%2073.2088%200.889558%2073.7138%200.53897%2074.3218C0.188382%2074.9297%200.00391694%2075.6192%200.00409712%2076.321C0.00427729%2077.0228%200.189097%2077.7122%200.539997%2078.32L35.38%20138.66C35.7299%20139.266%2036.2326%20139.77%2036.838%20140.121C37.4434%20140.472%2038.1302%20140.658%2038.83%20140.66H59.48C60.5409%20140.66%2061.5583%20140.239%2062.3084%20139.488C63.0586%20138.738%2063.48%20137.721%2063.48%20136.66V76.31C63.4773%2075.2509%2063.0548%2074.236%2062.3049%2073.488C61.555%2072.7401%2060.5391%2072.32%2059.48%2072.32Z'%20fill='%230164A8'/%3e%3c/g%3e%3cpath%20d='M207.52%20106.96C202.272%20106.96%20198.368%20105.584%20195.808%20102.832C193.312%20100.08%20192.064%2096.336%20192.064%2091.6V70.48H185.632V60.496H192.064V50.704L205.024%2046.864V60.496H216.544L215.776%2070.48H205.024V90.736C205.024%2093.232%20205.6%2094.96%20206.752%2095.92C207.904%2096.816%20209.696%2097.264%20212.128%2097.264C213.92%2097.264%20215.776%2096.944%20217.696%2096.304V105.232C216.288%20105.808%20214.752%20106.224%20213.088%20106.48C211.424%20106.8%20209.568%20106.96%20207.52%20106.96ZM224.347%20106V60.496H236.347L236.923%2065.2C238.971%2063.92%20241.499%2062.768%20244.507%2061.744C247.579%2060.656%20250.587%2059.92%20253.531%2059.536V69.328C251.803%2069.584%20249.915%2069.968%20247.867%2070.48C245.819%2070.992%20243.867%2071.568%20242.011%2072.208C240.155%2072.848%20238.587%2073.52%20237.307%2074.224V106H224.347ZM281.997%20106.96C274.125%20106.96%20267.885%20105.008%20263.277%20101.104C258.669%2097.136%20256.365%2091.152%20256.365%2083.152C256.365%2075.92%20258.285%2070.192%20262.125%2065.968C266.029%2061.68%20271.821%2059.536%20279.501%2059.536C286.541%2059.536%20291.917%2061.392%20295.629%2065.104C299.405%2068.752%20301.292%2073.552%20301.292%2079.504V87.76H268.365C269.069%2091.408%20270.733%2093.904%20273.357%2095.248C276.045%2096.592%20279.821%2097.264%20284.685%2097.264C287.117%2097.264%20289.581%2097.04%20292.077%2096.592C294.637%2096.144%20296.813%2095.568%20298.605%2094.864V104.08C296.493%20105.04%20294.029%20105.744%20291.213%20106.192C288.397%20106.704%20285.325%20106.96%20281.997%20106.96ZM268.365%2079.792H289.965V77.296C289.965%2074.672%20289.197%2072.624%20287.661%2071.152C286.125%2069.616%20283.533%2068.848%20279.885%2068.848C275.597%2068.848%20272.589%2069.712%20270.861%2071.44C269.197%2073.168%20268.365%2075.952%20268.365%2079.792ZM334.028%20106.96C326.156%20106.96%20319.916%20105.008%20315.308%20101.104C310.7%2097.136%20308.396%2091.152%20308.396%2083.152C308.396%2075.92%20310.316%2070.192%20314.156%2065.968C318.06%2061.68%20323.852%2059.536%20331.532%2059.536C338.572%2059.536%20343.948%2061.392%20347.66%2065.104C351.436%2068.752%20353.324%2073.552%20353.324%2079.504V87.76H320.396C321.1%2091.408%20322.764%2093.904%20325.388%2095.248C328.076%2096.592%20331.852%2097.264%20336.716%2097.264C339.148%2097.264%20341.612%2097.04%20344.108%2096.592C346.668%2096.144%20348.844%2095.568%20350.636%2094.864V104.08C348.524%20105.04%20346.06%20105.744%20343.244%20106.192C340.428%20106.704%20337.356%20106.96%20334.028%20106.96ZM320.396%2079.792H341.996V77.296C341.996%2074.672%20341.228%2072.624%20339.692%2071.152C338.156%2069.616%20335.564%2068.848%20331.916%2068.848C327.628%2068.848%20324.62%2069.712%20322.892%2071.44C321.228%2073.168%20320.396%2075.952%20320.396%2079.792ZM381.547%20122.896C378.155%20122.896%20374.667%20122.672%20371.083%20122.224C367.563%20121.776%20364.587%20121.136%20362.155%20120.304V110.608C364.715%20111.44%20367.723%20112.08%20371.179%20112.528C374.635%20113.04%20377.867%20113.296%20380.875%20113.296C385.291%20113.296%20388.491%20113.04%20390.475%20112.528C392.459%20112.08%20393.451%20111.248%20393.451%20110.032C393.451%20109.008%20393.003%20108.304%20392.107%20107.92C391.275%20107.536%20389.483%20107.344%20386.731%20107.344H374.347C366.219%20107.344%20362.155%20104.336%20362.155%2098.32C362.155%2096.464%20362.667%2094.768%20363.691%2093.232C364.715%2091.696%20366.347%2090.48%20368.587%2089.584C363.403%2086.96%20360.811%2082.544%20360.811%2076.336C360.811%2070.448%20362.635%2066.192%20366.283%2063.568C369.931%2060.88%20375.339%2059.536%20382.507%2059.536C383.979%2059.536%20385.579%2059.664%20387.307%2059.92C389.099%2060.112%20390.443%2060.304%20391.339%2060.496H408.427L408.139%2068.656H400.939C402.923%2070.512%20403.915%2073.104%20403.915%2076.432C403.915%2081.104%20402.443%2084.848%20399.499%2087.664C396.555%2090.416%20392.203%2091.792%20386.443%2091.792C385.419%2091.792%20384.427%2091.76%20383.467%2091.696C382.571%2091.568%20381.643%2091.44%20380.683%2091.312C378.763%2091.568%20377.131%2092.016%20375.787%2092.656C374.507%2093.296%20373.867%2094.16%20373.867%2095.248C373.867%2096.72%20375.179%2097.456%20377.803%2097.456H390.667C395.275%2097.456%20398.827%2098.512%20401.323%20100.624C403.819%20102.672%20405.067%20105.68%20405.067%20109.648C405.067%20114.128%20403.051%20117.456%20399.019%20119.632C394.987%20121.808%20389.163%20122.896%20381.547%20122.896ZM382.603%2084.496C386.443%2084.496%20389.099%2083.856%20390.571%2082.576C392.107%2081.232%20392.875%2078.992%20392.875%2075.856C392.875%2072.72%20392.107%2070.448%20390.571%2069.04C389.099%2067.632%20386.443%2066.928%20382.603%2066.928C378.955%2066.928%20376.331%2067.632%20374.731%2069.04C373.131%2070.384%20372.331%2072.656%20372.331%2075.856C372.331%2078.8%20373.067%2080.976%20374.539%2082.384C376.075%2083.792%20378.763%2084.496%20382.603%2084.496ZM439.028%20106.96C431.156%20106.96%20424.916%20105.008%20420.308%20101.104C415.7%2097.136%20413.396%2091.152%20413.396%2083.152C413.396%2075.92%20415.316%2070.192%20419.156%2065.968C423.06%2061.68%20428.852%2059.536%20436.532%2059.536C443.572%2059.536%20448.948%2061.392%20452.66%2065.104C456.436%2068.752%20458.324%2073.552%20458.324%2079.504V87.76H425.396C426.1%2091.408%20427.764%2093.904%20430.388%2095.248C433.076%2096.592%20436.852%2097.264%20441.716%2097.264C444.148%2097.264%20446.612%2097.04%20449.108%2096.592C451.668%2096.144%20453.844%2095.568%20455.636%2094.864V104.08C453.524%20105.04%20451.06%20105.744%20448.244%20106.192C445.428%20106.704%20442.356%20106.96%20439.028%20106.96ZM425.396%2079.792H446.996V77.296C446.996%2074.672%20446.228%2072.624%20444.692%2071.152C443.156%2069.616%20440.564%2068.848%20436.916%2068.848C432.628%2068.848%20429.62%2069.712%20427.892%2071.44C426.228%2073.168%20425.396%2075.952%20425.396%2079.792Z'%20fill='white'/%3e%3cdefs%3e%3cclipPath%20id='clip0_2_65'%3e%3crect%20width='151.93'%20height='136.64'%20fill='white'%20transform='translate(0%204)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", W = r(), lt = ({ theme: e = "dark" }) => /* @__PURE__ */ (0, W.jsx)("div", {
|
|
18
18
|
className: "absolute top-5 left-5 z-50 select-none",
|
|
19
|
-
children: /* @__PURE__ */ (0,
|
|
20
|
-
src: e === "dark" ?
|
|
19
|
+
children: /* @__PURE__ */ (0, W.jsx)("img", {
|
|
20
|
+
src: e === "dark" ? ct : st,
|
|
21
21
|
alt: "Treege",
|
|
22
22
|
className: "relative h-14 w-auto drop-shadow-[0_0px_35px] drop-shadow-blue-600"
|
|
23
23
|
})
|
|
24
|
-
}),
|
|
25
|
-
let t =
|
|
26
|
-
return
|
|
24
|
+
}), ut = (e) => {
|
|
25
|
+
let t = Te(), n = we();
|
|
26
|
+
return P(() => {
|
|
27
27
|
if (!e) return [];
|
|
28
28
|
let r = (e, t = /* @__PURE__ */ new Set()) => {
|
|
29
29
|
if (t.has(e)) return [];
|
|
@@ -44,53 +44,61 @@ var $e = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%20
|
|
|
44
44
|
t,
|
|
45
45
|
n
|
|
46
46
|
]);
|
|
47
|
-
},
|
|
48
|
-
let [n, r] =
|
|
47
|
+
}, dt = De(null), ft = ({ children: e, value: t }) => {
|
|
48
|
+
let [n, r] = F(t?.flowId), [i, a] = F(!1), o = P(() => ({
|
|
49
49
|
...t,
|
|
50
50
|
...t?.aiConfig && { aiConfig: {
|
|
51
51
|
...t.aiConfig,
|
|
52
52
|
provider: t?.aiConfig.provider ?? "gemini"
|
|
53
53
|
} },
|
|
54
54
|
flowId: n,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
isNodeSheetOpen: i,
|
|
56
|
+
setFlowId: r,
|
|
57
|
+
setIsNodeSheetOpen: a
|
|
58
|
+
}), [
|
|
59
|
+
n,
|
|
60
|
+
t,
|
|
61
|
+
i
|
|
62
|
+
]);
|
|
63
|
+
return /* @__PURE__ */ (0, W.jsx)(dt.Provider, {
|
|
64
|
+
value: o,
|
|
59
65
|
children: e
|
|
60
66
|
});
|
|
61
|
-
},
|
|
67
|
+
}, pt = () => ke(dt) ?? {
|
|
62
68
|
flowId: void 0,
|
|
69
|
+
isNodeSheetOpen: !1,
|
|
63
70
|
language: "en",
|
|
64
|
-
setFlowId: () => {}
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
setFlowId: () => {},
|
|
72
|
+
setIsNodeSheetOpen: () => {}
|
|
73
|
+
}, G = (t) => {
|
|
74
|
+
let n = pt();
|
|
67
75
|
return e(t ?? n.language);
|
|
68
76
|
};
|
|
69
77
|
//#endregion
|
|
70
78
|
//#region src/shared/components/ui/scroll-area.tsx
|
|
71
|
-
function
|
|
72
|
-
return /* @__PURE__ */ (0,
|
|
79
|
+
function mt({ className: e, children: t, ...n }) {
|
|
80
|
+
return /* @__PURE__ */ (0, W.jsxs)(rt.Root, {
|
|
73
81
|
"data-slot": "scroll-area",
|
|
74
82
|
className: f("relative", e),
|
|
75
83
|
...n,
|
|
76
84
|
children: [
|
|
77
|
-
/* @__PURE__ */ (0,
|
|
85
|
+
/* @__PURE__ */ (0, W.jsx)(rt.Viewport, {
|
|
78
86
|
"data-slot": "scroll-area-viewport",
|
|
79
87
|
className: "size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
80
88
|
children: t
|
|
81
89
|
}),
|
|
82
|
-
/* @__PURE__ */ (0,
|
|
83
|
-
/* @__PURE__ */ (0,
|
|
90
|
+
/* @__PURE__ */ (0, W.jsx)(ht, {}),
|
|
91
|
+
/* @__PURE__ */ (0, W.jsx)(rt.Corner, {})
|
|
84
92
|
]
|
|
85
93
|
});
|
|
86
94
|
}
|
|
87
|
-
function
|
|
88
|
-
return /* @__PURE__ */ (0,
|
|
95
|
+
function ht({ className: e, orientation: t = "vertical", ...n }) {
|
|
96
|
+
return /* @__PURE__ */ (0, W.jsx)(rt.ScrollAreaScrollbar, {
|
|
89
97
|
"data-slot": "scroll-area-scrollbar",
|
|
90
98
|
orientation: t,
|
|
91
99
|
className: f("flex touch-none select-none p-px transition-colors", t === "vertical" && "h-full w-2.5 border-l border-l-transparent", t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", e),
|
|
92
100
|
...n,
|
|
93
|
-
children: /* @__PURE__ */ (0,
|
|
101
|
+
children: /* @__PURE__ */ (0, W.jsx)(rt.ScrollAreaThumb, {
|
|
94
102
|
"data-slot": "scroll-area-thumb",
|
|
95
103
|
className: "relative flex-1 rounded-full bg-border"
|
|
96
104
|
})
|
|
@@ -98,16 +106,16 @@ function st({ className: e, orientation: t = "vertical", ...n }) {
|
|
|
98
106
|
}
|
|
99
107
|
//#endregion
|
|
100
108
|
//#region src/editor/constants/edgeTypes.ts
|
|
101
|
-
var
|
|
102
|
-
conditional:
|
|
103
|
-
let [S, C, ee] =
|
|
109
|
+
var gt = {
|
|
110
|
+
conditional: Oe(({ id: e, target: t, sourceX: n, sourceY: r, targetX: a, targetY: o, sourcePosition: s, targetPosition: c, markerEnd: f, style: g, data: b }) => {
|
|
111
|
+
let [S, C, ee] = Ce({
|
|
104
112
|
sourcePosition: s,
|
|
105
113
|
sourceX: n,
|
|
106
114
|
sourceY: r,
|
|
107
115
|
targetPosition: c,
|
|
108
116
|
targetX: a,
|
|
109
117
|
targetY: o
|
|
110
|
-
}), [te, w] =
|
|
118
|
+
}), [te, w] = F(!1), { updateEdgeData: ne } = Ee(), D = ut(t), O = b?.conditions && b.conditions.length > 0, k = G(), { handleSubmit: re, reset: ie, Field: A } = I({
|
|
111
119
|
defaultValues: {
|
|
112
120
|
conditions: b?.conditions || [{
|
|
113
121
|
field: D[0]?.nodeId ?? "",
|
|
@@ -147,7 +155,7 @@ var ct = {
|
|
|
147
155
|
let t = e.filter((e) => e.logicalOperator === i.AND).length, n = e.filter((e) => e.logicalOperator === i.OR).length;
|
|
148
156
|
return t > 0 && n === 0 ? `${e.length} ${k("editor.conditionalEdge.conditionsAnd")}` : n > 0 && t === 0 ? `${e.length} ${k("editor.conditionalEdge.conditionsOr")}` : `${e.length} ${k("editor.conditionalEdge.conditionsMixed")}`;
|
|
149
157
|
}, le = () => b?.isFallback ? "var(--color-chart-4)" : O ? "var(--color-chart-2)" : "var(--color-chart-3)";
|
|
150
|
-
return /* @__PURE__ */ (0,
|
|
158
|
+
return /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [/* @__PURE__ */ (0, W.jsx)(fe, {
|
|
151
159
|
path: S,
|
|
152
160
|
markerEnd: f,
|
|
153
161
|
style: {
|
|
@@ -156,121 +164,121 @@ var ct = {
|
|
|
156
164
|
strokeDasharray: b?.isFallback ? "5,5" : void 0,
|
|
157
165
|
strokeWidth: O || b?.isFallback ? 2 : g?.strokeWidth
|
|
158
166
|
}
|
|
159
|
-
}), /* @__PURE__ */ (0,
|
|
167
|
+
}), /* @__PURE__ */ (0, W.jsx)(me, { children: /* @__PURE__ */ (0, W.jsx)("div", {
|
|
160
168
|
className: "nodrag nopan absolute",
|
|
161
169
|
style: {
|
|
162
170
|
pointerEvents: "all",
|
|
163
171
|
transform: `translate(-50%, -50%) translate(${C}px,${ee}px)`
|
|
164
172
|
},
|
|
165
|
-
children: /* @__PURE__ */ (0,
|
|
173
|
+
children: /* @__PURE__ */ (0, W.jsxs)(ce, {
|
|
166
174
|
open: te,
|
|
167
175
|
onOpenChange: w,
|
|
168
|
-
children: [/* @__PURE__ */ (0,
|
|
176
|
+
children: [/* @__PURE__ */ (0, W.jsx)(d, {
|
|
169
177
|
asChild: !0,
|
|
170
|
-
children: /* @__PURE__ */ (0,
|
|
178
|
+
children: /* @__PURE__ */ (0, W.jsxs)(m, {
|
|
171
179
|
variant: O || b?.isFallback ? "default" : "secondary",
|
|
172
180
|
className: "h-8 px-2 text-xs",
|
|
173
181
|
onClick: ae,
|
|
174
|
-
children: [/* @__PURE__ */ (0,
|
|
182
|
+
children: [/* @__PURE__ */ (0, W.jsx)($e, { className: "mr-1 h-3 w-3" }), O || b?.isFallback ? se() : k("editor.conditionalEdge.condition")]
|
|
175
183
|
})
|
|
176
|
-
}), /* @__PURE__ */ (0,
|
|
184
|
+
}), /* @__PURE__ */ (0, W.jsx)(v, {
|
|
177
185
|
className: "w-96 p-1",
|
|
178
186
|
align: "center",
|
|
179
187
|
onClick: (e) => e.stopPropagation(),
|
|
180
|
-
children: /* @__PURE__ */ (0,
|
|
188
|
+
children: /* @__PURE__ */ (0, W.jsx)(mt, {
|
|
181
189
|
className: "flex max-h-150 flex-col p-3",
|
|
182
|
-
children: /* @__PURE__ */ (0,
|
|
190
|
+
children: /* @__PURE__ */ (0, W.jsx)("form", {
|
|
183
191
|
onSubmit: (e) => {
|
|
184
192
|
e.preventDefault(), e.stopPropagation();
|
|
185
193
|
},
|
|
186
|
-
children: /* @__PURE__ */ (0,
|
|
194
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
187
195
|
className: "grid gap-5",
|
|
188
196
|
children: [
|
|
189
|
-
/* @__PURE__ */ (0,
|
|
197
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
190
198
|
className: "space-y-2",
|
|
191
|
-
children: [/* @__PURE__ */ (0,
|
|
199
|
+
children: [/* @__PURE__ */ (0, W.jsx)("h4", {
|
|
192
200
|
className: "font-medium leading-none",
|
|
193
201
|
children: k("editor.conditionalEdge.displayConditions")
|
|
194
|
-
}), /* @__PURE__ */ (0,
|
|
202
|
+
}), /* @__PURE__ */ (0, W.jsx)("p", {
|
|
195
203
|
className: "text-muted-foreground text-sm",
|
|
196
204
|
children: k("editor.conditionalEdge.displayConditionsDesc")
|
|
197
205
|
})]
|
|
198
206
|
}),
|
|
199
|
-
/* @__PURE__ */ (0,
|
|
207
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
200
208
|
className: "grid gap-4",
|
|
201
209
|
children: [
|
|
202
|
-
/* @__PURE__ */ (0,
|
|
210
|
+
/* @__PURE__ */ (0, W.jsx)(A, {
|
|
203
211
|
name: "label",
|
|
204
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
205
|
-
/* @__PURE__ */ (0,
|
|
212
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [
|
|
213
|
+
/* @__PURE__ */ (0, W.jsx)(u, {
|
|
206
214
|
htmlFor: e.name,
|
|
207
215
|
children: k("editor.conditionalEdge.labelOptional")
|
|
208
216
|
}),
|
|
209
|
-
/* @__PURE__ */ (0,
|
|
217
|
+
/* @__PURE__ */ (0, W.jsx)(h, {
|
|
210
218
|
id: e.name,
|
|
211
219
|
placeholder: k("editor.conditionalEdge.labelPlaceholder"),
|
|
212
220
|
value: e.state.value,
|
|
213
221
|
onChange: (t) => e.handleChange(t.target.value)
|
|
214
222
|
}),
|
|
215
|
-
/* @__PURE__ */ (0,
|
|
223
|
+
/* @__PURE__ */ (0, W.jsx)(E, { children: k("editor.conditionalEdge.labelDesc") })
|
|
216
224
|
] })
|
|
217
225
|
}),
|
|
218
|
-
/* @__PURE__ */ (0,
|
|
226
|
+
/* @__PURE__ */ (0, W.jsx)(A, {
|
|
219
227
|
name: "isFallback",
|
|
220
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
228
|
+
children: (e) => /* @__PURE__ */ (0, W.jsx)(T, { children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
221
229
|
className: "flex items-center gap-3 rounded-lg border bg-muted/20 p-3",
|
|
222
|
-
children: [/* @__PURE__ */ (0,
|
|
230
|
+
children: [/* @__PURE__ */ (0, W.jsx)(p, {
|
|
223
231
|
id: e.name,
|
|
224
232
|
checked: e.state.value,
|
|
225
233
|
onCheckedChange: (t) => e.handleChange(t)
|
|
226
|
-
}), /* @__PURE__ */ (0,
|
|
234
|
+
}), /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
227
235
|
className: "flex flex-col gap-1",
|
|
228
|
-
children: [/* @__PURE__ */ (0,
|
|
236
|
+
children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
229
237
|
htmlFor: e.name,
|
|
230
238
|
className: "cursor-pointer font-medium",
|
|
231
239
|
children: k("editor.conditionalEdge.fallbackPath")
|
|
232
|
-
}), /* @__PURE__ */ (0,
|
|
240
|
+
}), /* @__PURE__ */ (0, W.jsx)(E, {
|
|
233
241
|
className: "text-xs",
|
|
234
242
|
children: k("editor.conditionalEdge.fallbackPathDesc")
|
|
235
243
|
})]
|
|
236
244
|
})]
|
|
237
245
|
}) })
|
|
238
246
|
}),
|
|
239
|
-
/* @__PURE__ */ (0,
|
|
247
|
+
/* @__PURE__ */ (0, W.jsx)(A, {
|
|
240
248
|
name: "conditions",
|
|
241
249
|
mode: "array",
|
|
242
250
|
children: (e) => {
|
|
243
251
|
let t = e.form.getFieldValue("isFallback");
|
|
244
|
-
return /* @__PURE__ */ (0,
|
|
252
|
+
return /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
245
253
|
className: "space-y-3",
|
|
246
|
-
children: [/* @__PURE__ */ (0,
|
|
254
|
+
children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
247
255
|
className: t ? "text-muted-foreground" : "",
|
|
248
256
|
children: k("editor.conditionalEdge.conditions")
|
|
249
|
-
}), /* @__PURE__ */ (0,
|
|
257
|
+
}), /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
250
258
|
className: "space-y-2",
|
|
251
|
-
children: [e.state.value?.map((n, r) => /* @__PURE__ */ (0,
|
|
259
|
+
children: [e.state.value?.map((n, r) => /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
252
260
|
className: "space-y-2",
|
|
253
|
-
children: [/* @__PURE__ */ (0,
|
|
261
|
+
children: [/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
254
262
|
className: "space-y-2 rounded-lg border bg-muted/30 p-3",
|
|
255
263
|
children: [
|
|
256
|
-
/* @__PURE__ */ (0,
|
|
264
|
+
/* @__PURE__ */ (0, W.jsx)(A, {
|
|
257
265
|
name: `conditions[${r}].field`,
|
|
258
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
266
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
259
267
|
htmlFor: `field-${r}`,
|
|
260
268
|
children: k("editor.conditionalEdge.field")
|
|
261
|
-
}), /* @__PURE__ */ (0,
|
|
269
|
+
}), /* @__PURE__ */ (0, W.jsxs)(y, {
|
|
262
270
|
disabled: t,
|
|
263
271
|
value: e.state.value || "",
|
|
264
272
|
onValueChange: (t) => e.handleChange(t),
|
|
265
|
-
children: [/* @__PURE__ */ (0,
|
|
273
|
+
children: [/* @__PURE__ */ (0, W.jsx)(_, {
|
|
266
274
|
id: `field-${r}`,
|
|
267
275
|
className: "w-full",
|
|
268
|
-
children: /* @__PURE__ */ (0,
|
|
269
|
-
}), /* @__PURE__ */ (0,
|
|
276
|
+
children: /* @__PURE__ */ (0, W.jsx)(l, { placeholder: k("editor.conditionalEdge.selectField") })
|
|
277
|
+
}), /* @__PURE__ */ (0, W.jsx)(j, { children: D.length === 0 ? /* @__PURE__ */ (0, W.jsx)(x, {
|
|
270
278
|
value: "none",
|
|
271
279
|
disabled: !0,
|
|
272
280
|
children: k("editor.conditionalEdge.noFieldsAvailable")
|
|
273
|
-
}) : D.map((e) => /* @__PURE__ */ (0,
|
|
281
|
+
}) : D.map((e) => /* @__PURE__ */ (0, W.jsxs)(x, {
|
|
274
282
|
value: e.nodeId,
|
|
275
283
|
children: [
|
|
276
284
|
e.label,
|
|
@@ -281,55 +289,55 @@ var ct = {
|
|
|
281
289
|
}, e.nodeId)) })]
|
|
282
290
|
})] })
|
|
283
291
|
}),
|
|
284
|
-
/* @__PURE__ */ (0,
|
|
292
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
285
293
|
className: "flex gap-2",
|
|
286
|
-
children: [/* @__PURE__ */ (0,
|
|
294
|
+
children: [/* @__PURE__ */ (0, W.jsx)(A, {
|
|
287
295
|
name: `conditions[${r}].operator`,
|
|
288
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
296
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
289
297
|
htmlFor: `operator-${r}`,
|
|
290
298
|
children: k("editor.conditionalEdge.operator")
|
|
291
|
-
}), /* @__PURE__ */ (0,
|
|
299
|
+
}), /* @__PURE__ */ (0, W.jsxs)(y, {
|
|
292
300
|
disabled: t,
|
|
293
301
|
value: e.state.value || "===",
|
|
294
302
|
onValueChange: (t) => e.handleChange(t),
|
|
295
|
-
children: [/* @__PURE__ */ (0,
|
|
303
|
+
children: [/* @__PURE__ */ (0, W.jsx)(_, {
|
|
296
304
|
id: `operator-${r}`,
|
|
297
|
-
children: /* @__PURE__ */ (0,
|
|
298
|
-
}), /* @__PURE__ */ (0,
|
|
299
|
-
/* @__PURE__ */ (0,
|
|
305
|
+
children: /* @__PURE__ */ (0, W.jsx)(l, {})
|
|
306
|
+
}), /* @__PURE__ */ (0, W.jsxs)(j, { children: [
|
|
307
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
300
308
|
value: "===",
|
|
301
309
|
children: "="
|
|
302
310
|
}),
|
|
303
|
-
/* @__PURE__ */ (0,
|
|
311
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
304
312
|
value: "!==",
|
|
305
313
|
children: "≠"
|
|
306
314
|
}),
|
|
307
|
-
/* @__PURE__ */ (0,
|
|
315
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
308
316
|
value: ">",
|
|
309
317
|
children: ">"
|
|
310
318
|
}),
|
|
311
|
-
/* @__PURE__ */ (0,
|
|
319
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
312
320
|
value: "<",
|
|
313
321
|
children: "<"
|
|
314
322
|
}),
|
|
315
|
-
/* @__PURE__ */ (0,
|
|
323
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
316
324
|
value: ">=",
|
|
317
325
|
children: ">="
|
|
318
326
|
}),
|
|
319
|
-
/* @__PURE__ */ (0,
|
|
327
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
320
328
|
value: "<=",
|
|
321
329
|
children: "<="
|
|
322
330
|
})
|
|
323
331
|
] })]
|
|
324
332
|
})] })
|
|
325
|
-
}), /* @__PURE__ */ (0,
|
|
333
|
+
}), /* @__PURE__ */ (0, W.jsx)(A, {
|
|
326
334
|
name: `conditions[${r}].value`,
|
|
327
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
335
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, {
|
|
328
336
|
className: "w-full",
|
|
329
|
-
children: [/* @__PURE__ */ (0,
|
|
337
|
+
children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
330
338
|
htmlFor: `value-${r}`,
|
|
331
339
|
children: k("editor.conditionalEdge.value")
|
|
332
|
-
}), /* @__PURE__ */ (0,
|
|
340
|
+
}), /* @__PURE__ */ (0, W.jsx)(h, {
|
|
333
341
|
disabled: t,
|
|
334
342
|
id: `value-${r}`,
|
|
335
343
|
placeholder: k("editor.conditionalEdge.valuePlaceholder"),
|
|
@@ -339,7 +347,7 @@ var ct = {
|
|
|
339
347
|
})
|
|
340
348
|
})]
|
|
341
349
|
}),
|
|
342
|
-
e.state.value && e.state.value.length > 1 && /* @__PURE__ */ (0,
|
|
350
|
+
e.state.value && e.state.value.length > 1 && /* @__PURE__ */ (0, W.jsxs)(m, {
|
|
343
351
|
disabled: t,
|
|
344
352
|
type: "button",
|
|
345
353
|
variant: "ghost",
|
|
@@ -348,31 +356,31 @@ var ct = {
|
|
|
348
356
|
onClick: () => {
|
|
349
357
|
e.removeValue(r), re().then();
|
|
350
358
|
},
|
|
351
|
-
children: [/* @__PURE__ */ (0,
|
|
359
|
+
children: [/* @__PURE__ */ (0, W.jsx)(z, { className: "mr-1 h-4 w-4" }), k("editor.conditionalEdge.removeCondition")]
|
|
352
360
|
})
|
|
353
361
|
]
|
|
354
|
-
}), e.state.value && r < e.state.value.length - 1 && /* @__PURE__ */ (0,
|
|
362
|
+
}), e.state.value && r < e.state.value.length - 1 && /* @__PURE__ */ (0, W.jsx)(A, {
|
|
355
363
|
name: `conditions[${r}].logicalOperator`,
|
|
356
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
364
|
+
children: (e) => /* @__PURE__ */ (0, W.jsx)("div", {
|
|
357
365
|
className: "flex justify-center",
|
|
358
|
-
children: /* @__PURE__ */ (0,
|
|
366
|
+
children: /* @__PURE__ */ (0, W.jsxs)(y, {
|
|
359
367
|
disabled: t,
|
|
360
368
|
value: e.state.value || i.AND,
|
|
361
369
|
onValueChange: (t) => e.handleChange(t),
|
|
362
|
-
children: [/* @__PURE__ */ (0,
|
|
370
|
+
children: [/* @__PURE__ */ (0, W.jsx)(_, {
|
|
363
371
|
className: "h-9 w-32 font-semibold",
|
|
364
|
-
children: /* @__PURE__ */ (0,
|
|
365
|
-
}), /* @__PURE__ */ (0,
|
|
372
|
+
children: /* @__PURE__ */ (0, W.jsx)(l, {})
|
|
373
|
+
}), /* @__PURE__ */ (0, W.jsxs)(j, { children: [/* @__PURE__ */ (0, W.jsx)(x, {
|
|
366
374
|
value: i.AND,
|
|
367
375
|
children: "AND"
|
|
368
|
-
}), /* @__PURE__ */ (0,
|
|
376
|
+
}), /* @__PURE__ */ (0, W.jsx)(x, {
|
|
369
377
|
value: i.OR,
|
|
370
378
|
children: "OR"
|
|
371
379
|
})] })]
|
|
372
380
|
})
|
|
373
381
|
})
|
|
374
382
|
})]
|
|
375
|
-
}, `condition-${r}`)), /* @__PURE__ */ (0,
|
|
383
|
+
}, `condition-${r}`)), /* @__PURE__ */ (0, W.jsxs)(m, {
|
|
376
384
|
disabled: t,
|
|
377
385
|
type: "button",
|
|
378
386
|
variant: "outline",
|
|
@@ -386,7 +394,7 @@ var ct = {
|
|
|
386
394
|
value: ""
|
|
387
395
|
}), re().then();
|
|
388
396
|
},
|
|
389
|
-
children: [/* @__PURE__ */ (0,
|
|
397
|
+
children: [/* @__PURE__ */ (0, W.jsx)(R, { className: "mr-2 h-4 w-4" }), k("editor.conditionalEdge.addCondition")]
|
|
390
398
|
})]
|
|
391
399
|
})]
|
|
392
400
|
});
|
|
@@ -394,15 +402,15 @@ var ct = {
|
|
|
394
402
|
})
|
|
395
403
|
]
|
|
396
404
|
}),
|
|
397
|
-
/* @__PURE__ */ (0,
|
|
405
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
398
406
|
className: "flex justify-end gap-2 pt-2",
|
|
399
|
-
children: [/* @__PURE__ */ (0,
|
|
407
|
+
children: [/* @__PURE__ */ (0, W.jsxs)(m, {
|
|
400
408
|
type: "button",
|
|
401
409
|
size: "sm",
|
|
402
410
|
variant: "outline",
|
|
403
411
|
onClick: oe,
|
|
404
|
-
children: [/* @__PURE__ */ (0,
|
|
405
|
-
}), /* @__PURE__ */ (0,
|
|
412
|
+
children: [/* @__PURE__ */ (0, W.jsx)(z, { className: "mr-1 h-4 w-4" }), k("common.clear")]
|
|
413
|
+
}), /* @__PURE__ */ (0, W.jsx)(m, {
|
|
406
414
|
type: "button",
|
|
407
415
|
size: "sm",
|
|
408
416
|
onClick: () => w(!1),
|
|
@@ -417,23 +425,23 @@ var ct = {
|
|
|
417
425
|
})
|
|
418
426
|
}) })] });
|
|
419
427
|
}),
|
|
420
|
-
default:
|
|
421
|
-
let [u, d, f] =
|
|
428
|
+
default: Oe(({ id: e, sourceX: t, sourceY: n, targetX: r, targetY: i, sourcePosition: a, targetPosition: o, style: s, markerEnd: c, selected: l }) => {
|
|
429
|
+
let [u, d, f] = Ce({
|
|
422
430
|
sourcePosition: a,
|
|
423
431
|
sourceX: t,
|
|
424
432
|
sourceY: n,
|
|
425
433
|
targetPosition: o,
|
|
426
434
|
targetX: r,
|
|
427
435
|
targetY: i
|
|
428
|
-
}), { setEdges: p } =
|
|
429
|
-
return /* @__PURE__ */ (0,
|
|
436
|
+
}), { setEdges: p } = Ee();
|
|
437
|
+
return /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [/* @__PURE__ */ (0, W.jsx)(fe, {
|
|
430
438
|
path: u,
|
|
431
439
|
markerEnd: c,
|
|
432
440
|
style: s
|
|
433
|
-
}), /* @__PURE__ */ (0,
|
|
441
|
+
}), /* @__PURE__ */ (0, W.jsx)(me, { children: l && /* @__PURE__ */ (0, W.jsx)("div", {
|
|
434
442
|
className: "button-edge__label nodrag nopan",
|
|
435
443
|
style: { transform: `translate(-50%, -50%) translate(${d}px,${f}px)` },
|
|
436
|
-
children: /* @__PURE__ */ (0,
|
|
444
|
+
children: /* @__PURE__ */ (0, W.jsx)("button", {
|
|
437
445
|
type: "button",
|
|
438
446
|
className: "button-edge__button",
|
|
439
447
|
onClick: () => {
|
|
@@ -444,46 +452,174 @@ var ct = {
|
|
|
444
452
|
})
|
|
445
453
|
}) })] });
|
|
446
454
|
})
|
|
447
|
-
},
|
|
455
|
+
}, _t = {
|
|
456
|
+
address: "address",
|
|
457
|
+
autocomplete: "autocomplete",
|
|
458
|
+
checkbox: "checkbox",
|
|
459
|
+
date: "date",
|
|
460
|
+
daterange: "daterange",
|
|
461
|
+
file: "file",
|
|
462
|
+
hidden: "hidden",
|
|
463
|
+
http: "http",
|
|
464
|
+
number: "number",
|
|
465
|
+
password: "password",
|
|
466
|
+
radio: "radio",
|
|
467
|
+
select: "select",
|
|
468
|
+
submit: "submit",
|
|
469
|
+
switch: "switch",
|
|
470
|
+
text: "text",
|
|
471
|
+
textarea: "textarea",
|
|
472
|
+
time: "time",
|
|
473
|
+
timerange: "timerange"
|
|
474
|
+
}, vt = { [o.input]: { type: _t.text } }, K = () => {
|
|
475
|
+
let { setNodes: e, setEdges: t, getNodes: n } = Ee(), r = N(() => {
|
|
476
|
+
e((e) => e.map(({ selected: e, ...t }) => t)), t((e) => e.map(({ selected: e, ...t }) => t));
|
|
477
|
+
}, [t, e]), i = N((n) => {
|
|
478
|
+
e((e) => e.map((e) => ({
|
|
479
|
+
...e,
|
|
480
|
+
selected: e.id === n
|
|
481
|
+
}))), t((e) => e.map(({ selected: e, ...t }) => t));
|
|
482
|
+
}, [t, e]), a = N((t, n) => {
|
|
483
|
+
e((e) => e.map((e) => e.id === t ? {
|
|
484
|
+
...e,
|
|
485
|
+
data: {
|
|
486
|
+
...e.data,
|
|
487
|
+
...n
|
|
488
|
+
}
|
|
489
|
+
} : e));
|
|
490
|
+
}, [e]), o = N((t, n) => {
|
|
491
|
+
e((e) => e.map((e) => e.id === t ? {
|
|
492
|
+
...e,
|
|
493
|
+
data: vt[n] ?? {},
|
|
494
|
+
type: n
|
|
495
|
+
} : e));
|
|
496
|
+
}, [e]), s = N((e) => {
|
|
497
|
+
let t = n().find((e) => e.selected);
|
|
498
|
+
t && o(t.id, e);
|
|
499
|
+
}, [n, o]), c = N((e) => {
|
|
500
|
+
let t = n().find((e) => e.selected);
|
|
501
|
+
t && a(t.id, e);
|
|
502
|
+
}, [n, a]);
|
|
503
|
+
return {
|
|
504
|
+
clearSelection: r,
|
|
505
|
+
deleteSelectedNode: N(() => {
|
|
506
|
+
let r = n().find((e) => e.selected);
|
|
507
|
+
r && (e((e) => e.filter((e) => e.id !== r.id)), t((e) => e.filter((e) => e.source !== r.id && e.target !== r.id)));
|
|
508
|
+
}, [
|
|
509
|
+
n,
|
|
510
|
+
e,
|
|
511
|
+
t
|
|
512
|
+
]),
|
|
513
|
+
selectNode: i,
|
|
514
|
+
updateNodeData: a,
|
|
515
|
+
updateNodeType: o,
|
|
516
|
+
updateSelectedNodeData: c,
|
|
517
|
+
updateSelectedNodeType: s
|
|
518
|
+
};
|
|
519
|
+
}, yt = ({ nodeId: e, label: t, placeholder: n, className: r }) => {
|
|
520
|
+
let { language: i } = pt(), { updateNodeData: a } = K(), o = G(), s = t?.[i] ?? "", c = n || o("editor.treegeNode.labelPlaceholder"), l = (n) => {
|
|
521
|
+
a(e, { label: {
|
|
522
|
+
...t,
|
|
523
|
+
[i]: n.target.value
|
|
524
|
+
} });
|
|
525
|
+
}, u = (e) => e.stopPropagation();
|
|
526
|
+
return /* @__PURE__ */ (0, W.jsx)("input", {
|
|
527
|
+
type: "text",
|
|
528
|
+
value: s,
|
|
529
|
+
placeholder: c,
|
|
530
|
+
onChange: l,
|
|
531
|
+
onClick: u,
|
|
532
|
+
onMouseDown: u,
|
|
533
|
+
onPointerDown: u,
|
|
534
|
+
className: f("nodrag nopan w-full truncate bg-transparent outline-none placeholder:text-muted-foreground/40", r)
|
|
535
|
+
});
|
|
536
|
+
}, bt = ({ nodeId: e, className: t }) => {
|
|
537
|
+
let { selectNode: n } = K(), { setIsNodeSheetOpen: r } = pt(), i = G();
|
|
538
|
+
return /* @__PURE__ */ (0, W.jsx)("button", {
|
|
539
|
+
type: "button",
|
|
540
|
+
onClick: (t) => {
|
|
541
|
+
t.stopPropagation(), n(e), r(!0);
|
|
542
|
+
},
|
|
543
|
+
"aria-label": i("editor.nodeActionsSheet.editNode"),
|
|
544
|
+
className: f("nodrag nopan absolute top-2 right-2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-md opacity-60 transition-all hover:text-[--treege-color-primary] hover:opacity-100", t),
|
|
545
|
+
children: /* @__PURE__ */ (0, W.jsx)(Ie, { className: "h-3.5 w-3.5" })
|
|
546
|
+
});
|
|
547
|
+
}, xt = nt("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3", {
|
|
548
|
+
defaultVariants: { variant: "default" },
|
|
549
|
+
variants: { variant: {
|
|
550
|
+
blue: "bg-blue-500 text-white dark:bg-blue-600",
|
|
551
|
+
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
552
|
+
destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
553
|
+
outline: "border-foreground/30 text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
554
|
+
purple: "bg-purple-600 hover:bg-purple-700 text-white",
|
|
555
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90"
|
|
556
|
+
} }
|
|
557
|
+
});
|
|
558
|
+
function St({ className: e, variant: t, asChild: n = !1, ...r }) {
|
|
559
|
+
return /* @__PURE__ */ (0, W.jsx)(n ? tt : "span", {
|
|
560
|
+
"data-slot": "badge",
|
|
561
|
+
className: f(xt({ variant: t }), e),
|
|
562
|
+
...r
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
var Ct = Oe(({ data: e, id: t }) => /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [
|
|
566
|
+
/* @__PURE__ */ (0, W.jsx)(_e, {}),
|
|
567
|
+
/* @__PURE__ */ (0, W.jsx)("div", {
|
|
568
|
+
className: "-top-3.5 absolute left-6",
|
|
569
|
+
children: /* @__PURE__ */ (0, W.jsxs)(St, {
|
|
570
|
+
className: "max-w-50 bg-chart-2",
|
|
571
|
+
children: [/* @__PURE__ */ (0, W.jsx)(Pe, { className: "!w-3 !h-3" }), /* @__PURE__ */ (0, W.jsx)(yt, {
|
|
572
|
+
nodeId: t,
|
|
573
|
+
label: e?.label,
|
|
574
|
+
className: "min-w-0 flex-1 text-xs text-white placeholder:text-white/60"
|
|
575
|
+
})]
|
|
576
|
+
})
|
|
577
|
+
}),
|
|
578
|
+
/* @__PURE__ */ (0, W.jsx)(bt, { nodeId: t })
|
|
579
|
+
] })), wt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", q = (e = 21) => {
|
|
448
580
|
let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
|
|
449
|
-
for (; e--;) t +=
|
|
581
|
+
for (; e--;) t += wt[n[e] & 63];
|
|
450
582
|
return t;
|
|
451
|
-
},
|
|
583
|
+
}, Tt = {
|
|
452
584
|
data: { type: "text" },
|
|
453
|
-
id:
|
|
585
|
+
id: q(),
|
|
454
586
|
position: {
|
|
455
587
|
x: 0,
|
|
456
588
|
y: 0
|
|
457
589
|
},
|
|
458
590
|
type: "input"
|
|
459
|
-
},
|
|
460
|
-
let { setNodes: e, setEdges: t, screenToFlowPosition: n, getNode: r, getNodes: i, getEdges: a } =
|
|
461
|
-
let
|
|
462
|
-
if (
|
|
463
|
-
let
|
|
464
|
-
...
|
|
465
|
-
|
|
591
|
+
}, Et = () => {
|
|
592
|
+
let { setNodes: e, setEdges: t, screenToFlowPosition: n, getNode: r, getNodes: i, getEdges: a } = Ee(), o = N((n, r, i = !1, o) => {
|
|
593
|
+
let s = n.id, l = a().filter((e) => e.source === s), u = c(n);
|
|
594
|
+
if (l.length > 0 && !u) return;
|
|
595
|
+
let d = q(), f = {
|
|
596
|
+
...Tt,
|
|
597
|
+
...o && {
|
|
598
|
+
data: o.data ?? {},
|
|
599
|
+
type: o.type
|
|
600
|
+
},
|
|
601
|
+
id: d,
|
|
466
602
|
position: r,
|
|
467
603
|
selected: i
|
|
468
604
|
};
|
|
469
|
-
n?.parentId && (
|
|
470
|
-
let t = e.filter((e) => e.source ===
|
|
471
|
-
data: t &&
|
|
472
|
-
field:
|
|
605
|
+
n?.parentId && (f.parentId = n.parentId, f.extent = "parent"), e((e) => e.concat(f)), t((e) => {
|
|
606
|
+
let t = e.filter((e) => e.source === s).length > 0, n = {
|
|
607
|
+
data: t && u ? { conditions: [{
|
|
608
|
+
field: s,
|
|
473
609
|
operator: "===",
|
|
474
610
|
value: ""
|
|
475
611
|
}] } : void 0,
|
|
476
|
-
id:
|
|
477
|
-
source:
|
|
478
|
-
target:
|
|
479
|
-
type: t &&
|
|
612
|
+
id: q(),
|
|
613
|
+
source: s,
|
|
614
|
+
target: d,
|
|
615
|
+
type: t && u ? "conditional" : "default"
|
|
480
616
|
};
|
|
481
|
-
return t &&
|
|
617
|
+
return t && u ? e.map((e) => e.source === s ? {
|
|
482
618
|
...e,
|
|
483
619
|
data: {
|
|
484
620
|
...e.data,
|
|
485
621
|
conditions: e.data?.conditions || [{
|
|
486
|
-
field:
|
|
622
|
+
field: s,
|
|
487
623
|
operator: "===",
|
|
488
624
|
value: ""
|
|
489
625
|
}]
|
|
@@ -492,7 +628,7 @@ var ct = {
|
|
|
492
628
|
} : e).concat(n) : e.concat(n);
|
|
493
629
|
}), i && (e((e) => e.map((e) => ({
|
|
494
630
|
...e,
|
|
495
|
-
selected: e.id ===
|
|
631
|
+
selected: e.id === d
|
|
496
632
|
}))), t((e) => e.map((e) => ({
|
|
497
633
|
...e,
|
|
498
634
|
selected: !1
|
|
@@ -501,9 +637,9 @@ var ct = {
|
|
|
501
637
|
a,
|
|
502
638
|
e,
|
|
503
639
|
t
|
|
504
|
-
]), s =
|
|
640
|
+
]), s = N((e) => {
|
|
505
641
|
t((t) => {
|
|
506
|
-
let n =
|
|
642
|
+
let n = Se(e, t), i = e.source, a = r(i);
|
|
507
643
|
return n.filter((e) => e.source === i).length > 1 && a && c(a) ? n.map((e) => e.source === i ? {
|
|
508
644
|
...e,
|
|
509
645
|
data: {
|
|
@@ -517,20 +653,20 @@ var ct = {
|
|
|
517
653
|
type: "conditional"
|
|
518
654
|
} : e) : n;
|
|
519
655
|
});
|
|
520
|
-
}, [t, r]), l =
|
|
521
|
-
let
|
|
522
|
-
if (!
|
|
523
|
-
let
|
|
524
|
-
o(
|
|
525
|
-
x:
|
|
526
|
-
y:
|
|
527
|
-
}, !0);
|
|
656
|
+
}, [t, r]), l = N((e, t) => {
|
|
657
|
+
let n = r(e);
|
|
658
|
+
if (!n) return;
|
|
659
|
+
let s = getComputedStyle(document.documentElement).getPropertyValue("--node-height"), c = getComputedStyle(document.documentElement).getPropertyValue("--node-width"), l = parseFloat(s) || 100, u = parseFloat(c) || 100, d = n.position.y + l + 100, f = i(), p = a(), m = f.filter((t) => p.some((n) => n.source === e && n.target === t.id));
|
|
660
|
+
o(n, {
|
|
661
|
+
x: m.length > 0 ? m.reduce((e, t) => t.position.x > e.position.x ? t : e, m[0]).position.x + u + 50 : n.position.x,
|
|
662
|
+
y: d
|
|
663
|
+
}, !0, t);
|
|
528
664
|
}, [
|
|
529
665
|
r,
|
|
530
666
|
i,
|
|
531
667
|
a,
|
|
532
668
|
o
|
|
533
|
-
]), u =
|
|
669
|
+
]), u = N((e, t) => {
|
|
534
670
|
if (!t.isValid) {
|
|
535
671
|
let { clientX: i, clientY: a } = "changedTouches" in e ? e.changedTouches[0] : e, s = t.fromNode;
|
|
536
672
|
if (!s) return;
|
|
@@ -550,7 +686,7 @@ var ct = {
|
|
|
550
686
|
o,
|
|
551
687
|
r,
|
|
552
688
|
n
|
|
553
|
-
]), d =
|
|
689
|
+
]), d = N((e) => {
|
|
554
690
|
t((t) => {
|
|
555
691
|
let n = t.filter((t) => !e.find((e) => e.id === t.id)), r = new Set(e.map((e) => e.source)), i = /* @__PURE__ */ new Map();
|
|
556
692
|
return n.forEach((e) => {
|
|
@@ -569,7 +705,7 @@ var ct = {
|
|
|
569
705
|
});
|
|
570
706
|
}, [t]);
|
|
571
707
|
return {
|
|
572
|
-
isValidConnection:
|
|
708
|
+
isValidConnection: N((e) => {
|
|
573
709
|
if (e.source === e.target) return !1;
|
|
574
710
|
let t = r(e.source);
|
|
575
711
|
return t ? !(a().filter((t) => t.source === e.source).length > 0 && !c(t)) : !1;
|
|
@@ -579,152 +715,213 @@ var ct = {
|
|
|
579
715
|
onConnectEnd: u,
|
|
580
716
|
onEdgesDelete: d
|
|
581
717
|
};
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
718
|
+
};
|
|
719
|
+
//#endregion
|
|
720
|
+
//#region src/shared/components/ui/dropdown-menu.tsx
|
|
721
|
+
function J({ ...e }) {
|
|
722
|
+
return /* @__PURE__ */ (0, W.jsx)(B.Root, {
|
|
723
|
+
"data-slot": "dropdown-menu",
|
|
724
|
+
...e
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
function Y({ ...e }) {
|
|
728
|
+
return /* @__PURE__ */ (0, W.jsx)(B.Trigger, {
|
|
729
|
+
"data-slot": "dropdown-menu-trigger",
|
|
730
|
+
...e
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
function X({ className: e, sideOffset: t = 4, ...n }) {
|
|
734
|
+
return /* @__PURE__ */ (0, W.jsx)(B.Portal, { children: /* @__PURE__ */ (0, W.jsx)(B.Content, {
|
|
735
|
+
"data-slot": "dropdown-menu-content",
|
|
736
|
+
sideOffset: t,
|
|
737
|
+
className: f("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in", e),
|
|
738
|
+
...n
|
|
739
|
+
}) });
|
|
740
|
+
}
|
|
741
|
+
function Dt({ ...e }) {
|
|
742
|
+
return /* @__PURE__ */ (0, W.jsx)(B.Group, {
|
|
743
|
+
"data-slot": "dropdown-menu-group",
|
|
744
|
+
...e
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
function Z({ className: e, inset: t, variant: n = "default", ...r }) {
|
|
748
|
+
return /* @__PURE__ */ (0, W.jsx)(B.Item, {
|
|
749
|
+
"data-slot": "dropdown-menu-item",
|
|
750
|
+
"data-inset": t,
|
|
751
|
+
"data-variant": n,
|
|
752
|
+
className: f("data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0", e),
|
|
605
753
|
...r
|
|
606
754
|
});
|
|
607
755
|
}
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
756
|
+
function Ot({ className: e, inset: t, ...n }) {
|
|
757
|
+
return /* @__PURE__ */ (0, W.jsx)(B.Label, {
|
|
758
|
+
"data-slot": "dropdown-menu-label",
|
|
759
|
+
"data-inset": t,
|
|
760
|
+
className: f("px-1.5 py-1 font-medium text-muted-foreground text-xs data-[inset]:pl-7", e),
|
|
761
|
+
...n
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
function kt({ className: e, ...t }) {
|
|
765
|
+
return /* @__PURE__ */ (0, W.jsx)(B.Separator, {
|
|
766
|
+
"data-slot": "dropdown-menu-separator",
|
|
767
|
+
className: f("-mx-1 my-1 h-px bg-border", e),
|
|
768
|
+
...t
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
//#endregion
|
|
772
|
+
//#region src/shared/constants/uiType.ts
|
|
773
|
+
var At = {
|
|
774
|
+
divider: "divider",
|
|
775
|
+
title: "title"
|
|
776
|
+
}, jt = ({ nodeId: e, isConnectable: t }) => {
|
|
777
|
+
let { onAddFromHandle: n } = Et(), r = G();
|
|
778
|
+
return /* @__PURE__ */ (0, W.jsxs)(J, { children: [/* @__PURE__ */ (0, W.jsx)(Y, {
|
|
779
|
+
asChild: !0,
|
|
780
|
+
children: /* @__PURE__ */ (0, W.jsx)(he, {
|
|
781
|
+
type: "source",
|
|
782
|
+
position: ye.Bottom,
|
|
783
|
+
isConnectable: t,
|
|
784
|
+
className: "flex h-6! w-6! cursor-pointer items-center justify-center rounded-sm transition-colors hover:bg-primary/80!",
|
|
785
|
+
children: /* @__PURE__ */ (0, W.jsx)(R, { className: "h-4 w-4 text-primary-foreground" })
|
|
786
|
+
})
|
|
787
|
+
}), /* @__PURE__ */ (0, W.jsxs)(X, {
|
|
788
|
+
align: "center",
|
|
789
|
+
side: "bottom",
|
|
790
|
+
className: "treege-scrollbar max-h-80",
|
|
612
791
|
children: [
|
|
613
|
-
/* @__PURE__ */ (0,
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
}),
|
|
619
|
-
/* @__PURE__ */ (0, q.jsx)("div", {
|
|
620
|
-
className: "mb-1 max-w-full overflow-hidden text-ellipsis text-nowrap text-2xl",
|
|
621
|
-
children: a
|
|
622
|
-
}),
|
|
623
|
-
/* @__PURE__ */ (0, q.jsxs)(ht, {
|
|
624
|
-
variant: "destructive",
|
|
792
|
+
/* @__PURE__ */ (0, W.jsxs)(Dt, { children: [/* @__PURE__ */ (0, W.jsx)(Ot, { children: r("editor.selectNodeType.options.input") }), Object.values(_t).map((t) => /* @__PURE__ */ (0, W.jsx)(Z, {
|
|
793
|
+
onClick: () => n(e, {
|
|
794
|
+
data: { type: t },
|
|
795
|
+
type: o.input
|
|
796
|
+
}),
|
|
625
797
|
className: "capitalize",
|
|
626
|
-
children:
|
|
627
|
-
}),
|
|
628
|
-
/* @__PURE__ */ (0,
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
798
|
+
children: t
|
|
799
|
+
}, t))] }),
|
|
800
|
+
/* @__PURE__ */ (0, W.jsx)(kt, {}),
|
|
801
|
+
/* @__PURE__ */ (0, W.jsxs)(Dt, { children: [/* @__PURE__ */ (0, W.jsx)(Ot, { children: r("editor.selectNodeType.options.ui") }), Object.values(At).map((t) => /* @__PURE__ */ (0, W.jsx)(Z, {
|
|
802
|
+
onClick: () => n(e, {
|
|
803
|
+
data: { type: t },
|
|
804
|
+
type: o.ui
|
|
805
|
+
}),
|
|
806
|
+
className: "capitalize",
|
|
807
|
+
children: t
|
|
808
|
+
}, t))] }),
|
|
809
|
+
/* @__PURE__ */ (0, W.jsx)(kt, {}),
|
|
810
|
+
/* @__PURE__ */ (0, W.jsxs)(Dt, { children: [/* @__PURE__ */ (0, W.jsx)(Ot, { children: r("common.other") }), /* @__PURE__ */ (0, W.jsx)(Z, {
|
|
811
|
+
onClick: () => n(e, {
|
|
812
|
+
data: {},
|
|
813
|
+
type: o.flow
|
|
814
|
+
}),
|
|
815
|
+
children: r("editor.selectNodeType.options.flow")
|
|
816
|
+
})] })
|
|
636
817
|
]
|
|
637
|
-
});
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
818
|
+
})] });
|
|
819
|
+
}, Mt = {
|
|
820
|
+
[o.flow]: Ge,
|
|
821
|
+
[o.group]: Pe,
|
|
822
|
+
[o.input]: We,
|
|
823
|
+
[o.ui]: Ue
|
|
824
|
+
}, Nt = {
|
|
825
|
+
[o.flow]: "destructive",
|
|
826
|
+
[o.group]: "default",
|
|
827
|
+
[o.input]: "blue",
|
|
828
|
+
[o.ui]: "purple"
|
|
829
|
+
}, Pt = ({ nodeId: e, type: t }) => {
|
|
830
|
+
let { updateNodeType: n } = K(), r = G(), i = Mt[t], a = Object.keys(zt).filter((e) => e !== o.group), s = (e) => e.stopPropagation();
|
|
831
|
+
return /* @__PURE__ */ (0, W.jsxs)(J, { children: [/* @__PURE__ */ (0, W.jsx)(Y, {
|
|
832
|
+
asChild: !0,
|
|
833
|
+
onClick: s,
|
|
834
|
+
children: /* @__PURE__ */ (0, W.jsxs)(St, {
|
|
835
|
+
variant: Nt[t],
|
|
836
|
+
className: "nodrag nopan cursor-pointer px-1.5 py-0 text-[10px] capitalize [&>svg]:size-2.5",
|
|
837
|
+
children: [/* @__PURE__ */ (0, W.jsx)(i, {}), r(`editor.selectNodeType.options.${t}`)]
|
|
838
|
+
})
|
|
839
|
+
}), /* @__PURE__ */ (0, W.jsx)(X, {
|
|
840
|
+
align: "start",
|
|
841
|
+
onClick: s,
|
|
842
|
+
children: a.map((i) => {
|
|
843
|
+
let a = Mt[i];
|
|
844
|
+
return /* @__PURE__ */ (0, W.jsxs)(Z, {
|
|
845
|
+
onClick: () => n(e, i),
|
|
846
|
+
className: i === t ? "bg-accent" : void 0,
|
|
847
|
+
children: [/* @__PURE__ */ (0, W.jsx)(a, {}), r(`editor.selectNodeType.options.${i}`)]
|
|
848
|
+
}, i);
|
|
645
849
|
})
|
|
646
850
|
})] });
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
|
|
851
|
+
}, Ft = {
|
|
852
|
+
input: Object.values(_t),
|
|
853
|
+
ui: Object.values(At)
|
|
854
|
+
}, It = ({ nodeId: e, type: t, subType: n }) => {
|
|
855
|
+
let { updateNodeData: r } = K(), i = G(), a = Ft[t], o = (e) => e.stopPropagation();
|
|
856
|
+
return /* @__PURE__ */ (0, W.jsxs)(J, { children: [/* @__PURE__ */ (0, W.jsx)(Y, {
|
|
857
|
+
asChild: !0,
|
|
858
|
+
onClick: o,
|
|
859
|
+
children: /* @__PURE__ */ (0, W.jsxs)(St, {
|
|
860
|
+
variant: "default",
|
|
861
|
+
className: "nodrag nopan cursor-pointer px-1.5 py-0 text-[10px] capitalize [&>svg]:size-2.5",
|
|
862
|
+
children: [/* @__PURE__ */ (0, W.jsx)(qe, {}), n || i("editor.selectInputType.type")]
|
|
863
|
+
})
|
|
864
|
+
}), /* @__PURE__ */ (0, W.jsx)(X, {
|
|
865
|
+
align: "start",
|
|
866
|
+
className: "treege-scrollbar max-h-60",
|
|
867
|
+
onClick: o,
|
|
868
|
+
children: a.map((t) => /* @__PURE__ */ (0, W.jsx)(Z, {
|
|
869
|
+
onClick: () => r(e, { type: t }),
|
|
870
|
+
className: f("capitalize", t === n && "bg-accent"),
|
|
871
|
+
children: t
|
|
872
|
+
}, t))
|
|
873
|
+
})] });
|
|
874
|
+
}, Lt = ({ children: e, inGroup: t, isSubmit: n }) => /* @__PURE__ */ (0, W.jsx)("div", {
|
|
875
|
+
className: f("react-flow__node__wrapper relative", t && "in-group", n && "submit-type"),
|
|
876
|
+
children: e
|
|
877
|
+
}), Rt = Oe(({ data: e, isConnectable: t, parentId: n, type: r, id: i }) => {
|
|
878
|
+
let a = r === "input" || r === "ui" ? e?.type : void 0, o = r === "input" && e?.type === "submit", s = r === "input" ? e?.name : void 0;
|
|
879
|
+
return /* @__PURE__ */ (0, W.jsxs)(Lt, {
|
|
650
880
|
inGroup: !!n,
|
|
651
|
-
isSubmit:
|
|
881
|
+
isSubmit: o,
|
|
652
882
|
children: [
|
|
653
|
-
/* @__PURE__ */ (0,
|
|
883
|
+
/* @__PURE__ */ (0, W.jsx)(bt, { nodeId: i }),
|
|
884
|
+
/* @__PURE__ */ (0, W.jsx)(he, {
|
|
654
885
|
type: "target",
|
|
655
|
-
position:
|
|
886
|
+
position: ye.Top,
|
|
656
887
|
isConnectable: t,
|
|
657
|
-
isConnectableStart:
|
|
888
|
+
isConnectableStart: r === "ui"
|
|
658
889
|
}),
|
|
659
|
-
/* @__PURE__ */ (0,
|
|
660
|
-
className: "mb-1
|
|
661
|
-
children:
|
|
890
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
891
|
+
className: "mb-1 flex gap-1",
|
|
892
|
+
children: [/* @__PURE__ */ (0, W.jsx)(Pt, {
|
|
893
|
+
nodeId: i,
|
|
894
|
+
type: r
|
|
895
|
+
}), (r === "input" || r === "ui") && /* @__PURE__ */ (0, W.jsx)(It, {
|
|
896
|
+
nodeId: i,
|
|
897
|
+
type: r,
|
|
898
|
+
subType: a
|
|
899
|
+
})]
|
|
662
900
|
}),
|
|
663
|
-
/* @__PURE__ */ (0,
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
children: [/* @__PURE__ */ (0, q.jsx)(He, {}), e.type]
|
|
669
|
-
})
|
|
901
|
+
/* @__PURE__ */ (0, W.jsx)(yt, {
|
|
902
|
+
nodeId: i,
|
|
903
|
+
label: e?.label,
|
|
904
|
+
placeholder: s,
|
|
905
|
+
className: f("py-1", r === "ui" && "capitalize")
|
|
670
906
|
}),
|
|
671
|
-
/* @__PURE__ */ (0,
|
|
672
|
-
|
|
673
|
-
position: P.Bottom,
|
|
674
|
-
isConnectable: t,
|
|
675
|
-
onClick: a,
|
|
676
|
-
className: "hover:!bg-primary/80 flex cursor-pointer items-center justify-center rounded-sm transition-colors",
|
|
677
|
-
children: /* @__PURE__ */ (0, q.jsx)(V, { className: "h-4 w-4 text-primary-foreground" })
|
|
678
|
-
})
|
|
679
|
-
]
|
|
680
|
-
});
|
|
681
|
-
}), yt = Te(({ data: e, isConnectable: t, type: n, parentId: r, id: i }) => {
|
|
682
|
-
let a = J()(e?.label), o = ft(i);
|
|
683
|
-
return /* @__PURE__ */ (0, q.jsxs)(pt, {
|
|
684
|
-
inGroup: !!r,
|
|
685
|
-
children: [
|
|
686
|
-
/* @__PURE__ */ (0, q.jsx)(N, {
|
|
687
|
-
type: "target",
|
|
688
|
-
position: P.Top,
|
|
907
|
+
/* @__PURE__ */ (0, W.jsx)(jt, {
|
|
908
|
+
nodeId: i,
|
|
689
909
|
isConnectable: t
|
|
690
|
-
}),
|
|
691
|
-
/* @__PURE__ */ (0, q.jsx)("div", {
|
|
692
|
-
className: "mb-1 max-w-full overflow-hidden text-ellipsis text-nowrap text-2xl capitalize",
|
|
693
|
-
children: a
|
|
694
|
-
}),
|
|
695
|
-
/* @__PURE__ */ (0, q.jsxs)("div", {
|
|
696
|
-
className: "flex gap-1",
|
|
697
|
-
children: [/* @__PURE__ */ (0, q.jsxs)(ht, {
|
|
698
|
-
variant: "purple",
|
|
699
|
-
children: [/* @__PURE__ */ (0, q.jsx)(Le, {}), n]
|
|
700
|
-
}), e?.type && /* @__PURE__ */ (0, q.jsxs)(ht, {
|
|
701
|
-
variant: "outline",
|
|
702
|
-
className: "capitalize",
|
|
703
|
-
children: [/* @__PURE__ */ (0, q.jsx)(He, {}), e.type]
|
|
704
|
-
})]
|
|
705
|
-
}),
|
|
706
|
-
/* @__PURE__ */ (0, q.jsx)(N, {
|
|
707
|
-
type: "source",
|
|
708
|
-
position: P.Bottom,
|
|
709
|
-
isConnectable: t,
|
|
710
|
-
onClick: o,
|
|
711
|
-
className: "!bg-primary hover:!bg-primary/80 !w-6 !h-6 flex cursor-pointer items-center justify-center transition-colors",
|
|
712
|
-
children: /* @__PURE__ */ (0, q.jsx)(V, { className: "h-4 w-4 text-primary-foreground" })
|
|
713
910
|
})
|
|
714
911
|
]
|
|
715
912
|
});
|
|
716
|
-
}),
|
|
717
|
-
[o.flow]:
|
|
718
|
-
[o.group]:
|
|
719
|
-
[o.input]:
|
|
720
|
-
[o.ui]:
|
|
721
|
-
}, xt = "You are a Treege decision tree generator. You must generate valid JSON structures for decision trees.\n\nIMPORTANT RULES:\n1. Always respond with valid JSON only, no markdown, no code blocks, no explanations outside the JSON\n2. The JSON must have this exact structure: { \"nodes\": [...], \"edges\": [...] }\n3. Every node must have: id (string), type (string), position ({ x: number, y: number }), data (object)\n4. Every edge must have: id (string), source (string), target (string)\n5. For regex patterns: ALWAYS use double backslashes (\\\\) for special characters (\\\\s, \\\\d, etc.)\n6. AVOID using \"pattern\" field unless specifically requested - prefer using simple validation\n7. For submit buttons, use type \"input\" with data.type \"submit\", NOT type \"flow\"\n8. For conditional logic, use conditional edges with proper operators (===, !==, >, <, >=, <=)\n\nNODE TYPES:\n- \"input\": Form input fields (text, number, select, checkbox, etc.)\n- \"ui\": UI elements (title, divider)\n- \"flow\": Navigation/flow control nodes\n- \"group\": Container for organizing nodes\n\nINPUT NODE TYPES (data.type):\n- \"text\", \"number\", \"textarea\", \"password\"\n- \"select\", \"radio\", \"checkbox\", \"switch\"\n- \"autocomplete\", \"date\", \"daterange\", \"time\", \"timerange\"\n- \"file\", \"address\", \"http\", \"hidden\", \"submit\"\n\nINPUT NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Field Label\",\n \"name\": \"fieldName\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter value...\",\n \"helperText\": \"Optional helper text\",\n \"pattern\": \"regex pattern (optional)\",\n \"errorMessage\": \"Error message if validation fails\",\n \"options\": [{ \"value\": \"val\", \"label\": \"Label\" }], // for select/radio/checkbox\n \"multiple\": false // for select/checkbox\n }\n}\n\nUI NODE TYPES (data.type):\n- \"title\": Display a title\n- \"divider\": Display a divider line\n\nUI NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"UI Element Label\",\n \"type\": \"title\" // or \"divider\"\n }\n}\n\nFLOW NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"flow\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Flow Step Label\",\n \"targetId\": \"next-node-id\" // optional\n }\n}\n\nGROUP NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"group\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Group Label\"\n }\n}\n\nEDGE STRUCTURE:\n{\n \"id\": \"edge-id\",\n \"source\": \"source-node-id\",\n \"target\": \"target-node-id\",\n \"type\": \"default\" // or \"conditional\" for conditional logic\n}\n\nCONDITIONAL EDGE STRUCTURE:\n{\n \"id\": \"edge-id\",\n \"source\": \"source-node-id\",\n \"target\": \"target-node-id\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If condition is true\", // optional label for the edge\n \"conditions\": [\n {\n \"field\": \"field-node-id\", // ID of the field to check\n \"operator\": \">=\", // operators: ===, !==, >, <, >=, <=\n \"value\": \"18\" // value to compare (as string)\n }\n ],\n \"operator\": \"AND\" // optional: \"AND\" or \"OR\" for multiple conditions (default: AND)\n }\n}\n\nIMPORTANT: For conditional edges, the value must ALWAYS be a string, even for numbers.\nExample: For \"age >= 18\", use \"value\": \"18\" (not value: 18)\n\nLAYOUT GUIDELINES:\n- Position nodes in a vertical flow (top to bottom)\n- Start at position { x: 0, y: 0 }\n- Space nodes vertically by exactly 250 pixels between each position (node height 150px + 100px spacing)\n- For horizontal spacing, use 350 pixels\n- Create logical flow from top to bottom\n- IMPORTANT: Keep consistent vertical spacing to avoid overlap\n- Each node position Y should increment by 250: first at y:0, second at y:250, third at y:500, etc.\n\nEXAMPLES:\n\nUser: \"Create a simple contact form with name, email and message\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"Contact Form\", \"type\": \"title\" }\n },\n {\n \"id\": \"name-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Name\",\n \"name\": \"name\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter your name\"\n }\n },\n {\n \"id\": \"email-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Email\",\n \"name\": \"email\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"your@email.com\"\n }\n },\n {\n \"id\": \"message-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 750 },\n \"data\": {\n \"label\": \"Message\",\n \"name\": \"message\",\n \"type\": \"textarea\",\n \"required\": true,\n \"placeholder\": \"Enter your message\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"name-1\" },\n { \"id\": \"e2\", \"source\": \"name-1\", \"target\": \"email-1\" },\n { \"id\": \"e3\", \"source\": \"email-1\", \"target\": \"message-1\" }\n ]\n}\n\nUser: \"Create a user registration form with age, address and country selector\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"User Registration\", \"type\": \"title\" }\n },\n {\n \"id\": \"age-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Age\",\n \"name\": \"age\",\n \"type\": \"number\",\n \"required\": true,\n \"placeholder\": \"Enter your age\"\n }\n },\n {\n \"id\": \"address-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Address\",\n \"name\": \"address\",\n \"type\": \"address\",\n \"required\": true,\n \"placeholder\": \"Enter your address\"\n }\n },\n {\n \"id\": \"country-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 750 },\n \"data\": {\n \"label\": \"Country\",\n \"name\": \"country\",\n \"type\": \"select\",\n \"required\": true,\n \"options\": [\n { \"value\": \"us\", \"label\": \"United States\" },\n { \"value\": \"ca\", \"label\": \"Canada\" },\n { \"value\": \"uk\", \"label\": \"United Kingdom\" },\n { \"value\": \"fr\", \"label\": \"France\" },\n { \"value\": \"de\", \"label\": \"Germany\" }\n ]\n }\n },\n {\n \"id\": \"submit-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 1000 },\n \"data\": {\n \"label\": \"Submit\",\n \"type\": \"submit\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"age-1\" },\n { \"id\": \"e2\", \"source\": \"age-1\", \"target\": \"address-1\" },\n { \"id\": \"e3\", \"source\": \"address-1\", \"target\": \"country-1\" },\n { \"id\": \"e4\", \"source\": \"country-1\", \"target\": \"submit-1\" }\n ]\n}\n\nUser: \"Create a form with name, age, and show different questions based on age (movie for 18+, color for under 18)\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"Survey Form\", \"type\": \"title\" }\n },\n {\n \"id\": \"name-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Name\",\n \"name\": \"name\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter your name\"\n }\n },\n {\n \"id\": \"age-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Age\",\n \"name\": \"age\",\n \"type\": \"number\",\n \"required\": true,\n \"placeholder\": \"Enter your age\"\n }\n },\n {\n \"id\": \"movie-1\",\n \"type\": \"input\",\n \"position\": { \"x\": -350, \"y\": 750 },\n \"data\": {\n \"label\": \"Favorite Movie\",\n \"name\": \"favoriteMovie\",\n \"type\": \"text\",\n \"required\": true,\n \"helperText\": \"For adults 18 and over\"\n }\n },\n {\n \"id\": \"color-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 350, \"y\": 750 },\n \"data\": {\n \"label\": \"Favorite Color\",\n \"name\": \"favoriteColor\",\n \"type\": \"text\",\n \"required\": true,\n \"helperText\": \"For those under 18\"\n }\n },\n {\n \"id\": \"submit-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 1000 },\n \"data\": {\n \"label\": \"Submit\",\n \"type\": \"submit\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"name-1\" },\n { \"id\": \"e2\", \"source\": \"name-1\", \"target\": \"age-1\" },\n {\n \"id\": \"e3\",\n \"source\": \"age-1\",\n \"target\": \"movie-1\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If 18 or older\",\n \"conditions\": [\n {\n \"field\": \"age-1\",\n \"operator\": \">=\",\n \"value\": \"18\"\n }\n ]\n }\n },\n {\n \"id\": \"e4\",\n \"source\": \"age-1\",\n \"target\": \"color-1\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If under 18\",\n \"conditions\": [\n {\n \"field\": \"age-1\",\n \"operator\": \"<\",\n \"value\": \"18\"\n }\n ]\n }\n },\n { \"id\": \"e5\", \"source\": \"movie-1\", \"target\": \"submit-1\" },\n { \"id\": \"e6\", \"source\": \"color-1\", \"target\": \"submit-1\" }\n ]\n}\n\nRemember:\n- Always respond with ONLY valid JSON\n- No markdown code blocks\n- No explanations outside the JSON\n- Follow the exact structure shown above\n- For submit buttons, ALWAYS use type \"input\" with data.type \"submit\"\n- For conditional edges, ALWAYS specify the value as a string and use proper operators (>=, <, ===, etc.)\n- Never leave condition values empty - always provide the comparison value\n", St = {
|
|
913
|
+
}), zt = {
|
|
914
|
+
[o.flow]: Rt,
|
|
915
|
+
[o.group]: Ct,
|
|
916
|
+
[o.input]: Rt,
|
|
917
|
+
[o.ui]: Rt
|
|
918
|
+
}, Bt = "You are a Treege decision tree generator. You must generate valid JSON structures for decision trees.\n\nIMPORTANT RULES:\n1. Always respond with valid JSON only, no markdown, no code blocks, no explanations outside the JSON\n2. The JSON must have this exact structure: { \"nodes\": [...], \"edges\": [...] }\n3. Every node must have: id (string), type (string), position ({ x: number, y: number }), data (object)\n4. Every edge must have: id (string), source (string), target (string)\n5. For regex patterns: ALWAYS use double backslashes (\\\\) for special characters (\\\\s, \\\\d, etc.)\n6. AVOID using \"pattern\" field unless specifically requested - prefer using simple validation\n7. For submit buttons, use type \"input\" with data.type \"submit\", NOT type \"flow\"\n8. For conditional logic, use conditional edges with proper operators (===, !==, >, <, >=, <=)\n\nNODE TYPES:\n- \"input\": Form input fields (text, number, select, checkbox, etc.)\n- \"ui\": UI elements (title, divider)\n- \"flow\": Navigation/flow control nodes\n- \"group\": Container for organizing nodes\n\nINPUT NODE TYPES (data.type):\n- \"text\", \"number\", \"textarea\", \"password\"\n- \"select\", \"radio\", \"checkbox\", \"switch\"\n- \"autocomplete\", \"date\", \"daterange\", \"time\", \"timerange\"\n- \"file\", \"address\", \"http\", \"hidden\", \"submit\"\n\nINPUT NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Field Label\",\n \"name\": \"fieldName\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter value...\",\n \"helperText\": \"Optional helper text\",\n \"pattern\": \"regex pattern (optional)\",\n \"errorMessage\": \"Error message if validation fails\",\n \"options\": [{ \"value\": \"val\", \"label\": \"Label\" }], // for select/radio/checkbox\n \"multiple\": false // for select/checkbox\n }\n}\n\nUI NODE TYPES (data.type):\n- \"title\": Display a title\n- \"divider\": Display a divider line\n\nUI NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"UI Element Label\",\n \"type\": \"title\" // or \"divider\"\n }\n}\n\nFLOW NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"flow\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Flow Step Label\",\n \"targetId\": \"next-node-id\" // optional\n }\n}\n\nGROUP NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"group\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Group Label\"\n }\n}\n\nEDGE STRUCTURE:\n{\n \"id\": \"edge-id\",\n \"source\": \"source-node-id\",\n \"target\": \"target-node-id\",\n \"type\": \"default\" // or \"conditional\" for conditional logic\n}\n\nCONDITIONAL EDGE STRUCTURE:\n{\n \"id\": \"edge-id\",\n \"source\": \"source-node-id\",\n \"target\": \"target-node-id\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If condition is true\", // optional label for the edge\n \"conditions\": [\n {\n \"field\": \"field-node-id\", // ID of the field to check\n \"operator\": \">=\", // operators: ===, !==, >, <, >=, <=\n \"value\": \"18\" // value to compare (as string)\n }\n ],\n \"operator\": \"AND\" // optional: \"AND\" or \"OR\" for multiple conditions (default: AND)\n }\n}\n\nIMPORTANT: For conditional edges, the value must ALWAYS be a string, even for numbers.\nExample: For \"age >= 18\", use \"value\": \"18\" (not value: 18)\n\nLAYOUT GUIDELINES:\n- Position nodes in a vertical flow (top to bottom)\n- Start at position { x: 0, y: 0 }\n- Space nodes vertically by exactly 250 pixels between each position (node height 150px + 100px spacing)\n- For horizontal spacing, use 350 pixels\n- Create logical flow from top to bottom\n- IMPORTANT: Keep consistent vertical spacing to avoid overlap\n- Each node position Y should increment by 250: first at y:0, second at y:250, third at y:500, etc.\n\nEXAMPLES:\n\nUser: \"Create a simple contact form with name, email and message\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"Contact Form\", \"type\": \"title\" }\n },\n {\n \"id\": \"name-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Name\",\n \"name\": \"name\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter your name\"\n }\n },\n {\n \"id\": \"email-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Email\",\n \"name\": \"email\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"your@email.com\"\n }\n },\n {\n \"id\": \"message-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 750 },\n \"data\": {\n \"label\": \"Message\",\n \"name\": \"message\",\n \"type\": \"textarea\",\n \"required\": true,\n \"placeholder\": \"Enter your message\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"name-1\" },\n { \"id\": \"e2\", \"source\": \"name-1\", \"target\": \"email-1\" },\n { \"id\": \"e3\", \"source\": \"email-1\", \"target\": \"message-1\" }\n ]\n}\n\nUser: \"Create a user registration form with age, address and country selector\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"User Registration\", \"type\": \"title\" }\n },\n {\n \"id\": \"age-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Age\",\n \"name\": \"age\",\n \"type\": \"number\",\n \"required\": true,\n \"placeholder\": \"Enter your age\"\n }\n },\n {\n \"id\": \"address-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Address\",\n \"name\": \"address\",\n \"type\": \"address\",\n \"required\": true,\n \"placeholder\": \"Enter your address\"\n }\n },\n {\n \"id\": \"country-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 750 },\n \"data\": {\n \"label\": \"Country\",\n \"name\": \"country\",\n \"type\": \"select\",\n \"required\": true,\n \"options\": [\n { \"value\": \"us\", \"label\": \"United States\" },\n { \"value\": \"ca\", \"label\": \"Canada\" },\n { \"value\": \"uk\", \"label\": \"United Kingdom\" },\n { \"value\": \"fr\", \"label\": \"France\" },\n { \"value\": \"de\", \"label\": \"Germany\" }\n ]\n }\n },\n {\n \"id\": \"submit-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 1000 },\n \"data\": {\n \"label\": \"Submit\",\n \"type\": \"submit\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"age-1\" },\n { \"id\": \"e2\", \"source\": \"age-1\", \"target\": \"address-1\" },\n { \"id\": \"e3\", \"source\": \"address-1\", \"target\": \"country-1\" },\n { \"id\": \"e4\", \"source\": \"country-1\", \"target\": \"submit-1\" }\n ]\n}\n\nUser: \"Create a form with name, age, and show different questions based on age (movie for 18+, color for under 18)\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"Survey Form\", \"type\": \"title\" }\n },\n {\n \"id\": \"name-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Name\",\n \"name\": \"name\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter your name\"\n }\n },\n {\n \"id\": \"age-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Age\",\n \"name\": \"age\",\n \"type\": \"number\",\n \"required\": true,\n \"placeholder\": \"Enter your age\"\n }\n },\n {\n \"id\": \"movie-1\",\n \"type\": \"input\",\n \"position\": { \"x\": -350, \"y\": 750 },\n \"data\": {\n \"label\": \"Favorite Movie\",\n \"name\": \"favoriteMovie\",\n \"type\": \"text\",\n \"required\": true,\n \"helperText\": \"For adults 18 and over\"\n }\n },\n {\n \"id\": \"color-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 350, \"y\": 750 },\n \"data\": {\n \"label\": \"Favorite Color\",\n \"name\": \"favoriteColor\",\n \"type\": \"text\",\n \"required\": true,\n \"helperText\": \"For those under 18\"\n }\n },\n {\n \"id\": \"submit-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 1000 },\n \"data\": {\n \"label\": \"Submit\",\n \"type\": \"submit\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"name-1\" },\n { \"id\": \"e2\", \"source\": \"name-1\", \"target\": \"age-1\" },\n {\n \"id\": \"e3\",\n \"source\": \"age-1\",\n \"target\": \"movie-1\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If 18 or older\",\n \"conditions\": [\n {\n \"field\": \"age-1\",\n \"operator\": \">=\",\n \"value\": \"18\"\n }\n ]\n }\n },\n {\n \"id\": \"e4\",\n \"source\": \"age-1\",\n \"target\": \"color-1\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If under 18\",\n \"conditions\": [\n {\n \"field\": \"age-1\",\n \"operator\": \"<\",\n \"value\": \"18\"\n }\n ]\n }\n },\n { \"id\": \"e5\", \"source\": \"movie-1\", \"target\": \"submit-1\" },\n { \"id\": \"e6\", \"source\": \"color-1\", \"target\": \"submit-1\" }\n ]\n}\n\nRemember:\n- Always respond with ONLY valid JSON\n- No markdown code blocks\n- No explanations outside the JSON\n- Follow the exact structure shown above\n- For submit buttons, ALWAYS use type \"input\" with data.type \"submit\"\n- For conditional edges, ALWAYS specify the value as a string and use proper operators (>=, <, ===, etc.)\n- Never leave condition values empty - always provide the comparison value\n", Vt = {
|
|
722
919
|
claude: "claude-3-5-haiku-20241022",
|
|
723
920
|
deepseek: "deepseek-chat",
|
|
724
921
|
gemini: "gemini-2.5-flash",
|
|
725
922
|
openai: "gpt-4o-mini"
|
|
726
|
-
},
|
|
727
|
-
function
|
|
923
|
+
}, Ht = .3;
|
|
924
|
+
function Ut(e) {
|
|
728
925
|
try {
|
|
729
926
|
return JSON.parse(e);
|
|
730
927
|
} catch (t) {
|
|
@@ -736,10 +933,10 @@ function wt(e) {
|
|
|
736
933
|
}
|
|
737
934
|
}
|
|
738
935
|
}
|
|
739
|
-
async function
|
|
740
|
-
let t = e.config.model ||
|
|
936
|
+
async function Wt(e) {
|
|
937
|
+
let t = e.config.model || Vt.gemini, n = e.config.temperature ?? Ht, r = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/${t}:generateContent?key=${e.config.apiKey}`, {
|
|
741
938
|
body: JSON.stringify({
|
|
742
|
-
contents: [{ parts: [{ text: `${
|
|
939
|
+
contents: [{ parts: [{ text: `${Bt}\n\nUser request: ${e.prompt}` }] }],
|
|
743
940
|
generationConfig: {
|
|
744
941
|
responseMimeType: "application/json",
|
|
745
942
|
temperature: n
|
|
@@ -754,13 +951,13 @@ async function Tt(e) {
|
|
|
754
951
|
}
|
|
755
952
|
let i = (await r.json()).candidates?.[0]?.content?.parts?.[0]?.text;
|
|
756
953
|
if (!i) throw Error("No response from Gemini");
|
|
757
|
-
return
|
|
954
|
+
return Ut(i);
|
|
758
955
|
}
|
|
759
|
-
async function
|
|
760
|
-
let t = e.config.model ||
|
|
956
|
+
async function Gt(e) {
|
|
957
|
+
let t = e.config.model || Vt.openai, n = e.config.temperature ?? Ht, r = await fetch("https://api.openai.com/v1/chat/completions", {
|
|
761
958
|
body: JSON.stringify({
|
|
762
959
|
messages: [{
|
|
763
|
-
content:
|
|
960
|
+
content: Bt,
|
|
764
961
|
role: "system"
|
|
765
962
|
}, {
|
|
766
963
|
content: e.prompt,
|
|
@@ -782,13 +979,13 @@ async function Et(e) {
|
|
|
782
979
|
}
|
|
783
980
|
let i = (await r.json()).choices?.[0]?.message?.content;
|
|
784
981
|
if (!i) throw Error("No response from OpenAI");
|
|
785
|
-
return
|
|
982
|
+
return Ut(i);
|
|
786
983
|
}
|
|
787
|
-
async function
|
|
788
|
-
let t = e.config.model ||
|
|
984
|
+
async function Kt(e) {
|
|
985
|
+
let t = e.config.model || Vt.deepseek, n = e.config.temperature ?? Ht, r = await fetch("https://api.deepseek.com/v1/chat/completions", {
|
|
789
986
|
body: JSON.stringify({
|
|
790
987
|
messages: [{
|
|
791
|
-
content:
|
|
988
|
+
content: Bt,
|
|
792
989
|
role: "system"
|
|
793
990
|
}, {
|
|
794
991
|
content: e.prompt,
|
|
@@ -810,10 +1007,10 @@ async function Dt(e) {
|
|
|
810
1007
|
}
|
|
811
1008
|
let i = (await r.json()).choices?.[0]?.message?.content;
|
|
812
1009
|
if (!i) throw Error("No response from DeepSeek");
|
|
813
|
-
return
|
|
1010
|
+
return Ut(i);
|
|
814
1011
|
}
|
|
815
|
-
async function
|
|
816
|
-
let t = e.config.model ||
|
|
1012
|
+
async function qt(e) {
|
|
1013
|
+
let t = e.config.model || Vt.claude, n = e.config.temperature ?? Ht, r = await fetch("https://api.anthropic.com/v1/messages", {
|
|
817
1014
|
body: JSON.stringify({
|
|
818
1015
|
max_tokens: 4096,
|
|
819
1016
|
messages: [{
|
|
@@ -821,7 +1018,7 @@ async function Ot(e) {
|
|
|
821
1018
|
role: "user"
|
|
822
1019
|
}],
|
|
823
1020
|
model: t,
|
|
824
|
-
system:
|
|
1021
|
+
system: Bt,
|
|
825
1022
|
temperature: n
|
|
826
1023
|
}),
|
|
827
1024
|
headers: {
|
|
@@ -837,75 +1034,75 @@ async function Ot(e) {
|
|
|
837
1034
|
}
|
|
838
1035
|
let i = (await r.json()).content?.[0]?.text;
|
|
839
1036
|
if (!i) throw Error("No response from Claude");
|
|
840
|
-
return
|
|
1037
|
+
return Ut(i);
|
|
841
1038
|
}
|
|
842
|
-
function
|
|
1039
|
+
function Jt(e) {
|
|
843
1040
|
switch (e.config.provider) {
|
|
844
|
-
case "gemini": return
|
|
845
|
-
case "openai": return
|
|
846
|
-
case "deepseek": return
|
|
847
|
-
case "claude": return
|
|
1041
|
+
case "gemini": return Wt(e);
|
|
1042
|
+
case "openai": return Gt(e);
|
|
1043
|
+
case "deepseek": return Kt(e);
|
|
1044
|
+
case "claude": return qt(e);
|
|
848
1045
|
default: throw Error(`Unsupported AI provider: ${e.config.provider}`);
|
|
849
1046
|
}
|
|
850
1047
|
}
|
|
851
1048
|
//#endregion
|
|
852
1049
|
//#region src/editor/features/TreegeEditor/panel/AIGeneratorDialog.tsx
|
|
853
|
-
var
|
|
854
|
-
let [n, r] =
|
|
1050
|
+
var Yt = ({ aiConfig: e, onGenerate: t }) => {
|
|
1051
|
+
let [n, r] = F(!1), [i, a] = F(""), [o, s] = F(!1), c = G(), l = async () => {
|
|
855
1052
|
if (!i.trim()) {
|
|
856
|
-
|
|
1053
|
+
V.error(c("editor.aiGenerator.enterDescription"));
|
|
857
1054
|
return;
|
|
858
1055
|
}
|
|
859
1056
|
if (!e?.apiKey) {
|
|
860
|
-
|
|
1057
|
+
V.error(c("editor.aiGenerator.missingApiKey"), { description: c("editor.aiGenerator.missingApiKeyDesc") });
|
|
861
1058
|
return;
|
|
862
1059
|
}
|
|
863
1060
|
s(!0);
|
|
864
1061
|
try {
|
|
865
|
-
let n = await
|
|
1062
|
+
let n = await Jt({
|
|
866
1063
|
config: e,
|
|
867
1064
|
prompt: i.trim()
|
|
868
1065
|
});
|
|
869
1066
|
t({
|
|
870
1067
|
edges: n.edges,
|
|
871
1068
|
nodes: n.nodes
|
|
872
|
-
}),
|
|
1069
|
+
}), V.success(c("editor.aiGenerator.successTitle"), { description: c("editor.aiGenerator.successDescription").replace("{nodes}", String(n.nodes.length)).replace("{edges}", String(n.edges.length)) }), a(""), r(!1);
|
|
873
1070
|
} catch (e) {
|
|
874
|
-
console.error("AI generation error:", e),
|
|
1071
|
+
console.error("AI generation error:", e), V.error(c("editor.aiGenerator.failedToGenerate"), { description: e instanceof Error ? e.message : c("editor.aiGenerator.unknownError") });
|
|
875
1072
|
} finally {
|
|
876
1073
|
s(!1);
|
|
877
1074
|
}
|
|
878
1075
|
};
|
|
879
|
-
return /* @__PURE__ */ (0,
|
|
1076
|
+
return /* @__PURE__ */ (0, W.jsxs)(se, {
|
|
880
1077
|
open: n,
|
|
881
1078
|
onOpenChange: r,
|
|
882
|
-
children: [/* @__PURE__ */ (0,
|
|
1079
|
+
children: [/* @__PURE__ */ (0, W.jsx)(te, {
|
|
883
1080
|
asChild: !0,
|
|
884
|
-
children: /* @__PURE__ */ (0,
|
|
1081
|
+
children: /* @__PURE__ */ (0, W.jsxs)(m, {
|
|
885
1082
|
variant: "outline",
|
|
886
1083
|
size: "sm",
|
|
887
1084
|
disabled: !e?.apiKey,
|
|
888
1085
|
children: [
|
|
889
|
-
/* @__PURE__ */ (0,
|
|
1086
|
+
/* @__PURE__ */ (0, W.jsx)(Qe, { className: "h-4 w-4 text-[#13d3b4]" }),
|
|
890
1087
|
" ",
|
|
891
1088
|
c("editor.aiGenerator.buttonLabel")
|
|
892
1089
|
]
|
|
893
1090
|
})
|
|
894
|
-
}), /* @__PURE__ */ (0,
|
|
1091
|
+
}), /* @__PURE__ */ (0, W.jsxs)(C, {
|
|
895
1092
|
className: "sm:max-w-[550px]",
|
|
896
1093
|
children: [
|
|
897
|
-
/* @__PURE__ */ (0,
|
|
898
|
-
/* @__PURE__ */ (0,
|
|
1094
|
+
/* @__PURE__ */ (0, W.jsxs)(O, { children: [/* @__PURE__ */ (0, W.jsx)(w, { children: c("editor.aiGenerator.title") }), /* @__PURE__ */ (0, W.jsx)(ee, { children: c("editor.aiGenerator.titleDescription") })] }),
|
|
1095
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
899
1096
|
className: "grid gap-4 py-4",
|
|
900
|
-
children: [/* @__PURE__ */ (0,
|
|
1097
|
+
children: [/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
901
1098
|
className: "grid gap-2",
|
|
902
1099
|
children: [
|
|
903
|
-
/* @__PURE__ */ (0,
|
|
1100
|
+
/* @__PURE__ */ (0, W.jsx)("label", {
|
|
904
1101
|
htmlFor: "ai-prompt",
|
|
905
1102
|
className: "font-medium text-sm",
|
|
906
1103
|
children: c("editor.aiGenerator.description")
|
|
907
1104
|
}),
|
|
908
|
-
/* @__PURE__ */ (0,
|
|
1105
|
+
/* @__PURE__ */ (0, W.jsx)(D, {
|
|
909
1106
|
placeholder: c("editor.aiGenerator.descriptionPlaceholder"),
|
|
910
1107
|
value: i,
|
|
911
1108
|
onChange: (e) => a(e.target.value),
|
|
@@ -916,22 +1113,22 @@ var At = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
916
1113
|
disabled: o,
|
|
917
1114
|
className: "resize-none"
|
|
918
1115
|
}),
|
|
919
|
-
/* @__PURE__ */ (0,
|
|
1116
|
+
/* @__PURE__ */ (0, W.jsx)("p", {
|
|
920
1117
|
className: "text-muted-foreground text-xs",
|
|
921
1118
|
children: c("editor.aiGenerator.keyboardShortcut").replace("{cmdEnter}", "⌘ Enter").replace("{ctrlEnter}", "Ctrl Enter")
|
|
922
1119
|
})
|
|
923
1120
|
]
|
|
924
|
-
}), !e?.apiKey && /* @__PURE__ */ (0,
|
|
1121
|
+
}), !e?.apiKey && /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
925
1122
|
className: "rounded-md bg-muted p-3 text-sm",
|
|
926
|
-
children: [/* @__PURE__ */ (0,
|
|
1123
|
+
children: [/* @__PURE__ */ (0, W.jsx)("p", {
|
|
927
1124
|
className: "font-medium",
|
|
928
1125
|
children: c("editor.aiGenerator.aiNotConfigured")
|
|
929
|
-
}), /* @__PURE__ */ (0,
|
|
1126
|
+
}), /* @__PURE__ */ (0, W.jsxs)("p", {
|
|
930
1127
|
className: "mt-1 text-muted-foreground text-xs",
|
|
931
1128
|
children: [
|
|
932
1129
|
c("editor.aiGenerator.aiNotConfiguredDesc").replace("{code}", ""),
|
|
933
1130
|
" ",
|
|
934
|
-
/* @__PURE__ */ (0,
|
|
1131
|
+
/* @__PURE__ */ (0, W.jsx)("code", {
|
|
935
1132
|
className: "rounded bg-background px-1 py-0.5",
|
|
936
1133
|
children: "aiConfig"
|
|
937
1134
|
})
|
|
@@ -939,83 +1136,28 @@ var At = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
939
1136
|
})]
|
|
940
1137
|
})]
|
|
941
1138
|
}),
|
|
942
|
-
/* @__PURE__ */ (0,
|
|
1139
|
+
/* @__PURE__ */ (0, W.jsxs)(ie, { children: [/* @__PURE__ */ (0, W.jsx)(m, {
|
|
943
1140
|
variant: "outline",
|
|
944
1141
|
onClick: () => r(!1),
|
|
945
1142
|
disabled: o,
|
|
946
1143
|
children: c("editor.aiGenerator.cancel")
|
|
947
|
-
}), /* @__PURE__ */ (0,
|
|
1144
|
+
}), /* @__PURE__ */ (0, W.jsx)(m, {
|
|
948
1145
|
onClick: l,
|
|
949
1146
|
disabled: o || !i.trim() || !e?.apiKey,
|
|
950
|
-
children: o ? /* @__PURE__ */ (0,
|
|
1147
|
+
children: o ? /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [/* @__PURE__ */ (0, W.jsx)(He, { className: "h-4 w-4 animate-spin" }), c("editor.aiGenerator.generating")] }) : /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [/* @__PURE__ */ (0, W.jsx)(Qe, { className: "h-4 w-4 text-[--treege-color-primary]" }), c("editor.aiGenerator.generate")] })
|
|
951
1148
|
})] })
|
|
952
1149
|
]
|
|
953
1150
|
})]
|
|
954
1151
|
});
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
//#region src/shared/components/ui/dropdown-menu.tsx
|
|
958
|
-
function jt({ ...e }) {
|
|
959
|
-
return /* @__PURE__ */ (0, q.jsx)(G.Root, {
|
|
960
|
-
"data-slot": "dropdown-menu",
|
|
961
|
-
...e
|
|
962
|
-
});
|
|
963
|
-
}
|
|
964
|
-
function Mt({ ...e }) {
|
|
965
|
-
return /* @__PURE__ */ (0, q.jsx)(G.Trigger, {
|
|
966
|
-
"data-slot": "dropdown-menu-trigger",
|
|
967
|
-
...e
|
|
968
|
-
});
|
|
969
|
-
}
|
|
970
|
-
function Nt({ className: e, sideOffset: t = 4, ...n }) {
|
|
971
|
-
return /* @__PURE__ */ (0, q.jsx)(G.Portal, { children: /* @__PURE__ */ (0, q.jsx)(G.Content, {
|
|
972
|
-
"data-slot": "dropdown-menu-content",
|
|
973
|
-
sideOffset: t,
|
|
974
|
-
className: f("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in", e),
|
|
975
|
-
...n
|
|
976
|
-
}) });
|
|
977
|
-
}
|
|
978
|
-
function Pt({ ...e }) {
|
|
979
|
-
return /* @__PURE__ */ (0, q.jsx)(G.Group, {
|
|
980
|
-
"data-slot": "dropdown-menu-group",
|
|
981
|
-
...e
|
|
982
|
-
});
|
|
983
|
-
}
|
|
984
|
-
function X({ className: e, inset: t, variant: n = "default", ...r }) {
|
|
985
|
-
return /* @__PURE__ */ (0, q.jsx)(G.Item, {
|
|
986
|
-
"data-slot": "dropdown-menu-item",
|
|
987
|
-
"data-inset": t,
|
|
988
|
-
"data-variant": n,
|
|
989
|
-
className: f("data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0", e),
|
|
990
|
-
...r
|
|
991
|
-
});
|
|
992
|
-
}
|
|
993
|
-
function Ft({ className: e, inset: t, ...n }) {
|
|
994
|
-
return /* @__PURE__ */ (0, q.jsx)(G.Label, {
|
|
995
|
-
"data-slot": "dropdown-menu-label",
|
|
996
|
-
"data-inset": t,
|
|
997
|
-
className: f("px-2 py-1.5 font-medium text-sm data-[inset]:pl-8", e),
|
|
998
|
-
...n
|
|
999
|
-
});
|
|
1000
|
-
}
|
|
1001
|
-
function It({ className: e, ...t }) {
|
|
1002
|
-
return /* @__PURE__ */ (0, q.jsx)(G.Separator, {
|
|
1003
|
-
"data-slot": "dropdown-menu-separator",
|
|
1004
|
-
className: f("-mx-1 my-1 h-px bg-border", e),
|
|
1005
|
-
...t
|
|
1006
|
-
});
|
|
1007
|
-
}
|
|
1008
|
-
//#endregion
|
|
1009
|
-
//#region src/editor/features/TreegeEditor/panel/ActionsPanel.tsx
|
|
1010
|
-
var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
1011
|
-
let { flowId: n, setFlowId: r, aiConfig: i } = at(), { setNodes: a, setEdges: o, addNodes: s, screenToFlowPosition: c } = F(), l = n || Lt, u = Ce(), d = Se(), f = ke(null), p = J(), h = () => {
|
|
1152
|
+
}, Xt = q(), Zt = ({ onExportJson: e, onSave: t }) => {
|
|
1153
|
+
let { flowId: n, setFlowId: r, aiConfig: i } = pt(), { setNodes: a, setEdges: o, addNodes: s, screenToFlowPosition: c } = Ee(), l = n || Xt, u = Te(), d = we(), f = Me(null), p = G(), h = () => {
|
|
1012
1154
|
let e = (window.innerWidth || 0) / 2, t = (window.innerHeight || 0) / 2, n = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--node-width"), 10), r = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--node-height"), 10), i = c({
|
|
1013
1155
|
x: e - n,
|
|
1014
1156
|
y: t - r
|
|
1015
1157
|
});
|
|
1016
1158
|
s([{
|
|
1017
|
-
...
|
|
1018
|
-
id:
|
|
1159
|
+
...Tt,
|
|
1160
|
+
id: q(),
|
|
1019
1161
|
position: i,
|
|
1020
1162
|
selected: !0
|
|
1021
1163
|
}]);
|
|
@@ -1026,9 +1168,9 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1026
1168
|
n.onload = (e) => {
|
|
1027
1169
|
try {
|
|
1028
1170
|
let t = JSON.parse(e.target?.result);
|
|
1029
|
-
t && Array.isArray(t.nodes) && Array.isArray(t.edges) ? (a(t.nodes), o(t.edges),
|
|
1171
|
+
t && Array.isArray(t.nodes) && Array.isArray(t.edges) ? (a(t.nodes), o(t.edges), V.success(p("editor.actionsPanel.importSuccess"), { description: p("editor.actionsPanel.importSuccessDesc") })) : V.error(p("editor.actionsPanel.invalidJson"), { description: p("editor.actionsPanel.invalidJsonDesc") });
|
|
1030
1172
|
} catch (e) {
|
|
1031
|
-
console.warn(e),
|
|
1173
|
+
console.warn(e), V.error(p("editor.actionsPanel.parseError"), { description: p("editor.actionsPanel.parseErrorDesc") });
|
|
1032
1174
|
}
|
|
1033
1175
|
f.current && (f.current.value = "");
|
|
1034
1176
|
}, n.readAsText(t);
|
|
@@ -1038,8 +1180,8 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1038
1180
|
id: l,
|
|
1039
1181
|
nodes: u
|
|
1040
1182
|
}, i = new Blob([JSON.stringify(t, null, 2)], { type: "application/json" }), a = URL.createObjectURL(i), o = document.createElement("a");
|
|
1041
|
-
o.href = a, o.download = "treege.json", o.click(), URL.revokeObjectURL(a),
|
|
1042
|
-
}, v =
|
|
1183
|
+
o.href = a, o.download = "treege.json", o.click(), URL.revokeObjectURL(a), V.success(p("editor.actionsPanel.downloadSuccess"), { description: p("editor.actionsPanel.downloadSuccessDesc") }), n || r?.(l), e?.(t);
|
|
1184
|
+
}, v = N(() => {
|
|
1043
1185
|
n || r?.(l), t?.({
|
|
1044
1186
|
edges: d,
|
|
1045
1187
|
id: l,
|
|
@@ -1053,108 +1195,108 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1053
1195
|
t,
|
|
1054
1196
|
r
|
|
1055
1197
|
]);
|
|
1056
|
-
return
|
|
1198
|
+
return Ae(() => {
|
|
1057
1199
|
let e = (e) => {
|
|
1058
1200
|
(e.ctrlKey || e.metaKey) && e.key === "s" && (e.preventDefault(), v());
|
|
1059
1201
|
};
|
|
1060
1202
|
return window.addEventListener("keydown", e), () => {
|
|
1061
1203
|
window.removeEventListener("keydown", e);
|
|
1062
1204
|
};
|
|
1063
|
-
}, [v]), /* @__PURE__ */ (0,
|
|
1205
|
+
}, [v]), /* @__PURE__ */ (0, W.jsxs)(ve, {
|
|
1064
1206
|
position: "top-right",
|
|
1065
1207
|
className: "flex gap-2",
|
|
1066
1208
|
children: [
|
|
1067
|
-
/* @__PURE__ */ (0,
|
|
1209
|
+
/* @__PURE__ */ (0, W.jsx)(Yt, {
|
|
1068
1210
|
aiConfig: i,
|
|
1069
1211
|
onGenerate: (e) => {
|
|
1070
1212
|
a(e.nodes), o(e.edges);
|
|
1071
1213
|
}
|
|
1072
1214
|
}),
|
|
1073
|
-
/* @__PURE__ */ (0,
|
|
1215
|
+
/* @__PURE__ */ (0, W.jsxs)(m, {
|
|
1074
1216
|
variant: "outline",
|
|
1075
1217
|
size: "sm",
|
|
1076
1218
|
onClick: h,
|
|
1077
1219
|
children: [
|
|
1078
|
-
/* @__PURE__ */ (0,
|
|
1220
|
+
/* @__PURE__ */ (0, W.jsx)(R, {}),
|
|
1079
1221
|
" ",
|
|
1080
1222
|
p("editor.actionsPanel.addNode")
|
|
1081
1223
|
]
|
|
1082
1224
|
}),
|
|
1083
|
-
/* @__PURE__ */ (0,
|
|
1225
|
+
/* @__PURE__ */ (0, W.jsxs)(m, {
|
|
1084
1226
|
variant: "outline",
|
|
1085
1227
|
size: "sm",
|
|
1086
1228
|
onClick: v,
|
|
1087
1229
|
children: [
|
|
1088
|
-
/* @__PURE__ */ (0,
|
|
1230
|
+
/* @__PURE__ */ (0, W.jsx)(Je, {}),
|
|
1089
1231
|
" ",
|
|
1090
1232
|
p("common.save")
|
|
1091
1233
|
]
|
|
1092
1234
|
}),
|
|
1093
|
-
/* @__PURE__ */ (0,
|
|
1235
|
+
/* @__PURE__ */ (0, W.jsxs)(J, { children: [/* @__PURE__ */ (0, W.jsx)(Y, {
|
|
1094
1236
|
asChild: !0,
|
|
1095
|
-
children: /* @__PURE__ */ (0,
|
|
1237
|
+
children: /* @__PURE__ */ (0, W.jsx)(m, {
|
|
1096
1238
|
variant: "outline",
|
|
1097
1239
|
size: "sm",
|
|
1098
|
-
children: /* @__PURE__ */ (0,
|
|
1240
|
+
children: /* @__PURE__ */ (0, W.jsx)(ze, {})
|
|
1099
1241
|
})
|
|
1100
|
-
}), /* @__PURE__ */ (0,
|
|
1242
|
+
}), /* @__PURE__ */ (0, W.jsxs)(X, {
|
|
1101
1243
|
align: "start",
|
|
1102
1244
|
children: [
|
|
1103
|
-
/* @__PURE__ */ (0,
|
|
1245
|
+
/* @__PURE__ */ (0, W.jsx)(Ot, {
|
|
1104
1246
|
className: "font-normal",
|
|
1105
|
-
children: /* @__PURE__ */ (0,
|
|
1247
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1106
1248
|
className: "flex flex-col gap-1",
|
|
1107
|
-
children: [/* @__PURE__ */ (0,
|
|
1249
|
+
children: [/* @__PURE__ */ (0, W.jsx)("span", {
|
|
1108
1250
|
className: "text-muted-foreground text-xs",
|
|
1109
1251
|
children: "Flow ID"
|
|
1110
|
-
}), /* @__PURE__ */ (0,
|
|
1252
|
+
}), /* @__PURE__ */ (0, W.jsxs)("button", {
|
|
1111
1253
|
onClick: async () => {
|
|
1112
1254
|
try {
|
|
1113
|
-
await navigator.clipboard.writeText(l),
|
|
1255
|
+
await navigator.clipboard.writeText(l), V.success(p("editor.actionsPanel.idCopied"), { description: l });
|
|
1114
1256
|
} catch {
|
|
1115
|
-
|
|
1257
|
+
V.error(p("editor.actionsPanel.copyFailed"));
|
|
1116
1258
|
}
|
|
1117
1259
|
},
|
|
1118
1260
|
className: "flex items-center gap-2 font-mono text-muted-foreground transition-colors hover:text-primary",
|
|
1119
1261
|
type: "button",
|
|
1120
|
-
children: [/* @__PURE__ */ (0,
|
|
1262
|
+
children: [/* @__PURE__ */ (0, W.jsx)(Le, { className: "h-3 w-3" }), /* @__PURE__ */ (0, W.jsx)("span", {
|
|
1121
1263
|
className: "truncate text-xs",
|
|
1122
1264
|
children: l
|
|
1123
1265
|
})]
|
|
1124
1266
|
})]
|
|
1125
1267
|
})
|
|
1126
1268
|
}),
|
|
1127
|
-
/* @__PURE__ */ (0,
|
|
1128
|
-
/* @__PURE__ */ (0,
|
|
1269
|
+
/* @__PURE__ */ (0, W.jsx)(kt, {}),
|
|
1270
|
+
/* @__PURE__ */ (0, W.jsxs)(Dt, { children: [/* @__PURE__ */ (0, W.jsxs)(Z, {
|
|
1129
1271
|
onClick: () => f?.current?.click(),
|
|
1130
1272
|
children: [
|
|
1131
|
-
/* @__PURE__ */ (0,
|
|
1273
|
+
/* @__PURE__ */ (0, W.jsx)(Re, {}),
|
|
1132
1274
|
" ",
|
|
1133
1275
|
p("editor.actionsPanel.importJson")
|
|
1134
1276
|
]
|
|
1135
|
-
}), /* @__PURE__ */ (0,
|
|
1277
|
+
}), /* @__PURE__ */ (0, W.jsxs)(Z, {
|
|
1136
1278
|
onClick: _,
|
|
1137
1279
|
children: [
|
|
1138
|
-
/* @__PURE__ */ (0,
|
|
1280
|
+
/* @__PURE__ */ (0, W.jsx)(Ne, {}),
|
|
1139
1281
|
" ",
|
|
1140
1282
|
p("editor.actionsPanel.exportJson")
|
|
1141
1283
|
]
|
|
1142
1284
|
})] }),
|
|
1143
|
-
/* @__PURE__ */ (0,
|
|
1144
|
-
/* @__PURE__ */ (0,
|
|
1285
|
+
/* @__PURE__ */ (0, W.jsx)(kt, {}),
|
|
1286
|
+
/* @__PURE__ */ (0, W.jsx)(Dt, { children: /* @__PURE__ */ (0, W.jsxs)(Z, {
|
|
1145
1287
|
onClick: () => {
|
|
1146
|
-
a([]), o([]),
|
|
1288
|
+
a([]), o([]), V.success(p("editor.actionsPanel.clearSuccess"), { description: p("editor.actionsPanel.clearSuccessDesc") });
|
|
1147
1289
|
},
|
|
1148
1290
|
className: "text-destructive focus:text-destructive",
|
|
1149
1291
|
children: [
|
|
1150
|
-
/* @__PURE__ */ (0,
|
|
1292
|
+
/* @__PURE__ */ (0, W.jsx)(Ye, { className: "text-destructive" }),
|
|
1151
1293
|
" ",
|
|
1152
1294
|
p("editor.actionsPanel.clear")
|
|
1153
1295
|
]
|
|
1154
1296
|
}) })
|
|
1155
1297
|
]
|
|
1156
1298
|
})] }),
|
|
1157
|
-
/* @__PURE__ */ (0,
|
|
1299
|
+
/* @__PURE__ */ (0, W.jsx)("input", {
|
|
1158
1300
|
type: "file",
|
|
1159
1301
|
accept: "application/json,.json",
|
|
1160
1302
|
className: "hidden",
|
|
@@ -1163,7 +1305,7 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1163
1305
|
})
|
|
1164
1306
|
]
|
|
1165
1307
|
});
|
|
1166
|
-
},
|
|
1308
|
+
}, Qt = {
|
|
1167
1309
|
ar: "ar",
|
|
1168
1310
|
de: "de",
|
|
1169
1311
|
en: "en",
|
|
@@ -1171,58 +1313,19 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1171
1313
|
fr: "fr",
|
|
1172
1314
|
it: "it",
|
|
1173
1315
|
pt: "pt"
|
|
1174
|
-
},
|
|
1316
|
+
}, Q = ({ value: e = "en", onValueChange: t }) => /* @__PURE__ */ (0, W.jsxs)(y, {
|
|
1175
1317
|
value: e,
|
|
1176
1318
|
onValueChange: t,
|
|
1177
|
-
children: [/* @__PURE__ */ (0,
|
|
1319
|
+
children: [/* @__PURE__ */ (0, W.jsx)(_, {
|
|
1178
1320
|
className: "uppercase",
|
|
1179
|
-
children: /* @__PURE__ */ (0,
|
|
1180
|
-
}), /* @__PURE__ */ (0,
|
|
1321
|
+
children: /* @__PURE__ */ (0, W.jsx)(l, { placeholder: "" })
|
|
1322
|
+
}), /* @__PURE__ */ (0, W.jsx)(j, { children: /* @__PURE__ */ (0, W.jsx)(M, { children: Object.values(Qt).map((e) => /* @__PURE__ */ (0, W.jsx)(x, {
|
|
1181
1323
|
value: e,
|
|
1182
1324
|
className: "uppercase",
|
|
1183
1325
|
children: e
|
|
1184
1326
|
}, e)) }) })]
|
|
1185
|
-
}),
|
|
1186
|
-
let
|
|
1187
|
-
e((e) => e.map(({ selected: e, ...t }) => t)), t((e) => e.map(({ selected: e, ...t }) => t));
|
|
1188
|
-
}, [t, e]), i = I((t, n) => {
|
|
1189
|
-
e((e) => e.map((e) => e.id === t ? {
|
|
1190
|
-
...e,
|
|
1191
|
-
data: {
|
|
1192
|
-
...e.data,
|
|
1193
|
-
...n
|
|
1194
|
-
}
|
|
1195
|
-
} : e));
|
|
1196
|
-
}, [e]), a = I((t, n) => {
|
|
1197
|
-
e((e) => e.map((e) => e.id === t ? {
|
|
1198
|
-
...e,
|
|
1199
|
-
data: {},
|
|
1200
|
-
type: n
|
|
1201
|
-
} : e));
|
|
1202
|
-
}, [e]), o = I((e) => {
|
|
1203
|
-
let t = n().find((e) => e.selected);
|
|
1204
|
-
t && a(t.id, e);
|
|
1205
|
-
}, [n, a]), s = I((e) => {
|
|
1206
|
-
let t = n().find((e) => e.selected);
|
|
1207
|
-
t && i(t.id, e);
|
|
1208
|
-
}, [n, i]);
|
|
1209
|
-
return {
|
|
1210
|
-
clearSelection: r,
|
|
1211
|
-
deleteSelectedNode: I(() => {
|
|
1212
|
-
let r = n().find((e) => e.selected);
|
|
1213
|
-
r && (e((e) => e.filter((e) => e.id !== r.id)), t((e) => e.filter((e) => e.source !== r.id && e.target !== r.id)));
|
|
1214
|
-
}, [
|
|
1215
|
-
n,
|
|
1216
|
-
e,
|
|
1217
|
-
t
|
|
1218
|
-
]),
|
|
1219
|
-
updateNodeData: i,
|
|
1220
|
-
updateNodeType: a,
|
|
1221
|
-
updateSelectedNodeData: s,
|
|
1222
|
-
updateSelectedNodeType: o
|
|
1223
|
-
};
|
|
1224
|
-
}, $ = () => {
|
|
1225
|
-
let e = Ce(), t = L(() => e.filter(a), [e]), n = L(() => e.filter((e) => e.selected), [e]), r = L(() => e.find((e) => e.selected), [e]);
|
|
1327
|
+
}), $ = () => {
|
|
1328
|
+
let e = Te(), t = P(() => e.filter(a), [e]), n = P(() => e.filter((e) => e.selected), [e]), r = P(() => e.find((e) => e.selected), [e]);
|
|
1226
1329
|
return {
|
|
1227
1330
|
groupNodes: t,
|
|
1228
1331
|
hasSelectedNodes: n.length > 0,
|
|
@@ -1230,8 +1333,8 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1230
1333
|
selectedNode: r,
|
|
1231
1334
|
selectedNodes: n
|
|
1232
1335
|
};
|
|
1233
|
-
},
|
|
1234
|
-
let [e, t] =
|
|
1336
|
+
}, $t = () => {
|
|
1337
|
+
let [e, t] = F("en"), { updateSelectedNodeData: n } = K(), { selectedNode: r } = $(), i = G(), { Field: a } = I({
|
|
1235
1338
|
defaultValues: {
|
|
1236
1339
|
label: r?.data?.label || { en: "" },
|
|
1237
1340
|
targetId: r?.data?.targetId || ""
|
|
@@ -1246,22 +1349,22 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1246
1349
|
n(e);
|
|
1247
1350
|
}
|
|
1248
1351
|
});
|
|
1249
|
-
return /* @__PURE__ */ (0,
|
|
1352
|
+
return /* @__PURE__ */ (0, W.jsx)("form", {
|
|
1250
1353
|
onSubmit: (e) => {
|
|
1251
1354
|
e.preventDefault(), e.stopPropagation();
|
|
1252
1355
|
},
|
|
1253
|
-
children: /* @__PURE__ */ (0,
|
|
1356
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1254
1357
|
className: "grid gap-6",
|
|
1255
|
-
children: [/* @__PURE__ */ (0,
|
|
1358
|
+
children: [/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1256
1359
|
className: "flex items-end gap-2",
|
|
1257
|
-
children: [/* @__PURE__ */ (0,
|
|
1360
|
+
children: [/* @__PURE__ */ (0, W.jsx)(a, {
|
|
1258
1361
|
name: "label",
|
|
1259
|
-
children: (t) => /* @__PURE__ */ (0,
|
|
1362
|
+
children: (t) => /* @__PURE__ */ (0, W.jsxs)(T, {
|
|
1260
1363
|
className: "flex-1",
|
|
1261
|
-
children: [/* @__PURE__ */ (0,
|
|
1364
|
+
children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
1262
1365
|
htmlFor: t.name,
|
|
1263
1366
|
children: i("editor.flowNodeForm.label")
|
|
1264
|
-
}), /* @__PURE__ */ (0,
|
|
1367
|
+
}), /* @__PURE__ */ (0, W.jsx)(h, {
|
|
1265
1368
|
id: t.name,
|
|
1266
1369
|
name: t.name,
|
|
1267
1370
|
value: t.state.value?.[e] || "",
|
|
@@ -1274,31 +1377,31 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1274
1377
|
}
|
|
1275
1378
|
})]
|
|
1276
1379
|
})
|
|
1277
|
-
}), /* @__PURE__ */ (0,
|
|
1380
|
+
}), /* @__PURE__ */ (0, W.jsx)(Q, {
|
|
1278
1381
|
value: e,
|
|
1279
1382
|
onValueChange: t
|
|
1280
1383
|
})]
|
|
1281
|
-
}), /* @__PURE__ */ (0,
|
|
1384
|
+
}), /* @__PURE__ */ (0, W.jsx)(a, {
|
|
1282
1385
|
name: "targetId",
|
|
1283
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1284
|
-
/* @__PURE__ */ (0,
|
|
1386
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [
|
|
1387
|
+
/* @__PURE__ */ (0, W.jsxs)(u, {
|
|
1285
1388
|
htmlFor: e.name,
|
|
1286
1389
|
children: [i("editor.flowNodeForm.targetId"), " (Flow ID)"]
|
|
1287
1390
|
}),
|
|
1288
|
-
/* @__PURE__ */ (0,
|
|
1391
|
+
/* @__PURE__ */ (0, W.jsx)(h, {
|
|
1289
1392
|
id: e.name,
|
|
1290
1393
|
name: e.name,
|
|
1291
1394
|
value: e.state.value,
|
|
1292
1395
|
onBlur: e.handleBlur,
|
|
1293
1396
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
1294
1397
|
}),
|
|
1295
|
-
/* @__PURE__ */ (0,
|
|
1398
|
+
/* @__PURE__ */ (0, W.jsx)(E, { children: "Unique identifier of the target flow." })
|
|
1296
1399
|
] })
|
|
1297
1400
|
})]
|
|
1298
1401
|
})
|
|
1299
1402
|
});
|
|
1300
|
-
},
|
|
1301
|
-
let [e, t] =
|
|
1403
|
+
}, en = () => {
|
|
1404
|
+
let [e, t] = F("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = K(), { Field: i } = I({
|
|
1302
1405
|
defaultValues: { label: n?.data?.label || { en: "" } },
|
|
1303
1406
|
listeners: {
|
|
1304
1407
|
onChange: ({ formApi: e }) => {
|
|
@@ -1310,20 +1413,20 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1310
1413
|
r(e);
|
|
1311
1414
|
}
|
|
1312
1415
|
});
|
|
1313
|
-
return /* @__PURE__ */ (0,
|
|
1416
|
+
return /* @__PURE__ */ (0, W.jsx)("form", {
|
|
1314
1417
|
onSubmit: (e) => {
|
|
1315
1418
|
e.preventDefault(), e.stopPropagation();
|
|
1316
1419
|
},
|
|
1317
|
-
children: /* @__PURE__ */ (0,
|
|
1420
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1318
1421
|
className: "flex items-end gap-2",
|
|
1319
|
-
children: [/* @__PURE__ */ (0,
|
|
1422
|
+
children: [/* @__PURE__ */ (0, W.jsx)(i, {
|
|
1320
1423
|
name: "label",
|
|
1321
|
-
children: (t) => /* @__PURE__ */ (0,
|
|
1424
|
+
children: (t) => /* @__PURE__ */ (0, W.jsxs)(T, {
|
|
1322
1425
|
className: "flex-1",
|
|
1323
|
-
children: [/* @__PURE__ */ (0,
|
|
1426
|
+
children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
1324
1427
|
htmlFor: t.name,
|
|
1325
1428
|
children: "Label"
|
|
1326
|
-
}), /* @__PURE__ */ (0,
|
|
1429
|
+
}), /* @__PURE__ */ (0, W.jsx)(h, {
|
|
1327
1430
|
id: t.name,
|
|
1328
1431
|
name: t.name,
|
|
1329
1432
|
value: t.state.value?.[e] || "",
|
|
@@ -1336,18 +1439,18 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1336
1439
|
}
|
|
1337
1440
|
})]
|
|
1338
1441
|
})
|
|
1339
|
-
}), /* @__PURE__ */ (0,
|
|
1442
|
+
}), /* @__PURE__ */ (0, W.jsx)(Q, {
|
|
1340
1443
|
value: e,
|
|
1341
1444
|
onValueChange: t
|
|
1342
1445
|
})]
|
|
1343
1446
|
})
|
|
1344
1447
|
});
|
|
1345
|
-
},
|
|
1448
|
+
}, tn = [
|
|
1346
1449
|
"POST",
|
|
1347
1450
|
"PUT",
|
|
1348
1451
|
"PATCH"
|
|
1349
|
-
],
|
|
1350
|
-
let { selectedNode: n } = $(), r =
|
|
1452
|
+
], nn = ({ value: e, onChange: t }) => {
|
|
1453
|
+
let { selectedNode: n } = $(), r = G(), i = ut(n?.id), { handleSubmit: a, Field: o, Subscribe: s } = I({
|
|
1351
1454
|
defaultValues: {
|
|
1352
1455
|
body: e?.body || "",
|
|
1353
1456
|
fetchOnMount: e?.fetchOnMount ?? !e?.searchParam,
|
|
@@ -1373,19 +1476,19 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1373
1476
|
t(e);
|
|
1374
1477
|
}
|
|
1375
1478
|
});
|
|
1376
|
-
return /* @__PURE__ */ (0,
|
|
1479
|
+
return /* @__PURE__ */ (0, W.jsx)("div", { children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1377
1480
|
className: "grid gap-6",
|
|
1378
1481
|
children: [
|
|
1379
|
-
/* @__PURE__ */ (0,
|
|
1482
|
+
/* @__PURE__ */ (0, W.jsx)(o, {
|
|
1380
1483
|
name: "url",
|
|
1381
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1382
|
-
/* @__PURE__ */ (0,
|
|
1484
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [
|
|
1485
|
+
/* @__PURE__ */ (0, W.jsx)(u, {
|
|
1383
1486
|
htmlFor: e.name,
|
|
1384
1487
|
children: r("editor.httpConfigForm.apiUrl")
|
|
1385
1488
|
}),
|
|
1386
|
-
/* @__PURE__ */ (0,
|
|
1489
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1387
1490
|
className: "flex gap-2",
|
|
1388
|
-
children: [/* @__PURE__ */ (0,
|
|
1491
|
+
children: [/* @__PURE__ */ (0, W.jsx)(h, {
|
|
1389
1492
|
id: e.name,
|
|
1390
1493
|
name: e.name,
|
|
1391
1494
|
value: e.state.value,
|
|
@@ -1393,30 +1496,30 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1393
1496
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1394
1497
|
placeholder: r("editor.httpConfigForm.apiUrlPlaceholder"),
|
|
1395
1498
|
className: "flex-1"
|
|
1396
|
-
}), /* @__PURE__ */ (0,
|
|
1499
|
+
}), /* @__PURE__ */ (0, W.jsxs)(J, { children: [/* @__PURE__ */ (0, W.jsx)(Y, {
|
|
1397
1500
|
asChild: !0,
|
|
1398
|
-
children: /* @__PURE__ */ (0,
|
|
1501
|
+
children: /* @__PURE__ */ (0, W.jsx)(m, {
|
|
1399
1502
|
type: "button",
|
|
1400
1503
|
variant: "outline",
|
|
1401
1504
|
size: "icon",
|
|
1402
|
-
children: /* @__PURE__ */ (0,
|
|
1505
|
+
children: /* @__PURE__ */ (0, W.jsx)(Ze, { className: "h-4 w-4" })
|
|
1403
1506
|
})
|
|
1404
|
-
}), /* @__PURE__ */ (0,
|
|
1507
|
+
}), /* @__PURE__ */ (0, W.jsx)(X, {
|
|
1405
1508
|
align: "end",
|
|
1406
|
-
children: i.length === 0 ? /* @__PURE__ */ (0,
|
|
1509
|
+
children: i.length === 0 ? /* @__PURE__ */ (0, W.jsx)(Z, {
|
|
1407
1510
|
disabled: !0,
|
|
1408
1511
|
children: r("editor.httpConfigForm.noFieldsAvailable")
|
|
1409
|
-
}) : i.map((t) => /* @__PURE__ */ (0,
|
|
1512
|
+
}) : i.map((t) => /* @__PURE__ */ (0, W.jsx)(Z, {
|
|
1410
1513
|
onClick: () => {
|
|
1411
1514
|
let n = `{{${t.nodeId}}}`, r = e.state.value || "";
|
|
1412
1515
|
e.handleChange(r + n);
|
|
1413
1516
|
},
|
|
1414
|
-
children: /* @__PURE__ */ (0,
|
|
1517
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1415
1518
|
className: "flex flex-col",
|
|
1416
|
-
children: [/* @__PURE__ */ (0,
|
|
1519
|
+
children: [/* @__PURE__ */ (0, W.jsx)("span", {
|
|
1417
1520
|
className: "font-medium",
|
|
1418
1521
|
children: t.label
|
|
1419
|
-
}), /* @__PURE__ */ (0,
|
|
1522
|
+
}), /* @__PURE__ */ (0, W.jsx)("span", {
|
|
1420
1523
|
className: "text-muted-foreground text-xs",
|
|
1421
1524
|
children: `{{${t.nodeId}}}`
|
|
1422
1525
|
})]
|
|
@@ -1424,87 +1527,87 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1424
1527
|
}, t.nodeId))
|
|
1425
1528
|
})] })]
|
|
1426
1529
|
}),
|
|
1427
|
-
/* @__PURE__ */ (0,
|
|
1530
|
+
/* @__PURE__ */ (0, W.jsx)(E, { children: r("editor.httpConfigForm.apiUrlDesc") })
|
|
1428
1531
|
] })
|
|
1429
1532
|
}),
|
|
1430
|
-
/* @__PURE__ */ (0,
|
|
1533
|
+
/* @__PURE__ */ (0, W.jsx)(o, {
|
|
1431
1534
|
name: "method",
|
|
1432
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1535
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
1433
1536
|
htmlFor: e.name,
|
|
1434
1537
|
children: r("editor.httpConfigForm.httpMethod")
|
|
1435
|
-
}), /* @__PURE__ */ (0,
|
|
1538
|
+
}), /* @__PURE__ */ (0, W.jsxs)(y, {
|
|
1436
1539
|
value: e.state.value,
|
|
1437
1540
|
onValueChange: (t) => e.handleChange(t),
|
|
1438
|
-
children: [/* @__PURE__ */ (0,
|
|
1541
|
+
children: [/* @__PURE__ */ (0, W.jsx)(_, {
|
|
1439
1542
|
id: e.name,
|
|
1440
|
-
children: /* @__PURE__ */ (0,
|
|
1441
|
-
}), /* @__PURE__ */ (0,
|
|
1442
|
-
/* @__PURE__ */ (0,
|
|
1543
|
+
children: /* @__PURE__ */ (0, W.jsx)(l, { placeholder: r("editor.httpConfigForm.selectMethod") })
|
|
1544
|
+
}), /* @__PURE__ */ (0, W.jsxs)(j, { children: [
|
|
1545
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
1443
1546
|
value: "GET",
|
|
1444
1547
|
children: r("editor.httpConfigForm.methodGet")
|
|
1445
1548
|
}),
|
|
1446
|
-
/* @__PURE__ */ (0,
|
|
1549
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
1447
1550
|
value: "POST",
|
|
1448
1551
|
children: r("editor.httpConfigForm.methodPost")
|
|
1449
1552
|
}),
|
|
1450
|
-
/* @__PURE__ */ (0,
|
|
1553
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
1451
1554
|
value: "PUT",
|
|
1452
1555
|
children: r("editor.httpConfigForm.methodPut")
|
|
1453
1556
|
}),
|
|
1454
|
-
/* @__PURE__ */ (0,
|
|
1557
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
1455
1558
|
value: "DELETE",
|
|
1456
1559
|
children: r("editor.httpConfigForm.methodDelete")
|
|
1457
1560
|
}),
|
|
1458
|
-
/* @__PURE__ */ (0,
|
|
1561
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
1459
1562
|
value: "PATCH",
|
|
1460
1563
|
children: r("editor.httpConfigForm.methodPatch")
|
|
1461
1564
|
})
|
|
1462
1565
|
] })]
|
|
1463
1566
|
})] })
|
|
1464
1567
|
}),
|
|
1465
|
-
/* @__PURE__ */ (0,
|
|
1568
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1466
1569
|
className: "space-y-4",
|
|
1467
|
-
children: [/* @__PURE__ */ (0,
|
|
1570
|
+
children: [/* @__PURE__ */ (0, W.jsx)("h4", {
|
|
1468
1571
|
className: "font-semibold text-sm",
|
|
1469
1572
|
children: r("editor.httpConfigForm.headers")
|
|
1470
|
-
}), /* @__PURE__ */ (0,
|
|
1573
|
+
}), /* @__PURE__ */ (0, W.jsx)(o, {
|
|
1471
1574
|
name: "headers",
|
|
1472
1575
|
mode: "array",
|
|
1473
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1576
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1474
1577
|
className: "space-y-2",
|
|
1475
1578
|
children: [e.state.value?.map((t, n) => {
|
|
1476
1579
|
let i = `headers[${n}]`;
|
|
1477
|
-
return /* @__PURE__ */ (0,
|
|
1580
|
+
return /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1478
1581
|
className: "flex items-start gap-2",
|
|
1479
1582
|
children: [
|
|
1480
|
-
/* @__PURE__ */ (0,
|
|
1583
|
+
/* @__PURE__ */ (0, W.jsx)(o, {
|
|
1481
1584
|
name: `headers[${n}].key`,
|
|
1482
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1585
|
+
children: (e) => /* @__PURE__ */ (0, W.jsx)(h, {
|
|
1483
1586
|
placeholder: r("editor.httpConfigForm.headerName"),
|
|
1484
1587
|
value: e.state.value || "",
|
|
1485
1588
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
1486
1589
|
})
|
|
1487
1590
|
}),
|
|
1488
|
-
/* @__PURE__ */ (0,
|
|
1591
|
+
/* @__PURE__ */ (0, W.jsx)(o, {
|
|
1489
1592
|
name: `headers[${n}].value`,
|
|
1490
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1593
|
+
children: (e) => /* @__PURE__ */ (0, W.jsx)(h, {
|
|
1491
1594
|
placeholder: r("editor.httpConfigForm.headerValue"),
|
|
1492
1595
|
value: e.state.value || "",
|
|
1493
1596
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
1494
1597
|
})
|
|
1495
1598
|
}),
|
|
1496
|
-
/* @__PURE__ */ (0,
|
|
1599
|
+
/* @__PURE__ */ (0, W.jsx)(m, {
|
|
1497
1600
|
type: "button",
|
|
1498
1601
|
variant: "ghost",
|
|
1499
1602
|
size: "icon",
|
|
1500
1603
|
onClick: () => {
|
|
1501
1604
|
e.removeValue(n);
|
|
1502
1605
|
},
|
|
1503
|
-
children: /* @__PURE__ */ (0,
|
|
1606
|
+
children: /* @__PURE__ */ (0, W.jsx)(z, { className: "h-4 w-4" })
|
|
1504
1607
|
})
|
|
1505
1608
|
]
|
|
1506
1609
|
}, i);
|
|
1507
|
-
}), /* @__PURE__ */ (0,
|
|
1610
|
+
}), /* @__PURE__ */ (0, W.jsxs)(m, {
|
|
1508
1611
|
type: "button",
|
|
1509
1612
|
variant: "outline",
|
|
1510
1613
|
size: "sm",
|
|
@@ -1514,64 +1617,64 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1514
1617
|
value: ""
|
|
1515
1618
|
});
|
|
1516
1619
|
},
|
|
1517
|
-
children: [/* @__PURE__ */ (0,
|
|
1620
|
+
children: [/* @__PURE__ */ (0, W.jsx)(R, { className: "mr-2 h-4 w-4" }), r("editor.httpConfigForm.addHeader")]
|
|
1518
1621
|
})]
|
|
1519
1622
|
})
|
|
1520
1623
|
})]
|
|
1521
1624
|
}),
|
|
1522
|
-
/* @__PURE__ */ (0,
|
|
1625
|
+
/* @__PURE__ */ (0, W.jsx)(s, {
|
|
1523
1626
|
selector: (e) => ({
|
|
1524
1627
|
method: e.values.method,
|
|
1525
1628
|
sendAllFormValues: e.values.sendAllFormValues
|
|
1526
1629
|
}),
|
|
1527
|
-
children: ({ method: e, sendAllFormValues: t }) =>
|
|
1630
|
+
children: ({ method: e, sendAllFormValues: t }) => tn.includes(e || "") && /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1528
1631
|
className: "space-y-4",
|
|
1529
|
-
children: [/* @__PURE__ */ (0,
|
|
1632
|
+
children: [/* @__PURE__ */ (0, W.jsx)(o, {
|
|
1530
1633
|
name: "sendAllFormValues",
|
|
1531
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1634
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1532
1635
|
className: "flex items-center space-x-2",
|
|
1533
|
-
children: [/* @__PURE__ */ (0,
|
|
1636
|
+
children: [/* @__PURE__ */ (0, W.jsx)(S, {
|
|
1534
1637
|
id: e.name,
|
|
1535
1638
|
checked: e.state.value,
|
|
1536
1639
|
onCheckedChange: (t) => e.handleChange(t)
|
|
1537
|
-
}), /* @__PURE__ */ (0,
|
|
1640
|
+
}), /* @__PURE__ */ (0, W.jsx)(u, {
|
|
1538
1641
|
htmlFor: e.name,
|
|
1539
1642
|
children: r("editor.httpConfigForm.sendAllFormValues")
|
|
1540
1643
|
})]
|
|
1541
1644
|
})
|
|
1542
|
-
}), /* @__PURE__ */ (0,
|
|
1645
|
+
}), /* @__PURE__ */ (0, W.jsx)(o, {
|
|
1543
1646
|
name: "body",
|
|
1544
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1545
|
-
/* @__PURE__ */ (0,
|
|
1647
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [
|
|
1648
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1546
1649
|
className: "mb-2 flex items-center justify-between",
|
|
1547
|
-
children: [/* @__PURE__ */ (0,
|
|
1650
|
+
children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
1548
1651
|
htmlFor: e.name,
|
|
1549
1652
|
children: r("editor.httpConfigForm.requestBody")
|
|
1550
|
-
}), /* @__PURE__ */ (0,
|
|
1653
|
+
}), /* @__PURE__ */ (0, W.jsxs)(J, { children: [/* @__PURE__ */ (0, W.jsx)(Y, {
|
|
1551
1654
|
asChild: !0,
|
|
1552
|
-
children: /* @__PURE__ */ (0,
|
|
1655
|
+
children: /* @__PURE__ */ (0, W.jsxs)(m, {
|
|
1553
1656
|
type: "button",
|
|
1554
1657
|
variant: "ghost",
|
|
1555
1658
|
size: "sm",
|
|
1556
1659
|
disabled: t,
|
|
1557
|
-
children: [/* @__PURE__ */ (0,
|
|
1660
|
+
children: [/* @__PURE__ */ (0, W.jsx)(Ze, { className: "mr-2 h-4 w-4" }), r("editor.httpConfigForm.insertVariable")]
|
|
1558
1661
|
})
|
|
1559
|
-
}), /* @__PURE__ */ (0,
|
|
1662
|
+
}), /* @__PURE__ */ (0, W.jsx)(X, {
|
|
1560
1663
|
align: "end",
|
|
1561
|
-
children: i.length === 0 ? /* @__PURE__ */ (0,
|
|
1664
|
+
children: i.length === 0 ? /* @__PURE__ */ (0, W.jsx)(Z, {
|
|
1562
1665
|
disabled: !0,
|
|
1563
1666
|
children: r("editor.httpConfigForm.noFieldsAvailable")
|
|
1564
|
-
}) : i.map((t) => /* @__PURE__ */ (0,
|
|
1667
|
+
}) : i.map((t) => /* @__PURE__ */ (0, W.jsx)(Z, {
|
|
1565
1668
|
onClick: () => {
|
|
1566
1669
|
let n = `{{${t.nodeId}}}`, r = e.state.value || "";
|
|
1567
1670
|
e.handleChange(r + n), a().then();
|
|
1568
1671
|
},
|
|
1569
|
-
children: /* @__PURE__ */ (0,
|
|
1672
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1570
1673
|
className: "flex flex-col",
|
|
1571
|
-
children: [/* @__PURE__ */ (0,
|
|
1674
|
+
children: [/* @__PURE__ */ (0, W.jsx)("span", {
|
|
1572
1675
|
className: "font-medium",
|
|
1573
1676
|
children: t.label
|
|
1574
|
-
}), /* @__PURE__ */ (0,
|
|
1677
|
+
}), /* @__PURE__ */ (0, W.jsx)("span", {
|
|
1575
1678
|
className: "text-muted-foreground text-xs",
|
|
1576
1679
|
children: `{{${t.nodeId}}}`
|
|
1577
1680
|
})]
|
|
@@ -1579,7 +1682,7 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1579
1682
|
}, t.nodeId))
|
|
1580
1683
|
})] })]
|
|
1581
1684
|
}),
|
|
1582
|
-
/* @__PURE__ */ (0,
|
|
1685
|
+
/* @__PURE__ */ (0, W.jsx)(D, {
|
|
1583
1686
|
id: e.name,
|
|
1584
1687
|
name: e.name,
|
|
1585
1688
|
value: e.state.value,
|
|
@@ -1589,26 +1692,26 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1589
1692
|
rows: 4,
|
|
1590
1693
|
disabled: t
|
|
1591
1694
|
}),
|
|
1592
|
-
/* @__PURE__ */ (0,
|
|
1695
|
+
/* @__PURE__ */ (0, W.jsx)(E, { children: r(t ? "editor.httpConfigForm.sendAllFormValuesDesc" : "editor.httpConfigForm.requestBodyDesc") })
|
|
1593
1696
|
] })
|
|
1594
1697
|
})]
|
|
1595
1698
|
})
|
|
1596
1699
|
}),
|
|
1597
|
-
/* @__PURE__ */ (0,
|
|
1700
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1598
1701
|
className: "space-y-4",
|
|
1599
1702
|
children: [
|
|
1600
|
-
/* @__PURE__ */ (0,
|
|
1703
|
+
/* @__PURE__ */ (0, W.jsx)("h4", {
|
|
1601
1704
|
className: "font-semibold text-sm",
|
|
1602
1705
|
children: r("editor.httpConfigForm.responseConfiguration")
|
|
1603
1706
|
}),
|
|
1604
|
-
/* @__PURE__ */ (0,
|
|
1707
|
+
/* @__PURE__ */ (0, W.jsx)(o, {
|
|
1605
1708
|
name: "responsePath",
|
|
1606
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1607
|
-
/* @__PURE__ */ (0,
|
|
1709
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [
|
|
1710
|
+
/* @__PURE__ */ (0, W.jsx)(u, {
|
|
1608
1711
|
htmlFor: e.name,
|
|
1609
1712
|
children: r("editor.httpConfigForm.responsePath")
|
|
1610
1713
|
}),
|
|
1611
|
-
/* @__PURE__ */ (0,
|
|
1714
|
+
/* @__PURE__ */ (0, W.jsx)(h, {
|
|
1612
1715
|
id: e.name,
|
|
1613
1716
|
name: e.name,
|
|
1614
1717
|
value: e.state.value,
|
|
@@ -1616,24 +1719,24 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1616
1719
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1617
1720
|
placeholder: r("editor.httpConfigForm.responsePathPlaceholder")
|
|
1618
1721
|
}),
|
|
1619
|
-
/* @__PURE__ */ (0,
|
|
1722
|
+
/* @__PURE__ */ (0, W.jsx)(E, { children: r("editor.httpConfigForm.responsePathDesc") })
|
|
1620
1723
|
] })
|
|
1621
1724
|
}),
|
|
1622
|
-
/* @__PURE__ */ (0,
|
|
1725
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1623
1726
|
className: "space-y-4",
|
|
1624
1727
|
children: [
|
|
1625
|
-
/* @__PURE__ */ (0,
|
|
1728
|
+
/* @__PURE__ */ (0, W.jsx)("h5", {
|
|
1626
1729
|
className: "font-medium text-sm",
|
|
1627
1730
|
children: r("editor.httpConfigForm.mapToOptions")
|
|
1628
1731
|
}),
|
|
1629
|
-
/* @__PURE__ */ (0,
|
|
1732
|
+
/* @__PURE__ */ (0, W.jsx)(o, {
|
|
1630
1733
|
name: "responseMapping.valueField",
|
|
1631
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1632
|
-
/* @__PURE__ */ (0,
|
|
1734
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [
|
|
1735
|
+
/* @__PURE__ */ (0, W.jsx)(u, {
|
|
1633
1736
|
htmlFor: e.name,
|
|
1634
1737
|
children: r("editor.httpConfigForm.valueField")
|
|
1635
1738
|
}),
|
|
1636
|
-
/* @__PURE__ */ (0,
|
|
1739
|
+
/* @__PURE__ */ (0, W.jsx)(h, {
|
|
1637
1740
|
id: e.name,
|
|
1638
1741
|
name: e.name,
|
|
1639
1742
|
value: e.state.value,
|
|
@@ -1641,17 +1744,17 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1641
1744
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1642
1745
|
placeholder: r("editor.httpConfigForm.valueFieldPlaceholder")
|
|
1643
1746
|
}),
|
|
1644
|
-
/* @__PURE__ */ (0,
|
|
1747
|
+
/* @__PURE__ */ (0, W.jsx)(E, { children: r("editor.httpConfigForm.valueFieldDesc") })
|
|
1645
1748
|
] })
|
|
1646
1749
|
}),
|
|
1647
|
-
/* @__PURE__ */ (0,
|
|
1750
|
+
/* @__PURE__ */ (0, W.jsx)(o, {
|
|
1648
1751
|
name: "responseMapping.labelField",
|
|
1649
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1650
|
-
/* @__PURE__ */ (0,
|
|
1752
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [
|
|
1753
|
+
/* @__PURE__ */ (0, W.jsx)(u, {
|
|
1651
1754
|
htmlFor: e.name,
|
|
1652
1755
|
children: r("editor.httpConfigForm.labelField")
|
|
1653
1756
|
}),
|
|
1654
|
-
/* @__PURE__ */ (0,
|
|
1757
|
+
/* @__PURE__ */ (0, W.jsx)(h, {
|
|
1655
1758
|
id: e.name,
|
|
1656
1759
|
name: e.name,
|
|
1657
1760
|
value: e.state.value,
|
|
@@ -1659,19 +1762,19 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1659
1762
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1660
1763
|
placeholder: r("editor.httpConfigForm.labelFieldPlaceholder")
|
|
1661
1764
|
}),
|
|
1662
|
-
/* @__PURE__ */ (0,
|
|
1765
|
+
/* @__PURE__ */ (0, W.jsx)(E, { children: r("editor.httpConfigForm.labelFieldDesc") })
|
|
1663
1766
|
] })
|
|
1664
1767
|
})
|
|
1665
1768
|
]
|
|
1666
1769
|
}),
|
|
1667
|
-
/* @__PURE__ */ (0,
|
|
1770
|
+
/* @__PURE__ */ (0, W.jsx)(o, {
|
|
1668
1771
|
name: "searchParam",
|
|
1669
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1670
|
-
/* @__PURE__ */ (0,
|
|
1772
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [
|
|
1773
|
+
/* @__PURE__ */ (0, W.jsx)(u, {
|
|
1671
1774
|
htmlFor: e.name,
|
|
1672
1775
|
children: r("editor.httpConfigForm.searchParameter")
|
|
1673
1776
|
}),
|
|
1674
|
-
/* @__PURE__ */ (0,
|
|
1777
|
+
/* @__PURE__ */ (0, W.jsx)(h, {
|
|
1675
1778
|
id: e.name,
|
|
1676
1779
|
name: e.name,
|
|
1677
1780
|
value: e.state.value,
|
|
@@ -1679,32 +1782,32 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1679
1782
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1680
1783
|
placeholder: r("editor.httpConfigForm.searchParameterPlaceholder")
|
|
1681
1784
|
}),
|
|
1682
|
-
/* @__PURE__ */ (0,
|
|
1785
|
+
/* @__PURE__ */ (0, W.jsx)(E, { children: r("editor.httpConfigForm.searchParameterDesc") })
|
|
1683
1786
|
] })
|
|
1684
1787
|
})
|
|
1685
1788
|
]
|
|
1686
1789
|
}),
|
|
1687
|
-
/* @__PURE__ */ (0,
|
|
1790
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1688
1791
|
className: "space-y-4",
|
|
1689
1792
|
children: [
|
|
1690
|
-
/* @__PURE__ */ (0,
|
|
1793
|
+
/* @__PURE__ */ (0, W.jsx)("h4", {
|
|
1691
1794
|
className: "font-semibold text-sm",
|
|
1692
1795
|
children: r("editor.httpConfigForm.behavior")
|
|
1693
1796
|
}),
|
|
1694
|
-
/* @__PURE__ */ (0,
|
|
1797
|
+
/* @__PURE__ */ (0, W.jsx)(s, {
|
|
1695
1798
|
selector: (e) => e.values.searchParam,
|
|
1696
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1799
|
+
children: (e) => /* @__PURE__ */ (0, W.jsx)(o, {
|
|
1697
1800
|
name: "fetchOnMount",
|
|
1698
1801
|
children: (t) => {
|
|
1699
1802
|
let n = !!e?.trim(), i = n ? t.state.value : !0;
|
|
1700
|
-
return !n && t.state.value !== !0 && t.handleChange(!0), /* @__PURE__ */ (0,
|
|
1803
|
+
return !n && t.state.value !== !0 && t.handleChange(!0), /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1701
1804
|
className: "flex items-center space-x-2",
|
|
1702
|
-
children: [/* @__PURE__ */ (0,
|
|
1805
|
+
children: [/* @__PURE__ */ (0, W.jsx)(S, {
|
|
1703
1806
|
id: t.name,
|
|
1704
1807
|
checked: i,
|
|
1705
1808
|
disabled: !n,
|
|
1706
1809
|
onCheckedChange: (e) => t.handleChange(e)
|
|
1707
|
-
}), /* @__PURE__ */ (0,
|
|
1810
|
+
}), /* @__PURE__ */ (0, W.jsx)(u, {
|
|
1708
1811
|
htmlFor: t.name,
|
|
1709
1812
|
className: n ? "" : "text-muted-foreground",
|
|
1710
1813
|
children: r("editor.httpConfigForm.fetchOnMount")
|
|
@@ -1713,15 +1816,15 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1713
1816
|
}
|
|
1714
1817
|
})
|
|
1715
1818
|
}),
|
|
1716
|
-
/* @__PURE__ */ (0,
|
|
1819
|
+
/* @__PURE__ */ (0, W.jsx)(o, {
|
|
1717
1820
|
name: "showLoading",
|
|
1718
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1821
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1719
1822
|
className: "flex items-center space-x-2",
|
|
1720
|
-
children: [/* @__PURE__ */ (0,
|
|
1823
|
+
children: [/* @__PURE__ */ (0, W.jsx)(S, {
|
|
1721
1824
|
id: e.name,
|
|
1722
1825
|
checked: e.state.value,
|
|
1723
1826
|
onCheckedChange: (t) => e.handleChange(t)
|
|
1724
|
-
}), /* @__PURE__ */ (0,
|
|
1827
|
+
}), /* @__PURE__ */ (0, W.jsx)(u, {
|
|
1725
1828
|
htmlFor: e.name,
|
|
1726
1829
|
children: r("editor.httpConfigForm.showLoadingState")
|
|
1727
1830
|
})]
|
|
@@ -1731,12 +1834,12 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1731
1834
|
})
|
|
1732
1835
|
]
|
|
1733
1836
|
}) });
|
|
1734
|
-
},
|
|
1837
|
+
}, rn = [
|
|
1735
1838
|
"POST",
|
|
1736
1839
|
"PUT",
|
|
1737
1840
|
"PATCH"
|
|
1738
|
-
],
|
|
1739
|
-
let [n, r] =
|
|
1841
|
+
], an = ({ value: e, onChange: t }) => {
|
|
1842
|
+
let [n, r] = F("en"), { selectedNode: i } = $(), a = G(), o = ut(i?.id), { handleSubmit: s, Field: c, Subscribe: d } = I({
|
|
1740
1843
|
defaultValues: {
|
|
1741
1844
|
body: e?.body || "",
|
|
1742
1845
|
errorMessage: e?.errorMessage || { en: "" },
|
|
@@ -1758,19 +1861,19 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1758
1861
|
t(e);
|
|
1759
1862
|
}
|
|
1760
1863
|
});
|
|
1761
|
-
return /* @__PURE__ */ (0,
|
|
1864
|
+
return /* @__PURE__ */ (0, W.jsx)("div", { children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1762
1865
|
className: "grid gap-6",
|
|
1763
1866
|
children: [
|
|
1764
|
-
/* @__PURE__ */ (0,
|
|
1867
|
+
/* @__PURE__ */ (0, W.jsx)(c, {
|
|
1765
1868
|
name: "url",
|
|
1766
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1767
|
-
/* @__PURE__ */ (0,
|
|
1869
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [
|
|
1870
|
+
/* @__PURE__ */ (0, W.jsx)(u, {
|
|
1768
1871
|
htmlFor: e.name,
|
|
1769
1872
|
children: a("editor.submitConfigForm.apiUrl")
|
|
1770
1873
|
}),
|
|
1771
|
-
/* @__PURE__ */ (0,
|
|
1874
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1772
1875
|
className: "flex gap-2",
|
|
1773
|
-
children: [/* @__PURE__ */ (0,
|
|
1876
|
+
children: [/* @__PURE__ */ (0, W.jsx)(h, {
|
|
1774
1877
|
id: e.name,
|
|
1775
1878
|
name: e.name,
|
|
1776
1879
|
value: e.state.value,
|
|
@@ -1778,30 +1881,30 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1778
1881
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1779
1882
|
placeholder: a("editor.submitConfigForm.apiUrlPlaceholder"),
|
|
1780
1883
|
className: "flex-1"
|
|
1781
|
-
}), /* @__PURE__ */ (0,
|
|
1884
|
+
}), /* @__PURE__ */ (0, W.jsxs)(J, { children: [/* @__PURE__ */ (0, W.jsx)(Y, {
|
|
1782
1885
|
asChild: !0,
|
|
1783
|
-
children: /* @__PURE__ */ (0,
|
|
1886
|
+
children: /* @__PURE__ */ (0, W.jsx)(m, {
|
|
1784
1887
|
type: "button",
|
|
1785
1888
|
variant: "outline",
|
|
1786
1889
|
size: "icon",
|
|
1787
|
-
children: /* @__PURE__ */ (0,
|
|
1890
|
+
children: /* @__PURE__ */ (0, W.jsx)(Ze, { className: "h-4 w-4" })
|
|
1788
1891
|
})
|
|
1789
|
-
}), /* @__PURE__ */ (0,
|
|
1892
|
+
}), /* @__PURE__ */ (0, W.jsx)(X, {
|
|
1790
1893
|
align: "end",
|
|
1791
|
-
children: o.length === 0 ? /* @__PURE__ */ (0,
|
|
1894
|
+
children: o.length === 0 ? /* @__PURE__ */ (0, W.jsx)(Z, {
|
|
1792
1895
|
disabled: !0,
|
|
1793
1896
|
children: a("editor.submitConfigForm.noFieldsAvailable")
|
|
1794
|
-
}) : o.map((t) => /* @__PURE__ */ (0,
|
|
1897
|
+
}) : o.map((t) => /* @__PURE__ */ (0, W.jsx)(Z, {
|
|
1795
1898
|
onClick: () => {
|
|
1796
1899
|
let n = `{{${t.nodeId}}}`, r = e.state.value || "";
|
|
1797
1900
|
e.handleChange(r + n);
|
|
1798
1901
|
},
|
|
1799
|
-
children: /* @__PURE__ */ (0,
|
|
1902
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1800
1903
|
className: "flex flex-col",
|
|
1801
|
-
children: [/* @__PURE__ */ (0,
|
|
1904
|
+
children: [/* @__PURE__ */ (0, W.jsx)("span", {
|
|
1802
1905
|
className: "font-medium",
|
|
1803
1906
|
children: t.label
|
|
1804
|
-
}), /* @__PURE__ */ (0,
|
|
1907
|
+
}), /* @__PURE__ */ (0, W.jsx)("span", {
|
|
1805
1908
|
className: "text-muted-foreground text-xs",
|
|
1806
1909
|
children: `{{${t.nodeId}}}`
|
|
1807
1910
|
})]
|
|
@@ -1809,83 +1912,83 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1809
1912
|
}, t.nodeId))
|
|
1810
1913
|
})] })]
|
|
1811
1914
|
}),
|
|
1812
|
-
/* @__PURE__ */ (0,
|
|
1915
|
+
/* @__PURE__ */ (0, W.jsx)(E, { children: a("editor.submitConfigForm.apiUrlDesc") })
|
|
1813
1916
|
] })
|
|
1814
1917
|
}),
|
|
1815
|
-
/* @__PURE__ */ (0,
|
|
1918
|
+
/* @__PURE__ */ (0, W.jsx)(c, {
|
|
1816
1919
|
name: "method",
|
|
1817
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1920
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
1818
1921
|
htmlFor: e.name,
|
|
1819
1922
|
children: a("editor.submitConfigForm.httpMethod")
|
|
1820
|
-
}), /* @__PURE__ */ (0,
|
|
1923
|
+
}), /* @__PURE__ */ (0, W.jsxs)(y, {
|
|
1821
1924
|
value: e.state.value,
|
|
1822
1925
|
onValueChange: (t) => e.handleChange(t),
|
|
1823
|
-
children: [/* @__PURE__ */ (0,
|
|
1926
|
+
children: [/* @__PURE__ */ (0, W.jsx)(_, {
|
|
1824
1927
|
id: e.name,
|
|
1825
|
-
children: /* @__PURE__ */ (0,
|
|
1826
|
-
}), /* @__PURE__ */ (0,
|
|
1827
|
-
/* @__PURE__ */ (0,
|
|
1928
|
+
children: /* @__PURE__ */ (0, W.jsx)(l, { placeholder: a("editor.submitConfigForm.selectMethod") })
|
|
1929
|
+
}), /* @__PURE__ */ (0, W.jsxs)(j, { children: [
|
|
1930
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
1828
1931
|
value: "POST",
|
|
1829
1932
|
children: a("editor.submitConfigForm.methodPost")
|
|
1830
1933
|
}),
|
|
1831
|
-
/* @__PURE__ */ (0,
|
|
1934
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
1832
1935
|
value: "PUT",
|
|
1833
1936
|
children: a("editor.submitConfigForm.methodPut")
|
|
1834
1937
|
}),
|
|
1835
|
-
/* @__PURE__ */ (0,
|
|
1938
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
1836
1939
|
value: "DELETE",
|
|
1837
1940
|
children: a("editor.submitConfigForm.methodDelete")
|
|
1838
1941
|
}),
|
|
1839
|
-
/* @__PURE__ */ (0,
|
|
1942
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
1840
1943
|
value: "PATCH",
|
|
1841
1944
|
children: a("editor.submitConfigForm.methodPatch")
|
|
1842
1945
|
})
|
|
1843
1946
|
] })]
|
|
1844
1947
|
})] })
|
|
1845
1948
|
}),
|
|
1846
|
-
/* @__PURE__ */ (0,
|
|
1949
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1847
1950
|
className: "space-y-4",
|
|
1848
|
-
children: [/* @__PURE__ */ (0,
|
|
1951
|
+
children: [/* @__PURE__ */ (0, W.jsx)("h4", {
|
|
1849
1952
|
className: "font-semibold text-sm",
|
|
1850
1953
|
children: a("editor.submitConfigForm.headers")
|
|
1851
|
-
}), /* @__PURE__ */ (0,
|
|
1954
|
+
}), /* @__PURE__ */ (0, W.jsx)(c, {
|
|
1852
1955
|
name: "headers",
|
|
1853
1956
|
mode: "array",
|
|
1854
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1957
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1855
1958
|
className: "space-y-2",
|
|
1856
1959
|
children: [e.state.value?.map((t, n) => {
|
|
1857
1960
|
let r = `headers[${n}]`;
|
|
1858
|
-
return /* @__PURE__ */ (0,
|
|
1961
|
+
return /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1859
1962
|
className: "flex items-start gap-2",
|
|
1860
1963
|
children: [
|
|
1861
|
-
/* @__PURE__ */ (0,
|
|
1964
|
+
/* @__PURE__ */ (0, W.jsx)(c, {
|
|
1862
1965
|
name: `headers[${n}].key`,
|
|
1863
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1966
|
+
children: (e) => /* @__PURE__ */ (0, W.jsx)(h, {
|
|
1864
1967
|
placeholder: a("editor.submitConfigForm.headerName"),
|
|
1865
1968
|
value: e.state.value || "",
|
|
1866
1969
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
1867
1970
|
})
|
|
1868
1971
|
}),
|
|
1869
|
-
/* @__PURE__ */ (0,
|
|
1972
|
+
/* @__PURE__ */ (0, W.jsx)(c, {
|
|
1870
1973
|
name: `headers[${n}].value`,
|
|
1871
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1974
|
+
children: (e) => /* @__PURE__ */ (0, W.jsx)(h, {
|
|
1872
1975
|
placeholder: a("editor.submitConfigForm.headerValue"),
|
|
1873
1976
|
value: e.state.value || "",
|
|
1874
1977
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
1875
1978
|
})
|
|
1876
1979
|
}),
|
|
1877
|
-
/* @__PURE__ */ (0,
|
|
1980
|
+
/* @__PURE__ */ (0, W.jsx)(m, {
|
|
1878
1981
|
type: "button",
|
|
1879
1982
|
variant: "ghost",
|
|
1880
1983
|
size: "icon",
|
|
1881
1984
|
onClick: () => {
|
|
1882
1985
|
e.removeValue(n);
|
|
1883
1986
|
},
|
|
1884
|
-
children: /* @__PURE__ */ (0,
|
|
1987
|
+
children: /* @__PURE__ */ (0, W.jsx)(z, { className: "h-4 w-4" })
|
|
1885
1988
|
})
|
|
1886
1989
|
]
|
|
1887
1990
|
}, r);
|
|
1888
|
-
}), /* @__PURE__ */ (0,
|
|
1991
|
+
}), /* @__PURE__ */ (0, W.jsxs)(m, {
|
|
1889
1992
|
type: "button",
|
|
1890
1993
|
variant: "outline",
|
|
1891
1994
|
size: "sm",
|
|
@@ -1895,64 +1998,64 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1895
1998
|
value: ""
|
|
1896
1999
|
});
|
|
1897
2000
|
},
|
|
1898
|
-
children: [/* @__PURE__ */ (0,
|
|
2001
|
+
children: [/* @__PURE__ */ (0, W.jsx)(R, { className: "mr-2 h-4 w-4" }), a("editor.submitConfigForm.addHeader")]
|
|
1899
2002
|
})]
|
|
1900
2003
|
})
|
|
1901
2004
|
})]
|
|
1902
2005
|
}),
|
|
1903
|
-
/* @__PURE__ */ (0,
|
|
2006
|
+
/* @__PURE__ */ (0, W.jsx)(d, {
|
|
1904
2007
|
selector: (e) => ({
|
|
1905
2008
|
method: e.values.method,
|
|
1906
2009
|
sendAllFormValues: e.values.sendAllFormValues
|
|
1907
2010
|
}),
|
|
1908
|
-
children: ({ method: e, sendAllFormValues: t }) =>
|
|
2011
|
+
children: ({ method: e, sendAllFormValues: t }) => rn.includes(e || "") && /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1909
2012
|
className: "space-y-4",
|
|
1910
|
-
children: [/* @__PURE__ */ (0,
|
|
2013
|
+
children: [/* @__PURE__ */ (0, W.jsx)(c, {
|
|
1911
2014
|
name: "sendAllFormValues",
|
|
1912
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2015
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1913
2016
|
className: "flex items-center space-x-2",
|
|
1914
|
-
children: [/* @__PURE__ */ (0,
|
|
2017
|
+
children: [/* @__PURE__ */ (0, W.jsx)(S, {
|
|
1915
2018
|
id: e.name,
|
|
1916
2019
|
checked: e.state.value,
|
|
1917
2020
|
onCheckedChange: (t) => e.handleChange(t)
|
|
1918
|
-
}), /* @__PURE__ */ (0,
|
|
2021
|
+
}), /* @__PURE__ */ (0, W.jsx)(u, {
|
|
1919
2022
|
htmlFor: e.name,
|
|
1920
2023
|
children: a("editor.submitConfigForm.sendAllFormValues")
|
|
1921
2024
|
})]
|
|
1922
2025
|
})
|
|
1923
|
-
}), /* @__PURE__ */ (0,
|
|
2026
|
+
}), /* @__PURE__ */ (0, W.jsx)(c, {
|
|
1924
2027
|
name: "body",
|
|
1925
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1926
|
-
/* @__PURE__ */ (0,
|
|
2028
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [
|
|
2029
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1927
2030
|
className: "mb-2 flex items-center justify-between",
|
|
1928
|
-
children: [/* @__PURE__ */ (0,
|
|
2031
|
+
children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
1929
2032
|
htmlFor: e.name,
|
|
1930
2033
|
children: a("editor.submitConfigForm.requestBody")
|
|
1931
|
-
}), /* @__PURE__ */ (0,
|
|
2034
|
+
}), /* @__PURE__ */ (0, W.jsxs)(J, { children: [/* @__PURE__ */ (0, W.jsx)(Y, {
|
|
1932
2035
|
asChild: !0,
|
|
1933
|
-
children: /* @__PURE__ */ (0,
|
|
2036
|
+
children: /* @__PURE__ */ (0, W.jsxs)(m, {
|
|
1934
2037
|
type: "button",
|
|
1935
2038
|
variant: "ghost",
|
|
1936
2039
|
size: "sm",
|
|
1937
2040
|
disabled: t,
|
|
1938
|
-
children: [/* @__PURE__ */ (0,
|
|
2041
|
+
children: [/* @__PURE__ */ (0, W.jsx)(Ze, { className: "mr-2 h-4 w-4" }), a("editor.submitConfigForm.insertVariable")]
|
|
1939
2042
|
})
|
|
1940
|
-
}), /* @__PURE__ */ (0,
|
|
2043
|
+
}), /* @__PURE__ */ (0, W.jsx)(X, {
|
|
1941
2044
|
align: "end",
|
|
1942
|
-
children: o.length === 0 ? /* @__PURE__ */ (0,
|
|
2045
|
+
children: o.length === 0 ? /* @__PURE__ */ (0, W.jsx)(Z, {
|
|
1943
2046
|
disabled: !0,
|
|
1944
2047
|
children: a("editor.submitConfigForm.noFieldsAvailable")
|
|
1945
|
-
}) : o.map((t) => /* @__PURE__ */ (0,
|
|
2048
|
+
}) : o.map((t) => /* @__PURE__ */ (0, W.jsx)(Z, {
|
|
1946
2049
|
onClick: () => {
|
|
1947
2050
|
let n = `{{${t.nodeId}}}`, r = e.state.value || "";
|
|
1948
2051
|
e.handleChange(r + n), s().then();
|
|
1949
2052
|
},
|
|
1950
|
-
children: /* @__PURE__ */ (0,
|
|
2053
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1951
2054
|
className: "flex flex-col",
|
|
1952
|
-
children: [/* @__PURE__ */ (0,
|
|
2055
|
+
children: [/* @__PURE__ */ (0, W.jsx)("span", {
|
|
1953
2056
|
className: "font-medium",
|
|
1954
2057
|
children: t.label
|
|
1955
|
-
}), /* @__PURE__ */ (0,
|
|
2058
|
+
}), /* @__PURE__ */ (0, W.jsx)("span", {
|
|
1956
2059
|
className: "text-muted-foreground text-xs",
|
|
1957
2060
|
children: `{{${t.nodeId}}}`
|
|
1958
2061
|
})]
|
|
@@ -1960,7 +2063,7 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1960
2063
|
}, t.nodeId))
|
|
1961
2064
|
})] })]
|
|
1962
2065
|
}),
|
|
1963
|
-
/* @__PURE__ */ (0,
|
|
2066
|
+
/* @__PURE__ */ (0, W.jsx)(D, {
|
|
1964
2067
|
id: e.name,
|
|
1965
2068
|
name: e.name,
|
|
1966
2069
|
value: e.state.value,
|
|
@@ -1970,26 +2073,26 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1970
2073
|
rows: 4,
|
|
1971
2074
|
disabled: t
|
|
1972
2075
|
}),
|
|
1973
|
-
/* @__PURE__ */ (0,
|
|
2076
|
+
/* @__PURE__ */ (0, W.jsx)(E, { children: a(t ? "editor.submitConfigForm.sendAllFormValuesDesc" : "editor.submitConfigForm.requestBodyDesc") })
|
|
1974
2077
|
] })
|
|
1975
2078
|
})]
|
|
1976
2079
|
})
|
|
1977
2080
|
}),
|
|
1978
|
-
/* @__PURE__ */ (0,
|
|
2081
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
1979
2082
|
className: "space-y-4",
|
|
1980
2083
|
children: [
|
|
1981
|
-
/* @__PURE__ */ (0,
|
|
2084
|
+
/* @__PURE__ */ (0, W.jsx)("h4", {
|
|
1982
2085
|
className: "font-semibold text-sm",
|
|
1983
2086
|
children: a("editor.submitConfigForm.postSubmission")
|
|
1984
2087
|
}),
|
|
1985
|
-
/* @__PURE__ */ (0,
|
|
2088
|
+
/* @__PURE__ */ (0, W.jsx)(c, {
|
|
1986
2089
|
name: "redirectUrl",
|
|
1987
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
1988
|
-
/* @__PURE__ */ (0,
|
|
2090
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [
|
|
2091
|
+
/* @__PURE__ */ (0, W.jsx)(u, {
|
|
1989
2092
|
htmlFor: e.name,
|
|
1990
2093
|
children: a("editor.submitConfigForm.redirectUrl")
|
|
1991
2094
|
}),
|
|
1992
|
-
/* @__PURE__ */ (0,
|
|
2095
|
+
/* @__PURE__ */ (0, W.jsx)(h, {
|
|
1993
2096
|
id: e.name,
|
|
1994
2097
|
name: e.name,
|
|
1995
2098
|
value: e.state.value,
|
|
@@ -1997,21 +2100,21 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
1997
2100
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1998
2101
|
placeholder: a("editor.submitConfigForm.redirectUrlPlaceholder")
|
|
1999
2102
|
}),
|
|
2000
|
-
/* @__PURE__ */ (0,
|
|
2103
|
+
/* @__PURE__ */ (0, W.jsx)(E, { children: a("editor.submitConfigForm.redirectUrlDesc") })
|
|
2001
2104
|
] })
|
|
2002
2105
|
}),
|
|
2003
|
-
/* @__PURE__ */ (0,
|
|
2106
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2004
2107
|
className: "flex items-center gap-2",
|
|
2005
|
-
children: [/* @__PURE__ */ (0,
|
|
2108
|
+
children: [/* @__PURE__ */ (0, W.jsx)(c, {
|
|
2006
2109
|
name: "successMessage",
|
|
2007
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2110
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, {
|
|
2008
2111
|
className: "flex-1",
|
|
2009
2112
|
children: [
|
|
2010
|
-
/* @__PURE__ */ (0,
|
|
2113
|
+
/* @__PURE__ */ (0, W.jsx)(u, {
|
|
2011
2114
|
htmlFor: e.name,
|
|
2012
2115
|
children: a("editor.submitConfigForm.successMessage")
|
|
2013
2116
|
}),
|
|
2014
|
-
/* @__PURE__ */ (0,
|
|
2117
|
+
/* @__PURE__ */ (0, W.jsx)(h, {
|
|
2015
2118
|
id: e.name,
|
|
2016
2119
|
name: e.name,
|
|
2017
2120
|
value: e.state.value?.[n] || "",
|
|
@@ -2024,26 +2127,26 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
2024
2127
|
},
|
|
2025
2128
|
placeholder: a("editor.submitConfigForm.successMessagePlaceholder")
|
|
2026
2129
|
}),
|
|
2027
|
-
/* @__PURE__ */ (0,
|
|
2130
|
+
/* @__PURE__ */ (0, W.jsx)(E, { children: a("editor.submitConfigForm.successMessageDesc") })
|
|
2028
2131
|
]
|
|
2029
2132
|
})
|
|
2030
|
-
}), /* @__PURE__ */ (0,
|
|
2133
|
+
}), /* @__PURE__ */ (0, W.jsx)(Q, {
|
|
2031
2134
|
value: n,
|
|
2032
2135
|
onValueChange: r
|
|
2033
2136
|
})]
|
|
2034
2137
|
}),
|
|
2035
|
-
/* @__PURE__ */ (0,
|
|
2138
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2036
2139
|
className: "flex items-center gap-2",
|
|
2037
|
-
children: [/* @__PURE__ */ (0,
|
|
2140
|
+
children: [/* @__PURE__ */ (0, W.jsx)(c, {
|
|
2038
2141
|
name: "errorMessage",
|
|
2039
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2142
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, {
|
|
2040
2143
|
className: "flex-1",
|
|
2041
2144
|
children: [
|
|
2042
|
-
/* @__PURE__ */ (0,
|
|
2145
|
+
/* @__PURE__ */ (0, W.jsx)(u, {
|
|
2043
2146
|
htmlFor: e.name,
|
|
2044
2147
|
children: a("editor.submitConfigForm.errorMessage")
|
|
2045
2148
|
}),
|
|
2046
|
-
/* @__PURE__ */ (0,
|
|
2149
|
+
/* @__PURE__ */ (0, W.jsx)(h, {
|
|
2047
2150
|
id: e.name,
|
|
2048
2151
|
name: e.name,
|
|
2049
2152
|
value: e.state.value?.[n] || "",
|
|
@@ -2056,30 +2159,30 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
2056
2159
|
},
|
|
2057
2160
|
placeholder: a("editor.submitConfigForm.errorMessagePlaceholder")
|
|
2058
2161
|
}),
|
|
2059
|
-
/* @__PURE__ */ (0,
|
|
2162
|
+
/* @__PURE__ */ (0, W.jsx)(E, { children: a("editor.submitConfigForm.errorMessageDesc") })
|
|
2060
2163
|
]
|
|
2061
2164
|
})
|
|
2062
|
-
}), /* @__PURE__ */ (0,
|
|
2165
|
+
}), /* @__PURE__ */ (0, W.jsx)(Q, {
|
|
2063
2166
|
value: n,
|
|
2064
2167
|
onValueChange: r
|
|
2065
2168
|
})]
|
|
2066
2169
|
})
|
|
2067
2170
|
]
|
|
2068
2171
|
}),
|
|
2069
|
-
/* @__PURE__ */ (0,
|
|
2172
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2070
2173
|
className: "space-y-4",
|
|
2071
|
-
children: [/* @__PURE__ */ (0,
|
|
2174
|
+
children: [/* @__PURE__ */ (0, W.jsx)("h4", {
|
|
2072
2175
|
className: "font-semibold text-sm",
|
|
2073
2176
|
children: a("editor.submitConfigForm.behavior")
|
|
2074
|
-
}), /* @__PURE__ */ (0,
|
|
2177
|
+
}), /* @__PURE__ */ (0, W.jsx)(c, {
|
|
2075
2178
|
name: "showLoading",
|
|
2076
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2179
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2077
2180
|
className: "flex items-center space-x-2",
|
|
2078
|
-
children: [/* @__PURE__ */ (0,
|
|
2181
|
+
children: [/* @__PURE__ */ (0, W.jsx)(S, {
|
|
2079
2182
|
id: e.name,
|
|
2080
2183
|
checked: e.state.value,
|
|
2081
2184
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2082
|
-
}), /* @__PURE__ */ (0,
|
|
2185
|
+
}), /* @__PURE__ */ (0, W.jsx)(u, {
|
|
2083
2186
|
htmlFor: e.name,
|
|
2084
2187
|
children: a("editor.submitConfigForm.showLoadingState")
|
|
2085
2188
|
})]
|
|
@@ -2088,60 +2191,60 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
2088
2191
|
})
|
|
2089
2192
|
]
|
|
2090
2193
|
}) });
|
|
2091
|
-
},
|
|
2092
|
-
let [h, g] =
|
|
2194
|
+
}, on = ({ options: e, id: t, value: n, onValueChange: r, placeholder: i = "Select...", searchPlaceholder: a = "Search or create...", createLabel: o = (e) => `Use: ${e}`, clearLabel: s = "Clear selection", emptyLabel: c = "No results found", className: l, allowClear: u = !0, allowCreate: p = !0 }) => {
|
|
2195
|
+
let [h, g] = F(!1), [_, y] = F(""), x = (e) => e ?? "", S = (e) => e.trim().toLowerCase(), C = x(n), ee = n !== null && n !== "", te = ee ? e.find((e) => x(e.value) === C) : void 0, w = S(_), T = p && w !== "" && !e.some((e) => S(e.label) === w || S(e.value ?? "") === w), E = (e) => {
|
|
2093
2196
|
e === C ? u && r?.("") : r?.(e), g(!1), y("");
|
|
2094
2197
|
}, D = () => {
|
|
2095
2198
|
_.trim() && (r?.(_.trim()), g(!1), y(""));
|
|
2096
2199
|
}, O = () => {
|
|
2097
2200
|
r?.(""), g(!1), y("");
|
|
2098
2201
|
};
|
|
2099
|
-
return /* @__PURE__ */ (0,
|
|
2202
|
+
return /* @__PURE__ */ (0, W.jsxs)(ce, {
|
|
2100
2203
|
open: h,
|
|
2101
2204
|
onOpenChange: g,
|
|
2102
|
-
children: [/* @__PURE__ */ (0,
|
|
2205
|
+
children: [/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2103
2206
|
asChild: !0,
|
|
2104
2207
|
id: t,
|
|
2105
|
-
children: /* @__PURE__ */ (0,
|
|
2208
|
+
children: /* @__PURE__ */ (0, W.jsxs)(m, {
|
|
2106
2209
|
type: "button",
|
|
2107
2210
|
variant: "outline",
|
|
2108
2211
|
role: "combobox",
|
|
2109
2212
|
"aria-expanded": h,
|
|
2110
2213
|
className: f("w-full justify-between font-normal", l),
|
|
2111
|
-
children: [/* @__PURE__ */ (0,
|
|
2214
|
+
children: [/* @__PURE__ */ (0, W.jsx)("span", {
|
|
2112
2215
|
className: "truncate",
|
|
2113
2216
|
children: ee && te ? te.label : i
|
|
2114
|
-
}), /* @__PURE__ */ (0,
|
|
2217
|
+
}), /* @__PURE__ */ (0, W.jsx)(L, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })]
|
|
2115
2218
|
})
|
|
2116
|
-
}), /* @__PURE__ */ (0,
|
|
2219
|
+
}), /* @__PURE__ */ (0, W.jsx)(v, {
|
|
2117
2220
|
className: "w-full p-0",
|
|
2118
2221
|
align: "start",
|
|
2119
|
-
children: /* @__PURE__ */ (0,
|
|
2222
|
+
children: /* @__PURE__ */ (0, W.jsxs)(k, {
|
|
2120
2223
|
shouldFilter: !1,
|
|
2121
|
-
children: [/* @__PURE__ */ (0,
|
|
2224
|
+
children: [/* @__PURE__ */ (0, W.jsx)(b, {
|
|
2122
2225
|
placeholder: a,
|
|
2123
2226
|
value: _,
|
|
2124
2227
|
onValueChange: y
|
|
2125
|
-
}), /* @__PURE__ */ (0,
|
|
2126
|
-
/* @__PURE__ */ (0,
|
|
2127
|
-
u && ee && /* @__PURE__ */ (0,
|
|
2228
|
+
}), /* @__PURE__ */ (0, W.jsxs)(ae, { children: [
|
|
2229
|
+
/* @__PURE__ */ (0, W.jsx)(A, { children: c }),
|
|
2230
|
+
u && ee && /* @__PURE__ */ (0, W.jsx)(ne, { children: /* @__PURE__ */ (0, W.jsxs)(re, {
|
|
2128
2231
|
value: "__clear__",
|
|
2129
2232
|
onSelect: O,
|
|
2130
2233
|
className: "mt-1 text-muted-foreground",
|
|
2131
|
-
children: [/* @__PURE__ */ (0,
|
|
2234
|
+
children: [/* @__PURE__ */ (0, W.jsx)(z, { className: "mr-2 h-4 w-4" }), s]
|
|
2132
2235
|
}) }),
|
|
2133
|
-
/* @__PURE__ */ (0,
|
|
2236
|
+
/* @__PURE__ */ (0, W.jsxs)(ne, { children: [T && /* @__PURE__ */ (0, W.jsxs)(re, {
|
|
2134
2237
|
value: `__create__${_}`,
|
|
2135
2238
|
onSelect: D,
|
|
2136
2239
|
className: "text-primary",
|
|
2137
|
-
children: [/* @__PURE__ */ (0,
|
|
2240
|
+
children: [/* @__PURE__ */ (0, W.jsx)(R, { className: "mr-2 h-4 w-4" }), o(_)]
|
|
2138
2241
|
}), e.filter((e) => {
|
|
2139
2242
|
let t = _.toLowerCase();
|
|
2140
2243
|
return e.label.toLowerCase().includes(t) || (e.value?.toLowerCase() ?? "").includes(t);
|
|
2141
|
-
}).map((e, t) => /* @__PURE__ */ (0,
|
|
2244
|
+
}).map((e, t) => /* @__PURE__ */ (0, W.jsxs)(re, {
|
|
2142
2245
|
value: e.label,
|
|
2143
2246
|
onSelect: () => E(e?.value || ""),
|
|
2144
|
-
children: [/* @__PURE__ */ (0,
|
|
2247
|
+
children: [/* @__PURE__ */ (0, W.jsx)(Fe, {
|
|
2145
2248
|
"aria-hidden": "true",
|
|
2146
2249
|
className: f("mr-2 h-4 w-4", ee && x(e.value) === C ? "opacity-100" : "opacity-0")
|
|
2147
2250
|
}), e.label]
|
|
@@ -2150,7 +2253,7 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
2150
2253
|
})
|
|
2151
2254
|
})]
|
|
2152
2255
|
});
|
|
2153
|
-
},
|
|
2256
|
+
}, sn = Object.entries({
|
|
2154
2257
|
alphanumeric: "^[a-zA-Z0-9]+$",
|
|
2155
2258
|
email: "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",
|
|
2156
2259
|
letters: "^[a-zA-Z]+$",
|
|
@@ -2159,49 +2262,149 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
2159
2262
|
}).map(([e, t]) => ({
|
|
2160
2263
|
label: e.charAt(0).toUpperCase() + e.slice(1).replace(/_/g, " "),
|
|
2161
2264
|
value: t
|
|
2162
|
-
})),
|
|
2265
|
+
})), cn = ({ id: e, value: t, onValueChange: n }) => /* @__PURE__ */ (0, W.jsx)(on, {
|
|
2163
2266
|
id: e,
|
|
2164
|
-
options:
|
|
2267
|
+
options: P(() => t && !sn.some((e) => e.value === t) ? [...sn, {
|
|
2165
2268
|
label: `Custom: ${t}`,
|
|
2166
2269
|
value: t
|
|
2167
|
-
}] :
|
|
2270
|
+
}] : sn, [t]),
|
|
2168
2271
|
value: t,
|
|
2169
2272
|
onValueChange: n,
|
|
2170
2273
|
placeholder: "Select or create a pattern",
|
|
2171
2274
|
searchPlaceholder: "Search patterns...",
|
|
2172
2275
|
createLabel: (e) => `Use pattern: ${e}`
|
|
2173
|
-
}),
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2276
|
+
}), ln = 400, un = .8, dn = (e) => new Promise((t, n) => {
|
|
2277
|
+
let r = new FileReader();
|
|
2278
|
+
r.onerror = () => n(/* @__PURE__ */ Error("read_failed")), r.onload = () => {
|
|
2279
|
+
let e = new Image();
|
|
2280
|
+
e.onload = () => t(e), e.onerror = () => n(/* @__PURE__ */ Error("decode_failed")), e.src = r.result;
|
|
2281
|
+
}, r.readAsDataURL(e);
|
|
2282
|
+
}), fn = async (e) => {
|
|
2283
|
+
if (!e.type.startsWith("image/")) throw Error("invalid_type");
|
|
2284
|
+
if (e.size > 5242880) throw Error("too_large");
|
|
2285
|
+
let t = await dn(e), n = Math.min(1, ln / Math.max(t.width, t.height)), r = document.createElement("canvas");
|
|
2286
|
+
r.width = Math.round(t.width * n), r.height = Math.round(t.height * n);
|
|
2287
|
+
let i = r.getContext("2d");
|
|
2288
|
+
if (!i) throw Error("canvas_unavailable");
|
|
2289
|
+
return i.drawImage(t, 0, 0, r.width, r.height), r.toDataURL("image/jpeg", un);
|
|
2290
|
+
}, pn = 400, mn = (e) => {
|
|
2291
|
+
if (!/^https?:\/\//i.test(e)) return !1;
|
|
2292
|
+
try {
|
|
2293
|
+
return !!new URL(e).hostname;
|
|
2294
|
+
} catch {
|
|
2295
|
+
return !1;
|
|
2296
|
+
}
|
|
2297
|
+
}, hn = ({ value: e, onChange: t }) => {
|
|
2298
|
+
let n = Me(null), r = Me(null), [i, a] = F(!1), [o, s] = F(e && /^https?:\/\//i.test(e) ? e : ""), c = G();
|
|
2299
|
+
Ae(() => {
|
|
2300
|
+
i || s(e && /^https?:\/\//i.test(e) ? e : "");
|
|
2301
|
+
}, [i, e]), Ae(() => () => {
|
|
2302
|
+
r.current && clearTimeout(r.current);
|
|
2303
|
+
}, []);
|
|
2304
|
+
let l = async (e) => {
|
|
2305
|
+
let r = e.target.files?.[0];
|
|
2306
|
+
if (r) try {
|
|
2307
|
+
t(await fn(r)), a(!1);
|
|
2308
|
+
} catch (e) {
|
|
2309
|
+
let t = e.message;
|
|
2310
|
+
t === "too_large" ? V.error(c("editor.inputNodeForm.optionImageTooLarge")) : t === "invalid_type" ? V.error(c("editor.inputNodeForm.optionImageInvalid")) : V.error(c("editor.inputNodeForm.optionImageError"));
|
|
2311
|
+
} finally {
|
|
2312
|
+
n.current && (n.current.value = "");
|
|
2313
|
+
}
|
|
2314
|
+
}, u = () => {
|
|
2315
|
+
let e = o.trim();
|
|
2316
|
+
e && (t(e), a(!1));
|
|
2317
|
+
}, f = (n) => {
|
|
2318
|
+
let i = n.target.value;
|
|
2319
|
+
s(i), r.current && clearTimeout(r.current);
|
|
2320
|
+
let a = i.trim();
|
|
2321
|
+
!mn(a) || a === e || (r.current = setTimeout(() => {
|
|
2322
|
+
t(a);
|
|
2323
|
+
}, pn));
|
|
2324
|
+
};
|
|
2325
|
+
return /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2326
|
+
className: "relative",
|
|
2327
|
+
children: [
|
|
2328
|
+
/* @__PURE__ */ (0, W.jsx)("input", {
|
|
2329
|
+
ref: n,
|
|
2330
|
+
type: "file",
|
|
2331
|
+
accept: "image/*",
|
|
2332
|
+
className: "hidden",
|
|
2333
|
+
onChange: l
|
|
2334
|
+
}),
|
|
2335
|
+
/* @__PURE__ */ (0, W.jsxs)(ce, {
|
|
2336
|
+
open: i,
|
|
2337
|
+
onOpenChange: a,
|
|
2338
|
+
children: [/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2339
|
+
asChild: !0,
|
|
2340
|
+
children: e ? /* @__PURE__ */ (0, W.jsx)("button", {
|
|
2341
|
+
type: "button",
|
|
2342
|
+
className: "h-9 w-9 cursor-pointer overflow-hidden rounded-md border border-input",
|
|
2343
|
+
"aria-label": c("editor.inputNodeForm.optionImageReplace"),
|
|
2344
|
+
children: /* @__PURE__ */ (0, W.jsx)("img", {
|
|
2345
|
+
src: e,
|
|
2346
|
+
alt: "",
|
|
2347
|
+
className: "h-full w-full object-cover"
|
|
2348
|
+
})
|
|
2349
|
+
}) : /* @__PURE__ */ (0, W.jsx)(m, {
|
|
2350
|
+
type: "button",
|
|
2351
|
+
variant: "outline",
|
|
2352
|
+
size: "icon",
|
|
2353
|
+
"aria-label": c("editor.inputNodeForm.optionImageAdd"),
|
|
2354
|
+
children: /* @__PURE__ */ (0, W.jsx)(Be, { className: "h-4 w-4" })
|
|
2355
|
+
})
|
|
2356
|
+
}), /* @__PURE__ */ (0, W.jsxs)(v, {
|
|
2357
|
+
align: "start",
|
|
2358
|
+
className: "w-64 space-y-3 p-3",
|
|
2359
|
+
children: [
|
|
2360
|
+
/* @__PURE__ */ (0, W.jsxs)(m, {
|
|
2361
|
+
type: "button",
|
|
2362
|
+
variant: "outline",
|
|
2363
|
+
size: "sm",
|
|
2364
|
+
className: "w-full",
|
|
2365
|
+
onClick: () => n.current?.click(),
|
|
2366
|
+
children: [/* @__PURE__ */ (0, W.jsx)(Xe, { className: "mr-2 h-4 w-4" }), c("editor.inputNodeForm.optionImageUpload")]
|
|
2367
|
+
}),
|
|
2368
|
+
/* @__PURE__ */ (0, W.jsx)(oe, {}),
|
|
2369
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2370
|
+
className: "flex items-center gap-2",
|
|
2371
|
+
children: [/* @__PURE__ */ (0, W.jsx)(Ve, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), /* @__PURE__ */ (0, W.jsx)(h, {
|
|
2372
|
+
placeholder: c("editor.inputNodeForm.optionImageUrlPlaceholder"),
|
|
2373
|
+
value: o,
|
|
2374
|
+
onChange: f,
|
|
2375
|
+
onKeyDown: (e) => {
|
|
2376
|
+
e.key === "Enter" && (e.preventDefault(), u());
|
|
2377
|
+
},
|
|
2378
|
+
onBlur: u
|
|
2379
|
+
})]
|
|
2380
|
+
})
|
|
2381
|
+
]
|
|
2382
|
+
})]
|
|
2383
|
+
}),
|
|
2384
|
+
e && /* @__PURE__ */ (0, W.jsx)("button", {
|
|
2385
|
+
type: "button",
|
|
2386
|
+
onClick: (e) => {
|
|
2387
|
+
e.stopPropagation(), t("");
|
|
2388
|
+
},
|
|
2389
|
+
className: "-top-1 -right-1 absolute flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-destructive text-destructive-foreground",
|
|
2390
|
+
"aria-label": c("editor.inputNodeForm.optionImageRemove"),
|
|
2391
|
+
children: /* @__PURE__ */ (0, W.jsx)(z, { className: "h-3 w-3" })
|
|
2392
|
+
})
|
|
2393
|
+
]
|
|
2394
|
+
});
|
|
2395
|
+
}, gn = ({ value: e, onValueChange: t }) => {
|
|
2396
|
+
let n = G(), r = je();
|
|
2397
|
+
return /* @__PURE__ */ (0, W.jsxs)(M, { children: [/* @__PURE__ */ (0, W.jsx)(le, {
|
|
2195
2398
|
htmlFor: r,
|
|
2196
2399
|
children: n("editor.selectInputType.type")
|
|
2197
|
-
}), /* @__PURE__ */ (0,
|
|
2400
|
+
}), /* @__PURE__ */ (0, W.jsxs)(y, {
|
|
2198
2401
|
value: e,
|
|
2199
2402
|
onValueChange: t,
|
|
2200
|
-
children: [/* @__PURE__ */ (0,
|
|
2403
|
+
children: [/* @__PURE__ */ (0, W.jsx)(_, {
|
|
2201
2404
|
id: r,
|
|
2202
2405
|
className: "w-full capitalize",
|
|
2203
|
-
children: /* @__PURE__ */ (0,
|
|
2204
|
-
}), /* @__PURE__ */ (0,
|
|
2406
|
+
children: /* @__PURE__ */ (0, W.jsx)(l, { placeholder: "" })
|
|
2407
|
+
}), /* @__PURE__ */ (0, W.jsx)(j, { children: /* @__PURE__ */ (0, W.jsx)(M, { children: Object.values(_t).map((e) => /* @__PURE__ */ (0, W.jsx)(x, {
|
|
2205
2408
|
value: e,
|
|
2206
2409
|
className: "capitalize",
|
|
2207
2410
|
children: e
|
|
@@ -2210,33 +2413,33 @@ var Lt = Y(), Rt = ({ onExportJson: e, onSave: t }) => {
|
|
|
2210
2413
|
};
|
|
2211
2414
|
//#endregion
|
|
2212
2415
|
//#region src/shared/components/ui/collapsible.tsx
|
|
2213
|
-
function
|
|
2214
|
-
return /* @__PURE__ */ (0,
|
|
2416
|
+
function _n({ ...e }) {
|
|
2417
|
+
return /* @__PURE__ */ (0, W.jsx)(at.Root, {
|
|
2215
2418
|
"data-slot": "collapsible",
|
|
2216
2419
|
...e
|
|
2217
2420
|
});
|
|
2218
2421
|
}
|
|
2219
|
-
function
|
|
2220
|
-
return /* @__PURE__ */ (0,
|
|
2422
|
+
function vn({ ...e }) {
|
|
2423
|
+
return /* @__PURE__ */ (0, W.jsx)(at.CollapsibleTrigger, {
|
|
2221
2424
|
"data-slot": "collapsible-trigger",
|
|
2222
2425
|
...e
|
|
2223
2426
|
});
|
|
2224
2427
|
}
|
|
2225
|
-
function
|
|
2226
|
-
return /* @__PURE__ */ (0,
|
|
2428
|
+
function yn({ ...e }) {
|
|
2429
|
+
return /* @__PURE__ */ (0, W.jsx)(at.CollapsibleContent, {
|
|
2227
2430
|
"data-slot": "collapsible-content",
|
|
2228
2431
|
...e
|
|
2229
2432
|
});
|
|
2230
2433
|
}
|
|
2231
2434
|
//#endregion
|
|
2232
2435
|
//#region src/editor/features/TreegeEditor/forms/InputNodeForm.tsx
|
|
2233
|
-
var
|
|
2234
|
-
let [e, t] =
|
|
2436
|
+
var bn = () => {
|
|
2437
|
+
let [e, t] = F("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = K(), i = [
|
|
2235
2438
|
"select",
|
|
2236
2439
|
"radio",
|
|
2237
2440
|
"autocomplete",
|
|
2238
2441
|
"checkbox"
|
|
2239
|
-
].includes(n?.data?.type || ""), a =
|
|
2442
|
+
].includes(n?.data?.type || ""), a = ut(n?.id), o = G(), s = n?.data?.type === "submit", { handleSubmit: c, Field: d } = I({
|
|
2240
2443
|
defaultValues: {
|
|
2241
2444
|
defaultValue: n?.data?.defaultValue,
|
|
2242
2445
|
disablePast: n?.data?.disablePast,
|
|
@@ -2263,30 +2466,30 @@ var en = () => {
|
|
|
2263
2466
|
r(e);
|
|
2264
2467
|
}
|
|
2265
2468
|
});
|
|
2266
|
-
return /* @__PURE__ */ (0,
|
|
2469
|
+
return /* @__PURE__ */ (0, W.jsx)("form", {
|
|
2267
2470
|
onSubmit: (e) => {
|
|
2268
2471
|
e.preventDefault(), e.stopPropagation();
|
|
2269
2472
|
},
|
|
2270
|
-
children: /* @__PURE__ */ (0,
|
|
2473
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2271
2474
|
className: "grid gap-6",
|
|
2272
2475
|
children: [
|
|
2273
|
-
/* @__PURE__ */ (0,
|
|
2476
|
+
/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2274
2477
|
name: "type",
|
|
2275
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2478
|
+
children: (e) => /* @__PURE__ */ (0, W.jsx)(T, { children: /* @__PURE__ */ (0, W.jsx)(gn, {
|
|
2276
2479
|
value: e.state.value,
|
|
2277
2480
|
onValueChange: (t) => e.handleChange(t)
|
|
2278
2481
|
}) })
|
|
2279
2482
|
}),
|
|
2280
|
-
/* @__PURE__ */ (0,
|
|
2483
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2281
2484
|
className: "flex items-end gap-2",
|
|
2282
|
-
children: [/* @__PURE__ */ (0,
|
|
2485
|
+
children: [/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2283
2486
|
name: "label",
|
|
2284
|
-
children: (t) => /* @__PURE__ */ (0,
|
|
2487
|
+
children: (t) => /* @__PURE__ */ (0, W.jsxs)(T, {
|
|
2285
2488
|
className: "flex-1",
|
|
2286
|
-
children: [/* @__PURE__ */ (0,
|
|
2489
|
+
children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
2287
2490
|
htmlFor: t.name,
|
|
2288
2491
|
children: o("editor.inputNodeForm.label")
|
|
2289
|
-
}), /* @__PURE__ */ (0,
|
|
2492
|
+
}), /* @__PURE__ */ (0, W.jsx)(h, {
|
|
2290
2493
|
autoFocus: !0,
|
|
2291
2494
|
id: t.name,
|
|
2292
2495
|
name: t.name,
|
|
@@ -2300,21 +2503,21 @@ var en = () => {
|
|
|
2300
2503
|
}
|
|
2301
2504
|
})]
|
|
2302
2505
|
})
|
|
2303
|
-
}), /* @__PURE__ */ (0,
|
|
2506
|
+
}), /* @__PURE__ */ (0, W.jsx)(Q, {
|
|
2304
2507
|
value: e,
|
|
2305
2508
|
onValueChange: t
|
|
2306
2509
|
})]
|
|
2307
2510
|
}),
|
|
2308
|
-
!s && n?.data?.type !== "file" && /* @__PURE__ */ (0,
|
|
2511
|
+
!s && n?.data?.type !== "file" && /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2309
2512
|
className: "flex items-end gap-2",
|
|
2310
|
-
children: [/* @__PURE__ */ (0,
|
|
2513
|
+
children: [/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2311
2514
|
name: "placeholder",
|
|
2312
|
-
children: (t) => /* @__PURE__ */ (0,
|
|
2515
|
+
children: (t) => /* @__PURE__ */ (0, W.jsxs)(T, {
|
|
2313
2516
|
className: "flex-1",
|
|
2314
|
-
children: [/* @__PURE__ */ (0,
|
|
2517
|
+
children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
2315
2518
|
htmlFor: t.name,
|
|
2316
2519
|
children: o("editor.inputNodeForm.placeholder")
|
|
2317
|
-
}), /* @__PURE__ */ (0,
|
|
2520
|
+
}), /* @__PURE__ */ (0, W.jsx)(h, {
|
|
2318
2521
|
id: t.name,
|
|
2319
2522
|
name: t.name,
|
|
2320
2523
|
value: t.state.value?.[e] || "",
|
|
@@ -2327,21 +2530,21 @@ var en = () => {
|
|
|
2327
2530
|
}
|
|
2328
2531
|
})]
|
|
2329
2532
|
})
|
|
2330
|
-
}), /* @__PURE__ */ (0,
|
|
2533
|
+
}), /* @__PURE__ */ (0, W.jsx)(Q, {
|
|
2331
2534
|
value: e,
|
|
2332
2535
|
onValueChange: t
|
|
2333
2536
|
})]
|
|
2334
2537
|
}),
|
|
2335
|
-
!s && /* @__PURE__ */ (0,
|
|
2538
|
+
!s && /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2336
2539
|
className: "flex items-end gap-2",
|
|
2337
|
-
children: [/* @__PURE__ */ (0,
|
|
2540
|
+
children: [/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2338
2541
|
name: "helperText",
|
|
2339
|
-
children: (t) => /* @__PURE__ */ (0,
|
|
2542
|
+
children: (t) => /* @__PURE__ */ (0, W.jsxs)(T, {
|
|
2340
2543
|
className: "flex-1",
|
|
2341
|
-
children: [/* @__PURE__ */ (0,
|
|
2544
|
+
children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
2342
2545
|
htmlFor: t.name,
|
|
2343
2546
|
children: o("editor.inputNodeForm.helperText")
|
|
2344
|
-
}), /* @__PURE__ */ (0,
|
|
2547
|
+
}), /* @__PURE__ */ (0, W.jsx)(h, {
|
|
2345
2548
|
id: t.name,
|
|
2346
2549
|
name: t.name,
|
|
2347
2550
|
value: t.state.value?.[e] || "",
|
|
@@ -2354,36 +2557,36 @@ var en = () => {
|
|
|
2354
2557
|
}
|
|
2355
2558
|
})]
|
|
2356
2559
|
})
|
|
2357
|
-
}), /* @__PURE__ */ (0,
|
|
2560
|
+
}), /* @__PURE__ */ (0, W.jsx)(Q, {
|
|
2358
2561
|
value: e,
|
|
2359
2562
|
onValueChange: t
|
|
2360
2563
|
})]
|
|
2361
2564
|
}),
|
|
2362
|
-
n?.data?.type === "http" && /* @__PURE__ */ (0,
|
|
2565
|
+
n?.data?.type === "http" && /* @__PURE__ */ (0, W.jsxs)(_n, {
|
|
2363
2566
|
defaultOpen: !0,
|
|
2364
2567
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
2365
|
-
children: [/* @__PURE__ */ (0,
|
|
2568
|
+
children: [/* @__PURE__ */ (0, W.jsx)(vn, {
|
|
2366
2569
|
asChild: !0,
|
|
2367
|
-
children: /* @__PURE__ */ (0,
|
|
2570
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2368
2571
|
className: "flex items-center justify-between gap-4",
|
|
2369
|
-
children: [/* @__PURE__ */ (0,
|
|
2572
|
+
children: [/* @__PURE__ */ (0, W.jsx)("h4", {
|
|
2370
2573
|
className: "font-semibold text-sm",
|
|
2371
2574
|
children: o("editor.inputNodeForm.httpConfiguration")
|
|
2372
|
-
}), /* @__PURE__ */ (0,
|
|
2575
|
+
}), /* @__PURE__ */ (0, W.jsxs)(m, {
|
|
2373
2576
|
variant: "ghost",
|
|
2374
2577
|
size: "icon",
|
|
2375
2578
|
className: "size-8",
|
|
2376
|
-
children: [/* @__PURE__ */ (0,
|
|
2579
|
+
children: [/* @__PURE__ */ (0, W.jsx)(L, {}), /* @__PURE__ */ (0, W.jsx)("span", {
|
|
2377
2580
|
className: "sr-only",
|
|
2378
2581
|
children: o("common.toggle")
|
|
2379
2582
|
})]
|
|
2380
2583
|
})]
|
|
2381
2584
|
})
|
|
2382
|
-
}), /* @__PURE__ */ (0,
|
|
2585
|
+
}), /* @__PURE__ */ (0, W.jsx)(yn, {
|
|
2383
2586
|
className: "flex flex-col gap-4",
|
|
2384
|
-
children: /* @__PURE__ */ (0,
|
|
2587
|
+
children: /* @__PURE__ */ (0, W.jsx)(d, {
|
|
2385
2588
|
name: "httpConfig",
|
|
2386
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2589
|
+
children: (e) => /* @__PURE__ */ (0, W.jsx)(nn, {
|
|
2387
2590
|
value: e.state.value,
|
|
2388
2591
|
onChange: (t) => {
|
|
2389
2592
|
e.handleChange(t), c().then();
|
|
@@ -2392,30 +2595,30 @@ var en = () => {
|
|
|
2392
2595
|
})
|
|
2393
2596
|
})]
|
|
2394
2597
|
}),
|
|
2395
|
-
s && /* @__PURE__ */ (0,
|
|
2598
|
+
s && /* @__PURE__ */ (0, W.jsxs)(_n, {
|
|
2396
2599
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
2397
|
-
children: [/* @__PURE__ */ (0,
|
|
2600
|
+
children: [/* @__PURE__ */ (0, W.jsx)(vn, {
|
|
2398
2601
|
asChild: !0,
|
|
2399
|
-
children: /* @__PURE__ */ (0,
|
|
2602
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2400
2603
|
className: "flex items-center justify-between gap-4",
|
|
2401
|
-
children: [/* @__PURE__ */ (0,
|
|
2604
|
+
children: [/* @__PURE__ */ (0, W.jsx)("h4", {
|
|
2402
2605
|
className: "font-semibold text-sm",
|
|
2403
2606
|
children: o("editor.inputNodeForm.submitConfiguration")
|
|
2404
|
-
}), /* @__PURE__ */ (0,
|
|
2607
|
+
}), /* @__PURE__ */ (0, W.jsxs)(m, {
|
|
2405
2608
|
variant: "ghost",
|
|
2406
2609
|
size: "icon",
|
|
2407
2610
|
className: "size-8",
|
|
2408
|
-
children: [/* @__PURE__ */ (0,
|
|
2611
|
+
children: [/* @__PURE__ */ (0, W.jsx)(L, {}), /* @__PURE__ */ (0, W.jsx)("span", {
|
|
2409
2612
|
className: "sr-only",
|
|
2410
2613
|
children: o("common.toggle")
|
|
2411
2614
|
})]
|
|
2412
2615
|
})]
|
|
2413
2616
|
})
|
|
2414
|
-
}), /* @__PURE__ */ (0,
|
|
2617
|
+
}), /* @__PURE__ */ (0, W.jsx)(yn, {
|
|
2415
2618
|
className: "flex flex-col gap-4",
|
|
2416
|
-
children: /* @__PURE__ */ (0,
|
|
2619
|
+
children: /* @__PURE__ */ (0, W.jsx)(d, {
|
|
2417
2620
|
name: "submitConfig",
|
|
2418
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2621
|
+
children: (e) => /* @__PURE__ */ (0, W.jsx)(an, {
|
|
2419
2622
|
value: e.state.value,
|
|
2420
2623
|
onChange: (t) => {
|
|
2421
2624
|
e.handleChange(t), c().then();
|
|
@@ -2424,55 +2627,62 @@ var en = () => {
|
|
|
2424
2627
|
})
|
|
2425
2628
|
})]
|
|
2426
2629
|
}),
|
|
2427
|
-
n?.data?.type === "file" && /* @__PURE__ */ (0,
|
|
2630
|
+
n?.data?.type === "file" && /* @__PURE__ */ (0, W.jsx)(d, {
|
|
2428
2631
|
name: "multiple",
|
|
2429
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2632
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2430
2633
|
className: "flex items-center space-x-2",
|
|
2431
|
-
children: [/* @__PURE__ */ (0,
|
|
2634
|
+
children: [/* @__PURE__ */ (0, W.jsx)(S, {
|
|
2432
2635
|
id: e.name,
|
|
2433
2636
|
checked: e.state.value,
|
|
2434
2637
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2435
|
-
}), /* @__PURE__ */ (0,
|
|
2638
|
+
}), /* @__PURE__ */ (0, W.jsx)(u, {
|
|
2436
2639
|
htmlFor: e.name,
|
|
2437
2640
|
children: o("editor.inputNodeForm.multipleFiles")
|
|
2438
2641
|
})]
|
|
2439
2642
|
})
|
|
2440
2643
|
}),
|
|
2441
|
-
i && /* @__PURE__ */ (0,
|
|
2644
|
+
i && /* @__PURE__ */ (0, W.jsxs)(_n, {
|
|
2442
2645
|
defaultOpen: !0,
|
|
2443
2646
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
2444
|
-
children: [/* @__PURE__ */ (0,
|
|
2647
|
+
children: [/* @__PURE__ */ (0, W.jsx)(vn, {
|
|
2445
2648
|
asChild: !0,
|
|
2446
|
-
children: /* @__PURE__ */ (0,
|
|
2649
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2447
2650
|
className: "flex items-center justify-between gap-4",
|
|
2448
|
-
children: [/* @__PURE__ */ (0,
|
|
2651
|
+
children: [/* @__PURE__ */ (0, W.jsx)("h4", {
|
|
2449
2652
|
className: "font-semibold text-sm",
|
|
2450
2653
|
children: o("editor.inputNodeForm.options")
|
|
2451
|
-
}), /* @__PURE__ */ (0,
|
|
2654
|
+
}), /* @__PURE__ */ (0, W.jsxs)(m, {
|
|
2452
2655
|
variant: "ghost",
|
|
2453
2656
|
size: "icon",
|
|
2454
2657
|
className: "size-8",
|
|
2455
|
-
children: [/* @__PURE__ */ (0,
|
|
2658
|
+
children: [/* @__PURE__ */ (0, W.jsx)(L, {}), /* @__PURE__ */ (0, W.jsx)("span", {
|
|
2456
2659
|
className: "sr-only",
|
|
2457
2660
|
children: o("common.toggle")
|
|
2458
2661
|
})]
|
|
2459
2662
|
})]
|
|
2460
2663
|
})
|
|
2461
|
-
}), /* @__PURE__ */ (0,
|
|
2664
|
+
}), /* @__PURE__ */ (0, W.jsxs)(yn, {
|
|
2462
2665
|
className: "flex flex-col gap-4",
|
|
2463
|
-
children: [/* @__PURE__ */ (0,
|
|
2666
|
+
children: [/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2464
2667
|
name: "options",
|
|
2465
2668
|
mode: "array",
|
|
2466
|
-
children: (t) => /* @__PURE__ */ (0,
|
|
2669
|
+
children: (t) => /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2467
2670
|
className: "space-y-2",
|
|
2468
|
-
children: [t.state.value?.map((
|
|
2469
|
-
let
|
|
2470
|
-
return /* @__PURE__ */ (0,
|
|
2671
|
+
children: [t.state.value?.map((r, i) => {
|
|
2672
|
+
let a = `options[${i}]`;
|
|
2673
|
+
return /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2471
2674
|
className: "flex items-start gap-2",
|
|
2472
2675
|
children: [
|
|
2473
|
-
/* @__PURE__ */ (0,
|
|
2474
|
-
name: `options[${
|
|
2475
|
-
children: (
|
|
2676
|
+
n?.data?.type === "radio" && /* @__PURE__ */ (0, W.jsx)(d, {
|
|
2677
|
+
name: `options[${i}].image`,
|
|
2678
|
+
children: (e) => /* @__PURE__ */ (0, W.jsx)(hn, {
|
|
2679
|
+
value: e.state.value,
|
|
2680
|
+
onChange: (t) => e.handleChange(t)
|
|
2681
|
+
})
|
|
2682
|
+
}),
|
|
2683
|
+
/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2684
|
+
name: `options[${i}].label`,
|
|
2685
|
+
children: (t) => /* @__PURE__ */ (0, W.jsx)(h, {
|
|
2476
2686
|
placeholder: o("editor.inputNodeForm.optionLabel"),
|
|
2477
2687
|
value: t.state.value?.[e] || "",
|
|
2478
2688
|
onChange: ({ target: n }) => {
|
|
@@ -2483,26 +2693,26 @@ var en = () => {
|
|
|
2483
2693
|
}
|
|
2484
2694
|
})
|
|
2485
2695
|
}),
|
|
2486
|
-
/* @__PURE__ */ (0,
|
|
2487
|
-
name: `options[${
|
|
2488
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2696
|
+
/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2697
|
+
name: `options[${i}].value`,
|
|
2698
|
+
children: (e) => /* @__PURE__ */ (0, W.jsx)(h, {
|
|
2489
2699
|
placeholder: o("editor.inputNodeForm.optionValue"),
|
|
2490
2700
|
value: e.state.value || "",
|
|
2491
2701
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
2492
2702
|
})
|
|
2493
2703
|
}),
|
|
2494
|
-
/* @__PURE__ */ (0,
|
|
2704
|
+
/* @__PURE__ */ (0, W.jsx)(m, {
|
|
2495
2705
|
type: "button",
|
|
2496
2706
|
variant: "ghost",
|
|
2497
2707
|
size: "icon",
|
|
2498
2708
|
onClick: () => {
|
|
2499
|
-
t.removeValue(
|
|
2709
|
+
t.removeValue(i), c().then();
|
|
2500
2710
|
},
|
|
2501
|
-
children: /* @__PURE__ */ (0,
|
|
2711
|
+
children: /* @__PURE__ */ (0, W.jsx)(z, { className: "h-4 w-4" })
|
|
2502
2712
|
})
|
|
2503
2713
|
]
|
|
2504
|
-
},
|
|
2505
|
-
}), /* @__PURE__ */ (0,
|
|
2714
|
+
}, a);
|
|
2715
|
+
}), /* @__PURE__ */ (0, W.jsx)(m, {
|
|
2506
2716
|
type: "button",
|
|
2507
2717
|
variant: "outline",
|
|
2508
2718
|
size: "sm",
|
|
@@ -2515,15 +2725,15 @@ var en = () => {
|
|
|
2515
2725
|
children: o("editor.inputNodeForm.addOption")
|
|
2516
2726
|
})]
|
|
2517
2727
|
})
|
|
2518
|
-
}), n?.data?.type === "select" && /* @__PURE__ */ (0,
|
|
2728
|
+
}), n?.data?.type === "select" && /* @__PURE__ */ (0, W.jsx)(d, {
|
|
2519
2729
|
name: "multiple",
|
|
2520
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2730
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2521
2731
|
className: "flex items-center space-x-2",
|
|
2522
|
-
children: [/* @__PURE__ */ (0,
|
|
2732
|
+
children: [/* @__PURE__ */ (0, W.jsx)(S, {
|
|
2523
2733
|
id: e.name,
|
|
2524
2734
|
checked: e.state.value,
|
|
2525
2735
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2526
|
-
}), /* @__PURE__ */ (0,
|
|
2736
|
+
}), /* @__PURE__ */ (0, W.jsx)(u, {
|
|
2527
2737
|
htmlFor: e.name,
|
|
2528
2738
|
children: o("editor.inputNodeForm.multipleSelection")
|
|
2529
2739
|
})]
|
|
@@ -2531,77 +2741,77 @@ var en = () => {
|
|
|
2531
2741
|
})]
|
|
2532
2742
|
})]
|
|
2533
2743
|
}),
|
|
2534
|
-
!s && /* @__PURE__ */ (0,
|
|
2744
|
+
!s && /* @__PURE__ */ (0, W.jsxs)(_n, {
|
|
2535
2745
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
2536
|
-
children: [/* @__PURE__ */ (0,
|
|
2746
|
+
children: [/* @__PURE__ */ (0, W.jsx)(vn, {
|
|
2537
2747
|
asChild: !0,
|
|
2538
|
-
children: /* @__PURE__ */ (0,
|
|
2748
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2539
2749
|
className: "flex items-center justify-between gap-4",
|
|
2540
|
-
children: [/* @__PURE__ */ (0,
|
|
2750
|
+
children: [/* @__PURE__ */ (0, W.jsx)("h4", {
|
|
2541
2751
|
className: "font-semibold text-sm",
|
|
2542
2752
|
children: o("editor.inputNodeForm.validation")
|
|
2543
|
-
}), /* @__PURE__ */ (0,
|
|
2753
|
+
}), /* @__PURE__ */ (0, W.jsxs)(m, {
|
|
2544
2754
|
variant: "ghost",
|
|
2545
2755
|
size: "icon",
|
|
2546
2756
|
className: "size-8",
|
|
2547
|
-
children: [/* @__PURE__ */ (0,
|
|
2757
|
+
children: [/* @__PURE__ */ (0, W.jsx)(L, {}), /* @__PURE__ */ (0, W.jsx)("span", {
|
|
2548
2758
|
className: "sr-only",
|
|
2549
2759
|
children: o("common.toggle")
|
|
2550
2760
|
})]
|
|
2551
2761
|
})]
|
|
2552
2762
|
})
|
|
2553
|
-
}), /* @__PURE__ */ (0,
|
|
2763
|
+
}), /* @__PURE__ */ (0, W.jsxs)(yn, {
|
|
2554
2764
|
className: "flex flex-col gap-6",
|
|
2555
2765
|
children: [
|
|
2556
|
-
/* @__PURE__ */ (0,
|
|
2766
|
+
/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2557
2767
|
name: "required",
|
|
2558
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2768
|
+
children: (e) => /* @__PURE__ */ (0, W.jsx)(T, { children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2559
2769
|
className: "flex items-center space-x-2",
|
|
2560
|
-
children: [/* @__PURE__ */ (0,
|
|
2770
|
+
children: [/* @__PURE__ */ (0, W.jsx)(S, {
|
|
2561
2771
|
id: e.name,
|
|
2562
2772
|
checked: e.state.value,
|
|
2563
2773
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2564
|
-
}), /* @__PURE__ */ (0,
|
|
2774
|
+
}), /* @__PURE__ */ (0, W.jsx)(u, {
|
|
2565
2775
|
htmlFor: e.name,
|
|
2566
2776
|
children: o("editor.inputNodeForm.required")
|
|
2567
2777
|
})]
|
|
2568
2778
|
}) })
|
|
2569
2779
|
}),
|
|
2570
|
-
(n?.data?.type === "date" || n?.data?.type === "daterange") && /* @__PURE__ */ (0,
|
|
2780
|
+
(n?.data?.type === "date" || n?.data?.type === "daterange") && /* @__PURE__ */ (0, W.jsx)(d, {
|
|
2571
2781
|
name: "disablePast",
|
|
2572
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2782
|
+
children: (e) => /* @__PURE__ */ (0, W.jsx)(T, { children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2573
2783
|
className: "flex items-center space-x-2",
|
|
2574
|
-
children: [/* @__PURE__ */ (0,
|
|
2784
|
+
children: [/* @__PURE__ */ (0, W.jsx)(S, {
|
|
2575
2785
|
id: e.name,
|
|
2576
2786
|
checked: e.state.value,
|
|
2577
2787
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2578
|
-
}), /* @__PURE__ */ (0,
|
|
2788
|
+
}), /* @__PURE__ */ (0, W.jsx)(u, {
|
|
2579
2789
|
htmlFor: e.name,
|
|
2580
2790
|
children: o("editor.inputNodeForm.disablePast")
|
|
2581
2791
|
})]
|
|
2582
2792
|
}) })
|
|
2583
2793
|
}),
|
|
2584
|
-
/* @__PURE__ */ (0,
|
|
2794
|
+
/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2585
2795
|
name: "pattern",
|
|
2586
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2796
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
2587
2797
|
htmlFor: e.name,
|
|
2588
2798
|
children: o("editor.inputNodeForm.pattern")
|
|
2589
|
-
}), /* @__PURE__ */ (0,
|
|
2799
|
+
}), /* @__PURE__ */ (0, W.jsx)(cn, {
|
|
2590
2800
|
id: e.name,
|
|
2591
2801
|
value: e.state.value,
|
|
2592
2802
|
onValueChange: e.handleChange
|
|
2593
2803
|
})] })
|
|
2594
2804
|
}),
|
|
2595
|
-
/* @__PURE__ */ (0,
|
|
2805
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2596
2806
|
className: "flex items-end gap-2",
|
|
2597
|
-
children: [/* @__PURE__ */ (0,
|
|
2807
|
+
children: [/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2598
2808
|
name: "errorMessage",
|
|
2599
|
-
children: (t) => /* @__PURE__ */ (0,
|
|
2809
|
+
children: (t) => /* @__PURE__ */ (0, W.jsxs)(T, {
|
|
2600
2810
|
className: "flex-1",
|
|
2601
|
-
children: [/* @__PURE__ */ (0,
|
|
2811
|
+
children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
2602
2812
|
htmlFor: t.name,
|
|
2603
2813
|
children: o("editor.inputNodeForm.errorMessage")
|
|
2604
|
-
}), /* @__PURE__ */ (0,
|
|
2814
|
+
}), /* @__PURE__ */ (0, W.jsx)(h, {
|
|
2605
2815
|
id: t.name,
|
|
2606
2816
|
name: t.name,
|
|
2607
2817
|
value: t.state.value?.[e] || "",
|
|
@@ -2614,7 +2824,7 @@ var en = () => {
|
|
|
2614
2824
|
}
|
|
2615
2825
|
})]
|
|
2616
2826
|
})
|
|
2617
|
-
}), /* @__PURE__ */ (0,
|
|
2827
|
+
}), /* @__PURE__ */ (0, W.jsx)(Q, {
|
|
2618
2828
|
value: e,
|
|
2619
2829
|
onValueChange: t
|
|
2620
2830
|
})]
|
|
@@ -2622,80 +2832,80 @@ var en = () => {
|
|
|
2622
2832
|
]
|
|
2623
2833
|
})]
|
|
2624
2834
|
}),
|
|
2625
|
-
!s && /* @__PURE__ */ (0,
|
|
2835
|
+
!s && /* @__PURE__ */ (0, W.jsxs)(_n, {
|
|
2626
2836
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
2627
|
-
children: [/* @__PURE__ */ (0,
|
|
2837
|
+
children: [/* @__PURE__ */ (0, W.jsx)(vn, {
|
|
2628
2838
|
asChild: !0,
|
|
2629
|
-
children: /* @__PURE__ */ (0,
|
|
2839
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2630
2840
|
className: "flex items-center justify-between gap-4",
|
|
2631
|
-
children: [/* @__PURE__ */ (0,
|
|
2841
|
+
children: [/* @__PURE__ */ (0, W.jsx)("h4", {
|
|
2632
2842
|
className: "font-semibold text-sm",
|
|
2633
2843
|
children: o("editor.inputNodeForm.advancedConfiguration")
|
|
2634
|
-
}), /* @__PURE__ */ (0,
|
|
2844
|
+
}), /* @__PURE__ */ (0, W.jsxs)(m, {
|
|
2635
2845
|
variant: "ghost",
|
|
2636
2846
|
size: "icon",
|
|
2637
2847
|
className: "size-8",
|
|
2638
|
-
children: [/* @__PURE__ */ (0,
|
|
2848
|
+
children: [/* @__PURE__ */ (0, W.jsx)(L, {}), /* @__PURE__ */ (0, W.jsx)("span", {
|
|
2639
2849
|
className: "sr-only",
|
|
2640
2850
|
children: o("common.toggle")
|
|
2641
2851
|
})]
|
|
2642
2852
|
})]
|
|
2643
2853
|
})
|
|
2644
|
-
}), /* @__PURE__ */ (0,
|
|
2854
|
+
}), /* @__PURE__ */ (0, W.jsxs)(yn, {
|
|
2645
2855
|
className: "flex flex-col gap-6",
|
|
2646
|
-
children: [/* @__PURE__ */ (0,
|
|
2856
|
+
children: [/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2647
2857
|
name: "name",
|
|
2648
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2649
|
-
/* @__PURE__ */ (0,
|
|
2858
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [
|
|
2859
|
+
/* @__PURE__ */ (0, W.jsx)(u, {
|
|
2650
2860
|
htmlFor: e.name,
|
|
2651
2861
|
children: o("editor.inputNodeForm.name")
|
|
2652
2862
|
}),
|
|
2653
|
-
/* @__PURE__ */ (0,
|
|
2863
|
+
/* @__PURE__ */ (0, W.jsx)(h, {
|
|
2654
2864
|
id: e.name,
|
|
2655
2865
|
name: e.name,
|
|
2656
2866
|
value: e.state.value,
|
|
2657
2867
|
onBlur: e.handleBlur,
|
|
2658
2868
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
2659
2869
|
}),
|
|
2660
|
-
/* @__PURE__ */ (0,
|
|
2870
|
+
/* @__PURE__ */ (0, W.jsx)(E, { children: o("editor.inputNodeForm.nameDescription") })
|
|
2661
2871
|
] })
|
|
2662
|
-
}), /* @__PURE__ */ (0,
|
|
2872
|
+
}), /* @__PURE__ */ (0, W.jsx)(d, {
|
|
2663
2873
|
name: "defaultValue",
|
|
2664
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2665
|
-
/* @__PURE__ */ (0,
|
|
2874
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [
|
|
2875
|
+
/* @__PURE__ */ (0, W.jsxs)(T, { children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
2666
2876
|
htmlFor: e.name,
|
|
2667
2877
|
children: o("editor.inputNodeForm.defaultValueType")
|
|
2668
|
-
}), /* @__PURE__ */ (0,
|
|
2878
|
+
}), /* @__PURE__ */ (0, W.jsxs)(y, {
|
|
2669
2879
|
value: e.state.value?.type || "none",
|
|
2670
2880
|
onValueChange: (t) => {
|
|
2671
2881
|
e.handleChange(t === "none" ? null : { type: t });
|
|
2672
2882
|
},
|
|
2673
|
-
children: [/* @__PURE__ */ (0,
|
|
2883
|
+
children: [/* @__PURE__ */ (0, W.jsx)(_, {
|
|
2674
2884
|
id: e.name,
|
|
2675
|
-
children: /* @__PURE__ */ (0,
|
|
2676
|
-
}), /* @__PURE__ */ (0,
|
|
2677
|
-
/* @__PURE__ */ (0,
|
|
2885
|
+
children: /* @__PURE__ */ (0, W.jsx)(l, { placeholder: o("editor.inputNodeForm.selectType") })
|
|
2886
|
+
}), /* @__PURE__ */ (0, W.jsxs)(j, { children: [
|
|
2887
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
2678
2888
|
value: "none",
|
|
2679
2889
|
children: o("editor.inputNodeForm.defaultValueTypeNone")
|
|
2680
2890
|
}),
|
|
2681
|
-
/* @__PURE__ */ (0,
|
|
2891
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
2682
2892
|
value: "static",
|
|
2683
2893
|
children: o("editor.inputNodeForm.defaultValueTypeStatic")
|
|
2684
2894
|
}),
|
|
2685
|
-
/* @__PURE__ */ (0,
|
|
2895
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
2686
2896
|
value: "reference",
|
|
2687
2897
|
children: o("editor.inputNodeForm.defaultValueTypeReference")
|
|
2688
2898
|
})
|
|
2689
2899
|
] })]
|
|
2690
2900
|
})] }),
|
|
2691
|
-
e.state.value?.type === "static" && /* @__PURE__ */ (0,
|
|
2901
|
+
e.state.value?.type === "static" && /* @__PURE__ */ (0, W.jsx)(d, {
|
|
2692
2902
|
name: "defaultValue.staticValue",
|
|
2693
2903
|
children: (e) => {
|
|
2694
2904
|
let t = n?.data?.type;
|
|
2695
|
-
return (t === "select" || t === "checkbox") && n?.data?.multiple ? /* @__PURE__ */ (0,
|
|
2905
|
+
return (t === "select" || t === "checkbox") && n?.data?.multiple ? /* @__PURE__ */ (0, W.jsxs)(T, { children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
2696
2906
|
htmlFor: e.name,
|
|
2697
2907
|
children: o("editor.inputNodeForm.defaultValuesCommaSeparated")
|
|
2698
|
-
}), /* @__PURE__ */ (0,
|
|
2908
|
+
}), /* @__PURE__ */ (0, W.jsx)(h, {
|
|
2699
2909
|
id: e.name,
|
|
2700
2910
|
placeholder: o("editor.inputNodeForm.defaultValuesPlaceholder"),
|
|
2701
2911
|
value: Array.isArray(e.state.value) ? e.state.value.join(", ") : "",
|
|
@@ -2703,20 +2913,20 @@ var en = () => {
|
|
|
2703
2913
|
let n = t.value.split(",").map((e) => e.trim()).filter(Boolean);
|
|
2704
2914
|
e.handleChange(n.length > 0 ? n : null);
|
|
2705
2915
|
}
|
|
2706
|
-
})] }) : t === "checkbox" ? /* @__PURE__ */ (0,
|
|
2916
|
+
})] }) : t === "checkbox" ? /* @__PURE__ */ (0, W.jsx)(T, { children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2707
2917
|
className: "flex items-center space-x-2",
|
|
2708
|
-
children: [/* @__PURE__ */ (0,
|
|
2918
|
+
children: [/* @__PURE__ */ (0, W.jsx)(S, {
|
|
2709
2919
|
id: e.name,
|
|
2710
2920
|
checked: !!e.state.value,
|
|
2711
2921
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2712
|
-
}), /* @__PURE__ */ (0,
|
|
2922
|
+
}), /* @__PURE__ */ (0, W.jsx)(u, {
|
|
2713
2923
|
htmlFor: e.name,
|
|
2714
2924
|
children: o("editor.inputNodeForm.defaultChecked")
|
|
2715
2925
|
})]
|
|
2716
|
-
}) }) : /* @__PURE__ */ (0,
|
|
2926
|
+
}) }) : /* @__PURE__ */ (0, W.jsxs)(T, { children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
2717
2927
|
htmlFor: e.name,
|
|
2718
2928
|
children: o("editor.inputNodeForm.staticValue")
|
|
2719
|
-
}), /* @__PURE__ */ (0,
|
|
2929
|
+
}), /* @__PURE__ */ (0, W.jsx)(h, {
|
|
2720
2930
|
id: e.name,
|
|
2721
2931
|
placeholder: o("editor.inputNodeForm.staticValuePlaceholder"),
|
|
2722
2932
|
value: typeof e.state.value == "string" ? e.state.value : "",
|
|
@@ -2724,27 +2934,27 @@ var en = () => {
|
|
|
2724
2934
|
})] });
|
|
2725
2935
|
}
|
|
2726
2936
|
}),
|
|
2727
|
-
e.state.value?.type === "reference" && /* @__PURE__ */ (0,
|
|
2728
|
-
/* @__PURE__ */ (0,
|
|
2937
|
+
e.state.value?.type === "reference" && /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [
|
|
2938
|
+
/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2729
2939
|
name: "defaultValue.referenceField",
|
|
2730
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2731
|
-
/* @__PURE__ */ (0,
|
|
2940
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [
|
|
2941
|
+
/* @__PURE__ */ (0, W.jsx)(u, {
|
|
2732
2942
|
htmlFor: e.name,
|
|
2733
2943
|
children: o("editor.inputNodeForm.referenceField")
|
|
2734
2944
|
}),
|
|
2735
|
-
/* @__PURE__ */ (0,
|
|
2945
|
+
/* @__PURE__ */ (0, W.jsxs)(y, {
|
|
2736
2946
|
value: e.state.value || "",
|
|
2737
2947
|
onValueChange: (t) => {
|
|
2738
2948
|
e.handleChange(t);
|
|
2739
2949
|
},
|
|
2740
|
-
children: [/* @__PURE__ */ (0,
|
|
2950
|
+
children: [/* @__PURE__ */ (0, W.jsx)(_, {
|
|
2741
2951
|
id: e.name,
|
|
2742
|
-
children: /* @__PURE__ */ (0,
|
|
2743
|
-
}), /* @__PURE__ */ (0,
|
|
2952
|
+
children: /* @__PURE__ */ (0, W.jsx)(l, { placeholder: o("editor.inputNodeForm.selectReferenceField") })
|
|
2953
|
+
}), /* @__PURE__ */ (0, W.jsx)(j, { children: a.length === 0 ? /* @__PURE__ */ (0, W.jsx)(x, {
|
|
2744
2954
|
value: "none",
|
|
2745
2955
|
disabled: !0,
|
|
2746
2956
|
children: o("editor.inputNodeForm.noParentFieldsAvailable")
|
|
2747
|
-
}) : a.map((e) => /* @__PURE__ */ (0,
|
|
2957
|
+
}) : a.map((e) => /* @__PURE__ */ (0, W.jsxs)(x, {
|
|
2748
2958
|
value: e.nodeId,
|
|
2749
2959
|
children: [
|
|
2750
2960
|
e.label,
|
|
@@ -2754,17 +2964,17 @@ var en = () => {
|
|
|
2754
2964
|
]
|
|
2755
2965
|
}, e.nodeId)) })]
|
|
2756
2966
|
}),
|
|
2757
|
-
a.length === 0 && /* @__PURE__ */ (0,
|
|
2967
|
+
a.length === 0 && /* @__PURE__ */ (0, W.jsx)(E, { children: o("editor.inputNodeForm.addInputFieldsBeforeReference") })
|
|
2758
2968
|
] })
|
|
2759
2969
|
}),
|
|
2760
|
-
/* @__PURE__ */ (0,
|
|
2970
|
+
/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2761
2971
|
name: "defaultValue.transformFunction",
|
|
2762
|
-
children: (t) => /* @__PURE__ */ (0,
|
|
2763
|
-
/* @__PURE__ */ (0,
|
|
2972
|
+
children: (t) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [
|
|
2973
|
+
/* @__PURE__ */ (0, W.jsx)(u, {
|
|
2764
2974
|
htmlFor: t.name,
|
|
2765
2975
|
children: o("editor.inputNodeForm.transformType")
|
|
2766
2976
|
}),
|
|
2767
|
-
/* @__PURE__ */ (0,
|
|
2977
|
+
/* @__PURE__ */ (0, W.jsxs)(y, {
|
|
2768
2978
|
value: t.state.value || "none",
|
|
2769
2979
|
onValueChange: (n) => {
|
|
2770
2980
|
let r = n === "none" ? null : n;
|
|
@@ -2776,80 +2986,80 @@ var en = () => {
|
|
|
2776
2986
|
});
|
|
2777
2987
|
}
|
|
2778
2988
|
},
|
|
2779
|
-
children: [/* @__PURE__ */ (0,
|
|
2989
|
+
children: [/* @__PURE__ */ (0, W.jsx)(_, {
|
|
2780
2990
|
id: t.name,
|
|
2781
|
-
children: /* @__PURE__ */ (0,
|
|
2782
|
-
}), /* @__PURE__ */ (0,
|
|
2783
|
-
/* @__PURE__ */ (0,
|
|
2991
|
+
children: /* @__PURE__ */ (0, W.jsx)(l, { placeholder: o("editor.inputNodeForm.selectTransformation") })
|
|
2992
|
+
}), /* @__PURE__ */ (0, W.jsxs)(j, { children: [
|
|
2993
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
2784
2994
|
value: "none",
|
|
2785
2995
|
children: o("editor.inputNodeForm.transformNone")
|
|
2786
2996
|
}),
|
|
2787
|
-
/* @__PURE__ */ (0,
|
|
2997
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
2788
2998
|
value: "toString",
|
|
2789
2999
|
children: o("editor.inputNodeForm.transformString")
|
|
2790
3000
|
}),
|
|
2791
|
-
/* @__PURE__ */ (0,
|
|
3001
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
2792
3002
|
value: "toNumber",
|
|
2793
3003
|
children: o("editor.inputNodeForm.transformNumber")
|
|
2794
3004
|
}),
|
|
2795
|
-
/* @__PURE__ */ (0,
|
|
3005
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
2796
3006
|
value: "toBoolean",
|
|
2797
3007
|
children: o("editor.inputNodeForm.transformBoolean")
|
|
2798
3008
|
}),
|
|
2799
|
-
/* @__PURE__ */ (0,
|
|
3009
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
2800
3010
|
value: "toArray",
|
|
2801
3011
|
children: o("editor.inputNodeForm.transformArray")
|
|
2802
3012
|
}),
|
|
2803
|
-
/* @__PURE__ */ (0,
|
|
3013
|
+
/* @__PURE__ */ (0, W.jsx)(x, {
|
|
2804
3014
|
value: "toObject",
|
|
2805
3015
|
children: o("editor.inputNodeForm.transformMapToObject")
|
|
2806
3016
|
})
|
|
2807
3017
|
] })]
|
|
2808
3018
|
}),
|
|
2809
|
-
/* @__PURE__ */ (0,
|
|
3019
|
+
/* @__PURE__ */ (0, W.jsx)(E, { children: o("editor.inputNodeForm.transformDesc") })
|
|
2810
3020
|
] })
|
|
2811
3021
|
}),
|
|
2812
|
-
e.state.value?.transformFunction === "toObject" && /* @__PURE__ */ (0,
|
|
3022
|
+
e.state.value?.transformFunction === "toObject" && /* @__PURE__ */ (0, W.jsx)(d, {
|
|
2813
3023
|
name: "defaultValue.objectMapping",
|
|
2814
3024
|
mode: "array",
|
|
2815
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
2816
|
-
/* @__PURE__ */ (0,
|
|
2817
|
-
/* @__PURE__ */ (0,
|
|
3025
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(T, { children: [
|
|
3026
|
+
/* @__PURE__ */ (0, W.jsx)(u, { children: o("editor.inputNodeForm.objectMapping") }),
|
|
3027
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2818
3028
|
className: "space-y-2",
|
|
2819
|
-
children: [e.state.value?.map((t, n) => /* @__PURE__ */ (0,
|
|
3029
|
+
children: [e.state.value?.map((t, n) => /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2820
3030
|
className: "flex items-center gap-2",
|
|
2821
3031
|
children: [
|
|
2822
|
-
/* @__PURE__ */ (0,
|
|
3032
|
+
/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2823
3033
|
name: `defaultValue.objectMapping[${n}].sourceKey`,
|
|
2824
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
3034
|
+
children: (e) => /* @__PURE__ */ (0, W.jsx)(h, {
|
|
2825
3035
|
placeholder: o("editor.inputNodeForm.sourceKey"),
|
|
2826
3036
|
value: e.state.value || "",
|
|
2827
3037
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
2828
3038
|
})
|
|
2829
3039
|
}),
|
|
2830
|
-
/* @__PURE__ */ (0,
|
|
3040
|
+
/* @__PURE__ */ (0, W.jsx)("span", {
|
|
2831
3041
|
className: "text-muted-foreground",
|
|
2832
3042
|
children: "→"
|
|
2833
3043
|
}),
|
|
2834
|
-
/* @__PURE__ */ (0,
|
|
3044
|
+
/* @__PURE__ */ (0, W.jsx)(d, {
|
|
2835
3045
|
name: `defaultValue.objectMapping[${n}].targetKey`,
|
|
2836
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
3046
|
+
children: (e) => /* @__PURE__ */ (0, W.jsx)(h, {
|
|
2837
3047
|
placeholder: o("editor.inputNodeForm.targetKey"),
|
|
2838
3048
|
value: e.state.value || "",
|
|
2839
3049
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
2840
3050
|
})
|
|
2841
3051
|
}),
|
|
2842
|
-
/* @__PURE__ */ (0,
|
|
3052
|
+
/* @__PURE__ */ (0, W.jsx)(m, {
|
|
2843
3053
|
type: "button",
|
|
2844
3054
|
variant: "ghost",
|
|
2845
3055
|
size: "icon",
|
|
2846
3056
|
onClick: () => {
|
|
2847
3057
|
e.removeValue(n), c().then();
|
|
2848
3058
|
},
|
|
2849
|
-
children: /* @__PURE__ */ (0,
|
|
3059
|
+
children: /* @__PURE__ */ (0, W.jsx)(z, { className: "h-4 w-4" })
|
|
2850
3060
|
})
|
|
2851
3061
|
]
|
|
2852
|
-
}, `mapping-${n}`)), /* @__PURE__ */ (0,
|
|
3062
|
+
}, `mapping-${n}`)), /* @__PURE__ */ (0, W.jsxs)(m, {
|
|
2853
3063
|
type: "button",
|
|
2854
3064
|
variant: "outline",
|
|
2855
3065
|
size: "sm",
|
|
@@ -2860,10 +3070,10 @@ var en = () => {
|
|
|
2860
3070
|
targetKey: ""
|
|
2861
3071
|
}), c().then();
|
|
2862
3072
|
},
|
|
2863
|
-
children: [/* @__PURE__ */ (0,
|
|
3073
|
+
children: [/* @__PURE__ */ (0, W.jsx)(R, { className: "mr-2 h-4 w-4" }), o("editor.inputNodeForm.addMapping")]
|
|
2864
3074
|
})]
|
|
2865
3075
|
}),
|
|
2866
|
-
/* @__PURE__ */ (0,
|
|
3076
|
+
/* @__PURE__ */ (0, W.jsx)(E, { children: o("editor.inputNodeForm.objectMappingDesc") })
|
|
2867
3077
|
] })
|
|
2868
3078
|
})
|
|
2869
3079
|
] })
|
|
@@ -2874,11 +3084,8 @@ var en = () => {
|
|
|
2874
3084
|
]
|
|
2875
3085
|
})
|
|
2876
3086
|
});
|
|
2877
|
-
},
|
|
2878
|
-
|
|
2879
|
-
title: "title"
|
|
2880
|
-
}, nn = () => {
|
|
2881
|
-
let [e, t] = R("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = Q(), { Field: i } = z({
|
|
3087
|
+
}, xn = () => {
|
|
3088
|
+
let [e, t] = F("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = K(), { Field: i } = I({
|
|
2882
3089
|
defaultValues: {
|
|
2883
3090
|
label: n?.data?.label || { en: "" },
|
|
2884
3091
|
type: n?.data?.type || ""
|
|
@@ -2893,22 +3100,22 @@ var en = () => {
|
|
|
2893
3100
|
r(e);
|
|
2894
3101
|
}
|
|
2895
3102
|
});
|
|
2896
|
-
return /* @__PURE__ */ (0,
|
|
3103
|
+
return /* @__PURE__ */ (0, W.jsx)("form", {
|
|
2897
3104
|
onSubmit: (e) => {
|
|
2898
3105
|
e.preventDefault(), e.stopPropagation();
|
|
2899
3106
|
},
|
|
2900
|
-
children: /* @__PURE__ */ (0,
|
|
3107
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2901
3108
|
className: "grid gap-6",
|
|
2902
|
-
children: [/* @__PURE__ */ (0,
|
|
3109
|
+
children: [/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
2903
3110
|
className: "flex items-end gap-2",
|
|
2904
|
-
children: [/* @__PURE__ */ (0,
|
|
3111
|
+
children: [/* @__PURE__ */ (0, W.jsx)(i, {
|
|
2905
3112
|
name: "label",
|
|
2906
|
-
children: (t) => /* @__PURE__ */ (0,
|
|
3113
|
+
children: (t) => /* @__PURE__ */ (0, W.jsxs)(T, {
|
|
2907
3114
|
className: "flex-1",
|
|
2908
|
-
children: [/* @__PURE__ */ (0,
|
|
3115
|
+
children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
2909
3116
|
htmlFor: t.name,
|
|
2910
3117
|
children: "Label"
|
|
2911
|
-
}), /* @__PURE__ */ (0,
|
|
3118
|
+
}), /* @__PURE__ */ (0, W.jsx)(h, {
|
|
2912
3119
|
id: t.name,
|
|
2913
3120
|
name: t.name,
|
|
2914
3121
|
value: t.state.value?.[e] || "",
|
|
@@ -2921,35 +3128,35 @@ var en = () => {
|
|
|
2921
3128
|
}
|
|
2922
3129
|
})]
|
|
2923
3130
|
})
|
|
2924
|
-
}), /* @__PURE__ */ (0,
|
|
3131
|
+
}), /* @__PURE__ */ (0, W.jsx)(Q, {
|
|
2925
3132
|
value: e,
|
|
2926
3133
|
onValueChange: t
|
|
2927
3134
|
})]
|
|
2928
|
-
}), /* @__PURE__ */ (0,
|
|
3135
|
+
}), /* @__PURE__ */ (0, W.jsx)(i, {
|
|
2929
3136
|
name: "type",
|
|
2930
|
-
children: (e) => /* @__PURE__ */ (0,
|
|
3137
|
+
children: (e) => /* @__PURE__ */ (0, W.jsxs)(M, { children: [/* @__PURE__ */ (0, W.jsx)(le, {
|
|
2931
3138
|
htmlFor: e.name,
|
|
2932
3139
|
children: "Type"
|
|
2933
|
-
}), /* @__PURE__ */ (0,
|
|
3140
|
+
}), /* @__PURE__ */ (0, W.jsxs)(y, {
|
|
2934
3141
|
value: e.state.value,
|
|
2935
3142
|
onValueChange: (t) => e.handleChange(t),
|
|
2936
|
-
children: [/* @__PURE__ */ (0,
|
|
3143
|
+
children: [/* @__PURE__ */ (0, W.jsx)(_, {
|
|
2937
3144
|
id: e.name,
|
|
2938
3145
|
className: "w-full",
|
|
2939
|
-
children: /* @__PURE__ */ (0,
|
|
2940
|
-
}), /* @__PURE__ */ (0,
|
|
2941
|
-
value:
|
|
3146
|
+
children: /* @__PURE__ */ (0, W.jsx)(l, { placeholder: "" })
|
|
3147
|
+
}), /* @__PURE__ */ (0, W.jsx)(j, { children: /* @__PURE__ */ (0, W.jsxs)(M, { children: [/* @__PURE__ */ (0, W.jsx)(x, {
|
|
3148
|
+
value: At.title,
|
|
2942
3149
|
children: "Title"
|
|
2943
|
-
}), /* @__PURE__ */ (0,
|
|
2944
|
-
value:
|
|
3150
|
+
}), /* @__PURE__ */ (0, W.jsx)(x, {
|
|
3151
|
+
value: At.divider,
|
|
2945
3152
|
children: "Divider"
|
|
2946
3153
|
})] }) })]
|
|
2947
3154
|
})] })
|
|
2948
3155
|
})]
|
|
2949
3156
|
})
|
|
2950
3157
|
});
|
|
2951
|
-
},
|
|
2952
|
-
let [e, t] =
|
|
3158
|
+
}, Sn = () => {
|
|
3159
|
+
let [e, t] = F(""), [n, r] = F(!1), { selectedNode: i, groupNodes: o } = $(), { setNodes: s } = Ee(), c = i?.parentId || "none", f = a(i), p = G(), g = je(), b = je();
|
|
2953
3160
|
if (f) return null;
|
|
2954
3161
|
let S = (e) => {
|
|
2955
3162
|
i && s((t) => e === "none" ? t.map((e) => {
|
|
@@ -2973,10 +3180,10 @@ var en = () => {
|
|
|
2973
3180
|
let n = t.data?.label?.en || t.data?.label;
|
|
2974
3181
|
return String(n).toLowerCase() === e.trim().toLowerCase();
|
|
2975
3182
|
})) {
|
|
2976
|
-
|
|
3183
|
+
V.error("This group already exists", { description: "Use the selector to add the node to an existing group." });
|
|
2977
3184
|
return;
|
|
2978
3185
|
}
|
|
2979
|
-
let n =
|
|
3186
|
+
let n = q();
|
|
2980
3187
|
s((t) => [{
|
|
2981
3188
|
data: { label: { en: e.trim() } },
|
|
2982
3189
|
id: n,
|
|
@@ -2997,63 +3204,63 @@ var en = () => {
|
|
|
2997
3204
|
x: 175,
|
|
2998
3205
|
y: 30
|
|
2999
3206
|
}
|
|
3000
|
-
} : e)]), t(""), r(!1),
|
|
3207
|
+
} : e)]), t(""), r(!1), V.success("Group created", { description: `The group "${e.trim()}" has been created successfully.` });
|
|
3001
3208
|
};
|
|
3002
|
-
return /* @__PURE__ */ (0,
|
|
3209
|
+
return /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
3003
3210
|
className: "space-y-2",
|
|
3004
|
-
children: [/* @__PURE__ */ (0,
|
|
3211
|
+
children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
3005
3212
|
htmlFor: g,
|
|
3006
3213
|
children: p("editor.selectNodeGroup.group")
|
|
3007
|
-
}), /* @__PURE__ */ (0,
|
|
3214
|
+
}), /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
3008
3215
|
className: "flex gap-2",
|
|
3009
|
-
children: [/* @__PURE__ */ (0,
|
|
3216
|
+
children: [/* @__PURE__ */ (0, W.jsxs)(y, {
|
|
3010
3217
|
value: c,
|
|
3011
3218
|
onValueChange: S,
|
|
3012
|
-
children: [/* @__PURE__ */ (0,
|
|
3219
|
+
children: [/* @__PURE__ */ (0, W.jsx)(_, {
|
|
3013
3220
|
id: g,
|
|
3014
3221
|
className: "flex-1",
|
|
3015
|
-
children: /* @__PURE__ */ (0,
|
|
3016
|
-
}), /* @__PURE__ */ (0,
|
|
3222
|
+
children: /* @__PURE__ */ (0, W.jsx)(l, { placeholder: p("editor.selectNodeGroup.noGroup") })
|
|
3223
|
+
}), /* @__PURE__ */ (0, W.jsx)(j, { children: /* @__PURE__ */ (0, W.jsxs)(M, { children: [/* @__PURE__ */ (0, W.jsx)(x, {
|
|
3017
3224
|
value: "none",
|
|
3018
3225
|
children: p("editor.selectNodeGroup.noGroup")
|
|
3019
|
-
}), o.map((e) => /* @__PURE__ */ (0,
|
|
3226
|
+
}), o.map((e) => /* @__PURE__ */ (0, W.jsx)(x, {
|
|
3020
3227
|
value: e.id,
|
|
3021
3228
|
children: e.data.label?.en ? String(e.data.label?.en) : e.id
|
|
3022
3229
|
}, e.id))] }) })]
|
|
3023
|
-
}), /* @__PURE__ */ (0,
|
|
3230
|
+
}), /* @__PURE__ */ (0, W.jsxs)(ce, {
|
|
3024
3231
|
open: n,
|
|
3025
3232
|
onOpenChange: r,
|
|
3026
|
-
children: [/* @__PURE__ */ (0,
|
|
3233
|
+
children: [/* @__PURE__ */ (0, W.jsx)(d, {
|
|
3027
3234
|
asChild: !0,
|
|
3028
|
-
children: /* @__PURE__ */ (0,
|
|
3235
|
+
children: /* @__PURE__ */ (0, W.jsx)(m, {
|
|
3029
3236
|
variant: "outline",
|
|
3030
3237
|
size: "icon",
|
|
3031
3238
|
title: "Create a new group",
|
|
3032
|
-
children: /* @__PURE__ */ (0,
|
|
3239
|
+
children: /* @__PURE__ */ (0, W.jsx)(Ke, { className: "h-4 w-4" })
|
|
3033
3240
|
})
|
|
3034
|
-
}), /* @__PURE__ */ (0,
|
|
3241
|
+
}), /* @__PURE__ */ (0, W.jsx)(v, {
|
|
3035
3242
|
className: "w-80",
|
|
3036
3243
|
align: "end",
|
|
3037
3244
|
disablePortal: !0,
|
|
3038
|
-
children: /* @__PURE__ */ (0,
|
|
3245
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
3039
3246
|
className: "space-y-4",
|
|
3040
3247
|
children: [
|
|
3041
|
-
/* @__PURE__ */ (0,
|
|
3248
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
3042
3249
|
className: "space-y-2",
|
|
3043
|
-
children: [/* @__PURE__ */ (0,
|
|
3250
|
+
children: [/* @__PURE__ */ (0, W.jsx)("h4", {
|
|
3044
3251
|
className: "font-medium leading-none",
|
|
3045
3252
|
children: p("editor.selectNodeGroup.newGroup")
|
|
3046
|
-
}), /* @__PURE__ */ (0,
|
|
3253
|
+
}), /* @__PURE__ */ (0, W.jsx)("p", {
|
|
3047
3254
|
className: "text-muted-foreground text-sm",
|
|
3048
3255
|
children: p("editor.selectNodeGroup.newGroupDescription")
|
|
3049
3256
|
})]
|
|
3050
3257
|
}),
|
|
3051
|
-
/* @__PURE__ */ (0,
|
|
3258
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
3052
3259
|
className: "space-y-2",
|
|
3053
|
-
children: [/* @__PURE__ */ (0,
|
|
3260
|
+
children: [/* @__PURE__ */ (0, W.jsx)(u, {
|
|
3054
3261
|
htmlFor: b,
|
|
3055
3262
|
children: p("editor.selectNodeGroup.groupName")
|
|
3056
|
-
}), /* @__PURE__ */ (0,
|
|
3263
|
+
}), /* @__PURE__ */ (0, W.jsx)(h, {
|
|
3057
3264
|
autoFocus: !0,
|
|
3058
3265
|
id: b,
|
|
3059
3266
|
value: e,
|
|
@@ -3064,14 +3271,14 @@ var en = () => {
|
|
|
3064
3271
|
}
|
|
3065
3272
|
})]
|
|
3066
3273
|
}),
|
|
3067
|
-
/* @__PURE__ */ (0,
|
|
3274
|
+
/* @__PURE__ */ (0, W.jsxs)("div", {
|
|
3068
3275
|
className: "flex justify-end gap-2",
|
|
3069
|
-
children: [/* @__PURE__ */ (0,
|
|
3276
|
+
children: [/* @__PURE__ */ (0, W.jsx)(m, {
|
|
3070
3277
|
variant: "outline",
|
|
3071
3278
|
size: "sm",
|
|
3072
3279
|
onClick: () => r(!1),
|
|
3073
3280
|
children: "Cancel"
|
|
3074
|
-
}), /* @__PURE__ */ (0,
|
|
3281
|
+
}), /* @__PURE__ */ (0, W.jsx)(m, {
|
|
3075
3282
|
size: "sm",
|
|
3076
3283
|
onClick: C,
|
|
3077
3284
|
disabled: !e.trim(),
|
|
@@ -3084,20 +3291,20 @@ var en = () => {
|
|
|
3084
3291
|
})]
|
|
3085
3292
|
})]
|
|
3086
3293
|
});
|
|
3087
|
-
},
|
|
3088
|
-
let { selectedNode: e } = $(), { updateSelectedNodeType: t } =
|
|
3089
|
-
return /* @__PURE__ */ (0,
|
|
3294
|
+
}, Cn = () => {
|
|
3295
|
+
let { selectedNode: e } = $(), { updateSelectedNodeType: t } = K(), n = e?.type || "", r = a(e), i = G(), o = je();
|
|
3296
|
+
return /* @__PURE__ */ (0, W.jsxs)(M, { children: [/* @__PURE__ */ (0, W.jsx)(le, {
|
|
3090
3297
|
htmlFor: o,
|
|
3091
3298
|
children: i("editor.selectNodeType.nodeType")
|
|
3092
|
-
}), /* @__PURE__ */ (0,
|
|
3299
|
+
}), /* @__PURE__ */ (0, W.jsxs)(y, {
|
|
3093
3300
|
value: n,
|
|
3094
3301
|
onValueChange: (e) => t(e),
|
|
3095
3302
|
disabled: r,
|
|
3096
|
-
children: [/* @__PURE__ */ (0,
|
|
3303
|
+
children: [/* @__PURE__ */ (0, W.jsx)(_, {
|
|
3097
3304
|
className: "w-full",
|
|
3098
3305
|
id: o,
|
|
3099
|
-
children: /* @__PURE__ */ (0,
|
|
3100
|
-
}), /* @__PURE__ */ (0,
|
|
3306
|
+
children: /* @__PURE__ */ (0, W.jsx)(l, { placeholder: i("editor.selectNodeType.nodeType") })
|
|
3307
|
+
}), /* @__PURE__ */ (0, W.jsx)(j, { children: /* @__PURE__ */ (0, W.jsx)(M, { children: Object.keys(zt).filter((e) => r ? e === "group" : e !== "group").map((e) => /* @__PURE__ */ (0, W.jsx)(x, {
|
|
3101
3308
|
value: e,
|
|
3102
3309
|
children: i(`editor.selectNodeType.options.${e}`)
|
|
3103
3310
|
}, e)) }) })]
|
|
@@ -3105,136 +3312,136 @@ var en = () => {
|
|
|
3105
3312
|
};
|
|
3106
3313
|
//#endregion
|
|
3107
3314
|
//#region src/shared/components/ui/alert-dialog.tsx
|
|
3108
|
-
function
|
|
3109
|
-
return /* @__PURE__ */ (0,
|
|
3315
|
+
function wn({ ...e }) {
|
|
3316
|
+
return /* @__PURE__ */ (0, W.jsx)(U.Root, {
|
|
3110
3317
|
"data-slot": "alert-dialog",
|
|
3111
3318
|
...e
|
|
3112
3319
|
});
|
|
3113
3320
|
}
|
|
3114
|
-
function
|
|
3115
|
-
return /* @__PURE__ */ (0,
|
|
3321
|
+
function Tn({ ...e }) {
|
|
3322
|
+
return /* @__PURE__ */ (0, W.jsx)(U.Trigger, {
|
|
3116
3323
|
"data-slot": "alert-dialog-trigger",
|
|
3117
3324
|
...e
|
|
3118
3325
|
});
|
|
3119
3326
|
}
|
|
3120
|
-
function
|
|
3121
|
-
return /* @__PURE__ */ (0,
|
|
3327
|
+
function En({ ...e }) {
|
|
3328
|
+
return /* @__PURE__ */ (0, W.jsx)(U.Portal, {
|
|
3122
3329
|
"data-slot": "alert-dialog-portal",
|
|
3123
3330
|
...e
|
|
3124
3331
|
});
|
|
3125
3332
|
}
|
|
3126
|
-
function
|
|
3127
|
-
return /* @__PURE__ */ (0,
|
|
3333
|
+
function Dn({ className: e, ...t }) {
|
|
3334
|
+
return /* @__PURE__ */ (0, W.jsx)(U.Overlay, {
|
|
3128
3335
|
"data-slot": "alert-dialog-overlay",
|
|
3129
3336
|
className: f("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in", e),
|
|
3130
3337
|
...t
|
|
3131
3338
|
});
|
|
3132
3339
|
}
|
|
3133
|
-
function
|
|
3134
|
-
return /* @__PURE__ */ (0,
|
|
3340
|
+
function On({ className: e, ...t }) {
|
|
3341
|
+
return /* @__PURE__ */ (0, W.jsxs)(En, { children: [/* @__PURE__ */ (0, W.jsx)(Dn, {}), /* @__PURE__ */ (0, W.jsx)(U.Content, {
|
|
3135
3342
|
"data-slot": "alert-dialog-content",
|
|
3136
3343
|
className: f("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg", e),
|
|
3137
3344
|
...t
|
|
3138
3345
|
})] });
|
|
3139
3346
|
}
|
|
3140
|
-
function
|
|
3141
|
-
return /* @__PURE__ */ (0,
|
|
3347
|
+
function kn({ className: e, ...t }) {
|
|
3348
|
+
return /* @__PURE__ */ (0, W.jsx)("div", {
|
|
3142
3349
|
"data-slot": "alert-dialog-header",
|
|
3143
3350
|
className: f("flex flex-col gap-2 text-center sm:text-left", e),
|
|
3144
3351
|
...t
|
|
3145
3352
|
});
|
|
3146
3353
|
}
|
|
3147
|
-
function
|
|
3148
|
-
return /* @__PURE__ */ (0,
|
|
3354
|
+
function An({ className: e, ...t }) {
|
|
3355
|
+
return /* @__PURE__ */ (0, W.jsx)("div", {
|
|
3149
3356
|
"data-slot": "alert-dialog-footer",
|
|
3150
3357
|
className: f("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
|
|
3151
3358
|
...t
|
|
3152
3359
|
});
|
|
3153
3360
|
}
|
|
3154
|
-
function
|
|
3155
|
-
return /* @__PURE__ */ (0,
|
|
3361
|
+
function jn({ className: e, ...t }) {
|
|
3362
|
+
return /* @__PURE__ */ (0, W.jsx)(U.Title, {
|
|
3156
3363
|
"data-slot": "alert-dialog-title",
|
|
3157
3364
|
className: f("font-semibold text-lg", e),
|
|
3158
3365
|
...t
|
|
3159
3366
|
});
|
|
3160
3367
|
}
|
|
3161
|
-
function
|
|
3162
|
-
return /* @__PURE__ */ (0,
|
|
3368
|
+
function Mn({ className: e, ...t }) {
|
|
3369
|
+
return /* @__PURE__ */ (0, W.jsx)(U.Description, {
|
|
3163
3370
|
"data-slot": "alert-dialog-description",
|
|
3164
3371
|
className: f("text-muted-foreground text-sm", e),
|
|
3165
3372
|
...t
|
|
3166
3373
|
});
|
|
3167
3374
|
}
|
|
3168
|
-
function
|
|
3169
|
-
return /* @__PURE__ */ (0,
|
|
3375
|
+
function Nn({ className: e, ...t }) {
|
|
3376
|
+
return /* @__PURE__ */ (0, W.jsx)(U.Action, {
|
|
3170
3377
|
className: f(g(), e),
|
|
3171
3378
|
...t
|
|
3172
3379
|
});
|
|
3173
3380
|
}
|
|
3174
|
-
function
|
|
3175
|
-
return /* @__PURE__ */ (0,
|
|
3381
|
+
function Pn({ className: e, ...t }) {
|
|
3382
|
+
return /* @__PURE__ */ (0, W.jsx)(U.Cancel, {
|
|
3176
3383
|
className: f(g({ variant: "outline" }), e),
|
|
3177
3384
|
...t
|
|
3178
3385
|
});
|
|
3179
3386
|
}
|
|
3180
3387
|
//#endregion
|
|
3181
3388
|
//#region src/shared/components/ui/sheet.tsx
|
|
3182
|
-
function
|
|
3183
|
-
return /* @__PURE__ */ (0,
|
|
3389
|
+
function Fn({ ...e }) {
|
|
3390
|
+
return /* @__PURE__ */ (0, W.jsx)(H.Root, {
|
|
3184
3391
|
"data-slot": "sheet",
|
|
3185
3392
|
...e
|
|
3186
3393
|
});
|
|
3187
3394
|
}
|
|
3188
|
-
function
|
|
3189
|
-
return /* @__PURE__ */ (0,
|
|
3395
|
+
function In({ ...e }) {
|
|
3396
|
+
return /* @__PURE__ */ (0, W.jsx)(H.Portal, {
|
|
3190
3397
|
"data-slot": "sheet-portal",
|
|
3191
3398
|
...e
|
|
3192
3399
|
});
|
|
3193
3400
|
}
|
|
3194
|
-
function
|
|
3195
|
-
return /* @__PURE__ */ (0,
|
|
3401
|
+
function Ln({ className: e, ...t }) {
|
|
3402
|
+
return /* @__PURE__ */ (0, W.jsx)(H.Overlay, {
|
|
3196
3403
|
"data-slot": "sheet-overlay",
|
|
3197
3404
|
className: f("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in", e),
|
|
3198
3405
|
...t
|
|
3199
3406
|
});
|
|
3200
3407
|
}
|
|
3201
|
-
function
|
|
3202
|
-
return /* @__PURE__ */ (0,
|
|
3408
|
+
function Rn({ className: e, children: t, side: n = "right", ...r }) {
|
|
3409
|
+
return /* @__PURE__ */ (0, W.jsxs)(In, { children: [/* @__PURE__ */ (0, W.jsx)(Ln, {}), /* @__PURE__ */ (0, W.jsxs)(H.Content, {
|
|
3203
3410
|
"data-slot": "sheet-content",
|
|
3204
3411
|
className: f("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:duration-300 data-[state=open]:duration-500", n === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm", n === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm", n === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b", n === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t", e),
|
|
3205
3412
|
...r,
|
|
3206
|
-
children: [t, /* @__PURE__ */ (0,
|
|
3413
|
+
children: [t, /* @__PURE__ */ (0, W.jsxs)(H.Close, {
|
|
3207
3414
|
className: "absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",
|
|
3208
|
-
children: [/* @__PURE__ */ (0,
|
|
3415
|
+
children: [/* @__PURE__ */ (0, W.jsx)(et, { className: "size-4" }), /* @__PURE__ */ (0, W.jsx)("span", {
|
|
3209
3416
|
className: "sr-only",
|
|
3210
3417
|
children: "Close"
|
|
3211
3418
|
})]
|
|
3212
3419
|
})]
|
|
3213
3420
|
})] });
|
|
3214
3421
|
}
|
|
3215
|
-
function
|
|
3216
|
-
return /* @__PURE__ */ (0,
|
|
3422
|
+
function zn({ className: e, ...t }) {
|
|
3423
|
+
return /* @__PURE__ */ (0, W.jsx)("div", {
|
|
3217
3424
|
"data-slot": "sheet-header",
|
|
3218
3425
|
className: f("flex flex-col gap-1.5 p-4", e),
|
|
3219
3426
|
...t
|
|
3220
3427
|
});
|
|
3221
3428
|
}
|
|
3222
|
-
function
|
|
3223
|
-
return /* @__PURE__ */ (0,
|
|
3429
|
+
function Bn({ className: e, ...t }) {
|
|
3430
|
+
return /* @__PURE__ */ (0, W.jsx)("div", {
|
|
3224
3431
|
"data-slot": "sheet-footer",
|
|
3225
3432
|
className: f("mt-auto flex flex-col gap-2 p-4", e),
|
|
3226
3433
|
...t
|
|
3227
3434
|
});
|
|
3228
3435
|
}
|
|
3229
|
-
function
|
|
3230
|
-
return /* @__PURE__ */ (0,
|
|
3436
|
+
function Vn({ className: e, ...t }) {
|
|
3437
|
+
return /* @__PURE__ */ (0, W.jsx)(H.Title, {
|
|
3231
3438
|
"data-slot": "sheet-title",
|
|
3232
3439
|
className: f("font-semibold text-foreground", e),
|
|
3233
3440
|
...t
|
|
3234
3441
|
});
|
|
3235
3442
|
}
|
|
3236
|
-
function
|
|
3237
|
-
return /* @__PURE__ */ (0,
|
|
3443
|
+
function Hn({ className: e, ...t }) {
|
|
3444
|
+
return /* @__PURE__ */ (0, W.jsx)(H.Description, {
|
|
3238
3445
|
"data-slot": "sheet-description",
|
|
3239
3446
|
className: f("text-muted-foreground text-sm", e),
|
|
3240
3447
|
...t
|
|
@@ -3242,59 +3449,63 @@ function wn({ className: e, ...t }) {
|
|
|
3242
3449
|
}
|
|
3243
3450
|
//#endregion
|
|
3244
3451
|
//#region src/editor/features/TreegeEditor/sheets/NodeActionsSheet.tsx
|
|
3245
|
-
var
|
|
3246
|
-
let { selectedNode: e
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3452
|
+
var Un = () => {
|
|
3453
|
+
let { selectedNode: e } = $(), { clearSelection: r, deleteSelectedNode: i } = K(), { isNodeSheetOpen: o, setIsNodeSheetOpen: s } = pt(), l = G(), u = l(e?.data?.label), d = () => {
|
|
3454
|
+
s(!1), r();
|
|
3455
|
+
};
|
|
3456
|
+
return /* @__PURE__ */ (0, W.jsx)(Fn, {
|
|
3457
|
+
open: o && !!e,
|
|
3458
|
+
onOpenChange: (e) => {
|
|
3459
|
+
e || d();
|
|
3460
|
+
},
|
|
3461
|
+
children: /* @__PURE__ */ (0, W.jsxs)(Rn, {
|
|
3251
3462
|
className: "flex flex-col gap-0",
|
|
3252
3463
|
children: [
|
|
3253
|
-
/* @__PURE__ */ (0,
|
|
3254
|
-
|
|
3464
|
+
/* @__PURE__ */ (0, W.jsxs)(zn, { children: [/* @__PURE__ */ (0, W.jsxs)(Vn, { children: [
|
|
3465
|
+
l("editor.nodeActionsSheet.editNode"),
|
|
3255
3466
|
" ",
|
|
3256
|
-
/* @__PURE__ */ (0,
|
|
3467
|
+
/* @__PURE__ */ (0, W.jsx)("span", {
|
|
3257
3468
|
className: "font-light text-muted-foreground text-xs",
|
|
3258
3469
|
children: e?.id
|
|
3259
3470
|
})
|
|
3260
|
-
] }), /* @__PURE__ */ (0,
|
|
3261
|
-
/* @__PURE__ */ (0,
|
|
3471
|
+
] }), /* @__PURE__ */ (0, W.jsx)(Hn, { children: u || "\xA0" })] }),
|
|
3472
|
+
/* @__PURE__ */ (0, W.jsx)(mt, {
|
|
3262
3473
|
className: "flex min-h-0 flex-1 flex-col px-4",
|
|
3263
|
-
children: /* @__PURE__ */ (0,
|
|
3474
|
+
children: /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
3264
3475
|
className: "space-y-6 py-4",
|
|
3265
3476
|
children: [
|
|
3266
|
-
/* @__PURE__ */ (0,
|
|
3267
|
-
/* @__PURE__ */ (0,
|
|
3268
|
-
/* @__PURE__ */ (0,
|
|
3269
|
-
c(e) && /* @__PURE__ */ (0,
|
|
3270
|
-
n(e) && /* @__PURE__ */ (0,
|
|
3271
|
-
t(e) && /* @__PURE__ */ (0,
|
|
3272
|
-
a(e) && /* @__PURE__ */ (0,
|
|
3477
|
+
/* @__PURE__ */ (0, W.jsx)(Cn, {}),
|
|
3478
|
+
/* @__PURE__ */ (0, W.jsx)(Sn, {}),
|
|
3479
|
+
/* @__PURE__ */ (0, W.jsx)(oe, {}),
|
|
3480
|
+
c(e) && /* @__PURE__ */ (0, W.jsx)(bn, {}),
|
|
3481
|
+
n(e) && /* @__PURE__ */ (0, W.jsx)(xn, {}),
|
|
3482
|
+
t(e) && /* @__PURE__ */ (0, W.jsx)($t, {}),
|
|
3483
|
+
a(e) && /* @__PURE__ */ (0, W.jsx)(en, {})
|
|
3273
3484
|
]
|
|
3274
3485
|
})
|
|
3275
3486
|
}),
|
|
3276
|
-
/* @__PURE__ */ (0,
|
|
3487
|
+
/* @__PURE__ */ (0, W.jsx)(Bn, {
|
|
3277
3488
|
className: "flex items-end border-t",
|
|
3278
|
-
children: /* @__PURE__ */ (0,
|
|
3489
|
+
children: /* @__PURE__ */ (0, W.jsxs)(wn, { children: [/* @__PURE__ */ (0, W.jsx)(Tn, {
|
|
3279
3490
|
asChild: !0,
|
|
3280
|
-
children: /* @__PURE__ */ (0,
|
|
3491
|
+
children: /* @__PURE__ */ (0, W.jsx)(m, {
|
|
3281
3492
|
variant: "ghost",
|
|
3282
3493
|
size: "icon",
|
|
3283
|
-
children: /* @__PURE__ */ (0,
|
|
3494
|
+
children: /* @__PURE__ */ (0, W.jsx)(Ye, {})
|
|
3284
3495
|
})
|
|
3285
|
-
}), /* @__PURE__ */ (0,
|
|
3496
|
+
}), /* @__PURE__ */ (0, W.jsxs)(On, { children: [/* @__PURE__ */ (0, W.jsxs)(kn, { children: [/* @__PURE__ */ (0, W.jsx)(jn, { children: l("editor.nodeActionsSheet.deleteNode") }), /* @__PURE__ */ (0, W.jsx)(Mn, { children: l("editor.nodeActionsSheet.deleteNodeConfirm") })] }), /* @__PURE__ */ (0, W.jsxs)(An, { children: [/* @__PURE__ */ (0, W.jsx)(Pn, { children: l("common.cancel") }), /* @__PURE__ */ (0, W.jsx)(Nn, {
|
|
3286
3497
|
onClick: () => {
|
|
3287
|
-
|
|
3498
|
+
i(), d();
|
|
3288
3499
|
},
|
|
3289
|
-
children:
|
|
3500
|
+
children: l("common.delete")
|
|
3290
3501
|
})] })] })] })
|
|
3291
3502
|
})
|
|
3292
3503
|
]
|
|
3293
3504
|
})
|
|
3294
3505
|
});
|
|
3295
|
-
},
|
|
3296
|
-
let { theme: t = "system" } =
|
|
3297
|
-
return /* @__PURE__ */ (0,
|
|
3506
|
+
}, Wn = ({ ...e }) => {
|
|
3507
|
+
let { theme: t = "system" } = ot();
|
|
3508
|
+
return /* @__PURE__ */ (0, W.jsx)(it, {
|
|
3298
3509
|
theme: t,
|
|
3299
3510
|
className: "toaster group",
|
|
3300
3511
|
style: {
|
|
@@ -3304,14 +3515,14 @@ var Tn = () => {
|
|
|
3304
3515
|
},
|
|
3305
3516
|
...e
|
|
3306
3517
|
});
|
|
3307
|
-
},
|
|
3308
|
-
let { onConnect: a, onConnectEnd: o, onEdgesDelete: s, isValidConnection: c } =
|
|
3309
|
-
return /* @__PURE__ */ (0,
|
|
3518
|
+
}, Gn = ({ flow: e, onExportJson: t, onSave: n, theme: r, className: i }) => {
|
|
3519
|
+
let { onConnect: a, onConnectEnd: o, onEdgesDelete: s, isValidConnection: c } = Et();
|
|
3520
|
+
return /* @__PURE__ */ (0, W.jsxs)(be, {
|
|
3310
3521
|
fitView: !0,
|
|
3311
3522
|
colorMode: r,
|
|
3312
3523
|
selectNodesOnDrag: !1,
|
|
3313
|
-
nodeTypes:
|
|
3314
|
-
edgeTypes:
|
|
3524
|
+
nodeTypes: zt,
|
|
3525
|
+
edgeTypes: gt,
|
|
3315
3526
|
defaultEdges: e?.edges || [],
|
|
3316
3527
|
defaultNodes: e?.nodes || [],
|
|
3317
3528
|
onConnect: a,
|
|
@@ -3320,31 +3531,31 @@ var Tn = () => {
|
|
|
3320
3531
|
isValidConnection: c,
|
|
3321
3532
|
className: f(i, "treege"),
|
|
3322
3533
|
children: [
|
|
3323
|
-
/* @__PURE__ */ (0,
|
|
3534
|
+
/* @__PURE__ */ (0, W.jsx)(ue, {
|
|
3324
3535
|
gap: 10,
|
|
3325
3536
|
variant: de.Dots
|
|
3326
3537
|
}),
|
|
3327
|
-
/* @__PURE__ */ (0,
|
|
3538
|
+
/* @__PURE__ */ (0, W.jsx)(Zt, {
|
|
3328
3539
|
onExportJson: t,
|
|
3329
3540
|
onSave: n
|
|
3330
3541
|
}),
|
|
3331
|
-
/* @__PURE__ */ (0,
|
|
3332
|
-
/* @__PURE__ */ (0,
|
|
3333
|
-
/* @__PURE__ */ (0,
|
|
3334
|
-
/* @__PURE__ */ (0,
|
|
3542
|
+
/* @__PURE__ */ (0, W.jsx)(lt, { theme: r }),
|
|
3543
|
+
/* @__PURE__ */ (0, W.jsx)(ge, {}),
|
|
3544
|
+
/* @__PURE__ */ (0, W.jsx)(pe, {}),
|
|
3545
|
+
/* @__PURE__ */ (0, W.jsx)(Un, {})
|
|
3335
3546
|
]
|
|
3336
3547
|
});
|
|
3337
|
-
},
|
|
3548
|
+
}, Kn = ({ flow: e, onExportJson: t, onSave: n, theme: r = "dark", language: i = "en", aiConfig: a }) => /* @__PURE__ */ (0, W.jsx)(s, {
|
|
3338
3549
|
defaultTheme: r,
|
|
3339
3550
|
storageKey: "treege-editor-theme",
|
|
3340
3551
|
theme: r,
|
|
3341
|
-
children: /* @__PURE__ */ (0,
|
|
3552
|
+
children: /* @__PURE__ */ (0, W.jsxs)(ft, {
|
|
3342
3553
|
value: {
|
|
3343
3554
|
aiConfig: a,
|
|
3344
3555
|
flowId: e?.id,
|
|
3345
3556
|
language: i
|
|
3346
3557
|
},
|
|
3347
|
-
children: [/* @__PURE__ */ (0,
|
|
3558
|
+
children: [/* @__PURE__ */ (0, W.jsx)(Wn, { position: "bottom-center" }), /* @__PURE__ */ (0, W.jsx)(xe, { children: /* @__PURE__ */ (0, W.jsx)(Gn, {
|
|
3348
3559
|
onExportJson: t,
|
|
3349
3560
|
onSave: n,
|
|
3350
3561
|
flow: e,
|
|
@@ -3353,4 +3564,4 @@ var Tn = () => {
|
|
|
3353
3564
|
})
|
|
3354
3565
|
});
|
|
3355
3566
|
//#endregion
|
|
3356
|
-
export {
|
|
3567
|
+
export { Kn as t };
|