@ynput/ayon-frontend-shared 0.3.34 → 0.3.36

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.
Files changed (115) hide show
  1. package/dist/_virtual/index.cjs12.js +1 -1
  2. package/dist/_virtual/index.cjs13.js +1 -1
  3. package/dist/_virtual/index.cjs15.js +1 -1
  4. package/dist/_virtual/index.cjs18.js +1 -1
  5. package/dist/_virtual/index.cjs19.js +1 -1
  6. package/dist/_virtual/index.cjs4.js +1 -1
  7. package/dist/_virtual/index.cjs6.js +1 -1
  8. package/dist/_virtual/index.cjs9.js +1 -1
  9. package/dist/_virtual/index.es12.js +5 -2
  10. package/dist/_virtual/index.es12.js.map +1 -1
  11. package/dist/_virtual/index.es13.js +5 -2
  12. package/dist/_virtual/index.es13.js.map +1 -1
  13. package/dist/_virtual/index.es14.js +2 -2
  14. package/dist/_virtual/index.es15.js +2 -2
  15. package/dist/_virtual/index.es16.js +2 -2
  16. package/dist/_virtual/index.es17.js +2 -2
  17. package/dist/_virtual/index.es18.js +2 -2
  18. package/dist/_virtual/index.es19.js +2 -2
  19. package/dist/_virtual/index.es4.js +2 -5
  20. package/dist/_virtual/index.es4.js.map +1 -1
  21. package/dist/_virtual/index.es6.js +2 -2
  22. package/dist/_virtual/index.es7.js +2 -2
  23. package/dist/_virtual/index.es9.js +2 -5
  24. package/dist/_virtual/index.es9.js.map +1 -1
  25. package/dist/node_modules/match-sorter/dist/match-sorter.esm.cjs.js +1 -1
  26. package/dist/node_modules/match-sorter/dist/match-sorter.esm.cjs.js.map +1 -1
  27. package/dist/node_modules/match-sorter/dist/match-sorter.esm.es.js +1 -1
  28. package/dist/node_modules/parse-numeric-range/index.cjs.js +1 -1
  29. package/dist/node_modules/parse-numeric-range/index.es.js +1 -1
  30. package/dist/node_modules/remove-accents/index.cjs.js +1 -1
  31. package/dist/node_modules/remove-accents/index.cjs.js.map +1 -1
  32. package/dist/node_modules/remove-accents/index.es.js +1 -1
  33. package/dist/shared/node_modules/@module-federation/error-codes/dist/index.cjs.js +1 -1
  34. package/dist/shared/node_modules/@module-federation/error-codes/dist/index.es.js +1 -1
  35. package/dist/shared/node_modules/@module-federation/runtime/dist/index.cjs.js +1 -1
  36. package/dist/shared/node_modules/@module-federation/runtime/dist/index.es.js +1 -1
  37. package/dist/shared/node_modules/@module-federation/runtime-core/dist/index.cjs.js +1 -1
  38. package/dist/shared/node_modules/@module-federation/runtime-core/dist/index.es.js +1 -1
  39. package/dist/shared/node_modules/@module-federation/runtime-core/dist/module/index.cjs.js +1 -1
  40. package/dist/shared/node_modules/@module-federation/runtime-core/dist/module/index.cjs.js.map +1 -1
  41. package/dist/shared/node_modules/@module-federation/runtime-core/dist/module/index.es.js +1 -1
  42. package/dist/shared/node_modules/@module-federation/runtime-core/dist/plugins/snapshot/index.cjs.js +1 -1
  43. package/dist/shared/node_modules/@module-federation/runtime-core/dist/plugins/snapshot/index.es.js +1 -1
  44. package/dist/shared/node_modules/@module-federation/runtime-core/dist/remote/index.cjs.js +1 -1
  45. package/dist/shared/node_modules/@module-federation/runtime-core/dist/remote/index.es.js +1 -1
  46. package/dist/shared/node_modules/@module-federation/runtime-core/dist/shared/index.cjs.js +1 -1
  47. package/dist/shared/node_modules/@module-federation/runtime-core/dist/shared/index.es.js +1 -1
  48. package/dist/shared/node_modules/@module-federation/runtime-core/dist/type/index.cjs.js +1 -1
  49. package/dist/shared/node_modules/@module-federation/runtime-core/dist/type/index.es.js +1 -1
  50. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/hooks/index.cjs.js +1 -1
  51. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/hooks/index.es.js +1 -1
  52. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/index.cjs.js +1 -1
  53. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/index.cjs.js.map +1 -1
  54. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/index.es.js +1 -1
  55. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/semver/index.cjs.js +1 -1
  56. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/semver/index.cjs.js.map +1 -1
  57. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/semver/index.es.js +1 -1
  58. package/dist/shared/node_modules/@module-federation/sdk/dist/index.cjs.js +1 -1
  59. package/dist/shared/node_modules/@module-federation/sdk/dist/index.es.js +1 -1
  60. package/dist/shared/node_modules/prop-types/index.cjs.js +1 -1
  61. package/dist/shared/node_modules/prop-types/index.es.js +1 -1
  62. package/dist/shared/node_modules/react-is/index.cjs.js +1 -1
  63. package/dist/shared/node_modules/react-is/index.es.js +1 -1
  64. package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.cjs.js +1 -1
  65. package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.cjs.js.map +1 -1
  66. package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.es.js +1 -1
  67. package/dist/shared/node_modules/react-transition-group/esm/Transition.cjs.js +1 -1
  68. package/dist/shared/node_modules/react-transition-group/esm/Transition.cjs.js.map +1 -1
  69. package/dist/shared/node_modules/react-transition-group/esm/Transition.es.js +1 -1
  70. package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.cjs.js +1 -1
  71. package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.cjs.js.map +1 -1
  72. package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.es.js +1 -1
  73. package/dist/shared/src/containers/Feed/Feed.cjs.js +1 -1
  74. package/dist/shared/src/containers/Feed/Feed.cjs.js.map +1 -1
  75. package/dist/shared/src/containers/Feed/Feed.es.js +7 -10
  76. package/dist/shared/src/containers/Feed/Feed.es.js.map +1 -1
  77. package/dist/shared/src/containers/Feed/components/ActivityComment/ActivityComment.cjs.js +1 -1
  78. package/dist/shared/src/containers/Feed/components/ActivityComment/ActivityComment.cjs.js.map +1 -1
  79. package/dist/shared/src/containers/Feed/components/ActivityVersionReview/ActivityVersionReview.cjs.js +1 -1
  80. package/dist/shared/src/containers/Feed/components/ActivityVersionReview/ActivityVersionReview.cjs.js.map +1 -1
  81. package/dist/shared/src/containers/Feed/components/ActivityVersionReview/ActivityVersionReview.es.js +9 -5
  82. package/dist/shared/src/containers/Feed/components/ActivityVersionReview/ActivityVersionReview.es.js.map +1 -1
  83. package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.cjs.js +2 -2
  84. package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.cjs.js.map +1 -1
  85. package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.es.js +207 -233
  86. package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.es.js.map +1 -1
  87. package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.styled.cjs.js +5 -10
  88. package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.styled.cjs.js.map +1 -1
  89. package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.styled.es.js +12 -17
  90. package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.styled.es.js.map +1 -1
  91. package/dist/shared/src/containers/Feed/components/CommentInput/VersionReviewPill.cjs.js +1 -1
  92. package/dist/shared/src/containers/Feed/components/CommentInput/VersionReviewPill.cjs.js.map +1 -1
  93. package/dist/shared/src/containers/Feed/components/CommentInput/VersionReviewPill.es.js +16 -22
  94. package/dist/shared/src/containers/Feed/components/CommentInput/VersionReviewPill.es.js.map +1 -1
  95. package/dist/shared/src/containers/Feed/components/CommentInput/types.cjs.js +2 -0
  96. package/dist/shared/src/containers/Feed/components/CommentInput/types.cjs.js.map +1 -0
  97. package/dist/shared/src/containers/Feed/components/CommentInput/types.es.js +18 -0
  98. package/dist/shared/src/containers/Feed/components/CommentInput/types.es.js.map +1 -0
  99. package/dist/shared/src/containers/Feed/hooks/useCommentMutations.cjs.js.map +1 -1
  100. package/dist/shared/src/containers/Feed/hooks/useCommentMutations.es.js.map +1 -1
  101. package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.cjs.js +1 -1
  102. package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.cjs.js.map +1 -1
  103. package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.es.js +67 -64
  104. package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.es.js.map +1 -1
  105. package/dist/shared/src/containers/RepresentationsList/RepresentationsList.cjs.js +1 -1
  106. package/dist/shared/src/containers/RepresentationsList/RepresentationsList.cjs.js.map +1 -1
  107. package/dist/shared/src/containers/RepresentationsList/RepresentationsList.es.js +13 -11
  108. package/dist/shared/src/containers/RepresentationsList/RepresentationsList.es.js.map +1 -1
  109. package/dist/types/containers/Feed/components/ActivityVersionReview/ActivityVersionReview.d.ts +1 -1
  110. package/dist/types/containers/Feed/components/CommentInput/CommentInput.d.ts +1 -16
  111. package/dist/types/containers/Feed/components/CommentInput/VersionReviewPill.d.ts +1 -2
  112. package/dist/types/containers/Feed/components/CommentInput/index.d.ts +2 -0
  113. package/dist/types/containers/Feed/components/CommentInput/types.d.ts +16 -0
  114. package/dist/types/containers/Feed/hooks/useCommentMutations.d.ts +1 -1
  115. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Transition.cjs.js","sources":["../../../../../node_modules/react-transition-group/esm/Transition.js"],"sourcesContent":["import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport config from './config';\nimport { timeoutsShape } from './utils/PropTypes';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { forceReflow } from './utils/reflow';\nexport var UNMOUNTED = 'unmounted';\nexport var EXITED = 'exited';\nexport var ENTERING = 'entering';\nexport var ENTERED = 'entered';\nexport var EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 1 },\n * entered: { opacity: 1 },\n * exiting: { opacity: 0 },\n * exited: { opacity: 0 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * <Transition in={inProp} timeout={duration}>\n * {state => (\n * <div style={{\n * ...defaultStyle,\n * ...transitionStyles[state]\n * }}>\n * I'm a fade Transition!\n * </div>\n * )}\n * </Transition>\n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n * <div>\n * <Transition in={inProp} timeout={500}>\n * {state => (\n * // ...\n * )}\n * </Transition>\n * <button onClick={() => setInProp(true)}>\n * Click to Enter\n * </button>\n * </div>\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n if (this.props.unmountOnExit || this.props.mountOnEnter) {\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749\n // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.\n // To make the animation happen, we have to separate each rendering and avoid being processed as batched.\n\n if (node) forceReflow(node);\n }\n\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || config.disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || config.disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n React.createElement(TransitionGroupContext.Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(React.Component);\n\nTransition.contextType = TransitionGroupContext;\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: PropTypes.shape({\n current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {\n var value = propValue[key];\n return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);\n }\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * <Transition in={this.state.in} timeout={150}>\n * {state => (\n * <MyComponent className={`fade fade-${state}`} />\n * )}\n * </Transition>\n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `<CSSTransition>` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\nexport default Transition;"],"names":["UNMOUNTED","EXITED","ENTERING","ENTERED","EXITING","Transition","_React$Component","_inheritsLoose","props","context","_this","parentGroup","appear","initialStatus","_ref","prevState","nextIn","_proto","prevProps","nextStatus","status","timeout","exit","enter","mounting","node","ReactDOM","forceReflow","_this2","appearing","_ref2","maybeNode","maybeAppearing","timeouts","enterTimeout","config","_this3","nextState","callback","_this4","active","event","handler","doesNotHaveTimeoutOrListener","_ref3","maybeNextCallback","_this$props","children","childProps","_objectWithoutPropertiesLoose","React","TransitionGroupContext","PropTypes","propValue","key","componentName","location","propFullName","secret","value","pt","timeoutsShape","_len","args","_key","noop"],"mappings":"ofASU,IAACA,EAAY,YACZC,EAAS,SACTC,EAAW,WACXC,EAAU,UACVC,EAAU,UA6FjBC,GAA0B,SAAUC,EAAkB,CACxDC,EAAeF,EAAYC,CAAgB,EAE3C,SAASD,EAAWG,EAAOC,EAAS,CAClC,IAAIC,EAEJA,EAAQJ,EAAiB,KAAK,KAAME,EAAOC,CAAO,GAAK,KACvD,IAAIE,EAAcF,EAEdG,EAASD,GAAe,CAACA,EAAY,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Ac,YAAY,QAAU,OAAO,EAAEN,EAAWC,EAAKC,EAAeC,EAAUC,EAAcC,CAAM,CAClL,CACJ,CAAG,EAgBD,SAAUN,EAAU,UAAU,CAACA,EAAU,KAAK,WAAYA,EAAU,QAAQ,UAAU,CAAC,EAAE,WAKzF,GAAIA,EAAU,KAQd,aAAcA,EAAU,KAMxB,cAAeA,EAAU,KAazB,OAAQA,EAAU,KAKlB,MAAOA,EAAU,KAKjB,KAAMA,EAAU,KA4BhB,QAAS,SAAiB5C,EAAO,CAC/B,IAAIoD,EAAKC,EAAAA,cACJrD,EAAM,iBAAgBoD,EAAKA,EAAG,YAEnC,QAASE,EAAO,UAAU,OAAQC,EAAO,IAAI,MAAMD,EAAO,EAAIA,EAAO,EAAI,CAAC,EAAGE,EAAO,EAAGA,EAAOF,EAAME,IAClGD,EAAKC,EAAO,CAAC,EAAI,UAAUA,CAAI,EAGjC,OAAOJ,EAAG,MAAM,OAAQ,CAACpD,CAAK,EAAE,OAAOuD,CAAI,CAAC,CAC9C,EAgBA,eAAgBX,EAAU,KAU1B,QAASA,EAAU,KAUnB,WAAYA,EAAU,KAUtB,UAAWA,EAAU,KASrB,OAAQA,EAAU,KASlB,UAAWA,EAAU,KASrB,SAAUA,EAAU,IACtB,EAAI,GAEJ,SAASa,GAAO,CAAC,CAEjB5D,EAAW,aAAe,CACxB,GAAI,GACJ,aAAc,GACd,cAAe,GACf,OAAQ,GACR,MAAO,GACP,KAAM,GACN,QAAS4D,EACT,WAAYA,EACZ,UAAWA,EACX,OAAQA,EACR,UAAWA,EACX,SAAUA,CACZ,EACA5D,EAAW,UAAYL,EACvBK,EAAW,OAASJ,EACpBI,EAAW,SAAWH,EACtBG,EAAW,QAAUF,EACrBE,EAAW,QAAUD","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"Transition.cjs.js","sources":["../../../../../node_modules/react-transition-group/esm/Transition.js"],"sourcesContent":["import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport config from './config';\nimport { timeoutsShape } from './utils/PropTypes';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { forceReflow } from './utils/reflow';\nexport var UNMOUNTED = 'unmounted';\nexport var EXITED = 'exited';\nexport var ENTERING = 'entering';\nexport var ENTERED = 'entered';\nexport var EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 1 },\n * entered: { opacity: 1 },\n * exiting: { opacity: 0 },\n * exited: { opacity: 0 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * <Transition in={inProp} timeout={duration}>\n * {state => (\n * <div style={{\n * ...defaultStyle,\n * ...transitionStyles[state]\n * }}>\n * I'm a fade Transition!\n * </div>\n * )}\n * </Transition>\n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n * <div>\n * <Transition in={inProp} timeout={500}>\n * {state => (\n * // ...\n * )}\n * </Transition>\n * <button onClick={() => setInProp(true)}>\n * Click to Enter\n * </button>\n * </div>\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n if (this.props.unmountOnExit || this.props.mountOnEnter) {\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749\n // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.\n // To make the animation happen, we have to separate each rendering and avoid being processed as batched.\n\n if (node) forceReflow(node);\n }\n\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || config.disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || config.disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n React.createElement(TransitionGroupContext.Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(React.Component);\n\nTransition.contextType = TransitionGroupContext;\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: PropTypes.shape({\n current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {\n var value = propValue[key];\n return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);\n }\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * <Transition in={this.state.in} timeout={150}>\n * {state => (\n * <MyComponent className={`fade fade-${state}`} />\n * )}\n * </Transition>\n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `<CSSTransition>` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\nexport default Transition;"],"names":["UNMOUNTED","EXITED","ENTERING","ENTERED","EXITING","Transition","_React$Component","_inheritsLoose","props","context","_this","parentGroup","appear","initialStatus","_ref","prevState","nextIn","_proto","prevProps","nextStatus","status","timeout","exit","enter","mounting","node","ReactDOM","forceReflow","_this2","appearing","_ref2","maybeNode","maybeAppearing","timeouts","enterTimeout","config","_this3","nextState","callback","_this4","active","event","handler","doesNotHaveTimeoutOrListener","_ref3","maybeNextCallback","_this$props","children","childProps","_objectWithoutPropertiesLoose","React","TransitionGroupContext","PropTypes","propValue","key","componentName","location","propFullName","secret","value","pt","timeoutsShape","_len","args","_key","noop"],"mappings":"qfASU,IAACA,EAAY,YACZC,EAAS,SACTC,EAAW,WACXC,EAAU,UACVC,EAAU,UA6FjBC,GAA0B,SAAUC,EAAkB,CACxDC,EAAeF,EAAYC,CAAgB,EAE3C,SAASD,EAAWG,EAAOC,EAAS,CAClC,IAAIC,EAEJA,EAAQJ,EAAiB,KAAK,KAAME,EAAOC,CAAO,GAAK,KACvD,IAAIE,EAAcF,EAEdG,EAASD,GAAe,CAACA,EAAY,WAAaH,EAAM,MAAQA,EAAM,OACtEK,EACJ,OAAAH,EAAM,aAAe,KAEjBF,EAAM,GACJI,GACFC,EAAgBZ,EAChBS,EAAM,aAAeR,GAErBW,EAAgBV,EAGdK,EAAM,eAAiBA,EAAM,aAC/BK,EAAgBb,EAEhBa,EAAgBZ,EAIpBS,EAAM,MAAQ,CACZ,OAAQG,CACd,EACIH,EAAM,aAAe,KACdA,CACT,CAEAL,EAAW,yBAA2B,SAAkCS,EAAMC,EAAW,CACvF,IAAIC,EAASF,EAAK,GAElB,OAAIE,GAAUD,EAAU,SAAWf,EAC1B,CACL,OAAQC,CAChB,EAGW,IACT,EAkBA,IAAIgB,EAASZ,EAAW,UAExB,OAAAY,EAAO,kBAAoB,UAA6B,CACtD,KAAK,aAAa,GAAM,KAAK,YAAY,CAC3C,EAEAA,EAAO,mBAAqB,SAA4BC,EAAW,CACjE,IAAIC,EAAa,KAEjB,GAAID,IAAc,KAAK,MAAO,CAC5B,IAAIE,EAAS,KAAK,MAAM,OAEpB,KAAK,MAAM,GACTA,IAAWlB,GAAYkB,IAAWjB,IACpCgB,EAAajB,IAGXkB,IAAWlB,GAAYkB,IAAWjB,KACpCgB,EAAaf,EAGnB,CAEA,KAAK,aAAa,GAAOe,CAAU,CACrC,EAEAF,EAAO,qBAAuB,UAAgC,CAC5D,KAAK,mBAAkB,CACzB,EAEAA,EAAO,YAAc,UAA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,GACf,OAAQ,GACR,MAAO,GACP,KAAM,GACN,QAAS4D,EACT,WAAYA,EACZ,UAAWA,EACX,OAAQA,EACR,UAAWA,EACX,SAAUA,CACZ,EACA5D,EAAW,UAAYL,EACvBK,EAAW,OAASJ,EACpBI,EAAW,SAAWH,EACtBG,EAAW,QAAUF,EACrBE,EAAW,QAAUD","x_google_ignoreList":[0]}
@@ -1,6 +1,6 @@
1
1
  import C from "../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.es.js";
2
2
  import D from "../../@babel/runtime/helpers/esm/inheritsLoose.es.js";
3
- import o from "../../../../_virtual/index.es9.js";
3
+ import o from "../../../../_virtual/index.es12.js";
4
4
  import v from "react";
5
5
  import b from "react-dom";
6
6
  import T from "./config.es.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../../_virtual/index.cjs9.js");var t=process.env.NODE_ENV!=="production"?e.oneOfType([e.number,e.shape({enter:e.number,exit:e.number,appear:e.number}).isRequired]):null,n=process.env.NODE_ENV!=="production"?e.oneOfType([e.string,e.shape({enter:e.string,exit:e.string,active:e.string}),e.shape({enter:e.string,enterDone:e.string,enterActive:e.string,exit:e.string,exitDone:e.string,exitActive:e.string})]):null;exports.classNamesShape=n;exports.timeoutsShape=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../../_virtual/index.cjs12.js");var t=process.env.NODE_ENV!=="production"?e.oneOfType([e.number,e.shape({enter:e.number,exit:e.number,appear:e.number}).isRequired]):null,n=process.env.NODE_ENV!=="production"?e.oneOfType([e.string,e.shape({enter:e.string,exit:e.string,active:e.string}),e.shape({enter:e.string,enterDone:e.string,enterActive:e.string,exit:e.string,exitDone:e.string,exitActive:e.string})]):null;exports.classNamesShape=n;exports.timeoutsShape=t;
2
2
  //# sourceMappingURL=PropTypes.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PropTypes.cjs.js","sources":["../../../../../../node_modules/react-transition-group/esm/utils/PropTypes.js"],"sourcesContent":["import PropTypes from 'prop-types';\nexport var timeoutsShape = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n enter: PropTypes.number,\n exit: PropTypes.number,\n appear: PropTypes.number\n}).isRequired]) : null;\nexport var classNamesShape = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.string, PropTypes.shape({\n enter: PropTypes.string,\n exit: PropTypes.string,\n active: PropTypes.string\n}), PropTypes.shape({\n enter: PropTypes.string,\n enterDone: PropTypes.string,\n enterActive: PropTypes.string,\n exit: PropTypes.string,\n exitDone: PropTypes.string,\n exitActive: PropTypes.string\n})]) : null;"],"names":["timeoutsShape","PropTypes","classNamesShape"],"mappings":"yIACU,IAACA,EAAgB,QAAQ,IAAI,WAAa,aAAeC,EAAU,UAAU,CAACA,EAAU,OAAQA,EAAU,MAAM,CACxH,MAAOA,EAAU,OACjB,KAAMA,EAAU,OAChB,OAAQA,EAAU,MACpB,CAAC,EAAE,UAAU,CAAC,EAAI,KACPC,EAAkB,QAAQ,IAAI,WAAa,aAAeD,EAAU,UAAU,CAACA,EAAU,OAAQA,EAAU,MAAM,CAC1H,MAAOA,EAAU,OACjB,KAAMA,EAAU,OAChB,OAAQA,EAAU,MACpB,CAAC,EAAGA,EAAU,MAAM,CAClB,MAAOA,EAAU,OACjB,UAAWA,EAAU,OACrB,YAAaA,EAAU,OACvB,KAAMA,EAAU,OAChB,SAAUA,EAAU,OACpB,WAAYA,EAAU,MACxB,CAAC,CAAC,CAAC,EAAI","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"PropTypes.cjs.js","sources":["../../../../../../node_modules/react-transition-group/esm/utils/PropTypes.js"],"sourcesContent":["import PropTypes from 'prop-types';\nexport var timeoutsShape = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n enter: PropTypes.number,\n exit: PropTypes.number,\n appear: PropTypes.number\n}).isRequired]) : null;\nexport var classNamesShape = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.string, PropTypes.shape({\n enter: PropTypes.string,\n exit: PropTypes.string,\n active: PropTypes.string\n}), PropTypes.shape({\n enter: PropTypes.string,\n enterDone: PropTypes.string,\n enterActive: PropTypes.string,\n exit: PropTypes.string,\n exitDone: PropTypes.string,\n exitActive: PropTypes.string\n})]) : null;"],"names":["timeoutsShape","PropTypes","classNamesShape"],"mappings":"0IACU,IAACA,EAAgB,QAAQ,IAAI,WAAa,aAAeC,EAAU,UAAU,CAACA,EAAU,OAAQA,EAAU,MAAM,CACxH,MAAOA,EAAU,OACjB,KAAMA,EAAU,OAChB,OAAQA,EAAU,MACpB,CAAC,EAAE,UAAU,CAAC,EAAI,KACPC,EAAkB,QAAQ,IAAI,WAAa,aAAeD,EAAU,UAAU,CAACA,EAAU,OAAQA,EAAU,MAAM,CAC1H,MAAOA,EAAU,OACjB,KAAMA,EAAU,OAChB,OAAQA,EAAU,MACpB,CAAC,EAAGA,EAAU,MAAM,CAClB,MAAOA,EAAU,OACjB,UAAWA,EAAU,OACrB,YAAaA,EAAU,OACvB,KAAMA,EAAU,OAChB,SAAUA,EAAU,OACpB,WAAYA,EAAU,MACxB,CAAC,CAAC,CAAC,EAAI","x_google_ignoreList":[0]}
@@ -1,4 +1,4 @@
1
- import e from "../../../../../_virtual/index.es9.js";
1
+ import e from "../../../../../_virtual/index.es12.js";
2
2
  var n = process.env.NODE_ENV !== "production" ? e.oneOfType([e.number, e.shape({
3
3
  enter: e.number,
4
4
  exit: e.number,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../../../_virtual/jsx-runtime.cjs.js"),q=require("react"),ge=require("./components/ActivityItem.cjs.js"),he=require("./components/CommentInput/CommentInput.cjs.js"),E=require("./Feed.styled.cjs.js"),xe=require("./hooks/useCommentMutations.cjs.js"),ye=require("./hooks/useTransformActivities.cjs.js"),fe=require("../../../../node_modules/react-intersection-observer/dist/index.cjs.js"),ve=require("./hooks/useSaveScrollPos.cjs.js"),Ce=require("./hooks/useScrollOnInputOpen.cjs.js"),ke=require("./feedHelpers.cjs.js");require("@ynput/ayon-react-components");const Ee=require("clsx"),we=require("./hooks/useScrollToHighlighted.cjs.js"),Fe=require("./components/FileUploadPreview/FileUploadPreview.cjs.js"),Re=require("../../components/EmptyPlaceholder/EmptyPlaceholder.cjs.js");require("../../components/EmptyPlaceholder/EmptyPlaceholderFlex.styled.cjs.js");const x=require("./context/FeedContext.cjs.js");require("../../context/RemoteModulesContext.cjs.js");const je=require("../../context/DetailsPanelContext.cjs.js");require("../../../../_virtual/runtime.cjs.js");require("../../../../_virtual/semver.cjs.js");require("../../api/base/client.cjs.js");require("../../api/generated/graphql.cjs.js");require("../../api/generated/graphqlLinks.cjs.js");require("../../api/generated/access.cjs.js");require("../../api/generated/actions.cjs.js");require("../../api/generated/activityFeed.cjs.js");require("../../api/generated/addons.cjs.js");require("../../api/generated/anatomy.cjs.js");require("../../api/generated/attributes.cjs.js");require("../../api/generated/authentication.cjs.js");require("../../api/generated/bundles.cjs.js");require("../../api/generated/configuration.cjs.js");require("../../api/generated/dataImport.cjs.js");require("../../api/generated/desktop.cjs.js");require("../../api/generated/entityLists.cjs.js");require("../../api/generated/events.cjs.js");require("../../api/generated/files.cjs.js");require("../../api/generated/folders.cjs.js");require("../../api/generated/inbox.cjs.js");require("../../api/generated/links.cjs.js");require("../../api/generated/market.cjs.js");require("../../api/generated/onboarding.cjs.js");require("../../api/generated/operations.cjs.js");require("../../api/generated/products.cjs.js");require("../../api/generated/projectDashboard.cjs.js");require("../../api/generated/projects.cjs.js");require("../../api/generated/projectFolders.cjs.js");require("../../api/generated/reviewables.cjs.js");require("../../api/generated/services.cjs.js");require("../../api/generated/system.cjs.js");require("../../api/generated/tasks.cjs.js");require("../../api/generated/teams.cjs.js");require("../../api/generated/thumbnails.cjs.js");require("../../api/generated/uRIs.cjs.js");require("../../api/generated/users.cjs.js");require("../../api/generated/versions.cjs.js");require("../../api/generated/workfiles.cjs.js");require("../../api/generated/ynputCloud.cjs.js");require("../../api/generated/grouping.cjs.js");require("../../api/generated/views.cjs.js");require("../../api/queries/actions/getActions.cjs.js");require("../../api/queries/activities/getActivities.cjs.js");require("../../api/queries/activities/updateActivities.cjs.js");require("../../api/queries/activities/updateReaction.cjs.js");require("../../api/queries/activities/getMentions.cjs.js");require("../../api/queries/activities/getCategories.cjs.js");require("../../api/queries/addons/getAddons.cjs.js");require("../../api/queries/addons/updateAddons.cjs.js");require("../../api/queries/attributes/getAttributes.cjs.js");require("../../api/queries/attributes/updateAttributes.cjs.js");require("../../api/queries/authentication/getAuthentication.cjs.js");require("../../api/queries/cloud/cloud.cjs.js");require("../../api/queries/columnStats/metricTargets.cjs.js");require("../../api/queries/config/getConfig.cjs.js");require("../../api/queries/config/updateConfig.cjs.js");require("../../api/queries/entities/getEntity.cjs.js");require("../../api/queries/entities/getEntityPanel.cjs.js");require("../../api/queries/overview/getOverview.cjs.js");require("../../api/queries/overview/updateOverview.cjs.js");require("../../api/queries/versions/getVersionsProducts.cjs.js");require("../../api/queries/links/getEntityLinks.cjs.js");require("../../api/queries/entities/updateEntity.cjs.js");require("../../api/queries/entityLists/getLists.cjs.js");require("../../api/queries/entityLists/updateLists.cjs.js");require("../../api/queries/entityLists/getListsAttributes.cjs.js");require("../../api/queries/entityLists/listItemsColumnStats.cjs.js");require("../../api/queries/entityLists/updateListsAttributes.cjs.js");require("../../api/queries/entityLists/listFolders.cjs.js");require("../../api/queries/folders/getFolders.cjs.js");require("../../api/queries/folders/getFolderDeleteInfo.cjs.js");require("../../api/queries/grouping/getGrouping.cjs.js");require("../../api/queries/links/updateLinks.cjs.js");require("../../api/queries/links/getLinks.cjs.js");const Ie=require("../../api/queries/permissions/getPermissions.cjs.js");require("../../api/queries/products/createProduct.cjs.js");require("../../api/queries/products/getFolderProducts.cjs.js");require("../../api/queries/project/getProject.cjs.js");require("../../api/queries/project/updateProject.cjs.js");require("../../api/queries/projectFolders/projectFolders.cjs.js");require("../../api/queries/review/getReview.cjs.js");require("../../api/queries/review/updateReview.cjs.js");require("../../api/queries/share/share.cjs.js");require("../../api/queries/system/getSystem.cjs.js");require("../../api/queries/tasks/getTasks.cjs.js");require("../../api/queries/tasks/updateTasks.cjs.js");require("../../api/queries/teams/getTeams.cjs.js");require("../../api/queries/userDashboard/getUserDashboard.cjs.js");require("../../api/queries/users/getUsers.cjs.js");require("../../api/queries/users/updateUsers.cjs.js");require("../../api/queries/users/guests.cjs.js");require("../../api/queries/versions/updateVersions.cjs.js");require("../../api/queries/views/getViews.cjs.js");require("../../api/queries/views/updateViews.cjs.js");require("../../api/queries/watchers/getWatchers.cjs.js");require("../../api/queries/uris/getUris.cjs.js");require("lodash");require("react-toastify");require("react-redux");require("custom-protocol-check");require("../ProjectTreeTable/components/GroupSettingsFallback.cjs.js");require("uuid");require("../../util/pubsub.cjs.js");require("../../context/PowerpackContextInstance.cjs.js");require("../../context/SubtasksModulesContextInstance.cjs.js");require("../../context/ThumbnailUploaderContext.cjs.js");require("../../context/SettingsPanelContext.cjs.js");require("../../context/pip/PiPProvider.cjs.js");require("react-dom");require("../../context/pip/PiPWrapper.cjs.js");require("../../context/AddonProjectContext.cjs.js");require("../../context/AddonContext.cjs.js");require("../../context/MoveEntityContext.cjs.js");require("../../context/MenuContext.cjs.js");require("../../context/WebsocketContext.cjs.js");require("../../context/GlobalContext.cjs.js");require("../../context/ProjectContext.cjs.js");require("../../context/ProjectFoldersContext.cjs.js");require("../../context/UriContext.cjs.js");const Me=require("./helpers/mergeAnnotationAttachments.cjs.js"),be=require("../DetailsPanel/components/TabHeaderAndFilters/TabHeaderAndFilters.cjs.js"),Pe=require("./hooks/useLastVersionReview.cjs.js"),Ae=30,Ne=[{id:"comments",tooltip:"Comments",icon:"chat"},{id:"checklists",tooltip:"Checklists",icon:"checklist"},{id:"versions",tooltip:"Published versions",icon:"layers"},{id:"updates",tooltip:"Entity updates",icon:"arrow_circle_right"}],Le=({disabled:H,readOnly:B,statuses:W=[],entityListId:G,isSlideOut:U,versionReview:w=!1})=>{const{projectName:n,entities:l,entityType:m,editingId:F,projectInfo:R,setEditingId:j,userName:I,activitiesData:y,isLoadingNew:u,isLoadingNextPage:M,loadNextPage:d,hasNextPage:Q,users:z,feedFilter:a,setFeedFilter:J,isGuest:K}=x.useFeedContext(),{openSlideOut:X,highlightedActivities:f,setHighlightedActivities:Y,onOpenImage:Z,setFeedAnnotations:b,user:P}=je.useDetailsPanelContext(),$=a.conditions?.some(e=>"key"in e&&e.key==="versions"&&e.value===!0),ee=a.conditions?.some(e=>"key"in e&&["comments","checklists","versions","updates"].includes(e.key)&&e.value===!0),A=a.conditions?.some(e=>"key"in e&&(e.key==="comments"||e.key==="checklists")&&e.value===!0),{data:N,isLoading:re}=Ie.useGetMyProjectPermissionsQuery({projectName:n},{skip:!n}),ie=!P.data?.isManager&&!P.data?.isAdmin&&!re&&N?.activities?.enabled&&!N?.activities?.activities?.includes("comment")||ee&&!A,p=q.useMemo(()=>Me(y),[y]);q.useEffect(()=>{p.length||b([]);const e=p.map(r=>r.activityData?.annotations?.map(i=>({...i,activityId:r.activityId}))).filter(Boolean).flat();b(e)},[p]);const g=ye.default(p,z,R,m,I,a),c=q.useRef(null);Ce({feedRef:c,isInputOpen:F===x.FEED_NEW_COMMENT,height:93}),ve({entities:l,feedRef:c,filter:a,disabled:!!f.length,isLoading:u}),we({feedRef:c,highlighted:f,isLoading:u||M,loadNextPage:d,hasNextPage:!!d,activities:y});const{submitComment:L,updateComment:O,deleteComment:te,submitReview:T,isSaving:se}=xe({projectName:n,entityType:m,entities:l,filter:a,entityListId:G}),ne=q.useCallback(async(e,r=[],i={})=>{await L(e,r,i),c.current&&c.current.scrollTo({top:0})},[L,c]),oe=q.useCallback(async e=>{await T(e)},[T]),ue=(e,r)=>{const i=e?.target;if(!i||!r)return console.log("no target or activity");const t=i.checked,o=t?"[ ]":"[x]",de=t?"[x]":"[ ]",{body:h}=r,S=Array.from(i.closest(".comment-body")?.querySelectorAll(".task-list-item")||[]).findIndex(k=>k===i.closest("li"));let _=S;(h.match(/\[.\]/g)||[]).forEach((k,pe)=>{k!==o&&pe<S&&_--});const D=[];let v=-1;for(;(v=h.indexOf(o,v+1))>-1;)D.push(v);const C=D[_];if(C===void 0)return;const me=C+o.length,V=h.slice(0,C)+de+h.slice(me);V&&O(r,V,r.files)},ae=e=>{const{entityId:r,entityType:i,activityId:t}=e;if(!i||!["version","task","folder"].includes(i))return console.log("Entity type not supported yet");if(!r||!i||!n)return console.log("No entity id or type found");X({entityId:r,entityType:i,projectName:n}),Y([t])},ce=({index:e,activityId:r})=>{const i=Object.values(g).reverse().filter(t=>t.activityType=="comment").map(t=>({id:t.activityId,files:t.files.filter(o=>Fe.isFilePreviewable(o.mime,o.ext))})).filter(t=>t.files.length>0);Z?.({files:i,activityId:r,index:e,projectName:n})},le=q.useMemo(()=>ke.getLoadingPlaceholders(10),[]),qe=Pe.useLastVersionReview({projectName:n,enabled:w,entityIds:l.map(e=>e.id),activities:g,loadingActivities:u,userName:I});return s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:s.jsxRuntimeExports.jsxs(E.FeedContainer,{className:"feed",children:[void 0,s.jsxRuntimeExports.jsx(be,{label:"Activity Feed",filters:Ne,currentFilter:a,onFilterChange:J,isLoading:u}),s.jsxRuntimeExports.jsxs(E.FeedContent,{ref:c,className:Ee({loading:u},"no-shimmer"),children:[u?le:g.map(e=>s.jsxRuntimeExports.jsx(ge,{activity:e,onCheckChange:ue,onDelete:te,onUpdate:async(r,i,t,o)=>await O(e,r,i,o),projectInfo:R,projectName:n,entityType:m,onReferenceClick:ae,createdAts:l.map(r=>r.createdAt),onFileExpand:ce,showOrigin:l.length>1,filter:a,editProps:{projectName:n,entities:l,entityType:m},isHighlighted:f.includes(e.activityId),readOnly:B,statuses:W,isSlideOut:U,isGuest:K},e.activityId)),g.length===0&&$&&!A&&!u&&s.jsxRuntimeExports.jsx(Re.EmptyPlaceholder,{message:"No versions published yet",icon:"layers"}),Q&&d&&s.jsxRuntimeExports.jsx(fe.InView,{root:c.current,onChange:e=>e&&d(),rootMargin:"400px 0px 0px 0px",children:s.jsxRuntimeExports.jsx(E.LoadMore,{style:{height:0},onClick:()=>d(),children:M?"Loading more...":"Click to load more"})})]}),!ie&&s.jsxRuntimeExports.jsx(he.default,{initValue:null,onSubmit:ne,isOpen:F===x.FEED_NEW_COMMENT,onClose:()=>j(null),onOpen:()=>j(x.FEED_NEW_COMMENT),disabled:H,isLoading:u||!l.length||se,versionReview:w,lastOwnVersionReview:qe,onReview:oe})]})})};exports.Feed=Le;exports.activitiesLast=Ae;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../../../_virtual/jsx-runtime.cjs.js"),q=require("react"),ge=require("./components/ActivityItem.cjs.js"),he=require("./components/CommentInput/CommentInput.cjs.js"),E=require("./Feed.styled.cjs.js"),xe=require("./hooks/useCommentMutations.cjs.js"),ye=require("./hooks/useTransformActivities.cjs.js"),fe=require("../../../../node_modules/react-intersection-observer/dist/index.cjs.js"),ve=require("./hooks/useSaveScrollPos.cjs.js"),Ce=require("./hooks/useScrollOnInputOpen.cjs.js"),ke=require("./feedHelpers.cjs.js");require("@ynput/ayon-react-components");const Ee=require("clsx"),we=require("./hooks/useScrollToHighlighted.cjs.js"),Fe=require("./components/FileUploadPreview/FileUploadPreview.cjs.js"),Re=require("../../components/EmptyPlaceholder/EmptyPlaceholder.cjs.js");require("../../components/EmptyPlaceholder/EmptyPlaceholderFlex.styled.cjs.js");const x=require("./context/FeedContext.cjs.js");require("../../context/RemoteModulesContext.cjs.js");const je=require("../../context/DetailsPanelContext.cjs.js");require("../../../../_virtual/runtime.cjs.js");require("../../../../_virtual/semver.cjs.js");require("../../api/base/client.cjs.js");require("../../api/generated/graphql.cjs.js");require("../../api/generated/graphqlLinks.cjs.js");require("../../api/generated/access.cjs.js");require("../../api/generated/actions.cjs.js");require("../../api/generated/activityFeed.cjs.js");require("../../api/generated/addons.cjs.js");require("../../api/generated/anatomy.cjs.js");require("../../api/generated/attributes.cjs.js");require("../../api/generated/authentication.cjs.js");require("../../api/generated/bundles.cjs.js");require("../../api/generated/configuration.cjs.js");require("../../api/generated/dataImport.cjs.js");require("../../api/generated/desktop.cjs.js");require("../../api/generated/entityLists.cjs.js");require("../../api/generated/events.cjs.js");require("../../api/generated/files.cjs.js");require("../../api/generated/folders.cjs.js");require("../../api/generated/inbox.cjs.js");require("../../api/generated/links.cjs.js");require("../../api/generated/market.cjs.js");require("../../api/generated/onboarding.cjs.js");require("../../api/generated/operations.cjs.js");require("../../api/generated/products.cjs.js");require("../../api/generated/projectDashboard.cjs.js");require("../../api/generated/projects.cjs.js");require("../../api/generated/projectFolders.cjs.js");require("../../api/generated/reviewables.cjs.js");require("../../api/generated/services.cjs.js");require("../../api/generated/system.cjs.js");require("../../api/generated/tasks.cjs.js");require("../../api/generated/teams.cjs.js");require("../../api/generated/thumbnails.cjs.js");require("../../api/generated/uRIs.cjs.js");require("../../api/generated/users.cjs.js");require("../../api/generated/versions.cjs.js");require("../../api/generated/workfiles.cjs.js");require("../../api/generated/ynputCloud.cjs.js");require("../../api/generated/grouping.cjs.js");require("../../api/generated/views.cjs.js");require("../../api/queries/actions/getActions.cjs.js");require("../../api/queries/activities/getActivities.cjs.js");require("../../api/queries/activities/updateActivities.cjs.js");require("../../api/queries/activities/updateReaction.cjs.js");require("../../api/queries/activities/getMentions.cjs.js");require("../../api/queries/activities/getCategories.cjs.js");require("../../api/queries/addons/getAddons.cjs.js");require("../../api/queries/addons/updateAddons.cjs.js");require("../../api/queries/attributes/getAttributes.cjs.js");require("../../api/queries/attributes/updateAttributes.cjs.js");require("../../api/queries/authentication/getAuthentication.cjs.js");require("../../api/queries/cloud/cloud.cjs.js");require("../../api/queries/columnStats/metricTargets.cjs.js");require("../../api/queries/config/getConfig.cjs.js");require("../../api/queries/config/updateConfig.cjs.js");require("../../api/queries/entities/getEntity.cjs.js");require("../../api/queries/entities/getEntityPanel.cjs.js");require("../../api/queries/overview/getOverview.cjs.js");require("../../api/queries/overview/updateOverview.cjs.js");require("../../api/queries/versions/getVersionsProducts.cjs.js");require("../../api/queries/links/getEntityLinks.cjs.js");require("../../api/queries/entities/updateEntity.cjs.js");require("../../api/queries/entityLists/getLists.cjs.js");require("../../api/queries/entityLists/updateLists.cjs.js");require("../../api/queries/entityLists/getListsAttributes.cjs.js");require("../../api/queries/entityLists/listItemsColumnStats.cjs.js");require("../../api/queries/entityLists/updateListsAttributes.cjs.js");require("../../api/queries/entityLists/listFolders.cjs.js");require("../../api/queries/folders/getFolders.cjs.js");require("../../api/queries/folders/getFolderDeleteInfo.cjs.js");require("../../api/queries/grouping/getGrouping.cjs.js");require("../../api/queries/links/updateLinks.cjs.js");require("../../api/queries/links/getLinks.cjs.js");const Ie=require("../../api/queries/permissions/getPermissions.cjs.js");require("../../api/queries/products/createProduct.cjs.js");require("../../api/queries/products/getFolderProducts.cjs.js");require("../../api/queries/project/getProject.cjs.js");require("../../api/queries/project/updateProject.cjs.js");require("../../api/queries/projectFolders/projectFolders.cjs.js");require("../../api/queries/review/getReview.cjs.js");require("../../api/queries/review/updateReview.cjs.js");require("../../api/queries/share/share.cjs.js");require("../../api/queries/system/getSystem.cjs.js");require("../../api/queries/tasks/getTasks.cjs.js");require("../../api/queries/tasks/updateTasks.cjs.js");require("../../api/queries/teams/getTeams.cjs.js");require("../../api/queries/userDashboard/getUserDashboard.cjs.js");require("../../api/queries/users/getUsers.cjs.js");require("../../api/queries/users/updateUsers.cjs.js");require("../../api/queries/users/guests.cjs.js");require("../../api/queries/versions/updateVersions.cjs.js");require("../../api/queries/views/getViews.cjs.js");require("../../api/queries/views/updateViews.cjs.js");require("../../api/queries/watchers/getWatchers.cjs.js");require("../../api/queries/uris/getUris.cjs.js");require("lodash");require("react-toastify");require("react-redux");require("custom-protocol-check");require("../ProjectTreeTable/components/GroupSettingsFallback.cjs.js");require("uuid");require("../../util/pubsub.cjs.js");require("../../context/PowerpackContextInstance.cjs.js");require("../../context/SubtasksModulesContextInstance.cjs.js");require("../../context/ThumbnailUploaderContext.cjs.js");require("../../context/SettingsPanelContext.cjs.js");require("../../context/pip/PiPProvider.cjs.js");require("react-dom");require("../../context/pip/PiPWrapper.cjs.js");require("../../context/AddonProjectContext.cjs.js");require("../../context/AddonContext.cjs.js");require("../../context/MoveEntityContext.cjs.js");require("../../context/MenuContext.cjs.js");require("../../context/WebsocketContext.cjs.js");require("../../context/GlobalContext.cjs.js");require("../../context/ProjectContext.cjs.js");require("../../context/ProjectFoldersContext.cjs.js");require("../../context/UriContext.cjs.js");const Me=require("./helpers/mergeAnnotationAttachments.cjs.js"),be=require("../DetailsPanel/components/TabHeaderAndFilters/TabHeaderAndFilters.cjs.js"),Pe=require("./hooks/useLastVersionReview.cjs.js"),Ae=30,Ne=[{id:"comments",tooltip:"Comments",icon:"chat"},{id:"checklists",tooltip:"Checklists",icon:"checklist"},{id:"versions",tooltip:"Published versions",icon:"layers"},{id:"updates",tooltip:"Entity updates",icon:"arrow_circle_right"}],Le=({disabled:H,readOnly:B,statuses:W=[],entityListId:G,isSlideOut:U,versionReview:w=!1})=>{const{projectName:n,entities:l,entityType:m,editingId:F,projectInfo:R,setEditingId:j,userName:I,activitiesData:y,isLoadingNew:u,isLoadingNextPage:M,loadNextPage:d,hasNextPage:Q,users:z,feedFilter:a,setFeedFilter:J,isGuest:K}=x.useFeedContext(),{openSlideOut:X,highlightedActivities:f,setHighlightedActivities:Y,onOpenImage:Z,setFeedAnnotations:b,user:P}=je.useDetailsPanelContext(),$=a.conditions?.some(e=>"key"in e&&e.key==="versions"&&e.value===!0),ee=a.conditions?.some(e=>"key"in e&&["comments","checklists","versions","updates"].includes(e.key)&&e.value===!0),A=a.conditions?.some(e=>"key"in e&&(e.key==="comments"||e.key==="checklists")&&e.value===!0),{data:N,isLoading:re}=Ie.useGetMyProjectPermissionsQuery({projectName:n},{skip:!n}),ie=!P.data?.isManager&&!P.data?.isAdmin&&!re&&N?.activities?.enabled&&!N?.activities?.activities?.includes("comment")||ee&&!A,p=q.useMemo(()=>Me(y),[y]);q.useEffect(()=>{p.length||b([]);const e=p.map(r=>r.activityData?.annotations?.map(i=>({...i,activityId:r.activityId}))).filter(Boolean).flat();b(e)},[p]);const g=ye.default(p,z,R,m,I,a),c=q.useRef(null);Ce({feedRef:c,isInputOpen:F===x.FEED_NEW_COMMENT,height:93}),ve({entities:l,feedRef:c,filter:a,disabled:!!f.length,isLoading:u}),we({feedRef:c,highlighted:f,isLoading:u||M,loadNextPage:d,hasNextPage:!!d,activities:y});const{submitComment:L,updateComment:O,deleteComment:te,submitReview:T,isSaving:se}=xe({projectName:n,entityType:m,entities:l,filter:a,entityListId:G}),ne=q.useCallback(async(e,r=[],i={})=>{await L(e,r,i),c.current&&c.current.scrollTo({top:0})},[L,c]),oe=q.useCallback(async e=>{await T(e)},[T]),ue=(e,r)=>{const i=e?.target;if(!i||!r)return console.log("no target or activity");const t=i.checked,o=t?"[ ]":"[x]",de=t?"[x]":"[ ]",{body:h}=r,S=Array.from(i.closest(".comment-body")?.querySelectorAll(".task-list-item")||[]).findIndex(k=>k===i.closest("li"));let _=S;(h.match(/\[.\]/g)||[]).forEach((k,pe)=>{k!==o&&pe<S&&_--});const D=[];let v=-1;for(;(v=h.indexOf(o,v+1))>-1;)D.push(v);const C=D[_];if(C===void 0)return;const me=C+o.length,V=h.slice(0,C)+de+h.slice(me);V&&O(r,V,r.files)},ae=e=>{const{entityId:r,entityType:i,activityId:t}=e;if(!i||!["version","task","folder"].includes(i))return console.log("Entity type not supported yet");if(!r||!i||!n)return console.log("No entity id or type found");X({entityId:r,entityType:i,projectName:n}),Y([t])},ce=({index:e,activityId:r})=>{const i=Object.values(g).reverse().filter(t=>t.activityType=="comment").map(t=>({id:t.activityId,files:t.files.filter(o=>Fe.isFilePreviewable(o.mime,o.ext))})).filter(t=>t.files.length>0);Z?.({files:i,activityId:r,index:e,projectName:n})},le=q.useMemo(()=>ke.getLoadingPlaceholders(10),[]),qe=Pe.useLastVersionReview({projectName:n,enabled:w,entityIds:l.map(e=>e.id),activities:g,loadingActivities:u,userName:I});return s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:s.jsxRuntimeExports.jsxs(E.FeedContainer,{className:"feed",children:[void 0,s.jsxRuntimeExports.jsx(be,{label:"Activity Feed",filters:Ne,currentFilter:a,onFilterChange:J,isLoading:u}),s.jsxRuntimeExports.jsxs(E.FeedContent,{ref:c,className:Ee({loading:u},"no-shimmer"),children:[u?le:g.map(e=>s.jsxRuntimeExports.jsx(ge,{activity:e,onCheckChange:ue,onDelete:te,onUpdate:async(r,i,t,o)=>await O(e,r,i,o),projectInfo:R,projectName:n,entityType:m,onReferenceClick:ae,createdAts:l.map(r=>r.createdAt),onFileExpand:ce,showOrigin:l.length>1,filter:a,editProps:{projectName:n,entities:l,entityType:m},isHighlighted:f.includes(e.activityId),readOnly:B,statuses:W,isSlideOut:U,isGuest:K},e.activityId)),g.length===0&&$&&!A&&!u&&s.jsxRuntimeExports.jsx(Re.EmptyPlaceholder,{message:"No versions published yet",icon:"layers"}),Q&&d&&s.jsxRuntimeExports.jsx(fe.InView,{root:c.current,onChange:e=>e&&d(),rootMargin:"400px 0px 0px 0px",children:s.jsxRuntimeExports.jsx(E.LoadMore,{style:{height:0},onClick:()=>d(),children:M?"Loading more...":"Click to load more"})})]}),!ie&&s.jsxRuntimeExports.jsx(he,{initValue:null,onSubmit:ne,isOpen:F===x.FEED_NEW_COMMENT,onClose:()=>j(null),onOpen:()=>j(x.FEED_NEW_COMMENT),disabled:H,isLoading:u||!l.length||se,versionReview:w,lastOwnVersionReview:qe,onReview:oe})]})})};exports.Feed=Le;exports.activitiesLast=Ae;
2
2
  //# sourceMappingURL=Feed.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Feed.cjs.js","sources":["../../../../../src/containers/Feed/Feed.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react'\nimport ActivityItem from './components/ActivityItem'\nimport CommentInput, { VersionReviewFeedback } from './components/CommentInput/CommentInput'\nimport * as Styled from './Feed.styled'\nimport useCommentMutations, { Activity } from './hooks/useCommentMutations'\nimport useTransformActivities from './hooks/useTransformActivities'\nimport { InView } from 'react-intersection-observer'\nimport useSaveScrollPos from './hooks/useSaveScrollPos'\nimport useScrollOnInputOpen from './hooks/useScrollOnInputOpen'\nimport { getLoadingPlaceholders } from './feedHelpers'\nimport { Icon } from '@ynput/ayon-react-components'\nimport clsx from 'clsx'\nimport useScrollToHighlighted from './hooks/useScrollToHighlighted'\nimport { isFilePreviewable } from './components/FileUploadPreview/FileUploadPreview'\nimport EmptyPlaceholder from '@shared/components/EmptyPlaceholder'\nimport { useFeedContext, FEED_NEW_COMMENT } from './context/FeedContext'\nimport { Status } from '../ProjectTreeTable/types/project'\nimport { useDetailsPanelContext } from '@shared/context'\nimport { DetailsPanelEntityType, useGetMyProjectPermissionsQuery } from '@shared/api'\nimport mergeAnnotationAttachments from './helpers/mergeAnnotationAttachments'\nimport { SavedAnnotationMetadata } from '.'\nimport TabHeaderAndFilters, {\n FilterItem,\n} from '../DetailsPanel/components/TabHeaderAndFilters/TabHeaderAndFilters'\nimport { useLastVersionReview } from './hooks/useLastVersionReview'\n\n// number of activities to get\nexport const activitiesLast = 30\n\nconst feedFilters: FilterItem<string>[] = [\n {\n id: 'comments',\n tooltip: 'Comments',\n icon: 'chat',\n },\n {\n id: 'checklists',\n tooltip: 'Checklists',\n icon: 'checklist',\n },\n {\n id: 'versions',\n tooltip: 'Published versions',\n icon: 'layers',\n },\n {\n id: 'updates',\n tooltip: 'Entity updates',\n icon: 'arrow_circle_right',\n },\n]\n\nexport type FeedProps = {\n disabled?: boolean\n readOnly: boolean\n statuses: Status[]\n entityListId?: string | undefined\n isSlideOut?: boolean\n versionReview?: boolean\n}\n\nexport const Feed = ({\n disabled,\n readOnly,\n statuses = [],\n entityListId,\n isSlideOut,\n versionReview = false,\n}: FeedProps) => {\n const {\n projectName,\n entities,\n entityType,\n editingId,\n projectInfo,\n setEditingId,\n userName,\n activitiesData,\n isLoadingNew,\n isLoadingNextPage,\n loadNextPage,\n hasNextPage,\n users,\n feedFilter,\n setFeedFilter,\n isGuest,\n } = useFeedContext()\n\n const {\n openSlideOut,\n highlightedActivities,\n setHighlightedActivities,\n onOpenImage,\n setFeedAnnotations,\n user,\n } = useDetailsPanelContext()\n\n const isVersionsFilter = feedFilter.conditions?.some(\n (c) => 'key' in c && c.key === 'versions' && c.value === true,\n )\n const hasActiveFilters = feedFilter.conditions?.some(\n (c) => 'key' in c && ['comments', 'checklists', 'versions', 'updates'].includes(c.key) && c.value === true,\n )\n const hasCommentLikeFilter = feedFilter.conditions?.some(\n (c) => 'key' in c && (c.key === 'comments' || c.key === 'checklists') && c.value === true,\n )\n\n // check activities permission for commenting\n const {\n data: projectPermissions,\n isLoading: isLoadingPermissions,\n } = useGetMyProjectPermissionsQuery(\n { projectName },\n { skip: !projectName },\n )\n const isCommentRestricted =\n !user.data?.isManager &&\n !user.data?.isAdmin &&\n !isLoadingPermissions &&\n projectPermissions?.activities?.enabled &&\n !projectPermissions?.activities?.activities?.includes('comment')\n\n // hide comment input for specific filters or when restricted by permissions\n const hideCommentInput = isCommentRestricted || (hasActiveFilters && !hasCommentLikeFilter)\n\n const activitiesWithMergedAnnotations = useMemo(\n () => mergeAnnotationAttachments(activitiesData),\n [activitiesData],\n )\n\n useEffect(() => {\n if (!activitiesWithMergedAnnotations.length) {\n setFeedAnnotations([])\n }\n\n const annotations = activitiesWithMergedAnnotations\n .map((activity) =>\n activity.activityData?.annotations?.map((a: SavedAnnotationMetadata) => ({\n ...a,\n activityId: activity.activityId,\n })),\n )\n .filter(Boolean)\n .flat()\n\n setFeedAnnotations(annotations)\n }, [activitiesWithMergedAnnotations])\n\n // do any transformation on activities data\n // 1. status change activities, attach status data based on projectName\n // 2. reverse the order\n // 3. is this activity from the current user?\n const transformedActivitiesData = useTransformActivities(\n // @ts-ignore\n activitiesWithMergedAnnotations,\n users,\n projectInfo,\n entityType,\n userName,\n feedFilter,\n ) as any[]\n\n // REFS\n const feedRef = useRef(null)\n // const commentInputRef = useRef(null)\n\n // scroll by height of comment input when it opens or closes\n useScrollOnInputOpen({ feedRef, isInputOpen: editingId === FEED_NEW_COMMENT, height: 93 })\n\n // save scroll position of a feed\n useSaveScrollPos({\n entities,\n feedRef,\n filter: feedFilter,\n disabled: !!highlightedActivities.length,\n isLoading: isLoadingNew,\n })\n // try and scroll to highlightedActivities activity\n useScrollToHighlighted({\n feedRef,\n highlighted: highlightedActivities,\n isLoading: isLoadingNew || isLoadingNextPage,\n loadNextPage,\n hasNextPage: !!loadNextPage,\n activities: activitiesData,\n })\n\n // comment mutations here!\n const {\n submitComment: submitCommentMutation,\n updateComment,\n deleteComment,\n submitReview: submitReviewMutation,\n isSaving,\n } = useCommentMutations({\n projectName,\n entityType: entityType,\n entities,\n filter: feedFilter,\n entityListId,\n })\n\n // wrap submitComment to scroll to bottom\n const submitComment = useCallback(\n async (value: string, files: any[] = [], data: any = {}) => {\n await submitCommentMutation(value, files, data)\n // scroll to bottom (scrollTop 0 is bottom because of column-reverse)\n if (feedRef.current) {\n ;(feedRef.current as any).scrollTo({ top: 0 })\n }\n },\n [submitCommentMutation, feedRef],\n )\n\n const submitReview = useCallback(async (feedback: VersionReviewFeedback) => {\n await submitReviewMutation(feedback)\n }, [submitReviewMutation])\n\n // When a checkbox is clicked, update the body to add/remove \"x\" in [ ] markdown\n // Then update comment with new body\n const handleCommentChecked = (e: React.ChangeEvent<HTMLInputElement>, activity: Activity) => {\n const target = e?.target\n if (!target || !activity) return console.log('no target or activity')\n\n // the value that it's changing to\n const checked: boolean = target.checked\n const currentMarkdown: string = checked ? '[ ]' : '[x]'\n const newMarkdown: string = checked ? '[x]' : '[ ]'\n\n const { body } = activity\n\n // based on all li elements in the whole className 'comment-body' with className 'task-list-item'\n // find the index of the task that was checked\n const taskIndex: number = Array.from(\n target.closest('.comment-body')?.querySelectorAll('.task-list-item') || [],\n ).findIndex((li: Element) => li === target.closest('li'))\n\n let replaceIndex: number = taskIndex\n\n // count the number of current markdowns in the body\n const allMarkdowns: string[] = body.match(/\\[.\\]/g) || []\n\n allMarkdowns.forEach((markdown: string, index: number) => {\n // does it match the current markdown?\n if (markdown !== currentMarkdown && index < taskIndex) replaceIndex--\n })\n\n // now find the indexes of the current markdown to replace\n const indexesOfCurrentMarkdownInBody: number[] = []\n let index: number = -1\n while ((index = body.indexOf(currentMarkdown, index + 1)) > -1) {\n indexesOfCurrentMarkdownInBody.push(index)\n }\n\n const indexToReplaceInBody: number | undefined = indexesOfCurrentMarkdownInBody[replaceIndex]\n if (indexToReplaceInBody === undefined) return\n\n const endReplaceIndex: number = indexToReplaceInBody + currentMarkdown.length\n\n // replace the current markdown with the new markdown\n const newBody: string =\n body.slice(0, indexToReplaceInBody) + newMarkdown + body.slice(endReplaceIndex)\n\n if (!newBody) return\n\n updateComment(activity, newBody, activity.files)\n }\n\n const handleRefClick = (ref: {\n entityId: string\n entityType: DetailsPanelEntityType\n activityId: string\n }) => {\n const { entityId, entityType, activityId } = ref\n const supportedTypes = ['version', 'task', 'folder']\n\n if (!entityType || !supportedTypes.includes(entityType))\n return console.log('Entity type not supported yet')\n\n if (!entityId || !entityType || !projectName) return console.log('No entity id or type found')\n\n // open the slide out\n openSlideOut({ entityId, entityType, projectName })\n // set highlighted activity\n setHighlightedActivities([activityId])\n }\n\n const handleFileExpand = ({ index, activityId }: { index: number; activityId: string }) => {\n const previewableFiles = Object.values(transformedActivitiesData)\n .reverse()\n .filter((a) => a.activityType == 'comment')\n .map((a) => ({\n id: a.activityId,\n files: a.files.filter((file: any) => isFilePreviewable(file.mime, file.ext)),\n }))\n .filter((a) => a.files.length > 0)\n\n // open image callback\n onOpenImage?.({ files: previewableFiles, activityId, index, projectName })\n }\n\n const loadingPlaceholders = useMemo(() => getLoadingPlaceholders(10), [])\n\n const lastVersionReview = useLastVersionReview({\n projectName,\n enabled: versionReview,\n entityIds: entities.map(e => e.id),\n activities: transformedActivitiesData,\n loadingActivities: isLoadingNew,\n userName,\n })\n\n let warningMessage\n\n return (\n <>\n <Styled.FeedContainer className=\"feed\">\n {warningMessage && (\n <Styled.Warning>\n <Icon icon=\"info\" />\n {warningMessage}\n </Styled.Warning>\n )}\n <TabHeaderAndFilters\n label=\"Activity Feed\"\n filters={feedFilters}\n currentFilter={feedFilter}\n onFilterChange={setFeedFilter}\n isLoading={isLoadingNew}\n />\n <Styled.FeedContent ref={feedRef} className={clsx({ loading: isLoadingNew }, 'no-shimmer')}>\n {isLoadingNew\n ? loadingPlaceholders\n : transformedActivitiesData.map((activity) => (\n <ActivityItem\n key={activity.activityId}\n activity={activity}\n onCheckChange={handleCommentChecked}\n onDelete={deleteComment}\n onUpdate={async (value, files, _refs, data) =>\n await updateComment(activity, value, files, data)\n }\n projectInfo={projectInfo}\n projectName={projectName}\n entityType={entityType}\n onReferenceClick={handleRefClick}\n createdAts={entities.map((e) => e.createdAt)}\n onFileExpand={handleFileExpand}\n showOrigin={entities.length > 1}\n filter={feedFilter}\n editProps={{\n projectName,\n entities: entities,\n entityType,\n }}\n isHighlighted={highlightedActivities.includes(activity.activityId)}\n readOnly={readOnly}\n statuses={statuses}\n isSlideOut={isSlideOut}\n isGuest={isGuest}\n />\n ))}\n {/* message when no versions published */}\n {transformedActivitiesData.length === 0 &&\n isVersionsFilter &&\n !hasCommentLikeFilter &&\n !isLoadingNew && (\n <EmptyPlaceholder message=\"No versions published yet\" icon=\"layers\" />\n )}\n {hasNextPage && loadNextPage && (\n <InView\n root={feedRef.current}\n onChange={(inView) => inView && loadNextPage()}\n rootMargin={'400px 0px 0px 0px'}\n >\n <Styled.LoadMore style={{ height: 0 }} onClick={() => loadNextPage()}>\n {isLoadingNextPage ? 'Loading more...' : 'Click to load more'}\n </Styled.LoadMore>\n </InView>\n )}\n </Styled.FeedContent>\n {!hideCommentInput && (\n <CommentInput\n initValue={null}\n onSubmit={submitComment}\n isOpen={editingId === FEED_NEW_COMMENT}\n onClose={() => setEditingId(null)}\n onOpen={() => setEditingId(FEED_NEW_COMMENT)}\n disabled={disabled}\n isLoading={isLoadingNew || !entities.length || isSaving}\n versionReview={versionReview}\n lastOwnVersionReview={lastVersionReview}\n onReview={submitReview}\n />\n )}\n </Styled.FeedContainer>\n </>\n )\n}\n"],"names":["activitiesLast","feedFilters","Feed","disabled","readOnly","statuses","entityListId","isSlideOut","versionReview","projectName","entities","entityType","editingId","projectInfo","setEditingId","userName","activitiesData","isLoadingNew","isLoadingNextPage","loadNextPage","hasNextPage","users","feedFilter","setFeedFilter","isGuest","useFeedContext","openSlideOut","highlightedActivities","setHighlightedActivities","onOpenImage","setFeedAnnotations","user","useDetailsPanelContext","isVersionsFilter","c","hasActiveFilters","hasCommentLikeFilter","projectPermissions","isLoadingPermissions","useGetMyProjectPermissionsQuery","hideCommentInput","activitiesWithMergedAnnotations","useMemo","mergeAnnotationAttachments","useEffect","annotations","activity","a","transformedActivitiesData","useTransformActivities","feedRef","useRef","useScrollOnInputOpen","FEED_NEW_COMMENT","useSaveScrollPos","useScrollToHighlighted","submitCommentMutation","updateComment","deleteComment","submitReviewMutation","isSaving","useCommentMutations","submitComment","useCallback","value","files","data","submitReview","feedback","handleCommentChecked","target","checked","currentMarkdown","newMarkdown","body","taskIndex","li","replaceIndex","markdown","index","indexesOfCurrentMarkdownInBody","indexToReplaceInBody","endReplaceIndex","newBody","handleRefClick","ref","entityId","activityId","handleFileExpand","previewableFiles","file","isFilePreviewable","loadingPlaceholders","getLoadingPlaceholders","lastVersionReview","useLastVersionReview","jsxs","Styled.FeedContainer","jsx","TabHeaderAndFilters","Styled.FeedContent","clsx","ActivityItem","_refs","e","EmptyPlaceholder","InView","inView","Styled.LoadMore","CommentInput"],"mappings":"8zOA2BaA,GAAiB,GAExBC,GAAoC,CACxC,CACE,GAAI,WACJ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kB,EAAOC,EAAOC,CAAI,EAElD,YAAArD,EACA,YAAAJ,EACA,WAAAE,EACA,iBAAkByE,GAClB,WAAY1E,EAAS,IAAK8F,GAAMA,EAAE,SAAS,EAC3C,aAAchB,GACd,WAAY9E,EAAS,OAAS,EAC9B,OAAQY,EACR,UAAW,CACT,YAAAb,EACA,SAAAC,EACA,WAAAC,CAAA,EAEF,cAAegB,EAAsB,SAASmB,EAAS,UAAU,EACjE,SAAA1C,EACA,SAAAC,EACA,WAAAE,EACA,QAAAiB,CAAA,EAxBKsB,EAAS,UAAA,CA0BjB,EAEJE,EAA0B,SAAW,GACpCf,GACA,CAACG,GACD,CAACnB,GACDiF,EAAAA,kBAAAA,IAACO,GAAAA,iBAAA,CAAiB,QAAQ,4BAA4B,KAAK,QAAA,CAAS,EAErErF,GAAeD,GACd+E,EAAAA,kBAAAA,IAACQ,GAAAA,OAAA,CACC,KAAMxD,EAAQ,QACd,SAAWyD,GAAWA,GAAUxF,EAAA,EAChC,WAAY,oBAEZ,SAAA+E,EAAAA,kBAAAA,IAACU,EAAAA,SAAA,CAAgB,MAAO,CAAE,OAAQ,CAAA,EAAK,QAAS,IAAMzF,EAAA,EACnD,SAAAD,EAAoB,kBAAoB,oBAAA,CAC3C,CAAA,CAAA,CACF,EAEJ,EACC,CAACsB,IACA0D,EAAAA,kBAAAA,IAACW,GAAAA,QAAA,CACC,UAAW,KACX,SAAU/C,GACV,OAAQlD,IAAcyC,EAAAA,iBACtB,QAAS,IAAMvC,EAAa,IAAI,EAChC,OAAQ,IAAMA,EAAauC,kBAAgB,EAC3C,SAAAlD,EACA,UAAWc,GAAgB,CAACP,EAAS,QAAUkD,GAC/C,cAAApD,EACA,qBAAsBsF,GACtB,SAAU3B,EAAA,CAAA,CACZ,CAAA,CAEJ,CAAA,CACF,CAEJ"}
1
+ {"version":3,"file":"Feed.cjs.js","sources":["../../../../../src/containers/Feed/Feed.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react'\nimport ActivityItem from './components/ActivityItem'\nimport CommentInput from './components/CommentInput/CommentInput'\nimport { VersionReviewFeedback } from './components/CommentInput/types'\nimport * as Styled from './Feed.styled'\nimport useCommentMutations, { Activity } from './hooks/useCommentMutations'\nimport useTransformActivities from './hooks/useTransformActivities'\nimport { InView } from 'react-intersection-observer'\nimport useSaveScrollPos from './hooks/useSaveScrollPos'\nimport useScrollOnInputOpen from './hooks/useScrollOnInputOpen'\nimport { getLoadingPlaceholders } from './feedHelpers'\nimport { Icon } from '@ynput/ayon-react-components'\nimport clsx from 'clsx'\nimport useScrollToHighlighted from './hooks/useScrollToHighlighted'\nimport { isFilePreviewable } from './components/FileUploadPreview/FileUploadPreview'\nimport EmptyPlaceholder from '@shared/components/EmptyPlaceholder'\nimport { useFeedContext, FEED_NEW_COMMENT } from './context/FeedContext'\nimport { Status } from '../ProjectTreeTable/types/project'\nimport { useDetailsPanelContext } from '@shared/context'\nimport { DetailsPanelEntityType, useGetMyProjectPermissionsQuery } from '@shared/api'\nimport mergeAnnotationAttachments from './helpers/mergeAnnotationAttachments'\nimport { SavedAnnotationMetadata } from '.'\nimport TabHeaderAndFilters, {\n FilterItem,\n} from '../DetailsPanel/components/TabHeaderAndFilters/TabHeaderAndFilters'\nimport { useLastVersionReview } from './hooks/useLastVersionReview'\n\n// number of activities to get\nexport const activitiesLast = 30\n\nconst feedFilters: FilterItem<string>[] = [\n {\n id: 'comments',\n tooltip: 'Comments',\n icon: 'chat',\n },\n {\n id: 'checklists',\n tooltip: 'Checklists',\n icon: 'checklist',\n },\n {\n id: 'versions',\n tooltip: 'Published versions',\n icon: 'layers',\n },\n {\n id: 'updates',\n tooltip: 'Entity updates',\n icon: 'arrow_circle_right',\n },\n]\n\nexport type FeedProps = {\n disabled?: boolean\n readOnly: boolean\n statuses: Status[]\n entityListId?: string | undefined\n isSlideOut?: boolean\n versionReview?: boolean\n}\n\nexport const Feed = ({\n disabled,\n readOnly,\n statuses = [],\n entityListId,\n isSlideOut,\n versionReview = false,\n}: FeedProps) => {\n const {\n projectName,\n entities,\n entityType,\n editingId,\n projectInfo,\n setEditingId,\n userName,\n activitiesData,\n isLoadingNew,\n isLoadingNextPage,\n loadNextPage,\n hasNextPage,\n users,\n feedFilter,\n setFeedFilter,\n isGuest,\n } = useFeedContext()\n\n const {\n openSlideOut,\n highlightedActivities,\n setHighlightedActivities,\n onOpenImage,\n setFeedAnnotations,\n user,\n } = useDetailsPanelContext()\n\n const isVersionsFilter = feedFilter.conditions?.some(\n (c) => 'key' in c && c.key === 'versions' && c.value === true,\n )\n const hasActiveFilters = feedFilter.conditions?.some(\n (c) =>\n 'key' in c &&\n ['comments', 'checklists', 'versions', 'updates'].includes(c.key) &&\n c.value === true,\n )\n const hasCommentLikeFilter = feedFilter.conditions?.some(\n (c) => 'key' in c && (c.key === 'comments' || c.key === 'checklists') && c.value === true,\n )\n\n // check activities permission for commenting\n const { data: projectPermissions, isLoading: isLoadingPermissions } =\n useGetMyProjectPermissionsQuery({ projectName }, { skip: !projectName })\n const isCommentRestricted =\n !user.data?.isManager &&\n !user.data?.isAdmin &&\n !isLoadingPermissions &&\n projectPermissions?.activities?.enabled &&\n !projectPermissions?.activities?.activities?.includes('comment')\n\n // hide comment input for specific filters or when restricted by permissions\n const hideCommentInput = isCommentRestricted || (hasActiveFilters && !hasCommentLikeFilter)\n\n const activitiesWithMergedAnnotations = useMemo(\n () => mergeAnnotationAttachments(activitiesData),\n [activitiesData],\n )\n\n useEffect(() => {\n if (!activitiesWithMergedAnnotations.length) {\n setFeedAnnotations([])\n }\n\n const annotations = activitiesWithMergedAnnotations\n .map((activity) =>\n activity.activityData?.annotations?.map((a: SavedAnnotationMetadata) => ({\n ...a,\n activityId: activity.activityId,\n })),\n )\n .filter(Boolean)\n .flat()\n\n setFeedAnnotations(annotations)\n }, [activitiesWithMergedAnnotations])\n\n // do any transformation on activities data\n // 1. status change activities, attach status data based on projectName\n // 2. reverse the order\n // 3. is this activity from the current user?\n const transformedActivitiesData = useTransformActivities(\n // @ts-ignore\n activitiesWithMergedAnnotations,\n users,\n projectInfo,\n entityType,\n userName,\n feedFilter,\n ) as any[]\n\n // REFS\n const feedRef = useRef(null)\n // const commentInputRef = useRef(null)\n\n // scroll by height of comment input when it opens or closes\n useScrollOnInputOpen({ feedRef, isInputOpen: editingId === FEED_NEW_COMMENT, height: 93 })\n\n // save scroll position of a feed\n useSaveScrollPos({\n entities,\n feedRef,\n filter: feedFilter,\n disabled: !!highlightedActivities.length,\n isLoading: isLoadingNew,\n })\n // try and scroll to highlightedActivities activity\n useScrollToHighlighted({\n feedRef,\n highlighted: highlightedActivities,\n isLoading: isLoadingNew || isLoadingNextPage,\n loadNextPage,\n hasNextPage: !!loadNextPage,\n activities: activitiesData,\n })\n\n // comment mutations here!\n const {\n submitComment: submitCommentMutation,\n updateComment,\n deleteComment,\n submitReview: submitReviewMutation,\n isSaving,\n } = useCommentMutations({\n projectName,\n entityType: entityType,\n entities,\n filter: feedFilter,\n entityListId,\n })\n\n // wrap submitComment to scroll to bottom\n const submitComment = useCallback(\n async (value: string, files: any[] = [], data: any = {}) => {\n await submitCommentMutation(value, files, data)\n // scroll to bottom (scrollTop 0 is bottom because of column-reverse)\n if (feedRef.current) {\n ;(feedRef.current as any).scrollTo({ top: 0 })\n }\n },\n [submitCommentMutation, feedRef],\n )\n\n const submitReview = useCallback(\n async (feedback: VersionReviewFeedback) => {\n await submitReviewMutation(feedback)\n },\n [submitReviewMutation],\n )\n\n // When a checkbox is clicked, update the body to add/remove \"x\" in [ ] markdown\n // Then update comment with new body\n const handleCommentChecked = (e: React.ChangeEvent<HTMLInputElement>, activity: Activity) => {\n const target = e?.target\n if (!target || !activity) return console.log('no target or activity')\n\n // the value that it's changing to\n const checked: boolean = target.checked\n const currentMarkdown: string = checked ? '[ ]' : '[x]'\n const newMarkdown: string = checked ? '[x]' : '[ ]'\n\n const { body } = activity\n\n // based on all li elements in the whole className 'comment-body' with className 'task-list-item'\n // find the index of the task that was checked\n const taskIndex: number = Array.from(\n target.closest('.comment-body')?.querySelectorAll('.task-list-item') || [],\n ).findIndex((li: Element) => li === target.closest('li'))\n\n let replaceIndex: number = taskIndex\n\n // count the number of current markdowns in the body\n const allMarkdowns: string[] = body.match(/\\[.\\]/g) || []\n\n allMarkdowns.forEach((markdown: string, index: number) => {\n // does it match the current markdown?\n if (markdown !== currentMarkdown && index < taskIndex) replaceIndex--\n })\n\n // now find the indexes of the current markdown to replace\n const indexesOfCurrentMarkdownInBody: number[] = []\n let index: number = -1\n while ((index = body.indexOf(currentMarkdown, index + 1)) > -1) {\n indexesOfCurrentMarkdownInBody.push(index)\n }\n\n const indexToReplaceInBody: number | undefined = indexesOfCurrentMarkdownInBody[replaceIndex]\n if (indexToReplaceInBody === undefined) return\n\n const endReplaceIndex: number = indexToReplaceInBody + currentMarkdown.length\n\n // replace the current markdown with the new markdown\n const newBody: string =\n body.slice(0, indexToReplaceInBody) + newMarkdown + body.slice(endReplaceIndex)\n\n if (!newBody) return\n\n updateComment(activity, newBody, activity.files)\n }\n\n const handleRefClick = (ref: {\n entityId: string\n entityType: DetailsPanelEntityType\n activityId: string\n }) => {\n const { entityId, entityType, activityId } = ref\n const supportedTypes = ['version', 'task', 'folder']\n\n if (!entityType || !supportedTypes.includes(entityType))\n return console.log('Entity type not supported yet')\n\n if (!entityId || !entityType || !projectName) return console.log('No entity id or type found')\n\n // open the slide out\n openSlideOut({ entityId, entityType, projectName })\n // set highlighted activity\n setHighlightedActivities([activityId])\n }\n\n const handleFileExpand = ({ index, activityId }: { index: number; activityId: string }) => {\n const previewableFiles = Object.values(transformedActivitiesData)\n .reverse()\n .filter((a) => a.activityType == 'comment')\n .map((a) => ({\n id: a.activityId,\n files: a.files.filter((file: any) => isFilePreviewable(file.mime, file.ext)),\n }))\n .filter((a) => a.files.length > 0)\n\n // open image callback\n onOpenImage?.({ files: previewableFiles, activityId, index, projectName })\n }\n\n const loadingPlaceholders = useMemo(() => getLoadingPlaceholders(10), [])\n\n const lastVersionReview = useLastVersionReview({\n projectName,\n enabled: versionReview,\n entityIds: entities.map((e) => e.id),\n activities: transformedActivitiesData,\n loadingActivities: isLoadingNew,\n userName,\n })\n\n let warningMessage\n\n return (\n <>\n <Styled.FeedContainer className=\"feed\">\n {warningMessage && (\n <Styled.Warning>\n <Icon icon=\"info\" />\n {warningMessage}\n </Styled.Warning>\n )}\n <TabHeaderAndFilters\n label=\"Activity Feed\"\n filters={feedFilters}\n currentFilter={feedFilter}\n onFilterChange={setFeedFilter}\n isLoading={isLoadingNew}\n />\n <Styled.FeedContent ref={feedRef} className={clsx({ loading: isLoadingNew }, 'no-shimmer')}>\n {isLoadingNew\n ? loadingPlaceholders\n : transformedActivitiesData.map((activity) => (\n <ActivityItem\n key={activity.activityId}\n activity={activity}\n onCheckChange={handleCommentChecked}\n onDelete={deleteComment}\n onUpdate={async (value, files, _refs, data) =>\n await updateComment(activity, value, files, data)\n }\n projectInfo={projectInfo}\n projectName={projectName}\n entityType={entityType}\n onReferenceClick={handleRefClick}\n createdAts={entities.map((e) => e.createdAt)}\n onFileExpand={handleFileExpand}\n showOrigin={entities.length > 1}\n filter={feedFilter}\n editProps={{\n projectName,\n entities: entities,\n entityType,\n }}\n isHighlighted={highlightedActivities.includes(activity.activityId)}\n readOnly={readOnly}\n statuses={statuses}\n isSlideOut={isSlideOut}\n isGuest={isGuest}\n />\n ))}\n {/* message when no versions published */}\n {transformedActivitiesData.length === 0 &&\n isVersionsFilter &&\n !hasCommentLikeFilter &&\n !isLoadingNew && <EmptyPlaceholder message=\"No versions published yet\" icon=\"layers\" />}\n {hasNextPage && loadNextPage && (\n <InView\n root={feedRef.current}\n onChange={(inView) => inView && loadNextPage()}\n rootMargin={'400px 0px 0px 0px'}\n >\n <Styled.LoadMore style={{ height: 0 }} onClick={() => loadNextPage()}>\n {isLoadingNextPage ? 'Loading more...' : 'Click to load more'}\n </Styled.LoadMore>\n </InView>\n )}\n </Styled.FeedContent>\n {!hideCommentInput && (\n <CommentInput\n initValue={null}\n onSubmit={submitComment}\n isOpen={editingId === FEED_NEW_COMMENT}\n onClose={() => setEditingId(null)}\n onOpen={() => setEditingId(FEED_NEW_COMMENT)}\n disabled={disabled}\n isLoading={isLoadingNew || !entities.length || isSaving}\n versionReview={versionReview}\n lastOwnVersionReview={lastVersionReview}\n onReview={submitReview}\n />\n )}\n </Styled.FeedContainer>\n </>\n )\n}\n"],"names":["activitiesLast","feedFilters","Feed","disabled","readOnly","statuses","entityListId","isSlideOut","versionReview","projectName","entities","entityType","editingId","projectInfo","setEditingId","userName","activitiesData","isLoadingNew","isLoadingNextPage","loadNextPage","hasNextPage","users","feedFilter","setFeedFilter","isGuest","useFeedContext","openSlideOut","highlightedActivities","setHighlightedActivities","onOpenImage","setFeedAnnotations","user","useDetailsPanelContext","isVersionsFilter","c","hasActiveFilters","hasCommentLikeFilter","projectPermissions","isLoadingPermissions","useGetMyProjectPermissionsQuery","hideCommentInput","activitiesWithMergedAnnotations","useMemo","mergeAnnotationAttachments","useEffect","annotations","activity","a","transformedActivitiesData","useTransformActivities","feedRef","useRef","useScrollOnInputOpen","FEED_NEW_COMMENT","useSaveScrollPos","useScrollToHighlighted","submitCommentMutation","updateComment","deleteComment","submitReviewMutation","isSaving","useCommentMutations","submitComment","useCallback","value","files","data","submitReview","feedback","handleCommentChecked","target","checked","currentMarkdown","newMarkdown","body","taskIndex","li","replaceIndex","markdown","index","indexesOfCurrentMarkdownInBody","indexToReplaceInBody","endReplaceIndex","newBody","handleRefClick","ref","entityId","activityId","handleFileExpand","previewableFiles","file","isFilePreviewable","loadingPlaceholders","getLoadingPlaceholders","lastVersionReview","useLastVersionReview","jsxs","Styled.FeedContainer","jsx","TabHeaderAndFilters","Styled.FeedContent","clsx","ActivityItem","_refs","e","EmptyPlaceholder","InView","inView","Styled.LoadMore","CommentInput"],"mappings":"8zOA4BaA,GAAiB,GAExBC,GAAoC,CACxC,CACE,GAAI,WACJ,QAAS,WACT,KAAM,MAAA,EAER,CACE,GAAI,a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EACA,WAAAE,EACA,iBAAkByE,GAClB,WAAY1E,EAAS,IAAK8F,GAAMA,EAAE,SAAS,EAC3C,aAAchB,GACd,WAAY9E,EAAS,OAAS,EAC9B,OAAQY,EACR,UAAW,CACT,YAAAb,EACA,SAAAC,EACA,WAAAC,CAAA,EAEF,cAAegB,EAAsB,SAASmB,EAAS,UAAU,EACjE,SAAA1C,EACA,SAAAC,EACA,WAAAE,EACA,QAAAiB,CAAA,EAxBKsB,EAAS,UAAA,CA0BjB,EAEJE,EAA0B,SAAW,GACpCf,GACA,CAACG,GACD,CAACnB,GAAgBiF,EAAAA,kBAAAA,IAACO,GAAAA,iBAAA,CAAiB,QAAQ,4BAA4B,KAAK,QAAA,CAAS,EACtFrF,GAAeD,GACd+E,EAAAA,kBAAAA,IAACQ,GAAAA,OAAA,CACC,KAAMxD,EAAQ,QACd,SAAWyD,GAAWA,GAAUxF,EAAA,EAChC,WAAY,oBAEZ,SAAA+E,EAAAA,kBAAAA,IAACU,EAAAA,SAAA,CAAgB,MAAO,CAAE,OAAQ,CAAA,EAAK,QAAS,IAAMzF,EAAA,EACnD,SAAAD,EAAoB,kBAAoB,oBAAA,CAC3C,CAAA,CAAA,CACF,EAEJ,EACC,CAACsB,IACA0D,EAAAA,kBAAAA,IAACW,GAAA,CACC,UAAW,KACX,SAAU/C,GACV,OAAQlD,IAAcyC,EAAAA,iBACtB,QAAS,IAAMvC,EAAa,IAAI,EAChC,OAAQ,IAAMA,EAAauC,kBAAgB,EAC3C,SAAAlD,EACA,UAAWc,GAAgB,CAACP,EAAS,QAAUkD,GAC/C,cAAApD,EACA,qBAAsBsF,GACtB,SAAU3B,EAAA,CAAA,CACZ,CAAA,CAEJ,CAAA,CACF,CAEJ"}
@@ -200,13 +200,7 @@ const Fo = 30, Vt = [
200
200
  (t) => "key" in t && ["comments", "checklists", "versions", "updates"].includes(t.key) && t.value === !0
201
201
  ), R = p.conditions?.some(
202
202
  (t) => "key" in t && (t.key === "comments" || t.key === "checklists") && t.value === !0
203
- ), {
204
- data: L,
205
- isLoading: it
206
- } = Ot(
207
- { projectName: s },
208
- { skip: !s }
209
- ), et = !P.data?.isManager && !P.data?.isAdmin && !it && L?.activities?.enabled && !L?.activities?.activities?.includes("comment") || tt && !R, u = _(
203
+ ), { data: L, isLoading: it } = Ot({ projectName: s }, { skip: !s }), et = !P.data?.isManager && !P.data?.isAdmin && !it && L?.activities?.enabled && !L?.activities?.activities?.includes("comment") || tt && !R, u = _(
210
204
  () => Tt(h),
211
205
  [h]
212
206
  );
@@ -260,9 +254,12 @@ const Fo = 30, Vt = [
260
254
  await E(t, i, e), a.current && a.current.scrollTo({ top: 0 });
261
255
  },
262
256
  [E, a]
263
- ), nt = B(async (t) => {
264
- await O(t);
265
- }, [O]), mt = (t, i) => {
257
+ ), nt = B(
258
+ async (t) => {
259
+ await O(t);
260
+ },
261
+ [O]
262
+ ), mt = (t, i) => {
266
263
  const e = t?.target;
267
264
  if (!e || !i) return console.log("no target or activity");
268
265
  const o = e.checked, n = o ? "[ ]" : "[x]", dt = o ? "[x]" : "[ ]", { body: g } = i, T = Array.from(
@@ -1 +1 @@
1
- {"version":3,"file":"Feed.es.js","sources":["../../../../../src/containers/Feed/Feed.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react'\nimport ActivityItem from './components/ActivityItem'\nimport CommentInput, { VersionReviewFeedback } from './components/CommentInput/CommentInput'\nimport * as Styled from './Feed.styled'\nimport useCommentMutations, { Activity } from './hooks/useCommentMutations'\nimport useTransformActivities from './hooks/useTransformActivities'\nimport { InView } from 'react-intersection-observer'\nimport useSaveScrollPos from './hooks/useSaveScrollPos'\nimport useScrollOnInputOpen from './hooks/useScrollOnInputOpen'\nimport { getLoadingPlaceholders } from './feedHelpers'\nimport { Icon } from '@ynput/ayon-react-components'\nimport clsx from 'clsx'\nimport useScrollToHighlighted from './hooks/useScrollToHighlighted'\nimport { isFilePreviewable } from './components/FileUploadPreview/FileUploadPreview'\nimport EmptyPlaceholder from '@shared/components/EmptyPlaceholder'\nimport { useFeedContext, FEED_NEW_COMMENT } from './context/FeedContext'\nimport { Status } from '../ProjectTreeTable/types/project'\nimport { useDetailsPanelContext } from '@shared/context'\nimport { DetailsPanelEntityType, useGetMyProjectPermissionsQuery } from '@shared/api'\nimport mergeAnnotationAttachments from './helpers/mergeAnnotationAttachments'\nimport { SavedAnnotationMetadata } from '.'\nimport TabHeaderAndFilters, {\n FilterItem,\n} from '../DetailsPanel/components/TabHeaderAndFilters/TabHeaderAndFilters'\nimport { useLastVersionReview } from './hooks/useLastVersionReview'\n\n// number of activities to get\nexport const activitiesLast = 30\n\nconst feedFilters: FilterItem<string>[] = [\n {\n id: 'comments',\n tooltip: 'Comments',\n icon: 'chat',\n },\n {\n id: 'checklists',\n tooltip: 'Checklists',\n icon: 'checklist',\n },\n {\n id: 'versions',\n tooltip: 'Published versions',\n icon: 'layers',\n },\n {\n id: 'updates',\n tooltip: 'Entity updates',\n icon: 'arrow_circle_right',\n },\n]\n\nexport type FeedProps = {\n disabled?: boolean\n readOnly: boolean\n statuses: Status[]\n entityListId?: string | undefined\n isSlideOut?: boolean\n versionReview?: boolean\n}\n\nexport const Feed = ({\n disabled,\n readOnly,\n statuses = [],\n entityListId,\n isSlideOut,\n versionReview = false,\n}: FeedProps) => {\n const {\n projectName,\n entities,\n entityType,\n editingId,\n projectInfo,\n setEditingId,\n userName,\n activitiesData,\n isLoadingNew,\n isLoadingNextPage,\n loadNextPage,\n hasNextPage,\n users,\n feedFilter,\n setFeedFilter,\n isGuest,\n } = useFeedContext()\n\n const {\n openSlideOut,\n highlightedActivities,\n setHighlightedActivities,\n onOpenImage,\n setFeedAnnotations,\n user,\n } = useDetailsPanelContext()\n\n const isVersionsFilter = feedFilter.conditions?.some(\n (c) => 'key' in c && c.key === 'versions' && c.value === true,\n )\n const hasActiveFilters = feedFilter.conditions?.some(\n (c) => 'key' in c && ['comments', 'checklists', 'versions', 'updates'].includes(c.key) && c.value === true,\n )\n const hasCommentLikeFilter = feedFilter.conditions?.some(\n (c) => 'key' in c && (c.key === 'comments' || c.key === 'checklists') && c.value === true,\n )\n\n // check activities permission for commenting\n const {\n data: projectPermissions,\n isLoading: isLoadingPermissions,\n } = useGetMyProjectPermissionsQuery(\n { projectName },\n { skip: !projectName },\n )\n const isCommentRestricted =\n !user.data?.isManager &&\n !user.data?.isAdmin &&\n !isLoadingPermissions &&\n projectPermissions?.activities?.enabled &&\n !projectPermissions?.activities?.activities?.includes('comment')\n\n // hide comment input for specific filters or when restricted by permissions\n const hideCommentInput = isCommentRestricted || (hasActiveFilters && !hasCommentLikeFilter)\n\n const activitiesWithMergedAnnotations = useMemo(\n () => mergeAnnotationAttachments(activitiesData),\n [activitiesData],\n )\n\n useEffect(() => {\n if (!activitiesWithMergedAnnotations.length) {\n setFeedAnnotations([])\n }\n\n const annotations = activitiesWithMergedAnnotations\n .map((activity) =>\n activity.activityData?.annotations?.map((a: SavedAnnotationMetadata) => ({\n ...a,\n activityId: activity.activityId,\n })),\n )\n .filter(Boolean)\n .flat()\n\n setFeedAnnotations(annotations)\n }, [activitiesWithMergedAnnotations])\n\n // do any transformation on activities data\n // 1. status change activities, attach status data based on projectName\n // 2. reverse the order\n // 3. is this activity from the current user?\n const transformedActivitiesData = useTransformActivities(\n // @ts-ignore\n activitiesWithMergedAnnotations,\n users,\n projectInfo,\n entityType,\n userName,\n feedFilter,\n ) as any[]\n\n // REFS\n const feedRef = useRef(null)\n // const commentInputRef = useRef(null)\n\n // scroll by height of comment input when it opens or closes\n useScrollOnInputOpen({ feedRef, isInputOpen: editingId === FEED_NEW_COMMENT, height: 93 })\n\n // save scroll position of a feed\n useSaveScrollPos({\n entities,\n feedRef,\n filter: feedFilter,\n disabled: !!highlightedActivities.length,\n isLoading: isLoadingNew,\n })\n // try and scroll to highlightedActivities activity\n useScrollToHighlighted({\n feedRef,\n highlighted: highlightedActivities,\n isLoading: isLoadingNew || isLoadingNextPage,\n loadNextPage,\n hasNextPage: !!loadNextPage,\n activities: activitiesData,\n })\n\n // comment mutations here!\n const {\n submitComment: submitCommentMutation,\n updateComment,\n deleteComment,\n submitReview: submitReviewMutation,\n isSaving,\n } = useCommentMutations({\n projectName,\n entityType: entityType,\n entities,\n filter: feedFilter,\n entityListId,\n })\n\n // wrap submitComment to scroll to bottom\n const submitComment = useCallback(\n async (value: string, files: any[] = [], data: any = {}) => {\n await submitCommentMutation(value, files, data)\n // scroll to bottom (scrollTop 0 is bottom because of column-reverse)\n if (feedRef.current) {\n ;(feedRef.current as any).scrollTo({ top: 0 })\n }\n },\n [submitCommentMutation, feedRef],\n )\n\n const submitReview = useCallback(async (feedback: VersionReviewFeedback) => {\n await submitReviewMutation(feedback)\n }, [submitReviewMutation])\n\n // When a checkbox is clicked, update the body to add/remove \"x\" in [ ] markdown\n // Then update comment with new body\n const handleCommentChecked = (e: React.ChangeEvent<HTMLInputElement>, activity: Activity) => {\n const target = e?.target\n if (!target || !activity) return console.log('no target or activity')\n\n // the value that it's changing to\n const checked: boolean = target.checked\n const currentMarkdown: string = checked ? '[ ]' : '[x]'\n const newMarkdown: string = checked ? '[x]' : '[ ]'\n\n const { body } = activity\n\n // based on all li elements in the whole className 'comment-body' with className 'task-list-item'\n // find the index of the task that was checked\n const taskIndex: number = Array.from(\n target.closest('.comment-body')?.querySelectorAll('.task-list-item') || [],\n ).findIndex((li: Element) => li === target.closest('li'))\n\n let replaceIndex: number = taskIndex\n\n // count the number of current markdowns in the body\n const allMarkdowns: string[] = body.match(/\\[.\\]/g) || []\n\n allMarkdowns.forEach((markdown: string, index: number) => {\n // does it match the current markdown?\n if (markdown !== currentMarkdown && index < taskIndex) replaceIndex--\n })\n\n // now find the indexes of the current markdown to replace\n const indexesOfCurrentMarkdownInBody: number[] = []\n let index: number = -1\n while ((index = body.indexOf(currentMarkdown, index + 1)) > -1) {\n indexesOfCurrentMarkdownInBody.push(index)\n }\n\n const indexToReplaceInBody: number | undefined = indexesOfCurrentMarkdownInBody[replaceIndex]\n if (indexToReplaceInBody === undefined) return\n\n const endReplaceIndex: number = indexToReplaceInBody + currentMarkdown.length\n\n // replace the current markdown with the new markdown\n const newBody: string =\n body.slice(0, indexToReplaceInBody) + newMarkdown + body.slice(endReplaceIndex)\n\n if (!newBody) return\n\n updateComment(activity, newBody, activity.files)\n }\n\n const handleRefClick = (ref: {\n entityId: string\n entityType: DetailsPanelEntityType\n activityId: string\n }) => {\n const { entityId, entityType, activityId } = ref\n const supportedTypes = ['version', 'task', 'folder']\n\n if (!entityType || !supportedTypes.includes(entityType))\n return console.log('Entity type not supported yet')\n\n if (!entityId || !entityType || !projectName) return console.log('No entity id or type found')\n\n // open the slide out\n openSlideOut({ entityId, entityType, projectName })\n // set highlighted activity\n setHighlightedActivities([activityId])\n }\n\n const handleFileExpand = ({ index, activityId }: { index: number; activityId: string }) => {\n const previewableFiles = Object.values(transformedActivitiesData)\n .reverse()\n .filter((a) => a.activityType == 'comment')\n .map((a) => ({\n id: a.activityId,\n files: a.files.filter((file: any) => isFilePreviewable(file.mime, file.ext)),\n }))\n .filter((a) => a.files.length > 0)\n\n // open image callback\n onOpenImage?.({ files: previewableFiles, activityId, index, projectName })\n }\n\n const loadingPlaceholders = useMemo(() => getLoadingPlaceholders(10), [])\n\n const lastVersionReview = useLastVersionReview({\n projectName,\n enabled: versionReview,\n entityIds: entities.map(e => e.id),\n activities: transformedActivitiesData,\n loadingActivities: isLoadingNew,\n userName,\n })\n\n let warningMessage\n\n return (\n <>\n <Styled.FeedContainer className=\"feed\">\n {warningMessage && (\n <Styled.Warning>\n <Icon icon=\"info\" />\n {warningMessage}\n </Styled.Warning>\n )}\n <TabHeaderAndFilters\n label=\"Activity Feed\"\n filters={feedFilters}\n currentFilter={feedFilter}\n onFilterChange={setFeedFilter}\n isLoading={isLoadingNew}\n />\n <Styled.FeedContent ref={feedRef} className={clsx({ loading: isLoadingNew }, 'no-shimmer')}>\n {isLoadingNew\n ? loadingPlaceholders\n : transformedActivitiesData.map((activity) => (\n <ActivityItem\n key={activity.activityId}\n activity={activity}\n onCheckChange={handleCommentChecked}\n onDelete={deleteComment}\n onUpdate={async (value, files, _refs, data) =>\n await updateComment(activity, value, files, data)\n }\n projectInfo={projectInfo}\n projectName={projectName}\n entityType={entityType}\n onReferenceClick={handleRefClick}\n createdAts={entities.map((e) => e.createdAt)}\n onFileExpand={handleFileExpand}\n showOrigin={entities.length > 1}\n filter={feedFilter}\n editProps={{\n projectName,\n entities: entities,\n entityType,\n }}\n isHighlighted={highlightedActivities.includes(activity.activityId)}\n readOnly={readOnly}\n statuses={statuses}\n isSlideOut={isSlideOut}\n isGuest={isGuest}\n />\n ))}\n {/* message when no versions published */}\n {transformedActivitiesData.length === 0 &&\n isVersionsFilter &&\n !hasCommentLikeFilter &&\n !isLoadingNew && (\n <EmptyPlaceholder message=\"No versions published yet\" icon=\"layers\" />\n )}\n {hasNextPage && loadNextPage && (\n <InView\n root={feedRef.current}\n onChange={(inView) => inView && loadNextPage()}\n rootMargin={'400px 0px 0px 0px'}\n >\n <Styled.LoadMore style={{ height: 0 }} onClick={() => loadNextPage()}>\n {isLoadingNextPage ? 'Loading more...' : 'Click to load more'}\n </Styled.LoadMore>\n </InView>\n )}\n </Styled.FeedContent>\n {!hideCommentInput && (\n <CommentInput\n initValue={null}\n onSubmit={submitComment}\n isOpen={editingId === FEED_NEW_COMMENT}\n onClose={() => setEditingId(null)}\n onOpen={() => setEditingId(FEED_NEW_COMMENT)}\n disabled={disabled}\n isLoading={isLoadingNew || !entities.length || isSaving}\n versionReview={versionReview}\n lastOwnVersionReview={lastVersionReview}\n onReview={submitReview}\n />\n )}\n </Styled.FeedContainer>\n </>\n )\n}\n"],"names":["activitiesLast","feedFilters","Feed","disabled","readOnly","statuses","entityListId","isSlideOut","versionReview","projectName","entities","entityType","editingId","projectInfo","setEditingId","userName","activitiesData","isLoadingNew","isLoadingNextPage","loadNextPage","hasNextPage","users","feedFilter","setFeedFilter","isGuest","useFeedContext","openSlideOut","highlightedActivities","setHighlightedActivities","onOpenImage","setFeedAnnotations","user","useDetailsPanelContext","isVersionsFilter","c","hasActiveFilters","hasCommentLikeFilter","projectPermissions","isLoadingPermissions","useGetMyProjectPermissionsQuery","hideCommentInput","activitiesWithMergedAnnotations","useMemo","mergeAnnotationAttachments","useEffect","annotations","activity","a","transformedActivitiesData","useTransformActivities","feedRef","useRef","useScrollOnInputOpen","FEED_NEW_COMMENT","useSaveScrollPos","useScrollToHighlighted","submitCommentMutation","updateComment","deleteComment","submitReviewMutation","isSaving","useCommentMutations","submitComment","useCallback","value","files","data","submitReview","feedback","handleCommentChecked","e","target","checked","currentMarkdown","newMarkdown","body","taskIndex","li","replaceIndex","markdown","index","indexesOfCurrentMarkdownInBody","indexToReplaceInBody","endReplaceIndex","newBody","handleRefClick","ref","entityId","activityId","handleFileExpand","previewableFiles","file","isFilePreviewable","loadingPlaceholders","getLoadingPlaceholders","lastVersionReview","useLastVersionReview","jsxs","Styled.FeedContainer","jsx","TabHeaderAndFilters","Styled.FeedContent","clsx","ActivityItem","_refs","EmptyPlaceholder","InView","inView","Styled.LoadMore","CommentInput"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,MAAMA,KAAiB,IAExBC,KAAoC;AAAA,EACxC;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAAA,EAER;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAAA,EAER;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAAA,EAER;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAEV,GAWaC,KAAO,CAAC;AAAA,EAC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AAeD,KACdgF,gBAAAA,EAAAA;AAAAA,QAACO;AAAA,QAAA;AAAA,UACC,MAAMxD,EAAQ;AAAA,UACd,UAAU,CAACyD,MAAWA,KAAUxF,EAAA;AAAA,UAChC,YAAY;AAAA,UAEZ,UAAAgF,gBAAAA,EAAAA,IAACS,IAAA,EAAgB,OAAO,EAAE,QAAQ,EAAA,GAAK,SAAS,MAAMzF,EAAA,GACnD,UAAAD,IAAoB,oBAAoB,qBAAA,CAC3C;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,GAEJ;AAAA,IACC,CAACsB,MACA2D,gBAAAA,EAAAA;AAAAA,MAACU;AAAA,MAAA;AAAA,QACC,WAAW;AAAA,QACX,UAAU/C;AAAA,QACV,QAAQlD,MAAcyC;AAAA,QACtB,SAAS,MAAMvC,EAAa,IAAI;AAAA,QAChC,QAAQ,MAAMA,EAAauC,CAAgB;AAAA,QAC3C,UAAAlD;AAAA,QACA,WAAWc,KAAgB,CAACP,EAAS,UAAUkD;AAAA,QAC/C,eAAApD;AAAA,QACA,sBAAsBuF;AAAA,QACtB,UAAU5B;AAAA,MAAA;AAAA,IAAA;AAAA,EACZ,EAAA,CAEJ,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"Feed.es.js","sources":["../../../../../src/containers/Feed/Feed.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef } from 'react'\nimport ActivityItem from './components/ActivityItem'\nimport CommentInput from './components/CommentInput/CommentInput'\nimport { VersionReviewFeedback } from './components/CommentInput/types'\nimport * as Styled from './Feed.styled'\nimport useCommentMutations, { Activity } from './hooks/useCommentMutations'\nimport useTransformActivities from './hooks/useTransformActivities'\nimport { InView } from 'react-intersection-observer'\nimport useSaveScrollPos from './hooks/useSaveScrollPos'\nimport useScrollOnInputOpen from './hooks/useScrollOnInputOpen'\nimport { getLoadingPlaceholders } from './feedHelpers'\nimport { Icon } from '@ynput/ayon-react-components'\nimport clsx from 'clsx'\nimport useScrollToHighlighted from './hooks/useScrollToHighlighted'\nimport { isFilePreviewable } from './components/FileUploadPreview/FileUploadPreview'\nimport EmptyPlaceholder from '@shared/components/EmptyPlaceholder'\nimport { useFeedContext, FEED_NEW_COMMENT } from './context/FeedContext'\nimport { Status } from '../ProjectTreeTable/types/project'\nimport { useDetailsPanelContext } from '@shared/context'\nimport { DetailsPanelEntityType, useGetMyProjectPermissionsQuery } from '@shared/api'\nimport mergeAnnotationAttachments from './helpers/mergeAnnotationAttachments'\nimport { SavedAnnotationMetadata } from '.'\nimport TabHeaderAndFilters, {\n FilterItem,\n} from '../DetailsPanel/components/TabHeaderAndFilters/TabHeaderAndFilters'\nimport { useLastVersionReview } from './hooks/useLastVersionReview'\n\n// number of activities to get\nexport const activitiesLast = 30\n\nconst feedFilters: FilterItem<string>[] = [\n {\n id: 'comments',\n tooltip: 'Comments',\n icon: 'chat',\n },\n {\n id: 'checklists',\n tooltip: 'Checklists',\n icon: 'checklist',\n },\n {\n id: 'versions',\n tooltip: 'Published versions',\n icon: 'layers',\n },\n {\n id: 'updates',\n tooltip: 'Entity updates',\n icon: 'arrow_circle_right',\n },\n]\n\nexport type FeedProps = {\n disabled?: boolean\n readOnly: boolean\n statuses: Status[]\n entityListId?: string | undefined\n isSlideOut?: boolean\n versionReview?: boolean\n}\n\nexport const Feed = ({\n disabled,\n readOnly,\n statuses = [],\n entityListId,\n isSlideOut,\n versionReview = false,\n}: FeedProps) => {\n const {\n projectName,\n entities,\n entityType,\n editingId,\n projectInfo,\n setEditingId,\n userName,\n activitiesData,\n isLoadingNew,\n isLoadingNextPage,\n loadNextPage,\n hasNextPage,\n users,\n feedFilter,\n setFeedFilter,\n isGuest,\n } = useFeedContext()\n\n const {\n openSlideOut,\n highlightedActivities,\n setHighlightedActivities,\n onOpenImage,\n setFeedAnnotations,\n user,\n } = useDetailsPanelContext()\n\n const isVersionsFilter = feedFilter.conditions?.some(\n (c) => 'key' in c && c.key === 'versions' && c.value === true,\n )\n const hasActiveFilters = feedFilter.conditions?.some(\n (c) =>\n 'key' in c &&\n ['comments', 'checklists', 'versions', 'updates'].includes(c.key) &&\n c.value === true,\n )\n const hasCommentLikeFilter = feedFilter.conditions?.some(\n (c) => 'key' in c && (c.key === 'comments' || c.key === 'checklists') && c.value === true,\n )\n\n // check activities permission for commenting\n const { data: projectPermissions, isLoading: isLoadingPermissions } =\n useGetMyProjectPermissionsQuery({ projectName }, { skip: !projectName })\n const isCommentRestricted =\n !user.data?.isManager &&\n !user.data?.isAdmin &&\n !isLoadingPermissions &&\n projectPermissions?.activities?.enabled &&\n !projectPermissions?.activities?.activities?.includes('comment')\n\n // hide comment input for specific filters or when restricted by permissions\n const hideCommentInput = isCommentRestricted || (hasActiveFilters && !hasCommentLikeFilter)\n\n const activitiesWithMergedAnnotations = useMemo(\n () => mergeAnnotationAttachments(activitiesData),\n [activitiesData],\n )\n\n useEffect(() => {\n if (!activitiesWithMergedAnnotations.length) {\n setFeedAnnotations([])\n }\n\n const annotations = activitiesWithMergedAnnotations\n .map((activity) =>\n activity.activityData?.annotations?.map((a: SavedAnnotationMetadata) => ({\n ...a,\n activityId: activity.activityId,\n })),\n )\n .filter(Boolean)\n .flat()\n\n setFeedAnnotations(annotations)\n }, [activitiesWithMergedAnnotations])\n\n // do any transformation on activities data\n // 1. status change activities, attach status data based on projectName\n // 2. reverse the order\n // 3. is this activity from the current user?\n const transformedActivitiesData = useTransformActivities(\n // @ts-ignore\n activitiesWithMergedAnnotations,\n users,\n projectInfo,\n entityType,\n userName,\n feedFilter,\n ) as any[]\n\n // REFS\n const feedRef = useRef(null)\n // const commentInputRef = useRef(null)\n\n // scroll by height of comment input when it opens or closes\n useScrollOnInputOpen({ feedRef, isInputOpen: editingId === FEED_NEW_COMMENT, height: 93 })\n\n // save scroll position of a feed\n useSaveScrollPos({\n entities,\n feedRef,\n filter: feedFilter,\n disabled: !!highlightedActivities.length,\n isLoading: isLoadingNew,\n })\n // try and scroll to highlightedActivities activity\n useScrollToHighlighted({\n feedRef,\n highlighted: highlightedActivities,\n isLoading: isLoadingNew || isLoadingNextPage,\n loadNextPage,\n hasNextPage: !!loadNextPage,\n activities: activitiesData,\n })\n\n // comment mutations here!\n const {\n submitComment: submitCommentMutation,\n updateComment,\n deleteComment,\n submitReview: submitReviewMutation,\n isSaving,\n } = useCommentMutations({\n projectName,\n entityType: entityType,\n entities,\n filter: feedFilter,\n entityListId,\n })\n\n // wrap submitComment to scroll to bottom\n const submitComment = useCallback(\n async (value: string, files: any[] = [], data: any = {}) => {\n await submitCommentMutation(value, files, data)\n // scroll to bottom (scrollTop 0 is bottom because of column-reverse)\n if (feedRef.current) {\n ;(feedRef.current as any).scrollTo({ top: 0 })\n }\n },\n [submitCommentMutation, feedRef],\n )\n\n const submitReview = useCallback(\n async (feedback: VersionReviewFeedback) => {\n await submitReviewMutation(feedback)\n },\n [submitReviewMutation],\n )\n\n // When a checkbox is clicked, update the body to add/remove \"x\" in [ ] markdown\n // Then update comment with new body\n const handleCommentChecked = (e: React.ChangeEvent<HTMLInputElement>, activity: Activity) => {\n const target = e?.target\n if (!target || !activity) return console.log('no target or activity')\n\n // the value that it's changing to\n const checked: boolean = target.checked\n const currentMarkdown: string = checked ? '[ ]' : '[x]'\n const newMarkdown: string = checked ? '[x]' : '[ ]'\n\n const { body } = activity\n\n // based on all li elements in the whole className 'comment-body' with className 'task-list-item'\n // find the index of the task that was checked\n const taskIndex: number = Array.from(\n target.closest('.comment-body')?.querySelectorAll('.task-list-item') || [],\n ).findIndex((li: Element) => li === target.closest('li'))\n\n let replaceIndex: number = taskIndex\n\n // count the number of current markdowns in the body\n const allMarkdowns: string[] = body.match(/\\[.\\]/g) || []\n\n allMarkdowns.forEach((markdown: string, index: number) => {\n // does it match the current markdown?\n if (markdown !== currentMarkdown && index < taskIndex) replaceIndex--\n })\n\n // now find the indexes of the current markdown to replace\n const indexesOfCurrentMarkdownInBody: number[] = []\n let index: number = -1\n while ((index = body.indexOf(currentMarkdown, index + 1)) > -1) {\n indexesOfCurrentMarkdownInBody.push(index)\n }\n\n const indexToReplaceInBody: number | undefined = indexesOfCurrentMarkdownInBody[replaceIndex]\n if (indexToReplaceInBody === undefined) return\n\n const endReplaceIndex: number = indexToReplaceInBody + currentMarkdown.length\n\n // replace the current markdown with the new markdown\n const newBody: string =\n body.slice(0, indexToReplaceInBody) + newMarkdown + body.slice(endReplaceIndex)\n\n if (!newBody) return\n\n updateComment(activity, newBody, activity.files)\n }\n\n const handleRefClick = (ref: {\n entityId: string\n entityType: DetailsPanelEntityType\n activityId: string\n }) => {\n const { entityId, entityType, activityId } = ref\n const supportedTypes = ['version', 'task', 'folder']\n\n if (!entityType || !supportedTypes.includes(entityType))\n return console.log('Entity type not supported yet')\n\n if (!entityId || !entityType || !projectName) return console.log('No entity id or type found')\n\n // open the slide out\n openSlideOut({ entityId, entityType, projectName })\n // set highlighted activity\n setHighlightedActivities([activityId])\n }\n\n const handleFileExpand = ({ index, activityId }: { index: number; activityId: string }) => {\n const previewableFiles = Object.values(transformedActivitiesData)\n .reverse()\n .filter((a) => a.activityType == 'comment')\n .map((a) => ({\n id: a.activityId,\n files: a.files.filter((file: any) => isFilePreviewable(file.mime, file.ext)),\n }))\n .filter((a) => a.files.length > 0)\n\n // open image callback\n onOpenImage?.({ files: previewableFiles, activityId, index, projectName })\n }\n\n const loadingPlaceholders = useMemo(() => getLoadingPlaceholders(10), [])\n\n const lastVersionReview = useLastVersionReview({\n projectName,\n enabled: versionReview,\n entityIds: entities.map((e) => e.id),\n activities: transformedActivitiesData,\n loadingActivities: isLoadingNew,\n userName,\n })\n\n let warningMessage\n\n return (\n <>\n <Styled.FeedContainer className=\"feed\">\n {warningMessage && (\n <Styled.Warning>\n <Icon icon=\"info\" />\n {warningMessage}\n </Styled.Warning>\n )}\n <TabHeaderAndFilters\n label=\"Activity Feed\"\n filters={feedFilters}\n currentFilter={feedFilter}\n onFilterChange={setFeedFilter}\n isLoading={isLoadingNew}\n />\n <Styled.FeedContent ref={feedRef} className={clsx({ loading: isLoadingNew }, 'no-shimmer')}>\n {isLoadingNew\n ? loadingPlaceholders\n : transformedActivitiesData.map((activity) => (\n <ActivityItem\n key={activity.activityId}\n activity={activity}\n onCheckChange={handleCommentChecked}\n onDelete={deleteComment}\n onUpdate={async (value, files, _refs, data) =>\n await updateComment(activity, value, files, data)\n }\n projectInfo={projectInfo}\n projectName={projectName}\n entityType={entityType}\n onReferenceClick={handleRefClick}\n createdAts={entities.map((e) => e.createdAt)}\n onFileExpand={handleFileExpand}\n showOrigin={entities.length > 1}\n filter={feedFilter}\n editProps={{\n projectName,\n entities: entities,\n entityType,\n }}\n isHighlighted={highlightedActivities.includes(activity.activityId)}\n readOnly={readOnly}\n statuses={statuses}\n isSlideOut={isSlideOut}\n isGuest={isGuest}\n />\n ))}\n {/* message when no versions published */}\n {transformedActivitiesData.length === 0 &&\n isVersionsFilter &&\n !hasCommentLikeFilter &&\n !isLoadingNew && <EmptyPlaceholder message=\"No versions published yet\" icon=\"layers\" />}\n {hasNextPage && loadNextPage && (\n <InView\n root={feedRef.current}\n onChange={(inView) => inView && loadNextPage()}\n rootMargin={'400px 0px 0px 0px'}\n >\n <Styled.LoadMore style={{ height: 0 }} onClick={() => loadNextPage()}>\n {isLoadingNextPage ? 'Loading more...' : 'Click to load more'}\n </Styled.LoadMore>\n </InView>\n )}\n </Styled.FeedContent>\n {!hideCommentInput && (\n <CommentInput\n initValue={null}\n onSubmit={submitComment}\n isOpen={editingId === FEED_NEW_COMMENT}\n onClose={() => setEditingId(null)}\n onOpen={() => setEditingId(FEED_NEW_COMMENT)}\n disabled={disabled}\n isLoading={isLoadingNew || !entities.length || isSaving}\n versionReview={versionReview}\n lastOwnVersionReview={lastVersionReview}\n onReview={submitReview}\n />\n )}\n </Styled.FeedContainer>\n </>\n )\n}\n"],"names":["activitiesLast","feedFilters","Feed","disabled","readOnly","statuses","entityListId","isSlideOut","versionReview","projectName","entities","entityType","editingId","projectInfo","setEditingId","userName","activitiesData","isLoadingNew","isLoadingNextPage","loadNextPage","hasNextPage","users","feedFilter","setFeedFilter","isGuest","useFeedContext","openSlideOut","highlightedActivities","setHighlightedActivities","onOpenImage","setFeedAnnotations","user","useDetailsPanelContext","isVersionsFilter","c","hasActiveFilters","hasCommentLikeFilter","projectPermissions","isLoadingPermissions","useGetMyProjectPermissionsQuery","hideCommentInput","activitiesWithMergedAnnotations","useMemo","mergeAnnotationAttachments","useEffect","annotations","activity","a","transformedActivitiesData","useTransformActivities","feedRef","useRef","useScrollOnInputOpen","FEED_NEW_COMMENT","useSaveScrollPos","useScrollToHighlighted","submitCommentMutation","updateComment","deleteComment","submitReviewMutation","isSaving","useCommentMutations","submitComment","useCallback","value","files","data","submitReview","feedback","handleCommentChecked","e","target","checked","currentMarkdown","newMarkdown","body","taskIndex","li","replaceIndex","markdown","index","indexesOfCurrentMarkdownInBody","indexToReplaceInBody","endReplaceIndex","newBody","handleRefClick","ref","entityId","activityId","handleFileExpand","previewableFiles","file","isFilePreviewable","loadingPlaceholders","getLoadingPlaceholders","lastVersionReview","useLastVersionReview","jsxs","Styled.FeedContainer","jsx","TabHeaderAndFilters","Styled.FeedContent","clsx","ActivityItem","_refs","EmptyPlaceholder","InView","inView","Styled.LoadMore","CommentInput"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAMA,KAAiB,IAExBC,KAAoC;AAAA,EACxC;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAAA,EAER;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAAA,EAER;AAAA,IACE,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAAA,EAER;AAAA,IACE,IAAI;AAAA,IACJ,SAA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