@stridge/kit 0.1.0-alpha.54 → 0.1.0-alpha.55
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/events/bus/flowIdRegistry.d.ts +1 -1
- package/dist/events/bus/flowIdRegistry.js +1 -1
- package/dist/events/bus/metadata.js +1 -1
- package/dist/events/emit/index.js +1 -1
- package/dist/events/emit/useActivityEmissions.js +1 -0
- package/dist/events/index.d.ts +2 -1
- package/dist/events/types/activity.d.ts +53 -0
- package/dist/events/types/deposit.d.ts +1 -1
- package/dist/events/types/envelope.d.ts +4 -4
- package/dist/events/types/index.d.ts +2 -1
- package/dist/flows/activity/dialog/ActivityDialog.d.ts +9 -1
- package/dist/flows/activity/dialog/ActivityDialog.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/package.js +1 -1
- package/package.json +1 -1
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
* without subscribing to the bus.
|
|
13
13
|
*/
|
|
14
14
|
/** Flow types eligible for a `flowId`. `kit` is excluded — `kit:*` events carry `flowId: null`. */
|
|
15
|
-
type FlowIdKey = "deposit" | "withdraw";
|
|
15
|
+
type FlowIdKey = "deposit" | "withdraw" | "activity";
|
|
16
16
|
//#endregion
|
|
17
17
|
export { FlowIdKey };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`;function t(){let t=``,n=typeof globalThis<`u`?globalThis.crypto:void 0;if(n?.getRandomValues){let r=new Uint8Array(10);n.getRandomValues(r);for(let n=0;n<10;n+=1)t+=e[(r[n]??0)%62];return t}for(let n=0;n<10;n+=1)t+=e[Math.floor(Math.random()*62)];return t}function n(){let e={deposit:null,withdraw:null},n={deposit:new Set,withdraw:new Set};function r(e){for(let t of n[e])try{t()}catch(t){console.error(`[stridge/kit] flowId listener for "${e}" threw:`,t)}}return{open(n){e[n]!==null&&process.env.NODE_ENV!==`production`&&console.warn(`[stridge/kit] minted a new "${n}" flowId while a previous session was still active — the previous flowId is being discarded. This usually means the kit emitted opened twice without an intervening terminal/cancelled event.`);let i=t();return e[n]=i,r(n),i},close(t){e[t]!==null&&(e[t]=null,r(t))},current(t){return e[t]},subscribe(e,t){return n[e].add(t),()=>{n[e].delete(t)}}}}export{n as createFlowIdRegistry};
|
|
1
|
+
const e=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`;function t(){let t=``,n=typeof globalThis<`u`?globalThis.crypto:void 0;if(n?.getRandomValues){let r=new Uint8Array(10);n.getRandomValues(r);for(let n=0;n<10;n+=1)t+=e[(r[n]??0)%62];return t}for(let n=0;n<10;n+=1)t+=e[Math.floor(Math.random()*62)];return t}function n(){let e={deposit:null,withdraw:null,activity:null},n={deposit:new Set,withdraw:new Set,activity:new Set};function r(e){for(let t of n[e])try{t()}catch(t){console.error(`[stridge/kit] flowId listener for "${e}" threw:`,t)}}return{open(n){e[n]!==null&&process.env.NODE_ENV!==`production`&&console.warn(`[stridge/kit] minted a new "${n}" flowId while a previous session was still active — the previous flowId is being discarded. This usually means the kit emitted opened twice without an intervening terminal/cancelled event.`);let i=t();return e[n]=i,r(n),i},close(t){e[t]!==null&&(e[t]=null,r(t))},current(t){return e[t]},subscribe(e,t){return n[e].add(t),()=>{n[e].delete(t)}}}}export{n as createFlowIdRegistry};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=Object.freeze({});function t(){let t={deposit:e,withdraw:e};return{snapshot(n,r){if(!r||Object.keys(r).length===0){t[n]=e;return}t[n]=Object.freeze({...r})},read(e){return t[e]},clear(n){t[n]=e}}}export{t as createMetadataStore};
|
|
1
|
+
const e=Object.freeze({});function t(){let t={deposit:e,withdraw:e,activity:e};return{snapshot(n,r){if(!r||Object.keys(r).length===0){t[n]=e;return}t[n]=Object.freeze({...r})},read(e){return t[e]},clear(n){t[n]=e}}}export{t as createMetadataStore};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./mapFailure.js";import"./useDepositEmissions.js";import"./useKitEmitter.js";import"./useWithdrawEmissions.js";
|
|
1
|
+
import"./mapFailure.js";import"./useActivityEmissions.js";import"./useDepositEmissions.js";import"./useKitEmitter.js";import"./useWithdrawEmissions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{StridgeEventsContext as e}from"../context.js";import{closeFlowSession as t,openFlowSession as n,publishEvent as r}from"../publish.js";import{use as i,useEffect as a,useRef as o}from"react";function s(t){let n=i(e),r=o(t.metadata);r.current=t.metadata;let s=o(t.state);a(()=>{let e=s.current;s.current=t.state,n&&e!==t.state&&c(n,e,t.state,r.current)})}function c(e,i,a,o){if(i.name===a.name){i.name===`activityDetail`&&a.name===`activityDetail`&&i.ctx.settlementId!==a.ctx.settlementId&&l(e,a);return}i.name===`closed`&&n(e,`activity`,o,{type:`activity.opened`,flow:`activity`,tier:`ui`,payload:{atStep:a.name}}),r(e,{type:`activity.step.changed`,flow:`activity`,tier:`ui`,payload:{from:i.name,to:a.name}}),a.name===`activityDetail`&&l(e,a),a.name===`closed`&&t(e,`activity`,{type:`activity.closed`,flow:`activity`,tier:`ui`,payload:{atStep:i.name}})}function l(e,t){r(e,{type:`activity.settlement.selected`,flow:`activity`,tier:`ui`,payload:{settlementId:t.ctx.settlementId,via:t.ctx.viaList?`list`:`direct`}})}export{s as useActivityEmissions};
|
package/dist/events/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FlowIdKey } from "./bus/flowIdRegistry.js";
|
|
2
2
|
import { useCurrentFlowId } from "./hooks/useCurrentFlowId.js";
|
|
3
3
|
import { FailureCode, FailurePayloadBase, StridgeEventBase, StridgeEventFlow, StridgeEventTier } from "./types/envelope.js";
|
|
4
|
+
import { ActivityClosedEvent, ActivityEvent, ActivityOpenedEvent, ActivitySelectionVia, ActivitySettlementSelectedEvent, ActivityStepChangedEvent, ActivityUiEvent } from "./types/activity.js";
|
|
4
5
|
import { DepositAmountChangedEvent, DepositAmountSubmittedEvent, DepositAssetClickedEvent, DepositBackClickedEvent, DepositCancelPhase, DepositCancelledEvent, DepositClosedEvent, DepositConfirmClickedEvent, DepositEvent, DepositFlowEvent, DepositMaxClickedEvent, DepositMethodClickedEvent, DepositOpenedEvent, DepositQuoteExpiredEvent, DepositQuoteFailedEvent, DepositQuoteRequestInput, DepositQuoteRequestedEvent, DepositQuoteResolvedEvent, DepositSettlementFailedEvent, DepositSettlementFailurePayload, DepositSettlementProgressedEvent, DepositSettlementResumedEvent, DepositSettlementSucceededEvent, DepositStepChangedEvent, DepositSubmissionBroadcastEvent, DepositSubmissionConfirmedEvent, DepositSubmissionDeclinedEvent, DepositSubmissionFailedEvent, DepositTransferAddressCopiedEvent, DepositTransferChainChangedEvent, DepositTransferTokenChangedEvent, DepositUiEvent } from "./types/deposit.js";
|
|
5
6
|
import { KitEvent, KitSupportClickedEvent, KitTermsClickedEvent } from "./types/kit.js";
|
|
6
7
|
import { WithdrawAmountChangedEvent, WithdrawBreakdownClickedEvent, WithdrawCancelPhase, WithdrawCancelledEvent, WithdrawClosedEvent, WithdrawEvent, WithdrawFlowEvent, WithdrawMaxClickedEvent, WithdrawOpenedEvent, WithdrawQuoteExpiredEvent, WithdrawQuoteFailedEvent, WithdrawQuoteRequestedEvent, WithdrawQuoteResolvedEvent, WithdrawReceiveChainChangedEvent, WithdrawReceiveTokenChangedEvent, WithdrawRecipientChangedEvent, WithdrawSettlementFailedEvent, WithdrawSettlementFailurePayload, WithdrawSettlementProgressedEvent, WithdrawSettlementSucceededEvent, WithdrawStepChangedEvent, WithdrawSubmissionBroadcastEvent, WithdrawSubmissionConfirmedEvent, WithdrawSubmissionDeclinedEvent, WithdrawSubmissionFailedEvent, WithdrawSubmitClickedEvent, WithdrawUiEvent } from "./types/withdraw.js";
|
|
@@ -11,4 +12,4 @@ import { PublicStridgeEventBus, useStridgeEventBus } from "./hooks/useStridgeEve
|
|
|
11
12
|
import { useStridgeEvents } from "./hooks/useStridgeEvents.js";
|
|
12
13
|
import { useStridgeFlowEvent } from "./hooks/useStridgeFlowEvent.js";
|
|
13
14
|
import { useStridgeFlowEvents } from "./hooks/useStridgeFlowEvents.js";
|
|
14
|
-
export { type DepositAmountChangedEvent, type DepositAmountSubmittedEvent, type DepositAssetClickedEvent, type DepositBackClickedEvent, type DepositCancelPhase, type DepositCancelledEvent, type DepositClosedEvent, type DepositConfirmClickedEvent, type DepositEvent, type DepositFlowEvent, type DepositMaxClickedEvent, type DepositMethodClickedEvent, type DepositOpenedEvent, type DepositQuoteExpiredEvent, type DepositQuoteFailedEvent, type DepositQuoteRequestInput, type DepositQuoteRequestedEvent, type DepositQuoteResolvedEvent, type DepositSettlementFailedEvent, type DepositSettlementFailurePayload, type DepositSettlementProgressedEvent, type DepositSettlementResumedEvent, type DepositSettlementSucceededEvent, type DepositStepChangedEvent, type DepositSubmissionBroadcastEvent, type DepositSubmissionConfirmedEvent, type DepositSubmissionDeclinedEvent, type DepositSubmissionFailedEvent, type DepositTransferAddressCopiedEvent, type DepositTransferChainChangedEvent, type DepositTransferTokenChangedEvent, type DepositUiEvent, type EventHandler, type FailureCode, type FailurePayloadBase, type FlowEvent, type FlowEventType, type FlowIdKey, type KitEvent, type KitSupportClickedEvent, type KitTermsClickedEvent, type PublicStridgeEventBus, type StridgeEvent, type StridgeEventBase, type StridgeEventFlow, type StridgeEventTier, type StridgeEventType, type UiEvent, type UiEventType, type WithdrawAmountChangedEvent, type WithdrawBreakdownClickedEvent, type WithdrawCancelPhase, type WithdrawCancelledEvent, type WithdrawClosedEvent, type WithdrawEvent, type WithdrawFlowEvent, type WithdrawMaxClickedEvent, type WithdrawOpenedEvent, type WithdrawQuoteExpiredEvent, type WithdrawQuoteFailedEvent, type WithdrawQuoteRequestedEvent, type WithdrawQuoteResolvedEvent, type WithdrawReceiveChainChangedEvent, type WithdrawReceiveTokenChangedEvent, type WithdrawRecipientChangedEvent, type WithdrawSettlementFailedEvent, type WithdrawSettlementFailurePayload, type WithdrawSettlementProgressedEvent, type WithdrawSettlementSucceededEvent, type WithdrawStepChangedEvent, type WithdrawSubmissionBroadcastEvent, type WithdrawSubmissionConfirmedEvent, type WithdrawSubmissionDeclinedEvent, type WithdrawSubmissionFailedEvent, type WithdrawSubmitClickedEvent, type WithdrawUiEvent, useCurrentFlowId, useStridgeEvent, useStridgeEventBus, useStridgeEvents, useStridgeFlowEvent, useStridgeFlowEvents };
|
|
15
|
+
export { type ActivityClosedEvent, type ActivityEvent, type ActivityOpenedEvent, type ActivitySelectionVia, type ActivitySettlementSelectedEvent, type ActivityStepChangedEvent, type ActivityUiEvent, type DepositAmountChangedEvent, type DepositAmountSubmittedEvent, type DepositAssetClickedEvent, type DepositBackClickedEvent, type DepositCancelPhase, type DepositCancelledEvent, type DepositClosedEvent, type DepositConfirmClickedEvent, type DepositEvent, type DepositFlowEvent, type DepositMaxClickedEvent, type DepositMethodClickedEvent, type DepositOpenedEvent, type DepositQuoteExpiredEvent, type DepositQuoteFailedEvent, type DepositQuoteRequestInput, type DepositQuoteRequestedEvent, type DepositQuoteResolvedEvent, type DepositSettlementFailedEvent, type DepositSettlementFailurePayload, type DepositSettlementProgressedEvent, type DepositSettlementResumedEvent, type DepositSettlementSucceededEvent, type DepositStepChangedEvent, type DepositSubmissionBroadcastEvent, type DepositSubmissionConfirmedEvent, type DepositSubmissionDeclinedEvent, type DepositSubmissionFailedEvent, type DepositTransferAddressCopiedEvent, type DepositTransferChainChangedEvent, type DepositTransferTokenChangedEvent, type DepositUiEvent, type EventHandler, type FailureCode, type FailurePayloadBase, type FlowEvent, type FlowEventType, type FlowIdKey, type KitEvent, type KitSupportClickedEvent, type KitTermsClickedEvent, type PublicStridgeEventBus, type StridgeEvent, type StridgeEventBase, type StridgeEventFlow, type StridgeEventTier, type StridgeEventType, type UiEvent, type UiEventType, type WithdrawAmountChangedEvent, type WithdrawBreakdownClickedEvent, type WithdrawCancelPhase, type WithdrawCancelledEvent, type WithdrawClosedEvent, type WithdrawEvent, type WithdrawFlowEvent, type WithdrawMaxClickedEvent, type WithdrawOpenedEvent, type WithdrawQuoteExpiredEvent, type WithdrawQuoteFailedEvent, type WithdrawQuoteRequestedEvent, type WithdrawQuoteResolvedEvent, type WithdrawReceiveChainChangedEvent, type WithdrawReceiveTokenChangedEvent, type WithdrawRecipientChangedEvent, type WithdrawSettlementFailedEvent, type WithdrawSettlementFailurePayload, type WithdrawSettlementProgressedEvent, type WithdrawSettlementSucceededEvent, type WithdrawStepChangedEvent, type WithdrawSubmissionBroadcastEvent, type WithdrawSubmissionConfirmedEvent, type WithdrawSubmissionDeclinedEvent, type WithdrawSubmissionFailedEvent, type WithdrawSubmitClickedEvent, type WithdrawUiEvent, useCurrentFlowId, useStridgeEvent, useStridgeEventBus, useStridgeEvents, useStridgeFlowEvent, useStridgeFlowEvents };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ActivityStateName } from "../../flows/activity/orchestrator/types.js";
|
|
2
|
+
import { StridgeEventBase } from "./envelope.js";
|
|
3
|
+
|
|
4
|
+
//#region src/events/types/activity.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* How the user reached a settlement detail view. `"list"` — tapped a row on the activity list.
|
|
7
|
+
* `"direct"` — entered the detail imperatively via `useActivity().open({ settlementId })` /
|
|
8
|
+
* `open({ txHash })`, without an intervening list (URL deep-link, push-notification handler).
|
|
9
|
+
*/
|
|
10
|
+
type ActivitySelectionVia = "list" | "direct";
|
|
11
|
+
/**
|
|
12
|
+
* Activity surface transitioned from `closed` to an open step. Mints the `flowId` and snapshots
|
|
13
|
+
* `metadata`. `payload.atStep` is the step it opened on — `"activityList"` for `open()`,
|
|
14
|
+
* `"activityDetail"` for a resolved direct-entry (`open({ settlementId })`).
|
|
15
|
+
*/
|
|
16
|
+
type ActivityOpenedEvent = StridgeEventBase<"activity.opened", "activity", "ui", {
|
|
17
|
+
atStep: ActivityStateName;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Activity surface returned to `closed`. `payload.atStep` is the step it was on at close time.
|
|
21
|
+
* Terminal event for the activity session — the `flowId` is retired after this fires.
|
|
22
|
+
*/
|
|
23
|
+
type ActivityClosedEvent = StridgeEventBase<"activity.closed", "activity", "ui", {
|
|
24
|
+
atStep: ActivityStateName;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Logical step transition within the activity surface (list ↔ detail, including back-presses).
|
|
28
|
+
* Brackets the session with the `closed` pseudo-step on open / close, mirroring
|
|
29
|
+
* `deposit.step.changed` / `withdraw.step.changed`. Same-step `ctx` shifts don't fire this.
|
|
30
|
+
*/
|
|
31
|
+
type ActivityStepChangedEvent = StridgeEventBase<"activity.step.changed", "activity", "ui", {
|
|
32
|
+
from: ActivityStateName;
|
|
33
|
+
to: ActivityStateName;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* User opened a settlement's detail view — by tapping a list row (`via: "list"`) or by
|
|
37
|
+
* imperative direct-entry (`via: "direct"`). Fires on every entry into `activityDetail`,
|
|
38
|
+
* including a pivot from one settlement's detail straight to another's.
|
|
39
|
+
*/
|
|
40
|
+
type ActivitySettlementSelectedEvent = StridgeEventBase<"activity.settlement.selected", "activity", "ui", {
|
|
41
|
+
settlementId: string;
|
|
42
|
+
via: ActivitySelectionVia;
|
|
43
|
+
}>;
|
|
44
|
+
/** Union of every `activity.*` `ui:*` event. */
|
|
45
|
+
type ActivityUiEvent = ActivityOpenedEvent | ActivityClosedEvent | ActivityStepChangedEvent | ActivitySettlementSelectedEvent;
|
|
46
|
+
/**
|
|
47
|
+
* Union of every `activity.*` event regardless of tier. Activity is UI-only today, so this
|
|
48
|
+
* equals {@link ActivityUiEvent} — the alias is kept for symmetry with `DepositEvent` /
|
|
49
|
+
* `WithdrawEvent` and so a future flow-tier variant has a home.
|
|
50
|
+
*/
|
|
51
|
+
type ActivityEvent = ActivityUiEvent;
|
|
52
|
+
//#endregion
|
|
53
|
+
export { ActivityClosedEvent, ActivityEvent, ActivityOpenedEvent, ActivitySelectionVia, ActivitySettlementSelectedEvent, ActivityStepChangedEvent, ActivityUiEvent };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SettlementFailureKind, TxRef } from "../../shared/driver/types.js";
|
|
2
2
|
import { BalanceItemPayload, QuotePayload, SettlementPendingPayload, SettlementSuccessPayload } from "../../flows/deposit/driver/payloads.js";
|
|
3
3
|
import { DepositMethod, DepositStateName, ResolvedOpenInput } from "../../flows/deposit/orchestrator/types.js";
|
|
4
|
-
import { TransferCryptoChain, TransferCryptoToken } from "../../flows/deposit/widgets/transfer-crypto/compound/types.js";
|
|
5
4
|
import { FailurePayloadBase, StridgeEventBase } from "./envelope.js";
|
|
5
|
+
import { TransferCryptoChain, TransferCryptoToken } from "../../flows/deposit/widgets/transfer-crypto/compound/types.js";
|
|
6
6
|
|
|
7
7
|
//#region src/events/types/deposit.d.ts
|
|
8
8
|
/**
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
* - `timestamp` — `Date.now()` at emit; wall-clock, not `performance.now()`, because
|
|
48
48
|
* consumers want it for logging/funnels.
|
|
49
49
|
* - `flowId` — session correlation id. Minted at `<flow>.opened`, retired after the terminal
|
|
50
|
-
* event (`*.settlement.succeeded` / `*.settlement.failed` / `*.cancelled`
|
|
51
|
-
*
|
|
52
|
-
* context to belong to).
|
|
50
|
+
* event (`*.settlement.succeeded` / `*.settlement.failed` / `*.cancelled`, or `activity.closed`
|
|
51
|
+
* for the read-only activity surface which has no settlement). Always `string` for `flow:*`
|
|
52
|
+
* and `ui:*` events; `null` for `kit:*` events (which have no flow context to belong to).
|
|
53
53
|
* - `payload` — event-specific data, always an object even when single-field, so future
|
|
54
54
|
* fields can be added non-breakingly.
|
|
55
55
|
* - `metadata` — consumer-attached, snapshotted at `<flow>.opened` and frozen for the
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
* bikeshed without paying for itself.
|
|
66
66
|
*/
|
|
67
67
|
/** Flow identifier — one per orchestrator family, plus `"kit"` for flow-less provider events. */
|
|
68
|
-
type StridgeEventFlow = "deposit" | "withdraw" | "kit";
|
|
68
|
+
type StridgeEventFlow = "deposit" | "withdraw" | "activity" | "kit";
|
|
69
69
|
/** Delivery tier — see envelope JSDoc for the rule. */
|
|
70
70
|
type StridgeEventTier = "flow" | "ui";
|
|
71
71
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FailureCode, FailurePayloadBase, StridgeEventBase, StridgeEventFlow, StridgeEventTier } from "./envelope.js";
|
|
2
|
+
import { ActivityClosedEvent, ActivityEvent, ActivityOpenedEvent, ActivitySelectionVia, ActivitySettlementSelectedEvent, ActivityStepChangedEvent, ActivityUiEvent } from "./activity.js";
|
|
2
3
|
import { DepositAmountChangedEvent, DepositAmountSubmittedEvent, DepositAssetClickedEvent, DepositBackClickedEvent, DepositCancelPhase, DepositCancelledEvent, DepositClosedEvent, DepositConfirmClickedEvent, DepositEvent, DepositFlowEvent, DepositMaxClickedEvent, DepositMethodClickedEvent, DepositOpenedEvent, DepositQuoteExpiredEvent, DepositQuoteFailedEvent, DepositQuoteRequestInput, DepositQuoteRequestedEvent, DepositQuoteResolvedEvent, DepositSettlementFailedEvent, DepositSettlementFailurePayload, DepositSettlementProgressedEvent, DepositSettlementResumedEvent, DepositSettlementSucceededEvent, DepositStepChangedEvent, DepositSubmissionBroadcastEvent, DepositSubmissionConfirmedEvent, DepositSubmissionDeclinedEvent, DepositSubmissionFailedEvent, DepositTransferAddressCopiedEvent, DepositTransferChainChangedEvent, DepositTransferTokenChangedEvent, DepositUiEvent } from "./deposit.js";
|
|
3
4
|
import { KitEvent, KitSupportClickedEvent, KitTermsClickedEvent } from "./kit.js";
|
|
4
5
|
import { WithdrawAmountChangedEvent, WithdrawBreakdownClickedEvent, WithdrawCancelPhase, WithdrawCancelledEvent, WithdrawClosedEvent, WithdrawEvent, WithdrawFlowEvent, WithdrawMaxClickedEvent, WithdrawOpenedEvent, WithdrawQuoteExpiredEvent, WithdrawQuoteFailedEvent, WithdrawQuoteRequestedEvent, WithdrawQuoteResolvedEvent, WithdrawReceiveChainChangedEvent, WithdrawReceiveTokenChangedEvent, WithdrawRecipientChangedEvent, WithdrawSettlementFailedEvent, WithdrawSettlementFailurePayload, WithdrawSettlementProgressedEvent, WithdrawSettlementSucceededEvent, WithdrawStepChangedEvent, WithdrawSubmissionBroadcastEvent, WithdrawSubmissionConfirmedEvent, WithdrawSubmissionDeclinedEvent, WithdrawSubmissionFailedEvent, WithdrawSubmitClickedEvent, WithdrawUiEvent } from "./withdraw.js";
|
|
@@ -17,7 +18,7 @@ type FlowEvent = DepositFlowEvent | WithdrawFlowEvent;
|
|
|
17
18
|
* belong to a deposit/withdraw flow). Does NOT include `flow:*` events — for the firehose
|
|
18
19
|
* union, use {@link StridgeEvent}.
|
|
19
20
|
*/
|
|
20
|
-
type UiEvent = DepositUiEvent | WithdrawUiEvent | KitEvent;
|
|
21
|
+
type UiEvent = DepositUiEvent | WithdrawUiEvent | ActivityUiEvent | KitEvent;
|
|
21
22
|
/**
|
|
22
23
|
* Firehose union — every event the kit ever emits. Equivalent to `FlowEvent | UiEvent`.
|
|
23
24
|
* What `useStridgeEvents` hands to its handler.
|
|
@@ -18,7 +18,8 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
18
18
|
declare function ActivityDialog({
|
|
19
19
|
container,
|
|
20
20
|
onError,
|
|
21
|
-
presentation
|
|
21
|
+
presentation,
|
|
22
|
+
metadata
|
|
22
23
|
}?: ActivityDialog.Props): _$react_jsx_runtime0.JSX.Element;
|
|
23
24
|
declare namespace ActivityDialog {
|
|
24
25
|
interface Props {
|
|
@@ -34,6 +35,13 @@ declare namespace ActivityDialog {
|
|
|
34
35
|
* `useActivity().close()`.
|
|
35
36
|
*/
|
|
36
37
|
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Consumer-attached metadata that rides along on every bus event emitted from this
|
|
40
|
+
* dialog's session. Snapshotted at `activity.opened` and frozen for the session — mid-flow
|
|
41
|
+
* prop changes are ignored to keep correlation consistent. The kit does not validate or
|
|
42
|
+
* normalise the shape. See `@stridge/kit/events`.
|
|
43
|
+
*/
|
|
44
|
+
metadata?: Record<string, unknown>;
|
|
37
45
|
/**
|
|
38
46
|
* Per-dialog surface override. `"auto"` (default) renders a centred dialog on wide
|
|
39
47
|
* containers and a bottom-sheet drawer below the breakpoint; `"dialog"` / `"drawer"`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useActivityControllerContext as e}from"../orchestrator/controller.js";import"../orchestrator/index.js";import{
|
|
1
|
+
"use client";import{useActivityControllerContext as e}from"../orchestrator/controller.js";import"../orchestrator/index.js";import{useActivityEmissions as t}from"../../../events/emit/useActivityEmissions.js";import"../../../events/emit/index.js";import{useIntercomShutdownOnUnmount as n}from"../../../shared/support/useIntercomShutdownOnUnmount.js";import"../../../shared/support/index.js";import{AdaptiveSurface as r}from"../../../shared/ui/AdaptiveSurface/AdaptiveSurface.js";import"../../../shared/ui/AdaptiveSurface/index.js";import{ActivityFlow as i}from"../compound/ActivityFlow.js";import"../../../activity/compound/index.js";import{ActivityDetail as a}from"../widgets/ActivityDetail.js";import{ActivityList as o}from"../widgets/ActivityList.js";import"../../../activity/widgets/index.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l({container:l,onError:u,presentation:d,metadata:f}={}){let{state:p,controller:m}=e(),h=p.name!==`closed`;return t({state:p,metadata:f}),n(),s(r,{open:h,onOpenChange:e=>{e||m.close()},container:l,...d?{presentation:d}:{},children:s(i.Boundary,{...u?{onError:u}:{},children:c(i.Steps,{children:[s(i.Step,{name:`activityList`,children:s(o,{})}),s(i.Step,{name:`activityDetail`,children:s(a,{})})]})})})}export{l as ActivityDialog};
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { useActivitySnapshot } from "./flows/activity/driver/context.js";
|
|
|
22
22
|
import { StridgeEnvironment } from "./drivers/stridge/types.js";
|
|
23
23
|
import { FlowIdKey } from "./events/bus/flowIdRegistry.js";
|
|
24
24
|
import { useCurrentFlowId } from "./events/hooks/useCurrentFlowId.js";
|
|
25
|
+
import { ActivityActions, ActivityController, ActivityState, ActivityStateName } from "./flows/activity/orchestrator/types.js";
|
|
25
26
|
import { WithdrawActions, WithdrawController, WithdrawState, WithdrawStateName, WithdrawSubmitActions, WithdrawSubmitCallback, WithdrawSubmitInput, WithdrawalFormSnapshot } from "./flows/withdraw/orchestrator/types.js";
|
|
26
27
|
import { FlowEvent, StridgeEvent, UiEvent } from "./events/types/index.js";
|
|
27
28
|
import { useStridgeEvent } from "./events/hooks/useStridgeEvent.js";
|
|
@@ -29,7 +30,6 @@ import { PublicStridgeEventBus, useStridgeEventBus } from "./events/hooks/useStr
|
|
|
29
30
|
import { useStridgeEvents } from "./events/hooks/useStridgeEvents.js";
|
|
30
31
|
import { useStridgeFlowEvent } from "./events/hooks/useStridgeFlowEvent.js";
|
|
31
32
|
import { useStridgeFlowEvents } from "./events/hooks/useStridgeFlowEvents.js";
|
|
32
|
-
import { ActivityActions, ActivityController, ActivityState, ActivityStateName } from "./flows/activity/orchestrator/types.js";
|
|
33
33
|
import { useActivityState } from "./flows/activity/orchestrator/controller.js";
|
|
34
34
|
import { useActivity, useOptionalActivity, useOptionalPrefetchActivity, usePrefetchActivity } from "./flows/activity/orchestrator/useActivity.js";
|
|
35
35
|
import { WithdrawBalanceInput, WithdrawBindings, WithdrawSuggestedRecipient, useWithdrawBindings } from "./flows/withdraw/bindings/WithdrawBindings.js";
|
package/dist/package.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`0.1.0-alpha.
|
|
1
|
+
var e=`0.1.0-alpha.55`;export{e as version};
|