react-easy-wall 3.5.16 → 3.5.18

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.
@@ -13,14 +13,14 @@ var Grid = require('../../../node_modules/@mui/material/esm/Grid/Grid.js');
13
13
  var Box = require('../../../node_modules/@mui/material/esm/Box/Box.js');
14
14
  var Divider = require('../../../node_modules/@mui/material/esm/Divider/Divider.js');
15
15
 
16
- const CommentContainer = ({ comment, commentItemProps = {}, replyCommentItemProps = {}, replyCommentContainerProps = {}, }) => {
16
+ const CommentContainer = ({ comment, commentItemProps = {}, replyCommentItemProps = {}, replyCommentContainerProps = {}, mentionColor = theme.PRIMARY_COLOR, }) => {
17
17
  const { commentId } = index.libExports.useStore(comment_store.replyCommentStore);
18
18
  const onReply = (r) => {
19
19
  if (comment.id === commentId) {
20
20
  comment_actions.replyCommentStoreAction('', 0);
21
21
  }
22
22
  else {
23
- comment_actions.replyCommentStoreAction(`<b style="color:${theme.PRIMARY_COLOR}">@${r.user?.name}</b>&nbsp;`, comment.id);
23
+ comment_actions.replyCommentStoreAction(`<b style="color:${mentionColor}">@${r.user?.name}</b>&nbsp;`, comment.id);
24
24
  }
25
25
  };
26
26
  const selectedComment = commentId === comment.id;
@@ -1 +1 @@
1
- {"version":3,"file":"CommentContainer.js","sources":["../../../../../src/components/comment/components/CommentContainer.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react';\nimport { Comment, ReplyComment } from '@/shared/types/generated';\nimport { Box, Divider, Grid } from '@mui/material';\nimport { ReplyComments } from './reply-comment/ReplyComments';\nimport { CommentItem } from './CommentItem';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { replyCommentStore } from '../comment.store';\nimport {\n CreateReplyCommentContainer,\n CreateReplyCommentContainerProps,\n} from './reply-comment/CreateReplyCommentContainer';\nimport { replyCommentStoreAction } from '../comment.actions';\nimport { PRIMARY_COLOR } from '@/shared/mui/theme';\nimport { CommentItemExtraProps } from '@/components/comment/comment.types';\n\nexport type CommentContainerProps = {\n comment: Comment;\n commentItemProps?: CommentItemExtraProps;\n replyCommentItemProps?: CommentItemExtraProps;\n replyCommentContainerProps?: CreateReplyCommentContainerProps;\n};\nexport const CommentContainer: React.FC<CommentContainerProps> = ({\n comment,\n commentItemProps = {},\n replyCommentItemProps = {},\n replyCommentContainerProps = {},\n}) => {\n const { commentId } = useStore(replyCommentStore);\n\n const onReply = (r: Comment | ReplyComment) => {\n if (comment.id === commentId) {\n replyCommentStoreAction('', 0);\n } else {\n replyCommentStoreAction(\n `<b style=\"color:${PRIMARY_COLOR}\">@${r.user?.name}</b>&nbsp;`,\n comment.id as number,\n );\n }\n };\n\n const selectedComment = commentId === comment.id;\n const haveReplyComments = comment.replies?.length;\n\n return (\n <Grid container>\n <Grid size={12} mb={2}>\n <CommentItem comment={comment} onReply={onReply} commentItemProps={commentItemProps} />\n </Grid>\n {selectedComment || haveReplyComments ? (\n <Grid size={12} mb={2}>\n <Grid container>\n <Grid size={1}>\n <Box display=\"flex\" height=\"100%\" justifyContent=\"center\">\n <Divider orientation=\"vertical\" flexItem />\n </Box>\n </Grid>\n <Grid size={11}>\n <Grid container spacing={2}>\n {haveReplyComments ? (\n <Grid size={12}>\n <ReplyComments\n replyComments={(comment.replies || []) as ReplyComment[]}\n onReply={onReply}\n replyCommentItemProps={replyCommentItemProps}\n />\n </Grid>\n ) : null}\n {selectedComment ? (\n <Grid size={12}>\n <CreateReplyCommentContainer {...replyCommentContainerProps} />\n </Grid>\n ) : null}\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n ) : null}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA+BE;AACE;AACE;;;AAEA;;AAKJ;AAEA;AACA;AAEA;AAoCF;;"}
1
+ {"version":3,"file":"CommentContainer.js","sources":["../../../../../src/components/comment/components/CommentContainer.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { Comment, ReplyComment } from '@/shared/types/generated';\nimport { Box, Divider, Grid } from '@mui/material';\nimport { ReplyComments } from './reply-comment/ReplyComments';\nimport { CommentItem } from './CommentItem';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { replyCommentStore } from '../comment.store';\nimport {\n CreateReplyCommentContainer,\n CreateReplyCommentContainerProps,\n} from './reply-comment/CreateReplyCommentContainer';\nimport { replyCommentStoreAction } from '../comment.actions';\nimport { PRIMARY_COLOR } from '@/shared/mui/theme';\nimport { CommentItemExtraProps } from '@/components/comment/comment.types';\n\nexport type CommentContainerProps = {\n comment: Comment;\n commentItemProps?: CommentItemExtraProps;\n replyCommentItemProps?: CommentItemExtraProps;\n replyCommentContainerProps?: CreateReplyCommentContainerProps;\n mentionColor?: string;\n};\nexport const CommentContainer: React.FC<CommentContainerProps> = ({\n comment,\n commentItemProps = {},\n replyCommentItemProps = {},\n replyCommentContainerProps = {},\n mentionColor = PRIMARY_COLOR,\n}) => {\n const { commentId } = useStore(replyCommentStore);\n\n const onReply = (r: Comment | ReplyComment) => {\n if (comment.id === commentId) {\n replyCommentStoreAction('', 0);\n } else {\n replyCommentStoreAction(\n `<b style=\"color:${mentionColor}\">@${r.user?.name}</b>&nbsp;`,\n comment.id as number,\n );\n }\n };\n\n const selectedComment = commentId === comment.id;\n const haveReplyComments = comment.replies?.length;\n\n return (\n <Grid container>\n <Grid size={12} mb={2}>\n <CommentItem comment={comment} onReply={onReply} commentItemProps={commentItemProps} />\n </Grid>\n {selectedComment || haveReplyComments ? (\n <Grid size={12} mb={2}>\n <Grid container>\n <Grid size={1}>\n <Box display=\"flex\" height=\"100%\" justifyContent=\"center\">\n <Divider orientation=\"vertical\" flexItem />\n </Box>\n </Grid>\n <Grid size={11}>\n <Grid container spacing={2}>\n {haveReplyComments ? (\n <Grid size={12}>\n <ReplyComments\n replyComments={(comment.replies || []) as ReplyComment[]}\n onReply={onReply}\n replyCommentItemProps={replyCommentItemProps}\n />\n </Grid>\n ) : null}\n {selectedComment ? (\n <Grid size={12}>\n <CreateReplyCommentContainer {...replyCommentContainerProps} />\n </Grid>\n ) : null}\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n ) : null}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAwBO;;AASL;AACE;AACE;;;AAEA;;AAKJ;AAEA;AACA;AAEA;AAoCF;;"}
@@ -10,7 +10,7 @@ const Paywall = ({ children, PaywallSubscriptionComponent, PaywallRegisterCompon
10
10
  if (!subscription && postPremium) {
11
11
  return PaywallSubscriptionComponent;
12
12
  }
13
- if (!(user && postRegister)) {
13
+ if (!user && postRegister) {
14
14
  return PaywallRegisterComponent;
15
15
  }
16
16
  return children;
@@ -1 +1 @@
1
- {"version":3,"file":"Paywall.js","sources":["../../../../src/components/paywall/Paywall.tsx"],"sourcesContent":["'use client'\n\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 LoadingComponent?: React.ReactNode;\n postPremium?: boolean;\n postRegister?: boolean;\n}\n\nexport const Paywall: React.FC<PaywallProps> = ({\n children,\n PaywallSubscriptionComponent,\n PaywallRegisterComponent,\n LoadingComponent,\n postPremium = false,\n postRegister = false,\n}) => {\n const { user, subscription, loading } = useSession();\n\n if (loading) return LoadingComponent;\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":";;;;;;;AAwBE;AAAa;AAEb;AACE;;AAGF;AACE;;AAGF;AACF;;"}
1
+ {"version":3,"file":"Paywall.js","sources":["../../../../src/components/paywall/Paywall.tsx"],"sourcesContent":["'use client';\n\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 LoadingComponent?: React.ReactNode;\n postPremium?: boolean;\n postRegister?: boolean;\n}\n\nexport const Paywall: React.FC<PaywallProps> = ({\n children,\n PaywallSubscriptionComponent,\n PaywallRegisterComponent,\n LoadingComponent,\n postPremium = false,\n postRegister = false,\n}) => {\n const { user, subscription, loading } = useSession();\n\n if (loading) return LoadingComponent;\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":";;;;;;;AAwBE;AAAa;AAEb;AACE;;AAGF;AACE;;AAGF;AACF;;"}
@@ -11,14 +11,14 @@ import Grid from '../../../node_modules/@mui/material/esm/Grid/Grid.js';
11
11
  import Box from '../../../node_modules/@mui/material/esm/Box/Box.js';
12
12
  import Divider from '../../../node_modules/@mui/material/esm/Divider/Divider.js';
13
13
 
14
- const CommentContainer = ({ comment, commentItemProps = {}, replyCommentItemProps = {}, replyCommentContainerProps = {}, }) => {
14
+ const CommentContainer = ({ comment, commentItemProps = {}, replyCommentItemProps = {}, replyCommentContainerProps = {}, mentionColor = PRIMARY_COLOR, }) => {
15
15
  const { commentId } = libExports.useStore(replyCommentStore);
16
16
  const onReply = (r) => {
17
17
  if (comment.id === commentId) {
18
18
  replyCommentStoreAction('', 0);
19
19
  }
20
20
  else {
21
- replyCommentStoreAction(`<b style="color:${PRIMARY_COLOR}">@${r.user?.name}</b>&nbsp;`, comment.id);
21
+ replyCommentStoreAction(`<b style="color:${mentionColor}">@${r.user?.name}</b>&nbsp;`, comment.id);
22
22
  }
23
23
  };
24
24
  const selectedComment = commentId === comment.id;
@@ -1 +1 @@
1
- {"version":3,"file":"CommentContainer.js","sources":["../../../../../src/components/comment/components/CommentContainer.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react';\nimport { Comment, ReplyComment } from '@/shared/types/generated';\nimport { Box, Divider, Grid } from '@mui/material';\nimport { ReplyComments } from './reply-comment/ReplyComments';\nimport { CommentItem } from './CommentItem';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { replyCommentStore } from '../comment.store';\nimport {\n CreateReplyCommentContainer,\n CreateReplyCommentContainerProps,\n} from './reply-comment/CreateReplyCommentContainer';\nimport { replyCommentStoreAction } from '../comment.actions';\nimport { PRIMARY_COLOR } from '@/shared/mui/theme';\nimport { CommentItemExtraProps } from '@/components/comment/comment.types';\n\nexport type CommentContainerProps = {\n comment: Comment;\n commentItemProps?: CommentItemExtraProps;\n replyCommentItemProps?: CommentItemExtraProps;\n replyCommentContainerProps?: CreateReplyCommentContainerProps;\n};\nexport const CommentContainer: React.FC<CommentContainerProps> = ({\n comment,\n commentItemProps = {},\n replyCommentItemProps = {},\n replyCommentContainerProps = {},\n}) => {\n const { commentId } = useStore(replyCommentStore);\n\n const onReply = (r: Comment | ReplyComment) => {\n if (comment.id === commentId) {\n replyCommentStoreAction('', 0);\n } else {\n replyCommentStoreAction(\n `<b style=\"color:${PRIMARY_COLOR}\">@${r.user?.name}</b>&nbsp;`,\n comment.id as number,\n );\n }\n };\n\n const selectedComment = commentId === comment.id;\n const haveReplyComments = comment.replies?.length;\n\n return (\n <Grid container>\n <Grid size={12} mb={2}>\n <CommentItem comment={comment} onReply={onReply} commentItemProps={commentItemProps} />\n </Grid>\n {selectedComment || haveReplyComments ? (\n <Grid size={12} mb={2}>\n <Grid container>\n <Grid size={1}>\n <Box display=\"flex\" height=\"100%\" justifyContent=\"center\">\n <Divider orientation=\"vertical\" flexItem />\n </Box>\n </Grid>\n <Grid size={11}>\n <Grid container spacing={2}>\n {haveReplyComments ? (\n <Grid size={12}>\n <ReplyComments\n replyComments={(comment.replies || []) as ReplyComment[]}\n onReply={onReply}\n replyCommentItemProps={replyCommentItemProps}\n />\n </Grid>\n ) : null}\n {selectedComment ? (\n <Grid size={12}>\n <CreateReplyCommentContainer {...replyCommentContainerProps} />\n </Grid>\n ) : null}\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n ) : null}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AA+BE;AACE;AACE;;;AAEA;;AAKJ;AAEA;AACA;AAEA;AAoCF;;"}
1
+ {"version":3,"file":"CommentContainer.js","sources":["../../../../../src/components/comment/components/CommentContainer.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { Comment, ReplyComment } from '@/shared/types/generated';\nimport { Box, Divider, Grid } from '@mui/material';\nimport { ReplyComments } from './reply-comment/ReplyComments';\nimport { CommentItem } from './CommentItem';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { replyCommentStore } from '../comment.store';\nimport {\n CreateReplyCommentContainer,\n CreateReplyCommentContainerProps,\n} from './reply-comment/CreateReplyCommentContainer';\nimport { replyCommentStoreAction } from '../comment.actions';\nimport { PRIMARY_COLOR } from '@/shared/mui/theme';\nimport { CommentItemExtraProps } from '@/components/comment/comment.types';\n\nexport type CommentContainerProps = {\n comment: Comment;\n commentItemProps?: CommentItemExtraProps;\n replyCommentItemProps?: CommentItemExtraProps;\n replyCommentContainerProps?: CreateReplyCommentContainerProps;\n mentionColor?: string;\n};\nexport const CommentContainer: React.FC<CommentContainerProps> = ({\n comment,\n commentItemProps = {},\n replyCommentItemProps = {},\n replyCommentContainerProps = {},\n mentionColor = PRIMARY_COLOR,\n}) => {\n const { commentId } = useStore(replyCommentStore);\n\n const onReply = (r: Comment | ReplyComment) => {\n if (comment.id === commentId) {\n replyCommentStoreAction('', 0);\n } else {\n replyCommentStoreAction(\n `<b style=\"color:${mentionColor}\">@${r.user?.name}</b>&nbsp;`,\n comment.id as number,\n );\n }\n };\n\n const selectedComment = commentId === comment.id;\n const haveReplyComments = comment.replies?.length;\n\n return (\n <Grid container>\n <Grid size={12} mb={2}>\n <CommentItem comment={comment} onReply={onReply} commentItemProps={commentItemProps} />\n </Grid>\n {selectedComment || haveReplyComments ? (\n <Grid size={12} mb={2}>\n <Grid container>\n <Grid size={1}>\n <Box display=\"flex\" height=\"100%\" justifyContent=\"center\">\n <Divider orientation=\"vertical\" flexItem />\n </Box>\n </Grid>\n <Grid size={11}>\n <Grid container spacing={2}>\n {haveReplyComments ? (\n <Grid size={12}>\n <ReplyComments\n replyComments={(comment.replies || []) as ReplyComment[]}\n onReply={onReply}\n replyCommentItemProps={replyCommentItemProps}\n />\n </Grid>\n ) : null}\n {selectedComment ? (\n <Grid size={12}>\n <CreateReplyCommentContainer {...replyCommentContainerProps} />\n </Grid>\n ) : null}\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n ) : null}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAwBO;;AASL;AACE;AACE;;;AAEA;;AAKJ;AAEA;AACA;AAEA;AAoCF;;"}
@@ -8,7 +8,7 @@ const Paywall = ({ children, PaywallSubscriptionComponent, PaywallRegisterCompon
8
8
  if (!subscription && postPremium) {
9
9
  return PaywallSubscriptionComponent;
10
10
  }
11
- if (!(user && postRegister)) {
11
+ if (!user && postRegister) {
12
12
  return PaywallRegisterComponent;
13
13
  }
14
14
  return children;
@@ -1 +1 @@
1
- {"version":3,"file":"Paywall.js","sources":["../../../../src/components/paywall/Paywall.tsx"],"sourcesContent":["'use client'\n\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 LoadingComponent?: React.ReactNode;\n postPremium?: boolean;\n postRegister?: boolean;\n}\n\nexport const Paywall: React.FC<PaywallProps> = ({\n children,\n PaywallSubscriptionComponent,\n PaywallRegisterComponent,\n LoadingComponent,\n postPremium = false,\n postRegister = false,\n}) => {\n const { user, subscription, loading } = useSession();\n\n if (loading) return LoadingComponent;\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":";;;;;AAwBE;AAAa;AAEb;AACE;;AAGF;AACE;;AAGF;AACF;;"}
1
+ {"version":3,"file":"Paywall.js","sources":["../../../../src/components/paywall/Paywall.tsx"],"sourcesContent":["'use client';\n\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 LoadingComponent?: React.ReactNode;\n postPremium?: boolean;\n postRegister?: boolean;\n}\n\nexport const Paywall: React.FC<PaywallProps> = ({\n children,\n PaywallSubscriptionComponent,\n PaywallRegisterComponent,\n LoadingComponent,\n postPremium = false,\n postRegister = false,\n}) => {\n const { user, subscription, loading } = useSession();\n\n if (loading) return LoadingComponent;\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":";;;;;AAwBE;AAAa;AAEb;AACE;;AAGF;AACE;;AAGF;AACF;;"}
@@ -7,5 +7,6 @@ export type CommentContainerProps = {
7
7
  commentItemProps?: CommentItemExtraProps;
8
8
  replyCommentItemProps?: CommentItemExtraProps;
9
9
  replyCommentContainerProps?: CreateReplyCommentContainerProps;
10
+ mentionColor?: string;
10
11
  };
11
12
  export declare const CommentContainer: React.FC<CommentContainerProps>;
package/dist/index.d.ts CHANGED
@@ -207,6 +207,7 @@ type CommentContainerProps = {
207
207
  commentItemProps?: CommentItemExtraProps;
208
208
  replyCommentItemProps?: CommentItemExtraProps;
209
209
  replyCommentContainerProps?: CreateReplyCommentContainerProps;
210
+ mentionColor?: string;
210
211
  };
211
212
 
212
213
  type CommentSubscriptionDialogProps = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-easy-wall",
3
- "version": "3.5.16",
3
+ "version": "3.5.18",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/index.d.ts",