{"action":"created","comment":{"url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/comments/243641754","pull_request_review_id":187474073,"id":243641754,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MzY0MTc1NA==","diff_hunk":"@@ -0,0 +1,186 @@\n+import { action } from '@storybook/addon-actions';\n+import algoliasearch from 'algoliasearch/lite';\n+import instantsearch from '../src/index';\n+\n+export const withHits = (storyFn, searchOptions = {}) => () => {\n+  const {\n+    appId = 'latency',\n+    apiKey = '6be0576ff61c053d5f9a3225e2a90f76',\n+    indexName = 'instant_search',\n+    searchParameters = {},\n+    ...instantsearchOptions\n+  } = searchOptions;\n+\n+  const urlLogger = action('Routing state');\n+  const search = instantsearch({\n+    indexName,\n+    searchClient: algoliasearch(appId, apiKey),\n+    searchParameters: {\n+      hitsPerPage: 4,\n+      attributesToSnippet: ['description:15'],\n+      snippetEllipsisText: '[…]',\n+      ...searchParameters,\n+    },\n+    routing: {\n+      router: {\n+        write: routeState => {\n+          urlLogger(JSON.stringify(routeState, null, 2));\n+        },\n+        read: () => ({}),\n+        createURL: () => '',\n+        onUpdate: () => {},\n+      },\n+    },\n+    ...instantsearchOptions,\n+  });\n+\n+  const containerElement = document.createElement('div');\n+\n+  // Add the preview container to add the stories in\n+  const previewElement = document.createElement('div');\n+  previewElement.classList.add('container', 'container-preview');\n+  containerElement.appendChild(previewElement);\n+\n+  // Add the playground container to add widgets into\n+  const playgroundElement = document.createElement('div');\n+  playgroundElement.classList.add('container', 'container-playground');\n+  containerElement.appendChild(playgroundElement);\n+\n+  const leftPanelPlaygroundElement = document.createElement('div');\n+  leftPanelPlaygroundElement.classList.add('panel-left');\n+  playgroundElement.appendChild(leftPanelPlaygroundElement);\n+\n+  const rightPanelPlaygroundElement = document.createElement('div');\n+  rightPanelPlaygroundElement.classList.add('panel-right');\n+  playgroundElement.appendChild(rightPanelPlaygroundElement);\n+\n+  // Add widgets to the playground\n+  const refinementList = document.createElement('div');\n+  leftPanelPlaygroundElement.appendChild(refinementList);\n+\n+  const brandList = instantsearch.widgets.panel({\n+    templates: {\n+      header: 'Brands',\n+    },\n+  })(instantsearch.widgets.refinementList);\n+\n+  search.addWidget(\n+    brandList({\n+      container: refinementList,\n+      attribute: 'brand',\n+    })\n+  );\n+\n+  const numericMenu = document.createElement('div');\n+  leftPanelPlaygroundElement.appendChild(numericMenu);\n+\n+  const priceMenu = instantsearch.widgets.panel({\n+    templates: {\n+      header: 'Price',\n+    },\n+  })(instantsearch.widgets.numericMenu);\n+\n+  search.addWidget(\n+    priceMenu({\n+      container: numericMenu,\n+      attribute: 'price',\n+      items: [\n+        { label: 'All' },\n+        { label: '≤ 10$', end: 10 },\n+        { label: '10–100$', start: 10, end: 100 },\n+        { label: '100–500$', start: 100, end: 500 },\n+        { label: '≥ 500$', start: 500 },\n+      ],\n+    })\n+  );\n+\n+  const ratingMenu = document.createElement('div');\n+  leftPanelPlaygroundElement.appendChild(ratingMenu);\n+\n+  const ratingList = instantsearch.widgets.panel({\n+    templates: {\n+      header: 'Rating',\n+    },\n+  })(instantsearch.widgets.ratingMenu);\n+\n+  search.addWidget(\n+    ratingList({\n+      container: ratingMenu,\n+      attribute: 'rating',\n+    })\n+  );\n+\n+  const searchBox = document.createElement('div');\n+  searchBox.classList.add('searchbox');\n+  rightPanelPlaygroundElement.appendChild(searchBox);\n+\n+  search.addWidget(\n+    instantsearch.widgets.searchBox({\n+      container: searchBox,\n+      placeholder: 'Search here…',\n+    })\n+  );\n+\n+  const stats = document.createElement('div');\n+  stats.classList.add('stats');\n+  rightPanelPlaygroundElement.appendChild(stats);\n+\n+  search.addWidget(\n+    instantsearch.widgets.stats({\n+      container: stats,\n+    })\n+  );\n+\n+  const hits = document.createElement('div');\n+  hits.classList.add('hits');\n+  rightPanelPlaygroundElement.appendChild(hits);\n+\n+  search.addWidget(\n+    instantsearch.widgets.hits({\n+      container: hits,\n+      templates: {\n+        item: `\n+<div\n+  class=\"hits-image\"\n+  style=\"background-image: url({{image}})\"","path":".storybook/decorators.js","position":145,"original_position":145,"commit_id":"09815e72f7341b80fcb280e49b4e8ef82ab24129","original_commit_id":"09815e72f7341b80fcb280e49b4e8ef82ab24129","user":{"login":"tkrugg","id":2982512,"node_id":"MDQ6VXNlcjI5ODI1MTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2982512?v=4","gravatar_id":"","url":"https://api.github.com/users/tkrugg","html_url":"https://github.com/tkrugg","followers_url":"https://api.github.com/users/tkrugg/followers","following_url":"https://api.github.com/users/tkrugg/following{/other_user}","gists_url":"https://api.github.com/users/tkrugg/gists{/gist_id}","starred_url":"https://api.github.com/users/tkrugg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkrugg/subscriptions","organizations_url":"https://api.github.com/users/tkrugg/orgs","repos_url":"https://api.github.com/users/tkrugg/repos","events_url":"https://api.github.com/users/tkrugg/events{/privacy}","received_events_url":"https://api.github.com/users/tkrugg/received_events","type":"User","site_admin":false},"body":"I think you need quotes around the image?\r\n`background-image: url(\"{{image}}\")`","created_at":"2018-12-21T17:18:34Z","updated_at":"2018-12-21T17:18:34Z","html_url":"https://github.com/algolia/instantsearch.js/pull/3376#discussion_r243641754","pull_request_url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/3376","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/algolia/instantsearch.js/pulls/comments/243641754"},"html":{"href":"https://github.com/algolia/instantsearch.js/pull/3376#discussion_r243641754"},"pull_request":{"href":"https://api.github.com/repos/algolia/instantsearch.js/pulls/3376"}}},"pull_request":{"url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/3376","id":240449932,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwNDQ5OTMy","html_url":"https://github.com/algolia/instantsearch.js/pull/3376","diff_url":"https://github.com/algolia/instantsearch.js/pull/3376.diff","patch_url":"https://github.com/algolia/instantsearch.js/pull/3376.patch","issue_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/3376","number":3376,"state":"open","locked":false,"title":"chore(storybook): migrate dev-novel to storybook","user":{"login":"francoischalifour","id":6137112,"node_id":"MDQ6VXNlcjYxMzcxMTI=","avatar_url":"https://avatars3.githubusercontent.com/u/6137112?v=4","gravatar_id":"","url":"https://api.github.com/users/francoischalifour","html_url":"https://github.com/francoischalifour","followers_url":"https://api.github.com/users/francoischalifour/followers","following_url":"https://api.github.com/users/francoischalifour/following{/other_user}","gists_url":"https://api.github.com/users/francoischalifour/gists{/gist_id}","starred_url":"https://api.github.com/users/francoischalifour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francoischalifour/subscriptions","organizations_url":"https://api.github.com/users/francoischalifour/orgs","repos_url":"https://api.github.com/users/francoischalifour/repos","events_url":"https://api.github.com/users/francoischalifour/events{/privacy}","received_events_url":"https://api.github.com/users/francoischalifour/received_events","type":"User","site_admin":false},"body":"This migrates our stories from `dev-novel` to `storybook`.\r\n\r\nNew stories: https://deploy-preview-3376--instantsearchjs.netlify.com/stories","created_at":"2018-12-21T11:40:25Z","updated_at":"2018-12-21T17:18:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05afd4ebccd214949cbdb1130c2e61f00ec4772d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/3376/commits","review_comments_url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/3376/comments","review_comment_url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/3376/comments","statuses_url":"https://api.github.com/repos/algolia/instantsearch.js/statuses/09815e72f7341b80fcb280e49b4e8ef82ab24129","head":{"label":"algolia:chore/storybook","ref":"chore/storybook","sha":"09815e72f7341b80fcb280e49b4e8ef82ab24129","user":{"login":"algolia","id":2034458,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMzQ0NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/2034458?v=4","gravatar_id":"","url":"https://api.github.com/users/algolia","html_url":"https://github.com/algolia","followers_url":"https://api.github.com/users/algolia/followers","following_url":"https://api.github.com/users/algolia/following{/other_user}","gists_url":"https://api.github.com/users/algolia/gists{/gist_id}","starred_url":"https://api.github.com/users/algolia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/algolia/subscriptions","organizations_url":"https://api.github.com/users/algolia/orgs","repos_url":"https://api.github.com/users/algolia/repos","events_url":"https://api.github.com/users/algolia/events{/privacy}","received_events_url":"https://api.github.com/users/algolia/received_events","type":"Organization","site_admin":false},"repo":{"id":39443258,"node_id":"MDEwOlJlcG9zaXRvcnkzOTQ0MzI1OA==","name":"instantsearch.js","full_name":"algolia/instantsearch.js","private":false,"owner":{"login":"algolia","id":2034458,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMzQ0NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/2034458?v=4","gravatar_id":"","url":"https://api.github.com/users/algolia","html_url":"https://github.com/algolia","followers_url":"https://api.github.com/users/algolia/followers","following_url":"https://api.github.com/users/algolia/following{/other_user}","gists_url":"https://api.github.com/users/algolia/gists{/gist_id}","starred_url":"https://api.github.com/users/algolia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/algolia/subscriptions","organizations_url":"https://api.github.com/users/algolia/orgs","repos_url":"https://api.github.com/users/algolia/repos","events_url":"https://api.github.com/users/algolia/events{/privacy}","received_events_url":"https://api.github.com/users/algolia/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/algolia/instantsearch.js","description":":zap: A JavaScript library for building performant and instant search experiences with Algolia.","fork":false,"url":"https://api.github.com/repos/algolia/instantsearch.js","forks_url":"https://api.github.com/repos/algolia/instantsearch.js/forks","keys_url":"https://api.github.com/repos/algolia/instantsearch.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/algolia/instantsearch.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/algolia/instantsearch.js/teams","hooks_url":"https://api.github.com/repos/algolia/instantsearch.js/hooks","issue_events_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/events{/number}","events_url":"https://api.github.com/repos/algolia/instantsearch.js/events","assignees_url":"https://api.github.com/repos/algolia/instantsearch.js/assignees{/user}","branches_url":"https://api.github.com/repos/algolia/instantsearch.js/branches{/branch}","tags_url":"https://api.github.com/repos/algolia/instantsearch.js/tags","blobs_url":"https://api.github.com/repos/algolia/instantsearch.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/algolia/instantsearch.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/algolia/instantsearch.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/algolia/instantsearch.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/algolia/instantsearch.js/statuses/{sha}","languages_url":"https://api.github.com/repos/algolia/instantsearch.js/languages","stargazers_url":"https://api.github.com/repos/algolia/instantsearch.js/stargazers","contributors_url":"https://api.github.com/repos/algolia/instantsearch.js/contributors","subscribers_url":"https://api.github.com/repos/algolia/instantsearch.js/subscribers","subscription_url":"https://api.github.com/repos/algolia/instantsearch.js/subscription","commits_url":"https://api.github.com/repos/algolia/instantsearch.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/algolia/instantsearch.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/algolia/instantsearch.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/algolia/instantsearch.js/contents/{+path}","compare_url":"https://api.github.com/repos/algolia/instantsearch.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/algolia/instantsearch.js/merges","archive_url":"https://api.github.com/repos/algolia/instantsearch.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/algolia/instantsearch.js/downloads","issues_url":"https://api.github.com/repos/algolia/instantsearch.js/issues{/number}","pulls_url":"https://api.github.com/repos/algolia/instantsearch.js/pulls{/number}","milestones_url":"https://api.github.com/repos/algolia/instantsearch.js/milestones{/number}","notifications_url":"https://api.github.com/repos/algolia/instantsearch.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/algolia/instantsearch.js/labels{/name}","releases_url":"https://api.github.com/repos/algolia/instantsearch.js/releases{/id}","deployments_url":"https://api.github.com/repos/algolia/instantsearch.js/deployments","created_at":"2015-07-21T12:10:27Z","updated_at":"2018-12-21T15:20:06Z","pushed_at":"2018-12-21T16:17:24Z","git_url":"git://github.com/algolia/instantsearch.js.git","ssh_url":"git@github.com:algolia/instantsearch.js.git","clone_url":"https://github.com/algolia/instantsearch.js.git","svn_url":"https://github.com/algolia/instantsearch.js","homepage":"https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/","size":271537,"stargazers_count":2128,"watchers_count":2128,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":311,"mirror_url":null,"archived":false,"open_issues_count":131,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":311,"open_issues":131,"watchers":2128,"default_branch":"develop"}},"base":{"label":"algolia:develop","ref":"develop","sha":"edba08c3fe059c8139fefb655e3f60ddcc34e8e6","user":{"login":"algolia","id":2034458,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMzQ0NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/2034458?v=4","gravatar_id":"","url":"https://api.github.com/users/algolia","html_url":"https://github.com/algolia","followers_url":"https://api.github.com/users/algolia/followers","following_url":"https://api.github.com/users/algolia/following{/other_user}","gists_url":"https://api.github.com/users/algolia/gists{/gist_id}","starred_url":"https://api.github.com/users/algolia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/algolia/subscriptions","organizations_url":"https://api.github.com/users/algolia/orgs","repos_url":"https://api.github.com/users/algolia/repos","events_url":"https://api.github.com/users/algolia/events{/privacy}","received_events_url":"https://api.github.com/users/algolia/received_events","type":"Organization","site_admin":false},"repo":{"id":39443258,"node_id":"MDEwOlJlcG9zaXRvcnkzOTQ0MzI1OA==","name":"instantsearch.js","full_name":"algolia/instantsearch.js","private":false,"owner":{"login":"algolia","id":2034458,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMzQ0NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/2034458?v=4","gravatar_id":"","url":"https://api.github.com/users/algolia","html_url":"https://github.com/algolia","followers_url":"https://api.github.com/users/algolia/followers","following_url":"https://api.github.com/users/algolia/following{/other_user}","gists_url":"https://api.github.com/users/algolia/gists{/gist_id}","starred_url":"https://api.github.com/users/algolia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/algolia/subscriptions","organizations_url":"https://api.github.com/users/algolia/orgs","repos_url":"https://api.github.com/users/algolia/repos","events_url":"https://api.github.com/users/algolia/events{/privacy}","received_events_url":"https://api.github.com/users/algolia/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/algolia/instantsearch.js","description":":zap: A JavaScript library for building performant and instant search experiences with Algolia.","fork":false,"url":"https://api.github.com/repos/algolia/instantsearch.js","forks_url":"https://api.github.com/repos/algolia/instantsearch.js/forks","keys_url":"https://api.github.com/repos/algolia/instantsearch.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/algolia/instantsearch.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/algolia/instantsearch.js/teams","hooks_url":"https://api.github.com/repos/algolia/instantsearch.js/hooks","issue_events_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/events{/number}","events_url":"https://api.github.com/repos/algolia/instantsearch.js/events","assignees_url":"https://api.github.com/repos/algolia/instantsearch.js/assignees{/user}","branches_url":"https://api.github.com/repos/algolia/instantsearch.js/branches{/branch}","tags_url":"https://api.github.com/repos/algolia/instantsearch.js/tags","blobs_url":"https://api.github.com/repos/algolia/instantsearch.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/algolia/instantsearch.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/algolia/instantsearch.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/algolia/instantsearch.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/algolia/instantsearch.js/statuses/{sha}","languages_url":"https://api.github.com/repos/algolia/instantsearch.js/languages","stargazers_url":"https://api.github.com/repos/algolia/instantsearch.js/stargazers","contributors_url":"https://api.github.com/repos/algolia/instantsearch.js/contributors","subscribers_url":"https://api.github.com/repos/algolia/instantsearch.js/subscribers","subscription_url":"https://api.github.com/repos/algolia/instantsearch.js/subscription","commits_url":"https://api.github.com/repos/algolia/instantsearch.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/algolia/instantsearch.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/algolia/instantsearch.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/algolia/instantsearch.js/contents/{+path}","compare_url":"https://api.github.com/repos/algolia/instantsearch.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/algolia/instantsearch.js/merges","archive_url":"https://api.github.com/repos/algolia/instantsearch.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/algolia/instantsearch.js/downloads","issues_url":"https://api.github.com/repos/algolia/instantsearch.js/issues{/number}","pulls_url":"https://api.github.com/repos/algolia/instantsearch.js/pulls{/number}","milestones_url":"https://api.github.com/repos/algolia/instantsearch.js/milestones{/number}","notifications_url":"https://api.github.com/repos/algolia/instantsearch.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/algolia/instantsearch.js/labels{/name}","releases_url":"https://api.github.com/repos/algolia/instantsearch.js/releases{/id}","deployments_url":"https://api.github.com/repos/algolia/instantsearch.js/deployments","created_at":"2015-07-21T12:10:27Z","updated_at":"2018-12-21T15:20:06Z","pushed_at":"2018-12-21T16:17:24Z","git_url":"git://github.com/algolia/instantsearch.js.git","ssh_url":"git@github.com:algolia/instantsearch.js.git","clone_url":"https://github.com/algolia/instantsearch.js.git","svn_url":"https://github.com/algolia/instantsearch.js","homepage":"https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/","size":271537,"stargazers_count":2128,"watchers_count":2128,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":311,"mirror_url":null,"archived":false,"open_issues_count":131,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":311,"open_issues":131,"watchers":2128,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/algolia/instantsearch.js/pulls/3376"},"html":{"href":"https://github.com/algolia/instantsearch.js/pull/3376"},"issue":{"href":"https://api.github.com/repos/algolia/instantsearch.js/issues/3376"},"comments":{"href":"https://api.github.com/repos/algolia/instantsearch.js/issues/3376/comments"},"review_comments":{"href":"https://api.github.com/repos/algolia/instantsearch.js/pulls/3376/comments"},"review_comment":{"href":"https://api.github.com/repos/algolia/instantsearch.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/algolia/instantsearch.js/pulls/3376/commits"},"statuses":{"href":"https://api.github.com/repos/algolia/instantsearch.js/statuses/09815e72f7341b80fcb280e49b4e8ef82ab24129"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"tkrugg"}}