@manta-eu/react 0.1.7 → 0.1.8
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/README.md +2 -0
- package/dist/components/chart/AreaChart.d.ts.map +1 -1
- package/dist/components/chart/AreaChart.js +4 -6
- package/dist/components/chart/BarChart.d.ts.map +1 -1
- package/dist/components/chart/BarChart.js +5 -6
- package/dist/components/chart/ComposedChart.d.ts.map +1 -1
- package/dist/components/chart/ComposedChart.js +15 -7
- package/dist/components/chart/LineChart.d.ts.map +1 -1
- package/dist/components/chart/LineChart.js +4 -6
- package/dist/components/chart/annotations.d.ts +4 -0
- package/dist/components/chart/annotations.d.ts.map +1 -1
- package/dist/components/chart/annotations.js +10 -2
- package/dist/components/chart/chart-schemas.d.ts +1960 -54
- package/dist/components/chart/chart-schemas.d.ts.map +1 -1
- package/dist/components/chart/chart-schemas.js +137 -15
- package/dist/components/chart/series.d.ts +28 -0
- package/dist/components/chart/series.d.ts.map +1 -0
- package/dist/components/chart/series.js +61 -0
- package/dist/components/chart/stacks.d.ts +9 -0
- package/dist/components/chart/stacks.d.ts.map +1 -0
- package/dist/components/chart/stacks.js +11 -0
- package/dist/components/chat-view/ChatHeaders.d.ts.map +1 -1
- package/dist/components/chat-view/ChatHeaders.js +2 -2
- package/dist/components/layouts/Sidebar.d.ts.map +1 -1
- package/dist/components/layouts/Sidebar.js +14 -3
- package/dist/components/planning/ActioningView.d.ts.map +1 -1
- package/dist/components/planning/ActioningView.js +7 -49
- package/dist/components/planning/ExecutionSectionItem.d.ts +6 -4
- package/dist/components/planning/ExecutionSectionItem.d.ts.map +1 -1
- package/dist/components/planning/ExecutionSectionItem.js +2 -2
- package/dist/components/planning/ExecutionSections.d.ts +6 -4
- package/dist/components/planning/ExecutionSections.d.ts.map +1 -1
- package/dist/components/planning/ExecutionSections.js +2 -2
- package/dist/components/planning/ManualActionCard.d.ts +14 -8
- package/dist/components/planning/ManualActionCard.d.ts.map +1 -1
- package/dist/components/planning/ManualActionCard.js +44 -24
- package/dist/components/planning/ManualActionList.d.ts +22 -0
- package/dist/components/planning/ManualActionList.d.ts.map +1 -0
- package/dist/components/planning/ManualActionList.js +35 -0
- package/dist/components/planning/manual-action-targets.d.ts +4 -0
- package/dist/components/planning/manual-action-targets.d.ts.map +1 -0
- package/dist/components/planning/manual-action-targets.js +19 -0
- package/dist/components/sidebar/index.d.ts +2 -0
- package/dist/components/sidebar/index.d.ts.map +1 -1
- package/dist/components/sidebar/index.js +1 -0
- package/dist/components/sidebar/nav-user.d.ts +1 -1
- package/dist/components/sidebar/nav-user.d.ts.map +1 -1
- package/dist/components/sidebar/nav-user.js +3 -3
- package/dist/components/sidebar/user-avatar.d.ts +7 -0
- package/dist/components/sidebar/user-avatar.d.ts.map +1 -0
- package/dist/components/sidebar/user-avatar.js +9 -0
- package/dist/globals.css +6 -13
- package/dist/hooks/use-connection-problems.d.ts.map +1 -1
- package/dist/hooks/use-manual-actions.d.ts +13 -3
- package/dist/hooks/use-manual-actions.d.ts.map +1 -1
- package/dist/hooks/use-manual-actions.js +16 -10
- package/dist/hooks/useAuth.d.ts +1 -0
- package/dist/hooks/useAuth.d.ts.map +1 -1
- package/dist/hooks/useAuth.js +7 -1
- package/dist/hooks/useConversations.d.ts +1 -0
- package/dist/hooks/useConversations.d.ts.map +1 -1
- package/dist/hooks/useResolveManualAction.d.ts +14 -0
- package/dist/hooks/useResolveManualAction.d.ts.map +1 -0
- package/dist/hooks/useResolveManualAction.js +47 -0
- package/dist/hooks/useValidateActionPlan.d.ts.map +1 -1
- package/dist/ldo-ui.d.ts +2 -1
- package/dist/ldo-ui.d.ts.map +1 -1
- package/dist/ldo-ui.js +2 -1
- package/dist/lib/build-config.d.ts +2 -0
- package/dist/lib/build-config.d.ts.map +1 -1
- package/dist/lib/build-config.js +2 -0
- package/dist/lib/chat-types.d.ts +1 -0
- package/dist/lib/chat-types.d.ts.map +1 -1
- package/dist/lib/datastore-route-table.d.ts +2 -0
- package/dist/lib/datastore-route-table.d.ts.map +1 -1
- package/dist/lib/datastore-route-table.js +3 -1
- package/dist/lib/datastore-routes.d.ts +7 -1
- package/dist/lib/datastore-routes.d.ts.map +1 -1
- package/dist/lib/datastore-routes.js +7 -2
- package/dist/lib/decode-chart-entities.d.ts.map +1 -1
- package/dist/lib/decode-chart-entities.js +5 -1
- package/dist/lib/manual-actions.d.ts +1 -0
- package/dist/lib/manual-actions.d.ts.map +1 -1
- package/dist/lib/manual-actions.js +4 -1
- package/dist/lib/structured-data/types.d.ts +7 -2
- package/dist/lib/structured-data/types.d.ts.map +1 -1
- package/dist/providers/ChatManagerProvider.d.ts.map +1 -1
- package/dist/providers/ChatManagerProvider.js +18 -16
- package/dist/providers/NavExtrasProvider.d.ts +23 -0
- package/dist/providers/NavExtrasProvider.d.ts.map +1 -0
- package/dist/providers/NavExtrasProvider.js +10 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +1 -0
- package/dist/routes/explain/ExplainEmpty.d.ts.map +1 -1
- package/dist/routes/explain/ExplainEmpty.js +2 -1
- package/dist/routes/integrations/catalog-shape.d.ts +2 -1
- package/dist/routes/integrations/catalog-shape.d.ts.map +1 -1
- package/dist/routes/integrations/components/AddIntegrationModal.d.ts.map +1 -1
- package/dist/routes/integrations/components/AddIntegrationModal.js +1 -1
- package/dist/routes/integrations/components/MantaSyncPluginDownload.d.ts +13 -0
- package/dist/routes/integrations/components/MantaSyncPluginDownload.d.ts.map +1 -0
- package/dist/routes/integrations/components/MantaSyncPluginDownload.js +23 -0
- package/dist/routes/integrations/components/connect-forms/ConnectFormHeader.d.ts +1 -1
- package/dist/routes/integrations/components/connect-forms/ConnectFormHeader.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/ConnectWizardShell.d.ts +1 -1
- package/dist/routes/integrations/components/connect-forms/ConnectWizardShell.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/ConnectionStringInput.d.ts +11 -0
- package/dist/routes/integrations/components/connect-forms/ConnectionStringInput.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/ConnectionStringInput.js +49 -0
- package/dist/routes/integrations/components/connect-forms/DashConnectForm.d.ts +7 -0
- package/dist/routes/integrations/components/connect-forms/DashConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/DashConnectForm.js +87 -0
- package/dist/routes/integrations/components/connect-forms/DataConnectionConnectForm.d.ts +20 -0
- package/dist/routes/integrations/components/connect-forms/DataConnectionConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/DataConnectionConnectForm.js +144 -0
- package/dist/routes/integrations/components/connect-forms/DataConnectionFieldInputs.d.ts +8 -0
- package/dist/routes/integrations/components/connect-forms/DataConnectionFieldInputs.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/DataConnectionFieldInputs.js +44 -0
- package/dist/routes/integrations/components/connect-forms/FigmaConnectForm.d.ts +3 -0
- package/dist/routes/integrations/components/connect-forms/FigmaConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/FigmaConnectForm.js +20 -0
- package/dist/routes/integrations/components/connect-forms/GmailConnectForm.d.ts +3 -0
- package/dist/routes/integrations/components/connect-forms/GmailConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/GmailConnectForm.js +11 -0
- package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.d.ts +3 -0
- package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.js +37 -0
- package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.d.ts +3 -0
- package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.js +37 -0
- package/dist/routes/integrations/components/connect-forms/ImportStartedNotice.d.ts +21 -0
- package/dist/routes/integrations/components/connect-forms/ImportStartedNotice.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/ImportStartedNotice.js +25 -0
- package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.d.ts +45 -0
- package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.js +187 -0
- package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.d.ts +6 -0
- package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.js +68 -0
- package/dist/routes/integrations/components/connect-forms/LinkedinConnectForm.d.ts +10 -0
- package/dist/routes/integrations/components/connect-forms/LinkedinConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/LinkedinConnectForm.js +124 -0
- package/dist/routes/integrations/components/connect-forms/MetaAdsConnectForm.d.ts +14 -0
- package/dist/routes/integrations/components/connect-forms/MetaAdsConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/MetaAdsConnectForm.js +183 -0
- package/dist/routes/integrations/components/connect-forms/OAuthConnectLink.d.ts +10 -0
- package/dist/routes/integrations/components/connect-forms/OAuthConnectLink.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/OAuthConnectLink.js +17 -0
- package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.d.ts +45 -0
- package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.js +136 -0
- package/dist/routes/integrations/components/connect-forms/OAuthSingleAccountConnectForm.d.ts +23 -0
- package/dist/routes/integrations/components/connect-forms/OAuthSingleAccountConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/OAuthSingleAccountConnectForm.js +63 -0
- package/dist/routes/integrations/components/connect-forms/ShopifyConnectForm.d.ts +3 -0
- package/dist/routes/integrations/components/connect-forms/ShopifyConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/ShopifyConnectForm.js +14 -0
- package/dist/routes/integrations/components/connect-forms/SlackConnectForm.d.ts +3 -0
- package/dist/routes/integrations/components/connect-forms/SlackConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/SlackConnectForm.js +10 -0
- package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.d.ts +5 -0
- package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.js +35 -0
- package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.d.ts +5 -0
- package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.js +47 -0
- package/dist/routes/integrations/components/connect-forms/connection-string-fields.d.ts +13 -0
- package/dist/routes/integrations/components/connect-forms/connection-string-fields.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/connection-string-fields.js +110 -0
- package/dist/routes/integrations/components/connect-forms/dash-folder-tree.d.ts +6 -0
- package/dist/routes/integrations/components/connect-forms/dash-folder-tree.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/dash-folder-tree.js +14 -0
- package/dist/routes/integrations/components/connect-forms/data-connection-fields.d.ts +35 -0
- package/dist/routes/integrations/components/connect-forms/data-connection-fields.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/data-connection-fields.js +88 -0
- package/dist/routes/integrations/components/connect-forms/google-ads-account-tree.d.ts +11 -0
- package/dist/routes/integrations/components/connect-forms/google-ads-account-tree.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/google-ads-account-tree.js +36 -0
- package/dist/routes/integrations/components/connect-forms/google-analytics-property-tree.d.ts +6 -0
- package/dist/routes/integrations/components/connect-forms/google-analytics-property-tree.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/google-analytics-property-tree.js +34 -0
- package/dist/routes/integrations/components/connect-forms/oauth-setup-phase.d.ts +12 -0
- package/dist/routes/integrations/components/connect-forms/oauth-setup-phase.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/oauth-setup-phase.js +33 -0
- package/dist/routes/integrations/components/connect-forms/setup-account-unavailable-reason.d.ts +3 -0
- package/dist/routes/integrations/components/connect-forms/setup-account-unavailable-reason.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/setup-account-unavailable-reason.js +8 -0
- package/dist/routes/integrations/components/connect-forms/types.d.ts +5 -1
- package/dist/routes/integrations/components/connect-forms/types.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/useConnectWizard.d.ts +19 -0
- package/dist/routes/integrations/components/connect-forms/useConnectWizard.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/useConnectWizard.js +28 -0
- package/dist/routes/integrations/components/connect-forms/useConnectedExternalIds.d.ts +4 -0
- package/dist/routes/integrations/components/connect-forms/useConnectedExternalIds.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/useConnectedExternalIds.js +17 -0
- package/dist/routes/integrations/components/connect-forms/useWindowFocusPoll.d.ts +7 -0
- package/dist/routes/integrations/components/connect-forms/useWindowFocusPoll.d.ts.map +1 -0
- package/dist/routes/integrations/components/connect-forms/useWindowFocusPoll.js +18 -0
- package/dist/routes/integrations/connect-forms.d.ts +16 -0
- package/dist/routes/integrations/connect-forms.d.ts.map +1 -0
- package/dist/routes/integrations/connect-forms.js +14 -0
- package/dist/routes/integrations/filter-connected-providers.d.ts +3 -0
- package/dist/routes/integrations/filter-connected-providers.d.ts.map +1 -0
- package/dist/routes/integrations/filter-connected-providers.js +15 -0
- package/dist/routes/integrations/overview.d.ts +3 -0
- package/dist/routes/integrations/overview.d.ts.map +1 -0
- package/dist/routes/integrations/overview.js +2 -0
- package/dist/routes/integrations/use-connected-account-entities.d.ts +10 -0
- package/dist/routes/integrations/use-connected-account-entities.d.ts.map +1 -0
- package/dist/routes/integrations/use-connected-account-entities.js +29 -0
- package/dist/routes/memories/components/EmptyStates.d.ts.map +1 -1
- package/dist/routes/memories/components/EmptyStates.js +2 -1
- package/dist/routes/plans/components/actionPlansTableConfig.d.ts +12 -12
- package/package.json +47 -8
|
@@ -3,6 +3,7 @@ import type { ReactNode } from "react";
|
|
|
3
3
|
export * from "./ActiveDatastoreProvider.js";
|
|
4
4
|
export * from "./AssistantIconProvider.js";
|
|
5
5
|
export * from "./AssistantNameProvider.js";
|
|
6
|
+
export * from "./NavExtrasProvider.js";
|
|
6
7
|
export * from "./GenerateStructuredDataProvider.js";
|
|
7
8
|
export * from "./MantaClientProvider.js";
|
|
8
9
|
export * from "./ShaclFormProvider.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAuB,MAAM,uBAAuB,CAAC;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC,CAAC;AAsCF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAc9C;AAED,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAG1G,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,2CAItE"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAuB,MAAM,uBAAuB,CAAC;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC,CAAC;AAsCF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAc9C;AAED,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAG1G,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,2CAItE"}
|
package/dist/providers/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import { TooltipProvider } from "#components/tooltip/index";
|
|
|
14
14
|
export * from "./ActiveDatastoreProvider.js";
|
|
15
15
|
export * from "./AssistantIconProvider.js";
|
|
16
16
|
export * from "./AssistantNameProvider.js";
|
|
17
|
+
export * from "./NavExtrasProvider.js";
|
|
17
18
|
export * from "./GenerateStructuredDataProvider.js";
|
|
18
19
|
export * from "./MantaClientProvider.js";
|
|
19
20
|
export * from "./ShaclFormProvider.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExplainEmpty.d.ts","sourceRoot":"","sources":["../../../src/routes/explain/ExplainEmpty.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExplainEmpty.d.ts","sourceRoot":"","sources":["../../../src/routes/explain/ExplainEmpty.tsx"],"names":[],"mappings":"AAMA,wBAAgB,YAAY,4CAkB3B"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { newChatPath } from "@manta-eu/client/shared/index";
|
|
2
3
|
import { FileQuestion } from "lucide-react";
|
|
3
4
|
import { Link } from "react-router";
|
|
4
5
|
import { Button } from "#components/button/index";
|
|
5
6
|
import { EmptyState } from "#components/empty-state/index";
|
|
6
7
|
export function ExplainEmpty() {
|
|
7
|
-
return (_jsx(EmptyState, { icon: FileQuestion, title: "Choose a fact to explain", description: "Open this view from a chat explanation or a rule sample fact so the URL includes a subject and object.", className: "h-full max-w-lg", children: _jsxs("div", { className: "flex items-center gap-2 mt-4", children: [_jsx(Button, { asChild: true, variant: "secondary", children: _jsx(Link, { to:
|
|
8
|
+
return (_jsx(EmptyState, { icon: FileQuestion, title: "Choose a fact to explain", description: "Open this view from a chat explanation or a rule sample fact so the URL includes a subject and object.", className: "h-full max-w-lg", children: _jsxs("div", { className: "flex items-center gap-2 mt-4", children: [_jsx(Button, { asChild: true, variant: "secondary", children: _jsx(Link, { to: newChatPath, children: "Back to chat" }) }), _jsx(Button, { asChild: true, variant: "tertiary", children: _jsx(Link, { to: "/rules", children: "View rules" }) })] }) }));
|
|
8
9
|
}
|
|
@@ -2,12 +2,13 @@ import type { GQLIntegration } from "@manta-eu/client";
|
|
|
2
2
|
import type { KeycloakRealm } from "@manta-eu/client/shared/constants";
|
|
3
3
|
import type { HexColor } from "@manta-eu/lib/color";
|
|
4
4
|
import type { ComponentType } from "react";
|
|
5
|
-
import type { ConnectFormProps, InferalConnectFormConfig } from "./components/connect-forms/types.js";
|
|
5
|
+
import type { ConnectFormProps, ImportNotice, InferalConnectFormConfig } from "./components/connect-forms/types.js";
|
|
6
6
|
import type { ConnectionSource, DataConnectorType, ProviderId, ProviderLogoComponent } from "./types.js";
|
|
7
7
|
export type ConnectionCapability = "provisions-stream";
|
|
8
8
|
export type ConnectionMethodBase = {
|
|
9
9
|
capabilities: readonly ConnectionCapability[];
|
|
10
10
|
connectForm?: ComponentType<ConnectFormProps>;
|
|
11
|
+
importNotice?: ImportNotice;
|
|
11
12
|
};
|
|
12
13
|
export type InferalConnectionMethod = ConnectionMethodBase & InferalConnectFormConfig & {
|
|
13
14
|
source: "inferal";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-shape.d.ts","sourceRoot":"","sources":["../../../src/routes/integrations/catalog-shape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog-shape.d.ts","sourceRoot":"","sources":["../../../src/routes/integrations/catalog-shape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACjH,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEtG,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AAEvD,MAAM,MAAM,oBAAoB,GAAG;IACjC,YAAY,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC9C,WAAW,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC9C,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,GACxD,wBAAwB,GAAG;IACzB,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC;AAEJ,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,GAAG;IACzD,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,cAAc,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,eAAe,CAAC,EAAE,aAAa,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,GAAG;IACzD,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,GAAG;IACxD,MAAM,EAAE,iBAAiB,CAAC;IAC1B,aAAa,EAAE,iBAAiB,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAChC,uBAAuB,GACvB,qBAAqB,GACrB,qBAAqB,GACrB,oBAAoB,CAAC;AAEzB,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,GAAG;IACnE,WAAW,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,UAAU,CAAC,EAAE,oBAAoB,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,QAAQ,CAAC;IACrB,IAAI,EAAE,qBAAqB,CAAC;IAC5B,iBAAiB,EAAE,SAAS,wBAAwB,EAAE,CAAC;IACvD,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,0BAA0B,CAAC,EAAE,SAAS,MAAM,GAAG,UAAU,IAAI;IAAE,EAAE,EAAE,EAAE,CAAA;CAAE,GAAG,oBAAoB,CAAC;AAE3G,MAAM,MAAM,2BAA2B,CAAC,EAAE,SAAS,MAAM,GAAG,UAAU,IAAI;IACxE,UAAU,EAAE,EAAE,CAAC;IACf,MAAM,EAAE,2BAA2B,CAAC;CACrC,CAAC;AAEF,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,oBAAoB,EAC3B,MAAM,GAAE,sBAA2B,GAClC,2BAA2B,GAAG,SAAS,CAOzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddIntegrationModal.d.ts","sourceRoot":"","sources":["../../../../src/routes/integrations/components/AddIntegrationModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAEhC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAK7D,MAAM,MAAM,wBAAwB,CAAC,EAAE,SAAS,MAAM,GAAG,UAAU,IAAI;IACrE,OAAO,EAAE,SAAS,0BAA0B,CAAC,EAAE,CAAC,EAAE,CAAC;IACnD,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IAChC,uBAAuB,CAAC,EAAE,gBAAgB,CAAC;IAC3C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,oBAAoB,CAAC;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,MAAM,GAAG,UAAU,EAAE,KAAK,EAAE,wBAAwB,CAAC,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"AddIntegrationModal.d.ts","sourceRoot":"","sources":["../../../../src/routes/integrations/components/AddIntegrationModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAEhC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAK7D,MAAM,MAAM,wBAAwB,CAAC,EAAE,SAAS,MAAM,GAAG,UAAU,IAAI;IACrE,OAAO,EAAE,SAAS,0BAA0B,CAAC,EAAE,CAAC,EAAE,CAAC;IACnD,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IAChC,uBAAuB,CAAC,EAAE,gBAAgB,CAAC;IAC3C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,oBAAoB,CAAC;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,MAAM,GAAG,UAAU,EAAE,KAAK,EAAE,wBAAwB,CAAC,EAAE,CAAC,2CAqFtG"}
|
|
@@ -38,5 +38,5 @@ export function AddIntegrationModal(props) {
|
|
|
38
38
|
}, inferalConfig: selection.method.source === "inferal" ? selection.method : undefined, dataConnectorType: selection.method.source === "data-connection" ? selection.method.connectorType : undefined, onBack: () => {
|
|
39
39
|
setResumeSpent(true);
|
|
40
40
|
setSelection(null);
|
|
41
|
-
}, onChanged: () => onConnected?.(), onDismiss: () => onOpenChange(false), resumedFromOAuth: selectedProviderResumedFromOAuth })) : (_jsx(IntegrationCatalog, { entries: entries, onSelect: setSelection, scrollable: true, requiredCapability: requiredCapability, header: _jsxs(DialogHeader, { children: [_jsx(DialogTitle, { text: title }), _jsx(DialogDescription, { children: description })] }) })) }) }));
|
|
41
|
+
}, onChanged: () => onConnected?.(), onDismiss: () => onOpenChange(false), resumedFromOAuth: selectedProviderResumedFromOAuth, importNotice: selection.method.importNotice })) : (_jsx(IntegrationCatalog, { entries: entries, onSelect: setSelection, scrollable: true, requiredCapability: requiredCapability, header: _jsxs(DialogHeader, { children: [_jsx(DialogTitle, { text: title }), _jsx(DialogDescription, { children: description })] }) })) }) }));
|
|
42
42
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ButtonVariant } from "#components/button/index";
|
|
2
|
+
export type MantaSyncPluginLinkProps = {
|
|
3
|
+
path: string;
|
|
4
|
+
variant: ButtonVariant;
|
|
5
|
+
size?: "sm" | "base";
|
|
6
|
+
};
|
|
7
|
+
export declare function MantaSyncPluginLink(props: MantaSyncPluginLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function MantaSyncPluginRowAction(): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export type MantaSyncPluginStepProps = {
|
|
10
|
+
path: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function MantaSyncPluginStep(props: MantaSyncPluginStepProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=MantaSyncPluginDownload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MantaSyncPluginDownload.d.ts","sourceRoot":"","sources":["../../../../src/routes/integrations/components/MantaSyncPluginDownload.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGpE,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,aAAa,CAAC;IACvB,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CASlE;AAED,wBAAgB,wBAAwB,mDAIvC;AAQD,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAgBlE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
3
|
+
import { Download } from "lucide-react";
|
|
4
|
+
import { Link } from "#components/button/index";
|
|
5
|
+
import { mantaSyncPluginPath } from "#lib/build-config";
|
|
6
|
+
export function MantaSyncPluginLink(props) {
|
|
7
|
+
const { path, variant, size } = props;
|
|
8
|
+
return (_jsxs(Link, { href: path, download: true, variant: variant, size: size, children: [_jsx(Download, { "aria-hidden": true }), "Download plugin"] }));
|
|
9
|
+
}
|
|
10
|
+
export function MantaSyncPluginRowAction() {
|
|
11
|
+
if (!isPresent(mantaSyncPluginPath))
|
|
12
|
+
return null;
|
|
13
|
+
return _jsx(MantaSyncPluginLink, { path: mantaSyncPluginPath, variant: "secondary", size: "sm" });
|
|
14
|
+
}
|
|
15
|
+
const importSteps = [
|
|
16
|
+
"Unzip the download.",
|
|
17
|
+
"In Figma, open Plugins → Development → Import plugin from manifest…",
|
|
18
|
+
"Pick manifest.json from the unzipped folder.",
|
|
19
|
+
];
|
|
20
|
+
export function MantaSyncPluginStep(props) {
|
|
21
|
+
const { path } = props;
|
|
22
|
+
return (_jsxs("div", { className: "flex flex-col items-start gap-4", children: [_jsx(MantaSyncPluginLink, { path: path, variant: "primary" }), _jsx("ol", { className: "grid gap-1.5 list-decimal pl-5", children: importSteps.map((step) => (_jsx("li", { className: "typography-caption text-muted-foreground", children: step }, step))) })] }));
|
|
23
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectFormHeader.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/ConnectFormHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ConnectFormHeader.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/ConnectFormHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAkB9D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import type { ProviderPresentation } from "
|
|
2
|
+
import type { ProviderPresentation } from "../../types.js";
|
|
3
3
|
export type ConnectWizardShellProps = {
|
|
4
4
|
provider: ProviderPresentation<string>;
|
|
5
5
|
status?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectWizardShell.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/ConnectWizardShell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ConnectWizardShell.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/ConnectWizardShell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAKxD,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CA8DhE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ConnectorField } from "./data-connection-fields.js";
|
|
2
|
+
import { type FormOf } from "./DataConnectionFieldInputs.js";
|
|
3
|
+
type ConnectionStringInputProps = {
|
|
4
|
+
form: FormOf;
|
|
5
|
+
connectorType: string;
|
|
6
|
+
allFields: readonly ConnectorField[];
|
|
7
|
+
stepFields: readonly ConnectorField[];
|
|
8
|
+
};
|
|
9
|
+
export declare function ConnectionStringInput(props: ConnectionStringInputProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=ConnectionStringInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionStringInput.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/ConnectionStringInput.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAInE,KAAK,0BAA0B,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;IACrC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAC;CACvC,CAAC;AAIF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,2CA4CtE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { humanList } from "@manta-eu/lib/humanize";
|
|
3
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { connectionStringValues } from "./connection-string-fields.js";
|
|
6
|
+
import { inputId } from "./DataConnectionFieldInputs.js";
|
|
7
|
+
import { Button } from "#components/button/index";
|
|
8
|
+
import { Input } from "#components/input/index";
|
|
9
|
+
export function ConnectionStringInput(props) {
|
|
10
|
+
const { form, connectorType, allFields, stepFields } = props;
|
|
11
|
+
const [text, setText] = useState("");
|
|
12
|
+
const [outcome, setOutcome] = useState();
|
|
13
|
+
function fill(input) {
|
|
14
|
+
const result = connectionStringValues(connectorType, input, allFields);
|
|
15
|
+
if (!result.ok) {
|
|
16
|
+
setOutcome({ error: result.error });
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
setFormValues(form, result.values);
|
|
20
|
+
const message = filledMessage(Object.keys(result.values), stepFields, allFields);
|
|
21
|
+
setOutcome({ message: [message, result.notice].filter(isPresent).join(" ") });
|
|
22
|
+
setText("");
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
function fillOnPaste(event) {
|
|
26
|
+
if (fill(event.clipboardData.getData("text")))
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
}
|
|
29
|
+
return (_jsxs("div", { className: "flex items-end gap-2", children: [_jsx(Input, { id: inputId("connection-string"), containerClassName: "flex-1", label: "Connection string", description: "Paste a connection string to fill the fields. Manta does not store it.", descriptionInLabelTooltip: true, type: "password", autoComplete: "off", value: text, onChange: (event) => setText(event.target.value), onPaste: fillOnPaste, error: outcome && "error" in outcome ? outcome.error : undefined, helperText: outcome && "message" in outcome ? outcome.message : undefined }), _jsx(Button, { variant: "secondary", disabled: !isPresent(text), onClick: () => fill(text), children: "Fill fields" })] }));
|
|
30
|
+
}
|
|
31
|
+
function setFormValues(form, values) {
|
|
32
|
+
for (const [key, value] of Object.entries(values)) {
|
|
33
|
+
form.setValue(key, value, { shouldValidate: true, shouldDirty: true });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function filledMessage(keys, stepFields, allFields) {
|
|
37
|
+
const stepKeys = new Set(stepFields.map((field) => field.key));
|
|
38
|
+
const thisStep = keys.filter((key) => stepKeys.has(key));
|
|
39
|
+
const nextStep = keys.filter((key) => !stepKeys.has(key));
|
|
40
|
+
return [
|
|
41
|
+
isPresent(thisStep) ? `Filled ${fieldTitles(allFields, thisStep)}.` : undefined,
|
|
42
|
+
isPresent(nextStep) ? `Also filled on the next step: ${fieldTitles(allFields, nextStep)}.` : undefined,
|
|
43
|
+
]
|
|
44
|
+
.filter(isPresent)
|
|
45
|
+
.join(" ");
|
|
46
|
+
}
|
|
47
|
+
function fieldTitles(fields, keys) {
|
|
48
|
+
return humanList(fields.filter((field) => keys.includes(field.key)).map((field) => field.title));
|
|
49
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ConnectFormProps } from "./types.js";
|
|
2
|
+
export declare function normalizeSubdomain(value: string): string;
|
|
3
|
+
export declare function isValidSubdomain(value: string): boolean;
|
|
4
|
+
export declare function subdomainError(value: string, connectedSubdomains: ReadonlySet<string>, reconnectableSubdomains?: ReadonlySet<string>): string | undefined;
|
|
5
|
+
export declare function dashStartHref(subdomain: string): string;
|
|
6
|
+
export declare function DashConnectForm(props: ConnectFormProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=DashConnectForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashConnectForm.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/DashConnectForm.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA+ChD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQxD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAAC,EACxC,uBAAuB,GAAE,WAAW,CAAC,MAAM,CAAa,GACvD,MAAM,GAAG,SAAS,CAQpB;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,2CAmDtD"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { GQLIntegration, useDashSetupConnectMutation, useDashSetupProgressQuery, } from "@manta-eu/client";
|
|
3
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
4
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { ConnectWizardShell } from "./ConnectWizardShell.js";
|
|
7
|
+
import { dashFolderTreeItems } from "./dash-folder-tree.js";
|
|
8
|
+
import { OAuthSetupConnectForm } from "./OAuthSetupConnectForm.js";
|
|
9
|
+
import { useConnectedExternalIds, useReconnectableExternalIds } from "./useConnectedExternalIds.js";
|
|
10
|
+
import { Input } from "#components/input/index";
|
|
11
|
+
import { useMantaClient } from "#providers/index";
|
|
12
|
+
const copy = {
|
|
13
|
+
providerName: "Dash",
|
|
14
|
+
identityProviderName: "Dash",
|
|
15
|
+
entitySingular: "folder",
|
|
16
|
+
entityPlural: "folders",
|
|
17
|
+
signInDescription: "We'll take you to Dash so you can grant Manta read access to this account's assets and the folders they live in.",
|
|
18
|
+
pickTitle: "Pick the Dash folders to connect",
|
|
19
|
+
pickDescription: "Manta pulls the assets in the folders you pick, and in every folder inside them.",
|
|
20
|
+
noEntitiesLabel: "We couldn't find any folders in this Dash account. Add folders in Dash, then disconnect Dash and connect it again.",
|
|
21
|
+
noneConnectableLabel: "No folders can be connected in this Dash account. Disconnect Dash and connect it again once it has folders.",
|
|
22
|
+
retryGuidance: "To pick folders, disconnect Dash from your integrations and connect it again.",
|
|
23
|
+
};
|
|
24
|
+
function useDashSetup() {
|
|
25
|
+
const { mantaClient } = useMantaClient();
|
|
26
|
+
const queryClient = useQueryClient();
|
|
27
|
+
const progressQuery = useDashSetupProgressQuery(mantaClient, undefined, { staleTime: 0 });
|
|
28
|
+
const connectMutation = useDashSetupConnectMutation(mantaClient);
|
|
29
|
+
const progress = progressQuery.data?.dashSetupProgress;
|
|
30
|
+
return {
|
|
31
|
+
progress: progress && { state: progress.state, rows: progress.folders, lastError: progress.lastError },
|
|
32
|
+
refetchProgress: progressQuery.refetch,
|
|
33
|
+
resetProgress: () => queryClient.setQueryData(useDashSetupProgressQuery.getKey(), {
|
|
34
|
+
dashSetupProgress: { state: [], folders: null, lastError: null },
|
|
35
|
+
}),
|
|
36
|
+
connect: (folderIds) => connectMutation.mutateAsync({ folderIds }),
|
|
37
|
+
isConnecting: connectMutation.isPending,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
// Mirrors the backend's guard: the subdomain becomes a secret-path segment verbatim.
|
|
41
|
+
const subdomainPattern = /^[a-z0-9][a-z0-9-]*$/i;
|
|
42
|
+
const dashHostSuffix = ".dash.app";
|
|
43
|
+
// People paste the address they see, so accept manta.dash.app (with or without a scheme)
|
|
44
|
+
// and keep only the label. A different domain keeps its dots and fails validation.
|
|
45
|
+
export function normalizeSubdomain(value) {
|
|
46
|
+
const withoutScheme = value
|
|
47
|
+
.trim()
|
|
48
|
+
.toLowerCase()
|
|
49
|
+
.replace(/^[a-z]+:\/\//, "");
|
|
50
|
+
const host = withoutScheme.replace(/\/.*$/, "");
|
|
51
|
+
// Only a real Dash host gives up its path; anything else keeps its slashes and fails validation.
|
|
52
|
+
return host.endsWith(dashHostSuffix) ? host.slice(0, -dashHostSuffix.length) : withoutScheme;
|
|
53
|
+
}
|
|
54
|
+
export function isValidSubdomain(value) {
|
|
55
|
+
return subdomainPattern.test(normalizeSubdomain(value));
|
|
56
|
+
}
|
|
57
|
+
export function subdomainError(value, connectedSubdomains, reconnectableSubdomains = new Set()) {
|
|
58
|
+
if (!isPresent(value.trim()))
|
|
59
|
+
return undefined;
|
|
60
|
+
if (!isValidSubdomain(value))
|
|
61
|
+
return "Letters, numbers and hyphens only.";
|
|
62
|
+
const subdomain = normalizeSubdomain(value);
|
|
63
|
+
if (connectedSubdomains.has(subdomain) && !reconnectableSubdomains.has(subdomain)) {
|
|
64
|
+
return "This Dash account is already connected here. Disconnect it first to connect it again.";
|
|
65
|
+
}
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
export function dashStartHref(subdomain) {
|
|
69
|
+
const params = new URLSearchParams({ subdomain: normalizeSubdomain(subdomain) });
|
|
70
|
+
return `/oauth/dash/start?${params}`;
|
|
71
|
+
}
|
|
72
|
+
export function DashConnectForm(props) {
|
|
73
|
+
const { provider, onBack, resumedFromOAuth = false } = props;
|
|
74
|
+
const [subdomain, setSubdomain] = useState("");
|
|
75
|
+
// Back from Dash sign-in, the subdomain is already bound to the grant.
|
|
76
|
+
const [confirmed, setConfirmed] = useState(resumedFromOAuth);
|
|
77
|
+
const setup = useDashSetup();
|
|
78
|
+
const connectedSubdomains = useConnectedExternalIds(GQLIntegration.Dash);
|
|
79
|
+
const reconnectableSubdomains = useReconnectableExternalIds(GQLIntegration.Dash);
|
|
80
|
+
const error = subdomainError(subdomain, connectedSubdomains, reconnectableSubdomains);
|
|
81
|
+
if (!confirmed) {
|
|
82
|
+
return (_jsx(ConnectWizardShell, { provider: provider, totalSteps: 2, currentStep: 1, stepTitle: "Which Dash account?", stepDescription: "Dash grants access one account at a time, so we need to know which one before sending you over.", onBack: onBack, onContinue: () => setConfirmed(true), continueDisabled: !isValidSubdomain(subdomain) || isPresent(error), children: _jsx(Input, { id: "dash-subdomain", label: "Dash subdomain", placeholder: "acme", autoComplete: "off", value: subdomain, onChange: (event) => setSubdomain(event.target.value), error: error, helperText: "The name in your Dash address \u2014 acme, or paste acme.dash.app." }) }));
|
|
83
|
+
}
|
|
84
|
+
return (_jsx(OAuthSetupConnectForm, { ...props,
|
|
85
|
+
// Once signed in, the subdomain step would refuse the account that was just connected.
|
|
86
|
+
onBack: resumedFromOAuth ? onBack : () => setConfirmed(false), integration: GQLIntegration.Dash, oauthStartPath: dashStartHref(subdomain), copy: copy, setup: setup, treeItems: dashFolderTreeItems, treeOptions: { defaultCollapsed: true, includeDescendants: true }, resumesUnfinishedSetup: false }));
|
|
87
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ProviderPresentation } from "../../types.js";
|
|
2
|
+
import { type ConnectorField, type DataConnectionValues, type StoredDataConnection } from "./data-connection-fields.js";
|
|
3
|
+
import type { ConnectFormProps, StepConfig } from "./types.js";
|
|
4
|
+
export type StoredConnection = StoredDataConnection & {
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
type Step = StepConfig<DataConnectionValues>;
|
|
8
|
+
export declare function createSteps(providerName: string, connectorType: string, fields: readonly ConnectorField[], editing?: boolean): Step[];
|
|
9
|
+
export declare function DataConnectionConnectForm(props: ConnectFormProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export type DataConnectionEditFormProps = {
|
|
11
|
+
provider: ProviderPresentation<string>;
|
|
12
|
+
connectorType: string;
|
|
13
|
+
stored: StoredConnection;
|
|
14
|
+
status: string;
|
|
15
|
+
onChanged: () => void;
|
|
16
|
+
onDismiss: () => void;
|
|
17
|
+
};
|
|
18
|
+
export declare function DataConnectionEditForm(props: DataConnectionEditFormProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=DataConnectionConnectForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataConnectionConnectForm.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/DataConnectionConnectForm.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAIxD,OAAO,EAUL,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAK5D,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAErE,KAAK,IAAI,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;AAuE7C,wBAAgB,WAAW,CACzB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,SAAS,cAAc,EAAE,EACjC,OAAO,UAAQ,GACd,IAAI,EAAE,CAUR;AA4ID,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,gBAAgB,2CAWhE;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,2CAmBxE"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
3
|
+
import { useCreateDataConnectionMutation, useDataConnectorTypesQuery, useUpdateDataConnectionMutation, } from "@manta-eu/client";
|
|
4
|
+
import { parseError } from "@manta-eu/client/shared/error-utils";
|
|
5
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
6
|
+
import { Fragment, useMemo, useState } from "react";
|
|
7
|
+
import { useForm } from "react-hook-form";
|
|
8
|
+
import { toast } from "sonner";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { acceptsConnectionString } from "./connection-string-fields.js";
|
|
11
|
+
import { ConnectionStringInput } from "./ConnectionStringInput.js";
|
|
12
|
+
import { ConnectWizardShell } from "./ConnectWizardShell.js";
|
|
13
|
+
import { blankValues, changedSettings, editableFields, formSchema, nameKey, nameSchema, pickSettings, settingsSchema, storedValues, } from "./data-connection-fields.js";
|
|
14
|
+
import { inputId, renderFields, renderOptionalFields } from "./DataConnectionFieldInputs.js";
|
|
15
|
+
import { ImportStartedStep } from "./ImportStartedNotice.js";
|
|
16
|
+
import { useConnectWizard } from "./useConnectWizard.js";
|
|
17
|
+
import { Input } from "#components/input/index";
|
|
18
|
+
import { useMantaClient } from "#providers/index";
|
|
19
|
+
function nameStep(providerName) {
|
|
20
|
+
return {
|
|
21
|
+
id: "name",
|
|
22
|
+
title: "Name this connection",
|
|
23
|
+
description: `Used to identify this ${providerName} database in Manta.`,
|
|
24
|
+
schema: z.object({ [nameKey]: nameSchema }),
|
|
25
|
+
continueLabel: "Continue",
|
|
26
|
+
render: (form) => (_jsx(Input, { id: inputId(nameKey), label: "Name", placeholder: "Warehouse", autoComplete: "off", error: form.formState.errors[nameKey]?.message?.toString(), ...form.register(nameKey) })),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function connectionStep(args) {
|
|
30
|
+
const { providerName, connectorType, stepFields, allFields, editing } = args;
|
|
31
|
+
return {
|
|
32
|
+
id: "connection",
|
|
33
|
+
title: "Enter the connection details",
|
|
34
|
+
description: editing
|
|
35
|
+
? "Manta tests new settings before it uses them. Until then, the stored settings keep syncing."
|
|
36
|
+
: `Manta tests the connection before it syncs the ${providerName} tables.`,
|
|
37
|
+
schema: settingsSchema(stepFields),
|
|
38
|
+
continueLabel: "Continue",
|
|
39
|
+
render: (form) => (_jsxs("div", { className: "grid gap-4", children: [acceptsConnectionString(connectorType) && (_jsx(ConnectionStringInput, { form: form, connectorType: connectorType, allFields: allFields, stepFields: stepFields })), renderFields(form, stepFields, editing)] })),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function optionalStep(fields, editing) {
|
|
43
|
+
return {
|
|
44
|
+
id: "optional",
|
|
45
|
+
title: "Optional settings",
|
|
46
|
+
description: editing ? "Leave a secret blank to keep its stored value." : "Leave a field blank to use its default.",
|
|
47
|
+
schema: settingsSchema(fields),
|
|
48
|
+
continueLabel: "Continue",
|
|
49
|
+
render: (form) => renderOptionalFields(form, fields, editing),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function withSubmitLabel(steps, label) {
|
|
53
|
+
return steps.map((step, index) => (index === steps.length - 1 ? { ...step, continueLabel: label } : step));
|
|
54
|
+
}
|
|
55
|
+
export function createSteps(providerName, connectorType, fields, editing = false) {
|
|
56
|
+
const required = fields.filter((field) => field.required);
|
|
57
|
+
const optional = fields.filter((field) => !field.required);
|
|
58
|
+
const steps = [
|
|
59
|
+
nameStep(providerName),
|
|
60
|
+
connectionStep({ providerName, connectorType, stepFields: required, allFields: fields, editing }),
|
|
61
|
+
...(isPresent(optional) ? [optionalStep(optional, editing)] : []),
|
|
62
|
+
];
|
|
63
|
+
return withSubmitLabel(steps, editing ? "Save" : "Connect");
|
|
64
|
+
}
|
|
65
|
+
function DataConnectionWizard(props) {
|
|
66
|
+
const { provider, connectorType, fields, stored, status, onBack, onChanged, onDismiss, importNotice } = props;
|
|
67
|
+
const editing = stored !== undefined;
|
|
68
|
+
const showsImportNotice = !editing && importNotice !== undefined;
|
|
69
|
+
const [created, setCreated] = useState(false);
|
|
70
|
+
const formFields = useMemo(() => (editing ? editableFields(fields) : fields), [editing, fields]);
|
|
71
|
+
const steps = useMemo(() => createSteps(provider.name, connectorType, formFields, editing), [provider.name, connectorType, formFields, editing]);
|
|
72
|
+
const fullSchema = useMemo(() => formSchema(formFields), [formFields]);
|
|
73
|
+
const { mantaClient } = useMantaClient();
|
|
74
|
+
const createMutation = useCreateDataConnectionMutation(mantaClient);
|
|
75
|
+
const updateMutation = useUpdateDataConnectionMutation(mantaClient);
|
|
76
|
+
const form = useForm({
|
|
77
|
+
resolver: zodResolver(fullSchema),
|
|
78
|
+
defaultValues: stored ? storedValues(stored, fields) : blankValues(fields),
|
|
79
|
+
mode: "onChange",
|
|
80
|
+
});
|
|
81
|
+
async function create(values) {
|
|
82
|
+
await createMutation.mutateAsync({
|
|
83
|
+
input: { name: values[nameKey], connectorType, settings: pickSettings(values, fields) },
|
|
84
|
+
});
|
|
85
|
+
toast.success(`${provider.name} added`, { description: "Manta is testing the connection." });
|
|
86
|
+
}
|
|
87
|
+
async function update(values, connection) {
|
|
88
|
+
const changed = changedSettings(values, fields, connection);
|
|
89
|
+
await updateMutation.mutateAsync({
|
|
90
|
+
input: { id: connection.id, name: values[nameKey], settings: isPresent(changed) ? changed : undefined },
|
|
91
|
+
});
|
|
92
|
+
toast.success(`${provider.name} saved`, {
|
|
93
|
+
description: isPresent(changed) ? "Manta is testing the new settings." : undefined,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
async function onValid(values) {
|
|
97
|
+
try {
|
|
98
|
+
await (stored ? update(values, stored) : create(values));
|
|
99
|
+
onChanged();
|
|
100
|
+
if (showsImportNotice)
|
|
101
|
+
setCreated(true);
|
|
102
|
+
else
|
|
103
|
+
onDismiss();
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
const info = parseError(err, `Failed to save ${provider.name}`);
|
|
107
|
+
toast.error(info.message, { description: info.description });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const { stepIndex, currentStep, canAdvance, handleContinue, handleBack } = useConnectWizard({
|
|
111
|
+
steps,
|
|
112
|
+
form,
|
|
113
|
+
fullSchema,
|
|
114
|
+
onSubmit: onValid,
|
|
115
|
+
onBack,
|
|
116
|
+
});
|
|
117
|
+
if (created && importNotice) {
|
|
118
|
+
return (_jsx(ImportStartedStep, { provider: provider, notice: importNotice, status: "Testing", title: `Testing your ${provider.name} connection`, totalSteps: steps.length + 1, onDone: onDismiss }));
|
|
119
|
+
}
|
|
120
|
+
return (_jsx(ConnectWizardShell, { provider: provider, status: status, totalSteps: showsImportNotice ? steps.length + 1 : steps.length, currentStep: stepIndex + 1, stepTitle: currentStep.title, stepDescription: currentStep.description, onBack: handleBack, onContinue: handleContinue, continueLabel: currentStep.continueLabel, continueDisabled: !canAdvance, isSubmitting: createMutation.isPending || updateMutation.isPending, children: _jsx(Fragment, { children: currentStep.render(form) }, currentStep.id) }));
|
|
121
|
+
}
|
|
122
|
+
function ConnectorLoader(props) {
|
|
123
|
+
const { provider, connectorType, onBack, children } = props;
|
|
124
|
+
const { mantaClient } = useMantaClient();
|
|
125
|
+
const { data, error, isLoading } = useDataConnectorTypesQuery(mantaClient);
|
|
126
|
+
const connector = data?.dataConnectorTypes.find((type) => type.connectorType === connectorType);
|
|
127
|
+
if (connector)
|
|
128
|
+
return children(connector.fields);
|
|
129
|
+
const message = isLoading
|
|
130
|
+
? "Loading the connection settings…"
|
|
131
|
+
: parseError(error, `Manta does not support ${provider.name} connections here.`).message;
|
|
132
|
+
return (_jsx(ConnectWizardShell, { provider: provider, totalSteps: 1, currentStep: 1, stepTitle: provider.name, onBack: onBack, continueLabel: "Continue", continueDisabled: true, children: _jsx("p", { role: "status", "aria-live": "polite", className: "typography-caption text-muted-foreground", children: message }) }));
|
|
133
|
+
}
|
|
134
|
+
export function DataConnectionConnectForm(props) {
|
|
135
|
+
const { provider, dataConnectorType, onBack } = props;
|
|
136
|
+
if (!dataConnectorType) {
|
|
137
|
+
throw new Error(`${provider.name} is missing its data connector type`);
|
|
138
|
+
}
|
|
139
|
+
return (_jsx(ConnectorLoader, { provider: provider, connectorType: dataConnectorType, onBack: onBack, children: (fields) => _jsx(DataConnectionWizard, { ...props, connectorType: dataConnectorType, fields: fields }) }));
|
|
140
|
+
}
|
|
141
|
+
export function DataConnectionEditForm(props) {
|
|
142
|
+
const { provider, connectorType, stored, status, onChanged, onDismiss } = props;
|
|
143
|
+
return (_jsx(ConnectorLoader, { provider: provider, connectorType: connectorType, onBack: onDismiss, children: (fields) => (_jsx(DataConnectionWizard, { provider: provider, connectorType: connectorType, fields: fields, stored: stored, status: status, onBack: onDismiss, onChanged: onChanged, onDismiss: onDismiss })) }));
|
|
144
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type UseFormReturn } from "react-hook-form";
|
|
2
|
+
import { type ConnectorField, type DataConnectionValues } from "./data-connection-fields.js";
|
|
3
|
+
export type FormOf = UseFormReturn<DataConnectionValues>;
|
|
4
|
+
export declare function inputId(key: string): string;
|
|
5
|
+
export declare function choiceToValue(choice: string): string;
|
|
6
|
+
export declare function renderFields(form: FormOf, fields: readonly ConnectorField[], editing: boolean): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function renderOptionalFields(form: FormOf, fields: readonly ConnectorField[], editing: boolean): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=DataConnectionFieldInputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataConnectionFieldInputs.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/DataConnectionFieldInputs.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAMlC,MAAM,MAAM,MAAM,GAAG,aAAa,CAAC,oBAAoB,CAAC,CAAC;AAIzD,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3C;AAKD,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD;AAwDD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,cAAc,EAAE,EAAE,OAAO,EAAE,OAAO,2CAE7F;AAwBD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,cAAc,EAAE,EAAE,OAAO,EAAE,OAAO,2CAUrG"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
3
|
+
import { ChevronRight } from "lucide-react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { Controller } from "react-hook-form";
|
|
6
|
+
import { choices, hasCustomValue, isCloudSqlField, } from "./data-connection-fields.js";
|
|
7
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "#components/collapsible/index";
|
|
8
|
+
import { Input } from "#components/input/index";
|
|
9
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "#components/select/index";
|
|
10
|
+
import { cn } from "#lib/utils";
|
|
11
|
+
const keepSecretHint = "Leave blank to keep the stored value";
|
|
12
|
+
export function inputId(key) {
|
|
13
|
+
return `data-connection-${key}`;
|
|
14
|
+
}
|
|
15
|
+
// Radix Select refuses an empty item value, so this marker stands for the blank that keeps the connector default.
|
|
16
|
+
const defaultChoice = "__connector-default__";
|
|
17
|
+
export function choiceToValue(choice) {
|
|
18
|
+
return choice === defaultChoice ? "" : choice;
|
|
19
|
+
}
|
|
20
|
+
function defaultChoiceLabel(field) {
|
|
21
|
+
return isPresent(field.default) ? `Default (${field.default})` : "Default";
|
|
22
|
+
}
|
|
23
|
+
function renderChoiceField(form, field, options) {
|
|
24
|
+
return (_jsx(Controller, { control: form.control, name: field.key, render: ({ field: control, fieldState }) => (_jsxs(Select, { value: control.value ?? "", onValueChange: (choice) => control.onChange(choiceToValue(choice)), children: [_jsx(SelectTrigger, { label: field.title, id: inputId(field.key), className: "w-full h-10", error: fieldState.error?.message, children: _jsx(SelectValue, { placeholder: field.required ? "Select a value" : defaultChoiceLabel(field) }) }), _jsxs(SelectContent, { children: [!field.required && _jsx(SelectItem, { value: defaultChoice, children: defaultChoiceLabel(field) }), options.map((option) => (_jsx(SelectItem, { value: option, children: option }, option)))] })] })) }, field.key));
|
|
25
|
+
}
|
|
26
|
+
function renderField(form, field, editing) {
|
|
27
|
+
const options = choices(field);
|
|
28
|
+
if (options)
|
|
29
|
+
return renderChoiceField(form, field, options);
|
|
30
|
+
return (_jsx(Input, { id: inputId(field.key), label: field.title, description: field.description ?? undefined, descriptionInLabelTooltip: true, type: field.secret ? "password" : undefined, placeholder: editing && field.secret ? keepSecretHint : (field.default ?? undefined), autoComplete: "off", error: form.formState.errors[field.key]?.message?.toString(), ...form.register(field.key) }, field.key));
|
|
31
|
+
}
|
|
32
|
+
export function renderFields(form, fields, editing) {
|
|
33
|
+
return _jsx("div", { className: "grid gap-3", children: fields.map((field) => renderField(form, field, editing)) });
|
|
34
|
+
}
|
|
35
|
+
function CloudSqlSettings(props) {
|
|
36
|
+
const { form, fields, editing } = props;
|
|
37
|
+
const [open, setOpen] = useState(() => hasCustomValue(form.getValues(), fields));
|
|
38
|
+
return (_jsxs(Collapsible, { open: open, onOpenChange: setOpen, className: "grid gap-3", children: [_jsxs(CollapsibleTrigger, { className: "flex items-center gap-2 typography-body text-default-foreground", children: [_jsx(ChevronRight, { "aria-hidden": true, className: cn("size-4 transition-transform", open && "rotate-90") }), "Google Cloud SQL", _jsx("span", { className: "typography-caption text-muted-foreground", children: "Only for a database in Google Cloud SQL" })] }), _jsx(CollapsibleContent, { children: renderFields(form, fields, editing) })] }));
|
|
39
|
+
}
|
|
40
|
+
export function renderOptionalFields(form, fields, editing) {
|
|
41
|
+
const cloudSql = fields.filter(isCloudSqlField);
|
|
42
|
+
const plain = fields.filter((field) => !isCloudSqlField(field));
|
|
43
|
+
return (_jsxs("div", { className: "grid gap-4", children: [renderFields(form, plain, editing), isPresent(cloudSql) && _jsx(CloudSqlSettings, { form: form, fields: cloudSql, editing: editing })] }));
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FigmaConnectForm.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/FigmaConnectForm.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAShD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,2CAyBvD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { GQLIntegration } from "@manta-eu/client";
|
|
3
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
4
|
+
import { MantaSyncPluginStep } from "../MantaSyncPluginDownload.js";
|
|
5
|
+
import { OAuthSingleAccountConnectForm } from "./OAuthSingleAccountConnectForm.js";
|
|
6
|
+
import { mantaSyncPluginPath } from "#lib/build-config";
|
|
7
|
+
const figmaPermissions = [
|
|
8
|
+
"Read the contents of the files you grant access to.",
|
|
9
|
+
"Read comments on those files.",
|
|
10
|
+
"Post comments back on those files.",
|
|
11
|
+
];
|
|
12
|
+
export function FigmaConnectForm(props) {
|
|
13
|
+
return (_jsx(OAuthSingleAccountConnectForm, { ...props, integration: GQLIntegration.Figma, startHref: "/oauth/figma/start", ctaLabel: "Continue with Figma", stepTitle: "Connect your Figma account", stepDescription: "Manta will take you to Figma to ask for permission, then bring you back here.", supportingInfo: "You'll be taken to Figma to approve access. You can revoke it any time from your Figma account settings.", permissions: figmaPermissions, waitingLabel: "Waiting for you to finish connecting to Figma\u2026", connectedToastLabel: "Figma connected", successStep: isPresent(mantaSyncPluginPath)
|
|
14
|
+
? {
|
|
15
|
+
title: "Install the Manta Sync plugin",
|
|
16
|
+
description: "Manta Sync brings campaign plans onto your canvas, with the reasoning behind each change attached.",
|
|
17
|
+
content: _jsx(MantaSyncPluginStep, { path: mantaSyncPluginPath }),
|
|
18
|
+
}
|
|
19
|
+
: undefined }));
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GmailConnectForm.d.ts","sourceRoot":"","sources":["../../../../../src/routes/integrations/components/connect-forms/GmailConnectForm.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,2CAuBvD"}
|