{"action":"created","comment":{"url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/pulls/comments/33605732","id":33605732,"diff_hunk":"@@ -0,0 +1,94 @@\n+/*eslint-disable react/prop-types */\n+'use strict';\n+import React from 'react';\n+import Transition from './Transition';\n+import domUtils from '../utils/domUtils';\n+import createChainedFunction from '../utils/createChainedFunction';\n+\n+let capitalize = str => str[0].toUpperCase() + str.substr(1);\n+\n+// reading a dimension prop will cause the browser to recalculate,\n+// which will let our animations work\n+let triggerBrowserReflow = node => node.offsetHeight; //eslint-disable-line no-unused-expressions\n+\n+const MARGINS = {\n+  height: ['marginTop', 'marginBottom'],\n+  width:  ['marginLeft', 'marginRight']\n+};\n+\n+function getDimensionValue(dimension, elem){\n+  let value = elem[`offset${capitalize(dimension)}`];\n+  let computedStyles = domUtils.getComputedStyles(elem);\n+  let margins = MARGINS[dimension];\n+\n+  return (value +\n+    parseInt(computedStyles[margins[0]], 10) +\n+    parseInt(computedStyles[margins[1]], 10)\n+  );\n+}\n+\n+class Collapse extends React.Component {\n+\n+  constructor(props, context){\n+    super(props, context);\n+  }\n+\n+  render() {\n+    let entering = createChainedFunction(this.handleEntering.bind(this), this.props.onEntering);\n+    let entered = createChainedFunction(this.handleEntered.bind(this), this.props.onEntered);\n+    let exit = createChainedFunction(this.handleExit.bind(this), this.props.onExit);\n+\n+    return (\n+      <Transition\n+        {...this.props}\n+        in={this.props.in}\n+        aria-expanded={this.props.in}\n+        className={this.props.dimension === 'width' ? 'width' : ''}\n+        exitClassName='collapse'\n+        exitingClassName='collapsing'\n+        enterClassName='collapse in'\n+        enteringClassName='collapsing'\n+        onEntering={entering}\n+        onEntered={entered}\n+        onExit={exit}\n+      >\n+        { this.props.children }\n+      </Transition>\n+    );\n+  }\n+\n+  handleEntering(elem){\n+    let dimension = this.props.dimension;\n+    elem.style[dimension] = elem[`scroll${capitalize(dimension)}`] + 'px';\n+  }\n+\n+  handleEntered(elem){\n+    let dimension = this.props.dimension;\n+    elem.style[dimension] = null;\n+  }\n+\n+  handleExit(elem){\n+    let dimension = this.props.dimension;\n+\n+    elem.style[dimension] = this.props.getDimensionValue(dimension, elem) + 'px';\n+\n+    triggerBrowserReflow(elem);\n+\n+    elem.style[dimension] = '0';\n+  }\n+}\n+\n+Collapse.propTypes = {\n+  ...Transition.propTypes,\n+  dimension: React.PropTypes.oneOf(['height', 'width']), //not entirely supported by tbs\n+  getDimensionValue: React.PropTypes.funcs\n+};\n+\n+Collapse.defaultProps = {\n+  in:       false,\n+  dimension: 'height',\n+  getDimensionValue","path":"src/Transitions/Collapse.js","position":90,"original_position":90,"commit_id":"c3b5d24d83cad4857c606720d08ebb0502bddc9e","original_commit_id":"c3b5d24d83cad4857c606720d08ebb0502bddc9e","user":{"login":"AlexKVal","id":847572,"avatar_url":"https://avatars.githubusercontent.com/u/847572?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexKVal","html_url":"https://github.com/AlexKVal","followers_url":"https://api.github.com/users/AlexKVal/followers","following_url":"https://api.github.com/users/AlexKVal/following{/other_user}","gists_url":"https://api.github.com/users/AlexKVal/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexKVal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexKVal/subscriptions","organizations_url":"https://api.github.com/users/AlexKVal/orgs","repos_url":"https://api.github.com/users/AlexKVal/repos","events_url":"https://api.github.com/users/AlexKVal/events{/privacy}","received_events_url":"https://api.github.com/users/AlexKVal/received_events","type":"User","site_admin":false},"body":"I was wrong about the 'private API' term. Sorry.\r\nAs you said: it was required for the `collapsibleMixin`, hence if this patch will deprecate `collapsibleMixin`, do we still need it as a part of API with `Collapse` ?\r\n","created_at":"2015-06-30T18:20:48Z","updated_at":"2015-06-30T18:20:48Z","html_url":"https://github.com/react-bootstrap/react-bootstrap/pull/848#discussion_r33605732","pull_request_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/pulls/848","_links":{"self":{"href":"https://api.github.com/repos/react-bootstrap/react-bootstrap/pulls/comments/33605732"},"html":{"href":"https://github.com/react-bootstrap/react-bootstrap/pull/848#discussion_r33605732"},"pull_request":{"href":"https://api.github.com/repos/react-bootstrap/react-bootstrap/pulls/848"}}},"pull_request":{"url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/pulls/848","id":37822582,"html_url":"https://github.com/react-bootstrap/react-bootstrap/pull/848","diff_url":"https://github.com/react-bootstrap/react-bootstrap/pull/848.diff","patch_url":"https://github.com/react-bootstrap/react-bootstrap/pull/848.patch","issue_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/848","number":848,"state":"open","locked":false,"title":"Transitions Components","user":{"login":"jquense","id":339286,"avatar_url":"https://avatars.githubusercontent.com/u/339286?v=3","gravatar_id":"","url":"https://api.github.com/users/jquense","html_url":"https://github.com/jquense","followers_url":"https://api.github.com/users/jquense/followers","following_url":"https://api.github.com/users/jquense/following{/other_user}","gists_url":"https://api.github.com/users/jquense/gists{/gist_id}","starred_url":"https://api.github.com/users/jquense/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jquense/subscriptions","organizations_url":"https://api.github.com/users/jquense/orgs","repos_url":"https://api.github.com/users/jquense/repos","events_url":"https://api.github.com/users/jquense/events{/privacy}","received_events_url":"https://api.github.com/users/jquense/received_events","type":"User","site_admin":false},"body":"DO NOT MERGE.\r\n\r\nAn experiment in mixin alternatives for transitions. I was already working on a generic version for a project at work and thought it might be valuable upstream here.\r\n\r\n`Transition` component is sort of like a streamlined CSSTransitionGroup from react.addons, but expects a single child and doesn't depend on components mounting/unmounting.\r\n\r\nIf it looks like the sort of thing we might like in core here I'll clean it up and add tests. Feedback appreciated, I added examples to the Component page for easy viewing :P.\r\n\r\nBenefits in my eyes:\r\n- Fade doesn't need to clone its element anymore, and we have proper callbacks\r\n- Collapse feels a bit more manageable in component form, rather than having to mixin the behavior\r\n- Transition is nice and extensible for its specific purpose.\r\n- no mixins means non createClass consumers can use em\r\n- looks like there is no need for breaking changes for components that use the new components, and mixins could be depreciated reasonably","created_at":"2015-06-16T17:54:20Z","updated_at":"2015-06-30T18:20:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9589ec3d1dfca856caa78bd9af180fe148811368","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/pulls/848/commits","review_comments_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/pulls/848/comments","review_comment_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/848/comments","statuses_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/statuses/c3b5d24d83cad4857c606720d08ebb0502bddc9e","head":{"label":"react-bootstrap:transitions","ref":"transitions","sha":"c3b5d24d83cad4857c606720d08ebb0502bddc9e","user":{"login":"react-bootstrap","id":6853419,"avatar_url":"https://avatars.githubusercontent.com/u/6853419?v=3","gravatar_id":"","url":"https://api.github.com/users/react-bootstrap","html_url":"https://github.com/react-bootstrap","followers_url":"https://api.github.com/users/react-bootstrap/followers","following_url":"https://api.github.com/users/react-bootstrap/following{/other_user}","gists_url":"https://api.github.com/users/react-bootstrap/gists{/gist_id}","starred_url":"https://api.github.com/users/react-bootstrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/react-bootstrap/subscriptions","organizations_url":"https://api.github.com/users/react-bootstrap/orgs","repos_url":"https://api.github.com/users/react-bootstrap/repos","events_url":"https://api.github.com/users/react-bootstrap/events{/privacy}","received_events_url":"https://api.github.com/users/react-bootstrap/received_events","type":"Organization","site_admin":false},"repo":{"id":15480067,"name":"react-bootstrap","full_name":"react-bootstrap/react-bootstrap","owner":{"login":"react-bootstrap","id":6853419,"avatar_url":"https://avatars.githubusercontent.com/u/6853419?v=3","gravatar_id":"","url":"https://api.github.com/users/react-bootstrap","html_url":"https://github.com/react-bootstrap","followers_url":"https://api.github.com/users/react-bootstrap/followers","following_url":"https://api.github.com/users/react-bootstrap/following{/other_user}","gists_url":"https://api.github.com/users/react-bootstrap/gists{/gist_id}","starred_url":"https://api.github.com/users/react-bootstrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/react-bootstrap/subscriptions","organizations_url":"https://api.github.com/users/react-bootstrap/orgs","repos_url":"https://api.github.com/users/react-bootstrap/repos","events_url":"https://api.github.com/users/react-bootstrap/events{/privacy}","received_events_url":"https://api.github.com/users/react-bootstrap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/react-bootstrap/react-bootstrap","description":"Bootstrap 3 components built with React","fork":false,"url":"https://api.github.com/repos/react-bootstrap/react-bootstrap","forks_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/forks","keys_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/teams","hooks_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/hooks","issue_events_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/events{/number}","events_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/events","assignees_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/assignees{/user}","branches_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/branches{/branch}","tags_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/tags","blobs_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/git/refs{/sha}","trees_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/statuses/{sha}","languages_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/languages","stargazers_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/stargazers","contributors_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/contributors","subscribers_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/subscribers","subscription_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/subscription","commits_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/commits{/sha}","git_commits_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/git/commits{/sha}","comments_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/comments{/number}","issue_comment_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/comments{/number}","contents_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/contents/{+path}","compare_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/merges","archive_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/downloads","issues_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues{/number}","pulls_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/pulls{/number}","milestones_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/milestones{/number}","notifications_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/labels{/name}","releases_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/releases{/id}","created_at":"2013-12-27T19:06:07Z","updated_at":"2015-06-30T16:07:48Z","pushed_at":"2015-06-30T17:57:40Z","git_url":"git://github.com/react-bootstrap/react-bootstrap.git","ssh_url":"git@github.com:react-bootstrap/react-bootstrap.git","clone_url":"https://github.com/react-bootstrap/react-bootstrap.git","svn_url":"https://github.com/react-bootstrap/react-bootstrap","homepage":"http://react-bootstrap.github.io/","size":9169,"stargazers_count":2664,"watchers_count":2664,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":414,"mirror_url":null,"open_issues_count":79,"forks":414,"open_issues":79,"watchers":2664,"default_branch":"master"}},"base":{"label":"react-bootstrap:v0.24-rc","ref":"v0.24-rc","sha":"b798b7f708ebd21b039d85930923677e88a0386a","user":{"login":"react-bootstrap","id":6853419,"avatar_url":"https://avatars.githubusercontent.com/u/6853419?v=3","gravatar_id":"","url":"https://api.github.com/users/react-bootstrap","html_url":"https://github.com/react-bootstrap","followers_url":"https://api.github.com/users/react-bootstrap/followers","following_url":"https://api.github.com/users/react-bootstrap/following{/other_user}","gists_url":"https://api.github.com/users/react-bootstrap/gists{/gist_id}","starred_url":"https://api.github.com/users/react-bootstrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/react-bootstrap/subscriptions","organizations_url":"https://api.github.com/users/react-bootstrap/orgs","repos_url":"https://api.github.com/users/react-bootstrap/repos","events_url":"https://api.github.com/users/react-bootstrap/events{/privacy}","received_events_url":"https://api.github.com/users/react-bootstrap/received_events","type":"Organization","site_admin":false},"repo":{"id":15480067,"name":"react-bootstrap","full_name":"react-bootstrap/react-bootstrap","owner":{"login":"react-bootstrap","id":6853419,"avatar_url":"https://avatars.githubusercontent.com/u/6853419?v=3","gravatar_id":"","url":"https://api.github.com/users/react-bootstrap","html_url":"https://github.com/react-bootstrap","followers_url":"https://api.github.com/users/react-bootstrap/followers","following_url":"https://api.github.com/users/react-bootstrap/following{/other_user}","gists_url":"https://api.github.com/users/react-bootstrap/gists{/gist_id}","starred_url":"https://api.github.com/users/react-bootstrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/react-bootstrap/subscriptions","organizations_url":"https://api.github.com/users/react-bootstrap/orgs","repos_url":"https://api.github.com/users/react-bootstrap/repos","events_url":"https://api.github.com/users/react-bootstrap/events{/privacy}","received_events_url":"https://api.github.com/users/react-bootstrap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/react-bootstrap/react-bootstrap","description":"Bootstrap 3 components built with React","fork":false,"url":"https://api.github.com/repos/react-bootstrap/react-bootstrap","forks_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/forks","keys_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/teams","hooks_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/hooks","issue_events_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/events{/number}","events_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/events","assignees_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/assignees{/user}","branches_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/branches{/branch}","tags_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/tags","blobs_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/git/refs{/sha}","trees_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/statuses/{sha}","languages_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/languages","stargazers_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/stargazers","contributors_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/contributors","subscribers_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/subscribers","subscription_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/subscription","commits_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/commits{/sha}","git_commits_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/git/commits{/sha}","comments_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/comments{/number}","issue_comment_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/comments{/number}","contents_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/contents/{+path}","compare_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/merges","archive_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/downloads","issues_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues{/number}","pulls_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/pulls{/number}","milestones_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/milestones{/number}","notifications_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/labels{/name}","releases_url":"https://api.github.com/repos/react-bootstrap/react-bootstrap/releases{/id}","created_at":"2013-12-27T19:06:07Z","updated_at":"2015-06-30T16:07:48Z","pushed_at":"2015-06-30T17:57:40Z","git_url":"git://github.com/react-bootstrap/react-bootstrap.git","ssh_url":"git@github.com:react-bootstrap/react-bootstrap.git","clone_url":"https://github.com/react-bootstrap/react-bootstrap.git","svn_url":"https://github.com/react-bootstrap/react-bootstrap","homepage":"http://react-bootstrap.github.io/","size":9169,"stargazers_count":2664,"watchers_count":2664,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":414,"mirror_url":null,"open_issues_count":79,"forks":414,"open_issues":79,"watchers":2664,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/react-bootstrap/react-bootstrap/pulls/848"},"html":{"href":"https://github.com/react-bootstrap/react-bootstrap/pull/848"},"issue":{"href":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/848"},"comments":{"href":"https://api.github.com/repos/react-bootstrap/react-bootstrap/issues/848/comments"},"review_comments":{"href":"https://api.github.com/repos/react-bootstrap/react-bootstrap/pulls/848/comments"},"review_comment":{"href":"https://api.github.com/repos/react-bootstrap/react-bootstrap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/react-bootstrap/react-bootstrap/pulls/848/commits"},"statuses":{"href":"https://api.github.com/repos/react-bootstrap/react-bootstrap/statuses/c3b5d24d83cad4857c606720d08ebb0502bddc9e"}}}}