react-easy-wall 1.1.13 → 1.1.15
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/dist/cjs/components/paywall/Paywall.js +3 -5
- package/dist/cjs/components/paywall/Paywall.js.map +1 -1
- package/dist/cjs/components/paywall/PaywallSubscription.js +1 -0
- package/dist/cjs/components/paywall/PaywallSubscription.js.map +1 -1
- package/dist/cjs/components/session/SessionProvider.js +7 -2
- package/dist/cjs/components/session/SessionProvider.js.map +1 -1
- package/dist/esm/components/paywall/Paywall.js +3 -5
- package/dist/esm/components/paywall/Paywall.js.map +1 -1
- package/dist/esm/components/paywall/PaywallSubscription.js +1 -0
- package/dist/esm/components/paywall/PaywallSubscription.js.map +1 -1
- package/dist/esm/components/session/SessionProvider.js +7 -2
- package/dist/esm/components/session/SessionProvider.js.map +1 -1
- package/dist/esm/types/components/paywall/Paywall.d.ts +2 -0
- package/dist/esm/types/components/paywall/PaywallRegister.d.ts +16 -0
- package/dist/esm/types/components/session/SessionProvider.d.ts +0 -2
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
5
4
|
var session_hooks = require('../session/session.hooks.js');
|
|
6
|
-
var PaywallSubscription = require('./PaywallSubscription.js');
|
|
7
5
|
|
|
8
|
-
const Paywall = ({ children, post, postTypeField, postType }) => {
|
|
6
|
+
const Paywall = ({ children, post, postTypeField, postType, PaywallSubscriptionComponent, PaywallRegisterComponent, }) => {
|
|
9
7
|
const { user, subscription } = session_hooks.useSession();
|
|
10
8
|
const postTypeValue = post[postTypeField];
|
|
11
9
|
if (!subscription && post && postTypeValue && postTypeValue === postType) {
|
|
12
|
-
return
|
|
10
|
+
return PaywallSubscriptionComponent;
|
|
13
11
|
}
|
|
14
12
|
if (!user && post && postTypeValue && postTypeValue === postType) {
|
|
15
|
-
return
|
|
13
|
+
return PaywallRegisterComponent;
|
|
16
14
|
}
|
|
17
15
|
return children;
|
|
18
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paywall.js","sources":["../../../../src/components/paywall/Paywall.tsx"],"sourcesContent":["'use client';\nimport React from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"Paywall.js","sources":["../../../../src/components/paywall/Paywall.tsx"],"sourcesContent":["'use client';\nimport React from 'react';\nimport { useSession } from '../session/session.hooks';\nimport { PaywallSubscription } from './PaywallSubscription';\n\nexport interface PaywallProps {\n children?: React.ReactNode;\n PaywallSubscriptionComponent?: React.ReactNode;\n PaywallRegisterComponent?: React.ReactNode;\n post?: any;\n postTypeField?: string;\n postType?: string;\n}\n\nexport const Paywall: React.FC<PaywallProps> = ({\n children,\n post,\n postTypeField,\n postType,\n PaywallSubscriptionComponent,\n PaywallRegisterComponent,\n}) => {\n const { user, subscription } = useSession();\n const postTypeValue = post[postTypeField as string];\n if (!subscription && post && postTypeValue && postTypeValue === postType) {\n return PaywallSubscriptionComponent;\n }\n\n if (!user && post && postTypeValue && postTypeValue === postType) {\n return PaywallRegisterComponent;\n }\n\n return children;\n};\n"],"names":[],"mappings":";;;;;AAcO;;AASL;;AAEE;;;AAIA;;AAGF;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaywallSubscription.js","sources":["../../../../src/components/paywall/PaywallSubscription.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"PaywallSubscription.js","sources":["../../../../src/components/paywall/PaywallSubscription.tsx"],"sourcesContent":["'use client'\nimport React from 'react';\nimport { Box, BoxProps, Typography, TypographyProps, ButtonProps, Button } from '@mui/material';\nimport { PAYWALL_AUTH_ENDPOINT } from './paywall.constants';\n\nexport interface PaywallSubscriptionProps {\n post?: any;\n containerProps?: BoxProps;\n titleProps?: TypographyProps;\n subtitleProps?: TypographyProps;\n buttonProps?: ButtonProps;\n buttonText?: string;\n secondaryButtonProps?: ButtonProps;\n secondaryButtonText?: string;\n title?: string;\n subtitle?: string;\n withCaption?: boolean;\n}\n\nexport const PaywallSubscription: React.FC<PaywallSubscriptionProps> = ({\n containerProps = {},\n subtitleProps = {},\n buttonProps = {},\n titleProps = {},\n secondaryButtonText = 'Ya soy suscriptor',\n secondaryButtonProps = {},\n withCaption = false,\n title = 'Este artículo es exclusivo para suscriptores',\n subtitle = 'Tu contribución nos ayuda a cubrir costos de investigación, tecnología y ofrecerte servicios de valor agregado.',\n post,\n buttonText = 'Suscríbete',\n}) => {\n const { sx: sxContainerProps, ...containerPropRest } = containerProps;\n const { sx: sxSubtitleProps, ...subtitlePropRest } = subtitleProps;\n const { sx: sxTitleProps, ...titlePropRest } = titleProps;\n const { sx: sxButtonProps, ...buttonPropsRest } = buttonProps;\n const { sx: sxSecondaryButtonProps, ...secondaryButtonPropsRest } = secondaryButtonProps;\n\n const handleButton = () => {\n if (!PAYWALL_AUTH_ENDPOINT) {\n console.error('PAYWALL_AUTH_ENDPOINT is required!');\n return null;\n }\n\n return (window.location.href = `${PAYWALL_AUTH_ENDPOINT}/planes?post_url=${window.location.href}`);\n };\n\n const handleSecondaryButton = () => {\n if (!PAYWALL_AUTH_ENDPOINT) {\n console.error('PAYWALL_AUTH_ENDPOINT is required!');\n return null;\n }\n\n return (window.location.href = `${PAYWALL_AUTH_ENDPOINT}/autenticacion?action=AUTH_LOGIN?post_url=${window.location.href}`);\n };\n\n return (\n <Box\n sx={{\n display: 'flex',\n width: '100%',\n border: '1px solid #707070',\n justifyContent: 'center',\n alignItems: 'center',\n flexDirection: 'column',\n background: 'white',\n paddingTop: '80px',\n paddingBottom: '80px',\n borderRadius: '20px',\n boxShadow: '0px 0px 32px #00000029',\n ...sxContainerProps,\n }}\n {...containerPropRest}>\n <Box\n sx={{\n width: {\n xs: 360,\n md: 460,\n },\n justifyContent: 'center',\n alignItems: 'center',\n flexDirection: 'column',\n display: 'flex',\n }}>\n <Typography\n sx={{\n fontWeight: 700,\n lineHeight: '34px',\n fontSize: '34px',\n textAlign: 'center',\n marginBottom: '1.5rem',\n ...sxTitleProps,\n }}\n {...titlePropRest}>\n {title}\n </Typography>\n <Typography\n sx={{ textAlign: 'center', marginBottom: '1.5rem', ...sxSubtitleProps }}\n {...subtitlePropRest}>\n {subtitle}\n </Typography>\n <Button\n disableElevation\n disableRipple\n disableTouchRipple\n disableFocusRipple\n sx={{\n background: '#f75957',\n '&:hover': {\n backgroundColor: '#f75957',\n },\n fontWeight: 700,\n textTransform: 'uppercase',\n marginBottom: '.5rem',\n color: 'white',\n fontSize: '18px',\n paddingTop: '.5rem',\n paddingBottom: '.5rem',\n paddingLeft: '.75rem',\n paddingRight: '.75rem',\n borderRadius: '0.25rem',\n ...sxButtonProps,\n }}\n onClick={() => handleButton()}\n {...buttonPropsRest}>\n {buttonText}\n </Button>\n <Button\n disableElevation\n disableRipple\n disableTouchRipple\n disableFocusRipple\n sx={{\n textDecoration: 'underline',\n background: 'transparent',\n textTransform: 'none',\n fontWeight: 700,\n textAlign: 'center',\n fontSize: '16px',\n paddingTop: '.5rem',\n paddingBottom: '.5rem',\n paddingLeft: '.75rem',\n paddingRight: '.75rem',\n color: 'black',\n ...sxSecondaryButtonProps,\n }}\n onClick={() => handleSecondaryButton()}\n {...secondaryButtonPropsRest}>\n {secondaryButtonText}\n </Button>\n </Box>\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAwCM;AACA;;AAGF;AACF;;;AAII;AACA;;AAGF;AACF;AAEA;AAGM;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACD;AAIG;AACE;AACA;AACD;AACD;AACA;AACA;AACA;AACD;AAGG;AACA;AACA;AACA;AACA;AACA;AACD;AAeC;AACA;AACE;AACD;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACD;AAQX;;"}
|
|
@@ -5,9 +5,14 @@ var SessionUserProvider = require('./SessionUserProvider.js');
|
|
|
5
5
|
var session_server_actions = require('./session.server.actions.js');
|
|
6
6
|
var appRouterV13 = require('../../node_modules/@mui/material-nextjs/esm/v13-appRouter/appRouterV13.js');
|
|
7
7
|
|
|
8
|
-
const SessionProvider = async ({ children
|
|
8
|
+
const SessionProvider = async ({ children }) => {
|
|
9
|
+
const config = {
|
|
10
|
+
uri: process.env.NEXT_PUBLIC_URI || '',
|
|
11
|
+
urlPortal: process.env.NEXT_PUBLIC_URL_PORTAL || '',
|
|
12
|
+
cookieTokenName: process.env.NEXT_PUBLIC_COOKIE_TOKEN_NAME || '',
|
|
13
|
+
cookieDomain: process.env.NEXT_PUBLIC_COOKIE_DOMAIN || '',
|
|
14
|
+
};
|
|
9
15
|
const user = await session_server_actions.getUserServer(config);
|
|
10
|
-
console.log({ user });
|
|
11
16
|
return (jsxRuntime.jsx(appRouterV13.default, { children: jsxRuntime.jsx(SessionUserProvider.SessionUserProvider, { initial: user, config: config, children: children }) }));
|
|
12
17
|
};
|
|
13
18
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionProvider.js","sources":["../../../../src/components/session/SessionProvider.tsx"],"sourcesContent":["import React from 'react';\nimport { Config } from '../../config/config.types';\nimport { SessionUserProvider } from './SessionUserProvider';\nimport { AppRouterCacheProvider } from '@mui/material-nextjs/v15-appRouter';\nimport { getUserServer } from './session.server.actions';\n\ntype SessionProviderProps = {\n children: React.ReactNode;\n
|
|
1
|
+
{"version":3,"file":"SessionProvider.js","sources":["../../../../src/components/session/SessionProvider.tsx"],"sourcesContent":["import React from 'react';\nimport { Config } from '../../config/config.types';\nimport { SessionUserProvider } from './SessionUserProvider';\nimport { AppRouterCacheProvider } from '@mui/material-nextjs/v15-appRouter';\nimport { getUserServer } from './session.server.actions';\n\ntype SessionProviderProps = {\n children: React.ReactNode;\n};\n\nexport const SessionProvider: React.FC<SessionProviderProps> = async ({ children }) => {\n const config: Config = {\n uri: process.env.NEXT_PUBLIC_URI || '',\n urlPortal: process.env.NEXT_PUBLIC_URL_PORTAL || '',\n cookieTokenName: process.env.NEXT_PUBLIC_COOKIE_TOKEN_NAME || '',\n cookieDomain: process.env.NEXT_PUBLIC_COOKIE_DOMAIN || '',\n };\n const user = await getUserServer(config);\n\n return (\n <AppRouterCacheProvider>\n <SessionUserProvider initial={user} config={config}>\n {children}\n </SessionUserProvider>\n </AppRouterCacheProvider>\n );\n};\n"],"names":["getUserServer","_jsx","AppRouterCacheProvider","SessionUserProvider"],"mappings":";;;;;;;AAUO,MAAM,eAAe,GAAmC,OAAO,EAAE,QAAQ,EAAE,KAAI;AACpF,IAAA,MAAM,MAAM,GAAW;AACrB,QAAA,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE;AACtC,QAAA,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,EAAE;AACnD,QAAA,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,6BAA6B,IAAI,EAAE;AAChE,QAAA,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,EAAE;KAC1D;AACD,IAAA,MAAM,IAAI,GAAG,MAAMA,oCAAa,CAAC,MAAM,CAAC;AAExC,IAAA,QACEC,cAAA,CAACC,oBAAsB,cACrBD,cAAA,CAACE,uCAAmB,IAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAA,QAAA,EAC/C,QAAQ,EAAA,CACW,EAAA,CACC;AAE7B;;;;"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { useSession } from '../session/session.hooks.js';
|
|
4
|
-
import { PaywallSubscription } from './PaywallSubscription.js';
|
|
5
3
|
|
|
6
|
-
const Paywall = ({ children, post, postTypeField, postType }) => {
|
|
4
|
+
const Paywall = ({ children, post, postTypeField, postType, PaywallSubscriptionComponent, PaywallRegisterComponent, }) => {
|
|
7
5
|
const { user, subscription } = useSession();
|
|
8
6
|
const postTypeValue = post[postTypeField];
|
|
9
7
|
if (!subscription && post && postTypeValue && postTypeValue === postType) {
|
|
10
|
-
return
|
|
8
|
+
return PaywallSubscriptionComponent;
|
|
11
9
|
}
|
|
12
10
|
if (!user && post && postTypeValue && postTypeValue === postType) {
|
|
13
|
-
return
|
|
11
|
+
return PaywallRegisterComponent;
|
|
14
12
|
}
|
|
15
13
|
return children;
|
|
16
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paywall.js","sources":["../../../../src/components/paywall/Paywall.tsx"],"sourcesContent":["'use client';\nimport React from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"Paywall.js","sources":["../../../../src/components/paywall/Paywall.tsx"],"sourcesContent":["'use client';\nimport React from 'react';\nimport { useSession } from '../session/session.hooks';\nimport { PaywallSubscription } from './PaywallSubscription';\n\nexport interface PaywallProps {\n children?: React.ReactNode;\n PaywallSubscriptionComponent?: React.ReactNode;\n PaywallRegisterComponent?: React.ReactNode;\n post?: any;\n postTypeField?: string;\n postType?: string;\n}\n\nexport const Paywall: React.FC<PaywallProps> = ({\n children,\n post,\n postTypeField,\n postType,\n PaywallSubscriptionComponent,\n PaywallRegisterComponent,\n}) => {\n const { user, subscription } = useSession();\n const postTypeValue = post[postTypeField as string];\n if (!subscription && post && postTypeValue && postTypeValue === postType) {\n return PaywallSubscriptionComponent;\n }\n\n if (!user && post && postTypeValue && postTypeValue === postType) {\n return PaywallRegisterComponent;\n }\n\n return children;\n};\n"],"names":[],"mappings":";;;AAcO;;AASL;;AAEE;;;AAIA;;AAGF;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaywallSubscription.js","sources":["../../../../src/components/paywall/PaywallSubscription.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"PaywallSubscription.js","sources":["../../../../src/components/paywall/PaywallSubscription.tsx"],"sourcesContent":["'use client'\nimport React from 'react';\nimport { Box, BoxProps, Typography, TypographyProps, ButtonProps, Button } from '@mui/material';\nimport { PAYWALL_AUTH_ENDPOINT } from './paywall.constants';\n\nexport interface PaywallSubscriptionProps {\n post?: any;\n containerProps?: BoxProps;\n titleProps?: TypographyProps;\n subtitleProps?: TypographyProps;\n buttonProps?: ButtonProps;\n buttonText?: string;\n secondaryButtonProps?: ButtonProps;\n secondaryButtonText?: string;\n title?: string;\n subtitle?: string;\n withCaption?: boolean;\n}\n\nexport const PaywallSubscription: React.FC<PaywallSubscriptionProps> = ({\n containerProps = {},\n subtitleProps = {},\n buttonProps = {},\n titleProps = {},\n secondaryButtonText = 'Ya soy suscriptor',\n secondaryButtonProps = {},\n withCaption = false,\n title = 'Este artículo es exclusivo para suscriptores',\n subtitle = 'Tu contribución nos ayuda a cubrir costos de investigación, tecnología y ofrecerte servicios de valor agregado.',\n post,\n buttonText = 'Suscríbete',\n}) => {\n const { sx: sxContainerProps, ...containerPropRest } = containerProps;\n const { sx: sxSubtitleProps, ...subtitlePropRest } = subtitleProps;\n const { sx: sxTitleProps, ...titlePropRest } = titleProps;\n const { sx: sxButtonProps, ...buttonPropsRest } = buttonProps;\n const { sx: sxSecondaryButtonProps, ...secondaryButtonPropsRest } = secondaryButtonProps;\n\n const handleButton = () => {\n if (!PAYWALL_AUTH_ENDPOINT) {\n console.error('PAYWALL_AUTH_ENDPOINT is required!');\n return null;\n }\n\n return (window.location.href = `${PAYWALL_AUTH_ENDPOINT}/planes?post_url=${window.location.href}`);\n };\n\n const handleSecondaryButton = () => {\n if (!PAYWALL_AUTH_ENDPOINT) {\n console.error('PAYWALL_AUTH_ENDPOINT is required!');\n return null;\n }\n\n return (window.location.href = `${PAYWALL_AUTH_ENDPOINT}/autenticacion?action=AUTH_LOGIN?post_url=${window.location.href}`);\n };\n\n return (\n <Box\n sx={{\n display: 'flex',\n width: '100%',\n border: '1px solid #707070',\n justifyContent: 'center',\n alignItems: 'center',\n flexDirection: 'column',\n background: 'white',\n paddingTop: '80px',\n paddingBottom: '80px',\n borderRadius: '20px',\n boxShadow: '0px 0px 32px #00000029',\n ...sxContainerProps,\n }}\n {...containerPropRest}>\n <Box\n sx={{\n width: {\n xs: 360,\n md: 460,\n },\n justifyContent: 'center',\n alignItems: 'center',\n flexDirection: 'column',\n display: 'flex',\n }}>\n <Typography\n sx={{\n fontWeight: 700,\n lineHeight: '34px',\n fontSize: '34px',\n textAlign: 'center',\n marginBottom: '1.5rem',\n ...sxTitleProps,\n }}\n {...titlePropRest}>\n {title}\n </Typography>\n <Typography\n sx={{ textAlign: 'center', marginBottom: '1.5rem', ...sxSubtitleProps }}\n {...subtitlePropRest}>\n {subtitle}\n </Typography>\n <Button\n disableElevation\n disableRipple\n disableTouchRipple\n disableFocusRipple\n sx={{\n background: '#f75957',\n '&:hover': {\n backgroundColor: '#f75957',\n },\n fontWeight: 700,\n textTransform: 'uppercase',\n marginBottom: '.5rem',\n color: 'white',\n fontSize: '18px',\n paddingTop: '.5rem',\n paddingBottom: '.5rem',\n paddingLeft: '.75rem',\n paddingRight: '.75rem',\n borderRadius: '0.25rem',\n ...sxButtonProps,\n }}\n onClick={() => handleButton()}\n {...buttonPropsRest}>\n {buttonText}\n </Button>\n <Button\n disableElevation\n disableRipple\n disableTouchRipple\n disableFocusRipple\n sx={{\n textDecoration: 'underline',\n background: 'transparent',\n textTransform: 'none',\n fontWeight: 700,\n textAlign: 'center',\n fontSize: '16px',\n paddingTop: '.5rem',\n paddingBottom: '.5rem',\n paddingLeft: '.75rem',\n paddingRight: '.75rem',\n color: 'black',\n ...sxSecondaryButtonProps,\n }}\n onClick={() => handleSecondaryButton()}\n {...secondaryButtonPropsRest}>\n {secondaryButtonText}\n </Button>\n </Box>\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAwCM;AACA;;AAGF;AACF;;;AAII;AACA;;AAGF;AACF;AAEA;AAGM;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACD;AAIG;AACE;AACA;AACD;AACD;AACA;AACA;AACA;AACD;AAGG;AACA;AACA;AACA;AACA;AACA;AACD;AAeC;AACA;AACE;AACD;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACD;AAQX;;"}
|
|
@@ -3,9 +3,14 @@ import { SessionUserProvider } from './SessionUserProvider.js';
|
|
|
3
3
|
import { getUserServer } from './session.server.actions.js';
|
|
4
4
|
import AppRouterCacheProvider from '../../node_modules/@mui/material-nextjs/esm/v13-appRouter/appRouterV13.js';
|
|
5
5
|
|
|
6
|
-
const SessionProvider = async ({ children
|
|
6
|
+
const SessionProvider = async ({ children }) => {
|
|
7
|
+
const config = {
|
|
8
|
+
uri: process.env.NEXT_PUBLIC_URI || '',
|
|
9
|
+
urlPortal: process.env.NEXT_PUBLIC_URL_PORTAL || '',
|
|
10
|
+
cookieTokenName: process.env.NEXT_PUBLIC_COOKIE_TOKEN_NAME || '',
|
|
11
|
+
cookieDomain: process.env.NEXT_PUBLIC_COOKIE_DOMAIN || '',
|
|
12
|
+
};
|
|
7
13
|
const user = await getUserServer(config);
|
|
8
|
-
console.log({ user });
|
|
9
14
|
return (jsx(AppRouterCacheProvider, { children: jsx(SessionUserProvider, { initial: user, config: config, children: children }) }));
|
|
10
15
|
};
|
|
11
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionProvider.js","sources":["../../../../src/components/session/SessionProvider.tsx"],"sourcesContent":["import React from 'react';\nimport { Config } from '../../config/config.types';\nimport { SessionUserProvider } from './SessionUserProvider';\nimport { AppRouterCacheProvider } from '@mui/material-nextjs/v15-appRouter';\nimport { getUserServer } from './session.server.actions';\n\ntype SessionProviderProps = {\n children: React.ReactNode;\n
|
|
1
|
+
{"version":3,"file":"SessionProvider.js","sources":["../../../../src/components/session/SessionProvider.tsx"],"sourcesContent":["import React from 'react';\nimport { Config } from '../../config/config.types';\nimport { SessionUserProvider } from './SessionUserProvider';\nimport { AppRouterCacheProvider } from '@mui/material-nextjs/v15-appRouter';\nimport { getUserServer } from './session.server.actions';\n\ntype SessionProviderProps = {\n children: React.ReactNode;\n};\n\nexport const SessionProvider: React.FC<SessionProviderProps> = async ({ children }) => {\n const config: Config = {\n uri: process.env.NEXT_PUBLIC_URI || '',\n urlPortal: process.env.NEXT_PUBLIC_URL_PORTAL || '',\n cookieTokenName: process.env.NEXT_PUBLIC_COOKIE_TOKEN_NAME || '',\n cookieDomain: process.env.NEXT_PUBLIC_COOKIE_DOMAIN || '',\n };\n const user = await getUserServer(config);\n\n return (\n <AppRouterCacheProvider>\n <SessionUserProvider initial={user} config={config}>\n {children}\n </SessionUserProvider>\n </AppRouterCacheProvider>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;AAUO,MAAM,eAAe,GAAmC,OAAO,EAAE,QAAQ,EAAE,KAAI;AACpF,IAAA,MAAM,MAAM,GAAW;AACrB,QAAA,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE;AACtC,QAAA,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,EAAE;AACnD,QAAA,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,6BAA6B,IAAI,EAAE;AAChE,QAAA,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,EAAE;KAC1D;AACD,IAAA,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC;AAExC,IAAA,QACEA,GAAA,CAAC,sBAAsB,cACrBA,GAAA,CAAC,mBAAmB,IAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAA,QAAA,EAC/C,QAAQ,EAAA,CACW,EAAA,CACC;AAE7B;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BoxProps, TypographyProps, ButtonProps } from '@mui/material';
|
|
3
|
+
export interface PaywallRegisterProps {
|
|
4
|
+
post?: any;
|
|
5
|
+
containerProps?: BoxProps;
|
|
6
|
+
titleProps?: TypographyProps;
|
|
7
|
+
subtitleProps?: TypographyProps;
|
|
8
|
+
buttonProps?: ButtonProps;
|
|
9
|
+
buttonText?: string;
|
|
10
|
+
secondaryButtonProps?: ButtonProps;
|
|
11
|
+
secondaryButtonText?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
subtitle?: string;
|
|
14
|
+
withCaption?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const PaywallRegister: React.FC<PaywallRegisterProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -92,7 +92,6 @@ declare const handleLogout: (config: Config | undefined) => void;
|
|
|
92
92
|
|
|
93
93
|
type SessionProviderProps = {
|
|
94
94
|
children: React.ReactNode;
|
|
95
|
-
config: Config;
|
|
96
95
|
};
|
|
97
96
|
declare const SessionProvider: React.FC<SessionProviderProps>;
|
|
98
97
|
|
|
@@ -115,6 +114,8 @@ declare const PAYWALL_AUTH_ENDPOINT: string;
|
|
|
115
114
|
|
|
116
115
|
interface PaywallProps {
|
|
117
116
|
children?: React.ReactNode;
|
|
117
|
+
PaywallSubscriptionComponent?: React.ReactNode;
|
|
118
|
+
PaywallRegisterComponent?: React.ReactNode;
|
|
118
119
|
post?: any;
|
|
119
120
|
postTypeField?: string;
|
|
120
121
|
postType?: string;
|