react-easy-wall 1.1.18 → 1.1.20
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 -4
- package/dist/cjs/components/paywall/Paywall.js.map +1 -1
- package/dist/cjs/components/paywall/PaywallRegister.js +92 -0
- package/dist/cjs/components/paywall/PaywallRegister.js.map +1 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/paywall/Paywall.js +3 -4
- package/dist/esm/components/paywall/Paywall.js.map +1 -1
- package/dist/esm/components/paywall/PaywallRegister.js +90 -0
- package/dist/esm/components/paywall/PaywallRegister.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/paywall/Paywall.d.ts +2 -3
- package/dist/esm/types/components/paywall/index.d.ts +1 -0
- package/dist/index.d.ts +19 -5
- package/package.json +1 -1
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
var session_hooks = require('../session/session.hooks.js');
|
|
5
5
|
|
|
6
|
-
const Paywall = ({ children,
|
|
6
|
+
const Paywall = ({ children, PaywallSubscriptionComponent, PaywallRegisterComponent, postPremium = false, postRegister = false, }) => {
|
|
7
7
|
const { user, subscription } = session_hooks.useSession();
|
|
8
|
-
|
|
9
|
-
if (!subscription && post && postTypeValue && postTypeValue === postType) {
|
|
8
|
+
if (!subscription && postPremium) {
|
|
10
9
|
return PaywallSubscriptionComponent;
|
|
11
10
|
}
|
|
12
|
-
if (!user &&
|
|
11
|
+
if (!(user && postRegister)) {
|
|
13
12
|
return PaywallRegisterComponent;
|
|
14
13
|
}
|
|
15
14
|
return children;
|
|
@@ -1 +1 @@
|
|
|
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';\
|
|
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';\n\nexport interface PaywallProps {\n children?: React.ReactNode;\n PaywallSubscriptionComponent?: React.ReactNode;\n PaywallRegisterComponent?: React.ReactNode;\n postPremium?: boolean;\n postRegister?: boolean;\n}\n\nexport const Paywall: React.FC<PaywallProps> = ({\n children,\n PaywallSubscriptionComponent,\n PaywallRegisterComponent,\n postPremium = false,\n postRegister = false,\n}) => {\n const { user, subscription } = useSession();\n\n if (!subscription && postPremium) {\n return PaywallSubscriptionComponent;\n }\n\n if (!(user && postRegister)) {\n return PaywallRegisterComponent;\n }\n\n return children;\n};\n"],"names":[],"mappings":";;;;;;;AAqBE;AACE;;AAGF;AACE;;AAGF;AACF;;"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var Box = require('../../node_modules/@mui/material/esm/Box/Box.js');
|
|
6
|
+
var Typography = require('../../node_modules/@mui/material/esm/Typography/Typography.js');
|
|
7
|
+
var Button = require('../../node_modules/@mui/material/esm/Button/Button.js');
|
|
8
|
+
|
|
9
|
+
const PaywallRegister = ({ containerProps = {}, subtitleProps = {}, buttonProps = {}, titleProps = {}, secondaryButtonText = 'Ya estoy registrado', secondaryButtonProps = {}, title = 'Este artículo es exclusivo para usuarios registrados', subtitle = 'Regístrate para obtener beneficios exclusivos.', buttonText = '¡Regístrate gratis!', }) => {
|
|
10
|
+
const { sx: sxContainerProps, ...containerPropRest } = containerProps;
|
|
11
|
+
const { sx: sxSubtitleProps, ...subtitlePropRest } = subtitleProps;
|
|
12
|
+
const { sx: sxTitleProps, ...titlePropRest } = titleProps;
|
|
13
|
+
const { sx: sxButtonProps, ...buttonPropsRest } = buttonProps;
|
|
14
|
+
const { sx: sxSecondaryButtonProps, ...secondaryButtonPropsRest } = secondaryButtonProps;
|
|
15
|
+
const url = process.env.NEXT_PUBLIC_URL_PORTAL || '';
|
|
16
|
+
const handleButton = () => {
|
|
17
|
+
if (!url) {
|
|
18
|
+
console.error('NEXT_PUBLIC_URL_PORTAL is required!');
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return (window.location.href = `${url}/autenticacion?action=AUTH_REGISTER?post_url=${window.location.href}`);
|
|
22
|
+
};
|
|
23
|
+
const handleSecondaryButton = () => {
|
|
24
|
+
if (!url) {
|
|
25
|
+
console.error('NEXT_PUBLIC_URL_PORTAL is required!');
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return (window.location.href = `${url}/autenticacion?action=AUTH_LOGIN?post_url=${window.location.href}`);
|
|
29
|
+
};
|
|
30
|
+
return (jsxRuntime.jsx(Box.default, { sx: {
|
|
31
|
+
display: 'flex',
|
|
32
|
+
width: '100%',
|
|
33
|
+
border: '1px solid #707070',
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
flexDirection: 'column',
|
|
37
|
+
background: 'white',
|
|
38
|
+
paddingTop: '80px',
|
|
39
|
+
paddingBottom: '80px',
|
|
40
|
+
borderRadius: '20px',
|
|
41
|
+
boxShadow: '0px 0px 32px #00000029',
|
|
42
|
+
...sxContainerProps,
|
|
43
|
+
}, ...containerPropRest, children: jsxRuntime.jsxs(Box.default, { sx: {
|
|
44
|
+
width: {
|
|
45
|
+
xs: 360,
|
|
46
|
+
md: 460,
|
|
47
|
+
},
|
|
48
|
+
justifyContent: 'center',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
flexDirection: 'column',
|
|
51
|
+
display: 'flex',
|
|
52
|
+
}, children: [jsxRuntime.jsx(Typography.default, { sx: {
|
|
53
|
+
fontWeight: 700,
|
|
54
|
+
lineHeight: '34px',
|
|
55
|
+
fontSize: '34px',
|
|
56
|
+
textAlign: 'center',
|
|
57
|
+
marginBottom: '1.5rem',
|
|
58
|
+
...sxTitleProps,
|
|
59
|
+
}, ...titlePropRest, children: title }), jsxRuntime.jsx(Typography.default, { sx: { textAlign: 'center', marginBottom: '1.5rem', ...sxSubtitleProps }, ...subtitlePropRest, children: subtitle }), jsxRuntime.jsx(Button.default, { disableElevation: true, disableRipple: true, disableTouchRipple: true, disableFocusRipple: true, sx: {
|
|
60
|
+
background: '#f75957',
|
|
61
|
+
'&:hover': {
|
|
62
|
+
backgroundColor: '#f75957',
|
|
63
|
+
},
|
|
64
|
+
fontWeight: 700,
|
|
65
|
+
textTransform: 'uppercase',
|
|
66
|
+
marginBottom: '.5rem',
|
|
67
|
+
color: 'white',
|
|
68
|
+
fontSize: '18px',
|
|
69
|
+
paddingTop: '.5rem',
|
|
70
|
+
paddingBottom: '.5rem',
|
|
71
|
+
paddingLeft: '.75rem',
|
|
72
|
+
paddingRight: '.75rem',
|
|
73
|
+
borderRadius: '0.25rem',
|
|
74
|
+
...sxButtonProps,
|
|
75
|
+
}, onClick: () => handleButton(), ...buttonPropsRest, children: buttonText }), jsxRuntime.jsx(Button.default, { disableElevation: true, disableRipple: true, disableTouchRipple: true, disableFocusRipple: true, sx: {
|
|
76
|
+
textDecoration: 'underline',
|
|
77
|
+
background: 'transparent',
|
|
78
|
+
textTransform: 'none',
|
|
79
|
+
fontWeight: 700,
|
|
80
|
+
textAlign: 'center',
|
|
81
|
+
fontSize: '16px',
|
|
82
|
+
paddingTop: '.5rem',
|
|
83
|
+
paddingBottom: '.5rem',
|
|
84
|
+
paddingLeft: '.75rem',
|
|
85
|
+
paddingRight: '.75rem',
|
|
86
|
+
color: 'black',
|
|
87
|
+
...sxSecondaryButtonProps,
|
|
88
|
+
}, onClick: () => handleSecondaryButton(), ...secondaryButtonPropsRest, children: secondaryButtonText })] }) }));
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
exports.PaywallRegister = PaywallRegister;
|
|
92
|
+
//# sourceMappingURL=PaywallRegister.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaywallRegister.js","sources":["../../../../src/components/paywall/PaywallRegister.tsx"],"sourcesContent":["'use client';\nimport React from 'react';\nimport { Box, BoxProps, Typography, TypographyProps, ButtonProps, Button } from '@mui/material';\n\nexport interface PaywallRegisterProps {\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 PaywallRegister: React.FC<PaywallRegisterProps> = ({\n containerProps = {},\n subtitleProps = {},\n buttonProps = {},\n titleProps = {},\n secondaryButtonText = 'Ya estoy registrado',\n secondaryButtonProps = {},\n title = 'Este artículo es exclusivo para usuarios registrados',\n subtitle = 'Regístrate para obtener beneficios exclusivos.',\n buttonText = '¡Regístrate gratis!',\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 const url = process.env.NEXT_PUBLIC_URL_PORTAL || '';\n\n const handleButton = () => {\n if (!url) {\n console.error('NEXT_PUBLIC_URL_PORTAL is required!');\n return null;\n }\n\n return (window.location.href = `${url}/autenticacion?action=AUTH_REGISTER?post_url=${window.location.href}`);\n };\n\n const handleSecondaryButton = () => {\n if (!url) {\n console.error('NEXT_PUBLIC_URL_PORTAL is required!');\n return null;\n }\n\n return (window.location.href = `${url}/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":";;;;;;;;AAkBO;;;;;;;;;AAoBD;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;;"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -13,6 +13,7 @@ var panel_store = require('./components/panel/panel.store.js');
|
|
|
13
13
|
var panel_actions = require('./components/panel/panel.actions.js');
|
|
14
14
|
var SessionProvider = require('./components/session/SessionProvider.js');
|
|
15
15
|
var PaywallSubscription = require('./components/paywall/PaywallSubscription.js');
|
|
16
|
+
var PaywallRegister = require('./components/paywall/PaywallRegister.js');
|
|
16
17
|
var Paywall = require('./components/paywall/Paywall.js');
|
|
17
18
|
var index = require('./shared/constants/index.js');
|
|
18
19
|
|
|
@@ -33,6 +34,7 @@ exports.handlePanelClick = panel_actions.handlePanelClick;
|
|
|
33
34
|
exports.panelStoreAction = panel_actions.panelStoreAction;
|
|
34
35
|
exports.SessionProvider = SessionProvider.SessionProvider;
|
|
35
36
|
exports.PaywallSubscription = PaywallSubscription.PaywallSubscription;
|
|
37
|
+
exports.PaywallRegister = PaywallRegister.PaywallRegister;
|
|
36
38
|
exports.Paywall = Paywall.Paywall;
|
|
37
39
|
exports.COOKIE_DOMAIN = index.COOKIE_DOMAIN;
|
|
38
40
|
exports.COOKIE_TOKEN_NAME = index.COOKIE_TOKEN_NAME;
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useSession } from '../session/session.hooks.js';
|
|
3
3
|
|
|
4
|
-
const Paywall = ({ children,
|
|
4
|
+
const Paywall = ({ children, PaywallSubscriptionComponent, PaywallRegisterComponent, postPremium = false, postRegister = false, }) => {
|
|
5
5
|
const { user, subscription } = useSession();
|
|
6
|
-
|
|
7
|
-
if (!subscription && post && postTypeValue && postTypeValue === postType) {
|
|
6
|
+
if (!subscription && postPremium) {
|
|
8
7
|
return PaywallSubscriptionComponent;
|
|
9
8
|
}
|
|
10
|
-
if (!user &&
|
|
9
|
+
if (!(user && postRegister)) {
|
|
11
10
|
return PaywallRegisterComponent;
|
|
12
11
|
}
|
|
13
12
|
return children;
|
|
@@ -1 +1 @@
|
|
|
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';\
|
|
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';\n\nexport interface PaywallProps {\n children?: React.ReactNode;\n PaywallSubscriptionComponent?: React.ReactNode;\n PaywallRegisterComponent?: React.ReactNode;\n postPremium?: boolean;\n postRegister?: boolean;\n}\n\nexport const Paywall: React.FC<PaywallProps> = ({\n children,\n PaywallSubscriptionComponent,\n PaywallRegisterComponent,\n postPremium = false,\n postRegister = false,\n}) => {\n const { user, subscription } = useSession();\n\n if (!subscription && postPremium) {\n return PaywallSubscriptionComponent;\n }\n\n if (!(user && postRegister)) {\n return PaywallRegisterComponent;\n }\n\n return children;\n};\n"],"names":[],"mappings":";;;;;AAqBE;AACE;;AAGF;AACE;;AAGF;AACF;;"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import Box from '../../node_modules/@mui/material/esm/Box/Box.js';
|
|
4
|
+
import Typography from '../../node_modules/@mui/material/esm/Typography/Typography.js';
|
|
5
|
+
import Button from '../../node_modules/@mui/material/esm/Button/Button.js';
|
|
6
|
+
|
|
7
|
+
const PaywallRegister = ({ containerProps = {}, subtitleProps = {}, buttonProps = {}, titleProps = {}, secondaryButtonText = 'Ya estoy registrado', secondaryButtonProps = {}, title = 'Este artículo es exclusivo para usuarios registrados', subtitle = 'Regístrate para obtener beneficios exclusivos.', buttonText = '¡Regístrate gratis!', }) => {
|
|
8
|
+
const { sx: sxContainerProps, ...containerPropRest } = containerProps;
|
|
9
|
+
const { sx: sxSubtitleProps, ...subtitlePropRest } = subtitleProps;
|
|
10
|
+
const { sx: sxTitleProps, ...titlePropRest } = titleProps;
|
|
11
|
+
const { sx: sxButtonProps, ...buttonPropsRest } = buttonProps;
|
|
12
|
+
const { sx: sxSecondaryButtonProps, ...secondaryButtonPropsRest } = secondaryButtonProps;
|
|
13
|
+
const url = process.env.NEXT_PUBLIC_URL_PORTAL || '';
|
|
14
|
+
const handleButton = () => {
|
|
15
|
+
if (!url) {
|
|
16
|
+
console.error('NEXT_PUBLIC_URL_PORTAL is required!');
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return (window.location.href = `${url}/autenticacion?action=AUTH_REGISTER?post_url=${window.location.href}`);
|
|
20
|
+
};
|
|
21
|
+
const handleSecondaryButton = () => {
|
|
22
|
+
if (!url) {
|
|
23
|
+
console.error('NEXT_PUBLIC_URL_PORTAL is required!');
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return (window.location.href = `${url}/autenticacion?action=AUTH_LOGIN?post_url=${window.location.href}`);
|
|
27
|
+
};
|
|
28
|
+
return (jsx(Box, { sx: {
|
|
29
|
+
display: 'flex',
|
|
30
|
+
width: '100%',
|
|
31
|
+
border: '1px solid #707070',
|
|
32
|
+
justifyContent: 'center',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
flexDirection: 'column',
|
|
35
|
+
background: 'white',
|
|
36
|
+
paddingTop: '80px',
|
|
37
|
+
paddingBottom: '80px',
|
|
38
|
+
borderRadius: '20px',
|
|
39
|
+
boxShadow: '0px 0px 32px #00000029',
|
|
40
|
+
...sxContainerProps,
|
|
41
|
+
}, ...containerPropRest, children: jsxs(Box, { sx: {
|
|
42
|
+
width: {
|
|
43
|
+
xs: 360,
|
|
44
|
+
md: 460,
|
|
45
|
+
},
|
|
46
|
+
justifyContent: 'center',
|
|
47
|
+
alignItems: 'center',
|
|
48
|
+
flexDirection: 'column',
|
|
49
|
+
display: 'flex',
|
|
50
|
+
}, children: [jsx(Typography, { sx: {
|
|
51
|
+
fontWeight: 700,
|
|
52
|
+
lineHeight: '34px',
|
|
53
|
+
fontSize: '34px',
|
|
54
|
+
textAlign: 'center',
|
|
55
|
+
marginBottom: '1.5rem',
|
|
56
|
+
...sxTitleProps,
|
|
57
|
+
}, ...titlePropRest, children: title }), jsx(Typography, { sx: { textAlign: 'center', marginBottom: '1.5rem', ...sxSubtitleProps }, ...subtitlePropRest, children: subtitle }), jsx(Button, { disableElevation: true, disableRipple: true, disableTouchRipple: true, disableFocusRipple: true, sx: {
|
|
58
|
+
background: '#f75957',
|
|
59
|
+
'&:hover': {
|
|
60
|
+
backgroundColor: '#f75957',
|
|
61
|
+
},
|
|
62
|
+
fontWeight: 700,
|
|
63
|
+
textTransform: 'uppercase',
|
|
64
|
+
marginBottom: '.5rem',
|
|
65
|
+
color: 'white',
|
|
66
|
+
fontSize: '18px',
|
|
67
|
+
paddingTop: '.5rem',
|
|
68
|
+
paddingBottom: '.5rem',
|
|
69
|
+
paddingLeft: '.75rem',
|
|
70
|
+
paddingRight: '.75rem',
|
|
71
|
+
borderRadius: '0.25rem',
|
|
72
|
+
...sxButtonProps,
|
|
73
|
+
}, onClick: () => handleButton(), ...buttonPropsRest, children: buttonText }), jsx(Button, { disableElevation: true, disableRipple: true, disableTouchRipple: true, disableFocusRipple: true, sx: {
|
|
74
|
+
textDecoration: 'underline',
|
|
75
|
+
background: 'transparent',
|
|
76
|
+
textTransform: 'none',
|
|
77
|
+
fontWeight: 700,
|
|
78
|
+
textAlign: 'center',
|
|
79
|
+
fontSize: '16px',
|
|
80
|
+
paddingTop: '.5rem',
|
|
81
|
+
paddingBottom: '.5rem',
|
|
82
|
+
paddingLeft: '.75rem',
|
|
83
|
+
paddingRight: '.75rem',
|
|
84
|
+
color: 'black',
|
|
85
|
+
...sxSecondaryButtonProps,
|
|
86
|
+
}, onClick: () => handleSecondaryButton(), ...secondaryButtonPropsRest, children: secondaryButtonText })] }) }));
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export { PaywallRegister };
|
|
90
|
+
//# sourceMappingURL=PaywallRegister.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaywallRegister.js","sources":["../../../../src/components/paywall/PaywallRegister.tsx"],"sourcesContent":["'use client';\nimport React from 'react';\nimport { Box, BoxProps, Typography, TypographyProps, ButtonProps, Button } from '@mui/material';\n\nexport interface PaywallRegisterProps {\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 PaywallRegister: React.FC<PaywallRegisterProps> = ({\n containerProps = {},\n subtitleProps = {},\n buttonProps = {},\n titleProps = {},\n secondaryButtonText = 'Ya estoy registrado',\n secondaryButtonProps = {},\n title = 'Este artículo es exclusivo para usuarios registrados',\n subtitle = 'Regístrate para obtener beneficios exclusivos.',\n buttonText = '¡Regístrate gratis!',\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 const url = process.env.NEXT_PUBLIC_URL_PORTAL || '';\n\n const handleButton = () => {\n if (!url) {\n console.error('NEXT_PUBLIC_URL_PORTAL is required!');\n return null;\n }\n\n return (window.location.href = `${url}/autenticacion?action=AUTH_REGISTER?post_url=${window.location.href}`);\n };\n\n const handleSecondaryButton = () => {\n if (!url) {\n console.error('NEXT_PUBLIC_URL_PORTAL is required!');\n return null;\n }\n\n return (window.location.href = `${url}/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":";;;;;;AAkBO;;;;;;;;;AAoBD;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;;"}
|
package/dist/esm/index.js
CHANGED
|
@@ -11,6 +11,7 @@ export { panelStore } from './components/panel/panel.store.js';
|
|
|
11
11
|
export { handleLogout, handlePanelClick, panelStoreAction } from './components/panel/panel.actions.js';
|
|
12
12
|
export { SessionProvider } from './components/session/SessionProvider.js';
|
|
13
13
|
export { PaywallSubscription } from './components/paywall/PaywallSubscription.js';
|
|
14
|
+
export { PaywallRegister } from './components/paywall/PaywallRegister.js';
|
|
14
15
|
export { Paywall } from './components/paywall/Paywall.js';
|
|
15
16
|
export { COOKIE_DOMAIN, COOKIE_TOKEN_NAME, URI, URL_PORTAL } from './shared/constants/index.js';
|
|
16
17
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -3,8 +3,7 @@ export interface PaywallProps {
|
|
|
3
3
|
children?: React.ReactNode;
|
|
4
4
|
PaywallSubscriptionComponent?: React.ReactNode;
|
|
5
5
|
PaywallRegisterComponent?: React.ReactNode;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
postType?: string;
|
|
6
|
+
postPremium?: boolean;
|
|
7
|
+
postRegister?: boolean;
|
|
9
8
|
}
|
|
10
9
|
export declare const Paywall: React.FC<PaywallProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -111,13 +111,27 @@ interface PaywallSubscriptionProps {
|
|
|
111
111
|
}
|
|
112
112
|
declare const PaywallSubscription: React.FC<PaywallSubscriptionProps>;
|
|
113
113
|
|
|
114
|
+
interface PaywallRegisterProps {
|
|
115
|
+
post?: any;
|
|
116
|
+
containerProps?: BoxProps;
|
|
117
|
+
titleProps?: TypographyProps;
|
|
118
|
+
subtitleProps?: TypographyProps;
|
|
119
|
+
buttonProps?: ButtonProps;
|
|
120
|
+
buttonText?: string;
|
|
121
|
+
secondaryButtonProps?: ButtonProps;
|
|
122
|
+
secondaryButtonText?: string;
|
|
123
|
+
title?: string;
|
|
124
|
+
subtitle?: string;
|
|
125
|
+
withCaption?: boolean;
|
|
126
|
+
}
|
|
127
|
+
declare const PaywallRegister: React.FC<PaywallRegisterProps>;
|
|
128
|
+
|
|
114
129
|
interface PaywallProps {
|
|
115
130
|
children?: React.ReactNode;
|
|
116
131
|
PaywallSubscriptionComponent?: React.ReactNode;
|
|
117
132
|
PaywallRegisterComponent?: React.ReactNode;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
postType?: string;
|
|
133
|
+
postPremium?: boolean;
|
|
134
|
+
postRegister?: boolean;
|
|
121
135
|
}
|
|
122
136
|
declare const Paywall: React.FC<PaywallProps>;
|
|
123
137
|
|
|
@@ -126,5 +140,5 @@ declare const URL_PORTAL: string;
|
|
|
126
140
|
declare const COOKIE_TOKEN_NAME: string;
|
|
127
141
|
declare const COOKIE_DOMAIN: string;
|
|
128
142
|
|
|
129
|
-
export { COOKIE_DOMAIN, COOKIE_TOKEN_NAME, Panel, PanelAvatar, PanelButton, PanelDivider, PanelFooter, PanelHeader, PanelItem, PanelListItems, PanelSubscriptionIcon, Paywall, PaywallSubscription, SessionProvider, URI, URL_PORTAL, handleLogout, handlePanelClick, panelStore, panelStoreAction };
|
|
130
|
-
export type { PanelAvatarProps, PanelButtonProps, PanelDividerProps, PanelFooterProps, PanelHeaderProps, PanelItemProps, PanelListRoute, PanelProps, PanelStoreAction, PanelSubscriptionIconProps, PaywallProps, PaywallSubscriptionProps };
|
|
143
|
+
export { COOKIE_DOMAIN, COOKIE_TOKEN_NAME, Panel, PanelAvatar, PanelButton, PanelDivider, PanelFooter, PanelHeader, PanelItem, PanelListItems, PanelSubscriptionIcon, Paywall, PaywallRegister, PaywallSubscription, SessionProvider, URI, URL_PORTAL, handleLogout, handlePanelClick, panelStore, panelStoreAction };
|
|
144
|
+
export type { PanelAvatarProps, PanelButtonProps, PanelDividerProps, PanelFooterProps, PanelHeaderProps, PanelItemProps, PanelListRoute, PanelProps, PanelStoreAction, PanelSubscriptionIconProps, PaywallProps, PaywallRegisterProps, PaywallSubscriptionProps };
|