react-easy-wall 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/rollup.config.mjs +0 -2
- package/src/components/comment/CommentContext.tsx +1 -1
- package/src/components/comment/CommentProvider.tsx +1 -1
- package/src/components/comment/Comments.tsx +1 -1
- package/src/components/comment/comment.actions.ts +2 -2
- package/src/components/comment/comment.events.ts +2 -2
- package/src/components/comment/components/AddComment.tsx +1 -1
- package/src/components/comment/components/AddCommentContainer.tsx +1 -1
- package/src/components/comment/components/AddReplyComment.tsx +1 -1
- package/src/components/comment/components/AddReplyCommentContainer.tsx +1 -1
- package/src/components/comment/components/CommentContainer.tsx +1 -1
- package/src/components/comment/components/CommentItem.tsx +1 -1
- package/src/components/comment/components/CommentSubscriptionDialog.tsx +1 -1
- package/src/components/comment/components/ReplyComments.tsx +1 -1
- package/src/components/comment/components/ShowMoreComments.tsx +1 -1
- package/src/components/panel/PanelDivider.tsx +1 -1
- package/src/components/panel/PanelItem.tsx +1 -1
- package/src/components/paywall/PaywallRegister.tsx +3 -0
- package/src/components/session/SessionClientProvider.tsx +14 -3
- package/src/components/session/SessionUserClientProvider.tsx +8 -6
- package/src/components/session/SessionUserContext.tsx +1 -1
- package/src/components/session/session.actions.ts +3 -3
- package/src/components/session/session.constants.ts +1 -9
- package/src/components/session/session.stores.ts +6 -0
- package/src/config/config.types.ts +1 -0
- package/src/shared/apollo/apollo.client.ts +2 -11
- package/src/shared/components/buttons/ButtonDefault.tsx +1 -1
- package/src/shared/components/dialog/DialogDefault.tsx +1 -1
- package/src/shared/components/react-editor/BtnEmoji.tsx +1 -1
- package/src/shared/components/react-editor/ReactSimpleWysiwyg.tsx +1 -1
- package/src/shared/constants/index.ts +6 -25
package/package.json
CHANGED
package/rollup.config.mjs
CHANGED
|
@@ -36,7 +36,6 @@ export default [
|
|
|
36
36
|
commonjs(),
|
|
37
37
|
typescript({
|
|
38
38
|
tsconfig: './tsconfig.json',
|
|
39
|
-
// SOBREESCRIBIMOS EL TSCONFIG AQUÍ:
|
|
40
39
|
declaration: false,
|
|
41
40
|
declarationMap: false,
|
|
42
41
|
composite: false,
|
|
@@ -45,7 +44,6 @@ export default [
|
|
|
45
44
|
external,
|
|
46
45
|
},
|
|
47
46
|
{
|
|
48
|
-
// SEGUNDA FASE: Generación de tipos unificada
|
|
49
47
|
input: 'src/index.ts',
|
|
50
48
|
output: [{ file: 'dist/index.d.ts', format: 'esm' }],
|
|
51
49
|
plugins: [dts()],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAction, createStoreAction } from '@cobuildlab/react-simple-state';
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
postStore,
|
|
4
4
|
fetchCommentsStore,
|
|
5
5
|
openSubscriptionCommentsStore,
|
|
6
6
|
replyCommentStore,
|
|
@@ -97,7 +97,7 @@ export const createReplyComment = createAction(
|
|
|
97
97
|
});
|
|
98
98
|
|
|
99
99
|
return {
|
|
100
|
-
comment: response.data?.createReplyComment
|
|
100
|
+
comment: response.data?.createReplyComment,
|
|
101
101
|
};
|
|
102
102
|
},
|
|
103
103
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createEvent } from '@cobuildlab/react-simple-state';
|
|
2
|
-
import { Comment } from '../../shared/types/generated';
|
|
2
|
+
import { Comment, ReplyComment } from '../../shared/types/generated';
|
|
3
3
|
|
|
4
4
|
export const fetchCommentsEvent = createEvent<{
|
|
5
5
|
comments: Comment[];
|
|
@@ -21,7 +21,7 @@ export const createCommentEvent = createEvent<{ comment: Comment | undefined }>(
|
|
|
21
21
|
export const createCommentErrorEvent = createEvent();
|
|
22
22
|
|
|
23
23
|
export const createReplyCommentEvent = createEvent<{
|
|
24
|
-
comment:
|
|
24
|
+
comment: ReplyComment | undefined;
|
|
25
25
|
}>({
|
|
26
26
|
initialValue: {
|
|
27
27
|
comment: undefined,
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import { GoogleOAuthProvider } from '@react-oauth/google';
|
|
2
|
-
import React, { ReactNode } from 'react';
|
|
2
|
+
import React, { ReactNode, useEffect } from 'react';
|
|
3
3
|
import { GOOGLE_AUTH_CLIENT } from '../../shared/constants';
|
|
4
4
|
import { SessionUserClientProvider } from './SessionUserClientProvider';
|
|
5
|
+
import { Config } from '@/config/config.types';
|
|
6
|
+
import { sessionConfigStore } from '@/components/session/session.stores';
|
|
5
7
|
|
|
6
8
|
type SessionClientProviderProps = {
|
|
7
9
|
children: ReactNode;
|
|
10
|
+
config: Config;
|
|
8
11
|
};
|
|
9
12
|
|
|
10
|
-
export const SessionClientProvider: React.FC<SessionClientProviderProps> = ({
|
|
13
|
+
export const SessionClientProvider: React.FC<SessionClientProviderProps> = ({
|
|
14
|
+
children,
|
|
15
|
+
config,
|
|
16
|
+
}) => {
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
sessionConfigStore.dispatch(config);
|
|
20
|
+
}, [config]);
|
|
21
|
+
|
|
11
22
|
return (
|
|
12
23
|
<GoogleOAuthProvider clientId={GOOGLE_AUTH_CLIENT}>
|
|
13
|
-
<SessionUserClientProvider>{children}</SessionUserClientProvider>
|
|
24
|
+
<SessionUserClientProvider config={config}>{children}</SessionUserClientProvider>
|
|
14
25
|
</GoogleOAuthProvider>
|
|
15
26
|
);
|
|
16
27
|
};
|
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
|
|
2
1
|
import React, { useState, useEffect } from 'react';
|
|
3
|
-
import { User, UserSavedPost } from '
|
|
2
|
+
import { User, UserSavedPost } from '@/shared/types/generated';
|
|
4
3
|
import { Provider } from './SessionUserContext';
|
|
5
4
|
import { SessionContextDefaultValues } from './session.types';
|
|
6
5
|
import { useGoogleOneTapLogin } from '@react-oauth/google';
|
|
7
6
|
|
|
8
7
|
import { ThemeProvider } from '@mui/material/styles';
|
|
9
8
|
import CssBaseline from '@mui/material/CssBaseline';
|
|
10
|
-
import { theme } from '
|
|
9
|
+
import { theme } from '@/shared/mui/theme';
|
|
11
10
|
import { getSubscriptionActive } from './session.utils';
|
|
12
|
-
import {
|
|
11
|
+
import { COOKIES_OPTIONS } from './session.constants';
|
|
13
12
|
import { useCallAction, useEvent } from '@cobuildlab/react-simple-state';
|
|
14
13
|
import { currentUserAction, googleOneTapAction } from './session.actions';
|
|
15
|
-
import { universalCookies } from '
|
|
16
|
-
import { COOKIE_NAME } from '
|
|
14
|
+
import { universalCookies } from '@/shared/cookies';
|
|
15
|
+
import { COOKIE_NAME } from '@/shared/constants';
|
|
17
16
|
import { tokenEvent } from './session.events';
|
|
17
|
+
import { Config } from '@/config/config.types';
|
|
18
18
|
|
|
19
19
|
type SessionUserClientProviderProps = {
|
|
20
20
|
children: React.ReactNode;
|
|
21
|
+
config: Config;
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
export const SessionUserClientProvider: React.FC<SessionUserClientProviderProps> = ({
|
|
24
25
|
children,
|
|
26
|
+
config,
|
|
25
27
|
}) => {
|
|
26
28
|
const [user, setUser] = useState<User | null | undefined>(null);
|
|
27
29
|
const { token } = useEvent(tokenEvent);
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
googleOneTapErrorEvent,
|
|
10
10
|
googleOneTapEvent,
|
|
11
11
|
} from './session.events';
|
|
12
|
-
import { URI } from '
|
|
12
|
+
import { URI } from '@/shared/constants';
|
|
13
13
|
import axios from 'axios';
|
|
14
|
-
import { apolloClient } from '
|
|
14
|
+
import { apolloClient } from '@/shared/apollo/apollo.client';
|
|
15
15
|
import {
|
|
16
16
|
CreateUserSavedPostDocument,
|
|
17
17
|
CreateUserSavedPostMutation,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
DeleteUserSavedPostDocument,
|
|
23
23
|
DeleteUserSavedPostMutation,
|
|
24
24
|
DeleteUserSavedPostMutationVariables,
|
|
25
|
-
} from '
|
|
25
|
+
} from '@/shared/types/generated';
|
|
26
26
|
|
|
27
27
|
export const googleOneTapAction = createAction(
|
|
28
28
|
googleOneTapEvent,
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import { Config } from '../../config/config.types';
|
|
2
1
|
import moment from 'moment';
|
|
3
|
-
import { COOKIE_DOMAIN
|
|
4
|
-
|
|
5
|
-
export const config: Config = {
|
|
6
|
-
uri: URI,
|
|
7
|
-
urlPortal: URL_PORTAL,
|
|
8
|
-
cookieTokenName: COOKIE_NAME,
|
|
9
|
-
cookieDomain: COOKIE_DOMAIN,
|
|
10
|
-
};
|
|
2
|
+
import { COOKIE_DOMAIN } from '../../shared/constants';
|
|
11
3
|
|
|
12
4
|
export const DEFAULT_USER_CONTEXT = {
|
|
13
5
|
user: undefined,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ApolloClient, InMemoryCache, SSRMultipartLink } from '@apollo/client-integration-nextjs';
|
|
1
|
+
import { HttpLink, ApolloClient, InMemoryCache } from '@apollo/client';
|
|
3
2
|
import { SetContextLink } from '@apollo/client/link/context';
|
|
4
3
|
import { universalCookies } from '../cookies';
|
|
5
4
|
import { COOKIE_NAME, URI } from '../constants';
|
|
@@ -29,14 +28,6 @@ export const apolloClient = () => {
|
|
|
29
28
|
|
|
30
29
|
return new ApolloClient({
|
|
31
30
|
cache: new InMemoryCache(),
|
|
32
|
-
link:
|
|
33
|
-
typeof window === 'undefined'
|
|
34
|
-
? ApolloLink.from([
|
|
35
|
-
new SSRMultipartLink({
|
|
36
|
-
stripDefer: true,
|
|
37
|
-
}),
|
|
38
|
-
authLink.concat(httpLink),
|
|
39
|
-
])
|
|
40
|
-
: authLink.concat(httpLink),
|
|
31
|
+
link: authLink.concat(httpLink),
|
|
41
32
|
});
|
|
42
33
|
};
|
|
@@ -1,26 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
process.env.NEXT_PUBLIC_EW_URI ||
|
|
3
|
-
process.env.REACT_PUBLIC_EW_URI ||
|
|
4
|
-
process.env.VITE_EW_URI ||
|
|
5
|
-
'';
|
|
6
|
-
export const URL_PORTAL =
|
|
7
|
-
process.env.NEXT_PUBLIC_EW_URL_PORTAL ||
|
|
8
|
-
process.env.REACT_PUBLIC_EW_URL_PORTAL ||
|
|
9
|
-
process.env.VITE_EW_URL_PORTAL ||
|
|
10
|
-
'';
|
|
11
|
-
export const COOKIE_NAME =
|
|
12
|
-
process.env.NEXT_PUBLIC_EW_COOKIE_NAME ||
|
|
13
|
-
process.env.REACT_PUBLIC_EW_COOKIE_NAME ||
|
|
14
|
-
process.env.VITE_EW_COOKIE_NAME ||
|
|
15
|
-
'';
|
|
16
|
-
export const COOKIE_DOMAIN =
|
|
17
|
-
process.env.NEXT_PUBLIC_EW_COOKIE_DOMAIN ||
|
|
18
|
-
process.env.REACT_PUBLIC_EW_COOKIE_DOMAIN ||
|
|
19
|
-
process.env.VITE_EW_COOKIE_DOMAIN ||
|
|
20
|
-
'';
|
|
1
|
+
import { sessionConfigStore } from '@/components/session/session.stores';
|
|
21
2
|
|
|
22
|
-
export const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
3
|
+
export const URI = sessionConfigStore.get().uri;
|
|
4
|
+
export const URL_PORTAL = sessionConfigStore.get().urlPortal;
|
|
5
|
+
export const COOKIE_NAME = sessionConfigStore.get().cookieTokenName;
|
|
6
|
+
export const COOKIE_DOMAIN = sessionConfigStore.get().cookieDomain;
|
|
7
|
+
export const GOOGLE_AUTH_CLIENT = sessionConfigStore.get().googleClient;
|