@datatechsolutions/ui 3.14.0 → 3.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/astrlabe/index.js +108 -108
- package/dist/astrlabe/index.mjs +4 -4
- package/dist/astrlabe/workflow-canvas.js +4 -4
- package/dist/astrlabe/workflow-canvas.mjs +3 -3
- package/dist/{chunk-FHGWXWVZ.js → chunk-2JPS5OND.js} +45 -45
- package/dist/{chunk-FHGWXWVZ.js.map → chunk-2JPS5OND.js.map} +1 -1
- package/dist/{chunk-YFMMZHL5.js → chunk-2QZFKQP6.js} +26 -26
- package/dist/{chunk-YFMMZHL5.js.map → chunk-2QZFKQP6.js.map} +1 -1
- package/dist/{chunk-U7VMFQFN.mjs → chunk-3FOLXKVP.mjs} +4 -4
- package/dist/{chunk-U7VMFQFN.mjs.map → chunk-3FOLXKVP.mjs.map} +1 -1
- package/dist/{chunk-LJGPMMKB.js → chunk-435TRHC2.js} +72 -72
- package/dist/{chunk-LJGPMMKB.js.map → chunk-435TRHC2.js.map} +1 -1
- package/dist/{chunk-WE35EV7J.mjs → chunk-5QRU3KKV.mjs} +3 -3
- package/dist/{chunk-WE35EV7J.mjs.map → chunk-5QRU3KKV.mjs.map} +1 -1
- package/dist/{chunk-7SDB2VC2.js → chunk-6UUFPSAR.js} +4 -4
- package/dist/{chunk-7SDB2VC2.js.map → chunk-6UUFPSAR.js.map} +1 -1
- package/dist/{chunk-OTQXU4WG.mjs → chunk-7LIJTAIF.mjs} +8 -8
- package/dist/{chunk-OTQXU4WG.mjs.map → chunk-7LIJTAIF.mjs.map} +1 -1
- package/dist/{chunk-Q5TZTA6H.mjs → chunk-A5M7SPPG.mjs} +3 -3
- package/dist/{chunk-Q5TZTA6H.mjs.map → chunk-A5M7SPPG.mjs.map} +1 -1
- package/dist/{chunk-4HZ55YKZ.js → chunk-BN4BKFE2.js} +9 -9
- package/dist/{chunk-4HZ55YKZ.js.map → chunk-BN4BKFE2.js.map} +1 -1
- package/dist/{chunk-5SCZB5UI.js → chunk-C4UYEHPY.js} +84 -84
- package/dist/chunk-C4UYEHPY.js.map +1 -0
- package/dist/{chunk-AUCS2KF4.js → chunk-CPTHSYM2.js} +10 -10
- package/dist/{chunk-AUCS2KF4.js.map → chunk-CPTHSYM2.js.map} +1 -1
- package/dist/{chunk-PO66V2PN.mjs → chunk-EZVBRLQH.mjs} +3 -3
- package/dist/{chunk-PO66V2PN.mjs.map → chunk-EZVBRLQH.mjs.map} +1 -1
- package/dist/{chunk-T7DROKWJ.mjs → chunk-F3PQ5EFQ.mjs} +3 -3
- package/dist/{chunk-T7DROKWJ.mjs.map → chunk-F3PQ5EFQ.mjs.map} +1 -1
- package/dist/{chunk-ZE6U4N4Q.js → chunk-GD3YV46U.js} +36 -36
- package/dist/{chunk-ZE6U4N4Q.js.map → chunk-GD3YV46U.js.map} +1 -1
- package/dist/{chunk-5YCH7FHT.mjs → chunk-I6ULYJR4.mjs} +3 -3
- package/dist/{chunk-5YCH7FHT.mjs.map → chunk-I6ULYJR4.mjs.map} +1 -1
- package/dist/{chunk-Q2FUNDCP.mjs → chunk-JJUWZNJY.mjs} +3 -3
- package/dist/{chunk-Q2FUNDCP.mjs.map → chunk-JJUWZNJY.mjs.map} +1 -1
- package/dist/{chunk-ZIRD3X6G.js → chunk-KRS2CLPR.js} +139 -139
- package/dist/chunk-KRS2CLPR.js.map +1 -0
- package/dist/{chunk-FZUV7GNB.js → chunk-KZDABEML.js} +41 -41
- package/dist/{chunk-FZUV7GNB.js.map → chunk-KZDABEML.js.map} +1 -1
- package/dist/{chunk-33ZWFDVG.mjs → chunk-MSXJFWKD.mjs} +17 -17
- package/dist/chunk-MSXJFWKD.mjs.map +1 -0
- package/dist/{chunk-HQNIETHV.mjs → chunk-NNR44MM5.mjs} +7 -7
- package/dist/{chunk-HQNIETHV.mjs.map → chunk-NNR44MM5.mjs.map} +1 -1
- package/dist/{chunk-72XZ7DSF.js → chunk-NQCFGIWC.js} +13 -13
- package/dist/{chunk-72XZ7DSF.js.map → chunk-NQCFGIWC.js.map} +1 -1
- package/dist/{chunk-NIZSQJRW.js → chunk-OQM252SM.js} +30 -30
- package/dist/{chunk-NIZSQJRW.js.map → chunk-OQM252SM.js.map} +1 -1
- package/dist/{chunk-2II2NLAZ.js → chunk-PADXORD2.js} +34 -34
- package/dist/{chunk-2II2NLAZ.js.map → chunk-PADXORD2.js.map} +1 -1
- package/dist/{chunk-N6SGVUTR.mjs → chunk-PSS3E463.mjs} +3 -3
- package/dist/{chunk-N6SGVUTR.mjs.map → chunk-PSS3E463.mjs.map} +1 -1
- package/dist/{chunk-F4KHAKTP.mjs → chunk-QCGSE24W.mjs} +41 -41
- package/dist/{chunk-F4KHAKTP.mjs.map → chunk-QCGSE24W.mjs.map} +1 -1
- package/dist/{chunk-7NHJSD4A.mjs → chunk-RH6Z425K.mjs} +6 -6
- package/dist/{chunk-7NHJSD4A.mjs.map → chunk-RH6Z425K.mjs.map} +1 -1
- package/dist/{chunk-WTSMTLSP.mjs → chunk-SMUBE3RO.mjs} +11 -11
- package/dist/chunk-SMUBE3RO.mjs.map +1 -0
- package/dist/{chunk-PXGESUKI.js → chunk-WG26KW6D.js} +36 -36
- package/dist/{chunk-PXGESUKI.js.map → chunk-WG26KW6D.js.map} +1 -1
- package/dist/{chunk-NXWIT4YQ.mjs → chunk-WGS65S7S.mjs} +3 -3
- package/dist/{chunk-NXWIT4YQ.mjs.map → chunk-WGS65S7S.mjs.map} +1 -1
- package/dist/{chunk-4P72IJOM.js → chunk-XJJZ6DHE.js} +4 -4
- package/dist/{chunk-4P72IJOM.js.map → chunk-XJJZ6DHE.js.map} +1 -1
- package/dist/index.js +664 -664
- package/dist/index.mjs +2 -2
- package/dist/platform/admin/index.js +10 -10
- package/dist/platform/admin/index.mjs +4 -4
- package/dist/platform/agents-workspace.js +7 -7
- package/dist/platform/agents-workspace.mjs +6 -6
- package/dist/platform/app-shell.js +4 -4
- package/dist/platform/app-shell.mjs +3 -3
- package/dist/platform/auth/index.js +22 -22
- package/dist/platform/auth/index.mjs +4 -4
- package/dist/platform/billing/index.js +4 -4
- package/dist/platform/billing/index.mjs +3 -3
- package/dist/platform/impersonation/index.js +4 -4
- package/dist/platform/impersonation/index.mjs +3 -3
- package/dist/platform/index.js +78 -78
- package/dist/platform/index.mjs +18 -18
- package/dist/platform/pages/index.js +1485 -1554
- package/dist/platform/pages/index.js.map +1 -1
- package/dist/platform/pages/index.mjs +1270 -1339
- package/dist/platform/pages/index.mjs.map +1 -1
- package/dist/platform/settings/index.js +7 -7
- package/dist/platform/settings/index.mjs +6 -6
- package/dist/platform/workflow-canvas-shell.js +5 -5
- package/dist/platform/workflow-canvas-shell.mjs +4 -4
- package/package.json +1 -1
- package/dist/chunk-33ZWFDVG.mjs.map +0 -1
- package/dist/chunk-5SCZB5UI.js.map +0 -1
- package/dist/chunk-WTSMTLSP.mjs.map +0 -1
- package/dist/chunk-ZIRD3X6G.js.map +0 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { adaptWorkflowGraphToUi, formatDurationMs } from '../../chunk-UQXVCVAN.mjs';
|
|
3
|
-
import { WorkflowWorkspace } from '../../chunk-
|
|
4
|
-
export { RolesPageView, UsersPageView } from '../../chunk-
|
|
5
|
-
import { DIALECT_CATEGORIES, DatasourceModal, findDialect, findCategory } from '../../chunk-
|
|
6
|
-
export { DIALECT_CATEGORIES, DatasourceFormModal, DatasourceModal, findCategory, findDialect } from '../../chunk-
|
|
7
|
-
import { defaultRuleForm, RuleForm, ExecutionTimelinePanel, defaultRuleCondition, defaultRuleAction, RuleConditionBuilder, RuleActionBuilder } from '../../chunk-
|
|
3
|
+
import { WorkflowWorkspace } from '../../chunk-3FOLXKVP.mjs';
|
|
4
|
+
export { RolesPageView, UsersPageView } from '../../chunk-3FOLXKVP.mjs';
|
|
5
|
+
import { DIALECT_CATEGORIES, DatasourceModal, findDialect, findCategory } from '../../chunk-A5M7SPPG.mjs';
|
|
6
|
+
export { DIALECT_CATEGORIES, DatasourceFormModal, DatasourceModal, findCategory, findDialect } from '../../chunk-A5M7SPPG.mjs';
|
|
7
|
+
import { defaultRuleForm, RuleForm, ExecutionTimelinePanel, defaultRuleCondition, defaultRuleAction, RuleConditionBuilder, RuleActionBuilder } from '../../chunk-SMUBE3RO.mjs';
|
|
8
8
|
import '../../chunk-JB6RNAD2.mjs';
|
|
9
9
|
import '../../chunk-LEXBTVGM.mjs';
|
|
10
|
-
import '../../chunk-
|
|
11
|
-
import { HeroSection, SearchBar, FormSection, ChipPicker, PageLoadingState, PageEmptyState, EntityCard, CreateActionButton, GlassModal, FormGrid, FormSelect, FormInput, FormTextarea, SectionHeader, Text, Form, FormActionsRow, Table, TableHead, TableRow, TableHeader, TableBody, TableCell, InlineForm, CopyableId, ListCard, ListCardItem, Avatar, SectionCard, Tabs, TabsList, TabsTrigger, TabsContent, StepIndicator, FilterTileButton, PickerTile, FormToggle, Spinner, StatusBadge, FormCheckbox, SegmentedControl, DatePicker, TimePicker } from '../../chunk-
|
|
10
|
+
import '../../chunk-MSXJFWKD.mjs';
|
|
11
|
+
import { HeroSection, SearchBar, FormSection, ChipPicker, PageLoadingState, PageEmptyState, EntityCard, CreateActionButton, GlassModal, FormGrid, FormSelect, FormInput, FormTextarea, SectionHeader, Text, Form, FormActionsRow, Table, TableHead, TableRow, TableHeader, TableBody, TableCell, InlineForm, CopyableId, ListCard, ListCardItem, Avatar, SectionCard, Tabs, TabsList, TabsTrigger, TabsContent, StepIndicator, Card, CardContent, FilterTileButton, PickerTile, FormToggle, Spinner, StatusBadge, FormCheckbox, SegmentedControl, DatePicker, TimePicker } from '../../chunk-QCGSE24W.mjs';
|
|
12
|
+
import '../../chunk-ZEFNBGYI.mjs';
|
|
12
13
|
import '../../chunk-NBW6WJQT.mjs';
|
|
13
14
|
import '../../chunk-3AY5HIQ6.mjs';
|
|
14
|
-
import '../../chunk-ZEFNBGYI.mjs';
|
|
15
15
|
import '../../chunk-KDDXDQR2.mjs';
|
|
16
|
-
import { Button, Badge } from '../../chunk-2SBVFLPZ.mjs';
|
|
16
|
+
import { Button, Badge, IconButton } from '../../chunk-2SBVFLPZ.mjs';
|
|
17
17
|
import '../../chunk-D2JF6C3E.mjs';
|
|
18
18
|
import { useLink } from '../../chunk-QWG2FMUN.mjs';
|
|
19
19
|
import '../../chunk-G7JQ4OCE.mjs';
|
|
20
20
|
import { useState, useMemo, useEffect, useCallback } from 'react';
|
|
21
|
-
import { CubeTransparentIcon, CpuChipIcon, ChatBubbleLeftEllipsisIcon, WrenchScrewdriverIcon, AdjustmentsHorizontalIcon, CircleStackIcon, RectangleStackIcon, ClockIcon, LinkIcon, KeyIcon, ArrowPathIcon, TrashIcon, PlusIcon,
|
|
21
|
+
import { CubeTransparentIcon, CpuChipIcon, ChatBubbleLeftEllipsisIcon, WrenchScrewdriverIcon, AdjustmentsHorizontalIcon, CircleStackIcon, RectangleStackIcon, ClockIcon, LinkIcon, KeyIcon, ArrowPathIcon, TrashIcon, PlusIcon, XMarkIcon, CodeBracketIcon, ServerStackIcon, SparklesIcon, BoltIcon, CloudIcon, BeakerIcon, GlobeAltIcon, BellAlertIcon, PencilIcon, ArrowUpCircleIcon, PencilSquareIcon } from '@heroicons/react/24/outline';
|
|
22
22
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
23
23
|
|
|
24
24
|
function AgentsModelsPageView({ labels, models, loading }) {
|
|
@@ -1786,20 +1786,20 @@ function DatasourcesPageView({
|
|
|
1786
1786
|
title: ds.name ?? ds.id,
|
|
1787
1787
|
subtitle: dialectLabel,
|
|
1788
1788
|
status: /* @__PURE__ */ jsx(Badge, { color: ds.enabled ? "emerald" : "zinc", children: ds.enabled ? labels.enabled : labels.disabled }),
|
|
1789
|
-
footer: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-
|
|
1789
|
+
footer: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-slate-400 dark:text-slate-500", children: [
|
|
1790
1790
|
ds.readOnly && /* @__PURE__ */ jsx("span", { className: "rounded-full bg-blue-100 px-2 py-0.5 text-[10px] font-semibold text-blue-700 dark:bg-blue-900/30 dark:text-blue-300", children: "Read-only" }),
|
|
1791
1791
|
ds.timeoutMs && /* @__PURE__ */ jsxs("span", { children: [
|
|
1792
1792
|
ds.timeoutMs / 1e3,
|
|
1793
1793
|
"s timeout"
|
|
1794
1794
|
] })
|
|
1795
1795
|
] }),
|
|
1796
|
-
children: /* @__PURE__ */ jsxs("div", { className: "mt-2 text-xs text-
|
|
1796
|
+
children: /* @__PURE__ */ jsxs("div", { className: "mt-2 text-xs text-slate-500 dark:text-slate-400", children: [
|
|
1797
1797
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
1798
1798
|
labels.dialect,
|
|
1799
1799
|
": ",
|
|
1800
1800
|
dialectLabel
|
|
1801
1801
|
] }),
|
|
1802
|
-
ds.slug && /* @__PURE__ */ jsxs("div", { className: "truncate text-
|
|
1802
|
+
ds.slug && /* @__PURE__ */ jsxs("div", { className: "truncate text-slate-400", children: [
|
|
1803
1803
|
"/",
|
|
1804
1804
|
ds.slug
|
|
1805
1805
|
] })
|
|
@@ -3664,7 +3664,6 @@ function AgentNewWizardPageView({
|
|
|
3664
3664
|
setSubmitting(false);
|
|
3665
3665
|
}
|
|
3666
3666
|
}
|
|
3667
|
-
const counter = labels.wizardStepCounter.replace("{current}", String(step)).replace("{total}", String(TOTAL_STEPS));
|
|
3668
3667
|
const hero = /* @__PURE__ */ jsx(
|
|
3669
3668
|
HeroSection,
|
|
3670
3669
|
{
|
|
@@ -3676,10 +3675,19 @@ function AgentNewWizardPageView({
|
|
|
3676
3675
|
children: emoji
|
|
3677
3676
|
}
|
|
3678
3677
|
),
|
|
3679
|
-
label:
|
|
3680
|
-
title:
|
|
3678
|
+
label: labels.pageTitle,
|
|
3679
|
+
title: stepTitles[step - 1],
|
|
3681
3680
|
subtitle: stepSubtitles[step - 1],
|
|
3682
3681
|
gradient: activePreset.accent,
|
|
3682
|
+
actions: /* @__PURE__ */ jsx(
|
|
3683
|
+
IconButton,
|
|
3684
|
+
{
|
|
3685
|
+
label: labels.wizardCancel,
|
|
3686
|
+
icon: /* @__PURE__ */ jsx(XMarkIcon, { className: "h-5 w-5" }),
|
|
3687
|
+
variant: "ghost",
|
|
3688
|
+
onClick: cancelWithConfirm
|
|
3689
|
+
}
|
|
3690
|
+
),
|
|
3683
3691
|
children: /* @__PURE__ */ jsx(
|
|
3684
3692
|
StepIndicator,
|
|
3685
3693
|
{
|
|
@@ -3694,466 +3702,376 @@ function AgentNewWizardPageView({
|
|
|
3694
3702
|
);
|
|
3695
3703
|
function renderStep1() {
|
|
3696
3704
|
return /* @__PURE__ */ jsx(
|
|
3697
|
-
|
|
3698
|
-
{
|
|
3699
|
-
variant: "glass",
|
|
3700
|
-
header: {
|
|
3701
|
-
title: labels.presetTitle,
|
|
3702
|
-
subtitle: labels.presetSubtitle
|
|
3703
|
-
},
|
|
3704
|
-
children: /* @__PURE__ */ jsx(
|
|
3705
|
-
"div",
|
|
3706
|
-
{
|
|
3707
|
-
role: "radiogroup",
|
|
3708
|
-
"aria-label": labels.presetTitle,
|
|
3709
|
-
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
3710
|
-
children: AGENT_PRESETS.map((preset) => {
|
|
3711
|
-
const selected = preset.id === presetId;
|
|
3712
|
-
return /* @__PURE__ */ jsx(
|
|
3713
|
-
FilterTileButton,
|
|
3714
|
-
{
|
|
3715
|
-
isActive: selected,
|
|
3716
|
-
color: preset.tileColor,
|
|
3717
|
-
icon: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-base leading-none", children: preset.emoji }),
|
|
3718
|
-
label: preset.id === "custom" ? labels.presetCustom : preset.name,
|
|
3719
|
-
count: preset.role || labels.presetCustomHint,
|
|
3720
|
-
onClick: () => applyPreset(preset)
|
|
3721
|
-
},
|
|
3722
|
-
preset.id
|
|
3723
|
-
);
|
|
3724
|
-
})
|
|
3725
|
-
}
|
|
3726
|
-
)
|
|
3727
|
-
}
|
|
3728
|
-
);
|
|
3729
|
-
}
|
|
3730
|
-
function renderStep2() {
|
|
3731
|
-
return /* @__PURE__ */ jsx(
|
|
3732
|
-
SectionCard,
|
|
3733
|
-
{
|
|
3734
|
-
variant: "glass",
|
|
3735
|
-
header: {
|
|
3736
|
-
title: labels.identitySection,
|
|
3737
|
-
subtitle: labels.identitySubtitle
|
|
3738
|
-
},
|
|
3739
|
-
children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
3740
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
3741
|
-
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.avatarLabel }),
|
|
3742
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5", children: EMOJI_PALETTE.map((e) => /* @__PURE__ */ jsx(
|
|
3743
|
-
PickerTile,
|
|
3744
|
-
{
|
|
3745
|
-
onClick: () => {
|
|
3746
|
-
setEmoji(e);
|
|
3747
|
-
markTouched();
|
|
3748
|
-
},
|
|
3749
|
-
selected: emoji === e,
|
|
3750
|
-
className: [
|
|
3751
|
-
"flex h-9 w-9 items-center justify-center rounded-lg text-base transition-all",
|
|
3752
|
-
emoji === e ? `bg-gradient-to-br ${activePreset.accent} shadow-sm ring-2 ring-indigo-500/70 ring-offset-1 ring-offset-transparent` : "liquid-surface hover:border-indigo-400/40 focus-visible:ring-2 focus-visible:ring-indigo-500/70 focus-visible:ring-offset-1"
|
|
3753
|
-
].join(" "),
|
|
3754
|
-
children: e
|
|
3755
|
-
},
|
|
3756
|
-
e
|
|
3757
|
-
)) })
|
|
3758
|
-
] }),
|
|
3759
|
-
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
3760
|
-
/* @__PURE__ */ jsx(
|
|
3761
|
-
FormInput,
|
|
3762
|
-
{
|
|
3763
|
-
label: labels.name,
|
|
3764
|
-
value: name,
|
|
3765
|
-
onValueChange: (v) => {
|
|
3766
|
-
setName(v);
|
|
3767
|
-
markTouched();
|
|
3768
|
-
},
|
|
3769
|
-
required: true,
|
|
3770
|
-
placeholder: labels.namePlaceholder
|
|
3771
|
-
}
|
|
3772
|
-
),
|
|
3773
|
-
/* @__PURE__ */ jsx(
|
|
3774
|
-
FormInput,
|
|
3775
|
-
{
|
|
3776
|
-
label: labels.role,
|
|
3777
|
-
value: role,
|
|
3778
|
-
onValueChange: (v) => {
|
|
3779
|
-
setRole(v);
|
|
3780
|
-
markTouched();
|
|
3781
|
-
},
|
|
3782
|
-
placeholder: labels.rolePlaceholder
|
|
3783
|
-
}
|
|
3784
|
-
)
|
|
3785
|
-
] }),
|
|
3786
|
-
/* @__PURE__ */ jsx(
|
|
3787
|
-
FormTextarea,
|
|
3788
|
-
{
|
|
3789
|
-
label: labels.descriptionLabel,
|
|
3790
|
-
value: description,
|
|
3791
|
-
onValueChange: (v) => {
|
|
3792
|
-
setDescription(v);
|
|
3793
|
-
markTouched();
|
|
3794
|
-
},
|
|
3795
|
-
rows: 3,
|
|
3796
|
-
placeholder: labels.descriptionPlaceholder
|
|
3797
|
-
}
|
|
3798
|
-
)
|
|
3799
|
-
] })
|
|
3800
|
-
}
|
|
3801
|
-
);
|
|
3802
|
-
}
|
|
3803
|
-
function renderStep3() {
|
|
3804
|
-
return /* @__PURE__ */ jsx(
|
|
3805
|
-
SectionCard,
|
|
3705
|
+
"div",
|
|
3806
3706
|
{
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
/* @__PURE__ */ jsx(
|
|
3815
|
-
FormSelect,
|
|
3816
|
-
{
|
|
3817
|
-
label: labels.connectionLabel,
|
|
3818
|
-
value: connectionId,
|
|
3819
|
-
onValueChange: (v) => {
|
|
3820
|
-
setConnectionId(v);
|
|
3821
|
-
markTouched();
|
|
3822
|
-
},
|
|
3823
|
-
options: connectionOptions,
|
|
3824
|
-
icon: /* @__PURE__ */ jsx(LinkIcon, { className: "h-4 w-4" })
|
|
3825
|
-
}
|
|
3826
|
-
),
|
|
3827
|
-
/* @__PURE__ */ jsx(
|
|
3828
|
-
FormSelect,
|
|
3829
|
-
{
|
|
3830
|
-
label: labels.frameworkLabel,
|
|
3831
|
-
value: framework,
|
|
3832
|
-
onValueChange: (v) => {
|
|
3833
|
-
setFramework(v);
|
|
3834
|
-
markTouched();
|
|
3835
|
-
},
|
|
3836
|
-
options: frameworkOptions
|
|
3837
|
-
}
|
|
3838
|
-
),
|
|
3839
|
-
/* @__PURE__ */ jsx(
|
|
3840
|
-
FormSelect,
|
|
3841
|
-
{
|
|
3842
|
-
label: labels.model,
|
|
3843
|
-
value: modelId,
|
|
3844
|
-
onValueChange: (v) => {
|
|
3845
|
-
setModelId(v);
|
|
3846
|
-
markTouched();
|
|
3847
|
-
},
|
|
3848
|
-
options: modelOptions.length > 0 ? modelOptions : [{ value: "", label: labels.modelEmpty }]
|
|
3849
|
-
}
|
|
3850
|
-
)
|
|
3851
|
-
] }),
|
|
3852
|
-
/* @__PURE__ */ jsx(
|
|
3853
|
-
FormTextarea,
|
|
3707
|
+
role: "radiogroup",
|
|
3708
|
+
"aria-label": labels.presetTitle,
|
|
3709
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
3710
|
+
children: AGENT_PRESETS.map((preset) => {
|
|
3711
|
+
const selected = preset.id === presetId;
|
|
3712
|
+
return /* @__PURE__ */ jsx(
|
|
3713
|
+
FilterTileButton,
|
|
3854
3714
|
{
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
] })
|
|
3715
|
+
isActive: selected,
|
|
3716
|
+
color: preset.tileColor,
|
|
3717
|
+
icon: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-base leading-none", children: preset.emoji }),
|
|
3718
|
+
label: preset.id === "custom" ? labels.presetCustom : preset.name,
|
|
3719
|
+
count: preset.role || labels.presetCustomHint,
|
|
3720
|
+
onClick: () => applyPreset(preset)
|
|
3721
|
+
},
|
|
3722
|
+
preset.id
|
|
3723
|
+
);
|
|
3724
|
+
})
|
|
3866
3725
|
}
|
|
3867
3726
|
);
|
|
3868
3727
|
}
|
|
3869
|
-
function
|
|
3728
|
+
function renderStep2() {
|
|
3870
3729
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
3730
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3731
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.avatarLabel }),
|
|
3732
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5", children: EMOJI_PALETTE.map((e) => /* @__PURE__ */ jsx(
|
|
3733
|
+
PickerTile,
|
|
3734
|
+
{
|
|
3735
|
+
onClick: () => {
|
|
3736
|
+
setEmoji(e);
|
|
3737
|
+
markTouched();
|
|
3738
|
+
},
|
|
3739
|
+
selected: emoji === e,
|
|
3740
|
+
className: [
|
|
3741
|
+
"flex h-9 w-9 items-center justify-center rounded-lg text-base transition-all",
|
|
3742
|
+
emoji === e ? `bg-gradient-to-br ${activePreset.accent} shadow-sm ring-2 ring-indigo-500/70 ring-offset-1 ring-offset-transparent` : "liquid-surface hover:border-indigo-400/40 focus-visible:ring-2 focus-visible:ring-indigo-500/70 focus-visible:ring-offset-1"
|
|
3743
|
+
].join(" "),
|
|
3744
|
+
children: e
|
|
3745
|
+
},
|
|
3746
|
+
e
|
|
3747
|
+
)) })
|
|
3748
|
+
] }),
|
|
3749
|
+
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
3750
|
+
/* @__PURE__ */ jsx(
|
|
3751
|
+
FormInput,
|
|
3752
|
+
{
|
|
3753
|
+
label: labels.name,
|
|
3754
|
+
value: name,
|
|
3755
|
+
onValueChange: (v) => {
|
|
3756
|
+
setName(v);
|
|
3757
|
+
markTouched();
|
|
3758
|
+
},
|
|
3759
|
+
required: true,
|
|
3760
|
+
placeholder: labels.namePlaceholder
|
|
3761
|
+
}
|
|
3762
|
+
),
|
|
3763
|
+
/* @__PURE__ */ jsx(
|
|
3764
|
+
FormInput,
|
|
3765
|
+
{
|
|
3766
|
+
label: labels.role,
|
|
3767
|
+
value: role,
|
|
3768
|
+
onValueChange: (v) => {
|
|
3769
|
+
setRole(v);
|
|
3770
|
+
markTouched();
|
|
3771
|
+
},
|
|
3772
|
+
placeholder: labels.rolePlaceholder
|
|
3773
|
+
}
|
|
3774
|
+
)
|
|
3775
|
+
] }),
|
|
3871
3776
|
/* @__PURE__ */ jsx(
|
|
3872
|
-
|
|
3777
|
+
FormTextarea,
|
|
3873
3778
|
{
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3779
|
+
label: labels.descriptionLabel,
|
|
3780
|
+
value: description,
|
|
3781
|
+
onValueChange: (v) => {
|
|
3782
|
+
setDescription(v);
|
|
3783
|
+
markTouched();
|
|
3878
3784
|
},
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
FormTextarea,
|
|
3882
|
-
{
|
|
3883
|
-
label: labels.promptSystemPrompt,
|
|
3884
|
-
value: systemPrompt,
|
|
3885
|
-
onValueChange: (v) => {
|
|
3886
|
-
setSystemPrompt(v);
|
|
3887
|
-
markTouched();
|
|
3888
|
-
},
|
|
3889
|
-
rows: 8,
|
|
3890
|
-
placeholder: labels.promptPlaceholder,
|
|
3891
|
-
hint: `${systemPrompt.length} chars`
|
|
3892
|
-
}
|
|
3893
|
-
),
|
|
3894
|
-
/* @__PURE__ */ jsx(
|
|
3895
|
-
FormTextarea,
|
|
3896
|
-
{
|
|
3897
|
-
label: labels.userPromptLabel,
|
|
3898
|
-
value: userPrompt,
|
|
3899
|
-
onValueChange: (v) => {
|
|
3900
|
-
setUserPrompt(v);
|
|
3901
|
-
markTouched();
|
|
3902
|
-
},
|
|
3903
|
-
rows: 5,
|
|
3904
|
-
placeholder: labels.userPromptPlaceholder,
|
|
3905
|
-
hint: `${userPrompt.length} chars`
|
|
3906
|
-
}
|
|
3907
|
-
),
|
|
3908
|
-
/* @__PURE__ */ jsx(
|
|
3909
|
-
RangeSliderField,
|
|
3910
|
-
{
|
|
3911
|
-
sliderId: "wizard-temperature",
|
|
3912
|
-
label: labels.temperature,
|
|
3913
|
-
value: temperature,
|
|
3914
|
-
onChange: (v) => {
|
|
3915
|
-
setTemperature(v);
|
|
3916
|
-
markTouched();
|
|
3917
|
-
},
|
|
3918
|
-
min: 0,
|
|
3919
|
-
max: 1,
|
|
3920
|
-
step: 0.05,
|
|
3921
|
-
trackGradient: "linear-gradient(90deg, #3b82f6, #8b5cf6 50%, #ec4899)",
|
|
3922
|
-
formatValue: (v) => v.toFixed(2),
|
|
3923
|
-
zones: [
|
|
3924
|
-
{ label: "Precise", max: 0.3, color: "text-blue-500", thumbColor: "#3b82f6" },
|
|
3925
|
-
{ label: "Balanced", max: 0.7, color: "text-purple-500", thumbColor: "#8b5cf6" },
|
|
3926
|
-
{ label: "Creative", max: 1, color: "text-pink-500", thumbColor: "#ec4899" }
|
|
3927
|
-
]
|
|
3928
|
-
}
|
|
3929
|
-
),
|
|
3930
|
-
/* @__PURE__ */ jsx(
|
|
3931
|
-
RangeSliderField,
|
|
3932
|
-
{
|
|
3933
|
-
sliderId: "wizard-top-p",
|
|
3934
|
-
label: labels.topPLabel,
|
|
3935
|
-
value: topP,
|
|
3936
|
-
onChange: (v) => {
|
|
3937
|
-
setTopP(v);
|
|
3938
|
-
markTouched();
|
|
3939
|
-
},
|
|
3940
|
-
min: 0,
|
|
3941
|
-
max: 1,
|
|
3942
|
-
step: 0.05,
|
|
3943
|
-
trackGradient: "linear-gradient(90deg, #6366f1, #8b5cf6)",
|
|
3944
|
-
formatValue: (v) => v.toFixed(2),
|
|
3945
|
-
zones: [
|
|
3946
|
-
{ label: "Top-P", max: 1, color: "text-violet-500", thumbColor: "#8b5cf6" }
|
|
3947
|
-
]
|
|
3948
|
-
}
|
|
3949
|
-
),
|
|
3950
|
-
/* @__PURE__ */ jsx(
|
|
3951
|
-
RangeSliderField,
|
|
3952
|
-
{
|
|
3953
|
-
sliderId: "wizard-top-k",
|
|
3954
|
-
label: labels.topKLabel,
|
|
3955
|
-
value: topK,
|
|
3956
|
-
onChange: (v) => {
|
|
3957
|
-
setTopK(Math.max(0, Math.floor(v)));
|
|
3958
|
-
markTouched();
|
|
3959
|
-
},
|
|
3960
|
-
min: 0,
|
|
3961
|
-
max: 500,
|
|
3962
|
-
step: 1,
|
|
3963
|
-
trackGradient: "linear-gradient(90deg, #10b981, #14b8a6)",
|
|
3964
|
-
formatValue: (v) => v.toString(),
|
|
3965
|
-
zones: [
|
|
3966
|
-
{ label: "Top-K", max: 500, color: "text-emerald-500", thumbColor: "#10b981" }
|
|
3967
|
-
]
|
|
3968
|
-
}
|
|
3969
|
-
),
|
|
3970
|
-
/* @__PURE__ */ jsx(
|
|
3971
|
-
FormInput,
|
|
3972
|
-
{
|
|
3973
|
-
label: labels.maxTokens,
|
|
3974
|
-
type: "number",
|
|
3975
|
-
value: String(maxTokens),
|
|
3976
|
-
onValueChange: (v) => {
|
|
3977
|
-
setMaxTokens(Math.max(1, Math.floor(Number(v) || 0)));
|
|
3978
|
-
markTouched();
|
|
3979
|
-
},
|
|
3980
|
-
min: 1,
|
|
3981
|
-
max: 32e3,
|
|
3982
|
-
step: 1,
|
|
3983
|
-
hint: maxTokens.toLocaleString()
|
|
3984
|
-
}
|
|
3985
|
-
),
|
|
3986
|
-
/* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-lg border border-slate-200/30 dark:border-white/10", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-px bg-slate-200/30 dark:bg-white/10", children: [
|
|
3987
|
-
/* @__PURE__ */ jsxs("div", { className: "bg-white/60 px-3 py-2 dark:bg-slate-900/60", children: [
|
|
3988
|
-
/* @__PURE__ */ jsx("p", { className: "text-[9px] uppercase tracking-wider text-slate-400 dark:text-slate-500", children: labels.model }),
|
|
3989
|
-
/* @__PURE__ */ jsx("p", { className: "truncate text-xs font-semibold text-slate-900 dark:text-white", children: matchingModels.find((m) => m.id === modelId)?.name ?? labels.modelEmpty })
|
|
3990
|
-
] }),
|
|
3991
|
-
/* @__PURE__ */ jsxs("div", { className: "bg-white/60 px-3 py-2 dark:bg-slate-900/60", children: [
|
|
3992
|
-
/* @__PURE__ */ jsx("p", { className: "text-[9px] uppercase tracking-wider text-slate-400 dark:text-slate-500", children: labels.maxTokens }),
|
|
3993
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-slate-900 dark:text-white", children: maxTokens.toLocaleString() })
|
|
3994
|
-
] }),
|
|
3995
|
-
/* @__PURE__ */ jsxs("div", { className: "bg-white/60 px-3 py-2 dark:bg-slate-900/60", children: [
|
|
3996
|
-
/* @__PURE__ */ jsx("p", { className: "text-[9px] uppercase tracking-wider text-slate-400 dark:text-slate-500", children: labels.temperature }),
|
|
3997
|
-
/* @__PURE__ */ jsxs("p", { className: `text-xs font-semibold ${temperature <= 0.3 ? "text-blue-500" : temperature <= 0.7 ? "text-purple-500" : "text-pink-500"}`, children: [
|
|
3998
|
-
temperature.toFixed(2),
|
|
3999
|
-
" \xB7 ",
|
|
4000
|
-
temperature <= 0.3 ? "Precise" : temperature <= 0.7 ? "Balanced" : "Creative"
|
|
4001
|
-
] })
|
|
4002
|
-
] })
|
|
4003
|
-
] }) })
|
|
4004
|
-
] })
|
|
3785
|
+
rows: 3,
|
|
3786
|
+
placeholder: labels.descriptionPlaceholder
|
|
4005
3787
|
}
|
|
4006
|
-
)
|
|
3788
|
+
)
|
|
3789
|
+
] });
|
|
3790
|
+
}
|
|
3791
|
+
function renderStep3() {
|
|
3792
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
3793
|
+
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
3794
|
+
/* @__PURE__ */ jsx(
|
|
3795
|
+
FormSelect,
|
|
3796
|
+
{
|
|
3797
|
+
label: labels.connectionLabel,
|
|
3798
|
+
value: connectionId,
|
|
3799
|
+
onValueChange: (v) => {
|
|
3800
|
+
setConnectionId(v);
|
|
3801
|
+
markTouched();
|
|
3802
|
+
},
|
|
3803
|
+
options: connectionOptions,
|
|
3804
|
+
icon: /* @__PURE__ */ jsx(LinkIcon, { className: "h-4 w-4" })
|
|
3805
|
+
}
|
|
3806
|
+
),
|
|
3807
|
+
/* @__PURE__ */ jsx(
|
|
3808
|
+
FormSelect,
|
|
3809
|
+
{
|
|
3810
|
+
label: labels.frameworkLabel,
|
|
3811
|
+
value: framework,
|
|
3812
|
+
onValueChange: (v) => {
|
|
3813
|
+
setFramework(v);
|
|
3814
|
+
markTouched();
|
|
3815
|
+
},
|
|
3816
|
+
options: frameworkOptions
|
|
3817
|
+
}
|
|
3818
|
+
),
|
|
3819
|
+
/* @__PURE__ */ jsx(
|
|
3820
|
+
FormSelect,
|
|
3821
|
+
{
|
|
3822
|
+
label: labels.model,
|
|
3823
|
+
value: modelId,
|
|
3824
|
+
onValueChange: (v) => {
|
|
3825
|
+
setModelId(v);
|
|
3826
|
+
markTouched();
|
|
3827
|
+
},
|
|
3828
|
+
options: modelOptions.length > 0 ? modelOptions : [{ value: "", label: labels.modelEmpty }]
|
|
3829
|
+
}
|
|
3830
|
+
)
|
|
3831
|
+
] }),
|
|
4007
3832
|
/* @__PURE__ */ jsx(
|
|
4008
|
-
|
|
3833
|
+
FormTextarea,
|
|
4009
3834
|
{
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
3835
|
+
label: labels.outputSchemaLabel,
|
|
3836
|
+
value: outputSchema,
|
|
3837
|
+
onValueChange: (v) => {
|
|
3838
|
+
setOutputSchema(v);
|
|
3839
|
+
markTouched();
|
|
4014
3840
|
},
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.difficultyLabel }),
|
|
4018
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-4", children: DIFFICULTY_OPTIONS.map((opt) => {
|
|
4019
|
-
const selected = difficulty === opt.id;
|
|
4020
|
-
const label = opt.id === "beginner" ? labels.difficultyBeginner : opt.id === "intermediate" ? labels.difficultyIntermediate : opt.id === "advanced" ? labels.difficultyAdvanced : labels.difficultyExpert;
|
|
4021
|
-
return /* @__PURE__ */ jsxs(
|
|
4022
|
-
PickerTile,
|
|
4023
|
-
{
|
|
4024
|
-
onClick: () => {
|
|
4025
|
-
setDifficulty(opt.id);
|
|
4026
|
-
markTouched();
|
|
4027
|
-
},
|
|
4028
|
-
selected,
|
|
4029
|
-
className: [
|
|
4030
|
-
"liquid-surface flex items-center gap-2 rounded-xl px-3 py-2 text-left transition-all",
|
|
4031
|
-
selected ? "ring-2 ring-indigo-500/70 ring-offset-1 ring-offset-transparent" : "hover:border-indigo-400/40 focus-visible:ring-2 focus-visible:ring-indigo-500/70 focus-visible:ring-offset-1"
|
|
4032
|
-
].join(" "),
|
|
4033
|
-
children: [
|
|
4034
|
-
/* @__PURE__ */ jsx(
|
|
4035
|
-
"span",
|
|
4036
|
-
{
|
|
4037
|
-
"aria-hidden": "true",
|
|
4038
|
-
className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br ${opt.accent} text-base shadow-sm`,
|
|
4039
|
-
children: opt.emoji
|
|
4040
|
-
}
|
|
4041
|
-
),
|
|
4042
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-slate-900 dark:text-white", children: label })
|
|
4043
|
-
]
|
|
4044
|
-
},
|
|
4045
|
-
opt.id
|
|
4046
|
-
);
|
|
4047
|
-
}) })
|
|
4048
|
-
] }),
|
|
4049
|
-
/* @__PURE__ */ jsx(
|
|
4050
|
-
FormInput,
|
|
4051
|
-
{
|
|
4052
|
-
label: labels.tagsLabel,
|
|
4053
|
-
value: tagsInput,
|
|
4054
|
-
onValueChange: (v) => {
|
|
4055
|
-
setTagsInput(v);
|
|
4056
|
-
markTouched();
|
|
4057
|
-
},
|
|
4058
|
-
placeholder: labels.tagsPlaceholder
|
|
4059
|
-
}
|
|
4060
|
-
)
|
|
4061
|
-
] })
|
|
3841
|
+
rows: 5,
|
|
3842
|
+
placeholder: labels.outputSchemaPlaceholder
|
|
4062
3843
|
}
|
|
4063
3844
|
)
|
|
4064
3845
|
] });
|
|
4065
3846
|
}
|
|
4066
|
-
function
|
|
4067
|
-
const modelLabel = models.find((m) => m.id === modelId)?.name ?? labels.modelEmpty;
|
|
4068
|
-
const connectionLabel = connectionId ? connections.find((c) => c.id === connectionId)?.name ?? labels.connectionInline : labels.connectionInline;
|
|
3847
|
+
function renderStep4() {
|
|
4069
3848
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
4070
3849
|
/* @__PURE__ */ jsx(
|
|
4071
|
-
|
|
3850
|
+
FormTextarea,
|
|
4072
3851
|
{
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
3852
|
+
label: labels.promptSystemPrompt,
|
|
3853
|
+
value: systemPrompt,
|
|
3854
|
+
onValueChange: (v) => {
|
|
3855
|
+
setSystemPrompt(v);
|
|
3856
|
+
markTouched();
|
|
4077
3857
|
},
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
] }),
|
|
4082
|
-
children: /* @__PURE__ */ jsx("p", { className: "text-sm text-slate-700 dark:text-slate-200", children: presetId === "custom" ? labels.presetCustom : AGENT_PRESETS.find((p) => p.id === presetId)?.name ?? labels.presetCustom })
|
|
3858
|
+
rows: 6,
|
|
3859
|
+
placeholder: labels.promptPlaceholder,
|
|
3860
|
+
hint: `${systemPrompt.length} chars`
|
|
4083
3861
|
}
|
|
4084
3862
|
),
|
|
4085
3863
|
/* @__PURE__ */ jsx(
|
|
4086
|
-
|
|
3864
|
+
FormTextarea,
|
|
4087
3865
|
{
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
3866
|
+
label: labels.userPromptLabel,
|
|
3867
|
+
value: userPrompt,
|
|
3868
|
+
onValueChange: (v) => {
|
|
3869
|
+
setUserPrompt(v);
|
|
3870
|
+
markTouched();
|
|
4092
3871
|
},
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
] }),
|
|
4097
|
-
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
4098
|
-
/* @__PURE__ */ jsx(
|
|
4099
|
-
"span",
|
|
4100
|
-
{
|
|
4101
|
-
"aria-hidden": "true",
|
|
4102
|
-
className: `flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br ${activePreset.accent} text-lg shadow-sm`,
|
|
4103
|
-
children: emoji
|
|
4104
|
-
}
|
|
4105
|
-
),
|
|
4106
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
4107
|
-
/* @__PURE__ */ jsx("p", { className: "truncate text-sm font-semibold text-slate-900 dark:text-white", children: name || labels.namePlaceholder }),
|
|
4108
|
-
role && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-slate-500 dark:text-slate-400", children: role }),
|
|
4109
|
-
description && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-slate-600 dark:text-slate-300", children: description })
|
|
4110
|
-
] })
|
|
4111
|
-
] })
|
|
3872
|
+
rows: 4,
|
|
3873
|
+
placeholder: labels.userPromptPlaceholder,
|
|
3874
|
+
hint: `${userPrompt.length} chars`
|
|
4112
3875
|
}
|
|
4113
3876
|
),
|
|
4114
3877
|
/* @__PURE__ */ jsx(
|
|
4115
|
-
|
|
3878
|
+
RangeSliderField,
|
|
4116
3879
|
{
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
3880
|
+
sliderId: "wizard-temperature",
|
|
3881
|
+
label: labels.temperature,
|
|
3882
|
+
value: temperature,
|
|
3883
|
+
onChange: (v) => {
|
|
3884
|
+
setTemperature(v);
|
|
3885
|
+
markTouched();
|
|
4121
3886
|
},
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
]
|
|
3887
|
+
min: 0,
|
|
3888
|
+
max: 1,
|
|
3889
|
+
step: 0.05,
|
|
3890
|
+
trackGradient: "linear-gradient(90deg, #3b82f6, #8b5cf6 50%, #ec4899)",
|
|
3891
|
+
formatValue: (v) => v.toFixed(2),
|
|
3892
|
+
zones: [
|
|
3893
|
+
{ label: "Precise", max: 0.3, color: "text-blue-500", thumbColor: "#3b82f6" },
|
|
3894
|
+
{ label: "Balanced", max: 0.7, color: "text-purple-500", thumbColor: "#8b5cf6" },
|
|
3895
|
+
{ label: "Creative", max: 1, color: "text-pink-500", thumbColor: "#ec4899" }
|
|
3896
|
+
]
|
|
4132
3897
|
}
|
|
4133
3898
|
),
|
|
4134
|
-
/* @__PURE__ */
|
|
4135
|
-
|
|
3899
|
+
/* @__PURE__ */ jsx(
|
|
3900
|
+
RangeSliderField,
|
|
4136
3901
|
{
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
3902
|
+
sliderId: "wizard-top-p",
|
|
3903
|
+
label: labels.topPLabel,
|
|
3904
|
+
value: topP,
|
|
3905
|
+
onChange: (v) => {
|
|
3906
|
+
setTopP(v);
|
|
3907
|
+
markTouched();
|
|
4141
3908
|
},
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
3909
|
+
min: 0,
|
|
3910
|
+
max: 1,
|
|
3911
|
+
step: 0.05,
|
|
3912
|
+
trackGradient: "linear-gradient(90deg, #6366f1, #8b5cf6)",
|
|
3913
|
+
formatValue: (v) => v.toFixed(2),
|
|
3914
|
+
zones: [
|
|
3915
|
+
{ label: "Top-P", max: 1, color: "text-violet-500", thumbColor: "#8b5cf6" }
|
|
3916
|
+
]
|
|
3917
|
+
}
|
|
3918
|
+
),
|
|
3919
|
+
/* @__PURE__ */ jsx(
|
|
3920
|
+
RangeSliderField,
|
|
3921
|
+
{
|
|
3922
|
+
sliderId: "wizard-top-k",
|
|
3923
|
+
label: labels.topKLabel,
|
|
3924
|
+
value: topK,
|
|
3925
|
+
onChange: (v) => {
|
|
3926
|
+
setTopK(Math.max(0, Math.floor(v)));
|
|
3927
|
+
markTouched();
|
|
3928
|
+
},
|
|
3929
|
+
min: 0,
|
|
3930
|
+
max: 500,
|
|
3931
|
+
step: 1,
|
|
3932
|
+
trackGradient: "linear-gradient(90deg, #10b981, #14b8a6)",
|
|
3933
|
+
formatValue: (v) => v.toString(),
|
|
3934
|
+
zones: [
|
|
3935
|
+
{ label: "Top-K", max: 500, color: "text-emerald-500", thumbColor: "#10b981" }
|
|
3936
|
+
]
|
|
3937
|
+
}
|
|
3938
|
+
),
|
|
3939
|
+
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
3940
|
+
/* @__PURE__ */ jsx(
|
|
3941
|
+
FormInput,
|
|
3942
|
+
{
|
|
3943
|
+
label: labels.maxTokens,
|
|
3944
|
+
type: "number",
|
|
3945
|
+
value: String(maxTokens),
|
|
3946
|
+
onValueChange: (v) => {
|
|
3947
|
+
setMaxTokens(Math.max(1, Math.floor(Number(v) || 0)));
|
|
3948
|
+
markTouched();
|
|
3949
|
+
},
|
|
3950
|
+
min: 1,
|
|
3951
|
+
max: 32e3,
|
|
3952
|
+
step: 1,
|
|
3953
|
+
hint: maxTokens.toLocaleString()
|
|
3954
|
+
}
|
|
3955
|
+
),
|
|
3956
|
+
/* @__PURE__ */ jsx(
|
|
3957
|
+
FormInput,
|
|
3958
|
+
{
|
|
3959
|
+
label: labels.tagsLabel,
|
|
3960
|
+
value: tagsInput,
|
|
3961
|
+
onValueChange: (v) => {
|
|
3962
|
+
setTagsInput(v);
|
|
3963
|
+
markTouched();
|
|
3964
|
+
},
|
|
3965
|
+
placeholder: labels.tagsPlaceholder
|
|
3966
|
+
}
|
|
3967
|
+
)
|
|
3968
|
+
] }),
|
|
3969
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3970
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.difficultyLabel }),
|
|
3971
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-4", children: DIFFICULTY_OPTIONS.map((opt) => {
|
|
3972
|
+
const selected = difficulty === opt.id;
|
|
3973
|
+
const label = opt.id === "beginner" ? labels.difficultyBeginner : opt.id === "intermediate" ? labels.difficultyIntermediate : opt.id === "advanced" ? labels.difficultyAdvanced : labels.difficultyExpert;
|
|
3974
|
+
return /* @__PURE__ */ jsxs(
|
|
3975
|
+
PickerTile,
|
|
3976
|
+
{
|
|
3977
|
+
onClick: () => {
|
|
3978
|
+
setDifficulty(opt.id);
|
|
3979
|
+
markTouched();
|
|
3980
|
+
},
|
|
3981
|
+
selected,
|
|
3982
|
+
className: [
|
|
3983
|
+
"liquid-surface flex items-center gap-2 rounded-xl px-3 py-2 text-left transition-all",
|
|
3984
|
+
selected ? "ring-2 ring-indigo-500/70 ring-offset-1 ring-offset-transparent" : "hover:border-indigo-400/40 focus-visible:ring-2 focus-visible:ring-indigo-500/70 focus-visible:ring-offset-1"
|
|
3985
|
+
].join(" "),
|
|
3986
|
+
children: [
|
|
3987
|
+
/* @__PURE__ */ jsx(
|
|
3988
|
+
"span",
|
|
3989
|
+
{
|
|
3990
|
+
"aria-hidden": "true",
|
|
3991
|
+
className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br ${opt.accent} text-base shadow-sm`,
|
|
3992
|
+
children: opt.emoji
|
|
3993
|
+
}
|
|
3994
|
+
),
|
|
3995
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-slate-900 dark:text-white", children: label })
|
|
3996
|
+
]
|
|
3997
|
+
},
|
|
3998
|
+
opt.id
|
|
3999
|
+
);
|
|
4000
|
+
}) })
|
|
4001
|
+
] })
|
|
4002
|
+
] });
|
|
4003
|
+
}
|
|
4004
|
+
function renderStep5() {
|
|
4005
|
+
const modelLabel = models.find((m) => m.id === modelId)?.name ?? labels.modelEmpty;
|
|
4006
|
+
const connectionLabel = connectionId ? connections.find((c) => c.id === connectionId)?.name ?? labels.connectionInline : labels.connectionInline;
|
|
4007
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
4008
|
+
/* @__PURE__ */ jsx(
|
|
4009
|
+
ReviewBlock,
|
|
4010
|
+
{
|
|
4011
|
+
stepTitle: labels.wizardStep1Title,
|
|
4012
|
+
stepSubtitle: labels.wizardStep1Subtitle,
|
|
4013
|
+
editLabel: labels.wizardReviewEdit,
|
|
4014
|
+
onEdit: () => goToStep(1),
|
|
4015
|
+
children: /* @__PURE__ */ jsx("p", { className: "text-sm text-slate-700 dark:text-slate-200", children: presetId === "custom" ? labels.presetCustom : AGENT_PRESETS.find((p) => p.id === presetId)?.name ?? labels.presetCustom })
|
|
4016
|
+
}
|
|
4017
|
+
),
|
|
4018
|
+
/* @__PURE__ */ jsx(
|
|
4019
|
+
ReviewBlock,
|
|
4020
|
+
{
|
|
4021
|
+
stepTitle: labels.wizardStep2Title,
|
|
4022
|
+
stepSubtitle: labels.wizardStep2Subtitle,
|
|
4023
|
+
editLabel: labels.wizardReviewEdit,
|
|
4024
|
+
onEdit: () => goToStep(2),
|
|
4025
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
4026
|
+
/* @__PURE__ */ jsx(
|
|
4027
|
+
"span",
|
|
4028
|
+
{
|
|
4029
|
+
"aria-hidden": "true",
|
|
4030
|
+
className: `flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br ${activePreset.accent} text-lg shadow-sm`,
|
|
4031
|
+
children: emoji
|
|
4032
|
+
}
|
|
4033
|
+
),
|
|
4034
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
4035
|
+
/* @__PURE__ */ jsx("p", { className: "truncate text-sm font-semibold text-slate-900 dark:text-white", children: name || labels.namePlaceholder }),
|
|
4036
|
+
role && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-slate-500 dark:text-slate-400", children: role }),
|
|
4037
|
+
description && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-slate-600 dark:text-slate-300", children: description })
|
|
4038
|
+
] })
|
|
4039
|
+
] })
|
|
4040
|
+
}
|
|
4041
|
+
),
|
|
4042
|
+
/* @__PURE__ */ jsx(
|
|
4043
|
+
ReviewBlock,
|
|
4044
|
+
{
|
|
4045
|
+
stepTitle: labels.wizardStep3Title,
|
|
4046
|
+
stepSubtitle: labels.wizardStep3Subtitle,
|
|
4047
|
+
editLabel: labels.wizardReviewEdit,
|
|
4048
|
+
onEdit: () => goToStep(3),
|
|
4049
|
+
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
4050
|
+
/* @__PURE__ */ jsx(ReviewRow, { label: labels.connectionLabel, value: connectionLabel }),
|
|
4051
|
+
/* @__PURE__ */ jsx(ReviewRow, { label: labels.frameworkLabel, value: framework || "\u2014" }),
|
|
4052
|
+
/* @__PURE__ */ jsx(ReviewRow, { label: labels.model, value: modelLabel }),
|
|
4053
|
+
outputSchema.trim() && /* @__PURE__ */ jsx(ReviewRow, { label: labels.outputSchemaLabel, value: outputSchema.trim().slice(0, 60) + (outputSchema.length > 60 ? "\u2026" : "") })
|
|
4054
|
+
] })
|
|
4055
|
+
}
|
|
4056
|
+
),
|
|
4057
|
+
/* @__PURE__ */ jsxs(
|
|
4058
|
+
ReviewBlock,
|
|
4059
|
+
{
|
|
4060
|
+
stepTitle: labels.wizardStep4Title,
|
|
4061
|
+
stepSubtitle: labels.wizardStep4Subtitle,
|
|
4062
|
+
editLabel: labels.wizardReviewEdit,
|
|
4063
|
+
onEdit: () => goToStep(4),
|
|
4064
|
+
children: [
|
|
4065
|
+
/* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-2 gap-2 sm:grid-cols-4", children: [
|
|
4066
|
+
/* @__PURE__ */ jsx(ReviewRow, { label: labels.temperature, value: temperature.toFixed(2) }),
|
|
4067
|
+
/* @__PURE__ */ jsx(ReviewRow, { label: labels.topPLabel, value: topP.toFixed(2) }),
|
|
4068
|
+
/* @__PURE__ */ jsx(ReviewRow, { label: labels.topKLabel, value: String(topK) }),
|
|
4069
|
+
/* @__PURE__ */ jsx(ReviewRow, { label: labels.maxTokens, value: maxTokens.toLocaleString() })
|
|
4070
|
+
] }),
|
|
4071
|
+
systemPrompt && /* @__PURE__ */ jsxs("div", { className: "mt-3", children: [
|
|
4072
|
+
/* @__PURE__ */ jsx("p", { className: "text-[10px] uppercase tracking-wider text-slate-400 dark:text-slate-500", children: labels.promptSystemPrompt }),
|
|
4073
|
+
/* @__PURE__ */ jsx("pre", { className: "mt-1 line-clamp-4 whitespace-pre-wrap rounded-lg border border-slate-200/70 bg-slate-50/60 p-2 text-xs text-slate-700 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-200", children: systemPrompt })
|
|
4074
|
+
] })
|
|
4157
4075
|
]
|
|
4158
4076
|
}
|
|
4159
4077
|
)
|
|
@@ -4161,14 +4079,14 @@ function AgentNewWizardPageView({
|
|
|
4161
4079
|
}
|
|
4162
4080
|
const stepBody = step === 1 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : step === 4 ? renderStep4() : renderStep5();
|
|
4163
4081
|
const advanceDisabled = !canAdvance(step);
|
|
4164
|
-
const
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4082
|
+
const isLast = step === TOTAL_STEPS;
|
|
4083
|
+
const scrollableStep = step === 4 || step === 5;
|
|
4084
|
+
const bodyClass = scrollableStep ? "p-5 pt-5 sm:p-8 sm:pt-8 max-h-[60vh] overflow-y-auto" : "p-5 pt-5 sm:p-8 sm:pt-8";
|
|
4085
|
+
const footer = /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex items-center justify-between border-t pt-4", children: [
|
|
4086
|
+
/* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: step === 1 ? cancelWithConfirm : goBack, disabled: submitting, children: step === 1 ? labels.wizardCancel : labels.wizardBack }),
|
|
4087
|
+
isLast ? /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: () => void submit(), disabled: submitting || !name.trim(), children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate }) : /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext })
|
|
4170
4088
|
] });
|
|
4171
|
-
|
|
4089
|
+
return /* @__PURE__ */ jsxs(
|
|
4172
4090
|
"form",
|
|
4173
4091
|
{
|
|
4174
4092
|
onSubmit: (e) => {
|
|
@@ -4178,15 +4096,12 @@ function AgentNewWizardPageView({
|
|
|
4178
4096
|
},
|
|
4179
4097
|
className: "space-y-4",
|
|
4180
4098
|
children: [
|
|
4181
|
-
|
|
4099
|
+
hero,
|
|
4100
|
+
/* @__PURE__ */ jsx(Card, { variant: "default", children: /* @__PURE__ */ jsx(CardContent, { className: bodyClass, children: stepBody }) }),
|
|
4182
4101
|
footer
|
|
4183
4102
|
]
|
|
4184
4103
|
}
|
|
4185
4104
|
);
|
|
4186
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
4187
|
-
hero,
|
|
4188
|
-
content
|
|
4189
|
-
] });
|
|
4190
4105
|
}
|
|
4191
4106
|
function ReviewRow({ label, value }) {
|
|
4192
4107
|
return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-slate-200/60 bg-white/40 px-3 py-2 dark:border-white/10 dark:bg-white/[0.04]", children: [
|
|
@@ -4194,6 +4109,27 @@ function ReviewRow({ label, value }) {
|
|
|
4194
4109
|
/* @__PURE__ */ jsx("dd", { className: "mt-0.5 truncate text-xs font-semibold text-slate-900 dark:text-white", children: value })
|
|
4195
4110
|
] });
|
|
4196
4111
|
}
|
|
4112
|
+
function ReviewBlock({
|
|
4113
|
+
stepTitle,
|
|
4114
|
+
stepSubtitle,
|
|
4115
|
+
editLabel,
|
|
4116
|
+
onEdit,
|
|
4117
|
+
children
|
|
4118
|
+
}) {
|
|
4119
|
+
return /* @__PURE__ */ jsxs("section", { className: "border-b liquid-divider pb-4 last:border-b-0 last:pb-0", children: [
|
|
4120
|
+
/* @__PURE__ */ jsxs("header", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
4121
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
4122
|
+
/* @__PURE__ */ jsx("h4", { className: "truncate text-sm font-semibold text-slate-900 dark:text-white", children: stepTitle }),
|
|
4123
|
+
stepSubtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-slate-500 dark:text-slate-400", children: stepSubtitle })
|
|
4124
|
+
] }),
|
|
4125
|
+
/* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: onEdit, children: [
|
|
4126
|
+
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
4127
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: editLabel })
|
|
4128
|
+
] })
|
|
4129
|
+
] }),
|
|
4130
|
+
children
|
|
4131
|
+
] });
|
|
4132
|
+
}
|
|
4197
4133
|
var DIALECT_LOGO_SRC = {
|
|
4198
4134
|
bigquery: "/logos/datasources/bigquery.svg",
|
|
4199
4135
|
postgres: "/logos/datasources/postgres.svg",
|
|
@@ -4230,7 +4166,7 @@ var CATEGORY_COLOR = {
|
|
|
4230
4166
|
keyvalue: "red",
|
|
4231
4167
|
search: "amber"
|
|
4232
4168
|
};
|
|
4233
|
-
var TOTAL_STEPS2 =
|
|
4169
|
+
var TOTAL_STEPS2 = 5;
|
|
4234
4170
|
function DatasourceNewWizardPageView({
|
|
4235
4171
|
labels,
|
|
4236
4172
|
initialStep,
|
|
@@ -4242,6 +4178,11 @@ function DatasourceNewWizardPageView({
|
|
|
4242
4178
|
const clampedInitial = Math.min(TOTAL_STEPS2, Math.max(1, initialStep ?? 1));
|
|
4243
4179
|
const [step, setStep] = useState(clampedInitial);
|
|
4244
4180
|
const [dialect, setDialect] = useState("");
|
|
4181
|
+
const [categoryId, setCategoryId] = useState(() => {
|
|
4182
|
+
if (!dialect) return "";
|
|
4183
|
+
const found = DIALECT_CATEGORIES.find((c) => c.dialects.some((d) => d.value === dialect));
|
|
4184
|
+
return found?.id ?? "";
|
|
4185
|
+
});
|
|
4245
4186
|
const [name, setName] = useState("");
|
|
4246
4187
|
const [host, setHost] = useState("");
|
|
4247
4188
|
const [port, setPort] = useState("");
|
|
@@ -4301,8 +4242,9 @@ function DatasourceNewWizardPageView({
|
|
|
4301
4242
|
onStepChange?.(clamped);
|
|
4302
4243
|
}, [onStepChange]);
|
|
4303
4244
|
function canAdvance(from) {
|
|
4304
|
-
if (from === 1) return Boolean(
|
|
4305
|
-
if (from === 2) return
|
|
4245
|
+
if (from === 1) return Boolean(categoryId);
|
|
4246
|
+
if (from === 2) return Boolean(dialect);
|
|
4247
|
+
if (from === 3) return name.trim().length > 0;
|
|
4306
4248
|
return true;
|
|
4307
4249
|
}
|
|
4308
4250
|
const goNext = useCallback(() => {
|
|
@@ -4390,12 +4332,14 @@ function DatasourceNewWizardPageView({
|
|
|
4390
4332
|
return () => window.removeEventListener("keydown", onKey);
|
|
4391
4333
|
}, [step, dialect, name, touched]);
|
|
4392
4334
|
const stepTitles = [
|
|
4393
|
-
labels.wizardStep1Title
|
|
4335
|
+
`${labels.wizardStep1Title} \xB7 1/2`,
|
|
4336
|
+
`${labels.wizardStep1Title} \xB7 2/2`,
|
|
4394
4337
|
labels.wizardStep2Title,
|
|
4395
4338
|
labels.wizardStep3Title,
|
|
4396
4339
|
labels.wizardStep4Title
|
|
4397
4340
|
];
|
|
4398
4341
|
const stepSubtitles = [
|
|
4342
|
+
labels.wizardStep1Subtitle,
|
|
4399
4343
|
labels.wizardStep1Subtitle,
|
|
4400
4344
|
labels.wizardStep2Subtitle,
|
|
4401
4345
|
labels.wizardStep3Subtitle,
|
|
@@ -4405,15 +4349,23 @@ function DatasourceNewWizardPageView({
|
|
|
4405
4349
|
id: String(idx + 1),
|
|
4406
4350
|
title
|
|
4407
4351
|
}));
|
|
4408
|
-
const counter = labels.wizardStepCounter.replace("{current}", String(step)).replace("{total}", String(TOTAL_STEPS2));
|
|
4409
4352
|
const hero = /* @__PURE__ */ jsx(
|
|
4410
4353
|
HeroSection,
|
|
4411
4354
|
{
|
|
4412
4355
|
icon: /* @__PURE__ */ jsx(CircleStackIcon, { className: "h-5 w-5" }),
|
|
4413
|
-
label:
|
|
4414
|
-
title: labels.pageTitle,
|
|
4356
|
+
label: labels.pageTitle,
|
|
4357
|
+
title: stepTitles[step - 1] ?? labels.pageTitle,
|
|
4415
4358
|
subtitle: stepSubtitles[step - 1] ?? labels.pageSubtitle,
|
|
4416
4359
|
gradient: category?.gradient ?? "from-amber-500 to-orange-600",
|
|
4360
|
+
actions: /* @__PURE__ */ jsx(
|
|
4361
|
+
IconButton,
|
|
4362
|
+
{
|
|
4363
|
+
label: labels.wizardCancel,
|
|
4364
|
+
icon: /* @__PURE__ */ jsx(XMarkIcon, { className: "h-5 w-5" }),
|
|
4365
|
+
variant: "ghost",
|
|
4366
|
+
onClick: cancelWithConfirm
|
|
4367
|
+
}
|
|
4368
|
+
),
|
|
4417
4369
|
children: /* @__PURE__ */ jsx(
|
|
4418
4370
|
StepIndicator,
|
|
4419
4371
|
{
|
|
@@ -4426,50 +4378,77 @@ function DatasourceNewWizardPageView({
|
|
|
4426
4378
|
)
|
|
4427
4379
|
}
|
|
4428
4380
|
);
|
|
4381
|
+
function renderStepCategory() {
|
|
4382
|
+
return /* @__PURE__ */ jsx(
|
|
4383
|
+
"div",
|
|
4384
|
+
{
|
|
4385
|
+
role: "radiogroup",
|
|
4386
|
+
"aria-label": labels.wizardStep1Title,
|
|
4387
|
+
className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",
|
|
4388
|
+
children: DIALECT_CATEGORIES.map((cat) => {
|
|
4389
|
+
const color = CATEGORY_COLOR[cat.id] ?? "slate";
|
|
4390
|
+
const categoryLabel = labels[cat.labelKey] ?? cat.id;
|
|
4391
|
+
const selected = cat.id === categoryId;
|
|
4392
|
+
return /* @__PURE__ */ jsx(
|
|
4393
|
+
FilterTileButton,
|
|
4394
|
+
{
|
|
4395
|
+
isActive: selected,
|
|
4396
|
+
color,
|
|
4397
|
+
icon: /* @__PURE__ */ jsx(cat.icon, { className: "h-5 w-5" }),
|
|
4398
|
+
label: categoryLabel,
|
|
4399
|
+
count: `${cat.dialects.length}`,
|
|
4400
|
+
onClick: () => {
|
|
4401
|
+
setCategoryId(cat.id);
|
|
4402
|
+
if (dialect && !cat.dialects.some((d) => d.value === dialect)) {
|
|
4403
|
+
setDialect("");
|
|
4404
|
+
}
|
|
4405
|
+
markTouched();
|
|
4406
|
+
}
|
|
4407
|
+
},
|
|
4408
|
+
cat.id
|
|
4409
|
+
);
|
|
4410
|
+
})
|
|
4411
|
+
}
|
|
4412
|
+
);
|
|
4413
|
+
}
|
|
4429
4414
|
function renderStep1() {
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4415
|
+
const cat = DIALECT_CATEGORIES.find((c) => c.id === categoryId);
|
|
4416
|
+
if (!cat) return null;
|
|
4417
|
+
const color = CATEGORY_COLOR[cat.id] ?? "slate";
|
|
4418
|
+
const categoryLabel = labels[cat.labelKey] ?? cat.id;
|
|
4419
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
4420
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: [
|
|
4421
|
+
/* @__PURE__ */ jsx(cat.icon, { className: "h-3.5 w-3.5" }),
|
|
4422
|
+
categoryLabel
|
|
4423
|
+
] }),
|
|
4424
|
+
/* @__PURE__ */ jsx(
|
|
4425
|
+
"div",
|
|
4435
4426
|
{
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
markTouched();
|
|
4462
|
-
}
|
|
4463
|
-
},
|
|
4464
|
-
opt.value
|
|
4465
|
-
);
|
|
4466
|
-
})
|
|
4467
|
-
}
|
|
4468
|
-
)
|
|
4469
|
-
},
|
|
4470
|
-
cat.id
|
|
4471
|
-
);
|
|
4472
|
-
}) });
|
|
4427
|
+
role: "radiogroup",
|
|
4428
|
+
"aria-label": categoryLabel,
|
|
4429
|
+
className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",
|
|
4430
|
+
children: cat.dialects.map((opt) => {
|
|
4431
|
+
const selected = opt.value === dialect;
|
|
4432
|
+
const logoSrc = DIALECT_LOGO_SRC[opt.value.toLowerCase()];
|
|
4433
|
+
return /* @__PURE__ */ jsx(
|
|
4434
|
+
FilterTileButton,
|
|
4435
|
+
{
|
|
4436
|
+
isActive: selected,
|
|
4437
|
+
color,
|
|
4438
|
+
icon: logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, alt: opt.label, className: "h-5 w-5 object-contain" }) : /* @__PURE__ */ jsx(CircleStackIcon, { className: "h-5 w-5" }),
|
|
4439
|
+
label: opt.label,
|
|
4440
|
+
count: opt.formType.replace("-", " "),
|
|
4441
|
+
onClick: () => {
|
|
4442
|
+
setDialect(opt.value);
|
|
4443
|
+
markTouched();
|
|
4444
|
+
}
|
|
4445
|
+
},
|
|
4446
|
+
opt.value
|
|
4447
|
+
);
|
|
4448
|
+
})
|
|
4449
|
+
}
|
|
4450
|
+
)
|
|
4451
|
+
] });
|
|
4473
4452
|
}
|
|
4474
4453
|
function renderConnectionFields() {
|
|
4475
4454
|
if (!dialectOption) return null;
|
|
@@ -4775,245 +4754,208 @@ function DatasourceNewWizardPageView({
|
|
|
4775
4754
|
}
|
|
4776
4755
|
function renderStep2() {
|
|
4777
4756
|
if (!dialectOption) {
|
|
4778
|
-
return /* @__PURE__ */ jsxs(
|
|
4757
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
4779
4758
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-slate-700 dark:text-slate-200", children: labels.wizardStep1Subtitle }),
|
|
4780
|
-
/* @__PURE__ */ jsx(
|
|
4759
|
+
/* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: () => goToStep(1), children: labels.wizardBack })
|
|
4781
4760
|
] });
|
|
4782
4761
|
}
|
|
4783
|
-
return /* @__PURE__ */ jsx(
|
|
4784
|
-
SectionCard,
|
|
4785
|
-
{
|
|
4786
|
-
variant: "glass",
|
|
4787
|
-
header: {
|
|
4788
|
-
title: dialectOption.label,
|
|
4789
|
-
subtitle: labels.wizardStep2Subtitle,
|
|
4790
|
-
icon: category?.icon ? /* @__PURE__ */ jsx(category.icon, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(CircleStackIcon, { className: "h-4 w-4" }),
|
|
4791
|
-
gradient: category?.gradient
|
|
4792
|
-
},
|
|
4793
|
-
children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
4794
|
-
/* @__PURE__ */ jsx(
|
|
4795
|
-
FormInput,
|
|
4796
|
-
{
|
|
4797
|
-
label: labels.fieldName,
|
|
4798
|
-
value: name,
|
|
4799
|
-
onValueChange: (v) => {
|
|
4800
|
-
setName(v);
|
|
4801
|
-
markTouched();
|
|
4802
|
-
},
|
|
4803
|
-
placeholder: labels.fieldNamePlaceholder,
|
|
4804
|
-
required: true
|
|
4805
|
-
}
|
|
4806
|
-
),
|
|
4807
|
-
/* @__PURE__ */ jsx(FormGrid, { children: renderConnectionFields() }),
|
|
4808
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-6 pt-1", children: [
|
|
4809
|
-
/* @__PURE__ */ jsx(
|
|
4810
|
-
FormToggle,
|
|
4811
|
-
{
|
|
4812
|
-
checked: ssl,
|
|
4813
|
-
onChange: (v) => {
|
|
4814
|
-
setSsl(v);
|
|
4815
|
-
markTouched();
|
|
4816
|
-
},
|
|
4817
|
-
label: labels.fieldSsl,
|
|
4818
|
-
variant: "inline"
|
|
4819
|
-
}
|
|
4820
|
-
),
|
|
4821
|
-
/* @__PURE__ */ jsx(
|
|
4822
|
-
FormToggle,
|
|
4823
|
-
{
|
|
4824
|
-
checked: readOnly,
|
|
4825
|
-
onChange: (v) => {
|
|
4826
|
-
setReadOnly(v);
|
|
4827
|
-
markTouched();
|
|
4828
|
-
},
|
|
4829
|
-
label: labels.fieldReadOnly,
|
|
4830
|
-
variant: "inline"
|
|
4831
|
-
}
|
|
4832
|
-
)
|
|
4833
|
-
] }),
|
|
4834
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: labels.fieldReadOnlyHelp }),
|
|
4835
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3 border-t border-slate-200/60 pt-4 dark:border-white/10", children: [
|
|
4836
|
-
/* @__PURE__ */ jsx(
|
|
4837
|
-
Button,
|
|
4838
|
-
{
|
|
4839
|
-
type: "button",
|
|
4840
|
-
outline: true,
|
|
4841
|
-
onClick: () => void handleTestConnection(),
|
|
4842
|
-
disabled: testStatus === "testing",
|
|
4843
|
-
children: testStatus === "testing" ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4844
|
-
/* @__PURE__ */ jsx(Spinner, { size: "xs" }),
|
|
4845
|
-
labels.testing
|
|
4846
|
-
] }) : labels.testConnection
|
|
4847
|
-
}
|
|
4848
|
-
),
|
|
4849
|
-
testStatus === "success" && /* @__PURE__ */ jsx(StatusBadge, { status: "success", label: labels.connectionSuccess }),
|
|
4850
|
-
testStatus === "failed" && /* @__PURE__ */ jsx(StatusBadge, { status: "error", label: labels.connectionFailed })
|
|
4851
|
-
] })
|
|
4852
|
-
] })
|
|
4853
|
-
}
|
|
4854
|
-
);
|
|
4855
|
-
}
|
|
4856
|
-
function renderStep3() {
|
|
4857
|
-
return /* @__PURE__ */ jsx(
|
|
4858
|
-
SectionCard,
|
|
4859
|
-
{
|
|
4860
|
-
variant: "glass",
|
|
4861
|
-
header: {
|
|
4862
|
-
title: labels.governanceSectionTitle,
|
|
4863
|
-
subtitle: labels.governanceSectionSubtitle
|
|
4864
|
-
},
|
|
4865
|
-
children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
4866
|
-
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
4867
|
-
/* @__PURE__ */ jsx(
|
|
4868
|
-
FormInput,
|
|
4869
|
-
{
|
|
4870
|
-
label: labels.fieldMaxPoolSize,
|
|
4871
|
-
type: "number",
|
|
4872
|
-
min: 1,
|
|
4873
|
-
max: 100,
|
|
4874
|
-
value: maxPoolSize,
|
|
4875
|
-
onValueChange: (v) => {
|
|
4876
|
-
setMaxPoolSize(v);
|
|
4877
|
-
markTouched();
|
|
4878
|
-
},
|
|
4879
|
-
hint: labels.fieldMaxPoolSizeHint
|
|
4880
|
-
}
|
|
4881
|
-
),
|
|
4882
|
-
/* @__PURE__ */ jsx(
|
|
4883
|
-
FormInput,
|
|
4884
|
-
{
|
|
4885
|
-
label: labels.fieldTimeoutMs,
|
|
4886
|
-
type: "number",
|
|
4887
|
-
min: 100,
|
|
4888
|
-
value: timeoutMs,
|
|
4889
|
-
onValueChange: (v) => {
|
|
4890
|
-
setTimeoutMs(v);
|
|
4891
|
-
markTouched();
|
|
4892
|
-
},
|
|
4893
|
-
hint: labels.fieldTimeoutMsHint
|
|
4894
|
-
}
|
|
4895
|
-
)
|
|
4896
|
-
] }),
|
|
4897
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
4898
|
-
/* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.fieldAllowedTables }),
|
|
4899
|
-
/* @__PURE__ */ jsx(
|
|
4900
|
-
ChipPicker,
|
|
4901
|
-
{
|
|
4902
|
-
items: allowedTablesItems,
|
|
4903
|
-
selectedIds: allowedTablesSelected,
|
|
4904
|
-
onChange: (ids) => {
|
|
4905
|
-
setAllowedTablesSelected(ids);
|
|
4906
|
-
markTouched();
|
|
4907
|
-
},
|
|
4908
|
-
onItemsChange: (items) => {
|
|
4909
|
-
setAllowedTablesItems(items);
|
|
4910
|
-
markTouched();
|
|
4911
|
-
},
|
|
4912
|
-
allowCustom: true,
|
|
4913
|
-
unselectedStyle: allowedTablesStyle,
|
|
4914
|
-
showActions: false,
|
|
4915
|
-
addPlaceholder: labels.fieldAllowedTablesPlaceholder,
|
|
4916
|
-
addAriaLabel: labels.fieldAllowedTables
|
|
4917
|
-
}
|
|
4918
|
-
),
|
|
4919
|
-
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.fieldAllowedTablesHint })
|
|
4920
|
-
] }),
|
|
4921
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
4922
|
-
/* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.fieldBlockedColumns }),
|
|
4923
|
-
/* @__PURE__ */ jsx(
|
|
4924
|
-
ChipPicker,
|
|
4925
|
-
{
|
|
4926
|
-
items: blockedColumnsItems,
|
|
4927
|
-
selectedIds: blockedColumnsSelected,
|
|
4928
|
-
onChange: (ids) => {
|
|
4929
|
-
setBlockedColumnsSelected(ids);
|
|
4930
|
-
markTouched();
|
|
4931
|
-
},
|
|
4932
|
-
onItemsChange: (items) => {
|
|
4933
|
-
setBlockedColumnsItems(items);
|
|
4934
|
-
markTouched();
|
|
4935
|
-
},
|
|
4936
|
-
allowCustom: true,
|
|
4937
|
-
unselectedStyle: blockedColumnsStyle,
|
|
4938
|
-
showActions: false,
|
|
4939
|
-
addPlaceholder: labels.fieldBlockedColumnsPlaceholder,
|
|
4940
|
-
addAriaLabel: labels.fieldBlockedColumns
|
|
4941
|
-
}
|
|
4942
|
-
),
|
|
4943
|
-
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.fieldBlockedColumnsHint })
|
|
4944
|
-
] }),
|
|
4945
|
-
/* @__PURE__ */ jsx(
|
|
4946
|
-
FormCheckbox,
|
|
4947
|
-
{
|
|
4948
|
-
checked: maskPii,
|
|
4949
|
-
onChange: (v) => {
|
|
4950
|
-
setMaskPii(v);
|
|
4951
|
-
markTouched();
|
|
4952
|
-
},
|
|
4953
|
-
label: labels.fieldMaskPii,
|
|
4954
|
-
description: labels.fieldMaskPiiDescription
|
|
4955
|
-
}
|
|
4956
|
-
)
|
|
4957
|
-
] })
|
|
4958
|
-
}
|
|
4959
|
-
);
|
|
4960
|
-
}
|
|
4961
|
-
function renderStep4() {
|
|
4962
|
-
const categoryLabel = category ? labels[category.labelKey] ?? category.id : labels.reviewNoneValue;
|
|
4963
|
-
const dialectLabel = dialectOption?.label ?? labels.reviewNoneValue;
|
|
4964
|
-
const allowed = allowedTablesSelected;
|
|
4965
|
-
const blocked = blockedColumnsSelected;
|
|
4966
4762
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
4967
4763
|
/* @__PURE__ */ jsx(
|
|
4968
|
-
|
|
4969
|
-
{
|
|
4970
|
-
variant: "glass",
|
|
4971
|
-
header: {
|
|
4972
|
-
title: labels.wizardStep1Title,
|
|
4973
|
-
subtitle: labels.wizardStep1Subtitle
|
|
4974
|
-
},
|
|
4975
|
-
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(1), children: [
|
|
4976
|
-
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
4977
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
4978
|
-
] }),
|
|
4979
|
-
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
4980
|
-
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewCategoryLabel, value: categoryLabel }),
|
|
4981
|
-
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewDialectLabel, value: dialectLabel })
|
|
4982
|
-
] })
|
|
4983
|
-
}
|
|
4984
|
-
),
|
|
4985
|
-
/* @__PURE__ */ jsx(
|
|
4986
|
-
SectionCard,
|
|
4764
|
+
FormInput,
|
|
4987
4765
|
{
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4766
|
+
label: labels.fieldName,
|
|
4767
|
+
value: name,
|
|
4768
|
+
onValueChange: (v) => {
|
|
4769
|
+
setName(v);
|
|
4770
|
+
markTouched();
|
|
4992
4771
|
},
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
4996
|
-
] }),
|
|
4997
|
-
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
4998
|
-
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewNameLabel, value: name || labels.reviewNoneValue }),
|
|
4999
|
-
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewCredentialsLabel, value: labels.reviewCredentialsRedacted }),
|
|
5000
|
-
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewSslLabel, value: ssl ? labels.reviewYes : labels.reviewNo }),
|
|
5001
|
-
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewReadOnlyLabel, value: readOnly ? labels.reviewYes : labels.reviewNo })
|
|
5002
|
-
] })
|
|
4772
|
+
placeholder: labels.fieldNamePlaceholder,
|
|
4773
|
+
required: true
|
|
5003
4774
|
}
|
|
5004
4775
|
),
|
|
5005
|
-
/* @__PURE__ */ jsx(
|
|
5006
|
-
|
|
4776
|
+
/* @__PURE__ */ jsx(FormGrid, { children: renderConnectionFields() }),
|
|
4777
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-6 pt-1", children: [
|
|
4778
|
+
/* @__PURE__ */ jsx(
|
|
4779
|
+
FormToggle,
|
|
4780
|
+
{
|
|
4781
|
+
checked: ssl,
|
|
4782
|
+
onChange: (v) => {
|
|
4783
|
+
setSsl(v);
|
|
4784
|
+
markTouched();
|
|
4785
|
+
},
|
|
4786
|
+
label: labels.fieldSsl,
|
|
4787
|
+
variant: "inline"
|
|
4788
|
+
}
|
|
4789
|
+
),
|
|
4790
|
+
/* @__PURE__ */ jsx(
|
|
4791
|
+
FormToggle,
|
|
4792
|
+
{
|
|
4793
|
+
checked: readOnly,
|
|
4794
|
+
onChange: (v) => {
|
|
4795
|
+
setReadOnly(v);
|
|
4796
|
+
markTouched();
|
|
4797
|
+
},
|
|
4798
|
+
label: labels.fieldReadOnly,
|
|
4799
|
+
variant: "inline"
|
|
4800
|
+
}
|
|
4801
|
+
)
|
|
4802
|
+
] }),
|
|
4803
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: labels.fieldReadOnlyHelp }),
|
|
4804
|
+
/* @__PURE__ */ jsxs("div", { className: "liquid-divider flex flex-wrap items-center gap-3 border-t pt-4", children: [
|
|
4805
|
+
/* @__PURE__ */ jsx(
|
|
4806
|
+
Button,
|
|
4807
|
+
{
|
|
4808
|
+
type: "button",
|
|
4809
|
+
outline: true,
|
|
4810
|
+
onClick: () => void handleTestConnection(),
|
|
4811
|
+
disabled: testStatus === "testing",
|
|
4812
|
+
children: testStatus === "testing" ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4813
|
+
/* @__PURE__ */ jsx(Spinner, { size: "xs" }),
|
|
4814
|
+
labels.testing
|
|
4815
|
+
] }) : labels.testConnection
|
|
4816
|
+
}
|
|
4817
|
+
),
|
|
4818
|
+
testStatus === "success" && /* @__PURE__ */ jsx(StatusBadge, { status: "success", label: labels.connectionSuccess }),
|
|
4819
|
+
testStatus === "failed" && /* @__PURE__ */ jsx(StatusBadge, { status: "error", label: labels.connectionFailed })
|
|
4820
|
+
] })
|
|
4821
|
+
] });
|
|
4822
|
+
}
|
|
4823
|
+
function renderStep3() {
|
|
4824
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
4825
|
+
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
4826
|
+
/* @__PURE__ */ jsx(
|
|
4827
|
+
FormInput,
|
|
4828
|
+
{
|
|
4829
|
+
label: labels.fieldMaxPoolSize,
|
|
4830
|
+
type: "number",
|
|
4831
|
+
min: 1,
|
|
4832
|
+
max: 100,
|
|
4833
|
+
value: maxPoolSize,
|
|
4834
|
+
onValueChange: (v) => {
|
|
4835
|
+
setMaxPoolSize(v);
|
|
4836
|
+
markTouched();
|
|
4837
|
+
},
|
|
4838
|
+
hint: labels.fieldMaxPoolSizeHint
|
|
4839
|
+
}
|
|
4840
|
+
),
|
|
4841
|
+
/* @__PURE__ */ jsx(
|
|
4842
|
+
FormInput,
|
|
4843
|
+
{
|
|
4844
|
+
label: labels.fieldTimeoutMs,
|
|
4845
|
+
type: "number",
|
|
4846
|
+
min: 100,
|
|
4847
|
+
value: timeoutMs,
|
|
4848
|
+
onValueChange: (v) => {
|
|
4849
|
+
setTimeoutMs(v);
|
|
4850
|
+
markTouched();
|
|
4851
|
+
},
|
|
4852
|
+
hint: labels.fieldTimeoutMsHint
|
|
4853
|
+
}
|
|
4854
|
+
)
|
|
4855
|
+
] }),
|
|
4856
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
4857
|
+
/* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.fieldAllowedTables }),
|
|
4858
|
+
/* @__PURE__ */ jsx(
|
|
4859
|
+
ChipPicker,
|
|
4860
|
+
{
|
|
4861
|
+
items: allowedTablesItems,
|
|
4862
|
+
selectedIds: allowedTablesSelected,
|
|
4863
|
+
onChange: (ids) => {
|
|
4864
|
+
setAllowedTablesSelected(ids);
|
|
4865
|
+
markTouched();
|
|
4866
|
+
},
|
|
4867
|
+
onItemsChange: (items) => {
|
|
4868
|
+
setAllowedTablesItems(items);
|
|
4869
|
+
markTouched();
|
|
4870
|
+
},
|
|
4871
|
+
allowCustom: true,
|
|
4872
|
+
unselectedStyle: allowedTablesStyle,
|
|
4873
|
+
showActions: false,
|
|
4874
|
+
addPlaceholder: labels.fieldAllowedTablesPlaceholder,
|
|
4875
|
+
addAriaLabel: labels.fieldAllowedTables
|
|
4876
|
+
}
|
|
4877
|
+
),
|
|
4878
|
+
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.fieldAllowedTablesHint })
|
|
4879
|
+
] }),
|
|
4880
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
4881
|
+
/* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.fieldBlockedColumns }),
|
|
4882
|
+
/* @__PURE__ */ jsx(
|
|
4883
|
+
ChipPicker,
|
|
4884
|
+
{
|
|
4885
|
+
items: blockedColumnsItems,
|
|
4886
|
+
selectedIds: blockedColumnsSelected,
|
|
4887
|
+
onChange: (ids) => {
|
|
4888
|
+
setBlockedColumnsSelected(ids);
|
|
4889
|
+
markTouched();
|
|
4890
|
+
},
|
|
4891
|
+
onItemsChange: (items) => {
|
|
4892
|
+
setBlockedColumnsItems(items);
|
|
4893
|
+
markTouched();
|
|
4894
|
+
},
|
|
4895
|
+
allowCustom: true,
|
|
4896
|
+
unselectedStyle: blockedColumnsStyle,
|
|
4897
|
+
showActions: false,
|
|
4898
|
+
addPlaceholder: labels.fieldBlockedColumnsPlaceholder,
|
|
4899
|
+
addAriaLabel: labels.fieldBlockedColumns
|
|
4900
|
+
}
|
|
4901
|
+
),
|
|
4902
|
+
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.fieldBlockedColumnsHint })
|
|
4903
|
+
] }),
|
|
4904
|
+
/* @__PURE__ */ jsx(
|
|
4905
|
+
FormCheckbox,
|
|
5007
4906
|
{
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
4907
|
+
checked: maskPii,
|
|
4908
|
+
onChange: (v) => {
|
|
4909
|
+
setMaskPii(v);
|
|
4910
|
+
markTouched();
|
|
5012
4911
|
},
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
4912
|
+
label: labels.fieldMaskPii,
|
|
4913
|
+
description: labels.fieldMaskPiiDescription
|
|
4914
|
+
}
|
|
4915
|
+
)
|
|
4916
|
+
] });
|
|
4917
|
+
}
|
|
4918
|
+
function renderStep4() {
|
|
4919
|
+
const categoryLabel = category ? labels[category.labelKey] ?? category.id : labels.reviewNoneValue;
|
|
4920
|
+
const dialectLabel = dialectOption?.label ?? labels.reviewNoneValue;
|
|
4921
|
+
const allowed = allowedTablesSelected;
|
|
4922
|
+
const blocked = blockedColumnsSelected;
|
|
4923
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
4924
|
+
/* @__PURE__ */ jsx(
|
|
4925
|
+
ReviewBlock2,
|
|
4926
|
+
{
|
|
4927
|
+
stepTitle: labels.wizardStep1Title,
|
|
4928
|
+
stepSubtitle: labels.wizardStep1Subtitle,
|
|
4929
|
+
editLabel: labels.wizardReviewEdit,
|
|
4930
|
+
onEdit: () => goToStep(1),
|
|
4931
|
+
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
4932
|
+
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewCategoryLabel, value: categoryLabel }),
|
|
4933
|
+
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewDialectLabel, value: dialectLabel })
|
|
4934
|
+
] })
|
|
4935
|
+
}
|
|
4936
|
+
),
|
|
4937
|
+
/* @__PURE__ */ jsx(
|
|
4938
|
+
ReviewBlock2,
|
|
4939
|
+
{
|
|
4940
|
+
stepTitle: labels.wizardStep2Title,
|
|
4941
|
+
stepSubtitle: labels.wizardStep2Subtitle,
|
|
4942
|
+
editLabel: labels.wizardReviewEdit,
|
|
4943
|
+
onEdit: () => goToStep(2),
|
|
4944
|
+
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
4945
|
+
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewNameLabel, value: name || labels.reviewNoneValue }),
|
|
4946
|
+
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewCredentialsLabel, value: labels.reviewCredentialsRedacted }),
|
|
4947
|
+
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewSslLabel, value: ssl ? labels.reviewYes : labels.reviewNo }),
|
|
4948
|
+
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewReadOnlyLabel, value: readOnly ? labels.reviewYes : labels.reviewNo })
|
|
4949
|
+
] })
|
|
4950
|
+
}
|
|
4951
|
+
),
|
|
4952
|
+
/* @__PURE__ */ jsx(
|
|
4953
|
+
ReviewBlock2,
|
|
4954
|
+
{
|
|
4955
|
+
stepTitle: labels.wizardStep3Title,
|
|
4956
|
+
stepSubtitle: labels.wizardStep3Subtitle,
|
|
4957
|
+
editLabel: labels.wizardReviewEdit,
|
|
4958
|
+
onEdit: () => goToStep(3),
|
|
5017
4959
|
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
5018
4960
|
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewPoolLabel, value: maxPoolSize || labels.reviewNoneValue }),
|
|
5019
4961
|
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewTimeoutLabel, value: timeoutMs ? `${timeoutMs}ms` : labels.reviewNoneValue }),
|
|
@@ -5037,16 +4979,25 @@ function DatasourceNewWizardPageView({
|
|
|
5037
4979
|
)
|
|
5038
4980
|
] });
|
|
5039
4981
|
}
|
|
5040
|
-
const stepBody = step === 1 ?
|
|
4982
|
+
const stepBody = step === 1 ? renderStepCategory() : step === 2 ? renderStep1() : (
|
|
4983
|
+
// dialect picker — original step 1
|
|
4984
|
+
step === 3 ? renderStep2() : (
|
|
4985
|
+
// connection — original step 2
|
|
4986
|
+
step === 4 ? renderStep3() : (
|
|
4987
|
+
// governance — original step 3
|
|
4988
|
+
renderStep4()
|
|
4989
|
+
)
|
|
4990
|
+
)
|
|
4991
|
+
);
|
|
5041
4992
|
const advanceDisabled = !canAdvance(step);
|
|
5042
|
-
const
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
4993
|
+
const isLast = step === TOTAL_STEPS2;
|
|
4994
|
+
const scrollableStep = step === TOTAL_STEPS2;
|
|
4995
|
+
const bodyClass = scrollableStep ? "p-5 pt-5 sm:p-8 sm:pt-8 max-h-[60vh] overflow-y-auto" : "p-5 pt-5 sm:p-8 sm:pt-8";
|
|
4996
|
+
const footer = /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex items-center justify-between border-t pt-4", children: [
|
|
4997
|
+
/* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: step === 1 ? cancelWithConfirm : goBack, disabled: submitting, children: step === 1 ? labels.wizardCancel : labels.wizardBack }),
|
|
4998
|
+
isLast ? /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: () => void submit(), disabled: submitting || !dialect || !name.trim(), children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate }) : /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext })
|
|
5048
4999
|
] });
|
|
5049
|
-
|
|
5000
|
+
return /* @__PURE__ */ jsxs(
|
|
5050
5001
|
"form",
|
|
5051
5002
|
{
|
|
5052
5003
|
onSubmit: (e) => {
|
|
@@ -5056,15 +5007,12 @@ function DatasourceNewWizardPageView({
|
|
|
5056
5007
|
},
|
|
5057
5008
|
className: "space-y-4",
|
|
5058
5009
|
children: [
|
|
5059
|
-
|
|
5010
|
+
hero,
|
|
5011
|
+
/* @__PURE__ */ jsx(Card, { variant: "default", children: /* @__PURE__ */ jsx(CardContent, { className: bodyClass, children: stepBody }) }),
|
|
5060
5012
|
footer
|
|
5061
5013
|
]
|
|
5062
5014
|
}
|
|
5063
5015
|
);
|
|
5064
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
5065
|
-
hero,
|
|
5066
|
-
content
|
|
5067
|
-
] });
|
|
5068
5016
|
}
|
|
5069
5017
|
function ReviewRow2({ label, value }) {
|
|
5070
5018
|
return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-slate-200/60 bg-white/40 px-3 py-2 dark:border-white/10 dark:bg-white/[0.04]", children: [
|
|
@@ -5072,6 +5020,27 @@ function ReviewRow2({ label, value }) {
|
|
|
5072
5020
|
/* @__PURE__ */ jsx("dd", { className: "mt-0.5 truncate text-xs font-semibold text-slate-900 dark:text-white", children: value })
|
|
5073
5021
|
] });
|
|
5074
5022
|
}
|
|
5023
|
+
function ReviewBlock2({
|
|
5024
|
+
stepTitle,
|
|
5025
|
+
stepSubtitle,
|
|
5026
|
+
editLabel,
|
|
5027
|
+
onEdit,
|
|
5028
|
+
children
|
|
5029
|
+
}) {
|
|
5030
|
+
return /* @__PURE__ */ jsxs("section", { className: "border-b liquid-divider pb-4 last:border-b-0 last:pb-0", children: [
|
|
5031
|
+
/* @__PURE__ */ jsxs("header", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
5032
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
5033
|
+
/* @__PURE__ */ jsx("h4", { className: "truncate text-sm font-semibold text-slate-900 dark:text-white", children: stepTitle }),
|
|
5034
|
+
stepSubtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-slate-500 dark:text-slate-400", children: stepSubtitle })
|
|
5035
|
+
] }),
|
|
5036
|
+
/* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: onEdit, children: [
|
|
5037
|
+
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5038
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: editLabel })
|
|
5039
|
+
] })
|
|
5040
|
+
] }),
|
|
5041
|
+
children
|
|
5042
|
+
] });
|
|
5043
|
+
}
|
|
5075
5044
|
async function simulateTest() {
|
|
5076
5045
|
await new Promise((r) => setTimeout(r, 1500));
|
|
5077
5046
|
return true;
|
|
@@ -5321,15 +5290,23 @@ function RuleNewWizardPageView({
|
|
|
5321
5290
|
id: String(idx + 1),
|
|
5322
5291
|
title
|
|
5323
5292
|
}));
|
|
5324
|
-
const counter = labels.wizardStepCounter.replace("{current}", String(step)).replace("{total}", String(TOTAL_STEPS3));
|
|
5325
5293
|
const hero = /* @__PURE__ */ jsx(
|
|
5326
5294
|
HeroSection,
|
|
5327
5295
|
{
|
|
5328
5296
|
icon: /* @__PURE__ */ jsx(AdjustmentsHorizontalIcon, { className: "h-5 w-5" }),
|
|
5329
|
-
label:
|
|
5330
|
-
title: labels.pageTitle,
|
|
5297
|
+
label: labels.pageTitle,
|
|
5298
|
+
title: stepTitles[step - 1] ?? labels.pageTitle,
|
|
5331
5299
|
subtitle: stepSubtitles[step - 1] ?? labels.pageSubtitle,
|
|
5332
5300
|
gradient: "from-fuchsia-500 to-purple-700",
|
|
5301
|
+
actions: /* @__PURE__ */ jsx(
|
|
5302
|
+
IconButton,
|
|
5303
|
+
{
|
|
5304
|
+
label: labels.wizardCancel,
|
|
5305
|
+
icon: /* @__PURE__ */ jsx(XMarkIcon, { className: "h-5 w-5" }),
|
|
5306
|
+
variant: "ghost",
|
|
5307
|
+
onClick: cancelWithConfirm
|
|
5308
|
+
}
|
|
5309
|
+
),
|
|
5333
5310
|
children: /* @__PURE__ */ jsx(
|
|
5334
5311
|
StepIndicator,
|
|
5335
5312
|
{
|
|
@@ -5343,399 +5320,346 @@ function RuleNewWizardPageView({
|
|
|
5343
5320
|
}
|
|
5344
5321
|
);
|
|
5345
5322
|
function renderStep1() {
|
|
5346
|
-
return /* @__PURE__ */
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
setEnabled(v);
|
|
5410
|
-
markTouched();
|
|
5411
|
-
},
|
|
5412
|
-
label: labels.enabledLabel,
|
|
5413
|
-
variant: "card"
|
|
5414
|
-
}
|
|
5415
|
-
)
|
|
5416
|
-
] })
|
|
5417
|
-
}
|
|
5418
|
-
);
|
|
5323
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
5324
|
+
/* @__PURE__ */ jsx(
|
|
5325
|
+
FormInput,
|
|
5326
|
+
{
|
|
5327
|
+
label: labels.nameLabel,
|
|
5328
|
+
value: name,
|
|
5329
|
+
onValueChange: (v) => {
|
|
5330
|
+
setName(v);
|
|
5331
|
+
markTouched();
|
|
5332
|
+
},
|
|
5333
|
+
placeholder: labels.namePlaceholder,
|
|
5334
|
+
required: true
|
|
5335
|
+
}
|
|
5336
|
+
),
|
|
5337
|
+
/* @__PURE__ */ jsx(
|
|
5338
|
+
FormTextarea,
|
|
5339
|
+
{
|
|
5340
|
+
label: labels.descriptionLabel,
|
|
5341
|
+
value: description,
|
|
5342
|
+
onValueChange: (v) => {
|
|
5343
|
+
setDescription(v);
|
|
5344
|
+
markTouched();
|
|
5345
|
+
},
|
|
5346
|
+
placeholder: labels.descriptionPlaceholder,
|
|
5347
|
+
rows: 3
|
|
5348
|
+
}
|
|
5349
|
+
),
|
|
5350
|
+
/* @__PURE__ */ jsx(
|
|
5351
|
+
RangeSliderField2,
|
|
5352
|
+
{
|
|
5353
|
+
sliderId: "wizard-rule-priority",
|
|
5354
|
+
label: labels.priorityLabel,
|
|
5355
|
+
value: priority,
|
|
5356
|
+
onChange: (v) => {
|
|
5357
|
+
setPriority(Math.round(v));
|
|
5358
|
+
markTouched();
|
|
5359
|
+
},
|
|
5360
|
+
min: 0,
|
|
5361
|
+
max: 100,
|
|
5362
|
+
step: 1,
|
|
5363
|
+
trackGradient: "linear-gradient(90deg, #10b981, #38bdf8 33%, #f59e0b 66%, #f43f5e)",
|
|
5364
|
+
formatValue: (v) => String(Math.round(v)),
|
|
5365
|
+
zones: [
|
|
5366
|
+
{ label: labels.priorityLow, max: 25, color: "text-emerald-500", thumbColor: "#10b981" },
|
|
5367
|
+
{ label: labels.priorityNormal, max: 50, color: "text-sky-500", thumbColor: "#38bdf8" },
|
|
5368
|
+
{ label: labels.priorityHigh, max: 75, color: "text-amber-500", thumbColor: "#f59e0b" },
|
|
5369
|
+
{ label: labels.priorityCritical, max: 100, color: "text-rose-500", thumbColor: "#f43f5e" }
|
|
5370
|
+
]
|
|
5371
|
+
}
|
|
5372
|
+
),
|
|
5373
|
+
/* @__PURE__ */ jsx(
|
|
5374
|
+
FormToggle,
|
|
5375
|
+
{
|
|
5376
|
+
checked: enabled,
|
|
5377
|
+
onChange: (v) => {
|
|
5378
|
+
setEnabled(v);
|
|
5379
|
+
markTouched();
|
|
5380
|
+
},
|
|
5381
|
+
label: labels.enabledLabel,
|
|
5382
|
+
variant: "card"
|
|
5383
|
+
}
|
|
5384
|
+
)
|
|
5385
|
+
] });
|
|
5419
5386
|
}
|
|
5420
5387
|
function renderStep2() {
|
|
5421
|
-
return /* @__PURE__ */
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
)
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
value: condition,
|
|
5453
|
-
onChange: (next) => {
|
|
5454
|
-
setCondition(next);
|
|
5455
|
-
markTouched();
|
|
5456
|
-
}
|
|
5457
|
-
}
|
|
5458
|
-
)
|
|
5459
|
-
] })
|
|
5460
|
-
}
|
|
5461
|
-
);
|
|
5388
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
5389
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5390
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.combinatorLabel }),
|
|
5391
|
+
/* @__PURE__ */ jsx(
|
|
5392
|
+
SegmentedControl,
|
|
5393
|
+
{
|
|
5394
|
+
segments: [
|
|
5395
|
+
{ value: "and", label: labels.combinatorAnd },
|
|
5396
|
+
{ value: "or", label: labels.combinatorOr },
|
|
5397
|
+
{ value: "not", label: labels.combinatorNot }
|
|
5398
|
+
],
|
|
5399
|
+
value: combinator,
|
|
5400
|
+
onChange: (v) => {
|
|
5401
|
+
setCombinator(v);
|
|
5402
|
+
markTouched();
|
|
5403
|
+
},
|
|
5404
|
+
size: "sm"
|
|
5405
|
+
}
|
|
5406
|
+
)
|
|
5407
|
+
] }),
|
|
5408
|
+
/* @__PURE__ */ jsx(
|
|
5409
|
+
RuleConditionBuilder,
|
|
5410
|
+
{
|
|
5411
|
+
value: condition,
|
|
5412
|
+
onChange: (next) => {
|
|
5413
|
+
setCondition(next);
|
|
5414
|
+
markTouched();
|
|
5415
|
+
}
|
|
5416
|
+
}
|
|
5417
|
+
)
|
|
5418
|
+
] });
|
|
5462
5419
|
}
|
|
5463
5420
|
function renderStep3() {
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
"
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
{
|
|
5488
|
-
isActive: selected,
|
|
5489
|
-
color: tile.color,
|
|
5490
|
-
icon: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" }),
|
|
5491
|
-
label,
|
|
5492
|
-
count: description2,
|
|
5493
|
-
onClick: () => {
|
|
5494
|
-
setActionTileId(tile.id);
|
|
5495
|
-
markTouched();
|
|
5496
|
-
}
|
|
5497
|
-
},
|
|
5498
|
-
tile.id
|
|
5499
|
-
);
|
|
5500
|
-
})
|
|
5501
|
-
}
|
|
5502
|
-
),
|
|
5503
|
-
selectedTile && /* @__PURE__ */ jsx(
|
|
5504
|
-
SectionCard,
|
|
5505
|
-
{
|
|
5506
|
-
variant: "glass",
|
|
5507
|
-
header: {
|
|
5508
|
-
title: labels[selectedTile.labelKey] ?? selectedTile.id,
|
|
5509
|
-
subtitle: labels.actionConfigSubtitle
|
|
5510
|
-
},
|
|
5511
|
-
children: /* @__PURE__ */ jsx(
|
|
5512
|
-
RuleActionBuilder,
|
|
5513
|
-
{
|
|
5514
|
-
value: action,
|
|
5515
|
-
onChange: (next) => {
|
|
5516
|
-
setAction(next);
|
|
5517
|
-
markTouched();
|
|
5518
|
-
}
|
|
5421
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
5422
|
+
/* @__PURE__ */ jsx(
|
|
5423
|
+
"div",
|
|
5424
|
+
{
|
|
5425
|
+
role: "radiogroup",
|
|
5426
|
+
"aria-label": labels.actionSectionTitle,
|
|
5427
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
5428
|
+
children: ACTION_TILES.map((tile) => {
|
|
5429
|
+
const Icon = tile.icon;
|
|
5430
|
+
const selected = tile.id === actionTileId;
|
|
5431
|
+
const label = labels[tile.labelKey] ?? tile.id;
|
|
5432
|
+
const description2 = labels[tile.descriptionKey] ?? "";
|
|
5433
|
+
return /* @__PURE__ */ jsx(
|
|
5434
|
+
FilterTileButton,
|
|
5435
|
+
{
|
|
5436
|
+
isActive: selected,
|
|
5437
|
+
color: tile.color,
|
|
5438
|
+
icon: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" }),
|
|
5439
|
+
label,
|
|
5440
|
+
count: description2,
|
|
5441
|
+
onClick: () => {
|
|
5442
|
+
setActionTileId(tile.id);
|
|
5443
|
+
markTouched();
|
|
5519
5444
|
}
|
|
5520
|
-
)
|
|
5521
|
-
}
|
|
5522
|
-
)
|
|
5523
|
-
] })
|
|
5524
|
-
}
|
|
5525
|
-
);
|
|
5526
|
-
}
|
|
5527
|
-
function renderStep4() {
|
|
5528
|
-
return /* @__PURE__ */ jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsx(
|
|
5529
|
-
SectionCard,
|
|
5530
|
-
{
|
|
5531
|
-
variant: "glass",
|
|
5532
|
-
header: {
|
|
5533
|
-
title: labels.scheduleSectionTitle,
|
|
5534
|
-
subtitle: labels.scheduleSectionSubtitle
|
|
5535
|
-
},
|
|
5536
|
-
children: /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
5537
|
-
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
5538
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
5539
|
-
/* @__PURE__ */ jsx("span", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.validFromLabel }),
|
|
5540
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
5541
|
-
/* @__PURE__ */ jsx(
|
|
5542
|
-
DatePicker,
|
|
5543
|
-
{
|
|
5544
|
-
value: validFromDate,
|
|
5545
|
-
onChange: (d) => {
|
|
5546
|
-
setValidFromDate(d);
|
|
5547
|
-
markTouched();
|
|
5548
|
-
},
|
|
5549
|
-
placeholder: labels.validFromDateLabel
|
|
5550
|
-
}
|
|
5551
|
-
),
|
|
5552
|
-
/* @__PURE__ */ jsx(
|
|
5553
|
-
TimePicker,
|
|
5554
|
-
{
|
|
5555
|
-
value: validFromTime,
|
|
5556
|
-
onChange: (t) => {
|
|
5557
|
-
setValidFromTime(t);
|
|
5558
|
-
markTouched();
|
|
5559
|
-
},
|
|
5560
|
-
placeholder: labels.validFromTimeLabel
|
|
5561
|
-
}
|
|
5562
|
-
)
|
|
5563
|
-
] })
|
|
5564
|
-
] }),
|
|
5565
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
5566
|
-
/* @__PURE__ */ jsx("span", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.validUntilLabel }),
|
|
5567
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
5568
|
-
/* @__PURE__ */ jsx(
|
|
5569
|
-
DatePicker,
|
|
5570
|
-
{
|
|
5571
|
-
value: validUntilDate,
|
|
5572
|
-
onChange: (d) => {
|
|
5573
|
-
setValidUntilDate(d);
|
|
5574
|
-
markTouched();
|
|
5575
|
-
},
|
|
5576
|
-
placeholder: labels.validUntilDateLabel
|
|
5577
|
-
}
|
|
5578
|
-
),
|
|
5579
|
-
/* @__PURE__ */ jsx(
|
|
5580
|
-
TimePicker,
|
|
5581
|
-
{
|
|
5582
|
-
value: validUntilTime,
|
|
5583
|
-
onChange: (t) => {
|
|
5584
|
-
setValidUntilTime(t);
|
|
5585
|
-
markTouched();
|
|
5586
|
-
},
|
|
5587
|
-
placeholder: labels.validUntilTimeLabel
|
|
5588
|
-
}
|
|
5589
|
-
)
|
|
5590
|
-
] })
|
|
5591
|
-
] })
|
|
5592
|
-
] }),
|
|
5593
|
-
/* @__PURE__ */ jsx(
|
|
5594
|
-
FormCheckbox,
|
|
5595
|
-
{
|
|
5596
|
-
checked: noExpiry,
|
|
5597
|
-
onChange: (v) => {
|
|
5598
|
-
setNoExpiry(v);
|
|
5599
|
-
markTouched();
|
|
5600
5445
|
},
|
|
5601
|
-
|
|
5602
|
-
|
|
5446
|
+
tile.id
|
|
5447
|
+
);
|
|
5448
|
+
})
|
|
5449
|
+
}
|
|
5450
|
+
),
|
|
5451
|
+
actionTileId && /* @__PURE__ */ jsxs("div", { className: "border-t liquid-divider pt-4", children: [
|
|
5452
|
+
/* @__PURE__ */ jsx("p", { className: "mb-2 text-xs text-slate-500 dark:text-slate-400", children: labels.actionConfigSubtitle }),
|
|
5453
|
+
/* @__PURE__ */ jsx(
|
|
5454
|
+
RuleActionBuilder,
|
|
5455
|
+
{
|
|
5456
|
+
value: action,
|
|
5457
|
+
onChange: (next) => {
|
|
5458
|
+
setAction(next);
|
|
5459
|
+
markTouched();
|
|
5603
5460
|
}
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5461
|
+
}
|
|
5462
|
+
)
|
|
5463
|
+
] })
|
|
5464
|
+
] });
|
|
5465
|
+
}
|
|
5466
|
+
function renderStep4() {
|
|
5467
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
5468
|
+
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
5469
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
5470
|
+
/* @__PURE__ */ jsx("span", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.validFromLabel }),
|
|
5471
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
5607
5472
|
/* @__PURE__ */ jsx(
|
|
5608
|
-
|
|
5473
|
+
DatePicker,
|
|
5609
5474
|
{
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
{ value: "archived", label: labels.statusArchived }
|
|
5614
|
-
],
|
|
5615
|
-
value: status,
|
|
5616
|
-
onChange: (v) => {
|
|
5617
|
-
setStatus(v);
|
|
5475
|
+
value: validFromDate,
|
|
5476
|
+
onChange: (d) => {
|
|
5477
|
+
setValidFromDate(d);
|
|
5618
5478
|
markTouched();
|
|
5619
5479
|
},
|
|
5620
|
-
|
|
5480
|
+
placeholder: labels.validFromDateLabel
|
|
5621
5481
|
}
|
|
5622
|
-
)
|
|
5623
|
-
] }),
|
|
5624
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
5625
|
-
/* @__PURE__ */ jsx("label", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.tagsLabel }),
|
|
5482
|
+
),
|
|
5626
5483
|
/* @__PURE__ */ jsx(
|
|
5627
|
-
|
|
5484
|
+
TimePicker,
|
|
5628
5485
|
{
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
setTagsSelected(ids);
|
|
5486
|
+
value: validFromTime,
|
|
5487
|
+
onChange: (t) => {
|
|
5488
|
+
setValidFromTime(t);
|
|
5633
5489
|
markTouched();
|
|
5634
5490
|
},
|
|
5635
|
-
|
|
5636
|
-
|
|
5491
|
+
placeholder: labels.validFromTimeLabel
|
|
5492
|
+
}
|
|
5493
|
+
)
|
|
5494
|
+
] })
|
|
5495
|
+
] }),
|
|
5496
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
5497
|
+
/* @__PURE__ */ jsx("span", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.validUntilLabel }),
|
|
5498
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
5499
|
+
/* @__PURE__ */ jsx(
|
|
5500
|
+
DatePicker,
|
|
5501
|
+
{
|
|
5502
|
+
value: validUntilDate,
|
|
5503
|
+
onChange: (d) => {
|
|
5504
|
+
setValidUntilDate(d);
|
|
5637
5505
|
markTouched();
|
|
5638
5506
|
},
|
|
5639
|
-
|
|
5640
|
-
unselectedStyle: tagsStyle,
|
|
5641
|
-
showActions: false,
|
|
5642
|
-
addPlaceholder: labels.tagsPlaceholder,
|
|
5643
|
-
addAriaLabel: labels.tagsLabel
|
|
5507
|
+
placeholder: labels.validUntilDateLabel
|
|
5644
5508
|
}
|
|
5645
5509
|
),
|
|
5646
|
-
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.tagsHint })
|
|
5647
|
-
] }),
|
|
5648
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
5649
|
-
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.recurrenceLabel }),
|
|
5650
5510
|
/* @__PURE__ */ jsx(
|
|
5651
|
-
|
|
5511
|
+
TimePicker,
|
|
5652
5512
|
{
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
{ value: "recurring", label: labels.recurrenceRecurring }
|
|
5657
|
-
],
|
|
5658
|
-
value: recurrence,
|
|
5659
|
-
onChange: (v) => {
|
|
5660
|
-
setRecurrence(v);
|
|
5513
|
+
value: validUntilTime,
|
|
5514
|
+
onChange: (t) => {
|
|
5515
|
+
setValidUntilTime(t);
|
|
5661
5516
|
markTouched();
|
|
5662
5517
|
},
|
|
5663
|
-
|
|
5518
|
+
placeholder: labels.validUntilTimeLabel
|
|
5664
5519
|
}
|
|
5665
5520
|
)
|
|
5666
|
-
] })
|
|
5667
|
-
|
|
5668
|
-
|
|
5521
|
+
] })
|
|
5522
|
+
] })
|
|
5523
|
+
] }),
|
|
5524
|
+
/* @__PURE__ */ jsx(
|
|
5525
|
+
FormCheckbox,
|
|
5526
|
+
{
|
|
5527
|
+
checked: noExpiry,
|
|
5528
|
+
onChange: (v) => {
|
|
5529
|
+
setNoExpiry(v);
|
|
5530
|
+
markTouched();
|
|
5531
|
+
},
|
|
5532
|
+
label: labels.noExpiryLabel,
|
|
5533
|
+
description: labels.noExpiryDescription
|
|
5534
|
+
}
|
|
5535
|
+
),
|
|
5536
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5537
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.statusLabel }),
|
|
5538
|
+
/* @__PURE__ */ jsx(
|
|
5539
|
+
SegmentedControl,
|
|
5540
|
+
{
|
|
5541
|
+
segments: [
|
|
5542
|
+
{ value: "active", label: labels.statusActive },
|
|
5543
|
+
{ value: "paused", label: labels.statusPaused },
|
|
5544
|
+
{ value: "archived", label: labels.statusArchived }
|
|
5545
|
+
],
|
|
5546
|
+
value: status,
|
|
5547
|
+
onChange: (v) => {
|
|
5548
|
+
setStatus(v);
|
|
5549
|
+
markTouched();
|
|
5550
|
+
},
|
|
5551
|
+
size: "sm"
|
|
5552
|
+
}
|
|
5553
|
+
)
|
|
5554
|
+
] }),
|
|
5555
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
5556
|
+
/* @__PURE__ */ jsx("label", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.tagsLabel }),
|
|
5557
|
+
/* @__PURE__ */ jsx(
|
|
5558
|
+
ChipPicker,
|
|
5559
|
+
{
|
|
5560
|
+
items: tagsItems,
|
|
5561
|
+
selectedIds: tagsSelected,
|
|
5562
|
+
onChange: (ids) => {
|
|
5563
|
+
setTagsSelected(ids);
|
|
5564
|
+
markTouched();
|
|
5565
|
+
},
|
|
5566
|
+
onItemsChange: (items) => {
|
|
5567
|
+
setTagsItems(items);
|
|
5568
|
+
markTouched();
|
|
5569
|
+
},
|
|
5570
|
+
allowCustom: true,
|
|
5571
|
+
unselectedStyle: tagsStyle,
|
|
5572
|
+
showActions: false,
|
|
5573
|
+
addPlaceholder: labels.tagsPlaceholder,
|
|
5574
|
+
addAriaLabel: labels.tagsLabel
|
|
5575
|
+
}
|
|
5576
|
+
),
|
|
5577
|
+
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.tagsHint })
|
|
5578
|
+
] }),
|
|
5579
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5580
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.recurrenceLabel }),
|
|
5581
|
+
/* @__PURE__ */ jsx(
|
|
5582
|
+
SegmentedControl,
|
|
5583
|
+
{
|
|
5584
|
+
segments: [
|
|
5585
|
+
{ value: "one-off", label: labels.recurrenceOneOff },
|
|
5586
|
+
{ value: "cron", label: labels.recurrenceCron },
|
|
5587
|
+
{ value: "recurring", label: labels.recurrenceRecurring }
|
|
5588
|
+
],
|
|
5589
|
+
value: recurrence,
|
|
5590
|
+
onChange: (v) => {
|
|
5591
|
+
setRecurrence(v);
|
|
5592
|
+
markTouched();
|
|
5593
|
+
},
|
|
5594
|
+
size: "sm"
|
|
5595
|
+
}
|
|
5596
|
+
)
|
|
5597
|
+
] }),
|
|
5598
|
+
recurrence === "cron" && /* @__PURE__ */ jsx(
|
|
5599
|
+
FormInput,
|
|
5600
|
+
{
|
|
5601
|
+
label: labels.cronExpressionLabel,
|
|
5602
|
+
value: cronExpression,
|
|
5603
|
+
onValueChange: (v) => {
|
|
5604
|
+
setCronExpression(v);
|
|
5605
|
+
markTouched();
|
|
5606
|
+
},
|
|
5607
|
+
placeholder: labels.cronExpressionPlaceholder,
|
|
5608
|
+
hint: labels.cronExpressionHint
|
|
5609
|
+
}
|
|
5610
|
+
),
|
|
5611
|
+
recurrence === "recurring" && /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
5612
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5613
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.weekdaysLabel }),
|
|
5614
|
+
/* @__PURE__ */ jsx(
|
|
5615
|
+
ChipPicker,
|
|
5669
5616
|
{
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5617
|
+
items: WEEKDAYS.map((d) => ({
|
|
5618
|
+
id: d.id,
|
|
5619
|
+
name: labels[d.labelKey] ?? d.id,
|
|
5620
|
+
style: {
|
|
5621
|
+
bg: "bg-fuchsia-500/15",
|
|
5622
|
+
text: "text-fuchsia-700 dark:text-fuchsia-300"
|
|
5623
|
+
}
|
|
5624
|
+
})),
|
|
5625
|
+
selectedIds: weekdays,
|
|
5626
|
+
onChange: (ids) => {
|
|
5627
|
+
setWeekdays(ids);
|
|
5674
5628
|
markTouched();
|
|
5675
5629
|
},
|
|
5676
|
-
|
|
5677
|
-
hint: labels.cronExpressionHint
|
|
5630
|
+
showActions: false
|
|
5678
5631
|
}
|
|
5679
|
-
)
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
selectedIds: weekdays,
|
|
5695
|
-
onChange: (ids) => {
|
|
5696
|
-
setWeekdays(ids);
|
|
5697
|
-
markTouched();
|
|
5698
|
-
},
|
|
5699
|
-
showActions: false
|
|
5700
|
-
}
|
|
5701
|
-
)
|
|
5702
|
-
] }),
|
|
5703
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
5704
|
-
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.timeOfDayLabel }),
|
|
5705
|
-
/* @__PURE__ */ jsx(
|
|
5706
|
-
TimePicker,
|
|
5707
|
-
{
|
|
5708
|
-
value: recurringTime,
|
|
5709
|
-
onChange: (t) => {
|
|
5710
|
-
setRecurringTime(t);
|
|
5711
|
-
markTouched();
|
|
5712
|
-
},
|
|
5713
|
-
placeholder: labels.timeOfDayLabel
|
|
5714
|
-
}
|
|
5715
|
-
)
|
|
5716
|
-
] })
|
|
5717
|
-
] })
|
|
5632
|
+
)
|
|
5633
|
+
] }),
|
|
5634
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5635
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.timeOfDayLabel }),
|
|
5636
|
+
/* @__PURE__ */ jsx(
|
|
5637
|
+
TimePicker,
|
|
5638
|
+
{
|
|
5639
|
+
value: recurringTime,
|
|
5640
|
+
onChange: (t) => {
|
|
5641
|
+
setRecurringTime(t);
|
|
5642
|
+
markTouched();
|
|
5643
|
+
},
|
|
5644
|
+
placeholder: labels.timeOfDayLabel
|
|
5645
|
+
}
|
|
5646
|
+
)
|
|
5718
5647
|
] })
|
|
5719
|
-
}
|
|
5720
|
-
|
|
5648
|
+
] })
|
|
5649
|
+
] });
|
|
5721
5650
|
}
|
|
5722
5651
|
function renderStep5() {
|
|
5723
5652
|
const payload = buildPayload();
|
|
5724
5653
|
const conditionSentence = humanReadableCondition(payload.condition, labels);
|
|
5725
5654
|
const actionSentence = humanReadableAction(payload.action, labels, ACTION_TILES, actionTileId);
|
|
5726
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-
|
|
5655
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
5727
5656
|
/* @__PURE__ */ jsx(
|
|
5728
|
-
|
|
5657
|
+
ReviewBlock3,
|
|
5729
5658
|
{
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
},
|
|
5735
|
-
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(1), children: [
|
|
5736
|
-
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5737
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5738
|
-
] }),
|
|
5659
|
+
stepTitle: labels.wizardStep1Title,
|
|
5660
|
+
stepSubtitle: labels.wizardStep1Subtitle,
|
|
5661
|
+
editLabel: labels.wizardReviewEdit,
|
|
5662
|
+
onEdit: () => goToStep(1),
|
|
5739
5663
|
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
5740
5664
|
/* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewNameLabel, value: payload.name }),
|
|
5741
5665
|
/* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewPriorityLabel, value: String(payload.priority) }),
|
|
@@ -5751,54 +5675,35 @@ function RuleNewWizardPageView({
|
|
|
5751
5675
|
}
|
|
5752
5676
|
),
|
|
5753
5677
|
/* @__PURE__ */ jsxs(
|
|
5754
|
-
|
|
5678
|
+
ReviewBlock3,
|
|
5755
5679
|
{
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
},
|
|
5761
|
-
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(2), children: [
|
|
5762
|
-
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5763
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5764
|
-
] }),
|
|
5680
|
+
stepTitle: labels.wizardStep2Title,
|
|
5681
|
+
stepSubtitle: labels.wizardStep2Subtitle,
|
|
5682
|
+
editLabel: labels.wizardReviewEdit,
|
|
5683
|
+
onEdit: () => goToStep(2),
|
|
5765
5684
|
children: [
|
|
5766
5685
|
/* @__PURE__ */ jsx("p", { className: "mb-2 text-sm text-slate-700 dark:text-slate-200", children: conditionSentence }),
|
|
5767
|
-
/* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewCombinatorLabel, value: combinator.toUpperCase() })
|
|
5768
|
-
/* @__PURE__ */ jsx("pre", { className: "mt-3 max-h-48 overflow-auto rounded-lg border border-slate-200/70 bg-slate-50/60 p-2 text-xs text-slate-700 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-200", children: JSON.stringify(payload.condition, null, 2) })
|
|
5686
|
+
/* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewCombinatorLabel, value: combinator.toUpperCase() })
|
|
5769
5687
|
]
|
|
5770
5688
|
}
|
|
5771
5689
|
),
|
|
5772
|
-
/* @__PURE__ */
|
|
5773
|
-
|
|
5690
|
+
/* @__PURE__ */ jsx(
|
|
5691
|
+
ReviewBlock3,
|
|
5774
5692
|
{
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
}
|
|
5780
|
-
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(3), children: [
|
|
5781
|
-
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5782
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5783
|
-
] }),
|
|
5784
|
-
children: [
|
|
5785
|
-
/* @__PURE__ */ jsx("p", { className: "mb-2 text-sm text-slate-700 dark:text-slate-200", children: actionSentence }),
|
|
5786
|
-
/* @__PURE__ */ jsx("pre", { className: "mt-3 max-h-48 overflow-auto rounded-lg border border-slate-200/70 bg-slate-50/60 p-2 text-xs text-slate-700 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-200", children: JSON.stringify(payload.action, null, 2) })
|
|
5787
|
-
]
|
|
5693
|
+
stepTitle: labels.wizardStep3Title,
|
|
5694
|
+
stepSubtitle: labels.wizardStep3Subtitle,
|
|
5695
|
+
editLabel: labels.wizardReviewEdit,
|
|
5696
|
+
onEdit: () => goToStep(3),
|
|
5697
|
+
children: /* @__PURE__ */ jsx("p", { className: "text-sm text-slate-700 dark:text-slate-200", children: actionSentence })
|
|
5788
5698
|
}
|
|
5789
5699
|
),
|
|
5790
5700
|
/* @__PURE__ */ jsx(
|
|
5791
|
-
|
|
5701
|
+
ReviewBlock3,
|
|
5792
5702
|
{
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
},
|
|
5798
|
-
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(4), children: [
|
|
5799
|
-
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5800
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5801
|
-
] }),
|
|
5703
|
+
stepTitle: labels.wizardStep4Title,
|
|
5704
|
+
stepSubtitle: labels.wizardStep4Subtitle,
|
|
5705
|
+
editLabel: labels.wizardReviewEdit,
|
|
5706
|
+
onEdit: () => goToStep(4),
|
|
5802
5707
|
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
5803
5708
|
/* @__PURE__ */ jsx(
|
|
5804
5709
|
ReviewRow3,
|
|
@@ -5830,23 +5735,23 @@ function RuleNewWizardPageView({
|
|
|
5830
5735
|
}
|
|
5831
5736
|
const stepBody = step === 1 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : step === 4 ? renderStep4() : renderStep5();
|
|
5832
5737
|
const advanceDisabled = !canAdvance(step);
|
|
5833
|
-
const
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5738
|
+
const isLast = step === TOTAL_STEPS3;
|
|
5739
|
+
const scrollableStep = step === 2 || step === 3 || step === 4 || step === 5;
|
|
5740
|
+
const bodyClass = scrollableStep ? "p-5 pt-5 sm:p-8 sm:pt-8 max-h-[60vh] overflow-y-auto" : "p-5 pt-5 sm:p-8 sm:pt-8";
|
|
5741
|
+
const footer = /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex items-center justify-between border-t pt-4", children: [
|
|
5742
|
+
/* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: step === 1 ? cancelWithConfirm : goBack, disabled: submitting, children: step === 1 ? labels.wizardCancel : labels.wizardBack }),
|
|
5743
|
+
isLast ? /* @__PURE__ */ jsx(
|
|
5744
|
+
Button,
|
|
5745
|
+
{
|
|
5746
|
+
type: "button",
|
|
5747
|
+
color: "ios-glass-blue",
|
|
5748
|
+
onClick: () => void submit(),
|
|
5749
|
+
disabled: submitting || !name.trim() || !actionTileId,
|
|
5750
|
+
children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate
|
|
5751
|
+
}
|
|
5752
|
+
) : /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext })
|
|
5848
5753
|
] });
|
|
5849
|
-
|
|
5754
|
+
return /* @__PURE__ */ jsxs(
|
|
5850
5755
|
"form",
|
|
5851
5756
|
{
|
|
5852
5757
|
onSubmit: (e) => {
|
|
@@ -5856,15 +5761,12 @@ function RuleNewWizardPageView({
|
|
|
5856
5761
|
},
|
|
5857
5762
|
className: "space-y-4",
|
|
5858
5763
|
children: [
|
|
5859
|
-
|
|
5764
|
+
hero,
|
|
5765
|
+
/* @__PURE__ */ jsx(Card, { variant: "default", children: /* @__PURE__ */ jsx(CardContent, { className: bodyClass, children: stepBody }) }),
|
|
5860
5766
|
footer
|
|
5861
5767
|
]
|
|
5862
5768
|
}
|
|
5863
5769
|
);
|
|
5864
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
5865
|
-
hero,
|
|
5866
|
-
content
|
|
5867
|
-
] });
|
|
5868
5770
|
}
|
|
5869
5771
|
function ReviewRow3({ label, value }) {
|
|
5870
5772
|
return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-slate-200/60 bg-white/40 px-3 py-2 dark:border-white/10 dark:bg-white/[0.04]", children: [
|
|
@@ -5872,6 +5774,27 @@ function ReviewRow3({ label, value }) {
|
|
|
5872
5774
|
/* @__PURE__ */ jsx("dd", { className: "mt-0.5 whitespace-pre-wrap break-words text-xs font-semibold text-slate-900 dark:text-white", children: value })
|
|
5873
5775
|
] });
|
|
5874
5776
|
}
|
|
5777
|
+
function ReviewBlock3({
|
|
5778
|
+
stepTitle,
|
|
5779
|
+
stepSubtitle,
|
|
5780
|
+
editLabel,
|
|
5781
|
+
onEdit,
|
|
5782
|
+
children
|
|
5783
|
+
}) {
|
|
5784
|
+
return /* @__PURE__ */ jsxs("section", { className: "border-b liquid-divider pb-4 last:border-b-0 last:pb-0", children: [
|
|
5785
|
+
/* @__PURE__ */ jsxs("header", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
5786
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
5787
|
+
/* @__PURE__ */ jsx("h4", { className: "truncate text-sm font-semibold text-slate-900 dark:text-white", children: stepTitle }),
|
|
5788
|
+
stepSubtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-slate-500 dark:text-slate-400", children: stepSubtitle })
|
|
5789
|
+
] }),
|
|
5790
|
+
/* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: onEdit, children: [
|
|
5791
|
+
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5792
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: editLabel })
|
|
5793
|
+
] })
|
|
5794
|
+
] }),
|
|
5795
|
+
children
|
|
5796
|
+
] });
|
|
5797
|
+
}
|
|
5875
5798
|
function pad(n) {
|
|
5876
5799
|
return String(n).padStart(2, "0");
|
|
5877
5800
|
}
|
|
@@ -6108,15 +6031,23 @@ function ModelNewWizardPageView({
|
|
|
6108
6031
|
const stepTitles = [labels.step1Title, labels.step2Title, labels.step3Title, labels.step4Title];
|
|
6109
6032
|
const stepSubtitles = [labels.step1Subtitle, labels.step2Subtitle, labels.step3Subtitle, labels.step4Subtitle];
|
|
6110
6033
|
const indicatorSteps = stepTitles.map((title, idx) => ({ id: String(idx + 1), title }));
|
|
6111
|
-
const counter = labels.wizardStepCounter.replace("{current}", String(step)).replace("{total}", String(TOTAL_STEPS4));
|
|
6112
6034
|
const hero = /* @__PURE__ */ jsx(
|
|
6113
6035
|
HeroSection,
|
|
6114
6036
|
{
|
|
6115
6037
|
icon: /* @__PURE__ */ jsx(CubeTransparentIcon, { className: "h-5 w-5" }),
|
|
6116
|
-
label:
|
|
6117
|
-
title: labels.pageTitle,
|
|
6038
|
+
label: labels.pageTitle,
|
|
6039
|
+
title: stepTitles[step - 1] ?? labels.pageTitle,
|
|
6118
6040
|
subtitle: stepSubtitles[step - 1] ?? labels.pageSubtitle,
|
|
6119
6041
|
gradient: "from-emerald-500 to-teal-700",
|
|
6042
|
+
actions: /* @__PURE__ */ jsx(
|
|
6043
|
+
IconButton,
|
|
6044
|
+
{
|
|
6045
|
+
label: labels.wizardCancel,
|
|
6046
|
+
icon: /* @__PURE__ */ jsx(XMarkIcon, { className: "h-5 w-5" }),
|
|
6047
|
+
variant: "ghost",
|
|
6048
|
+
onClick: cancelWithConfirm
|
|
6049
|
+
}
|
|
6050
|
+
),
|
|
6120
6051
|
children: /* @__PURE__ */ jsx(
|
|
6121
6052
|
StepIndicator,
|
|
6122
6053
|
{
|
|
@@ -6131,185 +6062,166 @@ function ModelNewWizardPageView({
|
|
|
6131
6062
|
);
|
|
6132
6063
|
function renderStep1() {
|
|
6133
6064
|
return /* @__PURE__ */ jsx(
|
|
6134
|
-
|
|
6135
|
-
{
|
|
6136
|
-
variant: "glass",
|
|
6137
|
-
header: { title: labels.providerLabel, subtitle: labels.step1Subtitle },
|
|
6138
|
-
children: /* @__PURE__ */ jsx(
|
|
6139
|
-
"div",
|
|
6140
|
-
{
|
|
6141
|
-
role: "radiogroup",
|
|
6142
|
-
"aria-label": labels.providerLabel,
|
|
6143
|
-
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
6144
|
-
children: MODEL_PROVIDERS.map((p) => {
|
|
6145
|
-
const Icon = PROVIDER_ICON[p.value] ?? GlobeAltIcon;
|
|
6146
|
-
const color = PROVIDER_COLOR[p.value] ?? "slate";
|
|
6147
|
-
const selected = providerSlug === p.value;
|
|
6148
|
-
return /* @__PURE__ */ jsx(
|
|
6149
|
-
FilterTileButton,
|
|
6150
|
-
{
|
|
6151
|
-
isActive: selected,
|
|
6152
|
-
color,
|
|
6153
|
-
icon: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" }),
|
|
6154
|
-
label: p.label,
|
|
6155
|
-
count: p.category,
|
|
6156
|
-
onClick: () => {
|
|
6157
|
-
setProviderSlug(p.value);
|
|
6158
|
-
markTouched();
|
|
6159
|
-
}
|
|
6160
|
-
},
|
|
6161
|
-
p.value
|
|
6162
|
-
);
|
|
6163
|
-
})
|
|
6164
|
-
}
|
|
6165
|
-
)
|
|
6166
|
-
}
|
|
6167
|
-
);
|
|
6168
|
-
}
|
|
6169
|
-
function renderStep2() {
|
|
6170
|
-
return /* @__PURE__ */ jsx(
|
|
6171
|
-
SectionCard,
|
|
6065
|
+
"div",
|
|
6172
6066
|
{
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
setName(v);
|
|
6183
|
-
markTouched();
|
|
6184
|
-
},
|
|
6185
|
-
placeholder: labels.namePlaceholder || `${preset.label} \u2014 produ\xE7\xE3o`,
|
|
6186
|
-
required: true
|
|
6187
|
-
}
|
|
6188
|
-
),
|
|
6189
|
-
/* @__PURE__ */ jsx(
|
|
6190
|
-
FormInput,
|
|
6067
|
+
role: "radiogroup",
|
|
6068
|
+
"aria-label": labels.providerLabel,
|
|
6069
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
6070
|
+
children: MODEL_PROVIDERS.map((p) => {
|
|
6071
|
+
const Icon = PROVIDER_ICON[p.value] ?? GlobeAltIcon;
|
|
6072
|
+
const color = PROVIDER_COLOR[p.value] ?? "slate";
|
|
6073
|
+
const selected = providerSlug === p.value;
|
|
6074
|
+
return /* @__PURE__ */ jsx(
|
|
6075
|
+
FilterTileButton,
|
|
6191
6076
|
{
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6077
|
+
isActive: selected,
|
|
6078
|
+
color,
|
|
6079
|
+
icon: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" }),
|
|
6080
|
+
label: p.label,
|
|
6081
|
+
count: p.category,
|
|
6082
|
+
onClick: () => {
|
|
6083
|
+
setProviderSlug(p.value);
|
|
6197
6084
|
markTouched();
|
|
6198
|
-
}
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
)
|
|
6202
|
-
|
|
6085
|
+
}
|
|
6086
|
+
},
|
|
6087
|
+
p.value
|
|
6088
|
+
);
|
|
6089
|
+
})
|
|
6203
6090
|
}
|
|
6204
6091
|
);
|
|
6205
6092
|
}
|
|
6093
|
+
function renderStep2() {
|
|
6094
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
6095
|
+
/* @__PURE__ */ jsx(
|
|
6096
|
+
FormInput,
|
|
6097
|
+
{
|
|
6098
|
+
label: labels.nameLabel,
|
|
6099
|
+
value: name,
|
|
6100
|
+
onValueChange: (v) => {
|
|
6101
|
+
setName(v);
|
|
6102
|
+
markTouched();
|
|
6103
|
+
},
|
|
6104
|
+
placeholder: labels.namePlaceholder || `${preset.label} \u2014 produ\xE7\xE3o`,
|
|
6105
|
+
required: true
|
|
6106
|
+
}
|
|
6107
|
+
),
|
|
6108
|
+
/* @__PURE__ */ jsx(
|
|
6109
|
+
FormInput,
|
|
6110
|
+
{
|
|
6111
|
+
label: labels.apiKeyLabel,
|
|
6112
|
+
type: "password",
|
|
6113
|
+
value: apiKey,
|
|
6114
|
+
onValueChange: (v) => {
|
|
6115
|
+
setApiKey(v);
|
|
6116
|
+
markTouched();
|
|
6117
|
+
},
|
|
6118
|
+
placeholder: labels.apiKeyPlaceholder
|
|
6119
|
+
}
|
|
6120
|
+
)
|
|
6121
|
+
] }) });
|
|
6122
|
+
}
|
|
6206
6123
|
function renderStep3() {
|
|
6207
6124
|
const showRegion = preset.needsRegion === true;
|
|
6208
6125
|
const showEndpoint = preset.needsEndpoint === true;
|
|
6209
|
-
return /* @__PURE__ */
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
),
|
|
6289
|
-
testStatus === "success" && /* @__PURE__ */ jsx(StatusBadge, { status: "success", label: labels.connectionSuccess }),
|
|
6290
|
-
testStatus === "failed" && /* @__PURE__ */ jsx(StatusBadge, { status: "error", label: labels.connectionFailed })
|
|
6291
|
-
] })
|
|
6292
|
-
] })
|
|
6293
|
-
}
|
|
6294
|
-
);
|
|
6126
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
6127
|
+
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
6128
|
+
showRegion && (preset.regions ? /* @__PURE__ */ jsx(
|
|
6129
|
+
FormSelect,
|
|
6130
|
+
{
|
|
6131
|
+
label: labels.regionLabel,
|
|
6132
|
+
value: region,
|
|
6133
|
+
onValueChange: (v) => {
|
|
6134
|
+
setRegion(v);
|
|
6135
|
+
markTouched();
|
|
6136
|
+
},
|
|
6137
|
+
options: [...preset.regions]
|
|
6138
|
+
}
|
|
6139
|
+
) : /* @__PURE__ */ jsx(
|
|
6140
|
+
FormInput,
|
|
6141
|
+
{
|
|
6142
|
+
label: labels.regionLabel,
|
|
6143
|
+
value: region,
|
|
6144
|
+
onValueChange: (v) => {
|
|
6145
|
+
setRegion(v);
|
|
6146
|
+
markTouched();
|
|
6147
|
+
},
|
|
6148
|
+
placeholder: labels.regionPlaceholder ?? preset.defaultRegion
|
|
6149
|
+
}
|
|
6150
|
+
)),
|
|
6151
|
+
showEndpoint && /* @__PURE__ */ jsx(
|
|
6152
|
+
FormInput,
|
|
6153
|
+
{
|
|
6154
|
+
label: labels.endpointLabel,
|
|
6155
|
+
type: "url",
|
|
6156
|
+
value: endpoint,
|
|
6157
|
+
onValueChange: (v) => {
|
|
6158
|
+
setEndpoint(v);
|
|
6159
|
+
markTouched();
|
|
6160
|
+
},
|
|
6161
|
+
placeholder: labels.endpointPlaceholder ?? "https://\u2026"
|
|
6162
|
+
}
|
|
6163
|
+
)
|
|
6164
|
+
] }),
|
|
6165
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
6166
|
+
/* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.modelFilterLabel }),
|
|
6167
|
+
/* @__PURE__ */ jsx(
|
|
6168
|
+
ChipPicker,
|
|
6169
|
+
{
|
|
6170
|
+
items: modelFilterItems,
|
|
6171
|
+
selectedIds: modelFilterSelected,
|
|
6172
|
+
onChange: (ids) => {
|
|
6173
|
+
setModelFilterSelected(ids);
|
|
6174
|
+
markTouched();
|
|
6175
|
+
},
|
|
6176
|
+
onItemsChange: (items) => {
|
|
6177
|
+
setModelFilterItems(items);
|
|
6178
|
+
markTouched();
|
|
6179
|
+
},
|
|
6180
|
+
allowCustom: true,
|
|
6181
|
+
showActions: false,
|
|
6182
|
+
addPlaceholder: labels.modelFilterPlaceholder,
|
|
6183
|
+
addAriaLabel: labels.modelFilterLabel
|
|
6184
|
+
}
|
|
6185
|
+
)
|
|
6186
|
+
] }),
|
|
6187
|
+
onTestConnection && /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex flex-wrap items-center gap-3 border-t pt-4", children: [
|
|
6188
|
+
/* @__PURE__ */ jsx(
|
|
6189
|
+
Button,
|
|
6190
|
+
{
|
|
6191
|
+
type: "button",
|
|
6192
|
+
outline: true,
|
|
6193
|
+
onClick: () => void handleTestConnection(),
|
|
6194
|
+
disabled: testStatus === "testing",
|
|
6195
|
+
children: testStatus === "testing" ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
6196
|
+
/* @__PURE__ */ jsx(Spinner, { size: "xs" }),
|
|
6197
|
+
labels.testing
|
|
6198
|
+
] }) : labels.testConnection
|
|
6199
|
+
}
|
|
6200
|
+
),
|
|
6201
|
+
testStatus === "success" && /* @__PURE__ */ jsx(StatusBadge, { status: "success", label: labels.connectionSuccess }),
|
|
6202
|
+
testStatus === "failed" && /* @__PURE__ */ jsx(StatusBadge, { status: "error", label: labels.connectionFailed })
|
|
6203
|
+
] })
|
|
6204
|
+
] });
|
|
6295
6205
|
}
|
|
6296
6206
|
function renderStep4() {
|
|
6297
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-
|
|
6207
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
6298
6208
|
/* @__PURE__ */ jsx(
|
|
6299
|
-
|
|
6209
|
+
ReviewBlock4,
|
|
6300
6210
|
{
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6211
|
+
stepTitle: labels.step1Title,
|
|
6212
|
+
stepSubtitle: labels.step1Subtitle,
|
|
6213
|
+
editLabel: labels.wizardReviewEdit,
|
|
6214
|
+
onEdit: () => goToStep(1),
|
|
6304
6215
|
children: /* @__PURE__ */ jsx("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: /* @__PURE__ */ jsx(ReviewRow4, { label: labels.reviewProviderLabel, value: preset.label }) })
|
|
6305
6216
|
}
|
|
6306
6217
|
),
|
|
6307
6218
|
/* @__PURE__ */ jsx(
|
|
6308
|
-
|
|
6219
|
+
ReviewBlock4,
|
|
6309
6220
|
{
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6221
|
+
stepTitle: labels.step2Title,
|
|
6222
|
+
stepSubtitle: labels.step2Subtitle,
|
|
6223
|
+
editLabel: labels.wizardReviewEdit,
|
|
6224
|
+
onEdit: () => goToStep(2),
|
|
6313
6225
|
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
6314
6226
|
/* @__PURE__ */ jsx(ReviewRow4, { label: labels.reviewNameLabel, value: name || labels.reviewNoneValue }),
|
|
6315
6227
|
/* @__PURE__ */ jsx(ReviewRow4, { label: labels.reviewApiKeyLabel, value: apiKey ? labels.reviewApiKeyRedacted : labels.reviewNoneValue })
|
|
@@ -6317,11 +6229,12 @@ function ModelNewWizardPageView({
|
|
|
6317
6229
|
}
|
|
6318
6230
|
),
|
|
6319
6231
|
/* @__PURE__ */ jsx(
|
|
6320
|
-
|
|
6232
|
+
ReviewBlock4,
|
|
6321
6233
|
{
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6234
|
+
stepTitle: labels.step3Title,
|
|
6235
|
+
stepSubtitle: labels.step3Subtitle,
|
|
6236
|
+
editLabel: labels.wizardReviewEdit,
|
|
6237
|
+
onEdit: () => goToStep(3),
|
|
6325
6238
|
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
6326
6239
|
/* @__PURE__ */ jsx(ReviewRow4, { label: labels.reviewRegionLabel, value: region || labels.reviewNoneValue }),
|
|
6327
6240
|
/* @__PURE__ */ jsx(ReviewRow4, { label: labels.reviewEndpointLabel, value: endpoint || labels.reviewNoneValue }),
|
|
@@ -6339,14 +6252,14 @@ function ModelNewWizardPageView({
|
|
|
6339
6252
|
}
|
|
6340
6253
|
const stepBody = step === 1 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : renderStep4();
|
|
6341
6254
|
const advanceDisabled = !canAdvance(step);
|
|
6342
|
-
const
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6255
|
+
const isLast = step === TOTAL_STEPS4;
|
|
6256
|
+
const scrollableStep = step === 1 || step === 4;
|
|
6257
|
+
const bodyClass = scrollableStep ? "p-5 pt-5 sm:p-8 sm:pt-8 max-h-[60vh] overflow-y-auto" : "p-5 pt-5 sm:p-8 sm:pt-8";
|
|
6258
|
+
const footer = /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex items-center justify-between border-t pt-4", children: [
|
|
6259
|
+
/* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: step === 1 ? cancelWithConfirm : goBack, disabled: submitting, children: step === 1 ? labels.wizardCancel : labels.wizardBack }),
|
|
6260
|
+
isLast ? /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: () => void submit(), disabled: submitting || !name.trim(), children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate }) : /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext })
|
|
6348
6261
|
] });
|
|
6349
|
-
|
|
6262
|
+
return /* @__PURE__ */ jsxs(
|
|
6350
6263
|
"form",
|
|
6351
6264
|
{
|
|
6352
6265
|
onSubmit: (e) => {
|
|
@@ -6356,15 +6269,12 @@ function ModelNewWizardPageView({
|
|
|
6356
6269
|
},
|
|
6357
6270
|
className: "space-y-4",
|
|
6358
6271
|
children: [
|
|
6359
|
-
|
|
6272
|
+
hero,
|
|
6273
|
+
/* @__PURE__ */ jsx(Card, { variant: "default", children: /* @__PURE__ */ jsx(CardContent, { className: bodyClass, children: stepBody }) }),
|
|
6360
6274
|
footer
|
|
6361
6275
|
]
|
|
6362
6276
|
}
|
|
6363
6277
|
);
|
|
6364
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
6365
|
-
hero,
|
|
6366
|
-
content
|
|
6367
|
-
] });
|
|
6368
6278
|
}
|
|
6369
6279
|
function ReviewRow4({ label, value }) {
|
|
6370
6280
|
return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-slate-200/60 bg-white/40 px-3 py-2 dark:border-white/10 dark:bg-white/[0.04]", children: [
|
|
@@ -6372,6 +6282,27 @@ function ReviewRow4({ label, value }) {
|
|
|
6372
6282
|
/* @__PURE__ */ jsx("dd", { className: "mt-0.5 truncate text-xs font-semibold text-slate-900 dark:text-white", children: value })
|
|
6373
6283
|
] });
|
|
6374
6284
|
}
|
|
6285
|
+
function ReviewBlock4({
|
|
6286
|
+
stepTitle,
|
|
6287
|
+
stepSubtitle,
|
|
6288
|
+
editLabel,
|
|
6289
|
+
onEdit,
|
|
6290
|
+
children
|
|
6291
|
+
}) {
|
|
6292
|
+
return /* @__PURE__ */ jsxs("section", { className: "border-b liquid-divider pb-4 last:border-b-0 last:pb-0", children: [
|
|
6293
|
+
/* @__PURE__ */ jsxs("header", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
6294
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
6295
|
+
/* @__PURE__ */ jsx("h4", { className: "truncate text-sm font-semibold text-slate-900 dark:text-white", children: stepTitle }),
|
|
6296
|
+
stepSubtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-slate-500 dark:text-slate-400", children: stepSubtitle })
|
|
6297
|
+
] }),
|
|
6298
|
+
/* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: onEdit, children: [
|
|
6299
|
+
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
6300
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: editLabel })
|
|
6301
|
+
] })
|
|
6302
|
+
] }),
|
|
6303
|
+
children
|
|
6304
|
+
] });
|
|
6305
|
+
}
|
|
6375
6306
|
function ModelNewModal({ open, onClose, ...wizardProps }) {
|
|
6376
6307
|
return /* @__PURE__ */ jsx(
|
|
6377
6308
|
GlassModal,
|