@opexa/portal-components 0.0.159 → 0.0.160

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.
@@ -1,8 +1,10 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { notFound } from 'next/navigation';
3
+ import { DOMAIN } from '../../constants/index.js';
3
4
  import { getSession } from '../../server/services/getSession.js';
4
5
  import { prefetchBonusQuery } from '../../server/utils/prefetchBonusQuery.js';
5
6
  import { getBonus } from '../../services/wallet.js';
7
+ import { stripTags } from '../../utils/stripTags.js';
6
8
  import { Bonus__client } from './Bonus.client.js';
7
9
  async function fetchBonus(id) {
8
10
  const session = await getSession();
@@ -20,7 +22,7 @@ export async function Bonus(props) {
20
22
  prefetchBonusQuery(props.id),
21
23
  ]);
22
24
  if (result.status === 'fulfilled' && result.value) {
23
- return _jsx(Bonus__client, { ...props });
25
+ return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "og:title", content: result.value.promo.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "og:image", content: result.value.promo.banner.url }), _jsx("meta", { name: "twitter:title", content: result.value.promo.name }), _jsx("meta", { name: "twitter:description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "twitter:image", content: result.value.promo.banner.url }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:site", content: DOMAIN }), _jsx(Bonus__client, { ...props })] }));
24
26
  }
25
27
  else {
26
28
  return notFound();
@@ -1,7 +1,9 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { notFound } from 'next/navigation';
3
+ import { DOMAIN } from '../../constants/index.js';
3
4
  import { prefetchCashbackQuery } from '../../server/utils/prefetchCashbackQuery.js';
4
5
  import { getCashback } from '../../services/wallet.js';
6
+ import { stripTags } from '../../utils/stripTags.js';
5
7
  import { Cashback__client } from './Cashback.client.js';
6
8
  export async function Cashback(props) {
7
9
  const [result] = await Promise.allSettled([
@@ -9,7 +11,7 @@ export async function Cashback(props) {
9
11
  prefetchCashbackQuery(props.id),
10
12
  ]);
11
13
  if (result.status === 'fulfilled' && result.value) {
12
- return _jsx(Cashback__client, { ...props });
14
+ return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:title", content: result.value.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:title", content: result.value.name }), _jsx("meta", { name: "twitter:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "twitter:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:site", content: DOMAIN }), _jsx(Cashback__client, { ...props })] }));
13
15
  }
14
16
  else {
15
17
  return notFound();
@@ -1,11 +1,13 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import Image from 'next/image';
4
4
  import Link from 'next/link';
5
+ import { DOMAIN } from '../../constants/index.js';
5
6
  import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
6
7
  import { Prose } from '../../ui/Prose/index.js';
8
+ import { stripTags } from '../../utils/stripTags.js';
7
9
  export function CustomPromo(props) {
8
- return (_jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "text-button-tertiary-fg flex w-fit items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all Promotions"] }), _jsx(Image, { src: props.promo.banner, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-xl h-auto w-full rounded-xl lg:mt-6" }), _jsx("h1", { className: "mt-xl text-2xl font-semibold lg:mt-6 lg:text-3xl", children: props.promo.name }), _jsx(Prose, { className: "mt-2xl lg:mt-6", dangerouslySetInnerHTML: {
9
- __html: props.promo.description,
10
- } })] }));
10
+ return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "og:title", content: props.promo.name }), _jsx("meta", { name: "og:description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "og:image", content: props.promo.banner }), _jsx("meta", { name: "twitter:title", content: props.promo.name }), _jsx("meta", { name: "twitter:description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "twitter:image", content: props.promo.banner }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:site", content: DOMAIN }), _jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "text-button-tertiary-fg flex w-fit items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all Promotions"] }), _jsx(Image, { src: props.promo.banner, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-xl h-auto w-full rounded-xl lg:mt-6" }), _jsx("h1", { className: "mt-xl text-2xl font-semibold lg:mt-6 lg:text-3xl", children: props.promo.name }), _jsx(Prose, { className: "mt-2xl lg:mt-6", dangerouslySetInnerHTML: {
11
+ __html: props.promo.description,
12
+ } })] })] }));
11
13
  }
@@ -1,10 +1,12 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import Image from 'next/image';
3
3
  import Link from 'next/link';
