{"action":"created","comment":{"url":"https://api.github.com/repos/rei-ui/rei/pulls/comments/207724029","pull_request_review_id":143398696,"id":207724029,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNzcyNDAyOQ==","diff_hunk":"@@ -0,0 +1,163 @@\n+/**\n+ * @license\n+ * Copyright (c) 2018 The Rei Project Authors. All rights reserved.\n+ * Please see the AUTHORS file for details. All rights reserved.\n+ * Use of this source code is governed by a BSD-style license that can be found in\n+ * the LICENSE file.\n+ */\n+\n+import { dedupingMixin } from '@polymer/polymer/lib/utils/mixin';\n+\n+import { Selectable, isSelectable } from './selectable';\n+import { fireSelectionEvent } from './events';\n+\n+export function canSelectElement(element: Element) {\n+  return element !== null;\n+}\n+\n+export enum Direction {\n+  /** Moves horizontally either left or right. */\n+  Horizontal = 'horizontal',\n+  /** Moves vertically either up or down. */\n+  Vertical = 'vertical'\n+}\n+\n+/**\n+ * A selectable area that moves in a single direction.\n+ */\n+export interface LinearSelectable {\n+  /** The direction that the selection moves in. */\n+  readonly direction: Direction;\n+}\n+\n+export interface HTMLElementConstructor {\n+  new(): HTMLElement;\n+}\n+\n+const linearSelectable = (base: HTMLElementConstructor) => {\n+  return class extends base implements HTMLElement, Selectable, LinearSelectable {\n+    selectedElement?: Element;\n+    wrapStart: boolean;\n+    wrapEnd: boolean;\n+    canMoveBack: boolean;\n+\n+    direction: Direction;\n+\n+    __selectedElement?: Element;\n+\n+    constructor() {\n+      super();\n+\n+      this.wrapStart = false;\n+      this.wrapEnd = false;\n+      this.canMoveBack = false;\n+      \n+      this.direction = Direction.Horizontal;\n+    }\n+\n+    // Selectable methods\n+\n+    select(element?: Element): void {\n+      var selected = this._selectInternal(element);\n+\n+      // If there was no preference from onSelect then just get the first\n+      // selectable element from the container\n+      if (!selected) {\n+        selected = this.__getSelectedElement();\n+      }\n+\n+      this.__selectElement(selected);\n+    }\n+\n+    left(): void {\n+      var selected = (this.direction == Direction.Horizontal) ? this.__previous() : false;\n+    \n+      if ((!selected) && (isSelectable(this.parentElement))) {\n+        this.parentElement.left();\n+      }\n+    }\n+    \n+    right(): void {\n+      let selected = (this.direction == Direction.Horizontal) ? this.__next() : false;\n+    \n+      if ((!selected) && (isSelectable(this.parentElement))) {\n+        this.parentElement.right();\n+      }\n+    }\n+    \n+    up(): void {\n+      let selected = (this.direction == Direction.Vertical) ? this.__previous() : false;\n+    \n+      if ((!selected) && (isSelectable(this.parentElement))) {\n+        this.parentElement.up();\n+      }\n+    }\n+    \n+    down(): void {\n+      let selected = (this.direction == Direction.Vertical) ? this.__next() : false;","path":"lib/selectable/linear-selectable.ts","position":97,"original_position":97,"commit_id":"c099f5099234bd9eeaa5d25f2dc52acb58d53e81","original_commit_id":"c099f5099234bd9eeaa5d25f2dc52acb58d53e81","user":{"login":"landongn","id":578681,"node_id":"MDQ6VXNlcjU3ODY4MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/578681?v=4","gravatar_id":"","url":"https://api.github.com/users/landongn","html_url":"https://github.com/landongn","followers_url":"https://api.github.com/users/landongn/followers","following_url":"https://api.github.com/users/landongn/following{/other_user}","gists_url":"https://api.github.com/users/landongn/gists{/gist_id}","starred_url":"https://api.github.com/users/landongn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/landongn/subscriptions","organizations_url":"https://api.github.com/users/landongn/orgs","repos_url":"https://api.github.com/users/landongn/repos","events_url":"https://api.github.com/users/landongn/events{/privacy}","received_events_url":"https://api.github.com/users/landongn/received_events","type":"User","site_admin":false},"body":"that double underscore is \r\n![image](https://user-images.githubusercontent.com/578681/43682198-b6c1104c-9821-11e8-9b2d-6ac69243a063.png)\r\n","created_at":"2018-08-05T03:05:23Z","updated_at":"2018-08-05T03:05:23Z","html_url":"https://github.com/rei-ui/rei/pull/1#discussion_r207724029","pull_request_url":"https://api.github.com/repos/rei-ui/rei/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/rei-ui/rei/pulls/comments/207724029"},"html":{"href":"https://github.com/rei-ui/rei/pull/1#discussion_r207724029"},"pull_request":{"href":"https://api.github.com/repos/rei-ui/rei/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/rei-ui/rei/pulls/1","id":206217811,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2MjE3ODEx","html_url":"https://github.com/rei-ui/rei/pull/1","diff_url":"https://github.com/rei-ui/rei/pull/1.diff","patch_url":"https://github.com/rei-ui/rei/pull/1.patch","issue_url":"https://api.github.com/repos/rei-ui/rei/issues/1","number":1,"state":"open","locked":false,"title":"Add initial Selectable library","user":{"login":"donny-dont","id":666297,"node_id":"MDQ6VXNlcjY2NjI5Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/666297?v=4","gravatar_id":"","url":"https://api.github.com/users/donny-dont","html_url":"https://github.com/donny-dont","followers_url":"https://api.github.com/users/donny-dont/followers","following_url":"https://api.github.com/users/donny-dont/following{/other_user}","gists_url":"https://api.github.com/users/donny-dont/gists{/gist_id}","starred_url":"https://api.github.com/users/donny-dont/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donny-dont/subscriptions","organizations_url":"https://api.github.com/users/donny-dont/orgs","repos_url":"https://api.github.com/users/donny-dont/repos","events_url":"https://api.github.com/users/donny-dont/events{/privacy}","received_events_url":"https://api.github.com/users/donny-dont/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-05T01:53:06Z","updated_at":"2018-08-05T03:05:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e1c548c863d28a1e485c5108d64ce63ec8a889a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rei-ui/rei/pulls/1/commits","review_comments_url":"https://api.github.com/repos/rei-ui/rei/pulls/1/comments","review_comment_url":"https://api.github.com/repos/rei-ui/rei/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rei-ui/rei/issues/1/comments","statuses_url":"https://api.github.com/repos/rei-ui/rei/statuses/c099f5099234bd9eeaa5d25f2dc52acb58d53e81","head":{"label":"rei-ui:feat/selectable","ref":"feat/selectable","sha":"c099f5099234bd9eeaa5d25f2dc52acb58d53e81","user":{"login":"rei-ui","id":15914828,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1OTE0ODI4","avatar_url":"https://avatars3.githubusercontent.com/u/15914828?v=4","gravatar_id":"","url":"https://api.github.com/users/rei-ui","html_url":"https://github.com/rei-ui","followers_url":"https://api.github.com/users/rei-ui/followers","following_url":"https://api.github.com/users/rei-ui/following{/other_user}","gists_url":"https://api.github.com/users/rei-ui/gists{/gist_id}","starred_url":"https://api.github.com/users/rei-ui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rei-ui/subscriptions","organizations_url":"https://api.github.com/users/rei-ui/orgs","repos_url":"https://api.github.com/users/rei-ui/repos","events_url":"https://api.github.com/users/rei-ui/events{/privacy}","received_events_url":"https://api.github.com/users/rei-ui/received_events","type":"Organization","site_admin":false},"repo":{"id":46447634,"node_id":"MDEwOlJlcG9zaXRvcnk0NjQ0NzYzNA==","name":"rei","full_name":"rei-ui/rei","owner":{"login":"rei-ui","id":15914828,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1OTE0ODI4","avatar_url":"https://avatars3.githubusercontent.com/u/15914828?v=4","gravatar_id":"","url":"https://api.github.com/users/rei-ui","html_url":"https://github.com/rei-ui","followers_url":"https://api.github.com/users/rei-ui/followers","following_url":"https://api.github.com/users/rei-ui/following{/other_user}","gists_url":"https://api.github.com/users/rei-ui/gists{/gist_id}","starred_url":"https://api.github.com/users/rei-ui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rei-ui/subscriptions","organizations_url":"https://api.github.com/users/rei-ui/orgs","repos_url":"https://api.github.com/users/rei-ui/repos","events_url":"https://api.github.com/users/rei-ui/events{/privacy}","received_events_url":"https://api.github.com/users/rei-ui/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rei-ui/rei","description":"Rei (Really elegant interface)","fork":false,"url":"https://api.github.com/repos/rei-ui/rei","forks_url":"https://api.github.com/repos/rei-ui/rei/forks","keys_url":"https://api.github.com/repos/rei-ui/rei/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rei-ui/rei/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rei-ui/rei/teams","hooks_url":"https://api.github.com/repos/rei-ui/rei/hooks","issue_events_url":"https://api.github.com/repos/rei-ui/rei/issues/events{/number}","events_url":"https://api.github.com/repos/rei-ui/rei/events","assignees_url":"https://api.github.com/repos/rei-ui/rei/assignees{/user}","branches_url":"https://api.github.com/repos/rei-ui/rei/branches{/branch}","tags_url":"https://api.github.com/repos/rei-ui/rei/tags","blobs_url":"https://api.github.com/repos/rei-ui/rei/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rei-ui/rei/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rei-ui/rei/git/refs{/sha}","trees_url":"https://api.github.com/repos/rei-ui/rei/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rei-ui/rei/statuses/{sha}","languages_url":"https://api.github.com/repos/rei-ui/rei/languages","stargazers_url":"https://api.github.com/repos/rei-ui/rei/stargazers","contributors_url":"https://api.github.com/repos/rei-ui/rei/contributors","subscribers_url":"https://api.github.com/repos/rei-ui/rei/subscribers","subscription_url":"https://api.github.com/repos/rei-ui/rei/subscription","commits_url":"https://api.github.com/repos/rei-ui/rei/commits{/sha}","git_commits_url":"https://api.github.com/repos/rei-ui/rei/git/commits{/sha}","comments_url":"https://api.github.com/repos/rei-ui/rei/comments{/number}","issue_comment_url":"https://api.github.com/repos/rei-ui/rei/issues/comments{/number}","contents_url":"https://api.github.com/repos/rei-ui/rei/contents/{+path}","compare_url":"https://api.github.com/repos/rei-ui/rei/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rei-ui/rei/merges","archive_url":"https://api.github.com/repos/rei-ui/rei/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rei-ui/rei/downloads","issues_url":"https://api.github.com/repos/rei-ui/rei/issues{/number}","pulls_url":"https://api.github.com/repos/rei-ui/rei/pulls{/number}","milestones_url":"https://api.github.com/repos/rei-ui/rei/milestones{/number}","notifications_url":"https://api.github.com/repos/rei-ui/rei/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rei-ui/rei/labels{/name}","releases_url":"https://api.github.com/repos/rei-ui/rei/releases{/id}","deployments_url":"https://api.github.com/repos/rei-ui/rei/deployments","created_at":"2015-11-18T21:10:32Z","updated_at":"2018-08-05T01:52:18Z","pushed_at":"2018-08-05T01:53:06Z","git_url":"git://github.com/rei-ui/rei.git","ssh_url":"git@github.com:rei-ui/rei.git","clone_url":"https://github.com/rei-ui/rei.git","svn_url":"https://github.com/rei-ui/rei","homepage":null,"size":6,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"rei-ui:master","ref":"master","sha":"8b6233e5f6bfffdc000d1461d5cda11c50548196","user":{"login":"rei-ui","id":15914828,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1OTE0ODI4","avatar_url":"https://avatars3.githubusercontent.com/u/15914828?v=4","gravatar_id":"","url":"https://api.github.com/users/rei-ui","html_url":"https://github.com/rei-ui","followers_url":"https://api.github.com/users/rei-ui/followers","following_url":"https://api.github.com/users/rei-ui/following{/other_user}","gists_url":"https://api.github.com/users/rei-ui/gists{/gist_id}","starred_url":"https://api.github.com/users/rei-ui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rei-ui/subscriptions","organizations_url":"https://api.github.com/users/rei-ui/orgs","repos_url":"https://api.github.com/users/rei-ui/repos","events_url":"https://api.github.com/users/rei-ui/events{/privacy}","received_events_url":"https://api.github.com/users/rei-ui/received_events","type":"Organization","site_admin":false},"repo":{"id":46447634,"node_id":"MDEwOlJlcG9zaXRvcnk0NjQ0NzYzNA==","name":"rei","full_name":"rei-ui/rei","owner":{"login":"rei-ui","id":15914828,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1OTE0ODI4","avatar_url":"https://avatars3.githubusercontent.com/u/15914828?v=4","gravatar_id":"","url":"https://api.github.com/users/rei-ui","html_url":"https://github.com/rei-ui","followers_url":"https://api.github.com/users/rei-ui/followers","following_url":"https://api.github.com/users/rei-ui/following{/other_user}","gists_url":"https://api.github.com/users/rei-ui/gists{/gist_id}","starred_url":"https://api.github.com/users/rei-ui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rei-ui/subscriptions","organizations_url":"https://api.github.com/users/rei-ui/orgs","repos_url":"https://api.github.com/users/rei-ui/repos","events_url":"https://api.github.com/users/rei-ui/events{/privacy}","received_events_url":"https://api.github.com/users/rei-ui/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rei-ui/rei","description":"Rei (Really elegant interface)","fork":false,"url":"https://api.github.com/repos/rei-ui/rei","forks_url":"https://api.github.com/repos/rei-ui/rei/forks","keys_url":"https://api.github.com/repos/rei-ui/rei/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rei-ui/rei/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rei-ui/rei/teams","hooks_url":"https://api.github.com/repos/rei-ui/rei/hooks","issue_events_url":"https://api.github.com/repos/rei-ui/rei/issues/events{/number}","events_url":"https://api.github.com/repos/rei-ui/rei/events","assignees_url":"https://api.github.com/repos/rei-ui/rei/assignees{/user}","branches_url":"https://api.github.com/repos/rei-ui/rei/branches{/branch}","tags_url":"https://api.github.com/repos/rei-ui/rei/tags","blobs_url":"https://api.github.com/repos/rei-ui/rei/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rei-ui/rei/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rei-ui/rei/git/refs{/sha}","trees_url":"https://api.github.com/repos/rei-ui/rei/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rei-ui/rei/statuses/{sha}","languages_url":"https://api.github.com/repos/rei-ui/rei/languages","stargazers_url":"https://api.github.com/repos/rei-ui/rei/stargazers","contributors_url":"https://api.github.com/repos/rei-ui/rei/contributors","subscribers_url":"https://api.github.com/repos/rei-ui/rei/subscribers","subscription_url":"https://api.github.com/repos/rei-ui/rei/subscription","commits_url":"https://api.github.com/repos/rei-ui/rei/commits{/sha}","git_commits_url":"https://api.github.com/repos/rei-ui/rei/git/commits{/sha}","comments_url":"https://api.github.com/repos/rei-ui/rei/comments{/number}","issue_comment_url":"https://api.github.com/repos/rei-ui/rei/issues/comments{/number}","contents_url":"https://api.github.com/repos/rei-ui/rei/contents/{+path}","compare_url":"https://api.github.com/repos/rei-ui/rei/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rei-ui/rei/merges","archive_url":"https://api.github.com/repos/rei-ui/rei/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rei-ui/rei/downloads","issues_url":"https://api.github.com/repos/rei-ui/rei/issues{/number}","pulls_url":"https://api.github.com/repos/rei-ui/rei/pulls{/number}","milestones_url":"https://api.github.com/repos/rei-ui/rei/milestones{/number}","notifications_url":"https://api.github.com/repos/rei-ui/rei/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rei-ui/rei/labels{/name}","releases_url":"https://api.github.com/repos/rei-ui/rei/releases{/id}","deployments_url":"https://api.github.com/repos/rei-ui/rei/deployments","created_at":"2015-11-18T21:10:32Z","updated_at":"2018-08-05T01:52:18Z","pushed_at":"2018-08-05T01:53:06Z","git_url":"git://github.com/rei-ui/rei.git","ssh_url":"git@github.com:rei-ui/rei.git","clone_url":"https://github.com/rei-ui/rei.git","svn_url":"https://github.com/rei-ui/rei","homepage":null,"size":6,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rei-ui/rei/pulls/1"},"html":{"href":"https://github.com/rei-ui/rei/pull/1"},"issue":{"href":"https://api.github.com/repos/rei-ui/rei/issues/1"},"comments":{"href":"https://api.github.com/repos/rei-ui/rei/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/rei-ui/rei/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/rei-ui/rei/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rei-ui/rei/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/rei-ui/rei/statuses/c099f5099234bd9eeaa5d25f2dc52acb58d53e81"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"landongn"}}