spotify-embed
Advanced tools
Comparing version 1.5.0 to 1.6.0
@@ -1,12 +0,1 @@ | ||
/** | ||
* - - - - - - - - | ||
* spotify-embed | ||
* Author: Gabb-c | ||
* License: MIT | ||
* Version: 1.5.0 | ||
* CI/CD: GitHub Actions | ||
* - - - - - - - - | ||
*/ | ||
/// <reference types="react" /> | ||
/** List of available embed spotify URL's */ | ||
@@ -51,3 +40,3 @@ declare enum SpotifyEmbedUrl { | ||
*/ | ||
declare const urlParser: (url: string, theme?: 'light' | 'dark') => string; | ||
declare const urlParser: (url: string, theme?: "light" | "dark") => string; | ||
/** | ||
@@ -58,5 +47,5 @@ * @param uri - The Spotify resource URI | ||
*/ | ||
declare const uriParser: (uri: string, theme?: 'light' | 'dark') => string; | ||
declare const uriParser: (uri: string, theme?: "light" | "dark") => string; | ||
interface SpotifyEmbedProps extends Omit<React.IframeHTMLAttributes<HTMLIFrameElement>, 'allow-transparency' | 'frameBorder' | 'aria-label' | 'allow'> { | ||
interface SpotifyEmbedProps extends Omit<React.IframeHTMLAttributes<HTMLIFrameElement>, "allow-transparency" | "frameBorder" | "aria-label" | "allow"> { | ||
/** | ||
@@ -66,3 +55,3 @@ * The size of the embed | ||
*/ | ||
size?: 'default' | 'compact' | 'custom'; | ||
size?: "default" | "compact" | "custom"; | ||
/** | ||
@@ -77,3 +66,3 @@ * The Spotify resource URL/URI | ||
*/ | ||
theme?: 'light' | 'dark'; | ||
theme?: "light" | "dark"; | ||
} | ||
@@ -80,0 +69,0 @@ /** |
@@ -1,12 +0,1 @@ | ||
/** | ||
* - - - - - - - - | ||
* spotify-embed | ||
* Author: Gabb-c | ||
* License: MIT | ||
* Version: 1.5.0 | ||
* CI/CD: GitHub Actions | ||
* - - - - - - - - | ||
*/ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,s,r,p,o=require("react/jsx-runtime");exports.SpotifyEmbedUrl=void 0,(e=exports.SpotifyEmbedUrl||(exports.SpotifyEmbedUrl={})).TRACK="https://open.spotify.com/embed/track/",e.ALBUM="https://open.spotify.com/embed/album/",e.PLAYLIST="https://open.spotify.com/embed/playlist/",e.ARTIST="https://open.spotify.com/embed/artist/",e.SHOW="https://open.spotify.com/embed/show/",e.EPISODE="https://open.spotify.com/embed/episode/",exports.SpotifyEmbedTypes=void 0,(t=exports.SpotifyEmbedTypes||(exports.SpotifyEmbedTypes={})).TRACK="track",t.ALBUM="album",t.PLAYLIST="playlist",t.ARTIST="artist",t.SHOW="show",t.EPISODE="episode",exports.Default=void 0,(s=exports.Default||(exports.Default={}))[s.WIDTH=300]="WIDTH",s[s.HEIGHT=380]="HEIGHT",exports.Compact=void 0,(r=exports.Compact||(exports.Compact={}))[r.WIDTH=300]="WIDTH",r[r.HEIGHT=80]="HEIGHT",exports.Themes=void 0,(p=exports.Themes||(exports.Themes={})).LIGHT="1",p.DARK="0";const i=(e,t,s)=>{const r="dark"===s?exports.Themes.DARK:exports.Themes.LIGHT;switch(e){case exports.SpotifyEmbedTypes.ALBUM:return exports.SpotifyEmbedUrl.ALBUM+t+`?theme=${r}`;case exports.SpotifyEmbedTypes.ARTIST:return exports.SpotifyEmbedUrl.ARTIST+t+`?theme=${r}`;case exports.SpotifyEmbedTypes.EPISODE:return exports.SpotifyEmbedUrl.EPISODE+t+`?theme=${r}`;case exports.SpotifyEmbedTypes.PLAYLIST:return exports.SpotifyEmbedUrl.PLAYLIST+t+`?theme=${r}`;case exports.SpotifyEmbedTypes.SHOW:return exports.SpotifyEmbedUrl.SHOW+t+`?theme=${r}`;case exports.SpotifyEmbedTypes.TRACK:return exports.SpotifyEmbedUrl.TRACK+t+`?theme=${r}`;default:return""}},m=(e,t)=>{if(0===e.length||!e.startsWith("https://open.spotify.com/"))return"";const s=e.split("/");return i(s[3],s[4]?.split("?")[0],t)},a=(e,t)=>{if(0===e.length||!e.startsWith("spotify"))return"";const s=e.split(":");return i(s[1],s[2],t)},d=e=>{const{size:t="default",src:s="",width:r=exports.Default.WIDTH,height:p=exports.Default.HEIGHT,theme:i="light"}=e;return o.jsx(o.Fragment,{children:o.jsx("iframe",{...e,src:""===m(s)?a(s,i):m(s,i),width:"default"===t?exports.Default.WIDTH:"custom"===t?r:exports.Compact.WIDTH,height:"default"===t?exports.Default.HEIGHT:"custom"===t?p:exports.Compact.HEIGHT,frameBorder:"0","aria-label":"spotify-embed",allow:"autoplay; transparency; clipboard-write; encrypted-media; fullscreen; picture-in-picture"})})};d.defaultProps={size:"default",src:"",width:exports.Default.WIDTH,height:exports.Default.HEIGHT,theme:"light"},exports.SpotifyEmbed=d,exports.uriParser=a,exports.urlParser=m; | ||
//# sourceMappingURL=index.js.map | ||
var l=Object.defineProperty;var c=(e,t)=>l(e,"name",{value:t,configurable:!0});var o;(function(e){e.TRACK="https://open.spotify.com/embed/track/",e.ALBUM="https://open.spotify.com/embed/album/",e.PLAYLIST="https://open.spotify.com/embed/playlist/",e.ARTIST="https://open.spotify.com/embed/artist/",e.SHOW="https://open.spotify.com/embed/show/",e.EPISODE="https://open.spotify.com/embed/episode/"})(o||(o={}));var s;(function(e){e.TRACK="track",e.ALBUM="album",e.PLAYLIST="playlist",e.ARTIST="artist",e.SHOW="show",e.EPISODE="episode"})(s||(s={}));var a;(function(e){e[e.WIDTH=300]="WIDTH",e[e.HEIGHT=380]="HEIGHT"})(a||(a={}));var i;(function(e){e[e.WIDTH=300]="WIDTH",e[e.HEIGHT=80]="HEIGHT"})(i||(i={}));var p;(function(e){e.LIGHT="1",e.DARK="0"})(p||(p={}));var T=c((e,t,r)=>{let n=r==="dark"?p.DARK:p.LIGHT;switch(e){case s.ALBUM:return`${o.ALBUM}${t}?theme=${n}`;case s.ARTIST:return`${o.ARTIST}${t}?theme=${n}`;case s.EPISODE:return`${o.EPISODE}${t}?theme=${n}`;case s.PLAYLIST:return`${o.PLAYLIST}${t}?theme=${n}`;case s.SHOW:return`${o.SHOW}${t}?theme=${n}`;case s.TRACK:return`${o.TRACK}${t}?theme=${n}`;default:return""}},"buildUrl"),h=c((e,t)=>{if(e.length===0||!e.startsWith("https://open.spotify.com/"))return"";let r=e.split("/");return T(r[3],r[4]?.split("?")[0],t)},"urlParser"),u=c((e,t)=>{if(e.length===0||!e.startsWith("spotify"))return"";let r=e.split(":");return T(r[1],r[2],t)},"uriParser");var I=c(e=>{let{size:t="default",src:r="",width:n=a.WIDTH,height:H=a.HEIGHT,theme:m="light"}=e;return React.createElement(React.Fragment,null,React.createElement("iframe",{...e,src:h(r)===""?u(r,m):h(r,m),width:t==="default"?a.WIDTH:t==="custom"?n:i.WIDTH,height:t==="default"?a.HEIGHT:t==="custom"?H:i.HEIGHT,"aria-label":"spotify-embed",allow:"autoplay; transparency; clipboard-write; encrypted-media; fullscreen; picture-in-picture"}))},"SpotifyEmbed");I.defaultProps={size:"default",src:"",width:a.WIDTH,height:a.HEIGHT,theme:"light"};export{i as Compact,a as Default,I as SpotifyEmbed,s as SpotifyEmbedTypes,o as SpotifyEmbedUrl,p as Themes,u as uriParser,h as urlParser}; |
144
package.json
{ | ||
"name": "spotify-embed", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"private": false, | ||
@@ -24,2 +24,3 @@ "description": "A spotify embed component", | ||
}, | ||
"type": "module", | ||
"main": "lib/index.js", | ||
@@ -32,93 +33,65 @@ "module": "lib/index.esm.js", | ||
"scripts": { | ||
"build": "rollup -c", | ||
"build-storybook": "build-storybook", | ||
"build-storybook-docs": "build-storybook --docs --quiet", | ||
"build:watch": "rollup -c -w", | ||
"format": "prettier 'src/**/*.[jt]s?(x)' --write", | ||
"lint": "eslint src --ext js,jsx,ts,tsx", | ||
"lint:fix": "eslint src --ext js,jsx,ts,tsx --fix", | ||
"build": "tsup --config tsup.config.ts", | ||
"build-storybook": "storybook build", | ||
"build-storybook-docs": "storybook build --docs", | ||
"format": "rome format ./src", | ||
"format:fix": "rome format --write ./src", | ||
"lint": "rome check src", | ||
"lint:fix": "rome check --apply-unsafe ./src", | ||
"lint:tsc": "tsc --diagnostics", | ||
"prepare": "is-ci || husky install", | ||
"prepublishOnly": "yarn build", | ||
"run:dev": "NODE_OPTIONS='--trace-deprecation --abort-on-uncaught-exception' tsnd --respawn --transpile-only --rs --pretty --log-error --compiler-options \"{\\\"module\\\":\\\"commonjs\\\"}\"", | ||
"storybook": "start-storybook -p 6006", | ||
"storybook-docs": "start-storybook --docs --no-manager-cache", | ||
"test:ci": "jest --ci --runInBand --bail --detectOpenHandles --errorOnDeprecated", | ||
"test:cov": "jest --coverage", | ||
"test:dev": "jest --verbose --colors --expand --maxWorkers=50% --detectOpenHandles --errorOnDeprecated --bail", | ||
"test:types": "yarn tsd", | ||
"test:watch": "jest --watch --verbose --colors --expand --detectOpenHandles --errorOnDeprecated --bail --maxWorkers=25%" | ||
"prepublishOnly": "pnpm build", | ||
"storybook": "storybook dev -p 6006", | ||
"test-storybook": "test-storybook", | ||
"test-storybook-coverage": "test-storybook --coverage", | ||
"test:ci": "vitest --silent --run", | ||
"test:coverage": "vitest run --coverage", | ||
"test:dev": "vitest -w", | ||
"test:ui": "vitest --ui --api 9527" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@babel/core": "^7.19.1", | ||
"@commitlint/cli": "^17.1.2", | ||
"@commitlint/config-conventional": "^17.1.0", | ||
"@rollup/plugin-commonjs": "^22.0.2", | ||
"@rollup/plugin-node-resolve": "^14.1.0", | ||
"@semantic-release/changelog": "^6.0.1", | ||
"@commitlint/cli": "^17.6.3", | ||
"@commitlint/config-conventional": "^17.6.3", | ||
"@semantic-release/changelog": "^6.0.3", | ||
"@semantic-release/commit-analyzer": "^9.0.2", | ||
"@semantic-release/git": "^10.0.1", | ||
"@semantic-release/github": "^8.0.6", | ||
"@semantic-release/npm": "^9.0.1", | ||
"@semantic-release/release-notes-generator": "^10.0.3", | ||
"@storybook/addon-a11y": "^6.5.12", | ||
"@storybook/addon-actions": "^6.5.12", | ||
"@storybook/addon-controls": "^6.5.12", | ||
"@storybook/addon-essentials": "^6.5.12", | ||
"@storybook/addon-links": "^6.5.12", | ||
"@storybook/addon-postcss": "^2.0.0", | ||
"@storybook/addon-storysource": "^6.5.12", | ||
"@storybook/builder-webpack5": "^6.5.12", | ||
"@storybook/manager-webpack5": "^6.5.12", | ||
"@storybook/react": "^6.5.12", | ||
"@swc/core": "^1.3.3", | ||
"@swc/jest": "^0.2.22", | ||
"@testing-library/dom": "^8.18.1", | ||
"@testing-library/jest-dom": "^5.16.5", | ||
"@testing-library/react": "^13.4.0", | ||
"@semantic-release/github": "^8.0.7", | ||
"@semantic-release/npm": "^10.0.3", | ||
"@semantic-release/release-notes-generator": "^11.0.1", | ||
"@storybook/addon-coverage": "^0.0.8", | ||
"@storybook/addon-docs": "^7.0.12", | ||
"@storybook/addon-essentials": "7.0.12", | ||
"@storybook/addon-interactions": "7.0.12", | ||
"@storybook/addon-links": "7.0.12", | ||
"@storybook/blocks": "7.0.12", | ||
"@storybook/react": "7.0.12", | ||
"@storybook/react-vite": "7.0.12", | ||
"@storybook/test-runner": "^0.10.0", | ||
"@storybook/testing-library": "0.1.0", | ||
"@swc/core": "^1.3.59", | ||
"@testing-library/dom": "^9.3.0", | ||
"@testing-library/react": "^14.0.0", | ||
"@testing-library/user-event": "^14.4.3", | ||
"@types/bluebird": "^3.5.36", | ||
"@types/jest": "^29.0.3", | ||
"@types/node": "^18.7.18", | ||
"@types/react": "^18.0.21", | ||
"@types/react-dom": "^18.0.6", | ||
"@typescript-eslint/eslint-plugin": "^5.38.0", | ||
"@typescript-eslint/parser": "^5.38.0", | ||
"ci-info": "^3.4.0", | ||
"eslint": "^8.23.1", | ||
"eslint-config-airbnb-typescript": "^17.0.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-eslint-comments": "^3.2.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-jest": "^27.0.4", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-storybook": "^0.6.4", | ||
"eslint-plugin-unicorn": "^43.0.2", | ||
"husky": "^8.0.1", | ||
"@types/bluebird": "^3.5.38", | ||
"@types/node": "^20.2.1", | ||
"@types/react": "^18.2.6", | ||
"@types/react-dom": "^18.2.4", | ||
"@vitejs/plugin-react": "^4.0.0", | ||
"@vitest/coverage-c8": "^0.31.1", | ||
"@vitest/ui": "^0.31.1", | ||
"ci-info": "^3.8.0", | ||
"husky": "^8.0.3", | ||
"is-ci": "^3.0.1", | ||
"jest": "^29.0.3", | ||
"jest-environment-jsdom": "^29.0.3", | ||
"jest-transform-stub": "^2.0.0", | ||
"lint-staged": "^13.0.3", | ||
"prettier": "^2.7.1", | ||
"jsdom": "^22.0.0", | ||
"lint-staged": "^13.2.2", | ||
"prop-types": "15.8.1", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"rollup": "^2.79.1", | ||
"rollup-plugin-analyzer": "^4.0.0", | ||
"rollup-plugin-banner2": "^1.2.2", | ||
"rollup-plugin-delete": "^2.0.0", | ||
"rollup-plugin-dts": "^4.2.2", | ||
"rollup-plugin-peer-deps-external": "^2.2.4", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-typescript2": "^0.34.0", | ||
"rollup-plugin-visualizer": "^5.8.1", | ||
"semantic-release": "^19.0.5", | ||
"sort-package-json": "^1.57.0", | ||
"storybook-addon-outline": "^1.4.2", | ||
"ts-node-dev": "^2.0.0", | ||
"ts-toolbelt": "^9.6.0", | ||
"tsd": "^0.24.1", | ||
"tslib": "^2.4.0", | ||
"typescript": "^4.8.3", | ||
"webpack": "^5.74.0" | ||
"rome": "12.1.2", | ||
"semantic-release": "^21.0.2", | ||
"sort-package-json": "^2.4.1", | ||
"storybook": "7.0.12", | ||
"tsup": "^6.7.0", | ||
"typescript": "^5.0.4", | ||
"vitest": "^0.31.1" | ||
}, | ||
@@ -130,7 +103,4 @@ "peerDependencies": { | ||
"engines": { | ||
"node": ">=12.x.x" | ||
}, | ||
"tsd": { | ||
"directory": "./src/__tests__" | ||
"node": ">=14.x.x" | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
44
1
Yes
14359
6
89
1