4
+ import { DOMAIN } from '../../constants/index.js';
4
5
  import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
5
6
  import { Prose } from '../../ui/Prose/index.js';
7
+ import { stripTags } from '../../utils/stripTags.js';
6
8
  export function News(props) {
7
- return (_jsxs("div", { style: props.style, className: props.className, children: [_jsxs(Link, { href: props.viewAllUrl ?? '/news', className: "text-button-secondary-fg flex items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all News"] }), _jsx(Image, { src: props.news.image, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-3xl block h-auto w-full rounded-xl lg:mt-6" }), _jsx("p", { className: "text-brand-400 mt-xl text-sm font-semibold lg:mt-6", children: props.news.category }), _jsx("h2", { className: "mt-xl text-2xl font-semibold lg:mt-6", children: props.news.title }), _jsx(Prose, { className: "mt-xl lg:mt-6", dangerouslySetInnerHTML: {
8
- __html: props.news.content,
9
- } })] }));
9
+ return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(props.news.content) }), _jsx("meta", { name: "og:title", content: props.news.title }), _jsx("meta", { name: "og:description", content: stripTags(props.news.content) }), _jsx("meta", { name: "og:image", content: props.news.image }), _jsx("meta", { name: "twitter:title", content: props.news.title }), _jsx("meta", { name: "twitter:description", content: stripTags(props.news.content) }), _jsx("meta", { name: "twitter:image", content: props.news.image }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:site", content: DOMAIN }), _jsxs("div", { style: props.style, className: props.className, children: [_jsxs(Link, { href: props.viewAllUrl ?? '/news', className: "text-button-secondary-fg flex items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all News"] }), _jsx(Image, { src: props.news.image, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-3xl block h-auto w-full rounded-xl lg:mt-6" }), _jsx("p", { className: "text-brand-400 mt-xl text-sm font-semibold lg:mt-6", children: props.news.category }), _jsx("h2", { className: "mt-xl text-2xl font-semibold lg:mt-6", children: props.news.title }), _jsx(Prose, { className: "mt-xl lg:mt-6", dangerouslySetInnerHTML: {
10
+ __html: props.news.content,
11
+ } })] })] }));
10
12
  }
@@ -1,7 +1,9 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { notFound } from 'next/navigation';
3
+ import { DOMAIN } from '../../constants/index.js';
3
4
  import { prefetchPromoQuery } from '../../server/utils/prefetchPromoQuery.js';
4
5
  import { getPromo } from '../../services/wallet.js';
6
+ import { stripTags } from '../../utils/stripTags.js';
5
7
  import { Promo__client } from './Promo.client.js';
6
8
  export async function Promo(props) {
7
9
  const [result] = await Promise.allSettled([
@@ -9,7 +11,7 @@ export async function Promo(props) {
9
11
  prefetchPromoQuery(props.id),
10
12
  ]);
11
13
  if (result.status === 'fulfilled' && result.value) {
12
- return _jsx(Promo__client, { ...props });
14
+ return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:title", content: result.value.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:title", content: result.value.name }), _jsx("meta", { name: "twitter:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "twitter:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:site", content: DOMAIN }), _jsx(Promo__client, { ...props })] }));
13
15
  }
14
16
  else {
15
17
  return notFound();
@@ -0,0 +1 @@
1
+ export declare const stripTags: (html: string) => string;
@@ -0,0 +1,4 @@
1
+ import { cache } from 'react';
2
+ export const stripTags = cache((html) => {
3
+ return html.replace(/<[^>]+>/gi, '');
4
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.159",
3
+ "version": "0.0.160",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",
@@ -101,8 +101,8 @@
101
101
  "@hookform/resolvers": "5.1.1",
102
102
  "@opexa/object-id": "0.1.6",
103
103
  "@tailwindcss/postcss": "4",
104
- "@tanstack/react-query": "5.80.10",
105
- "@tanstack/react-query-devtools": "5.80.10",
104
+ "@tanstack/react-query": "5.81.2",
105
+ "@tanstack/react-query-devtools": "5.81.2",
106
106
  "@total-typescript/ts-reset": "0.6.1",
107
107
  "@types/lodash-es": "4.17.12",
108
108
  "@types/node": "24",