@wopr-network/platform-ui-core 1.27.5 → 1.27.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wopr-network/platform-ui-core",
3
- "version": "1.27.5",
3
+ "version": "1.27.6",
4
4
  "description": "Brand-agnostic AI agent platform UI — deploy as any brand via env vars",
5
5
  "repository": {
6
6
  "type": "git",
@@ -4,10 +4,11 @@ import { BuyCreditsPanel } from "@/components/billing/buy-credits-panel";
4
4
  import { CryptoCheckout } from "@/components/billing/crypto-checkout";
5
5
  import { Button } from "@/components/ui/button";
6
6
  import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
7
- import { productName } from "@/lib/brand-config";
7
+ import { getBrandConfig, productName } from "@/lib/brand-config";
8
8
  import { pricingData } from "@/lib/pricing-data";
9
9
 
10
10
  export default function PlansPage() {
11
+ const { planFeatures } = getBrandConfig();
11
12
  return (
12
13
  <div className="max-w-3xl space-y-6">
13
14
  <div>
@@ -30,12 +31,7 @@ export default function PlansPage() {
30
31
  </p>
31
32
  <p className="text-muted-foreground">per bot</p>
32
33
  <ul className="space-y-2 text-sm">
33
- {[
34
- `$${pricingData.signup_credit} signup credit included`,
35
- "All channels",
36
- "All plugins",
37
- "Hosted AI — no API keys needed",
38
- ].map((feature) => (
34
+ {planFeatures.map((feature) => (
39
35
  <li key={feature} className="flex items-center gap-2 text-muted-foreground">
40
36
  <Check className="size-4 shrink-0 text-terminal" />
41
37
  {feature}
@@ -93,6 +93,9 @@ export interface BrandConfig {
93
93
 
94
94
  /** Whether the embedded chat widget is enabled (default true). */
95
95
  chatEnabled: boolean;
96
+
97
+ /** Feature bullet points shown on the billing plans page. */
98
+ planFeatures: string[];
96
99
  }
97
100
 
98
101
  /**
@@ -129,6 +132,20 @@ function parseNavItems(raw: string | undefined): Array<{ label: string; href: st
129
132
  return null;
130
133
  }
131
134
 
135
+ /** Parse a JSON string array env var. Returns null if unset/invalid. */
136
+ function parseStringArray(raw: string | undefined): string[] | null {
137
+ if (!raw) return null;
138
+ try {
139
+ const parsed = JSON.parse(raw);
140
+ if (Array.isArray(parsed) && parsed.every((s: unknown) => typeof s === "string")) {
141
+ return parsed as string[];
142
+ }
143
+ } catch {
144
+ // Invalid JSON — fall back to defaults
145
+ }
146
+ return null;
147
+ }
148
+
132
149
  function envDefaults(): BrandConfig {
133
150
  // Direct process.env.X access is required — Next.js Turbopack only inlines
134
151
  // NEXT_PUBLIC_* vars when accessed as literal dot-property references.
@@ -158,6 +175,12 @@ function envDefaults(): BrandConfig {
158
175
  price: process.env.NEXT_PUBLIC_BRAND_PRICE || "",
159
176
  homePath: process.env.NEXT_PUBLIC_BRAND_HOME_PATH || "/marketplace",
160
177
  chatEnabled: process.env.NEXT_PUBLIC_BRAND_CHAT_ENABLED !== "false",
178
+ planFeatures: parseStringArray(process.env.NEXT_PUBLIC_BRAND_PLAN_FEATURES) ?? [
179
+ "Signup credit included",
180
+ "All channels",
181
+ "All plugins",
182
+ "Hosted AI — no API keys needed",
183
+ ],
161
184
  navItems: parseNavItems(process.env.NEXT_PUBLIC_BRAND_NAV_ITEMS) ?? [
162
185
  { label: "Dashboard", href: "/dashboard" },
163
186
  { label: "Chat", href: "/chat" },