@bigbinary/neeto-molecules 4.0.57 → 4.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Engagements.js +7 -7
- package/dist/Engagements.js.map +1 -1
- package/dist/ProductEmbed.js +94 -58
- package/dist/ProductEmbed.js.map +1 -1
- package/dist/cjs/Engagements.js +7 -7
- package/dist/cjs/Engagements.js.map +1 -1
- package/dist/cjs/ProductEmbed.js +92 -56
- package/dist/cjs/ProductEmbed.js.map +1 -1
- package/package.json +1 -1
- package/types/ProductEmbed.d.ts +40 -18
package/dist/cjs/Engagements.js
CHANGED
|
@@ -53,19 +53,19 @@ var Activity = function Activity(_ref) {
|
|
|
53
53
|
_ref$unread = _ref.unread,
|
|
54
54
|
unread = _ref$unread === void 0 ? false : _ref$unread,
|
|
55
55
|
className = _ref.className,
|
|
56
|
-
children = _ref.children
|
|
57
|
-
|
|
58
|
-
name: user.name,
|
|
59
|
-
imageUrl: user.profileImageUrl
|
|
60
|
-
};
|
|
56
|
+
children = _ref.children,
|
|
57
|
+
userIcon = _ref.userIcon;
|
|
61
58
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
62
59
|
className: classnames("neeto-molecules-engagements-node relative -mt-4 flex items-center gap-2 px-4 py-4", className),
|
|
63
60
|
children: [/*#__PURE__*/jsxRuntime.jsx(ActivityIcon, {
|
|
64
61
|
icon: icon,
|
|
65
62
|
unread: unread
|
|
66
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Avatar, {
|
|
63
|
+
}), userIcon || /*#__PURE__*/jsxRuntime.jsx(Avatar, {
|
|
67
64
|
size: "small",
|
|
68
|
-
user:
|
|
65
|
+
user: {
|
|
66
|
+
name: user.name,
|
|
67
|
+
imageUrl: user.profileImageUrl
|
|
68
|
+
}
|
|
69
69
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
70
70
|
className: "neeto-molecules-engagements-node__children",
|
|
71
71
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Engagements.js","sources":["../../src/components/Engagements/Activity/Icon.jsx","../../src/components/Engagements/Activity/index.jsx","../../src/components/Engagements/Comment/Header.jsx","../../src/components/Engagements/Comment/Reactions.jsx","../../src/components/Engagements/constants.js","../../src/components/Engagements/utils.js","../../src/components/Engagements/Comment/index.jsx","../../src/components/Engagements/index.jsx"],"sourcesContent":["import classNames from \"classnames\";\n\nconst ActivityIcon = ({ icon, unread }) => (\n <div className=\"mx-0.5 flex-shrink-0\">\n <span\n className={classNames(\n \"neeto-ui-bg-gray-200 neeto-ui-text-gray-600 neeto-ui-rounded-full neeto-molecules-activity-node-icon relative z-10 flex h-7 w-7 items-center justify-center p-1\",\n {\n \"neeto-ui-text-primary-600 neeto-ui-bg-primary-100\": unread,\n }\n )}\n >\n {icon}\n {unread && (\n <span className=\"neeto-ui-rounded-full neeto-ui-bg-primary-800 absolute -right-0.5 -top-0.5 h-2 w-2\" />\n )}\n </span>\n </div>\n);\n\nexport default ActivityIcon;\n","import classNames from \"classnames\";\nimport { Avatar } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport ActivityIcon from \"./Icon\";\n\nconst Activity = ({ user, icon, unread = false, className, children }) => {\n const avatar = { name: user.name, imageUrl: user.profileImageUrl };\n\n return (\n <div\n className={classNames(\n \"neeto-molecules-engagements-node relative -mt-4 flex items-center gap-2 px-4 py-4\",\n className\n )}\n >\n <ActivityIcon {...{ icon, unread }} />\n <Avatar size=\"small\" user={avatar} />\n <div className=\"neeto-molecules-engagements-node__children\">\n {children}\n </div>\n </div>\n );\n};\n\nActivity.propTypes = {\n /** Object representing the user information */\n user: PropTypes.shape({ name: PropTypes.string.isRequired }).isRequired,\n\n /** Element to render as the icon */\n icon: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,\n\n /** Boolean indicating if the activity is unread to show unread badge */\n unread: PropTypes.bool,\n\n /** Additional classes passed on to the board view. */\n className: PropTypes.string,\n};\n\nexport default Activity;\n","import { isPresent } from \"neetocist\";\nimport { Avatar, Typography } from \"neetoui\";\n\nimport DateFormat from \"components/DateFormat\";\nimport MoreDropdown from \"components/MoreDropdown\";\n\nconst CommentHeader = ({ user, comment, info, actions }) => {\n const avatar = { name: user.name, imageUrl: user.profileImageUrl };\n\n return (\n <div className=\"neeto-ui-bg-gray-100 neeto-ui-border-gray-300 flex items-center justify-between rounded-t-md border-b py-1 pl-4 pr-1\">\n <div className=\"flex min-w-0 flex-grow flex-wrap items-center gap-2\">\n <Avatar size=\"medium\" user={avatar} />\n <Typography\n className=\"neeto-ui-text-gray-700\"\n style=\"body2\"\n weight=\"semibold\"\n >\n {user.name}\n </Typography>\n <Typography className=\"neeto-ui-text-gray-700\" style=\"body2\">\n •\n </Typography>\n {info && (\n <>\n <Typography\n className=\"neeto-ui-text-gray-500 lowercase\"\n style=\"body2\"\n >\n {info}\n </Typography>\n <Typography className=\"neeto-ui-text-gray-700\" style=\"body2\">\n •\n </Typography>\n </>\n )}\n {comment.createdAt && (\n <DateFormat.FromNow\n date={comment.createdAt}\n typographyProps={{\n style: \"body2\",\n className: \"neeto-ui-text-gray-500\",\n }}\n />\n )}\n </div>\n {isPresent(actions) && (\n <MoreDropdown\n dropdownButtonProps={{ className: \"self-start fles-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 classNames from \"classnames\";\nimport { findIndexBy } from \"neetocist\";\nimport { globalProps } from \"neetocommons/initializers\";\nimport { Tooltip, Typography } from \"neetoui\";\nimport { collectBy, eqProps, pathEq, pluck, prop } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport EmojiPicker from \"components/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 // Try to find group to which emoji belongs in existing reactions.\n const group = groups.find(pathEq(emoji.unified, [0, \"unified\"]));\n if (group && findOwnIndex(group) >= 0) return; // User already reacted with same emoji.\n onAdd({ ...emoji, emoji: emoji.native });\n };\n\n return (\n <div className=\"mt-2 flex flex-wrap gap-0.5\">\n <div className=\"neeto-ui-rounded-full neeto-ui-bg-gray-200 mr-2\">\n <EmojiPicker {...{ onSelect }} />\n </div>\n {groups.map(reactions => {\n const ownIndex = findOwnIndex(reactions);\n const selected = ownIndex >= 0;\n const reaction = selected ? reactions[ownIndex] : reactions[0];\n const names = pluck(\"reactor\", reactions).join(\", \");\n\n return (\n <Tooltip\n key={reaction.unified}\n position=\"top\"\n content={\n <p className=\"text-center text-xs\">\n {t(\"neetoMolecules.engagements.namesReacted\", { names })}\n </p>\n }\n >\n <div\n className={classNames(\n \"neeto-ui-rounded-full mx-1 flex cursor-pointer items-center justify-center px-2 py-1\",\n {\n \"neeto-ui-bg-accent-100\": selected,\n \"neeto-ui-bg-gray-100\": !selected,\n }\n )}\n onClick={() => (selected ? onRemove : onAdd)(reaction)}\n >\n <Typography\n className=\"flex items-center gap-x-1 text-sm\"\n style=\"body2\"\n >\n <span className=\"text-sm\">{reaction.emoji}</span>\n <span className=\"text-sm\">{reactions.length}</span>\n </Typography>\n </div>\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 `neeto-molecules-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 \"neeto-ui-bg-white neeto-ui-rounded-md neeto-ui-border-gray-300 neeto-molecules-comments-node mb-4 w-full border\",\n className\n )}\n >\n <CommentHeader {...{ actions, comment, info, user }} />\n <div className=\"neeto-molecules-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 /** Object representing the user information */\n user: PropTypes.shape({ name: PropTypes.string.isRequired }).isRequired,\n\n /** Object representing the comment item. */\n comment: PropTypes.shape({\n id: PropTypes.string.isRequired,\n createdAt: PropTypes.string.isRequired,\n }).isRequired,\n\n /** Array of reactions. Settings this to `false` will disable reactions for the item */\n reactions: PropTypes.oneOfType([PropTypes.array, PropTypes.bool]),\n\n /** Optional text label to be displayed in the header. */\n info: PropTypes.string,\n\n /** Optional action items to be passed to the menuItems prop of the actions dropdown */\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\n /** Additional classes passed on to the board view. */\n className: PropTypes.string,\n\n /** Callback function triggered when a reaction (emoji) is added */\n onAddReaction: PropTypes.func,\n\n /** Callback function triggered when a reaction (emoji) is removed*/\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 \"./engagements.scss\";\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 /** An array of engagement items */\n data: PropTypes.arrayOf(PropTypes.shape({ id: PropTypes.string.isRequired }))\n .isRequired,\n\n /** Boolean, determines whether activities are rendered. Defaults to false */\n isActivitiesEnabled: PropTypes.bool,\n\n /** Optional function to match the item type. Receives item as argument and should return one of Engagements.TYPES.*/\n matchType: PropTypes.func,\n\n /** A function to render individual comment item. Receives comment and index as arguments */\n renderComment: PropTypes.func.isRequired,\n\n /** A function to render individual activity item. Receives comment and index as arguments */\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","avatar","name","imageUrl","profileImageUrl","Avatar","size","CommentHeader","comment","info","actions","Typography","style","weight","_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","ownIndex","selected","reaction","names","pluck","join","Tooltip","content","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,sBAAsB;AAAAC,IAAAA,QAAA,eACnCC,eAAA,CAAA,MAAA,EAAA;AACEF,MAAAA,SAAS,EAAEG,UAAU,CACnB,iKAAiK,EACjK;AACE,QAAA,mDAAmD,EAAEL;AACvD,OACF,CAAE;AAAAG,MAAAA,QAAA,EAAA,CAEDJ,IAAI,EACJC,MAAM,iBACLC,cAAA,CAAA,MAAA,EAAA;AAAMC,QAAAA,SAAS,EAAC;AAAoF,OAAE,CACvG;KACG;AAAC,GACJ,CAAC;AAAA,CAC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,aAAa,GAAA3G,IAAA,CAAb2G,aAAa;IACbC,cAAc,GAAA5G,IAAA,CAAd4G,cAAc;EAEd,IAAMC,eAAe,GAAAC,eAAA,CAAAA,eAAA,CAAA,EAAA,EAClBrC,gBAAgB,CAACC,OAAO,EAAGiC,aAAa,CAAA,EACxClC,gBAAgB,CAACE,QAAQ,EAAG6B,mBAAmB,GAAGI,cAAc,GAAGG,cAAI,CACzE;EAED,oBACE5G,cAAA,CAAAqB,mBAAA,EAAA;IAAAnB,QAAA,EACGiG,IAAI,CAAC1C,GAAG,CAAC,UAACmB,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,oBACE/G,cAAA,CAACgH,KAAK,CAACC,QAAQ,EAAA;AAAA/G,QAAAA,QAAA,EACZ6G,QAAQ,CAACnC,UAAU,EAAEiC,KAAK;OAAC,EADTjC,UAAU,CAACvC,EAEhB,CAAC;IAErB,CAAC;AAAC,GACF,CAAC;AAEP;AAEA6D,WAAW,CAACd,WAAW,GAAG,aAAa;AACvCc,WAAW,CAACnB,OAAO,GAAGA,OAAO;AAC7BmB,WAAW,CAAC7F,QAAQ,GAAGA,QAAQ;AAC/B6F,WAAW,CAACgB,KAAK,GAAG5C,gBAAgB;;;;"}
|
|
1
|
+
{"version":3,"file":"Engagements.js","sources":["../../src/components/Engagements/Activity/Icon.jsx","../../src/components/Engagements/Activity/index.jsx","../../src/components/Engagements/Comment/Header.jsx","../../src/components/Engagements/Comment/Reactions.jsx","../../src/components/Engagements/constants.js","../../src/components/Engagements/utils.js","../../src/components/Engagements/Comment/index.jsx","../../src/components/Engagements/index.jsx"],"sourcesContent":["import classNames from \"classnames\";\n\nconst ActivityIcon = ({ icon, unread }) => (\n <div className=\"mx-0.5 flex-shrink-0\">\n <span\n className={classNames(\n \"neeto-ui-bg-gray-200 neeto-ui-text-gray-600 neeto-ui-rounded-full neeto-molecules-activity-node-icon relative z-10 flex h-7 w-7 items-center justify-center p-1\",\n {\n \"neeto-ui-text-primary-600 neeto-ui-bg-primary-100\": unread,\n }\n )}\n >\n {icon}\n {unread && (\n <span className=\"neeto-ui-rounded-full neeto-ui-bg-primary-800 absolute -right-0.5 -top-0.5 h-2 w-2\" />\n )}\n </span>\n </div>\n);\n\nexport default ActivityIcon;\n","import classNames from \"classnames\";\nimport { Avatar } from \"neetoui\";\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 \"neeto-molecules-engagements-node relative -mt-4 flex items-center gap-2 px-4 py-4\",\n className\n )}\n >\n <ActivityIcon {...{ icon, unread }} />\n {userIcon || (\n <Avatar\n size=\"small\"\n user={{ name: user.name, imageUrl: user.profileImageUrl }}\n />\n )}\n <div className=\"neeto-molecules-engagements-node__children\">{children}</div>\n </div>\n);\n\nActivity.propTypes = {\n /** Object representing the user information */\n user: PropTypes.shape({ name: PropTypes.string.isRequired }).isRequired,\n\n /** Element to render as the icon */\n icon: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,\n\n /** Boolean indicating if the activity is unread to show unread badge */\n unread: PropTypes.bool,\n\n /** Additional classes passed on to the board view. */\n className: PropTypes.string,\n};\n\nexport default Activity;\n","import { isPresent } from \"neetocist\";\nimport { Avatar, Typography } from \"neetoui\";\n\nimport DateFormat from \"components/DateFormat\";\nimport MoreDropdown from \"components/MoreDropdown\";\n\nconst CommentHeader = ({ user, comment, info, actions }) => {\n const avatar = { name: user.name, imageUrl: user.profileImageUrl };\n\n return (\n <div className=\"neeto-ui-bg-gray-100 neeto-ui-border-gray-300 flex items-center justify-between rounded-t-md border-b py-1 pl-4 pr-1\">\n <div className=\"flex min-w-0 flex-grow flex-wrap items-center gap-2\">\n <Avatar size=\"medium\" user={avatar} />\n <Typography\n className=\"neeto-ui-text-gray-700\"\n style=\"body2\"\n weight=\"semibold\"\n >\n {user.name}\n </Typography>\n <Typography className=\"neeto-ui-text-gray-700\" style=\"body2\">\n •\n </Typography>\n {info && (\n <>\n <Typography\n className=\"neeto-ui-text-gray-500 lowercase\"\n style=\"body2\"\n >\n {info}\n </Typography>\n <Typography className=\"neeto-ui-text-gray-700\" style=\"body2\">\n •\n </Typography>\n </>\n )}\n {comment.createdAt && (\n <DateFormat.FromNow\n date={comment.createdAt}\n typographyProps={{\n style: \"body2\",\n className: \"neeto-ui-text-gray-500\",\n }}\n />\n )}\n </div>\n {isPresent(actions) && (\n <MoreDropdown\n dropdownButtonProps={{ className: \"self-start fles-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 classNames from \"classnames\";\nimport { findIndexBy } from \"neetocist\";\nimport { globalProps } from \"neetocommons/initializers\";\nimport { Tooltip, Typography } from \"neetoui\";\nimport { collectBy, eqProps, pathEq, pluck, prop } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport EmojiPicker from \"components/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 // Try to find group to which emoji belongs in existing reactions.\n const group = groups.find(pathEq(emoji.unified, [0, \"unified\"]));\n if (group && findOwnIndex(group) >= 0) return; // User already reacted with same emoji.\n onAdd({ ...emoji, emoji: emoji.native });\n };\n\n return (\n <div className=\"mt-2 flex flex-wrap gap-0.5\">\n <div className=\"neeto-ui-rounded-full neeto-ui-bg-gray-200 mr-2\">\n <EmojiPicker {...{ onSelect }} />\n </div>\n {groups.map(reactions => {\n const ownIndex = findOwnIndex(reactions);\n const selected = ownIndex >= 0;\n const reaction = selected ? reactions[ownIndex] : reactions[0];\n const names = pluck(\"reactor\", reactions).join(\", \");\n\n return (\n <Tooltip\n key={reaction.unified}\n position=\"top\"\n content={\n <p className=\"text-center text-xs\">\n {t(\"neetoMolecules.engagements.namesReacted\", { names })}\n </p>\n }\n >\n <div\n className={classNames(\n \"neeto-ui-rounded-full mx-1 flex cursor-pointer items-center justify-center px-2 py-1\",\n {\n \"neeto-ui-bg-accent-100\": selected,\n \"neeto-ui-bg-gray-100\": !selected,\n }\n )}\n onClick={() => (selected ? onRemove : onAdd)(reaction)}\n >\n <Typography\n className=\"flex items-center gap-x-1 text-sm\"\n style=\"body2\"\n >\n <span className=\"text-sm\">{reaction.emoji}</span>\n <span className=\"text-sm\">{reactions.length}</span>\n </Typography>\n </div>\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 `neeto-molecules-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 \"neeto-ui-bg-white neeto-ui-rounded-md neeto-ui-border-gray-300 neeto-molecules-comments-node mb-4 w-full border\",\n className\n )}\n >\n <CommentHeader {...{ actions, comment, info, user }} />\n <div className=\"neeto-molecules-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 /** Object representing the user information */\n user: PropTypes.shape({ name: PropTypes.string.isRequired }).isRequired,\n\n /** Object representing the comment item. */\n comment: PropTypes.shape({\n id: PropTypes.string.isRequired,\n createdAt: PropTypes.string.isRequired,\n }).isRequired,\n\n /** Array of reactions. Settings this to `false` will disable reactions for the item */\n reactions: PropTypes.oneOfType([PropTypes.array, PropTypes.bool]),\n\n /** Optional text label to be displayed in the header. */\n info: PropTypes.string,\n\n /** Optional action items to be passed to the menuItems prop of the actions dropdown */\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\n /** Additional classes passed on to the board view. */\n className: PropTypes.string,\n\n /** Callback function triggered when a reaction (emoji) is added */\n onAddReaction: PropTypes.func,\n\n /** Callback function triggered when a reaction (emoji) is removed*/\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 \"./engagements.scss\";\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 /** An array of engagement items */\n data: PropTypes.arrayOf(PropTypes.shape({ id: PropTypes.string.isRequired }))\n .isRequired,\n\n /** Boolean, determines whether activities are rendered. Defaults to false */\n isActivitiesEnabled: PropTypes.bool,\n\n /** Optional function to match the item type. Receives item as argument and should return one of Engagements.TYPES.*/\n matchType: PropTypes.func,\n\n /** A function to render individual comment item. Receives comment and index as arguments */\n renderComment: PropTypes.func.isRequired,\n\n /** A function to render individual activity item. Receives comment and index as arguments */\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","style","weight","_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","ownIndex","selected","reaction","names","pluck","join","Tooltip","content","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,sBAAsB;AAAAC,IAAAA,QAAA,eACnCC,eAAA,CAAA,MAAA,EAAA;AACEF,MAAAA,SAAS,EAAEG,UAAU,CACnB,iKAAiK,EACjK;AACE,QAAA,mDAAmD,EAAEL;AACvD,OACF,CAAE;AAAAG,MAAAA,QAAA,EAAA,CAEDJ,IAAI,EACJC,MAAM,iBACLC,cAAA,CAAA,MAAA,EAAA;AAAMC,QAAAA,SAAS,EAAC;AAAoF,OAAE,CACvG;KACG;AAAC,GACJ,CAAC;AAAA,CACP;;ACZD,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,CAAT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G,cAAA,CAAAsB,mBAAA,EAAA;IAAApB,QAAA,EACGkG,IAAI,CAAC1C,GAAG,CAAC,UAACmB,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,oBACEhH,cAAA,CAACiH,KAAK,CAACC,QAAQ,EAAA;AAAAhH,QAAAA,QAAA,EACZ8G,QAAQ,CAACnC,UAAU,EAAEiC,KAAK;OAAC,EADTjC,UAAU,CAACvC,EAEhB,CAAC;IAErB,CAAC;AAAC,GACF,CAAC;AAEP;AAEA6D,WAAW,CAACd,WAAW,GAAG,aAAa;AACvCc,WAAW,CAACnB,OAAO,GAAGA,OAAO;AAC7BmB,WAAW,CAAC9F,QAAQ,GAAGA,QAAQ;AAC/B8F,WAAW,CAACgB,KAAK,GAAG5C,gBAAgB;;;;"}
|
package/dist/cjs/ProductEmbed.js
CHANGED
|
@@ -117,8 +117,10 @@ var inlineEmbedCode$1 = function inlineEmbedCode(_ref3) {
|
|
|
117
117
|
inlineWrapperStyle = _ref3.inlineWrapperStyle,
|
|
118
118
|
iframeStyle = _ref3.iframeStyle,
|
|
119
119
|
queryParams = _ref3.queryParams;
|
|
120
|
-
var elementSelector = customization.elementSelector
|
|
121
|
-
|
|
120
|
+
var elementSelector = customization.elementSelector,
|
|
121
|
+
dynamicHeight = customization.dynamicHeight;
|
|
122
|
+
var processedInlineWrapperStyle = dynamicHeight !== null && dynamicHeight !== void 0 && dynamicHeight.value ? removeHeightFromStyle(inlineWrapperStyle) : inlineWrapperStyle;
|
|
123
|
+
return "\n <!-- ".concat(globalProps.appName, " inline embed code begins -->\n <div style=\"").concat(processedInlineWrapperStyle, "\" id=\"").concat(elementSelector, "\">\n <!-- ").concat(globalProps.appName, " widget will be added here -->\n </div>\n ").concat(embedBaseScript(embedScriptLink), "\n <script>\n ").concat(camelCasedAppName$1, ".embed({\n type: \"inline\",\n id: \"").concat(id, "\",\n organization: \"").concat(globalProps.organization.subdomain, "\",\n elementSelector: \"#").concat(elementSelector, "\",\n styles: \"").concat(iframeStyle, "\", ").concat(embedQueryParam$1(queryParams)).concat(embedEnv$1()).concat(parseExtraArgs$1(extraArgs), "\n });\n </script>\n <!-- ").concat(globalProps.appName, " inline embed code ends -->");
|
|
122
124
|
};
|
|
123
125
|
var floatingPopupEmbedCode$1 = function floatingPopupEmbedCode(_ref4) {
|
|
124
126
|
var customization = _ref4.customization,
|
|
@@ -150,13 +152,15 @@ var iframeEmbedCode$1 = function iframeEmbedCode(_ref6) {
|
|
|
150
152
|
var height = customization.height,
|
|
151
153
|
width = customization.width,
|
|
152
154
|
iframeTitle = customization.iframeTitle,
|
|
153
|
-
iframeUrl = customization.iframeUrl
|
|
155
|
+
iframeUrl = customization.iframeUrl,
|
|
156
|
+
dynamicHeight = customization.dynamicHeight;
|
|
154
157
|
var iframeSrc = buildIframeURL$1({
|
|
155
158
|
id: id,
|
|
156
159
|
iframeUrl: iframeUrl,
|
|
157
160
|
queryParams: queryParams
|
|
158
161
|
});
|
|
159
|
-
|
|
162
|
+
var heightAttribute = dynamicHeight !== null && dynamicHeight !== void 0 && dynamicHeight.value ? "" : "\n".concat(TAB_STRING, "height=\"").concat(height, "\"");
|
|
163
|
+
return "\n <!-- ".concat(globalProps.appName, " iframe embed code begins -->\n <iframe\n allowfullscreen").concat(heightAttribute, "\n width=\"").concat(width, "\"\n frameborder=\"0\"\n title=\"").concat(iframeTitle, "\"\n src=\"").concat(iframeSrc, "\"\n ></iframe>\n <!-- ").concat(globalProps.appName, " iframe embed code ends -->");
|
|
160
164
|
};
|
|
161
165
|
var htmlCodeGenerators = {
|
|
162
166
|
inline: inlineEmbedCode$1,
|
|
@@ -175,7 +179,7 @@ var embedEnv = function embedEnv() {
|
|
|
175
179
|
return globalProps.railsEnv !== "production" ? "\n".concat(TAB_STRING).concat(TAB_STRING, " env: \"").concat(globalProps.railsEnv, "\",") : "";
|
|
176
180
|
};
|
|
177
181
|
var embedQueryParam = function embedQueryParam(queryParams) {
|
|
178
|
-
return queryParams ? "\n".concat(TAB_STRING).concat(TAB_STRING, "queryParams: ").concat(queryParams, ",") : "";
|
|
182
|
+
return queryParams ? "\n".concat(TAB_STRING).concat(TAB_STRING, " queryParams: ").concat(queryParams, ",") : "";
|
|
179
183
|
};
|
|
180
184
|
var parseExtraArgs = function parseExtraArgs(extraArgs) {
|
|
181
185
|
return ramda.toPairs(extraArgs).map(function (_ref) {
|
|
@@ -204,8 +208,10 @@ var inlineEmbedCode = function inlineEmbedCode(_ref3) {
|
|
|
204
208
|
inlineWrapperStyle = _ref3.inlineWrapperStyle,
|
|
205
209
|
iframeStyle = _ref3.iframeStyle,
|
|
206
210
|
queryParams = _ref3.queryParams;
|
|
207
|
-
var elementSelector = customization.elementSelector
|
|
208
|
-
|
|
211
|
+
var elementSelector = customization.elementSelector,
|
|
212
|
+
dynamicHeight = customization.dynamicHeight;
|
|
213
|
+
var processedInlineWrapperStyle = dynamicHeight !== null && dynamicHeight !== void 0 && dynamicHeight.value ? removeHeightFromStyle(inlineWrapperStyle) : inlineWrapperStyle;
|
|
214
|
+
return "\n import { useEffect } from \"react\";\n\n const App = () => {\n const ".concat(embedFunctionName, " = () => {\n ").concat(embedScript(embedScriptLink), "\n embedScript.onload = () => {\n window.").concat(camelCasedAppName, ".embed({\n type: \"inline\",\n id: \"").concat(id, "\",\n organization: \"").concat(globalProps.organization.subdomain, "\",\n elementSelector: \"#").concat(elementSelector, "\",\n styles: \"").concat(iframeStyle, "\",").concat(embedQueryParam(queryParams)).concat(embedEnv()).concat(parseExtraArgs(extraArgs), "\n });\n };\n\n document.body.appendChild(embedScript);\n ").concat(cleanupFunction, "\n };\n\n useEffect(() => ").concat(embedFunctionName, "(), []);\n\n return (\n <div\n id=\"inline-embed-container\"\n style={{ ").concat(parseInlineStyle(processedInlineWrapperStyle), " }}\n />\n );\n };");
|
|
209
215
|
};
|
|
210
216
|
var floatingPopupEmbedCode = function floatingPopupEmbedCode(_ref4) {
|
|
211
217
|
var customization = _ref4.customization,
|
|
@@ -237,13 +243,15 @@ var iframeEmbedCode = function iframeEmbedCode(_ref6) {
|
|
|
237
243
|
var height = customization.height,
|
|
238
244
|
width = customization.width,
|
|
239
245
|
iframeTitle = customization.iframeTitle,
|
|
240
|
-
iframeUrl = customization.iframeUrl
|
|
246
|
+
iframeUrl = customization.iframeUrl,
|
|
247
|
+
dynamicHeight = customization.dynamicHeight;
|
|
241
248
|
var iframeSrc = buildIframeURL$1({
|
|
242
249
|
id: id,
|
|
243
250
|
iframeUrl: iframeUrl,
|
|
244
251
|
queryParams: queryParams
|
|
245
252
|
});
|
|
246
|
-
|
|
253
|
+
var heightAttribute = dynamicHeight !== null && dynamicHeight !== void 0 && dynamicHeight.value ? "" : "\n".concat(TAB_STRING).concat(TAB_STRING, " height=\"").concat(height, "\"");
|
|
254
|
+
return "\n const App = () => {\n return (\n <>\n {/* ".concat(globalProps.appName, " iframe embed code begins */}\n <iframe\n allowFullScreen").concat(heightAttribute, "\n width=\"").concat(width, "\"\n frameBorder=\"0\"\n title=\"").concat(iframeTitle, "\"\n src=\"").concat(iframeSrc, "\"\n ></iframe>\n {/* ").concat(globalProps.appName, " iframe embed code ends */}\n </>\n );\n };\n");
|
|
247
255
|
};
|
|
248
256
|
var reactCodeGenerators = {
|
|
249
257
|
inline: inlineEmbedCode,
|
|
@@ -252,17 +260,19 @@ var reactCodeGenerators = {
|
|
|
252
260
|
iframe: iframeEmbedCode
|
|
253
261
|
};
|
|
254
262
|
|
|
255
|
-
var _excluded = ["selectedLanguage", "type"];
|
|
256
|
-
function ownKeys$
|
|
257
|
-
function _objectSpread$
|
|
258
|
-
var buildQueryParams = function buildQueryParams() {
|
|
263
|
+
var _excluded$1 = ["selectedLanguage", "type"];
|
|
264
|
+
function ownKeys$6(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; }
|
|
265
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
266
|
+
var buildQueryParams$1 = function buildQueryParams() {
|
|
259
267
|
var customization = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
260
268
|
var existingQueryParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
261
|
-
var
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
269
|
+
var activeOptions = Object.keys(SWITCH_OPTIONS).reduce(function (acc, key) {
|
|
270
|
+
var _customization$key;
|
|
271
|
+
var value = (_customization$key = customization[key]) === null || _customization$key === void 0 ? void 0 : _customization$key.value;
|
|
272
|
+
if (value) acc[key] = value;
|
|
273
|
+
return acc;
|
|
274
|
+
}, {});
|
|
275
|
+
var mergedQueryParams = _objectSpread$6(_objectSpread$6({}, existingQueryParams), activeOptions);
|
|
266
276
|
if (ramda.isEmpty(mergedQueryParams)) return "";
|
|
267
277
|
return JSON.stringify(mergedQueryParams, null, 2).replace(/\n/g, " ").replace(/\s\s+/g, " ");
|
|
268
278
|
};
|
|
@@ -270,11 +280,11 @@ var generateCode = function generateCode(options) {
|
|
|
270
280
|
var _embeddedCodeOptions$, _reactCodeGenerators$, _htmlCodeGenerators$t;
|
|
271
281
|
var selectedLanguage = options.selectedLanguage,
|
|
272
282
|
type = options.type,
|
|
273
|
-
embeddedCodeOptions = _objectWithoutProperties(options, _excluded);
|
|
283
|
+
embeddedCodeOptions = _objectWithoutProperties(options, _excluded$1);
|
|
274
284
|
var queryParams = ((_embeddedCodeOptions$ = embeddedCodeOptions.customization) === null || _embeddedCodeOptions$ === void 0 ? void 0 : _embeddedCodeOptions$.queryParams) || {};
|
|
275
285
|
var customization = embeddedCodeOptions.customization || {};
|
|
276
|
-
var codeOptions = _objectSpread$
|
|
277
|
-
queryParams: buildQueryParams(customization, queryParams)
|
|
286
|
+
var codeOptions = _objectSpread$6(_objectSpread$6({}, embeddedCodeOptions), {}, {
|
|
287
|
+
queryParams: buildQueryParams$1(customization, queryParams)
|
|
278
288
|
});
|
|
279
289
|
return selectedLanguage === "react" ? (_reactCodeGenerators$ = reactCodeGenerators[type]) === null || _reactCodeGenerators$ === void 0 ? void 0 : _reactCodeGenerators$.call(reactCodeGenerators, codeOptions) : (_htmlCodeGenerators$t = htmlCodeGenerators[type]) === null || _htmlCodeGenerators$t === void 0 ? void 0 : _htmlCodeGenerators$t.call(htmlCodeGenerators, codeOptions);
|
|
280
290
|
};
|
|
@@ -314,9 +324,12 @@ var buildIframeURL$1 = function buildIframeURL(_ref3) {
|
|
|
314
324
|
});
|
|
315
325
|
return url.toString();
|
|
316
326
|
};
|
|
327
|
+
var removeHeightFromStyle = function removeHeightFromStyle(style) {
|
|
328
|
+
return style.replace(/height\s*:\s*[^;]+;?\s*/g, "").trim();
|
|
329
|
+
};
|
|
317
330
|
|
|
318
|
-
function ownKeys$
|
|
319
|
-
function _objectSpread$
|
|
331
|
+
function ownKeys$5(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; }
|
|
332
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
320
333
|
var DynamicQueryParams = function DynamicQueryParams(_ref) {
|
|
321
334
|
var updateCustomization = _ref.updateCustomization;
|
|
322
335
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -342,7 +355,7 @@ var DynamicQueryParams = function DynamicQueryParams(_ref) {
|
|
|
342
355
|
};
|
|
343
356
|
var handleInputChange = function handleInputChange(index, field, value) {
|
|
344
357
|
var newQueryParams = queryParams.map(function (param, i) {
|
|
345
|
-
return i === index ? _objectSpread$
|
|
358
|
+
return i === index ? _objectSpread$5(_objectSpread$5({}, param), {}, _defineProperty({}, field, value)) : param;
|
|
346
359
|
});
|
|
347
360
|
setQueryParams(newQueryParams);
|
|
348
361
|
};
|
|
@@ -358,7 +371,7 @@ var DynamicQueryParams = function DynamicQueryParams(_ref) {
|
|
|
358
371
|
"data-cy": "dynamic-query-params-label",
|
|
359
372
|
"data-testid": "dynamic-query-params-label",
|
|
360
373
|
children: queryParamsProps.label || t("neetoMolecules.productEmbed.queryParam.label")
|
|
361
|
-
}), neetoCist.isPresent(queryParamsProps.helpPopoverProps) && /*#__PURE__*/jsxRuntime.jsx(HelpPopover, _objectSpread$
|
|
374
|
+
}), neetoCist.isPresent(queryParamsProps.helpPopoverProps) && /*#__PURE__*/jsxRuntime.jsx(HelpPopover, _objectSpread$5({
|
|
362
375
|
className: "ml-1"
|
|
363
376
|
}, queryParamsProps.helpPopoverProps))]
|
|
364
377
|
}), queryParams.map(function (param, index) {
|
|
@@ -544,6 +557,9 @@ var FloatingPopup$1 = function FloatingPopup(_ref) {
|
|
|
544
557
|
});
|
|
545
558
|
};
|
|
546
559
|
|
|
560
|
+
var _excluded = ["value", "label", "helpIconProps"];
|
|
561
|
+
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; }
|
|
562
|
+
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; }
|
|
547
563
|
var SwitchOptions = function SwitchOptions(_ref) {
|
|
548
564
|
var _ref$customization = _ref.customization,
|
|
549
565
|
customization = _ref$customization === void 0 ? {} : _ref$customization,
|
|
@@ -558,25 +574,28 @@ var SwitchOptions = function SwitchOptions(_ref) {
|
|
|
558
574
|
className: "flex flex-col gap-4",
|
|
559
575
|
children: visibleOptions.map(function (_ref2) {
|
|
560
576
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
helpIconProps
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
} : undefined;
|
|
571
|
-
return /*#__PURE__*/React.createElement(Switch, {
|
|
572
|
-
labelProps: labelProps,
|
|
577
|
+
option = _ref3[0],
|
|
578
|
+
_ref3$ = _ref3[1],
|
|
579
|
+
value = _ref3$.value,
|
|
580
|
+
label = _ref3$.label,
|
|
581
|
+
helpIconProps = _ref3$.helpIconProps,
|
|
582
|
+
rest = _objectWithoutProperties(_ref3$, _excluded);
|
|
583
|
+
return /*#__PURE__*/jsxRuntime.jsx(Switch, {
|
|
573
584
|
checked: value,
|
|
574
|
-
|
|
575
|
-
|
|
585
|
+
label: label || SWITCH_OPTIONS[option].label,
|
|
586
|
+
labelProps: helpIconProps && {
|
|
587
|
+
helpIconProps: _objectSpread$4({
|
|
588
|
+
"data-testid": "help-icon-button"
|
|
589
|
+
}, helpIconProps)
|
|
590
|
+
},
|
|
576
591
|
onChange: function onChange(e) {
|
|
577
|
-
return updateCustomization(_defineProperty({},
|
|
592
|
+
return updateCustomization(_defineProperty({}, option, _objectSpread$4(_objectSpread$4({}, rest), {}, {
|
|
593
|
+
label: label,
|
|
594
|
+
helpIconProps: helpIconProps,
|
|
595
|
+
value: e.target.checked
|
|
596
|
+
})));
|
|
578
597
|
}
|
|
579
|
-
});
|
|
598
|
+
}, option);
|
|
580
599
|
})
|
|
581
600
|
});
|
|
582
601
|
};
|
|
@@ -654,11 +673,11 @@ var Inline$1 = function Inline(_ref) {
|
|
|
654
673
|
});
|
|
655
674
|
};
|
|
656
675
|
|
|
657
|
-
function ownKeys$
|
|
658
|
-
function _objectSpread$
|
|
676
|
+
function ownKeys$3(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; }
|
|
677
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
659
678
|
var InlineEmbedIcon = function InlineEmbedIcon(_ref) {
|
|
660
679
|
var other = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
661
|
-
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$
|
|
680
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$3(_objectSpread$3({
|
|
662
681
|
fill: "none",
|
|
663
682
|
height: "163",
|
|
664
683
|
viewBox: "0 0 278 163",
|
|
@@ -907,7 +926,7 @@ var InlineEmbedIcon = function InlineEmbedIcon(_ref) {
|
|
|
907
926
|
};
|
|
908
927
|
var FloatingPopupIcon = function FloatingPopupIcon(_ref2) {
|
|
909
928
|
var other = Object.assign({}, (_objectDestructuringEmpty(_ref2), _ref2));
|
|
910
|
-
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$
|
|
929
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$3(_objectSpread$3({
|
|
911
930
|
fill: "none",
|
|
912
931
|
height: "163",
|
|
913
932
|
viewBox: "0 0 278 163",
|
|
@@ -1051,7 +1070,7 @@ var FloatingPopupIcon = function FloatingPopupIcon(_ref2) {
|
|
|
1051
1070
|
};
|
|
1052
1071
|
var ElementPopupIcon = function ElementPopupIcon(_ref3) {
|
|
1053
1072
|
var other = Object.assign({}, (_objectDestructuringEmpty(_ref3), _ref3));
|
|
1054
|
-
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$
|
|
1073
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$3(_objectSpread$3({
|
|
1055
1074
|
fill: "none",
|
|
1056
1075
|
height: "163",
|
|
1057
1076
|
viewBox: "0 0 278 163",
|
|
@@ -1202,8 +1221,7 @@ var SCRIPT_ID = "embed-script";
|
|
|
1202
1221
|
var TAB_STRING = " ";
|
|
1203
1222
|
var SWITCH_OPTIONS = {
|
|
1204
1223
|
dynamicHeight: {
|
|
1205
|
-
label: i18next.t("neetoMolecules.productEmbed.dynamicHeight")
|
|
1206
|
-
helpText: i18next.t("neetoMolecules.productEmbed.dynamicHeightHelpText")
|
|
1224
|
+
label: i18next.t("neetoMolecules.productEmbed.dynamicHeight")
|
|
1207
1225
|
},
|
|
1208
1226
|
hideTitle: {
|
|
1209
1227
|
label: i18next.t("neetoMolecules.productEmbed.hideTitle")
|
|
@@ -1279,11 +1297,11 @@ var Code = function Code(_ref) {
|
|
|
1279
1297
|
});
|
|
1280
1298
|
};
|
|
1281
1299
|
|
|
1282
|
-
function ownKeys$
|
|
1283
|
-
function _objectSpread$
|
|
1300
|
+
function ownKeys$2(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; }
|
|
1301
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1284
1302
|
var FloatingPopupPlaceholderImage = function FloatingPopupPlaceholderImage(_ref) {
|
|
1285
1303
|
var other = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
1286
|
-
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$
|
|
1304
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$2(_objectSpread$2({
|
|
1287
1305
|
fill: "none",
|
|
1288
1306
|
height: "518",
|
|
1289
1307
|
viewBox: "0 0 796 518",
|
|
@@ -1343,7 +1361,7 @@ var FloatingPopupPlaceholderImage = function FloatingPopupPlaceholderImage(_ref)
|
|
|
1343
1361
|
};
|
|
1344
1362
|
var ElementPopupPlaceholderImage = function ElementPopupPlaceholderImage(_ref2) {
|
|
1345
1363
|
var other = Object.assign({}, (_objectDestructuringEmpty(_ref2), _ref2));
|
|
1346
|
-
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$
|
|
1364
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$2(_objectSpread$2({
|
|
1347
1365
|
fill: "none",
|
|
1348
1366
|
height: "518",
|
|
1349
1367
|
viewBox: "0 0 748 518",
|
|
@@ -1509,10 +1527,27 @@ var Inline = function Inline(_ref) {
|
|
|
1509
1527
|
});
|
|
1510
1528
|
};
|
|
1511
1529
|
|
|
1512
|
-
var
|
|
1530
|
+
function ownKeys$1(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; }
|
|
1531
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1532
|
+
var buildQueryParams = function buildQueryParams() {
|
|
1533
|
+
var customization = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1534
|
+
var existingQueryParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1535
|
+
var activeOptions = Object.keys(SWITCH_OPTIONS).reduce(function (acc, key) {
|
|
1536
|
+
var _customization$key;
|
|
1537
|
+
var value = (_customization$key = customization[key]) === null || _customization$key === void 0 ? void 0 : _customization$key.value;
|
|
1538
|
+
if (value) acc[key] = value;
|
|
1539
|
+
return acc;
|
|
1540
|
+
}, {});
|
|
1541
|
+
return _objectSpread$1(_objectSpread$1({}, existingQueryParams), activeOptions);
|
|
1542
|
+
};
|
|
1543
|
+
var buildIframeURL = function buildIframeURL(iframeURL, queryParams, customization) {
|
|
1513
1544
|
var url = new URL(iframeURL);
|
|
1514
|
-
|
|
1515
|
-
|
|
1545
|
+
var params = buildQueryParams(customization, queryParams);
|
|
1546
|
+
Object.entries(params).forEach(function (_ref) {
|
|
1547
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
1548
|
+
name = _ref2[0],
|
|
1549
|
+
value = _ref2[1];
|
|
1550
|
+
url.searchParams.append(name, value);
|
|
1516
1551
|
});
|
|
1517
1552
|
return url.toString();
|
|
1518
1553
|
};
|
|
@@ -1531,7 +1566,8 @@ var Preview = function Preview(_ref) {
|
|
|
1531
1566
|
}, shallow.shallow),
|
|
1532
1567
|
queryParams = _useProductEmbedStore.queryParams;
|
|
1533
1568
|
var preview = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, EMBED_OPTIONS.INLINE, Inline), EMBED_OPTIONS.FLOATING_POPUP, FloatingPopup), EMBED_OPTIONS.ELEMENT_POPUP, ElementPopup), EMBED_OPTIONS.IFRAME, Iframe);
|
|
1534
|
-
var
|
|
1569
|
+
var previewURL = customPreviewIframeUrl || "".concat(location.origin, "/embed/").concat(id);
|
|
1570
|
+
var iframeURL = buildIframeURL(previewURL, queryParams, customization);
|
|
1535
1571
|
var Component = preview[selectedEmbed];
|
|
1536
1572
|
if (isScriptLoading) {
|
|
1537
1573
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|