@windrun-huaiin/third-ui 7.3.3 → 7.3.5

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.
Files changed (30) hide show
  1. package/dist/clerk/fingerprint/fingerprint-provider.js +26 -6
  2. package/dist/clerk/fingerprint/fingerprint-provider.mjs +27 -7
  3. package/dist/clerk/fingerprint/use-fingerprint.js +1 -1
  4. package/dist/clerk/fingerprint/use-fingerprint.mjs +1 -1
  5. package/dist/main/faq.js +0 -2
  6. package/dist/main/faq.mjs +0 -2
  7. package/dist/main/gallery.js +0 -2
  8. package/dist/main/gallery.mjs +0 -2
  9. package/dist/main/money-price/money-price-config-util.d.ts +7 -0
  10. package/dist/main/money-price/money-price-config-util.js +19 -0
  11. package/dist/main/money-price/money-price-config-util.mjs +16 -0
  12. package/dist/main/money-price/money-price-interactive.js +29 -50
  13. package/dist/main/money-price/money-price-interactive.mjs +28 -49
  14. package/dist/main/money-price/money-price-types.d.ts +1 -1
  15. package/dist/main/money-price/money-price.js +3 -23
  16. package/dist/main/money-price/money-price.mjs +2 -22
  17. package/dist/main/price-plan.js +0 -2
  18. package/dist/main/price-plan.mjs +0 -2
  19. package/dist/main/server.d.ts +1 -1
  20. package/dist/main/server.js +3 -4
  21. package/dist/main/server.mjs +1 -1
  22. package/package.json +1 -1
  23. package/src/clerk/fingerprint/fingerprint-provider.tsx +53 -20
  24. package/src/clerk/fingerprint/use-fingerprint.ts +1 -1
  25. package/src/main/money-price/money-price-config-util.ts +23 -0
  26. package/src/main/money-price/money-price-interactive.tsx +47 -64
  27. package/src/main/money-price/money-price-types.ts +1 -1
  28. package/src/main/money-price/money-price.tsx +5 -32
  29. package/src/main/server.ts +1 -2
  30. package/src/main/money-price/money-price-config.ts +0 -229
