This commit is contained in:
rui hildt 2020-07-23 21:30:58 +02:00
commit 0afc771a60
16 changed files with 199 additions and 0 deletions

19
asset-manifest.json Normal file
View File

@ -0,0 +1,19 @@
{
"files": {
"main.js": "/spoti-search/static/js/main.d5729ca7.chunk.js",
"main.js.map": "/spoti-search/static/js/main.d5729ca7.chunk.js.map",
"runtime-main.js": "/spoti-search/static/js/runtime-main.c30f5be2.js",
"runtime-main.js.map": "/spoti-search/static/js/runtime-main.c30f5be2.js.map",
"static/js/2.f5c50d49.chunk.js": "/spoti-search/static/js/2.f5c50d49.chunk.js",
"static/js/2.f5c50d49.chunk.js.map": "/spoti-search/static/js/2.f5c50d49.chunk.js.map",
"index.html": "/spoti-search/index.html",
"precache-manifest.ddc2f33480751a029d100cd7d0e001f4.js": "/spoti-search/precache-manifest.ddc2f33480751a029d100cd7d0e001f4.js",
"service-worker.js": "/spoti-search/service-worker.js",
"static/js/2.f5c50d49.chunk.js.LICENSE.txt": "/spoti-search/static/js/2.f5c50d49.chunk.js.LICENSE.txt"
},
"entrypoints": [
"static/js/runtime-main.c30f5be2.js",
"static/js/2.f5c50d49.chunk.js",
"static/js/main.d5729ca7.chunk.js"
]
}

BIN
favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

1
index.html Normal file
View File

@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/spoti-search/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="A frontend to search for an artist and display its albums"/><link rel="apple-touch-icon" href="/spoti-search/logo192.png"/><link rel="manifest" href="/spoti-search/manifest.json"/><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"/><title>Spoti Search</title><style>body{margin:0}</style></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,a=r[0],l=r[1],p=r[2],f=0,s=[];f<a.length;f++)i=a[f],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&s.push(o[i][0]),o[i]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n]);for(c&&c(r);s.length;)s.shift()();return u.push.apply(u,p||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var l=t[a];0!==o[l]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/spoti-search/";var a=this["webpackJsonpspoti-search"]=this["webpackJsonpspoti-search"]||[],l=a.push.bind(a);a.push=r,a=a.slice();for(var p=0;p<a.length;p++)r(a[p]);var c=l;t()}([])</script><script src="/spoti-search/static/js/2.f5c50d49.chunk.js"></script><script src="/spoti-search/static/js/main.d5729ca7.chunk.js"></script></body></html>

BIN
logo192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
logo512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

25
manifest.json Normal file
View File

@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

View File

@ -0,0 +1,22 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "bd4e2216d96b60e23b76ec8e9ae16d5c",
"url": "/spoti-search/index.html"
},
{
"revision": "d91e41b9eb2072aa0092",
"url": "/spoti-search/static/js/2.f5c50d49.chunk.js"
},
{
"revision": "150ff86ada6d4117f6d430f6acba325e",
"url": "/spoti-search/static/js/2.f5c50d49.chunk.js.LICENSE.txt"
},
{
"revision": "dd7dd0cfc148390dd40c",
"url": "/spoti-search/static/js/main.d5729ca7.chunk.js"
},
{
"revision": "d8701ba7eff8f72dc134",
"url": "/spoti-search/static/js/runtime-main.c30f5be2.js"
}
]);

3
robots.txt Normal file
View File

@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

39
service-worker.js Normal file
View File

