@wopr-network/platform-ui-core 1.1.11 → 1.1.13

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.1.11",
3
+ "version": "1.1.13",
4
4
  "description": "Brand-agnostic AI agent platform UI — deploy as any brand via env vars",
5
5
  "repository": {
6
6
  "type": "git",
@@ -658,7 +658,7 @@ describe("CSP nonce in middleware", () => {
658
658
  const res = await middleware(req);
659
659
  const csp = res.headers.get("content-security-policy") ?? "";
660
660
  expect(csp).toContain("default-src 'self'");
661
- expect(csp).toMatch(/style-src-elem 'self' 'nonce-[A-Za-z0-9+/=_-]+'/);
661
+ expect(csp).toMatch(/style-src-elem 'self' 'unsafe-inline' 'nonce-[A-Za-z0-9+/=_-]+'/);
662
662
 
663
663
  expect(csp).toContain("img-src 'self' data: blob:");
664
664
  expect(csp).toContain("frame-src https://js.stripe.com");
@@ -706,10 +706,10 @@ describe("CSP style-src directive", () => {
706
706
  });
707
707
  const res = await middleware(req);
708
708
  const csp = res.headers.get("content-security-policy") ?? "";
709
- // Must contain nonce in style-src-elem (split from style-src for finer-grained control)
710
- expect(csp).toMatch(/style-src-elem 'self' 'nonce-[A-Za-z0-9+/=_-]+'/);
711
- // Must NOT contain unsafe-inline in style-src-elem
712
- expect(csp).not.toContain("style-src-elem 'self' 'unsafe-inline'");
709
+ // Must contain nonce + unsafe-inline in style-src-elem
710
+ // (unsafe-inline needed for framer-motion dynamic style injection)
711
+ expect(csp).toMatch(/style-src-elem 'self' 'unsafe-inline' 'nonce-[A-Za-z0-9+/=_-]+'/);
712
+ expect(csp).toContain("style-src-attr 'unsafe-inline'");
713
713
  });
714
714
  });
715
715
 
@@ -40,7 +40,9 @@ function CreditsContent() {
40
40
  useEffect(() => {
41
41
  getOrganization()
42
42
  .then((org) => {
43
- const currentMember = org.members.find((m) => m.email === session?.user?.email);
43
+ const currentMember = org.members.find(
44
+ (m) => m.userId === session?.user?.id || (m.email && m.email === session?.user?.email),
45
+ );
44
46
  setOrgContext({
45
47
  orgId: org.id,
46
48
  orgName: org.name,
@@ -51,7 +53,7 @@ function CreditsContent() {
51
53
  // No org — show personal billing
52
54
  })
53
55
  .finally(() => setOrgChecked(true));
54
- }, [session?.user?.email]);
56
+ }, [session?.user?.email, session?.user?.id]);
55
57
 
56
58
  const [showCryptoPending, setShowCryptoPending] = useState(cryptoPending);
57
59
  const [dividendStats, setDividendStats] = useState<DividendWalletStats | null>(null);
@@ -5,6 +5,7 @@ import { Building2, Download } from "lucide-react";
5
5
  import { useCallback, useEffect, useState } from "react";
6
6
  import { AddPaymentMethodDialog } from "@/components/billing/add-payment-method-dialog";
7
7
  import { BuyCreditsPanel } from "@/components/billing/buy-credits-panel";
8
+ import { BuyCryptoCreditPanel } from "@/components/billing/buy-crypto-credits-panel";
8
9
  import { CreditBalance } from "@/components/billing/credit-balance";
9
10
  import { Badge } from "@/components/ui/badge";
10
11
  import { Button } from "@/components/ui/button";
@@ -157,6 +158,9 @@ export function OrgBillingPage({ orgId, orgName, isAdmin }: OrgBillingPageProps)
157
158
  transition={{ duration: 0.4, delay: sectionDelays.buyCredits, ease: "easeOut" }}
158
159
  >
159
160
  <BuyCreditsPanel />
161
+ <div className="mt-4">
162
+ <BuyCryptoCreditPanel />
163
+ </div>
160
164
  </motion.div>
161
165
  )}
162
166
 
package/src/proxy.ts CHANGED
@@ -31,7 +31,7 @@ function buildCsp(nonce: string, requestUrl?: string): string {
31
31
  "default-src 'self'",
32
32
  `script-src 'self' 'nonce-${nonce}' 'strict-dynamic' https://js.stripe.com`,
33
33
  ...(NONCE_STYLES_ENABLED
34
- ? [`style-src-elem 'self' 'nonce-${nonce}'`, "style-src-attr 'unsafe-inline'"]
34
+ ? [`style-src-elem 'self' 'unsafe-inline' 'nonce-${nonce}'`, "style-src-attr 'unsafe-inline'"]
35
35
  : ["style-src 'self' 'unsafe-inline'"]),
36
36
  "img-src 'self' data: blob:",
37
37
  "font-src 'self'",