@@ -1,229 +0,0 @@
1
- /**
2
- * Money Price Configuration
3
- * 价格组件配置文件
4
- */
5
-
6
- import type { MoneyPriceConfig, PaymentProviderConfig, EnhancePricePlan } from './money-price-types';
7
-
8
- // 示例配置
9
- export const moneyPriceConfig: MoneyPriceConfig = {
10
- paymentProviders: {
11
- stripe: {
12
- provider: 'stripe',
13
- enabled: true,
14
- products: {
15
- free: {
16
- key: 'free',
17
- name: 'free', // Just a key, actual display name comes from translation
18
- plans: {
19
- monthly: {
20
- priceId: 'free',
21
- amount: 0,
22
- currency: 'usd',
23
- credits: 0
24
- },
25
- yearly: {
26
- priceId: 'free',
27
- amount: 0,
28
- currency: 'usd',
29
- credits: 0
30
- }
31
- }
32
- },
33
- pro: {
34
- key: 'pro',
35
- name: 'pro', // Just a key, actual display name comes from translation
36
- plans: {
37
- monthly: {
38
- priceId: process.env.NEXT_PUBLIC_STRIPE_PRO_MONTHLY_PRICE_ID || 'price_pro_monthly',
39
- amount: Number(process.env.NEXT_PUBLIC_STRIPE_PRO_MONTHLY_AMOUNT) || 10,
40
- currency: process.env.NEXT_PUBLIC_STRIPE_PRO_MONTHLY_CURRENCY || 'usd',
41
- credits: Number(process.env.NEXT_PUBLIC_STRIPE_PRO_MONTHLY_CREDITS) || 100
42
- },
43
- yearly: {
44
- priceId: process.env.NEXT_PUBLIC_STRIPE_PRO_YEARLY_PRICE_ID || 'price_pro_yearly',
45
- amount: Number(process.env.NEXT_PUBLIC_STRIPE_PRO_YEARLY_AMOUNT) || 96,
46
- originalAmount: 120,
47
- discountPercent: 20,
48
- currency: process.env.NEXT_PUBLIC_STRIPE_PRO_YEARLY_CURRENCY || 'usd',
49
- credits: Number(process.env.NEXT_PUBLIC_STRIPE_PRO_YEARLY_CREDITS) || 1200
50
- }
51
- }
52
- },
53
- ultra: {
54
- key: 'ultra',
55
- name: 'ultra', // Just a key, actual display name comes from translation
56
- plans: {
57
- monthly: {
58
- priceId: process.env.NEXT_PUBLIC_STRIPE_ULTRA_MONTHLY_PRICE_ID || 'price_ultra_monthly',
59
- amount: Number(process.env.NEXT_PUBLIC_STRIPE_ULTRA_MONTHLY_AMOUNT) || 20,
60
- currency: process.env.NEXT_PUBLIC_STRIPE_ULTRA_MONTHLY_CURRENCY || 'usd',
61
- credits: Number(process.env.NEXT_PUBLIC_STRIPE_ULTRA_MONTHLY_CREDITS) || 250
62
- },
63
- yearly: {
64
- priceId: process.env.NEXT_PUBLIC_STRIPE_ULTRA_YEARLY_PRICE_ID || 'price_ultra_yearly',
65
- amount: Number(process.env.NEXT_PUBLIC_STRIPE_ULTRA_YEARLY_AMOUNT) || 192,
66
- originalAmount: 240,
67
- discountPercent: 20,
68
- currency: process.env.NEXT_PUBLIC_STRIPE_ULTRA_YEARLY_CURRENCY || 'usd',
69
- credits: Number(process.env.NEXT_PUBLIC_STRIPE_ULTRA_YEARLY_CREDITS) || 3000
70
- }
71
- }
72
- }
73
- }
74
- },
75
- alipay: {
76
- provider: 'alipay',
77
- enabled: false,
78
- products: {
79
- free: {
80
- key: 'free',
81
- name: 'free',
82
- plans: {
83
- monthly: {
84
- priceId: 'free',
85
- amount: 0,
86
- currency: 'cny',
87
- credits: 0
88
- },
89
- yearly: {
90
- priceId: 'free',
91
- amount: 0,
92
- currency: 'cny',
93
- credits: 0
94
- }
95
- }
96
- },
97
- pro: {
98
- key: 'pro',
99
- name: 'pro',
100
- plans: {
101
- monthly: {
102
- priceId: 'alipay_pro_monthly',
103
- amount: 70,
104
- currency: 'cny',
105
- credits: 100
106
- },
107
- yearly: {
108
- priceId: 'alipay_pro_yearly',
109
- amount: 672,
110
- originalAmount: 840,
111
- discountPercent: 20,
112
- currency: 'cny',
113
- credits: 1200
114
- }
115
- }
116
- },
117
- ultra: {
118
- key: 'ultra',
119
- name: 'ultra',
120
- plans: {
121
- monthly: {
122
- priceId: 'alipay_ultra_monthly',
123
- amount: 140,
124
- currency: 'cny',
125
- credits: 250
126
- },
127
- yearly: {
128
- priceId: 'alipay_ultra_yearly',
129
- amount: 1344,
130
- originalAmount: 1680,
131
- discountPercent: 20,
132
- currency: 'cny',
133
- credits: 3000
134
- }
135
- }
136
- }
137
- }
138
- },
139
- wechat: {
140
- provider: 'wechat',
141
- enabled: false,
142
- products: {
143
- free: {
144
- key: 'free',
145
- name: 'free',
146
- plans: {
147
- monthly: {
148
- priceId: 'free',
149
- amount: 0,
150
- currency: 'cny',
151
- credits: 0
152
- },
153
- yearly: {
154
- priceId: 'free',
155
- amount: 0,
156
- currency: 'cny',
157
- credits: 0
158
- }
159
- }
160
- },
161
- pro: {
162
- key: 'pro',
163
- name: 'pro',
164
- plans: {
165
- monthly: {
166
- priceId: 'wechat_pro_monthly',
167
- amount: 70,
168
- currency: 'cny',
169
- credits: 100
170
- },
171
- yearly: {
172
- priceId: 'wechat_pro_yearly',
173
- amount: 672,
174
- originalAmount: 840,
175
- discountPercent: 20,
176
- currency: 'cny',
177
- credits: 1200
178
- }
179
- }
180
- },
181
- ultra: {
182
- key: 'ultra',
183
- name: 'ultra',
184
- plans: {
185
- monthly: {
186
- priceId: 'wechat_ultra_monthly',
187
- amount: 140,
188
- currency: 'cny',
189
- credits: 250
190
- },
191
- yearly: {
192
- priceId: 'wechat_ultra_yearly',
193
- amount: 1344,
194
- originalAmount: 1680,
195
- discountPercent: 20,
196
- currency: 'cny',
197
- credits: 3000
198
- }
199
- }
200
- }
201
- }
202
- }
203
- },
204
-
205
- activeProvider: process.env.NEXT_PUBLIC_ACTIVE_PAYMENT_PROVIDER || 'stripe',
206
-
207
- display: {
208
- currency: '$',
209
- locale: 'en',
210
- minFeaturesCount: 4
211
- }
212
- };
213
-
214
- // 辅助函数:获取当前激活的支付供应商配置
215
- export function getActiveProviderConfig(config: MoneyPriceConfig): PaymentProviderConfig {
216
- const provider = config.activeProvider;
217
- return config.paymentProviders[provider];
218
- }
219
-
220
- // 辅助函数:获取特定产品的价格信息
221
- export function getProductPricing(
222
- productKey: 'free' | 'pro' | 'ultra',
223
- billingType: 'monthly' | 'yearly',
224
- provider: string,
225
- config: MoneyPriceConfig
226
- ): EnhancePricePlan {
227
- const providerConfig = config.paymentProviders[provider];
228
- return providerConfig.products[productKey].plans[billingType];
229
- }