mantur-components 0.1.10 → 0.1.11
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 +3 -0
- package/dist/api.d.ts +2 -0
- package/dist/header/ManturHeader.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/mantur-components.js +456 -397
- package/dist/mantur-components.umd.cjs +3 -3
- package/dist/types.d.ts +1 -0
- package/dist/utils/stripe-payment-window.d.ts +13 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -145,6 +145,7 @@ import {
|
|
|
145
145
|
getManturPricingChargePoint,
|
|
146
146
|
getManturPricingChargePoints,
|
|
147
147
|
getManturRechargeOrder,
|
|
148
|
+
postManturStripePaymentWindowMessage,
|
|
148
149
|
MANTUR_RECHARGE_ORDER_CREATED_EVENT,
|
|
149
150
|
} from "mantur-components";
|
|
150
151
|
```
|
|
@@ -153,6 +154,8 @@ import {
|
|
|
153
154
|
|
|
154
155
|
后端按 `mantur-billing` 文档返回 `ui_mode="embedded"` Checkout Session 的 `clientSecret` 后,`ManturHeader` 会通过 `EmbeddedCheckoutProvider` 挂载 Stripe Embedded Checkout;支付完成后由 Stripe 的 `onComplete` 回调刷新积分。如果后端返回 `paymentUrl`、`checkoutUrl`、`url` 或 `returnUrl` 这类托管支付地址,组件库会直接跳转。组件库仍兼容旧字段名 `stripeClientSecret`,但优先读取 `clientSecret`。
|
|
155
156
|
|
|
157
|
+
如果宿主项目把 Stripe 支付页放在主应用 `front-main` 中,组件库会在创建订单后按 `redirectToManturMain` 的规则打开子窗口,并通过 URL 参数携带 `orderNo`、`clientSecret`、`amount`、`points` 到 `/stripe-payment`。子页完成支付或点击关闭时调用 `postManturStripePaymentWindowMessage()` 通知父窗口,父窗口会关闭子窗口并刷新用户余额。
|
|
158
|
+
|
|
156
159
|
## 团队上下文同步
|
|
157
160
|
|
|
158
161
|
团队列表、当前团队、切换团队都由 `ManturHeader` 内部处理。
|
package/dist/api.d.ts
CHANGED
|
@@ -116,6 +116,8 @@ declare global {
|
|
|
116
116
|
__MANTUR_COMPONENTS_POINTS_ENDPOINT__?: string;
|
|
117
117
|
__MANTUR_COMPONENTS_STRIPE_PUBLISHABLE_KEY__?: string;
|
|
118
118
|
__MANTUR_COMPONENTS_TENANT_CONTEXT__?: ManturTenantContextDetail;
|
|
119
|
+
__MANTUR_MAIN_PREFIX__?: string;
|
|
120
|
+
__MANTUR_APP_NAME__?: string;
|
|
119
121
|
}
|
|
120
122
|
}
|
|
121
123
|
export declare function removeManturCookie(name: string): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ManturHeaderProps } from "../types";
|
|
2
|
-
export declare function ManturHeader({ user, disabled, brandSlot, children, onTenantContextChange, stripePublishableKey, }: ManturHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function ManturHeader({ user, disabled, brandSlot, children, onTenantContextChange, stripePublishableKey, stripePaymentWindowFeatures, }: ManturHeaderProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,4 +5,6 @@ export { formatDateByLang } from "./utils/date";
|
|
|
5
5
|
export type { ManturDateFormatType, ManturDateInput } from "./utils/date";
|
|
6
6
|
export { redirectToManturMain } from "./utils/url";
|
|
7
7
|
export type { ManturMainRedirectOptions } from "./utils/url";
|
|
8
|
+
export { isManturStripePaymentWindowMessage, MANTUR_STRIPE_PAYMENT_ROUTE, MANTUR_STRIPE_PAYMENT_WINDOW_MESSAGE_TYPE, postManturStripePaymentWindowMessage, resolveManturStripePaymentPageUrl, } from "./utils/stripe-payment-window";
|
|
9
|
+
export type { ManturStripePaymentWindowAction, ManturStripePaymentWindowMessage, } from "./utils/stripe-payment-window";
|
|
8
10
|
export type { ManturHeaderLabels, ManturHeaderProps, ManturHeaderUser, ManturPaymentMethod, ManturProfileValues, ManturRole, ManturTenant, ManturTenantAuthContext, ManturTenantContextDetail, ManturUserPoints, } from "./types";
|