@fluent.xyz/connect 0.8.3 → 0.8.4

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/index.d.ts CHANGED
@@ -656,6 +656,20 @@ type FluentWidgetRenderContext = {
656
656
  openConnect: () => void;
657
657
  /** Opens the account drawer, as the connect button does once a Widget account is connected. */
658
658
  openAccount: () => void;
659
+ /**
660
+ * Renders the drawer's Swap page, where a Deposit is made, as the App's own element: in a
661
+ * modal or a page of its own, shown when the App decides. It is the page the drawer shows, on
662
+ * both Networks and for either account kind, in the widget's own style scope so it draws as
663
+ * in the drawer inside any element, and it connects the External wallet that pays by itself.
664
+ * `onClose` is called by the page's own ways back to the wallet: "Back to wallet" once
665
+ * a Deposit has landed or while its funds are on their way, and "Back to Home" on a Two-step
666
+ * deposit's status screen. The form itself offers no way back, which the App's own element
667
+ * provides.
668
+ *
669
+ * @experimental May change or be removed in a minor release: an App that draws the Swap page
670
+ * itself is not a 0.8.3 commitment.
671
+ */
672
+ renderBridge: (onClose: () => void) => ReactNode;
659
673
  /**
660
674
  * Disconnects the Widget account, the same teardown the account menu's "Disconnect" runs. The
661
675
  * Widget session and the stored identity token are cleared before it resolves, so an App can
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import { clsx } from 'clsx';
11
11
  import { twMerge } from 'tailwind-merge';
12
12
  import { Button as Button$1 } from '@base-ui/react/button';
13
13
  import { cva } from 'class-variance-authority';
14
- import { X, ChevronLeft, ExternalLink, Copy, Settings, LogOut, Layers, Trash2, RefreshCw, ChevronDownIcon, CheckIcon, AlertTriangle, Plus, Loader2Icon, Loader2, LogIn, Send, RotateCw, KeyRound, Mail, Wallet, XIcon, Check, ChevronUpIcon, Search, ChevronDown, Info, CircleCheckIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon } from 'lucide-react';
14
+ import { X, ChevronLeft, ExternalLink, Copy, Settings, LogOut, Layers, Trash2, RefreshCw, ChevronDownIcon, CheckIcon, AlertTriangle, Plus, Loader2Icon, Loader2, LogIn, Send, RotateCw, KeyRound, Mail, Wallet, XIcon, Check, Search, ChevronDown, Info, ChevronUpIcon, CircleCheckIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon } from 'lucide-react';
15
15
  import { WagmiAdapter } from '@reown/appkit-adapter-wagmi';
16
16
  import { createAppKit } from '@reown/appkit/react';
17
17
  import { WagmiContext, WagmiProvider, useAccount, useDisconnect, useWalletClient, useSwitchChain, useConnect, useConfig, usePublicClient, useBalance, useReadContract, useWriteContract, useSendTransaction, useWaitForTransactionReceipt } from 'wagmi';
@@ -5626,7 +5626,7 @@ function createFluentConnectForWidget(config) {
5626
5626
  }
5627
5627
 
5628
5628
  // package.json
5629
- var version = "0.8.3";
5629
+ var version = "0.8.4";
5630
5630
 
5631
5631
  // src/core/analytics.ts
5632
5632
  var INSTANCE_NAME = "fluent";
@@ -22550,6 +22550,25 @@ function FluentWidgetContent({
22550
22550
  widget: appWidgetApi,
22551
22551
  openConnect,
22552
22552
  openAccount: openAccountMenu,
22553
+ // The drawer's Swap page with the drawer's own props, so a Deposit started here is the
22554
+ // same Deposit the drawer follows; the App's `onClose` stands where the drawer goes home.
22555
+ renderBridge: (onClose) => (
22556
+ // In the widget's own style scope, as the drawer is: the App's element sits outside it,
22557
+ // and the package's layout rules and theme colours hold under `.fluent-root` alone. The
22558
+ // scope draws no box of its own, so the page fills the element the App gives it.
22559
+ /* @__PURE__ */ jsx("div", { className: WIDGET_STYLE_SCOPE, children: /* @__PURE__ */ jsx(
22560
+ BridgeScreen,
22561
+ {
22562
+ config,
22563
+ recipient: fluentAccountAddress,
22564
+ onSignIn: signInWithFluent,
22565
+ track,
22566
+ depositSwap: bridgeDepositSwap,
22567
+ onDepositSent: addSentDeposit,
22568
+ onGoHome: onClose
22569
+ }
22570
+ ) })
22571
+ ),
22553
22572
  disconnect: requestDisconnect,
22554
22573
  hasConnectedAccount,
22555
22574
  status,
@@ -22566,6 +22585,12 @@ function FluentWidgetContent({
22566
22585
  appWidgetApi,
22567
22586
  openConnect,
22568
22587
  openAccountMenu,
22588
+ config,
22589
+ fluentAccountAddress,
22590
+ signInWithFluent,
22591
+ track,
22592
+ bridgeDepositSwap,
22593
+ addSentDeposit,
22569
22594
  requestDisconnect,
22570
22595
  hasConnectedAccount,
22571
22596
  status,