@ -0,0 +1,39 @@
/**
* Welcome to your Workbox-powered service worker!
*
* You'll need to register this file in your web app and you should
* disable HTTP caching for this file too.
* See https://goo.gl/nhQhGp
*
* The rest of the code is auto-generated. Please don't update this file
* directly; instead, make changes to your Workbox build configuration
* and re-run your build process.
* See https://goo.gl/2aRDsh
*/
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
importScripts(
"/spoti-search/precache-manifest.ddc2f33480751a029d100cd7d0e001f4.js"
);
self.addEventListener('message', (event) => {
if (event.data && event.data.type === 'SKIP_WAITING') {
self.skipWaiting();
}
});
workbox.core.clientsClaim();
/**
* The workboxSW.precacheAndRoute() method efficiently caches and responds to
* requests for URLs in the manifest.
* See https://goo.gl/S9QRab
*/
self.__precacheManifest = [].concat(self.__precacheManifest || []);
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/spoti-search/index.html"), {
blacklist: [/^\/_/,/\/[^/?]+\.[^/]+$/],
});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,80 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** @license React v0.19.1
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.13.1
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.13.1
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(this["webpackJsonpspoti-search"]=this["webpackJsonpspoti-search"]||[]).push([[0],{115:function(e,t,a){e.exports=a(131)},131:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),l=a(33),c=a.n(l),i=a(56),s=a(57),o=a(88),u=a(82),m=a(51),g=a(91),h=a(147),p=a(92),d=a(76),f=a(89),b=a(148),E=function(e){return r.a.createElement(b.a,Object.assign({as:"header",direction:"row",align:"center",justify:"center",background:"brand",pad:{left:"medium",right:"small",vertical:"small"},style:{zIndex:1}},e))},v=a(144),y=a(145),j=function(e){var t=e.inputValue,a=e.handleChange,n=e.suggestions,l=e.handleSelect;return r.a.createElement(b.a,{as:"section",direction:"row",justify:"center",margin:{vertical:"large"}},r.a.createElement(v.a,{value:t,onChange:a,onSelect:l,placeholder:"Type an artist name",icon:r.a.createElement(y.a,{color:"plain"}),dropHeight:"large",suggestions:n}))},O=a(151),S=a(149),w=a(146),x=a(143),k=a(150),A=function(e){var t=e.image,a=e.name;return r.a.createElement(b.a,{round:"xxsmall",elevation:"small",overflow:"hidden"},r.a.createElement(b.a,{height:"300px"},r.a.createElement(S.a,{src:t,fit:"cover"})),r.a.createElement(b.a,{pad:{horizontal:"small"}},r.a.createElement(b.a,{margin:{top:"small"},direction:"row",align:"center",justify:"between"},r.a.createElement(b.a,null,r.a.createElement(k.a,{level:"4",margin:{bottom:"small",top:"xsmall"}},a)))))},q=function(e){var t=e.artists,a=t[0],n=a.name,l=a.image,c=a.albums;return r.a.createElement(O.a,{rows:["fit","fit"],columns:["1/4","3/4"],gap:"small",areas:[["artist","other"],["discography","discography"]]},r.a.createElement(b.a,{gridArea:"artist",height:"300px"},r.a.createElement("h1",null,n),r.a.createElement(S.a,{src:l,fit:"cover"})),r.a.createElement(b.a,{gridArea:"other",background:"light-2"},r.a.createElement("h3",null,"Other results"),t.map((function(e){return r.a.createElement(b.a,{gridArea:"artist",key:e.id},r.a.createElement(w.a,{src:e.image}),r.a.createElement("h4",null,e.name))}))),r.a.createElement(x.a.Consumer,null,(function(e){return r.a.createElement(O.a,{gridArea:"discography",align:"start",columns:{count:"fill",size:"300px"},gap:"medium"},r.a.createElement(k.a,{level:"1"},"Discography"),c.map((function(e){return r.a.createElement(A,{key:e.id,image:e.image,name:e.name})})))})))};function C(){var e=Object(g.a)(["\n\tquery Artist($byName: String!) {\n\t\tqueryArtists(byName: $byName) {\n\t\t\tname\n\t\t\timage\n\t\t\tid\n\t\t\talbums {\n\t\t\t\tname\n\t\t\t\timage\n\t\t\t\tid\n\t\t\t}\n\t\t}\n\t}\n"]);return C=function(){return e},e}var z=Object(d.a)(C());function N(){var e=Object(n.useState)(""),t=Object(m.a)(e,2),a=t[0],l=t[1],c=Object(f.a)(z),i=Object(m.a)(c,2),s=i[0],o=i[1].data,g=Object(n.useState)([]),d=Object(m.a)(g,2),b=d[0],v=d[1],y=Object(n.useState)(),O=Object(m.a)(y,2),S=O[0],w=O[1],x=Object(n.useState)(!1),k=Object(m.a)(x,2),A=k[0],C=k[1],N=Object(n.useCallback)(Object(p.debounce)((function(){s({variables:{byName:a}})}),500),[a]);Object(n.useEffect)((function(){return N(),N.cancel}),[a,N]);return Object(n.useEffect)((function(){if(o&&o.queryArtists!==[]){var e=o.queryArtists.slice(0,5).map((function(e){return e.name}));w(e)}}),[o]),r.a.createElement(h.a,{theme:I},r.a.createElement(E,null,r.a.createElement("h1",null,"Spoti Search")),r.a.createElement(j,{inputValue:a,handleChange:function(e){l(e.target.value)},suggestions:S,handleSelect:function(e){for(var t=e.suggestion,a=[],n=o.queryArtists.slice(0,5).map((function(e){return e})),r=0;r<n.length;r++)if(n[r].name===t){var l=null===n||void 0===n?void 0:n.splice(r,1),c=n;a=[].concat(Object(u.a)(l),Object(u.a)(c));break}v(a),C(!0)}}),A&&r.a.createElement(q,{artists:b}))}var I={global:{font:{family:"Roboto",size:"18px",height:"20px"}}},J=new i.a({uri:"https://spotify-graphql-server.herokuapp.com/graphql",cache:new s.a});c.a.render(r.a.createElement(r.a.StrictMode,null,r.a.createElement(o.a,{client:J},r.a.createElement(N,null))),document.getElementById("root"))}},[[115,1,2]]]);
//# sourceMappingURL=main.d5729ca7.chunk.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
!function(e){function r(r){for(var n,i,a=r[0],l=r[1],p=r[2],f=0,s=[];f<a.length;f++)i=a[f],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&s.push(o[i][0]),o[i]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n]);for(c&&c(r);s.length;)s.shift()();return u.push.apply(u,p||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var l=t[a];0!==o[l]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/spoti-search/";var a=this["webpackJsonpspoti-search"]=this["webpackJsonpspoti-search"]||[],l=a.push.bind(a);a.push=r,a=a.slice();for(var p=0;p<a.length;p++)r(a[p]);var c=l;t()}([]);
//# sourceMappingURL=runtime-main.c30f5be2.js.map

File diff suppressed because one or more lines are too long