@burdenoff/microfe-integrations 2026.929.3 → 2026.930.2
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/generated/wspace-operations.d.ts +0 -137
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +73 -142
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/index.js +4 -3
- package/dist/integrations/ConnectSourceDialog.d.ts +21 -0
- package/dist/integrations/ConnectSourceDialog.d.ts.map +1 -0
- package/dist/integrations/ConnectSourceDialog.js +56 -0
- package/dist/integrations/ConnectSourceDialog.js.map +1 -0
- package/dist/integrations/ConnectionsPanel.d.ts.map +1 -1
- package/dist/integrations/ConnectionsPanel.js.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.d.ts +22 -11
- package/dist/integrations/components/AddConnectionDialog.d.ts.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.js +54 -602
- package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
- package/dist/integrations/components/AuthMethodsEditor.d.ts.map +1 -1
- package/dist/integrations/components/AuthMethodsEditor.js +69 -68
- package/dist/integrations/components/AuthMethodsEditor.js.map +1 -1
- package/dist/integrations/components/ConnectionCard.js +28 -28
- package/dist/integrations/components/ConnectionCard.js.map +1 -1
- package/dist/integrations/components/ConnectionModalFrame.d.ts +38 -0
- package/dist/integrations/components/ConnectionModalFrame.d.ts.map +1 -0
- package/dist/integrations/components/ConnectionModalFrame.js +64 -0
- package/dist/integrations/components/ConnectionModalFrame.js.map +1 -0
- package/dist/integrations/components/ProviderCard.js +29 -29
- package/dist/integrations/components/ProviderCard.js.map +1 -1
- package/dist/integrations/hooks/useConnections.js +91 -102
- package/dist/integrations/hooks/useConnections.js.map +1 -1
- package/dist/integrations/hooks/useLogs.js +4 -4
- package/dist/integrations/hooks/useProviders.js +36 -36
- package/dist/integrations/index.d.ts +2 -0
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +1 -0
- package/dist/integrations/pages/AddConnectionWizard.d.ts.map +1 -1
- package/dist/integrations/pages/AddConnectionWizard.js +281 -277
- package/dist/integrations/pages/AddConnectionWizard.js.map +1 -1
- package/dist/integrations/pages/ConnectionDetail.js +24 -24
- package/dist/integrations/pages/ConnectionDetail.js.map +1 -1
- package/dist/integrations/pages/ConnectionsList.js +7 -7
- package/dist/integrations/pages/ConnectionsList.js.map +1 -1
- package/dist/integrations/pages/IntegrationsOverview.js +34 -34
- package/dist/integrations/pages/ProviderCatalog.js +4 -4
- package/dist/integrations/pages/ProviderDetail.js +110 -110
- package/dist/integrations/pages/ProviderDetail.js.map +1 -1
- package/dist/integrations/translations/en.d.ts +21 -0
- package/dist/integrations/translations/en.d.ts.map +1 -1
- package/dist/integrations/utils/appearance.d.ts +0 -3
- package/dist/integrations/utils/appearance.d.ts.map +1 -1
- package/dist/integrations/utils/appearance.js +1 -20
- package/dist/integrations/utils/appearance.js.map +1 -1
- package/dist/integrations/utils/integrationsHelpers.js +1 -4
- package/dist/integrations/utils/integrationsHelpers.js.map +1 -1
- package/package.json +5 -3
- package/dist/integrations/assets/brands/bigconsole.js +0 -6
- package/dist/integrations/assets/brands/bigconsole.js.map +0 -1
- package/dist/integrations/assets/brands/burdenoff.js +0 -6
- package/dist/integrations/assets/brands/burdenoff.js.map +0 -1
- package/dist/integrations/components/AuthMethodSelector.d.ts +0 -30
- package/dist/integrations/components/AuthMethodSelector.d.ts.map +0 -1
- package/dist/integrations/components/AuthMethodSelector.js +0 -66
- package/dist/integrations/components/AuthMethodSelector.js.map +0 -1
- package/dist/integrations/components/CredentialStorageSelector.d.ts +0 -16
- package/dist/integrations/components/CredentialStorageSelector.d.ts.map +0 -1
- package/dist/integrations/components/CredentialStorageSelector.js +0 -262
- package/dist/integrations/components/CredentialStorageSelector.js.map +0 -1
- package/dist/integrations/components/ProviderIcon.d.ts +0 -25
- package/dist/integrations/components/ProviderIcon.d.ts.map +0 -1
- package/dist/integrations/components/ProviderIcon.js +0 -166
- package/dist/integrations/components/ProviderIcon.js.map +0 -1
- package/dist/integrations/components/SchemaForm.d.ts +0 -60
- package/dist/integrations/components/SchemaForm.d.ts.map +0 -1
- package/dist/integrations/components/SchemaForm.js +0 -235
- package/dist/integrations/components/SchemaForm.js.map +0 -1
- package/dist/integrations/hooks/useCredentialVaults.d.ts +0 -40
- package/dist/integrations/hooks/useCredentialVaults.d.ts.map +0 -1
- package/dist/integrations/hooks/useCredentialVaults.js +0 -98
- package/dist/integrations/hooks/useCredentialVaults.js.map +0 -1
- package/dist/integrations/utils/oauthPopup.d.ts +0 -16
- package/dist/integrations/utils/oauthPopup.d.ts.map +0 -1
- package/dist/integrations/utils/oauthPopup.js +0 -62
- package/dist/integrations/utils/oauthPopup.js.map +0 -1
- package/dist/node_modules/@iconify/react/dist/iconify.js +0 -1005
- package/dist/node_modules/@iconify/react/dist/iconify.js.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ConnectionsPanelProps } from './ConnectionsPanel';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The base props hosts already pass `ConnectionsPanel` / `IntegrationsRoot`
|
|
6
|
+
* (`basePath`, `navigate`, `workspaceId`, tokens, ...), plus the open state in
|
|
7
|
+
* the same `open` / `onOpenChange` shape as the dialog it replaces.
|
|
8
|
+
*
|
|
9
|
+
* ★ Pass `basePath` as the routed mount does. Without it `IntegrationsProvider`
|
|
10
|
+
* runs standalone and creates its own router, which throws inside a host router.
|
|
11
|
+
*/
|
|
12
|
+
export type ConnectSourceDialogProps = ConnectionsPanelProps & {
|
|
13
|
+
/** Whether the dialog is showing. It renders nothing while closed. */
|
|
14
|
+
open: boolean;
|
|
15
|
+
/** Called with `false` when the user closes it (X, Cancel, Escape, backdrop). */
|
|
16
|
+
onOpenChange: (open: boolean) => void;
|
|
17
|
+
/** Called with the new connection's id once it is created and authenticated. */
|
|
18
|
+
onConnectionCreated?: (connectionId: string) => void;
|
|
19
|
+
};
|
|
20
|
+
export declare const ConnectSourceDialog: FC<ConnectSourceDialogProps>;
|
|
21
|
+
//# sourceMappingURL=ConnectSourceDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectSourceDialog.d.ts","sourceRoot":"","sources":["../../src/integrations/ConnectSourceDialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAe,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAM7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,MAAM,wBAAwB,GAAG,qBAAqB,GAAG;IAC7D,sEAAsE;IACtE,IAAI,EAAE,OAAO,CAAC;IACd,iFAAiF;IACjF,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,gFAAgF;IAChF,mBAAmB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD,CAAC;AAoCF,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CA0B5D,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { IntegrationsProvider as e } from "./providers/IntegrationsProvider.js";
|
|
2
|
+
import { useTr as t } from "./hooks/useTr.js";
|
|
3
|
+
import { AddConnectionDialog as n } from "./components/AddConnectionDialog.js";
|
|
4
|
+
import { ConnectionModalFrame as r } from "./components/ConnectionModalFrame.js";
|
|
5
|
+
import { useCallback as i } from "react";
|
|
6
|
+
import { ErrorBoundary as a } from "@burdenoff/fe-libs/shared/components";
|
|
7
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
+
//#region src/integrations/ConnectSourceDialog.tsx
|
|
9
|
+
var c = "connect-source-error-title";
|
|
10
|
+
function l({ onClose: e }) {
|
|
11
|
+
let n = t();
|
|
12
|
+
return /* @__PURE__ */ s(r, {
|
|
13
|
+
onClose: e,
|
|
14
|
+
labelledBy: c,
|
|
15
|
+
presentation: "sheet",
|
|
16
|
+
size: "notice",
|
|
17
|
+
testId: "connect-source-error",
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ o("h2", {
|
|
20
|
+
id: c,
|
|
21
|
+
className: "text-lg font-semibold text-text-primary",
|
|
22
|
+
children: n("integrations.errorBoundary.title", "Something went wrong loading this module.")
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ o("p", {
|
|
25
|
+
className: "text-sm text-text-secondary",
|
|
26
|
+
children: n("integrations.errorBoundary.refresh", "Please refresh the page.")
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ o("button", {
|
|
29
|
+
type: "button",
|
|
30
|
+
onClick: e,
|
|
31
|
+
className: "px-4 py-2 text-sm font-medium rounded-md border border-border-subtle hover:bg-accent transition-colors",
|
|
32
|
+
children: n("integrations.common.close", "Close")
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
var u = ({ open: r, onOpenChange: s, onConnectionCreated: c, ...u }) => {
|
|
38
|
+
let d = t(), f = i(() => s(!1), [s]);
|
|
39
|
+
return r ? /* @__PURE__ */ o(a, {
|
|
40
|
+
fallback: /* @__PURE__ */ o(l, { onClose: f }),
|
|
41
|
+
children: /* @__PURE__ */ o(e, {
|
|
42
|
+
...u,
|
|
43
|
+
children: /* @__PURE__ */ o(n, {
|
|
44
|
+
open: !0,
|
|
45
|
+
onClose: f,
|
|
46
|
+
presentation: "sheet",
|
|
47
|
+
pickerTitle: d("integrations.connectSource.title", "Connect a source"),
|
|
48
|
+
onConnectionCreated: c
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
}) : null;
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
54
|
+
export { u as ConnectSourceDialog };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=ConnectSourceDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectSourceDialog.js","names":[],"sources":["../../src/integrations/ConnectSourceDialog.tsx"],"sourcesContent":["/**\n * ConnectSourceDialog: \"Connect a source\" over whatever page the user is on.\n *\n * ★★ WHY (BOFF-8158). The assistant's attach menu offers \"Connect a source\".\n * Two hosts navigated to `/integrations/connections`, where the assistant panel\n * then covered the page's \"Add Connection\" button. The other two put the whole\n * Connections PAGE (`ConnectionsPanel`) into a 512 px Radix dialog, so \"Add\n * Connection\" opened a second dialog nested in the first, laid out against the\n * host's transformed box, with the form 0 px wide on phones.\n *\n * This is ONE modal: centred on desktop, a bottom sheet below `md`. It opens\n * straight on the provider picker, then the credential form, then Connect in an\n * always-visible footer. The content is `AddConnectionDialog`'s own, so it is\n * the same connection screen every product already uses, not a second one.\n *\n * ★ It never navigates. There is no `<Routes>` in here (an `IntegrationsRoot`\n * inside a dialog would match the host's URL and fall through to its\n * `<Navigate>`), and nothing calls `navigate` when it opens.\n *\n * ★ Hosts render THIS as the modal. Do not wrap it in another dialog: it\n * portals to `document.body`, and a host modal's focus trap would fight it.\n *\n * @example\n * ```tsx\n * const [open, setOpen] = useState(false);\n * useEffect(() => {\n * const onConnect = () => setOpen(true);\n * window.addEventListener(CONNECT_SOURCE_EVENT, onConnect);\n * return () => window.removeEventListener(CONNECT_SOURCE_EVENT, onConnect);\n * }, []);\n *\n * <ConnectSourceDialog\n * open={open}\n * onOpenChange={setOpen}\n * basePath=\"/integrations\"\n * {...protectedWorkspaceBaseProps}\n * navigate={navigate}\n * />\n * ```\n */\nimport { useCallback, type FC } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { IntegrationsProvider } from './providers/IntegrationsProvider';\nimport { AddConnectionDialog } from './components/AddConnectionDialog';\nimport { ConnectionModalFrame } from './components/ConnectionModalFrame';\nimport { useTr } from './hooks/useTr';\nimport type { ConnectionsPanelProps } from './ConnectionsPanel';\n\n/**\n * The base props hosts already pass `ConnectionsPanel` / `IntegrationsRoot`\n * (`basePath`, `navigate`, `workspaceId`, tokens, ...), plus the open state in\n * the same `open` / `onOpenChange` shape as the dialog it replaces.\n *\n * ★ Pass `basePath` as the routed mount does. Without it `IntegrationsProvider`\n * runs standalone and creates its own router, which throws inside a host router.\n */\nexport type ConnectSourceDialogProps = ConnectionsPanelProps & {\n /** Whether the dialog is showing. It renders nothing while closed. */\n open: boolean;\n /** Called with `false` when the user closes it (X, Cancel, Escape, backdrop). */\n onOpenChange: (open: boolean) => void;\n /** Called with the new connection's id once it is created and authenticated. */\n onConnectionCreated?: (connectionId: string) => void;\n};\n\nconst FALLBACK_TITLE_ID = 'connect-source-error-title';\n\n/**\n * Shown if the connection screen throws. Rendered inside the same frame so the\n * failure stays a dismissible modal instead of text dropped into the host page\n * wherever the dialog is mounted.\n */\nfunction ConnectSourceErrorFallback({ onClose }: { onClose: () => void }) {\n const tr = useTr();\n return (\n <ConnectionModalFrame\n onClose={onClose}\n labelledBy={FALLBACK_TITLE_ID}\n presentation=\"sheet\"\n size=\"notice\"\n testId=\"connect-source-error\"\n >\n <h2 id={FALLBACK_TITLE_ID} className=\"text-lg font-semibold text-text-primary\">\n {tr('integrations.errorBoundary.title', 'Something went wrong loading this module.')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {tr('integrations.errorBoundary.refresh', 'Please refresh the page.')}\n </p>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"px-4 py-2 text-sm font-medium rounded-md border border-border-subtle hover:bg-accent transition-colors\"\n >\n {tr('integrations.common.close', 'Close')}\n </button>\n </ConnectionModalFrame>\n );\n}\n\nexport const ConnectSourceDialog: FC<ConnectSourceDialogProps> = ({\n open,\n onOpenChange,\n onConnectionCreated,\n ...integrationsProps\n}) => {\n const tr = useTr();\n const close = useCallback(() => onOpenChange(false), [onOpenChange]);\n\n // Unmounted while closed: nothing is fetched until the user asks, and every\n // open starts fresh on the picker (and with a reset error boundary).\n if (!open) return null;\n\n return (\n <ErrorBoundary fallback={<ConnectSourceErrorFallback onClose={close} />}>\n <IntegrationsProvider {...integrationsProps}>\n <AddConnectionDialog\n open\n onClose={close}\n presentation=\"sheet\"\n pickerTitle={tr('integrations.connectSource.title', 'Connect a source')}\n onConnectionCreated={onConnectionCreated}\n />\n </IntegrationsProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;AAiEA,IAAM,IAAoB;AAO1B,SAAS,EAA2B,EAAE,cAAoC;CACxE,IAAM,IAAK,GAAO;AAClB,QACE,kBAAC,GAAD;EACW;EACT,YAAY;EACZ,cAAa;EACb,MAAK;EACL,QAAO;YALT;GAOE,kBAAC,MAAD;IAAI,IAAI;IAAmB,WAAU;cAClC,EAAG,oCAAoC,4CAA4C;IACjF,CAAA;GACL,kBAAC,KAAD;IAAG,WAAU;cACV,EAAG,sCAAsC,2BAA2B;IACnE,CAAA;GACJ,kBAAC,UAAD;IACE,MAAK;IACL,SAAS;IACT,WAAU;cAET,EAAG,6BAA6B,QAAQ;IAClC,CAAA;GACY;;;AAI3B,IAAa,KAAqD,EAChE,SACA,iBACA,wBACA,GAAG,QACC;CACJ,IAAM,IAAK,GAAO,EACZ,IAAQ,QAAkB,EAAa,GAAM,EAAE,CAAC,EAAa,CAAC;AAMpE,QAFK,IAGH,kBAAC,GAAD;EAAe,UAAU,kBAAC,GAAD,EAA4B,SAAS,GAAS,CAAA;YACrE,kBAAC,GAAD;GAAsB,GAAI;aACxB,kBAAC,GAAD;IACE,MAAA;IACA,SAAS;IACT,cAAa;IACb,aAAa,EAAG,oCAAoC,mBAAmB;IAClD;IACrB,CAAA;GACmB,CAAA;EACT,CAAA,GAbA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionsPanel.d.ts","sourceRoot":"","sources":["../../src/integrations/ConnectionsPanel.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ConnectionsPanel.d.ts","sourceRoot":"","sources":["../../src/integrations/ConnectionsPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAE1D,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAuBtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionsPanel.js","names":[],"sources":["../../src/integrations/ConnectionsPanel.tsx"],"sourcesContent":["/**\n * The connections screen, without the router.\n *\n * ★★ WHY THIS EXISTS AND `IntegrationsRoot` COULD NOT BE USED. The assistant's\n * attach menu offers \"Connect a source\", and it was reported that it \"opens the\n * page but I need a popup in the centre\" — navigating away tears the user out\n * of the conversation they were having. A host wants to render the connections\n * screen inside a dialog, over whatever page the user is on.\n *\n * `IntegrationsRoot` cannot do that. It renders `IntegrationsUserRoutes`, whose\n * `<Routes>` matches against the CURRENT URL. Mounted in a dialog while the\n * user sits at `/dashboard`, the inner routes match none of their paths and\n * fall through to `<Route path=\"*\" element={<Navigate to=\"\" replace />} />` —\n * so opening the dialog would navigate the host app. Wrapping it in a\n * `MemoryRouter` is not an escape either: react-router still asserts\n * `You cannot render a <Router> inside another <Router>`, so it throws.\n *\n * ★ `ConnectionsList` itself needs no router. It takes `navigate` from\n * `IntegrationsProvider` — a plain callback the host supplies — so it works\n * anywhere its providers are mounted. This composes exactly the provider stack\n * `IntegrationsRoot` does, minus the routes and minus the shell nav/footer\n * registration, which a dialog has no business performing.\n *\n * ★ The SAME screen, not a second implementation. Products reuse this rather\n * than growing their own connection management, which is the thing this module\n * exists to own.\n */\nimport type { FC } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { IntegrationsProvider } from './providers/IntegrationsProvider';\nimport { ConnectionsList } from './pages/ConnectionsList';\nimport { useTr } from './hooks/useTr';\nimport type { IntegrationsRootProps } from './types';\n\n/**\n * The same props `IntegrationsRoot` takes.\n *\n * ★ `registerNavItems` / `registerFooterItems` are deliberately NOT called\n * here: they register items with the host's shell chrome, which is wrong for a\n * surface that lives and dies with a dialog. They cannot be typed away —\n * `IntegrationsRootProps` extends `MicrofrontendRootProps`, which is\n * `Record<string, unknown>`, so an index signature makes `keyof` equal `string`\n * and `Omit` collapses every field to `unknown` rather than removing two. An\n * `Omit` here would look like a constraint while silently destroying the types\n * of the props that matter, so this is an alias and the contract is the doc.\n */\nexport type ConnectionsPanelProps = IntegrationsRootProps;\n\nexport const ConnectionsPanel: FC<ConnectionsPanelProps> = (props) => {\n const tr = useTr();\n\n return (\n <FeatureFlagProvider\n workspaceId={props.workspaceId ?? null}\n gateway=\"global\"\n defaultEnabled={false}\n >\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr('integrations.errorBoundary.title', 'Something went wrong loading this module.')}{' '}\n {tr('integrations.errorBoundary.refresh', 'Please refresh the page.')}\n </div>\n }\n >\n <IntegrationsProvider {...props}>\n <ConnectionsList />\n </IntegrationsProvider>\n </ErrorBoundary>\n </FeatureFlagProvider>\n );\n};\n"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"ConnectionsPanel.js","names":[],"sources":["../../src/integrations/ConnectionsPanel.tsx"],"sourcesContent":["/**\n * The connections screen, without the router.\n *\n * ★★ WHY THIS EXISTS AND `IntegrationsRoot` COULD NOT BE USED. The assistant's\n * attach menu offers \"Connect a source\", and it was reported that it \"opens the\n * page but I need a popup in the centre\" — navigating away tears the user out\n * of the conversation they were having. A host wants to render the connections\n * screen inside a dialog, over whatever page the user is on.\n *\n * `IntegrationsRoot` cannot do that. It renders `IntegrationsUserRoutes`, whose\n * `<Routes>` matches against the CURRENT URL. Mounted in a dialog while the\n * user sits at `/dashboard`, the inner routes match none of their paths and\n * fall through to `<Route path=\"*\" element={<Navigate to=\"\" replace />} />` —\n * so opening the dialog would navigate the host app. Wrapping it in a\n * `MemoryRouter` is not an escape either: react-router still asserts\n * `You cannot render a <Router> inside another <Router>`, so it throws.\n *\n * ★ `ConnectionsList` itself needs no router. It takes `navigate` from\n * `IntegrationsProvider` — a plain callback the host supplies — so it works\n * anywhere its providers are mounted. This composes exactly the provider stack\n * `IntegrationsRoot` does, minus the routes and minus the shell nav/footer\n * registration, which a dialog has no business performing.\n *\n * ★ The SAME screen, not a second implementation. Products reuse this rather\n * than growing their own connection management, which is the thing this module\n * exists to own.\n *\n * ★★ For the assistant's \"Connect a source\", render `ConnectSourceDialog`\n * instead of this panel inside a host dialog (BOFF-8158). \"Add Connection\" here\n * opens `AddConnectionDialog`, which portals to `document.body`; inside a host\n * modal, that modal's focus trap and outside-click handling fight it.\n */\nimport type { FC } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { IntegrationsProvider } from './providers/IntegrationsProvider';\nimport { ConnectionsList } from './pages/ConnectionsList';\nimport { useTr } from './hooks/useTr';\nimport type { IntegrationsRootProps } from './types';\n\n/**\n * The same props `IntegrationsRoot` takes.\n *\n * ★ `registerNavItems` / `registerFooterItems` are deliberately NOT called\n * here: they register items with the host's shell chrome, which is wrong for a\n * surface that lives and dies with a dialog. They cannot be typed away —\n * `IntegrationsRootProps` extends `MicrofrontendRootProps`, which is\n * `Record<string, unknown>`, so an index signature makes `keyof` equal `string`\n * and `Omit` collapses every field to `unknown` rather than removing two. An\n * `Omit` here would look like a constraint while silently destroying the types\n * of the props that matter, so this is an alias and the contract is the doc.\n */\nexport type ConnectionsPanelProps = IntegrationsRootProps;\n\nexport const ConnectionsPanel: FC<ConnectionsPanelProps> = (props) => {\n const tr = useTr();\n\n return (\n <FeatureFlagProvider\n workspaceId={props.workspaceId ?? null}\n gateway=\"global\"\n defaultEnabled={false}\n >\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr('integrations.errorBoundary.title', 'Something went wrong loading this module.')}{' '}\n {tr('integrations.errorBoundary.refresh', 'Please refresh the page.')}\n </div>\n }\n >\n <IntegrationsProvider {...props}>\n <ConnectionsList />\n </IntegrationsProvider>\n </ErrorBoundary>\n </FeatureFlagProvider>\n );\n};\n"],"mappings":";;;;;;;AAsDA,IAAa,KAA+C,MAAU;CACpE,IAAM,IAAK,GAAO;AAElB,QACE,kBAAC,GAAD;EACE,aAAa,EAAM,eAAe;EAClC,SAAQ;EACR,gBAAgB;YAEhB,kBAAC,GAAD;GACE,UACE,kBAAC,OAAD;IAAK,WAAU;cAAf;KACG,EAAG,oCAAoC,4CAA4C;KAAE;KACrF,EAAG,sCAAsC,2BAA2B;KACjE;;aAGR,kBAAC,GAAD;IAAsB,GAAI;cACxB,kBAAC,GAAD,EAAmB,CAAA;IACE,CAAA;GACT,CAAA;EACI,CAAA"}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Replaces the full-page AddConnectionWizard with an inline modal dialog.
|
|
5
|
-
* Uses the same hooks and GraphQL operations that already exist in
|
|
6
|
-
* microfe-integrations (useCreateConnection, useInitiateOAuth, etc.).
|
|
7
|
-
*
|
|
8
|
-
* Opens from any page via Zustand store state, so there is no navigation
|
|
9
|
-
* to /connections/add — the dialog overlays the current page.
|
|
10
|
-
*/
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ConnectionDialogPresentation, CreatedConnection } from '@burdenoff/fe-libs/connections';
|
|
3
|
+
|
|
11
4
|
export interface AddConnectionDialogProps {
|
|
12
5
|
/** Whether the dialog is open */
|
|
13
6
|
open: boolean;
|
|
@@ -15,8 +8,26 @@ export interface AddConnectionDialogProps {
|
|
|
15
8
|
onClose: () => void;
|
|
16
9
|
/** Pre-selected provider ID (skips provider picker step) */
|
|
17
10
|
preselectedProviderId?: string | null;
|
|
11
|
+
/** Pre-selected provider key, for links that know a provider by key. */
|
|
12
|
+
preselectedProviderKey?: string | null;
|
|
18
13
|
/** Callback when a connection is successfully created */
|
|
19
14
|
onConnectionCreated?: (connectionId: string) => void;
|
|
15
|
+
/**
|
|
16
|
+
* `dialog` (default): a centred dialog from `sm`. `sheet`: a bottom sheet
|
|
17
|
+
* below `md`, centred from `md` — what `ConnectSourceDialog` uses.
|
|
18
|
+
*/
|
|
19
|
+
presentation?: ConnectionDialogPresentation;
|
|
20
|
+
/** Heading while the provider picker shows. Defaults to "Add new credential". */
|
|
21
|
+
pickerTitle?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Settings stored on the new connection, e.g. the Botlit channel to return
|
|
24
|
+
* to once OAuth completes.
|
|
25
|
+
*/
|
|
26
|
+
extraConfig?: Record<string, unknown>;
|
|
27
|
+
/** Replaces the success panel's button, e.g. "Link to bot channel". */
|
|
28
|
+
renderSuccessAction?: (connection: CreatedConnection) => ReactNode;
|
|
20
29
|
}
|
|
21
|
-
|
|
30
|
+
/** The OAuth callback the gateway serves; providers compare it exactly. */
|
|
31
|
+
export declare function oauthCallbackUrl(apiGatewayUrl: string | null | undefined): string;
|
|
32
|
+
export declare function AddConnectionDialog({ open, onClose, preselectedProviderId, preselectedProviderKey, onConnectionCreated, presentation, pickerTitle, extraConfig, renderSuccessAction, }: AddConnectionDialogProps): import("react").JSX.Element;
|
|
22
33
|
//# sourceMappingURL=AddConnectionDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddConnectionDialog.d.ts","sourceRoot":"","sources":["../../../src/integrations/components/AddConnectionDialog.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"AddConnectionDialog.d.ts","sourceRoot":"","sources":["../../../src/integrations/components/AddConnectionDialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAGL,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACvB,MAAM,gCAAgC,CAAC;AAQxC,MAAM,WAAW,wBAAwB;IACvC,iCAAiC;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,mCAAmC;IACnC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,4DAA4D;IAC5D,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,wEAAwE;IACxE,sBAAsB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,yDAAyD;IACzD,mBAAmB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD;;;OAGG;IACH,YAAY,CAAC,EAAE,4BAA4B,CAAC;IAC5C,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,uEAAuE;IACvE,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,SAAS,CAAC;CACpE;AAED,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAIjF;AAED,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,OAAO,EACP,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,YAAuB,EACvB,WAAW,EACX,WAAW,EACX,mBAAmB,GACpB,EAAE,wBAAwB,+BAoE1B"}
|