@bigbinary/neeto-molecules 5.3.13 → 5.3.14

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Engagements.js","sources":["../../../src/v2/components/Engagements/Activity/Icon.jsx","../../../src/v2/components/Engagements/Activity/index.jsx","../../../src/v2/components/Engagements/Comment/Header.jsx","../../../src/v2/components/Engagements/Comment/Reactions.jsx","../../../src/v2/components/Engagements/constants.js","../../../src/v2/components/Engagements/utils.js","../../../src/v2/components/Engagements/Comment/index.jsx","../../../src/v2/components/Engagements/index.jsx"],"sourcesContent":["import classNames from \"classnames\";\n\nconst ActivityIcon = ({ icon, unread }) => (\n <div className=\"bg-card relative z-10 mx-0.5 flex-shrink-0 rounded-full\">\n <span\n className={classNames(\n \"nm-activity-node-icon bg-muted text-muted-foreground relative flex h-7 w-7 items-center justify-center rounded-full p-1 [&>svg]:size-4\",\n { \"text-primary bg-primary/10\": unread }\n )}\n >\n {icon}\n {unread && (\n <span className=\"bg-primary absolute -end-0.5 -top-0.5 h-2 w-2 rounded-full\" />\n )}\n </span>\n </div>\n);\n\nexport default ActivityIcon;\n","import { Avatar } from \"@bigbinary/neeto-atoms\";\nimport classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport ActivityIcon from \"./Icon\";\n\nconst Activity = ({\n user,\n icon,\n unread = false,\n className,\n children,\n userIcon,\n}) => (\n <div\n className={classNames(\n \"nm-engagements-node relative -mt-4 flex items-center gap-2 px-4 py-4\",\n \"before:bg-border before:absolute before:start-[31px] before:top-0 before:h-full before:w-0.5 before:content-['']\",\n className\n )}\n >\n <ActivityIcon {...{ icon, unread }} />\n {userIcon || (\n <Avatar\n className=\"!size-[18px] [&_[data-slot=avatar-fallback]]:text-[10px]\"\n size=\"sm\"\n user={{ name: user.name, imageUrl: user.profileImageUrl }}\n />\n )}\n <div className=\"nm-engagements-node__children\">{children}</div>\n </div>\n);\n\nActivity.propTypes = {\n user: PropTypes.shape({ name: PropTypes.string.isRequired }).isRequired,\n icon: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,\n unread: PropTypes.bool,\n className: PropTypes.string,\n};\n\nexport default Activity;\n","import { Avatar, Typography } from \"@bigbinary/neeto-atoms\";\nimport { isPresent } from \"neetocist\";\n\nimport DateFormat from \"../../DateFormat\";\nimport MoreDropdown from \"../../MoreDropdown\";\n\nconst CommentHeader = ({ user, comment, info, actions }) => {\n const avatar = { name: user.name, imageUrl: user.profileImageUrl };\n\n return (\n <div className=\"bg-muted/40 border-border flex items-center justify-between rounded-t-md border-b py-1 ps-4 pe-1\">\n <div className=\"flex min-w-0 flex-grow flex-wrap items-center gap-2\">\n <Avatar size=\"sm\" user={avatar} />\n <Typography as=\"span\" variant=\"body3\" weight=\"semibold\">\n {user.name}\n </Typography>\n <Typography as=\"span\" color=\"muted\" variant=\"body3\">\n •\n </Typography>\n {info && (\n <>\n <Typography\n as=\"span\"\n className=\"lowercase\"\n color=\"muted\"\n variant=\"body3\"\n >\n {info}\n </Typography>\n <Typography as=\"span\" color=\"muted\" variant=\"body3\">\n •\n </Typography>\n </>\n )}\n {comment.createdAt && (\n <DateFormat.FromNow\n date={comment.createdAt}\n typographyProps={{ color: \"muted\", variant: \"body3\" }}\n />\n )}\n </div>\n {isPresent(actions) && (\n <MoreDropdown\n dropdownButtonProps={{ className: \"self-start flex-shrink-0\" }}\n dropdownProps={{ position: \"bottom-start\" }}\n menuItems={actions}\n />\n )}\n </div>\n );\n};\n\nexport default CommentHeader;\n","import { memo } from \"react\";\n\nimport { Button, Tooltip } from \"@bigbinary/neeto-atoms\";\nimport classNames from \"classnames\";\nimport { findIndexBy } from \"neetocist\";\nimport { globalProps } from \"neetocommons/v2/initializers\";\nimport { collectBy, eqProps, pathEq, prop } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport EmojiPicker from \"../../EmojiPicker\";\n\nconst findOwnIndex = findIndexBy({ userId: globalProps.user.id });\nconst groupReactions = collectBy(prop(\"unified\"));\n\nconst Reactions = ({ reactions, onAdd, onRemove }) => {\n const { t } = useTranslation();\n const groups = groupReactions(reactions);\n\n const onSelect = emoji => {\n const group = groups.find(pathEq(emoji.unified, [0, \"unified\"]));\n if (group && findOwnIndex(group) >= 0) return;\n onAdd({ ...emoji, emoji: emoji.native });\n };\n\n return (\n <div className=\"mt-3 flex flex-wrap items-center gap-1\">\n <div className=\"bg-muted rounded-full\">\n <EmojiPicker {...{ onSelect }} />\n </div>\n {groups.map(reactionsGroup => {\n const ownIndex = findOwnIndex(reactionsGroup);\n const selected = ownIndex >= 0;\n const reaction = selected\n ? reactionsGroup[ownIndex]\n : reactionsGroup[0];\n\n const names = reactionsGroup\n .map(({ reactor }) =>\n typeof reactor === \"string\" ? reactor : reactor?.name\n )\n .filter(Boolean)\n .join(\", \");\n\n return (\n <Tooltip\n content={t(\"neetoMolecules.engagements.namesReacted\", { names })}\n key={reaction.unified}\n position=\"top\"\n >\n <Button\n aria-pressed={selected}\n size=\"xs\"\n variant=\"ghost\"\n className={classNames(\n \"h-7 rounded-full px-2 text-sm font-normal\",\n {\n \"!bg-muted !hover:bg-muted/80\": selected,\n \"!bg-muted/50\": !selected,\n }\n )}\n onClick={() => (selected ? onRemove : onAdd)(reaction)}\n >\n <span>{reaction.emoji}</span>\n <span>{reactionsGroup.length}</span>\n </Button>\n </Tooltip>\n );\n })}\n </div>\n );\n};\n\nexport default memo(Reactions, eqProps(\"reactions\"));\n","export const ACTIVITY_TYPES = {\n TIMELINE: \"Timeline\",\n FIELD_VALUE: \"FieldValue\",\n TASK: \"Task\",\n ASSIGNEE: \"Assignee\",\n CHECKLIST: \"Checklist\",\n FIELD: \"Field\",\n PROJECT: \"Project\",\n COMMENT: \"Comment\",\n DOCUMENT: \"Document\",\n CHAT_MESSAGE: \"ChatMessage\",\n MESSAGE: \"Message\",\n SECTION: \"Section\",\n PROJECT_MEMBER: \"ProjectMember\",\n PULL_REQUEST: \"NeetoGithubEngine::PullRequest\",\n};\n\nexport const ENGAGEMENT_TYPES = {\n COMMENT: \"comment\",\n ACTIVITY: \"activity\",\n};\n","import { ENGAGEMENT_TYPES } from \"./constants\";\n\nexport const createCommentElementId = comment =>\n `nm-engagement-comment--${comment.id}`;\n\nexport const defaultMatchType = engagement => {\n if (engagement.commenter) return ENGAGEMENT_TYPES.COMMENT;\n else if (engagement.creator) return ENGAGEMENT_TYPES.ACTIVITY;\n\n return null;\n};\n","import { forwardRef } from \"react\";\n\nimport classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport CommentHeader from \"./Header\";\nimport Reactions from \"./Reactions\";\n\nimport { createCommentElementId } from \"../utils\";\n\nconst Comment = forwardRef(\n (\n {\n user,\n comment,\n reactions,\n info,\n actions,\n className,\n children,\n onAddReaction,\n onRemoveReaction,\n },\n ref\n ) => (\n <div\n {...{ ref }}\n id={createCommentElementId(comment)}\n className={classNames(\n \"nm-comments-node bg-card border-border relative mb-4 w-full rounded-md border\",\n \"before:bg-border before:absolute before:start-[30px] before:top-[calc(100%+1px)] before:h-4 before:w-0.5 before:content-['']\",\n className\n )}\n >\n <CommentHeader {...{ actions, comment, info, user }} />\n <div className=\"nm-comments-node__inner p-4\">\n {children}\n {reactions !== false && (\n <Reactions\n {...{ reactions }}\n onAdd={onAddReaction}\n onRemove={onRemoveReaction}\n />\n )}\n </div>\n </div>\n )\n);\n\nComment.displayName = \"Comment\";\nComment.propTypes = {\n user: PropTypes.shape({ name: PropTypes.string.isRequired }).isRequired,\n comment: PropTypes.shape({\n id: PropTypes.string.isRequired,\n createdAt: PropTypes.string,\n }).isRequired,\n reactions: PropTypes.oneOfType([PropTypes.array, PropTypes.bool]),\n info: PropTypes.string,\n actions: PropTypes.arrayOf(\n PropTypes.shape({\n isVisible: PropTypes.bool,\n key: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n })\n ),\n className: PropTypes.string,\n onAddReaction: PropTypes.func,\n onRemoveReaction: PropTypes.func,\n};\n\nexport default Comment;\n","import React from \"react\";\n\nimport { noop } from \"neetocist\";\nimport PropTypes from \"prop-types\";\n\nimport Activity from \"./Activity\";\nimport Comment from \"./Comment\";\nimport { ENGAGEMENT_TYPES } from \"./constants\";\nimport { defaultMatchType } from \"./utils\";\n\nconst Engagements = ({\n data,\n isActivitiesEnabled = false,\n matchType = defaultMatchType,\n renderComment,\n renderActivity,\n}) => {\n const rendererHashmap = {\n [ENGAGEMENT_TYPES.COMMENT]: renderComment,\n [ENGAGEMENT_TYPES.ACTIVITY]: isActivitiesEnabled ? renderActivity : noop,\n };\n\n return (\n <>\n {data.map((engagement, index) => {\n const type = matchType(engagement);\n const renderer = rendererHashmap[type];\n if (!renderer) return null;\n\n return (\n <React.Fragment key={engagement.id}>\n {renderer(engagement, index)}\n </React.Fragment>\n );\n })}\n </>\n );\n};\n\nEngagements.displayName = \"Engagements\";\nEngagements.Comment = Comment;\nEngagements.Activity = Activity;\nEngagements.TYPES = ENGAGEMENT_TYPES;\n\nEngagements.propTypes = {\n data: PropTypes.arrayOf(PropTypes.shape({ id: PropTypes.string.isRequired }))\n .isRequired,\n isActivitiesEnabled: PropTypes.bool,\n matchType: PropTypes.func,\n renderComment: PropTypes.func.isRequired,\n renderActivity: PropTypes.func.isRequired,\n};\n\nexport default Engagements;\n"],"names":["ActivityIcon","_ref","icon","unread","_jsx","className","children","_jsxs","classNames","Activity","user","_ref$unread","userIcon","Avatar","size","name","imageUrl","profileImageUrl","CommentHeader","comment","info","actions","avatar","Typography","as","variant","weight","color","_Fragment","createdAt","DateFormat","FromNow","date","typographyProps","isPresent","MoreDropdown","dropdownButtonProps","dropdownProps","position","menuItems","findOwnIndex","findIndexBy","userId","globalProps","id","groupReactions","collectBy","prop","Reactions","reactions","onAdd","onRemove","_useTranslation","useTranslation","t","groups","onSelect","emoji","group","find","pathEq","unified","_objectSpread","EmojiPicker","map","reactionsGroup","ownIndex","selected","reaction","names","_ref2","reactor","filter","Boolean","join","Tooltip","content","Button","onClick","length","memo","eqProps","ENGAGEMENT_TYPES","COMMENT","ACTIVITY","createCommentElementId","concat","defaultMatchType","engagement","commenter","creator","Comment","forwardRef","ref","onAddReaction","onRemoveReaction","displayName","propTypes","PropTypes","shape","string","isRequired","oneOfType","array","bool","arrayOf","isVisible","key","label","func","Engagements","data","_ref$isActivitiesEnab","isActivitiesEnabled","_ref$matchType","matchType","renderComment","renderActivity","rendererHashmap","_defineProperty","noop","index","type","renderer","React","Fragment","TYPES"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;AAAA,EAAA,oBAClCC,cAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,yDAAyD;AAAAC,IAAAA,QAAA,eACtEC,eAAA,CAAA,MAAA,EAAA;AACEF,MAAAA,SAAS,EAAEG,UAAU,CACnB,wIAAwI,EACxI;AAAE,QAAA,4BAA4B,EAAEL;AAAO,OACzC,CAAE;AAAAG,MAAAA,QAAA,EAAA,CAEDJ,IAAI,EACJC,MAAM,iBACLC,cAAA,CAAA,MAAA,EAAA;AAAMC,QAAAA,SAAS,EAAC;AAA4D,OAAE,CAC/E;KACG;AAAC,GACJ,CAAC;AAAA,CACP;;ACVD,IAAMI,QAAQ,GAAG,SAAXA,QAAQA,CAAAR,IAAA,EAAA;AAAA,EAAA,IACZS,IAAI,GAAAT,IAAA,CAAJS,IAAI;IACJR,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAAS,WAAA,GAAAV,IAAA,CACJE,MAAM;AAANA,IAAAA,MAAM,GAAAQ,WAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,WAAA;IACdN,SAAS,GAAAJ,IAAA,CAATI,SAAS;IACTC,QAAQ,GAAAL,IAAA,CA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aAAa,CAAA,EACxClC,gBAAgB,CAACE,QAAQ,EAAG6B,mBAAmB,GAAGI,cAAc,GAAGG,cAAI,CACzE;EAED,oBACEpH,cAAA,CAAAwB,mBAAA,EAAA;IAAAtB,QAAA,EACGyG,IAAI,CAAC/C,GAAG,CAAC,UAACwB,UAAU,EAAEiC,KAAK,EAAK;AAC/B,MAAA,IAAMC,IAAI,GAAGP,SAAS,CAAC3B,UAAU,CAAC;AAClC,MAAA,IAAMmC,QAAQ,GAAGL,eAAe,CAACI,IAAI,CAAC;AACtC,MAAA,IAAI,CAACC,QAAQ,EAAE,OAAO,IAAI;AAE1B,MAAA,oBACEvH,cAAA,CAACwH,KAAK,CAACC,QAAQ,EAAA;AAAAvH,QAAAA,QAAA,EACZqH,QAAQ,CAACnC,UAAU,EAAEiC,KAAK;OAAC,EADTjC,UAAU,CAAC5C,EAEhB,CAAC;IAErB,CAAC;AAAC,GACF,CAAC;AAEP;AAEAkE,WAAW,CAACd,WAAW,GAAG,aAAa;AACvCc,WAAW,CAACnB,OAAO,GAAGA,OAAO;AAC7BmB,WAAW,CAACrG,QAAQ,GAAGA,QAAQ;AAC/BqG,WAAW,CAACgB,KAAK,GAAG5C,gBAAgB;;;;"}
1
+ {"version":3,"file":"Engagements.js","sources":["../../../src/v2/components/Engagements/Activity/Icon.jsx","../../../src/v2/components/Engagements/Activity/index.jsx","../../../src/v2/components/Engagements/Comment/Header.jsx","../../../src/v2/components/Engagements/Comment/Reactions.jsx","../../../src/v2/components/Engagements/constants.js","../../../src/v2/components/Engagements/utils.js","../../../src/v2/components/Engagements/Comment/index.jsx","../../../src/v2/components/Engagements/index.jsx"],"sourcesContent":["import classNames from \"classnames\";\n\nconst ActivityIcon = ({ icon, unread }) => (\n <div className=\"bg-card relative z-10 mx-0.5 flex-shrink-0 rounded-full\">\n <span\n className={classNames(\n \"nm-activity-node-icon bg-muted text-muted-foreground relative flex h-7 w-7 items-center justify-center rounded-full p-1 [&>svg]:size-4\",\n { \"text-primary bg-primary/10\": unread }\n )}\n >\n {icon}\n {unread && (\n <span className=\"bg-primary absolute -end-0.5 -top-0.5 h-2 w-2 rounded-full\" />\n )}\n </span>\n </div>\n);\n\nexport default ActivityIcon;\n","import { Avatar } from \"@bigbinary/neeto-atoms\";\nimport classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport ActivityIcon from \"./Icon\";\n\nconst Activity = ({\n user,\n icon,\n unread = false,\n className,\n children,\n userIcon,\n}) => (\n <div\n className={classNames(\n \"nm-engagements-node relative -mt-4 flex items-center gap-2 px-4 py-4\",\n \"before:bg-border before:absolute before:start-[31px] before:top-0 before:h-full before:w-0.5 before:content-['']\",\n className\n )}\n >\n <ActivityIcon {...{ icon, unread }} />\n {userIcon || (\n <Avatar\n className=\"!size-[18px] [&_[data-slot=avatar-fallback]]:text-[10px]\"\n size=\"sm\"\n user={{ name: user.name, imageUrl: user.profileImageUrl }}\n />\n )}\n <div className=\"nm-engagements-node__children\">{children}</div>\n </div>\n);\n\nActivity.propTypes = {\n user: PropTypes.shape({ name: PropTypes.string.isRequired }).isRequired,\n icon: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,\n unread: PropTypes.bool,\n className: PropTypes.string,\n};\n\nexport default Activity;\n","import { Avatar, Typography } from \"@bigbinary/neeto-atoms\";\nimport { isPresent } from \"neetocist\";\n\nimport DateFormat from \"../../DateFormat\";\nimport MoreDropdown from \"../../MoreDropdown\";\n\nconst CommentHeader = ({ user, comment, info, actions }) => {\n const avatar = { name: user.name, imageUrl: user.profileImageUrl };\n\n return (\n <div className=\"bg-muted/40 border-border flex items-center justify-between rounded-t-md border-b py-1 ps-4 pe-1\">\n <div className=\"flex min-w-0 flex-grow flex-wrap items-center gap-2\">\n <Avatar size=\"sm\" user={avatar} />\n <Typography as=\"span\" variant=\"body3\" weight=\"medium\">\n {user.name}\n </Typography>\n <Typography as=\"span\" color=\"muted\" variant=\"body3\">\n •\n </Typography>\n {info && (\n <>\n <Typography\n as=\"span\"\n className=\"lowercase\"\n color=\"muted\"\n variant=\"body3\"\n >\n {info}\n </Typography>\n <Typography as=\"span\" color=\"muted\" variant=\"body3\">\n •\n </Typography>\n </>\n )}\n {comment.createdAt && (\n <DateFormat.FromNow\n date={comment.createdAt}\n typographyProps={{ color: \"muted\", variant: \"body3\" }}\n />\n )}\n </div>\n {isPresent(actions) && (\n <MoreDropdown\n dropdownButtonProps={{ className: \"self-start flex-shrink-0\" }}\n dropdownProps={{ position: \"bottom-start\" }}\n menuItems={actions}\n />\n )}\n </div>\n );\n};\n\nexport default CommentHeader;\n","import { memo } from \"react\";\n\nimport { Button, Tooltip } from \"@bigbinary/neeto-atoms\";\nimport classNames from \"classnames\";\nimport { findIndexBy } from \"neetocist\";\nimport { globalProps } from \"neetocommons/v2/initializers\";\nimport { collectBy, eqProps, pathEq, prop } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport EmojiPicker from \"../../EmojiPicker\";\n\nconst findOwnIndex = findIndexBy({ userId: globalProps.user.id });\nconst groupReactions = collectBy(prop(\"unified\"));\n\nconst Reactions = ({ reactions, onAdd, onRemove }) => {\n const { t } = useTranslation();\n const groups = groupReactions(reactions);\n\n const onSelect = emoji => {\n const group = groups.find(pathEq(emoji.unified, [0, \"unified\"]));\n if (group && findOwnIndex(group) >= 0) return;\n onAdd({ ...emoji, emoji: emoji.native });\n };\n\n return (\n <div className=\"mt-3 flex flex-wrap items-center gap-1\">\n <div className=\"bg-muted rounded-full\">\n <EmojiPicker {...{ onSelect }} />\n </div>\n {groups.map(reactionsGroup => {\n const ownIndex = findOwnIndex(reactionsGroup);\n const selected = ownIndex >= 0;\n const reaction = selected\n ? reactionsGroup[ownIndex]\n : reactionsGroup[0];\n\n const names = reactionsGroup\n .map(({ reactor }) =>\n typeof reactor === \"string\" ? reactor : reactor?.name\n )\n .filter(Boolean)\n .join(\", \");\n\n return (\n <Tooltip\n content={t(\"neetoMolecules.engagements.namesReacted\", { names })}\n key={reaction.unified}\n position=\"top\"\n >\n <Button\n aria-pressed={selected}\n size=\"xs\"\n variant=\"ghost\"\n className={classNames(\n \"h-7 rounded-full px-2 text-sm font-normal\",\n {\n \"!bg-muted !hover:bg-muted/80\": selected,\n \"!bg-muted/50\": !selected,\n }\n )}\n onClick={() => (selected ? onRemove : onAdd)(reaction)}\n >\n <span>{reaction.emoji}</span>\n <span>{reactionsGroup.length}</span>\n </Button>\n </Tooltip>\n );\n })}\n </div>\n );\n};\n\nexport default memo(Reactions, eqProps(\"reactions\"));\n","export const ACTIVITY_TYPES = {\n TIMELINE: \"Timeline\",\n FIELD_VALUE: \"FieldValue\",\n TASK: \"Task\",\n ASSIGNEE: \"Assignee\",\n CHECKLIST: \"Checklist\",\n FIELD: \"Field\",\n PROJECT: \"Project\",\n COMMENT: \"Comment\",\n DOCUMENT: \"Document\",\n CHAT_MESSAGE: \"ChatMessage\",\n MESSAGE: \"Message\",\n SECTION: \"Section\",\n PROJECT_MEMBER: \"ProjectMember\",\n PULL_REQUEST: \"NeetoGithubEngine::PullRequest\",\n};\n\nexport const ENGAGEMENT_TYPES = {\n COMMENT: \"comment\",\n ACTIVITY: \"activity\",\n};\n","import { ENGAGEMENT_TYPES } from \"./constants\";\n\nexport const createCommentElementId = comment =>\n `nm-engagement-comment--${comment.id}`;\n\nexport const defaultMatchType = engagement => {\n if (engagement.commenter) return ENGAGEMENT_TYPES.COMMENT;\n else if (engagement.creator) return ENGAGEMENT_TYPES.ACTIVITY;\n\n return null;\n};\n","import { forwardRef } from \"react\";\n\nimport classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport CommentHeader from \"./Header\";\nimport Reactions from \"./Reactions\";\n\nimport { createCommentElementId } from \"../utils\";\n\nconst Comment = forwardRef(\n (\n {\n user,\n comment,\n reactions,\n info,\n actions,\n className,\n children,\n onAddReaction,\n onRemoveReaction,\n },\n ref\n ) => (\n <div\n {...{ ref }}\n id={createCommentElementId(comment)}\n className={classNames(\n \"nm-comments-node bg-card border-border relative mb-4 w-full rounded-md border\",\n \"before:bg-border before:absolute before:start-[30px] before:top-[calc(100%+1px)] before:h-4 before:w-0.5 before:content-['']\",\n className\n )}\n >\n <CommentHeader {...{ actions, comment, info, user }} />\n <div className=\"nm-comments-node__inner p-4\">\n {children}\n {reactions !== false && (\n <Reactions\n {...{ reactions }}\n onAdd={onAddReaction}\n onRemove={onRemoveReaction}\n />\n )}\n </div>\n </div>\n )\n);\n\nComment.displayName = \"Comment\";\nComment.propTypes = {\n user: PropTypes.shape({ name: PropTypes.string.isRequired }).isRequired,\n comment: PropTypes.shape({\n id: PropTypes.string.isRequired,\n createdAt: PropTypes.string,\n }).isRequired,\n reactions: PropTypes.oneOfType([PropTypes.array, PropTypes.bool]),\n info: PropTypes.string,\n actions: PropTypes.arrayOf(\n PropTypes.shape({\n isVisible: PropTypes.bool,\n key: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n })\n ),\n className: PropTypes.string,\n onAddReaction: PropTypes.func,\n onRemoveReaction: PropTypes.func,\n};\n\nexport default Comment;\n","import React from \"react\";\n\nimport { noop } from \"neetocist\";\nimport PropTypes from \"prop-types\";\n\nimport Activity from \"./Activity\";\nimport Comment from \"./Comment\";\nimport { ENGAGEMENT_TYPES } from \"./constants\";\nimport { defaultMatchType } from \"./utils\";\n\nconst Engagements = ({\n data,\n isActivitiesEnabled = false,\n matchType = defaultMatchType,\n renderComment,\n renderActivity,\n}) => {\n const rendererHashmap = {\n [ENGAGEMENT_TYPES.COMMENT]: renderComment,\n [ENGAGEMENT_TYPES.ACTIVITY]: isActivitiesEnabled ? renderActivity : noop,\n };\n\n return (\n <>\n {data.map((engagement, index) => {\n const type = matchType(engagement);\n const renderer = rendererHashmap[type];\n if (!renderer) return null;\n\n return (\n <React.Fragment key={engagement.id}>\n {renderer(engagement, index)}\n </React.Fragment>\n );\n })}\n </>\n );\n};\n\nEngagements.displayName = \"Engagements\";\nEngagements.Comment = Comment;\nEngagements.Activity = Activity;\nEngagements.TYPES = ENGAGEMENT_TYPES;\n\nEngagements.propTypes = {\n data: PropTypes.arrayOf(PropTypes.shape({ id: PropTypes.string.isRequired }))\n .isRequired,\n isActivitiesEnabled: PropTypes.bool,\n matchType: PropTypes.func,\n renderComment: PropTypes.func.isRequired,\n renderActivity: PropTypes.func.isRequired,\n};\n\nexport default Engagements;\n"],"names":["ActivityIcon","_ref","icon","unread","_jsx","className","children","_jsxs","classNames","Activity","user","_ref$unread","userIcon","Avatar","size","name","imageUrl","profileImageUrl","CommentHeader","comment","info","actions","avatar","Typography","as","variant","weight","color","_Fragment","createdAt","DateFormat","FromNow","date","typographyProps","isPresent","MoreDropdown","dropdownButtonProps","dropdownProps","position","menuItems","findOwnIndex","findIndexBy","userId","globalProps","id","groupReactions","collectBy","prop","Reactions","reactions","onAdd","onRemove","_useTranslation","useTranslation","t","groups","onSelect","emoji","group","find","pathEq","unified","_objectSpread","EmojiPicker","map","reactionsGroup","ownIndex","selected","reaction","names","_ref2","reactor","filter","Boolean","join","Tooltip","content","Button","onClick","length","memo","eqProps","ENGAGEMENT_TYPES","COMMENT","ACTIVITY","createCommentElementId","concat","defaultMatchType","engagement","commenter","creator","Comment","forwardRef","ref","onAddReaction","onRemoveReaction","displayName","propTypes","PropTypes","shape","string","isRequired","oneOfType","array","bool","arrayOf","isVisible","key","label","func","Engagements","data","_ref$isActivitiesEnab","isActivitiesEnabled","_ref$matchType","matchType","renderComment","renderActivity","rendererHashmap","_defineProperty","noop","index","type","renderer","React","Fragment","TYPES"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;AAAA,EAAA,oBAClCC,cAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,yDAAyD;AAAAC,IAAAA,QAA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,GAAG,aAAa;AACvCc,WAAW,CAACnB,OAAO,GAAGA,OAAO;AAC7BmB,WAAW,CAACrG,QAAQ,GAAGA,QAAQ;AAC/BqG,WAAW,CAACgB,KAAK,GAAG5C,gBAAgB;;;;"}
@@ -24,15 +24,16 @@ var reactQuery = require('@tanstack/react-query');
24
24
  var axios = require('axios');
25
25
  var search = require('../search-DoXqXFel.js');
26
26
  var useBreakpoints = require('@bigbinary/neeto-commons-frontend/v2/react-utils/useBreakpoints');
27
+ var urls = require('../urls-CC4qs7hW.js');
27
28
  var i18next = require('i18next');
28
- var utils = require('@bigbinary/neeto-commons-frontend/v2/utils');
29
- var axios$1 = require('@bigbinary/neeto-commons-frontend/v2/utils/axios');
30
- var general = require('@bigbinary/neeto-commons-frontend/v2/utils/general');
31
29
  var createLucideIcon = require('../createLucideIcon-BbuuRL2u.js');
32
30
  var circleQuestionMark = require('../circle-question-mark-BijjM_4y.js');
33
31
  var chevronRight = require('../chevron-right-BVivH_B-.js');
34
32
  var user = require('../user-bZmvS8wE.js');
35
33
  var useLocalStorage = require('@bigbinary/neeto-commons-frontend/v2/react-utils/useLocalStorage');
34
+ var utils = require('@bigbinary/neeto-commons-frontend/v2/utils');
35
+ var axios$1 = require('@bigbinary/neeto-commons-frontend/v2/utils/axios');
36
+ var general = require('@bigbinary/neeto-commons-frontend/v2/utils/general');
36
37
  var v2_CopyToClipboardButton = require('./CopyToClipboardButton.js');
37
38
  require('../useKeyboardShortcutsPaneState-DZUnpw9v.js');
38
39
  require('zustand/shallow');
@@ -605,72 +606,6 @@ var MENU_ITEM_CLASSES = "gap-2.5 px-2.5 py-2 font-medium [&>[data-slot=menu-item
605
606
  var THEME_BUTTON_BASE = "relative z-10 flex items-center justify-center gap-1 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none";
606
607
  var THEME_ICON_BASE = "transition-transform duration-300 ease-out";
607
608
 
608
- var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
609
- var _globalProps$user, _globalProps$user2;
610
- var user = ((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.email) || ((_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.phoneNumber);
611
- return "sidebarState-".concat(user);
612
- };
613
- var getUserProfileInfo = function getUserProfileInfo() {
614
- var _globalProps$user$fir, _globalProps$user3, _globalProps$user$las, _globalProps$user4, _globalProps$user5, _globalProps$user6, _globalProps$user7;
615
- return {
616
- name: "".concat((_globalProps$user$fir = (_globalProps$user3 = globalProps.user) === null || _globalProps$user3 === void 0 ? void 0 : _globalProps$user3.firstName) !== null && _globalProps$user$fir !== void 0 ? _globalProps$user$fir : "", " ").concat((_globalProps$user$las = (_globalProps$user4 = globalProps.user) === null || _globalProps$user4 === void 0 ? void 0 : _globalProps$user4.lastName) !== null && _globalProps$user$las !== void 0 ? _globalProps$user$las : ""),
617
- imageUrl: globalProps.authenticated ? (_globalProps$user5 = globalProps.user) === null || _globalProps$user5 === void 0 ? void 0 : _globalProps$user5.profileImageUrl : "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
618
- email: ((_globalProps$user6 = globalProps.user) === null || _globalProps$user6 === void 0 ? void 0 : _globalProps$user6.email) || ((_globalProps$user7 = globalProps.user) === null || _globalProps$user7 === void 0 ? void 0 : _globalProps$user7.phoneNumber),
619
- isAuthenticated: globalProps.authenticated
620
- };
621
- };
622
- var getConsumerProfileInfo = function getConsumerProfileInfo() {
623
- var _globalProps$consumer, _globalProps$consumer2, _globalProps$consumer3, _globalProps$consumer4, _globalProps$consumer5, _globalProps$consumer6, _globalProps$consumer7;
624
- return {
625
- name: "".concat((_globalProps$consumer = (_globalProps$consumer2 = globalProps.consumer) === null || _globalProps$consumer2 === void 0 ? void 0 : _globalProps$consumer2.firstName) !== null && _globalProps$consumer !== void 0 ? _globalProps$consumer : "", " ").concat((_globalProps$consumer3 = (_globalProps$consumer4 = globalProps.consumer) === null || _globalProps$consumer4 === void 0 ? void 0 : _globalProps$consumer4.lastName) !== null && _globalProps$consumer3 !== void 0 ? _globalProps$consumer3 : ""),
626
- imageUrl: ((_globalProps$consumer5 = globalProps.consumer) === null || _globalProps$consumer5 === void 0 ? void 0 : _globalProps$consumer5.profileImageUrl) || "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
627
- email: ((_globalProps$consumer6 = globalProps.consumer) === null || _globalProps$consumer6 === void 0 ? void 0 : _globalProps$consumer6.email) || ((_globalProps$consumer7 = globalProps.consumer) === null || _globalProps$consumer7 === void 0 ? void 0 : _globalProps$consumer7.phoneNumber),
628
- isAuthenticated: globalProps.isConsumer
629
- };
630
- };
631
- var getDefaultBottomLinks = function getDefaultBottomLinks(isAuthenticated, isConsumer) {
632
- return [isAuthenticated ? {
633
- label: i18next.t("neetoMolecules.sidebar.logout"),
634
- icon: LogOut,
635
- onClick: function onClick() {
636
- axios$1.resetAuthTokens();
637
- general.removeFromLocalStorage(getSidebarStateLocalStorageKey());
638
- isConsumer ? window.location.href = "/consumers/logout?redirect_uri=".concat(window.location.href) : window.location.href = "/logout";
639
- },
640
- "data-testid": "profile-logout-button"
641
- } : {
642
- label: i18next.t("neetoMolecules.sidebar.login"),
643
- onClick: function onClick() {
644
- window.location.href = "/login";
645
- },
646
- "data-testid": "profile-login-button"
647
- }];
648
- };
649
- var getProfileInfo = function getProfileInfo(profileInfoOverrides, isConsumer) {
650
- return ramda.mergeDeepLeft(profileInfoOverrides, isConsumer ? getConsumerProfileInfo() : getUserProfileInfo());
651
- };
652
-
653
- // Theme switcher utils.
654
- var setDarkTheme = function setDarkTheme() {
655
- if (!document.body) return;
656
- document.body.classList.remove(THEMES.LIGHT, LEGACY_THEMES.LIGHT);
657
- document.body.classList.add(THEMES.DARK, LEGACY_THEMES.DARK);
658
- };
659
- var setLightTheme = function setLightTheme() {
660
- if (!document.body) return;
661
- document.body.classList.remove(THEMES.DARK, LEGACY_THEMES.DARK);
662
- document.body.classList.add(THEMES.LIGHT, LEGACY_THEMES.LIGHT);
663
- };
664
- var setAppTheme = function setAppTheme() {
665
- var storedTheme = utils.getFromLocalStorage(APP_THEME_LOCALSTORAGE_KEY);
666
- var isDarkTheme = storedTheme === THEMES.DARK || storedTheme === LEGACY_THEMES.DARK;
667
- isDarkTheme ? setDarkTheme() : setLightTheme();
668
- };
669
- var getRoadmapUrl = function getRoadmapUrl() {
670
- var _globalProps;
671
- return "https://roadmap.".concat(ramda.toLower(((_globalProps = globalProps) === null || _globalProps === void 0 ? void 0 : _globalProps.appName) || ""), ".com");
672
- };
673
-
674
609
  var _excluded$2 = ["className"];
675
610
  function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
676
611
  function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -685,12 +620,11 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
685
620
  MenuItem.displayName = "FloatingActionMenu.MenuItem";
686
621
 
687
622
  var HelpItems = reactUtils.withT(function (_ref) {
688
- var _globalProps;
689
623
  var t = _ref.t;
690
624
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
691
625
  children: [/*#__PURE__*/jsxRuntime.jsx(MenuItem, {
692
626
  "data-testid": "help-link-help-articles-button",
693
- href: "https://help.".concat(ramda.toLower(((_globalProps = globalProps) === null || _globalProps === void 0 ? void 0 : _globalProps.appName) || ""), ".com/"),
627
+ href: "".concat(urls.getNeetoUrl("help"), "/"),
694
628
  prefix: /*#__PURE__*/jsxRuntime.jsx(BookOpen, {
695
629
  size: 18
696
630
  }),
@@ -719,7 +653,7 @@ var HelpItems = reactUtils.withT(function (_ref) {
719
653
  children: t("neetoMolecules.sidebar.helpLinks.askTheCommunity")
720
654
  }), /*#__PURE__*/jsxRuntime.jsx(MenuItem, {
721
655
  "data-testid": "help-link-request-feature-button",
722
- href: "".concat(getRoadmapUrl(), "/feature-requests"),
656
+ href: "".concat(urls.getNeetoUrl("engage"), "/feature-requests"),
723
657
  prefix: /*#__PURE__*/jsxRuntime.jsx(Lightbulb, {
724
658
  size: 18
725
659
  }),
@@ -728,7 +662,7 @@ var HelpItems = reactUtils.withT(function (_ref) {
728
662
  children: t("neetoMolecules.sidebar.helpLinks.requestFeature")
729
663
  }), /*#__PURE__*/jsxRuntime.jsx(MenuItem, {
730
664
  "data-testid": "help-link-roadmap-button",
731
- href: "".concat(getRoadmapUrl(), "/product-roadmap"),
665
+ href: "".concat(urls.getNeetoUrl("engage"), "/product-roadmap"),
732
666
  prefix: /*#__PURE__*/jsxRuntime.jsx(Map, {
733
667
  size: 18
734
668
  }),
@@ -1152,6 +1086,68 @@ var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
1152
1086
  });
1153
1087
  };
1154
1088
 
1089
+ var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
1090
+ var _globalProps$user, _globalProps$user2;
1091
+ var user = ((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.email) || ((_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.phoneNumber);
1092
+ return "sidebarState-".concat(user);
1093
+ };
1094
+ var getUserProfileInfo = function getUserProfileInfo() {
1095
+ var _globalProps$user$fir, _globalProps$user3, _globalProps$user$las, _globalProps$user4, _globalProps$user5, _globalProps$user6, _globalProps$user7;
1096
+ return {
1097
+ name: "".concat((_globalProps$user$fir = (_globalProps$user3 = globalProps.user) === null || _globalProps$user3 === void 0 ? void 0 : _globalProps$user3.firstName) !== null && _globalProps$user$fir !== void 0 ? _globalProps$user$fir : "", " ").concat((_globalProps$user$las = (_globalProps$user4 = globalProps.user) === null || _globalProps$user4 === void 0 ? void 0 : _globalProps$user4.lastName) !== null && _globalProps$user$las !== void 0 ? _globalProps$user$las : ""),
1098
+ imageUrl: globalProps.authenticated ? (_globalProps$user5 = globalProps.user) === null || _globalProps$user5 === void 0 ? void 0 : _globalProps$user5.profileImageUrl : "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
1099
+ email: ((_globalProps$user6 = globalProps.user) === null || _globalProps$user6 === void 0 ? void 0 : _globalProps$user6.email) || ((_globalProps$user7 = globalProps.user) === null || _globalProps$user7 === void 0 ? void 0 : _globalProps$user7.phoneNumber),
1100
+ isAuthenticated: globalProps.authenticated
1101
+ };
1102
+ };
1103
+ var getConsumerProfileInfo = function getConsumerProfileInfo() {
1104
+ var _globalProps$consumer, _globalProps$consumer2, _globalProps$consumer3, _globalProps$consumer4, _globalProps$consumer5, _globalProps$consumer6, _globalProps$consumer7;
1105
+ return {
1106
+ name: "".concat((_globalProps$consumer = (_globalProps$consumer2 = globalProps.consumer) === null || _globalProps$consumer2 === void 0 ? void 0 : _globalProps$consumer2.firstName) !== null && _globalProps$consumer !== void 0 ? _globalProps$consumer : "", " ").concat((_globalProps$consumer3 = (_globalProps$consumer4 = globalProps.consumer) === null || _globalProps$consumer4 === void 0 ? void 0 : _globalProps$consumer4.lastName) !== null && _globalProps$consumer3 !== void 0 ? _globalProps$consumer3 : ""),
1107
+ imageUrl: ((_globalProps$consumer5 = globalProps.consumer) === null || _globalProps$consumer5 === void 0 ? void 0 : _globalProps$consumer5.profileImageUrl) || "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
1108
+ email: ((_globalProps$consumer6 = globalProps.consumer) === null || _globalProps$consumer6 === void 0 ? void 0 : _globalProps$consumer6.email) || ((_globalProps$consumer7 = globalProps.consumer) === null || _globalProps$consumer7 === void 0 ? void 0 : _globalProps$consumer7.phoneNumber),
1109
+ isAuthenticated: globalProps.isConsumer
1110
+ };
1111
+ };
1112
+ var getDefaultBottomLinks = function getDefaultBottomLinks(isAuthenticated, isConsumer) {
1113
+ return [isAuthenticated ? {
1114
+ label: i18next.t("neetoMolecules.sidebar.logout"),
1115
+ icon: LogOut,
1116
+ onClick: function onClick() {
1117
+ axios$1.resetAuthTokens();
1118
+ general.removeFromLocalStorage(getSidebarStateLocalStorageKey());
1119
+ isConsumer ? window.location.href = "/consumers/logout?redirect_uri=".concat(window.location.href) : window.location.href = "/logout";
1120
+ },
1121
+ "data-testid": "profile-logout-button"
1122
+ } : {
1123
+ label: i18next.t("neetoMolecules.sidebar.login"),
1124
+ onClick: function onClick() {
1125
+ window.location.href = "/login";
1126
+ },
1127
+ "data-testid": "profile-login-button"
1128
+ }];
1129
+ };
1130
+ var getProfileInfo = function getProfileInfo(profileInfoOverrides, isConsumer) {
1131
+ return ramda.mergeDeepLeft(profileInfoOverrides, isConsumer ? getConsumerProfileInfo() : getUserProfileInfo());
1132
+ };
1133
+
1134
+ // Theme switcher utils.
1135
+ var setDarkTheme = function setDarkTheme() {
1136
+ if (!document.body) return;
1137
+ document.body.classList.remove(THEMES.LIGHT, LEGACY_THEMES.LIGHT);
1138
+ document.body.classList.add(THEMES.DARK, LEGACY_THEMES.DARK);
1139
+ };
1140
+ var setLightTheme = function setLightTheme() {
1141
+ if (!document.body) return;
1142
+ document.body.classList.remove(THEMES.DARK, LEGACY_THEMES.DARK);
1143
+ document.body.classList.add(THEMES.LIGHT, LEGACY_THEMES.LIGHT);
1144
+ };
1145
+ var setAppTheme = function setAppTheme() {
1146
+ var storedTheme = utils.getFromLocalStorage(APP_THEME_LOCALSTORAGE_KEY);
1147
+ var isDarkTheme = storedTheme === THEMES.DARK || storedTheme === LEGACY_THEMES.DARK;
1148
+ isDarkTheme ? setDarkTheme() : setLightTheme();
1149
+ };
1150
+
1155
1151
  var ThemeSwitcher = function ThemeSwitcher() {
1156
1152
  var _useTranslation = reactI18next.useTranslation(),
1157
1153
  t = _useTranslation.t;