@stridge/kit 0.1.0-alpha.23 → 0.1.0-alpha.24
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.
|
@@ -14,6 +14,13 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
14
14
|
* hook keys ack rows by `<txHash, bucket>` where `bucket` is `inflight` for pending and
|
|
15
15
|
* `terminal` for succeeded / failed. Acking the pending banner does NOT suppress the eventual
|
|
16
16
|
* success / failure banner for the same source-chain tx — the buckets are distinct.
|
|
17
|
+
*
|
|
18
|
+
* Reaching a terminal FSM step (`success` / `error`) auto-acks the terminal bucket: the user is
|
|
19
|
+
* looking at the full-screen outcome, so that IS the acknowledgment. Without it, the natural
|
|
20
|
+
* `processing → success` / `processing → error` progression would re-surface the banner once
|
|
21
|
+
* the dialog is closed (FSM resets to `deposit`) and reopened, because the settlement entity
|
|
22
|
+
* still carries the terminal payload. `processing` is deliberately NOT auto-acked — an
|
|
23
|
+
* in-flight deposit should still re-surface its banner on reopen.
|
|
17
24
|
*/
|
|
18
25
|
declare function DepositStatusBanner(): _$react_jsx_runtime0.JSX.Element;
|
|
19
26
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useBannerAckForSettlement as
|
|
1
|
+
"use client";import{bucketFromSettlement as e,useBannerAckForSettlement as t}from"../../../../banners/useBannerAck.js";import"../../../../banners/index.js";import{useDepositSnapshot as n}from"../../driver/context.js";import{useLingui as r}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useDepositActions as i,useDepositState as a}from"../../orchestrator/controller.js";import{stepRendersSettlement as o}from"../../orchestrator/steps.js";import{DepositStatusBanner as s}from"./compound/DepositStatusBanner.js";import"./compound/index.js";import{useEffect as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{AnimatePresence as f}from"motion/react";function p(){let s=n(),l=a().name,{resumeToProcessing:d,resumeToSuccess:p,resumeToError:h}=i(),{_}=r(),v=s.settlement,y=v.status===`ready`||v.status===`stale`?v.payload:void 0,{acked:b,ack:x}=t(y),S=(l===`success`||l===`error`)&&e(y)?.bucket===`terminal`;c(()=>{S&&!b&&x()},[S,b,x]);let C=y!==void 0&&!b&&!o(l);function w(e){return()=>{x(),e()}}return u(f,{children:C&&y?u(m,{payload:y,brandName:s.brand.status===`ready`||s.brand.status===`stale`?s.brand.payload.name:void 0,onDismiss:x,onResumeToProcessing:()=>d(`wallet`,g(y)),onResumeToSuccess:w(()=>p(`wallet`,g(y))),onResumeToError:w(()=>h(g(y))),labels:{completed:_({id:`3kg1gB`,message:`Deposit completed`}),didntComplete:_({id:`Rxjdjn`,message:`Deposit didn't complete`}),receivedProcessing:_({id:`junZX6`,message:`Deposit received and processing…`}),creditedToBrand:e=>_({id:`IRogzB`,message:`Your deposit has been credited to {brand}.`,values:{brand:e}}),creditedToAccount:_({id:`9JHY2T`,message:`Your deposit has been credited to your account.`}),fundsSafe:_({id:`Z1WbO6`,message:`Funds are safe on the source chain — contact support to recover.`}),willBeCreditedToBrand:e=>_({id:`TG4WOd`,message:`Your deposit will be credited to {brand}.`,values:{brand:e}}),willBeCreditedToAccount:_({id:`Offl0a`,message:`Your deposit will be credited to your account.`})}},`banner`):null})}function m({payload:e,brandName:t,onDismiss:n,onResumeToProcessing:r,onResumeToSuccess:i,onResumeToError:a,labels:o}){let[c,f]=l(!1),p=()=>f(e=>!e),m=e.kind,g={symbol:e.creditedAsset.symbol,...e.creditedAsset.address?{address:e.creditedAsset.address}:{},...e.creditedAsset.isNative===void 0?{}:{isNative:e.creditedAsset.isNative},...e.creditedAsset.assetLogoUrl?{logoUrl:e.creditedAsset.assetLogoUrl}:{}},_=m===`succeeded`?o.completed:m===`failed`?o.didntComplete:o.receivedProcessing,v=m===`succeeded`?t?o.creditedToBrand(t):o.creditedToAccount:m===`failed`?o.fundsSafe:t?o.willBeCreditedToBrand(t):o.willBeCreditedToAccount,y=h(e),b=e.kind===`succeeded`&&e.completionTx?{hash:e.completionTx.hash.formatted,...e.completionTx.explorerUrl?{explorerUrl:e.completionTx.explorerUrl}:{}}:void 0,x=e.kind===`succeeded`||e.kind===`failed`?e.submittedAt.formatted:void 0,S=e.kind===`succeeded`?e.filledAt.formatted:void 0,C=m===`succeeded`?i:m===`failed`?a:r;return d(s,{kind:m,asset:g,headline:_,subline:v,expanded:c,onToggleExpanded:p,onDismiss:n,...y?{depositTx:y}:{},...b?{completionTx:b}:{},...x===void 0?{}:{submittedAt:x},...S===void 0?{}:{filledAt:S},onPrimaryAction:C,children:[d(s.Body,{children:[u(s.Hero,{}),u(s.Close,{})]}),d(s.Details,{children:[u(s.DepositTxRow,{}),u(s.CompletionTxRow,{}),u(s.SubmittedAtRow,{}),u(s.FilledAtRow,{})]}),d(s.Footer,{children:[u(s.Toggle,{}),u(s.PrimaryAction,{})]})]})}function h(e){if(e.kind===`succeeded`)return{hash:e.depositTx.hash.formatted,...e.depositTx.explorerUrl?{explorerUrl:e.depositTx.explorerUrl}:{}};if(e.kind===`failed`||e.txHash)return{hash:e.txHash.formatted,...e.txExplorerUrl?{explorerUrl:e.txExplorerUrl}:{}}}function g(e){return e.kind===`succeeded`?{hash:e.depositTx.hash.value,...e.depositTx.explorerUrl?{explorerUrl:e.depositTx.explorerUrl}:{}}:e.kind===`failed`?{hash:e.txHash.value,...e.txExplorerUrl?{explorerUrl:e.txExplorerUrl}:{}}:{hash:e.txHash?.value??``,...e.txExplorerUrl?{explorerUrl:e.txExplorerUrl}:{}}}export{p as DepositStatusBanner};
|
package/dist/package.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`0.1.0-alpha.
|
|
1
|
+
var e=`0.1.0-alpha.24`;export{e as version};
|