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