react-easy-wall 1.1.14 → 1.1.16

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.
@@ -2,7 +2,6 @@
2
2
  'use strict';
3
3
 
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
- var paywall_constants = require('./paywall.constants.js');
6
5
  var Box = require('../../node_modules/@mui/material/esm/Box/Box.js');
7
6
  var Typography = require('../../node_modules/@mui/material/esm/Typography/Typography.js');
8
7
  var Button = require('../../node_modules/@mui/material/esm/Button/Button.js');
@@ -13,19 +12,20 @@ const PaywallSubscription = ({ containerProps = {}, subtitleProps = {}, buttonPr
13
12
  const { sx: sxTitleProps, ...titlePropRest } = titleProps;
14
13
  const { sx: sxButtonProps, ...buttonPropsRest } = buttonProps;
15
14
  const { sx: sxSecondaryButtonProps, ...secondaryButtonPropsRest } = secondaryButtonProps;
15
+ const url = process.env.NEXT_PUBLIC_URL_PORTAL || '';
16
16
  const handleButton = () => {
17
- if (!paywall_constants.PAYWALL_AUTH_ENDPOINT) {
18
- console.error('PAYWALL_AUTH_ENDPOINT is required!');
17
+ if (!url) {
18
+ console.error('NEXT_PUBLIC_URL_PORTAL is required!');
19
19
  return null;
20
20
  }
21
- return (window.location.href = `${paywall_constants.PAYWALL_AUTH_ENDPOINT}/planes?post_url=${window.location.href}`);
21
+ return (window.location.href = `${url}/planes?post_url=${window.location.href}`);
22
22
  };
23
23
  const handleSecondaryButton = () => {
24
- if (!paywall_constants.PAYWALL_AUTH_ENDPOINT) {
25
- console.error('PAYWALL_AUTH_ENDPOINT is required!');
24
+ if (!url) {
25
+ console.error('NEXT_PUBLIC_URL_PORTAL is required!');
26
26
  return null;
27
27
  }
28
- return (window.location.href = `${paywall_constants.PAYWALL_AUTH_ENDPOINT}/autenticacion?action=AUTH_LOGIN?post_url=${window.location.href}`);
28
+ return (window.location.href = `${url}/autenticacion?action=AUTH_LOGIN?post_url=${window.location.href}`);
29
29
  };
30
30
  return (jsxRuntime.jsx(Box.default, { sx: {
31
31
  display: 'flex',
@@ -1 +1 @@
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;;"}
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';\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 const url = process.env.NEXT_PUBLIC_URL_PORTAL || '';\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}/planes?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":";;;;;;;;;;;;;;;;;AAuCM;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, config }) => {
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 config: Config;\n};\n\nexport const SessionProvider: React.FC<SessionProviderProps> = async ({ children, config }) => {\n const user = await getUserServer(config);\n console.log({ user });\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":";;;;;;;AAWO,MAAM,eAAe,GAAmC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAI;AAC5F,IAAA,MAAM,IAAI,GAAG,MAAMA,oCAAa,CAAC,MAAM,CAAC;AACxC,IAAA,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;AACrB,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
+ {"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;;;;"}
package/dist/cjs/index.js CHANGED
@@ -13,7 +13,6 @@ 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 paywall_constants = require('./components/paywall/paywall.constants.js');
17
16
  var Paywall = require('./components/paywall/Paywall.js');
18
17
 
19
18
 
@@ -33,6 +32,5 @@ exports.handlePanelClick = panel_actions.handlePanelClick;
33
32
  exports.panelStoreAction = panel_actions.panelStoreAction;
34
33
  exports.SessionProvider = SessionProvider.SessionProvider;
35
34
  exports.PaywallSubscription = PaywallSubscription.PaywallSubscription;
36
- exports.PAYWALL_AUTH_ENDPOINT = paywall_constants.PAYWALL_AUTH_ENDPOINT;
37
35
  exports.Paywall = Paywall.Paywall;
38
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,5 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { PAYWALL_AUTH_ENDPOINT } from './paywall.constants.js';
4
3
  import Box from '../../node_modules/@mui/material/esm/Box/Box.js';
5
4
  import Typography from '../../node_modules/@mui/material/esm/Typography/Typography.js';
6
5
  import Button from '../../node_modules/@mui/material/esm/Button/Button.js';
@@ -11,19 +10,20 @@ const PaywallSubscription = ({ containerProps = {}, subtitleProps = {}, buttonPr
11
10
  const { sx: sxTitleProps, ...titlePropRest } = titleProps;
12
11
  const { sx: sxButtonProps, ...buttonPropsRest } = buttonProps;
13
12
  const { sx: sxSecondaryButtonProps, ...secondaryButtonPropsRest } = secondaryButtonProps;
13
+ const url = process.env.NEXT_PUBLIC_URL_PORTAL || '';
14
14
  const handleButton = () => {
15
- if (!PAYWALL_AUTH_ENDPOINT) {
16
- console.error('PAYWALL_AUTH_ENDPOINT is required!');
15
+ if (!url) {
16
+ console.error('NEXT_PUBLIC_URL_PORTAL is required!');
17
17
  return null;
18
18
  }
19
- return (window.location.href = `${PAYWALL_AUTH_ENDPOINT}/planes?post_url=${window.location.href}`);
19
+ return (window.location.href = `${url}/planes?post_url=${window.location.href}`);
20
20
  };
21
21
  const handleSecondaryButton = () => {
22
- if (!PAYWALL_AUTH_ENDPOINT) {
23
- console.error('PAYWALL_AUTH_ENDPOINT is required!');
22
+ if (!url) {
23
+ console.error('NEXT_PUBLIC_URL_PORTAL is required!');
24
24
  return null;
25
25
  }
26
- return (window.location.href = `${PAYWALL_AUTH_ENDPOINT}/autenticacion?action=AUTH_LOGIN?post_url=${window.location.href}`);
26
+ return (window.location.href = `${url}/autenticacion?action=AUTH_LOGIN?post_url=${window.location.href}`);
27
27
  };
28
28
  return (jsx(Box, { sx: {
29
29
  display: 'flex',
@@ -1 +1 @@
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;;"}
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';\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 const url = process.env.NEXT_PUBLIC_URL_PORTAL || '';\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}/planes?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":";;;;;;;;;;;;;;;AAuCM;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, config }) => {
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 config: Config;\n};\n\nexport const SessionProvider: React.FC<SessionProviderProps> = async ({ children, config }) => {\n const user = await getUserServer(config);\n console.log({ user });\n return (\n <AppRouterCacheProvider>\n <SessionUserProvider initial={user} config={config}>\n {children}\n </SessionUserProvider>\n </AppRouterCacheProvider>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;AAWO,MAAM,eAAe,GAAmC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAI;AAC5F,IAAA,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC;AACxC,IAAA,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;AACrB,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;;;;"}
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;;;;"}
package/dist/esm/index.js CHANGED
@@ -11,6 +11,5 @@ 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 { PAYWALL_AUTH_ENDPOINT } from './components/paywall/paywall.constants.js';
15
14
  export { Paywall } from './components/paywall/Paywall.js';
16
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
@@ -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>;
@@ -1,3 +1,2 @@
1
1
  export * from './PaywallSubscription';
2
- export * from './paywall.constants';
3
2
  export * from './Paywall';
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
- import { Config } from '../../config/config.types';
3
2
  type SessionProviderProps = {
4
3
  children: React.ReactNode;
5
- config: Config;
6
4
  };
7
5
  export declare const SessionProvider: React.FC<SessionProviderProps>;
8
6
  export {};
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
 
@@ -111,8 +110,6 @@ interface PaywallSubscriptionProps {
111
110
  }
112
111
  declare const PaywallSubscription: React.FC<PaywallSubscriptionProps>;
113
112
 
114
- declare const PAYWALL_AUTH_ENDPOINT: string;
115
-
116
113
  interface PaywallProps {
117
114
  children?: React.ReactNode;
118
115
  PaywallSubscriptionComponent?: React.ReactNode;
@@ -123,5 +120,5 @@ interface PaywallProps {
123
120
  }
124
121
  declare const Paywall: React.FC<PaywallProps>;
125
122
 
126
- export { PAYWALL_AUTH_ENDPOINT, Panel, PanelAvatar, PanelButton, PanelDivider, PanelFooter, PanelHeader, PanelItem, PanelListItems, PanelSubscriptionIcon, Paywall, PaywallSubscription, SessionProvider, handleLogout, handlePanelClick, panelStore, panelStoreAction };
123
+ export { Panel, PanelAvatar, PanelButton, PanelDivider, PanelFooter, PanelHeader, PanelItem, PanelListItems, PanelSubscriptionIcon, Paywall, PaywallSubscription, SessionProvider, handleLogout, handlePanelClick, panelStore, panelStoreAction };
127
124
  export type { PanelAvatarProps, PanelButtonProps, PanelDividerProps, PanelFooterProps, PanelHeaderProps, PanelItemProps, PanelListRoute, PanelProps, PanelStoreAction, PanelSubscriptionIconProps, PaywallProps, PaywallSubscriptionProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-easy-wall",
3
- "version": "1.1.14",
3
+ "version": "1.1.16",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/index.d.ts",