@kernhq/module-billing 0.5.1 → 0.5.2
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/package.json +1 -1
- package/src/client/admin/PlansAdmin.svelte +16 -1
- package/src/client/i18n.ts +15 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kernhq/module-billing",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Kern billing module: plans, entitlements, subscriptions and Stripe — the mechanism that lets any Kern instance sell seats on itself",
|
|
5
5
|
"homepage": "https://github.com/KernAIO/module-billing#readme",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
@@ -59,6 +59,8 @@ interface Draft {
|
|
|
59
59
|
sso: boolean
|
|
60
60
|
auditDays: string
|
|
61
61
|
stripePriceId: string
|
|
62
|
+
/** One per line in the form; the row stores a list. */
|
|
63
|
+
highlights: string
|
|
62
64
|
order: string
|
|
63
65
|
published: boolean
|
|
64
66
|
}
|
|
@@ -77,6 +79,7 @@ const emptyDraft = (): Draft => ({
|
|
|
77
79
|
sso: true,
|
|
78
80
|
auditDays: '',
|
|
79
81
|
stripePriceId: '',
|
|
82
|
+
highlights: '',
|
|
80
83
|
order: '100',
|
|
81
84
|
published: false,
|
|
82
85
|
})
|
|
@@ -96,6 +99,7 @@ const toDraft = (p: Plan): Draft => ({
|
|
|
96
99
|
sso: p.limits.sso,
|
|
97
100
|
auditDays: p.limits.auditRetentionDays === null ? '' : String(p.limits.auditRetentionDays),
|
|
98
101
|
stripePriceId: p.stripePriceId ?? '',
|
|
102
|
+
highlights: p.highlights.join('\n'),
|
|
99
103
|
order: String(p.order),
|
|
100
104
|
published: p.published,
|
|
101
105
|
})
|
|
@@ -134,7 +138,12 @@ const save = createMutation(() => ({
|
|
|
134
138
|
apiRateLimit: null,
|
|
135
139
|
},
|
|
136
140
|
stripePriceId: d.stripePriceId.trim() || null,
|
|
137
|
-
|
|
141
|
+
// Used to be sent as `[]` on every save, so editing a plan's price wiped what the pricing
|
|
142
|
+
// page listed under it — and there was no field to put it back.
|
|
143
|
+
highlights: d.highlights
|
|
144
|
+
.split('\n')
|
|
145
|
+
.map((h) => h.trim())
|
|
146
|
+
.filter(Boolean),
|
|
138
147
|
published: d.published,
|
|
139
148
|
order: Number(d.order || 100),
|
|
140
149
|
}),
|
|
@@ -302,6 +311,12 @@ const intervalOptions = $derived([
|
|
|
302
311
|
{/snippet}
|
|
303
312
|
</Field>
|
|
304
313
|
|
|
314
|
+
<Field label={t('admin_plan_highlights')} hint={t('admin_plan_highlights_hint')}>
|
|
315
|
+
{#snippet children(id)}
|
|
316
|
+
<Textarea {id} bind:value={editing!.highlights} rows={4} />
|
|
317
|
+
{/snippet}
|
|
318
|
+
</Field>
|
|
319
|
+
|
|
305
320
|
<div class="grid gap-4 sm:grid-cols-3">
|
|
306
321
|
<Field label={t('admin_plan_price')} hint={t('admin_plan_price_hint')}>
|
|
307
322
|
{#snippet children(id)}
|
package/src/client/i18n.ts
CHANGED
|
@@ -45,6 +45,9 @@ export const en: Record<string, Message> = {
|
|
|
45
45
|
'billing.admin_plan_changed_toast': 'Plan changed',
|
|
46
46
|
'billing.admin_plan_currency': 'Currency',
|
|
47
47
|
'billing.admin_plan_description': 'Description',
|
|
48
|
+
'billing.admin_plan_highlights': 'Highlights',
|
|
49
|
+
'billing.admin_plan_highlights_hint':
|
|
50
|
+
'One per line. The pricing page lists them under the plan, so say only what the plan actually includes.',
|
|
48
51
|
'billing.admin_plan_draft': 'Draft',
|
|
49
52
|
'billing.admin_plan_edit': 'Edit',
|
|
50
53
|
'billing.admin_plan_interval': 'Billed',
|
|
@@ -203,6 +206,9 @@ const ar: Record<string, Message> = {
|
|
|
203
206
|
'billing.admin_plan_changed_toast': 'تغيّرت الخطة',
|
|
204
207
|
'billing.admin_plan_currency': 'العملة',
|
|
205
208
|
'billing.admin_plan_description': 'الوصف',
|
|
209
|
+
'billing.admin_plan_highlights': 'أبرز المزايا',
|
|
210
|
+
'billing.admin_plan_highlights_hint':
|
|
211
|
+
'ميزة واحدة في كل سطر. تعرضها صفحة الأسعار تحت الخطة، فاذكر فقط ما تتضمنه الخطة فعلاً.',
|
|
206
212
|
'billing.admin_plan_draft': 'مسودة',
|
|
207
213
|
'billing.admin_plan_edit': 'تحرير',
|
|
208
214
|
'billing.admin_plan_interval': 'دورة الفوترة',
|
|
@@ -357,6 +363,9 @@ const de: Record<string, Message> = {
|
|
|
357
363
|
'billing.admin_plan_changed_toast': 'Tarif geändert',
|
|
358
364
|
'billing.admin_plan_currency': 'Währung',
|
|
359
365
|
'billing.admin_plan_description': 'Beschreibung',
|
|
366
|
+
'billing.admin_plan_highlights': 'Leistungen',
|
|
367
|
+
'billing.admin_plan_highlights_hint':
|
|
368
|
+
'Eine pro Zeile. Die Preisseite listet sie unter dem Tarif auf – nennen Sie nur, was der Tarif tatsächlich enthält.',
|
|
360
369
|
'billing.admin_plan_draft': 'Entwurf',
|
|
361
370
|
'billing.admin_plan_edit': 'Bearbeiten',
|
|
362
371
|
'billing.admin_plan_interval': 'Abrechnung',
|
|
@@ -516,6 +525,9 @@ const fa: Record<string, Message> = {
|
|
|
516
525
|
'billing.admin_plan_changed_toast': 'طرح تغییر کرد',
|
|
517
526
|
'billing.admin_plan_currency': 'واحد پول',
|
|
518
527
|
'billing.admin_plan_description': 'توضیح',
|
|
528
|
+
'billing.admin_plan_highlights': 'ویژگیهای برجسته',
|
|
529
|
+
'billing.admin_plan_highlights_hint':
|
|
530
|
+
'هر کدام در یک خط. صفحهٔ قیمتها آنها را زیر طرح نشان میدهد، پس فقط چیزی را بنویسید که طرح واقعاً شامل آن است.',
|
|
519
531
|
'billing.admin_plan_draft': 'پیشنویس',
|
|
520
532
|
'billing.admin_plan_edit': 'ویرایش',
|
|
521
533
|
'billing.admin_plan_interval': 'دوره',
|
|
@@ -668,6 +680,9 @@ const tr: Record<string, Message> = {
|
|
|
668
680
|
'billing.admin_plan_changed_toast': 'Tarife değişti',
|
|
669
681
|
'billing.admin_plan_currency': 'Para birimi',
|
|
670
682
|
'billing.admin_plan_description': 'Açıklama',
|
|
683
|
+
'billing.admin_plan_highlights': 'Öne çıkanlar',
|
|
684
|
+
'billing.admin_plan_highlights_hint':
|
|
685
|
+
'Her satıra bir tane. Fiyat sayfası bunları planın altında listeler; yalnızca planın gerçekten içerdiklerini yazın.',
|
|
671
686
|
'billing.admin_plan_draft': 'Taslak',
|
|
672
687
|
'billing.admin_plan_edit': 'Düzenle',
|
|
673
688
|
'billing.admin_plan_interval': 'Faturalama',
|